[
  {
    "path": ".allstar/binary_artifacts.yaml",
    "content": "# Exemption reason: This repo uses binary artifacts for integration tests.\noptConfig:\n  optOut: true\n"
  },
  {
    "path": ".clusterfuzzlite/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:v1\nCOPY . $SRC/oss-fuzz\nWORKDIR oss-fuzz\nCOPY .clusterfuzzlite/build.sh $SRC/\nRUN cp .clusterfuzzlite/coverage_atheris_fuzzer.py infra\nWORKDIR infra/\nRUN pip3 install --upgrade pip\nRUN pip3 install -r cifuzz/requirements.txt\nRUN cp -r cifuzz/* .\n"
  },
  {
    "path": ".clusterfuzzlite/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfuzzer=coverage_atheris_fuzzer.py\nfuzzer_basename=$(basename -s .py $fuzzer)\nfuzzer_package=${fuzzer_basename}.pkg\n\n# To avoid issues with Python version conflicts, or changes in environment\n# over time on the OSS-Fuzz bots, we use pyinstaller to create a standalone\n# package. Though not necessarily required for reproducing issues, this is\n# required to keep fuzzers working properly in OSS-Fuzz.\npyinstaller --distpath $OUT --onefile --name $fuzzer_package $fuzzer\n\n# Create execution wrapper. Atheris requires that certain libraries are\n# preloaded, so this is also done here to ensure compatibility and simplify\n# test case reproduction. Since this helper script is what OSS-Fuzz will\n# actually execute, it is also always required.\n# NOTE: If you are fuzzing python-only code and do not have native C/C++\n# extensions, then remove the LD_PRELOAD line below as preloading sanitizer\n# library is not required and can lead to unexpected startup crashes.\necho \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_PRELOAD=\\$this_dir/sanitizer_with_fuzzer.so \\\n  ASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$this_dir/llvm-symbolizer:detect_leaks=0 \\\n  \\$this_dir/$fuzzer_package \\$@\" > $OUT/$fuzzer_basename\nchmod +x $OUT/$fuzzer_basename\n"
  },
  {
    "path": ".clusterfuzzlite/coverage_atheris_fuzzer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport json\nimport os\nfrom unittest import mock\nimport sys\n\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nsys.path.append(\n    os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cifuzz'))\n\nwith atheris.instrument_imports():\n  import get_coverage\n\nREPO_PATH = '/src/curl'\nPROJECT_NAME = 'curl'\n\nwith mock.patch('get_coverage._get_oss_fuzz_fuzzer_stats_dir_url',\n                return_value=\"randomurl\"):\n  oss_fuzz_coverage = get_coverage.OSSFuzzCoverage(REPO_PATH, PROJECT_NAME)\n\n\ndef TestOneInput(data):\n  try:\n    decoded_json = json.loads(data)\n  except (json.decoder.JSONDecodeError, UnicodeDecodeError):\n    # Wart\n    return oss_fuzz_coverage.get_files_covered_by_target('fuzz-target')\n\n  with mock.patch('get_coverage.OSSFuzzCoverage.get_target_coverage',\n                  return_value=decoded_json):\n    oss_fuzz_coverage.get_files_covered_by_target('fuzz-target')\n  return 0\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": ".clusterfuzzlite/project.yaml",
    "content": "language: python\n"
  },
  {
    "path": ".dockerignore",
    "content": ".git\n.venv\ninfra/cifuzz/test_data/*\ndocs/*\n\n# Copied from .gitignore.\n.vscode/\n*.pyc\nbuild\n*~\n.DS_Store\n*.swp\n.pytest_cache\n*__pycache__/*"
  },
  {
    "path": ".gitattributes",
    "content": "# Check out Linux shell scripts with LF (necessary when using Docker setup on Windows)\n*.sh text eol=lf\n"
  },
  {
    "path": ".github/header-checker-lint.yml",
    "content": "allowedCopyrightHolders:\n  - 'Google LLC'\nallowedLicenses:\n  - 'Apache-2.0'\nsourceFileExtensions:\n  - 'ts'\n  - 'js'\n  - 'java'\n  - 'Dockerfile'\n  - 'java'\n  - 'c'\n  - 'h'\n  - 'cc'\n  - 'cpp'\n  - 'css'\n  - 'html'\n  - 'htm'\n  - 'go'\n  - 'sh'\n  - 'bash'\n  - 'rs'\n  - 'proto'\n  - 'swift'\n"
  },
  {
    "path": ".github/workflows/cflite_pr.yml",
    "content": "name: ClusterFuzzLite PR fuzzing\non:\n  pull_request:\n    paths:\n      - 'infra/**'\npermissions: read-all\njobs:\n  PR:\n    runs-on: ubuntu-latest\n    concurrency:\n      group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ github.ref }}\n      cancel-in-progress: true\n    strategy:\n      fail-fast: false\n      matrix:\n        sanitizer:\n        - address\n        # Override this with the sanitizers you want.\n        # - undefined\n        # - memory\n    steps:\n    - name: Build Fuzzers (${{ matrix.sanitizer }})\n      id: build\n      uses: google/clusterfuzzlite/actions/build_fuzzers@v1\n      with:\n        language: python\n        github-token: ${{ secrets.GITHUB_TOKEN }}\n        sanitizer: ${{ matrix.sanitizer }}\n        # Optional but recommended: used to only run fuzzers that are affected\n        # by the PR.\n        # See later section on \"Git repo for storage\".\n        # storage-repo: https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/OWNER/STORAGE-REPO-NAME.git\n        # storage-repo-branch: main   # Optional. Defaults to \"main\"\n        # storage-repo-branch-coverage: gh-pages  # Optional. Defaults to \"gh-pages\".\n    - name: Run Fuzzers (${{ matrix.sanitizer }})\n      id: run\n      uses: google/clusterfuzzlite/actions/run_fuzzers@v1\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }}\n        fuzz-seconds: 600\n        mode: 'code-change'\n        sanitizer: ${{ matrix.sanitizer }}\n        # Optional but recommended: used to download the corpus produced by\n        # batch fuzzing.\n        # See later section on \"Git repo for storage\".\n        # storage-repo: https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/OWNER/STORAGE-REPO-NAME.git\n        # storage-repo-branch: main   # Optional. Defaults to \"main\"\n        # storage-repo-branch-coverage: gh-pages  # Optional. Defaults to \"gh-pages\".\n\n"
  },
  {
    "path": ".github/workflows/check_base_os.yml",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nname: 'Check Base OS Consistency'\n\non:\n  pull_request:\n    paths:\n      - 'projects/**'\n\njobs:\n  check-consistency:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n        with:\n          fetch-depth: 0 # Fetch all history to compare with main\n\n      - name: Get changed project directories\n        id: changed-projects\n        run: |\n          # Get the list of changed files compared to the target branch\n          # and filter for unique directories under 'projects/'.\n          CHANGED_DIRS=$(git diff --name-only ${GITHUB_BASE_REF} ${GITHUB_HEAD_REF} | \\\n            grep '^projects/' | \\\n            xargs -n 1 dirname | \\\n            sort -u)\n          echo \"changed_dirs=${CHANGED_DIRS}\" >> $GITHUB_OUTPUT\n\n      - name: Set up Python\n        uses: actions/setup-python@v6\n        with:\n          python-version: '3.x'\n\n      - name: Install dependencies\n        run: pip install PyYAML\n\n      - name: Check each modified project\n        if: steps.changed-projects.outputs.changed_dirs != ''\n        run: |\n          EXIT_CODE=0\n          for project_dir in ${STEPS_CHANGED_PROJECTS_OUTPUTS_CHANGED_DIRS};\n          do\n            echo \"--- Checking ${project_dir} ---\"\n            python3 infra/ci/check_base_os.py \"${project_dir}\" || EXIT_CODE=$?\n          done\n          exit $EXIT_CODE\n        env:\n          STEPS_CHANGED_PROJECTS_OUTPUTS_CHANGED_DIRS: ${{ steps.changed-projects.outputs.changed_dirs }}\n"
  },
  {
    "path": ".github/workflows/codeql-analysis.yml",
    "content": "name: \"CodeQL\"\n\non:\n  push:\n    branches: [ master ]\n    paths: [infra/**, .github/**]\n  pull_request:\n    # The branches below must be a subset of the branches above\n    branches: [ master ]\n    paths: [infra/**, .github/**]\n\njobs:\n  analyze:\n    name: Analyze\n    runs-on: ubuntu-latest\n    permissions:\n      actions: read\n      contents: read\n      security-events: write\n\n    strategy:\n      fail-fast: false\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v6\n\n    # Initializes the CodeQL tools for scanning.\n    - name: Initialize CodeQL\n      uses: github/codeql-action/init@v2\n      with:\n        languages: python\n        # If you wish to specify custom queries, you can do so here or in a config file.\n        # By default, queries listed here will override any specified in a config file.\n        # Prefix the list here with \"+\" to use these queries and those in the config file.\n        # queries: ./path/to/local/query, your-org/your-repo/queries@main\n\n    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).\n    # If this step fails, then you should remove it and run the build manually (see below)\n    - name: Autobuild\n      uses: github/codeql-action/autobuild@v2\n\n    # ℹ️ Command-line programs to run using the OS shell.\n    # 📚 https://git.io/JvXDl\n\n    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines\n    #    and modify them (or add more) to build your code if your project\n    #    uses a compiled language\n\n    #- run: |\n    #   make bootstrap\n    #   make release\n\n    - name: Perform CodeQL Analysis\n      uses: github/codeql-action/analyze@v2\n"
  },
  {
    "path": ".github/workflows/index_build_tests.yml",
    "content": "name: indexer tests\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n    paths:\n      - 'infra/base-images/base-builder/indexer/**'\n      - '.github/workflows/index_build_tests.yml'\n\njobs:\n  'indexer':\n    runs-on: ubuntu-latest\n    permissions:\n      actions: write\n    concurrency:\n      group: ${{ github.workflow }}-${{ github.ref }}\n      cancel-in-progress: true\n    steps:\n      - uses: actions/checkout@v6\n        with:  # Needed for git diff to work. (get_changed_files)\n          fetch-depth: 0\n      - run: |\n          git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master\n\n      - name: Setup python environment\n        uses: actions/setup-python@v6\n        with:\n          python-version: 3.11\n\n      - name: Get latest indexer binary\n        run: curl -O https://clusterfuzz-builds.storage.googleapis.com/oss-fuzz-artifacts/indexer && chmod +x indexer\n        working-directory: 'infra/base-images/base-builder/indexer'\n\n      - name: Run indexer tests\n        run: sudo env \"PATH=$PATH\" INDEX_BUILD_TESTS=1 python -m unittest index_build_test\n        working-directory: 'infra/base-images/base-builder/indexer'\n"
  },
  {
    "path": ".github/workflows/indexer_build.yml",
    "content": "name: indexer build tests\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n    paths:\n      - 'infra/indexer/**'\n      - '.github/workflows/indexer_build.yml'\n\njobs:\n  indexer:\n    runs-on: ubuntu-latest\n    permissions:\n      actions: write\n    concurrency:\n      group: ${{ github.workflow }}-${{ github.ref }}\n      cancel-in-progress: true\n    steps:\n      - uses: actions/checkout@v6\n        with:  # Needed for git diff to work. (get_changed_files)\n          fetch-depth: 0\n      - run: |\n          git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master\n\n      - name: Build indexer\n        run: docker build -t indexer .\n        working-directory: 'infra/indexer'"
  },
  {
    "path": ".github/workflows/infra_tests.yml",
    "content": "name: Infra tests\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n    paths:\n      - 'infra/**'\n      - '.github/workflows/**'\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    permissions:\n      actions: write\n    concurrency:\n      group: ${{ github.workflow }}-${{ github.ref }}\n      cancel-in-progress: true\n    steps:\n      - uses: actions/checkout@v6\n        with:  # Needed for git diff to work. (get_changed_files)\n          fetch-depth: 0\n      - run: |\n          git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master\n\n      - name: Setup python environment\n        uses: actions/setup-python@v6\n        with:\n          python-version: 3.11\n\n      # For gcloud emulators.\n      - name: Setup Java environment\n        uses: actions/setup-java@v5\n        with:\n          java-version: '21'\n          distribution: 'temurin'\n\n      - name: Install dependencies\n        run: |\n          sudo env \"PATH=$PATH\" python -m pip install --upgrade pip\n          sudo env \"PATH=$PATH\" pip install -r infra/ci/requirements.txt\n          sudo env \"PATH=$PATH\" pip install -r infra/build/functions/requirements.txt\n          sudo env \"PATH=$PATH\" pip install -r infra/cifuzz/requirements.txt\n\n      - uses: google-github-actions/setup-gcloud@v3\n        with:\n          version: '523.0.0'\n      - run: |\n          sudo env \"PATH=$PATH\" gcloud components install beta cloud-datastore-emulator\n\n      - name: Run infra tests\n        run: sudo env \"PATH=$PATH\" END_TO_END_TESTS=1 INTEGRATION_TESTS=1 python infra/presubmit.py infra-tests -p\n"
  },
  {
    "path": ".github/workflows/pr_helper.yml",
    "content": "name: PR helper\non:\n  pull_request_target:\n    types: [opened]\n    branches:\n      - master\n    paths:\n      - 'projects/**'\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    permissions:\n      contents: read\n      pull-requests: write\n\n    steps:\n      - uses: actions/checkout@v6\n      - name: Setup python environment\n        uses: actions/setup-python@v6\n        with:\n          python-version: 3.11\n          cache: pip\n          cache-dependency-path: |\n            infra/ci/requirements.txt\n\n      - name: Install dependencies\n        run: |\n          python -m pip install --upgrade pip\n          pip install -r infra/ci/requirements.txt\n\n      - name: setup go environment\n        uses: actions/setup-go@v6\n        with:\n          go-version: 'stable'\n      - run: go install github.com/ossf/criticality_score/cmd/criticality_score@latest\n\n      - name: Check if authors are authorized to modify.\n        id: checkAuthor\n        env:\n          GITHUBTOKEN: ${{secrets.GITHUB_TOKEN}}\n          PRAUTHOR: ${{ github.event.pull_request.user.login }}\n          PRNUMBER: ${{ github.event.pull_request.number }} \n        run: python infra/pr_helper.py\n\n      - name: Leave comments\n        if: env.IS_INTERNAL == 'FALSE'\n        uses: actions/github-script@v8\n        with:\n          github-token: ${{secrets.GITHUB_TOKEN}}\n          script: |\n            github.rest.issues.createComment({\n              issue_number: context.issue.number,\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              body: process.env.MESSAGE\n            })\n\n      - name: Add labels for valid PR\n        if: env.IS_READY_FOR_MERGE == 'True'\n        uses: actions/github-script@v8\n        with:\n          script: |\n            github.rest.issues.addLabels({\n              issue_number: context.issue.number,\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              labels: ['Ready to merge']\n            })\n"
  },
  {
    "path": ".github/workflows/presubmit.yml",
    "content": "name: Presubmit checks\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n    branches:\n    - master\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    permissions:\n      actions: write\n    concurrency:\n      group: ${{ github.workflow }}-${{ github.ref }}\n      cancel-in-progress: true\n    steps:\n\n      - uses: actions/checkout@v6\n        with:  # Needed for git diff to work. (get_changed_files)\n          fetch-depth: 0\n      - run: |\n          git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master\n\n      - name: Setup python environment\n        uses: actions/setup-python@v6\n        with:\n          python-version: 3.11\n          cache: pip\n          cache-dependency-path: |\n            infra/ci/requirements.txt\n            infra/build/functions/requirements.txt\n\n      - name: Install dependencies\n        run: |\n          python -m pip install --upgrade pip\n          pip install -r infra/ci/requirements.txt\n          pip install -r infra/build/functions/requirements.txt\n\n      - name: Run presubmit checks\n        run: python infra/presubmit.py\n"
  },
  {
    "path": ".github/workflows/project_tests.yml",
    "content": "name: Project tests\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n    branches:\n    - master\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    concurrency:\n      group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ matrix.engine }}-${{ matrix.architecture }}-${{ github.ref }}\n      cancel-in-progress: true\n    permissions:\n      actions: write\n    strategy:\n      fail-fast: false\n      matrix:\n        engine:\n          - libfuzzer\n        sanitizer:\n          - address\n          - memory\n          - undefined\n          - coverage\n        architecture:\n          - x86_64\n        include:\n          - engine: afl\n            sanitizer: address\n            architecture: x86_64\n          - engine: honggfuzz\n            sanitizer: address\n            architecture: x86_64\n          - engine: libfuzzer\n            sanitizer: address\n            architecture: i386\n          - engine: none\n            sanitizer: address\n            architecture: x86_64\n          - engine: centipede\n            sanitizer: address\n            architecture: x86_64\n          - engine: centipede\n            sanitizer: none\n            architecture: x86_64\n    env:\n      ENGINE: ${{ matrix.engine }}\n      SANITIZER: ${{ matrix.sanitizer }}\n      ARCHITECTURE: ${{ matrix.architecture }}\n\n    steps:\n      - uses: actions/checkout@v6\n        with:  # Needed for git diff to work. (get_changed_files)\n          fetch-depth: 0\n      - run: |\n          git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master\n\n      - name: Clear unnecessary files\n        run: |\n          df -h\n          sudo swapoff -a\n          sudo rm -f /swapfile\n          sudo apt clean\n          docker rmi $(docker images -a -q) || true\n          df -h\n          echo \"Remove large unused folders, inspired by https://github.com/apache/flink/blame/master/tools/azure-pipelines/free_disk_space.sh\"\n          sudo bash -c '(ionice -c 3 nice -n 19 rm -rf /usr/share/dotnet/ /usr/local/graalvm/ /usr/local/.ghcup/ /usr/local/share/powershell /usr/local/share/chromium /usr/local/lib/android /usr/local/lib/node_modules)&'\n\n      - name: Setup python environment\n        uses: actions/setup-python@v6\n        with:\n          python-version: 3.11\n          cache: pip\n          cache-dependency-path: |\n            infra/ci/requirements.txt\n\n      - name: Install dependencies\n        run: |\n          python -m pip install --upgrade pip\n          pip install -r infra/ci/requirements.txt\n\n      - name: Run project tests\n        run: python infra/ci/build.py\n"
  },
  {
    "path": ".github/workflows/ubuntu_version_sync.yml",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nname: 'Ubuntu Version Sync Check'\n\non:\n  pull_request:\n    types: [opened, synchronize, reopened]\n\njobs:\n  check-sync:\n    name: Ubuntu File Synchronization Check\n    runs-on: ubuntu-latest\n    env:\n      BASE_SHA: ${{ github.event.pull_request.base.sha }}\n      HEAD_SHA: ${{ github.event.pull_request.head.sha }}\n    steps:\n    - name: 'Checkout code'\n      uses: actions/checkout@v6\n      with:\n        # Fetch all history so we can diff against the base branch.\n        fetch-depth: 0\n\n    - name: 'Run sync check'\n      run: |\n        set -e\n        \n        MODIFIED_FILES=$(git diff --name-only $BASE_SHA...$HEAD_SHA)\n        echo \"Checking for synchronized file changes...\"\n        echo \"Modified files in this PR:\"\n        echo \"$MODIFIED_FILES\"\n        \n        ERRORS=\"\"\n\n        # Define the mapping of legacy files to their versioned counterparts.\n        # Format: \"legacy_file;versioned_file_pattern\"\n        # The pattern uses {version} which will be replaced with \"ubuntu-20-04\" and \"ubuntu-24-04\".\n        # For Dockerfiles, the pattern is different from scripts.\n        declare -A LEGACY_DOCKERFILES\n        LEGACY_DOCKERFILES[\"infra/base-images/base-builder-fuzzbench/Dockerfile\"]=\"infra/base-images/base-builder-fuzzbench/{version}.Dockerfile\"\n        LEGACY_DOCKERFILES[\"infra/base-images/base-builder-swift/Dockerfile\"]=\"infra/base-images/base-builder-swift/{version}.Dockerfile\"\n        LEGACY_DOCKERFILES[\"infra/base-images/base-builder/Dockerfile\"]=\"infra/base-images/base-builder/{version}.Dockerfile\"\n        LEGACY_DOCKERFILES[\"infra/base-images/base-clang/Dockerfile\"]=\"infra/base-images/base-clang/{version}.Dockerfile\"\n        LEGACY_DOCKERFILES[\"infra/base-images/base-runner/Dockerfile\"]=\"infra/base-images/base-runner/{version}.Dockerfile\"\n\n        declare -A LEGACY_SCRIPTS\n        LEGACY_SCRIPTS[\"infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies\"]=\"infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies_{version}\"\n        LEGACY_SCRIPTS[\"infra/base-images/base-builder/install_deps.sh\"]=\"infra/base-images/base-builder/install_deps_{version}.sh\"\n        LEGACY_SCRIPTS[\"infra/base-images/base-builder/install_swift.sh\"]=\"infra/base-images/base-builder/install_swift_{version}.sh\"\n        LEGACY_SCRIPTS[\"infra/base-images/base-builder/precompile_honggfuzz\"]=\"infra/base-images/base-builder/precompile_honggfuzz_{version}\"\n        LEGACY_SCRIPTS[\"infra/base-images/base-clang/checkout_build_install_llvm.sh\"]=\"infra/base-images/base-clang/checkout_build_install_llvm_{version}.sh\"\n        LEGACY_SCRIPTS[\"infra/base-images/base-runner/install_deps.sh\"]=\"infra/base-images/base-runner/install_deps_{version}.sh\"\n\n        VERSIONS=(\"ubuntu-20-04\" \"ubuntu-24-04\")\n\n        # Check Dockerfiles\n        for legacy_file in \"${!LEGACY_DOCKERFILES[@]}\"; do\n          if [[ \"${legacy_file}\" == infra/* ]] && echo \"$MODIFIED_FILES\" | grep -q \"^${legacy_file}$\"; then\n            echo \"Legacy file changed: $legacy_file. Verifying counterparts...\"\n            for version in \"${VERSIONS[@]}\"; do\n              pattern=\"${LEGACY_DOCKERFILES[$legacy_file]}\"\n              versioned_file=\"${pattern/\\{version\\}/$version}\"\n              if ! echo \"$MODIFIED_FILES\" | grep -q \"^${versioned_file}$\"; then\n                ERRORS+=\"\\n- Legacy file '${legacy_file}' was changed, but its counterpart '${versioned_file}' was not.\"\n              fi\n            done\n          fi\n        done\n\n        # Check Scripts\n        for legacy_file in \"${!LEGACY_SCRIPTS[@]}\"; do\n          if echo \"$MODIFIED_FILES\" | grep -q \"^${legacy_file}$\"; then\n            echo \"Legacy script changed: $legacy_file. Verifying counterparts...\"\n            for version in \"${VERSIONS[@]}\"; do\n              pattern=\"${LEGACY_SCRIPTS[$legacy_file]}\"\n              versioned_file=\"${pattern/\\{version\\}/$version}\"\n              if ! echo \"$MODIFIED_FILES\" | grep -q \"^${versioned_file}$\"; then\n                ERRORS+=\"\\n- Legacy script '${legacy_file}' was changed, but its counterpart '${versioned_file}' was not.\"\n              fi\n            done\n          fi\n        done\n\n        if [ -n \"$ERRORS\" ]; then\n          echo -e \"\\n\\e[31mError: Found synchronization issues between legacy and versioned files.\\e[0m\"\n          echo -e \"Please update the following files to match their legacy counterparts or ensure they are included in this PR:$ERRORS\"\n          exit 1\n        else\n          echo -e \"\\n\\e[32mSuccess: All modified legacy files are synchronized with their versioned counterparts.\\e[0m\"\n        fi\n"
  },
  {
    "path": ".gitignore",
    "content": "/.vscode/\n*.pyc\n/build/\n*~\n.DS_Store\n*.swp\n.venv\n.gdb_history\ninfra/base-images/base-builder/indexer/indexer\ninfra/base-images/base-builder/indexer/fuzzing_engine.a\n\n# IntelliJ IDEA\n/.idea\n**/*.iml\n\n# Chronos\nccaches/\n"
  },
  {
    "path": ".pylintrc",
    "content": "[MASTER]\n\n# A comma-separated list of package or module names from where C extensions may\n# be loaded. Extensions are loading into the active Python interpreter and may\n# run arbitrary code.\nextension-pkg-whitelist=\n\n# Add files or directories to the blocklist. They should be base names, not\n# paths.\nignore=CVS,base-clang,base-sanitizer-libs-builder\n\n# Add files or directories matching the regex patterns to the blocklist. The\n# regex matches against base names, not paths.\nignore-patterns=\n\n# Python code to execute, usually for sys.path manipulation such as\n# pygtk.require().\n#init-hook=\n\n# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the\n# number of processors available to use.\njobs=1\n\n# Control the amount of potential inferred values when inferring a single\n# object. This can help the performance when dealing with large functions or\n# complex, nested conditions.\nlimit-inference-results=100\n\n# List of plugins (as comma separated values of python module names) to load,\n# usually to register additional checkers.\nload-plugins=\n\n# Pickle collected data for later comparisons.\npersistent=yes\n\n# Specify a configuration file.\n#rcfile=\n\n# When enabled, pylint would attempt to guess common misconfiguration and emit\n# user-friendly hints instead of false-positive error messages.\nsuggestion-mode=yes\n\n# Allow loading of arbitrary C extensions. Extensions are imported into the\n# active Python interpreter and may run arbitrary code.\nunsafe-load-any-extension=no\n\n\n[MESSAGES CONTROL]\n\n# Only show warnings with the listed confidence levels. Leave empty to show\n# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.\nconfidence=\n\n# Disable the message, report, category or checker with the given id(s). You\n# can either give multiple identifiers separated by comma (,) or put this\n# option multiple times (only on the command line, not in the configuration\n# file where it should appear only once). You can also use \"--disable=all\" to\n# disable everything first and then reenable specific checks. For example, if\n# you want to run only the similarities checker, you can use \"--disable=all\n# --enable=similarities\". If you want to run only the classes checker, but have\n# no Warning level messages displayed, use \"--disable=all --enable=classes\n# --disable=W\".\ndisable=print-statement,\n        parameter-unpacking,\n        unpacking-in-except,\n        old-raise-syntax,\n        backtick,\n        long-suffix,\n        old-ne-operator,\n        old-octal-literal,\n        import-star-module-level,\n        non-ascii-bytes-literal,\n        raw-checker-failed,\n        bad-inline-option,\n        locally-disabled,\n        file-ignored,\n        suppressed-message,\n        useless-suppression,\n        deprecated-pragma,\n        use-symbolic-message-instead,\n        apply-builtin,\n        basestring-builtin,\n        buffer-builtin,\n        cmp-builtin,\n        coerce-builtin,\n        execfile-builtin,\n        file-builtin,\n        long-builtin,\n        raw_input-builtin,\n        reduce-builtin,\n        standarderror-builtin,\n        unicode-builtin,\n        xrange-builtin,\n        coerce-method,\n        delslice-method,\n        getslice-method,\n        setslice-method,\n        no-absolute-import,\n        old-division,\n        dict-iter-method,\n        dict-view-method,\n        next-method-called,\n        metaclass-assignment,\n        indexing-exception,\n        raising-string,\n        reload-builtin,\n        oct-method,\n        hex-method,\n        nonzero-method,\n        cmp-method,\n        input-builtin,\n        round-builtin,\n        intern-builtin,\n        unichr-builtin,\n        map-builtin-not-iterating,\n        zip-builtin-not-iterating,\n        range-builtin-not-iterating,\n        filter-builtin-not-iterating,\n        using-cmp-argument,\n        eq-without-hash,\n        div-method,\n        idiv-method,\n        rdiv-method,\n        exception-message-attribute,\n        invalid-str-codec,\n        sys-max-int,\n        bad-python3-import,\n        deprecated-string-function,\n        deprecated-str-translate-call,\n        deprecated-itertools-function,\n        deprecated-types-field,\n        next-method-defined,\n        dict-items-not-iterating,\n        dict-keys-not-iterating,\n        dict-values-not-iterating,\n        deprecated-operator-function,\n        deprecated-urllib-function,\n        xreadlines-attribute,\n        deprecated-sys-function,\n        exception-escape,\n        comprehension-escape,\n        fixme,\n        import-error,\n        logging-fstring-interpolation,\n\n# Enable the message, report, category or checker with the given id(s). You can\n# either give multiple identifier separated by comma (,) or put this option\n# multiple time (only on the command line, not in the configuration file where\n# it should appear only once). See also the \"--disable\" option for examples.\nenable=c-extension-no-member\n\n\n[REPORTS]\n\n# Python expression which should return a score less than or equal to 10. You\n# have access to the variables 'error', 'warning', 'refactor', and 'convention'\n# which contain the number of messages in each category, as well as 'statement'\n# which is the total number of statements analyzed. This score is used by the\n# global evaluation report (RP0004).\nevaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)\n\n# Template used to display messages. This is a python new-style format string\n# used to format the message information. See doc for all details.\n#msg-template=\n\n# Set the output format. Available formats are text, parseable, colorized, json\n# and msvs (visual studio). You can also give a reporter class, e.g.\n# mypackage.mymodule.MyReporterClass.\noutput-format=text\n\n# Tells whether to display a full report or only the messages.\nreports=no\n\n# Activate the evaluation score.\nscore=yes\n\n\n[REFACTORING]\n\n# Maximum number of nested blocks for function / method body\nmax-nested-blocks=5\n\n# Complete name of functions that never returns. When checking for\n# inconsistent-return-statements if a never returning function is called then\n# it will be considered as an explicit return statement and no message will be\n# printed.\nnever-returning-functions=sys.exit\n\n\n[BASIC]\n\n# Naming style matching correct argument names.\nargument-naming-style=snake_case\n\n# Regular expression matching correct argument names. Overrides argument-\n# naming-style.\n#argument-rgx=\n\n# Naming style matching correct attribute names.\nattr-naming-style=snake_case\n\n# Regular expression matching correct attribute names. Overrides attr-naming-\n# style.\n#attr-rgx=\n\n# Bad variable names which should always be refused, separated by a comma.\nbad-names=foo,\n          bar,\n          baz,\n          toto,\n          tutu,\n          tata\n\n# Naming style matching correct class attribute names.\nclass-attribute-naming-style=any\n\n# Regular expression matching correct class attribute names. Overrides class-\n# attribute-naming-style.\n#class-attribute-rgx=\n\n# Naming style matching correct class names.\nclass-naming-style=PascalCase\n\n# Regular expression matching correct class names. Overrides class-naming-\n# style.\n#class-rgx=\n\n# Naming style matching correct constant names.\nconst-naming-style=UPPER_CASE\n\n# Regular expression matching correct constant names. Overrides const-naming-\n# style.\n#const-rgx=\n\n# Minimum line length for functions/classes that require docstrings, shorter\n# ones are exempt.\ndocstring-min-length=-1\n\n# Naming style matching correct function names.\nfunction-naming-style=snake_case\n\n# Regular expression matching correct function names. Overrides function-\n# naming-style.\n#function-rgx=\n\n# Good variable names which should always be accepted, separated by a comma.\ngood-names=i,\n           j,\n           k,\n           fp,\n           ex,\n           Run,\n           _\n\n# Include a hint for the correct naming format with invalid-name.\ninclude-naming-hint=no\n\n# Naming style matching correct inline iteration names.\ninlinevar-naming-style=any\n\n# Regular expression matching correct inline iteration names. Overrides\n# inlinevar-naming-style.\n#inlinevar-rgx=\n\n# Naming style matching correct method names.\nmethod-naming-style=snake_case\n\n# Regular expression matching correct method names. Overrides method-naming-\n# style.\n#method-rgx=\n\n# Naming style matching correct module names.\nmodule-naming-style=snake_case\n\n# Regular expression matching correct module names. Overrides module-naming-\n# style.\n#module-rgx=\n\n# Colon-delimited sets of names that determine each other's naming style when\n# the name regexes allow several styles.\nname-group=\n\n# Regular expression which should only match function or class names that do\n# not require a docstring.\nno-docstring-rgx=^_\n\n# List of decorators that produce properties, such as abc.abstractproperty. Add\n# to this list to register other decorators that produce valid properties.\n# These decorators are taken in consideration only for invalid-name.\nproperty-classes=abc.abstractproperty\n\n# Naming style matching correct variable names.\nvariable-naming-style=snake_case\n\n# Regular expression matching correct variable names. Overrides variable-\n# naming-style.\n#variable-rgx=\n\n\n[SIMILARITIES]\n\n# Ignore comments when computing similarities.\nignore-comments=yes\n\n# Ignore docstrings when computing similarities.\nignore-docstrings=yes\n\n# Ignore imports when computing similarities.\nignore-imports=no\n\n# Minimum lines number of a similarity.\nmin-similarity-lines=4\n\n\n[FORMAT]\n\n# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.\nexpected-line-ending-format=\n\n# Regexp for a line that is allowed to be longer than the limit.\nignore-long-lines=^\\s*(# )?<?https?://\\S+>?$\n\n# Number of spaces of indent required inside a hanging or continued line.\nindent-after-paren=4\n\n# String used as indentation unit. This is usually \"    \" (4 spaces) or \"\\t\" (1\n# tab).\nindent-string='  '\n\n# Maximum number of characters on a single line.\nmax-line-length=100\n\n# Maximum number of lines in a module.\nmax-module-lines=1000\n\n# List of optional constructs for which whitespace checking is disabled. `dict-\n# separator` is used to allow tabulation in dicts, etc.: {1  : 1,\\n222: 2}.\n# `trailing-comma` allows a space between comma and closing bracket: (a, ).\n# `empty-line` allows space-only lines.\nno-space-check=trailing-comma,\n               dict-separator\n\n# Allow the body of a class to be on the same line as the declaration if body\n# contains single statement.\nsingle-line-class-stmt=no\n\n# Allow the body of an if to be on the same line as the test if there is no\n# else.\nsingle-line-if-stmt=no\n\n\n[MISCELLANEOUS]\n\n# List of note tags to take in consideration, separated by a comma.\nnotes=FIXME,\n      XXX,\n      TODO\n\n\n[TYPECHECK]\n\n# List of decorators that produce context managers, such as\n# contextlib.contextmanager. Add to this list to register other decorators that\n# produce valid context managers.\ncontextmanager-decorators=contextlib.contextmanager\n\n# List of members which are set dynamically and missed by pylint inference\n# system, and so shouldn't trigger E1101 when accessed. Python regular\n# expressions are accepted.\ngenerated-members=\n\n# Tells whether missing members accessed in mixin class should be ignored. A\n# mixin class is detected if its name ends with \"mixin\" (case insensitive).\nignore-mixin-members=yes\n\n# Tells whether to warn about missing members when the owner of the attribute\n# is inferred to be None.\nignore-none=yes\n\n# This flag controls whether pylint should warn about no-member and similar\n# checks whenever an opaque object is returned when inferring. The inference\n# can return multiple potential results while evaluating a Python object, but\n# some branches might not be evaluated, which results in partial inference. In\n# that case, it might be useful to still emit no-member and other checks for\n# the rest of the inferred objects.\nignore-on-opaque-inference=yes\n\n# List of class names for which member attributes should not be checked (useful\n# for classes with dynamically set attributes). This supports the use of\n# qualified names.\nignored-classes=optparse.Values,thread._local,_thread._local\n\n# List of module names for which member attributes should not be checked\n# (useful for modules/projects where namespaces are manipulated during runtime\n# and thus existing member attributes cannot be deduced by static analysis). It\n# supports qualified module names, as well as Unix pattern matching.\nignored-modules=\n\n# Show a hint with possible names when a member name was not found. The aspect\n# of finding the hint is based on edit distance.\nmissing-member-hint=yes\n\n# The minimum edit distance a name should have in order to be considered a\n# similar match for a missing member name.\nmissing-member-hint-distance=1\n\n# The total number of similar names that should be taken in consideration when\n# showing a hint for a missing member.\nmissing-member-max-choices=1\n\n# List of decorators that change the signature of a decorated function.\nsignature-mutators=\n\n\n[SPELLING]\n\n# Limits count of emitted suggestions for spelling mistakes.\nmax-spelling-suggestions=4\n\n# Spelling dictionary name. Available dictionaries: none. To make it work,\n# install the python-enchant package.\nspelling-dict=\n\n# List of comma separated words that should not be checked.\nspelling-ignore-words=\n\n# A path to a file that contains the private dictionary; one word per line.\nspelling-private-dict-file=\n\n# Tells whether to store unknown words to the private dictionary (see the\n# --spelling-private-dict-file option) instead of raising a message.\nspelling-store-unknown-words=no\n\n\n[VARIABLES]\n\n# List of additional names supposed to be defined in builtins. Remember that\n# you should avoid defining new builtins when possible.\nadditional-builtins=\n\n# Tells whether unused global variables should be treated as a violation.\nallow-global-unused-variables=no\n\n# List of strings which can identify a callback function by name. A callback\n# name must start or end with one of those strings.\ncallbacks=cb_,\n          _cb\n\n# A regular expression matching the name of placeholder variables (i.e. expected\n# to not be used).\ndummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_\n\n# Argument names that match this expression will be ignored. Default to name\n# with leading underscore.\nignored-argument-names=_.*|^ignored_|^unused_\n\n# Tells whether we should check for unused import in __init__ files.\ninit-import=no\n\n# List of qualified module names which can have objects that can redefine\n# builtins.\nredefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io\n\n\n[LOGGING]\n\n# Format style used to check logging format string. `old` means using %\n# formatting, `new` is for `{}` formatting,and `fstr` is for f-strings.\nlogging-format-style=old\n\n# Logging modules to check that the string format arguments are in logging\n# function parameter format.\nlogging-modules=logging\n\n\n[STRING]\n\n# This flag controls whether the implicit-str-concat-in-sequence should\n# generate a warning on implicit string concatenation in sequences defined over\n# several lines.\ncheck-str-concat-over-line-jumps=no\n\n\n[IMPORTS]\n\n# List of modules that can be imported at any level, not just the top level\n# one.\nallow-any-import-level=\n\n# Allow wildcard imports from modules that define __all__.\nallow-wildcard-with-all=no\n\n# Analyse import fallback blocks. This can be used to support both Python 2 and\n# 3 compatible code, which means that the block might have code that exists\n# only in one or another interpreter, leading to false positives when analysed.\nanalyse-fallback-blocks=no\n\n# Deprecated modules which should not be used, separated by a comma.\ndeprecated-modules=optparse,tkinter.tix\n\n# Create a graph of external dependencies in the given file (report RP0402 must\n# not be disabled).\next-import-graph=\n\n# Create a graph of every (i.e. internal and external) dependencies in the\n# given file (report RP0402 must not be disabled).\nimport-graph=\n\n# Create a graph of internal dependencies in the given file (report RP0402 must\n# not be disabled).\nint-import-graph=\n\n# Force import order to recognize a module as part of the standard\n# compatibility libraries.\nknown-standard-library=\n\n# Force import order to recognize a module as part of a third party library.\nknown-third-party=enchant\n\n# Couples of modules and preferred modules, separated by a comma.\npreferred-modules=\n\n\n[CLASSES]\n\n# List of method names used to declare (i.e. assign) instance attributes.\ndefining-attr-methods=__init__,\n                      __new__,\n                      setUp,\n                      __post_init__\n\n# List of member names, which should be excluded from the protected access\n# warning.\nexclude-protected=_asdict,\n                  _fields,\n                  _replace,\n                  _source,\n                  _make\n\n# List of valid names for the first argument in a class method.\nvalid-classmethod-first-arg=cls\n\n# List of valid names for the first argument in a metaclass class method.\nvalid-metaclass-classmethod-first-arg=cls\n\n\n[DESIGN]\n\n# Maximum number of arguments for function / method.\nmax-args=5\n\n# Maximum number of attributes for a class (see R0902).\nmax-attributes=7\n\n# Maximum number of boolean expressions in an if statement (see R0916).\nmax-bool-expr=5\n\n# Maximum number of branch for function / method body.\nmax-branches=12\n\n# Maximum number of locals for function / method body.\nmax-locals=15\n\n# Maximum number of parents for a class (see R0901).\nmax-parents=7\n\n# Maximum number of public methods for a class (see R0904).\nmax-public-methods=20\n\n# Maximum number of return / yield for function / method body.\nmax-returns=6\n\n# Maximum number of statements in function / method body.\nmax-statements=50\n\n# Minimum number of public methods for a class (see R0903).\nmin-public-methods=2\n\n\n[EXCEPTIONS]\n\n# Exceptions that will emit a warning when being caught. Defaults to\n# \"BaseException, Exception\".\novergeneral-exceptions=BaseException,\n                       Exception\n\n# Maximum number of characters on a single line.\nmax-line-length=80\n"
  },
  {
    "path": ".style.yapf",
    "content": "[style]\nbased_on_style = google\ncolumn_limit = 80\nindent_width = 2\nsplit_before_named_assigns = true\n"
  },
  {
    "path": "AGENTS.md",
    "content": "* Use python3 infra/helper.py to build projects and run fuzzers.\n* If doing development on infra/ you should use a venv and if it doesn't already exist, install deps from infra/ci/requirements.txt build/functions/requirements.txt with pip.\n* If doing development on infra/ run python infra/presubmit.py to format, lint and run tests.\n"
  },
  {
    "path": "CITATION.cff",
    "content": "cff-version: 1.2.0\ntitle: OSS-Fuzz\nmessage: >-\n  If you use this software, please cite it using the\n  metadata from this file.\ntype: software\nauthors:\n  - given-names: Abhishek\n    family-names: Arya\n    affiliation: Google LLC\n    email: aarya@google.com\n    orcid: 'https://orcid.org/0009-0009-4558-4314'\n  - given-names: Oliver\n    family-names: Chang\n    email: ochang@google.com\n    affiliation: Google LLC\n    orcid: 'https://orcid.org/0009-0006-3181-4551'\n  - given-names: Jonathan\n    family-names: Metzman\n    email: metzman@google.com\n    affiliation: Google LLC\n    orcid: 'https://orcid.org/0000-0002-7042-0444'\n  - given-names: Kostya\n    family-names: Serebryany\n    email: kcc@google.com\n    affiliation: Google LLC\n    orcid: 'https://orcid.org/0009-0009-2379-3641'\n  - given-names: Dongge\n    family-names: Liu\n    email: donggeliu@google.com\n    affiliation: Google LLC\n    orcid: 'https://orcid.org/0000-0003-4821-7033'\nrepository-code: 'https://github.com/google/oss-fuzz'\nabstract: >-\n  OSS-Fuzz is an open-source project by Google that provides\n  continuous fuzzing for open-source software. It aims to\n  make common open-source software more secure and stable by\n  combining modern fuzzing techniques with scalable,\n  distributed execution. As of August 2023, OSS-Fuzz has\n  helped identify and fix over 10,000 vulnerabilities and\n  36,000 bugs across 1,000 projects.\nkeywords:\n  - open-source\n  - fuzzing\nlicense: Apache-2.0\n\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Want to contribute? Great! First, read this page (including the small print at\nthe end).\n\n### Before you contribute\nBefore we can use your code, you must sign the\n[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual)\n(CLA), which you can do online. The CLA is necessary mainly because you own the\ncopyright to your changes, even after your contribution becomes part of our\ncodebase, so we need your permission to use and distribute your code. We also\nneed to be sure of various other things: for instance that you'll tell us if you\nknow that your code infringes on other people's patents. You don't have to sign\nthe CLA until after you've submitted your code for review and a member has\napproved it, but you must do it before we can put your code into our codebase.\nBefore you start working on a larger contribution, you should get in touch with\nus first through the issue tracker with your idea so that we can help out and\npossibly guide you. Coordinating up front makes it much easier to avoid\nfrustration later on.\n\n### Code reviews\nAll submissions, including submissions by project members, require review. We\nuse GitHub pull requests for this purpose.\n\n### The small print\nContributions made by corporations are covered by a different agreement than\nthe one above, the\n[Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate).\n\n### Requesting a review\nPRs should be reviewed within a few days by the OSS-Fuzz oncall. There is no need to add anyone to review your code.\nIf for some reason this does not happen for a few days, feel free to add a team member or email oss-fuzz-team@google.com\nabout your PR.\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# OSS-Fuzz: Continuous Fuzzing for Open Source Software\n\n[Fuzz testing] is a well-known technique for uncovering programming errors in\nsoftware. Many of these detectable errors, like [buffer overflow], can have\nserious security implications. Google has found [thousands] of security\nvulnerabilities and stability bugs by deploying [guided in-process fuzzing of\nChrome components], and we now want to share that service with the open source\ncommunity.\n\n[Fuzz testing]: https://en.wikipedia.org/wiki/Fuzz_testing\n[buffer overflow]: https://en.wikipedia.org/wiki/Buffer_overflow\n[thousands]: https://issues.chromium.org/issues?q=label:Stability-LibFuzzer%20-status:Duplicate,WontFix\n[guided in-process fuzzing of Chrome components]: https://security.googleblog.com/2016/08/guided-in-process-fuzzing-of-chrome.html\n\nIn cooperation with the [Core Infrastructure Initiative] and the [OpenSSF],\nOSS-Fuzz aims to make common open source software more secure and stable by\ncombining modern fuzzing techniques with scalable, distributed execution.\nProjects that do not qualify for OSS-Fuzz (e.g. closed source) can run their own\ninstances of [ClusterFuzz] or [ClusterFuzzLite].\n\n[Core Infrastructure Initiative]: https://www.coreinfrastructure.org/\n[OpenSSF]: https://www.openssf.org/\n\nWe support the [libFuzzer], [AFL++], and [Honggfuzz] fuzzing engines in\ncombination with [Sanitizers], as well as [ClusterFuzz], a distributed fuzzer\nexecution environment and reporting tool.\n\n[libFuzzer]: https://llvm.org/docs/LibFuzzer.html\n[AFL++]: https://github.com/AFLplusplus/AFLplusplus\n[Honggfuzz]: https://github.com/google/honggfuzz\n[Sanitizers]: https://github.com/google/sanitizers\n[ClusterFuzz]: https://github.com/google/clusterfuzz\n[ClusterFuzzLite]: https://google.github.io/clusterfuzzlite/\n\nCurrently, OSS-Fuzz supports C/C++, Rust, Go, Python, Java/JVM, JavaScript and Lua code. Other languages\nsupported by [LLVM] may work too. OSS-Fuzz supports fuzzing x86_64 and i386\nbuilds.\n\n[LLVM]: https://llvm.org\n\n## Overview\n![OSS-Fuzz process diagram](docs/images/process.png)\n\n## Documentation\nRead our [detailed documentation] to learn how to use OSS-Fuzz.\n\n[detailed documentation]: https://google.github.io/oss-fuzz\n\n## Trophies\nAs of May 2025, OSS-Fuzz has helped identify and fix over 13,000 vulnerabilities and 50,000 bugs across [1,000] projects.\n\n[1,000]: https://github.com/google/oss-fuzz/tree/master/projects\n\n## Blog posts\n* 2024-11-20 - [Leveling Up Fuzzing: Finding more vulnerabilities with AI]\n* 2023-08-16 - [AI-Powered Fuzzing: Breaking the Bug Hunting Barrier]\n* 2023-02-01 - [Taking the next step: OSS-Fuzz in 2023]\n* 2022-09-08 - [Fuzzing beyond memory corruption: Finding broader classes of vulnerabilities automatically]\n* 2021-12-16 - [Improving OSS-Fuzz and Jazzer to catch Log4Shell]\n* 2021-03-10 - [Fuzzing Java in OSS-Fuzz]\n* 2020-12-07 - [Improving open source security during the Google summer internship program]\n* 2020-10-09 - [Fuzzing internships for Open Source Software]\n* 2018-11-06 - [A New Chapter for OSS-Fuzz]\n* 2017-05-08 - [OSS-Fuzz: Five months later, and rewarding projects]\n* 2016-12-01 - [Announcing OSS-Fuzz: Continuous fuzzing for open source software]\n\n[Leveling Up Fuzzing: Finding more vulnerabilities with AI]: https://security.googleblog.com/2024/11/leveling-up-fuzzing-finding-more.html\n[AI-Powered Fuzzing: Breaking the Bug Hunting Barrier]: https://security.googleblog.com/2023/08/ai-powered-fuzzing-breaking-bug-hunting.html\n[Announcing OSS-Fuzz: Continuous fuzzing for open source software]: https://opensource.googleblog.com/2016/12/announcing-oss-fuzz-continuous-fuzzing.html\n[OSS-Fuzz: Five months later, and rewarding projects]: https://opensource.googleblog.com/2017/05/oss-fuzz-five-months-later-and.html\n[A New Chapter for OSS-Fuzz]: https://security.googleblog.com/2018/11/a-new-chapter-for-oss-fuzz.html\n[Fuzzing internships for Open Source Software]: https://security.googleblog.com/2020/10/fuzzing-internships-for-open-source.html\n[Improving open source security during the Google summer internship program]: https://security.googleblog.com/2020/12/improving-open-source-security-during.html\n[Fuzzing Java in OSS-Fuzz]: https://security.googleblog.com/2021/03/fuzzing-java-in-oss-fuzz.html\n[Improving OSS-Fuzz and Jazzer to catch Log4Shell]: https://security.googleblog.com/2021/12/improving-oss-fuzz-and-jazzer-to-catch.html\n[Fuzzing beyond memory corruption: Finding broader classes of vulnerabilities automatically]: https://security.googleblog.com/2022/09/fuzzing-beyond-memory-corruption.html\n[Taking the next step: OSS-Fuzz in 2023]: https://security.googleblog.com/2023/02/taking-next-step-oss-fuzz-in-2023.html\n"
  },
  {
    "path": "docs/.gitignore",
    "content": "_site\n.bundle\n.sass-cache\n.jekyll-metadata\nvendor\n"
  },
  {
    "path": "docs/404.html",
    "content": "---\nlayout: default\n---\n\n<style type=\"text/css\" media=\"screen\">\n  .container {\n    margin: 10px auto;\n    max-width: 600px;\n    text-align: center;\n  }\n  h1 {\n    margin: 30px 0;\n    font-size: 4em;\n    line-height: 1;\n    letter-spacing: -1px;\n  }\n</style>\n\n<div class=\"container\">\n  <h1>404</h1>\n\n  <p><strong>Page not found :(</strong></p>\n</div>\n"
  },
  {
    "path": "docs/Gemfile",
    "content": "source \"https://rubygems.org\"\ngem 'github-pages', group: :jekyll_plugins\n\ngem \"webrick\", \"~> 1.8\"\n"
  },
  {
    "path": "docs/README.md",
    "content": "# Readme\n\nUse the following instructions to make documentation changes locally.\n\n## Prerequisites\n```bash\n$ sudo apt install ruby bundler\n$ bundle config set path 'vendor/bundle'\n$ bundle install\n```\n\n## Serving locally\n```bash\n$ bundle exec jekyll serve\n```\n\n## Theme documentation\nWe are using the [just the docs](https://just-the-docs.github.io/just-the-docs/)\ntheme.\n"
  },
  {
    "path": "docs/_config.yml",
    "content": "# Welcome to Jekyll!\n#\n# This config file is meant for settings that affect your whole blog, values\n# which you are expected to set up once and rarely edit after that. If you find\n# yourself editing this file very often, consider using Jekyll's data files\n# feature for the data you need to update frequently.\n#\n# For technical reasons, this file is *NOT* reloaded automatically when you use\n# 'bundle exec jekyll serve'. If you change this file, please restart the server process.\n\n# Site settings\n# These are used to personalize your new site. If you look in the HTML files,\n# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.\n# You can create any custom variable you would like, and they will be accessible\n# in the templates via {{ site.myvariable }}.\ntitle: OSS-Fuzz\ndescription: Documentation for OSS-Fuzz\nbaseurl: \"/oss-fuzz\" # the subpath of your site, e.g. /blog\nurl: \"\" # the base hostname & protocol for your site, e.g. http://example.com\n\n# Build settings\nmarkdown: kramdown\nremote_theme: pmarsceill/just-the-docs\nsearch_enabled: true\n\nga_tracking: G-LRX1V3S5P\n\naux_links:\n  \"OSS-Fuzz on GitHub\":\n    - https://github.com/google/oss-fuzz\n\n# Exclude from processing.\nexclude:\n  - Gemfile\n  - Gemfile.lock\n  - node_modules\n  - vendor/bundle/\n  - vendor/cache/\n  - vendor/gems/\n  - vendor/ruby/\n"
  },
  {
    "path": "docs/_sass/color_schemes/wider.scss",
    "content": "@import \"./color_schemes/light\";\n$content-width: 70rem;\n"
  },
  {
    "path": "docs/advanced-topics/advanced_topics.md",
    "content": "---\nlayout: default\ntitle: Advanced topics\nhas_children: true\nnav_order: 3\npermalink: /advanced-topics/\n---\n\n# Advanced topics\n"
  },
  {
    "path": "docs/advanced-topics/bug_fixing_guidance.md",
    "content": "---\nlayout: default\ntitle: Bug fixing guidance\nnav_order: 6\npermalink: /advanced-topics/bug-fixing-guidance\n---\n\n# Bug fixing guidance\n{: .no_toc}\n\nThis page provides brief guidance on how to prioritise and fix bugs reported by\nOSS-Fuzz.\n\n- TOC\n{:toc}\n\n## Threat modelling\nIn general the severity of an issue reported by OSS-Fuzz must be determined\nrelative to the threat model of the project under analysis. Therefore, although\nthe fuzzers OSS-Fuzz makes an effort into determining the severity of the bug\nthe true severity of the bug depends on the threat model of the project.\n\n## Bug prioritisation\n\n### Security issues\nThese are the top priority of solving. A label is attached to these on\nthe OSS-Fuzz testcase page and you can also search up all of these on monorail\nusing the search pattern `-Bug=security`.\n\nIssues of this kind include issues reported by Address Sanitizer, e.g.\nheap-based buffer overflows, stack-based buffer overflows and use-after-frees.\n\n### Functional issues and memory leaks\nThese are issues that in general can tamper with the functionality of the\napplication. The bugs that have highest priority in this case are those that\ncan be easily triggered by an untrusted user of the project.\n\n### Timeouts and out-of-memory\nThese are in general the least prioritised issues to solve.\n\n### Bug prioritisation of non C/C++ projects\nCurrently there is no prioritisation of bugs in non C/C++ projects. As such, in\nthis scenario it is crucial you do the analysis yourself relative to the threat\nmodel of your project.\n\n## Non-reproducible bugs\nOSS-Fuzz will report some bugs that are labeled `Reliably reproduces: NO` and\nthese can be tricky to deal with. A non-reproducible bug is an issue that\nOSS-Fuzz did indeed discover, however, OSS-Fuzz is unable to reproduce the bug\nwith `python3 infra/helper.py reproduce`. In general, our suggestion is to do\nanalysis of the bug and determine whether there in fact is an issue.\n\nThe non-reproducible bugs can be of varying nature. Some of these bugs will be\ndue to some internal state of the target application being manipulated over the\ncause of several executions of the fuzzer function. This could be several\nhundreds or even thousands of executions and the bug may not be reproducible by\na single fuzzer test-case, however, there is indeed a bug in the application.\nThere are other reasons why bugs may be non-reproducible and in general any\nnon-determinism introduced into the application can have an effect on this.\n\nIn the case of non-reproducible bugs our advice is to put effort into analysing\nthe potential bug and also assess whether this is due to some internal state\nthat persists between each fuzz run. If that is indeed the case then we also\nsuggest investigating whether the fuzzer can be written such that the internal\nstate in the code will be reset between each fuzz run.\n\n## Should all reported issues be solved?\nIt is reported by some project maintainers that fixing timeout issues reported\nby OSS-Fuzz can increase the complexity of the project’s source code. The\nresult of this is that maintainers put effort into solving a timeout issue and\nthe fix results in additional complexity of the project. The question is\nwhether in a scenario like this if the overall result actually improves the\nstate of the application.\n\nIn order to answer this question we must assess the issue relative to the\nthreat model. Following the timeout anecdote then some timing issues can have\nsevere security implications. For example, if the timeout issue can cause\nmanipulation of control-flow then the timing issue may be of high security\nseverity. As such, it is difficult to say in the general case whether or not\nsome bugs should not be solved, as it should be analysed and determined on a\nproject-by-project basis.\n\nIn the event that a bug is reported by OSS-Fuzz that is not relevant to\nsecurity or reliability of the application then there may still be a point to\nfixing the bug. For example, if the issue is often run into by the fuzzer then\nthe fuzzer may have difficulty exploring further code in the target, and thus\nfixing the bug will allow the fuzzer to explore further code. In this case some\nsuggested examples of resolving the issue could be:\n* Perform a hot-patch that is only applied during fuzzer executions and does\nnot overcomplicate the project’s code.\n* Patch the code of the fuzzer to avoid the timeout. For example, some fuzzers\nrestrict the size of the input to avoid certain deep recursions or\ntime-intensive loops.\n* Patch the code in the target despite complicating things.\n"
  },
  {
    "path": "docs/advanced-topics/code_coverage.md",
    "content": "---\nlayout: default\ntitle: Code coverage\nparent: Advanced topics\nnav_order: 2\npermalink: /advanced-topics/code-coverage/\n---\n\n# Code Coverage\n{: .no_toc}\n\nFor projects written in C/C++, Rust, Go, Swift or Java and other JVM-based languages,\nyou can generate code coverage reports using Clang source-based code coverage.\nThis page walks you through the basic steps.\nFor more details on C/C++ coverage, see [Clang's documentation].\n\nCode coverage reports generation for other languages is not supported yet.\n\n- TOC\n{:toc}\n---\n\n## Pull the latest Docker images\n\nDocker images get regularly updated with a newer version of build tools, build\nconfigurations, scripts, and other changes. We recommend you pull the most\nrecent images by running the following command:\n\n```bash\n$ python3 infra/helper.py pull_images\n```\n\n## Build fuzz targets\n\nCode coverage report generation requires a special build configuration to be\nused. To create a code coverage build for your project, run these commands:\n\n```bash\n$ python3 infra/helper.py build_image $PROJECT_NAME\n$ python3 infra/helper.py build_fuzzers --sanitizer=coverage $PROJECT_NAME\n```\n\n## Establish access to GCS\n\nTo get a good understanding of fuzz testing quality, you should generate code\ncoverage reports by running fuzz targets against the corpus\naggregated by OSS-Fuzz. Set up `gsutil` and ensure that you have access to the\ncorpora by doing the following:\n\n* Install the [gsutil tool].\n* Check whether you have access to the corpus for your project:\n\n```bash\n$ gsutil ls gs://${PROJECT_NAME}-corpus.clusterfuzz-external.appspot.com/\n```\n\nIf you see an authorization error from the command above, run this:\n\n```bash\n$ gcloud auth login\n```\n\nand try again. Once `gsutil` works, you can run the report generation.\n\n## Generate code coverage reports\n\n### Full project report\n\nIf you want to generate a code coverage report using the corpus aggregated on\nOSS-Fuzz, run this command:\n\n```bash\n$ python3 infra/helper.py coverage $PROJECT_NAME\n```\n\nIf you want to generate a code coverage report using the corpus you have\nlocally, copy the corpus into the\n`build/corpus/$PROJECT_NAME/<fuzz_target_name>/` directories for each fuzz\ntarget, then run this command:\n\n```bash\n$ python3 infra/helper.py coverage --no-corpus-download $PROJECT_NAME\n```\n\n### Single fuzz target\n\nYou can generate a code coverage report for a particular fuzz target by using\nthe `--fuzz-target` argument:\n\n```bash\n$ python3 infra/helper.py coverage --fuzz-target=<fuzz_target_name> $PROJECT_NAME\n```\n\nIn this mode, you can specify an arbitrary corpus location for the fuzz target\n(instead of the corpus downloaded from OSS-Fuzz) by using `--corpus-dir`:\n\n```bash\n$ python3 infra/helper.py coverage --fuzz-target=<fuzz_target_name> \\\n    --corpus-dir=<my_local_corpus_dir> $PROJECT_NAME\n```\n\n### Additional arguments for `llvm-cov` (C/C++/Rust only)\n\nYou may want to use some of the options provided by the [llvm-cov tool], like\n`-ignore-filename-regex=`. You can pass these to the helper script after `--`:\n\n```bash\n$ python3 infra/helper.py coverage $PROJECT_NAME -- \\\n    -ignore-filename-regex=.*code/to/be/ignored/.* <other_extra_args>\n```\n\nIf you want to specify particular source files or directories to show in the\nreport, list their paths at the end of the extra arguments sequence:\n\n```bash\n$ python3 infra/helper.py coverage zlib -- \\\n    <other_extra_args> /src/zlib/inftrees.c /src/zlib_uncompress_fuzzer.cc /src/zlib/zutil.c\n```\n\nIf you want OSS-Fuzz to use extra arguments when generating code coverage\nreports for your project, add the arguments into your `project.yaml` file as\nfollows:\n\n```yaml\ncoverage_extra_args: -ignore-filename-regex=.*crc.* -ignore-filename-regex=.*adler.* <other_extra_args>\n```\n\n[Clang's documentation]: https://clang.llvm.org/docs/SourceBasedCodeCoverage.html\n[gsutil tool]: https://cloud.google.com/storage/docs/gsutil_install\n[llvm-cov tool]: https://llvm.org/docs/CommandGuide/llvm-cov.html\n"
  },
  {
    "path": "docs/advanced-topics/corpora.md",
    "content": "---\nlayout: default\ntitle: Corpora\nparent: Advanced topics\nnav_order: 3\npermalink: /advanced-topics/corpora/\n---\n\n# Accessing Corpora\n{: .no_toc}\n\nIf you want to access the corpora that we are using for your fuzz targets\n(synthesized by the fuzzing engines), follow these steps.\n\n- TOC\n{:toc}\n---\n\n## Obtain access\n\nTo get access to a project's corpora, you must be listed as the\nprimary contact or as an auto cc in the project's `project.yaml` file, as described\nin the [New Project Guide]({{ site.baseurl }}/getting-started/new-project-guide/#projectyaml).\nIf you don't do this, most of the links below won't work.\n\n## Install Google Cloud SDK\n\nThe corpora for fuzz targets are stored on [Google Cloud\nStorage](https://cloud.google.com/storage/). To access them, you need to\n[install the gsutil\ntool](https://cloud.google.com/storage/docs/gsutil_install), which is part of\nthe Google Cloud SDK. Follow the instructions on the installation page to\nlogin with the Google account listed in your project's `project.yaml` file.\n\n## Viewing the corpus for a fuzz target\n\nThe fuzzer statistics page for your project on\n[ClusterFuzz]({{ site.baseurl }}/further-reading/clusterfuzz)\ncontains a link to the Google Cloud console for your corpus under the\n**corpus_size** column. Click the link to browse and download individual test inputs in the\ncorpus.\n\n![viewing_corpus](https://raw.githubusercontent.com/google/oss-fuzz/master/docs/images/viewing_corpus.png)\n\n## Downloading the corpus \n\nIf you want to download the entire corpus, click the link in the **corpus_size** column, then\ncopy the **Buckets** path at the top of the page:\n\n![corpus_path](https://raw.githubusercontent.com/google/oss-fuzz/master/docs/images/corpus_path.png)\n\nCopy the corpus to a directory on your\nmachine by running the following command:\n\n```bash\n$ gsutil -m cp -r gs://<bucket_path> <local_directory>\n```\nUsing the expat example above, this would be:\n\n```bash\n$ gsutil -m cp -r \\\n    gs://expat-corpus.clusterfuzz-external.appspot.com/libFuzzer/expat_parse_fuzzer \\\n    <local_directory>\n```\n\n## Corpus backups\n\nWe keep daily zipped backups of your corpora. These can be accessed from the\n**corpus_backup** column of the fuzzer statistics page. Downloading these can\nbe significantly faster than running `gsutil -m cp -r` on the corpus bucket.\n"
  },
  {
    "path": "docs/advanced-topics/debugging.md",
    "content": "---\nlayout: default\ntitle: Debugging\nparent: Advanced topics\nnav_order: 4\npermalink: /advanced-topics/debugging/\n---\n\n# Debugging issues\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\n## Debugging build scripts\n\nWhile developing your build script, it may be useful to run bash within the\ncontainer:\n\n```bash\n$ python3 infra/helper.py shell $PROJECT_NAME  # runs /bin/bash within container\n$ compile                                     # runs compilation manually\n```\n\n## Debugging fuzzers with GDB\n\nIf you wish to debug a fuzz target with gdb, you can use the base-runner-debug\nimage:\n\n```bash\n# Copy input testcase into host output directory so it can be accessed\n# within the Docker image.\n$ cp /path/to/testcase build/out/$PROJECT_NAME\n\n# Run the Docker image containing GDB.\n$ python3 infra/helper.py shell base-runner-debug\n$ gdb --args /out/$PROJECT_NAME/$FUZZ_TARGET_NAME /out/$PROJECT_NAME/testcase\n```\n\n**Note:** The `base-runner-debug` image does not have access to your sources, so\nyou will not be able to do source code level debugging. We recommend integrating\nyour fuzz target upstream as part of\n[ideal integration]({{ site.baseurl }}/advanced-topics/ideal-integration/)\nfor debugging purposes.\n"
  },
  {
    "path": "docs/advanced-topics/fuzz_introspector.md",
    "content": "---\nlayout: default\ntitle: Fuzz Introspector\nparent: Advanced topics\nnav_order: 2\npermalink: /advanced-topics/fuzz-introspector/\n---\n\n# Fuzz Introspector\n{: .no_toc}\n\nFor projects written in C/C++, Python and Java you can generate Fuzz\nIntrospector reports to help guide the development of your fuzzing suite.\nThese reports help to extract details about the fuzzing setup of your\nproject with the goal of making it easier to improve the fuzzing set up.\nThe Fuzz Introspector reports are generated automatically and uploaded\nto the cloud like code coverage reports, and you can also generate them\nlocally using the OSS-Fuzz helper script.\n\n\n- TOC\n{:toc}\n---\n\n## Fuzz Introspector overview\n\nAs soon as your project is run with ClusterFuzz (<1 day), you can view the Fuzz\nIntrospector report for your project.\n[Fuzz Introspector](https://github.com/ossf/fuzz-introspector) helps you\nunderstand your fuzzers' performance and identify any potential blockers.\nIt provides individual and aggregated fuzzer reachability and coverage reports.\nYou can monitor each fuzzer's static reachability potential and compare it\nagainst dynamic coverage and identify any potential bottlenecks.\nFuzz Introspector can offer suggestions on increasing coverage by adding new\nfuzz targets or modify existing ones.\nFuzz Introspector reports can be viewed from the [OSS-Fuzz\nhomepage](https://oss-fuzz.com/) or through this\n[index](http://oss-fuzz-introspector.storage.googleapis.com/index.html).\n\n- [Fuzz Introspector documentation](https://fuzz-introspector.readthedocs.io/en/latest/)\n- [Fuzz Introspector source code](https://github.com/ossf/fuzz-introspector)\n- [OSS-Fuzz Fuzz Introspector reports](http://oss-fuzz-introspector.storage.googleapis.com/index.html)\n\n\n## Tutorials and guides\n\nThe reports generated can be a lot to digest when first viewing them. The \n[Fuzz Introspector documentation](https://fuzz-introspector.readthedocs.io/en/latest/)\nprovides various user guides and tutorials rooted in OSS-Fuzz projects, which is\na useful reference on how to make use of the reports.\n\nFor ideas on how to use Fuzz Introspector, see [user guides](https://fuzz-introspector.readthedocs.io/en/latest/user-guides/index.html) which includes sections e.g.\n- [Quickly extract overview of a given project](https://fuzz-introspector.readthedocs.io/en/latest/user-guides/quick-overview.html)\n- [Get ideas for new fuzz targets](https://fuzz-introspector.readthedocs.io/en/latest/user-guides/get-ideas-for-new-targets.html)\n- [Comparing introspector reports](https://fuzz-introspector.readthedocs.io/en/latest/user-guides/comparing-introspector-reports.html)\n\n## Run Fuzz Introspector locally\n\nTo generate a Fuzz Introspector report locally use `infra/helper.py` and the\n`introspector` command. Fuzz Introspector relies on code coverage to\nanalyze a given project, and this means we need to extract code coverage in the\nFuzz Introspector process. We can do this in two ways. First, by running the fuzzers\nfor a given amount of time, and, second, by generating code coverage using the public\ncorpus available from OSS-Fuzz.\n\n\n### Generate reports by running fuzzers for X seconds\n\nThe following command will generate a Fuzz Introspector report for the `libdwarf` project\nand will extract code coverage based on a corpus created from running the fuzzers for 30\nseconds.\n\n```bash\n$ python3 infra/helper.py introspector libdwarf --seconds=30\n```\n\nIf the above command was succesful, you should see output along the lines of:\n\n```bash\nINFO:root:To browse the report, run: python3 -m http.server 8008 --directory /home/my_user/oss-fuzz/build/out/libdwarf/introspector-report/inspector and navigate to localhost:8008/fuzz_report.html in your browser\n```\nThe above output gives you directions on how to start a simple webserver using\n`python3 -m http.server`, which you can use to view the Fuzz Introspector report.\n\n### Generate reports by using public corpora\n\nThe following command will generate a Fuzz Introspector report for the `libdwarf` project\nand will extract code coverage based on the publicly available corpora. \n\n```bash\n$ python3 infra/helper.py introspector libdwarf --public-corpora\n```\n\nAssuming the above command is succesful you can view the report using `python3 -m http.server`\nfollowing the example described above.\n\n\n## Differences in build tooling\n\nThere are some differences in build environment for Fuzz Introspector builds\nin comparison to e.g. ASAN or code coverage builds. The reason is that\nFuzz Introspector relies on certain compile-time tools to do its analysis.\nThis compile time tooling differs between languages, namely:\n- For C/C++, Fuzz Introspector relies on [LLVM LTO](https://llvm.org/docs/LinkTimeOptimization.html) and [LLVM Gold](https://llvm.org/docs/GoldPlugin.html)\n- For Python, Fuzz Introspector relies on a modified [PyCG](https://github.com/vitsalis/PyCG)\n- For Java, Fuzz Introspector relies on [Soot](https://soot-oss.github.io/soot/)\n\nThe consequence of this is your project must be compatible with these projects.\nPyCG and Soot have not shown to be a blocker for many projects, however, experience\nhas shown that sometimes a project's build needs modification in order to compile\nwith LLVM LTO. The easiest way to test if your project works with LLVM is checking\nwhether your project can compile with the flags `-flto -fuse-ld=gold` and using\nthe gold linker. OSS-Fuzz automatically sets these flags and linker options when\nusing `infra/helper.py` to build your project with `--sanitizer=introspector`, e.g.\n\n```bash\npython3 infra/helper.py build_fuzzers --sanitizer=introspector PROJ_NAME\n```\n"
  },
  {
    "path": "docs/advanced-topics/ideal_integration.md",
    "content": "---\nlayout: default\ntitle: Ideal integration\nparent: Advanced topics\nnav_order: 1\npermalink: /advanced-topics/ideal-integration/\n---\n\n# Ideal integration with OSS-Fuzz\n{: .no_toc}\n\nOSS projects have different build and test systems. We can't expect them all to\nimplement and maintain fuzz targets or integrate them with OSS-Fuzz in the same\nway. However, we do have recommendations.\n\nThis page documents several features (starting from the easiest) that will make\nautomated fuzzing simple and efficient, and will help you catch regressions\nearly in the development cycle. This simple\n[example](https://github.com/google/oss-fuzz/tree/master/projects/example/my-api-repo)\ncovers most of the items. \n\n- TOC\n{:toc}\n---\n\n## Summary\n\nEvery [fuzz target](https://llvm.org/docs/LibFuzzer.html#fuzz-target):\n* Is [maintained by code owners](#fuzz-target) in their RCS (Git, SVN, etc).\n* Is [built with the rest of the tests](#build-support) - no bit rot! \n* Has a [seed corpus](#seed-corpus) with good [code coverage](#coverage).\n* Has a [dictionary](#dictionary), if applicable.\n* Is [continuously tested on the seed corpus](#regression-testing) with\n  [ASan/UBSan/MSan](https://github.com/google/sanitizers).\n* Is [fast and has no OOMs](#performance).\n\n## Fuzz Target\n\nThe code of the [fuzz target(s)](https://llvm.org/docs/LibFuzzer.html#fuzz-target) should be\npart of the project's source code repository.  All fuzz targets should be easily\ndiscoverable (reside in the same directory, follow the same naming pattern,\netc.). \n\nThis makes it easy to maintain the fuzzers and minimizes breakages that can\narise as source code changes over time.\n\nMake sure to fuzz the target locally for a small period of time to ensure that \nit does not crash, hang, or run out of memory instantly. Also make sure that the fuzzer can\nmake at least some progress. If you're having trouble, read about [what makes a good fuzz\ntarget](https://github.com/google/fuzzing/blob/master/docs/good-fuzz-target.md).\n\nThe interface between the [fuzz target](https://llvm.org/docs/LibFuzzer.html#fuzz-target)\nand the fuzzing engines is C, so you can use either C or C++ to implement the\nfuzz target. Make sure to not return values other than **zero** [^1].\n\nExamples: \n[boringssl](https://github.com/google/boringssl/tree/master/fuzz),\n[SQLite](https://www.sqlite.org/src/artifact/ad79e867fb504338),\n[s2n](https://github.com/awslabs/s2n/tree/master/tests/fuzz),\n[openssl](https://github.com/openssl/openssl/tree/master/fuzz),\n[FreeType](http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/tools/ftfuzzer),\n[re2](https://github.com/google/re2/tree/master/re2/fuzzing),\n[harfbuzz](https://github.com/behdad/harfbuzz/tree/master/test/fuzzing),\n[pcre2](https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_fuzzsupport.c?view=markup),\n[ffmpeg](https://github.com/FFmpeg/FFmpeg/blob/master/tools/target_dec_fuzzer.c).\n\n[^1]: While LibFuzzer uses a non-zero value as a signal to discard inputs other fuzzers in\nuse by OSS-Fuzz do not necessarily support this behavior. (Discarding inputs can be used\nto stop a fuzzer from exploring further, which should only be used with good reason.)\n\n## Build support\n\nMany different build systems exist in the open-source world. The less OSS-Fuzz\nknows about them, the better it can scale.\n\nAn ideal build integration for OSS-Fuzz looks like this:\n* For every fuzz target `foo` in the project, there is a build rule that\nbuilds `foo_fuzzer`, a binary that: \n\t* Contains the fuzzing entry point.\n\t* Contains (`LLVMFuzzerTestOneInput`) and all the code it depends on.\n\t* Uses the `main()` function from `$LIB_FUZZING_ENGINE` (env var [provided]({{ site.baseurl }}/getting-started/new-project-guide/) by OSS-Fuzz environment).\n* Since the build system supports changing the compiler and passing extra compiler\nflags, the build command for `foo_fuzzer` looks similar to this:\n\n```bash\n# Assume the following env vars are set:\n# CC, CXX, CFLAGS, CXXFLAGS, LIB_FUZZING_ENGINE\n$ make_or_whatever_other_command foo_fuzzer\n```\n\nThis minimizes OSS-Fuzz-specific configuration, making your fuzzing more robust.\n\nThere is no point in hardcoding the exact compiler flags in the build system\nbecause they a) may change and b) depend on the fuzzing engine and sanitizer\nbeing used.\n\n## Seed Corpus\n\nThe *seed corpus* is a set of test inputs, stored as individual files, provided\nto the fuzz target as a starting point (to \"seed\" the mutations). The quality of\nthe seed corpus has a huge impact on fuzzing efficiency; the higher the quality,\nthe easier it is for the fuzzer to discover new code paths. The ideal corpus is\na minimal set of inputs that provides maximal code coverage. \n\nFor better OSS-Fuzz integration,  the seed corpus should be available in\nrevision control (it can be the same as or different from the source code). It\nshould be regularly extended with the inputs that (used to) trigger bugs and/or\ntouch new parts of the code. \n\nExamples: \n[boringssl](https://github.com/google/boringssl/tree/master/fuzz),\n[openssl](https://github.com/openssl/openssl/tree/master/fuzz),\n[nss](https://github.com/mozilla/nss-fuzzing-corpus) (corpus in a separate repo).\n\n## Dictionary\n\nFor some input types, a simple dictionary of tokens used by the input language\ncan have a dramatic impact on fuzzing efficiency.  For example, when fuzzing an\nXML parser, a dictionary of XML tokens is helpful. AFL++ has a\n[collection](https://github.com/AFLplusplus/AFLplusplus/tree/master/dictionaries)\nof dictionaries for popular data formats. Ideally, a dictionary should be\nmaintained alongside the fuzz target, and it must use [correct\nsyntax](https://llvm.org/docs/LibFuzzer.html#dictionaries).\n\n## Coverage\n\nFor a fuzz target to be useful, it must have good coverage in the code that it\nis testing. You can view the coverage for your fuzz targets by looking at the\n[fuzzer stats]({{ site.baseurl }}/further-reading/clusterfuzz#fuzzer-stats)\ndashboard on ClusterFuzz, as well as [coverage reports]({{ site.baseurl\n}}/further-reading/clusterfuzz#coverage-reports).\n\nTo generate an aggregated code coverage report for your project, please see the\n[code coverage]({{ site.baseurl }}/advanced-topics/code-coverage) page.\n\nCoverage can often be improved by adding dictionaries, more inputs for seed\ncorpora, and fixing timeouts/out-of-memory bugs in your targets.\n\n## Regression Testing\n\nFuzz targets should be regularly tested (not necessarily fuzzed!) as a part of\nthe project's regression testing process. One way to do so is to link the fuzz\ntarget with a simple standalone driver\n([example](https://github.com/llvm-mirror/compiler-rt/tree/master/lib/fuzzer/standalone))\nthat runs the provided inputs, then use this driver with the seed corpus created\nin previous step. We recommend you use\n[sanitizers](https://github.com/google/sanitizers) during regression testing.\n\nExamples: [SQLite](https://www.sqlite.org/src/artifact/d9f1a6f43e7bab45),\n[openssl](https://github.com/openssl/openssl/blob/master/fuzz/test-corpus.c).\n\n## Performance\n\nFuzz targets should perform well, because high memory usage and/or slow\nexecution speed can slow the down the growth of coverage and finding of new\nbugs. ClusterFuzz provides a [performance analyzer]({{ site.baseurl\n}}/further-reading/clusterfuzz/#performance-analyzer) for each fuzz target that\nshows problems that are impacting performance.\n\n## Not a project member?\n\nIf you are a member of the project you want to fuzz, most of the steps above are\nsimple. However in some cases, someone outside the project team may want to fuzz\nthe code, and the project maintainers are not interested in helping.\n\nIn such cases, we can host the fuzz targets, dictionaries, etc. in OSS-Fuzz's \nrepository and mention them in the Dockerfile. It's not ideal, because the fuzz\ntargets will not be continuously tested, so may quickly bitrot.\n\nExamples: [libxml2](https://github.com/google/oss-fuzz/tree/master/projects/libxml2),\n[c-ares](https://github.com/google/oss-fuzz/tree/master/projects/c-ares), [expat](https://github.com/google/oss-fuzz/tree/master/projects/expat).\n\nIf you are not a project maintainer, we may not be able to CC you to security\nbugs found by OSS-Fuzz.\n"
  },
  {
    "path": "docs/advanced-topics/reproducing.md",
    "content": "---\nlayout: default\ntitle: Reproducing\nparent: Advanced topics\nnav_order: 5\npermalink: /advanced-topics/reproducing/\n---\n\n# Reproducing OSS-Fuzz issues\n{: .no_toc}\n\nYou've been CCed on an OSS-Fuzz issue\n([examples](https://bugs.chromium.org/p/oss-fuzz/issues/list?can=1&q=Type%3ABug%2CBug-Security)).\nNow what? Before attempting to fix the bug, you should be able to reliably\nreproduce it. \n\n- TOC\n{:toc}\n---\n\n## Fuzz target bugs\n\nEvery issue has a [reproducer file]({{ site.baseurl\n}}/reference/glossary/#reproducer) (also know as a \"testcase\" file) attached.\nDownload it. This file contains the bytes that were fed to the [fuzz\ntarget](https://llvm.org/docs/LibFuzzer.html#fuzz-target).\n\n**Note:** If the issue is not public, you will need to login using a\n[Google account](https://support.google.com/accounts/answer/176347?hl=en)\n([why?]({{ site.baseurl\n}}/faq/#why-do-you-require-a-google-account-for-authentication)) that the bug\nreport CCs.\n\nIf you have already\n[integrated]({{ site.baseurl }}/advanced-topics/ideal-integration/)\nthe fuzz target with your build and test system, all you have to do is run this command:\n```bash\n$ ./fuzz_target_binary <testcase_path>\n```\n\nFor timeout bugs, add the `-timeout=65` argument. For OOM bugs, add the\n`-rss_limit_mb=2560` argument. Read more on [how timeouts and OOMs are\nhandled]({{ site.baseurl }}/faq/#how-do-you-handle-timeouts-and-ooms).\n\nDepending on the nature of the bug, the fuzz target binary needs to be built\nwith the appropriate [sanitizer](https://github.com/google/sanitizers)\n(for example, if it's a buffer overflow, build with\n[AddressSanitizer](http://clang.llvm.org/docs/AddressSanitizer.html)).\n\nIf you're not sure how to build the fuzzer using the project's build system,\nyou can also use Docker commands to replicate the exact build steps used by\nOSS-Fuzz, then feed the reproducer input to the fuzz target ([how?]({{\nsite.baseurl }}/getting-started/new-project-guide/#prerequisites), [why?]({{\nsite.baseurl }}/faq/#why-do-you-use-docker)).\n\n## Building using Docker\n\n### Cloning OSS-Fuzz\n\nTo use the following `infra/helper.py` commands, you need a checkout of OSS-Fuzz:\n\n```bash\n$ git clone --depth=1 https://github.com/google/oss-fuzz.git\n$ cd oss-fuzz\n```\n\n### Pull the latest Docker images\n\nDocker images get regularly updated with a newer version of build tools, build\nconfigurations, scripts, and other changes. In some cases, a particular issue\ncan be reproduced only with a fresh image being used. Pull the latest images\nby running the following command:\n\n```bash\n$ python3 infra/helper.py pull_images\n```\n\n### Build the image and the fuzzers\n\nRun the following commands:\n\n```bash\n$ python3 infra/helper.py build_image $PROJECT_NAME\n$ python3 infra/helper.py build_fuzzers --sanitizer <address/memory/undefined> \\\n    --architecture <x86_64/i386> $PROJECT_NAME\n```\n\nThe `sanitizer` used in the report is the value in the\n**Sanitizer** column. It's one of the following:\n  * **address** for AddressSanitizer.\n  * **memory** for MemorySanitizer.\n  * **undefined** for UndefinedBehaviorSanitizer.\n\n**Notes**:\n   * The `architecture` argument is only necessary if you want to specify\n`i386` configuration.\n   * Some bugs (specially ones related to pointer and integer overflows) are reproducible only in 32 bit mode or only in 64 bit mode.\nIf you can't reproduce a particular bug building for x86_64, try building for i386.\n\n## Reproducing bugs\n\nAfter you build an image and a fuzzer, you can reproduce a bug by running the following command:\n\n```bash\n$ python3 infra/helper.py reproduce $PROJECT_NAME <fuzz_target_name> <testcase_path>\n```\n\nFor example, to build the [libxml2](https://github.com/google/oss-fuzz/tree/master/projects/libxml2)\nproject with UndefinedBehaviorSanitizer (`undefined`) instrumentation and\nreproduce a crash testcase for a fuzzer named `libxml2_xml_read_memory_fuzzer`,\nyou would run: \n\n```bash\n$ python3 infra/helper.py build_image libxml2\n$ python3 infra/helper.py build_fuzzers --sanitizer undefined libxml2\n$ python3 infra/helper.py reproduce libxml2 libxml2_xml_read_memory_fuzzer ~/Downloads/testcase\n```\n\n## Reproduce using local source checkout\n\nYou can also mount local sources into the running container by using these commands:\n\n```bash\n$ python3 infra/helper.py build_fuzzers \\\n    --sanitizer <address/memory/undefined> $PROJECT_NAME <source_path>\n$ python3 infra/helper.py reproduce $PROJECT_NAME <fuzz_target_name> <testcase_path>\n```\n\nOnce you reproduce the bug, you can do the following:\n\n- **Fix issue:** Write a patch to fix the issue in your local checkout, then\n   use the previous command to verify the fix (i.e. no crash occurred). \n   [Use gdb]({{ site.baseurl }}/advanced-topics/debugging/#debugging-fuzzers-with-gdb)\n   if needed.\n- **Submit fix:** Submit the fix in the project's repository. ClusterFuzz will\n  automatically pick up the changes, recheck the testcase, and close the\n  issue (in &lt; 1 day).\n- **Improve fuzzing support:** Consider\n   [improving your integration with OSS-Fuzz]({{ site.baseurl }}/advanced-topics/ideal-integration/).\n\n## Reproducing build failures\n\nOur infrastructure runs some sanity tests to make sure that your build was\ncorrectly configured, even if it succeeded. To reproduce these locally, run these commands:\n\n```bash\n$ python3 infra/helper.py build_image $PROJECT_NAME\n$ python3 infra/helper.py build_fuzzers --sanitizer <address/memory/undefined> \\\n    --engine <libfuzzer/afl/honggfuzz/centipede> --architecture <x86_64/i386> $PROJECT_NAME\n$ python3 infra/helper.py check_build  --sanitizer <address/memory/undefined> \\\n    --engine <libfuzzer/afl/honggfuzz/centipede> --architecture <x86_64/i386> $PROJECT_NAME \\\n    <fuzz_target_name>\n```\n\n**Note:** Unless you have a reason to think the build is an `i386` build, the build\nis probably an `x86_64` build and the `architecture` argument can be omitted.\n\nIf you need to reproduce a `coverage` build failure, follow the\n[Code Coverage page]({{ site.baseurl }}/advanced-topics/code-coverage) to build\nyour project and generate a code coverage report.\n"
  },
  {
    "path": "docs/assets/css/just-the-docs-wider.scss",
    "content": "---\n---\n{% include css/just-the-docs.scss.liquid color_scheme=\"wider\" %}\n"
  },
  {
    "path": "docs/faq.md",
    "content": "---\nlayout: default\ntitle: FAQ\nnav_order: 7\npermalink: /faq/\n---\n\n# Frequently Asked Questions\n\n- TOC\n{:toc}\n---\n\n## Where can I learn more about fuzzing?\n\nWe recommend reading [libFuzzer tutorial] and the other docs in [google/fuzzing]\nrepository. These and some other resources are listed on the\n[useful links]({{ site.baseurl }}/reference/useful-links/#tutorials) page.\n\n[google/fuzzing]: https://github.com/google/fuzzing/tree/master/docs\n[libFuzzer tutorial]: https://github.com/google/fuzzing/blob/master/tutorial/libFuzzerTutorial.md\n\n## What kind of projects are you accepting?\n\nWe accept established projects that have a critical impact on infrastructure and\nuser security. We will consider each request on a case-by-case basis, but some\nthings we keep in mind are:\n\n  - Exposure to remote attacks (e.g. libraries that are used to process\n    untrusted input).\n  - Number of users/other projects depending on this project.\n\nWe hope to relax this requirement in the future though, so keep an eye out even\nif we are not able to accept your project at this time!\n\n## How can I find potential fuzz targets in my open source project?\n\nYou should look for places in your code that:\n\n  - consume un-trusted data from users or from the network.\n  - consume complex input data even if it's 'trusted'.\n  - use an algorithm that has two or more implementations\n    (to verify their equivalence).\n  - look for existing fuzz target [examples](https://github.com/google/oss-fuzz/tree/master/projects)\n    and find similarities.\n\n## Where can I store fuzz target sources and the build script if it's not yet accepted upstream?\n\nFuzz target sources as well as the build script may temporarily live inside the\n`projects/<your_project>` directory in the OSS-Fuzz repository. Note that we do\nnot accept integrations that rely on forked repositories. Refer to the\n[ideal integration guide] for the preferred long term solution.\n\n## My project is not open source. Can I use OSS-Fuzz?\n\nYou cannot use OSS-Fuzz, but you can use [ClusterFuzz] which OSS-Fuzz is based\non. ClusterFuzz is an open-source fuzzing infrastructure that you can deploy in\nyour own environment and run continuously at scale.\n\nOSS-Fuzz is a production instance of ClusterFuzz, plus the code living in\n[OSS-Fuzz repository]: build scripts, `project.yaml` files with contacts, etc.\n\n[OSS-Fuzz repository]: https://github.com/google/oss-fuzz\n\n## Why do you use a [different issue tracker](https://bugs.chromium.org/p/oss-fuzz/issues/list) for reporting bugs in OSS projects?\n\nSecurity access control is important for the kind of issues that OSS-Fuzz detects,\nhence why by default issues are only opened on the OSS-Fuzz tracker.\nYou can opt-in to have them on Github as well by adding the `file_github_issue`\nattribute to your `project.yaml` file. Note that this is only for visibility's\npurpose, and that the actual details can be found by following the link to the\nOSS-Fuzz tracker.\n\n## Why do you require a Google account for authentication?\n\nOur [ClusterFuzz]({{ site.baseurl }}/further-reading/clusterfuzz) fuzzing\ninfrastructure and [issue tracker](https://bugs.chromium.org/p/oss-fuzz/issues/list)\nrequire a Google account for authentication. Note that an alternate email\naddress associated with a Google account does not work due to appengine api\nlimitations.\n\n## Why do you use Docker?\n\nBuilding fuzzers requires building your project with a fresh Clang compiler and\nspecial compiler flags.  An easy-to-use Docker image is provided to simplify\ntoolchain distribution. This also simplifies our support for a variety of Linux\ndistributions and provides a reproducible environment for fuzzer\nbuilding and execution.\n\n## How do you handle timeouts and OOMs?\n\nIf a single input to a [fuzz target]({{ site.baseurl }}/reference/glossary/#fuzz-target)\nrequires more than **~25 seconds** or more than **2.5GB RAM** to process, we\nreport this as a timeout or an OOM (out-of-memory) bug\n(examples: [timeouts](https://bugs.chromium.org/p/oss-fuzz/issues/list?can=1&q=%22Crash+Type%3A+Timeout%22),\n[OOMs](https://bugs.chromium.org/p/oss-fuzz/issues/list?can=1&q=\"Crash+Type%3A+Out-of-memory\")).\nThis may or may not be considered as a real bug by the project owners,\nbut nevertheless we treat all timeouts and OOMs as bugs\nsince they significantly reduce the efficiency of fuzzing.\n\nRemember that fuzzing is executed with AddressSanitizer or other\nsanitizers which introduces a certain overhead in RAM and CPU.\n\nWe currently do not have a good way to deduplicate timeout or OOM bugs.\nSo, we report only one timeout and only one OOM bug per fuzz target.\nOnce that bug is fixed, we will file another one, and so on.\n\n## Can I change the default timeout and OOM for a fuzz target?\n\nYes, you can. For this, create a fuzz target options file named `<fuzz-target>.options`,\nwhere `<fuzz-target>` is the executable file name of the fuzz target, in the same\ndirectory as your `project.yaml`. The options file can contain fuzzer-specific\nconfiguration values, such as:\n\n```\n[libfuzzer]\nrss_limit_mb = 6000\ntimeout = 30\n```\n\n## My library gracefully handles allocation failures, why are OOMs reported?\n\nOOM detection is done *not* by instrumenting memory allocation routines such as `malloc`\nto have them return NULL, but using a separate watchdog thread that measures the resident\nset size (RSS) on a periodic basis. Therefore, your fuzz target might successfully\nallocate more than the configured max RSS, and yet get killed shortly afterwards.\n\nThe only reliable way to avoid this is for your fuzz target to use a custom allocator\nthat will prevent allocating more memory than a given limit. You can find a more\ndetailed discussion of this topic, as well as links to the solution implemented\nby a specific project, in [this issue](https://github.com/google/oss-fuzz/issues/1830).\n\n## Can I launch an additional process (e.g. a daemon) from my fuzz target?\n\nNo. In order to get all the benefits of in-process, coverage-guided fuzz testing,\nit is required to run everything inside a single process. Any child processes\ncreated outside the main process introduces heavy launch overhead and is not\nmonitored for code coverage.\n\nAnother rule of thumb is: \"the smaller fuzz target is, the better it is\". It is\nexpected that your project will have many fuzz targets to test different\ncomponents, instead of a single fuzz target trying to cover everything.\nThink of fuzz target as a unit test, though it is much more powerful since it\nhelps to test millions of data permutations rather than just one.\n\n## What if my fuzz target finds a bug in another project (dependency) ?\n\nEvery bug report has a crash stack-trace that shows where the crash happened.\nUsing that, you can debug the root cause and see which category the bug falls in:\n\n- If this is a bug is due to an incorrect usage of the dependent project's API\nin your project, then you need to fix your usage to call the API correctly.\n- If this is a real bug in the dependent project, then you should CC the\nmaintainers of that project on the bug. Once CCed, they will get automatic\naccess to all the information necessary to reproduce the issue. If this project\nis maintained in OSS-Fuzz, you can search for contacts in the respective\nproject.yaml file.\n\n## What if my fuzzer does not find anything?\n\nIf your fuzz target is running for many days and does not find bugs or new\ncoverage, it may mean several things:\n- We've covered all reachable code. In order to cover more code we need more\n  fuzz targets.\n- The [seed corpus]({{ site.baseurl }}/getting-started/new-project-guide#seed-corpus) is not good enough and the\n  fuzzing engine(s) are not able to go deeper based on the existing seeds.\n  Need to add more seeds.\n- There is some crypto/crc stuff in the code that will prevent any fuzzing\n  engine from going deeper, in which case the crypto should be disabled in\n  [fuzzing mode](https://llvm.org/docs/LibFuzzer.html#fuzzer-friendly-build-mode).\n  Examples: [openssl](https://github.com/openssl/openssl/tree/master/fuzz#reproducing-issues),\n  [boringssl](https://boringssl.googlesource.com/boringssl/+/HEAD/FUZZING.md#Fuzzer-mode)\n- It is also possible that the fuzzer is running too slow\n  (you may check the speed of your targets at https://oss-fuzz.com/)\n\nIn either case, look at the\n[coverage reports]({{ site.baseurl }}/further-reading/clusterfuzz#coverage-reports)\nfor your target(s) and figure out why some parts of the code are not covered.\n\n## What if my fuzzer does not find new coverage or bugs after a while?\n\nIt is common for fuzzers to plateau and stop finding new coverage or bugs.\n[Fuzz Introspector](https://github.com/ossf/fuzz-introspector) helps you\nevaluate your fuzzers' performance.\nIt can help you identify bottlenecks causing your fuzzers to plateau.\nIt provides aggregated and individual fuzzer reachability and coverage reports.\nDevelopers can either introduce a new fuzz target or modify an existing one to\nreach previously unreachable code.\nHere are\n[case studies](https://github.com/ossf/fuzz-introspector/blob/main/doc/CaseStudies.md)\nwhere Fuzz Introspector helped developers improve fuzzing of a project.\nFuzz Introspector reports are available on the [OSS-Fuzz homepage](https://oss-fuzz.com/)\nor through this [index](http://oss-fuzz-introspector.storage.googleapis.com/index.html).\n\nDevelopers can also use Fuzz Introspector on their local machines.\nDetailed instructions are available\n[here](https://github.com/ossf/fuzz-introspector/tree/main/oss_fuzz_integration#build-fuzz-introspector-with-oss-fuzz).\n\n## Why are code coverage reports public?\n\nWe work with open source projects and try to keep as much information public as\npossible. We believe that public code coverage reports do not put users at risk,\nas they do not indicate the presence of bugs or lack thereof.\n\n## Why is the coverage command complaining about format compatibility issues?\n\nThis may happen if the Docker images fetched locally become out of sync. Make\nsure you run the following command to pull the most recent images:\n\n```bash\n$ python3 infra/helper.py pull_images\n```\n\nPlease refer to\n[code coverage]({{ site.baseurl }}/advanced-topics/code-coverage/) for detailed\ninformation on code coverage generation.\n\n## What happens when I rename a fuzz target ?\n\nIf you rename your fuzz targets, the existing bugs for those targets will get\nclosed and fuzzing will start from scratch from a fresh corpora\n(seed corpus only). Similar corpora will get accumulated over time depending on\nthe number of cpu cycles that original fuzz target has run. If this is not\ndesirable, make sure to copy the accumulated corpora from the original fuzz\ntarget (instructions to download\n[here]({{ site.baseurl }}/advanced-topics/corpora/#downloading-the-corpus)) and\nrestore it to the new GCS location later (instruction to find the\nnew location [here]({{ site.baseurl }}/advanced-topics/corpora/#viewing-the-corpus-for-a-fuzz-target)).\n\n## Does OSS-Fuzz support AFL or honggfuzz or Centipede?\n\nOSS-Fuzz *uses* the following\n[fuzzing engines]({{ site.baseurl }}/reference/glossary/#fuzzing-engine):\n\n1. [libFuzzer](https://llvm.org/docs/LibFuzzer.html).\n1. [AFL++](https://github.com/AFLplusplus/AFLplusplus), an improved and\n   well-maintained version of [AFL](https://lcamtuf.coredump.cx/afl/).\n1. [Honggfuzz](https://github.com/google/honggfuzz).\n1. [Centipede (Experimental)](https://github.com/google/centipede).\n\nFollow the [new project guide] and OSS-Fuzz will use all its fuzzing engines\non your code.\n\n## What are the specs on your machines?\n\nOSS-Fuzz builders have 32CPU/28.8GB RAM.\n\nFuzzing machines only have a single core and fuzz targets should not use more\nthan 2.5GB of RAM.\n\n## Are there any restrictions on using test cases / corpora generated by OSS-Fuzz?\n\nNo, you can freely use (i.e. share, add to your repo, etc.) the test cases and\ncorpora generated by OSS-Fuzz. OSS-Fuzz infrastructure is fully open source\n(including [ClusterFuzz], various fuzzing engines, and other dependencies). We\nhave no intent to restrict the use of the artifacts produced by OSS-Fuzz.\n\n[ClusterFuzz]: https://github.com/google/clusterfuzz\n[new project guide]: {{ site.baseurl }}/getting-started/new-project-guide/\n[ideal integration guide]: {{ site.baseurl }}/getting-started/new-project-guide/\n"
  },
  {
    "path": "docs/further-reading/clusterfuzz.md",
    "content": "---\nlayout: default\ntitle: ClusterFuzz\nparent: Further reading\nnav_order: 1\npermalink: /further-reading/clusterfuzz/\n---\n\n# ClusterFuzz\n\n[ClusterFuzz](https://github.com/google/clusterfuzz) is the distributed fuzzing\ninfrastructure behind OSS-Fuzz. It was initially built for fuzzing Chrome at\nscale.\n\n- TOC\n{:toc}\n---\n\n## Web interface\n\nClusterFuzz provides a [web interface](https://oss-fuzz.com)\nto view statistics about your fuzz targets, as well as current crashes.\n\n*Note*: Access is restricted to project developers who we auto CC on new bug\nreports.\n\n## Testcase reports\n\nClusterFuzz will automatically de-duplicate and file reproducible crashes into\nour [bug tracker](https://bugs.chromium.org/p/oss-fuzz/issues/list). We provide\na crash report page that gives you the stack trace, a link to the crashing\ntestcase, and regression ranges where the bug was most likely introduced.\n\n![report]({{ site.baseurl }}/images/pcre2_testcase.png?raw=true)\n\n## Fuzzer stats\n\nYou can view statistics about your fuzz targets (e.g. speed, coverage\ninformation, memory usage) on our fuzzer statistics dashboard.\n\n![stats]({{ site.baseurl }}/images/freetype_stats_graphs.png?raw=true)\n\n![stats]({{ site.baseurl }}/images/freetype_stats_table.png?raw=true)\n\n## Coverage reports\n\nWe provide coverage reports, where we highlight the parts of source code that\nare being reached by your fuzz target. Make sure to look at the uncovered code\nmarked in red and add appropriate fuzz targets to cover those use cases.\n\n![coverage_1]({{ site.baseurl }}/images/freetype_coverage_1.png?raw=true)\n![coverage_2]({{ site.baseurl }}/images/freetype_coverage_2.png?raw=true)\n\n## Performance analyzer\n\nYou can view performance issues that your fuzz target is running into (e.g.\nleaks, timeouts, etc) by clicking on `Performance` link on our fuzzer statistics\ndashboard. Make sure to fix all cited issues, so as to keep your fuzz target\nrunning efficiently and finding new bugs.\n\n![performance_analyzer]({{ site.baseurl }}/images/expat_performance_analyzer.png?raw=true)\n\n## Crash stats\n\nYou can view statistics of crashes over time on our crash statistics dashboard.\n\n![crash_stats]({{ site.baseurl }}/images/crash_stats.png?raw=true)\n"
  },
  {
    "path": "docs/further-reading/further_reading.md",
    "content": "---\nlayout: default\ntitle: Further reading\nhas_children: true\nnav_order: 4\npermalink: /further-reading/\n---\n\n# Further reading\n"
  },
  {
    "path": "docs/further-reading/fuzzer_environment.md",
    "content": "---\nlayout: default\ntitle: Fuzzer environment\nparent: Further reading\nnav_order: 2\npermalink: /further-reading/fuzzer-environment/\n---\n\n# Fuzzer environment on ClusterFuzz\n\nYour fuzz targets will be run on a\n[Google Compute Engine](https://cloud.google.com/compute/) VM (Linux).\n\n- TOC\n{:toc}\n---\n\n## Runtime Dependencies\n\nYou should not make any assumptions on the availability of dependent packages \nin the execution environment. Packages that are installed via\n[Dockerfile]({{ site.baseurl }}/getting-started/new-project-guide/#dockerfile)\nor built as part of \n[build.sh]({{ site.baseurl }}/getting-started/new-project-guide/#buildsh)\nare not available on the bot runtime environment (where the fuzz targets run).\n\nIf you need these dependencies in the runtime environment, you can either:\n\n- (recommended) Build the dependencies statically in\n[build.sh]({{ site.baseurl }}/getting-started/new-project-guide/#buildsh)\n([example](https://github.com/google/oss-fuzz/blob/64f8b6593da141b97c98c7bc6f07df92c42ee010/projects/ffmpeg/build.sh#L26)).\nTheir source code should be inside the `$SRC` directory so that coverage can find it.\n\n- Or install the packages via Dockerfile\n([example](https://github.com/google/oss-fuzz/blob/2d5e2ef84f281e6ab789055aa735606d3122fda9/projects/tor/Dockerfile#L19))\nand then link statically against them\n([example](https://github.com/google/oss-fuzz/blob/2d5e2ef84f281e6ab789055aa735606d3122fda9/projects/tor/build.sh#L40)).\n**Dependencies built in this way will not be instrumented** and may prevent\nthe fuzzer from finding bugs if they are involved in the execution of a fuzz target.\n\nAll build artifacts needed during fuzz target execution should be inside the\n`$OUT` directory. Only those artifacts are archived and used on the bots.\nEverything else is ignored (e.g. artifacts in `$WORK`, `$SRC`, etc) and hence\nis not available in the execution environment.\n\nWe strongly recommend static linking because it just works. \nHowever dynamic linking can work if shared objects are included in the `$OUT` directory and are loaded relative\nto `'$ORIGIN'`, the path of the binary (see the discussion of `'$ORIGIN'` [here](http://man7.org/linux/man-pages/man8/ld.so.8.html)).\nA fuzzer can be instructed to load libraries relative to `'$ORIGIN'` during compilation (i.e. `-Wl,-rpath,'$ORIGIN/lib'` )\nor afterwards using `chrpath -r '$ORIGIN/lib' $OUT/$fuzzerName` ([example](https://github.com/google/oss-fuzz/blob/09aa9ac556f97bd4e31928747eca0c8fed42509f/projects/php/build.sh#L40)). Note that `'$ORIGIN'` should be surrounded\nby single quotes because it is not an environment variable like `$OUT` that can be retrieved during execution of `build.sh`.\nIts value is retrieved during execution of the binary. You can verify that you did this correctly using `ldd <fuzz_target_name>` and the `check_build` command in `infra/helper.py`.\n\nYou should ensure that the fuzz target works correctly by using `run_fuzzer`\ncommand (see instructions\n[here]({{ site.baseurl }}/getting-started/new-project-guide/#testing-locally)).\nThis command uses a clean base-runner docker container and not the base-builder\ndocker container created during build-time.\n\n## argv[0]\n\nYou must not modify `argv[0]`. It is required for certain things to work\ncorrectly.\n\n## Current working directory\n\nYou should not make any assumptions about the current working directory of your\nfuzz target. If you need to load data files, please use `argv[0]` to get the\ndirectory where your fuzz target executable is located.\n\n## File system\n\nEverything except `/tmp` is read-only, including the directory that your fuzz\ntarget executable lives in.\n\n`/dev` is also unavailable.\n\n## Hardware\n\nYour project should not be compiled with `-march=native` or `-mtune=native`\nflags, as the build infrastructure and fuzzing machines may have different CPUs\nas well as other hardware differences. You may however use `-mtune=generic`.\n"
  },
  {
    "path": "docs/getting-started/accepting_new_projects.md",
    "content": "---\nlayout: default\ntitle: Accepting new projects\nparent: Getting started\nnav_order: 1\npermalink: /getting-started/accepting-new-projects/\n---\n\n# Accepting New Projects\n\nTo be accepted to OSS-Fuzz, an open-source project must\nhave a significant user base and/or be critical to the global IT infrastructure.\n\nTo submit a new project, do the following:\n\n1. [Create a pull request](https://help.github.com/articles/creating-a-pull-request/)\nwith a new `projects/<project_name>/project.yaml` file\n([example](https://github.com/google/oss-fuzz/tree/master/projects/libarchive/project.yaml)).\n    **Note:** `project_name` can only contain alphanumeric characters,\n    underscores(_) or dashes(-).\n2. In the file, provide the following information:\n  * Your project's homepage. ([`homepage`]({{ site.baseurl }}/getting-started/new-project-guide/#homepage))\n  * Your project's main repository URL. ([`main_repo`]({{ site.baseurl }}/getting-started/new-project-guide/#main_repo))\n  * Your project's primary language. ([`language`]({{ site.baseurl }}/getting-started/new-project-guide/#language))\n  * An email address for the engineering contact to be CCed on new issues ([`primary_contact`]({{ site.baseurl }}/getting-started/new-project-guide/#primary)), satisfying the following:\n       * The address belongs to an established project committer (according to VCS logs).\n        If the address isn't you, or if the address differs from VCS, we'll require an informal\n        email verification.\n       * The address is associated with a Google account\n        ([why?]({{ site.baseurl }}/faq/#why-do-you-require-a-google-account-for-authentication)).\n        If you use an alternate email address\n        [linked to a Google Account](https://support.google.com/accounts/answer/176347?hl=en),\n        you'll only get access to [filed bugs in the issue tracker](https://bugs.chromium.org/p/oss-fuzz/issues/list), not to the [ClusterFuzz]({{ site.baseurl }}/further-reading/clusterfuzz)\n        dashboard. This is due to appengine API limitations.\n3. Once your project is accepted, configure it by following the\n  [New Project Guide]({{ site.baseurl }}/getting-started/new-project-guide/).\n"
  },
  {
    "path": "docs/getting-started/bug_disclosure_guidelines.md",
    "content": "---\nlayout: default\ntitle: Bug disclosure guidelines\nparent: Getting started\nnav_order: 4\npermalink: /getting-started/bug-disclosure-guidelines/\n---\n\n## Bug Disclosure Guidelines\n\nFollowing [Google's standard disclosure policy](https://googleprojectzero.blogspot.com/2015/02/feedback-and-data-driven-updates-to.html),\nOSS-Fuzz will adhere to following disclosure principles:\n\n  - **Deadline**. After notifying project authors, we will open reported\n    issues to the public in 90 days, or after the fix is released (whichever\n    comes earlier).\n  - **Weekends and holidays**. If a deadline is due to expire on a weekend,\n    the deadline will be moved to the next normal work day.\n  - **Grace period**. We have a 14-day grace period. If a 90-day deadline\n    expires but the upstream engineers let us know before the deadline that a\n    patch is scheduled for release on a specific day within 14 days following\n    the deadline, the public disclosure will be delayed until the availability\n    of the patch.\n"
  },
  {
    "path": "docs/getting-started/continuous_integration.md",
    "content": "---\nlayout: default\ntitle: Continuous Integration\nparent: Getting started\nnav_order: 5\npermalink: /getting-started/continuous-integration/\n---\n\n# Continuous Integration\n\nOSS-Fuzz offers **CIFuzz**, a GitHub action/CI job that runs your fuzz targets\non pull requests. This works similarly to running unit tests in CI. CIFuzz helps\nyou find and fix bugs before they make it into your codebase.\nCurrently, CIFuzz primarily supports projects hosted on GitHub.\nNon-OSS-Fuzz users can use CIFuzz with additional features through\n[ClusterFuzzLite](https://google.github.io/clusterfuzzlite/).\n\n## How it works\n\nCIFuzz builds your project's fuzzers from the source at a particular\npull request or commit. Then CIFuzz runs the fuzzers for a short amount of time.\nIf CIFuzz finds a crash, CIFuzz reports the stacktrace, makes the crashing\ninput available for download and the CI test fails (red X).\n\nIf CIFuzz doesn't find a crash during the allotted time, the CI test passes\n(green check). If CIFuzz finds a crash, it reports the crash only if both of\nfollowing are true:\n* The crash is reproducible (on the PR/commit build).\n* The crash does not occur on older OSS-Fuzz builds. (If the crash does occur\n  on older builds, then it was not introduced by the PR/commit\n  being tested.)\n\nIf your project supports [OSS-Fuzz's code coverage]({{ site.baseurl }}/advanced-topics/code-coverage),\nCIFuzz only runs the fuzzers affected by a pull request/commit.\nOtherwise it will divide up the allotted fuzzing time (10 minutes by default)\namong all fuzzers in the project.\n\nCIFuzz uses 30 day old/public regressions and corpora from OSS-Fuzz. This makes\nfuzzing more effective and gives you regression testing for free.\n\n## Requirements\n\n1. Your project must be integrated with OSS-Fuzz.\n1. Your project is hosted on GitHub.\n1. Your repository needs to be cloned with `git` in oss-fuzz Dockerfile (do not use `go get` or other methods)\n\n## Integrating into your repository\n\nYou can integrate CIFuzz into your project using the following steps:\n1. Create a `.github` directory in the root of your project.\n1. Create a `workflows` directory inside of your `.github` directory.\n1. Copy the example [`cifuzz.yml`](https://github.com/google/oss-fuzz/blob/master/infra/cifuzz/example_cifuzz.yml)\nfile over from the OSS-Fuzz repository to the `workflows` directory.\n1. Change the `oss-fuzz-project-name` value in `cifuzz.yml` from `example` to the name of your OSS-Fuzz project. It is **very important** that you use your OSS-Fuzz project name which is case sensitive. This name\nis the name of your project's subdirectory in the [`projects`](https://github.com/google/oss-fuzz/tree/master/projects) directory of OSS-Fuzz.\n1. Set the value of `fuzz-seconds`. The longest time that the project maintainers are acceptable with should be used. This value should be at minimum 600 seconds and scale with project size.\n\nYour directory structure should look like the following:\n```\nproject\n|___ .github\n|    |____ workflows\n|          |____ cifuzz.yml\n|___ other-files\n```\n\ncifuzz.yml for an example project:\n\n```yaml\nname: CIFuzz\non: [pull_request]\npermissions: {}\njobs:\n Fuzzing:\n   runs-on: ubuntu-latest\n   permissions:\n     security-events: write\n   steps:\n   - name: Build Fuzzers\n     id: build\n     uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master\n     with:\n       oss-fuzz-project-name: 'example'\n       language: c++\n   - name: Run Fuzzers\n     uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master\n     with:\n       oss-fuzz-project-name: 'example'\n       language: c++\n       fuzz-seconds: 600\n       output-sarif: true\n   - name: Upload Crash\n     uses: actions/upload-artifact@v4\n     if: failure() && steps.build.outcome == 'success'\n     with:\n       name: artifacts\n       path: ./out/artifacts\n   - name: Upload Sarif\n     if: always() && steps.build.outcome == 'success'\n     uses: github/codeql-action/upload-sarif@v2\n     with:\n      # Path to SARIF file relative to the root of the repository\n      sarif_file: cifuzz-sarif/results.sarif\n      checkout_path: cifuzz-sarif\n```\n\n\n### Optional configuration\n\n#### Configurable Variables\n\n`language`: (optional) The language your target program is written in. Defaults\nto `c++`. This should be the same as the value you set in `project.yaml`. See\n[this explanation]({{ site.baseurl }}//getting-started/new-project-guide/#language)\nfor more details.\n\n`fuzz-seconds`: Determines how long CIFuzz spends fuzzing your project in seconds.\nThe default is 600 seconds. The GitHub Actions max run time is 21600 seconds (6\nhours). This variable is only meaningful when supplied to the `run_fuzzers`\naction, not the `build_fuzzers` action.\n\n`dry-run`: Determines if CIFuzz surfaces errors. The default value is `false`. When set to `true`,\nCIFuzz will never report a failure even if it finds a crash in your project.\nThis requires the user to manually check the logs for detected bugs. If dry run mode is desired,\nmake sure to set the dry-run parameters in both the `Build Fuzzers` and `Run Fuzzers` action step.\n\n`allowed-broken-targets-percentage`: Can be set if you want to set a stricter\nlimit for broken fuzz targets than OSS-Fuzz's check_build. Most users should\nnot set this. This value is only meaningful when supplied to the `run_fuzzers`\naction, not the `build_fuzzers` action.\n\n`sanitizer`: Determines a sanitizer to build and run fuzz targets with. The choices are `'address'`,\n`'memory'` and `'undefined'`. The default is `'address'`. It is important to note that the `Build Fuzzers`\nand the `Run Fuzzers` sanitizer field needs to be the same. To specify a list of sanitizers\na [matrix](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)\ncan be used. To use a sanitizer add it to the list of sanitizers in the matrix field below:\n\n`report-timeouts`: Determines whether to report fails due to timeouts.\n\n`report-ooms`: Determines whether to report fails due to OOM.\n\n```yaml\n{% raw %}\nname: CIFuzz\non: [pull_request]\npermissions: {}\njobs:\n Fuzzing:\n   runs-on: ubuntu-latest\n   permissions:\n     security-events: write\n   strategy:\n     fail-fast: false\n     matrix:\n       sanitizer: [address, undefined, memory]\n   steps:\n   - name: Build Fuzzers (${{ matrix.sanitizer }})\n     id: build\n     uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master\n     with:\n       oss-fuzz-project-name: 'example'\n       language: c++\n       sanitizer: ${{ matrix.sanitizer }}\n   - name: Run Fuzzers (${{ matrix.sanitizer }})\n     uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master\n     with:\n       oss-fuzz-project-name: 'example'\n       language: c++\n       fuzz-seconds: 600\n       sanitizer: ${{ matrix.sanitizer }}\n       output-sarif: true\n   - name: Upload Crash\n     uses: actions/upload-artifact@v4\n     if: steps.build.outcome == 'success'\n     with:\n       name: ${{ matrix.sanitizer }}-artifacts\n       path: ./out/artifacts\n   - name: Upload Sarif\n    if: always() && steps.build.outcome == 'success'\n    uses: github/codeql-action/upload-sarif@v2\n    with:\n      # Path to SARIF file relative to the root of the repository\n      sarif_file: cifuzz-sarif/results.sarif\n      checkout_path: cifuzz-sarif\n{% endraw %}\n```\n\n#### Branches and paths\n\nYou can make CIFuzz trigger only on certain branches or paths by following the\ninstructions [here](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions).\nFor example, the following code can used to trigger CIFuzz only on changes to\nC/C++ code residing on master and release branches:\n\n```yaml\nname: CIFuzz\non:\n  pull_request:\n    branches:\n      - master\n      - 'releases/**'\n    paths:\n      - '**.c'\n      - '**.cc'\n      - '**.cpp'\n      - '**.cxx'\n      - '**.h'\npermissions: {}\njobs:\n Fuzzing:\n   runs-on: ubuntu-latest\n   steps:\n   - name: Build Fuzzers\n     id: build\n     uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master\n     with:\n       oss-fuzz-project-name: 'example'\n       language: c++\n   - name: Run Fuzzers\n     uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master\n     with:\n       oss-fuzz-project-name: 'example'\n       language: c++\n       fuzz-seconds: 600\n   - name: Upload Crash\n     uses: actions/upload-artifact@v4\n     if: failure() && steps.build.outcome == 'success'\n     with:\n       name: artifacts\n       path: ./out/artifacts\n```\n\nYou can checkout CIFuzz configs for OSS-Fuzz projects. Example -\n[systemd](https://github.com/systemd/systemd/blob/main/.github/workflows/cifuzz.yml),\n[curl](https://github.com/curl/curl/blob/master/.github/workflows/fuzz.yml).\n\n## Ubuntu 24.04 Support\n\nCIFuzz supports building and running fuzzers in an Ubuntu 24.04 environment.\nExisting projects will continue to use the legacy environment (Ubuntu 20.04) by default,\npreserving current behavior.\n\nTo migrate your project to Ubuntu 24.04, add the following line to your `project.yaml`:\n\n```yaml\nbase_os_version: ubuntu-24-04\n```\n\nFor OSS-Fuzz projects, this file is located at `projects/<project_name>/project.yaml`.\nFor external projects (ClusterFuzzLite), this file is typically located at `.clusterfuzzlite/project.yaml`.\n\n## Understanding results\n\nThe results of CIFuzz can be found in two different places.\n\n* Run fuzzers log:\n    1. This log can be accessed in the `actions` tab of a CIFuzz integrated repo.\n    1. Click on the `CIFuzz` button in the workflow selector on the left hand side.\n    1. Click on the event triggered by your desired pull request.\n    1. Click the `Fuzzing` workflow.\n    1. Select the `Run Fuzzer` drop down. It should show the timestamps and results\n    from each of the fuzz targets.\n\n![Finding fuzzer output](../images/run_fuzzers.png)\n\n\n\n*  Artifacts:\nWhen the fuzzer crashes the input file that causes the crash is uploaded as an\nartifact.\nTo download the artifact, do the following steps:\n1. Click on the summary from the run, as illustrated in the screenshot below:\n\n![github-actions-summary]\n\n2. Click on the artifact you wish to download from the summary page, as\n   illustrated in the screenshot below:\n\n![github-actions-download-crash]\n\n[github-actions-summary]: (https://raw.githubusercontent.com/google/clusterfuzzlite/refs/heads/bucket/images/github-actions-summary.png)\n[github-actions-download-crash]: (https://raw.githubusercontent.com/google/clusterfuzzlite/refs/heads/bucket/images/github-actions-download-crash.png)\n\n## Feedback/Questions/Issues\n\nCreate an issue in [OSS-Fuzz](https://github.com/google/oss-fuzz/issues/new) if you have questions or any other feedback on CIFuzz.\n"
  },
  {
    "path": "docs/getting-started/getting_started.md",
    "content": "---\nlayout: default\ntitle: Getting started\nhas_children: true\nnav_order: 2\npermalink: /getting-started/\n---\n\n# Getting started\nThese pages walk you through the process of integrating your open source project\nwith OSS-Fuzz.\n"
  },
  {
    "path": "docs/getting-started/integration_rewards.md",
    "content": "---\nlayout: default\ntitle: Integration rewards\nparent: Getting started\nnav_order: 3\npermalink: /getting-started/integration-rewards/\n---\n\n# Integration rewards\n\nWe encourage you to apply for integration rewards (up to **$30,000**) once your project\nis successfully integrated with OSS-Fuzz. Please see the full details\n[here](https://bughunters.google.com/about/rules/5097259337383936/oss-fuzz-reward-program-rules).\n\nTo submit your application for a reward, please fill out [this form](https://goo.gle/oss-fuzz-submission).\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/bazel.md",
    "content": "---\nlayout: default\ntitle: Integrating a Bazel project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 5\npermalink: /getting-started/new-project-guide/bazel/\n---\n\n# Integrating a Bazel project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\n## Bazel projects\n\nThe process of integrating a project using the [Bazel](https://bazel.build/)\nbuild system with OSS-Fuzz is very similar to the general\n[Setting up a new project]({{ site.baseurl }}/getting-started/new-project-guide/)\nprocess. The key specifics of integrating a Bazel project are outlined below.\n\n## Fuzzing support in Bazel\n\nFor Bazel-based projects, we recommend using the\n[`rules_fuzzing`](https://github.com/bazelbuild/rules_fuzzing) extension library\nfor defining fuzz tests. `rules_fuzzing` provides support for building and running\nfuzz tests under\n[multiple sanitizer and fuzzing engine configurations][rules-fuzzing-usage].\nIt also supports specifying corpora and dictionaries as part of the fuzz test\ndefinition.\n\nThe fuzzing rules provide out-of-the-box support for building and packaging fuzz\ntest artifacts in the OSS-Fuzz format. Each `//path/to:fuzz_test` fuzz test\ntarget automatically has a `//path/to:fuzz_test_oss_fuzz` packaging target that\n(a) builds the fuzz test using the instrumentation and engine library specified\nin the OSS-Fuzz environment variables, and (b) generates an archive containing\nthe binary and its associated artifacts (corpus, dictionary, etc.). Moreover,\nOSS-Fuzz provides a standard tool to automatically process these targets,\nsubstantially simplifying the `build.sh` script (see below).\n\n[rules-fuzzing-usage]: https://github.com/bazelbuild/rules_fuzzing#using-the-rules-in-your-project\n\n## Project files\n\nThis section explains how to integrate the fuzz tests written using the\n`rules_fuzzing` library with OSS-Fuzz. You can also see a complete example in the\n[`bazel-rules-fuzzing-test`](https://github.com/google/oss-fuzz/tree/master/projects/bazel-rules-fuzzing-test)\nproject.\n\nThe structure of the project directory in the OSS-Fuzz repository does not\ndiffer for Bazel-based projects. The project files have the following specific\naspects.\n\n### project.yaml\n\nOnly C++ projects are currently supported.\n\nSince the OSS-Fuzz target builds the fuzz test using the instrumentation and\nengine specified in the OSS-Fuzz environment variables, all the engine and\nsanitizer configurations supported in the `project.yaml` file are automatically\nsupported by the fuzzing rules.\n\n### Dockerfile\n\nThere is no need to install Bazel in your Docker image. The OSS-Fuzz builder\nimage provides the `bazel` executable through the\n[Bazelisk](https://github.com/bazelbuild/bazelisk) launcher, which will fetch\nand use the latest Bazel release. If your project requires a particular Bazel\nversion, create a\n[`.bazelversion`](https://docs.bazel.build/versions/master/updating-bazel.html)\nfile in your repository root with the desired version string.\n\n### build.sh\n\nYour `build.sh` script essentially needs to perform three steps: (1) selecting\nwhich fuzz tests to build, (2) building their OSS-Fuzz package targets in the\nright configuration, and (3) copying the build artifacts to the `${OUT}/`\ndestination.\n\nOSS-Fuzz provides a\n[`bazel_build_fuzz_tests`](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/bazel_build_fuzz_tests)\ntool that implements these steps in a standard way, so in most cases your\nbuild script only needs to invoke this command with no arguments.\n\nIf necessary, the behavior of the tool can be customized through a set of\nenvironment variables. The most common are:\n\n* `BAZEL_EXTRA_BUILD_FLAGS` are extra build flags passed on the Bazel command\n   line.\n* `BAZEL_FUZZ_TEST_TAG` and `BAZEL_FUZZ_TEST_EXCLUDE_TAG` can be overridden to\n  specify which target tags to use when determining what fuzz tests to include.\n  By default, the tool selects all the fuzz tests except for those tagged as\n  `\"no-oss-fuzz\"`.\n* `BAZEL_FUZZ_TEST_QUERY` overrides the Bazel query the tool uses to identify\n  the fuzz tests to build, if the tag-based approach is not sufficient.\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/go_lang.md",
    "content": "---\nlayout: default\ntitle: Integrating a Go project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 1\npermalink: /getting-started/new-project-guide/go-lang/\n---\n\n# Integrating a Go project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\nThe process of integrating a project written in Go with OSS-Fuzz is very similar\nto the general\n[Setting up a new project]({{ site.baseurl }}/getting-started/new-project-guide/)\nprocess. The key specifics of integrating a Go project are outlined below.\n\n## Go-fuzz support\n\nOSS-Fuzz supports **go-fuzz** in the\n[libFuzzer compatible mode](https://github.com/mdempsky/go114-fuzz-build)\nonly. In that mode, fuzz targets for Go use the libFuzzer engine with native Go\ncoverage instrumentation. Binaries compiled in this mode provide the same\nlibFuzzer command line interface as non-Go fuzz targets.\n\n## Native Go Fuzzing support\n\nOSS-fuzz supports [fuzzers written for the native Go 1.18 engine](https://go.dev/doc/fuzz/). These fuzzers are built as libFuzzer binaries in a similar fashion as fuzzers written for the go-fuzz engine. Because of that, dictionaries and seed corpora should be handled in accordance with [the OSS-fuzz documentation](https://google.github.io/oss-fuzz/getting-started/new-project-guide/#seed-corpus).\nUnlike libFuzzer/go-fuzz targets which must accept one data buffer, fuzz targets written for the Native Go engine can accept any number of arguments of any type. Here is an example of a valid fuzzer with multiple arguments:\n\n```go\npackage demofuzzing\n\nimport (\n    \"fmt\"\n    \"testing\"\n)\n\nfunc FuzzDemo(f *testing.F) {\n    f.Fuzz(func(t *testing.T, data1 string, data2 uint32, data3 float64) {\n        fmt.Println(data1)\n        fmt.Println(data2)\n        fmt.Println(data3)\n    })\n}\n```\n\nSome requirements for native Go 1.18 fuzzers are:\n* The only `testing.F` method supported is currently `F.Fuzz()`.\n* `F.Add()` will not add seeds when fuzzing. To provide OSS-fuzz with a seed corpus, follow the documentation [here](https://google.github.io/oss-fuzz/getting-started/new-project-guide/#seed-corpus).\n\n## Project files\n\nFirst, you need to write a Go fuzz target. This fuzz target should reside in your project\nrepository\n([example](https://github.com/golang/go/blob/4ad13555184eb0697c2e92c64c1b0bdb287ccc10/src/html/fuzz.go#L13)).\n\nThe structure of the project directory in OSS-Fuzz repository doesn't differ for\nprojects written in Go. The project files have the following Go specific\naspects.\n\n### project.yaml\n\nThe `language` attribute must be specified.\n\n```yaml\nlanguage: go\n```\n\nThe only supported fuzzing engine and sanitizer are `libfuzzer` and `address`,\nrespectively.\n[Example](https://github.com/google/oss-fuzz/blob/356f2b947670b7eb33a1f535c71bc5c87a60b0d1/projects/syzkaller/project.yaml#L7):\n\n```yaml\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n```\n\n### Dockerfile\n\nThe Dockerfile should start by `FROM gcr.io/oss-fuzz-base/base-builder-go`\n\nThe OSS-Fuzz builder image has the latest stable release of Golang installed. In\norder to install dependencies of your project, add `RUN git clone ...` command to\nyour Dockerfile.\n[Example](https://github.com/google/oss-fuzz/blob/356f2b947670b7eb33a1f535c71bc5c87a60b0d1/projects/syzkaller/Dockerfile#L23):\n\n```dockerfile\n# Dependency for one of the fuzz targets.\nRUN git clone --depth 1 https://github.com/ianlancetaylor/demangle\n```\n\ngo-fuzz will then automatically download the dependencies based on the go.mod file\n\n### build.sh\n\nIn order to build a Go fuzz target, you need to call `go-fuzz`\ncommand first, and then link the resulting `.a` file against\n`$LIB_FUZZING_ENGINE` using the `$CXX $CXXFLAGS ...` command.\n\nFor go-fuzz fuzzers, the best way to do this is by using the [`compile_go_fuzzer` script](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/compile_go_fuzzer), and for native Go 1.18 fuzzers it is recommended to use the [`compile_native_go_fuzzer` script](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/compile_native_go_fuzzer). Both of these also support coverage builds.\n\n`compile_native_go_fuzzer` requires two dependencies which can be installed with:\n```bash\ngo install github.com/AdamKorcz/go-118-fuzz-build@latest\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n```\n\nA usage example from go-dns project is\n\n```sh\ncompile_go_fuzzer github.com/miekg/dns FuzzNewRR fuzz_newrr fuzz\n```\n\nArguments are :\n* path of the package with the fuzz target\n* name of the fuzz function\n* name of the fuzzer to be built\n* optional tag to be used by `go build` and such\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/javascript_lang.md",
    "content": "---\nlayout: default\ntitle: Integrating a JavaScript project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 4\npermalink: /getting-started/new-project-guide/javascript-lang/\n---\n\n# Integrating a JavaScript project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\nThe process of integrating a project written in JavaScript for Node.js \nwith OSS-Fuzz is very similar to the general\n[Setting up a new project]({{ site.baseurl }}/getting-started/new-project-guide/)\nprocess. The key specifics of integrating a JavaScript project are outlined below.\n\n## Jazzer.js\n\nJavaScript fuzzing in OSS-Fuzz is powered by\n[Jazzer.js](https://github.com/CodeIntelligenceTesting/jazzer.js), which is\ninstalled during the build step. As Jazzer.js operates directly on the JavaScript\nsource code level, it can be applied to any project written in a language that \ncan be transpiled into JavaScript such as TypeScript. More information on how Jazzer.js\nfuzz targets look like can be found in its\n[README's Usage section](https://github.com/CodeIntelligenceTesting/jazzer.js#usage).\n\n## Project files\n\n### Example project\n\nWe recommend viewing\n[javascript-example](https://github.com/google/oss-fuzz/tree/master/projects/javascript-example)\nas an example of a simple JavaScript fuzzing project. We also recommend having a look at\n[typescript-example](https://github.com/google/oss-fuzz/tree/master/projects/typescript-example)\nas an example of how to fuzz TypeScript projects. This example also demonstrates how to use \nJazzer.js fuzzed data provider.\n\n### project.yaml\n\nThe `language` attribute must be specified as follows:\n\n```yaml\nlanguage: javascript\n```\n\nThe only supported fuzzing engine is libFuzzer (`libfuzzer`). So far, native sanitizers such as \nAddressSanitizer (`address`) and UndefinedBehaviorSanitizer (`undefined`) are not supported. \nThey would only be needed for projects that have native addons, which is a rather infrequent\nuse case for JavaScript projects. If you have a project where you need ASan or UBSan, please \ncreate open an issue on [Jazzer.js GitHub repo](https://github.com/CodeIntelligenceTesting/jazzer.js). None (`none`) is the default sanitizer for \nJavaScript projects, so setting it up in `project.yaml` is optional.\n\n```yaml\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - none\n```\n\n### Dockerfile\n\nThe Dockerfile should start by `FROM gcr.io/oss-fuzz-base/base-builder-javascript`\n\nThe OSS-Fuzz base Docker images already come with Node.js 19 and `npm` pre-installed.\nApart from that, you should usually not need to do more than to clone the\nproject, set a `WORKDIR`, and copy any necessary files, or install any\nproject-specific dependencies here as you normally would.\n\n### Fuzzers\n\nIn the simplest case, every fuzzer consists of a single JavaScript file that exports\na function named `fuzz` taking a single argument of type [Buffer](https://nodejs.org/api/buffer.html). \nAn example fuzz target could thus be a file `fuzz_string_compare.js` with contents:\n\n```javascript\n/**\n * @param { Buffer } data\n */\nmodule.exports.fuzz = function (data) {\n    const s = data.toString();\n    if (s.length !== 16) {\n        return;\n    }\n    if (\n        s.slice(0, 8) === \"Awesome \" &&\n        s.slice(8, 15) === \"Fuzzing\" &&\n        s[15] === \"!\"\n    ) {\n        throw Error(\"Welcome to Awesome Fuzzing!\");\n    }\n};\n```\n\n### build.sh\n\nThe OSS-Fuzz base docker image for JavaScript comes with the [`compile_javascript_fuzzer` script](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/compile_javascript_fuzzer) preinstalled. In `build.sh`, you should install dependencies for your project, and if necessary compile the code into JavaScript. Then, you can use the script to build the fuzzers. The script ensures that [@Jazzer.js/core](https://www.npmjs.com/package/@jazzer.js/core) is installed so that its CLI can be used to execute your fuzz tests. It also generates a wrapper script that can be used as a drop-in replacement for libFuzzer. This means that the generated script accepts the same command line flags for libFuzzer. Under the hood these flags are simply forwarded to the libFuzzer native addon used by Jazzer.js.\n\nA usage example from the javascript-example project is\n\n```shell\ncompile_javascript_fuzzer example fuzz_string_compare.js --sync\n```\n\nArguments are:\n* relative path of the project in the $SRC directory\n* relative path to the fuzz test inside the project\n* remaining arguments are forwarded to the [Jazzer.js CLI](https://github.com/CodeIntelligenceTesting/jazzer.js/blob/main/docs/fuzz-targets.md#running-the-fuzz-target)\n\nThe [javascript-example](https://github.com/google/oss-fuzz/blob/master/projects/javascript-example/build.sh)\nproject contains an example of a `build.sh` for JavaScript projects.\n\n## FuzzedDataProvider\n\nJazzer.js provides a `FuzzedDataProvider` that can simplify the task of creating a\nfuzz target by translating the raw input bytes received from the fuzzer into\nuseful primitive JavaScript types. Its functionality is similar to\n`FuzzedDataProviders` available in other languages, such as\n[Java](https://codeintelligencetesting.github.io/jazzer-docs/jazzer-api/com/code_intelligence/jazzer/api/FuzzedDataProvider.html) and\n[C++](https://github.com/google/fuzzing/blob/master/docs/split-inputs.md).\n\nA fuzz target using the `FuzzedDataProvider` would look as follows:\n\n```javascript\nconst { FuzzedDataProvider } = require(\"@jazzer.js/core\");\n\n/**\n * @param { Buffer } fuzzerInputData\n */\nmodule.exports.fuzz = function (fuzzerInputData) {\n    const data = new FuzzedDataProvider(fuzzerInputData);\n    const i = data.consumeIntegral(4);\n    const s = data.consumeRemainingAsString();\n    exploreMe(i, s);\n};\n```\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/jvm_lang.md",
    "content": "---\nlayout: default\ntitle: Integrating a Java/JVM project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 4\npermalink: /getting-started/new-project-guide/jvm-lang/\n---\n\n# Integrating a Java/JVM project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\nThe process of integrating a project written in Java or any other language\nrunning on the Java Virtual Machine (JVM) with OSS-Fuzz is very similar to the\ngeneral\n[Setting up a new project]({{ site.baseurl }}/getting-started/new-project-guide/)\nprocess. The key specifics of integrating a JVM project are outlined below.\n\n## Jazzer\n\nJava fuzzing in OSS-Fuzz depends on\n[Jazzer](https://github.com/CodeIntelligenceTesting/jazzer), which is\npre-installed on the OSS-Fuzz base docker images. As Jazzer operates directly\non the bytecode level, it can be applied to any project written in a JVM-based\nlanguage. More information on how Jazzer fuzz targets look like can be found in\nits\n[README's Usage section](https://github.com/CodeIntelligenceTesting/jazzer#usage).\n\n## Project files\n\n### Example project\n\nWe recommend viewing\n[json-sanitizer](https://github.com/google/oss-fuzz/tree/master/projects/json-sanitizer)\nas an example of a simple Java-only fuzzing project. Additional examples,\nincluding one for a Java project with native dependencies, are part of the\n[java-example](https://github.com/google/oss-fuzz/tree/master/projects/java-example)\nproject.\n\n### project.yaml\n\nThe `language` attribute must be specified as follows:\n\n```yaml\nlanguage: jvm\n```\n\nThe only supported fuzzing engine is libFuzzer (`libfuzzer`). So far the only\nsupported sanitizers are AddressSanitizer (`address`) and\nUndefinedBehaviorSanitizer (`undefined`). For pure Java projects, specify\njust `address`:\n\n```yaml\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n```\n\n### Dockerfile\n\nThe Dockerfile should start by `FROM gcr.io/oss-fuzz-base/base-builder-jvm`\n\nThe OSS-Fuzz base Docker images already come with OpenJDK 15 pre-installed. If\nyou need Maven to build your project, you can install it by adding the following\nline to your Dockerfile:\n\n```docker\nRUN apt-get update && apt-get install -y maven\n```\n\nApart from this, you should usually not need to do more than to clone the\nproject, set a `WORKDIR`, and copy any necessary files, or install any\nproject-specific dependencies here as you normally would.\n\n### Fuzzers\n\nIn the simplest case, every fuzzer consists of a single Java file with a\nfilename matching `*Fuzzer.java` and no `package` directive. An example fuzz\ntarget could thus be a file `ExampleFuzzer.java` with contents:\n\n```java\npublic class ExampleFuzzer {\n    public static void fuzzerTestOneInput(byte[] input) {\n        ...\n        // Call a function of the project under test with arguments derived from\n        // input and throw an exception if something unwanted happens.\n        ...\n    }\n}\n```\n\n### build.sh\n\nFor JVM projects, `build.sh` does need some more significant modifications\nover C/C++ projects. Below is an annotated example build script for a\nJava-only project with single-file fuzz targets as described above:\n\n```sh\n# Step 1: Build the project\n\n# Build the project .jar as usual, e.g. using Maven.\nmvn package\n# In this example, the project is built with Maven, which typically includes the\n# project version into the name of the packaged .jar file. The version can be\n# obtained as follows:\nCURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n# Copy the project .jar into $OUT under a fixed name.\ncp \"target/sample-project-$CURRENT_VERSION.jar\" $OUT/sample-project.jar\n\n# Specify the projects .jar file(s), separated by spaces if there are multiple.\nPROJECT_JARS=\"sample-project.jar\"\n\n# Step 2: Build the fuzzers (should not require any changes)\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:-Djava.awt.headless=true\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n```\n\nThe [java-example](https://github.com/google/oss-fuzz/blob/master/projects/java-example/build.sh)\nproject contains an example of a `build.sh` for Java projects with native\nlibraries.\n\n## FuzzedDataProvider\n\nJazzer provides a `FuzzedDataProvider` that can simplify the task of creating a\nfuzz target by translating the raw input bytes received from the fuzzer into\nuseful primitive Java types. Its functionality is similar to\n`FuzzedDataProviders` available in other languages, such as\n[Python](https://github.com/google/atheris#fuzzeddataprovider) and\n[C++](https://github.com/google/fuzzing/blob/master/docs/split-inputs.md).\n\nOn OSS-Fuzz, the required library is available in the base docker images under\nthe path `$JAZZER_API_PATH`, which is added to the classpath by the example\nbuild script shown above. Locally, the library can be obtained from\n[Maven Central](https://search.maven.org/search?q=g:com.code-intelligence%20a:jazzer-api).\n\nA fuzz target using the `FuzzedDataProvider` would look as follows:\n\n```java\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic class ExampleFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int number = data.consumeInt();\n        String string = data.consumeRemainingAsString();\n        // ...\n    }\n}\n```\n\nFor a list of convenience methods offered by `FuzzedDataProvider`, consult its\n[javadocs](https://codeintelligencetesting.github.io/jazzer-docs/jazzer-api/com/code_intelligence/jazzer/api/FuzzedDataProvider.html).\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/lua_lang.md",
    "content": "---\nlayout: default\ntitle: Integrating a Lua project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 4\npermalink: /getting-started/new-project-guide/lua-lang/\n---\n\n# Integrating a Lua project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\nThe process of integrating a project written in Lua with OSS-Fuzz\nis similar to the general [Setting up a new project]({{ site.baseurl\n}}/getting-started/new-project-guide/) process. The key specifics of\nintegrating a Lua project are outlined below.\n\n## luzer\n\nLua fuzzing in OSS-Fuzz is powered by\n[luzer](https://github.com/ligurio/luzer). As luzer operates\ndirectly on the Lua source code level, it can be applied to any\nproject written in a language that can be transpiled into Lua,\nsuch as [MoonScript](https://moonscript.org/),\n[TypeScriptToLua](https://typescripttolua.github.io/),\n[Fennel](https://fennel-lang.org/), and [Urn](https://urn-lang.com/).\nAlso, it supports fuzzing C/C++ extensions written for Lua. When\nfuzzing native code, luzer can be used in combination with\nAddress Sanitizer or Undefined Behavior Sanitizer to catch extra bugs.\n\n## Project files\n\n### Example project\n\nWe recommend viewing\n[lua-example](https://github.com/google/oss-fuzz/tree/master/projects/lua-example)\nas an example of a simple Lua fuzzing project. This example also\ndemonstrates how to use luzer's Fuzzed Data Provider.\n\n### project.yaml\n\nThe `language` attribute must be specified as follows:\n\n```yaml\nlanguage: c\n```\n\nThe only supported fuzzing engine is libFuzzer (`libfuzzer`).\n\n```yaml\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - none\n```\n\nThere is nothing special for sanitizer support in OSS-Fuzz\ninfrastructure. luzer builds its own DSO with libFuzzer and\nsanitizer and `compile_lua_fuzzer` (also managed by project) sets\nit to `LD_PRELOAD` if required.\n\n### Dockerfile\n\nThe Dockerfile should start by `FROM gcr.io/oss-fuzz-base/base-builder`.\n\nThe OSS-Fuzz base Docker images come without any pre-installed\ncomponents required for Lua fuzzing. Apart from that, you should\nusually need to build or install a Lua runtime, luzer module,\nclone the project, set a `WORKDIR`, and copy any necessary files,\nor install any project-specific dependencies here as you normally would.\n\n### Fuzzers\n\nIn the simplest case, every fuzzer consists of a single Lua file that defines\na function `TestOneInput` and executes a function named `luzer.Fuzz()`.\nAn example fuzz target could thus be a file `fuzz_basic.lua` with contents:\n\n```lua\nlocal parser = require(\"src.luacheck.parser\")\nlocal decoder = require(\"luacheck.decoder\")\nlocal luzer = require(\"luzer\")\n\nlocal function TestOneInput(buf)\n    parser.parse(decoder.decode(buf))\nend\n\nlocal args = {\n    print_final_stats = 1,\n}\nluzer.Fuzz(TestOneInput, nil, args)\n```\n\n### compile_lua_fuzzer\n\nUnlike projects for other languages, the base image does not\ninclude a script that generates a wrapper script that can be used\nas a drop-in replacement for libFuzzer.\n\nTherefore, you need to add such a script yourself. This script\nsets a relative path to Lua runtime that will be used for running\ntests and the necessary environment variables (for example, `LUA_PATH`,\n`LUA_CPATH` and `LD_PRELOAD`) and specifies the path directly to\nthe `.lua` file containing the test implementation. The script\n`compile_lua_fuzzer` must accept the same command line flags as\nlibFuzzer-based tests.\n\nNote, the resulting wrapper scripts must contain the word \"luarocks\"\nto pass checks by `bad_build_check` in continuous integration.\n\nThen, you can use the script `compile_lua_fuzzer` to build the fuzzers.\nA usage example from the `lua-example` project is\n\n```shell\ncompile_lua_fuzzer lua fuzz_basic.lua\n```\n\nArguments are:\n\n* a relative path to a Lua runtime name\n* a relative path to the fuzzing test inside the OSS Fuzz project directory\n\nThe `lua-example` projects includes an\n[example](https://github.com/google/oss-fuzz/blob/master/projects/lua-example/compile_lua_fuzzer)\nof such script.\n\n### build.sh\n\nThe script is executed within the image built from your [Dockerfile](#Dockerfile).\n\nIn general, this script should do the following:\n\n- Set up or build a Lua runtime.\n- Set up or build required dependencies for your tests.\n- Generate wrapper scripts for your tests using [compile_lua_fuzzer](#compile_lua_fuzzer).\n\nResulting binaries, tests and their wrapper scripts, and a\ndirectory with Luarocks dependencies should be placed in `$OUT`.\n\nBeware, when installing the luzer module, you need to set the\nenvironment variable `OSS_FUZZ` to non-empty value, otherwise the\nbuild may fail.\n\nThe [lua-example](https://github.com/google/oss-fuzz/blob/master/projects/lua-example/build.sh)\nproject contains an example of a `build.sh` for a Lua projects.\n\n## FuzzedDataProvider\n\nluzer provides a Fuzzed Data Provider that is helpful for splitting\na fuzz input into multiple parts of various Lua types. Its\nfunctionality is similar to\n[Fuzzed Data Provider](https://github.com/google/fuzzing/blob/master/docs/split-inputs.md#fuzzed-data-provider)\navailable in LLVM. Learn about methods, provided by FDP in luzer,\nin [documentation](https://github.com/ligurio/luzer/blob/master/docs/api.md#structure-aware-fuzzing).\n\nA fuzz target using the `FuzzedDataProvider` would look as follows:\n\n```lua\nlocal luzer = require(\"luzer\")\n\nlocal function TestOneInput(buf)\n    local fdp = luzer.FuzzedDataProvider(buf)\n    local str = fdp:consume_string(4)\n\n    local b = {}\n    str:gsub(\".\", function(c) table.insert(b, c) end)\n    local count = 0\n    if b[1] == \"o\" then count = count + 1 end\n    if b[2] == \"o\" then count = count + 1 end\n    if b[3] == \"p\" then count = count + 1 end\n    if b[4] == \"s\" then count = count + 1 end\n\n    if count == 4 then assert(nil) end\nend\n\nlocal args = {\n    only_ascii = 1,\n    print_pcs = 1,\n}\n\nluzer.Fuzz(TestOneInput, nil, args)\n```\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/python_lang.md",
    "content": "---\nlayout: default\ntitle: Integrating a Python project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 3\npermalink: /getting-started/new-project-guide/python-lang/\n---\n\n# Integrating a Python project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\n\nThe process of integrating a project written in Python with OSS-Fuzz is very\nsimilar to the general\n[Setting up a new project]({{ site.baseurl }}/getting-started/new-project-guide/)\nprocess. The key specifics of integrating a Python project are outlined below.\n\n## Atheris\n\nPython fuzzing in OSS-Fuzz depends on\n[Atheris](https://github.com/google/atheris). Fuzzers will depend on the\n`atheris` package, and dependencies are pre-installed on the OSS-Fuzz base\ndocker images.\n\n## Project files\n\n### Example project\n\nWe recommend viewing [ujson](https://github.com/google/oss-fuzz/tree/master/projects/ujson) as an\nexample of a simple Python fuzzing project, with both plain-Atheris and\nAtheris + Hypothesis harnesses.\n\n### project.yaml\n\nThe `language` attribute must be specified.\n\n```yaml\nlanguage: python3\n```\n\nThe only supported fuzzing engine is libFuzzer (`libfuzzer`). The supported\nsanitizers are AddressSanitizer (`address`) and\nUndefinedBehaviorSanitizer (`undefined`). These must be explicitly specified.\n\n```yaml\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n```\n\n### Dockerfile\n\nThe Dockerfile should start by `FROM gcr.io/oss-fuzz-base/base-builder-python`\n\nBecause most dependencies are already pre-installed on the images, no\nsignificant changes are needed in the Dockerfile for Python fuzzing projects.\nYou should simply clone the project, set a `WORKDIR`, and copy any necessary\nfiles, or install any project-specific dependencies here as you normally would.\n\n### build.sh\n\nFor Python projects, `build.sh` does need some more significant modifications\nover normal projects. The following is an annotated example build script,\nexplaining why each step is necessary and when they can be omitted.\n\n```sh\n# Build and install project (using current CFLAGS, CXXFLAGS). This is required\n# for projects with C extensions so that they're built with the proper flags.\npip3 install .\n\n# Build fuzzers into $OUT. These could be detected in other ways.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  fuzzer_basename=$(basename -s .py $fuzzer)\n  fuzzer_package=${fuzzer_basename}.pkg\n\n  # To avoid issues with Python version conflicts, or changes in environment\n  # over time on the OSS-Fuzz bots, we use pyinstaller to create a standalone\n  # package. Though not necessarily required for reproducing issues, this is\n  # required to keep fuzzers working properly in OSS-Fuzz.\n  pyinstaller --distpath $OUT --onefile --name $fuzzer_package $fuzzer\n\n  # Create execution wrapper. Atheris requires that certain libraries are\n  # preloaded, so this is also done here to ensure compatibility and simplify\n  # test case reproduction. Since this helper script is what OSS-Fuzz will\n  # actually execute, it is also always required.\n  # NOTE: If you are fuzzing python-only code and do not have native C/C++\n  # extensions, then remove the LD_PRELOAD line below as preloading sanitizer\n  # library is not required and can lead to unexpected startup crashes.\n  echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_PRELOAD=\\$this_dir/sanitizer_with_fuzzer.so \\\nASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$this_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$this_dir/$fuzzer_package \\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n```\n\n## Hypothesis\n\nUsing [Hypothesis](https://hypothesis.readthedocs.io/), the Python library for\n[property-based testing](https://hypothesis.works/articles/what-is-property-based-testing/),\nmakes it really easy to generate complex inputs - whether in traditional test suites\nor [by using test functions as fuzz harnesses](https://hypothesis.readthedocs.io/en/latest/details.html#use-with-external-fuzzers).\n\n> Property based testing is the construction of tests such that, when these tests are fuzzed,\n  failures in the test reveal problems with the system under test that could not have been\n  revealed by direct fuzzing of that system.\n\nWe recommend using the [`hypothesis write`](https://hypothesis.readthedocs.io/en/latest/ghostwriter.html)\ncommand to generate a starter fuzz harness.  This \"ghostwritten\" code may be usable as-is,\nor provide a useful template for writing more specific tests.\n\nSee [here for the core \"strategies\"](https://hypothesis.readthedocs.io/en/latest/data.html),\nfor arbitrary data, [here for Numpy + Pandas support](https://hypothesis.readthedocs.io/en/latest/numpy.html),\nor [here for a variety of third-party extensions](https://hypothesis.readthedocs.io/en/latest/strategies.html)\nsupporting everything from protobufs, to jsonschemas, to networkx graphs or geojson\nor valid Python source code.\nHypothesis' integrated test-case reduction also makes it trivial to report a canonical minimal\nexample for each distinct failure discovered while fuzzing - just run the test function!\n\nTo use Hypothesis in OSS-Fuzz, install it in your Dockerfile with\n\n```shell\nRUN pip3 install hypothesis\n```\n\nSee [the `ujson` structured fuzzer](https://github.com/google/oss-fuzz/blob/master/projects/ujson/hypothesis_structured_fuzzer.py)\nfor an example \"polyglot\" which can either be run with `pytest` as a standard test function,\nor run with OSS-Fuzz as a fuzz harness.\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/rust_lang.md",
    "content": "---\nlayout: default\ntitle: Integrating a Rust project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 2\npermalink: /getting-started/new-project-guide/rust-lang/\n---\n\n# Integrating a Rust project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\nThe process of integrating a project written in Rust with OSS-Fuzz is very\nsimilar to the general [Setting up a new project]({{ site.baseurl\n}}/getting-started/new-project-guide/) process. The key specifics of integrating\na Rust project are outlined below.\n\n## cargo-fuzz support\n\nRust integration with OSS-Fuzz is expected to use [`cargo\nfuzz`](https://github.com/rust-fuzz/cargo-fuzz) to build fuzzers. The `cargo\nfuzz` tool will build code with required compiler flags as well as link to the\ncorrect libFuzzer on OSS-Fuzz itself. Note that using `cargo fuzz` also makes it\nquite easy to run the fuzzers locally yourself if you get a failing test case!\n\n## Project files\n\nFirst you'll want to follow the [setup instructions for `cargo fuzz`\nitself](https://rust-fuzz.github.io/book/). Afterwards your project should have:\n\n* A top-level `fuzz` directory.\n* A `fuzz/Cargo.toml` manifest which pulls in necessary dependencies to fuzz.\n* Some `fuzz/fuzz_targets/*.rs` files which are the fuzz targets that will be\n  compiled and run on OSS-Fuzz.\n\nNote that you can customize this layout as well, but you'll need to edit some\nthe scripts below to integrate into OSS-Fuzz.\n\n### project.yaml\n\nThe `language` attribute must be specified.\n\n```yaml\nlanguage: rust\n```\n\nThe only supported fuzzing engine and sanitizer are `libfuzzer` and `address`,\nrespectively.\n[Example](https://github.com/google/oss-fuzz/blob/12ef3654b3e9adfd20b5a6afdde54819ba71493d/projects/serde_json/project.yaml#L3-L6)\n\n```yaml\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n```\n\n### Dockerfile\n\nThe Dockerfile should start by `FROM gcr.io/oss-fuzz-base/base-builder-rust`\n\nThe OSS-Fuzz builder image has the latest nightly release of Rust as well as\n`cargo fuzz` pre-installed and in `PATH`. In the `Dockerfile` for your project\nall you'll need to do is fetch the latest copy of your code and install any\nsystem dependencies necessary to build your project.\n[Example](https://github.com/google/oss-fuzz/blob/12ef3654b3e9adfd20b5a6afdde54819ba71493d/projects/serde_json/Dockerfile#L18-L20)\n\n```dockerfile\nRUN git clone --depth 1 https://github.com/serde-rs/json json\n```\n\n### build.sh\n\nHere it's expected that you'll build the fuzz targets for your project and then\ncopy the final binaries into the output directory.\n[Example](https://github.com/google/oss-fuzz/blob/12ef3654b3e9adfd20b5a6afdde54819ba71493d/projects/serde_json/build.sh#L20):\n\n```sh\ncd $SRC/json\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/from_slice $OUT/\n```\n\nNote that you likely want to pass the `-O` flag to `cargo fuzz build` which\nbuilds fuzzers in release mode. You may also want to pass the\n`--debug-assertions` flag to enable more checks while fuzzing. In this example\nthe `from_slice` binary is the fuzz target.\n\nWith some bash-fu you can also automatically copy over all fuzz targets into\nthe output directory so when you add a fuzz target to your project it's\nautomatically integrated into OSS-Fuzz:\n\n```sh\nFUZZ_TARGET_OUTPUT_DIR=target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n```\n\n## Writing fuzzers using a test-style strategy\n\nIn Rust you will often have tests written in a way so they are only \ncompiled into the final binary when build in test-mode. This is, achieved by\nwrapping your test code in `cfg(test)`, e.g.\n```rust\n#[cfg(test)]\nmod tests {\n    use super::*;\n    \n    ...\n```\n\nCargo-fuzz automatically enables the `fuzzing` feature, which means you can\nfollow a similar strategy to writing fuzzers as you do when writing tests.\nSpecifically, you can create modules wrapped in the `fuzzing` feature:\n```rust\n#[cfg(fuzzing)]\npub mod fuzz_logic {\n    use super::*;\n\n    ...\n```\nand then call the logic within `fuzz_logic` from your fuzzer. \n\nFurthermore, within your `.toml` files, you can then specify fuzzing-specific\ndependencies by wrapping them as follows:\n```\n[target.'cfg(fuzzing)'.dependencies]\n```\nsimilar to how you wrap test-dependencies as follows:\n```\n[dev-dependencies]\n```\n\nFinally, you can also combine the testing logic you have and the fuzz logic. This\ncan be achieved simply by using \n```rust\n#[cfg(any(test, fuzzing))]\n```\n\nA project that follows this structure is Linkerd2-proxy and the project files can be\nseen [here](https://github.com/google/oss-fuzz/tree/master/projects/linkerd2-proxy).\n"
  },
  {
    "path": "docs/getting-started/new-project-guide/swift_lang.md",
    "content": "---\nlayout: default\ntitle: Integrating a Swift project\nparent: Setting up a new project\ngrand_parent: Getting started\nnav_order: 1\npermalink: /getting-started/new-project-guide/swift-lang/\n---\n\n# Integrating a Swift project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\nThe process of integrating a project written in Swift with OSS-Fuzz is very similar\nto the general\n[Setting up a new project]({{ site.baseurl }}/getting-started/new-project-guide/)\nprocess. The key specifics of integrating a Swift project are outlined below.\n\n## Project files\n\nFirst, you need to write a Swift fuzz target that accepts a stream of bytes and\ncalls the program API with that. This fuzz target should reside in your project\nrepository.\n\nThe structure of the project directory in OSS-Fuzz repository doesn't differ for\nprojects written in Swift. The project files have the following Swift specific\naspects.\n\n### project.yaml\n\nThe `language` attribute must be specified.\n\n```yaml\nlanguage: swift\n```\n\nThe only supported fuzzing engine is `libfuzzer`\n\nThe supported sanitizers are and `address`, `thread`\n\n[Example](https://github.com/google/oss-fuzz/blob/2a15c3c88b21f4f1be2a7ff115f72bd7a08e34ac/projects/swift-nio/project.yaml#L9):\n\n```yaml\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - thread\n```\n\n### Dockerfile\n\nThe Dockerfile should start by `FROM gcr.io/oss-fuzz-base/base-builder-swift`\ninstead of using the simple base-builder\n\n### build.sh\n\nA `precompile_swift` generates an environment variable `SWIFTFLAGS`\nThis can then be used in the building command such as `swift build -c release $SWIFTFLAGS`\n\n\nA usage example from swift-protobuf project is\n\n```sh\n. precompile_swift\n# build project\ncd FuzzTesting\nswift build -c debug $SWIFTFLAGS\n\n(\ncd .build/debug/\nfind . -maxdepth 1 -type f -name \"*Fuzzer\" -executable | while read i; do cp $i $OUT/\"$i\"-debug; done\n)\n\n```\n"
  },
  {
    "path": "docs/getting-started/new_project_guide.md",
    "content": "---\nlayout: default\ntitle: Setting up a new project\nparent: Getting started\nhas_children: true\nnav_order: 2\npermalink: /getting-started/new-project-guide/\n---\n\n# Setting up a new project\n{: .no_toc}\n\n- TOC\n{:toc}\n---\n\n## Prerequisites\n\nBefore you can start setting up your new project for fuzzing, you must do the following:\n\n- [Integrate]({{ site.baseurl }}/advanced-topics/ideal-integration/) one or more [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target)\n  with the project you want to fuzz.\n\n  For examples, see\n[boringssl](https://github.com/google/boringssl/tree/master/fuzz) or\n[SQLite](https://www.sqlite.org/src/artifact/ad79e867fb504338) (C/C++),\n[go-fuzz](https://github.com/dvyukov/go-fuzz-corpus/tree/86a5af9d6842f80b205a082538ea28f61bbb8ccb) or\n[syzkaller](https://github.com/google/syzkaller/tree/7c7ded697e6322b0975f061b7e268fe44f585dab/prog/test)\n(Go).\n\n- [Install Docker](https://docs.docker.com/engine/installation)\n  (Googlers can visit [go/installdocker](https://goto.google.com/installdocker)).\n  [Why Docker?]({{ site.baseurl }}/faq/#why-do-you-use-docker)\n\n  If you want to run `docker` without `sudo`, you can\n  [create a docker group](https://docs.docker.com/engine/installation/linux/ubuntulinux/#/create-a-docker-group).\n\n  **Note:** Docker images can consume significant disk space. Run\n  [docker-cleanup](https://gist.github.com/mikea/d23a839cba68778d94e0302e8a2c200f)\n  periodically to garbage-collect unused images.\n\n- (optional) [Install gsutil](https://cloud.google.com/storage/docs/gsutil_install) for local code coverage testing.\n  For Google internal (gLinux) machines, please refer [here](https://cloud.google.com/storage/docs/gsutil_install#deb) instead.\n\n## Creating the file structure\n\nEach OSS-Fuzz project has a subdirectory\ninside the [`projects/`](https://github.com/google/oss-fuzz/tree/master/projects) directory in the [OSS-Fuzz repository](https://github.com/google/oss-fuzz). For example, the [boringssl](https://github.com/google/boringssl)\nproject is located in [`projects/boringssl`](https://github.com/google/oss-fuzz/tree/master/projects/boringssl).\n\nEach project directory also contains the following three configuration files:\n\n* [project.yaml](#projectyaml) - provides metadata about the project.\n* [Dockerfile](#dockerfile) - defines the container environment with information\non dependencies needed to build the project and its [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target).\n* [build.sh](#buildsh) - defines the build script that executes inside the Docker container and\ngenerates the project build.\n\nYou can automatically create a new directory for your project in OSS-Fuzz and\ngenerate templated versions of the configuration files\nby running the following commands:\n\n```bash\n$ cd /path/to/oss-fuzz\n$ export PROJECT_NAME=<project_name>\n$ export LANGUAGE=<project_language>\n$ python3 infra/helper.py generate $PROJECT_NAME --language=$LANGUAGE\n```\n\nOnce the template configuration files are created, you can modify them to fit your project.\n\n**Note:** We prefer that you keep and maintain [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target) in your own source code repository. If this isn't possible, you can store them inside the OSS-Fuzz project directory you created.\n\n## project.yaml {#projectyaml}\n\nThis configuration file stores project metadata. The following attributes are supported:\n\n- [homepage](#homepage)\n- [language](#language)\n- [primary_contact](#primary)\n- [auto_ccs](#auto_ccs)\n- [main_repo](#main_repo)\n- [vendor_ccs](#vendor) (optional)\n- [sanitizers](#sanitizers) (optional)\n- [architectures](#architectures) (optional)\n- [help_url](#help_url) (optional)\n- [builds_per_day](#build_frequency) (optional)\n- [file_github_issue](#file_github_issue) (optional)\n- [disable_remediation](#disable_remediation) (optional)\n\n### homepage\nYou project's homepage.\n\n### language\n\nProgramming language the project is written in. Values you can specify include:\n\n* `c`\n* `c++`\n* [`go`]({{ site.baseurl }}//getting-started/new-project-guide/go-lang/)\n* [`rust`]({{ site.baseurl }}//getting-started/new-project-guide/rust-lang/)\n* [`python`]({{ site.baseurl }}//getting-started/new-project-guide/python-lang/)\n* [`jvm` (Java, Kotlin, Scala and other JVM-based languages)]({{ site.baseurl }}//getting-started/new-project-guide/jvm-lang/)\n* [`swift`]({{ site.baseurl }}//getting-started/new-project-guide/swift-lang/)\n* [`javascript`]({{ site.baseurl }}//getting-started/new-project-guide/javascript-lang/)\n* [`lua`]({{ site.baseurl }}//getting-started/new-project-guide/lua-lang/)\n\n### primary_contact, auto_ccs {#primary}\nThe primary contact and list of other contacts to be CCed. Each person listed gets access to ClusterFuzz, including crash reports and fuzzer statistics, and are auto-cced on new bugs filed in the OSS-Fuzz\ntracker. If you're a primary or a CC, you'll need to use a [Google account](https://support.google.com/accounts/answer/176347?hl=en) to get full access. ([why?]({{ site.baseurl }}/faq/#why-do-you-require-a-google-account-for-authentication)).\n\n### main_repo {#main_repo}\nPath to source code repository hosting the code, e.g. `https://path/to/main/repo.git`. \n\n### vendor_ccs (optional) {#vendor}\nThe list of vendor email addresses that are downstream consumers of the project and want access to\nthe bug reports as they are filed.\n\nAny changes to this list must follow these rules:\n- Approved by the project maintainer (e.g. comment on pull request, reply on project mailing list).\n- An organization email address is used.\n\n### sanitizers (optional) {#sanitizers}\nThe list of sanitizers to use. Possible values are: `address`, `memory` and `undefined`.\nIf you don't specify a list, `sanitizers` uses a default list of supported\nsanitizers (currently [\"address\"](https://clang.llvm.org/docs/AddressSanitizer.html) and\n[\"undefined\"](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html)).\n\n[MemorySanitizer](https://clang.llvm.org/docs/MemorySanitizer.html) (\"memory\") is also supported\nand recommended, but is not enabled by default due to the likelihood of false positives from\nun-instrumented system dependencies.\nIf you want to use \"memory,\" please build all libraries your project needs using\nMemorySanitizer.\nThis can be done by building them with the compiler flags provided during\nMemorySanitizer builds.\nThen, you can opt in by adding \"memory\" to your list of sanitizers.\n\nIf your project does not build with a particular sanitizer configuration and you need some time to fix\nit, you can use `sanitizers` to override the defaults temporarily. For example, to disable the\nUndefinedBehaviourSanitizer build, just specify all supported sanitizers except \"undefined\".\n\nIf you want to test a particular sanitizer to see what crashes it generates without filing\nthem in the issue tracker, you can set an `experimental` flag. For example, if you want to test \"memory\", set `experimental: True` like this:\n\n```\nsanitizers:\n - address\n - memory:\n    experimental: True\n - undefined\n ```\n\nCrashes can be accessed on the [ClusterFuzz\nhomepage]({{ site.baseurl }}/further-reading/clusterfuzz#web-interface).\n\n`sanitizers` example: [boringssl](https://github.com/google/oss-fuzz/blob/master/projects/boringssl/project.yaml).\n\n### architectures (optional) {#architectures}\nThe list of architectures to fuzz on.\nClusterFuzz supports fuzzing on x86_64 (aka x64) by default.\nSome projects can benefit from i386 fuzzing. OSS-Fuzz will build and run\nAddressSanitizer with libFuzzer on i386 by doing the following:\n\n```yaml\narchitectures:\n - x86_64\n - i386\n ```\n\nBy fuzzing on i386 you might find bugs that:\n* Only occur in architecture-specific source code (e.g. code that contains i386 assembly).\n* Exist in architecture-independent source code and which only affects i386 users.\n* Exist in architecture-independent source code and which affects users on other 32-bit platforms such as AArch32 (aka 32-bit ARM).\n\nNote that some bugs which affect x86_64 may be discovered on i386 and filed as such.\nOn the testcase page of each oss-fuzz issue is a list of other jobs where the crash reproduces, this can let you know if the crash exists on x86_64 as well.\n\nFuzzing on i386 is not enabled by default because many projects won't build for i386 without some modification to their OSS-Fuzz build process.\nFor example, you will need to link against `$LIB_FUZZING_ENGINE` and possibly install i386 dependencies within the x86_64 docker image ([for example](https://github.com/google/oss-fuzz/blob/5b8dcb5d942b3b8bc173b823fb9ddbdca7ec6c99/projects/gdal/build.sh#L18)) to get things working.\n\nThere are [known bugs](https://github.com/google/oss-fuzz/issues/2746) in ASAN\non i386 that cause ClusterFuzz to report unreproducible crashes for 0 length\ntestcases. There are no plans to fix these bugs so be ready for slightly more\nfalse positives if you use i386. These false positives should be somewhat easy\nto identify since they will manifest as crashes in ASAN rather than your code.\n\n### fuzzing_engines (optional) {#fuzzing_engines}\nThe list of fuzzing engines to use.\nBy default, `libfuzzer`, `afl`, `honggfuzz`, and `centipede` are used. It is recommended to\nuse all of them if possible. `libfuzzer` is required by OSS-Fuzz.\n\n### help_url (optional) {#help_url}\nA link to a custom help URL that appears in bug reports instead of the default\n[OSS-Fuzz guide to reproducing crashes]({{ site.baseurl }}/advanced-topics/reproducing/). This can be useful if you assign\nbugs to members of your project unfamiliar with OSS-Fuzz, or if they should follow a different workflow for\nreproducing and fixing bugs than the standard one outlined in the reproducing guide.\n\n`help_url` example: [skia](https://github.com/google/oss-fuzz/blob/master/projects/skia/project.yaml).\n\n### builds_per_day (optional) {#build_frequency}\nThe number of times the project should be built per day.\nOSS-Fuzz allows upto 4 builds per day, and builds once per day by default.\nExample:\n```yaml\nbuilds_per_day: 2\n```\n\nWill build the project twice per day.\n\n### file_github_issue (optional) {#file_github_issue}\nWhether to mirror issues on github instead of having them only in the OSS-Fuzz\ntracker.\n\n### disable_remediation (optional) {#disable_remediation}\nOpt out of receiving remediation for all new and existing bugs. If remediation\nis disabled, all disclosure notifications will not include any proposed code\nchanges. If enabled (default), proposed code changes and comments to remediate\nbugs may be automatically included in disclosure that is private during the\nembargo of each issue on a case-by-case basis basis.\n\n## Dockerfile {#dockerfile}\n\nThis configuration file defines the Docker image for your project. Your [build.sh](#buildsh) script will be executed in inside the container you define.\nFor most projects, the image is simple:\n```docker\nFROM gcr.io/oss-fuzz-base/base-builder       # base image with clang toolchain\nRUN apt-get update && apt-get install -y ... # install required packages to build your project\nRUN git clone <git_url> <checkout_dir>       # checkout all sources needed to build your project\nWORKDIR <checkout_dir>                       # current directory for the build script\nCOPY build.sh fuzzer.cc $SRC/                # copy build script and other fuzzer files in src dir\n```\nIn the above example, the git clone will check out the source to `$SRC/<checkout_dir>`.\n\nDepending on your project's language, you will use a different base image,\nfor instance `FROM gcr.io/oss-fuzz-base/base-builder-go` for golang.\n\nFor an example, see\n[expat/Dockerfile](https://github.com/google/oss-fuzz/tree/master/projects/expat/Dockerfile)\nor\n[syzkaller/Dockerfile](https://github.com/google/oss-fuzz/blob/master/projects/syzkaller/Dockerfile).\n\nIn the case of a project with multiple languages/toolchains needed,\nyou can run installation scripts `install_lang.sh` where lang is the language needed.\nYou also need to setup environment variables needed by this toolchain, for example `GOPATH` is needed by golang.\nFor an example, see\n[ecc-diff-fuzzer/Dockerfile](https://github.com/google/oss-fuzz/blob/master/projects/ecc-diff-fuzzer/Dockerfile).\nwhere we use `base-builder-rust`and install golang\n\nRuntime dependencies of your project, such as third-party static libraries, will\nnot be instrumented if you build them in the Dockerfile. In most cases, you will\nwant to build them in `build.sh` instead.\n\n## build.sh {#buildsh}\n\nThis file defines how to build binaries for [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target) in your project.\nThe script is executed within the image built from your [Dockerfile](#Dockerfile).\n\nIn general, this script should do the following:\n\n- Build the project using your build system with the correct compiler.\n- Provide compiler flags as [environment variables](#Requirements).\n- Build your [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target) and link your project's build with libFuzzer.\n\nResulting binaries should be placed in `$OUT`.\n\nHere's an example from Expat ([source](https://github.com/google/oss-fuzz/blob/master/projects/expat/build.sh)):\n\n```bash\n#!/bin/bash -eu\n\n./buildconf.sh\n# configure scripts usually use correct environment variables.\n./configure\n\nmake clean\nmake -j$(nproc) all\n\n$CXX $CXXFLAGS -std=c++11 -Ilib/ \\\n    $SRC/parse_fuzzer.cc -o $OUT/parse_fuzzer \\\n    $LIB_FUZZING_ENGINE .libs/libexpat.a\n\ncp $SRC/*.dict $SRC/*.options $OUT/\n```\n\nIf your project is written in Go, check out the [Integrating a Go project]({{ site.baseurl }}//getting-started/new-project-guide/go-lang/) page.\n\n**Note:**\n\n1. Don't assume the fuzzing engine is libFuzzer by default, because we generate builds for libFuzzer, AFL++, Honggfuzz, and Centipede fuzzing engine configurations. Instead, link the fuzzing engine using $LIB_FUZZING_ENGINE.\n2. Make sure that the binary names for your [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target) contain only\nalphanumeric characters, underscore(_) or dash(-). Otherwise, they won't run on our infrastructure.\n3. Don't remove source code files. They are needed for code coverage.\n\n### Temporarily disabling code instrumentation during builds\n\nIn some cases, it's not necessary to instrument every 3rd party library or tool that supports the build target. Use the following snippet to build tools or libraries without instrumentation:\n\n\n```\nCFLAGS_SAVE=\"$CFLAGS\"\nCXXFLAGS_SAVE=\"$CXXFLAGS\"\nunset CFLAGS\nunset CXXFLAGS\nexport AFL_NOOPT=1\n\n#\n# build commands here that should not result in instrumented code.\n#\n\nexport CFLAGS=\"${CFLAGS_SAVE}\"\nexport CXXFLAGS=\"${CXXFLAGS_SAVE}\"\nunset AFL_NOOPT\n```\n\n### build.sh script environment\n\nWhen your build.sh script is executed, the following locations are available within the image:\n\n| Location| Env Variable | Description |\n|---------| ------------ | ----------  |\n| `/out/` | `$OUT`         | Directory to store build artifacts (fuzz targets, dictionaries, options files, seed corpus archives). |\n| `/src/` | `$SRC`         | Directory to checkout source files. |\n| `/work/`| `$WORK`        | Directory to store intermediate files. |\n\nAlthough the files layout is fixed within a container, environment variables are\nprovided so you can write retargetable scripts.\n\nIn case your fuzz target uses the [FuzzedDataProvider] class, make sure it is\nincluded via `#include <fuzzer/FuzzedDataProvider.h>` directive.\n\n[FuzzedDataProvider]: https://github.com/google/fuzzing/blob/master/docs/split-inputs.md#fuzzed-data-provider\n\n### build.sh requirements {#Requirements}\n\nOnly binaries without an extension are accepted as targets. Extensions are reserved for other artifacts, like .dict.\n\nYou *must* use the special compiler flags needed to build your project and fuzz targets.\nThese flags are provided in the following environment variables:\n\n| Env Variable           | Description\n| -------------          | --------\n| `$CC`, `$CXX`, `$CCC`  | The C and C++ compiler binaries.\n| `$CFLAGS`, `$CXXFLAGS` | C and C++ compiler flags.\n| `$LIB_FUZZING_ENGINE`  | C++ compiler argument to link fuzz target against the prebuilt engine library (e.g. libFuzzer).\n\nYou *must* use `$CXX` as a linker, even if your project is written in pure C.\n\nMost well-crafted build scripts will automatically use these variables. If not,\npass them manually to the build tool.\n\nSee the [Provided Environment Variables](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/README.md#provided-environment-variables) section in\n`base-builder` image documentation for more details.\n\n### Static and dynamic linking of libraries\nThe `build.sh` should produce fuzzers that are statically linked. This is because the\nfuzzer build environment is different to the fuzzer runtime environment and if your\nproject depends on third party libraries then it is likely they will not be present\nin the execution environment. Thus, any shared libraries you may install or compile in\n`build.sh` or `Dockerfile` will not be present in the fuzzer runtime environment. There\nare exceptions to this rule, and for further information on this please see the [fuzzer environment]({{ site.baseurl }}/further-reading/fuzzer-environment/) page.\n\n## Disk space restrictions\n\nOur builders have a disk size of 250GB (this includes space taken up by the OS). Builds must keep peak disk usage below this.\n\nIn addition, please keep the size of the build (everything copied to `$OUT`) small (<10GB uncompressed). The build is repeatedly transferred and unzipped during fuzzing and runs on VMs with limited disk space.\n\n## Fuzzer execution environment\n\nFor more on the environment that\nyour [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target) run in, and the assumptions you can make, see the [fuzzer environment]({{ site.baseurl }}/further-reading/fuzzer-environment/) page.\n\n## Testing locally\n\nYou can build your docker image and fuzz targets locally, so you can test them before you push them to the OSS-Fuzz repository.\n\n1. Run the same helper script you used to create your directory structure, this time using it to build your docker image and [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target):\n\n    ```bash\n    $ cd /path/to/oss-fuzz\n    $ python3 infra/helper.py build_image $PROJECT_NAME\n    $ python3 infra/helper.py build_fuzzers --sanitizer <address/memory/undefined> $PROJECT_NAME\n    ```\n\n    The built binaries appear in the `/path/to/oss-fuzz/build/out/$PROJECT_NAME`\n    directory on your machine (and `$OUT` in the container).\n\n    **Note:** You *must* run your fuzz target binaries inside the base-runner docker\n    container to make sure that they work properly.\n\n2. Find failures to fix by running the `check_build` command:\n\n    ```bash\n    $ python3 infra/helper.py check_build $PROJECT_NAME\n    ```\n\n3. If you want to test changes against a particular fuzz target, run the following command:\n\n    ```bash\n    $ python3 infra/helper.py run_fuzzer --corpus-dir=<path-to-temp-corpus-dir> $PROJECT_NAME <fuzz_target>\n    ```\n\n4. We recommend taking a look at your code coverage as a test to ensure that\nyour fuzz targets get to the code you expect. This would use the corpus\ngenerated from the previous `run_fuzzer` step in your local corpus directory.\n\n    ```bash\n    $ python3 infra/helper.py build_fuzzers --sanitizer coverage $PROJECT_NAME\n    $ python3 infra/helper.py coverage $PROJECT_NAME --fuzz-target=<fuzz_target> --corpus-dir=<path-to-temp-corpus-dir>\n    ```\n\nYou may need to run `python3 infra/helper.py pull_images` to use the latest\ncoverage tools. Please refer to\n[code coverage]({{ site.baseurl }}/advanced-topics/code-coverage/) for detailed\ninformation on code coverage generation.\n\n\n**Note:** Currently, we only support AddressSanitizer (address) and UndefinedBehaviorSanitizer (undefined)\nconfigurations by default.\nMemorySanitizer is recommended, but needs to be enabled manually since you must build all runtime dependencies with MemorySanitizer.\n<b>Make sure to test each\nof the supported build configurations with the above commands (build_fuzzers -> run_fuzzer -> coverage).</b>\n\nIf everything works locally, it should also work on our automated builders and ClusterFuzz. If you check in\nyour files and experience failures, review your [dependencies]({{ site.baseurl }}/further-reading/fuzzer-environment/#dependencies).\n\n## Debugging Problems\n\nIf you run into problems, our [Debugging page]({{ site.baseurl }}/advanced-topics/debugging/) lists ways to debug your build scripts and\n[fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target).\n\n## Efficient fuzzing\n\nTo improve your fuzz target ability to find bugs faster, you should consider the\nfollowing ways:\n\n### Seed Corpus\n\nMost fuzzing engines use evolutionary fuzzing algorithms. Supplying a seed\ncorpus consisting of good sample inputs is one of the best ways to improve [fuzz\ntarget]({{ site.baseurl }}/reference/glossary/#fuzz-target)'s coverage.\n\nTo provide a corpus for `my_fuzzer`, put `my_fuzzer_seed_corpus.zip` file next\nto the [fuzz target]({{ site.baseurl }}/reference/glossary/#fuzz-target)'s binary in `$OUT` during the build. Individual files in this\narchive will be used as starting inputs for mutations. You can store the corpus\nnext to source files, generate during build or fetch it using curl or any other\ntool of your choice.\n(example: [boringssl](https://github.com/google/oss-fuzz/blob/master/projects/boringssl/build.sh#L41)).\n\nSeed corpus files will be used for cross-mutations and portions of them might appear\nin bug reports or be used for further security research. It is important that corpus\nhas an appropriate and consistent license.\n\nOSS-Fuzz only: See also [Accessing Corpora]({{ site.baseurl }}/advanced-topics/corpora/) for information about getting access to the corpus we are currently using for your fuzz targets.\n\n### Dictionaries\n\nDictionaries hugely improve fuzzing efficiency for inputs with lots of similar\nsequences of bytes. [libFuzzer documentation](https://llvm.org/docs/LibFuzzer.html#dictionaries)\n\nPut your dict file in `$OUT`. If the dict filename is the same as your target\nbinary name (i.e. `%fuzz_target%.dict`), it will be automatically used. If the\nname is different (e.g. because it is shared by several targets), specify this\nin .options file:\n\n```\n[libfuzzer]\ndict = dictionary_name.dict\n```\n\nIt is common for several [fuzz targets]({{ site.baseurl }}/reference/glossary/#fuzz-target)\nto reuse the same dictionary if they are fuzzing very similar inputs.\n(example: [expat](https://github.com/google/oss-fuzz/blob/ad88a2e5295d91251d15f8a612758cd9e5ad92db/projects/expat/parse_fuzzer.options)).\n\n### Input Size\n\nBy default, the fuzzing engine will generate input of any arbitrary length.\nThis might be useful to try corner cases that could lead to a\nsecurity vulnerability. However, if large inputs are not necessary to\nincrease the coverage of your target API, it is important to add a limit\nhere to significantly improve performance.\n\n```cpp\nif (size < kMinInputLength || size > kMaxInputLength)\n  return 0;\n```\n\n## Checking in to the OSS-Fuzz repository\n\nOnce you've tested your fuzzing files locally, fork OSS-Fuzz, commit, and push to the fork. Then\ncreate a pull request with your change. Follow the\n[Forking Project](https://guides.github.com/activities/forking/) guide if you're new to contributing\nvia GitHub.\n\n### Copyright headers\n\nPlease include copyright headers for all files checked in to oss-fuzz:\n\n```\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n```\n\n**Exception:** If you're porting a fuzz target from Chromium, keep the original Chromium license header.\n\n## Reviewing results\n\nOnce your change is merged, your project and fuzz targets should be automatically built and run on\nClusterFuzz after a short while (&lt; 1 day). If you think there's a problem, you can check your project's [build status](https://oss-fuzz-build-logs.storage.googleapis.com/index.html).\n\nUse the [ClusterFuzz web interface](https://oss-fuzz.com/) to review the following:\n* Crashes generated\n* Code coverage statistics\n* Fuzzer statistics\n* Fuzzer performance analyzer (linked from fuzzer statistics)\n\n**Note:** Your Google Account must be listed in [project.yaml](#projectyaml) for you to have access to the ClusterFuzz web interface.\n\n### Status Badge\n\n![Example\nBadge](https://oss-fuzz-build-logs.storage.googleapis.com/badges/curl.svg)\n\nOnce your project has started [building](https://oss-fuzz-build-logs.storage.googleapis.com/index.html), we'd love it if you added our badge in\nyour project's README. This allows you to see bugs found by your OSS-Fuzz\nintegration at a glance. See\n[brotli](https://github.com/google/brotli#introduction)'s\nREADME for an example.\n\nAdding it is super easy, just follow this template:\n```markdown\n[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/<project>.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:<project>)\n```\n\n## Monitoring performance via Fuzz Introspector\n\nAs soon as your project is run with ClusterFuzz (< 1 day), you can view the Fuzz\nIntrospector report for your project.\n[Fuzz Introspector](https://github.com/ossf/fuzz-introspector) helps you\nunderstand your fuzzers' performance and identify any potential blockers.\nIt provides individual and aggregated fuzzer reachability and coverage reports.\nYou can monitor each fuzzer's static reachability potential and compare it\nagainst dynamic coverage and identify any potential bottlenecks.\nFuzz Introspector can offer suggestions on increasing coverage by adding new\nfuzz targets or modify existing ones.\nFuzz Introspector reports can be viewed from the [OSS-Fuzz\nhomepage](https://oss-fuzz.com/) or through this\n[index](http://oss-fuzz-introspector.storage.googleapis.com/index.html).\nFuzz Introspector support C and C++ projects.\nSupport for Java and Python projects is in the progress.\n\nYou can view the [Fuzz Introspector report for bzip2](https://storage.googleapis.com/oss-fuzz-introspector/bzip2/inspector-report/20221017/fuzz_report.html)\nas an example.\n"
  },
  {
    "path": "docs/glossary.md",
    "content": "This page has moved [here](https://google.github.io/oss-fuzz/reference/glossary/)\n"
  },
  {
    "path": "docs/ideal_integration.md",
    "content": "This page has moved [here](https://google.github.io/oss-fuzz/advanced-topics/ideal-integration)\n"
  },
  {
    "path": "docs/index.md",
    "content": "---\nlayout: default\ntitle: OSS-Fuzz\npermalink: /\nnav_order: 1\nhas_children: true\nhas_toc: false\n---\n\n# OSS-Fuzz\n\n[Fuzz testing] is a well-known technique for uncovering programming errors in\nsoftware. Many of these detectable errors, like [buffer overflow], can have\nserious security implications. Google has found [thousands] of security\nvulnerabilities and stability bugs by deploying [guided in-process fuzzing of\nChrome components], and we now want to share that service with the open source\ncommunity.\n\n[Fuzz testing]: https://en.wikipedia.org/wiki/Fuzz_testing\n[buffer overflow]: https://en.wikipedia.org/wiki/Buffer_overflow\n[thousands]: https://bugs.chromium.org/p/chromium/issues/list?q=label%3AStability-LibFuzzer%2CStability-AFL%20-status%3ADuplicate%2CWontFix&can=1\n[guided in-process fuzzing of Chrome components]: https://security.googleblog.com/2016/08/guided-in-process-fuzzing-of-chrome.html\n\nIn cooperation with the [Core Infrastructure Initiative] and the [OpenSSF],\nOSS-Fuzz aims to make common open source software more secure and stable by\ncombining modern fuzzing techniques with scalable, distributed execution.\nProjects that do not qualify for OSS-Fuzz (e.g. closed source) can run their own\ninstances of [ClusterFuzz] or [ClusterFuzzLite].\n\n[Core Infrastructure Initiative]: https://www.coreinfrastructure.org/\n[OpenSSF]: https://www.openssf.org/\n\nWe support the [libFuzzer], [AFL++], [Honggfuzz], and [Centipede] fuzzing engines in\ncombination with [Sanitizers], as well as [ClusterFuzz], a distributed fuzzer\nexecution environment and reporting tool.\n\n[libFuzzer]: https://llvm.org/docs/LibFuzzer.html\n[AFL++]: https://github.com/AFLplusplus/AFLplusplus\n[Honggfuzz]: https://github.com/google/honggfuzz\n[Centipede]: https://github.com/google/centipede\n[Sanitizers]: https://github.com/google/sanitizers\n[ClusterFuzz]: https://github.com/google/clusterfuzz\n[ClusterFuzzLite]: https://google.github.io/clusterfuzzlite/\n\nCurrently, OSS-Fuzz supports C/C++, Rust, Go, Python, Java/JVM code, JavaScript\nand Lua. Other languages supported by [LLVM] may work too. OSS-Fuzz supports fuzzing x86_64\nand i386 builds.\n\n[LLVM]: https://llvm.org\n\n\n## Project history\nOSS-Fuzz was launched in 2016 in response to the\n[Heartbleed] vulnerability, discovered in [OpenSSL], one of the\nmost popular open source projects for encrypting web traffic. The vulnerability\nhad the potential to affect almost every internet user, yet was caused by a\nrelatively simple memory buffer overflow bug that could have been detected by\nfuzzing—that is, by running the code on randomized inputs to intentionally cause\nunexpected behaviors or crashes. At the time, though, fuzzing\nwas not widely used and was cumbersome for developers, requiring extensive\nmanual effort.\n\nGoogle created OSS-Fuzz to fill this gap: it's a free service that runs fuzzers\nfor open source projects and privately alerts developers to the bugs detected.\nSince its launch, OSS-Fuzz has become a critical service for the open source\ncommunity, growing beyond C/C++ to\ndetect problems in memory-safe languages such as Go, Rust, and Python.\n\n[Heartbleed]: https://heartbleed.com/ \n[OpenSSL]: https://www.openssl.org/\n\n## Learn more about fuzzing\n\nThis documentation describes how to use OSS-Fuzz service for your open source\nproject. To learn more about fuzzing in general, we recommend reading [libFuzzer\ntutorial] and the other docs in [google/fuzzing] repository. These and some\nother resources are listed on the [useful links] page.\n\n[google/fuzzing]: https://github.com/google/fuzzing/tree/master/docs\n[libFuzzer tutorial]: https://github.com/google/fuzzing/blob/master/tutorial/libFuzzerTutorial.md\n[useful links]: {{ site.baseurl }}/reference/useful-links/#tutorials\n\n## Trophies\nAs of August 2023, OSS-Fuzz has helped identify and fix over [10,000] vulnerabilities and [36,000] bugs across [1,000] projects.\n\n[10,000]: https://bugs.chromium.org/p/oss-fuzz/issues/list?q=Type%3DBug-Security%20label%3Aclusterfuzz%20-status%3ADuplicate%2CWontFix&can=1\n[36,000]: https://bugs.chromium.org/p/oss-fuzz/issues/list?q=Type%3DBug%20label%3Aclusterfuzz%20-status%3ADuplicate%2CWontFix&can=1\n[1,000]: https://github.com/google/oss-fuzz/tree/master/projects\n"
  },
  {
    "path": "docs/new_project_guide.md",
    "content": "This page has moved [here](https://google.github.io/oss-fuzz/getting-started/new-project-guide/)\n"
  },
  {
    "path": "docs/oss-fuzz/architecture.md",
    "content": "---\nlayout: default\ntitle: Architecture\npermalink: /architecture/\nnav_order: 1\nparent: OSS-Fuzz\n---\n\n# Architecture\n![OSS-Fuzz architecture diagram]({{ site.baseurl }}/images/process.png?raw=true)\n\nThe process works like this:\n\n1. A maintainer of an open source project (or an outside volunteer) creates\none or more [fuzz targets](https://llvm.org/docs/LibFuzzer.html#fuzz-target)\nand [integrates]({{ site.baseurl }}/advanced-topics/ideal-integration/) them\nwith the project's build and test system.\n1. The project is [accepted to OSS-Fuzz]({{ site.baseurl }}/getting-started/accepting-new-projects/) and the developer commits their build configurations.\n1. The OSS-Fuzz [builder](https://github.com/google/oss-fuzz/tree/master/infra/build) builds the project from the committed configs.\n1. The builder uploads the fuzz targets to the OSS-Fuzz GCS bucket.\n1. [ClusterFuzz]({{ site.baseurl }}/further-reading/clusterfuzz) downloads the fuzz targets and begins to fuzz the projects.\n1. When Clusterfuzz finds a\n  bug, it reports the issue automatically to the OSS-Fuzz\n  [issue tracker](https://bugs.chromium.org/p/oss-fuzz/issues/list) \n  ([example](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9)).\n  ([Why use a different tracker?]({{ site.baseurl }}/faq/#why-do-you-use-a-different-issue-tracker-for-reporting-bugs-in-oss-projects))\n1. Project owners are CCed on the bug report.\n1. The project developer fixes the bug upstream and credits OSS-Fuzz for the\n  discovery (the commit message should contain the string **'Credit to OSS-Fuzz'**).\n\nOnce the developer fixes the bug, [ClusterFuzz]({{ site.baseurl }}/further-reading/clusterfuzz) automatically\nverifies the fix, adds a comment, and closes the issue ([example](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53#c3)). After the fix is verified or 90 days after reporting (whichever is earlier), the issue becomes [public]({{ site.baseurl }}/getting-started/bug-disclosure-guidelines/).\n\n"
  },
  {
    "path": "docs/reference/glossary.md",
    "content": "---\nlayout: default\ntitle: Glossary\nnav_order: 1\npermalink: /reference/glossary/\nparent: Reference\n---\n\n# Glossary\n\nFor general fuzzing terms, see the [glossary] from [google/fuzzing] project.\n\n[glossary]: https://github.com/google/fuzzing/blob/master/docs/glossary.md\n[google/fuzzing]: https://github.com/google/fuzzing\n\n- TOC\n{:toc}\n---\n\n## OSS-Fuzz specific terms\n\n### ClusterFuzz\n\nA scalable fuzzing infrastructure that is used for OSS-Fuzz backend.\n[ClusterFuzz] is also used to fuzz Chrome and many other projects. A quick\noverview of ClusterFuzz user interface is available on this [page].\n\n[page]: {{ site.baseurl }}/further-reading/clusterfuzz\n[ClusterFuzz]: https://github.com/google/clusterfuzz\n\n### Fuzz Target\n\nIn addition to its\n[general definition](https://github.com/google/fuzzing/blob/master/docs/glossary.md#fuzz-target),\nin OSS-Fuzz a fuzz target can be used to\n[reproduce bug reports]({{ site.baseurl }}/advanced-topics/reproducing/).\nIt is recommended to use it for regression testing as well (see\n[ideal integration]({{ site.baseurl }}/advanced-topics/ideal-integration/)).\n\n### Job type\n\nOr **Fuzzer Build**.\n\nThis refers to a build that contains all the [fuzz targets] for a given\n[project](#project), is run with a specific [fuzzing engine], in a specific\nbuild mode (e.g. with enabled/disabled assertions), and optionally combined\nwith a [sanitizer].\n\nFor example, we have a \"libfuzzer_asan_sqlite\" job type, indicating a build of\nall sqlite3 [fuzz targets] using [libFuzzer](http://libfuzzer.info) and\n[ASan](http://clang.llvm.org/docs/AddressSanitizer.html).\n\n### Project\n\nA project is an open source software project that is integrated with OSS-Fuzz.\nEach project has a single set of configuration files \n(example: [expat](https://github.com/google/oss-fuzz/tree/master/projects/expat))\nand may have one or more [fuzz targets]\n(example: [openssl](https://github.com/openssl/openssl/blob/master/fuzz/)).\n\n### Reproducer\n\nOr a **testcase**.\n\nA [test input] that causes a specific bug to reproduce.\n\n[fuzz targets]: https://github.com/google/fuzzing/blob/master/docs/glossary.md#fuzz-target\n[fuzzing engine]: https://github.com/google/fuzzing/blob/master/docs/glossary.md#fuzzing-engine\n[sanitizer]: https://github.com/google/fuzzing/blob/master/docs/glossary.md#sanitizer\n[test input]: https://github.com/google/fuzzing/blob/master/docs/glossary.md#test-input\n\n### Sanitizers\n\nFuzzers are usually built with one or more [sanitizer](https://github.com/google/sanitizers) enabled. \n\n```bash\n$ python3 infra/helper.py build_fuzzers --sanitizer undefined json\n```\n\nSupported sanitizers:\n\n| Sanitizer | Description\n| ------------ | ----------\n| `address` *(default)* | [Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) with [Leak Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer).\n| `undefined` | [Undefined Behavior Sanitizer](http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html).\n| `memory` | [Memory Sanitizer](https://github.com/google/sanitizers/wiki/MemorySanitizer).<br/>*NOTE: It is critical that you build __all__ the code in your program (including libraries it uses) with Memory Sanitizer. Otherwise, you will see false positive crashes due to an inability to see initializations in uninstrumented code.*\n| `coverage` | Used for generating code coverage reports. See [Code Coverage doc]({{ site.baseurl }}/advanced-topics/code-coverage/).\n\nCompiler flag values for predefined configurations are specified in the [Dockerfile](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/Dockerfile). \nThese flags can be overridden by specifying `$SANITIZER_FLAGS` directly.\n\nYou can choose which configurations to automatically run your fuzzers with in `project.yaml` file (e.g. [sqlite3](https://github.com/google/oss-fuzz/tree/master/projects/sqlite3/project.yaml)).\n\n### Architectures\nClusterFuzz supports fuzzing on x86_64 (aka x64) by default. However you can also fuzz using AddressSanitizer and libFuzzer on i386 (aka x86, or 32 bit) by specifying the `$ARCHITECTURE` build environment variable using the `--architecture` option:\n\n```bash\npython3 infra/helper.py build_fuzzers --architecture i386 json\n```\n"
  },
  {
    "path": "docs/reference/reference.md",
    "content": "---\nlayout: default\ntitle: Reference\nhas_children: true\nnav_order: 6\npermalink: /reference/\n---\n\n# Reference\n"
  },
  {
    "path": "docs/reference/useful_links.md",
    "content": "---\nlayout: default\ntitle: Useful links\nnav_order: 2\npermalink: /reference/useful-links/\nparent: Reference\n---\n\n# Useful links\n\n- TOC\n{:toc}\n---\n\n## Web Interface\n\n* The main page: [oss-fuzz.com](https://oss-fuzz.com)\n\n## Build Status\n\n* [This page](https://oss-fuzz-build-logs.storage.googleapis.com/index.html)\n  gives the latest build logs for each project.\n\n## Blog posts\n\n* 2016-12-01 - Announcing OSS-Fuzz: Continuous fuzzing for open source software\n([Open Source](https://opensource.googleblog.com/2016/12/announcing-oss-fuzz-continuous-fuzzing.html),\n[Testing](https://testing.googleblog.com/2016/12/announcing-oss-fuzz-continuous-fuzzing.html),\n[Security](https://security.googleblog.com/2016/12/announcing-oss-fuzz-continuous-fuzzing.html))\n* 2017-05-08 - OSS-Fuzz: Five months later, and rewarding projects\n([Open Source](https://opensource.googleblog.com/2017/05/oss-fuzz-five-months-later-and.html),\n[Testing](https://testing.googleblog.com/2017/05/oss-fuzz-five-months-later-and.html),\n[Security](https://security.googleblog.com/2017/05/oss-fuzz-five-months-later-and.html))\n* 2018-11-06 - A New Chapter for OSS-Fuzz\n([Security](https://security.googleblog.com/2018/11/a-new-chapter-for-oss-fuzz.html))\n* 2020-10-09 - [Fuzzing internships for Open Source Software](https://security.googleblog.com/2020/10/fuzzing-internships-for-open-source.html)\n* 2020-12-07 - [Improving open source security during the Google summer internship program](https://security.googleblog.com/2020/12/improving-open-source-security-during.html)\n* 2021-03-10 - [Fuzzing Java in OSS-Fuzz](https://security.googleblog.com/2021/03/fuzzing-java-in-oss-fuzz.html)\n* 2021-12-16 - [Improving OSS-Fuzz and Jazzer to catch Log4Shell](https://security.googleblog.com/2021/12/improving-oss-fuzz-and-jazzer-to-catch.html)\n* 2022-09-08 - [Fuzzing beyond memory corruption: Finding broader classes of vulnerabilities automatically](https://security.googleblog.com/2022/09/fuzzing-beyond-memory-corruption.html)\n* 2023-02-01 - [Taking the next step: OSS-Fuzz in 2023](https://security.googleblog.com/2023/02/taking-next-step-oss-fuzz-in-2023.html)\n\n## Tutorials\n\n* [libFuzzer documentation](https://llvm.org/docs/LibFuzzer.html)\n* [libFuzzer tutorial](https://github.com/google/fuzzing/blob/master/tutorial/libFuzzerTutorial.md)\n* [libFuzzer workshop](https://github.com/Dor1s/libfuzzer-workshop)\n* [Structure-Aware Fuzzing with libFuzzer](https://github.com/google/fuzzer-test-suite/blob/master/tutorial/structure-aware-fuzzing.md)\n* [Chromium Fuzzing Page](https://chromium.googlesource.com/chromium/src/testing/libfuzzer/)\n* [Chromium Efficient Fuzzing Guide](https://chromium.googlesource.com/chromium/src/testing/libfuzzer/+/HEAD/efficient_fuzzing.md)\n* [ClusterFuzz documentation](https://google.github.io/clusterfuzz/)"
  },
  {
    "path": "docs/reproducing.md",
    "content": "This page has moved [here](https://google.github.io/oss-fuzz/advanced-topics/reproducing)\n"
  },
  {
    "path": "docs/research/target_generation.md",
    "content": "---\nlayout: default\nnav_exclude: true\npermalink: /research/llms/target_generation/\n---\n# Fuzz target generation using LLMs\n\n[Read our announcement blog.](https://security.googleblog.com/2023/08/ai-powered-fuzzing-breaking-bug-hunting.html)\n\n# Background\n\n[OSS-Fuzz](http://github.com/google/oss-fuzz) performs continuous fuzzing of [1000+](https://github.com/google/oss-fuzz/tree/master/projects) open source projects across most major languages. To integrate a new project, a human typically analyzes the attack surface of a library and writes [fuzz targets](https://github.com/google/fuzzing/blob/master/docs/glossary.md#fuzz-target) (also called fuzzing harnesses) to exercise the relevant code. Linked with a [fuzzing engine](https://github.com/google/fuzzing/blob/master/docs/glossary.md#fuzzing-engine) (e.g. libFuzzer, AFL, Centipede), this enables coverage-guided fuzzing for all OSS-Fuzz projects. Depending on the complexity of the project, writing fuzz targets typically requires several hours of manual work and sufficient background knowledge of the project.\n\nAdditionally, the main challenge for most integrated OSS-Fuzz projects is ensuring high code coverage. Most OSS-Fuzz projects have fairly low runtime coverage ([~30%](http://introspector.oss-fuzz.com/)) despite millions of hours of CPU time. This means we are not finding vulnerabilities in approximately 70% of each project that we’re fuzzing. Our [preliminary research](https://dl.acm.org/doi/abs/10.1145/3605157.3605177) found that many[ fuzz blockers](https://github.com/ossf/fuzz-introspector/blob/main/doc/Glossary.md#fuzz-blockers) (as determined by [FuzzIntrospector](https://introspector.oss-fuzz.com/)) are because of deficiencies in existing targets, rather than deficiencies in fuzzing engines.\n\nGenerating fuzz targets via LLMs can reduce the manual effort required to more thoroughly fuzz existing projects in OSS-Fuzz as well as integrating new projects into OSS-Fuzz.\n\n\n# Goals\n\nOur ideal end state of this research is to use LLMs for two use cases:\n\n1. Completely automatic fuzz target generation (or modification of existing targets) for existing OSS-Fuzz projects to unblock fuzz blockers and increase project code coverage (and bugs found) for free. \n2. Completely automatic fuzz target generation for completely new OSS-Fuzz projects. This is much more challenging than 1, and is an extension of it. \n\nOur current experiments focus on the first use case for C/C++ projects. This report serves as a preliminary investigation into how effective LLMs are for this use case. More detailed results and the experimentation framework for our research will be published at a later date. \n\n\n# Experiment framework\n\nTo discover whether an LLM could successfully write new fuzz targets, we built an evaluation framework that connects OSS-Fuzz to Google’s LLMs, conducts the experiment, and evaluates the results. The steps look like this:\n\n![experiment framework]({{ site.baseurl }}/images/llm_framework.png \"image_tooltip\")\n\n1. OSS-Fuzz’s [Fuzz Introspector tool](http://introspector.oss-fuzz.com/) identifies an under-fuzzed, high-potential, portion of the target project’s code and passes the code to the evaluation framework. \n2. The evaluation framework creates a prompt that the LLM will use to write the new fuzz target. The prompt includes project specific information.\n3. The evaluation framework takes the fuzz target generated by the LLM and runs the new target. \n4. The evaluation framework observes the run for any change in code coverage or crashes.\n5. In the event that the fuzz target fails to compile, the evaluation framework prompts the LLM to write a revised fuzz target that addresses the compilation errors.\n\n\n## 1. Identifying high potential portions of the project’s code\n\nWe leverage [Fuzz Introspector](https://introspector.oss-fuzz.com/) ([example JSON endpoint](https://introspector.oss-fuzz.com/api/far-reach-but-low-coverage?project=tinyxml2)) to provide us with a list of functions with low runtime coverage (but high potential to reach more code coverage). These are turned into benchmark YAML files, which consist of an OSS-Fuzz project, and a list of function signatures to generate new targets for. \n\nWe have started with a small set of benchmarks, and will gradually scale this to larger, automated sets of benchmarks taken from all of OSS-Fuzz as we improve the function selection and prompt generation process.\n\nExample benchmark (YAML):\n\n```yaml\nfunctions:\n- XML_Parser XMLCALL XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char\n  *context, const XML_Char *encodingName)\n- XML_Parser XMLCALL XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep)\n- XML_Bool XMLCALL XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)\n- static enum XML_Error PTRCALL externalParEntInitProcessor(XML_Parser parser, const\n  char *s, const char *end, const char **nextPtr)\nproject: expat\ntarget_path: /src/expat/expat/fuzz/xml_parse_fuzzer.c\ntarget_name: xml_parse_fuzzer_UTF-8\n```\n\n## 2. Prompt generation\n\nWe dynamically generate a prompt based on a template ([example](https://storage.googleapis.com/oss-fuzz-llm-targets-public/jsoncpp-json-value-removeindex/prompts.txt)).\n\nAs part of our experimentation, we tried various different prompt approaches. So far, the best results have come from including:\n\n*   One example of an existing function signature and fuzz target from the project under test, formatted into problem and solution structure. Too many examples yields worse results.\n*   Two examples from other projects in OSS-Fuzz, formatted in the same way.\n*   Examples of how to leverage [FuzzedDataProvider](https://github.com/google/fuzzing/blob/master/docs/split-inputs.md#fuzzed-data-provider) to generate inputs for function arguments.\n*   A priming that gives the task context.\n*   Examples of code anti-patterns to avoid.\n\nThe dynamically generated sections today include examples of existing fuzz targets from both other projects on OSS-Fuzz as well as one example from the project under test. We have other unexplored ideas including more structured information about the function under test, such as:\n\n*   Relevant data structure definitions\n*   Function implementations of the function under test and related functions\n*   Usages of the function under test and related functions\n\n\n## 3. Build and run\n\nWe leverage the OSS-Fuzz build infrastructure to build new targets by replacing an existing target’s source code with the newly generated target source code.  \n\nOSS-Fuzz projects often have strict compiler flags on by default. To make compilation easier, we also implemented a [compiler wrapper](https://github.com/google/oss-fuzz/blob/d78275b4e2e17d3d8f12b99db2b51de4b114edb3/infra/base-images/base-builder/jcc.go) that:\n\n*   Turns off compiler warnings to prevent trivial issues such as missing pointer casts from blocking compilation. \n*   Re-compiles targets as C++ (to leverage [FuzzedDataProvider](https://github.com/google/fuzzing/blob/master/docs/split-inputs.md#fuzzed-data-provider)).\n\n\n## 4. Measuring quality of generated targets\n\nAn important part of our research is to define metrics to measure the quality of generated targets. \n\nThese metrics are:\n\n*   Syntax correctness and project consistency. This is measured by its compilation result. For example: whether it compiles successfully, does it call functions in the project correctly without hallucination.\n*   Whether it crashes instantly or within the fuzz target. This often means that there is some miscalled API and the crashes are likely to be false positives. \n*   **New code coverage**. This is measured by the new lines it covered compared to all existing targets in OSS-Fuzz for the same project. \n\nAll of these metrics can be automatically computed for a given generated target. \n\n\n## 5. LLM Code Fixer\n\nThe fuzz targets generated by LLM often contain various trivial defects,  which can be fixed by a separate LLM query.\n\nThe prompt of the code fixing query is structured as follows, where the raw code and error are respectively replaced with the fuzz target source code generated by the LLM and the build error messages extracted from pages of build logs:\n\n````\nGiven the following code and its build error message, fix the code without affecting its functionality.\nFirst explain the reason, then output the whole fixed code.\nIf a function is missing, fix it by including the related libraries.\nCode:\n```\n{raw_code}\n```\nBuild error message:\n```\n{error}\n```\nFixed code:\n````\n\nSeveral rounds of code fixing queries are required for some cases. For example, when multiple defects incurs several error messages, sometimes LLM tends to only fix one of them at a time. Similarly, new defects may be introduced during code fixing. In these cases, we found iteratively querying LLM with the same prompt structure will gradually fix all errors.\n\nLLM often proposes several responses for each query, we prefer the one with the longest code. This is an implementation decision to avoid a quadratically increasing number of targets to build (e.g. the LLMs could propose 4 new targets across N iterations) and to avoid the LLM deleting the function code to fix build failures.\n\nAdditionally, we also check that the generated target includes a call to the requested function to test. If it does not, this is surfaced as an error to the LLM. \t\n\n\n### Example\n\n[Prompt](https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmldocument-print/fixes/04-F4/prompt.txt): Incorrect target with missing arguments passed to target function.\n\n[After fix](https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmldocument-print/fixes/04-F4/01.cpp): Correct function argument added.\n\n# Results\n\nInitially, getting any compilable output was a challenge. We were able to improve this via prompt engineering and our compiler wrapper to having [14/31 tested OSS-Fuzz projects](https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=benchmarks/) successfully compile new targets and increase coverage. The successful examples and prompts are published [here](https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html). \n\nWe see a wide range of coverage improvements from 0-31% code coverage increases.\n\nThe top coverage increases, aggregated across all benchmarks per OSS-Fuzz project are:\n\n\n<table>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">31%\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">6%\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">expat \n   </td>\n   <td style=\"background-color: null\">4%\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libplist\n   </td>\n   <td style=\"background-color: null\">4%\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libxml2\n   </td>\n   <td style=\"background-color: null\">1%\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">elfutils\n   </td>\n   <td style=\"background-color: null\">1%\n   </td>\n  </tr>\n</table>\n\n\nThe best result we’ve had is with the TinyXML2 project, where we managed to increase fuzz coverage from [38%](https://storage.googleapis.com/oss-fuzz-coverage/tinyxml2/reports/20230801/linux/report.html) line coverage to [69%](https://storage.googleapis.com/oss-fuzz-coverage/llm-results/tinyxml2/linux/report.html) line coverage without any interventions.\n\n\n\n\n![alt_text]({{ site.baseurl }}/images/tinyxml2_examples.png \"image_tooltip\")\n\n\nAdditionally, we targeted OpenSSL from the perspective of discovering past vulnerabilities that were not found due to lack of fuzzing coverage. We were able to replicate [a similar fuzz target](https://storage.googleapis.com/oss-fuzz-llm-targets-public/openssl-ossl_punycode_decode/targets/15.c) that rediscovered [CVE-2022-3602](https://nvd.nist.gov/vuln/detail/CVE-2022-3602).\n\n![alt_text]({{ site.baseurl }}/images/punycode.png \"Stacktrace from LLM-generated target finding CVE-2022-3602\")\n\n\n# Future work\n\nWe’ve seen very promising early results in this space and will continue our research.\n\n\n## 1. Continue research\n\nThere are a number of areas we’d like to further research on:\n\n\n\n*   Expand benchmarks to all of OSS-Fuzz. We’d like to expand the set of benchmarks to cover all of OSS-Fuzz.\n*   Continued prompt engineering and experimentation with project-specific context, such as more structured context (e.g. structure definitions, implementations) around the relevant function to test. \n*   Model fine-tuning\n*   Expand to other languages beyond C/C++\n*   Expand research to completely new projects with no existing OSS-Fuzz integration.  \n\n\n## 2. Open source evaluation framework\n\nWe plan to open source the evaluation framework we’ve built to help test arbitrary auto-fuzz target generation capabilities. We hope that OSS-Fuzz can serve as a valuable benchmarking platform for researchers in this space. \n\n\n## 3. OSS-Fuzz integration\n\nUltimately, the goal is to integrate the results of this research into OSS-Fuzz, to provide:\n\n\n\n*   Free coverage increases for existing projects\n*   Automated onboarding of new projects, and tools to help maintainers write manual fuzz targets. \n\n\n# Appendix\n\n\n## Successful benchmark results\n\n<table>\n  <tr>\n   <td style=\"background-color: null\"><strong>Project</strong>\n   </td>\n   <td style=\"background-color: null\"><strong>Function</strong>\n   </td>\n   <td style=\"background-color: null\"><strong>Output</strong>\n   </td>\n   <td style=\"background-color: null\"><strong>Build rate</strong>\n   </td>\n   <td style=\"background-color: null\"><strong>Max Coverage</strong>\n   </td>\n   <td style=\"background-color: null\"><strong>Max Line coverage diff</strong>\n   </td>\n   <td style=\"background-color: null\"><strong>Reports</strong>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmldocument-print\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmldocument-print/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-print/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-print/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n29.74</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n11.16</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-print/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmldocument-deepcopy\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmldocument-deepcopy/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-deepcopy/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-deepcopy/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n26.8</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n4.45</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-deepcopy/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-setattribute\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-setattribute/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-setattribute/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-setattribute/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n75</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n26.08</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n3.77</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-setattribute/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libplist\n   </td>\n   <td style=\"background-color: null\">plist_print\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libplist-plist_print/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libplist-plist_print/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libplist-plist_print/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n12.88</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n3.42</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libplist-plist_print/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-doubletext\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-doubletext/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-doubletext/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-doubletext/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.61</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n3.28</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-doubletext/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-booltext\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-booltext/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-booltext/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-booltext/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n87.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n26.18</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.9</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-booltext/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-insertnewunknown\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-insertnewunknown/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewunknown/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewunknown/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.67</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.64</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewunknown/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-int64text\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-int64text/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-int64text/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-int64text/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n87.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.91</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.64</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-int64text/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">cjson_compare\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/cjson-cjson_compare/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_compare/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_compare/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n75</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n29.68</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.47</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_compare/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-floattext\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-floattext/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-floattext/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-floattext/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.09</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.45</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-floattext/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-inttext\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-inttext/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-inttext/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-inttext/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n75</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n26.2</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.41</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-inttext/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-unsigned64text\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-unsigned64text/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-unsigned64text/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-unsigned64text/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.74</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.22</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-unsigned64text/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyobjloader\n   </td>\n   <td style=\"background-color: null\">tinyobj-objreader-parsefromfile\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyobjloader-tinyobj-objreader-parsefromfile/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-objreader-parsefromfile/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-objreader-parsefromfile/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n5.7</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.16</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-objreader-parsefromfile/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-unsignedtext\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-unsignedtext/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-unsignedtext/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-unsignedtext/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.53</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.15</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-unsignedtext/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-shallowclone\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-shallowclone/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-shallowclone/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-shallowclone/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.03</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.07</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-shallowclone/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">cjson_replaceiteminobject\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/cjson-cjson_replaceiteminobject/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_replaceiteminobject/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_replaceiteminobject/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n27.56</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.98</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_replaceiteminobject/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-gettext\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-gettext/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-gettext/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-gettext/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.42</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.96</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-gettext/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-shallowequal\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-shallowequal/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-shallowequal/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-shallowequal/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.58</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.96</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-shallowequal/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">cjson_duplicate\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/cjson-cjson_duplicate/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_duplicate/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_duplicate/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n27.4</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.89</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_duplicate/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">expat\n   </td>\n   <td style=\"background-color: null\">xml_externalentityparsercreate\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/expat-xml_externalentityparsercreate/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=expat-xml_externalentityparsercreate/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=expat-xml_externalentityparsercreate/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n12.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.88</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=expat-xml_externalentityparsercreate/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">cjson_replaceiteminobjectcasesensitive\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/cjson-cjson_replaceiteminobjectcasesensitive/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_replaceiteminobjectcasesensitive/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_replaceiteminobjectcasesensitive/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n87.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.54</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.85</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_replaceiteminobjectcasesensitive/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-insertnewcomment\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-insertnewcomment/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewcomment/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewcomment/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.61</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.85</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewcomment/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">expat\n   </td>\n   <td style=\"background-color: null\">xml_parsercreatens\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/expat-xml_parsercreatens/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=expat-xml_parsercreatens/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=expat-xml_parsercreatens/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n12.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n45.6</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.84</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=expat-xml_parsercreatens/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-deleteattribute\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-deleteattribute/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-deleteattribute/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-deleteattribute/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.73</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.7</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-deleteattribute/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-insertnewdeclaration\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-insertnewdeclaration/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewdeclaration/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewdeclaration/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.7</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewdeclaration/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-insertnewchildelement\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-insertnewchildelement/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewchildelement/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewchildelement/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n24.88</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.51</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewchildelement/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlnode-previoussiblingelement\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlnode-previoussiblingelement/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlnode-previoussiblingelement/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlnode-previoussiblingelement/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n87.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n26.08</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.43</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlnode-previoussiblingelement/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyobjloader\n   </td>\n   <td style=\"background-color: null\">tinyobj-loadobj\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyobjloader-tinyobj-loadobj/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-loadobj/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-loadobj/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n4.33</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.35</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-loadobj/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyobjloader\n   </td>\n   <td style=\"background-color: null\">tinyobj-material_t-material_t\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyobjloader-tinyobj-material_t-material_t/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-material_t-material_t/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-material_t-material_t/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n23.91</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.35</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyobjloader-tinyobj-material_t-material_t/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmlelement-insertnewtext\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmlelement-insertnewtext/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewtext/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewtext/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n24.42</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.32</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmlelement-insertnewtext/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">elfutils\n   </td>\n   <td style=\"background-color: null\">dwfl_module_relocate_address\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/elfutils-dwfl_module_relocate_address/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=elfutils-dwfl_module_relocate_address/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=elfutils-dwfl_module_relocate_address/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n87.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n7.81</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.1</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=elfutils-dwfl_module_relocate_address/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libxml2\n   </td>\n   <td style=\"background-color: null\">xmlschemavalidatefile\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libxml2-xmlschemavalidatefile/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmlschemavalidatefile/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmlschemavalidatefile/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n4.18</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.93</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmlschemavalidatefile/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">tinyxml2\n   </td>\n   <td style=\"background-color: null\">tinyxml2-xmldocument-loadfile\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/tinyxml2-tinyxml2-xmldocument-loadfile/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-loadfile/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-loadfile/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.17</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.9</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=tinyxml2-tinyxml2-xmldocument-loadfile/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">speex\n   </td>\n   <td style=\"background-color: null\">ogg_stream_packetin\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/speex-ogg_stream_packetin/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=speex-ogg_stream_packetin/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=speex-ogg_stream_packetin/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n8.06</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.55</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=speex-ogg_stream_packetin/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libxml2\n   </td>\n   <td style=\"background-color: null\">xmltextreadersetschema\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libxml2-xmltextreadersetschema/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreadersetschema/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreadersetschema/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.44</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.48</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreadersetschema/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libxml2\n   </td>\n   <td style=\"background-color: null\">xmltextreaderschemavalidate\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libxml2-xmltextreaderschemavalidate/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreaderschemavalidate/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreaderschemavalidate/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n4.03</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.36</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreaderschemavalidate/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libplist\n   </td>\n   <td style=\"background-color: null\">plist_dict_merge\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libplist-plist_dict_merge/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libplist-plist_dict_merge/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libplist-plist_dict_merge/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n12.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.8</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.35</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libplist-plist_dict_merge/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libxml2\n   </td>\n   <td style=\"background-color: null\">xmltextreaderschemavalidatectxt\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libxml2-xmltextreaderschemavalidatectxt/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreaderschemavalidatectxt/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreaderschemavalidatectxt/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.19</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.33</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libxml2-xmltextreaderschemavalidatectxt/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">cjson_printpreallocated\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/cjson-cjson_printpreallocated/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_printpreallocated/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_printpreallocated/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n75</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n26.44</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.22</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_printpreallocated/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libucl\n   </td>\n   <td style=\"background-color: null\">ucl_parser_insert_chunk\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libucl-ucl_parser_insert_chunk/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_parser_insert_chunk/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_parser_insert_chunk/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n10.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.22</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_parser_insert_chunk/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libucl\n   </td>\n   <td style=\"background-color: null\">ucl_object_compare\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libucl-ucl_object_compare/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_compare/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_compare/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n12.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n1.35</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.21</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_compare/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">elfutils\n   </td>\n   <td style=\"background-color: null\">dwarf_getlocations\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/elfutils-dwarf_getlocations/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=elfutils-dwarf_getlocations/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=elfutils-dwarf_getlocations/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n7.22</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.2</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=elfutils-dwarf_getlocations/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libucl\n   </td>\n   <td style=\"background-color: null\">ucl_parser_add_fd_priority\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libucl-ucl_parser_add_fd_priority/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_parser_add_fd_priority/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_parser_add_fd_priority/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n71.43</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n19.61</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.18</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_parser_add_fd_priority/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">jsoncpp\n   </td>\n   <td style=\"background-color: null\">json-value-resize\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/jsoncpp-json-value-resize/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=jsoncpp-json-value-resize/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=jsoncpp-json-value-resize/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n2.23</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.17</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=jsoncpp-json-value-resize/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">mosquitto\n   </td>\n   <td style=\"background-color: null\">mosquitto_topic_matches_sub2\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/mosquitto-mosquitto_topic_matches_sub2/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=mosquitto-mosquitto_topic_matches_sub2/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=mosquitto-mosquitto_topic_matches_sub2/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n87.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n28.28</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.16</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=mosquitto-mosquitto_topic_matches_sub2/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">xvid\n   </td>\n   <td style=\"background-color: null\">xvid_encore\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/xvid-xvid_encore/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=xvid-xvid_encore/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=xvid-xvid_encore/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n31.25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.22</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.16</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=xvid-xvid_encore/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">cjson_parse\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/cjson-cjson_parse/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_parse/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_parse/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n75</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.72</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.13</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_parse/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">cjson\n   </td>\n   <td style=\"background-color: null\">cjson_parsewithlength\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/cjson-cjson_parsewithlength/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_parsewithlength/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_parsewithlength/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25.72</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.13</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=cjson-cjson_parsewithlength/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">jsoncpp\n   </td>\n   <td style=\"background-color: null\">json-value-removeindex\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/jsoncpp-json-value-removeindex/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=jsoncpp-json-value-removeindex/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=jsoncpp-json-value-removeindex/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n5.11</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.13</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=jsoncpp-json-value-removeindex/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libucl\n   </td>\n   <td style=\"background-color: null\">ucl_object_merge\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libucl-ucl_object_merge/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_merge/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_merge/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.65</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.12</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_merge/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">speex\n   </td>\n   <td style=\"background-color: null\">ogg_stream_pageout_fill\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/speex-ogg_stream_pageout_fill/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=speex-ogg_stream_pageout_fill/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=speex-ogg_stream_pageout_fill/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n6.25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.07</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=speex-ogg_stream_pageout_fill/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libsndfile\n   </td>\n   <td style=\"background-color: null\">sf_command\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libsndfile-sf_command/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libsndfile-sf_command/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libsndfile-sf_command/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n25</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n3.41</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.06</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libsndfile-sf_command/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">mosquitto\n   </td>\n   <td style=\"background-color: null\">mosquitto_topic_matches_sub\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/mosquitto-mosquitto_topic_matches_sub/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=mosquitto-mosquitto_topic_matches_sub/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=mosquitto-mosquitto_topic_matches_sub/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n62.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n4.03</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.05</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=mosquitto-mosquitto_topic_matches_sub/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libsndfile\n   </td>\n   <td style=\"background-color: null\">sf_format_check\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libsndfile-sf_format_check/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libsndfile-sf_format_check/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libsndfile-sf_format_check/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n12.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.1</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.04</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libsndfile-sf_format_check/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libucl\n   </td>\n   <td style=\"background-color: null\">ucl_object_replace_key\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libucl-ucl_object_replace_key/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_replace_key/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_replace_key/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n50</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n7.14</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.04</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libucl-ucl_object_replace_key/report/\">Reports</a>\n   </td>\n  </tr>\n  <tr>\n   <td style=\"background-color: null\">libdwarf\n   </td>\n   <td style=\"background-color: null\">dwarf_find_die_given_sig8\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/libdwarf-dwarf_find_die_given_sig8/prompts.txt\">Prompt</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libdwarf-dwarf_find_die_given_sig8/fixes/\">Fixes</a>;\n<br>\n<a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libdwarf-dwarf_find_die_given_sig8/targets/\">Targets</a>.\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n37.5</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n11.62</p>\n\n   </td>\n   <td style=\"background-color: null\"><p style=\"text-align: right\">\n0.01</p>\n\n   </td>\n   <td style=\"background-color: null\"><a href=\"https://storage.googleapis.com/oss-fuzz-llm-targets-public/index.html?prefix=libdwarf-dwarf_find_die_given_sig8/report/\">Reports</a>\n   </td>\n  </tr>\n</table>\n\n\n<script>jtd.setTheme('wider');</script>\n\n"
  },
  {
    "path": "infra/.dockerignore",
    "content": "cifuzz/test_data/*\n\n# Copied from .gitignore.\n.vscode/\n*.pyc\nbuild\n*~\n.DS_Store\n*.swp"
  },
  {
    "path": "infra/MAINTAINERS.csv",
    "content": "Name,Email,Github Username\nAdam Korcz,adam@adalogics.com,AdamKorcz\nDavid Korczynski,david@adalogics.com,DavidKorczynski\nDongge Liu,donggeliu@google.com,Alan32Liu\nHolly Gong,gongh@google.com,hogo6002\nJonathan Metzman,metzman@google.com,jonathanmetzman\nOliver Chang,ochang@google.com,oliverchang"
  },
  {
    "path": "infra/README.md",
    "content": "# infra\n> OSS-Fuzz project infrastructure\n\nCore infrastructure:\n* [`base-images`](base-images/) - docker images for building fuzz targets & corresponding jenkins\n  pipeline.\n\nContinuous Integration infrastructure:\n\n* [`ci`](ci/) - script to build projects in CI.\n\n## helper.py\n> script to automate common docker operations\n\n| Command | Description |\n|---------|-------------\n| `generate`      | Generates skeleton files for a new project |\n| `build_image`   | Builds a docker image for a given project |\n| `build_fuzzers` | Builds fuzz targets for a given project |\n| `run_fuzzer`    | Runs a fuzz target in a docker container |\n| `coverage`      | Runs fuzz target(s) in a docker container and generates a code coverage report. See [Code Coverage doc](https://google.github.io/oss-fuzz/advanced-topics/code-coverage/) |\n| `reproduce`     | Runs a testcase to reproduce a crash |\n| `shell`         | Starts a shell inside the docker image for a project |\n"
  },
  {
    "path": "infra/base-images/README.md",
    "content": "# Base Images\n\nThis directory contains the base images used by OSS-Fuzz.\n\n## Building\n\nTo build all images, run:\n\n```bash\n# run from project root\ninfra/base-images/all.sh\n```\n\n## Trial Builds for Testing Changes\n\nWhen making changes to any of the base images, it's crucial to test them using the trial build system. This system is designed to build test versions of the images, identified by a `-testing` suffix, and use them to build a subset of OSS-Fuzz projects to ensure the changes don't cause regressions.\n\n### Architecture Overview\n\nThe trial build system now supports building multiple Ubuntu base variants in parallel to accelerate testing. The supported variants are:\n- `latest` (based on the default `Dockerfile`)\n- `ubuntu-20-04` (based on `ubuntu-20-04.Dockerfile`)\n- `ubuntu-24-04` (based on `ubuntu-24-04.Dockerfile`)\n\nWhen a trial build is triggered on a Pull Request that modifies files in `infra/base-images/`, the system initiates three separate, parallel builds in Google Cloud Build (GCB). Each of these builds is responsible for building all base images for a single Ubuntu variant. This parallel architecture allows for faster feedback on changes across different base OS versions.\n\n### How to Trigger a Trial Build\n\n1.  Create a Pull Request with your changes to the base images.\n2.  Once the PR is open, add a comment with the following command:\n    ```\n    /gcbrun trial_build.py all\n    ```\n3.  This command will be picked up by our CI system. It will first trigger a \"coordinator\" build, which then spawns the three parallel builds for the different Ubuntu variants. You can monitor the progress of these builds directly in the Google Cloud Build interface linked in your PR.\n\n## Dependency Tree\n\nThe following diagram shows the dependency tree of the base images.\n\n```mermaid\ngraph TD\n    A[base-image] --> B(base-clang);\n    B --> C(base-builder);\n    C --> D(base-builder-go);\n    C --> E(base-builder-javascript);\n    C --> F(base-builder-jvm);\n    C --> G(base-builder-python);\n    C --> H(base-builder-ruby);\n    C --> I(base-builder-rust);\n    C --> J(base-builder-swift);\n    C --> K(base-builder-fuzzbench);\n    A --> L(base-runner);\n    B --> L;\n    C --> L;\n    H --> L;\n    L --> M(base-runner-debug);\n```\n"
  },
  {
    "path": "infra/base-images/all.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n#\n# A script to build base images locally.\n#\n# This script is a wrapper around `docker build` that dynamically fetches the\n# official list of images from the Python source of truth, ensuring it never\n# goes out of date.\n#\n# Usage:\n#       # Build the 'latest' version of all images.\n#       ./all.sh\n#\n#       # Build the 'ubuntu-24-04' version of all images.\n#       ./all.sh ubuntu-24-04\n#\n################################################################################\n\n# The first argument is the version tag, e.g., 'latest', 'ubuntu-20-04'.\nVERSION_TAG=${1:-latest}\n\n# Get the directory where this script is located to find the helper script.\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" >/dev/null 2>&1 && pwd)\"\n\n# Fetch the official list of images from the Python source of truth.\n# This avoids duplicating the image list and ensures this script is always\n# up-to-date.\nIMAGE_LIST=$(python3 \"${SCRIPT_DIR}/list_images.py\")\n\necho \"Building version: ${VERSION_TAG}\"\necho \"Images to build: ${IMAGE_LIST}\"\n\n# Loop through the official list of images and build each one.\nfor image_name in ${IMAGE_LIST}; do\n  image_dir=\"infra/base-images/${image_name}\"\n  \n  if [ \"${VERSION_TAG}\" == \"latest\" ]; then\n    dockerfile=\"${image_dir}/Dockerfile\"\n    tag=\"gcr.io/oss-fuzz-base/${image_name}\"\n  else\n    dockerfile=\"${image_dir}/${VERSION_TAG}.Dockerfile\"\n    tag=\"gcr.io/oss-fuzz-base/${image_name}:${VERSION_TAG}\"\n  fi\n\n  if [ ! -f \"${dockerfile}\" ]; then\n    echo \"Skipping build for ${image_name}:${VERSION_TAG} - Dockerfile not found at ${dockerfile}\"\n    continue\n  fi\n\n  echo \"Building ${tag} from ${dockerfile}...\"\n  docker build -t \"${tag}\" -f \"${dockerfile}\" \"${image_dir}\"\ndone\n\necho \"All builds for version ${VERSION_TAG} completed successfully.\"\n"
  },
  {
    "path": "infra/base-images/base-builder/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder` were successfully built. These images contain the necessary tools and libraries for building fuzzers. The `ubuntu-24-04` build required a fix to the `ADD` instruction in the Dockerfile to correctly handle multiple files. Both versions install a variety of tools, including Python, Bazel, and various compilers.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe `ubuntu-24-04` image includes newer versions of many packages, including Python 3.11.13. The specific versions of other tools and libraries also differ due to the updated base image.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have several key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-clang` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Package Installation:** The `install_deps.sh` script is used to install a base set of dependencies, which differ between the two versions.\n*   **Python Installation:** The `ubuntu-24-04` Dockerfile installs Python 3.11.13 from source, while the `ubuntu-20-04` version uses a different set of commands.\n*   **ADD Instruction:** The `ADD` instruction in the `ubuntu-24-04` Dockerfile was corrected to use the proper syntax for adding multiple files.\n"
  },
  {
    "path": "infra/base-images/base-builder/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-clang\n\nCOPY install_deps.sh /\nRUN /install_deps.sh && rm /install_deps.sh\n\n# Build and install latest Python 3.11.\nENV PYTHON_VERSION 3.11.13\nRUN PYTHON_DEPS=\"\\\n        zlib1g-dev \\\n        libncurses5-dev \\\n        libgdbm-dev \\\n        libnss3-dev \\\n        libssl-dev \\\n        libsqlite3-dev \\\n        libreadline-dev \\\n        libffi-dev \\\n        libbz2-dev \\\n        liblzma-dev\" && \\\n    unset CFLAGS CXXFLAGS && \\\n    apt-get install -y $PYTHON_DEPS && \\\n    cd /tmp && \\\n    curl -O https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz && \\\n    tar -xvf Python-$PYTHON_VERSION.tar.xz && \\\n    cd Python-$PYTHON_VERSION && \\\n    ./configure --enable-optimizations --enable-shared && \\\n    make -j$(nproc) && \\\n    make install && \\\n    ldconfig && \\\n    ln -s /usr/local/bin/python3 /usr/local/bin/python && \\\n    cd .. && \\\n    rm -r /tmp/Python-$PYTHON_VERSION.tar.xz /tmp/Python-$PYTHON_VERSION && \\\n    rm -rf /usr/local/lib/python${PYTHON_VERSION%.*}/test && \\\n    python3 -m ensurepip && \\\n    python3 -m pip install --upgrade pip && \\\n    apt-get remove -y $PYTHON_DEPS # https://github.com/google/oss-fuzz/issues/3888\n\n\nENV CCACHE_VERSION 4.10.2\nRUN cd /tmp && curl -OL https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION/ccache-$CCACHE_VERSION.tar.xz && \\\n    tar -xvf ccache-$CCACHE_VERSION.tar.xz && cd ccache-$CCACHE_VERSION && \\\n    mkdir build && cd build && \\\n    export LDFLAGS='-lpthread' && \\\n    cmake -D CMAKE_BUILD_TYPE=Release .. && \\\n    make -j && make install && \\\n    rm -rf /tmp/ccache-$CCACHE_VERSION /tmp/ccache-$CCACHE_VERSION.tar.xz\n\n# Install six for Bazel rules.\nRUN unset CFLAGS CXXFLAGS && pip3 install -v --no-cache-dir \\\n    six==1.15.0 absl-py==2.3.0 pyelftools==0.32 && rm -rf /tmp/*\n\n# Install Bazel through Bazelisk, which automatically fetches the latest Bazel version.\nENV BAZELISK_VERSION 1.9.0\nRUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v$BAZELISK_VERSION/bazelisk-linux-amd64 -o /usr/local/bin/bazel && \\\n    chmod +x /usr/local/bin/bazel\n\n# Default build flags for various sanitizers.\nENV SANITIZER_FLAGS_address \"-fsanitize=address -fsanitize-address-use-after-scope\"\nENV SANITIZER_FLAGS_hwaddress \"-fsanitize=hwaddress -fuse-ld=lld -Wno-unused-command-line-argument\"\n\n# Set of '-fsanitize' flags matches '-fno-sanitize-recover' + 'unsigned-integer-overflow'.\nENV SANITIZER_FLAGS_undefined \"-fsanitize=array-bounds,bool,builtin,enum,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr\"\n\n# Don't include \"function\" since it is unsupported on aarch64.\nENV SANITIZER_FLAGS_undefined_aarch64 \"-fsanitize=array-bounds,bool,builtin,enum,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr\"\n\nENV SANITIZER_FLAGS_memory \"-fsanitize=memory -fsanitize-memory-track-origins\"\n\nENV SANITIZER_FLAGS_thread \"-fsanitize=thread\"\n\nENV SANITIZER_FLAGS_introspector \"-O0 -flto -fno-inline-functions -fuse-ld=gold -Wno-unused-command-line-argument\"\n\n# Do not use any sanitizers in the coverage build.\nENV SANITIZER_FLAGS_coverage \"\"\n\n# We use unsigned-integer-overflow as an additional coverage signal and have to\n# suppress error messages. See https://github.com/google/oss-fuzz/issues/910.\nENV UBSAN_OPTIONS=\"silence_unsigned_overflow=1\"\n\n# To suppress warnings from binaries running during compilation.\nENV DFSAN_OPTIONS='warn_unimplemented=0'\n\n# Default build flags for coverage feedback.\nENV COVERAGE_FLAGS=\"-fsanitize=fuzzer-no-link\"\n\n# Use '-Wno-unused-command-line-argument' to suppress \"warning: -ldl: 'linker' input unused\"\n# messages which are treated as errors by some projects.\nENV COVERAGE_FLAGS_coverage \"-fprofile-instr-generate -fcoverage-mapping -pthread -Wl,--no-as-needed -Wl,-ldl -Wl,-lm -Wno-unused-command-line-argument\"\n\n# Default sanitizer, fuzzing engine and architecture to use.\nENV SANITIZER=\"address\"\nENV FUZZING_ENGINE=\"libfuzzer\"\nENV ARCHITECTURE=\"x86_64\"\n\n# DEPRECATED - NEW CODE SHOULD NOT USE THIS. OLD CODE SHOULD STOP. Please use\n# LIB_FUZZING_ENGINE instead.\n# Path to fuzzing engine library to support some old users of\n# LIB_FUZZING_ENGINE.\nENV LIB_FUZZING_ENGINE_DEPRECATED=\"/usr/lib/libFuzzingEngine.a\"\n\n# Argument passed to compiler to link against fuzzing engine.\n# Defaults to the path, but is \"-fsanitize=fuzzer\" in libFuzzer builds.\nENV LIB_FUZZING_ENGINE=\"/usr/lib/libFuzzingEngine.a\"\n\n# TODO: remove after tpm2 catchup.\nENV FUZZER_LDFLAGS \"\"\n\nWORKDIR $SRC\n\nCOPY afl_llvm22_patch.diff $SRC/\nRUN git clone https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \\\n    cd aflplusplus && \\\n    git checkout eadc8a2a7e0fa0338802ee6254bf296489ce4fd7 && \\\n    wget --no-check-certificate -O oss.sh https://raw.githubusercontent.com/vanhauser-thc/binary_blobs/master/oss.sh && \\\n    git apply $SRC/afl_llvm22_patch.diff && \\\n    rm -rf .git && \\\n    chmod 755 oss.sh\n\n# Do precompiles before copying other scripts for better cache efficiency.\nCOPY precompile_afl /usr/local/bin/\nRUN precompile_afl\n\nRUN cd $SRC && \\\n    curl -L -O https://github.com/google/honggfuzz/archive/oss-fuzz.tar.gz && \\\n    mkdir honggfuzz && \\\n    cd honggfuzz && \\\n    tar -xz --strip-components=1 -f $SRC/oss-fuzz.tar.gz && \\\n    rm -rf examples $SRC/oss-fuzz.tar.gz\n\n\nCOPY precompile_honggfuzz /usr/local/bin/\nRUN precompile_honggfuzz\n\nRUN cd $SRC && \\\n    git clone https://github.com/google/fuzztest && \\\n    cd fuzztest && \\\n    git checkout a37d133f714395cabc20dd930969a889495c9f53 && \\\n    rm -rf .git\n\nENV CENTIPEDE_BIN_DIR=$SRC/fuzztest/bazel-bin\nCOPY precompile_centipede /usr/local/bin/\nRUN precompile_centipede\n\nCOPY sanitizers /usr/local/lib/sanitizers\n\nCOPY bazel_build_fuzz_tests \\\n    cargo \\\n    compile \\\n    compile_afl \\\n    compile_centipede \\\n    compile_honggfuzz \\\n    compile_fuzztests.sh \\\n    compile_go_fuzzer \\\n    compile_javascript_fuzzer \\\n    compile_libfuzzer \\\n    compile_native_go_fuzzer \\\n    compile_native_go_fuzzer_v2 \\\n    go_utils.sh \\\n    compile_python_fuzzer \\\n    debug_afl \\\n    # Go, JavaScript, Java, Python, Rust, and Swift installation scripts.\n    install_go.sh \\\n    install_javascript.sh \\\n    install_java.sh \\\n    install_python.sh \\\n    install_ruby.sh \\\n    install_rust.sh \\\n    install_swift.sh \\\n    make_build_replayable.py \\\n    python_coverage_helper.py \\\n    replay_build.sh \\\n    srcmap \\\n    write_labels.py \\\n    unshallow_repos.py \\\n    /usr/local/bin/\n\n# TODO: Build this as part of a multi-stage build.\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang-jcc /usr/local/bin/\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang++-jcc /usr/local/bin\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang-jcc2 /usr/local/bin/\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang++-jcc2 /usr/local/bin\nRUN chmod +x /usr/local/bin/clang-jcc /usr/local/bin/clang++-jcc /usr/local/bin/clang-jcc2 /usr/local/bin/clang++-jcc2\n\nCOPY llvmsymbol.diff $SRC\nCOPY detect_repo.py /opt/cifuzz/\nCOPY bazel.bazelrc /root/.bazelrc\n\n# Set up ccache binary and cache directory.\n# /ccache/bin will contain the compiler wrappers, and /ccache/cache will\n# contain the actual cache, which can be saved.\n# To use this, set PATH=/ccache/bin:$PATH.\nRUN mkdir -p /ccache/bin && mkdir -p /ccache/cache && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang++ && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang-jcc && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang++-jcc\nENV CCACHE_DIR /ccache/cache\n\n# Don't check that the compiler is the same, so we can switch between jcc and\n# clang under the hood and re-use the same build cache.\nENV CCACHE_COMPILERCHECK none\nENV CCACHE_COMPILERTYPE clang\n\n# Build newer patchelf than the one available from Ubuntu.\nRUN cd /tmp && git clone https://github.com/NixOS/patchelf && \\\n    apt-get update && apt-get install -y autoconf && \\\n    cd patchelf && git checkout 523f401584d9584e76c9c77004e7abeb9e6c4551 && \\\n    unset CFLAGS && export CXXFLAGS='-stdlib=libc++' && export LDFLAGS='-lpthread' && \\\n    ./bootstrap.sh && ./configure && make && \\\n    cp /tmp/patchelf/src/patchelf /usr/local/bin && \\\n    rm -rf /tmp/patchelf && apt-get remove -y autoconf\n\nCOPY indexer /opt/indexer\nCOPY --from=gcr.io/oss-fuzz-base/indexer /indexer/build/indexer /opt/indexer/indexer\nRUN chmod a+x /opt/indexer/indexer /opt/indexer/index_build.py\n\nCMD [\"compile\"]\n"
  },
  {
    "path": "infra/base-images/base-builder/README.md",
    "content": "# base-builder\n> Abstract base image for project builders.\n\nEvery project image supports multiple commands that can be invoked through docker after the image is built:\n\n<pre>\ndocker run --rm -ti gcr.io/oss-fuzz/<b><i>$project</i></b> <i>&lt;command&gt;</i> <i>&lt;arguments...&gt;</i>\n</pre>\n\n# Supported Commands\n\n| Command | Description |\n|---------|-------------|\n| `compile` (default) | build all fuzz targets\n| `/bin/bash` | drop into shell, execute `compile` script to start build.\n\n# Build Configuration\n\nA single build image can build same set of fuzzers in many configurations.\nThe configuration is picked through one or more environment variables.\n\n| Env Variable     | Description\n| -------------    | --------\n| `$SANITIZER (\"address\")` | Specifies predefined sanitizer configuration to use. `address` or `memory` or `undefined`.\n| `$SANITIZER_FLAGS` | Specify compiler sanitizer flags directly. Overrides `$SANITIZER`.\n| `$COVERAGE_FLAGS` | Specify compiler flags to use for fuzzer feedback coverage.\n| `$BUILD_UID` | User id to use while building fuzzers.\n\n## Examples\n\n- *building sqlite3 fuzzer with UBSan (`SANITIZER=undefined`):*\n\n\n<pre>\ndocker run --rm -ti -e <i>SANITIZER</i>=<i>undefined</i> gcr.io/oss-fuzz/sqlite3\n</pre>\n\n\n# Image Files Layout\n\n| Location|Env| Description |\n|---------| -------- | ----------  |\n| `/out/` | `$OUT`         | Directory to store build artifacts (fuzz targets, dictionaries, options files, seed corpus archives). |\n| `/src/` | `$SRC`         | Directory to checkout source files |\n| `/work/`| `$WORK`        | Directory for storing intermediate files |\n| `/usr/lib/libFuzzingEngine.a` | `$LIB_FUZZING_ENGINE` | Location of prebuilt fuzzing engine library (e.g. libFuzzer) that needs to be linked with all fuzz targets.\n\nWhile files layout is fixed within a container, the environment variables are\nprovided to be able to write retargetable scripts.\n\n\n## Compiler Flags\n\nYou *must* use special compiler flags to build your project and fuzz targets.\nThese flags are provided in following environment variables:\n\n| Env Variable    | Description\n| -------------   | --------\n| `$CC`           | The C compiler binary.\n| `$CXX`, `$CCC`  | The C++ compiler binary.\n| `$CFLAGS`       | C compiler flags.\n| `$CXXFLAGS`     | C++ compiler flags.\n\nMost well-crafted build scripts will automatically use these variables. If not,\npass them manually to the build tool.\n\n\n# Child Image Interface\n\n## Sources\n\nChild image has to checkout all sources that it needs to compile fuzz targets into\n`$SRC` directory. When the image is executed, a directory could be mounted on top\nof these with local checkouts using\n`docker run -v $HOME/my_project:/src/my_project ...`.\n\n## Other Required Files\n\nFollowing files have to be added by child images:\n\n| File Location   | Description |\n| -------------   | ----------- |\n| `$SRC/build.sh` | build script to build the project and its fuzz targets |\n"
  },
  {
    "path": "infra/base-images/base-builder/afl_llvm22_patch.diff",
    "content": "diff --git a/GNUmakefile.llvm b/GNUmakefile.llvm\nindex 2cde89d9..7cafd3f5 100644\n--- a/GNUmakefile.llvm\n+++ b/GNUmakefile.llvm\n@@ -32,7 +32,7 @@ VERSION     = $(shell grep '^ *$(HASH)define VERSION ' ./config.h | cut -d '\"' -\n \n SYS = $(shell uname -s)\n \n-override LLVM_TOO_NEW_DEFAULT := 21\n+override LLVM_TOO_NEW_DEFAULT := 22\n override LLVM_TOO_OLD_DEFAULT := 14\n \n ifeq \"$(SYS)\" \"OpenBSD\"\n@@ -69,7 +69,7 @@ endif\n \n LLVM_STDCXX                  := gnu++11\n LLVM_LTO                     := 0\n-LLVM_UNSUPPORTED             := $(shell echo \"$(LLVMVER)\" | grep -E -q '^[0-2]\\.|^3\\.[0-7]\\.|^2[2-9]\\.' && echo 1 || echo 0)\n+LLVM_UNSUPPORTED             := $(shell echo \"$(LLVMVER)\" | grep -E -q '^[0-2]\\.|^3\\.[0-7]\\.|^2[3-9]\\.' && echo 1 || echo 0)\n # Uncomment to see the values assigned above\n # $(foreach var,_CLANG_VERSIONS_TO_TEST LLVM_CONFIG LLVMVER LLVM_MAJOR LLVM_MINOR LLVM_TOO_NEW LLVM_TOO_OLD LLVM_TOO_NEW_DEFAULT LLVM_TOO_OLD_DEFAULT LLVM_NEW_API LLVM_NEWER_API LLVM_13_OK LLVM_HAVE_LTO LLVM_BINDIR LLVM_LIBDIR LLVM_STDCXX LLVM_APPLE_XCODE LLVM_LTO LLVM_UNSUPPORTED,$(warning $(var) = $($(var))))\n \n"
  },
  {
    "path": "infra/base-images/base-builder/bazel.bazelrc",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# Pass variables from environment.\nbuild --action_env=FUZZ_INTROSPECTOR\nbuild --action_env=FUZZINTRO_OUTDIR\n"
  },
  {
    "path": "infra/base-images/base-builder/bazel_build_fuzz_tests",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n: \"${BAZEL_FUZZ_TEST_TAG:=fuzz-test}\"\n: \"${BAZEL_FUZZ_TEST_EXCLUDE_TAG:=no-oss-fuzz}\"\n: \"${BAZEL_PACKAGE_SUFFIX:=_oss_fuzz}\"\n: \"${BAZEL_TOOL:=bazel}\"\n: \"${BAZEL_EXTRA_BUILD_FLAGS:=}\"\n\nif [ \"$FUZZING_LANGUAGE\" = \"jvm\" ]; then\n    BAZEL_LANGUAGE=java\nelse\n    BAZEL_LANGUAGE=cc\nfi\n\nif [[ -z \"${BAZEL_FUZZ_TEST_QUERY:-}\" ]]; then\n    BAZEL_FUZZ_TEST_QUERY=\"\n        let all_fuzz_tests = attr(tags, \\\"${BAZEL_FUZZ_TEST_TAG}\\\", \\\"//...\\\") in\n        let lang_fuzz_tests = attr(generator_function, \\\"^${BAZEL_LANGUAGE}_fuzz_test\\$\\\", \\$all_fuzz_tests) in\n        \\$lang_fuzz_tests - attr(tags, \\\"${BAZEL_FUZZ_TEST_EXCLUDE_TAG}\\\", \\$lang_fuzz_tests)\n    \"\nfi\n\necho \"Using Bazel query to find fuzz targets: ${BAZEL_FUZZ_TEST_QUERY}\"\n\ndeclare -r OSS_FUZZ_TESTS=(\n    $(bazel query \"${BAZEL_FUZZ_TEST_QUERY}\" | sed \"s/$/${BAZEL_PACKAGE_SUFFIX}/\")\n)\n\necho \"Found ${#OSS_FUZZ_TESTS[@]} fuzz test packages:\"\nfor oss_fuzz_test in \"${OSS_FUZZ_TESTS[@]}\"; do\n    echo \"  ${oss_fuzz_test}\"\ndone\n\ndeclare -r BAZEL_BUILD_FLAGS=(\n    \"--@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing_oss_fuzz//:oss_fuzz_engine\" \\\n    \"--@rules_fuzzing//fuzzing:java_engine=@rules_fuzzing_oss_fuzz//:oss_fuzz_java_engine\" \\\n    \"--@rules_fuzzing//fuzzing:cc_engine_instrumentation=oss-fuzz\" \\\n    \"--@rules_fuzzing//fuzzing:cc_engine_sanitizer=none\" \\\n    \"--cxxopt=-stdlib=libc++\" \\\n    \"--linkopt=-lc++\" \\\n    \"--verbose_failures\" \\\n    \"--spawn_strategy=standalone\" \\\n    \"--action_env=CC=${CC}\" \"--action_env=CXX=${CXX}\" \\\n    ${BAZEL_EXTRA_BUILD_FLAGS[*]}\n)\n\necho \"Building the fuzz tests with the following Bazel options:\"\necho \"  ${BAZEL_BUILD_FLAGS[@]}\"\n\n${BAZEL_TOOL} build \"${BAZEL_BUILD_FLAGS[@]}\" \"${OSS_FUZZ_TESTS[@]}\"\n\necho \"Extracting the fuzz test packages in the output directory.\"\nfor oss_fuzz_archive in $(find bazel-bin/ -name \"*${BAZEL_PACKAGE_SUFFIX}.tar\"); do\n    tar --no-same-owner -xvf \"${oss_fuzz_archive}\" -C \"${OUT}\"\ndone\n\nif [ \"$SANITIZER\" = \"coverage\" ]; then\n    echo \"Collecting the repository source files for coverage tracking.\"\n    declare -r COVERAGE_SOURCES=\"${OUT}/proc/self/cwd\"\n    mkdir -p \"${COVERAGE_SOURCES}\"\n    declare -r RSYNC_FILTER_ARGS=(\n        \"--include\" \"*.h\"\n        \"--include\" \"*.cc\"\n        \"--include\" \"*.hpp\"\n        \"--include\" \"*.cpp\"\n        \"--include\" \"*.c\"\n        \"--include\" \"*.inc\"\n        \"--include\" \"*/\"\n        \"--exclude\" \"*\"\n    )\n    rsync -avLk \"${RSYNC_FILTER_ARGS[@]}\" \\\n        \"$(bazel info execution_root)/\" \\\n        \"${COVERAGE_SOURCES}/\"\nfi\n"
  },
  {
    "path": "infra/base-images/base-builder/bisect_clang.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Use git bisect to find the Clang/LLVM commit causing a regression.\"\"\"\n\nimport logging\nimport os\nimport re\nimport shutil\nimport subprocess\nimport sys\n\n\ndef execute(command, *args, expect_zero=True, **kwargs):\n  \"\"\"Execute |command| and return the returncode, stdout and stderr.\"\"\"\n  kwargs['stdout'] = subprocess.PIPE\n  kwargs['stderr'] = subprocess.PIPE\n  logging.debug('Running command: \"%s\"', str(command))\n  process = subprocess.Popen(command, *args, **kwargs)\n  stdout, stderr = process.communicate()\n  stdout = stdout.decode('utf-8')\n  stderr = stderr.decode('utf-8')\n  retcode = process.returncode\n  logging.info('Command: \"%s\" returned: %d.\\nStdout: %s.\\nStderr: %s',\n               str(command), retcode, stdout, stderr)\n  if expect_zero and retcode != 0:\n    raise subprocess.CalledProcessError(retcode, command)\n  return retcode, stdout, stderr\n\n\ndef search_bisect_output(output):\n  \"\"\"Search |output| for a message indicating the culprit commit has been\n  found.\"\"\"\n  # TODO(metzman): Is it necessary to look for \"good\"?\n  culprit_regex = re.compile('([a-z0-9]{40}) is the first (good|bad) commit')\n  match = re.match(culprit_regex, output)\n  return match.group(1) if match is not None else None\n\n\nclass GitRepo:\n  \"\"\"Class for executing commmands on a git repo.\"\"\"\n\n  def __init__(self, repo_dir):\n    self.repo_dir = repo_dir\n\n  def do_command(self, git_subcommand):\n    \"\"\"Execute a |git_subcommand| (a list of strings).\"\"\"\n    command = ['git', '-C', self.repo_dir] + git_subcommand\n    return execute(command)\n\n  def test_commit(self, test_command):\n    \"\"\"Build LLVM at the currently checkedout commit, then run |test_command|.\n    If returncode is 0 run 'git bisect good' otherwise return 'git bisect bad'.\n    Return None if bisect didn't finish yet. Return the culprit commit if it\n    does.\"\"\"\n    build_clang(self.repo_dir)\n    retcode, _, _ = execute(test_command, shell=True, expect_zero=False)\n    if retcode == 0:\n      retcode, stdout, _ = self.do_bisect_command('good')\n    else:\n      retcode, stdout, _ = self.do_bisect_command('bad')\n    return search_bisect_output(stdout)\n\n  def bisect(self, good_commit, bad_commit, test_command):\n    \"\"\"Do git bisect assuming |good_commit| is good, |bad_commit| is bad and\n    |test_command| is an oracle. Return the culprit commit.\"\"\"\n    self.bisect_start(good_commit, bad_commit, test_command)\n    result = self.test_commit(test_command)\n    while result is None:\n      result = self.test_commit(test_command)\n    return result\n\n  def bisect_start(self, good_commit, bad_commit, test_command):\n    \"\"\"Start doing git bisect.\"\"\"\n    self.do_bisect_command('start')\n    # Do bad commit first since it is more likely to be recent.\n    self.test_start_commit(bad_commit, 'bad', test_command)\n    self.test_start_commit(good_commit, 'good', test_command)\n\n  def do_bisect_command(self, subcommand):\n    \"\"\"Execute a git bisect |subcommand| (string) and return the result.\"\"\"\n    return self.do_command(['bisect', subcommand])\n\n  def test_start_commit(self, commit, label, test_command):\n    \"\"\"Use |test_command| to test the first good or bad |commit| (depending on\n    |label|).\"\"\"\n    assert label in ('good', 'bad'), label\n    self.do_command(['checkout', commit])\n    build_clang(self.repo_dir)\n    retcode, _, _ = execute(test_command, shell=True, expect_zero=False)\n    if label == 'good' and retcode != 0:\n      raise BisectError('Test command \"%s\" returns %d on first good commit %s' %\n                        (test_command, retcode, commit))\n    if label == 'bad' and retcode == 0:\n      raise BisectError('Test command \"%s\" returns %d on first bad commit %s' %\n                        (test_command, retcode, commit))\n\n    self.do_bisect_command(label)\n\n\nclass BisectError(Exception):\n  \"\"\"Error that was encountered during bisection.\"\"\"\n\n\ndef get_clang_build_env():\n  \"\"\"Get an environment for building Clang.\"\"\"\n  env = os.environ.copy()\n  for variable in ['CXXFLAGS', 'CFLAGS']:\n    if variable in env:\n      del env[variable]\n  return env\n\n\ndef install_clang_build_deps():\n  \"\"\"Instal dependencies necessary to build clang.\"\"\"\n  execute([\n      'apt-get', 'install', '-y', 'build-essential', 'make', 'cmake',\n      'ninja-build', 'git', 'subversion', 'g++-multilib'\n  ])\n\n\ndef clone_with_retries(repo, local_path, num_retries=10):\n  \"\"\"Clone |repo| to |local_path| if it doesn't exist already. Try up to\n  |num_retries| times. Return False if unable to checkout.\"\"\"\n  if os.path.isdir(local_path):\n    return\n  for _ in range(num_retries):\n    if os.path.isdir(local_path):\n      shutil.rmtree(local_path)\n    retcode, _, _ = execute(['git', 'clone', repo, local_path],\n                            expect_zero=False)\n    if retcode == 0:\n      return\n  raise Exception('Could not checkout %s.' % repo)\n\n\ndef get_clang_target_arch():\n  \"\"\"Get target architecture we want clang to target when we build it.\"\"\"\n  _, arch, _ = execute(['uname', '-m'])\n  if 'x86_64' in arch:\n    return 'X86'\n  if 'aarch64' in arch:\n    return 'AArch64'\n  raise Exception('Unsupported target: %s.' % arch)\n\n\ndef prepare_build(llvm_project_path):\n  \"\"\"Prepare to build clang.\"\"\"\n  llvm_build_dir = os.path.join(os.getenv('WORK'), 'llvm-build')\n  if not os.path.exists(llvm_build_dir):\n    os.mkdir(llvm_build_dir)\n  execute([\n      'cmake', '-G', 'Ninja', '-DLIBCXX_ENABLE_SHARED=OFF',\n      '-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON', '-DLIBCXXABI_ENABLE_SHARED=OFF',\n      '-DCMAKE_BUILD_TYPE=Release',\n      '-DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi;compiler-rt;clang',\n      '-DLLVM_TARGETS_TO_BUILD=' + get_clang_target_arch(),\n      os.path.join(llvm_project_path, 'llvm')\n  ],\n          env=get_clang_build_env(),\n          cwd=llvm_build_dir)\n  return llvm_build_dir\n\n\ndef build_clang(llvm_project_path):\n  \"\"\"Checkout, build and install Clang.\"\"\"\n  # TODO(metzman): Merge Python checkout and build code with\n  # checkout_build_install_llvm.sh.\n  # TODO(metzman): Look into speeding this process using ccache.\n  # TODO(metzman): Make this program capable of handling MSAN and i386 Clang\n  # regressions.\n  llvm_build_dir = prepare_build(llvm_project_path)\n  execute(['ninja', '-C', llvm_build_dir, 'install'], env=get_clang_build_env())\n\n\ndef find_culprit_commit(test_command, good_commit, bad_commit):\n  \"\"\"Returns the culprit LLVM commit that introduced a bug revealed by running\n  |test_command|. Uses git bisect and treats |good_commit| as the first latest\n   known good commit and |bad_commit| as the first known bad commit.\"\"\"\n  llvm_project_path = os.path.join(os.getenv('SRC'), 'llvm-project')\n  clone_with_retries('https://github.com/llvm/llvm-project.git',\n                     llvm_project_path)\n  git_repo = GitRepo(llvm_project_path)\n  result = git_repo.bisect(good_commit, bad_commit, test_command)\n  print('Culprit commit', result)\n  return result\n\n\ndef main():\n  # pylint: disable=line-too-long\n  \"\"\"Finds the culprit LLVM commit that introduced a clang regression.\n  Can be tested using this command in a libsodium shell:\n  python3 bisect_clang.py \"cd /src/libsodium; make clean; cd -; compile && /out/secret_key_auth_fuzzer -runs=100\" \\\n                          f7e52fbdb5a7af8ea0808e98458b497125a5eca1 \\\n                          8288453f6aac05080b751b680455349e09d49825\n  \"\"\"\n  # pylint: enable=line-too-long\n  # TODO(metzman): Check CFLAGS for things like -fsanitize=fuzzer-no-link.\n  # TODO(metzman): Allow test_command to be optional and for just build.sh to be\n  # used instead.\n  test_command = sys.argv[1]\n  # TODO(metzman): Add in more automation so that the script can automatically\n  # determine the commits used in last Clang roll.\n  good_commit = sys.argv[2]\n  bad_commit = sys.argv[3]\n  # TODO(metzman): Make verbosity configurable.\n  logging.getLogger().setLevel(logging.DEBUG)\n  install_clang_build_deps()\n  find_culprit_commit(test_command, good_commit, bad_commit)\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/base-images/base-builder/bisect_clang_test.py",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests for bisect_clang.py\"\"\"\nimport os\nfrom unittest import mock\nimport unittest\n\nimport bisect_clang\n\nFILE_DIRECTORY = os.path.dirname(__file__)\nLLVM_REPO_PATH = '/llvm-project'\n\n\ndef get_git_command(*args):\n  \"\"\"Returns a git command for the LLVM repo with |args| as arguments.\"\"\"\n  return ['git', '-C', LLVM_REPO_PATH] + list(args)\n\n\ndef patch_environ(testcase_obj):\n  \"\"\"Patch environment.\"\"\"\n  env = {}\n  patcher = mock.patch.dict(os.environ, env)\n  testcase_obj.addCleanup(patcher.stop)\n  patcher.start()\n\n\nclass BisectClangTestMixin:  # pylint: disable=too-few-public-methods\n  \"\"\"Useful mixin for bisect_clang unittests.\"\"\"\n\n  def setUp(self):  # pylint: disable=invalid-name\n    \"\"\"Initialization method for unittests.\"\"\"\n    patch_environ(self)\n    os.environ['SRC'] = '/src'\n    os.environ['WORK'] = '/work'\n\n\nclass GetClangBuildEnvTest(BisectClangTestMixin, unittest.TestCase):\n  \"\"\"Tests for get_clang_build_env.\"\"\"\n\n  def test_cflags(self):\n    \"\"\"Test that CFLAGS are not used compiling clang.\"\"\"\n    os.environ['CFLAGS'] = 'blah'\n    self.assertNotIn('CFLAGS', bisect_clang.get_clang_build_env())\n\n  def test_cxxflags(self):\n    \"\"\"Test that CXXFLAGS are not used compiling clang.\"\"\"\n    os.environ['CXXFLAGS'] = 'blah'\n    self.assertNotIn('CXXFLAGS', bisect_clang.get_clang_build_env())\n\n  def test_other_variables(self):\n    \"\"\"Test that other env vars are used when compiling clang.\"\"\"\n    key = 'other'\n    value = 'blah'\n    os.environ[key] = value\n    self.assertEqual(value, bisect_clang.get_clang_build_env()[key])\n\n\ndef read_test_data(filename):\n  \"\"\"Returns data from |filename| in the test_data directory.\"\"\"\n  with open(os.path.join(FILE_DIRECTORY, 'test_data', filename)) as file_handle:\n    return file_handle.read()\n\n\nclass SearchBisectOutputTest(BisectClangTestMixin, unittest.TestCase):\n  \"\"\"Tests for search_bisect_output.\"\"\"\n\n  def test_search_bisect_output(self):\n    \"\"\"Test that search_bisect_output finds the responsible commit when one\n    exists.\"\"\"\n    test_data = read_test_data('culprit-commit.txt')\n    self.assertEqual('ac9ee01fcbfac745aaedca0393a8e1c8a33acd8d',\n                     bisect_clang.search_bisect_output(test_data))\n\n  def test_search_bisect_output_none(self):\n    \"\"\"Test that search_bisect_output doesnt find a non-existent culprit\n    commit.\"\"\"\n    self.assertIsNone(bisect_clang.search_bisect_output('hello'))\n\n\ndef create_mock_popen(\n    output=bytes('', 'utf-8'), err=bytes('', 'utf-8'), returncode=0):\n  \"\"\"Creates a mock subprocess.Popen.\"\"\"\n\n  class MockPopen:\n    \"\"\"Mock subprocess.Popen.\"\"\"\n    commands = []\n    testcases_written = []\n\n    def __init__(self, command, *args, **kwargs):  # pylint: disable=unused-argument\n      \"\"\"Inits the MockPopen.\"\"\"\n      stdout = kwargs.pop('stdout', None)\n      self.command = command\n      self.commands.append(command)\n      self.stdout = None\n      self.stderr = None\n      self.returncode = returncode\n      if hasattr(stdout, 'write'):\n        self.stdout = stdout\n\n    def communicate(self, input_data=None):  # pylint: disable=unused-argument\n      \"\"\"Mock subprocess.Popen.communicate.\"\"\"\n      if self.stdout:\n        self.stdout.write(output)\n\n      if self.stderr:\n        self.stderr.write(err)\n\n      return output, err\n\n    def poll(self, input_data=None):  # pylint: disable=unused-argument\n      \"\"\"Mock subprocess.Popen.poll.\"\"\"\n      return self.returncode\n\n  return MockPopen\n\n\ndef mock_prepare_build_impl(llvm_project_path):  # pylint: disable=unused-argument\n  \"\"\"Mocked prepare_build function.\"\"\"\n  return '/work/llvm-build'\n\n\nclass BuildClangTest(BisectClangTestMixin, unittest.TestCase):\n  \"\"\"Tests for build_clang.\"\"\"\n\n  def test_build_clang_test(self):\n    \"\"\"Tests that build_clang works as intended.\"\"\"\n    with mock.patch('subprocess.Popen', create_mock_popen()) as mock_popen:\n      with mock.patch('bisect_clang.prepare_build', mock_prepare_build_impl):\n        llvm_src_dir = '/src/llvm-project'\n        bisect_clang.build_clang(llvm_src_dir)\n        self.assertEqual([['ninja', '-C', '/work/llvm-build', 'install']],\n                         mock_popen.commands)\n\n\nclass GitRepoTest(BisectClangTestMixin, unittest.TestCase):\n  \"\"\"Tests for GitRepo.\"\"\"\n\n  # TODO(metzman): Mock filesystem. Until then, use a real directory.\n\n  def setUp(self):\n    super().setUp()\n    self.git = bisect_clang.GitRepo(LLVM_REPO_PATH)\n    self.good_commit = 'good_commit'\n    self.bad_commit = 'bad_commit'\n    self.test_command = 'testcommand'\n\n  def test_do_command(self):\n    \"\"\"Test do_command creates a new process as intended.\"\"\"\n    # TODO(metzman): Test directory changing behavior.\n    command = ['subcommand', '--option']\n    with mock.patch('subprocess.Popen', create_mock_popen()) as mock_popen:\n      self.git.do_command(command)\n      self.assertEqual([get_git_command('subcommand', '--option')],\n                       mock_popen.commands)\n\n  def _test_test_start_commit_unexpected(self, label, commit, returncode):\n    \"\"\"Tests test_start_commit works as intended when the test returns an\n    unexpected value.\"\"\"\n\n    def mock_execute_impl(command, *args, **kwargs):  # pylint: disable=unused-argument\n      if command == self.test_command:\n        return returncode, '', ''\n      return 0, '', ''\n\n    with mock.patch('bisect_clang.execute', mock_execute_impl):\n      with mock.patch('bisect_clang.prepare_build', mock_prepare_build_impl):\n        with self.assertRaises(bisect_clang.BisectError):\n          self.git.test_start_commit(commit, label, self.test_command)\n\n  def test_test_start_commit_bad_zero(self):\n    \"\"\"Tests test_start_commit works as intended when the test on the first bad\n    commit returns 0.\"\"\"\n    self._test_test_start_commit_unexpected('bad', self.bad_commit, 0)\n\n  def test_test_start_commit_good_nonzero(self):\n    \"\"\"Tests test_start_commit works as intended when the test on the first good\n    commit returns nonzero.\"\"\"\n    self._test_test_start_commit_unexpected('good', self.good_commit, 1)\n\n  def test_test_start_commit_good_zero(self):\n    \"\"\"Tests test_start_commit works as intended when the test on the first good\n    commit returns 0.\"\"\"\n    self._test_test_start_commit_expected('good', self.good_commit, 0)  # pylint: disable=no-value-for-parameter\n\n  @mock.patch('bisect_clang.build_clang')\n  def _test_test_start_commit_expected(self, label, commit, returncode,\n                                       mock_build_clang):\n    \"\"\"Tests test_start_commit works as intended when the test returns an\n    expected value.\"\"\"\n    command_args = []\n\n    def mock_execute_impl(command, *args, **kwargs):  # pylint: disable=unused-argument\n      command_args.append(command)\n      if command == self.test_command:\n        return returncode, '', ''\n      return 0, '', ''\n\n    with mock.patch('bisect_clang.execute', mock_execute_impl):\n      self.git.test_start_commit(commit, label, self.test_command)\n      self.assertEqual([\n          get_git_command('checkout', commit), self.test_command,\n          get_git_command('bisect', label)\n      ], command_args)\n      mock_build_clang.assert_called_once_with(LLVM_REPO_PATH)\n\n  def test_test_start_commit_bad_nonzero(self):\n    \"\"\"Tests test_start_commit works as intended when the test on the first bad\n    commit returns nonzero.\"\"\"\n    self._test_test_start_commit_expected('bad', self.bad_commit, 1)  # pylint: disable=no-value-for-parameter\n\n  @mock.patch('bisect_clang.GitRepo.test_start_commit')\n  def test_bisect_start(self, mock_test_start_commit):\n    \"\"\"Tests bisect_start works as intended.\"\"\"\n    with mock.patch('subprocess.Popen', create_mock_popen()) as mock_popen:\n      self.git.bisect_start(self.good_commit, self.bad_commit,\n                            self.test_command)\n      self.assertEqual(get_git_command('bisect', 'start'),\n                       mock_popen.commands[0])\n      mock_test_start_commit.assert_has_calls([\n          mock.call('bad_commit', 'bad', 'testcommand'),\n          mock.call('good_commit', 'good', 'testcommand')\n      ])\n\n  def test_do_bisect_command(self):\n    \"\"\"Test do_bisect_command executes a git bisect subcommand as intended.\"\"\"\n    subcommand = 'subcommand'\n    with mock.patch('subprocess.Popen', create_mock_popen()) as mock_popen:\n      self.git.do_bisect_command(subcommand)\n      self.assertEqual([get_git_command('bisect', subcommand)],\n                       mock_popen.commands)\n\n  @mock.patch('bisect_clang.build_clang')\n  def _test_test_commit(self, label, output, returncode, mock_build_clang):\n    \"\"\"Test test_commit works as intended.\"\"\"\n    command_args = []\n\n    def mock_execute_impl(command, *args, **kwargs):  # pylint: disable=unused-argument\n      command_args.append(command)\n      if command == self.test_command:\n        return returncode, output, ''\n      return 0, output, ''\n\n    with mock.patch('bisect_clang.execute', mock_execute_impl):\n      result = self.git.test_commit(self.test_command)\n      self.assertEqual([self.test_command,\n                        get_git_command('bisect', label)], command_args)\n    mock_build_clang.assert_called_once_with(LLVM_REPO_PATH)\n    return result\n\n  def test_test_commit_good(self):\n    \"\"\"Test test_commit labels a good commit as good.\"\"\"\n    self.assertIsNone(self._test_test_commit('good', '', 0))  # pylint: disable=no-value-for-parameter\n\n  def test_test_commit_bad(self):\n    \"\"\"Test test_commit labels a bad commit as bad.\"\"\"\n    self.assertIsNone(self._test_test_commit('bad', '', 1))  # pylint: disable=no-value-for-parameter\n\n  def test_test_commit_culprit(self):\n    \"\"\"Test test_commit returns the culprit\"\"\"\n    test_data = read_test_data('culprit-commit.txt')\n    self.assertEqual('ac9ee01fcbfac745aaedca0393a8e1c8a33acd8d',\n                     self._test_test_commit('good', test_data, 0))  # pylint: disable=no-value-for-parameter\n\n\nclass GetTargetArchToBuildTest(unittest.TestCase):\n  \"\"\"Tests for get_target_arch_to_build.\"\"\"\n\n  def test_unrecognized(self):\n    \"\"\"Test that an unrecognized architecture raises an exception.\"\"\"\n    with mock.patch('bisect_clang.execute') as mock_execute:\n      mock_execute.return_value = (None, 'mips', None)\n      with self.assertRaises(Exception):\n        bisect_clang.get_clang_target_arch()\n\n  def test_recognized(self):\n    \"\"\"Test that a recognized architecture returns the expected value.\"\"\"\n    arch_pairs = {'x86_64': 'X86', 'aarch64': 'AArch64'}\n    for uname_result, clang_target in arch_pairs.items():\n      with mock.patch('bisect_clang.execute') as mock_execute:\n        mock_execute.return_value = (None, uname_result, None)\n        self.assertEqual(clang_target, bisect_clang.get_clang_target_arch())\n"
  },
  {
    "path": "infra/base-images/base-builder/cargo",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# This is a wrapper around calling cargo\n# This just expands RUSTFLAGS in case of a coverage build\n# We need this until https://github.com/rust-lang/cargo/issues/5450 is merged\n# because cargo uses relative paths for the current crate\n# and absolute paths for its dependencies\n#\n################################################################################\n\nif [ \"$SANITIZER\" = \"coverage\" ] && [ $1 = \"build\" ]\nthen\n    crate_src_abspath=`cargo metadata --no-deps --format-version 1 | jq -r '.workspace_root'`\n    export RUSTFLAGS=\"$RUSTFLAGS --remap-path-prefix src=$crate_src_abspath/src\"\nfi\n\nif [ \"$SANITIZER\" = \"coverage\" ] && [ $1 = \"fuzz\" ] && [ $2 = \"build\" ]\nthen\n    # hack to turn cargo fuzz build into cargo build so as to get coverage\n    # cargo fuzz adds \"--target\" \"x86_64-unknown-linux-gnu\"\n    (\n    # go into fuzz directory if not already the case\n    cd fuzz || true\n    fuzz_src_abspath=`pwd`\n    # Default directory is fuzz_targets, but some projects like image-rs use fuzzers.\n    while read i; do\n        export RUSTFLAGS=\"$RUSTFLAGS --remap-path-prefix $i=$fuzz_src_abspath/$i\"\n        # Bash while syntax so that we modify RUSTFLAGS in main shell instead of a subshell.\n    done <<< \"$(find . -name \"*.rs\" | cut -d/ -f2 | uniq)\"\n    # we do not want to trigger debug assertions and stops\n    export RUSTFLAGS=\"$RUSTFLAGS -C debug-assertions=no\"\n    # do not optimize with --release, leading to Malformed instrumentation profile data\n    cargo build --bins\n    # copies the build output in the expected target directory\n    cd `cargo metadata --format-version 1 --no-deps | jq -r '.target_directory'`\n    mkdir -p x86_64-unknown-linux-gnu/release\n    cp -r debug/* x86_64-unknown-linux-gnu/release/\n    )\n    exit 0\nfi\n\n/rust/bin/cargo \"$@\"\n"
  },
  {
    "path": "infra/base-images/base-builder/compile",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"---------------------------------------------------------------\"\n\nsysctl -w vm.mmap_rnd_bits=28\n\nOSS_FUZZ_ON_DEMAND=\"${OSS_FUZZ_ON_DEMAND:-0}\"\n\n# Used for Rust introspector builds\nRUST_SANITIZER=$SANITIZER\n\nif [ \"$FUZZING_LANGUAGE\" = \"jvm\" ]; then\n  if [ \"$SANITIZER\" != \"address\" ] && [ \"$SANITIZER\" != \"coverage\" ] && [ \"$SANITIZER\" != \"undefined\" ] && [ \"$SANITIZER\" != \"none\" ] && [ \"$SANITIZER\" != \"introspector\" ]; then\n    echo \"ERROR: JVM projects can be fuzzed with AddressSanitizer or UndefinedBehaviorSanitizer or Introspector only.\"\n    exit 1\n  fi\n  if [ \"$ARCHITECTURE\" != \"x86_64\" ]; then\n    echo \"ERROR: JVM projects can be fuzzed on x86_64 architecture only.\"\n    exit 1\n  fi\nfi\n\nif [ \"$FUZZING_LANGUAGE\" = \"rust\" ]; then\n  if [ \"$SANITIZER\" = \"introspector\" ]; then\n    # introspector sanitizer flag will cause cargo build to fail. Rremove it\n    # temporarily, RUST_SANITIZER will hold the original sanitizer.\n    export SANITIZER=address\n  fi\nfi\n\n\nif [ \"$FUZZING_LANGUAGE\" = \"javascript\" ]; then\n  if [ \"$FUZZING_ENGINE\" != \"libfuzzer\" ]; then\n    echo \"ERROR: JavaScript projects can be fuzzed with libFuzzer engine only.\"\n    exit 1\n  fi\n  if [ \"$SANITIZER\" != \"coverage\" ] && [ \"$SANITIZER\" != \"none\" ]; then\n    echo \"ERROR: JavaScript projects cannot be fuzzed with sanitizers.\"\n    exit 1\n  fi\n  if [ \"$ARCHITECTURE\" != \"x86_64\" ]; then\n    echo \"ERROR: JavaScript projects can be fuzzed on x86_64 architecture only.\"\n    exit 1\n  fi\nfi\n\nif [ \"$FUZZING_LANGUAGE\" = \"python\" ]; then\n  if [ \"$FUZZING_ENGINE\" != \"libfuzzer\" ]; then\n    echo \"ERROR: Python projects can be fuzzed with libFuzzer engine only.\"\n    exit 1\n  fi\n  if [ \"$SANITIZER\" != \"address\" ] && [ \"$SANITIZER\" != \"undefined\" ] && [ \"$SANITIZER\" != \"coverage\" ] && [ \"$SANITIZER\" != \"introspector\" ]; then\n    echo \"ERROR: Python projects can be fuzzed with AddressSanitizer or UndefinedBehaviorSanitizer or Coverage or Fuzz Introspector only.\"\n    exit 1\n  fi\n  if [ \"$ARCHITECTURE\" != \"x86_64\" ]; then\n    echo \"ERROR: Python projects can be fuzzed on x86_64 architecture only.\"\n    exit 1\n  fi\nfi\n\nif [ -z \"${SANITIZER_FLAGS-}\" ]; then\n  FLAGS_VAR=\"SANITIZER_FLAGS_${SANITIZER}\"\n  export SANITIZER_FLAGS=${!FLAGS_VAR-}\nfi\n\nif [[ $ARCHITECTURE == \"i386\" ]]; then\n    export CFLAGS=\"-m32 $CFLAGS\"\n    cp -R /usr/i386/lib/* /usr/local/lib\n    cp -R /usr/i386/include/* /usr/local/include\nfi\n\n# Don't use a fuzzing engine with Jazzer which has libFuzzer built-in or with\n# FuzzBench which will provide the fuzzing engine.\nif [[ $FUZZING_ENGINE != \"none\" ]] && [[ $FUZZING_LANGUAGE != \"jvm\" ]] && [[ \"${OSS_FUZZ_ON_DEMAND}\" == \"0\" ]] ; then\n  # compile script might override environment, use . to call it.\n  . compile_${FUZZING_ENGINE}\nfi\n\nif [[ $SANITIZER_FLAGS = *sanitize=memory* ]]\nthen\n  # Take all libraries from lib/msan\n  # export CXXFLAGS_EXTRA=\"-L/usr/msan/lib $CXXFLAGS_EXTRA\"\n  cp -R /usr/msan/lib/* /usr/local/lib/x86_64-unknown-linux-gnu/\n  cp -R /usr/msan/include/* /usr/local/include\n\n  echo 'Building without MSan instrumented libraries.'\nfi\n\n# Coverage flag overrides.\nCOVERAGE_FLAGS_VAR=\"COVERAGE_FLAGS_${SANITIZER}\"\nif [[ -n ${!COVERAGE_FLAGS_VAR+x} ]]\nthen\n  export COVERAGE_FLAGS=\"${!COVERAGE_FLAGS_VAR}\"\nfi\n\n# Only need the default coverage instrumentation for libFuzzer or honggfuzz.\n# Other engines bring their own.\nif [ $FUZZING_ENGINE = \"none\" ] || [ $FUZZING_ENGINE = \"afl\" ] || [ $FUZZING_ENGINE = \"centipede\" ] || [ \"${OSS_FUZZ_ON_DEMAND}\" != \"0\" ]; then\n  export COVERAGE_FLAGS=\nfi\n\n# Rust does not support sanitizers and coverage flags via CFLAGS/CXXFLAGS, so\n# use RUSTFLAGS.\n# FIXME: Support code coverage once support is in.\n# See https://github.com/rust-lang/rust/issues/34701.\nif [ \"$RUST_SANITIZER\" == \"introspector\" ]; then\n  export RUSTFLAGS=\"-Cdebuginfo=2 -Cforce-frame-pointers\"\nelif [ \"$SANITIZER\" != \"undefined\" ] && [ \"$SANITIZER\" != \"coverage\" ] && [ \"$SANITIZER\" != \"none\" ] && [ \"$ARCHITECTURE\" != 'i386' ]; then\n  export RUSTFLAGS=\"--cfg fuzzing -Zsanitizer=${SANITIZER} -Cdebuginfo=1 -Cforce-frame-pointers\"\nelse\n  export RUSTFLAGS=\"--cfg fuzzing -Cdebuginfo=1 -Cforce-frame-pointers\"\nfi\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n    # link to C++ from comment in f5098035eb1a14aa966c8651d88ea3d64323823d\n    export RUSTFLAGS=\"$RUSTFLAGS -Cinstrument-coverage -C link-arg=-lc++\"\nfi\n\n# Add Rust libfuzzer flags.\n# See https://github.com/rust-fuzz/libfuzzer/blob/master/build.rs#L12.\nexport CUSTOM_LIBFUZZER_PATH=\"$LIB_FUZZING_ENGINE_DEPRECATED\"\nexport CUSTOM_LIBFUZZER_STD_CXX=c++\n\nexport CFLAGS=\"$CFLAGS $SANITIZER_FLAGS $COVERAGE_FLAGS\"\nexport CXXFLAGS=\"$CFLAGS $CXXFLAGS_EXTRA\"\n\nif [ \"$SANITIZER\" = \"undefined\" ]; then\n  # Disable \"function\" sanitizer for C code for now, because many projects,\n  # possibly via legacy C code are affected.\n  # The projects should be fixed and this workaround be removed in the future.\n  # TODO(#11778):\n  # https://github.com/google/oss-fuzz/issues/11778\n  export CFLAGS=\"$CFLAGS -fno-sanitize=function\"\nfi\n\nif [ \"$FUZZING_LANGUAGE\" = \"go\" ]; then\n  # required by Go 1.20\n  export CXX=\"${CXX} -lresolv\"\nfi\n\nif [ \"$FUZZING_LANGUAGE\" = \"python\" ]; then\n  sanitizer_with_fuzzer_lib_dir=`python3 -c \"import atheris; import os; print(atheris.path())\"`\n  sanitizer_with_fuzzer_output_lib=$OUT/sanitizer_with_fuzzer.so\n  if [ \"$SANITIZER\" = \"address\" ]; then\n    cp $sanitizer_with_fuzzer_lib_dir/asan_with_fuzzer.so $sanitizer_with_fuzzer_output_lib\n  elif [ \"$SANITIZER\" = \"undefined\" ]; then\n    cp $sanitizer_with_fuzzer_lib_dir/ubsan_with_fuzzer.so $sanitizer_with_fuzzer_output_lib\n  fi\n\n  # Disable leak checking as it is unsupported.\n  export CFLAGS=\"$CFLAGS -fno-sanitize=function,leak,vptr,\"\n  export CXXFLAGS=\"$CXXFLAGS -fno-sanitize=function,leak,vptr\"\nfi\n\n# Copy latest llvm-symbolizer in $OUT for stack symbolization.\ncp $(which llvm-symbolizer) $OUT/\n\n# Copy Jazzer to $OUT if needed.\nif [ \"$FUZZING_LANGUAGE\" = \"jvm\" ]; then\n  cp $(which jazzer_agent_deploy.jar) $(which jazzer_driver) $(which jazzer_junit.jar) $OUT/\n  jazzer_driver_with_sanitizer=$OUT/jazzer_driver_with_sanitizer\n  if [ \"$SANITIZER\" = \"address\" ]; then\n    cat > $jazzer_driver_with_sanitizer << 'EOF'\n#!/bin/bash\nthis_dir=$(dirname \"$0\")\n\"$this_dir/jazzer_driver\" --asan \"$@\"\nEOF\n  elif [ \"$SANITIZER\" = \"undefined\" ]; then\n    cat > $jazzer_driver_with_sanitizer << 'EOF'\n#!/bin/bash\nthis_dir=$(dirname \"$0\")\n\"$this_dir/jazzer_driver\" --ubsan \"$@\"\nEOF\n  elif [ \"$SANITIZER\" = \"coverage\" ] ||  [ \"$SANITIZER\" = \"introspector\" ]; then\n    # Coverage & introspector builds require no instrumentation.\n    cp $(which jazzer_driver) $jazzer_driver_with_sanitizer\n  fi\n  chmod +x $jazzer_driver_with_sanitizer\n\n  # Disable leak checking since the JVM triggers too many false positives.\n  export CFLAGS=\"$CFLAGS -fno-sanitize=leak\"\n  export CXXFLAGS=\"$CXXFLAGS -fno-sanitize=leak\"\nfi\n\nif [ \"$SANITIZER\" = \"introspector\" ] || [ \"$RUST_SANITIZER\" = \"introspector\" ]; then\n  export AR=llvm-ar\n  export NM=llvm-nm\n  export RANLIB=llvm-ranlib\n\n  export CFLAGS=\"$CFLAGS -g\"\n  export CXXFLAGS=\"$CXXFLAGS -g\"\n  export FI_BRANCH_PROFILE=1\n  export FUZZ_INTROSPECTOR=1\n  export FUZZ_INTROSPECTOR_AUTO_FUZZ=1\n\n  # Move ar and ranlib\n  mv /usr/bin/ar /usr/bin/old-ar\n  mv /usr/bin/nm /usr/bin/old-nm\n  mv /usr/bin/ranlib /usr/bin/old-ranlib\n\n  ln -sf /usr/local/bin/llvm-ar /usr/bin/ar\n  ln -sf /usr/local/bin/llvm-nm /usr/bin/nm\n  ln -sf /usr/local/bin/llvm-ranlib /usr/bin/ranlib\n\n  apt-get install -y libjpeg-dev zlib1g-dev libyaml-dev\n  python3 -m pip install --upgrade pip setuptools\n  python3 -m pip install cxxfilt pyyaml beautifulsoup4 lxml soupsieve rust-demangler\n  python3 -m pip install --prefer-binary matplotlib\n\n  # Install Fuzz-Introspector\n  pushd /fuzz-introspector/src\n  python3 -m pip install -e .\n  popd\n\n  if [ \"$FUZZING_LANGUAGE\" = \"python\" ]; then\n    python3 /fuzz-introspector/src/main.py light --language=python\n    cp -rf $SRC/inspector/ /tmp/inspector-saved\n  elif [ \"$FUZZING_LANGUAGE\" = \"jvm\" ]; then\n    python3 /fuzz-introspector/src/main.py light --language=jvm\n    cp -rf $SRC/inspector/ /tmp/inspector-saved\n  elif [ \"$FUZZING_LANGUAGE\" = \"rust\" ]; then\n    python3 /fuzz-introspector/src/main.py light --language=rust\n    cp -rf $SRC/inspector/ /tmp/inspector-saved\n  else\n    python3 /fuzz-introspector/src/main.py light\n\n    # Make a copy of the light. This is needed because we run two versions of\n    # introspector: one based on pure statis analysis and one based on\n    # regular LTO.\n    cp -rf $SRC/inspector/ /tmp/inspector-saved\n\n\n    # Move coverage report.\n    if [ -d \"$OUT/textcov_reports\" ]\n    then\n      find $OUT/textcov_reports/ -name \"*.covreport\" -exec cp {} $SRC/inspector/ \\;\n      find $OUT/textcov_reports/ -name \"*.json\" -exec cp {} $SRC/inspector/ \\;\n    fi\n\n    # Make fuzz-introspector HTML report using light approach.\n    REPORT_ARGS=\"--name=$PROJECT_NAME\"\n\n    # Only pass coverage_url when COVERAGE_URL is set (in cloud builds)\n    if [[ ! -z \"${COVERAGE_URL+x}\" ]]; then\n      REPORT_ARGS=\"$REPORT_ARGS --coverage-url=${COVERAGE_URL}\"\n    fi\n\n    # Run pure static analysis fuzz introspector\n    fuzz-introspector full --target-dir=$SRC \\\n        --language=${FUZZING_LANGUAGE} \\\n        --out-dir=$SRC/inspector \\\n        ${REPORT_ARGS}\n  fi\n\n  rsync -avu --delete \"$SRC/inspector/\" \"$OUT/inspector\"\nfi\n\necho \"---------------------------------------------------------------\"\necho \"CC=$CC\"\necho \"CXX=$CXX\"\necho \"CFLAGS=$CFLAGS\"\necho \"CXXFLAGS=$CXXFLAGS\"\necho \"RUSTFLAGS=$RUSTFLAGS\"\necho \"---------------------------------------------------------------\"\n\nif [ \"${OSS_FUZZ_ON_DEMAND}\" != \"0\" ]; then\n  fuzzbench_build\n  cp $(which llvm-symbolizer) $OUT/\n  exit 0\nfi\n\n# Prepare the build command to run the project's build script.\nif [[ ! -z \"${REPLAY_ENABLED-}\" ]]; then\n  # If this is a replay, then use replay_build.sh. This is expected to be\n  # running in a cached container where a build has already happened prior.\n  BUILD_CMD=\"bash -eux $SRC/replay_build.sh $@\"\nelse\n  BUILD_CMD=\"bash -eux $SRC/build.sh $@\"\nfi\n\n# Set +u temporarily to continue even if GOPATH and OSSFUZZ_RUSTPATH are undefined.\nset +u\n# We need to preserve source code files for generating a code coverage report.\n# We need exact files that were compiled, so copy both $SRC and $WORK dirs.\nCOPY_SOURCES_CMD=\"cp -rL --parents $SRC $WORK /usr/include /usr/local/include $GOPATH $OSSFUZZ_RUSTPATH /rustc $OUT\"\nset -u\n\nif [ \"$FUZZING_LANGUAGE\" = \"rust\" ]; then\n  # Copy rust std lib to its path with a hash.\n  export rustch=`rustc --version --verbose | grep commit-hash | cut -d' ' -f2`\n  mkdir -p /rustc/$rustch/\n  export rustdef=`rustup toolchain list | grep default | cut -d' ' -f1`\n  cp -r /rust/rustup/toolchains/$rustdef/lib/rustlib/src/rust/library/ /rustc/$rustch/\nfi\n\nif [ \"${BUILD_UID-0}\" -ne \"0\" ]; then\n  adduser -u $BUILD_UID --disabled-password --gecos '' builder\n  chown -R builder $SRC $OUT $WORK\n  su -c \"$BUILD_CMD\" builder\n  if [ \"$SANITIZER\" = \"coverage\" ]; then\n    # Some directories have broken symlinks (e.g. honggfuzz), ignore the errors.\n    su -c \"$COPY_SOURCES_CMD\" builder 2>/dev/null || true\n  fi\nelse\n  $BUILD_CMD\n  if [ \"$SANITIZER\" = \"coverage\" ]; then\n    # Some directories have broken symlinks (e.g. honggfuzz), ignore the errors.\n    $COPY_SOURCES_CMD 2>/dev/null || true\n  fi\nfi\n\nif [ \"$SANITIZER\" = \"introspector\" ] || [ \"$RUST_SANITIZER\" = \"introspector\" ]; then\n  unset CXXFLAGS\n  unset CFLAGS\n  export G_ANALYTICS_TAG=\"G-8WTFM1Y62J\"\n\n  # If we get to here, it means the e.g. LTO had no problems and succeeded.\n  # TO this end, we wlil restore the original light analysis and used the\n  # LTO processing itself.\n  rm -rf $SRC/inspector\n  cp -rf /tmp/inspector-saved $SRC/inspector\n\n  cd /fuzz-introspector/src\n  python3 -m pip install -e .\n  cd /src/\n\n  if [ \"$FUZZING_LANGUAGE\" = \"rust\" ]; then\n    # Restore the sanitizer flag for rust\n    export SANITIZER=\"introspector\"\n  fi\n\n  mkdir -p $SRC/inspector\n  find $SRC/ -name \"fuzzerLogFile-*.data\" -exec cp {} $SRC/inspector/ \\;\n  find $SRC/ -name \"fuzzerLogFile-*.data.yaml\" -exec cp {} $SRC/inspector/ \\;\n  find $SRC/ -name \"fuzzerLogFile-*.data.debug_*\" -exec cp {} $SRC/inspector/ \\;\n  find $SRC/ -name \"allFunctionsWithMain-*.yaml\" -exec cp {} $SRC/inspector/ \\;\n\n  # Move coverage report.\n  if [ -d \"$OUT/textcov_reports\" ]\n  then\n    find $OUT/textcov_reports/ -name \"*.covreport\" -exec cp {} $SRC/inspector/ \\;\n    find $OUT/textcov_reports/ -name \"*.json\" -exec cp {} $SRC/inspector/ \\;\n  fi\n\n  cd $SRC/inspector\n\n  # Make fuzz-introspector HTML report.\n  REPORT_ARGS=\"--name=$PROJECT_NAME\"\n  # Only pass coverage_url when COVERAGE_URL is set (in cloud builds)\n  if [[ ! -z \"${COVERAGE_URL+x}\" ]]; then\n    REPORT_ARGS=\"$REPORT_ARGS --coverage-url=${COVERAGE_URL}\"\n  fi\n\n  # Do different things depending on languages\n  if [ \"$FUZZING_LANGUAGE\" = \"python\" ]; then\n    echo \"GOING python route\"\n    set -x\n    REPORT_ARGS=\"$REPORT_ARGS --target-dir=$SRC/inspector\"\n    REPORT_ARGS=\"$REPORT_ARGS --language=python\"\n    fuzz-introspector report $REPORT_ARGS\n    rsync -avu --delete \"$SRC/inspector/\" \"$OUT/inspector\"\n  elif [ \"$FUZZING_LANGUAGE\" = \"jvm\" ]; then\n    echo \"GOING jvm route\"\n    set -x\n    find $OUT/ -name \"jacoco.xml\" -exec cp {} $SRC/inspector/ \\;\n    REPORT_ARGS=\"$REPORT_ARGS --target-dir=$SRC --out-dir=$SRC/inspector\"\n    REPORT_ARGS=\"$REPORT_ARGS --language=jvm\"\n    fuzz-introspector full $REPORT_ARGS\n    rsync -avu --delete \"$SRC/inspector/\" \"$OUT/inspector\"\n  elif [ \"$FUZZING_LANGUAGE\" = \"rust\" ]; then\n    echo \"GOING rust route\"\n    REPORT_ARGS=\"$REPORT_ARGS --target-dir=$SRC --out-dir=$SRC/inspector\"\n    REPORT_ARGS=\"$REPORT_ARGS --language=rust\"\n    fuzz-introspector full $REPORT_ARGS\n    rsync -avu --delete \"$SRC/inspector/\" \"$OUT/inspector\"\n  else\n    # C/C++\n    mkdir -p $SRC/inspector\n    # Correlate fuzzer binaries to fuzz-introspector's raw data\n    fuzz-introspector correlate --binaries-dir=$OUT/\n\n    # Generate fuzz-introspector HTML report, this generates\n    # the file exe_to_fuzz_introspector_logs.yaml\n    REPORT_ARGS=\"$REPORT_ARGS --target-dir=$SRC/inspector\"\n    # Use the just-generated correlation file\n    REPORT_ARGS=\"$REPORT_ARGS --correlation-file=exe_to_fuzz_introspector_logs.yaml\"\n    fuzz-introspector report $REPORT_ARGS\n\n    rsync -avu --delete \"$SRC/inspector/\" \"$OUT/inspector\"\n  fi\nfi\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_afl",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# If LLVM once again does weird changes then enable this:\n#export AFL_LLVM_INSTRUMENT=LLVM-NATIVE\n\n# AFL++ setup\necho \"Copying precompiled AFL++\"\n\n# Copy AFL++ tools necessary for fuzzing.\npushd $SRC/aflplusplus > /dev/null\n\ncp -f libAFLDriver.a $LIB_FUZZING_ENGINE\n\n# Some important projects include libraries, copy those even when they don't\n# start with \"afl-\". Use \"sort -u\" to avoid a warning about duplicates.\nls afl-* *.txt *.a *.o *.so | sort -u | xargs cp -t $OUT\nexport CC=\"$SRC/aflplusplus/afl-clang-fast\"\nexport CXX=\"$SRC/aflplusplus/afl-clang-fast++\"\n\n# Set sane AFL++ environment defaults:\n# Be quiet, otherwise this can break some builds.\nexport AFL_QUIET=1\n# No leak errors during builds.\nexport ASAN_OPTIONS=\"detect_leaks=0:symbolize=0:detect_odr_violation=0:abort_on_error=1\"\n# Do not abort on any problems (because this is during build where it is ok)\nexport AFL_IGNORE_PROBLEMS=1\n# No complain on unknown AFL environment variables\nexport AFL_IGNORE_UNKNOWN_ENVS=1\n\n# Provide a way to document the AFL++ options used in this build:\necho\necho AFL++ target compilation setup:\nenv | egrep '^AFL_' | tee \"$OUT/afl_options.txt\"\necho\n\npopd > /dev/null\n\necho \" done.\"\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_centipede",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"Skipping compilation; using precompiled centipede\"\n\nif [[ \"$SANITIZER\" == 'none' ]]; then\n  cp \"$CENTIPEDE_BIN_DIR/centipede\" \"$OUT\"\nfi\n\ncp \"$CENTIPEDE_BIN_DIR/libcentipede_runner.pic.a\" \"$LIB_FUZZING_ENGINE\"\n\nexport CENTIPEDE_FLAGS=`cat \"$SRC/fuzztest/centipede/clang-flags.txt\" | tr '\\n' ' '`\nexport LIBRARIES_FLAGS=\"-Wno-unused-command-line-argument -Wl,-ldl -Wl,-lrt -Wl,-lpthread -Wl,$SRC/fuzztest/centipede/weak.o\"\n\nexport CFLAGS=\"$CFLAGS $CENTIPEDE_FLAGS $LIBRARIES_FLAGS\"\nexport CXXFLAGS=\"$CXXFLAGS $CENTIPEDE_FLAGS $LIBRARIES_FLAGS\"\n\necho 'done.'\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_fuzztests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -x\n\n# In order to identify fuzztest test case \"bazel query\" is used to search\n# the project. A search of the entire project is done with a default \"...\",\n# however, some projects may fail to, or have very long processing time, if\n# searching the entire project. Additionally, it may include fuzzers in\n# dependencies, which should not be build as part of a given project.\n# Tensorflow is an example project that will fail when the entire project is\n# queried. FUZZTEST_TARGET_FOLDER makes it posible to specify the folder\n# where fuzztest fuzzers should be search for. FUZZTEST_TARGET_FOLDER is passed\n# to \"bazel query\" below.\nif [[ ${FUZZTEST_TARGET_FOLDER:-\"unset\"} == \"unset\" ]];\nthen\n  export TARGET_FOLDER=\"...\"\nelse\n  TARGET_FOLDER=${FUZZTEST_TARGET_FOLDER}\nfi\n\nBUILD_ARGS=\"--config=oss-fuzz --subcommands\"\nif [[ ${FUZZTEST_EXTRA_ARGS:-\"unset\"} != \"unset\" ]];\nthen\n  BUILD_ARGS=\"$BUILD_ARGS ${FUZZTEST_EXTRA_ARGS}\"\nfi\n\n# Trigger setup_configs rule of fuzztest as it generates the necessary\n# configuration file based on OSS-Fuzz environment variables.\nbazel run @com_google_fuzztest//bazel:setup_configs >> /etc/bazel.bazelrc\n\n# Bazel target names of the fuzz binaries.\nFUZZ_TEST_BINARIES=$(bazel query \"kind(\\\"cc_test\\\", rdeps(${TARGET_FOLDER}, @com_google_fuzztest//fuzztest:fuzztest_gtest_main))\")\n\n# Bazel output paths of the fuzz binaries.\nFUZZ_TEST_BINARIES_OUT_PATHS=$(bazel cquery \"kind(\\\"cc_test\\\", rdeps(${TARGET_FOLDER}, @com_google_fuzztest//fuzztest:fuzztest_gtest_main))\" --output=files)\n\n# Build the project and fuzz binaries\n# Expose `FUZZTEST_EXTRA_TARGETS` environment variable, in the event a project\n# includes non-FuzzTest fuzzers then this can be used to compile these in the\n# same `bazel build` command as when building the FuzzTest fuzzers.\n# This is to avoid having to call `bazel build` twice.\nbazel build $BUILD_ARGS -- ${FUZZ_TEST_BINARIES[*]} ${FUZZTEST_EXTRA_TARGETS:-}\n\n# Iterate the fuzz binaries and list each fuzz entrypoint in the binary. For\n# each entrypoint create a wrapper script that calls into the binaries the\n# given entrypoint as argument.\n# The scripts will be named:\n# {binary_name}@{fuzztest_entrypoint}\nfor fuzz_main_file in $FUZZ_TEST_BINARIES_OUT_PATHS; do\n  FUZZ_TESTS=$($fuzz_main_file --list_fuzz_tests)\n  cp ${fuzz_main_file} $OUT/\n  fuzz_basename=$(basename $fuzz_main_file)\n  chmod -x $OUT/$fuzz_basename\n  for fuzz_entrypoint in $FUZZ_TESTS; do\n    TARGET_FUZZER=\"${fuzz_basename}@$fuzz_entrypoint\"\n\n    # Write executer script\n    echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nchmod +x \\$this_dir/$fuzz_basename\n\\$this_dir/$fuzz_basename --fuzz=$fuzz_entrypoint -- \\$@\" > $OUT/$TARGET_FUZZER\n    chmod +x $OUT/$TARGET_FUZZER\n  done\ndone\n\n# Synchronise coverage directory to bazel output artifacts. This is a\n# best-effort basis in that it will include source code in common\n# bazel output folders.\n# For projects that store results in non-standard folders or want to\n# manage what code to include in the coverage report more specifically,\n# the FUZZTEST_DO_SYNC environment variable is made available. Projects\n# can then implement a custom way of synchronising source code with the\n# coverage build. Set FUZZTEST_DO_SYNC to something other than \"yes\" and\n# no effort will be made to automatically synchronise the source code with\n# the code coverage visualisation utility.\nif [[ \"$SANITIZER\" = \"coverage\" && ${FUZZTEST_DO_SYNC:-\"yes\"} == \"yes\" ]]\nthen \n  # Synchronize bazel source files to coverage collection.\n  declare -r REMAP_PATH=\"${OUT}/proc/self/cwd\"\n  mkdir -p \"${REMAP_PATH}\"\n  \n  # Synchronize the folder bazel-BAZEL_OUT_PROJECT.\n  declare -r RSYNC_FILTER_ARGS=(\"--include\" \"*.h\" \"--include\" \"*.cc\" \"--include\" \\\n    \"*.hpp\" \"--include\" \"*.cpp\" \"--include\" \"*.c\" \"--include\" \"*/\" \"--include\" \"*.inc\" \\\n    \"--exclude\" \"*\")\n\n  project_folders=\"$(find . -name 'bazel-*' -type l -printf '%P\\n' | \\\n                    grep -v -x -F \\\n                    -e 'bazel-bin' \\\n                    -e 'bazel-testlogs')\"\n  for link in $project_folders; do\n   if [[ -d \"${PWD}\"/$link/external  ]]\n   then\n     rsync -avLk \"${RSYNC_FILTER_ARGS[@]}\" \"${PWD}\"/$link/external \"${REMAP_PATH}\"\n   fi\n   # k8-opt is a common path for storing bazel output artifacts, e.g. bazel-out/k8-opt.\n   # It's the output folder for default amd-64 builds, but projects may specify custom\n   # platform output directories, see: https://github.com/bazelbuild/bazel/issues/13818\n   # We support the default at the moment, and if a project needs custom synchronizing of\n   # output artifacts and code coverage we currently recommend using FUZZTEST_DO_SYNC.\n   if [[ -d \"${PWD}\"/$link/k8-opt  ]]\n   then\n     rsync -avLk \"${RSYNC_FILTER_ARGS[@]}\" \"${PWD}\"/$link/k8-opt \"${REMAP_PATH}\"/$link\n   fi\n  done\n\n  # Delete symlinks and sync the current folder.\n  find . -type l -ls -delete\n  rsync -av ${PWD}/ \"${REMAP_PATH}\"\nfi\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_go_fuzzer",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npath=$1\nfunction=$2\nfuzzer=$3\ntags=\"-tags gofuzz\"\nif [[ $#  -eq 4 ]]; then\n  tags=\"-tags $4\"\nfi\n\n# Import go_utils.sh\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nsource \"$SCRIPT_DIR/go_utils.sh\"\n\n# makes directory change temporary\n(\ncd $GOPATH/src/$path || true\n# in the case we are in the right directory, with go.mod but no go.sum\ngo mod tidy || true\n# project was downloaded with go get if go list fails\ngo list $tags $path || { cd $GOPATH/pkg/mod/ && cd `echo $path | cut -d/ -f1-3 | awk '{print $1\"@*\"}'`; } || cd -\n# project does not have go.mod if go list fails again\ngo list $tags $path || { go mod init $path && go mod tidy ;}\n\nif [[ $SANITIZER = *coverage* ]]; then\n  fuzzed_package=`go list $tags -f '{{.Name}}' $path`\n  abspath=`go list $tags -f {{.Dir}} $path`\n  cd $abspath\n  cp $GOPATH/ossfuzz_coverage_runner.go ./\"${function,,}\"_test.go\n  sed -i -e 's/FuzzFunction/'$function'/' ./\"${function,,}\"_test.go\n  sed -i -e 's/mypackagebeingfuzzed/'$fuzzed_package'/' ./\"${function,,}\"_test.go\n  sed -i -e 's/TestFuzzCorpus/Test'$function'Corpus/' ./\"${function,,}\"_test.go\n\n  # The repo is the module path/name, which is already created above in case it doesn't exist,\n  # but not always the same as the module path. This is necessary to handle SIV properly.\n  fuzzed_repo=$(go list $tags -f {{.Module}} \"$path\")\n  abspath_repo=`go list -m $tags -f {{.Dir}} $fuzzed_repo || go list $tags -f {{.Dir}} $fuzzed_repo`\n  # give equivalence to absolute paths in another file, as go test -cover uses golangish pkg.Dir\n  echo \"s=$fuzzed_repo\"=\"$abspath_repo\"= > $OUT/$fuzzer.gocovpath\n  # Additional packages for which to get coverage.\n  pkgaddcov=\"\"\n  # to prevent bash from failing about unbound variable\n  GO_COV_ADD_PKG_SET=${GO_COV_ADD_PKG:-}\n  if [[ -n \"${GO_COV_ADD_PKG_SET}\" ]]; then\n    pkgaddcov=\",\"$GO_COV_ADD_PKG\n    abspath_repo=`go list -m $tags -f {{.Dir}} $GO_COV_ADD_PKG || go list $tags -f {{.Dir}} $GO_COV_ADD_PKG`\n    echo \"s=^$GO_COV_ADD_PKG\"=\"$abspath_repo\"= >> $OUT/$fuzzer.gocovpath\n  fi\n  go test $tags \\\n    -c \\\n    -o $OUT/$fuzzer \\\n    -v \\\n    -covermode=atomic \\\n    -coverpkg $fuzzed_repo/...$pkgaddcov \\\n    $path\n    function_names_file=\"$OUT/fuzzer_function_names.json\"\n    save_function_name \"$fuzzer\" \"Test${function}Corpus\" \"$function_names_file\"\nelse\n  # Compile and instrument all Go files relevant to this fuzz target.\n  echo \"Running go-fuzz $tags -func $function -o $fuzzer.a $path\"\n  go-fuzz $tags -func $function -o $fuzzer.a $path\n\n  # Link Go code ($fuzzer.a) with fuzzing engine to produce fuzz target binary.\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer\nfi\n)\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_honggfuzz",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"Skipping compilation; using precompiled honggfuzz\"\n\ncp $SRC/honggfuzz/honggfuzz.a $LIB_FUZZING_ENGINE\ncp $SRC/honggfuzz/honggfuzz $OUT/\n\n# Set flags necessary for netdriver compilation.\nexport LIB_HFND=\"-Wl,-u,LIBHFNETDRIVER_module_netdriver -Wl,--start-group $SRC/honggfuzz/libhfnetdriver/libhfnetdriver.a $SRC/honggfuzz/libhfcommon/libhfcommon.a -Wl,--end-group\"\n\nexport HFND_CXXFLAGS='-DHFND_FUZZING_ENTRY_FUNCTION_CXX(x,y)=extern const char* LIBHFNETDRIVER_module_netdriver;const char** LIBHFNETDRIVER_tmp1 = &LIBHFNETDRIVER_module_netdriver;extern \"C\" int HonggfuzzNetDriver_main(x,y);int HonggfuzzNetDriver_main(x,y)'\nexport HFND_CFLAGS='-DHFND_FUZZING_ENTRY_FUNCTION(x,y)=extern const char* LIBHFNETDRIVER_module_netdriver;const char** LIBHFNETDRIVER_tmp1 = &LIBHFNETDRIVER_module_netdriver;int HonggfuzzNetDriver_main(x,y);int HonggfuzzNetDriver_main(x,y)'\n\n# Custom coverage flags, roughly in sync with:\n# https://github.com/google/honggfuzz/blob/oss-fuzz/hfuzz_cc/hfuzz-cc.c\nexport COVERAGE_FLAGS=\"-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp\"\n\necho \" done.\"\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_javascript_fuzzer",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nproject=$1\n# Path the fuzz target source file relative to the project's root.\nfuzz_target=$2\n# Arguments to pass to Jazzer.js\njazzerjs_args=${@:3}\n\n# Copy source code into the $OUT directory and install Jazzer.js into the project.\nif [ ! -d $OUT/$project ]; then\n  cp -r $SRC/$project $OUT/$project\nfi\n\nfuzzer_basename=$(basename -s .js $fuzz_target)\n\n# Create an execution wrapper that executes Jazzer.js with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput so that the wrapper script is recognized as a fuzz target for 'check_build'.\nproject_dir=\\$(dirname \\\"\\$0\\\")/$project\n\\$project_dir/node_modules/@jazzer.js/core/dist/cli.js \\$project_dir/$fuzz_target $jazzerjs_args \\$JAZZERJS_EXTRA_ARGS -- \\$@\" > $OUT/$fuzzer_basename\n\nchmod +x $OUT/$fuzzer_basename\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_libfuzzer",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho -n \"Compiling libFuzzer to $LIB_FUZZING_ENGINE... \"\nexport LIB_FUZZING_ENGINE=\"-fsanitize=fuzzer\"\nif [ \"$FUZZING_LANGUAGE\" = \"go\" ]; then\n    export LIB_FUZZING_ENGINE=\"$LIB_FUZZING_ENGINE $GOPATH/gosigfuzz/gosigfuzz.o\"\nfi\n\ncp /usr/local/lib/clang/*/lib/$ARCHITECTURE-unknown-linux-gnu/libclang_rt.fuzzer.a $LIB_FUZZING_ENGINE_DEPRECATED\necho \" done.\"\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_native_go_fuzzer",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npath=$1\nfunction=$2\nfuzzer=$3\ntags=\"-tags gofuzz\"\n\n# Get absolute path.\nabs_file_dir=$(go list $tags -f {{.Dir}} $path)\n\n# TODO(adamkorcz): Get rid of \"-r\" flag here.\nexport fuzzer_filename=$(grep -r -l --include='*.go' -s \"$function\" \"${abs_file_dir}\")\n\n# Import build_native_go_fuzzer_legacy\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nsource \"$SCRIPT_DIR/go_utils.sh\"\n\n# Test if file contains a line with \"func $function\" and \"testing.F\".\nif [ $(grep -r \"func $function\" $fuzzer_filename | grep \"testing.F\" | wc -l) -eq 1 ]\nthen\n\tbuild_native_go_fuzzer_legacy $fuzzer $function $abs_file_dir $path\nelse\n\techo \"Could not find the function: func ${function}(f *testing.F)\"\nfi\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_native_go_fuzzer_v2",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npath=$1\nfunction=$2\nfuzzer=$3\ntags=\"-tags gofuzz\"\n\n# Get absolute path.\nabs_file_dir=$(go list $tags -f {{.Dir}} $path)\n\n# Find the file containing the fuzzer function definition.\n# Search for the actual function signature with testing.F to avoid false matches\n# in files that only reference the function name (e.g., in comments or helper functions).\nexport fuzzer_filename=$(grep -r -l --include='*.go' \"func ${function}(.*testing\\.F\" \"${abs_file_dir}\")\n\n# Import build_native_go_fuzzer\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nsource \"$SCRIPT_DIR/go_utils.sh\"\n\n# Verify we found exactly one file with the fuzzer function.\nfile_count=$(echo \"$fuzzer_filename\" | wc -w)\nif [ \"$file_count\" -eq 1 ] && [ -n \"$fuzzer_filename\" ] && [ -f \"$fuzzer_filename\" ]\nthen\n  build_native_go_fuzzer $fuzzer $function $abs_file_dir $path\nelif [ \"$file_count\" -gt 1 ]\nthen\n  echo \"Error: Found multiple files with func ${function}(f *testing.F):\"\n  echo \"$fuzzer_filename\"\n  exit 1\nelse\n  echo \"Could not find the function: func ${function}(f *testing.F)\"\nfi\n"
  },
  {
    "path": "infra/base-images/base-builder/compile_python_fuzzer",
    "content": "#!/bin/bash -eux\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# In order to enable PySecSan for a given module, set the environment\n# variable ENABLE_PYSECSAN=\"YES\"\n\nfuzzer_path=$1\nshift 1\n\nfuzzer_basename=$(basename -s .py $fuzzer_path)\nfuzzer_package=${fuzzer_basename}.pkg\n\nPYFUZZ_WORKPATH=$SRC/pyfuzzworkdir/\nFUZZ_WORKPATH=$PYFUZZ_WORKPATH/$fuzzer_basename\n\nif [[ $SANITIZER = *introspector* ]]; then\n    # Extract the source package the fuzzer targets. This must happen before\n    # we enter the virtual environment in the following lines because we need\n    # to use the same python environment that installed the fuzzer dependencies.\n    python3 /fuzz-introspector/frontends/python/prepare_fuzz_imports.py $fuzzer_path isossfuzz\n\n    # We must ensure python3.9, this is because we use certain\n    # AST logic from there.\n    # The below should probably be refined\n    apt-get install -y python3.9\n    apt-get update\n    apt-get install -y python3-pip\n    python3.9 -m pip install virtualenv\n    python3.9 -m virtualenv .venv\n    . .venv/bin/activate\n    pip3 install pyyaml\n    export PYTHONPATH=\"/fuzz-introspector/frontends/python/PyCG\"\n\n    ARGS=\"--fuzzer $fuzzer_path\"\n    if [ -n \"${PYFUZZPACKAGE-}\" ]; then\n      ARGS=\"$ARGS --package=${PYFUZZPACKAGE}\"\n    fi\n    python /fuzz-introspector/frontends/python/main.py $ARGS\n    ls -la ./\n    exit 0\nfi\n\n# In coverage mode prepend coverage logic to the fuzzer source\nif [[ $SANITIZER = *coverage* ]]; then\n  cat <<EOF > coverage_wrapper.py\n###### Coverage stub\nimport atexit\nimport coverage\ncov = coverage.coverage(data_file='.coverage', cover_pylib=True)\ncov.start()\n# Register an exist handler that will print coverage\ndef exit_handler():\n    cov.stop()\n    cov.save()\natexit.register(exit_handler)\n####### End of coverage stub\nEOF\n\n  # Prepend stub and create tmp file\n  cat coverage_wrapper.py $fuzzer_path > tmp_fuzzer_coverage.py\n\n  # Overwrite existing fuzzer with new fuzzer that has stub\n  mv tmp_fuzzer_coverage.py $fuzzer_path\nfi\n\n# If PYSECSAN is enabled, ensure that we can build with it.\nif [[ ${ENABLE_PYSECSAN:-\"0\"} != \"0\" ]];\nthen\n  # Make sure pysecsan is installed\n  if [[ ! -d \"/pysecsan\" ]];\n  then\n    pushd /usr/local/lib/sanitizers/pysecsan\n    python3 -m pip install .\n    popd\n  fi\n\n  cat <<EOF > pysecsan_wrapper.py\nimport pysecsan; pysecsan.add_hooks();\nEOF\n\n  # Prepend stub and create tmp file\n  cat pysecsan_wrapper.py $fuzzer_path > tmp_fuzzer_pysecsan.py\n\n  # Overwrite existing fuzzer with new fuzzer that has stub\n  mv tmp_fuzzer_pysecsan.py $fuzzer_path\nfi\n\nrm -rf $PYFUZZ_WORKPATH\nmkdir $PYFUZZ_WORKPATH $FUZZ_WORKPATH\n\npyinstaller --distpath $OUT --workpath=$FUZZ_WORKPATH --onefile --name $fuzzer_package \"$@\" $fuzzer_path\n\n# Disable executable bit from package as OSS-Fuzz uses executable bits to\n# identify fuzz targets. We re-enable the executable bit in wrapper script\n# below.\nchmod -x $OUT/$fuzzer_package\n\n# In coverage mode save source files of dependencies in pyinstalled binary\nif [[ $SANITIZER = *coverage* ]]; then\n  rm -rf /medio/\n  python3 /usr/local/bin/python_coverage_helper.py $FUZZ_WORKPATH \"/medio\"\n  zip -r $fuzzer_package.deps.zip /medio\n  mv $fuzzer_package.deps.zip $OUT/\nfi\n\n# Create execution wrapper.\necho \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nchmod +x \\$this_dir/$fuzzer_package\nLD_PRELOAD=\\$this_dir/sanitizer_with_fuzzer.so \\\nASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$this_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$this_dir/$fuzzer_package \\$@\" > $OUT/$fuzzer_basename\nchmod +x $OUT/$fuzzer_basename\n"
  },
  {
    "path": "infra/base-images/base-builder/debug_afl",
    "content": "#!/bin/bash\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Source this file for afl++ debug sessions.\napt-get update\napt-get install -y strace gdb vim joe psmisc\n\npushd $SRC/aflplusplus > /dev/null\ngit checkout dev\ngit pull\ntest -n \"$1\" && { git checkout \"$1\" ; git pull ; }\nCFLAGS_SAVE=\"$CFLAGS\"\nCXXFLAGS_SAVE=\"$CXXFLAGS\"\nunset CFLAGS\nunset CXXFLAGS\nmake\nexport CFLAGS=\"$CFLAGS_SAVE\"\nexport CXXFLAGS=\"$CXXFLAGS_SAVE\"\npopd > /dev/null\n\nexport ASAN_OPTIONS=\"detect_leaks=0:symbolize=0:detect_odr_violation=0:abort_on_error=1\"\nexport AFL_LLVM_LAF_ALL=1\nexport AFL_LLVM_CMPLOG=1\ntouch \"$OUT/afl_cmplog.txt\"\nexport AFL_LLVM_DICT2FILE=$OUT/afl++.dict\nulimit -c unlimited\n"
  },
  {
    "path": "infra/base-images/base-builder/detect_repo.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module to get the the name of a git repo containing a specific commit\ninside of an OSS-Fuzz project.\n\nExample Usage:\n\n  python detect_repo.py --src_dir /src --example_commit\n    b534f03eecd8a109db2b085ab24d419b6486de97\n\nPrints the location of the git remote repo as well as the repo's name\nseperated by a space.\n\n  https://github.com/VirusTotal/yara.git yara\n\n\"\"\"\nimport argparse\nimport logging\nimport os\nimport subprocess\n\nGO_PATH = '/root/go/src/'\n\n\ndef main():\n  \"\"\"Function to get a git repo's url and name referenced by OSS-Fuzz\n  Dockerfile.\n\n  Raises:\n    ValueError when a commit or a ref is not provided.\n  \"\"\"\n  parser = argparse.ArgumentParser(\n      description=\n      'Finds a specific git repo in an oss-fuzz project\\'s docker file.')\n  parser.add_argument('--repo_name', help='The name of the git repo.')\n  parser.add_argument('--src_dir', help='The location of the possible repo.')\n  parser.add_argument('--example_commit',\n                      help='A commit SHA referencing the project\\'s main repo.')\n\n  args = parser.parse_args()\n  if not args.repo_name and not args.example_commit:\n    raise ValueError(\n        'Requires an example commit or a repo name to find repo location.')\n  if args.src_dir:\n    src_dir = args.src_dir\n  else:\n    src_dir = os.environ.get('SRC', '/src')\n\n  for single_dir in get_dirs_to_search(src_dir, args.repo_name):\n    full_path = os.path.join(src_dir, single_dir)\n    if not os.path.isdir(full_path):\n      continue\n    if args.example_commit and check_for_commit(full_path, args.example_commit):\n      print('Detected repo:', get_repo(full_path), full_path)\n      return\n    if args.repo_name and check_for_repo_name(full_path, args.repo_name):\n      print('Detected repo:', get_repo(full_path), full_path)\n      return\n  logging.error('No git repos with specific commit: %s found in %s',\n                args.example_commit, src_dir)\n\n\ndef get_dirs_to_search(src_dir, repo_name):\n  \"\"\"Gets a list of directories to search for the main git repo.\n\n  Args:\n    src_dir: The location set for the projects SRC.\n    repo_name: The name of the repo you are searching for.\n\n  Returns:\n    A list of directorys to search.\n  \"\"\"\n  dirs_to_search = os.listdir(src_dir)\n  if os.path.exists(GO_PATH) and repo_name:\n    for root, dirs, _ in os.walk(GO_PATH):\n      for test_dir in dirs:\n        if repo_name in test_dir:\n          dirs_to_search.append(os.path.join(root, test_dir))\n  return dirs_to_search\n\n\ndef get_repo(repo_path):\n  \"\"\"Gets a git repo link from a specific directory in a docker image.\n\n  Args:\n    repo_path: The directory on the image where the git repo exists.\n\n  Returns:\n    The repo location or None.\n  \"\"\"\n  output, return_code = execute(['git', 'config', '--get', 'remote.origin.url'],\n                                location=repo_path,\n                                check_result=True)\n  if return_code == 0 and output:\n    return output.rstrip()\n  return None\n\n\ndef check_for_repo_name(repo_path, expected_repo_name):\n  \"\"\"Returns True if the repo at |repo_path| repo_name matches\n  |expected_repo_name|.\n\n  Args:\n    repo_path: The directory of a git repo.\n    expected_repo_name: The name of the target git repo.\n  \"\"\"\n  if not os.path.exists(os.path.join(repo_path, '.git')):\n    return False\n\n  repo_url, _ = execute(['git', 'config', '--get', 'remote.origin.url'],\n                        location=repo_path)\n  # Handle two common cases:\n  # https://github.com/google/syzkaller/\n  # https://github.com/google/syzkaller.git\n  repo_url = repo_url.replace('.git', '').rstrip().rstrip('/')\n  actual_repo_name = repo_url.split('/')[-1]\n  return actual_repo_name == expected_repo_name\n\n\ndef check_for_commit(repo_path, commit):\n  \"\"\"Checks a directory for a specific commit.\n\n  Args:\n    repo_path: The name of the directory to test for the commit.\n    commit: The commit SHA to check for.\n\n  Returns:\n    True if directory contains that commit.\n  \"\"\"\n\n  # Check if valid git repo.\n  if not os.path.exists(os.path.join(repo_path, '.git')):\n    return False\n\n  # Check if history fetch is needed.\n  if os.path.exists(os.path.join(repo_path, '.git', 'shallow')):\n    execute(['git', 'fetch', '--unshallow'], location=repo_path)\n\n  # Check if commit is in history.\n  _, return_code = execute(['git', 'cat-file', '-e', commit],\n                           location=repo_path)\n  return return_code == 0\n\n\ndef execute(command, location, check_result=False):\n  \"\"\"Runs a shell command in the specified directory location.\n\n  Args:\n    command: The command as a list to be run.\n    location: The directory the command is run in.\n    check_result: Should an exception be thrown on failed command.\n\n  Returns:\n    The stdout of the command, the error code.\n\n  Raises:\n    RuntimeError: running a command resulted in an error.\n  \"\"\"\n  process = subprocess.Popen(command, stdout=subprocess.PIPE, cwd=location)\n  output, err = process.communicate()\n  if check_result and (process.returncode or err):\n    raise RuntimeError(\n        'Error: %s\\n running command: %s\\n return code: %s\\n out %s\\n' %\n        (err, command, process.returncode, output))\n  if output is not None:\n    output = output.decode('ascii')\n  return output, process.returncode\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/detect_repo_test.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Test the functionality of the detect_repo module.\nThis will consist of the following functional test:\n  1. Determine if an OSS-Fuzz projects main repo can be detected from example\n  commits.\n  2. Determine if an OSS-Fuzz project main repo can be detected from a\n  repo name.\n\"\"\"\nimport os\nimport re\nimport sys\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport detect_repo\n\n# Appending to path for access to repo_manager module.\n# pylint: disable=wrong-import-position\nsys.path.append(\n    os.path.dirname(os.path.dirname(os.path.dirname(\n        os.path.abspath(__file__)))))\nimport repo_manager\nimport test_repos\n# pylint: enable=wrong-import-position\n\n\nclass TestCheckForRepoName(unittest.TestCase):\n  \"\"\"Tests for check_for_repo_name.\"\"\"\n\n  @mock.patch('os.path.exists', return_value=True)\n  @mock.patch('detect_repo.execute',\n              return_value=('https://github.com/google/syzkaller/', None))\n  def test_go_get_style_url(self, _, __):\n    \"\"\"Tests that check_for_repo_name works on repos that were downloaded using\n    go get.\"\"\"\n    self.assertTrue(detect_repo.check_for_repo_name('fake-path', 'syzkaller'))\n\n  @mock.patch('os.path.exists', return_value=True)\n  @mock.patch('detect_repo.execute',\n              return_value=('https://github.com/google/syzkaller', None))\n  def test_missing_git_and_slash_url(self, _, __):\n    \"\"\"Tests that check_for_repo_name works on repos who's URLs do not end in\n    \".git\" or \"/\".\"\"\"\n    self.assertTrue(detect_repo.check_for_repo_name('fake-path', 'syzkaller'))\n\n  @mock.patch('os.path.exists', return_value=True)\n  @mock.patch('detect_repo.execute',\n              return_value=('https://github.com/google/syzkaller.git', None))\n  def test_normal_style_repo_url(self, _, __):\n    \"\"\"Tests that check_for_repo_name works on normally cloned repos.\"\"\"\n    self.assertTrue(detect_repo.check_for_repo_name('fake-path', 'syzkaller'))\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass DetectRepoIntegrationTest(unittest.TestCase):\n  \"\"\"Class to test the functionality of the detect_repo module.\"\"\"\n\n  def test_infer_main_repo_from_commit(self):\n    \"\"\"Tests that the main repo can be inferred based on an example commit.\"\"\"\n\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      # Construct example repo's to check for commits.\n      for test_repo in test_repos.TEST_REPOS:\n        repo_manager.clone_repo_and_get_manager(test_repo.git_url, tmp_dir)\n        self.check_with_repo(test_repo.git_url,\n                             test_repo.git_repo_name,\n                             tmp_dir,\n                             commit=test_repo.old_commit)\n\n  def test_infer_main_repo_from_name(self):\n    \"\"\"Tests that the main project repo can be inferred from a repo name.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      for test_repo in test_repos.TEST_REPOS:\n        repo_manager.clone_repo_and_get_manager(test_repo.git_url, tmp_dir)\n        self.check_with_repo(test_repo.git_url, test_repo.git_repo_name,\n                             tmp_dir)\n\n  def check_with_repo(self, repo_origin, repo_name, tmp_dir, commit=None):\n    \"\"\"Checks the detect repo's main method for a specific set of inputs.\n\n    Args:\n      repo_origin: URL of the git repo.\n      repo_name: The name of the directory it is cloned to.\n      tmp_dir: The location of the directory of git repos to be searched.\n      commit: The commit that should be used to look up the repo.\n    \"\"\"\n    command = ['python3', 'detect_repo.py', '--src_dir', tmp_dir]\n\n    if commit:\n      command += ['--example_commit', commit]\n    else:\n      command += ['--repo_name', repo_name]\n\n    out, _ = detect_repo.execute(command,\n                                 location=os.path.dirname(\n                                     os.path.realpath(__file__)))\n    match = re.search(r'\\bDetected repo: ([^ ]+) ([^ ]+)', out.rstrip())\n    if match and match.group(1) and match.group(2):\n      self.assertEqual(match.group(1), repo_origin)\n      self.assertEqual(match.group(2), os.path.join(tmp_dir, repo_name))\n    else:\n      self.assertIsNone(repo_origin)\n      self.assertIsNone(repo_name)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/base-images/base-builder/go_utils.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Adds a fuzzer to a json list stored in $OUT\n# so we can easily check later if a fuzzer\n# is a std lib fuzzer\nadd_to_list_of_native_fuzzers() {\n  local new_element=\"$1\"\n  local file=\"$OUT/native_go_fuzzers.json\"\n\n  if [ -z \"$new_element\" ]; then\n    echo \"Usage: add_to_list \\\"element to add\\\"\"\n    return 1\n  fi\n\n  # Ensure the directory exists\n  if [ ! -d \"$(dirname \"$file\")\" ]; then\n    echo \"Error: Directory $(dirname \"$file\") does not exist.\"\n    return 1\n  fi\n\n  # Initialize the file if it doesn't exist or is empty\n  if [ ! -s \"$file\" ]; then\n    echo \"[]\" > \"$file\"\n  fi\n\n  # Append the new element to the list using jq\n  jq --arg item \"$new_element\" '. += [$item]' \"$file\" > \"$file.tmp\" && mv \"$file.tmp\" \"$file\"\n}\n\n# Save a key-value pair to a JSON file. We use this to\n# store the fuzzer function name with the fuzzer\n# executable name; we need the function name in the\n# coverage build.\nsave_function_name() {\n  local key=\"$1\"\n  local value=\"$2\"\n  local file=\"$3\"\n\n  if [ -z \"$key\" ] || [ -z \"$value\" ] || [ -z \"$file\" ]; then\n    echo \"Usage: save_function_name <key> <value> <file>\"\n    return 1\n  fi\n\n  # If file doesn't exist or is empty, initialize it as empty object\n  if [ ! -s \"$file\" ]; then\n    echo \"{}\" > \"$file\"\n  fi\n\n  # Update or add the key-value pair\n  jq --arg k \"$key\" --arg v \"$value\" '.[$k] = $v' \"$file\" > \"$file.tmp\" && mv \"$file.tmp\" \"$file\"\n}\n\nfunction build_native_go_fuzzer_legacy() {\n\tfuzzer=$1\n\tfunction=$2\n\tpath=$3\n\ttags=\"-tags gofuzz\"\n\n\tif [[ $SANITIZER == *coverage* ]]; then\n\t\tcurrent_dir=$(pwd)\n\t\tmkdir $OUT/rawfuzzers || true\n\t\tcd $abs_file_dir\n\t\tgo test $tags -c -run $fuzzer -o $OUT/$fuzzer -cover\n\t\tcp \"${fuzzer_filename}\" \"${OUT}/rawfuzzers/${fuzzer}\"\n\n\t\tfuzzed_repo=$(go list $tags -f {{.Module}} \"$path\")\n\t\tabspath_repo=`go list -m $tags -f {{.Dir}} $fuzzed_repo || go list $tags -f {{.Dir}} $fuzzed_repo`\n\t\t# give equivalence to absolute paths in another file, as go test -cover uses golangish pkg.Dir\n\t\techo \"s=$fuzzed_repo\"=\"$abspath_repo\"= > $OUT/$fuzzer.gocovpath\n\t\tcd $current_dir\n\telse\n\t\tgo-118-fuzz-build $tags -o $fuzzer.a -func $function $abs_file_dir\n\t\t$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer\n\tfi\n}\n\nfunction build_native_go_fuzzer() {\n\tfuzzer=$1\n\tfunction=$2\n\tabs_path=$3\n\tpackage_path=$4\n\ttags=\"-tags gofuzz\"\n\n\tif [[ $SANITIZER == *coverage* ]]; then\n\t\tfunction_names_file=\"$OUT/fuzzer_function_names.json\"\n\n\t\t# Save the current dir to return later\n\t\tcurrent_dir=$(pwd)\n\t\tfuzzed_repo=$(go list $tags -f {{.Module}} \"$abs_path\")\n\t\tcd $abs_file_dir\n\t\tgo test $tags \\\n\t    -c \\\n\t    -o \"$OUT/$fuzzer\" \\\n\t    -coverpkg=\"$fuzzed_repo/...\" \\\n\t    -covermode=atomic \\\n\t    \"$package_path\"\n\t\tsave_function_name \"$fuzzer\" \"$function\" \"$function_names_file\"\n\n\t\tabspath_repo=`go list -m $tags -f {{.Dir}} $fuzzed_repo || go list $tags -f {{.Dir}} $fuzzed_repo`\n\t\t# give equivalence to absolute paths in another file, as go test -cover uses golangish pkg.Dir\n\t\techo \"s=$fuzzed_repo\"=\"$abspath_repo\"= > $OUT/$fuzzer.gocovpath\n\t\tadd_to_list_of_native_fuzzers \"${fuzzer}\"\n\n\t\t# Store the function signature in $OUT/fuzzer-parameters.json\n\t\t# so we can read it when running helper.py coverage. We need\n\t\t# this to convert corpus to a readable format by the test.\n\t\tconvertLibFuzzerTestcaseToStdLibGo \\\n\t\t  -write-params \\\n\t\t  -file $fuzzer_filename \\\n\t\t  -fuzzer-func $function \\\n\t\t  -fuzzerBinaryName $fuzzer \\\n\t\t  -json-out $OUT/fuzzer-parameters.json\n\t\tcd $current_dir\n\telse\n\t\tgo-118-fuzz-build_v2 $tags -o $fuzzer.a -func $function $abs_file_dir\n\t\t$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer\n\tfi\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/README.md",
    "content": "# Indexer snapshot builds\n\nThis directory provides the tooling to be able to build \"indexed\" OSS-Fuzz\nbuilds, which are snapshots which provide the binary, source code, and a source\ncode index.\n\nSnapshots are also built by our infrastructure and available at\n`gs://clusterfuzz-builds/indexer_indexes`.\n\n## Building project snapshots\n\n```bash\npython infra/helper.py build_image <project>\npython infra/helper.py index <project>\n\n# Only build snapshots for `target1` and `target2`.\npython infra/helper.py index --targets 'target1,target2' <project>\n\n# Drop into /bin/bash instead of automatically running /opt/indexer/index_build.py.\npython infra/helper.py index --shell <project>\n\n# Add additional docker args.\npython infra/helper.py index --docker_arg=\"-eFOO=123\" --docker_arg=\"-eBAR=456\" <project>\n\n# Pass through flags to the entrypoint.\npython infra/helper.py index <project> -- --target-args '123'\n```\n\nThe resulting snapshots will be found in `<oss-fuzz checkout>/build/out/<project>`.\n\n## Development\n\nFor faster local development on the scripts in this directory, we can mount in\neverything inside this directory to overwrite the scripts in the base image by\npassing `--dev` to the index command.\n\nIf the `indexer` binary does not exist, a prebuilt binary is\n[downloaded](https://clusterfuzz-builds.storage.googleapis.com/oss-fuzz-artifacts/indexer).\n\n```\ncd $OSS_FUZZ_CHECKOUT\npython infra/helper.py index --dev <PROJECT_NAME>\n```\n\nThe resulting snapshots will be found in `<oss-fuzz checkout>/build/out/<project>`.\n\n## Testing\n\nWe have some basic tests to make sure the snapshots we're generating have the correct format.\n\nFor this to work, you need to run `python infra/helper.py index --dev <PROJECT_NAME>` at least\nonce, or make sure you have the `indexer` binary in this directory.\n\n```\nsudo INDEX_BUILD_TESTS=1 python3 -m unittest index_build_test\n```\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/clang_wrapper.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Compiler Wrapper.\n\nThis is copied into the OSS-Fuzz container image and run there as part of the\ninstrumentation process.\n\"\"\"\n\nfrom collections.abc import Iterator, MutableSequence, Sequence\nimport contextlib\nimport dataclasses\nimport fcntl\nimport hashlib\nimport json\nimport os\nfrom pathlib import Path  # pylint: disable=g-importing-member\nimport shlex\nimport shutil\nimport subprocess\nimport sys\nimport time\nfrom typing import Any, Iterable, Set\n\nimport dwarf_info\nimport index_build\n\n_LLVM_READELF_PATH = \"/usr/local/bin/llvm-readelf\"\n_INDEXER_PATH = \"/opt/indexer/indexer\"\n_IGNORED_DEPS_PATH = os.path.join(\n    os.path.dirname(_INDEXER_PATH), \"ignored_deps.json\"\n)\n\n_INTERNAL_PATHS = (\"/src/llvm-project/\",)\n\n# When we notice a project using these flags,\n# we should figure out how to handle them.\n_DISALLOWED_CLANG_FLAGS = (\n    \"-fdebug-prefix-map=\",\n    \"-ffile-prefix-map=\",\n)\n\n# Chromium GN builds use these flags with a period to make paths relative to\n# the out directory. This is OK.\n_ALLOWED_CLANG_FLAGS_ONLY_WITH_PERIOD = (\n    \"-fdebug-compilation-dir=\",\n    \"-ffile-compilation-dir=\",\n)\n\n_IGNORED_FILES = (\n    # This file seems to cause a crash in the indexer, as well as performance\n    # issues.\n    \"simdutf.cpp\",\n)\n\n_INDEXER_THREADS_PER_MERGE_QUEUE = 16\n_INDEXER_PER_THREAD_MEMORY = 2 * 1024**3  # 2 GiB\n\n_CDB_FRAGMENT_DELIMITER = \",\\n\"\n\nSRC = Path(os.getenv(\"SRC\", \"/src\"))\n# On OSS-Fuzz build infra, $OUT is not /out.\nOUT = Path(os.getenv(\"OUT\", \"/out\"))\nINDEXES_PATH = Path(os.getenv(\"INDEXES_PATH\", \"/indexes\"))\nFUZZER_ENGINE = os.getenv(\"LIB_FUZZING_ENGINE\", \"/usr/lib/libFuzzingEngine.a\")\n\n\ndef _get_available_memory() -> int:\n  \"\"\"Returns the available memory in bytes.\"\"\"\n  with open(\"/proc/meminfo\", \"r\") as f:\n    for line in f:\n      if line.startswith(\"MemAvailable:\"):\n        return int(line.split()[1]) * 1024\n\n  raise RuntimeError(\"Failed to get available memory\")\n\n\ndef rewrite_argv0(argv: Sequence[str], clang_toolchain: str) -> list[str]:\n  \"\"\"Rewrite argv[0] to point to the real clang location.\"\"\"\n  # We do this because we've set PATH to our wrapper.\n  rewritten = [os.path.join(clang_toolchain, \"bin\", os.path.basename(argv[0]))]\n  rewritten.extend(argv[1:])\n  return rewritten\n\n\ndef execute(argv: Sequence[str], clang_toolchain: str) -> None:\n  argv = rewrite_argv0(argv, clang_toolchain)\n  print(\"About to execute...\", argv)\n  os.execv(argv[0], tuple(argv))\n\n\ndef run(argv: Sequence[str], clang_toolchain: str) -> None:\n  argv = rewrite_argv0(argv, clang_toolchain)\n  print(\"About to run...\", argv)\n  ret = subprocess.run(argv, check=False)\n  if ret.returncode != 0:\n    sys.exit(ret.returncode)\n\n\ndef sha256(file: Path) -> str:\n  hash_value = hashlib.sha256()\n  with open(file, \"rb\") as f:\n    # We can't use hashlib.file_digest here because OSS-Fuzz is still on\n    # Python 3.10.\n    for chunk in iter(lambda: f.read(4096), b\"\"):\n      hash_value.update(chunk)\n  return hash_value.hexdigest()\n\n\ndef get_flag_value(argv: Sequence[str], flag: str) -> str | None:\n  for i in range(len(argv) - 1):\n    if argv[i] == flag:\n      return argv[i + 1]\n    elif flag == \"-o\" and argv[i].startswith(flag):\n      return argv[i][2:]\n  return None\n\n\ndef remove_flag_if_present(argv: Iterable[str], flag: str) -> list[str]:\n  return [arg for arg in argv if arg != flag]\n\n\ndef remove_flag_and_value(argv: list[str], flag: str) -> list[str] | None:\n  \"\"\"Removes a flag and its value (as a separate token, --a=b not supported.)\"\"\"\n  for i in range(len(argv) - 1):\n    if argv[i] == flag:\n      return argv[:i] + argv[i + 2 :]\n  return argv\n\n\ndef parse_dependency_file(\n    file_path: Path, output_file: Path, ignored_deps: frozenset[str]\n) -> Sequence[str]:\n  \"\"\"Parses the dependency file generated by the linker.\"\"\"\n  output_file = output_file.resolve()\n  with file_path.open(\"r\") as f:\n    lines = [line.strip() for line in f]\n\n  # The first line should have the format \"/path/to/file: \\\"\n  # Make sure the binary name matches.\n  if output_file.name != Path(lines[0].split(\":\")[0].strip()).name:\n    raise RuntimeError(\n        f\"dependency file has invalid first line: {lines[0]}. \"\n        f\"Expected to see {output_file.name}.\"\n    )\n\n  deps = []\n  ignored_dep_paths = [\"/usr\", \"/clang\", \"/lib\"]\n  for line in lines[1:]:\n    if not line:\n      break\n    if line.endswith(\" \\\\\"):\n      line = line[:-2]\n    dep = os.path.realpath(line)\n    # We don\"t care about system-wide dependencies.\n    if any([True for p in ignored_dep_paths if dep.startswith(p)]):\n      continue\n    if dep in ignored_deps:\n      continue\n    deps.append(dep)\n  return deps\n\n\ndef files_by_creation_time(folder_path: Path) -> Sequence[Path]:\n  files = [path for path in folder_path.iterdir() if path.is_file()]\n  files.sort(key=os.path.getctime)\n  return files\n\n\ndef _wait_for_cdb_fragment(file: Path) -> Sequence[str]:\n  \"\"\"Returns the CDB fragment from the given file, waiting if needed.\"\"\"\n  num_retries = 3\n  for i in range(1 + num_retries):\n    data = file.read_text()\n    if data.endswith(_CDB_FRAGMENT_DELIMITER):\n      return data.split(_CDB_FRAGMENT_DELIMITER)[:-1]\n\n    if i < num_retries:\n      print(\n          f\"WARNING: CDB fragment {file} appears to be invalid: {data}, \"\n          f\"sleeping for 2^{i+1} seconds before retrying.\",\n          file=sys.stderr,\n      )\n      time.sleep(2 ** (i + 1))\n    else:\n      error = f\"CDB fragment {file} is invalid even after retries: {data}\"\n      if \"test.c\" in file.name or \"conftest.c\" in file.name:\n        # Some build systems seem to have a weird issue where the autotools\n        # generated `test.c` or `conftest.c` for testing compilers doesn't\n        # result in valid cdb fragments.\n        print(f\"WARNING: {error}\", file=sys.stderr)\n      else:\n        raise RuntimeError(error)\n\n  return ()\n\n\ndef read_cdb_fragments(cdb_path: Path) -> Any:\n  \"\"\"Iterates through the CDB fragments to reconstruct the compile commands.\"\"\"\n  files = files_by_creation_time(cdb_path)\n  contents = []\n  for file in files:\n    # Don't read previously generated linker commands files.\n    if file.name.endswith(\"_linker_commands.json\"):\n      continue\n    if not file.name.endswith(\".json\"):\n      continue\n\n    fragments = _wait_for_cdb_fragment(file)\n    contents.extend(fragments)\n\n  contents = _CDB_FRAGMENT_DELIMITER.join(contents)\n  contents = \"[\" + contents + \"]\"\n  return json.loads(contents)\n\n\ndef _index_dir_path(output_file: Path) -> Path:\n  \"\"\"Returns the path to the index directory for the given output binary.\"\"\"\n  # This mirrors the absolute path of the output file.\n  absolute_path = (Path(os.getcwd()) / output_file).resolve()\n  return INDEXES_PATH / absolute_path.relative_to(\"/\")\n\n\ndef run_indexer(\n    output_file: Path,\n    build_id: str,\n    linker_commands: dict[str, Any],\n    allow_errors: bool = False,\n):\n  \"\"\"Run the indexer.\"\"\"\n\n  # Use a build-specific compile commands directory, since there could be\n  # parallel linking happening at the same time.\n  compile_commands_dir = INDEXES_PATH / f\"compile_commands_{build_id}\"\n  try:\n    compile_commands_dir.mkdir(exist_ok=False)\n  except FileExistsError:\n    # Somehow we've already seen this link command, don't try to redo the\n    # indexing.\n    # TODO: check if this is the safest behaviour.\n    print(\n        f\"WARNING: Compile commands directory {compile_commands_dir} \"\n        \"already created.\",\n        file=sys.stderr,\n    )\n    return\n\n  # Indexes can be built incrementally, so use the same directory for each\n  # output binary.\n\n  index_dir = _index_dir_path(output_file)\n  index_dir.mkdir(parents=True, exist_ok=True)\n\n  # Symlink by build ID, because `index_build.py` relies on build IDs to match\n  # the binaries (which may have moved around) to indexes.\n  build_id_symlink = INDEXES_PATH / build_id\n  if not build_id_symlink.exists():\n    os.symlink(index_dir, build_id_symlink)\n\n  if not linker_commands[\"compile_commands\"]:\n    # Nothing to index.\n    return\n\n  with (compile_commands_dir / \"compile_commands.json\").open(\"wt\") as f:\n    json.dump(linker_commands[\"compile_commands\"], f, indent=2)\n\n  with (compile_commands_dir / \"full_compile_commands.json\").open(\"wt\") as f:\n    json.dump(linker_commands[\"full_compile_commands\"], f, indent=2)\n\n  # Auto-tune the number of threads and merge queues according to the number\n  # of cores and available memory.\n  # Note: this might require further tuning -- this might not work well if there\n  # are multiple binaries being linked/indexed at the same time.\n  num_cores = len(os.sched_getaffinity(0))\n  num_threads = max(\n      1, min(_get_available_memory() // _INDEXER_PER_THREAD_MEMORY, num_cores)\n  )\n  merge_queues = max(1, num_threads // _INDEXER_THREADS_PER_MERGE_QUEUE)\n\n  # TODO: b/447468859 - Use database_only once users are ready.\n  cmd = [\n      _INDEXER_PATH,\n      \"--build_dir\",\n      compile_commands_dir,\n      \"--index_dir\",\n      index_dir.as_posix(),\n      \"--source_dir\",\n      SRC.as_posix(),\n      \"--index_threads\",\n      str(num_threads),\n      \"--merge_queues\",\n      str(merge_queues),\n  ]\n\n  if (index_dir / \"db.sqlite\").exists():\n    cmd.append(\"--delta\")\n\n  if allow_errors:\n    cmd.append(\"--ignore_indexing_errors\")\n\n  result = subprocess.run(cmd, check=False, capture_output=True)\n  if result.returncode != 0:\n    raise RuntimeError(\n        \"Running indexer failed\\n\"\n        f\"stdout:\\n```\\n{result.stdout.decode()}\\n```\\n\"\n        f\"stderr:\\n```\\n{result.stderr.decode()}\\n```\\n\"\n    )\n\n\ndef check_fuzzing_engine_and_fix_argv(argv: MutableSequence[str]) -> bool:\n  \"\"\"Check if this command is linking in a fuzzing engine.\"\"\"\n  # Also fix up incorrect link flags so we link in the correct fuzzing\n  # engine.\n  fuzzing_engine_in_argv = False\n  idx = 0\n  for arg in argv[:]:\n    if arg == \"-fsanitize=fuzzer\":\n      argv[idx] = \"-lFuzzingEngine\"\n      fuzzing_engine_in_argv = True\n    elif arg == \"-fsanitize=fuzzer-no-link\":\n      argv.remove(\"-fsanitize=fuzzer-no-link\")\n      idx -= 1\n    elif arg.startswith(\"-fsanitize=\"):\n      # This could be -fsanitize=address,fuzzer.\n      sanitize_vals = arg.split(\"=\")[1].split(\",\")\n      if \"fuzzer\" in sanitize_vals:\n        sanitize_vals.remove(\"fuzzer\")\n        arg = \"-fsanitize=\" + \",\".join(sanitize_vals)\n        fuzzing_engine_in_argv = True\n      elif \"fuzzer-no-link\" in sanitize_vals:\n        sanitize_vals.remove(\"fuzzer-no-link\")\n        arg = \"-fsanitize=\" + \",\".join(sanitize_vals)\n      argv[idx] = arg\n\n      if fuzzing_engine_in_argv:\n        idx += 1\n        argv.insert(idx, \"-lFuzzingEngine\")\n\n    idx += 1\n\n    if \"libFuzzingEngine.a\" in arg or \"-lFuzzingEngine\" in arg:\n      fuzzing_engine_in_argv = True\n\n  return fuzzing_engine_in_argv\n\n\ndef _has_disallowed_clang_flags(argv: Sequence[str]) -> bool:\n  \"\"\"Checks if the command line arguments contain disallowed flags.\"\"\"\n  if any(arg.startswith(_DISALLOWED_CLANG_FLAGS) for arg in argv):\n    return True\n\n  if any(\n      arg.startswith(_ALLOWED_CLANG_FLAGS_ONLY_WITH_PERIOD)\n      and not arg.endswith(\"=.\")\n      for arg in argv\n  ):\n    return True\n\n  return False\n\n\n@dataclasses.dataclass(frozen=True)\nclass FilteredCompileCommands:\n  filtered_compile_commands: Sequence[dict[str, str]]\n  unused_cu_paths: Set[Path]\n  unused_cc_paths: Set[Path]\n\n\ndef _filter_compile_commands(\n    elf_path: Path, compile_commands: Sequence[dict[str, str]]\n) -> FilteredCompileCommands:\n  \"\"\"Extracts compile commands from the DWARF information of an ELF file.\n\n  Args:\n    elf_path: The path to the ELF file.\n    compile_commands: The compile commands to filter.\n\n  Returns:\n    The filtered compile commands.\n  \"\"\"\n  compilation_units = dwarf_info.get_all_compilation_units(elf_path)\n  cu_paths = set([Path(cu.compdir) / cu.name for cu in compilation_units])\n  used_cu_paths = set()\n  filtered_compile_commands = []\n  unused_cc_paths = set()\n\n  for compile_command in compile_commands:\n    if (\n        \"-ffile-compilation-dir=.\" in compile_command[\"arguments\"]\n        or \"-fdebug-compilation-dir=.\" in compile_command[\"arguments\"]\n    ):\n      # Handle build systems that make their debug paths relative.\n      directory = Path(\".\")\n    else:\n      directory = Path(compile_command[\"directory\"])\n\n    cc_path = Path(directory / compile_command[\"file\"])\n    if cc_path in cu_paths and cc_path.name not in _IGNORED_FILES:\n      filtered_compile_commands.append(compile_command)\n      used_cu_paths.add(cc_path)\n    else:\n      unused_cc_paths.add(cc_path)\n\n  unused_cu_paths = cu_paths - used_cu_paths\n\n  return FilteredCompileCommands(\n      filtered_compile_commands=filtered_compile_commands,\n      unused_cu_paths=unused_cu_paths,\n      unused_cc_paths=unused_cc_paths,\n  )\n\n\ndef _write_filter_log(\n    filter_log_file: Path,\n    filtered_compile_commands: FilteredCompileCommands,\n) -> None:\n  \"\"\"Writes the filter log file.\"\"\"\n  with open(filter_log_file, \"wt\") as f:\n    f.write(\"The following files were not used in the final binary:\\n\")\n    for cc_path in sorted(filtered_compile_commands.unused_cc_paths):\n      f.write(f\"\\t{cc_path}\\n\")\n\n    f.write(\n        \"The following compilation units were not matched with any compile\"\n        \" commands:\\n\"\n    )\n    for cu_path in sorted(filtered_compile_commands.unused_cu_paths):\n      if cu_path.as_posix().startswith(_INTERNAL_PATHS):\n        continue\n      f.write(f\"\\t{cu_path}\\n\")\n\n\ndef expand_rsp_file(argv: Sequence[str]) -> list[str]:\n  # https://llvm.org/docs/CommandLine.html#response-files\n  expanded = []\n  for arg in argv:\n    if arg.startswith(\"@\"):\n      with open(arg[1:], \"r\") as f:\n        expanded_args = shlex.split(f.read())\n      expanded.extend(expanded_args)\n    else:\n      expanded.append(arg)\n\n  return expanded\n\n\ndef force_optimization_flag(argv: Sequence[str]) -> list[str]:\n  \"\"\"Forces -O0 in the given argument list.\"\"\"\n  args = []\n  for arg in argv:\n    if arg.startswith(\"-O\") and arg != \"-O0\":\n      arg = \"-O0\"\n\n    args.append(arg)\n\n  return args\n\n\ndef fix_coverage_flags(\n    argv: Sequence[str], expected_coverage_flags: str\n) -> list[str]:\n  \"\"\"Makes sure that the right coverage flags are set.\"\"\"\n  args = []\n  for arg in argv:\n    # Some projects use -fsanitize-coverage-allowlist/ignorelist to optimize\n    # fuzzing feedback. For the indexer case, we would prefer to have all code\n    # instrumented, so we remove these flags.\n    # Some projects hardcode -fsanitize-coverage= options that cause conflicts\n    # with our indexer / tracer options.\n    if (arg.startswith(\"-fsanitize-coverage-allowlist=\") or\n        arg.startswith(\"-fsanitize-coverage-ignorelist=\") or\n        arg.startswith(\"-fsanitize-coverage=\")):\n      continue\n\n    args.append(arg)\n\n  args.append(expected_coverage_flags)\n  return args\n\n\n@contextlib.contextmanager\ndef _file_lock(lock_path: Path):\n  \"\"\"Context manager for acquiring an exclusive file lock.\"\"\"\n  fd = os.open(lock_path.as_posix(), os.O_CREAT | os.O_RDWR)\n  fcntl.flock(fd, fcntl.LOCK_EX)\n\n  try:\n    yield\n  finally:\n    fcntl.flock(fd, fcntl.LOCK_UN)\n    os.close(fd)\n\n\ndef merge_incremental_cdb(cdb_path: Path, merged_cdb_path: Path) -> None:\n  \"\"\"Merges new CDB fragments into the incremental CDB.\"\"\"\n  # Map of output file to the path of the file in the incremental CDB.\n  # Use the output file path as the key for merging.\n  existing_output_files: dict[Path, Path] = {}\n\n  def load_cdbs(directory: Path) -> Iterator[tuple[Path, dict[str, Any]]]:\n    for file in directory.iterdir():\n      if file.suffix != \".json\":\n        continue\n\n      if file.name.endswith(\"_linker_commands.json\"):\n        continue\n\n      fragments_data = _wait_for_cdb_fragment(file)\n      for fragment_data in fragments_data:\n        fragment = json.loads(fragment_data)\n        if \"output\" not in fragment:\n          continue\n\n        yield file, fragment\n\n  # We could be running multiple linking steps in parallel, so serialize merges.\n  with _file_lock(merged_cdb_path / \".lock\"):\n    # Load existing CDB fragments, and build the map of output file -> fragment.\n    for file, fragment in load_cdbs(merged_cdb_path):\n      output_path = Path(fragment[\"directory\"]) / fragment[\"output\"]\n      existing_output_files[output_path] = file\n\n    # Load new CDB fragments, replacing existing fragments for the same output\n    # file.\n    for file, fragment in load_cdbs(cdb_path):\n      output_path = Path(fragment[\"directory\"]) / fragment[\"output\"]\n\n      if output_path in existing_output_files:\n        # Remove existing entry for the output file.\n        os.unlink(existing_output_files[output_path])\n        del existing_output_files[output_path]\n\n      shutil.copy2(file, merged_cdb_path / file.name)\n\n\ndef main(argv: list[str]) -> None:\n  compile_settings = index_build.read_compile_settings()\n  argv = expand_rsp_file(argv)\n  argv = remove_flag_if_present(argv, \"-gline-tables-only\")\n  argv = force_optimization_flag(argv)\n  argv = fix_coverage_flags(argv, compile_settings.coverage_flags)\n\n  if _has_disallowed_clang_flags(argv):\n    raise ValueError(\"Disallowed clang flags found, aborting.\")\n\n  # TODO: b/441872725 - Migrate more flags to be appended in the clang wrapper\n  # instead.\n  cdb_path = index_build.OUT / \"cdb\"\n  argv.extend((\"-gen-cdb-fragment-path\", cdb_path.as_posix()))\n  argv.extend((\n      \"-isystem\",\n      (\n          f\"{compile_settings.clang_toolchain}/lib/clang/\"\n          f\"{compile_settings.clang_version}\"\n      ),\n      \"-resource-dir\",\n      (\n          f\"{compile_settings.clang_toolchain}/lib/clang/\"\n          f\"{compile_settings.clang_version}\"\n      ),\n  ))\n\n  if \"-E\" in argv:\n    # Preprocessor-only invocation.\n    modified_argv = remove_flag_and_value(argv, \"-gen-cdb-fragment-path\")\n    execute(modified_argv, compile_settings.clang_toolchain)\n\n  fuzzing_engine_in_argv = check_fuzzing_engine_and_fix_argv(argv)\n  indexer_targets: list[str] = [\n      t for t in os.getenv(\"INDEXER_TARGETS\", \"\").split(\",\") if t\n  ]\n\n  # If we are linking, collect the relevant flags and dependencies.\n  output_file = get_flag_value(argv, \"-o\")\n  if not output_file:\n    execute(argv, compile_settings.clang_toolchain)  # Missing output file\n\n  output_file = Path(output_file)\n\n  if output_file.name.endswith(\".o\"):\n    execute(argv, compile_settings.clang_toolchain)  # Not a real linker command\n\n  if indexer_targets:\n    if output_file.name not in indexer_targets:\n      # Not a relevant linker command\n      print(f\"Not indexing as {output_file} is not in the allowlist\")\n      execute(argv, compile_settings.clang_toolchain)\n  elif not fuzzing_engine_in_argv:\n    # Not a fuzz target.\n    execute(argv, compile_settings.clang_toolchain)\n\n  print(f\"Linking {argv}\")\n\n  # We can now run the linker and look at the output of some files.\n  dependency_file = (cdb_path / output_file.name).with_suffix(\".deps\")\n  why_extract_file = (cdb_path / output_file.name).with_suffix(\".why_extract\")\n  argv.append(\"-fuse-ld=lld\")\n  argv.append(f\"-Wl,--dependency-file={dependency_file}\")\n  argv.append(f\"-Wl,--why-extract={why_extract_file}\")\n  argv.append(\"-Wl,--build-id\")\n  # We force lld, but it doesn't include this dir by default.\n  argv.append(\"-L/usr/local/lib\")\n  argv.append(\"-Qunused-arguments\")\n\n  if compile_settings.coverage_flags == index_build.TRACING_COVERAGE_FLAGS:\n    argv.append(\"/opt/indexer/coverage.o\")\n\n  run(argv, compile_settings.clang_toolchain)\n\n  build_id = index_build.get_build_id(output_file)\n  assert build_id is not None\n\n  output_hash = sha256(output_file)\n\n  with open(_IGNORED_DEPS_PATH) as f:\n    ignored_deps = frozenset(json.load(f)[\"deps\"])\n\n  deps = parse_dependency_file(dependency_file, output_file, ignored_deps)\n  obj_deps = [dep for dep in deps if dep.endswith(\".o\")]\n  ar_deps = [dep for dep in deps if dep.endswith(\".a\") and dep != FUZZER_ENGINE]\n  archive_deps = []\n  for archive in ar_deps:\n    res = subprocess.run([\"ar\", \"-t\", archive], capture_output=True, check=True)\n    archive_deps += [dep.decode() for dep in res.stdout.splitlines()]\n\n  # Incremental index building relies on merging all new compilation fragments\n  # since the initial indexing.\n  cdb_fragments_dir = cdb_path\n  if _index_dir_path(output_file).exists():\n    merge_incremental_cdb(cdb_path, index_build.INCREMENTAL_CDB_PATH)\n    cdb_fragments_dir = index_build.INCREMENTAL_CDB_PATH\n\n  # We only care about the compile commands that emitted an output file.\n  full_compile_commands = [\n      cc for cc in read_cdb_fragments(cdb_fragments_dir) if \"output\" in cc\n  ]\n\n  # Discard compile commands that didn't end up in the final binary.\n  filtered_compile_commands = _filter_compile_commands(\n      output_file, full_compile_commands\n  )\n\n  linker_commands = {\n      \"output\": output_file.as_posix(),\n      \"directory\": os.getcwd(),\n      \"deps\": obj_deps + archive_deps,\n      \"args\": argv,\n      \"sha256\": output_hash,\n      \"gnu_build_id\": build_id,\n      \"compile_commands\": filtered_compile_commands.filtered_compile_commands,\n      \"full_compile_commands\": full_compile_commands,\n  }\n\n  filter_log_file = Path(cdb_path) / f\"{build_id}_filter_log.txt\"\n  _write_filter_log(filter_log_file, filtered_compile_commands)\n\n  if not os.getenv(\"INDEXER_BINARIES_ONLY\"):\n    is_custom_toolchain = (\n        compile_settings.clang_toolchain != index_build.DEFAULT_CLANG_TOOLCHAIN\n    )\n\n    run_indexer(\n        output_file, build_id, linker_commands, allow_errors=is_custom_toolchain\n    )\n\n  linker_commands = json.dumps(linker_commands)\n  commands_path = Path(cdb_path) / f\"{build_id}_linker_commands.json\"\n  commands_path.write_text(linker_commands)\n\n\nif __name__ == \"__main__\":\n  main(sys.argv)\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/clang_wrapper_test.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"clang_wrapper tests.\"\"\"\n\nimport json\nimport pathlib\n\nimport clang_wrapper\nimport unittest\n\n\nclass ClangWrapperTest(unittest.TestCase):\n\n  def test_force_optimization_flag_no_optimization(self):\n    \"\"\"Tests that optimization flags are not forced when not present.\"\"\"\n    argv = [\"clang\", \"-c\", \"test.c\", \"-o\", \"test.o\"]\n    modified_argv = clang_wrapper.force_optimization_flag(argv)\n    self.assertCountEqual(modified_argv, argv)\n\n  def test_force_optimization_flag(self):\n    \"\"\"Tests that optimization flags are forced when present.\"\"\"\n    argv = [\"clang\", \"-O2\", \"-c\", \"test.c\", \"-o\", \"test.o\", \"-O1\"]\n    modified_argv = clang_wrapper.force_optimization_flag(argv)\n    self.assertCountEqual(\n        modified_argv, [\"clang\", \"-O0\", \"-c\", \"test.c\", \"-o\", \"test.o\", \"-O0\"]\n    )\n\n  def test_remove_invalid_coverage_flags(self):\n    \"\"\"Tests that invalid coverage flags are removed.\"\"\"\n    argv = [\n        \"clang\",\n        \"-foo\",\n        \"-fsanitize-coverage-allowlist=allowlist\",\n        \"-fsanitize-coverage-ignorelist=ignorelist\",\n        \"-fsanitize-coverage=edge\",\n        \"-c\",\n        \"test.c\",\n    ]\n    modified_argv = clang_wrapper.fix_coverage_flags(\n        argv, \"-fsanitize-coverage=bb,no-prune,trace-pc-guard\"\n    )\n    self.assertCountEqual(\n        modified_argv,\n        [\n            \"clang\",\n            \"-foo\",\n            \"-c\",\n            \"test.c\",\n            \"-fsanitize-coverage=bb,no-prune,trace-pc-guard\",\n        ],\n    )\n\n  def test_merge_incremental_cdb(self):\n    \"\"\"Tests that incremental cdb is merged correctly.\"\"\"\n    cdb_path = pathlib.Path(self.create_tempdir().full_path)\n    merged_cdb_path = pathlib.Path(self.create_tempdir().full_path)\n\n    old_cdb_fragments = {\n        \"test.c.123.json\": {\n            \"directory\": \"/build\",\n            \"file\": \"test.c\",\n            \"output\": \"test.o\",\n            \"arguments\": [\"-c\", \"test.c\"],\n        },\n        \"test.c.455.json\": {\n            \"directory\": \"/build/subdir\",\n            \"file\": \"test.c\",\n            \"output\": \"test.o\",\n            \"arguments\": [\"-c\", \"test.c\"],\n        },\n        \"foo.c.455.json\": {\n            \"directory\": \"/build\",\n            \"file\": \"foo.c\",\n            \"output\": \"foo.o\",\n            \"arguments\": [\"-c\", \"foo.c\"],\n        },\n        \"foo.123_linker_commands.json\": {\"invalid\": \"foo\"},\n    }\n\n    new_cdb_fragments = {\n        \"test.c.aaa.json\": [{\n            \"directory\": \"/build/subdir\",\n            \"file\": \"test.c\",\n            \"output\": \"test.o\",\n            \"arguments\": [\"-c\", \"test.c\"],\n        }],\n        \"bar.c.bbb.json\": [\n            {\n                \"directory\": \"/build/subdir\",\n                \"file\": \"bar.c\",\n                \"output\": \"bar.o\",\n                \"arguments\": [\"-c\", \"bar.c\"],\n            },\n            {\n                \"directory\": \"/build/subdir\",\n                \"file\": \"bar2.c\",\n                \"output\": \"bar2.o\",\n                \"arguments\": [\"-c\", \"bar2.c\"],\n            },\n        ],\n    }\n\n    for cdb_fragment_path, cdb_fragment in old_cdb_fragments.items():\n      suffix = (\n          \",\\n\"\n          if not cdb_fragment_path.endswith(\"_linker_commands.json\")\n          else \"\"\n      )\n      (merged_cdb_path / cdb_fragment_path).write_text(\n          json.dumps(cdb_fragment) + suffix\n      )\n\n    for cdb_fragment_path, cdb_fragment in new_cdb_fragments.items():\n      (cdb_path / cdb_fragment_path).write_text(\n          \",\\n\".join([json.dumps(frag) for frag in cdb_fragment]) + \",\\n\"\n      )\n\n    (cdb_path / \"not_a_json\").write_text(\"not a json\")\n\n    clang_wrapper.merge_incremental_cdb(cdb_path, merged_cdb_path)\n\n    self.assertCountEqual(\n        merged_cdb_path.iterdir(),\n        [\n            pathlib.Path(merged_cdb_path) / \".lock\",\n            pathlib.Path(merged_cdb_path) / \"test.c.123.json\",\n            pathlib.Path(merged_cdb_path) / \"test.c.aaa.json\",\n            pathlib.Path(merged_cdb_path) / \"foo.c.455.json\",\n            pathlib.Path(merged_cdb_path) / \"foo.123_linker_commands.json\",\n            pathlib.Path(merged_cdb_path) / \"bar.c.bbb.json\",\n        ],\n    )\n\n  def test_merge_incremental_cdb_duplicate_outputs(self):\n    \"\"\"Tests that incremental cdb is merged correctly with duplicate outputs.\"\"\"\n    cdb_path = pathlib.Path(self.create_tempdir().full_path)\n    merged_cdb_path = pathlib.Path(self.create_tempdir().full_path)\n\n    fragment1 = {\n        \"directory\": \"/build\",\n        \"file\": \"test.c\",\n        \"output\": \"test.o\",\n    }\n    (merged_cdb_path / \"1.json\").write_text(json.dumps(fragment1) + \",\\n\")\n\n    fragment2 = {\n        \"directory\": \"/build\",\n        \"file\": \"test.c\",\n        \"output\": \"test.o\",\n    }\n    (cdb_path / \"2.json\").write_text(json.dumps(fragment2) + \",\\n\")\n    (cdb_path / \"3.json\").write_text(json.dumps(fragment2) + \",\\n\")\n\n    clang_wrapper.merge_incremental_cdb(cdb_path, merged_cdb_path)\n\n    self.assertCountEqual(\n        merged_cdb_path.iterdir(),\n        [\n            merged_cdb_path / \".lock\",\n            merged_cdb_path / \"2.json\",\n            merged_cdb_path / \"3.json\",\n        ],\n    )\n    self.assertFalse((merged_cdb_path / \"1.json\").exists())\n\n\nif __name__ == \"__main__\":\n  unittest.main()\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/coverage.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fcntl.h>\n#include <sanitizer/common_interface_defs.h>\n#include <sanitizer/coverage_interface.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n#include <sys/syscall.h>\n#include <unistd.h>\n\nnamespace {\n\nconstexpr int kMaxTraceSize = 64 * 1024;\n\nstruct CoverageData {\n  void* pcs[kMaxTraceSize];\n  size_t idx;\n  // TODO: b/441647761 - Handle multiple threads.\n  pid_t main_thread_id;\n  bool finished;\n};\n\nstatic CoverageData* coverage_data;\n\nbool IsStandardLibrary(const char* file_path) {\n  return (strstr(file_path, \"include/c++/v1\") ||\n          strstr(file_path, \"src/libcxx/include\") ||\n          strstr(file_path, \"src/libcxx/staging/include\") ||\n          strncmp(file_path, \"/usr/include\", 12) == 0 ||\n          strstr(file_path, \"libc++/src/include\") ||\n          strstr(file_path, \"/absl/\"));\n}\n\nvoid WriteTrace() {\n  coverage_data->finished = true;\n  char* trace_dump_file = getenv(\"TRACE_DUMP_FILE\");\n  if (!trace_dump_file) {\n    return;\n  }\n\n  int fd = open(trace_dump_file, O_WRONLY | O_CREAT | O_TRUNC, 0644);\n  if (fd == -1) {\n    perror(\"open\");\n    exit(EXIT_FAILURE);\n  }\n\n  // TODO: b/441647761 - This format likely needs iteration. This just prints\n  // symbolized function names, but this could still be ambiguous.\n  for (size_t i = 0; i < coverage_data->idx; ++i) {\n    char symbol[1024];\n    char file_path[1024];\n\n    // This always null terminates.\n    __sanitizer_symbolize_pc(coverage_data->pcs[i], \"%f\", symbol,\n                             sizeof(symbol));\n    __sanitizer_symbolize_pc(coverage_data->pcs[i], \"%s\", file_path,\n                             sizeof(file_path));\n\n    if (IsStandardLibrary(file_path)) continue;\n\n    write(fd, symbol, strlen(symbol));\n    write(fd, \"\\n\", 1);\n  }\n\n  close(fd);\n}\n\npid_t GetTID() { return static_cast<pid_t>(syscall(SYS_gettid)); }\n\nvoid Init() {\n  coverage_data = static_cast<CoverageData*>(malloc(sizeof(CoverageData)));\n  coverage_data->finished = false;\n  coverage_data->idx = 0;\n  // For now, only record PCs from the main thread.\n  coverage_data->main_thread_id = GetTID();\n  // Dump coverage on exit.\n  atexit(WriteTrace);\n  __sanitizer_set_death_callback(WriteTrace);\n}\n\n}  // namespace\n\nextern \"C\" void __sanitizer_cov_trace_pc_guard_init(uint32_t* start,\n                                                    uint32_t* stop) {\n  Init();\n  static uint32_t N;  // Counter for the guards.\n  if (start == stop || *start) return;\n  for (uint32_t* x = start; x < stop; x++) *x = ++N;\n}\n\nextern \"C\" void __sanitizer_cov_trace_pc_guard(uint32_t* guard) {\n  thread_local bool in_callback = false;\n\n  if (!coverage_data || coverage_data->finished) return;\n  if (*guard == 0) return;\n  if (in_callback) return;\n  in_callback = true;\n\n  class ResetInCallback {\n   public:\n    ~ResetInCallback() { in_callback = false; }\n  } reset_in_callback;\n\n  thread_local pid_t thread_id = GetTID();\n  if (thread_id != coverage_data->main_thread_id) {\n    return;\n  }\n\n  if (coverage_data->idx >= kMaxTraceSize) {\n    return;\n  }\n\n  *guard = 0;  // Don't trace the same PC more than once.\n  coverage_data->pcs[coverage_data->idx++] =\n      reinterpret_cast<void*>(__builtin_return_address(0));\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/dwarf_info.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"DWARF info parser for ELF files.\"\"\"\n\nimport dataclasses\nimport io\nimport os\nfrom typing import Sequence\n\nfrom absl import logging\nfrom elftools.elf import elffile\n\n_IGNORED_UNIT_TYPES = (\"DW_UT_type\", \"DW_UT_split_type\")\n\n\n@dataclasses.dataclass\nclass CompilationUnit:\n  \"\"\"Represents a DWARF compilation unit.\n\n  Attributes:\n    producer: The producer of the compilation unit.\n    name: The name of the compilation unit.\n    compdir: The compilation directory of the compilation unit.\n    language: The language of the compilation unit.\n    apple_flags: Flags used in the compilation unit (if compiled with `-glldb`).\n    isysroot: The isysroot of the compilation unit.\n  \"\"\"\n\n  producer: str\n  name: str\n  compdir: str\n  language: int\n  apple_flags: str | None\n  isysroot: str | None\n\n\ndef get_all_compilation_units(\n    elf_file_path: os.PathLike[str],\n) -> list[CompilationUnit]:\n  \"\"\"Parses compilation units from an ELF file.\n\n  Args:\n    elf_file_path: The path to the ELF file.\n\n  Returns:\n    A list of CompilationUnit objects.\n  \"\"\"\n  result = []\n  with open(elf_file_path, \"rb\") as f:\n    elf_file = elffile.ELFFile(f)\n    if not elf_file.has_dwarf_info():\n      logging.error(\"No DWARF info found in %s\", elf_file_path)\n      return []\n    dwarf_info = elf_file.get_dwarf_info()\n    for compilation_unit in dwarf_info.iter_CUs():\n      if compilation_unit.header.version < 5:\n        # Only DWARF5 has a unit_type field in the header.\n        # For older versions, we do a best effort approach.\n        logging.warning(\n            \"[!] Compilation Unit with unsupported DWARF version %d\",\n            compilation_unit.header.version,\n        )\n      elif compilation_unit.header.unit_type in _IGNORED_UNIT_TYPES:\n        # Type units are not interesting for us.\n        continue\n      elif compilation_unit.header.unit_type not in (\n          \"DW_UT_compile\",\n          \"DW_UT_partial\",\n      ):\n        raise ValueError(\n            \"Unsupported DWARF compilation unit type\"\n            f\" {compilation_unit.header.unit_type}\"\n        )\n\n      top_debug_info_entry = compilation_unit.get_top_DIE()\n      if top_debug_info_entry.tag != \"DW_TAG_compile_unit\":\n        logging.error(\"Top DIE is not a full compile unit\")\n\n      producer = top_debug_info_entry.attributes[\n          \"DW_AT_producer\"\n      ].value.decode()\n\n      name = top_debug_info_entry.attributes[\"DW_AT_name\"].value.decode()\n      language = top_debug_info_entry.attributes[\"DW_AT_language\"].value\n      compdir = top_debug_info_entry.attributes[\"DW_AT_comp_dir\"].value.decode()\n\n      # When using `-glldb`, the compile flags are stored\n      # in the DW_AT_APPLE_flags attribute\n      apple_flags = None\n      if top_debug_info_entry.attributes.get(\"DW_AT_APPLE_flags\", None):\n        apple_flags = top_debug_info_entry.attributes[\n            \"DW_AT_APPLE_flags\"\n        ].value.decode()\n\n      isysroot = None\n      if top_debug_info_entry.attributes.get(\"DW_AT_LLVM_isysroot\", None):\n        isysroot = top_debug_info_entry.attributes[\n            \"DW_AT_LLVM_isysroot\"\n        ].value.decode()\n\n      result.append(\n          CompilationUnit(\n              producer=producer,\n              name=name,\n              compdir=compdir,\n              language=language,\n              apple_flags=apple_flags,\n              isysroot=isysroot,\n          )\n      )\n  return result\n\n\ndef parse_clang_record_command_line_value(command: str) -> Sequence[str]:\n  \"\"\"Parses the value of a `-frecord-command-line` entry from clang.\n\n   Separate arguments within a command line are combined with spaces.\n   Spaces and backslashes within an argument are escaped with backslashes.\n\n  Args:\n    command: The command line string to split.\n\n  Returns:\n    A sequence of strings, each representing a single argument.\n\n  Raises:\n    ValueError: If the command line contains an invalid escape sequence.\n    ValueError: If the command line contains an empty argument.\n  \"\"\"\n  value = io.StringIO(command)\n  args = []\n  current_arg = \"\"\n  while True:\n    c = value.read(1)\n    match c:\n      case \"\":\n        # We found the end of the string.\n        break\n      case \"\\\\\":\n        # We found a backslash, the next character should be either a space or\n        # another backslash.\n        c = value.read(1)\n        if c not in (\" \", \"\\\\\"):\n          raise ValueError(f\"Invalid Escape Sequence: \\\\{c}\")\n        current_arg += c\n      case \" \":\n        # unescaped spaces separate arguments.\n        if not current_arg:\n          raise ValueError(\"Arguments should not be empty.\")\n        args.append(current_arg)\n        current_arg = \"\"\n      case _:\n        # Anything else is part of the current argument.\n        current_arg += c\n\n  if not current_arg:\n    raise ValueError(\"Last argument should not be empty.\")\n\n  args.append(current_arg)\n  return args\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/dwarf_info_diff.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Diffs compile commands generated via DWARF info and compilation databases.\"\"\"\n\nimport collections\nfrom collections.abc import Sequence\nimport json\nimport pathlib\nfrom absl import app\nfrom absl import flags\nfrom absl import logging\nimport dwarf_info\n\n_BINARY_PATH = flags.DEFINE_string(\n    \"binary_path\", None, \"Path to the binary file.\", required=True\n)\n\n_COMPILE_COMMANDS_PATH = flags.DEFINE_string(\n    \"compile_commands_path\",\n    None,\n    \"Path to the compile commands file.\",\n    required=True,\n)\n\n\ndef main(argv: Sequence[str]) -> None:\n  if len(argv) > 1:\n    raise app.UsageError(\"Too many command-line arguments.\")\n\n  binary_path = pathlib.Path(_BINARY_PATH.value)\n  compilation_units = dwarf_info.get_all_compilation_units(binary_path)\n  logging.info(\"Found %d compilation units.\", len(compilation_units))\n\n  # Question 1: Do we have repeated CU names in the binary?\n  cu_files = collections.Counter([cu.name for cu in compilation_units])\n  logging.info(\"Most Common CU names: %s\", cu_files.most_common(1))\n\n  libs = binary_path.parent / \"lib\"\n  for lib in libs.iterdir():\n    new_cus = dwarf_info.get_all_compilation_units(lib)\n    logging.info(\"Found %d compilation units in %s\", len(new_cus), lib)\n    compilation_units.extend(new_cus)\n\n  with open(_COMPILE_COMMANDS_PATH.value, \"r\") as f:\n    compile_commands = json.load(f)\n\n  # Question 2: Do we have repeated files in the compile commands?\n  cc_files = collections.Counter([cc[\"file\"] for cc in compile_commands])\n  logging.info(\"Most Common commands files: %s\", cc_files.most_common(1))\n\n  cc_files = set(cc_files)\n  cu_files = set(cu_files)\n\n  for file in cc_files - cu_files:\n    logging.info(\"File not found in CU: %s\", file)\n\n  for file in cu_files - cc_files:\n    logging.info(\"File not found in CC: %s\", file)\n\n  for file in cu_files.intersection(cc_files):\n    logging.info(\"File found in both: %s\", file)\n\n\nif __name__ == \"__main__\":\n  app.run(main)\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/fuzzing_engine.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <assert.h>\n#include <fcntl.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t n);\n\nextern \"C\" __attribute__((weak)) int LLVMFuzzerInitialize(int* argc,\n                                                          char*** argv);\n\n// Projects can call LLVMFuzzerMutate, but should only do it from\n// LLVMFuzzerCustomMutator, which should be called from the fuzzing engine (we\n// don't need to).\nextern \"C\" size_t LLVMFuzzerMutate([[maybe_unused]] uint8_t* Data,\n                                   [[maybe_unused]] size_t Size,\n                                   [[maybe_unused]] size_t MaxSize) {\n  fprintf(stderr, \"LLVMFuzzerMutate was called. This should never happen.\\n\");\n  __builtin_trap();\n}\n\nint main(int argc, char* argv[]) {\n  if (LLVMFuzzerInitialize) {\n    LLVMFuzzerInitialize(&argc, &argv);\n  }\n\n  if (argc != 2) {\n    // Special-case because curl invokes the fuzzer binaries without arguments\n    // during make, and will fail if they don't return success.\n    if (strstr(argv[0], \"curl_fuzzer\")) {\n      fprintf(stderr, \"Exiting early for curl_fuzzer\\n\");\n      exit(EXIT_SUCCESS);\n    }\n\n    fprintf(stderr, \"Usage: %s <input_file>\\n\", argv[0]);\n    exit(EXIT_FAILURE);\n  }\n\n  int fd = open(argv[1], O_RDONLY);\n  if (fd == -1) {\n    perror(\"open\");\n    exit(EXIT_FAILURE);\n  }\n\n  struct stat st;\n  if (fstat(fd, &st) == -1) {\n    perror(\"stat\");\n    exit(EXIT_FAILURE);\n  }\n\n  size_t size = static_cast<size_t>(st.st_size);\n  uint8_t* data = static_cast<uint8_t*>(malloc(size));\n  if (!data) {\n    perror(\"malloc\");\n    exit(EXIT_FAILURE);\n  }\n\n  size_t bytes_read = 0;\n  while (bytes_read < size) {\n    ssize_t res = read(fd, data + bytes_read, size - bytes_read);\n    if (res == -1) {\n      perror(\"read\");\n      exit(EXIT_FAILURE);\n    }\n    if (res == 0) {\n      fprintf(stderr, \"Unexpected EOF.\\n\");\n      exit(EXIT_FAILURE);\n    }\n    bytes_read += static_cast<size_t>(res);\n  }\n  close(fd);\n\n  int res = LLVMFuzzerTestOneInput(data, size);\n  free(data);\n\n  return res;\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/ignored_deps.json",
    "content": "{\n    \"deps\" : [\n    ]\n  }"
  },
  {
    "path": "infra/base-images/base-builder/indexer/index_build.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"This runs the actual build process to generate a snapshot.\"\"\"\n\nimport argparse\nimport dataclasses\nimport hashlib\nimport json\nimport logging\nimport os\nimport pathlib\nfrom pathlib import Path  # pylint: disable=g-importing-member\nimport shlex\nimport shutil\nimport stat\nimport subprocess\nimport tempfile\nfrom typing import Any, Sequence\n\nimport manifest_types\nimport pathlib\n\n\nPROJECT = Path(os.getenv('PROJECT_NAME', 'project')).name\nSNAPSHOT_DIR = Path('/snapshot')\nSRC = Path(os.getenv('SRC', '/src'))\n# On OSS-Fuzz build infra, $OUT is not /out.\nOUT = Path(os.getenv('OUT', '/out'))\nINDEXES_PATH = Path(os.getenv('INDEXES_PATH', '/indexes'))\nINCREMENTAL_CDB_PATH = Path('/incremental_cdb')\n_GCC_BASE_PATH = Path('/usr/lib/gcc/x86_64-linux-gnu')\n\n_LD_BINARY = 'ld-linux-x86-64.so.2'\n_LD_PATH = Path('/lib64') / _LD_BINARY\n_DEFAULT_GCC_VERSION = '9'\n_LLVM_READELF_PATH = '/usr/local/bin/llvm-readelf'\n\nDEFAULT_COVERAGE_FLAGS = '-fsanitize-coverage=bb,no-prune,trace-pc-guard'\nTRACING_COVERAGE_FLAGS = '-fsanitize-coverage=func,trace-pc-guard'\nDEFAULT_FUZZING_ENGINE = 'fuzzing_engine.cc'\n\nDEFAULT_CLANG_TOOLCHAIN = '/usr/local'\n_CLANG_TOOLCHAIN = Path(os.getenv('CLANG_TOOLCHAIN', DEFAULT_CLANG_TOOLCHAIN))\n_TOOLCHAIN_WITH_WRAPPER = Path('/opt/toolchain')\n\nINDEXER_DIR = Path(__file__).parent\n\n# Some build systems isolate the compiler environment from the parent process,\n# so we can't always rely on using environment variables to pass settings to the\n# wrapper. Get around this by writing to a file instead.\nCOMPILE_SETTINGS_PATH = INDEXER_DIR / 'compile_settings.json'\n\nCLANG_TOOLCHAIN_BINARY_PREFIXES = (\n    'clang-',\n    'ld',\n    'lld',\n    'llvm-',\n)\n\nEXTRA_CFLAGS = (\n    '-fno-omit-frame-pointer '\n    '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION '\n    '-O0 -glldb '\n    '-fsanitize=address '\n    '-Wno-invalid-offsetof '\n    '{coverage_flags} '\n    '-Qunused-arguments '\n)\n\n\n@dataclasses.dataclass(slots=True, frozen=True)\nclass CompileSettings:\n  coverage_flags: str\n  clang_toolchain: str\n  clang_version: str\n\n\ndef read_compile_settings() -> CompileSettings:\n  \"\"\"Gets compile settings from file.\"\"\"\n  with COMPILE_SETTINGS_PATH.open('r') as f:\n    settings_dict = json.load(f)\n\n  return CompileSettings(**settings_dict)\n\n\ndef write_compile_settings(compile_settings: CompileSettings) -> None:\n  \"\"\"Writes compile settings to file.\"\"\"\n  with COMPILE_SETTINGS_PATH.open('w') as f:\n    json.dump(dataclasses.asdict(compile_settings), f)\n\n\ndef set_env_vars(coverage_flags: str):\n  \"\"\"Set up build environment variables.\"\"\"\n  os.environ['SANITIZER'] = 'address'\n  # Prevent ASan leak checker from running on `configure` script targets.\n  # At the time of writing, this helps prevent a slowdown in `hunspell` build.\n  os.environ['ASAN_OPTIONS'] = 'detect_leaks=0'\n  os.environ['FUZZING_ENGINE'] = 'none'\n  os.environ['LIB_FUZZING_ENGINE'] = '/usr/lib/libFuzzingEngine.a'\n  os.environ['FUZZING_LANGUAGE'] = 'c++'\n  os.environ['CXX'] = 'clang++'\n  os.environ['CC'] = 'clang'\n  os.environ['COMPILING_PROJECT'] = 'True'\n  # Force users of clang to use our wrapper. This fixes e.g. libcups.\n  os.environ['PATH'] = (\n      f\"{_TOOLCHAIN_WITH_WRAPPER / 'bin'}:{os.environ.get('PATH')}\"\n  )\n\n  existing_cflags = os.environ.get('CFLAGS', '')\n  extra_cflags = EXTRA_CFLAGS.format(coverage_flags=coverage_flags)\n  os.environ['CFLAGS'] = f'{existing_cflags} {extra_cflags}'.strip()\n\n\ndef set_up_wrapper_dir():\n  \"\"\"Sets up a shadow toolchain.\n\n  This sets up our clang wrapper for clang/clang++ and symlinks everything else\n  to point to the real toolchain.\n  \"\"\"\n  if _TOOLCHAIN_WITH_WRAPPER.exists():\n    shutil.rmtree(_TOOLCHAIN_WITH_WRAPPER)\n  _TOOLCHAIN_WITH_WRAPPER.mkdir(parents=True)\n\n  # Set up symlinks to toolchain binaries.\n  wrapper_bin_dir = _TOOLCHAIN_WITH_WRAPPER / 'bin'\n  wrapper_bin_dir.mkdir()\n  for name in os.listdir(_CLANG_TOOLCHAIN / 'bin'):\n    # Symlink clang/llvm toolchain binaries, except for clang itself.\n    # We have to be careful not to symlink other unrelated binaries, since other\n    # parts of the build process may wrap those binaries (e.g.\n    # make_build_replayable.py in OSS-Fuzz).\n    if not name.startswith(CLANG_TOOLCHAIN_BINARY_PREFIXES):\n      continue\n\n    os.symlink(_CLANG_TOOLCHAIN / 'bin' / name, wrapper_bin_dir / name)\n  os.symlink(_CLANG_TOOLCHAIN / 'lib', _TOOLCHAIN_WITH_WRAPPER / 'lib')\n\n  # Set up our compiler wrappers.\n  os.symlink(INDEXER_DIR / 'clang_wrapper.py', wrapper_bin_dir / 'clang')\n  os.symlink(INDEXER_DIR / 'clang_wrapper.py', wrapper_bin_dir / 'clang++')\n\n\n@dataclasses.dataclass(slots=True, frozen=True)\nclass BinaryMetadata:\n  binary_config: manifest_types.CommandLineBinaryConfig\n  build_id: str\n  build_id_matches: bool\n  compile_commands: list[dict[str, Any]]\n\n\ndef _get_build_id_from_elf_notes(elf_file: Path, contents: bytes) -> str | None:\n  \"\"\"Extracts the build id from the ELF notes of a binary.\n\n  The ELF notes are obtained with\n    `llvm-readelf --notes --elf-output-style=JSON`.\n\n  Args:\n    elf_file: The ELF file name.\n    contents: The contents of the ELF notes, as a JSON string.\n\n  Returns:\n    The build id, or None if it could not be found.\n  \"\"\"\n\n  try:\n    elf_data = json.loads(contents)\n  except json.JSONDecodeError:\n    logging.error('failed to decode ELF notes for %s', elf_file)\n    return None\n\n  assert elf_data\n\n  # Example output of llvm-readelf JSON output for llvm 19+:\n  # [\n  #   {\n  #     \"FileSummary\": {\n  #       \"File\": \"binary\",\n  #       \"Format\": \"elf64-x86-64\",\n  #       \"Arch\": \"x86_64\",\n  #       \"AddressSize\": \"64bit\",\n  #       \"LoadName\": \"<Not found>\"\n  #     },\n  #     \"NoteSections\": [\n  #       {\n  #         \"NoteSection\": {\n  #           \"Name\": \".note.gnu.property\",\n  #           \"Offset\": 904,\n  #           \"Size\": 32,\n  #           \"Notes\": [\n  #             {\n  #               \"Owner\": \"GNU\",\n  #               \"Data size\": 16,\n  #               \"Type\": \"NT_GNU_PROPERTY_TYPE_0 (property note)\",\n  #               \"Property\": [\n  #                 \"x86 ISA needed: x86-64-baseline\"\n  #               ]\n  #             }\n  #           ]\n  #         }\n  #       },\n  #       {\n  #         \"NoteSection\": {\n  #           \"Name\": \".note.gnu.build-id\",\n  #           \"Offset\": 936,\n  #           \"Size\": 36,\n  #           \"Notes\": [\n  #             {\n  #               \"Owner\": \"GNU\",\n  #               \"Data size\": 20,\n  #               \"Type\": \"NT_GNU_BUILD_ID (unique build ID bitstring)\",\n  #               \"Build ID\": \"182a06c3dca5ee4d7e9c1d94b432c8bd9279438f\"\n  #             }\n  #           ]\n  #         }\n  #       },\n  #       {\n  #         \"NoteSection\": {\n  #           \"Name\": \".note.ABI-tag\",\n  #           \"Offset\": 1630064,\n  #           \"Size\": 32,\n  #           \"Notes\": [\n  #             {\n  #               \"Owner\": \"GNU\",\n  #               \"Data size\": 16,\n  #               \"Type\": \"NT_GNU_ABI_TAG (ABI version tag)\",\n  #               \"OS\": \"Linux\",\n  #               \"ABI\": \"3.2.0\"\n  #             }\n  #           ]\n  #         }\n  #       }\n  #     ]\n  #   }\n  # ]\n\n  for file_info in elf_data:\n    if 'Notes' in file_info:\n      # llvm < 19\n      for note_entry in file_info['Notes']:\n        note_section = note_entry['NoteSection']\n        if note_section['Name'] == '.note.gnu.build-id':\n          note_details = note_section['Note']\n          if 'Build ID' in note_details:\n            return note_details['Build ID']\n    elif 'NoteSections' in file_info:\n      # llvm 19+\n      for note_entry in file_info['NoteSections']:\n        note_section = note_entry['NoteSection']\n        if note_section['Name'] == '.note.gnu.build-id':\n          note_details = note_section['Notes']\n          for note_detail in note_details:\n            if 'Build ID' in note_detail:\n              return note_detail['Build ID']\n    else:\n      raise ValueError('Unknown ELF notes format.')\n\n  return None\n\n\ndef _get_clang_version(toolchain: Path) -> str:\n  \"\"\"Returns the clang version.\"\"\"\n  clang = toolchain / 'bin' / 'clang'\n  clang_version = subprocess.run(\n      [clang, '-dumpversion'], capture_output=True, check=True, text=True\n  ).stdout\n  return clang_version.split('.')[0]\n\n\ndef get_build_id(elf_file: Path) -> str | None:\n  \"\"\"This invokes llvm-readelf to get the build ID of the given ELF file.\"\"\"\n  ret = subprocess.run(\n      [\n          _LLVM_READELF_PATH,\n          '--notes',\n          '--elf-output-style=JSON',\n          elf_file.as_posix(),\n      ],\n      capture_output=True,\n      check=False,\n  )\n  if ret.returncode != 0:\n    return None\n\n  return _get_build_id_from_elf_notes(elf_file, ret.stdout)\n\n\ndef find_fuzzer_binaries(out_dir: Path, build_id: str) -> Sequence[Path]:\n  \"\"\"Find fuzzer binary with a given build ID.\"\"\"\n  binaries = []\n  for root, _, files in os.walk(out_dir):\n    for file in files:\n      file_path = Path(root, file)\n      if get_build_id(file_path) == build_id:\n        binaries.append(file_path)\n\n  return binaries\n\n\ndef enumerate_build_targets(\n    binary_config: manifest_types.CommandLineBinaryConfig,\n) -> Sequence[BinaryMetadata]:\n  \"\"\"Enumerates the build targets in the project.\n\n  Args:\n    binary_config: The binary config applied to all targets.\n\n  Returns:\n    A sequence of target descriptions, in BinaryMetadata form.\n  \"\"\"\n\n  logging.info('enumerate_build_targets')\n  linker_json_paths = list((OUT / 'cdb').glob('*_linker_commands.json'))\n\n  logging.info('Found %i linker JSON files.', len(linker_json_paths))\n  binary_to_build_metadata: dict[str, BinaryMetadata] = {}\n  for linker_json_path in linker_json_paths:\n    build_id = linker_json_path.name.split('_')[0]\n    with linker_json_path.open('rt') as f:\n      data = json.load(f)\n      binary_path = Path(data['output'])\n      name = binary_path.name\n\n      # Some projects may move build files around, so being more careful about\n      # the binary path and checking the build id should improve the success\n      # rate.\n      if (OUT / name).exists():\n        # Just because the name matches, doesn't mean it's the right one for\n        # this linker command.\n        # Only set this if we haven't already found an exact build ID match.\n        # We can't always rely on build ID matching, because some builds will\n        # modify the binary after the linker runs.\n        if (\n            name in binary_to_build_metadata\n            and binary_to_build_metadata[name].build_id_matches\n        ):\n          continue\n\n        build_id_matches = build_id == get_build_id(binary_path)\n        target_binary_config = manifest_types.CommandLineBinaryConfig(\n            **dict(binary_config.to_dict(), binary_name=name)\n        )\n        binary_to_build_metadata[name] = BinaryMetadata(\n            binary_config=target_binary_config,\n            compile_commands=data['compile_commands'],\n            build_id=build_id,\n            build_id_matches=build_id_matches,\n        )\n      else:\n        logging.info('trying to find %s with build id %s', name, build_id)\n        binary_paths = find_fuzzer_binaries(OUT, build_id)\n        logging.info('found matching binaries: %s', binary_paths)\n        if not binary_paths:\n          logging.error('could not find %s with build id %s', name, build_id)\n          continue\n\n        for binary_path in binary_paths:\n          compile_commands = data['compile_commands']\n          target_binary_config = manifest_types.CommandLineBinaryConfig(\n              **dict(binary_config.to_dict(), binary_name=binary_path.name)\n          )\n          binary_to_build_metadata[binary_path.name] = BinaryMetadata(\n              binary_config=target_binary_config,\n              compile_commands=compile_commands,\n              build_id=build_id,\n              build_id_matches=True,\n          )\n\n  return tuple(binary_to_build_metadata.values())\n\n\ndef copy_fuzzing_engine(fuzzing_engine: str) -> Path:\n  \"\"\"Copy fuzzing engine.\"\"\"\n  # Not every project saves source to $SRC/$PROJECT_NAME\n  fuzzing_engine_dir = SRC / PROJECT\n  if not fuzzing_engine_dir.exists():\n    fuzzing_engine_dir = SRC / 'fuzzing_engine'\n    fuzzing_engine_dir.mkdir(exist_ok=True)\n\n  shutil.copy(f'/opt/indexer/{fuzzing_engine}', fuzzing_engine_dir)\n  return fuzzing_engine_dir\n\n\ndef _get_latest_gcc_version() -> str:\n  \"\"\"Finds the latest GCC version installed.\n\n  Defaults to '9' for backward compatibility if detection fails.\n\n  Returns:\n    The latest GCC version found, or the default.\n  \"\"\"\n  if _GCC_BASE_PATH.exists():\n    versions = []\n    for d in _GCC_BASE_PATH.iterdir():\n      if d.is_dir() and d.name.isdigit():\n        versions.append(int(d.name))\n\n    if versions:\n      return str(max(versions))\n\n  return _DEFAULT_GCC_VERSION\n\n\ndef build_project(\n    targets_to_index: Sequence[str] | None = None,\n    compile_args: Sequence[str] | None = None,\n    binaries_only: bool = False,\n    coverage_flags: str = DEFAULT_COVERAGE_FLAGS,\n):\n  \"\"\"Build the actual project.\"\"\"\n  set_env_vars(coverage_flags)\n  if targets_to_index:\n    os.environ['INDEXER_TARGETS'] = ','.join(targets_to_index)\n\n  if binaries_only:\n    os.environ['INDEXER_BINARIES_ONLY'] = '1'\n\n  clang_version = _get_clang_version(_CLANG_TOOLCHAIN)\n  write_compile_settings(\n      CompileSettings(\n          coverage_flags=coverage_flags,\n          clang_toolchain=_CLANG_TOOLCHAIN.as_posix(),\n          clang_version=clang_version,\n      )\n  )\n\n  fuzzing_engine_dir = copy_fuzzing_engine(DEFAULT_FUZZING_ENGINE)\n  gcc_version = _get_latest_gcc_version()\n  build_fuzzing_engine_command = [\n      f'{_CLANG_TOOLCHAIN}/bin/clang++',\n      '-c',\n      '-Wall',\n      '-Wextra',\n      '-pedantic',\n      '-std=c++20',\n      '-fno-rtti',\n      '-fno-exceptions',\n      '-glldb',\n      '-O0',\n      (fuzzing_engine_dir / DEFAULT_FUZZING_ENGINE).as_posix(),\n      '-o',\n      f'{OUT}/fuzzing_engine.o',\n      '-gen-cdb-fragment-path',\n      f'{OUT}/cdb',\n      '-Qunused-arguments',\n      f'-isystem {_CLANG_TOOLCHAIN}/lib/clang/{clang_version}',\n      f'/usr/lib/gcc/x86_64-linux-gnu/{gcc_version}/../../../../include/c++/{gcc_version}',\n      '-I',\n      f'/usr/lib/gcc/x86_64-linux-gnu/{gcc_version}/../../../../include/x86_64-linux-gnu/c++/{gcc_version}',\n      '-I',\n      f'/usr/lib/gcc/x86_64-linux-gnu/{gcc_version}/../../../../include/c++/{gcc_version}/backward',\n      '-I',\n      f'{_CLANG_TOOLCHAIN}/lib/clang/{clang_version}/include',\n      '-I',\n      f'{_CLANG_TOOLCHAIN}/include',\n      '-I',\n      '/usr/include/x86_64-linux-gnu',\n      '-I',\n      '/usr/include',\n  ]\n  subprocess.run(build_fuzzing_engine_command, check=True, cwd='/opt/indexer')\n\n  build_cov_instrumentation_command = [\n      f'{_CLANG_TOOLCHAIN}/bin/clang++',\n      '-fno-rtti',\n      '-fno-exceptions',\n      '-c',\n      '/opt/indexer/coverage.cc',\n  ]\n  subprocess.run(\n      build_cov_instrumentation_command, check=True, cwd='/opt/indexer'\n  )\n\n  ar_cmd = [\n      'ar',\n      'rcs',\n      '/opt/indexer/fuzzing_engine.a',\n      f'{OUT}/fuzzing_engine.o',\n  ]\n  subprocess.run(ar_cmd, check=True)\n  lib_fuzzing_engine = '/usr/lib/libFuzzingEngine.a'\n  if os.path.exists(lib_fuzzing_engine):\n    os.remove(lib_fuzzing_engine)\n  os.symlink('/opt/indexer/fuzzing_engine.a', lib_fuzzing_engine)\n\n  compile_command = ['/usr/local/bin/compile']\n  if compile_args:\n    compile_command.extend(compile_args)\n\n  subprocess.run(compile_command, check=True)\n\n\ndef test_target(\n    target: BinaryMetadata,\n) -> bool:\n  \"\"\"Tests a single target.\"\"\"\n  target_path = OUT / target.binary_config.binary_name\n  result = subprocess.run(\n      [str(target_path)], stderr=subprocess.PIPE, check=False\n  )\n  expected_error = f'Usage: {target_path} <input_file>\\n'\n  if expected_error not in result.stderr.decode() or result.returncode != 1:\n    logging.error(\n        'Target %s failed to run: %s',\n        target_path,\n        result.stderr.decode(),\n    )\n    return False\n  return True\n\n\ndef set_interpreter(target_path: Path, lib_mount_path: pathlib.PurePath):\n  subprocess.run(\n      [\n          'patchelf',\n          '--set-interpreter',\n          (lib_mount_path / _LD_BINARY).as_posix(),\n          target_path.as_posix(),\n      ],\n      check=True,\n  )\n\n\ndef set_target_rpath(binary_artifact: Path, lib_mount_path: pathlib.PurePath):\n  subprocess.run(\n      [\n          'patchelf',\n          '--set-rpath',\n          lib_mount_path,\n          '--force-rpath',\n          binary_artifact.as_posix(),\n      ],\n      check=True,\n  )\n\n\ndef copy_shared_libraries(\n    fuzz_target_path: Path, libs_path: Path, lib_mount_path: pathlib.PurePath\n) -> None:\n  \"\"\"Copies the shared libraries to the shared directory.\"\"\"\n  env = os.environ.copy()\n  env['LD_TRACE_LOADED_OBJECTS'] = '1'\n  env['LD_BIND_NOW'] = '1'\n  # TODO: Should we take ld.so from interp?\n\n  res = subprocess.run(\n      [_LD_PATH.as_posix(), fuzz_target_path.as_posix()],\n      capture_output=True,\n      env=env,\n      check=True,\n  )\n\n  output = res.stdout.decode()\n  if 'statically linked' in output:\n    return\n\n  # Example output:\n  #       linux-vdso.so.1 =>  (0x00007f40afc0f000)\n  #       linux-vdso.so.1 (0x00007f76b9377000)\n  #       lib foo.so => /tmp/sharedlib/lib foo.so (0x00007f76b9367000)\n  #       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f76b9157000)\n  #       /lib64/ld-linux-x86-64.so.2 (0x00007f76b9379000)\n  #\n  # The lines that do not have a => should be skipped.\n  # The dynamic linker should always be copied.\n  # The lines that have a => could contain a space, but we copy whatever on the\n  # right side of the =>, removing the load address.\n  shutil.copy2(_LD_PATH, libs_path / _LD_PATH.name)\n\n  lines = output.splitlines()\n  for line in lines:\n    if '=>' not in line:\n      continue\n    parts = line.split('=>')\n    lib_name = parts[0].strip()\n    right_side = parts[1].strip().rsplit(' ', maxsplit=1)[0].strip()\n    if not right_side:\n      continue\n    library_path = Path(right_side)\n    logging.info('Copying %s => %s', lib_name, library_path)\n    if library_path.is_relative_to(libs_path):\n      # This can happen if the project build is doing the same thing as us and\n      # already copied the library to the library_path.\n      continue\n\n    try:\n      shutil.copy2(library_path, libs_path / library_path.name)\n      dst = libs_path / library_path.name\n      # Need to preserve world writeable permissions.\n      shutil.copy2(library_path, dst)\n      # If we don't do this, our shared objects load the system's shared\n      # objects. What about their shared objects you may ask? Well they\n      # will all be from this directory where every so has the directory\n      # as its rpath.\n      set_target_rpath(dst, lib_mount_path)\n\n    except FileNotFoundError as e:\n      logging.exception('Could not copy %s', library_path)\n      raise e\n\n\ndef archive_target(target: BinaryMetadata, file_extension: str) -> Path | None:\n  \"\"\"Archives a single target in the project using the exported rootfs.\"\"\"\n  logging.info('archive_target %s', target.binary_config.binary_name)\n  index_dir = INDEXES_PATH / target.build_id\n  if not index_dir.exists():\n    logging.error(\"didn't find index dir %s\", index_dir)\n    return None\n\n  source_map = subprocess.run(\n      ['srcmap'], capture_output=True, check=True\n  ).stdout\n\n  target_hash = hashlib.sha256(source_map).hexdigest()[:16]\n\n  name = f'{PROJECT}.{target.binary_config.binary_name}'\n  uuid = f'{PROJECT}.{target.binary_config.binary_name}.{target_hash}'\n  lib_mount_path = pathlib.Path('/tmp') / (uuid + '_lib')\n\n  libs_path = OUT / 'lib'\n  # Keep a backup of the original 'lib' dir, in case the upstream project also\n  # bundles libs using the same directory name.\n  libs_backup_path = OUT / 'lib.backup'\n\n  if libs_path.exists():\n    shutil.copytree(libs_path, libs_backup_path)\n  else:\n    libs_path.mkdir(parents=False)\n\n  target_path = OUT / target.binary_config.binary_name\n  copy_shared_libraries(target_path, libs_path, lib_mount_path)\n\n  # We may want to eventually re-enable SRC copying (with some filtering to only\n  # include source files).\n  with tempfile.TemporaryDirectory() as empty_src_dir, \\\n       tempfile.TemporaryDirectory() as backup_dir:\n    # Make a backup of the target binary so we can undo the rpath/interpreter\n    # changes in OUT.\n    backup_path = Path(backup_dir) / target_path.name\n    shutil.copy2(target_path, backup_path)\n    # This is to handle `target_path` being a hard link, where other target\n    # binaries share the same inode.\n    os.unlink(target_path)\n    shutil.copy2(backup_path, target_path)\n\n    set_interpreter(target_path, lib_mount_path)\n    set_target_rpath(target_path, lib_mount_path)\n    archive_path = SNAPSHOT_DIR / f'{uuid}{file_extension}'\n    # For `/` in $PROJECT.\n    archive_path.parent.mkdir(parents=True, exist_ok=True)\n\n    manifest_types.Manifest(\n        name=name,\n        uuid=uuid,\n        binary_config=target.binary_config,\n        source_map=manifest_types.source_map_from_dict(json.loads(source_map)),\n        lib_mount_path=lib_mount_path,\n    ).save_build(\n        source_dir=Path(empty_src_dir),\n        build_dir=OUT,\n        index_dir=index_dir,\n        archive_path=archive_path,\n        out_dir=OUT,\n    )\n\n    shutil.move(backup_path, target_path)\n\n  logging.info('Wrote archive to: %s', archive_path)\n  shutil.rmtree(libs_path)\n  if libs_backup_path.exists():\n    shutil.move(libs_backup_path, libs_path)\n\n  return archive_path\n\n\ndef test_and_archive(\n    binary_config: manifest_types.CommandLineBinaryConfig,\n    targets_to_index: Sequence[str] | None,\n    file_extension: str,\n):\n  \"\"\"Test target and archive.\"\"\"\n  targets = enumerate_build_targets(binary_config)\n  if targets_to_index:\n    targets = [\n        t for t in targets if t.binary_config.binary_name in targets_to_index\n    ]\n    missing_targets = set(targets_to_index) - set(\n        t.binary_config.binary_name for t in targets\n    )\n    if missing_targets:\n      raise ValueError(f'Could not find specified targets {missing_targets}.')\n\n  logging.info('targets %s', targets)\n  for target in targets:\n    try:\n      # Check that the target binary behaves like a fuzz target,\n      # unless the caller specifically asked for a list of targets.\n      if not targets_to_index and not test_target(target):\n        # TODO: Figure out if this is a good idea, it makes some things\n        # pass that should but causes some things to pass that shouldn't.\n        continue\n    except Exception:  # pylint: disable=broad-exception-caught\n      logging.exception('Error testing target.')\n      continue\n    archive_target(target, file_extension)\n\n\ndef clear_out():\n  \"\"\"Clean up the OUT directory.\"\"\"\n  for i in OUT.iterdir():\n    if i.is_dir():\n      shutil.rmtree(i)\n    else:\n      i.unlink()\n\n\ndef main():\n  logging.basicConfig(level=logging.INFO)\n\n  parser = argparse.ArgumentParser(description='Index builder.')\n  parser.add_argument(\n      '-t',\n      '--targets',\n      help=(\n          'Comma separated list of targets to build for. '\n          'If this is omitted, snapshots are built for all fuzz targets. '\n          'If specified, this can include binaries which are not fuzz targets '\n          '(e.g., CLI targets which are built as part of the build '\n          'integration).'\n      ),\n  )\n  parser.add_argument(\n      '--targets-all-index',\n      action='store_true',\n      help=(\n          'When -t/--targets is set, allow the indexer to run on all of them, '\n          'but only archive snapshots for the specified targets. This is '\n          'useful to save some time for projects where the binary name during '\n          'build time does not match the final name in the output directory.'\n      ),\n  )\n  parser.add_argument(\n      '--target-args',\n      default=None,\n      help=(\n          'Arguments to pass to the target when executing it. '\n          'This string is shell-escaped (interpreted with `shlex.split`). '\n          'The substring <input_file> will be replaced with the input path.'\n          'Note: This is deprecated, use --target-arg instead.'\n      ),\n  )\n  parser.add_argument(\n      '--target-arg',\n      action='append',\n      help=(\n          'An argument to pass to the target binary. '\n          'The substring <input_file> will be replaced with the input path.'\n          'If you want to pass custom args, pass --harness-kind=binary as well.'\n      ),\n  )\n  parser.add_argument(\n      '--target-env',\n      action='append',\n      default=[],\n      help=(\n          'Environment variables (key=value) to pass to the target when '\n          'executing it. The substring <input_file> in a value will be '\n          'replaced with the input path.'\n      ),\n  )\n  parser.add_argument(\n      '--binary-config',\n      default=None,\n      help=(\n          'JSON serialized OSS_FUZZ BinaryConfig object containing '\n          'binary_args, binary_env, harness_kind, etc. If this value is set, '\n          'redundant flags like target-arg, etc., may not be used. '\n          'The binary_name field of this BinaryConfig object is ignored, all '\n          'other fields will be applied to all targets.'\n      ),\n  )\n  parser.add_argument(\n      '--no-clear-out',\n      action='store_true',\n      help='Do not clear out the OUT directory before building.',\n  )\n  parser.add_argument(\n      '--compile-arg',\n      action='append',\n      help='An argument to pass to the `compile` script.',\n  )\n  parser.add_argument(\n      '--compressed',\n      action='store_true',\n      help='Use gzipped tar (.tgz) for the output snapshot',\n  )\n  parser.add_argument(\n      '--binaries-only',\n      action='store_true',\n      help='Build target binaries only, and not index archives.',\n  )\n  parser.add_argument(\n      '--harness-kind',\n      choices=[str(x) for x in manifest_types.HarnessKind],\n      default=manifest_types.HarnessKind.LIBFUZZER,\n      help=(\n          'The harness kind to use for the fuzz target. In order to pass custom'\n          ' args, set this to binary.'\n      ),\n  )\n  parser.add_argument(\n      '--tracing-instrumentation',\n      action='store_true',\n      help='Enable tracing coverage instrumentation.',\n  )\n  args = parser.parse_args()\n\n  INDEXES_PATH.mkdir(exist_ok=True)\n  INCREMENTAL_CDB_PATH.mkdir(exist_ok=True)\n\n  # Clean up the existing OUT by default, otherwise we may run into various\n  # build errors.\n  if not args.no_clear_out:\n    clear_out()\n\n  if args.target_args and args.target_arg:\n    raise ValueError(\n        'Only one of --target-args or --target-arg can be specified.'\n    )\n\n  if args.binary_config:\n    if (\n        args.target_arg\n        or args.target_args\n        or args.target_env\n        or args.harness_kind != manifest_types.HarnessKind.LIBFUZZER\n    ):\n      raise ValueError(\n          'If --binary-config is specified, redundant flags may not be set.'\n      )\n\n    binary_config = manifest_types.BinaryConfig.from_dict(\n        json.loads(args.binary_config)\n    )\n    if (\n        binary_config.kind != manifest_types.BinaryConfigKind.OSS_FUZZ\n        or not isinstance(binary_config, manifest_types.CommandLineBinaryConfig)\n    ):\n      raise ValueError(\n          'Only OSS_FUZZ binary configs are supported with --binary-config.'\n      )\n  else:\n    if args.target_args and args.target_arg:\n      raise ValueError(\n          'Only one of --target-args or --target-arg can be specified.'\n      )\n    elif args.target_arg:\n      target_args = args.target_arg\n    elif args.target_args:\n      logging.warning('--target-args is deprecated, use --target-arg instead.')\n      target_args = shlex.split(args.target_args)\n    else:\n      logging.info('No target args specified.')\n      target_args = []\n    if args.target_env:\n      target_env = manifest_types.parse_env(args.target_env)\n    else:\n      logging.info('No target env specified.')\n      target_env = {}\n\n    harness_kind = manifest_types.HarnessKind(args.harness_kind)\n\n    match harness_kind:\n      case manifest_types.HarnessKind.LIBFUZZER:\n        if target_args and target_args != [manifest_types.INPUT_FILE]:\n          raise ValueError(\n              'Unsupported target args for harness_kind libfuzzer:'\n              f' {target_args}'\n          )\n        target_args = [manifest_types.INPUT_FILE]\n      case _:\n        pass\n\n    binary_config = manifest_types.CommandLineBinaryConfig(\n        kind=manifest_types.BinaryConfigKind.OSS_FUZZ,\n        binary_name='oss-fuzz',  # The name will be replaced with the target.\n        binary_args=target_args,\n        binary_env=target_env,\n        harness_kind=harness_kind,\n    )\n\n  targets_to_index = None\n  if args.targets:\n    targets_to_index = args.targets.split(',')\n\n  for directory in ['aflplusplus', 'fuzztest', 'honggfuzz', 'libfuzzer']:\n    path = os.path.join(os.environ['SRC'], directory)\n    shutil.rmtree(path, ignore_errors=True)\n\n  # Initially, we put snapshots directly in /out. This caused a bug where each\n  # snapshot was added to the next because they contain the contents of /out.\n  SNAPSHOT_DIR.mkdir(exist_ok=True)\n  # We don't have an existing /out dir on oss-fuzz's build infra.\n  OUT.mkdir(parents=True, exist_ok=True)\n\n  set_up_wrapper_dir()\n  build_project(\n      None if args.targets_all_index else targets_to_index,\n      args.compile_arg,\n      args.binaries_only,\n      TRACING_COVERAGE_FLAGS\n      if args.tracing_instrumentation\n      else DEFAULT_COVERAGE_FLAGS,\n  )\n\n  if not args.binaries_only:\n    file_extension = '.tgz' if args.compressed else '.tar'\n\n    test_and_archive(binary_config, targets_to_index, file_extension)\n\n    for snapshot in SNAPSHOT_DIR.iterdir():\n      shutil.move(str(snapshot), OUT)\n\n  # By default, this directory has o-rwx and its contents can't be deleted\n  # by a non-root user from outside the container. The rest of the files are\n  # unaffected because to delete a file, a write permission on its enclosing\n  # directory is sufficient regardless of the owner.\n  cdb_dir = OUT / 'cdb'\n  try:\n    cdb_dir.chmod(\n        cdb_dir.stat().st_mode | stat.S_IROTH | stat.S_IWOTH | stat.S_IXOTH\n    )\n  except OSError:\n    pass\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/index_build_test.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"index_build tests.\n\nThis is only runnable on OSS-Fuzz infrastructure.\n\"\"\"\n\nimport json\nimport os\nimport pathlib\nimport subprocess\nimport tarfile\nfrom typing import Sequence\nimport unittest\n\nimport manifest_types\n\nTHIS_DIR = pathlib.Path(__file__).parent\nOSS_FUZZ_DIR = THIS_DIR.parent.parent.parent.parent\n\n\n@unittest.skipUnless(\n    os.getenv('INDEX_BUILD_TESTS'), 'Tests do not run on infra'\n)\nclass IndexBuildTest(unittest.TestCase):\n\n  def _build_project(\n      self, project: str, *additional_args, compressed: bool\n  ) -> Sequence[pathlib.Path]:\n    subprocess.run(\n        ('python3', 'infra/helper.py', 'build_image', '--no-pull', project),\n        cwd=OSS_FUZZ_DIR,\n        check=True,\n    )\n\n    out_dir = OSS_FUZZ_DIR / f'build/out/{project}'\n    docker_args = [\n        'docker',\n        'run',\n        '--rm',\n        '-e',\n        f'PROJECT_NAME={project}',\n        '-v',\n        f'{THIS_DIR}:/opt/indexer',\n        '-v',\n        f'{out_dir}:/out',\n        f'gcr.io/oss-fuzz/{project}',\n        '/opt/indexer/index_build.py',\n    ]\n\n    if additional_args:\n      docker_args.extend(additional_args)\n\n    file_suffix = '.tar'\n    if compressed:\n      docker_args.append('--compressed')\n      file_suffix = '.tgz'\n\n    subprocess.run(docker_args, cwd=OSS_FUZZ_DIR, check=True)\n    return [\n        file\n        for file in out_dir.iterdir()\n        if file.suffix == file_suffix and file.name.startswith(project)\n    ]\n\n  def _check_archive(self, archive_path: pathlib.Path):\n    has_obj_lib = False\n    has_idx_sqlite = False\n    has_idx_absolute = False\n    has_idx_relative = False\n    manifest = None\n    print(f'Testing {archive_path}')\n    with tarfile.open(archive_path) as tar:\n      members = tar.getmembers()\n      for member in members:\n        if member.name.startswith('obj/lib/'):\n          has_obj_lib = True\n        if member.name.startswith('idx/absolute/'):\n          has_idx_absolute = True\n        if member.name.startswith('idx/relative/'):\n          has_idx_relative = True\n        if member.name == 'idx/db.sqlite':\n          has_idx_sqlite = True\n        if member.name == 'manifest.json':\n          file = tar.extractfile(member)\n          self.assertIsNotNone(file)\n          if file:  # Make type checkers happy.\n            manifest = json.load(file)\n            self.assertTrue(manifest['lib_mount_path'])\n            self.assertIsNotNone(\n                tar.getmember('obj/' + manifest['binary_config']['binary_name'])\n            )\n            self.assertEqual(\n                manifest['binary_config']['binary_args'],\n                [manifest_types.INPUT_FILE],\n            )\n\n    self.assertTrue(has_obj_lib, 'obj/lib/ was not found in the archive.')\n    self.assertTrue(\n        has_idx_sqlite, 'idx/db.sqlite was not found in the archive.'\n    )\n    self.assertTrue(\n        has_idx_absolute, 'idx/absolute/ was not found in the archive.'\n    )\n    self.assertTrue(\n        has_idx_relative, 'idx/relative/ was not found in the archive.'\n    )\n    self.assertIsNotNone(\n        manifest, 'manifest.json was not found or is empty in the archive.'\n    )\n\n  def test_basic_build(self):\n    \"\"\"Test basic build.\"\"\"\n    for compressed in (False, True):\n      archives = self._build_project('expat', compressed=compressed)\n      self.assertGreater(len(archives), 0)\n      for archive in archives:\n        self._check_archive(archive)\n\n  def test_build_with_target_allowlist(self):\n    \"\"\"Test basic build with target allowlist.\"\"\"\n    for compressed in (False, True):\n      archives = self._build_project(\n          'expat',\n          '--targets',\n          'xml_parse_fuzzer_UTF-8',\n          compressed=compressed,\n      )\n      self.assertEqual(len(archives), 1)\n      self.assertIn('xml_parse_fuzzer_UTF-8', archives[0].name)\n      for archive in archives:\n        self._check_archive(archive)\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/manifest_constants.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Constants pertaining to snapshot manifests.\"\"\"\n\n# pylint: disable=g-import-not-at-top\ntry:\n  import pathlib\n\n  Path = pathlib.Path\nexcept ImportError:\n  import pathlib\n\n  Path = pathlib.Path\n\n\n# Source directory.\nSRC_DIR = Path(\"src\")\n# Object directory.\nOBJ_DIR = Path(\"obj\")\n# Directory for indexer data.\nINDEX_DIR = Path(\"idx\")\n# Relative source file root in the index.\nINDEX_RELATIVE_SOURCES = INDEX_DIR / \"relative\"\n# Absolute source file root in the index.\nINDEX_ABSOLUTE_SOURCES = INDEX_DIR / \"absolute\"\n# The index database filename.\nINDEX_DB = Path(\"db.sqlite\")\n# Library directory, where shared libraries are copied - inside obj.\nLIB_DIR = OBJ_DIR / \"lib\"\n# Manifest location\nMANIFEST_PATH = Path(\"manifest.json\")\n\n\n# Where archive version 1 expects the lib directory to be mounted.\nLIB_MOUNT_PATH_V1 = Path(\"/ossfuzzlib\")\n\n# Will be replaced with the input file for target execution.\nINPUT_FILE = \"<input_file>\"\n# A file the target can write output to.\nOUTPUT_FILE = \"<output_file>\"\n# Will be replaced with any dynamic arguments.\nDYNAMIC_ARGS = \"<dynamic_args>\"\n\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/manifest_types.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Classes and tools to build an indexer snapshot according to the spec.\n\nA snapshot is a tarball containing the following:\n- source files\n- build artifacts (e.g. object files, shared libraries)\n- indexer artifacts (e.g. clang command lines, symbol files)\n- the manifest.json file, according to the Manifest class below.\n\"\"\"\n\nimport dataclasses\nimport enum\nimport inspect\nimport io\nimport json\nimport logging\nimport os\nimport pathlib\nimport shlex\nimport shutil\nimport tarfile\nimport tempfile\nfrom typing import Any, Callable, Mapping, Self, Sequence\nimport urllib.request\n\nimport manifest_constants\nimport pathlib\n\n\nSRC_DIR = manifest_constants.SRC_DIR\nOBJ_DIR = manifest_constants.OBJ_DIR\nINDEX_DIR = manifest_constants.INDEX_DIR\nINDEX_DB = manifest_constants.INDEX_DB\nLIB_DIR = manifest_constants.LIB_DIR\nMANIFEST_PATH = manifest_constants.MANIFEST_PATH\nLIB_MOUNT_PATH_V1 = manifest_constants.LIB_MOUNT_PATH_V1\n\nINPUT_FILE = manifest_constants.INPUT_FILE\nOUTPUT_FILE = manifest_constants.OUTPUT_FILE\nDYNAMIC_ARGS = manifest_constants.DYNAMIC_ARGS\n\n# Min archive version we currently support.\n_MIN_SUPPORTED_ARCHIVE_VERSION = 1\n# The current version of the build archive format.\nARCHIVE_VERSION = 5\n# OSS-Fuzz $OUT dir.\nOUT = pathlib.Path(os.getenv(\"OUT\", \"/out\"))\n# OSS-Fuzz coverage info.\n_COVERAGE_INFO_URL = (\n    \"https://storage.googleapis.com/oss-fuzz-coverage/\"\n    f\"latest_report_info/{os.getenv('PROJECT_NAME')}.json\"\n)\n\n\nclass RepositoryType(enum.StrEnum):\n  \"\"\"The type of repository.\"\"\"\n\n  GIT = enum.auto()\n  SVN = enum.auto()\n  HG = enum.auto()\n\n\n@dataclasses.dataclass(frozen=True)\nclass SourceRef:\n  \"\"\"The reference to a source code repository.\n\n  Attributes:\n    type: The type of repository.\n    url: The URL of the repository.\n    rev: The revision of the repository.\n  \"\"\"\n\n  type: RepositoryType\n  url: str\n  rev: str\n\n  @classmethod\n  def from_dict(cls, data: dict[str, Any]) -> Self:\n    \"\"\"Creates a SourceRef object from a deserialized dict.\"\"\"\n    return SourceRef(\n        url=data[\"url\"], rev=data[\"rev\"], type=RepositoryType(data[\"type\"])\n    )\n\n\n@dataclasses.dataclass(frozen=True)\nclass Reproducibility:\n  \"\"\"A report of how reproducible a known bug is.\"\"\"\n\n  # How many of the trials succeeded in reproducing the behavior?\n  success_count: int = 0\n\n  # How many reproduction trials were attempted?\n  trial_count: int = 0\n\n  @classmethod\n  def from_dict(cls, data: dict[str, Any]) -> Self:\n    \"\"\"Creates a Reproducibility object from a deserialized dict.\"\"\"\n    return Reproducibility(\n        success_count=data[\"success_count\"],\n        trial_count=data[\"trial_count\"],\n    )\n\n\nclass BinaryConfigKind(enum.StrEnum):\n  \"\"\"The kind of binary configurations.\"\"\"\n\n  OSS_FUZZ = enum.auto()\n  BINARY = enum.auto()\n\n  def validate_in(self, options: list[Self]):\n    if self not in options:\n      raise ValueError(\n          f\"Expected one of the following binary config kinds: {options}, \"\n          f\"but got {self}\"\n      )\n\n\n@dataclasses.dataclass(frozen=True, kw_only=True)\nclass BinaryConfig:\n  \"\"\"Base binary configuration.\n\n  Attributes:\n    kind: The kind of binary configuration.\n    binary_name: The name of the executable file.\n  \"\"\"\n\n  kind: BinaryConfigKind\n\n  binary_name: str\n\n  @property\n  def uses_stdin(self) -> bool:\n    \"\"\"Whether the binary uses stdin.\"\"\"\n    del self\n    return False\n\n  @classmethod\n  def from_dict(cls, config_dict: Mapping[str, Any]) -> Self:\n    \"\"\"Deserializes the correct `BinaryConfig` subclass from a dict.\"\"\"\n    mapping = {\n        BinaryConfigKind.OSS_FUZZ: CommandLineBinaryConfig,\n        BinaryConfigKind.BINARY: CommandLineBinaryConfig,\n    }\n    kind = config_dict[\"kind\"]\n    if kind not in mapping:\n      raise ValueError(f\"Unknown BinaryConfigKind: {kind}\")\n    val = config_dict\n    if isinstance(val.get(\"binary_args\"), str):\n      logging.warning(\n          \"BinaryConfig: binary_args is type string instead of list.\"\n          \" This is deprecated. Converting to list. Args: %s\",\n          val[\"binary_args\"],\n      )\n      val = dict(val, binary_args=shlex.split(val[\"binary_args\"]))\n    return mapping[kind].from_dict(val)\n\n  def to_dict(self) -> dict[str, Any]:\n    \"\"\"Converts a BinaryConfig object to a serializable dict.\"\"\"\n    return dataclasses.asdict(self)\n\n\nclass HarnessKind(enum.StrEnum):\n  \"\"\"The target/harness kind.\"\"\"\n\n  LIBFUZZER = enum.auto()\n  BINARY = enum.auto()\n  # The target is a JavaScript shell that consumes JavaScript code.\n  JS = enum.auto()\n\n\n@dataclasses.dataclass(frozen=True, kw_only=True)\nclass CommandLineBinaryConfig(BinaryConfig):\n  \"\"\"Configuration for a command-line userspace binary.\"\"\"\n\n  binary_args: list[str]\n  # Additional environment variables to pass to the binary. They will overwrite\n  # any existing environment variables with the same name.\n  # Input replacement works on these variables as well.\n  binary_env: dict[str, str] = dataclasses.field(default_factory=dict)\n  harness_kind: HarnessKind\n  # Whether to filter the compile commands to only include object files that\n  # are directly linked into the target binary. Should usually be true but\n  # some targets like V8 require this to be false, see b/433718862.\n  filter_compile_commands: bool = True\n\n  @property\n  def uses_stdin(self) -> bool:\n    \"\"\"Whether the binary uses stdin.\"\"\"\n    return manifest_constants.INPUT_FILE not in self.binary_args\n\n  @classmethod\n  def from_dict(cls, config_dict: Mapping[str, Any]) -> Self:\n    \"\"\"Deserializes the `CommandLineBinaryConfig` from a dict.\"\"\"\n    kind = BinaryConfigKind(config_dict[\"kind\"])\n    kind.validate_in([BinaryConfigKind.OSS_FUZZ, BinaryConfigKind.BINARY])\n    # Default to \"binary\" for backwards compatibility.\n    harness_kind = HarnessKind(\n        config_dict.get(\"harness_kind\", HarnessKind.BINARY)\n    )\n    return CommandLineBinaryConfig(\n        kind=kind,\n        harness_kind=harness_kind,\n        binary_name=config_dict[\"binary_name\"],\n        binary_args=config_dict[\"binary_args\"],\n        binary_env=config_dict.get(\"binary_env\", {}),\n        filter_compile_commands=config_dict.get(\n            \"filter_compile_commands\", True\n        ),\n    )\n\n\n\n\n\ndef _get_sqlite_db_user_version(sqlite_db_path: pathlib.Path) -> int:\n  \"\"\"Retrieves `PRAGMA user_version;` value without connecting to the database.\"\"\"\n  with sqlite_db_path.open(\"rb\") as stream:\n    # https://www.sqlite.org/pragma.html#pragma_user_version - a big-endian\n    # 32-bit number at offset 60 of the database header.\n    too_small_error = ValueError(\n        f\"The file '{sqlite_db_path}' is too small for an SQLite database.\"\n    )\n    try:\n      stream.seek(60)\n    except OSError as e:\n      raise too_small_error from e\n\n    version_bytes = stream.read(4)\n    if len(version_bytes) < 4:\n      raise too_small_error\n\n    return int.from_bytes(version_bytes, byteorder=\"big\")\n\n\n@dataclasses.dataclass(frozen=True)\nclass Manifest:\n  \"\"\"Contains general meta-information about the snapshot.\"\"\"\n\n  # The name of the target.\n  name: str\n  # A unique identifier for the snapshot (not necessarily a valid UUID).\n  uuid: str\n  # A fixed path that shared libraries stored at `./obj/lib` should be mounted\n  # at before running the target.\n  lib_mount_path: pathlib.Path | None\n\n  # The binary configuration used to build the snapshot.\n  binary_config: BinaryConfig\n\n  # The path prefix of the actual build directory (e.g., a temporary file in\n  # the build host). It's used during replay to remove noisy source-file\n  # prefixes from reports.\n  source_dir_prefix: str | None = None\n\n  # The reproducibility information about the bug in this snapshot.\n  reproducibility: Reproducibility | None = None\n\n  # Example source map:\n  # {\n  #   \"/src/hunspell\": {\n  #     \"type\": \"git\",\n  #     \"url\": \"https://github.com/hunspell/hunspell.git\",\n  #     \"rev\": \"a9b7270c1c2832312cfb20c3d1cf5c5080bf221b\"\n  #   }\n  # }\n  source_map: dict[pathlib.Path, SourceRef] | None = None\n\n  # Version of the manifest spec.\n  version: int = ARCHIVE_VERSION\n\n  # Version of the index database schema.\n  index_db_version: int | None = None\n\n  @classmethod\n  def from_dict(cls, data: dict[str, Any]) -> Self:\n    \"\"\"Creates a Manifest object from a deserialized dict.\"\"\"\n    if data[\"version\"] == 1:\n      lib_mount_path = LIB_MOUNT_PATH_V1\n    else:\n      lib_mount_path = _get_mapped(data, \"lib_mount_path\", pathlib.Path)\n    if data[\"version\"] < 3:\n      if not isinstance(data.get(\"binary_args\"), str):\n        raise RuntimeError(\n            \"binary_args must be a string in version 1 and 2, but got\"\n            f\" {type(data.get('binary_args'))}\"\n        )\n      binary_args = _get_mapped(data, \"binary_args\", shlex.split)\n    else:\n      binary_args = data.get(\"binary_args\")\n    if data[\"version\"] < 4:\n      binary_config = CommandLineBinaryConfig(\n          kind=BinaryConfigKind.BINARY,\n          binary_name=data[\"binary_name\"],\n          binary_args=binary_args or [],\n          harness_kind=HarnessKind.BINARY,\n          binary_env={},\n      )\n    else:\n      binary_config = _get_mapped(data, \"binary_config\", BinaryConfig.from_dict)\n\n    version = data[\"version\"]\n    if _MIN_SUPPORTED_ARCHIVE_VERSION <= version <= ARCHIVE_VERSION:\n      # Upgrade archive version - we have upgraded all necessary fields.\n      version = ARCHIVE_VERSION\n    else:\n      logging.warning(\n          \"Unsupported manifest version %s detected. Not upgrading.\", version\n      )\n    return Manifest(\n        version=version,\n        index_db_version=data.get(\"index_db_version\"),\n        name=data[\"name\"],\n        uuid=data[\"uuid\"],\n        lib_mount_path=lib_mount_path,\n        source_map=_get_mapped(data, \"source_map\", source_map_from_dict),\n        source_dir_prefix=data.get(\"source_dir_prefix\"),\n        reproducibility=_get_mapped(\n            data, \"reproducibility\", Reproducibility.from_dict\n        ),\n        binary_config=binary_config,\n    )\n\n  def to_dict(self) -> dict[str, Any]:\n    \"\"\"Converts a Manifest object to a serializable dict.\"\"\"\n    data = dataclasses.asdict(self)\n\n    data[\"binary_config\"] = self.binary_config.to_dict()\n    data[\"lib_mount_path\"] = _get_mapped(\n        data, \"lib_mount_path\", lambda x: x.as_posix()\n    )\n    data[\"source_map\"] = _get_mapped(data, \"source_map\", source_map_to_dict)\n\n    return data\n\n  def validate(self) -> None:\n    \"\"\"Validates the manifest with some simple checks.\n\n    Raises:\n      RuntimeError: If the manifest is invalid.\n    \"\"\"\n    if self.version < _MIN_SUPPORTED_ARCHIVE_VERSION:\n      raise RuntimeError(\n          f\"Build archive version too low: {self.version}. Supporting at\"\n          f\" least {_MIN_SUPPORTED_ARCHIVE_VERSION}.\"\n      )\n    if self.version > ARCHIVE_VERSION:\n      raise RuntimeError(\n          f\"Build archive version too high: {self.version}. Only supporting\"\n          f\" up to {ARCHIVE_VERSION}.\"\n      )\n    if self.version == 1 and LIB_MOUNT_PATH_V1 != self.lib_mount_path:\n      raise RuntimeError(\n          \"Build archive with version 1 has an alternative lib_mount_path set\"\n          f\" ({self.lib_mount_path}). This is not a valid archive.\"\n      )\n    if not self.name or not self.uuid or not self.binary_config:\n      raise RuntimeError(\n          \"Attempting to load a manifest with missing fields. Expected all\"\n          \" fields to be set, but got {self}\"\n      )\n    if self.source_map is not None:\n      for _, ref in self.source_map.items():\n        if not ref.url:\n          raise RuntimeError(\n              \"Attempting to load a manifest with a source map entry with an\"\n              \" empty URL. Source map entry: {ref}\"\n          )\n    # check very simple basic types.\n    for k, v in inspect.get_annotations(type(self)).items():\n      if not isinstance(v, type):\n        continue\n      if not isinstance(getattr(self, k), v):\n        raise RuntimeError(\n            f\"Type mismatch for field {k}: expected {v}, got\"\n            f\" {type(getattr(self, k))}\"\n        )\n    # We updated from string to list in version 3, make sure this propagated.\n    binary_config = self.binary_config\n    if hasattr(binary_config, \"binary_args\"):\n      if not isinstance(binary_config.binary_args, list):\n        raise RuntimeError(\n            \"Type mismatch for field binary_config.binary_args: expected list,\"\n            f\"got {type(binary_config.binary_args)}\"\n        )\n\n  def save_build(\n      self,\n      *,\n      source_dir: pathlib.PurePath | None,\n      build_dir: pathlib.PurePath,\n      index_dir: pathlib.PurePath,\n      archive_path: pathlib.PurePath,\n      out_dir: pathlib.PurePath = pathlib.Path(\"/out\"),\n      overwrite: bool = True,\n  ) -> Self:\n    \"\"\"Saves a build archive with this Manifest.\"\"\"\n    if os.path.exists(archive_path) and not overwrite:\n      raise FileExistsError(f\"Not overwriting existing archive {archive_path}\")\n\n    self.validate()\n\n    with tempfile.NamedTemporaryFile() as tmp:\n      mode = \"w:gz\" if archive_path.suffix.endswith(\"gz\") else \"w\"\n      with tarfile.open(tmp.name, mode) as tar:\n\n        def _save_dir(\n            path: pathlib.PurePath,\n            prefix: pathlib.Path,\n            exclude_build_artifacts: bool = False,\n            only_include_target: str | None = None,\n        ):\n          prefix = prefix.as_posix() + \"/\"\n          for root, _, files in os.walk(path):\n            for file in files:\n              if file.endswith(\"_seed_corpus.zip\"):\n                # Don't copy over the seed corpus -- it's not necessary.\n                continue\n\n              if \"/.git/\" in root or root.endswith(\"/.git\"):\n                # Skip the .git directory -- it can be large.\n                continue\n\n              file = pathlib.Path(root, file)\n              if exclude_build_artifacts and _is_elf(file):\n                continue\n\n              if only_include_target and _is_elf(file):\n                # Skip ELF files that aren't the relevant target (unless it's a\n                # shared library).\n                if (\n                    file.name != only_include_target\n                    and \".so\" not in file.name\n                    and not file.absolute().is_relative_to(out_dir / \"lib\")\n                ):\n                  continue\n\n              tar.add(\n                  # Don't try to replicate symlinks in the tarfile, because they\n                  # can lead to various issues (e.g. absolute symlinks).\n                  file.resolve().as_posix(),\n                  arcname=prefix + str(file.relative_to(path)),\n              )\n\n        dumped_self = self\n        if self.index_db_version is None:\n          index_db_version = _get_sqlite_db_user_version(\n              pathlib.Path(index_dir) / INDEX_DB\n          )\n          dumped_self = dataclasses.replace(\n              self, index_db_version=index_db_version\n          )\n\n        # Make sure the manifest is the first file in the archive to avoid\n        # seeking when we only need the manifest.\n        _add_string_to_tar(\n            tar,\n            MANIFEST_PATH.as_posix(),\n            json.dumps(\n                dumped_self.to_dict(),\n                indent=2,\n            ),\n        )\n\n        # Make sure the index databases (the only files directly in `INDEX_DIR`)\n        # are early in the archive for the same reason.\n        _save_dir(index_dir, INDEX_DIR)\n\n        if source_dir:\n          _save_dir(source_dir, SRC_DIR, exclude_build_artifacts=True)\n\n        # Only include the relevant target for the snapshot, to save on disk\n        # space.\n        _save_dir(\n            build_dir,\n            OBJ_DIR,\n            only_include_target=self.binary_config.binary_name,\n        )\n\n        if self.binary_config.kind == BinaryConfigKind.OSS_FUZZ:\n          copied_files = [tar_info.name for tar_info in tar.getmembers()]\n          try:\n            report_missing_source_files(\n                self.binary_config.binary_name, copied_files, tar\n            )\n          except Exception as e:  # pylint: disable=broad-except\n            logging.warning(\"Failed to report missing source files: %s\", e)\n\n      shutil.copyfile(tmp.name, archive_path)\n\n      return dumped_self\n\n\ndef report_missing_source_files(\n    binary_name: str, copied_files: list[str], tar: tarfile.TarFile\n):\n  \"\"\"Saves a report of missing source files to the snapshot tarball.\"\"\"\n  copied_files = {_get_comparable_path(file) for file in copied_files}\n  covered_files = {\n      _get_comparable_path(path): path\n      for path in get_covered_files(binary_name)\n  }\n  missing = set(covered_files) - copied_files\n  if not missing:\n    return\n  logging.info(\"Reporting missing files: %s\", missing)\n  missing_report_lines = sorted([covered_files[k] for k in missing])\n  report_name = f\"{binary_name}_missing_files.txt\"\n  tar_info = tarfile.TarInfo(name=report_name)\n  missing_report = \" \".join(missing_report_lines)\n  missing_report_bytes = missing_report.encode(\"utf-8\")\n  tar.addfile(tarinfo=tar_info, fileobj=io.BytesIO(missing_report_bytes))\n  with open(os.path.join(OUT, report_name), \"w\") as fp:\n    fp.write(missing_report)\n\n\ndef _get_comparable_path(path: str) -> tuple[str, str]:\n  return os.path.basename(os.path.dirname(path)), os.path.basename(path)\n\n\ndef get_covered_files(target: str) -> Sequence[str]:\n  \"\"\"Returns the files covered by fuzzing on OSS-Fuzz by the target.\"\"\"\n  with urllib.request.urlopen(_COVERAGE_INFO_URL) as resp:\n    latest_info = json.load(resp)\n\n  stats_url = latest_info.get(\"fuzzer_stats_dir\").replace(\n      \"gs://\", \"https://storage.googleapis.com/\"\n  )\n\n  target_url = f\"{stats_url}/{target}.json\"\n  with urllib.request.urlopen(target_url) as resp:\n    target_cov = json.load(resp)\n\n  files = target_cov[\"data\"][0][\"files\"]\n  return [\n      file[\"filename\"]\n      for file in files\n      if file[\"summary\"][\"regions\"][\"covered\"]\n  ]\n\n\ndef _get_mapped(\n    data: dict[str, Any], key: str, mapper: Callable[[Any], Any]\n) -> Any | None:\n  \"\"\"Get a value from a dict and apply a mapper to it, if it's not None.\"\"\"\n  value = data.get(key)\n  if value is None:\n    return None\n  return mapper(value)\n\n\ndef source_map_from_dict(data: dict[str, Any]) -> dict[pathlib.Path, SourceRef]:\n  \"\"\"Converts a path: obj dict to a dictionary of SourceRef objects.\"\"\"\n  return {pathlib.Path(x): SourceRef.from_dict(y) for x, y in data.items()}\n\n\ndef source_map_to_dict(\n    x: dict[pathlib.Path, SourceRef],\n) -> dict[str, Any]:\n  \"\"\"Converts a dictionary of SourceRef objects to a string: obj dict.\"\"\"\n  return {k.as_posix(): v for k, v in x.items()}\n\n\ndef _add_string_to_tar(tar: tarfile.TarFile, name: str, data: str) -> None:\n  bytesio = io.BytesIO(data.encode(\"utf-8\"))\n\n  tar_info = tarfile.TarInfo(name)\n  tar_info.size = len(bytesio.getvalue())\n\n  tar.addfile(tarinfo=tar_info, fileobj=bytesio)\n\n\ndef _is_elf(path: pathlib.PurePath) -> bool:\n  \"\"\"Checks if a file is an ELF file.\"\"\"\n  try:\n    with open(path, \"rb\") as f:\n      return f.read(4) == b\"\\x7fELF\"\n  except OSError:\n    # Can happen if the file is a symlink, etc.\n    return False\n\n\ndef parse_env(env_list: list[str]) -> dict[str, str]:\n  \"\"\"Helper function to parse environment variables from a list.\n\n  Args:\n    env_list: A list of environment variables in the format of \"key=value\".\n\n  Returns:\n    A dictionary of environment variables.\n\n  Raises:\n    ValueError: If a key is empty or invalid.\n  \"\"\"\n  env = {}\n\n  def assert_key_valid(key: str) -> None:\n    if not key:\n      raise ValueError(\"Environment variable key is empty.\")\n    # Check that the key looks like a valid environment variable name.\n\n    if key in env:\n      raise ValueError(\n          f\"Environment variable key {key} is defined twice. \"\n          f\"Existing value: {env[key]}, new value: {value}.\"\n      )\n\n  for entry in env_list:\n    if \"=\" not in entry:\n      logging.warning(\n          \"Environment variable string is not in the format of 'key=value': %s\",\n          entry,\n      )\n    key, _, value = entry.partition(\"=\")\n    assert_key_valid(key)\n    env[key] = value\n\n  return env\n"
  },
  {
    "path": "infra/base-images/base-builder/indexer/utils.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2026 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Utils for snapshotting shared libraries.\"\"\"\n\nfrom collections.abc import Mapping, Sequence\nimport dataclasses\nimport os\nimport pathlib\nimport re\nimport subprocess\nfrom typing import Final, Protocol\n\nfrom absl import logging\n\nfrom google3.pyglib import gfile\nimport pathlib\n\n\nLD_BINARY_PATH_X86_64: Final[pathlib.Path] = (\n    pathlib.Path(\"/lib64/ld-linux-x86-64.so.2\")\n)\n\nLD_BINARY_PATH_X86: Final[pathlib.Path] = pathlib.Path(\"/lib32/ld-linux.so.2\")\n\n\n@dataclasses.dataclass(frozen=True)\nclass SharedLibrary:\n  \"\"\"A shared library with its name and path.\"\"\"\n\n  name: str\n  path: pathlib.Path\n\n\ndef _parse_ld_trace_output(\n    output: str, ld_binary_path: pathlib.Path\n) -> Sequence[SharedLibrary]:\n  \"\"\"Parses the output of `LD_TRACE_LOADED_OBJECTS=1 ld.so`.\"\"\"\n  if \"statically linked\" in output:\n    return []\n\n  # Example output:\n  #       linux-vdso.so.1 =>  (0x00007f40afc0f000)\n  #       linux-vdso.so.1 (0x00007f76b9377000)\n  #       lib foo.so => /tmp/sharedlib/lib foo.so (0x00007f76b9367000)\n  #       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f76b9157000)\n  #       /lib64/ld-linux-x86-64.so.2 (0x00007f76b9379000)\n  # The last line can also be:\n  #       /grte/lib64/lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2\n  # (0x00007f76b9379000)\n  #\n  # The lines that do not have a => should be skipped.\n  # The dynamic linker should always be copied AND have its executable bit set.\n  # The lines that have a => could contain a space, but we copy whatever is on\n  # the right side of the =>, removing the load address.\n  shared_libraries = [\n      SharedLibrary(name=ld_binary_path.name, path=ld_binary_path)\n  ]\n  for lib_name, lib_path in re.findall(r\"(\\S+) => .*?(\\S+) \\(\", output):\n    lib_path = pathlib.Path(lib_path)\n    if lib_path == ld_binary_path:\n      continue\n    shared_libraries.append(SharedLibrary(name=lib_name, path=lib_path))\n\n  return shared_libraries\n\n\nclass CommandRunner(Protocol):\n  \"\"\"Runs `command` with environment `env` and returns its stdout.\"\"\"\n\n  def __call__(\n      self,\n      command: Sequence[str | os.PathLike[str]],\n      env: Mapping[str, str] | None = None,\n  ) -> bytes:\n    pass\n\n\ndef run_subprocess(\n    command: Sequence[str | os.PathLike[str]],\n    env: Mapping[str, str] | None = None,\n) -> bytes:\n  return subprocess.run(\n      command,\n      capture_output=True,\n      env=env,\n      check=True,\n  ).stdout\n\n\ndef get_shared_libraries(\n    binary_path: os.PathLike[str],\n    command_runner: CommandRunner = run_subprocess,\n    ld_binary_path: pathlib.Path = LD_BINARY_PATH_X86_64,\n) -> Sequence[SharedLibrary]:\n  \"\"\"Enumerates the shared libraries required by the given binary.\"\"\"\n  env = os.environ | {\n      \"LD_TRACE_LOADED_OBJECTS\": \"1\",\n      \"LD_BIND_NOW\": \"1\",\n  }\n  stdout_bytes = command_runner([ld_binary_path, binary_path], env=env)\n  return _parse_ld_trace_output(stdout_bytes.decode(), ld_binary_path)\n\n\ndef copy_shared_libraries(\n    libraries: Sequence[SharedLibrary], dst_path: pathlib.Path\n) -> None:\n  \"\"\"Copies the shared libraries to the shared directory.\"\"\"\n  for lib in libraries:\n    try:\n      logging.info(\"Copying %s => %s\", lib.name, lib.path)\n      gfile.Copy(lib.path, dst_path / lib.path.name, overwrite=True, mode=0o755)\n    except gfile.GOSError:\n      logging.exception(\"Could not copy %s to %s\", lib.path, dst_path)\n      raise\n\n\ndef patch_binary_rpath_and_interpreter(\n    binary_path: os.PathLike[str],\n    lib_mount_path: pathlib.Path,\n    ld_binary_path: pathlib.Path = LD_BINARY_PATH_X86_64,\n):\n  \"\"\"Patches the binary rpath and interpreter.\"\"\"\n  subprocess.run(\n      [\n          \"patchelf\",\n          \"--set-rpath\",\n          lib_mount_path.as_posix(),\n          \"--force-rpath\",\n          binary_path,\n      ],\n      check=True,\n  )\n\n  subprocess.run(\n      [\n          \"patchelf\",\n          \"--set-interpreter\",\n          (lib_mount_path / ld_binary_path.name).as_posix(),\n          binary_path,\n      ],\n      check=True,\n  )\n\n\ndef get_library_mount_path(binary_id: str) -> pathlib.Path:\n  return pathlib.Path(\"/tmp\") / (binary_id + \"_lib\")\n\n\ndef report_progress(stage: str, is_done: bool = False) -> None:\n  \"\"\"Reports progress of a stage of the snapshotting process.\"\"\"\n  logging.info(\"%s%s\", stage, \"...\" if not is_done else \"\")\n"
  },
  {
    "path": "infra/base-images/base-builder/install_deps.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install base-builder's dependencies in a architecture-aware way.\n\n\ncase $(uname -m) in\n    x86_64)\n\tdpkg --add-architecture i386\n        ;;\nesac\n\napt-get update && \\\n    apt-get install -y \\\n        binutils-dev \\\n        build-essential \\\n        curl \\\n        wget \\\n        git \\\n        jq \\\n        patchelf \\\n        rsync \\\n        subversion \\\n        zip\n\ncase $(uname -m) in\n    x86_64)\n\tapt-get install -y libc6-dev-i386\n        ;;\nesac\n"
  },
  {
    "path": "infra/base-images/base-builder/install_deps_ubuntu-20-04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install base-builder's dependencies in a architecture-aware way.\n\n\ncase $(uname -m) in\n    x86_64)\n\tdpkg --add-architecture i386\n        ;;\nesac\n\napt-get update && \\\n    apt-get install -y \\\n        binutils-dev \\\n        build-essential \\\n        curl \\\n        wget \\\n        git \\\n        jq \\\n        patchelf \\\n        rsync \\\n        subversion \\\n        zip\n\ncase $(uname -m) in\n    x86_64)\n\tapt-get install -y libc6-dev-i386\n        ;;\nesac\n"
  },
  {
    "path": "infra/base-images/base-builder/install_deps_ubuntu-24-04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install base-builder's dependencies in a architecture-aware way.\n\n\ncase $(uname -m) in\n    x86_64)\n\tdpkg --add-architecture i386\n        ;;\nesac\n\napt-get update && \\\n    apt-get install -y \\\n        binutils-dev \\\n        build-essential \\\n        curl \\\n        wget \\\n        git \\\n        jq \\\n        patchelf \\\n        rsync \\\n        subversion \\\n        zip\n\ncase $(uname -m) in\n    x86_64)\n\tapt-get install -y libc6-dev-i386\n        ;;\nesac\n\n# Ubuntu 24.04 does not have lcab. Install an older .deb from Ubuntu repos.\ncurl -LO https://mirrors.edge.kernel.org/ubuntu/pool/universe/l/lcab/lcab_1.0b12-7_amd64.deb && \\\n    apt-get install -y ./lcab_1.0b12-7_amd64.deb && \\\n    rm lcab_1.0b12-7_amd64.deb\n\n# Create a custom apt configuration to allow downgrades and non-interactive installs.\ncat <<EOF > /etc/apt/apt.conf.d/99-oss-fuzz-apt-defaults\n// OSS-Fuzz custom apt configuration.\n// Automatically allow downgrades and assume \"yes\" to all prompts.\nAPT::Get::Allow-Downgrades \"true\";\nAPT::Get::Assume-Yes \"true\";\nEOF\n"
  },
  {
    "path": "infra/base-images/base-builder/install_go.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd /tmp\n\nexport GOROOT=/root/.go\nwget https://go.dev/dl/go1.25.0.linux-amd64.tar.gz\nmkdir temp-go\ntar -C temp-go/ -xzf go1.25.0.linux-amd64.tar.gz\n\nmkdir /root/.go/\nmv temp-go/go/* /root/.go/\nrm -rf temp-go\n\necho 'Set \"GOPATH=/root/go\"'\necho 'Set \"PATH=$PATH:/root/.go/bin:$GOPATH/bin\"'\n\ngo install github.com/mdempsky/go114-fuzz-build@latest\nln -s $GOPATH/bin/go114-fuzz-build $GOPATH/bin/go-fuzz\n\n# Build signal handler\nif [ -f \"$GOPATH/gosigfuzz/gosigfuzz.c\" ]; then\n    clang -c $GOPATH/gosigfuzz/gosigfuzz.c -o $GOPATH/gosigfuzz/gosigfuzz.o\nfi\n\ncd /tmp\ngit clone https://github.com/AdamKorcz/go-118-fuzz-build\ncd go-118-fuzz-build\ngo build\nmv go-118-fuzz-build $GOPATH/bin/\n\n# Build v2 binaries\ngit checkout v2\ngo build .\nmv go-118-fuzz-build $GOPATH/bin/go-118-fuzz-build_v2\npushd cmd/convertLibFuzzerTestcaseToStdLibGo\n  go build . && mv convertLibFuzzerTestcaseToStdLibGo $GOPATH/bin/\npopd\npushd cmd/addStdLibCorpusToFuzzer\n  go build . && mv addStdLibCorpusToFuzzer $GOPATH/bin/\npopd\n"
  },
  {
    "path": "infra/base-images/base-builder/install_java.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install OpenJDK 17 and trim its size by removing unused components. This enables using Jazzer's mutation framework.\ncd /tmp\ncurl --silent -L -O https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.16+8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.16_8.tar.gz && \\\nmkdir -p $JAVA_HOME\ntar -xz --strip-components=1 -f OpenJDK17U-jdk_x64_linux_hotspot_17.0.16_8.tar.gz --directory $JAVA_HOME && \\\nrm -f OpenJDK17U-jdk_x64_linux_hotspot_17.0.16_8.tar.gz\nrm -rf $JAVA_HOME/jmods $JAVA_HOME/lib/src.zip\n\n# Install OpenJDK 15 and trim its size by removing unused components. Some projects only run with Java 15.\ncurl --silent -L -O https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz && \\\nmkdir -p $JAVA_15_HOME\ntar -xz --strip-components=1 -f openjdk-15.0.2_linux-x64_bin.tar.gz --directory $JAVA_15_HOME && \\\nrm -f openjdk-15.0.2_linux-x64_bin.tar.gz\nrm -rf $JAVA_15_HOME/jmods $JAVA_15_HOME/lib/src.zip\n"
  },
  {
    "path": "infra/base-images/base-builder/install_javascript.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# see installation instructions: https://github.com/nodesource/distributions#available-architectures\napt-get update\napt-get install -y ca-certificates curl gnupg\nmkdir -p /etc/apt/keyrings\ncurl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg\n\nNODE_MAJOR=20\necho \"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main\" | tee /etc/apt/sources.list.d/nodesource.list\n\napt-get update\napt-get install nodejs -y\n"
  },
  {
    "path": "infra/base-images/base-builder/install_python.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"ATHERIS INSTALL\"\nunset CFLAGS CXXFLAGS\n# PYI_STATIC_ZLIB=1 is needed for installing pyinstaller 5.0\nexport PYI_STATIC_ZLIB=1\nLIBFUZZER_LIB=$( echo /usr/local/lib/clang/*/lib/x86_64-unknown-linux-gnu/libclang_rt.fuzzer_no_main.a ) pip3 install -v --no-cache-dir \"atheris>=2.3.0\" \"pyinstaller==6.10.0\" \"setuptools==72.1.0\" \"coverage==6.3.2\"\nrm -rf /tmp/*\n"
  },
  {
    "path": "infra/base-images/base-builder/install_ruby.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"Starting ruby installation\"\nRUBY_VERSION=3.3.1\nRUBY_DEPS=\"binutils xz-utils libyaml-dev libffi-dev zlib1g-dev\"\napt update && apt install -y $RUBY_DEPS\ncurl -O https://cache.ruby-lang.org/pub/ruby/3.3/ruby-$RUBY_VERSION.tar.gz\ntar -xvf ruby-$RUBY_VERSION.tar.gz\ncd ruby-$RUBY_VERSION\n./configure --disable-install-doc --disable-install-rdoc --disable-install-capi\nmake -j$(nproc)\nmake install\ncd ../\n\n# Clean up the sources.\nrm -rf ./ruby-$RUBY_VERSION ruby-$RUBY_VERSION.tar.gz\n\necho \"Finished installing ruby\""
  },
  {
    "path": "infra/base-images/base-builder/install_rust.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncurl https://sh.rustup.rs | sh -s -- -y --default-toolchain=$RUSTUP_TOOLCHAIN --profile=minimal\ncargo install cargo-fuzz --locked && rm -rf /rust/registry\n# Needed to recompile rust std library for MSAN\nrustup component add rust-src\ncp -r /usr/local/lib/x86_64-unknown-linux-gnu/* /usr/local/lib/\n"
  },
  {
    "path": "infra/base-images/base-builder/install_swift.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nSWIFT_PACKAGES=\"wget \\\n          binutils \\\n          git \\\n          gnupg2 \\\n          libc6-dev \\\n          libcurl4 \\\n          libedit2 \\\n          libgcc-9-dev \\\n          libpython2.7 \\\n          libsqlite3-0 \\\n          libstdc++-9-dev \\\n          libxml2 \\\n          libz3-dev \\\n          pkg-config \\\n          tzdata \\\n          uuid-dev \\\n          zlib1g-dev\"\nSWIFT_SYMBOLIZER_PACKAGES=\"build-essential make cmake ninja-build git python3 g++-multilib binutils-dev zlib1g-dev\"\napt-get update && apt install -y $SWIFT_PACKAGES && \\\n  apt install -y $SWIFT_SYMBOLIZER_PACKAGES --no-install-recommends\n\n\nwget -q https://download.swift.org/swift-6.1.3-release/ubuntu2004/swift-6.1.3-RELEASE/swift-6.1.3-RELEASE-ubuntu20.04.tar.gz\ntar xzf swift-6.1.3-RELEASE-ubuntu20.04.tar.gz\ncp -r swift-6.1.3-RELEASE-ubuntu20.04/usr/* /usr/\nrm -rf swift-6.1.3-RELEASE-ubuntu20.04.tar.gz swift-6.1.3-RELEASE-ubuntu20.04/\n# TODO: Move to a seperate work dir\ngit clone https://github.com/llvm/llvm-project.git\ncd llvm-project\ngit checkout 63bf228450b8403e0c5e828d276be47ffbcd00d0 # TODO: Keep in sync with base-clang.\ngit apply ../llvmsymbol.diff --verbose\ncmake -G \"Ninja\" \\\n    -DLIBCXX_ENABLE_SHARED=OFF \\\n    -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n    -DLIBCXXABI_ENABLE_SHARED=OFF \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DLLVM_TARGETS_TO_BUILD=X86 \\\n    -DCMAKE_C_COMPILER=clang \\\n    -DCMAKE_CXX_COMPILER=clang++ \\\n    -DLLVM_BUILD_TESTS=OFF \\\n    -DLLVM_INCLUDE_TESTS=OFF llvm\nninja -j$(nproc) llvm-symbolizer\ncp bin/llvm-symbolizer /usr/local/bin/llvm-symbolizer-swift\n\ncd $SRC\nrm -rf llvm-project llvmsymbol.diff\n\n# TODO: Cleanup packages\napt-get remove --purge -y wget\napt-get autoremove -y\n"
  },
  {
    "path": "infra/base-images/base-builder/install_swift_ubuntu-20-04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nSWIFT_PACKAGES=\"wget \\\n          binutils \\\n          git \\\n          gnupg2 \\\n          libc6-dev \\\n          libcurl4 \\\n          libedit2 \\\n          libgcc-9-dev \\\n          libpython2.7 \\\n          libsqlite3-0 \\\n          libstdc++-9-dev \\\n          libxml2 \\\n          libz3-dev \\\n          pkg-config \\\n          tzdata \\\n          uuid-dev \\\n          zlib1g-dev\"\nSWIFT_SYMBOLIZER_PACKAGES=\"build-essential make cmake ninja-build git python3 g++-multilib binutils-dev zlib1g-dev\"\napt-get update && apt install -y $SWIFT_PACKAGES && \\\n  apt install -y $SWIFT_SYMBOLIZER_PACKAGES --no-install-recommends\n\n\nwget -q https://download.swift.org/swift-6.1.3-release/ubuntu2004/swift-6.1.3-RELEASE/swift-6.1.3-RELEASE-ubuntu20.04.tar.gz\ntar xzf swift-6.1.3-RELEASE-ubuntu20.04.tar.gz\ncp -r swift-6.1.3-RELEASE-ubuntu20.04/usr/* /usr/\nrm -rf swift-6.1.3-RELEASE-ubuntu20.04.tar.gz swift-6.1.3-RELEASE-ubuntu20.04/\n# TODO: Move to a seperate work dir\ngit clone https://github.com/llvm/llvm-project.git\ncd llvm-project\ngit checkout 63bf228450b8403e0c5e828d276be47ffbcd00d0 # TODO: Keep in sync with base-clang.\ngit apply ../llvmsymbol.diff --verbose\ncmake -G \"Ninja\" \\\n    -DLIBCXX_ENABLE_SHARED=OFF \\\n    -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n    -DLIBCXXABI_ENABLE_SHARED=OFF \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DLLVM_TARGETS_TO_BUILD=X86 \\\n    -DCMAKE_C_COMPILER=clang \\\n    -DCMAKE_CXX_COMPILER=clang++ \\\n    -DLLVM_BUILD_TESTS=OFF \\\n    -DLLVM_INCLUDE_TESTS=OFF llvm\nninja -j$(nproc) llvm-symbolizer\ncp bin/llvm-symbolizer /usr/local/bin/llvm-symbolizer-swift\n\ncd $SRC\nrm -rf llvm-project llvmsymbol.diff\n\n# TODO: Cleanup packages\napt-get remove --purge -y wget\napt-get autoremove -y\n"
  },
  {
    "path": "infra/base-images/base-builder/install_swift_ubuntu-24-04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Detect Ubuntu version\nsource /etc/os-release\n\nif [[ \"$VERSION_ID\" == \"20.04\" ]]; then\n  SWIFT_PACKAGES=\"wget \\\n            binutils \\\n            git \\\n            gnupg2 \\\n            libc6-dev \\\n            libcurl4 \\\n            libedit2 \\\n            libgcc-9-dev \\\n            libpython2.7 \\\n            libsqlite3-0 \\\n            libstdc++-9-dev \\\n            libxml2 \\\n            libz3-dev \\\n            pkg-config \\\n            tzdata \\\n            uuid-dev \\\n            zlib1g-dev\"\n  SWIFT_URL=\"https://download.swift.org/swift-6.1.3-release/ubuntu2004/swift-6.1.3-RELEASE/swift-6.1.3-RELEASE-ubuntu20.04.tar.gz\"\n  SWIFT_DIR=\"swift-6.1.3-RELEASE-ubuntu20_04\"\nelif [[ \"$VERSION_ID\" == \"24.04\" ]]; then\n  SWIFT_PACKAGES=\"wget \\\n            binutils \\\n            git \\\n            gnupg2 \\\n            libc6-dev \\\n            libcurl4-openssl-dev \\\n            libedit2 \\\n            libgcc-13-dev \\\n            libncurses-dev \\\n            libpython3-dev \\\n            libsqlite3-0 \\\n            libstdc++-13-dev \\\n            libxml2-dev \\\n            libz3-dev \\\n            pkg-config \\\n            tzdata \\\n            zip \\\n            unzip \\\n            zlib1g-dev\"\n  SWIFT_URL=\"https://download.swift.org/swift-6.1.3-release/ubuntu2404/swift-6.1.3-RELEASE/swift-6.1.3-RELEASE-ubuntu24.04.tar.gz\"\n  SWIFT_DIR=\"swift-6.1.3-RELEASE-ubuntu24.04\"\nelse\n  echo \"Unsupported Ubuntu version: $VERSION_ID\"\n  exit 1\nfi\n\nSWIFT_SYMBOLIZER_PACKAGES=\"build-essential make cmake ninja-build git python3 g++-multilib binutils-dev zlib1g-dev\"\napt-get update && apt install -y $SWIFT_PACKAGES && \\\n  apt install -y $SWIFT_SYMBOLIZER_PACKAGES --no-install-recommends\n\n\nwget -q $SWIFT_URL\ntar xzf $(basename $SWIFT_URL)\ncp -r $SWIFT_DIR/usr/* /usr/\nrm -rf $(basename $SWIFT_URL) $SWIFT_DIR\n\n# TODO: Move to a seperate work dir\ngit clone https://github.com/llvm/llvm-project.git\ncd llvm-project\ngit checkout 63bf228450b8403e0c5e828d276be47ffbcd00d0 # TODO: Keep in sync with base-clang.\ngit apply ../llvmsymbol.diff --verbose\ncmake -G \"Ninja\" \\\n    -DLIBCXX_ENABLE_SHARED=OFF \\\n    -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n    -DLIBCXXABI_ENABLE_SHARED=OFF \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DLLVM_TARGETS_TO_BUILD=X86 \\\n    -DCMAKE_C_COMPILER=clang \\\n    -DCMAKE_CXX_COMPILER=clang++ \\\n    -DLLVM_BUILD_TESTS=OFF \\\n    -DLLVM_INCLUDE_TESTS=OFF llvm\nninja -j$(nproc) llvm-symbolizer\ncp bin/llvm-symbolizer /usr/local/bin/llvm-symbolizer-swift\n\ncd $SRC\nrm -rf llvm-project llvmsymbol.diff\n\n# TODO: Cleanup packages\napt-get remove --purge -y wget\napt-get autoremove -y\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/build_jcc.bash",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo build jcc.go\ngo build jcc2.go\ngsutil cp jcc gs://clusterfuzz-builds/jcc/clang++-jcc\ngsutil cp jcc gs://clusterfuzz-builds/jcc/clang-jcc\n\ngsutil cp jcc2 gs://clusterfuzz-builds/jcc/clang++-jcc2\ngsutil cp jcc2 gs://clusterfuzz-builds/jcc/clang-jcc2\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/go.mod",
    "content": "module github.com/google/jcc\n\ngo 1.21\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/jcc.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n)\n\nfunc ExecBuildCommand(bin string, args []string) (int, string, string) {\n\t// Executes the original command.\n\tcmd := exec.Command(bin, args...)\n\tvar outb, errb bytes.Buffer\n\tcmd.Stdout = &outb\n\tcmd.Stderr = &errb\n\tcmd.Stdin = os.Stdin\n\tcmd.Run()\n\treturn cmd.ProcessState.ExitCode(), outb.String(), errb.String()\n}\n\nfunc Compile(bin string, args []string) (int, string, string) {\n\t// Run the actual command.\n\treturn ExecBuildCommand(bin, args)\n}\n\nfunc AppendStringToFile(filepath, new_content string) error {\n\t// Appends |new_content| to the content of |filepath|.\n\tfile, err := os.OpenFile(filepath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\t_, err = file.WriteString(new_content)\n\treturn err\n}\n\nfunc WriteStdErrOut(args []string, outstr string, errstr string) {\n\t// Prints |outstr| to stdout, prints |errstr| to stderr, and saves |errstr| to err.log.\n\tfmt.Print(outstr)\n\tfmt.Fprint(os.Stderr, errstr)\n\t// Record what compile args produced the error and the error itself in log file.\n\tAppendStringToFile(\"/tmp/err.log\", fmt.Sprintf(\"%s\\n\", args)+errstr)\n}\n\nfunc main() {\n\tf, err := os.OpenFile(\"/tmp/jcc.log\", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tdefer f.Close()\n\tif _, err := f.WriteString(fmt.Sprintf(\"%s\\n\", os.Args)); err != nil {\n\t\tlog.Println(err)\n\t}\n\n\targs := os.Args[1:]\n\tbasename := filepath.Base(os.Args[0])\n\tisCPP := basename == \"clang++-jcc\"\n\tnewArgs := args\n\n\tvar bin string\n\tif isCPP {\n\t\tbin = \"clang++\"\n\t} else {\n\t\tbin = \"clang\"\n\t}\n\tfullCmdArgs := append([]string{bin}, newArgs...)\n\tretcode, out, errstr := Compile(bin, newArgs)\n\tWriteStdErrOut(fullCmdArgs, out, errstr)\n\tos.Exit(retcode)\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/jcc2.go",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar MaxMissingHeaderFiles = 10\nvar CppifyHeadersMagicString = \"\\n/* JCCCppifyHeadersMagicString */\\n\"\n\nfunc CopyFile(src string, dst string) {\n\tcontents, err := ioutil.ReadFile(src)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = ioutil.WriteFile(dst, contents, 0644)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc TryFixCCompilation(cmdline []string) ([]string, int, string, string) {\n\tvar newFile string = \"\"\n\tfor i, arg := range cmdline {\n\t\tif !strings.HasSuffix(arg, \".c\") {\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := os.Stat(arg); errors.Is(err, os.ErrNotExist) {\n\t\t\tcontinue\n\t\t}\n\t\tnewFile = strings.TrimSuffix(arg, \".c\")\n\t\tnewFile += \".cpp\"\n\t\tCopyFile(arg, newFile)\n\t\tCppifyHeaderIncludesFromFile(newFile)\n\t\tcmdline[i] = newFile\n\t\tbreak\n\t}\n\tif newFile == \"\" {\n\t\treturn []string{}, 1, \"\", \"\"\n\t}\n\tcppBin := \"clang++\"\n\tnewCmdline := []string{\"-stdlib=libc++\"}\n\tnewCmdline = append(cmdline, newCmdline...)\n\tnewFullArgs := append([]string{cppBin}, newCmdline...)\n\n\tretcode, out, err := Compile(cppBin, newCmdline)\n\tif retcode == 0 {\n\t\treturn newFullArgs, retcode, out, err\n\t}\n\tcorrectedCmdline, corrected, _ := CorrectMissingHeaders(cppBin, newCmdline)\n\tif corrected {\n\t\treturn append([]string{cppBin}, correctedCmdline...), 0, \"\", \"\"\n\t}\n\treturn newFullArgs, retcode, out, err\n}\n\nfunc ExtractMissingHeader(compilerOutput string) (string, bool) {\n\tr := regexp.MustCompile(`fatal error: ['|<](?P<header>[a-zA-z0-9\\/\\.]+)['|>] file not found`)\n\tmatches := r.FindStringSubmatch(compilerOutput)\n\tif len(matches) == 0 {\n\t\treturn \"\", false\n\t}\n\treturn matches[1], true\n}\n\nfunc ReplaceMissingHeaderInFile(srcFilename, curHeader, replacementHeader string) error {\n\tsrcFile, err := os.Open(srcFilename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsrcBytes, err := ioutil.ReadAll(srcFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsrc := string(srcBytes)\n\tnewSrc := ReplaceMissingHeader(src, curHeader, replacementHeader)\n\tb := []byte(newSrc)\n\terr = ioutil.WriteFile(srcFilename, b, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc ReplaceMissingHeader(src, curHeader, replacementHeader string) string {\n\tre := regexp.MustCompile(`#include [\"|<]` + curHeader + `[\"|>]\\n`)\n\treplacement := \"#include \\\"\" + replacementHeader + \"\\\"\\n\"\n\treturn re.ReplaceAllString(src, replacement)\n}\n\nfunc GetHeaderCorrectedFilename(compilerErr string) (string, string, bool) {\n\tre := regexp.MustCompile(`(?P<buggy>[a-z\\/\\-\\_0-9A-z\\.]+):.* fatal error: .* file not found`)\n\tmatches := re.FindStringSubmatch(compilerErr)\n\tif len(matches) < 2 {\n\t\treturn \"\", \"\", false\n\t}\n\toldFilename := matches[1]\n\tbase := filepath.Base(oldFilename)\n\troot := filepath.Dir(oldFilename)\n\tnewFilename := root + \"/jcc-corrected-\" + base\n\treturn oldFilename, newFilename, true\n}\n\nfunc GetHeaderCorrectedCmd(cmd []string, compilerErr string) ([]string, string, error) {\n\toldFilename, newFilename, success := GetHeaderCorrectedFilename(compilerErr)\n\tif !success {\n\t\treturn cmd, \"\", errors.New(\"Couldn't find buggy file\")\n\t}\n\t// Make new cmd.\n\tnewCmd := make([]string, len(cmd))\n\tfor i, part := range cmd {\n\t\tnewCmd[i] = part\n\t}\n\tfound := false\n\tfor i, filename := range newCmd {\n\t\tif filename == oldFilename {\n\t\t\tnewCmd[i] = newFilename\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tCopyFile(oldFilename, newFilename)\n\tif found {\n\t\treturn newCmd, newFilename, nil\n\t}\n\treturn cmd, \"\", errors.New(\"Couldn't find file\")\n}\n\nfunc CorrectMissingHeaders(bin string, cmd []string) ([]string, bool, error) {\n\n\t_, _, stderr := Compile(bin, cmd)\n\tcmd, correctedFilename, err := GetHeaderCorrectedCmd(cmd, stderr)\n\tif err != nil {\n\t\treturn cmd, false, err\n\t}\n\tfor i := 0; i < MaxMissingHeaderFiles; i++ {\n\t\tfixed, hasBrokenHeaders := TryCompileAndFixHeadersOnce(bin, cmd, correctedFilename)\n\t\tif fixed {\n\t\t\treturn cmd, true, nil\n\t\t}\n\t\tif !hasBrokenHeaders {\n\t\t\treturn cmd, false, nil\n\t\t}\n\t}\n\treturn cmd, false, nil\n}\n\nfunc ExecBuildCommand(bin string, args []string) (int, string, string) {\n\t// Executes the original command.\n\tcmd := exec.Command(bin, args...)\n\tvar outb, errb bytes.Buffer\n\tcmd.Stdout = &outb\n\tcmd.Stderr = &errb\n\tcmd.Stdin = os.Stdin\n\tcmd.Run()\n\treturn cmd.ProcessState.ExitCode(), outb.String(), errb.String()\n}\n\nfunc Compile(bin string, args []string) (int, string, string) {\n\t// Run the actual command.\n\treturn ExecBuildCommand(bin, args)\n}\n\nfunc TryCompileAndFixHeadersOnce(bin string, cmd []string, filename string) (fixed, hasBrokenHeaders bool) {\n\tretcode, _, err := Compile(bin, cmd)\n\tif retcode == 0 {\n\t\tfixed = true\n\t\thasBrokenHeaders = false\n\t\treturn\n\t}\n\tmissingHeader, isMissing := ExtractMissingHeader(err)\n\tif !isMissing {\n\t\tfixed = false\n\t\thasBrokenHeaders = false\n\t\treturn\n\t}\n\n\tnewHeaderPath, found := FindMissingHeader(missingHeader)\n\tif !found {\n\t\tfixed = false\n\t\thasBrokenHeaders = true\n\t\treturn false, true\n\t}\n\tReplaceMissingHeaderInFile(filename, missingHeader, newHeaderPath)\n\treturn false, true\n}\n\nfunc FindMissingHeader(missingHeader string) (string, bool) {\n\tenvVar := \"JCC_MISSING_HEADER_SEARCH_PATH\"\n\tvar searchPath string\n\tsearchPath, exists := os.LookupEnv(envVar)\n\tif !exists {\n\t\tsearchPath = \"/src\"\n\t}\n\tsearchPath, _ = filepath.Abs(searchPath)\n\tvar headerLocation string\n\tmissingHeader = \"/\" + missingHeader\n\tfind := func(path string, d fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif d.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tif strings.HasSuffix(path, missingHeader) {\n\t\t\theaderLocation = path\n\t\t\treturn nil\n\t\t}\n\t\treturn nil\n\t}\n\tfilepath.WalkDir(searchPath, find)\n\tif headerLocation == \"\" {\n\t\treturn \"\", false\n\t}\n\treturn headerLocation, true\n}\n\nfunc CppifyHeaderIncludesFromFile(srcFile string) error {\n\tcontentsBytes, err := ioutil.ReadFile(srcFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontents := string(contentsBytes[:])\n\tcontents, err = CppifyHeaderIncludes(contents)\n\tif err != nil {\n\t\treturn err\n\t}\n\tb := []byte(contents)\n\terr = ioutil.WriteFile(srcFile, b, 0644)\n\treturn err\n}\n\nfunc CppifyHeaderIncludes(contents string) (string, error) {\n\tshouldCppify, exists := os.LookupEnv(\"JCC_CPPIFY_PROJECT_HEADERS\")\n\tif !exists || strings.Compare(shouldCppify, \"0\") == 0 {\n\t\treturn contents, nil\n\t}\n\tif strings.Contains(contents, CppifyHeadersMagicString) {\n\t\treturn contents, nil\n\t}\n\tre := regexp.MustCompile(`\\#include \\\"(?P<header>.+)\\\"\\n`)\n\tmatches := re.FindAllStringSubmatch(contents, -1)\n\tif len(matches) == 0 {\n\t\treturn \"\", nil // !!!\n\t}\n\tfor i, match := range matches {\n\t\tif i == 0 {\n\t\t\t// So we don't cppify twice.\n\t\t\tcontents += CppifyHeadersMagicString\n\t\t}\n\t\toldStr := match[0]\n\t\treplacement := \"extern \\\"C\\\" {\\n#include \\\"\" + match[1] + \"\\\"\\n}\\n\"\n\t\tcontents = strings.Replace(contents, oldStr, replacement, 1)\n\t\tif strings.Compare(contents, \"\") == 0 {\n\t\t\tpanic(\"Failed to replace\")\n\t\t}\n\t}\n\treturn contents, nil\n}\n\nfunc AppendStringToFile(filepath, new_content string) error {\n\t// Appends |new_content| to the content of |filepath|.\n\tfile, err := os.OpenFile(filepath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\t_, err = file.WriteString(new_content)\n\treturn err\n}\n\nfunc WriteStdErrOut(args []string, outstr string, errstr string) {\n\t// Prints |outstr| to stdout, prints |errstr| to stderr, and saves |errstr| to err.log.\n\tfmt.Print(outstr)\n\tfmt.Fprint(os.Stderr, errstr)\n\t// Record what compile args produced the error and the error itself in log file.\n\tAppendStringToFile(\"/workspace/err.log\", fmt.Sprintf(\"%s\\n\", args)+errstr)\n}\n\nfunc main() {\n\tf, err := os.OpenFile(\"/tmp/jcc.log\", os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tdefer f.Close()\n\tif _, err := f.WriteString(fmt.Sprintf(\"%s\\n\", os.Args)); err != nil {\n\t\tlog.Println(err)\n\t}\n\n\targs := os.Args[1:]\n\tif args[0] == \"unfreeze\" {\n\t\tfmt.Println(\"unfreeze\")\n\t\tunfreeze()\n\t}\n\tbasename := filepath.Base(os.Args[0])\n\tisCPP := basename == \"clang++-jcc\"\n\tnewArgs := append(args, \"-w\")\n\n\tvar bin string\n\tif isCPP {\n\t\tbin = \"clang++\"\n\t\tnewArgs = append(args, \"-stdlib=libc++\")\n\t} else {\n\t\tbin = \"clang\"\n\t}\n\tfullCmdArgs := append([]string{bin}, newArgs...)\n\tif IsCompilingTarget(fullCmdArgs) {\n\t\tWriteTargetArgsAndCommitImage(fullCmdArgs)\n\t\tos.Exit(0)\n\t}\n\tretcode, out, errstr := Compile(bin, newArgs)\n\tWriteStdErrOut(fullCmdArgs, out, errstr)\n\tos.Exit(retcode)\n}\n\ntype BuildCommand struct {\n\tCWD string   `json:\"CWD\"`\n\tCMD []string `json:\"CMD\"`\n}\n\nfunc WriteTargetArgsAndCommitImage(cmdline []string) {\n\tlog.Println(\"WRITE COMMAND\")\n\tf, _ := os.OpenFile(\"/out/statefile.json\", os.O_CREATE|os.O_WRONLY, 0644)\n\twd, _ := os.Getwd()\n\tbuildcmd := BuildCommand{\n\t\tCWD: wd,\n\t\tCMD: cmdline,\n\t}\n\tjsonData, _ := json.Marshal(buildcmd)\n\tf.Write(jsonData)\n\tf.Close()\n\thostname, _ := os.Hostname()\n\tdockerArgs := []string{\"commit\", hostname, \"frozen\"}\n\tcmd := exec.Command(\"docker\", dockerArgs...)\n\tvar outb, errb bytes.Buffer\n\tcmd.Stdout = &outb\n\tcmd.Stderr = &errb\n\tcmd.Stdin = os.Stdin\n\tcmd.Run()\n\tfmt.Println(outb.String(), errb.String())\n\tfmt.Println(\"COMMIT IMAGE\")\n}\n\nfunc IsCompilingTarget(cmdline []string) bool {\n\tfor _, arg := range cmdline {\n\t\t// This can fail if people do crazy things they aren't supposed\n\t\t// to such as using some other means to link in libFuzzer.\n\t\tif arg == \"-fsanitize=fuzzer\" {\n\t\t\treturn true\n\t\t}\n\t\tif arg == \"-lFuzzingEngine\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc parseCommand(command string) (string, []string) {\n\targs := strings.Fields(command)\n\tcommandBin := args[0]\n\tcommandArgs := args[1:]\n\treturn commandBin, commandArgs\n}\n\nfunc unfreeze() {\n\tcontent, err := ioutil.ReadFile(\"/out/statefile.json\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar command BuildCommand\n\tjson.Unmarshal(content, &command)\n\tbin, args := parseCommand(strings.Join(command.CMD, \" \"))\n\tos.Chdir(command.CWD)\n\tExecBuildCommand(bin, args)\n\tos.Exit(0)\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/jcc_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestExtractMissingHeader(t *testing.T) {\n\tmissingHeaderMessage := `path/to/file.cpp:8:10: fatal error: 'missingheader.h' file not found\n\n\t#include \"missingheader.h\"\n\n\t\t^~~~~~~~~~~~\n\n\t1 error generated.\n\t`\n\n\tres, _ := ExtractMissingHeader(missingHeaderMessage)\n\texpected := \"missingheader.h\"\n\tif strings.Compare(res, expected) != 0 {\n\t\tt.Errorf(\"Got: %s. Expected: %s.\", res, expected)\n\t}\n}\n\nfunc TestGetHeaderCorrectedFilename(t *testing.T) {\n\tmissingHeaderMessage := `path/to/file.cpp:8:10: fatal error: 'missingheader.h' file not found\n\n\t#include \"missingheader.h\"\n\n\t\t^~~~~~~~~~~~\n\n\t1 error generated.\n\t`\n\t_, correctedFilename, _ := GetHeaderCorrectedFilename(missingHeaderMessage)\n\texpected := \"path/to/jcc-corrected-file.cpp\"\n\tif strings.Compare(correctedFilename, expected) != 0 {\n\t\tt.Errorf(\"Got: %s. Expected: %s.\", correctedFilename, expected)\n\t}\n}\n\nfunc TestFindMissingHeader(t *testing.T) {\n\tpwd, _ := os.Getwd()\n\tt.Setenv(\"JCC_MISSING_HEADER_SEARCH_PATH\", pwd)\n\n\tlocation, _ := FindMissingHeader(\"header.h\")\n\texpected := pwd + \"/testdata/path/to/header.h\"\n\tif strings.Compare(location, expected) != 0 {\n\t\tt.Errorf(\"Got: %s. Expected: %s.\", location, expected)\n\t}\n}\n\nfunc TestCorrectMissingHeaders(t *testing.T) {\n\tpwd, _ := os.Getwd()\n\tt.Setenv(\"JCC_MISSING_HEADER_SEARCH_PATH\", pwd)\n\tcfile := pwd + \"/testdata/cfile.c\"\n\tcmd := [4]string{\"-fsanitize=address\", cfile, \"-o\", \"/tmp/blah\"}\n\tres, err := CorrectMissingHeaders(\"clang\", cmd[:])\n\tif !res {\n\t\tfmt.Println(err)\n\t\tt.Errorf(\"Expected successful compilation\")\n\t}\n}\n\nfunc TestGetHeaderCorrectedCmd(t *testing.T) {\n\tcompilerErr := `testdata/cpp.cc:8:10: fatal error: 'missingheader.h' file not found\n\n\t#include \"missingheader.h\"\n\n\t\t^~~~~~~~~~~~\n\n\t1 error generated.\n\t`\n\n\tcmd := [3]string{\"-fsanitize=address\", \"file.cpp\", \"path/to/cpp.cc\"}\n\texpectedFixedCmd := [3]string{\"-fanitize=address\", \"file.cpp\", \"path/to/jcc-corrected-cpp.cc\"}\n\tfixedCmd, _, _ := GetHeaderCorrectedCmd(cmd[:], compilerErr)\n\tif strings.Compare(fixedCmd[1], expectedFixedCmd[1]) != 0 {\n\t\tt.Errorf(\"Expected %s, got: %s\", expectedFixedCmd, fixedCmd)\n\t}\n}\n\nfunc TestCppifyHeaderIncludes(t *testing.T) {\n\tt.Setenv(\"JCC_CPPIFY_PROJECT_HEADERS\", \"1\")\n\tsrc := `// Copyright blah\n#include <stddef.h>\n\n#include \"fuzz.h\"\n#include \"x/y.h\"\nextern \"C\" LLVMFuzzerTestOneInput(uint8_t* data, size_t sz) {\n  return 0;\n}`\n\tnewFile, _ := CppifyHeaderIncludes(src)\n\texpected := `// Copyright blah\n#include <stddef.h>\n\nextern \"C\" {\n#include \"fuzz.h\"\n}\nextern \"C\" {\n#include \"x/y.h\"\n}\nextern \"C\" LLVMFuzzerTestOneInput(uint8_t* data, size_t sz) {\n  return 0;\n}\n/* JCCCppifyHeadersMagicString */\n`\n\tif strings.Compare(newFile, expected) != 0 {\n\t\tt.Errorf(\"Expected: %s, got: %s\", expected, newFile)\n\t}\n}\n\nfunc TestCppifyHeaderIncludesShouldnt(t *testing.T) {\n\tsrc := `// Copyright blah\n#include <stddef.h>\n\n#include \"fuzz.h\"\n#include \"x/y.h\"\nextern \"C\" LLVMFuzzerTestOneInput(uint8_t* data, size_t sz) {\n  return 0;\n}`\n\tnewFile, _ := CppifyHeaderIncludes(src)\n\tif strings.Compare(newFile, src) != 0 {\n\t\tt.Errorf(\"Expected: %s. Got: %s\", src, newFile)\n\t}\n}\n\nfunc TestCppifyHeaderIncludesAlready(t *testing.T) {\n\tsrc := `// Copyright blah\n#include <stddef.h>\n\n#include \"fuzz.h\"\n#include \"x/y.h\"\nextern \"C\" LLVMFuzzerTestOneInput(uint8_t* data, size_t sz) {\n  return 0;\n}\n/* JCCCppifyHeadersMagicString */\n`\n\tnewFile, _ := CppifyHeaderIncludes(src)\n\tif strings.Compare(newFile, src) != 0 {\n\t\tt.Errorf(\"Expected %s, got: %s\", src, newFile)\n\t}\n}\n\nfunc TestExtractMissingHeaderNonHeaderFailure(t *testing.T) {\n\tmissingHeaderMessage := `clang: error: no such file or directory: 'x'\nclang: error: no input files`\n\n\theader, res := ExtractMissingHeader(missingHeaderMessage)\n\tif res {\n\t\tt.Errorf(\"Expected no match, got: %s\", header)\n\t}\n}\n\nfunc TestReplaceMissingHeader(t *testing.T) {\n\tcfile := `// Copyright 2035 Robots\n#include <stddef.h>\n\n#include <cstdint>\n\n// Some libraries like OpenSSL will use brackets for their own headers.\n#include <missingheader.h>\n\nint LLVMFuzzerTestOneInput(uint8_t* data,  size_t size) {\n  return 0;\n}\n`\n\n\tres := ReplaceMissingHeader(cfile, \"missingheader.h\", \"path/to/includes/missingheader.h\")\n\texpected := `// Copyright 2035 Robots\n#include <stddef.h>\n\n#include <cstdint>\n\n// Some libraries like OpenSSL will use brackets for their own headers.\n#include \"path/to/includes/missingheader.h\"\n\nint LLVMFuzzerTestOneInput(uint8_t* data,  size_t size) {\n  return 0;\n}\n`\n\tif strings.Compare(res, expected) != 0 {\n\t\tt.Errorf(\"Got: %s. Expected: %s.\", res, expected)\n\t}\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/testdata/.gitignore",
    "content": "jcc-corrected-cfile.c\njcc-corrected-cfile.cpp"
  },
  {
    "path": "infra/base-images/base-builder/jcc/testdata/cfile.c",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"header.h\"\nint main() {\n  return 0;\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/testdata/cpp.cc",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"header.h\"\nint main() {\n  return 0;\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/jcc/testdata/path/to/header.h",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nint xhg(void);\n"
  },
  {
    "path": "infra/base-images/base-builder/llvmsymbol.diff",
    "content": "diff --git a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt\nindex acfb3bd0e..a499ee2e0 100644\n--- a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt\n+++ b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt\n@@ -12,4 +12,8 @@ add_llvm_component_library(LLVMSymbolize\n   Object\n   Support\n   Demangle\n-  )\n+\n+  LINK_LIBS\n+  /usr/lib/swift_static/linux/libswiftCore.a\n+  /usr/lib/x86_64-linux-gnu/libstdc++.so.6\n+)\ndiff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp\nindex fb4875f79..0030769ee 100644\n--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp\n+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp\n@@ -36,6 +36,13 @@\n #include <cassert>\n #include <cstring>\n \n+\n+extern \"C\" char *swift_demangle(const char *mangledName,\n+                     size_t mangledNameLength,\n+                     char *outputBuffer,\n+                     size_t *outputBufferSize,\n+                     uint32_t flags);\n+\n namespace llvm {\n namespace symbolize {\n \n@@ -678,6 +685,14 @@ LLVMSymbolizer::DemangleName(const std::string &Name,\n     free(DemangledName);\n     return Result;\n   }\n+  if (!Name.empty() && Name.front() == '$') {\n+    char *DemangledName = swift_demangle(Name.c_str(), Name.length(), 0, 0, 0);\n+    if (DemangledName) {\n+      std::string Result = DemangledName;\n+      free(DemangledName);\n+      return Result;\n+    }\n+  }\n \n   if (DbiModuleDescriptor && DbiModuleDescriptor->isWin32Module())\n     return std::string(demanglePE32ExternCFunc(Name));\n"
  },
  {
    "path": "infra/base-images/base-builder/make_build_replayable.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#!/usr/bin/env python\nimport os\nimport shutil\n\n_REAL_SUFFIX = '.real'\n_WRAPPER_TEMPLATE = \"\"\"#!/usr/bin/env python3\n\nimport sys\nimport os\n\ndef main():\n  target = sys.argv[0] + '.real'\n{contents}\n  os.execv(target, sys.argv)\n\n\nif __name__ == '__main__':\n  main()\n\"\"\"\n\n\ndef create_wrapper(contents: str):\n  return _WRAPPER_TEMPLATE.format(contents=contents)\n\n\ndef main():\n  dummy_script_content = '#!/bin/sh'\n  dummy_scripts = [\n      '/usr/bin/autoconf',\n      '/usr/bin/autoheader',\n      '/usr/bin/autom4te',\n      '/usr/bin/automake',\n      '/usr/bin/autopoint',\n      '/usr/bin/autoreconf',\n      '/usr/bin/autoscan',\n      '/usr/bin/autoupdate',\n      # Applying patches is not idempotent.\n      '/usr/bin/patch',\n  ]\n\n  for script_path in dummy_scripts:\n    with open(script_path, 'w') as f:\n      f.write(dummy_script_content)\n    os.chmod(script_path, 0o755)\n\n  files_to_move = (\n      '/usr/bin/cmake',\n      '/usr/local/bin/cmake',\n      '/bin/sh',\n      '/bin/bash',\n      '/usr/bin/git',\n      '/usr/bin/ln',\n      '/usr/bin/make',\n      '/usr/bin/meson',\n      '/usr/bin/mkdir',\n      '/usr/bin/zip',\n  )\n\n  for src in files_to_move:\n    if os.path.exists(src):\n      shutil.move(src, src + _REAL_SUFFIX)\n\n  # Create a shell wrapper that stubs out `configure` and `autogen`.\n  with open('/bin/sh', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if any(os.path.basename(arg) in ('configure', 'autogen.sh') for arg in sys.argv[1:]):\n    sys.exit(0)\n\"\"\"))\n\n  shutil.copyfile('/bin/sh', '/bin/bash')\n\n  # Stub out `make clean`.\n  with open('/usr/bin/make', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if any(arg == 'clean' for arg in sys.argv[1:]):\n    sys.exit(0)\n\"\"\"))\n\n  # Stub out `meson setup`.\n  with open('/usr/bin/meson', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if any(arg == 'setup' for arg in sys.argv[1:]):\n    sys.exit(0)\n\"\"\"))\n\n  # Stub out cmake, but allow cmake --build, --install, -E (command mode), -P\n  # (script mode).\n  with open('/usr/bin/cmake', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if not any(arg in ('--build', '--install', '-E', '-P', '--version') for arg in sys.argv[1:]):\n    sys.exit(0)\n\"\"\"))\n  shutil.copyfile('/usr/bin/cmake', '/usr/local/bin/cmake')\n\n  # Add -p to mkdir calls to allow it to be run twice.\n  with open('/usr/bin/mkdir', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if not any(arg == '-p' for arg in sys.argv[1:]):\n    sys.argv.insert(1, '-p')\n\"\"\"))\n\n  # Don't zip something that already exists.\n  with open('/usr/bin/zip', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if (any(arg.endswith('.zip') and os.path.exists(arg) for arg in sys.argv[1:])):\n    sys.exit(0)\n\"\"\"))\n\n  # Add -f to ln.\n  with open('/usr/bin/ln', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if not any(arg == '-f' for arg in sys.argv[1:]):\n    sys.argv.insert(1, '-f')\n\"\"\"))\n\n  # Don't allow git `reset` or `clean` or `apply`.\n  # reset/clean might remove build artifacts.\n  # clone is not idempotent.\n  # applying patches is not idempotent.\n  with open('/usr/bin/git', 'w') as f:\n    f.write(\n        create_wrapper(\"\"\"\n  if any(arg in ('clean', 'clone', 'reset', 'apply', 'submodule') for arg in sys.argv[1:]):\n    sys.exit(0)\n\"\"\"))\n\n  for file_path in files_to_move:\n    if os.path.exists(file_path):\n      os.chmod(file_path, 0o755)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/ossfuzz_coverage_runner.go",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage mypackagebeingfuzzed\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"runtime/pprof\"\n\t\"testing\"\n)\n\nfunc TestFuzzCorpus(t *testing.T) {\n\tdir := os.Getenv(\"FUZZ_CORPUS_DIR\")\n\tif dir == \"\" {\n\t\tt.Logf(\"No fuzzing corpus directory set\")\n\t\treturn\n\t}\n\tinfos, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\tt.Logf(\"Not fuzzing corpus directory %s\", err)\n\t\treturn\n\t}\n\tfilename := \"\"\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tt.Error(\"Fuzz panicked in \"+filename, r)\n\t\t}\n\t}()\n\tprofname := os.Getenv(\"FUZZ_PROFILE_NAME\")\n\tif profname != \"\" {\n\t\tf, err := os.Create(profname + \".cpu.prof\")\n\t\tif err != nil {\n\t\t\tt.Logf(\"error creating profile file %s\\n\", err)\n\t\t} else {\n\t\t\t_ = pprof.StartCPUProfile(f)\n\t\t}\n\t}\n\tfor i := range infos {\n\t\tfilename = dir + infos[i].Name()\n\t\tdata, err := ioutil.ReadFile(filename)\n\t\tif err != nil {\n\t\t\tt.Error(\"Failed to read corpus file\", err)\n\t\t}\n\t\tFuzzFunction(data)\n\t}\n\tif profname != \"\" {\n\t\tpprof.StopCPUProfile()\n\t\tf, err := os.Create(profname + \".heap.prof\")\n\t\tif err != nil {\n\t\t\tt.Logf(\"error creating heap profile file %s\\n\", err)\n\t\t}\n\t\tif err = pprof.WriteHeapProfile(f); err != nil {\n\t\t\tt.Logf(\"error writing heap profile file %s\\n\", err)\n\t\t}\n\t\tf.Close()\n\t}\n}\n"
  },
  {
    "path": "infra/base-images/base-builder/precompile_afl",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"Precompiling AFLplusplus\"\n\npushd $SRC/aflplusplus > /dev/null\nmake clean\n# Unset CFLAGS and CXXFLAGS while building AFL since we don't want to slow it\n# down with sanitizers.\nSAVE_CXXFLAGS=$CXXFLAGS\nSAVE_CFLAGS=$CFLAGS\nunset CXXFLAGS\nunset CFLAGS\nexport AFL_IGNORE_UNKNOWN_ENVS=1\nmake clean\nAFL_NO_X86=1 PYTHON_INCLUDE=/ make\nmake -C utils/aflpp_driver\n\npopd > /dev/null\n\necho \"Done.\"\n"
  },
  {
    "path": "infra/base-images/base-builder/precompile_centipede",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho -n \"Precompiling centipede\"\n\n# Build Centipede with bazel.\ncd \"$SRC/fuzztest/centipede/\"\napt-get update && apt-get install libssl-dev -y\nunset CXXFLAGS CFLAGS\n# We need to use an older version of BAZEL because fuzztest relies on WORKSPACE\n# Ref: https://github.com/google/oss-fuzz/pull/12838#issue-2733821058\nexport USE_BAZEL_VERSION=7.4.0\necho 'build --cxxopt=-stdlib=libc++ --linkopt=-lc++' >> /tmp/centipede.bazelrc\nbazel --bazelrc=/tmp/centipede.bazelrc build -c opt :all\nunset USE_BAZEL_VERSION\n\n# Prepare the weak symbols:\n# This is necessary because we compile the target binary and the intermediate\n# auxiliary binaries with the same cflags. The auxiliary binaries do not need\n# data-flow tracing flags, but will still throw errors when they cannot find\n# the corresponding functions.\n# The weak symbols provides fake implementations for intermediate binaries.\n$CXX \"$SRC/fuzztest/centipede/weak_sancov_stubs.cc\" -c -o \"$SRC/fuzztest/centipede/weak.o\"\n\necho 'Removing extra stuff leftover to avoid bloating image.'\n\nrm -rf /clang-*.tgz /clang\n\nBAZEL_BIN_REAL_DIR=$(readlink -f $CENTIPEDE_BIN_DIR)\nrm -rf $CENTIPEDE_BIN_DIR\nmkdir -p $CENTIPEDE_BIN_DIR\nmv $BAZEL_BIN_REAL_DIR/centipede/{centipede,libcentipede_runner.pic.a} $CENTIPEDE_BIN_DIR\nrm -rf /root/.cache\n\necho 'Done.'\n"
  },
  {
    "path": "infra/base-images/base-builder/precompile_honggfuzz",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"Precompiling honggfuzz\"\nexport BUILD_OSSFUZZ_STATIC=true\n\nPACKAGES=(\n    libunwind8-dev\n    libblocksruntime-dev\n    liblzma-dev\n    libiberty-dev\n    zlib1g-dev\n    pkg-config)\n\napt-get update && apt-get install -y ${PACKAGES[@]}\n\npushd $SRC/honggfuzz > /dev/null\nmake clean\n# These CFLAGs match honggfuzz's default, with the exception of -mtune to\n# improve portability and `-D_HF_LINUX_NO_BFD` to remove assembly instructions\n# from the filenames.\nsed -i 's/-Werror//g' Makefile\nCC=clang CFLAGS=\"-O3 -funroll-loops -D_HF_LINUX_NO_BFD -Wno-unterminated-string-initialization -Wno-error\" make\n\n# libhfuzz.a will be added by CC/CXX linker directly during linking,\n# but it's defined here to satisfy the build infrastructure\nar rcs honggfuzz.a libhfuzz/*.o libhfcommon/*.o\npopd > /dev/null\n\napt-get remove -y --purge ${PACKAGES[@]}\napt-get autoremove -y\necho \"Done.\"\n"
  },
  {
    "path": "infra/base-images/base-builder/precompile_honggfuzz_ubuntu_20_04",
    "content": "#!/bin/bash -eux\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"Precompiling honggfuzz\"\nexport BUILD_OSSFUZZ_STATIC=true\n\nPACKAGES=(\n    libunwind8-dev\n    libblocksruntime-dev\n    liblzma-dev\n    libiberty-dev\n    zlib1g-dev\n    pkg-config)\n\napt-get update && apt-get install -y ${PACKAGES[@]}\n\npushd $SRC/honggfuzz > /dev/null\nmake clean\n# These CFLAGs match honggfuzz's default, with the exception of -mtune to\n# improve portability and `-D_HF_LINUX_NO_BFD` to remove assembly instructions\n# from the filenames.\nsed -i 's/-Werror//g' Makefile\nCC=clang CFLAGS=\"-O3 -funroll-loops -D_HF_LINUX_NO_BFD -Wno-unterminated-string-initialization -Wno-error\" make\n\n# libhfuzz.a will be added by CC/CXX linker directly during linking,\n# but it's defined here to satisfy the build infrastructure\nar rcs honggfuzz.a libhfuzz/*.o libhfcommon/*.o\npopd > /dev/null\n\napt-get remove -y --purge ${PACKAGES[@]}\napt-get autoremove -y\necho \"Done.\""
  },
  {
    "path": "infra/base-images/base-builder/precompile_honggfuzz_ubuntu_24_04",
    "content": "#!/bin/bash -eux\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"Precompiling honggfuzz\"\nexport BUILD_OSSFUZZ_STATIC=true\n\nPACKAGES=(\n    libunwind8-dev\n    libblocksruntime-dev\n    liblzma-dev\n    libiberty-dev\n    zlib1g-dev\n    pkg-config)\n\napt-get update && apt-get install -y ${PACKAGES[@]}\n\npushd $SRC/honggfuzz > /dev/null\nmake clean\n# These CFLAGs match honggfuzz's default, with the exception of -mtune to\n# improve portability and `-D_HF_LINUX_NO_BFD` to remove assembly instructions\n# from the filenames.\nsed -i 's/-Werror//g' Makefile\nCC=clang CFLAGS=\"-O3 -funroll-loops -D_HF_LINUX_NO_BFD -Wno-unterminated-string-initialization -Wno-error\" make LDFLAGS=\"-lBlocksRuntime -lunwind-ptrace -lunwind-generic\"\n\n# libhfuzz.a will be added by CC/CXX linker directly during linking,\n# but it's defined here to satisfy the build infrastructure\nar rcs honggfuzz.a libhfuzz/*.o libhfcommon/*.o\npopd > /dev/null\n\napt-get remove -y --purge ${PACKAGES[@]}\napt-get autoremove -y\necho \"Done.\""
  },
  {
    "path": "infra/base-images/base-builder/python_coverage_helper.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Extracts file paths to copy files from pyinstaller-generated executables\"\"\"\nimport os\nimport sys\nimport shutil\nimport zipfile\n\n\n# Finds all *.toc files in ./workpath and reads these files in order to\n# identify Python files associated with a pyinstaller packaged executable.\n# Copies all of the Python files to a temporary directory (/medio) following\n# the original directory structure.\ndef get_all_files_from_toc(toc_file, file_path_set):\n  \"\"\"\n  Extract filepaths from a .toc file and add to file_path_set\n  \"\"\"\n  with open(toc_file, 'rb') as toc_file_fd:\n    for line in toc_file_fd:\n      try:\n        line = line.decode()\n      except:  # pylint:disable=bare-except\n        continue\n      if '.py' not in line:\n        continue\n\n      split_line = line.split(' ')\n      for word in split_line:\n        word = word.replace('\\'', '').replace(',', '').replace('\\n', '')\n        if '.py' not in word:\n          continue\n        # Check if .egg is in the path and if so we need to split it\n        if os.path.isfile(word):\n          file_path_set.add(word)\n        elif '.egg' in word:  # check if this is an egg\n          egg_path_split = word.split('.egg')\n          if len(egg_path_split) != 2:\n            continue\n          egg_path = egg_path_split[0] + '.egg'\n          if not os.path.isfile(egg_path):\n            continue\n\n          print('Unzipping contents of %s' % egg_path)\n\n          # We have an egg. This needs to be unzipped and then replaced\n          # with the unzipped data.\n          tmp_dir_name = 'zipdcontents'\n          if os.path.isdir(tmp_dir_name):\n            shutil.rmtree(tmp_dir_name)\n\n          # unzip egg and replace path with unzipped content\n          with zipfile.ZipFile(egg_path, 'r') as zip_f:\n            zip_f.extractall(tmp_dir_name)\n          os.remove(egg_path)\n          shutil.copytree(tmp_dir_name, egg_path)\n\n          # Now the lines should be accessible, so check again\n          if os.path.isfile(word):\n            file_path_set.add(word)\n\n\ndef create_file_structure_from_tocs(work_path, out_path):\n  \"\"\"\n  Extract the Python files that are added as paths in the output of\n  a pyinstaller operation. The files are determined by reading through\n  all of the *.toc files in the workpath of pyinstaller.\n\n  The files will be copied into the out_path using a similar file path\n  as they originally are. If any archive (.egg) files are present in the\n  .toc files, then unzip the archives and substitute the archive for the\n  unzipped content, i.e. we will extract the archives and collect the source\n  files.\n  \"\"\"\n  print('Extracts files from the pyinstaller workpath')\n  file_path_set = set()\n  for path1 in os.listdir(work_path):\n    full_path = os.path.join(work_path, path1)\n    if not os.path.isdir(full_path):\n      continue\n\n    # We have a directory\n    for path2 in os.listdir(full_path):\n      if not '.toc' in path2:\n        continue\n      full_toc_file = os.path.join(full_path, path2)\n      get_all_files_from_toc(full_toc_file, file_path_set)\n\n  for file_path in file_path_set:\n    relative_src = file_path[1:] if file_path[0] == '/' else file_path\n    dst_path = os.path.join(out_path, relative_src)\n    os.makedirs(os.path.dirname(dst_path), exist_ok=True)\n    shutil.copy(file_path, dst_path)\n\n\ndef main():\n  \"\"\"\n  Main handler.\n  \"\"\"\n  if len(sys.argv) != 3:\n    print('Use: python3 python_coverage_helper.py pyinstaller_workpath '\n          'destination_for_output')\n    sys.exit(1)\n  work_path = sys.argv[1]\n  out_path = sys.argv[2]\n  create_file_structure_from_tocs(work_path, out_path)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/replay_build.sh",
    "content": "#!/bin/bash -x\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ ! -f /usr/bin/bash.real ]; then\n  # Only run this once.\n  python /usr/local/bin/make_build_replayable.py\nfi\n\n. $SRC/build.sh \"$@\""
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/.gitignore",
    "content": "dist\npysecsan.egg-info*\nbuild\n.venv\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/LICENSE",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/README.md",
    "content": "# pysecsan\n\nSecurity sanitizers for vulnerability detection during runtime.\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/pyproject.toml",
    "content": "[build-system]\nrequires = [\"setuptools>=61.0\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[project]\nname = \"pysecsan\"\nversion = \"0.1.0\"\nauthors = [\n  { name=\"David Korczynski\", email=\"david@adalogics.com\" },\n]\ndescription = \"Sanitizers to detect security vulnerabilities at runtime.\"\nreadme = \"README.md\"\nrequires-python = \">=3.7\"\nclassifiers = [\n    \"Programming Language :: Python :: 3\",\n    \"License :: OSI Approved :: Apache Software License\",\n    \"Operating System :: OS Independent\",\n]\n\n[project.urls]\n\"Homepage\" = \"https://github.com/google/oss-fuzz/tree/master/infra/sanitizers/pysecsan\"\n\"Bug Tracker\" = \"https://github.com/google/oss-fuzz/issues\"\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/pysecsan/__init__.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Glue for pysecsan library.\"\"\"\n\n# Import sanlib and expose only needs functionality by way of __all__\nfrom .sanlib import *\n\n# pylint: disable=undefined-all-variable\n__all__ = ['add_hooks']\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/pysecsan/command_injection.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Sanitizers for capturing code injections.\"\"\"\n\nfrom typing import Optional\nfrom pysecsan import sanlib\n\n\ndef get_all_substr_prefixes(main_str, sub_str):\n  \"\"\"Yields all strings prefixed with sub_str in main_str.\"\"\"\n  idx = 0\n  while True:\n    idx = main_str.find(sub_str, idx)\n    if idx == -1:\n      return\n    yield main_str[0:idx]\n    # Increase idx the length of the substring from the current position\n    # where an occurence of the substring was found.\n    idx += len(sub_str)\n\n\n# pylint: disable=unsubscriptable-object\ndef check_code_injection_match(elem, check_unquoted=False) -> Optional[str]:\n  \"\"\"identify if elem is an injection match.\"\"\"\n  # Check exact match\n  if elem == 'exec-sanitizer':\n    return 'Explicit command injection found.'\n\n  # Check potential for injecting into a string\n  if 'FROMFUZZ' in elem:\n    if check_unquoted:\n      # return true if any index is unquoted\n      for sub_str in get_all_substr_prefixes(elem, 'FROMFUZZ'):\n        if sub_str.count('\\\"') % 2 == 0:\n          return 'Fuzzer controlled content in data. Code injection potential.'\n\n      # Return None if all fuzzer taints were quoted\n      return None\n    return 'Fuzzer-controlled data in command string. Injection potential.'\n  return None\n\n\n# pylint: disable=invalid-name\ndef hook_pre_exec_subprocess_Popen(cmd, **kwargs):\n  \"\"\"Hook for subprocess.Popen.\"\"\"\n\n  arg_shell = 'shell' in kwargs and kwargs['shell']\n\n  # Command injections depend on whether the first argument is a list of\n  # strings or a string. Handle this now.\n  # Example: tests/poe/ansible-runner-cve-2021-4041\n  if isinstance(cmd, str):\n    res = check_code_injection_match(cmd, check_unquoted=True)\n    if res is not None:\n      # if shell arg is true and string is tainted and unquoted that's a\n      # definite code injection.\n      if arg_shell is True:\n        sanlib.abort_with_issue('Code injection in Popen', 'Command injection')\n\n      # It's a maybe: will not report this to avoid false positives.\n      # TODO: add more precise detection here.\n\n  # Check for hg command injection\n  # Example: tests/poe/libvcs-cve-2022-21187\n  if cmd[0] == 'hg':\n    # Check if the arguments are controlled by the fuzzer, and this given\n    # arg is not preceded by --\n    found_dashes = False\n    for idx in range(1, len(cmd)):\n      if cmd[0] == '--':\n        found_dashes = True\n      if not found_dashes and check_code_injection_match(cmd[idx]):\n        sanlib.abort_with_issue(\n            'command injection likely by way of mercurial. The following'\n            f'command {str(cmd)} is executed, and if you substitute {cmd[idx]} '\n            'with \\\"--config=alias.init=!touch HELLO_PY\\\" then you will '\n            'create HELLO_PY', 'Command injection')\n\n\ndef hook_pre_exec_os_system(cmd):\n  \"\"\"Hook for os.system.\"\"\"\n  res = check_code_injection_match(cmd)\n  if res is not None:\n    sanlib.abort_with_issue(f'code injection by way of os.system\\n{res}',\n                            'Command injection')\n\n\ndef hook_pre_exec_eval(cmd, *args, **kwargs):\n  \"\"\"Hook for eval. Experimental atm.\"\"\"\n  res = check_code_injection_match(cmd, check_unquoted=True)\n  if res is not None:\n    sanlib.abort_with_issue(f'Potential code injection by way of eval\\n{res}',\n                            'Command injection')\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/pysecsan/redos.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Sanitizer for regular expression dos.\"\"\"\n\n# pylint: disable=protected-access\n\nimport time\nimport os\nfrom pysecsan import sanlib\n\nSTART_RE_TIME = None\n\n\n# Hooks for regular expressions.\n# Main problem is to identify ReDOS attemps. This is a non-trivial task\n# - https://arxiv.org/pdf/1701.04045.pdf\n# - https://dl.acm.org/doi/pdf/10.1145/3236024.3236027\n# and the current approach we use is simply check for extensive computing time.\n# In essence, this is more of a refinement of traditional timeout checker from\n# the fuzzer, which, effectively will detect these types of attacks by way of\n# timeouts.\n#\n# Perhaps the smartest would be to use something like e.g.\n# https://github.com/doyensec/regexploit to scan the regex patterns.\n# Other heuristics without going too technical on identifying super-linear\n# regexes:\n# - check\n#   - if 'taint' exists in re.compile(xx)\n# - check\n#   - for backtracking possbility in PATTERN within re.comile(PATTERN)\n#   - and\n#   - 'taint' in findall(XX) calls.\n# pylint: disable=global-statement\ndef hook_post_exec_re_pattern_findall(self, re_str):\n  \"\"\"Hook post exeution re.compile().findall().\"\"\"\n  _ = self  # Satisfy lint\n  global START_RE_TIME\n  try:\n    endtime = time.time() - START_RE_TIME\n    if endtime > 4:\n      sanlib.abort_with_issue(f'Potential ReDOS attack.\\n {re_str}', 'ReDOS')\n  except NameError:\n    sanlib.sanitizer_log(\n        'starttime is not set, which it should have. Error in PySecSan',\n        sanlib.LOG_INFO)\n    os._exit(1)\n\n\ndef hook_pre_exec_re_pattern_findall(self, string):\n  \"\"\"Hook pre execution of re.pattern().findall().\"\"\"\n  _ = (self, string)  # Satisfy lint\n  global START_RE_TIME\n  START_RE_TIME = time.time()\n\n\ndef hook_post_exec_re_compile(retval, pattern, flags=None):\n  \"\"\"Hook for re.compile post execution to hook returned objects functions.\"\"\"\n  _ = (pattern, flags)  # Satisfy lint\n  sanlib.sanitizer_log('Inside of post compile hook', sanlib.LOG_DEBUG)\n  wrapper_object = sanlib.create_object_wrapper(\n      findall=(hook_pre_exec_re_pattern_findall,\n               hook_post_exec_re_pattern_findall))\n  hooked_object = wrapper_object(retval)\n  return hooked_object\n\n\ndef hook_pre_exec_re_compile(pattern, flags=None):\n  \"\"\"Check if tainted input exists in pattern. If so, likely chance of making\n    ReDOS possible.\"\"\"\n  _ = (pattern, flags)  # Satisfy lint\n  sanlib.sanitizer_log('Inside re compile hook', sanlib.LOG_DEBUG)\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/pysecsan/sanlib.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Core routines for pysecsan library.\"\"\"\n\n# pylint: disable=protected-access\n\nimport re\nimport os\nimport functools\nimport subprocess\nimport traceback\nimport importlib.util\n\nfrom typing import Any, Callable, Optional\nfrom pysecsan import command_injection, redos, yaml_deserialization\n\nLOG_DEBUG = 0\nLOG_INFO = 1\nPYSECSAN_LOG_LVL = LOG_INFO\n\n# Message that will be printed to stdout when an issue is found.\nPYSECSAN_BUG_LABEL = r'===BUG DETECTED: PySecSan:'\n\n\n# pylint: disable=global-statement\ndef sanitizer_log(msg, log_level, force=False, log_prefix=True):\n  \"\"\"Helper printing function.\"\"\"\n  global PYSECSAN_LOG_LVL\n  if log_level >= PYSECSAN_LOG_LVL or force:\n    if log_prefix:\n      print(f'[PYSECSAN] {msg}')\n    else:\n      print(f'{msg}')\n\n\ndef sanitizer_log_always(msg, log_prefix=True):\n  \"\"\"Wrapper for sanitizer logging. Will always log\"\"\"\n  sanitizer_log(msg, 0, force=True, log_prefix=log_prefix)\n\n\ndef is_module_present(mod_name):\n  \"\"\"Identify if module is importable.\"\"\"\n  # pylint: disable=deprecated-method\n  return importlib.util.find_spec(mod_name) is not None\n\n\ndef _log_bug(bug_title):\n  sanitizer_log_always('%s %s ===' % (PYSECSAN_BUG_LABEL, bug_title),\n                       log_prefix=False)\n\n\ndef abort_with_issue(msg, bug_title):\n  \"\"\"Print message, display stacktrace and force process exit.\n\n  Use this function for signalling an issue is found and use the messages\n  logged from this function to determine if a fuzzer found a bug.\n  \"\"\"\n  # Show breaker string using an ASAN approach (uses 65 =)\n  sanitizer_log_always(\"=\" * 65, log_prefix=False)\n\n  # Log issue message\n  _log_bug(bug_title)\n  sanitizer_log_always(msg)\n\n  # Log stacktrace\n  sanitizer_log_always(\"Stacktrace:\")\n  traceback.print_stack()\n\n  # Force exit\n  # Use os._exit here to force exit. sys.exit will exit\n  # by throwing a SystemExit exception which the interpreter\n  # handles by exiting. However, code may catch this exception,\n  # and thus to avoid this we exit the process without exceptions.\n  # pylint: disable=protected-access\n  sanitizer_log_always(\"Exiting\")\n  os._exit(1)\n\n\ndef is_exact_taint(stream) -> bool:\n  \"\"\"Checks if stream is an exact match for taint from fuzzer.\"\"\"\n  # The fuzzer has to get 8 characters right. This may be a bit much,\n  # however, when found it shows a high level of control over the data.\n  if stream == 'FROMFUZZ':\n    return True\n\n  return False\n\n\ndef create_object_wrapper(**methods):\n  \"\"\"Hooks functions in an object.\n\n  This is needed for hooking built-in types and object attributes.\n\n  Example use case is if we want to find ReDOS vulnerabilities, that\n  have a pattern of\n\n  ```\n  import re\n  r = re.compile(REGEX)\n  for _ in r.findall(...)\n  ```\n\n  In the above case r.findall is a reference to\n  re.Pattern.findall, which is a built-in type that is non-writeable.\n\n  In order to hook such calls we need to wrap the object, and also hook the\n  re.compile function to return the wrapped/hooked object.\n  \"\"\"\n\n  class Wrapper():\n    \"\"\"Wrap an object by hiding attributes.\"\"\"\n\n    def __init__(self, instance):\n      object.__setattr__(self, 'instance', instance)\n\n    def __setattr__(self, name, value):\n      object.__setattr__(object.__getattribute__(self, 'instance'), name, value)\n\n    def __getattribute__(self, name):\n      instance = object.__getattribute__(self, 'instance')\n\n      def _hook_func(self, pre_hook, post_hook, orig, *args, **kargs):\n        if pre_hook is not None:\n          pre_hook(self, *args, **kargs)\n        # No need to pass instance here because when we extracted\n        # the function we used instance.__getattribute__(name) which\n        # seems to include it. I think.\n        orig_retval = orig(*args, **kargs)\n\n        if post_hook is not None:\n          post_hook(self, *args, **kargs)\n        return orig_retval\n\n      # If this is a wrapped method, return a bound method\n      if name in methods:\n        pre_hook = methods[name][0]\n        post_hook = methods[name][1]\n        orig = instance.__getattribute__(name)\n        return (lambda *args, **kargs: _hook_func(self, pre_hook, post_hook,\n                                                  orig, *args, **kargs))\n\n      # Otherwise, just return attribute of instance\n      return instance.__getattribute__(name)\n\n  return Wrapper\n\n\n# pylint: disable=unsubscriptable-object\ndef add_hook(function: Callable[[Any], Any],\n             pre_exec_hook: Optional[Callable[[Any], Any]] = None,\n             post_exec_hook: Optional[Callable[[Any], Any]] = None):\n  \"\"\"Hook a function.\n\n    Hooks can be placed pre and post function call. At least one hook is\n    needed.\n\n    This hooking is intended on non-object hooks. In order to hook functions\n    in objects the `create_object_wrapper` function is used in combination\n    with function hooking initialisation functions post execution.\n    \"\"\"\n  if pre_exec_hook is None and post_exec_hook is None:\n    raise Exception('Some hooks must be included')\n\n  @functools.wraps(function)\n  def run(*args, **kwargs):\n    sanitizer_log(f'Hook start {str(function)}', LOG_DEBUG)\n\n    # Call hook\n    if pre_exec_hook is not None:\n      pre_exec_hook(*args, **kwargs)\n\n    # Call the original function in the even the hook did not indicate\n    # failure.\n    ret = function(*args, **kwargs)\n\n    # Post execution hook. Overwrite return value if anything is returned\n    # by post hook.\n    if post_exec_hook is not None:\n      tmp_ret = post_exec_hook(ret, *args, **kwargs)\n      if tmp_ret is not None:\n        sanitizer_log('Overwriting return value', LOG_DEBUG)\n        ret = tmp_ret\n    sanitizer_log(f'Hook end {str(function)}', LOG_DEBUG)\n    return ret\n\n  return run\n\n\ndef add_hooks():\n  \"\"\"Sets up hooks.\"\"\"\n  sanitizer_log('Starting', LOG_INFO)\n  os.system = add_hook(os.system,\n                       pre_exec_hook=command_injection.hook_pre_exec_os_system)\n  subprocess.Popen = add_hook(\n      subprocess.Popen,\n      pre_exec_hook=command_injection.hook_pre_exec_subprocess_Popen)\n\n  __builtins__['eval'] = add_hook(\n      __builtins__['eval'], pre_exec_hook=command_injection.hook_pre_exec_eval)\n\n  re.compile = add_hook(re.compile,\n                        pre_exec_hook=redos.hook_pre_exec_re_compile,\n                        post_exec_hook=redos.hook_post_exec_re_compile)\n\n  # Hack to determine if yaml is elligible, because pkg_resources does\n  # not seem to work from pyinstaller.\n  # pylint: disable=import-outside-toplevel\n  if is_module_present('yaml'):\n    import yaml\n    sanitizer_log('Hooking pyyaml.load', LOG_DEBUG)\n    yaml.load = add_hook(\n        yaml.load,\n        pre_exec_hook=yaml_deserialization.hook_pre_exec_pyyaml_load,\n    )\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/pysecsan/yaml_deserialization.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Catches vulnerable yaml desrializations that can potentially lead to\narbitrary code execution.\"\"\"\nfrom pysecsan import sanlib\n\ntry:\n  import yaml\n# pylint: disable=broad-except\nexcept Exception:\n  pass\n\n\ndef hook_pre_exec_pyyaml_load(stream, loader):\n  \"\"\"Hook for pyyaml.load_yaml.\n\n    Exits if the loader is unsafe or vanilla loader and the stream passed\n    to the loader is controlled by the fuzz data\n    \"\"\"\n  # Ensure loader is the unsafe loader or vanilla loader\n  if loader not in (yaml.loader.Loader, yaml.loader.UnsafeLoader):\n    return\n\n  # Check for exact taint in stream\n  if sanlib.is_exact_taint(stream):\n    msg = (\n        'Yaml deserialization issue.\\n'\n        'Unsafe deserialization can be used to execute arbitrary commands.\\n')\n    sanlib.abort_with_issue(msg, 'Yaml deserialisation')\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/setup.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Config for installing python as package.\"\"\"\nfrom setuptools import setup, find_packages\n\nsetup(name='pysecsan',\n      version='0.1',\n      author='David Korczynski',\n      author_email='david@adalogics.com',\n      packages=find_packages(exclude='tests'))\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/README.md",
    "content": "# Tests including Proof of Exploits\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/eval_command_injection.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer targetting command injection of eval.\"\"\"\n# pylint: disable=eval-used\n\nimport sys\nimport atheris\nimport pysecsan\n\npysecsan.add_hooks()\n\n\ndef list_files_perhaps(param, magicval):\n  \"\"\"Pass fuzzer data into eval.\"\"\"\n  if len(param) < 3:\n    return\n  if magicval == 1337:\n    try:\n      eval(\"FROMFUZZ\")\n    except ValueError:\n      pass\n\n\ndef test_one_input(data):\n  \"\"\"Fuzzer entrypoint.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  list_files_perhaps(fdp.ConsumeUnicodeNoSurrogates(24),\n                     fdp.ConsumeIntInRange(500, 1500))\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/os_command_injection.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer targetting command injection of os.system.\"\"\"\n\nimport os\nimport sys\nimport atheris\nimport pysecsan\n\n\ndef list_files_perhaps(param, magicval):\n  \"\"\"Pass fuzzer data into os.system.\"\"\"\n  if 'B' not in param:\n    return\n  if magicval == 1338:\n    os.system('exec-san')\n  elif magicval == 1339:\n    os.system('ls -la FROMFUZZ')\n  else:\n    os.system('ls -la ./')\n\n\ndef test_one_input(data):\n  \"\"\"Fuzzer entrypoint.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  list_files_perhaps(fdp.ConsumeUnicodeNoSurrogates(24),\n                     fdp.ConsumeIntInRange(500, 1500))\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n  pysecsan.add_hooks()\n\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/ansible-runner-cve-2021-4041/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install pysecsan\n\ngit clone https://github.com/ansible/ansible-runner/\ncd ansible-runner\ngit checkout cdc0961df51fa1e10b44371944aafe5ae140b98c\npython3 -m pip install .\ncd ..\npython3 fuzz_ansible_runner.py\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/ansible-runner-cve-2021-4041/fuzz_ansible_runner.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets: https://github.com/advisories/GHSA-6j58-grhv-2769.\"\"\"\n\nimport sys\nimport atheris\nimport pexpect\nimport pysecsan\nimport ansible_runner\nfrom ansible_runner.config.runner import RunnerConfig\n\npysecsan.add_hooks()\n\n\ndef test_one_input(data):\n  \"\"\"Fuzzer entrypoint.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n\n  conf = RunnerConfig('/tmp/')\n  conf.suppress_ansible_output = True\n  conf.expect_passwords = {pexpect.TIMEOUT: None, pexpect.EOF: None}\n  conf.cwd = str('/tmp/')\n  conf.env = {}\n  conf.job_timeout = 10\n  conf.idle_timeout = 0\n  conf.pexpect_timeout = 2.\n  conf.pexpect_use_poll = True\n  conf.command = 'from_fuzzer'\n\n  runner = ansible_runner.Runner(conf)\n  runner.resource_profiling = True\n  # rc.resource_profiling_base_cgroup = \"; exec-san\"\n  assistance = True\n  if assistance and fdp.ConsumeIntInRange(1, 100) > 80:\n    conf.resource_profiling_base_cgroup = 'FROMFUZZ'\n  else:\n    conf.resource_profiling_base_cgroup = fdp.ConsumeUnicodeNoSurrogates(24)\n  try:\n    runner.run()\n  except (RuntimeError, ValueError, TypeError) as _:\n    pass\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/libvcs-cve-2022-21187/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install pysecsan\n\npython3 -m pip install libvcs==0.11.0\npython3 ./fuzz_libvcs.py\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/libvcs-cve-2022-21187/fuzz_libvcs.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets https://github.com/advisories/GHSA-mv2w-4jqc-6fg4.\"\"\"\n\nimport sys\nimport atheris\nimport pysecsan\nfrom libvcs.shortcuts import create_repo\n\npysecsan.add_hooks()\n\n\ndef test_one_input(data):\n  \"\"\"Target code injection in libvcs.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  mercurial_repo = create_repo(url=fdp.ConsumeUnicodeNoSurrogates(128),\n                               vcs='hg',\n                               repo_dir='./')\n  try:\n    mercurial_repo.update_repo()\n  except (ValueError, FileNotFoundError) as exception:\n    _ = exception  # Satisfy lint\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/python-ldap-GHSL-2021-117/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install pysecsan\n\ngit clone https://github.com/python-ldap/python-ldap\ncd python-ldap\ngit checkout 404c36b702c5b3a7e60729745c8bda16098b1472\npython3 -m pip install .\ncd ../\npython3 ./fuzz_ldap.py\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/python-ldap-GHSL-2021-117/fuzz_ldap.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets: https://github.com/python-ldap/python-ldap/security/advisories/GHSA-r8wq-qrxc-hmcm\"\"\"  # pylint: disable=line-too-long\n\nimport sys\nimport atheris\nimport pysecsan\nimport ldap.schema\n\npysecsan.add_hooks()\n\n\ndef test_one_input(data):\n  \"\"\"Fuzzer targetting regex dos in ldap.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    ldap.schema.split_tokens(fdp.ConsumeUnicodeNoSurrogates(1024))\n  except ValueError:\n    pass\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/pytorch-lightning-1.5.10/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit clone --depth 1 --branch 1.5.10 https://github.com/PyTorchLightning/pytorch-lightning.git\ncd pytorch-lightning\npython3 -m pip install .\ncd ../\npython3 ./fuzz_pytorch_lightning.py\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/pytorch-lightning-1.5.10/fuzz_pytorch_lightning.dict",
    "content": "\"os.system('exec-sanitizer')\"\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/pytorch-lightning-1.5.10/fuzz_pytorch_lightning.py",
    "content": "#!/usr/local/bin/python3\n#\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Exploit pytorch lightning with fuzzer's input as a random env variable.\nThis PoC is extended from a report in GitHub Advisory Database:\nhttps://github.com/advisories/GHSA-r5qj-cvf9-p85h\nThe original report documents an exploit using a specific environment variable,\nwe show a way to achieve the same exploit with an arbitrary env variable.\n\"\"\"\n\nimport os\nimport sys\nimport atheris\nimport pysecsan\n\npysecsan.add_hooks()\n\nwith atheris.instrument_imports():\n  from pytorch_lightning import Trainer\n  from pytorch_lightning.utilities.argparse import parse_env_variables\n\n\ndef prepare_fuzzing_input(data):\n  \"\"\"Prepare the data needed by the exploit with input data from fuzzers.\"\"\"\n  data = data.replace(b'\\0', b'')\n  env_name = 'AN_ARBITRARY_ENV_NAME'\n  return data, env_name\n\n\ndef exploit_target(env_value, env_name):\n  \"\"\"This target is based on a snippet from the official documentation of\n  `parse_env_variables`:\n  https://pytorch-lightning.readthedocs.io/en/stable/api/pytorch_lightning.utilities.argparse.html  # pylint: disable=line-too-long\n  It might not be the most realistic example,\n  but serves as a PoC to show that SystemSan works for Python.\"\"\"\n  os.environb[env_name.encode()] = env_value\n  parse_env_variables(Trainer, template=env_name)\n\n\ndef TestOneInput(data):  # pylint: disable=invalid-name\n  \"\"\"Exploit the target only with input data from fuzzers.\"\"\"\n  env_value, env_name = prepare_fuzzing_input(data)\n  exploit_target(env_value, env_name)\n\n\ndef main():\n  \"\"\"Fuzz target with atheris.\"\"\"\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/subprocess_popen_injection.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer displaying insecure use of subprocess.Popen.\"\"\"\n\nimport sys\nimport subprocess\nimport atheris\nimport pysecsan\n\n\ndef list_files_perhaps(param):\n  \"\"\"Insecure call to Popen.\"\"\"\n  try:\n    subprocess.Popen(' '.join(['ls', '-la', param]), shell=True)\n  except ValueError:\n    pass\n\n\ndef test_one_input(data):\n  \"\"\"Fuzzer entrypoint.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n\n  if fdp.ConsumeIntInRange(1, 10) == 5:\n    list_files_perhaps('FROMFUZZ')\n  else:\n    list_files_perhaps('.')\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n  pysecsan.add_hooks()\n\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/yaml_deserialization_general.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer for insecure yaml deserialization.\"\"\"\n\nimport sys\nimport yaml\nimport atheris\nimport pysecsan\n\n\ndef serialize_with_tainted_data(param):\n  \"\"\"Hit insecure yaml function.\"\"\"\n  try:\n    yaml.load(param, yaml.Loader)\n  except yaml.YAMLError:\n    pass\n\n\ndef test_one_input(data):\n  \"\"\"Fuzzer routine.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  serialize_with_tainted_data(fdp.ConsumeUnicodeNoSurrogates(32))\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n  pysecsan.add_hooks()\n\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/sanitizers/pysecsan/tests/yaml_deserialization_simple.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer triggering insecure yaml serialization.\"\"\"\n\nimport sys\nimport yaml\nimport atheris\nimport pysecsan\n\n\ndef serialize_with_tainted_data(param, magicval):\n  \"\"\"Pass data to insecure yaml functions.\"\"\"\n  if magicval == 1337:\n    try:\n      yaml.load(param, yaml.Loader)\n    except yaml.YAMLError:\n      pass\n  elif magicval == 1338:\n    try:\n      yaml.load('FROMFUZZ', yaml.Loader)\n    except yaml.YAMLError:\n      pass\n\n\ndef test_one_input(data):\n  \"\"\"Fuzzer entrypoint.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  serialize_with_tainted_data(fdp.ConsumeUnicodeNoSurrogates(32),\n                              fdp.ConsumeIntInRange(500, 1500))\n\n\ndef main():\n  \"\"\"Set up and start fuzzing.\"\"\"\n  pysecsan.add_hooks()\n\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/srcmap",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Deterimine srcmap of checked out source code\n\nSRCMAP=$(tempfile)\necho \"{}\" > $SRCMAP\n\n# $1 - json file, $2 - jq program\nfunction jq_inplace() {\n  F=$(tempfile) && cat $1 | jq \"$2\" > $F && mv $F $1\n}\n\nPATHS_TO_SCAN=\"$SRC\"\n\nif [[ $FUZZING_LANGUAGE == \"go\" ]]; then\n  PATHS_TO_SCAN=\"$PATHS_TO_SCAN $GOPATH\"\nfi\n\n# Git\nfor DOT_GIT_DIR in $(find $PATHS_TO_SCAN -name \".git\" -type d); do\n  GIT_DIR=$(dirname $DOT_GIT_DIR)\n  cd $GIT_DIR\n  GIT_URL=$(git config --get remote.origin.url)\n  GIT_REV=$(git rev-parse HEAD)\n  jq_inplace $SRCMAP \".\\\"$GIT_DIR\\\" = { type: \\\"git\\\", url: \\\"$GIT_URL\\\", rev: \\\"$GIT_REV\\\" }\"\ndone\n\n# Subversion\nfor DOT_SVN_DIR in $(find $PATHS_TO_SCAN -name \".svn\" -type d); do\n  SVN_DIR=$(dirname $DOT_SVN_DIR)\n  cd $SVN_DIR\n  SVN_URL=$(svn info | grep \"^URL:\" | sed  's/URL: //g')\n  SVN_REV=$(svn info -r HEAD | grep \"^Revision:\" | sed  's/Revision: //g')\n  jq_inplace $SRCMAP \".\\\"$SVN_DIR\\\" = { type: \\\"svn\\\", url: \\\"$SVN_URL\\\", rev: \\\"$SVN_REV\\\" }\"\ndone\n\n# Mercurial\nfor DOT_HG_DIR in $(find $PATHS_TO_SCAN -name \".hg\" -type d); do\n  HG_DIR=$(dirname $DOT_HG_DIR)\n  cd $HG_DIR\n  HG_URL=$(hg paths default)\n  HG_REV=$(hg --debug id -r. -i)\n  jq_inplace $SRCMAP \".\\\"$HG_DIR\\\" = { type: \\\"hg\\\", url: \\\"$HG_URL\\\", rev: \\\"$HG_REV\\\" }\"\ndone\n\nif [ \"${OSSFUZZ_REVISION-}\" != \"\" ]; then\n  jq_inplace $SRCMAP \".\\\"/src\\\" = { type: \\\"git\\\", url: \\\"https://github.com/google/oss-fuzz.git\\\", rev: \\\"$OSSFUZZ_REVISION\\\" }\"\nfi\n\ncat $SRCMAP\nrm $SRCMAP\n"
  },
  {
    "path": "infra/base-images/base-builder/test_data/culprit-commit.txt",
    "content": "ac9ee01fcbfac745aaedca0393a8e1c8a33acd8d is the first bad commit\ncommit ac9ee01fcbfac745aaedca0393a8e1c8a33acd8d\nAuthor: John Doe <johndoe@example.com>\nDate:   Tue Aug 6 08:41:53 2019 +0000\n\n    [compiler-rt] Implement getrandom interception\n    \n    Summary:\n    Straightforward implementation of `getrandom` syscall and libc\n    hooks.\n    \n    Test Plan: Local MSAN failures caused by uninstrumented `getrandom`\n    calls stop failing.\n    \n    Patch by John Doe 3.\n    \n    Reviewers: jonhdoe2, johndoe\n    \n    Reviewed By: johndoe\n    \n    Subscribers: johndoe4, johndoe5, #sanitizers, llvm-commits\n    \n    Tags: #sanitizers, #llvm\n    \n    Differential Revision: https://reviews.llvm.org/D65551\n    \n    llvm-svn: 367999\n\n:040000 040000 8db10511ca83cc7b0265c7703684cd386350151b 62508fdc5e8919bbb2a0bd185cc109868192cdb0 M      compiler-rt\nbisect run success\n"
  },
  {
    "path": "infra/base-images/base-builder/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-clang:ubuntu-20-04\n\nCOPY install_deps_ubuntu-20-04.sh install_swift_ubuntu-20-04.sh /\nRUN /install_deps_ubuntu-20-04.sh\n\n# Build and install latest Python 3.11.\nENV PYTHON_VERSION 3.11.13\nRUN PYTHON_DEPS=\"\\\n        zlib1g-dev \\\n        libncurses5-dev \\\n        libgdbm-dev \\\n        libnss3-dev \\\n        libssl-dev \\\n        libsqlite3-dev \\\n        libreadline-dev \\\n        libffi-dev \\\n        libbz2-dev \\\n        liblzma-dev\" && \\\n    unset CFLAGS CXXFLAGS && \\\n    apt-get install -y $PYTHON_DEPS && \\\n    cd /tmp && \\\n    curl -O https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz && \\\n    tar -xvf Python-$PYTHON_VERSION.tar.xz && \\\n    cd Python-$PYTHON_VERSION && \\\n    ./configure --enable-optimizations --enable-shared && \\\n    make -j$(nproc) && \\\n    make install && \\\n    ldconfig && \\\n    ln -s /usr/local/bin/python3 /usr/local/bin/python && \\\n    cd .. && \\\n    rm -r /tmp/Python-$PYTHON_VERSION.tar.xz /tmp/Python-$PYTHON_VERSION && \\\n    rm -rf /usr/local/lib/python${PYTHON_VERSION%.*}/test && \\\n    python3 -m ensurepip && \\\n    python3 -m pip install --upgrade pip && \\\n    apt-get remove -y $PYTHON_DEPS # https://github.com/google/oss-fuzz/issues/3888\n\n\nENV CCACHE_VERSION 4.10.2\nRUN cd /tmp && curl -OL https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION/ccache-$CCACHE_VERSION.tar.xz && \\\n    tar -xvf ccache-$CCACHE_VERSION.tar.xz && cd ccache-$CCACHE_VERSION && \\\n    mkdir build && cd build && \\\n    export LDFLAGS='-lpthread' && \\\n    cmake -D CMAKE_BUILD_TYPE=Release .. && \\\n    make -j && make install && \\\n    rm -rf /tmp/ccache-$CCACHE_VERSION /tmp/ccache-$CCACHE_VERSION.tar.xz\n\n# Install six for Bazel rules.\nRUN unset CFLAGS CXXFLAGS && pip3 install -v --no-cache-dir \\\n    six==1.15.0 absl-py==2.3.0 pyelftools==0.32 && rm -rf /tmp/*\n\n# Install Bazel through Bazelisk, which automatically fetches the latest Bazel version.\nENV BAZELISK_VERSION 1.9.0\nRUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v$BAZELISK_VERSION/bazelisk-linux-amd64 -o /usr/local/bin/bazel && \\\n    chmod +x /usr/local/bin/bazel\n\n# Default build flags for various sanitizers.\nENV SANITIZER_FLAGS_address \"-fsanitize=address -fsanitize-address-use-after-scope\"\nENV SANITIZER_FLAGS_hwaddress \"-fsanitize=hwaddress -fuse-ld=lld -Wno-unused-command-line-argument\"\n\n# Set of '-fsanitize' flags matches '-fno-sanitize-recover' + 'unsigned-integer-overflow'.\nENV SANITIZER_FLAGS_undefined \"-fsanitize=array-bounds,bool,builtin,enum,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr\"\n\n# Don't include \"function\" since it is unsupported on aarch64.\nENV SANITIZER_FLAGS_undefined_aarch64 \"-fsanitize=array-bounds,bool,builtin,enum,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr\"\n\nENV SANITIZER_FLAGS_memory \"-fsanitize=memory -fsanitize-memory-track-origins\"\n\nENV SANITIZER_FLAGS_thread \"-fsanitize=thread\"\n\nENV SANITIZER_FLAGS_introspector \"-O0 -flto -fno-inline-functions -fuse-ld=gold -Wno-unused-command-line-argument\"\n\n# Do not use any sanitizers in the coverage build.\nENV SANITIZER_FLAGS_coverage \"\"\n\n# We use unsigned-integer-overflow as an additional coverage signal and have to\n# suppress error messages. See https://github.com/google/oss-fuzz/issues/910.\nENV UBSAN_OPTIONS=\"silence_unsigned_overflow=1\"\n\n# To suppress warnings from binaries running during compilation.\nENV DFSAN_OPTIONS='warn_unimplemented=0'\n\n# Default build flags for coverage feedback.\nENV COVERAGE_FLAGS=\"-fsanitize=fuzzer-no-link\"\n\n# Use '-Wno-unused-command-line-argument' to suppress \"warning: -ldl: 'linker' input unused\"\n# messages which are treated as errors by some projects.\nENV COVERAGE_FLAGS_coverage \"-fprofile-instr-generate -fcoverage-mapping -pthread -Wl,--no-as-needed -Wl,-ldl -Wl,-lm -Wno-unused-command-line-argument\"\n\n# Default sanitizer, fuzzing engine and architecture to use.\nENV SANITIZER=\"address\"\nENV FUZZING_ENGINE=\"libfuzzer\"\nENV ARCHITECTURE=\"x86_64\"\n\n# DEPRECATED - NEW CODE SHOULD NOT USE THIS. OLD CODE SHOULD STOP. Please use\n# LIB_FUZZING_ENGINE instead.\n# Path to fuzzing engine library to support some old users of\n# LIB_FUZZING_ENGINE.\nENV LIB_FUZZING_ENGINE_DEPRECATED=\"/usr/lib/libFuzzingEngine.a\"\n\n# Argument passed to compiler to link against fuzzing engine.\n# Defaults to the path, but is \"-fsanitize=fuzzer\" in libFuzzer builds.\nENV LIB_FUZZING_ENGINE=\"/usr/lib/libFuzzingEngine.a\"\n\n# TODO: remove after tpm2 catchup.\nENV FUZZER_LDFLAGS \"\"\n\nWORKDIR $SRC\n\nCOPY afl_llvm22_patch.diff $SRC/\nRUN git clone https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \\\n    cd aflplusplus && \\\n    git checkout eadc8a2a7e0fa0338802ee6254bf296489ce4fd7 && \\\n    wget --no-check-certificate -O oss.sh https://raw.githubusercontent.com/vanhauser-thc/binary_blobs/master/oss.sh && \\\n    git apply $SRC/afl_llvm22_patch.diff && \\\n    rm -rf .git && \\\n    chmod 755 oss.sh\n\n# Do precompiles before copying other scripts for better cache efficiency.\nCOPY precompile_afl /usr/local/bin/\nRUN precompile_afl\n\nRUN cd $SRC && \\\n    curl -L -O https://github.com/google/honggfuzz/archive/oss-fuzz.tar.gz && \\\n    mkdir honggfuzz && \\\n    cd honggfuzz && \\\n    tar -xz --strip-components=1 -f $SRC/oss-fuzz.tar.gz && \\\n    rm -rf examples $SRC/oss-fuzz.tar.gz\n\n\nCOPY precompile_honggfuzz_ubuntu_20_04 /usr/local/bin/\nRUN precompile_honggfuzz_ubuntu_20_04\n\nRUN cd $SRC && \\\n    git clone https://github.com/google/fuzztest && \\\n    cd fuzztest && \\\n    git checkout a37d133f714395cabc20dd930969a889495c9f53 && \\\n    rm -rf .git\n\nENV CENTIPEDE_BIN_DIR=$SRC/fuzztest/bazel-bin\nCOPY precompile_centipede /usr/local/bin/\nRUN precompile_centipede\n\nCOPY sanitizers /usr/local/lib/sanitizers\n\nCOPY bazel_build_fuzz_tests \\\n    cargo \\\n    compile \\\n    compile_afl \\\n    compile_centipede \\\n    compile_honggfuzz \\\n    compile_fuzztests.sh \\\n    compile_go_fuzzer \\\n    compile_javascript_fuzzer \\\n    compile_libfuzzer \\\n    compile_native_go_fuzzer \\\n    compile_native_go_fuzzer_v2 \\\n    go_utils.sh \\\n    compile_python_fuzzer \\\n    debug_afl \\\n    # Go, JavaScript, Java, Python, Rust, and Swift installation scripts.\n    install_go.sh \\\n    install_javascript.sh \\\n    install_java.sh \\\n    install_python.sh \\\n    install_ruby.sh \\\n    install_rust.sh \\\n    install_swift_ubuntu-20-04.sh \\\n    make_build_replayable.py \\\n    python_coverage_helper.py \\\n    replay_build.sh \\\n    srcmap \\\n    write_labels.py \\\n    unshallow_repos.py \\\n    /usr/local/bin/\n\n# TODO: Build this as part of a multi-stage build.\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang-jcc /usr/local/bin/\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang++-jcc /usr/local/bin\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang-jcc2 /usr/local/bin/\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang++-jcc2 /usr/local/bin\nRUN chmod +x /usr/local/bin/clang-jcc /usr/local/bin/clang++-jcc /usr/local/bin/clang-jcc2 /usr/local/bin/clang++-jcc2\n\nCOPY llvmsymbol.diff $SRC\nCOPY detect_repo.py /opt/cifuzz/\nCOPY bazel.bazelrc /root/.bazelrc\n\n# Set up ccache binary and cache directory.\n# /ccache/bin will contain the compiler wrappers, and /ccache/cache will\n# contain the actual cache, which can be saved.\n# To use this, set PATH=/ccache/bin:$PATH.\nRUN mkdir -p /ccache/bin && mkdir -p /ccache/cache && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang++ && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang-jcc && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang++-jcc\nENV CCACHE_DIR /ccache/cache\n\n# Don't check that the compiler is the same, so we can switch between jcc and\n# clang under the hood and re-use the same build cache.\nENV CCACHE_COMPILERCHECK none\nENV CCACHE_COMPILERTYPE clang\n\n# Build newer patchelf than the one available from Ubuntu.\nRUN cd /tmp && git clone https://github.com/NixOS/patchelf && \\\n    apt-get update && apt-get install -y autoconf && \\\n    cd patchelf && git checkout 523f401584d9584e76c9c77004e7abeb9e6c4551 && \\\n    unset CFLAGS && export CXXFLAGS='-stdlib=libc++' && export LDFLAGS='-lpthread' && \\\n    ./bootstrap.sh && ./configure && make && \\\n    cp /tmp/patchelf/src/patchelf /usr/local/bin && \\\n    rm -rf /tmp/patchelf && apt-get remove -y autoconf\n\nCOPY indexer /opt/indexer\nCOPY --from=gcr.io/oss-fuzz-base/indexer /indexer/build/indexer /opt/indexer/indexer\nRUN chmod a+x /opt/indexer/indexer /opt/indexer/index_build.py\n\nCMD [\"compile\"]\n"
  },
  {
    "path": "infra/base-images/base-builder/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-clang:ubuntu-24-04\n\nCOPY install_deps_ubuntu-24-04.sh install_swift_ubuntu-24-04.sh /\nRUN /install_deps_ubuntu-24-04.sh\n\n# Build and install latest Python 3.11.\nENV PYTHON_VERSION 3.11.13\nRUN PYTHON_DEPS=\"\\\n        zlib1g-dev \\\n        libncurses-dev \\\n        libgdbm-dev \\\n        libnss3-dev \\\n        libssl-dev \\\n        libsqlite3-dev \\\n        libreadline-dev \\\n        libffi-dev \\\n        libbz2-dev \\\n        liblzma-dev\" && \\\n    unset CFLAGS CXXFLAGS && \\\n    apt-get install -y $PYTHON_DEPS && \\\n    cd /tmp && \\\n    curl -O https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz && \\\n    tar -xvf Python-$PYTHON_VERSION.tar.xz && \\\n    cd Python-$PYTHON_VERSION && \\\n    ./configure --enable-optimizations --enable-shared && \\\n    make -j$(nproc) && \\\n    make install && \\\n    ldconfig && \\\n    ln -s /usr/local/bin/python3 /usr/local/bin/python && \\\n    cd .. && \\\n    rm -r /tmp/Python-$PYTHON_VERSION.tar.xz /tmp/Python-$PYTHON_VERSION && \\\n    rm -rf /usr/local/lib/python${PYTHON_VERSION%.*}/test && \\\n    python3 -m ensurepip && \\\n    python3 -m pip install --upgrade pip && \\\n    apt-get remove -y $PYTHON_DEPS # https://github.com/google/oss-fuzz/issues/3888\n\n\nENV CCACHE_VERSION 4.10.2\nRUN cd /tmp && curl -OL https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION/ccache-$CCACHE_VERSION.tar.xz && \\\n    tar -xvf ccache-$CCACHE_VERSION.tar.xz && cd ccache-$CCACHE_VERSION && \\\n    mkdir build && cd build && \\\n    export LDFLAGS='-lpthread' && \\\n    cmake -D CMAKE_BUILD_TYPE=Release .. && \\\n    make -j && make install && \\\n    rm -rf /tmp/ccache-$CCACHE_VERSION /tmp/ccache-$CCACHE_VERSION.tar.xz\n\n# Install six for Bazel rules.\nRUN unset CFLAGS CXXFLAGS && pip3 install -v --no-cache-dir \\\n    six==1.15.0 absl-py==2.3.0 pyelftools==0.32 && rm -rf /tmp/*\n\n# Install Bazel through Bazelisk, which automatically fetches the latest Bazel version.\nENV BAZELISK_VERSION 1.9.0\nRUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v$BAZELISK_VERSION/bazelisk-linux-amd64 -o /usr/local/bin/bazel && \\\n    chmod +x /usr/local/bin/bazel\n\n# Default build flags for various sanitizers.\nENV SANITIZER_FLAGS_address \"-fsanitize=address -fsanitize-address-use-after-scope\"\nENV SANITIZER_FLAGS_hwaddress \"-fsanitize=hwaddress -fuse-ld=lld -Wno-unused-command-line-argument\"\n\n# Set of '-fsanitize' flags matches '-fno-sanitize-recover' + 'unsigned-integer-overflow'.\nENV SANITIZER_FLAGS_undefined \"-fsanitize=array-bounds,bool,builtin,enum,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr\"\n\n# Don't include \"function\" since it is unsupported on aarch64.\nENV SANITIZER_FLAGS_undefined_aarch64 \"-fsanitize=array-bounds,bool,builtin,enum,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr\"\n\nENV SANITIZER_FLAGS_memory \"-fsanitize=memory -fsanitize-memory-track-origins\"\n\nENV SANITIZER_FLAGS_thread \"-fsanitize=thread\"\n\nENV SANITIZER_FLAGS_introspector \"-O0 -flto -fno-inline-functions -fuse-ld=gold -Wno-unused-command-line-argument\"\n\n# Do not use any sanitizers in the coverage build.\nENV SANITIZER_FLAGS_coverage \"\"\n\n# We use unsigned-integer-overflow as an additional coverage signal and have to\n# suppress error messages. See https://github.com/google/oss-fuzz/issues/910.\nENV UBSAN_OPTIONS=\"silence_unsigned_overflow=1\"\n\n# To suppress warnings from binaries running during compilation.\nENV DFSAN_OPTIONS='warn_unimplemented=0'\n\n# Default build flags for coverage feedback.\nENV COVERAGE_FLAGS=\"-fsanitize=fuzzer-no-link\"\n\n# Use '-Wno-unused-command-line-argument' to suppress \"warning: -ldl: 'linker' input unused\"\n# messages which are treated as errors by some projects.\nENV COVERAGE_FLAGS_coverage \"-fprofile-instr-generate -fcoverage-mapping -pthread -Wl,--no-as-needed -Wl,-ldl -Wl,-lm -Wno-unused-command-line-argument\"\n\n# Default sanitizer, fuzzing engine and architecture to use.\nENV SANITIZER=\"address\"\nENV FUZZING_ENGINE=\"libfuzzer\"\nENV ARCHITECTURE=\"x86_64\"\n\n# DEPRECATED - NEW CODE SHOULD NOT USE THIS. OLD CODE SHOULD STOP. Please use\n# LIB_FUZZING_ENGINE instead.\n# Path to fuzzing engine library to support some old users of\n# LIB_FUZZING_ENGINE.\nENV LIB_FUZZING_ENGINE_DEPRECATED=\"/usr/lib/libFuzzingEngine.a\"\n\n# Argument passed to compiler to link against fuzzing engine.\n# Defaults to the path, but is \"-fsanitize=fuzzer\" in libFuzzer builds.\nENV LIB_FUZZING_ENGINE=\"/usr/lib/libFuzzingEngine.a\"\n\n# TODO: remove after tpm2 catchup.\nENV FUZZER_LDFLAGS \"\"\n\nWORKDIR $SRC\n\nCOPY afl_llvm22_patch.diff $SRC/\nRUN git clone https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \\\n    cd aflplusplus && \\\n    git checkout eadc8a2a7e0fa0338802ee6254bf296489ce4fd7 && \\\n    wget --no-check-certificate -O oss.sh https://raw.githubusercontent.com/vanhauser-thc/binary_blobs/master/oss.sh && \\\n    git apply $SRC/afl_llvm22_patch.diff && \\\n    rm -rf .git && \\\n    chmod 755 oss.sh\n\n# Do precompiles before copying other scripts for better cache efficiency.\nCOPY precompile_afl /usr/local/bin/\nRUN precompile_afl\n\nRUN cd $SRC && \\\n    curl -L -O https://github.com/google/honggfuzz/archive/oss-fuzz.tar.gz && \\\n    mkdir honggfuzz && \\\n    cd honggfuzz && \\\n    tar -xz --strip-components=1 -f $SRC/oss-fuzz.tar.gz && \\\n    rm -rf examples $SRC/oss-fuzz.tar.gz\n\n\nCOPY precompile_honggfuzz_ubuntu_24_04 /usr/local/bin/\nRUN precompile_honggfuzz_ubuntu_24_04\n\nRUN cd $SRC && \\\n    git clone https://github.com/google/fuzztest && \\\n    cd fuzztest && \\\n    git checkout a37d133f714395cabc20dd930969a889495c9f53 && \\\n    rm -rf .git\n\nENV CENTIPEDE_BIN_DIR=$SRC/fuzztest/bazel-bin\nCOPY precompile_centipede /usr/local/bin/\nRUN precompile_centipede\n\nCOPY sanitizers /usr/local/lib/sanitizers\n\nCOPY bazel_build_fuzz_tests \\\n    cargo \\\n    compile \\\n    compile_afl \\\n    compile_centipede \\\n    compile_honggfuzz \\\n    compile_fuzztests.sh \\\n    compile_go_fuzzer \\\n    compile_javascript_fuzzer \\\n    compile_libfuzzer \\\n    compile_native_go_fuzzer \\\n    compile_native_go_fuzzer_v2 \\\n    go_utils.sh \\\n    compile_python_fuzzer \\\n    debug_afl \\\n    # Go, JavaScript, Java, Python, Rust, and Swift installation scripts.\n    install_go.sh \\\n    install_javascript.sh \\\n    install_java.sh \\\n    install_python.sh \\\n    install_ruby.sh \\\n    install_rust.sh \\\n    install_swift_ubuntu-24-04.sh \\\n    make_build_replayable.py \\\n    python_coverage_helper.py \\\n    replay_build.sh \\\n    srcmap \\\n    write_labels.py \\\n    unshallow_repos.py \\\n    /usr/local/bin/\n\n# TODO: Build this as part of a multi-stage build.\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang-jcc /usr/local/bin/\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang++-jcc /usr/local/bin\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang-jcc2 /usr/local/bin/\nADD https://commondatastorage.googleapis.com/clusterfuzz-builds/jcc/clang++-jcc2 /usr/local/bin\nRUN chmod +x /usr/local/bin/clang-jcc /usr/local/bin/clang++-jcc /usr/local/bin/clang-jcc2 /usr/local/bin/clang++-jcc2\n\nCOPY indexer /opt/indexer\nCOPY --from=gcr.io/oss-fuzz-base/indexer:ubuntu-24-04 /indexer/build/indexer /opt/indexer/indexer\nRUN chmod a+x /opt/indexer/indexer /opt/indexer/index_build.py\n\nCOPY llvmsymbol.diff $SRC\nCOPY detect_repo.py /opt/cifuzz/\nCOPY bazel.bazelrc /root/.bazelrc\n\n# Set up ccache binary and cache directory.\n# /ccache/bin will contain the compiler wrappers, and /ccache/cache will\n# contain the actual cache, which can be saved.\n# To use this, set PATH=/ccache/bin:$PATH.\nRUN mkdir -p /ccache/bin && mkdir -p /ccache/cache && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang++ && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang-jcc && \\\n    ln -s /usr/local/bin/ccache /ccache/bin/clang++-jcc\nENV CCACHE_DIR /ccache/cache\n\n# Don't check that the compiler is the same, so we can switch between jcc and\n# clang under the hood and re-use the same build cache.\nENV CCACHE_COMPILERCHECK none\nENV CCACHE_COMPILERTYPE clang\n\n# Build newer patchelf than the one available from Ubuntu.\nRUN cd /tmp && git clone https://github.com/NixOS/patchelf && \\\n    apt-get update && apt-get install -y autoconf && \\\n    cd patchelf && git checkout 523f401584d9584e76c9c77004e7abeb9e6c4551 && \\\n    unset CFLAGS && export CXXFLAGS='-stdlib=libc++' && export LDFLAGS='-lpthread' && \\\n    ./bootstrap.sh && ./configure && make && \\\n    cp /tmp/patchelf/src/patchelf /usr/local/bin && \\\n    rm -rf /tmp/patchelf && apt-get remove -y autoconf\n\nCMD [\"compile\"]\n"
  },
  {
    "path": "infra/base-images/base-builder/unshallow_repos.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Script to unshallow repositories.\"\"\"\nimport argparse\nimport os\nimport pathlib\nimport re\nimport subprocess\n\nSRC = pathlib.Path(os.getenv('SRC', '/src'))\n\n\ndef main():\n  parser = argparse.ArgumentParser(description='Unshallows repositores.')\n  parser.add_argument('repos', nargs='+', help='Repo URLs')\n\n  args = parser.parse_args()\n  repos = set()\n  for repo in args.repos:\n    repos.add(_normalize_repo(repo))\n\n  for subdir in SRC.iterdir():\n    if (subdir / '.git').exists():\n      repo = subprocess.check_output(['git', 'remote', 'get-url', 'origin'],\n                                     cwd=subdir).decode().strip()\n      if _normalize_repo(repo) in repos:\n        if not _is_shallow_repo(subdir):\n          continue\n        print(f'Unshallowing {repo} at {subdir}.')\n        subprocess.check_call(['git', 'fetch', '--unshallow'], cwd=subdir)\n\n\ndef _normalize_repo(repo: str) -> str:\n  return re.sub(r'(.git)?/?$', '', repo)\n\n\ndef _is_shallow_repo(directory: pathlib.Path):\n  return subprocess.check_output(\n      ['git', 'rev-parse', '--is-shallow-repository'],\n      cwd=directory).decode().strip() == 'true'\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder/write_labels.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Script for writing from project.yaml to .labels file.\"\"\"\n\nimport os\nimport json\nimport sys\n\n\ndef main():\n  \"\"\"Writes labels.\"\"\"\n  if len(sys.argv) != 3:\n    print('Usage: write_labels.py labels_json out_dir', file=sys.stderr)\n    sys.exit(1)\n\n  labels_by_target = json.loads(sys.argv[1])\n  out = sys.argv[2]\n\n  for target_name, labels in labels_by_target.items():\n    # Skip over wildcard value applying to all fuzz targets\n    if target_name == '*':\n      continue\n    with open(os.path.join(out, target_name + '.labels'), 'w') as file_handle:\n      file_handle.write('\\n'.join(labels))\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-fuzzbench\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-fuzzbench` were successfully built. These images install dependencies for FuzzBench, a service for evaluating fuzzers. The build process required several modifications to the `fuzzbench_install_dependencies` script to handle package version incompatibilities and differences between Ubuntu 20.04 and 24.04.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-fuzzbench:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-fuzzbench:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe `ubuntu-24-04` image includes newer versions of many packages, including Python development libraries. The `fuzzbench_install_dependencies` script was updated to handle these differences.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Dependency Installation:** The `fuzzbench_install_dependencies` script was modified to:\n    *   Update the `pytype` version to `2024.4.11`.\n    *   Update the `Orange3` package version to `3.39.0`.\n    *   Add version detection logic to install the correct Python development packages for each Ubuntu version.\n    *   Install `lsb-release` to support the version detection logic.\n"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Copy/Run this now to make the cache more resilient.\nCOPY fuzzbench_install_dependencies /usr/local/bin\nRUN fuzzbench_install_dependencies\n\nENV OSS_FUZZ_ON_DEMAND=1\n\nCOPY fuzzbench_build fuzzbench_run_fuzzer fuzzbench_measure /usr/local/bin/"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/fuzzbench_build",
    "content": "#! /bin/bash -eux\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# TODO(metzman): Do this in a docket image so we don't need to waste time\n# reinstalling.\nPYTHONPATH=$FUZZBENCH_PATH python3 -B -u -c \"from fuzzers.$FUZZING_ENGINE import fuzzer; fuzzer.build()\"\n\nif [ \"$FUZZING_ENGINE\" = \"coverage\" ]; then\n  cd $OUT\n  mkdir -p filestore/oss-fuzz-on-demand/coverage-binaries\n  # We expect an error regarding leading slashes. Just assume this step succeeds.\n  # TODO(metzman): Fix this when I get a chance.\n  tar -czvf filestore/oss-fuzz-on-demand/coverage-binaries/coverage-build-$PROJECT.tar.gz * /src /work || exit 0\nfi\n"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies",
    "content": "#! /bin/bash -eux\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\napt-get update && apt-get install -y gcc gfortran python-dev libopenblas-dev liblapack-dev cython libpq-dev\nwget -O /tmp/requirements.txt https://raw.githubusercontent.com/google/fuzzbench/master/requirements.txt\npip3 install pip --upgrade\nCFLAGS= CXXFLAGS= pip3 install -r /tmp/requirements.txt\nrm /tmp/requirements.txt\n"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies_ubuntu_20_04",
    "content": "#! /bin/bash -eux\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\napt-get update && apt-get install -y gcc gfortran python-dev libopenblas-dev liblapack-dev cython libpq-dev\nwget -O /tmp/requirements.txt https://raw.githubusercontent.com/google/fuzzbench/master/requirements.txt\npip3 install pip --upgrade\nCFLAGS= CXXFLAGS= pip3 install -r /tmp/requirements.txt\nrm /tmp/requirements.txt"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies_ubuntu_24_04",
    "content": "#! /bin/bash -eux\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [[ $(lsb_release -rs) == \"20.04\" ]]; then\n  apt-get update && apt-get install -y gcc gfortran python-dev libopenblas-dev liblapack-dev cython libpq-dev\nelse\n  apt-get update && apt-get install -y gcc gfortran python3-dev libopenblas-dev liblapack-dev cython3 libpq-dev\nfi\nwget -O /tmp/requirements.txt https://raw.githubusercontent.com/google/fuzzbench/master/requirements.txt\npip3 install pip --upgrade\nCFLAGS= CXXFLAGS= pip3 install -r /tmp/requirements.txt\nrm /tmp/requirements.txt\n"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/fuzzbench_measure",
    "content": "#! /bin/bash -eux\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# TODO(metzman): Make these configurable.\nexport DB_PATH=$OUT/experiment.db\nexport SNAPSHOT_PERIOD=30\nexport EXPERIMENT_FILESTORE=$OUT/filestore\nexport MAX_TOTAL_TIME=120\nexport EXPERIMENT=oss-fuzz-on-demand\n\nrm -f $DB_PATH\n\n# FUZZER=mopt BENCHMARK=skcms\n\nexport SQL_DATABASE_URL=sqlite:///$DB_PATH\n\ncd $FUZZBENCH_PATH\nPYTHONPATH=. python3 -B experiment/measurer/standalone.py $MAX_TOTAL_TIME\n"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/fuzzbench_run_fuzzer",
    "content": "#! /bin/bash -eux\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport RUNNER_NICENESS=\"-5\"\nexport EXPERIMENT_FILESTORE=$OUT/filestore\nexport EXPERIMENT=oss-fuzz-on-demand\nexport OSS_FUZZ_ON_DEMAND=1\nexport OUTPUT_CORPUS_DIR=/output-corpus\nexport SEED_CORPUS_DIR=/input-corpus\nmkdir $SEED_CORPUS_DIR\nrm -rf $OUTPUT_CORPUS_DIR\nmkdir $OUTPUT_CORPUS_DIR\nexport FUZZER=$FUZZING_ENGINE\nexport SNAPSHOT_PERIOD=$((MAX_TOTAL_TIME / 3))\nexport TRIAL_ID=1\nexport FORCE_LOCAL=1\n\n# BENCHMARK, FUZZ_TARGET\ncd $OUT\n\n# Prevent permissions issues with pyc files and docker.\ncp -r $FUZZBENCH_PATH /tmp/fuzzbench\n\nPYTHONPATH=/tmp/fuzzbench nice -n $RUNNER_NICENESS python3 -B -u /tmp/fuzzbench/experiment/runner.py\ncat $EXPERIMENT_FILESTORE/$EXPERIMENT/experiment-folders/$BENCHMARK-$FUZZER/trial-$TRIAL_ID/results/fuzzer-log.txt\n"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04\n\n# Copy/Run this now to make the cache more resilient.\nCOPY fuzzbench_install_dependencies_ubuntu_20_04 /usr/local/bin\nRUN fuzzbench_install_dependencies_ubuntu_20_04\n\nENV OSS_FUZZ_ON_DEMAND=1\n\nCOPY fuzzbench_build fuzzbench_run_fuzzer fuzzbench_measure /usr/local/bin/"
  },
  {
    "path": "infra/base-images/base-builder-fuzzbench/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\n# Copy/Run this now to make the cache more resilient.\nCOPY fuzzbench_install_dependencies_ubuntu_24_04 /usr/local/bin\nRUN fuzzbench_install_dependencies_ubuntu_24_04\n\nENV OSS_FUZZ_ON_DEMAND=1\n\nCOPY fuzzbench_build fuzzbench_run_fuzzer fuzzbench_measure /usr/local/bin/"
  },
  {
    "path": "infra/base-images/base-builder-go/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-go\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-go` were successfully built. These images install the Go programming language and related fuzzing tools on top of the `base-builder` image. The build process for both versions is nearly identical, with the primary difference being the base image used.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-go:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-go:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThere are no significant package differences introduced in this build stage, as the dependencies are inherited from the `base-builder` image.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions are very similar and perform the following actions:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Go Installation:** The `install_go.sh` script is used to download and install Go.\n*   **Go Fuzzing Tools:** The Dockerfiles install several Go-based fuzzing tools, including `go114-fuzz-build` and `go-118-fuzz-build`.\n"
  },
  {
    "path": "infra/base-images/base-builder-go/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Set up Golang environment variables (copied from /root/.bash_profile).\nENV GOPATH /root/go\n\n# /root/.go/bin is for the standard Go binaries (i.e. go, gofmt, etc).\n# $GOPATH/bin is for the binaries from the dependencies installed via \"go get\".\nENV PATH $PATH:/root/.go/bin:$GOPATH/bin\n\nCOPY gosigfuzz.c $GOPATH/gosigfuzz/\n\nRUN install_go.sh\n\n# TODO(jonathanmetzman): Install this file using install_go.sh.\nCOPY ossfuzz_coverage_runner.go \\\n     $GOPATH/\n"
  },
  {
    "path": "infra/base-images/base-builder-go/gosigfuzz.c",
    "content": "/*\n * Copyright 2023 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n#include<stdlib.h>\n#include<signal.h>\n\nstatic void fixSignalHandler(int signum) {\n    struct sigaction new_action;\n    struct sigaction old_action;\n    sigemptyset (&new_action.sa_mask);\n    sigaction (signum, NULL, &old_action);\n    new_action.sa_flags = old_action.sa_flags | SA_ONSTACK;\n    new_action.sa_sigaction = old_action.sa_sigaction;\n    new_action.sa_handler = old_action.sa_handler;\n    sigaction (signum, &new_action, NULL);\n}\n\nstatic void FixStackSignalHandler() {\n    fixSignalHandler(SIGSEGV);\n    fixSignalHandler(SIGABRT);\n    fixSignalHandler(SIGALRM);\n    fixSignalHandler(SIGINT);\n    fixSignalHandler(SIGTERM);\n    fixSignalHandler(SIGBUS);\n    fixSignalHandler(SIGFPE);\n    fixSignalHandler(SIGXFSZ);\n    fixSignalHandler(SIGUSR1);\n    fixSignalHandler(SIGUSR2);\n}\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n    FixStackSignalHandler();\n    return 0;\n}\n"
  },
  {
    "path": "infra/base-images/base-builder-go/ossfuzz_coverage_runner.go",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage mypackagebeingfuzzed\n\nimport (\n\t\"io/fs\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime/pprof\"\n\t\"testing\"\n)\n\nfunc TestFuzzCorpus(t *testing.T) {\n\tdir := os.Getenv(\"FUZZ_CORPUS_DIR\")\n\tif dir == \"\" {\n\t\tt.Logf(\"No fuzzing corpus directory set\")\n\t\treturn\n\t}\n\tfilename := \"\"\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tt.Error(\"Fuzz panicked in \"+filename, r)\n\t\t}\n\t}()\n\tprofname := os.Getenv(\"FUZZ_PROFILE_NAME\")\n\tif profname != \"\" {\n\t\tf, err := os.Create(profname + \".cpu.prof\")\n\t\tif err != nil {\n\t\t\tt.Logf(\"error creating profile file %s\\n\", err)\n\t\t} else {\n\t\t\t_ = pprof.StartCPUProfile(f)\n\t\t}\n\t}\n\t_, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\tt.Logf(\"Not fuzzing corpus directory %s\", err)\n\t\treturn\n\t}\n\t// recurse for regressions subdirectory\n\terr = filepath.Walk(dir, func(fname string, info fs.FileInfo, err error) error {\n\t\tif info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tdata, err := ioutil.ReadFile(fname)\n\t\tif err != nil {\n\t\t\tt.Error(\"Failed to read corpus file\", err)\n\t\t\treturn err\n\t\t}\n\t\tfilename = fname\n\t\tFuzzFunction(data)\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tt.Error(\"Failed to run corpus\", err)\n\t}\n\tif profname != \"\" {\n\t\tpprof.StopCPUProfile()\n\t\tf, err := os.Create(profname + \".heap.prof\")\n\t\tif err != nil {\n\t\t\tt.Logf(\"error creating heap profile file %s\\n\", err)\n\t\t}\n\t\tif err = pprof.WriteHeapProfile(f); err != nil {\n\t\t\tt.Logf(\"error writing heap profile file %s\\n\", err)\n\t\t}\n\t\tf.Close()\n\t}\n}\n"
  },
  {
    "path": "infra/base-images/base-builder-go/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04\n\n# Set up Golang environment variables (copied from /root/.bash_profile).\nENV GOPATH /root/go\n\n# /root/.go/bin is for the standard Go binaries (i.e. go, gofmt, etc).\n# $GOPATH/bin is for the binaries from the dependencies installed via \"go get\".\nENV PATH $PATH:/root/.go/bin:$GOPATH/bin\n\nCOPY gosigfuzz.c $GOPATH/gosigfuzz/\n\nRUN install_go.sh\n\n# TODO(jonathanmetzman): Install this file using install_go.sh.\nCOPY ossfuzz_coverage_runner.go \\\n     $GOPATH/\n"
  },
  {
    "path": "infra/base-images/base-builder-go/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not a use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\n# Set up Golang environment variables (copied from /root/.bash_profile).\nENV GOPATH /root/go\n\n# /root/.go/bin is for the standard Go binaries (i.e. go, gofmt, etc).\n# $GOPATH/bin is for the binaries from the dependencies installed via \"go get\".\nENV PATH $PATH:/root/.go/bin:$GOPATH/bin\n\nCOPY gosigfuzz.c $GOPATH/gosigfuzz/\n\nRUN install_go.sh\n\n# TODO(jonathanmetzman): Install this file using install_go.sh.\nCOPY ossfuzz_coverage_runner.go \\\n     $GOPATH/\n"
  },
  {
    "path": "infra/base-images/base-builder-javascript/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-javascript\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-javascript` were successfully built. These images install Node.js and other JavaScript-related tools on top of the `base-builder` image. The build process for both versions is straightforward and relies on the `install_javascript.sh` script, which is compatible with both base images.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-javascript:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-javascript:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe primary difference is the version of Node.js installed, which is Node.js 20.x for both versions, but the underlying dependencies may differ due to the base image.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions are very similar and perform the following actions:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Node.js Installation:** The `install_javascript.sh` script is used to add the Node.js repository and install Node.js.\n"
  },
  {
    "path": "infra/base-images/base-builder-javascript/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN install_javascript.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-javascript/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04\n\nRUN install_javascript.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-javascript/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN install_javascript.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-jvm/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-jvm\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-jvm` were successfully built. These images install the Java Development Kit (JDK) and the Jazzer fuzzer on top of the `base-builder` image. The `ubuntu-24-04` build required fixing syntax errors in the Dockerfile, specifically missing line continuation characters (`\\`). After these corrections, both builds completed successfully.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-jvm:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-jvm:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe primary difference is the Java version installed. Both versions install OpenJDK 17 and 15. The underlying dependencies may differ due to the base image.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Java Installation:** The `install_java.sh` script is used to download and install OpenJDK 17 and 15.\n*   **Jazzer Installation:** Both versions clone the Jazzer repository and build it using Bazel.\n*   **Dockerfile Syntax:** The `ubuntu-24-04` Dockerfile had syntax errors that were corrected.\n"
  },
  {
    "path": "infra/base-images/base-builder-jvm/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder AS base\n\nENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64\nENV JAVA_15_HOME /usr/lib/jvm/java-15-openjdk-amd64\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $PATH:$JAVA_HOME/bin\nENV JAZZER_API_PATH \"/usr/local/lib/jazzer_api_deploy.jar\"\nENV JAZZER_JUNIT_PATH \"/usr/local/bin/jazzer_junit.jar\"\n\nRUN install_java.sh\n\nRUN chmod 777 /usr/local/bin && chmod 777 /usr/local/lib\n\nFROM base AS builder\nRUN useradd -m jazzer_user\n\nUSER jazzer_user\n\nWORKDIR $SRC\n\n# Install Jazzer version 0.26.0\nRUN git clone https://github.com/CodeIntelligenceTesting/jazzer && \\\n    cd jazzer && \\\n    git checkout 86378b7a20f08165e72a45582d6a9a5091212318\n\nWORKDIR $SRC/jazzer\n\nRUN echo \"build --java_runtime_version=local_jdk_17\" >> .bazelrc \\\n    && echo \"build --cxxopt=-stdlib=libc++\" >> .bazelrc \\\n    && echo \"build --linkopt=-lc++\" >> .bazelrc\n\nRUN bazel build \\\n    //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar \\\n    //deploy:jazzer-api \\\n    //deploy:jazzer-junit \\\n    //launcher:jazzer\n\nRUN cp $(bazel cquery --output=files //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar) /usr/local/bin/jazzer_agent_deploy.jar && \\\n    cp $(bazel cquery --output=files //launcher:jazzer) /usr/local/bin/jazzer_driver && \\\n    cp $(bazel cquery --output=files //deploy:jazzer-api) $JAZZER_API_PATH && \\\n    cp $(bazel cquery --output=files //deploy:jazzer-junit) $JAZZER_JUNIT_PATH\n\nFROM base AS final\n\nCOPY --from=builder /usr/local/bin/jazzer_agent_deploy.jar /usr/local/bin/jazzer_agent_deploy.jar\nCOPY --from=builder /usr/local/bin/jazzer_driver /usr/local/bin/jazzer_driver\nCOPY --from=builder $JAZZER_API_PATH $JAZZER_API_PATH\nCOPY --from=builder $JAZZER_JUNIT_PATH $JAZZER_JUNIT_PATH\n\nRUN chmod 755 /usr/local/bin && chmod 755 /usr/local/lib\n\nWORKDIR $SRC\n"
  },
  {
    "path": "infra/base-images/base-builder-jvm/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04 AS base\n\nENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64\nENV JAVA_15_HOME /usr/lib/jvm/java-15-openjdk-amd64\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $PATH:$JAVA_HOME/bin\nENV JAZZER_API_PATH \"/usr/local/lib/jazzer_api_deploy.jar\"\nENV JAZZER_JUNIT_PATH \"/usr/local/bin/jazzer_junit.jar\"\n\nRUN install_java.sh\n\nRUN chmod 777 /usr/local/bin && chmod 777 /usr/local/lib\n\nFROM base AS builder\nRUN useradd -m jazzer_user\n\nUSER jazzer_user\n\nWORKDIR $SRC\n\nRUN git clone https://github.com/CodeIntelligenceTesting/jazzer && \\\n    cd jazzer && \\\n    git checkout 11b42852df4344737df54a380c2f522025bb4e84\n\nWORKDIR $SRC/jazzer\n\nRUN echo \"build --java_runtime_version=local_jdk_17\" >> .bazelrc \\\n    && echo \"build --cxxopt=-stdlib=libc++\" >> .bazelrc \\\n    && echo \"build --linkopt=-lc++\" >> .bazelrc\n\nRUN bazel build \\\n    //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar \\\n    //deploy:jazzer-api \\\n    //deploy:jazzer-junit \\\n    //launcher:jazzer\n\nRUN cp $(bazel cquery --output=files //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar) /usr/local/bin/jazzer_agent_deploy.jar && \\\n    cp $(bazel cquery --output=files //launcher:jazzer) /usr/local/bin/jazzer_driver && \\\n    cp $(bazel cquery --output=files //deploy:jazzer-api) $JAZZER_API_PATH && \\\n    cp $(bazel cquery --output=files //deploy:jazzer-junit) $JAZZER_JUNIT_PATH\n\nFROM base AS final\n\nCOPY --from=builder /usr/local/bin/jazzer_agent_deploy.jar /usr/local/bin/jazzer_agent_deploy.jar\nCOPY --from=builder /usr/local/bin/jazzer_driver /usr/local/bin/jazzer_driver\nCOPY --from=builder $JAZZER_API_PATH $JAZZER_API_PATH\nCOPY --from=builder $JAZZER_JUNIT_PATH $JAZZER_JUNIT_PATH\n\nRUN chmod 755 /usr/local/bin && chmod 755 /usr/local/lib\n\nWORKDIR $SRC\n"
  },
  {
    "path": "infra/base-images/base-builder-jvm/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04 AS base\n\nENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64\nENV JAVA_15_HOME /usr/lib/jvm/java-15-openjdk-amd64\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $PATH:$JAVA_HOME/bin\nENV JAZZER_API_PATH \"/usr/local/lib/jazzer_api_deploy.jar\"\nENV JAZZER_JUNIT_PATH \"/usr/local/bin/jazzer_junit.jar\"\n\nRUN install_java.sh\n\nRUN chmod 777 /usr/local/bin && chmod 777 /usr/local/lib\n\nFROM base AS builder\nRUN useradd -m jazzer_user\n\nUSER jazzer_user\n\nWORKDIR $SRC\n\nRUN git clone https://github.com/CodeIntelligenceTesting/jazzer && \\\n    cd jazzer && \\\n    git checkout 11b42852df4344737df54a380c2f522025bb4e84\n\nWORKDIR $SRC/jazzer\n\nRUN echo \"build --java_runtime_version=local_jdk_17\" >> .bazelrc \\\n    && echo \"build --cxxopt=-stdlib=libc++\" >> .bazelrc \\\n    && echo \"build --linkopt=-lc++\" >> .bazelrc\n\nRUN bazel build \\\n    //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar \\\n    //deploy:jazzer-api \\\n    //deploy:jazzer-junit \\\n    //launcher:jazzer\n\nRUN cp $(bazel cquery --output=files //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar) /usr/local/bin/jazzer_agent_deploy.jar && \\\n    cp $(bazel cquery --output=files //launcher:jazzer) /usr/local/bin/jazzer_driver && \\\n    cp $(bazel cquery --output=files //deploy:jazzer-api) $JAZZER_API_PATH && \\\n    cp $(bazel cquery --output=files //deploy:jazzer-junit) $JAZZER_JUNIT_PATH\n\nFROM base AS final\n\nCOPY --from=builder /usr/local/bin/jazzer_agent_deploy.jar /usr/local/bin/jazzer_agent_deploy.jar\nCOPY --from=builder /usr/local/bin/jazzer_driver /usr/local/bin/jazzer_driver\nCOPY --from=builder $JAZZER_API_PATH $JAZZER_API_PATH\nCOPY --from=builder $JAZZER_JUNIT_PATH $JAZZER_JUNIT_PATH\n\nRUN chmod 755 /usr/local/bin && chmod 755 /usr/local/lib\n\nWORKDIR $SRC\n"
  },
  {
    "path": "infra/base-images/base-builder-python/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-python\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-python` were successfully built. These images install Python-specific fuzzing tools, including Atheris and Coverage, on top of the `base-builder` image. The Dockerfile structure was refactored to support multi-version builds by creating separate Dockerfiles for each Ubuntu version and updating the `FROM` instruction accordingly.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-python:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-python:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe primary difference is the version of Python and its dependencies. Both versions install Atheris, PyInstaller, and other Python packages, but the underlying system libraries and Python version are different.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Python Fuzzing Tools:** The `install_python.sh` script is used to install Atheris and other Python fuzzing tools.\n*   **Refactoring:** The original `Dockerfile` was renamed to `ubuntu-20-04.Dockerfile`, and a new `ubuntu-24-04.Dockerfile` was created to support the multi-version build strategy.\n"
  },
  {
    "path": "infra/base-images/base-builder-python/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN install_python.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-python/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04\n\nRUN install_python.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-python/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN install_python.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-ruby/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-ruby\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-ruby` were successfully built. These images install Ruby and the Ruzzy fuzzer on top of the `base-builder` image. The Dockerfile structure was refactored to support multi-version builds by creating separate Dockerfiles for each Ubuntu version and updating the `FROM` instruction accordingly.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-ruby:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-ruby:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe primary difference is the version of Ruby and its dependencies. Both versions install Ruby 3.3.1, but the underlying system libraries and dependencies are different.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Ruby Installation:** The `install_ruby.sh` script is used to download and install Ruby.\n*   **Ruzzy Installation:** Both versions clone the Ruzzy repository and install it using `gem`.\n*   **Refactoring:** The original `Dockerfile` was renamed to `ubuntu-20-04.Dockerfile`, and a new `ubuntu-24-04.Dockerfile` was created to support the multi-version build strategy.\n"
  },
  {
    "path": "infra/base-images/base-builder-ruby/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone https://github.com/trailofbits/ruzzy.git $SRC/ruzzy\n\nRUN /usr/local/bin/install_ruby.sh\nRUN /usr/local/bin/gem update --system 3.5.11\n\n# Install ruzzy\nWORKDIR $SRC/ruzzy\n\n# The MAKE variable allows overwriting the make command at runtime. This forces the\n# Ruby C extension to respect ENV variables when compiling, like CC, CFLAGS, etc.\nENV MAKE=\"make --environment-overrides V=1\"\n\nRUN CC=\"clang\" \\\nCXX=\"clang++\" \\\nLDSHARED=\"clang -shared\" \\\nLDSHAREDXX=\"clang++ -shared\" \\\ngem build\n\nRUN MAKE=\"make --environment-overrides V=1\" \\\nCC=\"clang\" \\\nCXX=\"clang++\" \\\nLDSHARED=\"clang -shared\" \\\nLDSHAREDXX=\"clang++ -shared\" \\\nCXXFLAGS=\"-fPIC\" \\\nCFLAGS=\"-fPIC\" \\\nRUZZY_DEBUG=1 gem install --install-dir /install/ruzzy --development --verbose ruzzy-*.gem\n\n\nENV LDSHARED=\"$CC -shared\"\nENV LDSHAREDXX=\"$CXX -shared\"\n\nENV GEM_HOME=\"$OUT/fuzz-gem\"\nENV GEM_PATH=\"/install/ruzzy\"\n\nCOPY ruzzy-build /usr/bin/ruzzy-build\n"
  },
  {
    "path": "infra/base-images/base-builder-ruby/ruzzy-build",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfuzz_target=$(basename \"$1\")\necho \"BASENAME: $fuzz_target ---\"\nharness_sh=${fuzz_target::-3}\n\ncp $1 $OUT/$fuzz_target\n\necho \"\"\"#!/usr/bin/env bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nexport GEM_HOME=\\$this_dir/fuzz-gem\n\nruzzy \\$this_dir/$fuzz_target \\$@\n\"\"\" > $OUT/$harness_sh\nchmod +x $OUT/$harness_sh\n"
  },
  {
    "path": "infra/base-images/base-builder-ruby/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04\n\nRUN git clone https://github.com/trailofbits/ruzzy.git $SRC/ruzzy\n\nRUN /usr/local/bin/install_ruby.sh\nRUN /usr/local/bin/gem update --system 3.5.11\n\n# Install ruzzy\nWORKDIR $SRC/ruzzy\n\n# The MAKE variable allows overwriting the make command at runtime. This forces the\n# Ruby C extension to respect ENV variables when compiling, like CC, CFLAGS, etc.\nENV MAKE=\"make --environment-overrides V=1\"\n\nRUN CC=\"clang\" \\\nCXX=\"clang++\" \\\nLDSHARED=\"clang -shared\" \\\nLDSHAREDXX=\"clang++ -shared\" \\\ngem build\n\nRUN MAKE=\"make --environment-overrides V=1\" \\\nCC=\"clang\" \\\nCXX=\"clang++\" \\\nLDSHARED=\"clang -shared\" \\\nLDSHAREDXX=\"clang++ -shared\" \\\nCXXFLAGS=\"-fPIC\" \\\nCFLAGS=\"-fPIC\" \\\nRUZZY_DEBUG=1 gem install --install-dir /install/ruzzy --development --verbose ruzzy-*.gem\n\n\nENV LDSHARED=\"$CC -shared\"\nENV LDSHAREDXX=\"$CXX -shared\"\n\nENV GEM_HOME=\"$OUT/fuzz-gem\"\nENV GEM_PATH=\"/install/ruzzy\"\n\nCOPY ruzzy-build /usr/bin/ruzzy-build\n"
  },
  {
    "path": "infra/base-images/base-builder-ruby/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN git clone https://github.com/trailofbits/ruzzy.git $SRC/ruzzy\n\nRUN /usr/local/bin/install_ruby.sh\nRUN /usr/local/bin/gem update --system 3.5.11\n\nRUN gem update --system 3.5.11\n\n# Install ruzzy\nWORKDIR $SRC/ruzzy\n\n# The MAKE variable allows overwriting the make command at runtime. This forces the\n# Ruby C extension to respect ENV variables when compiling, like CC, CFLAGS, etc.\nENV MAKE=\"make --environment-overrides V=1\"\n\nRUN CC=\"clang\" \\\nCXX=\"clang++\" \\\nLDSHARED=\"clang -shared\" \\\nLDSHAREDXX=\"clang++ -shared\" \\\ngem build\n\nRUN MAKE=\"make --environment-overrides V=1\" \\\nCC=\"clang\" \\\nCXX=\"clang++\" \\\nLDSHARED=\"clang -shared\" \\\nLDSHAREDXX=\"clang++ -shared\" \\\nCXXFLAGS=\"-fPIC\" \\\nCFLAGS=\"-fPIC\" \\\nRUZZY_DEBUG=1 gem install --install-dir /install/ruzzy --development --verbose ruzzy-*.gem\n\n\nENV LDSHARED=\"$CC -shared\"\nENV LDSHAREDXX=\"$CXX -shared\"\n\nENV GEM_HOME=\"$OUT/fuzz-gem\"\nENV GEM_PATH=\"/install/ruzzy\"\n\nCOPY ruzzy-build /usr/bin/ruzzy-build\n"
  },
  {
    "path": "infra/base-images/base-builder-rust/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-rust\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-rust` were successfully built. These images are used for building Rust-based fuzzers and contain the necessary toolchain.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-rust:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-rust:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe `ubuntu-24-04` image includes newer versions of the Rust toolchain and other related dependencies.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Dependency Installation:** The `install_rust.sh` script is used to install the Rust toolchain, which may have version differences between the two Ubuntu versions."
  },
  {
    "path": "infra/base-images/base-builder-rust/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nENV CARGO_HOME=/rust\nENV RUSTUP_HOME=/rust/rustup\nENV PATH=$PATH:/rust/bin\n# Set up custom environment variable for source code copy for coverage reports\nENV OSSFUZZ_RUSTPATH /rust\n\n# Force rustup to ignore `rust-toolchain` and `rust-toolchain.toml` files by\n# manually specifying what toolchain to use. Note that this environment variable\n# is additionally used by `install_rust.sh` as the toolchain to install.\n# cf https://rust-lang.github.io/rustup/overrides.html\nENV RUSTUP_TOOLCHAIN nightly-2025-09-05\n\n# Configure the linker used by default for x86_64 linux to be `clang` instead of\n# rustc's default of `cc` which is able to find custom-built libraries like\n# `libc++` by default more easily.\nENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER clang\n\nRUN install_rust.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-rust/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04\n\nENV CARGO_HOME=/rust\nENV RUSTUP_HOME=/rust/rustup\nENV PATH=$PATH:/rust/bin\n# Set up custom environment variable for source code copy for coverage reports\nENV OSSFUZZ_RUSTPATH /rust\n\n# Force rustup to ignore `rust-toolchain` and `rust-toolchain.toml` files by\n# manually specifying what toolchain to use. Note that this environment variable\n# is additionally used by `install_rust.sh` as the toolchain to install.\n# cf https://rust-lang.github.io/rustup/overrides.html\nENV RUSTUP_TOOLCHAIN nightly-2024-07-12\n\n# Configure the linker used by default for x86_64 linux to be `clang` instead of\n# rustc's default of `cc` which is able to find custom-built libraries like\n# `libc++` by default more easily.\nENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER clang\n\nRUN install_rust.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-rust/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nENV CARGO_HOME=/rust\nENV RUSTUP_HOME=/rust/rustup\nENV PATH=$PATH:/rust/bin\n# Set up custom environment variable for source code copy for coverage reports\nENV OSSFUZZ_RUSTPATH /rust\n\n# Force rustup to ignore `rust-toolchain` and `rust-toolchain.toml` files by\n# manually specifying what toolchain to use. Note that this environment variable\n# is additionally used by `install_rust.sh` as the toolchain to install.\n# cf https://rust-lang.github.io/rustup/overrides.html\nENV RUSTUP_TOOLCHAIN nightly-2024-07-12\n\n# Configure the linker used by default for x86_64 linux to be `clang` instead of\n# rustc's default of `cc` which is able to find custom-built libraries like\n# `libc++` by default more easily.\nENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER clang\n\nRUN install_rust.sh\n"
  },
  {
    "path": "infra/base-images/base-builder-swift/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-builder-swift\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-builder-swift` were successfully built. These images install Swift and related tools on top of the `base-builder` image. The build process for both versions is straightforward and relies on the `install_swift.sh` script, which is compatible with both base images.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-builder-swift:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-builder-swift:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThere are no significant package differences introduced in this build stage, as the dependencies are inherited from the `base-builder` image.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions are very similar and perform the following actions:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-builder` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Swift Installation:** The `install_swift.sh` script is used to download and install Swift.\n"
  },
  {
    "path": "infra/base-images/base-builder-swift/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN install_swift.sh\n\nCOPY precompile_swift /usr/local/bin/\n"
  },
  {
    "path": "infra/base-images/base-builder-swift/llvmsymbol.diff",
    "content": "diff --git a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt\nindex acfb3bd0e..a499ee2e0 100644\n--- a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt\n+++ b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt\n@@ -12,4 +12,8 @@ add_llvm_component_library(LLVMSymbolize\n   Object\n   Support\n   Demangle\n-  )\n+\n+  LINK_LIBS\n+  /usr/lib/swift_static/linux/libswiftCore.a\n+  /usr/lib/x86_64-linux-gnu/libstdc++.so.6\n+)\ndiff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp\nindex fb4875f79..0030769ee 100644\n--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp\n+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp\n@@ -36,6 +36,13 @@\n #include <cassert>\n #include <cstring>\n \n+\n+extern \"C\" char *swift_demangle(const char *mangledName,\n+                     size_t mangledNameLength,\n+                     char *outputBuffer,\n+                     size_t *outputBufferSize,\n+                     uint32_t flags);\n+\n namespace llvm {\n namespace symbolize {\n \n@@ -678,6 +685,14 @@ LLVMSymbolizer::DemangleName(const std::string &Name,\n     free(DemangledName);\n     return Result;\n   }\n+  if (!Name.empty() && Name.front() == '$') {\n+    char *DemangledName = swift_demangle(Name.c_str(), Name.length(), 0, 0, 0);\n+    if (DemangledName) {\n+      std::string Result = DemangledName;\n+      free(DemangledName);\n+      return Result;\n+    }\n+  }\n \n   if (DbiModuleDescriptor && DbiModuleDescriptor->isWin32Module())\n     return std::string(demanglePE32ExternCFunc(Name));\n"
  },
  {
    "path": "infra/base-images/base-builder-swift/precompile_swift",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp /usr/local/bin/llvm-symbolizer-swift $OUT/llvm-symbolizer\n\nexport SWIFTFLAGS=\"-Xswiftc -parse-as-library -Xswiftc -static-stdlib --static-swift-stdlib\"\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n    export SWIFTFLAGS=\"$SWIFTFLAGS -Xswiftc -profile-generate -Xswiftc -profile-coverage-mapping -Xswiftc -sanitize=fuzzer\"\nelse\n    export SWIFTFLAGS=\"$SWIFTFLAGS -Xswiftc -sanitize=fuzzer,$SANITIZER --sanitize=$SANITIZER\"\n    for f in $CFLAGS; do\n        export SWIFTFLAGS=\"$SWIFTFLAGS -Xcc=$f\"\n    done\n\n    for f in $CXXFLAGS; do\n        export SWIFTFLAGS=\"$SWIFTFLAGS -Xcxx=$f\"\n    done\nfi\n"
  },
  {
    "path": "infra/base-images/base-builder-swift/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04\n\nRUN install_swift_ubuntu-20-04.sh\n\nCOPY precompile_swift /usr/local/bin/\n"
  },
  {
    "path": "infra/base-images/base-builder-swift/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nCOPY llvmsymbol.diff /src/\nRUN install_swift_ubuntu-24-04.sh\n\nCOPY precompile_swift /usr/local/bin/\n"
  },
  {
    "path": "infra/base-images/base-clang/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-clang\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-clang` were successfully built. Both images install Clang and its dependencies on top of the corresponding `base-image`. The build process for both versions is complex, involving the checkout and compilation of a specific LLVM revision. The primary differences between the two versions are the base image used and the script for checking out and building LLVM.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-clang:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-clang:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe package differences are numerous due to the different base Ubuntu versions. The `ubuntu-24-04` image uses newer versions of essential build tools and libraries, such as `g++`, `python3`, and `zlib1g-dev`.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-image` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **LLVM Build Script:** The `ubuntu-24-04` Dockerfile uses a new script, `checkout_build_install_llvm_24.04.sh`, to handle the LLVM build process, while the `ubuntu-20-04` Dockerfile uses `checkout_build_install_llvm.sh`. This is necessary to accommodate changes in the build environment and dependencies between the two Ubuntu versions.\n"
  },
  {
    "path": "infra/base-images/base-clang/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Docker image with clang installed.\n\nFROM gcr.io/oss-fuzz-base/base-image\n\nARG arch=x86_64\n\nENV FUZZINTRO_OUTDIR=$SRC\n\n# Install newer cmake.\n# Many projects, as well as recent clang versions, need a newer cmake.\nENV CMAKE_VERSION 3.29.2\nRUN apt-get update && apt-get install -y wget sudo && \\\n    wget -q https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    chmod +x cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    ./cmake-$CMAKE_VERSION-Linux-$arch.sh --skip-license --prefix=\"/usr/local\" && \\\n    rm cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    SUDO_FORCE_REMOVE=yes apt-get autoremove --purge -y wget sudo && \\\n    rm -rf /usr/local/doc/cmake /usr/local/bin/cmake-gui\n\nCOPY checkout_build_install_llvm.sh /root/\n\n# Keep all steps in the same script to decrease the number of intermediate\n# layes in docker file.\nARG FULL_LLVM_BUILD\nRUN FULL_LLVM_BUILD=$FULL_LLVM_BUILD /root/checkout_build_install_llvm.sh\nRUN rm /root/checkout_build_install_llvm.sh\n\n# Setup the environment.\nENV CC \"clang\"\nENV CXX \"clang++\"\nENV CCC \"clang++\"\n\n# FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is described at\n# https://llvm.org/docs/LibFuzzer.html#fuzzer-friendly-build-mode\n\n# The implicit-function-declaration and implicit-int errors are downgraded to a\n# warning, to allow compiling legacy code.\n# See https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes\n# Same for deprecated-declarations, int-conversion,\n# incompatible-function-pointer-types, enum-constexpr-conversion,\n# vla-cxx-extension\n\nENV CFLAGS -O1 \\\n  -fno-omit-frame-pointer \\\n  -gline-tables-only \\\n  -Wno-error=incompatible-function-pointer-types \\\n  -Wno-error=int-conversion \\\n  -Wno-error=deprecated-declarations \\\n  -Wno-error=implicit-function-declaration \\\n  -Wno-error=implicit-int \\\n  -Wno-error=unknown-warning-option \\\n  -Wno-error=vla-cxx-extension \\\n  -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\nENV CXXFLAGS_EXTRA \"-stdlib=libc++\"\nENV CXXFLAGS \"$CFLAGS $CXXFLAGS_EXTRA\"\n"
  },
  {
    "path": "infra/base-images/base-clang/README.md",
    "content": "# base-builder-clang\n\n## Regular build\n\n```\ndocker build -t gcr.io/oss-fuzz-base/base-clang . \n```\n\n## Full build \nFor a build including all binaries and libraries, including with everything built against libcxx, do\n\n```\ndocker build -t gcr.io/oss-fuzz-base/base-clang-full --build-arg FULL_LLVM_BUILD=1 . \n```"
  },
  {
    "path": "infra/base-images/base-clang/checkout_build_install_llvm.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nNPROC=$(nproc)\n\n# Set this to get a full build with all binaries and libraries, as well as\n# everything built with libcxx.\nif [ -z \"${FULL_LLVM_BUILD-}\" ]; then\n  FULL_LLVM_BUILD=\nfi\n\nTARGET_TO_BUILD=\ncase $(uname -m) in\n    x86_64)\n      TARGET_TO_BUILD=X86\n      ARCHITECTURE_DEPS=\"g++-multilib\"\n      # Use chromium's clang revision.\n      export CC=$WORK/llvm-stage1/bin/clang\n      export CXX=$WORK/llvm-stage1/bin/clang++\n      ;;\n    aarch64)\n      TARGET_TO_BUILD=AArch64\n      # g++ multilib is not needed on AArch64 because we don't care about i386.\n      # We need to install clang and lld using apt because the binary downloaded\n      # from Chrome's developer tools doesn't support AArch64.\n      # TODO(metzman): Make x86_64 use the distro's clang for consistency once\n      # we support AArch64 fully.\n      ARCHITECTURE_DEPS=\"clang lld g++\"\n      export CC=clang\n      export CXX=clang++\n      ;;\n    *)\n      echo \"Error: unsupported target $(uname -m)\"\n      exit 1\n      ;;\nesac\n\nINTROSPECTOR_DEP_PACKAGES=\"texinfo bison flex\"\n# zlib1g-dev is needed for llvm-profdata to handle coverage data from rust compiler\nLLVM_DEP_PACKAGES=\"build-essential make ninja-build git python3 python3-distutils binutils-dev zlib1g-dev $ARCHITECTURE_DEPS $INTROSPECTOR_DEP_PACKAGES\"\n\napt-get update && apt-get install -y $LLVM_DEP_PACKAGES --no-install-recommends\n\n# For manual bumping.\n# On each bump a full trial run for everything (fuzzing engines, sanitizers,\n# languages, projects, ...) is needed.\n# Check CMAKE_VERSION infra/base-images/base-clang/Dockerfile was released\n# recently enough to fully support this clang version.\nOUR_LLVM_REVISION=cb2f0d0a5f14\n\nmkdir $SRC/chromium_tools\ncd $SRC/chromium_tools\ngit clone https://chromium.googlesource.com/chromium/src/tools/clang\ncd clang\n# Pin clang script due to https://github.com/google/oss-fuzz/issues/7617\nOUR_CLANG_REVISION=063d3766486a820c708e888d737b004d11543410\ngit checkout $OUR_CLANG_REVISION\n\nLLVM_SRC=$SRC/llvm-project\n# Checkout\nCHECKOUT_RETRIES=10\nfunction clone_with_retries {\n  REPOSITORY=$1\n  LOCAL_PATH=$2\n  CHECKOUT_RETURN_CODE=1\n\n  # Disable exit on error since we might encounter some failures while retrying.\n  set +e\n  for i in $(seq 1 $CHECKOUT_RETRIES); do\n    rm -rf $LOCAL_PATH\n    git clone $REPOSITORY $LOCAL_PATH\n    CHECKOUT_RETURN_CODE=$?\n    if [ $CHECKOUT_RETURN_CODE -eq 0 ]; then\n      break\n    fi\n  done\n\n  # Re-enable exit on error. If checkout failed, script will exit.\n  set -e\n  return $CHECKOUT_RETURN_CODE\n}\nclone_with_retries https://github.com/llvm/llvm-project.git $LLVM_SRC\n\ngit -C $LLVM_SRC checkout $OUR_LLVM_REVISION\necho \"Using LLVM revision: $OUR_LLVM_REVISION\"\n\n# Prepare fuzz introspector.\necho \"Installing fuzz introspector\"\nFUZZ_INTROSPECTOR_CHECKOUT=341ebbd72bc9116733bcfcfab5adfd7f9b633e07\n\ngit clone https://github.com/ossf/fuzz-introspector.git /fuzz-introspector\ncd /fuzz-introspector\ngit checkout $FUZZ_INTROSPECTOR_CHECKOUT\ngit submodule init\ngit submodule update\n\necho \"Applying introspector changes\"\nOLD_WORKING_DIR=$PWD\ncd $LLVM_SRC\ncp -rf /fuzz-introspector/frontends/llvm/include/llvm/Transforms/FuzzIntrospector/ ./llvm/include/llvm/Transforms/FuzzIntrospector\ncp -rf /fuzz-introspector/frontends/llvm/lib/Transforms/FuzzIntrospector ./llvm/lib/Transforms/FuzzIntrospector\n\n# LLVM currently does not support dynamically loading LTO passes. Thus, we\n# hardcode it into Clang instead. Ref: https://reviews.llvm.org/D77704\n/fuzz-introspector/frontends/llvm/patch-llvm.sh\n\ncd $OLD_WORKING_DIR\n\nmkdir -p $WORK/llvm-stage2 $WORK/llvm-stage1\npython3 $SRC/chromium_tools/clang/scripts/update.py --output-dir $WORK/llvm-stage1\n\ncd $WORK/llvm-stage2\n\nif [[ -n \"$FULL_LLVM_BUILD\" ]]; then\n  # Bootstrap libc++ so we can build llvm with it.\n  cmake -G \"Ninja\" \\\n    -DLIBCXX_ENABLE_SHARED=OFF \\\n    -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n    -DLIBCXXABI_ENABLE_SHARED=OFF \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi\" \\\n    -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n    -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n    -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n    $LLVM_SRC/llvm\n\n  ninja runtimes -j $NPROC\n  ninja install-runtimes\n\n  # Make libc++ discoverable by the linker.\n  export LIBRARY_PATH=/usr/local/lib/x86_64-unknown-linux-gnu/\nfi\n\n# Note: LLVM_ENABLE_LIBCXX=ON doesn't break the build even if libcxx doesn't\n# exist.\ncmake -G \"Ninja\" \\\n  -DLIBCXX_ENABLE_SHARED=OFF \\\n  -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n  -DLIBCXXABI_ENABLE_SHARED=OFF \\\n  -DLLVM_ENABLE_LIBCXX=ON \\\n  -DLLVM_ENABLE_WARNINGS=OFF \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DLLVM_ENABLE_RUNTIMES=\"compiler-rt;libcxx;libcxxabi\" \\\n  -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n  -DLLVM_ENABLE_PROJECTS=\"clang;lld\" \\\n  -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n  -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n  $LLVM_SRC/llvm\n\nninja -j $NPROC\nninja install\nrm -rf $WORK/llvm-stage1 $WORK/llvm-stage2\n\n# libFuzzer sources.\ncp -r $LLVM_SRC/compiler-rt/lib/fuzzer $SRC/libfuzzer\n\n# Use the clang we just built from now on.\nexport CC=clang\nexport CXX=clang++\n\nfunction free_disk_space {\n    rm -rf $LLVM_SRC $SRC/chromium_tools\n    apt-get autoremove --purge -y $LLVM_DEP_PACKAGES\n\n    if [[ -n \"$FULL_LLVM_BUILD\" ]]; then\n      return 0\n    fi\n\n    # Delete unneeded parts of LLVM to reduce image size.\n    # See https://github.com/google/oss-fuzz/issues/5170\n    LLVM_TOOLS_TMPDIR=/tmp/llvm-tools\n    mkdir $LLVM_TOOLS_TMPDIR\n    # Move binaries with llvm- prefix that we want into LLVM_TOOLS_TMPDIR.\n    mv \\\n      /usr/local/bin/llvm-ar \\\n      /usr/local/bin/llvm-as \\\n      /usr/local/bin/llvm-config \\\n      /usr/local/bin/llvm-cov \\\n      /usr/local/bin/llvm-link \\\n      /usr/local/bin/llvm-objcopy \\\n      /usr/local/bin/llvm-nm \\\n      /usr/local/bin/llvm-profdata \\\n      /usr/local/bin/llvm-ranlib \\\n      /usr/local/bin/llvm-symbolizer \\\n      /usr/local/bin/llvm-undname \\\n      /usr/local/bin/llvm-readelf \\\n      /usr/local/bin/llvm-readobj \\\n      $LLVM_TOOLS_TMPDIR\n\n    # Delete remaining llvm- binaries.\n    rm -rf /usr/local/bin/llvm-*\n\n    # Restore the llvm- binaries we want to keep.\n    mv $LLVM_TOOLS_TMPDIR/* /usr/local/bin/\n    rm -rf $LLVM_TOOLS_TMPDIR\n\n    # Remove binaries from LLVM build that we don't need.\n    rm -f \\\n      /usr/local/bin/bugpoint \\\n      /usr/local/bin/llc \\\n      /usr/local/bin/lli \\\n      /usr/local/bin/clang-check \\\n      /usr/local/bin/clang-refactor \\\n      /usr/local/bin/clang-offload-wrapper \\\n      /usr/local/bin/clang-offload-bundler \\\n      /usr/local/bin/clang-repl \\\n      /usr/local/bin/clang-check \\\n      /usr/local/bin/clang-refactor \\\n      /usr/local/bin/c-index-test \\\n      /usr/local/bin/clang-rename \\\n      /usr/local/bin/clang-scan-deps \\\n      /usr/local/bin/clang-extdef-mapping \\\n      /usr/local/bin/diagtool \\\n      /usr/local/bin/sanstats \\\n      /usr/local/bin/dsymutil \\\n      /usr/local/bin/verify-uselistorder \\\n      /usr/local/bin/clang-format\n\n    # Remove unneeded clang libs, CMake files from LLVM build, lld libs, and the\n    # libraries.\n    # Note: we need fuzzer_no_main libraries for atheris. Don't delete.\n    rm -rf \\\n      /usr/local/lib/libclang* \\\n      /usr/local/lib/liblld* \\\n      /usr/local/lib/cmake/\n}\n\nif [ \"$TARGET_TO_BUILD\" == \"AArch64\" ]\nthen\n  free_disk_space\n  # Exit now on AArch64. We don't need to rebuild libc++ because on AArch64 we\n  # do not support MSAN nor do we care about i386.\n  exit 0\nfi\n\nfunction cmake_libcxx {\n  extra_args=\"$@\"\n  cmake -G \"Ninja\" \\\n      -DLIBCXX_ENABLE_SHARED=OFF \\\n      -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n      -DLIBCXXABI_ENABLE_SHARED=OFF \\\n      -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n      -DCMAKE_BUILD_TYPE=Release \\\n      -DLLVM_ENABLE_PIC=ON \\\n      -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n      -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi\" \\\n      -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n      $extra_args \\\n      -S $LLVM_SRC/runtimes\n}\n\n# 32-bit libraries.\nmkdir -p $WORK/i386\ncd $WORK/i386\ncmake_libcxx \\\n    -DCMAKE_INSTALL_PREFIX=/usr/i386/ \\\n    -DCMAKE_C_FLAGS=\"-m32\" \\\n    -DCMAKE_CXX_FLAGS=\"-m32\"\n\nninja -j $NPROC cxx\nninja install-cxx\nrm -rf $WORK/i386\n\n# MemorySanitizer instrumented libraries.\nmkdir -p $WORK/msan\ncd $WORK/msan\n\n# https://github.com/google/oss-fuzz/issues/1099\ncat <<EOF > $WORK/msan/ignorelist.txt\nfun:__gxx_personality_*\nEOF\n\ncmake_libcxx \\\n    -DLLVM_USE_SANITIZER=Memory \\\n    -DCMAKE_INSTALL_PREFIX=/usr/msan/ \\\n    -DCMAKE_CXX_FLAGS=\"-fsanitize-ignorelist=$WORK/msan/ignorelist.txt\"\n\nninja -j $NPROC cxx\nninja install-cxx\nrm -rf $WORK/msan\n\nfree_disk_space\n"
  },
  {
    "path": "infra/base-images/base-clang/checkout_build_install_llvm_ubuntu_20_04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nNPROC=$(nproc)\n\n# Set this to get a full build with all binaries and libraries, as well as\n# everything built with libcxx.\nif [ -z \"${FULL_LLVM_BUILD-}\" ]; then\n  FULL_LLVM_BUILD=\nfi\n\nTARGET_TO_BUILD=\ncase $(uname -m) in\n    x86_64)\n      TARGET_TO_BUILD=X86\n      ARCHITECTURE_DEPS=\"g++-multilib\"\n      # Use chromium's clang revision.\n      export CC=$WORK/llvm-stage1/bin/clang\n      export CXX=$WORK/llvm-stage1/bin/clang++\n      ;;\n    aarch64)\n      TARGET_TO_BUILD=AArch64\n      # g++ multilib is not needed on AArch64 because we don't care about i386.\n      # We need to install clang and lld using apt because the binary downloaded\n      # from Chrome's developer tools doesn't support AArch64.\n      # TODO(metzman): Make x86_64 use the distro's clang for consistency once\n      # we support AArch64 fully.\n      ARCHITECTURE_DEPS=\"clang lld g++\"\n      export CC=clang\n      export CXX=clang++\n      ;;\n    *)\n      echo \"Error: unsupported target $(uname -m)\"\n      exit 1\n      ;;\nesac\n\nINTROSPECTOR_DEP_PACKAGES=\"texinfo bison flex\"\n# zlib1g-dev is needed for llvm-profdata to handle coverage data from rust compiler\nLLVM_DEP_PACKAGES=\"build-essential make ninja-build git python3 python3-distutils binutils-dev zlib1g-dev $ARCHITECTURE_DEPS $INTROSPECTOR_DEP_PACKAGES\"\n\napt-get update && apt-get install -y $LLVM_DEP_PACKAGES --no-install-recommends\n\n# For manual bumping.\n# On each bump a full trial run for everything (fuzzing engines, sanitizers,\n# languages, projects, ...) is needed.\n# Check CMAKE_VERSION infra/base-images/base-clang/Dockerfile was released\n# recently enough to fully support this clang version.\nOUR_LLVM_REVISION=cb2f0d0a5f14\n\nmkdir $SRC/chromium_tools\ncd $SRC/chromium_tools\ngit clone https://chromium.googlesource.com/chromium/src/tools/clang\ncd clang\n# Pin clang script due to https://github.com/google/oss-fuzz/issues/7617\nOUR_CLANG_REVISION=063d3766486a820c708e888d737b004d11543410\ngit checkout $OUR_CLANG_REVISION\n\nLLVM_SRC=$SRC/llvm-project\n# Checkout\nCHECKOUT_RETRIES=10\nfunction clone_with_retries {\n  REPOSITORY=$1\n  LOCAL_PATH=$2\n  CHECKOUT_RETURN_CODE=1\n\n  # Disable exit on error since we might encounter some failures while retrying.\n  set +e\n  for i in $(seq 1 $CHECKOUT_RETRIES); do\n    rm -rf $LOCAL_PATH\n    git clone $REPOSITORY $LOCAL_PATH\n    CHECKOUT_RETURN_CODE=$?\n    if [ $CHECKOUT_RETURN_CODE -eq 0 ]; then\n      break\n    fi\n  done\n\n  # Re-enable exit on error. If checkout failed, script will exit.\n  set -e\n  return $CHECKOUT_RETURN_CODE\n}\nclone_with_retries https://github.com/llvm/llvm-project.git $LLVM_SRC\n\ngit -C $LLVM_SRC checkout $OUR_LLVM_REVISION\necho \"Using LLVM revision: $OUR_LLVM_REVISION\"\n\n# Prepare fuzz introspector.\necho \"Installing fuzz introspector\"\nFUZZ_INTROSPECTOR_CHECKOUT=341ebbd72bc9116733bcfcfab5adfd7f9b633e07\n\ngit clone https://github.com/ossf/fuzz-introspector.git /fuzz-introspector\ncd /fuzz-introspector\ngit checkout $FUZZ_INTROSPECTOR_CHECKOUT\ngit submodule init\ngit submodule update\n\necho \"Applying introspector changes\"\nOLD_WORKING_DIR=$PWD\ncd $LLVM_SRC\ncp -rf /fuzz-introspector/frontends/llvm/include/llvm/Transforms/FuzzIntrospector/ ./llvm/include/llvm/Transforms/FuzzIntrospector\ncp -rf /fuzz-introspector/frontends/llvm/lib/Transforms/FuzzIntrospector ./llvm/lib/Transforms/FuzzIntrospector\n\n# LLVM currently does not support dynamically loading LTO passes. Thus, we\n# hardcode it into Clang instead. Ref: https://reviews.llvm.org/D77704\n/fuzz-introspector/frontends/llvm/patch-llvm.sh\n\ncd $OLD_WORKING_DIR\n\nmkdir -p $WORK/llvm-stage2 $WORK/llvm-stage1\npython3 $SRC/chromium_tools/clang/scripts/update.py --output-dir $WORK/llvm-stage1\n\ncd $WORK/llvm-stage2\n\nif [[ -n \"$FULL_LLVM_BUILD\" ]]; then\n  # Bootstrap libc++ so we can build llvm with it.\n  cmake -G \"Ninja\" \\\n    -DLIBCXX_ENABLE_SHARED=OFF \\\n    -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n    -DLIBCXXABI_ENABLE_SHARED=OFF \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi\" \\\n    -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n    -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n    -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n    $LLVM_SRC/llvm\n\n  ninja runtimes -j $NPROC\n  ninja install-runtimes\n\n  # Make libc++ discoverable by the linker.\n  export LIBRARY_PATH=/usr/local/lib/x86_64-unknown-linux-gnu/\nfi\n\n# Note: LLVM_ENABLE_LIBCXX=ON doesn't break the build even if libcxx doesn\\'t\n# exist.\ncmake -G \"Ninja\" \\\n  -DLIBCXX_ENABLE_SHARED=OFF \\\n  -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n  -DLIBCXXABI_ENABLE_SHARED=OFF \\\n  -DLLVM_ENABLE_LIBCXX=ON \\\n  -DLLVM_ENABLE_WARNINGS=OFF \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DLLVM_ENABLE_RUNTIMES=\"compiler-rt;libcxx;libcxxabi\" \\\n  -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n  -DLLVM_ENABLE_PROJECTS=\"clang;lld\" \\\n  -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n  -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n  $LLVM_SRC/llvm\n\nninja -j $NPROC\nninja install\nrm -rf $WORK/llvm-stage1 $WORK/llvm-stage2\n\n# libFuzzer sources.\ncp -r $LLVM_SRC/compiler-rt/lib/fuzzer $SRC/libfuzzer\n\n# Use the clang we just built from now on.\nexport CC=clang\nexport CXX=clang++\n\nfunction free_disk_space {\n    rm -rf $LLVM_SRC $SRC/chromium_tools\n    apt-get autoremove --purge -y $LLVM_DEP_PACKAGES\n\n    if [[ -n \"$FULL_LLVM_BUILD\" ]]; then\n      return 0\n    fi\n\n    # Delete unneeded parts of LLVM to reduce image size.\n    # See https://github.com/google/oss-fuzz/issues/5170\n    LLVM_TOOLS_TMPDIR=/tmp/llvm-tools\n    mkdir $LLVM_TOOLS_TMPDIR\n    # Move binaries with llvm- prefix that we want into LLVM_TOOLS_TMPDIR.\n    mv \\\n      /usr/local/bin/llvm-ar \\\n      /usr/local/bin/llvm-as \\\n      /usr/local/bin/llvm-config \\\n      /usr/local/bin/llvm-cov \\\n      /usr/local/bin/llvm-link \\\n      /usr/local/bin/llvm-objcopy \\\n      /usr/local/bin/llvm-nm \\\n      /usr/local/bin/llvm-profdata \\\n      /usr/local/bin/llvm-ranlib \\\n      /usr/local/bin/llvm-symbolizer \\\n      /usr/local/bin/llvm-undname \\\n      /usr/local/bin/llvm-readelf \\\n      /usr/local/bin/llvm-readobj \\\n      $LLVM_TOOLS_TMPDIR\n\n    # Delete remaining llvm- binaries.\n    rm -rf /usr/local/bin/llvm-*\n\n    # Restore the llvm- binaries we want to keep.\n    mv $LLVM_TOOLS_TMPDIR/* /usr/local/bin/\n    rm -rf $LLVM_TOOLS_TMPDIR\n\n    # Remove binaries from LLVM build that we don't need.\n    rm -f \\\n      /usr/local/bin/bugpoint \\\n      /usr/local/bin/llc \\\n      /usr/local/bin/lli \\\n      /usr/local/bin/clang-check \\\n      /usr/local/bin/clang-refactor \\\n      /usr/local/bin/clang-offload-wrapper \\\n      /usr/local/bin/clang-offload-bundler \\\n      /usr/local/bin/clang-repl \\\n      /usr/local/bin/clang-check \\\n      /usr/local/bin/clang-refactor \\\n      /usr/local/bin/c-index-test \\\n      /usr/local/bin/clang-rename \\\n      /usr/local/bin/clang-scan-deps \\\n      /usr/local/bin/clang-extdef-mapping \\\n      /usr/local/bin/diagtool \\\n      /usr/local/bin/sanstats \\\n      /usr/local/bin/dsymutil \\\n      /usr/local/bin/verify-uselistorder \\\n      /usr/local/bin/clang-format\n\n    # Remove unneeded clang libs, CMake files from LLVM build, lld libs, and the\n    # libraries.\n    # Note: we need fuzzer_no_main libraries for atheris. Don't delete.\n    rm -rf \\\n      /usr/local/lib/libclang* \\\n      /usr/local/lib/liblld* \\\n      /usr/local/lib/cmake/\n}\n\nif [ \"$TARGET_TO_BUILD\" == \"AArch64\" ]\nthen\n  free_disk_space\n  # Exit now on AArch64. We don't need to rebuild libc++ because on AArch64 we\n  # do not support MSAN nor do we care about i386.\n  exit 0\nfi\n\nfunction cmake_libcxx {\n  extra_args=\"$@\"\n  cmake -G \"Ninja\" \\\n      -DLIBCXX_ENABLE_SHARED=OFF \\\n      -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n      -DLIBCXXABI_ENABLE_SHARED=OFF \\\n      -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n      -DCMAKE_BUILD_TYPE=Release \\\n      -DLLVM_ENABLE_PIC=ON \\\n      -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n      -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi\" \\\n      -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n      $extra_args \\\n      -S $LLVM_SRC/runtimes\n}\n\n# 32-bit libraries.\nmkdir -p $WORK/i386\ncd $WORK/i386\ncmake_libcxx \\\n    -DCMAKE_INSTALL_PREFIX=/usr/i386/ \\\n    -DCMAKE_C_FLAGS=\"-m32\" \\\n    -DCMAKE_CXX_FLAGS=\"-m32\"\n\nninja -j $NPROC cxx\nninja install-cxx\nrm -rf $WORK/i386\n\n# MemorySanitizer instrumented libraries.\nmkdir -p $WORK/msan\ncd $WORK/msan\n\n# https://github.com/google/oss-fuzz/issues/1099\ncat <<EOF > $WORK/msan/ignorelist.txt\nfun:__gxx_personality_*\nEOF\n\ncmake_libcxx \\\n    -DLLVM_USE_SANITIZER=Memory \\\n    -DCMAKE_INSTALL_PREFIX=/usr/msan/ \\\n    -DCMAKE_CXX_FLAGS=\"-fsanitize-ignorelist=$WORK/msan/ignorelist.txt\"\n\nninja -j $NPROC cxx\nninja install-cxx\nrm -rf $WORK/msan\n\nfree_disk_space"
  },
  {
    "path": "infra/base-images/base-clang/checkout_build_install_llvm_ubuntu_24_04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nNPROC=$(nproc)\n\n# Set this to get a full build with all binaries and libraries, as well as\n# everything built with libcxx.\nif [ -z \"${FULL_LLVM_BUILD-}\" ]; then\n  FULL_LLVM_BUILD=\nfi\n\nTARGET_TO_BUILD=\ncase $(uname -m) in\n    x86_64)\n      TARGET_TO_BUILD=X86\n      ARCHITECTURE_DEPS=\"g++-multilib\"\n      # Use chromium's clang revision.\n      export CC=$WORK/llvm-stage1/bin/clang\n      export CXX=$WORK/llvm-stage1/bin/clang++\n      ;; \n    aarch64)\n      TARGET_TO_BUILD=AArch64\n      # g++ multilib is not needed on AArch64 because we don't care about i386.\n      # We need to install clang and lld using apt because the binary downloaded\n      # from Chrome's developer tools doesn't support AArch64.\n      # TODO(metzman): Make x86_64 use the distro's clang for consistency once\n      # we support AArch64 fully.\n      ARCHITECTURE_DEPS=\"clang lld g++\"\n      export CC=clang\n      export CXX=clang++\n      ;; \n    *)\n      echo \"Error: unsupported target $(uname -m)\"\n      exit 1\n      ;; \nesac\n\nINTROSPECTOR_DEP_PACKAGES=\"texinfo bison flex\"\n# zlib1g-dev is needed for llvm-profdata to handle coverage data from rust compiler\nLLVM_DEP_PACKAGES=\"build-essential make ninja-build git python3 python3-setuptools binutils-dev zlib1g-dev $ARCHITECTURE_DEPS $INTROSPECTOR_DEP_PACKAGES\"\n\napt-get update && apt-get install -y $LLVM_DEP_PACKAGES --no-install-recommends\n\n# For manual bumping.\n# On each bump a full trial run for everything (fuzzing engines, sanitizers, \n# languages, projects, ...) is needed.\n# Check CMAKE_VERSION infra/base-images/base-clang/Dockerfile was released \n# recently enough to fully support this clang version.\nOUR_LLVM_REVISION=cb2f0d0a5f14\n\nmkdir $SRC/chromium_tools\ncd $SRC/chromium_tools\ngit clone https://chromium.googlesource.com/chromium/src/tools/clang\ncd clang\n# Pin clang script due to https://github.com/google/oss-fuzz/issues/7617\ngit checkout 063d3766486a820c708e888d737b004d11543410\n\nLLVM_SRC=$SRC/llvm-project\n# Checkout\nCHECKOUT_RETRIES=10\nfunction clone_with_retries {\n  REPOSITORY=$1\n  LOCAL_PATH=$2\n  CHECKOUT_RETURN_CODE=1\n\n  # Disable exit on error since we might encounter some failures while retrying.\n  set +e\n  for i in $(seq 1 $CHECKOUT_RETRIES); do\n    rm -rf $LOCAL_PATH\n    git clone $REPOSITORY $LOCAL_PATH\n    CHECKOUT_RETURN_CODE=$?\n    if [ $CHECKOUT_RETURN_CODE -eq 0 ]; then\n      break\n    fi\n  done\n\n  # Re-enable exit on error. If checkout failed, script will exit.\n  set -e\n  return $CHECKOUT_RETURN_CODE\n}\nclone_with_retries https://github.com/llvm/llvm-project.git $LLVM_SRC\n\ngit -C $LLVM_SRC checkout $OUR_LLVM_REVISION\necho \"Using LLVM revision: $OUR_LLVM_REVISION\"\n\n# Prepare fuzz introspector.\necho \"Installing fuzz introspector\"\nFUZZ_INTROSPECTOR_CHECKOUT=341ebbd72bc9116733bcfcfab5adfd7f9b633e07\n\ngit clone https://github.com/ossf/fuzz-introspector.git /fuzz-introspector\ncd /fuzz-introspector\ngit checkout $FUZZ_INTROSPECTOR_CHECKOUT\ngit submodule init\ngit submodule update\n\n# For fuzz introspector.\necho \"Applying introspector changes\"\nOLD_WORKING_DIR=$PWD\ncd $LLVM_SRC\ncp -rf /fuzz-introspector/frontends/llvm/include/llvm/Transforms/FuzzIntrospector/ ./llvm/include/llvm/Transforms/FuzzIntrospector\ncp -rf /fuzz-introspector/frontends/llvm/lib/Transforms/FuzzIntrospector ./llvm/lib/Transforms/FuzzIntrospector\n\n# LLVM currently does not support dynamically loading LTO passes. Thus, we\n# hardcode it into Clang instead. Ref: https://reviews.llvm.org/D77704\n/fuzz-introspector/frontends/llvm/patch-llvm.sh\ncd $OLD_WORKING_DIR\n\nmkdir -p $WORK/llvm-stage2 $WORK/llvm-stage1\npython3 $SRC/chromium_tools/clang/scripts/update.py --output-dir $WORK/llvm-stage1\n\ncd $WORK/llvm-stage2\n\nif [[ -n \"$FULL_LLVM_BUILD\" ]]; then\n  # Bootstrap libc++ so we can build llvm with it.\n  cmake -G \"Ninja\" \\\n    -DLIBCXX_ENABLE_SHARED=OFF \\\n    -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n    -DLIBCXXABI_ENABLE_SHARED=OFF \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi\" \\\n    -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n    -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n    -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n    $LLVM_SRC/llvm\n\n  ninja runtimes -j $NPROC\n  ninja install-runtimes\n\n  # Make libc++ discoverable by the linker.\n  export LIBRARY_PATH=/usr/local/lib/x86_64-unknown-linux-gnu/\nfi\n\n# Note: LLVM_ENABLE_LIBCXX=ON doesn't break the build even if libcxx doesn't\n# exist.\ncmake -G \"Ninja\" \\\n  -DLIBCXX_ENABLE_SHARED=OFF \\\n  -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n  -DLIBCXXABI_ENABLE_SHARED=OFF \\\n  -DLLVM_ENABLE_LIBCXX=ON \\\n  -DLLVM_ENABLE_WARNINGS=OFF \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DLLVM_ENABLE_RUNTIMES=\"compiler-rt;libcxx;libcxxabi\" \\\n  -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n  -DLLVM_ENABLE_PROJECTS=\"clang;lld\" \\\n  -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n  -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n  $LLVM_SRC/llvm\n\nninja -j $NPROC\nninja install\nrm -rf $WORK/llvm-stage1 $WORK/llvm-stage2\n\n# libFuzzer sources.\ncp -r $LLVM_SRC/compiler-rt/lib/fuzzer $SRC/libfuzzer\n\n# Use the clang we just built from now on.\nexport CC=clang\nexport CXX=clang++\n\nfunction free_disk_space {\n    rm -rf $LLVM_SRC $SRC/chromium_tools\n    apt-get autoremove --purge -y $LLVM_DEP_PACKAGES\n\n    if [[ -n \"$FULL_LLVM_BUILD\" ]]; then\n      return 0\n    fi\n\n    # Delete unneeded parts of LLVM to reduce image size.\n    # See https://github.com/google/oss-fuzz/issues/5170\n    LLVM_TOOLS_TMPDIR=/tmp/llvm-tools\n    mkdir $LLVM_TOOLS_TMPDIR\n    # Move binaries with llvm- prefix that we want into LLVM_TOOLS_TMPDIR.\n    mv \\\n      /usr/local/bin/llvm-ar \\\n      /usr/local/bin/llvm-as \\\n      /usr/local/bin/llvm-config \\\n      /usr/local/bin/llvm-cov \\\n      /usr/local/bin/llvm-objcopy \\\n      /usr/local/bin/llvm-nm \\\n      /usr/local/bin/llvm-profdata \\\n      /usr/local/bin/llvm-ranlib \\\n      /usr/local/bin/llvm-symbolizer \\\n      /usr/local/bin/llvm-undname \\\n      /usr/local/bin/llvm-readelf \\\n      /usr/local/bin/llvm-readobj \\\n      $LLVM_TOOLS_TMPDIR\n\n    # Delete remaining llvm- binaries.\n    rm -rf /usr/local/bin/llvm-*\n\n    # Restore the llvm- binaries we want to keep.\n    mv $LLVM_TOOLS_TMPDIR/* /usr/local/bin/\n    rm -rf $LLVM_TOOLS_TMPDIR\n\n    # Remove binaries from LLVM build that we don't need.\n    rm -f \\\n      /usr/local/bin/bugpoint \\\n      /usr/local/bin/llc \\\n      /usr/local/bin/lli \\\n      /usr/local/bin/clang-check \\\n      /usr/local/bin/clang-refactor \\\n      /usr/local/bin/clang-offload-wrapper \\\n      /usr/local/bin/clang-offload-bundler \\\n      /usr/local/bin/clang-repl \\\n      /usr/local/bin/clang-check \\\n      /usr/local/bin/clang-refactor \\\n      /usr/local/bin/c-index-test \\\n      /usr/local/bin/clang-rename \\\n      /usr/local/bin/clang-scan-deps \\\n      /usr/local/bin/clang-extdef-mapping \\\n      /usr/local/bin/diagtool \\\n      /usr/local/bin/sanstats \\\n      /usr/local/bin/dsymutil \\\n      /usr/local/bin/verify-uselistorder \\\n      /usr/local/bin/clang-format\n\n    # Remove unneeded clang libs, CMake files from LLVM build, lld libs, and the\n    # libraries.\n    # Note: we need fuzzer_no_main libraries for atheris. Don't delete.\n    rm -rf \\\n      /usr/local/lib/libclang* \\\n      /usr/local/lib/liblld* \\\n      /usr/local/lib/cmake/\n}\n\nif [ \"$TARGET_TO_BUILD\" == \"AArch64\" ]\nthen\n  free_disk_space\n  # Exit now on AArch64. We don't need to rebuild libc++ because on AArch64 we\n  # do not support MSAN nor do we care about i386.\n  exit 0\nfi\n\nfunction cmake_libcxx {\n  extra_args=\"$@\"\n  cmake -G \"Ninja\" \\\n      -DLIBCXX_ENABLE_SHARED=OFF \\\n      -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \\\n      -DLIBCXXABI_ENABLE_SHARED=OFF \\\n      -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\n      -DCMAKE_BUILD_TYPE=Release \\\n      -DLLVM_ENABLE_PIC=ON \\\n      -DLLVM_TARGETS_TO_BUILD=\"$TARGET_TO_BUILD\" \\\n      -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi\" \\\n      -DLLVM_BINUTILS_INCDIR=\"/usr/include/\" \\\n      $extra_args \\\n      -S $LLVM_SRC/runtimes\n}\n\n# 32-bit libraries.\nmkdir -p $WORK/i386\ncd $WORK/i386\ncmake_libcxx \\\n    -DCMAKE_INSTALL_PREFIX=/usr/i386/ \\\n    -DCMAKE_C_FLAGS=\"-m32\" \\\n    -DCMAKE_CXX_FLAGS=\"-m32\"\n\nninja -j $NPROC cxx\nninja install-cxx\nrm -rf $WORK/i386\n\n# MemorySanitizer instrumented libraries.\nmkdir -p $WORK/msan\ncd $WORK/msan\n\n# https://github.com/google/oss-fuzz/issues/1099\ncat <<EOF > $WORK/msan/ignorelist.txt\nfun:__gxx_personality_*\nEOF\n\ncmake_libcxx \\\n    -DLLVM_USE_SANITIZER=Memory \\\n    -DCMAKE_INSTALL_PREFIX=/usr/msan/ \\\n    -DCMAKE_CXX_FLAGS=\"-fsanitize-ignorelist=$WORK/msan/ignorelist.txt\"\n\nninja -j $NPROC cxx\nninja install-cxx\nrm -rf $WORK/msan\n\nfree_disk_space\n"
  },
  {
    "path": "infra/base-images/base-clang/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Docker image with clang installed.\n\nFROM gcr.io/oss-fuzz-base/base-image\n\nARG arch=x86_64\n\nENV FUZZINTRO_OUTDIR=$SRC\n\n# Install newer cmake.\n# Many projects, as well as recent clang versions, need a newer cmake.\nENV CMAKE_VERSION 3.29.2\nRUN apt-get update && apt-get install -y wget sudo && \\\n    wget -q https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    chmod +x cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    ./cmake-$CMAKE_VERSION-Linux-$arch.sh --skip-license --prefix=\"/usr/local\" && \\\n    rm cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    SUDO_FORCE_REMOVE=yes apt-get autoremove --purge -y wget sudo && \\\n    rm -rf /usr/local/doc/cmake /usr/local/bin/cmake-gui\n\nCOPY checkout_build_install_llvm_ubuntu_20_04.sh /root/\n# Keep all steps in the same script to decrease the number of intermediate\n# layes in docker file.\nARG FULL_LLVM_BUILD\nRUN FULL_LLVM_BUILD=$FULL_LLVM_BUILD /root/checkout_build_install_llvm_ubuntu_20_04.sh\nRUN rm /root/checkout_build_install_llvm_ubuntu_20_04.sh\n\n# Setup the environment.\nENV CC \"clang\"\nENV CXX \"clang++\"\nENV CCC \"clang++\"\n\n# FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is described at\n# https://llvm.org/docs/LibFuzzer.html#fuzzer-friendly-build-mode\n\n# The implicit-function-declaration and implicit-int errors are downgraded to a\n# warning, to allow compiling legacy code.\n# See https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes\n# Same for deprecated-declarations, int-conversion,\n# incompatible-function-pointer-types, enum-constexpr-conversion,\n# vla-cxx-extension\n\nENV CFLAGS -O1 \\\n  -fno-omit-frame-pointer \\\n  -gline-tables-only \\\n  -Wno-error=incompatible-function-pointer-types \\\n  -Wno-error=int-conversion \\\n  -Wno-error=deprecated-declarations \\\n  -Wno-error=implicit-function-declaration \\\n  -Wno-error=implicit-int \\\n  -Wno-error=unknown-warning-option \\\n  -Wno-error=vla-cxx-extension \\\n  -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\nENV CXXFLAGS_EXTRA \"-stdlib=libc++\"\nENV CXXFLAGS \"$CFLAGS $CXXFLAGS_EXTRA\"\n"
  },
  {
    "path": "infra/base-images/base-clang/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Docker image with clang installed.\n\nFROM gcr.io/oss-fuzz-base/base-image:ubuntu-24-04\n\nARG arch=x86_64\n\nENV FUZZINTRO_OUTDIR=$SRC\n\n# Install newer cmake.\n# Many projects, as well as recent clang versions, need a newer cmake.\nENV CMAKE_VERSION 3.29.2\nRUN apt-get update && apt-get install -y wget sudo && \\\n    wget -q https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    chmod +x cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    ./cmake-$CMAKE_VERSION-Linux-$arch.sh --skip-license --prefix=\"/usr/local\" && \\\n    rm cmake-$CMAKE_VERSION-Linux-$arch.sh && \\\n    SUDO_FORCE_REMOVE=yes apt-get autoremove --purge -y wget sudo && \\\n    rm -rf /usr/local/doc/cmake /usr/local/bin/cmake-gui\n\nCOPY checkout_build_install_llvm_ubuntu_24_04.sh /root/\nRUN chmod +x /root/checkout_build_install_llvm_ubuntu_24_04.sh\n# Keep all steps in the same script to decrease the number of intermediate\n# layes in docker file.\nARG FULL_LLVM_BUILD\nRUN FULL_LLVM_BUILD=$FULL_LLVM_BUILD /root/checkout_build_install_llvm_ubuntu_24_04.sh\nRUN rm /root/checkout_build_install_llvm_ubuntu_24_04.sh\n\n# Setup the environment.\nENV CC \"clang\"\nENV CXX \"clang++\"\nENV CCC \"clang++\"\n\n# FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is described at\n# https://llvm.org/docs/LibFuzzer.html#fuzzer-friendly-build-mode\n\n# The implicit-function-declaration and implicit-int errors are downgraded to a\n# warning, to allow compiling legacy code.\n# See https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes\n# Same for deprecated-declarations, int-conversion,\n# incompatible-function-pointer-types, enum-constexpr-conversion,\n# vla-cxx-extension\n\nENV CFLAGS -O1 \\\n  -fno-omit-frame-pointer \\\n  -gline-tables-only \\\n  -Wno-error=incompatible-function-pointer-types \\\n  -Wno-error=int-conversion \\\n  -Wno-error=deprecated-declarations \\\n  -Wno-error=implicit-function-declaration \\\n  -Wno-error=implicit-int \\\n  -Wno-error=unknown-warning-option \\\n  -Wno-error=vla-cxx-extension \\\n  -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\nENV CXXFLAGS_EXTRA \"-stdlib=libc++\"\nENV CXXFLAGS \"$CFLAGS $CXXFLAGS_EXTRA\"\n"
  },
  {
    "path": "infra/base-images/base-image/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-image\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-image` were successfully built. Both images are based on their respective Ubuntu versions and include essential packages for the fuzzing environment. The primary difference between the two is the version of `libgcc-dev` used, which is `libgcc-9-dev` for Ubuntu 20.04 and `libgcc-13-dev` for Ubuntu 24.04.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-image:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-image:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\n| Package | Ubuntu 20.04 Version | Ubuntu 24.04 Version | Notes |\n| --- | --- | --- | --- |\n| `libgcc-9-dev` | Installed | - | Specific to Ubuntu 20.04 |\n| `libgcc-13-dev` | - | Installed | Specific to Ubuntu 24.04 |\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions are very similar, with the main differences being:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding Ubuntu version (`ubuntu:20.04` or `ubuntu:24.04`).\n*   **Package Installation:** The `apt-get install` command is updated to install the correct version of `libgcc-dev` for each Ubuntu release.\n"
  },
  {
    "path": "infra/base-images/base-image/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Base image for all other images.\n\nARG parent_image=ubuntu:20.04@sha256:4a45212e9518f35983a976eead0de5eecc555a2f047134e9dd2cfc589076a00d\n\nFROM $parent_image\n\nENV DEBIAN_FRONTEND noninteractive\n# Install tzadata to match ClusterFuzz\n# (https://github.com/google/oss-fuzz/issues/9280).\n\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y libc6-dev binutils libgcc-9-dev tzdata && \\\n    apt-get autoremove -y\n\nENV OUT=/out\nENV SRC=/src\nENV WORK=/work\nENV PATH=\"$PATH:/out\"\nENV HWASAN_OPTIONS=random_tags=0\n\nRUN mkdir -p $OUT $SRC $WORK && chmod a+rwx $OUT $SRC $WORK\n"
  },
  {
    "path": "infra/base-images/base-image/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Base image for all other images.\n\nARG parent_image=ubuntu:20.04@sha256:4a45212e9518f35983a976eead0de5eecc555a2f047134e9dd2cfc589076a00d\n\nFROM $parent_image\n\nENV DEBIAN_FRONTEND noninteractive\n# Install tzadata to match ClusterFuzz\n# (https://github.com/google/oss-fuzz/issues/9280).\n\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y libc6-dev binutils libgcc-9-dev tzdata && \\\n    apt-get autoremove -y\n\nENV OUT=/out\nENV SRC=/src\nENV WORK=/work\nENV PATH=\"$PATH:/out\"\nENV HWASAN_OPTIONS=random_tags=0\n\nRUN mkdir -p $OUT $SRC $WORK && chmod a+rwx $OUT $SRC $WORK\n"
  },
  {
    "path": "infra/base-images/base-image/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Base image for all other images.\n\nARG parent_image=ubuntu:24.04@sha256:9cbed754112939e914291337b5e554b07ad7c392491dba6daf25eef1332a22e8\n\nFROM $parent_image\n\nENV DEBIAN_FRONTEND noninteractive\n# Install tzadata to match ClusterFuzz\n# (https://github.com/google/oss-fuzz/issues/9280).\n\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y libc6-dev binutils libgcc-13-dev tzdata && \\\n    apt-get autoremove -y\n\nENV OUT=/out\nENV SRC=/src\nENV WORK=/work\nENV PATH=\"$PATH:/out\"\nENV HWASAN_OPTIONS=random_tags=0\n\nRUN mkdir -p $OUT $SRC $WORK && chmod a+rwx $OUT $SRC $WORK\n"
  },
  {
    "path": "infra/base-images/base-runner/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-runner\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-runner` were successfully built. These images are used to run fuzzers and contain the necessary runtime dependencies. The initial build failed due to incorrect paths in the `COPY` instructions, which was resolved by making the paths relative to the build context.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-runner:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-runner:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe `ubuntu-24-04` image includes newer versions of many packages, including Python, Java, and Node.js. The specific versions of other tools and libraries also differ due to the updated base image.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-image` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **Dependency Installation:** The `install_deps.sh` script is used to install a base set of dependencies, which differ between the two versions.\n*   **COPY Instructions:** The `COPY` instructions were corrected to use paths relative to the build context.\n"
  },
  {
    "path": "infra/base-images/base-runner/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build rust stuff in its own image. We only need the resulting binaries.\n# Keeping the rust toolchain in the image wastes 1 GB.\nFROM gcr.io/oss-fuzz-base/base-image as temp-runner-binary-builder\n\nRUN apt-get update && apt-get install -y cargo libyaml-dev\nRUN cargo install rustfilt\n\n# Using multi-stage build to copy some LLVM binaries needed in the runner image.\nFROM gcr.io/oss-fuzz-base/base-clang AS base-clang\nFROM gcr.io/oss-fuzz-base/base-builder-ruby AS base-ruby\n\n# The base builder image compiles a specific Python version. Using a multi-stage build\n# to copy that same Python interpreter into the runner image saves build time and keeps\n# the Python versions in sync.\nFROM gcr.io/oss-fuzz-base/base-builder AS base-builder\n\n# Real image that will be used later.\nFROM gcr.io/oss-fuzz-base/base-image\n\nCOPY --from=temp-runner-binary-builder /root/.cargo/bin/rustfilt /usr/local/bin\n\n# Copy the binaries needed for code coverage and crash symbolization.\nCOPY --from=base-clang /usr/local/bin/llvm-cov \\\n     /usr/local/bin/llvm-profdata \\\n     /usr/local/bin/llvm-symbolizer \\\n     /usr/local/bin/\n\n# Copy the pre-compiled Python binaries and libraries\nCOPY --from=base-builder /usr/local/bin/python3.11 /usr/local/bin/python3.11\nCOPY --from=base-builder /usr/local/lib/libpython3.11.so.1.0 /usr/local/lib/libpython3.11.so.1.0\nCOPY --from=base-builder /usr/local/include/python3.11 /usr/local/include/python3.11\nCOPY --from=base-builder /usr/local/lib/python3.11 /usr/local/lib/python3.11\nCOPY --from=base-builder /usr/local/bin/pip3 /usr/local/bin/pip3\n\n# Create symbolic links to ensure compatibility\nRUN ldconfig && \\\n    ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 && \\\n    ln -s /usr/local/bin/python3.11 /usr/local/bin/python\n\nCOPY install_deps.sh /\nRUN /install_deps.sh && rm /install_deps.sh\n\nENV CODE_COVERAGE_SRC=/opt/code_coverage\n# Pin coverage to the same as in the base builder:\n# https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/install_python.sh#L22\nRUN git clone https://chromium.googlesource.com/chromium/src/tools/code_coverage $CODE_COVERAGE_SRC && \\\n    cd /opt/code_coverage && \\\n    git checkout edba4873b5e8a390e977a64c522db2df18a8b27d && \\\n    pip3 install wheel && \\\n    # If version \"Jinja2==2.10\" is in requirements.txt, bump it to a patch version that\n    # supports upgrading its MarkupSafe dependency to a Python 3.11 compatible release:\n    sed -i 's/Jinja2==2.10/Jinja2==2.10.3/' requirements.txt && \\\n    pip3 install -r requirements.txt && \\\n    pip3 install MarkupSafe==2.0.1 && \\\n    pip3 install coverage==6.3.2\n\n# Default environment options for various sanitizers.\n# Note that these match the settings used in ClusterFuzz and\n# shouldn't be changed unless a corresponding change is made on\n# ClusterFuzz side as well.\nENV ASAN_OPTIONS=\"alloc_dealloc_mismatch=0:allocator_may_return_null=1:allocator_release_to_os_interval_ms=500:check_malloc_usable_size=0:detect_container_overflow=1:detect_odr_violation=0:detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_fatal=0:handle_abort=1:handle_segv=1:handle_sigill=1:max_uar_stack_size_log=16:print_scariness=1:quarantine_size_mb=10:strict_memcmp=1:strip_path_prefix=/workspace/:symbolize=1:use_sigaltstack=1:dedup_token_length=3\"\nENV MSAN_OPTIONS=\"print_stats=1:strip_path_prefix=/workspace/:symbolize=1:dedup_token_length=3\"\nENV UBSAN_OPTIONS=\"print_stacktrace=1:print_summary=1:silence_unsigned_overflow=1:strip_path_prefix=/workspace/:symbolize=1:dedup_token_length=3\"\nENV FUZZER_ARGS=\"-rss_limit_mb=2560 -timeout=25\"\nENV AFL_FUZZER_ARGS=\"-m none\"\n\n# Set up Golang environment variables (copied from /root/.bash_profile).\nENV GOPATH /root/go\n\n# /root/.go/bin is for the standard Go binaries (i.e. go, gofmt, etc).\n# $GOPATH/bin is for the binaries from the dependencies installed via \"go get\".\nENV PATH $PATH:$GOPATH/bin\nCOPY gocoverage $GOPATH/gocoverage\n\nCOPY install_go.sh /\nRUN /install_go.sh && rm -rf /install_go.sh /root/.go\n\n# Install OpenJDK 15 and trim its size by removing unused components.\nENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64\nENV JAVA_15_HOME=/usr/lib/jvm/java-15-openjdk-amd64\nENV JVM_LD_LIBRARY_PATH=$JAVA_HOME/lib/server\nENV PATH=$PATH:$JAVA_HOME/bin\n\nCOPY install_java.sh /\nRUN /install_java.sh && rm /install_java.sh\n\n# Install JaCoCo for JVM coverage.\nRUN wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.7/org.jacoco.cli-0.8.7-nodeps.jar -O /opt/jacoco-cli.jar && \\\n    wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.7/org.jacoco.agent-0.8.7-runtime.jar -O /opt/jacoco-agent.jar && \\\n    echo \"37df187b76888101ecd745282e9cd1ad4ea508d6  /opt/jacoco-agent.jar\" | shasum --check && \\\n    echo \"c1814e7bba5fd8786224b09b43c84fd6156db690  /opt/jacoco-cli.jar\" | shasum --check\n\nCOPY install_javascript.sh /\nRUN /install_javascript.sh && rm /install_javascript.sh\n\n# Copy built ruby. It is up to the fuzzing harnesses\n# themselves to set GEM_HOME and GEM_PATH appropriately, as this depends\n# on how the harnesses are packaged.\nCOPY --from=base-ruby /usr/local/bin/ruby /usr/local/bin/ruby\nCOPY --from=base-ruby /usr/local/bin/gem /usr/local/bin/gem\nCOPY --from=base-ruby /usr/local/lib/ruby /usr/local/lib/ruby\nCOPY --from=base-ruby /usr/local/include/ruby-3.3.0 /usr/local/include/ruby-3.3.0\n\nRUN apt-get update && apt-get install -y luarocks\n\n# Do this last to make developing these files easier/faster due to caching.\nCOPY bad_build_check \\\n    coverage \\\n    coverage_helper \\\n    download_corpus \\\n    jacoco_report_converter.py \\\n    nyc_report_converter.py \\\n    rcfilt \\\n    reproduce \\\n    run_fuzzer \\\n    parse_options.py \\\n    generate_differential_cov_report.py \\\n    profraw_update.py \\\n    targets_list \\\n    test_all.py \\\n    test_one.py \\\n    python_coverage_runner_help.py \\\n    /usr/local/bin/\n"
  },
  {
    "path": "infra/base-images/base-runner/README.md",
    "content": "# base-runner\n> Base image for fuzzer runners.\n\n```bash\ndocker run -ti gcr.io/oss-fuzz-base/base-runner <command> <args>\n```\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `reproduce <fuzzer_name> <fuzzer_options>` | build all fuzz targets and run specified one with testcase `/testcase` and given options.\n| `run_fuzzer <fuzzer_name> <fuzzer_options>` | runs specified fuzzer combining options with `.options` file |\n| `test_all.py` | runs every binary in `/out` as a fuzzer for a while to ensure it works. |\n| `coverage <fuzzer_name>` | generate a coverage report for the given fuzzer. |\n\n# Examples\n\n- *Reproduce using latest OSS-Fuzz build:*\n\n<pre>\ndocker run --rm -ti -v <b><i>&lt;testcase_path&gt;</i></b>:/testcase gcr.io/oss-fuzz/<b><i>$PROJECT_NAME</i></b> reproduce <b><i>&lt;fuzzer_name&gt;</i></b>\n</pre>\n\n- *Reproduce using local source checkout:*\n\n<pre>\ndocker run --rm -ti -v <b><i>&lt;source_path&gt;</i></b>:/src/<b><i>$PROJECT_NAME</i></b> \\\n                    -v <b><i>&lt;testcase_path&gt;</i></b>:/testcase gcr.io/oss-fuzz/<b><i>$PROJECT_NAME</i></b> \\\n                    reproduce <b><i>&lt;fuzzer_name&gt;</i></b>\n</pre>\n"
  },
  {
    "path": "infra/base-images/base-runner/bad_build_check",
    "content": "#!/bin/bash -u\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# A minimal number of runs to test fuzz target with a non-empty input.\nMIN_NUMBER_OF_RUNS=4\n\n# The \"example\" target has 73 with ASan, 65 with UBSan, and 6648 with MSan.\n# Real world targets have greater values (arduinojson: 407, zlib: 664).\n# Mercurial's bdiff_fuzzer has 116 PCs when built with ASan.\nTHRESHOLD_FOR_NUMBER_OF_EDGES=100\n\n# A fuzz target is supposed to have at least two functions, such as\n# LLVMFuzzerTestOneInput and an API that is being called from there.\nTHRESHOLD_FOR_NUMBER_OF_FUNCTIONS=2\n\n# Threshold values for different sanitizers used by instrumentation checks.\nASAN_CALLS_THRESHOLD_FOR_ASAN_BUILD=1000\nASAN_CALLS_THRESHOLD_FOR_NON_ASAN_BUILD=0\n\n# The value below can definitely be higher (like 500-1000), but avoid being too\n# agressive here while still evaluating the DFT-based fuzzing approach.\nDFSAN_CALLS_THRESHOLD_FOR_DFSAN_BUILD=100\nDFSAN_CALLS_THRESHOLD_FOR_NON_DFSAN_BUILD=0\n\nMSAN_CALLS_THRESHOLD_FOR_MSAN_BUILD=1000\n# Some engines (e.g. honggfuzz) may make a very small number of calls to msan\n# for memory poisoning.\nMSAN_CALLS_THRESHOLD_FOR_NON_MSAN_BUILD=3\n\n# Usually, a non UBSan build (e.g. ASan) has 165 calls to UBSan runtime. The\n# majority of targets built with UBSan have 200+ UBSan calls, but there are\n# some very small targets that may have < 200 UBSan calls even in a UBSan build.\n# Use the threshold value of 168 (slightly > 165) for UBSan build.\nUBSAN_CALLS_THRESHOLD_FOR_UBSAN_BUILD=168\n\n# It would be risky to use the threshold value close to 165 for non UBSan build,\n# as UBSan runtime may change any time and thus we could have different number\n# of calls to UBSan runtime even in ASan build. With that, we use the threshold\n# value of 200 that would detect unnecessary UBSan instrumentation in the vast\n# majority of targets, except of a handful very small ones, which would not be\n# a big concern either way as the overhead for them would not be significant.\nUBSAN_CALLS_THRESHOLD_FOR_NON_UBSAN_BUILD=200\n\n# ASan builds on i386 generally have about 250 UBSan runtime calls.\nif [[ $ARCHITECTURE == 'i386' ]]\nthen\n  UBSAN_CALLS_THRESHOLD_FOR_NON_UBSAN_BUILD=280\nfi\n\n\n# Verify that the given fuzz target is correctly built to run with a particular\n# engine.\nfunction check_engine {\n  local FUZZER=$1\n  local FUZZER_NAME=$(basename $FUZZER)\n  local FUZZER_OUTPUT=\"/tmp/$FUZZER_NAME.output\"\n  local CHECK_FAILED=0\n\n  if [[ \"$FUZZING_ENGINE\" == libfuzzer ]]; then\n    # Store fuzz target's output into a temp file to be used for further checks.\n    $FUZZER -- -seed=1337 -runs=$MIN_NUMBER_OF_RUNS &>$FUZZER_OUTPUT\n    CHECK_FAILED=$(egrep \"ERROR: no interesting inputs were found. Is the code instrumented\" -c $FUZZER_OUTPUT)\n    if (( $CHECK_FAILED > 0 )); then\n      echo \"BAD BUILD: $FUZZER does not seem to have coverage instrumentation.\"\n      cat $FUZZER_OUTPUT\n      # Bail out as the further check does not make any sense, there are 0 PCs.\n      return 1\n    fi\n\n    local NUMBER_OF_EDGES=$(grep -Po \"INFO: Loaded [[:digit:]]+ module.*\\(.*(counters|guards)\\):[[:space:]]+\\K[[:digit:]]+\" $FUZZER_OUTPUT)\n\n    # If a fuzz target fails to start, grep won't find anything, so bail out early to let check_startup_crash deal with it.\n    [[ -z \"$NUMBER_OF_EDGES\" ]] && return\n\n    if (( $NUMBER_OF_EDGES < $THRESHOLD_FOR_NUMBER_OF_EDGES )); then\n      echo \"BAD BUILD: $FUZZER seems to have only partial coverage instrumentation.\"\n    fi\n  elif [[ \"$FUZZING_ENGINE\" == afl ]]; then\n    AFL_FORKSRV_INIT_TMOUT=30000 AFL_NO_UI=1 SKIP_SEED_CORPUS=1 timeout --preserve-status -s INT 35s run_fuzzer $FUZZER_NAME &>$FUZZER_OUTPUT\n    CHECK_PASSED=$(egrep \"All set and ready to roll\" -c $FUZZER_OUTPUT)\n    if (( $CHECK_PASSED == 0 )); then\n      echo \"BAD BUILD: fuzzing $FUZZER with afl-fuzz failed.\"\n      cat $FUZZER_OUTPUT\n      return 1\n    fi\n  elif [[ \"$FUZZING_ENGINE\" == honggfuzz ]]; then\n    SKIP_SEED_CORPUS=1 timeout --preserve-status -s INT 20s run_fuzzer $FUZZER_NAME &>$FUZZER_OUTPUT\n    CHECK_PASSED=$(egrep \"^Sz:[0-9]+ Tm:[0-9]+\" -c $FUZZER_OUTPUT)\n    if (( $CHECK_PASSED == 0 )); then\n      echo \"BAD BUILD: fuzzing $FUZZER with honggfuzz failed.\"\n      cat $FUZZER_OUTPUT\n      return 1\n    fi\n  elif [[ \"$FUZZING_ENGINE\" == dataflow ]]; then\n    $FUZZER &> $FUZZER_OUTPUT\n    local NUMBER_OF_FUNCTIONS=$(grep -Po \"INFO:\\s+\\K[[:digit:]]+(?=\\s+instrumented function.*)\" $FUZZER_OUTPUT)\n    [[ -z \"$NUMBER_OF_FUNCTIONS\" ]] && NUMBER_OF_FUNCTIONS=0\n    if (( $NUMBER_OF_FUNCTIONS < $THRESHOLD_FOR_NUMBER_OF_FUNCTIONS )); then\n      echo \"BAD BUILD: $FUZZER does not seem to be properly built in 'dataflow' config.\"\n      cat $FUZZER_OUTPUT\n      return 1\n    fi\n  elif [[ \"$FUZZING_ENGINE\" == centipede \\\n          && (\"${HELPER:-}\" == True || \"$SANITIZER\" == none ) ]]; then\n    # Performs run test on unsanitized binaries with auxiliary sanitized\n    # binaries if they are built with helper.py.\n    # Performs run test on unsanitized binaries without auxiliary sanitized\n    # binaries if they are from trial build and production build.\n    # TODO(Dongge): Support run test with sanitized binaries for trial and\n    # production build.\n    SKIP_SEED_CORPUS=1 timeout --preserve-status -s INT 20s run_fuzzer $FUZZER_NAME &>$FUZZER_OUTPUT\n    CHECK_PASSED=$(egrep \"\\[S0.0] begin-fuzz: ft: 0 corp: 0/0\" -c $FUZZER_OUTPUT)\n    if (( $CHECK_PASSED == 0 )); then\n      echo \"BAD BUILD: fuzzing $FUZZER with centipede failed.\"\n      cat $FUZZER_OUTPUT\n      return 1\n    fi\n  fi\n  \n  return 0\n}\n\n# Verify that the given fuzz target has been built properly and works.\nfunction check_startup_crash {\n  local FUZZER=$1\n  local FUZZER_NAME=$(basename $FUZZER)\n  local FUZZER_OUTPUT=\"/tmp/$FUZZER_NAME.output\"\n  local CHECK_PASSED=0\n\n  if [[ \"$FUZZING_ENGINE\" = libfuzzer ]]; then\n    # Skip seed corpus as there is another explicit check that uses seed corpora.\n    SKIP_SEED_CORPUS=1 run_fuzzer $FUZZER_NAME -seed=1337 -runs=$MIN_NUMBER_OF_RUNS &>$FUZZER_OUTPUT\n    CHECK_PASSED=$(egrep \"Done $MIN_NUMBER_OF_RUNS runs\" -c $FUZZER_OUTPUT)\n  elif [[ \"$FUZZING_ENGINE\" = afl ]]; then\n    AFL_FORKSRV_INIT_TMOUT=30000 AFL_NO_UI=1 SKIP_SEED_CORPUS=1 timeout --preserve-status -s INT 35s run_fuzzer $FUZZER_NAME &>$FUZZER_OUTPUT\n    if [ $(egrep \"target binary (crashed|terminated)\" -c $FUZZER_OUTPUT) -eq 0 ]; then\n      CHECK_PASSED=1\n    fi\n  elif [[ \"$FUZZING_ENGINE\" = dataflow ]]; then\n    # TODO(https://github.com/google/oss-fuzz/issues/1632): add check for\n    # binaries compiled with dataflow engine when the interface becomes stable.\n    CHECK_PASSED=1\n  else\n    # TODO: add checks for another fuzzing engines if possible.\n    CHECK_PASSED=1\n  fi\n\n  if [ \"$CHECK_PASSED\" -eq \"0\" ]; then\n    echo \"BAD BUILD: $FUZZER seems to have either startup crash or exit:\"\n    cat $FUZZER_OUTPUT\n    return 1\n  fi\n\n  return 0\n}\n\n# Mixed sanitizers check for ASan build.\nfunction check_asan_build {\n  local FUZZER=$1\n  local ASAN_CALLS=$2\n  local DFSAN_CALLS=$3\n  local MSAN_CALLS=$4\n  local UBSAN_CALLS=$5\n\n  # Perform all the checks for more detailed error message.\n  if (( $ASAN_CALLS < $ASAN_CALLS_THRESHOLD_FOR_ASAN_BUILD )); then\n    echo \"BAD BUILD: $FUZZER does not seem to be compiled with ASan.\"\n    return 1\n  fi\n\n  if (( $DFSAN_CALLS > $DFSAN_CALLS_THRESHOLD_FOR_NON_DFSAN_BUILD )); then\n    echo \"BAD BUILD: ASan build of $FUZZER seems to be compiled with DFSan.\"\n    return 1\n  fi\n\n  if (( $MSAN_CALLS > $MSAN_CALLS_THRESHOLD_FOR_NON_MSAN_BUILD )); then\n    echo \"BAD BUILD: ASan build of $FUZZER seems to be compiled with MSan.\"\n    return 1\n  fi\n\n  if (( $UBSAN_CALLS > $UBSAN_CALLS_THRESHOLD_FOR_NON_UBSAN_BUILD )); then\n    echo \"BAD BUILD: ASan build of $FUZZER seems to be compiled with UBSan.\"\n    return 1\n  fi\n\n  return 0\n}\n\n# Mixed sanitizers check for DFSan build.\nfunction check_dfsan_build {\n  local FUZZER=$1\n  local ASAN_CALLS=$2\n  local DFSAN_CALLS=$3\n  local MSAN_CALLS=$4\n  local UBSAN_CALLS=$5\n\n  # Perform all the checks for more detailed error message.\n  if (( $ASAN_CALLS > $ASAN_CALLS_THRESHOLD_FOR_NON_ASAN_BUILD )); then\n    echo \"BAD BUILD: DFSan build of $FUZZER seems to be compiled with ASan.\"\n    return 1\n  fi\n\n  if (( $DFSAN_CALLS < $DFSAN_CALLS_THRESHOLD_FOR_DFSAN_BUILD )); then\n    echo \"BAD BUILD: $FUZZER does not seem to be compiled with DFSan.\"\n    return 1\n  fi\n\n  if (( $MSAN_CALLS > $MSAN_CALLS_THRESHOLD_FOR_NON_MSAN_BUILD )); then\n    echo \"BAD BUILD: ASan build of $FUZZER seems to be compiled with MSan.\"\n    return 1\n  fi\n\n  if (( $UBSAN_CALLS > $UBSAN_CALLS_THRESHOLD_FOR_NON_UBSAN_BUILD )); then\n    echo \"BAD BUILD: ASan build of $FUZZER seems to be compiled with UBSan.\"\n    return 1\n  fi\n\n  return 0\n}\n\n\n# Mixed sanitizers check for MSan build.\nfunction check_msan_build {\n  local FUZZER=$1\n  local ASAN_CALLS=$2\n  local DFSAN_CALLS=$3\n  local MSAN_CALLS=$4\n  local UBSAN_CALLS=$5\n\n  # Perform all the checks for more detailed error message.\n  if (( $ASAN_CALLS > $ASAN_CALLS_THRESHOLD_FOR_NON_ASAN_BUILD )); then\n    echo \"BAD BUILD: MSan build of $FUZZER seems to be compiled with ASan.\"\n    return 1\n  fi\n\n  if (( $DFSAN_CALLS > $DFSAN_CALLS_THRESHOLD_FOR_NON_DFSAN_BUILD )); then\n    echo \"BAD BUILD: MSan build of $FUZZER seems to be compiled with DFSan.\"\n    return 1\n  fi\n\n  if (( $MSAN_CALLS < $MSAN_CALLS_THRESHOLD_FOR_MSAN_BUILD )); then\n    echo \"BAD BUILD: $FUZZER does not seem to be compiled with MSan.\"\n    return 1\n  fi\n\n  if (( $UBSAN_CALLS > $UBSAN_CALLS_THRESHOLD_FOR_NON_UBSAN_BUILD )); then\n    echo \"BAD BUILD: MSan build of $FUZZER seems to be compiled with UBSan.\"\n    return 1\n  fi\n\n  return 0\n}\n\n# Mixed sanitizers check for UBSan build.\nfunction check_ubsan_build {\n  local FUZZER=$1\n  local ASAN_CALLS=$2\n  local DFSAN_CALLS=$3\n  local MSAN_CALLS=$4\n  local UBSAN_CALLS=$5\n\n  if [[ \"$FUZZING_ENGINE\" != libfuzzer ]]; then\n    # Ignore UBSan checks for fuzzing engines other than libFuzzer because:\n    # A) we (probably) are not going to use those with UBSan\n    # B) such builds show indistinguishable number of calls to UBSan\n    return 0\n  fi\n\n  # Perform all the checks for more detailed error message.\n  if (( $ASAN_CALLS > $ASAN_CALLS_THRESHOLD_FOR_NON_ASAN_BUILD )); then\n    echo \"BAD BUILD: UBSan build of $FUZZER seems to be compiled with ASan.\"\n    return 1\n  fi\n\n  if (( $DFSAN_CALLS > $DFSAN_CALLS_THRESHOLD_FOR_NON_DFSAN_BUILD )); then\n    echo \"BAD BUILD: UBSan build of $FUZZER seems to be compiled with DFSan.\"\n    return 1\n  fi\n\n  if (( $MSAN_CALLS > $MSAN_CALLS_THRESHOLD_FOR_NON_MSAN_BUILD )); then\n    echo \"BAD BUILD: UBSan build of $FUZZER seems to be compiled with MSan.\"\n    return 1\n  fi\n\n  if (( $UBSAN_CALLS < $UBSAN_CALLS_THRESHOLD_FOR_UBSAN_BUILD )); then\n    echo \"BAD BUILD: $FUZZER does not seem to be compiled with UBSan.\"\n    return 1\n  fi\n}\n\n# Verify that the given fuzz target is compiled with correct sanitizer.\nfunction check_mixed_sanitizers {\n  local FUZZER=$1\n  local result=0\n  local CALL_INSN=\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"jvm\" ]; then\n    # Sanitizer runtime is linked into the Jazzer driver, so this check does not\n    # apply.\n    return 0\n  fi\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"javascript\" ]; then\n    # Jazzer.js currently does not support using sanitizers with native Node.js addons.\n    # This is not relevant anyways since supporting this will be done by preloading\n    # the sanitizers in the wrapper script starting Jazzer.js.\n    return 0\n  fi\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"ruby\" ]; then\n    return 0\n  fi\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"python\" ]; then\n    # Sanitizer runtime is loaded via LD_PRELOAD, so this check does not apply.\n    return 0\n  fi\n\n  # luzer-based tests.\n  # Sanitizer runtime is loaded via LD_PRELOAD, so this check does\n  # not apply.\n  egrep luarocks $FUZZER && return 0;\n\n  # For fuzztest fuzzers point to the binary instead of launcher script.\n  if [[ $FUZZER == *\"@\"* ]]; then\n    FUZZER=(${FUZZER//@/ }[0])\n  fi\n\n  CALL_INSN=\n  if [[ $ARCHITECTURE == \"x86_64\" ]]\n  then\n    CALL_INSN=\"callq?\\s+[0-9a-f]+\\s+<\"\n  elif [[ $ARCHITECTURE == \"i386\" ]]\n  then\n    CALL_INSN=\"call\\s+[0-9a-f]+\\s+<\"\n  elif [[ $ARCHITECTURE == \"aarch64\" ]]\n  then\n    CALL_INSN=\"bl\\s+[0-9a-f]+\\s+<\"\n  else\n    echo \"UNSUPPORTED ARCHITECTURE\"\n    exit 1\n  fi\n  local ASAN_CALLS=$(objdump -dC $FUZZER | egrep \"${CALL_INSN}__asan\" -c)\n  local DFSAN_CALLS=$(objdump -dC $FUZZER | egrep \"${CALL_INSN}__dfsan\" -c)\n  local MSAN_CALLS=$(objdump -dC $FUZZER | egrep \"${CALL_INSN}__msan\" -c)\n  local UBSAN_CALLS=$(objdump -dC $FUZZER | egrep \"${CALL_INSN}__ubsan\" -c)\n\n\n  if [[ \"$SANITIZER\" = address ]]; then\n    check_asan_build $FUZZER $ASAN_CALLS $DFSAN_CALLS $MSAN_CALLS $UBSAN_CALLS\n    result=$?\n  elif [[ \"$SANITIZER\" = dataflow ]]; then\n    check_dfsan_build $FUZZER $ASAN_CALLS $DFSAN_CALLS $MSAN_CALLS $UBSAN_CALLS\n    result=$?\n  elif [[ \"$SANITIZER\" = memory ]]; then\n    check_msan_build $FUZZER $ASAN_CALLS $DFSAN_CALLS $MSAN_CALLS $UBSAN_CALLS\n    result=$?\n  elif [[ \"$SANITIZER\" = undefined ]]; then\n    check_ubsan_build $FUZZER $ASAN_CALLS $DFSAN_CALLS $MSAN_CALLS $UBSAN_CALLS\n    result=$?\n  elif [[ \"$SANITIZER\" = thread ]]; then\n    # TODO(metzman): Implement this.\n    result=0\n  fi\n\n  return $result\n}\n\n# Verify that the given fuzz target doesn't crash on the seed corpus.\nfunction check_seed_corpus {\n  local FUZZER=$1\n  local FUZZER_NAME=\"$(basename $FUZZER)\"\n  local FUZZER_OUTPUT=\"/tmp/$FUZZER_NAME.output\"\n\n  if [[ \"$FUZZING_ENGINE\" != libfuzzer ]]; then\n    return 0\n  fi\n\n  # Set up common fuzzing arguments, otherwise \"run_fuzzer\" errors out.\n  if [ -z \"$FUZZER_ARGS\" ]; then\n    export FUZZER_ARGS=\"-rss_limit_mb=2560 -timeout=25\"\n  fi\n\n  bash -c \"run_fuzzer $FUZZER_NAME -runs=0\" &> $FUZZER_OUTPUT\n\n  # Don't output anything if fuzz target hasn't crashed.\n  if [ $? -ne 0 ]; then\n    echo \"BAD BUILD: $FUZZER has a crashing input in its seed corpus:\"\n    cat $FUZZER_OUTPUT\n    return 1\n  fi\n\n  return 0\n}\n\nfunction check_architecture {\n  local FUZZER=$1\n  local FUZZER_NAME=$(basename $FUZZER)\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"jvm\" ]; then\n    # The native dependencies of a JVM project are not packaged, but loaded\n    # dynamically at runtime and thus cannot be checked here.\n    return 0;\n  fi\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"javascript\" ]; then\n    # Jazzer.js fuzzers are wrapper scripts that start the fuzz target with\n    # the Jazzer.js CLI.\n    return 0;\n  fi\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"ruby\" ]; then\n    return 0;\n  fi\n\n  if [ \"${FUZZING_LANGUAGE:-}\" = \"python\" ]; then\n    FUZZER=${FUZZER}.pkg\n  fi\n\n  # luzer-based tests.\n  egrep luarocks $FUZZER && return 0;\n\n  # For fuzztest fuzzers point to the binary instead of launcher script.\n  if [[ $FUZZER == *\"@\"* ]]; then\n    FUZZER=(${FUZZER//@/ }[0])\n  fi\n\n  FILE_OUTPUT=$(file $FUZZER)\n  if [[ $ARCHITECTURE == \"x86_64\" ]]\n  then\n    echo $FILE_OUTPUT | grep \"x86-64\" > /dev/null\n  elif [[ $ARCHITECTURE == \"i386\" ]]\n  then\n    echo $FILE_OUTPUT | grep \"80386\" > /dev/null\n  elif [[ $ARCHITECTURE == \"aarch64\" ]]\n  then\n    echo $FILE_OUTPUT | grep \"aarch64\" > /dev/null\n  else\n    echo \"UNSUPPORTED ARCHITECTURE\"\n    return 1\n  fi\n  result=$?\n  if [[ $result != 0 ]]\n  then\n    echo \"BAD BUILD $FUZZER is not built for architecture: $ARCHITECTURE\"\n    echo \"file command output: $FILE_OUTPUT\"\n    echo \"check_mixed_sanitizers test will fail.\"\n  fi\n  return $result\n}\n\nfunction main {\n  local FUZZER=$1\n  local AUXILIARY_FUZZER=${2:-}\n  local checks_failed=0\n  local result=0\n\n  export RUN_FUZZER_MODE=\"batch\"\n  check_engine $FUZZER\n  result=$?\n  checks_failed=$(( $checks_failed + $result ))\n\n  check_architecture $FUZZER\n  result=$?\n  checks_failed=$(( $checks_failed + $result ))\n\n  if [[ \"$FUZZING_ENGINE\" == centipede \\\n        && \"$SANITIZER\" != none && \"${HELPER:-}\" == True ]]; then\n    check_mixed_sanitizers $AUXILIARY_FUZZER\n   else\n    check_mixed_sanitizers $FUZZER\n  fi\n  result=$?\n  checks_failed=$(( $checks_failed + $result ))\n\n  check_startup_crash $FUZZER\n  result=$?\n  checks_failed=$(( $checks_failed + $result ))\n\n  # TODO: re-enable after introducing bug auto-filing for bad builds.\n  # check_seed_corpus $FUZZER\n  return $checks_failed\n}\n\n\nif [ $# -ne 1 -a $# -ne 2 ]; then\n  echo \"Usage: $0 <fuzz_target_binary> [<auxiliary_binary>]\"\n  exit 1\nfi\n\n# Fuzz target path.\nFUZZER=$1\nAUXILIARY_FUZZER=${2:-}\n\nmain $FUZZER $AUXILIARY_FUZZER\nexit $?\n"
  },
  {
    "path": "infra/base-images/base-runner/coverage",
    "content": "#!/bin/bash -u\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $OUT\n\nif (( $# > 0 )); then\n  FUZZ_TARGETS=\"$@\"\nelse\n  FUZZ_TARGETS=\"$(find . -maxdepth 1 -type f -executable -printf '%P\\n' | \\\n      grep -v -x -F \\\n      -e 'llvm-symbolizer' \\\n      -e 'jazzer_agent_deploy.jar' \\\n      -e 'jazzer_driver' \\\n      -e 'jazzer_driver_with_sanitizer' \\\n      -e 'sanitizer_with_fuzzer.so')\"\nfi\n\nCOVERAGE_OUTPUT_DIR=${COVERAGE_OUTPUT_DIR:-$OUT}\n\nDUMPS_DIR=\"$COVERAGE_OUTPUT_DIR/dumps\"\nFUZZERS_COVERAGE_DUMPS_DIR=\"$DUMPS_DIR/fuzzers_coverage\"\nMERGED_COVERAGE_DIR=\"$COVERAGE_OUTPUT_DIR/merged_coverage\"\nFUZZER_STATS_DIR=\"$COVERAGE_OUTPUT_DIR/fuzzer_stats\"\nTEXTCOV_REPORT_DIR=\"$COVERAGE_OUTPUT_DIR/textcov_reports\"\nLOGS_DIR=\"$COVERAGE_OUTPUT_DIR/logs\"\nREPORT_ROOT_DIR=\"$COVERAGE_OUTPUT_DIR/report\"\nREPORT_BY_TARGET_ROOT_DIR=\"$COVERAGE_OUTPUT_DIR/report_target\"\nPLATFORM=linux\nREPORT_PLATFORM_DIR=\"$COVERAGE_OUTPUT_DIR/report/$PLATFORM\"\n\nfor directory in $DUMPS_DIR $FUZZER_STATS_DIR $LOGS_DIR $REPORT_ROOT_DIR $TEXTCOV_REPORT_DIR\\\n                 $REPORT_PLATFORM_DIR $REPORT_BY_TARGET_ROOT_DIR $FUZZERS_COVERAGE_DUMPS_DIR $MERGED_COVERAGE_DIR; do\n  rm -rf $directory\n  mkdir -p $directory\ndone\n\nPROFILE_FILE=\"$DUMPS_DIR/merged.profdata\"\nSUMMARY_FILE=\"$REPORT_PLATFORM_DIR/summary.json\"\nCOVERAGE_TARGET_FILE=\"$FUZZER_STATS_DIR/coverage_targets.txt\"\n\n# Use path mapping, as $SRC directory from the builder is copied into $OUT/$SRC.\nPATH_EQUIVALENCE_ARGS=\"-path-equivalence=/,$OUT\"\n\n# It's important to use $COVERAGE_EXTRA_ARGS as the last argument, because it\n# can contain paths to source files / directories which are positional args.\nLLVM_COV_COMMON_ARGS=\"$PATH_EQUIVALENCE_ARGS \\\n    -ignore-filename-regex=.*src/libfuzzer/.* $COVERAGE_EXTRA_ARGS\"\n\n# Options to extract branch coverage.\nBRANCH_COV_ARGS=\"--show-branches=count --show-expansions\"\n\n# Timeout for running a single fuzz target.\nTIMEOUT=1h\n\n# This will be used by llvm-cov command to generate the actual report.\nobjects=\"\"\n\n# Number of CPUs available, this is needed for running tests in parallel.\n# Set the max number of parallel jobs to be the CPU count and a max of 10.\nNPROC=$(nproc)\nMAX_PARALLEL_COUNT=10\n\nCORPUS_DIR=${CORPUS_DIR:-\"/corpus\"}\n\nfunction run_fuzz_target {\n  local target=$1\n\n  # '%1m' will produce separate dump files for every object. For example, if a\n  # fuzz target loads a shared library, we will have dumps for both of them.\n  local profraw_file=\"$DUMPS_DIR/$target.%1m.profraw\"\n  local profraw_file_mask=\"$DUMPS_DIR/$target.*.profraw\"\n  local profdata_file=\"$DUMPS_DIR/$target.profdata\"\n  local corpus_real=\"$CORPUS_DIR/${target}\"\n\n  # -merge=1 requires an output directory, create a new, empty dir for that.\n  local corpus_dummy=\"$OUT/dummy_corpus_dir_for_${target}\"\n  rm -rf $corpus_dummy && mkdir -p $corpus_dummy\n\n  # Use -merge=1 instead of -runs=0 because merge is crash resistant and would\n  # let to get coverage using all corpus files even if there are crash inputs.\n  # Merge should not introduce any significant overhead compared to -runs=0,\n  # because (A) corpuses are already minimized; (B) we do not use sancov, and so\n  # libFuzzer always finishes merge with an empty output dir.\n  # Use 100s timeout instead of 25s as code coverage builds can be very slow.\n  local args=\"-merge=1 -timeout=100 $corpus_dummy $corpus_real\"\n\n  export LLVM_PROFILE_FILE=$profraw_file\n  timeout $TIMEOUT $OUT/$target $args &> $LOGS_DIR/$target.log\n  cov_retcode=$?\n\n  target_error_log=\"$LOGS_DIR/${target}_error.log\"\n  grep -E \"^==[0-9]+== ERROR: libFuzzer:\" \"$LOGS_DIR/$target.log\" > \"$target_error_log\"\n  grep_retcode=$?\n\n  if (( $cov_retcode != 0 || $grep_retcode == 0 )); then\n    echo \"Error occured while running $target:\"\n    echo \"Cov returncode: $cov_retcode, grep returncode: $grep_retcode\"\n    cat $LOGS_DIR/$target.log\n  fi\n\n  rm -rf $corpus_dummy\n  if (( $(du -c $profraw_file_mask | tail -n 1 | cut -f 1) == 0 )); then\n    # Skip fuzz targets that failed to produce profile dumps.\n    return 0\n  fi\n\n  # If necessary translate to latest profraw version.\n  if [[ $target == *\"@\"* ]]; then\n    # Extract fuzztest binary name from fuzztest wrapper script.\n    target=(${target//@/ }[0])\n  fi\n  profraw_update.py $OUT/$target -i $profraw_file_mask\n  llvm-profdata merge -j=1 -sparse $profraw_file_mask -o $profdata_file\n\n  # Delete unnecessary and (potentially) large .profraw files.\n  rm $profraw_file_mask\n\n  shared_libraries=$(coverage_helper shared_libs -build-dir=$OUT -object=$target)\n\n  llvm-cov export -summary-only -instr-profile=$profdata_file -object=$target \\\n      $shared_libraries $LLVM_COV_COMMON_ARGS > $FUZZER_STATS_DIR/$target.json\n\n  # If grep returned zero an error was matched.\n  echo \"Coverage error, creating log file: $FUZZER_STATS_DIR/${target}_error.log\"\n  if (( $cov_retcode != 0 || $grep_retcode == 0 )); then\n    mv \"$target_error_log\" \"$FUZZER_STATS_DIR/${target}_error.log\";\n  fi\n\n  # For introspector.\n  llvm-cov show -instr-profile=$profdata_file -object=$target -line-coverage-gt=0 $shared_libraries $BRANCH_COV_ARGS $LLVM_COV_COMMON_ARGS > ${TEXTCOV_REPORT_DIR}/$target.covreport\n}\n\n# The native_go_fuzzers.json file contains a list of\n# fuzzers that are std lib harnesses. This function\n# reads that json list to see if the name of a fuzzer\n# exists in that list.\nis_std_lib_fuzzer() {\n  local element=\"$1\"\n  local file=\"$OUT/native_go_fuzzers.json\"\n\n  if [ -z \"$element\" ]; then\n    echo \"Usage: check_in_list \\\"element to check\\\"\"\n    return 1\n  fi\n\n  if [ ! -s \"$file\" ]; then\n    echo \"false\"\n    return 0\n  fi\n\n  if jq -e --arg item \"$element\" 'index($item) != null' \"$file\" > /dev/null; then\n    echo \"true\"\n  else\n    echo \"false\"\n  fi\n}\n\n# get_function_name reads a value from a simple json format:\n# \n# {\n#  \"fuzzerBinaryName1\": \"FuzzFunctionName1\",\n#  \"fuzzerBinaryName2\": \"FuzzFunctionName2\"\n# }\n# \n# In this case, we call `get_function_name fuzzerBinaryName1\n# $OUT/fuzzer_function_names.json` to get \"FuzzFunctionName1\".\n# We need this when setting up a temporary directory for\n# getting the coverage.\n# Go reads corpus files from `testdata/fuzz/FuzzFunctionName1`,\n# so we need the function name instead of the executable binary name.\nget_function_name() {\n  local key=\"$1\"\n  local file=\"$2\"\n\n  if [ -z \"$key\" ] || [ -z \"$file\" ]; then\n    echo \"Usage: get_function_name <key> <file>\"\n    return 1\n  fi\n\n  # If file doesn't exist or is empty\n  if [ ! -s \"$file\" ]; then\n    echo \"Error: File '$file' does not exist or is empty.\"\n    return 1\n  fi\n\n  # Use jq to extract the value\n  local result\n  result=$(jq -r --arg k \"$key\" '.[$k] // empty' \"$file\")\n\n  if [ -z \"$result\" ]; then\n    echo \"Error: Key '$key' not found in '$file'.\"\n    return 1\n  else\n    echo \"$result\"\n  fi\n}\n\nfunction run_go_fuzz_target {\n  local target=$1\n\n  echo \"Running go target $target\"\n  export FUZZ_CORPUS_DIR=\"$CORPUS_DIR/${target}/\"\n  export FUZZ_PROFILE_NAME=\"$DUMPS_DIR/$target.perf\"\n\n  # \"NAME\" in testdata/fuzz/NAME needs to be the function\n  # name of the fuzz test in the compiled binary. We have\n  # stored that name in $OUT/fuzzer_function_names.json.\n  # We also need this parameter for go-fuzz fuzzers, to\n  # run only the single function. Otherwise, the test may\n  # run other tests that are included in the binary\n  function_names_file=\"$OUT/fuzzer_function_names.json\"\n  function_name=$(get_function_name \"$target\" \"$function_names_file\")\n\n  if [[ \"$(is_std_lib_fuzzer \"${target}\")\" == \"true\" ]]; then\n\n    # Create the corpus dir testdata/fuzz/NAME\n    mkdir -p \"${OUT}/testdata/fuzz/${function_name}\"\n\n    # Now we copy the corpus generated at runtime into FUZZ_CORPUS_DIR.\n    # In the process, we convert it from a raw byte slice to files of\n    # the std lib Go corpus file format, eg:\n    # \n    # go test fuzz v1\n    # int8(42)\n    # string(\"hello\")\n    # \n    # The convertLibFuzzerTestcaseToStdLibGo binary handles the entire\n    # process for that.\n    convertLibFuzzerTestcaseToStdLibGo -convert-seeds \\\n      -params-json $OUT/fuzzer-parameters.json \\\n      -fuzzer-func \"${target}\" \\\n      -fuzzerBinaryName $target \\\n      -seeds-dir \"${FUZZ_CORPUS_DIR}\" \\\n      -out-dir \"${OUT}/testdata/fuzz/${function_name}\"\n\n    pushd $OUT\n      timeout \"$TIMEOUT\" \\\n        \"$OUT/$target\" \\\n        -test.run=\"^${function_name}\\$\" \\\n        -test.coverprofile \"$DUMPS_DIR/$target.profdata\" \\\n        &> \"$LOGS_DIR/$target.log\"\n      if (( $? != 0 )); then\n        echo \"Error occured while running std lib fuzzer $target:\"\n        cat $LOGS_DIR/$target.log\n      fi\n    popd\n    # cleanup after native go fuzzers\n    rm -r \"${OUT}/testdata/fuzz/${function_name}\"\n    # The std lib fuzzers are renamed to \"*_fuzz_.go\" during \"infra/helper.py build_fuzzers\".\n    # They are are therefore refered to as \"*_fuzz_.go\" in the profdata files.\n    # Since the copies named \"*_fuzz_.go\" do not exist in the file tree during\n    # the coverage build, we change the references in the .profdata files\n    # to the original file names.\n    sed -i \"s/_libFuzzer.go/_test.go/g\" $DUMPS_DIR/$target.profdata\n  else\n    timeout \"$TIMEOUT\" \\\n      \"$OUT/$target\" \\\n      -test.run=\"^${function_name}\\$\" \\\n      -test.coverprofile \"$DUMPS_DIR/$target.profdata\" \\\n      &> \"$LOGS_DIR/$target.log\"\n    if (( $? != 0 )); then\n      echo \"Error occured while running $target:\"\n      cat $LOGS_DIR/$target.log\n    fi\n  fi\n\n  # translate from golangish paths to current absolute paths\n  cat $OUT/$target.gocovpath | while read i; do sed -i $i $DUMPS_DIR/$target.profdata; done\n  # cf PATH_EQUIVALENCE_ARGS\n  sed -i 's=/='$OUT'/=' $DUMPS_DIR/$target.profdata\n  $SYSGOPATH/bin/gocovsum $DUMPS_DIR/$target.profdata > $FUZZER_STATS_DIR/$target.json\n}\n\nfunction run_python_fuzz_target {\n  local target=$1\n  local zipped_sources=\"$DUMPS_DIR/$target.deps.zip\"\n  local corpus_real=\"$CORPUS_DIR/${target}\"\n  # Write dummy stats file\n  echo \"{}\" > \"$FUZZER_STATS_DIR/$target.json\"\n\n  # Run fuzzer\n  $OUT/$target $corpus_real -atheris_runs=$(ls -la $corpus_real | wc -l) > $LOGS_DIR/$target.log 2>&1\n  if (( $? != 0 )); then\n    echo \"Error happened getting coverage of $target\"\n    echo \"This is likely because Atheris did not exit gracefully\"\n    cat $LOGS_DIR/$target.log\n    return 0\n  fi\n  mv .coverage $OUT/.coverage_$target\n}\n\nfunction run_java_fuzz_target {\n  local target=$1\n\n  local exec_file=\"$DUMPS_DIR/$target.exec\"\n  local class_dump_dir=\"$DUMPS_DIR/${target}_classes/\"\n  mkdir \"$class_dump_dir\"\n  local corpus_real=\"$CORPUS_DIR/${target}\"\n\n  # -merge=1 requires an output directory, create a new, empty dir for that.\n  local corpus_dummy=\"$OUT/dummy_corpus_dir_for_${target}\"\n  rm -rf $corpus_dummy && mkdir -p $corpus_dummy\n\n  # Use 100s timeout instead of 25s as code coverage builds can be very slow.\n  local jacoco_args=\"destfile=$exec_file,classdumpdir=$class_dump_dir,excludes=com.code_intelligence.jazzer.*\\\\:com.sun.tools.attach.VirtualMachine\"\n  local args=\"-merge=1 -timeout=100 --nohooks \\\n      --additional_jvm_args=-javaagent\\\\:/opt/jacoco-agent.jar=$jacoco_args \\\n      $corpus_dummy $corpus_real\"\n\n  timeout $TIMEOUT $OUT/$target $args &> $LOGS_DIR/$target.log\n  if (( $? != 0 )); then\n    echo \"Error occured while running $target:\"\n    cat $LOGS_DIR/$target.log\n  fi\n\n  if (( $(du -c $exec_file | tail -n 1 | cut -f 1) == 0 )); then\n    # Skip fuzz targets that failed to produce .exec files.\n    echo \"$target failed to produce .exec file.\"\n    return 0\n  fi\n\n  # Generate XML report only as input to jacoco_report_converter.\n  # Source files are not needed for the summary.\n  local xml_report=\"$DUMPS_DIR/${target}.xml\"\n  local summary_file=\"$FUZZER_STATS_DIR/$target.json\"\n  java -jar /opt/jacoco-cli.jar report $exec_file \\\n      --xml $xml_report \\\n      --classfiles $class_dump_dir\n\n  # Write llvm-cov summary file.\n  jacoco_report_converter.py $xml_report $summary_file\n}\n\nfunction run_javascript_fuzz_target {\n  local target=$1\n  local corpus_real=\"$CORPUS_DIR/${target}\"\n\n  # -merge=1 requires an output directory, create a new, empty dir for that.\n  local corpus_dummy=\"$OUT/dummy_corpus_dir_for_${target}\"\n  rm -rf $corpus_dummy && mkdir -p $corpus_dummy\n\n  # IstanbulJS currently does not work when the tested program creates\n  # subprocesses. For this reason, we first minimize the corpus removing\n  # any crashing inputs so that we can report source-based code coverage\n  # with a single sweep over the minimized corpus\n  local merge_args=\"-merge=1 -timeout=100 $corpus_dummy $corpus_real\"\n  timeout $TIMEOUT $OUT/$target $merge_args &> $LOGS_DIR/$target.log\n\n  # nyc saves the coverage reports in a directory with the default name \"coverage\"\n  local coverage_dir=\"$DUMPS_DIR/coverage_dir_for_${target}\"\n  rm -rf $coverage_dir && mkdir -p $coverage_dir\n\n  local nyc_json_coverage_file=\"$coverage_dir/coverage-final.json\"\n  local nyc_json_summary_file=\"$coverage_dir/coverage-summary.json\"\n\n  local args=\"-runs=0 $corpus_dummy\"\n  local jazzerjs_args=\"--coverage --coverageDirectory $coverage_dir --coverageReporters json --coverageReporters json-summary\"\n\n  JAZZERJS_EXTRA_ARGS=$jazzerjs_args $OUT/$target $args &> $LOGS_DIR/$target.log\n\n  if (( $? != 0 )); then\n    echo \"Error occured while running $target:\"\n    cat $LOGS_DIR/$target.log\n  fi\n\n  if [ ! -s $nyc_json_coverage_file ]; then\n    # Skip fuzz targets that failed to produce coverage-final.json file.\n    echo \"$target failed to produce coverage-final.json file.\"\n    return 0\n  fi\n\n  cp $nyc_json_coverage_file $FUZZERS_COVERAGE_DUMPS_DIR/$target.json\n\n  local summary_file=\"$FUZZER_STATS_DIR/$target.json\"\n\n  nyc_report_converter.py $nyc_json_summary_file $summary_file\n}\n\nfunction generate_html {\n  local profdata=$1\n  local shared_libraries=$2\n  local objects=$3\n  local output_dir=$4\n\n  rm -rf \"$output_dir\"\n  mkdir -p \"$output_dir/$PLATFORM\"\n\n  local llvm_cov_args=\"-instr-profile=$profdata $objects $LLVM_COV_COMMON_ARGS\"\n  llvm-cov show -format=html -output-dir=$output_dir -Xdemangler rcfilt $llvm_cov_args\n\n  # Export coverage summary in JSON format.\n  local summary_file=$output_dir/$PLATFORM/summary.json\n\n  llvm-cov export -summary-only $llvm_cov_args > $summary_file\n\n  coverage_helper -v post_process -src-root-dir=/ -summary-file=$summary_file \\\n      -output-dir=$output_dir $PATH_EQUIVALENCE_ARGS\n}\n\nexport SYSGOPATH=$GOPATH\nexport GOPATH=$OUT/$GOPATH\n# Run each fuzz target, generate raw coverage dumps.\nfor fuzz_target in $FUZZ_TARGETS; do\n  # Test if fuzz target is a golang one.\n  if [[ $FUZZING_LANGUAGE == \"go\" ]]; then\n    # Continue if not a fuzz target.\n    if [[ $FUZZING_ENGINE != \"none\" ]]; then\n      grep \"FUZZ_CORPUS_DIR\" $fuzz_target > /dev/null 2>&1 || grep \"testing\\.T\" $fuzz_target > /dev/null 2>&1 || continue\n    fi\n    # Log the target in the targets file.\n    echo ${fuzz_target} >> $COVERAGE_TARGET_FILE\n\n    # Run the coverage collection.\n    run_go_fuzz_target $fuzz_target &\n  elif [[ $FUZZING_LANGUAGE == \"python\" ]]; then\n    echo \"Entering python fuzzing\"\n    # Log the target in the targets file.\n    echo ${fuzz_target} >> $COVERAGE_TARGET_FILE\n\n    # Run the coverage collection.\n    run_python_fuzz_target $fuzz_target\n  elif [[ $FUZZING_LANGUAGE == \"jvm\" ]]; then\n    # Continue if not a fuzz target.\n    if [[ $FUZZING_ENGINE != \"none\" ]]; then\n      grep \"LLVMFuzzerTestOneInput\" $fuzz_target > /dev/null 2>&1 || continue\n    fi\n\n    echo \"Running $fuzz_target\"\n    # Log the target in the targets file.\n    echo ${fuzz_target} >> $COVERAGE_TARGET_FILE\n\n    # Run the coverage collection.\n    run_java_fuzz_target $fuzz_target &\n  elif [[ $FUZZING_LANGUAGE == \"javascript\" ]]; then\n    # Continue if not a fuzz target.\n    if [[ $FUZZING_ENGINE != \"none\" ]]; then\n      grep \"LLVMFuzzerTestOneInput\" $fuzz_target > /dev/null 2>&1 || continue\n    fi\n\n    echo \"Running $fuzz_target\"\n    # Log the target in the targets file.\n    echo ${fuzz_target} >> $COVERAGE_TARGET_FILE\n\n    # Run the coverage collection.\n    run_javascript_fuzz_target $fuzz_target &\n  else\n    # Continue if not a fuzz target.\n    if [[ $FUZZING_ENGINE != \"none\" ]]; then\n      grep \"LLVMFuzzerTestOneInput\" $fuzz_target > /dev/null 2>&1 || continue\n    fi\n\n    echo \"Running $fuzz_target\"\n    # Log the target in the targets file.\n    echo ${fuzz_target} >> $COVERAGE_TARGET_FILE\n\n    # Run the coverage collection.\n    run_fuzz_target $fuzz_target &\n\n    # Rewrite object if its a FUZZTEST target\n    if [[ $fuzz_target == *\"@\"* ]]; then\n      # Extract fuzztest binary name from fuzztest wrapper script.\n      fuzz_target=(${fuzz_target//@/ }[0])\n    fi\n    if [[ -z $objects ]]; then\n      # The first object needs to be passed without -object= flag.\n      objects=\"$fuzz_target\"\n    else\n      objects=\"$objects -object=$fuzz_target\"\n    fi\n  fi\n\n\n  # Limit the number of processes to be spawned.\n  n_child_proc=$(jobs -rp | wc -l)\n  while [[ \"$n_child_proc\" -eq \"$NPROC\" || \"$n_child_proc\" -gt \"$MAX_PARALLEL_COUNT\" ]]; do\n    sleep 4\n    n_child_proc=$(jobs -rp | wc -l)\n  done\ndone\n\n# Wait for background processes to finish.\nwait\n\nif [[ $FUZZING_LANGUAGE == \"go\" ]]; then\n  echo $DUMPS_DIR\n  $SYSGOPATH/bin/gocovmerge $DUMPS_DIR/*.profdata > fuzz.cov\n  gotoolcover -html=fuzz.cov -o $REPORT_ROOT_DIR/index.html\n  $SYSGOPATH/bin/gocovsum fuzz.cov > $SUMMARY_FILE\n  cp $REPORT_ROOT_DIR/index.html $REPORT_PLATFORM_DIR/index.html\n  $SYSGOPATH/bin/pprof-merge $DUMPS_DIR/*.perf.cpu.prof\n  mv merged.data $REPORT_ROOT_DIR/cpu.prof\n  $SYSGOPATH/bin/pprof-merge $DUMPS_DIR/*.perf.heap.prof\n  mv merged.data $REPORT_ROOT_DIR/heap.prof\n  #TODO some proxy for go tool pprof -http=127.0.0.1:8001 $DUMPS_DIR/cpu.prof\n  echo \"Finished generating code coverage report for Go fuzz targets.\"\nelif [[ $FUZZING_LANGUAGE == \"python\" ]]; then\n  # Extract source files from all dependency zip folders\n  mkdir -p /pythoncovmergedfiles/medio\n  PYCOVDIR=/pycovdir/\n  mkdir $PYCOVDIR\n  for fuzzer in $FUZZ_TARGETS; do\n    fuzzer_deps=${fuzzer}.pkg.deps.zip\n    unzip $OUT/${fuzzer_deps}\n    rsync -r ./medio /pythoncovmergedfiles/medio\n    rm -rf ./medio\n\n    # Translate paths in unzipped folders to paths that we can use\n    mv $OUT/.coverage_$fuzzer .coverage\n    python3 /usr/local/bin/python_coverage_runner_help.py translate /pythoncovmergedfiles/medio\n    cp .new_coverage $PYCOVDIR/.coverage_$fuzzer\n    cp .new_coverage $OUT/coverage_d_$fuzzer\n  done\n\n  # Combine coverage\n  cd $PYCOVDIR\n  python3 /usr/local/bin/python_coverage_runner_help.py combine .coverage_*\n  python3 /usr/local/bin/python_coverage_runner_help.py html\n  # Produce all_cov file used by fuzz introspector.\n  python3 /usr/local/bin/python_coverage_runner_help.py json -o ${TEXTCOV_REPORT_DIR}/all_cov.json\n\n  # Generate .json with similar format to llvm-cov output.\n  python3 /usr/local/bin/python_coverage_runner_help.py \\\n      convert-to-summary-json ${TEXTCOV_REPORT_DIR}/all_cov.json $SUMMARY_FILE\n\n  # Copy coverage date out\n  cp htmlcov/status.json ${TEXTCOV_REPORT_DIR}/html_status.json\n\n  mv htmlcov/* $REPORT_PLATFORM_DIR/\n  mv .coverage_* $REPORT_PLATFORM_DIR/\nelif [[ $FUZZING_LANGUAGE == \"jvm\" ]]; then\n\n  # From this point on the script does not tolerate any errors.\n  set -e\n\n  # Merge .exec files from the individual targets.\n  jacoco_merged_exec=$DUMPS_DIR/jacoco.merged.exec\n  java -jar /opt/jacoco-cli.jar merge $DUMPS_DIR/*.exec \\\n      --destfile $jacoco_merged_exec\n\n  # Prepare classes directory for jacoco process\n  classes_dir=$DUMPS_DIR/classes\n  mkdir $classes_dir\n\n  # Only copy class files found in $OUT/$SRC to ensure they are\n  # lively compiled from the project, avoiding inclusion of\n  # dependency classes. This also includes the fuzzer classes.\n  find \"$OUT/$SRC\" -type f -name \"*.class\" | while read -r class_file; do\n    # Skip module-info.class\n    if [[ \"$(basename \"$class_file\")\" == \"module-info.class\" ]]; then\n        continue\n    fi\n\n    # Use javap to extract the fully qualified name of the class and copy it to $classes_dir\n    fqn=$(javap -verbose \"$class_file\" 2>/dev/null | grep \"this_class:\" | grep -oP '(?<=// ).*')\n    if [ -n \"$fqn\" ]; then\n      mkdir -p $classes_dir/$(dirname $fqn)\n      cp $class_file $classes_dir/$fqn.class\n    fi\n  done\n\n  # Heuristically determine source directories based on Maven structure.\n  # Always include the $SRC root as it likely contains the fuzzer sources.\n  sourcefiles_args=(--sourcefiles $OUT/$SRC)\n  source_dirs=$(find $OUT/$SRC -type d -name 'java')\n  for source_dir in $source_dirs; do\n    sourcefiles_args+=(--sourcefiles \"$source_dir\")\n  done\n\n  # Generate HTML and XML reports.\n  xml_report=$REPORT_PLATFORM_DIR/index.xml\n  java -jar /opt/jacoco-cli.jar report $jacoco_merged_exec \\\n      --html $REPORT_PLATFORM_DIR \\\n      --xml $xml_report \\\n      --classfiles $classes_dir \\\n      \"${sourcefiles_args[@]}\"\n\n  # Also serve the raw exec file and XML report, which can be useful for\n  # automated analysis.\n  cp $jacoco_merged_exec $REPORT_PLATFORM_DIR/jacoco.exec\n  cp $xml_report $REPORT_PLATFORM_DIR/jacoco.xml\n  cp $xml_report $TEXTCOV_REPORT_DIR/jacoco.xml\n\n  # Write llvm-cov summary file.\n  jacoco_report_converter.py $xml_report $SUMMARY_FILE\n\n  set +e\nelif [[ $FUZZING_LANGUAGE == \"javascript\" ]]; then\n\n  # From this point on the script does not tolerate any errors.\n  set -e\n\n  json_report=$MERGED_COVERAGE_DIR/coverage.json\n  nyc merge $FUZZERS_COVERAGE_DUMPS_DIR $json_report\n\n  nyc report -t $MERGED_COVERAGE_DIR --report-dir $REPORT_PLATFORM_DIR --reporter=html --reporter=json-summary\n\n  nyc_json_summary_file=$REPORT_PLATFORM_DIR/coverage-summary.json\n\n  # Write llvm-cov summary file.\n  nyc_report_converter.py $nyc_json_summary_file $SUMMARY_FILE\n\n  set +e\nelse\n\n  # From this point on the script does not tolerate any errors.\n  set -e\n\n  # Merge all dumps from the individual targets.\n  rm -f $PROFILE_FILE\n  llvm-profdata merge -sparse $DUMPS_DIR/*.profdata -o $PROFILE_FILE\n\n  # TODO(mmoroz): add script from Chromium for rendering directory view reports.\n  # The first path in $objects does not have -object= prefix (llvm-cov format).\n  shared_libraries=$(coverage_helper shared_libs -build-dir=$OUT -object=$objects)\n  objects=\"$objects $shared_libraries\"\n\n  generate_html $PROFILE_FILE \"$shared_libraries\" \"$objects\" \"$REPORT_ROOT_DIR\"\n\n  # Per target reports.\n  for fuzz_target in $FUZZ_TARGETS; do\n    if [[ $fuzz_target == *\"@\"* ]]; then\n      profdata_path=$DUMPS_DIR/$fuzz_target.profdata\n      report_dir=$REPORT_BY_TARGET_ROOT_DIR/$fuzz_target\n      # Extract fuzztest binary name from fuzztest wrapper script.\n      fuzz_target=(${fuzz_target//@/ }[0])\n    else\n      profdata_path=$DUMPS_DIR/$fuzz_target.profdata\n      report_dir=$REPORT_BY_TARGET_ROOT_DIR/$fuzz_target\n    fi\n    if [[ ! -f \"$profdata_path\" ]]; then\n      echo \"WARNING: $fuzz_target has no profdata generated.\"\n      continue\n    fi\n\n    generate_html $profdata_path \"$shared_libraries\" \"$fuzz_target\" \"$report_dir\"\n  done\n\n  set +e\nfi\n\n# Make sure report is readable.\nchmod -R +r $REPORT_ROOT_DIR $REPORT_BY_TARGET_ROOT_DIR\nfind $REPORT_ROOT_DIR $REPORT_BY_TARGET_ROOT_DIR -type d -exec chmod +x {} +\n\n# HTTP_PORT is optional.\nset +u\nif [[ -n $HTTP_PORT ]]; then\n  # Serve the report locally.\n  echo \"Serving the report on http://127.0.0.1:$HTTP_PORT/linux/index.html\"\n  cd $REPORT_ROOT_DIR\n  python3 -m http.server $HTTP_PORT\nfi\n"
  },
  {
    "path": "infra/base-images/base-runner/coverage_helper",
    "content": "#!/bin/bash -u\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 $CODE_COVERAGE_SRC/coverage_utils.py $@\n"
  },
  {
    "path": "infra/base-images/base-runner/download_corpus",
    "content": "#!/bin/bash -u\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif (( $# < 1 )); then\n  echo \"Usage: $0 \\\"path_download_to url_download_from\\\" (can be repeated)\" >&2\n  exit 1\nfi\n\nfor pair in \"$@\"; do\n  read path url <<< \"$pair\"\n  wget -q -O $path $url\ndone\n\n# Always exit with 0 as we do not track wget return codes and should not rely\n# on the latest command execution.\nexit 0\n"
  },
  {
    "path": "infra/base-images/base-runner/generate_differential_cov_report.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script for generating differential coverage reports.\ngenerate_differential_cov_report.py <profdata-dump-directory> \\\n<profdata-directory-to-subtract-from-first> <output-directory>\n\"\"\"\nimport os\nimport shutil\nimport subprocess\nimport sys\n\n\nclass ProfData:\n  \"\"\"Class representing a profdata file.\"\"\"\n\n  def __init__(self, text):\n    self.function_profs = []\n    for function_prof in text.split('\\n\\n'):\n      if not function_prof:\n        continue\n      self.function_profs.append(FunctionProf(function_prof))\n\n  def to_string(self):\n    \"\"\"Convert back to a string.\"\"\"\n    return '\\n'.join(\n        [function_prof.to_string() for function_prof in self.function_profs])\n\n  def find_function(self, function, idx=None):\n    \"\"\"Find the same function in this profdata.\"\"\"\n    if idx is not None:\n      try:\n        possibility = self.function_profs[idx]\n        if function.func_hash == possibility.func_hash:\n          return possibility\n      except IndexError:\n        pass\n    for function_prof in self.function_profs:\n      if function_prof.func_hash == function.func_hash:\n        return function_prof\n    return None\n\n  def subtract(self, subtrahend):\n    \"\"\"Subtract subtrahend from this profdata.\"\"\"\n    for idx, function_prof in enumerate(self.function_profs):\n      subtrahend_function_prof = subtrahend.find_function(function_prof, idx)\n      function_prof.subtract(subtrahend_function_prof)\n\n\nclass FunctionProf:\n  \"\"\"Profile of a function.\"\"\"\n  FUNC_HASH_COMMENT_LINE = '# Func Hash:'\n  NUM_COUNTERS_COMMENT_LINE = '# Num Counters:'\n  COUNTER_VALUES_COMMENT_LINE = '# Counter Values:'\n\n  def __init__(self, text):\n    print(text)\n    lines = text.splitlines()\n    self.function = lines[0]\n    assert self.FUNC_HASH_COMMENT_LINE == lines[1]\n    self.func_hash = lines[2]\n    assert self.NUM_COUNTERS_COMMENT_LINE == lines[3]\n    self.num_counters = int(lines[4])\n    assert self.COUNTER_VALUES_COMMENT_LINE == lines[5]\n    self.counter_values = [1 if int(line) else 0 for line in lines[6:]]\n\n  def to_string(self):\n    \"\"\"Convert back to text.\"\"\"\n    lines = [\n        self.function,\n        self.FUNC_HASH_COMMENT_LINE,\n        self.func_hash,\n        self.NUM_COUNTERS_COMMENT_LINE,\n        str(self.num_counters),\n        self.COUNTER_VALUES_COMMENT_LINE,\n    ] + [str(num) for num in self.counter_values]\n    return '\\n'.join(lines)\n\n  def subtract(self, subtrahend_prof):\n    \"\"\"Subtract this other function from this function.\"\"\"\n    if not subtrahend_prof:\n      print(self.function, 'has no subtrahend')\n      # Nothing to subtract.\n      return\n    self.counter_values = [\n        max(counter1 - counter2, 0) for counter1, counter2 in zip(\n            self.counter_values, subtrahend_prof.counter_values)\n    ]\n\n\ndef get_profdata_files(directory):\n  \"\"\"Returns profdata files in |directory|.\"\"\"\n  profdatas = []\n  for filename in os.listdir(directory):\n    filename = os.path.join(directory, filename)\n    if filename.endswith('.profdata'):\n      profdatas.append(filename)\n  return profdatas\n\n\ndef convert_profdata_to_text(profdata):\n  \"\"\"Convert a profdata binary file to a profdata text file.\"\"\"\n  profdata_text = f'{profdata}.txt'\n  if os.path.exists(profdata_text):\n    os.remove(profdata_text)\n  command = [\n      'llvm-profdata', 'merge', '-j=1', '-sparse', profdata, '--text', '-o',\n      profdata_text\n  ]\n  print(command)\n  subprocess.run(command, check=True)\n  return profdata_text\n\n\ndef convert_text_profdata_to_bin(profdata_text):\n  \"\"\"Convert a profdata text file to a profdata binary file.\"\"\"\n  profdata = profdata_text.replace('.txt', '').replace('.profdata',\n                                                       '') + '.profdata'\n  print('bin profdata', profdata)\n  if os.path.exists(profdata):\n    os.remove(profdata)\n  command = [\n      'llvm-profdata', 'merge', '-j=1', '-sparse', profdata_text, '-o', profdata\n  ]\n  print(command)\n  subprocess.run(command, check=True)\n  return profdata\n\n\ndef get_difference(minuend_filename, subtrahend_filename):\n  \"\"\"Subtract subtrahend_filename from minuend_filename.\"\"\"\n  with open(minuend_filename, 'r', encoding='utf-8') as minuend_file:\n    print('minuend', minuend_filename)\n    minuend = ProfData(minuend_file.read())\n  with open(subtrahend_filename, 'r', encoding='utf-8') as subtrahend_file:\n    print('subtrahend', subtrahend_filename)\n    subtrahend = ProfData(subtrahend_file.read())\n\n  minuend.subtract(subtrahend)\n  return minuend\n\n\ndef profdatas_to_objects(profdatas):\n  \"\"\"Get the corresponding objects for each profdata.\"\"\"\n  return [\n      os.path.splitext(os.path.basename(profdata))[0] for profdata in profdatas\n  ]\n\n\ndef generate_differential_cov_reports(minuend_profdatas, subtrahend_profdatas,\n                                      difference_dir):\n  \"\"\"Calculate the differences between all profdatas and generate differential\n  coverage reports.\"\"\"\n  profdata_objects = profdatas_to_objects(minuend_profdatas)\n  real_profdata_objects = [\n      binobject for binobject in profdata_objects if binobject != 'merged'\n  ]\n  for minuend, subtrahend, binobject in zip(minuend_profdatas,\n                                            subtrahend_profdatas,\n                                            profdata_objects):\n    minuend_text = convert_profdata_to_text(minuend)\n    subtrahend_text = convert_profdata_to_text(subtrahend)\n    difference = get_difference(minuend_text, subtrahend_text)\n    basename = os.path.basename(minuend_text)\n    difference_text = os.path.join(difference_dir, basename)\n    with open(difference_text, 'w', encoding='utf-8') as file_handle:\n      file_handle.write(difference.to_string())\n    difference_profdata = convert_text_profdata_to_bin(difference_text)\n    if not difference_profdata.endswith('merged.profdata'):\n      generate_html_report(difference_profdata, [binobject],\n                           os.path.join(difference_dir, binobject))\n    else:\n      generate_html_report(difference_profdata, real_profdata_objects,\n                           os.path.join(difference_dir, 'merged'))\n\n\ndef generate_html_report(profdata, objects, directory):\n  \"\"\"Generate an HTML coverage report.\"\"\"\n  # TODO(metzman): Deal with shared libs.\n  html_dir = os.path.join(directory, 'reports')\n  if os.path.exists(html_dir):\n    os.remove(html_dir)\n  os.makedirs(html_dir)\n  out_dir = os.getenv('OUT', '/out')\n  command = [\n      'llvm-cov', 'show', f'-path-equivalence=/,{out_dir}', '-format=html',\n      '-Xdemangler', 'rcfilt', f'-instr-profile={profdata}'\n  ]\n\n  objects = [os.path.join(out_dir, binobject) for binobject in objects]\n  command += objects + ['-o', html_dir]\n  print(' '.join(command))\n  subprocess.run(command, check=True)\n\n\ndef main():\n  \"\"\"Generate differential coverage reports.\"\"\"\n  if len(sys.argv) != 4:\n    print(\n        f'Usage: {sys.argv[0]} <minuend_dir> <subtrahend_dir> <difference_dir>')\n  minuend_dir = sys.argv[1]\n  subtrahend_dir = sys.argv[2]\n  difference_dir = sys.argv[3]\n  if os.path.exists(difference_dir):\n    shutil.rmtree(difference_dir)\n  os.makedirs(difference_dir, exist_ok=True)\n  minuend_profdatas = get_profdata_files(minuend_dir)\n  subtrahend_profdatas = get_profdata_files(subtrahend_dir)\n  generate_differential_cov_reports(minuend_profdatas, subtrahend_profdatas,\n                                    difference_dir)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-runner/gocoverage/go.mod",
    "content": "module oss-fuzz.com/gocoverage\n\ngo 1.14\n\nrequire (\n\tgithub.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5\n\tgolang.org/x/tools v0.1.0\n)\n"
  },
  {
    "path": "infra/base-images/base-runner/gocoverage/go.sum",
    "content": "github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=\ngithub.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=\ngithub.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=\ngithub.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5 h1:zIaiqGYDQwa4HVx5wGRTXbx38Pqxjemn4BP98wpzpXo=\ngithub.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=\ngithub.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=\ngithub.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=\ngolang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\n"
  },
  {
    "path": "infra/base-images/base-runner/gocoverage/gocovmerge/LICENSE",
    "content": "Copyright (c) 2015, Wade Simmons\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "infra/base-images/base-runner/gocoverage/gocovmerge/gocovmerge.go",
    "content": "// gocovmerge takes the results from multiple `go test -coverprofile` runs and\n// merges them into one profile\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\n\t\"golang.org/x/tools/cover\"\n)\n\nfunc mergeProfiles(p *cover.Profile, merge *cover.Profile) {\n\tif p.Mode != merge.Mode {\n\t\tlog.Fatalf(\"cannot merge profiles with different modes\")\n\t}\n\t// Since the blocks are sorted, we can keep track of where the last block\n\t// was inserted and only look at the blocks after that as targets for merge\n\tstartIndex := 0\n\tfor _, b := range merge.Blocks {\n\t\tstartIndex = mergeProfileBlock(p, b, startIndex)\n\t}\n}\n\nfunc mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int) int {\n\tsortFunc := func(i int) bool {\n\t\tpi := p.Blocks[i+startIndex]\n\t\treturn pi.StartLine >= pb.StartLine && (pi.StartLine != pb.StartLine || pi.StartCol >= pb.StartCol)\n\t}\n\n\ti := 0\n\tif sortFunc(i) != true {\n\t\ti = sort.Search(len(p.Blocks)-startIndex, sortFunc)\n\t}\n\ti += startIndex\n\tif i < len(p.Blocks) && p.Blocks[i].StartLine == pb.StartLine && p.Blocks[i].StartCol == pb.StartCol {\n\t\tif p.Blocks[i].EndLine != pb.EndLine || p.Blocks[i].EndCol != pb.EndCol {\n\t\t\tlog.Fatalf(\"OVERLAP MERGE: %v %v %v\", p.FileName, p.Blocks[i], pb)\n\t\t}\n\t\tswitch p.Mode {\n\t\tcase \"set\":\n\t\t\tp.Blocks[i].Count |= pb.Count\n\t\tcase \"count\", \"atomic\":\n\t\t\tp.Blocks[i].Count += pb.Count\n\t\tdefault:\n\t\t\tlog.Fatalf(\"unsupported covermode: '%s'\", p.Mode)\n\t\t}\n\t} else {\n\t\tif i > 0 {\n\t\t\tpa := p.Blocks[i-1]\n\t\t\tif pa.EndLine >= pb.EndLine && (pa.EndLine != pb.EndLine || pa.EndCol > pb.EndCol) {\n\t\t\t\tlog.Fatalf(\"OVERLAP BEFORE: %v %v %v\", p.FileName, pa, pb)\n\t\t\t}\n\t\t}\n\t\tif i < len(p.Blocks)-1 {\n\t\t\tpa := p.Blocks[i+1]\n\t\t\tif pa.StartLine <= pb.StartLine && (pa.StartLine != pb.StartLine || pa.StartCol < pb.StartCol) {\n\t\t\t\tlog.Fatalf(\"OVERLAP AFTER: %v %v %v\", p.FileName, pa, pb)\n\t\t\t}\n\t\t}\n\t\tp.Blocks = append(p.Blocks, cover.ProfileBlock{})\n\t\tcopy(p.Blocks[i+1:], p.Blocks[i:])\n\t\tp.Blocks[i] = pb\n\t}\n\treturn i + 1\n}\n\nfunc addProfile(profiles []*cover.Profile, p *cover.Profile) []*cover.Profile {\n\ti := sort.Search(len(profiles), func(i int) bool { return profiles[i].FileName >= p.FileName })\n\tif i < len(profiles) && profiles[i].FileName == p.FileName {\n\t\tmergeProfiles(profiles[i], p)\n\t} else {\n\t\tprofiles = append(profiles, nil)\n\t\tcopy(profiles[i+1:], profiles[i:])\n\t\tprofiles[i] = p\n\t}\n\treturn profiles\n}\n\nfunc dumpProfiles(profiles []*cover.Profile, out io.Writer) {\n\tif len(profiles) == 0 {\n\t\treturn\n\t}\n\tfmt.Fprintf(out, \"mode: %s\\n\", profiles[0].Mode)\n\tfor _, p := range profiles {\n\t\tfor _, b := range p.Blocks {\n\t\t\tfmt.Fprintf(out, \"%s:%d.%d,%d.%d %d %d\\n\", p.FileName, b.StartLine, b.StartCol, b.EndLine, b.EndCol, b.NumStmt, b.Count)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tflag.Parse()\n\n\tvar merged []*cover.Profile\n\n\tfor _, file := range flag.Args() {\n\t\tprofiles, err := cover.ParseProfiles(file)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to parse profiles: %v\", err)\n\t\t}\n\t\tfor _, p := range profiles {\n\t\t\tmerged = addProfile(merged, p)\n\t\t}\n\t}\n\n\tdumpProfiles(merged, os.Stdout)\n}\n"
  },
  {
    "path": "infra/base-images/base-runner/gocoverage/gocovsum/gocovsum.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"go/ast\"\n\t\"go/parser\"\n\t\"go/token\"\n\n\t\"golang.org/x/tools/cover\"\n)\n\ntype CoverageTotal struct {\n\tCount     int     `json:\"count\"`\n\tCovered   int     `json:\"covered\"`\n\tUncovered int     `json:\"notcovered\"`\n\tPercent   float64 `json:\"percent\"`\n}\n\ntype CoverageTotals struct {\n\tFunctions      CoverageTotal `json:\"functions,omitempty\"`\n\tLines          CoverageTotal `json:\"lines,omitempty\"`\n\tRegions        CoverageTotal `json:\"regions,omitempty\"`\n\tInstantiations CoverageTotal `json:\"instantiations,omitempty\"`\n\tBranches       CoverageTotal `json:\"branches,omitempty\"`\n}\n\ntype CoverageFile struct {\n\tSummary  CoverageTotals `json:\"summary,omitempty\"`\n\tFilename string         `json:\"filename,omitempty\"`\n}\n\ntype CoverageData struct {\n\tTotals CoverageTotals `json:\"totals,omitempty\"`\n\tFiles  []CoverageFile `json:\"files,omitempty\"`\n}\n\ntype PositionInterval struct {\n\tstart token.Position\n\tend   token.Position\n}\n\ntype CoverageSummary struct {\n\tData    []CoverageData `json:\"data,omitempty\"`\n\tType    string         `json:\"type,omitempty\"`\n\tVersion string         `json:\"version,omitempty\"`\n}\n\nfunc isFunctionCovered(s token.Position, e token.Position, blocks []cover.ProfileBlock) bool {\n\tfor _, b := range blocks {\n\t\tif b.StartLine >= s.Line && b.StartLine <= e.Line && b.EndLine >= s.Line && b.EndLine <= e.Line {\n\t\t\tif b.Count > 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc computePercent(s *CoverageTotals) {\n\tif s.Regions.Count > 0 {\n\t\ts.Regions.Percent = float64(100*s.Regions.Covered) / float64(s.Regions.Count)\n\t}\n\tif s.Lines.Count > 0 {\n\t\ts.Lines.Percent = float64(100*s.Lines.Covered) / float64(s.Lines.Count)\n\t}\n\tif s.Functions.Count > 0 {\n\t\ts.Functions.Percent = float64(100*s.Functions.Covered) / float64(s.Functions.Count)\n\t}\n}\n\nfunc main() {\n\tflag.Parse()\n\n\tif len(flag.Args()) != 1 {\n\t\tlog.Fatalf(\"needs exactly one argument\")\n\t}\n\tprofiles, err := cover.ParseProfiles(flag.Args()[0])\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to parse profiles: %v\", err)\n\t}\n\tr := CoverageSummary{}\n\tr.Type = \"oss-fuzz.go.coverage.json.export\"\n\tr.Version = \"2.0.1\"\n\tr.Data = make([]CoverageData, 1)\n\tfor _, p := range profiles {\n\t\tfset := token.NewFileSet() // positions are relative to fset\n\t\tf, err := parser.ParseFile(fset, p.FileName, nil, 0)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"failed to parse go file: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tfileCov := CoverageFile{}\n\t\tfileCov.Filename = p.FileName\n\t\tast.Inspect(f, func(n ast.Node) bool {\n\t\t\tswitch x := n.(type) {\n\t\t\tcase *ast.FuncLit:\n\t\t\t\tstartf := fset.Position(x.Pos())\n\t\t\t\tendf := fset.Position(x.End())\n\t\t\t\tfileCov.Summary.Functions.Count++\n\t\t\t\tif isFunctionCovered(startf, endf, p.Blocks) {\n\t\t\t\t\tfileCov.Summary.Functions.Covered++\n\t\t\t\t} else {\n\t\t\t\t\tfileCov.Summary.Functions.Uncovered++\n\t\t\t\t}\n\t\t\tcase *ast.FuncDecl:\n\t\t\t\tstartf := fset.Position(x.Pos())\n\t\t\t\tendf := fset.Position(x.End())\n\t\t\t\tfileCov.Summary.Functions.Count++\n\t\t\t\tif isFunctionCovered(startf, endf, p.Blocks) {\n\t\t\t\t\tfileCov.Summary.Functions.Covered++\n\t\t\t\t} else {\n\t\t\t\t\tfileCov.Summary.Functions.Uncovered++\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\n\t\tfor _, b := range p.Blocks {\n\t\t\tfileCov.Summary.Regions.Count++\n\t\t\tif b.Count > 0 {\n\t\t\t\tfileCov.Summary.Regions.Covered++\n\t\t\t} else {\n\t\t\t\tfileCov.Summary.Regions.Uncovered++\n\t\t\t}\n\n\t\t\tfileCov.Summary.Lines.Count += b.NumStmt\n\t\t\tif b.Count > 0 {\n\t\t\t\tfileCov.Summary.Lines.Covered += b.NumStmt\n\t\t\t} else {\n\t\t\t\tfileCov.Summary.Lines.Uncovered += b.NumStmt\n\t\t\t}\n\t\t}\n\t\tr.Data[0].Totals.Regions.Count += fileCov.Summary.Regions.Count\n\t\tr.Data[0].Totals.Regions.Covered += fileCov.Summary.Regions.Covered\n\t\tr.Data[0].Totals.Regions.Uncovered += fileCov.Summary.Regions.Uncovered\n\t\tr.Data[0].Totals.Lines.Count += fileCov.Summary.Lines.Count\n\t\tr.Data[0].Totals.Lines.Covered += fileCov.Summary.Lines.Covered\n\t\tr.Data[0].Totals.Lines.Uncovered += fileCov.Summary.Lines.Uncovered\n\t\tr.Data[0].Totals.Functions.Count += fileCov.Summary.Functions.Count\n\t\tr.Data[0].Totals.Functions.Covered += fileCov.Summary.Functions.Covered\n\t\tr.Data[0].Totals.Functions.Uncovered += fileCov.Summary.Functions.Uncovered\n\n\t\tcomputePercent(&fileCov.Summary)\n\t\tr.Data[0].Files = append(r.Data[0].Files, fileCov)\n\t}\n\n\tcomputePercent(&r.Data[0].Totals)\n\to, err := json.Marshal(r)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to generate json: %v\", err)\n\t}\n\tfmt.Printf(string(o))\n}\n"
  },
  {
    "path": "infra/base-images/base-runner/gocoverage/pprof-merge/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "infra/base-images/base-runner/gocoverage/pprof-merge/main.go",
    "content": "// Copyright 2019 Google Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/pprof/profile\"\n)\n\nvar (\n\toutput string\n)\n\nfunc main() {\n\tflag.StringVar(&output, \"o\", \"merged.data\", \"\")\n\tflag.Parse()\n\n\tfiles := os.Args[1:]\n\tif len(files) == 0 {\n\t\tlog.Fatal(\"Give profiles files as arguments\")\n\t}\n\n\tvar profiles []*profile.Profile\n\tfor _, fname := range files {\n\t\tf, err := os.Open(fname)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Cannot open profile file at %q: %v\", fname, err)\n\t\t}\n\t\tp, err := profile.Parse(f)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Cannot parse profile at %q: %v\", fname, err)\n\t\t}\n\t\tprofiles = append(profiles, p)\n\t}\n\n\tmerged, err := profile.Merge(profiles)\n\tif err != nil {\n\t\tlog.Fatalf(\"Cannot merge profiles: %v\", err)\n\t}\n\n\tout, err := os.OpenFile(output, os.O_RDWR|os.O_CREATE, 0755)\n\tif err != nil {\n\t\tlog.Fatalf(\"Cannot open output to write: %v\", err)\n\t}\n\n\tif err := merged.Write(out); err != nil {\n\t\tlog.Fatalf(\"Cannot write merged profile to file: %v\", err)\n\t}\n\n\tif err := out.Close(); err != nil {\n\t\tlog.Printf(\"Error when closing the output file: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "infra/base-images/base-runner/install_deps.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies in a platform-aware way.\n\napt-get update && apt-get install -y \\\n    binutils \\\n    file \\\n    ca-certificates \\\n    fonts-dejavu \\\n    git \\\n    libcap2 \\\n    rsync \\\n    unzip \\\n    jq \\\n    wget \\\n    zip --no-install-recommends\n\ncase $(uname -m) in\n  x86_64)\n    # We only need to worry about i386 if we are on x86_64.\n    apt-get install -y lib32gcc1 libc6-i386\n    ;;\nesac\n"
  },
  {
    "path": "infra/base-images/base-runner/install_deps_ubuntu_20_04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies in a platform-aware way.\n\napt-get update && apt-get install -y \\\n    binutils \\\n    file \\\n    ca-certificates \\\n    fonts-dejavu \\\n    git \\\n    libcap2 \\\n    rsync \\\n    unzip \\\n    jq \\\n    wget \\\n    zip --no-install-recommends\n\ncase $(uname -m) in\n  x86_64)\n    # We only need to worry about i386 if we are on x86_64.\n    apt-get install -y lib32gcc1 libc6-i386\n    ;;\nesac"
  },
  {
    "path": "infra/base-images/base-runner/install_deps_ubuntu_24_04.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies in a platform-aware way.\n\napt-get update && apt-get install -y \\\n    binutils \\\n    file \\\n    ca-certificates \\\n    fonts-dejavu \\\n    git \\\n    libcap2 \\\n    rsync \\\n    unzip \\\n    jq \\\n    wget \\\n    libunwind-dev \\\n    libblocksruntime-dev \\\n    zip --no-install-recommends\n\n# libunwind-dev libblocksruntime-dev are needed for Honggfuzz\n\ncase $(uname -m) in\n  x86_64)\n    # We only need to worry about i386 if we are on x86_64.\n    if grep -q '24.04' /etc/os-release; then\n        apt-get install -y lib32gcc-s1 libc6-i386\n    else\n        apt-get install -y lib32gcc1 libc6-i386\n    fi\n    ;;\nesac\n"
  },
  {
    "path": "infra/base-images/base-runner/install_go.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install go on x86_64, don't do anything on ARM.\n\ncase $(uname -m) in\n    x86_64)\n      # Download and install Go.\n      export GOROOT=/root/.go\n      wget https://go.dev/dl/go1.25.0.linux-amd64.tar.gz\n      mkdir temp-go\n      tar -C temp-go/ -xzf go1.25.0.linux-amd64.tar.gz\n\n      mkdir $GOROOT\n      mv temp-go/go/* /root/.go/\n      rm -rf temp-go\n\n      echo 'Set \"GOPATH=/root/go\"'\n      echo 'Set \"PATH=$PATH:/root/.go/bin:$GOPATH/bin\"'\n      # Set up Golang coverage modules.\n      printf $(find . -name gocoverage)\n      cd $GOPATH/gocoverage && /root/.go/bin/go install ./...\n      cd /root/.go/src/cmd/cover && /root/.go/bin/go build && mv cover $GOPATH/bin/gotoolcover\n      pushd /tmp\n        git clone --depth=1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=v2\n        cd go-118-fuzz-build/cmd/convertLibFuzzerTestcaseToStdLibGo\n        /root/.go/bin/go build .\n        mv convertLibFuzzerTestcaseToStdLibGo $GOPATH/bin/\n      popd\n      ;;\n    aarch64)\n      # Don't install go because installer is not provided.\n      echo \"Not installing go: aarch64.\"\n      ;;\n    *)\n      echo \"Error: unsupported architecture: $(uname -m)\"\n      exit 1\n      ;;\nesac\n"
  },
  {
    "path": "infra/base-images/base-runner/install_java.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install java in a platform-aware way.\n\nARCHITECTURE=\ncase $(uname -m) in\n    x86_64)\n      ARCHITECTURE=x64\n        ;;\n    aarch64)\n      ARCHITECTURE=aarch64\n      ;;\n    *)\n      echo \"Error: unsupported architecture: $(uname -m)\"\n      exit 1\n      ;;\nesac\n\nwget -q https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.16+8/OpenJDK17U-jdk_\"$ARCHITECTURE\"_linux_hotspot_17.0.16_8.tar.gz -O /tmp/openjdk-17.0.16_linux-\"$ARCHITECTURE\"_bin.tar.gz\nwget -q https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-\"$ARCHITECTURE\"_bin.tar.gz -O /tmp/openjdk-15.0.2_linux-\"$ARCHITECTURE\"_bin.tar.gz\ncd /tmp\nmkdir -p $JAVA_HOME\ntar -xz --strip-components=1 -f openjdk-17.0.16_linux-\"$ARCHITECTURE\"_bin.tar.gz --directory $JAVA_HOME\nrm -f openjdk-17.0.16_linux-\"$ARCHITECTURE\"_bin.tar.gz\nrm -rf $JAVA_HOME/jmods $JAVA_HOME/lib/src.zip\n\n# Install OpenJDK 15 and trim its size by removing unused components. Some projects only run with Java 15.\nmkdir -p $JAVA_15_HOME\ntar -xz --strip-components=1 -f openjdk-15.0.2_linux-\"$ARCHITECTURE\"_bin.tar.gz --directory $JAVA_15_HOME\nrm -f openjdk-15.0.2_linux-\"$ARCHITECTURE\"_bin.tar.gz\nrm -rf $JAVA_15_HOME/jmods $JAVA_15_HOME/lib/src.zip\n"
  },
  {
    "path": "infra/base-images/base-runner/install_javascript.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# see installation instructions: https://github.com/nodesource/distributions#available-architectures\napt-get update\napt-get install -y ca-certificates curl gnupg\nmkdir -p /etc/apt/keyrings\ncurl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg\n\nNODE_MAJOR=20\necho \"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main\" | tee /etc/apt/sources.list.d/nodesource.list\n\napt-get update\napt-get install nodejs -y\n\n# Install latest versions of nyc for source-based coverage reporting\nnpm install --global nyc\n"
  },
  {
    "path": "infra/base-images/base-runner/jacoco_report_converter.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Helper script for creating an llvm-cov style JSON summary from a JaCoCo XML\nreport.\"\"\"\nimport json\nimport os\nimport sys\nimport xml.etree.ElementTree as ET\n\n\ndef convert(xml):\n  \"\"\"Turns a JaCoCo XML report into an llvm-cov JSON summary.\"\"\"\n  summary = {\n      'type': 'oss-fuzz.java.coverage.json.export',\n      'version': '1.0.0',\n      'data': [{\n          'totals': {},\n          'files': [],\n      }],\n  }\n\n  report = ET.fromstring(xml)\n  totals = make_element_summary(report)\n  summary['data'][0]['totals'] = totals\n\n  # Since Java compilation does not track source file location, we match\n  # coverage info to source files via the full class name, e.g. we search for\n  # a path in /out/src ending in foo/bar/Baz.java for the class foo.bar.Baz.\n  # Under the assumptions that a given project only ever contains a single\n  # version of a class and that no class name appears as a suffix of another\n  # class name, we can assign coverage info to every source file matched in that\n  # way.\n  src_files = list_src_files()\n\n  for class_element in report.findall('./package/class'):\n    # Skip fuzzer classes\n    if is_fuzzer_class(class_element):\n      continue\n\n    # Skip non class elements\n    if 'sourcefilename' not in class_element.attrib:\n      continue\n\n    class_name = class_element.attrib['name']\n    package_name = os.path.dirname(class_name)\n    basename = class_element.attrib['sourcefilename']\n    # This path is 'foo/Bar.java' for the class element\n    # <class name=\"foo/Bar\" sourcefilename=\"Bar.java\">.\n    canonical_path = os.path.join(package_name, basename)\n\n    class_summary = make_element_summary(class_element)\n    for src_file in relative_to_src_path(src_files, canonical_path):\n      summary['data'][0]['files'].append({\n          'filename': src_file,\n          'summary': class_summary,\n      })\n\n  return json.dumps(summary)\n\n\ndef list_src_files():\n  \"\"\"Returns a map from basename to full path for all files in $OUT/$SRC.\"\"\"\n  filename_to_paths = {}\n  out_path = os.environ['OUT'] + '/'\n  src_path = os.environ['SRC']\n  src_in_out = out_path + src_path\n  for dirpath, _, filenames in os.walk(src_in_out):\n    for filename in filenames:\n      full_path = dirpath + '/' + filename\n      # Map /out//src/... to /src/...\n      file_path = full_path[len(out_path):]\n      filename_to_paths.setdefault(filename, []).append(file_path)\n  return filename_to_paths\n\n\ndef is_fuzzer_class(class_element):\n  \"\"\"Check if the class is fuzzer class.\"\"\"\n  method_elements = class_element.find('./method[@name=\\\"fuzzerTestOneInput\\\"]')\n  if method_elements:\n    return True\n\n  return False\n\n\ndef relative_to_src_path(src_files, canonical_path):\n  \"\"\"Returns all paths in src_files ending in canonical_path.\"\"\"\n  basename = os.path.basename(canonical_path)\n  if basename not in src_files:\n    return []\n  candidate_paths = src_files[basename]\n  return [\n      path for path in candidate_paths if path.endswith(\"/\" + canonical_path)\n  ]\n\n\ndef make_element_summary(element):\n  \"\"\"Returns a coverage summary for an element in the XML report.\"\"\"\n  summary = {}\n\n  function_counter = element.find('./counter[@type=\\'METHOD\\']')\n  summary['functions'] = make_counter_summary(function_counter)\n\n  line_counter = element.find('./counter[@type=\\'LINE\\']')\n  summary['lines'] = make_counter_summary(line_counter)\n\n  # JaCoCo tracks branch coverage, which counts the covered control-flow edges\n  # between llvm-cov's regions instead of the covered regions themselves. For\n  # non-trivial code parts, the difference is usually negligible. However, if\n  # all methods of a class consist of a single region only (no branches),\n  # JaCoCo does not report any branch coverage even if there is instruction\n  # coverage. Since this would give incorrect results for CI Fuzz purposes, we\n  # increase the regions counter by 1 if there is any amount of instruction\n  # coverage.\n  instruction_counter = element.find('./counter[@type=\\'INSTRUCTION\\']')\n  has_some_coverage = instruction_counter is not None and int(\n      instruction_counter.attrib[\"covered\"]) > 0\n  branch_covered_adjustment = 1 if has_some_coverage else 0\n  region_counter = element.find('./counter[@type=\\'BRANCH\\']')\n  summary['regions'] = make_counter_summary(\n      region_counter, covered_adjustment=branch_covered_adjustment)\n\n  return summary\n\n\ndef make_counter_summary(counter_element, covered_adjustment=0):\n  \"\"\"Turns a JaCoCo <counter> element into an llvm-cov totals entry.\"\"\"\n  summary = {}\n  covered = covered_adjustment\n  missed = 0\n  if counter_element is not None:\n    covered += int(counter_element.attrib['covered'])\n    missed += int(counter_element.attrib['missed'])\n  summary['covered'] = covered\n  summary['notcovered'] = missed\n  summary['count'] = summary['covered'] + summary['notcovered']\n  if summary['count'] != 0:\n    summary['percent'] = (100.0 * summary['covered']) / summary['count']\n  else:\n    summary['percent'] = 0\n  return summary\n\n\ndef main():\n  \"\"\"Produces an llvm-cov style JSON summary from a JaCoCo XML report.\"\"\"\n  if len(sys.argv) != 3:\n    sys.stderr.write('Usage: %s <path_to_jacoco_xml> <out_path_json>\\n' %\n                     sys.argv[0])\n    return 1\n\n  with open(sys.argv[1], 'r') as xml_file:\n    xml_report = xml_file.read()\n  json_summary = convert(xml_report)\n  with open(sys.argv[2], 'w') as json_file:\n    json_file.write(json_summary)\n\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/base-images/base-runner/nyc_report_converter.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Helper script for creating a llvm-cov style JSON summary from a nyc\nJSON summary.\"\"\"\nimport json\nimport sys\n\n\ndef convert(nyc_json_summary):\n  \"\"\"Turns a nyc JSON report into a llvm-cov JSON summary.\"\"\"\n  summary = {\n      'type':\n          'oss-fuzz.javascript.coverage.json.export',\n      'version':\n          '1.0.0',\n      'data': [{\n          'totals':\n              file_summary(nyc_json_summary['total']),\n          'files': [{\n              'filename': src_file,\n              'summary': file_summary(nyc_json_summary[src_file])\n          } for src_file in nyc_json_summary if src_file != 'total'],\n      }],\n  }\n\n  return json.dumps(summary)\n\n\ndef file_summary(nyc_file_summary):\n  \"\"\"Returns a summary for a given file in the nyc JSON summary report.\"\"\"\n  return {\n      'functions': element_summary(nyc_file_summary['functions']),\n      'lines': element_summary(nyc_file_summary['lines']),\n      'regions': element_summary(nyc_file_summary['branches'])\n  }\n\n\ndef element_summary(element):\n  \"\"\"Returns a summary of a coverage element in the nyc JSON summary\n  of the file\"\"\"\n  return {\n      'count': element['total'],\n      'covered': element['covered'],\n      'notcovered': element['total'] - element['covered'] - element['skipped'],\n      'percent': element['pct'] if element['pct'] != 'Unknown' else 0\n  }\n\n\ndef main():\n  \"\"\"Produces a llvm-cov style JSON summary from a nyc JSON summary.\"\"\"\n  if len(sys.argv) != 3:\n    sys.stderr.write('Usage: %s <path_to_nyc_json_summary> <out_path_json>\\n' %\n                     sys.argv[0])\n    return 1\n\n  with open(sys.argv[1], 'r') as nyc_json_summary_file:\n    nyc_json_summary = json.load(nyc_json_summary_file)\n  json_summary = convert(nyc_json_summary)\n  with open(sys.argv[2], 'w') as json_output_file:\n    json_output_file.write(json_summary)\n\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/base-images/base-runner/parse_options.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Helper script for parsing custom fuzzing options.\"\"\"\nimport configparser\nimport sys\n\n\ndef parse_options(options_file_path, options_section):\n  \"\"\"Parses the given file and returns options from the given section.\"\"\"\n  parser = configparser.ConfigParser()\n  parser.read(options_file_path)\n\n  if not parser.has_section(options_section):\n    return None\n\n  options = parser[options_section]\n\n  if options_section == 'libfuzzer':\n    options_string = ' '.join(\n        '-%s=%s' % (key, value) for key, value in options.items())\n  else:\n    # Sanitizer options.\n    options_string = ':'.join(\n        '%s=%s' % (key, value) for key, value in options.items())\n\n  return options_string\n\n\ndef main():\n  \"\"\"Processes the arguments and prints the options in the correct format.\"\"\"\n  if len(sys.argv) < 3:\n    sys.stderr.write('Usage: %s <path_to_options_file> <options_section>\\n' %\n                     sys.argv[0])\n    return 1\n\n  options = parse_options(sys.argv[1], sys.argv[2])\n  if options is not None:\n    print(options)\n\n  return 0\n\n\nif __name__ == \"__main__\":\n  sys.exit(main())\n"
  },
  {
    "path": "infra/base-images/base-runner/profraw_update.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Helper script for upgrading a profraw file to latest version.\"\"\"\n\nfrom collections import namedtuple\nimport struct\nimport subprocess\nimport sys\n\nHeaderGeneric = namedtuple('HeaderGeneric', 'magic version')\nHeaderVersion9 = namedtuple(\n    'HeaderVersion9',\n    'BinaryIdsSize DataSize PaddingBytesBeforeCounters CountersSize \\\n    PaddingBytesAfterCounters NumBitmapBytes PaddingBytesAfterBitmapBytes NamesSize CountersDelta BitmapDelta NamesDelta ValueKindLast'\n)\n\nPROFRAW_MAGIC = 0xff6c70726f667281\n\n\ndef relativize_address(data, offset, databegin, sect_prf_cnts, sect_prf_data):\n  \"\"\"Turns an absolute offset into a relative one.\"\"\"\n  value = struct.unpack('Q', data[offset:offset + 8])[0]\n  if sect_prf_cnts <= value < sect_prf_data:\n    # If the value is an address in the right section, make it relative.\n    value = (value - databegin) & 0xffffffffffffffff\n    value = struct.pack('Q', value)\n    for i in range(8):\n      data[offset + i] = value[i]\n    # address was made relative\n    return True\n  # no changes done\n  return False\n\n\ndef upgrade(data, sect_prf_cnts, sect_prf_data):\n  \"\"\"Upgrades profraw data, knowing the sections addresses.\"\"\"\n  generic_header = HeaderGeneric._make(struct.unpack('QQ', data[:16]))\n  if generic_header.magic != PROFRAW_MAGIC:\n    raise Exception('Bad magic.')\n  base_version = generic_header.version\n\n  if base_version >= 9:\n    # Nothing to do.\n    return data\n  if base_version < 5 or base_version == 6:\n    raise Exception('Unhandled version.')\n\n  if generic_header.version == 5:\n    generic_header = generic_header._replace(version=7)\n    # Upgrade from version 5 to 7 by adding binaryids field.\n    data = data[:8] + struct.pack('Q', generic_header.version) + struct.pack(\n        'Q', 0) + data[16:]\n  if generic_header.version == 7:\n    # cf https://reviews.llvm.org/D111123\n    generic_header = generic_header._replace(version=8)\n    data = data[:8] + struct.pack('Q', generic_header.version) + data[16:]\n  if generic_header.version == 8:\n    # see https://reviews.llvm.org/D138846\n    generic_header = generic_header._replace(version=9)\n    # Upgrade from version 8 to 9 by adding NumBitmapBytes, PaddingBytesAfterBitmapBytes and BitmapDelta fields.\n    data = data[:8] + struct.pack(\n        'Q', generic_header.version) + data[16:56] + struct.pack(\n            'QQ', 0, 0) + data[56:72] + struct.pack('Q', 0) + data[72:]\n\n  v9_header = HeaderVersion9._make(struct.unpack('QQQQQQQQQQQQ', data[16:112]))\n\n  if base_version <= 8 and v9_header.BinaryIdsSize % 8 != 0:\n    # Adds padding for binary ids.\n    # cf commit b9f547e8e51182d32f1912f97a3e53f4899ea6be\n    # cf https://reviews.llvm.org/D110365\n    padlen = 8 - (v9_header.BinaryIdsSize % 8)\n    v7_header = v9_header._replace(BinaryIdsSize=v9_header.BinaryIdsSize +\n                                   padlen)\n    data = data[:16] + struct.pack('Q', v9_header.BinaryIdsSize) + data[24:]\n    data = data[:112 + v9_header.BinaryIdsSize] + bytes(\n        padlen) + data[112 + v9_header.BinaryIdsSize:]\n\n  if base_version <= 8:\n    offset = 112 + v9_header.BinaryIdsSize\n    for d in range(v9_header.DataSize):\n      # Add BitmapPtr and aligned u32(NumBitmapBytes)\n      data = data[:offset + 3 * 8] + struct.pack(\n          'Q', 0) + data[offset + 3 * 8:offset + 6 * 8] + struct.pack(\n              'Q', 0) + data[offset + 6 * 8:]\n      value = struct.unpack('Q',\n                            data[offset + 2 * 8:offset + 3 * 8])[0] - 16 * d\n      data = data[:offset + 2 * 8] + struct.pack('Q',\n                                                 value) + data[offset + 3 * 8:]\n      offset += 8 * 8\n\n  if base_version >= 8:\n    # Nothing more to do.\n    return data\n\n  # Last changes are relaed to bump from 7 to version 8 making CountersPtr relative.\n  dataref = sect_prf_data\n  # 80 is offset of CountersDelta.\n  if not relativize_address(data, 80, dataref, sect_prf_cnts, sect_prf_data):\n    return data\n\n  offset = 112 + v9_header.BinaryIdsSize\n  # This also works for C+Rust binaries compiled with\n  # clang-14/rust-nightly-clang-13.\n  for _ in range(v9_header.DataSize):\n    # 16 is the offset of CounterPtr in ProfrawData structure.\n    relativize_address(data, offset + 16, dataref, sect_prf_cnts, sect_prf_data)\n    # We need this because of CountersDelta -= sizeof(*SrcData);\n    # seen in __llvm_profile_merge_from_buffer.\n    dataref += 44 + 2 * (v9_header.ValueKindLast + 1)\n    if was8:\n      #profraw9 added RelativeBitmapPtr and NumBitmapBytes (8+4 rounded up to 16)\n      dataref -= 16\n    # This is the size of one ProfrawData structure.\n    offset += 44 + 2 * (v9_header.ValueKindLast + 1)\n\n  return data\n\n\ndef main():\n  \"\"\"Helper script for upgrading a profraw file to latest version.\"\"\"\n  if len(sys.argv) < 3:\n    sys.stderr.write('Usage: %s <binary> options? <profraw>...\\n' % sys.argv[0])\n    return 1\n\n  # First find llvm profile sections addresses in the elf, quick and dirty.\n  process = subprocess.Popen(['readelf', '-S', sys.argv[1]],\n                             stdout=subprocess.PIPE)\n  output, err = process.communicate()\n  if err:\n    print('readelf failed')\n    return 2\n  for line in iter(output.split(b'\\n')):\n    if b'__llvm_prf_cnts' in line:\n      sect_prf_cnts = int(line.split()[3], 16)\n    elif b'__llvm_prf_data' in line:\n      sect_prf_data = int(line.split()[3], 16)\n\n  out_name = \"default.profup\"\n  in_place = False\n  start = 2\n  if sys.argv[2] == \"-i\":\n    in_place = True\n    start = start + 1\n  elif sys.argv[2] == \"-o\":\n    out_name = sys.argv[3]\n    start = 4\n\n  if len(sys.argv) < start:\n    sys.stderr.write('Usage: %s <binary> options <profraw>...\\n' % sys.argv[0])\n    return 1\n\n  for i in range(start, len(sys.argv)):\n    # Then open and read the input profraw file.\n    with open(sys.argv[i], 'rb') as input_file:\n      profraw_base = bytearray(input_file.read())\n    # Do the upgrade, returning a bytes object.\n    profraw_latest = upgrade(profraw_base, sect_prf_cnts, sect_prf_data)\n    # Write the output to the file given to the command line.\n    if in_place:\n      out_name = sys.argv[i]\n    with open(out_name, 'wb') as output_file:\n      output_file.write(profraw_latest)\n\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/base-images/base-runner/python_coverage_runner_help.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"\nHelper to manage coverage.py related operations. Does two main\nthings: (1) pass commands into the coverage.py library and (2)\ntranslate .coverage created from a pyinstaller executable into\npaths that match local files. This is needed for html report creation.\n\"\"\"\nimport os\nimport re\nimport json\nimport sys\nfrom coverage.cmdline import main as coverage_main\nfrom coverage.data import CoverageData\n\n\ndef should_exclude_file(filepath):\n  \"\"\"Returns whether the path should be excluded from the coverage report.\"\"\"\n  # Skip all atheris code\n  if \"atheris\" in filepath:\n    return True\n\n  # Filter out all standard python libraries\n  if ('/usr/local/lib/python' in filepath and\n      'site-packages' not in filepath and 'dist-packages' not in filepath):\n    return True\n\n  # Avoid all PyInstaller modules.\n  if 'PyInstaller' in filepath:\n    return True\n\n  return False\n\n\ndef translate_lines(cov_data, new_cov_data, all_file_paths):\n  \"\"\"\n  Translate lines in a .coverage file created by coverage.py such that\n  the file paths points to local files instead. This is needed when collecting\n  coverage from executables created by pyinstaller.\n  \"\"\"\n  for pyinstaller_file_path in cov_data.measured_files():\n    stripped_py_file_path = pyinstaller_file_path\n    if stripped_py_file_path.startswith('/tmp/_MEI'):\n      stripped_py_file_path = '/'.join(stripped_py_file_path.split('/')[3:])\n    if stripped_py_file_path.startswith('/out/'):\n      stripped_py_file_path = stripped_py_file_path.replace('/out/', '')\n\n    # Check if this file exists in our file paths:\n    for local_file_path in all_file_paths:\n      if should_exclude_file(local_file_path):\n        continue\n      if local_file_path.endswith(stripped_py_file_path):\n        print('Found matching: %s' % (local_file_path))\n        new_cov_data.add_lines(\n            {local_file_path: cov_data.lines(pyinstaller_file_path)})\n\n\ndef translate_coverage(all_file_paths):\n  \"\"\"\n  Translate pyinstaller-generated file paths in .coverage (produced by\n  coverage.py) into local file paths. Place result in .new_coverage.\n  \"\"\"\n  covdata_pre_translation = CoverageData('.coverage')\n  covdata_post_translation = CoverageData('.new_coverage')\n\n  covdata_pre_translation.read()\n  translate_lines(covdata_pre_translation, covdata_post_translation,\n                  all_file_paths)\n  covdata_post_translation.write()\n\n\ndef convert_coveragepy_cov_to_summary_json(src, dst):\n  \"\"\"\n  Converts a json file produced by coveragepy into a summary.json file\n  similary to llvm-cov output. `src` is the source coveragepy json file,\n  `dst` is the destination json file, which will be overwritten.\n  \"\"\"\n  dst_dict = {'data': [{'files': {}}]}\n  lines_covered = 0\n  lines_count = 0\n  with open(src, \"r\") as src_f:\n    src_json = json.loads(src_f.read())\n    if 'files' in src_json:\n      for elem in src_json.get('files'):\n        if 'summary' not in src_json['files'][elem]:\n          continue\n        src_dict = src_json['files'][elem]['summary']\n        count = src_dict['covered_lines'] + src_dict['missing_lines']\n        covered = src_dict['covered_lines']\n        notcovered = src_dict['missing_lines']\n        percent = src_dict['percent_covered']\n\n        # Accumulate line coverage\n        lines_covered += covered\n        lines_count += count\n\n        dst_dict['data'][0]['files'][elem] = {\n            'summary': {\n                'lines': {\n                    'count': count,\n                    'covered': covered,\n                    'notcovered': notcovered,\n                    'percent': percent\n                }\n            }\n        }\n  if lines_count > 0:\n    lines_covered_percent = lines_covered / lines_count\n  else:\n    lines_covered_percent = 0.0\n  dst_dict['data'][0]['totals'] = {\n      'branches': {\n          'count': 0,\n          'covered': 0,\n          'notcovered': 0,\n          'percent': 0.0\n      },\n      'functions': {\n          'count': 0,\n          'covered': 0,\n          'percent': 0.0\n      },\n      'instantiations': {\n          'count': 0,\n          'covered': 0,\n          'percent': 0.0\n      },\n      'lines': {\n          'count': lines_count,\n          'covered': lines_covered,\n          'percent': lines_covered_percent\n      },\n      'regions': {\n          'count': 0,\n          'covered': 0,\n          'notcovered': 0,\n          'percent': 0.0\n      }\n  }\n\n  with open(dst, 'w') as dst_f:\n    dst_f.write(json.dumps(dst_dict))\n\n\ndef main():\n  \"\"\"\n  Main handler.\n  \"\"\"\n  if sys.argv[1] == 'translate':\n    print('Translating the coverage')\n    files_path = sys.argv[2]\n    all_file_paths = list()\n    for root, _, files in os.walk(files_path):\n      for relative_file_path in files:\n        abs_file_path = os.path.abspath(os.path.join(root, relative_file_path))\n        all_file_paths.append(abs_file_path)\n    print('Done with path walk')\n    translate_coverage(all_file_paths)\n  elif sys.argv[1] == 'convert-to-summary-json':\n    src = sys.argv[2]\n    dst = sys.argv[3]\n    convert_coveragepy_cov_to_summary_json(src, dst)\n  else:\n    # Pass commands into coverage package\n    sys.argv[0] = re.sub(r'(-script\\.pyw|\\.exe)?$', '', sys.argv[0])\n    sys.exit(coverage_main())\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/base-images/base-runner/rcfilt",
    "content": "#!/bin/bash -u\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# Symbol demangling for both C++ and Rust\n#\n################################################################################\n\n# simply pipe\nrustfilt | c++filt -n\n"
  },
  {
    "path": "infra/base-images/base-runner/reproduce",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFUZZER=$1\nshift\n\nif [ ! -v TESTCASE ]; then\n    TESTCASE=\"/testcase\"\nfi\n\nif [ ! -f $TESTCASE ]; then\n  echo \"Error: $TESTCASE not found, use: docker run -v <path>:$TESTCASE ...\"\n  exit 1\nfi\n\nexport RUN_FUZZER_MODE=\"interactive\"\nexport FUZZING_ENGINE=\"libfuzzer\"\nexport SKIP_SEED_CORPUS=\"1\"\n\nrun_fuzzer $FUZZER $@ $TESTCASE\n"
  },
  {
    "path": "infra/base-images/base-runner/run_fuzzer",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Fuzzer runner. Appends .options arguments and seed corpus to users args.\n# Usage: $0 <fuzzer_name> <fuzzer_args>\n\nsysctl -w vm.mmap_rnd_bits=28\n\nexport PATH=$OUT:$PATH\ncd $OUT\n\nDEBUGGER=${DEBUGGER:-}\n\nFUZZER=$1\nshift\n\n# This env var is set by CIFuzz. CIFuzz fills this directory with the corpus\n# from ClusterFuzz.\nCORPUS_DIR=${CORPUS_DIR:-}\nif [ -z \"$CORPUS_DIR\" ]\nthen\n  CORPUS_DIR=\"/tmp/${FUZZER}_corpus\"\n  rm -rf $CORPUS_DIR && mkdir -p $CORPUS_DIR\nfi\n\nSANITIZER=${SANITIZER:-}\nif [ -z $SANITIZER ]; then\n  # If $SANITIZER is not specified (e.g. calling from `reproduce` command), it\n  # is not important and can be set to any value.\n  SANITIZER=\"default\"\nfi\n\nif [[ \"$RUN_FUZZER_MODE\" = interactive ]]; then\n  FUZZER_OUT=\"$OUT/${FUZZER}_${FUZZING_ENGINE}_${SANITIZER}_out\"\nelse\n  FUZZER_OUT=\"/tmp/${FUZZER}_${FUZZING_ENGINE}_${SANITIZER}_out\"\nfi\n\nfunction get_dictionary() {\n  local options_file=\"$FUZZER.options\"\n  local dict_file=\"$FUZZER.dict\"\n  local dict=\"\"\n  if [[ -f \"$options_file\" ]]; then\n    dict=$(sed -n 's/^\\s*dict\\s*=\\s*\\(.*\\)/\\1/p' \"$options_file\" | tail -1)\n  fi\n  if [[ -z \"$dict\" && -f \"$dict_file\" ]]; then\n    dict=\"$dict_file\"\n  fi\n  [[ -z \"$dict\" ]] && return\n  if [[ \"$FUZZING_ENGINE\" = \"libfuzzer\" ]]; then\n     printf -- \"-dict=%s\" \"$dict\"\n  elif [[ \"$FUZZING_ENGINE\" = \"afl\" ]]; then\n     printf -- \"-x %s\" \"$dict\"\n  elif [[ \"$FUZZING_ENGINE\" = \"honggfuzz\" ]]; then\n     printf -- \"--dict %s\" \"$dict\"\n  elif [[ \"$FUZZING_ENGINE\" = \"centipede\" ]]; then\n     printf -- \"--dictionary %s\" \"$dict\"\n  else\n     printf \"Unexpected FUZZING_ENGINE: $FUZZING_ENGINE, ignoring\\n\" >&2\n  fi\n}\n\nfunction get_extra_binaries() {\n  [[ \"$FUZZING_ENGINE\" != \"centipede\" ]] && return\n\n  extra_binaries=\"$OUT/__centipede_${SANITIZER}/${FUZZER}\"\n  if compgen -G \"$extra_binaries\" >> /dev/null; then\n    printf -- \"--extra_binaries %s\" \\\"\"$extra_binaries\\\"\"\n  fi\n\n}\n\nrm -rf $FUZZER_OUT && mkdir -p $FUZZER_OUT\n\nSEED_CORPUS=\"${FUZZER}_seed_corpus.zip\"\n\n# TODO: Investigate why this code block is skipped\n# by all default fuzzers in bad_build_check.\n# They all set SKIP_SEED_CORPUS=1.\nif [ -f $SEED_CORPUS ] && [ -z ${SKIP_SEED_CORPUS:-} ]; then\n  echo \"Using seed corpus: $SEED_CORPUS\"\n  unzip -o -d ${CORPUS_DIR}/ $SEED_CORPUS > /dev/null\nfi\n\nOPTIONS_FILE=\"${FUZZER}.options\"\nCUSTOM_LIBFUZZER_OPTIONS=\"\"\n\nif [ -f $OPTIONS_FILE ]; then\n  custom_asan_options=$(parse_options.py $OPTIONS_FILE asan)\n  if [ ! -z $custom_asan_options ]; then\n    export ASAN_OPTIONS=\"$ASAN_OPTIONS:$custom_asan_options\"\n  fi\n\n  custom_msan_options=$(parse_options.py $OPTIONS_FILE msan)\n  if [ ! -z $custom_msan_options ]; then\n    export MSAN_OPTIONS=\"$MSAN_OPTIONS:$custom_msan_options\"\n  fi\n\n  custom_ubsan_options=$(parse_options.py $OPTIONS_FILE ubsan)\n  if [ ! -z $custom_ubsan_options ]; then\n    export UBSAN_OPTIONS=\"$UBSAN_OPTIONS:$custom_ubsan_options\"\n  fi\n\n  CUSTOM_LIBFUZZER_OPTIONS=$(parse_options.py $OPTIONS_FILE libfuzzer)\nfi\n\nif [[ \"$FUZZING_ENGINE\" = afl ]]; then\n\n  # Set afl++ environment options.\n  export ASAN_OPTIONS=\"$ASAN_OPTIONS:abort_on_error=1:symbolize=0:detect_odr_violation=0:\"\n  export MSAN_OPTIONS=\"$MSAN_OPTIONS:exit_code=86:symbolize=0\"\n  export UBSAN_OPTIONS=\"$UBSAN_OPTIONS:symbolize=0\"\n  export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1\n  export AFL_SKIP_CPUFREQ=1\n  export AFL_TRY_AFFINITY=1\n  export AFL_FAST_CAL=1\n  export AFL_CMPLOG_ONLY_NEW=1\n  export AFL_FORKSRV_INIT_TMOUT=30000\n  export AFL_IGNORE_PROBLEMS=1\n  export AFL_IGNORE_UNKNOWN_ENVS=1\n\n  # If $OUT/afl_cmplog.txt is present this means the target was compiled for\n  # CMPLOG. So we have to add the proper parameters to afl-fuzz.\n  test -e \"$OUT/afl_cmplog.txt\" && AFL_FUZZER_ARGS=\"$AFL_FUZZER_ARGS -c $OUT/$FUZZER\"\n\n  # If $OUT/afl++.dict we load it as a dictionary for afl-fuzz.\n  test -e \"$OUT/afl++.dict\" && AFL_FUZZER_ARGS=\"$AFL_FUZZER_ARGS -x $OUT/afl++.dict\"\n\n  # Ensure timeout is a bit larger than 1sec as some of the OSS-Fuzz fuzzers\n  # are slower than this.\n  AFL_FUZZER_ARGS=\"$AFL_FUZZER_ARGS -t 5000+\"\n\n  # AFL expects at least 1 file in the input dir.\n  echo input > ${CORPUS_DIR}/input\n\n  CMD_LINE=\"$OUT/afl-fuzz $AFL_FUZZER_ARGS -i $CORPUS_DIR -o $FUZZER_OUT $(get_dictionary) $* -- $OUT/$FUZZER\"\n\n  echo afl++ setup:\n  env|grep AFL_\n  cat \"$OUT/afl_options.txt\"\n\nelif [[ \"$FUZZING_ENGINE\" = honggfuzz ]]; then\n\n  # Honggfuzz expects at least 1 file in the input dir.\n  echo input > $CORPUS_DIR/input\n  # --exit_upon_crash: exit whith a first crash seen\n  # -V: verify crashes\n  # -R (report): save report file to this location\n  # -W (working dir): where the crashes go\n  # -v (verbose): don't use VTE UI, just stderr\n  # -z: use software-instrumentation of clang (trace-pc-guard....)\n  # -P: use persistent mode of fuzzing (i.e. LLVMFuzzerTestOneInput)\n  # -f: location of the initial (and destination) file corpus\n  # -n: number of fuzzing threads (and processes)\n  CMD_LINE=\"$OUT/honggfuzz -n 1 --exit_upon_crash -V -R /tmp/${FUZZER}_honggfuzz.report -W $FUZZER_OUT -v -z -P -f \\\"$CORPUS_DIR\\\" $(get_dictionary) $* -- \\\"$OUT/$FUZZER\\\"\"\n\n  if [[ $(LC_ALL=C grep -P \"\\x01_LIBHFUZZ_NETDRIVER_BINARY_SIGNATURE_\\x02\\xFF\" \"$FUZZER\" ) ]]; then\n    # Honggfuzz Netdriver port. This must match the port in Clusterfuzz.\n    export HFND_TCP_PORT=8666\n  fi\nelif [[ \"$FUZZING_ENGINE\" = centipede ]]; then\n\n  # Create the work and corpus directory for Centipede.\n  CENTIPEDE_WORKDIR=\"${CENTIPEDE_WORKDIR:-$OUT}\"\n\n  # Centipede only saves crashes to crashes/ in workdir.\n  rm -rf $FUZZER_OUT\n\n  # --workdir: Dir that stores corpus&features in Centipede's own format.\n  # --corpus_dir: Location of the initial (and destination) file corpus.\n  # --fork_server: Execute the target(s) via the fork server.\n  #   Run in fork mode to continue fuzzing indefinitely in case of\n  #   OOMs, timeouts, and crashes.\n  # --exit_on_crash=0: Do not exit on crash.\n  # --timeout=1200: The process that executes target binary will abort\n  #   if an input runs >= 1200s.\n  # --rss_limit_mb=0: Disable RSS limit.\n  # --address_space_limit_mb=0: No address space limit.\n  # --binary: The target binary under test without sanitizer.\n  # --extra_binary: The target binaries under test with sanitizers.\n  CMD_LINE=\"$OUT/centipede --workdir=$CENTIPEDE_WORKDIR --corpus_dir=\\\"$CORPUS_DIR\\\" --fork_server=1 --exit_on_crash=1 --timeout=1200 --rss_limit_mb=4096 --address_space_limit_mb=5120 $(get_dictionary) --binary=\\\"$OUT/${FUZZER}\\\" $(get_extra_binaries) $*\"\nelse\n\n  CMD_LINE=\"$OUT/$FUZZER -- $FUZZER_ARGS $*\"\n\n  if [ -z ${SKIP_SEED_CORPUS:-} ]; then\n    CMD_LINE=\"$CMD_LINE $CORPUS_DIR\"\n  fi\n\n  if [[ ! -z ${CUSTOM_LIBFUZZER_OPTIONS} ]]; then\n    CMD_LINE=\"$CMD_LINE $CUSTOM_LIBFUZZER_OPTIONS\"\n  fi\n\n  if [[ ! \"$CMD_LINE\" =~ \"-dict=\" ]]; then\n    if [ -f \"$FUZZER.dict\" ]; then\n      CMD_LINE=\"$CMD_LINE -dict=$FUZZER.dict\"\n    fi\n  fi\n\n  CMD_LINE=\"$CMD_LINE < /dev/null\"\n\nfi\n\necho $CMD_LINE\n\n# Unset OUT so the fuzz target can't rely on it.\nunset OUT\n\nif [ ! -z \"$DEBUGGER\" ]; then\n  CMD_LINE=\"$DEBUGGER $CMD_LINE\"\nfi\n\nbash -c \"$CMD_LINE\"\n\n"
  },
  {
    "path": "infra/base-images/base-runner/ruzzy",
    "content": "#!/usr/bin/env bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\" LD_PRELOAD=$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') \\\n\truby $@\n"
  },
  {
    "path": "infra/base-images/base-runner/targets_list",
    "content": "#!/bin/bash\n\nfor binary in $(find $OUT/ -executable -type f); do\n  [[ \"$binary\" != *.so ]] || continue\n  [[ $(basename \"$binary\") != jazzer_driver* ]] || continue\n  file \"$binary\" | grep -e ELF -e \"shell script\" > /dev/null 2>&1 || continue\n  grep \"LLVMFuzzerTestOneInput\" \"$binary\" > /dev/null 2>&1 || continue\n\n  basename \"$binary\"\ndone\n"
  },
  {
    "path": "infra/base-images/base-runner/test_all.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Does bad_build_check on all fuzz targets in $OUT.\"\"\"\n\nimport contextlib\nimport multiprocessing\nimport os\nimport re\nimport subprocess\nimport stat\nimport sys\nimport tempfile\n\nBASE_TMP_FUZZER_DIR = '/tmp/not-out'\n\nEXECUTABLE = stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH\n\nIGNORED_TARGETS = [\n    r'do_stuff_fuzzer', r'checksum_fuzzer', r'fuzz_dump', r'fuzz_keyring',\n    r'xmltest', r'fuzz_compression_sas_rle', r'ares_*_fuzzer'\n]\n\nIGNORED_TARGETS_RE = re.compile('^' + r'$|^'.join(IGNORED_TARGETS) + '$')\n\n\ndef move_directory_contents(src_directory, dst_directory):\n  \"\"\"Moves contents of |src_directory| to |dst_directory|.\"\"\"\n  # Use mv because mv preserves file permissions. If we don't preserve file\n  # permissions that can mess up CheckFuzzerBuildTest in cifuzz_test.py and\n  # other cases where one is calling test_all on files not in OSS-Fuzz's real\n  # out directory.\n  src_contents = [\n      os.path.join(src_directory, filename)\n      for filename in os.listdir(src_directory)\n  ]\n  command = ['mv'] + src_contents + [dst_directory]\n  subprocess.check_call(command)\n\n\ndef is_elf(filepath):\n  \"\"\"Returns True if |filepath| is an ELF file.\"\"\"\n  result = subprocess.run(['file', filepath],\n                          stdout=subprocess.PIPE,\n                          check=False)\n  return b'ELF' in result.stdout\n\n\ndef is_shell_script(filepath):\n  \"\"\"Returns True if |filepath| is a shell script.\"\"\"\n  result = subprocess.run(['file', filepath],\n                          stdout=subprocess.PIPE,\n                          check=False)\n  return b'shell script' in result.stdout\n\n\ndef find_fuzz_targets(directory):\n  \"\"\"Returns paths to fuzz targets in |directory|.\"\"\"\n  # TODO(https://github.com/google/oss-fuzz/issues/4585): Use libClusterFuzz for\n  # this.\n  fuzz_targets = []\n  for filename in os.listdir(directory):\n    path = os.path.join(directory, filename)\n    if filename == 'llvm-symbolizer':\n      continue\n    if filename.startswith('afl-'):\n      continue\n    if filename.startswith('jazzer_'):\n      continue\n    if not os.path.isfile(path):\n      continue\n    if not os.stat(path).st_mode & EXECUTABLE:\n      continue\n    # Fuzz targets can either be ELF binaries or shell scripts (e.g. wrapper\n    # scripts for Python and JVM targets or rules_fuzzing builds with runfiles\n    # trees).\n    if not is_elf(path) and not is_shell_script(path):\n      continue\n    if os.getenv('FUZZING_ENGINE') not in {'none', 'wycheproof'}:\n      with open(path, 'rb') as file_handle:\n        binary_contents = file_handle.read()\n        if b'LLVMFuzzerTestOneInput' not in binary_contents:\n          continue\n    fuzz_targets.append(path)\n  return fuzz_targets\n\n\ndef do_bad_build_check(fuzz_target):\n  \"\"\"Runs bad_build_check on |fuzz_target|. Returns a\n  Subprocess.ProcessResult.\"\"\"\n  print('INFO: performing bad build checks for', fuzz_target)\n  if centipede_needs_auxiliaries():\n    print('INFO: Finding Centipede\\'s auxiliary for target', fuzz_target)\n    auxiliary_path = find_centipede_auxiliary(fuzz_target)\n    print('INFO: Using auxiliary binary:', auxiliary_path)\n    auxiliary = [auxiliary_path]\n  else:\n    auxiliary = []\n\n  command = ['bad_build_check', fuzz_target] + auxiliary\n  with tempfile.TemporaryDirectory() as temp_centipede_workdir:\n    # Do this so that centipede doesn't fill up the disk during bad build check\n    env = os.environ.copy()\n    env['CENTIPEDE_WORKDIR'] = temp_centipede_workdir\n    return subprocess.run(command,\n                          stderr=subprocess.PIPE,\n                          stdout=subprocess.PIPE,\n                          env=env,\n                          check=False)\n\n\ndef get_broken_fuzz_targets(bad_build_results, fuzz_targets):\n  \"\"\"Returns a list of broken fuzz targets and their process results in\n  |fuzz_targets| where each item in |bad_build_results| is the result of\n  bad_build_check on the corresponding element in |fuzz_targets|.\"\"\"\n  broken = []\n  for result, fuzz_target in zip(bad_build_results, fuzz_targets):\n    if result.returncode != 0:\n      broken.append((fuzz_target, result))\n  return broken\n\n\ndef has_ignored_targets(out_dir):\n  \"\"\"Returns True if |out_dir| has any fuzz targets we are supposed to ignore\n  bad build checks of.\"\"\"\n  out_files = set(os.listdir(out_dir))\n  for filename in out_files:\n    if re.match(IGNORED_TARGETS_RE, filename):\n      return True\n  return False\n\n\n@contextlib.contextmanager\ndef use_different_out_dir():\n  \"\"\"Context manager that moves OUT to subdirectory of BASE_TMP_FUZZER_DIR. This\n  is useful for catching hardcoding. Note that this sets the environment\n  variable OUT and therefore must be run before multiprocessing.Pool is created.\n  Resets OUT at the end.\"\"\"\n  # Use a fake OUT directory to catch path hardcoding that breaks on\n  # ClusterFuzz.\n  initial_out = os.getenv('OUT')\n  os.makedirs(BASE_TMP_FUZZER_DIR, exist_ok=True)\n  # Use a random subdirectory of BASE_TMP_FUZZER_DIR to allow running multiple\n  # instances of test_all in parallel (useful for integration testing).\n  with tempfile.TemporaryDirectory(dir=BASE_TMP_FUZZER_DIR) as out:\n    # Set this so that run_fuzzer which is called by bad_build_check works\n    # properly.\n    os.environ['OUT'] = out\n    # We move the contents of the directory because we can't move the\n    # directory itself because it is a mount.\n    move_directory_contents(initial_out, out)\n    try:\n      yield out\n    finally:\n      move_directory_contents(out, initial_out)\n      os.environ['OUT'] = initial_out\n\n\ndef test_all_outside_out(allowed_broken_targets_percentage):\n  \"\"\"Wrapper around test_all that changes OUT and returns the result.\"\"\"\n  with use_different_out_dir() as out:\n    return test_all(out, allowed_broken_targets_percentage)\n\n\ndef centipede_needs_auxiliaries():\n  \"\"\"Checks if auxiliaries are needed for Centipede.\"\"\"\n  # Centipede always requires unsanitized binaries as the main fuzz targets,\n  # and separate sanitized binaries as auxiliaries.\n  # 1. Building sanitized binaries with helper.py (i.e., local or GitHub CI):\n  # Unsanitized ones will be built automatically into the same docker container.\n  # Script bad_build_check tests both\n  # a) If main fuzz targets can run with the auxiliaries, and\n  # b) If the auxiliaries are built with the correct sanitizers.\n  # 2. In Trial build and production build:\n  # Two kinds of binaries will be in separated buckets / docker containers.\n  # Script bad_build_check tests either\n  # a) If the unsanitized binaries can run without the sanitized ones, or\n  # b) If the sanitized binaries are built with the correct sanitizers.\n  return (os.getenv('FUZZING_ENGINE') == 'centipede' and\n          os.getenv('SANITIZER') != 'none' and os.getenv('HELPER') == 'True')\n\n\ndef find_centipede_auxiliary(main_fuzz_target_path):\n  \"\"\"Finds the sanitized binary path that corresponds to |main_fuzz_target| for\n  bad_build_check.\"\"\"\n  target_dir, target_name = os.path.split(main_fuzz_target_path)\n  sanitized_binary_dir = os.path.join(target_dir,\n                                      f'__centipede_{os.getenv(\"SANITIZER\")}')\n  sanitized_binary_path = os.path.join(sanitized_binary_dir, target_name)\n\n  if os.path.isfile(sanitized_binary_path):\n    return sanitized_binary_path\n\n  # Neither of the following two should ever happen, returns None to indicate\n  # an error.\n  if os.path.isdir(sanitized_binary_dir):\n    print('ERROR: Unable to identify Centipede\\'s sanitized target'\n          f'{sanitized_binary_path} in {os.listdir(sanitized_binary_dir)}')\n  else:\n    print('ERROR: Unable to identify Centipede\\'s sanitized target directory'\n          f'{sanitized_binary_dir} in {os.listdir(target_dir)}')\n  return None\n\n\ndef test_all(out, allowed_broken_targets_percentage):  # pylint: disable=too-many-return-statements\n  \"\"\"Do bad_build_check on all fuzz targets.\"\"\"\n  # TODO(metzman): Refactor so that we can convert test_one to python.\n  fuzz_targets = find_fuzz_targets(out)\n  if not fuzz_targets:\n    print('ERROR: No fuzz targets found.')\n    return False\n\n  if centipede_needs_auxiliaries():\n    for fuzz_target in fuzz_targets:\n      if not find_centipede_auxiliary(fuzz_target):\n        print(f'ERROR: Couldn\\'t find auxiliary for {fuzz_target}.')\n        return False\n\n  pool = multiprocessing.Pool()\n  bad_build_results = pool.map(do_bad_build_check, fuzz_targets)\n  pool.close()\n  pool.join()\n  broken_targets = get_broken_fuzz_targets(bad_build_results, fuzz_targets)\n  broken_targets_count = len(broken_targets)\n  if not broken_targets_count:\n    return True\n\n  print('Retrying failed fuzz targets sequentially', broken_targets_count)\n  pool = multiprocessing.Pool(1)\n  retry_targets = []\n  for broken_target, result in broken_targets:\n    retry_targets.append(broken_target)\n  bad_build_results = pool.map(do_bad_build_check, retry_targets)\n  pool.close()\n  pool.join()\n  broken_targets = get_broken_fuzz_targets(bad_build_results, broken_targets)\n  broken_targets_count = len(broken_targets)\n  if not broken_targets_count:\n    return True\n\n  print('Broken fuzz targets', broken_targets_count)\n  total_targets_count = len(fuzz_targets)\n  broken_targets_percentage = 100 * broken_targets_count / total_targets_count\n  for broken_target, result in broken_targets:\n    print(broken_target)\n    # Use write because we can't print binary strings.\n    sys.stdout.buffer.write(result.stdout + result.stderr + b'\\n')\n\n  if broken_targets_percentage > allowed_broken_targets_percentage:\n    print('ERROR: {broken_targets_percentage}% of fuzz targets seem to be '\n          'broken. See the list above for a detailed information.'.format(\n              broken_targets_percentage=broken_targets_percentage))\n    if has_ignored_targets(out):\n      print('Build check automatically passing because of ignored targets.')\n      return True\n    return False\n  print('{total_targets_count} fuzzers total, {broken_targets_count} '\n        'seem to be broken ({broken_targets_percentage}%).'.format(\n            total_targets_count=total_targets_count,\n            broken_targets_count=broken_targets_count,\n            broken_targets_percentage=broken_targets_percentage))\n  return True\n\n\ndef get_allowed_broken_targets_percentage():\n  \"\"\"Returns the value of the environment value\n  'ALLOWED_BROKEN_TARGETS_PERCENTAGE' as an int or returns a reasonable\n  default.\"\"\"\n  return int(os.getenv('ALLOWED_BROKEN_TARGETS_PERCENTAGE') or '10')\n\n\ndef main():\n  \"\"\"Does bad_build_check on all fuzz targets in parallel. Returns 0 on success.\n  Returns 1 on failure.\"\"\"\n  allowed_broken_targets_percentage = get_allowed_broken_targets_percentage()\n  if not test_all_outside_out(allowed_broken_targets_percentage):\n    return 1\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/base-images/base-runner/test_all_test.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests test_all.py\"\"\"\nimport unittest\nfrom unittest import mock\n\nimport test_all\n\n\nclass TestTestAll(unittest.TestCase):\n  \"\"\"Tests for the test_all_function.\"\"\"\n\n  @mock.patch('test_all.find_fuzz_targets', return_value=[])\n  @mock.patch('builtins.print')\n  def test_test_all_no_fuzz_targets(self, mock_print, _):\n    \"\"\"Tests that test_all returns False when there are no fuzz targets.\"\"\"\n    outdir = '/out'\n    allowed_broken_targets_percentage = 0\n    self.assertFalse(\n        test_all.test_all(outdir, allowed_broken_targets_percentage))\n    mock_print.assert_called_with('ERROR: No fuzz targets found.')\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/base-images/base-runner/test_one.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Does bad_build_check on a fuzz target in $OUT.\"\"\"\nimport os\nimport sys\n\nimport test_all\n\n\ndef test_one(fuzz_target):\n  \"\"\"Does bad_build_check on one fuzz target. Returns True on success.\"\"\"\n  with test_all.use_different_out_dir():\n    fuzz_target_path = os.path.join(os.environ['OUT'], fuzz_target)\n    result = test_all.do_bad_build_check(fuzz_target_path)\n    if result.returncode != 0:\n      sys.stdout.buffer.write(result.stdout + result.stderr + b'\\n')\n      return False\n    return True\n\n\ndef main():\n  \"\"\"Does bad_build_check on one fuzz target. Returns 1 on failure, 0 on\n  success.\"\"\"\n  if len(sys.argv) != 2:\n    print('Usage: %d <fuzz_target>', sys.argv[0])\n    return 1\n\n  fuzz_target_binary = sys.argv[1]\n  return 0 if test_one(fuzz_target_binary) else 1\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/base-images/base-runner/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build rust stuff in its own image. We only need the resulting binaries.\n# Keeping the rust toolchain in the image wastes 1 GB.\nFROM gcr.io/oss-fuzz-base/base-image:ubuntu-20-04 as temp-runner-binary-builder\n\nRUN apt-get update && apt-get install -y cargo libyaml-dev\nRUN cargo install rustfilt\n\n# Using multi-stage build to copy some LLVM binaries needed in the runner image.\nFROM gcr.io/oss-fuzz-base/base-clang:ubuntu-20-04 AS base-clang\nFROM gcr.io/oss-fuzz-base/base-builder-ruby:ubuntu-20-04 AS base-ruby\n\n# The base builder image compiles a specific Python version. Using a multi-stage build\n# to copy that same Python interpreter into the runner image saves build time and keeps\n# the Python versions in sync.\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-20-04 AS base-builder\n\n# Real image that will be used later.\nFROM gcr.io/oss-fuzz-base/base-image:ubuntu-20-04\n\nCOPY --from=temp-runner-binary-builder /root/.cargo/bin/rustfilt /usr/local/bin\n\n# Copy the binaries needed for code coverage and crash symbolization.\nCOPY --from=base-clang /usr/local/bin/llvm-cov \\\n     /usr/local/bin/llvm-profdata \\\n     /usr/local/bin/llvm-symbolizer \\\n     /usr/local/bin/\n\n# Copy the pre-compiled Python binaries and libraries\nCOPY --from=base-builder /usr/local/bin/python3.11 /usr/local/bin/python3.11\nCOPY --from=base-builder /usr/local/lib/libpython3.11.so.1.0 /usr/local/lib/libpython3.11.so.1.0\nCOPY --from=base-builder /usr/local/include/python3.11 /usr/local/include/python3.11\nCOPY --from=base-builder /usr/local/lib/python3.11 /usr/local/lib/python3.11\nCOPY --from=base-builder /usr/local/bin/pip3 /usr/local/bin/pip3\n\n# Create symbolic links to ensure compatibility\nRUN ldconfig && \\\n    ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 && \\\n    ln -s /usr/local/bin/python3.11 /usr/local/bin/python\n\nCOPY install_deps_ubuntu_20_04.sh /\nRUN /install_deps_ubuntu_20_04.sh && rm /install_deps_ubuntu_20_04.sh\n\nENV CODE_COVERAGE_SRC=/opt/code_coverage\n# Pin coverage to the same as in the base builder:\n# https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/install_python.sh#L22\nRUN git clone https://chromium.googlesource.com/chromium/src/tools/code_coverage $CODE_COVERAGE_SRC && \\\n    cd /opt/code_coverage && \\\n    git checkout edba4873b5e8a390e977a64c522db2df18a8b27d && \\\n    pip3 install wheel && \\\n    # If version \"Jinja2==2.10\" is in requirements.txt, bump it to a patch version that\n    # supports upgrading its MarkupSafe dependency to a Python 3.11 compatible release:\n    sed -i 's/Jinja2==2.10/Jinja2==2.10.3/' requirements.txt && \\\n    pip3 install -r requirements.txt && \\\n    pip3 install MarkupSafe==2.0.1 && \\\n    pip3 install coverage==6.3.2\n\n# Default environment options for various sanitizers.\n# Note that these match the settings used in ClusterFuzz and\n# shouldn't be changed unless a corresponding change is made on\n# ClusterFuzz side as well.\nENV ASAN_OPTIONS=\"alloc_dealloc_mismatch=0:allocator_may_return_null=1:allocator_release_to_os_interval_ms=500:check_malloc_usable_size=0:detect_container_overflow=1:detect_odr_violation=0:detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_fatal=0:handle_abort=1:handle_segv=1:handle_sigill=1:max_uar_stack_size_log=16:print_scariness=1:quarantine_size_mb=10:strict_memcmp=1:strip_path_prefix=/workspace/:symbolize=1:use_sigaltstack=1:dedup_token_length=3\"\nENV MSAN_OPTIONS=\"print_stats=1:strip_path_prefix=/workspace/:symbolize=1:dedup_token_length=3\"\nENV UBSAN_OPTIONS=\"print_stacktrace=1:print_summary=1:silence_unsigned_overflow=1:strip_path_prefix=/workspace/:symbolize=1:dedup_token_length=3\"\nENV FUZZER_ARGS=\"-rss_limit_mb=2560 -timeout=25\"\nENV AFL_FUZZER_ARGS=\"-m none\"\n\n# Set up Golang environment variables (copied from /root/.bash_profile).\nENV GOPATH /root/go\n\n# /root/.go/bin is for the standard Go binaries (i.e. go, gofmt, etc).\n# $GOPATH/bin is for the binaries from the dependencies installed via \"go get\".\nENV PATH $PATH:$GOPATH/bin\nCOPY gocoverage $GOPATH/gocoverage\n\nCOPY install_go.sh /\nRUN /install_go.sh && rm -rf /install_go.sh /root/.go\n\n# Install OpenJDK 15 and trim its size by removing unused components.\nENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64\nENV JAVA_15_HOME=/usr/lib/jvm/java-15-openjdk-amd64\nENV JVM_LD_LIBRARY_PATH=$JAVA_HOME/lib/server\nENV PATH=$PATH:$JAVA_HOME/bin\n\nCOPY install_java.sh /\nRUN /install_java.sh && rm /install_java.sh\n\n# Install JaCoCo for JVM coverage.\nRUN wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.7/org.jacoco.cli-0.8.7-nodeps.jar -O /opt/jacoco-cli.jar && \\\n    wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.7/org.jacoco.agent-0.8.7-runtime.jar -O /opt/jacoco-agent.jar && \\\n    echo \"37df187b76888101ecd745282e9cd1ad4ea508d6  /opt/jacoco-agent.jar\" | shasum --check && \\\n    echo \"c1814e7bba5fd8786224b09b43c84fd6156db690  /opt/jacoco-cli.jar\" | shasum --check\n\nCOPY install_javascript.sh /\nRUN /install_javascript.sh && rm /install_javascript.sh\n\n# Copy built ruby. It is up to the fuzzing harnesses\n# themselves to set GEM_HOME and GEM_PATH appropriately, as this depends\n# on how the harnesses are packaged.\nCOPY --from=base-ruby /usr/local/bin/ruby /usr/local/bin/ruby\nCOPY --from=base-ruby /usr/local/bin/gem /usr/local/bin/gem\nCOPY --from=base-ruby /usr/local/lib/ruby /usr/local/lib/ruby\nCOPY --from=base-ruby /usr/local/include/ruby-3.3.0 /usr/local/include/ruby-3.3.0\n\nRUN apt-get update && apt-get install -y luarocks\n\n# Do this last to make developing these files easier/faster due to caching.\nCOPY bad_build_check \\\n    coverage \\\n    coverage_helper \\\n    download_corpus \\\n    jacoco_report_converter.py \\\n    nyc_report_converter.py \\\n    rcfilt \\\n    reproduce \\\n    run_fuzzer \\\n    parse_options.py \\\n    generate_differential_cov_report.py \\\n    profraw_update.py \\\n    targets_list \\\n    test_all.py \\\n    test_one.py \\\n    python_coverage_runner_help.py \\\n    /usr/local/bin/"
  },
  {
    "path": "infra/base-images/base-runner/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build rust stuff in its own image. We only need the resulting binaries.\n# Keeping the rust toolchain in the image wastes 1 GB.\nFROM gcr.io/oss-fuzz-base/base-image:ubuntu-24-04 as temp-runner-binary-builder\n\nRUN apt-get update && apt-get install -y cargo libyaml-dev\nRUN cargo install rustfilt\n\n# Using multi-stage build to copy some LLVM binaries needed in the runner image.\nFROM gcr.io/oss-fuzz-base/base-clang:ubuntu-24-04 AS base-clang\nFROM gcr.io/oss-fuzz-base/base-builder-ruby:ubuntu-24-04 AS base-ruby\n\n# The base builder image compiles a specific Python version. Using a multi-stage build\n# to copy that same Python interpreter into the runner image saves build time and keeps\n# the Python versions in sync.\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04 AS base-builder\n\n# Real image that will be used later.\nFROM gcr.io/oss-fuzz-base/base-image:ubuntu-24-04\n\nCOPY --from=temp-runner-binary-builder /root/.cargo/bin/rustfilt /usr/local/bin\n\n# Copy the binaries needed for code coverage and crash symbolization.\nCOPY --from=base-clang /usr/local/bin/llvm-cov \\\n     /usr/local/bin/llvm-profdata \\\n     /usr/local/bin/llvm-symbolizer \\\n     /usr/local/bin/\n\n# Copy the pre-compiled Python binaries and libraries\nCOPY --from=base-builder /usr/local/bin/python3.11 /usr/local/bin/python3.11\nCOPY --from=base-builder /usr/local/lib/libpython3.11.so.1.0 /usr/local/lib/libpython3.11.so.1.0\nCOPY --from=base-builder /usr/local/include/python3.11 /usr/local/include/python3.11\nCOPY --from=base-builder /usr/local/lib/python3.11 /usr/local/lib/python3.11\nCOPY --from=base-builder /usr/local/bin/pip3 /usr/local/bin/pip3\n\n# Create symbolic links to ensure compatibility\nRUN ldconfig && \\\n    ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 && \\\n    ln -s /usr/local/bin/python3.11 /usr/local/bin/python\n\nCOPY install_deps_ubuntu_24_04.sh /\nRUN /install_deps_ubuntu_24_04.sh && rm /install_deps_ubuntu_24_04.sh\n\nENV CODE_COVERAGE_SRC=/opt/code_coverage\n# Pin coverage to the same as in the base builder:\n# https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/install_python.sh#L22\nRUN git clone https://chromium.googlesource.com/chromium/src/tools/code_coverage $CODE_COVERAGE_SRC && \\\n    cd /opt/code_coverage && \\\n    git checkout edba4873b5e8a390e977a64c522db2df18a8b27d && \\\n    pip3 install wheel && \\\n    # If version \"Jinja2==2.10\" is in requirements.txt, bump it to a patch version that\n    # supports upgrading its MarkupSafe dependency to a Python 3.11 compatible release:\n    sed -i 's/Jinja2==2.10/Jinja2==2.10.3/' requirements.txt && \\\n    pip3 install -r requirements.txt && \\\n    pip3 install MarkupSafe==2.0.1 && \\\n    pip3 install coverage==6.3.2\n\n# Default environment options for various sanitizers.\n# Note that these match the settings used in ClusterFuzz and\n# shouldn't be changed unless a corresponding change is made on\n# ClusterFuzz side as well.\nENV ASAN_OPTIONS=\"alloc_dealloc_mismatch=0:allocator_may_return_null=1:allocator_release_to_os_interval_ms=500:check_malloc_usable_size=0:detect_container_overflow=1:detect_odr_violation=0:detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_fatal=0:handle_abort=1:handle_segv=1:handle_sigill=1:max_uar_stack_size_log=16:print_scariness=1:quarantine_size_mb=10:strict_memcmp=1:strip_path_prefix=/workspace/:symbolize=1:use_sigaltstack=1:dedup_token_length=3\"\nENV MSAN_OPTIONS=\"print_stats=1:strip_path_prefix=/workspace/:symbolize=1:dedup_token_length=3\"\nENV UBSAN_OPTIONS=\"print_stacktrace=1:print_summary=1:silence_unsigned_overflow=1:strip_path_prefix=/workspace/:symbolize=1:dedup_token_length=3\"\nENV FUZZER_ARGS=\"-rss_limit_mb=2560 -timeout=25\"\nENV AFL_FUZZER_ARGS=\"-m none\"\n\n# Set up Golang environment variables (copied from /root/.bash_profile).\nENV GOPATH /root/go\n\n# /root/.go/bin is for the standard Go binaries (i.e. go, gofmt, etc).\n# $GOPATH/bin is for the binaries from the dependencies installed via \"go get\".\nENV PATH $PATH:$GOPATH/bin\nCOPY gocoverage $GOPATH/gocoverage\n\nCOPY install_go.sh /\nRUN /install_go.sh && rm -rf /install_go.sh /root/.go\n\n# Install OpenJDK 15 and trim its size by removing unused components.\nENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64\nENV JAVA_15_HOME=/usr/lib/jvm/java-15-openjdk-amd64\nENV JVM_LD_LIBRARY_PATH=$JAVA_HOME/lib/server\nENV PATH=$PATH:$JAVA_HOME/bin\n\nCOPY install_java.sh /\nRUN /install_java.sh && rm /install_java.sh\n\n# Install JaCoCo for JVM coverage.\nRUN wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.7/org.jacoco.cli-0.8.7-nodeps.jar -O /opt/jacoco-cli.jar && \\\n    wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.7/org.jacoco.agent-0.8.7-runtime.jar -O /opt/jacoco-agent.jar && \\\n    echo \"37df187b76888101ecd745282e9cd1ad4ea508d6  /opt/jacoco-agent.jar\" | shasum --check && \\\n    echo \"c1814e7bba5fd8786224b09b43c84fd6156db690  /opt/jacoco-cli.jar\" | shasum --check\n\nCOPY install_javascript.sh /\nRUN /install_javascript.sh && rm /install_javascript.sh\n\n# Copy built ruby. It is up to the fuzzing harnesses\n# themselves to set GEM_HOME and GEM_PATH appropriately, as this depends\n# on how the harnesses are packaged.\nCOPY --from=base-ruby /usr/local/bin/ruby /usr/local/bin/ruby\nCOPY --from=base-ruby /usr/local/bin/gem /usr/local/bin/gem\nCOPY --from=base-ruby /usr/local/lib/ruby /usr/local/lib/ruby\nCOPY --from=base-ruby /usr/local/include/ruby-3.3.0 /usr/local/include/ruby-3.3.0\n\nRUN apt-get update && apt-get install -y luarocks\n\n# Do this last to make developing these files easier/faster due to caching.\nCOPY bad_build_check \\\n    coverage \\\n    coverage_helper \\\n    download_corpus \\\n    jacoco_report_converter.py \\\n    nyc_report_converter.py \\\n    rcfilt \\\n    reproduce \\\n    run_fuzzer \\\n    parse_options.py \\\n    generate_differential_cov_report.py \\\n    profraw_update.py \\\n\n    targets_list \\\n    test_all.py \\\n    test_one.py \\\n    python_coverage_runner_help.py \\\n    /usr/local/bin/"
  },
  {
    "path": "infra/base-images/base-runner-debug/CHANGELOG.md",
    "content": "# Docker Image Version Changelog: oss-fuzz/base-runner-debug\n\n## Analysis Summary\n\nThe `ubuntu-20-04` and `ubuntu-24-04` images for `oss-fuzz/base-runner-debug` were successfully built. These images are used for debugging fuzzers and contain tools like GDB and Valgrind. The Dockerfile structure was refactored to support multi-version builds by creating separate Dockerfiles for each Ubuntu version and updating the `FROM` instruction accordingly.\n\n## Build Status\n\n| Image Tag | Dockerfile | Status |\n| --- | --- | --- |\n| `oss-fuzz/base-runner-debug:ubuntu-20-04` | `ubuntu-20-04.Dockerfile` | Success |\n| `oss-fuzz/base-runner-debug:ubuntu-24-04` | `ubuntu-24-04.Dockerfile` | Success |\n\n## Package Comparison\n\n### Key Differences (Ubuntu 20.04 vs. Ubuntu 24.04)\n\nThe `ubuntu-24-04` image includes newer versions of GDB, Valgrind, and other debugging tools.\n\n## Dockerfile Analysis\n\nThe Dockerfiles for both versions have the following key differences:\n\n*   **Base Image:** The `FROM` instruction in each Dockerfile points to the corresponding `oss-fuzz/base-runner` tag (`ubuntu-20-04` or `ubuntu-24-04`).\n*   **GDB Installation:** Both versions download and build GDB from source.\n*   **Refactoring:** The original `Dockerfile` was split into `ubuntu-20-04.Dockerfile` and `ubuntu-24-04.Dockerfile` to support the multi-version build strategy.\n"
  },
  {
    "path": "infra/base-images/base-runner-debug/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-runner\nRUN apt-get update && apt-get install -y valgrind zip\n\n# Installing GDB 12, re https://github.com/google/oss-fuzz/issues/7513.\nRUN apt-get install -y build-essential libgmp-dev && \\\n    wget https://ftp.gnu.org/gnu/gdb/gdb-12.1.tar.xz && \\\n    tar -xf gdb-12.1.tar.xz && cd gdb-12.1 && ./configure &&  \\\n    make -j $(expr $(nproc) / 2) && make install && cd .. && \\\n    rm -rf gdb-12.1* && apt-get remove --purge -y build-essential libgmp-dev\n"
  },
  {
    "path": "infra/base-images/base-runner-debug/ubuntu-20-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-runner:ubuntu-20-04\nRUN apt-get update && apt-get install -y valgrind zip\n\n# Installing GDB 12, re https://github.com/google/oss-fuzz/issues/7513.\nRUN apt-get install -y build-essential libgmp-dev && \\\n    wget https://ftp.gnu.org/gnu/gdb/gdb-12.1.tar.xz && \\\n    tar -xf gdb-12.1.tar.xz && cd gdb-12.1 && ./configure &&  \\\n    make -j $(expr $(nproc) / 2) && make install && cd .. && \\\n    rm -rf gdb-12.1* && apt-get remove --purge -y build-essential libgmp-dev\n"
  },
  {
    "path": "infra/base-images/base-runner-debug/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\nRUN apt-get update && apt-get install -y valgrind zip\n\n# Installing GDB 12, re https://github.com/google/oss-fuzz/issues/7513.\nRUN apt-get install -y build-essential libgmp-dev && \\\n    wget https://ftp.gnu.org/gnu/gdb/gdb-12.1.tar.xz && \\\n    tar -xf gdb-12.1.tar.xz && cd gdb-12.1 && ./configure &&  \\\n    make -j $(expr $(nproc) / 2) && make install && cd .. && \\\n    rm -rf gdb-12.1* && apt-get remove --purge -y build-essential libgmp-dev\n"
  },
  {
    "path": "infra/base-images/list_images.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"\nHelper script to print the official list of base images.\nThis script serves as the single source of truth for shell scripts,\navoiding logic duplication.\n\"\"\"\n\nimport os\nimport sys\n\n# Add the path to the `functions` directory to import the `base_images` module.\nFUNCTIONS_DIR = os.path.abspath(\n    os.path.join(os.path.dirname(__file__), '..', 'build', 'functions'))\nsys.path.append(FUNCTIONS_DIR)\n\nimport base_images\n\nfor image_config in base_images.BASE_IMAGE_DEFS:\n  # Exclude 'base-clang-full' as it is a special case not intended for\n  # the general build script.\n  if image_config.get('name', '') != 'base-clang-full':\n    print(image_config.get('name', ''))\n"
  },
  {
    "path": "infra/bisector.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Uses bisection to determine which commit a bug was introduced and fixed.\nThis module takes a high and a low commit SHA, a repo name, and a bug.\nThe module bisects the high and low commit SHA searching for the location\nwhere the bug was introduced. It also looks for where the bug was fixed.\nThis is done with the following steps:\n\n\n  NOTE: Needs to be run from root of the OSS-Fuzz source checkout.\n\n  Typical usage example:\n        python3 infra/bisector.py\n          --old_commit 1e403e9259a1abedf108ab86f711ba52c907226d\n          --new_commit f79be4f2330f4b89ea2f42e1c44ca998c59a0c0f\n          --fuzz_target rules_fuzzer\n          --project_name yara\n          --testcase infra/yara_testcase\n          --sanitizer address\n\"\"\"\n\nimport argparse\nimport collections\nimport logging\nimport os\nimport sys\nimport tempfile\n\nimport build_specified_commit\nimport helper\nimport repo_manager\nimport utils\n\nResult = collections.namedtuple('Result', ['repo_url', 'commit'])\n\nSTART_MARKERS = [\n    '==ERROR',\n    '==WARNING',\n]\n\nEND_MARKERS = [\n    'SUMMARY:',\n]\n\nDEDUP_TOKEN_MARKER = 'DEDUP_TOKEN:'\n\n\nclass BisectError(Exception):\n  \"\"\"Bisection error.\"\"\"\n\n  def __init__(self, message, repo_url):\n    super().__init__(message)\n    self.repo_url = repo_url\n\n\ndef main():\n  \"\"\"Finds the commit SHA where an error was initally introduced.\"\"\"\n  logging.getLogger().setLevel(logging.INFO)\n  utils.chdir_to_root()\n  parser = argparse.ArgumentParser(\n      description='git bisection for finding introduction of bugs')\n\n  parser.add_argument('--project_name',\n                      help='The name of the project where the bug occurred.',\n                      required=True)\n  parser.add_argument('--new_commit',\n                      help='The newest commit SHA to be bisected.',\n                      required=True)\n  parser.add_argument('--old_commit',\n                      help='The oldest commit SHA to be bisected.',\n                      required=True)\n  parser.add_argument('--fuzz_target',\n                      help='The name of the fuzzer to be built.',\n                      required=True)\n  parser.add_argument('--test_case_path',\n                      help='The path to test case.',\n                      required=True)\n  parser.add_argument('--engine',\n                      help='The default is \"libfuzzer\".',\n                      default='libfuzzer')\n  parser.add_argument('--sanitizer',\n                      default='address',\n                      help='The default is \"address\".')\n  parser.add_argument('--type',\n                      choices=['regressed', 'fixed'],\n                      help='The bisection type.',\n                      required=True)\n  parser.add_argument('--architecture', default='x86_64')\n  args = parser.parse_args()\n\n  build_data = build_specified_commit.BuildData(project_name=args.project_name,\n                                                engine=args.engine,\n                                                sanitizer=args.sanitizer,\n                                                architecture=args.architecture)\n\n  result = bisect(args.type, args.old_commit, args.new_commit,\n                  args.test_case_path, args.fuzz_target, build_data)\n  if not result.commit:\n    logging.error('No error was found in commit range %s:%s', args.old_commit,\n                  args.new_commit)\n    return 1\n  if result.commit == args.old_commit:\n    logging.error(\n        'Bisection Error: Both the first and the last commits in'\n        'the given range have the same behavior, bisection is not possible. ')\n    return 1\n  if args.type == 'regressed':\n    print('Error was introduced at commit %s' % result.commit)\n  elif args.type == 'fixed':\n    print('Error was fixed at commit %s' % result.commit)\n  return 0\n\n\ndef _get_dedup_token(output):\n  \"\"\"Get dedup token.\"\"\"\n  for line in output.splitlines():\n    token_location = line.find(DEDUP_TOKEN_MARKER)\n    if token_location == -1:\n      continue\n\n    return line[token_location + len(DEDUP_TOKEN_MARKER):].strip()\n\n  return None\n\n\ndef _check_for_crash(project_name, fuzz_target, testcase_path):\n  \"\"\"Check for crash.\"\"\"\n\n  def docker_run(args, **kwargs):\n    del kwargs\n    command = ['docker', 'run', '--rm', '--privileged']\n    if sys.stdin.isatty():\n      command.append('-i')\n\n    return utils.execute(command + args)\n\n  logging.info('Checking for crash')\n  out, err, return_code = helper.reproduce_impl(\n      project=helper.Project(project_name),\n      fuzzer_name=fuzz_target,\n      valgrind=False,\n      env_to_add=[],\n      fuzzer_args=[],\n      testcase_path=testcase_path,\n      run_function=docker_run,\n      err_result=(None, None, None))\n  if return_code is None:\n    return None\n\n  logging.info('stdout =\\n%s', out)\n  logging.info('stderr =\\n%s', err)\n\n  # pylint: disable=unsupported-membership-test\n  has_start_marker = any(\n      marker in out or marker in err for marker in START_MARKERS)\n  has_end_marker = any(marker in out or marker in err for marker in END_MARKERS)\n  if not has_start_marker or not has_end_marker:\n    return None\n\n  return _get_dedup_token(out + err)\n\n\n# pylint: disable=too-many-locals\n# pylint: disable=too-many-arguments\n# pylint: disable=too-many-statements\ndef _bisect(bisect_type, old_commit, new_commit, testcase_path, fuzz_target,\n            build_data):\n  \"\"\"Perform the bisect.\"\"\"\n  # pylint: disable=too-many-branches\n  base_builder_repo = build_specified_commit.load_base_builder_repo()\n\n  with tempfile.TemporaryDirectory() as tmp_dir:\n    repo_url, repo_path = build_specified_commit.detect_main_repo(\n        build_data.project_name, commit=new_commit)\n    if not repo_url or not repo_path:\n      raise ValueError('Main git repo can not be determined.')\n\n    if old_commit == new_commit:\n      raise BisectError('old_commit is the same as new_commit', repo_url)\n\n    # Copy /src from the built Docker container to ensure all dependencies\n    # exist. This will be mounted when running them.\n    host_src_dir = build_specified_commit.copy_src_from_docker(\n        build_data.project_name, tmp_dir)\n\n    bisect_repo_manager = repo_manager.RepoManager(\n        os.path.join(host_src_dir, os.path.basename(repo_path)))\n    bisect_repo_manager.fetch_all_remotes()\n\n    commit_list = bisect_repo_manager.get_commit_list(new_commit, old_commit)\n\n    old_idx = len(commit_list) - 1\n    new_idx = 0\n    logging.info('Testing against new_commit (%s)', commit_list[new_idx])\n    if not build_specified_commit.build_fuzzers_from_commit(\n        commit_list[new_idx],\n        bisect_repo_manager,\n        host_src_dir,\n        build_data,\n        base_builder_repo=base_builder_repo):\n      raise BisectError('Failed to build new_commit', repo_url)\n\n    if bisect_type == 'fixed':\n      should_crash = False\n    elif bisect_type == 'regressed':\n      should_crash = True\n    else:\n      raise BisectError('Invalid bisect type ' + bisect_type, repo_url)\n\n    expected_error = _check_for_crash(build_data.project_name, fuzz_target,\n                                      testcase_path)\n    logging.info('new_commit result = %s', expected_error)\n\n    if not should_crash and expected_error:\n      logging.warning('new_commit crashed but not shouldn\\'t. '\n                      'Continuing to see if stack changes.')\n\n    range_valid = False\n    for _ in range(2):\n      logging.info('Testing against old_commit (%s)', commit_list[old_idx])\n      if not build_specified_commit.build_fuzzers_from_commit(\n          commit_list[old_idx],\n          bisect_repo_manager,\n          host_src_dir,\n          build_data,\n          base_builder_repo=base_builder_repo):\n        raise BisectError('Failed to build old_commit', repo_url)\n\n      if _check_for_crash(build_data.project_name, fuzz_target,\n                          testcase_path) == expected_error:\n        logging.warning('old_commit %s had same result as new_commit %s',\n                        old_commit, new_commit)\n        # Try again on an slightly older commit.\n        old_commit = bisect_repo_manager.get_parent(old_commit, 64)\n        if not old_commit:\n          break\n\n        commit_list = bisect_repo_manager.get_commit_list(\n            new_commit, old_commit)\n        old_idx = len(commit_list) - 1\n        continue\n\n      range_valid = True\n      break\n\n    if not range_valid:\n      raise BisectError('old_commit had same result as new_commit', repo_url)\n\n    while old_idx - new_idx > 1:\n      curr_idx = (old_idx + new_idx) // 2\n      logging.info('Testing against %s (idx=%d)', commit_list[curr_idx],\n                   curr_idx)\n      if not build_specified_commit.build_fuzzers_from_commit(\n          commit_list[curr_idx],\n          bisect_repo_manager,\n          host_src_dir,\n          build_data,\n          base_builder_repo=base_builder_repo):\n        # Treat build failures as if we couldn't repo.\n        # TODO(ochang): retry nearby commits?\n        old_idx = curr_idx\n        continue\n\n      current_error = _check_for_crash(build_data.project_name, fuzz_target,\n                                       testcase_path)\n      logging.info('Current result = %s', current_error)\n      if expected_error == current_error:\n        new_idx = curr_idx\n      else:\n        old_idx = curr_idx\n    return Result(repo_url, commit_list[new_idx])\n\n\n# pylint: disable=too-many-locals\n# pylint: disable=too-many-arguments\ndef bisect(bisect_type, old_commit, new_commit, testcase_path, fuzz_target,\n           build_data):\n  \"\"\"From a commit range, this function caluclates which introduced a\n  specific error from a fuzz testcase_path.\n\n  Args:\n    bisect_type: The type of the bisect ('regressed' or 'fixed').\n    old_commit: The oldest commit in the error regression range.\n    new_commit: The newest commit in the error regression range.\n    testcase_path: The file path of the test case that triggers the error\n    fuzz_target: The name of the fuzzer to be tested.\n    build_data: a class holding all of the input parameters for bisection.\n\n  Returns:\n    The commit SHA that introduced the error or None.\n\n  Raises:\n    ValueError: when a repo url can't be determine from the project.\n  \"\"\"\n  try:\n    return _bisect(bisect_type, old_commit, new_commit, testcase_path,\n                   fuzz_target, build_data)\n  finally:\n    # Clean up projects/ as _bisect may have modified it.\n    oss_fuzz_repo_manager = repo_manager.RepoManager(helper.OSS_FUZZ_DIR)\n    oss_fuzz_repo_manager.git(['reset', 'projects'])\n    oss_fuzz_repo_manager.git(['checkout', 'projects'])\n    oss_fuzz_repo_manager.git(['clean', '-fxd', 'projects'])\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/bisector_test.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing perepo_managerissions and\n# limitations under the License.\n\"\"\"Test the functionality of bisection module:\n1) Test a known case where an error appears in a regression range.\n2) Bisect can handle incorrect inputs.\n\nIMPORTANT: This test needs to be run with root privileges.\n\"\"\"\n\nimport os\nimport unittest\n\nimport bisector\nimport build_specified_commit\nimport test_repos\n\n# Necessary because __file__ changes with os.chdir\nTEST_DIR_PATH = os.path.dirname(os.path.realpath(__file__))\n\n\n@unittest.skip('Test is too long to be run with presubmit.')\nclass BisectIntegrationTests(unittest.TestCase):\n  \"\"\"Class to test the functionality of bisection method.\"\"\"\n\n  BISECT_TYPE = 'regressed'\n\n  def test_bisect_invalid_repo(self):\n    \"\"\"Test the bisection method on a project that does not exist.\"\"\"\n    test_repo = test_repos.INVALID_REPO\n    build_data = build_specified_commit.BuildData(\n        project_name=test_repo.project_name,\n        engine='libfuzzer',\n        sanitizer='address',\n        architecture='x86_64')\n    with self.assertRaises(ValueError):\n      bisector.bisect(self.BISECT_TYPE, test_repo.old_commit,\n                      test_repo.new_commit, test_repo.testcase_path,\n                      test_repo.fuzz_target, build_data)\n\n  def test_bisect(self):\n    \"\"\"Test the bisect method on example projects.\"\"\"\n    for test_repo in test_repos.TEST_REPOS:\n      if test_repo.new_commit:\n        build_data = build_specified_commit.BuildData(\n            project_name=test_repo.project_name,\n            engine='libfuzzer',\n            sanitizer='address',\n            architecture='x86_64')\n        result = bisector.bisect(self.BISECT_TYPE, test_repo.old_commit,\n                                 test_repo.new_commit, test_repo.testcase_path,\n                                 test_repo.fuzz_target, build_data)\n        self.assertEqual(result.commit, test_repo.intro_commit)\n\n\nif __name__ == '__main__':\n  # Change to oss-fuzz main directory so helper.py runs correctly.\n  if os.getcwd() != os.path.dirname(TEST_DIR_PATH):\n    os.chdir(os.path.dirname(TEST_DIR_PATH))\n  unittest.main()\n"
  },
  {
    "path": "infra/build/blog/.gitignore",
    "content": "oss-fuzz-blog\nhugo-coder\n"
  },
  {
    "path": "infra/build/blog/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM python:3.11-bullseye\n\n# Allow statements and log messages to immediately appear in the Knative logs\nENV PYTHONUNBUFFERED True\n\nRUN mkdir -p hugo-bin && \\\n    cd hugo-bin && \\\n    wget https://github.com/gohugoio/hugo/releases/download/v0.126.1/hugo_extended_0.126.1_linux-amd64.tar.gz && \\\n    tar -xzf hugo_extended_0.126.1_linux-amd64.tar.gz\n\nENV PATH=\"${PATH}:/hugo-bin/\"\n\nRUN git clone https://github.com/luizdepra/hugo-coder hugo-coder && \\\n    cd hugo-coder && \\\n    git checkout 759cc945636473d251a28597e2007cbb7d11631d # 17th May 2024\n\nCOPY content /content\nCOPY hugo.toml /hugo.toml\nCOPY build_blog.sh /build_blog.sh\nRUN /build_blog.sh\n\nCMD exec python3 -m http.server 8011 -d /oss-fuzz-blog/page/public\n"
  },
  {
    "path": "infra/build/blog/build_blog.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBASE=$PWD\n\nif [ -d \"${BASE}/hugo-coder\" ]\nthen\n  echo \"Local version of hugo exists. Using this.\"\nelse\n  # When writing the blog outeside of docker we clone Hugo here.\n  git clone https://github.com/luizdepra/hugo-coder hugo-coder\n  cd hugo-coder\n  git checkout 759cc945636473d251a28597e2007cbb7d11631d # 17th May 2024\n  cd ../\nfi\n\n# Build the site\nif [ -d \"${BASE}/oss-fuzz-blog\" ]\nthen\n  rm -rf ${BASE}/oss-fuzz-blog\nfi\nmkdir oss-fuzz-blog\ncd oss-fuzz-blog\n\nhugo new site page\ncd page\n\ngit init\n\n# Copy over our content\ncp -rf ${BASE}/hugo-coder themes/hugo-coder\ncp $BASE/hugo.toml .\nrm -rf ./content\ncp -rf $BASE/content .\n\n# Build the site\nhugo -D\n\n# Uncomment the following to launch site automatically\n#python3 -m http.server 8011 -d ./oss-fuzz-blog/page/public\n"
  },
  {
    "path": "infra/build/blog/content/about.md",
    "content": "+++\ntitle = \"About\"\ndescription = \"OSS-Fuzz's blog\"\ndate = \"2024-05-20\"\naliases = [\"about-us\", \"about-oss-fuzz\", \"contact\"]\nauthor = \"OSS-Fuzz maintainers\"\n+++\n\nThis is a blog for updates, research and initiatives of the OSS-Fuzz project.\nOSS-Fuzz is an open source fuzzing framework focused on large scale fuzzing\nof open source projects. The efforts described in this blog focuses on this\ndomain and includes both feature updates to OSS-Fuzz itself as well as insights\ninto research and development efforts of OSS-Fuzz.\n"
  },
  {
    "path": "infra/build/blog/content/posts/introducing-java-auto-harnessing.md",
    "content": "+++\nauthors = [\"OSS-Fuzz Maintainers\"]\ntitle = \"Introducing Java fuzz harness synthesis using LLMs\"\ndate = \"2024-09-05\"\ndescription = \"Introducing LLM-based harness generation for Java OSS-Fuzz projects.\"\ncategories = [\n    \"Fuzzing\",\n    \"Fuzzing synthesis\",\n    \"LLM\",\n    \"Automated fuzzing\",\n    \"Java\",\n    \"Java automatic fuzzing\",\n]\n+++\n\n\n# Introduction\n\nThe primary objective of OSS-Fuzz-gen is to automate the fuzzing process for open-source software.\nIn our previous blog posts ([1](https://security.googleblog.com/2023/08/ai-powered-fuzzing-breaking-bug-hunting.html),[2](https://blog.oss-fuzz.com/posts/introducing-llm-based-harness-synthesis-for-unfuzzed-projects/)), we've demonstrated promising results using large language models (LLMs) to enhance existing C/C++ OSS-Fuzz projects and explored the potential of leveraging LLMs for initial OSS-Fuzz integrations.\n\n\nIn this blog post, we explore how we can extend this work to another language (Java), and the unique challenges we encountered while building Java-specific capabilities into our existing OSS-Fuzz-Gen workflow:\n\n1. Extracting program analysis data from Java projects.\n2. Generate LLM prompts based on program analysis targeted Java projects.\n\n# Java fuzz harness sample and outline\n\nTo illustrate the typical structure of a Java fuzz harness, consider the following\nexample targeting the [Jettison](https://github.com/google/oss-fuzz/tree/master/projects/jettison) project, specifically the constructor of the\n`MappedXMLStreamReader` class. This constructor requires a `JSONObject` as an argument,\nwhich the harness instantiates using fuzz data provided by the `FuzzedDataProvider`\nobject. Moreover, since `MappedXMLStreamReader` is a resource class implementing the\n`AutoCloseable` interface, the harness must invoke the close method on the instantiated\nobject to prevent memory exhaustion. Failure to do so would result in memory\nleaks during each fuzz iteration. \n\n\nThe harness also needs to handle `JSONException` and `XMLStreamException` exceptions,\nas these are valid exceptions that the target class may throw. If these exceptions\nare not appropriately caught, they would be incorrectly reported as issues, leading\nto false positives. It is also important to note that the methods targeted by the\nharness are publicly accessible, as otherwise the harness wouldn’t build successfully.\n\n```java\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.codehaus.jettison.mapped.MappedXMLStreamReader;\nimport org.codehaus.jettison.json.JSONObject;\nimport org.codehaus.jettison.json.JSONException;\nimport javax.xml.stream.XMLStreamException;\n\npublic class JsonFuzzer {\n  public static void fuzzerInitialize() {\n  }\n\n  public static void fuzzerTearDown() {\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      JSONObject jsonObject = new JSONObject();\n      for (int i = 0; i < 10; ++i) {\n        try {\n          jsonObject.put(data.consumeString(10), data.consumeString(10));\n        } catch (JSONException e) {\n          // handle exception\n        }\n      }\n      MappedXMLStreamReader reader = new MappedXMLStreamReader(jsonObject);\n      reader.close();\n    } catch (JSONException | XMLStreamException e) {\n      // handle exception\n    }\n  }\n}\n```\n\n\nThese aspects are central in the generation of Java fuzzing harnesses, and, we\nmay see similar code structures in a C++ harness, one of the observations that we\nhave made during our Java fuzzing automation efforts is that without contextual\ninformation regarding the aforementioned parts the LLMs are likely to generate\nharnesses that can’t build or produce false positives. To this end, a significant\npart of enabling Java fuzzing harness synthesis by way of LLMs has been to provide\nenough context to the LLM so it is aware of these constraints.\n\n# Challenges faced integrating Java into OSS-Fuzz-gen\n\nThe above example highlights several common characteristics of Java harnesses,\nand throughout our efforts we identified the need for specific handling of these\nwithin our prompt. This includes specific considerations to the following attributes:\n\n## 1. Object creation and constructors\n\nFuzzing Java targets almost always requires creating and managing objects, and this involves calling constructors, managing object lifecycles, and ensuring objects are in valid states before invoking methods. Because precise object management is crucial, it is important to provide context about object creation to LLMs so they can generate fuzzing harnesses that use the correct constructors or static methods. \n\nFor example, our auto-generation capabilities support generating harnesses targeting both static methods and object instance methods. Whenever the target is an instance method we provide details about the constructors associated with a given class, and further descriptions about the types of the arguments to the construct. This constructor section that we add to the LLM prompt, provides details such as a list of constructors, methods and guidelines in the target code that create and initialize objects of the type that the target method is attached to.\n\nA sample of this section is shown below, where the goal of the constructor section is to provide context for the LLM on how to instantiate a `DiffRowGenerator` object.\n\n```sh\n<constructor>\n<signature>DiffRowGenerator.Builder.build()</signature>\n<prerequisite>\nYou MUST call the STATIC method DiffRowGenerator.create() to retrieve an instance of DiffRowGenerator.Builder before invoking DiffRowGenerator.Builder.build() to generate a com.github.difflib.text.DiffRowGenerator instance.\n</prerequisite>\n</constructor>\n```\n\nFor the full prompt and the harness generated by the prompt, please see the following [Gist](https://gist.github.com/DavidKorczynski/d16bf21a433931d6c8be9f5a4048f48e).\n\n## 2. Exception handling\n\nExceptions are prevalent in Java and although they are also prevalent in C++, we found a need for adding further handling of exceptions when auto generating Java harnesses. We anticipate that this is, to some extent, due to Java fuzzing often revolving around generating harnesses that are meant to flag any uncaught exceptions in the target code, whereas the predominant goal of C++ fuzzing is to capture memory corruption issues. To this end, we added a specific guide on which exceptions a Java harness needs to catch as displayed in the prompt snippet below:\n\n```sh\nThe <exceptions> tag contains a list of exceptions thrown by the target method that you MUST catch.\n...\n<exceptions>\n<exception>jakarta.mail.internet.AddressException</exception>\n</exceptions>\n```\n\nIn order to extract the exceptions that a harness should catch, we rely on reachability analysis from Fuzz Introspector, that extracts the exceptions a given function can throw explicitly. The primary objective of including this section is to minimize the number of false positives arising from expected exceptions and to catch all checked exceptions, thereby preventing compilation errors in the generated harness.\n\n## 3. Resources object closing\n\nIn Java fuzzing we must manage and close resources for classes that implement `AutoCloseable`\nto prevent memory leaks and resource exhaustion. Java relies on the garbage collector\nfor memory management so a harness generally doesn’t need to worry about out-of-memory\nissues or memory leaks. However, for classes that implement the `AutoCloseable` interface,\nsuch as file streams, network connections, or database handles, the garbage collector won’t\nfree up its allocated memory. To this end, in order to avoid memory leaks and out-of-memory\nissues, we need to provide context for the LLM whenever `AutoCloseable` objects are and guidance\nfor closing the objects correctly. To address this, we add to the LLM prompt general guidance\non the need for closing `AutoCloseable` interfaces, as well as specific guidance whenever\nwe incur objects that implements this interface, as shown by the snippet of a prompt below:\n\n```sh\n...\n<item>You MUST invoke the close method of the org.codehaus.jettison.mapped.MappedXMLStreamReader objects in the finally block after the target method is invoked.</item>\n<item>You MUST invoke the close method of any resource class objects that implements the java.lang.AutoCloseable interface in the finally block after the target method is invoked.</item>\n...\n```\n\n## 4. Choosing suitable targets\nA central theme when auto-generating fuzzing harnesses is to identify entry points in the target code that are relevant fuzz targets. In general, OSS-Fuzz-gen does this by identifying target functions that exhibit a lot of complexity, but has zero or low code coverage from the existing OSS-Fuzz harnesses. This works well in terms of identifying targets that if fuzzed correctly will yield a lot of code coverage. This idea translates well into Java as well, in that we are interested in fuzzing targets that are high in the function call tree of the target codebase.\n\nHowever, we found that we need additional filtering mechanisms when choosing target method candidates, due to the language features of Java such as polymorphism, method scope and more. In addition to this, because Java targets often have several thousand methods that are potential candidates, we found a stronger need for more carefully choosing which candidates may be viable targets. For example, in addition to the existing candidate choosing mechanisms we have in OSS-Fuzz-gen, we added filtering logic for Java methods that only includes methods if they:\n- Are publicly accessible.\n- Are not part of the JVM library.\n- Are not part of an enum class.\n- Are not called by any existing fuzzing harnesses\n- Are not part of any exception or testing class or contain the words “test”, “exception” or “error in the function name.\n\n\n## 5. Random objects and primitive data\n\nJava harnesses often have to generate complex types as input to the target methods, and these types themselves are often generated either through creation of a sequence of different objects or using helper methods provided by helper classes exposed by the Jazzer fuzzing framework. We found the need to provide further guidance on how to instantiate the arguments of a given function, as well provide guidance on generating simple types such as strings seeded with fuzz data. To this end, we include in each prompt a section on how to instantiate the arguments of a target method, as shown by the below snippet:\n\n```sh\n<arguments>\n1. Argument #0 requires a java.util.List instance with a generic type of String. You MUST create an empty java.util.List<String> instance, then fill the list with multiple DIFFERENT String objects generated by FuzzedDataProvider::consumeString(int) or FuzzedDataProvider::consumeAsciiString(int) or FuzzedDataProvider::consumeRemainingAsString() or FuzzedDataProvider::consumeRemainingAsAsciiString() or FuzzedDataProvider::pickValue(String[]) methods.\n2. Argument #1 requires a com.github.difflib.patch.Patch instance with a generic type of String. You MUST create two empty java.util.List<String> instance, then fill the two lists with multiple DIFFERENT String objects generated by FuzzedDataProvider::consumeString(int) or FuzzedDataProvider::consumeAsciiString(int) or FuzzedDataProvider::consumeRemainingAsString() or FuzzedDataProvider::consumeRemainingAsAsciiString() or FuzzedDataProvider::pickValue(String[]) methods. After the two lists creation, use these newly created lists to invoke the STATIC method com.github.difflib.DiffUtils.diff(java.util.List<String>,java.util.List<String>) to generate a com.github.difflib.patch.Patch instance with generic type of String.\n</arguments>\n```\n\nThe section outlines both how to create primitive types using the `FuzzedDataProvider` exposed by the fuzzing engine, as well as guidelines on how to create higher-level types such as the `difflib.patch.Patch` as shown in the second argument in the above snippet.\n\n## 6. General Java fuzzing requirements\n\nThere are several fuzzing engines for Java, such as JQF, Jazzer, and JavaFuzz, each with its own unique structure and methodology, unlike the more standardized engines used for C/C++ fuzzing. Currently, OSS-Fuzz supports Java fuzzing exclusively through the Jazzer engine, so it is essential for OSS-Fuzz-Gen to provide guidelines that enable LLMs to generate harnesses following Jazzer's specific structure for direct use in OSS-Fuzz. We found a need to guide the LLM towards generating Jazzer-friendly harnesses by providing a Java-specific introduction section in the LLM, as well as a section on general Java fuzzing guidelines. \n\nAn example snippet of the general guidelines are shown in the snippet below:\n\n```sh\n<requirements>\n...\n<item>The generated fuzzing harness should be wrapped with the <java_code> tag.</item>\n<item>NEVER use any methods from the <code>java.lang.Random</code> class in the generated code.</item>\n<item>NEVER use any classes or methods in the <code>java.lang.reflect</code> package in the generated code.</item>\n<item>NEVER use the @FuzzTest annotation for specifying the fuzzing method.</item>\n<item>Please avoid using any multithreading or multi-processing approach.</item>\n<item>Please add import statements for necessary classes, except for classes in the java.lang package.</item>\n<item>You MUST create the object before calling the target method.</item>\n<item>You MUST catch java.lang.RuntimeException.</item>\n<item>Please use HeaderTokenizerFuzzer as the Java class name.</item>\n```\n\n\n# Results\n\nThe Java harness generation logic is built into OSS-Fuzz-gen which means we can run the logic at scale. To test our approach we ran the harness generation on a total of 106 existing Java project integrations in OSS-Fuzz. An overview of the results are shown in the below table. In total we tried to synthesize harnesses for 592 targets, which means that we identified 592 interesting Java methods to fuzz. In total, 280 of the harnesses synthesized were able to build and of these 280 harnesses a total of  102 harnesses had an edge-coverage delta of more than zero. This means that 102 harnesses had code exploration, where the remaining 178 harnesses either ran into an exception in the first iteration or failed to explore code incrementally.\n\n| Total number of projects | Total harnesses synthesized | Harnesses successfully built | harness build success rate | Harnesses with edge coverage delta above 0 |\n|--------------------------|----------------------------|--------------------|-----------------|----------------|\n| 106 | 592 | 280 | 47.30% | 102 |\n\nDuring our evaluation, several of the harnesses reported bugs which we triaged. We found that two issues were deemed to be security issues (awaiting response) and also triaged four issues that were considered reliability bugs. All issues were reported to the upstream maintainers. In the following we’ll go through the four harnesses that found reliability bugs (uncaught exceptions). \n\n## Reliability bug 1: uncaught exception in jakarta.mail\n\nReported [here](https://github.com/jakartaee/mail-api/issues/734)\n\nGenerated harness:\n\n```java\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport jakarta.mail.internet.ParameterList;\nimport jakarta.mail.internet.ParseException;\n\npublic class HeaderTokenizerFuzzer {\n  public static void fuzzerInitialize() {\n  }\n\n  public static void fuzzerTearDown() {\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      for (int i = 0; i < 10; i++) {\n        String var_0 = data.consumeRemainingAsString();\n        ParameterList parameterList = new ParameterList(var_0);\n      }\n    } catch (ParseException e) {\n    }\n  }\n}\n```\n\nExecution log and bug trace:\n\n```sh\n#2  INITED cov: 34 ft: 34 corp: 1/1b exec/s: 0 rss: 911Mb\n#6  NEW    cov: 51 ft: 69 corp: 2/3b lim: 4 exec/s: 0 rss: 911Mb L: 2/2 MS: 8 ChangeByte-Custom-ChangeBit-Custom-CopyPart-Custom-InsertByte-Custom-\n#12 NEW    cov: 60 ft: 79 corp: 3/5b lim: 4 exec/s: 0 rss: 911Mb L: 2/2 MS: 2 InsertByte-Custom-\n#14 NEW    cov: 62 ft: 82 corp: 4/8b lim: 4 exec/s: 0 rss: 911Mb L: 3/3 MS: 4 ShuffleBytes-Custom-InsertByte-Custom-\n#15 NEW    cov: 63 ft: 83 corp: 5/10b lim: 4 exec/s: 0 rss: 911Mb L: 2/3 MS: 2 ChangeByte-Custom-\n#16 REDUCE cov: 63 ft: 83 corp: 5/9b lim: 4 exec/s: 0 rss: 911Mb L: 2/2 MS: 2 EraseBytes-Custom-\n#25 NEW    cov: 64 ft: 84 corp: 6/11b lim: 4 exec/s: 0 rss: 911Mb L: 2/2 MS: 8 ShuffleBytes-Custom-ChangeByte-Custom-ChangeByte-Custom-CopyPart-Custom-\n#54 NEW    cov: 71 ft: 91 corp: 7/14b lim: 4 exec/s: 0 rss: 911Mb L: 3/3 MS: 8 ChangeBinInt-Custom-CrossOver-Custom-InsertByte-Custom-ChangeBit-Custom-\n#60 NEW    cov: 73 ft: 95 corp: 8/16b lim: 4 exec/s: 0 rss: 911Mb L: 2/3 MS: 2 CopyPart-Custom-\n\n…\n#232899 REDUCE cov: 247 ft: 1033 corp: 288/8318b lim: 493 exec/s: 116449 rss: 936Mb L: 14/260 MS: 2 EraseBytes-Custom-\n#234061 REDUCE cov: 247 ft: 1033 corp: 288/8317b lim: 501 exec/s: 117030 rss: 936Mb L: 13/260 MS: 4 ChangeBit-Custom-EraseBytes-Custom-\n#234662 REDUCE cov: 247 ft: 1033 corp: 288/8309b lim: 501 exec/s: 117331 rss: 936Mb L: 33/260 MS: 2 EraseBytes-Custom-\n#236110 REDUCE cov: 247 ft: 1033 corp: 288/8305b lim: 509 exec/s: 118055 rss: 936Mb L: 25/260 MS: 6 ShuffleBytes-Custom-CMP-Custom-EraseBytes-Custom- DE: \"*0*\"-\n#236377 REDUCE cov: 247 ft: 1033 corp: 288/8304b lim: 509 exec/s: 118188 rss: 936Mb L: 42/260 MS: 4 ChangeBit-Custom-EraseBytes-Custom-\n#236528 REDUCE cov: 247 ft: 1033 corp: 288/8303b lim: 509 exec/s: 118264 rss: 936Mb L: 8/260 MS: 2 EraseBytes-Custom-\n#238094 NEW    cov: 247 ft: 1037 corp: 289/8336b lim: 517 exec/s: 119047 rss: 936Mb L: 33/260 MS: 2 CopyPart-Custom-\n\n== Java Exception: java.util.ConcurrentModificationException\n    at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1584)\n    at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1607)\n    at jakarta.mail.internet.ParameterList.combineMultisegmentNames(ParameterList.java:408)\n    at jakarta.mail.internet.ParameterList.<init>(ParameterList.java:309)\n    at HeaderTokenizerFuzzer.fuzzerTestOneInput(HeaderTokenizerFuzzer.java:16)\n```\n\n\n## Reliability bug 2: uncaught exception in jettison.json\n\nReported [here](https://github.com/jettison-json/jettison/issues/96)\n\nGenerated harness:\n\n```java\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.codehaus.jettison.json.JSONArray;\nimport org.codehaus.jettison.json.JSONException;\nimport org.codehaus.jettison.json.JSONTokener;\n\npublic class JsonFuzzer {\n  public static void fuzzerInitialize() {\n  }\n\n  public static void fuzzerTearDown() {\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      \n      JSONTokener jSONTokener = new JSONTokener(data.consumeRemainingAsString());\n      JSONArray jSONArray = new JSONArray(jSONTokener);\n    } catch (JSONException e) {\n    }\n  }\n}\n```\n\nExecution log and bug trace:\n\n```sh\n#1729   INITED cov: 88 ft: 341 corp: 67/2733b exec/s: 0 rss: 954Mb\n#1731   NEW    cov: 90 ft: 343 corp: 68/2742b lim: 567 exec/s: 0 rss: 954Mb L: 9/558 MS: 4 CopyPart-Custom-ManualDict-Custom- DE: \"}=\"-\n#1758   NEW    cov: 92 ft: 345 corp: 69/2747b lim: 567 exec/s: 0 rss: 954Mb L: 5/558 MS: 4 PersAutoDict-Custom-CrossOver-Custom- DE: \"}=\"-\n#1759   REDUCE cov: 92 ft: 345 corp: 69/2745b lim: 567 exec/s: 0 rss: 954Mb L: 9/558 MS: 2 EraseBytes-Custom-\n#1763   NEW    cov: 94 ft: 347 corp: 70/2820b lim: 567 exec/s: 0 rss: 954Mb L: 75/558 MS: 8 ChangeASCIIInt-Custom-EraseBytes-Custom-ShuffleBytes-Custom-CopyPart-Custom-\n#1779   NEW    cov: 96 ft: 349 corp: 71/2853b lim: 567 exec/s: 0 rss: 954Mb L: 33/558 MS: 2 ManualDict-Custom- DE: \"\\\"\"-\n#1804   NEW    cov: 98 ft: 351 corp: 72/2864b lim: 567 exec/s: 0 rss: 954Mb L: 11/558 MS: 10 CMP-Custom-ChangeBit-Custom-ChangeBinInt-Custom-InsertByte-Custom-ChangeByte-Custom- DE: \"<E\"-\n#1815   NEW    cov: 101 ft: 356 corp: 73/2871b lim: 567 exec/s: 0 rss: 954Mb L: 7/558 MS: 2 InsertByte-Custom-\n…\n#3620   NEW    cov: 142 ft: 440 corp: 122/6357b lim: 567 exec/s: 0 rss: 932Mb L: 7/558 MS: 2 InsertByte-Custom-\n#3718   NEW    cov: 143 ft: 443 corp: 123/6509b lim: 567 exec/s: 0 rss: 932Mb L: 152/558 MS: 6 ChangeBit-Custom-ChangeByte-Custom-ManualDict-Custom- DE: \"{\\\"foo\\\":nul\"-\n#3774   REDUCE cov: 143 ft: 443 corp: 123/6458b lim: 567 exec/s: 0 rss: 932Mb L: 61/558 MS: 2 CrossOver-Custom-\n#3851   NEW    cov: 143 ft: 444 corp: 124/6487b lim: 567 exec/s: 0 rss: 932Mb L: 29/558 MS: 4 ChangeBinInt-Custom-PersAutoDict-Custom- DE: \"//\"-\n\n== Java Exception: java.lang.NumberFormatException: For input string: \"D[  \" under radix 16\n    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)\n    at java.base/java.lang.Integer.parseInt(Integer.java:652)\n    at org.codehaus.jettison.json.JSONTokener.nextString(JSONTokener.java:258)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:336)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at org.codehaus.jettison.json.JSONTokener.newJSONArray(JSONTokener.java:436)\n    at org.codehaus.jettison.json.JSONTokener.nextValue(JSONTokener.java:342)\n    at org.codehaus.jettison.json.JSONArray.<init>(JSONArray.java:145)\n    at JsonFuzzer.fuzzerTestOneInput(JsonFuzzer.java:17)\n```\n\n## Reliability bug 3: Uncaught exception in sqlite-jdbc\n\nReported [here](https://github.com/xerial/sqlite-jdbc/issues/1141)\n\nGenerated harness:\n\n```java\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.sqlite.ExtendedCommand;\n\npublic class SqliteConnectionFuzzer {\n  public static void fuzzerInitialize() {\n    // Initializing objects for fuzzing\n  }\n\n  public static void fuzzerTearDown() {\n    // Tear down objects after fuzzing\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    // Use the FuzzedDataProvider object to generate random data for fuzzing\n    String string0 = data.consumeRemainingAsString();\n    for (int i = 0; i < 100; i++) {\n      for (int j = 0; j < 100; j++) {\n        // Fuzz by invoking the target method with random parameters / objects generated above.\n        ExtendedCommand.removeQuotation(string0);\n      }\n    }\n  }\n}\n```\n\nExecution log and bug trace:\n\n```sh\n#2  INITED cov: 9 ft: 9 corp: 1/1b exec/s: 0 rss: 942Mb\n#486    NEW    cov: 10 ft: 10 corp: 2/3b lim: 8 exec/s: 486 rss: 1042Mb L: 2/2 MS: 8 ChangeByte-Custom-ChangeBit-Custom-CopyPart-Custom-ChangeBit-Custom-\n\n== Java Exception: java.lang.StringIndexOutOfBoundsException: begin 1, end 0, length 1\n    at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3734)\n    at java.base/java.lang.String.substring(String.java:1903)\n    at org.sqlite.ExtendedCommand.removeQuotation(ExtendedCommand.java:57)\n    at SqliteConnectionFuzzer.fuzzerTestOneInput(SqliteConnectionFuzzer.java:19)\n```\n\n\n## Reliability bug 4: uncaught exception in jolt\n\nReported [here](https://github.com/bazaarvoice/jolt/issues/1268)\n\nGenerated harness:\n```java\nimport com.bazaarvoice.jolt.removr.spec.RemovrCompositeSpec;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.Map;\nimport java.util.HashMap;\n\npublic class JsonUtilsFuzzer {\n  public static void fuzzerInitialize() {\n  }\n\n  public static void fuzzerTearDown() {\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n        String var_0 = data.consumeString(1024);\n        Map<String, Object> var_1 = new HashMap<String, Object>();\n        for (int i = 0; i < data.consumeInt(0, 10); i++) {\n            var_1.put(data.consumeString(1024), data.consumeString(1024));\n        }\n        RemovrCompositeSpec target = new RemovrCompositeSpec(var_0, var_1);\n    } catch (java.lang.UnsupportedOperationException e) {\n    }\n  }\n}\n```\n\nExecution log and bug trace:\n\n```sh\n#358    NEW    cov: 52 ft: 67 corp: 12/35b lim: 4 exec/s: 0 rss: 990Mb L: 4/4 MS: 6 ChangeBinInt-Custom-PersAutoDict-Custom-CopyPart-Custom- DE: \"\\000\\000\"-\n#411    NEW    cov: 54 ft: 70 corp: 13/39b lim: 4 exec/s: 0 rss: 990Mb L: 4/4 MS: 6 CrossOver-Custom-ShuffleBytes-Custom-CopyPart-Custom-\n#468    REDUCE cov: 54 ft: 70 corp: 13/38b lim: 4 exec/s: 0 rss: 990Mb L: 2/4 MS: 4 ChangeBit-Custom-CrossOver-Custom-\n#469    REDUCE cov: 54 ft: 70 corp: 13/37b lim: 4 exec/s: 0 rss: 990Mb L: 2/4 MS: 2 CrossOver-Custom-\n\n== Java Exception: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1\n    at com.bazaarvoice.jolt.common.pathelement.StarDoublePathElement.<init>(StarDoublePathElement.java:54)\n    at com.bazaarvoice.jolt.removr.spec.RemovrSpec.parse(RemovrSpec.java:55)\n    at com.bazaarvoice.jolt.removr.spec.RemovrSpec.<init>(RemovrSpec.java:36)\n    at com.bazaarvoice.jolt.removr.spec.RemovrCompositeSpec.<init>(RemovrCompositeSpec.java:59)\n    at JsonUtilsFuzzer.fuzzerTestOneInput(JsonUtilsFuzzer.java:20)\n```\n\n# Conclusions and future work\n\nIn this blog post we have introduced our initial efforts toward automated java fuzzing. We described the challenges we faced during integration of Java support to OSS-Fuzz-gen, including how we pick interesting candidates and how we provide Java-specific context in the LLM prompts. The approach is built into our existing pipelines in OSS-Fuzz-gen, which enables us to do harness generation at scale for all OSS-Fuzz Java projects. The approach has shown interesting elements including code coverage gains across a large part of the Java projects as well as reporting security and reliability issues.\n\nWe will continue our efforts in automated Java fuzzer generation and are actively exploring new avenues for prompt generation. The goal is to provide reliable and clear harness suggestions to OSS-Fuzz users. We are also exploring combining our Java efforts with approaches for generating OSS-Fuzz integrations from scratch, as described in a previous [blog post](https://blog.oss-fuzz.com/posts/introducing-llm-based-harness-synthesis-for-unfuzzed-projects/).\n\nThe efforts described in this blog post are available in our OSS-Fuzz-gen repository [https://github.com/google/oss-fuzz-gen](https://github.com/google/oss-fuzz-gen) and we invite contributions from the community to further the Java harness automation generation.\n"
  },
  {
    "path": "infra/build/blog/content/posts/introducing-llm-based-harness-synthesis-for-unfuzzed-projects.md",
    "content": "+++\nauthors = [\"OSS-Fuzz Maintainers\"]\ntitle = \"Introducing LLM-based harness synthesis for unfuzzed projects\"\ndate = \"2024-05-27\"\ndescription = \"Introducing LLM-based harness generation for unfuzzed projects.\"\ncategories = [\n    \"Fuzzing\",\n    \"Fuzzing synthesis\",\n    \"LLM\",\n    \"Automated fuzzing\",\n]\n+++\n\n\n# Introduction\n\nAs part of the OSS-Fuzz-Gen project, we’ve been working on generating fuzzing harnesses for OSS-Fuzz projects with the goal of improving fuzzing coverage and unearthing more vulnerabilities. \n\nResults previously published from our ongoing work described in our [blog post](https://security.googleblog.com/2023/08/ai-powered-fuzzing-breaking-bug-hunting.html) showed promising results, with absolute coverage increases of up to 35% across over 160 OSS-Fuzz projects, and [6 new vulnerabilities](https://github.com/google/oss-fuzz-gen/?tab=readme-ov-file#bugs-discovered) discovered. However, this work only applied to projects already integrated into OSS-Fuzz as it uses the existing fuzzing build setups scripts in the given OSS-Fuzz project.\n\nRecently, we experimented with generating fuzzing harnesses for arbitrary C/C++ software projects, using the same LLM techniques.\n\nThe primary goal of our efforts are to take as input a GitHub repository and output an OSS-Fuzz project as well as a ClusterFuzzLite project with a meaningful fuzz harness. In this blog post we will describe how we automatically build projects, how we generate fuzzing harnesses using LLMs, how these are evaluated and list a selection of 15 projects that we generated OSS-Fuzz/ClusterFuzzLite integrations for and have upstreamed the results.\n\n\n# Generating OSS-Fuzz integrations with LLM harness synthesis\n\nThe high-level process for generating fuzzing harnesses from scratch takes as input a URL to a GitHub project and then follows a four step approach:\n\n1. Build generator: Try building the project using a set of pre-defined auto-build heuristics and capture the output of the build heuristics. If no build succeeds, do not continue.\n2. Fuzz Introspector build: For each successful build, rebuild the project under analysis of [Fuzz Introspector](https://github.com/ossf/fuzz-introspector) in order to extract a myriad of program analysis data as output in a Fuzz Introspector report.\n3. LLM-based harness generation: Synthesize harnesses by way of LLMs where the prompts are based on the program analysis data from Fuzz Introspector report. \n4. Harness Building: For each generated harness, build it using the build scripts generated from step (1) and run each harness for a number of seconds to evaluate its runtime performance. Log results from runtime for later inspection. For each harness wrap it in an appropriate OSS-Fuzz and ClusterFuzzLite project.\n\nThe output of the above is a set of OSS-Fuzz/ClusterFuzzLite projects with LLM-generated harnesses, build scripts, Dockerfiles and output from runtime evaluations. The following figure visualizes the approach, and we will now go into further details with each of the above steps.\n\n![image](/images/llm-from-scratch-overview.png)\n\n\n## Step 1: Auto-build target project\n\nThe first step intends to build the target project. In the case of C/C++ projects this is a non-trivial problem because, in comparison to several managed languages, there is limited consensus on how to build projects. There are multiple build systems, e.g. Make, CMake, Bazel, Ninja and so on, some projects rely on third-party dependencies to be installed on the system that builds the project, and some projects may rely on multiple commands to create the build artifacts. In addition to this, in order to build the code in a fuzzer-friendly manner we need to ensure certain compiler flags, e.g. to enable sanitizers, and compilers are used for the compilation.\n\nThe strategy we have opted for auto-building projects for a fuzzer-friendly build is creating a set of generalized build scripts by abstracting the existing build scripts in OSS-Fuzz. These generalized build scripts are template-like and include, for example, general build approaches based on Make, CMake and also compiling source files directly. We call these generalized build scripts for “build heuristics”. The build heuristics also include features for building the target code statically, since this is a requirement by OSS-Fuzz, and techniques for disabling certain options there may be available in the target projects’ build set up. We added these options because we observed several libraries where default options may not be fuzz-compatible and disabling these would successfully build the target projects.\n\nUpon successful execution of a build template, we search for the binary artifacts created by the build. Specifically, we are interested in the static archives produced by the build since to run on OSS-Fuzz it is preferred to link harnesses statically. We consider each build that produces at least one static archive to be a successful build, and each successful build is used for further processing in the next steps. The output of this step is a bash build script for each successful build template.\n\nTo provide intuition for how the build scripts look, consider the following two examples.\n\nExample 1, lorawan-parser build script ([PR](https://github.com/JiapengLi/lorawan-parser/pull/17)):\n\n```sh\nautoreconf -fi\n./configure\nmake\n\n$CC $CFLAGS $LIB_FUZZING_ENGINE $SRC/fuzzer.c -Wl,--whole-archive $SRC/lorawan-parser/lw/.libs/liblorawan.a -Wl,--whole-archive $SRC/lorawan-parser/lib/libloragw$SRC/.libs/libloragw.a -Wl,--whole-archive $SRC/lorawan-parser/lib/.libs/lib.a -Wl,--allow-multiple-definition -I$SRC/lorawan-parser/util/parser -I$SRC/lorawan-parser/lib/libloragw/inc -I$SRC/lorawan-parser/lib -I$SRC/lorawan-parser/lw  -o $OUT/fuzzer\n```\n\nExample 2, simpleson build script ([PR](https://github.com/gregjesl/simpleson/pull/40)):\n\n```sh\nmkdir fuzz-build\ncd fuzz-build\ncmake -DCMAKE_VERBOSE_MAKEFILE=ON ../\nmake V=1 || true\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/fuzzer.cpp -Wl,--whole-archive $SRC/simpleson/fuzz-build/libsimpleson.a -Wl,--allow-multiple-definition -I$SRC/simpleson/  -o $OUT/fuzzer\n```\n\n## Step 2: Extract program analysis data using Fuzz Introspector\n\nThe next step is to extract data about the program under analysis so that we can use it in a programmatic manner. We need this for two reasons. First, in order to select functions that are good candidates for fuzzing in the target project. Second, we need to be able to programmatically describe the program under analysis in a way that allows us to generate LLM prompts that describe the source code in a human-readable manner.\n\nTo achieve this we build the target under analysis, using the build scripts from the previous step, in combination with Fuzz Introspector. Fuzz Introspector is an LLVM-based program analysis tool that extracts a lot of data useful for fuzz introspection and also program analysis in general. For example, for each function in the target project Fuzz Introspector provides data such as function signature, cross-reference information, source code, cyclomatic complexity, call tree and more. This is all useful for our LLM-based harness generation since the goal is to present the LLM with a prompt that gives a precise technical description of the target under analysis.The output of this step is an introspector report for each build script.\n\nThe json snippet below is a sample subset of the data that Fuzz Introspector provides for the [json_validate](https://github.com/JiapengLi/lorawan-parser/blob/010a8f16074fb9a004b812e0289c5bc527e548ba/lib/json.c#L433) function in the [lorawan-parser](https://github.com/JiapengLi/lorawan-parser) project. The full data is available in this [Gist](https://gist.github.com/DavidKorczynski/f573d074d7745f351f76fcecd4a51930) and this type of data is provided to each function in a target codebase. We have stripped the sample for a number of keys in the json output to focus primarily on the data that we use in OSS-Fuzz-gen. Specifically, during OSS-Fuzz-gen harness synthesis we use of the data below:\n\n1. Cyclomatic complexity data to highlight functions of interest.\n2. Callsite to identify sample locations a given function is used.\n3. Debug information to present to the prompt with program context about the target function.\n4. Source code location to extract source.\n\nThis is a target function that our approach successfully generated an OSS-Fuzz integration for.\n\n```json\n{\n    \"Func name\": \"json_validate\",\n    \"Functions filename\": \"/src/test-fuzz-build-2/./lib/json.c\",\n    \"Function call depth\": 7,\n    \"Cyclomatic complexity\": 4,\n    \"Functions reached\": 45,\n    \"Reached by functions\": 0,\n    \"Accumulated cyclomatic complexity\": 212,\n    \"ArgNames\": [\n        \"json\"\n    ],\n    \"callsites\": {\n        \"skip_space\": [\n            \"./lib/json.c#json_validate:437\",\n            \"./lib/json.c#json_validate:441\"\n        ],\n        \"parse_value\": [\n            \"./lib/json.c#json_validate:438\"\n        ]\n    },\n    \"source_line_begin\": 434,\n    \"source_line_end\": 446,\n    \"function_signature\": \"bool json_validate(const char *)\",\n    \"debug_function_info\": {\n        \"name\": \"json_validate\",\n        \"is_public\": 0,\n        \"is_private\": 0,\n        \"func_signature_elems\": {\n            \"return_type\": [\n                \"DW_TAG_base_type\",\n                \"bool\"\n            ],\n            \"params\": [\n                [\n                    \"DW_TAG_pointer_type\",\n                    \"DW_TAG_const_type\",\n                    \"char\"\n                ]\n            ]\n        },\n        \"source\": {\n            \"source_file\": \"/src/test-fuzz-build-2/lib/json.c\",\n            \"source_line\": \"433\"\n        },\n        \"return_type\": \"bool\",\n        \"args\": [\n            \"const char *\"\n        ]\n    }\n},\n```\n\n\n## Step 3: LLM-based harness synthesis\n\nThe next step is to use LLMs to generate fuzzing harnesses. To do this, we have implemented several “harness-generators” that take as input the introspector reports and use this to create human-readable (LLM-readable) prompts which direct the LLM towards creating fuzz harnesses. The high-level idea is to generate textual descriptions of the target functions that are likely to produce a good harness by the LLM. To this end, for each function we consider a likely good candidate for fuzzing we have features for including in the prompts:\n\n- Description of the target function’s signature, with complete types, of the target program\n- Description of specifically which header files are available in the target project.\n- Examples of cross-references that use the target function to present sample code patterns involving the target function.\n- The actual source code of the target function.\n- Provide basic guidance to the LLM, such as the need for wrapping it in `LLVMFuzzerTestOneInput`.\n\nThe output of this step is a set of fuzzing harnesses produced by LLMs. Specifically, we generate Y amounts of harnesses, where Y is the number of functions to target in the program under analysis.\n\nThe harnesses that perform the best for each project are in general those that target high-level functions in the target project where the given function accepts fairly raw input data and does not rely on a complex initialization set up. This includes top level functions to, e.g. parse a given string, read a certain file and similar. The interesting parts of the LLM harness synthesi is that the LLM generates the correct initialization logic, provides the correct data types seeded with fuzz data and also provides correct cleaning up logic. To this end, we consider our approach to likely be useful for a lot of open source projects that are by nature fuzzing-friendly targets.\n\nThe following GitHub [Gist](https://gist.github.com/DavidKorczynski/bc386b88eab43931338971cff4d4655b) contains three sample prompts generated by the prompt-generation logic, and also the corresponding harness as output by the LLM. These are all prompts that generated successful harnesses in that the harnesses exercised a meaningful portion of code in the target as well as based on human investigation were determined to be good harnesses.\n\nThe following examples show fuzzing harnesses generated by our approach.\n\nExample 1, nanosvg harness ([PR](https://github.com/google/oss-fuzz/pull/11944)):\n\n```c\n#include <stdlib.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"nanosvgrast.h\"\n#include \"nanosvg.h\"\n#include \"stb_image_write.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Ensure null-terminated string\n    char* data_copy = (char*)malloc(size + 1);\n    memcpy(data_copy, data, size);\n    data_copy[size] = '\\0';\n\n    // Dummy arguments\n    const char* dummy_filename = \"dummy.svg\";\n    float dummy_value = 1.0f;\n\n    // Call the target function\n    NSVGimage* result = nsvgParse(data_copy, dummy_filename, dummy_value);\n\n    // Free memory\n    if (result) {\n        nsvgDelete(result);\n    }\n    free(data_copy);\n\n    return 0;\n}\n```\n\nExample 2, tinyexpr harness ([PR](https://github.com/google/oss-fuzz/pull/11944)):\n\n```c\n#include <stdlib.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"minctest.h\"\n#include \"tinyexpr.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size == 0) {\n        return 0;\n    }\n\n    char *input = (char*)malloc(size + 1);\n    if (!input) {\n        return 0;\n    }\n\n    memcpy(input, data, size);\n    input[size] = '\\0';\n\n    te_variable vars[] = {{ \"x\", 0 }};\n    int error;\n    te_expr *result = te_compile(input, vars, 1, &error);\n\n    free(input);\n    te_free(result);\n\n    return 0;\n}\n```\n\nExample 3, Simpleson harness ([PR](https://github.com/gregjesl/simpleson/pull/40))\n\n```c\n#include <stdlib.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"json.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size == 0) {\n        return 0;\n    }\n\n    // Copy input data to a null-terminated string\n    char* input = new char[size + 1];\n    memcpy(input, data, size);\n    input[size] = '\\0';\n\n    try {\n        json::jobject::parse(input);\n    } catch (...) {\n        // Catch all exceptions thrown by the target code\n    }\n\n    delete[] input;\n\n    return 0;\n}\n```\n\n\n## Step 4: Build and run each generated project\n\nThe final step is to verify that the build scripts combined with the fuzzing harnesses can build actual executables, and for each successfully built executable to verify that the harness is meaningful. Specifically, from step (1) we have a set of build scripts that successfully build the project under analysis and from step (3) we have a set of harnesses, for each successful build script, that targets the project under analysis. We now combine these by running the build script and creating a command for building a given harness against the output static libraries.\n\nFor each successfully built harness we run the given harness for a set period of time (40 seconds) in order to collect runtime logs, and for each successfully built harness we wrap the relevant artifacts in an OSS-Fuzz project as well as CluserFuzzLite project that can be run directly using the OSS-Fuzz infrastructure. The logs from runtime are then used for later inspection to determine if a harness was good, using factors such as edge coverage and how long the harness ran without running into any issues. At this stage, this is then verified by a human to determine if the integration is considered to the standard of an OSS-Fuzz/ClusterFuzzLite integration.\n\n\n# Results\n\nThe goal of our efforts is to enable continuous fuzzing for arbitrary open source projects. We ran our approach on a benchmark of C/C++ projects and have captured a subset of the successful integrations in order to integrate them to OSS-Fuzz or upstream ClusterFuzzLite. \n\nDuring the initial runs of the fuzz harnesses three memory corruption issues were reported and also a couple of memory leakages. We manually debugged the issues to create fixes and report the issues upstream. The memory corruption issues were all heap-based read buffer overflows, where the heap-aspect comes from the harnesses allocating data on the heap. An interesting aspect for one of the discovered issues is that the project already had CodeQL running as part of its continuous integration workflow, however, CodeQL did not find the issue as reported by the automatically generated fuzzing set up.\n\nIn addition to the issues reported we also collected code coverage for the projects based on the coverage achieved from a 40 second run. The below table contains references to the 15 projects that we upstream for continuous fuzzing. These project integrations were all fully automatically generated, with the caveat that for some of the pull requests we made follow-up commits that only addressed cosmetic changes, such as beautifying the code and making the build scripts more lean.\n\n\n| Target GitHub repository    | Integration PR | Code coverage | Issues found and fixed |\n| ------------- | ------- | ------- | ------- |\n| https://github.com/memononen/nanosvg | [PR](https://github.com/google/oss-fuzz/pull/11944) | 41% | |\n| https://github.com/skeeto/pdjson | [PR](https://github.com/skeeto/pdjson/pull/33) | 78% | |\n| https://github.com/gregjesl/simpleson | [PR](https://github.com/gregjesl/simpleson/pull/40) | 35% | [PR](https://github.com/gregjesl/simpleson/pull/39) |\n| https://github.com/kgabis/parson | [PR](https://github.com/kgabis/parson/pull/214) | 42% | |\n| https://github.com/rafagafe/tiny-json | [PR](https://github.com/rafagafe/tiny-json/pull/18) | 85% | |\n| https://github.com/kosma/minmea | [PR](https://github.com/kosma/minmea/pull/79) | 37% | |\n| https://github.com/marcobambini/sqlite-createtable-parser | [PR](https://github.com/marcobambini/sqlite-createtable-parser/pull/5) | 14% | [PR](https://github.com/marcobambini/sqlite-createtable-parser/pull/6 ) |\n| https://github.com/benoitc/http-parser | [PR](https://github.com/benoitc/http-parser/pull/102) | 1.5% | [PR](https://github.com/benoitc/http-parser/pull/103 ) |\n| https://github.com/orangeduck/mpc | [PR](https://github.com/orangeduck/mpc/pull/169) | 49% | |\n| https://github.com/JiapengLi/lorawan-parser | [PR](https://github.com/JiapengLi/lorawan-parser/pull/17) | 11% | |\n| https://github.com/argtable/argtable3 | [PR](https://github.com/argtable/argtable3/pull/96) | 0.8% | |\n| https://github.com/h2o/picohttpparser | [PR](https://github.com/h2o/picohttpparser/pull/83) | 41% | |\n| https://github.com/ndevilla/iniparser | [PR](https://github.com/ndevilla/iniparser/pull/161) | 46% | |\n| https://github.com/codeplea/tinyexpr | [PR](https://github.com/codeplea/tinyexpr/pull/114) | 34% | | \n| https://github.com/vincenthz/libjson | [PR](https://github.com/vincenthz/libjson/pull/28) | 10% | |\n\n# Continuing the LLM harness synthesis loop\n\nThe LLM-based synthesis generation does not stop once a target project has integrated into OSS-Fuzz. In fact, at this point, the existing capabilities of OSS-Fuzz-gen will come into play and continuously, on a weekly basis, experiment with new harnesses for the target project that takes into account the project’s current coverage status on OSS-Fuzz. In particular, OSS-Fuzz-gen will analyze which are the most promising new targets for a given OSS-Fuzz project and use our extensive LLM-based harness synthesis to evaluate, test and run new harnesses for a given project. To this end, the synthesis will continue and improve as a given project is continuously fuzzed.\n\nThe [overall goal we’re working towards](https://security.googleblog.com/2023/08/ai-powered-fuzzing-breaking-bug-hunting.html) is to provide a fully automated solution to improve the security of projects with fuzzing, from the initial build integration, continuous fuzz harness generation, bug reporting and triage, and automatic patching.\n\n## Contribute to the efforts\n\nThe efforts described in this blog post are open sourced in [OSS-Fuzz-gen](https://github.com/google/oss-fuzz-gen/tree/main/experimental/c-cpp). We invite contributions, and would like to highlight specific efforts that will have a positive impact on our OSS-Fuzz from scratch generation:\n- Adding new build heuristics to enable compilation and fuzz introspector analysis of new projects. The key here is that any improvements in this context will open up analysis of new open source projects, and will ultimately be a positive sum outcome.\n- Adding additional prompt generators with a given example of success. The approach described in this blog runs each prompt generator without affecting the other prompt generation approaches, and because of this there is no need to worry of causing regressions in our existing prompt generators. As such, contributions are welcome for any new prompt generation approach that successfully creates harnesses for a project where the existing prompt generation approaches come short. We encourage the use of program analysis data from Fuzz Introspector in order to provide source code context.\n\n"
  },
  {
    "path": "infra/build/blog/content/posts/oss-fuzz-hello-world.md",
    "content": "+++\nauthors = [\"OSS-Fuzz Maintainers\"]\ntitle = \"OSS-Fuzz blog\"\ndate = \"2024-05-20\"\ndescription = \"Introduction to the OSS-Fuzz blog\"\ntags = [\n    \"fuzzing\",\n    \"blogging\",\n]\ncategories = [\n    \"introduction\",\n]\n+++\n\nWelcome to the new OSS-Fuzz blog! In this place we will publish feature\nupdates, research efforts and all-things OSS-Fuzz related.\n"
  },
  {
    "path": "infra/build/blog/content/posts/oss-fuzz-integrations-via-agent-based-build-generation.md",
    "content": "+++\nauthors = [\"OSS-Fuzz Maintainers\"]\ntitle = \"OSS-Fuzz integrations via agent-based build generation\"\ndate = \"2025-05-25\"\ndescription = \"OSS-Fuzz integrations via agent-based build generation.\"\ncategories = [\n    \"Fuzzing\",\n    \"Fuzzing synthesis\",\n    \"LLM\",\n    \"Automated fuzzing\",\n    \"Automated build script generation\",\n]\n+++\n\n\n# Introduction\n\nAs part of the [OSS-Fuzz-Gen](https://github.com/google/oss-fuzz-gen) project we have been working on making it easier for maintainers to integrate projects into OSS-Fuzz. Since OSS-Fuzz requires a specific build script in a format that uses the OSS-Fuzz build environment, the problem of automating OSS-Fuzz integrations is largely split in two parts: (1) creating a script for building the target project and relevant fuzzing harnesses and (2) creating the actual fuzzing harness. As such, any solution looking to automate OSS-Fuzz integrations must be able to solve both of these problems for a diverse set of open source projects.\n\nThe key goal for automating OSS-Fuzz integration is to support a full workflow that takes as input a project, e.g. GitHub repository, that is not integrated into OSS-Fuzz and outputs a generated OSS-Fuzz project with a working build script and one or more fuzzing harnesses. Furthermore, this workflow should be easily accessible and deployable, so open source maintainers can quickly leverage its features.\n\nThe primary focus of OSS-Fuzz-Gen has so far been on generating fuzzing harnesses for existing OSS-Fuzz projects. In a previous [blog post](https://blog.oss-fuzz.com/posts/introducing-llm-based-harness-synthesis-for-unfuzzed-projects/) we documented an end-to-end approach for OSS-Fuzz integrations, however, there were several significant limitations to this approach that meant it did not sufficiently solve the problems described above. Specifically, the build script generation was based on a template-based strategy and this had limitations in terms of being able to create build scripts for a diverse set of projects. In this blog post, we present two improvements towards an end-to-end OSS-Fuzz integration workflow:\n\n1) An agentic LLM-based approach for build script generation.\n2) A CLI tool making this easy to access and run.\n\n\n\n# Overview and sample run\n\nThe main goal of our approach is to automate the full end-to-end generation of an OSS-Fuzz project, by simply providing as input one or more Git repositories and then outputting a list of one or more OSS-Fuzz integrations. We expose these capabilities as a CLI in a Python package which makes it easy to install and run. To demonstrate the capabilities and give an intuition for the workflow, consider the below sample which generates an OSS-Fuzz project, including fuzzing harnesses, for [https://github.com/zserge/jsmn](https://github.com/zserge/jsmn). \n\n```sh\n# Prepare virtual environment\npython3.11 -m virtualenv .venv\n. .venv/bin/activate\n\n# Clone OSS-Fuzz-gen\ngit clone https://github.com/google/oss-fuzz-gen\ncd oss-fuzz-gen\n\n# Install OSS-Fuzz-gen\npython3 -m pip install .\n\n\n# Generate fuzzers for https://github.com/zserge/jsmn\necho \"https://github.com/zserge/jsmn\" > input.txt\n\n# Run the generation\n# Setup Vertex AI access: https://github.com/google/oss-fuzz-gen/blob/main/USAGE.md#llm-access\noss-fuzz-generator generate-full -i input.txt -m vertex_ai_gemini-2-flash-chat --agent -w work-1\n\n# List the files of generated project\n$ ls final-oss-fuzz-projects/jsmn-agent/\nbuild.sh  Dockerfile  empty-fuzzer.0.c  empty-fuzzer.1.c  project.yaml\n```\n\nThe first step is to install the Python package, which is currently done by cloning OSS-Fuzz-Gen and then installing it using `python -m pip install .`. The installed package includes a CLI tool `oss-fuzz-generator` which exposes the OSS-Fuzz project generation capabilities. The only step following this is to set up your LLM environment and use the `generate-full` command. This command will generate a build script as well as fuzzing harnesses, and also merge all successful fuzzing harness into one single OSS-Fuzz project.\n\nMore specifically, `oss-fuzz-generator generate-full` will perform three main steps for each of the repositories in the `input.txt` file:\n1) Generate a build script that will compile fuzzers of a given project\n2) If step 1 was successful, generate fuzzing harnesses for the project\n3) Merge successful fuzzing harnesses into a single OSS-Fuzz project\n\nIn this blog post, we will focus on step 1 above.\n\n\n# Agent-based build generation\n\nThe agent-based approach to generating build scripts rely on three central components. First, an initial prompt that outlines the overall task and constraints for creating build scripts for a given arbitrary repository. Second, an agent that communicates with the LLM and executes arbitrary commands, provided by the LLM, within the environment where the build script will be run, allowing the LLM to explore the runtime environment. Third, a process for running generated build scripts as well as executing generated fuzzers to guide the output from the LLM. The overall algorithm for the agentic build generation workflow is as follows:\n\n\n```\ninitial_prompt = prepare_initial_prompt(target_repository)\n\nprompt = prepare_initial_prompt(target_repository)\nllm_client = llm_start_chat()\nwhile should_keep_going():\n    llm_response = llm_client.chat(prompt)\n    res = parse_llm_response(llm_response)\n    if res.is_commands() {\n      output = execute_commands(res.get_commands());\n    }\n    else if (res.has_build_script()) {\n      output = build_and_run_fuzzer(res.get_build_script(), res.get_fuzz_harness());\n      if (output.has_successful_build_script()) {\n        // Success in harness generation\n        return output\n      }\n    }\n    else {\n      // Failure happened in parsing LLM output\n      exit()\n    }   \n\n    // Prepare a next prompt for the LLM to chat.\n    prompt = prepare_next_prompt(output);\n```\n\nThe algorithm returns a successful build script if the `return output` line is reached. Specifically, this line is reached when the LLM has created a build script with an accompanying fuzz harness that can successfully build and link against the code of the target repository.\n\nThere are four key functions in the build generation algorithm:\n\n- *parse_llm_response*: takes as input the raw text returned by the LLM and converts it into either (1) a list of commands to execute in the runtime environment where the fuzzers are build or (2) a build script with supplied fuzzing harness source code. The LLM is initially instructed in the prepare_initial_prompt to generate text that conforms to a given standard, such as by wrapping output in XML tags.\n- *execute_commands*: if the LLM returns a list of commands as determined by `parse_llm_response`, then this function executes these commands in the runtime environment in which the build script is to be run. The main point of this is that it enables the LLM to explore, understand and test the runtime environment. Results from running the commands are returned to the LLM and since the agent runs in a loop, the LLM can continuously issue commands, interpret the output and act accordingly.\n- *build_and_run_fuzzer*: if the LLM returns a build script and potentially a fuzzing harness (it may be empty) as determined by the `parse_llm_response`, then this function will build these artifacts in the runtime environment. The output of the build will be analysed, and, if a successful harness was built then the process is considered completed. In case the build was not successful, then the output of executing the build script is saved and will eventually be passed back to the LLM.\n- *prepare_next_prompt*: in the event that the iteration did not result in a successful build script, which can happen either if the LLM had returned a set of commands or the returned build script failed, the output of this will be used to construct a next prompt for the LLM. Specifically, we use the output from `execute_commands` and `build_and_run_fuzzer` as input to the next prompt. The prompt itself wraps around the output with a lightweight textual description. This prompt will then be used in the next agent iteration and passed to `llm_client.chat`.\n\n\nThe output of the above algorithm is upon success a build script that can produce a successful fuzzing harness. The next step is then to use this build script as the foundation of an OSS-Fuzz project, and use OSS-Fuzz-Gen’s core capabilities of generating fuzzing harnesses for an OSS-Fuzz project.\n\n# Empirical evaluation\n\nTo test our approach, we ran this on a set of GitHub repositories written in C/C++. In total we analysed 225 repositories which generated a total of 88 OSS-Fuzz integrations with valid build scripts. We furthermore ran the harness generation capabilities of OSS-Fuzz-Gen on these projects to confirm the validity of the build scripts. In this blog post we will focus on the results of the build generation and discuss bug-finding capabilities in a future blog post.\n\nWe found that the approach has many strengths in that it overcame hurdles posed by many of the projects, and that it’s able to create build scripts our template-based approach is not. In this section we will go through a few samples of the build scripts to highlight the capabilities and limitations of the approach.\n\n\n### Libcypher-parser\n\nTarget: [https://github.com/cleishm/libcypher-parser](https://github.com/cleishm/libcypher-parser)\n\nThe build script generated for this project is:\n\n```sh\n# Build script for libcypher-parser with fuzzing harness\n\n# Install necessary dependencies\napt-get update && apt-get install -y make autoconf automake libtool curl\n\n# Install autoconf 2.71\ncd /tmp\ncurl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz\ntar -xzf autoconf-2.71.tar.gz\ncd autoconf-2.71\n./configure\nmake\nmake install\n\n# Install leg tool\ncd /tmp\ncurl -L -O https://www.piumarta.com/software/peg/peg-0.1.18.tar.gz\ntar -xzf peg-0.1.18.tar.gz\ncd peg-0.1.18\nmake\nmake install\n\n# Build libcypher-parser\ncd $SRC/libcypher-parser\n./autogen.sh\n./configure --enable-static --disable-shared\nmake\n\n# Copy the static library to the output directory\ncp lib/src/.libs/libcypher-parser.a $OUT/\n\n# Compile the fuzzing harness\nfor fuzzer in $(find $SRC -maxdepth 1 -name 'empty-fuzzer.*'); do\n    fuzzer_basename=$(basename $fuzzer .c)\n    $CC $CFLAGS -I$SRC/libcypher-parser/lib/src $fuzzer -o $OUT/${fuzzer_basename} \\\n        -L$OUT -lcypher-parser -Wl,--whole-archive $LIB_FUZZING_ENGINE -Wl,--no-whole-archive\ndone\n```\n\nOverall, this is a fairly complex build in that it installs a version of autoconf different to what is already in the runtime environment and also a tool “peg”. In order to identify that the “leg”/”peg” tool is needed, the agent had to interpret the output of the building the project without this tool, as doing so leads to the following issue when configuring libcypher-parser:\n\n```sh\n...\nchecking for leg... no\nconfigure: error: leg is required: please install http://piumarta.com/software/peg/\nERROR:__main__:Building fuzzers failed.\n```\n\n\n### Yams\n\nTarget: [https://github.com/jpsim/Yams](https://github.com/jpsim/Yams)\n\nThe build script produced in this case is as follows:\n\n\n```sh\n#!/bin/bash\n# Set up build environment\ncd $SRC/Yams/Sources/CYaml\nmkdir -p build\ncd build\ncmake .. -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX\nmake\n\n# Compile the fuzzing harness\n$CC $CFLAGS -I$SRC/Yams/Sources/CYaml/include -I$SRC $SRC/empty-fuzzer.c -o $OUT/empty-fuzzer -L. -Wl,--whole-archive libCYaml.a -Wl,--no-whole-archive $LIB_FUZZING_ENGINE\n```\n\nThe build script is a simple cmake build script, but it passes arguments to the cmake command to ensure the target builds with the commands as specified by the OSS-Fuzz runtime environment. Interestingly, the building and linking of the fuzz harness in this context is not done in a loop. This works in principle, in that the project is able to build and link a fuzzing harness, but is limited in that it is unable to build and link and arbitrary number of fuzzing harnesses.\n\n\n### Moment\n\nTarget: [https://github.com/kmussel/Moment](https://github.com/kmussel/Moment)\n\nThis is a library that has not been active for 10 years, so a particular challenge of this project is building a potentially old project. The build script generated is the following:\n\n```sh\n#!/bin/bash\n# Install necessary tools\napt-get update && apt-get install -y bison flex\n\n# Set source and output directories\nSRC_DIR=\"$SRC/Moment\"\nOUT_DIR=\"$OUT\"\n\n# Preprocess parseIt.ym to remove the Foundation import\nsed '/#import <Foundation\\/Foundation.h>/d' $SRC_DIR/parseIt.ym > $SRC_DIR/parseIt_preprocessed.ym\n\n# Use bison to generate parseIt.c and y.tab.h\nbison -d -o $SRC_DIR/parseIt.c $SRC_DIR/parseIt_preprocessed.ym\n\n# Rename the generated header to y.tab.h\nmv $SRC_DIR/parseIt.h $SRC_DIR/y.tab.h\n\n# Use flex to generate tokeIt.c\nflex -o $SRC_DIR/tokeIt.c $SRC_DIR/tokeIt.l\n\n# Compile the source files into object files\n$CC $CFLAGS -c $SRC_DIR/TimeParser.c -o TimeParser.o\n$CC $CFLAGS -c $SRC_DIR/parseIt.c -o parseIt.o\n$CC $CFLAGS -I$SRC_DIR -c $SRC_DIR/tokeIt.c -o tokeIt.o\n\n# Archive the object files into a static library\nllvm-ar rcs libmoment.a TimeParser.o parseIt.o tokeIt.o\n\n# Compile the fuzzing harness and link with the static library\n$CC $CFLAGS -I$SRC_DIR $SRC/empty-fuzzer.c -o $OUT_DIR/empty-fuzzer -L. libmoment.a $LIB_FUZZING_ENGINE\n```\n\nSimilar to libcypher-parser above, the impressive parts of this build script is the complexity of it, and the ability to download and install custom packages, and using the tools of these packages as part of the build script process. The build script adjusts a file in the target project using `sed` and runs several tools, bison and flex, to generate code needed for the compilation. Furthermore, the project itself does not have any build system files, e.g. `Makefile` and consequently the build agent reverts to compiling the source files directly.\n\n\n# Limitations and future work\n\nDuring our empirical evaluation we observed several limitations and possible improvements.\n\n### Build scripts that succeed but avoid target source code\nWe observed several cases where the agent produces build scripts that simply avoid building the target source code and just end up building an empty fuzzing harness. The problem is that the approach currently does not do post-processing analysis on the generated harness in terms of validating that the target source code is part of the resulting binary. The problem in this case is that when the process moves on to harness generation, then the build script is not able to support the workflow because no building of the target source code is involved. Although this was a rare occurrence, a required solution is to have more rigorous post processing to validate the completeness of the build script generated, or the ability to adjust later in the end-to-end workflow.\n\n### Build scripts that can only build a single fuzzing harness\nThe approach instructs the LLMs to generate build scripts that can build an arbitrary number of fuzzing harnesses. This is to make it possible to use the build script for building and linking any number of fuzzing harnesses that the harness-generation part of OSS-Fuzz-gen produces. It is likely OSS-Fuzz-gen will end up producing more than one valuable fuzzing harness, and the build script should be able to build them all at the same time. We observed that this constraint is not always accepted and some build scripts end up with the capability of only building a single fuzzing harness, e.g. due to lack of a loop in the build instructions. The problem in this case is that the user of the tool will have to adjust the build script such that it can build an arbitrary number of fuzzing harnesses, assuming that two or more fuzzing harnesses are needed for the final OSS-Fuzz integration.\n\n### Integrating into target codebase’s build configurations\nThe current approach often yields build scripts that explicitly link fuzzing harnesses using CXX or CC environment variables to link against static libraries built earlier in the build script. As such, the build scripts are composed of a set of commands as well as a fuzzing harness source code. Another approach would be to integrate the building of the fuzzers into the build system of the target repository, such as by extending Makefiles and alike. Although this won’t have any practical difference as such, it may make the approach more friendly towards developers.\n\n### Diagnosis and conclusions on failed generation\nIn the case where the build script generation failed, there is at the moment no real explanation as to why it failed. An extension to the workflow is to have another agent or similar, that analyse the reason why the build failed. For example, it is valuable to know if the reason for failing is a hard reason such as the code cannot be compiled in the relevant build runtime, or whether the LLM simply wasn’t capable of finding a proper solution. In case the reason is a hard reason, that is in a sense a positive conclusion since it can explicitly tell the user that the target project is not compatible with OSS-Fuzz (such as, if it’s a Windows-only project).\n\n# Conclusion\n\nIn this blog post we have introduced a new capability of [OSS-Fuzz-Gen](https://github.com/google/oss-fuzz-gen) for producing OSS-Fuzz project integrations from scratch via an agent-based approach to build script generation. This is available through a CLI tool and only a single command is required for generating an OSS-Fuzz project. We ran the approach against a set of 225 projects which resulted in 88 OSS-Fuzz build scripts, and to highlight the capabilities we went through a set of these as well as identified limitations and future work.\n\nThe tooling is available on GitHub at [https://github.com/google/oss-fuzz-gen/tree/main/experimental/end_to_end](https://github.com/google/oss-fuzz-gen/tree/main/experimental/end_to_end) and we encourage users to try and run the tooling on their projects of interest. We are always happy to hear about projects where the build generation is not working and welcome users to submit this information as GitHub issues in the above repository."
  },
  {
    "path": "infra/build/blog/hugo.toml",
    "content": "seURL = ''\nlanguageCode = 'en-us'\ntitle = 'OSS-Fuzz blog'\ntheme = 'hugo-coder'\n\nlanguagecode = \"en\"\ndefaultcontentlanguage = \"en\"\n\npaginate = 20\n\n[markup.highlight]\nstyle = \"github-dark\"\n\n[params]\n  info = \"Fuzzing Open Source Software at Scale\"\n  description = \"OSS-Fuzz fuzzing blog\"\n  keywords = \"fuzzing, vulnerability research, open source, security\"\n  avatarurl = \"images/oss-fuzz-logo.png\"\n\n  faviconSVG = \"/img/favicon.svg\"\n  favicon_32 = \"/img/favicon-32x32.png\"\n  favicon_16 = \"/img/favicon-16x16.png\"\n\n  since = 2024\n\n  enableTwemoji = true\n\n  colorScheme = \"auto\"\n  hidecolorschemetoggle = false\n\n[taxonomies]\n  category = \"categories\"\n  series = \"series\"\n  tag = \"tags\"\n  author = \"authors\"\n\n# Social links\n[[params.social]]\n  name = \"Github\"\n  icon = \"fa-brands fa-github fa-2x\"\n  weight = 1\n  url = \"https://github.com/google/oss-fuzz\"\n\n# Menu links\n[[menu.main]]\n  name = \"Blog\"\n  weight = 1\n  url  = \"posts/\"\n[[menu.main]]\n  name = \"About\"\n  weight = 2\n  url = \"about/\"\n"
  },
  {
    "path": "infra/build/build_status/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-runner\n\nRUN mkdir -p /opt/oss-fuzz/infra/build_status\nCOPY infra/build/functions/* /opt/oss-fuzz/infra/build_status/\nCOPY infra/build/build_status/* /opt/oss-fuzz/infra/build_status/\nRUN pip3 install -r /opt/oss-fuzz/infra/build_status/requirements.txt\n\nENTRYPOINT [ \"python3\", \"/opt/oss-fuzz/infra/build_status/update_build_status.py\" ]\n"
  },
  {
    "path": "infra/build/build_status/cloudbuild.yaml",
    "content": "steps:\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/build-status\n  - '-f'\n  - infra/build/build_status/Dockerfile\n  - .\n- name: 'gcr.io/oss-fuzz-base/build-status'\n  args: []\n  timeout: 14400s\noptions:\n  logging: CLOUD_LOGGING_ONLY\ntimeout: 14400s\n"
  },
  {
    "path": "infra/build/build_status/fuzz_introspector_page_gen.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Logic to create Fuzz Introspector overview page.\"\"\"\nimport json\n\nfrom urllib.request import urlopen\nfrom bs4 import BeautifulSoup\n\nTABLE_HEAD = \"\"\"<table id=\"mainTable\">\n<thead>\n            <tr>\n      <th title=\"Fuzzer key. Usually fuzzer executable file\">\n       Project Report\n      </th>\n      <th title=\"Number of fuzz targets for the project.\">\n       Fuzz target count\n      </th>\n      <th title=\"Percentage of code statially reachable from the fuzzers.\">\n       Code statically reached\n      </th>\n      <th title=\"Percentage of code currently covered at runtime.\">\n       Code covered at runtime\n      </th>\n     </tr>\n    </thead>\n<tbody>\"\"\"\n\nTABLE_END = \"\"\"</tbody>\n</table>\"\"\"\n\nFUZZ_INTROSPECTOR_HTML_TOP = \"\"\"<html>\n<head>\n\t<style>\n\t\tbody {\n\t\t\tbackground: #EBEDEE;\n\t\t\tfont-family: \"Roboto\", sans-serif;\n\t\t\tmargin: 0px;\n\t\t}\n\t\t.main-div {\n\t\t\tpadding: 20px;\t\t\t\n\t\t}\n\t\t.table-wrapper {\n\t\t\tbackground: white;\n\t\t\theight: calc(100% - 190px);\n\t\t\tpadding: 40px\n\t\t}\n\t\t.top-navbar {\n\t\t\theight: 70px;\n\t\t\tbackground:  #222;\n\t\t\tdisplay: flex;\n\t\t\tposition: relative;\n\t\t\tcolor: white;\n\t\t\talign-items: center;\n\t\t\t/*justify-content: center;*/\n\t\t\tpadding-left: 20px;\n\t\t}\n\t\tthead {\n\t\t\tbackground: #393f43;\n\t\t\tcolor: white;\n\t\t}\n\t\tinput[type=search] {\n\t\t\tmin-height: 38.58px;\n\t\t}\n\t\t#mainTable_filter {\n\t\t\tmargin-bottom: 5px;\n\t\t}\n\t\ttable.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td {\n\t\t\tborder:  none!important;\n\t\t\tmax-width:  300px;\n\t\t\tword-wrap: break-word;\n\t\t\tfont-size:  .8rem;\n\t\t\tfont-weight:  700;\n\t\t}\n\t\ttable.dataTable.stripe tbody tr.odd, table tbody tr.odd {\n\t\t\tbackground: #fafafa !important;\n\t\t}\n\t\ttable.dataTable tbody th, table.dataTable tbody td {\n\t\t\tfont-size: .9rem !important;\n\t\t\tborder-top: 1px solid #eee !important;\n\t\t\tborder-right: 1px solid #eee !important;\n\t\t\tpadding: 0.8em !important;\n\t\t}\n\t\ttable.dataTable tbody tr.odd:hover,\n\t\ttable.dataTable tbody tr.even:hover {\n\t\t\tbackground: #d6e9f8!important;\n\t\t}\n\t\t.dataTables_filter {\n\t\t\tfloat:  left!important;\n\t\t\ttext-align: left!important;\n\t\t\tmargin-left:  20px;\n\t\t}\n\t\t.dataTables_paginate.paging_simple_numbers {\n\t\t\tfloat: left!important;\n\t\t}\n\t\t.dataTables_wrapper .dataTables_info {\n\t\t\tfloat: none!important;\n\t\t}\n\t\t.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing, .dataTables_wrapper .dataTables_paginate {\n\t\t\tcolor: #adadad;\n\t\t\tfont-size: .95rem;\n\t\t}\n\t\t.dataTables_wrapper .dataTables_paginate .paginate_button {\n\t\t\tcolor: #8a8a8a!important;\n\t\t\tpadding: 0!important;\n\t\t\tbackground: none !important;\n\t\t\tborder: none !important;\n\t\t}\n\t</style>\n</head>\n<body>\n\t<script crossorigin=\"anonymous\" integrity=\"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=\" src=\"https://code.jquery.com/jquery-3.6.0.min.js\"></script>\n  <script src=\"https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js\"></script>\n  <link href=\"https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css\" rel=\"stylesheet\"/>\n\n  <div class=\"top-navbar\">\n   <div class=\"top-navbar-title-wrapper\">\n    <div class=\"top-navbar-title\" style=\"margin-bottom: 10px; font-size:25px\">\n      Fuzzer introspection of OSS-Fuzz projects\n    </div>\n    <div style=\"margin:0; font-size: 10px\">\n     For issues and ideas:\n     <a href=\"https://github.com/ossf/fuzz-introspector/issues\" style=\"color:#FFFFFF;\">\n      https://github.com/ossf/fuzz-introspector/issues\n     </a>\n    </div>\n   </div>\n  </div>\n  <div class=\"main-div\">\n  \t<div>\n      <b>Fuzz Introspector documentation:</b><a href=\"https://fuzz-introspector.readthedocs.io/en/latest/\">https://fuzz-introspector.readthedocs.io/en/latest/</a>\n      <br>\n      <b>Fuzz Introspector repository:</b><a href=\"https://github.com/ossf/fuzz-introspector\">https://github.com/ossf/fuzz-introspector</a>\n  \t</div>\n\t<div class=\"table-wrapper\">\"\"\"\n\nFUZZ_INTROSPECTOR_HTML_BOTTOM = \"\"\"</div>\n</div>\n\t<script>\n\t\t$(document).ready( function () {\n\t\t  // Get number of rows in this table\n\t\t  var rowCount = $('#mainTable tr').length;\n\t\t  var sortByColumn = $('#mainTable').data('sort-by-column');\n\t\t  var sortOrder = $('#mainTable').data('sort-order');\n\t\t  \n\n\t\t  var bPaginate;\n\t\t  var bLengthChange;\n\t\t  var bInfo;\n\t\t  var bFilter;\n\n\t\t  /*if(rowCount<6) {\n\t\t    bFilter = false;\n\t\t  } else {\n\t\t    bFilter = true;\n\t\t  }*/\n\t\t    bFilter = true;   \n\t\t    bPaginate = true;\n\t\t    bLengthChange = true;\n\t\t    bInfo = true;\n\n\t\t  var tableConfig = {'bPaginate': bPaginate,\n\t\t                      'bLengthChange': bLengthChange,\n\t\t                      'bInfo': bInfo,\n\t\t                      'bFilter': bFilter,\n\t\t                      'pageLength': 1000,\n\t\t                      'autoWidth': false,\n\t\t                      /*dom:            \"Bfrtip\",*/\n\t\t                      paging: true, \n\t\t                      scrollCollapse: true,\n\t\t                      buttons:        [ {\n\t\t                        extend: 'colvis',\n\t\t                        text: \"Columns\"\n\t\t                        },\n\t\t                        {\n\t\t                          extend: \"pageLength\",\n\t\t                          text: \"Rows\"\n\t\t                        }],\n\t\t                      fixedColumns:   {\n\t\t                          left: 2\n\t\t                      }\n\t\t                    }\n\t\t  var language = {\"lengthMenu\": \"_MENU_ per page\",\n\t\t                  \"searchPlaceholder\": \"Search table\",\n\t\t                  \"search\": \"_INPUT_\"}\n\t\t  tableConfig.language = language;\n\t\t    $('#mainTable').DataTable(tableConfig);\n} );\n</script>\n</body>\n</html>\"\"\"\n\n\ndef refine_percentage_string(percentage_string):\n  \"\"\"Shortens a srting to 4 characters and prepends zeros if necessary.\n  We need to prepend the zero to make sorting in the final table accurrate.\n  \"\"\"\n  percentage_string = percentage_string.replace(\"%\", \"\")\n  if len(percentage_string.split(\".\")[0]) == 1:\n    percentage_string = \"0\" + percentage_string\n\n  if len(percentage_string) > 5:\n    percentage_string = percentage_string[:5]\n\n  # Check if the percentage is withing range of [0.0 : 100.0]\n  # Some old reports from 2022 have deprecated data, which we do not want to\n  # display.\n  float_val = float(percentage_string)\n  if float_val < 0.0 or float_val > 100.0:\n    # Raise exception to make the code display '-' elements.\n    raise Exception('Out of range numbers')\n\n  return percentage_string + \"%\"\n\n\ndef fetch_fuzz_introspector_summary(report_url):\n  \"\"\"Given a URL to an introspector report, returns a dictionary with data\n  from the report. This includes, fuzzer count, reachability and code\n  coverage.\n  \"\"\"\n  # Extract json summary file.\n  summary_url = report_url.replace('fuzz_report.html', 'summary.json')\n  response = urlopen(summary_url)\n  json_data = json.loads(response.read())\n\n  # 1) Extract fuzzer count. This corresponds to all but two elements at the\n  # top level of the dictionary.\n  fuzzer_count = len(json_data) - 2\n\n  # 2) Extract reachability count.\n  reached_stats = \"0.0%\"\n  if 'MergedProjectProfile' in json_data:\n    if 'stats' in json_data['MergedProjectProfile']:\n      merged_profile = json_data['MergedProjectProfile']\n      reached_stats = merged_profile['stats']['reached-complexity-percentage']\n\n  reached_stats = refine_percentage_string(str(reached_stats))\n\n  # Extract code coverage stats.\n  # Momentarily, we will get this from the HTML page because it's not yet\n  # in the summary.json. This will change in the near future, but in the\n  # spirit of time we keep it like this for now.\n  fuzz_report_html = urlopen(report_url).read()\n  soup = BeautifulSoup(fuzz_report_html, 'html.parser')\n  target_divs = soup.findAll('text', {'class': 'percentage'})\n\n  # The code coverage is the third instance of this text class.\n  raw_code_coverage = target_divs[2].string.strip()\n  code_coverage = refine_percentage_string(raw_code_coverage)\n\n  return {\n      'fuzzer_count': fuzzer_count,\n      'project_complexity_reached': reached_stats,\n      'code_coverage': code_coverage\n  }\n\n\ndef get_fuzzer_introspector_project_summary(report_url):\n  \"\"\"Return dictionary containing summary of fuzz introspector project.\"\"\"\n  try:\n    results_dict = fetch_fuzz_introspector_summary(report_url)\n  except Exception:  # pylint: disable=broad-except\n    results_dict = {\n        'fuzzer_count': '-',\n        'project_complexity_reached': '-',\n        'code_coverage': '-'\n    }\n  return results_dict\n\n\ndef get_fuzz_introspector_row(project, report_url):\n  \"\"\"Creates a single row in the Fuzz Introspector HTML table.\"\"\"\n  project_summary = get_fuzzer_introspector_project_summary(report_url)\n  return (\"<tr>\"\n          f\"<td><a href='{report_url}'>{project}</a></td>\"\n          f\"<td>{project_summary['fuzzer_count']}</td>\"\n          f\"<td>{project_summary['project_complexity_reached']}</td>\"\n          f\"<td>{project_summary['code_coverage']}</td>\"\n          \"</tr>\\n\")\n\n\ndef create_introspector_overview_table(fuzz_introspector_index):\n  \"\"\"Creates a HTML table with Fuzz Introspector summary for each project.\"\"\"\n  all_rows = \"\"\n  for project_name in fuzz_introspector_index:\n    report_url = fuzz_introspector_index[project_name]\n    all_rows += get_fuzz_introspector_row(project_name, report_url)\n  return TABLE_HEAD + all_rows + TABLE_END\n\n\ndef get_fuzz_introspector_html_page(fuzz_introspector_index):\n  \"\"\"Creates a HTML page as a string displaying Fuzz Introspector overview.\"\"\"\n  html_table = create_introspector_overview_table(fuzz_introspector_index)\n  return (FUZZ_INTROSPECTOR_HTML_TOP + html_table +\n          FUZZ_INTROSPECTOR_HTML_BOTTOM)\n"
  },
  {
    "path": "infra/build/build_status/update_build_status.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud function to request builds.\"\"\"\nimport concurrent.futures\nimport logging\nimport json\nimport sys\nimport os\n\nimport google.auth\nfrom googleapiclient.discovery import build\nimport googleapiclient.errors\nfrom google.cloud import ndb\nfrom google.cloud import storage\nimport yaml\n\nimport build_and_run_coverage\nimport build_lib\nimport build_project\nimport datastore_entities\nimport fuzz_introspector_page_gen\n\nBADGE_DIR = 'badge_images'\nBADGE_IMAGE_TYPES = {'svg': 'image/svg+xml', 'png': 'image/png'}\nDESTINATION_BADGE_DIR = 'badges'\nMAX_BUILD_LOGS = 7\n\nSTATUS_BUCKET = 'oss-fuzz-build-logs'\nINTROSPECTOR_BUCKET = 'oss-fuzz-introspector'\nINTROSPECTOR_BUCKET_URL = 'https://storage.googleapis.com/oss-fuzz-introspector'\nINTROSPECTOR_DOC_URL = 'https://fuzz-introspector.readthedocs.io/en/latest/'\nINTROSPECTOR_INDEX_JSON = 'build_status.json'\nINTROSPECTOR_INDEX_HTML = 'index.html'\n\nFUZZING_STATUS_FILENAME = 'status.json'\nCOVERAGE_STATUS_FILENAME = 'status-coverage.json'\nINTROSPECTOR_STATUS_FILENAME = 'status-introspector.json'\n\n# pylint: disable=invalid-name\n_client = None\n\nlogging.basicConfig(level=logging.INFO)\n\n\n# pylint: disable=global-statement\ndef get_storage_client():\n  \"\"\"Return storage client.\"\"\"\n  global _client\n  if not _client:\n    _client = storage.Client()\n\n  return _client\n\n\ndef is_build_successful(build_obj):\n  \"\"\"Check build success.\"\"\"\n  return build_obj['status'] == 'SUCCESS'\n\n\ndef upload_status(data, status_filename):\n  \"\"\"Upload json file to cloud storage.\"\"\"\n  bucket = get_storage_client().get_bucket(STATUS_BUCKET)\n  blob = bucket.blob(status_filename)\n  blob.cache_control = 'no-cache'\n  blob.upload_from_string(json.dumps(data), content_type='application/json')\n\n\ndef sort_projects(projects):\n  \"\"\"Sort projects in order Failures, Successes, Not yet built.\"\"\"\n\n  def key_func(project):\n    if not project['history']:\n      return 2  # Order projects without history last.\n\n    if project['history'][0]['success']:\n      # Successful builds come second.\n      return 1\n\n    # Build failures come first.\n    return 0\n\n  projects.sort(key=key_func)\n\n\ndef update_last_successful_build(project, build_tag):\n  \"\"\"Update last successful build.\"\"\"\n  last_successful_build = ndb.Key(datastore_entities.LastSuccessfulBuild,\n                                  project['name'] + '-' + build_tag).get()\n  if not last_successful_build and 'last_successful_build' not in project:\n    return\n\n  if 'last_successful_build' not in project:\n    project['last_successful_build'] = {\n        'build_id': last_successful_build.build_id,\n        'finish_time': last_successful_build.finish_time\n    }\n  else:\n    if last_successful_build:\n      last_successful_build.build_id = project['last_successful_build'][\n          'build_id']\n      last_successful_build.finish_time = project['last_successful_build'][\n          'finish_time']\n    else:\n      last_successful_build = datastore_entities.LastSuccessfulBuild(\n          id=project['name'] + '-' + build_tag,\n          project=project['name'],\n          build_id=project['last_successful_build']['build_id'],\n          finish_time=project['last_successful_build']['finish_time'])\n    last_successful_build.put()\n\n\nclass BuildGetter:  # pylint: disable=too-few-public-methods\n  \"\"\"Class for getting builds. This is a hack because builds were previously run\n  in the global region while builds going forward have been run in us-central1.\n  This class will try looking for the build from the global region, until that\n  fails, at which point it will look for builds in the us-central1 region.\"\"\"\n\n  def __init__(self):\n    self._credentials, self._image_project = google.auth.default()\n    self._global_cloudbuild = build('cloudbuild',\n                                    'v1',\n                                    credentials=self._credentials,\n                                    cache_discovery=False)\n    self._central_cloudbuild = build(\n        'cloudbuild',\n        'v1',\n        credentials=self._credentials,\n        cache_discovery=False,\n        client_options=build_lib.REGIONAL_CLIENT_OPTIONS)\n    self._cloudbuilds = [self._global_cloudbuild, self._central_cloudbuild]\n    self._swapped = False\n\n  def _swap_cloudbuild_order_once(self):\n    \"\"\"Swap the region order after one failure since the global build region was\n    first used before being switched to us-central1.\"\"\"\n    if self._swapped:\n      return\n    new_last, new_first = self._cloudbuilds\n    self._cloudbuilds = [new_first, new_last]\n    self._swapped = True\n\n  def get_build(self, build_id):\n    \"\"\"Get the build from global or us-central1 region.\"\"\"\n    for cloudbuild in self._cloudbuilds[:]:\n      try:\n        return cloudbuild.projects().builds().get(projectId=self._image_project,\n                                                  id=build_id).execute()\n      except googleapiclient.errors.HttpError:\n        self._swap_cloudbuild_order_once()\n        continue\n    assert None\n\n\n# pylint: disable=no-member\ndef get_build_history(build_ids):\n  \"\"\"Returns build object for the last finished build of project.\"\"\"\n\n  build_getter = BuildGetter()\n\n  history = []\n  last_successful_build = None\n\n  for build_id in reversed(build_ids):\n    project_build = build_getter.get_build(build_id)\n    if project_build['status'] not in ('SUCCESS', 'FAILURE', 'TIMEOUT'):\n      continue\n\n    if (not last_successful_build and is_build_successful(project_build)):\n      last_successful_build = {\n          'build_id': build_id,\n          'finish_time': project_build['finishTime'],\n      }\n\n    if not upload_log(build_id):\n      log_name = f'log-{build_id}'\n      logging.error('Missing build log file %s', log_name)\n      continue\n\n    history.append({\n        'build_id': build_id,\n        'finish_time': project_build['finishTime'],\n        'success': is_build_successful(project_build)\n    })\n\n    if len(history) == MAX_BUILD_LOGS:\n      break\n\n  project = {'history': history}\n  if last_successful_build:\n    project['last_successful_build'] = last_successful_build\n  return project\n\n\ndef _get_main_repo(project_name):\n  \"\"\"Get the main repo for a project.\"\"\"\n  project = datastore_entities.Project.query(\n      datastore_entities.Project.name == project_name).get()\n  if not project:\n    return None\n\n  project_yaml = yaml.safe_load(project.project_yaml_contents)\n  return project_yaml.get('main_repo')\n\n\n# pylint: disable=too-many-locals\ndef update_build_status(build_tag, status_filename):\n  \"\"\"Update build statuses.\"\"\"\n  projects = []\n\n  def process_project(project_build):\n    \"\"\"Process a project.\"\"\"\n    # We need a new context for every thread.\n    with ndb.Client().context():\n      project = get_build_history(project_build.build_ids)\n      project['name'] = project_build.project\n      project['main_repo'] = _get_main_repo(project_build.project)\n      print('Processing project', project['name'])\n      return project\n\n  with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:\n    futures = []\n    for project_build in datastore_entities.BuildsHistory.query(\n        datastore_entities.BuildsHistory.build_tag == build_tag).order(\n            'project'):\n      futures.append(executor.submit(process_project, project_build))\n\n    for future in concurrent.futures.as_completed(futures):\n      project = future.result()\n      update_last_successful_build(project, build_tag)\n      projects.append(project)\n\n  sort_projects(projects)\n  data = {'projects': projects}\n  upload_status(data, status_filename)\n\n\ndef update_build_badges(project, last_build_successful,\n                        last_coverage_build_successful):\n  \"\"\"Upload badges of given project.\"\"\"\n  badge = 'building'\n  # last_coverage_build_successful is False if there was an unsuccessful build\n  # and None if the target does not support coverage (e.g. Python or Java\n  # targets).\n  if last_coverage_build_successful is False:\n    badge = 'coverage_failing'\n  if not last_build_successful:\n    badge = 'failing'\n\n  print(f'[badge] {project}: {badge}')\n\n  for extension in BADGE_IMAGE_TYPES:\n    badge_name = f'{badge}.{extension}'\n\n    # Copy blob from badge_images/badge_name to badges/project/\n    blob_name = f'{BADGE_DIR}/{badge_name}'\n\n    destination_blob_name = f'{DESTINATION_BADGE_DIR}/{project}.{extension}'\n\n    status_bucket = get_storage_client().get_bucket(STATUS_BUCKET)\n    badge_blob = status_bucket.blob(blob_name)\n    status_bucket.copy_blob(badge_blob,\n                            status_bucket,\n                            new_name=destination_blob_name)\n\n\ndef upload_log(build_id):\n  \"\"\"Upload log file to GCS.\"\"\"\n  status_bucket = get_storage_client().get_bucket(STATUS_BUCKET)\n  gcb_bucket = get_storage_client().get_bucket(build_project.GCB_LOGS_BUCKET)\n  log_name = f'log-{build_id}.txt'\n  log = gcb_bucket.blob(log_name)\n  dest_log = status_bucket.blob(log_name)\n\n  if not log.exists():\n    print('Failed to find build log', log_name, file=sys.stderr)\n    return False\n\n  if dest_log.exists():\n    return True\n\n  gcb_bucket.copy_blob(log, status_bucket)\n  return True\n\n\ndef load_status_from_gcs(filename):\n  \"\"\"Load statuses from bucket.\"\"\"\n  status_bucket = get_storage_client().get_bucket(STATUS_BUCKET)\n  status = json.loads(status_bucket.blob(filename).download_as_string())\n  result = {}\n\n  for project in status['projects']:\n    if project['history']:\n      result[project['name']] = project['history'][0]['success']\n\n  return result\n\n\ndef update_badges():\n  \"\"\"Update badges.\"\"\"\n  project_build_statuses = load_status_from_gcs(FUZZING_STATUS_FILENAME)\n  coverage_build_statuses = load_status_from_gcs(COVERAGE_STATUS_FILENAME)\n\n  with concurrent.futures.ThreadPoolExecutor(max_workers=32) as executor:\n    futures = []\n    for project in datastore_entities.Project.query():\n      if project.name not in project_build_statuses:\n        continue\n      # Certain projects (e.g. JVM and Python) do not have any coverage\n      # builds, but should still receive a badge.\n      coverage_build_status = None\n      if project.name in coverage_build_statuses:\n        coverage_build_status = coverage_build_statuses[project.name]\n\n      futures.append(\n          executor.submit(update_build_badges, project.name,\n                          project_build_statuses[project.name],\n                          coverage_build_status))\n    concurrent.futures.wait(futures)\n\n\ndef upload_index(json_index, html_string):\n  \"\"\"Upload json and html file to introspector bucket.\"\"\"\n  introspector_bucket = get_storage_client().get_bucket(INTROSPECTOR_BUCKET)\n  json_blob = introspector_bucket.blob(INTROSPECTOR_INDEX_JSON)\n  html_blob = introspector_bucket.blob(INTROSPECTOR_INDEX_HTML)\n\n  json_blob.cache_control = 'no-cache'\n  json_blob.upload_from_string(json.dumps(json_index),\n                               content_type='application/json')\n\n  html_blob.cache_control = 'no-cache'\n  html_blob.upload_from_string(html_string, content_type='text/html')\n\n\ndef generate_introspector_index():\n  \"\"\"Generate index.html for successful Fuzz Introspector projects\"\"\"\n  status_bucket = get_storage_client().get_bucket(STATUS_BUCKET)\n  status = json.loads(\n      status_bucket.blob(INTROSPECTOR_STATUS_FILENAME).download_as_string())\n\n  introspector_bucket = get_storage_client().get_bucket(INTROSPECTOR_BUCKET)\n  index_blob = introspector_bucket.blob(INTROSPECTOR_INDEX_JSON)\n  if index_blob.exists():\n    introspector_index = json.loads(index_blob.download_as_string())\n  else:\n    introspector_index = {}\n\n  for project in status['projects']:\n    if project['history'] and project['history'][0]['success']:\n      project_name = project['name']\n      build_date = project['history'][0]['finish_time'].split('T')[0].replace(\n          '-', '')\n      introspector_index[project_name] = os.path.join(INTROSPECTOR_BUCKET_URL,\n                                                      project_name,\n                                                      'inspector-report',\n                                                      build_date,\n                                                      'fuzz_report.html')\n\n  html_string = fuzz_introspector_page_gen.get_fuzz_introspector_html_page(\n      introspector_index)\n  upload_index(introspector_index, html_string)\n\n\ndef main():\n  \"\"\"Entry point for cloudbuild\"\"\"\n  with ndb.Client().context():\n    configs = ((build_project.FUZZING_BUILD_TYPE, FUZZING_STATUS_FILENAME),\n               (build_and_run_coverage.COVERAGE_BUILD_TYPE,\n                COVERAGE_STATUS_FILENAME),\n               (build_and_run_coverage.INTROSPECTOR_BUILD_TYPE,\n                INTROSPECTOR_STATUS_FILENAME))\n\n    for tag, filename in configs:\n      update_build_status(tag, filename)\n\n    update_badges()\n    generate_introspector_index()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/build/build_status/update_build_status_test.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unit tests for Cloud Function update builds status.\"\"\"\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\nfrom google.cloud import ndb\n\nsys.path.append(os.path.dirname(__file__))\n# pylint: disable=wrong-import-position\n\nimport datastore_entities\nimport test_utils\nimport update_build_status\n\n# pylint: disable=no-member\n\n\n# pylint: disable=too-few-public-methods\nclass MockGetBuild:\n  \"\"\"Spoofing get_builds function.\"\"\"\n\n  def __init__(self, builds):\n    self.builds = builds\n\n  def get_build(self, build_id):\n    \"\"\"Mimic build object retrieval.\"\"\"\n    for build in self.builds:\n      if build['build_id'] == build_id:\n        return build\n\n    return None\n\n\n@mock.patch('google.auth.default', return_value=['temp', 'temp'])\n@mock.patch('update_build_status.build', return_value='cloudbuild')\n@mock.patch('update_build_status.upload_log')\nclass TestGetBuildHistory(unittest.TestCase):\n  \"\"\"Unit tests for get_build_history.\"\"\"\n\n  def test_get_build_history(self, mock_upload_log, mock_cloud_build,\n                             mock_google_auth):\n    \"\"\"Test for get_build_steps.\"\"\"\n    del mock_cloud_build, mock_google_auth\n    mock_upload_log.return_value = True\n    builds = [{'build_id': '1', 'finishTime': 'test_time', 'status': 'SUCCESS'}]\n    mock_get_build = MockGetBuild(builds)\n    update_build_status.BuildGetter.get_build = mock_get_build.get_build\n\n    expected_projects = {\n        'history': [{\n            'build_id': '1',\n            'finish_time': 'test_time',\n            'success': True\n        }],\n        'last_successful_build': {\n            'build_id': '1',\n            'finish_time': 'test_time'\n        }\n    }\n    self.assertDictEqual(update_build_status.get_build_history(['1']),\n                         expected_projects)\n\n  def test_get_build_history_no_last_success(self, mock_upload_log,\n                                             mock_cloud_build,\n                                             mock_google_auth):\n    \"\"\"Test when there is no last successful build.\"\"\"\n    del mock_cloud_build, mock_google_auth\n    builds = [{'build_id': '1', 'finishTime': 'test_time', 'status': 'FAILURE'}]\n    mock_get_build = MockGetBuild(builds)\n    update_build_status.BuildGetter.get_build = mock_get_build.get_build\n    mock_upload_log.return_value = True\n\n    expected_projects = {\n        'history': [{\n            'build_id': '1',\n            'finish_time': 'test_time',\n            'success': False\n        }]\n    }\n    self.assertDictEqual(update_build_status.get_build_history(['1']),\n                         expected_projects)\n\n\nclass TestSortProjects(unittest.TestCase):\n  \"\"\"Unit tests for testing sorting functionality.\"\"\"\n\n  def test_sort_projects(self):\n    \"\"\"Test sorting functionality.\"\"\"\n    projects = [{\n        'name': '1',\n        'history': []\n    }, {\n        'name': '2',\n        'history': [{\n            'success': True\n        }]\n    }, {\n        'name': '3',\n        'history': [{\n            'success': False\n        }]\n    }]\n    expected_order = ['3', '2', '1']\n    update_build_status.sort_projects(projects)\n    self.assertEqual(expected_order, [project['name'] for project in projects])\n\n\nclass TestUpdateLastSuccessfulBuild(unittest.TestCase):\n  \"\"\"Unit tests for updating last successful build.\"\"\"\n\n  @classmethod\n  def setUpClass(cls):\n    cls.ds_emulator = test_utils.start_datastore_emulator()\n    test_utils.wait_for_emulator_ready(cls.ds_emulator, 'datastore',\n                                       test_utils.DATASTORE_READY_INDICATOR)\n    test_utils.set_gcp_environment()\n\n  def setUp(self):\n    test_utils.reset_ds_emulator()\n\n  def test_update_last_successful_build_new(self):\n    \"\"\"When last successful build isn't available in datastore.\"\"\"\n    with ndb.Client().context():\n      project = {\n          'name': 'test-project',\n          'last_successful_build': {\n              'build_id': '1',\n              'finish_time': 'test_time'\n          }\n      }\n      update_build_status.update_last_successful_build(project, 'fuzzing')\n      expected_build_id = '1'\n      self.assertEqual(\n          expected_build_id,\n          ndb.Key(datastore_entities.LastSuccessfulBuild,\n                  'test-project-fuzzing').get().build_id)\n\n  def test_update_last_successful_build_datastore(self):\n    \"\"\"When last successful build is only available in datastore.\"\"\"\n    with ndb.Client().context():\n      project = {'name': 'test-project'}\n      datastore_entities.LastSuccessfulBuild(id='test-project-fuzzing',\n                                             build_tag='fuzzing',\n                                             project='test-project',\n                                             build_id='1',\n                                             finish_time='test_time').put()\n\n      update_build_status.update_last_successful_build(project, 'fuzzing')\n      expected_project = {\n          'name': 'test-project',\n          'last_successful_build': {\n              'build_id': '1',\n              'finish_time': 'test_time'\n          }\n      }\n      self.assertDictEqual(project, expected_project)\n\n  def test_update_last_successful_build(self):\n    \"\"\"When last successful build is available at both places.\"\"\"\n    with ndb.Client().context():\n      project = {\n          'name': 'test-project',\n          'last_successful_build': {\n              'build_id': '2',\n              'finish_time': 'test_time'\n          }\n      }\n      datastore_entities.LastSuccessfulBuild(id='test-project-fuzzing',\n                                             build_tag='fuzzing',\n                                             project='test-project',\n                                             build_id='1',\n                                             finish_time='test_time').put()\n\n      update_build_status.update_last_successful_build(project, 'fuzzing')\n      expected_build_id = '2'\n      self.assertEqual(\n          expected_build_id,\n          ndb.Key(datastore_entities.LastSuccessfulBuild,\n                  'test-project-fuzzing').get().build_id)\n\n  @classmethod\n  def tearDownClass(cls):\n    test_utils.cleanup_emulator(cls.ds_emulator)\n\n\nclass TestUpdateBuildStatus(unittest.TestCase):\n  \"\"\"Unit test for update build status.\"\"\"\n\n  @classmethod\n  def setUpClass(cls):\n    cls.ds_emulator = test_utils.start_datastore_emulator()\n    test_utils.wait_for_emulator_ready(cls.ds_emulator, 'datastore',\n                                       test_utils.DATASTORE_READY_INDICATOR)\n    test_utils.set_gcp_environment()\n\n  def setUp(self):\n    test_utils.reset_ds_emulator()\n\n  # pylint: disable=no-self-use\n  @mock.patch('google.auth.default', return_value=['temp', 'temp'])\n  @mock.patch('update_build_status.build', return_value='cloudbuild')\n  @mock.patch('update_build_status.upload_log')\n  def test_update_build_status(self, mock_upload_log, mock_cloud_build,\n                               mock_google_auth):\n    \"\"\"Testing update build status as a whole.\"\"\"\n    del self, mock_cloud_build, mock_google_auth\n    update_build_status.upload_status = mock.MagicMock()\n    mock_upload_log.return_value = True\n    status_filename = 'status.json'\n    with ndb.Client().context():\n      datastore_entities.Project(\n          name='test-project-1',\n          project_yaml_contents=(\n              'main_repo: \"https://github/com/main/repo1\"')).put()\n      datastore_entities.Project(\n          name='test-project-2',\n          project_yaml_contents=(\n              'main_repo: \"https://github/com/main/repo2\"')).put()\n      datastore_entities.Project(\n          name='test-project-3',\n          project_yaml_contents=(\n              'main_repo: \"https://github/com/main/repo3\"')).put()\n\n      datastore_entities.BuildsHistory(id='test-project-1-fuzzing',\n                                       build_tag='fuzzing',\n                                       project='test-project-1',\n                                       build_ids=['1']).put()\n\n      datastore_entities.BuildsHistory(id='test-project-2-fuzzing',\n                                       build_tag='fuzzing',\n                                       project='test-project-2',\n                                       build_ids=['2']).put()\n\n      datastore_entities.BuildsHistory(id='test-project-3-fuzzing',\n                                       build_tag='fuzzing',\n                                       project='test-project-3',\n                                       build_ids=['3']).put()\n\n      builds = [{\n          'build_id': '1',\n          'finishTime': 'test_time',\n          'status': 'SUCCESS'\n      }, {\n          'build_id': '2',\n          'finishTime': 'test_time',\n          'status': 'FAILURE'\n      }, {\n          'build_id': '3',\n          'status': 'WORKING'\n      }]\n      mock_get_build = MockGetBuild(builds)\n      update_build_status.BuildGetter.get_build = mock_get_build.get_build\n\n      expected_data = {\n          'projects': [{\n              'history': [{\n                  'build_id': '2',\n                  'finish_time': 'test_time',\n                  'success': False\n              }],\n              'name': 'test-project-2',\n              'main_repo': 'https://github/com/main/repo2',\n          }, {\n              'history': [{\n                  'build_id': '1',\n                  'finish_time': 'test_time',\n                  'success': True\n              }],\n              'last_successful_build': {\n                  'build_id': '1',\n                  'finish_time': 'test_time'\n              },\n              'name': 'test-project-1',\n              'main_repo': 'https://github/com/main/repo1',\n          }, {\n              'history': [],\n              'name': 'test-project-3',\n              'main_repo': 'https://github/com/main/repo3',\n          }]\n      }\n\n      update_build_status.update_build_status('fuzzing', 'status.json')\n      update_build_status.upload_status.assert_called_with(\n          expected_data, status_filename)\n\n  @classmethod\n  def tearDownClass(cls):\n    test_utils.cleanup_emulator(cls.ds_emulator)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/functions/__init__.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n"
  },
  {
    "path": "infra/build/functions/base_images.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud function to build base images on Google Cloud Builder.\n\nThis script can be run locally for testing or deployment purposes. By default,\nit performs a real build. To perform a dry run, use the '--dry-run' flag. To\nprevent images from being pushed to the registry, use '--no-push'.\n\nExample:\n  python3 infra/build/functions/base_images.py --dry-run\n\"\"\"\nfrom collections.abc import Sequence\nimport logging\nimport os\nimport sys\n\nimport google.auth\n\nimport build_lib\n\nBASE_PROJECT = 'oss-fuzz-base'\nIMAGE_NAME_PREFIX = f'gcr.io/{BASE_PROJECT}/'\nMAJOR_TAG = 'v1'\nTIMEOUT = '21600'  # 6 hours\n\n# Defines the Ubuntu versions supported by the build infrastructure.\n# 'legacy' refers to the unversioned, default image.\n# Note: This list indicates build capability, not production readiness.\n# A version is only ready for general use after being fully enabled in\n# ClusterFuzz.\nSUPPORTED_VERSIONS = ('legacy', 'ubuntu-20-04', 'ubuntu-24-04')\n\n# Define which of the supported versions is considered the default.\n# This version will receive the ':v1' tag.\nDEFAULT_VERSION = 'legacy'\n\n# Defines the dependency graph for base images.\nIMAGE_DEPENDENCIES = {\n    'base-clang': ['base-image'],\n    'base-clang-full': ['base-clang'],\n    'base-builder': ['base-clang'],\n    'base-builder-go': ['base-builder'],\n    'base-builder-javascript': ['base-builder'],\n    'base-builder-jvm': ['base-builder'],\n    'base-builder-python': ['base-builder'],\n    'base-builder-ruby': ['base-builder'],\n    'base-builder-rust': ['base-builder'],\n    'base-builder-swift': ['base-builder'],\n    'base-runner': ['base-image', 'base-builder', 'base-builder-ruby'],\n    'base-runner-debug': ['base-runner'],\n    'indexer': ['base-clang-full'],\n}\n\n\nclass ImageConfig:\n  \"\"\"Configuration for a specific base image version.\"\"\"\n  name: str\n  version: str\n  path: str\n  dockerfile_path: str\n  build_args: Sequence[str] | None\n\n  def __init__(self,\n               name: str,\n               version: str,\n               path: str | None = None,\n               build_args: Sequence[str] | None = None):\n    self.name = name\n    self.version = version\n    self.path = path if path else self._get_default_path()\n    self.dockerfile_path = self._resolve_dockerfile()\n    self.build_args = build_args\n\n  def _get_default_path(self) -> str:\n    \"\"\"Returns the default path to the image's build directory.\"\"\"\n    if self.name == 'indexer':\n      return os.path.join('infra', 'indexer')\n    return os.path.join('infra', 'base-images', self.name)\n\n  def _resolve_dockerfile(self) -> str:\n    \"\"\"Resolves the path to the Dockerfile.\n\n    Prefers a version-specific one if it exists, otherwise falling back to the\n    legacy Dockerfile.\n    \"\"\"\n    if self.version != 'legacy':\n      versioned_dockerfile = os.path.join(self.path,\n                                          f'{self.version}.Dockerfile')\n      logging.info('Using versioned Dockerfile: %s', versioned_dockerfile)\n      return versioned_dockerfile\n\n    legacy_dockerfile = os.path.join(self.path, 'Dockerfile')\n    logging.info('Using legacy Dockerfile: %s', legacy_dockerfile)\n    return legacy_dockerfile\n\n  @property\n  def final_tag(self) -> str:\n    \"\"\"\n        Returns the final tag for the image, using ':v1' for the default\n        version and the version name for others.\n        \"\"\"\n    return MAJOR_TAG if self.version == DEFAULT_VERSION else self.version\n\n  @property\n  def full_image_name_with_tag(self) -> str:\n    \"\"\"Returns the full GCR image name with the final tag.\"\"\"\n    return f'{IMAGE_NAME_PREFIX}{self.name}:{self.final_tag}'\n\n\n# Definitions of the base images to be built.\nBASE_IMAGE_DEFS = [\n    {\n        'name': 'base-image'\n    },\n    {\n        'name': 'base-clang'\n    },\n    {\n        'name': 'base-clang-full',\n        'path': 'infra/base-images/base-clang',\n        'build_args': ('FULL_LLVM_BUILD=1',)\n    },\n    {\n        'name': 'indexer'\n    },\n    {\n        'name': 'base-builder'\n    },\n    {\n        'name': 'base-builder-go'\n    },\n    {\n        'name': 'base-builder-javascript'\n    },\n    {\n        'name': 'base-builder-jvm'\n    },\n    {\n        'name': 'base-builder-python'\n    },\n    {\n        'name': 'base-builder-ruby'\n    },\n    {\n        'name': 'base-builder-rust'\n    },\n    {\n        'name': 'base-builder-swift'\n    },\n    {\n        'name': 'base-runner'\n    },\n    {\n        'name': 'base-runner-debug'\n    },\n]\n\n\ndef get_base_image_steps(images: Sequence[ImageConfig]) -> list[dict]:\n  \"\"\"Returns build steps for a given list of image configurations.\"\"\"\n  steps = [build_lib.get_git_clone_step()]\n  build_ids = {}\n\n  for image_config in images:\n    # The final tag is ':v1' for the default version, or the version name\n    # (e.g., ':ubuntu-24-04') for others.\n    tags = [image_config.full_image_name_with_tag]\n\n    # The 'legacy' build is also tagged as 'latest' for use by subsequent\n    # build steps within the same pipeline.\n    if image_config.version == 'legacy':\n      tags.append(f'{IMAGE_NAME_PREFIX}{image_config.name}:latest')\n\n    dockerfile_path = os.path.join('oss-fuzz', image_config.dockerfile_path)\n    step = build_lib.get_docker_build_step(tags,\n                                           image_config.path,\n                                           dockerfile_path=dockerfile_path,\n                                           build_args=image_config.build_args)\n\n    # Check for dependencies and add 'waitFor' if necessary.\n    dependencies = IMAGE_DEPENDENCIES.get(image_config.name, [])\n    wait_for = [build_ids[dep] for dep in dependencies if dep in build_ids]\n    if wait_for:\n      step['waitFor'] = wait_for\n\n    build_ids[image_config.name] = step['id']\n    steps.append(step)\n\n  return steps\n\n\ndef run_build(steps: list[dict],\n              images_to_push: list[str],\n              build_version: str,\n              tags: list[str] | None = None,\n              dry_run: bool = False,\n              no_push: bool = False):\n  \"\"\"Executes a build in GCB and pushes the resulting images.\n\n  Alternatively, prints the configuration if in dry_run mode.\n  \"\"\"\n  if dry_run:\n    print(\n        '--------------------------------------------------------------------')\n    print(f'DRY RUN FOR VERSION: {build_version}')\n    print(\n        '--------------------------------------------------------------------')\n    print(f'Images to push: {images_to_push}')\n    print(f'Push enabled: {not no_push}')\n    print('Build steps:')\n    for step in steps:\n      print(f\"  - {step['name']}: {' '.join(step['args'])}\")\n    print(\n        '--------------------------------------------------------------------\\n'\n    )\n    return\n\n  images_for_gcb = images_to_push\n  if no_push:\n    logging.info('\"--no-push\" flag detected. Skipping push to registry.')\n    images_for_gcb = []\n\n  credentials, _ = google.auth.default()\n  body_overrides = {\n      'images': images_for_gcb,\n      'options': {\n          'machineType': 'E2_HIGHCPU_32'\n      },\n  }\n  build_tags = ['base-image-build', f'version-{build_version}']\n  if tags:\n    build_tags.extend(tags)\n\n  build_info = build_lib.run_build('',\n                                   steps,\n                                   credentials,\n                                   BASE_PROJECT,\n                                   TIMEOUT,\n                                   body_overrides,\n                                   build_tags,\n                                   use_build_pool=False)\n\n  if build_info:\n    build_id = build_info.get('id')\n    log_url = build_info.get('logUrl')\n    logging.info('Successfully triggered build %s for version %s.', build_id,\n                 build_version)\n    logging.info('Build logs are available at: %s', log_url)\n  else:\n    logging.error('Failed to trigger build for version %s.', build_version)\n\n\ndef get_images_architecture_manifest_steps(target_tag: str) -> list[dict]:\n  \"\"\"Returns steps for creating and pushing a multi-architecture manifest.\n\n  The manifest is for the base-builder and base-runner images with a\n  specific tag.\n  \"\"\"\n  images = [\n      f'{IMAGE_NAME_PREFIX}base-builder', f'{IMAGE_NAME_PREFIX}base-runner'\n  ]\n  steps = []\n  for image in images:\n    steps.extend(get_image_push_architecture_manifest_steps(image, target_tag))\n  return steps\n\n\ndef get_image_push_architecture_manifest_steps(image: str,\n                                               target_tag: str) -> list[dict]:\n  \"\"\"Returns steps for pushing a manifest pointing to ARM64/AMD64 versions.\"\"\"\n  # The AMD64 image is the one we just built.\n  amd64_source_image = f'{image}:{target_tag}'\n  # The ARM64 image is a pre-built generic testing image.\n  arm64_source_image = f'{image}-testing-arm'\n  # The final manifest will point to this tag.\n  manifest_tag = f'{image}:{target_tag}'\n\n  # Intermediate tags for pushing architecture-specific images.\n  amd64_manifest_image = f'{image}:{target_tag}-manifest-amd64'\n  arm64_manifest_image = f'{image}:{target_tag}-manifest-arm64v8'\n\n  steps = [\n      # Tag and push the AMD64 image.\n      {\n          'name': 'gcr.io/cloud-builders/docker',\n          'args': ['tag', amd64_source_image, amd64_manifest_image],\n      },\n      {\n          'name': 'gcr.io/cloud-builders/docker',\n          'args': ['push', amd64_manifest_image],\n      },\n      # Pull and tag the ARM64 image.\n      {\n          'name': 'gcr.io/cloud-builders/docker',\n          'args': ['pull', arm64_source_image],\n      },\n      {\n          'name': 'gcr.io/cloud-builders/docker',\n          'args': ['tag', arm64_source_image, arm64_manifest_image],\n      },\n      {\n          'name': 'gcr.io/cloud-builders/docker',\n          'args': ['push', arm64_manifest_image],\n      },\n      # Create and push the manifest.\n      {\n          'name':\n              'gcr.io/cloud-builders/docker',\n          'args': [\n              'manifest', 'create', manifest_tag, '--amend',\n              arm64_manifest_image, '--amend', amd64_manifest_image\n          ],\n      },\n      {\n          'name': 'gcr.io/cloud-builders/docker',\n          'args': ['manifest', 'push', manifest_tag]\n      }\n  ]\n  return steps\n\n\ndef base_builder(event, context, dry_run: bool = False, no_push: bool = False):\n  \"\"\"Cloud function entry point.\n\n  Triggers parallel base image builds for each supported Ubuntu version.\n  \"\"\"\n  del event, context\n  logging.basicConfig(level=logging.INFO)\n\n  for version in SUPPORTED_VERSIONS:\n    logging.info('Starting build for version: %s', version)\n\n    version_images = [\n        ImageConfig(version=version, **def_args) for def_args in BASE_IMAGE_DEFS\n    ]\n    steps = get_base_image_steps(version_images)\n    images_to_push = [img.full_image_name_with_tag for img in version_images]\n\n    # Also push the 'latest' tag for the default build.\n    if version == DEFAULT_VERSION:\n      images_to_push.extend(\n          [f'{IMAGE_NAME_PREFIX}{img.name}:latest' for img in version_images])\n\n    # Determine the final tag for this build.\n    target_tag = MAJOR_TAG if version == DEFAULT_VERSION else version\n\n    # Create a multi-architecture manifest for this version's final tag.\n    logging.info('Adding multi-architecture manifest steps for tag: %s',\n                 target_tag)\n    steps.extend(get_images_architecture_manifest_steps(target_tag))\n    images_to_push.extend([\n        f'{IMAGE_NAME_PREFIX}base-builder:{target_tag}',\n        f'{IMAGE_NAME_PREFIX}base-runner:{target_tag}'\n    ])\n\n    logging.info('Triggering GCB build for version: %s', version)\n    run_build(steps,\n              images_to_push,\n              build_version=version,\n              dry_run=dry_run,\n              no_push=no_push)\n\n\nif __name__ == '__main__':\n  is_dry_run = '--dry-run' in sys.argv\n  no_push = '--no-push' in sys.argv\n  base_builder(None, None, dry_run=is_dry_run, no_push=no_push)\n"
  },
  {
    "path": "infra/build/functions/build_and_push_test_images.py",
    "content": "#! /usr/bin/env python3\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script for building and pushing base-images to gcr.io/oss-fuzz-base/ with\n\"-test\" suffix. This is useful for using the build infra to test image\nchanges.\"\"\"\nimport logging\nimport multiprocessing\nimport os\nimport re\nimport subprocess\nimport sys\nimport time\n\nimport google.auth\nimport yaml\nfrom googleapiclient.discovery import build as cloud_build\n\nimport base_images\nimport build_lib\n\nCLOUD_PROJECT = 'oss-fuzz-base'\nINFRA_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))\nIMAGES_DIR = os.path.join(INFRA_DIR, 'base-images')\nOSS_FUZZ_ROOT = os.path.dirname(INFRA_DIR)\nGCB_BUILD_TAGS = ['trial-build']\n\n# Add the new Ubuntu versions to the list of versions to build.\nBASE_IMAGE_VERSIONS = ['legacy', 'ubuntu-20-04', 'ubuntu-24-04']\n\n\ndef push_image(tag):\n  \"\"\"Pushes image with |tag| to docker registry.\"\"\"\n  logging.info('Pushing: %s', tag)\n  command = ['docker', 'push', tag]\n  subprocess.run(command, check=True)\n  logging.info('Pushed: %s', tag)\n\n\ndef build_and_push_image(image, test_image_tag, version='legacy'):\n  \"\"\"Builds and pushes |image| to docker registry with \"-testing\" suffix.\"\"\"\n  main_image_name, test_image_name = get_image_tags(image, test_image_tag,\n                                                    version)\n  build_image(image, [main_image_name, test_image_name], main_image_name,\n              version)\n  push_image(test_image_name)\n\n\ndef build_image(image, tags, cache_from_tag, version='latest'):\n  \"\"\"Builds |image| and tags it with |tags|.\"\"\"\n  logging.info('Building: %s', image)\n  command = ['docker', 'build']\n  for tag in tags:\n    command.extend(['--tag', tag])\n  path = os.path.join(IMAGES_DIR, image)\n  if version != 'legacy':\n    command.extend(['-f', os.path.join(path, f'{version}.Dockerfile')])\n  command.extend([\n      '--build-arg', 'BUILDKIT_INLINE_CACHE=1', '--cache-from', cache_from_tag\n  ])\n  command.append(path)\n  subprocess.run(command, check=True)\n  logging.info('Built: %s', image)\n\n\ndef _run_cloudbuild(build_body):\n  \"\"\"Runs a cloud build and returns the build ID.\"\"\"\n  yaml_file = os.path.join(OSS_FUZZ_ROOT, 'cloudbuild.yaml')\n  with open(yaml_file, 'w') as yaml_file_handle:\n    yaml.dump(build_body, yaml_file_handle)\n\n  # Use --async to not wait on the build.\n  result = subprocess.run([\n      'gcloud', 'builds', 'submit', '--project=oss-fuzz-base',\n      f'--config={yaml_file}', '--async', '--format=value(id)'\n  ],\n                          cwd=OSS_FUZZ_ROOT,\n                          check=True,\n                          capture_output=True,\n                          text=True)\n  return result.stdout.strip()\n\n\ndef wait_for_build_and_report_summary(build_id, cloud_project='oss-fuzz-base'):\n  \"\"\"Waits for a GCB build to complete and reports a detailed summary.\"\"\"\n  logs_url = build_lib.get_logs_url(build_id)\n  credentials, _ = google.auth.default()\n  cloudbuild = cloud_build('cloudbuild',\n                           'v1',\n                           credentials=credentials,\n                           cache_discovery=False,\n                           client_options=build_lib.REGIONAL_CLIENT_OPTIONS)\n  cloudbuild_api = cloudbuild.projects().builds()\n\n  logging.info(\n      '================================================================')\n  logging.info('            PHASE 1: STARTED BASE IMAGE BUILD')\n  logging.info(\n      '----------------------------------------------------------------')\n  for line in build_lib.get_build_info_lines(build_id, cloud_project):\n    logging.info(line)\n  logging.info(\n      '================================================================')\n\n  logging.info('Waiting for base image build to complete...')\n  build_result = None\n  while True:\n    try:\n      build_result = cloudbuild_api.get(projectId=cloud_project,\n                                        id=build_id).execute()\n      status = build_result['status']\n      if status in ('SUCCESS', 'FAILURE', 'TIMEOUT', 'CANCELLED', 'EXPIRED'):\n        break\n    except Exception as e:\n      logging.error('Error checking build status: %s', e)\n    time.sleep(15)\n\n  logging.info(\n      '================================================================')\n  logging.info('            PHASE 1: BASE IMAGE BUILD REPORT')\n  logging.info(\n      '----------------------------------------------------------------')\n  for line in build_lib.get_build_info_lines(build_id, cloud_project):\n    logging.info(line)\n  logging.info(\n      '================================================================')\n\n  if not build_result or 'steps' not in build_result:\n    logging.error('Could not retrieve build steps. See logs for details: %s',\n                  logs_url)\n    return False\n\n  # Detailed step-by-step report\n  succeeded_steps = 0\n  failed_steps = []\n  for step in build_result['steps']:\n    step_id = step.get('id', step.get('name', 'Unnamed Step'))\n    step_status = step.get('status', 'UNKNOWN')\n    if step_status == 'SUCCESS':\n      logging.info('  - %s: %s', step_id, step_status)\n      succeeded_steps += 1\n    else:\n      logging.error('  - %s: %s', step_id, step_status)\n      failed_steps.append(step_id)\n\n  logging.info(\n      '----------------------------------------------------------------')\n  logging.info('Summary: %d succeeded, %d failed.', succeeded_steps,\n               len(failed_steps))\n  logging.info(\n      '================================================================')\n\n  if failed_steps:\n    logging.error('The following images failed to build: %s',\n                  ', '.join(failed_steps))\n    logging.error('See full logs for details: %s', logs_url)\n    return False\n\n  logging.info('All base images built successfully.')\n  return True\n\n\ndef get_image_tags(image: str,\n                   test_image_tag: str | None = None,\n                   version: str = 'legacy'):\n  \"\"\"Returns tags for image build.\"\"\"\n  if version == 'legacy':\n    main_image_name = f'{base_images.IMAGE_NAME_PREFIX}{image}'\n  else:\n    main_image_name = f'{base_images.IMAGE_NAME_PREFIX}{image}:{version}'\n\n  test_image_name = None\n  if test_image_tag:\n    test_image_name = (\n        f'{base_images.IMAGE_NAME_PREFIX}{image}-{test_image_tag}')\n\n  return main_image_name, test_image_name\n\n\ndef gcb_build_and_push_images(test_image_tag: str, version_tag: str = None):\n  \"\"\"Build and push test versions of base images using GCB.\"\"\"\n  # Define the dependency hierarchy for base images.\n  IMAGE_DEPENDENCIES = {\n      'base-clang': ['base-image'],\n      'base-clang-full': ['base-clang'],\n      'base-builder': ['base-clang'],\n      'base-runner': [\n          'base-image', 'base-clang', 'base-builder', 'base-builder-ruby'\n      ],\n      'base-builder-go': ['base-builder'],\n      'base-builder-javascript': ['base-builder'],\n      'base-builder-jvm': ['base-builder'],\n      'base-builder-python': ['base-builder'],\n      'base-builder-ruby': ['base-builder'],\n      'base-builder-rust': ['base-builder'],\n      'base-builder-swift': ['base-builder'],\n      'base-runner-debug': ['base-runner'],\n      'indexer': ['base-clang-full'],\n  }\n\n  steps = []\n  added_step_ids = set()\n  test_image_names = []\n  versions = [version_tag] if version_tag else BASE_IMAGE_VERSIONS\n  for version in versions:\n    for base_image_def in base_images.BASE_IMAGE_DEFS:\n      base_image = base_images.ImageConfig(version=version, **base_image_def)\n      main_image_name, test_image_name = get_image_tags(base_image.name,\n                                                        test_image_tag, version)\n      test_image_names.append(test_image_name)\n\n      if version == 'legacy':\n        dockerfile = os.path.join(base_image.path, 'Dockerfile')\n      else:\n        dockerfile = os.path.join(base_image.path, f'{version}.Dockerfile')\n\n      # Skip building if the Dockerfile does not exist.\n      if not os.path.exists(os.path.join(OSS_FUZZ_ROOT, dockerfile)):\n        logging.info('Skipping %s for version %s as it does not exist.',\n                     dockerfile, version)\n        continue\n\n      intermediate_tag = base_images.IMAGE_NAME_PREFIX + base_image.name\n      tags_for_build = sorted(\n          list(set([main_image_name, test_image_name, intermediate_tag])))\n\n      # Get dependency tags for caching.\n      dependencies = IMAGE_DEPENDENCIES.get(base_image.name, [])\n      if not isinstance(dependencies, list):\n        dependencies = [dependencies]\n\n      cache_tags = []\n      for dep_name in dependencies:\n        dep_main_tag, _ = get_image_tags(dep_name, None, version)\n        cache_tags.append(dep_main_tag)\n\n      step = build_lib.get_docker_build_step(\n          tags_for_build,\n          base_image.path,\n          use_buildkit_cache=True,\n          src_root='.',\n          build_args=base_image.build_args,\n          dockerfile_path=dockerfile,\n          additional_cache_from_tags=cache_tags)\n\n      # Add a unique ID to each step for dependency tracking.\n      step_id = f'build-{base_image.name}-{version}'\n      step['id'] = step_id\n\n      # Add 'waitFor' if the image has dependencies that have been added.\n      wait_for_ids = []\n      for dependency in dependencies:\n        dependency_id = f'build-{dependency}-{version}'\n        if dependency_id in added_step_ids:\n          wait_for_ids.append(dependency_id)\n      if wait_for_ids:\n        step['waitFor'] = wait_for_ids\n\n      steps.append(step)\n      added_step_ids.add(step_id)\n\n  build_body = build_lib.get_build_body(steps, base_images.TIMEOUT,\n                                        {'images': test_image_names},\n                                        GCB_BUILD_TAGS + [test_image_tag])\n  build_id = _run_cloudbuild(build_body)\n  return wait_for_build_and_report_summary(build_id)\n\n\ndef build_and_push_images(test_image_tag, version_tag=None):\n  \"\"\"Builds and pushes base-images.\"\"\"\n  images = [\n      ['base-image'],\n      ['base-clang'],\n      ['base-clang-full'],\n      ['indexer'],\n      ['base-builder'],\n      [\n          'base-builder-swift',\n          'base-builder-ruby',\n          'base-builder-rust',\n          'base-builder-go',\n          'base-builder-javascript',\n          'base-builder-jvm',\n          'base-builder-python',\n      ],\n      ['base-runner'],\n      ['base-runner-debug'],\n  ]\n  os.environ['DOCKER_BUILDKIT'] = '1'\n  max_parallelization = max([len(image_list) for image_list in images])\n  proc_count = min(multiprocessing.cpu_count(), max_parallelization)\n  logging.info('Using %d parallel processes.', proc_count)\n  with multiprocessing.Pool(proc_count) as pool:\n    for image_list in images:\n      args_list = []\n      for image in image_list:\n        versions = [version_tag] if version_tag else BASE_IMAGE_VERSIONS\n        for version in versions:\n          # Check if the specific versioned Dockerfile exists before adding.\n          if version == 'legacy':\n            dockerfile_path = os.path.join(IMAGES_DIR, image, 'Dockerfile')\n          else:\n            dockerfile_path = os.path.join(IMAGES_DIR, image,\n                                           f'{version}.Dockerfile')\n          if os.path.exists(dockerfile_path):\n            args_list.append((image, test_image_tag, version))\n\n      pool.starmap(build_and_push_image, args_list)\n\n\ndef main():\n  \"\"\"Builds base-images tags them with \"-testing\" suffix (in addition to normal\n  tag) and pushes testing suffixed images to docker registry.\"\"\"\n  test_image_tag = sys.argv[1]\n  logging.basicConfig(level=logging.DEBUG)\n  logging.info('Doing simple gcloud command to ensure 2FA passes.')\n  subprocess.run(['gcloud', 'projects', 'list', '--limit=1'], check=True)\n  build_and_push_images(test_image_tag)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/build/functions/build_and_run_coverage.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Starts and runs coverage build on Google Cloud Builder.\n\nUsage: build_and_run_coverage.py <project>.\n\"\"\"\nimport json\nimport logging\nimport os\nimport sys\nimport posixpath\n\nimport build_lib\nimport build_project\n\nSANITIZER = 'coverage'\nFUZZING_ENGINE = 'libfuzzer'\nARCHITECTURE = 'x86_64'\n\nPLATFORM = 'linux'\n\nCOVERAGE_BUILD_TYPE = 'coverage'\nINTROSPECTOR_BUILD_TYPE = 'introspector'\n\n# This is needed for ClusterFuzz to pick up the most recent reports data.\n\nLATEST_REPORT_INFO_CONTENT_TYPE = 'application/json'\n\n# Languages from project.yaml that have code coverage support.\nLANGUAGES_WITH_COVERAGE_SUPPORT = [\n    'c', 'c++', 'go', 'jvm', 'rust', 'swift', 'python'\n]\n\nLANGUAGES_WITH_INTROSPECTOR_SUPPORT = ['c', 'c++', 'python', 'jvm', 'rust']\n\n\nclass Bucket:  # pylint: disable=too-few-public-methods\n  \"\"\"Class representing the GCS bucket.\"\"\"\n  BUCKET_NAME = None\n\n  def __init__(self, project, date, platform, testing):\n    self.bucket_name = self.BUCKET_NAME\n    if testing:\n      self.bucket_name += '-testing'\n    self.date = date\n    self.project = project\n    self.html_report_url = (\n        f'{build_lib.GCS_URL_BASENAME}{self.bucket_name}/{project}'\n        f'/reports/{date}/{platform}')\n    self.latest_report_info_url = (f'/{self.bucket_name}'\n                                   f'/latest_report_info/{project}.json')\n\n  def get_upload_url(self, upload_type):\n    \"\"\"Returns an upload url for |upload_type|.\"\"\"\n    return (f'gs://{self.bucket_name}/{self.project}'\n            f'/{upload_type}/{self.date}')\n\n\nclass CoverageBucket(Bucket):  # pylint: disable=too-few-public-methods\n  \"\"\"Class representing the coverage GCS bucket.\"\"\"\n  BUCKET_NAME = 'oss-fuzz-coverage'\n\n\nclass IntrospectorBucket(Bucket):  # pylint: disable=too-few-public-methods\n  \"\"\"Class representing the introspector GCS bucket.\"\"\"\n  BUCKET_NAME = 'oss-fuzz-introspector'\n\n\ndef get_build_steps(  # pylint: disable=too-many-locals, too-many-arguments\n    project_name, project_yaml, dockerfile_lines, config):\n  \"\"\"Returns build steps for project.\"\"\"\n  project = build_project.Project(project_name, project_yaml, dockerfile_lines)\n  if project.disabled:\n    return [], f'Project \"{project.name}\" is disabled.'\n\n  if project.fuzzing_language not in LANGUAGES_WITH_COVERAGE_SUPPORT:\n    return [], (f'Project \"{project.name}\" is written in '\n                f'\"{project.fuzzing_language}\", coverage is not supported yet.')\n\n  report_date = build_project.get_datetime_now().strftime('%Y%m%d')\n  bucket = CoverageBucket(project.name, report_date, PLATFORM, config.testing)\n\n  build_steps = build_lib.get_project_image_steps(project.name,\n                                                  project.image,\n                                                  project.fuzzing_language,\n                                                  config=config)\n\n  build = build_project.Build(FUZZING_ENGINE, 'coverage', ARCHITECTURE)\n  env = build_project.get_env(project.fuzzing_language, build)\n  build_steps.append(\n      build_project.get_compile_step(project, build, env, config.parallel))\n  download_corpora_steps = build_lib.download_corpora_steps(\n      project.name, test_image_suffix=config.test_image_suffix)\n  if not download_corpora_steps:\n    return [], f'Failed to get corpora for project \"{project.name}\".'\n\n  build_steps.extend(download_corpora_steps)\n\n  failure_msg = ('*' * 80 + '\\nCode coverage report generation failed.\\n'\n                 'To reproduce, run:\\n'\n                 f'python infra/helper.py build_image {project.name}\\n'\n                 'python infra/helper.py build_fuzzers --sanitizer coverage '\n                 f'{project.name}\\n'\n                 f'python infra/helper.py coverage {project.name}\\n' + '*' * 80)\n\n  # Unpack the corpus and run coverage script.\n  coverage_env = env + [\n      'HTTP_PORT=',\n      f'COVERAGE_EXTRA_ARGS={project.coverage_extra_args.strip()}',\n  ]\n\n  build_steps.append({\n      'name':\n          build_lib.get_runner_image_name(config.test_image_suffix,\n                                          config.base_image_tag),\n      'env':\n          coverage_env,\n      'args': [\n          'bash', '-c',\n          ('for f in /corpus/*.zip; do unzip -q $f -d ${f%.*} || ('\n           'echo \"Failed to unpack the corpus for $(basename ${f%.*}). '\n           'This usually means that corpus backup for a particular fuzz '\n           'target does not exist. If a fuzz target was added in the last '\n           '24 hours, please wait one more day. Otherwise, something is '\n           'wrong with the fuzz target or the infrastructure, and corpus '\n           'pruning task does not finish successfully.\" && exit 1'\n           '); done && coverage || (echo \"' + failure_msg + '\" && false)')\n      ],\n      'volumes': [{\n          'name': 'corpus',\n          'path': '/corpus'\n      }],\n  })\n\n  # Upload the report.\n  upload_report_url = bucket.get_upload_url('reports')\n  upload_report_by_target_url = bucket.get_upload_url('reports-by-target')\n\n  # Delete the existing report as gsutil cannot overwrite it in a useful way due\n  # to the lack of `-T` option (it creates a subdir in the destination dir).\n  build_steps.append(build_lib.gsutil_rm_rf_step(upload_report_url))\n  build_steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'args': [\n          '-m',\n          'cp',\n          '-r',\n          os.path.join(build.out, 'report'),\n          upload_report_url,\n      ],\n  })\n\n  # TODO(navidem):\n  # Currently python and jvm coverage does not produce per_target reports.\n  # Skipping python for now to avoid breakage.\n  if (project.fuzzing_language not in ['python', 'jvm'] and\n      project.fuzzing_language in LANGUAGES_WITH_INTROSPECTOR_SUPPORT):\n    build_steps.append(build_lib.gsutil_rm_rf_step(upload_report_by_target_url))\n    build_steps.append({\n        'name':\n            'gcr.io/cloud-builders/gsutil',\n        'args': [\n            '-m',\n            'cp',\n            '-r',\n            os.path.join(build.out, 'report_target'),\n            upload_report_by_target_url,\n        ],\n    })\n\n  # Upload the fuzzer stats. Delete the old ones just in case.\n  upload_fuzzer_stats_url = bucket.get_upload_url('fuzzer_stats')\n\n  build_steps.append(build_lib.gsutil_rm_rf_step(upload_fuzzer_stats_url))\n  build_steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'args': [\n          '-m',\n          'cp',\n          '-r',\n          os.path.join(build.out, 'fuzzer_stats'),\n          upload_fuzzer_stats_url,\n      ],\n  })\n\n  if project.fuzzing_language in LANGUAGES_WITH_INTROSPECTOR_SUPPORT:\n    # Upload the text coverage reports. Delete the old ones just in case.\n    upload_textcov_reports_url = bucket.get_upload_url('textcov_reports')\n\n    build_steps.append(build_lib.gsutil_rm_rf_step(upload_textcov_reports_url))\n    build_steps.append({\n        'name':\n            'gcr.io/cloud-builders/gsutil',\n        'args': [\n            '-m',\n            'cp',\n            '-r',\n            os.path.join(build.out, 'textcov_reports'),\n            upload_textcov_reports_url,\n        ],\n    })\n\n  # Upload the fuzzer logs. Delete the old ones just in case\n  upload_fuzzer_logs_url = bucket.get_upload_url('logs')\n  build_steps.append(build_lib.gsutil_rm_rf_step(upload_fuzzer_logs_url))\n  build_steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'args': [\n          '-m',\n          'cp',\n          '-r',\n          os.path.join(build.out, 'logs'),\n          upload_fuzzer_logs_url,\n      ],\n  })\n\n  # Upload srcmap.\n  srcmap_upload_url = bucket.get_upload_url('srcmap')\n  srcmap_upload_url = srcmap_upload_url.rstrip('/') + '.json'\n  build_steps.append({\n      'name': 'gcr.io/cloud-builders/gsutil',\n      'args': [\n          'cp',\n          '/workspace/srcmap.json',\n          srcmap_upload_url,\n      ],\n  })\n\n  # Update the latest report information file for ClusterFuzz.\n  latest_report_info_url = build_lib.get_signed_url(\n      bucket.latest_report_info_url,\n      content_type=LATEST_REPORT_INFO_CONTENT_TYPE)\n  latest_report_info_body = json.dumps({\n      'fuzzer_stats_dir':\n          upload_fuzzer_stats_url,\n      'html_report_url':\n          posixpath.join(bucket.html_report_url, 'index.html'),\n      'report_date':\n          report_date,\n      'report_summary_path':\n          os.path.join(upload_report_url, PLATFORM, 'summary.json'),\n  })\n\n  build_steps.append(\n      build_lib.http_upload_step(latest_report_info_body,\n                                 latest_report_info_url,\n                                 LATEST_REPORT_INFO_CONTENT_TYPE))\n  return build_steps, None\n\n\ndef get_fuzz_introspector_steps(  # pylint: disable=too-many-locals, too-many-arguments, unused-argument\n    project_name, project_yaml, dockerfile_lines, config):\n  \"\"\"Returns build steps of fuzz introspector for project\"\"\"\n\n  project = build_project.Project(project_name, project_yaml, dockerfile_lines)\n  if project.disabled:\n    return [], f'Project \"{project.name}\" is disabled.'\n\n  if project.fuzzing_language not in LANGUAGES_WITH_INTROSPECTOR_SUPPORT:\n    return [], (f'Project \"{project.name}\" is written in '\n                f'\"{project.fuzzing_language}\", Fuzz Introspector is not '\n                'supported yet.')\n\n  build_steps = []\n  build = build_project.Build(FUZZING_ENGINE, 'introspector', ARCHITECTURE)\n\n  report_date = build_project.get_datetime_now().strftime('%Y%m%d')\n  bucket = IntrospectorBucket(project.name, report_date, PLATFORM,\n                              config.testing)\n\n  # TODO (navidem): find the latest coverage report.\n  coverage_report_latest = report_date\n  bucket_name = 'oss-fuzz-coverage'\n\n  coverage_url = (f'{build_lib.GCS_URL_BASENAME}{bucket_name}/{project.name}'\n                  f'/reports/{coverage_report_latest}/linux')\n\n  download_coverage_steps = build_lib.download_coverage_data_steps(\n      project.name, coverage_report_latest, bucket_name, build.out,\n      config.base_image_tag)\n  if not download_coverage_steps:\n    return [], f'Skipping introspector build for {project.name}. No coverage data found.'\n  build_steps.extend(download_coverage_steps)\n  build_steps.extend(\n      build_lib.get_project_image_steps(project.name,\n                                        project.image,\n                                        project.fuzzing_language,\n                                        config=config))\n  env = build_project.get_env(project.fuzzing_language, build)\n  env.append(f'GIT_REPO={project.main_repo}')\n  env.append(f'COVERAGE_URL={coverage_url}')\n  env.append(f'PROJECT_NAME={project.name}')\n\n  build_steps.append(\n      build_project.get_compile_step(project,\n                                     build,\n                                     env,\n                                     config.parallel,\n                                     allow_failure=True))\n\n  # Upload the report.\n  upload_report_url = bucket.get_upload_url('inspector-report')\n\n  # Delete the existing report as gsutil cannot overwrite it in a useful way due\n  # to the lack of `-T` option (it creates a subdir in the destination dir).\n  build_steps.append(build_lib.gsutil_rm_rf_step(upload_report_url))\n  build_steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'args': [\n          '-m',\n          'cp',\n          '-r',\n          os.path.join(build.out, 'inspector'),\n          upload_report_url,\n      ],\n  })\n  return build_steps, None\n\n\ndef main():\n  \"\"\"Build and run coverage for projects.\"\"\"\n  coverage_status = build_project.build_script_main(\n      'Generates coverage report for project.', get_build_steps,\n      COVERAGE_BUILD_TYPE)\n  if coverage_status != 0:\n    return coverage_status\n\n  return build_project.build_script_main(\n      'Generates introspector report for project.', get_fuzz_introspector_steps,\n      INTROSPECTOR_BUILD_TYPE)\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/build/functions/build_and_run_coverage_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unit tests for build_and_run_coverage.\"\"\"\nimport json\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\nfrom pyfakefs import fake_filesystem_unittest\n\nFUNCTIONS_DIR = os.path.dirname(__file__)\nsys.path.append(FUNCTIONS_DIR)\n# pylint: disable=wrong-import-position\n\nimport build_and_run_coverage\nimport build_project\nimport test_utils\n\n# pylint: disable=no-member\n\n\nclass TestRequestCoverageBuilds(fake_filesystem_unittest.TestCase):\n  \"\"\"Unit tests for sync.\"\"\"\n\n  def setUp(self):\n    self.maxDiff = None  # pylint: disable=invalid-name\n    self.setUpPyfakefs()\n\n  @mock.patch('build_lib.get_signed_url', return_value='test_url')\n  @mock.patch('build_lib.download_corpora_steps',\n              return_value=[{\n                  'url': 'test_download'\n              }])\n  @mock.patch('build_project.get_datetime_now',\n              return_value=test_utils.FAKE_DATETIME)\n  @mock.patch('build_lib.get_unique_build_step_image_id',\n              return_value='UNIQUE_ID')\n  def test_get_coverage_build_steps(self, mock_url, mock_corpora_steps,\n                                    mock_get_datetime_now, mock_get_id):\n    \"\"\"Test for get_build_steps.\"\"\"\n    del mock_url, mock_corpora_steps, mock_get_datetime_now\n    project_yaml_contents = (\n        'language: c++\\n'\n        'sanitizers:\\n'\n        '  - address\\n'\n        'architectures:\\n'\n        '  - x86_64\\n'\n        'main_repo: https://github.com/google/oss-fuzz.git\\n')\n    self.fs.create_dir(test_utils.PROJECT_DIR)\n    test_utils.create_project_data(test_utils.PROJECT, project_yaml_contents)\n\n    expected_build_steps_file_path = test_utils.get_test_data_file_path(\n        'expected_coverage_build_steps.json')\n    self.fs.add_real_file(expected_build_steps_file_path)\n    with open(expected_build_steps_file_path) as expected_build_steps_file:\n      expected_coverage_build_steps = json.load(expected_build_steps_file)\n\n    config = build_project.Config(upload=False)\n    project_yaml, dockerfile = build_project.get_project_data(\n        test_utils.PROJECT)\n    build_steps, _ = build_and_run_coverage.get_build_steps(\n        test_utils.PROJECT, project_yaml, dockerfile, config)\n    self.assertEqual(build_steps, expected_coverage_build_steps)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/functions/build_lib.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Utility module for Google Cloud Build scripts.\"\"\"\nimport base64\nimport binascii\nimport collections\nfrom collections.abc import Sequence\nimport dataclasses\nimport datetime\nimport json\nimport logging\nimport os\nimport re\nimport six.moves.urllib.parse as urlparse\nimport sys\nimport time\nimport tarfile\nimport tempfile\nimport uuid\n\nfrom googleapiclient.discovery import build as cloud_build\nimport googleapiclient.discovery\nimport google.api_core.client_options\nimport google.auth\nfrom google.cloud import storage\nfrom oauth2client import service_account as service_account_lib\nimport requests\nimport yaml\n\nBASE_IMAGES_PROJECT = 'oss-fuzz-base'\nIMAGE_PROJECT = 'oss-fuzz'\n\nBUILD_TIMEOUT = 20 * 60 * 60\n\n# Needed for reading public target.list.* files.\nGCS_URL_BASENAME = 'https://storage.googleapis.com/'\n\nGCS_UPLOAD_URL_FORMAT = '/{0}/{1}/{2}'\n\n# Where corpus backups can be downloaded from.\nCORPUS_BACKUP_URL = ('/{project}-backup.clusterfuzz-external.appspot.com/'\n                     'corpus/libFuzzer/{fuzzer}/latest.zip')\n\n# Regex to match special chars in project name.\nSPECIAL_CHARS_REGEX = re.compile('[^a-zA-Z0-9_-]')\n\n# Cloud Builder has a limit of 100 build steps and 100 arguments for each step.\nCORPUS_DOWNLOAD_BATCH_SIZE = 100\n\nTARGETS_LIST_BASENAME = 'targets.list'\n\nEngineInfo = collections.namedtuple(\n    'EngineInfo',\n    ['upload_bucket', 'supported_sanitizers', 'supported_architectures'])\n\n\n@dataclasses.dataclass\nclass SignedPolicyDocument:\n  \"\"\"Signed policy document\"\"\"\n  bucket: str\n  policy: str\n  x_goog_algorithm: str\n  x_goog_date: str\n  x_goog_credential: str\n  x_goog_signature: str\n\n\nENGINE_INFO = {\n    'libfuzzer':\n        EngineInfo(upload_bucket='clusterfuzz-builds',\n                   supported_sanitizers=['address', 'memory', 'undefined'],\n                   supported_architectures=['x86_64', 'i386', 'aarch64']),\n    'afl':\n        EngineInfo(upload_bucket='clusterfuzz-builds-afl',\n                   supported_sanitizers=['address'],\n                   supported_architectures=['x86_64']),\n    'honggfuzz':\n        EngineInfo(upload_bucket='clusterfuzz-builds-honggfuzz',\n                   supported_sanitizers=['address'],\n                   supported_architectures=['x86_64']),\n    'none':\n        EngineInfo(upload_bucket='clusterfuzz-builds-no-engine',\n                   supported_sanitizers=['address'],\n                   supported_architectures=['x86_64']),\n    'centipede':\n        EngineInfo(upload_bucket='clusterfuzz-builds-centipede',\n                   supported_sanitizers=['address', 'none'],\n                   supported_architectures=['x86_64']),\n}\n\nOSS_FUZZ_BUILDPOOL_NAME = os.getenv(\n    'GCB_BUILDPOOL_NAME', 'projects/oss-fuzz/locations/us-central1/'\n    'workerPools/buildpool')\n\nOSS_FUZZ_INDEXER_BUILDPOOL_NAME = os.getenv(\n    'GCB_BUILDPOOL_NAME', 'projects/oss-fuzz/locations/us-central1/'\n    'workerPools/indexer-buildpool')\n\nOSS_FUZZ_EXPERIMENTS_BUILDPOOL_NAME = os.getenv(\n    'GCB_BUILDPOOL_NAME', 'projects/oss-fuzz/locations/us-central1/'\n    'workerPools/buildpool-experiments')\n\nCLOUD_BUILD_LOCATION = os.getenv('CLOUD_BUILD_LOCATION', 'us-central1')\nREGIONAL_CLIENT_OPTIONS = google.api_core.client_options.ClientOptions(\n    api_endpoint=f'https://{CLOUD_BUILD_LOCATION}-cloudbuild.googleapis.com/')\n\nDOCKER_TOOL_IMAGE = 'gcr.io/cloud-builders/docker'\n\n_ARM64 = 'aarch64'\n\nOSS_FUZZ_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..', '..'))\n\n\ndef get_targets_list_filename(sanitizer):\n  \"\"\"Returns target list filename.\"\"\"\n  return TARGETS_LIST_BASENAME + '.' + sanitizer\n\n\ndef get_targets_list_url(bucket, project, sanitizer):\n  \"\"\"Returns target list url.\"\"\"\n  filename = get_targets_list_filename(sanitizer)\n  url = GCS_UPLOAD_URL_FORMAT.format(bucket, project, filename)\n  return url\n\n\ndef dockerify_run_step(step,\n                       build,\n                       use_architecture_image_name=False,\n                       container_name=None):\n  \"\"\"Modify a docker run step to run using gcr.io/cloud-builders/docker. This\n  allows us to specify which architecture to run the image on.\"\"\"\n  image = step['name']\n  if use_architecture_image_name:\n    image = _make_image_name_architecture_specific(image, build.architecture)\n  step['name'] = DOCKER_TOOL_IMAGE\n  if build.is_arm:\n    platform = 'linux/arm64'\n  else:\n    platform = 'linux/amd64'\n  new_args = [\n      'run', '--platform', platform, '-v', '/workspace:/workspace',\n      '--privileged', '--cap-add=all'\n  ]\n\n  if container_name:\n    new_args.extend(['--name', container_name])\n\n  if 'env' in step:\n    for env_var in step.get('env', {}):\n      new_args.extend(['-e', env_var])\n  new_args += ['-t', image]\n  new_args += step['args']\n  step['args'] = new_args\n  return step\n\n\ndef get_upload_bucket(engine, architecture, testing):\n  \"\"\"Returns the upload bucket for |engine| and architecture. Returns the\n  testing bucket if |testing|.\"\"\"\n  bucket = ENGINE_INFO[engine].upload_bucket\n  if architecture != 'x86_64':\n    bucket += '-' + architecture\n  if testing:\n    bucket += '-testing'\n  return bucket\n\n\ndef _get_targets_list(project_name):\n  \"\"\"Returns target list.\"\"\"\n  # libFuzzer ASan 'x86_84' is the default configuration, get list of targets\n  # from it.\n  # We never want the target list from the testing bucket, the testing bucket is\n  # only for uploading.\n  bucket = get_upload_bucket('libfuzzer', 'x86_64', testing=None)\n  url = get_targets_list_url(bucket, project_name, 'address')\n\n  url = urlparse.urljoin(GCS_URL_BASENAME, url)\n  response = requests.get(url)\n  if not response.status_code == 200:\n    sys.stderr.write('Failed to get list of targets from \"%s\".\\n' % url)\n    sys.stderr.write('Status code: %d \\t\\tText:\\n%s\\n' %\n                     (response.status_code, response.text))\n    return None\n\n  return response.text.split()\n\n\ndef _sign_client_id():\n  service_account_path = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS')\n  if service_account_path:\n    creds = (\n        service_account_lib.ServiceAccountCredentials.from_json_keyfile_name(\n            os.environ['GOOGLE_APPLICATION_CREDENTIALS']))\n    return creds.service_account_email\n  else:\n    _, project = google.auth.default()\n    return project + '@appspot.gserviceaccount.com'\n\n\ndef _sign_blob(blob):\n  service_account_path = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS')\n  if service_account_path:\n    creds = (\n        service_account_lib.ServiceAccountCredentials.from_json_keyfile_name(\n            os.environ['GOOGLE_APPLICATION_CREDENTIALS']))\n    client_id = creds.service_account_email\n    signature = base64.b64encode(creds.sign_blob(blob)[1])\n  else:\n    credentials, project = google.auth.default()\n    iam = googleapiclient.discovery.build('iamcredentials',\n                                          'v1',\n                                          credentials=credentials,\n                                          cache_discovery=False)\n    client_id = project + '@appspot.gserviceaccount.com'\n    service_account = f'projects/-/serviceAccounts/{client_id}'\n    response = iam.projects().serviceAccounts().signBlob(\n        name=service_account,\n        body={\n            'delegates': [],\n            'payload': base64.b64encode(blob.encode('utf-8')).decode('utf-8'),\n        }).execute()\n    signature = response['signedBlob']\n\n  return client_id, signature\n\n\n# TODO(ochang): Migrate older signed URLs to V4 signatures.\ndef get_signed_policy_document_upload_prefix(bucket, path_prefix):\n  now = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)\n  timestamp = now.strftime('%Y%m%dT%H%M%SZ')\n  datestamp = now.date().strftime('%Y%m%d')\n  expiry = now + datetime.timedelta(hours=24)\n\n  client_id = _sign_client_id()\n  x_goog_credential = f'{client_id}/{datestamp}/auto/storage/goog4_request'\n\n  doc = {\n      'expiration':\n          expiry.isoformat() + 'Z',\n      'conditions': [[\n          'starts-with',\n          '$key',\n          path_prefix,\n      ], {\n          'bucket': bucket,\n      }, {\n          'x-goog-algorithm': 'GOOG4-RSA-SHA256'\n      }, {\n          'x-goog-credential': x_goog_credential\n      }, {\n          'x-goog-date': timestamp\n      }]\n  }\n\n  encoded = base64.b64encode(json.dumps(doc).encode()).decode()\n  client_id, signature = _sign_blob(encoded)\n\n  return SignedPolicyDocument(\n      bucket=bucket,\n      policy=encoded,\n      x_goog_algorithm='GOOG4-RSA-SHA256',\n      x_goog_credential=x_goog_credential,\n      x_goog_date=timestamp,\n      x_goog_signature=binascii.hexlify(base64.b64decode(signature)).decode(),\n  )\n\n\n# pylint: disable=no-member\ndef get_signed_url(path, method='PUT', content_type=''):\n  \"\"\"Returns signed url.\"\"\"\n  timestamp = int(time.time() + BUILD_TIMEOUT)\n  blob = f'{method}\\n\\n{content_type}\\n{timestamp}\\n{path}'\n\n  client_id, signature = _sign_blob(blob)\n  values = {\n      'GoogleAccessId': client_id,\n      'Expires': timestamp,\n      'Signature': signature,\n  }\n  return f'https://storage.googleapis.com{path}?{urlparse.urlencode(values)}'\n\n\ndef _normalized_name(name):\n  \"\"\"Return normalized name with special chars like slash, colon, etc normalized\n  to hyphen(-). This is important as otherwise these chars break local and cloud\n  storage paths.\"\"\"\n  return SPECIAL_CHARS_REGEX.sub('-', name).strip('-')\n\n\ndef download_corpora_steps(project_name, test_image_suffix):\n  \"\"\"Returns GCB steps for downloading corpora backups for the given project.\n  \"\"\"\n  fuzz_targets = _get_targets_list(project_name)\n  if not fuzz_targets:\n    return None, f'No fuzz targets found for project \"{project_name}\".'\n\n  steps = []\n  # Split fuzz targets into batches of CORPUS_DOWNLOAD_BATCH_SIZE.\n  for i in range(0, len(fuzz_targets), CORPUS_DOWNLOAD_BATCH_SIZE):\n    download_corpus_args = []\n    for binary_name in fuzz_targets[i:i + CORPUS_DOWNLOAD_BATCH_SIZE]:\n      qualified_name = binary_name\n      qualified_name_prefix = '%s_' % project_name\n      if not binary_name.startswith(qualified_name_prefix):\n        qualified_name = qualified_name_prefix + binary_name\n\n      # Normalize qualified_name name.\n      qualified_name = _normalized_name(qualified_name)\n\n      url = get_signed_url(CORPUS_BACKUP_URL.format(project=project_name,\n                                                    fuzzer=qualified_name),\n                           method='GET')\n\n      corpus_archive_path = os.path.join('/corpus', binary_name + '.zip')\n      download_corpus_args.append('%s %s' % (corpus_archive_path, url))\n\n    steps.append({\n        'name': get_runner_image_name(test_image_suffix),\n        'entrypoint': 'download_corpus',\n        'args': download_corpus_args,\n        'volumes': [{\n            'name': 'corpus',\n            'path': '/corpus'\n        }],\n    })\n\n  return steps, None\n\n\ndef download_coverage_data_steps(project_name,\n                                 latest,\n                                 bucket_name,\n                                 out_dir,\n                                 base_image_tag=None):\n  \"\"\"Returns GCB steps to download coverage data for the given project\"\"\"\n  steps = []\n  fuzz_targets = _get_targets_list(project_name)\n  if not fuzz_targets:\n    sys.stderr.write('No fuzz targets found for project \"%s\".\\n' % project_name)\n    return None\n\n  runner_image_name = get_runner_image_name(base_image_tag=base_image_tag)\n\n  steps.append({\n      'name': runner_image_name,\n      'args': ['bash', '-c', (f'mkdir -p {out_dir}/textcov_reports')]\n  })\n\n  coverage_data_path = os.path.join(f'{out_dir}/textcov_reports/')\n  bucket_url = f'gs://{bucket_name}/{project_name}/textcov_reports/{latest}/*'\n  steps.append({\n      'name': 'gcr.io/cloud-builders/gsutil',\n      'args': ['-m', 'cp', '-r', bucket_url, coverage_data_path],\n      'allowFailure': True\n  })\n  steps.append({\n      'name': runner_image_name,\n      'args': ['bash', '-c', f'ls -lrt {out_dir}/textcov_reports'],\n      'allowFailure': True\n  })\n\n  return steps\n\n\ndef http_upload_step(data, signed_url, content_type):\n  \"\"\"Returns a GCB step to upload data to the given URL via GCS HTTP API.\"\"\"\n  step = {\n      'name':\n          'gcr.io/cloud-builders/curl',\n      'args': [\n          '-H',\n          'Content-Type: ' + content_type,\n          '-X',\n          'PUT',\n          '-d',\n          data,\n          signed_url,\n      ],\n  }\n  return step\n\n\ndef signed_policy_document_curl_args(doc: SignedPolicyDocument):\n  \"\"\"Signed policy document curl args.\"\"\"\n  return [\n      '-F',\n      'policy=' + doc.policy,\n      '-F',\n      'x-goog-algorithm=' + doc.x_goog_algorithm,\n      '-F',\n      'x-goog-date=' + doc.x_goog_date,\n      '-F',\n      'x-goog-credential=' + doc.x_goog_credential,\n      '-F',\n      'x-goog-signature=' + doc.x_goog_signature,\n  ]\n\n\ndef upload_using_signed_policy_document(file_path, upload_path,\n                                        doc: SignedPolicyDocument):\n  \"\"\"Upload using signed policy document.\"\"\"\n  step = {\n      'name':\n          'gcr.io/cloud-builders/curl',\n      'args':\n          signed_policy_document_curl_args(doc) + [\n              '-F',\n              f'key={upload_path}',\n              '-F',\n              f'file=@{file_path}',\n              f'https://{doc.bucket}.storage.googleapis.com',\n          ]\n  }\n  return step\n\n\ndef gsutil_rm_rf_step(url):\n  \"\"\"Returns a GCB step to recursively delete the object with given GCS url.\"\"\"\n  step = {\n      'name': 'gcr.io/cloud-builders/gsutil',\n      'entrypoint': 'sh',\n      'args': [\n          '-c',\n          'gsutil -m rm -rf %s || exit 0' % url,\n      ],\n  }\n  return step\n\n\ndef get_pull_test_images_steps(test_image_suffix):\n  \"\"\"Returns steps to pull testing versions of base-images and tag them so that\n  they are used in builds.\"\"\"\n  images = [\n      'gcr.io/oss-fuzz-base/base-builder',\n      'gcr.io/oss-fuzz-base/base-builder-swift',\n      'gcr.io/oss-fuzz-base/base-builder-javascript',\n      'gcr.io/oss-fuzz-base/base-builder-jvm',\n      'gcr.io/oss-fuzz-base/base-builder-go',\n      'gcr.io/oss-fuzz-base/base-builder-python',\n      'gcr.io/oss-fuzz-base/base-builder-ruby',\n      'gcr.io/oss-fuzz-base/base-builder-rust',\n      'gcr.io/oss-fuzz-base/base-runner',\n  ]\n  steps = []\n  for image in images:\n    test_image = image + '-' + test_image_suffix\n    steps.append({\n        'name': DOCKER_TOOL_IMAGE,\n        'args': [\n            'pull',\n            test_image,\n        ],\n        'waitFor': '-'  # Start this immediately, don't wait for previous step.\n    })\n\n    # This step is hacky but gives us great flexibility. OSS-Fuzz has hardcoded\n    # references to gcr.io/oss-fuzz-base/base-builder (in dockerfiles, for\n    # example) and gcr.io/oss-fuzz-base-runner (in this build code). But the\n    # testing versions of those images are called e.g.\n    # gcr.io/oss-fuzz-base/base-builder-testing and\n    # gcr.io/oss-fuzz-base/base-runner-testing. How can we get the build to use\n    # the testing images instead of the real ones? By doing this step: tagging\n    # the test image with the non-test version, so that the test version is used\n    # instead of pulling the real one.\n    steps.append({\n        'name': DOCKER_TOOL_IMAGE,\n        'args': ['tag', test_image, image],\n    })\n  return steps\n\n\ndef get_srcmap_step_id():\n  \"\"\"Returns the id for the srcmap step.\"\"\"\n  return 'srcmap'\n\n\ndef get_git_clone_step(repo_url='https://github.com/google/oss-fuzz.git',\n                       branch=None):\n  \"\"\"Returns the git clone step.\"\"\"\n  clone_step = {\n      'args': ['clone', repo_url, '--depth', '1'],\n      'name': 'gcr.io/cloud-builders/git',\n  }\n  if branch:\n    # Do this to support testing other branches.\n    clone_step['args'].extend(['--branch', branch])\n\n  return clone_step\n\n\ndef _make_image_name_architecture_specific(image_name, architecture):\n  \"\"\"Returns an architecture-specific name for |image_name|, based on |build|\"\"\"\n  return f'{image_name}-{architecture.lower()}'\n\n\ndef get_unique_build_step_image_id():\n  return uuid.uuid4()\n\n\ndef get_docker_build_step(image_names,\n                          directory,\n                          use_buildkit_cache=False,\n                          src_root='oss-fuzz',\n                          architecture='x86_64',\n                          cache_image='',\n                          build_args: Sequence[str] | None = None,\n                          dockerfile_path: str | None = None,\n                          additional_cache_from_tags: list | None = None):\n  \"\"\"Returns the docker build step.\"\"\"\n  assert len(image_names) >= 1\n  directory = os.path.join(src_root, directory)\n\n  if architecture != _ARM64:\n    args = ['build']\n  else:\n    args = [\n        'buildx', 'build', '--platform', 'linux/arm64', '--progress', 'plain',\n        '--load'\n    ]\n    # TODO(metzman): This wont work when we want to build the base-images.\n    image_names = [\n        _make_image_name_architecture_specific(image_name, architecture)\n        for image_name in image_names\n    ]\n  if cache_image:\n    args.extend(['--build-arg', f'CACHE_IMAGE={cache_image}'])\n\n  for image_name in sorted(image_names):\n    args.extend(['--tag', image_name])\n\n  if build_args:\n    for build_arg in build_args:\n      args.extend(['--build-arg', build_arg])\n\n  if dockerfile_path:\n    args.extend(['-f', dockerfile_path])\n\n  step = {\n      'name': DOCKER_TOOL_IMAGE,\n      'args': args,\n      'id': f'build-{get_unique_build_step_image_id()}',\n  }\n  # Handle buildkit args\n  # Note that we mutate \"args\" after making it a value in step.\n  if use_buildkit_cache:\n    env = ['DOCKER_BUILDKIT=1']\n    step['env'] = env\n    args.extend(['--build-arg', 'BUILDKIT_INLINE_CACHE=1'])\n\n    all_cache_tags = set(image_names)\n    if additional_cache_from_tags:\n      all_cache_tags.update(additional_cache_from_tags)\n\n    for image in sorted(list(all_cache_tags)):\n      args.extend(['--cache-from', image])\n\n  args.append(directory)\n\n  return step\n\n\ndef has_arm_build(architectures):\n  \"\"\"Returns True if project has an ARM build.\"\"\"\n  return 'aarch64' in architectures\n\n\ndef get_srcmap_steps(image, language, directory='/workspace'):\n  srcmap_step_id = get_srcmap_step_id()\n  return [{\n      'name': image,\n      'args': [\n          'bash', '-c',\n          f'srcmap > {directory}/srcmap.json && cat {directory}/srcmap.json'\n      ],\n      'env': [\n          'OSSFUZZ_REVISION=$REVISION_ID',\n          f'FUZZING_LANGUAGE={language}',\n      ],\n      'id': srcmap_step_id\n  }]\n\n\ndef get_project_image_steps(  # pylint: disable=too-many-arguments\n    name,\n    image,\n    language,\n    config,\n    architectures=None,\n    experiment=False,\n    cache_image=None,\n    srcmap=True):\n  \"\"\"Returns GCB steps to build OSS-Fuzz project image.\"\"\"\n  if architectures is None:\n    architectures = []\n\n  # TODO(metzman): Pass the URL to clone.\n  clone_step = get_git_clone_step(repo_url=config.repo, branch=config.branch)\n  if experiment:\n    # Skip cloning if we're in an experiment. The source is submitted to GCB\n    # via gcloud builds submit.\n    steps = []\n  else:\n    steps = [clone_step]\n  if config.test_image_suffix:\n    steps.extend(get_pull_test_images_steps(config.test_image_suffix))\n  src_root = 'oss-fuzz' if not experiment else '.'\n\n  docker_build_step = get_docker_build_step(\n      [image, _get_unsafe_name(name)],\n      os.path.join('projects', name),\n      src_root=src_root,\n      cache_image=cache_image)\n  steps.append(docker_build_step)\n  if srcmap:\n    steps.extend(get_srcmap_steps(image, language))\n\n  if has_arm_build(architectures):\n    builder_name = 'buildxbuilder'\n    steps.extend([\n        {\n            'name': 'gcr.io/cloud-builders/docker',\n            'args': ['run', '--privileged', 'linuxkit/binfmt:v0.8']\n        },\n        {\n            'name': DOCKER_TOOL_IMAGE,\n            'args': ['buildx', 'create', '--name', builder_name]\n        },\n        {\n            'name': DOCKER_TOOL_IMAGE,\n            'args': ['buildx', 'use', builder_name]\n        },\n    ])\n    docker_build_arm_step = get_docker_build_step(\n        [image, _get_unsafe_name(name)],\n        os.path.join('projects', name),\n        architecture=_ARM64)\n    steps.append(docker_build_arm_step)\n\n  if (config.build_type == 'fuzzing' and language in ('c', 'c++') and\n      not not config.testing and not config.experiment and config.upload):\n    logging.info('Pushing.')\n    # Push so that historical bugs are reproducible.\n    push_step = {\n        'name': 'gcr.io/cloud-builders/docker',\n        'args': ['push', _get_unsafe_name(name)],\n        'id': 'push-image',\n        'waitFor': [docker_build_step['id']],\n        'allowFailure': True\n    }\n    steps.append(push_step)\n\n  return steps\n\n\ndef _get_unsafe_name(name):\n  return f'us-central1-docker.pkg.dev/oss-fuzz/unsafe/{name}'\n\n\ndef get_logs_url(build_id):\n  \"\"\"Returns url that displays the build logs.\"\"\"\n  return (\n      f'https://oss-fuzz-gcb-logs.storage.googleapis.com/log-{build_id}.txt')\n\n\ndef get_gcb_url(build_id, cloud_project='oss-fuzz'):\n  \"\"\"Returns url where logs are displayed for the build.\"\"\"\n  return (\n      'https://console.cloud.google.com/cloud-build/builds;region=us-central1/'\n      f'{build_id}?project={cloud_project}')\n\n\ndef get_build_info_lines(build_id, cloud_project='oss-fuzz'):\n  \"\"\"Returns a list of strings with build information.\"\"\"\n  gcb_url = get_gcb_url(build_id, cloud_project)\n  log_url = get_logs_url(build_id)\n  return [\n      f'GCB Build ID: {build_id}',\n      f'GCB Build URL: {gcb_url}',\n      f'Log URL: {log_url}',\n  ]\n\n\ndef get_runner_image_name(test_image_suffix=None, base_image_tag=None):\n  \"\"\"Returns the runner image that should be used.\n\n  Returns the testing image if |test_image_suffix|.\n  \"\"\"\n  image = f'gcr.io/{BASE_IMAGES_PROJECT}/base-runner'\n\n  # For trial builds, the version is embedded in the suffix.\n  if test_image_suffix:\n    image += '-' + test_image_suffix\n    return image\n\n  # For local/manual runs, the version is passed as a tag.\n  # Only add a tag if it's specified and not 'legacy', as 'legacy' implies\n  # 'latest', which is the default behavior.\n  if base_image_tag and base_image_tag != 'legacy':\n    image += f\":{base_image_tag}\"\n\n  return image\n\n\ndef get_build_body(  # pylint: disable=too-many-arguments\n    steps,\n    timeout,\n    body_overrides,\n    tags,\n    use_build_pool=True,\n    experiment=False):\n  \"\"\"Helper function to create a build from |steps|.\"\"\"\n  if 'GCB_OPTIONS' in os.environ:\n    options = yaml.safe_load(os.environ['GCB_OPTIONS'])\n  else:\n    options = {}\n\n  if use_build_pool:\n    if experiment:\n      options['pool'] = {'name': OSS_FUZZ_EXPERIMENTS_BUILDPOOL_NAME}\n    # TODO: refactor all of this to make this less ugly.\n    elif 'indexer' in tags:\n      options['pool'] = {'name': OSS_FUZZ_INDEXER_BUILDPOOL_NAME}\n    else:\n      options['pool'] = {'name': OSS_FUZZ_BUILDPOOL_NAME}\n\n  build_body = {\n      'steps': steps,\n      'timeout': str(timeout) + 's',\n      'options': options,\n      'logsBucket': 'gs://oss-fuzz-gcb-logs',\n  }\n  if tags:\n    build_body['tags'] = tags\n\n  if body_overrides is None:\n    body_overrides = {}\n  for key, value in body_overrides.items():\n    build_body[key] = value\n  return build_body\n\n\ndef _tgz_local_build(oss_fuzz_project, temp_tgz_path):\n  \"\"\"Prepare a .tgz containing the files required to build\n  `oss_fuzz_project`.\"\"\"\n  # Just the projects/<project> dir should be sufficient.\n  project_rel_path = os.path.join('projects', oss_fuzz_project)\n  with tarfile.open(temp_tgz_path, 'w:gz') as tar:\n    tar.add(os.path.join(OSS_FUZZ_ROOT, project_rel_path),\n            arcname=project_rel_path)\n\n\ndef run_build(  # pylint: disable=too-many-arguments, too-many-locals\n    oss_fuzz_project,\n    steps,\n    credentials,\n    cloud_project,\n    timeout,\n    body_overrides=None,\n    tags=None,\n    use_build_pool=True,\n    experiment=False):\n  \"\"\"Runs the build.\"\"\"\n\n  build_body = get_build_body(steps,\n                              timeout,\n                              body_overrides,\n                              tags,\n                              use_build_pool=use_build_pool,\n                              experiment=experiment)\n  if experiment:\n    with tempfile.NamedTemporaryFile(suffix='source.tgz') as tgz_file:\n      # Archive the necessary files for the build.\n      _tgz_local_build(oss_fuzz_project, tgz_file.name)\n      gcs_client = storage.Client()\n      # This is the automatically created Cloud Build bucket for Cloud Build.\n      bucket_name = gcs_client.project + '_cloudbuild'\n      bucket = gcs_client.bucket(bucket_name)\n      blob_name = f'source/{str(uuid.uuid4())}.tgz'\n      blob = bucket.blob(blob_name)\n      logging.info(f'Uploading project to {bucket_name}/{blob_name}')\n      blob.upload_from_filename(tgz_file.name)\n\n      build_body['source'] = {\n          'storageSource': {\n              'bucket': bucket_name,\n              'object': blob_name,\n          }\n      }\n\n  cloudbuild = cloud_build('cloudbuild',\n                           'v1',\n                           credentials=credentials,\n                           cache_discovery=False,\n                           client_options=REGIONAL_CLIENT_OPTIONS)\n\n  build_info = cloudbuild.projects().builds().create(projectId=cloud_project,\n                                                     body=build_body).execute()\n  return build_info['metadata']['build']\n\n\ndef wait_for_build(build_id, credentials, cloud_project):\n  \"\"\"Wait for a GCB build.\"\"\"\n  cloudbuild = cloud_build('cloudbuild',\n                           'v1',\n                           credentials=credentials,\n                           cache_discovery=False,\n                           client_options=REGIONAL_CLIENT_OPTIONS)\n\n  while True:\n    try:\n      status = cloudbuild.projects().builds().get(projectId=cloud_project,\n                                                  id=build_id).execute()\n      if status.get('status') in ('SUCCESS', 'FAILURE', 'TIMEOUT',\n                                  'INTERNAL_ERROR', 'EXPIRED', 'CANCELLED'):\n        # Build done.\n        return\n    except (googleapiclient.errors.HttpError, BrokenPipeError):\n      pass\n\n    time.sleep(15)  # Avoid rate limiting.\n\n\ndef cancel_build(build_id, credentials, cloud_project):\n  \"\"\"Cancel a GCB build\"\"\"\n  cloudbuild = cloud_build('cloudbuild',\n                           'v1',\n                           credentials=credentials,\n                           cache_discovery=False,\n                           client_options=REGIONAL_CLIENT_OPTIONS)\n  cloudbuild.projects().builds().cancel(projectId=cloud_project,\n                                        id=build_id).execute()\n"
  },
  {
    "path": "infra/build/functions/build_project.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n#!/usr/bin/env python3\n\"\"\"Starts project build on Google Cloud Builder.\n\nUsage: build_project.py <project_dir>\n\"\"\"\n\nimport argparse\nfrom dataclasses import dataclass\nimport datetime\nimport json\nimport logging\nimport os\nimport posixpath\nimport re\nimport shlex\nimport sys\nfrom typing import Optional\n\nimport oauth2client.client\nimport six\nimport yaml\n\nimport build_lib\n\nFUZZING_BUILD_TYPE = 'fuzzing'\nINDEXER_BUILD_TYPE = 'indexer'\n\nGCB_LOGS_BUCKET = 'oss-fuzz-gcb-logs'\nGCB_EXPERIMENT_LOGS_BUCKET = 'oss-fuzz-gcb-experiment-logs'\n\nDEFAULT_ARCHITECTURES = ['x86_64']\nDEFAULT_ENGINES = ['libfuzzer', 'afl', 'honggfuzz', 'centipede']\nDEFAULT_SANITIZERS = ['address', 'undefined']\n\nLATEST_VERSION_FILENAME = 'latest.version'\nLATEST_VERSION_CONTENT_TYPE = 'text/plain'\n\nQUEUE_TTL_SECONDS = 60 * 60 * 24  # 24 hours.\n\nPROJECTS_DIR = os.path.abspath(\n    os.path.join(__file__, os.path.pardir, os.path.pardir, os.path.pardir,\n                 os.path.pardir, 'projects'))\n\nDEFAULT_OSS_FUZZ_REPO = 'https://github.com/google/oss-fuzz.git'\n\n# Used if build logs are uploaded to a separate place.\nLOCAL_BUILD_LOG_PATH = '/workspace/build.log'\nBUILD_SUCCESS_MARKER = '/workspace/build.succeeded'\n\n_CACHED_IMAGE = ('us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/'\n                 '{name}-ofg-cached-{sanitizer}')\n_CACHED_SANITIZERS = ('address', 'coverage')\n_INDEXED_CONTAINER_NAME = 'indexed-container'\n_TRACING_CONTAINER_NAME = 'tracing-container'\n\n\n@dataclass\nclass Config:\n  testing: bool = False\n  test_image_suffix: Optional[str] = None\n  base_image_tag: Optional[str] = None\n  repo: Optional[str] = DEFAULT_OSS_FUZZ_REPO\n  branch: Optional[str] = None\n  parallel: bool = False\n  upload: bool = True\n  experiment: bool = False\n  # TODO(ochang): This should be different per engine+sanitizer combination.\n  upload_build_logs: Optional[str] = None\n  build_type: Optional[str] = None\n  fuzzing_engine: Optional[str] = None\n  fuzz_target: Optional[str] = None\n\n\n# Allow the WORKDIR to be commented out for OSS-Fuzz-Gen, which creates new\n# Dockerfiles that inherit from cached verisons of the project images.\n# e.g.\n#   FROM us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/proj-ofg-cached-address\n#   # WORKDIR foo\n#   COPY new_target.c /src/proj/\n#\n# Because the WORKDIR is already set in the parent image and can be a relative\n# path, we can't set it again in the new Dockerfile.\n# However, we still need to know what the value is (for GCB), so we leave it\n# commented.\nWORKDIR_REGEX = re.compile(r'\\s*#?\\s*WORKDIR\\s*([^\\s]+)')\n\n\nclass Build:  # pylint: disable=too-few-public-methods\n  \"\"\"Class representing the configuration for a build.\"\"\"\n\n  def __init__(self, fuzzing_engine, sanitizer, architecture):\n    self.fuzzing_engine = fuzzing_engine\n    self.sanitizer = sanitizer\n    self.architecture = architecture\n    self.targets_list_filename = build_lib.get_targets_list_filename(\n        self.sanitizer)\n\n  @property\n  def is_arm(self):\n    \"\"\"Returns True if CPU architecture is ARM-based.\"\"\"\n    return self.architecture == 'aarch64'\n\n  @property\n  def out(self):\n    \"\"\"Returns the out directory for the build.\"\"\"\n    return posixpath.join(\n        '/workspace/out/',\n        f'{self.fuzzing_engine}-{self.sanitizer}-{self.architecture}')\n\n\ndef get_project_data(project_name):\n  \"\"\"(Local only) Returns a tuple containing the contents of the project.yaml\n  and Dockerfile of |project_name|. Raises a FileNotFoundError if there is no\n  Dockerfile for |project_name|.\"\"\"\n  project_dir = os.path.join(PROJECTS_DIR, project_name)\n  dockerfile_path = os.path.join(project_dir, 'Dockerfile')\n  try:\n    with open(dockerfile_path) as dockerfile:\n      dockerfile = dockerfile.read()\n  except FileNotFoundError:\n    raise\n  project_yaml_path = os.path.join(project_dir, 'project.yaml')\n  with open(project_yaml_path, 'r') as project_yaml_file_handle:\n    project_yaml_contents = project_yaml_file_handle.read()\n  project_yaml = yaml.safe_load(project_yaml_contents)\n  return project_yaml, dockerfile\n\n\ndef get_sanitizer_strings(sanitizers):\n  \"\"\"Accepts the sanitizers field from project.yaml where some sanitizers can be\n  defined as experimental. Returns a list of sanitizers.\"\"\"\n  processed_sanitizers = []\n  for sanitizer in sanitizers:\n    if isinstance(sanitizer, six.string_types):\n      processed_sanitizers.append(sanitizer)\n    elif isinstance(sanitizer, dict):\n      processed_sanitizers.extend(sanitizer.keys())\n\n  return processed_sanitizers\n\n\ndef set_default_sanitizer_for_centipede(project_yaml):\n  \"\"\"Adds none as a sanitizer for centipede in yaml if it does not exist yet.\"\"\"\n  # Centipede requires a separate unsanitized binary to use sanitized ones.\n  if ('centipede' in project_yaml['fuzzing_engines'] and\n      project_yaml['sanitizers'] and 'none' not in project_yaml['sanitizers']):\n    project_yaml['sanitizers'].append('none')\n\n\nclass Project:  # pylint: disable=too-many-instance-attributes\n  \"\"\"Class representing an OSS-Fuzz project.\"\"\"\n\n  def __init__(self, name, project_yaml, dockerfile):\n    project_yaml = project_yaml.copy()\n    set_yaml_defaults(project_yaml)\n\n    self.name = name\n    self.workdir = workdir_from_dockerfile(dockerfile)\n    self._sanitizers = project_yaml['sanitizers']\n    self.disabled = project_yaml['disabled']\n    self.architectures = project_yaml['architectures']\n    self.fuzzing_engines = project_yaml['fuzzing_engines']\n    self.coverage_extra_args = project_yaml['coverage_extra_args']\n    self.labels = project_yaml['labels']\n    self.fuzzing_language = project_yaml['language']\n    self.run_tests = project_yaml['run_tests']\n    self.base_os_version = project_yaml.get('base_os_version', 'legacy')\n    if 'main_repo' in project_yaml:\n      self.main_repo = project_yaml['main_repo']\n    else:\n      self.main_repo = ''\n\n    self.indexer_targets = project_yaml.get('indexer', {}).get('targets', [])\n\n    # This is set to enable build infra to use cached images (which are\n    # specific to a sanitizer).\n    # TODO: find a better way to handle this.\n    self.cached_sanitizer = None\n\n    # This is used by OSS-Fuzz-Gen, which generates fake project names for each\n    # benchmark. We still need access to the real project name in some cases.\n    self.real_name = self.name\n\n  @property\n  def sanitizers(self):\n    \"\"\"Returns processed sanitizers.\"\"\"\n    assert isinstance(self._sanitizers, list)\n    return get_sanitizer_strings(self._sanitizers)\n\n  @property\n  def image(self):\n    \"\"\"Returns the docker image for the project.\"\"\"\n    return f'gcr.io/{build_lib.IMAGE_PROJECT}/{self.name}'\n\n  @property\n  def cached_image(self):\n    return _CACHED_IMAGE.format(name=self.real_name,\n                                sanitizer=self.cached_sanitizer)\n\n\ndef get_last_step_id(steps):\n  \"\"\"Returns the id of the last step in |steps|.\"\"\"\n  return steps[-1]['id']\n\n\ndef set_yaml_defaults(project_yaml):\n  \"\"\"Sets project.yaml's default parameters.\"\"\"\n  project_yaml.setdefault('disabled', False)\n  project_yaml.setdefault('architectures', DEFAULT_ARCHITECTURES)\n  project_yaml.setdefault('sanitizers', DEFAULT_SANITIZERS)\n  project_yaml.setdefault('fuzzing_engines', DEFAULT_ENGINES)\n  project_yaml.setdefault('run_tests', True)\n  project_yaml.setdefault('coverage_extra_args', '')\n  project_yaml.setdefault('labels', {})\n  # Adds 'none' as a sanitizer for centipede to the project yaml by default,\n  # because Centipede always requires a separate build of unsanitized binary.\n  set_default_sanitizer_for_centipede(project_yaml)\n\n\ndef is_supported_configuration(build):\n  \"\"\"Check if the given configuration is supported.\"\"\"\n  fuzzing_engine_info = build_lib.ENGINE_INFO[build.fuzzing_engine]\n  if build.architecture == 'i386' and build.sanitizer != 'address':\n    return False\n  # TODO(jonathanmetzman): UBSan should be easy to support.\n  if build.architecture == 'aarch64' and (build.sanitizer\n                                          not in {'address', 'hwaddress'}):\n    return False\n  return (build.sanitizer in fuzzing_engine_info.supported_sanitizers and\n          build.architecture in fuzzing_engine_info.supported_architectures)\n\n\ndef workdir_from_dockerfile(dockerfile):\n  \"\"\"Parses WORKDIR from the Dockerfile.\"\"\"\n  dockerfile_lines = dockerfile.split('\\n')\n  for line in dockerfile_lines:\n    match = re.match(WORKDIR_REGEX, line)\n    if match:\n      # We need to escape '$' since they're used for subsitutions in Container\n      # Builer builds.\n      return match.group(1).replace('$', '$$')\n\n  return '/src'\n\n\ndef get_datetime_now():\n  \"\"\"Returns datetime.datetime.now(). Used for mocking.\"\"\"\n  return datetime.datetime.now()\n\n\ndef get_env(fuzzing_language, build, project_name=None):\n  \"\"\"Returns an environment for building. The environment is returned as a list\n  and is suitable for use as the \"env\" parameter in a GCB build step. The\n  environment variables are based on the values of |fuzzing_language| and\n  |build.\"\"\"\n  env_dict = {\n      'FUZZING_LANGUAGE': fuzzing_language,\n      'FUZZING_ENGINE': build.fuzzing_engine,\n      'SANITIZER': build.sanitizer,\n      'ARCHITECTURE': build.architecture,\n      # Set HOME so that it doesn't point to a persisted volume (see\n      # https://github.com/google/oss-fuzz/issues/6035).\n      'HOME': '/root',\n      'OUT': build.out,\n  }\n  if project_name is not None:\n    env_dict['PROJECT_NAME'] = project_name\n  return list(sorted([f'{key}={value}' for key, value in env_dict.items()]))\n\n\ndef get_compile_step(project,\n                     build,\n                     env,\n                     parallel,\n                     upload_build_logs=None,\n                     allow_failure=False):\n  \"\"\"Returns the GCB step for compiling |projects| fuzzers using |env|. The type\n  of build is specified by |build|.\"\"\"\n  failure_msg = (\n      '*' * 80 + '\\\\nFailed to build.\\\\nTo reproduce, run:\\\\n'\n      f'python infra/helper.py build_image {project.name}\\\\n'\n      'python infra/helper.py build_fuzzers --sanitizer '\n      f'{build.sanitizer} --engine {build.fuzzing_engine} --architecture '\n      f'{build.architecture} {project.name}\\\\n' + '*' * 80)\n  compile_output_redirect = ''\n\n  if upload_build_logs:\n    # Also write a build success marker because this step needs to succeed first\n    # for a subsequent step to upload the log.\n    compile_output_redirect = (\n        f'&> {LOCAL_BUILD_LOG_PATH} && touch {BUILD_SUCCESS_MARKER}')\n\n  compile_step = {\n      'name': project.image,\n      'env': env,\n      'args': [\n          'bash',\n          '-c',\n          # Remove /out to make sure there are non instrumented binaries.\n          # `cd /src && cd {workdir}` (where {workdir} is parsed from the\n          # Dockerfile). Container Builder overrides our workdir so we need\n          # to add this step to set it back.\n          (f'rm -r /out && cd /src && cd {project.workdir} && '\n           f'mkdir -p {build.out} && compile {compile_output_redirect}|| '\n           f'(echo \"{failure_msg}\" && false)'),\n      ],\n      'id': get_id('compile', build),\n  }\n\n  if upload_build_logs or allow_failure:\n    # The failure will be reported in a subsequent step.\n    compile_step['allowFailure'] = True\n\n  build_lib.dockerify_run_step(compile_step,\n                               build,\n                               use_architecture_image_name=build.is_arm)\n  maybe_add_parallel(compile_step, build_lib.get_srcmap_step_id(), parallel)\n  return compile_step\n\n\ndef maybe_add_parallel(step, wait_for_id, parallel):\n  \"\"\"Makes |step| run immediately after |wait_for_id| if |parallel|. Mutates\n  |step|.\"\"\"\n  if not parallel:\n    return\n  step['waitFor'] = wait_for_id\n\n\ndef get_id(step_type, build):\n  \"\"\"Returns a unique step id based on |step_type| and |build|. Useful for\n  parallelizing builds.\"\"\"\n  return (f'{step_type}-{build.fuzzing_engine}-{build.sanitizer}'\n          f'-{build.architecture}')\n\n\ndef get_build_steps(  # pylint: disable=too-many-locals, too-many-statements, too-many-branches, too-many-arguments\n    project_name,\n    project_yaml,\n    dockerfile,\n    config,\n    additional_env=None,\n    use_caching=False,\n    timestamp=None):\n  \"\"\"Returns build steps for project.\"\"\"\n\n  project = Project(project_name, project_yaml, dockerfile)\n  return get_build_steps_for_project(project,\n                                     config,\n                                     additional_env=additional_env,\n                                     use_caching=use_caching,\n                                     timestamp=timestamp), None\n\n\ndef get_build_steps_for_project(project,\n                                config,\n                                additional_env=None,\n                                use_caching=False,\n                                timestamp=None):\n  \"\"\"Returns build steps for project.\"\"\"\n\n  if not timestamp:\n    timestamp = get_datetime_now()\n\n  timestamp = timestamp.strftime('%Y%m%d%H%M')\n\n  if use_caching:\n    # For cached builds: the cache images are sanitizer-specific, so we need to\n    # do a rebuild prior to each compile.\n    build_steps = []\n  else:\n    # Non-cached builds just use a single builder image to build all sanitizers.\n    build_steps = build_lib.get_project_image_steps(\n        project.name,\n        project.image,\n        project.fuzzing_language,\n        config=config,\n        architectures=project.architectures,\n        experiment=config.experiment)\n\n  # Sort engines to make AFL first to test if libFuzzer has an advantage in\n  # finding bugs first since it is generally built first.\n  for fuzzing_engine in sorted(project.fuzzing_engines):\n    # Sort sanitizers and architectures so order is determinisitic (good for\n    # tests).\n    for sanitizer in sorted(project.sanitizers):\n      if use_caching and sanitizer in _CACHED_SANITIZERS:\n        project.cached_sanitizer = sanitizer\n        build_steps.extend(\n            build_lib.get_project_image_steps(\n                project.name,\n                project.image,\n                project.fuzzing_language,\n                config=config,\n                architectures=project.architectures,\n                experiment=config.experiment,\n                cache_image=project.cached_image))\n\n      # Build x86_64 before i386.\n      for architecture in reversed(sorted(project.architectures)):\n        build = Build(fuzzing_engine, sanitizer, architecture)\n        if not is_supported_configuration(build):\n          continue\n\n        env = get_env(project.fuzzing_language, build)\n        if additional_env:\n          env.extend(additional_env)\n\n        compile_step = get_compile_step(project, build, env, config.parallel,\n                                        config.upload_build_logs)\n        build_steps.append(compile_step)\n        if config.upload_build_logs:\n          build_steps.append({\n              'name':\n                  'gcr.io/cloud-builders/gsutil',\n              'args': [\n                  '-m', 'cp', LOCAL_BUILD_LOG_PATH, config.upload_build_logs\n              ],\n          })\n\n          # Report the build failure if it happened.\n          build_steps.append({\n              'name':\n                  project.image,\n              'args': [\n                  'bash', '-c',\n                  f'cat {LOCAL_BUILD_LOG_PATH} && test -f {BUILD_SUCCESS_MARKER}'\n              ],\n          })\n\n        if project.run_tests:\n          failure_msg = (\n              '*' * 80 + '\\\\nBuild checks failed.\\\\n'\n              'To reproduce, run:\\\\n'\n              f'python infra/helper.py build_image {project.name}\\\\n'\n              'python infra/helper.py build_fuzzers --sanitizer '\n              f'{build.sanitizer} --engine {build.fuzzing_engine} '\n              f'--architecture {build.architecture} {project.name}\\\\n'\n              'python infra/helper.py check_build --sanitizer '\n              f'{build.sanitizer} --engine {build.fuzzing_engine} '\n              f'--architecture {build.architecture} {project.name}\\\\n' +\n              '*' * 80)\n          # Test fuzz targets.\n          runner_image_name = build_lib.get_runner_image_name(\n              config.test_image_suffix, config.base_image_tag)\n          test_step = {\n              'name': runner_image_name,\n              'env': env,\n              'args': [\n                  'bash', '-c',\n                  f'test_all.py || (echo \"{failure_msg}\" && false)'\n              ],\n              'id': get_id('build-check', build)\n          }\n          build_lib.dockerify_run_step(test_step, build)\n          maybe_add_parallel(test_step, get_last_step_id(build_steps),\n                             config.parallel)\n          build_steps.append(test_step)\n\n        if project.labels:\n          # Write target labels.\n          build_steps.append({\n              'name':\n                  project.image,\n              'env':\n                  env,\n              'args': [\n                  '/usr/local/bin/write_labels.py',\n                  json.dumps(project.labels),\n                  build.out,\n              ],\n          })\n\n        build_steps.extend([\n            # Generate targets list.\n            {\n                'name':\n                    build_lib.get_runner_image_name(config.test_image_suffix,\n                                                    config.base_image_tag),\n                'env':\n                    env,\n                'args': [\n                    'bash', '-c',\n                    f'targets_list > /workspace/{build.targets_list_filename}'\n                ],\n            }\n        ])\n        if config.upload:\n          upload_steps = get_upload_steps(project, build, timestamp,\n                                          config.testing)\n          build_steps.extend(upload_steps)\n\n  return build_steps\n\n\ndef _indexer_built_image_name(name: str):\n  # TODO(ochang): Write this to a tar (via docker image save) and upload this to\n  # GCS.\n  return f'us-docker.pkg.dev/oss-fuzz/indexer/{name}'\n\n\ndef _tracer_built_image_name(name: str):\n  # TODO(ochang): Write this to a tar (via docker image save) and upload this to\n  # GCS.\n  return f'us-docker.pkg.dev/oss-fuzz/tracer/{name}'\n\n\ndef _create_indexed_build_steps(project,\n                                build,\n                                timestamp,\n                                env,\n                                indexer_targets,\n                                build_type='indexer'):\n  \"\"\"Creates the build steps for a specific indexer type.\"\"\"\n  if build_type == 'indexer':\n    container_name = _INDEXED_CONTAINER_NAME\n    image_name = _indexer_built_image_name(project.name)\n    build_script_command = '/opt/indexer/index_build.py'\n  elif build_type == 'tracer':\n    container_name = _TRACING_CONTAINER_NAME\n    image_name = _tracer_built_image_name(project.name)\n    build_script_command = (\n        '/opt/indexer/index_build.py --tracing-instrumentation')\n  else:\n    raise ValueError(f'Unknown build_type: {build_type}')\n\n  if indexer_targets:\n    build_script_command += ' -t ' + ','.join(indexer_targets)\n\n  command_sequence = [\n      'cd /src',\n      f'cd {project.workdir}',\n      f'mkdir -p {build.out}',\n      build_script_command,\n      # Enable re-building both the project and the indexes.\n      'cp -n /usr/local/bin/replay_build.sh $$SRC/',\n      # The following complicated dance is so that the resulting image works\n      # in a standalone way without the mount paths GCB installs by default\n      # (/workspace).\n      # First we save the $OUT contents into /outbak.\n      'mkdir -p /outbak && cp -a $$OUT/* /outbak/ && '\n      # Create a link from /out to the actual $OUT.\n      'rm -rf /out && ln -s $$OUT /out && '\n      # Unmount GCB's mount paths.\n      'umount /workspace && mkdir -p $$OUT && '\n      # Restore the actual contents into $OUT after unmounting.\n      'mv -T /outbak $$OUT && '\n      # Unshallow the main repository so we have easy access to the git history.\n      f'/usr/local/bin/unshallow_repos.py {project.main_repo}',\n  ]\n\n  build_step = {\n      'name': project.image,\n      'args': ['bash', '-c', ' && '.join(command_sequence)],\n      'env': env,\n  }\n  build_lib.dockerify_run_step(build_step,\n                               build,\n                               use_architecture_image_name=build.is_arm,\n                               container_name=container_name)\n\n  upload_steps = []\n  # TODO: Don't upload anything if we're in trial build.\n  if build_type == 'indexer':\n    prefix = f'indexer_indexes/{project.name}/{timestamp}/'\n    signed_policy_document = build_lib.get_signed_policy_document_upload_prefix(\n        'clusterfuzz-builds', prefix)\n    curl_signed_args = shlex.join(\n        build_lib.signed_policy_document_curl_args(signed_policy_document))\n    upload_steps = [\n        {\n            # TODO(metzman): Make sure not to include other tars, and support\n            # .tar.gz\n            'name': get_uploader_image(),\n            'args': [\n                '-c', f'for tar in {build.out}/*.tar; '\n                f'do curl {curl_signed_args} -F key=\"{prefix}$(basename $tar)\" '\n                f'-F file=\"@$tar\" https://{signed_policy_document.bucket}'\n                '.storage.googleapis.com; '\n                'done'\n            ],\n            'entrypoint': 'bash',\n            'allowFailure': True,\n        },\n        build_lib.upload_using_signed_policy_document('/workspace/srcmap.json',\n                                                      f'{prefix}srcmap.json',\n                                                      signed_policy_document)\n    ]\n\n  push_image_steps = [\n      {\n          'name':\n              build_lib.DOCKER_TOOL_IMAGE,\n          'args': [\n              'container', 'commit', '-c', 'ENV REPLAY_ENABLED 1',\n              container_name, image_name + f':{timestamp}'\n          ],\n      },\n      {\n          'name': build_lib.DOCKER_TOOL_IMAGE,\n          'args': ['tag', image_name + f':{timestamp}', image_name],\n      },\n      {\n          'name': build_lib.DOCKER_TOOL_IMAGE,\n          'args': ['push', '--all-tags', image_name],\n      },\n  ]\n  return [build_step] + upload_steps + push_image_steps\n\n\ndef get_indexer_build_steps(project_name,\n                            project_yaml,\n                            dockerfile,\n                            config,\n                            additional_env=None,\n                            use_caching=False,\n                            timestamp=None):\n  \"\"\"Get indexer build steps.\"\"\"\n  project = Project(project_name, project_yaml, dockerfile)\n\n  if project.fuzzing_language not in {'c', 'c++'}:\n    return [], f'Project \"{project.name}\" is written in \"{project.fuzzing_language}\", indexer is not supported yet.'\n\n  if not timestamp:\n    timestamp = get_datetime_now()\n  timestamp = timestamp.strftime('%Y%m%d%H%M')\n\n  build_steps = build_lib.get_project_image_steps(\n      project.name,\n      project.image,\n      project.fuzzing_language,\n      config=config,\n      architectures=project.architectures,\n      experiment=config.experiment)\n  build = Build('none', 'address', 'x86_64')\n  env = get_env(project.fuzzing_language, build, project.name)\n  env.append('INDEXER_BUILD=1')\n  env.append('CAPTURE_REPLAY_SCRIPT=1')\n\n  indexer_steps = _create_indexed_build_steps(project,\n                                              build,\n                                              timestamp,\n                                              env,\n                                              project.indexer_targets,\n                                              build_type='indexer')\n\n  tracer_steps = _create_indexed_build_steps(project,\n                                             build,\n                                             timestamp,\n                                             env,\n                                             project.indexer_targets,\n                                             build_type='tracer')\n  return build_steps + indexer_steps + tracer_steps, None\n\n\ndef get_targets_list_upload_step(bucket, project, build, uploader_image):\n  \"\"\"Returns the step to upload targets_list for |build| of |project| to\n  |bucket|.\"\"\"\n  targets_list_url = build_lib.get_signed_url(\n      build_lib.get_targets_list_url(bucket, project.name, build.sanitizer))\n  return {\n      'name': uploader_image,\n      'args': [\n          f'/workspace/{build.targets_list_filename}',\n          targets_list_url,\n      ],\n  }\n\n\ndef get_uploader_image():\n  \"\"\"Returns the uploader base image in |base_images_project|.\"\"\"\n  return f'gcr.io/{build_lib.BASE_IMAGES_PROJECT}/uploader'\n\n\ndef get_upload_steps(project, build, timestamp, testing):\n  \"\"\"Returns the steps for uploading the fuzzer build specified by |project| and\n  |build|. Uses |timestamp| for naming the uploads. Uses |testing| for\n  determining which image to use for the upload.\"\"\"\n  bucket = build_lib.get_upload_bucket(build.fuzzing_engine, build.architecture,\n                                       testing)\n  stamped_name = '-'.join([project.name, build.sanitizer, timestamp])\n  zip_file = stamped_name + '.zip'\n  upload_url = build_lib.get_signed_url(\n      build_lib.GCS_UPLOAD_URL_FORMAT.format(bucket, project.name, zip_file))\n  stamped_srcmap_file = stamped_name + '.srcmap.json'\n  srcmap_url = build_lib.get_signed_url(\n      build_lib.GCS_UPLOAD_URL_FORMAT.format(bucket, project.name,\n                                             stamped_srcmap_file))\n  latest_version_file = '-'.join(\n      [project.name, build.sanitizer, LATEST_VERSION_FILENAME])\n  latest_version_url = build_lib.GCS_UPLOAD_URL_FORMAT.format(\n      bucket, project.name, latest_version_file)\n  latest_version_url = build_lib.get_signed_url(\n      latest_version_url, content_type=LATEST_VERSION_CONTENT_TYPE)\n  uploader_image = get_uploader_image()\n\n  upload_steps = [\n      # Zip binaries.\n      {\n          'name': project.image,\n          'args': ['bash', '-c', f'cd {build.out} && zip -r {zip_file} *'],\n      },\n      # Upload srcmap.\n      {\n          'name': uploader_image,\n          'args': [\n              '/workspace/srcmap.json',\n              srcmap_url,\n          ],\n      },\n      # Upload binaries.\n      {\n          'name': uploader_image,\n          'args': [\n              os.path.join(build.out, zip_file),\n              upload_url,\n          ],\n      },\n      # Upload targets list.\n      get_targets_list_upload_step(bucket, project, build, uploader_image),\n      # Upload the latest.version file.\n      build_lib.http_upload_step(zip_file, latest_version_url,\n                                 LATEST_VERSION_CONTENT_TYPE),\n      # Cleanup.\n      get_cleanup_step(project, build),\n  ]\n  return upload_steps\n\n\ndef get_cleanup_step(project, build):\n  \"\"\"Returns the step for cleaning up after doing |build| of |project|.\"\"\"\n  return {\n      'name': project.image,\n      'args': [\n          'bash',\n          '-c',\n          'rm -r ' + build.out,\n      ],\n  }\n\n\n# pylint: disable=no-member,too-many-arguments\ndef run_build(oss_fuzz_project,\n              build_steps,\n              credentials,\n              build_type,\n              cloud_project='oss-fuzz',\n              extra_tags=None,\n              experiment=False,\n              timeout=None):\n  \"\"\"Run the build for given steps on cloud build. |build_steps| are the steps\n  to run. |credentials| are are used to authenticate to GCB and build in\n  |cloud_project|. |oss_fuzz_project| and |build_type| are used to tag the build\n  in GCB so the build can be queried for debugging purposes.\"\"\"\n  if extra_tags is None:\n    extra_tags = []\n  tags = [oss_fuzz_project + '-' + build_type, build_type, oss_fuzz_project]\n  tags.extend(extra_tags)\n  if timeout is None:\n    timeout = build_lib.BUILD_TIMEOUT\n  bucket = GCB_LOGS_BUCKET if not experiment else GCB_EXPERIMENT_LOGS_BUCKET\n  body_overrides = {\n      'logsBucket': bucket,\n      'queueTtl': str(QUEUE_TTL_SECONDS) + 's',\n  }\n  return build_lib.run_build(oss_fuzz_project,\n                             build_steps,\n                             credentials,\n                             cloud_project,\n                             timeout,\n                             body_overrides=body_overrides,\n                             tags=tags,\n                             experiment=experiment)\n\n\ndef parse_args(description, args):\n  \"\"\"Parses command line arguments (or args if it is not None) and returns them.\n  Suitable for a build script.\"\"\"\n  parser = argparse.ArgumentParser(sys.argv[0], description=description)\n  parser.add_argument('projects', help='Projects.', nargs='+')\n  parser.add_argument('--testing',\n                      action='store_true',\n                      required=False,\n                      default=False,\n                      help='Upload to testing buckets.')\n  parser.add_argument('--test-image-suffix',\n                      required=False,\n                      default=None,\n                      help='Use testing base-images.')\n  parser.add_argument('--repo',\n                      required=False,\n                      default=DEFAULT_OSS_FUZZ_REPO,\n                      help='Use specified OSS-Fuzz repo.')\n  parser.add_argument('--branch',\n                      required=False,\n                      default=None,\n                      help='Use specified OSS-Fuzz branch.')\n  parser.add_argument('--parallel',\n                      action='store_true',\n                      required=False,\n                      default=False,\n                      help='Do builds in parallel.')\n  parser.add_argument('--experiment',\n                      action='store_true',\n                      required=False,\n                      default=False,\n                      help='Configuration for experiments.')\n  parser.add_argument('--fuzzing-engine',\n                      required=False,\n                      default='libfuzzer',\n                      help='Fuzzing engine name.')\n  parser.add_argument('--fuzz-target',\n                      required=False,\n                      default='',\n                      help='Fuzz target name.')\n  return parser.parse_args(args)\n\n\ndef create_config(args, build_type, base_image_tag=None):\n  \"\"\"Create a Config object from parsed command line |args|.\"\"\"\n  upload = not args.experiment\n  return Config(testing=args.testing,\n                test_image_suffix=args.test_image_suffix,\n                base_image_tag=base_image_tag,\n                branch=args.branch,\n                parallel=args.parallel,\n                upload=upload,\n                experiment=args.experiment,\n                build_type=build_type,\n                fuzzing_engine=args.fuzzing_engine,\n                fuzz_target=args.fuzz_target)\n\n\ndef build_script_main(script_description,\n                      get_build_steps_func,\n                      build_type,\n                      args=None):\n  \"\"\"Gets arguments from command line using |script_description| as helpstring\n  description or from args. Gets build_steps using |get_build_steps_func| and\n  then runs those steps on GCB, tagging the builds with |build_type|. Returns 0\n  on success, 1 on failure.\"\"\"\n  args = parse_args(script_description, args)\n  logging.basicConfig(level=logging.INFO)\n\n  credentials = oauth2client.client.GoogleCredentials.get_application_default()\n  error = False\n  for project_name in args.projects:\n    try:\n      project_yaml, dockerfile_contents = get_project_data(project_name)\n    except FileNotFoundError:\n      logging.error('Couldn\\'t get project data. Skipping %s.', project_name)\n      error = True\n      continue\n\n    base_image_tag = project_yaml.get('base_os_version', 'legacy')\n    if base_image_tag == 'legacy':\n      base_image_tag = None\n    config = create_config(args, build_type, base_image_tag=base_image_tag)\n\n    steps, _ = get_build_steps_func(project_name, project_yaml,\n                                    dockerfile_contents, config)\n    if not steps:\n      logging.error('No steps. Skipping %s.', project_name)\n      error = True\n      continue\n\n    run_build(project_name,\n              steps,\n              credentials,\n              build_type,\n              experiment=args.experiment)\n  return 0 if not error else 1\n\n\ndef main():\n  \"\"\"Build and run projects.\"\"\"\n  return build_script_main('Builds a project on GCB.', get_build_steps,\n                           FUZZING_BUILD_TYPE)\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/build/functions/build_project_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unit tests for build_project.\"\"\"\nimport json\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\nfrom pyfakefs import fake_filesystem_unittest\n\nFUNCTIONS_DIR = os.path.dirname(__file__)\nsys.path.append(FUNCTIONS_DIR)\n# pylint: disable=wrong-import-position\n\nimport build_project\nimport test_utils\n\n# pylint: disable=no-member\n\n\nclass TestRequestCoverageBuilds(fake_filesystem_unittest.TestCase):\n  \"\"\"Unit tests for sync.\"\"\"\n\n  def setUp(self):\n    self.maxDiff = None  # pylint: disable=invalid-name\n    self.setUpPyfakefs()\n\n  @mock.patch('build_lib.get_signed_url', return_value='test_url')\n  @mock.patch('build_project.get_datetime_now',\n              return_value=test_utils.FAKE_DATETIME)\n  @mock.patch('build_lib.get_unique_build_step_image_id',\n              return_value='UNIQUE_ID')\n  def test_get_build_steps(self, mock_url, mock_get_datetime_now, mock_get_id):\n    \"\"\"Test for get_build_steps.\"\"\"\n    del mock_url, mock_get_datetime_now\n    project_yaml_contents = (\n        'language: c++\\n'\n        'sanitizers:\\n'\n        '  - address\\n'\n        '  - memory\\n'\n        '  - undefined\\n'\n        'architectures:\\n'\n        '  - x86_64\\n'\n        '  - i386\\n'\n        '  - aarch64\\n'\n        'main_repo: https://github.com/google/oss-fuzz.git\\n')\n    self.fs.create_dir(test_utils.PROJECT_DIR)\n    test_utils.create_project_data(test_utils.PROJECT, project_yaml_contents)\n\n    expected_build_steps_file_path = test_utils.get_test_data_file_path(\n        'expected_build_steps.json')\n    self.fs.add_real_file(expected_build_steps_file_path)\n    with open(expected_build_steps_file_path) as expected_build_steps_file:\n      expected_build_steps = json.load(expected_build_steps_file)\n\n    config = build_project.Config(upload=True)\n    project_yaml, dockerfile = build_project.get_project_data(\n        test_utils.PROJECT)\n    build_steps, _ = build_project.get_build_steps(test_utils.PROJECT,\n                                                   project_yaml, dockerfile,\n                                                   config)\n    self.assertEqual(build_steps, expected_build_steps)\n\n  @mock.patch('build_lib.get_signed_url', return_value='test_url')\n  @mock.patch('build_project.get_datetime_now',\n              return_value=test_utils.FAKE_DATETIME)\n  @mock.patch('build_lib.get_unique_build_step_image_id',\n              return_value='UNIQUE_ID')\n  def test_get_centipede_build_steps(self, mock_url, mock_get_datetime_now,\n                                     mock_get_id):\n    \"\"\"Test for get_build_steps of centipede.\"\"\"\n    del mock_url, mock_get_datetime_now\n    # The none sanitizer should be added automatically when other sanitizers are\n    # specified by the users.\n    project_yaml_contents = (\n        'language: c++\\n'\n        'fuzzing_engines:\\n'\n        '  - centipede\\n'\n        'sanitizers:\\n'\n        '  - address\\n'\n        'architectures:\\n'\n        '  - x86_64\\n'\n        'main_repo: https://github.com/google/centipede.git\\n')\n    self.fs.create_dir(test_utils.PROJECT_DIR)\n    test_utils.create_project_data(test_utils.PROJECT, project_yaml_contents)\n\n    expected_build_steps_file_path = test_utils.get_test_data_file_path(\n        'expected_centipede_build_steps.json')\n    self.fs.add_real_file(expected_build_steps_file_path)\n    with open(expected_build_steps_file_path) as expected_build_steps_file:\n      expected_build_steps = json.load(expected_build_steps_file)\n\n    config = build_project.Config(upload=True)\n    project_yaml, dockerfile = build_project.get_project_data(\n        test_utils.PROJECT)\n    build_steps, _ = build_project.get_build_steps(test_utils.PROJECT,\n                                                   project_yaml, dockerfile,\n                                                   config)\n    self.assertEqual(build_steps, expected_build_steps)\n\n  @mock.patch('build_lib.get_signed_url', return_value='test_url')\n  @mock.patch('build_project.get_datetime_now',\n              return_value=test_utils.FAKE_DATETIME)\n  @mock.patch('build_lib.get_unique_build_step_image_id',\n              return_value='UNIQUE_ID')\n  def test_get_build_steps_ubuntu_24_04(self, mock_url, mock_get_datetime_now,\n                                        mock_get_id):\n    \"\"\"Test for get_build_steps with ubuntu-24-04.\"\"\"\n    del mock_url, mock_get_datetime_now\n    project_yaml_contents = (\n        'language: c++\\n'\n        'base_os_version: ubuntu-24-04\\n'\n        'sanitizers:\\n'\n        '  - address\\n'\n        '  - memory\\n'\n        '  - undefined\\n'\n        'architectures:\\n'\n        '  - x86_64\\n'\n        '  - i386\\n'\n        '  - aarch64\\n'\n        'main_repo: https://github.com/google/oss-fuzz.git\\n')\n    self.fs.create_dir(test_utils.PROJECT_DIR)\n    test_utils.create_project_data(test_utils.PROJECT, project_yaml_contents)\n\n    expected_build_steps_file_path = test_utils.get_test_data_file_path(\n        'expected_build_steps_ubuntu_24_04.json')\n    self.fs.add_real_file(expected_build_steps_file_path)\n    with open(expected_build_steps_file_path) as expected_build_steps_file:\n      expected_build_steps = json.load(expected_build_steps_file)\n\n    config = build_project.Config(upload=True)\n    project_yaml, dockerfile = build_project.get_project_data(\n        test_utils.PROJECT)\n    config.base_image_tag = project_yaml.get('base_os_version')\n    build_steps, _ = build_project.get_build_steps(test_utils.PROJECT,\n                                                   project_yaml, dockerfile,\n                                                   config)\n    self.assertEqual(build_steps, expected_build_steps)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/functions/datastore_entities.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud datastore entity classes.\"\"\"\nfrom google.cloud import ndb\n\n\n# pylint: disable=too-few-public-methods\nclass Project(ndb.Model):\n  \"\"\"Represents an integrated OSS-Fuzz project.\"\"\"\n  name = ndb.StringProperty()\n  schedule = ndb.StringProperty()\n  project_yaml_contents = ndb.TextProperty()\n  dockerfile_contents = ndb.TextProperty()\n\n\n# pylint: disable=too-few-public-methods\nclass GithubCreds(ndb.Model):\n  \"\"\"Represents GitHub credentials.\"\"\"\n  client_id = ndb.StringProperty()\n  client_secret = ndb.StringProperty()\n\n\n# pylint: disable=too-few-public-methods\nclass BuildsHistory(ndb.Model):\n  \"\"\"Container for build history of projects.\"\"\"\n  build_tag = ndb.StringProperty()\n  project = ndb.StringProperty()\n  build_ids = ndb.StringProperty(repeated=True)\n\n\nclass LastSuccessfulBuild(ndb.Model):\n  \"\"\"Container for storing last successful build of project.\"\"\"\n  build_tag = ndb.StringProperty()\n  project = ndb.StringProperty()\n  build_id = ndb.StringProperty()\n  finish_time = ndb.StringProperty()\n"
  },
  {
    "path": "infra/build/functions/deploy.sh",
    "content": "#!/bin/bash -ex\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBASE_IMAGE_JOB_TOPIC=schedule-base-image-build\nBASE_IMAGE_SCHEDULER_JOB=base-image-scheduler\nBASE_IMAGE_SCHEDULE=\"0 3 * * *\"\nBASE_IMAGE_MESSAGE=\"Start base image build\"\n\nBUILD_JOB_TOPIC=request-build\n\nCOVERAGE_BUILD_JOB_TOPIC=request-coverage-build\nINTROSPECTOR_BUILD_JOB_TOPIC=request-introspector-build\n\nSYNC_JOB_TOPIC=schedule-project-sync\nSYNC_SCHEDULER_JOB=sync-scheduler\nSYNC_JOB_SCHEDULE=\"*/30 * * * *\"\nSYNC_MESSAGE=\"Start Sync\"\n\nfunction deploy_pubsub_topic {\n\ttopic=$1\n\tproject=$2\n\n\tif ! gcloud pubsub topics describe $topic --project $project ;\n\t\tthen\n\t\t\tgcloud pubsub topics create $topic \\\n\t\t\t--project $project\n\tfi\n}\n\nfunction deploy_scheduler {\n\tscheduler_name=$1\n\tschedule=\"$2\"\n\ttopic=$3\n\tmessage=\"$4\"\n\tproject=$5\n\n\tif gcloud scheduler jobs describe $scheduler_name --project $project ;\n\t\tthen\n\t\t\tgcloud scheduler jobs update pubsub $scheduler_name \\\n\t\t\t--project $project \\\n\t\t\t--schedule \"$schedule\" \\\n\t\t\t--topic $topic \\\n\t\t\t--message-body \"$message\"\n\t\telse\n\t\t\tgcloud scheduler jobs create pubsub $scheduler_name \\\n\t\t\t--project $project \\\n\t\t\t--schedule \"$schedule\" \\\n\t\t\t--topic $topic \\\n\t\t\t--message-body \"$message\"\n\tfi\n}\n\nfunction deploy_cloud_function {\n\tname=$1\n\tentry_point=$2\n\ttopic=$3\n\tproject=$4\n\n\tgcloud functions deploy $name \\\n\t--entry-point $entry_point \\\n\t--trigger-topic $topic \\\n\t--runtime python311 \\\n\t--project $project \\\n\t--timeout 540 \\\n\t--region us-central1 \\\n\t--set-env-vars GCP_PROJECT=$project,FUNCTION_REGION=us-central1 \\\n\t--max-instances 1 \\\n\t--memory 4096MB\n}\n\nif [ $# == 1 ]; then\n\tPROJECT_ID=$1\nelse\n\techo -e \"\\n Usage ./deploy.sh <project-name>\"; exit;\nfi\n\ndeploy_pubsub_topic $BUILD_JOB_TOPIC $PROJECT_ID\ndeploy_pubsub_topic $SYNC_JOB_TOPIC $PROJECT_ID\ndeploy_pubsub_topic $BASE_IMAGE_JOB_TOPIC $PROJECT_ID\ndeploy_pubsub_topic $COVERAGE_BUILD_JOB_TOPIC $PROJECT_ID\ndeploy_pubsub_topic $INTROSPECTOR_BUILD_JOB_TOPIC $PROJECT_ID\n\ndeploy_scheduler $SYNC_SCHEDULER_JOB \\\n\t\t\t\t \"$SYNC_JOB_SCHEDULE\" \\\n\t\t\t\t $SYNC_JOB_TOPIC \\\n\t\t\t\t \"$SYNC_MESSAGE\" \\\n\t\t\t\t  $PROJECT_ID\n\ndeploy_scheduler $BASE_IMAGE_SCHEDULER_JOB \\\n\t\t\t\t \"$BASE_IMAGE_SCHEDULE\" \\\n\t\t\t\t  $BASE_IMAGE_JOB_TOPIC \\\n\t\t\t\t  \"$BASE_IMAGE_MESSAGE\" \\\n\t\t\t\t  $PROJECT_ID\n\ndeploy_cloud_function sync \\\n\t\t\t\t\t  sync \\\n\t\t\t\t\t  $SYNC_JOB_TOPIC \\\n\t\t\t\t\t  $PROJECT_ID\n\ndeploy_cloud_function base-image-build \\\n\t\t\t\t\t  build_base_images \\\n\t\t\t\t\t  $BASE_IMAGE_JOB_TOPIC \\\n\t\t\t\t\t  $PROJECT_ID\n\ndeploy_cloud_function request-build \\\n\t\t\t\t\t  build_project \\\n\t\t\t\t\t  $BUILD_JOB_TOPIC \\\n\t\t\t\t\t  $PROJECT_ID\n\ndeploy_cloud_function request-coverage-build \\\n\t\t\t\t\t  coverage_build \\\n\t\t\t\t\t  $COVERAGE_BUILD_JOB_TOPIC \\\n\t\t\t\t\t  $PROJECT_ID\n\ndeploy_cloud_function request-introspector-build \\\n\t\t\t\t\t  introspector_build \\\n\t\t\t\t\t  $INTROSPECTOR_BUILD_JOB_TOPIC \\\n\t\t\t\t\t  $PROJECT_ID\n\ngcloud datastore indexes create index.yaml --project $PROJECT_ID\n"
  },
  {
    "path": "infra/build/functions/fuzzbench.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Does fuzzbench runs on Google Cloud Build.\"\"\"\n\nimport json\nimport logging\nimport os\nimport random\nimport requests\nimport sys\n\nimport build_lib\nimport build_project\nimport ood_upload_corpus\n\nINFRA_DIR = os.path.dirname(\n    os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nsys.path.append(os.path.join(INFRA_DIR, 'cifuzz'))\nimport clusterfuzz_deployment\nimport config_utils\n\nFUZZBENCH_BUILD_TYPE = 'coverage'\nFUZZBENCH_PATH = '/fuzzbench'\nGCB_WORKSPACE_DIR = '/workspace'\nMAX_FUZZING_DURATION = 1800\nOOD_OUTPUT_CORPUS_DIR = f'{GCB_WORKSPACE_DIR}/ood_output_corpus'\nOOD_CRASHES_DIR = f'{GCB_WORKSPACE_DIR}/crashes'\n\n\ndef get_engine_project_image_name(fuzzing_engine, project):\n  \"\"\"Returns the name of an image used to build |project| with\n  |fuzzing_engine|.\"\"\"\n  return f'gcr.io/oss-fuzz-base/{fuzzing_engine}/{project.name}'\n\n\ndef get_ood_image_name(fuzzing_engine, project):\n  \"\"\"Returns the name of an OSS-Fuzz on Demand image.\"\"\"\n  # TODO(andrenribeiro): Abstract the OOD image name generation to a separate\n  # location.\n  return f'us-central1-docker.pkg.dev/oss-fuzz/unsafe/ood/{fuzzing_engine}/{project.name}'\n\n\ndef get_gcs_public_corpus_url(project, fuzz_target_name):\n  \"\"\"Returns the url of a public gcs seed corpus.\"\"\"\n  return (\n      f'https://storage.googleapis.com/{project.name}-backup.clusterfuzz-'\n      f'external.appspot.com/corpus/libFuzzer/{project.name}_{fuzz_target_name}'\n      f'/public.zip')\n\n\ndef get_latest_libfuzzer_build(project_name):\n  \"\"\"Returns the latest LibFuzzer build gsutil URI and the build file name.\"\"\"\n  # Mandatory environment variables required to obtain the latest build name\n  os.environ['CIFUZZ_TEST'] = 'True'\n  os.environ['OSS_FUZZ_PROJECT_NAME'] = project_name\n\n  config = config_utils.RunFuzzersConfig()\n  deployment = clusterfuzz_deployment.OSSFuzz(config, None)\n  latest_build_filename = deployment.get_latest_build_name()\n  build_uri = f'gs://clusterfuzz-builds/{project_name}/{latest_build_filename}'\n\n  return build_uri, latest_build_filename\n\n\ndef get_fuzz_target_name(project_name):\n  \"\"\"Use Fuzz Introspector Web API to choose a random fuzz target for\n  |project_name|\"\"\"\n  header = {'accept': 'application/json'}\n  url = f'https://introspector.oss-fuzz.com/api/harness-source-and-executable?project={project_name}'\n  resp = requests.get(url, headers=header)\n  resp.raise_for_status()\n  resp_json = resp.json()\n  if resp_json['result'] == 'error' or len(resp_json['pairs']) < 1:\n    logging.info(f'There are no fuzz targets available for {project_name}')\n    return None\n\n  idx = random.randint(0, len(resp_json['pairs']) - 1)\n  fuzz_target_name = resp_json['pairs'][idx]['executable']\n  logging.info(f'Using fuzz target: {fuzz_target_name}')\n  return fuzz_target_name\n\n\ndef get_env(project, build, fuzz_target_name):\n  \"\"\"Gets the environment for fuzzbench/oss-fuzz-on-demand.\"\"\"\n  env = build_project.get_env(project.fuzzing_language, build)\n  env.append(f'FUZZBENCH_PATH={FUZZBENCH_PATH}')\n  env.append('FORCE_LOCAL=1')\n  env.append(f'PROJECT={project.name}')\n  env.append('OSS_FUZZ_ON_DEMAND=1')\n  env.extend([\n      f'FUZZ_TARGET={fuzz_target_name}', f'BENCHMARK={project.name}',\n      'EXPERIMENT_TYPE=bug'\n  ])\n  return env\n\n\ndef get_fuzzbench_setup_steps():\n  \"\"\"Returns the build steps required to set up fuzzbench on oss-fuzz-on-demand\n  build.\"\"\"\n  fuzzbench_setup_steps = [\n      {\n          'args': [\n              'clone', 'https://github.com/google/fuzzbench', '--depth', '1',\n              FUZZBENCH_PATH\n          ],\n          'name': 'gcr.io/cloud-builders/git',\n          'volumes': [{\n              'name': 'fuzzbench_path',\n              'path': FUZZBENCH_PATH,\n          }],\n      },\n      {\n          'name': 'gcr.io/cloud-builders/docker',\n          'args': ['pull', 'gcr.io/oss-fuzz-base/base-builder-fuzzbench']\n      },\n      {  # TODO(metzman): Don't overwrite base-builder\n          'name':\n              'gcr.io/cloud-builders/docker',\n          'args': [\n              'tag', 'gcr.io/oss-fuzz-base/base-builder-fuzzbench',\n              'gcr.io/oss-fuzz-base/base-builder'\n          ]\n      },\n  ]\n  return fuzzbench_setup_steps\n\n\ndef get_build_fuzzers_steps(fuzzing_engine, project, env):\n  \"\"\"Returns the build_fuzzers step to build |project| with |fuzzing_engine|,\n  for fuzzbench/oss-fuzz-on-demand.\"\"\"\n  steps = []\n  engine_dockerfile_path = os.path.join(FUZZBENCH_PATH, 'fuzzers',\n                                        fuzzing_engine, 'builder.Dockerfile')\n  build_args = [\n      'build', '--build-arg', f'parent_image=gcr.io/oss-fuzz/{project.name}',\n      '--tag',\n      get_engine_project_image_name(fuzzing_engine,\n                                    project), '--file', engine_dockerfile_path,\n      os.path.join(FUZZBENCH_PATH, 'fuzzers')\n  ]\n  engine_step = {\n      'name': 'gcr.io/cloud-builders/docker',\n      'args': build_args,\n      'volumes': [{\n          'name': 'fuzzbench_path',\n          'path': FUZZBENCH_PATH,\n      }],\n  }\n  steps.append(engine_step)\n\n  project_yaml_path = f'{GCB_WORKSPACE_DIR}/oss-fuzz/projects/{project.name}/project.yaml'\n  benchmark_yaml_path = '/benchmark.yaml'\n  compile_project_step = {\n      'name':\n          get_engine_project_image_name(fuzzing_engine, project),\n      'env':\n          env,\n      'volumes': [{\n          'name': 'fuzzbench_path',\n          'path': FUZZBENCH_PATH,\n      }],\n      'args': [\n          'bash',\n          '-c',\n          # Remove /out to make sure there are non instrumented binaries.\n          # `cd /src && cd {workdir}` (where {workdir} is parsed from the\n          # Dockerfile). Container Builder overrides our workdir so we need\n          # to add this step to set it back.\n          (f'cp {project_yaml_path} {benchmark_yaml_path} && '\n           f'rm -r /out && cd /src && cd {project.workdir} && '\n           'mkdir -p $$OUT && compile'),\n      ],\n  }\n  steps.append(compile_project_step)\n\n  return steps\n\n\ndef get_gcs_corpus_steps(fuzzing_engine, project, env_dict):\n  \"\"\"Returns the build steps to download corpus from GCS (if it exists) and\n  use it on oss-fuzz-on-demand.\"\"\"\n  steps = []\n\n  corpus_path = f'{GCB_WORKSPACE_DIR}/gcs_corpus'\n  corpus_filename = 'public.zip'\n  fuzz_target_name = env_dict[\"FUZZ_TARGET\"]\n  corpus_url = get_gcs_public_corpus_url(project, fuzz_target_name)\n  download_and_use_corpus_step = {\n      'name':\n          get_engine_project_image_name(fuzzing_engine, project),\n      'args': [\n          'bash', '-c', f'if wget --spider --quiet {corpus_url}; then '\n          f'  echo \"URL exists. Downloading...\" && mkdir -p {corpus_path} && '\n          f'  cd {corpus_path} && wget -O {corpus_filename} {corpus_url};'\n          f'else '\n          f'  echo \"URL does not exist. Skipping download.\"; '\n          f'fi'\n      ],\n  }\n  steps.append(download_and_use_corpus_step)\n\n  seed_corpus_path = f'{env_dict[\"OUT\"]}/{fuzz_target_name}_seed_corpus.zip'\n  gcs_corpus_path = f'{corpus_path}/{corpus_filename}'\n  update_corpus_step = {\n      'name':\n          get_engine_project_image_name(fuzzing_engine, project),\n      'args': [\n          'bash', '-c', f'if test -f \"{gcs_corpus_path}\"; then '\n          f'  mv {gcs_corpus_path} {seed_corpus_path} && '\n          f'  rm -r {corpus_path};'\n          f'else '\n          f'  echo \"There is no corpus to update.\"; '\n          f'fi'\n      ],\n  }\n  steps.append(update_corpus_step)\n\n  return steps\n\n\ndef get_build_ood_image_steps(fuzzing_engine, project, env_dict):\n  \"\"\"Returns the build steps to create the oss-fuzz-on-demand self-contained\n  image. Executing docker run on this image starts the fuzzing process.\"\"\"\n  steps = []\n\n  fuzzbench_run_fuzzer_path = f'{GCB_WORKSPACE_DIR}/oss-fuzz/infra/base-images/base-builder-fuzzbench/fuzzbench_run_fuzzer'\n  copy_runtime_essential_files_step = {\n      'name':\n          get_engine_project_image_name(fuzzing_engine, project),\n      'volumes': [{\n          'name': 'fuzzbench_path',\n          'path': FUZZBENCH_PATH,\n      }],\n      'args': [\n          'bash', '-c', f'cp {fuzzbench_run_fuzzer_path} '\n          f'{GCB_WORKSPACE_DIR}/fuzzbench_run_fuzzer.sh  && '\n          f'cp -r {FUZZBENCH_PATH} {GCB_WORKSPACE_DIR} && '\n          f'ls {GCB_WORKSPACE_DIR}'\n      ],\n  }\n  steps.append(copy_runtime_essential_files_step)\n\n  ood_image = get_ood_image_name(fuzzing_engine, project)\n  fuzzer_runtime_dockerfile_path = os.path.join(\n      GCB_WORKSPACE_DIR + FUZZBENCH_PATH, 'fuzzers', fuzzing_engine,\n      'runner.Dockerfile')\n  build_runtime_step = {\n      'name':\n          'gcr.io/cloud-builders/docker',\n      'args': [\n          'build', '--tag', ood_image, '--file', fuzzer_runtime_dockerfile_path,\n          os.path.join(GCB_WORKSPACE_DIR + FUZZBENCH_PATH, 'fuzzers')\n      ]\n  }\n  steps.append(build_runtime_step)\n\n  oss_fuzz_on_demand_dockerfile_path = f'{GCB_WORKSPACE_DIR}/oss-fuzz/infra/build/functions/ood.Dockerfile'\n  build_out_path_without_workspace = env_dict[\"OUT\"][10:]\n  build_ood_image_step = {\n      'name':\n          'gcr.io/cloud-builders/docker',\n      'args': [\n          'build', '--tag', ood_image, '--file',\n          oss_fuzz_on_demand_dockerfile_path, '--build-arg',\n          f'BENCHMARK={env_dict[\"BENCHMARK\"]}', '--build-arg',\n          f'BUILD_OUT_PATH={build_out_path_without_workspace}', '--build-arg',\n          f'FUZZBENCH_PATH={FUZZBENCH_PATH}', '--build-arg',\n          f'FUZZING_ENGINE={env_dict[\"FUZZING_ENGINE\"]}', '--build-arg',\n          f'FUZZ_TARGET={env_dict[\"FUZZ_TARGET\"]}', '--build-arg',\n          f'MAX_TOTAL_TIME={MAX_FUZZING_DURATION}', '--build-arg',\n          f'OOD_OUTPUT_CORPUS_DIR={OOD_OUTPUT_CORPUS_DIR}', '--build-arg',\n          f'runtime_image={ood_image}', GCB_WORKSPACE_DIR\n      ]\n  }\n  steps.append(build_ood_image_step)\n\n  return steps\n\n\ndef get_push_and_run_ood_image_steps(fuzzing_engine, project, env_dict):\n  \"\"\"Returns the build steps to push and run the oss-fuzz-on-demand\n  self-contained image.\"\"\"\n  steps = []\n\n  ood_image = get_ood_image_name(fuzzing_engine, project)\n\n  push_ood_image_step = {\n      'name': 'gcr.io/cloud-builders/docker',\n      'args': ['push', ood_image]\n  }\n  steps.append(push_ood_image_step)\n\n  # This step also copies fuzzing output corpus to $OOD_OUTPUT_CORPUS_DIR\n  run_ood_image_step = {\n      'name':\n          'gcr.io/cloud-builders/docker',\n      'args': [\n          'run', '-v', f'{GCB_WORKSPACE_DIR}:{GCB_WORKSPACE_DIR}', ood_image\n      ]\n  }\n  steps.append(run_ood_image_step)\n\n  return steps\n\n\ndef get_extract_crashes_steps(fuzzing_engine, project, env_dict):\n  \"\"\"Returns the build steps to download a LibFuzzer build and use it to extract\n  crashes from the fuzzing output.\"\"\"\n  steps = []\n\n  libfuzzer_build_dir = f'{GCB_WORKSPACE_DIR}/libfuzzer_build/'\n  create_libfuzzer_build_dir_step = {\n      'name': get_engine_project_image_name(fuzzing_engine, project),\n      'args': ['bash', '-c', f'mkdir -p {libfuzzer_build_dir}']\n  }\n  steps.append(create_libfuzzer_build_dir_step)\n\n  build_uri, build_filename = get_latest_libfuzzer_build(project.name)\n  download_libfuzzer_build_step = {\n      'name': 'gcr.io/cloud-builders/gsutil',\n      'args': ['-m', 'cp', '-r', build_uri, libfuzzer_build_dir]\n  }\n  steps.append(download_libfuzzer_build_step)\n\n  extract_crashes_step = {\n      'name':\n          get_engine_project_image_name(fuzzing_engine, project),\n      'args': [\n          'bash', '-c', f'unzip {libfuzzer_build_dir}{build_filename} '\n          f'-d {libfuzzer_build_dir} && mkdir -p {OOD_CRASHES_DIR} && '\n          f'{libfuzzer_build_dir}{env_dict[\"FUZZ_TARGET\"]} {OOD_OUTPUT_CORPUS_DIR} '\n          f'-runs=0 -artifact_prefix={OOD_CRASHES_DIR}/; '\n          f'echo \"\\nCrashes found by OOD:\" && ls {OOD_CRASHES_DIR} '\n      ],\n  }\n  steps.append(extract_crashes_step)\n\n  return steps\n\n\ndef get_upload_testcase_steps(project, env_dict):\n  \"\"\"Returns the build steps to upload a testcase in the ClusterFuzz External\n  upload testcase endpoint.\"\"\"\n  steps = []\n\n  access_token_file_path = f'{GCB_WORKSPACE_DIR}/at.txt'\n  get_access_token_step = {\n      'name':\n          'google/cloud-sdk',\n      'args': [\n          'bash', '-c',\n          f'gcloud auth print-access-token > {access_token_file_path}'\n      ]\n  }\n  steps.append(get_access_token_step)\n\n  upload_testcase_script_path = f'{GCB_WORKSPACE_DIR}/oss-fuzz/infra/build/functions/ood_upload_testcase.py'\n  job_name = f'libfuzzer_asan_{project.name}'\n  target_name = f'{project.name}_{env_dict[\"FUZZ_TARGET\"]}'\n  upload_testcase_step = {\n      'name':\n          'python:3.8',\n      'args': [\n          'python3', upload_testcase_script_path, OOD_CRASHES_DIR, job_name,\n          target_name, access_token_file_path\n      ]\n  }\n  steps.append(upload_testcase_step)\n\n  return steps\n\n\ndef get_upload_corpus_steps(fuzzing_engine, project, env_dict):\n  \"\"\"Returns the build steps to upload corpus elements to GCS.\"\"\"\n  steps = []\n\n  upload_corpus_script_path = f'{GCB_WORKSPACE_DIR}/oss-fuzz/infra/build/functions/ood_upload_corpus.py'\n  doc, path_prefix = ood_upload_corpus.get_corpus_signed_policy_document(\n      project.name, env_dict['FUZZ_TARGET'])\n  doc_str = json.dumps(doc.__dict__)\n  num_uploads = '1000'\n  upload_corpus_step = {\n      'name':\n          get_engine_project_image_name(fuzzing_engine, project),\n      'args': [\n          'python3', upload_corpus_script_path, doc_str, path_prefix,\n          OOD_OUTPUT_CORPUS_DIR, num_uploads\n      ]\n  }\n  steps.append(upload_corpus_step)\n\n  return steps\n\n\ndef get_build_steps(  # pylint: disable=too-many-locals, too-many-arguments\n    project_name, project_yaml, dockerfile_lines, config):\n  \"\"\"Returns build steps for project.\"\"\"\n  project = build_project.Project(project_name, project_yaml, dockerfile_lines)\n  if project.disabled:\n    logging.info('Project \"%s\" is disabled.', project.name)\n    return []\n\n  fuzz_target_name = config.fuzz_target\n  if not fuzz_target_name:\n    fuzz_target_name = get_fuzz_target_name(project.name)\n    if not fuzz_target_name:\n      return None\n\n  steps = get_fuzzbench_setup_steps()\n  steps += build_lib.get_project_image_steps(project.name,\n                                             project.image,\n                                             project.fuzzing_language,\n                                             config=config)\n  build = build_project.Build(config.fuzzing_engine, 'address', 'x86_64')\n  env = get_env(project, build, fuzz_target_name)\n  steps += get_build_fuzzers_steps(config.fuzzing_engine, project, env)\n  env_dict = {string.split('=')[0]: string.split('=')[1] for string in env}\n  steps += get_gcs_corpus_steps(config.fuzzing_engine, project, env_dict)\n  steps += get_build_ood_image_steps(config.fuzzing_engine, project, env_dict)\n  steps += get_push_and_run_ood_image_steps(config.fuzzing_engine, project,\n                                            env_dict)\n  steps += get_extract_crashes_steps(config.fuzzing_engine, project, env_dict)\n  steps += get_upload_testcase_steps(project, env_dict)\n  steps += get_upload_corpus_steps(config.fuzzing_engine, project, env_dict)\n\n  return steps\n\n\ndef main():\n  \"\"\"Build and run fuzzbench for OSS-Fuzz projects.\"\"\"\n  return build_project.build_script_main('Does a FuzzBench run.',\n                                         get_build_steps, FUZZBENCH_BUILD_TYPE)\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/build/functions/fuzzbench_local_run.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Does fuzzbench runs locally.\"\"\"\n# TODO It is worth checking https://github.com/google/oss-fuzz/pull/12833 for\n# insights on making this code less specific for OSS-Fuzz on Demand.\n\nimport os\nimport re\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nimport time\n\nimport build_lib\nimport build_project\nimport fuzzbench\n\nGCB_WORKSPACE_DIR = fuzzbench.GCB_WORKSPACE_DIR\nFUZZBENCH_PATH = fuzzbench.FUZZBENCH_PATH\nDOCKER_BUILDER_IMAGE = 'gcr.io/cloud-builders/docker'\nLOG_FILE_PATH = os.path.join(os.path.dirname(__file__),\n                             'fuzzbench_local_run_log.txt')\n\n\ndef run_step_locally(temp_dir, local_fuzzbench_path, step, i, log_file):\n  \"\"\"Run a build step locally.\"\"\"\n  log_file.write(f'--- Step {i}: ---\\n')\n  log_file.write(f'Step_details:\\n{step}\\n')\n  log_file.write('------\\n')\n\n  image_name = step.get('name')\n  args = step.get('args', [])\n  env_list = step.get('env', [])\n  volumes = step.get('volumes', [])\n\n  if not image_name:\n    raise Exception(f'Error: Step {i} has no \"name\" field.\\n')\n  if not args:\n    raise Exception(f'Error: Step {i} has no \"args\" field.\\n')\n  if args[0] == 'push':\n    log_file.write(f'Skipping step {i} because it is a push step.\\n')\n    return\n\n  step_container_work_dir = os.path.join(GCB_WORKSPACE_DIR, step.get('dir', ''))\n\n  # This is needed because when running a container inside of a container, the\n  # mount point of the second container is also in the host machine and not in\n  # the first container\n  if args[0] == 'run' and args[1] == '-v' and GCB_WORKSPACE_DIR in args[2]:\n    args[2] = args[2].replace(GCB_WORKSPACE_DIR, temp_dir, 1)\n\n  docker_command = ['docker', 'run', '--rm', '--cpus=0.5']\n  docker_command.extend(['-w', step_container_work_dir])\n  docker_command.extend(['-v', f'{temp_dir}:{GCB_WORKSPACE_DIR}'])\n\n  mount_fuzzbench = any(vol.get('path') == FUZZBENCH_PATH for vol in volumes)\n  if mount_fuzzbench:\n    docker_command.extend(['-v', f'{local_fuzzbench_path}:{FUZZBENCH_PATH}'])\n\n  if image_name == DOCKER_BUILDER_IMAGE:\n    docker_command.extend(['-v', '/var/run/docker.sock:/var/run/docker.sock'])\n\n  for env_var in env_list:\n    docker_command.extend(['-e', env_var])\n\n  docker_command.append(image_name)\n  docker_command.extend(args)\n\n  # Local runs use local changes\n  if 'https://github.com/google/oss-fuzz.git' in docker_command:\n    oss_fuzz_dir = os.path.dirname(\n        os.path.dirname(\n            os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))\n    docker_command = ['cp', '-r', f'{oss_fuzz_dir}', f'{temp_dir}']\n\n  if '$$' in docker_command[-1]:\n    docker_command[-1] = re.sub(r'\\$\\$([a-zA-Z0-9_]+)', r'\"$\\1\"',\n                                docker_command[-1])\n\n  log_file.write(f'Executing Docker Command:\\n')\n  log_file.write(\n      ' '.join(map(lambda x: f'\"{x}\"' if ' ' in x else x, docker_command)) +\n      '\\n')\n  log_file.flush()\n\n  try:\n    start_time = time.time()\n    result = subprocess.run(docker_command,\n                            check=True,\n                            capture_output=True,\n                            text=True)\n    end_time = time.time()\n    log_file.write(\n        f'--- Container STDOUT ---\\n'\n        f'{result.stdout}'\n        f'--- Container STDERR ---\\n'\n        f'{result.stderr}'\n        f'--- Step {i} completed successfully --- Took {end_time - start_time}s\\n\\n'\n    )\n  except subprocess.CalledProcessError as e:\n    if e.returncode == 124:\n      end_time = time.time()\n      log_file.write(\n          f'Caught timeout: {e}\\n'\n          f'--- Step {i} completed with a timeout --- Took {end_time - start_time}s\\n\\n'\n      )\n    else:\n      log_file.write('--- DOCKER RUN ERROR ---\\n'\n                     f'Docker command failed with exit code {e.returncode}\\n'\n                     '--- Container STDOUT ---\\n'\n                     f'{e.stdout}'\n                     '--- Container STDERR ---\\n'\n                     f'{e.stderr}'\n                     f'Failed Step Details: {step}\\n'\n                     f'Failed Docker Command: {\" \".join(docker_command)}\\n'\n                     f'Execution failed at step {i}\\n')\n      sys.exit()\n  except Exception as e:\n    log_file.write('--- UNEXPECTED ERROR ---\\n'\n                   f'An unexpected error occurred during step {i}: {e}\\n'\n                   f'Failed Step Details: {step}\\n'\n                   f'Failed Docker Command: {\" \".join(docker_command)}\\n'\n                   f'Execution failed at step {i}\\n')\n    sys.exit()\n\n\ndef remove_temp_dir_content(temp_dir, i, log_file):\n  \"\"\"Remove temporary directory using Docker to avoid permission issues.\"\"\"\n  remove_temp_dir_step = {\n      'name': 'bash',\n      'args': ['sh', '-c', f'rm -rf {GCB_WORKSPACE_DIR}/*']\n  }\n  run_step_locally(temp_dir, '', remove_temp_dir_step, i, log_file)\n\n\ndef run_steps_locally(steps,\n                      temp_dir=None,\n                      log_file_path=LOG_FILE_PATH,\n                      testing=False):\n  \"\"\"Executes Cloud Build steps locally by running each step's command\n  inside the specified container using 'docker run'. Log is written in\n  to |log_file_path|\"\"\"\n  with open(log_file_path, 'w') as log_file:\n    if not steps:\n      log_file.write('No steps provided to run.\\n')\n      return\n\n    log_file.write(f'--- Starting Local Execution with Docker ---\\n')\n    log_file.flush()\n\n    if not temp_dir:\n      temp_dir = tempfile.mkdtemp()\n    local_fuzzbench_path = os.path.join(temp_dir, 'fuzzbench_vol')\n    os.makedirs(local_fuzzbench_path, exist_ok=True)\n\n    for i, step in enumerate(steps):\n      run_step_locally(temp_dir, local_fuzzbench_path, step, i, log_file)\n      log_file.flush()\n    log_file.write(f'--- Local Execution Finished ---\\n')\n    if not testing:\n      log_file.write(f'--- Starting temporary directory removal ---\\n')\n      remove_temp_dir_content(temp_dir, i + 1, log_file)\n      shutil.rmtree(temp_dir)\n      log_file.write(f'--- Removed temporary directory ---\\n')\n\n\ndef main():\n  \"\"\"Local fuzzbench build and run for OSS-Fuzz projects. Excludes steps on\n  which non local storage is written.\"\"\"\n  args = build_project.parse_args('local_fuzzbench_run', None)\n  project_name = args.projects[0]\n  project_yaml, dockerfile_lines = build_project.get_project_data(project_name)\n  config = build_project.create_config(args, fuzzbench.FUZZBENCH_BUILD_TYPE)\n  project = build_project.Project(project_name, project_yaml, dockerfile_lines)\n  fuzz_target_name = config.fuzz_target\n  if not fuzz_target_name:\n    fuzz_target_name = fuzzbench.get_fuzz_target_name(project.name)\n    if not fuzz_target_name:\n      raise Exception(\n          'Fuzz Introspector Web API did not find a fuzz target. Provide one')\n  steps = fuzzbench.get_fuzzbench_setup_steps()\n  steps += build_lib.get_project_image_steps(project.name,\n                                             project.image,\n                                             project.fuzzing_language,\n                                             config=config)\n  build = build_project.Build(config.fuzzing_engine, 'address', 'x86_64')\n  env = fuzzbench.get_env(project, build, fuzz_target_name)\n  steps += fuzzbench.get_build_fuzzers_steps(config.fuzzing_engine, project,\n                                             env)\n  env_dict = {string.split('=')[0]: string.split('=')[1] for string in env}\n  steps += fuzzbench.get_gcs_corpus_steps(config.fuzzing_engine, project,\n                                          env_dict)\n  steps += fuzzbench.get_build_ood_image_steps(config.fuzzing_engine, project,\n                                               env_dict)\n  steps += fuzzbench.get_push_and_run_ood_image_steps(config.fuzzing_engine,\n                                                      project, env_dict)\n  steps += fuzzbench.get_extract_crashes_steps(config.fuzzing_engine, project,\n                                               env_dict)\n\n  run_steps_locally(steps)\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/build/functions/fuzzbench_test.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests for fuzzbench.py.\"\"\"\n\nimport logging\nimport os\nimport requests\nimport sys\nimport shutil\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport build_lib\nimport build_project\nimport fuzzbench\nimport fuzzbench_local_run\n\nLOG_FILE_PATH = os.path.join(os.path.dirname(__file__),\n                             'fuzzbench_test_log.txt')\n\n\nclass GetFuzzTargetName(unittest.TestCase):\n  \"\"\"Tests for get_fuzz_target_name.\"\"\"\n\n  @mock.patch('requests.get')\n  @mock.patch('random.randint')\n  @mock.patch('logging.info')\n  def test_successful_retrieval(self, mock_logging_info, mock_randint,\n                                mock_get):\n    \"\"\"Tests successful retrieval and random selection of a fuzz target.\"\"\"\n    mock_response = mock.MagicMock()\n    mock_response.raise_for_status.return_value = None\n    mock_response.json.return_value = {\n        'result':\n            'success',\n        'pairs': [{\n            'executable': 'target1'\n        }, {\n            'executable': 'target2'\n        }, {\n            'executable': 'target3'\n        }]\n    }\n    mock_get.return_value = mock_response\n    mock_randint.return_value = 1\n\n    project_name = 'test_project'\n    fuzz_target = fuzzbench.get_fuzz_target_name(project_name)\n\n    self.assertEqual(fuzz_target, 'target2')\n    mock_get.assert_called_once_with(\n        f'https://introspector.oss-fuzz.com/api/harness-source-and-executable?project={project_name}',\n        headers={'accept': 'application/json'})\n    mock_randint.assert_called_once_with(0, 2)\n    mock_logging_info.assert_called_with('Using fuzz target: target2')\n\n  @mock.patch('requests.get')\n  @mock.patch('logging.info')\n  def test_api_error(self, mock_logging_info, mock_get):\n    \"\"\"Tests handling of API errors during the request.\"\"\"\n    mock_response = mock.MagicMock()\n    mock_response.raise_for_status.side_effect = requests.exceptions.HTTPError(\n        'API Error')\n    mock_get.return_value = mock_response\n\n    project_name = 'error_project'\n    with self.assertRaises(requests.exceptions.HTTPError):\n      fuzzbench.get_fuzz_target_name(project_name)\n\n    mock_get.assert_called_once_with(\n        f'https://introspector.oss-fuzz.com/api/harness-source-and-executable?project={project_name}',\n        headers={'accept': 'application/json'})\n    mock_logging_info.assert_not_called()\n\n  @mock.patch('requests.get')\n  @mock.patch('logging.info')\n  def test_no_fuzz_targets(self, mock_logging_info, mock_get):\n    \"\"\"Tests the case where the API returns an error indicating no fuzz targets.\"\"\"\n    mock_response = mock.MagicMock()\n    mock_response.raise_for_status.return_value = None\n    mock_response.json.return_value = {'result': 'error'}\n    mock_get.return_value = mock_response\n\n    project_name = 'empty_project'\n    fuzz_target = fuzzbench.get_fuzz_target_name(project_name)\n\n    self.assertIsNone(fuzz_target)\n    mock_get.assert_called_once_with(\n        f'https://introspector.oss-fuzz.com/api/harness-source-and-executable?project={project_name}',\n        headers={'accept': 'application/json'})\n    mock_logging_info.assert_called_once_with(\n        f'There are no fuzz targets available for {project_name}')\n\n  @mock.patch('requests.get')\n  @mock.patch('logging.info')\n  def test_empty_pairs(self, mock_logging_info, mock_get):\n    \"\"\"Tests the case where the API returns an empty list of fuzz target pairs.\"\"\"\n    mock_response = mock.MagicMock()\n    mock_response.raise_for_status.return_value = None\n    mock_response.json.return_value = {'result': 'success', 'pairs': []}\n    mock_get.return_value = mock_response\n\n    project_name = 'empty_pairs_project'\n    fuzz_target = fuzzbench.get_fuzz_target_name(project_name)\n\n    self.assertIsNone(fuzz_target)\n    mock_get.assert_called_once_with(\n        f'https://introspector.oss-fuzz.com/api/harness-source-and-executable?project={project_name}',\n        headers={'accept': 'application/json'})\n    mock_logging_info.assert_called_once_with(\n        f'There are no fuzz targets available for {project_name}')\n\n\nclass FuzzbenchRunsTest(unittest.TestCase):\n  \"\"\"Tests for fuzzbench runs.\"\"\"\n\n  def setUp(self):\n    \"\"\"Creates a temporary directory for fuzzbench runs tests.\"\"\"\n    self.temp_dir = tempfile.mkdtemp()\n\n  def tearDown(self):\n    \"\"\"Removes temporary directory.\"\"\"\n    with open(LOG_FILE_PATH, 'w', encoding='utf-8') as log_file:\n      fuzzbench_local_run.remove_temp_dir_content(self.temp_dir, -1, log_file)\n      shutil.rmtree(self.temp_dir)\n    os.remove(LOG_FILE_PATH)\n\n  def _fuzzbench_test_setup(self):\n    \"\"\"Returns necessary variables for fuzzbench runs setup.\"\"\"\n    project_name = 'example'\n    fuzz_target_name = 'do_stuff_fuzzer'\n    project_yaml, dockerfile_lines = build_project.get_project_data(\n        project_name)\n    project = build_project.Project(project_name, project_yaml,\n                                    dockerfile_lines)\n    fuzzing_engine = 'mopt'\n    build = build_project.Build(fuzzing_engine, 'address', 'x86_64')\n    env = fuzzbench.get_env(project, build, fuzz_target_name)\n\n    return fuzzing_engine, project, env\n\n  def _assert_log_content(self, frequency):\n    \"\"\"Asserts the frequency of 'successfully' in the log content.\"\"\"\n    with open(LOG_FILE_PATH, 'r', encoding='utf-8') as log_file:\n      log_content = log_file.read()\n      count = log_content.count('successfully')\n      self.assertGreaterEqual(count, frequency)\n\n  def _fuzzbench_setup_steps_test(self, fuzzing_engine, project, env):\n    \"\"\"Test for fuzzbench setup steps.\"\"\"\n    steps = fuzzbench.get_fuzzbench_setup_steps()\n    fuzzbench_local_run.run_steps_locally(steps,\n                                          self.temp_dir,\n                                          LOG_FILE_PATH,\n                                          testing=True)\n    self._assert_log_content(3)\n\n  def _get_project_image_steps_test(self, fuzzing_engine, project, env_dict):\n    \"\"\"Test for project image steps.\"\"\"\n    config = build_project.Config(build_type=fuzzbench.FUZZBENCH_BUILD_TYPE,\n                                  fuzzing_engine=fuzzing_engine,\n                                  fuzz_target=env_dict['FUZZ_TARGET'])\n    steps = build_lib.get_project_image_steps(project.name,\n                                              project.image,\n                                              project.fuzzing_language,\n                                              config=config)\n    fuzzbench_local_run.run_steps_locally(steps,\n                                          self.temp_dir,\n                                          LOG_FILE_PATH,\n                                          testing=True)\n    self._assert_log_content(3)\n\n  def _build_fuzzers_steps_test(self, fuzzing_engine, project, env):\n    \"\"\"Test for build fuzzers steps.\"\"\"\n    steps = fuzzbench.get_build_fuzzers_steps(fuzzing_engine, project, env)\n    fuzzbench_local_run.run_steps_locally(steps,\n                                          self.temp_dir,\n                                          LOG_FILE_PATH,\n                                          testing=True)\n    self._assert_log_content(2)\n\n  def _corpus_steps_test(self, fuzzing_engine, project, env_dict):\n    \"\"\"Test for corpus steps.\"\"\"\n    steps = fuzzbench.get_gcs_corpus_steps(fuzzing_engine, project, env_dict)\n    fuzzbench_local_run.run_steps_locally(steps,\n                                          self.temp_dir,\n                                          LOG_FILE_PATH,\n                                          testing=True)\n    self._assert_log_content(2)\n\n  def _build_ood_image_steps_test(self, fuzzing_engine, project, env_dict):\n    \"\"\"Test for build ood image steps.\"\"\"\n    steps = fuzzbench.get_build_ood_image_steps(fuzzing_engine, project,\n                                                env_dict)\n    # Limit fuzzing time for testing\n    build_ood_image_args = steps[2]['args']\n    for i in range(len(build_ood_image_args)):\n      if 'MAX_TOTAL_TIME' in build_ood_image_args[i]:\n        build_ood_image_args[i] = 'MAX_TOTAL_TIME=5'\n    fuzzbench_local_run.run_steps_locally(steps,\n                                          self.temp_dir,\n                                          LOG_FILE_PATH,\n                                          testing=True)\n    self._assert_log_content(3)\n\n  def _run_ood_image_step_test(self, fuzzing_engine, project, env_dict):\n    \"\"\"Test for run ood image step.\"\"\"\n    steps = fuzzbench.get_push_and_run_ood_image_steps(fuzzing_engine, project,\n                                                       env_dict)\n    test_steps = []\n    for step in steps:\n      if step['args'][0] != 'push':\n        test_steps.append(step)\n    fuzzbench_local_run.run_steps_locally(test_steps,\n                                          self.temp_dir,\n                                          LOG_FILE_PATH,\n                                          testing=True)\n    self._assert_log_content(1)\n\n  def _extract_crashes_steps_test(self, fuzzing_engine, project, env_dict):\n    \"\"\"Test for extract crashes steps.\"\"\"\n    steps = fuzzbench.get_extract_crashes_steps(fuzzing_engine, project,\n                                                env_dict)\n    for step in steps:\n      if '-runs=0 -artifact_prefix=' in step['args'][-1]:\n        step['args'] = ['timeout', '10'] + step['args']\n    fuzzbench_local_run.run_steps_locally(steps,\n                                          self.temp_dir,\n                                          LOG_FILE_PATH,\n                                          testing=True)\n    self._assert_log_content(3)\n\n  def test_fuzzbench_runs(self):\n    \"\"\"Test for fuzzbench runs.\"\"\"\n    fuzzing_engine, project, env = self._fuzzbench_test_setup()\n    env_dict = {string.split('=')[0]: string.split('=')[1] for string in env}\n    self._fuzzbench_setup_steps_test(fuzzing_engine, project, env)\n    self._get_project_image_steps_test(fuzzing_engine, project, env_dict)\n    self._build_fuzzers_steps_test(fuzzing_engine, project, env)\n    self._corpus_steps_test(fuzzing_engine, project, env_dict)\n    # Disable OOD test as it seems broken\n    # TODO(Jonathan) (David) fix this test.\n    # self._build_ood_image_steps_test(fuzzing_engine, project, env_dict)\n    # self._run_ood_image_step_test(fuzzing_engine, project, env_dict)\n    self._extract_crashes_steps_test(fuzzing_engine, project, env_dict)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/build/functions/gcb.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Entrypoint for CI into trial_build or oss_fuzz_on_demand. This script will\nget the command from the last PR comment containing \"/gcbrun\" and pass it to\ntrial_build.py or oss_fuzz_on_demand. On trial_build.py it will build test\nversions of base-images, push them and then do test builds using those images.\n\"\"\"\n\nimport logging\nimport os\nimport sys\n\nimport github\n\nimport trial_build\nimport oss_fuzz_on_demand\n\nTRIGGER_COMMAND = '/gcbrun'\nTRIAL_BUILD_COMMAND_STR = f'{TRIGGER_COMMAND} trial_build.py '\nOSS_FUZZ_ON_DEMAND_COMMAND_STR = f'{TRIGGER_COMMAND} oss_fuzz_on_demand.py '\nSKIP_COMMAND_STR = f'{TRIGGER_COMMAND} skip'\n\n\ndef get_comments(pull_request_number):\n  \"\"\"Returns comments on the GitHub Pull request referenced by\n  |pull_request_number|.\"\"\"\n  github_obj = github.Github()\n  repo = github_obj.get_repo('google/oss-fuzz')\n  pull = repo.get_pull(pull_request_number)\n  pull_comments = list(pull.get_comments())\n  issue = repo.get_issue(pull_request_number)\n  issue_comments = list(issue.get_comments())\n  # Github only returns comments if from the pull object when a pull request is\n  # open. If it is a draft, it will only return comments from the issue object.\n  return pull_comments + issue_comments\n\n\ndef get_latest_gcbrun_command(comments):\n  \"\"\"Gets the last /gcbrun comment from comments.\"\"\"\n  for comment in reversed(comments):\n    # This seems to get comments on code too.\n    body = comment.body\n    if body.startswith(SKIP_COMMAND_STR):\n      return None\n    if not body.startswith(TRIAL_BUILD_COMMAND_STR) and (\n        not body.startswith(OSS_FUZZ_ON_DEMAND_COMMAND_STR)):\n      continue\n    if len(body) == len(TRIAL_BUILD_COMMAND_STR) or (\n        len(body) == len(OSS_FUZZ_ON_DEMAND_COMMAND_STR)):\n      return None\n    return body[len(TRIGGER_COMMAND):].strip().split(' ')\n  return None\n\n\ndef exec_command_from_github(args):\n  \"\"\"Executes the gcbrun command for trial_build.py or oss_fuzz_on_demand.py in\n  the most recent command on |pull_request_number|. Returns True on success,\n  False on failure.\"\"\"\n  pull_request_number = int(os.environ['PULL_REQUEST_NUMBER'])\n  branch = os.environ['BRANCH']\n  repo = os.environ['REPO']\n\n  comments = get_comments(pull_request_number)\n  full_command = get_latest_gcbrun_command(comments)\n\n  if full_command is None:\n    logging.info('Trial build not requested.')\n    # Create a flag file to indicate that the build was skipped.\n    with open('trial_build_skipped.flag', 'w') as f:\n      pass\n    return None\n  command_file = full_command[0]\n  command = full_command[1:]\n\n  command.extend(['--repo', repo])\n\n  # Set the branch so that the trial_build builds the projects from the PR\n  # branch.\n  command.extend(['--branch', branch])\n  command.extend(args)\n\n  logging.info('Executing command: %s.', command)\n\n  if command_file == OSS_FUZZ_ON_DEMAND_COMMAND_STR.split(' ')[1]:\n    return oss_fuzz_on_demand.oss_fuzz_on_demand_main(command) == 0\n  return trial_build.trial_build_main(command, local_base_build=False)\n\n\ndef main():\n  \"\"\"Entrypoint for GitHub CI into trial_build.py\"\"\"\n  logging.basicConfig(level=logging.INFO)\n  logging.getLogger('oauth2client').setLevel(logging.WARNING)\n\n  args = sys.argv[1:]\n\n  result = exec_command_from_github(args)\n  if result or result is None:\n    return 0\n  return 1\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/build/functions/gcb_test.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests for gcb.py.\"\"\"\nimport unittest\nfrom unittest import mock\n\nimport gcb\n\n\nclass GetLatestGCBrunCommandTest(unittest.TestCase):\n  \"\"\"Tests for get_latest_gcbrun_command.\"\"\"\n\n  def test_command_parsing(self):\n    \"\"\"Tests that commands from GitHub comments are parsed properly.\"\"\"\n    mock_comment = mock.MagicMock()\n    mock_comment.body = ('/gcbrun trial_build.py aiohttp --sanitizer '\n                         'coverage address --fuzzing-engine libfuzzer')\n    comments = [mock_comment]\n    expected_command = [\n        'trial_build.py', 'aiohttp', '--sanitizer', 'coverage', 'address',\n        '--fuzzing-engine', 'libfuzzer'\n    ]\n    actual_command = gcb.get_latest_gcbrun_command(comments)\n    self.assertEqual(expected_command, actual_command)\n\n  def test_last_comment(self):\n    \"\"\"Tests that the last comment from the GitHub PR is considered the\n    command.\"\"\"\n    mock_comment_1 = mock.MagicMock()\n    mock_comment_1.body = ('/gcbrun trial_build.py aiohttp --sanitizer '\n                           'coverage address --fuzzing-engine libfuzzer')\n    mock_comment_2 = mock.MagicMock()\n    mock_comment_2.body = ('/gcbrun trial_build.py skcms --sanitizer '\n                           'coverage address --fuzzing-engine libfuzzer')\n    comments = [mock_comment_1, mock_comment_2]\n    expected_command = [\n        'trial_build.py', 'skcms', '--sanitizer', 'coverage', 'address',\n        '--fuzzing-engine', 'libfuzzer'\n    ]\n    actual_command = gcb.get_latest_gcbrun_command(comments)\n    self.assertEqual(expected_command, actual_command)\n\n  def test_oss_fuzz_on_demand_command_parsing(self):\n    \"\"\"Tests that the OSS-Fuzz on demand commands from GitHub comments are\n    parsed properly.\"\"\"\n    mock_comment = mock.MagicMock()\n    mock_comment.body = ('/gcbrun oss_fuzz_on_demand.py aiohttp --sanitizer '\n                         'coverage address --fuzzing-engine libfuzzer')\n    comments = [mock_comment]\n    expected_command = [\n        'oss_fuzz_on_demand.py', 'aiohttp', '--sanitizer', 'coverage',\n        'address', '--fuzzing-engine', 'libfuzzer'\n    ]\n    actual_command = gcb.get_latest_gcbrun_command(comments)\n    self.assertEqual(expected_command, actual_command)\n\n\nclass ExecCommandFromGithubTest(unittest.TestCase):\n  \"\"\"Tests for exec_command_from_github.\"\"\"\n\n  @mock.patch('os.environ', {\n      'PULL_REQUEST_NUMBER': '0',\n      'BRANCH': 'test_branch',\n      'REPO': 'test_repo'\n  })\n  def test_exec_command(self):\n    \"\"\"Tests if exec_command_from_github is generating the correct command.\"\"\"\n    test_cases = [\n        {\n            \"comments\": [('/gcbrun oss_fuzz_on_demand.py aiohttp --sanitizer'\n                          'coverage address --fuzzing-engine libfuzzer')],\n            \"latest_command\": [\n                'oss_fuzz_on_demand.py', 'aiohttp', '--sanitizer', 'coverage',\n                'address', '--fuzzing-engine', 'libfuzzer'\n            ],\n            \"expected_command\": [\n                'aiohttp', '--sanitizer', 'coverage', 'address',\n                '--fuzzing-engine', 'libfuzzer', '--repo', 'test_repo',\n                '--branch', 'test_branch', '--version-tag', 'latest'\n            ],\n            \"trial_build_called\": False,\n        },\n        {\n            \"comments\": ['/gcbrun trial_build.py my_project'],\n            \"latest_command\": ['trial_build.py', 'my_project'],\n            \"expected_command\": [\n                'my_project', '--repo', 'test_repo', '--branch', 'test_branch',\n                '--version-tag', 'latest'\n            ],\n            \"trial_build_called\": True,\n        },\n        {\n            \"comments\": ['/gcbrun trial_build.py my_project'],\n            \"latest_command\": None,\n            \"expected_command\": [\n                'my_project', '--repo', 'test_repo', '--branch', 'test_branch',\n                '--version-tag', 'latest'\n            ],\n            \"trial_build_called\": True,\n        },\n    ]\n    for i, test_case in enumerate(test_cases):\n      with self.subTest(i=i):\n        with mock.patch(\n            'gcb.get_comments', return_value=test_case[\"comments\"]), mock.patch(\n                'gcb.get_latest_gcbrun_command',\n                return_value=test_case[\"latest_command\"]), mock.patch(\n                    'oss_fuzz_on_demand.oss_fuzz_on_demand_main') as (\n                        mock_oss_fuzz_on_demand\n                    ), mock.patch('trial_build.trial_build_main') as (\n                        mock_trial_build_trial_build_main):\n\n          gcb.exec_command_from_github(['--version-tag', 'latest'])\n\n          if test_case[\"latest_command\"] == None:\n            mock_trial_build_trial_build_main.assert_not_called()\n            mock_oss_fuzz_on_demand.assert_not_called()\n\n          else:\n            if test_case[\"trial_build_called\"]:\n              mock_trial_build_trial_build_main.assert_called_once_with(\n                  test_case[\"expected_command\"], local_base_build=False)\n              mock_oss_fuzz_on_demand.assert_not_called()\n            else:\n              mock_trial_build_trial_build_main.assert_not_called()\n              mock_oss_fuzz_on_demand.assert_called_once_with(\n                  test_case[\"expected_command\"])\n\n  @mock.patch('os.environ', {\n      'PULL_REQUEST_NUMBER': '0',\n      'BRANCH': 'test_branch',\n      'REPO': 'test_repo'\n  })\n  @mock.patch('gcb.get_comments',\n              return_value=[('/gcbrun oss_fuzz_on_demand.py aiohttp --sanitizer'\n                             'coverage address --fuzzing-engine libfuzzer')])\n  @mock.patch('gcb.get_latest_gcbrun_command',\n              return_value=[\n                  'oss_fuzz_on_demand.py', 'aiohttp', '--fuzzing-engine',\n                  'libfuzzer'\n              ])\n  @mock.patch('trial_build.trial_build_main')\n  @mock.patch('oss_fuzz_on_demand.oss_fuzz_on_demand_main')\n  def test_build_script_main_args(self, mock_oss_fuzz_on_demand_main,\n                                  mock_trial_build_main,\n                                  mock_get_latest_gcbrun_command,\n                                  mock_gcb_get_comments):\n    \"\"\"Tests for build_script_main args on oss_fuzz_on_demmand call.\"\"\"\n    gcb.exec_command_from_github([])\n\n    mock_trial_build_main.assert_not_called()\n\n    build_script_main_args = [\n        'aiohttp', '--fuzzing-engine', 'libfuzzer', '--repo', 'test_repo',\n        '--branch', 'test_branch'\n    ]\n    mock_oss_fuzz_on_demand_main.assert_called_once_with(build_script_main_args)\n"
  },
  {
    "path": "infra/build/functions/index.yaml",
    "content": "indexes:\n  - kind: BuildsHistory\n    properties:\n      - name: build_tag\n      - name: project\n"
  },
  {
    "path": "infra/build/functions/indexer_build_test.py",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unittests for indexer build steps.\"\"\"\nimport sys\nimport os\nimport unittest\nfrom unittest import mock\n\nfrom pyfakefs import fake_filesystem_unittest\n\nFUNCTIONS_DIR = os.path.dirname(__file__)\nsys.path.append(FUNCTIONS_DIR)\n\nimport build_project\nimport build_lib\n\n\nclass TestIndexerBuildSteps(fake_filesystem_unittest.TestCase):\n  \"\"\"Unittests for indexer build.\"\"\"\n\n  def setUp(self):\n    self.setUpPyfakefs()\n\n  @mock.patch('build_lib.get_signed_policy_document_upload_prefix')\n  @mock.patch('build_lib.signed_policy_document_curl_args')\n  @mock.patch('build_lib.upload_using_signed_policy_document')\n  @mock.patch('build_lib.get_project_image_steps')\n  def test_get_indexer_build_steps(self, mock_get_project_image_steps,\n                                   mock_upload_using_policy,\n                                   mock_signed_policy_args,\n                                   mock_get_policy_doc):\n    \"\"\"Test get_indexer_build_steps.\"\"\"\n    mock_get_project_image_steps.return_value = []\n    mock_policy_doc = mock.Mock()\n    mock_policy_doc.bucket = 'test-bucket'\n    mock_get_policy_doc.return_value = mock_policy_doc\n    mock_signed_policy_args.return_value = ['-F', 'policy=foo']\n    mock_upload_using_policy.return_value = {'name': 'upload_srcmap'}\n    project_name = 'test-project'\n    project_yaml = {\n        'language': 'c++',\n        'sanitizers': ['address'],\n        'architectures': ['x86_64'],\n        'main_repo': 'https://github.com/test/repo.git',\n        'indexer': {\n            'targets': ['target1']\n        }\n    }\n    dockerfile = '''FROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get install -y make'''\n\n    config = build_project.Config(upload=True, experiment=False)\n    steps, reason = build_project.get_indexer_build_steps(\n        project_name, project_yaml, dockerfile, config)\n    indexer_step = None\n    for step in steps:\n      if 'args' in step and ('--name' in step['args'] and\n                             'indexed-container' in step['args']):\n        indexer_step = step\n        break\n\n    self.assertIsNotNone(indexer_step, \"Indexer build step not found\")\n    bash_command = indexer_step['args'][-1]\n    self.assertIn('unshallow_repos.py', bash_command)\n\n    upload_step = None\n    for step in steps:\n      if 'args' in step and len(step['args']) >= 2 and isinstance(\n          step['args'][1], str) and 'for tar in' in step['args'][1]:\n        upload_step = step\n        break\n\n    self.assertIsNotNone(upload_step, \"Upload step not found\")\n    upload_command = upload_step['args'][1]\n    self.assertIn('for tar in /workspace/out/none-address-x86_64/*.tar',\n                  upload_command)\n    self.assertIn('curl -F policy=foo', upload_command)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/build/functions/main.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud functions for build infrastructure.\"\"\"\n\nimport base_images\nimport project_sync\nimport request_build\nimport request_coverage_build\nimport request_introspector_build\n\n\ndef build_project(event, context):\n  \"\"\"Entry point for cloud function to requesting project builds.\"\"\"\n  request_build.request_build(event, context)\n\n\ndef sync(event, context):\n  \"\"\"Entry point for cloud function that syncs projects from github.\"\"\"\n  project_sync.sync(event, context)\n\n\ndef build_base_images(event, context):\n  \"\"\"Entry point for cloud function that builds base images.\"\"\"\n  base_images.base_builder(event, context)\n\n\ndef coverage_build(event, context):\n  \"\"\"Entry point for cloud function to build coverage reports.\"\"\"\n  request_coverage_build.request_coverage_build(event, context)\n\n\ndef introspector_build(event, context):\n  \"\"\"Entry point for cloud function to build introspector reports.\"\"\"\n  request_introspector_build.request_introspector_build(event, context)\n"
  },
  {
    "path": "infra/build/functions/ood.Dockerfile",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nARG runtime_image\nFROM $runtime_image\n\nARG BUILD_OUT_PATH\nARG FUZZING_ENGINE\nARG FUZZ_TARGET\nARG FUZZBENCH_PATH\nARG BENCHMARK\nARG MAX_TOTAL_TIME\nARG OOD_OUTPUT_CORPUS_DIR\n\nRUN mkdir -p /ood\nRUN mkdir -p /ood$FUZZBENCH_PATH\n\nCOPY ./fuzzbench_run_fuzzer.sh /ood\nCOPY .$BUILD_OUT_PATH /ood\nCOPY .$FUZZBENCH_PATH /ood$FUZZBENCH_PATH\n\nENV OUT=/ood\nENV FUZZING_ENGINE=$FUZZING_ENGINE\nENV FUZZ_TARGET=$FUZZ_TARGET\nENV FUZZBENCH_PATH=/ood$FUZZBENCH_PATH\nENV BENCHMARK=$BENCHMARK\nENV MAX_TOTAL_TIME=$MAX_TOTAL_TIME\nENV OOD_OUTPUT_CORPUS_DIR=$OOD_OUTPUT_CORPUS_DIR\n\nCMD [\"bash\", \"-c\", \"source /ood/fuzzbench_run_fuzzer.sh && \\\n     mkdir -p $OOD_OUTPUT_CORPUS_DIR && \\\n     cp -r $OUTPUT_CORPUS_DIR $OOD_OUTPUT_CORPUS_DIR\"]\n"
  },
  {
    "path": "infra/build/functions/ood_upload_corpus.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Upload OSS-Fuzz on Demand output corpus to GCS.\"\"\"\n\nimport argparse\nimport base64\nimport json\nimport logging\nimport os\nimport pickle\nimport requests\nimport subprocess\nimport sys\nimport uuid\n\nimport build_lib\n\n\ndef get_corpus_signed_policy_document(project_name, fuzz_target_name):\n  \"\"\"Returns a signed policy document and a path prefix to upload corpus to GCS.\"\"\"\n  bucket = f'{project_name}-corpus.clusterfuzz-external.appspot.com'\n  path_prefix = f'libFuzzer/{fuzz_target_name}/'\n  signed_policy_document = build_lib.get_signed_policy_document_upload_prefix(\n      bucket, path_prefix)\n  return signed_policy_document, path_prefix\n\n\ndef upload_corpus_file(file_path, upload_path, doc):\n  \"\"\"Make a request to upload a corpus file to GCS.\"\"\"\n  url = f'https://storage.googleapis.com/{doc.bucket}'\n  print(f'Upload url: {url}')\n  data = {\n      'key': upload_path,\n      'policy': doc.policy,\n      'x-goog-algorithm': doc.x_goog_algorithm,\n      'x-goog-date': doc.x_goog_date,\n      'x-goog-credential': doc.x_goog_credential,\n      'x-goog-signature': doc.x_goog_signature,\n  }\n  files = {\n      'file': open(file_path, 'rb'),\n  }\n  try:\n    response = requests.post(url, data=data, files=files)\n    response.raise_for_status()\n    print(f'File uploaded successfully to {url}/{upload_path}')\n  except requests.exceptions.RequestException as e:\n    print(f'Error uploading file: {e}')\n    if response is not None:\n      print(f'Response status code: {response.status_code}')\n      print(f'Response text: {response.text}')\n\n\ndef get_files_path(directory_path, num_files):\n  \"\"\"Returns the path for |num_files| corpus files.\"\"\"\n  file_paths = []\n  for root, _, files in os.walk(directory_path):\n    for name in files:\n      file_path = os.path.join(root, name)\n      file_paths.append(file_path)\n      if len(file_paths) >= num_files:\n        return file_paths\n  return file_paths\n\n\ndef upload_corpus(doc_str, path_prefix, output_corpus_directory, num_uploads):\n  \"\"\"Uploads |num_uploads| corpus files using |doc_str| signed document policy.\n  It uses |path_prefix| to get the upload path.\"\"\"\n  doc_data = json.loads(doc_str)\n  doc = build_lib.SignedPolicyDocument(**doc_data)\n  file_paths = get_files_path(output_corpus_directory, num_uploads)\n  for file_path in file_paths:\n    suffix = uuid.uuid4().hex\n    upload_path = path_prefix + suffix\n    upload_corpus_file(file_path, upload_path, doc)\n\n\ndef get_args():\n  \"\"\"Parses command line arguments and returns them.\"\"\"\n  parser = argparse.ArgumentParser(\n      description=\"Script to upload corpus elements to GCS.\")\n  parser.add_argument(\"doc_str\",\n                      type=str,\n                      help=\"The signed document policy string.\")\n  parser.add_argument(\"path_prefix\",\n                      type=str,\n                      help=\"The prefix to get the corpus upload path.\")\n  parser.add_argument(\n      \"output_corpus_directory\",\n      type=str,\n      help=\"The directory where the fuzzing output corpus is stored.\")\n  parser.add_argument(\"num_uploads\",\n                      type=int,\n                      help=\"The number of elements which will be uploaded.\")\n  args = parser.parse_args()\n  return args\n\n\ndef main():\n  \"\"\"Upload OSS-Fuzz on Demand output corpus to GCS.\"\"\"\n  args = get_args()\n  upload_corpus(args.doc_str, args.path_prefix, args.output_corpus_directory,\n                args.num_uploads)\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/build/functions/ood_upload_corpus_test.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests for ood_upload_corpus_test.py.\"\"\"\n\nimport json\nimport os\nimport shutil\nimport tempfile\nimport unittest\nfrom unittest.mock import patch, MagicMock, call\n\nimport build_lib\nimport ood_upload_corpus\n\n\nclass GetFilePathTest(unittest.TestCase):\n  \"\"\"Tests for get_files_path function.\"\"\"\n\n  def setUp(self):\n    \"\"\"Set tem_dir attribute\"\"\"\n    self.temp_dir = tempfile.mkdtemp()\n\n  def tearDown(self):\n    \"\"\"Remove temp_dir after tests\"\"\"\n    shutil.rmtree(self.temp_dir)\n\n  def test_no_files(self):\n    \"\"\"Test for empty directory\"\"\"\n    self.assertEqual(ood_upload_corpus.get_files_path(self.temp_dir, 10), [])\n\n  def test_single_file(self):\n    \"\"\"Test for single file\"\"\"\n    file_name = 'test_file.txt'\n    file_path = os.path.join(self.temp_dir, file_name)\n    open(file_path, 'w').close()\n    self.assertEqual(ood_upload_corpus.get_files_path(self.temp_dir, 10),\n                     [file_path])\n\n  def test_multiple_files(self):\n    \"\"\"Test for multiple files\"\"\"\n    file_names = ['file1.txt', 'file2.csv', 'data.json']\n    for name in file_names:\n      file_path = os.path.join(self.temp_dir, name)\n      open(file_path, 'w').close()\n    files_path_set = set(ood_upload_corpus.get_files_path(self.temp_dir, 2))\n    self.assertTrue(len(files_path_set) == 2)\n    self.assertTrue(\n        files_path_set.issubset(\n            set([\n                f'{self.temp_dir}/file1.txt', f'{self.temp_dir}/file2.csv',\n                f'{self.temp_dir}/data.json'\n            ])))\n\n  def test_with_subdirectory(self):\n    \"\"\"Test for directory with subdirectory\"\"\"\n    os.makedirs(os.path.join(self.temp_dir, 'subdir'))\n    self.assertEqual(ood_upload_corpus.get_files_path(self.temp_dir, 10), [])\n\n    file_name = 'test_file.txt'\n    file_path = os.path.join(self.temp_dir, file_name)\n    open(file_path, 'w').close()\n    self.assertEqual(ood_upload_corpus.get_files_path(self.temp_dir, 10),\n                     [file_path])\n\n\nclass TestUploadCorpus(unittest.TestCase):\n  \"\"\"Tests for upload_corpus function.\"\"\"\n\n  @patch('uuid.uuid4')\n  @patch('ood_upload_corpus.upload_corpus_file')\n  @patch('ood_upload_corpus.get_files_path')\n  def test_upload_multiple_files(self, mock_get_files_path,\n                                 mock_upload_corpus_file, mock_uuid):\n    \"\"\"Tests uploading multiple corpus files with the given document policy.\"\"\"\n    output_dir = 'test_corpus_dir'\n    path_prefix = 'gs://test_bucket/corpus/'\n    num_uploads = 3\n    doc = build_lib.SignedPolicyDocument(bucket='bucket',\n                                         policy='test_policy',\n                                         x_goog_algorithm='x',\n                                         x_goog_credential='x',\n                                         x_goog_date='00000000',\n                                         x_goog_signature='x')\n    doc_str = json.dumps(doc.__dict__)\n    mock_get_files_path.return_value = [\n        os.path.join(output_dir, 'file_0.txt'),\n        os.path.join(output_dir, 'file_1.txt'),\n        os.path.join(output_dir, 'file_2.txt'),\n    ]\n    mock_uuid.side_effect = [\n        MagicMock(hex='suffix1'),\n        MagicMock(hex='suffix2'),\n        MagicMock(hex='suffix3')\n    ]\n\n    ood_upload_corpus.upload_corpus(doc_str, path_prefix, output_dir,\n                                    num_uploads)\n\n    mock_get_files_path.assert_called_once_with(output_dir, num_uploads)\n    mock_upload_corpus_file.assert_has_calls([\n        call(os.path.join(output_dir, 'file_0.txt'),\n             'gs://test_bucket/corpus/suffix1', doc),\n        call(os.path.join(output_dir, 'file_1.txt'),\n             'gs://test_bucket/corpus/suffix2', doc),\n        call(os.path.join(output_dir, 'file_2.txt'),\n             'gs://test_bucket/corpus/suffix3', doc),\n    ])\n    self.assertEqual(mock_uuid.call_count, num_uploads)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/build/functions/ood_upload_testcase.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Upload OSS-Fuzz on Demand testcases.\"\"\"\n\nimport json\nimport logging\nimport os\nimport sys\nimport subprocess\n\ntry:\n  import requests\nexcept ImportError:\n  print(\"requests library not found. Installing...\")\n  subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"requests\"])\n  import requests\n\nPOST_URL = 'https://oss-fuzz.com/upload-testcase/upload-oauth'\n\n\ndef get_access_token(access_token_path):\n  \"\"\"Returns the ACCESS_TOKEN for upload testcase requests\"\"\"\n  with open(access_token_path, 'r') as f:\n    line = f.readline()\n    return line.strip()\n\n\ndef get_headers(access_token_path):\n  \"\"\"Returns the headers required to upload testcase requests\"\"\"\n  access_token = get_access_token(access_token_path)\n  return {\n      'Authorization': 'Bearer ' + access_token,\n  }\n\n\ndef upload_testcase(upload_url, testcase_path, job, target, access_token_path):\n  \"\"\"Make an upload testcase request.\"\"\"\n  files = {\n      'file': open(testcase_path, 'rb'),\n  }\n  data = {\n      'job': job,\n      'target': target,\n  }\n  try:\n    resp = requests.post(upload_url,\n                         files=files,\n                         data=data,\n                         headers=get_headers(access_token_path))\n    resp.raise_for_status()\n    result = json.loads(resp.text)\n    print('Upload succeeded. Testcase ID is', result['id'])\n  except:\n    print('Failed to upload with status', resp.status_code)\n    print(resp.text)\n\n\ndef get_crash_file_path(dir_path):\n  \"\"\"Returns the path of a crash file (except from out of memory, timeout and\n  slow units crashes) inside 'dir_path'. Returns None if there are no files\n  inside the the given directory.\"\"\"\n  excluded_prefixes = ('oom', 'timeout', 'slow-unit')\n  for entry in os.scandir(dir_path):\n    if entry.is_file() and not entry.name.startswith(excluded_prefixes):\n      return f'{dir_path}/{entry.name}'\n  return None\n\n\ndef main():\n  \"\"\"Upload an OSS-Fuzz on Demand testcase.\"\"\"\n  testcase_dir_path = sys.argv[1]\n  job = sys.argv[2]\n  target = sys.argv[3]\n  access_token_path = sys.argv[4]\n  testcase_path = get_crash_file_path(testcase_dir_path)\n\n  if not testcase_path:\n    print('OSS-Fuzz on Demand did not find any relevant crashes.')\n  else:\n    upload_testcase(POST_URL, testcase_path, job, target, access_token_path)\n\n  return 0\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/build/functions/ood_upload_testcase_test.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests for ood_upload_testcase_test.py.\"\"\"\n\nimport os\nimport shutil\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport ood_upload_testcase\n\n\nclass GetCrashFilePathTest(unittest.TestCase):\n  \"\"\"Tests for get_crash_file_path.\"\"\"\n\n  def setUp(self):\n    \"\"\"Set tem_dir attribute\"\"\"\n    self.temp_dir = tempfile.mkdtemp()\n\n  def tearDown(self):\n    \"\"\"Remove temp_dir after tests\"\"\"\n    shutil.rmtree(self.temp_dir)\n\n  def test_no_files(self):\n    \"\"\"Test for empty directory\"\"\"\n    self.assertIsNone(ood_upload_testcase.get_crash_file_path(self.temp_dir))\n\n  def test_single_file(self):\n    \"\"\"Test for single file\"\"\"\n    file_name = 'test_file.txt'\n    file_path = os.path.join(self.temp_dir, file_name)\n    open(file_path, 'w').close()\n    self.assertEqual(ood_upload_testcase.get_crash_file_path(self.temp_dir),\n                     file_path)\n\n  def test_multiple_files(self):\n    \"\"\"Test for multiple files\"\"\"\n    file_names = ['file1.txt', 'file2.csv', 'data.json']\n    file_paths = []\n    for name in file_names:\n      file_path = os.path.join(self.temp_dir, name)\n      file_paths.append(file_path)\n      open(file_path, 'w').close()\n    self.assertIn(ood_upload_testcase.get_crash_file_path(self.temp_dir),\n                  file_paths)\n\n  def test_with_subdirectory(self):\n    \"\"\"Test for directory with subdirectory\"\"\"\n    os.makedirs(os.path.join(self.temp_dir, 'subdir'))\n    self.assertIsNone(ood_upload_testcase.get_crash_file_path(self.temp_dir))\n\n    file_name = 'test_file.txt'\n    file_path = os.path.join(self.temp_dir, file_name)\n    open(file_path, 'w').close()\n    self.assertEqual(ood_upload_testcase.get_crash_file_path(self.temp_dir),\n                     file_path)\n\n  def test_oom_file(self):\n    \"\"\"Test for crash file starting with 'oom'\"\"\"\n    file_name = 'oom-test_file.txt'\n    file_path = os.path.join(self.temp_dir, file_name)\n    open(file_path, 'w').close()\n    self.assertIsNone(ood_upload_testcase.get_crash_file_path(self.temp_dir))\n"
  },
  {
    "path": "infra/build/functions/oss_fuzz_on_demand.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"OSS-Fuzz on demand.\"\"\"\n\nimport sys\nimport logging\n\nimport fuzzbench\nimport build_project\n\n\ndef oss_fuzz_on_demand_main(args=None):\n  \"\"\"Main function for OSS-Fuzz on demand. Returns 0 on success, 1 on\n  failure.\"\"\"\n  return build_project.build_script_main('Does a FuzzBench run.',\n                                         fuzzbench.get_build_steps,\n                                         fuzzbench.FUZZBENCH_BUILD_TYPE, args)\n\n\ndef main():\n  \"\"\"Build OSS-Fuzz projects with FuzzBench fuzzing engines.\"\"\"\n  logging.basicConfig(level=logging.INFO)\n  return 0 if oss_fuzz_on_demand_main() else 1\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/build/functions/project_experiment.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script to run target experiments on GCB.\"\"\"\n\nimport argparse\nimport logging\nimport sys\n\nimport google.auth\n\nimport build_lib\nimport build_project\n\n\ndef run_experiment(project_name, command, output_path, experiment_name):\n  \"\"\"Runs the experiment specified on GCB.\"\"\"\n  config = build_project.Config(testing=True,\n                                test_image_suffix='',\n                                repo=build_project.DEFAULT_OSS_FUZZ_REPO,\n                                branch=None,\n                                parallel=False,\n                                upload=False,\n                                experiment=True,\n                                upload_build_logs=None)\n\n  try:\n    project_yaml, dockerfile_contents = (\n        build_project.get_project_data(project_name))\n  except FileNotFoundError:\n    logging.error('Couldn\\'t get project data. Skipping %s.', project_name)\n    return None\n\n  project = build_project.Project(project_name, project_yaml,\n                                  dockerfile_contents)\n\n  # Override sanitizers and engine because we only care about libFuzzer+ASan\n  # for benchmarking purposes.\n  build_project.set_yaml_defaults(project_yaml)\n  project_yaml['sanitizers'] = ['address']\n  project_yaml['fuzzing_engines'] = ['libfuzzer']\n  project_yaml['architectures'] = ['x86_64']\n\n  # Don't do bad build checks.\n  project_yaml['run_tests'] = False\n\n  steps = build_lib.get_project_image_steps(project.name,\n                                            project.image,\n                                            project.fuzzing_language,\n                                            config=config,\n                                            architectures=project.architectures,\n                                            experiment=config.experiment)\n\n  steps.extend([\n      {\n          'name': project.image,\n          'args': [\n              'bash',\n              '-c',\n              'mkdir /workspace/out',\n          ]\n      },\n      {\n          'name':\n              project.image,\n          'args': [\n              'bash',\n              '-c',\n              f'(cd \"/src\"; cd {project.workdir}; {command})',\n          ]\n      },\n      {\n          'name': 'gcr.io/cloud-builders/gsutil',\n          'args': [\n              '-m',\n              'cp',\n              '-r',\n              '/workspace/out/*',\n              output_path,\n          ]\n      },\n  ])\n\n  credentials, _ = google.auth.default()\n  return build_project.run_build(project_name,\n                                 steps,\n                                 credentials,\n                                 'experiment',\n                                 experiment=True,\n                                 extra_tags=[f'experiment-{experiment_name}'])\n\n\ndef main():\n  \"\"\"Runs run target experiments on GCB.\"\"\"\n  parser = argparse.ArgumentParser(sys.argv[0], description='Test projects')\n  parser.add_argument('--project', required=True, help='Project name')\n  parser.add_argument('--command',\n                      required=True,\n                      help='Command to run inside the project image.')\n  parser.add_argument('--upload_output',\n                      required=True,\n                      help='GCS bucket location to upload output to.')\n  parser.add_argument('--experiment_name',\n                      required=True,\n                      help='Experiment name.')\n  args = parser.parse_args()\n\n  run_experiment(args.project, args.command, args.upload_output,\n                 args.experiment_name)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/build/functions/project_sync.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud functions for build scheduling.\"\"\"\n\nfrom collections import namedtuple\nimport io\nimport logging\nimport os\nimport re\nimport tempfile\nimport urllib.request\nimport zipfile\n\nfrom google.api_core import exceptions\nfrom google.cloud import ndb\nfrom google.cloud import scheduler_v1\nimport yaml\n\nimport build_and_run_coverage\nimport build_project\nfrom datastore_entities import Project\n\nVALID_PROJECT_NAME = re.compile(r'^[a-zA-Z0-9_-]+$')\nDEFAULT_BUILDS_PER_DAY = 1\nMAX_BUILDS_PER_DAY = 4\nCOVERAGE_SCHEDULE = '0 6 * * *'\nINTROSPECTOR_SCHEDULE = '0 10 * * *'\nFUZZING_BUILD_TOPIC = 'request-build'\nCOVERAGE_BUILD_TOPIC = 'request-coverage-build'\nINTROSPECTOR_BUILD_TOPIC = 'request-introspector-build'\n\nProjectMetadata = namedtuple(\n    'ProjectMetadata', 'schedule project_yaml_contents dockerfile_contents')\n\nContent = namedtuple('Content', 'type path name decoded_content')\n\nlogging.basicConfig(level=logging.INFO)\n\n\n# pylint: disable=too-few-public-methods\nclass OssFuzzRepo:\n  \"\"\"OSS-Fuzz repo.\"\"\"\n\n  _MASTER_ZIP_LINK = (\n      'https://github.com/google/oss-fuzz/archive/refs/heads/master.zip')\n\n  def __init__(self, out_dir):\n    with urllib.request.urlopen(self._MASTER_ZIP_LINK) as response:\n      zip_contents = response.read()\n\n    with zipfile.ZipFile(io.BytesIO(zip_contents)) as zip_file:\n      zip_file.extractall(out_dir)\n\n    self._out_dir = out_dir\n\n  @property\n  def _repo_dir(self):\n    return os.path.join(self._out_dir, 'oss-fuzz-master')\n\n  def get_contents(self, path):\n    \"\"\"Gets contents of path.\"\"\"\n    contents = []\n    list_path = os.path.join(self._repo_dir, path)\n    for item in os.listdir(list_path):\n      full_path = os.path.join(list_path, item)\n      rel_path = os.path.relpath(full_path, self._repo_dir)\n\n      if os.path.isdir(full_path):\n        file_type = 'dir'\n        decoded_content = None\n      else:\n        file_type = 'file'\n        with open(full_path, mode='rb') as file:\n          decoded_content = file.read()\n\n      contents.append(\n          Content(file_type, rel_path, os.path.basename(rel_path),\n                  decoded_content))\n\n    return contents\n\n\nclass ProjectYamlError(Exception):\n  \"\"\"Error in project.yaml format.\"\"\"\n\n\ndef create_scheduler(cloud_scheduler_client, project_name, schedule, tag,\n                     topic):\n  \"\"\"Creates schedulers for new projects.\"\"\"\n  project_id = os.environ.get('GCP_PROJECT')\n  location_id = os.environ.get('FUNCTION_REGION')\n  parent = cloud_scheduler_client.location_path(project_id, location_id)\n  job = {\n      'name': parent + '/jobs/' + project_name + '-scheduler-' + tag,\n      'pubsub_target': {\n          'topic_name': 'projects/' + project_id + '/topics/' + topic,\n          'data': project_name.encode()\n      },\n      'schedule': schedule\n  }\n\n  try:\n    existing_job = cloud_scheduler_client.get_job(job['name'])\n  except exceptions.NotFound:\n    existing_job = None\n\n  if existing_job:\n    if existing_job.schedule != schedule:\n      update_mask = {'paths': ['schedule']}\n      cloud_scheduler_client.update_job(job, update_mask)\n  else:\n    cloud_scheduler_client.create_job(parent, job)\n\n\ndef delete_scheduler(cloud_scheduler_client, project_name, tag):\n  \"\"\"Deletes schedulers for projects that were removed.\"\"\"\n  project_id = os.environ.get('GCP_PROJECT')\n  location_id = os.environ.get('FUNCTION_REGION')\n  name = cloud_scheduler_client.job_path(project_id, location_id,\n                                         project_name + '-scheduler-' + tag)\n  cloud_scheduler_client.delete_job(name)\n\n\ndef delete_project(cloud_scheduler_client, project):\n  \"\"\"Delete the given project.\"\"\"\n  logging.info('Deleting project %s', project.name)\n  for tag in (build_project.FUZZING_BUILD_TYPE,\n              build_and_run_coverage.COVERAGE_BUILD_TYPE,\n              build_and_run_coverage.INTROSPECTOR_BUILD_TYPE):\n    try:\n      delete_scheduler(cloud_scheduler_client, project.name, tag)\n    except exceptions.NotFound:\n      # Already deleted.\n      continue\n    except exceptions.GoogleAPICallError as error:\n      logging.error('Scheduler deletion for %s failed with %s', project.name,\n                    error)\n      return\n\n  project.key.delete()\n\n\n# pylint: disable=too-many-branches\ndef sync_projects(cloud_scheduler_client, projects):\n  \"\"\"Sync projects with cloud datastore.\"\"\"\n  for project in Project.query():\n    if project.name not in projects:\n      delete_project(cloud_scheduler_client, project)\n\n  existing_projects = {project.name for project in Project.query()}\n  for project_name in projects:\n    try:\n      create_scheduler(cloud_scheduler_client, project_name,\n                       projects[project_name].schedule,\n                       build_project.FUZZING_BUILD_TYPE, FUZZING_BUILD_TOPIC)\n      create_scheduler(cloud_scheduler_client, project_name, COVERAGE_SCHEDULE,\n                       build_and_run_coverage.COVERAGE_BUILD_TYPE,\n                       COVERAGE_BUILD_TOPIC)\n      create_scheduler(cloud_scheduler_client, project_name,\n                       INTROSPECTOR_SCHEDULE,\n                       build_and_run_coverage.INTROSPECTOR_BUILD_TYPE,\n                       INTROSPECTOR_BUILD_TOPIC)\n    except exceptions.GoogleAPICallError as error:\n      logging.error('Scheduler creation for %s failed with %s', project_name,\n                    error)\n      continue\n\n    if project_name in existing_projects:\n      continue\n\n    project_metadata = projects[project_name]\n    Project(name=project_name,\n            schedule=project_metadata.schedule,\n            project_yaml_contents=project_metadata.project_yaml_contents,\n            dockerfile_contents=project_metadata.dockerfile_contents).put()\n\n  for project in Project.query():\n    if project.name not in projects:\n      continue\n\n    logging.info('Setting up project %s', project.name)\n    project_metadata = projects[project.name]\n    project_changed = False\n    if project.schedule != project_metadata.schedule:\n      try:\n        logging.info('Schedule changed.')\n        project.schedule = project_metadata.schedule\n        project_changed = True\n      except exceptions.GoogleAPICallError as error:\n        logging.error('Updating scheduler for %s failed with %s', project.name,\n                      error)\n    if project.project_yaml_contents != project_metadata.project_yaml_contents:\n      project.project_yaml_contents = project_metadata.project_yaml_contents\n      project_changed = True\n\n    if project.dockerfile_contents != project_metadata.dockerfile_contents:\n      project.dockerfile_contents = project_metadata.dockerfile_contents\n      project_changed = True\n\n    if project_changed:\n      project.put()\n\n\ndef _has_docker_file(project_contents):\n  \"\"\"Checks if project has a Dockerfile.\"\"\"\n  return any(\n      content_file.name == 'Dockerfile' for content_file in project_contents)\n\n\ndef get_project_metadata(project_contents):\n  \"\"\"Checks for schedule parameter in yaml file else uses DEFAULT_SCHEDULE.\"\"\"\n  for content_file in project_contents:\n    if content_file.name == 'project.yaml':\n      project_yaml_contents = content_file.decoded_content.decode('utf-8')\n\n    if content_file.name == 'Dockerfile':\n      dockerfile_contents = content_file.decoded_content.decode('utf-8')\n\n  project_yaml = yaml.safe_load(project_yaml_contents)\n  builds_per_day = project_yaml.get('builds_per_day', DEFAULT_BUILDS_PER_DAY)\n  if not isinstance(builds_per_day, int) or builds_per_day not in range(\n      1, MAX_BUILDS_PER_DAY + 1):\n    raise ProjectYamlError('Parameter is not an integer in range [1-4]')\n\n  # Starting at 6:00 am, next build schedules are added at 'interval' slots\n  # Example for interval 2, hours = [6, 18] and schedule = '0 6,18 * * *'\n  interval = 24 // builds_per_day\n  hours = []\n  for hour in range(6, 30, interval):\n    hours.append(hour % 24)\n  schedule = '0 ' + ','.join(str(hour) for hour in hours) + ' * * *'\n\n  return ProjectMetadata(schedule, project_yaml_contents, dockerfile_contents)\n\n\ndef get_projects(repo):\n  \"\"\"Get project list from git repository.\"\"\"\n  projects = {}\n  contents = repo.get_contents('projects')\n  for content_file in contents:\n    if content_file.type != 'dir' or not VALID_PROJECT_NAME.match(\n        content_file.name):\n      continue\n\n    project_contents = repo.get_contents(content_file.path)\n    if not _has_docker_file(project_contents):\n      continue\n\n    try:\n      projects[content_file.name] = get_project_metadata(project_contents)\n    except ProjectYamlError as error:\n      logging.error(\n          'Incorrect format for project.yaml file of %s with error %s',\n          content_file.name, error)\n\n  return projects\n\n\ndef sync(event, context):\n  \"\"\"Sync projects with cloud datastore.\"\"\"\n  del event, context  # Unused.\n\n  with ndb.Client().context():\n    with tempfile.TemporaryDirectory() as temp_dir:\n      repo = OssFuzzRepo(temp_dir)\n      projects = get_projects(repo)\n      cloud_scheduler_client = scheduler_v1.CloudSchedulerClient()\n      sync_projects(cloud_scheduler_client, projects)\n"
  },
  {
    "path": "infra/build/functions/project_sync_test.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unit tests for Cloud Function sync, which syncs the list of github projects\nand uploads them to the Cloud Datastore.\"\"\"\n\nimport os\nimport sys\nimport unittest\n\nfrom google.cloud import ndb\n\nsys.path.append(os.path.dirname(__file__))\n# pylint: disable=wrong-import-position\n\nimport datastore_entities\nimport project_sync\nimport test_utils\n\n# pylint: disable=no-member\n\n\n# pylint: disable=too-few-public-methods\nclass Repository:\n  \"\"\"Mocking Github Repository.\"\"\"\n\n  def __init__(self, name, file_type, path, contents=None):\n    self.contents = contents or []\n    self.name = name\n    self.type = file_type\n    self.path = path\n    self.decoded_content = b\"name: test\"\n\n  def get_contents(self, path):\n    \"\"\"\"Get contents of repository.\"\"\"\n    if self.path == path:\n      return self.contents\n\n    for content_file in self.contents:\n      if content_file.path == path:\n        return content_file.contents\n\n    return None\n\n  def set_yaml_contents(self, decoded_content):\n    \"\"\"Set yaml_contents.\"\"\"\n    self.decoded_content = decoded_content\n\n\nclass CloudSchedulerClient:\n  \"\"\"Mocking cloud scheduler client.\"\"\"\n\n  def __init__(self):\n    self.schedulers = []\n\n  # pylint: disable=no-self-use\n  def location_path(self, project_id, location_id):\n    \"\"\"Return project path.\"\"\"\n    return f'projects/{project_id}/location/{location_id}'\n\n  def create_job(self, parent, job):\n    \"\"\"Simulate create job.\"\"\"\n    del parent\n    self.schedulers.append(job)\n\n  def get_job(self, name):\n    \"\"\"Simulate get_job.\"\"\"\n    for scheduler in self.schedulers:\n      if scheduler['name'] == name:\n        return scheduler\n\n    return None\n\n  # pylint: disable=no-self-use\n  def job_path(self, project_id, location_id, name):\n    \"\"\"Return job path.\"\"\"\n    return f'projects/{project_id}/location/{location_id}/jobs/{name}'\n\n  def delete_job(self, name):\n    \"\"\"Simulate delete jobs.\"\"\"\n    for job in self.schedulers:\n      if job['name'] == name:\n        self.schedulers.remove(job)\n        break\n\n  def update_job(self, job, update_mask):\n    \"\"\"Simulate update jobs.\"\"\"\n    for existing_job in self.schedulers:\n      if existing_job == job and 'schedule' in update_mask:\n        job['schedule'] = update_mask['schedule']\n\n\nclass TestDataSync(unittest.TestCase):\n  \"\"\"Unit tests for sync.\"\"\"\n\n  @classmethod\n  def setUpClass(cls):\n    cls.ds_emulator = test_utils.start_datastore_emulator()\n    test_utils.wait_for_emulator_ready(cls.ds_emulator, 'datastore',\n                                       test_utils.DATASTORE_READY_INDICATOR)\n    test_utils.set_gcp_environment()\n\n  def setUp(self):\n    test_utils.reset_ds_emulator()\n\n  def test_sync_projects_update(self):\n    \"\"\"Testing sync_projects() updating a schedule.\"\"\"\n    cloud_scheduler_client = CloudSchedulerClient()\n\n    with ndb.Client().context():\n      datastore_entities.Project(name='test1',\n                                 schedule='0 8 * * *',\n                                 project_yaml_contents='',\n                                 dockerfile_contents='').put()\n      datastore_entities.Project(name='test2',\n                                 schedule='0 9 * * *',\n                                 project_yaml_contents='',\n                                 dockerfile_contents='').put()\n\n      projects = {\n          'test1': project_sync.ProjectMetadata('0 8 * * *', '', ''),\n          'test2': project_sync.ProjectMetadata('0 7 * * *', '', '')\n      }\n      project_sync.sync_projects(cloud_scheduler_client, projects)\n\n      projects_query = datastore_entities.Project.query()\n      self.assertEqual({\n          'test1': '0 8 * * *',\n          'test2': '0 7 * * *'\n      }, {project.name: project.schedule for project in projects_query})\n\n  def test_sync_projects_create(self):\n    \"\"\"\"Testing sync_projects() creating new schedule.\"\"\"\n    cloud_scheduler_client = CloudSchedulerClient()\n\n    with ndb.Client().context():\n      datastore_entities.Project(name='test1',\n                                 schedule='0 8 * * *',\n                                 project_yaml_contents='',\n                                 dockerfile_contents='').put()\n\n      projects = {\n          'test1': project_sync.ProjectMetadata('0 8 * * *', '', ''),\n          'test2': project_sync.ProjectMetadata('0 7 * * *', '', '')\n      }\n      project_sync.sync_projects(cloud_scheduler_client, projects)\n\n      projects_query = datastore_entities.Project.query()\n      self.assertEqual({\n          'test1': '0 8 * * *',\n          'test2': '0 7 * * *'\n      }, {project.name: project.schedule for project in projects_query})\n\n      self.assertCountEqual([\n          {\n              'name': 'projects/test-project/location/us-central1/jobs/'\n                      'test1-scheduler-fuzzing',\n              'pubsub_target': {\n                  'topic_name': 'projects/test-project/topics/request-build',\n                  'data': b'test1'\n              },\n              'schedule': '0 8 * * *'\n          },\n          {\n              'name': 'projects/test-project/location/us-central1/jobs/'\n                      'test1-scheduler-coverage',\n              'pubsub_target': {\n                  'topic_name':\n                      'projects/test-project/topics/request-coverage-build',\n                  'data':\n                      b'test1'\n              },\n              'schedule': '0 6 * * *'\n          },\n          {\n              'name': 'projects/test-project/location/us-central1/jobs/'\n                      'test1-scheduler-introspector',\n              'pubsub_target': {\n                  'topic_name':\n                      'projects/test-project/topics/request-introspector-build',\n                  'data':\n                      b'test1'\n              },\n              'schedule': '0 10 * * *'\n          },\n          {\n              'name': 'projects/test-project/location/us-central1/jobs/'\n                      'test2-scheduler-fuzzing',\n              'pubsub_target': {\n                  'topic_name': 'projects/test-project/topics/request-build',\n                  'data': b'test2'\n              },\n              'schedule': '0 7 * * *'\n          },\n          {\n              'name': 'projects/test-project/location/us-central1/jobs/'\n                      'test2-scheduler-coverage',\n              'pubsub_target': {\n                  'topic_name':\n                      'projects/test-project/topics/request-coverage-build',\n                  'data':\n                      b'test2'\n              },\n              'schedule': '0 6 * * *'\n          },\n          {\n              'name': 'projects/test-project/location/us-central1/jobs/'\n                      'test2-scheduler-introspector',\n              'pubsub_target': {\n                  'topic_name':\n                      'projects/test-project/topics/request-introspector-build',\n                  'data':\n                      b'test2'\n              },\n              'schedule': '0 10 * * *'\n          },\n      ], cloud_scheduler_client.schedulers)\n\n  def test_sync_projects_delete(self):\n    \"\"\"Testing sync_projects() deleting.\"\"\"\n    cloud_scheduler_client = CloudSchedulerClient()\n\n    with ndb.Client().context():\n      datastore_entities.Project(name='test1',\n                                 schedule='0 8 * * *',\n                                 project_yaml_contents='',\n                                 dockerfile_contents='').put()\n      datastore_entities.Project(name='test2',\n                                 schedule='0 9 * * *',\n                                 project_yaml_contents='',\n                                 dockerfile_contents='').put()\n\n      projects = {'test1': project_sync.ProjectMetadata('0 8 * * *', '', '')}\n      project_sync.sync_projects(cloud_scheduler_client, projects)\n\n      projects_query = datastore_entities.Project.query()\n      self.assertEqual(\n          {'test1': '0 8 * * *'},\n          {project.name: project.schedule for project in projects_query})\n\n  def test_get_projects_yaml(self):\n    \"\"\"Testing get_projects() yaml get_schedule().\"\"\"\n\n    repo = Repository('oss-fuzz', 'dir', 'projects', [\n        Repository('test0', 'dir', 'projects/test0', [\n            Repository('Dockerfile', 'file', 'projects/test0/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test0/project.yaml')\n        ]),\n        Repository('test1', 'dir', 'projects/test1', [\n            Repository('Dockerfile', 'file', 'projects/test1/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test1/project.yaml')\n        ])\n    ])\n    repo.contents[0].contents[1].set_yaml_contents(b'builds_per_day: 2')\n    repo.contents[1].contents[1].set_yaml_contents(b'builds_per_day: 3')\n\n    self.assertEqual(\n        project_sync.get_projects(repo), {\n            'test0':\n                project_sync.ProjectMetadata('0 6,18 * * *',\n                                             'builds_per_day: 2', 'name: test'),\n            'test1':\n                project_sync.ProjectMetadata('0 6,14,22 * * *',\n                                             'builds_per_day: 3', 'name: test')\n        })\n\n  def test_get_projects_no_docker_file(self):\n    \"\"\"Testing get_projects() with missing dockerfile\"\"\"\n\n    repo = Repository('oss-fuzz', 'dir', 'projects', [\n        Repository('test0', 'dir', 'projects/test0', [\n            Repository('Dockerfile', 'file', 'projects/test0/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test0/project.yaml')\n        ]),\n        Repository('test1', 'dir', 'projects/test1')\n    ])\n\n    self.assertEqual(\n        project_sync.get_projects(repo), {\n            'test0':\n                project_sync.ProjectMetadata('0 6 * * *', 'name: test',\n                                             'name: test')\n        })\n\n  def test_get_projects_invalid_project_name(self):\n    \"\"\"Testing get_projects() with invalid project name\"\"\"\n\n    repo = Repository('oss-fuzz', 'dir', 'projects', [\n        Repository('test0', 'dir', 'projects/test0', [\n            Repository('Dockerfile', 'file', 'projects/test0/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test0/project.yaml')\n        ]),\n        Repository('test1@', 'dir', 'projects/test1', [\n            Repository('Dockerfile', 'file', 'projects/test1/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test0/project.yaml')\n        ])\n    ])\n\n    self.assertEqual(\n        project_sync.get_projects(repo), {\n            'test0':\n                project_sync.ProjectMetadata('0 6 * * *', 'name: test',\n                                             'name: test')\n        })\n\n  def test_get_projects_non_directory_type_project(self):\n    \"\"\"Testing get_projects() when a file in projects/ is not of type 'dir'.\"\"\"\n\n    repo = Repository('oss-fuzz', 'dir', 'projects', [\n        Repository('test0', 'dir', 'projects/test0', [\n            Repository('Dockerfile', 'file', 'projects/test0/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test0/project.yaml')\n        ]),\n        Repository('test1', 'file', 'projects/test1')\n    ])\n\n    self.assertEqual(\n        project_sync.get_projects(repo), {\n            'test0':\n                project_sync.ProjectMetadata('0 6 * * *', 'name: test',\n                                             'name: test')\n        })\n\n  def test_invalid_yaml_format(self):\n    \"\"\"Testing invalid yaml schedule parameter argument.\"\"\"\n\n    repo = Repository('oss-fuzz', 'dir', 'projects', [\n        Repository('test0', 'dir', 'projects/test0', [\n            Repository('Dockerfile', 'file', 'projects/test0/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test0/project.yaml')\n        ])\n    ])\n    repo.contents[0].contents[1].set_yaml_contents(\n        b'builds_per_day: some-string')\n\n    self.assertEqual(project_sync.get_projects(repo), {})\n\n  def test_yaml_out_of_range(self):\n    \"\"\"Testing invalid yaml schedule parameter argument.\"\"\"\n\n    repo = Repository('oss-fuzz', 'dir', 'projects', [\n        Repository('test0', 'dir', 'projects/test0', [\n            Repository('Dockerfile', 'file', 'projects/test0/Dockerfile'),\n            Repository('project.yaml', 'file', 'projects/test0/project.yaml')\n        ])\n    ])\n    repo.contents[0].contents[1].set_yaml_contents(b'builds_per_day: 5')\n\n    self.assertEqual(project_sync.get_projects(repo), {})\n\n  @classmethod\n  def tearDownClass(cls):\n    test_utils.cleanup_emulator(cls.ds_emulator)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/functions/report_generator.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Generates a comparative report of trial build results and determines the\nfinal status of the pipeline.\"\"\"\n\nimport json\nimport os\nimport sys\n\n# Define the expected result files for each build version.\nRESULT_FILES = {\n    'Legacy': 'legacy-results.json',\n    'Ubuntu 20.04': 'ubuntu-20-04-results.json',\n    'Ubuntu 24.04': 'ubuntu-24-04-results.json',\n}\n\n\ndef _print_box(title, lines):\n  \"\"\"Prints a formatted box with a title and lines.\"\"\"\n  box_width = 92\n  title_line = f'| {title.center(box_width - 4)} |'\n  summary_lines = [\n      '+' + '-' * (box_width - 2) + '+',\n      title_line,\n      '+' + '-' * (box_width - 2) + '+',\n  ]\n  for line in lines:\n    padding = box_width - 4 - len(line)\n    summary_lines.append(f'| {line}{\" \" * padding} |')\n\n  summary_lines.append('+' + '-' * (box_width - 2) + '+')\n  print('\\n'.join(summary_lines))\n\n\ndef generate_final_summary(all_results):\n  \"\"\"Prints a summary of all build versions.\"\"\"\n  box_width = 92\n  summary_lines = []\n  total_unique_projects = set()\n\n  for version, data in all_results.items():\n    if data:\n      total_unique_projects.update(data.get('all_projects', []))\n      passed = str(data.get('successful_builds', 0))\n      failed = str(data.get('failed_builds', 0))\n      skipped = str(data.get('skipped_builds', 0))\n      total_builds = str(\n          data.get('successful_builds', 0) + data.get('failed_builds', 0) +\n          data.get('skipped_builds', 0))\n      line = (\n          f\"  {version.ljust(15)} -> {'Passed:'.ljust(8)} {passed.ljust(6)} | \"\n          f\"{'Failed:'.ljust(8)} {failed.ljust(6)} | {'Skipped:'.ljust(8)} {skipped.ljust(6)} | \"\n          f\"{'Total:'.ljust(7)} {total_builds.ljust(6)}\")\n      summary_lines.append(line)\n\n  if summary_lines:\n    separator = '-' * (box_width - 4)\n    summary_lines.append(separator)\n    project_summary_line = (\n        f\"  Total Projects Analyzed: {len(total_unique_projects)}\")\n    summary_lines.append(project_summary_line)\n\n  _print_box('FINAL BUILD REPORT', summary_lines)\n\n\ndef generate_comparison_table(all_results):\n  \"\"\"Prints a table comparing failures across versions.\"\"\"\n  all_projects = set()\n  for data in all_results.values():\n    if data and 'all_projects' in data:\n      all_projects.update(data['all_projects'])\n\n  if not all_projects:\n    print('\\nNo projects were run.')\n    return\n\n  project_col_width = 30\n  header = ' Project                       |      Legacy      |   Ubuntu 20.04   |   Ubuntu 24.04'\n  separator = '-------------------------------+------------------+------------------+------------------'\n\n  table_lines = [header, separator]\n\n  for project in sorted(list(all_projects)):\n    project_name = project\n    if len(project_name) > project_col_width:\n      project_name = project_name[:project_col_width - 3] + '...'\n\n    row = f' {project_name.ljust(project_col_width)}|'\n    for version in RESULT_FILES:\n      status_icon = ' '\n      if all_results.get(version):\n        if project in all_results[version].get('failed_projects', []):\n          status_icon = 'FAIL'\n        elif project in all_results[version].get('skipped_projects', []):\n          status_icon = 'SKIP'\n        else:\n          status_icon = 'PASS'\n      row += f' {status_icon.center(15)} |'\n    row = row[:-1]\n    table_lines.append(row)\n\n  _print_box('FAILURE COMPARISON TABLE', table_lines)\n\n\ndef main():\n  \"\"\"Main function to generate report and determine pipeline status.\"\"\"\n  if os.path.exists('trial_build_skipped.flag'):\n    print('Skipping report generation because trial build was not invoked.')\n    sys.exit(0)\n\n  all_results = {}\n  any_failures = False\n  any_results_found = False\n  total_unique_projects = set()\n\n  print('Generating final build report...')\n\n  for version, filename in RESULT_FILES.items():\n    if not os.path.exists(filename):\n      print(f'Warning: Result file \"{filename}\" not found.')\n      all_results[version] = None\n      continue\n\n    with open(filename, 'r') as f:\n      data = json.load(f)\n      all_results[version] = data\n      any_results_found = True\n      if data.get('failed_builds', 0) > 0:\n        any_failures = True\n      total_unique_projects.update(data.get('all_projects', []))\n\n  if not any_results_found:\n    error_lines = [\n        'No result files found. This typically means that all upstream builds',\n        'either timed out or failed catastrophically.',\n    ]\n    _print_box('FINAL BUILD REPORT', error_lines)\n    print('\\nPipeline finished with failures.')\n    sys.exit(1)\n\n  generate_comparison_table(all_results)\n  generate_final_summary(all_results)\n\n  has_explicit_failures = any_failures\n  no_projects_were_run = any_results_found and not total_unique_projects\n\n  if has_explicit_failures or no_projects_were_run:\n    if no_projects_were_run and not has_explicit_failures:\n      print(\n          '\\nWarning: No projects were run. This may indicate an upstream issue.'\n      )\n    print('\\nPipeline finished with failures.')\n    sys.exit(1)\n\n  print('\\nPipeline finished successfully.')\n  sys.exit(0)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/build/functions/request_build.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud function to request builds.\"\"\"\nimport base64\n\nimport google.auth\nfrom google.cloud import ndb\nimport yaml\n\nimport build_project\nimport datastore_entities\n\nBASE_PROJECT = 'oss-fuzz-base'\nMAX_BUILD_HISTORY_LENGTH = 64\nQUEUE_TTL_SECONDS = 60 * 60 * 24  # 24 hours.\n\n\ndef update_build_history(project_name, build_id, build_tag):\n  \"\"\"Update build history of project.\"\"\"\n  project_key = ndb.Key(datastore_entities.BuildsHistory,\n                        project_name + '-' + build_tag)\n  project = project_key.get()\n\n  if not project:\n    project = datastore_entities.BuildsHistory(id=project_name + '-' +\n                                               build_tag,\n                                               build_tag=build_tag,\n                                               project=project_name,\n                                               build_ids=[])\n\n  if len(project.build_ids) >= MAX_BUILD_HISTORY_LENGTH:\n    project.build_ids.pop(0)\n\n  project.build_ids.append(build_id)\n  project.put()\n\n\ndef get_project_data(project_name):\n  \"\"\"Retrieve project metadata from datastore.\"\"\"\n  query = datastore_entities.Project.query(\n      datastore_entities.Project.name == project_name)\n  project = query.get()\n  if not project:\n    raise RuntimeError(\n        f'Project {project_name} not available in cloud datastore')\n\n  project_yaml = yaml.safe_load(project.project_yaml_contents)\n  return project_yaml, project.dockerfile_contents\n\n\ndef get_empty_config():\n  \"\"\"Returns an empty build config.\"\"\"\n  return build_project.Config()\n\n\ndef get_build_steps(project_name, timestamp=None):\n  \"\"\"Retrieve build steps.\"\"\"\n  project_yaml, dockerfile_lines = get_project_data(project_name)\n  build_config = build_project.Config(\n      build_type=build_project.FUZZING_BUILD_TYPE,\n      base_image_tag=project_yaml.get('base_os_version', None))\n\n  return build_project.get_build_steps(project_name,\n                                       project_yaml,\n                                       dockerfile_lines,\n                                       build_config,\n                                       timestamp=timestamp)\n\n\ndef get_indexer_build_steps(project_name, timestamp=None):\n  \"\"\"Retrieve build steps.\"\"\"\n  project_yaml, dockerfile_lines = get_project_data(project_name)\n  build_config = build_project.Config(\n      build_type=build_project.INDEXER_BUILD_TYPE)\n  return build_project.get_indexer_build_steps(project_name,\n                                               project_yaml,\n                                               dockerfile_lines,\n                                               build_config,\n                                               timestamp=timestamp)\n\n\ndef run_build(oss_fuzz_project,\n              build_steps,\n              credentials,\n              build_type,\n              cloud_project,\n              update_history=True):\n  \"\"\"Execute build on cloud build. Wrapper around build_project.py that also\n  updates the db.\"\"\"\n  build = build_project.run_build(oss_fuzz_project, build_steps, credentials,\n                                  build_type, cloud_project)\n  if update_history:\n    update_build_history(oss_fuzz_project, build['id'], build_type)\n\n\n# pylint: disable=no-member\ndef request_build(event, context):\n  \"\"\"Entry point for cloud function to request builds.\"\"\"\n  del context  #unused\n  if 'data' in event:\n    project_name = base64.b64decode(event['data']).decode('utf-8')\n  else:\n    raise RuntimeError('Project name missing from payload')\n\n  timestamp = build_project.get_datetime_now()\n  with ndb.Client().context():\n    credentials, cloud_project = google.auth.default()\n    build_steps = get_build_steps(project_name, timestamp)\n    if not build_steps:\n      return\n    run_build(\n        project_name,\n        build_steps,\n        credentials,\n        build_project.FUZZING_BUILD_TYPE,\n        cloud_project=cloud_project,\n    )\n\n    indexer_build_steps = get_indexer_build_steps(project_name, timestamp)\n    if not indexer_build_steps:\n      return\n    run_build(\n        project_name,\n        indexer_build_steps,\n        credentials,\n        build_project.INDEXER_BUILD_TYPE,\n        cloud_project=cloud_project,\n        update_history=False,\n    )\n"
  },
  {
    "path": "infra/build/functions/request_build_test.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unit tests for Cloud Function request builds which builds projects.\"\"\"\nimport base64\nimport json\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\nfrom google.cloud import ndb\n\n# pylint: disable=wrong-import-position\n\nimport datastore_entities\nimport request_build\nimport test_utils\nimport build_project\nimport build_lib\n\n# pylint: disable=no-member\n\n\nclass TestRequestBuilds(unittest.TestCase):\n  \"\"\"Unit tests for sync.\"\"\"\n\n  @classmethod\n  def setUpClass(cls):\n    cls.ds_emulator = test_utils.start_datastore_emulator()\n    test_utils.wait_for_emulator_ready(cls.ds_emulator, 'datastore',\n                                       test_utils.DATASTORE_READY_INDICATOR)\n    test_utils.set_gcp_environment()\n\n  def setUp(self):\n    test_utils.reset_ds_emulator()\n    self.maxDiff = None  # pylint: disable=invalid-name\n    self.mock_get_signed_url = mock.patch(\n        'build_lib.get_signed_url',\n        return_value='https://example.com/signed-url').start()\n    self.mock_get_signed_policy = mock.patch(\n        'build_lib.get_signed_policy_document_upload_prefix',\n        return_value=mock.MagicMock()).start()\n    self.mock_curl_args = mock.patch(\n        'build_lib.signed_policy_document_curl_args', return_value=[]).start()\n\n  def tearDown(self):\n    mock.patch.stopall()\n\n  def test_get_build_steps_no_project(self):\n    \"\"\"Test for when project isn't available in datastore.\"\"\"\n    with ndb.Client().context():\n      self.assertRaises(RuntimeError, request_build.get_build_steps,\n                        'test-project')\n\n  @mock.patch('build_project.run_build', return_value={'id': 'mock-build-id'})\n  def test_get_build_steps_with_base_os_version(self, mock_run_build):\n    \"\"\"Test that get_build_steps uses the base_os_version.\"\"\"\n    project_name = 'example'\n    base_os_version = 'ubuntu-24-04'\n\n    project_yaml_contents = \"\"\"\nhomepage: https://my-api.example.com\nmain_repo: https://github.com/example/my-api\nlanguage: c++\nvendor_ccs: []\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nbase_os_version: ubuntu-24-04\n\"\"\"\n    dockerfile_contents = \"\"\"\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.                                                 \n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\n\n# Get *your* source code here.\nRUN git clone https://github.com/google/oss-fuzz.git my-git-repo\nWORKDIR my-git-repo\nCOPY build.sh $SRC/\n\"\"\"\n    with ndb.Client().context():\n      datastore_entities.Project(name=project_name,\n                                 project_yaml_contents=project_yaml_contents,\n                                 dockerfile_contents=dockerfile_contents).put()\n\n    event = {'data': base64.b64encode(project_name.encode('utf-8'))}\n\n    with mock.patch('google.auth.default', return_value=(None, 'oss-fuzz')):\n      request_build.request_build(event, None)\n\n    self.assertTrue(mock_run_build.called)\n\n    self.assertEqual(2, mock_run_build.call_count)\n    build_steps = mock_run_build.call_args_list[0][0][1]\n\n    found_build_check_step = False\n    for inner_step in build_steps[0]:\n      if isinstance(\n          inner_step,\n          dict) and inner_step.get('id') and 'build-check' in inner_step['id']:\n        found_build_check_step = True\n        expected_image = f'gcr.io/oss-fuzz-base/base-runner:{base_os_version}'\n        self.assertIn(expected_image, inner_step['args'])\n        break\n    self.assertTrue(found_build_check_step, 'Build check step not found.')\n\n  def test_build_history(self):\n    \"\"\"Testing build history.\"\"\"\n    with ndb.Client().context():\n      datastore_entities.BuildsHistory(id='test-project-fuzzing',\n                                       build_tag='fuzzing',\n                                       project='test-project',\n                                       build_ids=[str(i) for i in range(1, 65)\n                                                 ]).put()\n      request_build.update_build_history('test-project', '65', 'fuzzing')\n      expected_build_ids = [str(i) for i in range(2, 66)]\n\n      self.assertEqual(datastore_entities.BuildsHistory.query().get().build_ids,\n                       expected_build_ids)\n\n  def test_build_history_no_existing_project(self):\n    \"\"\"Testing build history when build history object is missing.\"\"\"\n    with ndb.Client().context():\n      request_build.update_build_history('test-project', '1', 'fuzzing')\n      expected_build_ids = ['1']\n\n      self.assertEqual(datastore_entities.BuildsHistory.query().get().build_ids,\n                       expected_build_ids)\n\n  def test_get_project_data(self):\n    \"\"\"Testing get project data.\"\"\"\n    with ndb.Client().context():\n      self.assertRaises(RuntimeError, request_build.get_project_data,\n                        'test-project')\n\n  @classmethod\n  def tearDownClass(cls):\n    test_utils.cleanup_emulator(cls.ds_emulator)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/functions/request_coverage_build.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud function that requests coverage builds.\"\"\"\nimport base64\n\nimport google.auth\nfrom google.cloud import ndb\n\nimport build_and_run_coverage\nimport request_build\nimport build_project\n\nBASE_PROJECT = 'oss-fuzz-base'\n\n\ndef get_build_steps(project_name):\n  \"\"\"Retrieve build steps.\"\"\"\n  project_yaml, dockerfile_lines = request_build.get_project_data(project_name)\n  build_config = build_project.Config(\n      base_image_tag=project_yaml.get('base_os_version', None))\n\n  return build_and_run_coverage.get_build_steps(project_name, project_yaml,\n                                                dockerfile_lines, build_config)\n\n\ndef request_coverage_build(event, context):\n  \"\"\"Entry point for coverage build cloud function.\"\"\"\n  del context  # Unused.\n  if 'data' in event:\n    project_name = base64.b64decode(event['data']).decode('utf-8')\n  else:\n    raise RuntimeError('Project name missing from payload')\n\n  with ndb.Client().context():\n    credentials, cloud_project = google.auth.default()\n    build_steps = get_build_steps(project_name)\n    if not build_steps:\n      return\n    request_build.run_build(project_name,\n                            build_steps,\n                            credentials,\n                            build_and_run_coverage.COVERAGE_BUILD_TYPE,\n                            cloud_project=cloud_project)\n"
  },
  {
    "path": "infra/build/functions/request_coverage_build_test.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unit tests for Cloud Function request_coverage_build.\"\"\"\nimport base64\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\nfrom google.cloud import ndb\n\n# pylint: disable=wrong-import-position\n\nimport datastore_entities\nimport request_coverage_build\nimport test_utils\nimport yaml\n\n# pylint: disable=no-member\n\n\nclass TestRequestCoverageBuild(unittest.TestCase):\n  \"\"\"Unit tests for sync.\"\"\"\n\n  @classmethod\n  def setUpClass(cls):\n    cls.ds_emulator = test_utils.start_datastore_emulator()\n    test_utils.wait_for_emulator_ready(cls.ds_emulator, 'datastore',\n                                       test_utils.DATASTORE_READY_INDICATOR)\n    test_utils.set_gcp_environment()\n\n  def setUp(self):\n    test_utils.reset_ds_emulator()\n    self.maxDiff = None\n\n  @mock.patch('request_build.run_build', return_value={'id': 'mock-build-id'})\n  @mock.patch('build_lib.get_signed_url',\n              return_value='https://mocked-signed-url.com')\n  def test_get_build_steps_with_base_os_version(self, mock_get_signed_url,\n                                                mock_run_build):\n    \"\"\"Test that get_build_steps uses the base_os_version for coverage builds.\"\"\"\n    project_name = 'example'\n    base_os_version = 'ubuntu-24-04'\n\n    project_yaml_contents = f\"\"\"\nhomepage: https://my-api.example.com\nmain_repo: https://github.com/example/my-api\nlanguage: c++\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nbase_os_version: {base_os_version}\n\"\"\"\n    dockerfile_contents = \"FROM gcr.io/oss-fuzz-base/base-builder\"\n\n    with mock.patch('request_build.get_project_data') as mock_get_project_data:\n      mock_get_project_data.return_value = (\n          yaml.safe_load(project_yaml_contents), dockerfile_contents)\n\n      event = {'data': base64.b64encode(project_name.encode('utf-8'))}\n\n      with mock.patch('google.auth.default', return_value=(None, 'oss-fuzz')):\n        request_coverage_build.request_coverage_build(event, None)\n\n    self.assertTrue(mock_run_build.called)\n    build_steps = mock_run_build.call_args[0][1]\n\n    for inner_list in build_steps:\n      for step in inner_list:\n        if isinstance(\n            step, dict\n        ) and 'name' in step and 'gcr.io/oss-fuzz-base/base-runner' in step[\n            'name']:\n          found_build_check_step = True\n          expected_image = f'gcr.io/oss-fuzz-base/base-runner:{base_os_version}'\n          self.assertEqual(step['name'], expected_image)\n          break\n      if found_build_check_step:\n        break\n    self.assertTrue(found_build_check_step, 'Coverage build step not found.')\n\n  @classmethod\n  def tearDownClass(cls):\n    test_utils.cleanup_emulator(cls.ds_emulator)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/functions/request_introspector_build.py",
    "content": "# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Cloud function that requests fuzz introspector builds.\"\"\"\nimport base64\n\nimport google.auth\nfrom google.cloud import ndb\n\nimport build_and_run_coverage\nimport request_build\nimport build_project\n\nBASE_PROJECT = 'oss-fuzz-base'\n\n\n# TODO (navidem): write test, currently tested manually.\ndef get_build_steps(project_name, image_project, base_images_project):\n  \"\"\"Retrieve build steps.\"\"\"\n  project_yaml, dockerfile_lines = request_build.get_project_data(project_name)\n  build_config = build_project.Config(\n      base_image_tag=project_yaml.get('base_os_version', None))\n\n  build_config.base_image_tag = project_yaml.get('base_os_version', None)\n\n  return build_and_run_coverage.get_fuzz_introspector_steps(\n      project_name, project_yaml, dockerfile_lines, build_config)\n\n\ndef request_introspector_build(event, context):\n  \"\"\"Entry point for fuzz introspector build cloud function.\"\"\"\n  del context  # Unused.\n  if 'data' in event:\n    project_name = base64.b64decode(event['data']).decode('utf-8')\n  else:\n    raise RuntimeError('Project name missing from payload')\n\n  with ndb.Client().context():\n    credentials, cloud_project = google.auth.default()\n    build_steps = get_build_steps(project_name, cloud_project, BASE_PROJECT)\n    if not build_steps:\n      return\n    request_build.run_build(project_name,\n                            build_steps,\n                            credentials,\n                            build_and_run_coverage.INTROSPECTOR_BUILD_TYPE,\n                            cloud_project=cloud_project)\n"
  },
  {
    "path": "infra/build/functions/request_introspector_build_test.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Unit tests for Cloud Function request_introspector_build.\"\"\"\nimport base64\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\nfrom google.cloud import ndb\n\n# pylint: disable=wrong-import-position\n\nimport datastore_entities\nimport request_introspector_build\nimport test_utils\nimport yaml\n\n# pylint: disable=no-member\n\n\nclass TestRequestIntrospectorBuild(unittest.TestCase):\n  \"\"\"Unit tests for sync.\"\"\"\n\n  @classmethod\n  def setUpClass(cls):\n    cls.ds_emulator = test_utils.start_datastore_emulator()\n    test_utils.wait_for_emulator_ready(cls.ds_emulator, 'datastore',\n                                       test_utils.DATASTORE_READY_INDICATOR)\n    test_utils.set_gcp_environment()\n\n  def setUp(self):\n    test_utils.reset_ds_emulator()\n    self.maxDiff = None\n\n  @mock.patch('request_build.run_build', return_value={'id': 'mock-build-id'})\n  def test_get_build_steps_with_base_os_version(self, mock_run_build):\n    \"\"\"Test that get_build_steps uses the base_os_version for introspector builds.\"\"\"\n    project_name = 'example'\n    base_os_version = 'ubuntu-24-04'\n\n    project_yaml_contents = f\"\"\"\nhomepage: https://my-api.example.com\nmain_repo: https://github.com/example/my-api\nlanguage: c++\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nbase_os_version: {base_os_version}\n\"\"\"\n    dockerfile_contents = \"FROM gcr.io/oss-fuzz-base/base-builder\"\n\n    with mock.patch('request_build.get_project_data') as mock_get_project_data:\n      mock_get_project_data.return_value = (\n          yaml.safe_load(project_yaml_contents), dockerfile_contents)\n\n      event = {'data': base64.b64encode(project_name.encode('utf-8'))}\n\n      with mock.patch('google.auth.default', return_value=(None, 'oss-fuzz')):\n        request_introspector_build.request_introspector_build(event, None)\n\n    self.assertTrue(mock_run_build.called)\n    build_steps = mock_run_build.call_args[0][1]\n\n    for inner_list in build_steps:\n      for step in inner_list:\n        if isinstance(\n            step, dict\n        ) and 'name' in step and 'gcr.io/oss-fuzz-base/base-runner' in step[\n            'name']:\n          found_build_check_step = True\n          expected_image = f'gcr.io/oss-fuzz-base/base-runner:{base_os_version}'\n          self.assertEqual(step['name'], expected_image)\n          break\n      if found_build_check_step:\n        break\n    self.assertTrue(found_build_check_step,\n                    'Introspector build step not found.')\n\n  @classmethod\n  def tearDownClass(cls):\n    test_utils.cleanup_emulator(cls.ds_emulator)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/functions/requirements.txt",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBrotli==1.0.9\nhiredis==3.0.0\nPyYaml==6.0.2\nPyGithub==2.6.1\ngrpcio==1.71.0\ngoogle-auth==1.21.1\ngoogle-cloud-datastore<2.0\ngoogle-cloud-ndb==1.7.1\ngoogle-cloud-scheduler==1.3.0\ngoogle-cloud-storage==1.29.0\ngoogle-api-core==1.22.2\ngoogle-api-python-client==1.9.3\noauth2client==4.1.3\npython-dateutil==2.8.1\nprotobuf==3.20.2\nbeautifulsoup4==4.11.1\nwrapt==1.17.2\n"
  },
  {
    "path": "infra/build/functions/target_experiment.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script to run target experiments on GCB.\"\"\"\n\nimport argparse\nimport logging\nimport os\nimport sys\n\nimport google.auth\n\nimport build_lib\nimport build_project\n\n# 12 hours, allowing more than enough waiting time before cloud build starts.\nbuild_lib.BUILD_TIMEOUT = 12 * 60 * 60\n\n\ndef run_experiment(project_name,\n                   target_name,\n                   args,\n                   output_path,\n                   build_output_path,\n                   upload_corpus_path,\n                   upload_coverage_path,\n                   experiment_name,\n                   upload_reproducer_path,\n                   tags,\n                   use_cached_image,\n                   real_project_name=None):\n  config = build_project.Config(testing=True,\n                                test_image_suffix='',\n                                repo=build_project.DEFAULT_OSS_FUZZ_REPO,\n                                branch=None,\n                                parallel=False,\n                                upload=False,\n                                experiment=True,\n                                upload_build_logs=build_output_path)\n\n  try:\n    project_yaml, dockerfile_contents = (\n        build_project.get_project_data(project_name))\n  except FileNotFoundError:\n    logging.error('Couldn\\'t get project data. Skipping %s.', project_name)\n    return\n\n  # Override sanitizers and engine because we only care about libFuzzer+ASan\n  # for benchmarking purposes.\n  build_project.set_yaml_defaults(project_yaml)\n  project_yaml['sanitizers'] = ['address']\n  project_yaml['fuzzing_engines'] = ['libfuzzer']\n  project_yaml['architectures'] = ['x86_64']\n\n  # Don't do bad build checks.\n  project_yaml['run_tests'] = False\n  project = build_project.Project(project_name, project_yaml,\n                                  dockerfile_contents)\n\n  if real_project_name:\n    # If the passed project name is not the actual OSS-Fuzz project name (e.g.\n    # OSS-Fuzz-Gen generated benchmark), record the real one here.\n    project.real_name = real_project_name\n\n  steps = build_project.get_build_steps_for_project(\n      project, config, use_caching=use_cached_image)\n\n  build = build_project.Build('libfuzzer', 'address', 'x86_64')\n  local_output_path = '/workspace/output.log'\n  local_corpus_path_base = '/workspace/corpus'\n  local_corpus_path = os.path.join(local_corpus_path_base, target_name)\n  default_target_path = os.path.join(build.out, target_name)\n  local_target_dir = os.path.join(build.out, 'target')\n  local_corpus_zip_path = '/workspace/corpus/corpus.zip'\n  local_artifact_path = os.path.join(build.out, 'artifacts/')\n  local_stacktrace_path = os.path.join(build.out, 'stacktrace/')\n  fuzzer_args = ' '.join(args + [f'-artifact_prefix={local_artifact_path}'])\n\n  env = build_project.get_env(project_yaml['language'], build)\n  env.append('RUN_FUZZER_MODE=batch')\n  env.append('CORPUS_DIR=' + local_corpus_path)\n\n  run_step = {\n      'name':\n          'gcr.io/oss-fuzz-base/base-runner',\n      'env':\n          env,\n      'args': [\n          'bash',\n          '-c',\n          (f'mkdir -p {local_corpus_path} && '\n           f'mkdir -p {local_target_dir} && '\n           f'mkdir -p {local_artifact_path} && '\n           f'mkdir -p {local_stacktrace_path} && '\n           f'run_fuzzer {target_name} {fuzzer_args} '\n           f'|& tee {local_output_path} || true'),\n      ]\n  }\n  steps.append(build_lib.dockerify_run_step(run_step, build))\n  steps.append({\n      'name': 'gcr.io/cloud-builders/gsutil',\n      'args': ['-m', 'cp', local_output_path, output_path]\n  })\n\n  # Upload corpus.\n  steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'entrypoint':\n          '/bin/bash',\n      'args': [\n          '-c',\n          (f'cd {local_corpus_path} && '\n           f'zip -r {local_corpus_zip_path} * && '\n           f'gsutil -m cp {local_corpus_zip_path} {upload_corpus_path} || '\n           f'rm -f {local_corpus_zip_path}'),\n      ],\n  })\n\n  if upload_reproducer_path:\n    # Upload binary. First copy the binary directly from default_target_path,\n    # if that fails, find it under build out dir and copy to local_target_dir.\n    # If either succeeds, then upload it to bucket.\n    # If multiple files are found, suffix them and upload them all.\n    steps.append({\n        'name':\n            'gcr.io/cloud-builders/gsutil',\n        'entrypoint':\n            '/bin/bash',\n        'args': [\n            '-c',\n            (f'cp {default_target_path} {local_target_dir} 2>/dev/null || '\n             f'find {build.out} -type f -name {target_name} -exec bash -c '\n             f'\\'cp \"$0\" \"{local_target_dir}/$(echo \"$0\" | sed \"s@/@_@g\")\"\\' '\n             f'{{}} \\\\; && gsutil cp -r {local_target_dir} '\n             f'{upload_reproducer_path}/target_binary || true'),\n        ],\n    })\n\n    # Upload reproducer.\n    steps.append({\n        'name':\n            'gcr.io/cloud-builders/gsutil',\n        'entrypoint':\n            '/bin/bash',\n        'args': [\n            '-c',\n            (f'gsutil -m cp -r {local_artifact_path} {upload_reproducer_path} '\n             '|| true'),\n        ],\n    })\n\n    # Upload stacktrace.\n    steps.append({\n        'name':\n            'gcr.io/cloud-builders/gsutil',\n        'entrypoint':\n            '/bin/bash',\n        'args': [\n            '-c',\n            (f'if [ -f {local_target_dir}/{target_name} ]; then '\n             f'{local_target_dir}/{target_name} {local_artifact_path}/* > '\n             f'{local_stacktrace_path}/{target_name}.st 2>&1; '\n             'else '\n             f'for target in {local_target_dir}/*; do '\n             f'\"$target\" {local_artifact_path}/* > '\n             f'\"{local_stacktrace_path}/$target.st\" 2>&1; '\n             'done; fi; '\n             f'gsutil -m cp -r {local_stacktrace_path} {upload_reproducer_path}'\n             ' || true'),\n        ],\n    })\n\n  # Build for coverage.\n  build = build_project.Build('libfuzzer', 'coverage', 'x86_64')\n  env = build_project.get_env(project_yaml['language'], build)\n\n  if use_cached_image:\n    project.cached_sanitizer = 'coverage'\n    steps.extend(\n        build_lib.get_project_image_steps(project.name,\n                                          project.image,\n                                          project.fuzzing_language,\n                                          config=config,\n                                          architectures=project.architectures,\n                                          experiment=config.experiment,\n                                          cache_image=project.cached_image,\n                                          srcmap=False))\n\n  steps.append(\n      build_project.get_compile_step(project, build, env, config.parallel))\n\n  # Generate coverage report.\n  env.extend([\n      # The coverage script automatically adds the target name to this.\n      'CORPUS_DIR=' + local_corpus_path_base,\n      'HTTP_PORT=',\n      f'COVERAGE_EXTRA_ARGS={project.coverage_extra_args.strip()}',\n  ])\n  steps.append({\n      'name':\n          build_lib.get_runner_image_name(''),\n      'env':\n          env,\n      'entrypoint':\n          '/bin/bash',\n      'args': [\n          '-c',\n          (\n              f'timeout 30m coverage {target_name}; ret=$?; '\n              '[ $ret -eq 124 ] '  # Exit code 124 indicates a time out.\n              f'&& echo \"coverage {target_name} timed out after 30 minutes\" '\n              f'|| echo \"coverage {target_name} completed with exit code $ret\"'\n          ),\n      ],\n  })\n\n  # Upload raw coverage data.\n  steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'args': [\n          '-m',\n          'cp',\n          '-r',\n          os.path.join(build.out, 'dumps'),\n          os.path.join(upload_coverage_path, 'dumps'),\n      ],\n  })\n\n  # Upload coverage report.\n  steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'args': [\n          '-m',\n          'cp',\n          '-r',\n          os.path.join(build.out, 'report'),\n          os.path.join(upload_coverage_path, 'report'),\n      ],\n  })\n\n  # Upload textcovs.\n  steps.append({\n      'name':\n          'gcr.io/cloud-builders/gsutil',\n      'args': [\n          '-m',\n          'cp',\n          '-r',\n          os.path.join(build.out, 'textcov_reports'),\n          os.path.join(upload_coverage_path, 'textcov_reports'),\n      ],\n  })\n\n  credentials, _ = google.auth.default()\n  build = build_project.run_build(project_name,\n                                  steps,\n                                  credentials,\n                                  'experiment',\n                                  experiment=True,\n                                  extra_tags=[experiment_name, project_name] +\n                                  tags)\n\n  build_id = build['id']\n  print('Waiting for build', build_id)\n  try:\n    build_lib.wait_for_build(build_id, credentials, 'oss-fuzz')\n  except (KeyboardInterrupt, SystemExit):\n    # Cancel the build on exit, to avoid dangling builds.\n    build_lib.cancel_build(build_id, credentials, 'oss-fuzz')\n\n\ndef main():\n  \"\"\"Runs a target experiment on GCB.\"\"\"\n  parser = argparse.ArgumentParser(sys.argv[0], description='Test projects')\n  parser.add_argument('--project', required=True, help='Project name')\n  parser.add_argument('--target', required=True, help='Target name')\n  parser.add_argument('args',\n                      nargs='+',\n                      help='Additional arguments to pass to the target')\n  parser.add_argument('--upload_build_log',\n                      required=True,\n                      help='GCS build log location.')\n  parser.add_argument('--upload_output_log',\n                      required=True,\n                      help='GCS log location.')\n  parser.add_argument('--upload_corpus',\n                      required=True,\n                      help='GCS location to upload corpus.')\n  parser.add_argument('--upload_reproducer',\n                      required=False,\n                      default='',\n                      help='GCS location to upload reproducer.')\n  parser.add_argument('--upload_coverage',\n                      required=True,\n                      help='GCS location to upload coverage data.')\n  parser.add_argument('--experiment_name',\n                      required=True,\n                      help='Experiment name.')\n  parser.add_argument('--tags',\n                      nargs='*',\n                      help='Tags for cloud build.',\n                      default=[])\n  parser.add_argument('--use_cached_image',\n                      action='store_true',\n                      help='Use cached images post build.')\n  parser.add_argument(\n      '--real_project',\n      required=False,\n      default='',\n      help=('The real OSS-Fuzz project name (e.g. if `--project` '\n            'is an autogenerated project name).'))\n  args = parser.parse_args()\n\n  run_experiment(args.project, args.target, args.args, args.upload_output_log,\n                 args.upload_build_log, args.upload_corpus,\n                 args.upload_coverage, args.experiment_name,\n                 args.upload_reproducer, args.tags, args.use_cached_image,\n                 args.real_project)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/build/functions/test_data/expected_build_steps.json",
    "content": "[\n  {\n    \"args\": [\n      \"clone\",\n      \"https://github.com/google/oss-fuzz.git\",\n      \"--depth\",\n      \"1\"\n    ],\n    \"name\": \"gcr.io/cloud-builders/git\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"build\",\n      \"--tag\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"--tag\",\n      \"us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project\",\n      \"oss-fuzz/projects/test-project\"\n    ],\n    \"id\": \"build-UNIQUE_ID\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json\"\n    ],\n    \"env\": [\n      \"OSSFUZZ_REVISION=$REVISION_ID\",\n      \"FUZZING_LANGUAGE=c++\"\n    ],\n    \"id\": \"srcmap\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"run\",\n      \"--privileged\",\n      \"linuxkit/binfmt:v0.8\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"buildx\",\n      \"create\",\n      \"--name\",\n      \"buildxbuilder\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"buildx\",\n      \"use\",\n      \"buildxbuilder\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"buildx\",\n      \"build\",\n      \"--platform\",\n      \"linux/arm64\",\n      \"--progress\",\n      \"plain\",\n      \"--load\",\n      \"--tag\",\n      \"gcr.io/oss-fuzz/test-project-aarch64\",\n      \"--tag\",\n      \"us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project-aarch64\",\n      \"oss-fuzz/projects/test-project\"\n    ],\n    \"id\": \"build-UNIQUE_ID\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=afl\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/afl-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-afl-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=afl\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine afl --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-afl-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/afl-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/afl-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/afl-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-centipede-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-centipede-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/centipede-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"-e\",\n      \"SANITIZER=none\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-centipede-none-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"-e\",\n      \"SANITIZER=none\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-centipede-none-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.none\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.none\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-none-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/centipede-none-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/honggfuzz-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-honggfuzz-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-honggfuzz-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/honggfuzz-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/honggfuzz-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/honggfuzz-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=i386\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-i386 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-i386\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=i386\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture i386 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-i386\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-address-i386 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-address-i386/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-address-i386\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=aarch64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/arm64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=aarch64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project-aarch64\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-aarch64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-aarch64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=aarch64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/arm64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=aarch64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-aarch64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=aarch64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-address-aarch64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-address-aarch64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-address-aarch64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"SANITIZER=memory\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"-e\",\n      \"SANITIZER=memory\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-memory-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-memory-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"SANITIZER=memory\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"-e\",\n      \"SANITIZER=memory\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-memory-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"SANITIZER=memory\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.memory\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-memory-x86_64 && zip -r test-project-memory-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-memory-x86_64/test-project-memory-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.memory\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-memory-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-memory-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"-e\",\n      \"SANITIZER=undefined\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-undefined-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-undefined-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"-e\",\n      \"SANITIZER=undefined\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-undefined-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.undefined\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-undefined-x86_64 && zip -r test-project-undefined-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-undefined-x86_64/test-project-undefined-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.undefined\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-undefined-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-undefined-x86_64\"\n    ]\n  }\n]"
  },
  {
    "path": "infra/build/functions/test_data/expected_build_steps_ubuntu_24_04.json",
    "content": "[\n  {\n    \"args\": [\n      \"clone\",\n      \"https://github.com/google/oss-fuzz.git\",\n      \"--depth\",\n      \"1\"\n    ],\n    \"name\": \"gcr.io/cloud-builders/git\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"build\",\n      \"--tag\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"--tag\",\n      \"us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project\",\n      \"oss-fuzz/projects/test-project\"\n    ],\n    \"id\": \"build-UNIQUE_ID\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json\"\n    ],\n    \"env\": [\n      \"OSSFUZZ_REVISION=$REVISION_ID\",\n      \"FUZZING_LANGUAGE=c++\"\n    ],\n    \"id\": \"srcmap\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"run\",\n      \"--privileged\",\n      \"linuxkit/binfmt:v0.8\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"buildx\",\n      \"create\",\n      \"--name\",\n      \"buildxbuilder\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"buildx\",\n      \"use\",\n      \"buildxbuilder\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"buildx\",\n      \"build\",\n      \"--platform\",\n      \"linux/arm64\",\n      \"--progress\",\n      \"plain\",\n      \"--load\",\n      \"--tag\",\n      \"gcr.io/oss-fuzz/test-project-aarch64\",\n      \"--tag\",\n      \"us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project-aarch64\",\n      \"oss-fuzz/projects/test-project\"\n    ],\n    \"id\": \"build-UNIQUE_ID\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=afl\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/afl-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-afl-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=afl\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine afl --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-afl-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/afl-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/afl-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/afl-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-centipede-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-centipede-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/centipede-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"-e\",\n      \"SANITIZER=none\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-centipede-none-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"-e\",\n      \"SANITIZER=none\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-centipede-none-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.none\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.none\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-none-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/centipede-none-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/honggfuzz-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-honggfuzz-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-honggfuzz-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=honggfuzz\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/honggfuzz-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/honggfuzz-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/honggfuzz-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/honggfuzz-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=i386\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-i386 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-i386\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=i386\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture i386 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-i386\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-address-i386 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-address-i386/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-address-i386\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=aarch64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/arm64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=aarch64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project-aarch64\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-aarch64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-aarch64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=aarch64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/arm64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=aarch64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-aarch64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=aarch64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-aarch64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-address-aarch64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-address-aarch64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-address-aarch64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"SANITIZER=memory\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"-e\",\n      \"SANITIZER=memory\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-memory-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-memory-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"SANITIZER=memory\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"-e\",\n      \"SANITIZER=memory\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-memory-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-memory-x86_64\",\n      \"SANITIZER=memory\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.memory\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-memory-x86_64 && zip -r test-project-memory-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-memory-x86_64/test-project-memory-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.memory\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-memory-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-memory-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"-e\",\n      \"SANITIZER=undefined\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-undefined-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-undefined-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"-e\",\n      \"SANITIZER=undefined\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-undefined-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.undefined\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/libfuzzer-undefined-x86_64 && zip -r test-project-undefined-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/libfuzzer-undefined-x86_64/test-project-undefined-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.undefined\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-undefined-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/libfuzzer-undefined-x86_64\"\n    ]\n  }\n]"
  },
  {
    "path": "infra/build/functions/test_data/expected_centipede_build_steps.json",
    "content": "[\n  {\n    \"args\": [\n      \"clone\",\n      \"https://github.com/google/oss-fuzz.git\",\n      \"--depth\",\n      \"1\"\n    ],\n    \"name\": \"gcr.io/cloud-builders/git\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"build\",\n      \"--tag\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"--tag\",\n      \"us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project\",\n      \"oss-fuzz/projects/test-project\"\n    ],\n    \"id\": \"build-UNIQUE_ID\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json\"\n    ],\n    \"env\": [\n      \"OSSFUZZ_REVISION=$REVISION_ID\",\n      \"FUZZING_LANGUAGE=c++\"\n    ],\n    \"id\": \"srcmap\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-centipede-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-centipede-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.address\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-address-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/centipede-address-x86_64\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"-e\",\n      \"SANITIZER=none\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-centipede-none-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=centipede\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"-e\",\n      \"SANITIZER=none\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\\\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-centipede-none-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=centipede\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/centipede-none-x86_64\",\n      \"SANITIZER=none\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.none\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/srcmap.json\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/uploader\",\n    \"args\": [\n      \"/workspace/targets.list.none\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: text/plain\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"test-project-none-202001010000.zip\",\n      \"test_url\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"rm -r /workspace/out/centipede-none-x86_64\"\n    ]\n  }\n]"
  },
  {
    "path": "infra/build/functions/test_data/expected_coverage_build_steps.json",
    "content": "[\n  {\n    \"args\": [\n      \"clone\",\n      \"https://github.com/google/oss-fuzz.git\",\n      \"--depth\",\n      \"1\"\n    ],\n    \"name\": \"gcr.io/cloud-builders/git\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"build\",\n      \"--tag\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"--tag\",\n      \"us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project\",\n      \"oss-fuzz/projects/test-project\"\n    ],\n    \"id\": \"build-UNIQUE_ID\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/test-project\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json\"\n    ],\n    \"env\": [\n      \"OSSFUZZ_REVISION=$REVISION_ID\",\n      \"FUZZING_LANGUAGE=c++\"\n    ],\n    \"id\": \"srcmap\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-coverage-x86_64\",\n      \"SANITIZER=coverage\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-coverage-x86_64\",\n      \"-e\",\n      \"SANITIZER=coverage\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/test-project\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-coverage-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image test-project\\\\npython infra/helper.py build_fuzzers --sanitizer coverage --engine libfuzzer --architecture x86_64 test-project\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-coverage-x86_64\"\n  },\n  {\n    \"url\": \"test_download\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-coverage-x86_64\",\n      \"SANITIZER=coverage\",\n      \"HTTP_PORT=\",\n      \"COVERAGE_EXTRA_ARGS=\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"for f in /corpus/*.zip; do unzip -q $f -d ${f%.*} || (echo \\\"Failed to unpack the corpus for $(basename ${f%.*}). This usually means that corpus backup for a particular fuzz target does not exist. If a fuzz target was added in the last 24 hours, please wait one more day. Otherwise, something is wrong with the fuzz target or the infrastructure, and corpus pruning task does not finish successfully.\\\" && exit 1); done && coverage || (echo \\\"********************************************************************************\\nCode coverage report generation failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer coverage test-project\\npython infra/helper.py coverage test-project\\n********************************************************************************\\\" && false)\"\n    ],\n    \"volumes\": [\n      {\n        \"name\": \"corpus\",\n        \"path\": \"/corpus\"\n      }\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"entrypoint\": \"sh\",\n    \"args\": [\n      \"-c\",\n      \"gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/reports/20200101 || exit 0\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"args\": [\n      \"-m\",\n      \"cp\",\n      \"-r\",\n      \"/workspace/out/libfuzzer-coverage-x86_64/report\",\n      \"gs://oss-fuzz-coverage/test-project/reports/20200101\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"entrypoint\": \"sh\",\n    \"args\": [\n      \"-c\",\n      \"gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/reports-by-target/20200101 || exit 0\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"args\": [\n      \"-m\",\n      \"cp\",\n      \"-r\",\n      \"/workspace/out/libfuzzer-coverage-x86_64/report_target\",\n      \"gs://oss-fuzz-coverage/test-project/reports-by-target/20200101\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"entrypoint\": \"sh\",\n    \"args\": [\n      \"-c\",\n      \"gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/fuzzer_stats/20200101 || exit 0\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"args\": [\n      \"-m\",\n      \"cp\",\n      \"-r\",\n      \"/workspace/out/libfuzzer-coverage-x86_64/fuzzer_stats\",\n      \"gs://oss-fuzz-coverage/test-project/fuzzer_stats/20200101\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"entrypoint\": \"sh\",\n    \"args\": [\n      \"-c\",\n      \"gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/textcov_reports/20200101 || exit 0\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"args\": [\n      \"-m\",\n      \"cp\",\n      \"-r\",\n      \"/workspace/out/libfuzzer-coverage-x86_64/textcov_reports\",\n      \"gs://oss-fuzz-coverage/test-project/textcov_reports/20200101\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"entrypoint\": \"sh\",\n    \"args\": [\n      \"-c\",\n      \"gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/logs/20200101 || exit 0\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"args\": [\n      \"-m\",\n      \"cp\",\n      \"-r\",\n      \"/workspace/out/libfuzzer-coverage-x86_64/logs\",\n      \"gs://oss-fuzz-coverage/test-project/logs/20200101\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/gsutil\",\n    \"args\": [\n      \"cp\",\n      \"/workspace/srcmap.json\",\n      \"gs://oss-fuzz-coverage/test-project/srcmap/20200101.json\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/curl\",\n    \"args\": [\n      \"-H\",\n      \"Content-Type: application/json\",\n      \"-X\",\n      \"PUT\",\n      \"-d\",\n      \"{\\\"fuzzer_stats_dir\\\": \\\"gs://oss-fuzz-coverage/test-project/fuzzer_stats/20200101\\\", \\\"html_report_url\\\": \\\"https://storage.googleapis.com/oss-fuzz-coverage/test-project/reports/20200101/linux/index.html\\\", \\\"report_date\\\": \\\"20200101\\\", \\\"report_summary_path\\\": \\\"gs://oss-fuzz-coverage/test-project/reports/20200101/linux/summary.json\\\"}\",\n      \"test_url\"\n    ]\n  }\n]"
  },
  {
    "path": "infra/build/functions/test_data/expected_trial_build_steps.json",
    "content": "[\n  {\n    \"args\": [\n      \"clone\",\n      \"https://github.com/google/oss-fuzz.git\",\n      \"--depth\",\n      \"1\",\n      \"--branch\",\n      \"mybranch\"\n    ],\n    \"name\": \"gcr.io/cloud-builders/git\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-swift-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-swift-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder-swift\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-javascript-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-javascript-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder-javascript\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-jvm-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-jvm-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder-jvm\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-go-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-go-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder-go\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-python-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-python-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder-python\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-ruby-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-ruby-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder-ruby\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-builder-rust-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-builder-rust-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-builder-rust\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"pull\",\n      \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\"\n    ],\n    \"waitFor\": \"-\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"tag\",\n      \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n      \"gcr.io/oss-fuzz-base/base-runner\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"args\": [\n      \"build\",\n      \"--tag\",\n      \"gcr.io/oss-fuzz/skcms\",\n      \"--tag\",\n      \"us-central1-docker.pkg.dev/oss-fuzz/unsafe/skcms\",\n      \"oss-fuzz/projects/skcms\"\n    ],\n    \"id\": \"build-UNIQUE_ID\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz/skcms\",\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json\"\n    ],\n    \"env\": [\n      \"OSSFUZZ_REVISION=$REVISION_ID\",\n      \"FUZZING_LANGUAGE=c++\"\n    ],\n    \"id\": \"srcmap\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=afl\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/skcms\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd skcms && mkdir -p /workspace/out/afl-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-afl-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=afl\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 skcms\\\\npython infra/helper.py check_build --sanitizer address --engine afl --architecture x86_64 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-afl-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=afl\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/afl-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/skcms\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd skcms && mkdir -p /workspace/out/libfuzzer-address-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 skcms\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture x86_64 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-x86_64\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=i386\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/skcms\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd skcms && mkdir -p /workspace/out/libfuzzer-address-i386 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-address-i386\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=i386\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"-e\",\n      \"SANITIZER=address\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 skcms\\\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture i386 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-address-i386\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n    \"env\": [\n      \"ARCHITECTURE=i386\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-address-i386\",\n      \"SANITIZER=address\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.address\"\n    ]\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"-e\",\n      \"SANITIZER=undefined\",\n      \"-t\",\n      \"gcr.io/oss-fuzz/skcms\",\n      \"bash\",\n      \"-c\",\n      \"rm -r /out && cd /src && cd skcms && mkdir -p /workspace/out/libfuzzer-undefined-x86_64 && compile || (echo \\\"********************************************************************************\\\\nFailed to build.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"compile-libfuzzer-undefined-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/cloud-builders/docker\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"run\",\n      \"--platform\",\n      \"linux/amd64\",\n      \"-v\",\n      \"/workspace:/workspace\",\n      \"--privileged\",\n      \"--cap-add=all\",\n      \"-e\",\n      \"ARCHITECTURE=x86_64\",\n      \"-e\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"-e\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"-e\",\n      \"HOME=/root\",\n      \"-e\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"-e\",\n      \"SANITIZER=undefined\",\n      \"-t\",\n      \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n      \"bash\",\n      \"-c\",\n      \"test_all.py || (echo \\\"********************************************************************************\\\\nBuild checks failed.\\\\nTo reproduce, run:\\\\npython infra/helper.py build_image skcms\\\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 skcms\\\\npython infra/helper.py check_build --sanitizer undefined --engine libfuzzer --architecture x86_64 skcms\\\\n********************************************************************************\\\" && false)\"\n    ],\n    \"id\": \"build-check-libfuzzer-undefined-x86_64\"\n  },\n  {\n    \"name\": \"gcr.io/oss-fuzz-base/base-runner-testing-legacy-mybranch\",\n    \"env\": [\n      \"ARCHITECTURE=x86_64\",\n      \"FUZZING_ENGINE=libfuzzer\",\n      \"FUZZING_LANGUAGE=c++\",\n      \"HOME=/root\",\n      \"OUT=/workspace/out/libfuzzer-undefined-x86_64\",\n      \"SANITIZER=undefined\"\n    ],\n    \"args\": [\n      \"bash\",\n      \"-c\",\n      \"targets_list > /workspace/targets.list.undefined\"\n    ]\n  }\n]"
  },
  {
    "path": "infra/build/functions/test_utils.py",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Utility functions for testing cloud functions.\"\"\"\nimport datetime\nimport os\nimport subprocess\nimport threading\n\nimport requests\n\nDATASTORE_READY_INDICATOR = b'is now running'\nDATASTORE_EMULATOR_PORT = 8432\nEMULATOR_TIMEOUT = 30\n\nFUNCTIONS_DIR = os.path.dirname(__file__)\nOSS_FUZZ_DIR = os.path.dirname(os.path.dirname(os.path.dirname(FUNCTIONS_DIR)))\nPROJECTS_DIR = os.path.join(OSS_FUZZ_DIR, 'projects')\n\nFAKE_DATETIME = datetime.datetime(2020, 1, 1, 0, 0, 0)\nPROJECT = 'test-project'\nPROJECT_DIR = os.path.join(PROJECTS_DIR, PROJECT)\n\n\ndef create_project_data(project,\n                        project_yaml_contents,\n                        dockerfile_contents='test line'):\n  \"\"\"Creates a project.yaml with |project_yaml_contents| and a Dockerfile with\n  |dockerfile_contents| for |project|.\"\"\"\n  project_dir = os.path.join(PROJECTS_DIR, project)\n  project_yaml_path = os.path.join(project_dir, 'project.yaml')\n  with open(project_yaml_path, 'w') as project_yaml_handle:\n    project_yaml_handle.write(project_yaml_contents)\n\n  dockerfile_path = os.path.join(project_dir, 'Dockerfile')\n  with open(dockerfile_path, 'w') as dockerfile_handle:\n    dockerfile_handle.write(dockerfile_contents)\n\n\ndef start_datastore_emulator():\n  \"\"\"Start Datastore emulator.\"\"\"\n  return subprocess.Popen([\n      'gcloud',\n      'beta',\n      'emulators',\n      'datastore',\n      'start',\n      '--consistency=1.0',\n      '--host-port=localhost:' + str(DATASTORE_EMULATOR_PORT),\n      '--project=' + PROJECT,\n      '--no-store-on-disk',\n  ],\n                          stdout=subprocess.PIPE,\n                          stderr=subprocess.STDOUT)\n\n\ndef wait_for_emulator_ready(proc,\n                            emulator,\n                            indicator,\n                            timeout=EMULATOR_TIMEOUT):\n  \"\"\"Wait for emulator to be ready.\"\"\"\n\n  emulator_output = []\n\n  def _read_thread(proc, ready_event):\n    \"\"\"Thread to continuously read from the process stdout.\"\"\"\n    ready = False\n    while True:\n      line = proc.stdout.readline()\n      if not line:\n        break\n      emulator_output.append(line.decode())\n      if not ready and indicator in line:\n        ready = True\n        ready_event.set()\n\n  # Wait for process to become ready.\n  ready_event = threading.Event()\n  thread = threading.Thread(target=_read_thread, args=(proc, ready_event))\n  thread.daemon = True\n  thread.start()\n  if not ready_event.wait(timeout):\n    raise RuntimeError(f'{emulator} emulator did not get ready in time:\\n' +\n                       '\\n'.join(emulator_output))\n  return thread\n\n\ndef reset_ds_emulator():\n  \"\"\"Reset ds emulator/clean all entities.\"\"\"\n  req = requests.post(f'http://localhost:{DATASTORE_EMULATOR_PORT}/reset')\n  req.raise_for_status()\n\n\ndef cleanup_emulator(ds_emulator):\n  \"\"\"Cleanup the system processes made by ds emulator.\"\"\"\n  del ds_emulator  #To do, find a better way to cleanup emulator\n  os.system('pkill -f datastore')\n\n\ndef set_gcp_environment():\n  \"\"\"Set environment variables for simulating in google cloud platform.\"\"\"\n  os.environ['DATASTORE_EMULATOR_HOST'] = 'localhost:' + str(\n      DATASTORE_EMULATOR_PORT)\n  os.environ['GOOGLE_CLOUD_PROJECT'] = PROJECT\n  os.environ['DATASTORE_DATASET'] = PROJECT\n  os.environ['GCP_PROJECT'] = PROJECT\n  os.environ['FUNCTION_REGION'] = 'us-central1'\n\n\ndef get_test_data_file_path(filename):\n  \"\"\"Returns the path to a test data file with name |filename|.\"\"\"\n  return os.path.join(os.path.dirname(__file__), 'test_data', filename)\n"
  },
  {
    "path": "infra/build/functions/trial_build/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/cloud-builders/gcloud\n\nRUN apt-get update && apt-get install python3-pip -y\nCOPY . /opt/oss-fuzz\nRUN pip install -r /opt/oss-fuzz/infra/build/functions/requirements.txt\n\nWORKDIR /opt/oss-fuzz/infra/build/functions/\n\nENTRYPOINT [\"python3\", \"/opt/oss-fuzz/infra/build/functions/gcb.py\"]\n"
  },
  {
    "path": "infra/build/functions/trial_build/cloudbuild.yaml",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsteps:\n- id: 'Build the trial-build image'\n  name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/trial-build\n  - '-f'\n  - infra/build/functions/trial_build/Dockerfile\n  - .\n- id: 'Legacy'\n  name: 'gcr.io/oss-fuzz-base/trial-build'\n  args: ['--version-tag', 'legacy']\n  waitFor: ['Build the trial-build image']\n  allowFailure: true\n  env:\n    - 'PULL_REQUEST_NUMBER=${_PR_NUMBER}'\n    - 'BRANCH=${_HEAD_BRANCH}'\n    - 'REPO=${_HEAD_REPO_URL}'\n    - 'TIMEOUT=25200'\n  timeout: 25200s\n- id: 'Ubuntu 20.04'\n  name: 'gcr.io/oss-fuzz-base/trial-build'\n  args: ['--version-tag', 'ubuntu-20-04']\n  waitFor: ['Build the trial-build image']\n  allowFailure: true\n  env:\n    - 'PULL_REQUEST_NUMBER=${_PR_NUMBER}'\n    - 'BRANCH=${_HEAD_BRANCH}'\n    - 'REPO=${_HEAD_REPO_URL}'\n    - 'TIMEOUT=25200'\n  timeout: 25200s\n- id: 'Ubuntu 24.04'\n  name: 'gcr.io/oss-fuzz-base/trial-build'\n  args: ['--version-tag', 'ubuntu-24-04']\n  waitFor: ['Build the trial-build image']\n  allowFailure: true\n  env:\n    - 'PULL_REQUEST_NUMBER=${_PR_NUMBER}'\n    - 'BRANCH=${_HEAD_BRANCH}'\n    - 'REPO=${_HEAD_REPO_URL}'\n    - 'TIMEOUT=25200'\n  timeout: 25200s\n- id: 'Generate Report'\n  name: 'gcr.io/oss-fuzz-base/trial-build'\n  entrypoint: 'python3'\n  args: ['infra/build/functions/report_generator.py']\n  waitFor: ['Legacy', 'Ubuntu 20.04', 'Ubuntu 24.04']\nlogsBucket: gs://oss-fuzz-trialbuild-logs\ntimeout: 25200s\n"
  },
  {
    "path": "infra/build/functions/trial_build.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tool for testing changes to base-images in OSS-Fuzz. This script builds test\nversions of all base images and the builds projects using those test images.\"\"\"\nimport argparse\nimport collections\nimport datetime\nimport functools\nimport json\nimport random\nimport logging\nimport os\nimport subprocess\nimport sys\nimport textwrap\nimport time\nimport urllib.request\nimport urllib.error\nimport yaml\nimport oauth2client.client\nfrom googleapiclient.discovery import build as cloud_build\nfrom googleapiclient.errors import HttpError\n\nimport build_and_push_test_images\nimport build_and_run_coverage\nimport build_lib\nimport build_project\n\n# Default timeout for the entire script in seconds, 7 hours.\nSCRIPT_DEFAULT_TIMEOUT = 25200\n\n# Default timeout for a single project build in seconds, 4 hours.\nPROJECT_BUILD_TIMEOUT = 14400\n\nTEST_IMAGE_SUFFIX = 'testing'\n\n# Warning time in minutes before build times out.\nBUILD_TIMEOUT_WARNING_MINUTES = 15\nFINISHED_BUILD_STATUSES = ('SUCCESS', 'FAILURE', 'TIMEOUT', 'CANCELLED',\n                           'EXPIRED')\n\nBuildType = collections.namedtuple(\n    'BuildType', ['type_name', 'get_build_steps_func', 'status_filename'])\n\nBUILD_TYPES = {\n    'coverage':\n        BuildType('coverage', build_and_run_coverage.get_build_steps,\n                  'status-coverage.json'),\n    'introspector':\n        BuildType('introspector',\n                  build_and_run_coverage.get_fuzz_introspector_steps,\n                  'status-introspector.json'),\n    'indexer':\n        BuildType('indexer', build_project.get_indexer_build_steps,\n                  'status.json'),\n    'fuzzing':\n        BuildType('fuzzing', build_project.get_build_steps, 'status.json'),\n}\n\n\ndef _get_production_build_statuses(build_type):\n  \"\"\"Gets the statuses for |build_type| that is reported by build-status.\n  Returns a dictionary mapping projects to bools indicating whether the last\n  build of |build_type| succeeded.\"\"\"\n  try:\n    request = urllib.request.urlopen(\n        'https://oss-fuzz-build-logs.storage.googleapis.com/'\n        f'{build_type.status_filename}')\n    project_statuses = json.load(request)['projects']\n  except urllib.error.URLError:\n    # It is not a critical error if the status file cannot be found.\n    # This is expected for indexer.\n    return {}\n\n  results = {}\n  for project in project_statuses:\n    name = project['name']\n    history = project['history']\n    if not history:\n      continue\n    success = history[0]['success']\n    results[name] = bool(success)\n  return results\n\n\n@functools.lru_cache\ndef get_all_projects():\n  \"\"\"Returns a list of all OSS-Fuzz projects.\"\"\"\n  projects_dir = os.path.join(build_and_push_test_images.OSS_FUZZ_ROOT,\n                              'projects')\n  return sorted([\n      project for project in os.listdir(projects_dir)\n      if os.path.isdir(os.path.join(projects_dir, project))\n  ])\n\n\n@functools.lru_cache\ndef get_project_languages():\n  \"\"\"Returns a dictionary mapping languages to projects.\"\"\"\n  all_projects = get_all_projects()\n  project_languages = collections.defaultdict(list)\n  for project in all_projects:\n    project_yaml_path = os.path.join(build_and_push_test_images.OSS_FUZZ_ROOT,\n                                     'projects', project, 'project.yaml')\n    if not os.path.exists(project_yaml_path):\n      continue\n    with open(project_yaml_path, 'r', encoding='utf-8') as file_handle:\n      project_yaml = yaml.safe_load(file_handle)\n    language = project_yaml.get('language', 'c++')\n    project_languages[language].append(project)\n  return project_languages\n\n\ndef handle_special_projects(args):\n  \"\"\"Handles \"special\" projects that are not actually projects such as \"all\" or\n  \"c++\".\"\"\"\n  all_projects = get_all_projects()\n  if 'all' in args.projects:\n    args.projects = all_projects\n    return\n  project_languages = get_project_languages()\n  for project in args.projects[:]:\n    if project in project_languages:\n      language = project\n      args.projects.remove(language)\n      args.projects.extend(project_languages[language])\n\n\ndef get_args(args=None):\n  \"\"\"Parses command line arguments.\"\"\"\n  parser = argparse.ArgumentParser(sys.argv[0], description='Test projects')\n  parser.add_argument('projects',\n                      help='Projects. \"all\" for all projects',\n                      nargs='+')\n  parser.add_argument('--sanitizers',\n                      required=False,\n                      default=[\n                          'address', 'memory', 'undefined', 'coverage',\n                          'introspector', 'indexer'\n                      ],\n                      nargs='+',\n                      help='Sanitizers.')\n  parser.add_argument('--fuzzing-engines',\n                      required=False,\n                      default=['afl', 'libfuzzer', 'honggfuzz', 'centipede'],\n                      nargs='+',\n                      help='Fuzzing engines.')\n  parser.add_argument('--repo',\n                      required=False,\n                      default=build_project.DEFAULT_OSS_FUZZ_REPO,\n                      help='Use specified OSS-Fuzz repo.')\n  parser.add_argument('--branch',\n                      required=False,\n                      default=None,\n                      help='Use specified OSS-Fuzz branch.')\n  parser.add_argument('--force-build',\n                      action='store_true',\n                      help='Build projects that failed to build on OSS-Fuzz\\'s '\n                      'production builder.')\n  parser.add_argument('--version-tag',\n                      required=False,\n                      default=None,\n                      help='Version tag to use for base images.')\n  parser.add_argument('--skip-build-images',\n                      action='store_true',\n                      help='Skip the base image build phase.')\n  parsed_args = parser.parse_args(args)\n  handle_special_projects(parsed_args)\n  return parsed_args\n\n\ndef handle_phase1_failure(version_tag):\n  \"\"\"Handles the case where phase 1 (image build) fails.\"\"\"\n  all_projects = get_all_projects()\n  results = {\n      'total': len(all_projects),\n      'successful': 0,\n      'failed': len(all_projects),\n      'skipped': 0,\n      'failed_projects': all_projects,\n  }\n  if version_tag:\n    with open(f'{version_tag}-results.json', 'w') as f:\n      json.dump(results, f)\n  logging.error(\n      'Failed to build and push images. All projects for this version will be '\n      'marked as failed.')\n  return False\n\n\ndef get_projects_to_build(specified_projects, build_type, force_build):\n  \"\"\"Returns the list of projects that should be built.\"\"\"\n  buildable_projects = []\n  project_statuses = _get_production_build_statuses(build_type)\n  for project in specified_projects:\n    if (project not in project_statuses or project_statuses[project] or\n        force_build):\n      buildable_projects.append(project)\n  return buildable_projects\n\n\ndef trial_build_main(args=None, local_base_build=True):\n  \"\"\"Main function for trial_build.\"\"\"\n  args = get_args(args)\n\n  if not args.skip_build_images:\n    logging.info('Starting \"Build and Push Images\" phase...')\n\n    versions_to_build = ([args.version_tag] if args.version_tag else\n                         build_and_push_test_images.BASE_IMAGE_VERSIONS)\n\n    for version in versions_to_build:\n      logging.info(\n          '================================================================')\n      logging.info('      BUILDING BASE IMAGES FOR VERSION: %s',\n                   version.upper())\n      logging.info(\n          '================================================================')\n      version_test_image_tag = f'{TEST_IMAGE_SUFFIX}-{version}'\n      if args.branch:\n        version_test_image_tag = (\n            f'{version_test_image_tag}-{args.branch.lower().replace(\"/\", \"-\")}')\n\n      if local_base_build:\n        build_and_push_test_images.build_and_push_images(\n            version_test_image_tag, version)\n      else:\n        if not build_and_push_test_images.gcb_build_and_push_images(\n            version_test_image_tag, version_tag=version):\n          return handle_phase1_failure(version)\n\n    logging.info('\"Build and Push Images\" phase completed.')\n  else:\n    logging.info(\n        '================================================================')\n    logging.info('                   PHASE 1: SKIPPED')\n    logging.info(\n        '================================================================')\n    logging.info('Skipping \"Build and Push Images\" phase as requested.')\n\n  timeout = int(os.environ.get('TIMEOUT', SCRIPT_DEFAULT_TIMEOUT))\n  end_time = datetime.datetime.now() + datetime.timedelta(seconds=timeout)\n\n  if local_base_build and not args.version_tag:\n    versions_to_build = build_and_push_test_images.BASE_IMAGE_VERSIONS\n    if not versions_to_build:\n      return False\n\n    overall_result = True\n    for version in versions_to_build:\n      logging.info(\n          '================================================================')\n      logging.info('      RUNNING TEST BUILDS FOR VERSION: %s', version.upper())\n      logging.info(\n          '================================================================')\n      test_image_tag = f'{TEST_IMAGE_SUFFIX}-{version}'\n      if args.branch:\n        test_image_tag = (\n            f'{test_image_tag}-{args.branch.lower().replace(\"/\", \"-\")}')\n\n      result = _do_test_builds(args, test_image_tag, end_time, version)\n      overall_result = overall_result and result\n    return overall_result\n\n  # GCB or local single-version case\n  test_image_tag = TEST_IMAGE_SUFFIX\n  if args.version_tag:\n    test_image_tag = f'{test_image_tag}-{args.version_tag}'\n  if args.branch:\n    test_image_tag = f'{test_image_tag}-{args.branch.lower().replace(\"/\", \"-\")}'\n  return _do_test_builds(args, test_image_tag, end_time, args.version_tag)\n\n\ndef _do_test_builds(args, test_image_suffix, end_time, version_tag):\n  \"\"\"Does test coverage and fuzzing builds.\"\"\"\n  build_types = []\n  sanitizers = list(args.sanitizers)\n  if 'coverage' in sanitizers:\n    sanitizers.pop(sanitizers.index('coverage'))\n    build_types.append(BUILD_TYPES['coverage'])\n  if 'introspector' in sanitizers:\n    sanitizers.pop(sanitizers.index('introspector'))\n    build_types.append(BUILD_TYPES['introspector'])\n  if 'indexer' in sanitizers:\n    sanitizers.pop(sanitizers.index('indexer'))\n    build_types.append(BUILD_TYPES['indexer'])\n  if sanitizers:\n    build_types.append(BUILD_TYPES['fuzzing'])\n\n  build_ids = collections.defaultdict(list)\n  skipped_projects = collections.defaultdict(list)\n  failed_to_start_builds = []\n  credentials = oauth2client.client.GoogleCredentials.get_application_default()\n\n  logging.info(\n      '================================================================')\n  logging.info('            PHASE 2: STARTING TEST BUILDS')\n  logging.info(\n      '================================================================')\n\n  for build_type in build_types:\n    specified_projects = list(args.projects)\n    projects_to_build = get_projects_to_build(specified_projects, build_type,\n                                              args.force_build)\n    if not args.force_build:\n      unselected_projects = set(specified_projects) - set(projects_to_build)\n      for project in unselected_projects:\n        skipped_projects[build_type.type_name].append(\n            (project, 'Production build failed'))\n\n      logging.info('Build type: %s', build_type.type_name)\n      logging.info(\n          '  - Selected projects: %d / %d (due to successful production builds)',\n          len(projects_to_build), len(args.projects))\n      logging.info('  - To build all projects, use the --force-build flag.')\n    else:\n      logging.info('Build type: %s', build_type.type_name)\n      logging.info('  - Building all %d projects (--force-build)',\n                   len(projects_to_build))\n\n    logging.info('Starting to create and trigger builds for build type: %s',\n                 build_type.type_name)\n\n    config = build_project.Config(testing=True,\n                                  test_image_suffix=test_image_suffix,\n                                  base_image_tag=version_tag,\n                                  repo=args.repo,\n                                  branch=args.branch,\n                                  parallel=False,\n                                  upload=False,\n                                  build_type=build_type.type_name)\n    project_builds, new_skipped, new_failed_to_start = _do_build_type_builds(\n        args, config, credentials, build_type, projects_to_build)\n    for project, reason in new_skipped:\n      skipped_projects[build_type.type_name].append((project, reason))\n    failed_to_start_builds.extend(new_failed_to_start)\n    for project, project_build_id in project_builds.items():\n      build_ids[project].append((project_build_id, build_type.type_name))\n\n  logging.info('Triggered all builds.')\n  if skipped_projects:\n    logging.info(\n        '================================================================')\n    logging.info('               PHASE 2: SKIPPED BUILDS')\n    logging.info(\n        '================================================================')\n    total_skipped_builds = sum(\n        len(skips) for skips in skipped_projects.values())\n    logging.info('Total skipped builds: %d', total_skipped_builds)\n    logging.info('--- SKIPPED BUILDS ---')\n    for build_type_name, skips in sorted(skipped_projects.items()):\n      logging.info('  - %s:', build_type_name)\n      for project, reason in sorted(skips):\n        logging.info('    - %s: %s', project, reason)\n    logging.info('-----------------------')\n\n  logging.info(\n      '================================================================')\n  logging.info('               PHASE 2: STARTED BUILDS')\n  logging.info(\n      '================================================================')\n  logging.info('Total projects with builds: %d', len(build_ids))\n  logging.info('--- STARTED BUILDS ---')\n  for project, project_builds in sorted(build_ids.items()):\n    logging.info('  - %s:', project)\n    for build_id, build_type in project_builds:\n      logging.info('    - Build Type: %s', build_type)\n      for line in build_lib.get_build_info_lines(build_id,\n                                                 build_lib.IMAGE_PROJECT):\n        logging.info('      %s', line)\n  logging.info('-----------------------')\n\n  wait_result = wait_on_builds(args, build_ids, credentials,\n                               build_lib.IMAGE_PROJECT, end_time,\n                               skipped_projects, version_tag)\n\n  if failed_to_start_builds:\n    logging.error(\n        '================================================================')\n    logging.error('           PHASE 2: FAILED TO START BUILDS')\n    logging.error(\n        '================================================================')\n    logging.error('Total projects that failed to start: %d',\n                  len(failed_to_start_builds))\n    for project, reason in sorted(failed_to_start_builds):\n      logging.error('  - %s: %s', project, reason)\n\n  return wait_result and not failed_to_start_builds\n\n\ndef _do_build_type_builds(args, config, credentials, build_type, projects):\n  \"\"\"Does |build_type| test builds of |projects|.\"\"\"\n  build_ids = {}\n  skipped_projects = []\n  failed_to_start_builds = []\n  for project_name in projects:\n    try:\n      project_yaml, dockerfile_contents = (\n          build_project.get_project_data(project_name))\n    except FileNotFoundError:\n      skipped_projects.append((project_name, 'Missing Dockerfile'))\n      continue\n\n    build_project.set_yaml_defaults(project_yaml)\n    if project_yaml['disabled']:\n      skipped_projects.append((project_name, 'Disabled'))\n      continue\n\n    project_yaml_sanitizers = build_project.get_sanitizer_strings(\n        project_yaml['sanitizers']) + ['coverage', 'introspector', 'indexer']\n    project_yaml['sanitizers'] = list(\n        set(project_yaml_sanitizers).intersection(set(args.sanitizers)))\n\n    project_yaml['fuzzing_engines'] = list(\n        set(project_yaml['fuzzing_engines']).intersection(\n            set(args.fuzzing_engines)))\n\n    if not project_yaml['sanitizers'] or not project_yaml['fuzzing_engines']:\n      skipped_projects.append(\n          (project_name, 'No compatible sanitizers or engines'))\n      continue\n\n    # Check if project's base_os_version matches the current build version.\n    project_base_os = project_yaml.get('base_os_version', 'legacy')\n    current_build_version = config.base_image_tag or 'legacy'\n\n    if project_base_os != current_build_version:\n      skipped_projects.append(\n          (project_name, f'Project requires {project_base_os}, but '\n           f'build version is {current_build_version}'))\n      continue\n\n    steps, reason = build_type.get_build_steps_func(project_name, project_yaml,\n                                                    dockerfile_contents, config)\n    if reason:\n      skipped_projects.append((project_name, reason))\n      continue\n\n    try:\n      tags = ['trial-build']\n      if args.branch:\n        tags.append(f'branch-{args.branch.replace(\"/\", \"-\")}')\n      build_ids[project_name] = (build_project.run_build(\n          project_name,\n          steps,\n          credentials,\n          build_type.type_name,\n          extra_tags=tags,\n          timeout=PROJECT_BUILD_TIMEOUT))['id']\n      time.sleep(1)  # Avoid going over 75 requests per second limit.\n    except Exception as error:  # pylint: disable=broad-except\n      # Handle flake.\n      logging.error('Failed to start build %s: %s', project_name, error)\n      failed_to_start_builds.append((project_name, error))\n\n  return build_ids, skipped_projects, failed_to_start_builds\n\n\ndef _print_summary_box(title, lines):\n  \"\"\"Prints a formatted box for summarizing build results.\"\"\"\n  box_width = 80\n  title_line = f'| {title.center(box_width - 4)} |'\n  separator = '+' + '-' * (box_width - 2) + '+'\n  summary_lines = [\n      '+' + '-' * (box_width - 2) + '+',\n      title_line,\n      '+' + '-' * (box_width - 2) + '+',\n  ]\n  for line in lines:\n    wrapped_lines = textwrap.wrap(line, box_width - 6)\n    for i, sub_line in enumerate(wrapped_lines):\n      summary_lines.append(f'|  {sub_line.ljust(box_width - 6)}  |')\n  summary_lines.append('+' + '-' * (box_width - 2) + '+')\n  print('\\n'.join(summary_lines))\n\n\ndef get_build_status_from_gcb(cloudbuild_api, cloud_project, build_id):\n  \"\"\"Returns the status of the build: |build_id| from cloudbuild_api.\"\"\"\n  build_result = cloudbuild_api.get(projectId=cloud_project,\n                                    id=build_id).execute()\n  return build_result['status']\n\n\ndef check_finished(build_id, cloudbuild_api, cloud_project, retries_map):\n  \"\"\"Checks that the build is complete. Returns status if complete, else None\"\"\"\n  try:\n    build_status = get_build_status_from_gcb(cloudbuild_api, cloud_project,\n                                             build_id)\n  except HttpError:\n    logging.debug('build: HttpError when getting build status from gcb')\n    retries_map[build_id] = retries_map.get(build_id, 0) + 1\n    return None\n  if build_status not in FINISHED_BUILD_STATUSES:\n    logging.debug('build: %d not finished.', build_id)\n    return None\n  return build_status\n\n\ndef wait_on_builds(args, build_ids, credentials, cloud_project, end_time,\n                   skipped_projects, version_tag):  # pylint: disable=too-many-locals\n  \"\"\"Waits on |builds|. Returns True if all builds succeed.\"\"\"\n  cloudbuild = cloud_build('cloudbuild',\n                           'v1',\n                           credentials=credentials,\n                           cache_discovery=False,\n                           client_options=build_lib.REGIONAL_CLIENT_OPTIONS)\n  cloudbuild_api = cloudbuild.projects().builds()  # pylylint: disable=no-member\n\n  wait_builds = build_ids.copy()\n  failed_builds = collections.defaultdict(list)\n  successful_builds = collections.defaultdict(list)\n  finished_builds_count = 0\n  retries_map = {}\n  next_retry_time = {}\n  MAX_RETRIES = 5\n  BASE_BACKOFF_SECONDS = 2\n\n  builds_count = sum(len(v) for v in build_ids.values())\n  projects_count = len(build_ids)\n  logging.info('Waiting for %d builds from %d projects to complete...',\n               builds_count, projects_count)\n\n  timeout_warning_time = end_time - datetime.timedelta(\n      minutes=BUILD_TIMEOUT_WARNING_MINUTES)\n  notified_timeout = False\n\n  while wait_builds:\n    current_time = datetime.datetime.now()\n    if current_time >= end_time:\n      logging.error(\n          'Coordinator timeout reached. Marking remaining builds as TIMEOUT.')\n      break\n\n    if not notified_timeout and current_time >= timeout_warning_time:\n      notified_timeout = True\n      logging.warning(\n          'Nearing timeout: %d minutes remaining. Remaining builds: %d',\n          BUILD_TIMEOUT_WARNING_MINUTES, len(wait_builds))\n\n    processed_a_build_in_iteration = False\n    for project, project_builds in list(wait_builds.items()):\n      for build_id, build_type in project_builds[:]:\n        if (build_id in next_retry_time and\n            datetime.datetime.now() < next_retry_time[build_id]):\n          continue  # In backoff period, skip for now.\n\n        processed_a_build_in_iteration = True\n        status = check_finished(build_id, cloudbuild_api, cloud_project,\n                                retries_map)\n\n        if status:\n          # API call was successful, remove from backoff map if it exists.\n          if build_id in next_retry_time:\n            del next_retry_time[build_id]\n\n          finished_builds_count += 1\n          if status == 'SUCCESS':\n            successful_builds[project].append(build_id)\n          else:\n            gcb_url = build_lib.get_gcb_url(build_id, cloud_project)\n            log_url = build_lib.get_logs_url(build_id)\n            failed_builds[project].append(\n                (status, gcb_url, build_type, log_url))\n\n          wait_builds[project].remove((build_id, build_type))\n          if not wait_builds[project]:\n            del wait_builds[project]\n\n        elif retries_map.get(build_id, 0) >= MAX_RETRIES:\n          # Max retries reached, mark as failed.\n          logging.error('HttpError for build %s. Max retries reached.',\n                        build_id)\n          if build_id in next_retry_time:\n            del next_retry_time[build_id]\n\n          finished_builds_count += 1\n          status = 'UNKNOWN (too many HttpErrors)'\n          gcb_url = build_lib.get_gcb_url(build_id, cloud_project)\n          log_url = build_lib.get_logs_url(build_id)\n          failed_builds[project].append((status, gcb_url, build_type, log_url))\n          wait_builds[project].remove((build_id, build_type))\n          if not wait_builds[project]:\n            del wait_builds[project]\n        else:\n          # API call failed, calculate and set next retry time.\n          retry_count = retries_map.get(build_id, 0)\n          backoff_time = (BASE_BACKOFF_SECONDS * (2**retry_count) +\n                          random.uniform(0, 1))\n          next_retry_time[build_id] = (datetime.datetime.now() +\n                                       datetime.timedelta(seconds=backoff_time))\n\n    if not processed_a_build_in_iteration and wait_builds:\n      # All remaining builds are in backoff, sleep to prevent busy-waiting.\n      time.sleep(1)\n    else:\n      # General rate limiting after one full pass.\n      time.sleep(0.5)\n\n  # Handle builds that were still running when the coordinator timed out.\n  if wait_builds:\n    for project, project_builds in list(wait_builds.items()):\n      for build_id, build_type in project_builds:\n        gcb_url = build_lib.get_gcb_url(build_id, cloud_project)\n        log_url = build_lib.get_logs_url(build_id)\n        failed_builds[project].append(\n            ('TIMEOUT (Coordinator)', gcb_url, build_type, log_url))\n\n  # Final Report\n  successful_builds_count = sum(\n      len(builds) for builds in successful_builds.values())\n  failed_builds_count = sum(len(builds) for builds in failed_builds.values())\n  skipped_builds_count = sum(len(skips) for skips in skipped_projects.values())\n\n  # Note: To get all unique project names, we create a set from the keys of\n  # successful_builds, failed_builds, and the project names in skipped_projects.\n  all_projects_in_build = set(successful_builds.keys()) | set(\n      failed_builds.keys()) | set(\n          p for sl in skipped_projects.values() for p, r in sl)\n  total_projects = len(all_projects_in_build)\n\n  results = {\n      'total_projects_analyzed':\n          total_projects,\n      'successful_builds':\n          successful_builds_count,\n      'failed_builds':\n          failed_builds_count,\n      'skipped_builds':\n          skipped_builds_count,\n      'failed_projects':\n          sorted(list(failed_builds.keys())),\n      'skipped_projects':\n          sorted(list(set(p for sl in skipped_projects.values() for p, r in sl))\n                ),\n      'all_projects':\n          sorted(list(all_projects_in_build)),\n  }\n  with open(f'{version_tag}-results.json', 'w') as f:\n    json.dump(results, f)\n\n  summary_title = f'BUILD REPORT: {version_tag.upper()}'\n  summary_lines = [\n      f\"Total projects analyzed: {total_projects}\",\n      f\"[PASSED]  Successful builds: {successful_builds_count}\",\n      f\"[FAILED]  Failed builds: {failed_builds_count}\",\n      f\"[SKIPPED] Skipped builds: {skipped_builds_count}\",\n  ]\n  _print_summary_box(summary_title, summary_lines)\n\n  if failed_builds:\n    logging.error('--- FAILED BUILDS ---')\n    for project, failures in sorted(failed_builds.items()):\n      logging.error('  - %s:', project)\n      for status, gcb_url, build_type, log_url in failures:\n        build_id = gcb_url.split('/')[-1].split('?')[0]\n        logging.error('    - Build Type: %s', build_type)\n        logging.error('    - Status: %s', status)\n        for line in build_lib.get_build_info_lines(build_id, cloud_project):\n          logging.error('    - %s', line)\n    logging.info('-----------------------')\n    return False\n\n  if not finished_builds_count and not skipped_builds_count:\n    logging.warning('No builds were run.')\n    if args.skip_build_images:\n      return True\n    return False\n\n  logging.info('\\nAll builds passed successfully!')\n  logging.info('------------------------')\n  return True\n\n\nif __name__ == '__main__':\n  sys.exit(trial_build_main())\n"
  },
  {
    "path": "infra/build/functions/trial_build_test.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests for trial_build.py.\"\"\"\nimport json\nimport unittest\nfrom unittest import mock\n\nimport test_utils\nimport trial_build\n\n\nclass GetProjectsToBuild(unittest.TestCase):\n  \"\"\"Tests for get_projects_to_build.\"\"\"\n\n  PROJECTS = ['myproject', 'myfailingproject']\n\n  @mock.patch('trial_build._get_production_build_statuses',\n              return_value={\n                  'myproject': True,\n                  'myfailingproject': False\n              })\n  def test_force_build(self, mock_get_production_build_statuses):\n    \"\"\"Tests force build works.\"\"\"\n    del mock_get_production_build_statuses\n    buildable_projects = trial_build.get_projects_to_build(\n        self.PROJECTS, 'fuzzing', True)\n    self.assertEqual(self.PROJECTS, buildable_projects)\n\n  @mock.patch('trial_build._get_production_build_statuses',\n              return_value={\n                  'myproject': True,\n                  'myfailingproject': False\n              })\n  def test_get_projects_to_build(self, mock_get_production_build_statuses):\n    \"\"\"Tests get_projects_to_build works.\"\"\"\n    del mock_get_production_build_statuses\n    buildable_projects = trial_build.get_projects_to_build(\n        self.PROJECTS, 'fuzzing', True)\n    self.assertEqual(self.PROJECTS, buildable_projects)\n\n\nclass TrialBuildMainTest(unittest.TestCase):\n  \"\"\"Tests for trial_build_main.\"\"\"\n\n  @mock.patch('build_lib.get_unique_build_step_image_id',\n              return_value='UNIQUE_ID')\n  @mock.patch('trial_build.wait_on_builds', return_value=True)\n  @mock.patch('oauth2client.client.GoogleCredentials.get_application_default',\n              return_value=None)\n  @mock.patch('build_project.run_build')\n  @mock.patch('build_and_push_test_images.build_and_push_images')\n  def test_build_steps_correct(self, mock_gcb_build_and_push_images,\n                               mock_run_build, mock_get_application_default,\n                               mock_wait_on_builds,\n                               mock_get_unique_build_step_image_id):\n    \"\"\"Tests that the correct build steps for building a project are passed to\n    GCB.\"\"\"\n    del mock_gcb_build_and_push_images\n    del mock_get_application_default\n    del mock_wait_on_builds\n    self.maxDiff = None  # pylint: disable=invalid-name\n    build_id = 1\n    mock_run_build.return_value = {'id': build_id}\n    branch_name = 'mybranch'\n    project = 'skcms'\n    args = [\n        '--sanitizers', 'address', 'undefined', '--fuzzing-engines', 'afl',\n        'libfuzzer', '--branch', branch_name, '--force-build', project\n    ]\n    self.assertTrue(trial_build.trial_build_main(args))\n    expected_build_steps_path = test_utils.get_test_data_file_path(\n        'expected_trial_build_steps.json')\n    with open(expected_build_steps_path, 'r') as file_handle:\n      expected_build_steps = json.load(file_handle)\n\n    # Snippet for updating this:\n    # f=open('/tmp/a', 'w')\n    # json.dump(mock_run_build.call_args_list[0][0][1], f); f.close()\n    self.assertEqual(mock_run_build.call_args_list[0][0][1],\n                     expected_build_steps)\n\n\nif __name__ == '__main__':\n  unittest.main(exit=False)\n"
  },
  {
    "path": "infra/build/fuzz-introspector-webapp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM python:3.11-bullseye\n\n# Allow statements and log messages to immediately appear in the Knative logs\nENV PYTHONUNBUFFERED True\n\nRUN git clone --depth=1 https://github.com/ossf/fuzz-introspector /fuzz-introspector\n\n# Copy local code to the container image.\nENV APP_HOME /fuzz-introspector/tools/web-fuzzing-introspection/app/\nWORKDIR $APP_HOME\n\n# Install production dependencies.\nRUN pip install --no-cache-dir -r $APP_HOME/../requirements.txt\n\n# Create the database the webapp will be using\nRUN cd $APP_HOME/static/assets/db/ && \\\n    python ./web_db_creator_from_summary.py \\\n      --since-date=20-04-2023 \\\n      --output-dir=$PWD \\\n      --input-dir=$PWD\n\nENV WEBAPP_PORT 8080\nENV G_ANALYTICS_TAG \"G-VDH9DCD8T8\"\n\nRUN pip install gunicorn==20.1.0\n\n# Run the web service on container startup. Here we use the gunicorn\n# webserver, with one worker process and 8 threads.\n# For environments with multiple CPU cores, increase the number of workers\n# to be equal to the cores available.\n# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.\nCMD exec gunicorn --bind :${WEBAPP_PORT} --workers 1 --threads 8 --timeout 0 'main:create_app()'\n"
  },
  {
    "path": "infra/build/fuzz-introspector-webapp/cloudbuild.yaml",
    "content": "# Builds and deploys the fuzz introspector webapp.\nsteps:\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - 'build'\n  - '-t'\n  - 'gcr.io/oss-fuzz-base/fuzz-introspector-webapp'\n  - 'infra/build/fuzz-introspector-webapp'\n\n# Push the image here so we deploy the latest build.\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - 'push'\n  - 'gcr.io/oss-fuzz-base/fuzz-introspector-webapp'\n\n- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'\n  entrypoint: gcloud\n  args:\n    - 'run'\n    - 'deploy'\n    - 'fuzz-introspector-webapp'\n    - '--image'\n    - 'gcr.io/oss-fuzz-base/fuzz-introspector-webapp'\n    - '--region'\n    - 'us-central1'\n    - '--min-instances'\n    - '1'\n    - '--max-instances'\n    - '100'\n    - '--cpu'\n    - '6'\n    - '--memory'\n    - '24Gi'\noptions:\n  machineType: 'E2_HIGHCPU_32'\ntimeout: 21600s  # 6 hours\n"
  },
  {
    "path": "infra/build/request_all_builds.sh",
    "content": "#!/bin/bash -ex\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfor project in ../../projects/*; do\n  if [[ ! -f $project/Dockerfile ]]; then\n    continue\n  fi\n\n  ./request_build.sh $(basename $project) $1\ndone\n"
  },
  {
    "path": "infra/build/request_build.sh",
    "content": "#!/bin/bash -ex\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$2\" = \"fuzzing\" ]; then\n  topic=request-build\nelif [ \"$2\" = \"coverage\" ]; then\n  topic=request-coverage-build\nelif [ \"$2\" = \"introspector\" ]; then\n  topic=request-introspector-build\nelse\n  echo \"Invalid build type $2.\"\n  exit 1\nfi\n\ngcloud pubsub topics publish $topic --message \"$1\" --project oss-fuzz\n"
  },
  {
    "path": "infra/build/status/bower.json",
    "content": "{\n  \"name\": \"build-status\",\n  \"main\": \"index.html\",\n  \"dependencies\": {\n    \"polymer\": \"Polymer/polymer#^2.0.0-rc.3\",\n    \"paper-item\": \"PolymerElements/paper-item#2.0-preview\",\n    \"app-layout\": \"PolymerElements/app-layout#2.0-preview\",\n    \"paper-card\": \"PolymerElements/paper-card#2.0-preview\",\n    \"paper-tabs\": \"PolymerElements/paper-tabs#2.0-preview\",\n    \"iron-icons\": \"PolymerElements/iron-icons#2.0-preview\",\n    \"iron-ajax\": \"PolymerElements/iron-ajax#2.0-preview\",\n    \"iron-flex-layout\": \"PolymerElements/iron-flex-layout#2.0-preview\",\n    \"paper-icon-button\": \"PolymerElements/paper-icon-button#2.0-preview\",\n    \"app-route\": \"PolymerElements/app-route#2.0-preview\"\n  },\n  \"devDependencies\": {\n    \"web-component-tester\": \"^6.0.0-prerelease.5\",\n    \"webcomponentsjs\": \"webcomponents/webcomponentsjs#^1.1.0\"\n  }\n}\n"
  },
  {
    "path": "infra/build/status/deploy.sh",
    "content": "#!/bin/bash -ex\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngsutil -h \"Cache-Control:no-cache,max-age=0\" -m cp -r bower_components index.html src manifest.json gs://oss-fuzz-build-logs\n"
  },
  {
    "path": "infra/build/status/index.html",
    "content": "<!-- Copyright 2020 Google Inc.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n     http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License. -->\n\n<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes\">\n    <title>OSS-Fuzz build status</title>\n    <meta name=\"description\" content=\"OSS-Fuzz build status\">\n\n    <!-- See https://goo.gl/OOhYW5 -->\n    <link rel=\"manifest\" href=\"/manifest.json\">\n\n    <script src=\"/bower_components/webcomponentsjs/webcomponents-loader.js\"></script>\n\n\n    <link rel=\"import\" href=\"/src/build-status/build-status.html\">\n\n    <style>\n      body {\n        font-family: 'Roboto', 'Noto', sans-serif;\n        background: #f1f1f1;\n        margin: 0;\n      }\n    </style>\n  </head>\n  <body>\n    <build-status></build-status>\n  </body>\n</html>\n"
  },
  {
    "path": "infra/build/status/manifest.json",
    "content": "{\n  \"name\": \"build-status\",\n  \"short_name\": \"build-status\",\n  \"start_url\": \"/\",\n  \"display\": \"standalone\"\n}\n"
  },
  {
    "path": "infra/build/status/polymer.json",
    "content": "{\n  \"lint\": {\n    \"rules\": [\n      \"polymer-2\"\n    ]\n  }\n}\n"
  },
  {
    "path": "infra/build/status/src/build-status/build-status.html",
    "content": "<!-- Copyright 2020 Google Inc.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n     http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License. -->\n\n<link rel=\"import\" href=\"../../bower_components/polymer/polymer-element.html\">\n<link rel=\"import\" href=\"../../bower_components/app-layout/app-drawer-layout/app-drawer-layout.html\">\n<link rel=\"import\" href=\"../../bower_components/app-layout/app-drawer/app-drawer.html\">\n<link rel=\"import\" href=\"../../bower_components/app-layout/app-scroll-effects/app-scroll-effects.html\">\n<link rel=\"import\" href=\"../../bower_components/app-layout/app-header/app-header.html\">\n<link rel=\"import\" href=\"../../bower_components/app-layout/app-header-layout/app-header-layout.html\">\n<link rel=\"import\" href=\"../../bower_components/app-layout/app-toolbar/app-toolbar.html\">\n<link rel=\"import\" href=\"../../bower_components/paper-item/paper-item.html\">\n<link rel=\"import\" href=\"../../bower_components/paper-item/paper-item-body.html\">\n<link rel=\"import\" href=\"../../bower_components/paper-button/paper-button.html\">\n<link rel=\"import\" href=\"../../bower_components/paper-card/paper-card.html\">\n<link rel=\"import\" href=\"../../bower_components/paper-tabs/paper-tabs.html\">\n<link rel=\"import\" href=\"../../bower_components/paper-icon-button/paper-icon-button.html\">\n<link rel=\"import\" href=\"../../bower_components/iron-icons/iron-icons.html\">\n<link rel=\"import\" href=\"../../bower_components/iron-ajax/iron-ajax.html\">\n<link rel=\"import\" href=\"../../bower_components/iron-flex-layout/iron-flex-layout-classes.html\">\n<link rel=\"import\" href=\"../../bower_components/polymer/lib/elements/dom-if.html\">\n<link rel=\"import\" href=\"../../bower_components/polymer/lib/elements/dom-repeat.html\">\n<link rel=\"import\" href=\"../../bower_components/app-route/app-location.html\">\n<link rel=\"import\" href=\"../../bower_components/app-route/app-route.html\">\n\n<dom-module id=\"build-status\">\n  <template>\n    <app-location route=\"{{route}}\" use-hash-as-path></app-location>\n    <app-route route=\"{{route}}\"\n      pattern=\":project_name\"\n      data=\"{{routeData}}\">\n    </app-route>\n    <style is=\"custom-style\" include=\"iron-flex iron-flex-alignment\">\n    <style>\n      .paper-item-link {\n        color: inherit;\n        text-decoration: none;\n      }\n\n      a {\n        text-decoration: none;\n      }\n\n      app-header {\n        background-color: #2ba4ad;\n        color: #fff;\n      }\n\n      paper-button {\n        font-weight: normal;\n        font-size: 14px;\n        -webkit-font-smoothing: antialiased;\n      }\n\n      paper-button.green:hover {\n        background-color: var(--paper-green-400);\n      }\n\n      paper-button.green {\n        background-color: var(--paper-green-500);\n        color: white;\n      }\n\n      paper-card {\n        margin: 0.5em;\n      }\n\n      paper-item {\n        cursor: pointer;\n      }\n\n      paper-tabs {\n        -webkit-font-smoothing: antialiased;\n        width: 100%;\n        margin-bottom: 1px;\n        height: 40px;\n      }\n\n      :host {\n        display: block;\n      }\n\n      .icon-error {\n        color: #e83030;\n        margin-right: 0.2em;\n      }\n\n      .icon-success {\n        color: var(--paper-green-500);\n        margin-right: 0.2em;\n      }\n\n      .icon-waiting {\n        color: var(--paper-yellow-500);\n        margin-right: 0.2em;\n      }\n\n      .projects {\n        min-width: 10em;\n      }\n\n      .log {\n        width: 80%;\n        display: inline;\n      }\n\n      .buildHistory {\n        margin: 20px 0;\n      }\n\n      pre {\n        white-space: pre-wrap;\n      }\n    </style>\n    <app-header reveals>\n      <app-toolbar>\n        <div main-title>OSS-Fuzz build status</div>\n        <div><small>(Updated every 30 minutes)</small></div>\n      </app-toolbar>\n    </app-header>\n    <div class=\"layout horizontal\">\n      <paper-card class=\"projects\">\n        <div class=\"card-tabs\">\n          <paper-tabs selected=\"fuzzing\" id=\"build_type\" attr-for-selected=\"type\" on-click=\"onChanged\">\n            <paper-tab type=\"fuzzing\">Fuzzing Builds</paper-tab>\n            <paper-tab type=\"coverage\">Coverage Builds</paper-tab>\n            <paper-tab type=\"introspector\">Introspector Builds</paper-tab>\n          </paper-tabs>\n        </div>\n        <div class=\"card-content\">\n          <template is=\"dom-repeat\" items=\"[[status.projects]]\" as=\"project\">\n            <paper-item on-tap=\"onTap\">\n              <paper-item-body two-line>\n                <div>\n                  <template is=\"dom-if\" if=\"[[!isSuccessful(project)]]\">\n                    <iron-icon class=\"icon-error\" icon=\"icons:error\"></iron-icon>\n                  </template>\n                  <template is=\"dom-if\" if=\"[[!project.history.length]]\">\n                    <iron-icon class=\"icon-waiting\" icon=\"icons:error\"></iron-icon>\n                  </template>\n                  [[project.name]]\n                </div>\n                <template is=\"dom-if\" if=\"[[project.history.length]]\">\n                 <div secondary title$=\"Last built [[toLocalDate(project.finish_time)]]\">\n                    Last built [[toLocalDate(project.history.0.finish_time)]]\n                 </div>\n                </template>\n                <template is=\"dom-if\" if=\"[[!project.history.length]]\">\n                  <div secondary title$=\"Not built yet\">\n                    Not built yet\n                  </div>\n                </template>\n              </paper-item-body>\n            </paper-item>\n          </template>\n        </div>\n      </paper-card>\n      <paper-card class=\"log\">\n        <div class=\"card-content\">\n          <template is=\"dom-if\" if=\"[[!project]]\">\n            Select a project to see logs.\n          </template>\n          <template is=\"dom-if\" if=\"[[build_history.length]]\">\n            Last Successful build:\n            <template is=\"dom-if\" if=\"[[last_successful_build]]\">\n              <paper-button raised on-click=\"onLastBuildSuccessful\" class=\"green\">\n                [[getLocalDate(last_successful_build.finish_time)]]\n              </paper-button>\n            </template>\n            <template is=\"dom-if\" if=\"[[!last_successful_build]]\">\n              None yet.\n            </template>\n              <div class=\"buildHistory\">\n                Build History: <br>\n                <template is=\"dom-repeat\" items=\"[[build_history]]\" as=\"history\">\n                  <paper-button raised on-click=\"onBuildHistory\">\n                    <template is=\"dom-if\" if=\"[[history.success]]\">\n                      <iron-icon class=\"icon-success\" icon=\"icons:done\"></iron-icon>\n                    </template>\n                    <template is=\"dom-if\" if=\"[[!history.success]]\">\n                      <iron-icon class=\"icon-error\" icon=\"icons:error\"></iron-icon>\n                    </template>\n                    [[getLocalDate(history.finish_time)]]\n                  </paper-button>\n                </template>\n              </div>\n              <template is=\"dom-if\" if=[[!finish_time]]>\n              <pre>Select a build to see logs.</pre>\n            </template>\n              <template is=\"dom-if\" if=\"[[finish_time]]\">\n                <a href=\"/log-[[build_id]].txt\" target=\"_blank\" tabindex=\"-1\">\n                  <paper-button raised>\n                    Open in new tab\n                    <iron-icon icon=\"icons:link\"></iron-iron>\n                  </paper-button>\n                </a>\n                <pre>Finish Time : [[finish_time]]</pre>\n              </template>\n          </template>\n          <template is=\"dom-if\" if=\"[[loading_log]]\">\n            Loading...\n          </template>\n          <pre>[[log]]</pre>\n        </div>\n      </paper-card>\n    </div>\n      <iron-ajax id=\"status_fuzzing\" auto handle-as=\"json\" url=\"/status.json\" on-response=\"onResponseForFuzzing\"></iron-ajax>\n      <iron-ajax id=\"status_coverage\" auto handle-as=\"json\" url=\"/status-coverage.json\" on-response=\"onResponseForCoverage\"></iron-ajax>\n      <iron-ajax id=\"status_introspector\" auto handle-as=\"json\" url=\"/status-introspector.json\" on-response=\"onResponseForIntrospector\"></iron-ajax>\n    <iron-ajax id=\"logxhr\" handle-as=\"text\" on-response=\"onLogResponse\"></iron-ajax>\n  </template>\n\n  <script>\n    /** @polymerElement */\n    class BuildStatus extends Polymer.Element {\n      static get is() {\n        return \"build-status\";\n      }\n      static get properties() {\n        return {\n          log: {\n            type: String,\n            value: '',\n          },\n          loading_log: {\n            type: Boolean,\n            value: false,\n          },\n          finish_time: {\n            type: String,\n            value: '',\n          }\n        }\n      }\n      static get observers() {\n        return [\"_routeChanged(route.*)\"]\n      }\n\n      _routeChanged() {\n        if(!this.routeData.project_name)\n          this.project = \"\";\n        if (!this.status || !this.routeData.project_name) {\n          // If our status json is loaded and there is a project_name specified\n          // in the URL, we can proceed to load that project's log.\n          return\n        }\n        this.project = this.getProjectByName(this.routeData.project_name);\n        this.build_history = this.project.history;\n        if (this.project['last_successful_build']){\n          this.last_successful_build = this.project.last_successful_build;\n        } else{\n          this.last_successful_build = \"\";\n        }\n        this.log = \"\";\n        this.finish_time = \"\";\n      }\n\n      getProjectByName(project_name) {\n        return this.status.projects.find(\n          p => p.name === project_name\n        );\n      }\n\n      onResponseForFuzzing(e) {\n        this.status_fuzzing = e.detail.response;\n        if (!this.status) {\n          // Show status of the fuzzing builds by default.\n          this.status = this.status_fuzzing;\n          // Manually invoke a _routeChanged call, in order to load the log for\n          // someone going directly to a project's URL.\n          this._routeChanged();\n        }\n      }\n\n      onResponseForCoverage(e) {\n        this.status_coverage = e.detail.response;\n      }\n\n      onResponseForIntrospector(e) {\n        this.status_introspector = e.detail.response;\n      }\n\n      onLogResponse(e) {\n        this.log = e.detail.response;\n        this.loading_log = false;\n      }\n\n      onTap(e) {\n        // Change the route, this should auto-magically update the url in the\n        // browser and invoke the _routeChanged method.\n        this.set(\"route.path\", e.model.project.name);\n      }\n\n      onChanged(e) {\n        if (this.$.build_type.selected == \"coverage\") {\n          this.status = this.status_coverage;\n        } else if (this.$.build_type.selected == \"introspector\") {\n          this.status = this.status_introspector;\n        } else {\n          this.status = this.status_fuzzing;\n        }\n      }\n\n      requestLog() {\n        var ajax = this.$.logxhr;\n        ajax.url = \"/log-\" + this.build_id + \".txt\";\n        ajax.generateRequest();\n        this.loading_log = true;\n        this.log = \"\";\n        this.finish_time = this.toLocalDate(this.finish_time);\n      }\n\n      onLastBuildSuccessful(e) {\n        this.build_id = this.last_successful_build.build_id\n        this.finish_time = this.last_successful_build.finish_time\n        this.requestLog()\n      }\n\n      onBuildHistory(e) {\n        this.build_id = e.model.history.build_id\n        this.finish_time = e.model.history.finish_time\n        this.requestLog()\n      }\n\n      showLog(log) {\n        return log !== \"\";\n      }\n\n      showTabs() {\n        return this.tab_count !== 0;\n      }\n\n      toLocalDate(str) {\n        let date = new Date(str);\n        let ds = date.toString();\n        let timezone = ds.substring(ds.indexOf(\"(\"));\n        return date.toLocaleString() + \" \" + timezone;\n      }\n\n      pad(n) {\n        return n<10 ? '0'+n : n;\n      }\n\n      getLocalDate(str) {\n        let date = new Date(str);\n        return date.toLocaleString()\n      }\n\n      isSuccessful(project) {\n        return (!project.history.length || project.history[0].success)\n      }\n    }\n\n    window.customElements.define(BuildStatus.is, BuildStatus)\n  </script>\n</dom-module>\n"
  },
  {
    "path": "infra/build_fuzzers.Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Docker image to run fuzzers for CIFuzz (the run_fuzzers action on GitHub\n# actions).\n\nFROM gcr.io/oss-fuzz-base/cifuzz-base\n\n# Python file to execute when the docker container starts up\n# We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var,\n# just expand to '/opt/oss-fuzz'.\nENTRYPOINT [\"python3\", \"/opt/oss-fuzz/infra/cifuzz/build_fuzzers_entrypoint.py\"]\n\nWORKDIR ${OSS_FUZZ_ROOT}/infra\n\n# Update infra source code.\nADD . ${OSS_FUZZ_ROOT}/infra\n\nRUN python3 -m pip install -r ${OSS_FUZZ_ROOT}/infra/cifuzz/requirements.txt"
  },
  {
    "path": "infra/build_fuzzers.ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Docker image to run fuzzers for CIFuzz (the run_fuzzers action on GitHub\n# actions).\n\nFROM gcr.io/oss-fuzz-base/cifuzz-base:ubuntu-24-04\n\n# Python file to execute when the docker container starts up\n# We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var,\n# just expand to '/opt/oss-fuzz'.\nENTRYPOINT [\"python3\", \"/opt/oss-fuzz/infra/cifuzz/build_fuzzers_entrypoint.py\"]\n\nWORKDIR ${OSS_FUZZ_ROOT}/infra\n\n# Update infra source code.\nADD . ${OSS_FUZZ_ROOT}/infra\n\nRUN python3 -m pip install -r ${OSS_FUZZ_ROOT}/infra/cifuzz/requirements.txt\n"
  },
  {
    "path": "infra/build_specified_commit.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module to build a image from a specific commit, branch or pull request.\n\nThis module is allows each of the OSS Fuzz projects fuzzers to be built\nfrom a specific point in time. This feature can be used for implementations\nlike continuious integration fuzzing and bisection to find errors\n\"\"\"\nimport argparse\nimport bisect\nimport datetime\nimport os\nimport collections\nimport json\nimport logging\nimport re\nimport shutil\nimport tempfile\n\nimport helper\nimport repo_manager\nimport retry\nimport utils\n\nBuildData = collections.namedtuple(\n    'BuildData', ['project_name', 'engine', 'sanitizer', 'architecture'])\n\n_GIT_DIR_MARKER = 'gitdir: '\n_IMAGE_BUILD_TRIES = 3\n\n\nclass BaseBuilderRepo:\n  \"\"\"Repo of base-builder images.\"\"\"\n\n  def __init__(self):\n    self.timestamps = []\n    self.digests = []\n\n  def add_digest(self, timestamp, digest):\n    \"\"\"Add a digest.\"\"\"\n    self.timestamps.append(timestamp)\n    self.digests.append(digest)\n\n  def find_digest(self, timestamp):\n    \"\"\"Find the latest image before the given timestamp.\"\"\"\n    index = bisect.bisect_right(self.timestamps, timestamp)\n    if index > 0:\n      return self.digests[index - 1]\n\n    logging.error('Failed to find suitable base-builder.')\n    return None\n\n\ndef _replace_gitdir(src_dir, file_path):\n  \"\"\"Replace gitdir with a relative path.\"\"\"\n  with open(file_path) as handle:\n    lines = handle.readlines()\n\n  new_lines = []\n  for line in lines:\n    if line.startswith(_GIT_DIR_MARKER):\n      absolute_path = line[len(_GIT_DIR_MARKER):].strip()\n      if not os.path.isabs(absolute_path):\n        # Already relative.\n        return\n\n      current_dir = os.path.dirname(file_path)\n      # Rebase to /src rather than the host src dir.\n      base_dir = current_dir.replace(src_dir, '/src')\n      relative_path = os.path.relpath(absolute_path, base_dir)\n      logging.info('Replacing absolute submodule gitdir from %s to %s',\n                   absolute_path, relative_path)\n\n      line = _GIT_DIR_MARKER + relative_path\n\n    new_lines.append(line)\n\n  with open(file_path, 'w') as handle:\n    handle.write(''.join(new_lines))\n\n\ndef _make_gitdirs_relative(src_dir):\n  \"\"\"Make gitdirs relative.\"\"\"\n  for root_dir, _, files in os.walk(src_dir):\n    for filename in files:\n      if filename != '.git':\n        continue\n\n      file_path = os.path.join(root_dir, filename)\n      _replace_gitdir(src_dir, file_path)\n\n\ndef _replace_base_builder_digest(dockerfile_path, digest):\n  \"\"\"Replace the base-builder digest in a Dockerfile.\"\"\"\n  with open(dockerfile_path) as handle:\n    lines = handle.readlines()\n\n  new_lines = []\n  for line in lines:\n    if line.strip().startswith('FROM'):\n      line = 'FROM gcr.io/oss-fuzz-base/base-builder@' + digest + '\\n'\n\n    new_lines.append(line)\n\n  with open(dockerfile_path, 'w') as handle:\n    handle.write(''.join(new_lines))\n\n\ndef copy_src_from_docker(project_name, host_dir):\n  \"\"\"Copy /src from docker to the host.\"\"\"\n  # Copy /src to host.\n  image_name = 'gcr.io/oss-fuzz/' + project_name\n  src_dir = os.path.join(host_dir, 'src')\n  if os.path.exists(src_dir):\n    shutil.rmtree(src_dir, ignore_errors=True)\n\n  docker_args = [\n      '-v',\n      host_dir + ':/out',\n      image_name,\n      'cp',\n      '-r',\n      '-p',\n      '/src',\n      '/out',\n  ]\n  helper.docker_run(docker_args)\n\n  # Submodules can have gitdir entries which point to absolute paths. Make them\n  # relative, as otherwise we can't do operations on the checkout on the host.\n  _make_gitdirs_relative(src_dir)\n  return src_dir\n\n\n@retry.wrap(_IMAGE_BUILD_TRIES, 2)\ndef _build_image_with_retries(project_name):\n  \"\"\"Build image with retries.\"\"\"\n  return helper.build_image_impl(helper.Project(project_name))\n\n\ndef get_required_post_checkout_steps(dockerfile_path):\n  \"\"\"Get required post checkout steps (best effort).\"\"\"\n\n  checkout_pattern = re.compile(r'\\s*RUN\\s*(git|svn|hg)')\n\n  # If the build.sh is copied from upstream, we need to copy it again after\n  # changing the revision to ensure correct building.\n  post_run_pattern = re.compile(r'\\s*RUN\\s*(.*build\\.sh.*(\\$SRC|/src).*)')\n\n  with open(dockerfile_path) as handle:\n    lines = handle.readlines()\n\n  subsequent_run_cmds = []\n  for i, line in enumerate(lines):\n    if checkout_pattern.match(line):\n      subsequent_run_cmds = []\n      continue\n\n    match = post_run_pattern.match(line)\n    if match:\n      workdir = helper.workdir_from_lines(lines[:i])\n      command = match.group(1)\n      subsequent_run_cmds.append((workdir, command))\n\n  return subsequent_run_cmds\n\n\n# pylint: disable=too-many-locals\ndef build_fuzzers_from_commit(commit,\n                              build_repo_manager,\n                              host_src_path,\n                              build_data,\n                              base_builder_repo=None):\n  \"\"\"Builds a OSS-Fuzz fuzzer at a specific commit SHA.\n\n  Args:\n    commit: The commit SHA to build the fuzzers at.\n    build_repo_manager: The OSS-Fuzz project's repo manager to be built at.\n    build_data: A struct containing project build information.\n    base_builder_repo: A BaseBuilderRepo.\n  Returns:\n    0 on successful build or error code on failure.\n  \"\"\"\n  oss_fuzz_repo_manager = repo_manager.RepoManager(helper.OSS_FUZZ_DIR)\n  num_retry = 1\n\n  def cleanup():\n    # Re-copy /src for a clean checkout every time.\n    copy_src_from_docker(build_data.project_name,\n                         os.path.dirname(host_src_path))\n    build_repo_manager.fetch_all_remotes()\n\n  projects_dir = os.path.join('projects', build_data.project_name)\n  dockerfile_path = os.path.join(projects_dir, 'Dockerfile')\n\n  for i in range(num_retry + 1):\n    build_repo_manager.checkout_commit(commit, clean=False)\n\n    post_checkout_steps = get_required_post_checkout_steps(dockerfile_path)\n    for workdir, post_checkout_step in post_checkout_steps:\n      logging.info('Running post-checkout step `%s` in %s.', post_checkout_step,\n                   workdir)\n      helper.docker_run([\n          '-w',\n          workdir,\n          '-v',\n          host_src_path + ':' + '/src',\n          'gcr.io/oss-fuzz/' + build_data.project_name,\n          '/bin/bash',\n          '-c',\n          post_checkout_step,\n      ])\n\n    project = helper.Project(build_data.project_name)\n    result = helper.build_fuzzers_impl(project=project,\n                                       clean=True,\n                                       engine=build_data.engine,\n                                       sanitizer=build_data.sanitizer,\n                                       architecture=build_data.architecture,\n                                       env_to_add=None,\n                                       source_path=host_src_path,\n                                       mount_path='/src')\n    if result or i == num_retry:\n      break\n\n    # Retry with an OSS-Fuzz builder container that's closer to the project\n    # commit date.\n    commit_date = build_repo_manager.commit_date(commit)\n\n    # Find first change in the projects/<PROJECT> directory before the project\n    # commit date.\n    oss_fuzz_commit, _, _ = oss_fuzz_repo_manager.git([\n        'log', '--before=' + commit_date.isoformat(), '-n1', '--format=%H',\n        projects_dir\n    ],\n                                                      check_result=True)\n    oss_fuzz_commit = oss_fuzz_commit.strip()\n    if not oss_fuzz_commit:\n      logging.info(\n          'Could not find first OSS-Fuzz commit prior to upstream commit. '\n          'Falling back to oldest integration commit.')\n\n      # Find the oldest commit.\n      oss_fuzz_commit, _, _ = oss_fuzz_repo_manager.git(\n          ['log', '--reverse', '--format=%H', projects_dir], check_result=True)\n\n      oss_fuzz_commit = oss_fuzz_commit.splitlines()[0].strip()\n\n    if not oss_fuzz_commit:\n      logging.error('Failed to get oldest integration commit.')\n      break\n\n    logging.info('Build failed. Retrying on earlier OSS-Fuzz commit %s.',\n                 oss_fuzz_commit)\n\n    # Check out projects/<PROJECT> dir to the commit that was found.\n    oss_fuzz_repo_manager.git(['checkout', oss_fuzz_commit, projects_dir],\n                              check_result=True)\n\n    # Also use the closest base-builder we can find.\n    if base_builder_repo:\n      base_builder_digest = base_builder_repo.find_digest(commit_date)\n      if not base_builder_digest:\n        return False\n\n      logging.info('Using base-builder with digest %s.', base_builder_digest)\n      _replace_base_builder_digest(dockerfile_path, base_builder_digest)\n\n    # Rebuild image and re-copy src dir since things in /src could have changed.\n    if not _build_image_with_retries(build_data.project_name):\n      logging.error('Failed to rebuild image.')\n      return False\n\n    cleanup()\n\n  cleanup()\n  return result\n\n\ndef detect_main_repo(project_name, repo_name=None, commit=None):\n  \"\"\"Checks a docker image for the main repo of an OSS-Fuzz project.\n\n  Note: The default is to use the repo name to detect the main repo.\n\n  Args:\n    project_name: The name of the oss-fuzz project.\n    repo_name: The name of the main repo in an OSS-Fuzz project.\n    commit: A commit SHA that is associated with the main repo.\n\n  Returns:\n    A tuple containing (the repo's origin, the repo's path).\n  \"\"\"\n\n  if not repo_name and not commit:\n    logging.error(\n        'Error: can not detect main repo without a repo_name or a commit.')\n    return None, None\n  if repo_name and commit:\n    logging.info(\n        'Both repo name and commit specific. Using repo name for detection.')\n\n  # Change to oss-fuzz main directory so helper.py runs correctly.\n  utils.chdir_to_root()\n  if not _build_image_with_retries(project_name):\n    logging.error('Error: building %s image failed.', project_name)\n    return None, None\n  docker_image_name = 'gcr.io/oss-fuzz/' + project_name\n  command_to_run = [\n      'docker', 'run', '--rm', '-t', docker_image_name, 'python3',\n      os.path.join('/opt', 'cifuzz', 'detect_repo.py')\n  ]\n  if repo_name:\n    command_to_run.extend(['--repo_name', repo_name])\n  else:\n    command_to_run.extend(['--example_commit', commit])\n  out, _, _ = utils.execute(command_to_run)\n  match = re.search(r'\\bDetected repo: ([^ ]+) ([^ ]+)', out.rstrip())\n  if match and match.group(1) and match.group(2):\n    return match.group(1), match.group(2)\n\n  logging.error('Failed to detect repo:\\n%s', out)\n  return None, None\n\n\ndef load_base_builder_repo():\n  \"\"\"Get base-image digests.\"\"\"\n  gcloud_path = shutil.which('gcloud')\n  if not gcloud_path:\n    logging.warning('gcloud not found in PATH.')\n    return None\n\n  result, _, _ = utils.execute([\n      gcloud_path,\n      'container',\n      'images',\n      'list-tags',\n      'gcr.io/oss-fuzz-base/base-builder',\n      '--format=json',\n      '--sort-by=timestamp',\n  ],\n                               check_result=True)\n  result = json.loads(result)\n\n  repo = BaseBuilderRepo()\n  for image in result:\n    timestamp = datetime.datetime.fromisoformat(\n        image['timestamp']['datetime']).astimezone(datetime.timezone.utc)\n    repo.add_digest(timestamp, image['digest'])\n\n  return repo\n\n\ndef main():\n  \"\"\"Main function.\"\"\"\n  logging.getLogger().setLevel(logging.INFO)\n\n  parser = argparse.ArgumentParser(\n      description='Build fuzzers at a specific commit')\n  parser.add_argument('--project_name',\n                      help='The name of the project where the bug occurred.',\n                      required=True)\n  parser.add_argument('--commit',\n                      help='The newest commit SHA to be bisected.',\n                      required=True)\n  parser.add_argument('--engine',\n                      help='The default is \"libfuzzer\".',\n                      default='libfuzzer')\n  parser.add_argument('--sanitizer',\n                      default='address',\n                      help='The default is \"address\".')\n  parser.add_argument('--architecture', default='x86_64')\n\n  args = parser.parse_args()\n\n  repo_url, repo_path = detect_main_repo(args.project_name, commit=args.commit)\n\n  if not repo_url or not repo_path:\n    raise ValueError('Main git repo can not be determined.')\n\n  with tempfile.TemporaryDirectory() as tmp_dir:\n    host_src_dir = copy_src_from_docker(args.project_name, tmp_dir)\n    build_repo_manager = repo_manager.RepoManager(\n        os.path.join(host_src_dir, os.path.basename(repo_path)))\n    base_builder_repo = load_base_builder_repo()\n\n    build_data = BuildData(project_name=args.project_name,\n                           engine=args.engine,\n                           sanitizer=args.sanitizer,\n                           architecture=args.architecture)\n    if not build_fuzzers_from_commit(args.commit,\n                                     build_repo_manager,\n                                     host_src_dir,\n                                     build_data,\n                                     base_builder_repo=base_builder_repo):\n      raise RuntimeError('Failed to build.')\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/build_specified_commit_test.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Test the functionality of the build image from commit module.\nThe will consist of the following functional tests:\n  1. The inference of the main repo for a specific project.\n  2. The building of a projects fuzzers from a specific commit.\n\n\"\"\"\nimport os\nimport tempfile\nimport unittest\n\nimport build_specified_commit\nimport helper\nimport repo_manager\nimport test_repos\n\n# necessary because __file__ changes with os.chdir\nTEST_DIR_PATH = os.path.dirname(os.path.realpath(__file__))\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass BuildImageIntegrationTest(unittest.TestCase):\n  \"\"\"Tests if an image can be built from different states e.g. a commit.\"\"\"\n\n  @unittest.skip('Test is failing (spuriously?).')\n  def test_build_fuzzers_from_commit(self):\n    \"\"\"Tests if the fuzzers can build at a specified commit.\n\n    This is done by using a known regression range for a specific test case.\n    The old commit should show the error when its fuzzers run and the new one\n    should not.\n    \"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      test_repo = test_repos.TEST_REPOS[1]\n      self.assertTrue(helper.build_image_impl(test_repo.project_name))\n      host_src_dir = build_specified_commit.copy_src_from_docker(\n          test_repo.project_name, tmp_dir)\n\n      test_repo_manager = repo_manager.clone_repo_and_get_manager(\n          test_repo.git_url, host_src_dir, test_repo.oss_repo_name)\n      build_data = build_specified_commit.BuildData(\n          sanitizer='address',\n          architecture='x86_64',\n          engine='libfuzzer',\n          project_name=test_repo.project_name)\n\n      build_specified_commit.build_fuzzers_from_commit(test_repo.old_commit,\n                                                       test_repo_manager,\n                                                       host_src_dir, build_data)\n      project = helper.Project(test_repo.project_name)\n      old_result = helper.reproduce_impl(project=project,\n                                         fuzzer_name=test_repo.fuzz_target,\n                                         valgrind=False,\n                                         env_to_add=[],\n                                         fuzzer_args=[],\n                                         testcase_path=test_repo.testcase_path)\n      build_specified_commit.build_fuzzers_from_commit(test_repo.project_name,\n                                                       test_repo_manager,\n                                                       host_src_dir, build_data)\n      new_result = helper.reproduce_impl(project=project,\n                                         fuzzer_name=test_repo.fuzz_target,\n                                         valgrind=False,\n                                         env_to_add=[],\n                                         fuzzer_args=[],\n                                         testcase_path=test_repo.testcase_path)\n      self.assertNotEqual(new_result, old_result)\n\n  def test_detect_main_repo_from_commit(self):\n    \"\"\"Test the detect main repo function from build specific commit module.\"\"\"\n    # TODO(metzman): Fix these tests so they don't randomly break because of\n    # changes in the outside world.\n    for example_repo in test_repos.TEST_REPOS:\n      if example_repo.new_commit:\n        # TODO(metzman): This function calls _build_image_with_retries which\n        # has a long delay (30 seconds). Figure out how to make this quicker.\n        repo_origin, repo_name = build_specified_commit.detect_main_repo(\n            example_repo.project_name, commit=example_repo.new_commit)\n        self.assertEqual(repo_origin, example_repo.git_url)\n        self.assertEqual(repo_name,\n                         os.path.join('/src', example_repo.oss_repo_name))\n\n    repo_origin, repo_name = build_specified_commit.detect_main_repo(\n        test_repos.INVALID_REPO.project_name,\n        test_repos.INVALID_REPO.new_commit)\n    self.assertIsNone(repo_origin)\n    self.assertIsNone(repo_name)\n\n  def test_detect_main_repo_from_name(self):\n    \"\"\"Test the detect main repo function from build specific commit module.\"\"\"\n    for example_repo in test_repos.TEST_REPOS:\n      if example_repo.project_name == 'gonids':\n        # It's unclear how this test ever passed, but we can't infer the repo\n        # because gonids doesn't really check it out, it uses \"go get\".\n        continue\n      repo_origin, repo_name = build_specified_commit.detect_main_repo(\n          example_repo.project_name, repo_name=example_repo.git_repo_name)\n      self.assertEqual(repo_origin, example_repo.git_url)\n      self.assertEqual(\n          repo_name,\n          os.path.join(example_repo.image_location, example_repo.oss_repo_name))\n\n    repo_origin, repo_name = build_specified_commit.detect_main_repo(\n        test_repos.INVALID_REPO.project_name,\n        test_repos.INVALID_REPO.oss_repo_name)\n    self.assertIsNone(repo_origin)\n    self.assertIsNone(repo_name)\n\n\nif __name__ == '__main__':\n  # Change to oss-fuzz main directory so helper.py runs correctly.\n  if os.getcwd() != os.path.dirname(TEST_DIR_PATH):\n    os.chdir(os.path.dirname(TEST_DIR_PATH))\n  unittest.main()\n"
  },
  {
    "path": "infra/chronos/README.md",
    "content": "# Chronos: rebuilding OSS-Fuzz harnesses using cached builds\n\nChronos is a utility tooling to enable fast re-building of OSS-Fuzz projects\nand analysis of projects' testing infrastructure. This is used by projects,\ne.g. [OSS-Fuzz-gen](https://github.com/google/oss-fuzz-gen) to help speed up\nvaluation processes during fuzzing harness generation.\n\nAt the core, Chronos relies on caching containers after project build, in order\nto enable fast rebuilding of a project following minor patches, and also enable\nrunning of the tests in a given project. To support this, Chronos creates a snapshot\nof the Docker container given project post build completion. This means that all `.o` files, generated\nconfigurations etc. persist in the Docker container. These artifacts are then\nleveraged for future \"replay builds\" where only a minor part of the project has changed,\ne.g. due to some patching on the project. This patching could be e.g. minor adjustments\nto the fuzzing harness source code e.g. by [oss-fuzz-gen](https://github.com/google/oss-fuzz-gen).\n\nAs such, at the core of Chronos are cached containers that are generated by taking a\nsnapshot of the container of a project post project build.\n\nChronos is focused on two features, rebuilding projects fast and running the\ntests of a given project.\n\n\n## Chronos features: fast rebuilding and running the tests of a project\n\n### CLI interface for Chronos\n\nThe default route to validating Chronos is using the CLI available in `infra/experimental/chronos/manager.py`\n\n### Chronos feature: Fast rebuilding\n\nChronos enables rebuilding projects efficiently in contexts where only a small patch\nneeds to be evaluated in the target. This is achieved by running a replay build script\nin the build container, similarly to how a regular `build_fuzzers` command would run, but\nwith the caveat that the replay build script only performs a subset of the operations\nof the original `build.sh`.\n\nThe replay build scripts are constructed in two ways: manually or automatically.\n\n#### Option 1: Automated rebuilds\n\nChronos supports automated rebuilding. This is meant as a generic mechanism to enable Chronos support for projects by default. This is achieved by:\n\n1. Calling into a `replay_build.sh` script during the building inside the container [here](https://github.com/google/oss-fuzz/blob/206656447b213fb04901d15122692d8dd4d45312/infra/base-images/base-builder/compile#L292-L296)\n2. The `replay_build.sh` calls into `make_build_replayable.py`: [here](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/replay_build.sh)\n3. `make_build_replayable.py` adjusts the build environment to wrap around common commands, to avoid performing a complete run of `build.sh`: [here](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/make_build_replayable.py).\n\nThe automated rebuilding works in combination with [Ccache](https://ccache.dev/), in order to facilitate caching of e.g. `.o` files.\nThis means that during rebuild mode as long as we have a cache, we don't need to e.g. run `configure` again and will only have to\nrebuild the changed source code.\n\n#### Option 2: Manually provided replay builds\n\n`replay_build.sh` above, is simply just a wrapper script around `build.sh` that aims to enable\nfast rebuilding of the project. This `replay_build.sh` can, however, be overwritten in the Dockerfile\nof the project's builder image to support a custom approach to fast rebuilding. Two examples of this is [php](https://github.com/google/oss-fuzz/blob/206656447b213fb04901d15122692d8dd4d45312/projects/php/replay_build.sh#L1) and [ffmpeg](https://github.com/google/oss-fuzz/blob/master/projects/ffmpeg/replay_build.sh#L1).\n\nProviding a manual `replay_build.sh` is likely more efficient at build time and can help speed up the process. Automated replay build scripts can also be erroneous.\n\n\n#### Testing the validity of a replay build\n\nThe Chronos manager can use the `manager.py` to validate the validity of a\nreplay build for a given project:\n\n```sh\npython3 infra/experimental/chronos/manager.py check-replay tinyobjloader\n```\n\nIf the above command fails for the relevant project, then the replay build feature\ndoes not work for the given project.\n\n### Chronos feature:  Running tests of a project\n\nThe second part of Chronos is a feature to enable running the tests of a given\nproject. This is done by way of a script `run_tests.sh`. Samples of\nthis script include [jsonnet](https://github.com/google/oss-fuzz/blob/master/projects/jsonnet/run_tests.sh#L1) and [tinyobjloader](https://github.com/google/oss-fuzz/blob/master/projects/tinyobjloader/run_tests.sh#L1).\n\n\n#### Run tests constraints\n\n1. The `run_tests.sh` main task is to run the tests of a project and return `0` upon success and non-null otherwise.\n2. The `run_tests.sh` script must leave the main repository in the state as it was prior to the execution of `run_tests.sh` relative to `git diff` (or similar diff features of other version control systems).\n\n#### Testing the validity of run_tests.sh\n\nThe Chronos manager can use the `manager.py` to validate the validity of a\n`run_tests.sh` script:\n\n```sh\npython3 infra/experimental/chronos/manager.py check-tests json-c\n```\n\n\n### Constraints imposed on replay_build.sh and run_tests.sh\n\nAt the core of chronos are the two scripts `replay_build.sh` and `run_tests.sh`. We have a default\nmechanism for `replay_build.sh` so it's not strictly necessary to have a custom one, although it will\nlikely improve speed and maybe correctness by providing one.\n\nThere are three stages of the Chronos workflow:\n\n1. The cached containers represent the state of a build container after a successful project build.\n2. The `replay_build.sh` is able to rebuild a given project from the state of a cached container.\n3. The `run_tests.sh` script is able to run the tests of a given project. This should be able to succeed following the running of a `replay_build.sh`.\n\nThe stages (2) and (3) must both support running without network connectivity.\nSpecifically, this means that the `replay_build.sh` must not do tasks e.g. fetch\ndependencies, download corpus, or anything of this nature. Similarly, the `run_tests.sh`\nmust be able to operate completely in a closed network environment.\n\n\n## Pre-built images.\n\nChronos cached images are built daily, and pre-built images are available at:\n\n- `us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/<PROJECT>-ofg-cached-address`\n- `us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/<PROJECT>-ofg-cached-coverage`\n\nThey can be used as drop-in replacements for the usual `gcr.io/oss-fuzz/<PROJECT>` images."
  },
  {
    "path": "infra/chronos/__init__.py",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################"
  },
  {
    "path": "infra/chronos/container_cache_build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\necho \"Starting prepare cache build script\"\nexport PATH=/ccache/bin:$PATH\npython3.11 -m pip install -r /chronos/requirements.txt\nrm -rf /out/*\ncompile\ncp -n /usr/local/bin/replay_build.sh $SRC/"
  },
  {
    "path": "infra/chronos/container_coverage_collection.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nchmod +x /src/run_tests.sh\nfind /src/ -name \"*.profraw\" -exec rm -f {} \\;\n/src/run_tests.sh\npython3 /chronos/coverage_test_collection.py\nchmod -R 755 /out/test-html-generation/"
  },
  {
    "path": "infra/chronos/container_patch_replay_test.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\necho \"Starting container patch replay script: $1\"\n\npython3 /chronos/integrity_validator_check_replay.py $1\n\nexport PATH=/ccache/bin$PATH\nrm -rf /out/*\ncompile"
  },
  {
    "path": "infra/chronos/container_patch_tests_test.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\necho \"Starting container patch tests script\"\n\n# Ensure dependencies are installed\npython3 -m pip install -r /chronos/requirements.txt\n\n# Capture patch, run tests and then diff patches.\npython3 /chronos/integrity_validator_run_tests.py diff-patch before\nchmod +x /src/run_tests.sh\n/src/run_tests.sh        \npython3 /chronos/integrity_validator_run_tests.py diff-patch after"
  },
  {
    "path": "infra/chronos/coverage_test_collection.py",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\"\"\"Module for extracting coverage data from a run of run_tests.sh\"\"\"\n\nimport os\nimport shutil\nimport subprocess\n\nCOV_WORKDIR = '/tmp/cov-dumps'\n\n\ndef collect_coverage_profraw_files():\n  \"\"\"Finds profraw files in the most likely places in the OSS-Fuzz build\n    container and copies them to the COV_WORKDIR.\"\"\"\n  rootdir = '/src/'\n  for subdir, _, files in os.walk(rootdir):\n    for file in files:\n      if file.endswith('.profraw'):\n        print(os.path.join(subdir, file))\n        dst_name = os.path.join(subdir, file).replace('/', '_')\n        shutil.copy(os.path.join(subdir, file), f'{COV_WORKDIR}/{dst_name}')\n\n\ndef find_all_executables():\n  \"\"\"Finds all executables that are likely to be run with coverage\n  collection.\"\"\"\n  rootdir = '/src/'\n  objects_string = ''\n  for subdir, _, files in os.walk(rootdir):\n    if any(avoid_dir in subdir for avoid_dir in\n           ['aflplusplus', 'fuzztest', 'honggfuzz', 'libfuzzer', '.git']):\n      continue\n    for file in files:\n      abs_file = os.path.join(subdir, file)\n\n      if os.access(abs_file, os.X_OK):\n\n        # Ensure it's an ELF\n        with open(abs_file, 'rb') as binf:\n          magic_bytes = binf.read(4)\n        if len(magic_bytes) != 4:\n          continue\n\n        is_elf = True\n        if magic_bytes[0] != 0x7f:\n          is_elf = False\n        if magic_bytes[1] != 0x45:\n          is_elf = False\n        if magic_bytes[2] != 0x4c:\n          is_elf = False\n        if magic_bytes[3] != 0x46:\n          is_elf = False\n        if not is_elf:\n          continue\n\n        dst_name = f'{COV_WORKDIR}/{file}'\n        if not objects_string:\n          objects_string = abs_file + ' '\n        else:\n          objects_string += f'-object {dst_name} '\n        shutil.copy(abs_file, dst_name)\n  print('Found the following executables for coverage extraction:')\n  print(objects_string)\n  return objects_string\n\n\ndef run_llvm_html_generation(objects, out_dir, workdir=COV_WORKDIR):\n  \"\"\"Generates HTML coverage report from profraw files.\"\"\"\n  prof_raws = ''\n  instr_profile = os.path.join(workdir, 'merged_profdata.profdata')\n\n  for file in os.listdir(workdir):\n    if file.endswith('.profraw'):\n      prof_raws += os.path.join(workdir, file) + ' '\n  cmd = [\n      'llvm-profdata', 'merge', '-j=1', '-sparse', prof_raws, '-o',\n      instr_profile\n  ]\n  subprocess.check_call(' '.join(cmd), shell=True)\n\n  # Extract HTML report\n  cmd = [\n      'llvm-cov', 'show', '-format=html', f'-output-dir={out_dir}',\n      f'-instr-profile={instr_profile}', objects\n  ]\n\n  subprocess.check_call(' '.join(cmd), shell=True)\n\n  # Extract json report\n  cmd = [\n      'llvm-cov',\n      'export',\n      '-summary-only',\n      f'-instr-profile={instr_profile}',\n      objects,\n  ]\n  stdout_fp = open(os.path.join(out_dir, 'summary.json'), 'w')\n  subprocess.check_call(' '.join(cmd), shell=True, stdout=stdout_fp)\n  stdout_fp.close()\n\n\ndef reset_cov_workdir():\n  \"\"\"Resets the coverage work directory.\"\"\"\n  if os.path.exists(COV_WORKDIR):\n    shutil.rmtree(COV_WORKDIR, ignore_errors=True)\n  os.mkdir(COV_WORKDIR)\n\n\ndef main():\n  \"\"\"Main function to run the coverage test collection.\"\"\"\n  reset_cov_workdir()\n  collect_coverage_profraw_files()\n  obj_string = find_all_executables()\n\n  run_llvm_html_generation(obj_string, '/out/test-html-generation')\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/chronos/integrity_validator_check_replay.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Helper to generate bad patches for replay test using different approach.\"\"\"\n\nimport os\nimport pathlib\nimport random\nimport sys\n\nEXCLUDE_DIRS = ['tests', 'test', 'examples', 'example', 'build']\nROOT_PATH = os.path.abspath(pathlib.Path.cwd().resolve())\nMAX_COUNT = 50\n\n\ndef normal_compile():\n  \"\"\"Do nothing and act as a control test that should always success.\"\"\"\n\n\ndef source_code_white_noise():\n  \"\"\"Insert white noise. This is a control test which forces\n  recompilation of good code. We need this to make sure that\n  the system is able to rebuild full source code under the\n  Chronos environment.\"\"\"\n  exts = ['.c', '.cc', '.cpp', '.cxx', '.h', '.hpp']\n  payload = '\\n\\n\\n\\n\\n\\n'\n\n  # Walk and insert garbage code\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        try:\n          with open(path, 'a', encoding='utf-8') as f:\n            f.write(payload)\n        except Exception:\n          pass\n\n\ndef source_code_compile_error():\n  \"\"\"Insert garbage code to all found source files in the /src/ directory.\"\"\"\n  exts = ['.c', '.cc', '.cpp', '.cxx', '.h', '.hpp']\n  payload = 'GARBAGE GARBAGE'\n\n  # Walk and insert garbage code\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        try:\n          with open(path, 'a', encoding='utf-8') as f:\n            f.write(payload)\n        except Exception:\n          pass\n\n\ndef macro_compile_error():\n  \"\"\"Insert explicit macro error to all found header files in the /src/ directory.\"\"\"\n  exts = ['.h', '.hpp']\n  payload = '#error THIS_SHOULD_BE_FAILING'\n\n  # Walk and insert error macro\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        try:\n          with open(path, 'a', encoding='utf-8') as f:\n            f.write(payload)\n        except Exception:\n          pass\n\n\ndef missing_header_error():\n  \"\"\"Insert wrong header inclusion to all found source files in the /src/ directory.\"\"\"\n  exts = ['.c', '.cc', '.cpp', '.cxx']\n  payload = '#include header_not_exist.h\\n'\n  count = 0\n\n  # Walk and insert missing header inclusion\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      # Only modify a handful of files\n      if count > MAX_COUNT:\n        return\n\n      # Skip random file\n      if random.choice([True, False]):\n        continue\n\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        try:\n          # Read source file\n          source = ''\n          with open(path, 'r', encoding='utf-8') as f:\n            source = f.read()\n          if not source:\n            continue\n\n          # Append a wrong header inclusion at the beginning\n          with open(path, 'w', encoding='utf-8') as f:\n            f.write(payload)\n            f.write(source)\n          count += 1\n        except Exception:\n          pass\n\n\ndef duplicate_symbol_error():\n  \"\"\"Insert duplicate symbol to all found source files in the /src/ directory.\"\"\"\n  import tree_sitter_cpp\n  from tree_sitter import Language, Parser, Query, QueryCursor\n\n  exts = ['.c', '.cc', '.cpp', '.cxx']\n  count = 0\n\n  treesitter_lang = Language(tree_sitter_cpp.language())\n  treesitter_parser = Parser(treesitter_lang)\n\n  # Walk and insert missing header inclusion\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      # Only modify a handful of files\n      if count > MAX_COUNT:\n        return\n\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        node = None\n        new_source = None\n        try:\n          # Try read and parse the source with tree-sitter\n          source = ''\n          with open(path, 'r', encoding='utf-8') as f:\n            source = f.read()\n          if source:\n            node = treesitter_parser.parse(source.encode()).root_node\n        except Exception:\n          pass\n\n        if not node:\n          continue\n\n        # Found random declaration and duplicate it\n        cursor = QueryCursor(Query(treesitter_lang, '( declaration ) @decl'))\n        for declaration in cursor.captures(node).get('decl', []):\n          if declaration.text:\n            target = declaration.text.decode()\n            new_source = source.replace(target, target + target)\n            break\n\n        # Add source code with duplicated declaration randomly\n        if new_source and random.choice([True, False]):\n          try:\n            with open(path, 'w', encoding='utf-8') as f:\n              f.write(new_source)\n            count += 1\n          except Exception:\n            pass\n\n\ndef function_linker_error():\n  \"\"\"Insert an extern header to some found source files with no real definition in the /src/ directory.\"\"\"\n  exts = ['.c', '.cpp', '.cxx', '.cc']\n  count = 0\n  payload = '#ifdef __cplusplus\\nextern \"C\" {\\n#endif\\nvoid __not_defined(void);\\n#ifdef __cplusplus\\n}\\n#endif\\n'\n  payload_call = 'void wrong_linking_function_{COUNT}(){\\n__not_defined();\\n}'\n\n  # Walk and insert error macro\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      # Only modify a handful of files\n      if count > MAX_COUNT:\n        return\n\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        try:\n          # Read source file\n          source = ''\n          with open(path, 'r', encoding='utf-8') as f:\n            source = f.read()\n          if not source:\n            continue\n\n          # Append a wrong header inclusion at the beginning\n          with open(path, 'w', encoding='utf-8') as f:\n            f.write(payload)\n            f.write(source)\n            f.write(payload_call.replace('{COUNT}', str(count)))\n          count += 1\n        except Exception:\n          pass\n\n\nBAD_PATCH_GENERATOR = {\n    'control_test': {\n        'func': normal_compile,\n        'rc': [0],\n    },\n    'white_noise': {\n        'func': source_code_white_noise,\n        'rc': [0],\n    },\n    'compile_error': {\n        'func': source_code_compile_error,\n        'rc': [1, 2],\n    },\n    'macro_error': {\n        'func': macro_compile_error,\n        'rc': [1, 2],\n    },\n    'missing_headers': {\n        'func': missing_header_error,\n        'rc': [1, 2],\n    },\n    'duplicate_symbols': {\n        'func': duplicate_symbol_error,\n        'rc': [1, 2],\n    },\n    'function_missing': {\n        'func': function_linker_error,\n        'rc': [1, 2],\n    },\n}\n\n\ndef main():\n  \"\"\"Main entrypoint.\"\"\"\n  target = sys.argv[1]\n  BAD_PATCH_GENERATOR[target]['func']()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "infra/chronos/integrity_validator_run_tests.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Helper to generate logic error patches for general test using different approach.\"\"\"\n\nfrom dataclasses import dataclass\nimport os\nimport pathlib\nimport random\nimport subprocess\nimport sys\n\ntry:\n  import tree_sitter_cpp\n  from tree_sitter import Language, Parser, Query, QueryCursor\nexcept (ModuleNotFoundError, ImportError):\n  # pass. Allow this module to be imported even when tree-sitter\n  # is not available.\n  pass\n\nEXCLUDE_DIRS = ['tests', 'test', 'examples', 'example', 'build']\nROOT_PATH = os.path.abspath(pathlib.Path.cwd().resolve())\nMAX_FILES_TO_PATCH = 50\n\n\ndef _add_payload_random_functions(exts: list[str], payload: str) -> str:\n  \"\"\"Helper to attach payload to random functions found in any source.\"\"\"\n  count = 0\n\n  treesitter_parser = Parser(Language(tree_sitter_cpp.language()))\n  # Walk and insert payload on the random line of random functions\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      # Only change some files randomly\n      if count > MAX_FILES_TO_PATCH:\n        return\n\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        node = None\n        try:\n          # Try read and parse the source with tree-sitter\n          source = ''\n          with open(path, 'r', encoding='utf-8') as f:\n            source = f.read()\n          if source:\n            node = treesitter_parser.parse(source.encode()).root_node\n        except Exception:\n          pass\n\n        if not node:\n          continue\n\n        # Insert payload to random line in the function\n        cursor = QueryCursor(\n            Query(Language(tree_sitter_cpp.language()),\n                  '( function_definition ) @funcs'))\n        for func in cursor.captures(node).get('funcs', []):\n          body = func.child_by_field_name('body')\n\n          # Skip Class / Struct definition\n          type_node = func.child_by_field_name('type')\n          if not type_node or type_node.type not in [\n              'primitive_type', 'type_identifier'\n          ]:\n            continue\n\n          if body and body.text and random.choice([True, False]):\n            func_source = body.text.decode()\n            # new_func_source = f'{{ {payload} {func_source[1:]}'\n            if len(func_source) > 10:\n              new_func_source = f'{{ {payload} {func_source[1:]}'\n              source = source.replace(func_source, new_func_source)\n        try:\n          with open(path, 'w', encoding='utf-8') as f:\n            f.write(source)\n          count += 1\n        except Exception:\n          pass\n\n\ndef normal_patch():\n  \"\"\"Do nothing and act as a control test that should always success.\"\"\"\n  return\n\n\ndef signal_abort_crash():\n  \"\"\"Insert abort call to force a crash in source files found in the /src/directory.\"\"\"\n  exts = ['.c', '.cc', '.cpp', '.cxx']\n  _add_payload_random_functions(exts, 'abort();')\n\n\ndef builtin_trap_crash():\n  \"\"\"Insert builtin trap to force a crash in source files found in the /src/directory.\"\"\"\n  exts = ['.c', '.cc', '.cpp', '.cxx']\n  _add_payload_random_functions(exts, '__builtin_trap();')\n\n\ndef null_write_crash():\n  \"\"\"Insert null pointer write to force a crash in source files found in the /src/directory.\"\"\"\n  exts = ['.c', '.cc', '.cpp', '.cxx']\n  _add_payload_random_functions(exts, '*(volatile int*)0 = 0;')\n\n\ndef wrong_return_value():\n  \"\"\"modify random return statement to force an unit test failed in source files found in the /src/directory.\"\"\"\n  exts = ['.c', '.cc', '.cpp', '.cxx']\n  primitives = {\n      'bool', 'char', 'signed', 'unsigned', 'short', 'int', 'long', 'float',\n      'double', 'wchar_t', 'char8_t', 'char16_t', 'char32_t', 'size_t'\n  }\n  count = 0\n  treesitter_parser = Parser(Language(tree_sitter_cpp.language()))\n  # Walk and insert payload on the random line of random functions\n  for cur, dirs, files in os.walk(ROOT_PATH):\n    dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]\n    for file in files:\n      # Only change some files randomly\n      if count > MAX_FILES_TO_PATCH:\n        return\n\n      if any(file.endswith(ext) for ext in exts):\n        path = os.path.join(cur, file)\n        node = None\n        try:\n          # Try read and parse the source with tree-sitter\n          source = ''\n          with open(path, 'r', encoding='utf-8') as f:\n            source = f.read()\n          if source:\n            node = treesitter_parser.parse(source.encode()).root_node\n        except Exception:\n          pass\n\n        if not node:\n          continue\n\n        # Try simulate wrong return statement\n        cursor = QueryCursor(\n            Query(Language(tree_sitter_cpp.language()),\n                  '( function_definition ) @funcs'))\n        for func in cursor.captures(node).get('funcs', []):\n          # Get return type\n          rtn_node = func.child_by_field_name('type')\n          if rtn_node and rtn_node.text:\n            rtn = rtn_node.text.decode()\n          else:\n            rtn = None\n\n          # Determine if return type is a pointer\n          if func.child_by_field_name(\n              'declarator').type == 'pointer_declarator':\n            is_pointer = True\n          else:\n            is_pointer = False\n\n          # If the return tyoe is a pointer or primitive types,\n          #add return 0 at the beginning of the function\n          body = func.child_by_field_name('body')\n          if body and body.text and (is_pointer or rtn in primitives):\n            func_source = body.text.decode()\n            new_func_source = f'{{  {func_source[1:]}'\n            source = source.replace(func_source, new_func_source)\n\n        try:\n          with open(path, 'w', encoding='utf-8') as f:\n            f.write(source)\n          count += 1\n        except Exception:\n          pass\n\n\n@dataclass\nclass LogicErrorPatch:\n  \"\"\"Dataclass to hold the patch function and expected result.\"\"\"\n  name: str\n  func: callable\n  expected_result: bool\n\n\nLOGIC_ERROR_PATCHES: list[LogicErrorPatch] = [\n    LogicErrorPatch(\n        name='control_test',\n        func=normal_patch,\n        expected_result=True,\n    ),\n    LogicErrorPatch(\n        name='sigkill_crash',\n        func=builtin_trap_crash,\n        expected_result=False,\n    ),\n    LogicErrorPatch(\n        name='sigabrt_crash',\n        func=signal_abort_crash,\n        expected_result=False,\n    ),\n    LogicErrorPatch(\n        name='sigsegv_crash',\n        func=null_write_crash,\n        expected_result=False,\n    ),\n    LogicErrorPatch(\n        name='random_return_value',\n        func=wrong_return_value,\n        expected_result=False,\n    )\n]\n\n\ndef _capture_source_control():\n  \"\"\"Capture the source directory where source control is located.\"\"\"\n\n  # List all directories under /src/\n  oss_fuzz_dirs = [\n      'aflplusplus', 'fuzztest', 'honggfuzz', 'libfuzzer', 'googletest'\n  ]\n  project_dirs = []\n  for dir_name in os.listdir('/src/'):\n    if dir_name in oss_fuzz_dirs:\n      continue\n    if os.path.isdir(os.path.join('/src/', dir_name)):\n      project_dirs.append(dir_name)\n\n  # If there is only a single new project directory, then we are\n  # almost certain this is the right directory.\n  if len(project_dirs) == 1:\n    # Check if there is a .git directory\n    if os.path.isdir(os.path.join('/src/', project_dirs[0], '.git')):\n      return ('git', os.path.join('/src/', project_dirs[0]))\n    elif os.path.isdir(os.path.join('/src/', project_dirs[0], '.svn')):\n      return ('svn', os.path.join('/src/', project_dirs[0]))\n  else:\n    print('Wrong number of directories found under /src/')\n    print(project_dirs)\n\n  if len(project_dirs) > 1:\n    print('Multiple project directories found under /src/')\n    # If we have a project name, try to use this\n    project_name = os.getenv('PROJECT_NAME', 'unknown_project')\n    if project_name in project_dirs:\n      if os.path.isdir(os.path.join('/src/', project_name, '.git')):\n        return ('git', os.path.join('/src/', project_name))\n      elif os.path.isdir(os.path.join('/src/', project_name, '.svn')):\n        return ('svn', os.path.join('/src/', project_name))\n  return None, None\n\n\ndef diff_patch_analysis(stage: str) -> int:\n  \"\"\"Check if run_tests.sh generates patches that affect\n  source control versioning.\n  \n  \n  Returns:   int: 0 if no patch found, 1 if patch found and -1 on\n            unkonwn (such as due to unsupported version control).\n  \"\"\"\n\n  print(\n      f'Diff patch analysis begin. Stage: {stage}, Current working dir: {os.getcwd()}'\n  )\n  if stage == 'before':\n    print('Diff patch analysis before stage.')\n    type, project_dir = _capture_source_control()\n    if not type:\n      print('Uknown version control system.')\n      return -1\n\n    print('%s repo found: %s' % (type, project_dir))\n    try:\n      subprocess.check_call('cd %s && %s diff ./ >> /tmp/chronos-before.diff' %\n                            (project_dir, type),\n                            shell=True)\n    except subprocess.CalledProcessError:\n      pass\n    return 0\n\n  elif stage == 'after':\n    print('Diff patch analysis after stage.')\n    type, project_dir = _capture_source_control()\n    if not type:\n      print('Uknown version control system.')\n      return -1\n\n    print('%s repo found: %s' % (type, project_dir))\n    subprocess.check_call('cd %s && %s diff ./ >> /tmp/chronos-after.diff' %\n                          (project_dir, type),\n                          shell=True)\n\n    try:\n      subprocess.check_call(\n          'diff /tmp/chronos-before.diff /tmp/chronos-after.diff > /tmp/chronos-diff.patch',\n          shell=True)\n    except subprocess.CalledProcessError:\n      pass\n    print('Diff patch generated at /tmp/chronos-diff.patch')\n    print('Difference between diffs:')\n    with open('/tmp/chronos-diff.patch', 'r', encoding='utf-8') as f:\n      diff_content = f.read()\n    if diff_content.strip():\n      patch_found = True\n      print(diff_content)\n    else:\n      patch_found = False\n\n    if patch_found:\n      print(\n          'Patch result: failed. Patch found that affects source control versioning.'\n      )\n      return 1\n    else:\n      print(\n          'Patch result: success. No patch found that affects source control versioning.'\n      )\n      return 0\n\n  else:\n    print(\n        f'Patch result: failed. Unknown stage {stage} for diff patch analysis.')\n    return -1\n\n\ndef main():\n  \"\"\"Main entrypoint.\"\"\"\n\n  project_name = os.getenv('PROJECT_NAME', 'unknown_project')\n  print(f'Integrity validator run tests for project: {project_name}')\n  command = sys.argv[1]\n  if command == 'semantic-patch':\n    target_patch = sys.argv[2]\n    for logic_error_patch in LOGIC_ERROR_PATCHES:\n      if logic_error_patch.name == target_patch:\n        logic_error_patch.func()\n  elif command == 'diff-patch':\n    print(f'Diff patching for stage %s.' % sys.argv[2])\n    result = diff_patch_analysis(sys.argv[2])\n    sys.exit(result)\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "infra/chronos/manager.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for managing Chronos cached builds.\"\"\"\n\nimport os\nimport sys\nimport logging\nimport argparse\nimport time\nimport json\nimport subprocess\n\n# Call from the core OSS-Fuzz repository:\n# PYTHONPATH=$PYTHONPATH:$PWD/infra python3 -m chronos.manager check-tests json-c\nfrom chronos import integrity_validator_check_replay\nfrom chronos import integrity_validator_run_tests\nimport common_utils\n\nlogger = logging.getLogger(__name__)\n\n\ndef _get_oss_fuzz_root():\n  \"\"\"Gets the root directory of the OSS-Fuzz repository.\"\"\"\n  return os.path.abspath(\n      os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))\n\n\ndef _get_project_cached_named(project: common_utils.Project,\n                              sanitizer='address'):\n  \"\"\"Gets the name of the cached project image.\"\"\"\n  base_name = 'us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen'\n  return f'{base_name}/{project.name}-ofg-cached-{sanitizer}'\n\n\ndef _get_project_cached_named_local(project: common_utils.Project,\n                                    sanitizer='address'):\n  return f'{project.name}-origin-{sanitizer}'\n\n\ndef build_cached_project(project: common_utils.Project,\n                         cleanup: bool = True,\n                         sanitizer: str = 'address'):\n  \"\"\"Build cached image for a project.\"\"\"\n  container_name = _get_project_cached_named_local(project, sanitizer)\n  logger.info('Building cached image for project: %s', project)\n  # Clean up the container if it exists.\n  if cleanup:\n    logger.info('Cleaning up existing container: %s', container_name)\n    cmd = ['docker', 'container', 'rm', '-f', container_name]\n    subprocess.run(cmd, check=False)\n\n  project_language = 'c++'\n  oss_fuzz_root = _get_oss_fuzz_root()\n  # Build the cached image.\n  cmd = [\n      'docker', 'run', '--env=SANITIZER=' + sanitizer,\n      '--env=CCACHE_DIR=/workspace/ccache',\n      f'--env=FUZZING_LANGUAGE={project_language}',\n      '--env=CAPTURE_REPLAY_SCRIPT=1', f'--name={container_name}',\n      f'-v={oss_fuzz_root}/ccaches/{project.name}/ccache:/workspace/ccache',\n      f'-v={oss_fuzz_root}/build/out/{project.name}/:/out/',\n      '-v=' + os.path.join(oss_fuzz_root, 'infra', 'chronos') + ':/chronos/',\n      f'gcr.io/oss-fuzz/{project.name}', '/bin/bash', '-c',\n      '/chronos/container_cache_build.sh'\n  ]\n\n  logger.info('Command: %s', ' '.join(cmd))\n  start = time.time()\n  try:\n    logger.info('Building cached container for project: %s', project.name)\n    subprocess.check_call(cmd, cwd=oss_fuzz_root)\n    end = time.time()\n    logger.info('%s vanilla build Succeeded: Duration: %.2f seconds', project,\n                end - start)\n  except subprocess.CalledProcessError:\n    end = time.time()\n    logger.info('%s vanilla build Failed: Duration: %.2f seconds', project.name,\n                end - start)\n    return False\n\n  # Save the container.\n  cmd = [\n      'docker', 'container', 'commit', '-c', \"ENV REPLAY_ENABLED=1\", '-c',\n      \"ENV CAPTURE_REPLAY_SCRIPT=1\", container_name,\n      _get_project_cached_named(project, sanitizer)\n  ]\n  logger.info('Saving image: [%s]', ' '.join(cmd))\n  try:\n    subprocess.check_call(cmd)\n\n  except subprocess.CalledProcessError as e:\n    logger.error('Failed to save cached image: %s', e)\n    return False\n  return True\n\n\ndef check_cached_replay(project: common_utils.Project,\n                        sanitizer: str = 'address',\n                        integrity_check: bool = False):\n  \"\"\"Checks if a cache build succeeds and times is.\n\n  If integrity_check is True, will run with bad patches to validate\n  the integrity of the cached replay build. The patches will perform three\n  main tasks:\n    1) A control test to ensure it's working as is.\n    2) A control test to check that we rebuild when white noise is included.\n    3) A set of bad patches that should cause the build to fail.\n  \"\"\"\n  common_utils.build_image_impl(project)\n\n  if not build_cached_project(project, sanitizer=sanitizer):\n    logger.info('Failed to build cached image for project: %s', project.name)\n    return\n\n  start = time.time()\n  cmd = [\n      'docker',\n      'run',\n      '--rm',\n      '--network',\n      'none',\n      '--env=SANITIZER=' + sanitizer,\n      '--env=FUZZING_LANGUAGE=c++',\n      '-v=' + os.path.join(_get_oss_fuzz_root(), 'build', 'out', project.name) +\n      ':/out',\n      '-v=' + os.path.join(_get_oss_fuzz_root(), 'infra', 'chronos') +\n      ':/chronos',\n      '--name=' + project.name + '-origin-' + sanitizer + '-replay-recached',\n      _get_project_cached_named(project, sanitizer),\n      '/bin/bash',\n      '-c',\n  ]\n\n  if integrity_check:\n    # Use different bad patches to test the cached replay build\n    failed = []\n    for bad_patch_name, bad_patch_map in integrity_validator_check_replay.BAD_PATCH_GENERATOR.items(\n    ):\n      # Generate bad patch command using different approaches\n      expected_rc = bad_patch_map['rc']\n      cmd_to_run = cmd[:]\n      cmd_to_run.append(\n          f'/chronos/container_patch_replay_test.sh {bad_patch_name}')\n\n      # Run the cached replay script with bad patches\n      result = subprocess.run(cmd_to_run, check=False)\n\n      if result.returncode not in expected_rc:\n        failed.append(bad_patch_name)\n        logger.info(('%s check cached replay failed on bad patches %s. '\n                     'Return code: %d. Expected return code: %s'), project.name,\n                    bad_patch_name, result.returncode, str(expected_rc))\n\n    if failed:\n      logger.info(\n          '%s check cached replay failed to detect these bad patches: %s',\n          project.name, ' '.join(failed))\n    else:\n      logger.info('%s check cached replay success to detect all bad patches.',\n                  project.name)\n  else:\n    # Normal run with no integrity check\n    logger.info('Running cached replay with no integrity check for project: %s',\n                project.name)\n    base_cmd = 'export PATH=/ccache/bin:$PATH && rm -rf /out/* && compile'\n    cmd.append(base_cmd)\n    replay_success = False\n    try:\n      subprocess.run(cmd, check=True)\n      replay_success = True\n    except subprocess.CalledProcessError as e:\n      logger.error('Failed to run cached replay: %s', e)\n      replay_success = False\n    logger.info('%s check cached replay: %s.', project.name,\n                'succeeded' if replay_success else 'failed')\n\n  end = time.time()\n  logger.info('%s check cached replay completion time: %.2f seconds',\n              project.name, (end - start))\n\n\ndef check_tests(project: common_utils.Project,\n                sanitizer: str = 'address',\n                run_full_cache_replay: bool = False,\n                integrity_check: bool = False,\n                stop_on_failure: bool = False,\n                semantic_test: bool = False):\n  \"\"\"Run the `run_tests.sh` script for a specific project. Will\n    build a cached container first.\n\n  When `integrity_check` is True, a check that validates if the `run_test.sh` changes\n  the source control of the project will be performed. That is, we want to ensure,\n  e.g. `git diff ./` has the same output before and after `run_tests.sh`.\n  Additionally, if `semantic_test` is\n  True, a set of semantic patches will be applied to the source code of the project\n  to validate if the `run_tests.sh` is able to detect them.\n  \"\"\"\n\n  script_path = os.path.join('projects', project.name, 'run_tests.sh')\n\n  if not os.path.exists(script_path):\n    logger.info('Error: The script for project \"%s\" does not exist at %s',\n                project.name, script_path)\n    sys.exit(1)\n\n  logger.info('Building image for project for use in check-tests: %s',\n              project.name)\n  # Build an OSS-Fuzz image of the project\n  if run_full_cache_replay:\n    check_cached_replay(project.name, sanitizer)\n  else:\n    common_utils.build_image_impl(project)\n\n    # build a cached version of the project\n    if not build_cached_project(project, sanitizer=sanitizer):\n      logger.info('Failed to build cached image for project: %s', project.name)\n      sys.exit(1)\n\n  # Run the test script\n  start = time.time()\n  run_tests_cmd = 'chmod +x /src/run_tests.sh && /src/run_tests.sh'\n  docker_cmd = [\n      'docker',\n      'run',\n      '--rm',\n      '--network',\n      'none',\n      '-e',\n      'PROJECT_NAME=' + project.name,\n      '-v=' + os.path.join(_get_oss_fuzz_root(), 'infra', 'chronos') +\n      ':/chronos',\n      _get_project_cached_named(project, sanitizer),\n      '/bin/bash',\n      '-c',\n  ]\n\n  if integrity_check or semantic_test:\n\n    # Run normal build_test\n    logger.info('Running normal run_tests.sh for project: %s', project.name)\n    docker_cmd_vanilla = docker_cmd[:]\n    docker_cmd_vanilla.append(run_tests_cmd)\n    try:\n      subprocess.check_call(docker_cmd_vanilla)\n      logger.info('Successfully ran run_tests.sh for project: %s', project)\n    except subprocess.CalledProcessError:\n      logger.info(\n          'run_tests.sh result failed: Failed to run vanilla run_tests.sh for project: %s',\n          project.name)\n      sys.exit(0)\n\n    # First check diffing patch. The approach here is to capture a diff before\n    # and after applying the patch, and see if there are any changes to e.g. git diff.\n    logger.info('Checking diffing patch for project: %s', project.name)\n    patch_command = (\n        'python3 -m pip install -r /chronos/requirements.txt &&'\n        'python3 /chronos/integrity_validator_run_tests.py diff-patch before')\n    cmd_to_run = docker_cmd[:]\n\n    # Capture the patch after.\n    cmd_to_run.append('/chronos/container_patch_tests_test.sh')\n    ret_code = 0\n    try:\n      subprocess.check_call(cmd_to_run)\n    except subprocess.CalledProcessError as exc:\n      ret_code = exc.returncode\n\n    succeeded_patch = ret_code == 0\n    logger.info('succeeded patch: %s', succeeded_patch)\n    if ret_code == 0:\n      patch_msg = 'run_tests.sh result succeeded: does not patch source control'\n    elif ret_code == 1:\n      patch_msg = 'run_tests.sh result failed: patches source control'\n    else:\n      patch_msg = 'run_tests.sh result uknown: unable to tell if run_tests.sh patches source control'\n    logger.info('%s', patch_msg)\n    patch_details = {\n        'check-name': 'run_tests_patches_diff',\n        'patch-message': patch_msg\n    }\n    succeeded = succeeded_patch\n    if semantic_test:\n      # Second, check semantic patching tests. This is a best effort and won't work on some\n      # projects.\n      integrity_checks = []\n      # Patch the code with some logic error and see if build_test able to detect\n      # them.\n      for logic_patch in integrity_validator_run_tests.LOGIC_ERROR_PATCHES:\n        logger.info('Checking logic patch: %s', logic_patch.name)\n        patch_command = (\n            'python3 -m pip install -r /chronos/requirements.txt &&'\n            f'python3 /chronos/integrity_validator_run_tests.py semantic-patch {logic_patch.name} && '\n            'compile')\n        cmd_to_run = docker_cmd[:]\n\n        # In the below, we will apply a set of changes in the source code, rebuild\n        # the target and then run the run_tests.sh script.\n        # The patches are meant to check the semantics of the code, but they are\n        # not bulletproof, which means they may break the build in exceptional\n        # circumstances. So, we first try to compile the code after having applied\n        # the patches, but without running the tests, and if this step fails, then\n        # we skip running the tests for this patch as well.\n        # Patch and build first.\n        cmd_to_run.append(f'set -euo pipefail && {patch_command}')\n        try:\n          subprocess.check_call(cmd_to_run)\n        except subprocess.CalledProcessError:\n          logger.info('%s skipping logic patch %s that failed to compile.',\n                      project.name, logic_patch.name)\n          integrity_checks.append({\n              'patch': logic_patch.name,\n              'result': 'compile_fail'\n          })\n          continue\n\n        # Patch and build succeeded, now proceed to patch, build and run tests in\n        # one go. This will indicate if the patch was detected by the tests or\n        # not.\n        cmd_to_run[\n            -1] = f'set -euo pipefail && {patch_command} && {run_tests_cmd}'\n        try:\n          subprocess.check_call(cmd_to_run)\n          exception_thrown = False\n        except subprocess.CalledProcessError:\n          exception_thrown = True\n\n        if ((exception_thrown and not logic_patch.expected_result) or\n            (not exception_thrown and logic_patch.expected_result)):\n          # The patch was detected by the tests as it should have been.\n          integrity_checks.append({\n              'patch': logic_patch.name,\n              'result': 'Success'\n          })\n        else:\n          if stop_on_failure:\n            logger.info(\n                '%s integrity check failed on patch %s, stopping as requested.',\n                project.name, logic_patch.name)\n            return False\n          integrity_checks.append({\n              'patch': logic_patch.name,\n              'result': 'Failed'\n          })\n\n      logger.info('%s integrity check results:', project.name)\n      for check in integrity_checks:\n        logger.info('%s integrity check patch %s result: %s', project.name,\n                    check['patch'], check['result'])\n      succeeded = any([chk['result'] == 'Success' for chk in integrity_checks])\n\n      # Print patching results as well.\n      logger.info('run_tests.sh patches version control: %s',\n                  patch_details['patch-message'])\n  else:\n    # Run normal build_test\n    docker_cmd.append(run_tests_cmd)\n    try:\n      subprocess.check_call(docker_cmd)\n      succeeded = True\n      succeeded_patch = True\n    except subprocess.CalledProcessError:\n      succeeded = False\n      succeeded_patch = False\n\n  end = time.time()\n\n  result = succeeded and succeeded_patch\n  logger.info('%s test completion %s: Duration of run_tests.sh: %.2f seconds',\n              project.name, 'failed' if not result else 'succeeded',\n              (end - start))\n\n  return result\n\n\ndef extract_test_coverage(project):\n  \"\"\"Extract code coverage report from run_tests.sh script.\"\"\"\n\n  build_cached_project(project, sanitizer='coverage')\n\n  os.makedirs(os.path.join('build', 'out', project.name), exist_ok=True)\n\n  shared_folder = os.path.join(_get_oss_fuzz_root(), 'build', 'out',\n                               project.name)\n  cmd = [\n      'docker', 'run', '--rm', '--network', 'none', '-v',\n      f'{shared_folder}:/out', '-v=' +\n      os.path.join(_get_oss_fuzz_root(), 'infra', 'chronos') + ':/chronos/',\n      _get_project_cached_named(project, 'coverage'), '/bin/bash', '-c',\n      '/chronos/container_coverage_collection.sh'\n  ]\n  try:\n    subprocess.check_call(cmd)\n  except subprocess.CalledProcessError as e:\n    logger.error('Error occurred while running coverage collection: %s', e)\n    return False\n\n  # If the summary file is created, dump the total lines covered.\n  if os.path.isfile(\n      os.path.join('build', 'out', project, 'test-html-generation',\n                   'summary.json')):\n    summary_json = os.path.join('build', 'out', project, 'test-html-generation',\n                                'summary.json')\n    with open(summary_json, 'r', encoding='utf-8') as f:\n      summary = json.load(f)\n      total_lines_covered = summary['data'][0]['totals']['lines']\n      logger.info('Total lines covered for %s: %s', project,\n                  json.dumps(total_lines_covered))\n  return True\n\n\ndef cmd_dispatcher_check_tests(args):\n  \"\"\"Dispatcher for check-tests command.\"\"\"\n  # This argument is not enabled by default in helper.py, so we set it here.\n  args.semantic_test = getattr(args, 'semantic_test', False)\n  check_tests(args.project, args.sanitizer, args.run_full_cache_replay,\n              args.integrity_check, args.stop_on_failure, args.semantic_test)\n\n\ndef cmd_dispatcher_check_replay(args):\n  \"\"\"Dispatcher for check-replay command.\"\"\"\n  check_cached_replay(args.project,\n                      args.sanitizer,\n                      integrity_check=args.integrity_check)\n\n\ndef cmd_dispatcher_build_cached_image(args):\n  \"\"\"Dispatcher for build-cached-image command.\"\"\"\n  build_cached_project(args.project, sanitizer=args.sanitizer)\n\n\ndef cmd_dispatcher_extract_coverage(args):\n  \"\"\"Dispatcher for extract-test-coverage command.\"\"\"\n  extract_test_coverage(args.project)\n\n\ndef parse_args():\n  \"\"\"Parses command line arguments for the manager script.\"\"\"\n  parser = argparse.ArgumentParser(\n      'manager.py',\n      description='Chronos Manager: a tool for managing cached OSS-Fuzz builds.'\n  )\n  subparsers = parser.add_subparsers(dest='command')\n\n  checks_test_parser = subparsers.add_parser(\n      'check-tests', help='Checks run_test.sh for specific project.')\n  checks_test_parser.add_argument(\n      'project',\n      type=str,\n      help='The name of the project to check (e.g., \"libpng\").',\n  )\n  checks_test_parser.add_argument(\n      '--stop-on-failure',\n      action='store_true',\n      help='If set, will stop integrity checks on first failure.')\n  checks_test_parser.add_argument(\n      '--sanitizer',\n      default='address',\n      help='The sanitizer to use (default: address).')\n  checks_test_parser.add_argument(\n      '--container-output',\n      choices=['silent', 'file', 'stdout'],\n      default='stdout',\n      help='How to handle output from the container. ')\n  checks_test_parser.add_argument(\n      '--run-full-cache-replay',\n      action='store_true',\n      help=\n      'If set, will run the full cache replay instead of just checking the script.'\n  )\n  checks_test_parser.add_argument(\n      '--integrity-check',\n      action='store_true',\n      help=\n      'If set, will patch and test with logic errors to ensure build integrity.'\n  )\n  checks_test_parser.add_argument(\n      '--semantic-test',\n      help=\n      'If set, will try and validate semantic correctness of run_tests.sh. This is beta for now.',\n      action='store_true')\n\n  check_replay_parser = subparsers.add_parser(\n      'check-replay',\n      help='Checks if the replay script works for a specific project.')\n\n  check_replay_parser.add_argument('project',\n                                   help='The name of the project to check.')\n  check_replay_parser.add_argument(\n      '--sanitizer',\n      default='address',\n      help='The sanitizer to use for the cached build (default: address).')\n  check_replay_parser.add_argument(\n      '--integrity-check',\n      action='store_true',\n      help='If set, will test the integrity of the replay script.')\n\n  build_cached_image_parser = subparsers.add_parser(\n      'build-cached-image',\n      help='Builds a cached image for a specific project.')\n  build_cached_image_parser.add_argument(\n      'project', help='The name of the project to build.')\n  build_cached_image_parser.add_argument(\n      '--sanitizer',\n      default='address',\n      help='The sanitizer to use for the cached build (default: address).')\n  build_cached_image_parser.add_argument(\n      '--container-output',\n      choices=['silent', 'file', 'stdout'],\n      default='stdout',\n      help='How to handle output from the container. ')\n\n  extract_coverage_parser = subparsers.add_parser(\n      'extract-test-coverage',\n      help='Extract code coverage reports from run_tests.sh script')\n  extract_coverage_parser.add_argument(\n      'project', help='The name of the project to extract coverage for.')\n\n  return parser.parse_args()\n\n\ndef main():\n  \"\"\"Main\"\"\"\n  logging.basicConfig(level=logging.INFO)\n\n  args = parse_args()\n\n  args.project = common_utils.Project(args.project, False)\n\n  dispatch_map = {\n      'check-tests': cmd_dispatcher_check_tests,\n      'check-replay': cmd_dispatcher_check_replay,\n      'build-cached-image': cmd_dispatcher_build_cached_image,\n      'extract-test-coverage': cmd_dispatcher_extract_coverage\n  }\n\n  dispatch_cmd = dispatch_map.get(args.command, None)\n  if not dispatch_cmd:\n    logger.error('Unknown command: %s', args.command)\n    sys.exit(1)\n  logger.info('Dispatching command: %s', args.command)\n  dispatch_cmd(args)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/chronos/requirements.txt",
    "content": "tree-sitter==0.25.1\ntree-sitter-cpp==0.23.4\nrequests==2.32.5\n"
  },
  {
    "path": "infra/ci/build.py",
    "content": "#!/usr/bin/env python\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Build modified projects.\"\"\"\n\nfrom __future__ import print_function\n\nimport enum\nimport os\nimport re\nimport sys\nimport subprocess\nimport yaml\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport constants\n\nCANARY_PROJECT = 'skcms'\n\nDEFAULT_ARCHITECTURES = ['x86_64']\nDEFAULT_ENGINES = ['afl', 'honggfuzz', 'libfuzzer', 'centipede']\nDEFAULT_SANITIZERS = ['address', 'undefined']\n\n\ndef get_changed_files_output():\n  \"\"\"Returns the output of a git command that discovers changed files.\"\"\"\n  branch_commit_hash = subprocess.check_output(\n      ['git', 'merge-base', 'HEAD', 'origin/HEAD']).strip().decode()\n\n  return subprocess.check_output(\n      ['git', 'diff', '--name-only', branch_commit_hash + '..']).decode()\n\n\ndef get_modified_buildable_projects():\n  \"\"\"Returns a list of all the projects modified in this commit that have a\n  build.sh file.\"\"\"\n  git_output = get_changed_files_output()\n  projects_regex = '.*projects/(?P<name>.*)/.*\\n'\n  modified_projects = set(re.findall(projects_regex, git_output))\n  projects_dir = os.path.join(get_oss_fuzz_root(), 'projects')\n  # Filter out projects without Dockerfile files since new projects and reverted\n  # projects frequently don't have them. In these cases we don't want Travis's\n  # builds to fail.\n  modified_buildable_projects = []\n  for project in modified_projects:\n    if not os.path.exists(os.path.join(projects_dir, project, 'Dockerfile')):\n      print('Project {0} does not have Dockerfile. skipping build.'.format(\n          project))\n      continue\n    modified_buildable_projects.append(project)\n  return modified_buildable_projects\n\n\ndef get_oss_fuzz_root():\n  \"\"\"Get the absolute path of the root of the oss-fuzz checkout.\"\"\"\n  script_path = os.path.realpath(__file__)\n  return os.path.abspath(\n      os.path.dirname(os.path.dirname(os.path.dirname(script_path))))\n\n\ndef execute_helper_command(helper_command):\n  \"\"\"Execute |helper_command| using helper.py.\"\"\"\n  root = get_oss_fuzz_root()\n  script_path = os.path.join(root, 'infra', 'helper.py')\n  command = ['python', script_path] + helper_command\n  print('Running command: %s' % ' '.join(command))\n  subprocess.check_call(command)\n\n\ndef build_fuzzers(project, engine, sanitizer, architecture):\n  \"\"\"Execute helper.py's build_fuzzers command on |project|. Build the fuzzers\n  with |engine| and |sanitizer| for |architecture|.\"\"\"\n  execute_helper_command([\n      'build_fuzzers', project, '--engine', engine, '--sanitizer', sanitizer,\n      '--architecture', architecture\n  ])\n\n\ndef check_build(project, engine, sanitizer, architecture):\n  \"\"\"Execute helper.py's check_build command on |project|, assuming it was most\n  recently built with |engine| and |sanitizer| for |architecture|.\"\"\"\n  execute_helper_command([\n      'check_build', project, '--engine', engine, '--sanitizer', sanitizer,\n      '--architecture', architecture\n  ])\n\n\ndef should_build_coverage(project_yaml):\n  \"\"\"Returns True if a coverage build should be done based on project.yaml\n  contents.\"\"\"\n  # Enable coverage builds on projects that use engines. Those that don't use\n  # engines shouldn't get coverage builds.\n  engines = project_yaml.get('fuzzing_engines', DEFAULT_ENGINES)\n  engineless = 'none' in engines\n  if engineless:\n    assert_message = ('Forbidden to specify multiple engines for '\n                      '\"fuzzing_engines\" if \"none\" is specified.')\n    assert len(engines) == 1, assert_message\n    return False\n  if 'wycheproof' in engines:\n    return False\n\n  language = project_yaml.get('language')\n  if language not in constants.LANGUAGES_WITH_COVERAGE_SUPPORT:\n    print(('Project is written in \"{language}\", '\n           'coverage is not supported yet.').format(language=language))\n    return False\n\n  return True\n\n\ndef flatten_options(option_list):\n  \"\"\"Generator that flattens |option_list| (a list of sanitizers, architectures\n  or fuzzing engines) by returning each element in the list that isn't a\n  dictionary. For elements that are dictionaries, the sole key is returned.\"\"\"\n  result = []\n  for option in option_list:\n    if isinstance(option, dict):\n      keys = list(option.keys())\n      assert len(keys) == 1\n      result.append(keys[0])\n      continue\n    result.append(option)\n  print(result)\n  return result\n\n\ndef should_build(project_yaml):\n  \"\"\"Returns True on if the build specified is enabled in the project.yaml.\"\"\"\n\n  if os.getenv('SANITIZER') == 'coverage':\n    # This assumes we only do coverage builds with libFuzzer on x86_64.\n    return should_build_coverage(project_yaml)\n\n  def is_enabled(env_var, yaml_name, defaults):\n    \"\"\"Is the value of |env_var| enabled in |project_yaml| (in the |yaml_name|\n    section)? Uses |defaults| if |yaml_name| section is unspecified.\"\"\"\n    return os.getenv(env_var) in flatten_options(\n        project_yaml.get(yaml_name, defaults))\n\n  return (is_enabled('ENGINE', 'fuzzing_engines', DEFAULT_ENGINES) and\n          is_enabled('SANITIZER', 'sanitizers', DEFAULT_SANITIZERS) and\n          is_enabled('ARCHITECTURE', 'architectures', DEFAULT_ARCHITECTURES))\n\n\ndef build_project(project):\n  \"\"\"Do the build of |project| that is specified by the environment variables -\n  SANITIZER, ENGINE, and ARCHITECTURE.\"\"\"\n  root = get_oss_fuzz_root()\n  project_yaml_path = os.path.join(root, 'projects', project, 'project.yaml')\n  with open(project_yaml_path) as file_handle:\n    project_yaml = yaml.safe_load(file_handle)\n\n  if project_yaml.get('disabled', False):\n    print('Project {0} is disabled, skipping build.'.format(project))\n    return\n\n  engine = os.getenv('ENGINE')\n  sanitizer = os.getenv('SANITIZER')\n  architecture = os.getenv('ARCHITECTURE')\n\n  if not should_build(project_yaml):\n    print(('Specified build: engine: {0}, sanitizer: {1}, architecture: {2} '\n           'not enabled for this project: {3}. Skipping build.').format(\n               engine, sanitizer, architecture, project))\n\n    return\n\n  print('Building project', project)\n  build_fuzzers(project, engine, sanitizer, architecture)\n\n  run_tests = project_yaml.get('run_tests', True)\n  if engine != 'none' and sanitizer != 'coverage' and run_tests:\n    check_build(project, engine, sanitizer, architecture)\n\n\nclass BuildModifiedProjectsResult(enum.Enum):\n  \"\"\"Enum containing the return values of build_modified_projects().\"\"\"\n  NONE_BUILT = 0\n  BUILD_SUCCESS = 1\n  BUILD_FAIL = 2\n\n\ndef build_modified_projects():\n  \"\"\"Build modified projects. Returns BuildModifiedProjectsResult.NONE_BUILT if\n  no builds were attempted. Returns BuildModifiedProjectsResult.BUILD_SUCCESS if\n  all attempts succeed, otherwise returns\n  BuildModifiedProjectsResult.BUILD_FAIL.\"\"\"\n  projects = get_modified_buildable_projects()\n  if not projects:\n    return BuildModifiedProjectsResult.NONE_BUILT\n\n  failed_projects = []\n  for project in projects:\n    try:\n      build_project(project)\n    except subprocess.CalledProcessError:\n      failed_projects.append(project)\n\n  if failed_projects:\n    print('Failed projects:', ' '.join(failed_projects))\n    return BuildModifiedProjectsResult.BUILD_FAIL\n\n  return BuildModifiedProjectsResult.BUILD_SUCCESS\n\n\ndef is_infra_changed():\n  \"\"\"Returns True if the infra directory was changed.\"\"\"\n  git_output = get_changed_files_output()\n  infra_code_regex = '.*infra/.*\\n'\n  return re.search(infra_code_regex, git_output) is not None\n\n\ndef build_base_images():\n  \"\"\"Builds base images.\"\"\"\n  # TODO(jonathanmetzman): Investigate why caching fails so often and\n  # when we improve it, build base-clang as well. Also, move this function\n  # to a helper command when we can support base-clang.\n  execute_helper_command(['pull_images'])\n  images = [\n      'base-image',\n      'base-builder',\n      'base-builder-go',\n      'base-builder-javascript',\n      'base-builder-jvm',\n      'base-builder-python',\n      'base-builder-rust',\n      'base-builder-swift',\n      'base-builder-ruby',\n      'base-runner',\n  ]\n  for image in images:\n    try:\n      execute_helper_command(['build_image', image, '--no-pull', '--cache'])\n    except subprocess.CalledProcessError:\n      return 1\n\n  return 0\n\n\ndef build_canary_project():\n  \"\"\"Builds a specific project when infra/ is changed to verify that infra/\n  changes don't break things. Returns False if build was attempted but\n  failed.\"\"\"\n\n  try:\n    build_project('skcms')\n  except subprocess.CalledProcessError:\n    return False\n\n  return True\n\n\ndef main():\n  \"\"\"Build modified projects or canary project.\"\"\"\n  os.environ['OSS_FUZZ_CI'] = '1'\n  infra_changed = is_infra_changed()\n  if infra_changed:\n    print('Pulling and building base images first.')\n    if build_base_images():\n      return 1\n\n  result = build_modified_projects()\n  if result == BuildModifiedProjectsResult.BUILD_FAIL:\n    return 1\n\n  # It's unnecessary to build the canary if we've built any projects already.\n  no_projects_built = result == BuildModifiedProjectsResult.NONE_BUILT\n  should_build_canary = no_projects_built and infra_changed\n  if should_build_canary and not build_canary_project():\n    return 1\n\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/ci/build_test.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Tests for build.py\"\"\"\n\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\n# pylint: disable=wrong-import-position\nINFRA_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nsys.path.append(INFRA_DIR)\n\nfrom ci import build\n\n\ndef patch_environ(testcase_obj):\n  \"\"\"Patch environment.\"\"\"\n  env = {}\n  patcher = mock.patch.dict(os.environ, env)\n  testcase_obj.addCleanup(patcher.stop)\n  patcher.start()\n\n\ndef _set_coverage_build():\n  \"\"\"Set the right environment variables for a coverage build.\"\"\"\n  os.environ['SANITIZER'] = 'coverage'\n  os.environ['ENGINE'] = 'libfuzzer'\n  os.environ['ARCHITECTURE'] = 'x86_64'\n\n\nclass TestShouldBuild(unittest.TestCase):\n  \"\"\"Tests that should_build() works as intended.\"\"\"\n\n  def setUp(self):\n    patch_environ(self)\n\n  def test_none_engine_coverage_build(self):\n    \"\"\"Tests that should_build returns False for a coverage build of a\n    project that specifies 'none' for fuzzing_engines.\"\"\"\n    _set_coverage_build()\n    project_yaml = {\n        'language': 'c++',\n        'fuzzing_engines': ['none'],\n        'sanitizers': ['address']\n    }\n    self.assertFalse(build.should_build(project_yaml))\n\n  def test_unspecified_engines_coverage_build(self):\n    \"\"\"Tests that should_build returns True for a coverage build of a\n    project that doesn't specify fuzzing_engines.\"\"\"\n    _set_coverage_build()\n    project_yaml = {'language': 'c++'}\n    self.assertTrue(build.should_build(project_yaml))\n\n  def test_libfuzzer_coverage_build(self):\n    \"\"\"Tests that should_build returns True for coverage build of a project\n    specifying 'libfuzzer' for fuzzing_engines.\"\"\"\n    _set_coverage_build()\n    project_yaml = {\n        'language': 'c++',\n        'fuzzing_engines': ['libfuzzer'],\n        'sanitizers': ['address']\n    }\n    self.assertTrue(build.should_build(project_yaml))\n\n  def test_go_coverage_build(self):\n    \"\"\"Tests that should_build returns True for coverage build of a project\n    specifying 'libfuzzer' for fuzzing_engines.\"\"\"\n    _set_coverage_build()\n    project_yaml = {'language': 'go'}\n    self.assertTrue(build.should_build(project_yaml))\n\n  def test_engine_project_none_build(self):\n    \"\"\"Tests that should_build returns False for an engine: 'none' build when\n    the project doesn't specify engines.\"\"\"\n    os.environ['SANITIZER'] = 'address'\n    os.environ['ENGINE'] = 'none'\n    os.environ['ARCHITECTURE'] = 'x86_64'\n    project_yaml = {\n        'language': 'c++',\n        'fuzzing_engines': ['libfuzzer'],\n        'sanitizers': ['address']\n    }\n    self.assertFalse(build.should_build(project_yaml))\n\n  def test_centipede_none_build(self):\n    \"\"\"Tests that should_build returns True for none sanitizer build of a\n    project specifying 'centipede' for fuzzing_engines.\"\"\"\n    os.environ['SANITIZER'] = 'none'\n    os.environ['ENGINE'] = 'centipede'\n    os.environ['ARCHITECTURE'] = 'x86_64'\n    project_yaml = {\n        'language': 'c++',\n        'fuzzing_engines': ['centipede'],\n        'sanitizers': ['none']\n    }\n    self.assertTrue(build.should_build(project_yaml))\n\n  def test_centipede_address_build(self):\n    \"\"\"Tests that should_build returns True for address sanitizer build of a\n    project specifying 'centipede' for fuzzing_engines.\"\"\"\n    os.environ['SANITIZER'] = 'address'\n    os.environ['ENGINE'] = 'centipede'\n    os.environ['ARCHITECTURE'] = 'x86_64'\n    project_yaml = {\n        'language': 'c++',\n        'fuzzing_engines': ['centipede'],\n        'sanitizers': ['address']\n    }\n    self.assertTrue(build.should_build(project_yaml))\n"
  },
  {
    "path": "infra/ci/check_base_os.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"\nA CI script to ensure that the base OS version specified in a project's\nproject.yaml file matches the FROM line in its Dockerfile.\n\"\"\"\n\nimport os\nimport sys\nimport yaml\n\n# Defines the base OS versions that are currently supported for use in project.yaml.\n# For now, only 'legacy' is permitted. This list will be expanded as new\n# base images are rolled out.\nSUPPORTED_VERSIONS = [\n    'legacy',\n    # 'ubuntu-20-04',\n    'ubuntu-24-04',\n]\n\n# A map from the base_os_version in project.yaml to the expected Dockerfile\n# FROM tag.\nBASE_OS_TO_DOCKER_TAG = {\n    'legacy': 'latest',\n    'ubuntu-20-04': 'ubuntu-20-04',\n    'ubuntu-24-04': 'ubuntu-24-04',\n}\n\n\ndef main():\n  \"\"\"Checks the Dockerfile FROM tag against the project's base_os_version.\"\"\"\n  if len(sys.argv) < 2:\n    print(f'Usage: {sys.argv[0]} <project_path>', file=sys.stderr)\n    return 1\n\n  project_path = sys.argv[1]\n  project_yaml_path = os.path.join(project_path, 'project.yaml')\n  dockerfile_path = os.path.join(project_path, 'Dockerfile')\n\n  # 1. Get the base_os_version from project.yaml, defaulting to 'legacy'.\n  base_os_version = 'legacy'\n  if os.path.exists(project_yaml_path):\n    with open(project_yaml_path) as f:\n      config = yaml.safe_load(f)\n      if config and 'base_os_version' in config:\n        base_os_version = config['base_os_version']\n\n  # 2. Validate that the version is currently supported.\n  if base_os_version not in SUPPORTED_VERSIONS:\n    print(\n        f'Error: base_os_version \"{base_os_version}\" is not yet supported. '\n        f'The currently supported versions are: \"{\", \".join(SUPPORTED_VERSIONS)}\"',\n        file=sys.stderr)\n    return 1\n\n  # 3. Get the expected Dockerfile tag from our mapping.\n  expected_tag = BASE_OS_TO_DOCKER_TAG[base_os_version]\n\n  # 4. Read the Dockerfile and find the tag in the FROM line.\n  if not os.path.exists(dockerfile_path):\n    print(f'Error: Dockerfile not found at {dockerfile_path}', file=sys.stderr)\n    return 1\n\n  dockerfile_tag = ''\n  with open(dockerfile_path) as f:\n    for line in f:\n      if line.strip().startswith('FROM'):\n        try:\n          if ':' not in line:\n            print(\n                f'Error: Malformed FROM line in Dockerfile (missing tag): {line.strip()}',\n                file=sys.stderr)\n            return 1\n          dockerfile_tag = line.split(':')[1].strip()\n        except IndexError:\n          print(f'Error: Could not parse tag from Dockerfile FROM line: {line}',\n                file=sys.stderr)\n          return 1\n        break\n\n  # 5. Compare and report.\n  if dockerfile_tag != expected_tag:\n    print(\n        f'Error: Mismatch found in {project_path}.\\n'\n        f'  - project.yaml (base_os_version): \"{base_os_version}\" (expects Dockerfile tag \"{expected_tag}\")\\n'\n        f'  - Dockerfile FROM tag: \"{dockerfile_tag}\"\\n'\n        f'Please align the Dockerfile\\'s FROM line to use the tag \"{expected_tag}\".',\n        file=sys.stderr)\n    return 1\n\n  print(\n      f'Success: {project_path} is consistent (base_os_version: \"{base_os_version}\", Dockerfile tag: \"{dockerfile_tag}\").'\n  )\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/ci/requirements.txt",
    "content": "# Requirements for submitting code changes to infra/ (needed by presubmit.py).\nparameterized==0.7.4\npyfakefs==5.8.0\npylint==3.3.7\npytest==7.1.2\npytest-xdist==2.5.0\nPyYAML==6.0.2\nrequests==2.31.0\nyapf==0.43.0\n"
  },
  {
    "path": "infra/cifuzz/CHANGELOG",
    "content": "\tNext Release:\n\n\tImprove detection of changed files better by fixing https://github.com/google/oss-fuzz/issues/7011\n"
  },
  {
    "path": "infra/cifuzz/actions/build_fuzzers/action.yml",
    "content": "# action.yml\nname: 'build-fuzzers'\ndescription: \"Builds an OSS-Fuzz project's fuzzers.\"\ninputs:\n  oss-fuzz-project-name:\n    description: 'Name of the corresponding OSS-Fuzz project.'\n    required: true\n  language:\n    description: 'Programming language project is written in.'\n    required: false\n    default: 'c++'\n  dry-run:\n    description: 'If set, run the action without actually reporting a failure.'\n    default: false\n  allowed-broken-targets-percentage:\n    description: 'The percentage of broken targets allowed in bad_build_check.'\n    required: false\n  sanitizer:\n    description: 'The sanitizer to build the fuzzers with.'\n    default: 'address'\n  architecture:\n    description: 'The architecture used to build the fuzzers.'\n    default: 'x86_64'\n  project-src-path:\n    description: \"The path to the project's source code checkout.\"\n    required: false\n  bad-build-check:\n    description: \"Whether or not OSS-Fuzz's check for bad builds should be done.\"\n    required: false\n    default: true\n  keep-unaffected-fuzz-targets:\n    description: \"Whether to keep unaffected fuzzers or delete them.\"\n    required: false\n    default: false\n  output-sarif:\n    description: \"Whether to output fuzzing results to SARIF.\"\n    required: false\n    default: false\nruns:\n  using: 'docker'\n  image: '../../../build_fuzzers.Dockerfile'\n  env:\n    OSS_FUZZ_PROJECT_NAME: ${{ inputs.oss-fuzz-project-name }}\n    LANGUAGE: ${{ inputs.language }}\n    DRY_RUN: ${{ inputs.dry-run}}\n    ALLOWED_BROKEN_TARGETS_PERCENTAGE: ${{ inputs.allowed-broken-targets-percentage}}\n    SANITIZER: ${{ inputs.sanitizer }}\n    ARCHITECTURE: ${{ inputs.architecture }}\n    PROJECT_SRC_PATH: ${{ inputs.project-src-path }}\n    LOW_DISK_SPACE: 'True'\n    BAD_BUILD_CHECK: ${{ inputs.bad-build-check }}\n    CIFUZZ_DEBUG: 'True'\n    CFL_PLATFORM: 'github'\n    KEEP_UNAFFECTED_FUZZ_TARGETS: ${{ inputs.keep-unaffected-fuzz-targets }}\n    OUTPUT_SARIF: ${{ inputs.output-sarif }}\n"
  },
  {
    "path": "infra/cifuzz/actions/run_fuzzers/action.yml",
    "content": "# action.yml\nname: 'run-fuzzers'\ndescription: 'Runs fuzz target binaries for a specified length of time.'\ninputs:\n  oss-fuzz-project-name:\n    description: 'The OSS-Fuzz project name.'\n    required: true\n  language:\n    description: 'Programming language project is written in.'\n    required: false\n    default: 'c++'\n  fuzz-seconds:\n    description: 'The total time allotted for fuzzing in seconds.'\n    required: true\n    default: 600\n  dry-run:\n    description: 'If set, run the action without actually reporting a failure.'\n    default: false\n  sanitizer:\n    description: 'The sanitizer to run the fuzzers with.'\n    default: 'address'\n  mode:\n    description: |\n      The mode to run the fuzzers with (\"code-change\", \"batch\", \"coverage\", or \"prune\").\n      \"code-change\" is for fuzzing a pull request or commit.\n      \"batch\" is for non-interactive fuzzing of an entire project.\n      \"coverage\" is for coverage generation.\n      \"prune\" is for corpus pruning.\n    required: false\n    default: 'code-change'\n  github-token:\n    description: |\n      Token for GitHub API. WARNING: THIS SHOULD NOT BE USED IN PRODUCTION YET\n      You should use \"secrets.GITHUB_TOKEN\" in your workflow file, do not\n      hardcode the token.\n      TODO(https://github.com/google/oss-fuzz/pull/5841#discussion_r639393361):\n      Document locking this down.\n    required: false\n  report-unreproducible-crashes:\n    description: 'If True, then unreproducible crashes will be reported.'\n    required: false\n    default: False\n  minimize-crashes:\n    description: 'If True, reportable crashes will be minimized.'\n    required: false\n    default: False\n  parallel-fuzzing:\n    description: \"How many cores to use cores for fuzzing. A specific number, True - all available cores or False to run single threaded on a single core.\"\n    required: false\n    default: false\n  output-sarif:\n    description: \"Whether to output fuzzing results to SARIF.\"\n    required: false\n    default: false\n  report-timeouts:\n    description: \"Whether to report fails due to timeout.\"\n    required: false\n    default: true\n  report-ooms:\n    description: \"Whether to report fails due to OOM.\"\n    required: false\n    default: true\nruns:\n  using: 'docker'\n  image: '../../../run_fuzzers.Dockerfile'\n  env:\n    OSS_FUZZ_PROJECT_NAME: ${{ inputs.oss-fuzz-project-name }}\n    LANGUAGE: ${{ inputs.language }}\n    FUZZ_SECONDS: ${{ inputs.fuzz-seconds }}\n    DRY_RUN: ${{ inputs.dry-run}}\n    SANITIZER: ${{ inputs.sanitizer }}\n    MODE: ${{ inputs.mode }}\n    GITHUB_TOKEN: ${{ inputs.github-token }}\n    LOW_DISK_SPACE: 'True'\n    REPORT_UNREPRODUCIBLE_CRASHES: ${{ inputs.report-unreproducible-crashes }}\n    MINIMIZE_CRASHES: ${{ inputs.minimize-crashes }}\n    CIFUZZ_DEBUG: 'True'\n    CFL_PLATFORM: 'github'\n    PARALLEL_FUZZING: ${{ inputs.parallel-fuzzing }}\n    OUTPUT_SARIF: ${{ inputs.output-sarif }}\n    REPORT_TIMEOUTS: ${{ inputs.report-timeouts }}\n    REPORT_OOMS: ${{ inputs.report-ooms}}\n"
  },
  {
    "path": "infra/cifuzz/affected_fuzz_targets.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for dealing with fuzz targets affected by the change-under-test\n(CUT).\"\"\"\nimport logging\nimport os\nimport sys\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nimport utils\n\n\ndef remove_unaffected_fuzz_targets(clusterfuzz_deployment, out_dir,\n                                   files_changed, repo_path):\n  \"\"\"Removes all non affected fuzz targets in the out directory.\n\n  Args:\n    clusterfuzz_deployment: The ClusterFuzz deployment object.\n    out_dir: The location of the fuzz target binaries.\n    files_changed: A list of files changed compared to HEAD.\n    repo_path: The location of the OSS-Fuzz repo in the docker image.\n\n  This function will not delete fuzz targets unless it knows that the fuzz\n  targets are unaffected. For example, this means that fuzz targets which don't\n  have coverage data on will not be deleted.\n  \"\"\"\n  if not files_changed:\n    # Don't remove any fuzz targets if there is no difference from HEAD.\n    logging.info('No files changed compared to HEAD.')\n    return\n\n  logging.info('Files changed in PR: %s', files_changed)\n\n  fuzz_target_paths = utils.get_fuzz_targets(out_dir)\n  if not fuzz_target_paths:\n    # Nothing to remove.\n    logging.error('No fuzz targets found in out dir.')\n    return\n\n  coverage = clusterfuzz_deployment.get_coverage(repo_path)\n  if not coverage:\n    # Don't remove any fuzz targets unless we have data.\n    logging.error('Could not find latest coverage report.')\n    return\n\n  affected_fuzz_targets = get_affected_fuzz_targets(coverage, fuzz_target_paths,\n                                                    files_changed)\n\n  if not affected_fuzz_targets:\n    logging.info('No affected fuzz targets detected, keeping all as fallback.')\n    return\n\n  logging.info('Using affected fuzz targets: %s.', affected_fuzz_targets)\n  unaffected_fuzz_targets = set(fuzz_target_paths) - affected_fuzz_targets\n  logging.info('Removing unaffected fuzz targets: %s.', unaffected_fuzz_targets)\n\n  # Remove all the targets that are not affected.\n  for fuzz_target_path in unaffected_fuzz_targets:\n    try:\n      os.remove(fuzz_target_path)\n    except OSError as error:\n      logging.error('%s occurred while removing file %s', error,\n                    fuzz_target_path)\n\n\ndef is_fuzz_target_affected(coverage, fuzz_target_path, files_changed):\n  \"\"\"Returns True if a fuzz target (|fuzz_target_path|) is affected by\n  |files_changed|.\"\"\"\n  fuzz_target = os.path.basename(fuzz_target_path)\n  covered_files = coverage.get_files_covered_by_target(fuzz_target)\n  if not covered_files:\n    # Assume a fuzz target is affected if we can't get its coverage from\n    # OSS-Fuzz.\n    # TODO(metzman): Figure out what we should do if covered_files is [].\n    # Should we act as if we couldn't get the coverage?\n    logging.info('Could not get coverage for %s. Treating as affected.',\n                 fuzz_target)\n    return True\n\n  covered_files = [\n      os.path.normpath(covered_file) for covered_file in covered_files\n  ]\n  logging.info('Fuzz target %s is affected by: %s', fuzz_target, covered_files)\n  for filename in files_changed:\n    if filename in covered_files:\n      logging.info('Fuzz target %s is affected by changed file: %s',\n                   fuzz_target, filename)\n      return True\n\n  logging.info('Fuzz target %s is not affected.', fuzz_target)\n  return False\n\n\ndef get_affected_fuzz_targets(coverage, fuzz_target_paths, files_changed):\n  \"\"\"Returns a list of paths of affected targets.\"\"\"\n  affected_fuzz_targets = set()\n  for fuzz_target_path in fuzz_target_paths:\n    if is_fuzz_target_affected(coverage, fuzz_target_path, files_changed):\n      affected_fuzz_targets.add(fuzz_target_path)\n\n  return affected_fuzz_targets\n"
  },
  {
    "path": "infra/cifuzz/affected_fuzz_targets_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for affected_fuzz_targets.py\"\"\"\nimport os\nimport shutil\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport parameterized\n\nimport affected_fuzz_targets\nimport clusterfuzz_deployment\nimport get_coverage\nimport test_helpers\nimport workspace_utils\n\n# pylint: disable=protected-access\n\n# NOTE: This integration test relies on\n# https://github.com/google/oss-fuzz/tree/master/projects/example project.\nEXAMPLE_PROJECT = 'example'\n\nEXAMPLE_FILE_CHANGED = 'test.txt'\n\nTEST_DATA_OUT_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n                                  'test_data', 'build-out')\n\n\nclass RemoveUnaffectedFuzzTargetsTest(unittest.TestCase):\n  \"\"\"Tests remove_unaffected_fuzzers.\"\"\"\n\n  TEST_FUZZER_1 = os.path.join(TEST_DATA_OUT_PATH, 'example_crash_fuzzer')\n  TEST_FUZZER_2 = os.path.join(TEST_DATA_OUT_PATH, 'example_nocrash_fuzzer')\n\n  # yapf: disable\n  @parameterized.parameterized.expand([\n      # Tests specific affected fuzzers are kept.\n      ([[EXAMPLE_FILE_CHANGED], None], 2,),\n\n      # Tests specific affected fuzzer is kept.\n      ([[EXAMPLE_FILE_CHANGED], ['not/a/real/file']], 1),\n\n      # Tests all fuzzers are kept if none are deemed affected.\n      ([None, None], 2),\n\n      # Tests that multiple fuzzers are kept if multiple fuzzers are affected.\n      ([[EXAMPLE_FILE_CHANGED], [EXAMPLE_FILE_CHANGED]], 2),\n      ])\n  # yapf: enable\n  def test_remove_unaffected_fuzz_targets(self, side_effect, expected_dir_len):\n    \"\"\"Tests that remove_unaffected_fuzzers has the intended effect.\"\"\"\n    config = test_helpers.create_run_config(\n        cfl_platform='github',\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        workspace='/workspace')\n    workspace = workspace_utils.Workspace(config)\n    deployment = clusterfuzz_deployment.get_clusterfuzz_deployment(\n        config, workspace)\n    # We can't use fakefs in this test because this test executes\n    # utils.is_fuzz_target_local. This function relies on the executable bit\n    # being set, which doesn't work properly in fakefs.\n    with tempfile.TemporaryDirectory() as tmp_dir, mock.patch(\n        'get_coverage.OSSFuzzCoverage.get_files_covered_by_target'\n    ) as mock_get_files:\n      with mock.patch('get_coverage._get_oss_fuzz_fuzzer_stats_dir_url',\n                      return_value=1):\n        mock_get_files.side_effect = side_effect\n        shutil.copy(self.TEST_FUZZER_1, tmp_dir)\n        shutil.copy(self.TEST_FUZZER_2, tmp_dir)\n\n        affected_fuzz_targets.remove_unaffected_fuzz_targets(\n            deployment, tmp_dir, [EXAMPLE_FILE_CHANGED], '')\n        self.assertEqual(expected_dir_len, len(os.listdir(tmp_dir)))\n\n\nclass IsFuzzTargetAffectedTest(unittest.TestCase):\n  \"\"\"Tests for is_fuzz_target_affected.\"\"\"\n\n  def setUp(self):\n    self.fuzz_target_path = '/fuzz_target'\n\n  def test_relative_paths(self):\n    \"\"\"Tests that is_fuzz_target_affected works as intended when the covered\n    files are relative paths.\"\"\"\n    with mock.patch.object(\n        get_coverage.FilesystemCoverage,\n        'get_files_covered_by_target',\n    ) as get_files_covered_by_target:\n      get_files_covered_by_target.return_value = [\n          '/work/build/../../src/systemd/src/basic/alloc-util.c'\n      ]\n      coverage = get_coverage.FilesystemCoverage('/', '/')\n\n      self.assertTrue(\n          affected_fuzz_targets.is_fuzz_target_affected(\n              coverage, self.fuzz_target_path,\n              ['/src/systemd/src/basic/alloc-util.c']))\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/cifuzz/base_runner_utils.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Utilities for scripts from gcr.io/oss-fuzz-base/base-runner.\"\"\"\n\nimport os\n\nimport config_utils\n\n\ndef get_env(config, workspace):\n  \"\"\"Returns a dictionary containing the current environment with additional env\n  vars set to values needed to run a fuzzer.\"\"\"\n  env = os.environ.copy()\n  env['SANITIZER'] = config.sanitizer\n  env['FUZZING_LANGUAGE'] = config.language\n  env['OUT'] = workspace.out\n  env['CIFUZZ'] = 'True'\n  env['FUZZING_ENGINE'] = config_utils.DEFAULT_ENGINE\n  env['ARCHITECTURE'] = config.architecture\n  # Do this so we don't fail in tests.\n  env['FUZZER_ARGS'] = '-rss_limit_mb=2560 -timeout=25'\n  return env\n"
  },
  {
    "path": "infra/cifuzz/build-images.sh",
    "content": "#! /bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Script for building the docker images for cifuzz.\n\nCIFUZZ_DIR=$(dirname \"$0\")\nCIFUZZ_DIR=$(realpath $CIFUZZ_DIR)\nINFRA_DIR=$(realpath $CIFUZZ_DIR/..)\nOSS_FUZZ_ROOT=$(realpath $INFRA_DIR/..)\n\n# Build cifuzz-base.\ndocker build --tag gcr.io/oss-fuzz-base/cifuzz-base --file $CIFUZZ_DIR/cifuzz-base/Dockerfile $OSS_FUZZ_ROOT\ndocker build --tag gcr.io/oss-fuzz-base/cifuzz-base:ubuntu-24-04 --file $CIFUZZ_DIR/cifuzz-base/ubuntu-24-04.Dockerfile $OSS_FUZZ_ROOT\n\n# Build run-fuzzers and build-fuzzers images.\ndocker build \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers-test:v1 \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:v1 \\\n  --file $INFRA_DIR/build_fuzzers.Dockerfile $INFRA_DIR\ndocker build \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers-test:ubuntu-24-04-v1 \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:ubuntu-24-04-v1 \\\n  --file $INFRA_DIR/build_fuzzers.ubuntu-24-04.Dockerfile $INFRA_DIR\ndocker build \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:v1 \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers-test:v1 \\\n  --file $INFRA_DIR/run_fuzzers.Dockerfile $INFRA_DIR\ndocker build \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:ubuntu-24-04-v1 \\\n  --tag gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers-test:ubuntu-24-04-v1 \\\n  --file $INFRA_DIR/run_fuzzers.ubuntu-24-04.Dockerfile $INFRA_DIR\n"
  },
  {
    "path": "infra/cifuzz/build_fuzzers.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module used by CI tools in order to interact with fuzzers. This module helps\nCI tools to build fuzzers.\"\"\"\n\nimport logging\nimport os\nimport sys\n\nimport affected_fuzz_targets\nimport base_runner_utils\nimport clusterfuzz_deployment\nimport continuous_integration\nimport docker\nimport logs\nimport workspace_utils\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nimport helper\nimport utils\n\nlogs.init()\n\n\ndef check_project_src_path(project_src_path):\n  \"\"\"Returns True if |project_src_path| exists.\"\"\"\n  if not os.path.exists(project_src_path):\n    logging.error(\n        'PROJECT_SRC_PATH: %s does not exist. '\n        'Are you mounting it correctly?', project_src_path)\n    return False\n  return True\n\n\n# pylint: disable=too-many-arguments\n\n\nclass Builder:  # pylint: disable=too-many-instance-attributes\n  \"\"\"Class for fuzzer builders.\"\"\"\n\n  def __init__(self, config, ci_system):\n    self.config = config\n    self.ci_system = ci_system\n    self.workspace = workspace_utils.Workspace(config)\n    self.workspace.initialize_dir(self.workspace.out)\n    self.workspace.initialize_dir(self.workspace.work)\n    self.clusterfuzz_deployment = (\n        clusterfuzz_deployment.get_clusterfuzz_deployment(\n            self.config, self.workspace))\n    self.image_repo_path = None\n    self.host_repo_path = None\n    self.repo_manager = None\n\n  def build_image_and_checkout_src(self):\n    \"\"\"Builds the project builder image and checkout source code for the patch\n    we want to fuzz (if necessary). Returns True on success.\"\"\"\n    result = self.ci_system.prepare_for_fuzzer_build()\n    if not result.success:\n      return False\n    self.image_repo_path = result.image_repo_path\n    self.repo_manager = result.repo_manager\n    if self.config.output_sarif:\n      self.workspace.make_repo_for_sarif(self.repo_manager)\n    logging.info('repo_dir: %s.', self.repo_manager.repo_dir)\n    self.host_repo_path = self.repo_manager.repo_dir\n    return True\n\n  def build_fuzzers(self):\n    \"\"\"Moves the source code we want to fuzz into the project builder and builds\n    the fuzzers from that source code. Returns True on success.\"\"\"\n    docker_args, docker_container = docker.get_base_docker_run_args(\n        self.workspace, self.config.sanitizer, self.config.language,\n        self.config.architecture, self.config.docker_in_docker)\n    if not docker_container:\n      docker_args.extend(\n          _get_docker_build_fuzzers_args_not_container(self.host_repo_path))\n\n    build_command = self.ci_system.get_build_command(self.host_repo_path,\n                                                     self.image_repo_path)\n\n    # Set extra environment variables so that they are visible to the build.\n    for key in self.config.extra_environment_variables:\n      # Don't specify their value in case they get echoed.\n      docker_args.extend(['-e', key])\n\n    docker_args.extend([\n        docker.get_project_image_name(self.config.oss_fuzz_project_name),\n        '/bin/bash',\n        '-c',\n        build_command,\n    ])\n    logging.info('Building with %s sanitizer.', self.config.sanitizer)\n\n    # TODO(metzman): Stop using helper.docker_run so we can get rid of\n    # docker.get_base_docker_run_args and merge its contents into\n    # docker.get_base_docker_run_command.\n    if not helper.docker_run(docker_args):\n      logging.error('Building fuzzers failed.')\n      return False\n\n    return True\n\n  def upload_build(self):\n    \"\"\"Upload build.\"\"\"\n    if self.config.upload_build:\n      self.clusterfuzz_deployment.upload_build(\n          self.repo_manager.get_current_commit())\n\n    return True\n\n  def check_fuzzer_build(self):\n    \"\"\"Checks the fuzzer build. Returns True on success or if config specifies\n    to skip check.\"\"\"\n    if not self.config.bad_build_check:\n      return True\n\n    return check_fuzzer_build(self.config)\n\n  def build(self):\n    \"\"\"Builds the image, checkouts the source (if needed), builds the fuzzers\n    and then removes the unaffectted fuzzers. Returns True on success.\"\"\"\n    methods = [\n        self.build_image_and_checkout_src,\n        self.build_fuzzers,\n        self.remove_unaffected_fuzz_targets,\n        self.upload_build,\n        self.check_fuzzer_build,\n    ]\n    for method in methods:\n      if not method():\n        return False\n    return True\n\n  def remove_unaffected_fuzz_targets(self):\n    \"\"\"Removes the fuzzers unaffected by the patch.\"\"\"\n    if self.config.keep_unaffected_fuzz_targets:\n      logging.info('Not removing unaffected fuzz targets.')\n      return True\n\n    logging.info('Removing unaffected fuzz targets.')\n    changed_files = self.ci_system.get_changed_code_under_test(\n        self.repo_manager)\n    affected_fuzz_targets.remove_unaffected_fuzz_targets(\n        self.clusterfuzz_deployment, self.workspace.out, changed_files,\n        self.image_repo_path)\n    return True\n\n\ndef build_fuzzers(config):\n  \"\"\"Builds all of the fuzzers for a specific OSS-Fuzz project.\n\n  Args:\n    config: The configuration object for building fuzzers.\n\n  Returns:\n    True if build succeeded.\n  \"\"\"\n  # Do some quick validation.\n  if config.project_src_path and not check_project_src_path(\n      config.project_src_path):\n    return False\n\n  # Get the builder and then build the fuzzers.\n  ci_system = continuous_integration.get_ci(config)\n  logging.info('ci_system: %s.', ci_system)\n  builder = Builder(config, ci_system)\n  return builder.build()\n\n\ndef check_fuzzer_build(config):\n  \"\"\"Checks the integrity of the built fuzzers.\n\n  Args:\n    config: The config object.\n\n  Returns:\n    True if fuzzers pass OSS-Fuzz's build check.\n  \"\"\"\n  workspace = workspace_utils.Workspace(config)\n  if not os.path.exists(workspace.out):\n    logging.error('Invalid out directory: %s.', workspace.out)\n    return False\n  if not os.listdir(workspace.out):\n    logging.error('No fuzzers found in out directory: %s.', workspace.out)\n    return False\n\n  env = base_runner_utils.get_env(config, workspace)\n  if config.allowed_broken_targets_percentage is not None:\n    env['ALLOWED_BROKEN_TARGETS_PERCENTAGE'] = (\n        config.allowed_broken_targets_percentage)\n\n  stdout, stderr, retcode = utils.execute('test_all.py', env=env)\n  print(f'Build check: stdout: {stdout}\\nstderr: {stderr}')\n  if retcode == 0:\n    logging.info('Build check passed.')\n    return True\n  logging.error('Build check failed.')\n  return False\n\n\ndef _get_docker_build_fuzzers_args_not_container(host_repo_path):\n  \"\"\"Returns arguments to the docker build arguments that are needed to use\n  |host_repo_path| when the host of the OSS-Fuzz builder container is not\n  another container.\"\"\"\n  return ['-v', f'{host_repo_path}:{host_repo_path}']\n"
  },
  {
    "path": "infra/cifuzz/build_fuzzers_entrypoint.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Builds a specific OSS-Fuzz project's fuzzers for CI tools.\"\"\"\nimport logging\nimport sys\n\nimport build_fuzzers\nimport logs\nimport config_utils\n\n# pylint: disable=c-extension-no-member\n# pylint gets confused because of the relative import of cifuzz.\n\nlogs.init()\n\n\ndef build_fuzzers_entrypoint():\n  \"\"\"Builds OSS-Fuzz project's fuzzers for CI tools.\"\"\"\n  config = config_utils.BuildFuzzersConfig()\n\n  if config.base_os_version == 'ubuntu-24-04':\n    result = config_utils.pivot_to_ubuntu_24_04(\n        'build-fuzzers',\n        '/opt/oss-fuzz/infra/cifuzz/build_fuzzers_entrypoint.py')\n    if result is not None:\n      return result\n\n  if config.dry_run:\n    # Sets the default return code on error to success.\n    returncode = 0\n  else:\n    # The default return code when an error occurs.\n    returncode = 1\n\n  if not build_fuzzers.build_fuzzers(config):\n    logging.error('Error building fuzzers for (commit: %s, pr_ref: %s).',\n                  config.git_sha, config.pr_ref)\n    return returncode\n\n  return 0\n\n\ndef main():\n  \"\"\"Builds OSS-Fuzz project's fuzzers for CI tools.\n\n  Note: The resulting fuzz target binaries of this build are placed in\n  the directory: ${GITHUB_WORKSPACE}/out\n\n  Returns:\n    0 on success or nonzero on failure.\n  \"\"\"\n  return build_fuzzers_entrypoint()\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/cifuzz/build_fuzzers_test.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests the functionality of the cifuzz module.\"\"\"\nimport os\nimport shutil\nimport sys\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport parameterized\n\n# pylint: disable=wrong-import-position\nINFRA_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nsys.path.append(INFRA_DIR)\n\nOSS_FUZZ_DIR = os.path.dirname(INFRA_DIR)\n\nimport build_fuzzers\nimport continuous_integration\nimport repo_manager\nimport test_helpers\n\n# NOTE: This integration test relies on\n# https://github.com/google/oss-fuzz/tree/master/projects/example project.\nEXAMPLE_PROJECT = 'example'\n\n# Location of data used for testing.\nTEST_DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n                              'test_data')\n\n# An example fuzzer that triggers an crash.\n# Binary is a copy of the example project's do_stuff_fuzzer and can be\n# generated by running \"python3 infra/helper.py build_fuzzers example\".\nEXAMPLE_CRASH_FUZZER = 'example_crash_fuzzer'\n\n# An example fuzzer that does not trigger a crash.\n# Binary is a modified version of example project's do_stuff_fuzzer. It is\n# created by removing the bug in my_api.cpp.\nEXAMPLE_NOCRASH_FUZZER = 'example_nocrash_fuzzer'\n\n# A fuzzer to be built in build_fuzzers integration tests.\nEXAMPLE_BUILD_FUZZER = 'do_stuff_fuzzer'\n\n# pylint: disable=no-self-use,protected-access,too-few-public-methods,unused-argument\n\n\ndef docker_command_has_env_var_arg(command, env_var_arg):\n  \"\"\"Returns True if a docker command has a specific env var argument.\"\"\"\n  for idx, element in enumerate(command):\n    if idx == 0:\n      # We're looking for the variable which can't be the first argument.\n      continue\n\n    if element == env_var_arg and command[idx - 1] == '-e':\n      return True\n  return False\n\n\nclass BuildFuzzersTest(unittest.TestCase):\n  \"\"\"Unit tests for build_fuzzers.\"\"\"\n\n  @mock.patch('build_specified_commit.detect_main_repo',\n              return_value=('example.com', '/path'))\n  @mock.patch('repo_manager._clone', return_value=None)\n  @mock.patch('continuous_integration.checkout_specified_commit')\n  @mock.patch('helper.docker_run', return_value=False)  # We want to quit early.\n  def test_cifuzz_env_var(self, mock_docker_run, _, __, ___):\n    \"\"\"Tests that the CIFUZZ env var is set.\"\"\"\n\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      build_fuzzers.build_fuzzers(\n          test_helpers.create_build_config(\n              oss_fuzz_project_name=EXAMPLE_PROJECT,\n              project_repo_name=EXAMPLE_PROJECT,\n              workspace=tmp_dir,\n              pr_ref='refs/pull/1757/merge'))\n\n      docker_run_command = mock_docker_run.call_args_list[0][0][0]\n\n    self.assertTrue(\n        docker_command_has_env_var_arg(docker_run_command, 'CIFUZZ=True'))\n\n  @mock.patch('build_specified_commit.detect_main_repo',\n              return_value=('example.com', '/path'))\n  @mock.patch('repo_manager._clone', return_value=None)\n  @mock.patch('continuous_integration.checkout_specified_commit')\n  @mock.patch('helper.docker_run', return_value=False)  # We want to quit early.\n  def test_extra_env_var(self, mock_docker_run, _, __, ___):\n    \"\"\"Tests that the CIFUZZ env var is set.\"\"\"\n\n    extra_env_var = 'CFL_EXTRA_TOKEN'\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      with mock.patch.dict(os.environ, {extra_env_var: 'BLAH'}):\n        build_fuzzers.build_fuzzers(\n            test_helpers.create_build_config(\n                oss_fuzz_project_name=EXAMPLE_PROJECT,\n                project_repo_name=EXAMPLE_PROJECT,\n                workspace=tmp_dir,\n                pr_ref='refs/pull/1757/merge'))\n\n    docker_run_command = mock_docker_run.call_args_list[0][0][0]\n    self.assertTrue(\n        docker_command_has_env_var_arg(docker_run_command, extra_env_var))\n\n\nclass InternalGithubBuildTest(unittest.TestCase):\n  \"\"\"Tests for building OSS-Fuzz projects on GitHub actions.\"\"\"\n  PROJECT_REPO_NAME = 'myproject'\n  SANITIZER = 'address'\n  GIT_SHA = 'fake'\n  PR_REF = 'fake'\n\n  def _create_builder(self, tmp_dir, oss_fuzz_project_name='myproject'):\n    \"\"\"Creates an InternalGithubBuilder and returns it.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name=oss_fuzz_project_name,\n        project_repo_name=self.PROJECT_REPO_NAME,\n        workspace=tmp_dir,\n        sanitizer=self.SANITIZER,\n        git_sha=self.GIT_SHA,\n        pr_ref=self.PR_REF,\n        cfl_platform='github')\n    cfl_platform = continuous_integration.get_ci(config)\n    builder = build_fuzzers.Builder(config, cfl_platform)\n    builder.repo_manager = repo_manager.RepoManager('/fake')\n    return builder\n\n  @mock.patch('helper.docker_run', return_value=True)\n  @mock.patch('continuous_integration.checkout_specified_commit',\n              side_effect=None)\n  def test_correct_host_repo_path(self, _, __):\n    \"\"\"Tests that the correct self.host_repo_path is set by\n    build_image_and_checkout_src. Specifically, we want the name of the\n    directory the repo is in to match the name used in the docker\n    image/container, so that it will replace the host's copy properly.\"\"\"\n    image_repo_path = '/src/repo_dir'\n    with tempfile.TemporaryDirectory() as tmp_dir, mock.patch(\n        'build_specified_commit.detect_main_repo',\n        return_value=('inferred_url', image_repo_path)):\n      builder = self._create_builder(tmp_dir)\n      builder.build_image_and_checkout_src()\n\n    self.assertEqual(os.path.basename(builder.host_repo_path),\n                     os.path.basename(image_repo_path))\n\n  @mock.patch('clusterfuzz_deployment.ClusterFuzzLite.upload_build',\n              return_value=True)\n  def test_upload_build_disabled(self, mock_upload_build):\n    \"\"\"Test upload build (disabled).\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      builder = self._create_builder(tmp_dir)\n      builder.upload_build()\n\n    mock_upload_build.assert_not_called()\n\n  @mock.patch('repo_manager.RepoManager.get_current_commit',\n              return_value='commit')\n  @mock.patch('clusterfuzz_deployment.ClusterFuzzLite.upload_build',\n              return_value=True)\n  def test_upload_build(self, mock_upload_build, mock_get_current_commit):\n    \"\"\"Test upload build.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      builder = self._create_builder(tmp_dir, oss_fuzz_project_name='')\n      builder.config.upload_build = True\n      builder.upload_build()\n\n    mock_upload_build.assert_called_with('commit')\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass BuildFuzzersIntegrationTest(unittest.TestCase):\n  \"\"\"Integration tests for build_fuzzers.\"\"\"\n\n  def setUp(self):\n    self.temp_dir_ctx_manager = test_helpers.docker_temp_dir()\n    self.workspace = self.temp_dir_ctx_manager.__enter__()\n    self.out_dir = os.path.join(self.workspace, 'build-out')\n    test_helpers.patch_environ(self)\n\n    base_runner_path = os.path.join(INFRA_DIR, 'base-images', 'base-runner')\n    os.environ['PATH'] = os.environ['PATH'] + os.pathsep + base_runner_path\n\n  def tearDown(self):\n    self.temp_dir_ctx_manager.__exit__(None, None, None)\n\n  def test_external_github_project(self):\n    \"\"\"Tests building fuzzers from an external project on Github.\"\"\"\n    project_repo_name = 'external-project'\n    git_url = 'https://github.com/jonathanmetzman/cifuzz-external-example.git'\n    # This test is dependant on the state of\n    # github.com/jonathanmetzman/cifuzz-external-example.\n    config = test_helpers.create_build_config(\n        project_repo_name=project_repo_name,\n        workspace=self.workspace,\n        git_url=git_url,\n        git_sha='HEAD',\n        cfl_platform='github',\n        base_commit='HEAD^1')\n    self.assertTrue(build_fuzzers.build_fuzzers(config))\n    self.assertTrue(\n        os.path.exists(os.path.join(self.out_dir, EXAMPLE_BUILD_FUZZER)))\n\n  def test_external_generic_project(self):\n    \"\"\"Tests building fuzzers from an external project not on Github.\"\"\"\n    project_repo_name = 'cifuzz-external-example'\n    git_url = 'https://github.com/jonathanmetzman/cifuzz-external-example.git'\n    # This test is dependant on the state of\n    # github.com/jonathanmetzman/cifuzz-external-example.\n    manager = repo_manager.clone_repo_and_get_manager(\n        'https://github.com/jonathanmetzman/cifuzz-external-example',\n        self.workspace)\n    project_src_path = manager.repo_dir\n    config = test_helpers.create_build_config(\n        project_repo_name=project_repo_name,\n        workspace=self.workspace,\n        git_url=git_url,\n        filestore='no_filestore',\n        git_sha='HEAD',\n        project_src_path=project_src_path,\n        base_commit='HEAD^1')\n    self.assertTrue(build_fuzzers.build_fuzzers(config))\n    self.assertTrue(\n        os.path.exists(os.path.join(self.out_dir, EXAMPLE_BUILD_FUZZER)))\n\n  def test_valid_commit(self):\n    \"\"\"Tests building fuzzers with valid inputs.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        project_repo_name='oss-fuzz',\n        workspace=self.workspace,\n        git_sha='0b95fe1039ed7c38fea1f97078316bfc1030c523',\n        base_commit='da0746452433dc18bae699e355a9821285d863c8',\n        cfl_platform='github')\n    self.assertTrue(build_fuzzers.build_fuzzers(config))\n    self.assertTrue(\n        os.path.exists(os.path.join(self.out_dir, EXAMPLE_BUILD_FUZZER)))\n\n  def test_valid_pull_request(self):\n    \"\"\"Tests building fuzzers with valid pull request.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        project_repo_name='oss-fuzz',\n        workspace=self.workspace,\n        pr_ref='refs/pull/1757/merge',\n        base_ref='master',\n        cfl_platform='github')\n    self.assertTrue(build_fuzzers.build_fuzzers(config))\n    self.assertTrue(\n        os.path.exists(os.path.join(self.out_dir, EXAMPLE_BUILD_FUZZER)))\n\n  def test_invalid_pull_request(self):\n    \"\"\"Tests building fuzzers with invalid pull request.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        project_repo_name='oss-fuzz',\n        workspace=self.workspace,\n        pr_ref='ref-1/merge',\n        base_ref='master',\n        cfl_platform='github')\n    self.assertTrue(build_fuzzers.build_fuzzers(config))\n\n  def test_invalid_oss_fuzz_project_name(self):\n    \"\"\"Tests building fuzzers with invalid project name.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name='not_a_valid_project',\n        project_repo_name='oss-fuzz',\n        workspace=self.workspace,\n        git_sha='0b95fe1039ed7c38fea1f97078316bfc1030c523')\n    self.assertFalse(build_fuzzers.build_fuzzers(config))\n\n  def test_invalid_repo_name(self):\n    \"\"\"Tests building fuzzers with invalid repo name.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        project_repo_name='not-real-repo',\n        workspace=self.workspace,\n        git_sha='0b95fe1039ed7c38fea1f97078316bfc1030c523')\n    self.assertFalse(build_fuzzers.build_fuzzers(config))\n\n  def test_invalid_git_sha(self):\n    \"\"\"Tests building fuzzers with invalid commit SHA.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        project_repo_name='oss-fuzz',\n        workspace=self.workspace,\n        git_sha='',\n        cfl_platform='github')\n    with self.assertRaises(AssertionError):\n      build_fuzzers.build_fuzzers(config)\n\n  def test_invalid_workspace(self):\n    \"\"\"Tests building fuzzers with invalid workspace.\"\"\"\n    config = test_helpers.create_build_config(\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        project_repo_name='oss-fuzz',\n        workspace=os.path.join(self.workspace, 'not', 'a', 'dir'),\n        git_sha='0b95fe1039ed7c38fea1f97078316bfc1030c523')\n    self.assertFalse(build_fuzzers.build_fuzzers(config))\n\n\nclass CheckFuzzerBuildTest(unittest.TestCase):\n  \"\"\"Tests the check_fuzzer_build function in the cifuzz module.\"\"\"\n\n  SANITIZER = 'address'\n  LANGUAGE = 'c++'\n\n  def setUp(self):\n    self.temp_dir_obj = tempfile.TemporaryDirectory()\n    workspace_path = os.path.join(self.temp_dir_obj.name, 'workspace')\n    self.config = test_helpers.create_build_config(\n        oss_fuzz_project_name=EXAMPLE_PROJECT,\n        sanitizer=self.SANITIZER,\n        language=self.LANGUAGE,\n        workspace=workspace_path,\n        pr_ref='refs/pull/1757/merge')\n    self.workspace = test_helpers.create_workspace(workspace_path)\n    shutil.copytree(TEST_DATA_PATH, workspace_path)\n    test_helpers.patch_environ(self, runner=True)\n\n  def tearDown(self):\n    self.temp_dir_obj.cleanup()\n\n  def test_correct_fuzzer_build(self):\n    \"\"\"Checks check_fuzzer_build function returns True for valid fuzzers.\"\"\"\n    self.assertTrue(build_fuzzers.check_fuzzer_build(self.config))\n\n  def test_not_a_valid_path(self):\n    \"\"\"Tests that False is returned when a nonexistent path is given.\"\"\"\n    self.config.workspace = 'not/a/valid/path'\n    self.assertFalse(build_fuzzers.check_fuzzer_build(self.config))\n\n  def test_no_valid_fuzzers(self):\n    \"\"\"Tests that False is returned when an empty directory is given.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      self.config.workspace = tmp_dir\n      os.mkdir(os.path.join(self.config.workspace, 'build-out'))\n      self.assertFalse(build_fuzzers.check_fuzzer_build(self.config))\n\n  @mock.patch('utils.execute', return_value=(None, None, 0))\n  def test_allow_broken_fuzz_targets_percentage(self, mock_execute):\n    \"\"\"Tests that ALLOWED_BROKEN_TARGETS_PERCENTAGE is set when running\n    docker if passed to check_fuzzer_build.\"\"\"\n    percentage = '0'\n    self.config.allowed_broken_targets_percentage = percentage\n    build_fuzzers.check_fuzzer_build(self.config)\n    self.assertEqual(\n        mock_execute.call_args[1]['env']['ALLOWED_BROKEN_TARGETS_PERCENTAGE'],\n        percentage)\n\n\n@unittest.skip('Test is too long to be run with presubmit.')\nclass BuildSantizerIntegrationTest(unittest.TestCase):\n  \"\"\"Integration tests for the build_fuzzers.\n    Note: This test relies on \"curl\" being an OSS-Fuzz project.\"\"\"\n  PROJECT_NAME = 'curl'\n  PR_REF = 'fake_pr'\n\n  @classmethod\n  def _create_config(cls, tmp_dir, sanitizer):\n    return test_helpers.create_build_config(\n        oss_fuzz_project_name=cls.PROJECT_NAME,\n        project_repo_name=cls.PROJECT_NAME,\n        workspace=tmp_dir,\n        pr_ref=cls.PR_REF,\n        sanitizer=sanitizer)\n\n  @parameterized.parameterized.expand([('memory',), ('undefined',)])\n  def test_valid_project_curl(self, sanitizer):\n    \"\"\"Tests that MSAN can be detected from project.yaml\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      self.assertTrue(\n          build_fuzzers.build_fuzzers(self._create_config(tmp_dir, sanitizer)))\n\n\nclass GetDockerBuildFuzzersArgsNotContainerTest(unittest.TestCase):\n  \"\"\"Tests that _get_docker_build_fuzzers_args_not_container works as\n  intended.\"\"\"\n\n  def test_get_docker_build_fuzzers_args_no_container(self):\n    \"\"\"Tests that _get_docker_build_fuzzers_args_not_container works\n    as intended.\"\"\"\n    host_repo_path = '/host/repo'\n    result = build_fuzzers._get_docker_build_fuzzers_args_not_container(\n        host_repo_path)\n    expected_result = ['-v', '/host/repo:/host/repo']\n    self.assertEqual(result, expected_result)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/cifuzz/cifuzz-base/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-runner\n\nRUN apt-get update && \\\n    apt-get install -y systemd wget gnupg && \\\n    install -m 0755 -d /etc/apt/keyrings && \\\n    wget -qO- https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \\\n    chmod a+r /etc/apt/keyrings/docker.gpg && \\\n    echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable\" > /etc/apt/sources.list.d/docker.list && \\\n    apt-get update && \\\n    apt-get install -y docker-ce-cli\n\nENV PATH=/opt/gcloud/google-cloud-sdk/bin/:$PATH\nENV OSS_FUZZ_ROOT=/opt/oss-fuzz\n\n# Do this step before copying to make rebuilding faster when developing.\nCOPY ./infra/cifuzz/requirements.txt /tmp/requirements.txt\nRUN python3 -m pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt\n\nADD . ${OSS_FUZZ_ROOT}\n# Don't use the default npm location since jazzer.js can break us.\n# This means javascript needed by cifuzz/clusterfuzzlite must be executed in\n# OSS_FUZZ_ROOT.\nRUN cd ${OSS_FUZZ_ROOT} && npm install ${OSS_FUZZ_ROOT}/infra/cifuzz\n\n\nENV PYTHONUNBUFFERED=1\n\n# Python file to execute when the docker container starts up.\n# We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var,\n# just expand to '/opt/oss-fuzz'.\nENTRYPOINT [\"python3\", \"/opt/oss-fuzz/infra/cifuzz/cifuzz_combined_entrypoint.py\"]\n"
  },
  {
    "path": "infra/cifuzz/cifuzz-base/ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04\n\nRUN apt-get update && \\\n    apt-get install -y systemd wget gnupg && \\\n    install -m 0755 -d /etc/apt/keyrings && \\\n    wget -qO- https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \\\n    chmod a+r /etc/apt/keyrings/docker.gpg && \\\n    echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable\" > /etc/apt/sources.list.d/docker.list && \\\n    apt-get update && \\\n    apt-get install -y docker-ce-cli\n\nENV PATH=/opt/gcloud/google-cloud-sdk/bin/:$PATH\nENV OSS_FUZZ_ROOT=/opt/oss-fuzz\n\n# Do this step before copying to make rebuilding faster when developing.\nCOPY ./infra/cifuzz/requirements.txt /tmp/requirements.txt\nRUN python3 -m pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt\n\nADD . ${OSS_FUZZ_ROOT}\n# Don't use the default npm location since jazzer.js can break us.\n# This means javascript needed by cifuzz/clusterfuzzlite must be executed in\n# OSS_FUZZ_ROOT.\nRUN cd ${OSS_FUZZ_ROOT} && npm install ${OSS_FUZZ_ROOT}/infra/cifuzz\n\n\nENV PYTHONUNBUFFERED=1\n\n# Python file to execute when the docker container starts up.\n# We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var,\n# just expand to '/opt/oss-fuzz'.\nENTRYPOINT [\"python3\", \"/opt/oss-fuzz/infra/cifuzz/cifuzz_combined_entrypoint.py\"]\n"
  },
  {
    "path": "infra/cifuzz/cifuzz_combined_entrypoint.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Builds fuzzers and runs fuzzers. Entrypoint used for external users\"\"\"\nimport logging\nimport sys\n\nimport build_fuzzers_entrypoint\nimport run_fuzzers_entrypoint\n\n\ndef main():\n  \"\"\"Builds and runs fuzzers for CI tools.\n\n  NOTE: Any crash report will be in the filepath: $WORKSPACE/out/testcase\n  This can be used with GitHub's upload-artifact action to surface the logs.\n\n  Required environment variables:\n  Returns:\n    0 on success or 1 on failure.\n  \"\"\"\n  logging.debug(\"Using cifuzz_combined_entrypoint.\")\n  result = build_fuzzers_entrypoint.build_fuzzers_entrypoint()\n  if result != 0:\n    return result\n  return run_fuzzers_entrypoint.run_fuzzers_entrypoint()\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/cifuzz/cifuzz_end_to_end_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"End-to-End tests for CIFuzz.\"\"\"\nimport os\nimport unittest\n\nimport run_cifuzz\nimport test_helpers\n\nCIFUZZ_DIR = os.path.dirname(os.path.abspath(__file__))\nEXTERNAL_PROJECT_PATH = os.path.join(CIFUZZ_DIR, 'test_data',\n                                     'external-project')\n\n\n# This test will fail if not run as root because the fuzzer build process\n# creates binaries that only root can write to.\n# Use a seperate env var to keep this seperate from integration tests which\n# don't have this annoying property.\n@unittest.skipIf(not os.getenv('END_TO_END_TESTS'),\n                 'END_TO_END_TESTS=1 not set')\nclass EndToEndTest(unittest.TestCase):\n  \"\"\"End-to-End tests for CIFuzz.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self, runner=True)\n\n  def test_simple(self):\n    \"\"\"Simple end-to-end test using run_cifuzz.main().\"\"\"\n    os.environ['REPOSITORY'] = 'external-project'\n    os.environ['PROJECT_SRC_PATH'] = EXTERNAL_PROJECT_PATH\n    os.environ['FILESTORE'] = 'no_filestore'\n    os.environ['NO_CLUSTERFUZZ_DEPLOYMENT'] = 'True'\n\n    with test_helpers.docker_temp_dir() as temp_dir:\n      os.environ['WORKSPACE'] = temp_dir\n      # TODO(metzman): Verify the crash, affected fuzzers, and other things.\n      self.assertEqual(run_cifuzz.main(), 1)\n"
  },
  {
    "path": "infra/cifuzz/cloudbuild.yaml",
    "content": "# TODO(metzman): Get rid of cifuzz-build-fuzzers and cifuzz-run-fuzzers.\nsteps:\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-base\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-base:v1\n  - '-f'\n  - infra/cifuzz/cifuzz-base/Dockerfile\n  - .\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-build-fuzzers\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-build-fuzzers:v1\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:v1\n  - '-f'\n  - infra/build_fuzzers.Dockerfile\n  - infra\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-run-fuzzers\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-run-fuzzers:v1\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:v1\n  - '-f'\n  - infra/run_fuzzers.Dockerfile\n  - infra\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-base:ubuntu-24-04-v1\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-base:ubuntu-24-04\n  - '-f'\n  - infra/cifuzz/cifuzz-base/ubuntu-24-04.Dockerfile\n  - .\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:ubuntu-24-04-v1\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:ubuntu-24-04\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-build-fuzzers:ubuntu-24-04-v1\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-build-fuzzers:ubuntu-24-04\n  - '-f'\n  - infra/build_fuzzers.ubuntu-24-04.Dockerfile\n  - infra\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:ubuntu-24-04-v1\n  - '-t'\n  - gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:ubuntu-24-04\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-run-fuzzers:ubuntu-24-04-v1\n  - '-t'\n  - gcr.io/oss-fuzz-base/cifuzz-run-fuzzers:ubuntu-24-04\n  - '-f'\n  - infra/run_fuzzers.ubuntu-24-04.Dockerfile\n  - infra\nimages:\n- gcr.io/oss-fuzz-base/cifuzz-base\n- gcr.io/oss-fuzz-base/cifuzz-base:v1\n- gcr.io/oss-fuzz-base/cifuzz-run-fuzzers\n- gcr.io/oss-fuzz-base/cifuzz-run-fuzzers:v1\n- gcr.io/oss-fuzz-base/cifuzz-build-fuzzers\n- gcr.io/oss-fuzz-base/cifuzz-build-fuzzers:v1\n- gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers\n- gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:v1\n- gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers\n- gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:v1\n- gcr.io/oss-fuzz-base/cifuzz-base:ubuntu-24-04-v1\n- gcr.io/oss-fuzz-base/cifuzz-base:ubuntu-24-04\n- gcr.io/oss-fuzz-base/cifuzz-run-fuzzers:ubuntu-24-04-v1\n- gcr.io/oss-fuzz-base/cifuzz-run-fuzzers:ubuntu-24-04\n- gcr.io/oss-fuzz-base/cifuzz-build-fuzzers:ubuntu-24-04-v1\n- gcr.io/oss-fuzz-base/cifuzz-build-fuzzers:ubuntu-24-04\n- gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:ubuntu-24-04-v1\n- gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers:ubuntu-24-04\n- gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:ubuntu-24-04-v1\n- gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers:ubuntu-24-04\ntimeout: 1800s\n"
  },
  {
    "path": "infra/cifuzz/clusterfuzz_deployment.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for interacting with the ClusterFuzz deployment.\"\"\"\nimport logging\nimport os\nimport sys\nimport urllib.error\nimport urllib.request\n\nimport config_utils\nimport continuous_integration\nimport filestore_utils\nimport http_utils\nimport get_coverage\nimport repo_manager\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nimport utils\n\n\nclass BaseClusterFuzzDeployment:\n  \"\"\"Base class for ClusterFuzz deployments.\"\"\"\n\n  def __init__(self, config, workspace):\n    self.config = config\n    self.workspace = workspace\n    self.ci_system = continuous_integration.get_ci(config)\n\n  def download_latest_build(self):\n    \"\"\"Downloads the latest build from ClusterFuzz.\n\n    Returns:\n      A path to where the OSS-Fuzz build was stored, or None if it wasn't.\n    \"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def upload_build(self, commit):\n    \"\"\"Uploads the build with the given commit sha to the filestore.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def download_corpus(self, target_name, corpus_dir):\n    \"\"\"Downloads the corpus for |target_name| from ClusterFuzz to |corpus_dir|.\n\n    Returns:\n      A path to where the OSS-Fuzz build was stored, or None if it wasn't.\n    \"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def upload_crashes(self):\n    \"\"\"Uploads crashes in |crashes_dir| to filestore.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def upload_corpus(self, target_name, corpus_dir, replace=False):  # pylint: disable=no-self-use,unused-argument\n    \"\"\"Uploads the corpus for |target_name| to filestore.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def upload_coverage(self):\n    \"\"\"Uploads the coverage report to the filestore.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def get_coverage(self, repo_path):\n    \"\"\"Returns the project coverage object for the project.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n\ndef _make_empty_dir_if_nonexistent(path):\n  \"\"\"Makes an empty directory at |path| if it does not exist.\"\"\"\n  os.makedirs(path, exist_ok=True)\n\n\nclass ClusterFuzzLite(BaseClusterFuzzDeployment):\n  \"\"\"Class representing a deployment of ClusterFuzzLite.\"\"\"\n\n  COVERAGE_NAME = 'latest'\n  LATEST_BUILD_WINDOW = 3\n\n  def __init__(self, config, workspace):\n    super().__init__(config, workspace)\n    self.filestore = filestore_utils.get_filestore(self.config)\n\n  def download_latest_build(self):\n    if os.path.exists(self.workspace.clusterfuzz_build):\n      # This path is necessary because download_latest_build can be called\n      # multiple times.That is the case because it is called only when we need\n      # to see if a bug is novel, i.e. until we want to check a bug is novel we\n      # don't want to waste time calling this, but therefore this method can be\n      # called if multiple bugs are found.\n      return self.workspace.clusterfuzz_build\n\n    repo_dir = self.ci_system.repo_dir\n    if not repo_dir:\n      raise RuntimeError('Repo checkout does not exist.')\n\n    _make_empty_dir_if_nonexistent(self.workspace.clusterfuzz_build)\n    repo = repo_manager.RepoManager(repo_dir)\n\n    diff_base = self.ci_system.get_diff_base()\n    if not diff_base:\n      diff_base = 'HEAD^'\n\n    # Builds are stored by commit, so try the latest |LATEST_BUILD_WINDOW|\n    # commits before the current diff base.\n    # TODO(ochang): If API usage becomes an issue, this can be optimized by the\n    # filestore accepting a list of filenames to try.\n    try:\n      # TODO(metzman): Why do we default to 'origin', we should avoid going down\n      # this path entirely and not need to catch an exception.\n      commit_list = repo.get_commit_list(diff_base,\n                                         limit=self.LATEST_BUILD_WINDOW)\n    except ValueError as error:\n      logging.error('Can\\'t get commit list: %s', error)\n      return None\n\n    for old_commit in commit_list:\n      logging.info('Trying to downloading previous build %s.', old_commit)\n      build_name = self._get_build_name(old_commit)\n      try:\n        if self.filestore.download_build(build_name,\n                                         self.workspace.clusterfuzz_build):\n          logging.info('Done downloading previous build.')\n          return self.workspace.clusterfuzz_build\n\n        logging.info('Build for %s does not exist.', old_commit)\n      except Exception as err:  # pylint: disable=broad-except\n        logging.error('Could not download build for %s because of: %s',\n                      old_commit, err)\n\n    return None\n\n  def download_corpus(self, target_name, corpus_dir):\n    _make_empty_dir_if_nonexistent(corpus_dir)\n    logging.info('Downloading corpus for %s to %s.', target_name, corpus_dir)\n    corpus_name = self._get_corpus_name(target_name)\n    try:\n      self.filestore.download_corpus(corpus_name, corpus_dir)\n      logging.info('Done downloading corpus. Contains %d elements.',\n                   len(os.listdir(corpus_dir)))\n    except Exception as err:  # pylint: disable=broad-except\n      logging.error('Failed to download corpus for target: %s. Error: %s',\n                    target_name, str(err))\n    return corpus_dir\n\n  def _get_build_name(self, name):\n    return f'{self.config.sanitizer}-{name}'\n\n  def _get_corpus_name(self, target_name):  # pylint: disable=no-self-use\n    \"\"\"Returns the name of the corpus artifact.\"\"\"\n    return target_name\n\n  def upload_corpus(self, target_name, corpus_dir, replace=False):\n    \"\"\"Upload the corpus produced by |target_name|.\"\"\"\n    logging.info('Uploading corpus in %s for %s.', corpus_dir, target_name)\n    name = self._get_corpus_name(target_name)\n    try:\n      self.filestore.upload_corpus(name, corpus_dir, replace=replace)\n      logging.info('Done uploading corpus.')\n    except Exception as err:  # pylint: disable=broad-except\n      logging.error('Failed to upload corpus for target: %s. Error: %s.',\n                    target_name, err)\n\n  def upload_build(self, commit):\n    \"\"\"Upload the build produced by CIFuzz as the latest build.\"\"\"\n    logging.info('Uploading latest build in %s.', self.workspace.out)\n    build_name = self._get_build_name(commit)\n    try:\n      result = self.filestore.upload_build(build_name, self.workspace.out)\n      logging.info('Done uploading latest build.')\n      return result\n    except Exception as err:  # pylint: disable=broad-except\n      logging.error('Failed to upload latest build: %s. Error: %s',\n                    self.workspace.out, err)\n\n  def upload_crashes(self):\n    \"\"\"Uploads crashes.\"\"\"\n    artifact_dirs = os.listdir(self.workspace.artifacts)\n    if not artifact_dirs:\n      logging.info('No crashes in %s. Not uploading.', self.workspace.artifacts)\n      return\n\n    for crash_target in artifact_dirs:\n      artifact_dir = os.path.join(self.workspace.artifacts, crash_target)\n      if not os.path.isdir(artifact_dir):\n        logging.warning('%s is not an expected artifact directory, skipping.',\n                        crash_target)\n        continue\n\n      logging.info('Uploading crashes in %s.', artifact_dir)\n      try:\n        self.filestore.upload_crashes(crash_target, artifact_dir)\n        logging.info('Done uploading crashes.')\n      except Exception as err:  # pylint: disable=broad-except\n        logging.error('Failed to upload crashes. Error: %s', err)\n\n  def upload_coverage(self):\n    \"\"\"Uploads the coverage report to the filestore.\"\"\"\n    self.filestore.upload_coverage(self.COVERAGE_NAME,\n                                   self.workspace.coverage_report)\n\n  def get_coverage(self, repo_path):\n    \"\"\"Returns the project coverage object for the project.\"\"\"\n    _make_empty_dir_if_nonexistent(self.workspace.clusterfuzz_coverage)\n    try:\n      if not self.filestore.download_coverage(\n          self.COVERAGE_NAME, self.workspace.clusterfuzz_coverage):\n        logging.error('Could not download coverage.')\n        return None\n      return get_coverage.FilesystemCoverage(\n          repo_path, self.workspace.clusterfuzz_coverage)\n    except Exception as err:  # pylint: disable=broad-except\n      logging.error('Could not get coverage: %s.', err)\n      return None\n\n\nclass OSSFuzz(BaseClusterFuzzDeployment):\n  \"\"\"The OSS-Fuzz ClusterFuzz deployment.\"\"\"\n\n  # Location of clusterfuzz builds on GCS.\n  CLUSTERFUZZ_BUILDS = 'clusterfuzz-builds'\n\n  # Zip file name containing the corpus.\n  CORPUS_ZIP_NAME = 'public.zip'\n\n  def get_latest_build_name(self):\n    \"\"\"Gets the name of the latest OSS-Fuzz build of a project.\n\n    Returns:\n      A string with the latest build version or None.\n    \"\"\"\n    version_file = (\n        f'{self.config.oss_fuzz_project_name}-{self.config.sanitizer}'\n        '-latest.version')\n    version_url = utils.url_join(utils.GCS_BASE_URL, self.CLUSTERFUZZ_BUILDS,\n                                 self.config.oss_fuzz_project_name,\n                                 version_file)\n    try:\n      response = urllib.request.urlopen(version_url)\n    except urllib.error.HTTPError:\n      logging.error('Error getting latest build version for %s from: %s.',\n                    self.config.oss_fuzz_project_name, version_url)\n      return None\n    return response.read().decode()\n\n  def download_latest_build(self):\n    \"\"\"Downloads the latest OSS-Fuzz build from GCS.\n\n    Returns:\n      A path to where the OSS-Fuzz build was stored, or None if it wasn't.\n    \"\"\"\n    if os.path.exists(self.workspace.clusterfuzz_build):\n      # This function can be called multiple times, don't download the build\n      # again.\n      return self.workspace.clusterfuzz_build\n\n    _make_empty_dir_if_nonexistent(self.workspace.clusterfuzz_build)\n\n    latest_build_name = self.get_latest_build_name()\n    if not latest_build_name:\n      return None\n\n    logging.info('Downloading latest build.')\n    oss_fuzz_build_url = utils.url_join(utils.GCS_BASE_URL,\n                                        self.CLUSTERFUZZ_BUILDS,\n                                        self.config.oss_fuzz_project_name,\n                                        latest_build_name)\n    if http_utils.download_and_unpack_zip(oss_fuzz_build_url,\n                                          self.workspace.clusterfuzz_build):\n      logging.info('Done downloading latest build.')\n      return self.workspace.clusterfuzz_build\n\n    return None\n\n  def upload_build(self, commit):  # pylint: disable=no-self-use\n    \"\"\"Noop Implementation of upload_build.\"\"\"\n    logging.info('Not uploading latest build because on OSS-Fuzz.')\n\n  def upload_corpus(self, target_name, corpus_dir, replace=False):  # pylint: disable=no-self-use,unused-argument\n    \"\"\"Noop Implementation of upload_corpus.\"\"\"\n    logging.info('Not uploading corpus because on OSS-Fuzz.')\n\n  def upload_crashes(self):  # pylint: disable=no-self-use\n    \"\"\"Noop Implementation of upload_crashes.\"\"\"\n    logging.info('Not uploading crashes because on OSS-Fuzz.')\n\n  def download_corpus(self, target_name, corpus_dir):\n    \"\"\"Downloads the latest OSS-Fuzz corpus for the target.\n\n    Returns:\n      The local path to to corpus or None if download failed.\n    \"\"\"\n    _make_empty_dir_if_nonexistent(corpus_dir)\n    project_qualified_fuzz_target_name = target_name\n    qualified_name_prefix = self.config.oss_fuzz_project_name + '_'\n    if not target_name.startswith(qualified_name_prefix):\n      project_qualified_fuzz_target_name = qualified_name_prefix + target_name\n\n    corpus_url = (f'{utils.GCS_BASE_URL}{self.config.oss_fuzz_project_name}'\n                  '-backup.clusterfuzz-external.appspot.com/corpus/'\n                  f'libFuzzer/{project_qualified_fuzz_target_name}/'\n                  f'{self.CORPUS_ZIP_NAME}')\n    logging.info('Downloading corpus from OSS-Fuzz: %s', corpus_url)\n\n    if not http_utils.download_and_unpack_zip(corpus_url, corpus_dir):\n      logging.warning('Failed to download corpus for %s.', target_name)\n    return corpus_dir\n\n  def upload_coverage(self):\n    \"\"\"Noop Implementation of upload_coverage_report.\"\"\"\n    logging.info('Not uploading coverage report because on OSS-Fuzz.')\n\n  def get_coverage(self, repo_path):\n    \"\"\"Returns the project coverage object for the project.\"\"\"\n    try:\n      return get_coverage.OSSFuzzCoverage(repo_path,\n                                          self.config.oss_fuzz_project_name)\n    except get_coverage.CoverageError:\n      return None\n\n\nclass NoClusterFuzzDeployment(BaseClusterFuzzDeployment):\n  \"\"\"ClusterFuzzDeployment implementation used when there is no deployment of\n  ClusterFuzz to use.\"\"\"\n\n  def upload_build(self, commit):  # pylint: disable=no-self-use\n    \"\"\"Noop Implementation of upload_build.\"\"\"\n    logging.info('Not uploading latest build because no ClusterFuzz '\n                 'deployment.')\n\n  def upload_corpus(self, target_name, corpus_dir, replace=False):  # pylint: disable=no-self-use,unused-argument\n    \"\"\"Noop Implementation of upload_corpus.\"\"\"\n    logging.info('Not uploading corpus because no ClusterFuzz deployment.')\n\n  def upload_crashes(self):  # pylint: disable=no-self-use\n    \"\"\"Noop Implementation of upload_crashes.\"\"\"\n    logging.info('Not uploading crashes because no ClusterFuzz deployment.')\n\n  def download_corpus(self, target_name, corpus_dir):\n    \"\"\"Noop Implementation of download_corpus.\"\"\"\n    logging.info('Not downloading corpus because no ClusterFuzz deployment.')\n    return _make_empty_dir_if_nonexistent(corpus_dir)\n\n  def download_latest_build(self):  # pylint: disable=no-self-use\n    \"\"\"Noop Implementation of download_latest_build.\"\"\"\n    logging.info(\n        'Not downloading latest build because no ClusterFuzz deployment.')\n\n  def upload_coverage(self):\n    \"\"\"Noop Implementation of upload_coverage.\"\"\"\n    logging.info(\n        'Not uploading coverage report because no ClusterFuzz deployment.')\n\n  def get_coverage(self, repo_path):\n    \"\"\"Noop Implementation of get_coverage.\"\"\"\n    logging.info(\n        'Not getting project coverage because no ClusterFuzz deployment.')\n\n\n_PLATFORM_CLUSTERFUZZ_DEPLOYMENT_MAPPING = {\n    config_utils.BaseConfig.Platform.INTERNAL_GENERIC_CI: OSSFuzz,\n    config_utils.BaseConfig.Platform.INTERNAL_GITHUB: OSSFuzz,\n    config_utils.BaseConfig.Platform.EXTERNAL_GENERIC_CI: ClusterFuzzLite,\n    config_utils.BaseConfig.Platform.EXTERNAL_GITHUB: ClusterFuzzLite,\n}\n\n\ndef get_clusterfuzz_deployment(config, workspace):\n  \"\"\"Returns object reprsenting deployment of ClusterFuzz used by |config|.\"\"\"\n  deployment_cls = _PLATFORM_CLUSTERFUZZ_DEPLOYMENT_MAPPING[config.platform]\n  if config.no_clusterfuzz_deployment:\n    logging.info('Overriding ClusterFuzzDeployment. Using None.')\n    deployment_cls = NoClusterFuzzDeployment\n  result = deployment_cls(config, workspace)\n  logging.info('ClusterFuzzDeployment: %s.', result)\n  return result\n"
  },
  {
    "path": "infra/cifuzz/clusterfuzz_deployment_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for clusterfuzz_deployment.py\"\"\"\n\nimport os\nimport unittest\nfrom unittest import mock\n\nimport parameterized\nfrom pyfakefs import fake_filesystem_unittest\n\nimport clusterfuzz_deployment\nimport config_utils\nimport test_helpers\nimport workspace_utils\n\n# NOTE: This integration test relies on\n# https://github.com/google/oss-fuzz/tree/master/projects/example project.\nEXAMPLE_PROJECT = 'example'\n\n# An example fuzzer that triggers an error.\nEXAMPLE_FUZZER = 'example_crash_fuzzer'\n\nWORKSPACE = '/workspace'\nEXPECTED_LATEST_BUILD_PATH = os.path.join(WORKSPACE, 'cifuzz-prev-build')\n\n# pylint: disable=unused-argument\n\n\ndef _create_config(**kwargs):\n  \"\"\"Creates a config object and then sets every attribute that is a key in\n  |kwargs| to the corresponding value. Asserts that each key in |kwargs| is an\n  attribute of Config.\"\"\"\n  defaults = {\n      'cfl_platform': 'github',\n      'oss_fuzz_project_name': EXAMPLE_PROJECT,\n      'workspace': WORKSPACE,\n  }\n  for default_key, default_value in defaults.items():\n    if default_key not in kwargs:\n      kwargs[default_key] = default_value\n\n  return test_helpers.create_run_config(**kwargs)\n\n\ndef _create_deployment(**kwargs):\n  config = _create_config(**kwargs)\n  workspace = workspace_utils.Workspace(config)\n  return clusterfuzz_deployment.get_clusterfuzz_deployment(config, workspace)\n\n\nclass OSSFuzzTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests OSSFuzz.\"\"\"\n\n  def setUp(self):\n    self.setUpPyfakefs()\n    self.deployment = _create_deployment()\n    self.corpus_dir = os.path.join(self.deployment.workspace.corpora,\n                                   EXAMPLE_FUZZER)\n\n  @mock.patch('http_utils.download_and_unpack_zip', return_value=True)\n  def test_download_corpus(self, mock_download_and_unpack_zip):\n    \"\"\"Tests that we can download a corpus for a valid project.\"\"\"\n    self.deployment.download_corpus(EXAMPLE_FUZZER, self.corpus_dir)\n    expected_url = ('https://storage.googleapis.com/example-backup.'\n                    'clusterfuzz-external.appspot.com/corpus/libFuzzer/'\n                    'example_crash_fuzzer/public.zip')\n    call_args, _ = mock_download_and_unpack_zip.call_args\n    self.assertEqual(call_args, (expected_url, self.corpus_dir))\n    self.assertTrue(os.path.exists(self.corpus_dir))\n\n  @mock.patch('http_utils.download_and_unpack_zip', return_value=False)\n  def test_download_corpus_fail(self, _):\n    \"\"\"Tests that when downloading fails, an empty corpus directory is still\n    returned.\"\"\"\n    self.deployment.download_corpus(EXAMPLE_FUZZER, self.corpus_dir)\n    self.assertEqual(os.listdir(self.corpus_dir), [])\n\n  def test_get_latest_build_name(self):\n    \"\"\"Tests that the latest build name can be retrieved from GCS.\"\"\"\n    latest_build_name = self.deployment.get_latest_build_name()\n    self.assertTrue(latest_build_name.endswith('.zip'))\n    self.assertTrue('address' in latest_build_name)\n\n  @parameterized.parameterized.expand([\n      ('upload_build', ('commit',),\n       'Not uploading latest build because on OSS-Fuzz.'),\n      ('upload_corpus', ('target', 'corpus-dir'),\n       'Not uploading corpus because on OSS-Fuzz.'),\n      ('upload_crashes', tuple(), 'Not uploading crashes because on OSS-Fuzz.'),\n  ])\n  def test_noop_methods(self, method, method_args, expected_message):\n    \"\"\"Tests that certain methods are noops for OSS-Fuzz.\"\"\"\n    with mock.patch('logging.info') as mock_info:\n      method = getattr(self.deployment, method)\n      self.assertIsNone(method(*method_args))\n      mock_info.assert_called_with(expected_message)\n\n  @mock.patch('http_utils.download_and_unpack_zip', return_value=True)\n  def test_download_latest_build(self, mock_download_and_unpack_zip):\n    \"\"\"Tests that downloading the latest build works as intended under normal\n    circumstances.\"\"\"\n    self.assertEqual(self.deployment.download_latest_build(),\n                     EXPECTED_LATEST_BUILD_PATH)\n    expected_url = ('https://storage.googleapis.com/clusterfuzz-builds/example/'\n                    'example-address-202008030600.zip')\n    # This is broken\n    # TODO: fix\n    # mock_download_and_unpack_zip.assert_called_with(expected_url,\n    #                                               EXPECTED_LATEST_BUILD_PATH)\n\n  @mock.patch('http_utils.download_and_unpack_zip', return_value=False)\n  def test_download_latest_build_fail(self, _):\n    \"\"\"Tests that download_latest_build returns None when it fails to download a\n    build.\"\"\"\n    self.assertIsNone(self.deployment.download_latest_build())\n\n\nclass ClusterFuzzLiteTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests for ClusterFuzzLite.\"\"\"\n\n  def setUp(self):\n    self.setUpPyfakefs()\n    self.deployment = _create_deployment(mode='batch',\n                                         oss_fuzz_project_name='',\n                                         cloud_bucket='gs://bucket')\n    self.corpus_dir = os.path.join(self.deployment.workspace.corpora,\n                                   EXAMPLE_FUZZER)\n\n  @mock.patch('filestore.github_actions.GithubActionsFilestore.download_corpus',\n              return_value=True)\n  def test_download_corpus(self, mock_download_corpus):\n    \"\"\"Tests that download_corpus works for a valid project.\"\"\"\n    self.deployment.download_corpus(EXAMPLE_FUZZER, self.corpus_dir)\n    mock_download_corpus.assert_called_with('example_crash_fuzzer',\n                                            self.corpus_dir)\n    self.assertTrue(os.path.exists(self.corpus_dir))\n\n  @mock.patch('filestore.github_actions.GithubActionsFilestore.download_corpus',\n              side_effect=Exception)\n  def test_download_corpus_fail(self, _):\n    \"\"\"Tests that when downloading fails, an empty corpus directory is still\n    returned.\"\"\"\n    self.deployment.download_corpus(EXAMPLE_FUZZER, self.corpus_dir)\n    self.assertEqual(os.listdir(self.corpus_dir), [])\n\n  @mock.patch('filestore.github_actions.GithubActionsFilestore.download_build',\n              side_effect=[False, True])\n  @mock.patch('repo_manager.RepoManager.get_commit_list',\n              return_value=['commit1', 'commit2'])\n  @mock.patch('continuous_integration.GithubCiMixin.repo_dir',\n              return_value='/path/to/repo')\n  def test_download_latest_build(self, mock_repo_dir, mock_get_commit_list,\n                                 mock_download_build):\n    \"\"\"Tests that downloading the latest build works as intended under normal\n    circumstances.\"\"\"\n    self.assertEqual(self.deployment.download_latest_build(),\n                     EXPECTED_LATEST_BUILD_PATH)\n    expected_artifact_name = 'address-commit2'\n    mock_download_build.assert_called_with(expected_artifact_name,\n                                           EXPECTED_LATEST_BUILD_PATH)\n\n  @mock.patch('filestore.github_actions.GithubActionsFilestore.download_build',\n              side_effect=Exception)\n  @mock.patch('repo_manager.RepoManager.get_commit_list',\n              return_value=['commit1', 'commit2'])\n  @mock.patch('continuous_integration.GithubCiMixin.repo_dir',\n              return_value='/path/to/repo')\n  def test_download_latest_build_fail(self, mock_repo_dir, mock_get_commit_list,\n                                      _):\n    \"\"\"Tests that download_latest_build returns None when it fails to download a\n    build.\"\"\"\n    self.assertIsNone(self.deployment.download_latest_build())\n\n  @mock.patch('filestore.github_actions.GithubActionsFilestore.upload_build')\n  def test_upload_build(self, mock_upload_build):\n    \"\"\"Tests that upload_build works as intended.\"\"\"\n    self.deployment.upload_build('commit')\n    mock_upload_build.assert_called_with('address-commit',\n                                         '/workspace/build-out')\n\n\nclass NoClusterFuzzDeploymentTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests for NoClusterFuzzDeployment.\"\"\"\n\n  def setUp(self):\n    self.setUpPyfakefs()\n    config = test_helpers.create_run_config(workspace=WORKSPACE,\n                                            cfl_platform='other',\n                                            filestore='no_filestore',\n                                            no_clusterfuzz_deployment=True)\n    workspace = workspace_utils.Workspace(config)\n    self.deployment = clusterfuzz_deployment.get_clusterfuzz_deployment(\n        config, workspace)\n\n    self.corpus_dir = os.path.join(workspace.corpora, EXAMPLE_FUZZER)\n\n  @mock.patch('logging.info')\n  def test_download_corpus(self, mock_info):\n    \"\"\"Tests that download corpus returns the path to the empty corpus\n    directory.\"\"\"\n    self.deployment.download_corpus(EXAMPLE_FUZZER, self.corpus_dir)\n    mock_info.assert_called_with(\n        'Not downloading corpus because no ClusterFuzz deployment.')\n    self.assertTrue(os.path.exists(self.corpus_dir))\n\n  @parameterized.parameterized.expand([\n      ('upload_build', ('commit',),\n       'Not uploading latest build because no ClusterFuzz deployment.'),\n      ('upload_corpus', ('target', 'corpus-dir'),\n       'Not uploading corpus because no ClusterFuzz deployment.'),\n      ('upload_crashes', tuple(),\n       'Not uploading crashes because no ClusterFuzz deployment.'),\n      ('download_latest_build', tuple(),\n       'Not downloading latest build because no ClusterFuzz deployment.')\n  ])\n  def test_noop_methods(self, method, method_args, expected_message):\n    \"\"\"Tests that certain methods are noops for NoClusterFuzzDeployment.\"\"\"\n    with mock.patch('logging.info') as mock_info:\n      method = getattr(self.deployment, method)\n      self.assertIsNone(method(*method_args))\n      mock_info.assert_called_with(expected_message)\n\n\nclass GetClusterFuzzDeploymentTest(unittest.TestCase):\n  \"\"\"Tests for get_clusterfuzz_deployment.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    os.environ['GITHUB_REPOSITORY'] = 'owner/myproject'\n\n  @parameterized.parameterized.expand([\n      (config_utils.BaseConfig.Platform.INTERNAL_GENERIC_CI,\n       clusterfuzz_deployment.OSSFuzz),\n      (config_utils.BaseConfig.Platform.INTERNAL_GITHUB,\n       clusterfuzz_deployment.OSSFuzz),\n      (config_utils.BaseConfig.Platform.EXTERNAL_GENERIC_CI,\n       clusterfuzz_deployment.ClusterFuzzLite),\n      (config_utils.BaseConfig.Platform.EXTERNAL_GITHUB,\n       clusterfuzz_deployment.ClusterFuzzLite),\n  ])\n  def test_get_clusterfuzz_deployment(self, platform, expected_deployment_cls):\n    \"\"\"Tests that get_clusterfuzz_deployment returns the correct value.\"\"\"\n    with mock.patch('config_utils.BaseConfig.platform',\n                    return_value=platform,\n                    new_callable=mock.PropertyMock):\n      with mock.patch('filestore_utils.get_filestore', return_value=None):\n        with mock.patch('platform_config.github._get_event_data',\n                        return_value={}):\n          config = _create_config()\n          workspace = workspace_utils.Workspace(config)\n\n          self.assertIsInstance(\n              clusterfuzz_deployment.get_clusterfuzz_deployment(\n                  config, workspace), expected_deployment_cls)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/cifuzz/config_utils.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for getting the configuration CIFuzz needs to run.\"\"\"\n\nimport enum\nimport importlib\nimport logging\nimport os\nimport sys\n\nimport environment\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport platform_config\nimport constants\nimport re\nimport subprocess\n\nSANITIZERS = ['address', 'memory', 'undefined', 'coverage']\nBASE_OS_VERSION_REGEX = re.compile(r'\\s*base_os_version\\s*:\\s*([^\\s]+)')\n\n# TODO(metzman): Set these on config objects so there's one source of truth.\nDEFAULT_ENGINE = 'libfuzzer'\n\n# This module deals a lot with env variables. Many of these will be set by users\n# and others beyond CIFuzz's control. Thus, you should be careful about using\n# the environment.py helpers for getting env vars, since it can cause values\n# that should be interpreted as strings to be returned as other types (bools or\n# ints for example). The environment.py helpers should not be used for values\n# that are supposed to be strings.\n\n\ndef _get_sanitizer():\n  return os.getenv('SANITIZER', constants.DEFAULT_SANITIZER).lower()\n\n\ndef _get_architecture():\n  return os.getenv('ARCHITECTURE', constants.DEFAULT_ARCHITECTURE).lower()\n\n\ndef _is_dry_run():\n  \"\"\"Returns True if configured to do a dry run.\"\"\"\n  return environment.get_bool('DRY_RUN', False)\n\n\ndef _get_language():\n  \"\"\"Returns the project language.\"\"\"\n  # Get language from environment. We took this approach because the convenience\n  # given to OSS-Fuzz users by not making them specify the language again (and\n  # getting it from the project.yaml) is outweighed by the complexity in\n  # implementing this. A lot of the complexity comes from our unittests not\n  # setting a proper projet at this point.\n  return os.getenv('LANGUAGE', constants.DEFAULT_LANGUAGE)\n\n\ndef _get_extra_environment_variables():\n  \"\"\"Gets extra environment variables specified by the user with\n  CFL_EXTRA_$NAME=$VALUE.\"\"\"\n  return [key for key in os.environ if key.startswith('CFL_EXTRA_')]\n\n\n# pylint: disable=too-many-instance-attributes\n\n\nclass ConfigError(Exception):\n  \"\"\"Error for invalid configuration.\"\"\"\n\n\nclass BaseConfig:\n  \"\"\"Object containing constant configuration for CIFuzz.\"\"\"\n\n  class Platform(enum.Enum):\n    \"\"\"Enum representing the different platforms CIFuzz runs on.\"\"\"\n    EXTERNAL_GITHUB = 0  # Non-OSS-Fuzz on GitHub actions.\n    INTERNAL_GITHUB = 1  # OSS-Fuzz on GitHub actions.\n    INTERNAL_GENERIC_CI = 2  # OSS-Fuzz on any CI.\n    EXTERNAL_GENERIC_CI = 3  # Non-OSS-Fuzz on any CI.\n\n  @property\n  def is_github(self):\n    \"\"\"Returns True if running on GitHub.\"\"\"\n    return self.cfl_platform == 'github'\n\n  def __init__(self):\n    # Need to set these before calling self.platform.\n    self.oss_fuzz_project_name = os.getenv('OSS_FUZZ_PROJECT_NAME')\n    self.cfl_platform = os.getenv('CFL_PLATFORM')\n    logging.debug('Is github: %s.', self.is_github)\n\n    self.platform_conf = _get_platform_config(self.cfl_platform)\n    self.base_commit = self.platform_conf.base_commit\n    self.base_ref = self.platform_conf.base_ref\n    self.pr_ref = self.platform_conf.pr_ref\n    self.workspace = self.platform_conf.workspace\n    self.project_src_path = self.platform_conf.project_src_path\n    self.actor = self.platform_conf.actor\n    self.token = self.platform_conf.token\n    self.project_repo_owner = self.platform_conf.project_repo_owner\n    self.project_repo_name = self.platform_conf.project_repo_name\n    self.filestore = self.platform_conf.filestore\n\n    # This determines if builds are done using docker in docker\n    # rather than the normal method which is sibling containers.\n    self.docker_in_docker = self.platform_conf.docker_in_docker\n\n    self.dry_run = _is_dry_run()  # Check if failures should not be reported.\n    self.sanitizer = _get_sanitizer()\n    self.architecture = _get_architecture()\n    self.language = _get_language()\n    self.low_disk_space = environment.get_bool('LOW_DISK_SPACE', False)\n\n    self.git_store_repo = os.environ.get('GIT_STORE_REPO')\n    self.git_store_branch = os.environ.get('GIT_STORE_BRANCH')\n    self.git_store_branch_coverage = os.environ.get('GIT_STORE_BRANCH_COVERAGE',\n                                                    self.git_store_branch)\n    self.cloud_bucket = os.environ.get('CLOUD_BUCKET')\n    self.no_clusterfuzz_deployment = environment.get_bool(\n        'NO_CLUSTERFUZZ_DEPLOYMENT', False)\n    self.build_integration_path = (\n        constants.DEFAULT_EXTERNAL_BUILD_INTEGRATION_PATH)\n\n    self.parallel_fuzzing = environment.get('PARALLEL_FUZZING', False)\n    self.extra_environment_variables = _get_extra_environment_variables()\n    self.output_sarif = environment.get_bool('OUTPUT_SARIF', False)\n\n    # TODO(metzman): Fix tests to create valid configurations and get rid of\n    # CIFUZZ_TEST here and in presubmit.py.\n    if not os.getenv('CIFUZZ_TEST') and not self.validate():\n      raise ConfigError('Invalid Configuration.')\n\n  def validate(self):\n    \"\"\"Returns False if the configuration is invalid.\"\"\"\n    # Do validation here so that unittests don't need to make a fully-valid\n    # config.\n    # pylint: disable=too-many-return-statements\n    if not self.workspace:\n      logging.error('Must set WORKSPACE.')\n      return False\n\n    if self.sanitizer not in SANITIZERS:\n      logging.error('Invalid SANITIZER: %s. Must be one of: %s.',\n                    self.sanitizer, SANITIZERS)\n      return False\n\n    if self.architecture not in constants.ARCHITECTURES:\n      logging.error('Invalid ARCHITECTURE: %s. Must be one of: %s.',\n                    self.architecture, constants.ARCHITECTURES)\n      return False\n\n    if self.architecture == 'i386' and self.sanitizer != 'address':\n      logging.error(\n          'ARCHITECTURE=i386 can be used with SANITIZER=address only.')\n      return False\n\n    if self.language not in constants.LANGUAGES:\n      logging.error('Invalid LANGUAGE: %s. Must be one of: %s.', self.language,\n                    constants.LANGUAGES)\n      return False\n\n    if not self.project_repo_name:\n      logging.error('Must set REPOSITORY.')\n      return False\n\n    return True\n\n  @property\n  def is_internal(self):\n    \"\"\"Returns True if this is an OSS-Fuzz project.\"\"\"\n    return bool(self.oss_fuzz_project_name)\n\n  @property\n  def platform(self):\n    \"\"\"Returns the platform CIFuzz is runnning on.\"\"\"\n    if not self.is_internal:\n      if not self.is_github:\n        return self.Platform.EXTERNAL_GENERIC_CI\n      return self.Platform.EXTERNAL_GITHUB\n\n    if self.is_github:\n      return self.Platform.INTERNAL_GITHUB\n    return self.Platform.INTERNAL_GENERIC_CI\n\n  @property\n  def is_coverage(self):\n    \"\"\"Returns True if this CIFuzz run (building fuzzers and running them) for\n    generating a coverage report.\"\"\"\n    return self.sanitizer == 'coverage'\n\n  @property\n  def base_os_version(self):\n    \"\"\"Returns the project's base OS version.\"\"\"\n    if self.oss_fuzz_project_name:\n      # Internal/OSS-Fuzz project.\n      project_yaml_path = os.path.join('/opt/oss-fuzz/projects',\n                                       self.oss_fuzz_project_name,\n                                       'project.yaml')\n    else:\n      # External project.\n      project_src_path = self.project_src_path\n      if project_src_path is None:\n        logging.info('PROJECT_SRC_PATH not set. Using workspace: %s',\n                     self.workspace)\n        project_src_path = self.workspace\n\n      project_yaml_path = os.path.join(project_src_path,\n                                       self.build_integration_path,\n                                       'project.yaml')\n\n    try:\n      if not os.path.exists(project_yaml_path):\n        return 'legacy'\n\n      with open(project_yaml_path) as file_handle:\n        content = file_handle.read()\n        for line in content.splitlines():\n          match = BASE_OS_VERSION_REGEX.match(line)\n          if match:\n            return match.group(1).strip('\\'\"')\n    except Exception:  # pylint: disable=broad-except\n      logging.warning(\n          'Failed to read project.yaml at %s. Falling back to legacy.',\n          project_yaml_path)\n      return 'legacy'\n\n    return 'legacy'\n\n\ndef pivot_to_ubuntu_24_04(image_suffix, script_path, check_result=True):\n  \"\"\"Pivots execution to an Ubuntu 24.04 container if needed.\"\"\"\n  with open('/etc/os-release') as file_handle:\n    if '24.04' not in file_handle.read():\n      logging.info(\n          'Base OS version is Ubuntu 24.04, but running in a different OS. Pivoting to Ubuntu 24.04 container.'\n      )\n      env = os.environ.copy()\n      # Ensure we don't loop indefinitely.\n      env['CIFUZZ_PIVOTED'] = '1'\n      command = [\n          'docker', 'run', '--rm', '--privileged', '--volumes-from',\n          os.environ.get('HOSTNAME', ''), '-e', 'CIFUZZ_PIVOTED=1'\n      ]\n      # Propagate environment variables.\n      for key, value in os.environ.items():\n        command.extend(['-e', f'{key}={value}'])\n\n      # Use the ubuntu-24-04 version of the image.\n      command.append('--entrypoint')\n      command.append('python3')\n      command.append(\n          f'gcr.io/oss-fuzz-base/clusterfuzzlite-{image_suffix}:ubuntu-24-04-v1'\n      )\n\n      # Run the same command.\n      command.append(script_path)\n\n      if check_result:\n        subprocess.check_call(command)\n        return 0\n      else:\n        try:\n          subprocess.check_call(command)\n        except subprocess.CalledProcessError as e:\n          return e.returncode\n        return 0\n  return None\n\n\ndef _get_platform_config(cfl_platform):\n  \"\"\"Returns the CI environment object for |cfl_platform|.\"\"\"\n  module_name = f'platform_config.{cfl_platform}'\n  try:\n    cls = importlib.import_module(module_name).PlatformConfig\n  except ImportError:\n    cls = platform_config.BasePlatformConfig\n  return cls()\n\n\nclass RunFuzzersConfig(BaseConfig):\n  \"\"\"Class containing constant configuration for running fuzzers in CIFuzz.\"\"\"\n\n  MODES = ['batch', 'code-change', 'coverage', 'prune']\n\n  def __init__(self):\n    super().__init__()\n    # TODO(metzman): Pick a better default for pruning.\n    self.fuzz_seconds = int(os.environ.get('FUZZ_SECONDS', 600))\n    self.mode = os.environ.get('MODE', 'code-change').lower()\n    if self.is_coverage:\n      self.mode = 'coverage'\n\n    self.report_unreproducible_crashes = environment.get_bool(\n        'REPORT_UNREPRODUCIBLE_CRASHES', False)\n\n    self.minimize_crashes = environment.get_bool('MINIMIZE_CRASHES', False)\n    if self.mode == 'batch':\n      logging.warning(\n          'Minimizing crashes reduces fuzzing time in batch fuzzing.')\n    self.report_timeouts = environment.get_bool('REPORT_TIMEOUTS', False)\n    self.report_ooms = environment.get_bool('REPORT_OOMS', True)\n    self.upload_all_crashes = environment.get_bool('UPLOAD_ALL_CRASHES', False)\n\n    # TODO(metzman): Fix tests to create valid configurations and get rid of\n    # CIFUZZ_TEST here and in presubmit.py.\n    if not os.getenv('CIFUZZ_TEST') and not self._run_config_validate():\n      raise ConfigError('Invalid Run Configuration.')\n\n  def _run_config_validate(self):\n    \"\"\"Do extra validation on RunFuzzersConfig.__init__(). Do not name this\n    validate or else it will be called when using the parent's __init__ and will\n    fail. Returns True if valid.\"\"\"\n    if self.mode not in self.MODES:\n      logging.error('Invalid MODE: %s. Must be one of %s.', self.mode,\n                    self.MODES)\n      return False\n\n    return True\n\n\nclass BuildFuzzersConfig(BaseConfig):\n  \"\"\"Class containing constant configuration for building fuzzers in CIFuzz.\"\"\"\n\n  def __init__(self):\n    \"\"\"Get the configuration from CIFuzz from the environment. These variables\n    are set by GitHub or the user.\"\"\"\n    super().__init__()\n    self.git_sha = self.platform_conf.git_sha\n    self.git_url = self.platform_conf.git_url\n\n    self.allowed_broken_targets_percentage = os.getenv(\n        'ALLOWED_BROKEN_TARGETS_PERCENTAGE')\n    self.bad_build_check = environment.get_bool('BAD_BUILD_CHECK', True)\n\n    self.keep_unaffected_fuzz_targets = environment.get_bool(\n        'KEEP_UNAFFECTED_FUZZ_TARGETS')\n\n    self.upload_build = environment.get_bool('UPLOAD_BUILD', False)\n    if not self.keep_unaffected_fuzz_targets:\n      has_base_for_diff = (self.base_ref or self.base_commit)\n      if not has_base_for_diff:\n        logging.info(\n            'Keeping all fuzzers because there is nothing to diff against.')\n        self.keep_unaffected_fuzz_targets = True\n      elif self.upload_build:\n        logging.info('Keeping all fuzzers because we are uploading build.')\n        self.keep_unaffected_fuzz_targets = True\n      elif self.sanitizer == 'coverage':\n        logging.info('Keeping all fuzzers because we are doing coverage.')\n        self.keep_unaffected_fuzz_targets = True\n\n    if self.sanitizer == 'coverage':\n      self.bad_build_check = False\n"
  },
  {
    "path": "infra/cifuzz/config_utils_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for config_utils.\"\"\"\nimport os\nimport unittest\nfrom unittest import mock\n\nimport config_utils\nimport constants\nimport test_helpers\n\n# pylint: disable=no-self-use,protected-access\n\n\nclass BaseConfigTest(unittest.TestCase):\n  \"\"\"Tests for BaseConfig.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    os.environ['CIFUZZ_TEST'] = '1'\n\n  def _create_config(self):\n    return config_utils.BuildFuzzersConfig()\n\n  def test_language_default(self):\n    \"\"\"Tests that the correct default language is set.\"\"\"\n    config = self._create_config()\n    self.assertEqual(config.language, 'c++')\n\n  def test_language(self):\n    \"\"\"Tests that the correct language is set.\"\"\"\n    language = 'python'\n    os.environ['LANGUAGE'] = language\n    config = self._create_config()\n    self.assertEqual(config.language, language)\n\n  def test_is_coverage(self):\n    \"\"\"Tests that is_coverage is set correctly.\"\"\"\n    # Test it is set when it is supposed to be.\n    os.environ['SANITIZER'] = 'coverage'\n    config = self._create_config()\n    self.assertTrue(config.is_coverage)\n\n    # Test it is not set when it is not supposed to be.\n    os.environ['SANITIZER'] = 'address'\n    config = self._create_config()\n    self.assertFalse(config.is_coverage)\n\n  @mock.patch('logging.error')\n  def test_validate_no_workspace(self, mock_error):\n    \"\"\"Tests that validate returns False if GITHUB_WORKSPACE isn't set.\"\"\"\n    os.environ['OSS_FUZZ_PROJECT_NAME'] = 'example'\n    config = self._create_config()\n    self.assertFalse(config.validate())\n    mock_error.assert_called_with('Must set WORKSPACE.')\n\n  @mock.patch('logging.error')\n  def test_validate_invalid_language(self, mock_error):\n    \"\"\"Tests that validate returns False if GITHUB_WORKSPACE isn't set.\"\"\"\n    os.environ['OSS_FUZZ_PROJECT_NAME'] = 'example'\n    os.environ['WORKSPACE'] = '/workspace'\n    os.environ['LANGUAGE'] = 'invalid-language'\n    config = self._create_config()\n    self.assertFalse(config.validate())\n    mock_error.assert_called_with('Invalid LANGUAGE: %s. Must be one of: %s.',\n                                  os.environ['LANGUAGE'], constants.LANGUAGES)\n\n  @mock.patch('logging.error')\n  def test_validate_invalid_sanitizer(self, mock_error):\n    \"\"\"Tests that validate returns False if GITHUB_WORKSPACE isn't set.\"\"\"\n    os.environ['OSS_FUZZ_PROJECT_NAME'] = 'example'\n    os.environ['WORKSPACE'] = '/workspace'\n    os.environ['SANITIZER'] = 'invalid-sanitizer'\n    config = self._create_config()\n    self.assertFalse(config.validate())\n    mock_error.assert_called_with('Invalid SANITIZER: %s. Must be one of: %s.',\n                                  os.environ['SANITIZER'],\n                                  config_utils.SANITIZERS)\n\n  def test_validate(self):\n    \"\"\"Tests that validate returns True if config is valid.\"\"\"\n    os.environ['OSS_FUZZ_PROJECT_NAME'] = 'example'\n    os.environ['WORKSPACE'] = '/workspace'\n    os.environ['REPOSITORY'] = 'repo'\n    config = self._create_config()\n    self.assertTrue(config.validate())\n\n  def test_base_os_version_external(self):\n    \"\"\"Tests that base_os_version is read correctly for external projects.\"\"\"\n    os.environ['PROJECT_SRC_PATH'] = '/src'\n    # Use patch to mock os.path.exists and open for the project.yaml\n    with mock.patch('os.path.exists', return_value=True) as mock_exists:\n      with mock.patch(\n          'builtins.open',\n          mock.mock_open(\n              read_data='base_os_version: ubuntu-24-04')) as mock_open:\n        config = self._create_config()\n        self.assertEqual(config.base_os_version, 'ubuntu-24-04')\n        # Verify it looked in the right place (PROJECT_SRC_PATH + .clusterfuzzlite)\n        expected_path = os.path.join('/src', '.clusterfuzzlite', 'project.yaml')\n        # We can't easily check the exact path without more mocking, but we can check it was called\n        mock_open.assert_called()\n\n  def test_base_os_version_external_quoted(self):\n    \"\"\"Tests that base_os_version handles quoted values for external projects.\"\"\"\n    os.environ['PROJECT_SRC_PATH'] = '/src'\n    # Use patch to mock os.path.exists and open for the project.yaml\n    with mock.patch('os.path.exists', return_value=True) as mock_exists:\n      with mock.patch(\n          'builtins.open',\n          mock.mock_open(\n              read_data='base_os_version: \"ubuntu-24-04\"')) as mock_open:\n        config = self._create_config()\n        self.assertEqual(config.base_os_version, 'ubuntu-24-04')\n\n  def test_base_os_version_default(self):\n    \"\"\"Tests that base_os_version defaults to legacy if not present.\"\"\"\n    os.environ['PROJECT_SRC_PATH'] = '/src'\n    with mock.patch('os.path.exists', return_value=False):\n      config = self._create_config()\n      self.assertEqual(config.base_os_version, 'legacy')\n\n\nclass BuildFuzzersConfigTest(unittest.TestCase):\n  \"\"\"Tests for BuildFuzzersConfig.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    os.environ['CIFUZZ_TEST'] = '1'\n\n  def _create_config(self):\n    return config_utils.BuildFuzzersConfig()\n\n  @mock.patch('platform_config.github._get_event_data', return_value={})\n  def test_github_base_ref(self, _):\n    \"\"\"Tests that base_ref is set properly.\"\"\"\n    expected_base_ref = 'expected_base_ref'\n    os.environ['GITHUB_BASE_REF'] = expected_base_ref\n    os.environ['CFL_PLATFORM'] = 'github'\n    os.environ['GITHUB_REPOSITORY'] = 'owner/repo'\n    config = self._create_config()\n    self.assertEqual(config.base_ref, expected_base_ref)\n\n  def test_base_ref(self):\n    \"\"\"Tests that base_ref is set properly.\"\"\"\n    expected_base_ref = 'expected_base_ref'\n    os.environ['GIT_BASE_REF'] = expected_base_ref\n    config = self._create_config()\n    self.assertEqual(config.base_ref, expected_base_ref)\n\n  def test_keep_unaffected_defaults_to_true(self):\n    \"\"\"Tests that keep_unaffected_fuzz_targets defaults to true.\"\"\"\n    config = self._create_config()\n    self.assertTrue(config.keep_unaffected_fuzz_targets)\n\n  def test_keep_unaffected_defaults_to_false_when_pr(self):\n    \"\"\"Tests that keep_unaffected_fuzz_targets defaults to false when from a\n    pr.\"\"\"\n    os.environ['GIT_BASE_REF'] = 'base-ref'\n    config = self._create_config()\n    self.assertFalse(config.keep_unaffected_fuzz_targets)\n\n\nclass RunFuzzersConfigTest(unittest.TestCase):\n  \"\"\"Tests for RunFuzzersConfig.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    os.environ['CIFUZZ_TEST'] = '1'\n\n  def _create_config(self):\n    return config_utils.RunFuzzersConfig()\n\n  def test_coverage(self):\n    \"\"\"Tests that mode is overriden properly based on is_coverage.\"\"\"\n    # Test that it is overriden when it is supposed to be.\n    os.environ['SANITIZER'] = 'coverage'\n    os.environ['MODE'] = 'code-change'\n    config = self._create_config()\n    self.assertEqual(config.mode, 'coverage')\n\n    # Test that it isn't overriden when it isn't supposed to be.\n    os.environ['SANITIZER'] = 'address'\n    mode = 'code-change'\n    os.environ['MODE'] = mode\n    config = self._create_config()\n    self.assertEqual(config.mode, mode)\n\n  def test_run_config_validate(self):\n    \"\"\"Tests that _run_config_validate returns True when the config is valid.\"\"\"\n    self.assertTrue(self._create_config()._run_config_validate())\n\n  @mock.patch('logging.error')\n  def test_run_config_invalid_mode(self, mock_error):\n    \"\"\"Tests that _run_config_validate returns False when mode is invalid.\"\"\"\n    fake_mode = 'fake-mode'\n    os.environ['MODE'] = fake_mode\n    self.assertFalse(self._create_config()._run_config_validate())\n    mock_error.assert_called_with('Invalid MODE: %s. Must be one of %s.',\n                                  fake_mode,\n                                  config_utils.RunFuzzersConfig.MODES)\n\n\nclass GetSanitizerTest(unittest.TestCase):\n  \"\"\"Tests for _get_sanitizer.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    self.sanitizer = 'memory'\n\n  def test_default_value(self):\n    \"\"\"Tests that the default value returned by _get_sanitizer is correct.\"\"\"\n    self.assertEqual(config_utils._get_sanitizer(), 'address')\n\n  def test_normal_case(self):\n    \"\"\"Tests that _get_sanitizer returns the correct value in normal cases.\"\"\"\n    os.environ['SANITIZER'] = self.sanitizer\n    self.assertEqual(config_utils._get_sanitizer(), self.sanitizer)\n\n  def test_capitalization(self):\n    \"\"\"Tests that that _get_sanitizer handles capitalization properly.\"\"\"\n    os.environ['SANITIZER'] = self.sanitizer.upper()\n    self.assertEqual(config_utils._get_sanitizer(), self.sanitizer)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/cifuzz/continuous_integration.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Implementations for various CI systems.\"\"\"\n\nimport os\nimport collections\nimport sys\nimport logging\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nimport build_specified_commit\nimport docker\nimport helper\nimport repo_manager\nimport retry\nimport utils\nimport workspace_utils\n\n# pylint: disable=too-few-public-methods\n\nBuildPreparationResult = collections.namedtuple(\n    'BuildPreparationResult', ['success', 'image_repo_path', 'repo_manager'])\n\n_IMAGE_BUILD_TRIES = 3\n_IMAGE_BUILD_BACKOFF = 2\n\n\ndef fix_git_repo_for_diff(repo_manager_obj):\n  \"\"\"Fixes git repos cloned by the \"checkout\" action so that diffing works on\n  them.\"\"\"\n  command = [\n      'git', 'symbolic-ref', 'refs/remotes/origin/HEAD',\n      'refs/remotes/origin/master'\n  ]\n  return utils.execute(command, location=repo_manager_obj.repo_dir)\n\n\nclass BaseCi:\n  \"\"\"Class representing common CI functionality.\"\"\"\n\n  def __init__(self, config):\n    self.config = config\n    self.workspace = workspace_utils.Workspace(config)\n    self._repo_dir = None\n\n  @property\n  def repo_dir(self):\n    \"\"\"Returns the source repo path, if it has been checked out. None is\n    returned otherwise.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def prepare_for_fuzzer_build(self):\n    \"\"\"Builds the fuzzer builder image and gets the source code we need to\n    fuzz.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def get_diff_base(self):\n    \"\"\"Returns the base to diff against with git to get the change under\n    test.\"\"\"\n    if self.config.base_ref:\n      logging.debug('Diffing against base_ref: %s.', self.config.base_ref)\n      return self.config.base_ref\n    if self.config.base_commit:\n      logging.debug('Diffing against base_commit: %s.', self.config.base_commit)\n      return self.config.base_commit\n    # TODO(metzman): Do we want this at all? What purpose does it serve? I guess\n    # it is a decent fallback when there is no base_commit or base_ref.\n    logging.debug('Diffing against origin.')\n    return 'origin'\n\n  def get_changed_code_under_test(self, repo_manager_obj):\n    \"\"\"Returns the changed files that need to be tested.\"\"\"\n    if self.config.base_ref:\n      repo_manager_obj.fetch_branch(self.config.base_ref)\n    fix_git_repo_for_diff(repo_manager_obj)\n    base = self.get_diff_base()\n    logging.info('Diffing against %s.', base)\n    # git diff <commit>... is equivalent to\n    # git diff $(git merge-base <commit> HEAD)\n    return repo_manager_obj.get_git_diff(base + '...')\n\n  def get_build_command(self, host_repo_path, image_repo_path):\n    \"\"\"Returns the command for building the project that is run inside the\n    project builder container.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def _build_external_project_docker_image(self, manager):\n    \"\"\"Helper for child classes that builds an external project's docker image.\n    Returns a BuildPreparationResult indicating failure or success.\"\"\"\n    build_integration_abs_path = os.path.join(\n        manager.repo_dir, self.config.build_integration_path)\n    if not build_external_project_docker_image(manager.repo_dir,\n                                               build_integration_abs_path):\n      logging.error('Failed to build external project.')\n      return get_build_preparation_failure()\n    image_repo_path = os.path.join('/src', self.config.project_repo_name)\n    return BuildPreparationResult(success=True,\n                                  image_repo_path=image_repo_path,\n                                  repo_manager=manager)\n\n  def _make_repo_storage_dir(self):\n    os.makedirs(self.workspace.repo_storage, exist_ok=True)\n\n  def _clone_repo_and_checkout(self, repo_url, repo_name):\n    \"\"\"Helper for child classes that clones the git repo specified by |repo_url|\n    to |repo_name|, checks out the specified commit, and returns the\n    |manager|.\"\"\"\n    self._make_repo_storage_dir()\n    # Checkout project's repo in the shared volume.\n    manager = repo_manager.clone_repo_and_get_manager(\n        repo_url,\n        self.workspace.repo_storage,\n        repo_name=repo_name,\n        username=self.config.actor,\n        password=self.config.token)\n    self._checkout_specified_commit(manager)\n    return manager\n\n  def _checkout_specified_commit(self, manager):\n    checkout_specified_commit(manager, self.config.pr_ref, self.config.git_sha)\n\n  def _detect_main_repo(self):\n    \"\"\"Helper for child classes that detects the main repo and returns a tuple\n    containing the inffered url and path to the repo in the image.\"\"\"\n    inferred_url, image_repo_path = build_specified_commit.detect_main_repo(\n        self.config.oss_fuzz_project_name,\n        repo_name=self.config.project_repo_name)\n    if not inferred_url or not image_repo_path:\n      logging.error('Could not detect repo.')\n    return inferred_url, image_repo_path\n\n  def _create_repo_manager_for_project_src_path(self):\n    \"\"\"Returns a repo manager for |project_src_path|.\"\"\"\n    return repo_manager.RepoManager(self.config.project_src_path)\n\n\ndef get_build_command():\n  \"\"\"Returns the command to build the project inside the project builder\n  container.\"\"\"\n  return 'compile'\n\n\ndef get_replace_repo_and_build_command(host_repo_path, image_repo_path):\n  \"\"\"Returns the command to replace the repo located at |image_repo_path| with\n  |host_repo_path| and build the project inside the project builder\n  container.\"\"\"\n  rm_path = os.path.join(image_repo_path, '*')\n  image_src_path = os.path.dirname(image_repo_path)\n  build_command = get_build_command()\n  command = (f'cd / && rm -rf {rm_path} && cp -r {host_repo_path} '\n             f'{image_src_path} && cd - && {build_command}')\n  return command\n\n\ndef get_ci(config):\n  \"\"\"Determines what kind of CI is being used and returns the object\n  representing that system.\"\"\"\n\n  if config.platform == config.Platform.EXTERNAL_GENERIC_CI:\n    # Non-OSS-Fuzz projects must bring their own source and their own build\n    # integration (which is relative to that source).\n    return ExternalGeneric(config)\n  if config.platform == config.Platform.EXTERNAL_GITHUB:\n    # Non-OSS-Fuzz projects must bring their own source and their own build\n    # integration (which is relative to that source).\n    return ExternalGithub(config)\n\n  if config.platform == config.Platform.INTERNAL_GENERIC_CI:\n    # Builds of OSS-Fuzz projects not hosted on Github must bring their own\n    # source since the checkout logic CIFuzz implements is github-specific.\n    # TODO(metzman): Consider moving Github-actions builds of OSS-Fuzz projects\n    # to this system to reduce implementation complexity.\n    return InternalGeneric(config)\n\n  return InternalGithub(config)\n\n\ndef checkout_specified_commit(repo_manager_obj, pr_ref, git_sha):\n  \"\"\"Checks out the specified commit or pull request using\n  |repo_manager_obj|.\"\"\"\n  try:\n    if pr_ref:\n      repo_manager_obj.checkout_pr(pr_ref)\n    else:\n      repo_manager_obj.checkout_commit(git_sha)\n  except (RuntimeError, ValueError):\n    logging.error(\n        'Can not check out requested state %s. '\n        'Using current repo state.', pr_ref or git_sha)\n\n\nclass GithubCiMixin:\n  \"\"\"Mixin for Github based CI systems.\"\"\"\n\n  def __init__(self, config):\n    super().__init__(config)\n    # Unlike in other classes, here _repo_dir is the parent directory of the\n    # repo, not its actual directory.\n    self._repo_dir = self.workspace.repo_storage\n\n  @property\n  def repo_dir(self):\n    \"\"\"Returns the source repo path, if it has been checked out. None is\n    returned otherwise.\"\"\"\n    if not os.path.exists(self._repo_dir):\n      logging.warning('Repo dir: %s does not exist.', self._repo_dir)\n      return None\n\n    # Note: this assumes there is only one repo checked out here.\n    listing = os.listdir(self._repo_dir)\n    if len(listing) != 1:\n      raise RuntimeError('Invalid repo directory.')\n\n    repo_path = os.path.join(self._repo_dir, listing[0])\n    if not os.path.isdir(repo_path):\n      raise RuntimeError('Repo is not a directory.')\n\n    return repo_path\n\n\nclass InternalGithub(GithubCiMixin, BaseCi):\n  \"\"\"Class representing CI for an OSS-Fuzz project on Github Actions.\"\"\"\n\n  def _copy_repo_from_image(self, image_repo_path):\n    self._make_repo_storage_dir()\n    repo_name = os.path.basename(image_repo_path)\n    host_repo_path = os.path.join(self._repo_dir, repo_name)\n    bash_command = f'cp -r {image_repo_path} {host_repo_path}'\n    docker_args, _ = docker.get_base_docker_run_args(\n        self.workspace, self.config.sanitizer, self.config.language,\n        self.config.architecture, self.config.docker_in_docker)\n    docker_args.extend([\n        docker.get_project_image_name(self.config.oss_fuzz_project_name),\n        '/bin/bash', '-c', bash_command\n    ])\n    if not helper.docker_run(docker_args):\n      raise RuntimeError('Failed to copy repo.')\n    return repo_manager.RepoManager(host_repo_path)\n\n  def prepare_for_fuzzer_build(self):\n    \"\"\"Builds the fuzzer builder image, checks out the pull request/commit and\n    returns the BuildPreparationResult.\"\"\"\n    logging.info('InternalGithub: preparing for fuzzer build.')\n    assert self.config.pr_ref or self.config.git_sha\n    # _detect_main_repo builds the image as a side effect.\n    _, image_repo_path = self._detect_main_repo()\n    if not image_repo_path:\n      return get_build_preparation_failure()\n\n    # Use the same name used in the docker image so we can overwrite it.\n    manager = self._copy_repo_from_image(image_repo_path)\n    self._checkout_specified_commit(manager)\n    return BuildPreparationResult(success=True,\n                                  image_repo_path=image_repo_path,\n                                  repo_manager=manager)\n\n  def get_build_command(self, host_repo_path, image_repo_path):  # pylint: disable=no-self-use\n    \"\"\"Returns the command for building the project that is run inside the\n    project builder container. Command also replaces |image_repo_path| with\n    |host_repo_path|.\"\"\"\n    return get_replace_repo_and_build_command(host_repo_path, image_repo_path)\n\n\ndef get_build_preparation_failure():\n  \"\"\"Returns a BuildPreparationResult indicating failure.\"\"\"\n  return BuildPreparationResult(success=False,\n                                image_repo_path=None,\n                                repo_manager=None)\n\n\nclass InternalGeneric(BaseCi):\n  \"\"\"Class representing CI for an OSS-Fuzz project on a CI other than Github\n  actions.\"\"\"\n\n  def __init__(self, config):\n    super().__init__(config)\n    self._repo_dir = config.project_src_path\n\n  @property\n  def repo_dir(self):\n    \"\"\"Returns the source repo path, if it has been checked out. None is\n    returned otherwise.\"\"\"\n    return self._repo_dir\n\n  def prepare_for_fuzzer_build(self):\n    \"\"\"Builds the project builder image for an OSS-Fuzz project outside of\n    GitHub actions. Returns the repo_manager. Does not checkout source code\n    since external projects are expected to bring their own source code to\n    CIFuzz.\"\"\"\n    logging.info('InternalGeneric: preparing for fuzzer build.')\n    # detect_main_repo builds the image as a side effect.\n    _, image_repo_path = self._detect_main_repo()\n\n    if not image_repo_path:\n      return get_build_preparation_failure()\n\n    manager = self._create_repo_manager_for_project_src_path()\n    return BuildPreparationResult(success=True,\n                                  image_repo_path=image_repo_path,\n                                  repo_manager=manager)\n\n  def get_build_command(self, host_repo_path, image_repo_path):  # pylint: disable=no-self-use\n    \"\"\"Returns the command for building the project that is run inside the\n    project builder container. Command also replaces |image_repo_path| with\n    |host_repo_path|.\"\"\"\n    return get_replace_repo_and_build_command(host_repo_path, image_repo_path)\n\n\n@retry.wrap(_IMAGE_BUILD_TRIES, _IMAGE_BUILD_BACKOFF)\ndef build_external_project_docker_image(project_src, build_integration_path):\n  \"\"\"Builds the project builder image for an external (non-OSS-Fuzz) project.\n  Returns True on success.\"\"\"\n  dockerfile_path = os.path.join(build_integration_path, 'Dockerfile')\n  command = [\n      '-t', docker.EXTERNAL_PROJECT_IMAGE, '-f', dockerfile_path, project_src\n  ]\n  return helper.docker_build(command)\n\n\nclass ExternalGeneric(BaseCi):\n  \"\"\"CI implementation for generic CI for external (non-OSS-Fuzz) projects.\"\"\"\n\n  def __init__(self, config):\n    super().__init__(config)\n    self._repo_dir = config.project_src_path\n\n  @property\n  def repo_dir(self):\n    \"\"\"Returns the source repo path, if it has been checked out. None is\n    returned otherwise.\"\"\"\n    return self._repo_dir\n\n  def prepare_for_fuzzer_build(self):\n    logging.info('ExternalGeneric: preparing for fuzzer build.')\n    manager = self._create_repo_manager_for_project_src_path()\n    return self._build_external_project_docker_image(manager)\n\n  def get_build_command(self, host_repo_path, image_repo_path):  # pylint: disable=no-self-use\n    \"\"\"Returns the command for building the project that is run inside the\n    project builder container.\"\"\"\n    return get_build_command()\n\n\nclass ExternalGithub(GithubCiMixin, BaseCi):\n  \"\"\"Class representing CI for a non-OSS-Fuzz project on Github Actions.\"\"\"\n\n  def prepare_for_fuzzer_build(self):\n    \"\"\"Builds the project builder image for a non-OSS-Fuzz project on GitHub\n    actions. Sets the repo manager. Does not checkout source code since external\n    projects are expected to bring their own source code to CIFuzz. Returns True\n    on success.\"\"\"\n    logging.info('ExternalGithub: preparing for fuzzer build.')\n    # Checkout before building, so we don't need to rely on copying the source\n    # from the image.\n    # TODO(metzman): Figure out if we want second copy at all.\n    manager = self._clone_repo_and_checkout(self.config.git_url,\n                                            self.config.project_repo_name)\n    return self._build_external_project_docker_image(manager)\n\n  def get_build_command(self, host_repo_path, image_repo_path):  # pylint: disable=no-self-use\n    \"\"\"Returns the command for building the project that is run inside the\n    project builder container.\"\"\"\n    return get_build_command()\n"
  },
  {
    "path": "infra/cifuzz/continuous_integration_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for continuous_integration_module.\"\"\"\nimport os\nimport sys\nimport unittest\nfrom unittest import mock\n\nimport continuous_integration\nimport docker\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport repo_manager\n\n# pylint: disable=no-self-use\n\n\nclass FixGitRepoForDiffTest(unittest.TestCase):\n  \"\"\"Tests for fix_git_repo_for_diff.\"\"\"\n\n  @mock.patch('utils.execute')\n  def test_fix_git_repo_for_diff(self, mock_execute):\n    \"\"\"Tests that fix_git_repo_for_diff works as intended.\"\"\"\n    repo_dir = '/dir'\n    repo_manager_obj = repo_manager.RepoManager(repo_dir)\n    continuous_integration.fix_git_repo_for_diff(repo_manager_obj)\n    expected_command = [\n        'git', 'symbolic-ref', 'refs/remotes/origin/HEAD',\n        'refs/remotes/origin/master'\n    ]\n\n    mock_execute.assert_called_with(expected_command, location=repo_dir)\n\n\nclass GetBuildCommand(unittest.TestCase):\n  \"\"\"Tests for get_build_command.\"\"\"\n\n  def test_build_command(self):\n    \"\"\"Tests that get_build_command works as intended.\"\"\"\n    self.assertEqual(continuous_integration.get_build_command(), 'compile')\n\n\nclass GetReplaceRepoAndBuildCommand(unittest.TestCase):\n  \"\"\"Tests for get_replace_repo_and_build_command.\"\"\"\n\n  def test_get_replace_repo_and_build_command(self):\n    \"\"\"Tests that get_replace_repo_and_build_command works as intended.\"\"\"\n    host_repo_path = '/path/on/host/to/repo'\n    image_repo_path = '/src/repo'\n    command = continuous_integration.get_replace_repo_and_build_command(\n        host_repo_path, image_repo_path)\n    expected_command = ('cd / && rm -rf /src/repo/* && '\n                        'cp -r /path/on/host/to/repo /src && cd - '\n                        '&& compile')\n    self.assertEqual(command, expected_command)\n\n\nclass BuildExternalProjetDockerImage(unittest.TestCase):\n  \"\"\"Tests for build_external_project_docker_image.\"\"\"\n\n  @mock.patch('helper.docker_build')\n  def test_build_external_project_docker_image(self, mock_docker_build):\n    \"\"\"Tests that build_external_project_docker_image works as intended.\"\"\"\n    build_integration_path = '.clusterfuzzlite'\n    project_src = '/path/to/project/src'\n    continuous_integration.build_external_project_docker_image(\n        project_src, build_integration_path)\n\n    mock_docker_build.assert_called_with([\n        '-t', docker.EXTERNAL_PROJECT_IMAGE, '-f',\n        os.path.join('.clusterfuzzlite', 'Dockerfile'), project_src\n    ])\n\n\n# TODO(metzman): Write tests for the rest of continuous_integration.py.\n"
  },
  {
    "path": "infra/cifuzz/docker.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for dealing with docker.\"\"\"\nimport logging\nimport os\nimport sys\nimport uuid\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport constants\nimport utils\nimport environment\n\nBASE_BUILDER_TAG = 'gcr.io/oss-fuzz-base/base-builder'\nPROJECT_TAG_PREFIX = 'gcr.io/oss-fuzz/'\n\n# Default fuzz configuration.\n_DEFAULT_DOCKER_RUN_ARGS = [\n    '-e', 'FUZZING_ENGINE=' + constants.DEFAULT_ENGINE, '-e', 'CIFUZZ=True'\n]\n\nUNIQUE_ID_SUFFIX = '-' + uuid.uuid4().hex\n\n# TODO(metzman): Make run_fuzzers able to delete this image.\nEXTERNAL_PROJECT_IMAGE = 'external-cfl-project' + UNIQUE_ID_SUFFIX\n\n_DEFAULT_DOCKER_RUN_COMMAND = [\n    'docker',\n    'run',\n    '--rm',\n    '--privileged',\n]\n\n\ndef get_docker_env_vars(env_mapping):\n  \"\"\"Returns a list of docker arguments that sets each key in |env_mapping| as\n  an env var and the value of that key in |env_mapping| as the value.\"\"\"\n  env_var_args = []\n  for env_var, env_var_val in env_mapping.items():\n    env_var_args.extend(['-e', f'{env_var}={env_var_val}'])\n  return env_var_args\n\n\ndef get_project_image_name(project):\n  \"\"\"Returns the name of the project builder image for |project_name|.\"\"\"\n  # TODO(jonathanmetzman): We may need unique names to support parallel fuzzing\n  # for CIFuzz (like CFL supports). Don't do this for now because no one has\n  # asked for it and build_specified_commit would need to be modified to support\n  # this.\n  if project:\n    return PROJECT_TAG_PREFIX + project\n\n  return EXTERNAL_PROJECT_IMAGE\n\n\ndef delete_images(images):\n  \"\"\"Deletes |images|.\"\"\"\n  command = ['docker', 'rmi', '-f'] + images\n  utils.execute(command)\n  utils.execute(['docker', 'builder', 'prune', '-f'])\n\n\ndef get_base_docker_run_args(workspace,\n                             sanitizer=constants.DEFAULT_SANITIZER,\n                             language=constants.DEFAULT_LANGUAGE,\n                             architecture=constants.DEFAULT_ARCHITECTURE,\n                             docker_in_docker=False):\n  \"\"\"Returns arguments that should be passed to every invocation of 'docker\n  run'.\"\"\"\n  docker_args = _DEFAULT_DOCKER_RUN_ARGS.copy()\n  env_mapping = {\n      'SANITIZER': sanitizer,\n      'ARCHITECTURE': architecture,\n      'FUZZING_LANGUAGE': language,\n      'OUT': workspace.out\n  }\n  docker_args += get_docker_env_vars(env_mapping)\n  docker_container = environment.get('CFL_CONTAINER_ID',\n                                     utils.get_container_name())\n  logging.info('Docker container: %s.', docker_container)\n  if docker_container and not docker_in_docker:\n    # Don't map specific volumes if in a docker container, it breaks when\n    # running a sibling container.\n    docker_args += ['--volumes-from', docker_container]\n  else:\n    docker_args += _get_args_mapping_host_path_to_container(workspace.workspace)\n  return docker_args, docker_container\n\n\ndef get_base_docker_run_command(workspace,\n                                sanitizer=constants.DEFAULT_SANITIZER,\n                                language=constants.DEFAULT_LANGUAGE,\n                                architecture=constants.DEFAULT_ARCHITECTURE,\n                                docker_in_docker=False):\n  \"\"\"Returns part of the command that should be used everytime 'docker run' is\n  invoked.\"\"\"\n  docker_args, docker_container = get_base_docker_run_args(\n      workspace,\n      sanitizer,\n      language,\n      architecture,\n      docker_in_docker=docker_in_docker)\n  command = _DEFAULT_DOCKER_RUN_COMMAND.copy() + docker_args\n  return command, docker_container\n\n\ndef _get_args_mapping_host_path_to_container(host_path, container_path=None):\n  \"\"\"Get arguments to docker run that will map |host_path| a path on the host to\n  a path in the container. If |container_path| is specified, that path is mapped\n  to. If not, then |host_path| is mapped to itself in the container.\"\"\"\n  # WARNING: Do not use this function when running in production (and\n  # --volumes-from) is used for mapping volumes. It will break production.\n  container_path = host_path if container_path is None else container_path\n  return ['-v', f'{host_path}:{container_path}']\n"
  },
  {
    "path": "infra/cifuzz/docker_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests the functionality of the docker module.\"\"\"\nimport unittest\nfrom unittest import mock\n\nimport docker\nimport test_helpers\nimport workspace_utils\n\nCONTAINER_NAME = 'example-container'\nconfig = test_helpers.create_run_config(oss_fuzz_project_name='project',\n                                        workspace='/workspace')\nconfig.workspace = '/workspace'\nWORKSPACE = workspace_utils.Workspace(config)\nSANITIZER = 'example-sanitizer'\nLANGUAGE = 'example-language'\n\n\nclass GetProjectImageTest(unittest.TestCase):\n  \"\"\"Tests for get_project_image.\"\"\"\n\n  def test_get_project_image(self):\n    \"\"\"Tests that get_project_image_name works as intended.\"\"\"\n    project = 'my-project'\n    self.assertEqual(docker.get_project_image_name(project),\n                     'gcr.io/oss-fuzz/my-project')\n\n\nclass GetDeleteImagesTest(unittest.TestCase):\n  \"\"\"Tests for delete_images.\"\"\"\n\n  @mock.patch('utils.execute')\n  def test_delete_images(self, mock_execute):  # pylint: disable=no-self-use\n    \"\"\"Tests that get_project_image_name works as intended.\"\"\"\n    images = ['image']\n    docker.delete_images(images)\n    expected_calls = [\n        mock.call(['docker', 'rmi', '-f'] + images),\n        mock.call(['docker', 'builder', 'prune', '-f'])\n    ]\n\n    mock_execute.assert_has_calls(expected_calls)\n\n\nclass GetBaseDockerRunArgsTest(unittest.TestCase):\n  \"\"\"Tests get_base_docker_run_args.\"\"\"\n\n  @mock.patch('utils.get_container_name', return_value=CONTAINER_NAME)\n  def test_get_base_docker_run_args_container(self, _):\n    \"\"\"Tests that get_base_docker_run_args works as intended when inside a\n    container.\"\"\"\n    docker_args, docker_container = docker.get_base_docker_run_args(\n        WORKSPACE, SANITIZER, LANGUAGE)\n    self.assertEqual(docker_container, CONTAINER_NAME)\n    expected_docker_args = []\n    expected_docker_args = [\n        '-e',\n        'FUZZING_ENGINE=libfuzzer',\n        '-e',\n        'CIFUZZ=True',\n        '-e',\n        f'SANITIZER={SANITIZER}',\n        '-e',\n        'ARCHITECTURE=x86_64',\n        '-e',\n        f'FUZZING_LANGUAGE={LANGUAGE}',\n        '-e',\n        f'OUT={WORKSPACE.out}',\n        '--volumes-from',\n        CONTAINER_NAME,\n    ]\n    self.assertEqual(docker_args, expected_docker_args)\n\n  @mock.patch('utils.get_container_name', return_value=None)\n  def test_get_base_docker_run_args_no_container(self, _):\n    \"\"\"Tests that get_base_docker_run_args works as intended when not inside a\n    container.\"\"\"\n    docker_args, docker_container = docker.get_base_docker_run_args(\n        WORKSPACE, SANITIZER, LANGUAGE)\n    self.assertEqual(docker_container, None)\n    expected_docker_args = [\n        '-e', 'FUZZING_ENGINE=libfuzzer', '-e', 'CIFUZZ=True', '-e',\n        f'SANITIZER={SANITIZER}', '-e', 'ARCHITECTURE=x86_64', '-e',\n        f'FUZZING_LANGUAGE={LANGUAGE}', '-e', f'OUT={WORKSPACE.out}', '-v',\n        f'{WORKSPACE.workspace}:{WORKSPACE.workspace}'\n    ]\n    self.assertEqual(docker_args, expected_docker_args)\n\n\nclass GetBaseDockerRunCommandTest(unittest.TestCase):\n  \"\"\"Tests get_base_docker_run_args.\"\"\"\n\n  @mock.patch('utils.get_container_name', return_value=None)\n  def test_get_base_docker_run_command_no_container(self, _):\n    \"\"\"Tests that get_base_docker_run_args works as intended when not inside a\n    container.\"\"\"\n    docker_args, docker_container = docker.get_base_docker_run_command(\n        WORKSPACE, SANITIZER, LANGUAGE)\n    self.assertEqual(docker_container, None)\n    expected_docker_command = [\n        'docker', 'run', '--rm', '--privileged', '-e',\n        'FUZZING_ENGINE=libfuzzer', '-e', 'CIFUZZ=True', '-e',\n        f'SANITIZER={SANITIZER}', '-e', 'ARCHITECTURE=x86_64', '-e',\n        f'FUZZING_LANGUAGE={LANGUAGE}', '-e', f'OUT={WORKSPACE.out}', '-v',\n        f'{WORKSPACE.workspace}:{WORKSPACE.workspace}'\n    ]\n    self.assertEqual(docker_args, expected_docker_command)\n"
  },
  {
    "path": "infra/cifuzz/environment.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for dealing with env vars.\"\"\"\n\nimport ast\nimport os\n\n\ndef _eval_value(value_string):\n  \"\"\"Returns evaluated value.\"\"\"\n  try:\n    return ast.literal_eval(value_string)\n  except:  # pylint: disable=bare-except\n    # String fallback.\n    return value_string\n\n\ndef get(env_var, default_value=None):\n  \"\"\"Returns an environment variable value.\"\"\"\n  value_string = os.getenv(env_var)\n  if value_string is None:\n    return default_value\n\n  return _eval_value(value_string)\n\n\ndef get_bool(env_var, default_value=None):\n  \"\"\"Returns a boolean environment variable value. This is needed because a lot\n  of CIFuzz users specified 'false' for dry-run. So we need to special case\n  this.\"\"\"\n  value = get(env_var, default_value)\n  if not isinstance(value, str):\n    return bool(value)\n\n  lower_value = value.lower()\n  allowed_values = {'true', 'false'}\n  if lower_value not in allowed_values:\n    raise Exception(f'Bool env var {env_var} value {value} is invalid. '\n                    f'Must be one of {allowed_values}.')\n  return lower_value == 'true'\n"
  },
  {
    "path": "infra/cifuzz/example_cifuzz.yml",
    "content": "name: CIFuzz\non: [pull_request]\npermissions: {}\njobs:\n  Fuzzing:\n    runs-on: ubuntu-latest\n    permissions:\n      security-events: write\n    steps:\n    - name: Build Fuzzers\n      id: build\n      uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master\n      with:\n        oss-fuzz-project-name: 'example'\n    - name: Run Fuzzers\n      uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master\n      with:\n        oss-fuzz-project-name: 'example'\n        fuzz-seconds: 600\n        output-sarif: true\n    - name: Upload Crash\n      uses: actions/upload-artifact@v4\n      if: failure() && steps.build.outcome == 'success'\n      with:\n        name: artifacts\n        path: ./out/artifacts\n    - name: Upload Sarif\n      if: always() && steps.build.outcome == 'success'\n      uses: github/codeql-action/upload-sarif@v2\n      with:\n        # Path to SARIF file relative to the root of the repository\n        sarif_file: cifuzz-sarif/results.sarif\n        checkout_path: cifuzz-sarif\n"
  },
  {
    "path": "infra/cifuzz/external-actions/build_fuzzers/action.yml",
    "content": "# action.yml\nname: 'build-fuzzers'\ndescription: \"Builds an OSS-Fuzz project's fuzzers.\"\ninputs:\n  language:\n    description: 'Programming language project is written in.'\n    required: false\n    default: 'c++'\n  dry-run:\n    description: 'If set, run the action without actually reporting a failure.'\n    default: false\n  allowed-broken-targets-percentage:\n    description: 'The percentage of broken targets allowed in bad_build_check.'\n    required: false\n  sanitizer:\n    description: 'The sanitizer to build the fuzzers with.'\n    default: 'address'\n  project-src-path:\n    description: \"The path to the project's source code checkout.\"\n    required: false\n  bad-build-check:\n    description: \"Whether or not OSS-Fuzz's check for bad builds should be done.\"\n    required: false\n    default: true\n  keep-unaffected-fuzz-targets:\n    description: \"Whether to keep unaffected fuzzers or delete them.\"\n    required: false\n    default: false\n  storage-repo:\n    description: |\n      The git repo to use for storing certain artifacts from fuzzing.\n    required: false\n  storage-repo-branch:\n    description: |\n      The branch of the git repo to use for storing certain artifacts from\n      fuzzing.\n    required: false\n  storage-repo-branch-coverage:\n    description: |\n      The branch of the git repo to use for storing coverage reports.\n    required: false\n  upload-build:\n    description: |\n      If set, will upload the build.\n    default: false\n  github-token:\n    description: |\n      Token for GitHub API. WARNING: THIS SHOULD NOT BE USED IN PRODUCTION YET\n      You should use \"secrets.GITHUB_TOKEN\" in your workflow file, do not\n      hardcode the token.\n      TODO(https://github.com/google/oss-fuzz/pull/5841#discussion_r639393361):\n      Document locking this down.\n    required: false\n  output-sarif:\n    description: \"Whether to output fuzzing results to SARIF.\"\n    required: false\n    default: false\nruns:\n  using: 'docker'\n  image: '../../../build_fuzzers.Dockerfile'\n  env:\n    OSS_FUZZ_PROJECT_NAME: ${{ inputs.oss-fuzz-project-name }}\n    LANGUAGE: ${{ inputs.language }}\n    DRY_RUN: ${{ inputs.dry-run}}\n    ALLOWED_BROKEN_TARGETS_PERCENTAGE: ${{ inputs.allowed-broken-targets-percentage}}\n    SANITIZER: ${{ inputs.sanitizer }}\n    PROJECT_SRC_PATH: ${{ inputs.project-src-path }}\n    GITHUB_TOKEN: ${{ inputs.github-token }}\n    LOW_DISK_SPACE: 'True'\n    BAD_BUILD_CHECK: ${{ inputs.bad-build-check }}\n    UPLOAD_BUILD: ${{ inputs.upload-build }}\n    CIFUZZ_DEBUG: 'True'\n    CFL_PLATFORM: 'github'\n    KEEP_UNAFFECTED_FUZZ_TARGETS: ${{ inputs.keep-unaffected-fuzz-targets }}\n    OUTPUT_SARIF: ${{ inputs.output-sarif }}\n"
  },
  {
    "path": "infra/cifuzz/external-actions/run_fuzzers/action.yml",
    "content": "# action.yml\nname: 'run-fuzzers'\ndescription: 'Runs fuzz target binaries for a specified length of time.'\ninputs:\n  language:\n    description: 'Programming language project is written in.'\n    required: false\n    default: 'c++'\n  fuzz-seconds:\n    description: 'The total time allotted for fuzzing in seconds.'\n    required: true\n    default: 600\n  dry-run:\n    description: 'If set, run the action without actually reporting a failure.'\n    default: false\n  sanitizer:\n    description: 'The sanitizer to run the fuzzers with.'\n    default: 'address'\n  mode:\n    description: |\n      The mode to run the fuzzers with (\"code-change\", \"batch\", \"coverage\", or \"prune\").\n      \"code-change\" is for fuzzing a pull request or commit.\n      \"batch\" is for non-interactive fuzzing of an entire project.\n      \"coverage\" is for coverage generation.\n      \"prune\" is for corpus pruning.\n    required: false\n    default: 'code-change'\n  github-token:\n    description: |\n      Token for GitHub API. WARNING: THIS SHOULD NOT BE USED IN PRODUCTION YET\n      You should use \"secrets.GITHUB_TOKEN\" in your workflow file, do not\n      hardcode the token.\n      TODO(https://github.com/google/oss-fuzz/pull/5841#discussion_r639393361):\n      Document locking this down.\n    required: true\n  storage-repo:\n    description: |\n      The git repo to use for storing certain artifacts from fuzzing.\n    required: false\n  storage-repo-branch:\n    description: |\n      The branch of the git repo to use for storing certain artifacts from\n      fuzzing.\n    default: main\n    required: false\n  storage-repo-branch-coverage:\n    description: |\n      The branch of the git repo to use for storing coverage reports.\n    default: gh-pages\n    required: false\n  report-unreproducible-crashes:\n    description: 'If True, then unreproducible crashes will be reported.'\n    required: false\n    default: false\n  minimize-crashes:\n    description: 'If True, reportable crashes will be minimized.'\n    required: false\n    default: False\n  parallel-fuzzing:\n    description: \"How many cores to use cores for fuzzing. A specific number, True - all available cores or False to run single threaded on a single core.\"\n    required: false\n    default: false\n  output-sarif:\n    description: \"Whether to output fuzzing results to SARIF.\"\n    required: false\n    default: false\n  report-timeouts:\n    description: \"Whether to report fails due to timeout.\"\n    required: false\n    default: true\n  report-ooms:\n    description: \"Whether to report fails due to OOM.\"\n    required: false\n    default: true\nruns:\n  using: 'docker'\n  image: '../../../run_fuzzers.Dockerfile'\n  env:\n    OSS_FUZZ_PROJECT_NAME: ${{ inputs.oss-fuzz-project-name }}\n    LANGUAGE: ${{ inputs.language }}\n    FUZZ_SECONDS: ${{ inputs.fuzz-seconds }}\n    DRY_RUN: ${{ inputs.dry-run}}\n    SANITIZER: ${{ inputs.sanitizer }}\n    MODE: ${{ inputs.mode }}\n    GITHUB_TOKEN: ${{ inputs.github-token }}\n    LOW_DISK_SPACE: 'True'\n    GIT_STORE_REPO: ${{ inputs.storage-repo }}\n    GIT_STORE_BRANCH: ${{ inputs.storage-repo-branch }}\n    GIT_STORE_BRANCH_COVERAGE: ${{ inputs.storage-repo-branch-coverage }}\n    REPORT_UNREPRODUCIBLE_CRASHES: ${{ inputs.report-unreproducible-crashes }}\n    MINIMIZE_CRASHES: ${{ inputs.minimize-crashes }}\n    CIFUZZ_DEBUG: 'True'\n    CFL_PLATFORM: 'github'\n    PARALLEL_FUZZING: ${{ inputs.parallel-fuzzing }}\n    OUTPUT_SARIF: ${{ inputs.output-sarif }}\n    REPORT_TIMEOUTS: ${{ inputs.report-timeouts }}\n    REPORT_OOMS: ${{ inputs.report-ooms}}\n"
  },
  {
    "path": "infra/cifuzz/filestore/__init__.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for a generic filestore.\"\"\"\n\n\nclass FilestoreError(Exception):\n  \"\"\"Error using the filestore.\"\"\"\n\n\n# pylint: disable=unused-argument,no-self-use\nclass BaseFilestore:\n  \"\"\"Base class for a filestore.\"\"\"\n\n  def __init__(self, config):\n    self.config = config\n\n  def upload_crashes(self, name, directory):\n    \"\"\"Uploads the crashes at |directory| to |name|.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def upload_corpus(self, name, directory, replace=False):\n    \"\"\"Uploads the corpus at |directory| to |name|.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def upload_build(self, name, directory):\n    \"\"\"Uploads the build at |directory| to |name|.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def upload_coverage(self, name, directory):\n    \"\"\"Uploads the coverage report at |directory| to |name|.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def download_corpus(self, name, dst_directory):\n    \"\"\"Downloads the corpus located at |name| to |dst_directory|.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def download_build(self, name, dst_directory):\n    \"\"\"Downloads the build with |name| to |dst_directory|.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def download_coverage(self, name, dst_directory):\n    \"\"\"Downloads the latest project coverage report.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n"
  },
  {
    "path": "infra/cifuzz/filestore/filesystem/__init__.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Filestore implementation using a filesystem directory.\"\"\"\nimport logging\nimport os\nimport shutil\nimport subprocess\nimport sys\n\nfrom distutils import dir_util\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(\n    os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir,\n                 os.pardir, os.pardir))\nimport filestore\n\n\ndef recursive_list_dir(directory):\n  \"\"\"Returns list of all files in |directory|, including those in\n  subdirectories.\"\"\"\n  files = []\n  for root, _, filenames in os.walk(directory):\n    for filename in filenames:\n      files.append(os.path.join(root, filename))\n  return files\n\n\nclass FilesystemFilestore(filestore.BaseFilestore):\n  \"\"\"Filesystem implementation using a filesystem directory.\"\"\"\n  BUILD_DIR = 'build'\n  CRASHES_DIR = 'crashes'\n  CORPUS_DIR = 'corpus'\n  COVERAGE_DIR = 'coverage'\n\n  def __init__(self, config):\n    super().__init__(config)\n    self._filestore_root_dir = self.config.platform_conf.filestore_root_dir\n\n  def _get_filestore_path(self, name, prefix_dir):\n    \"\"\"Returns the filesystem path in the filestore for |name| and\n    |prefix_dir|.\"\"\"\n    return os.path.join(self._filestore_root_dir, prefix_dir, name)\n\n  def _upload_directory(self, name, directory, prefix, delete=False):\n    filestore_path = self._get_filestore_path(name, prefix)\n    if os.path.exists(filestore_path):\n      initial_files = set(recursive_list_dir(filestore_path))\n    else:\n      initial_files = set()\n\n    # Make directory and any parents.\n    os.makedirs(filestore_path, exist_ok=True)\n    copied_files = set(dir_util.copy_tree(directory, filestore_path))\n    if not delete:\n      return True\n\n    files_to_delete = initial_files - copied_files\n    for file_path in files_to_delete:\n      os.remove(file_path)\n    return True\n\n  def _download_directory(self, name, dst_directory, prefix):\n    filestore_path = self._get_filestore_path(name, prefix)\n    return dir_util.copy_tree(filestore_path, dst_directory)\n\n  def upload_crashes(self, name, directory):\n    \"\"\"Uploads the crashes at |directory| to |name|.\"\"\"\n    return self._upload_directory(name, directory, self.CRASHES_DIR)\n\n  def upload_corpus(self, name, directory, replace=False):\n    \"\"\"Uploads the crashes at |directory| to |name|.\"\"\"\n    return self._upload_directory(name,\n                                  directory,\n                                  self.CORPUS_DIR,\n                                  delete=replace)\n\n  def upload_build(self, name, directory):\n    \"\"\"Uploads the build located at |directory| to |name|.\"\"\"\n    return self._upload_directory(name, directory, self.BUILD_DIR)\n\n  def upload_coverage(self, name, directory):\n    \"\"\"Uploads the coverage report at |directory| to |name|.\"\"\"\n    return self._upload_directory(name, directory, self.COVERAGE_DIR)\n\n  def download_corpus(self, name, dst_directory):\n    \"\"\"Downloads the corpus located at |name| to |dst_directory|.\"\"\"\n    return self._download_directory(name, dst_directory, self.CORPUS_DIR)\n\n  def download_build(self, name, dst_directory):\n    \"\"\"Downloads the build with |name| to |dst_directory|.\"\"\"\n    return self._download_directory(name, dst_directory, self.BUILD_DIR)\n\n  def download_coverage(self, name, dst_directory):\n    \"\"\"Downloads the latest project coverage report.\"\"\"\n    return self._download_directory(name, dst_directory, self.COVERAGE_DIR)\n"
  },
  {
    "path": "infra/cifuzz/filestore/git/__init__.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for a git based filestore.\"\"\"\n\nimport logging\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\n\nimport filestore\n\n# pylint: disable=wrong-import-position\nINFRA_DIR = os.path.dirname(\n    os.path.dirname(os.path.dirname(os.path.dirname(\n        os.path.abspath(__file__)))))\nsys.path.append(INFRA_DIR)\n\nimport retry\n\n_PUSH_RETRIES = 3\n_PUSH_BACKOFF = 1\n_CLONE_RETRIES = 5\n_CLONE_DELAY = 1\n_GIT_EMAIL = 'cifuzz@clusterfuzz.com'\n_GIT_NAME = 'CIFuzz'\n_CORPUS_DIR = 'corpus'\n_COVERAGE_DIR = 'coverage'\n\n\ndef git_runner(repo_path):\n  \"\"\"Returns a gits runner for the repo_path.\"\"\"\n\n  def func(*args):\n    return subprocess.check_call(('git', '-C', repo_path) + args)\n\n  return func\n\n\n# pylint: disable=unused-argument,no-self-use\nclass GitFilestore(filestore.BaseFilestore):\n  \"\"\"Generic git filestore. This still relies on another filestore provided by\n  the CI for larger artifacts or artifacts which make sense to be included as\n  the result of a workflow run.\"\"\"\n\n  def __init__(self, config, ci_filestore):\n    super().__init__(config)\n    self.repo_path = tempfile.mkdtemp()\n    self._git = git_runner(self.repo_path)\n    self._clone(self.config.git_store_repo)\n\n    self._ci_filestore = ci_filestore\n\n  def __del__(self):\n    shutil.rmtree(self.repo_path)\n\n  @retry.wrap(_CLONE_RETRIES, _CLONE_DELAY)\n  def _clone(self, repo_url):\n    \"\"\"Clones repo URL.\"\"\"\n    self._git('clone', repo_url, '.')\n    self._git('config', '--local', 'user.email', _GIT_EMAIL)\n    self._git('config', '--local', 'user.name', _GIT_NAME)\n\n  def _reset_git(self, branch):\n    \"\"\"Resets the git repo.\"\"\"\n    self._git('fetch', 'origin')\n    try:\n      self._git('checkout', '-B', branch, 'origin/' + branch)\n      self._git('reset', '--hard', 'HEAD')\n    except subprocess.CalledProcessError:\n      self._git('checkout', '--orphan', branch)\n\n    self._git('clean', '-fxd')\n\n  # pylint: disable=too-many-arguments\n  @retry.wrap(_PUSH_RETRIES, _PUSH_BACKOFF)\n  def _upload_to_git(self,\n                     message,\n                     branch,\n                     upload_path,\n                     local_path,\n                     replace=False):\n    \"\"\"Uploads a directory to git. If `replace` is True, then existing contents\n    in the upload_path is deleted.\"\"\"\n    self._reset_git(branch)\n\n    full_repo_path = os.path.join(self.repo_path, upload_path)\n    if replace and os.path.exists(full_repo_path):\n      shutil.rmtree(full_repo_path)\n\n    shutil.copytree(local_path, full_repo_path, dirs_exist_ok=True)\n    self._git('add', '.')\n    try:\n      self._git('commit', '-m', message)\n    except subprocess.CalledProcessError:\n      logging.debug('No changes, skipping git push.')\n      return\n\n    self._git('push', 'origin', branch)\n\n  def upload_crashes(self, name, directory):\n    \"\"\"Uploads the crashes at |directory| to |name|.\"\"\"\n    return self._ci_filestore.upload_crashes(name, directory)\n\n  def upload_corpus(self, name, directory, replace=False):\n    \"\"\"Uploads the corpus at |directory| to |name|.\"\"\"\n    self._upload_to_git('Corpus upload',\n                        self.config.git_store_branch,\n                        os.path.join(_CORPUS_DIR, name),\n                        directory,\n                        replace=replace)\n\n  def upload_build(self, name, directory):\n    \"\"\"Uploads the build at |directory| to |name|.\"\"\"\n    return self._ci_filestore.upload_build(name, directory)\n\n  def upload_coverage(self, name, directory):\n    \"\"\"Uploads the coverage report at |directory| to |name|.\"\"\"\n    self._upload_to_git('Coverage upload',\n                        self.config.git_store_branch_coverage,\n                        os.path.join(_COVERAGE_DIR, name),\n                        directory,\n                        replace=True)\n\n  def download_corpus(self, name, dst_directory):\n    \"\"\"Downloads the corpus located at |name| to |dst_directory|.\"\"\"\n    self._reset_git(self.config.git_store_branch)\n    path = os.path.join(self.repo_path, _CORPUS_DIR, name)\n    if not os.path.exists(path):\n      logging.debug('Corpus does not exist at %s.', path)\n      return False\n\n    shutil.copytree(path, dst_directory, dirs_exist_ok=True)\n    return True\n\n  def download_build(self, name, dst_directory):\n    \"\"\"Downloads the build with |name| to |dst_directory|.\"\"\"\n    return self._ci_filestore.download_build(name, dst_directory)\n\n  def download_coverage(self, name, dst_directory):\n    \"\"\"Downloads the latest project coverage report.\"\"\"\n    self._reset_git(self.config.git_store_branch_coverage)\n    path = os.path.join(self.repo_path, _COVERAGE_DIR, name)\n    if not os.path.exists(path):\n      logging.debug('Coverage does not exist at %s.', path)\n      return False\n\n    shutil.copytree(path, dst_directory, dirs_exist_ok=True)\n    return True\n"
  },
  {
    "path": "infra/cifuzz/filestore/git/git_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for git.\"\"\"\nimport filecmp\nimport os\nimport tempfile\nimport subprocess\nimport sys\nimport unittest\nfrom unittest import mock\n\n# pylint: disable=wrong-import-position\nINFRA_DIR = os.path.dirname(\n    os.path.dirname(os.path.dirname(os.path.dirname(\n        os.path.abspath(__file__)))))\nsys.path.append(INFRA_DIR)\n\nfrom filestore import git\nimport test_helpers\n\n# pylint: disable=protected-access,no-self-use\n\n\nclass GitFilestoreTest(unittest.TestCase):\n  \"\"\"Tests for GitFilestore.\"\"\"\n\n  def setUp(self):\n    self.git_dir = tempfile.TemporaryDirectory()\n    self.addCleanup(self.git_dir.cleanup)\n\n    self.local_dir = tempfile.TemporaryDirectory()\n    self.addCleanup(self.local_dir.cleanup)\n\n    self.download_dir = tempfile.TemporaryDirectory()\n    self.addCleanup(self.download_dir.cleanup)\n\n    with open(os.path.join(self.local_dir.name, 'a'), 'w') as handle:\n      handle.write('')\n\n    os.makedirs(os.path.join(self.local_dir.name, 'b'))\n\n    with open(os.path.join(self.local_dir.name, 'b', 'c'), 'w') as handle:\n      handle.write('')\n\n    self.git_repo = git.git_runner(self.git_dir.name)\n    self.git_repo('init', '--bare')\n\n    self.config = test_helpers.create_run_config(\n        git_store_repo='file://' + self.git_dir.name,\n        git_store_branch='main',\n        git_store_branch_coverage='cov-branch')\n\n    self.mock_ci_filestore = mock.MagicMock()\n    self.git_store = git.GitFilestore(self.config, self.mock_ci_filestore)\n\n  def assert_dirs_same(self, first, second):\n    \"\"\"Asserts two dirs are the same.\"\"\"\n    dcmp = filecmp.dircmp(first, second)\n    if dcmp.diff_files or dcmp.left_only or dcmp.right_only:\n      return False\n\n    return all(\n        self.assert_dirs_same(os.path.join(first, subdir),\n                              os.path.join(second, subdir))\n        for subdir in dcmp.common_dirs)\n\n  def get_repo_filelist(self, branch):\n    \"\"\"Get files in repo.\"\"\"\n    return subprocess.check_output([\n        'git', '-C', self.git_dir.name, 'ls-tree', '-r', '--name-only', branch\n    ]).decode().splitlines()\n\n  def test_upload_download_corpus(self):\n    \"\"\"Tests uploading and downloading corpus.\"\"\"\n    self.git_store.upload_corpus('target', self.local_dir.name)\n    self.git_store.download_corpus('target', self.download_dir.name)\n    self.assert_dirs_same(self.local_dir.name, self.download_dir.name)\n\n    self.assertCountEqual([\n        'corpus/target/a',\n        'corpus/target/b/c',\n    ], self.get_repo_filelist('main'))\n\n  def test_upload_download_coverage(self):\n    \"\"\"Tests uploading and downloading corpus.\"\"\"\n    self.git_store.upload_coverage('latest', self.local_dir.name)\n    self.git_store.download_coverage('latest', self.download_dir.name)\n    self.assert_dirs_same(self.local_dir.name, self.download_dir.name)\n\n    self.assertCountEqual([\n        'coverage/latest/a',\n        'coverage/latest/b/c',\n    ], self.get_repo_filelist('cov-branch'))\n\n  def test_upload_crashes(self):\n    \"\"\"Tests uploading crashes.\"\"\"\n    self.git_store.upload_crashes('current', self.local_dir.name)\n    self.mock_ci_filestore.upload_crashes.assert_called_with(\n        'current', self.local_dir.name)\n\n  def test_upload_build(self):\n    \"\"\"Tests uploading build.\"\"\"\n    self.git_store.upload_build('sanitizer', self.local_dir.name)\n    self.mock_ci_filestore.upload_build.assert_called_with(\n        'sanitizer', self.local_dir.name)\n\n  def test_download_build(self):\n    \"\"\"Tests downloading build.\"\"\"\n    self.git_store.download_build('sanitizer', self.download_dir.name)\n    self.mock_ci_filestore.download_build.assert_called_with(\n        'sanitizer', self.download_dir.name)\n"
  },
  {
    "path": "infra/cifuzz/filestore/github_actions/__init__.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Implementation of a filestore using Github actions artifacts.\"\"\"\nimport logging\nimport os\nimport shutil\nimport sys\nimport tarfile\nimport tempfile\n\n# pylint: disable=wrong-import-position,import-error\nINFRA_DIR = os.path.abspath(\n    os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir,\n                 os.path.pardir))\nsys.path.append(INFRA_DIR)\nOSS_FUZZ_ROOT_DIR = os.path.dirname(INFRA_DIR)\n\nimport utils\nimport http_utils\nimport filestore\nfrom filestore.github_actions import github_api\n\nUPLOAD_JS = os.path.join(os.path.dirname(__file__), 'upload.js')\n\n\ndef tar_directory(directory, archive_path):\n  \"\"\"Tars a |directory| and stores archive at |archive_path|. |archive_path|\n  must end in .tar\"\"\"\n  assert archive_path.endswith('.tar')\n  # Do this because make_archive will append the extension to archive_path.\n  archive_path = os.path.splitext(archive_path)[0]\n\n  root_directory = os.path.abspath(directory)\n  shutil.make_archive(archive_path,\n                      'tar',\n                      root_dir=root_directory,\n                      base_dir='./')\n\n\nclass GithubActionsFilestore(filestore.BaseFilestore):\n  \"\"\"Implementation of BaseFilestore using Github actions artifacts. Relies on\n  github_actions_toolkit for using the GitHub actions API and the github_api\n  module for using GitHub's standard API. We need to use both because the GitHub\n  actions API is the only way to upload an artifact but it does not support\n  downloading artifacts from other runs. The standard GitHub API does support\n  this however.\"\"\"\n\n  ARTIFACT_PREFIX = 'cifuzz-'\n  BUILD_PREFIX = 'build-'\n  CRASHES_PREFIX = 'crashes-'\n  CORPUS_PREFIX = 'corpus-'\n  COVERAGE_PREFIX = 'coverage-'\n\n  def __init__(self, config):\n    super().__init__(config)\n    self.github_api_http_headers = github_api.get_http_auth_headers(config)\n\n  def _get_artifact_name(self, name):\n    \"\"\"Returns |name| prefixed with |self.ARITFACT_PREFIX| if it isn't already\n    prefixed. Otherwise returns |name|.\"\"\"\n    if name.startswith(self.ARTIFACT_PREFIX):\n      return name\n    return f'{self.ARTIFACT_PREFIX}{name}'\n\n  def _upload_directory(self, name, directory):  # pylint: disable=no-self-use\n    \"\"\"Uploads |directory| as artifact with |name|.\"\"\"\n    name = self._get_artifact_name(name)\n    with tempfile.TemporaryDirectory() as temp_dir:\n      archive_path = os.path.join(temp_dir, name + '.tar')\n      tar_directory(directory, archive_path)\n      _raw_upload_directory(name, temp_dir)\n\n  def upload_crashes(self, name, directory):\n    \"\"\"Uploads the crashes at |directory| to |name|.\"\"\"\n    return _raw_upload_directory(self.CRASHES_PREFIX + name, directory)\n\n  def upload_corpus(self, name, directory, replace=False):\n    \"\"\"Uploads the corpus at |directory| to |name|.\"\"\"\n    # Not applicable as the the entire corpus is uploaded under a single\n    # artifact name.\n    del replace\n    return self._upload_directory(self.CORPUS_PREFIX + name, directory)\n\n  def upload_build(self, name, directory):\n    \"\"\"Uploads the build at |directory| to |name|.\"\"\"\n    return self._upload_directory(self.BUILD_PREFIX + name, directory)\n\n  def upload_coverage(self, name, directory):\n    \"\"\"Uploads the coverage report at |directory| to |name|.\"\"\"\n    return self._upload_directory(self.COVERAGE_PREFIX + name, directory)\n\n  def download_corpus(self, name, dst_directory):  # pylint: disable=unused-argument,no-self-use\n    \"\"\"Downloads the corpus located at |name| to |dst_directory|.\"\"\"\n    return self._download_artifact(self.CORPUS_PREFIX + name, dst_directory)\n\n  def _find_artifact(self, name):\n    \"\"\"Finds an artifact using the GitHub API and returns it.\"\"\"\n    logging.debug('Listing artifacts.')\n    artifacts = self._list_artifacts()\n    artifact = github_api.find_artifact(name, artifacts)\n    logging.debug('Artifact: %s.', artifact)\n    return artifact\n\n  def _download_artifact(self, name, dst_directory):\n    \"\"\"Downloads artifact with |name| to |dst_directory|. Returns True on\n    success.\"\"\"\n    name = self._get_artifact_name(name)\n\n    with tempfile.TemporaryDirectory() as temp_dir:\n      if not self._raw_download_artifact(name, temp_dir):\n        logging.warning('Could not download artifact: %s.', name)\n        return False\n\n      artifact_tarfile_path = os.path.join(temp_dir, name + '.tar')\n      if not os.path.exists(artifact_tarfile_path):\n        logging.error('Artifact zip did not contain a tarfile.')\n        return False\n\n      # TODO(jonathanmetzman): Replace this with archive.unpack from\n      # libClusterFuzz so we can avoid path traversal issues.\n      with tarfile.TarFile(artifact_tarfile_path) as artifact_tarfile:\n        artifact_tarfile.extractall(dst_directory)\n    return True\n\n  def _raw_download_artifact(self, name, dst_directory):\n    \"\"\"Downloads the artifact with |name| to |dst_directory|. Returns True on\n    success. Does not do any untarring or adding prefix to |name|.\"\"\"\n    artifact = self._find_artifact(name)\n    if not artifact:\n      logging.warning('Could not find artifact: %s.', name)\n      return False\n    download_url = artifact['archive_download_url']\n    return http_utils.download_and_unpack_zip(\n        download_url, dst_directory, headers=self.github_api_http_headers)\n\n  def _list_artifacts(self):\n    \"\"\"Returns a list of artifacts.\"\"\"\n    return github_api.list_artifacts(self.config.project_repo_owner,\n                                     self.config.project_repo_name,\n                                     self.github_api_http_headers)\n\n  def download_build(self, name, dst_directory):\n    \"\"\"Downloads the build with name |name| to |dst_directory|.\"\"\"\n    return self._download_artifact(self.BUILD_PREFIX + name, dst_directory)\n\n  def download_coverage(self, name, dst_directory):\n    \"\"\"Downloads the latest project coverage report.\"\"\"\n    return self._download_artifact(self.COVERAGE_PREFIX + name, dst_directory)\n\n\ndef _upload_artifact_with_upload_js(name, artifact_paths, directory):\n  \"\"\"Uploads the artifacts in |artifact_paths| that are located in |directory|\n  to |name|, using the upload.js script.\"\"\"\n  command = [UPLOAD_JS, name, directory] + artifact_paths\n  _, _, retcode = utils.execute(command, location=OSS_FUZZ_ROOT_DIR)\n  return retcode == 0\n\n\ndef _raw_upload_directory(name, directory):\n  \"\"\"Uploads the artifacts located in |directory| to |name|. Does not do any\n  tarring or adding prefixes to |name|.\"\"\"\n  # Get file paths.\n  artifact_paths = []\n  for root, _, curr_file_paths in os.walk(directory):\n    for file_path in curr_file_paths:\n      artifact_paths.append(os.path.join(root, file_path))\n  logging.debug('Artifact paths: %s.', artifact_paths)\n  return _upload_artifact_with_upload_js(name, artifact_paths, directory)\n"
  },
  {
    "path": "infra/cifuzz/filestore/github_actions/github_actions_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for github_actions.\"\"\"\nimport os\nimport shutil\nimport sys\nimport tarfile\nimport tempfile\nimport unittest\nfrom unittest import mock\n\n# pylint: disable=wrong-import-position\nINFRA_DIR = os.path.dirname(\n    os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nsys.path.append(INFRA_DIR)\n\nfrom filestore import github_actions\nimport test_helpers\n\n# pylint: disable=protected-access,no-self-use\n\n\nclass GithubActionsFilestoreTest(unittest.TestCase):\n  \"\"\"Tests for GithubActionsFilestore.\"\"\"\n\n  @mock.patch('platform_config.github._get_event_data', return_value={})\n  def setUp(self, _):  # pylint: disable=arguments-differ\n    test_helpers.patch_environ(self)\n    self.token = 'example githubtoken'\n    self.owner = 'exampleowner'\n    self.repo = 'examplerepo'\n    os.environ['GITHUB_REPOSITORY'] = f'{self.owner}/{self.repo}'\n    os.environ['GITHUB_EVENT_PATH'] = '/fake'\n    os.environ['CFL_PLATFORM'] = 'github'\n    os.environ['GITHUB_WORKSPACE'] = '/workspace'\n    self.config = test_helpers.create_run_config(token=self.token)\n    self.local_dir = tempfile.mkdtemp()\n    self.testcase = os.path.join(self.local_dir, 'testcase')\n\n  def tearDown(self):\n    shutil.rmtree(self.local_dir)\n\n  def _get_expected_http_headers(self):\n    return {\n        'Authorization': f'token {self.token}',\n        'Accept': 'application/vnd.github.v3+json',\n    }\n\n  @mock.patch('filestore.github_actions.github_api.list_artifacts')\n  def test_list_artifacts(self, mock_list_artifacts):\n    \"\"\"Tests that _list_artifacts works as intended.\"\"\"\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    filestore._list_artifacts()\n    mock_list_artifacts.assert_called_with(self.owner, self.repo,\n                                           self._get_expected_http_headers())\n\n  @mock.patch('logging.warning')\n  @mock.patch('filestore.github_actions.GithubActionsFilestore._list_artifacts',\n              return_value=None)\n  @mock.patch('filestore.github_actions.github_api.find_artifact',\n              return_value=None)\n  def test_download_build_no_artifact(self, _, __, mock_warning):\n    \"\"\"Tests that download_build returns None and doesn't exception when\n    find_artifact can't find an artifact.\"\"\"\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    name = 'name'\n    build_dir = 'build-dir'\n    self.assertFalse(filestore.download_build(name, build_dir))\n    mock_warning.assert_called_with('Could not download artifact: %s.',\n                                    'cifuzz-build-' + name)\n\n  @mock.patch('logging.warning')\n  @mock.patch('filestore.github_actions.GithubActionsFilestore._list_artifacts',\n              return_value=None)\n  @mock.patch('filestore.github_actions.github_api.find_artifact',\n              return_value=None)\n  def test_download_corpus_no_artifact(self, _, __, mock_warning):\n    \"\"\"Tests that download_corpus_build returns None and doesn't exception when\n    find_artifact can't find an artifact.\"\"\"\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    name = 'name'\n    dst_dir = self.local_dir\n    self.assertFalse(filestore.download_corpus(name, dst_dir))\n    mock_warning.assert_called_with('Could not download artifact: %s.',\n                                    'cifuzz-corpus-' + name)\n\n  @mock.patch('filestore.github_actions.tar_directory')\n  @mock.patch('filestore.github_actions._upload_artifact_with_upload_js')\n  def test_upload_corpus(self, mock_upload_artifact, mock_tar_directory):\n    \"\"\"Test uploading corpus.\"\"\"\n    self._create_local_dir()\n\n    def mock_tar_directory_impl(_, archive_path):\n      with open(archive_path, 'w') as f:\n        pass\n\n    mock_tar_directory.side_effect = mock_tar_directory_impl\n\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    filestore.upload_corpus('target', self.local_dir)\n    self.assert_upload(mock_upload_artifact, mock_tar_directory,\n                       'corpus-target')\n\n  @mock.patch('filestore.github_actions._upload_artifact_with_upload_js')\n  def test_upload_crashes(self, mock_upload_artifact):\n    \"\"\"Test uploading crashes.\"\"\"\n    self._create_local_dir()\n\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    filestore.upload_crashes('current', self.local_dir)\n    mock_upload_artifact.assert_has_calls([\n        mock.call('crashes-current', [f'{self.local_dir}/testcase'],\n                  self.local_dir)\n    ])\n\n  @mock.patch('filestore.github_actions.tar_directory')\n  @mock.patch('filestore.github_actions._upload_artifact_with_upload_js')\n  def test_upload_build(self, mock_upload_artifact, mock_tar_directory):\n    \"\"\"Test uploading build.\"\"\"\n    self._create_local_dir()\n\n    def mock_tar_directory_impl(_, archive_path):\n      with open(archive_path, 'w') as f:\n        pass\n\n    mock_tar_directory.side_effect = mock_tar_directory_impl\n\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    filestore.upload_build('sanitizer', self.local_dir)\n    self.assert_upload(mock_upload_artifact, mock_tar_directory,\n                       'build-sanitizer')\n\n  @mock.patch('filestore.github_actions.tar_directory')\n  @mock.patch('filestore.github_actions._upload_artifact_with_upload_js')\n  def test_upload_coverage(self, mock_upload_artifact, mock_tar_directory):\n    \"\"\"Test uploading coverage.\"\"\"\n    self._create_local_dir()\n\n    def mock_tar_directory_impl(_, archive_path):\n      with open(archive_path, 'w') as f:\n        pass\n\n    mock_tar_directory.side_effect = mock_tar_directory_impl\n\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    filestore.upload_coverage('latest', self.local_dir)\n    self.assert_upload(mock_upload_artifact, mock_tar_directory,\n                       'coverage-latest')\n\n  def assert_upload(self, mock_upload_artifact, mock_tar_directory,\n                    expected_artifact_name):\n    \"\"\"Tests that upload_directory invokes tar_directory and\n    artifact_client.upload_artifact properly.\"\"\"\n    # Don't assert what second argument will be since it's a temporary\n    # directory.\n    self.assertEqual(mock_tar_directory.call_args_list[0][0][0], self.local_dir)\n\n    # Don't assert what second and third arguments will be since they are\n    # temporary directories.\n    expected_artifact_name = 'cifuzz-' + expected_artifact_name\n    self.assertEqual(mock_upload_artifact.call_args_list[0][0][0],\n                     expected_artifact_name)\n\n    # Assert artifacts list contains one tarfile.\n    artifacts_list = mock_upload_artifact.call_args_list[0][0][1]\n    self.assertEqual(len(artifacts_list), 1)\n    self.assertEqual(os.path.basename(artifacts_list[0]),\n                     expected_artifact_name + '.tar')\n\n  def _create_local_dir(self):\n    \"\"\"Create fake testcase.\"\"\"\n    with open(self.testcase, 'w') as f:\n      f.write('hi')\n\n  @mock.patch('filestore.github_actions.GithubActionsFilestore._find_artifact')\n  @mock.patch('http_utils.download_and_unpack_zip')\n  def test_download_artifact(self, mock_download_and_unpack_zip,\n                             mock_find_artifact):\n    \"\"\"Tests that _download_artifact works as intended.\"\"\"\n    artifact_download_url = 'http://example.com/download'\n    artifact_listing = {\n        'expired': False,\n        'name': 'corpus',\n        'archive_download_url': artifact_download_url\n    }\n    mock_find_artifact.return_value = artifact_listing\n\n    self._create_local_dir()\n    with tempfile.TemporaryDirectory() as temp_dir:\n      # Create a tarball.\n      archive_path = os.path.join(temp_dir, 'cifuzz-corpus.tar')\n      github_actions.tar_directory(self.local_dir, archive_path)\n\n      artifact_download_dst_dir = os.path.join(temp_dir, 'dst')\n      os.mkdir(artifact_download_dst_dir)\n\n      def mock_download_and_unpack_zip_impl(url, download_artifact_temp_dir,\n                                            headers):\n        self.assertEqual(url, artifact_download_url)\n        self.assertEqual(headers, self._get_expected_http_headers())\n        shutil.copy(\n            archive_path,\n            os.path.join(download_artifact_temp_dir,\n                         os.path.basename(archive_path)))\n        return True\n\n      mock_download_and_unpack_zip.side_effect = (\n          mock_download_and_unpack_zip_impl)\n      filestore = github_actions.GithubActionsFilestore(self.config)\n      self.assertTrue(\n          filestore._download_artifact('corpus', artifact_download_dst_dir))\n      mock_find_artifact.assert_called_with('cifuzz-corpus')\n      self.assertTrue(\n          os.path.exists(\n              os.path.join(artifact_download_dst_dir,\n                           os.path.basename(self.testcase))))\n\n  @mock.patch('filestore.github_actions.github_api.list_artifacts')\n  def test_find_artifact(self, mock_list_artifacts):\n    \"\"\"Tests that _find_artifact works as intended.\"\"\"\n    artifact_listing_1 = {\n        'expired': False,\n        'name': 'other',\n        'archive_download_url': 'http://download1'\n    }\n    artifact_listing_2 = {\n        'expired': False,\n        'name': 'artifact',\n        'archive_download_url': 'http://download2'\n    }\n    artifact_listing_3 = {\n        'expired': True,\n        'name': 'artifact',\n        'archive_download_url': 'http://download3'\n    }\n    artifact_listing_4 = {\n        'expired': False,\n        'name': 'artifact',\n        'archive_download_url': 'http://download4'\n    }\n    artifacts = [\n        artifact_listing_1, artifact_listing_2, artifact_listing_3,\n        artifact_listing_4\n    ]\n    mock_list_artifacts.return_value = artifacts\n    filestore = github_actions.GithubActionsFilestore(self.config)\n    # Test that find_artifact will return the most recent unexpired artifact\n    # with the correct name.\n    self.assertEqual(filestore._find_artifact('artifact'), artifact_listing_2)\n    mock_list_artifacts.assert_called_with(self.owner, self.repo,\n                                           self._get_expected_http_headers())\n\n\nclass TarDirectoryTest(unittest.TestCase):\n  \"\"\"Tests for tar_directory.\"\"\"\n\n  def test_tar_directory(self):\n    \"\"\"Tests that tar_directory writes the archive to the correct location and\n    archives properly.\"\"\"\n    with tempfile.TemporaryDirectory() as temp_dir:\n      archive_path = os.path.join(temp_dir, 'myarchive.tar')\n      archived_dir = os.path.join(temp_dir, 'toarchive')\n      os.mkdir(archived_dir)\n      archived_filename = 'file1'\n      archived_file_path = os.path.join(archived_dir, archived_filename)\n      with open(archived_file_path, 'w') as file_handle:\n        file_handle.write('hi')\n      github_actions.tar_directory(archived_dir, archive_path)\n      self.assertTrue(os.path.exists(archive_path))\n\n      # Now check it archives correctly.\n      unpacked_directory = os.path.join(temp_dir, 'unpacked')\n      with tarfile.TarFile(archive_path) as artifact_tarfile:\n        artifact_tarfile.extractall(unpacked_directory)\n      unpacked_archived_file_path = os.path.join(unpacked_directory,\n                                                 archived_filename)\n      self.assertTrue(os.path.exists(unpacked_archived_file_path))\n"
  },
  {
    "path": "infra/cifuzz/filestore/github_actions/github_api.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for dealing with the GitHub API. This is different from\ngithub_actions_toolkit which only deals with the actions API. We need to use\nboth.\"\"\"\nimport logging\nimport os\nimport sys\n\nimport requests\n\nimport filestore\n\n# pylint: disable=wrong-import-position,import-error\n\nsys.path.append(\n    os.path.join(__file__, os.path.pardir, os.path.pardir, os.path.pardir,\n                 os.path.pardir))\nimport retry\n\n_MAX_ITEMS_PER_PAGE = 100\n\n_GET_ATTEMPTS = 3\n_GET_BACKOFF = 1\n\n\ndef get_http_auth_headers(config):\n  \"\"\"Returns HTTP headers for authentication to the API.\"\"\"\n  authorization = f'token {config.token}'\n  return {\n      'Authorization': authorization,\n      'Accept': 'application/vnd.github.v3+json'\n  }\n\n\ndef _get_artifacts_list_api_url(repo_owner, repo_name):\n  \"\"\"Returns the artifacts_api_url for |repo_name| owned by |repo_owner|.\"\"\"\n  github_api_url = os.getenv('GITHUB_API_URL', 'https://api.github.com')\n  return (f'{github_api_url}/repos/{repo_owner}/'\n          f'{repo_name}/actions/artifacts')\n\n\n@retry.wrap(_GET_ATTEMPTS, _GET_BACKOFF)\ndef _do_get_request(*args, **kwargs):\n  \"\"\"Wrapped version of requests.get that does retries.\"\"\"\n  return requests.get(*args, **kwargs)\n\n\ndef _get_items(url, headers):\n  \"\"\"Generator that gets and yields items from a GitHub API endpoint (specified\n  by |URL|) sending |headers| with the get request.\"\"\"\n  # Github API response pages are 1-indexed.\n  page_counter = 1\n\n  # Set to infinity so we run loop at least once.\n  total_num_items = float('inf')\n\n  item_num = 0\n  while item_num < total_num_items:\n    params = {'per_page': _MAX_ITEMS_PER_PAGE, 'page': str(page_counter)}\n    response = _do_get_request(url, params=params, headers=headers)\n    response_json = response.json()\n    if not response.status_code == 200:\n      # Check that request was successful.\n      logging.error('Request to %s failed. Code: %d. Response: %s',\n                    response.request.url, response.status_code, response_json)\n      raise filestore.FilestoreError('Github API request failed.')\n\n    if total_num_items == float('inf'):\n      # Set proper total_num_items\n      total_num_items = response_json['total_count']\n\n    # Get the key for the items we are after.\n    keys = [key for key in response_json.keys() if key != 'total_count']\n    assert len(keys) == 1, keys\n    items_key = keys[0]\n\n    for item in response_json[items_key]:\n      yield item\n      item_num += 1\n\n    page_counter += 1\n\n\ndef find_artifact(artifact_name, artifacts):\n  \"\"\"Find the artifact with the name |artifact_name| in |artifacts|.\"\"\"\n  for artifact in artifacts:\n    # TODO(metzman): Handle multiple by making sure we download the latest.\n    if artifact['name'] == artifact_name and not artifact['expired']:\n      return artifact\n  return None\n\n\ndef list_artifacts(owner, repo, headers):\n  \"\"\"Returns a generator of all the artifacts for |owner|/|repo|.\"\"\"\n  url = _get_artifacts_list_api_url(owner, repo)\n  logging.debug('Getting artifacts from: %s', url)\n  return _get_items(url, headers)\n"
  },
  {
    "path": "infra/cifuzz/filestore/github_actions/github_api_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for github_api.\"\"\"\nimport os\nimport sys\nimport unittest\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(\n    os.path.abspath(\n        os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir,\n                     os.path.pardir)))\n\nfrom filestore.github_actions import github_api\nimport test_helpers\n\n\nclass GetHttpAuthHeaders(unittest.TestCase):\n  \"\"\"Tests for get_http_auth_headers.\"\"\"\n\n  def test_get_http_auth_headers(self):\n    \"\"\"Tests that get_http_auth_headers returns the correct result.\"\"\"\n    token = 'example githubtoken'\n    run_config = test_helpers.create_run_config(token=token)\n    expected_headers = {\n        'Authorization': f'token {token}',\n        'Accept': 'application/vnd.github.v3+json',\n    }\n    self.assertEqual(expected_headers,\n                     github_api.get_http_auth_headers(run_config))\n"
  },
  {
    "path": "infra/cifuzz/filestore/github_actions/upload.js",
    "content": "#!/usr/bin/env node\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// Script for uploading an artifact. Returns 0 on success.\n// Usage: upload.js <artifactName> <rootDirectory> <file 1>...<file N>\n\nconst fs = require('fs');\nconst { DefaultArtifactClient } = require('@actions/artifact');\n\nconst artifactClient = new DefaultArtifactClient();\nconst artifactName = process.argv[2];\nconst rootDirectory = process.argv[3]\nconst files = process.argv.slice(4);\nconst options = {\n    continueOnError: true\n};\n\nasync function uploadArtifact() {\n    try {\n        const uploadResult = await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);\n        console.log(uploadResult);\n        if (uploadResult.failedItems.length > 0) {\n            return 1;\n        }\n        return 0;\n    } catch (error) {\n        console.error('Error uploading artifact:', error);\n        return 1;\n    }\n}\n\nuploadArtifact().then(exitCode => {\n    process.exit(exitCode);\n});\n"
  },
  {
    "path": "infra/cifuzz/filestore/gitlab/__init__.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"GitLab filestore implementation.\"\"\"\nimport logging\n\nimport json\nimport os\nimport shutil\nimport tempfile\n\nimport filestore\nimport http_utils\n\n# pylint: disable=no-self-use,unused-argument\n\n\nclass GitlabFilestore(filestore.BaseFilestore):\n  \"\"\"Implementation of BaseFilestore using GitLab.\n  Needs a cache to upload and download builds.\n  Needs a git repository for corpus and coverage.\n  \"\"\"\n\n  BUILD_PREFIX = 'build-'\n  CORPUS_PREFIX = 'corpus-'\n  COVERAGE_PREFIX = 'coverage-'\n  CRASHES_PREFIX = 'crashes-'\n\n  def __init__(self, config):\n    super().__init__(config)\n    self.artifacts_dir = self.config.platform_conf.artifacts_dir\n    self.cache_dir = self.config.platform_conf.cache_dir\n    if self.config.git_store_repo:\n      self.git_filestore = filestore.git.GitFilestore(config, None)\n    else:\n      self.git_filestore = None\n\n  def upload_crashes(self, name, directory):\n    \"\"\"GitLab artifacts implementation of upload_crashes.\"\"\"\n    # Upload crashes as job artifacts.\n    if os.listdir(directory):\n      dest_dir_artifacts = os.path.join(self.config.project_src_path,\n                                        self.artifacts_dir,\n                                        self.CRASHES_PREFIX + name)\n      logging.info('Uploading artifacts to %s.', dest_dir_artifacts)\n      shutil.copytree(directory, dest_dir_artifacts)\n\n  def upload_corpus(self, name, directory, replace=False):\n    \"\"\"GitLab artifacts implementation of upload_corpus.\"\"\"\n    # Use the git filestore if any.\n    if self.git_filestore:\n      self.git_filestore.upload_corpus(name, directory, replace)\n      return\n    # Fall back to cache.\n    dest_dir_cache = os.path.join(self.config.project_src_path, self.cache_dir,\n                                  self.CORPUS_PREFIX + name)\n    logging.info('Copying from %s to cache %s.', directory, dest_dir_cache)\n    # Remove previous corpus from cache if any.\n    shutil.rmtree(dest_dir_cache, ignore_errors=True)\n    shutil.copytree(directory, dest_dir_cache, dirs_exist_ok=True)\n\n  def upload_build(self, name, directory):\n    \"\"\"GitLab artifacts implementation of upload_build.\"\"\"\n    # Puts build into the cache.\n    dest_dir_cache = os.path.join(self.config.project_src_path, self.cache_dir,\n                                  self.BUILD_PREFIX + name)\n    logging.info('Copying from %s to cache %s.', directory, dest_dir_cache)\n    shutil.copytree(directory, dest_dir_cache, dirs_exist_ok=True)\n\n  def upload_coverage(self, name, directory):\n    \"\"\"GitLab artifacts implementation of upload_coverage.\"\"\"\n    # Use the git filestore.\n    if self.git_filestore:\n      self.git_filestore.upload_coverage(name, directory)\n      return\n    # Fall back to cache.\n    dest_dir_cache = os.path.join(self.config.project_src_path, self.cache_dir,\n                                  self.COVERAGE_PREFIX + name)\n    logging.info('Copying from %s to cache %s.', directory, dest_dir_cache)\n    shutil.copytree(directory, dest_dir_cache, dirs_exist_ok=True)\n    # And also updates coverage reports as artifacts\n    # as it should not be too big.\n    dest_dir_artifacts = os.path.join(self.config.project_src_path,\n                                      self.artifacts_dir,\n                                      self.COVERAGE_PREFIX + name)\n    logging.info('Uploading artifacts to %s.', dest_dir_artifacts)\n    shutil.copytree(directory, dest_dir_artifacts)\n\n  def _copy_from_cache(self, src_dir_cache, dst_directory):\n    if not os.path.exists(src_dir_cache):\n      logging.info('Cache %s does not exist.', src_dir_cache)\n      return False\n    logging.info('Copying %s from cache to %s.', src_dir_cache, dst_directory)\n    shutil.copytree(src_dir_cache, dst_directory, dirs_exist_ok=True)\n    return True\n\n  def download_corpus(self, name, dst_directory):\n    \"\"\"GitLab artifacts implementation of download_corpus.\"\"\"\n    # Use the git filestore if any.\n    if self.git_filestore:\n      self.git_filestore.download_corpus(name, dst_directory)\n      return\n    # Fall back to cache.\n    src_dir_cache = os.path.join(self.config.project_src_path, self.cache_dir,\n                                 self.CORPUS_PREFIX + name)\n    self._copy_from_cache(src_dir_cache, dst_directory)\n\n  def download_build(self, name, dst_directory):\n    \"\"\"GitLab artifacts implementation of download_build.\"\"\"\n    # Gets build from the cache.\n    src_dir_cache = os.path.join(self.config.project_src_path, self.cache_dir,\n                                 self.BUILD_PREFIX + name)\n    return self._copy_from_cache(src_dir_cache, dst_directory)\n\n  def download_coverage(self, name, dst_directory):\n    \"\"\"GitLab artifacts implementation of download_coverage.\"\"\"\n    # Use the git filestore if any.\n    if self.git_filestore:\n      return self.git_filestore.download_coverage(name, dst_directory)\n    # Fall back to cache.\n    src_dir_cache = os.path.join(self.config.project_src_path, self.cache_dir,\n                                 self.COVERAGE_PREFIX + name)\n    return self._copy_from_cache(src_dir_cache, dst_directory)\n"
  },
  {
    "path": "infra/cifuzz/filestore/gsutil/__init__.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Filestore implementation using gsutil.\"\"\"\nimport logging\nimport os\nimport posixpath\nimport subprocess\nimport sys\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(\n    os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir,\n                 os.pardir, os.pardir))\nimport filestore\nimport utils\n\n\ndef _gsutil_execute(*args, parallel=True):\n  \"\"\"Executes a gsutil command, passing |*args| to gsutil and returns the\n  stdout, stderr and returncode. Exceptions on failure.\"\"\"\n  command = ['gsutil']\n  if parallel:\n    command.append('-m')\n  command += list(args)\n  logging.info('Executing gsutil command: %s', command)\n  return utils.execute(command, check_result=True)\n\n\ndef _rsync(src, dst, recursive=True, delete=False):\n  \"\"\"Executes gsutil rsync on |src| and |dst|\"\"\"\n  args = ['rsync']\n  if recursive:\n    args.append('-r')\n  if delete:\n    args.append('-d')\n  args += [src, dst]\n  return _gsutil_execute(*args)\n\n\nclass GSUtilFilestore(filestore.BaseFilestore):\n  \"\"\"Filestore implementation using gsutil.\"\"\"\n  BUILD_DIR = 'build'\n  CRASHES_DIR = 'crashes'\n  CORPUS_DIR = 'corpus'\n  COVERAGE_DIR = 'coverage'\n\n  def __init__(self, config):\n    super().__init__(config)\n    self._cloud_bucket = self.config.cloud_bucket\n\n  def _get_gsutil_url(self, name, prefix_dir):\n    \"\"\"Returns the gsutil URL for |name| and |prefix_dir|.\"\"\"\n    if not prefix_dir:\n      return posixpath.join(self._cloud_bucket, name)\n    return posixpath.join(self._cloud_bucket, prefix_dir, name)\n\n  def _upload_directory(self, name, directory, prefix, delete=False):\n    gsutil_url = self._get_gsutil_url(name, prefix)\n    return _rsync(directory, gsutil_url, delete=delete)\n\n  def _download_directory(self, name, dst_directory, prefix):\n    gsutil_url = self._get_gsutil_url(name, prefix)\n    return _rsync(gsutil_url, dst_directory)\n\n  def upload_crashes(self, name, directory):\n    \"\"\"Uploads the crashes at |directory| to |name|.\"\"\"\n    # Name is going to be \"current\". I don't know if this makes sense outside of\n    # GitHub Actions.\n    gsutil_url = self._get_gsutil_url(name, self.CRASHES_DIR)\n    logging.info('Uploading crashes to %s.', gsutil_url)\n    return _rsync(directory, gsutil_url)\n\n  def upload_corpus(self, name, directory, replace=False):\n    \"\"\"Uploads the crashes at |directory| to |name|.\"\"\"\n    return self._upload_directory(name,\n                                  directory,\n                                  self.CORPUS_DIR,\n                                  delete=replace)\n\n  def upload_build(self, name, directory):\n    \"\"\"Uploads the build located at |directory| to |name|.\"\"\"\n    return self._upload_directory(name, directory, self.BUILD_DIR)\n\n  def upload_coverage(self, name, directory):\n    \"\"\"Uploads the coverage report at |directory| to |name|.\"\"\"\n    return self._upload_directory(name, directory, self.COVERAGE_DIR)\n\n  def download_corpus(self, name, dst_directory):\n    \"\"\"Downloads the corpus located at |name| to |dst_directory|.\"\"\"\n    return self._download_directory(name, dst_directory, self.CORPUS_DIR)\n\n  def download_build(self, name, dst_directory):\n    \"\"\"Downloads the build with |name| to |dst_directory|.\"\"\"\n    return self._download_directory(name, dst_directory, self.BUILD_DIR)\n\n  def download_coverage(self, name, dst_directory):\n    \"\"\"Downloads the latest project coverage report.\"\"\"\n    return self._download_directory(name, dst_directory, self.COVERAGE_DIR)\n"
  },
  {
    "path": "infra/cifuzz/filestore/no_filestore/__init__.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Empty filestore implementation for platforms that haven't implemented it.\"\"\"\nimport logging\n\nimport filestore\n\n# pylint:disable=no-self-use,unused-argument\n\n\nclass NoFilestore(filestore.BaseFilestore):\n  \"\"\"Empty Filestore implementation.\"\"\"\n\n  def upload_crashes(self, name, directory):\n    \"\"\"Noop implementation of upload_crashes.\"\"\"\n    logging.info('Not uploading crashes because no Filestore.')\n\n  def upload_corpus(self, name, directory, replace=False):\n    \"\"\"Noop implementation of upload_corpus.\"\"\"\n    logging.info('Not uploading corpus because no Filestore.')\n\n  def upload_build(self, name, directory):\n    \"\"\"Noop implementation of upload_build.\"\"\"\n    logging.info('Not uploading build because no Filestore.')\n\n  def upload_coverage(self, name, directory):\n    \"\"\"Noop implementation of upload_coverage.\"\"\"\n    logging.info('Not uploading coverage because no Filestore.')\n\n  def download_corpus(self, name, dst_directory):\n    \"\"\"Noop implementation of download_corpus.\"\"\"\n    logging.info('Not downloading corpus because no Filestore.')\n\n  def download_build(self, name, dst_directory):\n    \"\"\"Noop implementation of download_build.\"\"\"\n    logging.info('Not downloading build because no Filestore.')\n\n  def download_coverage(self, name, dst_directory):\n    \"\"\"Noop implementation of download_coverage.\"\"\"\n    logging.info('Not downloading coverage because no Filestore.')\n"
  },
  {
    "path": "infra/cifuzz/filestore_utils.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"External filestore interface. Cannot be depended on by filestore code.\"\"\"\nimport filestore\nimport filestore.filesystem\nimport filestore.git\nimport filestore.github_actions\nimport filestore.gsutil\nimport filestore.no_filestore\nimport filestore.gitlab\n\nFILESTORE_MAPPING = {\n    'filesystem': filestore.filesystem.FilesystemFilestore,\n    'gsutil': filestore.gsutil.GSUtilFilestore,\n    'github-actions': filestore.github_actions.GithubActionsFilestore,\n    'git': filestore.git.GitFilestore,\n    # TODO(metzman): Change to \"no-filestore\"\n    'no_filestore': filestore.no_filestore.NoFilestore,\n    'gitlab': filestore.gitlab.GitlabFilestore,\n}\n\n\ndef get_filestore(config):\n  \"\"\"Returns the correct filestore object based on the platform in |config|.\n  Raises an exception if there is no correct filestore for the platform.\"\"\"\n  if config.platform == config.Platform.EXTERNAL_GITHUB:\n    ci_filestore = filestore.github_actions.GithubActionsFilestore(config)\n    if not config.git_store_repo:\n      return ci_filestore\n\n    return filestore.git.GitFilestore(config, ci_filestore)\n\n  filestore_cls = FILESTORE_MAPPING.get(config.filestore)\n  if filestore_cls is None:\n    raise filestore.FilestoreError(\n        f'Filestore: {config.filestore} doesn\\'t exist.')\n  return filestore_cls(config)\n"
  },
  {
    "path": "infra/cifuzz/filestore_utils_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for filestore_utils.\"\"\"\nimport unittest\nfrom unittest import mock\n\nimport parameterized\n\nimport platform_config\nimport filestore\nfrom filestore import github_actions\nimport filestore_utils\nimport test_helpers\n\n\nclass GetFilestoreTest(unittest.TestCase):\n  \"\"\"Tests for get_filestore.\"\"\"\n\n  @parameterized.parameterized.expand([\n      ({\n          'cfl_platform': 'github',\n      }, github_actions.GithubActionsFilestore),\n  ])\n  def test_get_filestore(self, config_kwargs, filestore_cls):\n    \"\"\"Tests that get_filestore returns the right filestore given a certain\n    platform.\"\"\"\n    run_config = test_helpers.create_run_config(**config_kwargs)\n    filestore_impl = filestore_utils.get_filestore(run_config)\n    self.assertIsInstance(filestore_impl, filestore_cls)\n\n  @mock.patch('config_utils.BaseConfig.platform', return_value='other')\n  @mock.patch('config_utils._get_platform_config',\n              return_value=platform_config.BasePlatformConfig())\n  def test_get_filestore_unsupported_platform(self, _, __):\n    \"\"\"Tests that get_filestore exceptions given a platform it doesn't\n    support.\"\"\"\n    run_config = test_helpers.create_run_config()\n    with self.assertRaises(filestore.FilestoreError):\n      filestore_utils.get_filestore(run_config)\n"
  },
  {
    "path": "infra/cifuzz/fuzz_target.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"A module to handle running a fuzz target for a specified amount of time.\"\"\"\nimport collections\nimport logging\nimport multiprocessing\nimport os\nimport shutil\nimport stat\nimport tempfile\nfrom typing import Optional\n\nimport clusterfuzz.environment\nimport clusterfuzz.fuzz\n\nimport config_utils\nimport logs\n\nlogs.init()\n\n# Use len_control=0 since we don't have enough time fuzzing for len_control to\n# make sense (probably).\nLIBFUZZER_OPTIONS_BATCH = ['-len_control=0']\n# Use a fixed seed for determinism for code change fuzzing.\nLIBFUZZER_OPTIONS_CODE_CHANGE = LIBFUZZER_OPTIONS_BATCH + ['-seed=1337']\nLIBFUZZER_OPTIONS_NO_REPORT_OOM = ['-rss_limit_mb=0']\n\n# The number of reproduce attempts for a crash.\nREPRODUCE_ATTEMPTS = 10\n\nDEFAULT_REPRODUCE_TIME_SECONDS = 30\nPER_LANGUAGE_REPRODUCE_TIMEOUTS = {\n    'python': 30 * 4  # Python takes a bit longer on startup.\n}\nMINIMIZE_TIME_SECONDS = 60 * 4\n\n# Seconds on top of duration until a timeout error is raised.\nBUFFER_TIME = 10\n\n# Log message if we can't check if crash reproduces on an recent build.\nCOULD_NOT_TEST_ON_CLUSTERFUZZ_MESSAGE = (\n    'Could not run previous build of target to determine if this code change '\n    '(pr/commit) introduced crash. Assuming crash was newly introduced.')\n\nFuzzResult = collections.namedtuple('FuzzResult',\n                                    ['testcase', 'stacktrace', 'corpus_path'])\n\n\ndef get_libfuzzer_parallel_options(option):\n  \"\"\"Returns a list containing options to pass to libFuzzer to fuzz using all\n  available or the specified number of cores.\"\"\"\n  if option == 'true' or (isinstance(option, bool) and option == True):\n    cpu_count = str(multiprocessing.cpu_count())\n  else:\n    cpu_count = option\n  return [f'-jobs={cpu_count}', f'-workers={cpu_count}']\n\n\nclass ReproduceError(Exception):\n  \"\"\"Error for when we can't attempt to reproduce a crash.\"\"\"\n\n\ndef get_fuzz_target_corpus_dir(workspace, target_name):\n  \"\"\"Returns the directory for storing |target_name|'s corpus in |workspace|.\"\"\"\n  return os.path.join(workspace.corpora, target_name)\n\n\ndef get_fuzz_target_pruned_corpus_dir(workspace, target_name):\n  \"\"\"Returns the directory for storing |target_name|'s puned corpus in\n  |workspace|.\"\"\"\n  return os.path.join(workspace.pruned_corpora, target_name)\n\n\nclass FuzzTarget:  # pylint: disable=too-many-instance-attributes\n  \"\"\"A class to manage a single fuzz target.\n\n  Attributes:\n    target_name: The name of the fuzz target.\n    duration: The length of time in seconds that the target should run.\n    target_path: The location of the fuzz target binary.\n    workspace: The workspace for storing things related to fuzzing.\n  \"\"\"\n\n  # pylint: disable=too-many-arguments\n  def __init__(self, target_path, duration, workspace, clusterfuzz_deployment,\n               config):\n    \"\"\"Represents a single fuzz target.\n\n    Args:\n      target_path: The location of the fuzz target binary.\n      duration: The length of time  in seconds the target should run.\n      workspace: The path used for storing things needed for fuzzing.\n      clusterfuzz_deployment: The object representing the ClusterFuzz\n          deployment.\n      config: The config of this project.\n    \"\"\"\n    self.target_path = target_path\n    self.target_name = os.path.basename(self.target_path)\n    self.duration = int(duration)\n    self.workspace = workspace\n    self.clusterfuzz_deployment = clusterfuzz_deployment\n    self.config = config\n    self.latest_corpus_path = get_fuzz_target_corpus_dir(\n        self.workspace, self.target_name)\n    os.makedirs(self.latest_corpus_path, exist_ok=True)\n    self.pruned_corpus_path = get_fuzz_target_pruned_corpus_dir(\n        self.workspace, self.target_name)\n    os.makedirs(self.pruned_corpus_path, exist_ok=True)\n\n  def _download_corpus(self):\n    \"\"\"Downloads the corpus for the target from ClusterFuzz and returns the path\n    to the corpus. An empty directory is provided if the corpus can't be\n    downloaded or is empty.\"\"\"\n    self.clusterfuzz_deployment.download_corpus(self.target_name,\n                                                self.latest_corpus_path)\n    return self.latest_corpus_path\n\n  def _target_artifact_path(self):\n    \"\"\"Target artifact path.\"\"\"\n    artifact_path = os.path.join(self.workspace.artifacts, self.target_name,\n                                 self.config.sanitizer)\n    os.makedirs(artifact_path, exist_ok=True)\n    return artifact_path\n\n  def _save_crash(self, crash):\n    \"\"\"Add stacktraces to crashes.\"\"\"\n    target_reproducer_path = os.path.join(self._target_artifact_path(),\n                                          os.path.basename(crash.input_path))\n    shutil.copy(crash.input_path, target_reproducer_path)\n    bug_summary_artifact_path = target_reproducer_path + '.summary'\n    with open(bug_summary_artifact_path, 'w') as handle:\n      handle.write(crash.stacktrace)\n\n    # Set permissions of testcase to be the same as summary so that we're sure\n    # it can be read by necessary users.\n    permissions_mode = os.stat(bug_summary_artifact_path).st_mode\n    os.chmod(target_reproducer_path, permissions_mode & 0o777)\n    return target_reproducer_path\n\n  def prune(self):\n    \"\"\"Prunes the corpus and returns the result.\"\"\"\n    self._download_corpus()\n    with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE,\n                                             self.config.sanitizer,\n                                             self.target_path):\n      engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE)\n      result = engine_impl.minimize_corpus(self.target_path, [],\n                                           [self.latest_corpus_path],\n                                           self.pruned_corpus_path,\n                                           self._target_artifact_path(),\n                                           self.duration)\n\n    print(result.logs)\n    return FuzzResult(None, result.logs, self.pruned_corpus_path)\n\n  def fuzz(self, batch=False) -> Optional[FuzzResult]:\n    \"\"\"Starts the fuzz target run for the length of time specified by duration.\n\n    Returns:\n      FuzzResult namedtuple with stacktrace and testcase if applicable.\n    \"\"\"\n    logging.info('Running fuzzer: %s.', self.target_name)\n\n    self._download_corpus()\n    corpus_path = self.latest_corpus_path\n\n    logging.info('Starting fuzzing')\n    with tempfile.TemporaryDirectory() as artifacts_dir:\n      with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE,\n                                               self.config.sanitizer,\n                                               self.target_path) as env:\n        engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE)\n        options = engine_impl.prepare(corpus_path, env.target_path,\n                                      env.build_dir)\n        options.merge_back_new_testcases = False\n        options.analyze_dictionary = False\n        if batch:\n          options.arguments.extend(LIBFUZZER_OPTIONS_BATCH)\n        else:\n          options.arguments.extend(LIBFUZZER_OPTIONS_CODE_CHANGE)\n\n        if not self.config.report_ooms:\n          options.arguments.extend(LIBFUZZER_OPTIONS_NO_REPORT_OOM)\n\n        if (self.config.parallel_fuzzing == 'true' or\n            (isinstance(self.config.parallel_fuzzing, int) and\n             not isinstance(self.config.parallel_fuzzing, bool)) or\n            (isinstance(self.config.parallel_fuzzing, bool) and\n             self.config.parallel_fuzzing == True)):\n          if self.config.sanitizer == 'memory':\n            # TODO(https://github.com/google/oss-fuzz/issues/11915): Don't gate\n            # this after jobs is fixed for MSAN.\n            logging.info('Not using jobs because it breaks MSAN.')\n          else:\n            options.arguments.extend(\n                get_libfuzzer_parallel_options(self.config.parallel_fuzzing))\n\n        result = engine_impl.fuzz(self.target_path, options, artifacts_dir,\n                                  self.duration)\n        print(f'Fuzzing logs:\\n{result.logs}')\n\n      if not result.crashes:\n        # Libfuzzer max time was reached.\n        logging.info('Fuzzer %s finished with no crashes discovered.',\n                     self.target_name)\n        return FuzzResult(None, None, self.latest_corpus_path)\n\n      if result.timed_out:\n        logging.info('Not reporting crash in %s because process timed out.',\n                     self.target_name)\n        return FuzzResult(None, None, self.latest_corpus_path)\n\n      # Only report first crash.\n      crash = result.crashes[0]\n      logging.info('Fuzzer: %s. Detected bug.', self.target_name)\n\n      is_reportable = self.is_crash_reportable(crash.input_path,\n                                               crash.reproduce_args,\n                                               batch=batch)\n      if is_reportable or self.config.upload_all_crashes:\n        logging.info('SAVING CRASH')\n        fuzzer_logs = result.logs\n        testcase_path = self._save_crash(crash)\n        if is_reportable and self.config.minimize_crashes:\n          # TODO(metzman): We don't want to minimize unreproducible crashes.\n          # Use is_reportable to decide this even though reportable crashes\n          # are a subset of reproducible ones.\n          self.minimize_testcase(testcase_path)\n        else:\n          logging.info('NOT MINIMIZED')\n      else:\n        fuzzer_logs = None\n        testcase_path = None\n\n    return FuzzResult(testcase_path, fuzzer_logs, self.latest_corpus_path)\n\n  def minimize_testcase(self, testcase_path):\n    \"\"\"Minimizes the testcase located at |testcase_path|.\"\"\"\n    with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE,\n                                             self.config.sanitizer,\n                                             self.target_path):\n      engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE)\n      minimized_testcase_path = testcase_path + '-minimized'\n      return engine_impl.minimize_testcase(self.target_path, [],\n                                           testcase_path,\n                                           minimized_testcase_path,\n                                           max_time=MINIMIZE_TIME_SECONDS)\n\n  def free_disk_if_needed(self, delete_fuzz_target=True):\n    \"\"\"Deletes things that are no longer needed from fuzzing this fuzz target to\n    save disk space if needed.\"\"\"\n    if not self.config.low_disk_space:\n      logging.info('Not freeing disk space after running fuzz target.')\n      return\n    logging.info('Deleting corpus and seed corpus of %s to save disk.',\n                 self.target_name)\n\n    # Delete the seed corpus, corpus, and fuzz target.\n    for corpus_path in [self.latest_corpus_path, self.pruned_corpus_path]:\n      # Use ignore_errors=True to fix\n      # https://github.com/google/oss-fuzz/issues/5383.\n      shutil.rmtree(corpus_path, ignore_errors=True)\n\n    target_seed_corpus_path = self.target_path + '_seed_corpus.zip'\n    if os.path.exists(target_seed_corpus_path):\n      os.remove(target_seed_corpus_path)\n\n    if delete_fuzz_target:\n      logging.info('Deleting fuzz target: %s.', self.target_name)\n      os.remove(self.target_path)\n    logging.info('Done deleting.')\n\n  def is_reproducible(self, testcase, target_path, reproduce_args):\n    \"\"\"Checks if the testcase reproduces.\n\n      Args:\n        testcase: The path to the testcase to be tested.\n        target_path: The path to the fuzz target to be tested\n        reproduce_args: The arguments to pass to the target to reproduce the\n          crash.\n\n      Returns:\n        True if crash is reproducible and we were able to run the\n        binary.\n\n      Raises:\n        ReproduceError if we can't attempt to reproduce the crash.\n    \"\"\"\n    if not os.path.exists(target_path):\n      logging.info('Target: %s does not exist.', target_path)\n      raise ReproduceError(f'Target {target_path} not found.')\n\n    os.chmod(target_path, stat.S_IRWXO)\n\n    logging.info('Trying to reproduce crash using: %s.', testcase)\n    with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE,\n                                             self.config.sanitizer,\n                                             target_path):\n      reproduce_time_seconds = PER_LANGUAGE_REPRODUCE_TIMEOUTS.get(\n          self.config.language, DEFAULT_REPRODUCE_TIME_SECONDS)\n      for _ in range(REPRODUCE_ATTEMPTS):\n        engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE)\n        try:\n          result = engine_impl.reproduce(target_path,\n                                         testcase,\n                                         arguments=reproduce_args,\n                                         max_time=reproduce_time_seconds)\n        except TimeoutError as error:\n          logging.error('%s.', error)\n          return False\n\n        if result.return_code != 0:\n          logging.info('Reproduce command returned: %s. Reproducible on %s.',\n                       result.return_code, target_path)\n\n          return True\n\n    logging.info('Reproduce command returned: 0. Not reproducible on %s.',\n                 target_path)\n    return False\n\n  def is_crash_reportable(self, testcase, reproduce_args, batch=False):\n    \"\"\"Returns True if a crash is reportable. This means the crash is\n    reproducible but not reproducible on a build from the ClusterFuzz deployment\n    (meaning the crash was introduced by this PR/commit/code change).\n\n    Args:\n      testcase: The path to the testcase that triggered the crash.\n      reproduce_args: The arguments to pass to the target to reproduce the\n      crash.\n\n    Returns:\n      True if the crash was introduced by the current pull request.\n\n    Raises:\n      ReproduceError if we can't attempt to reproduce the crash on the PR build.\n    \"\"\"\n\n    if not self.is_crash_type_reportable(testcase):\n      return False\n\n    if not os.path.exists(testcase):\n      raise ReproduceError(f'Testcase {testcase} not found.')\n\n    try:\n      reproducible_on_code_change = self.is_reproducible(\n          testcase, self.target_path, reproduce_args)\n    except ReproduceError as error:\n      logging.error('Could not check for crash reproducibility.'\n                    'Please file an issue:'\n                    'https://github.com/google/oss-fuzz/issues/new.')\n      raise error\n\n    if not reproducible_on_code_change:\n      logging.info('Crash is not reproducible.')\n      return self.config.report_unreproducible_crashes\n\n    logging.info('Crash is reproducible.')\n    if batch:\n      # We don't need to check if the crash is novel for batch fuzzing.\n      return True\n\n    return self.is_crash_novel(testcase, reproduce_args)\n\n  def is_crash_type_reportable(self, testcase):\n    \"\"\"Returns True if |testcase| is an actual crash. If crash is a timeout or\n    OOM then returns True if config says we should report those.\"\"\"\n    # TODO(metzman): Use a less hacky method.\n    testcase = os.path.basename(testcase)\n    if testcase.startswith('oom-'):\n      return self.config.report_ooms\n    if testcase.startswith('timeout-'):\n      return self.config.report_timeouts\n    return True\n\n  def is_crash_novel(self, testcase, reproduce_args):\n    \"\"\"Returns whether or not the crash is new. A crash is considered new if it\n    can't be reproduced on an older ClusterFuzz build of the target.\"\"\"\n    if not os.path.exists(testcase):\n      raise ReproduceError('Testcase %s not found.' % testcase)\n    clusterfuzz_build_dir = self.clusterfuzz_deployment.download_latest_build()\n    if not clusterfuzz_build_dir:\n      # Crash is reproducible on PR build and we can't test on a recent\n      # ClusterFuzz/OSS-Fuzz build.\n      logging.info(COULD_NOT_TEST_ON_CLUSTERFUZZ_MESSAGE)\n      return True\n\n    clusterfuzz_target_path = os.path.join(clusterfuzz_build_dir,\n                                           self.target_name)\n\n    try:\n      reproducible_on_clusterfuzz_build = self.is_reproducible(\n          testcase, clusterfuzz_target_path, reproduce_args)\n    except ReproduceError:\n      # This happens if the project has ClusterFuzz builds, but the fuzz target\n      # is not in it (e.g. because the fuzz target is new).\n      logging.info(COULD_NOT_TEST_ON_CLUSTERFUZZ_MESSAGE)\n      return True\n\n    if reproducible_on_clusterfuzz_build:\n      logging.info('The crash is reproducible on previous build. '\n                   'Code change (pr/commit) did not introduce crash.')\n      return False\n    logging.info('The crash is not reproducible on previous build. '\n                 'Code change (pr/commit) introduced crash.')\n    return True\n"
  },
  {
    "path": "infra/cifuzz/fuzz_target_test.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests the functionality of the fuzz_target module.\"\"\"\n\nimport os\nimport shutil\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport certifi\n# Importing this later causes import failures with pytest for some reason.\n# TODO(ochang): Figure out why.\nimport parameterized\nimport google.cloud.ndb  # pylint: disable=unused-import\nfrom pyfakefs import fake_filesystem_unittest\nfrom clusterfuzz.fuzz import engine\n\nimport clusterfuzz_deployment\nimport fuzz_target\nimport test_helpers\nimport workspace_utils\n\n# NOTE: This integration test relies on\n# https://github.com/google/oss-fuzz/tree/master/projects/example project.\nEXAMPLE_PROJECT = 'example'\n\n# An example fuzzer that triggers an error.\nEXAMPLE_FUZZER = 'example_crash_fuzzer'\n\n# Mock return values for engine_impl.reproduce.\nEXECUTE_SUCCESS_RESULT = engine.ReproduceResult([], 0, 0, '')\nEXECUTE_FAILURE_RESULT = engine.ReproduceResult([], 1, 0, '')\n\nTEST_DATA_PATH = os.path.join(os.path.dirname(__file__), 'test_data')\n\n\ndef _create_config(**kwargs):\n  \"\"\"Creates a config object and then sets every attribute that is a key in\n  |kwargs| to the corresponding value. Asserts that each key in |kwargs| is an\n  attribute of Config.\"\"\"\n  defaults = {\n      'cfl_platform': 'github',\n      'oss_fuzz_project_name': EXAMPLE_PROJECT,\n      'workspace': '/workspace'\n  }\n  for default_key, default_value in defaults.items():\n    if default_key not in kwargs:\n      kwargs[default_key] = default_value\n\n  return test_helpers.create_run_config(**kwargs)\n\n\ndef _create_deployment(**kwargs):\n  config = _create_config(**kwargs)\n  workspace = workspace_utils.Workspace(config)\n  return clusterfuzz_deployment.get_clusterfuzz_deployment(config, workspace)\n\n\n@mock.patch('utils.get_container_name', return_value='container')\nclass IsReproducibleTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests the is_reproducible method in the fuzz_target.FuzzTarget class.\"\"\"\n\n  def setUp(self):\n    \"\"\"Sets up example fuzz target to test is_reproducible method.\"\"\"\n    self.fuzz_target_name = 'fuzz-target'\n    deployment = _create_deployment()\n    self.config = deployment.config\n    self.workspace = deployment.workspace\n    self.fuzz_target_path = os.path.join(self.workspace.out,\n                                         self.fuzz_target_name)\n    self.setUpPyfakefs()\n    self.fs.create_file(self.fuzz_target_path)\n    self.testcase_path = '/testcase'\n    self.fs.create_file(self.testcase_path)\n\n    self.target = fuzz_target.FuzzTarget(self.fuzz_target_path,\n                                         fuzz_target.REPRODUCE_ATTEMPTS,\n                                         self.workspace, deployment,\n                                         deployment.config)\n\n    # ClusterFuzz requires ROOT_DIR.\n    root_dir = os.environ['ROOT_DIR']\n    test_helpers.patch_environ(self, empty=True)\n    os.environ['ROOT_DIR'] = root_dir\n\n  # There's an extremely bad issue that happens if this test is run: Other tests\n  # in this file fail in CI with stacktraces using referencing fakefs even if\n  # the tests do not use fakefs.\n  # TODO(metzman): Stop using fakefs.\n  @mock.patch('os.chmod')\n  @unittest.skip('Skip because of weird failures.')\n  def test_repro_timed_out(self, mock_chmod, mock_get_container_name):\n    \"\"\"Tests that is_reproducible behaves correctly when reproduction times\n    out.\"\"\"\n    del mock_get_container_name\n    del mock_chmod\n\n    with mock.patch(\n        'clusterfuzz._internal.bot.fuzzers.libFuzzer.engine.LibFuzzerEngine.'\n        'reproduce',\n        side_effect=TimeoutError):\n      self.assertFalse(\n          self.target.is_reproducible('/testcase', self.target.target_path, []))\n\n  def test_reproducible(self, _):\n    \"\"\"Tests that is_reproducible returns True if crash is detected and that\n    is_reproducible uses the correct command to reproduce a crash.\"\"\"\n    all_repro = [EXECUTE_FAILURE_RESULT] * fuzz_target.REPRODUCE_ATTEMPTS\n    with mock.patch('clusterfuzz.fuzz.get_engine') as mock_get_engine:\n      mock_get_engine().reproduce.side_effect = all_repro\n\n      result = self.target.is_reproducible(self.testcase_path,\n                                           self.fuzz_target_path, [])\n      mock_get_engine().reproduce.assert_called_once_with(\n          '/workspace/build-out/fuzz-target',\n          '/testcase',\n          arguments=[],\n          max_time=30)\n      self.assertTrue(result)\n      self.assertEqual(1, mock_get_engine().reproduce.call_count)\n\n  def test_flaky(self, _):\n    \"\"\"Tests that is_reproducible returns True if crash is detected on the last\n    attempt.\"\"\"\n    last_time_repro = [EXECUTE_SUCCESS_RESULT] * 9 + [EXECUTE_FAILURE_RESULT]\n    with mock.patch('clusterfuzz.fuzz.get_engine') as mock_get_engine:\n      mock_get_engine().reproduce.side_effect = last_time_repro\n      self.assertTrue(\n          self.target.is_reproducible(self.testcase_path, self.fuzz_target_path,\n                                      []))\n      self.assertEqual(fuzz_target.REPRODUCE_ATTEMPTS,\n                       mock_get_engine().reproduce.call_count)\n\n  def test_nonexistent_fuzzer(self, _):\n    \"\"\"Tests that is_reproducible raises an error if it could not attempt\n    reproduction because the fuzzer doesn't exist.\"\"\"\n    with self.assertRaises(fuzz_target.ReproduceError):\n      self.target.is_reproducible(self.testcase_path, '/non-existent-path', [])\n\n  def test_unreproducible(self, _):\n    \"\"\"Tests that is_reproducible returns False for a crash that did not\n    reproduce.\"\"\"\n    all_unrepro = [EXECUTE_SUCCESS_RESULT] * fuzz_target.REPRODUCE_ATTEMPTS\n    with mock.patch('clusterfuzz.fuzz.get_engine') as mock_get_engine:\n      mock_get_engine().reproduce.side_effect = all_unrepro\n      result = self.target.is_reproducible(self.testcase_path,\n                                           self.fuzz_target_path, [])\n      self.assertFalse(result)\n\n\nclass IsCrashReportableTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests the is_crash_reportable method of FuzzTarget.\"\"\"\n\n  def setUp(self):\n    \"\"\"Sets up example fuzz target to test is_crash_reportable method.\"\"\"\n    self.setUpPyfakefs()\n    self.fuzz_target_path = '/example/do_stuff_fuzzer'\n    deployment = _create_deployment()\n    self.target = fuzz_target.FuzzTarget(self.fuzz_target_path, 100,\n                                         deployment.workspace, deployment,\n                                         deployment.config)\n    self.oss_fuzz_build_path = '/oss-fuzz-build'\n    self.fs.create_file(self.fuzz_target_path)\n    self.oss_fuzz_target_path = os.path.join(\n        self.oss_fuzz_build_path, os.path.basename(self.fuzz_target_path))\n    self.fs.create_file(self.oss_fuzz_target_path)\n    self.testcase_path = '/testcase'\n    self.fs.create_file(self.testcase_path, contents='')\n\n    # Do this to prevent pyfakefs from messing with requests.\n    self.fs.add_real_directory(os.path.dirname(certifi.__file__))\n\n  @mock.patch('fuzz_target.FuzzTarget.is_reproducible',\n              side_effect=[True, False])\n  @mock.patch('logging.info')\n  def test_new_reproducible_crash(self, mock_info, _):\n    \"\"\"Tests that a new reproducible crash returns True.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      self.target.out_dir = tmp_dir\n      self.assertTrue(self.target.is_crash_reportable(self.testcase_path, []))\n    mock_info.assert_called_with(\n        'The crash is not reproducible on previous build. '\n        'Code change (pr/commit) introduced crash.')\n\n  # yapf: disable\n  @parameterized.parameterized.expand([\n      # Reproducible on PR build, but also reproducible on OSS-Fuzz.\n      ([True, True],),\n\n      # Not reproducible on PR build, but somehow reproducible on OSS-Fuzz.\n      # Unlikely to happen in real world except if test is flaky.\n      ([False, True],),\n\n      # Not reproducible on PR build, and not reproducible on OSS-Fuzz.\n      ([False, False],),\n  ])\n  # yapf: enable\n  def test_invalid_crash(self, is_reproducible_retvals):\n    \"\"\"Tests that a nonreportable crash causes the method to return False.\"\"\"\n    with mock.patch('fuzz_target.FuzzTarget.is_reproducible',\n                    side_effect=is_reproducible_retvals):\n      with mock.patch('clusterfuzz_deployment.OSSFuzz.download_latest_build',\n                      return_value=self.oss_fuzz_build_path):\n        self.assertFalse(self.target.is_crash_reportable(\n            self.testcase_path, []))\n\n  @mock.patch('logging.info')\n  @mock.patch('fuzz_target.FuzzTarget.is_reproducible', return_value=[True])\n  def test_reproducible_no_oss_fuzz_target(self, _, mock_info):\n    \"\"\"Tests that is_crash_reportable returns True when a crash reproduces on\n    the PR build but the target is not in the OSS-Fuzz build (usually because it\n    is new).\"\"\"\n    os.remove(self.oss_fuzz_target_path)\n\n    def is_reproducible_side_effect(testcase, target_path, reproduce_arguments):\n      del testcase\n      del reproduce_arguments\n      if os.path.dirname(target_path) == self.oss_fuzz_build_path:\n        raise fuzz_target.ReproduceError()\n      return True\n\n    with mock.patch(\n        'fuzz_target.FuzzTarget.is_reproducible',\n        side_effect=is_reproducible_side_effect) as mock_is_reproducible:\n      with mock.patch('clusterfuzz_deployment.OSSFuzz.download_latest_build',\n                      return_value=self.oss_fuzz_build_path):\n        self.assertTrue(self.target.is_crash_reportable(self.testcase_path, []))\n    mock_is_reproducible.assert_any_call(self.testcase_path,\n                                         self.oss_fuzz_target_path, [])\n    mock_info.assert_called_with(\n        'Could not run previous build of target to determine if this code '\n        'change (pr/commit) introduced crash. Assuming crash was newly '\n        'introduced.')\n\n\nclass FuzzTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Fuzz test.\"\"\"\n\n  def setUp(self):\n    \"\"\"Sets up example fuzz target.\"\"\"\n    self.setUpPyfakefs()\n    deployment = _create_deployment()\n    config = deployment.config\n    workspace = deployment.workspace\n    self.fuzz_target = fuzz_target.FuzzTarget('/path/fuzz-target', 10,\n                                              workspace, deployment, config)\n\n  def test_get_fuzz_target_artifact(self):\n    \"\"\"Tests that get_fuzz_target_artifact works as intended.\"\"\"\n    # pylint: disable=protected-access\n    fuzz_target_artifact = self.fuzz_target._target_artifact_path()\n    self.assertEqual('/workspace/out/artifacts/fuzz-target/address',\n                     fuzz_target_artifact)\n\n\nclass TimeoutIntegrationTest(unittest.TestCase):\n  \"\"\"Tests handling of fuzzer timeout (timeout crashes reported by\n  libFuzzer).\"\"\"\n  TIMEOUT_FUZZER_NAME = 'timeout_fuzzer'\n\n  @parameterized.parameterized.expand([(True, True), (False, False)])\n  def test_timeout_reported(self, report_timeouts, expect_crash):\n    \"\"\"Tests that timeouts are not reported.\"\"\"\n    with test_helpers.temp_dir_copy(TEST_DATA_PATH) as temp_dir:\n      fuzz_target_path = os.path.join(temp_dir, 'build-out',\n                                      self.TIMEOUT_FUZZER_NAME)\n      shutil.copy(os.path.join(temp_dir, self.TIMEOUT_FUZZER_NAME),\n                  fuzz_target_path)\n      deployment = _create_deployment(workspace=temp_dir,\n                                      report_timeouts=report_timeouts)\n      config = deployment.config\n      fuzz_target_obj = fuzz_target.FuzzTarget(fuzz_target_path,\n                                               fuzz_target.REPRODUCE_ATTEMPTS,\n                                               deployment.workspace, deployment,\n                                               config)\n      with mock.patch('clusterfuzz._internal.bot.fuzzers.libfuzzer.'\n                      'fix_timeout_argument_for_reproduction') as _:\n        with mock.patch(\n            'clusterfuzz._internal.bot.fuzzers.libFuzzer.fuzzer.get_arguments',\n            return_value=['-timeout=1', '-rss_limit_mb=2560']):\n          fuzz_result = fuzz_target_obj.fuzz()\n    self.assertEqual(bool(fuzz_result.testcase), expect_crash)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/cifuzz/generate_coverage_report.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for generating coverage reports.\"\"\"\nimport os\n\nimport base_runner_utils\nimport fuzz_target\nimport utils\n\n\ndef run_coverage_command(config, workspace):\n  \"\"\"Runs the coverage command in base-runner to generate a coverage report.\"\"\"\n  env = base_runner_utils.get_env(config, workspace)\n  env['HTTP_PORT'] = ''\n  env['COVERAGE_EXTRA_ARGS'] = ''\n  env['CORPUS_DIR'] = workspace.corpora\n  env['COVERAGE_OUTPUT_DIR'] = workspace.coverage_report\n  command = 'coverage'\n  return utils.execute(command, env=env)\n\n\ndef download_corpora(fuzz_target_paths, clusterfuzz_deployment):\n  \"\"\"Downloads corpora for fuzz targets in |fuzz_target_paths| using\n  |clusterfuzz_deployment| to download corpora from ClusterFuzz/OSS-Fuzz.\"\"\"\n  for target_path in fuzz_target_paths:\n    target_name = os.path.basename(target_path)\n    corpus_dir = fuzz_target.get_fuzz_target_corpus_dir(\n        clusterfuzz_deployment.workspace, target_name)\n    clusterfuzz_deployment.download_corpus(target_name, corpus_dir)\n\n\ndef generate_coverage_report(fuzz_target_paths, workspace,\n                             clusterfuzz_deployment, config):\n  \"\"\"Generates a coverage report using Clang's source based coverage.\"\"\"\n  download_corpora(fuzz_target_paths, clusterfuzz_deployment)\n  run_coverage_command(config, workspace)\n  clusterfuzz_deployment.upload_coverage()\n"
  },
  {
    "path": "infra/cifuzz/generate_coverage_report_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for generate_coverage_report.\"\"\"\n\nimport unittest\nfrom unittest import mock\n\nimport generate_coverage_report\nimport test_helpers\n\nOUT_DIR = '/outdir'\nPROJECT = 'example-project'\nSANITIZER = 'coverage'\n\n\nclass TestRunCoverageCommand(unittest.TestCase):\n  \"\"\"Tests run_coverage_command\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self, empty=True)\n\n  @mock.patch('utils.execute')\n  def test_run_coverage_command(self, mock_execute):  # pylint: disable=no-self-use\n    \"\"\"Tests that run_coverage_command works as intended.\"\"\"\n    config = test_helpers.create_run_config(oss_fuzz_project_name=PROJECT,\n                                            sanitizer=SANITIZER)\n    workspace = test_helpers.create_workspace()\n    generate_coverage_report.run_coverage_command(config, workspace)\n    expected_command = 'coverage'\n    expected_env = {\n        'SANITIZER': config.sanitizer,\n        'FUZZING_LANGUAGE': config.language,\n        'OUT': workspace.out,\n        'CIFUZZ': 'True',\n        'FUZZING_ENGINE': 'libfuzzer',\n        'ARCHITECTURE': 'x86_64',\n        'FUZZER_ARGS': '-rss_limit_mb=2560 -timeout=25',\n        'HTTP_PORT': '',\n        'COVERAGE_EXTRA_ARGS': '',\n        'CORPUS_DIR': workspace.corpora,\n        'COVERAGE_OUTPUT_DIR': workspace.coverage_report\n    }\n    mock_execute.assert_called_with(expected_command, env=expected_env)\n\n\nclass DownloadCorporaTest(unittest.TestCase):\n  \"\"\"Tests for download_corpora.\"\"\"\n\n  def test_download_corpora(self):  # pylint: disable=no-self-use\n    \"\"\"Tests that download_corpora works as intended.\"\"\"\n    clusterfuzz_deployment = mock.Mock()\n    clusterfuzz_deployment.workspace = test_helpers.create_workspace()\n    fuzz_target_paths = ['/path/to/fuzzer1', '/path/to/fuzzer2']\n    expected_calls = [\n        mock.call('fuzzer1', '/workspace/cifuzz-corpus/fuzzer1'),\n        mock.call('fuzzer2', '/workspace/cifuzz-corpus/fuzzer2')\n    ]\n    generate_coverage_report.download_corpora(fuzz_target_paths,\n                                              clusterfuzz_deployment)\n    clusterfuzz_deployment.download_corpus.assert_has_calls(expected_calls)\n"
  },
  {
    "path": "infra/cifuzz/get_coverage.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for determining coverage of fuzz targets.\"\"\"\nimport json\nimport logging\nimport os\nimport sys\n\nimport http_utils\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nimport utils\n\n# The path to get OSS-Fuzz project's latest report json file.`\nOSS_FUZZ_LATEST_COVERAGE_INFO_PATH = 'oss-fuzz-coverage/latest_report_info/'\n\n\n# pylint: disable=too-few-public-methods\nclass CoverageError(Exception):\n  \"\"\"Exceptions for project coverage.\"\"\"\n\n\nclass BaseCoverage:\n  \"\"\"Gets coverage data for a project.\"\"\"\n\n  def __init__(self, repo_path):\n    self.repo_path = _normalize_repo_path(repo_path)\n\n  def get_files_covered_by_target(self, target):\n    \"\"\"Returns a list of source files covered by the specific fuzz target.\n\n    Args:\n      target: The name of the fuzz target whose coverage is requested.\n\n    Returns:\n      A list of files that the fuzz target covers or None.\n    \"\"\"\n    target_cov = self.get_target_coverage(target)\n    if not target_cov:\n      logging.info('No coverage available for %s.', target)\n      return None\n\n    coverage_per_file = get_coverage_per_file(target_cov)\n    if not coverage_per_file:\n      logging.info('No files found in coverage report.')\n      return None\n\n    affected_file_list = []\n    for file_cov in coverage_per_file:\n      norm_file_path = os.path.normpath(file_cov['filename'])\n      if not norm_file_path.startswith(self.repo_path):\n        # Exclude files outside of the main repo.\n        continue\n\n      if not is_file_covered(file_cov):\n        # Don't consider a file affected if code in it is never executed.\n        continue\n\n      # TODO(metzman): It's weird to me that we access file_cov['filename']\n      # again and not norm_file_path, figure out if this makes sense.\n      relative_path = utils.remove_prefix(file_cov['filename'], self.repo_path)\n      affected_file_list.append(relative_path)\n\n    return affected_file_list\n\n  def get_target_coverage(self, target):\n    \"\"\"Get the coverage report for a specific fuzz target.\n\n    Args:\n      target: The name of the fuzz target whose coverage is requested.\n\n    Returns:\n      The target's coverage json dict or None on failure.\n    \"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n\nclass OSSFuzzCoverage(BaseCoverage):\n  \"\"\"Gets coverage data for a project from OSS-Fuzz.\"\"\"\n\n  def __init__(self, repo_path, oss_fuzz_project_name):\n    \"\"\"Constructor for OSSFuzzCoverage.\"\"\"\n    super().__init__(repo_path)\n    self.oss_fuzz_project_name = oss_fuzz_project_name\n    self.fuzzer_stats_url = _get_oss_fuzz_fuzzer_stats_dir_url(\n        self.oss_fuzz_project_name)\n    if self.fuzzer_stats_url is None:\n      raise CoverageError('Could not get latest coverage.')\n\n  def get_target_coverage(self, target):\n    \"\"\"Get the coverage report for a specific fuzz target.\n\n    Args:\n      target: The name of the fuzz target whose coverage is requested.\n\n    Returns:\n      The target's coverage json dict or None on failure.\n    \"\"\"\n    if not self.fuzzer_stats_url:\n      return None\n\n    target_url = utils.url_join(self.fuzzer_stats_url, target + '.json')\n    return http_utils.get_json_from_url(target_url)\n\n\ndef _get_oss_fuzz_latest_cov_report_info(oss_fuzz_project_name):\n  \"\"\"Gets and returns a dictionary containing the latest coverage report info\n  for |project|.\"\"\"\n  latest_report_info_url = utils.url_join(utils.GCS_BASE_URL,\n                                          OSS_FUZZ_LATEST_COVERAGE_INFO_PATH,\n                                          oss_fuzz_project_name + '.json')\n  latest_cov_info = http_utils.get_json_from_url(latest_report_info_url)\n  if latest_cov_info is None:\n    logging.error('Could not get the coverage report json from url: %s.',\n                  latest_report_info_url)\n    return None\n  return latest_cov_info\n\n\ndef _get_oss_fuzz_fuzzer_stats_dir_url(oss_fuzz_project_name):\n  \"\"\"Gets latest coverage report info for a specific OSS-Fuzz project from\n  GCS.\n\n  Args:\n    oss_fuzz_project_name: The name of the project.\n\n  Returns:\n    The projects coverage report info in json dict or None on failure.\n  \"\"\"\n  latest_cov_info = _get_oss_fuzz_latest_cov_report_info(oss_fuzz_project_name)\n\n  if not latest_cov_info:\n    return None\n\n  if 'fuzzer_stats_dir' not in latest_cov_info:\n    logging.error('fuzzer_stats_dir not in latest coverage info.')\n    return None\n\n  fuzzer_stats_dir_gs_url = latest_cov_info['fuzzer_stats_dir']\n  fuzzer_stats_dir_url = utils.gs_url_to_https(fuzzer_stats_dir_gs_url)\n  return fuzzer_stats_dir_url\n\n\nclass FilesystemCoverage(BaseCoverage):\n  \"\"\"Class that gets a project's coverage from the filesystem.\"\"\"\n\n  def __init__(self, repo_path, project_coverage_dir):\n    super().__init__(repo_path)\n    self.project_coverage_dir = project_coverage_dir\n\n  def get_target_coverage(self, target):\n    \"\"\"Get the coverage report for a specific fuzz target.\n\n    Args:\n      target: The name of the fuzz target whose coverage is requested.\n\n    Returns:\n      The target's coverage json dict or None on failure.\n    \"\"\"\n    logging.info('Getting coverage for %s from filesystem.', target)\n    fuzzer_stats_json_path = os.path.join(self.project_coverage_dir,\n                                          'fuzzer_stats', target + '.json')\n    if not os.path.exists(fuzzer_stats_json_path):\n      logging.warning('%s does not exist.', fuzzer_stats_json_path)\n      return None\n\n    with open(fuzzer_stats_json_path) as fuzzer_stats_json_file_handle:\n      try:\n        return json.load(fuzzer_stats_json_file_handle)\n      except json.decoder.JSONDecodeError as err:\n        logging.error('Could not decode: %s. Error: %s.',\n                      fuzzer_stats_json_path, err)\n        return None\n\n\ndef is_file_covered(file_cov):\n  \"\"\"Returns whether the file is covered.\"\"\"\n  return file_cov['summary']['regions']['covered']\n\n\ndef get_coverage_per_file(target_cov):\n  \"\"\"Returns the coverage per file within |target_cov|.\"\"\"\n  try:\n    return target_cov['data'][0]['files']\n  except (IndexError, TypeError, KeyError):\n    logging.error('target_cov: %s is malformed.', target_cov)\n    return None\n\n\ndef _normalize_repo_path(repo_path):\n  \"\"\"Normalizes and returns |repo_path| to make sure cases like /src/curl and\n  /src/curl/ are both handled.\"\"\"\n  repo_path = os.path.normpath(repo_path)\n  if not repo_path.endswith('/'):\n    repo_path += '/'\n  return repo_path\n"
  },
  {
    "path": "infra/cifuzz/get_coverage_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for get_coverage.py\"\"\"\nimport os\nimport json\nimport unittest\nfrom unittest import mock\n\nimport parameterized\nfrom pyfakefs import fake_filesystem_unittest\nimport pytest\n\nimport get_coverage\n\n# pylint: disable=protected-access\n\nTEST_DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n                              'test_data')\n\nPROJECT_NAME = 'curl'\nREPO_PATH = '/src/curl'\nFUZZ_TARGET = 'curl_fuzzer'\nPROJECT_COV_JSON_FILENAME = 'example_curl_cov.json'\nFUZZ_TARGET_COV_JSON_FILENAME = 'example_curl_fuzzer_cov.json'\nINVALID_TARGET = 'not-a-fuzz-target'\n\nwith open(os.path.join(TEST_DATA_PATH,\n                       PROJECT_COV_JSON_FILENAME),) as cov_file_handle:\n  PROJECT_COV_INFO = json.loads(cov_file_handle.read())\n\n\nclass GetOssFuzzFuzzerStatsDirUrlTest(unittest.TestCase):\n  \"\"\"Tests _get_oss_fuzz_fuzzer_stats_dir_url.\"\"\"\n\n  @mock.patch('http_utils.get_json_from_url',\n              return_value={\n                  'fuzzer_stats_dir':\n                      'gs://oss-fuzz-coverage/systemd/fuzzer_stats/20210303'\n              })\n  def test_get_valid_project(self, mock_get_json_from_url):\n    \"\"\"Tests that a project's coverage report can be downloaded and parsed.\n\n    NOTE: This test relies on the PROJECT_NAME repo's coverage report.\n    The \"example\" project was not used because it has no coverage reports.\n    \"\"\"\n    result = get_coverage._get_oss_fuzz_fuzzer_stats_dir_url(PROJECT_NAME)\n    (url,), _ = mock_get_json_from_url.call_args\n    self.assertEqual(\n        'https://storage.googleapis.com/oss-fuzz-coverage/'\n        'latest_report_info/curl.json', url)\n\n    expected_result = (\n        'https://storage.googleapis.com/oss-fuzz-coverage/systemd/fuzzer_stats/'\n        '20210303')\n    self.assertEqual(result, expected_result)\n\n  def test_get_invalid_project(self):\n    \"\"\"Tests that passing a bad project returns None.\"\"\"\n    self.assertIsNone(\n        get_coverage._get_oss_fuzz_fuzzer_stats_dir_url('not-a-proj'))\n\n\nclass OSSFuzzCoverageGetTargetCoverageTest(unittest.TestCase):\n  \"\"\"Tests OSSFuzzCoverage.get_target_coverage.\"\"\"\n\n  def setUp(self):\n    with mock.patch('get_coverage._get_oss_fuzz_latest_cov_report_info',\n                    return_value=PROJECT_COV_INFO):\n      self.oss_fuzz_coverage = get_coverage.OSSFuzzCoverage(\n          REPO_PATH, PROJECT_NAME)\n\n  @mock.patch('http_utils.get_json_from_url', return_value={})\n  def test_valid_target(self, mock_get_json_from_url):\n    \"\"\"Tests that a target's coverage report can be downloaded and parsed.\"\"\"\n    self.oss_fuzz_coverage.get_target_coverage(FUZZ_TARGET)\n    (url,), _ = mock_get_json_from_url.call_args\n    self.assertEqual(\n        'https://storage.googleapis.com/oss-fuzz-coverage/'\n        'curl/fuzzer_stats/20200226/curl_fuzzer.json', url)\n\n  def test_invalid_target(self):\n    \"\"\"Tests that passing an invalid target coverage report returns None.\"\"\"\n    self.assertIsNone(\n        self.oss_fuzz_coverage.get_target_coverage(INVALID_TARGET))\n\n  @mock.patch('get_coverage._get_oss_fuzz_latest_cov_report_info',\n              return_value=None)\n  def test_invalid_project_json(self, _):  # pylint: disable=no-self-use\n    \"\"\"Tests an invalid project JSON results in None being returned.\"\"\"\n    with pytest.raises(get_coverage.CoverageError):\n      get_coverage.OSSFuzzCoverage(REPO_PATH, PROJECT_NAME)\n\n\ndef _get_expected_curl_covered_file_list():\n  \"\"\"Returns the expected covered file list for\n  FUZZ_TARGET_COV_JSON_FILENAME.\"\"\"\n  curl_files_list_path = os.path.join(TEST_DATA_PATH,\n                                      'example_curl_file_list.json')\n  with open(curl_files_list_path) as file_handle:\n    return json.loads(file_handle.read())\n\n\ndef _get_example_curl_coverage():\n  \"\"\"Returns the contents of the fuzzer stats JSON file for\n  FUZZ_TARGET_COV_JSON_FILENAME.\"\"\"\n  with open(os.path.join(TEST_DATA_PATH,\n                         FUZZ_TARGET_COV_JSON_FILENAME)) as file_handle:\n    return json.loads(file_handle.read())\n\n\nclass OSSFuzzCoverageGetFilesCoveredByTargetTest(unittest.TestCase):\n  \"\"\"Tests OSSFuzzCoverage.get_files_covered_by_target.\"\"\"\n\n  def setUp(self):\n    with mock.patch('get_coverage._get_oss_fuzz_latest_cov_report_info',\n                    return_value=PROJECT_COV_INFO):\n      self.oss_fuzz_coverage = get_coverage.OSSFuzzCoverage(\n          REPO_PATH, PROJECT_NAME)\n\n  @parameterized.parameterized.expand([({\n      'data': []\n  },), ({\n      'data': [[]]\n  },), ({\n      'data': [{}]\n  },)])\n  def test_malformed_cov_data(self, coverage_data):\n    \"\"\"Tests that covered files can be retrieved from a coverage report.\"\"\"\n    with mock.patch('get_coverage.OSSFuzzCoverage.get_target_coverage',\n                    return_value=coverage_data):\n      self.oss_fuzz_coverage.get_files_covered_by_target(FUZZ_TARGET)\n\n  def test_valid_target(self):\n    \"\"\"Tests that covered files can be retrieved from a coverage report.\"\"\"\n    fuzzer_cov_data = _get_example_curl_coverage()\n    with mock.patch('get_coverage.OSSFuzzCoverage.get_target_coverage',\n                    return_value=fuzzer_cov_data):\n      file_list = self.oss_fuzz_coverage.get_files_covered_by_target(\n          FUZZ_TARGET)\n\n    expected_file_list = _get_expected_curl_covered_file_list()\n    self.assertCountEqual(file_list, expected_file_list)\n\n  def test_invalid_target(self):\n    \"\"\"Tests passing invalid fuzz target returns None.\"\"\"\n    self.assertIsNone(\n        self.oss_fuzz_coverage.get_files_covered_by_target(INVALID_TARGET))\n\n\nclass FilesystemCoverageGetFilesCoveredByTargetTest(\n    fake_filesystem_unittest.TestCase):\n  \"\"\"Tests FilesystemCoverage.get_files_covered_by_target.\"\"\"\n\n  def setUp(self):\n    _fuzzer_cov_data = _get_example_curl_coverage()\n    self._expected_file_list = _get_expected_curl_covered_file_list()\n    self.coverage_path = '/coverage'\n    self.filesystem_coverage = get_coverage.FilesystemCoverage(\n        REPO_PATH, self.coverage_path)\n    self.setUpPyfakefs()\n    self.fs.create_file(os.path.join(self.coverage_path, 'fuzzer_stats',\n                                     FUZZ_TARGET + '.json'),\n                        contents=json.dumps(_fuzzer_cov_data))\n\n  def test_valid_target(self):\n    \"\"\"Tests that covered files can be retrieved from a coverage report.\"\"\"\n    file_list = self.filesystem_coverage.get_files_covered_by_target(\n        FUZZ_TARGET)\n    self.assertCountEqual(file_list, self._expected_file_list)\n\n  def test_invalid_target(self):\n    \"\"\"Tests passing invalid fuzz target returns None.\"\"\"\n    self.assertIsNone(\n        self.filesystem_coverage.get_files_covered_by_target(INVALID_TARGET))\n\n\nclass IsFileCoveredTest(unittest.TestCase):\n  \"\"\"Tests for is_file_covered.\"\"\"\n\n  def test_is_file_covered_covered(self):\n    \"\"\"Tests that is_file_covered returns True for a covered file.\"\"\"\n    file_coverage = {\n        'filename': '/src/systemd/src/basic/locale-util.c',\n        'summary': {\n            'regions': {\n                'count': 204,\n                'covered': 200,\n                'notcovered': 200,\n                'percent': 98.03\n            }\n        }\n    }\n    self.assertTrue(get_coverage.is_file_covered(file_coverage))\n\n  def test_is_file_covered_not_covered(self):\n    \"\"\"Tests that is_file_covered returns False for a not covered file.\"\"\"\n    file_coverage = {\n        'filename': '/src/systemd/src/basic/locale-util.c',\n        'summary': {\n            'regions': {\n                'count': 204,\n                'covered': 0,\n                'notcovered': 0,\n                'percent': 0\n            }\n        }\n    }\n    self.assertFalse(get_coverage.is_file_covered(file_coverage))\n\n\nclass GetOssFuzzLatestCovReportInfo(unittest.TestCase):\n  \"\"\"Tests that _get_oss_fuzz_latest_cov_report_info works as\n  intended.\"\"\"\n\n  PROJECT = 'project'\n  LATEST_REPORT_INFO_URL = ('https://storage.googleapis.com/oss-fuzz-coverage/'\n                            'latest_report_info/project.json')\n\n  @mock.patch('logging.error')\n  @mock.patch('http_utils.get_json_from_url', return_value={'coverage': 1})\n  def test_get_oss_fuzz_latest_cov_report_info(self, mock_get_json_from_url,\n                                               mock_error):\n    \"\"\"Tests that _get_oss_fuzz_latest_cov_report_info works as intended.\"\"\"\n    result = get_coverage._get_oss_fuzz_latest_cov_report_info(self.PROJECT)\n    self.assertEqual(result, {'coverage': 1})\n    mock_error.assert_not_called()\n    mock_get_json_from_url.assert_called_with(self.LATEST_REPORT_INFO_URL)\n\n  @mock.patch('logging.error')\n  @mock.patch('http_utils.get_json_from_url', return_value=None)\n  def test_get_oss_fuzz_latest_cov_report_info_fail(self, _, mock_error):\n    \"\"\"Tests that _get_oss_fuzz_latest_cov_report_info works as intended when we\n    can't get latest report info.\"\"\"\n    result = get_coverage._get_oss_fuzz_latest_cov_report_info('project')\n    self.assertIsNone(result)\n    mock_error.assert_called_with(\n        'Could not get the coverage report json from url: %s.',\n        self.LATEST_REPORT_INFO_URL)\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/cifuzz/http_utils.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Utility module for HTTP.\"\"\"\nimport json\nimport logging\nimport os\nimport sys\nimport tempfile\nimport zipfile\n\nimport requests\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nimport retry\n\n_DOWNLOAD_URL_RETRIES = 3\n_DOWNLOAD_URL_BACKOFF = 1\n_HTTP_REQUEST_TIMEOUT = 10\n\n\ndef download_and_unpack_zip(url, extract_directory, headers=None):\n  \"\"\"Downloads and unpacks a zip file from an HTTP URL.\n\n  Args:\n    url: A url to the zip file to be downloaded and unpacked.\n    extract_directory: The path where the zip file should be extracted to.\n    headers: (Optional) HTTP headers to send with the download request.\n\n  Returns:\n    True on success.\n  \"\"\"\n  if headers is None:\n    headers = {}\n\n  if not os.path.exists(extract_directory):\n    logging.error('Extract directory: %s does not exist.', extract_directory)\n    return False\n\n  # Gives the temporary zip file a unique identifier in the case that\n  # that download_and_unpack_zip is done in parallel.\n  with tempfile.NamedTemporaryFile(suffix='.zip') as tmp_file:\n    if not download_url(url, tmp_file.name, headers=headers):\n      return False\n\n    try:\n      with zipfile.ZipFile(tmp_file.name, 'r') as zip_file:\n        zip_file.extractall(extract_directory)\n    except zipfile.BadZipFile:\n      logging.error('Error unpacking zip from %s. Bad Zipfile.', url)\n      return False\n\n  return True\n\n\ndef download_url(*args, **kwargs):\n  \"\"\"Wrapper around _download_url that returns False if _download_url\n  exceptions.\"\"\"\n  try:\n    return _download_url(*args, **kwargs)\n  except Exception:  # pylint: disable=broad-except\n    return False\n\n\ndef get_json_from_url(url):\n  \"\"\"Gets a json object from a specified HTTP URL.\n\n  Args:\n    url: The url of the json to be downloaded.\n\n  Returns:\n    A dictionary deserialized from JSON or None on failure.\n  \"\"\"\n  try:\n    return requests.get(url, timeout=_HTTP_REQUEST_TIMEOUT).json()\n  except (ValueError, TypeError, json.JSONDecodeError,\n          requests.exceptions.ReadTimeout) as err:\n    logging.error('Loading json from url %s failed with: %s.', url, str(err))\n    return None\n\n\n@retry.wrap(_DOWNLOAD_URL_RETRIES, _DOWNLOAD_URL_BACKOFF)\ndef _download_url(url, filename, headers=None):\n  \"\"\"Downloads the file located at |url|, using HTTP to |filename|.\n\n  Args:\n    url: A url to a file to download.\n    filename: The path the file should be downloaded to.\n    headers: (Optional) HTTP headers to send with the download request.\n\n  Returns:\n    True on success.\n  \"\"\"\n  if headers is None:\n    headers = {}\n\n  response = requests.get(url, headers=headers)\n\n  if response.status_code != 200:\n    logging.error('Unable to download from: %s. Code: %d. Content: %s.', url,\n                  response.status_code, response.content)\n    return False\n\n  with open(filename, 'wb') as file_handle:\n    file_handle.write(response.content)\n\n  return True\n"
  },
  {
    "path": "infra/cifuzz/http_utils_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for http_utils.py\"\"\"\n\nimport unittest\nfrom unittest import mock\n\nfrom pyfakefs import fake_filesystem_unittest\n\nimport http_utils\n\nmock_get_response = mock.MagicMock(status_code=200, content=b'')\n\n\nclass DownloadUrlTest(unittest.TestCase):\n  \"\"\"Tests that download_url works.\"\"\"\n  URL = 'https://example.com/file'\n  FILE_PATH = '/tmp/file'\n\n  @mock.patch('time.sleep')\n  @mock.patch('requests.get', return_value=mock_get_response)\n  def test_download_url_no_error(self, mock_urlretrieve, _):\n    \"\"\"Tests that download_url works when there is no error.\"\"\"\n    self.assertTrue(http_utils.download_url(self.URL, self.FILE_PATH))\n    self.assertEqual(1, mock_urlretrieve.call_count)\n\n  @mock.patch('time.sleep')\n  @mock.patch('logging.error')\n  @mock.patch('requests.get',\n              return_value=mock.MagicMock(status_code=404, content=b''))\n  def test_download_url_http_error(self, mock_get, mock_error, _):\n    \"\"\"Tests that download_url doesn't retry when there is an HTTP error.\"\"\"\n    self.assertFalse(http_utils.download_url(self.URL, self.FILE_PATH))\n    mock_error.assert_called_with(\n        'Unable to download from: %s. Code: %d. Content: %s.', self.URL, 404,\n        b'')\n    self.assertEqual(1, mock_get.call_count)\n\n  @mock.patch('time.sleep')\n  @mock.patch('requests.get', side_effect=ConnectionResetError)\n  def test_download_url_connection_error(self, mock_get, mock_sleep):\n    \"\"\"Tests that download_url doesn't retry when there is an HTTP error.\"\"\"\n    self.assertFalse(http_utils.download_url(self.URL, self.FILE_PATH))\n    self.assertEqual(4, mock_get.call_count)\n    self.assertEqual(3, mock_sleep.call_count)\n\n\nclass DownloadAndUnpackZipTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests download_and_unpack_zip.\"\"\"\n\n  def setUp(self):\n    self.setUpPyfakefs()\n\n  @mock.patch('requests.get', return_value=mock_get_response)\n  def test_bad_zip_download(self, _):\n    \"\"\"Tests download_and_unpack_zip returns none when a bad zip is passed.\"\"\"\n    self.fs.create_file('/url_tmp.zip', contents='Test file.')\n    self.assertFalse(\n        http_utils.download_and_unpack_zip('/not/a/real/url',\n                                           '/extract-directory'))\n"
  },
  {
    "path": "infra/cifuzz/logs.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Log helpers.\"\"\"\n\nimport logging\nimport os\n\n\ndef init():\n  \"\"\"Initialize logging.\"\"\"\n  log_level = logging.DEBUG if os.getenv('CIFUZZ_DEBUG') else logging.INFO\n  logging.basicConfig(\n      format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',\n      level=log_level)\n"
  },
  {
    "path": "infra/cifuzz/package.json",
    "content": "{\n  \"name\": \"cifuzz\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"author\": \"Google\",\n  \"license\": \"Apache2\",\n  \"dependencies\": {\n    \"@actions/artifact\": \"^2.2.0\"\n  }\n}\n"
  },
  {
    "path": "infra/cifuzz/platform_config/__init__.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for getting the configuration CIFuzz needs to run.\"\"\"\nimport logging\nimport os\n\nimport environment\n\n\nclass BasePlatformConfig:\n  \"\"\"Base class for PlatformConfig subclasses.\"\"\"\n\n  @property\n  def project_src_path(self):\n    \"\"\"Returns the manually checked out path of the project's source if\n    specified or None.\"\"\"\n    path = os.getenv('PROJECT_SRC_PATH')\n    if not path:\n      logging.debug('No PROJECT_SRC_PATH.')\n      return path\n\n    logging.debug('PROJECT_SRC_PATH: %s.', path)\n    return path\n\n  @property\n  def workspace(self):\n    \"\"\"Returns the workspace.\"\"\"\n    return os.getenv('WORKSPACE')\n\n  # Optional config variables.\n\n  @property\n  def git_sha(self):\n    \"\"\"Returns the Git SHA to checkout and fuzz. This is used only by GitHub\n    projects when commit fuzzing. It is not used when PR fuzzing. It is\n    definitely needed by OSS-Fuzz on GitHub since they have no copy of the repo\n    on the host and the repo on the builder image is a clone from main/master.\n    Right now it is needed by external on GitHub because we need to clone a new\n    repo because the copy they give us doesn't work for diffing.\n\n    TODO(metzman): Try to eliminate the need for this by 1. Making the clone\n    from external github projects usable. 2. Forcing OSS-Fuzz on Github to clone\n    before starting CIFuzz.\"\"\"\n    return None\n\n  @property\n  def base_commit(self):\n    \"\"\"Returns the base commit to diff against (commit fuzzing).\"\"\"\n    # TODO(metzman) Rename base_commit to git_base_commit.\n    return os.getenv('GIT_BASE_COMMIT')\n\n  @property\n  def base_ref(self):\n    \"\"\"Returns the base branch to diff against (pr fuzzing).\"\"\"\n    # TODO(metzman) Rename base_ref to git_base_ref.\n    return os.getenv('GIT_BASE_REF')\n\n  @property\n  def pr_ref(self):\n    \"\"\"Returns the pull request to checkout and fuzz. This is used only by\n    GitHub projects when PR fuzzing. It is not used when commit fuzzing. It is\n    definitely needed by OSS-Fuzz on GitHub since they have no copy of the repo\n    on the host and the repo on the builder image is a clone from main/master.\n    Right now it is needed by external on GitHub because we need to clone a new\n    repo because the copy they give us doesn't work for diffing.\n\n    TODO(metzman): Try to eliminate the need for this by 1. Making the clone\n    from external github projects usable. 2. Forcing OSS-Fuzz on Github to clone\n    before starting CIFuzz.\"\"\"\n    return None\n\n  @property\n  def project_repo_owner(self):\n    \"\"\"Returns the project repo owner (githubism).\"\"\"\n    return None\n\n  @property\n  def project_repo_name(self):\n    \"\"\"Returns the project repo name.\"\"\"\n    return os.environ.get('REPOSITORY')\n\n  @property\n  def actor(self):\n    \"\"\"Name of the actor for the CI.\"\"\"\n    return None\n\n  @property\n  def token(self):\n    \"\"\"Returns the CI API token.\"\"\"\n    return None\n\n  @property\n  def docker_in_docker(self):\n    \"\"\"Returns whether or not CFL is running using Docker in Docker.\"\"\"\n    return environment.get_bool('DOCKER_IN_DOCKER', False)\n\n  @property\n  def filestore(self):\n    \"\"\"Returns the filestore used to store persistent data.\"\"\"\n    return os.environ.get('FILESTORE')\n\n  @property\n  def git_url(self):\n    \"\"\"Returns the repo URL. This is only used by GitHub users. Right now it is\n    needed by external on GitHub because we need to clone a new repo because the\n    copy they give us doesn't work for diffing. It isn't used by OSS-Fuzz on\n    github users since the Git URL is determined using repo detection.\n\n    TODO(metzman): Try to eliminate the need for this by making the clone\n    from external github projects usable.\n    TODO(metzman): As an easier goal, maybe make OSS-Fuzz GitHub use this too\n    for: 1. Consistency 2. Maybe it will allow use on forks.\"\"\"\n    return None\n"
  },
  {
    "path": "infra/cifuzz/platform_config/gcb.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for getting the configuration CIFuzz needs to run on Github.\"\"\"\nimport logging\nimport os\n\nimport platform_config\n\n\nclass PlatformConfig(platform_config.BasePlatformConfig):\n  \"\"\"CI environment for Google Cloud Build.\"\"\"\n\n  @property\n  def project_src_path(self):\n    \"\"\"Returns the manually checked out path of the project's source if\n    specified or the default.\"\"\"\n    project_src_path = os.getenv('PROJECT_SRC_PATH', '/workspace')\n    logging.debug('PROJECT_SRC_PATH: %s.', project_src_path)\n    return project_src_path\n\n  @property\n  def workspace(self):\n    \"\"\"Returns the workspace.\"\"\"\n    return os.getenv('WORKSPACE', '/builder/home')\n\n  @property\n  def filestore(self):\n    \"\"\"Returns the filestore used to store persistent data.\"\"\"\n    return os.environ.get('FILESTORE', 'gsutil')\n"
  },
  {
    "path": "infra/cifuzz/platform_config/github.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for getting the configuration CIFuzz needs to run on Github.\"\"\"\nimport json\nimport logging\nimport os\n\nimport platform_config\n\n\ndef _get_github_event_path():\n  return os.getenv('GITHUB_EVENT_PATH')\n\n\ndef _get_event_data():\n  \"\"\"Returns the GitHub event data.\"\"\"\n  github_event_path = _get_github_event_path()\n  with open(github_event_path, encoding='utf-8') as file_handle:\n    return json.load(file_handle)\n\n\nclass PlatformConfig(platform_config.BasePlatformConfig):\n  \"\"\"CI environment for GitHub.\"\"\"\n\n  def __init__(self):\n    self._event_data = _get_event_data()\n    self._event = os.getenv('GITHUB_EVENT_NAME')\n\n  @property\n  def workspace(self):\n    \"\"\"Returns the workspace.\"\"\"\n    return os.getenv('GITHUB_WORKSPACE')\n\n  @property\n  def git_sha(self):\n    \"\"\"Returns the Git SHA to checkout and fuzz. This is used only by GitHub\n    projects when commit fuzzing. It is not used when PR fuzzing. It is\n    definitely needed by OSS-Fuzz on GitHub since they have no copy of the repo\n    on the host and the repo on the builder image is a clone from main/master.\n    Right now it is needed by external on GitHub because we need to clone a new\n    repo because the copy they give us doesn't work for diffing.\n\n    TODO(metzman): Try to eliminate the need for this by 1. Making the clone\n    from external github projects usable. 2. Forcing OSS-Fuzz on Github to clone\n    before starting CIFuzz.\"\"\"\n    return os.getenv('GITHUB_SHA')\n\n  @property\n  def actor(self):\n    \"\"\"Name of the actor for the CI.\"\"\"\n    return os.getenv('GITHUB_ACTOR')\n\n  @property\n  def token(self):\n    \"\"\"Returns the CI API token.\"\"\"\n    return os.getenv('GITHUB_TOKEN')\n\n  @property\n  def project_src_path(self):\n    \"\"\"Returns the manually checked out path of the project's source if\n    specified or None. The path returned is relative to |self.workspace| since\n    on github the checkout will be relative to there.\"\"\"\n    project_src_path = super().project_src_path\n    if project_src_path is None:\n      # Not set for internal GitHub users.\n      return project_src_path\n    # On GitHub (external users), this path is relative to |workspace|.\n    return os.path.join(self.workspace, project_src_path)\n\n  @property\n  def _project_repo_owner_and_name(self):\n    \"\"\"Returns a tuple containing the project repo owner and the name of the\n    repo.\"\"\"\n    # On GitHub this includes owner and repo name.\n    repository = os.getenv('GITHUB_REPOSITORY')\n    # Use os.path.split to split owner from repo.\n    return os.path.split(repository)\n\n  @property\n  def project_repo_owner(self):\n    \"\"\"Returns the project repo owner (githubism).\"\"\"\n    return self._project_repo_owner_and_name[0]\n\n  @property\n  def project_repo_name(self):\n    \"\"\"Returns the project repo name.\"\"\"\n    return self._project_repo_owner_and_name[1]\n\n  @property\n  def git_url(self):\n    \"\"\"Returns the repo URL. This is only used by GitHub users. Right now it is\n    needed by external on GitHub because we need to clone a new repo because the\n    copy they give us doesn't work for diffing. It isn't used by OSS-Fuzz on\n    github users since the Git URL is determined using repo detection.\n\n    TODO(metzman): Try to eliminate the need for this by making the clone\n    from external github projects usable.\n    TODO(metzman): As an easier goal, maybe make OSS-Fuzz GitHub use this too\n    for: 1. Consistency 2. Maybe it will allow use on forks.\"\"\"\n    repository = os.getenv('GITHUB_REPOSITORY')\n    github_server_url = os.getenv('GITHUB_SERVER_URL', 'https://github.com')\n    # TODO(metzman): Probably need to change this to github.server_url.\n    return os.path.join(github_server_url, repository)\n\n  @property\n  def base_commit(self):\n    \"\"\"Returns the base commit to diff against (commit fuzzing).\"\"\"\n    base_commit = None\n    if self._event == 'push':\n      base_commit = self._event_data['before']\n    logging.debug('base_commit: %s', base_commit)\n    return base_commit\n\n  @property\n  def pr_ref(self):\n    \"\"\"Returns the pull request to checkout and fuzz. This is used only by\n    GitHub projects when PR fuzzing. It is not used when commit fuzzing. It is\n    definitely needed by OSS-Fuzz on GitHub since they have no copy of the repo\n    on the host and the repo on the builder image is a clone from main/master.\n    Right now it is needed by external on GitHub because we need to clone a new\n    repo because the copy they give us doesn't work for diffing.\n\n    TODO(metzman): Try to eliminate the need for this by 1. Making the clone\n    from external github projects usable. 2. Forcing OSS-Fuzz on Github to clone\n    before starting CIFuzz.\"\"\"\n    if self._event == 'pull_request':\n      pr_ref = f'refs/pull/{self._event_data[\"pull_request\"][\"number\"]}/merge'\n      logging.debug('pr_ref: %s', pr_ref)\n      return pr_ref\n    return None\n\n  @property\n  def base_ref(self):\n    \"\"\"Returns the base branch to diff against (pr fuzzing).\"\"\"\n    return os.getenv('GITHUB_BASE_REF')\n"
  },
  {
    "path": "infra/cifuzz/platform_config/github_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for platform_config.github.\"\"\"\nimport os\nimport unittest\nfrom unittest import mock\n\nimport platform_config.github\nimport test_helpers\n\n# pylint: disable=arguments-differ\n\n\nclass GetProjectRepoOwnerAndNameTest(unittest.TestCase):\n  \"\"\"Tests for get_project_repo_owner and get_project_repo_name.\"\"\"\n\n  @mock.patch('platform_config.github._get_event_data', return_value={})\n  def setUp(self, _):\n    test_helpers.patch_environ(self)\n    self.repo_owner = 'repo-owner'\n    self.repo_name = 'repo-name'\n    os.environ['GITHUB_REPOSITORY'] = f'{self.repo_owner}/{self.repo_name}'\n    self.platform_conf = platform_config.github.PlatformConfig()\n\n  def test_github_repository_owner(self):\n    \"\"\"Tests that the correct result is returned when repository contains the\n    owner and repo name (as it does on GitHub).\"\"\"\n    self.assertEqual(self.platform_conf.project_repo_owner, self.repo_owner)\n\n  def test_github_repository_name(self):\n    \"\"\"Tests that the correct result is returned when repository contains the\n    owner and repo name (as it does on GitHub).\"\"\"\n    os.environ['GITHUB_REPOSITORY'] = f'{self.repo_owner}/{self.repo_name}'\n    self.assertEqual(self.platform_conf.project_repo_name, self.repo_name)\n\n\nclass ProjectSrcPathTest(unittest.TestCase):\n  \"\"\"Tests for project_src_path.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    self.workspace = '/workspace'\n    os.environ['GITHUB_WORKSPACE'] = self.workspace\n    self.project_src_dir_name = 'project-src'\n\n  @mock.patch('platform_config.github._get_event_data', return_value={})\n  def test_github_unset(self, _):\n    \"\"\"Tests that project_src_path returns None when no PROJECT_SRC_PATH is\n    set.\"\"\"\n    github_env = platform_config.github.PlatformConfig()\n    self.assertIsNone(github_env.project_src_path)\n\n  @mock.patch('platform_config.github._get_event_data', return_value={})\n  def test_github(self, _):\n    \"\"\"Tests that project_src_path returns the correct result on GitHub.\"\"\"\n    os.environ['PROJECT_SRC_PATH'] = self.project_src_dir_name\n    expected_project_src_path = os.path.join(self.workspace,\n                                             self.project_src_dir_name)\n    github_env = platform_config.github.PlatformConfig()\n    self.assertEqual(github_env.project_src_path, expected_project_src_path)\n\n\nclass GetGitUrlTest(unittest.TestCase):\n  \"\"\"Tests for GenericPlatformConfig.git_url.\"\"\"\n\n  @mock.patch('platform_config.github._get_event_data', return_value={})\n  def setUp(self, _):\n    test_helpers.patch_environ(self)\n    self.platform_conf = platform_config.github.PlatformConfig()\n\n  def test_repository(self):\n    \"\"\"Tests that the correct result is returned when repository contains the\n    owner and repo name (as it does on GitHub).\"\"\"\n    os.environ['GITHUB_REPOSITORY'] = 'repo/owner'\n    self.assertEqual('https://github.com/repo/owner',\n                     self.platform_conf.git_url)\n"
  },
  {
    "path": "infra/cifuzz/platform_config/gitlab.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for getting the configuration CIFuzz needs to run on GitLab.\"\"\"\nimport logging\nimport os\n\nimport environment\nimport platform_config\n\n\nclass PlatformConfig(platform_config.BasePlatformConfig):\n  \"\"\"CI environment for GitLab.\"\"\"\n\n  @property\n  def workspace(self):\n    \"\"\"Returns the workspace.\"\"\"\n    return os.path.join(os.getenv('CI_BUILDS_DIR'), os.getenv('CI_JOB_ID'))\n\n  @property\n  def git_sha(self):\n    \"\"\"Returns the Git SHA to checkout and fuzz.\"\"\"\n    return os.getenv('CI_COMMIT_SHA')\n\n  @property\n  def project_src_path(self):\n    \"\"\"Returns the directory with the source of the project\"\"\"\n    return os.getenv('CI_PROJECT_DIR')\n\n  @property\n  def token(self):\n    \"\"\"Returns the job token\"\"\"\n    return os.getenv('CI_JOB_TOKEN')\n\n  @property\n  def project_repo_name(self):\n    \"\"\"Returns the project's name\"\"\"\n    return os.getenv('CI_PROJECT_NAME')\n\n  @property\n  def base_commit(self):\n    \"\"\"Returns the previous commit sha for commit-fuzzing\"\"\"\n    base_commit = None\n    if os.getenv('CI_PIPELINE_SOURCE') == 'push':\n      base_commit = os.getenv('CI_COMMIT_BEFORE_SHA')\n    logging.debug('base_commit: %s.', base_commit)\n    return base_commit\n\n  @property\n  def base_ref(self):\n    \"\"\"Returns the base commit sha for a merge request\"\"\"\n    # Could also be CI_MERGE_REQUEST_TARGET_BRANCH_NAME.\n    return os.getenv('CI_MERGE_REQUEST_DIFF_BASE_SHA')\n\n  @property\n  def filestore(self):\n    \"\"\"Returns the filestore used to store persistent data.\"\"\"\n    return os.environ.get('FILESTORE', 'gitlab')\n\n  @property\n  def artifacts_dir(self):\n    \"\"\"Gitlab: returns the directory to put artifacts\"\"\"\n    return environment.get('CFL_ARTIFACTS_DIR', 'artifacts')\n\n  @property\n  def cache_dir(self):\n    \"\"\"Gitlab: returns the directory to use as cache\"\"\"\n    return environment.get('CFL_CACHE_DIR', 'cache')\n"
  },
  {
    "path": "infra/cifuzz/platform_config/platform_config_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for platform_config.\"\"\"\nimport os\nimport unittest\n\nimport platform_config\nimport test_helpers\n\n\nclass GetProjectRepoOwnerAndNameTest(unittest.TestCase):\n  \"\"\"Tests for get_project_repo_owner and get_project_repo_name.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    self.repo_owner = 'repo-owner'\n    self.repo_name = 'repo-name'\n    self.env = platform_config.BasePlatformConfig()\n\n  def test_unset_repository(self):\n    \"\"\"Tests that the correct result is returned when repository is not set.\"\"\"\n    self.assertIsNone(self.env.project_repo_name)\n\n  def test_owner(self):\n    \"\"\"Tests that the correct result is returned for owner.\"\"\"\n    self.assertIsNone(self.env.project_repo_owner)\n\n  def test_empty_repository(self):\n    \"\"\"Tests that the correct result is returned when repository is an empty\n    string.\"\"\"\n    os.environ['REPOSITORY'] = ''\n    self.assertEqual(self.env.project_repo_name, '')\n\n  def test_repository(self):\n    \"\"\"Tests that the correct result is returned when repository contains the\n    just the repo name (as it does outside of GitHub).\"\"\"\n    os.environ['REPOSITORY'] = self.repo_name\n    self.assertEqual(self.env.project_repo_name, self.repo_name)\n\n\nclass ProjectSrcPathTest(unittest.TestCase):\n  \"\"\"Tests for project_src_path.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n\n  def test_not_github(self):\n    \"\"\"Tests that project_src_path returns the correct result not on\n    GitHub.\"\"\"\n    project_src_path = 'project-src'\n    os.environ['PROJECT_SRC_PATH'] = project_src_path\n    generic_ci_env = platform_config.BasePlatformConfig()\n    self.assertEqual(generic_ci_env.project_src_path, project_src_path)\n\n\nclass GetGitUrlTest(unittest.TestCase):\n  \"\"\"Tests for BasePlatformConfig.git_url.\"\"\"\n\n  def setUp(self):\n    test_helpers.patch_environ(self)\n    self.env = platform_config.BasePlatformConfig()\n\n  def test_unset_repository(self):\n    \"\"\"Tests that the correct result is returned when repository is not set.\"\"\"\n    self.assertEqual(self.env.git_url, None)\n\n  def test_repository(self):\n    \"\"\"Tests that the correct result is returned when GITHUB_REPOSITORY is\n    set.\"\"\"\n    os.environ['GITHUB_REPOSITORY'] = 'repo/owner'\n    self.assertIsNone(self.env.git_url)\n"
  },
  {
    "path": "infra/cifuzz/platform_config/prow.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for getting the configuration CIFuzz needs to run on prow.\"\"\"\nimport logging\nimport os\n\nimport platform_config\n\n# pylint: disable=too-few-public-methods\n\n\nclass PlatformConfig(platform_config.BasePlatformConfig):\n  \"\"\"CI environment for Prow.\"\"\"\n\n  @property\n  def project_src_path(self):\n    \"\"\"Returns the manually checked out path of the project's source if\n    specified or the current directory if not. Prow will run ClusterfuzzLite\n    at the directory head for the repo.\"\"\"\n    project_src_path = os.getenv('PROJECT_SRC_PATH', os.getcwd())\n    logging.debug('PROJECT_SRC_PATH: %s.', project_src_path)\n    return project_src_path\n\n  @property\n  def workspace(self):\n    \"\"\"Returns the workspace.\"\"\"\n    # Let Prow user override workspace, but default to using artifacts dir\n    return os.getenv('WORKSPACE', os.getenv('ARTIFACTS'))\n\n  @property\n  def base_ref(self):\n    \"\"\"Returns the base branch to diff against (pr fuzzing).\"\"\"\n    return os.getenv('PULL_BASE_REF')\n\n  @property\n  def project_repo_name(self):\n    \"\"\"Returns the project repo name.\"\"\"\n    return os.getenv('REPO_NAME')\n\n  @property\n  def base_commit(self):\n    \"\"\"Returns the base commit to diff against (commit fuzzing).\"\"\"\n    return os.getenv('PULL_BASE_SHA')\n\n  @property\n  def docker_in_docker(self):\n    \"\"\"Returns True if using Docker in Docker.\"\"\"\n    return True\n\n  @property\n  def filestore(self):\n    \"\"\"Returns the filestore used to store persistent data.\"\"\"\n    return os.environ.get('FILESTORE', 'gsutil')\n"
  },
  {
    "path": "infra/cifuzz/platform_config/standalone.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for getting the configuration CIFuzz needs to run standalone.\"\"\"\nimport os\n\nimport platform_config\n\n# pylint: disable=too-few-public-methods\n\n\nclass PlatformConfig(platform_config.BasePlatformConfig):\n  \"\"\"CI environment for Standalone.\"\"\"\n\n  @property\n  def filestore(self):\n    \"\"\"Returns the filestore used to store persistent data.\"\"\"\n    return os.environ.get('FILESTORE', 'filesystem')\n\n  @property\n  def filestore_root_dir(self):\n    \"\"\"Returns the filestore used to store persistent data.\"\"\"\n    return os.environ['FILESTORE_ROOT_DIR']\n"
  },
  {
    "path": "infra/cifuzz/requirements.txt",
    "content": "clusterfuzz==2.5.9\nrequests==2.28.0\nprotobuf==3.20.2\ngsutil==5.20\n"
  },
  {
    "path": "infra/cifuzz/run_cifuzz.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Script for running CIFuzz end-to-end. This is meant to work outside any\ndocker image. This cannot depend on any CIFuzz code or third party packages.\"\"\"\nimport os\nimport subprocess\nimport sys\nimport tempfile\nimport logging\n\nINFRA_DIR = os.path.dirname(os.path.dirname(__file__))\nDEFAULT_ENVS = [('DRY_RUN', '0'), ('SANITIZER', 'address')]\nBASE_CIFUZZ_DOCKER_TAG = 'gcr.io/oss-fuzz-base'\n\n\ndef set_default_env_var_if_unset(env_var, default_value):\n  \"\"\"Sets the value of |env_var| in the environment to |default_value| if it was\n  not already set.\"\"\"\n  if env_var not in os.environ:\n    os.environ[env_var] = default_value\n\n\ndef docker_run(name, workspace, project_src_path):\n  \"\"\"Runs a CIFuzz docker container with |name|.\"\"\"\n  command = [\n      'docker', 'run', '--name', name, '--rm', '-e', 'PROJECT_SRC_PATH', '-e',\n      'OSS_FUZZ_PROJECT_NAME', '-e', 'WORKSPACE', '-e', 'REPOSITORY', '-e',\n      'DRY_RUN', '-e', 'CI', '-e', 'SANITIZER', '-e', 'GIT_SHA', '-e',\n      'FILESTORE', '-e', 'NO_CLUSTERFUZZ_DEPLOYMENT'\n  ]\n  if project_src_path:\n    command += ['-v', f'{project_src_path}:{project_src_path}']\n  command += [\n      '-v', '/var/run/docker.sock:/var/run/docker.sock', '-v',\n      f'{workspace}:{workspace}', f'{BASE_CIFUZZ_DOCKER_TAG}/{name}'\n  ]\n  print('Running docker command:', command)\n  subprocess.run(command, check=True)\n\n\ndef docker_build(image):\n  \"\"\"Builds the CIFuzz |image|. Only suitable for building CIFuzz images.\"\"\"\n  command = [\n      'docker', 'build', '-t', f'{BASE_CIFUZZ_DOCKER_TAG}/{image}', '--file',\n      f'{image}.Dockerfile', '.'\n  ]\n  subprocess.run(command, check=True, cwd=INFRA_DIR)\n\n\ndef main():\n  \"\"\"Builds and runs fuzzers using CIFuzz.\"\"\"\n  for env_var, default_value in DEFAULT_ENVS:\n    set_default_env_var_if_unset(env_var, default_value)\n\n  repository = os.getenv('REPOSITORY')\n  assert repository\n\n  project_src_path = os.getenv('PROJECT_SRC_PATH')\n\n  with tempfile.TemporaryDirectory() as temp_dir:\n    if 'WORKSPACE' not in os.environ:\n      os.environ['WORKSPACE'] = temp_dir\n\n    workspace = os.environ['WORKSPACE']\n\n    docker_build('build_fuzzers')\n    docker_run('build_fuzzers', workspace, project_src_path)\n    docker_build('run_fuzzers')\n    try:\n      docker_run('run_fuzzers', workspace, project_src_path)\n    except subprocess.CalledProcessError:\n      logging.error('run_fuzzers failed.')\n      return 1\n    return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/cifuzz/run_fuzzers.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for running fuzzers.\"\"\"\nimport enum\nimport logging\nimport os\nimport sys\nimport time\n\nimport clusterfuzz_deployment\nimport fuzz_target\nimport generate_coverage_report\nimport workspace_utils\nimport sarif_utils\n\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport utils\n\n\nclass RunFuzzersResult(enum.Enum):\n  \"\"\"Enum result from running fuzzers.\"\"\"\n  ERROR = 0\n  BUG_FOUND = 1\n  NO_BUG_FOUND = 2\n\n\nclass BaseFuzzTargetRunner:\n  \"\"\"Base class for fuzzer runners.\"\"\"\n\n  def __init__(self, config):\n    self.config = config\n    self.workspace = workspace_utils.Workspace(config)\n    self.clusterfuzz_deployment = (\n        clusterfuzz_deployment.get_clusterfuzz_deployment(\n            self.config, self.workspace))\n\n    # Set by the initialize method.\n    self.fuzz_target_paths = None\n\n  def get_fuzz_targets(self):\n    \"\"\"Returns fuzz targets in out directory.\"\"\"\n    return utils.get_fuzz_targets(self.workspace.out)\n\n  def initialize(self):\n    \"\"\"Initialization method. Must be called before calling run_fuzz_targets.\n    Returns True on success.\"\"\"\n    # Use a separate initialization function so we can return False on failure\n    # instead of exceptioning like we need to do if this were done in the\n    # __init__ method.\n\n    logging.info('Using %s sanitizer.', self.config.sanitizer)\n\n    # TODO(metzman) Add a check to ensure we aren't over time limit.\n    if not self.config.fuzz_seconds or self.config.fuzz_seconds < 1:\n      logging.error(\n          'Fuzz_seconds argument must be greater than 1, but was: %s.',\n          self.config.fuzz_seconds)\n      return False\n\n    if not os.path.exists(self.workspace.out):\n      logging.error('Out directory: %s does not exist.', self.workspace.out)\n      return False\n\n    if not os.path.exists(self.workspace.artifacts):\n      os.makedirs(self.workspace.artifacts)\n    elif (not os.path.isdir(self.workspace.artifacts) or\n          os.listdir(self.workspace.artifacts)):\n      logging.error('Artifacts path: %s exists and is not an empty directory.',\n                    self.workspace.artifacts)\n      return False\n\n    self.fuzz_target_paths = self.get_fuzz_targets()\n    logging.info('Fuzz targets: %s', self.fuzz_target_paths)\n    if not self.fuzz_target_paths:\n      logging.error('No fuzz targets were found in out directory: %s.',\n                    self.workspace.out)\n      return False\n\n    return True\n\n  def cleanup_after_fuzz_target_run(self, fuzz_target_obj):  # pylint: disable=no-self-use\n    \"\"\"Cleans up after running |fuzz_target_obj|.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def run_fuzz_target(self, fuzz_target_obj):  # pylint: disable=no-self-use\n    \"\"\"Fuzzes with |fuzz_target_obj| and returns the result.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  @property\n  def quit_on_bug_found(self):\n    \"\"\"Property that is checked to determine if fuzzing should quit after first\n    bug is found.\"\"\"\n    raise NotImplementedError('Child class must implement method.')\n\n  def create_fuzz_target_obj(self, target_path, run_seconds):\n    \"\"\"Returns a fuzz target object.\"\"\"\n    return fuzz_target.FuzzTarget(target_path, run_seconds, self.workspace,\n                                  self.clusterfuzz_deployment, self.config)\n\n  def run_fuzz_targets(self):\n    \"\"\"Runs fuzz targets. Returns True if a bug was found.\"\"\"\n    fuzzers_left_to_run = len(self.fuzz_target_paths)\n\n    # Make a copy since we will mutate it.\n    fuzz_seconds = self.config.fuzz_seconds\n\n    min_seconds_per_fuzzer = fuzz_seconds // fuzzers_left_to_run\n    bug_found = False\n    for target_path in self.fuzz_target_paths:\n      # By doing this, we can ensure that every fuzz target runs for at least\n      # min_seconds_per_fuzzer, but that other fuzzers will have longer to run\n      # if one ends early.\n      run_seconds = max(fuzz_seconds // fuzzers_left_to_run,\n                        min_seconds_per_fuzzer)\n\n      target = self.create_fuzz_target_obj(target_path, run_seconds)\n      start_time = time.time()\n      result = self.run_fuzz_target(target)\n      self.cleanup_after_fuzz_target_run(target)\n\n      # It's OK if this goes negative since we take max when determining\n      # run_seconds.\n      fuzz_seconds -= time.time() - start_time\n\n      fuzzers_left_to_run -= 1\n      if not result.testcase or not result.stacktrace:\n        logging.info('Fuzzer %s finished running without reportable crashes.',\n                     target.target_name)\n        continue\n\n      bug_found = True\n      if self.quit_on_bug_found:\n        logging.info('Bug found. Stopping fuzzing.')\n        break\n\n    # pylint: disable=undefined-loop-variable\n    if not target_path:\n      logging.error('Ran no fuzz targets.')\n    elif self.config.output_sarif:\n      # TODO(metzman): Handle multiple crashes.\n      write_fuzz_result_to_sarif(result, target_path, self.workspace)\n    self.clusterfuzz_deployment.upload_crashes()\n    return bug_found\n\n\ndef write_fuzz_result_to_sarif(fuzz_result, target_path, workspace):\n  \"\"\"Write results of fuzzing to SARIF.\"\"\"\n  logging.info('Writing sarif results.')\n  sarif_utils.write_stacktrace_to_sarif(fuzz_result.stacktrace, target_path,\n                                        workspace)\n\n\nclass PruneTargetRunner(BaseFuzzTargetRunner):\n  \"\"\"Runner that prunes corpora.\"\"\"\n\n  @property\n  def quit_on_bug_found(self):\n    return False\n\n  def run_fuzz_target(self, fuzz_target_obj):\n    \"\"\"Prunes with |fuzz_target_obj| and returns the result.\"\"\"\n    result = fuzz_target_obj.prune()\n    logging.debug('Corpus path contents: %s.', os.listdir(result.corpus_path))\n    self.clusterfuzz_deployment.upload_corpus(fuzz_target_obj.target_name,\n                                              result.corpus_path,\n                                              replace=True)\n    return result\n\n  def cleanup_after_fuzz_target_run(self, fuzz_target_obj):  # pylint: disable=no-self-use\n    \"\"\"Cleans up after pruning with |fuzz_target_obj|.\"\"\"\n    fuzz_target_obj.free_disk_if_needed()\n\n\nNON_FUZZ_TARGETS_FOR_COVERAGE = {\n    'llvm-symbolizer',\n    'jazzer_agent_deploy.jar',\n    'jazzer_driver',\n    'jazzer_driver_with_sanitizer',\n}\n\n\ndef is_coverage_fuzz_target(file_path):\n  \"\"\"Returns whether |file_path| is a fuzz target binary for the purposes of a\n  coverage report. Inspired by infra/base-images/base-runner/coverage.\"\"\"\n  if not os.path.isfile(file_path):\n    return False\n  if not utils.is_executable(file_path):\n    return False\n  filename = os.path.basename(file_path)\n  return filename not in NON_FUZZ_TARGETS_FOR_COVERAGE\n\n\ndef get_coverage_fuzz_targets(out):\n  \"\"\"Returns a list of fuzz targets in |out| for coverage.\"\"\"\n  # We only want fuzz targets from the root because during the coverage build,\n  # a lot of the image's filesystem is copied into /out for the purpose of\n  # generating coverage reports.\n  fuzz_targets = []\n  for filename in os.listdir(out):\n    file_path = os.path.join(out, filename)\n    if is_coverage_fuzz_target(file_path):\n      fuzz_targets.append(file_path)\n  return fuzz_targets\n\n\nclass CoverageTargetRunner(BaseFuzzTargetRunner):\n  \"\"\"Runner that runs the 'coverage' command.\"\"\"\n\n  @property\n  def quit_on_bug_found(self):\n    raise NotImplementedError('Not implemented for CoverageTargetRunner.')\n\n  def get_fuzz_targets(self):\n    \"\"\"Returns fuzz targets in out directory.\"\"\"\n    return get_coverage_fuzz_targets(self.workspace.out)\n\n  def run_fuzz_targets(self):\n    \"\"\"Generates a coverage report. Always returns False since it never finds\n    any bugs.\"\"\"\n    generate_coverage_report.generate_coverage_report(\n        self.fuzz_target_paths, self.workspace, self.clusterfuzz_deployment,\n        self.config)\n    return False\n\n  def run_fuzz_target(self, fuzz_target_obj):  # pylint: disable=no-self-use\n    \"\"\"Fuzzes with |fuzz_target_obj| and returns the result.\"\"\"\n    raise NotImplementedError('Not implemented for CoverageTargetRunner.')\n\n  def cleanup_after_fuzz_target_run(self, fuzz_target_obj):  # pylint: disable=no-self-use\n    \"\"\"Cleans up after running |fuzz_target_obj|.\"\"\"\n    raise NotImplementedError('Not implemented for CoverageTargetRunner.')\n\n\nclass CiFuzzTargetRunner(BaseFuzzTargetRunner):\n  \"\"\"Runner for fuzz targets used in CI (patch-fuzzing) context.\"\"\"\n\n  @property\n  def quit_on_bug_found(self):\n    return True\n\n  def cleanup_after_fuzz_target_run(self, fuzz_target_obj):  # pylint: disable=no-self-use\n    \"\"\"Cleans up after running |fuzz_target_obj|.\"\"\"\n    fuzz_target_obj.free_disk_if_needed()\n\n  def run_fuzz_target(self, fuzz_target_obj):  # pylint: disable=no-self-use\n    return fuzz_target_obj.fuzz()\n\n\nclass BatchFuzzTargetRunner(BaseFuzzTargetRunner):\n  \"\"\"Runner for fuzz targets used in batch fuzzing context.\"\"\"\n\n  @property\n  def quit_on_bug_found(self):\n    return False\n\n  def run_fuzz_target(self, fuzz_target_obj):\n    \"\"\"Fuzzes with |fuzz_target_obj| and returns the result.\"\"\"\n    result = fuzz_target_obj.fuzz(batch=True)\n    logging.debug('Corpus path contents: %s.', os.listdir(result.corpus_path))\n    self.clusterfuzz_deployment.upload_corpus(fuzz_target_obj.target_name,\n                                              result.corpus_path)\n    return result\n\n  def cleanup_after_fuzz_target_run(self, fuzz_target_obj):\n    \"\"\"Cleans up after running |fuzz_target_obj|.\"\"\"\n    # This must be done after we upload the corpus, otherwise it will be deleted\n    # before we get a chance to upload it. We can't delete the fuzz target\n    # because it is needed when we upload the build.\n    fuzz_target_obj.free_disk_if_needed(delete_fuzz_target=False)\n\n\n_MODE_RUNNER_MAPPING = {\n    'batch': BatchFuzzTargetRunner,\n    'coverage': CoverageTargetRunner,\n    'prune': PruneTargetRunner,\n    'code-change': CiFuzzTargetRunner,\n}\n\n\ndef get_fuzz_target_runner(config):\n  \"\"\"Returns a fuzz target runner object based on the mode of\n  |config|.\"\"\"\n  runner = _MODE_RUNNER_MAPPING[config.mode](config)\n  logging.info('run fuzzers MODE is: %s. Runner: %s.', config.mode, runner)\n  return runner\n\n\ndef run_fuzzers(config):  # pylint: disable=too-many-locals\n  \"\"\"Runs fuzzers for a specific OSS-Fuzz project.\n\n  Args:\n    config: A RunFuzzTargetsConfig.\n\n  Returns:\n    A RunFuzzersResult enum value indicating what happened during fuzzing.\n  \"\"\"\n  fuzz_target_runner = get_fuzz_target_runner(config)\n  if not fuzz_target_runner.initialize():\n    # We didn't fuzz at all because of internal (CIFuzz) errors. And we didn't\n    # find any bugs.\n    return RunFuzzersResult.ERROR\n\n  if not fuzz_target_runner.run_fuzz_targets():\n    # We fuzzed successfully, but didn't find any bugs (in the fuzz target).\n    return RunFuzzersResult.NO_BUG_FOUND\n\n  # We fuzzed successfully and found bug(s) in the fuzz targets.\n  return RunFuzzersResult.BUG_FOUND\n"
  },
  {
    "path": "infra/cifuzz/run_fuzzers_entrypoint.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Runs a specific OSS-Fuzz project's fuzzers for CI tools.\"\"\"\nimport logging\nimport sys\n\nimport config_utils\nimport docker\nimport logs\nimport run_fuzzers\n\n# pylint: disable=c-extension-no-member\n# pylint gets confused because of the relative import of cifuzz.\n\nlogs.init()\n\n\ndef delete_unneeded_docker_images(config):\n  \"\"\"Deletes unneeded docker images if running in an environment with low\n  disk space.\"\"\"\n  if not config.low_disk_space:\n    return\n  logging.info('Deleting builder docker images to save disk space.')\n  project_image = docker.get_project_image_name(config.oss_fuzz_project_name)\n  images = [\n      project_image,\n      docker.BASE_BUILDER_TAG,\n      docker.BASE_BUILDER_TAG + '-go',\n      docker.BASE_BUILDER_TAG + '-javascript',\n      docker.BASE_BUILDER_TAG + '-jvm',\n      docker.BASE_BUILDER_TAG + '-python',\n      docker.BASE_BUILDER_TAG + '-rust',\n      docker.BASE_BUILDER_TAG + '-ruby',\n      docker.BASE_BUILDER_TAG + '-swift',\n  ]\n  docker.delete_images(images)\n\n\ndef run_fuzzers_entrypoint():\n  \"\"\"This is the entrypoint for the run_fuzzers github action.\n  This action can be added to any OSS-Fuzz project's workflow that uses\n  Github.\"\"\"\n  config = config_utils.RunFuzzersConfig()\n\n  if config.base_os_version == 'ubuntu-24-04':\n    result = config_utils.pivot_to_ubuntu_24_04(\n        'run-fuzzers',\n        '/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py',\n        check_result=not config.dry_run)\n    if result is not None:\n      return result\n\n  # The default return code when an error occurs.\n  returncode = 1\n  if config.dry_run:\n    # Sets the default return code on error to success.\n    returncode = 0\n\n  delete_unneeded_docker_images(config)\n  # Run the specified project's fuzzers from the build.\n  result = run_fuzzers.run_fuzzers(config)\n  if result == run_fuzzers.RunFuzzersResult.ERROR:\n    logging.error('Error occurred while running in workspace %s.',\n                  config.workspace)\n    return returncode\n  if result == run_fuzzers.RunFuzzersResult.BUG_FOUND:\n    logging.info('Bug found.')\n    if not config.dry_run:\n      # Return 2 when a bug was found by a fuzzer causing the CI to fail.\n      return 2\n  return 0\n\n\ndef main():\n  \"\"\"Runs project's fuzzers for CI tools.\n  This is the entrypoint for the run_fuzzers github action.\n\n  NOTE: libFuzzer binaries must be located in the $WORKSPACE/build-out\n  directory in order for this action to be used. This action will only fuzz the\n  binaries that are located in that directory. It is recommended that you add\n  the build_fuzzers action preceding this one.\n\n  NOTE: Any crash report will be in the filepath:\n  ${GITHUB_WORKSPACE}/out/testcase\n  This can be used in parallel with the upload-artifact action to surface the\n  logs.\n\n  Returns:\n    0 on success or nonzero on failure.\n  \"\"\"\n  return run_fuzzers_entrypoint()\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/cifuzz/run_fuzzers_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for running fuzzers.\"\"\"\nimport json\nimport os\nimport shutil\nimport stat\nimport sys\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport parameterized\nfrom pyfakefs import fake_filesystem_unittest\n\nimport build_fuzzers\nimport fuzz_target\nimport run_fuzzers\n\n# pylint: disable=wrong-import-position\nINFRA_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nsys.path.append(INFRA_DIR)\n\nimport helper\nimport test_helpers\n\n# NOTE: This integration test relies on\n# https://github.com/google/oss-fuzz/tree/master/projects/example project.\nEXAMPLE_PROJECT = 'example'\n\n# Location of files used for testing.\nTEST_DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n                              'test_data')\n\nMEMORY_FUZZER_DIR = os.path.join(TEST_DATA_PATH, 'memory')\nMEMORY_FUZZER = 'curl_fuzzer_memory'\n\nUNDEFINED_FUZZER_DIR = os.path.join(TEST_DATA_PATH, 'undefined')\nUNDEFINED_FUZZER = 'curl_fuzzer_undefined'\n\nFUZZ_SECONDS = 10\n\n\nclass RunFuzzerIntegrationTestMixin:  # pylint: disable=too-few-public-methods,invalid-name\n  \"\"\"Mixin for integration test classes that runbuild_fuzzers on builds of a\n  specific sanitizer.\"\"\"\n  # These must be defined by children.\n  FUZZER_DIR = None\n  FUZZER = None\n\n  def setUp(self):\n    \"\"\"Patch the environ so that we can execute runner scripts.\"\"\"\n    test_helpers.patch_environ(self, runner=True)\n\n  def _test_run_with_sanitizer(self, fuzzer_dir, sanitizer):\n    \"\"\"Calls run_fuzzers on fuzzer_dir and |sanitizer| and asserts\n    the run succeeded and that no bug was found.\"\"\"\n    with test_helpers.temp_dir_copy(fuzzer_dir) as fuzzer_dir_copy:\n      config = test_helpers.create_run_config(fuzz_seconds=FUZZ_SECONDS,\n                                              workspace=fuzzer_dir_copy,\n                                              oss_fuzz_project_name='curl',\n                                              sanitizer=sanitizer)\n      result = run_fuzzers.run_fuzzers(config)\n    self.assertEqual(result, run_fuzzers.RunFuzzersResult.NO_BUG_FOUND)\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass RunMemoryFuzzerIntegrationTest(RunFuzzerIntegrationTestMixin,\n                                     unittest.TestCase):\n  \"\"\"Integration test for build_fuzzers with an MSAN build.\"\"\"\n  FUZZER_DIR = MEMORY_FUZZER_DIR\n  FUZZER = MEMORY_FUZZER\n\n  def test_run_with_memory_sanitizer(self):\n    \"\"\"Tests run_fuzzers with a valid MSAN build.\"\"\"\n    self._test_run_with_sanitizer(self.FUZZER_DIR, 'memory')\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass RunUndefinedFuzzerIntegrationTest(RunFuzzerIntegrationTestMixin,\n                                        unittest.TestCase):\n  \"\"\"Integration test for build_fuzzers with an UBSAN build.\"\"\"\n  FUZZER_DIR = UNDEFINED_FUZZER_DIR\n  FUZZER = UNDEFINED_FUZZER\n\n  def test_run_with_undefined_sanitizer(self):\n    \"\"\"Tests run_fuzzers with a valid UBSAN build.\"\"\"\n    self._test_run_with_sanitizer(self.FUZZER_DIR, 'undefined')\n\n\nclass BaseFuzzTargetRunnerTest(unittest.TestCase):\n  \"\"\"Tests BaseFuzzTargetRunner.\"\"\"\n\n  def _create_runner(self, **kwargs):  # pylint: disable=no-self-use\n    defaults = {\n        'fuzz_seconds': FUZZ_SECONDS,\n        'oss_fuzz_project_name': EXAMPLE_PROJECT\n    }\n    for default_key, default_value in defaults.items():\n      if default_key not in kwargs:\n        kwargs[default_key] = default_value\n\n    config = test_helpers.create_run_config(**kwargs)\n    return run_fuzzers.BaseFuzzTargetRunner(config)\n\n  def _test_initialize_fail(self, expected_error_args, **create_runner_kwargs):\n    with mock.patch('logging.error') as mock_error:\n      runner = self._create_runner(**create_runner_kwargs)\n      self.assertFalse(runner.initialize())\n      mock_error.assert_called_with(*expected_error_args)\n\n  @parameterized.parameterized.expand([(0,), (None,), (-1,)])\n  def test_initialize_invalid_fuzz_seconds(self, fuzz_seconds):\n    \"\"\"Tests initialize fails with an invalid fuzz seconds.\"\"\"\n    expected_error_args = ('Fuzz_seconds argument must be greater than 1, '\n                           'but was: %s.', fuzz_seconds)\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      os.mkdir(out_path)\n      with mock.patch('utils.get_fuzz_targets') as mock_get_fuzz_targets:\n        mock_get_fuzz_targets.return_value = [\n            os.path.join(out_path, 'fuzz_target')\n        ]\n        self._test_initialize_fail(expected_error_args,\n                                   fuzz_seconds=fuzz_seconds,\n                                   workspace=tmp_dir)\n\n  def test_initialize_no_out_dir(self):\n    \"\"\"Tests initialize fails with no out dir.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      expected_error_args = ('Out directory: %s does not exist.', out_path)\n      self._test_initialize_fail(expected_error_args, workspace=tmp_dir)\n\n  def test_initialize_nonempty_artifacts(self):\n    \"\"\"Tests initialize with a file artifacts path.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      os.mkdir(out_path)\n      os.makedirs(os.path.join(tmp_dir, 'out'))\n      artifacts_path = os.path.join(tmp_dir, 'out', 'artifacts')\n      with open(artifacts_path, 'w') as artifacts_handle:\n        artifacts_handle.write('fake')\n      expected_error_args = (\n          'Artifacts path: %s exists and is not an empty directory.',\n          artifacts_path)\n      self._test_initialize_fail(expected_error_args, workspace=tmp_dir)\n\n  def test_initialize_bad_artifacts(self):\n    \"\"\"Tests initialize with a non-empty artifacts path.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      os.mkdir(out_path)\n      artifacts_path = os.path.join(tmp_dir, 'out', 'artifacts')\n      os.makedirs(artifacts_path)\n      artifact_path = os.path.join(artifacts_path, 'artifact')\n      with open(artifact_path, 'w') as artifact_handle:\n        artifact_handle.write('fake')\n      expected_error_args = (\n          'Artifacts path: %s exists and is not an empty directory.',\n          artifacts_path)\n      self._test_initialize_fail(expected_error_args, workspace=tmp_dir)\n\n  @mock.patch('utils.get_fuzz_targets')\n  @mock.patch('logging.error')\n  def test_initialize_empty_artifacts(self, mock_log_error,\n                                      mock_get_fuzz_targets):\n    \"\"\"Tests initialize with an empty artifacts dir.\"\"\"\n    mock_get_fuzz_targets.return_value = ['fuzz-target']\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      os.mkdir(out_path)\n      artifacts_path = os.path.join(tmp_dir, 'out', 'artifacts')\n      os.makedirs(artifacts_path)\n      runner = self._create_runner(workspace=tmp_dir)\n      self.assertTrue(runner.initialize())\n      mock_log_error.assert_not_called()\n      self.assertTrue(os.path.isdir(artifacts_path))\n\n  @mock.patch('utils.get_fuzz_targets')\n  @mock.patch('logging.error')\n  def test_initialize_no_artifacts(self, mock_log_error, mock_get_fuzz_targets):\n    \"\"\"Tests initialize with no artifacts dir (the expected setting).\"\"\"\n    mock_get_fuzz_targets.return_value = ['fuzz-target']\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      os.mkdir(out_path)\n      runner = self._create_runner(workspace=tmp_dir)\n      self.assertTrue(runner.initialize())\n      mock_log_error.assert_not_called()\n      self.assertTrue(os.path.isdir(os.path.join(tmp_dir, 'out', 'artifacts')))\n\n  def test_initialize_no_fuzz_targets(self):\n    \"\"\"Tests initialize with no fuzz targets.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      os.makedirs(out_path)\n      expected_error_args = ('No fuzz targets were found in out directory: %s.',\n                             out_path)\n      self._test_initialize_fail(expected_error_args, workspace=tmp_dir)\n\n\nclass CiFuzzTargetRunnerTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests that CiFuzzTargetRunner works as intended.\"\"\"\n\n  def setUp(self):\n    self.setUpPyfakefs()\n\n  @mock.patch('clusterfuzz_deployment.OSSFuzz.upload_crashes')\n  @mock.patch('utils.get_fuzz_targets')\n  @mock.patch('run_fuzzers.CiFuzzTargetRunner.run_fuzz_target')\n  @mock.patch('run_fuzzers.CiFuzzTargetRunner.create_fuzz_target_obj')\n  def test_run_fuzz_targets_quits(self, mock_create_fuzz_target_obj,\n                                  mock_run_fuzz_target, mock_get_fuzz_targets,\n                                  mock_upload_crashes):\n    \"\"\"Tests that run_fuzz_targets quits on the first crash it finds.\"\"\"\n    workspace = 'workspace'\n    out_path = os.path.join(workspace, 'build-out')\n    self.fs.create_dir(out_path)\n    config = test_helpers.create_run_config(\n        fuzz_seconds=FUZZ_SECONDS,\n        workspace=workspace,\n        oss_fuzz_project_name=EXAMPLE_PROJECT)\n    runner = run_fuzzers.CiFuzzTargetRunner(config)\n\n    mock_get_fuzz_targets.return_value = ['target1', 'target2']\n    runner.initialize()\n    testcase = os.path.join(workspace, 'testcase')\n    self.fs.create_file(testcase)\n    stacktrace = 'stacktrace'\n    corpus_dir = 'corpus'\n    self.fs.create_dir(corpus_dir)\n    mock_run_fuzz_target.return_value = fuzz_target.FuzzResult(\n        testcase, stacktrace, corpus_dir)\n    magic_mock = mock.MagicMock()\n    magic_mock.target_name = 'target1'\n    mock_create_fuzz_target_obj.return_value = magic_mock\n    self.assertTrue(runner.run_fuzz_targets())\n    self.assertEqual(mock_run_fuzz_target.call_count, 1)\n    self.assertEqual(mock_upload_crashes.call_count, 1)\n\n\nclass BatchFuzzTargetRunnerTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests that BatchFuzzTargetRunnerTest works as intended.\"\"\"\n  WORKSPACE = 'workspace'\n  STACKTRACE = 'stacktrace'\n  CORPUS_DIR = 'corpus'\n\n  def setUp(self):\n    self.setUpPyfakefs()\n    out_dir = os.path.join(self.WORKSPACE, 'build-out')\n    self.fs.create_dir(out_dir)\n    self.testcase1 = os.path.join(out_dir, 'testcase-aaa')\n    self.fs.create_file(self.testcase1)\n    self.testcase2 = os.path.join(out_dir, 'testcase-bbb')\n    self.fs.create_file(self.testcase2)\n    self.config = test_helpers.create_run_config(fuzz_seconds=FUZZ_SECONDS,\n                                                 workspace=self.WORKSPACE,\n                                                 cfl_platform='github')\n\n  @mock.patch('utils.get_fuzz_targets', return_value=['target1', 'target2'])\n  @mock.patch('clusterfuzz_deployment.ClusterFuzzLite.upload_crashes')\n  @mock.patch('run_fuzzers.BatchFuzzTargetRunner.run_fuzz_target')\n  @mock.patch('run_fuzzers.BatchFuzzTargetRunner.create_fuzz_target_obj')\n  def test_run_fuzz_targets_quits(self, mock_create_fuzz_target_obj,\n                                  mock_run_fuzz_target, mock_upload_crashes, _):\n    \"\"\"Tests that run_fuzz_targets doesn't quit on the first crash it finds.\"\"\"\n    runner = run_fuzzers.BatchFuzzTargetRunner(self.config)\n    runner.initialize()\n\n    call_count = 0\n\n    def mock_run_fuzz_target_impl(_):\n      nonlocal call_count\n      if call_count == 0:\n        testcase = self.testcase1\n      elif call_count == 1:\n        testcase = self.testcase2\n      assert call_count != 2\n      call_count += 1\n      if not os.path.exists(self.CORPUS_DIR):\n        self.fs.create_dir(self.CORPUS_DIR)\n      return fuzz_target.FuzzResult(testcase, self.STACKTRACE, self.CORPUS_DIR)\n\n    mock_run_fuzz_target.side_effect = mock_run_fuzz_target_impl\n    magic_mock = mock.MagicMock()\n    magic_mock.target_name = 'target1'\n    mock_create_fuzz_target_obj.return_value = magic_mock\n    self.assertTrue(runner.run_fuzz_targets())\n    self.assertEqual(mock_run_fuzz_target.call_count, 2)\n    self.assertEqual(mock_upload_crashes.call_count, 1)\n\n\nclass GetCoverageTargetsTest(unittest.TestCase):\n  \"\"\"Tests for get_coverage_fuzz_targets.\"\"\"\n\n  def test_get_fuzz_targets(self):\n    \"\"\"Tests that get_coverage_fuzz_targets returns expected targets.\"\"\"\n    with tempfile.TemporaryDirectory() as temp_dir:\n      # Setup.\n      fuzz_target_path = os.path.join(temp_dir, 'fuzz-target')\n      with open(fuzz_target_path, 'w') as file_handle:\n        file_handle.write('')\n      fuzz_target_st = os.stat(fuzz_target_path)\n      os.chmod(fuzz_target_path, fuzz_target_st.st_mode | stat.S_IEXEC)\n      non_fuzz_target1 = os.path.join(temp_dir, 'non-fuzz-target1')\n      with open(non_fuzz_target1, 'w') as file_handle:\n        file_handle.write('LLVMFuzzerTestOneInput')\n      subdir = os.path.join(temp_dir, 'subdir')\n      os.mkdir(subdir)\n      non_fuzz_target2 = os.path.join(subdir, 'non-fuzz-target1')\n      with open(non_fuzz_target2, 'w') as file_handle:\n        file_handle.write('LLVMFuzzerTestOneInput')\n\n      self.assertEqual(run_fuzzers.get_coverage_fuzz_targets(temp_dir),\n                       [fuzz_target_path])\n\n\n@unittest.skip('TODO(metzman): Fix this test')\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass CoverageReportIntegrationTest(unittest.TestCase):\n  \"\"\"Integration tests for coverage reports.\"\"\"\n  SANITIZER = 'coverage'\n\n  def setUp(self):\n    test_helpers.patch_environ(self, runner=True)\n\n  @mock.patch('filestore.github_actions._upload_artifact_with_upload_js')\n  def test_coverage_report(self, _):\n    \"\"\"Tests generation of coverage reports end-to-end, from building to\n    generation.\"\"\"\n\n    with test_helpers.docker_temp_dir() as temp_dir:\n      shared = os.path.join(temp_dir, 'shared')\n      os.mkdir(shared)\n      copy_command = ('cp -r /opt/code_coverage /shared && '\n                      'cp $(which llvm-profdata) /shared && '\n                      'cp $(which llvm-cov) /shared')\n      assert helper.docker_run([\n          '-v', f'{shared}:/shared', 'gcr.io/oss-fuzz-base/base-runner', 'bash',\n          '-c', copy_command\n      ])\n\n      os.environ['CODE_COVERAGE_SRC'] = os.path.join(shared, 'code_coverage')\n      os.environ['PATH'] += os.pathsep + shared\n      # Do coverage build.\n      build_config = test_helpers.create_build_config(\n          oss_fuzz_project_name=EXAMPLE_PROJECT,\n          project_repo_name='oss-fuzz',\n          workspace=temp_dir,\n          git_sha='0b95fe1039ed7c38fea1f97078316bfc1030c523',\n          base_commit='da0746452433dc18bae699e355a9821285d863c8',\n          sanitizer=self.SANITIZER,\n          cfl_platform='github',\n          # Needed for test not to fail because of permissions issues.\n          bad_build_check=False)\n      self.assertTrue(build_fuzzers.build_fuzzers(build_config))\n\n      # TODO(metzman): Get rid of this here and make 'compile' do this.\n      chmod_command = ('chmod -R +r /out && '\n                       'find /out -type d -exec chmod +x {} +')\n\n      assert helper.docker_run([\n          '-v', f'{os.path.join(temp_dir, \"build-out\")}:/out',\n          'gcr.io/oss-fuzz-base/base-builder', 'bash', '-c', chmod_command\n      ])\n\n      # Generate report.\n      run_config = test_helpers.create_run_config(fuzz_seconds=FUZZ_SECONDS,\n                                                  workspace=temp_dir,\n                                                  sanitizer=self.SANITIZER,\n                                                  mode='coverage',\n                                                  cfl_platform='github')\n      result = run_fuzzers.run_fuzzers(run_config)\n      self.assertEqual(result, run_fuzzers.RunFuzzersResult.NO_BUG_FOUND)\n      expected_summary_path = os.path.join(\n          TEST_DATA_PATH, 'example_coverage_report_summary.json')\n      with open(expected_summary_path) as file_handle:\n        expected_summary = json.loads(file_handle.read())\n        actual_summary_path = os.path.join(temp_dir, 'cifuzz-coverage',\n                                           'report', 'linux', 'summary.json')\n      with open(actual_summary_path) as file_handle:\n        actual_summary = json.loads(file_handle.read())\n      self.assertEqual(expected_summary, actual_summary)\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass RunAddressFuzzersIntegrationTest(RunFuzzerIntegrationTestMixin,\n                                       unittest.TestCase):\n  \"\"\"Integration tests for build_fuzzers with an ASAN build.\"\"\"\n\n  BUILD_DIR_NAME = 'cifuzz-latest-build'\n\n  def test_new_bug_found(self):\n    \"\"\"Tests run_fuzzers with a valid ASAN build.\"\"\"\n    # Set the first return value to True, then the second to False to\n    # emulate a bug existing in the current PR but not on the downloaded\n    # OSS-Fuzz build.\n    with mock.patch('fuzz_target.FuzzTarget.is_reproducible',\n                    side_effect=[True, False]):\n      with tempfile.TemporaryDirectory() as tmp_dir:\n        workspace = os.path.join(tmp_dir, 'workspace')\n        shutil.copytree(TEST_DATA_PATH, workspace)\n        config = test_helpers.create_run_config(\n            fuzz_seconds=FUZZ_SECONDS,\n            workspace=workspace,\n            oss_fuzz_project_name=EXAMPLE_PROJECT)\n        result = run_fuzzers.run_fuzzers(config)\n        self.assertEqual(result, run_fuzzers.RunFuzzersResult.BUG_FOUND)\n\n  @mock.patch('fuzz_target.FuzzTarget.is_reproducible',\n              side_effect=[True, True])\n  def test_old_bug_found(self, _):\n    \"\"\"Tests run_fuzzers with a bug found in OSS-Fuzz before.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      workspace = os.path.join(tmp_dir, 'workspace')\n      shutil.copytree(TEST_DATA_PATH, workspace)\n      config = test_helpers.create_run_config(\n          fuzz_seconds=FUZZ_SECONDS,\n          workspace=workspace,\n          oss_fuzz_project_name=EXAMPLE_PROJECT)\n      result = run_fuzzers.run_fuzzers(config)\n      self.assertEqual(result, run_fuzzers.RunFuzzersResult.NO_BUG_FOUND)\n\n  def test_invalid_build(self):\n    \"\"\"Tests run_fuzzers with an invalid ASAN build.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out_path = os.path.join(tmp_dir, 'build-out')\n      os.mkdir(out_path)\n      config = test_helpers.create_run_config(\n          fuzz_seconds=FUZZ_SECONDS,\n          workspace=tmp_dir,\n          oss_fuzz_project_name=EXAMPLE_PROJECT)\n      result = run_fuzzers.run_fuzzers(config)\n    self.assertEqual(result, run_fuzzers.RunFuzzersResult.ERROR)\n\n\nclass GetFuzzTargetRunnerTest(unittest.TestCase):\n  \"\"\"Tests for get_fuzz_fuzz_target_runner.\"\"\"\n\n  @parameterized.parameterized.expand([\n      ('batch', run_fuzzers.BatchFuzzTargetRunner),\n      ('code-change', run_fuzzers.CiFuzzTargetRunner),\n      ('coverage', run_fuzzers.CoverageTargetRunner)\n  ])\n  def test_get_fuzz_target_runner(self, mode, fuzz_target_runner_cls):\n    \"\"\"Tests that get_fuzz_target_runner returns the correct runner based on the\n    specified mode.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      run_config = test_helpers.create_run_config(\n          fuzz_seconds=FUZZ_SECONDS,\n          workspace=tmp_dir,\n          oss_fuzz_project_name='example',\n          mode=mode)\n      runner = run_fuzzers.get_fuzz_target_runner(run_config)\n      self.assertTrue(isinstance(runner, fuzz_target_runner_cls))\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/cifuzz/sarif_utils.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for outputting SARIF data.\"\"\"\nimport copy\nimport json\nimport logging\nimport os\n\nfrom clusterfuzz import stacktraces\n\nSARIF_RULES = [\n    {\n        'id': 'no-crashes',\n        'shortDescription': {\n            'text': 'Don\\'t crash'\n        },\n        'helpUri': 'https://cwe.mitre.org/data/definitions/416.html',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id': 'heap-use-after-free',\n        'shortDescription': {\n            'text': 'Use of a heap-object after it has been freed.'\n        },\n        'helpUri': 'https://cwe.mitre.org/data/definitions/416.html',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id': 'heap-buffer-overflow',\n        'shortDescription': {\n            'text': 'A read or write past the end of a heap buffer.'\n        },\n        'helpUri': 'https://cwe.mitre.org/data/definitions/122.html',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id': 'stack-buffer-overflow',\n        'shortDescription': {\n            'text': 'A read or write past the end of a stack buffer.'\n        },\n        'helpUri': 'https://cwe.mitre.org/data/definitions/121.html',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id': 'global-buffer-overflow',\n        'shortDescription': {\n            'text': 'A read or write past the end of a global buffer.'\n        },\n        'helpUri': 'https://cwe.mitre.org/data/definitions/121.html',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id': 'stack-use-after-return',\n        'shortDescription': {\n            'text':\n                'A stack-based variable has been used after the function returned.'\n        },\n        'helpUri': 'https://cwe.mitre.org/data/definitions/562.html',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id': 'stack-use-after-scope',\n        'shortDescription': {\n            'text':\n                'A stack-based variable has been used outside of the scope in which it exists.'\n        },\n        'helpUri': 'https://cwe.mitre.org/data/definitions/562.html',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id': 'initialization-order-fiasco',\n        'shortDescription': {\n            'text': 'Problem with order of initialization of global objects.'\n        },\n        'helpUri': 'https://isocpp.org/wiki/faq/ctors#static-init-order',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id':\n            'direct-leak',\n        'shortDescription': {\n            'text': 'Memory is leaked.'\n        },\n        'helpUri':\n            'https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n    {\n        'id':\n            'indirect-leak',\n        'shortDescription': {\n            'text': 'Memory is leaked.'\n        },\n        'helpUri':\n            'https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer',\n        'properties': {\n            'category': 'Crashes'\n        }\n    },\n]\nSARIF_DATA = {\n    'version':\n        '2.1.0',\n    '$schema':\n        'http://json.schemastore.org/sarif-2.1.0-rtm.4',\n    'runs': [{\n        'tool': {\n            'driver': {\n                'name': 'ClusterFuzzLite/CIFuzz',\n                'informationUri': 'https://google.github.io/clusterfuzzlite/',\n                'rules': SARIF_RULES,\n            }\n        },\n        'results': []\n    }]\n}\n\nSRC_ROOT = '/src/'\n\n\ndef redact_src_path(src_path):\n  \"\"\"Redact the src path so that it can be reported to users.\"\"\"\n  src_path = os.path.normpath(src_path)\n  if src_path.startswith(SRC_ROOT):\n    src_path = src_path[len(SRC_ROOT):]\n\n  src_path = os.sep.join(src_path.split(os.sep)[1:])\n  return src_path\n\n\ndef get_error_frame(crash_info):\n  \"\"\"Returns the stackframe where the error occurred.\"\"\"\n  if not crash_info.crash_state:\n    return None\n  state = crash_info.crash_state.split('\\n')[0]\n  logging.info('state: %s frames %s, %s', state, crash_info.frames,\n               [f.function_name for f in crash_info.frames[0]])\n\n  for crash_frames in crash_info.frames:\n    for frame in crash_frames:\n      # TODO(metzman): Do something less fragile here.\n      if frame.function_name is None:\n        continue\n      if state in frame.function_name:\n        return frame\n  return None\n\n\ndef get_error_source_info(crash_info):\n  \"\"\"Returns the filename and the line where the bug occurred.\"\"\"\n  frame = get_error_frame(crash_info)\n  if not frame:\n    return (None, 1)\n  try:\n    return redact_src_path(frame.filename), int(frame.fileline or 1)\n  except TypeError:\n    return (None, 1)\n\n\ndef get_rule_index(crash_type):\n  \"\"\"Returns the rule index describe the rule that |crash_type| ran afoul of.\"\"\"\n  # Don't include \"READ\" or \"WRITE\" or number of bytes.\n  crash_type = crash_type.replace('\\n', ' ').split(' ')[0].lower()\n  logging.info('crash_type: %s.', crash_type)\n  for idx, rule in enumerate(SARIF_RULES):\n    if rule['id'] == crash_type:\n      logging.info('Rule index: %d.', idx)\n      return idx\n\n  return get_rule_index('no-crashes')\n\n\ndef get_sarif_data(stacktrace, target_path):\n  \"\"\"Returns a description of the crash in SARIF.\"\"\"\n  data = copy.deepcopy(SARIF_DATA)\n  if stacktrace is None:\n    return data\n\n  fuzz_target = os.path.basename(target_path)\n  stack_parser = stacktraces.StackParser(fuzz_target=fuzz_target,\n                                         symbolized=True,\n                                         detect_ooms_and_hangs=True,\n                                         include_ubsan=True)\n  crash_info = stack_parser.parse(stacktrace)\n  error_source_info = get_error_source_info(crash_info)\n  rule_idx = get_rule_index(crash_info.crash_type)\n  rule_id = SARIF_RULES[rule_idx]['id']\n  uri = error_source_info[0]\n\n  result = {\n      'level': 'error',\n      'message': {\n          'text': crash_info.crash_type\n      },\n      'locations': [{\n          'physicalLocation': {\n              'artifactLocation': {\n                  'uri': uri,\n                  'index': 0\n              },\n              'region': {\n                  'startLine': error_source_info[1],\n                  # We don't have this granualarity fuzzing.\n                  'startColumn': 1,\n              }\n          }\n      }],\n      'ruleId': rule_id,\n      'ruleIndex': rule_idx\n  }\n  if uri:\n    data['runs'][0]['results'].append(result)\n  return data\n\n\ndef write_stacktrace_to_sarif(stacktrace, target_path, workspace):\n  \"\"\"Writes a description of the crash in stacktrace to a SARIF file.\"\"\"\n  data = get_sarif_data(stacktrace, target_path)\n  if not os.path.exists(workspace.sarif):\n    os.makedirs(workspace.sarif)\n  with open(os.path.join(workspace.sarif, 'results.sarif'), 'w') as file_handle:\n    file_handle.write(json.dumps(data))\n"
  },
  {
    "path": "infra/cifuzz/sarif_utils_test.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for sarif_utils.py\"\"\"\nimport os\nimport unittest\nfrom unittest import mock\n\nimport sarif_utils\n\nCRASH_INFO_FILELINE = 403\n\nTEST_DATA = os.path.join(os.path.dirname(__file__), 'test_data')\n\n\nclass GetSarifDataTest(unittest.TestCase):\n  \"\"\"Tests for get_sarif_data.\"\"\"\n\n  def setUp(self):\n    self.maxDiff = None  # pylint: disable=invalid-name\n\n  def test_get_sarif_data_none(self):\n    \"\"\"Tests get_sarif_data when there was no crash.\"\"\"\n    self.assertEqual(sarif_utils.get_sarif_data(None, '/root/target'),\n                     sarif_utils.SARIF_DATA)\n\n  def test_ordinary_case(self):\n    stacktrace_filename = os.path.join(TEST_DATA,\n                                       'sarif_utils_systemd_stack.txt')\n    with open(stacktrace_filename, 'r') as fp:\n      stacktrace = fp.read()\n    expected_result = {\n        'level': 'error',\n        'message': {\n            'text': 'Heap-buffer-overflow\\nREAD 4'\n        },\n        'locations': [{\n            'physicalLocation': {\n                'artifactLocation': {\n                    'uri': 'src/core/fuzz-unit-file.c',\n                    'index': 0\n                },\n                'region': {\n                    'startLine': 30,\n                    # We don't have this granualarity fuzzing.\n                    'startColumn': 1,\n                }\n            }\n        }],\n        'ruleId': 'heap-buffer-overflow',\n        'ruleIndex': 2\n    }\n    actual_result = sarif_utils.get_sarif_data(\n        stacktrace, '/root/target')['runs'][0]['results'][0]\n    self.assertEqual(actual_result, expected_result)\n\n  def test_llvmfuzzertestoneinput_case(self):\n    stacktrace_filename = os.path.join(TEST_DATA,\n                                       'sarif_utils_only_llvmfuzzer_stack.txt')\n    with open(stacktrace_filename, 'r') as fp:\n      stacktrace = fp.read()\n    actual_result = sarif_utils.get_sarif_data(\n        stacktrace, '/root/target')['runs'][0]['results']\n    self.assertEqual(actual_result, [])\n\n  def test_msan(self):\n    \"\"\"Tests that MSAN stacktraces don't exception.\"\"\"\n    stacktrace_filename = os.path.join(TEST_DATA, 'sarif_utils_msan_stack.txt')\n    with open(stacktrace_filename, 'r') as fp:\n      stacktrace = fp.read()\n\n    actual_result = sarif_utils.get_sarif_data(stacktrace, '/root/target')\n\n\nclass RedactSrcPathTest(unittest.TestCase):\n  \"\"\"Tests for redact_src_path.\"\"\"\n\n  def test_redact_src_path(self):\n    \"\"\"Tests redact_src_path.\"\"\"\n    path = '/src/src-repo/subdir/file'\n    self.assertEqual(sarif_utils.redact_src_path(path), 'subdir/file')\n\n\ndef _get_mock_crash_info():\n  \"\"\"Returns a mock crash_info to be used in tests.\"\"\"\n  stack_frame = mock.MagicMock()\n  stack_frame.filename = '/src/repo-dir/sub/vuln.cc'\n  stack_frame.function_name = 'vuln_func'\n  stack_frame.fileline = CRASH_INFO_FILELINE\n  crash1_frames = [stack_frame, stack_frame]\n  frames = [crash1_frames]\n  crash_info = mock.MagicMock()\n  crash_info.frames = frames\n  crash_info.crash_state = 'vuln_func\\nvuln_func0\\nvuln_func1'\n  return crash_info\n\n\nclass GetErrorSourceInfoTest(unittest.TestCase):\n  \"\"\"Tests for get_error_source_info.\"\"\"\n\n  def test_redact_src_path(self):\n    \"\"\"Tests that get_error_source_info finds the right source info.\"\"\"\n    crash_info = _get_mock_crash_info()\n    source_info = sarif_utils.get_error_source_info(crash_info)\n    expected_source_info = ('sub/vuln.cc', CRASH_INFO_FILELINE)\n    self.assertEqual(source_info, expected_source_info)\n\n\nclass GetRuleIndexTest(unittest.TestCase):\n  \"\"\"Tests for get_rule_index.\"\"\"\n  CRASH_INFO_CRASH_TYPE = 'Heap-use-after-free READ 8'\n\n  def test_get_rule_index(self):\n    \"\"\"Tests that get_rule_index finds the right rule index.\"\"\"\n    index = sarif_utils.get_rule_index(self.CRASH_INFO_CRASH_TYPE)\n    self.assertEqual(sarif_utils.SARIF_RULES[index]['id'],\n                     'heap-use-after-free')\n    self.assertEqual(sarif_utils.get_rule_index('no-crashes'), 0)\n"
  },
  {
    "path": "infra/cifuzz/test_data/TimeoutFuzzer.cpp",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Example of a standalone runner for \"fuzz targets\".\n// It reads all files passed as parameters and feeds their contents\n// one by one into the fuzz target (LLVMFuzzerTestOneInput).\n// This runner does not do any fuzzing, but allows us to run the fuzz target\n// on the test corpus (e.g. \"do_stuff_test_data\") or on a single file,\n// e.g. the one that comes from a bug report.\n\n// This is a fuzz target that times out on every input by infinite looping.\n// This is used for testing.\n// Build instructions:\n// 1. clang++ -fsanitize=fuzzer TimeoutFuzzer.cpp -o timeout_fuzzer\n// 2. strip timeout_fuzzer\n// The binary is stripped to save space in the git repo.\n\n#include <stddef.h>\n#include <stdint.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(uint8_t* data, size_t size) {\n  while (true)\n    ;\n  return 0;\n}\n"
  },
  {
    "path": "infra/cifuzz/test_data/example_coverage_report_summary.json",
    "content": "{\"data\": [{\"files\": [{\"filename\": \"/src/my-git-repo/projects/example/my-api-repo/do_stuff_fuzzer.cpp\", \"summary\": {\"branches\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}, \"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/my-git-repo/projects/example/my-api-repo/my_api.cpp\", \"summary\": {\"branches\": {\"count\": 10, \"covered\": 0, \"notcovered\": 10, \"percent\": 0}, \"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 15, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 11, \"covered\": 0, \"notcovered\": 11, \"percent\": 0}}}], \"totals\": {\"branches\": {\"count\": 10, \"covered\": 0, \"notcovered\": 10, \"percent\": 0}, \"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 12, \"covered\": 0, \"notcovered\": 12, \"percent\": 0}}}], \"type\": \"llvm.coverage.json.export\", \"version\": \"2.0.1\"}"
  },
  {
    "path": "infra/cifuzz/test_data/example_crash_fuzzer_bug_summary.txt",
    "content": "AddressSanitizer: heap-buffer-overflow on address 0x62500001b530 at pc 0x00000052138a bp 0x7ffe62db2c10 sp 0x7ffe62db23d8\nREAD of size 52 at 0x62500001b530 thread T0\nSCARINESS: 26 (multi-byte-read-heap-buffer-overflow)\n    #0 0x521389 in __asan_memcpy /src/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3\n    #1 0x567590 in yr_object_set_string /src/yara/libyara/object.c:1122:5\n    #2 0x5afced in dex_parse /src/yara/libyara/modules/dex/dex.c:781:5\n    #3 0x5b4a8b in dex__load /src/yara/libyara/modules/dex/dex.c:1218:7\n    #4 0x56537c in yr_modules_load /src/yara/libyara/modules.c:179:16\n    #5 0x5d6583 in yr_execute_code /src/yara/libyara/exec.c:1276:18\n    #6 0x56f5c0 in yr_scanner_scan_mem_blocks /src/yara/libyara/scanner.c:444:3\n    #7 0x56bf23 in yr_rules_scan_mem_blocks /src/yara/libyara/rules.c:235:12\n    #8 0x56c182 in yr_rules_scan_mem /src/yara/libyara/rules.c:285:10\n    #9 0x5548d2 in LLVMFuzzerTestOneInput /src/yara/tests/oss-fuzz/dex_fuzzer.cc:40:3\n    #10 0x45a3b1 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:556:15\n    #11 0x459ad5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:470:3\n    #12 0x45be77 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:698:19\n    #13 0x45cc05 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:830:5\n    #14 0x44ac88 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:824:6\n    #15 0x474ab2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:19:10\n    #16 0x7f4409b7a82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)\n    #17 0x41e348 in _start (out/dex_fuzzer+0x41e348)\n\n0x62500001b530 is located 0 bytes to the right of 9264-byte region [0x625000019100,0x62500001b530)\nallocated by thread T0 here:\n    #0 0x521f4d in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3\n    #1 0x4331b7 in operator new(unsigned long) (out/dex_fuzzer+0x4331b7)\n    #2 0x459ad5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:470:3\n    #3 0x45be77 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:698:19\n    #4 0x45cc05 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:830:5\n    #5 0x44ac88 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:824:6\n    #6 0x474ab2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:19:10\n    #7 0x7f4409b7a82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)\n\nSUMMARY: AddressSanitizer: heap-buffer-overflow /src/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy\nShadow bytes around the buggy address:\n  0x0c4a7fffb650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  0x0c4a7fffb660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  0x0c4a7fffb670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  0x0c4a7fffb680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  0x0c4a7fffb690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n=>0x0c4a7fffb6a0: 00 00 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa\n  0x0c4a7fffb6b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c4a7fffb6c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c4a7fffb6d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c4a7fffb6e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c4a7fffb6f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07\n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n  Shadow gap:              cc\n==12==ABORTING"
  },
  {
    "path": "infra/cifuzz/test_data/example_crash_fuzzer_output.txt",
    "content": "/github/workspace/build-out/do_stuff_fuzzer -timeout=25 -rss_limit_mb=2560 -dict=/github/workspace/build-out/do_stuff_fuzzer.dict -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmp9p1w4p8r/ -max_total_time=600 -print_final_stats=1 /github/workspace/cifuzz-corpus/do_stuff_fuzzer >fuzz-0.log 2>&1\n================== Job 0 exited with exit code 77 ============\nDictionary: 3 entries\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 1 modules   (86 inline 8-bit counters): 86 [0x6150e0, 0x615136), \nINFO: Loaded 1 PC tables (86 PCs): 86 [0x5c8b08,0x5c9068), \nINFO:        5 files found in /github/workspace/cifuzz-corpus/do_stuff_fuzzer\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes\nINFO: seed corpus: files: 5 min: 3b max: 44b total: 64b rss: 31Mb\n#6\tINITED cov: 64 ft: 70 corp: 5/64b exec/s: 0 rss: 32Mb\n#9\tNEW    cov: 64 ft: 72 corp: 6/74b lim: 4096 exec/s: 0 rss: 32Mb L: 10/44 MS: 3 ChangeBit-InsertByte-ManualDict- DE: \"foo\"-\n#17\tNEW    cov: 64 ft: 74 corp: 7/86b lim: 4096 exec/s: 0 rss: 32Mb L: 12/44 MS: 3 ChangeBit-ManualDict-PersAutoDict- DE: \"ouch\"-\"foo\"-\n#18\tNEW    cov: 64 ft: 76 corp: 8/100b lim: 4096 exec/s: 0 rss: 32Mb L: 14/44 MS: 1 CrossOver-\n#22\tNEW    cov: 64 ft: 78 corp: 9/141b lim: 4096 exec/s: 0 rss: 32Mb L: 41/44 MS: 4 InsertRepeatedBytes-CopyPart-ChangeBinInt-ChangeBit-\n#24\tNEW    cov: 64 ft: 80 corp: 10/151b lim: 4096 exec/s: 0 rss: 32Mb L: 10/44 MS: 2 CrossOver-CopyPart-\n#28\tNEW    cov: 64 ft: 81 corp: 11/171b lim: 4096 exec/s: 0 rss: 32Mb L: 20/44 MS: 4 InsertByte-PersAutoDict-ShuffleBytes-ManualDict- DE: \"foo\"-\"ouch\"-\n#43\tNEW    cov: 65 ft: 83 corp: 12/175b lim: 4096 exec/s: 0 rss: 32Mb L: 4/44 MS: 5 InsertByte-ChangeBit-ManualDict-ManualDict-EraseBytes- DE: \"bar\"-\"bar\"-\n#54\tNEW    cov: 65 ft: 84 corp: 13/191b lim: 4096 exec/s: 0 rss: 32Mb L: 16/44 MS: 1 CrossOver-\n#64\tNEW    cov: 65 ft: 86 corp: 14/209b lim: 4096 exec/s: 0 rss: 32Mb L: 18/44 MS: 5 InsertByte-ChangeBinInt-CMP-PersAutoDict-CopyPart- DE: \"\\000\\000\"-\"foo\"-\n#75\tREDUCE cov: 65 ft: 86 corp: 14/203b lim: 4096 exec/s: 0 rss: 32Mb L: 35/44 MS: 1 EraseBytes-\n#76\tREDUCE cov: 65 ft: 86 corp: 14/195b lim: 4096 exec/s: 0 rss: 32Mb L: 36/36 MS: 1 EraseBytes-\n=================================================================\n==26==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000003114 at pc 0x00000056d1db bp 0x7fffd6a72bf0 sp 0x7fffd6a72be8\nREAD of size 4 at 0x603000003114 thread T0\nSCARINESS: 17 (4-byte-read-heap-buffer-overflow)\n    #0 0x56d1da in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:26:10\n    #1 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3\n    #2 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19\n    #5 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5\n    #6 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7fcfaa2aa082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n    #9 0x41f74d in _start (build-out/do_stuff_fuzzer+0x41f74d)\n\nDEDUP_TOKEN: DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\n0x603000003114 is located 0 bytes to the right of 20-byte region [0x603000003100,0x603000003114)\nallocated by thread T0 here:\n    #0 0x569dfd in operator new(unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3\n    #1 0x56c9d4 in __libcpp_operator_new<unsigned long> /usr/local/bin/../include/c++/v1/new:245:10\n    #2 0x56c9d4 in __libcpp_allocate /usr/local/bin/../include/c++/v1/new:271:10\n    #3 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator.h:105:38\n    #4 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator_traits.h:262:20\n    #5 0x56c9d4 in __vallocate /usr/local/bin/../include/c++/v1/vector:931:37\n    #6 0x56c9d4 in vector /usr/local/bin/../include/c++/v1/vector:1236:9\n    #7 0x56c9d4 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:14:20\n    #8 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3\n    #9 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #10 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #11 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19\n    #12 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5\n    #13 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #14 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #15 0x7fcfaa2aa082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: operator new(unsigned long)--__libcpp_operator_new<unsigned long>--__libcpp_allocate\nSUMMARY: AddressSanitizer: heap-buffer-overflow /src/cifuzz-example/my_api.cpp:26:10 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)\nShadow bytes around the buggy address:\n  0x0c067fff85d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff85e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff85f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8600: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd\n  0x0c067fff8610: fd fa fa fa fd fd fd fa fa fa 00 00 00 00 fa fa\n=>0x0c067fff8620: 00 00[04]fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8630: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8640: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8650: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8660: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8670: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07 \n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==26==ABORTING\nMS: 4 PersAutoDict-ManualDict-CrossOver-PersAutoDict- DE: \"foo\"-\"ouch\"-\"bar\"-; base unit: 1a25c32303e03f997166aee1c665b5ae9f66ec7d\n0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x66,0x6f,0x6f,0xff,0x1,0x62,0x61,0x72,0x63,0x68,0x6f,0x75,0x63,0x68,0x66,0x6f,0x66,0x6e,0x6f,0x6d,0x67,0x6d,\n\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377foo\\377\\001barchouchfofnomgm\nartifact_prefix='/tmp/tmp9p1w4p8r/'; Test unit written to /tmp/tmp9p1w4p8r/crash-1c750df432fe458b738987ba69cd20a598708775\nBase64: //////////////////////9mb2//AWJhcmNob3VjaGZvZm5vbWdt\nstat::number_of_executed_units: 90\nstat::average_exec_per_sec:     0\nstat::new_units_added:          11\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              33\n/github/workspace/build-out/do_stuff_fuzzer -timeout=25 -rss_limit_mb=2560 -dict=/github/workspace/build-out/do_stuff_fuzzer.dict -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmp9p1w4p8r/ -max_total_time=600 -print_final_stats=1 /github/workspace/cifuzz-corpus/do_stuff_fuzzer >fuzz-1.log 2>&1\n================== Job 1 exited with exit code 77 ============\nDictionary: 3 entries\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 1 modules   (86 inline 8-bit counters): 86 [0x6150e0, 0x615136), \nINFO: Loaded 1 PC tables (86 PCs): 86 [0x5c8b08,0x5c9068), \nINFO:       15 files found in /github/workspace/cifuzz-corpus/do_stuff_fuzzer\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes\nINFO: seed corpus: files: 15 min: 3b max: 44b total: 239b rss: 31Mb\n#16\tINITED cov: 65 ft: 86 corp: 13/159b exec/s: 0 rss: 32Mb\n#38\tNEW    cov: 65 ft: 88 corp: 14/188b lim: 4096 exec/s: 0 rss: 32Mb L: 29/35 MS: 2 InsertByte-CopyPart-\n#43\tREDUCE cov: 65 ft: 88 corp: 14/187b lim: 4096 exec/s: 0 rss: 32Mb L: 2/35 MS: 5 InsertByte-ChangeByte-ChangeBinInt-EraseBytes-EraseBytes-\n#64\tNEW    cov: 66 ft: 89 corp: 15/191b lim: 4096 exec/s: 0 rss: 32Mb L: 4/35 MS: 1 ChangeByte-\n#78\tREDUCE cov: 66 ft: 89 corp: 15/190b lim: 4096 exec/s: 0 rss: 32Mb L: 15/35 MS: 4 ChangeBinInt-CopyPart-EraseBytes-EraseBytes-\n#95\tREDUCE cov: 66 ft: 89 corp: 15/188b lim: 4096 exec/s: 0 rss: 32Mb L: 16/35 MS: 2 ChangeBinInt-EraseBytes-\n#110\tREDUCE cov: 66 ft: 89 corp: 15/184b lim: 4096 exec/s: 0 rss: 32Mb L: 31/31 MS: 5 CrossOver-ChangeByte-ShuffleBytes-InsertByte-EraseBytes-\n#146\tREDUCE cov: 66 ft: 89 corp: 15/183b lim: 4096 exec/s: 0 rss: 32Mb L: 1/31 MS: 1 EraseBytes-\n#157\tNEW    cov: 66 ft: 90 corp: 16/210b lim: 4096 exec/s: 0 rss: 32Mb L: 27/31 MS: 1 CrossOver-\n#230\tREDUCE cov: 66 ft: 92 corp: 17/318b lim: 4096 exec/s: 0 rss: 32Mb L: 108/108 MS: 3 CopyPart-InsertRepeatedBytes-CrossOver-\n#277\tNEW    cov: 66 ft: 94 corp: 18/429b lim: 4096 exec/s: 0 rss: 32Mb L: 111/111 MS: 2 ManualDict-CMP- DE: \"bar\"-\"\\000\\000\\000\\000\"-\n#337\tNEW    cov: 67 ft: 95 corp: 19/439b lim: 4096 exec/s: 0 rss: 32Mb L: 10/111 MS: 5 ChangeByte-ChangeBit-ManualDict-CopyPart-EraseBytes- DE: \"bar\"-\n=================================================================\n==30==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000007d94 at pc 0x00000056d1db bp 0x7ffdb9da4b50 sp 0x7ffdb9da4b48\nREAD of size 4 at 0x603000007d94 thread T0\nSCARINESS: 17 (4-byte-read-heap-buffer-overflow)\n    #0 0x56d1da in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:26:10\n    #1 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3\n    #2 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19\n    #5 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5\n    #6 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7fc2c6bd3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n    #9 0x41f74d in _start (build-out/do_stuff_fuzzer+0x41f74d)\n\nDEDUP_TOKEN: DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\n0x603000007d94 is located 0 bytes to the right of 20-byte region [0x603000007d80,0x603000007d94)\nallocated by thread T0 here:\n    #0 0x569dfd in operator new(unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3\n    #1 0x56c9d4 in __libcpp_operator_new<unsigned long> /usr/local/bin/../include/c++/v1/new:245:10\n    #2 0x56c9d4 in __libcpp_allocate /usr/local/bin/../include/c++/v1/new:271:10\n    #3 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator.h:105:38\n    #4 0x56c9d4 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator_traits.h:262:20\n    #5 0x56c9d4 in __vallocate /usr/local/bin/../include/c++/v1/vector:931:37\n    #6 0x56c9d4 in vector /usr/local/bin/../include/c++/v1/vector:1236:9\n    #7 0x56c9d4 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /src/cifuzz-example/my_api.cpp:14:20\n    #8 0x56c5d6 in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:15:3\n    #9 0x43de23 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #10 0x43d60a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #11 0x43ecd9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19\n    #12 0x43f9a5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5\n    #13 0x42ed0f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #14 0x458362 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #15 0x7fc2c6bd3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: operator new(unsigned long)--__libcpp_operator_new<unsigned long>--__libcpp_allocate\nSUMMARY: AddressSanitizer: heap-buffer-overflow /src/cifuzz-example/my_api.cpp:26:10 in DoStuff(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)\nShadow bytes around the buggy address:\n  0x0c067fff8f60: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd\n  0x0c067fff8f70: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa\n  0x0c067fff8f80: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa\n  0x0c067fff8f90: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd\n  0x0c067fff8fa0: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa\n=>0x0c067fff8fb0: 00 00[04]fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8fc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8fd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8fe0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff8ff0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c067fff9000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07 \n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==30==ABORTING\nMS: 4 ShuffleBytes-ManualDict-CrossOver-PersAutoDict- DE: \"foo\"-\"bar\"-; base unit: 8fc7da8d952ed1aa5c7415e21b3d52b42402973d\n0x66,0x6f,0x6f,0x63,0x6f,0x75,0x6f,0x75,0x63,0x68,0x63,0x68,0x66,0x62,0x61,0x72,0x6f,0x6f,0x6d,0x67,0x66,0x6f,0x6f,0x2f,0x99,0x6f,0x6f,0x90,0x6f,0x6f,0x6d,0x0,0x0,0x67,0x2f,\nfoocououchchfbaroomgfoo/\\231oo\\220oom\\000\\000g/\nartifact_prefix='/tmp/tmp9p1w4p8r/'; Test unit written to /tmp/tmp9p1w4p8r/crash-f8a2a1e84f58a2d676e5ad8078119a39b78df901\nBase64: Zm9vY291b3VjaGNoZmJhcm9vbWdmb28vmW9vkG9vbQAAZy8=\nstat::number_of_executed_units: 366\nstat::average_exec_per_sec:     0\nstat::new_units_added:          11\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              33\n"
  },
  {
    "path": "infra/cifuzz/test_data/example_curl_cov.json",
    "content": "{\"report_summary_path\": \"gs://oss-fuzz-coverage/curl/reports/20200226/linux/summary.json\", \"html_report_url\": \"https://storage.googleapis.com/oss-fuzz-coverage/curl/reports/20200226/linux/index.html\", \"report_date\": \"20200226\", \"fuzzer_stats_dir\": \"gs://oss-fuzz-coverage/curl/fuzzer_stats/20200226\"}"
  },
  {
    "path": "infra/cifuzz/test_data/example_curl_file_list.json",
    "content": "[\"lib/asyn-thread.c\", \"lib/base64.c\", \"lib/conncache.c\", \"lib/connect.c\", \"lib/content_encoding.c\", \"lib/cookie.c\", \"lib/curl_addrinfo.c\", \"lib/curl_ctype.c\", \"lib/curl_endian.c\", \"lib/curl_fnmatch.c\", \"lib/curl_gethostname.c\", \"lib/curl_memrchr.c\", \"lib/curl_ntlm_core.c\", \"lib/curl_ntlm_wb.c\", \"lib/curl_range.c\", \"lib/curl_sasl.c\", \"lib/curl_threads.c\", \"lib/dict.c\", \"lib/dotdot.c\", \"lib/easy.c\", \"lib/escape.c\", \"lib/file.c\", \"lib/fileinfo.c\", \"lib/ftp.c\", \"lib/ftplistparser.c\", \"lib/getenv.c\", \"lib/getinfo.c\", \"lib/gopher.c\", \"lib/hash.c\", \"lib/hmac.c\", \"lib/hostasyn.c\", \"lib/hostip.c\", \"lib/hostip6.c\", \"lib/http.c\", \"lib/http2.c\", \"lib/http_chunks.c\", \"lib/http_digest.c\", \"lib/http_ntlm.c\", \"lib/http_proxy.c\", \"lib/if2ip.c\", \"lib/imap.c\", \"lib/llist.c\", \"lib/md4.c\", \"lib/md5.c\", \"lib/memdebug.c\", \"lib/mime.c\", \"lib/mprintf.c\", \"lib/multi.c\", \"lib/nonblock.c\", \"lib/parsedate.c\", \"lib/pingpong.c\", \"lib/pop3.c\", \"lib/progress.c\", \"lib/rand.c\", \"lib/rename.c\", \"lib/rtsp.c\", \"lib/select.c\", \"lib/sendf.c\", \"lib/setopt.c\", \"lib/share.c\", \"lib/sigpipe.h\", \"lib/slist.c\", \"lib/smb.c\", \"lib/smtp.c\", \"lib/speedcheck.c\", \"lib/splay.c\", \"lib/strcase.c\", \"lib/strdup.c\", \"lib/strerror.c\", \"lib/strtoofft.c\", \"lib/tftp.c\", \"lib/timeval.c\", \"lib/transfer.c\", \"lib/url.c\", \"lib/urlapi.c\", \"lib/vauth/cleartext.c\", \"lib/vauth/cram.c\", \"lib/vauth/digest.c\", \"lib/vauth/ntlm.c\", \"lib/version.c\", \"lib/vtls/openssl.c\", \"lib/vtls/vtls.c\", \"lib/warnless.c\", \"lib/wildcard.c\"]"
  },
  {
    "path": "infra/cifuzz/test_data/example_curl_fuzzer_cov.json",
    "content": "{\"data\": [{\"files\": [{\"filename\": \"/src/curl/include/curl/curl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/include/curl/curlver.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/include/curl/multi.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/include/curl/system.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/include/curl/urlapi.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/amigaos.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/arpa_telnet.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/asyn-thread.c\", \"summary\": {\"functions\": {\"count\": 24, \"covered\": 17, \"percent\": 70.83333333333334}, \"instantiations\": {\"count\": 24, \"covered\": 17, \"percent\": 70.83333333333334}, \"lines\": {\"count\": 454, \"covered\": 316, \"percent\": 69.60352422907489}, \"regions\": {\"count\": 206, \"covered\": 133, \"notcovered\": 73, \"percent\": 64.56310679611651}}}, {\"filename\": \"/src/curl/lib/asyn.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/base64.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"instantiations\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"lines\": {\"count\": 205, \"covered\": 199, \"percent\": 97.07317073170731}, \"regions\": {\"count\": 81, \"covered\": 76, \"notcovered\": 5, \"percent\": 93.82716049382715}}}, {\"filename\": \"/src/curl/lib/conncache.c\", \"summary\": {\"functions\": {\"count\": 22, \"covered\": 20, \"percent\": 90.9090909090909}, \"instantiations\": {\"count\": 22, \"covered\": 20, \"percent\": 90.9090909090909}, \"lines\": {\"count\": 405, \"covered\": 267, \"percent\": 65.92592592592592}, \"regions\": {\"count\": 225, \"covered\": 123, \"notcovered\": 102, \"percent\": 54.666666666666664}}}, {\"filename\": \"/src/curl/lib/conncache.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/connect.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 16, \"percent\": 76.19047619047619}, \"instantiations\": {\"count\": 21, \"covered\": 16, \"percent\": 76.19047619047619}, \"lines\": {\"count\": 1074, \"covered\": 439, \"percent\": 40.87523277467412}, \"regions\": {\"count\": 596, \"covered\": 233, \"notcovered\": 363, \"percent\": 39.09395973154363}}}, {\"filename\": \"/src/curl/lib/connect.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/content_encoding.c\", \"summary\": {\"functions\": {\"count\": 28, \"covered\": 27, \"percent\": 96.42857142857143}, \"instantiations\": {\"count\": 28, \"covered\": 27, \"percent\": 96.42857142857143}, \"lines\": {\"count\": 582, \"covered\": 404, \"percent\": 69.41580756013745}, \"regions\": {\"count\": 338, \"covered\": 223, \"notcovered\": 115, \"percent\": 65.97633136094674}}}, {\"filename\": \"/src/curl/lib/cookie.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 20, \"percent\": 74.07407407407408}, \"instantiations\": {\"count\": 27, \"covered\": 20, \"percent\": 74.07407407407408}, \"lines\": {\"count\": 1341, \"covered\": 837, \"percent\": 62.41610738255034}, \"regions\": {\"count\": 1020, \"covered\": 615, \"notcovered\": 405, \"percent\": 60.29411764705882}}}, {\"filename\": \"/src/curl/lib/cookie.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_addrinfo.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 5, \"percent\": 62.5}, \"instantiations\": {\"count\": 8, \"covered\": 5, \"percent\": 62.5}, \"lines\": {\"count\": 339, \"covered\": 149, \"percent\": 43.95280235988201}, \"regions\": {\"count\": 148, \"covered\": 52, \"notcovered\": 96, \"percent\": 35.13513513513514}}}, {\"filename\": \"/src/curl/lib/curl_config.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_ctype.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 8, \"percent\": 80}, \"instantiations\": {\"count\": 10, \"covered\": 8, \"percent\": 80}, \"lines\": {\"count\": 50, \"covered\": 39, \"percent\": 78}, \"regions\": {\"count\": 96, \"covered\": 73, \"notcovered\": 23, \"percent\": 76.04166666666666}}}, {\"filename\": \"/src/curl/lib/curl_ctype.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_endian.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 2, \"percent\": 40}, \"instantiations\": {\"count\": 5, \"covered\": 2, \"percent\": 40}, \"lines\": {\"count\": 22, \"covered\": 8, \"percent\": 36.36363636363637}, \"regions\": {\"count\": 5, \"covered\": 2, \"notcovered\": 3, \"percent\": 40}}}, {\"filename\": \"/src/curl/lib/curl_fnmatch.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 18, \"covered\": 15, \"percent\": 83.33333333333334}, \"regions\": {\"count\": 13, \"covered\": 9, \"notcovered\": 4, \"percent\": 69.23076923076923}}}, {\"filename\": \"/src/curl/lib/curl_fnmatch.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_get_line.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 18, \"covered\": 0, \"notcovered\": 18, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_gethostname.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 30, \"covered\": 25, \"percent\": 83.33333333333334}, \"regions\": {\"count\": 9, \"covered\": 6, \"notcovered\": 3, \"percent\": 66.66666666666666}}}, {\"filename\": \"/src/curl/lib/curl_hmac.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_md5.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_memrchr.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 15, \"covered\": 15, \"percent\": 100}, \"regions\": {\"count\": 9, \"covered\": 9, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/curl/lib/curl_memrchr.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_ntlm_core.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 6, \"percent\": 60}, \"instantiations\": {\"count\": 10, \"covered\": 6, \"percent\": 60}, \"lines\": {\"count\": 234, \"covered\": 106, \"percent\": 45.2991452991453}, \"regions\": {\"count\": 102, \"covered\": 43, \"notcovered\": 59, \"percent\": 42.15686274509804}}}, {\"filename\": \"/src/curl/lib/curl_ntlm_wb.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 4, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 6, \"covered\": 4, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 392, \"covered\": 130, \"percent\": 33.16326530612245}, \"regions\": {\"count\": 293, \"covered\": 66, \"notcovered\": 227, \"percent\": 22.525597269624573}}}, {\"filename\": \"/src/curl/lib/curl_printf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_range.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 57, \"covered\": 57, \"percent\": 100}, \"regions\": {\"count\": 42, \"covered\": 42, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/curl/lib/curl_sasl.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 8, \"percent\": 100}, \"instantiations\": {\"count\": 8, \"covered\": 8, \"percent\": 100}, \"lines\": {\"count\": 411, \"covered\": 312, \"percent\": 75.91240875912408}, \"regions\": {\"count\": 272, \"covered\": 188, \"notcovered\": 84, \"percent\": 69.11764705882352}}}, {\"filename\": \"/src/curl/lib/curl_sasl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_setup.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_setup_once.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/curl_threads.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"instantiations\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"lines\": {\"count\": 44, \"covered\": 31, \"percent\": 70.45454545454545}, \"regions\": {\"count\": 26, \"covered\": 15, \"notcovered\": 11, \"percent\": 57.692307692307686}}}, {\"filename\": \"/src/curl/lib/curl_threads.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/dict.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 179, \"covered\": 165, \"percent\": 92.17877094972067}, \"regions\": {\"count\": 117, \"covered\": 107, \"notcovered\": 10, \"percent\": 91.45299145299145}}}, {\"filename\": \"/src/curl/lib/doh.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 839, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 656, \"covered\": 0, \"notcovered\": 656, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/doh.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/dotdot.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 129, \"covered\": 103, \"percent\": 79.84496124031007}, \"regions\": {\"count\": 56, \"covered\": 46, \"notcovered\": 10, \"percent\": 82.14285714285714}}}, {\"filename\": \"/src/curl/lib/easy.c\", \"summary\": {\"functions\": {\"count\": 28, \"covered\": 4, \"percent\": 14.285714285714285}, \"instantiations\": {\"count\": 28, \"covered\": 4, \"percent\": 14.285714285714285}, \"lines\": {\"count\": 767, \"covered\": 49, \"percent\": 6.388526727509778}, \"regions\": {\"count\": 421, \"covered\": 26, \"notcovered\": 395, \"percent\": 6.175771971496437}}}, {\"filename\": \"/src/curl/lib/escape.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 1, \"percent\": 14.285714285714285}, \"instantiations\": {\"count\": 7, \"covered\": 1, \"percent\": 14.285714285714285}, \"lines\": {\"count\": 160, \"covered\": 52, \"percent\": 32.5}, \"regions\": {\"count\": 156, \"covered\": 32, \"notcovered\": 124, \"percent\": 20.51282051282051}}}, {\"filename\": \"/src/curl/lib/file.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 6, \"percent\": 100}, \"instantiations\": {\"count\": 6, \"covered\": 6, \"percent\": 100}, \"lines\": {\"count\": 347, \"covered\": 306, \"percent\": 88.18443804034582}, \"regions\": {\"count\": 200, \"covered\": 169, \"notcovered\": 31, \"percent\": 84.5}}}, {\"filename\": \"/src/curl/lib/fileinfo.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 10, \"covered\": 10, \"percent\": 100}, \"regions\": {\"count\": 12, \"covered\": 12, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/curl/lib/formdata.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 720, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 513, \"covered\": 0, \"notcovered\": 513, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/ftp.c\", \"summary\": {\"functions\": {\"count\": 65, \"covered\": 54, \"percent\": 83.07692307692308}, \"instantiations\": {\"count\": 65, \"covered\": 54, \"percent\": 83.07692307692308}, \"lines\": {\"count\": 3626, \"covered\": 2078, \"percent\": 57.30832873690016}, \"regions\": {\"count\": 2133, \"covered\": 1182, \"notcovered\": 951, \"percent\": 55.41490857946554}}}, {\"filename\": \"/src/curl/lib/ftp.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/ftplistparser.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 6, \"percent\": 100}, \"instantiations\": {\"count\": 6, \"covered\": 6, \"percent\": 100}, \"lines\": {\"count\": 818, \"covered\": 735, \"percent\": 89.85330073349633}, \"regions\": {\"count\": 498, \"covered\": 463, \"notcovered\": 35, \"percent\": 92.9718875502008}}}, {\"filename\": \"/src/curl/lib/getenv.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 7, \"covered\": 7, \"percent\": 100}, \"regions\": {\"count\": 5, \"covered\": 3, \"notcovered\": 2, \"percent\": 60}}}, {\"filename\": \"/src/curl/lib/getinfo.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 1, \"percent\": 12.5}, \"instantiations\": {\"count\": 8, \"covered\": 1, \"percent\": 12.5}, \"lines\": {\"count\": 427, \"covered\": 44, \"percent\": 10.304449648711945}, \"regions\": {\"count\": 165, \"covered\": 4, \"notcovered\": 161, \"percent\": 2.4242424242424243}}}, {\"filename\": \"/src/curl/lib/gopher.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 97, \"covered\": 72, \"percent\": 74.22680412371135}, \"regions\": {\"count\": 51, \"covered\": 38, \"notcovered\": 13, \"percent\": 74.50980392156863}}}, {\"filename\": \"/src/curl/lib/hash.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 13, \"percent\": 100}, \"instantiations\": {\"count\": 13, \"covered\": 13, \"percent\": 100}, \"lines\": {\"count\": 186, \"covered\": 171, \"percent\": 91.93548387096774}, \"regions\": {\"count\": 98, \"covered\": 92, \"notcovered\": 6, \"percent\": 93.87755102040816}}}, {\"filename\": \"/src/curl/lib/hmac.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"instantiations\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"lines\": {\"count\": 84, \"covered\": 67, \"percent\": 79.76190476190477}, \"regions\": {\"count\": 22, \"covered\": 16, \"notcovered\": 6, \"percent\": 72.72727272727273}}}, {\"filename\": \"/src/curl/lib/hostasyn.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 44, \"covered\": 22, \"percent\": 50}, \"regions\": {\"count\": 15, \"covered\": 5, \"notcovered\": 10, \"percent\": 33.33333333333333}}}, {\"filename\": \"/src/curl/lib/hostcheck.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 81, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 72, \"covered\": 0, \"notcovered\": 72, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/hostcheck.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/hostip.c\", \"summary\": {\"functions\": {\"count\": 20, \"covered\": 14, \"percent\": 70}, \"instantiations\": {\"count\": 20, \"covered\": 14, \"percent\": 70}, \"lines\": {\"count\": 603, \"covered\": 260, \"percent\": 43.117744610281925}, \"regions\": {\"count\": 276, \"covered\": 107, \"notcovered\": 169, \"percent\": 38.768115942028984}}}, {\"filename\": \"/src/curl/lib/hostip.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/hostip6.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 30, \"covered\": 30, \"percent\": 100}, \"regions\": {\"count\": 20, \"covered\": 18, \"notcovered\": 2, \"percent\": 90}}}, {\"filename\": \"/src/curl/lib/http.c\", \"summary\": {\"functions\": {\"count\": 38, \"covered\": 32, \"percent\": 84.21052631578947}, \"instantiations\": {\"count\": 38, \"covered\": 32, \"percent\": 84.21052631578947}, \"lines\": {\"count\": 3373, \"covered\": 2572, \"percent\": 76.25259412985473}, \"regions\": {\"count\": 2208, \"covered\": 1696, \"notcovered\": 512, \"percent\": 76.81159420289855}}}, {\"filename\": \"/src/curl/lib/http.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/http2.c\", \"summary\": {\"functions\": {\"count\": 46, \"covered\": 37, \"percent\": 80.43478260869566}, \"instantiations\": {\"count\": 46, \"covered\": 37, \"percent\": 80.43478260869566}, \"lines\": {\"count\": 1978, \"covered\": 1318, \"percent\": 66.6329625884732}, \"regions\": {\"count\": 1147, \"covered\": 741, \"notcovered\": 406, \"percent\": 64.60331299040976}}}, {\"filename\": \"/src/curl/lib/http2.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/http_chunks.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"instantiations\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"lines\": {\"count\": 248, \"covered\": 227, \"percent\": 91.53225806451613}, \"regions\": {\"count\": 122, \"covered\": 108, \"notcovered\": 14, \"percent\": 88.52459016393442}}}, {\"filename\": \"/src/curl/lib/http_chunks.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/http_digest.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"instantiations\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"lines\": {\"count\": 122, \"covered\": 111, \"percent\": 90.98360655737704}, \"regions\": {\"count\": 54, \"covered\": 46, \"notcovered\": 8, \"percent\": 85.18518518518519}}}, {\"filename\": \"/src/curl/lib/http_ntlm.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"instantiations\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"lines\": {\"count\": 166, \"covered\": 110, \"percent\": 66.26506024096386}, \"regions\": {\"count\": 94, \"covered\": 50, \"notcovered\": 44, \"percent\": 53.191489361702125}}}, {\"filename\": \"/src/curl/lib/http_proxy.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 3, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 9, \"covered\": 3, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 594, \"covered\": 17, \"percent\": 2.861952861952862}, \"regions\": {\"count\": 357, \"covered\": 10, \"notcovered\": 347, \"percent\": 2.801120448179272}}}, {\"filename\": \"/src/curl/lib/if2ip.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 97, \"covered\": 8, \"percent\": 8.24742268041237}, \"regions\": {\"count\": 59, \"covered\": 4, \"notcovered\": 55, \"percent\": 6.779661016949152}}}, {\"filename\": \"/src/curl/lib/if2ip.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/imap.c\", \"summary\": {\"functions\": {\"count\": 49, \"covered\": 41, \"percent\": 83.6734693877551}, \"instantiations\": {\"count\": 49, \"covered\": 41, \"percent\": 83.6734693877551}, \"lines\": {\"count\": 1567, \"covered\": 1285, \"percent\": 82.00382897255903}, \"regions\": {\"count\": 1081, \"covered\": 865, \"notcovered\": 216, \"percent\": 80.01850138760406}}}, {\"filename\": \"/src/curl/lib/imap.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/inet_ntop.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/inet_pton.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/llist.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"instantiations\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"lines\": {\"count\": 80, \"covered\": 78, \"percent\": 97.5}, \"regions\": {\"count\": 41, \"covered\": 39, \"notcovered\": 2, \"percent\": 95.1219512195122}}}, {\"filename\": \"/src/curl/lib/md4.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 7, \"covered\": 7, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/curl/lib/md5.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 4, \"percent\": 100}, \"instantiations\": {\"count\": 4, \"covered\": 4, \"percent\": 100}, \"lines\": {\"count\": 42, \"covered\": 38, \"percent\": 90.47619047619048}, \"regions\": {\"count\": 15, \"covered\": 12, \"notcovered\": 3, \"percent\": 80}}}, {\"filename\": \"/src/curl/lib/memdebug.c\", \"summary\": {\"functions\": {\"count\": 18, \"covered\": 15, \"percent\": 83.33333333333334}, \"instantiations\": {\"count\": 18, \"covered\": 15, \"percent\": 83.33333333333334}, \"lines\": {\"count\": 283, \"covered\": 202, \"percent\": 71.37809187279152}, \"regions\": {\"count\": 165, \"covered\": 99, \"notcovered\": 66, \"percent\": 60}}}, {\"filename\": \"/src/curl/lib/memdebug.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/mime.c\", \"summary\": {\"functions\": {\"count\": 56, \"covered\": 34, \"percent\": 60.71428571428571}, \"instantiations\": {\"count\": 56, \"covered\": 34, \"percent\": 60.71428571428571}, \"lines\": {\"count\": 1277, \"covered\": 671, \"percent\": 52.54502740798747}, \"regions\": {\"count\": 828, \"covered\": 412, \"notcovered\": 416, \"percent\": 49.75845410628019}}}, {\"filename\": \"/src/curl/lib/mime.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/mprintf.c\", \"summary\": {\"functions\": {\"count\": 17, \"covered\": 11, \"percent\": 64.70588235294117}, \"instantiations\": {\"count\": 17, \"covered\": 11, \"percent\": 64.70588235294117}, \"lines\": {\"count\": 905, \"covered\": 585, \"percent\": 64.64088397790056}, \"regions\": {\"count\": 591, \"covered\": 323, \"notcovered\": 268, \"percent\": 54.653130287648054}}}, {\"filename\": \"/src/curl/lib/multi.c\", \"summary\": {\"functions\": {\"count\": 70, \"covered\": 43, \"percent\": 61.42857142857143}, \"instantiations\": {\"count\": 70, \"covered\": 43, \"percent\": 61.42857142857143}, \"lines\": {\"count\": 2793, \"covered\": 1523, \"percent\": 54.52918009308987}, \"regions\": {\"count\": 1565, \"covered\": 756, \"notcovered\": 809, \"percent\": 48.30670926517572}}}, {\"filename\": \"/src/curl/lib/multihandle.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/multiif.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/netrc.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 180, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 143, \"covered\": 0, \"notcovered\": 143, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/non-ascii.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/nonblock.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 8, \"covered\": 6, \"percent\": 75}, \"regions\": {\"count\": 7, \"covered\": 5, \"notcovered\": 2, \"percent\": 71.42857142857143}}}, {\"filename\": \"/src/curl/lib/parsedate.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 8, \"percent\": 88.88888888888889}, \"instantiations\": {\"count\": 9, \"covered\": 8, \"percent\": 88.88888888888889}, \"lines\": {\"count\": 317, \"covered\": 289, \"percent\": 91.16719242902208}, \"regions\": {\"count\": 218, \"covered\": 202, \"notcovered\": 16, \"percent\": 92.66055045871559}}}, {\"filename\": \"/src/curl/lib/pingpong.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 9, \"percent\": 90}, \"instantiations\": {\"count\": 10, \"covered\": 9, \"percent\": 90}, \"lines\": {\"count\": 386, \"covered\": 329, \"percent\": 85.23316062176166}, \"regions\": {\"count\": 202, \"covered\": 165, \"notcovered\": 37, \"percent\": 81.68316831683168}}}, {\"filename\": \"/src/curl/lib/pop3.c\", \"summary\": {\"functions\": {\"count\": 40, \"covered\": 36, \"percent\": 90}, \"instantiations\": {\"count\": 40, \"covered\": 36, \"percent\": 90}, \"lines\": {\"count\": 1087, \"covered\": 995, \"percent\": 91.53633854645814}, \"regions\": {\"count\": 559, \"covered\": 508, \"notcovered\": 51, \"percent\": 90.87656529516994}}}, {\"filename\": \"/src/curl/lib/pop3.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/progress.c\", \"summary\": {\"functions\": {\"count\": 15, \"covered\": 11, \"percent\": 73.33333333333333}, \"instantiations\": {\"count\": 15, \"covered\": 11, \"percent\": 73.33333333333333}, \"lines\": {\"count\": 488, \"covered\": 208, \"percent\": 42.62295081967213}, \"regions\": {\"count\": 499, \"covered\": 83, \"notcovered\": 416, \"percent\": 16.63326653306613}}}, {\"filename\": \"/src/curl/lib/progress.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/rand.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"instantiations\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"lines\": {\"count\": 115, \"covered\": 65, \"percent\": 56.52173913043478}, \"regions\": {\"count\": 50, \"covered\": 26, \"notcovered\": 24, \"percent\": 52}}}, {\"filename\": \"/src/curl/lib/rename.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 6, \"covered\": 5, \"percent\": 83.33333333333334}, \"regions\": {\"count\": 4, \"covered\": 3, \"notcovered\": 1, \"percent\": 75}}}, {\"filename\": \"/src/curl/lib/rtsp.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 8, \"percent\": 72.72727272727273}, \"instantiations\": {\"count\": 11, \"covered\": 8, \"percent\": 72.72727272727273}, \"lines\": {\"count\": 673, \"covered\": 579, \"percent\": 86.03268945022289}, \"regions\": {\"count\": 409, \"covered\": 323, \"notcovered\": 86, \"percent\": 78.97310513447434}}}, {\"filename\": \"/src/curl/lib/select.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 154, \"covered\": 79, \"percent\": 51.298701298701296}, \"regions\": {\"count\": 111, \"covered\": 51, \"notcovered\": 60, \"percent\": 45.94594594594595}}}, {\"filename\": \"/src/curl/lib/select.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/sendf.c\", \"summary\": {\"functions\": {\"count\": 15, \"covered\": 11, \"percent\": 73.33333333333333}, \"instantiations\": {\"count\": 15, \"covered\": 11, \"percent\": 73.33333333333333}, \"lines\": {\"count\": 514, \"covered\": 296, \"percent\": 57.58754863813229}, \"regions\": {\"count\": 253, \"covered\": 147, \"notcovered\": 106, \"percent\": 58.10276679841897}}}, {\"filename\": \"/src/curl/lib/sendf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/setopt.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"instantiations\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"lines\": {\"count\": 2549, \"covered\": 488, \"percent\": 19.1447626520204}, \"regions\": {\"count\": 991, \"covered\": 145, \"notcovered\": 846, \"percent\": 14.631685166498487}}}, {\"filename\": \"/src/curl/lib/sha256.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/share.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 2, \"percent\": 40}, \"instantiations\": {\"count\": 5, \"covered\": 2, \"percent\": 40}, \"lines\": {\"count\": 190, \"covered\": 10, \"percent\": 5.263157894736842}, \"regions\": {\"count\": 86, \"covered\": 6, \"notcovered\": 80, \"percent\": 6.976744186046512}}}, {\"filename\": \"/src/curl/lib/sigpipe.h\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 6, \"covered\": 6, \"percent\": 100}, \"lines\": {\"count\": 20, \"covered\": 20, \"percent\": 100}, \"regions\": {\"count\": 6, \"covered\": 6, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/curl/lib/slist.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"instantiations\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"lines\": {\"count\": 79, \"covered\": 59, \"percent\": 74.68354430379746}, \"regions\": {\"count\": 40, \"covered\": 29, \"notcovered\": 11, \"percent\": 72.5}}}, {\"filename\": \"/src/curl/lib/smb.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 26, \"percent\": 96.29629629629629}, \"instantiations\": {\"count\": 27, \"covered\": 26, \"percent\": 96.29629629629629}, \"lines\": {\"count\": 740, \"covered\": 702, \"percent\": 94.86486486486486}, \"regions\": {\"count\": 406, \"covered\": 371, \"notcovered\": 35, \"percent\": 91.37931034482759}}}, {\"filename\": \"/src/curl/lib/smb.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/smtp.c\", \"summary\": {\"functions\": {\"count\": 44, \"covered\": 40, \"percent\": 90.9090909090909}, \"instantiations\": {\"count\": 44, \"covered\": 40, \"percent\": 90.9090909090909}, \"lines\": {\"count\": 1323, \"covered\": 1174, \"percent\": 88.73771730914588}, \"regions\": {\"count\": 674, \"covered\": 587, \"notcovered\": 87, \"percent\": 87.0919881305638}}}, {\"filename\": \"/src/curl/lib/smtp.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/socketpair.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/socks.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 787, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 390, \"covered\": 0, \"notcovered\": 390, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/speedcheck.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 36, \"covered\": 10, \"percent\": 27.77777777777778}, \"regions\": {\"count\": 18, \"covered\": 7, \"notcovered\": 11, \"percent\": 38.88888888888889}}}, {\"filename\": \"/src/curl/lib/splay.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 4, \"percent\": 100}, \"instantiations\": {\"count\": 4, \"covered\": 4, \"percent\": 100}, \"lines\": {\"count\": 203, \"covered\": 108, \"percent\": 53.20197044334976}, \"regions\": {\"count\": 143, \"covered\": 59, \"notcovered\": 84, \"percent\": 41.25874125874126}}}, {\"filename\": \"/src/curl/lib/splay.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/strcase.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 8, \"percent\": 88.88888888888889}, \"instantiations\": {\"count\": 9, \"covered\": 8, \"percent\": 88.88888888888889}, \"lines\": {\"count\": 69, \"covered\": 60, \"percent\": 86.95652173913044}, \"regions\": {\"count\": 59, \"covered\": 50, \"notcovered\": 9, \"percent\": 84.7457627118644}}}, {\"filename\": \"/src/curl/lib/strcase.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/strdup.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 16, \"covered\": 7, \"percent\": 43.75}, \"regions\": {\"count\": 11, \"covered\": 5, \"notcovered\": 6, \"percent\": 45.45454545454545}}}, {\"filename\": \"/src/curl/lib/strerror.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 403, \"covered\": 33, \"percent\": 8.188585607940446}, \"regions\": {\"count\": 145, \"covered\": 11, \"notcovered\": 134, \"percent\": 7.586206896551724}}}, {\"filename\": \"/src/curl/lib/strtoofft.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 26, \"covered\": 26, \"percent\": 100}, \"regions\": {\"count\": 19, \"covered\": 19, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/curl/lib/telnet.c\", \"summary\": {\"functions\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1128, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 894, \"covered\": 0, \"notcovered\": 894, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/tftp.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 6, \"percent\": 22.22222222222222}, \"instantiations\": {\"count\": 27, \"covered\": 6, \"percent\": 22.22222222222222}, \"lines\": {\"count\": 1049, \"covered\": 199, \"percent\": 18.970448045757866}, \"regions\": {\"count\": 498, \"covered\": 79, \"notcovered\": 419, \"percent\": 15.863453815261044}}}, {\"filename\": \"/src/curl/lib/timeval.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"instantiations\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"lines\": {\"count\": 52, \"covered\": 37, \"percent\": 71.15384615384616}, \"regions\": {\"count\": 68, \"covered\": 37, \"notcovered\": 31, \"percent\": 54.41176470588235}}}, {\"filename\": \"/src/curl/lib/timeval.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/transfer.c\", \"summary\": {\"functions\": {\"count\": 19, \"covered\": 16, \"percent\": 84.21052631578947}, \"instantiations\": {\"count\": 19, \"covered\": 16, \"percent\": 84.21052631578947}, \"lines\": {\"count\": 1580, \"covered\": 1270, \"percent\": 80.37974683544303}, \"regions\": {\"count\": 971, \"covered\": 788, \"notcovered\": 183, \"percent\": 81.15345005149331}}}, {\"filename\": \"/src/curl/lib/transfer.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/url.c\", \"summary\": {\"functions\": {\"count\": 50, \"covered\": 41, \"percent\": 82}, \"instantiations\": {\"count\": 50, \"covered\": 41, \"percent\": 82}, \"lines\": {\"count\": 3154, \"covered\": 2036, \"percent\": 64.55294863665188}, \"regions\": {\"count\": 2207, \"covered\": 1267, \"notcovered\": 940, \"percent\": 57.408246488445855}}}, {\"filename\": \"/src/curl/lib/url.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/urlapi-int.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/urlapi.c\", \"summary\": {\"functions\": {\"count\": 19, \"covered\": 18, \"percent\": 94.73684210526315}, \"instantiations\": {\"count\": 19, \"covered\": 18, \"percent\": 94.73684210526315}, \"lines\": {\"count\": 1308, \"covered\": 1054, \"percent\": 80.58103975535168}, \"regions\": {\"count\": 1031, \"covered\": 777, \"notcovered\": 254, \"percent\": 75.36372453928225}}}, {\"filename\": \"/src/curl/lib/urldata.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/vauth/cleartext.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 59, \"covered\": 48, \"percent\": 81.35593220338984}, \"regions\": {\"count\": 26, \"covered\": 20, \"notcovered\": 6, \"percent\": 76.92307692307693}}}, {\"filename\": \"/src/curl/lib/vauth/cram.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 54, \"covered\": 52, \"percent\": 96.29629629629629}, \"regions\": {\"count\": 18, \"covered\": 16, \"notcovered\": 2, \"percent\": 88.88888888888889}}}, {\"filename\": \"/src/curl/lib/vauth/digest.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 11, \"percent\": 84.61538461538461}, \"instantiations\": {\"count\": 13, \"covered\": 11, \"percent\": 84.61538461538461}, \"lines\": {\"count\": 747, \"covered\": 440, \"percent\": 58.90227576974565}, \"regions\": {\"count\": 482, \"covered\": 265, \"notcovered\": 217, \"percent\": 54.9792531120332}}}, {\"filename\": \"/src/curl/lib/vauth/digest.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/vauth/ntlm.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 4, \"percent\": 57.14285714285714}, \"instantiations\": {\"count\": 7, \"covered\": 4, \"percent\": 57.14285714285714}, \"lines\": {\"count\": 555, \"covered\": 152, \"percent\": 27.387387387387385}, \"regions\": {\"count\": 191, \"covered\": 41, \"notcovered\": 150, \"percent\": 21.465968586387437}}}, {\"filename\": \"/src/curl/lib/vauth/ntlm.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/vauth/oauth2.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 36, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 18, \"covered\": 0, \"notcovered\": 18, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/vauth/vauth.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 26, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 26, \"covered\": 0, \"notcovered\": 26, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/version.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"instantiations\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"lines\": {\"count\": 76, \"covered\": 74, \"percent\": 97.36842105263158}, \"regions\": {\"count\": 21, \"covered\": 17, \"notcovered\": 4, \"percent\": 80.95238095238095}}}, {\"filename\": \"/src/curl/lib/vtls/openssl.c\", \"summary\": {\"functions\": {\"count\": 57, \"covered\": 20, \"percent\": 35.08771929824561}, \"instantiations\": {\"count\": 57, \"covered\": 20, \"percent\": 35.08771929824561}, \"lines\": {\"count\": 2927, \"covered\": 648, \"percent\": 22.138708575333105}, \"regions\": {\"count\": 2350, \"covered\": 386, \"notcovered\": 1964, \"percent\": 16.425531914893618}}}, {\"filename\": \"/src/curl/lib/vtls/vtls.c\", \"summary\": {\"functions\": {\"count\": 60, \"covered\": 19, \"percent\": 31.666666666666664}, \"instantiations\": {\"count\": 60, \"covered\": 19, \"percent\": 31.666666666666664}, \"lines\": {\"count\": 878, \"covered\": 186, \"percent\": 21.184510250569478}, \"regions\": {\"count\": 667, \"covered\": 159, \"notcovered\": 508, \"percent\": 23.838080959520237}}}, {\"filename\": \"/src/curl/lib/vtls/vtls.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/warnless.c\", \"summary\": {\"functions\": {\"count\": 15, \"covered\": 7, \"percent\": 46.666666666666664}, \"instantiations\": {\"count\": 15, \"covered\": 7, \"percent\": 46.666666666666664}, \"lines\": {\"count\": 71, \"covered\": 33, \"percent\": 46.478873239436616}, \"regions\": {\"count\": 50, \"covered\": 22, \"notcovered\": 28, \"percent\": 44}}}, {\"filename\": \"/src/curl/lib/warnless.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl/lib/wildcard.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"instantiations\": {\"count\": 3, \"covered\": 3, \"percent\": 100}, \"lines\": {\"count\": 32, \"covered\": 31, \"percent\": 96.875}, \"regions\": {\"count\": 12, \"covered\": 11, \"notcovered\": 1, \"percent\": 91.66666666666666}}}, {\"filename\": \"/src/curl_fuzzer/curl_fuzzer.cc\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 11, \"percent\": 100}, \"instantiations\": {\"count\": 11, \"covered\": 11, \"percent\": 100}, \"lines\": {\"count\": 391, \"covered\": 377, \"percent\": 96.41943734015345}, \"regions\": {\"count\": 202, \"covered\": 170, \"notcovered\": 32, \"percent\": 84.15841584158416}}}, {\"filename\": \"/src/curl_fuzzer/curl_fuzzer.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_fuzzer/curl_fuzzer_callback.cc\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 4, \"percent\": 100}, \"instantiations\": {\"count\": 4, \"covered\": 4, \"percent\": 100}, \"lines\": {\"count\": 161, \"covered\": 136, \"percent\": 84.472049689441}, \"regions\": {\"count\": 71, \"covered\": 60, \"notcovered\": 11, \"percent\": 84.50704225352112}}}, {\"filename\": \"/src/curl_fuzzer/curl_fuzzer_tlv.cc\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 7, \"percent\": 100}, \"instantiations\": {\"count\": 7, \"covered\": 7, \"percent\": 100}, \"lines\": {\"count\": 247, \"covered\": 247, \"percent\": 100}, \"regions\": {\"count\": 470, \"covered\": 442, \"notcovered\": 28, \"percent\": 94.04255319148936}}}, {\"filename\": \"/src/curl_install/include/curl/curl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/nghttp2/nghttp2.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/asn1.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/bio.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/conf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/crypto.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/des.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/engine.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/evp.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/obj_mac.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/ocsp.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/opensslv.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/rsa.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/safestack.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/ssl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/ssl2.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/ssl3.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/tls1.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/ui.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/x509.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/x509_vfy.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/openssl/x509v3.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/curl_install/include/zlib.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/includes/nghttp2/nghttp2.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/includes/nghttp2/nghttp2ver.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_buf.c\", \"summary\": {\"functions\": {\"count\": 30, \"covered\": 18, \"percent\": 60}, \"instantiations\": {\"count\": 30, \"covered\": 18, \"percent\": 60}, \"lines\": {\"count\": 458, \"covered\": 234, \"percent\": 51.09170305676856}, \"regions\": {\"count\": 183, \"covered\": 97, \"notcovered\": 86, \"percent\": 53.00546448087432}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_buf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_callbacks.c\", \"summary\": {\"functions\": {\"count\": 25, \"covered\": 9, \"percent\": 36}, \"instantiations\": {\"count\": 25, \"covered\": 9, \"percent\": 36}, \"lines\": {\"count\": 81, \"covered\": 31, \"percent\": 38.2716049382716}, \"regions\": {\"count\": 28, \"covered\": 11, \"notcovered\": 17, \"percent\": 39.285714285714285}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_debug.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_frame.c\", \"summary\": {\"functions\": {\"count\": 69, \"covered\": 46, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 69, \"covered\": 46, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 953, \"covered\": 465, \"percent\": 48.79328436516264}, \"regions\": {\"count\": 315, \"covered\": 155, \"notcovered\": 160, \"percent\": 49.2063492063492}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_frame.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_hd.c\", \"summary\": {\"functions\": {\"count\": 81, \"covered\": 55, \"percent\": 67.90123456790124}, \"instantiations\": {\"count\": 81, \"covered\": 55, \"percent\": 67.90123456790124}, \"lines\": {\"count\": 1989, \"covered\": 1616, \"percent\": 81.24685771744595}, \"regions\": {\"count\": 1043, \"covered\": 891, \"notcovered\": 152, \"percent\": 85.42665388302973}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_hd.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_hd_huffman.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"instantiations\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"lines\": {\"count\": 184, \"covered\": 170, \"percent\": 92.3913043478261}, \"regions\": {\"count\": 143, \"covered\": 136, \"notcovered\": 7, \"percent\": 95.1048951048951}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_helper.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 11, \"percent\": 91.66666666666666}, \"instantiations\": {\"count\": 12, \"covered\": 11, \"percent\": 91.66666666666666}, \"lines\": {\"count\": 237, \"covered\": 177, \"percent\": 74.68354430379746}, \"regions\": {\"count\": 115, \"covered\": 85, \"notcovered\": 30, \"percent\": 73.91304347826086}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_helper.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_http.c\", \"summary\": {\"functions\": {\"count\": 18, \"covered\": 15, \"percent\": 83.33333333333334}, \"instantiations\": {\"count\": 18, \"covered\": 15, \"percent\": 83.33333333333334}, \"lines\": {\"count\": 463, \"covered\": 309, \"percent\": 66.73866090712744}, \"regions\": {\"count\": 376, \"covered\": 248, \"notcovered\": 128, \"percent\": 65.95744680851064}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_map.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 11, \"percent\": 91.66666666666666}, \"instantiations\": {\"count\": 12, \"covered\": 11, \"percent\": 91.66666666666666}, \"lines\": {\"count\": 140, \"covered\": 92, \"percent\": 65.71428571428571}, \"regions\": {\"count\": 69, \"covered\": 44, \"notcovered\": 25, \"percent\": 63.76811594202898}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_mem.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 10, \"percent\": 100}, \"instantiations\": {\"count\": 10, \"covered\": 10, \"percent\": 100}, \"lines\": {\"count\": 36, \"covered\": 36, \"percent\": 100}, \"regions\": {\"count\": 10, \"covered\": 10, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_outbound_item.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"instantiations\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"lines\": {\"count\": 93, \"covered\": 62, \"percent\": 66.66666666666666}, \"regions\": {\"count\": 32, \"covered\": 21, \"notcovered\": 11, \"percent\": 65.625}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_outbound_item.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_pq.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 9, \"percent\": 69.23076923076923}, \"instantiations\": {\"count\": 13, \"covered\": 9, \"percent\": 69.23076923076923}, \"lines\": {\"count\": 141, \"covered\": 71, \"percent\": 50.35460992907801}, \"regions\": {\"count\": 73, \"covered\": 31, \"notcovered\": 42, \"percent\": 42.465753424657535}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_priority_spec.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"instantiations\": {\"count\": 4, \"covered\": 3, \"percent\": 75}, \"lines\": {\"count\": 21, \"covered\": 14, \"percent\": 66.66666666666666}, \"regions\": {\"count\": 20, \"covered\": 10, \"notcovered\": 10, \"percent\": 50}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_rcbuf.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 5, \"percent\": 71.42857142857143}, \"instantiations\": {\"count\": 7, \"covered\": 5, \"percent\": 71.42857142857143}, \"lines\": {\"count\": 59, \"covered\": 48, \"percent\": 81.35593220338984}, \"regions\": {\"count\": 23, \"covered\": 19, \"notcovered\": 4, \"percent\": 82.6086956521739}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_session.c\", \"summary\": {\"functions\": {\"count\": 189, \"covered\": 124, \"percent\": 65.60846560846561}, \"instantiations\": {\"count\": 189, \"covered\": 124, \"percent\": 65.60846560846561}, \"lines\": {\"count\": 6806, \"covered\": 4020, \"percent\": 59.06553041434029}, \"regions\": {\"count\": 3356, \"covered\": 1973, \"notcovered\": 1383, \"percent\": 58.790226460071516}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_session.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_stream.c\", \"summary\": {\"functions\": {\"count\": 50, \"covered\": 29, \"percent\": 57.99999999999999}, \"instantiations\": {\"count\": 50, \"covered\": 29, \"percent\": 57.99999999999999}, \"lines\": {\"count\": 734, \"covered\": 348, \"percent\": 47.41144414168937}, \"regions\": {\"count\": 310, \"covered\": 132, \"notcovered\": 178, \"percent\": 42.58064516129032}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_submit.c\", \"summary\": {\"functions\": {\"count\": 23, \"covered\": 9, \"percent\": 39.130434782608695}, \"instantiations\": {\"count\": 23, \"covered\": 9, \"percent\": 39.130434782608695}, \"lines\": {\"count\": 698, \"covered\": 167, \"percent\": 23.925501432664756}, \"regions\": {\"count\": 292, \"covered\": 66, \"notcovered\": 226, \"percent\": 22.602739726027394}}}, {\"filename\": \"/src/nghttp2/lib/nghttp2_version.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"regions\": {\"count\": 5, \"covered\": 4, \"notcovered\": 1, \"percent\": 80}}}, {\"filename\": \"/src/openssl/crypto/LPdir_unix.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 54, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 26, \"covered\": 0, \"notcovered\": 26, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/aes/aes_misc.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 3, \"covered\": 0, \"notcovered\": 3, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/aes/aes_wrap.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 2, \"covered\": 0, \"notcovered\": 2, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_bitstr.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 1, \"percent\": 16.666666666666664}, \"instantiations\": {\"count\": 6, \"covered\": 1, \"percent\": 16.666666666666664}, \"lines\": {\"count\": 184, \"covered\": 42, \"percent\": 22.82608695652174}, \"regions\": {\"count\": 148, \"covered\": 24, \"notcovered\": 124, \"percent\": 16.216216216216218}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_bool.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 46, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 26, \"covered\": 0, \"notcovered\": 26, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_bytes.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 233, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 167, \"covered\": 0, \"notcovered\": 167, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_d2i_fp.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 199, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 141, \"covered\": 0, \"notcovered\": 141, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_digest.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 34, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 23, \"covered\": 0, \"notcovered\": 23, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_dup.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 21, \"covered\": 0, \"notcovered\": 21, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_enum.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 106, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 91, \"covered\": 0, \"notcovered\": 91, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_gentm.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 176, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 160, \"covered\": 0, \"notcovered\": 160, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_i2d_fp.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 79, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 47, \"covered\": 0, \"notcovered\": 47, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_int.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 1, \"percent\": 11.11111111111111}, \"instantiations\": {\"count\": 9, \"covered\": 1, \"percent\": 11.11111111111111}, \"lines\": {\"count\": 345, \"covered\": 64, \"percent\": 18.55072463768116}, \"regions\": {\"count\": 266, \"covered\": 39, \"notcovered\": 227, \"percent\": 14.661654135338345}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_mbstr.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 7, \"percent\": 63.63636363636363}, \"instantiations\": {\"count\": 11, \"covered\": 7, \"percent\": 63.63636363636363}, \"lines\": {\"count\": 277, \"covered\": 143, \"percent\": 51.624548736462096}, \"regions\": {\"count\": 225, \"covered\": 102, \"notcovered\": 123, \"percent\": 45.33333333333333}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_object.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 3, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 9, \"covered\": 3, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 316, \"covered\": 91, \"percent\": 28.79746835443038}, \"regions\": {\"count\": 263, \"covered\": 58, \"notcovered\": 205, \"percent\": 22.0532319391635}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_octet.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 6, \"covered\": 0, \"notcovered\": 6, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_print.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 57, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 84, \"covered\": 0, \"notcovered\": 84, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_set.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 155, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 175, \"covered\": 0, \"notcovered\": 175, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_sign.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 189, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 143, \"covered\": 0, \"notcovered\": 143, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_strex.c\", \"summary\": {\"functions\": {\"count\": 14, \"covered\": 1, \"percent\": 7.142857142857142}, \"instantiations\": {\"count\": 14, \"covered\": 1, \"percent\": 7.142857142857142}, \"lines\": {\"count\": 452, \"covered\": 19, \"percent\": 4.20353982300885}, \"regions\": {\"count\": 347, \"covered\": 13, \"notcovered\": 334, \"percent\": 3.7463976945244957}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_strnid.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 94, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 99, \"covered\": 0, \"notcovered\": 99, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_time.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 117, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 98, \"covered\": 0, \"notcovered\": 98, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_type.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 80, \"covered\": 8, \"percent\": 10}, \"regions\": {\"count\": 90, \"covered\": 5, \"notcovered\": 85, \"percent\": 5.555555555555555}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_utctm.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 184, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 176, \"covered\": 0, \"notcovered\": 176, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_utf8.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 151, \"covered\": 31, \"percent\": 20.52980132450331}, \"regions\": {\"count\": 137, \"covered\": 25, \"notcovered\": 112, \"percent\": 18.248175182481752}}}, {\"filename\": \"/src/openssl/crypto/asn1/a_verify.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 148, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 106, \"covered\": 0, \"notcovered\": 106, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/ameth_lib.c\", \"summary\": {\"functions\": {\"count\": 19, \"covered\": 9, \"percent\": 47.368421052631575}, \"instantiations\": {\"count\": 19, \"covered\": 9, \"percent\": 47.368421052631575}, \"lines\": {\"count\": 263, \"covered\": 109, \"percent\": 41.44486692015209}, \"regions\": {\"count\": 169, \"covered\": 44, \"notcovered\": 125, \"percent\": 26.035502958579883}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn1_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn1_gen.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 680, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 560, \"covered\": 0, \"notcovered\": 560, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn1_lib.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 8, \"percent\": 29.629629629629626}, \"instantiations\": {\"count\": 27, \"covered\": 8, \"percent\": 29.629629629629626}, \"lines\": {\"count\": 349, \"covered\": 124, \"percent\": 35.53008595988539}, \"regions\": {\"count\": 251, \"covered\": 81, \"notcovered\": 170, \"percent\": 32.27091633466135}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn1_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn1_par.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 333, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 322, \"covered\": 0, \"notcovered\": 322, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn_mime.c\", \"summary\": {\"functions\": {\"count\": 24, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 24, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 743, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 741, \"covered\": 0, \"notcovered\": 741, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn_moid.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 69, \"covered\": 3, \"percent\": 4.3478260869565215}, \"regions\": {\"count\": 52, \"covered\": 1, \"notcovered\": 51, \"percent\": 1.9230769230769231}}}, {\"filename\": \"/src/openssl/crypto/asn1/asn_pack.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 109, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 96, \"covered\": 0, \"notcovered\": 96, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/bio_asn1.c\", \"summary\": {\"functions\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 298, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 183, \"covered\": 0, \"notcovered\": 183, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/bio_ndef.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 141, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 64, \"covered\": 0, \"notcovered\": 64, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/d2i_pr.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 97, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 99, \"covered\": 0, \"notcovered\": 99, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/evp_asn1.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 117, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 92, \"covered\": 0, \"notcovered\": 92, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/f_int.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 141, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 129, \"covered\": 0, \"notcovered\": 129, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/f_string.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 135, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 118, \"covered\": 0, \"notcovered\": 118, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/i2d_pr.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 16, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 17, \"covered\": 0, \"notcovered\": 17, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/nsseq.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 5, \"covered\": 0, \"notcovered\": 5, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/p5_pbe.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 60, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 51, \"covered\": 0, \"notcovered\": 51, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/p5_pbev2.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 178, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 123, \"covered\": 0, \"notcovered\": 123, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/p8_pkey.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 61, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 55, \"covered\": 0, \"notcovered\": 55, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/t_pkey.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 47, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 49, \"covered\": 0, \"notcovered\": 49, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/t_x509.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 433, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 424, \"covered\": 0, \"notcovered\": 424, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/t_x509a.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 45, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 49, \"covered\": 0, \"notcovered\": 49, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/tasn_dec.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 9, \"percent\": 69.23076923076923}, \"instantiations\": {\"count\": 13, \"covered\": 9, \"percent\": 69.23076923076923}, \"lines\": {\"count\": 1012, \"covered\": 510, \"percent\": 50.39525691699605}, \"regions\": {\"count\": 816, \"covered\": 383, \"notcovered\": 433, \"percent\": 46.93627450980392}}}, {\"filename\": \"/src/openssl/crypto/asn1/tasn_enc.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 5, \"percent\": 50}, \"instantiations\": {\"count\": 10, \"covered\": 5, \"percent\": 50}, \"lines\": {\"count\": 533, \"covered\": 310, \"percent\": 58.16135084427767}, \"regions\": {\"count\": 445, \"covered\": 227, \"notcovered\": 218, \"percent\": 51.01123595505618}}}, {\"filename\": \"/src/openssl/crypto/asn1/tasn_fre.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"instantiations\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"lines\": {\"count\": 170, \"covered\": 130, \"percent\": 76.47058823529412}, \"regions\": {\"count\": 144, \"covered\": 107, \"notcovered\": 37, \"percent\": 74.30555555555556}}}, {\"filename\": \"/src/openssl/crypto/asn1/tasn_new.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 8, \"percent\": 100}, \"instantiations\": {\"count\": 8, \"covered\": 8, \"percent\": 100}, \"lines\": {\"count\": 250, \"covered\": 153, \"percent\": 61.199999999999996}, \"regions\": {\"count\": 220, \"covered\": 124, \"notcovered\": 96, \"percent\": 56.36363636363636}}}, {\"filename\": \"/src/openssl/crypto/asn1/tasn_prn.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 426, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 379, \"covered\": 0, \"notcovered\": 379, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/tasn_utl.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 8, \"percent\": 80}, \"instantiations\": {\"count\": 10, \"covered\": 8, \"percent\": 80}, \"lines\": {\"count\": 152, \"covered\": 83, \"percent\": 54.60526315789473}, \"regions\": {\"count\": 100, \"covered\": 57, \"notcovered\": 43, \"percent\": 56.99999999999999}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_algor.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 58, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 53, \"covered\": 0, \"notcovered\": 53, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_attrib.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 24, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 27, \"covered\": 0, \"notcovered\": 27, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_bignum.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 40, \"covered\": 0, \"notcovered\": 40, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_crl.c\", \"summary\": {\"functions\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 331, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 332, \"covered\": 0, \"notcovered\": 332, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_info.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 38, \"covered\": 34, \"percent\": 89.47368421052632}, \"regions\": {\"count\": 24, \"covered\": 16, \"notcovered\": 8, \"percent\": 66.66666666666666}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_long.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 109, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 55, \"covered\": 0, \"notcovered\": 55, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_name.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 8, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 12, \"covered\": 8, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 345, \"covered\": 218, \"percent\": 63.18840579710145}, \"regions\": {\"count\": 386, \"covered\": 205, \"notcovered\": 181, \"percent\": 53.10880829015544}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_pkey.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 80, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 101, \"covered\": 0, \"notcovered\": 101, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_pubkey.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 1, \"percent\": 7.6923076923076925}, \"instantiations\": {\"count\": 13, \"covered\": 1, \"percent\": 7.6923076923076925}, \"lines\": {\"count\": 252, \"covered\": 7, \"percent\": 2.7777777777777777}, \"regions\": {\"count\": 166, \"covered\": 4, \"notcovered\": 162, \"percent\": 2.4096385542168677}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_req.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 9, \"covered\": 0, \"notcovered\": 9, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_x509.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 1, \"percent\": 10}, \"instantiations\": {\"count\": 10, \"covered\": 1, \"percent\": 10}, \"lines\": {\"count\": 142, \"covered\": 40, \"percent\": 28.169014084507044}, \"regions\": {\"count\": 76, \"covered\": 13, \"notcovered\": 63, \"percent\": 17.105263157894736}}}, {\"filename\": \"/src/openssl/crypto/asn1/x_x509a.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 88, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 134, \"covered\": 0, \"notcovered\": 134, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bf/bf_cfb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 21, \"covered\": 0, \"notcovered\": 21, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bf/bf_ecb.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 10, \"covered\": 0, \"notcovered\": 10, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bf/bf_enc.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 134, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 94, \"covered\": 0, \"notcovered\": 94, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bf/bf_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bf/bf_ofb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 16, \"covered\": 0, \"notcovered\": 16, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bf/bf_skey.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 51, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 25, \"covered\": 0, \"notcovered\": 25, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bio/b_dump.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 109, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 68, \"covered\": 0, \"notcovered\": 68, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bio/b_print.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 6, \"percent\": 50}, \"instantiations\": {\"count\": 12, \"covered\": 6, \"percent\": 50}, \"lines\": {\"count\": 651, \"covered\": 254, \"percent\": 39.01689708141321}, \"regions\": {\"count\": 473, \"covered\": 172, \"notcovered\": 301, \"percent\": 36.36363636363637}}}, {\"filename\": \"/src/openssl/crypto/bio/b_sock.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 455, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 266, \"covered\": 0, \"notcovered\": 266, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bio/bf_buff.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 5, \"percent\": 55.55555555555556}, \"instantiations\": {\"count\": 9, \"covered\": 5, \"percent\": 55.55555555555556}, \"lines\": {\"count\": 409, \"covered\": 125, \"percent\": 30.56234718826406}, \"regions\": {\"count\": 302, \"covered\": 84, \"notcovered\": 218, \"percent\": 27.81456953642384}}}, {\"filename\": \"/src/openssl/crypto/bio/bio_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/bio/bio_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bio/bio_lib.c\", \"summary\": {\"functions\": {\"count\": 38, \"covered\": 15, \"percent\": 39.473684210526315}, \"instantiations\": {\"count\": 38, \"covered\": 15, \"percent\": 39.473684210526315}, \"lines\": {\"count\": 433, \"covered\": 194, \"percent\": 44.80369515011547}, \"regions\": {\"count\": 312, \"covered\": 109, \"notcovered\": 203, \"percent\": 34.93589743589743}}}, {\"filename\": \"/src/openssl/crypto/bio/bss_conn.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 456, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 323, \"covered\": 0, \"notcovered\": 323, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bio/bss_file.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 7, \"percent\": 63.63636363636363}, \"instantiations\": {\"count\": 11, \"covered\": 7, \"percent\": 63.63636363636363}, \"lines\": {\"count\": 233, \"covered\": 88, \"percent\": 37.76824034334764}, \"regions\": {\"count\": 193, \"covered\": 48, \"notcovered\": 145, \"percent\": 24.870466321243523}}}, {\"filename\": \"/src/openssl/crypto/bio/bss_mem.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 5, \"percent\": 55.55555555555556}, \"instantiations\": {\"count\": 9, \"covered\": 5, \"percent\": 55.55555555555556}, \"lines\": {\"count\": 207, \"covered\": 71, \"percent\": 34.29951690821256}, \"regions\": {\"count\": 140, \"covered\": 35, \"notcovered\": 105, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/bio/bss_null.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 51, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 38, \"covered\": 0, \"notcovered\": 38, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bio/bss_sock.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 8, \"percent\": 80}, \"instantiations\": {\"count\": 10, \"covered\": 8, \"percent\": 80}, \"lines\": {\"count\": 145, \"covered\": 83, \"percent\": 57.24137931034483}, \"regions\": {\"count\": 88, \"covered\": 49, \"notcovered\": 39, \"percent\": 55.68181818181818}}}, {\"filename\": \"/src/openssl/crypto/bn/asm/x86_64-gcc.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 372, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 659, \"covered\": 0, \"notcovered\": 659, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_add.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 225, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 132, \"covered\": 0, \"notcovered\": 132, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_blind.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 215, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 173, \"covered\": 0, \"notcovered\": 173, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_ctx.c\", \"summary\": {\"functions\": {\"count\": 16, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 16, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 192, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 110, \"covered\": 0, \"notcovered\": 110, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_div.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 237, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 186, \"covered\": 0, \"notcovered\": 186, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_exp.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1076, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 895, \"covered\": 0, \"notcovered\": 895, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_exp2.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 183, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 170, \"covered\": 0, \"notcovered\": 170, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_gcd.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 567, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 387, \"covered\": 0, \"notcovered\": 387, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_gf2m.c\", \"summary\": {\"functions\": {\"count\": 19, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 19, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 692, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 551, \"covered\": 0, \"notcovered\": 551, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_kron.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 123, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 93, \"covered\": 0, \"notcovered\": 93, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_lib.c\", \"summary\": {\"functions\": {\"count\": 30, \"covered\": 1, \"percent\": 3.3333333333333335}, \"instantiations\": {\"count\": 30, \"covered\": 1, \"percent\": 3.3333333333333335}, \"lines\": {\"count\": 669, \"covered\": 3, \"percent\": 0.4484304932735426}, \"regions\": {\"count\": 463, \"covered\": 3, \"notcovered\": 460, \"percent\": 0.6479481641468683}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_mod.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 146, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 108, \"covered\": 0, \"notcovered\": 108, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_mont.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 284, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 210, \"covered\": 0, \"notcovered\": 210, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_mul.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 894, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 514, \"covered\": 0, \"notcovered\": 514, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_nist.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 661, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 944, \"covered\": 0, \"notcovered\": 944, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_prime.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 341, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 352, \"covered\": 0, \"notcovered\": 352, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_prime.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_print.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 309, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 278, \"covered\": 0, \"notcovered\": 278, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_rand.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 161, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 118, \"covered\": 0, \"notcovered\": 118, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_recp.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 169, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 110, \"covered\": 0, \"notcovered\": 110, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_shift.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 155, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 132, \"covered\": 0, \"notcovered\": 132, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_sqr.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 175, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 90, \"covered\": 0, \"notcovered\": 90, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_sqrt.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 341, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 297, \"covered\": 0, \"notcovered\": 297, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/bn_word.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 169, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 122, \"covered\": 0, \"notcovered\": 122, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/bn/rsaz_exp.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 226, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 15, \"covered\": 0, \"notcovered\": 15, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/buffer/buf_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/buffer/buf_str.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 5, \"percent\": 83.33333333333334}, \"instantiations\": {\"count\": 6, \"covered\": 5, \"percent\": 83.33333333333334}, \"lines\": {\"count\": 63, \"covered\": 47, \"percent\": 74.60317460317461}, \"regions\": {\"count\": 49, \"covered\": 31, \"notcovered\": 18, \"percent\": 63.26530612244898}}}, {\"filename\": \"/src/openssl/crypto/buffer/buffer.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"instantiations\": {\"count\": 5, \"covered\": 4, \"percent\": 80}, \"lines\": {\"count\": 109, \"covered\": 79, \"percent\": 72.47706422018348}, \"regions\": {\"count\": 71, \"covered\": 43, \"notcovered\": 28, \"percent\": 60.56338028169014}}}, {\"filename\": \"/src/openssl/crypto/buildinf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/camellia/cmll_misc.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 15, \"covered\": 0, \"notcovered\": 15, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/camellia/cmll_utl.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cast/c_cfb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 21, \"covered\": 0, \"notcovered\": 21, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cast/c_ecb.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 9, \"covered\": 0, \"notcovered\": 9, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cast/c_enc.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 132, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 160, \"covered\": 0, \"notcovered\": 160, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cast/c_ofb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 16, \"covered\": 0, \"notcovered\": 16, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cast/c_skey.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 92, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 200, \"covered\": 0, \"notcovered\": 200, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cast/cast_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cmac/cm_ameth.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 5, \"covered\": 0, \"notcovered\": 5, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cmac/cm_pmeth.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 73, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 55, \"covered\": 0, \"notcovered\": 55, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cmac/cmac.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 166, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 122, \"covered\": 0, \"notcovered\": 122, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_asn1.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 114, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 80, \"covered\": 0, \"notcovered\": 80, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_att.c\", \"summary\": {\"functions\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 77, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 44, \"covered\": 0, \"notcovered\": 44, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_dd.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 74, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 38, \"covered\": 0, \"notcovered\": 38, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_enc.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 185, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 149, \"covered\": 0, \"notcovered\": 149, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_env.c\", \"summary\": {\"functions\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 795, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 608, \"covered\": 0, \"notcovered\": 608, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_io.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 52, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 34, \"covered\": 0, \"notcovered\": 34, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_kari.c\", \"summary\": {\"functions\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 336, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 299, \"covered\": 0, \"notcovered\": 299, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_lib.c\", \"summary\": {\"functions\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 505, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 475, \"covered\": 0, \"notcovered\": 475, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_pwri.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 343, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 216, \"covered\": 0, \"notcovered\": 216, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cms/cms_sd.c\", \"summary\": {\"functions\": {\"count\": 32, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 32, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 804, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 841, \"covered\": 0, \"notcovered\": 841, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/comp/c_zlib.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 6, \"covered\": 5, \"percent\": 83.33333333333334}, \"regions\": {\"count\": 2, \"covered\": 1, \"notcovered\": 1, \"percent\": 50}}}, {\"filename\": \"/src/openssl/crypto/comp/comp_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/comp/comp_lib.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 51, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 29, \"covered\": 0, \"notcovered\": 29, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/conf/conf_api.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 1, \"percent\": 10}, \"instantiations\": {\"count\": 10, \"covered\": 1, \"percent\": 10}, \"lines\": {\"count\": 154, \"covered\": 3, \"percent\": 1.948051948051948}, \"regions\": {\"count\": 218, \"covered\": 5, \"notcovered\": 213, \"percent\": 2.293577981651376}}}, {\"filename\": \"/src/openssl/crypto/conf/conf_def.c\", \"summary\": {\"functions\": {\"count\": 19, \"covered\": 6, \"percent\": 31.57894736842105}, \"instantiations\": {\"count\": 19, \"covered\": 6, \"percent\": 31.57894736842105}, \"lines\": {\"count\": 537, \"covered\": 44, \"percent\": 8.193668528864059}, \"regions\": {\"count\": 489, \"covered\": 25, \"notcovered\": 464, \"percent\": 5.112474437627812}}}, {\"filename\": \"/src/openssl/crypto/conf/conf_def.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/conf/conf_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/conf/conf_lib.c\", \"summary\": {\"functions\": {\"count\": 22, \"covered\": 3, \"percent\": 13.636363636363635}, \"instantiations\": {\"count\": 22, \"covered\": 3, \"percent\": 13.636363636363635}, \"lines\": {\"count\": 228, \"covered\": 21, \"percent\": 9.210526315789473}, \"regions\": {\"count\": 129, \"covered\": 11, \"notcovered\": 118, \"percent\": 8.527131782945736}}}, {\"filename\": \"/src/openssl/crypto/conf/conf_mall.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 8, \"covered\": 8, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/conf/conf_mod.c\", \"summary\": {\"functions\": {\"count\": 24, \"covered\": 4, \"percent\": 16.666666666666664}, \"instantiations\": {\"count\": 24, \"covered\": 4, \"percent\": 16.666666666666664}, \"lines\": {\"count\": 391, \"covered\": 74, \"percent\": 18.925831202046037}, \"regions\": {\"count\": 317, \"covered\": 48, \"notcovered\": 269, \"percent\": 15.141955835962145}}}, {\"filename\": \"/src/openssl/crypto/constant_time_locl.h\", \"summary\": {\"functions\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 98, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 42, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 14, \"covered\": 0, \"notcovered\": 14, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cpt_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/cryptlib.c\", \"summary\": {\"functions\": {\"count\": 36, \"covered\": 8, \"percent\": 22.22222222222222}, \"instantiations\": {\"count\": 36, \"covered\": 8, \"percent\": 22.22222222222222}, \"lines\": {\"count\": 370, \"covered\": 71, \"percent\": 19.18918918918919}, \"regions\": {\"count\": 287, \"covered\": 28, \"notcovered\": 259, \"percent\": 9.75609756097561}}}, {\"filename\": \"/src/openssl/crypto/cryptlib.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/cversion.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 20, \"covered\": 3, \"percent\": 15}, \"regions\": {\"count\": 26, \"covered\": 2, \"notcovered\": 24, \"percent\": 7.6923076923076925}}}, {\"filename\": \"/src/openssl/crypto/des/cfb64ede.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 158, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 116, \"covered\": 0, \"notcovered\": 116, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/cfb64enc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 23, \"covered\": 0, \"notcovered\": 23, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/cfb_enc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 92, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 85, \"covered\": 0, \"notcovered\": 85, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/des_enc.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 1, \"percent\": 20}, \"instantiations\": {\"count\": 5, \"covered\": 1, \"percent\": 20}, \"lines\": {\"count\": 267, \"covered\": 52, \"percent\": 19.475655430711612}, \"regions\": {\"count\": 374, \"covered\": 83, \"notcovered\": 291, \"percent\": 22.192513368983956}}}, {\"filename\": \"/src/openssl/crypto/des/des_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/ecb3_enc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 19, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 9, \"covered\": 0, \"notcovered\": 9, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/ecb_enc.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 38, \"covered\": 17, \"percent\": 44.73684210526316}, \"regions\": {\"count\": 12, \"covered\": 6, \"notcovered\": 6, \"percent\": 50}}}, {\"filename\": \"/src/openssl/crypto/des/ncbc_enc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 81, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 62, \"covered\": 0, \"notcovered\": 62, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/ofb64ede.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 44, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 16, \"covered\": 0, \"notcovered\": 16, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/ofb64enc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 17, \"covered\": 0, \"notcovered\": 17, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/des/set_key.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 3, \"percent\": 42.857142857142854}, \"instantiations\": {\"count\": 7, \"covered\": 3, \"percent\": 42.857142857142854}, \"lines\": {\"count\": 107, \"covered\": 72, \"percent\": 67.28971962616822}, \"regions\": {\"count\": 52, \"covered\": 27, \"notcovered\": 25, \"percent\": 51.92307692307693}}}, {\"filename\": \"/src/openssl/crypto/des/xcbc_enc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 86, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 66, \"covered\": 0, \"notcovered\": 66, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_ameth.c\", \"summary\": {\"functions\": {\"count\": 29, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 29, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 738, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 595, \"covered\": 0, \"notcovered\": 595, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_asn1.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 69, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 36, \"covered\": 0, \"notcovered\": 36, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_check.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 104, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 162, \"covered\": 0, \"notcovered\": 162, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_gen.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 77, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 71, \"covered\": 0, \"notcovered\": 71, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_kdf.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 107, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 82, \"covered\": 0, \"notcovered\": 82, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_key.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 1, \"percent\": 11.11111111111111}, \"instantiations\": {\"count\": 9, \"covered\": 1, \"percent\": 11.11111111111111}, \"lines\": {\"count\": 172, \"covered\": 3, \"percent\": 1.744186046511628}, \"regions\": {\"count\": 141, \"covered\": 1, \"notcovered\": 140, \"percent\": 0.7092198581560284}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_lib.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 141, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 87, \"covered\": 0, \"notcovered\": 87, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_pmeth.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 318, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 223, \"covered\": 0, \"notcovered\": 223, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dh/dh_rfc5114.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 17, \"covered\": 0, \"notcovered\": 17, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_ameth.c\", \"summary\": {\"functions\": {\"count\": 22, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 22, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 498, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 407, \"covered\": 0, \"notcovered\": 407, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_asn1.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 68, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 45, \"covered\": 0, \"notcovered\": 45, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_gen.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 604, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 503, \"covered\": 0, \"notcovered\": 503, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_key.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 58, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 48, \"covered\": 0, \"notcovered\": 48, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_lib.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 1, \"percent\": 8.333333333333332}, \"instantiations\": {\"count\": 12, \"covered\": 1, \"percent\": 8.333333333333332}, \"lines\": {\"count\": 197, \"covered\": 6, \"percent\": 3.0456852791878175}, \"regions\": {\"count\": 121, \"covered\": 3, \"notcovered\": 118, \"percent\": 2.479338842975207}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_ossl.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 1, \"percent\": 16.666666666666664}, \"instantiations\": {\"count\": 6, \"covered\": 1, \"percent\": 16.666666666666664}, \"lines\": {\"count\": 299, \"covered\": 3, \"percent\": 1.0033444816053512}, \"regions\": {\"count\": 248, \"covered\": 1, \"notcovered\": 247, \"percent\": 0.4032258064516129}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_pmeth.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 158, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 132, \"covered\": 0, \"notcovered\": 132, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_sign.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 22, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 15, \"covered\": 0, \"notcovered\": 15, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dsa/dsa_vrf.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/dso/dso_dlfcn.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 4, \"percent\": 44.44444444444444}, \"instantiations\": {\"count\": 9, \"covered\": 4, \"percent\": 44.44444444444444}, \"lines\": {\"count\": 235, \"covered\": 53, \"percent\": 22.5531914893617}, \"regions\": {\"count\": 212, \"covered\": 40, \"notcovered\": 172, \"percent\": 18.867924528301888}}}, {\"filename\": \"/src/openssl/crypto/dso/dso_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/dso/dso_lib.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 7, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 21, \"covered\": 7, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 321, \"covered\": 116, \"percent\": 36.13707165109034}, \"regions\": {\"count\": 287, \"covered\": 96, \"notcovered\": 191, \"percent\": 33.44947735191638}}}, {\"filename\": \"/src/openssl/crypto/dso/dso_openssl.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/ec/ec2_mult.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 318, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 291, \"covered\": 0, \"notcovered\": 291, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec2_oct.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 290, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 254, \"covered\": 0, \"notcovered\": 254, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec2_smpl.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 562, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 412, \"covered\": 0, \"notcovered\": 412, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_ameth.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 795, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 678, \"covered\": 0, \"notcovered\": 678, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_asn1.c\", \"summary\": {\"functions\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1034, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 910, \"covered\": 0, \"notcovered\": 910, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_curve.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 160, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 137, \"covered\": 0, \"notcovered\": 137, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_cvt.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 81, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 33, \"covered\": 0, \"notcovered\": 33, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_key.c\", \"summary\": {\"functions\": {\"count\": 26, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 26, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 412, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 305, \"covered\": 0, \"notcovered\": 305, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_lib.c\", \"summary\": {\"functions\": {\"count\": 60, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 60, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 868, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 672, \"covered\": 0, \"notcovered\": 672, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_mult.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 751, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 513, \"covered\": 0, \"notcovered\": 513, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_oct.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 87, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 88, \"covered\": 0, \"notcovered\": 88, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_pmeth.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 336, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 282, \"covered\": 0, \"notcovered\": 282, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ec_print.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 104, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 66, \"covered\": 0, \"notcovered\": 66, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/eck_prn.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 289, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 259, \"covered\": 0, \"notcovered\": 259, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_mont.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 207, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 106, \"covered\": 0, \"notcovered\": 106, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_nist.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 130, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 84, \"covered\": 0, \"notcovered\": 84, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_nistp224.c\", \"summary\": {\"functions\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1273, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 405, \"covered\": 0, \"notcovered\": 405, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_nistp521.c\", \"summary\": {\"functions\": {\"count\": 42, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 42, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1596, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 395, \"covered\": 0, \"notcovered\": 395, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_nistputil.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 73, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 63, \"covered\": 0, \"notcovered\": 63, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_nistz256.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 886, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 476, \"covered\": 0, \"notcovered\": 476, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_oct.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 347, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 294, \"covered\": 0, \"notcovered\": 294, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ec/ecp_smpl.c\", \"summary\": {\"functions\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1244, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 938, \"covered\": 0, \"notcovered\": 938, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdh/ech_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/ecdh/ech_kdf.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 44, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 38, \"covered\": 0, \"notcovered\": 38, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdh/ech_key.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 4, \"covered\": 0, \"notcovered\": 4, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdh/ech_lib.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 129, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 61, \"covered\": 0, \"notcovered\": 61, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdh/ech_ossl.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 112, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 86, \"covered\": 0, \"notcovered\": 86, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdsa/ecs_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/ecdsa/ecs_lib.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 209, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 99, \"covered\": 0, \"notcovered\": 99, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdsa/ecs_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdsa/ecs_ossl.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 383, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 337, \"covered\": 0, \"notcovered\": 337, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdsa/ecs_sign.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 30, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 14, \"covered\": 0, \"notcovered\": 14, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ecdsa/ecs_vrf.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 31, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 20, \"covered\": 0, \"notcovered\": 20, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_all.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 41, \"covered\": 41, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_cnf.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 1, \"percent\": 20}, \"instantiations\": {\"count\": 5, \"covered\": 1, \"percent\": 20}, \"lines\": {\"count\": 49, \"covered\": 4, \"percent\": 8.16326530612245}, \"regions\": {\"count\": 59, \"covered\": 1, \"notcovered\": 58, \"percent\": 1.694915254237288}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_ctrl.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 287, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 254, \"covered\": 0, \"notcovered\": 254, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_dyn.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 2, \"percent\": 18.181818181818183}, \"instantiations\": {\"count\": 11, \"covered\": 2, \"percent\": 18.181818181818183}, \"lines\": {\"count\": 360, \"covered\": 28, \"percent\": 7.777777777777778}, \"regions\": {\"count\": 275, \"covered\": 21, \"notcovered\": 254, \"percent\": 7.636363636363637}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_fat.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 2, \"percent\": 50}, \"instantiations\": {\"count\": 4, \"covered\": 2, \"percent\": 50}, \"lines\": {\"count\": 75, \"covered\": 30, \"percent\": 40}, \"regions\": {\"count\": 75, \"covered\": 8, \"notcovered\": 67, \"percent\": 10.666666666666668}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_init.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 76, \"covered\": 12, \"percent\": 15.789473684210526}, \"regions\": {\"count\": 59, \"covered\": 6, \"notcovered\": 53, \"percent\": 10.16949152542373}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_lib.c\", \"summary\": {\"functions\": {\"count\": 30, \"covered\": 15, \"percent\": 50}, \"instantiations\": {\"count\": 30, \"covered\": 15, \"percent\": 50}, \"lines\": {\"count\": 186, \"covered\": 86, \"percent\": 46.236559139784944}, \"regions\": {\"count\": 113, \"covered\": 59, \"notcovered\": 54, \"percent\": 52.21238938053098}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_list.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 4, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 12, \"covered\": 4, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 276, \"covered\": 72, \"percent\": 26.08695652173913}, \"regions\": {\"count\": 204, \"covered\": 55, \"notcovered\": 149, \"percent\": 26.96078431372549}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_pkey.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 2, \"percent\": 22.22222222222222}, \"instantiations\": {\"count\": 9, \"covered\": 2, \"percent\": 22.22222222222222}, \"lines\": {\"count\": 99, \"covered\": 8, \"percent\": 8.080808080808081}, \"regions\": {\"count\": 97, \"covered\": 2, \"notcovered\": 95, \"percent\": 2.0618556701030926}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_rdrand.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 3, \"percent\": 50}, \"instantiations\": {\"count\": 6, \"covered\": 3, \"percent\": 50}, \"lines\": {\"count\": 58, \"covered\": 26, \"percent\": 44.827586206896555}, \"regions\": {\"count\": 41, \"covered\": 22, \"notcovered\": 19, \"percent\": 53.65853658536586}}}, {\"filename\": \"/src/openssl/crypto/engine/eng_table.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 6, \"percent\": 46.15384615384615}, \"instantiations\": {\"count\": 13, \"covered\": 6, \"percent\": 46.15384615384615}, \"lines\": {\"count\": 186, \"covered\": 109, \"percent\": 58.602150537634415}, \"regions\": {\"count\": 232, \"covered\": 117, \"notcovered\": 115, \"percent\": 50.43103448275862}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_asnmth.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 2, \"percent\": 15.384615384615385}, \"instantiations\": {\"count\": 13, \"covered\": 2, \"percent\": 15.384615384615385}, \"lines\": {\"count\": 119, \"covered\": 18, \"percent\": 15.126050420168067}, \"regions\": {\"count\": 80, \"covered\": 9, \"notcovered\": 71, \"percent\": 11.25}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_cipher.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 2, \"percent\": 22.22222222222222}, \"instantiations\": {\"count\": 9, \"covered\": 2, \"percent\": 22.22222222222222}, \"lines\": {\"count\": 53, \"covered\": 15, \"percent\": 28.30188679245283}, \"regions\": {\"count\": 29, \"covered\": 7, \"notcovered\": 22, \"percent\": 24.137931034482758}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_dh.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"instantiations\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"lines\": {\"count\": 36, \"covered\": 11, \"percent\": 30.555555555555557}, \"regions\": {\"count\": 17, \"covered\": 5, \"notcovered\": 12, \"percent\": 29.411764705882355}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_digest.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 3, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 9, \"covered\": 3, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 53, \"covered\": 18, \"percent\": 33.9622641509434}, \"regions\": {\"count\": 29, \"covered\": 8, \"notcovered\": 21, \"percent\": 27.586206896551722}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_dsa.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"instantiations\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"lines\": {\"count\": 36, \"covered\": 11, \"percent\": 30.555555555555557}, \"regions\": {\"count\": 17, \"covered\": 5, \"notcovered\": 12, \"percent\": 29.411764705882355}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_ecdh.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 1, \"percent\": 12.5}, \"instantiations\": {\"count\": 8, \"covered\": 1, \"percent\": 12.5}, \"lines\": {\"count\": 36, \"covered\": 4, \"percent\": 11.11111111111111}, \"regions\": {\"count\": 17, \"covered\": 3, \"notcovered\": 14, \"percent\": 17.647058823529413}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_ecdsa.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 1, \"percent\": 12.5}, \"instantiations\": {\"count\": 8, \"covered\": 1, \"percent\": 12.5}, \"lines\": {\"count\": 36, \"covered\": 4, \"percent\": 11.11111111111111}, \"regions\": {\"count\": 17, \"covered\": 3, \"notcovered\": 14, \"percent\": 17.647058823529413}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_pkmeth.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 2, \"percent\": 20}, \"instantiations\": {\"count\": 10, \"covered\": 2, \"percent\": 20}, \"lines\": {\"count\": 68, \"covered\": 15, \"percent\": 22.058823529411764}, \"regions\": {\"count\": 37, \"covered\": 7, \"notcovered\": 30, \"percent\": 18.91891891891892}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_rand.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 3, \"percent\": 37.5}, \"instantiations\": {\"count\": 8, \"covered\": 3, \"percent\": 37.5}, \"lines\": {\"count\": 36, \"covered\": 14, \"percent\": 38.88888888888889}, \"regions\": {\"count\": 17, \"covered\": 6, \"notcovered\": 11, \"percent\": 35.294117647058826}}}, {\"filename\": \"/src/openssl/crypto/engine/tb_rsa.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"instantiations\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"lines\": {\"count\": 36, \"covered\": 11, \"percent\": 30.555555555555557}, \"regions\": {\"count\": 17, \"covered\": 5, \"notcovered\": 12, \"percent\": 29.411764705882355}}}, {\"filename\": \"/src/openssl/crypto/err/err.c\", \"summary\": {\"functions\": {\"count\": 54, \"covered\": 37, \"percent\": 68.51851851851852}, \"instantiations\": {\"count\": 54, \"covered\": 37, \"percent\": 68.51851851851852}, \"lines\": {\"count\": 660, \"covered\": 486, \"percent\": 73.63636363636363}, \"regions\": {\"count\": 598, \"covered\": 423, \"notcovered\": 175, \"percent\": 70.73578595317726}}}, {\"filename\": \"/src/openssl/crypto/err/err_all.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 49, \"covered\": 49, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/err/err_prn.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 36, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 14, \"covered\": 0, \"notcovered\": 14, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/bio_b64.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 446, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 321, \"covered\": 0, \"notcovered\": 321, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/bio_enc.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 296, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 183, \"covered\": 0, \"notcovered\": 183, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/bio_md.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 157, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 115, \"covered\": 0, \"notcovered\": 115, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/c_all.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 10, \"covered\": 10, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/evp/c_allc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 176, \"covered\": 176, \"percent\": 100}, \"regions\": {\"count\": 115, \"covered\": 115, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/evp/c_alld.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 49, \"covered\": 49, \"percent\": 100}, \"regions\": {\"count\": 28, \"covered\": 28, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/evp/digest.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 5, \"percent\": 41.66666666666667}, \"instantiations\": {\"count\": 12, \"covered\": 5, \"percent\": 41.66666666666667}, \"lines\": {\"count\": 221, \"covered\": 78, \"percent\": 35.294117647058826}, \"regions\": {\"count\": 167, \"covered\": 56, \"notcovered\": 111, \"percent\": 33.532934131736525}}}, {\"filename\": \"/src/openssl/crypto/evp/e_aes.c\", \"summary\": {\"functions\": {\"count\": 33, \"covered\": 5, \"percent\": 15.151515151515152}, \"instantiations\": {\"count\": 60, \"covered\": 32, \"percent\": 53.333333333333336}, \"lines\": {\"count\": 939, \"covered\": 13, \"percent\": 1.384451544195953}, \"regions\": {\"count\": 678, \"covered\": 9, \"notcovered\": 669, \"percent\": 1.3274336283185841}}}, {\"filename\": \"/src/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 2, \"percent\": 28.57142857142857}, \"instantiations\": {\"count\": 7, \"covered\": 2, \"percent\": 28.57142857142857}, \"lines\": {\"count\": 641, \"covered\": 8, \"percent\": 1.24804992199688}, \"regions\": {\"count\": 310, \"covered\": 6, \"notcovered\": 304, \"percent\": 1.935483870967742}}}, {\"filename\": \"/src/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 2, \"percent\": 28.57142857142857}, \"instantiations\": {\"count\": 7, \"covered\": 2, \"percent\": 28.57142857142857}, \"lines\": {\"count\": 682, \"covered\": 8, \"percent\": 1.1730205278592376}, \"regions\": {\"count\": 317, \"covered\": 8, \"notcovered\": 309, \"percent\": 2.5236593059936907}}}, {\"filename\": \"/src/openssl/crypto/evp/e_bf.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 3, \"covered\": 0, \"notcovered\": 3, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/e_camellia.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 1, \"percent\": 12.5}, \"instantiations\": {\"count\": 25, \"covered\": 18, \"percent\": 72}, \"lines\": {\"count\": 92, \"covered\": 2, \"percent\": 2.1739130434782608}, \"regions\": {\"count\": 51, \"covered\": 1, \"notcovered\": 50, \"percent\": 1.9607843137254901}}}, {\"filename\": \"/src/openssl/crypto/evp/e_cast.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 3, \"covered\": 0, \"notcovered\": 3, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/e_des.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 110, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 75, \"covered\": 0, \"notcovered\": 75, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/e_des3.c\", \"summary\": {\"functions\": {\"count\": 15, \"covered\": 3, \"percent\": 20}, \"instantiations\": {\"count\": 15, \"covered\": 3, \"percent\": 20}, \"lines\": {\"count\": 227, \"covered\": 9, \"percent\": 3.9647577092511015}, \"regions\": {\"count\": 175, \"covered\": 3, \"notcovered\": 172, \"percent\": 1.7142857142857144}}}, {\"filename\": \"/src/openssl/crypto/evp/e_idea.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 23, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 26, \"covered\": 0, \"notcovered\": 26, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/e_null.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 5, \"covered\": 0, \"notcovered\": 5, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/e_rc2.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"instantiations\": {\"count\": 8, \"covered\": 2, \"percent\": 25}, \"lines\": {\"count\": 90, \"covered\": 6, \"percent\": 6.666666666666667}, \"regions\": {\"count\": 70, \"covered\": 2, \"notcovered\": 68, \"percent\": 2.857142857142857}}}, {\"filename\": \"/src/openssl/crypto/evp/e_rc4.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 2, \"percent\": 50}, \"instantiations\": {\"count\": 4, \"covered\": 2, \"percent\": 50}, \"lines\": {\"count\": 14, \"covered\": 6, \"percent\": 42.857142857142854}, \"regions\": {\"count\": 6, \"covered\": 2, \"notcovered\": 4, \"percent\": 33.33333333333333}}}, {\"filename\": \"/src/openssl/crypto/evp/e_rc4_hmac_md5.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 184, \"covered\": 3, \"percent\": 1.6304347826086956}, \"regions\": {\"count\": 96, \"covered\": 1, \"notcovered\": 95, \"percent\": 1.0416666666666665}}}, {\"filename\": \"/src/openssl/crypto/evp/e_rc5.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 32, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 30, \"covered\": 0, \"notcovered\": 30, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/e_seed.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/e_xcbc_d.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 27, \"covered\": 3, \"percent\": 11.11111111111111}, \"regions\": {\"count\": 21, \"covered\": 1, \"notcovered\": 20, \"percent\": 4.761904761904762}}}, {\"filename\": \"/src/openssl/crypto/evp/encode.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 5, \"percent\": 55.55555555555556}, \"instantiations\": {\"count\": 9, \"covered\": 5, \"percent\": 55.55555555555556}, \"lines\": {\"count\": 253, \"covered\": 112, \"percent\": 44.26877470355731}, \"regions\": {\"count\": 159, \"covered\": 86, \"notcovered\": 73, \"percent\": 54.088050314465406}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_cnf.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 35, \"covered\": 3, \"percent\": 8.571428571428571}, \"regions\": {\"count\": 35, \"covered\": 1, \"notcovered\": 34, \"percent\": 2.857142857142857}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_enc.c\", \"summary\": {\"functions\": {\"count\": 24, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 24, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 516, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 406, \"covered\": 0, \"notcovered\": 406, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_key.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 111, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 102, \"covered\": 0, \"notcovered\": 102, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_lib.c\", \"summary\": {\"functions\": {\"count\": 31, \"covered\": 4, \"percent\": 12.903225806451612}, \"instantiations\": {\"count\": 31, \"covered\": 4, \"percent\": 12.903225806451612}, \"lines\": {\"count\": 217, \"covered\": 13, \"percent\": 5.990783410138248}, \"regions\": {\"count\": 150, \"covered\": 8, \"notcovered\": 142, \"percent\": 5.333333333333334}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_locl.h\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 1, \"percent\": 20}, \"instantiations\": {\"count\": 63, \"covered\": 38, \"percent\": 60.317460317460316}, \"lines\": {\"count\": 48, \"covered\": 1, \"percent\": 2.083333333333333}, \"regions\": {\"count\": 47, \"covered\": 1, \"notcovered\": 46, \"percent\": 2.127659574468085}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_pbe.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 137, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 123, \"covered\": 0, \"notcovered\": 123, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/evp_pkey.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 125, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 83, \"covered\": 0, \"notcovered\": 83, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/m_dss.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_dss1.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_ecdsa.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_md4.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_md5.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_mdc2.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_ripemd.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_sha.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/m_sha1.c\", \"summary\": {\"functions\": {\"count\": 16, \"covered\": 8, \"percent\": 50}, \"instantiations\": {\"count\": 16, \"covered\": 8, \"percent\": 50}, \"lines\": {\"count\": 48, \"covered\": 24, \"percent\": 50}, \"regions\": {\"count\": 16, \"covered\": 8, \"notcovered\": 8, \"percent\": 50}}}, {\"filename\": \"/src/openssl/crypto/evp/m_sigver.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 122, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 118, \"covered\": 0, \"notcovered\": 118, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/m_wp.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"instantiations\": {\"count\": 4, \"covered\": 1, \"percent\": 25}, \"lines\": {\"count\": 12, \"covered\": 3, \"percent\": 25}, \"regions\": {\"count\": 4, \"covered\": 1, \"notcovered\": 3, \"percent\": 25}}}, {\"filename\": \"/src/openssl/crypto/evp/names.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 4, \"percent\": 36.36363636363637}, \"instantiations\": {\"count\": 11, \"covered\": 4, \"percent\": 36.36363636363637}, \"lines\": {\"count\": 110, \"covered\": 51, \"percent\": 46.36363636363636}, \"regions\": {\"count\": 55, \"covered\": 30, \"notcovered\": 25, \"percent\": 54.54545454545454}}}, {\"filename\": \"/src/openssl/crypto/evp/p5_crpt.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 75, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 66, \"covered\": 0, \"notcovered\": 66, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/p5_crpt2.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 200, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 138, \"covered\": 0, \"notcovered\": 138, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/p_lib.c\", \"summary\": {\"functions\": {\"count\": 31, \"covered\": 1, \"percent\": 3.225806451612903}, \"instantiations\": {\"count\": 31, \"covered\": 1, \"percent\": 3.225806451612903}, \"lines\": {\"count\": 291, \"covered\": 5, \"percent\": 1.718213058419244}, \"regions\": {\"count\": 242, \"covered\": 3, \"notcovered\": 239, \"percent\": 1.2396694214876034}}}, {\"filename\": \"/src/openssl/crypto/evp/p_sign.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 55, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 50, \"covered\": 0, \"notcovered\": 50, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/p_verify.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 50, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 47, \"covered\": 0, \"notcovered\": 47, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/pmeth_fn.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 229, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 355, \"covered\": 0, \"notcovered\": 355, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/pmeth_gn.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 130, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 119, \"covered\": 0, \"notcovered\": 119, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/evp/pmeth_lib.c\", \"summary\": {\"functions\": {\"count\": 50, \"covered\": 13, \"percent\": 26}, \"instantiations\": {\"count\": 50, \"covered\": 13, \"percent\": 26}, \"lines\": {\"count\": 420, \"covered\": 57, \"percent\": 13.571428571428571}, \"regions\": {\"count\": 296, \"covered\": 17, \"notcovered\": 279, \"percent\": 5.743243243243244}}}, {\"filename\": \"/src/openssl/crypto/ex_data.c\", \"summary\": {\"functions\": {\"count\": 24, \"covered\": 13, \"percent\": 54.166666666666664}, \"instantiations\": {\"count\": 24, \"covered\": 13, \"percent\": 54.166666666666664}, \"lines\": {\"count\": 296, \"covered\": 160, \"percent\": 54.054054054054056}, \"regions\": {\"count\": 436, \"covered\": 224, \"notcovered\": 212, \"percent\": 51.37614678899083}}}, {\"filename\": \"/src/openssl/crypto/hmac/hm_ameth.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 52, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 32, \"covered\": 0, \"notcovered\": 32, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/hmac/hm_pmeth.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 118, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 75, \"covered\": 0, \"notcovered\": 75, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/hmac/hmac.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 138, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 124, \"covered\": 0, \"notcovered\": 124, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/idea/i_cbc.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 105, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 202, \"covered\": 0, \"notcovered\": 202, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/idea/i_cfb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 20, \"covered\": 0, \"notcovered\": 20, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/idea/i_ecb.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 9, \"covered\": 0, \"notcovered\": 9, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/idea/i_ofb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 15, \"covered\": 0, \"notcovered\": 15, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/idea/i_skey.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 93, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 33, \"covered\": 0, \"notcovered\": 33, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/idea/idea_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/lhash/lhash.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 11, \"percent\": 84.61538461538461}, \"instantiations\": {\"count\": 13, \"covered\": 11, \"percent\": 84.61538461538461}, \"lines\": {\"count\": 310, \"covered\": 239, \"percent\": 77.09677419354838}, \"regions\": {\"count\": 136, \"covered\": 97, \"notcovered\": 39, \"percent\": 71.32352941176471}}}, {\"filename\": \"/src/openssl/crypto/md32_common.h\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 18, \"covered\": 6, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 91, \"covered\": 87, \"percent\": 95.6043956043956}, \"regions\": {\"count\": 84, \"covered\": 58, \"notcovered\": 26, \"percent\": 69.04761904761905}}}, {\"filename\": \"/src/openssl/crypto/md4/md4_dgst.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 112, \"covered\": 112, \"percent\": 100}, \"regions\": {\"count\": 184, \"covered\": 184, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/md4/md4_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/md5/md5_dgst.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 8, \"covered\": 8, \"percent\": 100}, \"regions\": {\"count\": 5, \"covered\": 5, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/md5/md5_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/mdc2/mdc2dgst.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 90, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 41, \"covered\": 0, \"notcovered\": 41, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/mem.c\", \"summary\": {\"functions\": {\"count\": 23, \"covered\": 5, \"percent\": 21.73913043478261}, \"instantiations\": {\"count\": 23, \"covered\": 5, \"percent\": 21.73913043478261}, \"lines\": {\"count\": 234, \"covered\": 42, \"percent\": 17.94871794871795}, \"regions\": {\"count\": 170, \"covered\": 19, \"notcovered\": 151, \"percent\": 11.176470588235295}}}, {\"filename\": \"/src/openssl/crypto/mem_dbg.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 4, \"percent\": 19.047619047619047}, \"instantiations\": {\"count\": 21, \"covered\": 4, \"percent\": 19.047619047619047}, \"lines\": {\"count\": 490, \"covered\": 45, \"percent\": 9.183673469387756}, \"regions\": {\"count\": 403, \"covered\": 25, \"notcovered\": 378, \"percent\": 6.20347394540943}}}, {\"filename\": \"/src/openssl/crypto/modes/cbc128.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 135, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 83, \"covered\": 0, \"notcovered\": 83, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/ccm128.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 359, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 139, \"covered\": 0, \"notcovered\": 139, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/cfb128.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 164, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 85, \"covered\": 0, \"notcovered\": 85, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/ctr128.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 165, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 64, \"covered\": 0, \"notcovered\": 64, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/gcm128.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 732, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 376, \"covered\": 0, \"notcovered\": 376, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/modes_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/ofb128.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 55, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 26, \"covered\": 0, \"notcovered\": 26, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/wrap128.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 62, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 41, \"covered\": 0, \"notcovered\": 41, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/modes/xts128.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 120, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 35, \"covered\": 0, \"notcovered\": 35, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/o_init.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 5, \"covered\": 5, \"percent\": 100}, \"regions\": {\"count\": 4, \"covered\": 4, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/o_time.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 122, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 50, \"covered\": 0, \"notcovered\": 50, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/objects/o_names.c\", \"summary\": {\"functions\": {\"count\": 15, \"covered\": 5, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 15, \"covered\": 5, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 258, \"covered\": 87, \"percent\": 33.72093023255814}, \"regions\": {\"count\": 296, \"covered\": 75, \"notcovered\": 221, \"percent\": 25.33783783783784}}}, {\"filename\": \"/src/openssl/crypto/objects/obj_dat.c\", \"summary\": {\"functions\": {\"count\": 25, \"covered\": 8, \"percent\": 32}, \"instantiations\": {\"count\": 25, \"covered\": 8, \"percent\": 32}, \"lines\": {\"count\": 567, \"covered\": 87, \"percent\": 15.343915343915343}, \"regions\": {\"count\": 541, \"covered\": 80, \"notcovered\": 461, \"percent\": 14.78743068391867}}}, {\"filename\": \"/src/openssl/crypto/objects/obj_dat.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/objects/obj_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/objects/obj_lib.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 68, \"covered\": 31, \"percent\": 45.588235294117645}, \"regions\": {\"count\": 51, \"covered\": 20, \"notcovered\": 31, \"percent\": 39.21568627450981}}}, {\"filename\": \"/src/openssl/crypto/objects/obj_xref.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 108, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 133, \"covered\": 0, \"notcovered\": 133, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ocsp/ocsp_cl.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 219, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 209, \"covered\": 0, \"notcovered\": 209, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ocsp/ocsp_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/ocsp/ocsp_ht.c\", \"summary\": {\"functions\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 402, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 328, \"covered\": 0, \"notcovered\": 328, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ocsp/ocsp_lib.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 192, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 118, \"covered\": 0, \"notcovered\": 118, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ocsp/ocsp_prn.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 210, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 226, \"covered\": 0, \"notcovered\": 226, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ocsp/ocsp_vfy.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 338, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 348, \"covered\": 0, \"notcovered\": 348, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pem/pem_all.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 72, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 33, \"covered\": 0, \"notcovered\": 33, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pem/pem_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/pem/pem_info.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 310, \"covered\": 86, \"percent\": 27.741935483870968}, \"regions\": {\"count\": 294, \"covered\": 72, \"notcovered\": 222, \"percent\": 24.489795918367346}}}, {\"filename\": \"/src/openssl/crypto/pem/pem_lib.c\", \"summary\": {\"functions\": {\"count\": 14, \"covered\": 3, \"percent\": 21.428571428571427}, \"instantiations\": {\"count\": 14, \"covered\": 3, \"percent\": 21.428571428571427}, \"lines\": {\"count\": 605, \"covered\": 118, \"percent\": 19.50413223140496}, \"regions\": {\"count\": 476, \"covered\": 71, \"notcovered\": 405, \"percent\": 14.915966386554622}}}, {\"filename\": \"/src/openssl/crypto/pem/pem_oth.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 15, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 8, \"covered\": 0, \"notcovered\": 8, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pem/pem_pk8.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 124, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 81, \"covered\": 0, \"notcovered\": 81, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pem/pem_pkey.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 163, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 116, \"covered\": 0, \"notcovered\": 116, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_add.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 158, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 120, \"covered\": 0, \"notcovered\": 120, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_attr.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 62, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 73, \"covered\": 0, \"notcovered\": 73, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_crpt.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 49, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 40, \"covered\": 0, \"notcovered\": 40, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_decr.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 92, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 66, \"covered\": 0, \"notcovered\": 66, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_key.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 117, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 117, \"covered\": 0, \"notcovered\": 117, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_kiss.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 210, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 269, \"covered\": 0, \"notcovered\": 269, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_mutl.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 114, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 111, \"covered\": 0, \"notcovered\": 111, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_p8d.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 2, \"covered\": 0, \"notcovered\": 2, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_p8e.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 38, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 26, \"covered\": 0, \"notcovered\": 26, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/p12_utl.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 76, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 69, \"covered\": 0, \"notcovered\": 69, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs12/pk12err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/pkcs7/pk7_asn1.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 38, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 27, \"covered\": 0, \"notcovered\": 27, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs7/pk7_attr.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 82, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 82, \"covered\": 0, \"notcovered\": 82, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs7/pk7_doit.c\", \"summary\": {\"functions\": {\"count\": 24, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 24, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1136, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1049, \"covered\": 0, \"notcovered\": 1049, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs7/pk7_lib.c\", \"summary\": {\"functions\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 540, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 449, \"covered\": 0, \"notcovered\": 449, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/pkcs7/pkcs7err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/pqueue/pqueue.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 137, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 69, \"covered\": 0, \"notcovered\": 69, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rand/md_rand.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 5, \"percent\": 62.5}, \"instantiations\": {\"count\": 8, \"covered\": 5, \"percent\": 62.5}, \"lines\": {\"count\": 405, \"covered\": 349, \"percent\": 86.17283950617283}, \"regions\": {\"count\": 273, \"covered\": 231, \"notcovered\": 42, \"percent\": 84.61538461538461}}}, {\"filename\": \"/src/openssl/crypto/rand/rand_egd.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 148, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 75, \"covered\": 0, \"notcovered\": 75, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rand/rand_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/rand/rand_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rand/rand_lib.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 4, \"percent\": 44.44444444444444}, \"instantiations\": {\"count\": 9, \"covered\": 4, \"percent\": 44.44444444444444}, \"lines\": {\"count\": 79, \"covered\": 25, \"percent\": 31.645569620253166}, \"regions\": {\"count\": 55, \"covered\": 21, \"notcovered\": 34, \"percent\": 38.18181818181819}}}, {\"filename\": \"/src/openssl/crypto/rand/rand_unix.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 133, \"covered\": 114, \"percent\": 85.71428571428571}, \"regions\": {\"count\": 57, \"covered\": 37, \"notcovered\": 20, \"percent\": 64.91228070175438}}}, {\"filename\": \"/src/openssl/crypto/rand/randfile.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 159, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 89, \"covered\": 0, \"notcovered\": 89, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc2/rc2_cbc.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 161, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 75, \"covered\": 0, \"notcovered\": 75, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc2/rc2_ecb.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 8, \"covered\": 0, \"notcovered\": 8, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc2/rc2_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc2/rc2_skey.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 45, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 19, \"covered\": 0, \"notcovered\": 19, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc2/rc2cfb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 20, \"covered\": 0, \"notcovered\": 20, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc2/rc2ofb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 15, \"covered\": 0, \"notcovered\": 15, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc4/rc4_utl.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc5/rc5_ecb.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 8, \"covered\": 0, \"notcovered\": 8, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc5/rc5_enc.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 140, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 271, \"covered\": 0, \"notcovered\": 271, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc5/rc5_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc5/rc5_skey.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 47, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 50, \"covered\": 0, \"notcovered\": 50, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc5/rc5cfb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 20, \"covered\": 0, \"notcovered\": 20, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rc5/rc5ofb64.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 15, \"covered\": 0, \"notcovered\": 15, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ripemd/rmd_dgst.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 249, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 841, \"covered\": 0, \"notcovered\": 841, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ripemd/rmd_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_ameth.c\", \"summary\": {\"functions\": {\"count\": 32, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 32, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 751, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 780, \"covered\": 0, \"notcovered\": 780, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_asn1.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 19, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 16, \"covered\": 0, \"notcovered\": 16, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_crpt.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 122, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 88, \"covered\": 0, \"notcovered\": 88, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_eay.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 1, \"percent\": 9.090909090909092}, \"instantiations\": {\"count\": 11, \"covered\": 1, \"percent\": 9.090909090909092}, \"lines\": {\"count\": 724, \"covered\": 3, \"percent\": 0.4143646408839779}, \"regions\": {\"count\": 598, \"covered\": 1, \"notcovered\": 597, \"percent\": 0.16722408026755853}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_gen.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 151, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 178, \"covered\": 0, \"notcovered\": 178, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_lib.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 207, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 118, \"covered\": 0, \"notcovered\": 118, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_none.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 25, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 17, \"covered\": 0, \"notcovered\": 17, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_oaep.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 232, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 129, \"covered\": 0, \"notcovered\": 129, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_pk1.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 196, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 93, \"covered\": 0, \"notcovered\": 93, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_pmeth.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 12, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 456, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 439, \"covered\": 0, \"notcovered\": 439, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_pss.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 206, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 166, \"covered\": 0, \"notcovered\": 166, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_saos.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 74, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 51, \"covered\": 0, \"notcovered\": 51, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_sign.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 195, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 182, \"covered\": 0, \"notcovered\": 182, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_ssl.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 80, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 60, \"covered\": 0, \"notcovered\": 60, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/rsa/rsa_x931.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 92, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 55, \"covered\": 0, \"notcovered\": 55, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/seed/seed.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 106, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 216, \"covered\": 0, \"notcovered\": 216, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/seed/seed_cbc.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 4, \"covered\": 0, \"notcovered\": 4, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/seed/seed_cfb.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/seed/seed_ecb.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 4, \"covered\": 0, \"notcovered\": 4, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/seed/seed_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/seed/seed_ofb.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/sha/sha1_one.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 6, \"covered\": 0, \"notcovered\": 6, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/sha/sha256.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 56, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 12, \"covered\": 0, \"notcovered\": 12, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/sha/sha512.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 171, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 71, \"covered\": 0, \"notcovered\": 71, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/sha/sha_locl.h\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 204, \"covered\": 9, \"percent\": 4.411764705882353}, \"regions\": {\"count\": 632, \"covered\": 6, \"notcovered\": 626, \"percent\": 0.949367088607595}}}, {\"filename\": \"/src/openssl/crypto/srp/srp_grps.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/srp/srp_lib.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 254, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 209, \"covered\": 0, \"notcovered\": 209, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/srp/srp_vfy.c\", \"summary\": {\"functions\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 21, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 567, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 511, \"covered\": 0, \"notcovered\": 511, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/stack/stack.c\", \"summary\": {\"functions\": {\"count\": 23, \"covered\": 16, \"percent\": 69.56521739130434}, \"instantiations\": {\"count\": 23, \"covered\": 16, \"percent\": 69.56521739130434}, \"lines\": {\"count\": 253, \"covered\": 165, \"percent\": 65.21739130434783}, \"regions\": {\"count\": 194, \"covered\": 107, \"notcovered\": 87, \"percent\": 55.154639175257735}}}, {\"filename\": \"/src/openssl/crypto/ts/ts_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/txt_db/txt_db.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 314, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 386, \"covered\": 0, \"notcovered\": 386, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ui/ui_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/ui/ui_lib.c\", \"summary\": {\"functions\": {\"count\": 55, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 55, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 653, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 465, \"covered\": 0, \"notcovered\": 465, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ui/ui_locl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/ui/ui_openssl.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 196, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 124, \"covered\": 0, \"notcovered\": 124, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/uid.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 7, \"covered\": 0, \"notcovered\": 7, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/whrlpool/wp_dgst.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 191, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 97, \"covered\": 0, \"notcovered\": 97, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/by_dir.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 290, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 302, \"covered\": 0, \"notcovered\": 302, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/by_file.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 3, \"percent\": 60}, \"instantiations\": {\"count\": 5, \"covered\": 3, \"percent\": 60}, \"lines\": {\"count\": 180, \"covered\": 42, \"percent\": 23.333333333333332}, \"regions\": {\"count\": 175, \"covered\": 40, \"notcovered\": 135, \"percent\": 22.857142857142858}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_att.c\", \"summary\": {\"functions\": {\"count\": 19, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 19, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 261, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 280, \"covered\": 0, \"notcovered\": 280, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_cmp.c\", \"summary\": {\"functions\": {\"count\": 26, \"covered\": 2, \"percent\": 7.6923076923076925}, \"instantiations\": {\"count\": 26, \"covered\": 2, \"percent\": 7.6923076923076925}, \"lines\": {\"count\": 327, \"covered\": 22, \"percent\": 6.727828746177369}, \"regions\": {\"count\": 278, \"covered\": 13, \"notcovered\": 265, \"percent\": 4.676258992805756}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_d2.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"instantiations\": {\"count\": 2, \"covered\": 1, \"percent\": 50}, \"lines\": {\"count\": 39, \"covered\": 14, \"percent\": 35.8974358974359}, \"regions\": {\"count\": 39, \"covered\": 15, \"notcovered\": 24, \"percent\": 38.46153846153847}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_def.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 1, \"percent\": 16.666666666666664}, \"instantiations\": {\"count\": 6, \"covered\": 1, \"percent\": 16.666666666666664}, \"lines\": {\"count\": 18, \"covered\": 3, \"percent\": 16.666666666666664}, \"regions\": {\"count\": 15, \"covered\": 2, \"notcovered\": 13, \"percent\": 13.333333333333334}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_ext.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 83, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 27, \"covered\": 0, \"notcovered\": 27, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_lu.c\", \"summary\": {\"functions\": {\"count\": 34, \"covered\": 13, \"percent\": 38.23529411764706}, \"instantiations\": {\"count\": 34, \"covered\": 13, \"percent\": 38.23529411764706}, \"lines\": {\"count\": 554, \"covered\": 167, \"percent\": 30.144404332129966}, \"regions\": {\"count\": 608, \"covered\": 138, \"notcovered\": 470, \"percent\": 22.697368421052634}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_obj.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 123, \"covered\": 77, \"percent\": 62.601626016260155}, \"regions\": {\"count\": 104, \"covered\": 63, \"notcovered\": 41, \"percent\": 60.57692307692307}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_req.c\", \"summary\": {\"functions\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 198, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 168, \"covered\": 0, \"notcovered\": 168, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_trs.c\", \"summary\": {\"functions\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 182, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 209, \"covered\": 0, \"notcovered\": 209, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_txt.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 147, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 134, \"covered\": 0, \"notcovered\": 134, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_v3.c\", \"summary\": {\"functions\": {\"count\": 15, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 15, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 180, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 223, \"covered\": 0, \"notcovered\": 223, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_vfy.c\", \"summary\": {\"functions\": {\"count\": 72, \"covered\": 1, \"percent\": 1.3888888888888888}, \"instantiations\": {\"count\": 72, \"covered\": 1, \"percent\": 1.3888888888888888}, \"lines\": {\"count\": 2208, \"covered\": 8, \"percent\": 0.36231884057971014}, \"regions\": {\"count\": 1926, \"covered\": 2, \"notcovered\": 1924, \"percent\": 0.10384215991692627}}}, {\"filename\": \"/src/openssl/crypto/x509/x509_vpm.c\", \"summary\": {\"functions\": {\"count\": 35, \"covered\": 5, \"percent\": 14.285714285714285}, \"instantiations\": {\"count\": 35, \"covered\": 5, \"percent\": 14.285714285714285}, \"lines\": {\"count\": 386, \"covered\": 110, \"percent\": 28.497409326424872}, \"regions\": {\"count\": 461, \"covered\": 87, \"notcovered\": 374, \"percent\": 18.872017353579178}}}, {\"filename\": \"/src/openssl/crypto/x509/x509cset.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 88, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 75, \"covered\": 0, \"notcovered\": 75, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509name.c\", \"summary\": {\"functions\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 274, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 288, \"covered\": 0, \"notcovered\": 288, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509rset.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 15, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 16, \"covered\": 0, \"notcovered\": 16, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x509type.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 62, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 57, \"covered\": 0, \"notcovered\": 57, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509/x_all.c\", \"summary\": {\"functions\": {\"count\": 80, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 80, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 291, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 422, \"covered\": 0, \"notcovered\": 422, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/ext_dat.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/pcy_cache.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 1, \"percent\": 14.285714285714285}, \"instantiations\": {\"count\": 7, \"covered\": 1, \"percent\": 14.285714285714285}, \"lines\": {\"count\": 179, \"covered\": 3, \"percent\": 1.675977653631285}, \"regions\": {\"count\": 196, \"covered\": 3, \"notcovered\": 193, \"percent\": 1.530612244897959}}}, {\"filename\": \"/src/openssl/crypto/x509v3/pcy_data.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 50, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 54, \"covered\": 0, \"notcovered\": 54, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/pcy_int.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/pcy_lib.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 60, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 64, \"covered\": 0, \"notcovered\": 64, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/pcy_map.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 59, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 76, \"covered\": 0, \"notcovered\": 76, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/pcy_node.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 99, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 120, \"covered\": 0, \"notcovered\": 120, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/pcy_tree.c\", \"summary\": {\"functions\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 576, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 541, \"covered\": 0, \"notcovered\": 541, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_akey.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 103, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 110, \"covered\": 0, \"notcovered\": 110, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_alt.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 478, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 527, \"covered\": 0, \"notcovered\": 527, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_bcons.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_bitst.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 6, \"covered\": 0, \"notcovered\": 6, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_conf.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 304, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 244, \"covered\": 0, \"notcovered\": 244, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_cpols.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 338, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 410, \"covered\": 0, \"notcovered\": 410, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_crld.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 292, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 348, \"covered\": 0, \"notcovered\": 348, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_enum.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 7, \"covered\": 0, \"notcovered\": 7, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_extku.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 41, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 61, \"covered\": 0, \"notcovered\": 61, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_genn.c\", \"summary\": {\"functions\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 7, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 132, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 93, \"covered\": 0, \"notcovered\": 93, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_ia5.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 31, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 30, \"covered\": 0, \"notcovered\": 30, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_info.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 93, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 117, \"covered\": 0, \"notcovered\": 117, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_int.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_lib.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 226, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 241, \"covered\": 0, \"notcovered\": 241, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_ncons.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 358, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 355, \"covered\": 0, \"notcovered\": 355, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_ocsp.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 117, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 129, \"covered\": 0, \"notcovered\": 129, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_pci.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 105, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 102, \"covered\": 0, \"notcovered\": 102, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_pcons.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 1, \"covered\": 0, \"notcovered\": 1, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_pku.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 14, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 7, \"covered\": 0, \"notcovered\": 7, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_pmaps.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 56, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 87, \"covered\": 0, \"notcovered\": 87, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_prn.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 143, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 146, \"covered\": 0, \"notcovered\": 146, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_purp.c\", \"summary\": {\"functions\": {\"count\": 34, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 34, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 598, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 670, \"covered\": 0, \"notcovered\": 670, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_scts.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 186, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 125, \"covered\": 0, \"notcovered\": 125, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_skey.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 69, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 57, \"covered\": 0, \"notcovered\": 57, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_sxnet.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 124, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 138, \"covered\": 0, \"notcovered\": 138, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3_utl.c\", \"summary\": {\"functions\": {\"count\": 43, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 43, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1020, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 974, \"covered\": 0, \"notcovered\": 974, \"percent\": 0}}}, {\"filename\": \"/src/openssl/crypto/x509v3/v3err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/e_os.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/e_gost_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 26, \"covered\": 12, \"percent\": 46.15384615384615}, \"regions\": {\"count\": 12, \"covered\": 5, \"notcovered\": 7, \"percent\": 41.66666666666667}}}, {\"filename\": \"/src/openssl/engines/ccgost/e_gost_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost2001.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 375, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 336, \"covered\": 0, \"notcovered\": 336, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost2001_keyx.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 237, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 129, \"covered\": 0, \"notcovered\": 129, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost89.c\", \"summary\": {\"functions\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 18, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 293, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 74, \"covered\": 0, \"notcovered\": 74, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost94_keyx.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 222, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 131, \"covered\": 0, \"notcovered\": 131, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_ameth.c\", \"summary\": {\"functions\": {\"count\": 39, \"covered\": 1, \"percent\": 2.564102564102564}, \"instantiations\": {\"count\": 39, \"covered\": 1, \"percent\": 2.564102564102564}, \"lines\": {\"count\": 835, \"covered\": 45, \"percent\": 5.389221556886228}, \"regions\": {\"count\": 486, \"covered\": 11, \"notcovered\": 475, \"percent\": 2.263374485596708}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_crypt.c\", \"summary\": {\"functions\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 425, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 232, \"covered\": 0, \"notcovered\": 232, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_ctl.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 49, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 42, \"covered\": 0, \"notcovered\": 42, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_eng.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 6, \"percent\": 60}, \"instantiations\": {\"count\": 10, \"covered\": 6, \"percent\": 60}, \"lines\": {\"count\": 202, \"covered\": 78, \"percent\": 38.613861386138616}, \"regions\": {\"count\": 144, \"covered\": 80, \"notcovered\": 64, \"percent\": 55.55555555555556}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_keywrap.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 53, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 15, \"covered\": 0, \"notcovered\": 15, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_lcl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_md.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 5, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 11, \"covered\": 0, \"notcovered\": 11, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_pmeth.c\", \"summary\": {\"functions\": {\"count\": 25, \"covered\": 1, \"percent\": 4}, \"instantiations\": {\"count\": 25, \"covered\": 1, \"percent\": 4}, \"lines\": {\"count\": 491, \"covered\": 57, \"percent\": 11.608961303462321}, \"regions\": {\"count\": 313, \"covered\": 10, \"notcovered\": 303, \"percent\": 3.1948881789137378}}}, {\"filename\": \"/src/openssl/engines/ccgost/gost_sign.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 239, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 152, \"covered\": 0, \"notcovered\": 152, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/ccgost/gosthash.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 11, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 183, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 56, \"covered\": 0, \"notcovered\": 56, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_4758cca.c\", \"summary\": {\"functions\": {\"count\": 20, \"covered\": 5, \"percent\": 25}, \"instantiations\": {\"count\": 20, \"covered\": 5, \"percent\": 25}, \"lines\": {\"count\": 659, \"covered\": 59, \"percent\": 8.952959028831563}, \"regions\": {\"count\": 321, \"covered\": 43, \"notcovered\": 278, \"percent\": 13.395638629283487}}}, {\"filename\": \"/src/openssl/engines/e_4758cca_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 26, \"covered\": 16, \"percent\": 61.53846153846154}, \"regions\": {\"count\": 12, \"covered\": 8, \"notcovered\": 4, \"percent\": 66.66666666666666}}}, {\"filename\": \"/src/openssl/engines/e_4758cca_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_aep.c\", \"summary\": {\"functions\": {\"count\": 24, \"covered\": 3, \"percent\": 12.5}, \"instantiations\": {\"count\": 24, \"covered\": 3, \"percent\": 12.5}, \"lines\": {\"count\": 613, \"covered\": 85, \"percent\": 13.866231647634583}, \"regions\": {\"count\": 327, \"covered\": 29, \"notcovered\": 298, \"percent\": 8.868501529051988}}}, {\"filename\": \"/src/openssl/engines/e_aep_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 26, \"covered\": 12, \"percent\": 46.15384615384615}, \"regions\": {\"count\": 12, \"covered\": 5, \"notcovered\": 7, \"percent\": 41.66666666666667}}}, {\"filename\": \"/src/openssl/engines/e_aep_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_atalla.c\", \"summary\": {\"functions\": {\"count\": 16, \"covered\": 3, \"percent\": 18.75}, \"instantiations\": {\"count\": 16, \"covered\": 3, \"percent\": 18.75}, \"lines\": {\"count\": 313, \"covered\": 78, \"percent\": 24.920127795527154}, \"regions\": {\"count\": 163, \"covered\": 29, \"notcovered\": 134, \"percent\": 17.791411042944784}}}, {\"filename\": \"/src/openssl/engines/e_atalla_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 35, \"covered\": 17, \"percent\": 48.57142857142857}, \"regions\": {\"count\": 13, \"covered\": 6, \"notcovered\": 7, \"percent\": 46.15384615384615}}}, {\"filename\": \"/src/openssl/engines/e_atalla_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_chil.c\", \"summary\": {\"functions\": {\"count\": 28, \"covered\": 5, \"percent\": 17.857142857142858}, \"instantiations\": {\"count\": 28, \"covered\": 5, \"percent\": 17.857142857142858}, \"lines\": {\"count\": 847, \"covered\": 104, \"percent\": 12.278630460448642}, \"regions\": {\"count\": 560, \"covered\": 44, \"notcovered\": 516, \"percent\": 7.857142857142857}}}, {\"filename\": \"/src/openssl/engines/e_chil_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 35, \"covered\": 21, \"percent\": 60}, \"regions\": {\"count\": 13, \"covered\": 9, \"notcovered\": 4, \"percent\": 69.23076923076923}}}, {\"filename\": \"/src/openssl/engines/e_chil_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_cswift.c\", \"summary\": {\"functions\": {\"count\": 22, \"covered\": 5, \"percent\": 22.727272727272727}, \"instantiations\": {\"count\": 22, \"covered\": 5, \"percent\": 22.727272727272727}, \"lines\": {\"count\": 732, \"covered\": 91, \"percent\": 12.431693989071038}, \"regions\": {\"count\": 455, \"covered\": 42, \"notcovered\": 413, \"percent\": 9.230769230769232}}}, {\"filename\": \"/src/openssl/engines/e_cswift_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 35, \"covered\": 21, \"percent\": 60}, \"regions\": {\"count\": 13, \"covered\": 9, \"notcovered\": 4, \"percent\": 69.23076923076923}}}, {\"filename\": \"/src/openssl/engines/e_cswift_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_nuron.c\", \"summary\": {\"functions\": {\"count\": 16, \"covered\": 3, \"percent\": 18.75}, \"instantiations\": {\"count\": 16, \"covered\": 3, \"percent\": 18.75}, \"lines\": {\"count\": 195, \"covered\": 78, \"percent\": 40}, \"regions\": {\"count\": 104, \"covered\": 29, \"notcovered\": 75, \"percent\": 27.884615384615387}}}, {\"filename\": \"/src/openssl/engines/e_nuron_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 35, \"covered\": 17, \"percent\": 48.57142857142857}, \"regions\": {\"count\": 13, \"covered\": 6, \"notcovered\": 7, \"percent\": 46.15384615384615}}}, {\"filename\": \"/src/openssl/engines/e_nuron_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_padlock.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/engines/e_sureware.c\", \"summary\": {\"functions\": {\"count\": 22, \"covered\": 4, \"percent\": 18.181818181818183}, \"instantiations\": {\"count\": 22, \"covered\": 4, \"percent\": 18.181818181818183}, \"lines\": {\"count\": 734, \"covered\": 123, \"percent\": 16.7574931880109}, \"regions\": {\"count\": 489, \"covered\": 47, \"notcovered\": 442, \"percent\": 9.611451942740286}}}, {\"filename\": \"/src/openssl/engines/e_sureware_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 3, \"covered\": 2, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 35, \"covered\": 21, \"percent\": 60}, \"regions\": {\"count\": 13, \"covered\": 9, \"notcovered\": 4, \"percent\": 69.23076923076923}}}, {\"filename\": \"/src/openssl/engines/e_sureware_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/e_ubsec.c\", \"summary\": {\"functions\": {\"count\": 19, \"covered\": 3, \"percent\": 15.789473684210526}, \"instantiations\": {\"count\": 19, \"covered\": 3, \"percent\": 15.789473684210526}, \"lines\": {\"count\": 649, \"covered\": 69, \"percent\": 10.631741140215716}, \"regions\": {\"count\": 314, \"covered\": 29, \"notcovered\": 285, \"percent\": 9.235668789808917}}}, {\"filename\": \"/src/openssl/engines/e_ubsec_err.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 3, \"covered\": 1, \"percent\": 33.33333333333333}, \"lines\": {\"count\": 35, \"covered\": 17, \"percent\": 48.57142857142857}, \"regions\": {\"count\": 13, \"covered\": 6, \"notcovered\": 7, \"percent\": 46.15384615384615}}}, {\"filename\": \"/src/openssl/engines/e_ubsec_err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/vendor_defns/aep.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/vendor_defns/cswift.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/vendor_defns/hw_4758_cca.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/vendor_defns/hw_ubsec.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/vendor_defns/hwcryptohook.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/engines/vendor_defns/sureware.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/aes.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/asn1.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/asn1_mac.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/asn1t.h\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 3, \"percent\": 33.33333333333333}, \"instantiations\": {\"count\": 484, \"covered\": 11, \"percent\": 2.272727272727273}, \"lines\": {\"count\": 28, \"covered\": 9, \"percent\": 32.142857142857146}, \"regions\": {\"count\": 18, \"covered\": 6, \"notcovered\": 12, \"percent\": 33.33333333333333}}}, {\"filename\": \"/src/openssl/include/openssl/bio.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/blowfish.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/bn.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/cast.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/cms.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/conf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/crypto.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/des.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/dh.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/dsa.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/dso.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/dtls1.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/e_os2.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ec.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ecdh.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/engine.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/err.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/evp.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/hmac.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/lhash.h\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 2, \"percent\": 50}, \"instantiations\": {\"count\": 34, \"covered\": 10, \"percent\": 29.411764705882355}, \"lines\": {\"count\": 14, \"covered\": 7, \"percent\": 50}, \"regions\": {\"count\": 4, \"covered\": 2, \"notcovered\": 2, \"percent\": 50}}}, {\"filename\": \"/src/openssl/include/openssl/md4.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/md5.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/mdc2.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/obj_mac.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/objects.h\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 2, \"percent\": 50}, \"instantiations\": {\"count\": 26, \"covered\": 2, \"percent\": 7.6923076923076925}, \"lines\": {\"count\": 18, \"covered\": 9, \"percent\": 50}, \"regions\": {\"count\": 4, \"covered\": 2, \"notcovered\": 2, \"percent\": 50}}}, {\"filename\": \"/src/openssl/include/openssl/ocsp.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/opensslconf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/opensslv.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/pem.h\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 84, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 36, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 10, \"covered\": 0, \"notcovered\": 10, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/pkcs12.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/pkcs7.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/rc5.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ripemd.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/rsa.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/safestack.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/sha.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/srp.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ssl.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ssl2.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ssl23.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ssl3.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/tls1.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/txt_db.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/ui.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/whrlpool.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/x509.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/x509_vfy.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/include/openssl/x509v3.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/bio_ssl.c\", \"summary\": {\"functions\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 13, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 452, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 331, \"covered\": 0, \"notcovered\": 331, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/d1_both.c\", \"summary\": {\"functions\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 28, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1270, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 723, \"covered\": 0, \"notcovered\": 723, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/d1_clnt.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 522, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 447, \"covered\": 0, \"notcovered\": 447, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/d1_lib.c\", \"summary\": {\"functions\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 20, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 394, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 210, \"covered\": 0, \"notcovered\": 210, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/d1_meth.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 13, \"covered\": 0, \"notcovered\": 13, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/d1_pkt.c\", \"summary\": {\"functions\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 17, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 1452, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 912, \"covered\": 0, \"notcovered\": 912, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/d1_srtp.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 10, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 273, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 220, \"covered\": 0, \"notcovered\": 220, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/d1_srvr.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 660, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 557, \"covered\": 0, \"notcovered\": 557, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/s23_clnt.c\", \"summary\": {\"functions\": {\"count\": 6, \"covered\": 4, \"percent\": 66.66666666666666}, \"instantiations\": {\"count\": 6, \"covered\": 4, \"percent\": 66.66666666666666}, \"lines\": {\"count\": 577, \"covered\": 320, \"percent\": 55.45927209705373}, \"regions\": {\"count\": 474, \"covered\": 218, \"notcovered\": 256, \"percent\": 45.9915611814346}}}, {\"filename\": \"/src/openssl/ssl/s23_lib.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 3, \"percent\": 37.5}, \"instantiations\": {\"count\": 8, \"covered\": 3, \"percent\": 37.5}, \"lines\": {\"count\": 92, \"covered\": 13, \"percent\": 14.130434782608695}, \"regions\": {\"count\": 87, \"covered\": 5, \"notcovered\": 82, \"percent\": 5.747126436781609}}}, {\"filename\": \"/src/openssl/ssl/s23_meth.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 16, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 17, \"covered\": 0, \"notcovered\": 17, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/s23_pkt.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"instantiations\": {\"count\": 2, \"covered\": 2, \"percent\": 100}, \"lines\": {\"count\": 44, \"covered\": 36, \"percent\": 81.81818181818183}, \"regions\": {\"count\": 22, \"covered\": 19, \"notcovered\": 3, \"percent\": 86.36363636363636}}}, {\"filename\": \"/src/openssl/ssl/s23_srvr.c\", \"summary\": {\"functions\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 3, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 453, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 355, \"covered\": 0, \"notcovered\": 355, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/s3_both.c\", \"summary\": {\"functions\": {\"count\": 16, \"covered\": 8, \"percent\": 50}, \"instantiations\": {\"count\": 16, \"covered\": 8, \"percent\": 50}, \"lines\": {\"count\": 538, \"covered\": 214, \"percent\": 39.77695167286245}, \"regions\": {\"count\": 435, \"covered\": 142, \"notcovered\": 293, \"percent\": 32.64367816091954}}}, {\"filename\": \"/src/openssl/ssl/s3_cbc.c\", \"summary\": {\"functions\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 550, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 215, \"covered\": 0, \"notcovered\": 215, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/s3_clnt.c\", \"summary\": {\"functions\": {\"count\": 20, \"covered\": 2, \"percent\": 10}, \"instantiations\": {\"count\": 20, \"covered\": 2, \"percent\": 10}, \"lines\": {\"count\": 3303, \"covered\": 92, \"percent\": 2.785346654556464}, \"regions\": {\"count\": 2670, \"covered\": 58, \"notcovered\": 2612, \"percent\": 2.1722846441947565}}}, {\"filename\": \"/src/openssl/ssl/s3_enc.c\", \"summary\": {\"functions\": {\"count\": 16, \"covered\": 3, \"percent\": 18.75}, \"instantiations\": {\"count\": 16, \"covered\": 3, \"percent\": 18.75}, \"lines\": {\"count\": 737, \"covered\": 19, \"percent\": 2.578018995929444}, \"regions\": {\"count\": 577, \"covered\": 15, \"notcovered\": 562, \"percent\": 2.5996533795493932}}}, {\"filename\": \"/src/openssl/ssl/s3_lib.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 8, \"percent\": 29.629629629629626}, \"instantiations\": {\"count\": 27, \"covered\": 8, \"percent\": 29.629629629629626}, \"lines\": {\"count\": 1385, \"covered\": 224, \"percent\": 16.173285198555956}, \"regions\": {\"count\": 1021, \"covered\": 103, \"notcovered\": 918, \"percent\": 10.088148873653282}}}, {\"filename\": \"/src/openssl/ssl/s3_meth.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 6, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 5, \"covered\": 0, \"notcovered\": 5, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/s3_pkt.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 7, \"percent\": 63.63636363636363}, \"instantiations\": {\"count\": 11, \"covered\": 7, \"percent\": 63.63636363636363}, \"lines\": {\"count\": 1515, \"covered\": 535, \"percent\": 35.31353135313531}, \"regions\": {\"count\": 1083, \"covered\": 290, \"notcovered\": 793, \"percent\": 26.777469990766388}}}, {\"filename\": \"/src/openssl/ssl/s3_srvr.c\", \"summary\": {\"functions\": {\"count\": 16, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 16, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 3192, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 2464, \"covered\": 0, \"notcovered\": 2464, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/ssl_algs.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 86, \"covered\": 86, \"percent\": 100}, \"regions\": {\"count\": 22, \"covered\": 22, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/ssl/ssl_asn1.c\", \"summary\": {\"functions\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 2, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 482, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 715, \"covered\": 0, \"notcovered\": 715, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/ssl_cert.c\", \"summary\": {\"functions\": {\"count\": 35, \"covered\": 6, \"percent\": 17.142857142857142}, \"instantiations\": {\"count\": 35, \"covered\": 6, \"percent\": 17.142857142857142}, \"lines\": {\"count\": 974, \"covered\": 197, \"percent\": 20.2258726899384}, \"regions\": {\"count\": 902, \"covered\": 87, \"notcovered\": 815, \"percent\": 9.645232815964523}}}, {\"filename\": \"/src/openssl/ssl/ssl_ciph.c\", \"summary\": {\"functions\": {\"count\": 31, \"covered\": 14, \"percent\": 45.16129032258064}, \"instantiations\": {\"count\": 31, \"covered\": 14, \"percent\": 45.16129032258064}, \"lines\": {\"count\": 1468, \"covered\": 783, \"percent\": 53.33787465940054}, \"regions\": {\"count\": 1300, \"covered\": 575, \"notcovered\": 725, \"percent\": 44.230769230769226}}}, {\"filename\": \"/src/openssl/ssl/ssl_err.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 9, \"covered\": 9, \"percent\": 100}, \"regions\": {\"count\": 3, \"covered\": 3, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/ssl/ssl_err2.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 6, \"covered\": 6, \"percent\": 100}, \"regions\": {\"count\": 1, \"covered\": 1, \"notcovered\": 0, \"percent\": 100}}}, {\"filename\": \"/src/openssl/ssl/ssl_lib.c\", \"summary\": {\"functions\": {\"count\": 171, \"covered\": 30, \"percent\": 17.543859649122805}, \"instantiations\": {\"count\": 171, \"covered\": 30, \"percent\": 17.543859649122805}, \"lines\": {\"count\": 2598, \"covered\": 762, \"percent\": 29.330254041570434}, \"regions\": {\"count\": 2003, \"covered\": 395, \"notcovered\": 1608, \"percent\": 19.720419370943585}}}, {\"filename\": \"/src/openssl/ssl/ssl_locl.h\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 2, \"percent\": 50}, \"instantiations\": {\"count\": 24, \"covered\": 2, \"percent\": 8.333333333333332}, \"lines\": {\"count\": 136, \"covered\": 68, \"percent\": 50}, \"regions\": {\"count\": 6, \"covered\": 3, \"notcovered\": 3, \"percent\": 50}}}, {\"filename\": \"/src/openssl/ssl/ssl_rsa.c\", \"summary\": {\"functions\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 27, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 879, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 640, \"covered\": 0, \"notcovered\": 640, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/ssl_sess.c\", \"summary\": {\"functions\": {\"count\": 46, \"covered\": 9, \"percent\": 19.565217391304348}, \"instantiations\": {\"count\": 46, \"covered\": 9, \"percent\": 19.565217391304348}, \"lines\": {\"count\": 938, \"covered\": 152, \"percent\": 16.204690831556505}, \"regions\": {\"count\": 656, \"covered\": 84, \"notcovered\": 572, \"percent\": 12.804878048780488}}}, {\"filename\": \"/src/openssl/ssl/ssl_stat.c\", \"summary\": {\"functions\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 8, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 742, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 637, \"covered\": 0, \"notcovered\": 637, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/t1_clnt.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 13, \"covered\": 0, \"notcovered\": 13, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/t1_enc.c\", \"summary\": {\"functions\": {\"count\": 12, \"covered\": 2, \"percent\": 16.666666666666664}, \"instantiations\": {\"count\": 12, \"covered\": 2, \"percent\": 16.666666666666664}, \"lines\": {\"count\": 912, \"covered\": 69, \"percent\": 7.565789473684211}, \"regions\": {\"count\": 780, \"covered\": 24, \"notcovered\": 756, \"percent\": 3.076923076923077}}}, {\"filename\": \"/src/openssl/ssl/t1_ext.c\", \"summary\": {\"functions\": {\"count\": 11, \"covered\": 4, \"percent\": 36.36363636363637}, \"instantiations\": {\"count\": 11, \"covered\": 4, \"percent\": 36.36363636363637}, \"lines\": {\"count\": 194, \"covered\": 23, \"percent\": 11.855670103092782}, \"regions\": {\"count\": 139, \"covered\": 11, \"notcovered\": 128, \"percent\": 7.913669064748201}}}, {\"filename\": \"/src/openssl/ssl/t1_lib.c\", \"summary\": {\"functions\": {\"count\": 61, \"covered\": 9, \"percent\": 14.754098360655737}, \"instantiations\": {\"count\": 61, \"covered\": 9, \"percent\": 14.754098360655737}, \"lines\": {\"count\": 3401, \"covered\": 396, \"percent\": 11.643634225227874}, \"regions\": {\"count\": 2727, \"covered\": 247, \"notcovered\": 2480, \"percent\": 9.057572423909058}}}, {\"filename\": \"/src/openssl/ssl/t1_meth.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 13, \"covered\": 0, \"notcovered\": 13, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/t1_reneg.c\", \"summary\": {\"functions\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 4, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 140, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 84, \"covered\": 0, \"notcovered\": 84, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/t1_srvr.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 1, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 9, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 13, \"covered\": 0, \"notcovered\": 13, \"percent\": 0}}}, {\"filename\": \"/src/openssl/ssl/tls_srp.c\", \"summary\": {\"functions\": {\"count\": 22, \"covered\": 4, \"percent\": 18.181818181818183}, \"instantiations\": {\"count\": 22, \"covered\": 4, \"percent\": 18.181818181818183}, \"lines\": {\"count\": 417, \"covered\": 136, \"percent\": 32.61390887290168}, \"regions\": {\"count\": 260, \"covered\": 48, \"notcovered\": 212, \"percent\": 18.461538461538463}}}, {\"filename\": \"/src/zlib/adler32.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 2, \"percent\": 40}, \"instantiations\": {\"count\": 5, \"covered\": 2, \"percent\": 40}, \"lines\": {\"count\": 97, \"covered\": 68, \"percent\": 70.10309278350515}, \"regions\": {\"count\": 140, \"covered\": 111, \"notcovered\": 29, \"percent\": 79.28571428571428}}}, {\"filename\": \"/src/zlib/crc32.c\", \"summary\": {\"functions\": {\"count\": 10, \"covered\": 3, \"percent\": 30}, \"instantiations\": {\"count\": 10, \"covered\": 3, \"percent\": 30}, \"lines\": {\"count\": 159, \"covered\": 41, \"percent\": 25.78616352201258}, \"regions\": {\"count\": 106, \"covered\": 33, \"notcovered\": 73, \"percent\": 31.132075471698112}}}, {\"filename\": \"/src/zlib/inffast.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 219, \"covered\": 210, \"percent\": 95.8904109589041}, \"regions\": {\"count\": 84, \"covered\": 81, \"notcovered\": 3, \"percent\": 96.42857142857143}}}, {\"filename\": \"/src/zlib/inffixed.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/zlib/inflate.c\", \"summary\": {\"functions\": {\"count\": 22, \"covered\": 10, \"percent\": 45.45454545454545}, \"instantiations\": {\"count\": 22, \"covered\": 10, \"percent\": 45.45454545454545}, \"lines\": {\"count\": 1023, \"covered\": 744, \"percent\": 72.72727272727273}, \"regions\": {\"count\": 1170, \"covered\": 894, \"notcovered\": 276, \"percent\": 76.41025641025641}}}, {\"filename\": \"/src/zlib/inftrees.c\", \"summary\": {\"functions\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"instantiations\": {\"count\": 1, \"covered\": 1, \"percent\": 100}, \"lines\": {\"count\": 266, \"covered\": 256, \"percent\": 96.2406015037594}, \"regions\": {\"count\": 109, \"covered\": 101, \"notcovered\": 8, \"percent\": 92.66055045871559}}}, {\"filename\": \"/src/zlib/inftrees.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/zlib/zconf.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/zlib/zlib.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}, {\"filename\": \"/src/zlib/zutil.c\", \"summary\": {\"functions\": {\"count\": 5, \"covered\": 1, \"percent\": 20}, \"instantiations\": {\"count\": 5, \"covered\": 1, \"percent\": 20}, \"lines\": {\"count\": 45, \"covered\": 3, \"percent\": 6.666666666666667}, \"regions\": {\"count\": 30, \"covered\": 2, \"notcovered\": 28, \"percent\": 6.666666666666667}}}, {\"filename\": \"/src/zlib/zutil.h\", \"summary\": {\"functions\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"instantiations\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"lines\": {\"count\": 0, \"covered\": 0, \"percent\": 0}, \"regions\": {\"count\": 0, \"covered\": 0, \"notcovered\": 0, \"percent\": 0}}}], \"totals\": {\"functions\": {\"count\": 6666, \"covered\": 1907, \"percent\": 28.60786078607861}, \"instantiations\": {\"count\": 7495, \"covered\": 2012, \"percent\": 26.844563042028017}, \"lines\": {\"count\": 197515, \"covered\": 51027, \"percent\": 25.834493582765866}, \"regions\": {\"count\": 143296, \"covered\": 30159, \"notcovered\": 113137, \"percent\": 21.046644707458686}}}], \"type\": \"llvm.coverage.json.export\", \"version\": \"2.0.0\"}"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/.clusterfuzzlite/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\n\nCOPY . $SRC/external-project\nWORKDIR $SRC/external-project\nCOPY .clusterfuzzlite/build.sh $SRC/\n"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/.clusterfuzzlite/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake clean  # Not strictly necessary, since we are building in a fresh dir.\nmake -j$(nproc) all    # Build the fuzz targets.\n\n# Copy the fuzzer executables, zip-ed corpora, option and dictionary files to $OUT\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'     # If you have dictionaries.\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'  # If you have custom options.\n"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/Makefile",
    "content": "# Copyright 2017 Google Inc. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n\n# Simple example of a build file that nicely integrates a fuzz target\n# with the rest of the project.\n#\n# We use 'make' as the build system, but these ideas are applicable\n# to any other build system\n\n# By default, use our own standalone_fuzz_target_runner.\n# This runner does no fuzzing, but simply executes the inputs\n# provided via parameters.\n# Run e.g. \"make all LIB_FUZZING_ENGINE=/path/to/libFuzzer.a\"\n# to link the fuzzer(s) against a real fuzzing engine.\n#\n# OSS-Fuzz will define its own value for LIB_FUZZING_ENGINE.\nLIB_FUZZING_ENGINE ?= standalone_fuzz_target_runner.o\n\n# Values for CC, CFLAGS, CXX, CXXFLAGS are provided by OSS-Fuzz.\n# Outside of OSS-Fuzz use the ones you prefer or rely on the default values.\n# Do not use the -fsanitize=* flags by default.\n# OSS-Fuzz will use different -fsanitize=* flags for different builds (asan, ubsan, msan, ...)\n\n# You may add extra compiler flags like this:\nCXXFLAGS += -std=c++11\n\nall: do_stuff_fuzzer\n\nclean:\n\trm -fv *.a *.o *_fuzzer crash-* *.zip\n\n# Fuzz target, links against $LIB_FUZZING_ENGINE, so that\n# you may choose which fuzzing engine to use.\ndo_stuff_fuzzer: do_stuff_fuzzer.cpp my_api.a standalone_fuzz_target_runner.o\n\t${CXX} ${CXXFLAGS} $< my_api.a ${LIB_FUZZING_ENGINE} -o $@\n\n\n# The library itself.\nmy_api.a: my_api.cpp my_api.h\n\t${CXX} ${CXXFLAGS} $< -c\n\tar ruv my_api.a my_api.o\n\n# The standalone fuzz target runner.\nstandalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cpp\n"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/do_stuff_fuzzer.cpp",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n#include \"my_api.h\"\n\n#include <string>\n\n// Simple fuzz target for DoStuff().\n// See https://llvm.org/docs/LibFuzzer.html for details.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  std::string str(reinterpret_cast<const char *>(data), size);\n  DoStuff(str);  // Disregard the output.\n  return 0;\n}\n"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/do_stuff_fuzzer.dict",
    "content": "# A dictionary for more efficient fuzzing of DoStuff(). \n# If the inputs contain multi-byte tokens, list them here.\n# See https://llvm.org/docs/LibFuzzer.html#dictionaries\n\"foo\"\n\"bar\"\n\"ouch\"\n"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/my_api.cpp",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Implementation of \"my_api\".\n#include \"my_api.h\"\n\n#include <vector>\n\n// Do some computations with 'str', return the result.\n// This function contains a bug. Can you spot it?\nsize_t DoStuff(const std::string &str) {\n  std::vector<int> Vec({0, 1, 2, 3, 4});\n  size_t Idx = 0;\n  if (str.size() > 5)\n    Idx++;\n  if (str.find(\"foo\") != std::string::npos)\n    Idx++;\n  if (str.find(\"bar\") != std::string::npos)\n    Idx++;\n  if (str.find(\"ouch\") != std::string::npos)\n    Idx++;\n  if (str.find(\"omg\") != std::string::npos)\n    Idx++;\n  return Vec[Idx];\n}\n"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/my_api.h",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// A library that does ... stuff.\n// Serves as an example of good fuzz testing and OSS-Fuzz integration.\n#include <string>\n\nsize_t DoStuff(const std::string &str);\n"
  },
  {
    "path": "infra/cifuzz/test_data/external-project/standalone_fuzz_target_runner.cpp",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Example of a standalone runner for \"fuzz targets\".\n// It reads all files passed as parameters and feeds their contents\n// one by one into the fuzz target (LLVMFuzzerTestOneInput).\n// This runner does not do any fuzzing, but allows us to run the fuzz target\n// on the test corpus (e.g. \"do_stuff_test_data\") or on a single file,\n// e.g. the one that comes from a bug report.\n\n#include <cassert>\n#include <iostream>\n#include <fstream>\n#include <vector>\n\n// Forward declare the \"fuzz target\" interface.\n// We deliberately keep this inteface simple and header-free.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n\nint main(int argc, char **argv) {\n  for (int i = 1; i < argc; i++) {\n    std::ifstream in(argv[i]);\n    in.seekg(0, in.end);\n    size_t length = in.tellg();\n    in.seekg (0, in.beg);\n    std::cout << \"Reading \" << length << \" bytes from \" << argv[i] << std::endl;\n    // Allocate exactly length bytes so that we reliably catch buffer overflows.\n    std::vector<char> bytes(length);\n    in.read(bytes.data(), bytes.size());\n    assert(in);\n    LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()),\n                           bytes.size());\n    std::cout << \"Execution successful\" << std::endl;\n  }\n  return 0;\n}\n"
  },
  {
    "path": "infra/cifuzz/test_data/msan_crash_fuzzer_bug_summary.txt",
    "content": "MemorySanitizer: use-of-uninitialized-value\n#0 0x52675f in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:13:7\n#1 0x45a431 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15\n#2 0x45ba46 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:792:3\n#3 0x45bed9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:845:3\n#4 0x44a4bc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6\n#5 0x474432 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n#6 0x7eff5562683f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)\n#7 0x41eab8 in _start (out/do_stuff_fuzzer+0x41eab8)\n\nDEDUP_TOKEN: LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&)\nUninitialized value was created by a heap allocation\n#0 0x4d57ad in malloc /src/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:901:3\n#1 0x437c07 in operator new(unsigned long) (out/do_stuff_fuzzer+0x437c07)\n#2 0x45ba46 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:792:3\n#3 0x45bed9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:845:3\n#4 0x44a4bc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6\n#5 0x474432 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n#6 0x7eff5562683f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)\nDEDUP_TOKEN: malloc--operator new(unsigned long)--fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&)\n\nSUMMARY:"
  },
  {
    "path": "infra/cifuzz/test_data/msan_crash_fuzzer_output.txt",
    "content": "Dictionary: 3 entries\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 1 modules   (184 inline 8-bit counters): 184 [0x829300, 0x8293b8), \nINFO: Loaded 1 PC tables (184 PCs): 184 [0x5dc910,0x5dd490), \nINFO:        5 files found in /tmp/do_stuff_fuzzer_corpus\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes\n==13==WARNING: MemorySanitizer: use-of-uninitialized-value\n#0 0x52675f in LLVMFuzzerTestOneInput /src/cifuzz-example/do_stuff_fuzzer.cpp:13:7\n#1 0x45a431 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15\n#2 0x45ba46 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:792:3\n#3 0x45bed9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:845:3\n#4 0x44a4bc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6\n#5 0x474432 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n#6 0x7eff5562683f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)\n#7 0x41eab8 in _start (out/do_stuff_fuzzer+0x41eab8)\n\nDEDUP_TOKEN: LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&)\nUninitialized value was created by a heap allocation\n#0 0x4d57ad in malloc /src/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:901:3\n#1 0x437c07 in operator new(unsigned long) (out/do_stuff_fuzzer+0x437c07)\n#2 0x45ba46 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:792:3\n#3 0x45bed9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:845:3\n#4 0x44a4bc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6\n#5 0x474432 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n#6 0x7eff5562683f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)\nDEDUP_TOKEN: malloc--operator new(unsigned long)--fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&)\n\nSUMMARY: MemorySanitizer: use-of-uninitialized-value /src/cifuzz-example/do_stuff_fuzzer.cpp:13:7 in LLVMFuzzerTestOneInput\nUnique heap origins: 65\nStack depot allocated bytes: 4424\nUnique origin histories: 29\nHistory depot allocated bytes: 696\nExiting\nMS: 0 ; base unit: 0000000000000000000000000000000000000000\n\n\nartifact_prefix='./'; Test unit written to ./crash-da39a3ee5e6b4b0d3255bfef95601890afd80709\nBase64: \n"
  },
  {
    "path": "infra/cifuzz/test_data/sarif_utils_msan_stack.txt",
    "content": "Dictionary: 3 entries\n2024-05-07 18:49:02,343 - root - INFO - Fuzzer: do_stuff_fuzzer. Detected bug.\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 1 modules   (83 inline 8-bit counters): 83 [0x563ff0e03e98, 0x563ff0e03eeb), \nINFO: Loaded 1 PC tables (83 PCs): 83 [0x563ff0e03ef0,0x563ff0e04420), \nINFO:        0 files found in /github/workspace/cifuzz-corpus/do_stuff_fuzzer\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes\nINFO: A corpus is not provided, starting from an empty corpus\n#2\tINITED cov: 2 ft: 2 corp: 1/1b exec/s: 0 rss: 69Mb\n#4\tNEW    cov: 3 ft: 3 corp: 2/3b lim: 4096 exec/s: 0 rss: 69Mb L: 2/2 MS: 2 ChangeBit-InsertByte-\n==23==WARNING: MemorySanitizer: use-of-uninitialized-value\n    #0 0x563ff0d278f0 in LLVMFuzzerTestOneInput /src/cifuzz-external-example/do_stuff_fuzzer.cpp:24:1\n    #1 0x563ff0c24340 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:614:13\n    #2 0x563ff0c23b65 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7\n    #3 0x563ff0c25335 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:760:19\n    #4 0x563ff0c26125 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:905:5\n    #5 0x563ff0c14436 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:914:6\n    #6 0x563ff0c40962 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #7 0x7f4c156ed082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 87b331c034a6458c64ce09c03939e947212e18ce)\n    #8 0x563ff0c055ad in _start (build-out/do_stuff_fuzzer+0x4a5ad)\n\nDEDUP_TOKEN: LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*)\n  Uninitialized value was stored to memory at\n    #0 0x563ff0d278e9 in LLVMFuzzerTestOneInput /src/cifuzz-external-example/do_stuff_fuzzer.cpp\n    #1 0x563ff0c24340 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:614:13\n    #2 0x563ff0c23b65 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7\n    #3 0x563ff0c25335 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:760:19\n    #4 0x563ff0c26125 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:905:5\n    #5 0x563ff0c14436 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:914:6\n    #6 0x563ff0c40962 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #7 0x7f4c156ed082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 87b331c034a6458c64ce09c03939e947212e18ce)\n\nDEDUP_TOKEN: LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*)\n  Uninitialized value was created by a heap deallocation\n    #0 0x563ff0cc7480 in free /src/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:218:3\n    #1 0x563ff0d27800 in LLVMFuzzerTestOneInput /src/cifuzz-external-example/do_stuff_fuzzer.cpp:21:5\n    #2 0x563ff0c24340 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:614:13\n    #3 0x563ff0c23b65 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7\n    #4 0x563ff0c25335 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:760:19\n    #5 0x563ff0c26125 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:905:5\n    #6 0x563ff0c14436 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:914:6\n    #7 0x563ff0c40962 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7f4c156ed082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 87b331c034a6458c64ce09c03939e947212e18ce)\n\nDEDUP_TOKEN: __interceptor_free--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\nSUMMARY: MemorySanitizer: use-of-uninitialized-value /src/cifuzz-external-example/do_stuff_fuzzer.cpp:24:1 in LLVMFuzzerTestOneInput\nUnique heap origins: 201\nStack depot allocated bytes: 9764880\nUnique origin histories: 181\nHistory depot allocated bytes: 196608\nExiting\nMS: 5 ShuffleBytes-CopyPart-InsertByte-CopyPart-ManualDict- DE: \"bar\"-; base unit: adc83b19e793491b1c6ea0fd8b46cd9f32e592fc\n0xa,0x62,0x61,0x72,0xa,\n\\012bar\\012\nartifact_prefix='/tmp/tmp1tc5b3m2/'; Test unit written to /tmp/tmp1tc5b3m2/crash-c935b6724d7e27401ac9af3773700ca86ac38dea\nBase64: CmJhcgo=\nstat::number_of_executed_units: 159\nstat::average_exec_per_sec:     0\nstat::new_units_added:          1\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              69\n"
  },
  {
    "path": "infra/cifuzz/test_data/sarif_utils_only_llvmfuzzer_stack.txt",
    "content": "/github/workspace/build-out/fuzz-bus-label -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpsngf52cy/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bus-label >fuzz-0.log 2>&1\n================== Job 0 exited with exit code 0 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (82577 inline 8-bit counters): 82573 [0x7fc55e6bedf0, 0x7fc55e6d307d), 4 [0x5e9c28, 0x5e9c2c), \n2023-05-04 01:02:55,065 - root - INFO - Not reporting crash in fuzz-bus-label because process timed out.\n2023-05-04 01:02:55,069 - root - INFO - Deleting corpus and seed corpus of fuzz-bus-label to save disk.\nINFO: Loaded 2 PC tables (82577 PCs): 82573 [0x7fc55e6d3080,0x7fc55e815950), 4 [0x5a6c78,0x5a6cb8), \nINFO:      256 files found in /github/workspace/cifuzz-corpus/fuzz-bus-label\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes\nINFO: seed corpus: files: 256 min: 1b max: 5242880b total: 30968483b rss: 48Mb\n#257\tINITED cov: 41 ft: 230 corp: 111/4360b exec/s: 0 rss: 73Mb\n#131072\tpulse  cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43690 rss: 76Mb\n#262144\tpulse  cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43690 rss: 76Mb\n#524288\tpulse  cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43690 rss: 77Mb\n#609082\tDONE   cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43505 rss: 77Mb\nDone 609082 runs in 14 second(s)\nstat::number_of_executed_units: 609082\nstat::average_exec_per_sec:     43505\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              77\n/github/workspace/build-out/fuzz-bus-label -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpsngf52cy/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bus-label >fuzz-1.log 2>&1\n2023-05-04 01:02:55,082 - root - INFO - Deleting fuzz target: fuzz-bus-label.\n2023-05-04 01:02:55,083 - root - INFO - Done deleting.\n2023-05-04 01:02:55,084 - root - INFO - Fuzzer fuzz-bus-label finished running without reportable crashes.\n2023-05-04 01:02:55,084 - root - INFO - Running fuzzer: fuzz-dhcp-server.\n2023-05-04 01:02:55,085 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-dhcp-server/public.zip\n2023-05-04 01:02:55,088 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:02:55,145 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-dhcp-server/public.zip HTTP/1.1\" 200 806749\n2023-05-04 01:02:55,350 - root - INFO - Starting fuzzing\nFuzzing logs:\n/github/workspace/build-out/fuzz-dhcp-server -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpyxgwwsvr/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-dhcp-server >fuzz-0.log 2>&1\n================== Job 0 exited with exit code 0 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (83640 inline 8-bit counters): 82573 [0x7fe86ff70df0, 0x7fe86ff8507d), 1067 [0x60c638, 0x60ca63), \nINFO: Loaded 2 PC tables (83640 PCs): 82573 [0x7fe86ff85080,0x7fe8700c7950), 1067 [0x60ca68,0x610d18), \nINFO:     1153 files found in /github/workspace/cifuzz-corpus/fuzz-dhcp-server\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes\nINFO: seed corpus: files: 1153 min: 1b max: 5242879b total: 17056071b rss: 50Mb\n#1155\tINITED cov: 577 ft: 1116 corp: 203/54Kb exec/s: 0 rss: 86Mb\n#1167\tNEW    cov: 577 ft: 1117 corp: 204/54Kb lim: 1048576 exec/s: 0 rss: 86Mb L: 243/1071 MS: 2 ChangeASCIIInt-CrossOver-\n#1509\tNEW    cov: 577 ft: 1118 corp: 205/54Kb lim: 1048576 exec/s: 0 rss: 86Mb L: 243/1071 MS: 2 ChangeBit-CopyPart-\n#63018\tNEW    cov: 577 ft: 1119 corp: 206/55Kb lim: 1048576 exec/s: 21006 rss: 86Mb L: 245/1071 MS: 4 InsertByte-ChangeByte-CMP-InsertByte- DE: \"2\\000\\000\\000\\000\\000\\000\\000\"-\n#65536\tpulse  cov: 577 ft: 1119 corp: 206/55Kb lim: 1048576 exec/s: 21845 rss: 86Mb\nLoaded 1024/1155 files from /github/workspace/cifuzz-corpus/fuzz-dhcp-server\n#99784\tNEW    cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 19956 rss: 105Mb L: 243/1071 MS: 2 ChangeASCIIInt-ChangeBinInt-\n#131072\tpulse  cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 21845 rss: 105Mb\n#262144\tpulse  cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 20164 rss: 105Mb\n#275639\tDONE   cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 19688 rss: 105Mb\n###### Recommended dictionary. ######\n\"2\\000\\000\\000\\000\\000\\000\\000\" # Uses: 17879\n###### End of recommended dictionary. ######\nDone 275639 runs in 14 second(s)\nstat::number_of_executed_units: 275639\nstat::average_exec_per_sec:     19688\nstat::new_units_added:          4\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              105\n/github/workspace/build-out/fuzz-dhcp-server -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpyxgwwsvr/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-dhcp-server >fuzz-1.log 2>&1\n2023-05-04 01:03:18,374 - root - INFO - Not reporting crash in fuzz-dhcp-server because process timed out.\n2023-05-04 01:03:18,377 - root - INFO - Deleting corpus and seed corpus of fuzz-dhcp-server to save disk.\n2023-05-04 01:03:18,399 - root - INFO - Deleting fuzz target: fuzz-dhcp-server.\n2023-05-04 01:03:18,400 - root - INFO - Done deleting.\n2023-05-04 01:03:18,400 - root - INFO - Fuzzer fuzz-dhcp-server finished running without reportable crashes.\n2023-05-04 01:03:18,401 - root - INFO - Running fuzzer: fuzz-bcd.\n2023-05-04 01:03:18,401 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-bcd/public.zip\n2023-05-04 01:03:18,404 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:03:18,582 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-bcd/public.zip HTTP/1.1\" 200 2293254\n2023-05-04 01:03:18,804 - root - INFO - Starting fuzzing\nFuzzing logs:\n/github/workspace/build-out/fuzz-bcd -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpgvqlyr8q/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bcd >fuzz-0.log 2>&1\n================== Job 0 exited with exit code 0 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (83175 inline 8-bit counters): 82573 [0x7f1b5387edf0, 0x7f1b5389307d), 602 [0x5f8718, 0x5f8972), \nINFO: Loaded 2 PC tables (83175 PCs): 82573 [0x7f1b53893080,0x7f1b539d5950), 602 [0x5f8978,0x5faf18), \nINFO:     1260 files found in /github/workspace/cifuzz-corpus/fuzz-bcd\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 946175 bytes\nINFO: seed corpus: files: 1260 min: 1b max: 946175b total: 10373697b rss: 48Mb\n#1261\tINITED cov: 137 ft: 653 corp: 282/1416Kb exec/s: 0 rss: 91Mb\n#65536\tpulse  cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 32768 rss: 98Mb\n#131072\tpulse  cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 32768 rss: 98Mb\n#262144\tpulse  cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 37449 rss: 98Mb\n#475081\tDONE   cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 33934 rss: 98Mb\nDone 475081 runs in 14 second(s)\nstat::number_of_executed_units: 475081\nstat::average_exec_per_sec:     33934\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              98\n/github/workspace/build-out/fuzz-bcd -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpgvqlyr8q/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bcd >fuzz-1.log 2>&1\n2023-05-04 01:03:41,821 - root - INFO - Not reporting crash in fuzz-bcd because process timed out.\n2023-05-04 01:03:41,822 - root - INFO - Deleting corpus and seed corpus of fuzz-bcd to save disk.\n2023-05-04 01:03:41,848 - root - INFO - Deleting fuzz target: fuzz-bcd.\n2023-05-04 01:03:41,848 - root - INFO - Done deleting.\n2023-05-04 01:03:41,848 - root - INFO - Fuzzer fuzz-bcd finished running without reportable crashes.\n2023-05-04 01:03:41,848 - root - INFO - Running fuzzer: fuzz-varlink.\n2023-05-04 01:03:41,849 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-varlink/public.zip\n2023-05-04 01:03:41,852 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:03:41,906 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-varlink/public.zip HTTP/1.1\" 200 2586434\n2023-05-04 01:03:42,671 - root - INFO - Starting fuzzing\n2023-05-04 01:04:05,709 - root - INFO - Not reporting crash in fuzz-varlink because process timed out.\nFuzzing logs:\n/github/workspace/build-out/fuzz-varlink -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpbtf4f932/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-varlink >fuzz-0.log 2>&1\n2023-05-04 01:04:05,709 - root - INFO - Deleting corpus and seed corpus of fuzz-varlink to save disk.\n2023-05-04 01:04:05,806 - root - INFO - Deleting fuzz target: fuzz-varlink.\n2023-05-04 01:04:05,806 - root - INFO - Done deleting.\n2023-05-04 01:04:05,806 - root - INFO - Fuzzer fuzz-varlink finished running without reportable crashes.\n2023-05-04 01:04:05,806 - root - INFO - Running fuzzer: fuzz-unit-file.\n2023-05-04 01:04:05,807 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-unit-file/public.zip\n2023-05-04 01:04:05,809 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:04:05,897 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-unit-file/public.zip HTTP/1.1\" 200 4999974\n2023-05-04 01:04:07,869 - root - INFO - Starting fuzzing\n2023-05-04 01:04:09,516 - root - INFO - Fuzzer: fuzz-unit-file. Detected bug.\nFuzzing logs:\n/github/workspace/build-out/fuzz-unit-file -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpjhswtxiw/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-unit-file >fuzz-0.log 2>&1\n2023-05-04 01:04:09,517 - root - INFO - Trying to reproduce crash using: /tmp/tmpjhswtxiw/crash-7be9e0f3a71d95f8d5e67c5a9d84273d6f4e3c03.\n================== Job 0 exited with exit code 77 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (82576 inline 8-bit counters): 82573 [0x7f3b0de4cdf0, 0x7f3b0de6107d), 3 [0x5e9b28, 0x5e9b2b), \nINFO: Loaded 2 PC tables (82576 PCs): 82573 [0x7f3b0de61080,0x7f3b0dfa3950), 3 [0x5a6af8,0x5a6b28), \nINFO:    20907 files found in /github/workspace/cifuzz-corpus/fuzz-unit-file\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 604973 bytes\nINFO: seed corpus: files: 20907 min: 1b max: 604973b total: 16005340b rss: 61Mb\n=================================================================\n==74==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000005078 at pc 0x0000004ddffa bp 0x7fffeea64fe0 sp 0x7fffeea64fd8\nREAD of size 4 at 0x602000005078 thread T0\nSCARINESS: 27 (4-byte-read-heap-buffer-overflow-far-from-bounds)\n    #0 0x4ddff9 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16\n    #1 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #2 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #3 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #4 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #5 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #6 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #7 0x7f3b0ce20082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n    #8 0x41f6ed in _start (build-out/fuzz-unit-file+0x41f6ed)\n\nDEDUP_TOKEN: LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*)\n0x602000005078 is located 38 bytes to the right of 2-byte region [0x602000005050,0x602000005052)\nfreed by thread T0 here:\n    #0 0x4a0882 in __interceptor_free /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:52:3\n    #1 0x4ddfb7 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:29:9\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7f3b0ce20082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: __interceptor_free--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\npreviously allocated by thread T0 here:\n    #0 0x4a0b26 in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3\n    #1 0x4ddfac in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:28:25\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7f3b0ce20082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: malloc--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\nSUMMARY: AddressSanitizer: heap-buffer-overflow /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16 in LLVMFuzzerTestOneInput\nShadow bytes around the buggy address:\n  0x0c047fff89b0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89c0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89d0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89e0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89f0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n=>0x0c047fff8a00: fa fa 00 02 fa fa 00 02 fa fa fd fa fa fa fa[fa]\n  0x0c047fff8a10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07 \n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==74==ABORTING\nMS: 0 ; base unit: 0000000000000000000000000000000000000000\n0x61,0x75,0x74,0x6f,0x6d,0x6f,0x75,0x6e,0x74,0x48,\nautomountH\nartifact_prefix='/tmp/tmpjhswtxiw/'; Test unit written to /tmp/tmpjhswtxiw/crash-7be9e0f3a71d95f8d5e67c5a9d84273d6f4e3c03\nBase64: YXV0b21vdW50SA==\nstat::number_of_executed_units: 314\nstat::average_exec_per_sec:     0\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              67\n/github/workspace/build-out/fuzz-unit-file -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpjhswtxiw/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-unit-file >fuzz-1.log 2>&1\n================== Job 1 exited with exit code 77 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (82576 inline 8-bit counters): 82573 [0x7ff1ba038df0, 0x7ff1ba04d07d), 3 [0x5e9b28, 0x5e9b2b), \nINFO: Loaded 2 PC tables (82576 PCs): 82573 [0x7ff1ba04d080,0x7ff1ba18f950), 3 [0x5a6af8,0x5a6b28), \nINFO:    20907 files found in /github/workspace/cifuzz-corpus/fuzz-unit-file\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 604973 bytes\nINFO: seed corpus: files: 20907 min: 1b max: 604973b total: 16005340b rss: 61Mb\n=================================================================\n==78==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000005078 at pc 0x0000004ddffa bp 0x7ffc2e6825c0 sp 0x7ffc2e6825b8\nREAD of size 4 at 0x602000005078 thread T0\nSCARINESS: 27 (4-byte-read-heap-buffer-overflow-far-from-bounds)\n    #0 0x4ddff9 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16\n    #1 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #2 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #3 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #4 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #5 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #6 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #7 0x7ff1b900c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n    #8 0x41f6ed in _start (build-out/fuzz-unit-file+0x41f6ed)\n\nDEDUP_TOKEN: LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*)\n0x602000005078 is located 38 bytes to the right of 2-byte region [0x602000005050,0x602000005052)\nfreed by thread T0 here:\n    #0 0x4a0882 in __interceptor_free /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:52:3\n    #1 0x4ddfb7 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:29:9\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7ff1b900c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: __interceptor_free--LLVMFuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\npreviously allocated by thread T0 here:\n    #0 0x4a0b26 in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3\n    #1 0x4ddfac in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:28:25\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7ff1b900c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: malloc--samLLVM2FuzzerTestOneInput --fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\nSUMMARY: AddressSanitizer: heap-buffer-overflow /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16 in samsamLLVM2FuzzerTestOneInput\nShadow bytes around the buggy address:\n  0x0c047fff89b0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89c0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89d0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89e0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89f0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n=>0x0c047fff8a00: fa fa 00 02 fa fa 00 02 fa fa fd fa fa fa fa[fa]\n  0x0c047fff8a10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07 \n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==78==ABORTING\nMS: 0 ; base unit: 0000000000000000000000000000000000000000\n0x61,0x75,0x74,0x6f,0x6d,0x6f,0x75,0x6e,0x74,0x48,\nautomountH\nartifact_prefix='/tmp/tmpjhswtxiw/'; Test unit written to /tmp/tmpjhswtxiw/crash-7be9e0f3a71d95f8d5e67c5a9d84273d6f4e3c03\nBase64: YXV0b21vdW50SA==\nstat::number_of_executed_units: 314\nstat::average_exec_per_sec:     0\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              68\n"
  },
  {
    "path": "infra/cifuzz/test_data/sarif_utils_systemd_stack.txt",
    "content": "/github/workspace/build-out/fuzz-bus-label -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpsngf52cy/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bus-label >fuzz-0.log 2>&1\n================== Job 0 exited with exit code 0 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (82577 inline 8-bit counters): 82573 [0x7fc55e6bedf0, 0x7fc55e6d307d), 4 [0x5e9c28, 0x5e9c2c), \n2023-05-04 01:02:55,065 - root - INFO - Not reporting crash in fuzz-bus-label because process timed out.\n2023-05-04 01:02:55,069 - root - INFO - Deleting corpus and seed corpus of fuzz-bus-label to save disk.\nINFO: Loaded 2 PC tables (82577 PCs): 82573 [0x7fc55e6d3080,0x7fc55e815950), 4 [0x5a6c78,0x5a6cb8), \nINFO:      256 files found in /github/workspace/cifuzz-corpus/fuzz-bus-label\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes\nINFO: seed corpus: files: 256 min: 1b max: 5242880b total: 30968483b rss: 48Mb\n#257\tINITED cov: 41 ft: 230 corp: 111/4360b exec/s: 0 rss: 73Mb\n#131072\tpulse  cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43690 rss: 76Mb\n#262144\tpulse  cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43690 rss: 76Mb\n#524288\tpulse  cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43690 rss: 77Mb\n#609082\tDONE   cov: 41 ft: 230 corp: 111/4360b lim: 1048576 exec/s: 43505 rss: 77Mb\nDone 609082 runs in 14 second(s)\nstat::number_of_executed_units: 609082\nstat::average_exec_per_sec:     43505\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              77\n/github/workspace/build-out/fuzz-bus-label -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpsngf52cy/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bus-label >fuzz-1.log 2>&1\n2023-05-04 01:02:55,082 - root - INFO - Deleting fuzz target: fuzz-bus-label.\n2023-05-04 01:02:55,083 - root - INFO - Done deleting.\n2023-05-04 01:02:55,084 - root - INFO - Fuzzer fuzz-bus-label finished running without reportable crashes.\n2023-05-04 01:02:55,084 - root - INFO - Running fuzzer: fuzz-dhcp-server.\n2023-05-04 01:02:55,085 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-dhcp-server/public.zip\n2023-05-04 01:02:55,088 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:02:55,145 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-dhcp-server/public.zip HTTP/1.1\" 200 806749\n2023-05-04 01:02:55,350 - root - INFO - Starting fuzzing\nFuzzing logs:\n/github/workspace/build-out/fuzz-dhcp-server -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpyxgwwsvr/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-dhcp-server >fuzz-0.log 2>&1\n================== Job 0 exited with exit code 0 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (83640 inline 8-bit counters): 82573 [0x7fe86ff70df0, 0x7fe86ff8507d), 1067 [0x60c638, 0x60ca63), \nINFO: Loaded 2 PC tables (83640 PCs): 82573 [0x7fe86ff85080,0x7fe8700c7950), 1067 [0x60ca68,0x610d18), \nINFO:     1153 files found in /github/workspace/cifuzz-corpus/fuzz-dhcp-server\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes\nINFO: seed corpus: files: 1153 min: 1b max: 5242879b total: 17056071b rss: 50Mb\n#1155\tINITED cov: 577 ft: 1116 corp: 203/54Kb exec/s: 0 rss: 86Mb\n#1167\tNEW    cov: 577 ft: 1117 corp: 204/54Kb lim: 1048576 exec/s: 0 rss: 86Mb L: 243/1071 MS: 2 ChangeASCIIInt-CrossOver-\n#1509\tNEW    cov: 577 ft: 1118 corp: 205/54Kb lim: 1048576 exec/s: 0 rss: 86Mb L: 243/1071 MS: 2 ChangeBit-CopyPart-\n#63018\tNEW    cov: 577 ft: 1119 corp: 206/55Kb lim: 1048576 exec/s: 21006 rss: 86Mb L: 245/1071 MS: 4 InsertByte-ChangeByte-CMP-InsertByte- DE: \"2\\000\\000\\000\\000\\000\\000\\000\"-\n#65536\tpulse  cov: 577 ft: 1119 corp: 206/55Kb lim: 1048576 exec/s: 21845 rss: 86Mb\nLoaded 1024/1155 files from /github/workspace/cifuzz-corpus/fuzz-dhcp-server\n#99784\tNEW    cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 19956 rss: 105Mb L: 243/1071 MS: 2 ChangeASCIIInt-ChangeBinInt-\n#131072\tpulse  cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 21845 rss: 105Mb\n#262144\tpulse  cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 20164 rss: 105Mb\n#275639\tDONE   cov: 577 ft: 1120 corp: 207/55Kb lim: 1048576 exec/s: 19688 rss: 105Mb\n###### Recommended dictionary. ######\n\"2\\000\\000\\000\\000\\000\\000\\000\" # Uses: 17879\n###### End of recommended dictionary. ######\nDone 275639 runs in 14 second(s)\nstat::number_of_executed_units: 275639\nstat::average_exec_per_sec:     19688\nstat::new_units_added:          4\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              105\n/github/workspace/build-out/fuzz-dhcp-server -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpyxgwwsvr/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-dhcp-server >fuzz-1.log 2>&1\n2023-05-04 01:03:18,374 - root - INFO - Not reporting crash in fuzz-dhcp-server because process timed out.\n2023-05-04 01:03:18,377 - root - INFO - Deleting corpus and seed corpus of fuzz-dhcp-server to save disk.\n2023-05-04 01:03:18,399 - root - INFO - Deleting fuzz target: fuzz-dhcp-server.\n2023-05-04 01:03:18,400 - root - INFO - Done deleting.\n2023-05-04 01:03:18,400 - root - INFO - Fuzzer fuzz-dhcp-server finished running without reportable crashes.\n2023-05-04 01:03:18,401 - root - INFO - Running fuzzer: fuzz-bcd.\n2023-05-04 01:03:18,401 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-bcd/public.zip\n2023-05-04 01:03:18,404 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:03:18,582 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-bcd/public.zip HTTP/1.1\" 200 2293254\n2023-05-04 01:03:18,804 - root - INFO - Starting fuzzing\nFuzzing logs:\n/github/workspace/build-out/fuzz-bcd -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpgvqlyr8q/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bcd >fuzz-0.log 2>&1\n================== Job 0 exited with exit code 0 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (83175 inline 8-bit counters): 82573 [0x7f1b5387edf0, 0x7f1b5389307d), 602 [0x5f8718, 0x5f8972), \nINFO: Loaded 2 PC tables (83175 PCs): 82573 [0x7f1b53893080,0x7f1b539d5950), 602 [0x5f8978,0x5faf18), \nINFO:     1260 files found in /github/workspace/cifuzz-corpus/fuzz-bcd\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 946175 bytes\nINFO: seed corpus: files: 1260 min: 1b max: 946175b total: 10373697b rss: 48Mb\n#1261\tINITED cov: 137 ft: 653 corp: 282/1416Kb exec/s: 0 rss: 91Mb\n#65536\tpulse  cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 32768 rss: 98Mb\n#131072\tpulse  cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 32768 rss: 98Mb\n#262144\tpulse  cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 37449 rss: 98Mb\n#475081\tDONE   cov: 137 ft: 653 corp: 282/1416Kb lim: 946175 exec/s: 33934 rss: 98Mb\nDone 475081 runs in 14 second(s)\nstat::number_of_executed_units: 475081\nstat::average_exec_per_sec:     33934\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              98\n/github/workspace/build-out/fuzz-bcd -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpgvqlyr8q/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-bcd >fuzz-1.log 2>&1\n2023-05-04 01:03:41,821 - root - INFO - Not reporting crash in fuzz-bcd because process timed out.\n2023-05-04 01:03:41,822 - root - INFO - Deleting corpus and seed corpus of fuzz-bcd to save disk.\n2023-05-04 01:03:41,848 - root - INFO - Deleting fuzz target: fuzz-bcd.\n2023-05-04 01:03:41,848 - root - INFO - Done deleting.\n2023-05-04 01:03:41,848 - root - INFO - Fuzzer fuzz-bcd finished running without reportable crashes.\n2023-05-04 01:03:41,848 - root - INFO - Running fuzzer: fuzz-varlink.\n2023-05-04 01:03:41,849 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-varlink/public.zip\n2023-05-04 01:03:41,852 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:03:41,906 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-varlink/public.zip HTTP/1.1\" 200 2586434\n2023-05-04 01:03:42,671 - root - INFO - Starting fuzzing\n2023-05-04 01:04:05,709 - root - INFO - Not reporting crash in fuzz-varlink because process timed out.\nFuzzing logs:\n/github/workspace/build-out/fuzz-varlink -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpbtf4f932/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-varlink >fuzz-0.log 2>&1\n2023-05-04 01:04:05,709 - root - INFO - Deleting corpus and seed corpus of fuzz-varlink to save disk.\n2023-05-04 01:04:05,806 - root - INFO - Deleting fuzz target: fuzz-varlink.\n2023-05-04 01:04:05,806 - root - INFO - Done deleting.\n2023-05-04 01:04:05,806 - root - INFO - Fuzzer fuzz-varlink finished running without reportable crashes.\n2023-05-04 01:04:05,806 - root - INFO - Running fuzzer: fuzz-unit-file.\n2023-05-04 01:04:05,807 - root - INFO - Downloading corpus from OSS-Fuzz: https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-unit-file/public.zip\n2023-05-04 01:04:05,809 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): storage.googleapis.com:443\n2023-05-04 01:04:05,897 - urllib3.connectionpool - DEBUG - https://storage.googleapis.com:443 \"GET /systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_fuzz-unit-file/public.zip HTTP/1.1\" 200 4999974\n2023-05-04 01:04:07,869 - root - INFO - Starting fuzzing\n2023-05-04 01:04:09,516 - root - INFO - Fuzzer: fuzz-unit-file. Detected bug.\nFuzzing logs:\n/github/workspace/build-out/fuzz-unit-file -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpjhswtxiw/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-unit-file >fuzz-0.log 2>&1\n2023-05-04 01:04:09,517 - root - INFO - Trying to reproduce crash using: /tmp/tmpjhswtxiw/crash-7be9e0f3a71d95f8d5e67c5a9d84273d6f4e3c03.\n================== Job 0 exited with exit code 77 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (82576 inline 8-bit counters): 82573 [0x7f3b0de4cdf0, 0x7f3b0de6107d), 3 [0x5e9b28, 0x5e9b2b), \nINFO: Loaded 2 PC tables (82576 PCs): 82573 [0x7f3b0de61080,0x7f3b0dfa3950), 3 [0x5a6af8,0x5a6b28), \nINFO:    20907 files found in /github/workspace/cifuzz-corpus/fuzz-unit-file\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 604973 bytes\nINFO: seed corpus: files: 20907 min: 1b max: 604973b total: 16005340b rss: 61Mb\n=================================================================\n==74==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000005078 at pc 0x0000004ddffa bp 0x7fffeea64fe0 sp 0x7fffeea64fd8\nREAD of size 4 at 0x602000005078 thread T0\nSCARINESS: 27 (4-byte-read-heap-buffer-overflow-far-from-bounds)\n    #0 0x4ddff9 in samLLVM2FuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16\n    #1 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #2 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #3 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #4 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #5 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #6 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #7 0x7f3b0ce20082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n    #8 0x41f6ed in _start (build-out/fuzz-unit-file+0x41f6ed)\n\nDEDUP_TOKEN: samLLVM2FuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*)\n0x602000005078 is located 38 bytes to the right of 2-byte region [0x602000005050,0x602000005052)\nfreed by thread T0 here:\n    #0 0x4a0882 in __interceptor_free /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:52:3\n    #1 0x4ddfb7 in samLLVM2FuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:29:9\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7f3b0ce20082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: __interceptor_free--samLLVM2FuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\npreviously allocated by thread T0 here:\n    #0 0x4a0b26 in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3\n    #1 0x4ddfac in samLLVM2FuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:28:25\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7f3b0ce20082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: malloc--samLLVM2FuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\nSUMMARY: AddressSanitizer: heap-buffer-overflow /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16 in samLLVM2FuzzerTestOneInput\nShadow bytes around the buggy address:\n  0x0c047fff89b0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89c0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89d0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89e0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89f0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n=>0x0c047fff8a00: fa fa 00 02 fa fa 00 02 fa fa fd fa fa fa fa[fa]\n  0x0c047fff8a10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07 \n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==74==ABORTING\nMS: 0 ; base unit: 0000000000000000000000000000000000000000\n0x61,0x75,0x74,0x6f,0x6d,0x6f,0x75,0x6e,0x74,0x48,\nautomountH\nartifact_prefix='/tmp/tmpjhswtxiw/'; Test unit written to /tmp/tmpjhswtxiw/crash-7be9e0f3a71d95f8d5e67c5a9d84273d6f4e3c03\nBase64: YXV0b21vdW50SA==\nstat::number_of_executed_units: 314\nstat::average_exec_per_sec:     0\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              67\n/github/workspace/build-out/fuzz-unit-file -timeout=25 -rss_limit_mb=2560 -len_control=0 -seed=1337 -artifact_prefix=/tmp/tmpjhswtxiw/ -max_total_time=13 -print_final_stats=1 /github/workspace/cifuzz-corpus/fuzz-unit-file >fuzz-1.log 2>&1\n================== Job 1 exited with exit code 77 ============\nINFO: Running with entropic power schedule (0xFF, 100).\nINFO: Seed: 1337\nINFO: Loaded 2 modules   (82576 inline 8-bit counters): 82573 [0x7ff1ba038df0, 0x7ff1ba04d07d), 3 [0x5e9b28, 0x5e9b2b), \nINFO: Loaded 2 PC tables (82576 PCs): 82573 [0x7ff1ba04d080,0x7ff1ba18f950), 3 [0x5a6af8,0x5a6b28), \nINFO:    20907 files found in /github/workspace/cifuzz-corpus/fuzz-unit-file\nINFO: -max_len is not provided; libFuzzer will not generate inputs larger than 604973 bytes\nINFO: seed corpus: files: 20907 min: 1b max: 604973b total: 16005340b rss: 61Mb\n=================================================================\n==78==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000005078 at pc 0x0000004ddffa bp 0x7ffc2e6825c0 sp 0x7ffc2e6825b8\nREAD of size 4 at 0x602000005078 thread T0\nSCARINESS: 27 (4-byte-read-heap-buffer-overflow-far-from-bounds)\n    #0 0x4ddff9 in samLLVM2FuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16\n    #1 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #2 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #3 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #4 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #5 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #6 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #7 0x7ff1b900c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n    #8 0x41f6ed in _start (build-out/fuzz-unit-file+0x41f6ed)\n\nDEDUP_TOKEN: samLLVM2FuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)--fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*)\n0x602000005078 is located 38 bytes to the right of 2-byte region [0x602000005050,0x602000005052)\nfreed by thread T0 here:\n    #0 0x4a0882 in __interceptor_free /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:52:3\n    #1 0x4ddfb7 in samLLVM2FuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:29:9\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7ff1b900c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: __interceptor_free--samLLVM2FuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\npreviously allocated by thread T0 here:\n    #0 0x4a0b26 in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3\n    #1 0x4ddfac in samLLVM2FuzzerTestOneInput /work/build/../../src/systemd/src/core/fuzz-unit-file.c:28:25\n    #2 0x4fc653 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15\n    #3 0x4fbe3a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3\n    #4 0x4fdca4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7\n    #5 0x4fded9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3\n    #6 0x4ed53f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6\n    #7 0x516b92 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10\n    #8 0x7ff1b900c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)\n\nDEDUP_TOKEN: malloc--samLLVM2FuzzerTestOneInput--fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)\nSUMMARY: AddressSanitizer: heap-buffer-overflow /work/build/../../src/systemd/src/core/fuzz-unit-file.c:30:16 in samsamLLVM2FuzzerTestOneInput\nShadow bytes around the buggy address:\n  0x0c047fff89b0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89c0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89d0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89e0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x0c047fff89f0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n=>0x0c047fff8a00: fa fa 00 02 fa fa 00 02 fa fa fd fa fa fa fa[fa]\n  0x0c047fff8a10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x0c047fff8a50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07 \n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==78==ABORTING\nMS: 0 ; base unit: 0000000000000000000000000000000000000000\n0x61,0x75,0x74,0x6f,0x6d,0x6f,0x75,0x6e,0x74,0x48,\nautomountH\nartifact_prefix='/tmp/tmpjhswtxiw/'; Test unit written to /tmp/tmpjhswtxiw/crash-7be9e0f3a71d95f8d5e67c5a9d84273d6f4e3c03\nBase64: YXV0b21vdW50SA==\nstat::number_of_executed_units: 314\nstat::average_exec_per_sec:     0\nstat::new_units_added:          0\nstat::slowest_unit_time_sec:    0\nstat::peak_rss_mb:              68\n"
  },
  {
    "path": "infra/cifuzz/test_helpers.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Contains convenient helpers for writing tests.\"\"\"\n\nimport contextlib\nimport os\nimport sys\nimport shutil\nimport tempfile\nfrom unittest import mock\n\nimport config_utils\nimport docker\nimport workspace_utils\n\nINFRA_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n# pylint: disable=wrong-import-position,import-error\nsys.path.append(INFRA_DIR)\n\nimport helper\n\n\n# TODO(metzman): Get rid of these decorators.\n@mock.patch('config_utils._is_dry_run', return_value=True)\n@mock.patch('platform_config.BasePlatformConfig.project_src_path',\n            return_value=None)\n@mock.patch('os.path.basename', return_value=None)\ndef _create_config(config_cls, _, __, ___, **kwargs):\n  \"\"\"Creates a config object from |config_cls| and then sets every attribute\n  that is a key in |kwargs| to the corresponding value. Asserts that each key in\n  |kwargs| is an attribute of config.\"\"\"\n  with mock.patch('config_utils.BaseConfig.validate', return_value=True):\n    config = config_cls()\n  for key, value in kwargs.items():\n    assert hasattr(config, key), 'Config doesn\\'t have attribute: ' + key\n    setattr(config, key, value)\n\n  return config\n\n\ndef create_build_config(**kwargs):\n  \"\"\"Wrapper around _create_config for build configs.\"\"\"\n  return _create_config(config_utils.BuildFuzzersConfig, **kwargs)\n\n\ndef create_run_config(**kwargs):\n  \"\"\"Wrapper around _create_config for run configs.\"\"\"\n  return _create_config(config_utils.RunFuzzersConfig, **kwargs)\n\n\ndef create_workspace(workspace_path='/workspace'):\n  \"\"\"Returns a workspace located at |workspace_path| ('/workspace' by\n  default).\"\"\"\n  config = create_run_config(workspace=workspace_path)\n  return workspace_utils.Workspace(config)\n\n\ndef patch_environ(testcase_obj, env=None, empty=False, runner=False):\n  \"\"\"Patch environment. |testcase_obj| is the unittest.TestCase that contains\n  tests. |env|, if specified, is a dictionary of environment variables to start\n  from. If |empty| is True then the new patched environment will be empty. If\n  |runner| is True then the necessary environment variables will be set to run\n  the scripts from base-runner.\"\"\"\n  if env is None:\n    env = {}\n\n  patcher = mock.patch.dict(os.environ, env)\n  testcase_obj.addCleanup(patcher.stop)\n  patcher.start()\n  if empty:\n    for key in os.environ.copy():\n      del os.environ[key]\n\n  if runner:\n    # Add the scripts for base-runner to the path since the wont be in\n    # /usr/local/bin on host machines during testing.\n    base_runner_dir = os.path.join(INFRA_DIR, 'base-images', 'base-runner')\n    os.environ['PATH'] = (os.environ.get('PATH', '') + os.pathsep +\n                          base_runner_dir)\n    if 'GOPATH' not in os.environ:\n      # A GOPATH must be set or else the coverage script fails, even for getting\n      # the coverage of non-Go programs.\n      os.environ['GOPATH'] = '/root/go'\n\n\n@contextlib.contextmanager\ndef temp_dir_copy(directory):\n  \"\"\"Context manager that yields a temporary copy of |directory|.\"\"\"\n  with tempfile.TemporaryDirectory() as temp_dir:\n    temp_copy_path = os.path.join(temp_dir, os.path.basename(directory))\n    shutil.copytree(directory, temp_copy_path)\n    yield temp_copy_path\n\n\n@contextlib.contextmanager\ndef docker_temp_dir():\n  \"\"\"Returns a temporary a directory that is useful for use with docker. On\n  cleanup this contextmanager uses docker to delete the directory's contents so\n  that if anything is owned by root it can be deleted (which\n  tempfile.TemporaryDirectory() cannot do) by non-root users.\"\"\"\n  with tempfile.TemporaryDirectory() as temp_dir:\n    yield temp_dir\n    helper.docker_run([\n        '-v', f'{temp_dir}:/temp_dir', '-t', docker.BASE_BUILDER_TAG,\n        '/bin/bash', '-c', 'rm -rf /temp_dir/*'\n    ])\n"
  },
  {
    "path": "infra/cifuzz/workspace_utils.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for representing the workspace directory which CIFuzz uses.\"\"\"\n\nimport os\nimport shutil\n\n\nclass Workspace:\n  \"\"\"Class representing the workspace directory.\"\"\"\n\n  def __init__(self, config):\n    self.workspace = config.workspace\n\n  def initialize_dir(self, directory):  # pylint: disable=no-self-use\n    \"\"\"Creates directory if it doesn't already exist, otherwise does nothing.\"\"\"\n    os.makedirs(directory, exist_ok=True)\n\n  @property\n  def repo_storage(self):\n    \"\"\"The parent directory for repo storage.\"\"\"\n    return os.path.join(self.workspace, 'storage')\n\n  @property\n  def out(self):\n    \"\"\"The out directory used for storing the fuzzer build built by\n    build_fuzzers.\"\"\"\n    # Don't use 'out' because it needs to be used by artifacts.\n    return os.path.join(self.workspace, 'build-out')\n\n  @property\n  def work(self):\n    \"\"\"The directory used as the work directory for the fuzzer build/run.\"\"\"\n    return os.path.join(self.workspace, 'work')\n\n  @property\n  def artifacts(self):\n    \"\"\"The directory used to store artifacts for download by CI-system users.\"\"\"\n    # This is hardcoded by a lot of clients, so we need to use this.\n    return os.path.join(self.workspace, 'out', 'artifacts')\n\n  @property\n  def clusterfuzz_build(self):\n    \"\"\"The directory where builds from ClusterFuzz are stored.\"\"\"\n    return os.path.join(self.workspace, 'cifuzz-prev-build')\n\n  @property\n  def clusterfuzz_coverage(self):\n    \"\"\"The directory where builds from ClusterFuzz are stored.\"\"\"\n    return os.path.join(self.workspace, 'cifuzz-prev-coverage')\n\n  @property\n  def coverage_report(self):\n    \"\"\"The directory where coverage reports generated by cifuzz are put.\"\"\"\n    return os.path.join(self.workspace, 'cifuzz-coverage')\n\n  @property\n  def corpora(self):\n    \"\"\"The directory where corpora from ClusterFuzz are stored.\"\"\"\n    return os.path.join(self.workspace, 'cifuzz-corpus')\n\n  @property\n  def pruned_corpora(self):\n    \"\"\"The directory where pruned corpora are stored.\"\"\"\n    return os.path.join(self.workspace, 'cifuzz-pruned-corpus')\n\n  @property\n  def sarif(self):\n    \"\"\"The directory where sarif files are stored.\"\"\"\n    return os.path.join(self.workspace, 'cifuzz-sarif')\n\n  def make_repo_for_sarif(self, repo_manager):\n    \"\"\"Copies the repo over for the sarif upload GitHub action.\"\"\"\n    return shutil.copytree(repo_manager.repo_dir, self.sarif, symlinks=True)\n"
  },
  {
    "path": "infra/common_utils.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Common utilities for OSS-Fuzz infrastructure.\"\"\"\n\nimport logging\nimport os\nimport re\nimport shlex\nimport subprocess\n\nimport constants\n\nOSS_FUZZ_DIR = os.environ.get(\n    'OSS_FUZZ_DIR', os.path.abspath(os.path.dirname(os.path.dirname(__file__))))\nBUILD_DIR = os.path.join(OSS_FUZZ_DIR, 'build')\n\nBASE_RUNNER_IMAGE = 'gcr.io/oss-fuzz-base/base-runner'\n\nBASE_IMAGES = {\n    'generic': [\n        'gcr.io/oss-fuzz-base/base-image',\n        'gcr.io/oss-fuzz-base/base-clang',\n        'gcr.io/oss-fuzz-base/base-builder',\n        BASE_RUNNER_IMAGE,\n        'gcr.io/oss-fuzz-base/base-runner-debug',\n    ],\n    'go': ['gcr.io/oss-fuzz-base/base-builder-go'],\n    'javascript': ['gcr.io/oss-fuzz-base/base-builder-javascript'],\n    'jvm': ['gcr.io/oss-fuzz-base/base-builder-jvm'],\n    'python': ['gcr.io/oss-fuzz-base/base-builder-python'],\n    'rust': ['gcr.io/oss-fuzz-base/base-builder-rust'],\n    'ruby': ['gcr.io/oss-fuzz-base/base-builder-ruby'],\n    'swift': ['gcr.io/oss-fuzz-base/base-builder-swift'],\n}\n\nPROJECT_LANGUAGE_REGEX = re.compile(r'\\s*language\\s*:\\s*([^\\s]+)')\nBASE_OS_VERSION_REGEX = re.compile(r'\\s*base_os_version\\s*:\\s*([^\\s]+)')\n\nlogger = logging.getLogger(__name__)\n\n\ndef get_project_build_subdir(project, subdir_name):\n  \"\"\"Creates the |subdir_name| subdirectory of the |project| subdirectory in\n  |BUILD_DIR| and returns its path.\"\"\"\n  directory = os.path.join(BUILD_DIR, subdir_name, project)\n  os.makedirs(directory, exist_ok=True)\n\n  return directory\n\n\ndef get_out_dir(project=''):\n  \"\"\"Creates and returns path to /out directory for the given project (if\n  specified).\"\"\"\n  return get_project_build_subdir(project, 'out')\n\n\nclass Project:\n  \"\"\"Class representing a project that is in OSS-Fuzz or an external project\n  (ClusterFuzzLite user).\"\"\"\n\n  def __init__(\n      self,\n      project_name_or_path,\n      is_external=False,\n      build_integration_path=constants.DEFAULT_EXTERNAL_BUILD_INTEGRATION_PATH):\n    self.is_external = is_external\n    if self.is_external:\n      self.path = os.path.abspath(project_name_or_path)\n      self.name = os.path.basename(self.path)\n      self.build_integration_path = os.path.join(self.path,\n                                                 build_integration_path)\n    else:\n      self.name = project_name_or_path\n      self.path = os.path.join(OSS_FUZZ_DIR, 'projects', self.name)\n      self.build_integration_path = self.path\n\n  @property\n  def dockerfile_path(self):\n    \"\"\"Returns path to the project Dockerfile.\"\"\"\n    return os.path.join(self.build_integration_path, 'Dockerfile')\n\n  @property\n  def language(self):\n    \"\"\"Returns project language.\"\"\"\n    project_yaml_path = os.path.join(self.build_integration_path,\n                                     'project.yaml')\n    if not os.path.exists(project_yaml_path):\n      logger.warning('No project.yaml. Assuming c++.')\n      return constants.DEFAULT_LANGUAGE\n\n    with open(project_yaml_path) as file_handle:\n      content = file_handle.read()\n      for line in content.splitlines():\n        match = PROJECT_LANGUAGE_REGEX.match(line)\n        if match:\n          return match.group(1)\n\n    logger.warning('Language not specified in project.yaml. Assuming c++.')\n    return constants.DEFAULT_LANGUAGE\n\n  @property\n  def base_os_version(self):\n    \"\"\"Returns the project's base OS version.\"\"\"\n    project_yaml_path = os.path.join(self.build_integration_path,\n                                     'project.yaml')\n    if not os.path.exists(project_yaml_path):\n      return 'legacy'\n\n    with open(project_yaml_path) as file_handle:\n      content = file_handle.read()\n      for line in content.splitlines():\n        match = BASE_OS_VERSION_REGEX.match(line)\n        if match:\n          return match.group(1)\n\n    return 'legacy'\n\n  @property\n  def coverage_extra_args(self):\n    \"\"\"Returns project coverage extra args.\"\"\"\n    project_yaml_path = os.path.join(self.build_integration_path,\n                                     'project.yaml')\n    if not os.path.exists(project_yaml_path):\n      logger.warning('project.yaml not found: %s.', project_yaml_path)\n      return ''\n\n    with open(project_yaml_path) as file_handle:\n      content = file_handle.read()\n\n    coverage_flags = ''\n    read_coverage_extra_args = False\n    # Pass the yaml file and extract the value of the coverage_extra_args key.\n    # This is naive yaml parsing and we do not handle comments at this point.\n    for line in content.splitlines():\n      if read_coverage_extra_args:\n        # Break reading coverage args if a new yaml key is defined.\n        if len(line) > 0 and line[0] != ' ':\n          break\n        coverage_flags += line\n      if 'coverage_extra_args' in line:\n        read_coverage_extra_args = True\n        # Include the first line only if it's not a multi-line value.\n        if 'coverage_extra_args: >' not in line:\n          coverage_flags += line.replace('coverage_extra_args: ', '')\n    return coverage_flags\n\n  @property\n  def out(self):\n    \"\"\"Returns the out dir for the project. Creates it if needed.\"\"\"\n    return get_out_dir(self.name)\n\n  @property\n  def work(self):\n    \"\"\"Returns the out dir for the project. Creates it if needed.\"\"\"\n    return get_project_build_subdir(self.name, 'work')\n\n  @property\n  def corpus(self):\n    \"\"\"Returns the out dir for the project. Creates it if needed.\"\"\"\n    return get_project_build_subdir(self.name, 'corpus')\n\n\ndef is_base_image(image_name):\n  \"\"\"Checks if the image name is a base image.\"\"\"\n  return os.path.exists(os.path.join('infra', 'base-images', image_name))\n\n\ndef check_project_exists(project):\n  \"\"\"Checks if a project exists.\"\"\"\n  if os.path.exists(project.path):\n    return True\n\n  if project.is_external:\n    descriptive_project_name = project.path\n  else:\n    descriptive_project_name = project.name\n\n  logger.error('\"%s\" does not exist.', descriptive_project_name)\n  return False\n\n\ndef get_command_string(command):\n  \"\"\"Returns a shell escaped command string.\"\"\"\n  return ' '.join(shlex.quote(part) for part in command)\n\n\ndef docker_build(build_args):\n  \"\"\"Calls `docker build`.\"\"\"\n  command = ['docker', 'build']\n  command.extend(build_args)\n  logger.info('Running: %s.', get_command_string(command))\n\n  try:\n    subprocess.check_call(command)\n  except subprocess.CalledProcessError:\n    logger.error('Docker build failed.')\n    return False\n\n  return True\n\n\ndef docker_pull(image):\n  \"\"\"Call `docker pull`.\"\"\"\n  command = ['docker', 'pull', image]\n  logger.info('Running: %s', get_command_string(command))\n\n  try:\n    subprocess.check_call(command)\n  except subprocess.CalledProcessError:\n    logger.error('Docker pull failed.')\n    return False\n\n  return True\n\n\ndef pull_images(language=None):\n  \"\"\"Pulls base images used to build projects in language lang (or all if lang\n  is None).\"\"\"\n  for base_image_lang, base_images in BASE_IMAGES.items():\n    if (language is None or base_image_lang == 'generic' or\n        base_image_lang == language):\n      for base_image in base_images:\n        if not docker_pull(base_image):\n          return False\n\n  return True\n\n\ndef build_image_impl(project, cache=True, pull=False, architecture='x86_64'):\n  \"\"\"Builds image.\"\"\"\n  image_name = project.name\n\n  if is_base_image(image_name):\n    image_project = 'oss-fuzz-base'\n    docker_build_dir = os.path.join(OSS_FUZZ_DIR, 'infra', 'base-images',\n                                    image_name)\n    dockerfile_path = os.path.join(docker_build_dir, 'Dockerfile')\n  else:\n    if not check_project_exists(project):\n      return False\n    dockerfile_path = project.dockerfile_path\n    docker_build_dir = project.path\n    image_project = 'oss-fuzz'\n\n  if pull and not pull_images(project.language):\n    return False\n\n  build_args = []\n  image_name = 'gcr.io/%s/%s' % (image_project, image_name)\n  if architecture == 'aarch64':\n    build_args += [\n        'buildx',\n        'build',\n        '--platform',\n        'linux/arm64',\n        '--progress',\n        'plain',\n        '--load',\n    ]\n  if not cache:\n    build_args.append('--no-cache')\n\n  build_args += ['-t', image_name, '--file', dockerfile_path]\n  build_args.append(docker_build_dir)\n\n  if architecture == 'aarch64':\n    command = ['docker'] + build_args\n    subprocess.check_call(command)\n    return True\n  return docker_build(build_args)\n"
  },
  {
    "path": "infra/constants.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Constants for OSS-Fuzz.\"\"\"\n\nDEFAULT_EXTERNAL_BUILD_INTEGRATION_PATH = '.clusterfuzzlite'\n\nDEFAULT_LANGUAGE = 'c++'\nDEFAULT_SANITIZER = 'address'\nDEFAULT_ARCHITECTURE = 'x86_64'\nDEFAULT_ENGINE = 'libfuzzer'\nLANGUAGES = [\n    'c',\n    'c++',\n    'go',\n    'javascript',\n    'jvm',\n    'python',\n    'rust',\n    'swift',\n    'ruby',\n]\nLANGUAGES_WITH_COVERAGE_SUPPORT = [\n    'c', 'c++', 'go', 'jvm', 'python', 'rust', 'swift', 'javascript', 'ruby'\n]\nSANITIZERS = [\n    'address',\n    'none',\n    'memory',\n    'undefined',\n    'thread',\n    'coverage',\n    'introspector',\n    'hwaddress',\n]\nARCHITECTURES = ['i386', 'x86_64', 'aarch64']\nENGINES = ['libfuzzer', 'afl', 'honggfuzz', 'centipede', 'none', 'wycheproof']\n"
  },
  {
    "path": "infra/experimental/SystemSan/Makefile",
    "content": ".POSIX:\nCXX     = clang++\nCFLAGS = -std=c++17 -Wall -Wextra -O3 -g3 -Werror\n\nall: SystemSan target target_file target_dns\n\nSystemSan: SystemSan.cpp inspect_dns.cpp inspect_utils.cpp\n\t$(CXX) $(CFLAGS) -lpthread -o $@ $^\n\n# Needs atheris.\npython-test: all\n\t./SystemSan python shell_injection_poc_fuzzer.py\n\ntarget: target.cpp\n\t$(CXX) $(CFLAGS) -fsanitize=address,fuzzer -o $@ $^\n\ntarget_file: target_file.cpp\n\t$(CXX) $(CFLAGS) -fsanitize=address,fuzzer -o $@ $^\n\ntarget_dns: target_dns.cpp\n\t$(CXX) $(CFLAGS) -fsanitize=address,fuzzer -o $@ $^\n\ntest:  all vuln.dict\n\t./SystemSan ./target -dict=vuln.dict\n\t./SystemSan ./target_file -dict=vuln.dict\n\t./SystemSan ./target_dns -dict=vuln.dict\n\npytorch-lightning-1.5.10:\n\tcp SystemSan.cpp PoEs/pytorch-lightning-1.5.10/; \\\n\tcd PoEs/pytorch-lightning-1.5.10/; \\\n\tdocker build . --tag syssan_pytorch-lightning; \\\n\tdocker run -t systemsan_pytorch-lightning:latest;\n\nnode-shell-quote-v1.7.3:\n\tcp SystemSan.cpp PoEs/node-shell-quote-v1.7.3/; \\\n\tcd PoEs/node-shell-quote-v1.7.3/; \\\n\tdocker build . --tag systemsan_node-shell-quote; \\\n\tdocker run -t systemsan_node-shell-quote:latest;\n\nclean:\n\trm -f SystemSan /tmp/tripwire target target_file target_dns\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/node-shell-quote-v1.7.3/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# Build and run the proof of error in shell-quote v1.7.3.\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt update && \\\n  apt install -y \\\n  vim \\\n  npm && \\\n  git clone \\\n    --depth 1 \\\n    https://github.com/substack/node-shell-quote.git && \\\n  npm config set @gitlab-org:registry \\\n    https://gitlab.com/api/v4/packages/npm/\n\nCOPY ./build.sh $SRC\nRUN  ./build.sh\n\nCOPY . $SRC\nRUN make SystemSan\n\nCMD [\"make\", \"run\"]\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/node-shell-quote-v1.7.3/Makefile",
    "content": ".POSIX:\nCXX     = clang++\nCFLAGS = -std=c++17 -Wall -Wextra -O3 -g3\n\nSystemSan: SystemSan.cpp\n\t$(CXX) $(CFLAGS) -lpthread -o $@ $^\n\nrun: clean SystemSan target.js\n\t./SystemSan jsfuzz ./target.js\n\nclean:\n\trm -f SystemSan /tmp/tripwire\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/node-shell-quote-v1.7.3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\nnpm install ./node-shell-quote/\n\n# Build fuzzers.\nnpm i -g @gitlab-org/jsfuzz\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/node-shell-quote-v1.7.3/target.js",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* Exploit shell quote with fuzzer's input as a parameter of echo.\n * This PoC is extended from a report in GitHub Advisory Database:\n * https://github.com/advisories/GHSA-g4rg-993r-mgx7\n * The original report records a shell injection exploit in shell-quote v1.7.2,\n * we show that a similar shell corruption exploit still persists in v1.7.3,\n * after a commit that intends to fix the original exploit.\n * */\n\n/* Fuzz the target program with buf generated by Jsfuzz. */\nfunction fuzz(buf) {\n    buf = String(buf)\n    const childProcess = require('child_process');\n    const shellQuote = require('shell-quote');\n    childProcess.execSync(shellQuote.quote(['echo', buf]));\n}\n\n/* Run Jsfuzz. */\nmodule.exports = {\n    fuzz\n};\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/pytorch-lightning-1.5.10/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# Build and run the proof of error in pytorch-lightning.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt update && \\\n  apt install -y vim && \\\n  git clone \\\n    --depth 1 \\\n    --branch 1.5.10 \\\n    https://github.com/PyTorchLightning/pytorch-lightning.git\n\nCOPY ./build.sh $SRC\nRUN  ./build.sh\n\nCOPY . $SRC\nRUN make SystemSan\n\nCMD [\"make\", \"run\"]\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/pytorch-lightning-1.5.10/Makefile",
    "content": ".POSIX:\nCXX     = clang++\nCFLAGS = -std=c++17 -Wall -Wextra -O3 -g3\n\nSystemSan: SystemSan.cpp\n\t$(CXX) $(CFLAGS) -lpthread -o $@ $^\n\nrun: clean SystemSan fuzz_pytorch_lightning.py\n\t./SystemSan ./fuzz_pytorch_lightning.py -dict=vuln.dict\n\nclean:\n\trm -f SystemSan /tmp/tripwire\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/pytorch-lightning-1.5.10/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\ncd pytorch-lightning\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/pytorch-lightning-1.5.10/fuzz_pytorch_lightning.py",
    "content": "#!/usr/local/bin/python3\n#\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Exploit pytorch lightning with fuzzer's input as a random env variable.\n\nThis PoC is extended from a report in GitHub Advisory Database:\nhttps://github.com/advisories/GHSA-r5qj-cvf9-p85h\nThe original report documents an exploit using a specific environment variable,\nwe show a way to achieve the same exploit with an arbitrary env variable.\n\"\"\"\n\nimport os\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n  from pytorch_lightning import Trainer\n  from pytorch_lightning.utilities.argparse import parse_env_variables\n\n\ndef prepare_fuzzing_input(data):\n  \"\"\"Prepare the data needed by the exploit with input data from fuzzers.\"\"\"\n  data = data.replace(b'\\0', b'')\n  env_name = 'AN_ARBITRARY_ENV_NAME'\n  return data, env_name\n\n\ndef exploit_target(env_value, env_name):\n  \"\"\"This target is based on a snippet from the official documentation of\n  `parse_env_variables`:\n  https://pytorch-lightning.readthedocs.io/en/stable/api/pytorch_lightning.utilities.argparse.html  # pylint: disable=line-too-long\n  It might not be the most realistic example,\n  but serves as a PoC to show that SystemSan works for Python.\"\"\"\n  os.environb[env_name.encode()] = env_value\n  parse_env_variables(Trainer, template=env_name)\n\n\ndef TestOneInput(data):  # pylint: disable=invalid-name\n  \"\"\"Exploit the target only with input data from fuzzers.\"\"\"\n  env_value, env_name = prepare_fuzzing_input(data)\n  exploit_target(env_value, env_name)\n\n\ndef main():\n  \"\"\"Fuzz target with atheris.\"\"\"\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/experimental/SystemSan/PoEs/pytorch-lightning-1.5.10/vuln.dict",
    "content": "\"os.system('/tmp/tripwire')\"\n"
  },
  {
    "path": "infra/experimental/SystemSan/README.md",
    "content": "# System Sanitizers\n\nWe use `ptrace` to instrument system calls made by the target program to detect\nvarious vulnerabilities.\n\n## Command injection\n\nThis detector currently works by\n\n- Checking if `execve` is called with `/tmp/tripwire` (which comes from our dictionary).\n- Checking if `execve` is invoking a shell with invalid syntax. This is likely\n  caused by our input.\n\n## Arbitrary file open\n\nTODO: documentation.\n\n## Proof of concept\n\n### Cleanup\nNote this will delete /tmp/tripwire if it exists.\n```shell\nmake clean\n```\n\n### Run test\nNote this will overwrite /tmp/tripwire if it exists.\n```shell\nmake test\n```\n\nLook for one of the following lines:\n\n> ===BUG DETECTED: Shell injection===\n\nwhich indicates the detection of executing the planted `/tmp/tripwire`.\n\n\n> ===BUG DETECTED: Shell corruption===\n\nwhich indicates the detection of executing a syntactic erroneous command.\n\n\n### Command injection PoC in Python with `pytorch-lightning`\nWith `SystemSan`, [`Artheris`](https://github.com/google/atheris) can detect a shell injection bug in [version v1.5.10 of `pytorch-lightning`](https://github.com/PyTorchLightning/pytorch-lightning/tree/1.5.0).\n```shell\nmake pytorch-lightning-1.5.10\n```\n\n### Command injection PoC in JavaScript with `shell-quote`\nWith `SystemSan`, [`Jsfuzz`](https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz) can detect a shell corrpution bug in [the latest version (v1.7.3) of `shell-quote`](https://github.com/substack/node-shell-quote) without any seed.\n```shell\nmake node-shell-quote-v1.7.3\n```\nThis is based on [a shell injection exploit report](https://wh0.github.io/2021/10/28/shell-quote-rce-exploiting.html) of [version v1.7.2 of `shell-quote`](https://github.com/substack/node-shell-quote/tree/v1.7.2).\n`SystemSan` can also discover the same shell injection bug with a corpus file containing:\n```\n`:`/tmp/tripwire``:`\n```\n\n## Trophies\n\n- <https://github.com/syoyo/tinygltf/issues/368>\n- <https://github.com/substack/node-shell-quote/issues/54>\n\n\n"
  },
  {
    "path": "infra/experimental/SystemSan/SystemSan.cpp",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* A detector that uses ptrace to identify shell injection vulnerabilities. */\n\n/* C standard library */\n#include <errno.h>\n#include <signal.h>\n#include <stdio.h>\n#include <string.h>\n\n/* POSIX */\n#include <sys/stat.h>\n#include <sys/user.h>\n#include <sys/wait.h>\n#include <unistd.h>\n\n/* Linux */\n#include <sys/ptrace.h>\n#include <syscall.h>\n#include <fcntl.h>\n\n#include <fstream>\n#include <iostream>\n#include <map>\n#include <set>\n#include <sstream>\n#include <string>\n#include <vector>\n\n#include \"inspect_utils.h\"\n#include \"inspect_dns.h\"\n\n#define DEBUG_LOGS 0\n\n#if DEBUG_LOGS\n#define debug_log(...)            \\\n  do {                            \\\n    fprintf(stderr, __VA_ARGS__); \\\n    fflush(stdout);               \\\n    fputc('\\n', stderr);          \\\n  } while (0)\n#else\n#define debug_log(...)\n#endif\n\n#define fatal_log(...)            \\\n  do {                            \\\n    fprintf(stderr, __VA_ARGS__); \\\n    fputc('\\n', stderr);          \\\n    exit(EXIT_FAILURE);           \\\n  } while (0)\n\n// The magic string that we'll use to detect full control over the command\n// executed.\nconst std::string kTripWire = \"/tmp/tripwire\";\n// Shell injection bug confirmed with /tmp/tripwire.\nconst std::string kInjectionError = \"Shell injection\";\n// Shell corruption bug detected based on syntax error.\nconst std::string kCorruptionError = \"Shell corruption\";\n// The magic string that we'll use to detect arbitrary file open\nconst std::string kFzAbsoluteDirectory = \"/fz/\";\n// Arbitrary file open in /fz/\nconst std::string kArbitraryFileOpenError = \"Arbitrary file open\";\n// Assuming only shorter (than this constant) top dir are legitly used.\nconstexpr int kRootDirMaxLength = 16;\n\n// The PID of the root process we're fuzzing.\npid_t g_root_pid;\n\n// Map of a PID/TID its PID/TID creator and wether it ran exec.\nstd::map<pid_t, ThreadParent> root_pids;\n\n// Assuming the longest pathname is \"/bin/bash\".\nconstexpr int kShellPathnameLength = 20;\n\n// Syntax error messages of each shell.\nconst std::map<std::string, std::set<std::string>> kShellSyntaxErrors = {\n    {\"bash\",\n     {\n         \": command not found\",  // General\n         \": syntax error\",       // Unfinished \" or ' or ` or if, leading | or ;\n         \": missing `]'\",        // Unfinished [\n         \": event not found\",    // ! leads large numbers\n         \": No such file or directory\",  // Leading < or /\n     }},\n    {\"csh\",\n     {\n         \": Command not found.\",         // General\n         \": Missing }.\",                 // Unfinished {\n         \"Too many ('s.\",                // Unfinished (\n         \"Invalid null command.\",        // Leading | or < or >\n         \"Missing name for redirect.\",   // Single < or >\n         \": No match.\",                  // Leading ? or [ or *\n         \"Modifier failed.\",             // Leading ^\n         \"No previous left hand side.\",  // A ^\n         \": No such job.\",               // Leading %\n         \": No current job.\",            // A %\n         \": Undefined variable.\",        // Containing $\n         \": Event not found.\",           // ! leads large numbers\n         // TODO: Make this more specific.\n         \"Unmatched\",  // Unfinished \" or ' or `, leading ;\n     }},\n    {\"dash\",\n     {\n         \"not found\",     // General\n         \"Syntax error\",  // Unfinished \" or ' or ` or if, leading | or ; or &\n         \"missing ]\",     // Unfinished [\n         \"No such file\",  // Leading <\n     }},\n    {\"zsh\",\n     {\n         \": command not found\",                // General\n         \": syntax error\",                     // Unfinished \" or ' or `\n         \": ']' expected\",                     // Unfinished [\n         \": no such file or directory\",        // Leading < or /\n         \": parse error near\",                 // Leading |, or &\n         \": no such user or named directory\",  // Leading ~\n     }},\n};\n\n// Shells used by Processes.\nstd::map<pid_t, std::string> g_shell_pids;\n\nstruct Tracee {\n  pid_t pid;\n  bool syscall_enter = true;\n\n  Tracee(pid_t pid) : pid(pid) {}\n};\n\npid_t run_child(char **argv) {\n  // Run the program under test with its args as a child process\n  pid_t pid = fork();\n  switch (pid) {\n    case -1:\n      fatal_log(\"Fork failed: %s\", strerror(errno));\n    case 0:\n      raise(SIGSTOP);\n      execvp(argv[0], argv);\n      fatal_log(\"execvp: %s\", strerror(errno));\n  }\n  return pid;\n}\n\n// Construct a string with the memory specified in a register.\nstd::string read_string(pid_t pid, unsigned long reg, unsigned long length) {\n  auto memory = read_memory(pid, reg, length);\n  if (!memory.size()) {\n    return \"\";\n  }\n\n  std::string content(reinterpret_cast<char *>(memory.data()),\n                      std::min(memory.size(), length));\n  return content;\n}\n\nvoid inspect_for_injection(pid_t pid, const user_regs_struct &regs) {\n  // Inspect a PID's registers for the sign of shell injection.\n  std::string path = read_string(pid, regs.rdi, kTripWire.length());\n  if (!path.length()) {\n    return;\n  }\n  debug_log(\"inspecting\");\n  if (path == kTripWire) {\n    report_bug(kInjectionError, pid);\n  }\n}\n\nstd::string get_pathname(pid_t pid, const user_regs_struct &regs) {\n  // Parse the pathname from the memory specified in the RDI register.\n  std::string pathname = read_string(pid, regs.rdi, kShellPathnameLength);\n  debug_log(\"Pathname is %s (len %lu)\\n\", pathname.c_str(), pathname.length());\n  return pathname;\n}\n\nstd::string match_shell(std::string binary_pathname);\n\n// Identify the exact shell behind sh\nstd::string identify_sh(std::string path) {\n  char shell_pathname[kShellPathnameLength];\n  auto written = readlink(path.c_str(), shell_pathname, kShellPathnameLength - 1);\n  if (written == -1) {\n    std::cerr << \"Cannot query which shell is behind sh: readlink failed on \"\n              << path << \": \"\n              << strerror(errno) << \"\\n\";\n    std::cerr << \"Assuming the shell is dash\\n\";\n    return \"dash\";\n  }\n  shell_pathname[written] = '\\0';\n\n  debug_log(\"sh links to %s\\n\", shell_pathname);\n  std::string shell_pathname_str(shell_pathname);\n\n  return match_shell(shell_pathname_str);\n}\n\nstd::string match_shell(std::string binary_pathname) {\n  // Identify the name of the shell used in the pathname.\n  if (!binary_pathname.length()) {\n    return \"\";\n  }\n\n  // We use c_str() to accept only the null terminated string.\n  std::string binary_name = binary_pathname.substr(\n      binary_pathname.find_last_of(\"/\") + 1).c_str();\n\n  debug_log(\"Binary is %s (%lu)\\n\", binary_name.c_str(),\n            binary_name.length());\n\n  for (const auto &item : kShellSyntaxErrors) {\n    std::string known_shell = item.first;\n    if (binary_name == \"sh\") {\n      debug_log(\"Matched sh: Needs to identify which specific shell it is.\\n\");\n      return identify_sh(binary_pathname);\n    }\n    if (binary_name == known_shell) {\n      debug_log(\"Matched %s\\n\", binary_name.c_str());\n      return known_shell;\n    }\n  }\n  return \"\";\n}\n\nstd::string get_shell(pid_t pid, const user_regs_struct &regs) {\n  // Get shell name used in a process.\n  std::string binary_pathname = get_pathname(pid, regs);\n  return match_shell(binary_pathname);\n}\n\nvoid match_error_pattern(std::string buffer, std::string shell, pid_t pid) {\n  auto error_patterns = kShellSyntaxErrors.at(shell);\n  for (const auto &pattern : error_patterns) {\n    if (buffer.find(pattern) != std::string::npos) {\n      std::cerr << \"--- Found a sign of shell corruption ---\\n\"\n                << buffer.c_str()\n                << \"\\n----------------------------------------\\n\";\n      // If a shell corruption error happens, kill its parent.\n      auto parent = root_pids[pid];\n      while (!parent.ran_exec) {\n        if (parent.parent_tid == g_root_pid) {\n          break;\n        }\n        parent = root_pids[parent.parent_tid];\n      }\n      report_bug(kCorruptionError, parent.parent_tid);\n    }\n  }\n}\n\nvoid inspect_for_corruption(pid_t pid, const user_regs_struct &regs) {\n  // Inspect a PID's registers for shell corruption.\n  std::string buffer = read_string(pid, regs.rsi, regs.rdx);\n  debug_log(\"Write buffer: %s\\n\", buffer.c_str());\n  match_error_pattern(buffer, g_shell_pids[pid], pid);\n}\n\nvoid log_file_open(std::string path, int flags, pid_t pid) {\n  report_bug(kArbitraryFileOpenError, pid);\n  std::cerr << \"===File opened: \" << path.c_str() << \", flags = \" << flags << \",\";\n  switch (flags & 3) {\n    case O_RDONLY:\n      std::cerr << \"O_RDONLY\";\n      break;\n    case O_WRONLY:\n      std::cerr << \"O_WRONLY\";\n      break;\n    case O_RDWR:\n      std::cerr << \"O_RDWR\";\n      break;\n    default:\n      std::cerr << \"unknown\";\n  }\n  std::cerr << \"===\\n\";\n}\n\nbool has_unprintable(const std::string &value) {\n  for (size_t i = 0; i < value.length(); i++) {\n    if (value[i] & 0x80) {\n      return true;\n    }\n  }\n  return false;\n}\n\nvoid inspect_for_arbitrary_file_open(pid_t pid, const user_regs_struct &regs) {\n  // Inspect a PID's register for the sign of arbitrary file open.\n  std::string path = read_string(pid, regs.rsi, kRootDirMaxLength);\n  if (!path.length()) {\n    return;\n  }\n  if (path.substr(0, kFzAbsoluteDirectory.length()) == kFzAbsoluteDirectory) {\n    log_file_open(path, regs.rdx, pid);\n    return;\n  }\n  if (path[0] == '/' && path.length() > 1) {\n    std::string path_absolute_topdir = path;\n    size_t root_dir_end = path.find('/', 1);\n    if (root_dir_end != std::string::npos) {\n      path_absolute_topdir = path.substr(0, root_dir_end);\n    }\n    if (has_unprintable(path_absolute_topdir)) {\n      struct stat dirstat;\n      if (stat(path_absolute_topdir.c_str(), &dirstat) != 0) {\n        log_file_open(path, regs.rdx, pid);\n      }\n    }\n  }\n}\n\nint trace(std::map<pid_t, Tracee> pids) {\n  unsigned long exit_status = 0;\n  while (!pids.empty()) {\n    std::vector<pid_t> new_pids;\n\n    auto it = pids.begin();\n\n    while (it != pids.end()) {\n      auto pid = it->first;\n      auto &tracee = it->second;\n      int status = 0;\n\n      int result = waitpid(pid, &status, __WALL | WNOHANG);\n      if (result == -1) {\n        it = pids.erase(it);\n        continue;\n      }\n\n      if (result == 0) {\n        // Nothing to report yet.\n        ++it;\n        continue;\n      }\n\n      if (WIFEXITED(status) || WIFSIGNALED(status)) {\n        debug_log(\"%d exited\", pid);\n        it = pids.erase(it);\n        // Remove pid from the watchlist when it exits\n        g_shell_pids.erase(pid);\n        root_pids.erase(pid);\n        continue;\n      }\n\n      // ptrace sets 0x80 for syscalls (with PTRACE_O_TRACESYSGOOD set).\n      bool is_syscall =\n          WIFSTOPPED(status) && WSTOPSIG(status) == (SIGTRAP | 0x80);\n      int sig = 0;\n      if (!is_syscall) {\n        // Handle generic signal.\n        siginfo_t siginfo;\n        if (ptrace(PTRACE_GETSIGINFO, pid, nullptr, &siginfo) == -1) {\n          debug_log(\"ptrace(PTRACE_GETSIGINFO, %d): %s\", pid, strerror(errno));\n          continue;\n        }\n        sig = siginfo.si_signo;\n        debug_log(\"forwarding signal %d to %d\", sig, pid);\n      }\n\n      if ((status >> 8 == (SIGTRAP | (PTRACE_EVENT_EXIT << 8)))) {\n        debug_log(\"%d exiting\", pid);\n        if (pid == g_root_pid) {\n          if (ptrace(PTRACE_GETEVENTMSG, pid, 0, &exit_status) == -1) {\n            debug_log(\"ptrace(PTRACE_GETEVENTMSG, %d): %s\", pid, strerror(errno));\n          }\n          debug_log(\"got exit status from root process: %lu\", exit_status);\n        }\n\n        if (ptrace(PTRACE_DETACH, pid, 0, 0) == -1) {\n          debug_log(\"ptrace(PTRACE_DETACH, %d): %s\", pid, strerror(errno));\n        }\n        continue;\n      }\n\n      if (WIFSTOPPED(status) &&\n          (status >> 8 == (SIGTRAP | (PTRACE_EVENT_CLONE << 8)) ||\n           status >> 8 == (SIGTRAP | (PTRACE_EVENT_FORK << 8)) ||\n           status >> 8 == (SIGTRAP | (PTRACE_EVENT_VFORK << 8)))) {\n        long new_pid;\n        if (ptrace(PTRACE_GETEVENTMSG, pid, 0, &new_pid) == -1) {\n          debug_log(\"ptrace(PTRACE_GETEVENTMSG, %d): %s\", pid, strerror(errno));\n          continue;\n        }\n        debug_log(\"forked %ld\", new_pid);\n        new_pids.push_back(new_pid);\n        root_pids.emplace(new_pid, ThreadParent(pid));\n      }\n\n      if (is_syscall) {\n        user_regs_struct regs;\n        if (ptrace(PTRACE_GETREGS, pid, 0, &regs) == -1) {\n          debug_log(\"ptrace(PTRACE_GETREGS, %d): %s\", pid, strerror(errno));\n          continue;\n        }\n\n        if (tracee.syscall_enter) {\n          if (regs.orig_rax == __NR_execve) {\n            // This is a new process.\n            auto parent = root_pids[pid];\n            parent.ran_exec = true;\n            root_pids[pid] = parent;\n            inspect_for_injection(pid, regs);\n            std::string shell = get_shell(pid, regs);\n            if (shell != \"\") {\n              debug_log(\"Shell parsed: %s\", shell.c_str());\n              g_shell_pids.insert(std::make_pair(pid, shell));\n            }\n          }\n\n          inspect_dns_syscalls(pid, regs);\n\n          if (regs.orig_rax == __NR_openat) {\n            // TODO(metzman): Re-enable this once we have config/flag support.\n            // inspect_for_arbitrary_file_open(pid, regs);\n          }\n\n          if (regs.orig_rax == __NR_write &&\n              g_shell_pids.find(pid) != g_shell_pids.end()) {\n            debug_log(\"Inspecting the `write` buffer of shell process %d.\",\n                      pid);\n            inspect_for_corruption(pid, regs);\n          }\n        }\n\n        // TODO: Check for commands with invalid syntax passed to /bin/sh and\n        // other shells.\n        // TODO: It's possible the process we're fuzzing can communicate with\n        // another process to execute code. Our check wouldn't catch this\n        // currently.\n        tracee.syscall_enter = !tracee.syscall_enter;\n      }\n\n      if (ptrace(PTRACE_SYSCALL, pid, nullptr, sig) == -1) {\n        debug_log(\"ptrace(PTRACE_SYSCALL, %d): %s\", pid, strerror(errno));\n        continue;\n      }\n\n      ++it;\n    }\n\n    for (const auto &pid : new_pids) {\n      pids.emplace(pid, Tracee(pid));\n    }\n  }\n  return static_cast<int>(exit_status >> 8);\n}\n\nint main(int argc, char **argv) {\n  if (argc <= 1) {\n    fatal_log(\"Expecting at least one arguments, received %d\", argc - 1);\n  }\n\n  // Create an executable tripwire file, as programs may check for existence\n  // before actually calling exec.\n  std::ofstream tripwire(kTripWire);\n  tripwire.close();\n  chmod(kTripWire.c_str(), 0755);\n\n  pid_t pid = run_child(argv + 1);\n\n  long options = PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEFORK |\n                 PTRACE_O_TRACEVFORK | PTRACE_O_TRACECLONE |\n                 PTRACE_O_TRACEEXIT;\n\n  if (ptrace(PTRACE_SEIZE, pid, nullptr, options) == -1) {\n    fatal_log(\"ptrace(PTRACE_SEIZE): %s\", strerror(errno));\n  }\n\n  if (waitpid(pid, nullptr, __WALL) == -1) {\n    fatal_log(\"waitpid: %s\", strerror(errno));\n  }\n\n  if (ptrace(PTRACE_SYSCALL, pid, 0, 0) == -1) {\n    fatal_log(\"ptrace(PTRACE_SYSCALL): %s\", strerror(errno));\n  }\n\n  g_root_pid = pid;\n  std::map<pid_t, Tracee> pids;\n  pids.emplace(pid, Tracee(pid));\n  root_pids.emplace(pid, ThreadParent(pid));\n  return trace(pids);\n}\n"
  },
  {
    "path": "infra/experimental/SystemSan/inspect_dns.cpp",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* A detector that uses ptrace to identify shell injection vulnerabilities. */\n\n/* POSIX */\n#include <sys/user.h>\n#include <unistd.h>\n\n/* Linux */\n#include <arpa/inet.h>\n#include <syscall.h>\n#include <sys/ptrace.h>\n\n#include <iostream>\n\n#include \"inspect_utils.h\"\n\n\n// Arbitrary domain name resolution.\nconst std::string kArbitraryDomainNameResolution = \"Arbitrary domain name resolution\";\n\n// Global constant for one file descriptor about of a DNS socket\nint kFdDns = 0;\nconst size_t kDnsHeaderLen = 12;\n\n\nvoid inspect_for_arbitrary_dns_connect(pid_t pid, const user_regs_struct &regs) {\n  auto memory = read_memory(pid, regs.rsi, sizeof(struct sockaddr_in));\n  if (memory.size()) {\n    struct sockaddr_in * sa = reinterpret_cast<struct sockaddr_in *>(memory.data());\n    if (sa->sin_family == AF_INET && htons(sa->sin_port) == 53) {\n      // save file descriptor for later sendmmsg\n      kFdDns = regs.rdi;\n    }\n  }\n}\n\nstruct DnsHeader {\n  uint16_t tx_id;\n  uint16_t flags;\n  uint16_t questions;\n  uint16_t answers;\n  uint16_t nameservers;\n  uint16_t additional;\n};\n\nstruct DnsHeader parse_dns_header(std::vector<std::byte> data) {\n  struct DnsHeader h;\n  h.tx_id = (((uint16_t) data[0]) << 8) | ((uint16_t) data[1]);\n  h.flags = (((uint16_t) data[2]) << 8) | ((uint16_t) data[3]);\n  h.questions = (((uint16_t) data[4]) << 8) | ((uint16_t) data[5]);\n  h.answers = (((uint16_t) data[6]) << 8) | ((uint16_t) data[7]);\n  h.nameservers = (((uint16_t) data[8]) << 8) | ((uint16_t) data[9]);\n  h.additional = (((uint16_t) data[10]) << 8) | ((uint16_t) data[11]);\n  return h;\n}\n\nbool dns_flags_standard_query(uint16_t flags) {\n  if ((flags & 0x8000) == 0) {\n    // Query, not response.\n    if (((flags & 0x7800) >> 11) == 0) {\n      // Opcode 0 is standard query.\n      if ((flags & 0x0200) == 0) {\n        // Message is not truncated.\n        if ((flags & 0x0040) == 0) {\n          // Z-bit reserved flag is unset.\n          return true;\n        }\n      }\n    }\n  }\n  return false;\n}\n\nstruct DnsRequest {\n  // Start of name in the byte vector.\n  size_t offset;\n  // End of name in the byte vector.\n  size_t end;\n  // Length of top level domain.\n  uint8_t tld_size;\n  // Number of levels/dots in domain name.\n  size_t nb_levels;\n  // DNS type like A is 1.\n  uint16_t dns_type;\n  // DNS class like IN is 1.\n  uint16_t dns_class;\n};\n\nstruct DnsRequest parse_dns_request(std::vector<std::byte> data, size_t offset) {\n  struct DnsRequest r;\n  r.offset = offset;\n  r.tld_size = 0;\n  r.nb_levels = 0;\n  while(offset < data.size()) {\n    uint8_t rlen = uint8_t(data[offset]);\n    if (rlen == 0) {\n      offset++;\n      break;\n    }\n    r.nb_levels++;\n    offset += rlen+1;\n    r.tld_size = rlen;\n  }\n  if (offset <= 4 + data.size()) {\n    r.end = offset;\n    r.dns_type = (((uint16_t) data[offset]) << 8) | ((uint16_t) data[offset+1]);\n    r.dns_class = (((uint16_t) data[offset+2]) << 8) | ((uint16_t) data[offset+3]);\n  } else {\n    r.end = data.size();\n  }\n  return r;\n}\n\nvoid log_dns_request(struct DnsRequest r, std::vector<std::byte> data) {\n  size_t offset = r.offset;\n  std::cerr << \"===Domain resolved: \";\n  while(offset < r.end) {\n    uint8_t rlen = uint8_t(data[offset]);\n    if (rlen == 0) {\n      break;\n    }\n    std::cerr << '.';\n    for (uint8_t i = 1; i < rlen+1; i++) {\n      std::cerr << (char) data[offset + i];\n    }\n    offset += rlen+1;\n  }\n  std::cerr << \"===\\n\";\n  std::cerr << \"===DNS request type: \" << r.dns_type << \", class: \" << r.dns_class << \"===\\n\";\n}\n\nvoid inspect_for_arbitrary_dns_pkt(std::vector<std::byte> data, pid_t pid) {\n  if (data.size() < kDnsHeaderLen + 1) {\n    return;\n  }\n  struct DnsHeader h = parse_dns_header(data);\n  if (h.questions != 1) {\n    return;\n  }\n  if (h.answers != 0 || h.nameservers != 0) {\n    return;\n  }\n  if (!dns_flags_standard_query(h.flags)) {\n    return;\n  }\n\n  struct DnsRequest req = parse_dns_request(data, kDnsHeaderLen);\n  // Alert if the top level domain is only one character and\n  // if there is more than just the TLD.\n  if (req.tld_size == 1 && req.nb_levels > 1 && req.end < data.size()) {\n    report_bug(kArbitraryDomainNameResolution, pid);\n    log_dns_request(req, data);\n  }\n}\n\nvoid inspect_for_arbitrary_dns_fdbuffer(pid_t pid, const user_regs_struct &regs) {\n  if (kFdDns > 0 && kFdDns == (int) regs.rdi) {\n    auto memory = read_memory(pid, regs.rsi, regs.rdx);\n    if (memory.size()) {\n      inspect_for_arbitrary_dns_pkt(memory, pid);\n    }\n  }\n}\n\nvoid inspect_for_arbitrary_dns_iov(pid_t pid, unsigned long iov) {\n  auto memory = read_memory(pid, iov, sizeof(struct iovec));\n  if (memory.size()) {\n    struct iovec * iovec = reinterpret_cast<struct iovec *>(memory.data());\n    memory = read_memory(pid, (unsigned long) iovec->iov_base, iovec->iov_len);\n    if (memory.size()) {\n      inspect_for_arbitrary_dns_pkt(memory, pid);\n    }\n  }\n}\n\nvoid inspect_for_arbitrary_dns_sendmsg(pid_t pid, const user_regs_struct &regs) {\n  if (kFdDns > 0 && kFdDns == (int) regs.rdi) {\n    auto memory = read_memory(pid, regs.rsi, sizeof(struct msghdr));\n    if (memory.size()) {\n      struct msghdr * msg = reinterpret_cast<struct msghdr *>(memory.data());\n      if (msg->msg_iovlen == 1) {\n        inspect_for_arbitrary_dns_iov(pid, (unsigned long) msg->msg_iov);\n      }\n    }\n  }\n}\n\nvoid inspect_for_arbitrary_dns_sendmmsg(pid_t pid, const user_regs_struct &regs) {\n  if (kFdDns > 0 && kFdDns == (int) regs.rdi) {\n    auto memory = read_memory(pid, regs.rsi, sizeof(struct mmsghdr));\n    if (memory.size()) {\n      struct mmsghdr * msg = reinterpret_cast<struct mmsghdr *>(memory.data());\n      if (msg->msg_hdr.msg_iovlen == 1) {\n        inspect_for_arbitrary_dns_iov(pid, (unsigned long) msg->msg_hdr.msg_iov);\n      }\n    }\n  }\n}\n\nvoid inspect_dns_syscalls(pid_t pid, const user_regs_struct &regs) {\n  switch (regs.orig_rax) {\n    case __NR_connect:\n      inspect_for_arbitrary_dns_connect(pid, regs);\n      break;\n    case __NR_close:\n      if (kFdDns > 0 && kFdDns == (int) regs.rdi) {\n        // reset DNS file descriptor on close\n        kFdDns = 0;\n      }\n      break;\n    case __NR_sendmmsg:\n      inspect_for_arbitrary_dns_sendmmsg(pid, regs);\n      break;\n    case __NR_sendmsg:\n      inspect_for_arbitrary_dns_sendmsg(pid, regs);\n      break;\n    case __NR_sendto:\n      // fallthrough\n    case __NR_write:\n      inspect_for_arbitrary_dns_fdbuffer(pid, regs);\n  }\n}\n"
  },
  {
    "path": "infra/experimental/SystemSan/inspect_dns.h",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* A detector that uses ptrace to identify DNS arbitrary resolutions. */\n\n\n/* POSIX */\n#include <unistd.h>\n\n/* Linux */\n#include <sys/ptrace.h>\n\n\nvoid inspect_dns_syscalls(pid_t pid, const user_regs_struct &regs);\n"
  },
  {
    "path": "infra/experimental/SystemSan/inspect_utils.cpp",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* A detector that uses ptrace to identify DNS arbitrary resolutions. */\n\n/* C standard library */\n#include <signal.h>\n\n/* POSIX */\n#include <unistd.h>\n\n/* Linux */\n#include <sys/ptrace.h>\n\n#include <iostream>\n#include <string>\n#include <vector>\n#include <map>\n\n#include \"inspect_utils.h\"\n\nextern pid_t g_root_pid;\nextern std::map<pid_t, ThreadParent> root_pids;\n\nstd::vector<std::byte> read_memory(pid_t pid, unsigned long long address,\n                                   size_t size) {\n  std::vector<std::byte> memory;\n\n  for (size_t i = 0; i < size; i += sizeof(long)) {\n    long word = ptrace(PTRACE_PEEKTEXT, pid, address + i, 0);\n    if (word == -1) {\n      return memory;\n    }\n\n    std::byte *word_bytes = reinterpret_cast<std::byte *>(&word);\n    memory.insert(memory.end(), word_bytes, word_bytes + sizeof(long));\n  }\n\n  return memory;\n}\n\nvoid report_bug(std::string bug_type, pid_t tid) {\n  // Report the bug found based on the bug code.\n  std::cerr << \"===BUG DETECTED: \" << bug_type.c_str() << \"===\\n\";\n  // Rely on sanitizers/libFuzzer to produce a stacktrace by sending SIGABRT\n  // to the root process.\n  // Note: this may not be reliable or consistent if shell injection happens\n  // in an async way.\n  // Find the thread group id, that is the pid.\n  pid_t pid = tid;\n  auto parent = root_pids[tid];\n  while (!parent.ran_exec) {\n    // Find the first parent which ran exec syscall.\n    if (parent.parent_tid == g_root_pid) {\n      break;\n    }\n    pid = parent.parent_tid;\n    parent = root_pids[parent.parent_tid];\n  }\n  tgkill(pid, tid, SIGABRT);\n}\n"
  },
  {
    "path": "infra/experimental/SystemSan/inspect_utils.h",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* A detector that uses ptrace to identify DNS arbitrary resolutions. */\n\n\n/* POSIX */\n#include <unistd.h>\n\n#include <string>\n#include <vector>\n\n// Structure to know which thread id triggered the bug.\nstruct ThreadParent {\n  // Parent thread ID, ie creator.\n  pid_t parent_tid;\n  // Current thread ID ran exec to become another process.\n  bool ran_exec = false;\n\n  ThreadParent() : parent_tid(0) {}\n  ThreadParent(pid_t tid) : parent_tid(tid) {}\n};\n\nstd::vector<std::byte> read_memory(pid_t pid, unsigned long long address,\n                                   size_t size);\n\nvoid report_bug(std::string bug_type, pid_t tid);\n"
  },
  {
    "path": "infra/experimental/SystemSan/target.cpp",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n/* A sample target program under test,\n * /tmp/tripwire or other commands will be injected into its shell command */\n\n#include <stdlib.h>\n#include <string>\n#include <iostream>\n\nextern \"C\" int LLVMFuzzerTestOneInput(char* data, size_t size) {\n  std::string str(data, size);\n  std::cout << \"INPUT\" << str << std::endl;\n  system(str.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "infra/experimental/SystemSan/target_dns.cpp",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string>\n#include <iostream>\n\n#include <string.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netdb.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(char* data, size_t size) {\n  std::string str(data, size);\n  std::cout << \"INPUT\" << str << std::endl;\n\n  struct addrinfo *result = NULL;\n\n  getaddrinfo(str.c_str(), NULL, NULL, &result);\n  if (result) {\n    freeaddrinfo(result);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "infra/experimental/SystemSan/target_file.cpp",
    "content": "/*\n * Copyright 2022 Google LLC\n\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n\n *      http://www.apache.org/licenses/LICENSE-2.0\n\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n/* A sample target program under test,\n * /tmp/tripwire or other commands will be injected into its shell command */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string>\n#include <iostream>\n\nextern \"C\" int LLVMFuzzerTestOneInput(char* data, size_t size) {\n  std::string str(data, size);\n  std::cout << \"INPUT\" << str << std::endl;\n  FILE *fp = fopen(str.c_str(), \"r\");\n  if (fp) {\n    fclose(fp);\n  }\n  return 0;\n}\n"
  },
  {
    "path": "infra/experimental/SystemSan/vuln.dict",
    "content": "\"/tmp/tripwire\"\n\"/fz/\"\n\"f.z\""
  },
  {
    "path": "infra/experimental/chronos/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/cloud-builders/gcloud\n\nRUN apt-get update && apt-get install -y jq"
  },
  {
    "path": "infra/experimental/chronos/README.md",
    "content": "# Chronos: rebuilding OSS-Fuzz harnesses using cached builds\n\nChronos is a utility tooling to enable fast re-building of OSS-Fuzz projects\nand analysis of projects' testing infrastructure. This is used by projects,\ne.g. [OSS-Fuzz-gen](https://github.com/google/oss-fuzz-gen) to help speed up\nvaluation processes during fuzzing harness generation.\n\nAt the core, Chronos relies on caching containers after project build, in order\nto enable fast rebuilding of a project following minor patches, and also enable\nrunning of the tests in a given project. To support this, Chronos creates a snapshot\nof a the docker container given project post build completion. This means that all `.o` files, generated\nconfiguations etc. persist in the docker container. These artifacts are then\nleverage for future \"replay builds\" where only a minor part of the project has changed,\ne.g. due to some patching on the project. This patching could be e.g. minor adjustments\nto the fuzzing harness source code e.g. by [oss-fuzz-gen](https://github.com/google/oss-fuzz-gen).\n\nAs such, at the core of Chronos are cached containers that are generated by taking a\nsnapshot of the container of a project post project build.\n\nChronos is focused on two features, rebuilding projects fast and running the\ntests of a given project.\n\n\n## Chronos features: fast rebuilding and running the tests of a project\n\n### CLI interface for Chronos\n\nThe default route to validating Chronos is using the CLI available in `infra/experimental/chronos/manager.py`\n\n### Chronos feature: Fast rebuilding\n\nChronos enables rebuilding projects efficiently in contexts where only a small patch\nneeds to be evalualted in the target. This is achieved by running a replay build script\nin the build container, similarly to how a regular `build_fuzzers` command would run, but\nwith the caveat that the replay build script only performs a subset of the operations\nof the original `build.sh`.\n\nThe replay build scripts are constructed in two ways: manually or automatically.\n\n#### Option 1: Automated rebuilds\n\nChronos support automated rebuilding. This is meant as a generic mechanism to enable Chronos support for projects by default. This is achieved by:\n\n1. Calling into a `replay_build.sh` script during the building inside the container [here](https://github.com/google/oss-fuzz/blob/206656447b213fb04901d15122692d8dd4d45312/infra/base-images/base-builder/compile#L292-L296)\n2. The `replay_build.sh` calls into `make_build_replayable.py`: [here](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/replay_build.sh)\n3. `make_build_replayable.py` adjusts the build environment to wrap around common commands, to avoid performing a complete run of `build.sh`: [here](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/make_build_replayable.py).\n\nThe automated rebuilding works in combination with [Ccache](https://ccache.dev/), in order to facilitate cachine of e.g. `.o` files.\nThis means that during rebuild mode as long as we have a cacche, we don't need to e.g. run `configure` again and will only have to\nrebuild the changed source code.\n\n#### Option 2: Manually provided replay builds\n\n`replay_build.sh` above, is simply just a wrapper script around `build.sh` that aims to enable\nfast rebuilding of the project. This `replay_build.sh` can, however, be overwritten in the Dockerfile\nof the project's builder image to support a custom approach to fast rebuilding. Two examples of this is [php](https://github.com/google/oss-fuzz/blob/206656447b213fb04901d15122692d8dd4d45312/projects/php/replay_build.sh#L1) and [ffmpeg](https://github.com/google/oss-fuzz/blob/master/projects/ffmpeg/replay_build.sh#L1).\n\nProviding a manual `replay_build.sh` is likely more efficient at build time and can help speed up the process. Automated replay build scripts can also be erroneous.\n\n\n#### Testing the validity of a replay build\n\nThe Chronos manager can use the `manager.py` to validate the validity of a\nreplay build for a given project:\n\n```sh\npython3 infra/experimental/chronos/manager.py check-replay tinyobjloader\n```\n\nIf the above command fails for the relevant project, then the replay build feature\ndoes not work for the given project.\n\n### Chronos feature:  Running tests of a project\n\nThe second part of Chronos is a feature to enable running the tests of a given\nproject. This is done by way of a script `run_tests.sh`. Samples of\nthis script include [jsonnet](https://github.com/google/oss-fuzz/blob/master/projects/jsonnet/run_tests.sh#L1) and [tinyobjloader](https://github.com/google/oss-fuzz/blob/master/projects/tinyobjloader/run_tests.sh#L1).\n\n\n#### Run tests constraints\n\n1. The `run_tests.sh` main task is to run the tests of a project and return `0` upon success and non-null otherwise.\n2. The `run_tests.sh` script must leave the main repository in the state as it was prior to the execution of `run_tests.sh` relative to `git diff` (or similar diff features of other version control systems).\n\n#### Testing the validity of run_tests.sh\n\nThe Chronos manager can use the `manager.py` to validate the validity of a\n`run_tests.sh` script:\n\n```sh\npython3 infra/experimental/chronos/manager.py check-tests json-c\n```\n\n\n### Constraints imposed on replay_build.sh and run_tests.sh\n\nAt the core of chronos are the two scripts `replay_build.sh` and `run_tests.sh`. We have a default\nmechanism for `replay_build.sh` so it's not strictly necessary to have a custom one, although it will\nlikely improve speed and maybe correctness by providing one.\n\nThere are three stages of the Chronos workflow:\n\n1. The cached containers represent the state of a build container after a successful project build.\n2. The `replay_build.sh` is able to rebuild a given project from the state of a cached container.\n3. The `run_tests.sh` script is able to run the tests of a given project. This should be able to succeed following the running of a `replay_build.sh`.\n\nThe stages (2) and (3) must both support running without network connectivity.\nSpecifically, this means that the `replay_build.sh` must not do tasks e.g. fetch\ndependencies, download corpus, or anything of this nature. Similarly, the `run_tests.sh`\nmust be able to operate completely in a closed network environment.\n\n\n## Pre-built images.\n\nChronos cached images are build daily, and pre-built images are available at:\n\n- `us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/<PROJECT>-ofg-cached-address`\n- `us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/<PROJECT>-ofg-cached-coverage`\n\nThey can be used as drop-in replacements for the usual `gcr.io/oss-fuzz/<PROJECT>` images."
  },
  {
    "path": "infra/experimental/chronos/build_all.sh",
    "content": "#!/bin/bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build all C/C++ projects.\nc_project_yaml=$(find projects/ -name project.yaml -exec grep -l 'language: c' {} \\;)\nprojs=$(echo $c_project_yaml | xargs dirname | xargs basename -a | sort)\n\ncd infra/experimental/chronos\n\nfor proj in $projs; do\n  if [ ! -f ../../../projects/$proj/Dockerfile ]; then\n    # Incomplete integration.\n    echo \"Skipping $proj as it's incomplete.\"\n    continue\n  fi\n\n  echo ./build_on_cloudbuild.sh $proj c\n  ./build_on_cloudbuild.sh $proj c\ndone"
  },
  {
    "path": "infra/experimental/chronos/build_cache_local.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n_PROJECT=$1\n_FUZZING_LANGUAGE=$2\n_SANITIZER=${3:-address}\n\nBASE=$PWD\n\n# Final image is either ccache or replay script, depending on which worked.\nFINAL_IMAGE_NAME=us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-cached-${_SANITIZER}\n\n# Always build an image with ccache.\nCCACHE_IMAGE_NAME=us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-ccache-${_SANITIZER}\n\n# Step 1: build the base image\ncd projects/${_PROJECT}\ndocker build -t gcr.io/oss-fuzz/${_PROJECT} .\n\n\n# Step 2: create a container where `compile` has run which enables ccaching\n#         and also generates a replay build script.\ncd ${BASE}\nmkdir -p ccaches/${_PROJECT}\nmkdir -p build/out/${_PROJECT}\nB_START=$SECONDS\n\ndocker container rm -f ${_PROJECT}-origin-${_SANITIZER}\n\ndocker run \\\n  --env=SANITIZER=${_SANITIZER} \\\n  --env=CCACHE_DIR=/workspace/ccache \\\n  --env=FUZZING_LANGUAGE=${_FUZZING_LANGUAGE} \\\n  --env=CAPTURE_REPLAY_SCRIPT=1 \\\n  --name=${_PROJECT}-origin-${_SANITIZER} \\\n  -v=$PWD/ccaches/${_PROJECT}/ccache:/workspace/ccache \\\n  -v=$PWD/build/out/${_PROJECT}/:/out/ \\\n  gcr.io/oss-fuzz/${_PROJECT} \\\n  /bin/bash -c \\\n  \"export PATH=/ccache/bin:\\$PATH && compile && cp -n /usr/local/bin/replay_build.sh \\$SRC/\"\nB_TIME=$(($SECONDS - $B_START))\n\n# Step 3: save (commit, locally) the cached container as an image\ndocker container commit -c \"ENV REPLAY_ENABLED=1\" -c \"ENV CAPTURE_REPLAY_SCRIPT=\" ${_PROJECT}-origin-${_SANITIZER} $FINAL_IMAGE_NAME\n\n# If the project has declared its own replay_build.sh, assume that's the\n# approach to use and we're done.\nif [ -f projects/${_PROJECT}/replay_build.sh ]; then\n  echo \"Has project-specfied replay build script.\"\n  exit 0\nfi\n\n# Step 4: save the list of executables created from a vanilla build. This is\n#         needed for validating if replay and ccaching works.\n# notes: run a shell the container with e.g.\n# `docker run --entrypoint /bin/bash  -it local/ossfuzz/htslib-origin-address`\nexecutables_vanilla=\"$(find ./build/out/${_PROJECT} -executable -type f | sort)\"\n\n\n# Step 5: Build with replay enabled, and validate the executables are the same\n# in terms of naming.\n# Note that an important step is removing everything in $OUT/ which is done\n# in the docker command.\nR_START=$SECONDS\ndocker run \\\n  --rm \\\n  --env=SANITIZER=${_SANITIZER} \\\n  --env=FUZZING_LANGUAGE=${_FUZZING_LANGUAGE} \\\n  -v=$PWD/build/out/${_PROJECT}/:/out/ \\\n  --name=${_PROJECT}-origin-${_SANITIZER}-replay-recached \\\n  $FINAL_IMAGE_NAME \\\n  /bin/bash -c \\\n  \"export PATH=/ccache/bin:\\$PATH && rm -rf /out/* && compile\"\nR_TIME=$(($SECONDS - $R_START))\n\n# Step 6: Extract the newly build executables\nexecutables_replay=\"$(find ./build/out/${_PROJECT}/ -executable -type f | sort)\"\n\necho \"Executables vanilla: \"\necho ${executables_vanilla}\n\necho \"------------------------------------------------------\"\necho \"Executables replay: \"\necho ${executables_replay}\n\nREPLAY_WORKED=\n\n# Step 7: match executables from vanilla builds and replay builds.\n#         If this step is successful, then the process can exit as it's ready.\nif [[ \"$executables_replay\" == \"$executables_vanilla\" ]]\nthen\n  REPLAY_WORKED=1\n\n  if [ -z \"${RUN_ALL+1}\" ]; then\n    echo \"${_PROJECT}: Replay worked.\"\n    echo \"${_PROJECT}: Compile times: Vanilla=${B_TIME}; Replay=${R_TIME};\"\n    exit 0\n  fi\nelse\n  echo \"${_PROJECT}: Replay did not work\"\n  R_TIME=\"N/A\"\nfi\n\n# Step 8: prepare Dockerfile for ccache\ncp -rf ccaches/${_PROJECT}/ccache ./projects/${_PROJECT}/ccache-cache\n\ninfra/experimental/chronos/prepare-ccache ${_PROJECT}\n\ncd projects/${_PROJECT}\n\n# Step 9: Build an image with CCache's new items (modifications are done on the\n#         dockerfile)\ndocker build -t $CCACHE_IMAGE_NAME .\n\ncd ${BASE}\n\n# Step 10: Run a `compile` with ccache's image.\n# Run the ccache build\nA_START=$SECONDS\ndocker run \\\n  --rm \\\n  --env=SANITIZER=${_SANITIZER} \\\n  --env=FUZZING_LANGUAGE=${_FUZZING_LANGUAGE} \\\n  --name=${_PROJECT}-origin-${_SANITIZER}-recached \\\n  -v=$PWD/build/out/${_PROJECT}/:/out/ \\\n  $CCACHE_IMAGE_NAME \\\n  /bin/bash -c \\\n  \"export PATH=/ccache/bin:\\$PATH && rm -rf /out/* && compile\"\nA_TIME=$(($SECONDS - $A_START))\n\n# Step 11: extract the executables from the ccache build\nexecutables_ccache=\"$(find ./build/out/${_PROJECT}/ -executable -type f | sort)\"\n\n\n# Step 12: validate the ccache builds are successful\nif [[ \"$executables_ccache\" == \"$executables_vanilla\" ]]\nthen\n  echo \"${_PROJECT}: Compile times: Vanilla=${B_TIME}; Replay=${R_TIME}; CCache=${A_TIME};\"\n\n  if [[ -z \"${REPLAY_WORKED}\" || ${R_TIME} -gt ${A_TIME} ]]; then\n    if [ ${R_TIME} -gt ${A_TIME} ]; then\n      echo \"Replay was slower than ccache.\"\n    fi\n\n    # Replay didn't work or was slower, so make the default \"cached\" image use the ccache one.\n    docker image tag \\\n      $CCACHE_IMAGE_NAME \\\n      $FINAL_IMAGE_NAME\n  fi\n\n  exit 0\nelse\n  echo \"${_PROJECT}: Replay and ccaching did not work.\"\n  exit 1\nfi\n\n"
  },
  {
    "path": "infra/experimental/chronos/build_on_cloudbuild.sh",
    "content": "#!/bin/bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nPROJECT=$1\nFUZZING_LANGUAGE=$2\n\ngcloud builds submit \"https://github.com/google/oss-fuzz\" \\\n  --async \\\n  --git-source-revision=master \\\n  --config=cloudbuild.yaml \\\n  --substitutions=_PROJECT=$PROJECT,_FUZZING_LANGUAGE=$FUZZING_LANGUAGE \\\n  --project=oss-fuzz \\\n  --region=us-central1\n"
  },
  {
    "path": "infra/experimental/chronos/check_tests.sh",
    "content": "#!/bin/bash\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Module for validating \"run_tests.sh\" of a given project. Before the run_tests.sh\n# script is run, a cached container image is first built. We assume here that the\n# replay is working for the target project.\n# (TODO): make sure this works for both replay_build.sh and ccached rebuilds.\n#         currently the focus is on replay_build.sh.\n_PROJECT=$1\n_FUZZING_LANGUAGE=$2\n_SANITIZER=${3:-address}\n\nBASE=$PWD\n\n# Final image is either ccache or replay script, depending on which worked.\nFINAL_IMAGE_NAME=us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-cached-${_SANITIZER}\n\n# Step 1: build the base image\ncd projects/${_PROJECT}\ndocker build -t gcr.io/oss-fuzz/${_PROJECT} .\n\n# Step 2: create a container where `compile` has run which enables ccaching\n#         and also generates a replay build script.\ncd ${BASE}\nmkdir -p ccaches/${_PROJECT}\nmkdir -p build/out/${_PROJECT}\n\n# Clean up existing images.\ndocker container rm -f ${_PROJECT}-origin-${_SANITIZER}\n\ndocker run \\\n  --env=SANITIZER=${_SANITIZER} \\\n  --env=CCACHE_DIR=/workspace/ccache \\\n  --env=FUZZING_LANGUAGE=${_FUZZING_LANGUAGE} \\\n  --env=CAPTURE_REPLAY_SCRIPT=1 \\\n  --name=${_PROJECT}-origin-${_SANITIZER} \\\n  -v=$PWD/ccaches/${_PROJECT}/ccache:/workspace/ccache \\\n  -v=$PWD/build/out/${_PROJECT}/:/out/ \\\n  gcr.io/oss-fuzz/${_PROJECT} \\\n  /bin/bash -c \\\n  \"export PATH=/ccache/bin:\\$PATH && compile && cp -n /usr/local/bin/replay_build.sh \\$SRC/\"\n\n\n# Step 3: save (commit, locally) the cached container as an image\ndocker container commit -c \"ENV REPLAY_ENABLED=1\" -c \"ENV CAPTURE_REPLAY_SCRIPT=\" ${_PROJECT}-origin-${_SANITIZER} $FINAL_IMAGE_NAME\n\nT_START=$SECONDS\n# Step 4: run the actual run_tests.sh script in the container.\ndocker run \\\n  --rm \\\n  --network none \\\n  -ti \\\n  us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-cached-address /bin/bash -c 'chmod +x /src/run_tests.sh && /src/run_tests.sh'\nT_END=$SECONDS\n\nT_TOTAL_TIME=$(($T_END - $T_START))\necho \"--------------------------------------------------------\"\necho \"Total time taken to replay tests: $T_TOTAL_TIME\"\n"
  },
  {
    "path": "infra/experimental/chronos/chronos.sh",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script records the ENV and commands needed for fuzz target recompilation.\n# It intercepts bash commands to save: 1) the ENV variable values before\n# building the fuzz target (`recompile_env.sh`) and 2) all subsequent bash\n# commands from that point (`recompile`). Combined with Docker, this setup\n# allows for recompiling the fuzz target without rebuilding the entire project.\n# Usage:\n# 1. Set FUZZ_TARGET (e.g., in project's Dockerfile)\n# 2. Source this file before compiling the fuzz target (e.g., source chronos.sh\n# at the beginning of project's build.sh).\n\nexport START_RECORDING=\"false\"\nRECOMPILE_ENV=\"/usr/local/bin/recompile_env.sh\"\n\n\n# Initialize the recompile script as compile in case Chronos did not trap any\n# command containing the fuzz target.\ninitialize_recompile_script() {\n    export RECOMPILE_SCRIPT=\"/usr/local/bin/recompile\"\n    cp \"/usr/local/bin/compile\" \"$RECOMPILE_SCRIPT\"\n}\n\nreset_recompile_script() {\n    rm \"$RECOMPILE_SCRIPT\"\n    echo \"#!/bin/bash\" > \"$RECOMPILE_SCRIPT\"\n    echo \"source $RECOMPILE_ENV\" >> \"$RECOMPILE_SCRIPT\" \n    chmod +x \"$RECOMPILE_SCRIPT\" \n}\n\n\n# Execute or record command for recompilation.\nexecute_or_record_command() {\n    record_command() {\n        echo \"cd \\\"$(pwd)\\\"\" >> \"$RECOMPILE_SCRIPT\"\n        echo \"$@\" >> \"$RECOMPILE_SCRIPT\"\n    }\n\n    # Check if any element in the command array contains the FUZZ_TARGET.\n    if [[ \"$BASH_COMMAND\" == *\"$FUZZ_TARGET\"* ]]; then\n        export START_RECORDING=\"true\"\n        # Save all environment variables, excluding read-only ones\n        reset_recompile_script\n        declare -p | grep -Ev 'declare -[^ ]*r[^ ]*' > \"$RECOMPILE_ENV\"\n    fi\n\n    if [[ \"$START_RECORDING\" == \"true\" ]]; then\n        record_command \"$BASH_COMMAND\"\n        echo \"Recorded execution of: $BASH_COMMAND\"\n    fi\n}\n\n\nmain() {\n    # Initialize.\n    initialize_recompile_script\n    \n    # Set up trap for DEBUG to intercept commands.\n    trap 'execute_or_record_command' DEBUG\n\n    # Enable extended debugging mode\n    shopt -s extdebug  \n    # Ensure trap works in subshells and functions.\n    set -T  \n}\n\nmain\n"
  },
  {
    "path": "infra/experimental/chronos/cloudbuild.yaml",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# CloudBuild for generating Chronos-cached images.\n# Supports building by way of ccache now.\n# High-level steps:\n# 1) Build image for project\n# 2) Run an ASAN build and store ccache\n# 3) Copy ccache cache to host and copy into project's OSS-Fuzz folder\n# 4) Build image for project and copy ccache in, storing image as *-ofg-cache-address\n# 5) Run an coverage build and store ccache\n# 6) Copy ccache cache to host and copy into project's OSS-Fuzz folder\n# 7) Build image for project and copy ccache in, storing image as *-ofg-cache-coverage\n# TODO (David): add support for use of dedicated replay_build.sh\nsteps:\n- name: 'gcr.io/cloud-builders/docker'\n  entrypoint: /bin/bash\n  args:\n  - /workspace/infra/experimental/chronos/build_cache_local.sh\n  - ${_PROJECT}\n  - ${_FUZZING_LANGUAGE}\n  - address\n  env:\n  - RUN_ALL=1\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - push\n  - us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-ccache-address\n  allowFailure: true\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - push\n  - us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-cached-address\n  allowFailure: true\n\n- name: 'gcr.io/cloud-builders/docker'\n  entrypoint: /bin/bash\n  args:\n  - /workspace/infra/experimental/chronos/build_cache_local.sh\n  - ${_PROJECT}\n  - ${_FUZZING_LANGUAGE}\n  - memory\n  env:\n  - RUN_ALL=1\n  allowFailure: true  # MSan is finicky, so let this fail.\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - push\n  - us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-ccache-memory\n  allowFailure: true\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - push\n  - us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-cached-memory\n  allowFailure: true\n\n- name: 'gcr.io/cloud-builders/docker'\n  entrypoint: /bin/bash\n  args:\n  - /workspace/infra/experimental/chronos/build_cache_local.sh\n  - ${_PROJECT}\n  - ${_FUZZING_LANGUAGE}\n  - coverage\n  env:\n  - RUN_ALL=1\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - push\n  - us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-cached-coverage\n  allowFailure: true\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - push\n  - us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/${_PROJECT}-ofg-ccache-coverage\n  allowFailure: true\ntimeout: 72000s  # 20 hours, same as build_lib.py\nlogsBucket: oss-fuzz-gcb-logs\ntags:\n- ${_PROJECT}\n- chronos\noptions:\n  pool:\n    name: projects/oss-fuzz/locations/us-central1/workerPools/buildpool-chronos\n"
  },
  {
    "path": "infra/experimental/chronos/cloudbuild_all.yaml",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# CloudBuild for generating Chronos-cached images.\nsteps:\n- name: 'gcr.io/cloud-builders/docker'\n  args:\n  - build\n  - -t\n  - gcloud\n  - .\n  dir: infra/experimental/chronos\n- name: 'gcloud'\n  args:\n  - infra/experimental/chronos/build_all.sh\n  entrypoint: /bin/bash\ntimeout: 1800s\nserviceAccount: 'projects/oss-fuzz/serviceAccounts/llm-eval@oss-fuzz.iam.gserviceaccount.com'\noptions:\n  logging: CLOUD_LOGGING_ONLY\ntags:\n- chronos-all"
  },
  {
    "path": "infra/experimental/chronos/e2e-replay-build.sh",
    "content": "#!/usr/bin/bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Sample projects: simd, wt, libheif, htslib\nPROJECT=liblouis\nLOG=replay-${PROJECT}.txt\nOUT1=replay-out-${PROJECT}-1\nOUT2=replay-out-${PROJECT}-2\npython infra/helper.py build_image --no-pull  \"$PROJECT\"\n\n# AddressSanitizer.\nmkdir -p build/out/${PROJECT}\necho \"start\" >> ${LOG}\necho $(date +%Y:%m:%d:%H:%M:%S) >> ${LOG}\n# Remove container name we are about to use.\ndocker container rm \"${PROJECT}-origin-asan\"\n\n# Build once, clean container if needed\ndocker run -v $PWD/build/out/${PROJECT}:/out \\\n    -ti --entrypoint=\"/bin/sh\" \\\n    --env FUZZING_LANGUAGE=c  --env SANITIZER=\"address\" \\\n    --name \"${PROJECT}-origin-asan\" \\\n    \"gcr.io/oss-fuzz/${PROJECT}\" -c \"compile\"\n\n# Copy outs and log data\ncp -rf $PWD/build/out/${PROJECT} ${OUT1}\nrm -rf $PWD/build/out/${PROJECT}\nls -la $PWD/build/out/ >> ${LOG}\necho \"next\" >> ${LOG}\necho $(date +%Y:%m:%d:%H:%M:%S) >> ${LOG}\ndocker commit \"${PROJECT}-origin-asan\" \"gcr.io/oss-fuzz/${PROJECT}-ofg-cached-asan\"\n\n# Run the replay command\ndocker run -v $PWD/build/out/${PROJECT}:/out \\\n    -e REPLAY_ENABLED=1 -ti --entrypoint=\"/bin/sh\" \\\n    --env FUZZING_LANGUAGE=c --env SANITIZER=\"address\" \\\n    \"gcr.io/oss-fuzz/${PROJECT}-ofg-cached-asan\" -c \"compile\"\necho \"finish\" >> ${LOG}\necho $(date +%Y:%m:%d:%H:%M:%S) >> ${LOG}\ncp -rf $PWD/build/out/${PROJECT} ${OUT2}\n\n# Now match the artifacts\nSUCCESS=$(infra/experimental/chronos/match_artifacts $OUT1 $OUT2)\n\nif [[ $SUCCESS -eq 0 ]]; then\n  echo \"SUCCESS REPLAY\" >> ${LOG}\nelse\n  echo \"FAIL REPLAY\" >> ${LOG}\nfi\n"
  },
  {
    "path": "infra/experimental/chronos/match_artifacts.sh",
    "content": "#!/usr/bin/bash -eux\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCMP1=$1\nCMP2=$2\n\nfor exec1 in $(find $CMP1/ -type f -executable); do\n  base=$(basename $exec1)\n\n  exec2=$CMP2/${base}\n  if [ ! -f ${exec2} ]; then\n    exit 1\n  fi\n\n  comparison=$(cmp --silent $exec1 $exec2; echo $?)\n  if [[ $comparison -ne 0 ]]; then\n    exit 1\n  fi\ndone\n\nexit 0\n"
  },
  {
    "path": "infra/experimental/chronos/prepare-ccache",
    "content": "#!/usr/bin/bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=$1\n{\n    echo \"COPY ccache-cache/ /ccache/cache\";\n    echo \"ENV PATH=\\\"/ccache/bin:\\$PATH\\\"\"\n} >> \"projects/$PROJECT/Dockerfile\"\n"
  },
  {
    "path": "infra/experimental/chronos/prepare-replay-rebuild",
    "content": "#!/usr/bin/bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=$1\n{\n    echo \"ENV REPLAY_ENABLED=1\";\n} >> \"projects/$PROJECT/Dockerfile\"\n"
  },
  {
    "path": "infra/experimental/chronos/requirements.txt",
    "content": "tree-sitter==0.25.1\ntree-sitter-cpp==0.23.4\nrequests==2.32.5\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/LICENSE",
    "content": "BSD 2-Clause License\n\nCopyright (c) 2022, The ARVO AUTHORS\nCopyright (c) 2023, The Arizona Board of Regents\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "infra/experimental/contrib/arvo/__init__.py",
    "content": ""
  },
  {
    "path": "infra/experimental/contrib/arvo/arvo_data.py",
    "content": "\"\"\"ARVO data management module.\n\nThis module provides data management functions for ARVO reproducer,\nincluding configuration mappings and Docker/build script fixes.\n\"\"\"\n\nfrom pathlib import Path\nfrom typing import Any, Dict, Tuple\nfrom datetime import datetime\nfrom hacks import get_project_hack\n\nfrom arvo_utils import (DockerfileModifier, CHANGED_KEY, CHANGED_TYPE,\n                        GLOBAL_STR_REPLACE, UPDATE_TABLE)\n\n\ndef update_resource_info(item_name: str, item_url: str,\n                         item_type: str) -> Tuple[str, str, str]:\n  \"\"\"Update resource information based on configuration tables.\n    \n    Args:\n        item_name: Name of the resource item.\n        item_url: URL of the resource.\n        item_type: Type of the resource.\n        \n    Returns:\n        Tuple of (updated_name, updated_url, updated_type).\n    \"\"\"\n  if item_name in CHANGED_KEY:\n    item_name = CHANGED_KEY[item_name]\n\n  if item_name in UPDATE_TABLE:\n    resource_type = CHANGED_TYPE.get(item_name, 'git')\n    return item_name, UPDATE_TABLE[item_name], resource_type\n  else:\n    return item_name, item_url, item_type\n\n\ndef dockerfile_cleaner(dockerfile_path: str | Path) -> None:\n  \"\"\"Clean dockerfile by removing git branch-specific arguments.\n    \n    Args:\n        dockerfile_path: Path to the Dockerfile to clean.\n    \"\"\"\n  dft = DockerfileModifier(dockerfile_path)\n  dft.replace(r'(--single-branch\\s+)', \"\")  # --single-branch\n  dft.replace(r'(--branch\\s+\\S+\\s+|-b\\s\\S+\\s+|--branch=\\S+\\s+)',\n              \"\")  # remove --branch or -b\n  dft.flush()\n\n\ndef fix_dockerfile(dockerfile_path: str | Path,\n                   project: str | None = None,\n                   commit_date: datetime | None = None) -> bool:\n  \"\"\"Fix the dockerfile for specific projects and general issues.\n    \n    Args:\n        dockerfile_path: Path to the Dockerfile to fix.\n        project: Name of the project for project-specific fixes.\n        commit_date: Target commit date (required for some projects like GDAL).\n        \n    Returns:\n        True if fixes were applied successfully, False otherwise.\n    \"\"\"\n\n  dockerfile_cleaner(dockerfile_path)\n  dft = DockerfileModifier(dockerfile_path)\n\n  # Some dockerfile forgets to apt update before apt install\n  # and we have to install/set ca-certificate/git sslVerify to avoid\n  # certificates issues\n  # TODO: improve regex\n  dft.replace_once(\n      r'RUN apt', \"RUN apt update -y && apt install git ca-certificates -y && \"\n      \"git config --global http.sslVerify false && \"\n      \"git config --global --add safe.directory '*'\\nRUN apt\")\n  dft.str_replace_all(GLOBAL_STR_REPLACE)\n\n  # Apply project-specific hacks that solve building/compiling problems\n  if project:\n    hack = get_project_hack(project)\n    if hack:\n      # Pass commit_date to the hack if it needs it\n      if hasattr(hack, 'set_commit_date') and commit_date:\n        hack.set_commit_date(commit_date)\n      if not hack.apply_dockerfile_fixes(dft):\n        return False\n\n  dft.clean_comments()\n  return dft.flush()\n\n\ndef fix_build_script(file_path: Path, project_name: str) -> bool:\n  \"\"\"Fix the build script for specific projects.\n    \n    Args:\n        file_path: Path to the build script file.\n        project_name: Name of the project.\n        \n    Returns:\n        True if fixes were applied successfully, False otherwise.\n    \"\"\"\n  if not file_path.exists():\n    return True\n\n  dft = DockerfileModifier(file_path)\n\n  # Apply project-specific build script hacks\n  hack = get_project_hack(project_name)\n  if hack and not hack.apply_build_script_fixes(dft):\n    return False\n\n  return dft.flush()\n\n\ndef extra_scripts(project_name: str, source_dir: Path) -> bool:\n  \"\"\"Execute extra scripts for specific projects.\n    \n    This function allows us to modify build.sh scripts and other stuff\n    to modify the compiling setting.\n    \n    Args:\n        project_name: Name of the project.\n        source_dir: Path to the source directory.\n        \n    Returns:\n        True if scripts executed successfully, False otherwise.\n    \"\"\"\n  # Apply project-specific extra fixes\n  hack = get_project_hack(project_name)\n  if hack and not hack.apply_extra_fixes(source_dir):\n    return False\n  return True\n\n\ndef special_component(project_name: str, item_key: str, item: Dict[str, Any],\n                      dockerfile: str | Path) -> bool:\n  \"\"\"Check if a component requires special handling.\n    \n    TODO: Theoretically, we can remove this func since other parts gonna\n    handle the submodule, but not tested.\n    These components are submodules, but their info are in srcmap.\n    \n    Args:\n        project_name: Name of the project.\n        item_key: Key of the item in srcmap.\n        item: Item data from srcmap.\n        dockerfile: Path to the dockerfile.\n        \n    Returns:\n        True if component should be skipped, False otherwise.\n    \"\"\"\n  # These components are submodules, but their info are in srcmap\n  if project_name == 'libressl' and item_key == '/src/libressl/openbsd':\n    return False\n\n  if project_name == 'gnutls' and item_key == '/src/gnutls/nettle':\n    # Just Ignore since we have submodule update --init\n    with open(dockerfile, encoding='utf-8') as f:\n      dt = f.read()\n    if item['rev'] not in dt:\n      return True\n    else:\n      return False\n\n  return False\n\n\ndef skip_component(project_name: str, item_name: str) -> bool:\n  \"\"\"Check if a component should be skipped during processing.\n    \n    TODO: solve the submodule problem in a decent way\n    \n    Args:\n        project_name: Name of the project.\n        item_name: Name of the item/component.\n        \n    Returns:\n        True if component should be skipped, False otherwise.\n    \"\"\"\n  NO_OPERATION = (\n      \"/src\",\n      \"/src/LPM/external.protobuf/src/external.protobuf\",\n      \"/src/libprotobuf-mutator/build/external.protobuf/src/external.protobuf\",\n  )\n  item_name = item_name.strip(\" \")\n\n  # Special for skia, Skip since they are done by submodule init\n  if project_name in ['skia', 'skia-ftz']:\n    if item_name.startswith(\"/src/skia/\"):\n      return True\n\n  if item_name in NO_OPERATION:\n    return True\n\n  return False\n\n\nif __name__ == \"__main__\":\n  pass\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/arvo_reproducer.py",
    "content": "# ARVO reproducer\n# Paper: https://arxiv.org/abs/2408.02153\n# ARVO Implementation: https://github.com/n132/ARVO\n# Neil — May 5, 2025 — Seattle, USA\n# Jordi — July 30, 2025\n\"\"\"ARVO reproducer module.\n\nThis module reproduces a vulnerability and its fix on OSS-Fuzz.\nLogin gcloud:\n    $ gcloud auth application-default login \n\nClasses:\n    BuildData: Named tuple for build configuration data.\n    \nFunctions:\n    Main reproducing functions and utilities for OSS-Fuzz\n    vulnerability reproduction.\n\"\"\"\n\nimport argparse\nimport json\nimport logging\nimport os\nimport re\nimport subprocess\nimport tempfile\nimport time\nfrom bisect import bisect_right\nfrom datetime import datetime\nfrom pathlib import Path\nfrom typing import Any\nfrom urllib.parse import parse_qs, urlparse\n\nimport requests\nfrom dateutil.parser import parse\nfrom google.cloud import storage\nfrom dataclasses import dataclass\n\nfrom arvo_data import (extra_scripts, fix_build_script, fix_dockerfile,\n                       skip_component, special_component, update_resource_info)\nfrom arvo_utils import (DockerfileModifier, VersionControlTool, check_call,\n                        clean_dir, clone, docker_build, docker_run, execute,\n                        hg_clone, leave_ret, svn_clone, OSS_ERR, OSS_OUT,\n                        OSS_WORK, PNAME_TABLE)\n\n# Global storage client\nstorage_client: storage.Client | None = None\n\n\n@dataclass\nclass BuildData:\n  project_name: str\n  engine: str\n  sanitizer: str\n  architecture: str\n\n\ndef parse_oss_fuzz_report(report_text: bytes,\n                          local_id: int) -> dict[str, Any] | bool:\n  \"\"\"Parse OSS-Fuzz report text and extract relevant information.\n    \n    Args:\n        report_text: Raw report text as bytes.\n        local_id: Local ID of the issue.\n        \n    Returns:\n        Dictionary containing parsed report data, or False if parsing fails.\n    \"\"\"\n  text = report_text.decode(\n      'unicode_escape', errors='ignore')  # decode escaped unicode like \\u003d\n\n  def extract(pattern: str, default: str = '') -> str:\n    \"\"\"Extract information using regex pattern.\"\"\"\n    match = re.search(pattern, text)\n    if not match:\n      if default == '':\n        logging.error(f\"FAILED to PARSE {pattern} {local_id=}\")\n        exit(1)\n      else:\n        return default\n    return match.group(1).strip()\n\n  result = {\n      \"project\":\n          extract(r'(?:Target|Project):\\s*(\\S+)', 'NOTFOUND'),\n      \"job_type\":\n          extract(r'Job Type:\\s*(\\S+)'),\n      \"platform\":\n          extract(r'Platform Id:\\s*(\\S+)', 'linux'),\n      \"crash_type\":\n          extract(r'Crash Type:\\s*(.+)'),\n      \"crash_address\":\n          extract(r'Crash Address:\\s*(\\S+)'),\n      \"severity\":\n          extract(r'Security Severity:\\s*(\\w+)', 'Medium'),\n      \"regressed\":\n          extract(r'(?:Regressed|Crash Revision):\\s*(https?://\\S+)',\n                  \"NO_REGRESS\"),\n      \"reproducer\":\n          extract(r'(?:Minimized Testcase|Reproducer Testcase|Download).*:'\n                  r'\\s*(https?://\\S+)'),\n      \"verified_fixed\":\n          extract(r'(?:fixed in|Fixed:)\\s*(https?://\\S+revisions\\S+)',\n                  'NO_FIX'),\n      \"localId\":\n          local_id\n  }\n\n  sanitizer_map = {\n      \"address (ASAN)\": \"address\",\n      \"memory (MSAN)\": \"memory\",\n      \"undefined (UBSAN)\": \"undefined\",\n      \"asan\": \"address\",\n      \"msan\": \"memory\",\n      \"ubsan\": \"undefined\",\n  }\n\n  fuzz_target = extract(r'(?:Fuzz Target|Fuzz target binary):\\s*(\\S+)',\n                        'NOTFOUND')\n\n  if len(result['job_type'].split(\"_\")) == 2:\n    return False\n  else:\n    result['sanitizer'] = sanitizer_map[result['job_type'].split(\"_\")[1]]\n\n  if fuzz_target != 'NOTFOUND':\n    result['fuzz_target'] = fuzz_target\n  if result['project'] == \"NOTFOUND\":\n    result['project'] = result['job_type'].split(\"_\")[-1]\n\n  return result\n\n\ndef fetch_issue(local_id: int | str) -> dict[str, Any] | bool:\n  \"\"\"Fetch issue information from OSS-Fuzz tracker.\n    \n    Args:\n        local_id: Local ID of the issue to fetch.\n        \n    Returns:\n        Dictionary containing issue information, or False if fetch fails.\n    \"\"\"\n  # TODO: Replace this with proper issue tracker API calls\n  url = (f'https://issues.oss-fuzz.com/action/issues/{local_id}/'\n         f'events?currentTrackerId=391')\n  session = requests.Session()\n\n  # Step 1: Get the token from the cookie\n  session.get(\"https://issues.oss-fuzz.com/\")\n  xsrf_token = session.cookies.get(\"XSRF_TOKEN\")\n\n  headers = {\n      'accept':\n          'application/json, text/plain, */*',\n      'accept-language':\n          'en,zh-CN;q=0.9,zh;q=0.8,ar;q=0.7',\n      'priority':\n          'u=1, i',\n      'referer':\n          'https://issues.oss-fuzz.com/',\n      'sec-ch-ua':\n          '\"Chromium\";v=\"134\", \"Not:A-Brand\";v=\"24\", \"Google Chrome\";v=\"134\"',\n      'sec-ch-ua-mobile':\n          '?0',\n      'sec-ch-ua-platform':\n          '\"Linux\"',\n      'sec-fetch-dest':\n          'empty',\n      'sec-fetch-mode':\n          'cors',\n      'sec-fetch-site':\n          'same-origin',\n      'user-agent':\n          'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 '\n          '(KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',\n      'X-XSRF-Token':\n          xsrf_token\n  }\n\n  response = session.get(url, headers=headers)\n  raw_text = response.content\n\n  try:\n    result = parse_oss_fuzz_report(raw_text, int(local_id))\n  except Exception:\n    logging.error(f\"FAIL on {local_id}, skip\")\n    return False\n\n  return result\n\n\ndef parse_job_type(job_type: str) -> dict[str, Any]:\n  \"\"\"Parse job type string into components.\n    \n    Args:\n        job_type: Job type string from OSS-Fuzz.\n        \n    Returns:\n        Dictionary containing parsed job type components.\n    \"\"\"\n  parts = job_type.split('_')\n  remainder = []\n  parsed = {}\n\n  while len(parts) > 0:\n    part = parts.pop(0)\n    if part in ['afl', 'honggfuzz', 'libfuzzer']:\n      parsed['engine'] = part\n    elif part in ['asan', 'ubsan', 'msan']:\n      parsed['sanitizer'] = part\n    elif part == 'i386':\n      parsed['arch'] = part\n    elif part == 'untrusted':\n      parsed['untrusted'] = True\n    else:\n      remainder.append(part)\n\n  if len(remainder) > 0:\n    parsed['project'] = '_'.join(remainder)\n  if 'arch' not in parsed:\n    parsed['arch'] = 'x86_64'\n  if 'engine' not in parsed:\n    parsed['engine'] = 'none'\n  if 'untrusted' not in parsed:\n    parsed['untrusted'] = False\n\n  return parsed\n\n\ndef download_build_artifacts(metadata: dict[str, Any], url: str,\n                             outdir: Path) -> list[str] | bool:\n  \"\"\"Download build artifacts from Google Cloud Storage.\n    \n    Args:\n        metadata: Issue metadata containing build information.\n        url: URL to download artifacts from.\n        outdir: Output directory for downloaded files.\n        \n    Returns:\n        List of downloaded file paths on success, False on failure.\n    \"\"\"\n  global storage_client\n  if storage_client is None:\n    storage_client = storage.Client()\n\n  bucket_map = {\n      \"libfuzzer_address_i386\": \"clusterfuzz-builds-i386\",\n      \"libfuzzer_memory_i386\": \"clusterfuzz-builds-i386\",\n      \"libfuzzer_undefined_i386\": \"clusterfuzz-builds-i386\",\n      \"libfuzzer_address\": \"clusterfuzz-builds\",\n      \"libfuzzer_memory\": \"clusterfuzz-builds\",\n      \"libfuzzer_undefined\": \"clusterfuzz-builds\",\n      \"afl_address\": \"clusterfuzz-builds-afl\",\n      \"honggfuzz_address\": \"clusterfuzz-builds-honggfuzz\",\n  }\n\n  sanitizer_map = {\n      \"address (ASAN)\": \"address\",\n      \"memory (MSAN)\": \"memory\",\n      \"undefined (UBSAN)\": \"undefined\",\n      \"asan\": \"address\",\n      \"msan\": \"memory\",\n      \"ubsan\": \"undefined\",\n      \"address\": \"address\",\n      \"memory\": \"memory\",\n      \"undefined\": \"undefined\",\n      None: \"\",\n  }\n\n  job_name = metadata[\"job_type\"]\n  job = parse_job_type(job_name)\n\n  # These don't have any build artifacts\n  if job['untrusted'] or job['engine'] == 'none':\n    return False\n\n  # Prefer the info from the job name, since the metadata\n  # format has changed several times.\n  if 'project' in metadata:\n    project = metadata[\"project\"]\n  else:\n    project = job['project']\n\n  if 'sanitizer' in metadata:\n    sanitizer = sanitizer_map[metadata[\"sanitizer\"]]\n    assert sanitizer == sanitizer_map[job['sanitizer']]\n  else:\n    sanitizer = sanitizer_map[job['sanitizer']]\n\n  fuzzer = job['engine']\n  bucket_string = f\"{fuzzer}_{sanitizer}\"\n  if job['arch'] == 'i386':\n    bucket_string += '_i386'\n\n  assert bucket_string in bucket_map\n  bucket_name = bucket_map[bucket_string]\n\n  # Grab the revision from the URL\n  urlparams = parse_qs(urlparse(url).query)\n\n  if 'revision' in urlparams:\n    revision = urlparams['revision'][0]\n  elif 'range' in urlparams:\n    revision = urlparams['range'][0].split(':')[1]\n  else:\n    return False\n\n  zip_name = f'{project}-{sanitizer}-{revision}.zip'\n  srcmap_name = f'{project}-{sanitizer}-{revision}.srcmap.json'\n  zip_path = f'{project}/{zip_name}'\n  srcmap_path = f'{project}/{srcmap_name}'\n  downloaded_files = []\n  bucket = storage_client.bucket(bucket_name)\n\n  for path, name in [(srcmap_path, srcmap_name)]:\n    download_path = outdir / name\n\n    if download_path.exists():\n      logging.info(f'Skipping {name} (already exists)')\n      downloaded_files.append(download_path)\n      continue\n\n    blob = bucket.blob(path)\n    if not blob.exists():\n      logging.info(f'Skipping {name} (not found)')\n      continue\n\n    blob.download_to_filename(str(download_path))\n    logging.info(f'Downloaded {name}')\n    downloaded_files.append(download_path)\n\n  return [str(f) for f in downloaded_files]\n\n\ndef get_project_name(issue: dict[str, Any], srcmap: str | Path) -> str | bool:\n  \"\"\"Get project name from issue and srcmap data.\n    \n    Args:\n        issue: Issue dictionary containing project information.\n        srcmap: Path to the srcmap file.\n        \n    Returns:\n        Project name on success, False on failure.\n    \"\"\"\n  if 'project' not in issue:\n    logging.error(\"[FAILED] to get project field in issue\")\n    return False\n  else:\n    project_name = issue['project']\n\n  if project_name in PNAME_TABLE:\n    return PNAME_TABLE[project_name]  # handling special cases\n\n  with open(srcmap, encoding='utf-8') as f:\n    info1 = json.load(f)\n\n  expected_name = \"/src/\" + project_name\n  if expected_name in info1:\n    return project_name\n  else:\n    logging.error(\n        f\"Failed to locate the main component, plz add that to pname_table\")\n    return False\n\n\ndef get_language(project_dir: Path) -> str | bool:\n  \"\"\"Get programming language from project.yaml file.\n    \n    Args:\n        project_dir: Path to the project directory.\n        \n    Returns:\n        Language string on success, False on failure.\n    \"\"\"\n  project_yaml = project_dir / \"project.yaml\"\n  if not project_yaml.exists():\n    return False\n\n  with open(project_yaml, encoding='utf-8') as f:\n    content = f.read()\n\n  matches = re.findall(r'language\\s*:\\s*([^\\s]+)', content)\n  if len(matches) != 1:\n    logging.error(f\"[!] Get more than one languages\")\n    return False\n\n  return str(matches[0])\n\n\ndef get_sanitizer(fuzzer_sanitizer: str) -> str | bool:\n  \"\"\"Convert fuzzer sanitizer short name to full name.\n    \n    Args:\n        fuzzer_sanitizer: Short sanitizer name (asan, msan, ubsan).\n        \n    Returns:\n        Full sanitizer name on success, False on failure.\n    \"\"\"\n  sanitizer_map = {'asan': \"address\", 'msan': 'memory', 'ubsan': 'undefined'}\n\n  return sanitizer_map.get(fuzzer_sanitizer, False)\n\n\ndef download_poc(issue: dict[str, Any], path: Path, name: str) -> Path | bool:\n  \"\"\"Download proof-of-concept file from issue.\n    \n    Args:\n        issue: Issue dictionary containing reproducer URL.\n        path: Directory to save the POC file.\n        name: Name for the downloaded file.\n        \n    Returns:\n        Path to downloaded file on success, False on failure.\n    \"\"\"\n  session = requests.Session()\n  url = issue['reproducer']\n  response = session.head(url, allow_redirects=True)\n\n  if response.status_code != 200:\n    return False\n\n  reproducer_path = path / name\n  response = session.get(url)\n\n  if response.status_code != 200:\n    return False\n\n  reproducer_path.write_bytes(response.content)\n  return reproducer_path\n\n\ndef prepare_ossfuzz(project_name: str,\n                    commit_date: str | datetime) -> tuple[Path, Path] | bool:\n  \"\"\"Prepare OSS-Fuzz repository for the specified project and date.\n    \n    Args:\n        project_name: Name of the project.\n        commit_date: Target commit date or commit hash.\n        \n    Returns:\n        Tuple of (temp_dir, project_dir) on success, False on failure.\n    \"\"\"\n  # 1. Clone OSS Fuzz\n  tmp_dir = clone(\"https://github.com/google/oss-fuzz.git\", name=\"oss-fuzz\")\n  if tmp_dir is False:\n    return False\n\n  # 2. Get the Commit Close to Commit_Date\n  tmp_oss_fuzz_dir = tmp_dir / \"oss-fuzz\"\n\n  if isinstance(commit_date, str):\n    oss_fuzz_commit = commit_date\n  else:\n    # Remove the cmd variable and use the list directly\n    result = execute([\n        'git', 'log', '--before=' + commit_date.isoformat(), '-n1',\n        '--format=%H'\n    ], tmp_oss_fuzz_dir)\n    if result.success and result.output:\n      oss_fuzz_commit = result.output.strip()\n    else:\n      oss_fuzz_commit = False\n\n    if oss_fuzz_commit is False:\n      cmd = ['git', 'log', '--reverse', '--format=%H']\n      result = execute(cmd, tmp_oss_fuzz_dir)\n      if result.success and result.output:\n        oss_fuzz_commit = result.output.splitlines()[0].strip()\n      else:\n        oss_fuzz_commit = False\n\n      if oss_fuzz_commit is False:\n        logging.error('Failed to get oldest oss-fuzz commit')\n        return leave_ret(False, tmp_dir)\n\n  # 3. Reset OSS Fuzz\n  gt = VersionControlTool(tmp_oss_fuzz_dir)\n  if not gt.reset(oss_fuzz_commit):\n    logging.error(\"Failed to Reset OSS-Fuzz\")\n    return leave_ret(False, tmp_dir)\n\n  # 4. Locate Project Dir\n  tmp_list = [x for x in tmp_oss_fuzz_dir.iterdir() if x.is_dir()]\n  if tmp_oss_fuzz_dir / \"projects\" in tmp_list:\n    proj_dir = tmp_oss_fuzz_dir / \"projects\" / project_name\n  elif tmp_oss_fuzz_dir / \"targets\" in tmp_list:\n    proj_dir = tmp_oss_fuzz_dir / \"targets\" / project_name\n  else:\n    logging.error(f\"Failed to locate the project({project_name}) in oss-fuzz\")\n    return leave_ret(False, tmp_dir)\n\n  return (tmp_dir, proj_dir)\n\n\ndef rebase_dockerfile(dockerfile_path: str | Path, commit_date: str) -> bool:\n  \"\"\"Rebase dockerfile to use historical base image.\n    \n    Args:\n        dockerfile_path: Path to the Dockerfile to rebase.\n        commit_date: Target commit date for base image.\n        \n    Returns:\n        True if rebase succeeded, False otherwise.\n    \"\"\"\n\n  def _get_base(date: str,\n                repo: str = \"gcr.io/oss-fuzz-base/base-builder\") -> str:\n    \"\"\"Get base image hash for the specified date.\"\"\"\n    cache_name = repo.split(\"/\")[-1]\n    cache_file = f\"/tmp/{cache_name}_cache.json\"\n    cache_ttl = 86400  # 24 hours\n    result_json = []\n\n    if os.path.exists(cache_file) and (\n        time.time() - os.path.getmtime(cache_file)) < cache_ttl:\n      with open(cache_file, 'r', encoding='utf-8') as f:\n        result_json = json.load(f)\n    else:\n      cmd = [\n          \"gcloud\", \"container\", \"images\", \"list-tags\", repo, \"--format=json\",\n          \"--sort-by=timestamp\"\n      ]\n      result = execute(cmd)\n      if result.success and result.output:\n        result_json = json.loads(result.output)\n        with open(cache_file, 'w', encoding='utf-8') as f:\n          f.write(json.dumps(result_json, indent=4))\n      else:\n        return \"\"\n\n    timestamps = []\n    for item in result_json:\n      timestamps.append(int(parse(item['timestamp']['datetime']).timestamp()))\n\n    target_ts = int(parse(date).timestamp())\n    return result_json[bisect_right(timestamps, target_ts - 1) -\n                       1]['digest'].split(\":\")[1]\n\n  # Load the Dockerfile\n  try:\n    with open(dockerfile_path, encoding='utf-8') as f:\n      data = f.read()\n  except IOError:\n    logging.error(f\"No such a dockerfile: {dockerfile_path}\")\n    return False\n\n  # Locate the Repo\n  match = re.search(r'FROM .*', data)\n  if match is None:\n    logging.error(\"Failed to get the base-image: {dockerfile_path}\")\n    return False\n  else:\n    repo = match[0][5:]\n\n  if \"@sha256\" in repo:\n    repo = repo.split(\"@sha256\")[0]\n  if repo == 'ossfuzz/base-builder' or repo == 'ossfuzz/base-libfuzzer':\n    repo = \"gcr.io/oss-fuzz-base/base-builder\"\n  if \":\" in repo:\n    repo = repo.split(\":\")[0]\n\n  image_hash = _get_base(commit_date, repo)\n\n  # We insert update since some old dockerfile doesn't have that line\n  data = re.sub(\n      r\"FROM .*\",\n      f\"FROM {repo}@sha256:\" + image_hash + \"\\nRUN apt-get update -y\\n\", data)\n\n  with open(dockerfile_path, 'w', encoding='utf-8') as f:\n    f.write(data)\n\n  return True\n\n\ndef update_revision_info(dockerfile: str | Path, src_path: str,\n                         item: dict[str, Any], commit_date: datetime | Path,\n                         approximate: str) -> bool:\n  \"\"\"Update revision information in dockerfile.\n    \n    Args:\n        dockerfile: Path to the dockerfile.\n        src_path: Source path in the dockerfile.\n        item: Item information containing URL, revision, and type.\n        commit_date: Target commit date or path for replacement mode.\n        approximate: Approximation direction ('+' or '-').\n        \n    Returns:\n        True if update succeeded, False otherwise.\n    \"\"\"\n  item_url = item['url']\n  item_rev = item['rev']\n  item_type = item['type']\n  dft = DockerfileModifier(dockerfile)\n\n  if item_url.startswith(\"http:\"):\n    keyword = item_url[4:]\n  elif item_url.startswith(\"https:\"):\n    keyword = item_url[5:]\n  else:\n    keyword = item_url\n\n  hits, line_count = dft.get_line(keyword)\n  # mismatch\n  if len(hits) != 1:\n    return False\n\n  line = hits[0]\n  if item_type == 'git':\n    pattern = re.compile(rf\"{item_type}\\s+clone\")\n  elif item_type == 'hg':\n    pattern = re.compile(rf\"{item_type}\\s+clone\")\n  elif item_type == 'svn':\n    pattern = re.compile(rf\"RUN\\s+svn\\s+(co|checkout)+\")\n  else:\n    logging.error(\"NOT supported protocol\")\n    return False\n\n  if len(pattern.findall(line)) != 1:  # mismatch\n    return False\n\n  if isinstance(commit_date, Path):\n    rep_path = commit_date\n    # Replace mode: for bisection\n    # Replace the original line with ADD/COPY command\n    # Then RUN init/update the submodule\n    dft.replace_line_at(line_count - 1, f\"ADD {rep_path.name} {src_path}\")\n    dft.insert_line_at(\n        line_count, f\"RUN bash -cx 'pushd {src_path} ;(git submodule init && \"\n        f\"git submodule update --force) ;popd'\")\n    dft.flush()\n    return True\n  else:\n    # Insertion Mode\n    if item_type == \"git\":\n      if approximate == '-':\n        dft.insert_line_at(\n            line_count, f\"RUN bash -cx 'pushd {src_path} ; \"\n            f\"(git reset --hard {item_rev}) || \"\n            f\"(commit=$(git log --before='{commit_date.isoformat()}' \"\n            f\"--format='%H' -n1) && \"\n            f\"git reset --hard $commit || exit 99) ; \"\n            f\"(git submodule init && git submodule update --force) ;popd'\")\n      else:\n        dft.insert_line_at(\n            line_count, f\"RUN bash -cx 'pushd {src_path} ; \"\n            f\"(git reset --hard {item_rev}) || \"\n            f\"(commit=$(git log --since='{commit_date.isoformat()}' \"\n            f\"--format='%H' --reverse | head -n1) && \"\n            f\"git reset --hard $commit || exit 99) ; \"\n            f\"(git submodule init && git submodule update --force) ;popd'\")\n    elif item_type == 'hg':\n      # TODO: support approximate\n      dft.insert_line_at(\n          line_count, f'RUN bash -cx \"pushd {src_path} ; '\n          f'(hg update --clean -r {item_rev} && '\n          f'hg purge --config extensions.purge=)|| exit 99 ; popd\"')\n    elif item_type == \"svn\":\n      # TODO: support approximate\n      dft.replace(pattern, f\"RUN svn checkout -r {item_rev}\")\n    else:\n      logging.error(\"Failed to support {item_type}\")\n      return False\n\n    dft.flush()\n    return True\n\n\ndef build_fuzzers_impl(local_id: int | str,\n                       project_dir: Path,\n                       engine: str,\n                       sanitizer: str,\n                       architecture: str,\n                       source_path: Path | None,\n                       mount_path: Path | None = None,\n                       no_dump: bool = False,\n                       custom_script: list[str] | None = None) -> bool:\n  \"\"\"Build fuzzers using Docker.\n    \n    Args:\n        local_id: Local ID for logging and output directories.\n        project_dir: Path to the project directory.\n        engine: Fuzzing engine to use.\n        sanitizer: Sanitizer to use.\n        architecture: Target architecture.\n        source_path: Path to source code.\n        mount_path: Mount path for source code in container.\n        no_dump: Whether to suppress log output.\n        custom_script: Additional custom script commands.\n        \n    Returns:\n        True if build succeeded, False otherwise.\n    \"\"\"\n  if custom_script is None:\n    custom_script = []\n\n  # Set the LogFile\n  log_file = OSS_ERR / f\"{local_id}_Image.log\"\n  logging.info(f\"Check the output in file: {log_file}\")\n\n  # Clean The WORK/OUT DIR\n  project_out = OSS_OUT / f\"{local_id}_OUT\"\n  project_work = OSS_WORK / f\"{local_id}_WORK\"\n\n  if project_out.exists():\n    check_call([\"sudo\", \"rm\", \"-rf\", str(project_out)])\n  if project_work.exists():\n    check_call([\"sudo\", \"rm\", \"-rf\", str(project_work)])\n\n  project_out.mkdir()\n  project_work.mkdir()\n\n  args = [\n      '-t', f'gcr.io/oss-fuzz/{local_id}', '--file',\n      str(project_dir / \"Dockerfile\"),\n      str(project_dir)\n  ]\n\n  if not docker_build(args, log_file=log_file):\n    logging.error(f\"Failed to build DockerImage\")\n    return False\n\n  # Build Succeed, Try Compiling\n  if log_file and log_file.exists():\n    os.remove(str(log_file))\n\n  env = [\n      'FUZZING_ENGINE=' + engine,\n      'SANITIZER=' + sanitizer,\n      'ARCHITECTURE=' + architecture,\n      'FUZZING_LANGUAGE=' + str(get_language(project_dir)),\n  ]\n\n  command = sum([['-e', x] for x in env], [])\n\n  # Mount the Source/Dependencies (we try to replace this with\n  # modifying dockerfile)\n  if source_path and mount_path:\n    for item in source_path.iterdir():\n      command += ['-v', f'{item}:{mount_path / item.name}']\n\n  # Mount out/work dir\n  command += [\n      '-v', f'{project_out}:/out', '-v', f'{project_work}:/work', '-t',\n      f'gcr.io/oss-fuzz/{local_id}'\n  ]\n\n  # supports for submodule tracker\n  command += custom_script\n\n  if not no_dump:\n    log_file = OSS_ERR / f\"{local_id}_Compile.log\"\n    logging.info(f\"Check the output in file: {str(log_file)}\")\n  else:\n    log_file = None\n\n  result = docker_run(command, log_file=log_file)\n  if not result:\n    logging.error('Failed to Build Targets')\n    return False\n  else:\n    if log_file and log_file.exists() and str(log_file) != \"/dev/null\":\n      os.remove(str(log_file))\n\n  logging.info(f\"OUT: {project_out}\")\n  return True\n\n\ndef build_fuzzer_with_source(local_id: int | str, project_name: str,\n                             srcmap: str | Path, sanitizer: str, engine: str,\n                             arch: str, commit_date: datetime,\n                             issue: dict[str, Any], tag: str) -> bool:\n  \"\"\"Build fuzzer with source code from srcmap.\n    \n    Args:\n        local_id: Local ID for the build.\n        project_name: Name of the project.\n        srcmap: Path to the srcmap file.\n        sanitizer: Sanitizer to use.\n        engine: Fuzzing engine.\n        arch: Target architecture.\n        commit_date: Target commit date.\n        issue: Issue information.\n        tag: Build tag ('fix' or 'vul').\n        \n    Returns:\n        True if build succeeded, False otherwise.\n    \"\"\"\n  # Build source_dir\n\n  with open(srcmap, encoding='utf-8') as f:\n    srcmap_items = json.loads(f.read())\n\n  if (\"/src\" in srcmap_items and\n      srcmap_items['/src']['url'] == 'https://github.com/google/oss-fuzz.git'):\n    result = prepare_ossfuzz(project_name, srcmap_items['/src']['rev'])\n  else:\n    result = prepare_ossfuzz(project_name, commit_date)\n\n  if not result:\n    return False\n  else:\n    tmp_dir, project_dir = result\n\n  dockerfile = project_dir / 'Dockerfile'\n  logging.info(f\"dockerfile: {dockerfile}\")\n\n  build_data = BuildData(sanitizer=sanitizer,\n                         architecture=arch,\n                         engine=engine,\n                         project_name=project_name)\n\n  # Step ZERO: Rebase Dockerfiles\n  if not rebase_dockerfile(dockerfile, str(commit_date).replace(\" \", \"-\")):\n    logging.error(\n        f\"build_fuzzer_with_source: Failed to Rebase Dockerfile, {local_id}\")\n    return leave_ret(False, tmp_dir)\n\n  # Step ONE: Fix Dockerfiles\n  if not fix_dockerfile(dockerfile, project_name, commit_date):\n    logging.error(\n        f\"build_fuzzer_with_source: Failed to Fix Dockerfile, {local_id}\")\n    return leave_ret(False, tmp_dir)\n\n  # Step TWO: Prepare Dependencies\n  with open(srcmap, encoding='utf-8') as f:\n    data = json.loads(f.read())\n\n  source_dir = Path(tempfile.mkdtemp())\n  src = source_dir / \"src\"\n  src.mkdir(parents=True, exist_ok=True)\n  docker_volume = []\n  unsorted = list(data.keys())\n  sorted_keys = sorted(unsorted, key=len)\n  main_component = get_project_name(issue, srcmap)\n\n  if main_component is False:\n    return leave_ret(False, tmp_dir)\n\n  force_no_err_dump = \"/src/xz\" in sorted_keys\n\n  # Handle Srcmap Info\n  for item_key in sorted_keys:\n    # logging.info(f\"Prepare Dependency: {x}\")\n    if skip_component(project_name, item_key):\n      continue\n\n    if tag == 'fix' and main_component == item_key:\n      approximate = '+'\n    else:\n      approximate = '-'\n\n    new_data = {}\n    new_data['rev'] = data[item_key]['rev']\n    new_key, new_data['url'], new_data['type'] = update_resource_info(\n        item_key, data[item_key]['url'], data[item_key]['type'])\n\n    del data[item_key]\n    data[new_key] = new_data\n\n    item_name = new_key\n    item_url = data[new_key]['url']\n    item_type = data[new_key]['type']\n    item_rev = data[new_key]['rev']\n    item_name = \"/\".join(item_name.split(\"/\")[2:])\n\n    if special_component(project_name, new_key, data[new_key], dockerfile):\n      continue\n\n    if (item_name == 'aflplusplus' and\n        item_url == 'https://github.com/AFLplusplus/AFLplusplus.git'):\n      continue\n\n    if (item_name == 'libfuzzer' and\n        'llvm.org/svn/llvm-project/compiler-rt/trunk/lib/fuzzer' in item_url):\n      continue\n\n    # Broken Revision\n    if item_rev == \"\" or item_rev == \"UNKNOWN\":\n      logging.error(f\"Broken Meta: No Revision Provided\")\n      return leave_ret(False, [tmp_dir, source_dir])\n\n    # Ignore not named dependencies if it's not main\n    if item_name.strip(\" \") == \"\" and len(data.keys()) == 1:\n      logging.error(f\"Broken Meta: Found Not Named Dep\")\n      return leave_ret(False, [tmp_dir, source_dir])\n\n    # Broken type\n    if item_type not in ['git', 'svn', 'hg']:\n      logging.error(f\"Broken Meta: No support for {item_type}\")\n      return leave_ret(False, [tmp_dir, source_dir])\n\n    # Try to perform checkout in dockerfile,\n    # which could make reproducing more reliable\n    if update_revision_info(dockerfile, new_key, data[new_key], commit_date,\n                            approximate):\n      continue\n\n    # Prepare the dependencies and record them. We'll use -v to mount them\n    # to the docker container\n    if item_type == 'git':\n      clone_result = clone(item_url,\n                           item_rev,\n                           src,\n                           item_name,\n                           commit_date=commit_date)\n\n      if clone_result is False:\n        logging.error(f\"[!] build_from_srcmap: Failed to clone & checkout \"\n                      f\"[{local_id}]: {item_name}\")\n        return leave_ret(False, [tmp_dir, source_dir])\n      elif clone_result is None:\n        command = (f'git log --before=\"{commit_date.isoformat()}\" '\n                   f'-n 1 --format=\"%H\"')\n        result = subprocess.run(command,\n                                stdout=subprocess.PIPE,\n                                text=True,\n                                shell=True,\n                                cwd=src / item_name)\n        commit_hash = result.stdout.strip()\n        if not check_call(['git', \"reset\", '--hard', commit_hash],\n                          cwd=src / item_name):\n          logging.error(f\"[!] build_from_srcmap: Failed to clone & checkout \"\n                        f\"[{local_id}]: {item_name}\")\n          return leave_ret(False, [tmp_dir, source_dir])\n\n      docker_volume.append(new_key)\n\n    elif item_type == 'svn':\n      if not svn_clone(item_url, item_rev, src, item_name):\n        logging.error(\n            f\"[!] build_from_srcmap/svn: Failed clone & checkout: {item_name}\")\n        return leave_ret(False, [tmp_dir, source_dir])\n      docker_volume.append(new_key)\n\n    elif item_type == 'hg':\n      if not hg_clone(item_url, item_rev, src, item_name):\n        logging.error(\n            f\"[!] build_from_srcmap/hg: Failed clone & checkout: {item_name}\")\n        return leave_ret(False, [tmp_dir, source_dir])\n      docker_volume.append(new_key)\n    else:\n      logging.error(f\"Failed to support {item_type}\")\n      exit(1)\n\n  # Step Three: Extra Scripts\n  if not extra_scripts(project_name, source_dir):\n    logging.error(f\"Failed to Run ExtraScripts, {local_id}\")\n    return leave_ret(False, [tmp_dir, source_dir])\n\n  if not fix_build_script(project_dir / \"build.sh\", project_name):\n    logging.error(f\"Failed to Fix Build.sh, {local_id}\")\n    return leave_ret(False, [tmp_dir, source_dir])\n\n  # Let's Build It\n  result = build_fuzzers_impl(local_id,\n                              project_dir=project_dir,\n                              engine=build_data.engine,\n                              sanitizer=build_data.sanitizer,\n                              architecture=build_data.architecture,\n                              source_path=source_dir / \"src\",\n                              mount_path=Path(\"/src\"),\n                              no_dump=force_no_err_dump)\n\n  # we need sudo since the docker container root touched the folder\n  check_call([\"sudo\", \"rm\", \"-rf\", str(source_dir)])\n  return leave_ret(result, tmp_dir)\n\n\ndef build_from_srcmap(srcmap: Path, issue: dict[str, Any], tag: str) -> bool:\n  \"\"\"Build fuzzer from srcmap file.\n    \n    Args:\n        srcmap: Path to the srcmap file.\n        issue: Issue dictionary.\n        tag: Build tag ('fix' or 'vul').\n        \n    Returns:\n        True if build succeeded, False otherwise.\n    \"\"\"\n  # Get Basic Information\n  fuzzer_info = issue['job_type'].split(\"_\")\n  engine = fuzzer_info[0]\n  sanitizer = get_sanitizer(fuzzer_info[1])\n  arch = 'i386' if fuzzer_info[2] == 'i386' else 'x86_64'\n\n  # Get Issue Date\n  issue_date = srcmap.name.split(\".\")[0].split(\"-\")[-1]\n  commit_date = datetime.strptime(issue_date + \" +0000\", '%Y%m%d%H%M %z')\n\n  if 'issue' not in issue:\n    issue['issue'] = {'localId': issue['localId']}\n\n  if engine not in ['libfuzzer', 'afl', 'honggfuzz', 'centipede']:\n    logging.error(\"Failed to get engine\")\n    return False\n\n  if sanitizer is False:\n    logging.error(\"Failed to get Sanitizer\")\n    return False\n\n  return build_fuzzer_with_source(issue['issue']['localId'], issue['project'],\n                                  srcmap, sanitizer, engine, arch, commit_date,\n                                  issue, tag)\n\n\ndef arvo_reproducer(local_id: int | str, tag: str) -> bool:\n  \"\"\"Main ARVO reproducer function.\n    \n    Args:\n        local_id: Local ID of the vulnerability.\n        tag: Version tag ('fix' or 'vul').\n        \n    Returns:\n        True if reproduction succeeded, False otherwise.\n    \"\"\"\n  logging.info(f\"Working on {local_id}\")\n\n  # 1. Fetch the basic info for the vulnerability\n  issue = fetch_issue(local_id)  # TODO, refactor a fast way\n  if not issue:\n    logging.error(f\"Failed to get the srcmap or issue for {local_id}\")\n    return False\n\n  tmpdir = Path(tempfile.mkdtemp())\n  srcmap_url = issue['regressed'] if tag == 'vul' else issue['verified_fixed']\n  srcmap_files = download_build_artifacts(issue, srcmap_url, tmpdir)\n\n  if not srcmap_files:\n    logging.error(f\"Failed to get the srcmap for {local_id}\")\n    return False\n\n  srcmap = Path(srcmap_files[0])\n\n  # Early issues don't have 'project' field. Set project for issues that\n  # didn't have it.\n  if 'project' not in issue:\n    issue['project'] = issue['fuzzer'].split(\"_\")[1]\n\n  # 2. Download the PoC\n  logging.info(\"Downloading PoC\")\n  case_dir = Path(tempfile.mkdtemp())\n\n  try:\n    case_path = download_poc(issue, case_dir, \"crash_case\")\n  except Exception:\n    logging.error(f\"Failed to Download the Reproducer\")\n    return False\n\n  logging.info(f\"POC: {case_path}\")\n  if not case_path or not case_path.exists():\n    logging.error(f\"Failed to Download the Reproducer\")\n    return False\n\n  # 3. Build the Vulnerable Software\n  logging.info(\"Building the Binary\")\n  result = build_from_srcmap(srcmap, issue, tag)\n\n  if not result:\n    logging.error(f\"Failed to build old fuzzers from srcmap\")\n    return False\n\n  return True\n\n\ndef main() -> None:\n  \"\"\"Main function.\"\"\"\n  parser = argparse.ArgumentParser(description='Reproduce ')\n  parser.add_argument('--issueId',\n                      help='The issueId of the found vulnerability '\n                      'https://issues.oss-fuzz.com/',\n                      required=True)\n  parser.add_argument('--version',\n                      default='fix',\n                      help=\"The fixed version or vulnerable version\")\n  args = parser.parse_args()\n\n  # In this script, localId == issueId\n  arvo_reproducer(args.issueId, args.version)\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/arvo_reproducer_test.py",
    "content": "\"\"\"Test module for ARVO reproducer functionality.\n\nThis module contains functional tests for the ARVO reproducer components:\n1. The functionality of reproducer components.\n2. The building of a project's fuzzers from a vulnerability found on OSS-Fuzz.\n\"\"\"\n\nimport shutil\nimport tempfile\nimport unittest\nimport warnings\nfrom datetime import datetime\nfrom pathlib import Path\nfrom typing import Dict, Any\n\nfrom arvo_reproducer import (arvo_reproducer, download_poc, fetch_issue,\n                             prepare_ossfuzz, rebase_dockerfile)\nfrom arvo_utils import execute\n\n# Suppress Google auth warnings\nwarnings.filterwarnings(\"ignore\",\n                        category=UserWarning,\n                        module=\"google.auth._default\")\n\n# Test constants\nREPRODUCE_TEST_LOCAL_ID = 42487096\nUNITTEST_LOCAL_ID = 42498388\n\n\nclass ArvoReproducingTest(unittest.TestCase):\n  \"\"\"Test class for ARVO reproducer functionality.\"\"\"\n\n  def test_reproduce(self) -> None:\n    \"\"\"Test the complete reproduction process.\"\"\"\n    result = arvo_reproducer(REPRODUCE_TEST_LOCAL_ID, 'vul')\n    self.assertEqual(result, True)\n\n    case_dir = Path(tempfile.mkdtemp())\n    issue = fetch_issue(REPRODUCE_TEST_LOCAL_ID)  # TODO, refactor a fast way\n    download_poc(issue, case_dir, \"crash_case\")\n\n    (case_dir / \"stderr\").touch()\n    with open(case_dir / \"stderr\", 'wb') as f:\n      execute([\n          f'/tmp/{REPRODUCE_TEST_LOCAL_ID}_OUT/set_eval_fuzzer',\n          str(case_dir / \"crash_case\")\n      ],\n              stdout=f,\n              stderr=f)\n\n    with open(case_dir / \"stderr\", 'rb') as f:\n      crash_info = f.read()\n\n    self.assertEqual(\n        b\"SUMMARY: AddressSanitizer: heap-buffer-overflow \" in crash_info, True)\n\n    shutil.rmtree(case_dir)\n\n\nclass ArvoUnitTests(unittest.TestCase):\n  \"\"\"Unit tests for individual ARVO reproducer components.\"\"\"\n\n  def test_fetch_issue(self) -> None:\n    \"\"\"Test if we can get issues from OSS-Fuzz.\"\"\"\n    expected_issue_cve_2021_38593: Dict[str, Any] = {\n        'project':\n            'qt',\n        'job_type':\n            'libfuzzer_asan_i386_qt',\n        'platform':\n            'linux',\n        'crash_type':\n            'UNKNOWN WRITE',\n        'crash_address':\n            '0x10000000',\n        'severity':\n            'High',\n        'regressed':\n            'https://oss-fuzz.com/revisions?job=libfuzzer_asan_i386_qt&'\n            'range=202106240616:202106250624',\n        'reproducer':\n            'https://oss-fuzz.com/download?testcase_id=6379642528333824',\n        'verified_fixed':\n            'https://oss-fuzz.com/revisions?job=libfuzzer_asan_i386_qt&'\n            'range=202107280604:202107290609',\n        'localId':\n            42498388,\n        'sanitizer':\n            'address',\n        'fuzz_target':\n            'qtsvg_svg_qsvgrenderer_render'\n    }\n\n    issue = fetch_issue(UNITTEST_LOCAL_ID)\n    self.assertEqual(expected_issue_cve_2021_38593, issue)\n\n  def test_download_poc(self) -> None:\n    \"\"\"Test if we can download proof-of-concept files.\"\"\"\n    issue = fetch_issue(UNITTEST_LOCAL_ID)\n    case_dir = Path(tempfile.mkdtemp())\n\n    result = download_poc(issue, case_dir, \"crash_case\")\n    self.assertEqual(result.name, \"crash_case\")\n\n    shutil.rmtree(case_dir)\n\n  def test_rebase_dockerfile(self) -> None:\n    \"\"\"Test if we can get the historical dockerfile and rebase it.\"\"\"\n    commit_date = datetime.strptime(\"202409200607\" + \" +0000\", '%Y%m%d%H%M %z')\n    result = prepare_ossfuzz(\"libxml2\", commit_date)\n\n    commit_date_str = str(commit_date).replace(\" \", \"-\")\n    rebase_result = rebase_dockerfile(result[1] / \"Dockerfile\", commit_date_str)\n\n    self.assertEqual(rebase_result, True)\n    shutil.rmtree(result[0])\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/arvo_utils.py",
    "content": "\"\"\"ARVO utilities module.\n\nThis module provides utility functions for ARVO reproducer including:\n- Command execution functions\n- Version control operations\n- Docker operations\n- File system utilities\n- Dockerfile modification tools\n\"\"\"\n\nimport json\nimport os\nimport logging\nimport re\nimport shutil\nimport subprocess\nimport tempfile\nimport warnings\nfrom datetime import datetime\nfrom pathlib import Path\nfrom typing import Any, Dict, List, Tuple\n\nimport pytz\nfrom dataclasses import dataclass\n\n\ndef load_repo_map(file_name: str) -> Dict[str, Any]:\n  \"\"\"Load repository mapping from JSON file.\n    \n    Args:\n        file_name: Name of the JSON file to load.\n        \n    Returns:\n        Dictionary containing the loaded JSON data.\n    \"\"\"\n  json_path = os.path.join(os.path.dirname(__file__), file_name)\n  with open(json_path, encoding='utf-8') as f:\n    return json.load(f)\n\n\n# Configuration constants - Order matters\nGLOBAL_STR_REPLACE = load_repo_map(\"string_replacement.json\")\nUPDATE_TABLE = load_repo_map(\"component_fixes.json\")\n\n# Global constants\nOSS_OUT = OSS_WORK = OSS_ERR = Path(\"/tmp\")\n\n# Only include non git project\nCHANGED_TYPE = {'/src/graphicsmagick': 'hg'}\n\nCHANGED_KEY = {\n    '/src/mdbtools/test': '/src/mdbtools',\n}\n\nPNAME_TABLE = {\n    'libpng-proto': \"libprotobuf-mutator\",\n    'pcapplusplus': \"PcapPlusPlus\",\n    'skia-ftz': 'skia',\n}\n\n# Configure logging\nlogging.basicConfig(level=logging.INFO,\n                    format='%(asctime)s - %(levelname)s - %(message)s')\n\n# Suppress Google auth warnings\nwarnings.filterwarnings(\"ignore\",\n                        category=UserWarning,\n                        module=\"google.auth._default\")\n\n\n@dataclass\nclass CommandResult:\n  success: bool\n  output: bytes | None\n  returncode: int\n\n\ndef execute(cmd: List[str],\n            cwd: Path = Path(\"/tmp\"),\n            stdout: int = subprocess.PIPE,\n            stderr: int = subprocess.PIPE) -> CommandResult:\n  \"\"\"\n    Execute a command and return its result.\n\n    Args:\n        cmd: Command to execute as a list of strings.\n        cwd: Working directory for the command.\n        stdout: Stdout redirection target.\n        stderr: Stderr redirection target.\n\n    Returns:\n        CommandResult: with success, output, and returncode.\n        success is True if returncode==0, regardless of output.\n        output is the stdout bytes if present, else None.\n    \"\"\"\n  try:\n    result = subprocess.run(cmd,\n                            cwd=cwd,\n                            stderr=stderr,\n                            stdout=stdout,\n                            check=False)\n    output = result.stdout if result.stdout and result.stdout.strip(\n    ) != b'' else None\n    return CommandResult(success=(result.returncode == 0),\n                         output=output,\n                         returncode=result.returncode)\n  except (subprocess.SubprocessError, OSError):\n    return CommandResult(success=False, output=None, returncode=-1)\n\n\ndef check_call(cmd: List[str],\n               cwd: Path = Path(\"/tmp\"),\n               stdout: int = subprocess.PIPE,\n               stderr: int = subprocess.PIPE) -> bool:\n  \"\"\"Execute a command and return success status.\n    \n    Args:\n        cmd: Command to execute as a list of strings.\n        cwd: Working directory for the command.\n        stdout: Stdout redirection target.\n        stderr: Stderr redirection target.\n        \n    Returns:\n        True if command succeeded, False otherwise.\n    \"\"\"\n  try:\n    result = subprocess.run(cmd,\n                            cwd=cwd,\n                            stderr=stderr,\n                            stdout=stdout,\n                            check=False)\n    return result.returncode == 0\n  except (subprocess.SubprocessError, OSError):\n    return False\n\n\ndef _git_pull(cwd: Path) -> bool:\n  \"\"\"Pull latest changes from git repository.\n    \n    Args:\n        cwd: Path to the git repository.\n        \n    Returns:\n        True if pull succeeded, False otherwise.\n    \"\"\"\n  with open(\"/dev/null\", 'w', encoding='utf-8') as f:\n    return check_call(['git', 'pull'], cwd=cwd, stderr=f, stdout=f)\n\n\ndef _hg_pull(cwd: Path) -> bool:\n  \"\"\"Pull latest changes from mercurial repository.\n    \n    Args:\n        cwd: Path to the mercurial repository.\n        \n    Returns:\n        True if pull succeeded, False otherwise.\n    \"\"\"\n  with open(\"/dev/null\", 'w', encoding='utf-8') as f:\n    return check_call(['hg', 'pull'], cwd=cwd, stderr=f, stdout=f)\n\n\ndef _svn_pull(cwd: Path) -> bool:\n  \"\"\"Update SVN repository to latest revision.\n    \n    Args:\n        cwd: Path to the SVN repository.\n        \n    Returns:\n        True if update succeeded, False otherwise.\n    \"\"\"\n  with open(\"/dev/null\", 'w', encoding='utf-8') as f:\n    return check_call(['svn', 'update'], cwd=cwd, stderr=f, stdout=f)\n\n\ndef clone(url: str,\n          commit: str | None = None,\n          dest: str | Path | None = None,\n          name: str | None = None,\n          main_repo: bool = False,\n          commit_date: datetime | None = None) -> Path | bool:\n  \"\"\"Clone a git repository and optionally checkout a specific commit.\n    \n    Args:\n        url: Repository URL to clone.\n        commit: Specific commit to checkout.\n        dest: Destination directory for cloning.\n        name: Name for the cloned repository directory.\n        main_repo: Whether this is the main repository.\n        commit_date: Date of the commit for fallback checkout.\n        \n    Returns:\n        Path to cloned repository on success, False on failure.\n    \"\"\"\n\n  def _git_clone(url: str, dest: Path, name: str | None) -> bool:\n    \"\"\"Helper function to perform git clone operation.\"\"\"\n    cmd = ['git', 'clone', url]\n    if name is not None:\n      cmd.append(name)\n    if not check_call(cmd, dest):\n      return False\n    return True\n\n  def _check_out(commit: str, path: Path) -> bool:\n    \"\"\"Helper function to checkout a specific commit.\"\"\"\n    with open('/dev/null', 'w', encoding='utf-8') as f:\n      return check_call(['git', \"reset\", '--hard', commit], cwd=path, stdout=f)\n\n  dest_path = Path(dest) if dest else Path(tempfile.mkdtemp())\n\n  if not _git_clone(url, dest_path, name):\n    logging.error(f\"[!] - clone: Failed to clone {url}\")\n    return False\n\n  if commit:\n    logging.info(f\"Checkout to commit {commit}\")\n    repo_name = list(dest_path.iterdir())[0] if name is None else name\n    repo_path = dest_path / repo_name\n\n    if _check_out(commit, repo_path):\n      return dest_path\n    else:\n      if main_repo:\n        logging.error(f\"[!] - clone: Failed to checkout {repo_name}\")\n        return False\n      else:\n        if commit_date is None:\n          logging.warning(\n              f\"[!] - clone: Failed to checkout {repo_name} but it's not the main component, using the latest version\"\n          )\n          return dest_path\n        logging.warning(\n            \"[!] Failed to checkout, try a version before required commit\")\n        cmd = [\n            \"git\", \"log\", f\"--before='{commit_date.isoformat()}'\",\n            \"--format='%H'\", \"-n1\"\n        ]\n        fallback_result = execute(cmd, repo_path)\n        if fallback_result.success and fallback_result.output:\n          fallback_commit = fallback_result.output.decode().strip(\"'\")\n          logging.info(f\"Checkout to {fallback_commit}\")\n          if _check_out(fallback_commit, repo_path):\n            return dest_path\n        logging.error(f\"[!] - clone: Failed to checkout {repo_name}\")\n        return False\n\n  return dest_path\n\n\ndef svn_clone(url: str,\n              commit: str | None = None,\n              dest: str | Path | None = None,\n              rename: str | None = None) -> Path | bool:\n  \"\"\"Clone an SVN repository and optionally checkout a specific revision.\n    \n    Args:\n        url: SVN repository URL.\n        commit: Specific revision to checkout.\n        dest: Destination directory.\n        rename: Name for the cloned directory.\n        \n    Returns:\n        Path to cloned repository on success, False on failure.\n    \"\"\"\n\n  def _svn_clone(url: str, dest: Path, name: str | None = None) -> bool:\n    \"\"\"Helper function to perform SVN checkout operation.\"\"\"\n    cmd = [\"svn\", \"co\", url]\n    if name:\n      cmd.append(name)\n    if not check_call(cmd, dest):\n      return False\n    return True\n\n  tmp_path = Path(dest) if dest else Path(tempfile.mkdtemp())\n\n  if not _svn_clone(url, tmp_path, rename):\n    logging.error(f\"[!] - svn_clone: Failed to clone {url}\")\n    return False\n\n  if commit:\n    repo_name = rename if rename else list(tmp_path.iterdir())[0]\n    repo_path = tmp_path / repo_name\n    if not check_call(['svn', \"up\", '--force', '-r', commit], cwd=repo_path):\n      return False\n\n  return tmp_path\n\n\ndef hg_clone(url: str,\n             commit: str | None = None,\n             dest: str | Path | None = None,\n             rename: str | None = None) -> Path | bool:\n  \"\"\"Clone a Mercurial repository and optionally checkout a specific commit.\n    \n    Args:\n        url: Mercurial repository URL.\n        commit: Specific commit to checkout.\n        dest: Destination directory.\n        rename: Name for the cloned directory.\n        \n    Returns:\n        Path to cloned repository on success, False on failure.\n    \"\"\"\n\n  def _hg_clone(url: str, dest: Path, name: str | None = None) -> bool:\n    \"\"\"Helper function to perform hg clone operation.\"\"\"\n    cmd = [\"hg\", \"clone\", url]\n    if name:\n      cmd.append(name)\n    if not check_call(cmd, dest):\n      return False\n    return True\n\n  tmp_path = Path(dest) if dest else Path(tempfile.mkdtemp())\n\n  if not _hg_clone(url, tmp_path, rename):\n    logging.error(f\"[!] - hg_clone: Failed to clone {url}\")\n    return False\n\n  if commit:\n    repo_name = rename if rename else list(tmp_path.iterdir())[0]\n    repo_path = tmp_path / repo_name\n    if not (check_call(['hg', \"update\", '--clean', '-r', commit], cwd=repo_path)\n            and check_call(['hg', \"purge\", '--config', 'extensions.purge='],\n                           cwd=repo_path)):\n      return False\n\n  return tmp_path\n\n\nclass DockerfileModifier:\n  \"\"\"A class for modifying Dockerfile content with various text operations.\"\"\"\n\n  def __init__(self, path: str | Path) -> None:\n    \"\"\"\n    Initialize the DockerfileModifier.\n\n    This constructor loads the Dockerfile content and performs a clean up:\n    - Removes all comment lines (lines starting with #)\n    - Removes line continuations (backslash-newline)\n    - Collapses multiple blank lines into a single blank line\n    This normalization makes further text processing and modifications more robust and predictable.\n\n    Args:\n        path: Path to the Dockerfile to modify.\n    \"\"\"\n    self.path = Path(path)\n    with open(self.path, encoding='utf-8') as f:\n      self.content = f.read()\n\n    # Clean up the content\n    comments = re.compile(r'^\\s*#.*\\n', re.MULTILINE)\n    self.content = comments.sub(\"\", self.content)\n    self.content = self.content.replace(\"\\\\\\n\", \"\")\n    blank_line = re.compile(r'\\n(\\s)*\\n', re.MULTILINE)\n    self.content = blank_line.sub(\"\\n\", self.content)\n\n  def flush(self) -> bool:\n    \"\"\"Write the modified content back to the file.\n        \n        Returns:\n            True if write succeeded, False otherwise.\n        \"\"\"\n    try:\n      with open(self.path, 'w', encoding='utf-8') as f:\n        f.write(self.content)\n      return True\n    except IOError:\n      return False\n\n  def str_replace(self, old: str, new: str) -> None:\n    \"\"\"Replace all occurrences of old string with new string.\n        \n        Args:\n            old: String to replace.\n            new: Replacement string.\n        \"\"\"\n    self.content = self.content.replace(old, new)\n\n  def str_replace_all(self, pairs: Dict[str, str]) -> None:\n    \"\"\"Replace multiple string pairs.\n        \n        Args:\n            pairs: Dictionary of old -> new string mappings.\n        \"\"\"\n    for key, value in pairs.items():\n      self.str_replace(key, value)\n\n  def replace_line_at(self, pos: int, line: str) -> None:\n    \"\"\"Replace the line at specified position.\n        \n        Args:\n            pos: Line position (0-indexed).\n            line: New line content.\n        \"\"\"\n    lines = self.content.split(\"\\n\")\n    if 0 <= pos < len(lines):\n      lines[pos] = line\n      self.content = \"\\n\".join(lines)\n\n  def replace(self, old: str, new: str, flags: int = 0) -> None:\n    \"\"\"Replace using regular expressions.\n        \n        Args:\n            old: Regular expression pattern.\n            new: Replacement string.\n            flags: Regular expression flags.\n        \"\"\"\n    self.content = re.sub(old, new, self.content, flags=flags)\n\n  def replace_once(self, old: str, new: str) -> None:\n    \"\"\"Replace first occurrence using regular expressions.\n        \n        Args:\n            old: Regular expression pattern.\n            new: Replacement string.\n        \"\"\"\n    self.content = re.sub(old, new, self.content, count=1)\n\n  def insert_line_before(self, target: str, newline: str) -> bool | None:\n    \"\"\"Insert a new line before the target line.\n        \n        Args:\n            target: Target line to find.\n            newline: New line to insert.\n            \n        Returns:\n            None if target not found, otherwise inserts the line.\n        \"\"\"\n    line_num = self.locate_str(target)\n    if line_num is False:\n      return False\n    self.insert_line_at(line_num, newline)\n    return None\n\n  def insert_line_after(self, target: str, newline: str) -> bool | None:\n    \"\"\"Insert a new line after the target line.\n        \n        Args:\n            target: Target line to find.\n            newline: New line to insert.\n            \n        Returns:\n            None if target not found, otherwise inserts the line.\n        \"\"\"\n    line_num = self.locate_str(target)\n    if line_num is False:\n      return False\n    self.insert_line_at(line_num + 1, newline)\n    return None\n\n  def insert_line_at(self, pos: int, line: str) -> None:\n    \"\"\"Insert a line at specified position.\n        \n        Args:\n            pos: Position to insert at.\n            line: Line content to insert.\n        \"\"\"\n    lines = self.content.split(\"\\n\")\n    lines.insert(pos, line)\n    self.content = \"\\n\".join(lines)\n\n  def remove_range(self, starts: int, ends: int) -> None:\n    \"\"\"Remove lines in the specified range.\n        \n        Args:\n            starts: Start line number (inclusive).\n            ends: End line number (exclusive).\n        \"\"\"\n    lines = self.content.split(\"\\n\")\n    new_lines = []\n    for num, line in enumerate(lines):\n      if not (starts <= num < ends):\n        new_lines.append(line)\n    self.content = '\\n'.join(new_lines)\n\n  def clean_comments(self) -> None:\n    \"\"\"Remove comment lines from the content.\"\"\"\n    pattern = re.compile(r'^#.*', re.MULTILINE)\n    self.content = pattern.sub('', self.content)\n    newline_pattern = re.compile(r'^\\n', re.MULTILINE)\n    self.content = newline_pattern.sub('', self.content)\n\n  def locate_str(self, keyword: str) -> int | bool:\n    \"\"\"Find the line number containing the keyword.\n        \n        Args:\n            keyword: Keyword to search for.\n            \n        Returns:\n            Line number if found, False otherwise.\n        \"\"\"\n    lines = self.content.split(\"\\n\")\n    for line_num, line in enumerate(lines):\n      if keyword in line:\n        return line_num\n    return False\n\n  def get_line(self, keyword: str) -> Tuple[List[str], int]:\n    \"\"\"Get lines containing the keyword and the last line number.\n        \n        Args:\n            keyword: Keyword to search for.\n            \n        Returns:\n            Tuple of (matching_lines, last_line_number).\n        \"\"\"\n    lines = self.content.split(\"\\n\")\n    matching_lines = []\n    last_line_num = 0\n\n    for line_num, line in enumerate(lines, 1):\n      if keyword in line:\n        matching_lines.append(line)\n        last_line_num = line_num\n\n    if len(matching_lines) < 2:\n      return matching_lines, last_line_num\n\n    # Use regex for more precise matching\n    pattern = re.compile(rf\"{keyword}(\\s.*$|$)\")\n    matching_lines = []\n    last_line_num = 0\n\n    for line_num, line in enumerate(lines, 1):\n      if pattern.search(line):\n        matching_lines.append(line)\n        last_line_num = line_num\n\n    return matching_lines, last_line_num\n\n\nclass VersionControlTool:\n  \"\"\"A unified interface for version control operations (git, hg, svn).\"\"\"\n\n  def __init__(self,\n               repo_path: str | Path,\n               vc_type: str = 'git',\n               revision: str | None = None,\n               latest: bool = False) -> None:\n    \"\"\"Initialize the VersionControlTool.\n        \n        Args:\n            repo_path: Path to the repository or URL to clone.\n            vc_type: Version control type ('git', 'hg', 'svn').\n            revision: Specific revision to checkout.\n            latest: Whether to pull latest changes.\n            \n        Raises:\n            ValueError: If vc_type is not supported.\n        \"\"\"\n    if vc_type not in ['git', 'hg', 'svn']:\n      raise ValueError(f'VersionControlTool: Does not support {vc_type}')\n\n    self.type = vc_type\n    repo_path_obj = Path(repo_path) if isinstance(repo_path, str) else repo_path\n\n    if not repo_path_obj.exists():\n      repo_path_obj = self.clone(str(repo_path), revision)\n      if not repo_path_obj:\n        raise RuntimeError(f'VersionControlTool: Failed to init {repo_path}')\n\n    self.repo = repo_path_obj\n    self.name = self.repo.name\n\n    if latest and not self.pull():\n      raise RuntimeError(f'VersionControlTool: Failed to Update {repo_path}')\n\n  def pull(self) -> bool:\n    \"\"\"Pull latest changes from the repository.\n        \n        Returns:\n            True if pull succeeded, False otherwise.\n        \"\"\"\n    if self.type == 'git':\n      return _git_pull(self.repo)\n    elif self.type == 'hg':\n      return _hg_pull(self.repo)\n    else:\n      return _svn_pull(self.repo)\n\n  def clone(self, url: str, revision: str | None = None) -> Path | bool:\n    \"\"\"Clone the repository.\n        \n        Args:\n            url: Repository URL to clone.\n            revision: Specific revision to checkout.\n            \n        Returns:\n            Path to cloned repository on success, False on failure.\n        \"\"\"\n    if self.type == 'git':\n      repo = clone(url, revision)\n      if repo is not False:\n        self.repo = list(repo.iterdir())[0]\n        return self.repo\n    elif self.type == 'hg':\n      repo = hg_clone(url, revision)\n      if repo is not False:\n        self.repo = list(repo.iterdir())[0]\n        return self.repo\n    else:\n      repo = svn_clone(url, revision)\n      if repo is not False:\n        self.repo = list(repo.iterdir())[0]\n        return self.repo\n\n    return False\n\n  def commit_date(self, commit: str) -> str | bool:\n    \"\"\"Get the date of a specific commit.\n        \n        Args:\n            commit: Commit hash or revision.\n            \n        Returns:\n            Formatted date string on success, False on failure.\n        \"\"\"\n\n    def time_reformat(original_str: str) -> str:\n      \"\"\"Reformat time string to standard format.\"\"\"\n      original_dt = datetime.strptime(original_str, \"%Y-%m-%d %H:%M:%S %z\")\n      utc_dt = original_dt.astimezone(pytz.utc)\n      return utc_dt.strftime(\"%Y%m%d%H%M\")\n\n    if self.type == 'git':\n      result = execute(['git', 'show', '-s', '--format=%ci', commit], self.repo)\n      if result.success and result.output:\n        return time_reformat(result.output.decode())\n    elif self.type == 'hg':\n      result = execute(['hg', 'log', '-r', commit, '--template', '{date}'],\n                       self.repo)\n      if result.success and result.output:\n        timestamp = int(result.output.decode().split(\".\")[0])\n        return datetime.utcfromtimestamp(timestamp).strftime('%Y%m%d%H%M')\n    else:\n      result = execute(['svn', 'log', '-r', commit, '-q'], self.repo)\n      if result.success and result.output:\n        lines = result.output.decode().split('\\n')\n        if len(lines) > 1:\n          date_part = lines[1].split(' | ')[2].split(' (')[0]\n          return time_reformat(date_part)\n    return False\n\n  def reset(self, commit: str) -> bool:\n    \"\"\"Reset the repository to a specific commit.\n        \n        Args:\n            commit: Commit hash or revision to reset to.\n            \n        Returns:\n            True if reset succeeded, False otherwise.\n        \"\"\"\n    if self.type == 'git':\n      cmd = ['git', 'reset', '--hard', commit]\n      with open('/dev/null', 'w', encoding='utf-8') as f:\n        return check_call(cmd, self.repo, stdout=f)\n    elif self.type == 'hg':\n      cmd1 = ['hg', 'update', '--clean', '-r', commit]\n      cmd2 = ['hg', \"purge\", '--config', 'extensions.purge=']\n      return (check_call(cmd1, self.repo) and check_call(cmd2, self.repo))\n    elif self.type == \"svn\":\n      return check_call(['svn', \"up\", '--force', '-r', commit], cwd=self.repo)\n\n    return False\n\n\ndef docker_build(args: List[str], log_file: Path | None = None) -> bool:\n  \"\"\"Build a Docker image.\n    \n    Args:\n        args: Arguments for docker build command.\n        log_file: Optional log file to write output.\n        \n    Returns:\n        True if build succeeded, False otherwise.\n    \"\"\"\n  cmd = ['docker', 'build']\n  cmd.extend(args)\n  logging.info(\"Docker Build: \\n\" + \" \".join(cmd))\n\n  if log_file:\n    with open(log_file, 'w', encoding='utf-8') as f:\n      result = check_call(cmd, stderr=f, stdout=f)\n      f.write(\"\\n\" + \" \".join(cmd) + \"\\n\")\n      return result\n  else:\n    return check_call(cmd)\n\n\ndef docker_run(args: List[str],\n               rm: bool = True,\n               log_file: Path | None = None) -> bool:\n  \"\"\"Run a Docker container.\n    \n    Args:\n        args: Arguments for docker run command.\n        rm: Whether to automatically remove the container when it exits.\n        log_file: Optional log file to write output.\n        \n    Returns:\n        True if run succeeded, False otherwise.\n    \"\"\"\n  if rm:\n    cmd = ['docker', 'run', '--rm', '--privileged']\n  else:\n    cmd = ['docker', 'run', '--privileged']\n\n  cmd.extend(args)\n  logging.info(\"Docker Run: \\n\" + \" \".join(cmd))\n\n  if log_file:\n    with open(log_file, 'w', encoding='utf-8') as f:\n      result = check_call(cmd, stdout=f, stderr=f)\n      f.write(\"\\n\" + \" \".join(cmd) + \"\\n\")\n      return result\n  else:\n    return check_call(cmd)\n\n\ndef clean_dir(directory: Path) -> bool:\n  \"\"\"Remove a directory and all its contents.\n    \n    Args:\n        directory: Directory to remove.\n        \n    Returns:\n        True if removal succeeded, False otherwise.\n    \"\"\"\n  if not directory.exists():\n    return True\n\n  try:\n    shutil.rmtree(directory)\n    return True\n  except OSError:\n    logging.warning(f\"[FAILED] to remove tmp file {directory}\")\n    return False\n\n\ndef leave_ret(return_val: Any, tmp_dirs: Path | list[Path]) -> Any:\n  \"\"\"\n  Clean up temporary directories and return a value.\n\n  This function is used to ensure that any temporary directories created during\n  the execution of a process are properly removed before returning a result.\n  It accepts either a single Path or a list of Paths, and attempts to remove\n  each directory (and its contents) using clean_dir. This helps prevent\n  resource leaks and keeps the filesystem clean after temporary work is done.\n\n  Args:\n      return_val: Value to return after cleanup.\n      tmp_dirs: Temporary directory or list of directories to clean up.\n\n  Returns:\n      The return_val parameter, after cleanup is performed.\n  \"\"\"\n  if isinstance(tmp_dirs, list):\n    for tmp_dir in tmp_dirs:\n      clean_dir(tmp_dir)\n  else:\n    clean_dir(tmp_dirs)\n  return return_val\n\n\nif __name__ == \"__main__\":\n  pass\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/component_fixes.json",
    "content": "{\n  \"/src/freetype2\": \"https://github.com/freetype/freetype2\",\n  \"/src/freetype\": \"https://github.com/freetype/freetype\",\n  \"/src/pcre2\": \"https://github.com/PCRE2Project/pcre2\",\n  \"/src/skia/third_party/externals/libjpeg-turbo\": \"https://github.com/libjpeg-turbo/libjpeg-turbo.git\",\n  \"/src/radare2-regressions\": \"https://github.com/rlaemmert/radare2-regressions.git\",\n  \"/src/x264\": \"https://code.videolan.org/videolan/x264.git\",\n  \"/src/x265\": \"https://bitbucket.org/multicoreware/x265_git.git\",\n  \"/src/vorbis\": \"https://gitlab.xiph.org/xiph/vorbis.git\",\n  \"/src/theora\": \"https://gitlab.xiph.org/xiph/theora.git\",\n  \"/src/opus\": \"https://gitlab.xiph.org/xiph/opus.git\",\n  \"/src/ogg\": \"https://gitlab.xiph.org/xiph/ogg.git\",\n  \"/src/libxml2\": \"https://gitlab.gnome.org/GNOME/libxml2.git\",\n  \"/src/wireshark\": \"https://github.com/wireshark/wireshark.git\",\n  \"/src/kimageformats\": \"https://invent.kde.org/frameworks/kimageformats.git\",\n  \"/src/extra-cmake-modules\": \"https://invent.kde.org/frameworks/extra-cmake-modules.git\",\n  \"/src/kcodecs\": \"https://github.com/KDE/kcodecs.git\",\n  \"/src/karchive\": \"https://invent.kde.org/frameworks/karchive.git\",\n  \"/src/libtheora\": \"https://gitlab.xiph.org/xiph/theora.git\",\n  \"/src/libva\": \"https://github.com/intel/libva.git\",\n  \"/src/libssh2\": \"https://github.com/libssh2/libssh2.git\",\n  \"/src/quickjs\": \"https://github.com/bellard/quickjs\",\n  \"/src/lwan\": \"https://github.com/lpereira/lwan.git\",\n  \"/src/graphicsmagick\": \"https://foss.heptapod.net/graphicsmagick/graphicsmagick\",\n  \"/src/llvm\": \"https://github.com/llvm/llvm-project.git\",\n  \"/src/pcre\": \"https://github.com/PhilipHazel/pcre2\",\n  \"/src/gnulib\": \"https://github.com/coreutils/gnulib.git\",\n  \"/src/net-snmp\": \"https://github.com/net-snmp/net-snmp.git\",\n  \"/src/harfbuzz\": \"https://github.com/harfbuzz/harfbuzz.git\",\n  \"/src/matio\": \"https://github.com/tbeu/matio.git\",\n  \"/src/aspell\": \"https://github.com/gnuaspell/aspell.git\",\n  \"/src/libsndfile\": \"https://github.com/libsndfile/libsndfile.git\",\n  \"/src/poppler\": \"https://gitlab.freedesktop.org/poppler/poppler.git\",\n  \"/src/gdal/poppler\": \"https://gitlab.freedesktop.org/poppler/poppler.git\",\n  \"/src/gdal/curl\": \"https://github.com/curl/curl.git\",\n  \"/src/ghostpdl\": \"https://cgit.ghostscript.com/ghostpdl.git\",\n  \"/src/cryptofuzz\": \"https://github.com/MozillaSecurity/cryptofuzz.git\",\n  \"/src/python-library-fuzzers\": \"https://github.com/hugovk/python-library-fuzzers.git\",\n  \"/src/libmicrohttpd\": \"https://git.gnunet.org/libmicrohttpd.git\"\n}"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/__init__.py",
    "content": "\"\"\"Project-specific hacks for fixing Dockerfiles and build scripts.\n\nThis module contains project-specific fixes that solve building/compiling problems\nfor various OSS-Fuzz projects. Each project has its own module with dedicated\nhack functions.\n\"\"\"\n\nimport importlib\n\nfrom abc import ABC, abstractmethod\nfrom pathlib import Path\n\ntry:\n  from ..arvo_utils import DockerfileModifier\nexcept ImportError:\n  # Fallback for when module is imported directly\n  from arvo_utils import DockerfileModifier\n\n\nclass ProjectHack(ABC):\n  \"\"\"Base class for project-specific hacks.\"\"\"\n\n  def __init__(self):\n    self.commit_date = None\n\n  def set_commit_date(self, commit_date):\n    \"\"\"Set the commit date for hacks that need it.\"\"\"\n    self.commit_date = commit_date\n\n  @abstractmethod\n  def apply_dockerfile_fixes(self, dft: DockerfileModifier) -> bool:\n    \"\"\"Apply project-specific fixes to a Dockerfile.\n        \n        Args:\n            dft: DockerfileModifier instance for the project's Dockerfile.\n            \n        Returns:\n            True if fixes were applied successfully, False otherwise.\n        \"\"\"\n    pass\n\n  def apply_build_script_fixes(self, dft: DockerfileModifier) -> bool:\n    \"\"\"Apply project-specific fixes to a build script.\n        \n        Args:\n            dft: DockerfileModifier instance for the project's build script.\n            \n        Returns:\n            True if fixes were applied successfully, False otherwise.\n        \"\"\"\n    # Default implementation - no build script fixes\n    return True\n\n  def apply_extra_fixes(self, source_dir: Path) -> bool:\n    \"\"\"Apply extra project-specific fixes that require file system operations.\n        \n        Args:\n            source_dir: Path to the source directory.\n            \n        Returns:\n            True if fixes were applied successfully, False otherwise.\n        \"\"\"\n    # Default implementation - no extra fixes\n    return True\n\n\ndef get_project_hack(project_name: str) -> ProjectHack | None:\n  \"\"\"Get a project hack instance by name using dynamic import.\"\"\"\n  try:\n    # Try to import the module for this project\n    module = importlib.import_module(f\".{project_name}\", __name__)\n\n    # Look for a class that ends with 'Hack' and is a subclass of ProjectHack\n    for attr_name in dir(module):\n      attr = getattr(module, attr_name)\n      if (isinstance(attr, type) and issubclass(attr, ProjectHack) and\n          attr != ProjectHack):\n        return attr()\n\n    # If no hack class found, return None\n    return None\n\n  except ImportError:\n    # No hack module for this project\n    return None\n\n\n# Helper functions that can be reused across projects\ndef x265_fix(dft: DockerfileModifier) -> None:\n  \"\"\"Apply x265-specific fixes to the dockerfile modifier.\n    \n    This is a common fix used by multiple projects that depend on x265.\n    The order of these replacements matters.\n    \"\"\"\n  dft.replace(\n      r'RUN\\shg\\sclone\\s.*bitbucket.org/multicoreware/x265\\s*(x265)*',\n      \"RUN git clone \"\n      \"https://bitbucket.org/multicoreware/x265_git.git x265\\n\")\n  dft.replace(\n      r'RUN\\shg\\sclone\\s.*hg\\.videolan\\.org/x265\\s*(x265)*', \"RUN git clone \"\n      \"https://bitbucket.org/multicoreware/x265_git.git x265\\n\")\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/cryptofuzz.py",
    "content": "\"\"\"Cryptofuzz project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass CryptofuzzHack(ProjectHack):\n  \"\"\"Hacks for the Cryptofuzz project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix Cryptofuzz Dockerfile issues.\"\"\"\n    # Fix libressl update script\n    dft.insert_line_before(\n        \"RUN cd $SRC/libressl && ./update.sh\",\n        \"RUN sed -n -i '/^# setup source paths$/,$p' $SRC/libressl/update.sh\")\n\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/dlplibs.py",
    "content": "\"\"\"DLPLibs project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass DLPLibsHack(ProjectHack):\n  \"\"\"Hacks for the DLPLibs project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix DLPLibs Dockerfile issues.\"\"\"\n    dft.replace(r\"ADD\", '# ADD')\n    dft.replace(r\"RUN wget\", '#RUN wget')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/duckdb.py",
    "content": "\"\"\"DuckDB project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass DuckDBHack(ProjectHack):\n  \"\"\"Hacks for the DuckDB project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"No Dockerfile fixes needed for DuckDB.\"\"\"\n    return True\n\n  def apply_build_script_fixes(self, dft) -> bool:\n    \"\"\"Fix DuckDB build script issues.\"\"\"\n    dft.replace(r'^make$', 'make -j`nproc`\\n')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/ffmpeg.py",
    "content": "\"\"\"FFmpeg project-specific hacks.\"\"\"\n\nfrom . import ProjectHack, x265_fix\n\n\nclass FFmpegHack(ProjectHack):\n  \"\"\"Hacks for the FFmpeg project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix FFmpeg Dockerfile issues.\"\"\"\n    # Apply x265 fixes\n    x265_fix(dft)\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/ghostscript.py",
    "content": "\"\"\"Ghostscript project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass GhostscriptHack(ProjectHack):\n  \"\"\"Hacks for the Ghostscript project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"No Dockerfile fixes needed for Ghostscript.\"\"\"\n    return True\n\n  def apply_build_script_fixes(self, dft) -> bool:\n    \"\"\"Fix Ghostscript build script issues.\"\"\"\n    old = r\"mv \\$SRC\\/freetype freetype\"\n    new = \"cp -r $SRC/freetype freetype\"\n    dft.replace(old, new)\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/gnutls.py",
    "content": "\"\"\"GnuTLS project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass GnuTLSHack(ProjectHack):\n  \"\"\"Hacks for the GnuTLS project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix GnuTLS Dockerfile issues.\"\"\"\n    dft.str_replace(\" libnettle6 \", \" \")\n    dft.replace(r\".*client_corpus_no_fuzzer_mode.*\", \"\")\n    dft.replace(r\".*server_corpus_no_fuzzer_mode.*\", \"\")\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/graphicsmagick.py",
    "content": "\"\"\"GraphicsMagick project-specific hacks.\"\"\"\n\nfrom . import ProjectHack, x265_fix\n\n\nclass GraphicsMagickHack(ProjectHack):\n  \"\"\"Hacks for the GraphicsMagick project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix GraphicsMagick Dockerfile issues.\"\"\"\n    # Fix mercurial clone with retry logic\n    dft.replace(\n        r'RUN hg clone .* graphicsmagick', 'RUN (CMD=\"hg clone --insecure '\n        'https://foss.heptapod.net/graphicsmagick/graphicsmagick '\n        'graphicsmagick\" && '\n        'for x in `seq 1 100`; do $($CMD); '\n        'if [ $? -eq 0 ]; then break; fi; done)')\n\n    # Apply x265 fixes\n    x265_fix(dft)\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/imagemagick.py",
    "content": "\"\"\"ImageMagick project-specific hacks.\"\"\"\n\nfrom pathlib import Path\nfrom . import ProjectHack\n\n\nclass ImageMagickHack(ProjectHack):\n  \"\"\"Hacks for the ImageMagick project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix ImageMagick Dockerfile issues.\"\"\"\n    # Fix heic corpus download issue\n    dft.replace(r'RUN svn .*heic_corpus.*',\n                \"RUN mkdir /src/heic_corpus && touch /src/heic_corpus/XxX\")\n    return True\n\n  def apply_extra_fixes(self, source_dir: Path) -> bool:\n    \"\"\"Apply extra ImageMagick-specific fixes.\"\"\"\n    # TODO: Improve this hack\n    target = (source_dir / \"src\" / \"imagemagick\" / \"Magick++\" / \"fuzz\" /\n              \"build.sh\")\n    if target.exists():\n      with open(target, encoding='utf-8') as f:\n        lines = f.readlines()\n      for x in range(3):\n        if lines and \"zip\" in lines[-x - 1]:\n          del lines[-x - 1]\n      with open(target, 'w', encoding='utf-8') as f:\n        f.write(\"\\n\".join(lines))\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/jbig2dec.py",
    "content": "\"\"\"JBIG2DEC project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass JBIG2DECHack(ProjectHack):\n  \"\"\"Hacks for the JBIG2DEC project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix JBIG2DEC Dockerfile issues.\"\"\"\n    dft.replace(r'RUN cd tests .*', \"\")\n    return True\n\n  def apply_build_script_fixes(self, dft) -> bool:\n    \"\"\"Fix JBIG2DEC build script issues.\"\"\"\n    dft.replace('unzip.*', 'exit 0')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/lcms.py",
    "content": "\"\"\"LCMS project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass LCMSHack(ProjectHack):\n  \"\"\"Hacks for the LCMS project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix LCMS Dockerfile issues.\"\"\"\n    # TODO: improve this tmp patch\n    dft.replace(r'#add more seeds from the testbed dir.*\\n', \"\")\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/libheif.py",
    "content": "\"\"\"LibHeif project-specific hacks.\"\"\"\n\nfrom . import ProjectHack, x265_fix\n\n\nclass LibHeifHack(ProjectHack):\n  \"\"\"Hacks for the LibHeif project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix LibHeif Dockerfile issues.\"\"\"\n    # Apply x265 fixes\n    x265_fix(dft)\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/libredwg.py",
    "content": "\"\"\"LibreDWG project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass LibreDWGHack(ProjectHack):\n  \"\"\"Hacks for the LibreDWG project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"No Dockerfile fixes needed for LibreDWG.\"\"\"\n    return True\n\n  def apply_build_script_fixes(self, dft) -> bool:\n    \"\"\"Fix LibreDWG build script issues.\"\"\"\n    dft.replace(r'^make$', 'make -j`nproc`\\n')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/libreoffice.py",
    "content": "\"\"\"LibreOffice project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass LibreOfficeHack(ProjectHack):\n  \"\"\"Hacks for the LibreOffice project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix LibreOffice Dockerfile issues.\"\"\"\n    # Fix setup script and disable various commands\n    dft.str_replace(\n        'RUN ./bin/oss-fuzz-setup.sh',\n        \"RUN sed -i 's|svn export --force -q https://github.com|\"\n        \"#svn export --force -q https://github.com|g' \"\n        \"./bin/oss-fuzz-setup.sh\")\n    dft.str_replace('RUN svn export', '# RUN svn export')\n    dft.str_replace('ADD ', '# ADD ')\n    dft.str_replace('RUN zip', '# RUN zip')\n    dft.str_replace('RUN mkdir afl-testcases', \"# RUN mkdir afl-testcases\")\n    dft.str_replace(\n        'RUN ./bin/oss-fuzz-setup.sh',\n        \"# RUN ./bin/oss-fuzz-setup.sh\")  # Avoid downloading not related stuff\n    return True\n\n  def apply_build_script_fixes(self, dft) -> bool:\n    \"\"\"Fix LibreOffice build script issues.\"\"\"\n    # If you don't want to destroy your life.\n    # Please leave this project alone. too hard to fix and the compiling\n    # takes several hours\n    line = '$SRC/libreoffice/bin/oss-fuzz-build.sh'\n    dft.insert_line_before(\n        line, \"sed -i 's/make fuzzers/make fuzzers -i/g' \"\n        \"$SRC/libreoffice/bin/oss-fuzz-build.sh\")\n    dft.insert_line_before(\n        line, \"sed -n -i '/#starting corpuses/q;p' \"\n        \"$SRC/libreoffice/bin/oss-fuzz-build.sh\")\n    dft.insert_line_before(\n        line, r\"sed -n -i '/pushd instdir\\/program/q;p' \"\n        r\"$SRC/libreoffice/bin/oss-fuzz-build.sh\")\n    dft.insert_line_before(\n        line, 'echo \"pushd instdir/program && mv *fuzzer $OUT\" >> '\n        '$SRC/libreoffice/bin/oss-fuzz-build.sh')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/libyang.py",
    "content": "\"\"\"LibYang project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass LibYangHack(ProjectHack):\n  \"\"\"Hacks for the LibYang project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix LibYang Dockerfile issues.\"\"\"\n    dft.str_replace(\n        'RUN git clone https://github.com/PCRE2Project/pcre2 pcre2 &&',\n        \"RUN git clone https://github.com/PCRE2Project/pcre2 pcre2\\n\"\n        \"RUN \")\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/lwan.py",
    "content": "\"\"\"Lwan project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass LwanHack(ProjectHack):\n  \"\"\"Hacks for the Lwan project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix Lwan Dockerfile issues.\"\"\"\n    dft.str_replace('git://github.com/lpereira/lwan',\n                    'https://github.com/lpereira/lwan.git')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/openh264.py",
    "content": "\"\"\"OpenH264 project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass OpenH264Hack(ProjectHack):\n  \"\"\"Hacks for the OpenH264 project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"No Dockerfile fixes needed for OpenH264.\"\"\"\n    return True\n\n  def apply_build_script_fixes(self, dft) -> bool:\n    \"\"\"Fix OpenH264 build script issues.\"\"\"\n    lines = dft.content.split(\"\\n\")\n    starts = -1\n    ends = -1\n    for num, line in enumerate(lines):\n      if \"# prepare corpus\" in line:\n        starts = num\n      elif \"# build\" in line:\n        ends = num\n        break\n    if starts != -1 and ends != -1:\n      dft.remove_range(starts, ends)\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/quickjs.py",
    "content": "\"\"\"QuickJS project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass QuickJSHack(ProjectHack):\n  \"\"\"Hacks for the QuickJS project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix QuickJS Dockerfile issues.\"\"\"\n    dft.str_replace('https://github.com/horhof/quickjs',\n                    'https://github.com/bellard/quickjs')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/radare2.py",
    "content": "\"\"\"Radare2 project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass Radare2Hack(ProjectHack):\n  \"\"\"Hacks for the Radare2 project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix Radare2 Dockerfile issues.\"\"\"\n    dft.str_replace(\"https://github.com/radare/radare2-regressions\",\n                    'https://github.com/rlaemmert/radare2-regressions.git')\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/skia.py",
    "content": "\"\"\"Skia project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass SkiaHack(ProjectHack):\n  \"\"\"Hacks for the Skia project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix Skia Dockerfile issues.\"\"\"\n    # Comment out wget commands and fix build script\n    dft.str_replace('RUN wget', \"# RUN wget\")\n    dft.insert_line_after('COPY build.sh $SRC/',\n                          \"RUN sed -i 's/cp.*zip.*//g' $SRC/build.sh\")\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/uwebsockets.py",
    "content": "\"\"\"uWebSockets project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass UWebSocketsHack(ProjectHack):\n  \"\"\"Hacks for the uWebSockets project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"No Dockerfile fixes needed for uWebSockets.\"\"\"\n    return True\n\n  def apply_build_script_fixes(self, dft) -> bool:\n    \"\"\"Fix uWebSockets build script issues.\"\"\"\n    # https://github.com/alexhultman/zlib -> https://github.com/madler/zlib.git\n    script = \"sed -i 's/alexhultman/madler/g' fuzzing/Makefile\"\n    dft.insert_line_at(0, script)\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/wireshark.py",
    "content": "\"\"\"Wireshark project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass WiresharkHack(ProjectHack):\n  \"\"\"Hacks for the Wireshark project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix Wireshark Dockerfile issues.\"\"\"\n    dft.replace(r\"RUN git clone .*wireshark.*\", \"\")\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/wolfssl.py",
    "content": "\"\"\"WolfSSL project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass WolfSSLHack(ProjectHack):\n  \"\"\"Hacks for the WolfSSL project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix WolfSSL Dockerfile issues.\"\"\"\n    # Replace gsutil cp command with a simple touch and zip\n    dft.str_replace(\n        'RUN gsutil cp '\n        'gs://wolfssl-backup.clusterfuzz-external.appspot.com/'\n        'corpus/libFuzzer/wolfssl_cryptofuzz-disable-fastmath/public.zip '\n        '$SRC/corpus_wolfssl_disable-fastmath.zip', \"RUN touch 0xdeadbeef && \"\n        \"zip $SRC/corpus_wolfssl_disable-fastmath.zip 0xdeadbeef\")\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/hacks/yara.py",
    "content": "\"\"\"YARA project-specific hacks.\"\"\"\n\nfrom . import ProjectHack\n\n\nclass YARAHack(ProjectHack):\n  \"\"\"Hacks for the YARA project.\"\"\"\n\n  def apply_dockerfile_fixes(self, dft) -> bool:\n    \"\"\"Fix YARA Dockerfile issues.\"\"\"\n    if 'bison' not in dft.content:\n      dft.insert_line_before(\n          \"RUN git clone https://github.com/VirusTotal/yara.git\",\n          \"RUN apt install -y bison\")\n    return True\n"
  },
  {
    "path": "infra/experimental/contrib/arvo/string_replacement.json",
    "content": "{\n    \"http://download.icu-project.org/files/icu4c/59.1/\":\n        \"https://github.com/unicode-org/icu/releases/download/release-59-1/\",\n    \"git://git.gnome.org/libxml2\":\n        \"https://gitlab.gnome.org/GNOME/libxml2.git\",\n    \"svn co svn://vcs.exim.org/pcre2/code/trunk pcre2\":\n        \"git clone https://github.com/PCRE2Project/pcre2 pcre2\",\n    \"https://git.savannah.nongnu.org/r/freetype/freetype2\":\n        \"https://github.com/freetype/freetype2\",\n    \"https://git.savannah.gnu.org/git/freetype/freetype2.git\":\n        \"https://github.com/freetype/freetype2\",\n    \"git://git.sv.nongnu.org/freetype/freetype2.git\":\n        \"https://github.com/freetype/freetype2\",\n    \"ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.1.tar.gz\":\n        \"-L http://ppmcore.mpi-cbg.de/upload/netcdf-4.4.1.1.tar.gz\",\n    \"RUN curl http\":\n        \"RUN curl -L http\",\n    \"&& curl http\":\n        \"&& curl -L http\",\n    \"https://github.com/01org/libva\":\n        \"https://github.com/intel/libva.git\",\n    \"https://github.com/intel/libva\\n\":\n        \"https://github.com/intel/libva.git\\n\",\n    \"http://www.zlib.net/zlib-1.2.11.tar.gz\":\n        \"https://www.zlib.net/fossils/zlib-1.2.11.tar.gz\",\n    \"https://jannau.net/dav1d_fuzzer_seed_corpus.zip\":\n        \"https://download.videolan.org/pub/videolan/testing/contrib/dav1d/dav1d_fuzzer_seed_corpus.zip\",\n    \"git://git.xiph.org/ogg.git\":\n        \"https://gitlab.xiph.org/xiph/ogg.git\",\n    \"https://github.com/xiph/ogg.git\":\n        \"https://gitlab.xiph.org/xiph/ogg.git\",\n    \"git://git.xiph.org/opus.git\":\n        \"https://gitlab.xiph.org/xiph/opus.git\",\n    \"git://git.xiph.org/theora.git\":\n        \"https://gitlab.xiph.org/xiph/theora.git\",\n    \"git://git.xiph.org/vorbis.git\":\n        \"https://gitlab.xiph.org/xiph/vorbis.git\",\n    \"svn co http://svn.xiph.org/trunk/ogg\":\n        \"git clone https://gitlab.xiph.org/xiph/ogg.git\",\n    \"git://git.videolan.org/git/x264.git\":\n        \"https://code.videolan.org/videolan/x264.git\",\n    \"http://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz\":\n        \"https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz\",\n    \"https://downloads.apache.org/maven/maven-3/3.6.3/binaries/\":\n        \"https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/\",\n    \"https://downloads.apache.org/maven/maven-3/3.8.6/binaries/\":\n        \"https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/\",\n    \"https://downloads.apache.org/maven/maven-3/3.8.5/binaries/\":\n        \"https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/\",\n    \"https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/\":\n        \"https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/\",\n    \"https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/\":\n        \"https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/\",\n    \"https://opus-codec.org/static/testvectors/opus_testvectors.tar.gz\":\n        \"http://opus-codec.org/static/testvectors/opus_testvectors.tar.gz\",\n    \"https://anongit.freedesktop.org/git/harfbuzz.git\":\n        \"https://github.com/harfbuzz/harfbuzz.git\",\n    \"git://anongit.kde.org/extra-cmake-modules\":\n        \"https://invent.kde.org/frameworks/extra-cmake-modules.git\",\n    \"git://anongit.kde.org/kimageformats\":\n        \"https://invent.kde.org/frameworks/kimageformats.git\",\n    \"git://anongit.kde.org/karchive\":\n        \"https://invent.kde.org/frameworks/karchive.git\",\n    \"git://git.savannah.gnu.org/gnulib.git\":\n        \"https://github.com/coreutils/gnulib.git\",\n    \"svn co http://llvm.org/svn/llvm-project/llvm/trunk\":\n        \"git clone https://github.com/llvm/llvm-project.git\",\n    \"svn co svn://vcs.exim.org/pcre/code/trunk\":\n        \"git clone https://github.com/PhilipHazel/pcre2\",\n    \"https://github.com/cmeister2/libssh2.git\":\n        \"https://github.com/libssh2/libssh2.git\",\n    \"git://git.code.sf.net/p/matio/matio\":\n        \"https://github.com/tbeu/matio.git\",\n    \"https://github.com/cmeister2/aspell.git\":\n        \"https://github.com/gnuaspell/aspell.git\",\n    \"https://github.com/erikd/libsndfile.git\":\n        \"https://github.com/libsndfile/libsndfile.git\",\n    \"https://anongit.freedesktop.org/git/poppler/poppler.git\":\n        \"https://gitlab.freedesktop.org/poppler/poppler.git\",\n    \"https://gitlab.freedesktop.org/ceyhunalp/poppler.git\":\n        \"https://gitlab.freedesktop.org/poppler/poppler.git\",\n    \"git.ghostscript.com/ghostpdl.git\":\n        \"cgit.ghostscript.com/ghostpdl.git\",\n    \"https://github.com/guidovranken/cryptofuzz\\n\":\n        \"https://github.com/MozillaSecurity/cryptofuzz.git\\n\",\n    \"https://gnunet.org/git\":\n        \"https://git.gnunet.org\",\n    \" --depth 1\":\n        \"\",\n    \" --depth=1\":\n        \"\",\n    \" --depth \":\n        \" --jobs \",\n    \" --recursive \":\n        \" \"\n}"
  },
  {
    "path": "infra/experimental/mcp/.gitignore",
    "content": ".venv\n__pycache__\n"
  },
  {
    "path": "infra/experimental/mcp/README.md",
    "content": "# OSS-Fuzz MCP\n\nThis is an experimental implementation of an MCP server that enables use of\nOSS-Fuzz tools. You can use it to solve various common OSS-Fuzz tasks.\n\nAt this stage, this is purely experimental code.\n\n\n## Threat model for running\n\nThis is experimental code and has an open threat model. By design, the MCP server\nexecutes untrusted code. As such, when running this tool you\nshould assume you will be running untrusted code on your machine. You should\nonly run this in a trusted environment and on a trusted network. In practice,\nthis means you must run this in a heavily sandboxed environment, and from a\nsecurity perspective if you run this tool you will run untrusted code in\nyour environment.\n\nThis code does not run in OSS-Fuzz production services and is not part of the\ntooling that runs our continuous fuzzing of open source projects.\n\n## Running the Service\n\n```sh\npython3.12 -m venv .venv\n. .venv/bin/active\npython3 -m pip install -r ./requirements.txt\n\n\n\n# Start server in one  terminal\npython3 ./oss_fuzz_server.py\n\n\n# Start client\npython3 ./client.py fix-build --projects abseil-py\n```\n"
  },
  {
    "path": "infra/experimental/mcp/client.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Client for OSS-Fuzz MCP server.\"\"\"\n\nimport asyncio\nimport os\nimport shutil\nimport logging\nimport random\nimport subprocess\nimport argparse\nimport time\nimport sys\nimport httpx\nimport pathlib\n\nfrom pydantic_ai import Agent\nfrom pydantic_ai.mcp import MCPServerStdio\n\nimport config as oss_fuzz_mcp_config\n\n# Configure logging\nlogging.basicConfig(\n    level=logging.INFO,\n    format=\"[CLIENT] %(asctime)s - %(name)s - %(levelname)s - %(message)s\",\n    stream=sys.stderr)\nlogger = logging.getLogger(\"mcp-server\")\n\nMCP_SERVER_URL = \"http://localhost:8000/sse\"\n\nOSS_FUZZ_SYSTEM_PROMPT = f\"\"\"You are an expert software security engineer that is specialized in OSS-Fuzz. OSS-Fuzz\nis a framework for managing fuzzing of projects, including building the projects,\nwriting fuzzing harnesses, and running the fuzzing harnesses.\n\nAn OSS-Fuzz project in general consists of a Dockerfile, a build.sh script, and a project.yaml file.\nThe Dockerfile is used to build the project and the build.sh script is used to build the\nfuzzing harnesses. The project.yaml file holds metadata.\n\nOSS-Fuzz builds the projects inside a container and links the fuzzing harnesses\ninside the container. The fuzzer executables, and relevant files, are copied to the $OUT directory.\n\nThere are three key tasks in OSS-Fuzz:\n1. Fixing broken OSS-Fuzz projects. Sometimes the OSS-Fuzz projects fail to build, which\n   is likely either a broken Dockerfile, broken build.sh or broken fuzzing harness source codes.\n   This often need to be fixed.\n\n2. Creating new OSS-Fuzz projects. This is done by creating a new Dockerfile, build.sh, project.yaml\n   and also fuzzing harnesses. This requires studying the project source code and coming up\n   with a set up where the fuzzing harnesses exist in the OSS-Fuzz project directory structure.\n\n3. Improving the code coverage of existing OSS-Fuzz projects by adding new fuzzing harnesses or\n   extending existing ones.\n\nYou are an expert in completing the above tasks.\n\nThe OSS-Fuzz source code is available at {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}. The various OSS-Fuzz\nprojects are available in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects.\n\nYou have access to the MCP tools, which allow you to read and write files, run commands,\nand interact with the OSS-Fuzz framework. You must use these tools to complete the tasks.\n\nEach OSS-Fuzz project targets fuzzing of a relevant open source project. Often you need to look at the\nsource code of this project, which exists in {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/\"the project name\"/...\nThis source code is a local version of the project and *not* the paths that exist in the container.\nYou should not adjust the files in this directory, but only read and study them. In case you need to\nadd changes to the source code, then these should be done directly by way of the Dockerfile and build.sh\nscript. Inside the container, in general the fuzzing harness is placed at $SRC/harness_name... and the project code is in\n$SRC/project_name.\n\n\nA sample structure for an OSS-Fuzz project is rapidjson (located at {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/rapidjson/)) which has the following relevant files:\n\nDockerfile:\n```\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool cmake libgtest-dev\nRUN git clone --depth 1 https://github.com/Tencent/rapidjson.git rapidjson\nWORKDIR rapidjson\nCOPY *.sh fuzzer.cpp $SRC/\n```\n\nbuild.sh\n```\nexport CXXFLAGS=\"$CXXFLAGS -pthread\"\n\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\nif [[ $CFLAGS = *sanitize=address* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DASAN\"\nfi\n\n# First build library and tests, which is needed for OSS-Fuzz's Chronos.\nmkdir build\ncd build\ncmake ../\nmake -j$(nproc)\ncd ../\n\n# Build fuzz harness.\n$CXX $CXXFLAGS -D_GLIBCXX_DEBUG -I $SRC/rapidjson/include $SRC/fuzzer.cpp $LIB_FUZZING_ENGINE -o $OUT/fuzzer\n```\n\nfuzzer.cpp\n```\n#include <cstdint>\n#include <cstddef>\n#include <string>\n#include <rapidjson/document.h>\n#include <rapidjson/prettywriter.h>\n\n#ifdef MSAN\nextern \"C\" {{\n    void __msan_check_mem_is_initialized(const volatile void *x, size_t size);\n}}\n#endif\n\ntemplate<unsigned parseFlags>\nvoid fuzzWithFlags(const std::string &s)\n{{\n    /* Parse input to rapidjson::Document */\n    rapidjson::Document document;\n    rapidjson::ParseResult pr = document.Parse<parseFlags>(s.c_str());\n    if ( !pr ) {{\n        return;\n    }}\n\n    /* Convert from rapidjson::Document to string */\n    rapidjson::StringBuffer sb;\n    rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(sb);\n    document.Accept(writer);\n    std::string str = sb.GetString();\n#ifdef MSAN\n    if ( str.size() ) {{\n        __msan_check_mem_is_initialized(str.data(), str.size());\n    }}\n#endif\n}}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{{\n    const std::string s(data, data + size);\n\n    fuzzWithFlags<rapidjson::kParseDefaultFlags>(s);\n    fuzzWithFlags<rapidjson::kParseFullPrecisionFlag>(s);\n    fuzzWithFlags<rapidjson::kParseNumbersAsStringsFlag>(s);\n    fuzzWithFlags<rapidjson::kParseCommentsFlag>(s);\n\n    return 0;\n}}\n```\n\nOSS-Fuzz supports multiple languages:\n- C\n- C++\n- Go\n- Python\n- Java\n\"\"\"\n\n\nasync def run_agent_loop(prompt: str) -> list:\n  \"\"\"\n    Performs a run with the LLM.\n    \n    Args:\n        prompt: The user's message\n        \n    Returns:\n        List of Nodes each a step in agent execution.\n    \"\"\"\n  nodes = []\n  try:\n    server = MCPServerStdio(\n        'python3',\n        [str(pathlib.Path(__file__).parent.resolve()) + '/oss_fuzz_server.py'],\n        timeout=5200.0)\n\n    agent = Agent(model=\"openai:gpt-4\", toolsets=[server], retries=30)\n\n    # Run the agent with the MCP server context\n    logger.info('Starting agent run')\n    async with agent.iter(prompt) as agent_run:\n      logger.info('Agent run started')\n      async for node in agent_run:\n        logger.info('Running node [%d] %s', len(nodes), node.__class__.__name__)\n        time.sleep(3)\n        nodes.append(node)\n  except Exception as e:\n    logger.info('Error during agent run: %s', e)\n    sys.exit(1)\n\n  return nodes\n\n\ndef initialize_oss_fuzz() -> None:\n  \"\"\"\n    Initialize the OSS-Fuzz environment by cloning the OSS-Fuzz repository.\n    \"\"\"\n  if not os.path.exists(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR):\n    logger.info('Cloning OSS-Fuzz repository...')\n    subprocess.check_call(\n        f'git clone https://github.com/google/oss-fuzz.git {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}',\n        shell=True)\n\n  os.makedirs(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, exist_ok=True)\n\n\ndef _get_oss_fuzz_filetree(project_name: str) -> str:\n  \"\"\"Gets the file tree for a given OSS-Fuzz project.\"\"\"\n  project_dir = os.path.join(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR, 'projects',\n                             project_name)\n  if not os.path.isdir(project_dir):\n    logger.warning('Project directory does not exist: %s', project_dir)\n    return ''\n\n  file_tree = []\n  for root, _, files in os.walk(project_dir):\n    for fname in files:\n      file_tree.append(os.path.join(project_dir, root, fname))\n  return '\\n'.join(file_tree)\n\n\ndef _get_upstream_repo(project_name: str) -> str:\n  \"\"\"Gets the upstream repository URL for a given project.\"\"\"\n  project_yaml = os.path.join(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR, 'projects',\n                              project_name, 'project.yaml')\n  if not os.path.exists(project_yaml):\n    logger.warning('Project YAML does not exist: %s', project_yaml)\n    return ''\n\n  with open(project_yaml, 'r', encoding='utf-8') as f:\n    project_data = f.read()\n  main_repo = ''\n  for line in project_data.split('\\n'):\n    if line.startswith('main_repo'):\n      main_repo = line.replace('main_repo: ', '').strip()\n  return main_repo\n\n\ndef _detect_language(project_name: str) -> str:\n  \"\"\"Gets the likely language of a project, using file extension count.\"\"\"\n  project_src = os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR,\n                             project_name)\n  if not os.path.isdir(project_src):\n    return ''\n\n  languages = {\n      'c++': 0,\n      'c': 0,\n      'python': 0,\n      'jvm': 0,\n      'go': 0,\n  }\n  for _, _, fnames in os.walk(project_src):\n    for fname in fnames:\n      _, file_extension = os.path.splitext(fname)\n      if file_extension in ['.c++', '.cpp', '.cc', '.hpp', '.h']:\n        languages['c++'] += 1\n      if file_extension in ['.c', '.h']:\n        languages['c'] += 1\n      if file_extension in ['.py']:\n        languages['python'] += 1\n      if file_extension in ['.java']:\n        languages['jvm'] += 1\n      if file_extension in ['.go']:\n        languages['go'] += 1\n\n  max_language = max(languages, key=languages.get)\n  # If max language is C, make sure it's not equal to C++ in the event only header files were counted.\n  # In that scenario, we will consider only header files to be C++.\n  if max_language == 'c' and languages['c'] == languages['c++']:\n    max_language = 'c++'\n  return max_language\n\n\ndef prepare_oss_fuzz_project(project_name: str) -> bool:\n  \"\"\"Gets the main repo of an OSS-Fuzz project and clones it into our caching folder.\"\"\"\n  # check the project yaml.\n  project_yaml = os.path.join(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR, 'projects',\n                              project_name, 'project.yaml')\n  if not os.path.exists(project_yaml):\n    logger.warning('Project YAML does not exist: %s', project_yaml)\n    return False\n\n  if os.path.isdir(\n      os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, project_name)):\n    return True\n\n  with open(project_yaml, 'r', encoding='utf-8') as f:\n    project_data = f.read()\n  main_repo = ''\n  for line in project_data.split('\\n'):\n    if line.startswith('main_repo'):\n      main_repo = line.replace('main_repo: ', '').strip()\n  if not main_repo:\n    raise Exception('No main_repo found in project.yaml')\n  logger.info('Main repo: %s', main_repo)\n\n  try:\n    subprocess.check_call(\n        'git clone ' + main_repo + ' ' +\n        os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, project_name),\n        shell=True,\n        timeout=60 * 10)\n  except subprocess.CalledProcessError as e:\n    logger.info(f\"Error cloning project {project_name}: {e}\")\n    return False\n  except subprocess.TimeoutExpired:\n    logger.info(f\"Cloning project {project_name} timed out.\")\n    return False\n\n  return os.path.isdir(\n      os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, project_name))\n\n\nasync def does_project_build(project: str) -> bool:\n  \"\"\"Runs OSS-Fuzz build_fuzzers and check_build to validate if project is\n  successful\"\"\"\n  try:\n    subprocess.check_call(\n        f'python3 {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/infra/helper.py build_fuzzers '\n        + project,\n        cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n        shell=True,\n        timeout=60 * 20)\n  except subprocess.CalledProcessError:\n    return False\n  except subprocess.TimeoutExpired:\n    logger.info(f\"Building project {project} timed out.\")\n    return False\n\n  try:\n    subprocess.check_call(\n        f'python3 {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/infra/helper.py check_build '\n        + project,\n        cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n        shell=True,\n        timeout=60 * 10)\n\n  except subprocess.CalledProcessError:\n    return False\n  except subprocess.TimeoutExpired:\n    logger.info(f\"Checking build for project {project} timed out.\")\n    return False\n\n  return True\n\n\nasync def fix_project_build(project: str, max_tries: int = 3):\n  \"\"\"Runs an agent to fix the build of an OSS-Fuzz project.\"\"\"\n\n  project_language = _detect_language(project)\n\n  extra_project_text = \"\"\n  upstream_repo = _get_upstream_repo(project)\n  if upstream_repo:\n    extra_project_text += f\"The upstream repository targeted by the OSS-Fuzz project is {upstream_repo}.\\n\"\n\n  if project_language == 'python':\n    extra_project_text += 'For Python projects, installing packages by way of pip should be done using `python3 -m pip ...` in the OSS-Fuzz build container.\\n'\n\n  oss_fuzz_filetree = _get_oss_fuzz_filetree(project)\n  if oss_fuzz_filetree:\n    extra_project_text += f'The files in the OSS-Fuzz project for {project} are:\\n{oss_fuzz_filetree}\\n'\n\n  nodes = []\n  for _attempt in range(max_tries):\n    logger.info('Attempt %d to fix project %s', _attempt + 1, project)\n    nodes += await run_agent_loop(\n        f\"\"\"Fix the OSS-Fuzz project {project} that currently has a broken build.\nUse the build logs from OSS-Fuzz's project {project} and determine why it fails, then \nproceed to adjust Dockerfile and build.sh scripts until the project builds.\n\nThe OSS-Fuzz project {project} targets a project written in {project_language}.\n{extra_project_text}\n\nYou should edit the files directly in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/\n\nOnce the project builds, then you must ensure the project passes OSS-Fuzz's \"fuzzer-check\".\n\nDo not stop testing new Dockerfile and build.sh scripts until the \"fuzzer-check\" passes.\nIf you need access to the files of the project that is being built, then this is available\nat the path {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/{project}/\n\nThe files in {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/{project}/ are a copy for read-only purposes, and not the files that will exist in the build environment.\nIn order to change files in the build environment, you must modify or create files in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/.\nUse file operations tools to inspect the files. However, only modify and adjust the files in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/...\n\nSome rules:\n- Do not change the ENTRYPOINT of the Dockerfile, it must remain as it is.\n- Do not adjust the Dockerfile so it copies files from the {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/{project}/... directory, as this is not the path that exists in the container.\n- You can add new files into the build environment by creating them in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/ and copying them into the environment by adjusting {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/Dockerfile.\n- The \"fuzzer-check\" must pass.\n- Continue adjusting the files in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/ until \"fuzzer-check\" passes.\n\"\"\")\n\n    fix_success = await does_project_build(project)\n    if fix_success:\n      logger.info('Project %s build fixed successfully.', project)\n      break\n  return nodes, fix_success\n\n\ndef _get_all_broken_oss_fuzz_projects(language: str = '') -> list[str]:\n  \"\"\"Gets the projects that are failing to build in OSS-Fuzz.\"\"\"\n  OSS_FUZZ_BUILD_STATUS_URL = 'https://oss-fuzz-build-logs.storage.googleapis.com'\n  FUZZ_BUILD_JSON = 'status.json'\n  fuzz_build_url = OSS_FUZZ_BUILD_STATUS_URL + '/' + FUZZ_BUILD_JSON\n\n  raw_fuzz_builds = httpx.get(fuzz_build_url)\n  if raw_fuzz_builds.status_code != 200:\n    raise Exception(\n        f\"Failed to fetch OSS-Fuzz build status: {raw_fuzz_builds.status_code}\")\n  fuzz_builds = raw_fuzz_builds.json()\n  broken_projects = []\n  for project in fuzz_builds.get('projects', []):\n\n    if len(project.get('history', [])) <= 4:\n      continue\n\n    history = project['history']\n    # Ensure the latest three build are failing, as we don't want to \"fix\" projects\n    # that spurious fail. This happens due to network issues, for example.\n    if history[0]['success'] or history[1]['success'] or history[2]['success']:\n      continue\n\n    # Make sure the project actually exists in the OSS-Fuzz repository.\n    # We need to do this because Clusterfuzz may keep some projects rolling\n    # withouth them being in OSS-Fuzz any longer.\n    project_path = os.path.join(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n                                'projects', project['name'])\n    if not os.path.exists(project_path):\n      continue\n\n    if language:\n      # Check which language\n      project_yaml = os.path.join(project_path, 'project.yaml')\n      if not os.path.exists(project_yaml):\n        logger.info(\n            f\"Project {project['name']} does not have a project.yaml file, skipping.\"\n        )\n        continue\n      with open(project_yaml, 'r', encoding='utf-8') as f:\n        project_data = f.read()\n      project_language = ''\n      for line in project_data.split('\\n'):\n        if line.startswith('language:'):\n          project_language = line.replace('language:', '').strip().lower()\n          break\n      if project_language != language.lower():\n        continue\n\n    broken_projects = [project['name']] + broken_projects\n  return broken_projects\n\n\nasync def add_run_tests_command(project_name: str):\n  \"\"\"Adds a run-tests.sh command for a specific OSS-Fuzz project.\"\"\"\n  project_path = os.path.join(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR, 'projects',\n                              project_name)\n  if not os.path.exists(project_path):\n    logger.warning(\"Project %s does not exist in OSS-Fuzz.\", project_name)\n    return\n  if not prepare_oss_fuzz_project(project_name):\n    logger.warning(\"Failed to prepare OSS-Fuzz project %s.\", project_name)\n    return\n\n  run_tests_path = os.path.join(project_path, 'run_tests.sh')\n  if not os.path.exists(run_tests_path):\n    with open(run_tests_path, 'w', encoding='utf-8') as f:\n      f.write(\"#!/bin/bash\\n\")\n      f.write(\"echo 'Running tests for project: {}'\\n\".format(project_name))\n\n  dockerfile_path = os.path.join(project_path, 'Dockerfile')\n  if not os.path.exists(dockerfile_path):\n    logger.info(f\"Dockerfile does not exist for project {project_name}.\")\n    return\n  with open(dockerfile_path, 'r', encoding='utf-8') as f:\n    if 'run_tests.sh' not in f.read():\n      should_add = True\n    else:\n      should_add = False\n\n  if should_add:\n    with open(dockerfile_path, 'a', encoding='utf-8') as f:\n      f.write(\"COPY run_tests.sh $SRC/\\n\")\n      f.write(\"RUN chmod +x $SRC/run_tests.sh\\n\")\n\n  os.chmod(run_tests_path, 0o755)\n\n  await run_agent_loop(f\"\"\"\nYou are an expert software security engineer that is specialized in OSS-Fuzz.\nYou are tasked with adding a run_tests.sh script to an OSS-Fuzz project.\nThis script should run the tests of the project, and ensure that the project is working correctly.\nThe run_tests.sh script should be placed in the project directory at {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/run_tests.sh.\nYou must ensure that the run_tests.sh script is executable and runs the tests of the project.\nThe run_tests.sh script should be placed in the project directory at {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/run_tests.sh.\nYou must ensure that the run_tests.sh script is executable and runs the tests of the project.\nYou should assume the run_tests.sh script runs after the project is build, and that the starting working\ndirectory of the run_tests.sh script is the WORKDIR of the Dockerfile ($SRC if not otherwise specified).\n\nYour task is to fix the run_tests.sh script for {project_name} so it runs the tests of the project and also passes the `run-tests-check`.\n\nYou are working on the OSS-Fuzz project {project_name}.\n\nYou must ensure the check `run-tests-check` passes! Continue creating a new run_tests.sh script until the check passes.\n\nYou must adjust the file in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/run_tests.sh to execute the tests.\n\nYou must run the `run-tests-check` after adjusting the script.\"\"\")\n\n\nasync def expand_existing_project(project_name: str):\n  \"\"\"Expands existing coverage harnesses of a given project.\"\"\"\n\n  if not prepare_oss_fuzz_project(project_name):\n    logger.info('Failed to prepare %s. Exiting.', project_name)\n    return\n\n  nodes = await run_agent_loop(\n      f\"\"\"You are a security engineer that is an expert in fuzzing development, and your goal is to expand on the\nfuzzing harnesses of OSS-Fuzz project {project_name}.\nUse the tools to understand the fuzzing harnesses of the {project_name}'s OSS-Fuzz integration.\nYou should edit the files directly in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/....\n\nA copy of the source code of {project_name} is available at {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/{project_name}/... This is a read-only copy\nand you should not modify the files in this directory. Instead, you should only modify the files in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/\nand you should do so to the extend that the fuzzing extensions are successful.\n\nUse file operations tools to inspect the files. However, only modify and adjust the files in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/...\n\nUse coverage tooling to understand if there are improvements in code coverage.\n\nYou can both add new fuzzing harnesses or modify existing, by writing files in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/...\n\nSome rules:\n- Do not change the ENTRYPOINT of the Dockerfile, it must remain as it is.\n- Do not adjust the Dockerfile so it copies files from the {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/{project_name}/... directory, as this is not the path that exists in the container.\n- If you need to add files to the project directory when inside the container, then add them to the {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/ folder and copy via the Dockerfile.\n- The \"fuzzer-check\" must pass.\n- Continue adjusting the files in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project_name}/ until \"fuzzer-check\" passes.\n\"\"\")\n\n  if nodes:\n    _log_nodes(f'responses-expand-{project_name}.log', nodes)\n\n\ndef _log_nodes(logfile, nodes, header_text=''):\n  \"\"\"Logs the nodes to a specified logfile.\"\"\"\n  with open(logfile, 'a', encoding='utf-8') as f:\n    if header_text:\n      f.write(header_text + '\\n')\n    for node in nodes:\n      f.write(str(node))\n      f.write('\\n')\n      f.write('-' * 55 + '\\n')\n\n\nasync def fix_oss_fuzz_projects(projects_to_fix=None,\n                                max_projects_to_fix=4,\n                                language='',\n                                max_tries=3):\n  \"\"\"Fixes the build of a list of OSS-Fuzz projects.\"\"\"\n\n  if projects_to_fix is None:\n    # Get list of all OSS-Fuzz projects that are broken.\n    broken_oss_fuzz_projects = _get_all_broken_oss_fuzz_projects(language)\n    random.shuffle(broken_oss_fuzz_projects)\n    logger.info('Total number of broken OSS-Fuzz projects: %d',\n                len(broken_oss_fuzz_projects))\n    if len(broken_oss_fuzz_projects) > max_projects_to_fix:\n      broken_oss_fuzz_projects = broken_oss_fuzz_projects[:max_projects_to_fix]\n  else:\n    broken_oss_fuzz_projects = projects_to_fix\n\n  logger.info('Projects to fix: %s', broken_oss_fuzz_projects)\n  if not broken_oss_fuzz_projects:\n    logger.info('No broken OSS-Fuzz projects to fix.')\n    return\n\n  responses = []\n  for project in broken_oss_fuzz_projects:\n    logger.info('Trying to fix project: %s', project)\n    try:\n      if not prepare_oss_fuzz_project(project):\n        continue\n    except:\n      continue\n    nodes, fix_success = await fix_project_build(project, max_tries)\n    responses.append({'project': project, 'fix_success': fix_success})\n    if nodes:\n      _log_nodes(f'responses-fix-build-{project}.json',\n                 nodes,\n                 header_text=f'Fixed build: {fix_success}')\n\n\nasync def initiate_project_creation(project: str, project_repo: str,\n                                    language: str):\n  \"\"\"Runs an agent to create an OSS-Fuzz project.\"\"\"\n\n  if language == 'go':\n    extra_text = \"\"\"\nA sample build.sh script for a Go OSS-Fuzz project is:\n\n```sh\nmv $SRC/fuzz_pageparser.go $SRC/hugo/parser/pageparser/\n\ncompile_go_fuzzer github.com/gohugoio/hugo/parser/pageparser FuzzParseFrontMatterAndContent FuzzParseFrontMatterAndContent\n```\n\nand a sample go fuzzer is:\n\n```go\npackage pageparser\n\nimport \"bytes\"\n\nfunc FuzzParseFrontMatterAndContent(data []byte) int {\n\tParseFrontMatterAndContent(bytes.NewReader(data))\n\treturn 1\n}\n```\n\nYou must use the `compile_go_fuzzer` command which exists inside the OSS-Fuzz container.\nTo debug semantics of this if needed, you should build the project and extract the logs. The first\nargument to `compile_go_fuzzer` is the package path, and the second argument is the fuzzer name.\n\n\nThe `compile_go_fuzzer` source code is as follows:\n```go\npath=$1\nfunction=$2\nfuzzer=$3\ntags=\"-tags gofuzz\"\nif [[ $#  -eq 4 ]]; then\n  tags=\"-tags $4\"\nfi\n\n# makes directory change temporary\n(\ncd $GOPATH/src/$path || true\n# in the case we are in the right directory, with go.mod but no go.sum\ngo mod tidy || true\n# project was downloaded with go get if go list fails\ngo list $tags $path || { cd $GOPATH/pkg/mod/ && cd `echo $path | cut -d/ -f1-3 | awk '{print $1\"@*\"}'`; } || cd -\n# project does not have go.mod if go list fails again\ngo list $tags $path || { go mod init $path && go mod tidy ;}\n\nif [[ $SANITIZER = *coverage* ]]; then\n  fuzzed_package=`go list $tags -f '{{.Name}}' $path`\n  abspath=`go list $tags -f {{.Dir}} $path`\n  cd $abspath\n  cp $GOPATH/ossfuzz_coverage_runner.go ./\"${function,,}\"_test.go\n  sed -i -e 's/FuzzFunction/'$function'/' ./\"${function,,}\"_test.go\n  sed -i -e 's/mypackagebeingfuzzed/'$fuzzed_package'/' ./\"${function,,}\"_test.go\n  sed -i -e 's/TestFuzzCorpus/Test'$function'Corpus/' ./\"${function,,}\"_test.go\n\n  # The repo is the module path/name, which is already created above in case it doesn't exist,\n  # but not always the same as the module path. This is necessary to handle SIV properly.\n  fuzzed_repo=$(go list $tags -f {{.Module}} \"$path\")\n  abspath_repo=`go list -m $tags -f {{.Dir}} $fuzzed_repo || go list $tags -f {{.Dir}} $fuzzed_repo`\n  # give equivalence to absolute paths in another file, as go test -cover uses golangish pkg.Dir\n  echo \"s=$fuzzed_repo\"=\"$abspath_repo\"= > $OUT/$fuzzer.gocovpath\n  # Additional packages for which to get coverage.\n  pkgaddcov=\"\"\n  # to prevent bash from failing about unbound variable\n  GO_COV_ADD_PKG_SET=${GO_COV_ADD_PKG:-}\n  if [[ -n \"${GO_COV_ADD_PKG_SET}\" ]]; then\n    pkgaddcov=\",\"$GO_COV_ADD_PKG\n    abspath_repo=`go list -m $tags -f {{.Dir}} $GO_COV_ADD_PKG || go list $tags -f {{.Dir}} $GO_COV_ADD_PKG`\n    echo \"s=^$GO_COV_ADD_PKG\"=\"$abspath_repo\"= >> $OUT/$fuzzer.gocovpath\n  fi\n  go test -run Test${function}Corpus -v $tags -coverpkg $fuzzed_repo/...$pkgaddcov -c -o $OUT/$fuzzer $path\nelse\n  # Compile and instrument all Go files relevant to this fuzz target.\n  echo \"Running go-fuzz $tags -func $function -o $fuzzer.a $path\"\n  go-fuzz $tags -func $function -o $fuzzer.a $path\n\n  # Link Go code ($fuzzer.a) with fuzzing engine to produce fuzz target binary.\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer\nfi\n)\n```\n\nI am only showing the source code of `compile_go_fuzzer` here for your reference. You should just\nuse it directly as a command `compile_go_fuzzer` as shown above in the `build.sh`.\n\"\"\"\n  else:\n    extra_text = \"\"\n\n  target_goal = ''\n  if language in ['c', 'c++']:\n    target_goal = \"\"\"The goal is to make sure we have a decent code coverage of the target project. Make\nsure the coverage of the target is above 10% in terms of line coverage. Use the tools\navailable to extract code coverage of the project when you're creating the harness, and either\nadd more fuzzing harnesses to the project or extend the harness to cover more functions.\"\"\"\n\n  nodes = await run_agent_loop(\n      f\"\"\"You are an expert software security engineer and you are tasked with creating an OSS-Fuzz project.\nI have set up an initial project structure at {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/. This structure\nincludes a Dockerfile, build.sh, and project.yaml file. The Dockerfile clones the target\nproject repository ({project_repo}) and the build.sh file is empty. Your task is to\nfill in the empty build.sh file with the necessary commands to build the project.\nThe Dockerfile should set up the relevant dependencies, but it should continue to\ninherit FROM the base builder image as already set.\n\nYou should:\n(1) fix the build.sh so it builds the project correctly, using CC, CXX, CFLAGS and CXXFLAGS for compilation.\n(2) add at least one fuzzing harness. This should be added in the {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/ directory\nand copied into the contained using the Dockerfile, where it will be build by the build.sh script.\n\nYou must ensure when the fuzzing harness is linked that the $LIB_FUZZING_ENGINE environment variable\nis included in the link command. The build.sh script must make sure to copy out the fuzzers build\nto the $OUT/ directory.\n\nYou must continue this session until the OSS-Fuzz project {project} builds correctly and the\n\\\"fuzzer-check\\\" must pass.\n\nThis is a project in the {language} programming language, so you must ensure the fuzzing\nharness is written in {language} and the build.sh script is set up to compile the project.\n\n{extra_text}\n\nThe project repository source code is available at {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/{project}/.\nThis source code is a local version of the project and *not* the paths that exist in the container. You should not adjust the files\nin this directory, but only read them. In case you need to add changes to the source code,\nthen these should be done directly by way of the Dockerfile and build.sh script. Inside the container,\nin general the fuzzing harness is placed at $SRC/harness_name... and the project code is in\n$SRC/project_name.\n\nYou must add at least one fuzzing harness to the OSS-Fuzz project {project}, and ensure it\nfully works.\n\nUse the file reading and writing tools to create the necessary files in the {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/{project}/ directory.\nThen, run the build_fuzzers and check_build commands to ensure the project builds correctly.\nRepeat this until the project builds successfully and the fuzzer-check passes.\nThe project must build success fully and the fuzzer-check must pass. If they do not pass, then\nyou must refine the OSS-Fuzz project until it does.\n\n{target_goal}\n\"\"\")\n\n  fix_success = await does_project_build(project)\n\n  if nodes:\n    _log_nodes(f'responses-{project}.json',\n               nodes,\n               header_text=f'initialization: {fix_success}')\n\n  if not fix_success:\n    logger.info('Project %s still does not build, trying to fix again.',\n                project)\n    fix_nodes, fix_success = await fix_project_build(project)\n    if fix_nodes:\n      _log_nodes(f'responses-fix-build-{project}.json',\n                 fix_nodes,\n                 header_text=f'fixed: {fix_success}')\n\n  return nodes, fix_success\n\n\ndef prepare_new_oss_fuzz_project(project_name: str, project_url: str) -> bool:\n  \"\"\"Gets the main repo of an OSS-Fuzz project and clones it into our caching folder.\"\"\"\n  if os.path.isdir(\n      os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, project_name)):\n    return True\n\n  try:\n    subprocess.check_call(\n        'git clone ' + project_url + ' ' +\n        os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, project_name),\n        shell=True,\n        timeout=60 * 10)\n  except subprocess.CalledProcessError as e:\n    logger.info(\"Error cloning project %s: %s\", project_name, e)\n    return False\n  except subprocess.TimeoutExpired:\n    logger.info(\"Cloning project %s timed out.\", project_name)\n    return False\n\n  return os.path.isdir(\n      f'{oss_fuzz_mcp_config.BASE_PROJECTS_DIR}/{project_name}')\n\n\nasync def create_oss_fuzz_integration_for_project(project_url: str,\n                                                  project_language: str):\n  \"\"\"Creates an integration for a specific OSS-Fuzz project.\"\"\"\n  # This function would typically create a new MCP tool for the project\n  # and register it with the MCP server.\n  # For now, we will just print the project URL.\n  logger.info(f\"Creating OSS-Fuzz integration for project: {project_url}\")\n  # Here you would implement the logic to create the integration.\n\n  oss_fuzz_project_name = project_url.split('/')[-1].lower()\n  if not oss_fuzz_project_name:\n    raise ValueError(\"Project URL does not contain a valid project name.\")\n  oss_fuzz_path = os.path.join(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n                               'projects', oss_fuzz_project_name)\n  if os.path.isdir(oss_fuzz_path):\n    shutil.rmtree(oss_fuzz_path)\n\n  prepare_new_oss_fuzz_project(oss_fuzz_project_name, project_url)\n  if not project_language:\n    project_language = _detect_language(oss_fuzz_project_name)\n\n  logger.info('Project %s language: %s', oss_fuzz_project_name,\n              project_language)\n\n  if not project_language:\n    logger.info('Could not detect language for project %s, exiting')\n    return\n\n  os.makedirs(oss_fuzz_path)\n  dockerfile_path = os.path.join(oss_fuzz_path, 'Dockerfile')\n  build_sh_path = os.path.join(oss_fuzz_path, 'build.sh')\n  project_yaml_path = os.path.join(oss_fuzz_path, 'project.yaml')\n\n  base_image = ''\n  project_language = project_language.lower()\n\n  if project_language == 'c':\n    base_image = 'gcr.io/oss-fuzz-base/base-builder'\n  elif project_language == 'c++':\n    base_image = 'gcr.io/oss-fuzz-base/base-builder'\n  elif project_language == 'go':\n    base_image = 'gcr.io/oss-fuzz-base/base-builder-go'\n\n  # Dockerfile\n  with open(dockerfile_path, 'w') as f:\n    dockerfile_content = f\"\"\"\nFROM {base_image}\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone {project_url} /src/{oss_fuzz_project_name}\nWORKDIR /src/{oss_fuzz_project_name}\nCOPY build.sh $SRC/build.sh\n\"\"\"\n\n    f.write(dockerfile_content)\n\n  # Build script\n  with open(build_sh_path, 'w') as f:\n    build_sh_content = f\"\"\"#!/bin/bash -eux\n# Empty build script for now. This needs to be filled with the actual build commands.\"\"\"\n    f.write(build_sh_content)\n\n  # Project YAML\n  with open(project_yaml_path, 'w') as f:\n    project_yaml_content = f\"\"\"\\\nhomepage: \"{project_url}\"\nlanguage: {project_language}\nprimary_contact: \"david@adalogics.com\"\nmain_repo: \"{project_url}\"\n\"\"\"\n    f.write(project_yaml_content)\n\n  # First, create a template setup for the project.\n  # Use a local directory with the project clone,\n  await initiate_project_creation(oss_fuzz_project_name, project_url,\n                                  project_language)\n\n\ndef parse_arguments():\n  \"\"\"Parse command line arguments.\"\"\"\n\n  parser = argparse.ArgumentParser(description=\"OSS-Fuzz MCP Client\")\n\n  subparsers = parser.add_subparsers(dest='command')\n\n  # Fix builds command\n  fix_builds = subparsers.add_parser(\n      'fix-builds',\n      help='Fix the builds of OSS-Fuzz projects that are currently broken.')\n  fix_builds.add_argument(\n      '--max_attempts',\n      type=int,\n      default=3,\n      help='Maximum number of attempts to fix each project (default: 3)')\n\n  fix_builds.add_argument('--max-projects',\n                          type=int,\n                          default=4,\n                          help='Maximum number of projects to fix (default: 4)')\n\n  fix_builds.add_argument('--language',\n                          help='Filter projects by language (e.g., c, c++, go)',\n                          default='')\n  fix_builds.add_argument(\n      '--projects',\n      nargs='*',\n      help=\n      'List of specific projects to fix. If not provided, random broken projects will be selected.'\n  )\n\n  # Create initial OSS-Fuzz project command.\n  create_project = subparsers.add_parser(\n      'create-project',\n      help=\n      'Create an initial OSS-Fuzz project with a given repository URL and language.'\n  )\n  create_project.add_argument(\n      'project_url',\n      type=str,\n      help='The URL of the project repository to create an OSS-Fuzz project for.'\n  )\n  create_project.add_argument(\n      '--language',\n      type=str,\n      default='',\n      help='The programming language of the project (e.g., c, c++, go).')\n\n  # Command to add run_tests.sh\n  add_run_tests_parser = subparsers.add_parser(\n      'run-tests', help='Add run-tests.sh command for specific project')\n  add_run_tests_parser.add_argument(\n      'project_name',\n      type=str,\n      help='The name of the project to add run-tests.sh command for.')\n\n  expand_existing = subparsers.add_parser(\n      'expand-existing', help='Expand existing OSS-Fuzz project')\n  expand_existing.add_argument('project_name',\n                               type=str,\n                               help='The name of the project to expand.')\n\n  return parser.parse_args()\n\n\nasync def main():\n  \"\"\"Main function to demonstrate the client usage\"\"\"\n\n  args = parse_arguments()\n\n  initialize_oss_fuzz()\n  if args.command == 'fix-builds':\n    await fix_oss_fuzz_projects(args.projects, args.max_projects, args.language,\n                                args.max_attempts)\n  elif args.command == 'create-project':\n    logger.info('Creating OSS-Fuzz project for URL: %s', args.project_url)\n    await create_oss_fuzz_integration_for_project(args.project_url,\n                                                  args.language)\n  elif args.command == 'run-tests':\n    await add_run_tests_command(args.project_name)\n  elif args.command == 'expand-existing':\n    await expand_existing_project(args.project_name)\n\n\nif __name__ == \"__main__\":\n  asyncio.run(main())\n"
  },
  {
    "path": "infra/experimental/mcp/config.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBASE_DIR = '/var/tmp/oss-fuzz-mcp'\nBASE_PROJECTS_DIR = f'{BASE_DIR}/projects'\nBASE_OSS_FUZZ_DIR = f'{BASE_DIR}/oss-fuzz'\nBASE_TMP_LOGS = f'{BASE_DIR}/tmp-logs'"
  },
  {
    "path": "infra/experimental/mcp/oss_fuzz_server.py",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"MCP server for OSS-Fuzz.\"\"\"\n\nimport logging\n\nimport os\nimport shutil\nimport sys\nimport json\nimport time\nimport subprocess\nfrom mcp.server.fastmcp import FastMCP\n\nimport config as oss_fuzz_mcp_config\n\nTARGET_PROJECT = ''\n\n# Configure logging\nlogging.basicConfig(\n    level=logging.INFO,\n    format=\n    \"[SERVER] %(asctime)s - %(name)s - '%(module)s - %(funcName)s - %(levelname)s - %(message)s\",\n    stream=sys.stderr)\nlogger = logging.getLogger(\"mcp-server\")\n\n# Create an MCP server with a name\nmcp = FastMCP(\"OSS-Fuzz tools with relevant file system utilities.\")\n\nFILE_ACCESS_ERROR = f\"\"\"Error: Cannot access directories outside of the base directory.\nRemember, all paths accessible by you must be prefixed with {oss_fuzz_mcp_config.BASE_DIR}.\n\nFurther:\n1) For project source code, this is available within {oss_fuzz_mcp_config.BASE_PROJECTS_DIR}.\n2) For access to OSS-Fuzz project files, these are accessible in {oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR}/projects/PROJECT_NAME/.\n\"\"\"\n\n\ndef _internal_delay():\n  \"\"\"Forced delay to control LLM limits\"\"\"\n  time.sleep(2)\n\n\ndef clone_oss_fuzz_if_it_does_not_exist():\n  \"\"\"Clones OSS-Fuzz if it does not already exist.\"\"\"\n\n  target = oss_fuzz_mcp_config.BASE_PROJECTS_DIR\n  if os.path.isdir(target):\n    logger.info('OSS-Fuzz already exists')\n    return\n\n  repo_url = \"https://github.com/google/oss-fuzz\"\n\n  try:\n    subprocess.check_call([\"git\", \"clone\", repo_url, target],\n                          stdout=subprocess.DEVNULL,\n                          stderr=subprocess.DEVNULL,\n                          cwd=oss_fuzz_mcp_config.BASE_DIR)\n\n  except subprocess.CalledProcessError:\n    logger.info('Error cloning OSS-Fuzz')\n\n\ndef _prepare_target_project():\n  \"\"\"Prepares the target OSS-Fuzz project by copying it to the OSS-Fuzz projects directory.\"\"\"\n  global TARGET_PROJECT\n\n  clone_oss_fuzz_if_it_does_not_exist()\n  project_name = os.path.basename(TARGET_PROJECT)\n  # Copy over the project files if needed.\n  if os.path.isdir(\n      os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, 'projects',\n                   project_name)):\n    shutil.rmtree(\n        os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, 'projects',\n                     project_name))\n  shutil.copytree(\n      TARGET_PROJECT,\n      os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, 'projects',\n                   project_name))\n  return project_name\n\n\n@mcp.tool()\nasync def check_if_oss_fuzz_project_builds() -> bool:\n  \"\"\"\n    Checks if the OSS-Fuzz project being worked on builds successfully.\n    \n    Returns:\n        True if the project builds successfully, False otherwise\n    \"\"\"\n  project_name = _prepare_target_project()\n\n  logger.info(\"Checking if OSS-Fuzz project '%s' builds successfully...\",\n              project_name)\n\n  try:\n    logger.info('Building OSS-Fuzz project: %s', project_name)\n    subprocess.check_call('python3 infra/helper.py build_fuzzers ' +\n                          project_name,\n                          cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n                          shell=True,\n                          stdout=subprocess.DEVNULL,\n                          stderr=subprocess.STDOUT,\n                          timeout=60 * 20)\n    return True\n  except subprocess.CalledProcessError as e:\n    logger.info(\"Build failed for project '%s': {%s}\", project_name, str(e))\n    return False\n  except subprocess.TimeoutExpired:\n    logger.info(f\"Building project {project_name} timed out.\")\n  return False\n\n\ndef shorten_logs_if_needed(log_string: str) -> str:\n  \"\"\"\n    Shortens the log string if it exceeds a certain length.\n    \n    Args:\n        log_string: The log string to potentially shorten\n    \n    Returns:\n        The original log string if it's short enough, or a shortened version\n    \"\"\"\n  max_length = 5000  # Define a maximum length for logs\n  if len(log_string) > max_length:\n    return log_string[:1000] + '... [truncated] ' + log_string[-3700:]\n  return log_string\n\n\n@mcp.tool()\nasync def build_and_get_build_logs_from_oss_fuzz() -> str:\n  \"\"\"\n    Retrieves build logs for an OSS-Fuzz project. This is useful when changes\n    have been made to the project and you want to see the build output.\n    \n    Returns:\n        A string containing the build logs for the project\n    \"\"\"\n  project_name = _prepare_target_project()\n  logger.info(\"Retrieving build logs for OSS-Fuzz project '%s'...\",\n              project_name)\n\n  os.makedirs(oss_fuzz_mcp_config.BASE_TMP_LOGS, exist_ok=True)\n  target_logs = os.path.join(oss_fuzz_mcp_config.BASE_TMP_LOGS, 'build-log.txt')\n  if os.path.isfile(target_logs):\n    os.remove(target_logs)\n\n  log_stdout = open(target_logs, 'w', encoding='utf-8')\n\n  try:\n    logger.info(\"Building OSS-Fuzz project: '%s'\", project_name)\n    subprocess.check_call('python3 infra/helper.py build_fuzzers ' +\n                          project_name,\n                          cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n                          shell=True,\n                          stdout=log_stdout,\n                          stderr=subprocess.STDOUT,\n                          timeout=60 * 20)\n  except subprocess.CalledProcessError as e:\n    logger.info(\"Build failed for project '%s': {%s}\", project_name, str(e))\n  except subprocess.TimeoutExpired:\n    logger.info(f\"Building project {project_name} timed out.\")\n\n  with open(target_logs, 'r', encoding='utf-8') as f:\n    logs = f.read()\n  logs_to_return = shorten_logs_if_needed(logs)\n  logger.info(\"Build logs for project '%s': {%s}\", project_name, logs_to_return)\n  return logs_to_return\n\n\n#@mcp.tool()\nasync def get_sample_artifacts_from_oss_fuzz_project(\n    language: str) -> dict[str, str]:\n  \"\"\"\n    Retrieves sample artifacts, Dockerfile and builds, for a specific language from OSS-Fuzz projects.\n    \n    Args:\n        language: The programming language for which to retrieve sample artifacts\n\n    Returns:\n        A dictionary containing the Dockerfile and build script.\n    \"\"\"\n  logger.info(\"Retrieving sample artifacts for OSS-Fuzz project language: %s\",\n              language)\n  if language == 'go':\n    project_name = 'go-dns'\n  elif language == 'c':\n    project_name = 'cjson'\n  elif language == 'cpp':\n    project_name = 'htslib'\n  elif language == 'java':\n    project_name = 'guava'\n  else:\n    return f\"Error: Unsupported language '{language}'. Supported languages are: go, c, cpp, java.\"\n\n  logger.info(\"Retrieving sample artifacts for OSS-Fuzz project '%s'...\",\n              project_name)\n\n  dockerfile_path = os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR,\n                                 'projects', project_name, 'Dockerfile')\n  build_script_path = os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR,\n                                   'projects', project_name, 'build.sh')\n  if not os.path.isfile(dockerfile_path) or not os.path.isfile(\n      build_script_path):\n    return f\"Error: Sample artifacts for project '{project_name}' not found.\"\n\n  with open(dockerfile_path, 'r', encoding='utf-8') as f:\n    dockerfile = f.read()\n  with open(build_script_path, 'r', encoding='utf-8') as f:\n    build_script = f.read()\n  artifacts = {\"Dockerfile\": dockerfile, \"build.sh\": build_script}\n  logger.info(\"Sample artifacts retrieved successfully for project '%s'.\",\n              project_name)\n  return artifacts\n\n\n#@mcp.tool()\nasync def check_run_tests(\n    project_name) -> str:  #, build_sh, dockerfile) -> str:\n  \"\"\"\n    OSS-Fuzz tool that performs \"run-tests-check\" on an OSS-Fuzz project.\n    Use this tool to verify `run_tests.sh` scripts.\n    Checks if an OSS-Fuzz project's tests run correctly.\n    This check should only be applied after the project builds successfully.\n    This check is needed for an OSS-Fuzz project to be in a good state.\n    \n    Args:\n        project_name: Name of the OSS-Fuzz project to check\n    \n    Returns:\n        The logs from building the project with custom artifacts.\n    \"\"\"\n  clone_oss_fuzz_if_it_does_not_exist()\n  logger.info(\n      \"Checking if OSS-Fuzz project '%s' builds with custom artifacts...\",\n      project_name)\n\n  os.makedirs(oss_fuzz_mcp_config.BASE_TMP_LOGS, exist_ok=True)\n  target_logs = os.path.join(oss_fuzz_mcp_config.BASE_TMP_LOGS,\n                             'check-fuzz-run-tests-log.txt')\n  if os.path.isfile(target_logs):\n    os.remove(target_logs)\n  log_stdout = open(target_logs, 'w', encoding='utf-8')\n  try:\n    subprocess.check_call(\n        f'infra/experimental/chronos/check_tests.sh {project_name} c++',\n        cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n        shell=True,\n        stdout=log_stdout,\n        stderr=subprocess.STDOUT,\n        timeout=60 * 20)\n\n  except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:\n    logger.info(\"Build failed for project '%s': {%s}\", project_name, str(e))\n    log_stdout.write(\"\\n\\nrun-tests.sh failed!!\\n\")\n    with open(target_logs, 'r', encoding='utf-8') as f:\n      logs = f.read()\n    logs_to_return = shorten_logs_if_needed(logs)\n    logger.info(\"run-tests.sh logs for project '%s': {%s}\", project_name,\n                logs_to_return)\n    return logs_to_return\n\n  with open(target_logs, 'r', encoding='utf-8') as f:\n    logs = f.read()\n  logs_to_return = shorten_logs_if_needed(logs)\n  logger.info(\"run-tests.sh for project '%s': {%s}\", project_name,\n              logs_to_return)\n  return logs_to_return\n\n\n@mcp.tool()\nasync def check_oss_fuzz_fuzzers() -> str:\n  \"\"\"\n    Performs \"fuzzer-check\" on an OSS-Fuzz project with custom artifacts.\n    Checks if the OSS-Fuzz project's fuzzers run correctly with custom artifacts.\n    This check should only be applied after the project builds successfully.\n    This check is needed for an OSS-Fuzz project to be in a good state.\n    \n    Returns:\n        The build logs from building the project with custom artifacts.\n    \"\"\"\n  project_name = _prepare_target_project()\n  logger.info(\n      \"Checking if OSS-Fuzz project '%s' builds and fuzzers pass check_build\",\n      project_name)\n\n  os.makedirs(oss_fuzz_mcp_config.BASE_TMP_LOGS, exist_ok=True)\n  target_logs = os.path.join(oss_fuzz_mcp_config.BASE_TMP_LOGS,\n                             'check-fuzz-build-log.txt')\n  if os.path.isfile(target_logs):\n    os.remove(target_logs)\n  log_stdout = open(target_logs, 'w', encoding='utf-8')\n  try:\n    subprocess.check_call('python3 infra/helper.py build_fuzzers ' +\n                          project_name,\n                          cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n                          shell=True,\n                          stdout=log_stdout,\n                          stderr=subprocess.STDOUT,\n                          timeout=60 * 20)\n\n  except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:\n    logger.info(\"Build failed for project '%s': {%s}\", project_name, str(e))\n    log_stdout.write(\"\\n\\nBuild failed!!\\n\")\n    with open(target_logs, 'r', encoding='utf-8') as f:\n      logs = f.read()\n    logs_to_return = shorten_logs_if_needed(logs)\n    logger.info(\"Build logs for project '%s': {%s}\", project_name,\n                logs_to_return)\n    return logs_to_return\n\n  check_target_logs = os.path.join(oss_fuzz_mcp_config.BASE_TMP_LOGS,\n                                   'check-fuzz-run-log.txt')\n  if os.path.isfile(check_target_logs):\n    os.remove(check_target_logs)\n  log_stdout = open(check_target_logs, 'w', encoding='utf-8')\n  try:\n    subprocess.check_call('python3 infra/helper.py check_build ' + project_name,\n                          cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n                          shell=True,\n                          stdout=log_stdout,\n                          stderr=subprocess.STDOUT,\n                          timeout=60 * 30)\n    log_stdout.write(\"\\n\\nChecking fuzzers succeeded.\\n\")\n  except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:\n    logger.info(\"Check failed for project '%s': {%s}\", project_name, str(e))\n    log_stdout.write(\"\\n\\nChecking fuzzers failed!!\\n\")\n  with open(check_target_logs, 'r', encoding='utf-8') as f:\n    logs = f.read()\n  logs_to_return = shorten_logs_if_needed(logs)\n  logger.info(\"Check fuzzers for project '%s': {%s}\", project_name,\n              logs_to_return)\n  return logs_to_return\n\n\n# File operating utilities\n#@mcp.tool()\nasync def list_files(path: str = \"\") -> str:\n  \"\"\"List all files in the specified directory.\n    \n    Args:\n        path: Optional subdirectory path relative to the base directory\n  \"\"\"\n  _internal_delay()\n  target_dir = os.path.normpath(path)\n  if not target_dir.startswith(oss_fuzz_mcp_config.BASE_DIR):\n    return FILE_ACCESS_ERROR\n\n  logger.info(\"Listing files in directory: %s\", target_dir)\n  try:\n    files = os.listdir(target_dir)\n    file_info = []\n\n    for file in files:\n      full_path = os.path.join(target_dir, file)\n      is_dir = os.path.isdir(full_path)\n      size = os.path.getsize(full_path) if not is_dir else \"-\"\n      file_type = \"Directory\" if is_dir else \"File\"\n\n      file_info.append({\"name\": file, \"type\": file_type, \"size\": size})\n\n    return_val = json.dumps(file_info, indent=2)\n    return return_val\n  except Exception as e:\n    return f\"Error listing files: {str(e)}\"\n\n\n#@mcp.tool()\nasync def get_file_size(file_path) -> str:\n  \"\"\"Get the size of a file.\n    \n    Args:\n        file_path: Path to the file relative to the base directory\n\n    Returns:\n        The size of the file in bytes or an error message.\n  \"\"\"\n  _internal_delay()\n  target_file = os.path.normpath(file_path)\n  if not target_file.startswith(oss_fuzz_mcp_config.BASE_DIR):\n    return FILE_ACCESS_ERROR\n\n  logger.info(\"Getting file size: %s\", target_file)\n  try:\n    if not os.path.isfile(target_file):\n      return f\"Error: File does not exist or is not a file: {file_path}\"\n\n    size = os.path.getsize(target_file)\n    return f\"File size of {file_path}: {size} bytes\"\n  except Exception as e:\n    return f\"Error getting file size: {str(e)}\"\n\n\n#@mcp.tool()\nasync def read_file(file_path: str, start_idx: int, end_idx: int) -> str:\n  \"\"\"Read the contents of a file. Will read a maximum of 3000 characters\n     to control size of content. Use arguments to control which part of file\n     to read.\n\n    Args:\n        file_path: Path to the file relative to the base directory\n        start_idx: character index to start reading from\n        end_idx: character index to stop reading (exclusive). If set to -1\n                 will read until the end of the file\n\n    Returns:\n        The contents of the file or an error message.\n  \"\"\"\n  _internal_delay()\n  target_file = os.path.normpath(file_path)\n  if not target_file.startswith(oss_fuzz_mcp_config.BASE_DIR):\n    return FILE_ACCESS_ERROR\n\n  logger.info(\"Reading file: %s\", target_file)\n  try:\n    if not os.path.isfile(target_file):\n      return f\"Error: File does not exist or is not a file: {file_path}\"\n\n    with open(target_file, 'r', encoding='utf-8') as f:\n      content = f.read()\n  except Exception as e:\n    return f\"Error reading file: {str(e)}\"\n\n  if end_idx == -1:\n    end_idx = len(content)\n\n  buffer_size_to_read = end_idx - start_idx\n\n  if buffer_size_to_read <= 0:\n    return f\"Error: Invalid indices. Negative size asked for: {buffer_size_to_read}\"\n\n  if buffer_size_to_read > 3000:\n    return f\"Error: Requested size too large: {buffer_size_to_read}. Maximum is 3000 characters.\"\n\n  try:\n    return content[start_idx:end_idx]\n  except Exception as e:\n    return f\"Error extracting content: {str(e)}\"\n\n\n#@mcp.tool()\nasync def write_file(file_path: str, content: str) -> str:\n  \"\"\"Write content to a file.\n    \n    Args:\n        file_path: Path to the file relative to the base directory\n        content: Content to write to the file\n  \"\"\"\n  _internal_delay()\n  logger.info(\"Writing to file: %s\", file_path)\n  target_file = os.path.normpath(file_path)\n\n  if not target_file.startswith(oss_fuzz_mcp_config.BASE_DIR):\n    return FILE_ACCESS_ERROR\n\n  try:\n    # Create directory if it doesn't exist\n    os.makedirs(os.path.dirname(target_file), exist_ok=True)\n\n    with open(target_file, 'w') as f:\n      f.write(content)\n\n    return f\"Successfully wrote to {file_path}\"\n  except Exception as e:\n    return f\"Error writing to file: {str(e)}\"\n\n\n#@mcp.tool()\nasync def delete_file(file_path: str) -> str:\n  \"\"\"Delete a file.\n    \n    Args:\n        file_path: Path to the file relative to the base directory\n  \"\"\"\n  _internal_delay()\n  logger.info(\"Deleting file: %s\", file_path)\n  target_file = os.path.normpath(file_path)\n\n  if not target_file.startswith(oss_fuzz_mcp_config.BASE_DIR):\n    return FILE_ACCESS_ERROR\n\n  try:\n    if not os.path.exists(target_file):\n      return f\"Error: File does not exist: {file_path}\"\n\n    if os.path.isdir(target_file):\n      os.rmdir(target_file)\n      return f\"Successfully deleted directory: {file_path}\"\n    else:\n      os.remove(target_file)\n      return f\"Successfully deleted file: {file_path}\"\n  except Exception as e:\n    return f\"Error deleting file: {str(e)}\"\n\n\n#@mcp.tool()\nasync def search_project_filename(project_name: str, filename: str) -> str:\n  \"\"\"\n    Searches for a filename inside the project directory.\n    \n    Args:\n        project_name: Name of the OSS-Fuzz project to search in\n        filename: The filename to search for\n    \n    Returns:\n        A string containing the paths of the files with the relevant\n        filename, or an error message.\n  \"\"\"\n  _internal_delay()\n  logger.info('Searching for filename \"%s\" in project \"%s\"...', filename,\n              project_name)\n\n  if '/' in filename:\n    return \"Error: Filename should not contain directory separators, only basename.\"\n\n  files_found = []\n  for root, dirs, files in os.walk(\n      os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, 'projects',\n                   project_name)):\n    for fname in files:\n      if fname == filename:\n        full_path = os.path.join(root, fname)\n        files_found.append(full_path)\n  return '\\n'.join(\n      files_found\n  ) if files_found else f'No files named \"{filename}\" found in project \"{project_name}\".'\n\n\n#@mcp.tool()\nasync def search_project_file_content(project_name: str,\n                                      search_term: str) -> str:\n  \"\"\"\n    Searches for a term in the content of files inside the project directory.\n\n    Args:\n        project_name: Name of the OSS-Fuzz project to search in.\n        search_term: The term to search for in the file contents.\n\n    Returns:\n        A string containing the paths of the files that contain the \n        search term and the line in the file the term is found,\n        or an error message if no files are found.\n    \"\"\"\n  _internal_delay()\n  logger.info('Searching for term \"%s\" in project \"%s\"...', search_term,\n              project_name)\n\n  files_found = []\n  for root, _, files in os.walk(\n      os.path.join(oss_fuzz_mcp_config.BASE_PROJECTS_DIR, 'projects',\n                   project_name)):\n    for fname in files:\n      full_path = os.path.join(root, fname)\n      with open(full_path, 'r', encoding='utf-8') as f:\n        content = f.read()\n        if search_term in content:\n          for lineno, line in enumerate(content.split('\\n')):\n            if search_term in line:\n              files_found.append(f'{full_path}:{lineno}')\n  return '\\n'.join(\n      files_found\n  ) if files_found else f'No files containing \"{search_term}\" found in project \"{project_name}\".'\n\n\n#@mcp.tool()\nasync def get_coverage_of_oss_fuzz_project(project_name):\n  \"\"\"\n    Gets the code coverage information for an OSS-Fuzz project.\n\n    Args:\n        project_name: Name of the OSS-Fuzz project\n\n    Returns:\n        A string containing the code coverage information, or an error message.\n  \"\"\"\n  _internal_delay()\n  logger.info('Getting coverage for project \"%s\"...', project_name)\n\n  os.makedirs(oss_fuzz_mcp_config.BASE_TMP_LOGS, exist_ok=True)\n  target_logs = os.path.join(oss_fuzz_mcp_config.BASE_TMP_LOGS, 'build-log.txt')\n  if os.path.isfile(target_logs):\n    os.remove(target_logs)\n\n  log_stdout = open(target_logs, 'w', encoding='utf-8')\n\n  try:\n    logger.info(\"Building OSS-Fuzz project: '%s'\", project_name)\n    subprocess.check_call(\n        'python3 infra/helper.py introspector --coverage-only --seconds=10 ' +\n        project_name,\n        cwd=oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n        shell=True,\n        stdout=log_stdout,\n        stderr=subprocess.STDOUT,\n        timeout=60 * 20)\n  except subprocess.CalledProcessError as e:\n    logger.info(\"Build failed for project '%s': {%s}\", project_name, str(e))\n  except subprocess.TimeoutExpired:\n    logger.info(f\"Building project {project_name} timed out.\")\n\n  # Extract coverage if we have it.\n  coverage_info_file = os.path.join(oss_fuzz_mcp_config.BASE_OSS_FUZZ_DIR,\n                                    'build', 'out', project_name, 'report',\n                                    'linux', 'summary.json')\n\n  if not os.path.isfile(coverage_info_file):\n    return f\"Error: Coverage information not found for project '{project_name}'.\"\n\n  with open(coverage_info_file, 'r', encoding='utf-8') as f:\n    oss_fuzz_cov_dict = json.load(f)\n\n  refined_cov_dict = {\n      'file-coverage': [],\n      'total-coverage': {\n          'lines': {\n              'count':\n                  oss_fuzz_cov_dict['data'][0]['totals']['lines']['count'],\n              'covered':\n                  oss_fuzz_cov_dict['data'][0]['totals']['lines']['covered'],\n              'percent':\n                  oss_fuzz_cov_dict['data'][0]['totals']['lines']['percent']\n          },\n          'functions': {\n              'count':\n                  oss_fuzz_cov_dict['data'][0]['totals']['functions']['count'],\n              'covered':\n                  oss_fuzz_cov_dict['data'][0]['totals']['functions']\n                  ['covered'],\n              'percent':\n                  oss_fuzz_cov_dict['data'][0]['totals']['functions']['percent']\n          }\n      }\n  }\n\n  for file_cov in oss_fuzz_cov_dict['data'][0]['files']:\n    refined_cov_dict['file-coverage'].append({\n        'filename': file_cov['filename'],\n        'lines': {\n            'count': file_cov['summary']['lines']['count'],\n            'covered': file_cov['summary']['lines']['covered'],\n            'percent': file_cov['summary']['lines']['percent']\n        },\n        'functions': {\n            'count': file_cov['summary']['functions']['count'],\n            'covered': file_cov['summary']['functions']['covered'],\n            'percent': file_cov['summary']['functions']['percent']\n        }\n    })\n\n  logger.info('Refined coverage dict: %s', json.dumps(refined_cov_dict,\n                                                      indent=2))\n\n  return json.dumps(refined_cov_dict, indent=2)\n\n\ndef start_mcp_server():\n  \"\"\"Starts the MCP server.\"\"\"\n  global TARGET_PROJECT\n\n  oss_fuzz_target = sys.argv[1]\n\n  TARGET_PROJECT = oss_fuzz_target\n  logger.info('OSS-Fuzz MCP server target: %s', oss_fuzz_target)\n\n  try:\n    logger.info(\"Starting MCP server.\")\n    mcp.run(transport=\"stdio\")\n  except KeyboardInterrupt:\n    logger.info(\"Caught KeyboardInterrupt.\")\n  logger.info('Server shut down.')\n\n\nif __name__ == \"__main__\":\n  start_mcp_server()\n"
  },
  {
    "path": "infra/experimental/mcp/requirements.txt",
    "content": "openai==1.97.0\npydantic_ai==0.4.10\nlogfire\n"
  },
  {
    "path": "infra/experimental/sanitizers/ExecSan/README.md",
    "content": "# Moved\n\nThis has moved to <https://github.com/google/oss-fuzz/tree/master/infra/experimental/SystemSan>.\n"
  },
  {
    "path": "infra/helper.py",
    "content": "#!/usr/bin/env python\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Helper script for OSS-Fuzz users. Can do common tasks like building\nprojects/fuzzers, running them etc.\"\"\"\n\nfrom __future__ import print_function\nfrom multiprocessing.dummy import Pool as ThreadPool\nimport argparse\nimport datetime\nimport errno\nimport logging\nimport os\nimport re\nimport shlex\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nimport urllib.request\n\nimport constants\nimport templates\nimport chronos.manager\nimport common_utils\n\n# Forward reference common functions. We do this because they are used\n# throughout the infra and to avoid breakages we declare them here.\n# TODO(David): clean this up.\nOSS_FUZZ_DIR = common_utils.OSS_FUZZ_DIR\nProject = common_utils.Project\ndocker_build = common_utils.docker_build\nbuild_image_impl = common_utils.build_image_impl\npull_images = common_utils.pull_images\n\n\ndef _get_base_runner_image(args, debug=False):\n  \"\"\"Returns the base runner image to use.\"\"\"\n  image = common_utils.BASE_RUNNER_IMAGE\n  if debug:\n    image += '-debug'\n\n  tag = 'latest'\n  if hasattr(args, 'base_image_tag') and args.base_image_tag:\n    tag = args.base_image_tag\n  elif hasattr(args, 'project') and args.project:\n    if args.project.base_os_version != 'legacy':\n      tag = args.project.base_os_version\n\n  return f'{image}:{tag}'\n\n\nVALID_PROJECT_NAME_REGEX = re.compile(r'^[a-zA-Z0-9_-]+$')\nMAX_PROJECT_NAME_LENGTH = 26\n\nCORPUS_URL_FORMAT = (\n    'gs://{project_name}-corpus.clusterfuzz-external.appspot.com/libFuzzer/'\n    '{fuzz_target}/')\nCORPUS_BACKUP_URL_FORMAT = (\n    'gs://{project_name}-backup.clusterfuzz-external.appspot.com/corpus/'\n    'libFuzzer/{fuzz_target}/')\n\nHTTPS_CORPUS_BACKUP_URL_FORMAT = (\n    'https://storage.googleapis.com/{project_name}-backup.clusterfuzz-external'\n    '.appspot.com/corpus/libFuzzer/{fuzz_target}/public.zip')\n\nLANGUAGE_REGEX = re.compile(r'[^\\s]+')\n\nWORKDIR_REGEX = re.compile(r'\\s*WORKDIR\\s*([^\\s]+)')\n\n# Regex to match special chars in project name.\nSPECIAL_CHARS_REGEX = re.compile('[^a-zA-Z0-9_-]')\n\nLANGUAGE_TO_BASE_BUILDER_IMAGE = {\n    'c': 'base-builder',\n    'c++': 'base-builder',\n    'go': 'base-builder-go',\n    'javascript': 'base-builder-javascript',\n    'jvm': 'base-builder-jvm',\n    'python': 'base-builder-python',\n    'ruby': 'base-builder-ruby',\n    'rust': 'base-builder-rust',\n    'swift': 'base-builder-swift'\n}\nARM_BUILDER_NAME = 'oss-fuzz-buildx-builder'\n\nCLUSTERFUZZLITE_ENGINE = 'libfuzzer'\nCLUSTERFUZZLITE_ARCHITECTURE = 'x86_64'\nCLUSTERFUZZLITE_FILESTORE_DIR = 'filestore'\nCLUSTERFUZZLITE_DOCKER_IMAGE = 'gcr.io/oss-fuzz-base/cifuzz-run-fuzzers'\n\nINDEXER_PREBUILT_URL = ('https://clusterfuzz-builds.storage.googleapis.com/'\n                        'oss-fuzz-artifacts/indexer')\n\nlogger = logging.getLogger(__name__)\n\nif sys.version_info[0] >= 3:\n  raw_input = input  # pylint: disable=invalid-name\n\n# pylint: disable=too-many-lines\n\n\ndef main():  # pylint: disable=too-many-branches,too-many-return-statements\n  \"\"\"Gets subcommand from program arguments and does it. Returns 0 on success 1\n  on error.\"\"\"\n  logging.basicConfig(level=logging.INFO)\n  parser = get_parser()\n  args = parse_args(parser)\n\n  # Need to do this before chdir.\n  # TODO(https://github.com/google/oss-fuzz/issues/6758): Get rid of chdir.\n  if hasattr(args, 'testcase_path'):\n    args.testcase_path = _get_absolute_path(args.testcase_path)\n  # Note: this has to happen after parse_args above as parse_args needs to know\n  # the original CWD for external projects.\n  os.chdir(common_utils.OSS_FUZZ_DIR)\n  if not os.path.exists(common_utils.BUILD_DIR):\n    os.mkdir(common_utils.BUILD_DIR)\n\n  # We have different default values for `sanitizer` depending on the `engine`.\n  # Some commands do not have `sanitizer` argument, so `hasattr` is necessary.\n  if hasattr(args, 'sanitizer') and not args.sanitizer:\n    if args.project.language == 'javascript':\n      args.sanitizer = 'none'\n    else:\n      args.sanitizer = constants.DEFAULT_SANITIZER\n\n  if args.command == 'generate':\n    result = generate(args)\n  elif args.command == 'build_image':\n    result = build_image(args)\n  elif args.command == 'build_fuzzers':\n    result = build_fuzzers(args)\n  elif args.command == 'fuzzbench_build_fuzzers':\n    result = fuzzbench_build_fuzzers(args)\n  elif args.command == 'fuzzbench_run_fuzzer':\n    result = fuzzbench_run_fuzzer(args)\n  elif args.command == 'fuzzbench_measure':\n    result = fuzzbench_measure(args)\n  elif args.command == 'check_build':\n    result = check_build(args)\n  elif args.command == 'download_corpora':\n    result = download_corpora(args)\n  elif args.command == 'run_fuzzer':\n    result = run_fuzzer(args)\n  elif args.command == 'coverage':\n    result = coverage(args)\n  elif args.command == 'introspector':\n    result = introspector(args)\n  elif args.command == 'reproduce':\n    result = reproduce(args)\n  elif args.command == 'shell':\n    result = shell(args)\n  elif args.command == 'pull_images':\n    result = common_utils.pull_images()\n  elif args.command == 'index':\n    result = index(args)\n  elif args.command == 'run_clusterfuzzlite':\n    result = run_clusterfuzzlite(args)\n  elif args.command == 'check-tests':\n    chronos.manager.cmd_dispatcher_check_tests(args)\n    result = 0\n  elif args.command == 'check-replay':\n    chronos.manager.cmd_dispatcher_check_replay(args)\n    result = 0\n  else:\n    # Print help string if no arguments provided.\n    parser.print_help()\n    result = False\n  return bool_to_retcode(result)\n\n\ndef bool_to_retcode(boolean):\n  \"\"\"Returns 0 if |boolean| is Truthy, 0 is the standard return code for a\n  successful process execution. Returns 1 otherwise, indicating the process\n  failed.\"\"\"\n  return 0 if boolean else 1\n\n\ndef parse_args(parser, args=None):\n  \"\"\"Parses |args| using |parser| and returns parsed args. Also changes\n  |args.build_integration_path| to have correct default behavior.\"\"\"\n  # Use default argument None for args so that in production, argparse does its\n  # normal behavior, but unittesting is easier.\n  parsed_args = parser.parse_args(args)\n  project = getattr(parsed_args, 'project', None)\n  if not project:\n    return parsed_args\n\n  # Use hacky method for extracting attributes so that ShellTest works.\n  # TODO(metzman): Fix this.\n  is_external = getattr(parsed_args, 'external', False)\n  parsed_args.project = common_utils.Project(parsed_args.project, is_external)\n  return parsed_args\n\n\ndef _add_external_project_args(parser):\n  parser.add_argument(\n      '--external',\n      help='Is project external?',\n      default=False,\n      action='store_true',\n  )\n\n\ndef get_parser():  # pylint: disable=too-many-statements,too-many-locals\n  \"\"\"Returns an argparse parser.\"\"\"\n  parser = argparse.ArgumentParser('helper.py', description='oss-fuzz helpers')\n  subparsers = parser.add_subparsers(dest='command')\n\n  generate_parser = subparsers.add_parser(\n      'generate', help='Generate files for new project.')\n  generate_parser.add_argument('project')\n  generate_parser.add_argument('--language',\n                               default=constants.DEFAULT_LANGUAGE,\n                               choices=LANGUAGE_TO_BASE_BUILDER_IMAGE.keys(),\n                               help='Project language.')\n  _add_external_project_args(generate_parser)\n\n  build_image_parser = subparsers.add_parser('build_image',\n                                             help='Build an image.')\n  build_image_parser.add_argument('project')\n  build_image_parser.add_argument('--pull',\n                                  action='store_true',\n                                  help='Pull latest base image.')\n  _add_architecture_args(build_image_parser)\n  build_image_parser.add_argument('--cache',\n                                  action='store_true',\n                                  default=False,\n                                  help='Use docker cache when building image.')\n  build_image_parser.add_argument('--no-pull',\n                                  action='store_true',\n                                  help='Do not pull latest base image.')\n  _add_external_project_args(build_image_parser)\n\n  build_fuzzers_parser = subparsers.add_parser(\n      'build_fuzzers', help='Build fuzzers for a project.')\n  _add_architecture_args(build_fuzzers_parser)\n  _add_engine_args(build_fuzzers_parser)\n  _add_sanitizer_args(build_fuzzers_parser)\n  _add_environment_args(build_fuzzers_parser)\n  _add_external_project_args(build_fuzzers_parser)\n  build_fuzzers_parser.add_argument('project')\n  build_fuzzers_parser.add_argument('source_path',\n                                    help='path of local source',\n                                    nargs='?')\n  build_fuzzers_parser.add_argument('--mount_path',\n                                    dest='mount_path',\n                                    help='path to mount local source in '\n                                    '(defaults to WORKDIR)')\n  build_fuzzers_parser.add_argument('--clean',\n                                    dest='clean',\n                                    action='store_true',\n                                    help='clean existing artifacts.')\n  build_fuzzers_parser.add_argument('--no-clean',\n                                    dest='clean',\n                                    action='store_false',\n                                    help='do not clean existing artifacts '\n                                    '(default).')\n  build_fuzzers_parser.set_defaults(clean=False)\n\n  fuzzbench_build_fuzzers_parser = subparsers.add_parser(\n      'fuzzbench_build_fuzzers')\n  _add_architecture_args(fuzzbench_build_fuzzers_parser)\n  fuzzbench_build_fuzzers_parser.add_argument('--engine')\n  _add_sanitizer_args(fuzzbench_build_fuzzers_parser)\n  _add_environment_args(fuzzbench_build_fuzzers_parser)\n  _add_external_project_args(fuzzbench_build_fuzzers_parser)\n  fuzzbench_build_fuzzers_parser.add_argument('project')\n  check_build_parser = subparsers.add_parser(\n      'check_build', help='Checks that fuzzers execute without errors.')\n  _add_architecture_args(check_build_parser)\n  _add_engine_args(check_build_parser, choices=constants.ENGINES)\n  _add_sanitizer_args(check_build_parser, choices=constants.SANITIZERS)\n  _add_environment_args(check_build_parser)\n  _add_base_image_tag_args(check_build_parser)\n  check_build_parser.add_argument('project',\n                                  help='name of the project or path (external)')\n  check_build_parser.add_argument('fuzzer_name',\n                                  help='name of the fuzzer',\n                                  nargs='?')\n  _add_external_project_args(check_build_parser)\n  index_parser = subparsers.add_parser('index', help='Index project.')\n  index_parser.add_argument(\n      '--targets', help='Allowlist of targets to index (comma-separated).')\n  index_parser.add_argument('--dev',\n                            action='store_true',\n                            help=('Use development versions of scripts and '\n                                  'indexer.'))\n  index_parser.add_argument('--shell',\n                            action='store_true',\n                            help='Run /bin/bash instead of the indexer.')\n  index_parser.add_argument('--docker_arg',\n                            help='Additional docker argument to pass through '\n                            '(can be specified multiple times).',\n                            nargs='*',\n                            action='extend')\n  index_parser.add_argument('project', help='Project')\n  index_parser.add_argument(\n      'extra_args',\n      nargs='*',\n      help='Additional args to pass through to the Docker entrypoint.')\n  _add_architecture_args(index_parser)\n  _add_environment_args(index_parser)\n\n  run_fuzzer_parser = subparsers.add_parser(\n      'run_fuzzer', help='Run a fuzzer in the emulated fuzzing environment.')\n  _add_architecture_args(run_fuzzer_parser)\n  _add_engine_args(run_fuzzer_parser)\n  _add_sanitizer_args(run_fuzzer_parser)\n  _add_environment_args(run_fuzzer_parser)\n  _add_base_image_tag_args(run_fuzzer_parser)\n  _add_external_project_args(run_fuzzer_parser)\n  run_fuzzer_parser.add_argument(\n      '--corpus-dir', help='directory to store corpus for the fuzz target')\n  run_fuzzer_parser.add_argument('project',\n                                 help='name of the project or path (external)')\n  run_fuzzer_parser.add_argument('fuzzer_name', help='name of the fuzzer')\n  run_fuzzer_parser.add_argument('fuzzer_args',\n                                 help='arguments to pass to the fuzzer',\n                                 nargs='*')\n\n  fuzzbench_run_fuzzer_parser = subparsers.add_parser('fuzzbench_run_fuzzer')\n  _add_architecture_args(fuzzbench_run_fuzzer_parser)\n  fuzzbench_run_fuzzer_parser.add_argument('--engine')\n  _add_sanitizer_args(fuzzbench_run_fuzzer_parser)\n  _add_environment_args(fuzzbench_run_fuzzer_parser)\n  _add_external_project_args(fuzzbench_run_fuzzer_parser)\n  fuzzbench_run_fuzzer_parser.add_argument(\n      '--corpus-dir', help='directory to store corpus for the fuzz target')\n  fuzzbench_run_fuzzer_parser.add_argument(\n      'project', help='name of the project or path (external)')\n  fuzzbench_run_fuzzer_parser.add_argument('fuzzer_name',\n                                           help='name of the fuzzer')\n  fuzzbench_run_fuzzer_parser.add_argument(\n      'fuzzer_args', help='arguments to pass to the fuzzer', nargs='*')\n\n  fuzzbench_measure_parser = subparsers.add_parser('fuzzbench_measure')\n  fuzzbench_measure_parser.add_argument(\n      'project', help='name of the project or path (external)')\n  fuzzbench_measure_parser.add_argument('engine_name',\n                                        help='name of the fuzzer')\n  fuzzbench_measure_parser.add_argument('fuzz_target_name',\n                                        help='name of the fuzzer')\n\n  coverage_parser = subparsers.add_parser(\n      'coverage', help='Generate code coverage report for the project.')\n  coverage_parser.add_argument('--no-corpus-download',\n                               action='store_true',\n                               help='do not download corpus backup from '\n                               'OSS-Fuzz; use corpus located in '\n                               'build/corpus/<project>/<fuzz_target>/')\n  coverage_parser.add_argument('--no-serve',\n                               action='store_true',\n                               help='do not serve a local HTTP server.')\n  coverage_parser.add_argument('--port',\n                               default='8008',\n                               help='specify port for'\n                               ' a local HTTP server rendering coverage report')\n  coverage_parser.add_argument('--fuzz-target',\n                               help='specify name of a fuzz '\n                               'target to be run for generating coverage '\n                               'report')\n  coverage_parser.add_argument('--corpus-dir',\n                               help='specify location of corpus'\n                               ' to be used (requires --fuzz-target argument)')\n  coverage_parser.add_argument('--public',\n                               action='store_true',\n                               help='if set, will download public '\n                               'corpus using wget')\n  coverage_parser.add_argument('project',\n                               help='name of the project or path (external)')\n  coverage_parser.add_argument('extra_args',\n                               help='additional arguments to '\n                               'pass to llvm-cov utility.',\n                               nargs='*')\n  _add_external_project_args(coverage_parser)\n  _add_architecture_args(coverage_parser)\n  _add_base_image_tag_args(coverage_parser)\n\n  introspector_parser = subparsers.add_parser(\n      'introspector',\n      help='Run a complete end-to-end run of '\n      'fuzz introspector. This involves (1) '\n      'building the fuzzers with ASAN; (2) '\n      'running all fuzzers; (3) building '\n      'fuzzers with coverge; (4) extracting '\n      'coverage; (5) building fuzzers using '\n      'introspector')\n  introspector_parser.add_argument('project', help='name of the project')\n  introspector_parser.add_argument('--seconds',\n                                   help='number of seconds to run fuzzers',\n                                   default=10)\n  introspector_parser.add_argument('source_path',\n                                   help='path of local source',\n                                   nargs='?')\n  introspector_parser.add_argument(\n      '--public-corpora',\n      help='if specified, will use public corpora for code coverage',\n      default=False,\n      action='store_true')\n  introspector_parser.add_argument(\n      '--private-corpora',\n      help='if specified, will use private corpora',\n      default=False,\n      action='store_true')\n  introspector_parser.add_argument(\n      '--coverage-only',\n      action='store_true',\n      help='if specified, will only collect coverage.')\n\n  download_corpora_parser = subparsers.add_parser(\n      'download_corpora', help='Download all corpora for a project.')\n  download_corpora_parser.add_argument('--fuzz-target',\n                                       nargs='+',\n                                       help='specify name of a fuzz target')\n  download_corpora_parser.add_argument('--public',\n                                       action='store_true',\n                                       help='if set, will download public '\n                                       'corpus using wget')\n  download_corpora_parser.add_argument(\n      'project', help='name of the project or path (external)')\n\n  reproduce_parser = subparsers.add_parser('reproduce',\n                                           help='Reproduce a crash.')\n  reproduce_parser.add_argument('--valgrind',\n                                action='store_true',\n                                help='run with valgrind')\n  reproduce_parser.add_argument('project',\n                                help='name of the project or path (external)')\n  reproduce_parser.add_argument('fuzzer_name', help='name of the fuzzer')\n  reproduce_parser.add_argument('testcase_path', help='path of local testcase')\n  reproduce_parser.add_argument('fuzzer_args',\n                                help='arguments to pass to the fuzzer',\n                                nargs='*')\n  _add_environment_args(reproduce_parser)\n  _add_external_project_args(reproduce_parser)\n  _add_architecture_args(reproduce_parser)\n  _add_base_image_tag_args(reproduce_parser)\n\n  shell_parser = subparsers.add_parser(\n      'shell', help='Run /bin/bash within the builder container.')\n  shell_parser.add_argument('project',\n                            help='name of the project or path (external)')\n  shell_parser.add_argument('source_path',\n                            help='path of local source',\n                            nargs='?')\n  _add_architecture_args(shell_parser)\n  _add_engine_args(shell_parser)\n  _add_sanitizer_args(shell_parser)\n  _add_environment_args(shell_parser)\n  _add_external_project_args(shell_parser)\n  _add_base_image_tag_args(shell_parser)\n\n  run_clusterfuzzlite_parser = subparsers.add_parser(\n      'run_clusterfuzzlite', help='Run ClusterFuzzLite on a project.')\n  _add_sanitizer_args(run_clusterfuzzlite_parser)\n  _add_environment_args(run_clusterfuzzlite_parser)\n  run_clusterfuzzlite_parser.add_argument('project')\n  run_clusterfuzzlite_parser.add_argument('--clean',\n                                          dest='clean',\n                                          action='store_true',\n                                          help='clean existing artifacts.')\n  run_clusterfuzzlite_parser.add_argument(\n      '--no-clean',\n      dest='clean',\n      action='store_false',\n      help='do not clean existing artifacts '\n      '(default).')\n  run_clusterfuzzlite_parser.add_argument('--branch',\n                                          default='master',\n                                          required=True)\n  _add_external_project_args(run_clusterfuzzlite_parser)\n  run_clusterfuzzlite_parser.set_defaults(clean=False)\n\n  subparsers.add_parser('pull_images', help='Pull base images.')\n\n  check_test_parser = subparsers.add_parser(\n      'check-tests', help='Checks run_test.sh for specific project.')\n  check_test_parser.add_argument(\n      'project',\n      type=str,\n      help='The name of the project to check (e.g., \"libpng\").',\n  )\n  check_test_parser.add_argument(\n      '--stop-on-failure',\n      action='store_true',\n      help='If set, will stop integrity checks on first failure.')\n  _add_sanitizer_args(check_test_parser)\n  check_test_parser.add_argument(\n      '--container-output',\n      choices=['silent', 'file', 'stdout'],\n      default='stdout',\n      help='How to handle output from the container. ')\n  check_test_parser.add_argument(\n      '--run-full-cache-replay',\n      action='store_true',\n      help=\n      'If set, will run the full cache replay instead of just checking the script.'\n  )\n  check_test_parser.add_argument(\n      '--integrity-check',\n      action='store_true',\n      help=\n      'Setting `integrity_check` enables a check that validates if the `run_test.sh` modifies '\\\n      'the source control of the project will be performed. That is we want to ensure '\\\n      'e.g. `git diff ./` has the same output before and after `run_tests.sh`. The `run_test.sh` '\\\n      'must not change the underlying project source, and if it does it should reset the changes ' \\\n      'before exiting.'\n  )\n\n  check_replay_parser = subparsers.add_parser(\n      'check-replay',\n      help='Checks if the replay script works for a specific project.')\n  check_replay_parser.add_argument('project',\n                                   help='The name of the project to check.')\n  _add_sanitizer_args(check_replay_parser)\n  check_replay_parser.add_argument(\n      '--integrity-check',\n      action='store_true',\n      help='If set, will test the integrity of the replay script. The integrity check' \\\n            'will run the build a number of times where each time the source code of the ' \\\n            'project is patched with a different patch to validate. The goal is to ensure ' \\\n            'the replay script correctly builds the target source code when code modifications ' \\\n            'are made. The patches will perform three main tasks:\\n' \\\n            '1) A control test to ensure it is working as is.\\n' \\\n            '2) A control test to check that we rebuild when white noise is included.\\n' \\\n            '3) A set of bad patches that should cause the build to fail.')\n\n  return parser\n\n\ndef _check_fuzzer_exists(project, fuzzer_name, args, architecture='x86_64'):\n  \"\"\"Checks if a fuzzer exists.\"\"\"\n  platform = 'linux/arm64' if architecture == 'aarch64' else 'linux/amd64'\n  command = ['docker', 'run', '--rm', '--platform', platform]\n  command.extend(['-v', '%s:/out:z' % project.out])\n  command.append(_get_base_runner_image(args))\n\n  command.extend(['/bin/bash', '-c', 'test -f /out/%s' % fuzzer_name])\n\n  try:\n    subprocess.check_call(command)\n  except subprocess.CalledProcessError:\n    logger.error('%s does not seem to exist. Please run build_fuzzers first.',\n                 fuzzer_name)\n    return False\n\n  return True\n\n\ndef _normalized_name(name):\n  \"\"\"Return normalized name with special chars like slash, colon, etc normalized\n  to hyphen(-). This is important as otherwise these chars break local and cloud\n  storage paths.\"\"\"\n  return SPECIAL_CHARS_REGEX.sub('-', name).strip('-')\n\n\ndef _get_absolute_path(path):\n  \"\"\"Returns absolute path with user expansion.\"\"\"\n  return os.path.abspath(os.path.expanduser(path))\n\n\ndef _add_architecture_args(parser, choices=None):\n  \"\"\"Adds common architecture args.\"\"\"\n  if choices is None:\n    choices = constants.ARCHITECTURES\n  parser.add_argument('--architecture',\n                      default=constants.DEFAULT_ARCHITECTURE,\n                      choices=choices)\n\n\ndef _add_engine_args(parser, choices=None):\n  \"\"\"Adds common engine args.\"\"\"\n  if choices is None:\n    choices = constants.ENGINES\n  parser.add_argument('--engine',\n                      default=constants.DEFAULT_ENGINE,\n                      choices=choices)\n\n\ndef _add_sanitizer_args(parser, choices=None):\n  \"\"\"Adds common sanitizer args.\"\"\"\n  if choices is None:\n    choices = constants.SANITIZERS\n  parser.add_argument('--sanitizer',\n                      default=None,\n                      choices=choices,\n                      help='the default is \"address\"')\n\n\ndef _add_environment_args(parser):\n  \"\"\"Adds common environment args.\"\"\"\n  parser.add_argument('-e',\n                      action='append',\n                      help=\"set environment variable e.g. VAR=value\")\n\n\ndef _add_base_image_tag_args(parser):\n  \"\"\"Adds base image tag arg.\"\"\"\n  parser.add_argument('--base-image-tag',\n                      help='The tag of the base-runner image to use.')\n\n\ndef _env_to_docker_args(env_list):\n  \"\"\"Turns envirnoment variable list into docker arguments.\"\"\"\n  return sum([['-e', v] for v in env_list], [])\n\n\ndef workdir_from_lines(lines, default='/src'):\n  \"\"\"Gets the WORKDIR from the given lines.\"\"\"\n  for line in reversed(lines):  # reversed to get last WORKDIR.\n    match = re.match(WORKDIR_REGEX, line)\n    if match:\n      workdir = match.group(1)\n      workdir = workdir.replace('$SRC', '/src')\n\n      if not os.path.isabs(workdir):\n        workdir = os.path.join('/src', workdir)\n\n      return os.path.normpath(workdir)\n\n  return default\n\n\ndef _workdir_from_dockerfile(project):\n  \"\"\"Parses WORKDIR from the Dockerfile for the given project.\"\"\"\n  with open(project.dockerfile_path) as file_handle:\n    lines = file_handle.readlines()\n\n  return workdir_from_lines(lines, default=os.path.join('/src', project.name))\n\n\ndef prepare_aarch64_emulation():\n  \"\"\"Run some necessary commands to use buildx to build AArch64 targets using\n  QEMU emulation on an x86_64 host.\"\"\"\n  subprocess.check_call(\n      ['docker', 'buildx', 'create', '--name', ARM_BUILDER_NAME])\n  subprocess.check_call(['docker', 'buildx', 'use', ARM_BUILDER_NAME])\n\n\ndef docker_run(run_args, *, print_output=True, architecture='x86_64'):\n  \"\"\"Calls `docker run`.\"\"\"\n  platform = 'linux/arm64' if architecture == 'aarch64' else 'linux/amd64'\n  command = [\n      'docker', 'run', '--privileged', '--shm-size=2g', '--platform', platform\n  ]\n  if os.getenv('OSS_FUZZ_SAVE_CONTAINERS_NAME'):\n    command.append('--name')\n    command.append(os.getenv('OSS_FUZZ_SAVE_CONTAINERS_NAME'))\n  else:\n    command.append('--rm')\n\n  # Support environments with a TTY.\n  if sys.stdin.isatty():\n    command.append('-i')\n\n  command.extend(run_args)\n\n  logger.info('Running: %s.', common_utils.get_command_string(command))\n  stdout = None\n  if not print_output:\n    stdout = open(os.devnull, 'w')\n\n  try:\n    subprocess.check_call(command, stdout=stdout, stderr=subprocess.STDOUT)\n  except subprocess.CalledProcessError:\n    return False\n\n  return True\n\n\ndef build_image(args):\n  \"\"\"Builds docker image.\"\"\"\n  if args.pull and args.no_pull:\n    logger.error('Incompatible arguments --pull and --no-pull.')\n    return False\n\n  if args.pull:\n    pull = True\n  elif args.no_pull:\n    pull = False\n  else:\n    y_or_n = raw_input('Pull latest base images (compiler/runtime)? (y/N): ')\n    pull = y_or_n.lower() == 'y'\n\n  if pull:\n    logger.info('Pulling latest base images...')\n  else:\n    logger.info('Using cached base images...')\n\n  # If build_image is called explicitly, don't use cache.\n  if common_utils.build_image_impl(args.project,\n                                   cache=args.cache,\n                                   pull=pull,\n                                   architecture=args.architecture):\n    return True\n\n  return False\n\n\ndef build_fuzzers_impl(  # pylint: disable=too-many-arguments,too-many-locals,too-many-branches\n    project,\n    clean,\n    engine,\n    sanitizer,\n    architecture,\n    env_to_add,\n    source_path,\n    mount_path=None,\n    child_dir='',\n    build_project_image=True):\n  \"\"\"Builds fuzzers.\"\"\"\n  if build_project_image and not common_utils.build_image_impl(\n      project, architecture=architecture):\n    return False\n\n  project_out = os.path.join(project.out, child_dir)\n  if clean:\n    logger.info('Cleaning existing build artifacts.')\n\n    # Clean old and possibly conflicting artifacts in project's out directory.\n    docker_run([\n        '-v', f'{project_out}:/out', '-t', f'gcr.io/oss-fuzz/{project.name}',\n        '/bin/bash', '-c', 'rm -rf /out/*'\n    ],\n               architecture=architecture)\n\n    docker_run([\n        '-v',\n        '%s:/work' % project.work, '-t',\n        'gcr.io/oss-fuzz/%s' % project.name, '/bin/bash', '-c', 'rm -rf /work/*'\n    ],\n               architecture=architecture)\n\n  else:\n    logger.info('Keeping existing build artifacts as-is (if any).')\n  env = [\n      'FUZZING_ENGINE=' + engine,\n      'SANITIZER=' + sanitizer,\n      'ARCHITECTURE=' + architecture,\n      'PROJECT_NAME=' + project.name,\n      'HELPER=True',\n  ]\n\n  _add_oss_fuzz_ci_if_needed(env)\n\n  if project.language:\n    env.append('FUZZING_LANGUAGE=' + project.language)\n\n  if env_to_add:\n    env += env_to_add\n\n  command = _env_to_docker_args(env)\n  if source_path:\n    workdir = _workdir_from_dockerfile(project)\n    if mount_path:\n      command += [\n          '-v',\n          '%s:%s' % (_get_absolute_path(source_path), mount_path),\n      ]\n    else:\n      if workdir == '/src':\n        logger.error('Cannot use local checkout with \"WORKDIR: /src\".')\n        return False\n\n      command += [\n          '-v',\n          '%s:%s' % (_get_absolute_path(source_path), workdir),\n      ]\n\n  command += [\n      '-v', f'{project_out}:/out', '-v', f'{project.work}:/work',\n      f'gcr.io/oss-fuzz/{project.name}'\n  ]\n  if sys.stdin.isatty():\n    command.insert(-1, '-t')\n\n  result = docker_run(command, architecture=architecture)\n  if not result:\n    logger.error('Building fuzzers failed.')\n    return False\n\n  return True\n\n\ndef run_clusterfuzzlite(args):\n  \"\"\"Runs ClusterFuzzLite on a local repo.\"\"\"\n  if not os.path.exists(CLUSTERFUZZLITE_FILESTORE_DIR):\n    os.mkdir(CLUSTERFUZZLITE_FILESTORE_DIR)\n\n  try:\n    with tempfile.TemporaryDirectory() as workspace:\n\n      if args.external:\n        project_src_path = os.path.join(workspace, args.project.name)\n        shutil.copytree(args.project.path, project_src_path)\n\n      build_command = [\n          '--tag', 'gcr.io/oss-fuzz-base/cifuzz-run-fuzzers', '--file',\n          'infra/run_fuzzers.Dockerfile', 'infra'\n      ]\n      if not common_utils.docker_build(build_command):\n        return False\n      filestore_path = os.path.abspath(CLUSTERFUZZLITE_FILESTORE_DIR)\n      docker_run_command = []\n      if args.external:\n        docker_run_command += [\n            '-e',\n            f'PROJECT_SRC_PATH={project_src_path}',\n        ]\n      else:\n        docker_run_command += [\n            '-e',\n            f'OSS_FUZZ_PROJECT_NAME={args.project.name}',\n        ]\n      docker_run_command += [\n          '-v',\n          f'{filestore_path}:{filestore_path}',\n          '-v',\n          f'{workspace}:{workspace}',\n          '-e',\n          f'FILESTORE_ROOT_DIR={filestore_path}',\n          '-e',\n          f'WORKSPACE={workspace}',\n          '-e',\n          f'REPOSITORY={args.project.name}',\n          '-e',\n          'CFL_PLATFORM=standalone',\n          '--entrypoint',\n          '',\n          '-v',\n          '/var/run/docker.sock:/var/run/docker.sock',\n          CLUSTERFUZZLITE_DOCKER_IMAGE,\n          'python3',\n          '/opt/oss-fuzz/infra/cifuzz/cifuzz_combined_entrypoint.py',\n      ]\n      return docker_run(docker_run_command)\n\n  except PermissionError as error:\n    logger.error('PermissionError: %s.', error)\n    # Tempfile can't delete the workspace because of a permissions issue. This\n    # is because docker creates files in the workspace that are owned by root\n    # but this process is probably being run as another user. Use a docker image\n    # to delete the temp directory (workspace) so that we have permission.\n    docker_run([\n        '-v', f'{workspace}:{workspace}', '--entrypoint', '',\n        CLUSTERFUZZLITE_DOCKER_IMAGE, 'rm', '-rf',\n        os.path.join(workspace, '*')\n    ])\n    return False\n\n\ndef build_fuzzers(args):\n  \"\"\"Builds fuzzers.\"\"\"\n  if args.engine == 'centipede' and args.sanitizer != 'none':\n    # Centipede always requires separate binaries for sanitizers:\n    # An unsanitized binary, which Centipede requires for fuzzing.\n    # A sanitized binary, placed in the child directory.\n    sanitized_binary_directories = (\n        ('none', ''),\n        (args.sanitizer, f'__centipede_{args.sanitizer}'),\n    )\n  else:\n    # Generally, a fuzzer only needs one sanitized binary in the default dir.\n    sanitized_binary_directories = ((args.sanitizer, ''),)\n  return all(\n      build_fuzzers_impl(args.project,\n                         args.clean,\n                         args.engine,\n                         sanitizer,\n                         args.architecture,\n                         args.e,\n                         args.source_path,\n                         mount_path=args.mount_path,\n                         child_dir=child_dir)\n      for sanitizer, child_dir in sanitized_binary_directories)\n\n\ndef fuzzbench_build_fuzzers(args):\n  \"\"\"Builds fuzz targets with an arbitrary fuzzer from FuzzBench.\"\"\"\n  with tempfile.TemporaryDirectory() as tmp_dir:\n    tmp_dir = os.path.abspath(tmp_dir)\n    fuzzbench_path = os.path.join(tmp_dir, 'fuzzbench')\n    subprocess.run([\n        'git', 'clone', 'https://github.com/google/fuzzbench', '--depth', '1',\n        fuzzbench_path\n    ],\n                   check=True)\n    env = [\n        f'FUZZBENCH_PATH={fuzzbench_path}', 'OSS_FUZZ_ON_DEMAND=1',\n        f'PROJECT={args.project.name}'\n    ]\n    tag = f'gcr.io/oss-fuzz/{args.project.name}'\n    subprocess.run([\n        'docker', 'tag', 'gcr.io/oss-fuzz-base/base-builder-fuzzbench',\n        'gcr.io/oss-fuzz-base/base-builder'\n    ],\n                   check=True)\n    common_utils.build_image_impl(args.project)\n    assert common_utils.docker_build([\n        '--tag', tag, '--build-arg', f'parent_image={tag}', '--file',\n        os.path.join(fuzzbench_path, 'fuzzers', args.engine,\n                     'builder.Dockerfile'),\n        os.path.join(fuzzbench_path, 'fuzzers', args.engine)\n    ])\n\n    return build_fuzzers_impl(args.project,\n                              False,\n                              args.engine,\n                              args.sanitizer,\n                              args.architecture,\n                              env,\n                              source_path=fuzzbench_path,\n                              mount_path=fuzzbench_path,\n                              build_project_image=False)\n\n\ndef _add_oss_fuzz_ci_if_needed(env):\n  \"\"\"Adds value of |OSS_FUZZ_CI| environment variable to |env| if it is set.\"\"\"\n  oss_fuzz_ci = os.getenv('OSS_FUZZ_CI')\n  if oss_fuzz_ci:\n    env.append('OSS_FUZZ_CI=' + oss_fuzz_ci)\n\n\ndef check_build(args):\n  \"\"\"Checks that fuzzers in the container execute without errors.\"\"\"\n  # Access the property to trigger validation early.\n  _ = args.project.base_os_version\n  if not common_utils.check_project_exists(args.project):\n    return False\n\n  if (args.fuzzer_name and not _check_fuzzer_exists(\n      args.project, args.fuzzer_name, args, args.architecture)):\n    return False\n\n  env = [\n      'FUZZING_ENGINE=' + args.engine,\n      'SANITIZER=' + args.sanitizer,\n      'ARCHITECTURE=' + args.architecture,\n      'FUZZING_LANGUAGE=' + args.project.language,\n      'HELPER=True',\n  ]\n  _add_oss_fuzz_ci_if_needed(env)\n  if args.e:\n    env += args.e\n\n  run_args = _env_to_docker_args(env) + [\n      '-v', f'{args.project.out}:/out', '-t',\n      _get_base_runner_image(args)\n  ]\n\n  if args.fuzzer_name:\n    run_args += ['test_one.py', args.fuzzer_name]\n  else:\n    run_args.append('test_all.py')\n\n  result = docker_run(run_args, architecture=args.architecture)\n  if result:\n    logger.info('Check build passed.')\n  else:\n    logger.error('Check build failed.')\n\n  return result\n\n\ndef _get_fuzz_targets(project):\n  \"\"\"Returns names of fuzz targest build in the project's /out directory.\"\"\"\n  fuzz_targets = []\n  for name in os.listdir(project.out):\n    if name.startswith('afl-'):\n      continue\n    if name == 'centipede':\n      continue\n    if name.startswith('jazzer_'):\n      continue\n    if name == 'llvm-symbolizer':\n      continue\n\n    path = os.path.join(project.out, name)\n    # Python and JVM fuzz targets are only executable for the root user, so\n    # we can't use os.access.\n    if os.path.isfile(path) and (os.stat(path).st_mode & 0o111):\n      fuzz_targets.append(name)\n\n  return fuzz_targets\n\n\ndef _get_latest_corpus(project, fuzz_target, base_corpus_dir):\n  \"\"\"Downloads the latest corpus for the given fuzz target.\"\"\"\n  corpus_dir = os.path.join(base_corpus_dir, fuzz_target)\n  os.makedirs(corpus_dir, exist_ok=True)\n\n  if not fuzz_target.startswith(project.name + '_'):\n    fuzz_target = '%s_%s' % (project.name, fuzz_target)\n\n  # Normalise fuzz target name.\n  fuzz_target = _normalized_name(fuzz_target)\n\n  corpus_backup_url = CORPUS_BACKUP_URL_FORMAT.format(project_name=project.name,\n                                                      fuzz_target=fuzz_target)\n  command = ['gsutil', 'ls', corpus_backup_url]\n\n  # Don't capture stderr. We want it to print in real time, in case gsutil is\n  # asking for two-factor authentication.\n  corpus_listing = subprocess.Popen(command, stdout=subprocess.PIPE)\n  output, _ = corpus_listing.communicate()\n\n  # Some fuzz targets (e.g. new ones) may not have corpus yet, just skip those.\n  if corpus_listing.returncode:\n    logger.warning('Corpus for %s not found:\\n', fuzz_target)\n    return\n\n  if output:\n    latest_backup_url = output.splitlines()[-1]\n    archive_path = corpus_dir + '.zip'\n    command = ['gsutil', '-q', 'cp', latest_backup_url, archive_path]\n    subprocess.check_call(command)\n\n    command = ['unzip', '-q', '-o', archive_path, '-d', corpus_dir]\n    subprocess.check_call(command)\n    os.remove(archive_path)\n  else:\n    # Sync the working corpus copy if a minimized backup is not available.\n    corpus_url = CORPUS_URL_FORMAT.format(project_name=project.name,\n                                          fuzz_target=fuzz_target)\n    command = ['gsutil', '-m', '-q', 'rsync', '-R', corpus_url, corpus_dir]\n    subprocess.check_call(command)\n\n\ndef _get_latest_public_corpus(args, fuzzer):\n  \"\"\"Downloads the public corpus\"\"\"\n  target_corpus_dir = \"build/corpus/%s\" % args.project.name\n  if not os.path.isdir(target_corpus_dir):\n    os.makedirs(target_corpus_dir)\n\n  target_zip = os.path.join(target_corpus_dir, fuzzer + \".zip\")\n\n  project_qualified_fuzz_target_name = fuzzer\n  qualified_name_prefix = args.project.name + '_'\n  if not fuzzer.startswith(qualified_name_prefix):\n    project_qualified_fuzz_target_name = qualified_name_prefix + fuzzer\n\n  download_url = HTTPS_CORPUS_BACKUP_URL_FORMAT.format(\n      project_name=args.project.name,\n      fuzz_target=project_qualified_fuzz_target_name)\n\n  cmd = ['wget', download_url, '-O', target_zip]\n  try:\n    with open(os.devnull, 'w') as stdout:\n      subprocess.check_call(cmd, stdout=stdout)\n  except OSError:\n    logger.error('Failed to download corpus')\n\n  target_fuzzer_dir = os.path.join(target_corpus_dir, fuzzer)\n  if not os.path.isdir(target_fuzzer_dir):\n    os.mkdir(target_fuzzer_dir)\n\n  target_corpus_dir = os.path.join(target_corpus_dir, fuzzer)\n  try:\n    with open(os.devnull, 'w') as stdout:\n      subprocess.check_call(\n          ['unzip', '-q', '-o', target_zip, '-d', target_fuzzer_dir],\n          stdout=stdout)\n  except OSError:\n    logger.error('Failed to unzip corpus')\n\n  # Remove the downloaded zip\n  os.remove(target_zip)\n  return True\n\n\ndef download_corpora(args):\n  \"\"\"Downloads most recent corpora from GCS for the given project.\"\"\"\n  if not common_utils.check_project_exists(args.project):\n    return False\n\n  if args.public:\n    logger.info(\"Downloading public corpus\")\n    try:\n      with open(os.devnull, 'w') as stdout:\n        subprocess.check_call(['wget', '--version'], stdout=stdout)\n    except OSError:\n      logger.error('wget not found')\n      return False\n  else:\n    try:\n      with open(os.devnull, 'w') as stdout:\n        subprocess.check_call(['gsutil', '--version'], stdout=stdout)\n    except OSError:\n      logger.error('gsutil not found. Please install it from '\n                   'https://cloud.google.com/storage/docs/gsutil_install')\n      return False\n\n  if args.fuzz_target:\n    fuzz_targets = args.fuzz_target\n  else:\n    fuzz_targets = _get_fuzz_targets(args.project)\n\n  if not fuzz_targets:\n    logger.error(\n        'Fuzz targets not found. Please build project first '\n        '(python3 infra/helper.py build_fuzzers %s) so that download_corpora '\n        'can automatically identify targets.', args.project.name)\n    return False\n\n  corpus_dir = args.project.corpus\n\n  def _download_for_single_target(fuzz_target):\n    try:\n      if args.public:\n        _get_latest_public_corpus(args, fuzz_target)\n      else:\n        _get_latest_corpus(args.project, fuzz_target, corpus_dir)\n      return True\n    except Exception as error:  # pylint:disable=broad-except\n      logger.error('Corpus download for %s failed: %s.', fuzz_target,\n                   str(error))\n      return False\n\n  logger.info('Downloading corpora for %s project to %s.', args.project.name,\n              corpus_dir)\n  thread_pool = ThreadPool()\n  return all(thread_pool.map(_download_for_single_target, fuzz_targets))\n\n\ndef coverage(args):  # pylint: disable=too-many-branches\n  \"\"\"Generates code coverage using clang source based code coverage.\"\"\"\n  if args.corpus_dir and not args.fuzz_target:\n    logger.error(\n        '--corpus-dir requires specifying a particular fuzz target using '\n        '--fuzz-target')\n    return False\n\n  if not common_utils.check_project_exists(args.project):\n    return False\n\n  if args.project.language not in constants.LANGUAGES_WITH_COVERAGE_SUPPORT:\n    logger.error(\n        'Project is written in %s, coverage for it is not supported yet.',\n        args.project.language)\n    return False\n\n  if (not args.no_corpus_download and not args.corpus_dir and\n      not args.project.is_external):\n    if not download_corpora(args):\n      return False\n\n  extra_cov_args = (\n      f'{args.project.coverage_extra_args.strip()} {\" \".join(args.extra_args)}')\n  env = [\n      'FUZZING_ENGINE=libfuzzer',\n      'HELPER=True',\n      'FUZZING_LANGUAGE=%s' % args.project.language,\n      'PROJECT=%s' % args.project.name,\n      'SANITIZER=coverage',\n      'COVERAGE_EXTRA_ARGS=%s' % extra_cov_args,\n      'ARCHITECTURE=' + args.architecture,\n  ]\n\n  if not args.no_serve:\n    env.append(f'HTTP_PORT={args.port}')\n\n  run_args = _env_to_docker_args(env)\n\n  if args.port:\n    run_args.extend([\n        '-p',\n        '%s:%s' % (args.port, args.port),\n    ])\n\n  if args.corpus_dir:\n    if not os.path.exists(args.corpus_dir):\n      logger.error('The path provided in --corpus-dir argument does not '\n                   'exist.')\n      return False\n    corpus_dir = os.path.realpath(args.corpus_dir)\n    run_args.extend(['-v', '%s:/corpus/%s' % (corpus_dir, args.fuzz_target)])\n  else:\n    run_args.extend(['-v', '%s:/corpus' % args.project.corpus])\n\n  run_args.extend([\n      '-v',\n      '%s:/out' % args.project.out,\n      '-t',\n      _get_base_runner_image(args),\n  ])\n\n  run_args.append('coverage')\n  if args.fuzz_target:\n    run_args.append(args.fuzz_target)\n\n  result = docker_run(run_args, architecture=args.architecture)\n  if result:\n    logger.info('Successfully generated clang code coverage report.')\n  else:\n    logger.error('Failed to generate clang code coverage report.')\n\n  return result\n\n\ndef _introspector_prepare_corpus(args):\n  \"\"\"Helper function for introspector runs to generate corpora.\"\"\"\n  parser = get_parser()\n  # Generate corpus, either by downloading or running fuzzers.\n  if args.private_corpora or args.public_corpora:\n    corpora_command = ['download_corpora']\n    if args.public_corpora:\n      corpora_command.append('--public')\n    corpora_command.append(args.project.name)\n    if not download_corpora(parse_args(parser, corpora_command)):\n      logger.error('Failed to download corpora')\n      return False\n  else:\n    fuzzer_targets = _get_fuzz_targets(args.project)\n    for fuzzer_name in fuzzer_targets:\n      # Make a corpus directory.\n      fuzzer_corpus_dir = args.project.corpus + f'/{fuzzer_name}'\n      if not os.path.isdir(fuzzer_corpus_dir):\n        os.makedirs(fuzzer_corpus_dir)\n      run_fuzzer_command = [\n          'run_fuzzer', '--sanitizer', 'address', '--corpus-dir',\n          fuzzer_corpus_dir, args.project.name, fuzzer_name\n      ]\n\n      parsed_args = parse_args(parser, run_fuzzer_command)\n      parsed_args.fuzzer_args = [\n          f'-max_total_time={args.seconds}', '-detect_leaks=0'\n      ]\n      # Continue even if run command fails, because we do not have 100%\n      # accuracy in fuzz target detection, i.e. we might try to run something\n      # that is not a target.\n      run_fuzzer(parsed_args)\n  return True\n\n\ndef introspector(args):\n  \"\"\"Runs a complete end-to-end run of introspector.\"\"\"\n  parser = get_parser()\n\n  args_to_append = []\n  if args.source_path:\n    args_to_append.append(_get_absolute_path(args.source_path))\n\n  # Build fuzzers with ASAN.\n  build_fuzzers_command = [\n      'build_fuzzers', '--sanitizer=address', args.project.name\n  ] + args_to_append\n  if not build_fuzzers(parse_args(parser, build_fuzzers_command)):\n    logger.error('Failed to build project with ASAN')\n    return False\n\n  if not _introspector_prepare_corpus(args):\n    return False\n\n  # Build code coverage.\n  build_fuzzers_command = [\n      'build_fuzzers', '--sanitizer=coverage', args.project.name\n  ] + args_to_append\n  if not build_fuzzers(parse_args(parser, build_fuzzers_command)):\n    logger.error('Failed to build project with coverage instrumentation')\n    return False\n\n  # Collect coverage.\n  coverage_command = [\n      'coverage', '--no-corpus-download', '--port', '', args.project.name\n  ]\n  if not coverage(parse_args(parser, coverage_command)):\n    logger.error('Failed to extract coverage')\n    return False\n\n  logger.info('Coverage collected for %s', args.project.name)\n  if args.coverage_only:\n    logger.info('Coverage-only enabled, finishing now.')\n    return True\n\n  # Build introspector.\n  build_fuzzers_command = [\n      'build_fuzzers', '--sanitizer=introspector', args.project.name\n  ] + args_to_append\n  if not build_fuzzers(parse_args(parser, build_fuzzers_command)):\n    logger.error('Failed to build project with introspector')\n    return False\n\n  introspector_dst = os.path.join(args.project.out,\n                                  \"introspector-report/inspector\")\n  shutil.rmtree(introspector_dst, ignore_errors=True)\n  shutil.copytree(os.path.join(args.project.out, \"inspector\"), introspector_dst)\n\n  # Copy the coverage reports into the introspector report.\n  dst_cov_report = os.path.join(introspector_dst, \"covreport\")\n  shutil.copytree(os.path.join(args.project.out, \"report\"), dst_cov_report)\n\n  # Copy per-target coverage reports\n  src_target_cov_report = os.path.join(args.project.out, \"report_target\")\n  for target_cov_dir in os.listdir(src_target_cov_report):\n    dst_target_cov_report = os.path.join(dst_cov_report, target_cov_dir)\n    shutil.copytree(os.path.join(src_target_cov_report, target_cov_dir),\n                    dst_target_cov_report)\n\n  logger.info('Introspector run complete. Report in %s', introspector_dst)\n  logger.info(\n      'To browse the report, run: `python3 -m http.server 8008 --directory %s`'\n      'and navigate to localhost:8008/fuzz_report.html in your browser',\n      introspector_dst)\n  return True\n\n\ndef run_fuzzer(args):\n  \"\"\"Runs a fuzzer in the container.\"\"\"\n  if not common_utils.check_project_exists(args.project):\n    return False\n\n  if not _check_fuzzer_exists(args.project, args.fuzzer_name, args,\n                              args.architecture):\n    return False\n\n  env = [\n      'FUZZING_ENGINE=' + args.engine,\n      'SANITIZER=' + args.sanitizer,\n      'RUN_FUZZER_MODE=interactive',\n      'HELPER=True',\n  ]\n\n  if args.e:\n    env += args.e\n\n  run_args = _env_to_docker_args(env)\n\n  if args.corpus_dir:\n    if not os.path.exists(args.corpus_dir):\n      logger.error('The path provided in --corpus-dir argument does not exist')\n      return False\n    corpus_dir = os.path.realpath(args.corpus_dir)\n    run_args.extend([\n        '-v',\n        '{corpus_dir}:/tmp/{fuzzer}_corpus'.format(corpus_dir=corpus_dir,\n                                                   fuzzer=args.fuzzer_name)\n    ])\n\n  run_args.extend([\n      '-v',\n      '%s:/out' % args.project.out,\n      '-t',\n      _get_base_runner_image(args),\n      'run_fuzzer',\n      args.fuzzer_name,\n  ] + args.fuzzer_args)\n\n  return docker_run(run_args, architecture=args.architecture)\n\n\ndef fuzzbench_run_fuzzer(args):\n  \"\"\"Runs a fuzz target built by fuzzbench in the container.\"\"\"\n  if not common_utils.check_project_exists(args.project):\n    return False\n\n  env = [\n      'FUZZING_ENGINE=' + args.engine,\n      'SANITIZER=' + args.sanitizer,\n      'RUN_FUZZER_MODE=interactive',\n      'HELPER=True',\n      f'FUZZ_TARGET={args.fuzzer_name}',\n      f'BENCHMARK={args.project.name}',\n      'TRIAL_ID=1',\n      'EXPERIMENT_TYPE=bug',\n  ]\n\n  if args.e:\n    env += args.e\n\n  run_args = _env_to_docker_args(env)\n\n  if args.corpus_dir:\n    if not os.path.exists(args.corpus_dir):\n      logger.error('The path provided in --corpus-dir argument does not exist')\n      return False\n    corpus_dir = os.path.realpath(args.corpus_dir)\n    run_args.extend([\n        '-v',\n        '{corpus_dir}:/tmp/{fuzzer}_corpus'.format(corpus_dir=corpus_dir,\n                                                   fuzzer=args.fuzzer_name)\n    ])\n\n  with tempfile.TemporaryDirectory() as tmp_dir:\n    tmp_dir = os.path.abspath(tmp_dir)\n    fuzzbench_path = os.path.join(tmp_dir, 'fuzzbench')\n    subprocess.run([\n        'git', 'clone', 'https://github.com/google/fuzzbench', '--depth', '1',\n        fuzzbench_path\n    ],\n                   check=True)\n    run_args.extend([\n        '-v',\n        f'{args.project.out}:/out',\n        '-v',\n        f'{fuzzbench_path}:{fuzzbench_path}',\n        '-e',\n        f'FUZZBENCH_PATH={fuzzbench_path}',\n        f'gcr.io/oss-fuzz/{args.project.name}',\n        'fuzzbench_run_fuzzer',\n        args.fuzzer_name,\n    ] + args.fuzzer_args)\n\n    return docker_run(run_args, architecture=args.architecture)\n\n\ndef fuzzbench_measure(args):\n  \"\"\"Measure results from fuzzing with fuzzbench.\"\"\"\n  if not common_utils.check_project_exists(args.project):\n    return False\n\n  with tempfile.TemporaryDirectory() as tmp_dir:\n    tmp_dir = os.path.abspath(tmp_dir)\n    fuzzbench_path = os.path.join(tmp_dir, 'fuzzbench')\n    subprocess.run([\n        'git', 'clone', 'https://github.com/google/fuzzbench', '--depth', '1',\n        fuzzbench_path\n    ],\n                   check=True)\n    run_args = [\n        '-v', f'{args.project.out}:/out', '-v',\n        f'{fuzzbench_path}:{fuzzbench_path}', '-e',\n        f'FUZZBENCH_PATH={fuzzbench_path}', '-e', 'EXPERIMENT_TYPE=bug', '-e',\n        f'FUZZ_TARGET={args.fuzz_target_name}', '-e',\n        f'FUZZER={args.engine_name}', '-e', f'BENCHMARK={args.project.name}',\n        f'gcr.io/oss-fuzz/{args.project.name}', 'fuzzbench_measure'\n    ]\n\n    return docker_run(run_args, architecture='x86_64')\n\n\ndef reproduce(args):\n  \"\"\"Reproduces a specific test case from a specific project.\"\"\"\n  return reproduce_impl(args.project, args.fuzzer_name, args.valgrind, args.e,\n                        args.fuzzer_args, args.testcase_path, args,\n                        args.architecture)\n\n\ndef reproduce_impl(  # pylint: disable=too-many-arguments\n    project,\n    fuzzer_name,\n    valgrind,\n    env_to_add,\n    fuzzer_args,\n    testcase_path,\n    args,\n    architecture='x86_64',\n    run_function=docker_run):\n  \"\"\"Reproduces a specific test case.\"\"\"\n\n  if not common_utils.check_project_exists(project):\n    return False\n\n  if not _check_fuzzer_exists(project, fuzzer_name, args, architecture):\n    return False\n\n  debugger = ''\n  env = ['HELPER=True', 'ARCHITECTURE=' + architecture]\n  use_debug_image = bool(valgrind)\n  image_name = _get_base_runner_image(args, debug=use_debug_image)\n\n  if valgrind:\n    debugger = 'valgrind --tool=memcheck --track-origins=yes --leak-check=full'\n\n  if debugger:\n    env += ['DEBUGGER=' + debugger]\n\n  if env_to_add:\n    env.extend(env_to_add)\n\n  run_args = _env_to_docker_args(env) + [\n      '-v',\n      '%s:/out' % project.out,\n      '-v',\n      '%s:/testcase' % _get_absolute_path(testcase_path),\n      '-t',\n      image_name,\n      'reproduce',\n      fuzzer_name,\n      '-runs=100',\n  ] + fuzzer_args\n\n  return run_function(run_args, architecture=architecture)\n\n\ndef _validate_project_name(project_name):\n  \"\"\"Validates |project_name| is a valid OSS-Fuzz project name.\"\"\"\n  if len(project_name) > MAX_PROJECT_NAME_LENGTH:\n    logger.error(\n        'Project name needs to be less than or equal to %d characters.',\n        MAX_PROJECT_NAME_LENGTH)\n    return False\n\n  if not VALID_PROJECT_NAME_REGEX.match(project_name):\n    logger.info('Invalid project name: %s.', project_name)\n    return False\n\n  return True\n\n\ndef _validate_language(language):\n  if not LANGUAGE_REGEX.match(language):\n    logger.error('Invalid project language %s.', language)\n    return False\n\n  return True\n\n\ndef _create_build_integration_directory(directory):\n  \"\"\"Returns True on successful creation of a build integration directory.\n  Suitable for OSS-Fuzz and external projects.\"\"\"\n  try:\n    os.makedirs(directory)\n  except OSError as error:\n    if error.errno != errno.EEXIST:\n      raise\n    logger.error('%s already exists.', directory)\n    return False\n  return True\n\n\ndef _template_project_file(filename, template, template_args, directory):\n  \"\"\"Templates |template| using |template_args| and writes the result to\n  |directory|/|filename|. Sets the file to executable if |filename| is\n  build.sh.\"\"\"\n  file_path = os.path.join(directory, filename)\n  with open(file_path, 'w') as file_handle:\n    file_handle.write(template % template_args)\n\n  if filename == 'build.sh':\n    os.chmod(file_path, 0o755)\n\n\ndef generate(args):\n  \"\"\"Generates empty project files.\"\"\"\n  return _generate_impl(args.project, args.language)\n\n\ndef _get_current_datetime():\n  \"\"\"Returns this year. Needed for mocking.\"\"\"\n  return datetime.datetime.now()\n\n\ndef _base_builder_from_language(language):\n  \"\"\"Returns the base builder for the specified language.\"\"\"\n  return LANGUAGE_TO_BASE_BUILDER_IMAGE[language]\n\n\ndef _generate_impl(project, language):\n  \"\"\"Implementation of generate(). Useful for testing.\"\"\"\n  if project.is_external:\n    # External project.\n    project_templates = templates.EXTERNAL_TEMPLATES\n  else:\n    # Internal project.\n    if not _validate_project_name(project.name):\n      return False\n    project_templates = templates.TEMPLATES\n\n  if not _validate_language(language):\n    return False\n\n  directory = project.build_integration_path\n  if not _create_build_integration_directory(directory):\n    return False\n\n  logger.info('Writing new files to: %s.', directory)\n\n  template_args = {\n      'project_name': project.name,\n      'base_builder': _base_builder_from_language(language),\n      'language': language,\n      'year': _get_current_datetime().year\n  }\n  for filename, template in project_templates.items():\n    _template_project_file(filename, template, template_args, directory)\n  return True\n\n\ndef index(args):\n  \"\"\"Runs the indexer on the project.\"\"\"\n  if not args.project.is_external and not common_utils.check_project_exists(\n      args.project):\n    return False\n\n  image_name = f'gcr.io/oss-fuzz/{args.project.name}'\n  if not common_utils.build_image_impl(\n      args.project, cache=True, pull=False, architecture=args.architecture):\n    logger.error('Failed to build project image for indexer.')\n    return False\n  env = [\n      f'ARCHITECTURE={args.architecture}',\n      'HELPER=True',\n      f'PROJECT_NAME={args.project.name}',\n      'INDEXER_BUILD=1',\n  ]\n  if args.e:\n    env.extend(args.e)\n\n  run_args = _env_to_docker_args(env)\n  run_args.extend([\n      '-v',\n      f'{args.project.out}:/out',\n      '-v',\n      f'{args.project.work}:/work',\n      '-t',\n  ])\n\n  if args.docker_arg:\n    run_args.extend(args.docker_arg)\n\n  if args.dev:\n    indexer_dir = os.path.join(os.path.dirname(__file__), 'base-images',\n                               'base-builder', 'indexer')\n    indexer_binary_path = os.path.join(indexer_dir, 'indexer')\n    if not os.path.exists(indexer_binary_path):\n      print('Indexer binary does not exist, pulling prebuilt.')\n      with urllib.request.urlopen(INDEXER_PREBUILT_URL) as resp, \\\n          open(indexer_binary_path, 'wb') as f:\n        shutil.copyfileobj(resp, f)\n        os.chmod(indexer_binary_path, 0o755)\n\n    run_args.extend(['-v', f'{indexer_dir}:/opt/indexer'])\n\n  run_args.append(image_name)\n  if args.shell:\n    run_args.append('/bin/bash')\n  else:\n    run_args.append('/opt/indexer/index_build.py')\n\n  if args.targets:\n    run_args.extend(['--targets', args.targets])\n\n  run_args.extend(args.extra_args)\n\n  logger.info(f'Running indexer for project: {args.project.name}')\n  result = docker_run(run_args, architecture=args.architecture)\n  if result:\n    logger.info('Indexer completed successfully.')\n  else:\n    logger.error('Indexer failed.')\n\n  return result\n\n\ndef shell(args):\n  \"\"\"Runs a shell within a docker image.\"\"\"\n  # Access the property to trigger validation early.\n  _ = args.project.base_os_version\n  if not common_utils.build_image_impl(args.project):\n    return False\n\n  env = [\n      'FUZZING_ENGINE=' + args.engine, 'SANITIZER=' + args.sanitizer,\n      'ARCHITECTURE=' + args.architecture, 'HELPER=True',\n      f'PROJECT_NAME={args.project.name}'\n  ]\n\n  if args.project.name != 'base-runner-debug':\n    env.append('FUZZING_LANGUAGE=' + args.project.language)\n\n  if args.e:\n    env += args.e\n\n  if common_utils.is_base_image(args.project.name):\n    image_project = 'oss-fuzz-base'\n    out_dir = common_utils.get_out_dir()\n  else:\n    image_project = 'oss-fuzz'\n    out_dir = args.project.out\n\n  run_args = _env_to_docker_args(env)\n  if args.source_path:\n    workdir = _workdir_from_dockerfile(args.project)\n    run_args.extend([\n        '-v',\n        '%s:%s' % (_get_absolute_path(args.source_path), workdir),\n    ])\n\n  run_args.extend([\n      '-v',\n      '%s:/out' % out_dir, '-v',\n      '%s:/work' % args.project.work, '-t',\n      'gcr.io/%s/%s' % (image_project, args.project.name), '/bin/bash'\n  ])\n\n  docker_run(run_args, architecture=args.architecture)\n  return True\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/helper_test.py",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests for helper.py\"\"\"\n\nimport datetime\nimport os\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nfrom pyfakefs import fake_filesystem_unittest\n\nimport constants\nimport helper\nimport common_utils\nimport templates\n\n# pylint: disable=no-self-use,protected-access\n\n\nclass ShellTest(unittest.TestCase):\n  \"\"\"Tests 'shell' command.\"\"\"\n\n  @mock.patch('helper.docker_run')\n  @mock.patch('helper.build_image_impl')\n  def test_base_runner_debug(self, _, __):\n    \"\"\"Tests that shell base-runner-debug works as intended.\"\"\"\n    image_name = 'base-runner-debug'\n    unparsed_args = ['shell', image_name]\n    parser = helper.get_parser()\n    args = helper.parse_args(parser, unparsed_args)\n    args.sanitizer = 'address'\n    result = helper.shell(args)\n    self.assertTrue(result)\n\n\nclass BuildImageImplTest(unittest.TestCase):\n  \"\"\"Tests for build_image_impl.\"\"\"\n\n  @mock.patch('common_utils.docker_build')\n  def test_no_cache(self, mock_docker_build):\n    \"\"\"Tests that cache=False is handled properly.\"\"\"\n    image_name = 'base-image'\n    common_utils.build_image_impl(common_utils.Project(image_name), cache=False)\n    self.assertIn('--no-cache', mock_docker_build.call_args_list[0][0][0])\n\n  @mock.patch('common_utils.docker_build')\n  @mock.patch('common_utils.pull_images')\n  def test_pull(self, mock_pull_images, _):\n    \"\"\"Tests that pull=True is handled properly.\"\"\"\n    image_name = 'base-image'\n    project = common_utils.Project(image_name, is_external=True)\n    self.assertTrue(common_utils.build_image_impl(project, pull=True))\n    mock_pull_images.assert_called_with('c++')\n\n  @mock.patch('common_utils.docker_build')\n  def test_base_image(self, mock_docker_build):\n    \"\"\"Tests that build_image_impl works as intended with a base-image.\"\"\"\n    image_name = 'base-image'\n    self.assertTrue(\n        common_utils.build_image_impl(common_utils.Project(image_name)))\n    build_dir = os.path.join(common_utils.OSS_FUZZ_DIR,\n                             'infra/base-images/base-image')\n    mock_docker_build.assert_called_with([\n        '-t', 'gcr.io/oss-fuzz-base/base-image', '--file',\n        os.path.join(build_dir, 'Dockerfile'), build_dir\n    ])\n\n  @mock.patch('common_utils.docker_build')\n  def test_oss_fuzz_project(self, mock_docker_build):\n    \"\"\"Tests that build_image_impl works as intended with an OSS-Fuzz\n    project.\"\"\"\n    project_name = 'example'\n    self.assertTrue(\n        common_utils.build_image_impl(common_utils.Project(project_name)))\n    build_dir = os.path.join(common_utils.OSS_FUZZ_DIR, 'projects',\n                             project_name)\n    mock_docker_build.assert_called_with([\n        '-t', 'gcr.io/oss-fuzz/example', '--file',\n        os.path.join(build_dir, 'Dockerfile'), build_dir\n    ])\n\n  @mock.patch('common_utils.docker_build')\n  def test_external_project(self, mock_docker_build):\n    \"\"\"Tests that build_image_impl works as intended with a non-OSS-Fuzz\n    project.\"\"\"\n    with tempfile.TemporaryDirectory() as temp_dir:\n      project_src_path = os.path.join(temp_dir, 'example')\n      os.mkdir(project_src_path)\n      build_integration_path = 'build-integration'\n      project = common_utils.Project(\n          project_src_path,\n          is_external=True,\n          build_integration_path=build_integration_path)\n      self.assertTrue(common_utils.build_image_impl(project))\n      mock_docker_build.assert_called_with([\n          '-t', 'gcr.io/oss-fuzz/example', '--file',\n          os.path.join(project_src_path, build_integration_path, 'Dockerfile'),\n          project_src_path\n      ])\n\n\nclass GenerateImplTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests for _generate_impl.\"\"\"\n  PROJECT_NAME = 'newfakeproject'\n  PROJECT_LANGUAGE = 'python'\n\n  def setUp(self):\n    self.maxDiff = None  # pylint: disable=invalid-name\n    self.setUpPyfakefs()\n    self.fs.add_real_directory(helper.OSS_FUZZ_DIR)\n\n  def _verify_templated_files(self, template_dict, directory, language):\n    template_args = {\n        'project_name': self.PROJECT_NAME,\n        'year': 2021,\n        'base_builder': helper._base_builder_from_language(language),\n        'language': language,\n    }\n    for filename, template in template_dict.items():\n      file_path = os.path.join(directory, filename)\n      with open(file_path, 'r') as file_handle:\n        contents = file_handle.read()\n      self.assertEqual(contents, template % template_args)\n\n  @mock.patch('helper._get_current_datetime',\n              return_value=datetime.datetime(year=2021, month=1, day=1))\n  def test_generate_oss_fuzz_project(self, _):\n    \"\"\"Tests that the correct files are generated for an OSS-Fuzz project.\"\"\"\n    helper._generate_impl(helper.Project(self.PROJECT_NAME),\n                          self.PROJECT_LANGUAGE)\n    self._verify_templated_files(\n        templates.TEMPLATES,\n        os.path.join(helper.OSS_FUZZ_DIR, 'projects', self.PROJECT_NAME),\n        self.PROJECT_LANGUAGE)\n\n  def test_generate_external_project(self):\n    \"\"\"Tests that the correct files are generated for a non-OSS-Fuzz project.\"\"\"\n    build_integration_path = '/newfakeproject/build-integration'\n    helper._generate_impl(\n        helper.Project('/newfakeproject/',\n                       is_external=True,\n                       build_integration_path=build_integration_path),\n        self.PROJECT_LANGUAGE)\n    self._verify_templated_files(templates.EXTERNAL_TEMPLATES,\n                                 build_integration_path, self.PROJECT_LANGUAGE)\n\n  @mock.patch('helper._get_current_datetime',\n              return_value=datetime.datetime(year=2021, month=1, day=1))\n  def test_generate_swift_project(self, _):\n    \"\"\"Tests that the swift project uses the correct base image.\"\"\"\n    helper._generate_impl(helper.Project(self.PROJECT_NAME), 'swift')\n    self._verify_templated_files(\n        templates.TEMPLATES,\n        os.path.join(helper.OSS_FUZZ_DIR, 'projects', self.PROJECT_NAME),\n        'swift')\n\n\nclass ProjectTest(fake_filesystem_unittest.TestCase):\n  \"\"\"Tests for Project class.\"\"\"\n\n  def setUp(self):\n    self.project_name = 'project'\n    self.internal_project = helper.Project(self.project_name)\n    self.external_project_path = os.path.join('/path', 'to', self.project_name)\n    self.external_project = helper.Project(self.external_project_path,\n                                           is_external=True)\n    self.setUpPyfakefs()\n\n  def test_init_external_project(self):\n    \"\"\"Tests __init__ method for external projects.\"\"\"\n    self.assertEqual(self.external_project.name, self.project_name)\n    self.assertEqual(self.external_project.path, self.external_project_path)\n    self.assertEqual(\n        self.external_project.build_integration_path,\n        os.path.join(self.external_project_path,\n                     constants.DEFAULT_EXTERNAL_BUILD_INTEGRATION_PATH))\n\n  def test_init_internal_project(self):\n    \"\"\"Tests __init__ method for internal projects.\"\"\"\n    self.assertEqual(self.internal_project.name, self.project_name)\n    path = os.path.join(helper.OSS_FUZZ_DIR, 'projects', self.project_name)\n    self.assertEqual(self.internal_project.path, path)\n    self.assertEqual(self.internal_project.build_integration_path, path)\n\n  def test_dockerfile_path_internal_project(self):\n    \"\"\"Tests that dockerfile_path works as intended.\"\"\"\n    self.assertEqual(\n        self.internal_project.dockerfile_path,\n        os.path.join(helper.OSS_FUZZ_DIR, 'projects', self.project_name,\n                     'Dockerfile'))\n\n  def test_dockerfile_path_external_project(self):\n    \"\"\"Tests that dockerfile_path works as intended.\"\"\"\n    self.assertEqual(\n        self.external_project.dockerfile_path,\n        os.path.join(self.external_project_path,\n                     constants.DEFAULT_EXTERNAL_BUILD_INTEGRATION_PATH,\n                     'Dockerfile'))\n\n  def test_out(self):\n    \"\"\"Tests that out works as intended.\"\"\"\n    out_dir = self.internal_project.out\n    self.assertEqual(\n        out_dir,\n        os.path.join(helper.OSS_FUZZ_DIR, 'build', 'out', self.project_name))\n    self.assertTrue(os.path.exists(out_dir))\n\n  def test_work(self):\n    \"\"\"Tests that work works as intended.\"\"\"\n    work_dir = self.internal_project.work\n    self.assertEqual(\n        work_dir,\n        os.path.join(helper.OSS_FUZZ_DIR, 'build', 'work', self.project_name))\n    self.assertTrue(os.path.exists(work_dir))\n\n  def test_corpus(self):\n    \"\"\"Tests that corpus works as intended.\"\"\"\n    corpus_dir = self.internal_project.corpus\n    self.assertEqual(\n        corpus_dir,\n        os.path.join(helper.OSS_FUZZ_DIR, 'build', 'corpus', self.project_name))\n    self.assertTrue(os.path.exists(corpus_dir))\n\n  def test_language_internal_project(self):\n    \"\"\"Tests that language works as intended for an internal project.\"\"\"\n    project_yaml_path = os.path.join(self.internal_project.path, 'project.yaml')\n    self.fs.create_file(project_yaml_path, contents='language: python')\n    self.assertEqual(self.internal_project.language, 'python')\n\n  def test_language_external_project(self):\n    \"\"\"Tests that language works as intended for an external project.\"\"\"\n    self.assertEqual(self.external_project.language, 'c++')\n"
  },
  {
    "path": "infra/indexer/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.19)\n\nproject(Indexer LANGUAGES C CXX)\n\nset(CMAKE_CXX_STANDARD 20)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\n\nif(NOT CMAKE_BUILD_TYPE)\n  set(CMAKE_BUILD_TYPE Release)\nendif()\n\nset(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG -stdlib=libc++ -fexperimental-library -fno-rtti\")\nset(CMAKE_EXE_LINKER_FLAGS \"-fuse-ld=lld -lc++\")\n\ninclude(FetchContent)\nFetchContent_Declare(\n    absl\n    URL https://github.com/abseil/abseil-cpp/archive/987c57f325f7fa8472fa84e1f885f7534d391b0d.zip\n    # https://github.com/abseil/abseil-cpp/releases/tag/20250814.0\n)\nFetchContent_MakeAvailable(absl)\n\n# Force static linking of libraries.\nset(CMAKE_FIND_LIBRARY_SUFFIXES \".a\")\n\n# LLVM / Clang\nfind_package(LLVM REQUIRED CONFIG COMPONENTS\n    LLVMSupport\n)\n\nfind_package(Clang REQUIRED CONFIG COMPONENTS\n    clang-cpp\n    clangTooling\n    clangFrontend\n    clangAST\n    clangBasic\n    clangLex\n    clangSema\n)\nmessage(STATUS \"Found LLVM: ${LLVM_PACKAGE_VERSION}\")\nmessage(STATUS \"Using LLVM include directories: ${LLVM_INCLUDE_DIRS}\")\nmessage(STATUS \"Using LLVM library directories: ${LLVM_LIBRARY_DIRS}\")\ninclude_directories(SYSTEM ${LLVM_INCLUDE_DIRS})\n\n# SQLite\nfind_package(SQLite3 REQUIRED)\n\n# GoogleTest (for unittests)\nFetchContent_Declare(\n  googletest\n  URL https://github.com/google/googletest/archive/6910c9d9165801d8827d628cb72eb7ea9dd538c5.zip\n)\n# For Windows: Prevent overriding the parent project's compiler/linker settings\nset(gtest_force_shared_crt ON CACHE BOOL \"\" FORCE)\nFetchContent_MakeAvailable(googletest)\n\nadd_library(index\n    index/file_copier.cc\n    index/in_memory_index.cc\n    index/sqlite.cc\n    index/types.cc\n    index/in_memory_index.h\n    index/sqlite.h\n    index/types.h\n)\ntarget_include_directories(index PUBLIC\n    ${CMAKE_CURRENT_SOURCE_DIR}/..\n)\ntarget_link_libraries(index PUBLIC\n    absl::flat_hash_map\n    absl::log\n    absl::check\n    absl::strings\n    absl::span\n    SQLite::SQLite3\n)\n\nadd_library(merge_queue\n    merge_queue.cc\n    queue_state.cc\n    merge_queue.h\n    queue_state.h\n)\ntarget_link_libraries(merge_queue PUBLIC\n    absl::base\n    absl::log\n    absl::strings\n    absl::synchronization\n    index\n)\ntarget_include_directories(merge_queue PUBLIC\n    ${CMAKE_CURRENT_SOURCE_DIR}/..\n)\nadd_library(frontend\n    frontend/ast_visitor.cc\n    frontend/common.cc\n    frontend/frontend.cc\n    frontend/index_action.cc\n    frontend/pp_callbacks.cc\n    frontend/ast_visitor.h\n    frontend/common.h\n    frontend/frontend.h\n    frontend/index_action.h\n    frontend/pp_callbacks.h\n)\ntarget_include_directories(frontend PUBLIC\n    ${CMAKE_CURRENT_SOURCE_DIR}/..\n)\ntarget_link_libraries(frontend PUBLIC\n    absl::flags\n    absl::log\n    absl::check\n    absl::strings\n    LLVMSupport\n    clangAST\n    clangBasic\n    clangFrontend\n    clangLex\n    clangSema\n    clangTooling\n    index\n    merge_queue\n)\ntarget_include_directories(frontend INTERFACE SYSTEM ${LLVM_INCLUDE_DIRS})\n\nadd_executable(indexer main.cc)\ntarget_link_libraries(indexer PRIVATE\n    absl::flags\n    absl::flags_parse\n    absl::log\n    absl::log_initialize\n    absl::check\n    absl::string_view\n    LLVMSupport\n    clangTooling\n    frontend\n    index\n    merge_queue\n    -static\n)\n\nenable_testing()\ninclude(GoogleTest)\n\nadd_executable(index_unittest\n    index/file_copier_unittest.cc\n    index/in_memory_index_unittest.cc\n    index/types_unittest.cc\n)\ntarget_link_libraries(index_unittest PRIVATE\n    GTest::gmock_main\n    absl::hash\n    absl::strings\n    index\n)\ngtest_discover_tests(index_unittest)\n\nadd_executable(frontend_test\n    frontend/frontend_test.cc\n)\ntarget_link_libraries(frontend_test PRIVATE\n    frontend\n    index\n    GTest::gmock_main\n)\ngtest_discover_tests(frontend_test)\n"
  },
  {
    "path": "infra/indexer/Dockerfile",
    "content": "FROM gcr.io/oss-fuzz-base/base-clang-full\n\nRUN mkdir /indexer\nWORKDIR /indexer\nCOPY . /indexer\n\nRUN apt-get update && apt-get install -y libsqlite3-dev make zlib1g-dev\nRUN mkdir build && cd build && cmake .. && cmake --build . -j -v\n"
  },
  {
    "path": "infra/indexer/frontend/ast_visitor.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/frontend/ast_visitor.h\"\n\n#include <cassert>\n#include <list>\n#include <optional>\n#include <string>\n#include <vector>\n\n#include \"indexer/frontend/common.h\"\n#include \"indexer/index/types.h\"\n#include \"absl/log/check.h\"\n#include \"absl/log/log.h\"\n#include \"absl/strings/str_cat.h\"\n#include \"absl/strings/str_join.h\"\n#include \"clang/AST/Attr.h\"\n#include \"clang/AST/Decl.h\"\n#include \"clang/AST/DeclCXX.h\"\n#include \"clang/AST/DeclTemplate.h\"\n#include \"clang/AST/DeclarationName.h\"\n#include \"clang/AST/Expr.h\"\n#include \"clang/AST/ExprCXX.h\"\n#include \"clang/AST/PrettyPrinter.h\"\n#include \"clang/AST/TemplateBase.h\"\n#include \"clang/AST/Type.h\"\n#include \"clang/Basic/FileEntry.h\"\n#include \"clang/Basic/OperatorKinds.h\"\n#include \"clang/Basic/SourceLocation.h\"\n#include \"clang/Basic/Specifiers.h\"\n#include \"clang/Basic/TypeTraits.h\"\n#include \"clang/Sema/Lookup.h\"\n#include \"clang/Sema/Sema.h\"\n#include \"llvm/ADT/APSInt.h\"\n#include \"llvm/ADT/ArrayRef.h\"\n#include \"llvm/ADT/MapVector.h\"\n#include \"llvm/ADT/SmallPtrSet.h\"\n#include \"llvm/ADT/SmallSet.h\"\n#include \"llvm/ADT/SmallString.h\"\n#include \"llvm/ADT/SmallVector.h\"\n#include \"llvm/ADT/StringRef.h\"\n#include \"llvm/Config/llvm-config.h\"\n#include \"llvm/Support/Casting.h\"\n#include \"llvm/Support/raw_ostream.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace {\n\nconst clang::PrintingPolicy& GetPrintingPolicy() {\n  static clang::PrintingPolicy static_policy = ([] {\n    clang::PrintingPolicy policy({});\n    policy.adjustForCPlusPlus();\n    policy.SplitTemplateClosers = false;\n    policy.SuppressTemplateArgsInCXXConstructors = true;\n    return policy;\n  })();\n  return static_policy;\n}\n\n// Helper functions used to distinguish between declarations and definitions, so\n// that we can mark declarations as incomplete and resolve them at a later\n// stage.\nbool IsADefinition(const clang::Decl* decl) {\n  if (llvm::isa<clang::RecordDecl>(decl)) {\n    const auto* record_decl = llvm::cast<clang::RecordDecl>(decl);\n    if (!record_decl->isThisDeclarationADefinition() &&\n        !llvm::isa<clang::ClassTemplateSpecializationDecl>(decl)) {\n      return false;\n    }\n  } else if (llvm::isa<clang::FunctionDecl>(decl)) {\n    const auto* function_decl = llvm::cast<clang::FunctionDecl>(decl);\n    if (llvm::isa<clang::CXXMethodDecl>(function_decl)) {\n      const auto* cxx_method_decl =\n          llvm::cast<clang::CXXMethodDecl>(function_decl);\n      if (cxx_method_decl->getParent()->isLambda()) {\n        return true;\n      }\n    }\n    if (!function_decl->isThisDeclarationADefinition()) {\n      return false;\n    }\n  }\n  return true;\n}\n\nbool IsParentADefinition(const clang::Decl* decl) {\n  const auto* parent_context = decl->getNonTransparentDeclContext();\n  if (llvm::isa<clang::Decl>(parent_context)) {\n    const auto* parent = llvm::cast<clang::Decl>(parent_context);\n    return IsADefinition(parent);\n  } else {\n    return true;\n  }\n}\n\nconst clang::ClassTemplateDecl* GetClassTemplateDefinition(\n    const clang::ClassTemplateDecl* class_template_decl) {\n  if (class_template_decl->getTemplatedDecl()->getDefinition()) {\n    class_template_decl = class_template_decl->getTemplatedDecl()\n                              ->getDefinition()\n                              ->getDescribedClassTemplate();\n  }\n  return class_template_decl;\n}\n\nconst clang::ClassTemplateSpecializationDecl* FindSpecialization(\n    const clang::ClassTemplateDecl* class_template_decl,\n    const llvm::ArrayRef<clang::TemplateArgument> args,\n    const clang::ASTContext& context) {\n  // Without this, sugared types can lead to lookup misses.\n  llvm::SmallVector<clang::TemplateArgument, 4> canonical_args;\n  for (const clang::TemplateArgument& arg : args) {\n    canonical_args.push_back(context.getCanonicalTemplateArgument(arg));\n  }\n\n  // XXX(kartynnik): `findSpecialization` is a non-`const` method because it can\n  // lead to loading external specializations. Arguably this could have been\n  // handled through `mutable` fields because logically this doesn't affect the\n  // forthcoming behavior of the object.\n  void* insert_pos = nullptr;\n  return const_cast<clang::ClassTemplateDecl*>(class_template_decl)\n      ->findSpecialization(canonical_args, insert_pos);\n}\n\n// Helper functions to find the closest explicit template specialization that\n// matches the provided template arguments.\nconst clang::Decl* GetSpecializationDecl(\n    const clang::ClassTemplateDecl* class_template_decl,\n    const llvm::ArrayRef<clang::TemplateArgument> template_arguments,\n    const clang::ASTContext& context) {\n  class_template_decl = GetClassTemplateDefinition(class_template_decl);\n  const clang::Decl* decl = class_template_decl;\n  const auto* specialization_decl =\n      FindSpecialization(class_template_decl, template_arguments, context);\n  while (specialization_decl) {\n    // This happens when we have a forward declaration of a template class,\n    // followed by an explicit instantiation, followed by the definition. In\n    // that case, when we look for the correct specialization of the template\n    // class definition, we get a ClassTemplateSpecializationDecl which is of\n    // type TSK_Undeclared and which references the forward declaration of the\n    // template class instead of the correct definition. Calling\n    // getInstantiatedFrom on such a ClassTemplateSpecializationDecl will return\n    // null.\n    //\n    // FrontendTest.UsingSpecialization tests the handling of this case.\n    if (specialization_decl->getSpecializationKind() ==\n        clang::TemplateSpecializationKind::TSK_Undeclared) {\n      return class_template_decl;\n    }\n\n    // Otherwise we should be able to continue walking the chain of\n    // specialisations until we find the best match.\n    const auto instantiated_from = specialization_decl->getInstantiatedFrom();\n    if (instantiated_from.isNull()) {\n      // Includes the case of `specialization_decl->isExplicitSpecialization()`.\n      decl = specialization_decl;\n      break;\n    } else if (llvm::isa<clang::ClassTemplateDecl*>(instantiated_from)) {\n      decl = llvm::cast<clang::ClassTemplateDecl*>(instantiated_from);\n      break;\n    } else {\n      specialization_decl =\n          llvm::cast<clang::ClassTemplatePartialSpecializationDecl*>(\n              instantiated_from);\n    }\n  }\n\n  if (llvm::isa<clang::ClassTemplateDecl>(decl)) {\n    decl =\n        GetClassTemplateDefinition(llvm::cast<clang::ClassTemplateDecl>(decl));\n  }\n\n  return decl;\n}\n\nconst clang::Decl* GetSpecializationDecl(\n    const clang::TemplateSpecializationType* type,\n    const clang::ASTContext& context) {\n  // There's no direct link to the clang::Type for the template type being\n  // specialized, so this gets us a reference to the underlying template.\n  //\n  // Note that template_decl can be nullptr in the case of template template\n  // parameters that are still instantiation dependent in this specialization.\n  // Those are not \"real\" types, so we don't want to add references to them.\n  const auto* template_decl = type->getTemplateName().getAsTemplateDecl();\n  const clang::Decl* decl = template_decl;\n  if (template_decl) {\n    if (llvm::isa<clang::ClassTemplateDecl>(template_decl)) {\n      auto* class_template_decl =\n          llvm::cast<clang::ClassTemplateDecl>(template_decl);\n      decl = GetSpecializationDecl(class_template_decl,\n                                   type->template_arguments(), context);\n    } else if (llvm::isa<clang::TypeAliasTemplateDecl>(template_decl)) {\n      return llvm::cast<clang::TypeAliasTemplateDecl>(template_decl)\n          ->getTemplatedDecl();\n    }\n  }\n\n  return decl;\n}\n\nconst clang::Decl* GetSpecializationDecl(\n    const clang::ClassTemplateSpecializationDecl* decl,\n    const clang::ASTContext& context) {\n  // If this is an explicit specialization, then there's no need to look for\n  // the best matching specialization.\n  if (decl->isExplicitSpecialization()) {\n    return decl;\n  }\n  return GetSpecializationDecl(decl->getSpecializedTemplate(),\n                               decl->getTemplateArgs().asArray(), context);\n}\n\nconst clang::CXXRecordDecl* GetTemplatePrototypeRecordDecl(\n    const clang::ClassTemplateSpecializationDecl* decl,\n    const clang::ASTContext& context) {\n  const clang::Decl* specialization_decl = GetSpecializationDecl(decl, context);\n  if (const auto* class_template_decl =\n          llvm::dyn_cast<clang::ClassTemplateDecl>(specialization_decl)) {\n    return class_template_decl->getTemplatedDecl();\n  }\n  const clang::CXXRecordDecl* record_decl =\n      llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(\n          specialization_decl);\n  CHECK_NE(record_decl, nullptr);\n  return record_decl;\n}\n\nbool IsIncompleteFunction(const clang::FunctionDecl* function_decl) {\n  return !function_decl->hasBody() && !function_decl->isDefaulted() &&\n         !function_decl->isPureVirtual() &&\n         !function_decl->getBuiltinID(true) &&\n         !function_decl->hasDefiningAttr();\n}\n\n// `decl` is required to be a `clang::NamedDecl`.\n// If it is inside a template instantiation, finds the context where it is\n// instantiated from and finds the corresponding entity by name.\nconst clang::NamedDecl* GetTemplatePrototypeNamedDecl(\n    const clang::Decl* decl, const clang::ASTContext& context) {\n  const clang::NamedDecl* named_decl = llvm::dyn_cast<clang::NamedDecl>(decl);\n  CHECK_NE(named_decl, nullptr);\n  clang::DeclarationName field_name = named_decl->getDeclName();\n\n  if (field_name.getAsString().empty()) {\n    // E.g. for a `DecompositionDecl`.\n    return nullptr;\n  }\n  const clang::DeclContext* template_context = nullptr;\n  const clang::TemplateDecl* template_decl = nullptr;\n\n  if (const auto* class_specialization_decl =\n          llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(\n              named_decl->getDeclContext())) {\n    if (class_specialization_decl->isExplicitSpecialization()) {\n      return nullptr;\n    }\n    if (const clang::CXXRecordDecl* template_definition =\n            GetTemplatePrototypeRecordDecl(class_specialization_decl,\n                                           context)) {\n      template_context = template_definition;\n      template_decl = template_definition->getDescribedClassTemplate();\n    } else {\n      return nullptr;\n    }\n  } else if (const auto* function_decl = llvm::dyn_cast<clang::FunctionDecl>(\n                 named_decl->getDeclContext())) {\n    if (const clang::FunctionDecl* instantiation_pattern =\n            function_decl->getTemplateInstantiationPattern()) {\n      template_context = instantiation_pattern;\n      template_decl = instantiation_pattern->getDescribedFunctionTemplate();\n    } else if (function_decl->getDescribedFunctionTemplate() &&\n               function_decl->getDescribedFunctionTemplate()\n                   ->getInstantiatedFromMemberTemplate()) {\n      template_decl = function_decl->getDescribedFunctionTemplate()\n                          ->getInstantiatedFromMemberTemplate();\n      template_context = llvm::dyn_cast<clang::FunctionDecl>(\n          template_decl->getTemplatedDecl());\n    } else {\n      return nullptr;\n    }\n  } else {\n    return nullptr;\n  }\n\n  if (template_context) {\n    // We are using `decls` instead of `fields` to also account for statics.\n    for (const clang::Decl* inner_decl : template_context->decls()) {\n      if (const auto* inner_named_decl =\n              llvm::dyn_cast<clang::NamedDecl>(inner_decl)) {\n        if (inner_named_decl->getDeclName() == field_name) {\n          if (llvm::isa<clang::BindingDecl>(inner_named_decl)) {\n            // TODO: Figure out if we can support these.\n            return nullptr;\n          }\n          return inner_named_decl;\n        }\n      }\n    }\n  }\n\n  if (template_decl) {\n    // Look up template parameters as well.\n    for (const clang::NamedDecl* template_parameter :\n         *template_decl->getTemplateParameters()) {\n      if (template_parameter->getDeclName() == field_name) {\n        return template_parameter;\n      }\n    }\n  }\n\n  return nullptr;\n}\n\n// Helper functions used to print template parameters for template declarations\n// and specializations, since this code can be shared between class and function\n// templates.\nstd::string FormatTemplateParameters(\n    const clang::TemplateParameterList* params) {\n  llvm::SmallString<128> string;\n  llvm::raw_svector_ostream stream(string);\n  stream << \"<\";\n  for (int i = 0; i < params->size(); ++i) {\n    if (i != 0) {\n      stream << \", \";\n    }\n    const auto* param = params->getParam(i);\n    if (llvm::isa<clang::NonTypeTemplateParmDecl>(param)) {\n      const auto* value_param =\n          llvm::cast<clang::NonTypeTemplateParmDecl>(param);\n      auto value_type = value_param->getType();\n      stream << value_type.getAsString(GetPrintingPolicy());\n    } else {\n      param->getNameForDiagnostic(stream, GetPrintingPolicy(), false);\n      if (param->isParameterPack()) {\n        stream << \"...\";\n      }\n    }\n  }\n  stream << \">\";\n  return stream.str().str();\n}\n\ntemplate <class TemplateArgumentType>\nstd::string FormatTemplateArguments(const clang::TemplateParameterList* params,\n                                    llvm::ArrayRef<TemplateArgumentType> args) {\n  llvm::SmallString<128> string;\n  llvm::raw_svector_ostream stream(string);\n  clang::printTemplateArgumentList(stream, args, GetPrintingPolicy(), params);\n  return stream.str().str();\n}\n\n// Helper functions to generate the `<typename T, int S>` suffixes when handling\n// templates.\nstd::string GetTemplateParameterSuffix(const clang::TemplateDecl* decl) {\n  return FormatTemplateParameters(decl->getTemplateParameters());\n}\n\nstd::string GetTemplateParameterSuffix(\n    const clang::ClassTemplateSpecializationDecl* decl) {\n  const clang::TemplateParameterList* params =\n      decl->getSpecializedTemplate()->getTemplateParameters();\n  if (const auto* partial_spec_decl =\n          llvm::dyn_cast<clang::ClassTemplatePartialSpecializationDecl>(decl)) {\n    if (const clang::ASTTemplateArgumentListInfo* args_as_written =\n            partial_spec_decl->getTemplateArgsAsWritten()) {\n      return FormatTemplateArguments(params, args_as_written->arguments());\n    }\n  }\n  return FormatTemplateArguments(params, decl->getTemplateArgs().asArray());\n}\n\nstd::string GetTemplateParameterSuffix(\n    const clang::TemplateSpecializationType* type,\n    const clang::ASTContext& context) {\n  const auto* template_decl = type->getTemplateName().getAsTemplateDecl();\n  if (llvm::isa<clang::ClassTemplateDecl>(template_decl)) {\n    const auto* class_template_decl =\n        llvm::cast<clang::ClassTemplateDecl>(template_decl);\n    return GetTemplateParameterSuffix(FindSpecialization(\n        class_template_decl, type->template_arguments(), context));\n  } else {\n    CHECK(llvm::isa<clang::TypeAliasTemplateDecl>(template_decl));\n    const auto* type_alias_template_decl =\n        llvm::cast<clang::TypeAliasTemplateDecl>(template_decl);\n    return FormatTemplateArguments(\n        type_alias_template_decl->getTemplateParameters(),\n        type->template_arguments());\n  }\n}\n\nstd::string GetTemplateParameterSuffix(\n    const clang::FunctionTemplateSpecializationInfo* info) {\n  return FormatTemplateArguments(info->getTemplate()->getTemplateParameters(),\n                                 info->TemplateArguments->asArray());\n}\n\nstd::string GetTemplateParameterSuffix(\n    const clang::VarTemplateSpecializationDecl* decl,\n    const clang::ASTContext& context) {\n  const clang::TemplateParameterList* params =\n      decl->getSpecializedTemplate()->getTemplateParameters();\n  if (const auto* partial_spec_decl =\n          llvm::dyn_cast<clang::VarTemplatePartialSpecializationDecl>(decl)) {\n    if (const clang::ASTTemplateArgumentListInfo* args_as_written =\n            partial_spec_decl->getTemplateArgsAsWritten()) {\n      return FormatTemplateArguments(params, args_as_written->arguments());\n    }\n  }\n  return FormatTemplateArguments(params, decl->getTemplateArgs().asArray());\n}\n\nstd::string GetName(const clang::Decl* decl) {\n  std::string name = \"\";\n  if (auto field_decl = llvm::dyn_cast<clang::FieldDecl>(decl);\n      field_decl && field_decl->isAnonymousStructOrUnion()) {\n    // Implicit unnamed fields for anonymous structs/unions are named after the\n    // latter. We ignore them elsewhere; this is only for tests to assert\n    // they're absent (the name contains the source file path otherwise).\n    decl = field_decl->getType()->getAsRecordDecl();\n    CHECK_NE(decl, nullptr);\n  }\n  if (llvm::isa<clang::RecordDecl>(decl)) {\n    const auto* record_decl = llvm::cast<clang::RecordDecl>(decl);\n    name = record_decl->getName().str();\n    if (name.empty() && record_decl->isStruct()) {\n      return \"(anonymous struct)\";\n    } else if (name.empty() && record_decl->isUnion()) {\n      return \"(anonymous union)\";\n    }\n  } else if (llvm::isa<clang::NamedDecl>(decl)) {\n    // Lambda function handling is a little bit tricky, since we want to use\n    // the implicit operator() definition, but that doesn't track whether we are\n    // in a lambda function, so we need to check whether the parent decl is an\n    // implicit lambda class.\n    if (llvm::isa<clang::CXXMethodDecl>(decl)) {\n      auto* cxx_method_decl = llvm::cast<clang::CXXMethodDecl>(decl);\n      if (cxx_method_decl->getParent()->isLambda()) {\n        return \"lambda\";\n      }\n    }\n    const auto* named_decl = llvm::cast<clang::NamedDecl>(decl);\n    llvm::SmallString<32> string;\n    llvm::raw_svector_ostream stream(string);\n    named_decl->printName(stream, GetPrintingPolicy());\n    name = string.str().str();\n  }\n\n  return name;\n}\n\nstd::string GetNameSuffix(const clang::Decl* decl,\n                          const clang::ASTContext& context) {\n  std::string name_suffix = \"\";\n  if (llvm::isa<clang::CXXRecordDecl>(decl)) {\n    const auto* cxx_record_decl = llvm::cast<clang::CXXRecordDecl>(decl);\n    if (llvm::isa<clang::ClassTemplateSpecializationDecl>(decl)) {\n      const auto* class_template_specialization_decl =\n          llvm::cast<clang::ClassTemplateSpecializationDecl>(decl);\n      name_suffix =\n          GetTemplateParameterSuffix(class_template_specialization_decl);\n    } else if (cxx_record_decl->getDescribedClassTemplate()) {\n      name_suffix = GetTemplateParameterSuffix(\n          cxx_record_decl->getDescribedClassTemplate());\n    }\n  } else if (llvm::isa<clang::FunctionDecl>(decl)) {\n    const auto* function_decl = llvm::cast<clang::FunctionDecl>(decl);\n\n    std::string template_param_suffix = \"\";\n    if (function_decl->getTemplateSpecializationInfo()) {\n      template_param_suffix = GetTemplateParameterSuffix(\n          function_decl->getTemplateSpecializationInfo());\n    } else if (function_decl->getDescribedFunctionTemplate()) {\n      template_param_suffix = GetTemplateParameterSuffix(\n          function_decl->getDescribedFunctionTemplate());\n    }\n\n    std::vector<std::string> param_types;\n    param_types.reserve(function_decl->getNumParams());\n    for (int i = 0; i < function_decl->getNumParams(); ++i) {\n      const clang::ParmVarDecl* parm_decl = function_decl->getParamDecl(i);\n      param_types.emplace_back(\n          parm_decl->getType().getAsString(GetPrintingPolicy()));\n    }\n\n    if (function_decl->isVariadic()) {\n      param_types.emplace_back(\"...\");\n    }\n\n    name_suffix = absl::StrCat(template_param_suffix, \"(\",\n                               absl::StrJoin(param_types, \", \"), \")\");\n\n    if (llvm::isa<clang::CXXMethodDecl>(decl)) {\n      const auto* cxx_method_decl = llvm::cast<clang::CXXMethodDecl>(decl);\n      if (!cxx_method_decl->getParent()->isLambda()) {\n        if (cxx_method_decl->isConst()) {\n          absl::StrAppend(&name_suffix, \" const\");\n        }\n        if (cxx_method_decl->isVolatile()) {\n          absl::StrAppend(&name_suffix, \" volatile\");\n        }\n        switch (cxx_method_decl->getRefQualifier()) {\n          case clang::RQ_None:\n            break;\n          case clang::RQ_LValue:\n            absl::StrAppend(&name_suffix, \" &\");\n            break;\n          case clang::RQ_RValue:\n            absl::StrAppend(&name_suffix, \" &&\");\n            break;\n        }\n      }\n    }\n  } else if (llvm::isa<clang::VarDecl>(decl)) {\n    const auto* var_decl = llvm::cast<clang::VarDecl>(decl);\n    if (const auto* var_template_decl = var_decl->getDescribedVarTemplate()) {\n      name_suffix = GetTemplateParameterSuffix(var_template_decl);\n    } else if (const auto* var_template_specialization_decl =\n                   llvm::dyn_cast<clang::VarTemplateSpecializationDecl>(decl)) {\n      name_suffix =\n          GetTemplateParameterSuffix(var_template_specialization_decl, context);\n    }\n  } else if (llvm::isa<clang::TypeAliasDecl>(decl)) {\n    const auto* type_alias_decl = llvm::cast<clang::TypeAliasDecl>(decl);\n    const auto* type_alias_template_decl =\n        type_alias_decl->getDescribedAliasTemplate();\n    if (type_alias_template_decl) {\n      name_suffix = GetTemplateParameterSuffix(type_alias_template_decl);\n    }\n  }\n\n  return name_suffix;\n}\n\nstd::string GetNamePrefixForDeclContext(const clang::DeclContext* decl_context,\n                                        const clang::ASTContext& ast_context,\n                                        bool include_function_scope = true) {\n  std::list<std::string> parts = {\"\"};\n\n  while (decl_context) {\n    if (llvm::isa<clang::FunctionDecl>(decl_context)) {\n      if (!include_function_scope) {\n        // If we're not including function scopes, then we can stop when we\n        // reach the first containing function.\n        break;\n      }\n\n      const auto* parent_decl = llvm::cast<clang::Decl>(decl_context);\n      parts.push_front(absl::StrCat(GetName(parent_decl),\n                                    GetNameSuffix(parent_decl, ast_context)));\n    } else if (llvm::isa<clang::NamespaceDecl>(decl_context)) {\n      // namespace name should always appear in our name prefix.\n      const auto* namespace_decl =\n          llvm::cast<clang::NamespaceDecl>(decl_context);\n      if (namespace_decl->isAnonymousNamespace()) {\n        parts.push_front(\"(anonymous namespace)\");\n      } else {\n        parts.push_front(namespace_decl->getName().str());\n      }\n    } else if (llvm::isa<clang::RecordDecl>(decl_context)) {\n      bool is_lambda = false;\n      if (llvm::isa<clang::CXXRecordDecl>(decl_context)) {\n        const auto* cxx_record_decl =\n            llvm::cast<clang::CXXRecordDecl>(decl_context);\n        is_lambda = cxx_record_decl->isLambda();\n      }\n      // class / union / struct name should always appear in our name prefix,\n      // unless it's the implicit class for a lambda function.\n      if (!is_lambda) {\n        const auto* parent_decl = llvm::cast<clang::Decl>(decl_context);\n        parts.push_front(absl::StrCat(GetName(parent_decl),\n                                      GetNameSuffix(parent_decl, ast_context)));\n      }\n    } else if (llvm::isa<clang::EnumDecl>(decl_context)) {\n      const auto* enum_decl = llvm::cast<clang::EnumDecl>(decl_context);\n      // The only time that an enum should appear in our name prefix is when it\n      // is a c++11 scoped enum / enum class.\n      if (enum_decl->isScoped() || enum_decl->isScopedUsingClassTag()) {\n        const auto* parent_decl = llvm::cast<clang::Decl>(decl_context);\n        parts.push_front(absl::StrCat(GetName(parent_decl),\n                                      GetNameSuffix(parent_decl, ast_context)));\n      }\n    }\n    decl_context = decl_context->getParent();\n  }\n\n  return absl::StrJoin(parts, \"::\");\n}\n\nstd::string GetNamePrefix(const clang::Decl* decl,\n                          const clang::ASTContext& ast_context) {\n  if (llvm::isa<clang::ParmVarDecl>(decl)) {\n    return {};\n  }\n\n  // Function names should only appear in the name prefix in specific cases.\n  //\n  // 1. Declaration of a template parameter for a function or member function\n  //    template:\n  //    ```\n  //    template <typename T>\n  //    void foo(T bar);\n  //    ```\n  //    In this case, the Type entity for `T` should be qualified as\n  //    `foo<typename T>()::T`\n  //\n  // 2. Declaration of a nested type/class/enum or a nested function:\n  //    ```\n  //    int foo() {\n  //      class Bar {\n  //      };\n  //    }\n  //    ```\n  //    In this case, the Class entity for `Bar` should be qualified as\n  //    `foo()::Bar`\n  //\n  // Technically, I think the return type should be included when functions are\n  // used as qualifiers, but since return type overloading is not allowed I\n  // don't think that this is necessary, so it is omitted at present.\n  //\n  // In practice this means that we want to include functions in fully qualified\n  // names for anything other than variable declarations.\n  bool include_function_scope = !llvm::isa<clang::VarDecl>(decl);\n  const auto* decl_context = decl->getNonTransparentDeclContext();\n  return GetNamePrefixForDeclContext(decl_context, ast_context,\n                                     include_function_scope);\n}\n\nbool IsIgnoredImplicitDecl(const clang::Decl* decl) {\n  // Don't index unreferenced implicit entities except implicit methods.\n  // (We opt to declare all the implicit methods with a preference to report\n  // e.g. an \"implicitly defined\" destructor over reporting it missing.)\n  return decl->isImplicit() && !llvm::isa<clang::CXXMethodDecl>(decl);\n}\n\nbool IsNotInherited(const clang::Decl* decl) {\n  if (decl->isImplicit() || llvm::isa<clang::CXXConstructorDecl>(decl) ||\n      llvm::isa<clang::CXXDestructorDecl>(decl)) {\n    return true;\n  }\n  // Assignment operators are not inherited.\n  if (const auto* function_decl = llvm::dyn_cast<clang::FunctionDecl>(decl)) {\n    if (function_decl->isOverloadedOperator() &&\n        function_decl->getOverloadedOperator() == clang::OO_Equal) {\n      return true;\n    }\n  }\n  return false;\n}\n\nusing SeenNames = llvm::SmallSet<clang::DeclarationName, 32>;\n\nvoid CollectPotentialMemberNamesFromAncestors(\n    const clang::CXXRecordDecl* class_decl, SeenNames& seen_names) {\n  class_decl = class_decl->getDefinition();\n  if (!class_decl) {\n    return;\n  }\n  for (const auto& base_spec : class_decl->bases()) {\n    if (const clang::CXXRecordDecl* base_decl =\n            base_spec.getType()->getAsCXXRecordDecl();\n        base_decl && (base_decl = base_decl->getDefinition())) {\n      // We are using `decls` instead of `fields` to also account for statics.\n      for (const auto* decl : base_decl->decls()) {\n        if (const auto* named_decl = llvm::dyn_cast<clang::NamedDecl>(decl)) {\n          const clang::DeclarationName& decl_name = named_decl->getDeclName();\n          if (decl_name.getAsString().empty()) {\n            continue;\n          }\n          if (!seen_names.contains(decl_name)) {\n            // Process all the members with this name (e.g. method overloads).\n            auto result = base_decl->lookup(named_decl->getDeclName());\n            for (const auto* found_decl : result) {\n              if (!IsNotInherited(found_decl)) {\n                seen_names.insert(decl_name);\n                break;\n              }\n            }\n          }\n        }\n      }\n\n      CollectPotentialMemberNamesFromAncestors(base_decl, seen_names);\n    }\n  }\n}\n\nbool IsCompleteClass(const clang::CXXRecordDecl* class_decl) {\n  // According to `Sema::LookupQualifiedName` constraints for a `TagDecl`.\n  return class_decl->isDependentContext() ||\n         class_decl->isCompleteDefinition() || class_decl->isBeingDefined();\n}\n\ntemplate <typename Action>\nvoid ForAllInheritedMembers(clang::Sema& sema,\n                            const clang::CXXRecordDecl* class_decl,\n                            Action&& action) {\n  CHECK_NE(class_decl, nullptr);\n  if (!IsCompleteClass(class_decl)) {\n    return;\n  }\n\n  SeenNames seen_names;\n  CollectPotentialMemberNamesFromAncestors(class_decl, seen_names);\n\n  for (const clang::DeclarationName& decl_name : seen_names) {\n    clang::LookupResult lookup_result(\n        sema, decl_name, {}, clang::Sema::LookupNameKind::LookupMemberName);\n    lookup_result.suppressDiagnostics();\n    // `LookupQualifiedName` requires a mutable context - in particular,\n    // implicit methods can be lazily defined in the process.\n    // However, the pattern of `const` usage there is awkward - at the time of\n    // writing, `LookupDirect` takes it as a `const` pointer, then passed to\n    // `DeclareImplicitMemberFunctionsWithName` which casts the `const` away...\n    auto* mutable_class_decl = const_cast<clang::CXXRecordDecl*>(class_decl);\n    sema.LookupQualifiedName(lookup_result, mutable_class_decl,\n                             /*InUnqualifiedLookup=*/false);\n    if (!lookup_result.isSingleResult() &&\n        !lookup_result.isOverloadedResult()) {\n      // Ambiguous lookups that require qualification are not instantiated.\n      // However, qualified accesses (`A().B::x`) do count as references.\n      continue;\n    }\n    for (const auto decl : lookup_result) {\n      // Check that it is an inherited member and not one from the class itself.\n      if (decl->getNonTransparentDeclContext()->getPrimaryContext() ==\n          class_decl->getPrimaryContext()) {\n        continue;\n      }\n      action(decl);\n    }\n  }\n}\n\nvoid ReportTranslationUnit(llvm::raw_string_ostream& stream,\n                           const clang::ASTContext& context) {\n  const clang::SourceManager& source_manager = context.getSourceManager();\n  clang::FileID main_file_id = source_manager.getMainFileID();\n  const clang::FileEntry* main_file_entry =\n      source_manager.getFileEntryForID(main_file_id);\n  if (main_file_entry) {\n    llvm::StringRef main_file_path = main_file_entry->tryGetRealPathName();\n    stream << \"Translation unit: '\" << main_file_path << \"'\\n\";\n  }\n}\n\nstd::string GetEnumValue(const clang::EnumConstantDecl* decl) {\n  const llvm::APSInt& value = decl->getInitVal();\n  std::string string_value;\n  llvm::raw_string_ostream stream(string_value);\n  stream << value;\n  return string_value;\n}\n\n// The mapping from (not necessarily immediate) base classes defining a method\n// to their definitions thereof.\nusing DefiningSuperBasesToMethods =\n    llvm::SmallMapVector<const clang::CXXRecordDecl*,\n                         const clang::CXXMethodDecl*, 16>;\n\ntemplate <typename EntityIdByDecl>\nvoid AddVirtualMethodLinksImpl(\n    const clang::CXXMethodDecl* prototype_method_decl,\n    const clang::CXXRecordDecl* child_class_decl,\n    const DefiningSuperBasesToMethods& defining_super_bases_to_methods,\n    EntityId child_id, InMemoryIndex& index,\n    EntityIdByDecl&& get_entity_id_for_decl, const clang::ASTContext& context) {\n  llvm::SmallPtrSet<const clang::CXXRecordDecl*, 32> seen;\n  llvm::SmallVector<const clang::CXXRecordDecl*, 32> to_visit;\n  auto add_bases_to_visit = [&to_visit,\n                             &seen](const clang::CXXRecordDecl* class_decl) {\n    for (const auto& base : class_decl->bases()) {\n      auto* base_cxx_record = base.getType()->getAsCXXRecordDecl();\n      if (!base_cxx_record) {\n        continue;\n      }\n      base_cxx_record = base_cxx_record->getDefinition();\n      if (!base_cxx_record) {\n        continue;\n      }\n      if (!seen.contains(base_cxx_record)) {\n        to_visit.push_back(base_cxx_record);\n        seen.insert(base_cxx_record);\n      }\n    }\n  };\n  add_bases_to_visit(child_class_decl);\n\n  while (!to_visit.empty()) {\n    const clang::CXXRecordDecl* base_cxx_record = to_visit.pop_back_val();\n\n    const auto it = defining_super_bases_to_methods.find(base_cxx_record);\n    if (it != defining_super_bases_to_methods.end()) {\n      // There is a definition in `base_cxx_record` we can link to.\n      const clang::CXXMethodDecl* overridden_method_decl = it->second;\n      EntityId parent_id = get_entity_id_for_decl(overridden_method_decl);\n      if (parent_id != kInvalidEntityId) {\n        (void)index.GetVirtualMethodLinkId({parent_id, child_id});\n      } else {\n        LOG(DFATAL) << \"Parent of virtual method \"\n                    << index.GetEntityById(child_id).full_name() << \" in class \"\n                    << base_cxx_record->getQualifiedNameAsString()\n                    << \" is an invalid entity\";\n      }\n      continue;\n    }\n\n    // `base_cxx_record` doesn't define this method directly.\n    for (const auto [defining_super_base, overridden_method_decl] :\n         defining_super_bases_to_methods) {\n      if (!base_cxx_record->isDerivedFrom(defining_super_base)) {\n        continue;\n      }\n      // Because it can be present in `base_cxx_record` only through inheritance\n      // (see above), check if it was synthesized there from\n      // `overridden_method_decl` in `defining_super_base`.\n      const EntityId inherited_id =\n          get_entity_id_for_decl(overridden_method_decl);\n      if (inherited_id == kInvalidEntityId) {\n        LOG(DFATAL) << \"Parent of virtual method \"\n                    << index.GetEntityById(child_id).full_name() << \" in class \"\n                    << defining_super_base->getQualifiedNameAsString()\n                    << \" is an invalid entity\";\n        continue;\n      }\n      const Entity& inherited_entity = index.GetEntityById(inherited_id);\n      const std::string new_name_prefix =\n          GetNamePrefixForDeclContext(base_cxx_record, context);\n      // Re-synthesize it to get the ID of the synthetic entity.\n      const EntityId parent_id = index.GetExistingEntityId(\n          Entity(inherited_entity, /*new_name_prefix=*/new_name_prefix,\n                 /*inherited_entity_id=*/inherited_id));\n      if (parent_id == kInvalidEntityId) {\n        // No such synthetic entity, likely due to name resolution ambiguity in\n        // the base. Skip it and consider its immediate super-bases.\n        add_bases_to_visit(base_cxx_record);\n      } else {\n        (void)index.GetVirtualMethodLinkId({parent_id, child_id});\n      }\n      // We can't break here - can have multiple bases with this virtual method.\n    }\n  }\n}\n\nconst clang::CXXRecordDecl* GetCXXRecordForType(const clang::QualType& type) {\n  clang::QualType derived_type = type;\n  if (const auto* pointer_type = type->getAs<clang::PointerType>()) {\n    derived_type = pointer_type->getPointeeType();\n  }\n  if (derived_type->isDependentType()) {\n    return nullptr;\n  }\n  const auto* record_type = derived_type->castAs<clang::RecordType>();\n  CHECK(record_type);\n#if LLVM_VERSION_MAJOR > 22\n  const clang::RecordDecl* decl = record_type->getDecl();\n#else\n  const clang::RecordDecl* decl = record_type->getOriginalDecl();\n#endif\n  CHECK(decl);\n  return llvm::dyn_cast<clang::CXXRecordDecl>(decl);\n}\n\n}  // namespace\n\nbool AstVisitor::VisitCallExpr(const clang::CallExpr* expr) {\n  AddReferencesForExpr(expr);\n  return true;\n}\n\nbool AstVisitor::VisitCXXConstructExpr(const clang::CXXConstructExpr* expr) {\n  AddReferencesForExpr(expr);\n  return true;\n}\n\nbool AstVisitor::VisitCXXDeleteExpr(const clang::CXXDeleteExpr* expr) {\n  AddReferencesForExpr(expr);\n  return true;\n}\n\nbool AstVisitor::VisitCXXNewExpr(const clang::CXXNewExpr* expr) {\n  AddReferencesForExpr(expr);\n  return true;\n}\n\nbool AstVisitor::VisitDeclRefExpr(const clang::DeclRefExpr* expr) {\n  AddReferencesForExpr(expr);\n  return true;\n}\n\nbool AstVisitor::VisitEnumDecl(const clang::EnumDecl* decl) {\n  GetEntityIdForDecl(decl);\n  return true;\n}\n\nbool AstVisitor::VisitEnumConstantDecl(const clang::EnumConstantDecl* decl) {\n  GetEntityIdForDecl(decl);\n  return true;\n}\n\nbool AstVisitor::VisitFieldDecl(const clang::FieldDecl* decl) {\n  GetEntityIdForDecl(decl);\n  AddReferencesForDecl(decl);\n  return true;\n}\n\nbool AstVisitor::VisitFunctionDecl(const clang::FunctionDecl* decl) {\n  // We only need to add an entity for a FunctionDecl that is the definition,\n  // or if there is no definition in this translation unit, and we never add an\n  // entity for a deleted function.\n  if (decl->isDeleted()) {\n    return true;\n  }\n  if (IsADefinition(decl) || !decl->getDefinition()) {\n    GetEntityIdForDecl(decl);\n    AddReferencesForDecl(decl);\n  }\n  return true;\n}\n\nbool AstVisitor::VisitLambdaExpr(const clang::LambdaExpr* expr) {\n  GetEntityIdForDecl(expr->getCallOperator());\n  return true;\n}\n\nbool AstVisitor::VisitMemberExpr(const clang::MemberExpr* expr) {\n  AddReferencesForExpr(expr);\n  return true;\n}\n\nbool AstVisitor::VisitNonTypeTemplateParmDecl(\n    const clang::NonTypeTemplateParmDecl* decl) {\n  if (IsParentADefinition(decl)) {\n    GetEntityIdForDecl(decl);\n  }\n  return true;\n}\n\nbool AstVisitor::VisitRecordDecl(clang::RecordDecl* decl) {\n  if (auto* record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(decl)) {\n    if (record_decl->isInjectedClassName()) {\n      // struct C {\n      //   // C is implicitly declared here as a synonym for the class name.\n      // };\n      // C::C c; // same as \"C c;\"\n      // Only index `C` in this case, and don't index `C::C`.\n      return true;\n    }\n\n    if (IsADefinition(record_decl)) {\n      SynthesizeInheritedMemberEntities(record_decl);\n    }\n\n    // We opt to declare all the implicit members with a preference to report\n    // e.g. an \"implicitly defined\" destructor over reporting it missing.\n    sema_.ForceDeclarationOfImplicitMembers(record_decl);\n  }\n\n  // As for FunctionDecl, we only need to add an entity for a RecordDecl if this\n  // is the definition, or if there is no definition in this translation unit.\n  if (IsADefinition(decl) || !decl->getDefinition()) {\n    GetEntityIdForDecl(decl);\n    AddReferencesForDecl(decl);\n  }\n  return true;\n}\n\nvoid AstVisitor::SynthesizeInheritedMemberEntities(\n    const clang::CXXRecordDecl* class_decl) {\n  CHECK(IsADefinition(class_decl));\n\n  const std::string new_name_prefix = GetNamePrefixForDeclContext(\n      /*decl_context=*/class_decl, /*ast_context=*/context_);\n  ForAllInheritedMembers(sema_, class_decl, [&](const clang::Decl* decl) {\n    const EntityId inherited_id = GetEntityIdForDecl(decl);\n    if (inherited_id == kInvalidEntityId) {\n      return;\n    }\n    const Entity& inherited_entity = index_.GetEntityById(inherited_id);\n    const Entity synth_entity(inherited_entity,\n                              /*new_name_prefix=*/new_name_prefix,\n                              /*inherited_entity_id=*/inherited_id);\n    const EntityId synth_id = index_.GetEntityId(synth_entity);\n\n    if (inherited_entity.is_virtual_method()) {\n      AddSynthesizedVirtualMethodLinks(llvm::cast<clang::CXXMethodDecl>(decl),\n                                       class_decl, synth_id);\n    }\n  });\n}\n\nbool AstVisitor::VisitTemplateTypeParmDecl(\n    const clang::TemplateTypeParmDecl* decl) {\n  if (IsParentADefinition(decl)) {\n    GetEntityIdForDecl(decl);\n  }\n  return true;\n}\n\nbool AstVisitor::VisitTypedefNameDecl(const clang::TypedefNameDecl* decl) {\n  GetEntityIdForDecl(decl);\n  AddReferencesForDecl(decl);\n  return true;\n}\n\nbool AstVisitor::VisitUnaryExprOrTypeTraitExpr(\n    const clang::UnaryExprOrTypeTraitExpr* expr) {\n  // This is handling for the special kind of expression\n  // size_t foo_size = sizeof(struct Foo);\n  if ((expr->getKind() == clang::UETT_SizeOf ||\n       expr->getKind() == clang::UETT_AlignOf) &&\n      expr->isArgumentType()) {\n    const auto* arg_type = expr->getArgumentType().getTypePtrOrNull();\n    if (arg_type) {\n      AddTypeReferencesForSourceRange(expr->getSourceRange(), arg_type);\n    }\n  }\n  return true;\n}\n\nbool AstVisitor::VisitVarDecl(const clang::VarDecl* decl) {\n  if (IsParentADefinition(decl)) {\n    GetEntityIdForDecl(decl);\n  }\n  AddReferencesForDecl(decl);\n  return true;\n}\n\nLocationId AstVisitor::GetLocationId(clang::SourceLocation start,\n                                     clang::SourceLocation end) {\n  return oss_fuzz::indexer::GetLocationId(index_, context_.getSourceManager(),\n                                          start, end);\n}\n\nLocationId AstVisitor::GetLocationId(const clang::Decl* decl) {\n  // If we have a template specialization or instantiation, we should make\n  // sure we use the source location that matches the closest explicit\n  // specialization instead of the base template.\n  if (llvm::isa<clang::ClassTemplateSpecializationDecl>(decl)) {\n    const auto* specialization_decl =\n        llvm::cast<clang::ClassTemplateSpecializationDecl>(decl);\n    decl = GetSpecializationDecl(specialization_decl, context_);\n  }\n\n  // For class template definitions, the AST has two nodes:\n  // - ClassTemplateDecl `template <typename T>`\n  //   - CXXRecordDecl   `class Foo { ... };`\n  // So, if we have a `CXXRecordDecl`, then we should check if we have an\n  // associated class template, and use the outer location to give the full\n  // definition.\n  if (llvm::isa<clang::CXXRecordDecl>(decl)) {\n    const auto* cxx_record_decl = llvm::cast<clang::CXXRecordDecl>(decl);\n    if (cxx_record_decl->getDefinition()) {\n      cxx_record_decl = cxx_record_decl->getDefinition();\n    }\n\n    const auto* class_template_decl =\n        cxx_record_decl->getDescribedClassTemplate();\n    if (class_template_decl) {\n      decl = GetClassTemplateDefinition(class_template_decl);\n    }\n  }\n\n  // For function template definitions, the AST also has two nodes:\n  // - FunctionTemplateDecl `template <typename T>`\n  //   - FunctionDecl       `void Foo(T bar) { ... }`\n  // So we similarly need to check whether we have an associated function\n  // template. However, for instantiation of function templates, we have an\n  // extra level of indirection via `FunctionTemplateSpecializationInfo`.\n  if (llvm::isa<clang::FunctionDecl>(decl)) {\n    const auto* function_decl = llvm::cast<clang::FunctionDecl>(decl);\n    if (function_decl->isTemplateInstantiation()) {\n      function_decl = function_decl->getTemplateInstantiationPattern();\n    } else if (function_decl->getTemplateSpecializationInfo()) {\n      const auto* tmp_info = function_decl->getTemplateSpecializationInfo();\n      function_decl = tmp_info->getFunction();\n    }\n\n    decl = function_decl;\n    const auto* func_template = function_decl->getDescribedFunctionTemplate();\n    if (func_template) {\n      decl = func_template;\n    }\n  }\n\n  // Same for variable template declarations.\n  if (llvm::isa<clang::VarDecl>(decl)) {\n    const auto* var_decl = llvm::cast<clang::VarDecl>(decl);\n    const auto* var_template_decl = var_decl->getDescribedVarTemplate();\n    if (var_template_decl) {\n      decl = var_template_decl;\n    }\n  }\n\n  // Same for type alias template declarations.\n  if (llvm::isa<clang::TypeAliasDecl>(decl)) {\n    const auto* type_alias_decl = llvm::cast<clang::TypeAliasDecl>(decl);\n    const auto* type_alias_template_decl =\n        type_alias_decl->getDescribedTemplate();\n    if (type_alias_template_decl) {\n      decl = type_alias_template_decl;\n    }\n  }\n\n  // b/438675191: Workaround for a `libclang` bug (incorrect start location of\n  // abbreviated function templates stemming from a missing `template` keyword).\n  if (const auto* function_template_decl =\n          llvm::dyn_cast<clang::FunctionTemplateDecl>(decl);\n      function_template_decl &&\n      function_template_decl->getBeginLoc().isInvalid()) {\n    return GetLocationId(\n        function_template_decl->getTemplatedDecl()->getBeginLoc(),\n        function_template_decl->getEndLoc());\n  }\n\n  // If we reach here then we have updated decl to point to the correct location\n  // already.\n  return GetLocationId(decl->getBeginLoc(), decl->getEndLoc());\n}\n\nstd::optional<SubstituteRelationship>\nAstVisitor::GetTemplateSubstituteRelationship(\n    const clang::Decl* template_decl, const clang::Decl* original_decl) {\n  if (template_decl == nullptr) {\n    return std::nullopt;\n  }\n\n  EntityId template_entity_id = GetEntityIdForDecl(template_decl);\n  if (template_entity_id == kInvalidEntityId) {\n    // `original_decl` might have been materialized with `for_reference`.\n    if (!IsIgnoredImplicitDecl(original_decl)) {\n      std::string str;\n      llvm::raw_string_ostream stream(str);\n      stream << \"Please report an indexer issue marked 'TEMPLATE':\\n\";\n      ReportTranslationUnit(stream, context_);\n      stream << \"Original Decl:\\n\";\n      original_decl->dump(stream);\n      stream << \"Template prototype Decl:\\n\";\n      template_decl->dump(stream);\n      llvm::errs() << str;\n    }\n    return std::nullopt;\n  }\n\n  const Entity& template_entity = index_.GetEntityById(template_entity_id);\n  const auto relationship_kind =\n      SubstituteRelationship::Kind::kIsTemplateInstantiationOf;\n  if (const auto& next_relationship = template_entity.substitute_relationship();\n      next_relationship && next_relationship->kind() == relationship_kind) {\n    // Contract consecutive references to point to the ultimate prototype.\n    template_entity_id = next_relationship->substitute_entity_id();\n  }\n  return SubstituteRelationship(relationship_kind, template_entity_id);\n}\n\n// See the description of the `VirtualMethodLink` type for a discussion.\nvoid AstVisitor::AddVirtualMethodLinks(const clang::CXXMethodDecl* method_decl,\n                                       EntityId child_id) {\n  // For an actual virtual method, trace the chains to its prototypes, if any.\n  if (method_decl->overridden_methods().empty()) {\n    return;\n  }\n  DefiningSuperBasesToMethods defining_super_bases_to_methods;\n  for (const clang::CXXMethodDecl* overridden_method_decl :\n       method_decl->overridden_methods()) {\n    const clang::CXXRecordDecl* overridden_method_record =\n        overridden_method_decl->getParent();\n    defining_super_bases_to_methods.insert(\n        {overridden_method_record, overridden_method_decl});\n  }\n  AddVirtualMethodLinksImpl(\n      method_decl, method_decl->getParent(), defining_super_bases_to_methods,\n      child_id, index_,\n      [&](const clang::Decl* decl) -> EntityId {\n        return GetEntityIdForDecl(decl);\n      },\n      context_);\n}\n\nvoid AstVisitor::AddSynthesizedVirtualMethodLinks(\n    const clang::CXXMethodDecl* prototype_method_decl,\n    const clang::CXXRecordDecl* child_class_decl, EntityId child_id) {\n  DefiningSuperBasesToMethods defining_super_bases_to_methods;\n  // For a synthesized entity, trace the chain(s) back to the origin class.\n  defining_super_bases_to_methods.insert(\n      {prototype_method_decl->getParent(), prototype_method_decl});\n  AddVirtualMethodLinksImpl(\n      prototype_method_decl, child_class_decl, defining_super_bases_to_methods,\n      child_id, index_,\n      [&](const clang::Decl* decl) -> EntityId {\n        return GetEntityIdForDecl(decl);\n      },\n      context_);\n}\n\nEntityId AstVisitor::GetEntityIdForDecl(const clang::Decl* decl,\n                                        bool for_reference) {\n  auto it = decl_to_entity_id_.find(decl);\n  if (it != decl_to_entity_id_.end()) {\n    const CachedEntityId& cached = it->second;\n    if (for_reference || !cached.for_reference_only) {\n      return cached.entity_id;\n    }\n  }\n  std::optional<Entity> entity = GetEntityForDecl(decl, for_reference);\n  if (entity) {\n    const EntityId id = index_.GetEntityId(*entity);\n    decl_to_entity_id_.insert_or_assign(it, decl, {id, for_reference});\n    if (entity->is_virtual_method()) {\n      const auto method_decl = llvm::cast<clang::CXXMethodDecl>(decl);\n      AddVirtualMethodLinks(method_decl, id);\n    }\n    return id;\n  }\n  if (for_reference) {\n    // If even `for_reference` yields an invalid entity, we can cache that.\n    decl_to_entity_id_.insert(\n        it, {decl, {kInvalidEntityId, /*for_reference_only=*/false}});\n  }\n  return kInvalidEntityId;\n}\n\nstd::optional<Entity> AstVisitor::GetEntityForDecl(const clang::Decl* decl,\n                                                   bool for_reference,\n                                                   LocationId location_id) {\n  CHECK_NE(decl, nullptr);\n  // Unless they are referenced, do not index `IsIgnoredImplicitDecl` subjects.\n  if (!for_reference && IsIgnoredImplicitDecl(decl)) {\n    return std::nullopt;\n  }\n\n  // Handle assignments of lambda types, as we need to get the entity for the\n  // lambda::operator() rather than the implicit invisible lambda class.\n  if (llvm::isa<clang::CXXRecordDecl>(decl)) {\n    auto* function_decl = llvm::cast<clang::CXXRecordDecl>(decl);\n    if (function_decl->isLambda()) {\n      return GetEntityForDecl(function_decl->getLambdaCallOperator(),\n                              location_id);\n    }\n  }\n\n  // Similarly, for ClassTemplateDecl we want the underlying CXXRecordDecl and\n  // not the template wrapper decl.\n  if (llvm::isa<clang::ClassTemplateDecl>(decl)) {\n    const auto* class_template_decl =\n        llvm::cast<clang::ClassTemplateDecl>(decl);\n    decl = class_template_decl->getTemplatedDecl();\n  }\n\n  // Resolve FunctionTemplateDecl to the underlying FunctionDecl.\n  if (llvm::isa<clang::FunctionTemplateDecl>(decl)) {\n    const auto* function_template_decl =\n        llvm::cast<clang::FunctionTemplateDecl>(decl);\n    decl = function_template_decl->getTemplatedDecl();\n  }\n\n  // Resolve VarTemplateDecl to the underlying VarDecl.\n  if (llvm::isa<clang::VarTemplateDecl>(decl)) {\n    const auto* var_template_decl = llvm::cast<clang::VarTemplateDecl>(decl);\n    decl = var_template_decl->getTemplatedDecl();\n  }\n\n  // Resolve TypeAliasTemplateDecl to the underlying TypeAliasDecl.\n  if (llvm::isa<clang::TypeAliasTemplateDecl>(decl)) {\n    const auto* type_template_decl =\n        llvm::cast<clang::TypeAliasTemplateDecl>(decl);\n    decl = type_template_decl->getTemplatedDecl();\n  }\n\n  // Then handle structured binding.\n  if (llvm::isa<clang::BindingDecl>(decl)) {\n    auto* binding_decl = llvm::cast<clang::BindingDecl>(decl);\n    decl = binding_decl->getHoldingVar();\n    // It's possible that we don't have a holding var here.\n    if (!decl) {\n      return std::nullopt;\n    }\n  }\n\n  // Then resolve from the declaration to the definition of the entity.\n  if (llvm::isa<clang::VarDecl>(decl)) {\n    auto* var_decl = llvm::cast<clang::VarDecl>(decl);\n    if (!var_decl->isThisDeclarationADefinition() &&\n        var_decl->getDefinition()) {\n      decl = var_decl->getDefinition();\n    }\n  } else if (llvm::isa<clang::TagDecl>(decl)) {\n    auto* tag_decl = llvm::cast<clang::TagDecl>(decl);\n    if (!tag_decl->isThisDeclarationADefinition() &&\n        tag_decl->getDefinition()) {\n      decl = tag_decl->getDefinition();\n    }\n  } else if (llvm::isa<clang::FunctionDecl>(decl)) {\n    auto* function_decl = llvm::cast<clang::FunctionDecl>(decl);\n    if (!function_decl->isThisDeclarationADefinition() &&\n        function_decl->getDefinition()) {\n      decl = function_decl->getDefinition();\n    }\n  }\n  // Defer getting the location in case the entity is invalid.\n  auto get_location_id = [&]() {\n    return location_id == kInvalidLocationId ? GetLocationId(decl)\n                                             : location_id;\n  };\n\n  const std::string name = GetName(decl);\n  if (name.empty()) {\n    return std::nullopt;\n  }\n  const std::string name_prefix = GetNamePrefix(decl, context_);\n  const std::string name_suffix = GetNameSuffix(decl, context_);\n\n  std::optional<SubstituteRelationship> substitute_relationship;\n  if (llvm::isa<clang::VarDecl>(decl) || llvm::isa<clang::FieldDecl>(decl) ||\n      llvm::isa<clang::NonTypeTemplateParmDecl>(decl)) {\n    if (decl->isImplicit() || llvm::isa<clang::DecompositionDecl>(decl)) {\n      // Implicit `VarDecl`s encountered were range `for` loop variables;\n      // implicit `FieldDecl`s were unnamed anonymous struct/union fields\n      // (see `FieldDecl::isAnonymousStructOrUnion`).\n      // `DecompositionDecl` is unnamed but inherits from `VarDecl`.\n      return std::nullopt;\n    }\n\n    if (llvm::isa<clang::FieldDecl>(decl) || llvm::isa<clang::VarDecl>(decl)) {\n      // Check for template instantiation.\n      substitute_relationship = GetTemplateSubstituteRelationship(\n          GetTemplatePrototypeNamedDecl(decl, context_), decl);\n    }\n    return Entity(Entity::Kind::kVariable, name_prefix, name, name_suffix,\n                  get_location_id(), /*is_incomplete=*/false,\n                  /*is_weak=*/false, substitute_relationship);\n  } else if (llvm::isa<clang::RecordDecl>(decl)) {\n    const auto* record_decl = llvm::cast<clang::RecordDecl>(decl);\n    bool is_incomplete = !record_decl->getDefinition();\n    if (llvm::isa<clang::ClassTemplateSpecializationDecl>(decl)) {\n      auto* class_template_specialization_decl =\n          llvm::cast<clang::ClassTemplateSpecializationDecl>(decl);\n      // All explicit specializations should be considered complete, as they\n      // will be the definition that is used (when the specialization matches).\n      if (class_template_specialization_decl->isExplicitSpecialization()) {\n        is_incomplete = false;\n      } else {\n        // Otherwise, a template instantiation is complete iff the base class\n        // being templated from is complete.\n        const auto* class_template_decl =\n            class_template_specialization_decl->getSpecializedTemplate();\n\n        is_incomplete =\n            !class_template_decl->getTemplatedDecl()->getDefinition();\n\n        substitute_relationship = GetTemplateSubstituteRelationship(\n            GetTemplatePrototypeRecordDecl(class_template_specialization_decl,\n                                           context_),\n            class_template_specialization_decl);\n      }\n    }\n    return Entity(Entity::Kind::kClass, name_prefix, name, name_suffix,\n                  get_location_id(), is_incomplete, /*is_weak=*/false,\n                  substitute_relationship);\n  } else if (llvm::isa<clang::EnumDecl>(decl)) {\n    substitute_relationship = GetTemplateSubstituteRelationship(\n        GetTemplatePrototypeNamedDecl(decl, context_), decl);\n    return Entity(Entity::Kind::kEnum, name_prefix, name, name_suffix,\n                  get_location_id(), /*is_incomplete=*/false,\n                  /*is_weak=*/false, substitute_relationship);\n  } else if (llvm::isa<clang::EnumConstantDecl>(decl)) {\n    const auto* enum_constant_decl = llvm::cast<clang::EnumConstantDecl>(decl);\n    substitute_relationship = GetTemplateSubstituteRelationship(\n        GetTemplatePrototypeNamedDecl(decl, context_), decl);\n    return Entity(Entity::Kind::kEnumConstant, name_prefix, name, name_suffix,\n                  get_location_id(), /*is_incomplete=*/false, /*is_weak=*/false,\n                  substitute_relationship,\n                  /*enum_value=*/GetEnumValue(enum_constant_decl));\n  } else if (llvm::isa<clang::TemplateTypeParmDecl>(decl) ||\n             llvm::isa<clang::TypedefNameDecl>(decl)) {\n    substitute_relationship = GetTemplateSubstituteRelationship(\n        GetTemplatePrototypeNamedDecl(decl, context_), decl);\n    return Entity(Entity::Kind::kType, name_prefix, name, name_suffix,\n                  get_location_id(), /*is_incomplete=*/false, /*is_weak=*/false,\n                  substitute_relationship);\n  } else if (llvm::isa<clang::FunctionDecl>(decl)) {\n    const auto* function_decl = llvm::cast<clang::FunctionDecl>(decl);\n    bool is_incomplete = IsIncompleteFunction(function_decl);\n    bool is_weak = !is_incomplete && function_decl->hasAttr<clang::WeakAttr>();\n    Entity::VirtualMethodKind virtual_method_kind =\n        Entity::VirtualMethodKind::kNotAVirtualMethod;\n    if (const auto* method_decl =\n            llvm::dyn_cast<clang::CXXMethodDecl>(function_decl)) {\n      if (method_decl->isVirtual()) {\n        virtual_method_kind = method_decl->isPureVirtual()\n                                  ? Entity::VirtualMethodKind::kPureVirtual\n                                  : Entity::VirtualMethodKind::kNonPureVirtual;\n      }\n    }\n\n    // Note: Implicit methods are generally defined after template\n    // instantiation, but an implicit comparison operator coming from (C++20)\n    //   constexpr operator<=>(const TemplatedClass<T>& other);\n    // can be instantiated by class template instantiations.\n    // In this case we report the instantiation via `kIsTemplateInstantiationOf`\n    // which refers to an implicit method in the template\n    // (`kIsImplicitlyDefinedFor`).\n    //\n    // In contrast, an implicit destructor of an (implicit) template\n    // instantiation will have `kIsImplicitlyDefinedFor` which in turn\n    // has a 'kIsTemplateInstantiationOf`.\n\n    // Check for template instantiation.\n    const clang::Decl* function_template = nullptr;\n    if (function_decl->getTemplateInstantiationPattern()) {\n      function_template = function_decl->getTemplateInstantiationPattern();\n    } else if (function_decl->getDescribedFunctionTemplate() &&\n               function_decl->getDescribedFunctionTemplate()\n                   ->getInstantiatedFromMemberTemplate()) {\n      function_template = function_decl->getDescribedFunctionTemplate()\n                              ->getInstantiatedFromMemberTemplate();\n    }\n    if (function_template) {\n      substitute_relationship =\n          GetTemplateSubstituteRelationship(function_template, decl);\n    }\n\n    if (!substitute_relationship) {\n      if (const auto method_decl =\n              llvm::dyn_cast<clang::CXXMethodDecl>(function_decl)) {\n        // Check for an implicitly defined method.\n        if (!substitute_relationship && method_decl->isImplicit()) {\n          auto parent_class = method_decl->getParent();\n          if (parent_class->getName().empty()) {\n            // An anonymous struct's/union's implicit method; ignore.\n            return std::nullopt;\n          }\n          auto implicitly_defined_for_entity_id =\n              GetEntityIdForDecl(parent_class);\n          if (implicitly_defined_for_entity_id == kInvalidEntityId) {\n            // Case in point: Implicitly defined `struct __va_list_tag`.\n            return std::nullopt;\n          } else {\n            substitute_relationship = {\n                SubstituteRelationship::Kind::kIsImplicitlyDefinedFor,\n                implicitly_defined_for_entity_id};\n          }\n        }\n      }\n    }\n    return Entity(Entity::Kind::kFunction, name_prefix, name, name_suffix,\n                  get_location_id(), is_incomplete, is_weak,\n                  substitute_relationship, /*enum_value=*/std::nullopt,\n                  /*virtual_method_kind=*/virtual_method_kind);\n  }\n\n  return std::nullopt;\n}\n\nvoid AstVisitor::AddTypeReferencesFromLocation(LocationId location_id,\n                                               const clang::Type* type,\n                                               bool outermost_type) {\n  const clang::Decl* type_decl = nullptr;\n\n  // We can't add references if the location is invalid.\n  if (location_id == kInvalidLocationId) return;\n\n  // First strip indirections\n  while (type->isPointerType() || type->isReferenceType()) {\n    const auto* pointee_type = type->getPointeeOrArrayElementType();\n    if (pointee_type == type) {\n      break;\n    }\n\n    type = pointee_type;\n  }\n\n  if (llvm::isa<clang::TemplateSpecializationType>(type)) {\n    auto* specialization_type =\n        llvm::cast<clang::TemplateSpecializationType>(type);\n    // We need to add references to the parameter types in the case of a\n    // template specialization. We only do this in the first level of recursion,\n    // so that we don't get too noisy with the cross-references.\n    if (outermost_type) {\n      for (const auto& template_argument :\n           specialization_type->template_arguments()) {\n        if (template_argument.getKind() ==\n            clang::TemplateArgument::ArgKind::Type) {\n          const auto* argument_type =\n              template_argument.getAsType().getTypePtrOrNull();\n          if (argument_type) {\n            AddTypeReferencesFromLocation(location_id, argument_type,\n                                          /*outermost_type=*/false);\n          }\n        }\n      }\n    }\n\n    // We want to add a reference to the \"best matching\" underlying template.\n    // This should be the source code entity that closest matches the template\n    // parameters; so the source code version of the template that will be\n    // instantiated for this type.\n    const auto* specialization_decl =\n        GetSpecializationDecl(specialization_type, context_);\n    if (specialization_decl) {\n      auto entity_id = GetEntityIdForDecl(specialization_decl,\n                                          /*for_reference=*/true);\n      if (entity_id != kInvalidEntityId) {\n        (void)index_.GetReferenceId({entity_id, location_id});\n      }\n    }\n\n    const auto* template_decl =\n        specialization_type->getTemplateName().getAsTemplateDecl();\n    LocationId decl_location_id = kInvalidLocationId;\n    if (specialization_decl) {\n      decl_location_id = GetLocationId(specialization_decl);\n    } else if (template_decl) {\n      decl_location_id = GetLocationId(template_decl);\n    }\n\n    // We need to manually create the entities for template specializations,\n    // because when we have partial specializations or forward declarations,\n    // we need a different source location than the one associated to the\n    // template ClassTemplateDecl, and for partial specializations we also\n    // need to override the name_suffix generation with information that is only\n    // stored in the TemplateSpecializationType.\n    if (decl_location_id != kInvalidLocationId) {\n      if (template_decl &&\n          llvm::isa<clang::TypeAliasTemplateDecl>(template_decl)) {\n        std::string name_prefix = GetNamePrefix(template_decl, context_);\n        std::string name = GetName(template_decl);\n        std::string name_suffix =\n            GetTemplateParameterSuffix(specialization_type, context_);\n\n        auto* alias_template_decl =\n            llvm::cast<clang::TypeAliasTemplateDecl>(template_decl);\n        auto entity_id = index_.GetEntityId(\n            {Entity::Kind::kType, name_prefix, name, name_suffix,\n             decl_location_id,\n             /*is_incomplete=*/false, /*is_weak=*/false,\n             SubstituteRelationship(\n                 SubstituteRelationship::Kind::kIsTemplateInstantiationOf,\n                 GetEntityIdForDecl(alias_template_decl->getTemplatedDecl(),\n                                    /*for_reference=*/true))});\n        if (entity_id != kInvalidEntityId) {\n          (void)index_.GetReferenceId({entity_id, location_id});\n        }\n      }\n    }\n\n    // Type declaration becomes the instantiation of the underlying template.\n    type_decl = type->getAsTagDecl();\n    if (type_decl) {\n      auto entity_id = GetEntityIdForDecl(type_decl, /*for_reference=*/true);\n      if (entity_id != kInvalidEntityId) {\n        (void)index_.GetReferenceId({entity_id, location_id});\n      }\n    }\n  } else {\n    if (llvm::isa<clang::TemplateTypeParmType>(type)) {\n      type_decl = llvm::cast<clang::TemplateTypeParmType>(type)->getDecl();\n    } else if (type->isTypedefNameType()) {\n      // We need to add references to the inner-types in the case of typedefs.\n      const clang::TypedefType* typedef_type_ptr =\n          type->getAs<clang::TypedefType>();\n      if (typedef_type_ptr) {\n        const auto* typedef_decl = typedef_type_ptr->getDecl();\n        const auto* underlying_type_ptr =\n            typedef_decl->getUnderlyingType().getTypePtrOrNull();\n        if (underlying_type_ptr) {\n          AddTypeReferencesFromLocation(location_id, underlying_type_ptr,\n                                        /*outermost_type=*/false);\n        }\n\n        type_decl = typedef_decl;\n      }\n    } else {\n      type_decl = type->getAsTagDecl();\n    }\n\n    if (type_decl) {\n      auto entity_id = GetEntityIdForDecl(type_decl, /*for_reference=*/true);\n\n      if (entity_id != kInvalidEntityId) {\n        (void)index_.GetReferenceId({entity_id, location_id});\n      }\n    }\n  }\n}\n\nvoid AstVisitor::AddReferencesForDecl(const clang::Decl* decl) {\n  clang::SourceRange range = decl->getSourceRange();\n  const clang::Type* type_ptr = nullptr;\n  if (llvm::isa<clang::TypedefNameDecl>(decl)) {\n    const auto* typedef_decl = llvm::cast<clang::TypedefNameDecl>(decl);\n    type_ptr = typedef_decl->getUnderlyingType().getTypePtrOrNull();\n  } else if (llvm::isa<clang::FunctionDecl>(decl)) {\n    if (const auto* method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl)) {\n      for (const clang::CXXMethodDecl* overridden_method :\n           method_decl->overridden_methods()) {\n        AddDeclReferenceForSourceRange(range, overridden_method);\n      }\n    }\n    const auto* function_decl = llvm::cast<clang::FunctionDecl>(decl);\n    type_ptr = function_decl->getReturnType().getTypePtrOrNull();\n    // We truncate function return type type references to reference only the\n    // function declaration/definition and not to include the lines for the\n    // function body.\n    if (function_decl->hasBody()) {\n      range.setEnd(function_decl->getBody()->getSourceRange().getBegin());\n    }\n  } else if (llvm::isa<clang::CXXRecordDecl>(decl)) {\n    const auto* cxx_record_decl = llvm::cast<clang::CXXRecordDecl>(decl);\n    if (cxx_record_decl->isThisDeclarationADefinition()) {\n      // C++ class definitions may have multiple inheritance, so we need to add\n      // references to all base classes here.\n      for (const auto& base : cxx_record_decl->bases()) {\n        const auto* base_type_ptr = base.getType().getTypePtrOrNull();\n        if (base_type_ptr) {\n          AddTypeReferencesForSourceRange(range, base_type_ptr);\n        }\n      }\n    }\n  } else if (llvm::isa<clang::ValueDecl>(decl)) {\n    const auto* value_decl = llvm::cast<clang::ValueDecl>(decl);\n    type_ptr = value_decl->getType().getTypePtrOrNull();\n  }\n\n  if (type_ptr) {\n    AddTypeReferencesForSourceRange(range, type_ptr);\n  }\n}\n\nvoid AstVisitor::AddReferencesForExpr(const clang::Expr* expr) {\n  const clang::Decl* decl = nullptr;\n  if (llvm::isa<clang::CXXDeleteExpr>(expr)) {\n    decl = llvm::cast<clang::CXXDeleteExpr>(expr)->getOperatorDelete();\n  } else if (llvm::isa<clang::CXXNewExpr>(expr)) {\n    decl = llvm::cast<clang::CXXNewExpr>(expr)->getOperatorNew();\n  } else if (llvm::isa<clang::CallExpr>(expr)) {\n    decl = llvm::cast<clang::CallExpr>(expr)->getCalleeDecl();\n    if (decl && llvm::isa<clang::CXXMethodDecl>(decl)) {\n      const auto* method_decl = llvm::cast<clang::CXXMethodDecl>(decl);\n      if (method_decl->getParent()) {\n        const auto* type = method_decl->getParent()\n                               ->getASTContext()\n                               .getCanonicalTagType(method_decl->getParent())\n                               .getTypePtr();\n        if (type) {\n          AddTypeReferencesForSourceRange(expr->getSourceRange(), type);\n        }\n      }\n    }\n  } else if (llvm::isa<clang::CXXConstructExpr>(expr)) {\n    // Perhaps surprisingly, `CXXConstructExpr` is not a `CallExpr`.\n    decl = llvm::cast<clang::CXXConstructExpr>(expr)->getConstructor();\n    if (decl && llvm::isa<clang::CXXConstructorDecl>(decl)) {\n      const auto* constructor_decl =\n          llvm::cast<clang::CXXConstructorDecl>(decl);\n      if (constructor_decl->getParent()) {\n        const auto* type =\n            constructor_decl->getParent()\n                ->getASTContext()\n                .getCanonicalTagType(constructor_decl->getParent())\n                .getTypePtr();\n        if (type) {\n          AddTypeReferencesForSourceRange(expr->getSourceRange(), type);\n        }\n      }\n    }\n  } else if (llvm::isa<clang::DeclRefExpr>(expr)) {\n    decl = llvm::cast<clang::DeclRefExpr>(expr)->getDecl();\n  } else if (llvm::isa<clang::MemberExpr>(expr)) {\n    const auto* member_expr = llvm::cast<clang::MemberExpr>(expr);\n    const clang::ValueDecl* value_decl = member_expr->getMemberDecl();\n    decl = value_decl;\n    if (clang::Expr* base = member_expr->getBase()) {\n      AddReferencesForExpr(base);\n\n      // Check if the call can be devirtualized (the type is known precisely,\n      // or either the member function or its defining class are marked `final`\n      // etc.) Add a reference to the devirtualized method as well in that case.\n      if (const auto* method_decl =\n              llvm::dyn_cast<clang::CXXMethodDecl>(value_decl);\n          method_decl && method_decl->isVirtual()) {\n        if (const clang::CXXMethodDecl* devirtualized_method_decl =\n                method_decl->getDevirtualizedMethod(base,\n                                                    /*IsAppleKext=*/false);\n            devirtualized_method_decl &&\n            devirtualized_method_decl != method_decl) {\n          AddDeclReferenceForSourceRange(expr->getSourceRange(),\n                                         devirtualized_method_decl);\n        }\n      }\n\n      // Check if the access is through an inheriting descendant, in which case\n      // we add a cross-reference to the corresponding synthetic entity.\n      //\n      // Skip the case of an explicit qualification (`instance.Base::method`)\n      // because it is commonly used for members not accessible through the\n      // instance directly (for disambiguation).\n      if (!member_expr->getQualifierLoc()) {\n        if (const clang::CXXRecordDecl* expr_record_decl =\n                GetCXXRecordForType(base->IgnoreParenBaseCasts()->getType())) {\n          const clang::DeclContext* decl_context =\n              value_decl->getNonTransparentDeclContext();\n          // If the base expression is not of the same record type as the parent\n          // of the retrieved member...\n          if (const auto* record_decl =\n                  llvm::dyn_cast<clang::CXXRecordDecl>(decl_context);\n              record_decl && record_decl->getCanonicalDecl() !=\n                                 expr_record_decl->getCanonicalDecl()) {\n            // ...add synthetic entity cross-references.\n            AddSyntheticMemberReference(expr_record_decl, value_decl,\n                                        expr->getSourceRange());\n          }\n        }\n      }\n    }\n  } else if (llvm::isa<clang::LambdaExpr>(expr)) {\n    decl = llvm::cast<clang::LambdaExpr>(expr)\n               ->getLambdaClass()\n               ->getLambdaCallOperator();\n  }\n\n  if (decl) {\n    AddDeclReferenceForSourceRange(expr->getSourceRange(), decl);\n  }\n}\n\nvoid AstVisitor::AddSyntheticMemberReference(\n    const clang::CXXRecordDecl* child_class,\n    const clang::ValueDecl* inherited_member, const clang::SourceRange& range) {\n  const EntityId base_member_entity_id = GetEntityIdForDecl(inherited_member);\n  if (base_member_entity_id == kInvalidEntityId) {\n    return;\n  }\n  const Entity& base_member_entity =\n      index_.GetEntityById(base_member_entity_id);\n  const Entity synthetic_inherited_member = Entity(\n      base_member_entity, GetNamePrefixForDeclContext(child_class, context_),\n      /*inherited_entity_id=*/base_member_entity_id);\n  const EntityId synthetic_inherited_member_id =\n      index_.GetEntityId(synthetic_inherited_member);\n  auto location_id = GetLocationId(range.getBegin(), range.getEnd());\n  (void)index_.GetReferenceId({synthetic_inherited_member_id, location_id});\n}\n\nvoid AstVisitor::AddDeclReferenceForSourceRange(const clang::SourceRange& range,\n                                                const clang::Decl* decl) {\n  auto entity_id = GetEntityIdForDecl(decl, /*for_reference=*/true);\n  auto location_id = GetLocationId(range.getBegin(), range.getEnd());\n\n  if (entity_id != kInvalidEntityId && location_id != kInvalidLocationId) {\n    (void)index_.GetReferenceId({entity_id, location_id});\n  }\n}\n\nvoid AstVisitor::AddTypeReferencesForSourceRange(\n    const clang::SourceRange& range, const clang::Type* type) {\n  if (range.isInvalid()) {\n    return;\n  }\n  auto location_id = GetLocationId(range.getBegin(), range.getEnd());\n  AddTypeReferencesFromLocation(location_id, type);\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/frontend/ast_visitor.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_FRONTEND_AST_VISITOR_H_\n#define OSS_FUZZ_INFRA_INDEXER_FRONTEND_AST_VISITOR_H_\n\n#include <optional>\n\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/index/types.h\"\n#include \"absl/container/flat_hash_map.h\"\n#include \"clang/AST/ASTConsumer.h\"\n#include \"clang/AST/Decl.h\"\n#include \"clang/AST/DeclTemplate.h\"\n#include \"clang/AST/Expr.h\"\n#include \"clang/AST/ExprCXX.h\"\n#include \"clang/AST/RecursiveASTVisitor.h\"\n#include \"clang/AST/Type.h\"\n#include \"clang/Basic/SourceLocation.h\"\n#include \"clang/Frontend/CompilerInstance.h\"\n#include \"clang/Sema/Sema.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n// AstVisitor handles the indexing operations for the AST. This should not be\n// used directly, and the exposed api in indexer/frontend.h should be used\n// instead.\nclass AstVisitor : public clang::RecursiveASTVisitor<AstVisitor> {\n public:\n  AstVisitor(InMemoryIndex& index, clang::ASTContext& context,\n             clang::CompilerInstance& compiler)\n      : index_(index),\n        context_(context),\n        sema_(compiler.getSema()) {}\n\n  bool shouldVisitImplicitCode() const { return true; }\n  bool shouldVisitTemplateInstantiations() const { return true; }\n\n  // clang::RecursiveASTVisitor<T> functions:\n  // These are not overrides, since clang uses template magic to implement the\n  // AST visitor instead of virtual function calls.\n  bool VisitCallExpr(const clang::CallExpr *expr);\n  bool VisitCXXConstructExpr(const clang::CXXConstructExpr *expr);\n  bool VisitCXXNewExpr(const clang::CXXNewExpr *expr);\n  bool VisitCXXDeleteExpr(const clang::CXXDeleteExpr *expr);\n  bool VisitDeclRefExpr(const clang::DeclRefExpr *expr);\n  bool VisitEnumDecl(const clang::EnumDecl *decl);\n  bool VisitEnumConstantDecl(const clang::EnumConstantDecl *decl);\n  bool VisitFieldDecl(const clang::FieldDecl *decl);\n  bool VisitFunctionDecl(const clang::FunctionDecl *decl);\n  bool VisitLambdaExpr(const clang::LambdaExpr *expr);\n  bool VisitMemberExpr(const clang::MemberExpr *expr);\n  bool VisitNonTypeTemplateParmDecl(const clang::NonTypeTemplateParmDecl *decl);\n  bool VisitRecordDecl(clang::RecordDecl *decl);\n  bool VisitTemplateTypeParmDecl(const clang::TemplateTypeParmDecl *decl);\n  bool VisitTypedefNameDecl(const clang::TypedefNameDecl *decl);\n  bool VisitUnaryExprOrTypeTraitExpr(\n      const clang::UnaryExprOrTypeTraitExpr *expr);\n  bool VisitVarDecl(const clang::VarDecl *decl);\n\n private:\n  LocationId GetLocationId(clang::SourceLocation start,\n                           clang::SourceLocation end);\n  LocationId GetLocationId(const clang::Decl *decl);\n  std::optional<Entity> GetEntityForDecl(\n      const clang::Decl* decl, bool for_reference = false,\n      LocationId location_id = kInvalidLocationId);\n  EntityId GetEntityIdForDecl(const clang::Decl *decl,\n                              bool for_reference = false);\n  std::optional<SubstituteRelationship> GetTemplateSubstituteRelationship(\n      const clang::Decl* template_decl, const clang::Decl* original_decl);\n  void SynthesizeInheritedMemberEntities(\n      const clang::CXXRecordDecl* class_decl);\n  void AddSyntheticMemberReference(const clang::CXXRecordDecl* child_class,\n                                   const clang::ValueDecl* inherited_member,\n                                   const clang::SourceRange& range);\n  void AddTypeReferencesFromLocation(LocationId location_id,\n                                     const clang::Type *type,\n                                     bool outermost_type = true);\n  void AddReferencesForDecl(const clang::Decl *decl);\n  void AddReferencesForExpr(const clang::Expr *expr);\n  void AddDeclReferenceForSourceRange(const clang::SourceRange &range,\n                                      const clang::Decl *decl);\n  void AddTypeReferencesForSourceRange(const clang::SourceRange &range,\n                                       const clang::Type *type);\n\n  void AddVirtualMethodLinks(const clang::CXXMethodDecl* method_decl,\n                             EntityId child_id);\n  void AddSynthesizedVirtualMethodLinks(\n      const clang::CXXMethodDecl* prototype_method_decl,\n      const clang::CXXRecordDecl* child_class_decl, EntityId child_id);\n\n  InMemoryIndex &index_;\n  clang::ASTContext &context_;\n  clang::Sema& sema_;\n\n  struct CachedEntityId {\n    EntityId entity_id;\n    bool for_reference_only;\n  };\n\n  absl::flat_hash_map<const clang::Decl*, CachedEntityId> decl_to_entity_id_;\n};\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_FRONTEND_AST_VISITOR_H_\n"
  },
  {
    "path": "infra/indexer/frontend/common.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/frontend/common.h\"\n\n#include <cstdint>\n#include <filesystem>  // NOLINT\n#include <string>\n\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/index/types.h\"\n#include \"absl/log/check.h\"\n#include \"absl/strings/string_view.h\"\n#include \"clang/Basic/SourceLocation.h\"\n#include \"clang/Basic/SourceManager.h\"\n#include \"llvm/Support/ErrorOr.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n\nstd::string ToNormalizedAbsolutePath(\n    absl::string_view path, const clang::SourceManager& source_manager) {\n  std::filesystem::path native_path = std::filesystem::path(path);\n  if (!native_path.is_absolute()) {\n    llvm::ErrorOr<std::string> cwd = source_manager.getFileManager()\n                                         .getVirtualFileSystem()\n                                         .getCurrentWorkingDirectory();\n    QCHECK(cwd) << \"unable to get cwd\";\n    native_path = std::filesystem::path(*cwd);\n    native_path.append(path);\n  }\n  return native_path.lexically_normal();\n}\n\n// Converting from `SourceLocation` to a usable file location is non-trivial,\n// see comments in-line for explanation.\nLocationId GetLocationId(InMemoryIndex& index,\n                         const clang::SourceManager& source_manager,\n                         clang::SourceLocation start,\n                         clang::SourceLocation end) {\n  std::string path = \"\";\n  uint32_t start_line = 0, end_line = 0;\n\n  // If the location is inside a macro expansion, we want to first resolve it to\n  // the source location (of the expansion). For example:\n  //\n  // 1: #define INNER_MACRO 1\n  // 2: #define OUTER_MACRO INNER_MACRO\n  // 3: OUTER_MACRO\n  //\n  // If we look at the reference to INNER_MACRO here, we'd want to see that it\n  // is referenced from line 3, not from line 2.\n  //\n  // `getExpansionLoc` is the identity function if the location is not in an\n  // expansion.\n  start = source_manager.getExpansionLoc(start);\n  end = source_manager.getExpansionLoc(end);\n\n  // At this point, both of the `SourceLocations` that are valid should be file\n  // locations. `getPresumedLoc` will then resolve these to meaningful file\n  // locations.\n  clang::PresumedLoc presumed_start =\n      source_manager.getPresumedLoc(start, false);\n  if (!presumed_start.isInvalid()) {\n    path = presumed_start.getFilename();\n    start_line = presumed_start.getLine();\n    end_line = presumed_start.getLine();\n  }\n\n  clang::PresumedLoc presumed_end = source_manager.getPresumedLoc(end, false);\n  if (!presumed_end.isInvalid()) {\n    end_line = presumed_end.getLine();\n  }\n\n  if (end_line < start_line) {\n    end_line = start_line;\n  }\n\n  if (IsRealPath(path)) {\n    // This is a real file path, so normalize it.\n    path = ToNormalizedAbsolutePath(path, source_manager);\n  }\n  return index.GetLocationId({path, start_line, end_line});\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/frontend/common.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_FRONTEND_COMMON_H_\n#define OSS_FUZZ_INFRA_INDEXER_FRONTEND_COMMON_H_\n\n#include <string>\n\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/index/types.h\"\n#include \"absl/strings/string_view.h\"\n#include \"clang/Basic/SourceLocation.h\"\n#include \"clang/Basic/SourceManager.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n// Converts a source-level `path` into a normalized absolute form suitable for\n// passing to the indexer as a location path.\nstd::string ToNormalizedAbsolutePath(\n    absl::string_view path, const clang::SourceManager& source_manager);\n\n// Converts a pair of `SourceLocation` to a `LocationId` for a location in the\n// index.\nLocationId GetLocationId(InMemoryIndex& index,\n                         const clang::SourceManager& source_manager,\n                         clang::SourceLocation start,\n                         clang::SourceLocation end);\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_FRONTEND_COMMON_H_\n"
  },
  {
    "path": "infra/indexer/frontend/frontend.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/frontend/frontend.h\"\n\n#include <cctype>\n#include <cstddef>\n#include <cstdlib>\n#include <memory>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include \"indexer/frontend/index_action.h\"\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/merge_queue.h\"\n#include \"absl/flags/flag.h\"\n#include \"absl/strings/match.h\"\n#include \"absl/strings/string_view.h\"\n#include \"clang/Tooling/ArgumentsAdjusters.h\"\n#include \"clang/Tooling/Tooling.h\"\n#include \"llvm/ADT/StringRef.h\"\n\nABSL_FLAG(std::string, extra_compiler_args, \"\", \"Extra compiler flags\");\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace frontend_internal {\nstd::vector<std::string> ParseCommandLine(absl::string_view commandLine) {\n  std::vector<std::string> args;\n  std::string currentArg;\n  bool inSingleQuotes = false;\n  bool inDoubleQuotes = false;\n  bool escaped = false;\n  for (char c : commandLine) {\n    if (c == '\\\\' && inDoubleQuotes) {\n      escaped = true;\n      continue;\n    }\n    if (c == '\\'' && !inDoubleQuotes && !escaped) {\n      if (inSingleQuotes) {\n        inSingleQuotes = false;\n        args.push_back(currentArg);\n        currentArg.clear();\n      } else {\n        inSingleQuotes = true;\n      }\n    } else if (c == '\"' && !inSingleQuotes && !escaped) {\n      if (inDoubleQuotes) {\n        inDoubleQuotes = false;\n        args.push_back(currentArg);\n        currentArg.clear();\n      } else {\n        inDoubleQuotes = true;\n      }\n    } else if (std::isspace(c) && !inSingleQuotes && !inDoubleQuotes) {\n      if (!currentArg.empty()) {\n        args.push_back(currentArg);\n        currentArg.clear();\n      }\n    } else {\n      currentArg += c;\n    }\n    escaped = false;\n  }\n  if (!currentArg.empty()) {\n    args.push_back(currentArg);\n  }\n  return args;\n}\n}  // namespace frontend_internal\n\nnamespace {\n// We need to strip clang-specific arguments from the command line, as these are\n// usually invocations of clang plugins, which will not be present in our build\n// of clang/llvm.\nclang::tooling::CommandLineArguments RemoveClangArgumentsAdjuster(\n    const clang::tooling::CommandLineArguments& arguments, llvm::StringRef) {\n  clang::tooling::CommandLineArguments result;\n  for (size_t i = 0; i < arguments.size(); ++i) {\n    if (arguments[i] == \"-Xclang\") {\n      ++i;\n    } else if (absl::StartsWith(arguments[i], \"-cfg=\") ||\n               absl::StartsWith(arguments[i], \"-exec_root=\")) {\n      // Also skip these arguments, it's reclient...\n    } else if (absl::EndsWith(arguments[i], \".o.d\")) {\n      // Also skip these arguments, these are there to create dependencies\n      // between build actions.\n    } else {\n      result.push_back(arguments[i]);\n    }\n  }\n  return result;\n}\n\nclang::tooling::CommandLineArguments ExtraArgumentsAdjuster(\n    const clang::tooling::CommandLineArguments& arguments, llvm::StringRef) {\n  clang::tooling::CommandLineArguments result = arguments;\n  std::vector<std::string> extra_args = frontend_internal::ParseCommandLine(\n      absl::GetFlag(FLAGS_extra_compiler_args));\n  result.insert(result.end(), extra_args.begin(), extra_args.end());\n  return result;\n}\n}  // namespace\n\n// Gets the index tool and arguments adjuster to be used with clang tooling to\n// perform indexing on a compilation database.\nstd::vector<std::pair<std::unique_ptr<clang::tooling::FrontendActionFactory>,\n                      clang::tooling::ArgumentsAdjuster>>\nGetIndexActions(FileCopier& file_copier, MergeQueue& merge_queue) {\n  std::vector<std::pair<std::unique_ptr<clang::tooling::FrontendActionFactory>,\n                        clang::tooling::ArgumentsAdjuster>>\n      actions;\n  auto index_action =\n      std::make_unique<IndexActionFactory>(file_copier, merge_queue);\n  auto adjuster = clang::tooling::combineAdjusters(RemoveClangArgumentsAdjuster,\n                                                   ExtraArgumentsAdjuster);\n  actions.push_back(\n      std::make_pair(std::move(index_action), std::move(adjuster)));\n  return actions;\n}\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/frontend/frontend.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_FRONTEND_FRONTEND_H_\n#define OSS_FUZZ_INFRA_INDEXER_FRONTEND_FRONTEND_H_\n\n#include <memory>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/merge_queue.h\"\n#include \"absl/strings/string_view.h\"\n#include \"clang/Tooling/ArgumentsAdjusters.h\"\n#include \"clang/Tooling/Tooling.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace frontend_internal {\n// Parses a command line string into a vector of arguments.\n// This is used internally in GetIndexActions() to parse the\n// --extra_compiler_args flag, exposed here for testing only.\nstd::vector<std::string> ParseCommandLine(absl::string_view commandLine);\n}  // namespace frontend_internal\n\n// Gets the index tool and arguments adjuster to be used with clang tooling to\n// perform indexing on a compilation database.\nstd::vector<std::pair<std::unique_ptr<clang::tooling::FrontendActionFactory>,\n                      clang::tooling::ArgumentsAdjuster>>\nGetIndexActions(FileCopier& file_copier, MergeQueue& merge_queue);\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_FRONTEND_FRONTEND_H_\n"
  },
  {
    "path": "infra/indexer/frontend/frontend_test.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/frontend/frontend.h\"\n\n#include <filesystem>  // NOLINT\n#include <fstream>\n#include <iostream>\n#include <memory>\n#include <optional>\n#include <sstream>\n#include <string>\n#include <string_view>\n#include <utility>\n#include <vector>\n\n#include \"indexer/frontend/index_action.h\"\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/index/types.h\"\n#include \"indexer/merge_queue.h\"\n#include \"gmock/gmock.h\"\n#include \"gtest/gtest.h\"\n#include \"absl/flags/declare.h\"\n#include \"absl/flags/flag.h\"\n#include \"absl/log/check.h\"\n#include \"clang/Tooling/Tooling.h\"\n\nABSL_DECLARE_FLAG(std::vector<std::string>, ignore_pragmas);\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace frontend_internal {\nusing ::testing::ElementsAre;\n\nTEST(ParseCommandLineTest, BasicWhitespaceSeparation) {\n  std::vector<std::string> args = ParseCommandLine(\"one two   three\\tfour\");\n  EXPECT_THAT(args, ElementsAre(\"one\", \"two\", \"three\", \"four\"));\n}\n\nTEST(ParseCommandLineTest, SingleQuotedWords) {\n  std::vector<std::string> args = ParseCommandLine(\"hello 'world' 'again '\");\n  EXPECT_THAT(args, ElementsAre(\"hello\", \"world\", \"again \"));\n}\n\nTEST(ParseCommandLineTest, DoubleQuotedWords) {\n  std::vector<std::string> args =\n      ParseCommandLine(\"test \\\"more words\\\" \\\"inside \\\" \");\n  EXPECT_THAT(args, ElementsAre(\"test\", \"more words\", \"inside \"));\n}\n\nTEST(ParseCommandLineTest, BackslashInsideSingleQuotes) {\n  std::vector<std::string> args = ParseCommandLine(\"prefix 'a\\\\b' 'c\\\\d'\");\n  EXPECT_THAT(args, ElementsAre(\"prefix\", \"a\\\\b\", \"c\\\\d\"));\n}\n\nTEST(ParseCommandLineTest, BackslashInsideDoubleQuotes) {\n  std::vector<std::string> args =\n      ParseCommandLine(\"item1 \\\"item2 \\\\' \\\\\\\"item3 \\\"\");\n  EXPECT_THAT(args, ElementsAre(\"item1\", \"item2 ' \\\"item3 \"));\n}\n\nTEST(ParseCommandLineTest, EscapedDoubleQuoteInsideDoubleQuotes) {\n  std::vector<std::string> args =\n      ParseCommandLine(\"value1 \\\"value2\\\\\\\" \\\\\\\"value3 \\\"\");\n  EXPECT_THAT(args, ElementsAre(\"value1\", \"value2\\\" \\\"value3 \"));\n}\n\nTEST(ParseCommandLineTest, UnterminatedDoubleQuote) {\n  std::vector<std::string> args = ParseCommandLine(\"start \\\"middle end '\");\n  EXPECT_THAT(args, ElementsAre(\"start\", \"middle end '\"));\n}\n\nTEST(ParseCommandLineTest, EmptyQuotedStrings) {\n  std::vector<std::string> args = ParseCommandLine(\"before '' \\\"\\\" after\");\n  EXPECT_THAT(args, ElementsAre(\"before\", \"\", \"\", \"after\"));\n}\n\nTEST(ParseCommandLineTest, HashInsideSingleQuotes) {\n  std::vector<std::string> args = ParseCommandLine(\"'#'\");\n  EXPECT_THAT(args, ElementsAre(\"#\"));\n}\n\nTEST(ParseCommandLineTest, HashInsideDoubleQuotes) {\n  std::vector<std::string> args = ParseCommandLine(\"another \\\"#\\\" here\");\n  EXPECT_THAT(args, ElementsAre(\"another\", \"#\", \"here\"));\n}\n\n}  // namespace frontend_internal\n\nnamespace {\ntypedef void (*TExtraSourceTreeAction)(const std::filesystem::path&);\n\nstd::unique_ptr<InMemoryIndex> GetSnippetIndex(\n    std::string code, const std::vector<std::string>& extra_args = {},\n    bool fail_on_error = false, TExtraSourceTreeAction extra_action = nullptr) {\n  auto source_dir = std::filesystem::path(::testing::TempDir()) / \"src\";\n  std::filesystem::remove_all(source_dir);\n  CHECK(std::filesystem::create_directory(source_dir));\n  {\n    std::ofstream source_file(source_dir / \"snippet.cc\");\n    source_file << code;\n    CHECK(source_file.good());\n  }\n  std::string source_file_path = (source_dir / \"snippet.cc\").string();\n  std::string source_dir_path = source_dir.string();\n\n  if (extra_action != nullptr) {\n    extra_action(source_dir);\n  }\n\n  auto index_dir = std::filesystem::path(::testing::TempDir()) / \"idx\";\n  std::filesystem::remove_all(index_dir);\n  CHECK(std::filesystem::create_directory(index_dir));\n  std::string index_dir_path = index_dir.string();\n  std::string sysroot_path = \"/\";\n  FileCopier file_copier(source_dir_path, index_dir_path, {sysroot_path});\n  std::unique_ptr<MergeQueue> merge_queue = MergeQueue::Create(1);\n  auto index_action = std::make_unique<IndexAction>(file_copier, *merge_queue);\n  const bool result = clang::tooling::runToolOnCodeWithArgs(\n      std::move(index_action), code, extra_args, source_file_path);\n  merge_queue->WaitUntilComplete();\n  auto index = merge_queue->TakeIndex();\n\n  if (fail_on_error && !result) {\n    return nullptr;\n  }\n\n  return index;\n}\n\nFlatIndex IndexSnippet(std::string code,\n                       const std::vector<std::string>& extra_args = {}) {\n  return std::move(*GetSnippetIndex(code, extra_args)).Export();\n}\n\nstd::string KindToString(Entity::Kind kind) {\n  if (kind == Entity::Kind::kMacro) {\n    return \"Macro\";\n  } else if (kind == Entity::Kind::kEnum) {\n    return \"Enum\";\n  } else if (kind == Entity::Kind::kEnumConstant) {\n    return \"EnumConstant\";\n  } else if (kind == Entity::Kind::kVariable) {\n    return \"Variable\";\n  } else if (kind == Entity::Kind::kFunction) {\n    return \"Function\";\n  } else if (kind == Entity::Kind::kClass) {\n    return \"Class\";\n  } else if (kind == Entity::Kind::kType) {\n    return \"Type\";\n  } else {\n    return \"Invalid\";\n  }\n}\n\nvoid PrintRequiredEntityParameters(const FlatIndex& index,\n                                   const Entity& entity) {\n  const auto& location = index.locations[entity.location_id()];\n  std::cerr << \"Entity::Kind::k\" << KindToString(entity.kind()) << \", \" << \"\\\"\"\n            << entity.name_prefix() << \"\\\", \" << \"\\\"\" << entity.name() << \"\\\", \"\n            << \"\\\"\" << entity.name_suffix() << \"\\\", \" << \"\\\"\" << location.path()\n            << \"\\\", \" << location.start_line() << \", \" << location.end_line();\n}\n\nvoid PrintAllEntityParameters(const FlatIndex& index, const Entity& entity);\n\nvoid PrintOptionalEntityParameters(const FlatIndex& index,\n                                   const Entity& entity) {\n  std::vector<const char*> preceding_defaults;\n  auto flush_preceding_defaults = [&preceding_defaults]() {\n    for (const auto& preceding_default : preceding_defaults) {\n      std::cerr << preceding_default;\n    }\n    preceding_defaults.clear();\n  };\n\n  if (entity.is_incomplete()) {\n    std::cerr << \", /*is_incomplete=*/true\";\n  } else {\n    preceding_defaults.push_back(\", /*is_incomplete=*/false\");\n  }\n\n  std::optional<SubstituteRelationship::Kind> substitute_relationship_kind =\n      (entity.substitute_relationship()\n           ? std::make_optional(entity.substitute_relationship()->kind())\n           : std::nullopt);\n  auto handle_substitute_relationship = [&](SubstituteRelationship::Kind kind,\n                                            const char* parameter_name) {\n    if (substitute_relationship_kind != kind) {\n      preceding_defaults.push_back(\", /*\");\n      preceding_defaults.push_back(parameter_name);\n      preceding_defaults.push_back(\"=*/std::nullopt\");\n      return;\n    }\n\n    flush_preceding_defaults();\n    std::cerr << \", /*\" << parameter_name << \"=*/RequiredEntityId(index, \";\n    const Entity& template_prototype_entity =\n        index\n            .entities[entity.substitute_relationship()->substitute_entity_id()];\n    PrintAllEntityParameters(index, template_prototype_entity);\n    std::cerr << \")\";\n  };\n  handle_substitute_relationship(\n      SubstituteRelationship::Kind::kIsTemplateInstantiationOf,\n      \"template_prototype_entity_id\");\n  handle_substitute_relationship(\n      SubstituteRelationship::Kind::kIsImplicitlyDefinedFor,\n      \"implicitly_defined_for_entity_id\");\n\n  if (entity.enum_value().has_value()) {\n    flush_preceding_defaults();\n    std::cerr << \", /*enum_value=*/\\\"\" << *entity.enum_value() << \"\\\"\";\n  } else {\n    preceding_defaults.push_back(\", /*enum_value=*/std::nullopt\");\n  }\n\n  handle_substitute_relationship(SubstituteRelationship::Kind::kIsInheritedFrom,\n                                 \"inherited_from_entity_id\");\n\n  switch (entity.virtual_method_kind()) {\n    // No default. Exhaustiveness checks will force us to handle new cases.\n    case Entity::VirtualMethodKind::kNotAVirtualMethod: {\n      preceding_defaults.push_back(\n          \", /*virtual_method_kind=*/\"\n          \"Entity::VirtualMethodKind::kNotAVirtualMethod\");\n    }; break;\n    case Entity::VirtualMethodKind::kPureVirtual: {\n      flush_preceding_defaults();\n      std::cerr\n          << \", \"\n             \"/*virtual_method_kind=*/Entity::VirtualMethodKind::kPureVirtual\";\n    }; break;\n    case Entity::VirtualMethodKind::kNonPureVirtual: {\n      flush_preceding_defaults();\n      std::cerr << \", /*virtual_method_kind=*/\"\n                   \"Entity::VirtualMethodKind::kNonPureVirtual\";\n    }; break;\n  }\n}\n\nvoid PrintAllEntityParameters(const FlatIndex& index, const Entity& entity) {\n  PrintRequiredEntityParameters(index, entity);\n  PrintOptionalEntityParameters(index, entity);\n}\n\n// Helper function for adding new tests, this will print all the potentially\n// valid `EXPECT...`s for a given index. These should be vetted and cleaned up\n// before adding to the test body. This should not be referenced in committed\n// tests.\nvoid PrintValidExpectations(\n    const FlatIndex& index,\n    std::optional<Entity::Kind> only_of_kind = std::nullopt,\n    bool omit_implicit = false) {\n  for (EntityId entity_id = 0; entity_id < index.entities.size(); ++entity_id) {\n    const auto& entity = index.entities[entity_id];\n    if (omit_implicit && entity.substitute_relationship() &&\n        entity.substitute_relationship()->kind() ==\n            SubstituteRelationship::Kind::kIsImplicitlyDefinedFor) {\n      continue;\n    }\n    if (only_of_kind && entity.kind() != *only_of_kind) {\n      continue;\n    }\n\n    const auto& location = index.locations[entity.location_id()];\n    if (location.path() == \"<built-in>\" ||\n        location.path() == \"<command line>\") {\n      continue;\n    }\n\n    std::cerr << \"EXPECT_HAS_ENTITY(index, \";\n    PrintAllEntityParameters(index, entity);\n    std::cerr << \");\\n\";\n\n    for (const auto& reference : index.references) {\n      if (reference.entity_id() == entity_id) {\n        const auto& ref_location = index.locations[reference.location_id()];\n        std::cerr << \"EXPECT_HAS_REFERENCE(index, \";\n        PrintRequiredEntityParameters(index, entity);\n        std::cerr << \", \\\"\" << ref_location.path() << \"\\\", \"\n                  << ref_location.start_line() << \", \"\n                  << ref_location.end_line();\n        PrintOptionalEntityParameters(index, entity);\n        std::cerr << \");\\n\";\n      }\n    }\n  }\n\n  for (const auto& link : index.virtual_method_links) {\n    const Entity& parent = index.entities[link.parent()];\n    const Entity& child = index.entities[link.child()];\n    std::cerr << \"EXPECT_HAS_VIRTUAL_LINK(index, \\\"\" << parent.full_name()\n              << \"\\\", \\\"\" << child.full_name() << \"\\\");\\n\";\n  }\n}\n\nvoid PrintEntity(std::ostream& stream, const FlatIndex& index,\n                 const Entity& entity, int padding = 0) {\n  const std::string indent(padding, ' ');\n  const auto& location = index.locations[entity.location_id()];\n  stream << indent << KindToString(entity.kind()) << \" `\"\n         << entity.name_prefix() << entity.name() << entity.name_suffix()\n         << \"`\\n\"\n         << indent\n         << (entity.is_incomplete() ? \"  Declared at \\\"\" : \"  Defined at \\\"\")\n         << location.path() << \"\\\" lines \" << location.start_line() << \"-\"\n         << location.end_line() << \"\\n\";\n  if (entity.substitute_relationship().has_value()) {\n    const SubstituteRelationship& relationship =\n        *entity.substitute_relationship();\n    switch (relationship.kind()) {\n      // No default. Exhaustiveness checks will force us to handle new cases.\n      case SubstituteRelationship::Kind::kIsTemplateInstantiationOf: {\n        stream << indent << \"  Template instantiation of:\\n\";\n      }; break;\n      case SubstituteRelationship::Kind::kIsImplicitlyDefinedFor: {\n        stream << indent << \"  Implicitly defined for:\\n\";\n      }; break;\n      case SubstituteRelationship::Kind::kIsInheritedFrom: {\n        stream << indent << \"  Inherited from:\\n\";\n      }; break;\n    }\n    const auto& substitute_entity =\n        index.entities[relationship.substitute_entity_id()];\n    PrintEntity(stream, index, substitute_entity, /*padding=*/padding + 4);\n  }\n  if (entity.enum_value().has_value()) {\n    stream << \"  Enum value: \" << *entity.enum_value() << \"\\n\";\n  }\n  switch (entity.virtual_method_kind()) {\n    case Entity::VirtualMethodKind::kNotAVirtualMethod:\n      break;\n    case Entity::VirtualMethodKind::kPureVirtual:\n      stream << indent << \"  Pure virtual\\n\";\n      break;\n    case Entity::VirtualMethodKind::kNonPureVirtual:\n      stream << indent << \"  Non-pure virtual\\n\";\n      break;\n  }\n}\n\nstd::string DebugPrintIndex(const FlatIndex& index) {\n  std::stringstream stream;\n  for (EntityId entity_id = 0; entity_id < index.entities.size(); ++entity_id) {\n    const auto& entity = index.entities[entity_id];\n    const auto& location = index.locations[entity.location_id()];\n    if (location.path().empty() || location.path() == \"<built-in>\" ||\n        location.path() == \"<command line>\") {\n      continue;\n    }\n\n    PrintEntity(stream, index, entity);\n\n    for (const auto& reference : index.references) {\n      if (reference.entity_id() == entity_id) {\n        const auto& ref_location = index.locations[reference.location_id()];\n        stream << \"  Referenced at \\\"\" << ref_location.path() << \"\\\" lines \"\n               << ref_location.start_line() << \"-\" << ref_location.end_line()\n               << \"\\n\";\n      }\n    }\n  }\n\n  if (!index.virtual_method_links.empty()) {\n    stream << \"Virtual method links:\\n\";\n    for (const auto& link : index.virtual_method_links) {\n      const Entity& parent = index.entities[link.parent()];\n      const Entity& child = index.entities[link.child()];\n      stream << \"  \" << parent.full_name() << \" -> \" << child.full_name()\n             << \"\\n\";\n    }\n  }\n\n  return stream.str();\n}\n\nvoid DumpIndex(const FlatIndex& index) { std::cerr << DebugPrintIndex(index); }\n\n[[maybe_unused]] void DumpAll(const FlatIndex& index) {\n  DumpIndex(index);\n  PrintValidExpectations(index);\n}\n\nstd::optional<SubstituteRelationship> GetSubstituteRelationship(\n    std::optional<EntityId> template_prototype_entity_id,\n    std::optional<EntityId> implicitly_defined_for_entity_id,\n    std::optional<EntityId> inherited_from_entity_id) {\n  auto count = [](const auto& optional) { return optional ? 1 : 0; };\n  auto substitutions = count(template_prototype_entity_id) +\n                       count(implicitly_defined_for_entity_id) +\n                       count(inherited_from_entity_id);\n  CHECK_LE(substitutions, 1)\n      << \"Multiple simultaneous substitutions are not allowed\";\n  if (template_prototype_entity_id) {\n    return SubstituteRelationship(\n        SubstituteRelationship::Kind::kIsTemplateInstantiationOf,\n        *template_prototype_entity_id);\n  }\n  if (implicitly_defined_for_entity_id) {\n    return SubstituteRelationship(\n        SubstituteRelationship::Kind::kIsImplicitlyDefinedFor,\n        *implicitly_defined_for_entity_id);\n  }\n  if (inherited_from_entity_id) {\n    return SubstituteRelationship(\n        SubstituteRelationship::Kind::kIsInheritedFrom,\n        *inherited_from_entity_id);\n  }\n  return std::nullopt;\n}\n\nstd::optional<Entity> FindEntity(\n    const FlatIndex& index, Entity::Kind kind, std::string name_prefix,\n    std::string name, std::string name_suffix, std::string path, int start_line,\n    int end_line, bool is_incomplete = false,\n    const std::optional<EntityId>& template_prototype_entity_id = std::nullopt,\n    const std::optional<EntityId>& implicitly_defined_for_entity_id =\n        std::nullopt,\n    const std::optional<std::string> enum_value = std::nullopt,\n    const std::optional<EntityId>& inherited_from_entity_id = std::nullopt,\n    Entity::VirtualMethodKind virtual_method_kind =\n        Entity::VirtualMethodKind::kNotAVirtualMethod) {\n  std::optional<Entity> entity;\n  for (LocationId location_id = 0; location_id < index.locations.size();\n       ++location_id) {\n    const auto& index_location = index.locations[location_id];\n    if (index_location.path() == path &&\n        index_location.start_line() == start_line &&\n        index_location.end_line() == end_line) {\n      entity = {kind,\n                name_prefix,\n                name,\n                name_suffix,\n                location_id,\n                is_incomplete,\n                /*is_weak=*/false,\n                GetSubstituteRelationship(template_prototype_entity_id,\n                                          implicitly_defined_for_entity_id,\n                                          inherited_from_entity_id),\n                enum_value,\n                virtual_method_kind};\n      break;\n    }\n  }\n\n  if (!entity.has_value()) {\n    return std::nullopt;\n  }\n\n  for (const auto& index_entity : index.entities) {\n    if (*entity == index_entity) {\n      return entity;\n    }\n  }\n\n  return std::nullopt;\n}\n\nbool IndexHasEntity(\n    const FlatIndex& index, Entity::Kind kind, std::string name_prefix,\n    std::string name, std::string name_suffix, std::string path, int start_line,\n    int end_line, bool is_incomplete = false,\n    const std::optional<EntityId>& template_prototype_entity_id = std::nullopt,\n    const std::optional<EntityId>& implicitly_defined_for_entity_id =\n        std::nullopt,\n    const std::optional<std::string> enum_value = std::nullopt,\n    const std::optional<EntityId>& inherited_from_entity_id = std::nullopt,\n    Entity::VirtualMethodKind virtual_method_kind =\n        Entity::VirtualMethodKind::kNotAVirtualMethod) {\n  return FindEntity(index, kind, name_prefix, name, name_suffix, path,\n                    start_line, end_line, is_incomplete,\n                    template_prototype_entity_id,\n                    implicitly_defined_for_entity_id, enum_value,\n                    inherited_from_entity_id, virtual_method_kind)\n      .has_value();\n}\n\nbool IndexHasReference(\n    const FlatIndex& index, Entity::Kind kind, std::string name_prefix,\n    std::string name, std::string name_suffix, std::string path, int start_line,\n    int end_line, std::string ref_path, int ref_start_line, int ref_end_line,\n    bool is_incomplete = false,\n    const std::optional<EntityId> template_prototype_entity_id = std::nullopt,\n    const std::optional<EntityId> implicitly_defined_for_entity_id =\n        std::nullopt,\n    const std::optional<std::string> enum_value = std::nullopt,\n    const std::optional<EntityId>& inherited_from_entity_id = std::nullopt,\n    Entity::VirtualMethodKind virtual_method_kind =\n        Entity::VirtualMethodKind::kNotAVirtualMethod) {\n  LocationId ref_location_id = kInvalidLocationId;\n  EntityId ref_entity_id = kInvalidEntityId;\n\n  std::optional<Entity> entity;\n  for (LocationId location_id = 0; location_id < index.locations.size();\n       ++location_id) {\n    const auto& index_location = index.locations[location_id];\n    if (index_location.path() == path &&\n        index_location.start_line() == start_line &&\n        index_location.end_line() == end_line) {\n      entity = {kind,\n                name_prefix,\n                name,\n                name_suffix,\n                location_id,\n                is_incomplete,\n                /*is_weak=*/false,\n                GetSubstituteRelationship(template_prototype_entity_id,\n                                          implicitly_defined_for_entity_id,\n                                          inherited_from_entity_id),\n                enum_value,\n                virtual_method_kind};\n    }\n\n    if (index_location.path() == ref_path &&\n        index_location.start_line() == ref_start_line &&\n        index_location.end_line() == ref_end_line) {\n      ref_location_id = location_id;\n    }\n  }\n\n  if (!entity.has_value()) {\n    return false;\n  }\n\n  for (EntityId entity_id = 0; entity_id < index.entities.size(); ++entity_id) {\n    const auto& index_entity = index.entities[entity_id];\n    if (*entity == index_entity) {\n      ref_entity_id = entity_id;\n    }\n  }\n\n  if (ref_entity_id == kInvalidEntityId ||\n      ref_location_id == kInvalidLocationId) {\n    return false;\n  }\n\n  for (const auto& reference : index.references) {\n    if (reference.entity_id() == ref_entity_id &&\n        reference.location_id() == ref_location_id) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nbool IndexHasVirtualMethodLink(const FlatIndex& index,\n                               std::string_view parent_full_name,\n                               std::string_view child_full_name) {\n  for (const auto& link : index.virtual_method_links) {\n    const Entity& parent = index.entities[link.parent()];\n    const Entity& child = index.entities[link.child()];\n    if (parent.full_name() == parent_full_name &&\n        child.full_name() == child_full_name) {\n      return true;\n    }\n  }\n  return false;\n}\n\ntemplate <typename... Args>\nstd::optional<EntityId> RequiredEntityId(const FlatIndex& index,\n                                         Args&&... args) {\n  auto entity = FindEntity(index, std::forward<Args>(args)...);\n  EXPECT_TRUE(entity.has_value());\n  if (!entity.has_value()) {\n    return std::nullopt;\n  }\n\n  for (EntityId entity_id = 0; entity_id < index.entities.size(); ++entity_id) {\n    const Entity& other_entity = index.entities[entity_id];\n    if (entity == other_entity) {\n      return entity_id;\n    }\n  }\n  return std::nullopt;\n}\n}  // anonymous namespace\n\n#define EXPECT_HAS_ENTITY(index, ...) \\\n  EXPECT_TRUE(IndexHasEntity(index, __VA_ARGS__)) << DebugPrintIndex(index)\n\n#define EXPECT_HAS_REFERENCE(index, ...) \\\n  EXPECT_TRUE(IndexHasReference(index, __VA_ARGS__)) << DebugPrintIndex(index)\n\n#define EXPECT_HAS_VIRTUAL_LINK(index, ...)                  \\\n  EXPECT_TRUE(IndexHasVirtualMethodLink(index, __VA_ARGS__)) \\\n      << DebugPrintIndex(index)\n\nTEST(FrontendTest, MacroDefinition) {\n  auto index = IndexSnippet(\"#define MACRO 1\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\", \"snippet.cc\",\n                    1, 1);\n}\n\nTEST(FrontendTest, MultilineMacroDefinition) {\n  auto index = IndexSnippet(\n      \"#define MACRO 1\\\\\\n\"\n      \"  + 2 + 3\\\\\\n\"\n      \"  + 4 + 5\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\", \"snippet.cc\",\n                    1, 3);\n}\n\nTEST(FrontendTest, MacroArgsDefinition) {\n  auto index = IndexSnippet(\"#define MACRO(x) (void)(x)\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\", \"snippet.cc\",\n                    1, 1);\n}\n\nTEST(FrontendTest, MacroVarargsDefinition) {\n  auto index = IndexSnippet(\"#define MACRO(...) (void)(__VA_ARGS__)\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\", \"snippet.cc\",\n                    1, 1);\n}\n\nTEST(FrontendTest, MacroExpansion) {\n  auto index = IndexSnippet(\n      \"#define MACRO 1\\n\"\n      \"constexpr int a = MACRO;\\n\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, MacroArgsExpansion) {\n  auto index = IndexSnippet(\n      \"#define MACRO(x) (x)\\n\"\n      \"constexpr int a = MACRO(1);\\n\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, MacroVarargsExpansion) {\n  auto index = IndexSnippet(\n      \"#define MACRO(...) __VA_ARGS__\\n\"\n      \"int MACRO(a, b, c);\\n\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, NestedMacroExpansion) {\n  auto index = IndexSnippet(\n      \"#define INNER_MACRO a\\n\"\n      \"#define OUTER_MACRO INNER_MACRO = 1\\n\"\n      \"constexpr int OUTER_MACRO;\\n\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"OUTER_MACRO\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"INNER_MACRO\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3);\n}\n\nTEST(FrontendTest, MultipleMacroExpansion) {\n  auto index = IndexSnippet(\n      \"#define INNER_MACRO(x) x\\n\"\n      \"#define OUTER_MACRO(x, y) INNER_MACRO(x) = y\\n\"\n      \"constexpr int OUTER_MACRO(a, 1);\\n\"\n      \"constexpr int OUTER_MACRO(b, 2);\\n\"\n      \"constexpr int OUTER_MACRO(c, 3);\\n\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"OUTER_MACRO\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"OUTER_MACRO\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"OUTER_MACRO\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"INNER_MACRO\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"INNER_MACRO\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kMacro, \"\", \"INNER_MACRO\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 5, 5);\n}\n\nTEST(FrontendTest, EnumDeclaration) {\n  auto index = IndexSnippet(\n      \"enum Enum {\\n\"\n      \"  kEnumConstant0 = 0,\\n\"\n      \"  kEnumConstant1 = 1,\\n\"\n      \"  kElaborateEnumConstant = \"\n      \"kEnumConstant0 * kEnumConstant1 - 7,\\n\"\n      \"};\\n\"\n      \"Enum enum_instance = kEnumConstant0;\\n\"\n      \"enum class LargeUnsigned : decltype(0ULL) {\\n\"\n      \"  kNonNegative = 0xffffffffffffffff,\\n\"\n      \"};\\n\"\n      \"enum class Huge : unsigned __int128 {\\n\"\n      \"  kValue = ~(unsigned __int128)(0),\\n\"\n      \"};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnum, \"\", \"Enum\", \"\", \"snippet.cc\", 1,\n                    5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant, \"\", \"kEnumConstant0\",\n                    \"\", \"snippet.cc\", 2, 2, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"0\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant, \"\", \"kEnumConstant1\",\n                    \"\", \"snippet.cc\", 3, 3, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"1\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant, \"\",\n                    \"kElaborateEnumConstant\", \"\", \"snippet.cc\", 4, 4,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"-7\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"enum_instance\", \"\",\n                    \"snippet.cc\", 6, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnum, \"\", \"Enum\", \"\", \"snippet.cc\",\n                       1, 5, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnumConstant, \"\", \"kEnumConstant0\",\n                       \"\", \"snippet.cc\", 2, 2, \"snippet.cc\", 6, 6,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/\"0\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant, \"Huge::\", \"kValue\", \"\",\n                    \"snippet.cc\", 11, 11, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"340282366920938463463374607431768211455\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant,\n                    \"LargeUnsigned::\", \"kNonNegative\", \"\", \"snippet.cc\", 8, 8,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"18446744073709551615\");\n}\n\nTEST(FrontendTest, EnumClassDeclaration) {\n  auto index = IndexSnippet(\n      \"enum class Enum : char {\\n\"\n      \"  kEnumConstant0 = 0,\\n\"\n      \"  kEnumConstant1 = 1,\\n\"\n      \"};\\n\"\n      \"Enum enum_instance = Enum::kEnumConstant0;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnum, \"\", \"Enum\", \"\", \"snippet.cc\", 1,\n                    4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant,\n                    \"Enum::\", \"kEnumConstant0\", \"\", \"snippet.cc\", 2, 2,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"0\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant,\n                    \"Enum::\", \"kEnumConstant1\", \"\", \"snippet.cc\", 3, 3,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"1\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"enum_instance\", \"\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnum, \"\", \"Enum\", \"\", \"snippet.cc\",\n                       1, 4, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnumConstant,\n                       \"Enum::\", \"kEnumConstant0\", \"\", \"snippet.cc\", 2, 2,\n                       \"snippet.cc\", 5, 5, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/\"0\");\n}\n\nTEST(FrontendTest, NamespacedEnumDeclaration) {\n  auto index = IndexSnippet(\n      \"namespace n {\\n\"\n      \"enum Enum {\\n\"\n      \"  kEnumConstant0 = 0,\\n\"\n      \"  kEnumConstant1 = 1,\\n\"\n      \"};\\n\"\n      \"Enum enum_instance0 = kEnumConstant0;\\n\"\n      \"}  // namespace n\\n\"\n      \"n::Enum enum_instance1 = n::kEnumConstant1;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnum, \"n::\", \"Enum\", \"\", \"snippet.cc\",\n                    2, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant, \"n::\", \"kEnumConstant0\",\n                    \"\", \"snippet.cc\", 3, 3, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"0\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant, \"n::\", \"kEnumConstant1\",\n                    \"\", \"snippet.cc\", 4, 4, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"1\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"n::\", \"enum_instance0\", \"\",\n                    \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"enum_instance1\", \"\",\n                    \"snippet.cc\", 8, 8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnum, \"n::\", \"Enum\", \"\",\n                       \"snippet.cc\", 2, 5, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnumConstant,\n                       \"n::\", \"kEnumConstant0\", \"\", \"snippet.cc\", 3, 3,\n                       \"snippet.cc\", 6, 6, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/\"0\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnum, \"n::\", \"Enum\", \"\",\n                       \"snippet.cc\", 2, 5, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnumConstant,\n                       \"n::\", \"kEnumConstant1\", \"\", \"snippet.cc\", 4, 4,\n                       \"snippet.cc\", 8, 8, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/\"1\");\n}\n\nTEST(FrontendTest, NamespacedEnumClassDeclaration) {\n  auto index = IndexSnippet(\n      \"namespace n {\\n\"\n      \"enum class Enum : char {\\n\"\n      \"  kEnumConstant0 = 0,\\n\"\n      \"  kEnumConstant1 = 1,\\n\"\n      \"};\\n\"\n      \"Enum enum_instance0 = Enum::kEnumConstant0;\\n\"\n      \"}  // namespace n\\n\"\n      \"n::Enum enum_instance1 = n::Enum::kEnumConstant1;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnum, \"n::\", \"Enum\", \"\", \"snippet.cc\",\n                    2, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant,\n                    \"n::Enum::\", \"kEnumConstant0\", \"\", \"snippet.cc\", 3, 3,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"0\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnumConstant,\n                    \"n::Enum::\", \"kEnumConstant1\", \"\", \"snippet.cc\", 4, 4,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/\"1\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"n::\", \"enum_instance0\", \"\",\n                    \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"enum_instance1\", \"\",\n                    \"snippet.cc\", 8, 8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnum, \"n::\", \"Enum\", \"\",\n                       \"snippet.cc\", 2, 5, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnumConstant,\n                       \"n::Enum::\", \"kEnumConstant0\", \"\", \"snippet.cc\", 3, 3,\n                       \"snippet.cc\", 6, 6, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/\"0\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnum, \"n::\", \"Enum\", \"\",\n                       \"snippet.cc\", 2, 5, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kEnumConstant,\n                       \"n::Enum::\", \"kEnumConstant1\", \"\", \"snippet.cc\", 4, 4,\n                       \"snippet.cc\", 8, 8, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/\"1\");\n}\n\nTEST(FrontendTest, VariableDeclaration) {\n  auto index = IndexSnippet(\n      \"int foo = 0;\\n\"\n      \"extern \\\"C\\\" int bar = 1;\\n\"\n      \"volatile int* const baz = nullptr;\\n\"\n      \"const int* (*qux)() = nullptr;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"qux\", \"\", \"snippet.cc\",\n                    4, 4);\n}\n\nTEST(FrontendTest, ArrayDeclaration) {\n  auto index = IndexSnippet(\n      \"const char foo[] = {\\n\"\n      \"  'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',\\n\"\n      \"  'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B',\\n\"\n      \"};\\n\"\n      \"const char* bar = \\\"AAAAAAAAA\\\"\\n\"\n      \"                  \\\"BBBBBBBBB\\\"\\n\"\n      \"                  \\\"CCCCCCCCC\\\";\\n\"\n      \"const char* baz = \\\"AAAAAAAAA\\\"\\\\\\n\"\n      \"                  \\\"BBBBBBBBB\\\"\\\\\\n\"\n      \"                  \\\"CCCCCCCCC\\\";\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    1, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    5, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    8, 10);\n}\n\nTEST(FrontendTest, AnonymousStructDeclaration) {\n  auto index = IndexSnippet(\n      \"struct {\\n\"\n      \"  int foo;\\n\"\n      \"} bar;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"(anonymous struct)\", \"\",\n                    \"snippet.cc\", 1, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable,\n                    \"(anonymous struct)::\", \"foo\", \"\", \"snippet.cc\", 2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    1, 3);\n}\n\nTEST(FrontendTest, ConstructorReference) {\n  auto index = IndexSnippet(\n      \"class TestClass {\\n\"\n      \" public:\\n\"\n      \"  TestClass() {}\\n\"\n      \"};\\n\"\n      \"template<typename T>\\n\"\n      \"class Template {\\n\"\n      \" public:\\n\"\n      \"  Template() {}\\n\"\n      \"};\\n\"\n      \"class Derived : public Template<int> {};\\n\"\n      \"int main() {\\n\"\n      \"  TestClass instance;\\n\"\n      \"  struct Test {} test;\\n\"\n      \"  Derived();\\n\"\n      \"}\\n\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction,\n                       \"TestClass::\", \"TestClass\", \"()\", \"snippet.cc\", 3, 3,\n                       \"snippet.cc\", 12, 12, /*is_incomplete=*/false);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Derived\", \"\",\n                       \"snippet.cc\", 10, 10, \"snippet.cc\", 14, 14,\n                       /*is_incomplete=*/false);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"Derived::\", \"Derived\",\n                       \"()\", \"snippet.cc\", 10, 10, \"snippet.cc\", 14, 14,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\",\n                                        \"Derived\", \"\", \"snippet.cc\", 10, 10));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"main()::Test::\", \"Test\", \"()\",\n      \"snippet.cc\", 13, 13, \"snippet.cc\", 13, 13, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"main()::\", \"Test\", \"\",\n                       \"snippet.cc\", 13, 13));\n}\n\nTEST(FrontendTest, NamespacedVariableDeclaration) {\n  auto index = IndexSnippet(\n      \"namespace n {\\n\"\n      \"int foo = 0;\\n\"\n      \"namespace {\\n\"\n      \"int bar = 1;\\n\"\n      \"}  // anonymous namespace\\n\"\n      \"}  // namespace n\\n\"\n      \"int baz = 2;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"n::\", \"foo\", \"\",\n                    \"snippet.cc\", 2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable,\n                    \"n::(anonymous namespace)::\", \"bar\", \"\", \"snippet.cc\", 4,\n                    4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    7, 7);\n}\n\nTEST(FrontendTest, FunctionDeclaration) {\n  auto index = IndexSnippet(\n      \"int foo();\\n\"\n      \"extern \\\"C\\\" int bar(int baz);\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"()\",\n                    \"snippet.cc\", 1, 1, /*is_incomplete=*/true);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"bar\", \"(int)\",\n                    \"snippet.cc\", 2, 2, /*is_incomplete=*/true);\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kVariable, \"\", \"baz\", \"\",\n                              \"snippet.cc\", 2, 2));\n}\n\nTEST(FrontendTest, FunctionDefinition) {\n  auto index = IndexSnippet(\n      \"extern int foo(int bar);\\n\"\n      \"int foo(int bar) {\\n\"\n      \"  int baz = bar;\\n\"\n      \"  return foo(baz) + bar;\\n\"\n      \"}\");\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kFunction, \"\", \"foo\",\n                              \"(int)\", \"snippet.cc\", 1, 1));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                              \"snippet.cc\", 1, 1));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"(int)\",\n                    \"snippet.cc\", 2, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"baz\", \"\",\n                       \"snippet.cc\", 3, 3, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"foo\", \"(int)\",\n                       \"snippet.cc\", 2, 5, \"snippet.cc\", 4, 4);\n}\n\nTEST(FrontendTest, MacroWrappedFunctionDefinition1) {\n  auto index = IndexSnippet(\n      \"#define MACRO(x, y, z) x y z\\n\"\n      \"MACRO(int, foo, (int bar)) {\\n\"\n      \"  return bar;\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"(int)\",\n                    \"snippet.cc\", 2, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n}\n\nTEST(FrontendTest, MacroWrappedFunctionDefinition2) {\n  auto index = IndexSnippet(\n      \"#define MACRO(x, y, z) x y ## z\\n\"\n      \"MACRO(void, foo, bar)() {\\n\"\n      \"  return;\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kMacro, \"\", \"MACRO\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foobar\", \"()\",\n                    \"snippet.cc\", 2, 4);\n}\n\nTEST(FrontendTest, VariadicFunctionDefinition) {\n  auto index = IndexSnippet(\n      \"void foo(int bar, ...) {\\n\"\n      \"}\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"(int, ...)\",\n                    \"snippet.cc\", 1, 2);\n}\n\nTEST(FrontendTest, CapturingLambdaDefinition) {\n  auto index = IndexSnippet(\n      \"void foo(int bar) {\\n\"\n      \"  auto baz = [bar](int xof) {\\n\"\n      \"    return bar + xof;\\n\"\n      \"  };\\n\"\n      \"}\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"(int)\",\n                    \"snippet.cc\", 1, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    2, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"xof\", \"\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"xof\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"foo(int)::\", \"lambda\",\n                    \"(int)\", \"snippet.cc\", 2, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"foo(int)::\", \"lambda\",\n                       \"(int)\", \"snippet.cc\", 2, 4, \"snippet.cc\", 2, 4);\n}\n\nTEST(FrontendTest, NonCapturingLambdaDefinition) {\n  auto index = IndexSnippet(\n      \"void foo(int bar) {\\n\"\n      \"  auto baz = [](int xof) {\\n\"\n      \"    return xof;\\n\"\n      \"  };\\n\"\n      \"}\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"(int)\",\n                    \"snippet.cc\", 1, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    2, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"xof\", \"\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"xof\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"foo(int)::\", \"lambda\",\n                    \"(int)\", \"snippet.cc\", 2, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"foo(int)::\", \"lambda\",\n                       \"(int)\", \"snippet.cc\", 2, 4, \"snippet.cc\", 2, 4);\n}\n\nTEST(FrontendTest, ClassDefinition) {\n  auto index = IndexSnippet(\n      \"class Foo;\\n\"\n      \"class Foo {\\n\"\n      \"  void bar();\\n\"\n      \"  void baz() const;\\n\"\n      \"};\\n\"\n      \"void Foo::bar() {\\n\"\n      \"}\\n\"\n      \"void Foo::baz() const {\\n\"\n      \"}\\n\"\n      \"class Bar;\\n\");\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kClass, \"\", \"Foo\", \"\",\n                              \"snippet.cc\", 1, 1));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 2,\n                    5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"bar\", \"()\",\n                    \"snippet.cc\", 6, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"baz\", \"() const\",\n                    \"snippet.cc\", 8, 9);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Bar\", \"\", \"snippet.cc\",\n                    10, 10, /*is_incomplete=*/true);\n}\n\nTEST(FrontendTest, LocalClassDefinition) {\n  auto index = IndexSnippet(\n      \"void foo() {\\n\"\n      \"  class Bar {\\n\"\n      \"   public:\\n\"\n      \"    void baz() {\\n\"\n      \"    }\\n\"\n      \"  } bar;\\n\"\n      \"  bar.baz();\\n\"\n      \"}\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"()\",\n                    \"snippet.cc\", 1, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"foo()::\", \"Bar\", \"\",\n                    \"snippet.cc\", 2, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"foo()::\", \"Bar\", \"\",\n                       \"snippet.cc\", 2, 6, \"snippet.cc\", 2, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"foo()::Bar::\", \"baz\", \"()\",\n                    \"snippet.cc\", 4, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"foo()::Bar::\", \"baz\",\n                       \"()\", \"snippet.cc\", 4, 5, \"snippet.cc\", 7, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    2, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 2, 6, \"snippet.cc\", 7, 7);\n}\n\nTEST(FrontendTest, Typedef) {\n  auto index = IndexSnippet(\n      \"typedef int foo;\\n\"\n      \"typedef struct Bar{\\n\"\n      \"} Baz;\\n\"\n      \"Baz baz;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Bar\", \"\", \"snippet.cc\", 2,\n                    3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Bar\", \"\", \"snippet.cc\",\n                       2, 3, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Baz\", \"\", \"snippet.cc\", 2,\n                    3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Baz\", \"\", \"snippet.cc\",\n                       2, 3, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"foo\", \"\", \"snippet.cc\", 1,\n                    1);\n}\n\nTEST(FrontendTest, Using) {\n  auto index = IndexSnippet(\n      \"using foo = int;\\n\"\n      \"using Bar = struct Baz{};\\n\"\n      \"Bar bar;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\", 2,\n                    2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\",\n                       2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Baz\", \"\", \"snippet.cc\", 2,\n                    2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Baz\", \"\", \"snippet.cc\",\n                       2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"foo\", \"\", \"snippet.cc\", 1,\n                    1);\n}\n\nTEST(FrontendTest, TypeTemplateClass) {\n  auto index = IndexSnippet(\n      \"template <typename T, class S>\\n\"\n      \"class Foo;\\n\"\n      \"template <typename T, class S>\\n\"\n      \"class Foo {\\n\"\n      \"  void bar();\\n\"\n      \"};\\n\"\n      \"template <typename T, class S>\\n\"\n      \"void Foo<T, S>::bar() {\\n\"\n      \"}\\n\"\n      \"Foo<int, int> baz;\\n\");\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T, S>\",\n                              \"snippet.cc\", 1, 2));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kType, \"Foo::\", \"T\", \"\",\n                              \"snippet.cc\", 1, 1));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kType, \"Foo::\", \"S\", \"\",\n                              \"snippet.cc\", 1, 1));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T, S>\",\n                    \"snippet.cc\", 3, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T, S>::\", \"T\", \"\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T, S>::\", \"S\", \"\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo<T, S>::\", \"bar\", \"()\",\n                    \"snippet.cc\", 7, 9);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, int>\",\n                    \"snippet.cc\", 3, 6, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<T, S>\", \"snippet.cc\", 3, 6));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, int>\",\n                       \"snippet.cc\", 3, 6, \"snippet.cc\", 10, 10,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<T, S>\", \"snippet.cc\", 3, 6));\n}\n\nTEST(FrontendTest, UsingTypeTemplateClass) {\n  auto index = IndexSnippet(\n      \"class Foo;\\n\"\n      \"template <typename T>\\n\"\n      \"class Bar {};\\n\"\n      \"using Baz = Bar<Foo*>;\\n\"\n      \"Baz* baz;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    1, /*is_incomplete=*/true);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 1, \"snippet.cc\", 4, 4, /*is_incomplete=*/true);\n  // TODO: Potential implicit reference.\n  EXPECT_FALSE(IndexHasReference(index, Entity::Kind::kClass, \"\", \"Foo\", \"\",\n                                 \"snippet.cc\", 1, 1, \"snippet.cc\", 5, 5,\n                                 /*is_incomplete=*/true));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Bar\", \"<T>\", \"snippet.cc\",\n                    2, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Bar\", \"<T>\",\n                       \"snippet.cc\", 2, 3, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Bar\", \"<T>\",\n                       \"snippet.cc\", 2, 3, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Bar<T>::\", \"T\", \"\",\n                    \"snippet.cc\", 2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Bar\", \"<Foo *>\",\n                    \"snippet.cc\", 2, 3, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Bar\",\n                                     \"<T>\", \"snippet.cc\", 2, 3));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Bar\", \"<Foo *>\",\n                       \"snippet.cc\", 2, 3, \"snippet.cc\", 4, 4,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Bar\",\n                                        \"<T>\", \"snippet.cc\", 2, 3));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Bar\", \"<Foo *>\",\n                       \"snippet.cc\", 2, 3, \"snippet.cc\", 5, 5,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Bar\",\n                                        \"<T>\", \"snippet.cc\", 2, 3));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Baz\", \"\", \"snippet.cc\", 4,\n                    4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Baz\", \"\", \"snippet.cc\",\n                       4, 4, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    5, 5);\n}\n\nTEST(FrontendTest, ValueTemplateClass) {\n  auto index = IndexSnippet(\n      \"template <char T, int S>\\n\"\n      \"class Foo {\\n\"\n      \"  void bar();\\n\"\n      \"};\\n\"\n      \"template <char T, int S>\\n\"\n      \"void Foo<T, S>::bar() {\\n\"\n      \"}\\n\"\n      \"Foo<'A', 99> baz;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<char, int>\",\n                    \"snippet.cc\", 1, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<char, int>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<char, int>::\", \"S\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo<char, int>::\", \"bar\",\n                    \"()\", \"snippet.cc\", 5, 7);\n\n  // TODO: For consistency, we'd probably want the following\n  // instead. However, due to the way that the AST handles template method\n  // definitions, this isn't possible without manually walking the AST; and if\n  // we add custom walking for template method definitions, we'd have to\n  // remove the standard handling for other template types, and manually walk\n  // those as well...\n\n  // EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable,\n  //                            \"Foo<char T, int S>::\", \"T\", \"\", \"snippet.cc\",\n  //                            5, 5));\n  // EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"Foo<char\n  // T, int S>::\", \"T\", \"\", \"snippet.cc\", 5, 5, \"snippet.cc\", 6, 6));\n  // EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable,\n  //                            \"Foo<char T, int S>::\", \"S\", \"\", \"snippet.cc\",\n  //                            5, 5));\n  // EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"Foo<char\n  // T, int S>::\", \"S\", \"\", \"snippet.cc\", 5, 5, \"snippet.cc\", 6, 6));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"S\", \"\", \"snippet.cc\",\n                    5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"S\", \"\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"T\", \"\", \"snippet.cc\",\n                    5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"T\", \"\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<'A', 99>\",\n                    \"snippet.cc\", 1, 4, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<char, int>\", \"snippet.cc\", 1, 4));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<'A', 99>\",\n                       \"snippet.cc\", 1, 4, \"snippet.cc\", 8, 8,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<char, int>\", \"snippet.cc\", 1, 4));\n}\n\nTEST(FrontendTest, TypeTemplateClassFullSpecialisation) {\n  auto index = IndexSnippet(\n      \"template <typename T>\\n\"\n      \"class Foo {\\n\"\n      \"};\\n\"\n      \"template <>\\n\"\n      \"class Foo<int> {\\n\"\n      \"  int foo;\\n\"\n      \"};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\", \"snippet.cc\",\n                    1, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 4, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<int>::\", \"foo\", \"\",\n                    \"snippet.cc\", 6, 6);\n}\n\nTEST(FrontendTest, ValueTemplateClassFullSpecialisation) {\n  auto index = IndexSnippet(\n      \"template <int T>\\n\"\n      \"class Foo {\\n\"\n      \"};\\n\"\n      \"template <>\\n\"\n      \"class Foo<99> {\\n\"\n      \"  int foo;\\n\"\n      \"};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 1, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<int>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<99>\",\n                    \"snippet.cc\", 4, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<99>::\", \"foo\", \"\",\n                    \"snippet.cc\", 6, 6);\n}\n\nTEST(FrontendTest, TypeTemplateClassPartialSpecialisation) {\n  auto index = IndexSnippet(\n      \"template <typename T, typename S>\\n\"\n      \"class Foo {\\n\"\n      \"  S bar;\\n\"\n      \"};\\n\"\n      \"template <typename T>\\n\"\n      \"class Foo<T, int> {\\n\"\n      \"  T bar;\\n\"\n      \"};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T, S>\",\n                    \"snippet.cc\", 1, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T, S>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T, S>::\", \"S\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<T, S>::\", \"bar\", \"\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"Foo<T, S>::\", \"S\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T, int>\",\n                    \"snippet.cc\", 5, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T, int>::\", \"T\", \"\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<T, int>::\", \"bar\", \"\",\n                    \"snippet.cc\", 7, 7);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"Foo<T, int>::\", \"T\", \"\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 7, 7);\n}\n\nTEST(FrontendTest, ValueTemplateClassPartialSpecialisation) {\n  auto index = IndexSnippet(\n      \"template <int T, char S>\\n\"\n      \"class Foo {\\n\"\n      \"  int bar = S;\\n\"\n      \"};\\n\"\n      \"template <int T>\\n\"\n      \"class Foo<T, 'A'> {\\n\"\n      \"  int bar = T;\\n\"\n      \"};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, char>\",\n                    \"snippet.cc\", 1, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<int, char>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<int, char>::\", \"S\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"Foo<int, char>::\", \"S\",\n                       \"\", \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T, 'A'>\",\n                    \"snippet.cc\", 5, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<T, 'A'>::\", \"bar\", \"\",\n                    \"snippet.cc\", 7, 7);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"Foo<T, 'A'>::\", \"T\", \"\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 7, 7);\n}\n\nTEST(FrontendTest, TypeTemplateFunction) {\n  auto index = IndexSnippet(\n      \"template <typename T>\\n\"\n      \"void foo(T bar) {\\n\"\n      \"};\\n\"\n      \"void baz() {\\n\"\n      \"  foo(0);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"<T>(T)\",\n                    \"snippet.cc\", 1, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"<int>(int)\",\n                    \"snippet.cc\", 1, 3,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"foo\",\n                                     \"<T>(T)\", \"snippet.cc\", 1, 3));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"foo<T>(T)::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"foo<T>(T)::\", \"T\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"baz\", \"()\",\n                    \"snippet.cc\", 4, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"foo\", \"<int>(int)\",\n                       \"snippet.cc\", 1, 3, \"snippet.cc\", 5, 5,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kFunction, \"\",\n                                        \"foo\", \"<T>(T)\", \"snippet.cc\", 1, 3));\n}\n\nTEST(FrontendTest, ValueTemplateFunction) {\n  auto index = IndexSnippet(\n      \"template <int T>\\n\"\n      \"int foo(int bar) {\\n\"\n      \"  return bar + T;\\n\"\n      \"};\\n\"\n      \"void baz() {\\n\"\n      \"  foo<88>(0);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"<int>(int)\",\n                    \"snippet.cc\", 1, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"foo<int>(int)::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"foo<int>(int)::\", \"T\",\n                       \"\", \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"baz\", \"()\",\n                    \"snippet.cc\", 5, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"<88>(int)\",\n                    \"snippet.cc\", 1, 4, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"foo\",\n                                     \"<int>(int)\", \"snippet.cc\", 1, 4));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"\", \"foo\", \"<88>(int)\", \"snippet.cc\", 1,\n      4, \"snippet.cc\", 6, 6, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"foo\", \"<int>(int)\",\n                       \"snippet.cc\", 1, 4));\n}\n\nTEST(FrontendTest, TemplateTemplateFunction) {\n  auto index = IndexSnippet(\n      \"template <class T>\\n\"\n      \"class Foo {\\n\"\n      \"};\\n\"\n      \"template <template<class> class S, class T>\\n\"\n      \"void bar(const S<T>& baz) {\\n\"\n      \"};\\n\"\n      \"void qux() {\\n\"\n      \"  Foo<int> foo;\\n\"\n      \"  bar(foo);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\", \"snippet.cc\",\n                    1, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 1, 3,\n                    /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<T>\", \"snippet.cc\", 1, 3));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\", \"snippet.cc\", 1, 3,\n      \"snippet.cc\", 8, 8,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\",\n                       \"snippet.cc\", 1, 3));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"bar\",\n                    \"<S, T>(const S<T> &)\", \"snippet.cc\", 4, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType,\n                    \"bar<S, T>(const S<T> &)::\", \"T\", \"\", \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"\", \"bar\", \"<Foo, int>(const Foo<int> &)\",\n      \"snippet.cc\", 4, 6,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"bar\",\n                       \"<S, T>(const S<T> &)\", \"snippet.cc\", 4, 6));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"\", \"bar\", \"<Foo, int>(const Foo<int> &)\",\n      \"snippet.cc\", 4, 6, \"snippet.cc\", 9, 9,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"bar\",\n                       \"<S, T>(const S<T> &)\", \"snippet.cc\", 4, 6));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    8, 8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                       \"snippet.cc\", 8, 8, \"snippet.cc\", 9, 9);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"qux\", \"()\",\n                    \"snippet.cc\", 7, 10);\n}\n\nTEST(FrontendTest, TemplateParameterPackFunction) {\n  auto index = IndexSnippet(\n      \"template <class... T>\\n\"\n      \"void foo(T... args) {\\n\"\n      \"}\\n\"\n      \"void bar() {\\n\"\n      \"  foo(1, 2);\\n\"\n      \"  foo(\\\"aaaaa\\\", 2, \\\"bbbb\\\");\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"\", \"foo\",\n      \"<const char *, int, const char *>(const char *, int, const char *)\",\n      \"snippet.cc\", 1, 3,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"foo\",\n                       \"<T...>(T...)\", \"snippet.cc\", 1, 3));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"\", \"foo\",\n      \"<const char *, int, const char *>(const char *, int, const char *)\",\n      \"snippet.cc\", 1, 3, \"snippet.cc\", 6, 6, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"foo\",\n                       \"<T...>(T...)\", \"snippet.cc\", 1, 3));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\",\n                    \"<int, int>(int, int)\", \"snippet.cc\", 1, 3,\n                    /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"foo\",\n                                     \"<T...>(T...)\", \"snippet.cc\", 1, 3));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"\", \"foo\", \"<int, int>(int, int)\",\n      \"snippet.cc\", 1, 3, \"snippet.cc\", 5, 5, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"\", \"foo\",\n                       \"<T...>(T...)\", \"snippet.cc\", 1, 3));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"<T...>(T...)\",\n                    \"snippet.cc\", 1, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"foo<T...>(T...)::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n}\n\nTEST(FrontendTest, FunctionScopedClassDefinition) {\n  auto index = IndexSnippet(\n      \"namespace foo {\\n\"\n      \"void bar() {\\n\"\n      \"  class Baz {};\\n\"\n      \"};\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"foo::\", \"bar\", \"()\",\n                    \"snippet.cc\", 2, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"foo::bar()::\", \"Baz\", \"\",\n                    \"snippet.cc\", 3, 3);\n}\n\nTEST(FrontendTest, OperatorOverloads) {\n  auto index = IndexSnippet(\n      \"struct Foo {\\n\"\n      \"  operator int() {\\n\"\n      \"    return 0;\\n\"\n      \"  }\\n\"\n      \"  Foo& operator+=(const Foo& other) {\\n\"\n      \"    return *this;\\n\"\n      \"  }\\n\"\n      \"};\\n\"\n      \"int main() {\\n\"\n      \"  Foo foo;\\n\"\n      \"  Foo bar;\\n\"\n      \"  foo += bar;\\n\"\n      \"  return foo;\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 8, \"snippet.cc\", 10, 10);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 8, \"snippet.cc\", 11, 11);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    11, 11);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                       \"snippet.cc\", 11, 11, \"snippet.cc\", 12, 12);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    10, 10);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                       \"snippet.cc\", 10, 10, \"snippet.cc\", 12, 12);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                       \"snippet.cc\", 10, 10, \"snippet.cc\", 13, 13);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 9, 14);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"other\", \"\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"operator int\",\n                    \"()\", \"snippet.cc\", 2, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"Foo::\", \"operator int\",\n                       \"()\", \"snippet.cc\", 2, 4, \"snippet.cc\", 13, 13);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Foo::\", \"operator+=\", \"(const Foo &)\", \"snippet.cc\", 5, 7);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction,\n                       \"Foo::\", \"operator+=\", \"(const Foo &)\", \"snippet.cc\", 5,\n                       7, \"snippet.cc\", 12, 12);\n}\n\nTEST(FrontendTest, NoIdentifierOperator) {\n  // This causes some interesting stuff to happen with identifiers, as the\n  // operator== doesn't have an identifier for the name. Not clear on why this\n  // is different to the operator overloading testcase.\n  auto index = IndexSnippet(\n      \"template<typename T>\\n\"\n      \"class Foo {};\\n\"\n      \"template<typename T>\\n\"\n      \"inline bool\\n\"\n      \"operator==(const Foo<T>& lhs, const Foo<T>& rhs)\\n\"\n      \"{ return &lhs == &rhs; }\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\", \"snippet.cc\",\n                    1, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"lhs\", \"\", \"snippet.cc\",\n                    5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"lhs\", \"\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\",\n                    \"operator==\", \"<T>(const Foo<T> &, const Foo<T> &)\",\n                    \"snippet.cc\", 3, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"rhs\", \"\", \"snippet.cc\",\n                    5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"rhs\", \"\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType,\n                    \"operator==<T>(const Foo<T> &, const Foo<T> &)::\", \"T\", \"\",\n                    \"snippet.cc\", 3, 3);\n}\n\nTEST(FrontendTest, PointerToStruct) {\n  auto index = IndexSnippet(\n      \"struct Foo {\\n\"\n      \"  int field;\\n\"\n      \"};\\n\"\n      \"extern void f(const Foo*);\\n\"\n      \"int main() {\\n\"\n      \"  const Foo* const* foo_ptr = nullptr;\\n\"\n      \"  f(*foo_ptr);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 3, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 3, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"f\", \"(const Foo *)\",\n                    \"snippet.cc\", 4, 4, /*is_incomplete=*/true);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"f\", \"(const Foo *)\",\n                       \"snippet.cc\", 4, 4, \"snippet.cc\", 7, 7,\n                       /*is_incomplete=*/true);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo_ptr\", \"\",\n                    \"snippet.cc\", 6, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo_ptr\", \"\",\n                       \"snippet.cc\", 6, 6, \"snippet.cc\", 7, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 5, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo::\", \"field\", \"\",\n                    \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, PointerToType) {\n  auto index = IndexSnippet(\n      \"typedef struct FooStruct {} Foo;\\n\"\n      \"using Bar = int;\\n\"\n      \"int main() {\\n\"\n      \"  Foo* foo_ptr = nullptr;\\n\"\n      \"  Bar* bar_ptr = nullptr;\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\", 2,\n                    2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\",\n                       2, 2, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 1, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"FooStruct\", \"\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"FooStruct\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar_ptr\", \"\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo_ptr\", \"\",\n                    \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 3, 6);\n}\n\nTEST(FrontendTest, ReferenceToStruct) {\n  auto index = IndexSnippet(\n      \"struct Foo {\\n\"\n      \"  int field;\\n\"\n      \"};\\n\"\n      \"extern void f(Foo&);\\n\"\n      \"int main() {\\n\"\n      \"  Foo foo;\\n\"\n      \"  Foo& foo_ref = foo;\\n\"\n      \"  f(foo_ref);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 3, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"f\", \"(Foo &)\",\n                    \"snippet.cc\", 4, 4, /*is_incomplete=*/true);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"f\", \"(Foo &)\",\n                       \"snippet.cc\", 4, 4, \"snippet.cc\", 8, 8,\n                       /*is_incomplete=*/true);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    6, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                       \"snippet.cc\", 6, 6, \"snippet.cc\", 7, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo_ref\", \"\",\n                    \"snippet.cc\", 7, 7);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo_ref\", \"\",\n                       \"snippet.cc\", 7, 7, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 5, 9);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo::\", \"field\", \"\",\n                    \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, ReferenceToReturnType) {\n  auto index = IndexSnippet(\n      \"struct Foo {\\n\"\n      \"  int bar;\\n\"\n      \"};\\n\"\n      \"Foo* baz() {\\n\"\n      \"  return nullptr;\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 3, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"baz\", \"()\",\n                    \"snippet.cc\", 4, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo::\", \"bar\", \"\",\n                    \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, ReferenceToSizeof) {\n  auto index = IndexSnippet(\n      \"struct Foo {\\n\"\n      \"  int bar;\\n\"\n      \"} foo;\\n\"\n      \"int size_1 = (int)sizeof(struct Foo);\\n\"\n      \"int size_2 = (int)sizeof(foo);\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo::\", \"bar\", \"\",\n                    \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 3, \"snippet.cc\", 1, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 3, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    1, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                       \"snippet.cc\", 1, 3, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"size_1\", \"\",\n                    \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"size_2\", \"\",\n                    \"snippet.cc\", 5, 5);\n}\n\nTEST(FrontendTest, DeletedConstructor) {\n  auto index = IndexSnippet(\n      \"class Foo {\\n\"\n      \"  Foo(const Foo&) = delete;\\n\"\n      \"  Foo(Foo&&) = delete;\\n\"\n      \"  Foo& operator=(const Foo&) = delete;\\n\"\n      \"};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    5);\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kFunction, \"Foo::\", \"Foo\",\n                              \"(Foo &&)\", \"snippet.cc\", 3, 3,\n                              /*is_incomplete=*/true));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kFunction, \"Foo::\", \"Foo\",\n                              \"(const Foo &)\", \"snippet.cc\", 2, 2,\n                              /*is_incomplete=*/true));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kFunction,\n                              \"Foo::\", \"operator=\", \"(const Foo &)\",\n                              \"snippet.cc\", 4, 4, /*is_incomplete=*/true));\n}\n\nTEST(FrontendTest, PureVirtualMethod) {\n  auto index = IndexSnippet(\n      \"class Foo {\\n\"\n      \"  virtual void Bar() = 0;\\n\"\n      \"};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    3);\n  // Pure virtual methods are complete, even though they have no body.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"Bar\", \"()\",\n                    \"snippet.cc\", 2, 2, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/std::nullopt,\n                    /*inherited_from_entity_id=*/std::nullopt,\n                    Entity::VirtualMethodKind::kPureVirtual);\n}\n\nTEST(FrontendTest, OverriddenMethod) {\n  auto index = IndexSnippet(\n      \"class Foo {\\n\"                  // 1\n      \" public:\\n\"                     // 2\n      \"  virtual void Bar() {\\n\"       // 3\n      \"  }\\n\"                          // 4\n      \"};\\n\"                           // 5\n      \"class Baz : public Foo {\\n\"     // 6\n      \" public:\\n\"                     // 7\n      \"  // No override\\n\"             // 8\n      \"  // of `Bar()`\\n\"              // 9\n      \"};\\n\"                           // 10\n      \"class Foobar : public Baz {\\n\"  // 11\n      \" public:\\n\"                     // 12\n      \"  void Bar() override {\\n\"      // 13\n      \"  }\\n\"                          // 14\n      \"};\\n\"                           // 15\n      \"int main() {\\n\"                 // 16\n      \"  Foo* foo = new Foobar;\\n\"     // 17\n      \"  foo->Bar();\\n\"                // 18\n      \"};\\n\");                         // 19\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 5, \"snippet.cc\", 6, 10);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 5, \"snippet.cc\", 17, 17);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 5, \"snippet.cc\", 18, 18);\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Baz\", \"\", \"snippet.cc\", 6,\n                    10);\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"Bar\", \"()\",\n                    \"snippet.cc\", 3, 4, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/std::nullopt,\n                    /*inherited_from_entity_id=*/std::nullopt,\n                    Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"Foo::\", \"Bar\", \"()\",\n                       \"snippet.cc\", 3, 4, \"snippet.cc\", 18, 18,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual);\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foobar\", \"\", \"snippet.cc\",\n                    11, 15);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foobar\", \"\",\n                       \"snippet.cc\", 11, 15, \"snippet.cc\", 17, 17);\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foobar::\", \"Bar\", \"()\",\n                    \"snippet.cc\", 13, 14, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/std::nullopt,\n                    /*inherited_from_entity_id=*/std::nullopt,\n                    Entity::VirtualMethodKind::kNonPureVirtual);\n  // We should have a cross-reference from the overridden method definition to\n  // the base method definition.\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"Foo::\", \"Bar\", \"()\", \"snippet.cc\", 3, 4,\n      \"snippet.cc\", 13, 14,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"Baz::\", \"Bar\", \"()\", \"snippet.cc\", 3, 4,\n      /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo::\", \"Bar\", \"()\",\n                       \"snippet.cc\", 3, 4,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual),\n      Entity::VirtualMethodKind::kNonPureVirtual);\n\n  EXPECT_EQ(index.virtual_method_links.size(), 2);\n  EXPECT_HAS_VIRTUAL_LINK(index, \"Foo::Bar()\", \"Baz::Bar()\");\n  EXPECT_HAS_VIRTUAL_LINK(index, \"Baz::Bar()\", \"Foobar::Bar()\");\n}\n\nTEST(FrontendTest, CursedInheritance) {\n  auto index = IndexSnippet(\n      \"namespace ns {\\n\"                      // 1\n      \" struct Base {\\n\"                      // 2\n      \"  void foo() {}\\n\"                     // 3\n      \"  int foo(int) { return 7; }\\n\"        // 4\n      \"  int a;\\n\"                            // 5\n      \"  char Deriv() { return ' '; }\\n\"      // 6\n      \" }; \\n\"                                // 7\n      \"}\\n\"                                   // 8\n      \"struct Deriv : ns::Base {\\n\"           // 9\n      \"  void foo() {}\\n\"                     // 10\n      \"  void foo(char*) {}\\n\"                // 11\n      \"  void foo(int[]) {}\\n\"                // 12\n      \"  int a;\\n\"                            // 13\n      \"};\\n\"                                  // 14\n      \"struct DerivDeriv : public Deriv {\\n\"  // 15\n      \"};\\n\"                                  // 16\n      \"\\n\"                                    // 17\n      \"int main() {\\n\"                        // 18\n      \"  DerivDeriv().ns::Base::foo(3);\\n\"    // 19\n      \"  (void)DerivDeriv().ns::Base::a;\\n\"   // 20\n      \"  Deriv d = DerivDeriv::Deriv();\\n\"    // 21\n      \"}\");                                   // 22\n  // Ensure we have a full set of overloads from `Deriv::foo`.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"DerivDeriv::\", \"foo\", \"()\",\n                    \"snippet.cc\", 10, 10, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"Deriv::\",\n                                     \"foo\", \"()\", \"snippet.cc\", 10, 10));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"DerivDeriv::\", \"foo\",\n                    \"(char *)\", \"snippet.cc\", 11, 11, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"Deriv::\",\n                                     \"foo\", \"(char *)\", \"snippet.cc\", 11, 11));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"DerivDeriv::\", \"foo\",\n                    \"(int *)\", \"snippet.cc\", 12, 12, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"Deriv::\",\n                                     \"foo\", \"(int *)\", \"snippet.cc\", 12, 12));\n  // The overload in `Base` is shadowed. We do not support `.ns::Base::foo`.\n  EXPECT_FALSE(IndexHasEntity(\n      index, Entity::Kind::kFunction, \"DerivDeriv::\", \"foo\", \"(int)\",\n      \"snippet.cc\", 12, 12, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"ns::Base::\", \"foo\",\n                       \"(int)\", \"snippet.cc\", 4, 4)));\n  // Unqualified `a` is inherited from `Deriv`. We don't support `.ns::Base::a`.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"DerivDeriv::\", \"a\", \"\",\n                    \"snippet.cc\", 13, 13, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/std::nullopt,\n                    /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kVariable,\n                                     \"Deriv::\", \"a\", \"\", \"snippet.cc\", 13, 13));\n  // However, the references via such qualifications are still tracked.\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"ns::Base::\", \"a\", \"\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 20, 20);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"ns::Base::\", \"foo\",\n                       \"(int)\", \"snippet.cc\", 4, 4, \"snippet.cc\", 19, 19);\n  // There are no virtual methods involved.\n  EXPECT_TRUE(index.virtual_method_links.empty());\n}\n\nTEST(FrontendTest, MoreCursedInheritance) {\n  auto index = IndexSnippet(\n      \"struct A {\\n\"                                 // 1\n      \"  virtual char* foo() { return nullptr; }\\n\"  // 2\n      \"  virtual void moo() {}\\n\"                    // 3\n      \"  virtual void bar() = 0;\\n\"                  // 4\n      \"};\\n\"                                         // 5\n      \"struct B {\\n\"                                 // 6\n      \"  virtual int* foo() { return nullptr; }\\n\"   // 7\n      \"  virtual int moo(int) { return 13; }\\n\"      // 8\n      \"  virtual void bar() = 0;\\n\"                  // 9\n      \"};\\n\"                                         // 10\n      \"struct C: A, B {\\n\"                           // 11\n      \"  void moo() override {}\\n\"                   // 12\n      \"  void bar() override {}\\n\"                   // 13\n      \"};\\n\"                                         // 14\n      \"struct D: C {\\n\"                              // 15\n      \"  int moo(int) override { return 666; }\\n\"    // 16\n      \"};\\n\"                                         // 17\n      \"int main() {\\n\"                               // 18\n      \"  D().A::foo(); D().B::foo();\\n\"              // 19\n      \"  D().moo(3);\\n\"                              // 20\n      \"  D().bar();\\n\"                               // 21\n      \"  struct E: D { void moo() override {} };\\n\"  // 22\n      \"}\\n\");                                        // 23\n\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"A::\", \"bar\", \"()\", \"snippet.cc\", 4, 4,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"A::\", \"foo\", \"()\", \"snippet.cc\", 2, 2,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"A::\", \"moo\", \"()\", \"snippet.cc\", 3, 3,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"B::\", \"bar\", \"()\", \"snippet.cc\", 9, 9,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"B::\", \"foo\", \"()\", \"snippet.cc\", 7, 7,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"B::\", \"moo\", \"(int)\", \"snippet.cc\", 8, 8,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"C::\", \"bar\", \"()\", \"snippet.cc\", 13, 13,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"C::\", \"moo\", \"()\", \"snippet.cc\", 12, 12,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"D::\", \"bar\", \"()\", \"snippet.cc\", 13, 13,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kFunction, \"C::\", \"bar\", \"()\", \"snippet.cc\", 13,\n          13, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/std::nullopt,\n          /*implicitly_defined_for_entity_id=*/std::nullopt,\n          /*enum_value=*/std::nullopt,\n          /*inherited_from_entity_id=*/std::nullopt,\n          /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual),\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"D::\", \"moo\", \"(int)\", \"snippet.cc\", 16,\n      16, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"main()::E::\", \"bar\", \"()\", \"snippet.cc\",\n      13, 13, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kFunction, \"C::\", \"bar\", \"()\", \"snippet.cc\", 13,\n          13, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/std::nullopt,\n          /*implicitly_defined_for_entity_id=*/std::nullopt,\n          /*enum_value=*/std::nullopt,\n          /*inherited_from_entity_id=*/std::nullopt,\n          /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual),\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"main()::E::\", \"moo\", \"()\", \"snippet.cc\",\n      22, 22, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"A::\", \"bar\", \"()\", \"snippet.cc\", 4, 4,\n      \"snippet.cc\", 13, 13, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"A::\", \"foo\", \"()\", \"snippet.cc\", 2, 2,\n      \"snippet.cc\", 19, 19, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"A::\", \"moo\", \"()\", \"snippet.cc\", 3, 3,\n      \"snippet.cc\", 12, 12, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"B::\", \"bar\", \"()\", \"snippet.cc\", 9, 9,\n      \"snippet.cc\", 13, 13, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"B::\", \"foo\", \"()\", \"snippet.cc\", 7, 7,\n      \"snippet.cc\", 19, 19, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"B::\", \"moo\", \"(int)\", \"snippet.cc\", 8, 8,\n      \"snippet.cc\", 16, 16, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"C::\", \"bar\", \"()\", \"snippet.cc\", 13, 13,\n      \"snippet.cc\", 21, 21, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"C::\", \"moo\", \"()\", \"snippet.cc\", 12, 12,\n      \"snippet.cc\", 22, 22, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"D::\", \"moo\", \"(int)\", \"snippet.cc\", 16,\n      16, \"snippet.cc\", 20, 20, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n\n  // `C::foo` is ambiguous, so we omit it.\n  EXPECT_FALSE(IndexHasEntity(\n      index, Entity::Kind::kFunction, \"C::\", \"foo\", \"()\", \"snippet.cc\", 2, 2,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"A::\", \"foo\", \"()\",\n                       \"snippet.cc\", 2, 2, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual),\n      Entity::VirtualMethodKind::kNonPureVirtual));\n  EXPECT_FALSE(IndexHasEntity(\n      index, Entity::Kind::kFunction, \"C::\", \"foo\", \"()\", \"snippet.cc\", 7, 7,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"B::\", \"foo\", \"()\",\n                       \"snippet.cc\", 7, 7, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual),\n      Entity::VirtualMethodKind::kNonPureVirtual));\n  // `C::moo(int)` is not available as an overload in `C` because of `C::moo()`.\n  EXPECT_FALSE(IndexHasEntity(\n      index, Entity::Kind::kFunction, \"C::\", \"moo\", \"(int)\", \"snippet.cc\", 8, 8,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"B::\", \"moo\", \"(int)\",\n                       \"snippet.cc\", 8, 8, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual),\n      Entity::VirtualMethodKind::kNonPureVirtual));\n  // ...And `D::moo()` is not available as an overload in `D` due to `moo(int)`.\n  EXPECT_FALSE(IndexHasEntity(\n      index, Entity::Kind::kFunction, \"D::\", \"moo\", \"()\", \"snippet.cc\", 3, 3,\n      /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt,\n      /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"A::\", \"moo\", \"()\",\n                       \"snippet.cc\", 3, 3, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual),\n      Entity::VirtualMethodKind::kNonPureVirtual));\n\n  EXPECT_EQ(index.virtual_method_links.size(), 7);\n  EXPECT_HAS_VIRTUAL_LINK(index, \"A::bar()\", \"C::bar()\");\n  EXPECT_HAS_VIRTUAL_LINK(index, \"B::bar()\", \"C::bar()\");\n  EXPECT_HAS_VIRTUAL_LINK(index, \"C::bar()\", \"D::bar()\");\n  EXPECT_HAS_VIRTUAL_LINK(index, \"D::bar()\", \"main()::E::bar()\");\n\n  EXPECT_HAS_VIRTUAL_LINK(index, \"A::moo()\", \"C::moo()\");\n  // There's no `C::moo()` -> `D::moo()` link because `D::moo(int)` shadows it.\n  EXPECT_HAS_VIRTUAL_LINK(index, \"C::moo()\", \"main()::E::moo()\");\n\n  // Note that this link skips `C` because it is devoid of `moo(int)`.\n  EXPECT_HAS_VIRTUAL_LINK(index, \"B::moo(int)\", \"D::moo(int)\");\n\n  // Qualified-name member accesses only create references to the base class\n  // entities...\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"A::\", \"foo\", \"()\", \"snippet.cc\", 2, 2,\n      \"snippet.cc\", 19, 19, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"B::\", \"foo\", \"()\", \"snippet.cc\", 7, 7,\n      \"snippet.cc\", 19, 19, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  // ...whereas an unqualified-name one also creates a reference to the\n  // synthesized inherited entity in the child.\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"C::\", \"bar\", \"()\", \"snippet.cc\", 13, 13,\n      \"snippet.cc\", 21, 21, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"D::\", \"bar\", \"()\", \"snippet.cc\", 13, 13,\n      \"snippet.cc\", 21, 21, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kFunction, \"C::\", \"bar\", \"()\", \"snippet.cc\", 13,\n          13, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/std::nullopt,\n          /*implicitly_defined_for_entity_id=*/std::nullopt,\n          /*enum_value=*/std::nullopt,\n          /*inherited_from_entity_id=*/std::nullopt,\n          /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual),\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n}\n\nTEST(FrontendTest, Devirtualization) {\n  auto index = IndexSnippet(\n      \"struct Foo {\\n\"                     // 1\n      \"  virtual void bar() const {}\\n\"    // 2\n      \"};\\n\"                               // 3\n      \"struct Bar final : public Foo {\\n\"  // 4\n      \"  void bar() const override {}\\n\"   // 5\n      \"};\\n\"                               // 6\n      \"int main(void) {\\n\"                 // 7\n      \"  const auto* bar = new Bar();\\n\"   // 8\n      \"  ((Foo*)bar)->bar();\\n\"            // 9\n      \"}\");                                // 10\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"Bar::\", \"bar\", \"() const\", \"snippet.cc\",\n      5, 5, \"snippet.cc\", 9, 9, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt,\n      /*inherited_from_entity_id=*/std::nullopt,\n      /*virtual_method_kind=*/Entity::VirtualMethodKind::kNonPureVirtual);\n}\n\nTEST(FrontendTest, InheritanceThroughTemplateInstantiation) {\n  auto index = IndexSnippet(\n      \"class Foo {\\n\"                         // 1\n      \" public:\\n\"                            // 2\n      \"  virtual void Bar() {}\\n\"             // 3\n      \"  virtual int foo() { return 1; }\\n\"   // 4\n      \"};\\n\"                                  // 5\n      \"template <typename T>\\n\"               // 6\n      \"class Template : public Foo {\\n\"       // 7\n      \" public:\\n\"                            // 8\n      \"  int field = 0;\\n\"                    // 9\n      \"};\\n\"                                  // 10\n      \"class Bar : public Template<int> {\\n\"  // 11\n      \"};\\n\");                                // 12\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"Template<T>::\", \"foo\", \"()\",\n      \"snippet.cc\", 4, 4, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo::\", \"foo\", \"()\",\n                       \"snippet.cc\", 4, 4,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual),\n      Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"Template<int>::\", \"foo\", \"()\",\n      \"snippet.cc\", 4, 4, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo::\", \"foo\", \"()\",\n                       \"snippet.cc\", 4, 4, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/std::nullopt,\n                       /*enum_value=*/std::nullopt,\n                       /*inherited_from_entity_id=*/std::nullopt,\n                       Entity::VirtualMethodKind::kNonPureVirtual),\n      Entity::VirtualMethodKind::kNonPureVirtual);\n  // `Bar::Bar` is a constructor set shadowing the virtual function.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Bar::\", \"Bar\", \"()\",\n                    \"snippet.cc\", 11, 11, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Bar\", \"\",\n                                     \"snippet.cc\", 11, 12),\n                    /*enum_value=*/std::nullopt,\n                    /*inherited_from_entity_id=*/std::nullopt,\n                    Entity::VirtualMethodKind::kNotAVirtualMethod);\n}\n\nTEST(FrontendTest, Builtin) {\n  auto index = IndexSnippet(\n      \"int foo(int value) {\\n\"\n      \"  __builtin_trap();\\n\"\n      \"  __builtin_trap();\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"__builtin_trap\", \"()\",\n                    \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"__builtin_trap\",\n                       \"()\", \"snippet.cc\", 2, 2, \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"__builtin_trap\",\n                       \"()\", \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"(int)\",\n                    \"snippet.cc\", 1, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"value\", \"\",\n                    \"snippet.cc\", 1, 1);\n}\n\nTEST(FrontendTest, RecursiveTemplateInstantiation) {\n  auto index = IndexSnippet(\n      \"volatile int bar = 0;\\n\"\n      \"template <typename... Args> struct Foo;\\n\"\n      \"template <>\\n\"\n      \"struct Foo<> {\\n\"\n      \"  static void foo() {};\\n\"\n      \"};\\n\"\n      \"template <typename... Args>\\n\"\n      \"struct Foo<int, Args...> {\\n\"\n      \"  static void foo(int arg, Args... args) {\\n\"\n      \"    bar += arg;\\n\"\n      \"    Foo<Args...>::foo(args...);\\n\"\n      \"  }\\n\"\n      \"};\\n\"\n      \"template <typename... Args>\\n\"\n      \"struct Foo<char, Args...> {\\n\"\n      \"  static void foo(char arg, Args... args) {\\n\"\n      \"    bar += arg;\\n\"\n      \"    Foo<Args...>::foo(args...);\\n\"\n      \"  }\\n\"\n      \"};\\n\"\n      \"template <typename Arg, typename... Args>\\n\"\n      \"struct Foo<Arg, Args...> {\\n\"\n      \"  static void foo(Arg arg, Args... args) {\\n\"\n      \"    Foo<Args...>::foo(args...);\\n\"\n      \"  }\\n\"\n      \"};\\n\"\n      \"int main() {\\n\"\n      \"  Foo<int, char, int, char>::foo(1, 'b', 3, 'd');\\n\"\n      \"}\\n\");\n  // First the expected classes\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<Args...>\",\n                    \"snippet.cc\", 2, 2,\n                    /*is_incomplete=*/true);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<>\", \"snippet.cc\",\n                    3, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, Args...>\",\n                    \"snippet.cc\", 7, 13);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<char, Args...>\",\n                    \"snippet.cc\", 14, 20);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<Arg, Args...>\",\n                    \"snippet.cc\", 21, 26);\n\n  // And the expected functions.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo<>::\", \"foo\", \"()\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Foo<char, Args...>::\", \"foo\", \"(char, Args...)\",\n                    \"snippet.cc\", 16, 19);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Foo<int, Args...>::\", \"foo\", \"(int, Args...)\",\n                    \"snippet.cc\", 9, 12);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Foo<Arg, Args...>::\", \"foo\", \"(Arg, Args...)\",\n                    \"snippet.cc\", 23, 25);\n\n  // Then make sure we get the final instantiation function with the correct\n  // parameter types.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Foo<int, char, int, char>::\", \"foo\",\n                    \"(int, char, int, char)\", \"snippet.cc\", 9, 12,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction,\n                                     \"Foo<int, Args...>::\", \"foo\",\n                                     \"(int, Args...)\", \"snippet.cc\", 9, 12));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"Foo<int, char, int, char>::\", \"foo\",\n      \"(int, char, int, char)\", \"snippet.cc\", 9, 12, \"snippet.cc\", 28, 28,\n      /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo<int, Args...>::\",\n                       \"foo\", \"(int, Args...)\", \"snippet.cc\", 9, 12));\n}\n\nTEST(FrontendTest, IncompleteTemplate) {\n  auto index = IndexSnippet(\n      \"template <class T>\\n\"\n      \"class Foo;\\n\"\n      \"using Bar = Foo<int>;\\n\"\n      \"template <class T>\\n\"\n      \"class Foo {\\n\"\n      \" public:\\n\"\n      \"  int baz_;\\n\"\n      \"};\\n\"\n      \"Bar bar;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\", \"snippet.cc\",\n                    4, 8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\",\n                       \"snippet.cc\", 4, 8, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\",\n                       \"snippet.cc\", 4, 8, \"snippet.cc\", 9, 9);\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 4, 8,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<T>\", \"snippet.cc\", 4, 8));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                       \"snippet.cc\", 4, 8, \"snippet.cc\", 3, 3,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<T>\", \"snippet.cc\", 4, 8));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                       \"snippet.cc\", 4, 8, \"snippet.cc\", 9, 9,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<T>\", \"snippet.cc\", 4, 8));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\", 3,\n                    3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\",\n                       3, 3, \"snippet.cc\", 9, 9);\n}\n\nTEST(FrontendTest, ConstrainedSpecialization) {\n  auto index = IndexSnippet(\n      \"template <class T>\\n\"\n      \"class Foo {};\\n\"\n      \"template <class T>\\n\"\n      \"class Bar {};\\n\"\n      \"template <class T>\\n\"\n      \"class Bar<Foo<T>> {};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Bar\", \"<Foo<T>>\",\n                    \"snippet.cc\", 5, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Bar\", \"<T>\", \"snippet.cc\",\n                    3, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\", \"snippet.cc\",\n                    1, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Bar<Foo<T>>::\", \"T\", \"\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Bar<T>::\", \"T\", \"\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<T>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n}\n\nTEST(FrontendTest, MoreTemplateSpecialization) {\n  auto index = IndexSnippet(\n      \"template <typename S, typename T>\\n\"\n      \"class Foo {};\\n\"\n      \"template <typename S, typename T>\\n\"\n      \"using Bar = Foo<S, T>;\\n\"\n      \"template <typename S, typename T>\\n\"\n      \"using Baz = Foo<Bar<S, bool>, T>;\\n\"\n      \"Bar<int, char> bar;\\n\"\n      \"Baz<int, char> baz;\\n\");\n  // Check that the baseline template entities exist\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<S, T>\",\n                    \"snippet.cc\", 1, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<S, T>\",\n                       \"snippet.cc\", 1, 2, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<S, T>\",\n                       \"snippet.cc\", 1, 2, \"snippet.cc\", 6, 6);\n  // TODO: Maybe add these if we have implicit reference support.\n  EXPECT_FALSE(IndexHasReference(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                 \"<S, T>\", \"snippet.cc\", 1, 2, \"snippet.cc\", 7,\n                                 7));\n  EXPECT_FALSE(IndexHasReference(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                 \"<S, T>\", \"snippet.cc\", 1, 2, \"snippet.cc\", 8,\n                                 8));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"<S, T>\",\n                    \"snippet.cc\", 3, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"<S, T>\",\n                       \"snippet.cc\", 3, 4, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"<S, T>\",\n                       \"snippet.cc\", 3, 4, \"snippet.cc\", 7, 7);\n  // TODO: Maybe add these if we have implicit reference support.\n  EXPECT_FALSE(IndexHasReference(index, Entity::Kind::kType, \"\", \"Bar\",\n                                 \"<S, T>\", \"snippet.cc\", 3, 4, \"snippet.cc\", 8,\n                                 8));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Baz\", \"<S, T>\",\n                    \"snippet.cc\", 5, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Baz\", \"<S, T>\",\n                       \"snippet.cc\", 5, 6, \"snippet.cc\", 8, 8);\n\n  // Check that the correct specializations of Foo exist\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, char>\",\n                    \"snippet.cc\", 1, 2,\n                    /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<S, T>\", \"snippet.cc\", 1, 2));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, char>\", \"snippet.cc\", 1, 2,\n      \"snippet.cc\", 7, 7,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\", \"<S, T>\",\n                       \"snippet.cc\", 1, 2));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\",\n                    \"<Foo<int, bool>, char>\", \"snippet.cc\", 1, 2,\n                    /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<S, T>\", \"snippet.cc\", 1, 2));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kClass, \"\", \"Foo\", \"<Foo<int, bool>, char>\",\n      \"snippet.cc\", 1, 2, \"snippet.cc\", 8, 8,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\", \"<S, T>\",\n                       \"snippet.cc\", 1, 2));\n  // Note: These entities no longer exist, because they're also implicit. Maybe\n  // we want them, but it's unclear how we'd be able to use them without the\n  // implicit references.\n  // EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, bool>\",\n  //                   \"snippet.cc\", 1, 2);\n  // EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, bool>\",\n  //                      \"snippet.cc\", 1, 2, \"snippet.cc\", 8, 8);\n}\n\nTEST(FrontendTest, FormatTemplateArgumentsOne) {\n  auto index = IndexSnippet(\n      \"template <typename... Args> class Foo {};\\n\"\n      \"Foo<int, int, int> foo;\\n\");\n  // Base templates.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<Args...>\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<Args...>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n\n  // Specializations.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int, int, int>\",\n                    \"snippet.cc\", 1, 1,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<Args...>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\",\n                       \"<int, int, int>\", \"snippet.cc\", 1, 1, \"snippet.cc\", 2,\n                       2,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<Args...>\", \"snippet.cc\", 1, 1));\n}\n\nTEST(FrontendTest, FormatTemplateArgumentsTwo) {\n  auto index = IndexSnippet(\n      \"template <typename T> class Foo {};\\n\"\n      \"template <typename T> class Bar {};\\n\"\n      \"template <typename T> using Baz = Foo<Bar<T>>;\\n\"\n      \"Baz<int> baz;\\n\");\n  // Base templates.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Bar\", \"<T>\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Bar\", \"<T>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Baz\", \"<T>\", \"snippet.cc\",\n                    3, 3);\n\n  // Specializations.\n  // TODO: If we add implicit references at some point, we should\n  // reintroduce these two as implicit references.\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kClass, \"\", \"Bar\", \"<int>\",\n                              \"snippet.cc\", 2, 2));\n  EXPECT_FALSE(IndexHasReference(index, Entity::Kind::kClass, \"\", \"Bar\",\n                                 \"<int>\", \"snippet.cc\", 2, 2, \"snippet.cc\", 4,\n                                 4));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<Bar<int>>\",\n                    \"snippet.cc\", 1, 1,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<T>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<Bar<int>>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 4, 4,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<T>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Baz\", \"<int>\",\n                    \"snippet.cc\", 3, 3,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kType, \"\", \"Baz\",\n                                     \"<T>\", \"snippet.cc\", 3, 3));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Baz\", \"<int>\",\n                       \"snippet.cc\", 3, 3, \"snippet.cc\", 4, 4,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kType, \"\", \"Baz\",\n                                        \"<T>\", \"snippet.cc\", 3, 3));\n}\n\nTEST(FrontendTest, FormatTemplateArgumentsThree) {\n  auto index = IndexSnippet(\n      \"template <typename T, typename S> class Foo {};\\n\"\n      \"template <typename T> using Bar = Foo<T, int>;\\n\"\n      \"Bar<char> bar;\\n\");\n  // Base templates.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T, S>\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T, S>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"<T>\", \"snippet.cc\",\n                    2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"<T>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3);\n\n  // Specializations.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<char, int>\",\n                    \"snippet.cc\", 1, 1,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<T, S>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<char, int>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 3, 3,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<T, S>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"<char>\",\n                    \"snippet.cc\", 2, 2,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kType, \"\", \"Bar\",\n                                     \"<T>\", \"snippet.cc\", 2, 2));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"<char>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kType, \"\", \"Bar\",\n                                        \"<T>\", \"snippet.cc\", 2, 2));\n}\n\nTEST(FrontendTest, EvenMoreTemplates) {\n  auto index = IndexSnippet(\n      \"template <typename A, typename B> class Foo { };\\n\"\n      \"template <typename A, typename B> using Bar = Foo<B, A>;\\n\"\n      \"\\n\"\n      \"template <typename... Args> class Baz {};\\n\"\n      \"template <typename A, typename B> using Brrrr = Foo<Baz<A, \"\n      \"char, int>, B>;\\n\"\n      \"\\n\"\n      \"int main() {\\n\"\n      \"    Bar<int, char> bar;\\n\"\n      \"    Brrrr<int, char> brrrr;\\n\"\n      \"}\\n\");\n  // Base templates.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A, B>\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A, B>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A, B>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"<A, B>\",\n                    \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"<A, B>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Baz\", \"<Args...>\",\n                    \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Baz\", \"<Args...>\",\n                       \"snippet.cc\", 4, 4, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Brrrr\", \"<A, B>\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Brrrr\", \"<A, B>\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 9, 9);\n\n  // Specializations/instantiations.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"<int, char>\",\n                    \"snippet.cc\", 2, 2,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kType, \"\", \"Bar\",\n                                     \"<A, B>\", \"snippet.cc\", 2, 2));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Bar\", \"<int, char>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 8, 8,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kType, \"\", \"Bar\",\n                                        \"<A, B>\", \"snippet.cc\", 2, 2));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<char, int>\",\n                    \"snippet.cc\", 1, 1, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<A, B>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<char, int>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 8, 8,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<A, B>\", \"snippet.cc\", 1, 1));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Brrrr\", \"<int, char>\",\n                    \"snippet.cc\", 5, 5, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kType, \"\", \"Brrrr\",\n                                     \"<A, B>\", \"snippet.cc\", 5, 5));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Brrrr\", \"<int, char>\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 9, 9,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kType, \"\", \"Brrrr\",\n                                        \"<A, B>\", \"snippet.cc\", 5, 5));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\",\n                    \"<Baz<int, char, int>, char>\", \"snippet.cc\", 1, 1,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<A, B>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\",\n                       \"<Baz<int, char, int>, char>\", \"snippet.cc\", 1, 1,\n                       \"snippet.cc\", 9, 9, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<A, B>\", \"snippet.cc\", 1, 1));\n}\n\nTEST(FrontendTest, QualifiedTypeSpecialization) {\n  auto index = IndexSnippet(\n      \"template <typename A> class Foo { };\\n\"\n      \"template <typename A> class Foo<const A> { };\\n\"\n      \"template <typename A> class Foo<volatile A> { };\\n\"\n      \"Foo<int> foo;\\n\"\n      \"Foo<const int> const_foo;\\n\"\n      \"Foo<volatile int> volatile_foo;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A>\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 1, 1, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<A>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 4, 4,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<A>\", \"snippet.cc\", 1, 1));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const A>\",\n                    \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const A>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const int>\",\n                    \"snippet.cc\", 2, 2, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<const A>\", \"snippet.cc\", 2, 2));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const int>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 5, 5,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<const A>\", \"snippet.cc\", 2, 2));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<volatile A>\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<volatile A>\",\n                       \"snippet.cc\", 3, 3, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<volatile int>\",\n                    \"snippet.cc\", 3, 3, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<volatile A>\", \"snippet.cc\", 3, 3));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<volatile int>\",\n                       \"snippet.cc\", 3, 3, \"snippet.cc\", 6, 6,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<volatile A>\", \"snippet.cc\", 3, 3));\n}\n\nTEST(FrontendTest, QualifiedTypeSpecializationTwo) {\n  auto index = IndexSnippet(\n      \"template <typename A> class Foo { };\\n\"\n      \"template <typename A> class Foo<const A&> { };\\n\"\n      \"template <typename A> class Foo<const A* const> { };\\n\"\n      \"template <typename A> class Foo<volatile A&&> { };\\n\"\n      \"Foo<int> foo;\\n\"\n      \"Foo<const int&> const_foo;\\n\"\n      \"Foo<const int* const> const_const_foo;\\n\"\n      \"Foo<volatile int&&> volatile_foo;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A>\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 1, 1, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<A>\", \"snippet.cc\", 1, 1));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 5, 5,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<A>\", \"snippet.cc\", 1, 1));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const A &>\",\n                    \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const A &>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 6, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const int &>\",\n                    \"snippet.cc\", 2, 2, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<const A &>\", \"snippet.cc\", 2, 2));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const int &>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 6, 6,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<const A &>\", \"snippet.cc\", 2, 2));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const A *const>\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\",\n                       \"<const A *const>\", \"snippet.cc\", 3, 3, \"snippet.cc\", 7,\n                       7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\",\n                    \"<const int *const>\", \"snippet.cc\", 3, 3,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<const A *const>\", \"snippet.cc\", 3, 3));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kClass, \"\", \"Foo\", \"<const int *const>\",\n      \"snippet.cc\", 3, 3, \"snippet.cc\", 7, 7, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                       \"<const A *const>\", \"snippet.cc\", 3, 3));\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<volatile A &&>\",\n                    \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\",\n                       \"<volatile A &&>\", \"snippet.cc\", 4, 4, \"snippet.cc\", 8,\n                       8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<volatile int &&>\",\n                    \"snippet.cc\", 4, 4, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<volatile A &&>\", \"snippet.cc\", 4, 4));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\",\n                       \"<volatile int &&>\", \"snippet.cc\", 4, 4, \"snippet.cc\", 8,\n                       8, /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<volatile A &&>\", \"snippet.cc\", 4, 4));\n}\n\nTEST(FrontendTest, QualifiedTypeSpecializationThree) {\n  auto index = IndexSnippet(\n      \"template <typename A> class Foo { };\\n\"\n      \"template <typename A> class Foo<const A[1]> { };\\n\"\n      \"Foo<const int[1]> foo_1;\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A>\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const A[1]>\",\n                    \"snippet.cc\", 2, 2);\n  // TODO: Figure out why clang finds the correct specialization\n  // for the cases in FrontendTest.QualifiedTypeSpecialization and\n  // FrontendTest.QualifiedTypeSpecializationTwo but not here. This reference\n  // incorrectly goes to the base template instead.\n  //\n  // EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\",\n  //                      \"<const A[1]>\", \"snippet.cc\", 2, 2, \"snippet.cc\",\n  //                      3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const int[1]>\",\n                    \"snippet.cc\", 2, 2, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<const A[1]>\", \"snippet.cc\", 2, 2));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<const int[1]>\",\n                       \"snippet.cc\", 2, 2, \"snippet.cc\", 3, 3,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<const A[1]>\", \"snippet.cc\", 2, 2));\n}\n\nTEST(FrontendTest, UsingSpecialization) {\n  auto index = IndexSnippet(\n      \"template <typename A> class Foo;\\n\"\n      \"using Bar = Foo<int>;\\n\"\n      \"template <typename A> class Foo {};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\", 2,\n                    2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A>\", \"snippet.cc\",\n                    3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<A>::\", \"A\", \"\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 3, 3, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<A>\", \"snippet.cc\", 3, 3));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                       \"snippet.cc\", 3, 3, \"snippet.cc\", 2, 2,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<A>\", \"snippet.cc\", 3, 3));\n}\n\nTEST(FrontendTest, UsingSpecializationTwo) {\n  auto index = IndexSnippet(\n      \"template <typename A> class Foo;\\n\"\n      \"using Bar = Foo<int>;\\n\"\n      \"template <typename A> class Foo {};\\n\"\n      \"template <> class Foo<int> {};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Bar\", \"\", \"snippet.cc\", 2,\n                    2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<A>\", \"snippet.cc\",\n                    3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo<A>::\", \"A\", \"\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                       \"snippet.cc\", 4, 4, \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, BooleanParameter) {\n  auto index = IndexSnippet(\"void foo(bool bar) {}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"bar\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"(bool)\",\n                    \"snippet.cc\", 1, 1);\n}\n\nTEST(FrontendTest, BooleanTemplate) {\n  auto index = IndexSnippet(\"template <bool T> class Foo {};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<bool>\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<bool>::\", \"T\", \"\",\n                    \"snippet.cc\", 1, 1);\n}\n\nTEST(FrontendTest, InheritanceReference) {\n  auto index = IndexSnippet(\n      \"class Base {};\\n\"\n      \"class Child : public Base {};\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Base\", \"\", \"snippet.cc\",\n                    1, 1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Base\", \"\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Child\", \"\", \"snippet.cc\",\n                    2, 2);\n}\n\nTEST(FrontendTest, MemberTemplateInstantiation) {\n  auto index = IndexSnippet(\n      \"class Foo {\\n\"\n      \" public:\\n\"\n      \"  template <typename T>\\n\"\n      \"  static T GetA();\\n\"\n      \"  int GetB() {\\n\"\n      \"    return Foo::GetA<int>();\\n\"\n      \"  }\\n\"\n      \"};\\n\"\n      \"template <typename T>\\n\"\n      \"T Foo::GetA() {\\n\"\n      \"  return 99;\\n\"\n      \"}\\n\"\n      \"int main() {\\n\"\n      \"  Foo foo;\\n\"\n      \"  return foo.GetB() + Foo::GetA<unsigned int>();\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\", 1,\n                    8);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"\", \"snippet.cc\",\n                       1, 8, \"snippet.cc\", 14, 14);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<T>()\",\n                    \"snippet.cc\", 9, 12);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<int>()\",\n                    \"snippet.cc\", 9, 12, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"Foo::\",\n                                     \"GetA\", \"<T>()\", \"snippet.cc\", 9, 12));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<int>()\", \"snippet.cc\",\n      9, 12, \"snippet.cc\", 6, 6, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<T>()\",\n                       \"snippet.cc\", 9, 12));\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<unsigned int>()\",\n      \"snippet.cc\", 9, 12, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<T>()\",\n                       \"snippet.cc\", 9, 12));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<unsigned int>()\",\n      \"snippet.cc\", 9, 12, \"snippet.cc\", 15, 15, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo::\", \"GetA\", \"<T>()\",\n                       \"snippet.cc\", 9, 12));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"GetB\", \"()\",\n                    \"snippet.cc\", 5, 7);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"Foo::\", \"GetB\", \"()\",\n                       \"snippet.cc\", 5, 7, \"snippet.cc\", 15, 15);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Foo::GetA<T>()::\", \"T\", \"\",\n                    \"snippet.cc\", 9, 9);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"Foo::GetA<T>()::\", \"T\", \"\",\n                       \"snippet.cc\", 9, 9, \"snippet.cc\", 10, 10);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 13, 16);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    14, 14);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                       \"snippet.cc\", 14, 14, \"snippet.cc\", 15, 15);\n}\n\nTEST(FrontendTest, ClassTemplateMemberReference) {\n  auto index = IndexSnippet(\n      \"template <typename T>\\n\"\n      \"class Foo {\\n\"\n      \" public:\\n\"\n      \"  static T GetA();\\n\"\n      \"  static const T kConstant = 99;\\n\"\n      \"};\\n\"\n      \"template <typename T>\\n\"\n      \"T Foo<T>::GetA() {\\n\"\n      \"  return 99;\\n\"\n      \"}\\n\"\n      \"int main() {\\n\"\n      \"  int result = Foo<int>::kConstant;\\n\"\n      \"  return result + Foo<int>::GetA();\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<T>\", \"snippet.cc\",\n                    1, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                    \"snippet.cc\", 1, 6, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                     \"<T>\", \"snippet.cc\", 1, 6));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"Foo\", \"<int>\",\n                       \"snippet.cc\", 1, 6, \"snippet.cc\", 13, 13,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"<T>\", \"snippet.cc\", 1, 6));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo<T>::\", \"GetA\", \"()\",\n                    \"snippet.cc\", 7, 10);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<T>::\", \"kConstant\", \"\",\n                    \"snippet.cc\", 5, 5);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo<int>::\", \"GetA\", \"()\",\n                    \"snippet.cc\", 7, 10, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kFunction, \"Foo<T>::\",\n                                     \"GetA\", \"()\", \"snippet.cc\", 7, 10));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"Foo<int>::\", \"GetA\", \"()\", \"snippet.cc\",\n      7, 10, \"snippet.cc\", 13, 13,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Foo<T>::\", \"GetA\", \"()\",\n                       \"snippet.cc\", 7, 10));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"Foo<int>::\", \"kConstant\",\n                    \"\", \"snippet.cc\", 5, 5,\n                    /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kVariable, \"Foo<T>::\",\n                                     \"kConstant\", \"\", \"snippet.cc\", 5, 5));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kVariable, \"Foo<int>::\", \"kConstant\", \"\",\n      \"snippet.cc\", 5, 5, \"snippet.cc\", 12, 12, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kVariable, \"Foo<T>::\", \"kConstant\",\n                       \"\", \"snippet.cc\", 5, 5));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 11, 14);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"result\", \"\",\n                    \"snippet.cc\", 12, 12);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"result\", \"\",\n                       \"snippet.cc\", 12, 12, \"snippet.cc\", 13, 13);\n}\n\nTEST(FrontendTest, AnonymousStructMemberCollision) {\n  auto index = IndexSnippet(\n      \"struct {\\n\"\n      \" int bar;\\n\"\n      \"} foo;\\n\"\n      \"struct {\\n\"\n      \" int bar;\\n\"\n      \"} baz;\\n\"\n      \"int main() {\\n\"\n      \"  return foo.bar + baz.bar;\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"(anonymous struct)\", \"\",\n                    \"snippet.cc\", 1, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"(anonymous struct)\",\n                       \"\", \"snippet.cc\", 1, 3, \"snippet.cc\", 1, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"(anonymous struct)\", \"\",\n                    \"snippet.cc\", 4, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"(anonymous struct)\",\n                       \"\", \"snippet.cc\", 4, 6, \"snippet.cc\", 4, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"baz\", \"\", \"snippet.cc\",\n                    4, 6);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"baz\", \"\",\n                       \"snippet.cc\", 4, 6, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    1, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                       \"snippet.cc\", 1, 3, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 7, 9);\n\n  // BUG: b/416218844 - These two entities have identical names.\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable,\n                    \"(anonymous struct)::\", \"bar\", \"\", \"snippet.cc\", 2, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable,\n                       \"(anonymous struct)::\", \"bar\", \"\", \"snippet.cc\", 2, 2,\n                       \"snippet.cc\", 8, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable,\n                    \"(anonymous struct)::\", \"bar\", \"\", \"snippet.cc\", 5, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable,\n                       \"(anonymous struct)::\", \"bar\", \"\", \"snippet.cc\", 5, 5,\n                       \"snippet.cc\", 8, 8);\n}\n\nTEST(FrontendTest, ImplicitThisOverload) {\n  auto index = IndexSnippet(\n      \"class Test {\\n\"\n      \" public:\\n\"\n      \"  int foo(int a) && { return a; }\\n\"\n      \"  const char* foo(int a) volatile & { \\n\"\n      \"    return \\\"A\\\";\\n\"\n      \"  }\\n\"\n      \"  int* foo(int a) const & { return nullptr; }\\n\"\n      \"};\\n\"\n      \"int main() {\\n\"\n      \"  return Test().foo(1);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"a\", \"\", \"snippet.cc\",\n                    3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"a\", \"\",\n                       \"snippet.cc\", 3, 3, \"snippet.cc\", 3, 3);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"a\", \"\", \"snippet.cc\",\n                    4, 4);\n\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Test::\", \"foo\", \"(int) &&\",\n                    \"snippet.cc\", 3, 3);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"Test::\", \"foo\",\n                       \"(int) &&\", \"snippet.cc\", 3, 3, \"snippet.cc\", 10, 10);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Test::\", \"foo\",\n                    \"(int) volatile &\", \"snippet.cc\", 4, 6);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Test::\", \"foo\",\n                    \"(int) const &\", \"snippet.cc\", 7, 7);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 9, 11);\n}\n\nTEST(FrontendTest, TemplatedConstructor) {\n  auto index = IndexSnippet(\n      \"template<typename T>\\n\"\n      \"class Test {\\n\"\n      \" public:\\n\"\n      \"  template<typename U> Test(U&&) {}\\n\"\n      \"};\\n\"\n      \"int main() {\\n\"\n      \"  Test<void>(17);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Test<T>::\", \"Test\",\n                    \"<U>(U &&)\", \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"Test<T>::Test<U>(U &&)::\", \"U\",\n                    \"\", \"snippet.cc\", 4, 4);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"Test<void>::\", \"Test\", \"<int>(int &&)\",\n      \"snippet.cc\", 4, 4, \"snippet.cc\", 7, 7, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"Test<T>::\", \"Test\",\n                       \"<U>(U &&)\", \"snippet.cc\", 4, 4));\n}\n\nTEST(FrontendTest, UnknownPragmas) {\n  // This test doesn't actually fail to index, it just tests that unrecognised\n  // pragmas are treated as errors by the indexer, and that `IndexSnippet`\n  // can detect that there was an error and return nullptr. The indexer itself\n  // doesn't care about these errors, so we check that as well.\n\n  // https://chromium.googlesource.com/chromium/src/+/main/tools/clang/plugins/UnsafeBuffersPlugin.cpp\n  constexpr auto kSnippet =\n      \"#pragma allow_unsafe_buffers\\n\"\n      \"int foo = 1;\\n\"\n      \"#pragma allow_unsafe_libc_calls\\n\"\n      \"char bar = 2;\\n\";\n\n  // First we check that the indexer does indeed treat unrecognised pragmas as\n  // errors.\n  auto index_one =\n      GetSnippetIndex(kSnippet,\n                      /*extra_args=*/{\"-Werror\", \"-Wunknown-pragmas\"},\n                      /*fail_on_error=*/true);\n  EXPECT_EQ(index_one, nullptr);\n\n  // Then we tell it to ignore those errors, and produce the index regardless.\n  auto index_two =\n      GetSnippetIndex(kSnippet,\n                      /*extra_args=*/{\"-Werror\", \"-Wunknown-pragmas\"},\n                      /*fail_on_error=*/false);\n  ASSERT_NE(index_two, nullptr);\n  auto flat_index_two = std::move(*index_two).Export();\n  EXPECT_HAS_ENTITY(flat_index_two, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                    \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(flat_index_two, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                    \"snippet.cc\", 2, 2);\n\n  // Now we specifically suppress the unrecognised pragmas, so that we should be\n  // able to index without any errors.\n  absl::SetFlag(&FLAGS_ignore_pragmas,\n                {\"allow_unsafe_buffers\", \"allow_unsafe_libc_calls\"});\n  auto index_three =\n      GetSnippetIndex(kSnippet,\n                      /*extra_args=*/{\"-Werror\", \"-Wunknown-pragmas\"},\n                      /*fail_on_error=*/true);\n  ASSERT_NE(index_three, nullptr);\n  auto flat_index_three = std::move(*index_three).Export();\n  EXPECT_HAS_ENTITY(flat_index_three, Entity::Kind::kVariable, \"\", \"bar\", \"\",\n                    \"snippet.cc\", 4, 4);\n  EXPECT_HAS_ENTITY(flat_index_three, Entity::Kind::kVariable, \"\", \"foo\", \"\",\n                    \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, TemplatedXRef) {\n  auto index = IndexSnippet(\n      \"class RefCounted {\\n\"\n      \"public:\\n\"\n      \"  void AddRef() { return; }\\n\"\n      \"};\\n\"\n      \"template <typename T>\\n\"\n      \"class Foo {\\n\"\n      \"public:\\n\"\n      \"  explicit Foo(T* p) : ptr_(p) {\\n\"\n      \"    if (ptr_) {\\n\"\n      \"      ptr_->AddRef();\\n\"\n      \"    }\\n\"\n      \"  }\\n\"\n      \"private:\\n\"\n      \"  T* ptr_;\\n\"\n      \"};\\n\"\n      \"Foo<RefCounted> foo(new RefCounted());\\n\");\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"RefCounted::\", \"AddRef\",\n                       \"()\", \"snippet.cc\", 3, 3, \"snippet.cc\", 10, 10);\n}\n\nTEST(FrontendTest, TemplateMemberFn) {\n  auto index = IndexSnippet(\n      \"template <typename T>\\n\"\n      \"class TestTemplateClass {\\n\"\n      \" public:\\n\"\n      \"  TestTemplateClass() {}\\n\"\n      \"\\n\"\n      \"  template <typename S>\\n\"\n      \"  static S TestTemplateMemberFn(T t) {\\n\"\n      \"    return static_cast<S>(t);\\n\"\n      \"  }\\n\"\n      \"};\\n\"\n      \"\\n\"\n      \"template <typename T>\\n\"\n      \"class TestTemplateClass2 {\\n\"\n      \" public:\\n\"\n      \"  template<class U> TestTemplateClass2(U&&) { enum E{}; }\\n\"\n      \"};\\n\"\n      \"\\n\"\n      \"void template_xrefs() {\\n\"\n      \"  int template_xref =\\n\"\n      \"      TestTemplateClass<int>::\"\n      \"TestTemplateMemberFn<unsigned int>(99);\\n\"\n      \"  TestTemplateClass2<char> test2(3);\\n\"\n      \"}\\n\"\n      \"\\n\"\n      \"template <typename T>\\n\"\n      \"class TestTemplateClass3 : public TestTemplateClass<T> {\\n\"\n      \"};\\n\"\n      \"void more_template_xrefs() {\\n\"\n      \"  int template_xref =\\n\"\n      \"      TestTemplateClass3<char>::\"\n      \"TestTemplateMemberFn<long>(99);\\n\"\n      \"}\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"TestTemplateClass\", \"<T>\",\n                    \"snippet.cc\", 1, 10, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kClass, \"\", \"TestTemplateClass\", \"<int>\",\n      \"snippet.cc\", 1, 10,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"TestTemplateClass\",\n                       \"<T>\", \"snippet.cc\", 1, 10));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kClass, \"\", \"TestTemplateClass\", \"<int>\",\n      \"snippet.cc\", 1, 10, \"snippet.cc\", 20, 20, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"TestTemplateClass\",\n                       \"<T>\", \"snippet.cc\", 1, 10));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kClass, \"\", \"TestTemplateClass2\",\n                    \"<T>\", \"snippet.cc\", 12, 16, /*is_incomplete=*/false);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kClass, \"\", \"TestTemplateClass2\",\n                       \"<T>\", \"snippet.cc\", 12, 16, \"snippet.cc\", 21, 21,\n                       /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kClass, \"\", \"TestTemplateClass2\", \"<char>\",\n      \"snippet.cc\", 12, 16,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"TestTemplateClass2\",\n                       \"<T>\", \"snippet.cc\", 12, 16));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kClass, \"\", \"TestTemplateClass2\", \"<char>\",\n      \"snippet.cc\", 12, 16, \"snippet.cc\", 21, 21, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"TestTemplateClass2\",\n                       \"<T>\", \"snippet.cc\", 12, 16));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"t\", \"\", \"snippet.cc\",\n                    7, 7, /*is_incomplete=*/false);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"t\", \"\",\n                       \"snippet.cc\", 7, 7, \"snippet.cc\", 8, 8,\n                       /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"t\", \"\", \"snippet.cc\",\n                    7, 7);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"t\", \"\",\n                       \"snippet.cc\", 7, 7, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"template_xref\", \"\",\n                    \"snippet.cc\", 19, 20, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"template_xrefs\", \"()\",\n                    \"snippet.cc\", 18, 22, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"test2\", \"\",\n                    \"snippet.cc\", 21, 21, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"TestTemplateClass2<T>::\", \"T\",\n                    \"\", \"snippet.cc\", 12, 12, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"TestTemplateClass2<T>::\", \"TestTemplateClass2\",\n                    \"<U>(U &&)\", \"snippet.cc\", 15, 15, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kEnum,\n                    \"TestTemplateClass2<T>::TestTemplateClass2<U>(U &&)::\", \"E\",\n                    \"\", \"snippet.cc\", 15, 15, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType,\n                    \"TestTemplateClass2<T>::TestTemplateClass2<U>(U &&)::\", \"U\",\n                    \"\", \"snippet.cc\", 15, 15, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass2<char>::\", \"TestTemplateClass2\", \"<int>(int &&)\",\n      \"snippet.cc\", 15, 15,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction,\n                       \"TestTemplateClass2<T>::\", \"TestTemplateClass2\",\n                       \"<U>(U &&)\", \"snippet.cc\", 15, 15));\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kEnum,\n      \"TestTemplateClass2<char>::TestTemplateClass2<int>(int &&)::\", \"E\", \"\",\n      \"snippet.cc\", 15, 15,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kEnum,\n                       \"TestTemplateClass2<T>::TestTemplateClass2<U>(U &&)::\",\n                       \"E\", \"\", \"snippet.cc\", 15, 15));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"TestTemplateClass<T>::\", \"T\",\n                    \"\", \"snippet.cc\", 1, 1, /*is_incomplete=*/false);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType,\n                       \"TestTemplateClass<T>::\", \"T\", \"\", \"snippet.cc\", 1, 1,\n                       \"snippet.cc\", 7, 7, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"TestTemplateClass<T>::\", \"TestTemplateClass\", \"()\",\n                    \"snippet.cc\", 4, 4, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"TestTemplateClass<T>::\", \"TestTemplateMemberFn\", \"<S>(T)\",\n                    \"snippet.cc\", 6, 9, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType,\n                    \"TestTemplateClass<T>::TestTemplateMemberFn<S>(T)::\", \"S\",\n                    \"\", \"snippet.cc\", 6, 6, /*is_incomplete=*/false);\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kType,\n      \"TestTemplateClass<T>::TestTemplateMemberFn<S>(T)::\", \"S\", \"\",\n      \"snippet.cc\", 6, 6, \"snippet.cc\", 7, 7, /*is_incomplete=*/false);\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass<int>::\", \"TestTemplateMemberFn\", \"<S>(int)\",\n      \"snippet.cc\", 6, 9,\n      /*is_incomplete=*/true, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"TestTemplateClass<T>::\",\n                       \"TestTemplateMemberFn\", \"<S>(T)\", \"snippet.cc\", 6, 9));\n  // Template function parameter in a class template specialization.\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kType,\n      \"TestTemplateClass<int>::TestTemplateMemberFn<S>(int)::\", \"S\", \"\",\n      \"snippet.cc\", 6, 6, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kType,\n                       \"TestTemplateClass<T>::TestTemplateMemberFn<S>(T)::\",\n                       \"S\", \"\", \"snippet.cc\", 6, 6));\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass<int>::\", \"TestTemplateMemberFn\", \"<unsigned int>(int)\",\n      \"snippet.cc\", 6, 9,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"TestTemplateClass<T>::\",\n                       \"TestTemplateMemberFn\", \"<S>(T)\", \"snippet.cc\", 6, 9));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass<int>::\", \"TestTemplateMemberFn\", \"<unsigned int>(int)\",\n      \"snippet.cc\", 6, 9, \"snippet.cc\", 20, 20, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kFunction, \"TestTemplateClass<T>::\",\n                       \"TestTemplateMemberFn\", \"<S>(T)\", \"snippet.cc\", 6, 9));\n  // Implicit entities for entities which have template prototypes.\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass3<char>::\", \"TestTemplateClass3\", \"()\", \"snippet.cc\",\n      25, 25, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kClass, \"\", \"TestTemplateClass3\", \"<char>\",\n          \"snippet.cc\", 24, 26, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\",\n                           \"TestTemplateClass3\", \"<T>\", \"snippet.cc\", 24, 26)));\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass3<char>::\", \"TestTemplateClass3\",\n      \"(TestTemplateClass3<char> &&)\", \"snippet.cc\", 25, 25,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kClass, \"\", \"TestTemplateClass3\", \"<char>\",\n          \"snippet.cc\", 24, 26, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\",\n                           \"TestTemplateClass3\", \"<T>\", \"snippet.cc\", 24, 26)));\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass3<char>::\", \"TestTemplateClass3\",\n      \"(const TestTemplateClass3<char> &)\", \"snippet.cc\", 25, 25,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kClass, \"\", \"TestTemplateClass3\", \"<char>\",\n          \"snippet.cc\", 24, 26, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\",\n                           \"TestTemplateClass3\", \"<T>\", \"snippet.cc\", 24, 26)));\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"TestTemplateClass3<char>::\", \"operator=\",\n      \"(TestTemplateClass3<char> &&)\", \"snippet.cc\", 25, 25,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kClass, \"\", \"TestTemplateClass3\", \"<char>\",\n          \"snippet.cc\", 24, 26, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\",\n                           \"TestTemplateClass3\", \"<T>\", \"snippet.cc\", 24, 26)));\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"TestTemplateClass3<char>::\", \"operator=\",\n      \"(const TestTemplateClass3<char> &)\", \"snippet.cc\", 25, 25,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kClass, \"\", \"TestTemplateClass3\", \"<char>\",\n          \"snippet.cc\", 24, 26, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\",\n                           \"TestTemplateClass3\", \"<T>\", \"snippet.cc\", 24, 26)));\n  // Implicitly defined destructor in a class instantiated from a template.\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction,\n      \"TestTemplateClass3<char>::\", \"~TestTemplateClass3\", \"()\", \"snippet.cc\",\n      25, 25, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kClass, \"\", \"TestTemplateClass3\", \"<char>\",\n          \"snippet.cc\", 24, 26, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\",\n                           \"TestTemplateClass3\", \"<T>\", \"snippet.cc\", 24, 26)));\n}\n\nTEST(FrontendTest, ImplicitCode) {\n  auto index = IndexSnippet(\n      \"class Foo {\\n\"\n      \" public:\\n\"\n      \"  virtual ~Foo() {}\\n\"\n      \"};\\n\"\n      \"Foo instance;\"\n      \"class Bar : public Foo {};\\n\"\n      \"Bar instance2;\\n\"\n      \"Bar func() { return {}; }\\n\"\n      \"typedef union { int x; short y; } u;\\n\"\n      \"struct Baz {\\n\"\n      \"  Baz() {\\n\"\n      \"    int arr[] = {1, 2, 3};\\n\"\n      \"    for (auto x : arr) {};\\n\"\n      \"  };\\n\"\n      \"  union { int a; char b; };  // anonymous union field\\n\"\n      \"};\");\n\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"Foo::\", \"~Foo\", \"()\", \"snippet.cc\", 3, 3,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/std::nullopt,\n      /*implicitly_defined_for_entity_id=*/std::nullopt,\n      /*enum_value=*/std::nullopt, /*inherited_from_entity_id=*/std::nullopt,\n      Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"Foo\", \"()\",\n                    \"snippet.cc\", 1, 1, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\", \"\",\n                                     \"snippet.cc\", 1, 4));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Foo::\", \"Foo\",\n                    \"(const Foo &)\", \"snippet.cc\", 1, 1,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    std::nullopt, /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\", \"\",\n                                     \"snippet.cc\", 1, 4));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Foo::\", \"operator=\", \"(const Foo &)\", \"snippet.cc\", 1, 1,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    std::nullopt, /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\", \"\",\n                                     \"snippet.cc\", 1, 4));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Bar::\", \"Bar\", \"()\",\n                    \"snippet.cc\", 5, 5, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Bar\", \"\",\n                                     \"snippet.cc\", 5, 5));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Bar::\", \"~Bar\", \"()\",\n                    \"snippet.cc\", 5, 5, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Bar\", \"\",\n                                     \"snippet.cc\", 5, 5),\n                    /*enum_value=*/std::nullopt,\n                    /*inherited_from_entity_id=*/std::nullopt,\n                    Entity::VirtualMethodKind::kNonPureVirtual);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"Foo::\", \"Foo\", \"()\",\n                       \"snippet.cc\", 1, 1, \"snippet.cc\", 5, 5,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/std::nullopt,\n                       /*implicitly_defined_for_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Foo\",\n                                        \"\", \"snippet.cc\", 1, 4));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"Bar::\", \"Bar\", \"()\",\n                       \"snippet.cc\", 5, 5, \"snippet.cc\", 7, 7,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       std::nullopt, /*implicitly_defined_for_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Bar\",\n                                        \"\", \"snippet.cc\", 5, 5));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Baz::\", \"Baz\", \"()\",\n                    \"snippet.cc\", 10, 13);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Baz::\", \"Baz\", \"(Baz &&)\",\n                    \"snippet.cc\", 9, 9, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Baz\", \"\",\n                                     \"snippet.cc\", 9, 15));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Baz::\", \"Baz\",\n                    \"(const Baz &)\", \"snippet.cc\", 9, 9,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    std::nullopt, /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Baz\", \"\",\n                                     \"snippet.cc\", 9, 15));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Baz::\", \"operator=\", \"(Baz &&)\", \"snippet.cc\", 9, 9,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    std::nullopt, /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Baz\", \"\",\n                                     \"snippet.cc\", 9, 15));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction,\n                    \"Baz::\", \"operator=\", \"(const Baz &)\", \"snippet.cc\", 9, 9,\n                    /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    std::nullopt, /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Baz\", \"\",\n                                     \"snippet.cc\", 9, 15));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"Baz::\", \"~Baz\", \"()\",\n                    \"snippet.cc\", 9, 9, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/std::nullopt,\n                    /*implicitly_defined_for_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kClass, \"\", \"Baz\", \"\",\n                                     \"snippet.cc\", 9, 15));\n\n  // Anonymous union destructor should be absent, with or without implicit-for.\n  EXPECT_FALSE(IndexHasEntity(\n      index, Entity::Kind::kFunction, \"(anonymous union)::\", \"~u\", \"()\",\n      \"snippet.cc\", 8, 8, /*is_incomplete=*/false,\n      /*template_prototype_entity_id=*/\n      std::nullopt, /*implicitly_defined_for_entity_id=*/\n      RequiredEntityId(index, Entity::Kind::kClass, \"\", \"(anonymous union)\", \"\",\n                       \"snippet.cc\", 8, 8)));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kFunction,\n                              \"(anonymous union)::\", \"~u\", \"()\", \"snippet.cc\",\n                              8, 8));\n  // Implicit variables from range for loops should be absent.\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kVariable, \"\", \"__begin1\",\n                              \"\", \"snippet.cc\", 12, 12));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kVariable, \"\", \"__end1\", \"\",\n                              \"snippet.cc\", 12, 12));\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kVariable, \"\", \"__range1\",\n                              \"\", \"snippet.cc\", 12, 12));\n  EXPECT_FALSE(IndexHasReference(index, Entity::Kind::kVariable, \"\", \"__range1\",\n                                 \"\", \"snippet.cc\", 12, 12, \"snippet.cc\", 12,\n                                 12));\n  // Implicit unnamed field produced by an anonymous union should be absent.\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kVariable, \"Baz::\",\n                              \"(anonymous union)\", \"\", \"snippet.cc\", 14, 14));\n  // Unreferenced `operator delete` should be absent.\n  EXPECT_FALSE(IndexHasEntity(index, Entity::Kind::kFunction, \"\",\n                              \"operator delete\", \"(void *)\", \"\", 0, 0,\n                              /*is_incomplete=*/true));\n}\n\nTEST(FrontendTest, ReferencedImplicitCode) {\n  auto index = IndexSnippet(\"void func() { delete new int; }\\n\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"func\", \"()\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"operator delete\",\n                    \"(void *, __size_t)\", \"\", 0, 0,\n                    /*is_incomplete=*/true);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"operator delete\",\n                       \"(void *, __size_t)\", \"\", 0, 0, \"snippet.cc\", 1, 1,\n                       /*is_incomplete=*/true);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"operator new\",\n                    \"(__size_t)\", \"\", 0, 0, /*is_incomplete=*/true);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kFunction, \"\", \"operator new\",\n                       \"(__size_t)\", \"\", 0, 0, \"snippet.cc\", 1, 1,\n                       /*is_incomplete=*/true);\n}\n\nTEST(FrontendTest, ImplicitComparisonInstantiation) {\n  auto index = IndexSnippet(\n      \"namespace std {\\n\"\n      \"struct strong_ordering {\\n\"\n      \"  int n;\\n\"\n      \"  static const strong_ordering less, equal, greater;\\n\"\n      \"};\\n\"\n      \"constexpr strong_ordering strong_ordering::less = {-1};\\n\"\n      \"constexpr strong_ordering strong_ordering::equal = {0};\\n\"\n      \"constexpr strong_ordering strong_ordering::greater = {1};\\n\"\n      \"constexpr bool operator!=(strong_ordering, int);\\n\"\n      \"} // namespace std\\n\"\n      \"template <typename T>\\n\"\n      \"struct TestTemplateClass {\\n\"\n      \"  constexpr auto operator<=>(const TestTemplateClass<T>&) \"\n      \"const = default;\\n\"\n      \"};\\n\"\n      \"const bool X = (TestTemplateClass<int>() ==\\n\"\n      \"                TestTemplateClass<int>());\\n\",\n      {\"-std=c++20\"});\n  // Implicit `operator==` instantiated from a template implicit `operator==`\n  // coming from `auto operator<=>`.\n  EXPECT_HAS_ENTITY(\n      index, Entity::Kind::kFunction, \"TestTemplateClass<int>::\", \"operator==\",\n      \"(const TestTemplateClass<int> &) const\", \"snippet.cc\", 13, 13,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kFunction, \"TestTemplateClass<T>::\",\n          \"operator==\", \"(const TestTemplateClass<T> &) const\", \"snippet.cc\",\n          13, 13, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/std::nullopt,\n          /*implicitly_defined_for_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\", \"TestTemplateClass\",\n                           \"<T>\", \"snippet.cc\", 11, 14)));\n  EXPECT_HAS_REFERENCE(\n      index, Entity::Kind::kFunction, \"TestTemplateClass<int>::\", \"operator==\",\n      \"(const TestTemplateClass<int> &) const\", \"snippet.cc\", 13, 13,\n      \"snippet.cc\", 15, 16,\n      /*is_incomplete=*/false, /*template_prototype_entity_id=*/\n      RequiredEntityId(\n          index, Entity::Kind::kFunction, \"TestTemplateClass<T>::\",\n          \"operator==\", \"(const TestTemplateClass<T> &) const\", \"snippet.cc\",\n          13, 13, /*is_incomplete=*/false,\n          /*template_prototype_entity_id=*/std::nullopt,\n          /*implicitly_defined_for_entity_id=*/\n          RequiredEntityId(index, Entity::Kind::kClass, \"\", \"TestTemplateClass\",\n                           \"<T>\", \"snippet.cc\", 11, 14)));\n}\n\nTEST(FrontendTest, VarAndTypeAliasTemplates) {\n  auto index = IndexSnippet(\n      \"template <typename T>\\n\"                        // 1\n      \"constexpr T kPi = T(3.1415926535897932385);\\n\"  // 2\n      \"\\n\"                                             // 3\n      \"template <typename Y>\\n\"                        // 4\n      \"using Blah = Y[15];\\n\"                          // 5\n      \"\\n\"                                             // 6\n      \"int main() {\\n\"                                 // 7\n      \"  (void)kPi<double>;\\n\"                         // 8\n      \"  (void)kPi<float>;\\n\"                          // 9\n      \"  Blah<int> foo = {kPi<int>, };\\n\"              // 10\n      \"}\\n\");                                          // 11\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Blah\", \"<Y>\", \"snippet.cc\",\n                    4, 5);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Blah\", \"<Y>\",\n                       \"snippet.cc\", 4, 5, \"snippet.cc\", 10, 10);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Blah\", \"<int>\",\n                    \"snippet.cc\", 4, 5, /*is_incomplete=*/false,\n                    /*template_prototype_entity_id=*/\n                    RequiredEntityId(index, Entity::Kind::kType, \"\", \"Blah\",\n                                     \"<Y>\", \"snippet.cc\", 4, 5));\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"Blah\", \"<int>\",\n                       \"snippet.cc\", 4, 5, \"snippet.cc\", 10, 10,\n                       /*is_incomplete=*/false,\n                       /*template_prototype_entity_id=*/\n                       RequiredEntityId(index, Entity::Kind::kType, \"\", \"Blah\",\n                                        \"<Y>\", \"snippet.cc\", 4, 5));\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"T\", \"\", \"snippet.cc\", 1,\n                    1);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kType, \"\", \"T\", \"\", \"snippet.cc\", 1,\n                       1, \"snippet.cc\", 2, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kType, \"\", \"Y\", \"\", \"snippet.cc\", 4,\n                    4);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"foo\", \"\", \"snippet.cc\",\n                    10, 10);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"kPi\", \"<T>\",\n                    \"snippet.cc\", 1, 2);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"kPi\", \"<double>\",\n                    \"snippet.cc\", 1, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"kPi\", \"<double>\",\n                       \"snippet.cc\", 1, 2, \"snippet.cc\", 8, 8);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"kPi\", \"<float>\",\n                    \"snippet.cc\", 1, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"kPi\", \"<float>\",\n                       \"snippet.cc\", 1, 2, \"snippet.cc\", 9, 9);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"kPi\", \"<int>\",\n                    \"snippet.cc\", 1, 2);\n  EXPECT_HAS_REFERENCE(index, Entity::Kind::kVariable, \"\", \"kPi\", \"<int>\",\n                       \"snippet.cc\", 1, 2, \"snippet.cc\", 10, 10);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"main\", \"()\",\n                    \"snippet.cc\", 7, 11);\n}\n\nTEST(FrontendTest, AbbreviatedFunctionTemplate) {\n  auto index =\n      IndexSnippet(\"void template_function(auto arg) {}\", {\"-std=c++20\"});\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"template_function\",\n                    \"<arg:auto>(auto)\", \"snippet.cc\", 1, 1);\n}\n\nTEST(FrontendTest, CommandLineMacro) {\n  auto index = IndexSnippet(\"int MACRO;\", {\"-DMACRO=expansion\"});\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kVariable, \"\", \"expansion\", \"\",\n                    \"snippet.cc\", 1, 1);\n  int found = 0;\n  for (const auto& index_entity : index.entities) {\n    if (index_entity.full_name() == \"MACRO\") {\n      EXPECT_EQ(index_entity.kind(), Entity::Kind::kMacro);\n      // NOTE(kartynnik): Why isn't this `<command line>`?\n      EXPECT_EQ(index.locations[index_entity.location_id()].path(),\n                \"<built-in>\");\n      ++found;\n    }\n  }\n  EXPECT_EQ(found, 1);\n}\n\nTEST(FrontendTest, AliasedSymbol) {\n  auto index = IndexSnippet(\n      \"extern \\\"C\\\" int foo(void) { return 0; }\\n\"\n      \"int bar(void) __attribute__((alias(\\\"foo\\\")));\\n\"\n      \"int main(void) { bar(); return 0; }\");\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"foo\", \"()\",\n                    \"snippet.cc\", 1, 1);\n  EXPECT_HAS_ENTITY(index, Entity::Kind::kFunction, \"\", \"bar\", \"()\",\n                    \"snippet.cc\", 2, 2);\n}\n\nTEST(FrontendTest, GhostFileLocations) {\n  FlatIndex index =\n      std::move(\n          *GetSnippetIndex(\n              /*code=*/\"#include \\\"ghostfile.h\\\"\\n\",\n              /*extra_args=*/{},\n              /*fail_on_error=*/true,\n              /*extra_action=*/\n              [](const std::filesystem::path& source_dir) {\n                std::ofstream ghost_file(source_dir / \"ghostfile.h\");\n                ghost_file\n                    << \"// Copyright 2025 Google Inc. All rights reserved.\";\n                CHECK(ghost_file.good());\n              }))\n          .Export();\n\n  bool found_self = false;\n  bool found_include = false;\n  bool found_other = false;\n  for (const Location& location : index.locations) {\n    if (location.is_whole_file()) {\n      if (location.path().ends_with(\"snippet.cc\")) {\n        found_self = true;\n      } else if (location.path().ends_with(\"ghostfile.h\")) {\n        found_include = true;\n      }\n    } else if (location.is_real()) {\n      found_other = true;\n    }\n  }\n  EXPECT_TRUE(found_self);\n  EXPECT_TRUE(found_include);\n  EXPECT_FALSE(found_other);\n}\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/frontend/index_action.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/frontend/index_action.h\"\n\n#include <memory>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include \"indexer/frontend/ast_visitor.h\"\n#include \"indexer/frontend/common.h\"\n#include \"indexer/frontend/pp_callbacks.h\"\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/index/types.h\"\n#include \"indexer/merge_queue.h\"\n#include \"absl/flags/flag.h\"\n#include \"absl/log/check.h\"\n#include \"absl/strings/match.h\"\n#include \"absl/strings/string_view.h\"\n#include \"clang/AST/ASTConsumer.h\"\n#include \"clang/Frontend/CompilerInstance.h\"\n#include \"clang/Frontend/Utils.h\"\n#include \"clang/Lex/Pragma.h\"\n#include \"clang/Lex/Preprocessor.h\"\n#include \"llvm/ADT/StringRef.h\"\n\nABSL_FLAG(std::vector<std::string>, ignore_pragmas, {},\n          \"#pragma(s) to ignore, comma-separated\");\n\nnamespace oss_fuzz {\nnamespace indexer {\nclass AstConsumer : public clang::ASTConsumer {\n public:\n  explicit AstConsumer(InMemoryIndex& index, clang::CompilerInstance& compiler)\n      : index_(index), compiler_(compiler) {}\n  ~AstConsumer() override = default;\n\n  void HandleTranslationUnit(clang::ASTContext& context) override {\n    AstVisitor visitor(index_, context, compiler_);\n    visitor.TraverseDecl(context.getTranslationUnitDecl());\n  }\n\n private:\n  InMemoryIndex& index_;\n  clang::CompilerInstance& compiler_;\n};\n\nIndexAction::IndexAction(FileCopier& file_copier, MergeQueue& merge_queue)\n    : index_(std::make_unique<InMemoryIndex>(file_copier)),\n      merge_queue_(merge_queue) {}\n\nbool IndexAction::BeginSourceFileAction(clang::CompilerInstance& compiler) {\n  CHECK(index_);\n\n  dependencies_collector_ = std::make_unique<AllDependenciesCollector>();\n\n  clang::Preprocessor& preprocessor = compiler.getPreprocessor();\n  dependencies_collector_->attachToPreprocessor(preprocessor);\n  preprocessor.addPPCallbacks(\n      std::make_unique<PpCallbacks>(*index_, compiler.getSourceManager()));\n  for (const std::string& ignored_pragma :\n       absl::GetFlag(FLAGS_ignore_pragmas)) {\n    preprocessor.AddPragmaHandler(\n        new clang::EmptyPragmaHandler(ignored_pragma));\n  }\n\n  // TODO: b/409708640 - Support indexing assembly files.\n  return !absl::EndsWith(compiler.getFrontendOpts().Inputs[0].getFile(), \".S\");\n}\n\nvoid IndexAction::EndSourceFileAction() {\n  const clang::SourceManager& source_manager =\n      getCompilerInstance().getSourceManager();\n  for (const std::string& filename :\n       dependencies_collector_->getDependencies()) {\n    if (!IsRealPath(filename)) {\n      continue;\n    }\n    const auto absolute_path =\n        ToNormalizedAbsolutePath(filename, source_manager);\n    // Create a \"whole file\" location per filename to make sure files without\n    // indexed symbols are still copied and e.g. accounted for in deltas.\n    index_->GetLocationId(Location::WholeFile(absolute_path));\n  }\n  dependencies_collector_.reset();\n\n  merge_queue_.Add(std::move(index_));\n}\n\nstd::unique_ptr<clang::ASTConsumer> IndexAction::CreateASTConsumer(\n    clang::CompilerInstance& compiler, llvm::StringRef path) {\n  return std::make_unique<AstConsumer>(*index_, compiler);\n}\n\nIndexActionFactory::IndexActionFactory(FileCopier& file_copier,\n                                       MergeQueue& merge_queue)\n    : file_copier_(file_copier), merge_queue_(merge_queue) {}\n\nstd::unique_ptr<clang::FrontendAction> IndexActionFactory::create() {\n  return std::make_unique<IndexAction>(file_copier_, merge_queue_);\n}\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/frontend/index_action.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_FRONTEND_INDEX_ACTION_H_\n#define OSS_FUZZ_INFRA_INDEXER_FRONTEND_INDEX_ACTION_H_\n\n#include <memory>\n\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/merge_queue.h\"\n#include \"clang/AST/ASTConsumer.h\"\n#include \"clang/Frontend/FrontendAction.h\"\n#include \"clang/Frontend/Utils.h\"\n#include \"clang/Tooling/Tooling.h\"\n#include \"llvm/ADT/StringRef.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nclass AllDependenciesCollector : public clang::DependencyCollector {\n public:\n  // Also include files from the \"system\" locations.\n  bool needSystemDependencies() override { return true; }\n};\n\n// IndexAction provides the entry-point for the indexing tooling. This should\n// typically not be used directly, and the functions exposed in\n// indexer/frontend.h should be used instead.\nclass IndexAction : public clang::ASTFrontendAction {\n public:\n  explicit IndexAction(FileCopier& file_copier, MergeQueue& merge_queue);\n\n  bool BeginSourceFileAction(clang::CompilerInstance& compiler) override;\n  void EndSourceFileAction() override;\n\n  std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(\n      clang::CompilerInstance& compiler, llvm::StringRef) override;\n\n private:\n  std::unique_ptr<InMemoryIndex> index_;\n  MergeQueue& merge_queue_;\n  std::unique_ptr<AllDependenciesCollector> dependencies_collector_;\n};\n\nclass IndexActionFactory : public clang::tooling::FrontendActionFactory {\n public:\n  explicit IndexActionFactory(FileCopier& file_copier, MergeQueue& merge_queue);\n\n  std::unique_ptr<clang::FrontendAction> create() override;\n\n private:\n  FileCopier& file_copier_;\n  MergeQueue& merge_queue_;\n};\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_FRONTEND_INDEX_ACTION_H_\n"
  },
  {
    "path": "infra/indexer/frontend/pp_callbacks.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/frontend/pp_callbacks.h\"\n\n#include \"indexer/frontend/common.h\"\n#include \"indexer/index/types.h\"\n#include \"clang/Basic/IdentifierTable.h\"\n#include \"clang/Basic/SourceLocation.h\"\n#include \"clang/Lex/MacroInfo.h\"\n#include \"clang/Lex/PPCallbacks.h\"\n#include \"llvm/ADT/StringRef.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nLocationId PpCallbacks::GetLocationId(clang::SourceLocation start,\n                                      clang::SourceLocation end) {\n  return oss_fuzz::indexer::GetLocationId(index_, source_manager_,\n                                          start, end);\n}\n\nEntityId PpCallbacks::GetEntityIdForMacro(llvm::StringRef name,\n                                          const clang::MacroInfo* macro_info) {\n  LocationId location_id = GetLocationId(macro_info->getDefinitionLoc(),\n                                         macro_info->getDefinitionEndLoc());\n  if (location_id == kInvalidLocationId) {\n    return kInvalidEntityId;\n  }\n  return index_.GetEntityId({Entity::Kind::kMacro, \"\", name, \"\", location_id});\n}\n\nvoid PpCallbacks::MacroExpands(const clang::Token& name_token,\n                               const clang::MacroDefinition& definition,\n                               clang::SourceRange range,\n                               const clang::MacroArgs* args) {\n  llvm::StringRef name = name_token.getIdentifierInfo()->getName();\n  const clang::MacroInfo* info = definition.getMacroInfo();\n  LocationId location_id = GetLocationId(range.getBegin(), range.getEnd());\n  EntityId entity_id = GetEntityIdForMacro(name, info);\n  if (location_id != kInvalidLocationId && entity_id != kInvalidEntityId) {\n    index_.GetReferenceId({entity_id, location_id});\n  }\n}\n\nvoid PpCallbacks::MacroDefined(const clang::Token& name_token,\n                               const clang::MacroDirective* directive) {\n  llvm::StringRef name = name_token.getIdentifierInfo()->getName();\n  const clang::MacroInfo* info = directive->getMacroInfo();\n  GetEntityIdForMacro(name, info);\n}\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/frontend/pp_callbacks.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_FRONTEND_PP_CALLBACKS_H_\n#define OSS_FUZZ_INFRA_INDEXER_FRONTEND_PP_CALLBACKS_H_\n\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/index/types.h\"\n#include \"clang/Basic/SourceLocation.h\"\n#include \"clang/Lex/MacroInfo.h\"\n#include \"clang/Lex/PPCallbacks.h\"\n#include \"llvm/ADT/StringRef.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n// PpCallbacks indexes macro definitions and expansions.\nclass PpCallbacks : public clang::PPCallbacks {\n public:\n  PpCallbacks(InMemoryIndex& index, clang::SourceManager& source_manager)\n      : index_(index), source_manager_(source_manager) {}\n  ~PpCallbacks() override = default;\n\n  // clang::PPCallbacks functions:\n  void MacroExpands(const clang::Token& name,\n                    const clang::MacroDefinition& definition,\n                    clang::SourceRange range,\n                    const clang::MacroArgs* args) override;\n\n  void MacroDefined(const clang::Token& name,\n                    const clang::MacroDirective* directive) override;\n\n private:\n  LocationId GetLocationId(clang::SourceLocation start,\n                           clang::SourceLocation end);\n  EntityId GetEntityIdForMacro(llvm::StringRef name,\n                               const clang::MacroInfo* macro_info);\n\n  InMemoryIndex& index_;\n  clang::SourceManager& source_manager_;\n};\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_FRONTEND_PP_CALLBACKS_H_\n"
  },
  {
    "path": "infra/indexer/index/file_copier.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/index/file_copier.h\"\n\n#include <filesystem>  // NOLINT\n#include <string>\n#include <system_error>  // NOLINT\n#include <vector>\n\n#include \"absl/container/flat_hash_set.h\"\n#include \"absl/log/check.h\"\n#include \"absl/log/log.h\"\n#include \"absl/strings/match.h\"\n#include \"absl/strings/string_view.h\"\n#include \"absl/synchronization/mutex.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace {\n\nvoid PreparePath(std::string& path) {\n  if (!path.empty() && !path.ends_with('/')) {\n    path.append(\"/\");\n  }\n\n  CHECK(path.empty() || std::filesystem::path(path).is_absolute()) << path;\n}\n\n}  // namespace\n\nFileCopier::FileCopier(absl::string_view base_path,\n                       absl::string_view index_path,\n                       const std::vector<std::string>& extra_paths,\n                       Behavior behavior, bool skip_missing_files)\n    : base_path_(base_path),\n      extra_paths_(extra_paths),\n      index_path_(index_path),\n      behavior_(behavior),\n      skip_missing_files_(skip_missing_files) {\n  if (behavior_ == Behavior::kNoOp) {\n    return;\n  }\n\n  PreparePath(base_path_);\n  for (std::string& extra_path : extra_paths_) {\n    PreparePath(extra_path);\n  }\n}\n\nstd::string FileCopier::AbsoluteToIndexPath(absl::string_view path) const {\n  CHECK(path.starts_with('/')) << \"Absolute path expected: \" << path;\n\n  std::string result = std::string(path);\n  if (!base_path_.empty() && absl::StartsWith(path, base_path_)) {\n    result = path.substr(base_path_.size());\n  } else {\n    bool found = false;\n    for (const auto& extra_path : extra_paths_) {\n      if (!extra_path.empty() && absl::StartsWith(path, extra_path)) {\n        found = true;\n      }\n    }\n    CHECK(found) << \"File outside of --source_dir and --extra_dirs: \" << path;\n  }\n  return result;\n}\n\nvoid FileCopier::RegisterIndexedFile(absl::string_view index_path) {\n  if (behavior_ == Behavior::kNoOp) {\n    return;\n  }\n\n  absl::MutexLock lock(mutex_);\n  indexed_files_.emplace(index_path);\n}\n\nvoid FileCopier::CopyIndexedFiles() {\n  if (behavior_ == Behavior::kNoOp) {\n    return;\n  }\n\n  absl::MutexLock lock(mutex_);\n\n  for (const std::string& indexed_path : indexed_files_) {\n    std::filesystem::path src_path = indexed_path;\n    std::filesystem::path dst_path;\n    if (src_path.is_absolute()) {\n      dst_path = std::filesystem::path(index_path_) / \"absolute\" /\n                 indexed_path.substr(1);\n    } else {\n      src_path = std::filesystem::path(base_path_) / indexed_path;\n      dst_path = std::filesystem::path(index_path_) / \"relative\" / indexed_path;\n    }\n\n    if (!std::filesystem::exists(src_path)) {\n      if (!skip_missing_files_) {\n        LOG(QFATAL) << \"Source file \" << src_path\n                   << \" does not exist and skip_missing_files is false.\";\n      } else {\n        LOG(WARNING) << \"Skipping non-existent source file: \" << src_path;\n        continue;\n      }\n    }\n\n    DLOG(INFO) << \"\\nFrom: \" << src_path << \"\\n  To: \" << dst_path << \"\\n\";\n\n    std::error_code error_code;\n    // The destination directory may already exist, but report other errors.\n    (void)std::filesystem::create_directories(dst_path.parent_path(),\n                                              error_code);\n    QCHECK(!error_code) << \"Failed to create directory: \"\n                        << dst_path.parent_path()\n                        << \" (error: \" << error_code.message() << \")\";\n\n    using std::filesystem::copy_options;\n    const copy_options options = behavior_ == Behavior::kOverwriteExistingFiles\n                                     ? copy_options::overwrite_existing\n                                     : copy_options::none;\n    std::filesystem::copy_file(src_path, dst_path, options, error_code);\n    QCHECK(!error_code) << \"Failed to copy file \" << src_path << \" to \"\n                        << dst_path << \" (error: \" << error_code.message()\n                        << \")\";\n  }\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/index/file_copier.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_INDEX_FILE_COPIER_H_\n#define OSS_FUZZ_INFRA_INDEXER_INDEX_FILE_COPIER_H_\n\n#include <filesystem>  // NOLINT\n#include <string>\n#include <vector>\n\n#include \"absl/base/thread_annotations.h\"\n#include \"absl/container/flat_hash_set.h\"\n#include \"absl/strings/string_view.h\"\n#include \"absl/synchronization/mutex.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n\n// FileCopier tracks the source code files that have been copied across all\n// InMemoryIndexes for the current project. The same FileCopier is shared by\n// all InMemoryIndexes for the current project.\nclass FileCopier {\n public:\n  enum class Behavior {\n    kNoOp,\n    kFailOnExistingFiles,\n    kOverwriteExistingFiles,\n  };\n\n  FileCopier(absl::string_view base_path, absl::string_view index_path,\n             const std::vector<std::string>& extra_paths,\n             Behavior behavior = Behavior::kFailOnExistingFiles,\n             bool skip_missing_files = false);\n  FileCopier(const FileCopier&) = delete;\n\n  // Takes an absolute path. Rewrites this path into the representation it will\n  // have in the index (relative if within the source tree and absolute\n  // otherwise).\n  std::string AbsoluteToIndexPath(absl::string_view path) const;\n\n  // `index_path` is expected to be produced by `ToIndexPath`.\n  void RegisterIndexedFile(absl::string_view index_path);\n\n  // Single-threaded.\n  void CopyIndexedFiles();\n\n private:\n  std::string base_path_;\n  std::vector<std::string> extra_paths_;\n  const std::filesystem::path index_path_;\n  const Behavior behavior_;\n  const bool skip_missing_files_;\n\n  absl::Mutex mutex_;\n  absl::flat_hash_set<std::string> indexed_files_ ABSL_GUARDED_BY(mutex_);\n};\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_INDEX_FILE_COPIER_H_\n"
  },
  {
    "path": "infra/indexer/index/file_copier_unittest.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/index/file_copier.h\"\n\n#include <filesystem>  // NOLINT\n#include <fstream>\n#include <optional>\n#include <sstream>\n#include <string>\n\n#include \"gtest/gtest.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace {\nvoid CreateFile(const std::filesystem::path& path) {\n  std::filesystem::create_directories(path.parent_path());\n  std::ofstream tmp_file(path);\n  tmp_file << path.filename().string();\n  ASSERT_TRUE(tmp_file.good());\n}\n\nstd::optional<std::string> GetFileContents(const std::filesystem::path& path) {\n  std::ifstream file(path);\n  if (!file.good()) {\n    return std::nullopt;\n  }\n  std::stringstream buffer;\n  buffer << file.rdbuf();\n  return buffer.str();\n}\n}  // namespace\n\nTEST(FileCopierTest, AbsoluteToIndexPath) {\n  auto tmp_dir_path = std::filesystem::path(::testing::TempDir());\n  auto base_path = tmp_dir_path / \"src\";\n  auto index_path = tmp_dir_path / \"idx\";\n  FileCopier file_copier(base_path.string(), index_path.string(), {\"/\"});\n\n  EXPECT_EQ(file_copier.AbsoluteToIndexPath(\"/a/b/c/d.cc\"), \"/a/b/c/d.cc\");\n  EXPECT_EQ(\n      file_copier.AbsoluteToIndexPath((base_path / \"a/b/c/d.cc\").string()),\n      \"a/b/c/d.cc\");\n  EXPECT_DEATH(file_copier.AbsoluteToIndexPath(\"a/b/c/d.cc\"),\n               \"Absolute path expected\");\n}\n\nTEST(FileCopierTest, AbsoluteToIndexPathOutside) {\n  auto tmp_dir_path = std::filesystem::path(::testing::TempDir());\n  auto base_path = tmp_dir_path / \"src\";\n  auto index_path = tmp_dir_path / \"idx\";\n  FileCopier file_copier(base_path.string(), index_path.string(), {\"/sysroot\"});\n\n  EXPECT_DEATH(file_copier.AbsoluteToIndexPath(\"/a/b/c/d.cc\"), \"/a/b/c/d.cc\");\n}\n\nTEST(FileCopierTest, FileCopying) {\n  auto tmp_dir_path = std::filesystem::path(::testing::TempDir());\n  auto base_path = tmp_dir_path / \"src\";\n  auto index_path = tmp_dir_path / \"idx\";\n  auto sysroot_path = tmp_dir_path / \"sysroot\";\n  FileCopier file_copier(base_path.string(), index_path.string(),\n                         {sysroot_path.string()});\n\n  auto file_a = base_path / \"a.cc\";\n  CreateFile(file_a);\n  auto file_a_copy = index_path / \"relative/a.cc\";\n\n  auto file_b = base_path / \"x\" / \"b.cc\";\n  CreateFile(file_b);\n  auto file_b_copy = index_path / \"relative/x/b.cc\";\n\n  auto file_c = sysroot_path / \"y/z/c.cc\";\n  CreateFile(file_c);\n  auto file_c_copy = index_path / \"absolute\" /\n                     sysroot_path.lexically_relative(\"/\") / \"y/z/c.cc\";\n\n  file_copier.RegisterIndexedFile(\n      file_copier.AbsoluteToIndexPath(file_a.string()));\n  file_copier.RegisterIndexedFile(\n      file_copier.AbsoluteToIndexPath(file_b.string()));\n  file_copier.RegisterIndexedFile(\n      file_copier.AbsoluteToIndexPath(file_c.string()));\n\n  file_copier.CopyIndexedFiles();\n\n  EXPECT_EQ(GetFileContents(file_a_copy).value_or(\"\"), \"a.cc\");\n  EXPECT_EQ(GetFileContents(file_b_copy).value_or(\"\"), \"b.cc\");\n  EXPECT_EQ(GetFileContents(file_c_copy).value_or(\"\"), \"c.cc\");\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/index/in_memory_index.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/index/in_memory_index.h\"\n\n#include <algorithm>\n#include <cstddef>\n#include <iostream>\n#include <optional>\n#include <sstream>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/index/types.h\"\n#include \"absl/algorithm/container.h\"\n#include \"absl/container/flat_hash_map.h\"\n#include \"absl/container/flat_hash_set.h\"\n#include \"absl/container/node_hash_map.h\"\n#include \"absl/log/check.h\"\n#include \"absl/log/log.h\"\n#include \"absl/types/span.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace {\n\n// TODO: record the high-percentile entity counts in typical\n// translation units and adjust this accordingly. This should be large enough\n// to avoid rehashing during indexing.\nconst size_t kInitialReservationCount = 0x1000;\n\nbool HasTheSameIdentity(const Entity& lhs, const Entity& rhs) {\n  return lhs.kind() == rhs.kind() && lhs.name_prefix() == rhs.name_prefix() &&\n         lhs.name() == rhs.name() && lhs.name_suffix() == rhs.name_suffix();\n}\n\nvoid MaybePrintLinkerMessage(absl::Span<const Entity> entities,\n                             absl::Span<const Location> locations) {\n  std::stringstream stream;\n\n  // First we check the mix of complete and incomplete entities that match this\n  // identity.\n  size_t complete_count = 0;\n  size_t strong_count = 0;\n  for (const auto& entity : entities) {\n    if (!entity.is_incomplete()) {\n      complete_count++;\n      if (!entity.is_weak()) strong_count++;\n    } else {\n      // All complete entities come first.\n      break;\n    }\n  }\n  size_t incomplete_count = entities.size() - complete_count;\n\n  // If strong definitions exist, ignore weak ones.\n  if (strong_count) complete_count = strong_count;\n\n  // There are two cases where we might want to print a warning message.\n  // First, if we have an incomplete entity that shares an identity with\n  // multiple complete entities, then we cannot link this correctly.\n  // Secondly, if we have an incomplete entity that does not have a\n  // corresponding complete entity, then linking will be incomplete.\n  if (complete_count > 1 && incomplete_count) {\n    stream << \"error: multiple definitions for \" << entities[0].full_name()\n           << \"\\n\";\n  } else if (!complete_count && incomplete_count) {\n#ifndef NDEBUG\n    // TODO: Enable this in opt builds once the number of warnings is\n    // more reasonable.\n    stream << \"warning: no definition found for \" << entities[0].full_name()\n           << \"\\n\";\n#else\n    return;\n#endif  // NDEBUG\n  } else {\n    return;\n  }\n\n  for (const auto& entity : entities) {\n    const auto& location = locations[entity.location_id()];\n    stream << \"  \" << location.path() << \":\" << location.start_line() << \"-\"\n           << location.end_line()\n           << (entity.is_incomplete() ? \"\" : \" [definition]\")\n           << (entity.is_weak() ? \" [weak]\" : \"\") << \"\\n\";\n  }\n  std::cerr << stream.str();\n}\n\nstruct ComparePairFirst {\n  template <typename T1, typename T2>\n  bool operator()(const std::pair<T1, T2>& lhs,\n                  const std::pair<T1, T2>& rhs) const {\n    return lhs.first < rhs.first;\n  }\n};\n\n}  // namespace\n\nInMemoryIndex::InMemoryIndex(FileCopier& file_copier)\n    : file_copier_(file_copier) {\n  Expand(kInitialReservationCount, kInitialReservationCount,\n         kInitialReservationCount, kInitialReservationCount);\n}\n\nInMemoryIndex::~InMemoryIndex() = default;\n\nvoid InMemoryIndex::Merge(const InMemoryIndex& other) {\n  // This is guaranteed to be large enough to avoid another rehash for the rest\n  // of this merge operation. This may be a larger reservation than we need; but\n  // this is not an issue, since we almost always use the same indexes to merge\n  // into, so the overly-large reservation will be used later.\n  Expand(other.locations_.size(), other.entities_.size(),\n         other.references_.size(), other.virtual_method_links_.size());\n\n  std::vector<LocationId> new_location_ids(other.locations_.size(),\n                                           kInvalidLocationId);\n  for (const auto& [location, id] : other.locations_) {\n    new_location_ids[id] = GetIdForLocationWithIndexPath(location);\n  }\n\n  // We need to update the location_id for entities, the entity_id and\n  // location_id for references, and parent/child entity ids for virtual method\n  // links during insertion.\n\n  // Entity references point to entities with lower ids. Process them\n  // in the increasing order of old ids to ensure reference resolution.\n  using EntitiesIterator = decltype(other.entities_)::const_iterator;\n  std::vector<std::optional<EntitiesIterator>> other_entities(\n      other.entities_.size());\n  for (auto it = other.entities_.cbegin(); it != other.entities_.cend(); ++it) {\n    const EntityId old_id = it->second;\n    CHECK(old_id < other_entities.size() && !other_entities[old_id]);\n    other_entities[old_id] = it;\n  }\n  std::vector<EntityId> new_entity_ids(other.entities_.size(),\n                                       kInvalidEntityId);\n  std::vector<std::optional<SubstituteRelationship::Kind>>\n      substitute_relationships(other.entities_.size());\n  for (const auto& optional_iter : other_entities) {\n    // The fact that the CHECK above was satisfied `other_entities.size()` times\n    // means that all the `other_entities` items have values.\n    CHECK(optional_iter);\n    const auto& iter = *optional_iter;\n    const Entity& entity = iter->first;\n    const EntityId id = iter->second;\n    std::optional<EntityId> new_substitute_entity_id;\n    if (entity.substitute_relationship()) {\n      const EntityId old_substitute_entity_id =\n          entity.substitute_relationship()->substitute_entity_id();\n      CHECK_LT(old_substitute_entity_id, id);\n      new_substitute_entity_id = new_entity_ids[old_substitute_entity_id];\n      CHECK_NE(*new_substitute_entity_id, kInvalidEntityId);\n    }\n    const EntityId new_id = GetEntityId(Entity(\n        entity, /*new_location_id=*/new_location_ids[entity.location_id()],\n        new_substitute_entity_id));\n    new_entity_ids[id] = new_id;\n  }\n\n  for (const auto& [reference, id] : other.references_) {\n    GetReferenceId({new_entity_ids[reference.entity_id()],\n                    new_location_ids[reference.location_id()]});\n  }\n\n  for (const auto& [link, id] : other.virtual_method_links_) {\n    GetVirtualMethodLinkId(\n        {new_entity_ids[link.parent()], new_entity_ids[link.child()]});\n  }\n}\n\nvoid InMemoryIndex::Expand(size_t locations_count, size_t entities_count,\n                           size_t references_count,\n                           size_t virtual_method_links_count) {\n  locations_.reserve(locations_.size() + locations_count);\n  entities_.reserve(entities_.size() + entities_count);\n  references_.reserve(references_.size() + references_count);\n  virtual_method_links_.reserve(virtual_method_links_.size() +\n                                virtual_method_links_count);\n}\n\nLocationId InMemoryIndex::GetLocationId(Location location) {\n  if (location.is_real()) {\n    // Adjust paths within the base_path to be relative paths.\n    location.path_ = file_copier_.AbsoluteToIndexPath(location.path());\n  }\n  return GetIdForLocationWithIndexPath(location);\n}\n\nLocationId InMemoryIndex::GetIdForLocationWithIndexPath(\n    const Location& location) {\n  auto [iter, inserted] = locations_.insert({location, next_location_id_});\n  if (inserted) {\n    next_location_id_++;\n    if (location.is_real()) {\n      file_copier_.RegisterIndexedFile(location.path());\n    }\n  }\n\n  return iter->second;\n}\n\nEntityId InMemoryIndex::GetEntityId(const Entity& entity) {\n  // If an entity and its substitute have identical renderings and are thus\n  // indistinguishable during index merging, prevent creating self-references\n  // due to this collapse by pre-merging them here already.\n  if (entity.substitute_relationship()) {\n    const EntityId substitute_entity_id =\n        entity.substitute_relationship()->substitute_entity_id();\n    const Entity& substitute_entity = GetEntityById(substitute_entity_id);\n    if (HasTheSameIdentity(substitute_entity, entity)) {\n      return substitute_entity_id;\n    }\n  }\n\n  auto [iter, inserted] = entities_.insert({entity, next_entity_id_});\n  const EntityId entity_id = iter->second;\n  if (inserted) {\n    next_entity_id_++;\n    id_to_entity_.push_back(&iter->first);\n    if (auto relationship = entity.substitute_relationship_) {\n      CHECK_LT(relationship->substitute_entity_id(), entity_id);\n    }\n  }\n  return entity_id;\n}\n\nEntityId InMemoryIndex::GetExistingEntityId(const Entity& entity) const {\n  auto it = entities_.find(entity);\n  if (it == entities_.end()) {\n    return kInvalidEntityId;\n  }\n  return it->second;\n}\n\nconst Entity& InMemoryIndex::GetEntityById(EntityId entity_id) const {\n  CHECK_NE(entity_id, kInvalidEntityId);\n  CHECK_LT(entity_id, id_to_entity_.size());\n  return *id_to_entity_[entity_id];\n}\n\nReferenceId InMemoryIndex::GetReferenceId(const Reference& reference) {\n  auto [iter, inserted] = references_.insert({reference, next_reference_id_});\n  if (inserted) {\n    next_reference_id_++;\n  }\n  return iter->second;\n}\n\nVirtualMethodLinkId InMemoryIndex::GetVirtualMethodLinkId(\n    const VirtualMethodLink& link) {\n  auto [iter, inserted] =\n      virtual_method_links_.insert({link, next_virtual_method_link_id_});\n  if (inserted) {\n    next_virtual_method_link_id_++;\n  }\n  return iter->second;\n}\n\nFlatIndex InMemoryIndex::Export() && {\n  FlatIndex result;\n\n  // Order is important here, since until we've sorted Locations we don't have\n  // a fixed order for Entities, and similarly until both the Entities and\n  // Locations are sorted the order of the References is still being updated.\n\n  std::vector<LocationId> new_location_ids(locations_.size(),\n                                           kInvalidLocationId);\n  {\n    // First sort the locations in pairs with their original id.\n    std::vector<std::pair<Location, LocationId>> sorted_locations;\n    for (const auto& [location, id] : locations_) {\n      sorted_locations.emplace_back(location, id);\n    }\n    absl::c_sort(sorted_locations, ComparePairFirst());\n    CHECK_EQ(sorted_locations.size(), locations_.size());\n    locations_.clear();\n\n    // Now iterate through the sorted locations, building a lookup from the old\n    // to the new sorted ids, and building the results vector.\n    result.locations.reserve(sorted_locations.size());\n    LocationId new_id = 0;\n    for (auto& [location, old_id] : sorted_locations) {\n      result.locations.emplace_back(/*path=*/std::move(location.path_),\n                                    /*start_line=*/location.start_line(),\n                                    /*end_line=*/location.end_line());\n      new_location_ids[old_id] = new_id++;\n    }\n  }\n\n  std::vector<LocationId> new_entity_ids(entities_.size(), kInvalidEntityId);\n  {\n    // Repeat for entities, but updating stale location ids.\n    std::vector<std::pair<Entity, EntityId>> sorted_entities;\n    for (const auto& [entity, id] : entities_) {\n      const LocationId old_location_id = entity.location_id();\n      LocationId new_location_id = new_location_ids[old_location_id];\n      CHECK_NE(new_location_id, kInvalidLocationId);\n\n      if (entity.substitute_relationship()) {\n        CHECK_LT(entity.substitute_relationship()->substitute_entity_id(), id);\n      }\n\n      auto& iter = sorted_entities.emplace_back(entity, id);\n      Entity& new_entity = iter.first;\n      new_entity.location_id_ = new_location_id;\n    }\n    absl::c_sort(sorted_entities, ComparePairFirst());\n    CHECK_EQ(sorted_entities.size(), entities_.size());\n    entities_.clear();\n    id_to_entity_.clear();\n\n    // Now iterate through the sorted entities, building a lookup from the old\n    // to the new sorted ids, and building the results vector. Since entities\n    // are sorted by name, then by type, then by completeness and weakness (and\n    // finally by location), we can perform linking at this stage to remove\n    // incomplete entities where possible and get rid of overridden weak\n    // symbols.\n    result.entities.reserve(sorted_entities.size());\n    EntityId new_id = kInvalidEntityId;\n    std::vector<Entity> same_entities;\n    for (auto& [entity, old_id] : sorted_entities) {\n      if (!same_entities.empty() &&\n          HasTheSameIdentity(entity, same_entities[0])) {\n        same_entities.emplace_back(entity);\n        if (!entity.is_incomplete() && !entity.is_weak()) {\n          result.entities.emplace_back(std::move(entity));\n          ++new_id;\n        }\n      } else {\n        MaybePrintLinkerMessage(same_entities, result.locations);\n        same_entities = {entity};\n        result.entities.emplace_back(std::move(entity));\n        ++new_id;\n      }\n\n      new_entity_ids[old_id] = new_id;\n    }\n    MaybePrintLinkerMessage(same_entities, result.locations);\n    CHECK_EQ(new_entity_ids.size(), sorted_entities.size());\n    CHECK_LE(result.entities.size(), sorted_entities.size());\n\n    // Update the substitute entity ids.\n    for (Entity& entity : result.entities) {\n      if (entity.substitute_relationship()) {\n        entity.substitute_relationship_->entity_id_ =\n            new_entity_ids[entity.substitute_relationship_->entity_id_];\n      }\n    }\n  }\n\n  // Here we don't need to maintain a mapping from the old to the new reference\n  // ids.\n  result.references.reserve(references_.size());\n  for (const auto& [reference, id] : references_) {\n    EntityId new_entity_id = new_entity_ids[reference.entity_id()];\n    CHECK_NE(new_entity_id, kInvalidEntityId);\n    LocationId new_location_id = new_location_ids[reference.location_id()];\n    CHECK_NE(new_location_id, kInvalidLocationId);\n    result.references.emplace_back(new_entity_id, new_location_id);\n  }\n  absl::c_sort(result.references);\n  // Remove duplicates that could have arisen due to location column erasure.\n  auto last = std::unique(result.references.begin(), result.references.end());\n  result.references.erase(last, result.references.end());\n\n  // Likewise, no need to maintain the old-to-new link id mapping.\n  result.virtual_method_links.reserve(virtual_method_links_.size());\n  for (const auto& [link, id] : virtual_method_links_) {\n    EntityId new_parent = new_entity_ids[link.parent()];\n    CHECK_NE(new_parent, kInvalidEntityId);\n    EntityId new_child = new_entity_ids[link.child()];\n    CHECK_NE(new_child, kInvalidEntityId);\n    result.virtual_method_links.emplace_back(new_parent, new_child);\n  }\n  absl::c_sort(result.virtual_method_links);\n\n  return result;\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/index/in_memory_index.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_INDEX_IN_MEMORY_INDEX_H_\n#define OSS_FUZZ_INFRA_INDEXER_INDEX_IN_MEMORY_INDEX_H_\n\n#include <cstddef>\n#include <vector>\n\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/index/types.h\"\n#include \"absl/container/flat_hash_map.h\"\n#include \"absl/container/node_hash_map.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n// InMemoryIndex is a space-inefficient index structure that allows for fast\n// insertion and lookup. This is the main data-structure used for index storage\n// while building the index, and it supports both adding single entries to the\n// index and efficiently merging multiple indexes together.\nclass InMemoryIndex {\n public:\n  // `base_path` is the filesystem path of the main source root for the project\n  // being indexed. Paths within `base_path` will be expressed as relative paths\n  // in the index.\n  explicit InMemoryIndex(FileCopier& file_copier);\n\n  ~InMemoryIndex();\n\n  void Merge(const InMemoryIndex& other);\n\n  // Ensures that there is sufficient additional storage to add at least\n  // `locations_count` new unique locations, `entities_count` new unique\n  // entities, ...\n  void Expand(size_t locations_count, size_t entities_count,\n              size_t references_count, size_t virtual_method_links_count);\n\n  // The `GetXxxId` functions return the id of an existing, matching object if\n  // there is already one in the index, or allocate a new id if there is not an\n  // identical object in the index.\n  // `GetLocationId` expects a location with an absolute path if not built-in;\n  // use `ToNormalizedAbsolutePath` to obtain one.\n  LocationId GetLocationId(Location location);\n  EntityId GetEntityId(const Entity& entity);\n  const Entity& GetEntityById(EntityId entity_id) const;\n  ReferenceId GetReferenceId(const Reference& reference);\n  VirtualMethodLinkId GetVirtualMethodLinkId(const VirtualMethodLink& link);\n\n  // In contrast, `GetExistingEntityId` returns `kInvalidEntityId` if such an\n  // entity has not been passed to `GetEntityId` before.\n  EntityId GetExistingEntityId(const Entity& entity) const;\n\n  // Build a sorted FlatIndex from the contents of this index. This invalidates\n  // the contents of this InMemoryIndex, which should no longer be used.\n  // Usage:\n  //   FlatIndex& flat_index = std::move(index).Export();\n  FlatIndex Export() &&;\n\n private:\n  FileCopier& file_copier_;\n\n  // Like `GetLocationId`, but requires the path to be already index-adjusted.\n  LocationId GetIdForLocationWithIndexPath(const Location& location);\n\n  // Although we could sort location_lookup_ in advance, the performance impact\n  // on indexing if we use a btree_map is significant, and it's much faster\n  // to sort the index at the end.\n  LocationId next_location_id_ = 0;\n  absl::flat_hash_map<Location, LocationId> locations_;\n\n  EntityId next_entity_id_ = 0;\n  // Pointer stability is needed for `id_to_entity_`.\n  absl::node_hash_map<Entity, EntityId> entities_;\n  // Maps back from the entity ID to an entity in `entities_`.\n  std::vector<const Entity*> id_to_entity_;\n\n  ReferenceId next_reference_id_ = 0;\n  absl::flat_hash_map<Reference, ReferenceId> references_;\n\n  VirtualMethodLinkId next_virtual_method_link_id_ = 0;\n  absl::flat_hash_map<VirtualMethodLink, VirtualMethodLinkId>\n      virtual_method_links_;\n};\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_INDEX_IN_MEMORY_INDEX_H_\n"
  },
  {
    "path": "infra/indexer/index/in_memory_index_unittest.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/index/in_memory_index.h\"\n\n#include <cstddef>\n#include <cstdio>\n#include <filesystem>  // NOLINT\n#include <fstream>\n#include <optional>\n#include <utility>\n#include <vector>\n\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/index/types.h\"\n#include \"gtest/gtest.h\"\n#include \"absl/log/check.h\"\n#include \"absl/strings/match.h\"\n#include \"absl/types/span.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace {\nvoid PopulateLocationFiles(absl::Span<const Location> locations,\n                           const std::filesystem::path& base_path) {\n  for (const auto& location : locations) {\n    auto path = std::filesystem::path(location.path());\n    if (!path.is_absolute()) {\n      path = base_path / path;\n    }\n    std::filesystem::create_directories(path.parent_path());\n    std::ofstream tmp_file(path);\n    tmp_file << \"A\";\n    CHECK(tmp_file.good());\n  }\n}\n\ntemplate <typename T>\nstd::vector<T> EnsureSorted(std::vector<T> items) {\n  for (size_t index = 1; index < items.size(); ++index) {\n    CHECK(items[index - 1] < items[index]);\n  }\n  return items;\n}\n\nstd::vector<Location> GetTestLocations() {\n  auto tmp_dir_path = std::filesystem::path(::testing::TempDir());\n  // This should return a sorted vector of Locations.\n  std::vector<Location> locations = EnsureSorted<Location>({\n      // This path is outside base path, and should remain unmodified in the\n      // output.\n      Location((tmp_dir_path / \"last/path.cc\").string(), 0, 1),\n      Location((tmp_dir_path / \"some/file/path.cc\").string(), 0, 1),\n      Location((tmp_dir_path / \"some/file/path.cc\").string(), 0, 99),\n      Location((tmp_dir_path / \"some/other/file/path.cc\").string(), 0, 1),\n      Location((tmp_dir_path / \"some/other/file/path.cc\").string(), 0, 99),\n  });\n  PopulateLocationFiles(locations, tmp_dir_path);\n  return locations;\n}\n\nstd::vector<Entity> GetTestEntities() {\n  // This should return a sorted vector of Entities.\n  return EnsureSorted<Entity>({\n      Entity(Entity::Kind::kVariable, \"bar::\", \"foo\", \"\", 0),\n      Entity(Entity::Kind::kEnum, \"foo::\", \"bar\", \"\", 0),\n      Entity(Entity::Kind::kVariable, \"foo::\", \"bar\", \"\", 0),\n      Entity(Entity::Kind::kVariable, \"foo::\", \"bar\", \"\", 1,\n             /*is_incomplete=*/true),\n      Entity(Entity::Kind::kFunction, \"foo::\", \"bar\", \"()\", 0),\n      Entity(Entity::Kind::kFunction, \"foo::\", \"bar\", \"(int baz)\", 0),\n      Entity(Entity::Kind::kEnum, \"foo::\", \"foo\", \"\", 0),\n  });\n}\n\nstd::vector<Reference> GetTestReferences() {\n  // This should return a sorted vector of References.\n  return EnsureSorted<Reference>({\n      Reference(0, 0),\n      Reference(0, 1),\n      Reference(1, 1),\n  });\n}\n\nstd::vector<Location> GetSecondTestLocations() {\n  auto tmp_dir_path = std::filesystem::path(::testing::TempDir());\n  // This should return a sorted vector of Locations.\n  std::vector<Location> locations = EnsureSorted<Location>({\n      // This path is outside base path, and should remain unmodified in the\n      // output.\n      Location((tmp_dir_path / \"aaaa/last/path.cc\").string(), 0, 0),\n      Location((tmp_dir_path / \"aaaa/last/path.cc\").string(), 1, 1),\n      Location((tmp_dir_path / \"bbbb/last/path.cc\").string(), 1, 1),\n  });\n  PopulateLocationFiles(locations, tmp_dir_path);\n  return locations;\n}\n\nstd::vector<Entity> EnsureSubstituteReferenceOrdering(\n    std::vector<Entity> entities) {\n  for (size_t index = 0; index < entities.size(); ++index) {\n    const Entity& entity = entities[index];\n    if (entity.substitute_relationship()) {\n      CHECK_LT(entity.substitute_relationship()->substitute_entity_id(), index);\n    }\n  }\n  return entities;\n}\n\nstd::vector<Entity> GetSecondTestEntities() {\n  // This should return a sorted vector of Entities whose substitute entity\n  // reference IDs are lower than their indices in the vector.\n  return EnsureSubstituteReferenceOrdering(EnsureSorted<Entity>({\n      Entity(Entity::Kind::kClass, \"bar::\", \"Foo\", \"<T>\", 0),\n      Entity(Entity::Kind::kClass, \"bar::\", \"Foo\", \"<int>\", 0,\n             /*is_incomplete=*/false, /*is_weak=*/false,\n             /*substitute_relationship=*/\n             SubstituteRelationship(\n                 SubstituteRelationship::Kind::kIsTemplateInstantiationOf, 0)),\n      Entity(Entity::Kind::kClass, \"jar::\", \"Bar\", \"<T>\", 0),\n      Entity(Entity::Kind::kClass, \"jar::\", \"Bar\", \"<char>\", 0,\n             /*is_incomplete=*/false, /*is_weak=*/false,\n             /*substitute_relationship=*/\n             SubstituteRelationship(\n                 SubstituteRelationship::Kind::kIsTemplateInstantiationOf, 2)),\n  }));\n}\n\nstd::vector<Entity> GetThirdTestEntities() {\n  // This should return a sorted vector of Entities whose substitute entity\n  // reference IDs are lower than their indices in the vector.\n  return EnsureSubstituteReferenceOrdering(EnsureSorted<Entity>({\n      Entity(Entity::Kind::kEnum, \"bar::\", \"Baz\", \"\", 1),\n      Entity(Entity::Kind::kClass, \"bar::\", \"Foo\", \"<T>\", 0),\n      Entity(Entity::Kind::kClass, \"bar::\", \"Foo\", \"<int>\", 0,\n             /*is_incomplete=*/false, /*is_weak=*/false,\n             /*substitute_relationship=*/\n             SubstituteRelationship(\n                 SubstituteRelationship::Kind::kIsTemplateInstantiationOf, 1)),\n      Entity(Entity::Kind::kClass, \"jar::\", \"Bad\", \"<T>\", 0),\n      Entity(Entity::Kind::kClass, \"jar::\", \"Bad\", \"<char>\", 0,\n             /*is_incomplete=*/false, /*is_weak=*/false,\n             /*substitute_relationship=*/\n             SubstituteRelationship(\n                 SubstituteRelationship::Kind::kIsTemplateInstantiationOf, 3)),\n  }));\n}\n}  // namespace\n\nTEST(InMemoryIndexTest, Locations) {\n  FileCopier file_copier(\"\", ::testing::TempDir(), {\"/\"});\n  InMemoryIndex index(file_copier);\n  auto locations = GetTestLocations();\n  for (const auto& location : locations) {\n    index.GetLocationId(location);\n  }\n  FlatIndex flat_index = std::move(index).Export();\n  ASSERT_EQ(flat_index.locations.size(), locations.size());\n  for (size_t i = 0; i < flat_index.locations.size(); ++i) {\n    ASSERT_EQ(flat_index.locations[i], locations[i]);\n  }\n}\n\nTEST(InMemoryIndexTest, LocationsBasePath) {\n  auto base_path =\n      (std::filesystem::path(::testing::TempDir()) / \"some\").string();\n  FileCopier file_copier(base_path, ::testing::TempDir(), {\"/\"});\n  InMemoryIndex index(file_copier);\n  auto locations = GetTestLocations();\n  for (const auto& location : locations) {\n    index.GetLocationId(location);\n  }\n  FlatIndex flat_index = std::move(index).Export();\n  ASSERT_EQ(flat_index.locations.size(), locations.size());\n  // The first location is outside the base path, and should be unmodified.\n  ASSERT_EQ(flat_index.locations[0], locations[0]);\n  for (size_t i = 1; i < flat_index.locations.size(); ++i) {\n    // All of the other locations are inside the base path, and should be made\n    // into relative paths.\n    ASSERT_NE(flat_index.locations[i].path(), locations[i].path());\n    ASSERT_EQ(flat_index.locations[i].start_line(), locations[i].start_line());\n    ASSERT_EQ(flat_index.locations[i].end_line(), locations[i].end_line());\n    ASSERT_TRUE(\n        absl::EndsWith(locations[i].path(), flat_index.locations[i].path()));\n  }\n}\n\nTEST(InMemoryIndexTest, Entities) {\n  FileCopier file_copier(\"\", ::testing::TempDir(), {\"/\"});\n  InMemoryIndex index(file_copier);\n  auto locations = GetTestLocations();\n  auto entities = GetTestEntities();\n  for (const auto& location : locations) {\n    index.GetLocationId(location);\n  }\n  for (const auto& entity : entities) {\n    index.GetEntityId(entity);\n  }\n  FlatIndex flat_index = std::move(index).Export();\n  ASSERT_EQ(flat_index.entities.size(), entities.size() - 1);\n  for (size_t i = 0; i < flat_index.entities.size(); ++i) {\n    // There is an incomplete entity in the input, which should be linked out\n    // during the index export, so we need to skip over this entry.\n    size_t j = i < 3 ? i : i + 1;\n    ASSERT_EQ(flat_index.entities[i], entities[j]);\n  }\n}\n\nTEST(InMemoryIndexTest, SubstituteEntities) {\n  FileCopier file_copier(\"\", ::testing::TempDir(), {\"/\"});\n  InMemoryIndex index(file_copier);\n  auto locations = GetSecondTestLocations();\n  auto entities = GetSecondTestEntities();\n  for (const auto& location : locations) {\n    index.GetLocationId(location);\n  }\n  for (const auto& entity : entities) {\n    index.GetEntityId(entity);\n  }\n  FlatIndex flat_index = std::move(index).Export();\n  ASSERT_EQ(flat_index.entities.size(), entities.size());\n  ASSERT_TRUE(flat_index.entities[1].substitute_relationship().has_value());\n  EXPECT_EQ(flat_index.entities[1].substitute_relationship()->kind(),\n            SubstituteRelationship::Kind::kIsTemplateInstantiationOf);\n  EXPECT_EQ(\n      flat_index.entities[1].substitute_relationship()->substitute_entity_id(),\n      0);\n  ASSERT_TRUE(flat_index.entities[3].substitute_relationship().has_value());\n  EXPECT_EQ(flat_index.entities[3].substitute_relationship()->kind(),\n            SubstituteRelationship::Kind::kIsTemplateInstantiationOf);\n  EXPECT_EQ(\n      flat_index.entities[3].substitute_relationship()->substitute_entity_id(),\n      2);\n}\n\nTEST(InMemoryIndexTest, References) {\n  FileCopier file_copier(\"\", ::testing::TempDir(), {\"/\"});\n  InMemoryIndex index(file_copier);\n  auto locations = GetTestLocations();\n  auto entities = GetTestEntities();\n  auto references = GetTestReferences();\n  for (const auto& location : locations) {\n    index.GetLocationId(location);\n  }\n  for (const auto& entity : entities) {\n    index.GetEntityId(entity);\n  }\n  for (const auto& reference : references) {\n    index.GetReferenceId(reference);\n  }\n  FlatIndex flat_index = std::move(index).Export();\n  ASSERT_EQ(flat_index.references.size(), references.size());\n  for (size_t i = 0; i < flat_index.references.size(); ++i) {\n    ASSERT_EQ(flat_index.references[i], references[i]);\n  }\n}\n\nTEST(InMemoryIndexTest, Merge) {\n  FileCopier file_copier(\"\", ::testing::TempDir(), {\"/\"});\n  InMemoryIndex index_one(file_copier);\n  InMemoryIndex index_two(file_copier);\n  auto locations = GetTestLocations();\n  auto entities = GetTestEntities();\n  auto references = GetTestReferences();\n  for (const auto& location : locations) {\n    index_one.GetLocationId(location);\n    index_two.GetLocationId(location);\n  }\n  for (size_t i = 0; i < entities.size(); ++i) {\n    if (i < 3) {\n      index_one.GetEntityId(entities[i]);\n    }\n    index_two.GetEntityId(entities[i]);\n  }\n  for (const auto& reference : references) {\n    index_one.GetReferenceId(reference);\n  }\n\n  {\n    // First make sure that merging a single index to an empty index works.\n    InMemoryIndex index(file_copier);\n    index.Merge(index_one);\n    FlatIndex flat_index = std::move(index).Export();\n    ASSERT_EQ(flat_index.locations.size(), locations.size());\n    ASSERT_EQ(flat_index.entities.size(), 3);\n    ASSERT_EQ(flat_index.references.size(), references.size());\n  }\n\n  {\n    // Now check that merging two different indexes doesn't add duplicate\n    // entries.\n    InMemoryIndex index(file_copier);\n    index.Merge(index_one);\n    index.Merge(index_two);\n    FlatIndex flat_index = std::move(index).Export();\n    ASSERT_EQ(flat_index.locations.size(), locations.size());\n    ASSERT_EQ(flat_index.entities.size(), entities.size() - 1);\n    ASSERT_EQ(flat_index.references.size(), references.size());\n    for (size_t i = 0; i < flat_index.locations.size(); ++i) {\n      ASSERT_EQ(flat_index.locations[i], locations[i]);\n    }\n    for (size_t i = 0; i < flat_index.entities.size(); ++i) {\n      size_t j = i < 3 ? i : i + 1;\n      ASSERT_EQ(flat_index.entities[i], entities[j]);\n    }\n    for (size_t i = 0; i < flat_index.references.size(); ++i) {\n      ASSERT_EQ(flat_index.references[i], references[i]);\n    }\n  }\n}\n\nTEST(InMemoryIndexTest, MergeWithSubstituteEntities) {\n  FileCopier file_copier(\"\", ::testing::TempDir(), {\"/\"});\n  InMemoryIndex index_one(file_copier);\n  InMemoryIndex index_two(file_copier);\n  auto locations = GetSecondTestLocations();\n  auto entities_one = GetSecondTestEntities();\n  auto entities_two = GetThirdTestEntities();\n  for (const auto& location : locations) {\n    index_one.GetLocationId(location);\n    index_two.GetLocationId(location);\n  }\n  for (const auto& entity : entities_one) {\n    index_one.GetEntityId(entity);\n  }\n  for (const auto& entity : entities_two) {\n    index_two.GetEntityId(entity);\n  }\n\n  {\n    // First make sure that merging a single index to an empty index works.\n    InMemoryIndex index(file_copier);\n    index.Merge(index_one);\n    FlatIndex flat_index = std::move(index).Export();\n    ASSERT_EQ(flat_index.locations.size(), locations.size());\n    ASSERT_EQ(flat_index.entities.size(), entities_one.size());\n\n    EXPECT_EQ(flat_index.entities[0].substitute_relationship(), std::nullopt);\n    ASSERT_TRUE(flat_index.entities[1].substitute_relationship().has_value());\n    EXPECT_EQ(flat_index.entities[1].substitute_relationship()->kind(),\n              SubstituteRelationship::Kind::kIsTemplateInstantiationOf);\n    EXPECT_EQ(flat_index.entities[1]\n                  .substitute_relationship()\n                  ->substitute_entity_id(),\n              0);\n    EXPECT_EQ(flat_index.entities[2].substitute_relationship(), std::nullopt);\n    ASSERT_TRUE(flat_index.entities[3].substitute_relationship().has_value());\n    EXPECT_EQ(flat_index.entities[3].substitute_relationship()->kind(),\n              SubstituteRelationship::Kind::kIsTemplateInstantiationOf);\n    EXPECT_EQ(flat_index.entities[3]\n                  .substitute_relationship()\n                  ->substitute_entity_id(),\n              2);\n  }\n\n  {\n    // Now check that merging two different indexes doesn't add duplicate\n    // entries.\n    InMemoryIndex index(file_copier);\n    index.Merge(index_one);\n    index.Merge(index_two);\n    FlatIndex flat_index = std::move(index).Export();\n    ASSERT_EQ(flat_index.locations.size(), locations.size());\n    ASSERT_EQ(flat_index.entities.size(), 7);\n    for (size_t i = 0; i < flat_index.locations.size(); ++i) {\n      ASSERT_EQ(flat_index.locations[i], locations[i]);\n    }\n\n    ASSERT_EQ(flat_index.entities[0], entities_two[0]);  // bar::Baz\n    ASSERT_EQ(flat_index.entities[1], entities_two[1]);  // bar::Foo<T>\n    ASSERT_EQ(flat_index.entities[2], entities_two[2]);  // bar::Foo<int>\n    ASSERT_EQ(flat_index.entities[3], entities_two[3]);  // jar::Bad<T>\n    ASSERT_EQ(flat_index.entities[4], entities_two[4]);  // jar::Bad<char>\n    ASSERT_EQ(flat_index.entities[5], entities_one[2]);  // jar::Bar<T>\n    const auto& original = entities_one[3];              // jar::Bar<T>\n    ASSERT_EQ(\n        flat_index.entities[6],\n        Entity(\n            original.kind(), original.name_prefix(), original.name(),\n            original.name_suffix(), original.location_id(),\n            original.is_incomplete(), original.is_weak(),\n            SubstituteRelationship(\n                SubstituteRelationship::Kind::kIsTemplateInstantiationOf, 5)));\n  }\n}\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/index/sqlite.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/index/sqlite.h\"\n\n#include <cstddef>\n#include <filesystem>  // NOLINT\n#include <string>\n\n#include \"indexer/index/types.h\"\n#include \"absl/cleanup/cleanup.h\"\n#include \"absl/log/log.h\"\n#include \"absl/types/span.h\"\n#include \"sqlite3.h\"\n\n#define SCHEMA_VERSION \"4\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace {\n\n// We disable foreign keys and don't enforce unique constraints by default\n// to speed up index writing (and to account for forward references without\n// transactions). However, with `enable_expensive_checks`, we add these\n// afterwards.\n\nconst char kCreateDb[] =\n    \"PRAGMA foreign_keys = OFF;\\n\"\n    \"PRAGMA user_version = \" SCHEMA_VERSION\n    \";\\n\"\n    \"\\n\"\n    \"CREATE TABLE location(\\n\"\n    \"  id             INTEGER PRIMARY KEY,\\n\"\n    \"  dirname        TEXT NOT NULL,\\n\"\n    \"  basename       TEXT NOT NULL,\\n\"\n    \"  start_line     INT NOT NULL,\\n\"\n    \"  end_line       INT NOT NULL);\\n\"\n    \"\\n\"\n    \"CREATE TABLE entity(\\n\"\n    \"  id                            INTEGER PRIMARY KEY,\\n\"\n    \"  kind                          INT NOT NULL,\\n\"\n    \"  is_incomplete                 BOOLEAN,\\n\"\n    \"  name_prefix                   TEXT,\\n\"\n    \"  name                          TEXT NOT NULL,\\n\"\n    \"  name_suffix                   TEXT,\\n\"\n    \"  location_id                   INTEGER NOT NULL,\\n\"\n    \"  substitute_entity_id          INTEGER,\\n\"\n    \"  substitute_relationship_kind  INTEGER,\\n\"\n    \"  enum_value                    TEXT,\\n\"\n    \"  virtual_method_kind           INT NOT NULL,\\n\"\n    \"  FOREIGN KEY (location_id) REFERENCES location(id),\\n\"\n    \"  FOREIGN KEY (substitute_entity_id) REFERENCES entity(id),\\n\"\n    \"  CHECK(\"\n    \"  (substitute_entity_id IS NULL) == (substitute_relationship_kind IS NULL)\"\n    \"  ));\\n\"\n    \"\\n\"\n    \"CREATE TABLE reference(\\n\"\n    \"  id             INTEGER PRIMARY KEY,\\n\"\n    \"  entity_id      INTEGER NOT NULL,\\n\"\n    \"  location_id    INTEGER NOT NULL,\\n\"\n    \"  FOREIGN KEY (entity_id) REFERENCES entity(id),\\n\"\n    \"  FOREIGN KEY (location_id) REFERENCES location(id));\\n\"\n    \"\\n\"\n    \"CREATE TABLE virtual_method_link(\\n\"\n    \"  id                INTEGER PRIMARY KEY,\\n\"\n    \"  parent_entity_id  INTEGER NOT NULL,\\n\"\n    \"  child_entity_id   INTEGER NOT NULL,\\n\"\n    \"  FOREIGN KEY (parent_entity_id) REFERENCES entity(id),\\n\"\n    \"  FOREIGN KEY (child_entity_id) REFERENCES entity(id));\\n\"\n    \"\\n\"\n    \"CREATE INDEX entity_name ON entity(name);\\n\"\n    \"\\n\"\n    \"CREATE INDEX location_basename_start_line ON location(\"\n    \"  basename,\\n\"\n    \"  start_line);\\n\"\n    \"\\n\"\n    \"CREATE INDEX reference_entity_location ON reference(\"\n    \"  entity_id,\\n\"\n    \"  location_id);\\n\"\n    \"\\n\"\n    \"CREATE INDEX virtual_method_link_parent ON virtual_method_link(\"\n    \"  parent_entity_id);\";\n\n// UNIQUE indices are almost equivalent to UNIQUE column constraints (only used\n// with `enable_expensive_checks`).\nconst char kCreateUniqueIndices[] =\n    \"CREATE UNIQUE INDEX unique_location\\n\"\n    \"  ON location(dirname, basename, start_line, end_line);\\n\"\n    \"\\n\"\n    \"CREATE UNIQUE INDEX unique_entity\\n\"\n    \"  ON entity(kind, name_prefix, name, name_suffix, location_id);\\n\"\n    \"\\n\"\n    \"CREATE UNIQUE INDEX unique_reference\\n\"\n    \"  ON reference(entity_id, location_id);\\n\"\n    \"\\n\"\n    \"CREATE UNIQUE INDEX unique_link\\n\"\n    \"  ON virtual_method_link(parent_entity_id, child_entity_id);\";\n\nconst char kInsertLocation[] =\n    \"INSERT INTO location\\n\"\n    \"  (id, dirname, basename, start_line, end_line)\\n\"\n    \"  VALUES (?1, ?2, ?3, ?4, ?5);\";\n\nconst char kInsertEntity[] =\n    \"INSERT INTO entity\\n\"\n    \"  (id, kind, is_incomplete, name_prefix, name, name_suffix, location_id,\\n\"\n    \"   substitute_entity_id, substitute_relationship_kind, enum_value,\\n\"\n    \"   virtual_method_kind)\\n\"\n    \"  VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11);\";\n\nconst char kInsertReference[] =\n    \"INSERT INTO reference\\n\"\n    \"  (id, entity_id, location_id)\\n\"\n    \"  VALUES (?1, ?2, ?3);\";\n\nconst char kInsertLink[] =\n    \"INSERT INTO virtual_method_link\\n\"\n    \"  (id, parent_entity_id, child_entity_id)\\n\"\n    \"  VALUES (?1, ?2, ?3);\";\n\nconst char kFinalizeDb[] =\n    \"VACUUM;\\n\"\n    \"REINDEX;\\n\"\n    \"ANALYZE;\\n\";\n\nbool InsertLocations(sqlite3* db, absl::Span<const Location> locations) {\n  sqlite3_stmt* insert_location = nullptr;\n  if (sqlite3_prepare_v2(db, kInsertLocation, sizeof(kInsertLocation),\n                         &insert_location, nullptr) != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite compiling prepared statement failed: `\"\n               << sqlite3_errmsg(db) << \"`\";\n    return false;\n  }\n  absl::Cleanup cleanup = [insert_location] {\n    sqlite3_finalize(insert_location);\n  };\n\n  for (LocationId i = 0; i < locations.size(); ++i) {\n    const Location& location = locations[i];\n    std::filesystem::path location_path(location.path());\n    const std::string dirname = location_path.parent_path();\n    const std::string basename = location_path.filename();\n\n    if (sqlite3_bind_int64(insert_location, 1, i) != SQLITE_OK ||\n        sqlite3_bind_text(insert_location, 2, dirname.data(), dirname.size(),\n                          SQLITE_STATIC) != SQLITE_OK ||\n        sqlite3_bind_text(insert_location, 3, basename.data(), basename.size(),\n                          SQLITE_STATIC) != SQLITE_OK ||\n\n        sqlite3_bind_int(insert_location, 4, location.start_line()) !=\n            SQLITE_OK ||\n\n        sqlite3_bind_int(insert_location, 5, location.end_line()) !=\n            SQLITE_OK) {\n      LOG(ERROR) << \"sqlite binding insert_location failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n\n    if (sqlite3_step(insert_location) != SQLITE_DONE) {\n      LOG(ERROR) << \"sqlite executing insert_entity failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n\n    sqlite3_reset(insert_location);\n    sqlite3_clear_bindings(insert_location);\n  }\n\n  return true;\n}\n\nbool InsertEntities(sqlite3* db, absl::Span<const Entity> entities) {\n  sqlite3_stmt* insert_entity = nullptr;\n  if (sqlite3_prepare_v2(db, kInsertEntity, sizeof(kInsertEntity),\n                         &insert_entity, nullptr) != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite compiling prepared statement failed: `\"\n               << sqlite3_errmsg(db) << \"`\";\n    return false;\n  }\n  absl::Cleanup cleanup = [insert_entity] { sqlite3_finalize(insert_entity); };\n\n  for (EntityId i = 0; i < entities.size(); ++i) {\n    const Entity& entity = entities[i];\n    if (sqlite3_bind_int64(insert_entity, 1, i) != SQLITE_OK ||\n        sqlite3_bind_int(insert_entity, 2, static_cast<int>(entity.kind())) !=\n            SQLITE_OK ||\n        sqlite3_bind_int(insert_entity, 3,\n                         static_cast<int>(entity.is_incomplete())) !=\n            SQLITE_OK ||\n        sqlite3_bind_text(insert_entity, 5, entity.name().data(),\n                          entity.name().size(), SQLITE_STATIC) != SQLITE_OK ||\n\n        sqlite3_bind_int64(insert_entity, 7, entity.location_id()) !=\n            SQLITE_OK) {\n      LOG(ERROR) << \"sqlite binding insert_entity failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n\n    // Note that unbound parameters default to NULL, which is allowed in our\n    // schema for name_{prefix,suffix}, substitute_entity_{id,relationship}, and\n    // enum_value.\n\n    if (!entity.name_prefix().empty() &&\n        sqlite3_bind_text(insert_entity, 4, entity.name_prefix().data(),\n                          entity.name_prefix().size(),\n                          SQLITE_STATIC) != SQLITE_OK) {\n      return false;\n    }\n\n    if (!entity.name_suffix().empty() &&\n        sqlite3_bind_text(insert_entity, 6, entity.name_suffix().data(),\n                          entity.name_suffix().size(),\n                          SQLITE_STATIC) != SQLITE_OK) {\n      return false;\n    }\n\n    if (entity.substitute_relationship().has_value()) {\n      if (sqlite3_bind_int64(\n              insert_entity, 8,\n              entity.substitute_relationship()->substitute_entity_id()) !=\n          SQLITE_OK) {\n        return false;\n      }\n\n      if (sqlite3_bind_int64(\n              insert_entity, 9,\n              static_cast<int>(entity.substitute_relationship()->kind())) !=\n          SQLITE_OK) {\n        return false;\n      }\n    }\n\n    if (entity.enum_value().has_value() &&\n        sqlite3_bind_text(insert_entity, 10, entity.enum_value()->data(),\n                          entity.enum_value()->size(),\n                          SQLITE_STATIC) != SQLITE_OK) {\n      return false;\n    }\n\n    if (sqlite3_bind_int(insert_entity, 11,\n                         static_cast<int>(entity.virtual_method_kind())) !=\n        SQLITE_OK) {\n      return false;\n    }\n\n    if (sqlite3_step(insert_entity) != SQLITE_DONE) {\n      LOG(ERROR) << \"sqlite executing insert_entity failed: \"\n                 << sqlite3_errmsg(db);\n      return false;\n    }\n\n    sqlite3_reset(insert_entity);\n    sqlite3_clear_bindings(insert_entity);\n  }\n\n  return true;\n}\n\nbool InsertReferences(sqlite3* db, absl::Span<const Reference> references) {\n  sqlite3_stmt* insert_reference = nullptr;\n  if (sqlite3_prepare_v2(db, kInsertReference, sizeof(kInsertReference),\n                         &insert_reference, nullptr) != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite compiling prepared statement failed: `\"\n               << sqlite3_errmsg(db) << \"`\";\n    return false;\n  }\n  absl::Cleanup cleanup = [insert_reference] {\n    sqlite3_finalize(insert_reference);\n  };\n\n  for (ReferenceId i = 0; i < references.size(); ++i) {\n    const Reference& reference = references[i];\n    if (sqlite3_bind_int64(insert_reference, 1, i) != SQLITE_OK ||\n\n        sqlite3_bind_int64(insert_reference, 2, reference.entity_id()) !=\n            SQLITE_OK ||\n\n        sqlite3_bind_int64(insert_reference, 3, reference.location_id()) !=\n            SQLITE_OK) {\n      LOG(ERROR) << \"sqlite binding insert_reference failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n\n    if (sqlite3_step(insert_reference) != SQLITE_DONE) {\n      LOG(ERROR) << \"sqlite executing insert_reference failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n\n    sqlite3_reset(insert_reference);\n    sqlite3_clear_bindings(insert_reference);\n  }\n\n  return true;\n}\n\nbool InsertVirtualMethodLinks(sqlite3* db,\n                              absl::Span<const VirtualMethodLink> links) {\n  sqlite3_stmt* insert_link = nullptr;\n  if (sqlite3_prepare_v2(db, kInsertLink, sizeof(kInsertLink), &insert_link,\n                         nullptr) != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite compiling prepared statement failed: `\"\n               << sqlite3_errmsg(db) << \"`\";\n    return false;\n  }\n  absl::Cleanup cleanup = [insert_link] { sqlite3_finalize(insert_link); };\n\n  for (VirtualMethodLinkId i = 0; i < links.size(); ++i) {\n    const VirtualMethodLink& link = links[i];\n    if (sqlite3_bind_int64(insert_link, 1, i) != SQLITE_OK ||\n        sqlite3_bind_int64(insert_link, 2, link.parent()) != SQLITE_OK ||\n        sqlite3_bind_int64(insert_link, 3, link.child()) != SQLITE_OK) {\n      LOG(ERROR) << \"sqlite binding insert_link failed: `\" << sqlite3_errmsg(db)\n                 << \"`\";\n      return false;\n    }\n\n    if (sqlite3_step(insert_link) != SQLITE_DONE) {\n      LOG(ERROR) << \"sqlite executing insert_link failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n\n    sqlite3_reset(insert_link);\n    sqlite3_clear_bindings(insert_link);\n  }\n\n  return true;\n  return true;\n}\n}  // anonymous namespace\n\nbool SaveAsSqlite(const FlatIndex& index, const std::string& path,\n                  bool enable_expensive_checks) {\n  LOG(INFO) << \"creating in-memory database\";\n  const size_t kSqliteMmapSize = 0x1000000000ull;\n  if (sqlite3_config(SQLITE_CONFIG_SINGLETHREAD) != SQLITE_OK ||\n      sqlite3_config(SQLITE_CONFIG_MMAP_SIZE, kSqliteMmapSize,\n                     kSqliteMmapSize) != SQLITE_OK ||\n      sqlite3_initialize() != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite setup failed\";\n    return false;\n  }\n\n  sqlite3* db = nullptr;\n  char* error = nullptr;\n\n  if (sqlite3_open(\":memory:\", &db) != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite open in-memory database failed: `\"\n               << sqlite3_errmsg(db) << \"`\";\n    sqlite3_close(db);\n    return false;\n  }\n\n  absl::Cleanup cleanup = [db] { sqlite3_close(db); };\n\n  if (sqlite3_exec(db, kCreateDb, nullptr, nullptr, &error) != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite create database failed: `\" << error << \"`\";\n    sqlite3_free(error);\n    return false;\n  }\n\n  if (enable_expensive_checks) {\n    if (sqlite3_exec(db, kCreateUniqueIndices, nullptr, nullptr, &error) !=\n        SQLITE_OK) {\n      LOG(ERROR) << \"sqlite creating unique indices failed: `\" << error << \"`\";\n      sqlite3_free(error);\n      return false;\n    }\n  }\n\n  LOG(INFO) << \"inserting locations\";\n  if (!InsertLocations(db, index.locations)) {\n    return false;\n  }\n\n  LOG(INFO) << \"inserting entities\";\n  if (!InsertEntities(db, index.entities)) {\n    return false;\n  }\n\n  LOG(INFO) << \"inserting references\";\n  if (!InsertReferences(db, index.references)) {\n    return false;\n  }\n\n  LOG(INFO) << \"inserting virtual method links\";\n  if (!InsertVirtualMethodLinks(db, index.virtual_method_links)) {\n    return false;\n  }\n\n  if (enable_expensive_checks) {\n    // Enable foreign keys and check for foreign key violations.\n    if (sqlite3_exec(db, \"PRAGMA foreign_keys = ON;\", nullptr, nullptr,\n                     nullptr) != SQLITE_OK) {\n      LOG(ERROR) << \"sqlite re-enabling foreign keys failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n\n    sqlite3_stmt* foreign_key_check = nullptr;\n    if (sqlite3_prepare_v2(db, \"PRAGMA foreign_key_check;\", -1,\n                           &foreign_key_check, nullptr) != SQLITE_OK) {\n      LOG(ERROR) << \"sqlite compiling foreign_key_check failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n    absl::Cleanup fk_cleanup = [foreign_key_check] {\n      sqlite3_finalize(foreign_key_check);\n    };\n    int rc = sqlite3_step(foreign_key_check);\n    if (rc == SQLITE_ROW) {\n      LOG(ERROR) << \"sqlite foreign key check failed: violations found\";\n      return false;\n    } else if (rc != SQLITE_DONE) {\n      LOG(ERROR) << \"sqlite foreign key check execution failed: `\"\n                 << sqlite3_errmsg(db) << \"`\";\n      return false;\n    }\n  }\n\n  LOG(INFO) << \"finalizing database\";\n  if (sqlite3_exec(db, kFinalizeDb, nullptr, nullptr, &error) != SQLITE_OK) {\n    LOG(ERROR) << \"database finalization failed: `\" << error << \"`\";\n    sqlite3_free(error);\n    return false;\n  }\n\n  LOG(INFO) << \"writing out database\";\n  sqlite3* file_db = nullptr;\n  if (sqlite3_open(path.c_str(), &file_db) != SQLITE_OK) {\n    LOG(ERROR) << \"sqlite opening file_db failed\";\n    sqlite3_close(file_db);\n    return false;\n  }\n\n  bool backup_success = true;\n  sqlite3_backup* backup = sqlite3_backup_init(file_db, \"main\", db, \"main\");\n  if (!backup) {\n    backup_success = false;\n  }\n\n  if (backup_success) {\n    bool step_success = sqlite3_backup_step(backup, -1) == SQLITE_DONE;\n    bool finish_success = sqlite3_backup_finish(backup) == SQLITE_OK;\n    backup_success = step_success && finish_success;\n  }\n\n  if (!backup_success) {\n    LOG(ERROR) << \"sqlite backup to file_db failed\";\n  }\n\n  sqlite3_close(file_db);\n  return backup_success;\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/index/sqlite.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_INDEX_SQLITE_H_\n#define OSS_FUZZ_INFRA_INDEXER_INDEX_SQLITE_H_\n\n#include <string>\n\n#include \"indexer/index/types.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nbool SaveAsSqlite(const FlatIndex& index, const std::string& path,\n                  bool enable_expensive_checks = false);\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_INDEX_SQLITE_H_\n"
  },
  {
    "path": "infra/indexer/index/types.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/index/types.h\"\n\n#include <cctype>\n#include <compare>\n#include <cstdint>\n#include <optional>\n#include <string>\n#include <tuple>\n\n#include \"absl/log/check.h\"\n#include \"absl/strings/string_view.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n\nnamespace {\n\nbool IsPositiveDecimalInteger(const char* str) noexcept {\n  CHECK_NE(str, nullptr);\n  if (*str == '\\0') {\n    return false;\n  }\n  for (; *str != '\\0'; ++str) {\n    if (!isdigit(*str)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nbool IsDecimalInteger(const char* str) {\n  CHECK_NE(str, nullptr);\n  if (*str == '-') {\n    return IsPositiveDecimalInteger(str + 1);\n  }\n  return IsPositiveDecimalInteger(str);\n}\n\n}  // namespace\n\nLocation::Location(absl::string_view path, uint32_t start_line,\n                   uint32_t end_line)\n    : path_(path), start_line_(start_line), end_line_(end_line) {\n  CHECK_LE(start_line, end_line);\n}\n\n// This is implicitly used for != in C++20.\nbool operator==(const Location& lhs, const Location& rhs) {\n  return lhs.path() == rhs.path() && lhs.start_line() == rhs.start_line() &&\n         lhs.end_line() == rhs.end_line();\n}\n\n// Locations are ordered by file, then start line, then end line.\n// This is implicitly used for relational comparisons in C++20 (<, <=, >, >=).\nstd::strong_ordering operator<=>(const Location& lhs, const Location& rhs) {\n  return std::forward_as_tuple(lhs.path(), lhs.start_line(), lhs.end_line()) <=>\n         std::forward_as_tuple(rhs.path(), rhs.start_line(), rhs.end_line());\n}\n\nEntity::Entity(Kind kind, absl::string_view name_prefix, absl::string_view name,\n               absl::string_view name_suffix, LocationId location_id,\n               bool is_incomplete, bool is_weak,\n               std::optional<SubstituteRelationship> substitute_relationship,\n               std::optional<std::string> enum_value,\n               VirtualMethodKind virtual_method_kind)\n    : kind_(kind),\n      is_incomplete_(is_incomplete),\n      is_weak_(is_weak),\n      name_prefix_(name_prefix),\n      name_(name),\n      name_suffix_(name_suffix),\n      location_id_(location_id),\n      substitute_relationship_(substitute_relationship),\n      enum_value_(enum_value),\n      virtual_method_kind_(virtual_method_kind) {\n  CHECK_GT(name.size(), 0);\n  CHECK_NE(location_id, kInvalidLocationId);\n  if (kind == Kind::kEnumConstant) {\n    CHECK(enum_value && IsDecimalInteger(enum_value->c_str()));\n  } else {\n    CHECK(!enum_value.has_value());\n  }\n  if (virtual_method_kind != VirtualMethodKind::kNotAVirtualMethod) {\n    CHECK(kind == Kind::kFunction);\n  }\n}\n\nbool operator==(const Entity& lhs, const Entity& rhs) {\n  return lhs.kind() == rhs.kind() &&\n         lhs.is_incomplete() == rhs.is_incomplete() &&\n         lhs.is_weak() == rhs.is_weak() && lhs.name() == rhs.name() &&\n         lhs.name_prefix() == rhs.name_prefix() &&\n         lhs.name_suffix() == rhs.name_suffix() &&\n         lhs.location_id() == rhs.location_id() &&\n         lhs.substitute_relationship() == rhs.substitute_relationship() &&\n         lhs.enum_value() == rhs.enum_value() &&\n         lhs.virtual_method_kind() == rhs.virtual_method_kind();\n}\n\n// Entities are sorted by fully-qualified name, then by kind, then by\n// completeness, by weakness, and finally by location, substitution\n// relationship fields, enum value, and virtual method kind.\nstd::strong_ordering operator<=>(const Entity& lhs, const Entity& rhs) {\n  return std::forward_as_tuple(lhs.name_prefix(), lhs.name(), lhs.name_suffix(),\n                               lhs.kind(), lhs.is_incomplete(), lhs.is_weak(),\n                               lhs.location_id(), lhs.substitute_relationship(),\n                               lhs.enum_value(), lhs.virtual_method_kind()) <=>\n         std::forward_as_tuple(rhs.name_prefix(), rhs.name(), rhs.name_suffix(),\n                               rhs.kind(), rhs.is_incomplete(), rhs.is_weak(),\n                               rhs.location_id(), rhs.substitute_relationship(),\n                               rhs.enum_value(), rhs.virtual_method_kind());\n}\n\nReference::Reference(EntityId entity_id, LocationId location_id)\n    : entity_id_(entity_id), location_id_(location_id) {\n  CHECK_NE(entity_id, kInvalidEntityId);\n  CHECK_NE(location_id, kInvalidLocationId);\n}\n\nbool operator==(const Reference& lhs, const Reference& rhs) {\n  return lhs.entity_id() == rhs.entity_id() &&\n         lhs.location_id() == rhs.location_id();\n}\n\n// References are sorted by entity then location.\nstd::strong_ordering operator<=>(const Reference& lhs, const Reference& rhs) {\n  return std::forward_as_tuple(lhs.entity_id(), lhs.location_id()) <=>\n         std::forward_as_tuple(rhs.entity_id(), rhs.location_id());\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/index/types.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Defines the main types used for indexing, at the lowest level. These types\n// explicitly don't use pointers to express relationships to allow simple\n// serialization.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_INDEX_TYPES_H_\n#define OSS_FUZZ_INFRA_INDEXER_INDEX_TYPES_H_\n\n#include <compare>\n#include <cstdint>\n#include <optional>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include \"absl/log/check.h\"\n#include \"absl/strings/string_view.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace testing_internal {\nclass TestPeer;\n}  // namespace testing_internal\nclass InMemoryIndex;\n\nusing LocationId = uint64_t;\nusing EntityId = uint64_t;\nusing ReferenceId = uint64_t;\nusing VirtualMethodLinkId = uint64_t;\nconstexpr LocationId kInvalidLocationId = 0xffffffffffffffffull;\nconstexpr EntityId kInvalidEntityId = 0xffffffffffffffffull;\n\ninline bool IsRealPath(absl::string_view path) {\n  // Examples of built-in paths: `<built-in>` and `<command-line>`.\n  return !path.empty() && !path.starts_with('<');\n}\n\n// Represents a source-file location.\nclass Location {\n public:\n  Location(absl::string_view path, uint32_t start_line, uint32_t end_line);\n\n  static Location WholeFile(absl::string_view path) {\n    return Location(path, /*start_line=*/0, /*end_line=*/0);\n  }\n\n  inline const std::string& path() const { return path_; }\n  inline uint32_t start_line() const { return start_line_; }\n  inline uint32_t end_line() const { return end_line_; }\n\n  inline bool is_real() const { return IsRealPath(path()); }\n  inline bool is_whole_file() const {\n    return start_line_ == 0 && end_line_ == 0;\n  }\n\n private:\n  friend class InMemoryIndex;\n\n  std::string path_;\n  uint32_t start_line_;\n  uint32_t end_line_;\n};\n\nbool operator==(const Location& lhs, const Location& rhs);\nstd::strong_ordering operator<=>(const Location& lhs, const Location& rhs);\n\ntemplate <typename H>\nH AbslHashValue(H h, const Location& location) {\n  return H::combine(std::move(h), location.path(), location.start_line(),\n                    location.end_line());\n}\n\n// Represents a relationship whereby an entity's source code is shown in lieu of\n// that of another entity, typically because the latter is not explicitly\n// defined in code.\nclass SubstituteRelationship {\n public:\n  enum class Kind : uint8_t {\n    // This entity is instantiated from the substitute entity (a template).\n    // Example: Looking up Foo<int> when only Foo<T> implementation is provided.\n    kIsTemplateInstantiationOf = 1,\n\n    // This entity is implicitly defined for the substitute entity (but not in\n    // the sense of being instantiated from a template or inherited).\n    //\n    // Example: An implicit constructor / destructor is defined for a class.\n    //   Even if the class is a template instantiation, these implicit methods\n    //   are defined post-instantiation (as in `FrontendTest.TemplateMemberFn`).\n    //\n    // Non-example: Implicit `operator==` instantiation from its counterpart\n    //   `operator==` implicitly defined in a class template by\n    //     const auto operator<=>(...) const = default;\n    //   In this case that template `operator==` will be a\n    //   `kIsTemplateInstantiationOf` substitute which, in turn, will have a\n    //   `kIsImplicitlyDefinedFor` one, specifically the class template.\n    //   (See `FrontendTest.ImplicitComparisonInstantiation` for this\n    //   situation.)\n    kIsImplicitlyDefinedFor = 2,\n\n    // This entity's implementation is inherited from the base class and not\n    // overridden.\n    // (We report it as \"this implementation is inherited from another\" with a\n    // slight abuse of wording.)\n    kIsInheritedFrom = 3,\n  };\n\n  SubstituteRelationship(Kind kind, EntityId entity_id)\n      : kind_(kind), entity_id_(entity_id) {\n    CHECK_NE(entity_id, kInvalidEntityId);\n  }\n\n  Kind kind() const { return kind_; }\n  EntityId substitute_entity_id() const { return entity_id_; }\n\n  bool operator==(const SubstituteRelationship&) const = default;\n  std::strong_ordering operator<=>(const SubstituteRelationship&) const =\n      default;\n\n private:\n  friend class Entity;\n  friend class InMemoryIndex;\n\n  Kind kind_;\n  EntityId entity_id_;\n};\n\ntemplate <typename H>\nH AbslHashValue(H h, const SubstituteRelationship& relationship) {\n  return H::combine(std::move(h), relationship.kind(),\n                    relationship.substitute_entity_id());\n}\n\n// Represents a source-level entity definition.\nclass Entity {\n public:\n  enum class Kind : uint8_t {\n    // #define Macro ...\n    kMacro = 1,\n    // enum Enum { ... }\n    kEnum = 2,\n    // enum ... { EnumConstant = ... }\n    kEnumConstant = 3,\n    // int Variable = ...\n    kVariable = 4,\n    // int Function() { ... }\n    kFunction = 5,\n    // class Class { ... }; struct Class { ... };\n    kClass = 6,\n    // typedef Type int; using Type = int; union Type { ... };\n    kType = 7,\n  };\n\n  enum class VirtualMethodKind : uint8_t {\n    kNotAVirtualMethod = 0,\n    kPureVirtual = 1,\n    kNonPureVirtual = 2,\n  };\n\n  Entity(Kind kind, absl::string_view name_prefix, absl::string_view name,\n         absl::string_view name_suffix, LocationId location_id,\n         bool is_incomplete = false, bool is_weak = false,\n         std::optional<SubstituteRelationship> substitute_relationship =\n             std::nullopt,\n         std::optional<std::string> enum_value = std::nullopt,\n         VirtualMethodKind virtual_method_kind =\n             VirtualMethodKind::kNotAVirtualMethod);\n\n  // Allows to create a copy of `entity` with the ID field values replaced.\n  template <class TEntity>\n  Entity(TEntity&& entity, LocationId new_location_id,\n         std::optional<EntityId> new_substitute_entity_id)\n      : Entity(std::forward<TEntity>(entity)) {\n    location_id_ = new_location_id;\n    CHECK_EQ(substitute_relationship_.has_value(),\n             new_substitute_entity_id.has_value());\n    if (substitute_relationship_.has_value()) {\n      substitute_relationship_->entity_id_ = *new_substitute_entity_id;\n    }\n  }\n\n  // Allows to create a copy of `entity` inheriting its implementation.\n  template <class TEntity>\n  Entity(TEntity&& entity, absl::string_view new_name_prefix,\n         EntityId inherited_entity_id)\n      : Entity(std::forward<TEntity>(entity)) {\n    name_prefix_ = new_name_prefix;\n    substitute_relationship_ = SubstituteRelationship(\n        SubstituteRelationship::Kind::kIsInheritedFrom, inherited_entity_id);\n  }\n\n  inline Kind kind() const { return kind_; }\n  inline bool is_incomplete() const { return is_incomplete_; }\n  inline bool is_weak() const { return is_weak_; }\n  inline const std::string& name_prefix() const { return name_prefix_; }\n  inline const std::string& name() const { return name_; }\n  inline const std::string& name_suffix() const { return name_suffix_; }\n  inline std::string full_name() const {\n    return name_prefix() + name() + name_suffix();\n  }\n  inline LocationId location_id() const { return location_id_; }\n  inline const std::optional<SubstituteRelationship>& substitute_relationship()\n      const {\n    return substitute_relationship_;\n  }\n  inline const std::optional<std::string>& enum_value() const {\n    return enum_value_;\n  }\n  inline bool is_virtual_method() const {\n    return virtual_method_kind_ != VirtualMethodKind::kNotAVirtualMethod;\n  }\n  inline VirtualMethodKind virtual_method_kind() const {\n    return virtual_method_kind_;\n  }\n\n private:\n  friend class InMemoryIndex;\n  friend class testing_internal::TestPeer;\n\n  Kind kind_;\n\n  // If an Entity is not complete, then it is a forward declaration. Incomplete\n  // entries could be removed/merged with the corresponding complete Entities\n  // during merge.\n  bool is_incomplete_;\n\n  // If the entity is weak, it should be overridden by strong entities at link\n  // time.\n  // Always false for incomplete entities.\n  bool is_weak_;\n\n  // Name is split into three components for storage and lookup.\n  // \"foo::bar::Baz(int qux)\"\n  //   name_prefix = \"foo::bar::\"\n  //   name        = \"Baz\"\n  //   name_suffix = \"(int qux)\"\n  //\n  // The only mandatory component is `name`, the other two are optional and may\n  // not be present depending on the entity kind.\n  std::string name_prefix_;\n  std::string name_;\n  std::string name_suffix_;\n\n  LocationId location_id_;\n\n  std::optional<SubstituteRelationship> substitute_relationship_;\n\n  // Tracks the decimal value of an enum constant (only for `kEnumConstant`).\n  // (A string to support both signed and unsigned 64-bit values - and beyond,\n  // like the `__int128` extension.)\n  std::optional<std::string> enum_value_;\n\n  VirtualMethodKind virtual_method_kind_;\n};\n\nbool operator==(const Entity& lhs, const Entity& rhs);\nstd::strong_ordering operator<=>(const Entity& lhs, const Entity& rhs);\n\ntemplate <typename H>\nH AbslHashValue(H h, const Entity& entity) {\n  return H::combine(std::move(h), entity.kind(), entity.is_incomplete(),\n                    entity.is_weak(), entity.name(), entity.name_prefix(),\n                    entity.name_suffix(), entity.location_id(),\n                    entity.substitute_relationship(), entity.enum_value(),\n                    entity.virtual_method_kind());\n}\n\n// Represents a source-level reference to an entity. This may be an implicit or\n// \"hidden\" reference that doesn't involve explicitly mentioning the entity by\n// name.\nclass Reference {\n public:\n  Reference(EntityId entity_id, LocationId location_id);\n\n  EntityId entity_id() const { return entity_id_; }\n  LocationId location_id() const { return location_id_; }\n\n private:\n  friend class InMemoryIndex;\n\n  EntityId entity_id_;\n  LocationId location_id_;\n};\n\nbool operator==(const Reference& lhs, const Reference& rhs);\nstd::strong_ordering operator<=>(const Reference& lhs, const Reference& rhs);\n\ntemplate <typename H>\nH AbslHashValue(H h, const Reference& reference) {\n  return H::combine(std::move(h), reference.entity_id(),\n                    reference.location_id());\n}\n\n// Represents a link between two virtual member functions.\n// (Note that the C++ standard doesn't use the term \"method\" but we follow\n// Clang's liberal approach of `CXXMethodDecl` for brevity.)\n//\n// We mostly track immediate parent-child relationships to be able to\n// answer the question \"What virtual method implementations can be invoked as\n// `ptr->method()`?\" even for `*ptr` being of a class that doesn't override, but\n// only inherits a virtual method `child`.\n// The only exception to this is when the immediate parent doesn't have the\n// method due to name resolution ambiguity / an own set of overloads for this\n// method hiding the overload in question, in which case we skip to the lowest\n// ancestor(s) that do(es) have it:\n//   struct A { virtual void X() {} };\n//   struct B { virtual int X(int) { return 0; } };\n//   // Has no `X(int)` due to its own overload set for X.\n//   struct C: A, B { void X() override {} };\n//   // `X(int)` can still be overridden through it though!\n//   // We link `D::X(int)` directly to `B::X(int)`, bypassing `C`.\n//   struct D: C { int X(int) override { return 13; } };\n// The same behavior is observed when we remove the `X()` override from `C`\n// since `C::X()` is an ambiguity.\nclass VirtualMethodLink {\n public:\n  // `parent` and `child` should point to `Entity::Kind::kFunction` entities\n  // with `is_virtual_method() == true`.\n  VirtualMethodLink(EntityId parent, EntityId child)\n      : parent_(parent), child_(child) {\n    CHECK_NE(parent, kInvalidEntityId);\n    CHECK_NE(child, kInvalidEntityId);\n  }\n\n  EntityId parent() const { return parent_; }\n  EntityId child() const { return child_; }\n\n  bool operator==(const VirtualMethodLink&) const = default;\n  std::strong_ordering operator<=>(const VirtualMethodLink&) const = default;\n\n private:\n  EntityId parent_;\n  EntityId child_;\n};\n\ntemplate <typename H>\nH AbslHashValue(H h, const VirtualMethodLink& link) {\n  return H::combine(std::move(h), link.parent(), link.child());\n}\n\n// A simple holder for a sorted index, used as an interchange format/interface\n// definition between uses of the index.\nstruct FlatIndex {\n  std::vector<Location> locations;\n  std::vector<Entity> entities;\n  std::vector<Reference> references;\n  std::vector<VirtualMethodLink> virtual_method_links;\n};\n\nnamespace testing_internal {\n// For test use only: Provides access to some private members of the above.\nclass TestPeer {\n public:\n  static void SetSubstituteRelationship(\n      Entity& entity, const SubstituteRelationship& relationship) {\n    entity.substitute_relationship_ = relationship;\n  }\n};\n}  // namespace testing_internal\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_INDEX_TYPES_H_\n"
  },
  {
    "path": "infra/indexer/index/types_unittest.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/index/types.h\"\n\n#include <cstddef>\n#include <vector>\n\n#include \"gtest/gtest.h\"\n#include \"absl/hash/hash_testing.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nnamespace {\nstd::vector<Location> GetTestLocations() {\n  // This should return a sorted vector of Locations.\n  return {\n      Location(\"/some/file/path.cc\", 0, 1),\n      Location(\"/some/file/path.cc\", 0, 99),\n      Location(\"/some/other/file/path.cc\", 0, 1),\n      Location(\"/some/other/file/path.cc\", 0, 99),\n  };\n}\n\nstd::vector<Entity> GetTestEntities() {\n  // This should return a sorted vector of Entities.\n  return {\n      Entity(Entity::Kind::kVariable, \"bar::\", \"foo\", \"\", 0),\n      Entity(Entity::Kind::kEnum, \"foo::\", \"bar\", \"\", 0),\n      Entity(Entity::Kind::kVariable, \"foo::\", \"bar\", \"\", 0),\n      Entity(Entity::Kind::kVariable, \"foo::\", \"bar\", \"\", 1),\n      Entity(Entity::Kind::kVariable, \"foo::\", \"bar\", \"\", 1,\n             /*is_incomplete=*/true),\n      Entity(Entity::Kind::kFunction, \"foo::\", \"bar\", \"()\", 0),\n      Entity(Entity::Kind::kFunction, \"foo::\", \"bar\", \"(int baz)\", 0),\n      Entity(Entity::Kind::kEnum, \"foo::\", \"foo\", \"\", 0),\n  };\n}\n\nstd::vector<Reference> GetTestReferences() {\n  // This should return a sorted vector of References.\n  return {\n      Reference(0, 0),\n      Reference(0, 1),\n      Reference(1, 1),\n  };\n}\n}  // namespace\n\nTEST(LocationTest, TestEquality) {\n  auto locations = GetTestLocations();\n  for (size_t i = 0; i < locations.size(); ++i) {\n    for (size_t j = 0; j < locations.size(); ++j) {\n      if (i == j) {\n        ASSERT_EQ(locations[i], locations[j]) << i << \" == \" << j;\n      } else {\n        ASSERT_NE(locations[i], locations[j]) << i << \" == \" << j;\n      }\n    }\n  }\n}\n\nTEST(LocationTest, TestStrictComparison) {\n  auto locations = GetTestLocations();\n  for (size_t i = 0; i < locations.size(); ++i) {\n    for (size_t j = 0; j < locations.size(); ++j) {\n      if (i < j) {\n        ASSERT_TRUE(locations[i] < locations[j]) << i << \" < \" << j;\n        ASSERT_FALSE(locations[i] > locations[j]) << i << \" > \" << j;\n      } else if (i > j) {\n        ASSERT_FALSE(locations[i] < locations[j]) << i << \" < \" << j;\n        ASSERT_TRUE(locations[i] > locations[j]) << i << \" > \" << j;\n      } else {\n        ASSERT_FALSE(locations[i] < locations[j]) << i << \" < \" << j;\n        ASSERT_FALSE(locations[i] > locations[j]) << i << \" > \" << j;\n      }\n    }\n  }\n}\n\nTEST(LocationTest, TestComparison) {\n  auto locations = GetTestLocations();\n  for (size_t i = 0; i < locations.size(); ++i) {\n    for (size_t j = 0; j < locations.size(); ++j) {\n      if (i < j) {\n        ASSERT_TRUE(locations[i] <= locations[j]) << i << \" <= \" << j;\n        ASSERT_FALSE(locations[i] >= locations[j]) << i << \" >= \" << j;\n      } else if (i > j) {\n        ASSERT_FALSE(locations[i] <= locations[j]) << i << \" <= \" << j;\n        ASSERT_TRUE(locations[i] >= locations[j]) << i << \" >= \" << j;\n      } else {\n        ASSERT_TRUE(locations[i] <= locations[j]) << i << \" <= \" << j;\n        ASSERT_TRUE(locations[i] >= locations[j]) << i << \" >= \" << j;\n      }\n    }\n  }\n}\n\nTEST(LocationTest, TestHash) {\n  EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(GetTestLocations()));\n}\n\nTEST(EntityTest, TestEquality) {\n  auto entities = GetTestEntities();\n  for (size_t i = 0; i < entities.size(); ++i) {\n    for (size_t j = 0; j < entities.size(); ++j) {\n      if (i == j) {\n        ASSERT_EQ(entities[i], entities[j]) << i << \" == \" << j;\n      } else {\n        ASSERT_NE(entities[i], entities[j]) << i << \" == \" << j;\n      }\n    }\n  }\n}\n\nTEST(EntityTest, TestStrictComparison) {\n  auto entities = GetTestEntities();\n  for (size_t i = 0; i < entities.size(); ++i) {\n    for (size_t j = 0; j < entities.size(); ++j) {\n      if (i < j) {\n        ASSERT_TRUE(entities[i] < entities[j]) << i << \" < \" << j;\n        ASSERT_FALSE(entities[i] > entities[j]) << i << \" > \" << j;\n      } else if (i > j) {\n        ASSERT_FALSE(entities[i] < entities[j]) << i << \" < \" << j;\n        ASSERT_TRUE(entities[i] > entities[j]) << i << \" > \" << j;\n      } else {\n        ASSERT_FALSE(entities[i] < entities[j]) << i << \" < \" << j;\n        ASSERT_FALSE(entities[i] > entities[j]) << i << \" > \" << j;\n      }\n    }\n  }\n}\n\nTEST(EntityTest, TestComparison) {\n  auto entities = GetTestEntities();\n  for (size_t i = 0; i < entities.size(); ++i) {\n    for (size_t j = 0; j < entities.size(); ++j) {\n      if (i < j) {\n        ASSERT_TRUE(entities[i] <= entities[j]) << i << \" <= \" << j;\n        ASSERT_FALSE(entities[i] >= entities[j]) << i << \" >= \" << j;\n      } else if (i > j) {\n        ASSERT_FALSE(entities[i] <= entities[j]) << i << \" <= \" << j;\n        ASSERT_TRUE(entities[i] >= entities[j]) << i << \" >= \" << j;\n      } else {\n        ASSERT_TRUE(entities[i] <= entities[j]) << i << \" <= \" << j;\n        ASSERT_TRUE(entities[i] >= entities[j]) << i << \" >= \" << j;\n      }\n    }\n  }\n}\n\nTEST(EntityTest, TestHash) {\n  EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(GetTestEntities()));\n}\n\nTEST(ReferenceTest, TestEquality) {\n  auto references = GetTestReferences();\n  for (size_t i = 0; i < references.size(); ++i) {\n    for (size_t j = 0; j < references.size(); ++j) {\n      if (i == j) {\n        ASSERT_EQ(references[i], references[j]) << i << \" == \" << j;\n      } else {\n        ASSERT_NE(references[i], references[j]) << i << \" == \" << j;\n      }\n    }\n  }\n}\n\nTEST(ReferenceTest, TestStrictComparison) {\n  auto references = GetTestReferences();\n  for (size_t i = 0; i < references.size(); ++i) {\n    for (size_t j = 0; j < references.size(); ++j) {\n      if (i < j) {\n        ASSERT_TRUE(references[i] < references[j]) << i << \" < \" << j;\n        ASSERT_FALSE(references[i] > references[j]) << i << \" > \" << j;\n      } else if (i > j) {\n        ASSERT_FALSE(references[i] < references[j]) << i << \" < \" << j;\n        ASSERT_TRUE(references[i] > references[j]) << i << \" > \" << j;\n      } else {\n        ASSERT_FALSE(references[i] < references[j]) << i << \" < \" << j;\n        ASSERT_FALSE(references[i] > references[j]) << i << \" > \" << j;\n      }\n    }\n  }\n}\n\nTEST(ReferenceTest, TestComparison) {\n  auto references = GetTestReferences();\n  for (size_t i = 0; i < references.size(); ++i) {\n    for (size_t j = 0; j < references.size(); ++j) {\n      if (i < j) {\n        ASSERT_TRUE(references[i] <= references[j]) << i << \" <= \" << j;\n        ASSERT_FALSE(references[i] >= references[j]) << i << \" >= \" << j;\n      } else if (i > j) {\n        ASSERT_FALSE(references[i] <= references[j]) << i << \" <= \" << j;\n        ASSERT_TRUE(references[i] >= references[j]) << i << \" >= \" << j;\n      } else {\n        ASSERT_TRUE(references[i] <= references[j]) << i << \" <= \" << j;\n        ASSERT_TRUE(references[i] >= references[j]) << i << \" >= \" << j;\n      }\n    }\n  }\n}\n\nTEST(ReferenceTest, TestHash) {\n  EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(GetTestReferences()));\n}\n\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/init.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// This is only built/included in the open source indexer.\n#ifndef OSS_FUZZ_INFRA_INDEXER_INIT_H_\n#define OSS_FUZZ_INFRA_INDEXER_INIT_H_\n\n#include \"absl/flags/parse.h\"\n#include \"absl/flags/usage.h\"\n#include \"absl/log/initialize.h\"\n#include \"absl/strings/string_view.h\"\n\nvoid InitGoogle(absl::string_view usage, int* argc, char*** argv,\n                bool remove_flags) {\n  absl::InitializeLog();\n  absl::SetProgramUsageMessage(*argv[0]);\n  absl::ParseCommandLine(*argc, *argv);\n}\n\nvoid InitGoogleExceptChangeRootAndUser(absl::string_view usage, int* argc,\n                                       char*** argv, bool remove_flags) {\n  InitGoogle(usage, argc, argv, remove_flags);\n}\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_INIT_H_\n"
  },
  {
    "path": "infra/indexer/main.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <filesystem>  // NOLINT\n#include <memory>\n#include <string>\n#include <system_error>  // NOLINT\n#include <utility>\n#include <vector>\n\n#include \"init.h\"\n#include \"indexer/frontend/frontend.h\"\n#include \"indexer/index/file_copier.h\"\n#include \"indexer/index/sqlite.h\"\n#include \"indexer/merge_queue.h\"\n#include \"absl/flags/flag.h\"\n#include \"absl/log/check.h\"\n#include \"absl/log/log.h\"\n#include \"absl/strings/string_view.h\"\n#include \"clang/Tooling/AllTUsExecution.h\"\n#include \"clang/Tooling/CompilationDatabase.h\"\n#include \"clang/Tooling/Tooling.h\"\n#include \"llvm/Support/Error.h\"\n\nABSL_FLAG(std::string, source_dir, \"\", \"Source directory\");\nABSL_FLAG(std::string, build_dir, \"\", \"Build directory\");\nABSL_FLAG(std::string, index_dir, \"\",\n          \"Output index file directory (should be empty if it exists for a new \"\n          \"index or contain the old index for a --delta); required unless\"\n          \"--database_only is specified\");\nABSL_FLAG(std::vector<std::string>, extra_dirs, {\"/\"},\n          \"Additional source directory/-ies (comma-separated)\");\nABSL_FLAG(std::string, dry_run_regex, \"\",\n          \"If specified, dry-run only on files matching this (POSIX-like) \"\n          \"`llvm::Regex` and don't store the index\");\nABSL_FLAG(int, index_threads, 4, \"Number of parallel indexing threads\");\nABSL_FLAG(int, merge_queues, 1, \"Number of parallel merge queues\");\nABSL_FLAG(int, merge_queue_size, 16, \"Length of merge queues\");\nABSL_FLAG(bool, enable_expensive_checks, false,\n          \"Enable expensive database integrity checks\");\nABSL_FLAG(bool, ignore_indexing_errors, false, \"Ignore indexing errors\");\nABSL_FLAG(bool, delta, false,\n          \"Has no effect with --database_only (which can however be directly \"\n          \"pointed to the delta database filename for the same effect). Expects\"\n          \" --index_dir to point to an existing database. Stores a delta\"\n          \" database alongside it only for the translation units in\"\n          \"`compile_commands.json` (for incremental indexing). IMPORTANT: The \"\n          \"latter should contain all the translation units dependent on any \"\n          \"files changed since the original index was built. Source files that \"\n          \"get indexed are copied to --index_dir (again)\");\nABSL_FLAG(std::string, database_only, \"\",\n          \"Do not copy source files, only build the index database at the given\"\n          \" location (--index_dir is not effective in that case)\");\nABSL_FLAG(bool, skip_missing_files, false,\n          \"If set to true, missing source files will be skipped with a warning.\"\n          \" If false, the indexer will error out on missing files.\");\n\nstatic constexpr char kIndexDbName[] = \"db.sqlite\";\nstatic constexpr char kDeltaDbName[] = \"delta.sqlite\";\n\nint main(int argc, char** argv) {\n  using oss_fuzz::indexer::FileCopier;\n  using oss_fuzz::indexer::MergeQueue;\n  using oss_fuzz::indexer::SaveAsSqlite;\n  using clang::tooling::AllTUsToolExecutor;\n  using clang::tooling::CompilationDatabase;\n\n#ifdef NO_CHANGE_ROOT_AND_USER\n  // When running inside a container, we cannot drop privileges.\n  InitGoogleExceptChangeRootAndUser(argv[0], &argc, &argv, true);\n#else\n  InitGoogle(argv[0], &argc, &argv, true);\n#endif\n\n  const std::string& source_dir = absl::GetFlag(FLAGS_source_dir);\n  const std::string& build_dir = absl::GetFlag(FLAGS_build_dir);\n  const std::string& index_dir = absl::GetFlag(FLAGS_index_dir);\n  const std::string& database_only = absl::GetFlag(FLAGS_database_only);\n  const std::vector<std::string>& extra_dirs = absl::GetFlag(FLAGS_extra_dirs);\n  const bool delta = absl::GetFlag(FLAGS_delta);\n\n#ifndef NDEBUG\n  LOG(ERROR) << \"indexer is built without optimisations. Use 'blaze run -c opt'\"\n             << \" for indexing larger codebases, or this will be extra slow.\";\n#endif\n\n  std::string error;\n  auto db = CompilationDatabase::autoDetectFromDirectory(build_dir, error);\n  if (!db) {\n    LOG(ERROR) << \"Failed to load compilation database: \" << error;\n    return 1;\n  }\n\n  const std::string& dry_run_regex = absl::GetFlag(FLAGS_dry_run_regex);\n  if (!dry_run_regex.empty()) {\n    clang::tooling::Filter.setValue(dry_run_regex);\n  }\n\n  std::string index_path = database_only;\n  FileCopier::Behavior behavior = FileCopier::Behavior::kNoOp;\n  if (database_only.empty()) {\n    if (delta) {\n      index_path = std::filesystem::path(index_dir) / kDeltaDbName;\n      behavior = FileCopier::Behavior::kOverwriteExistingFiles;\n    } else {\n      index_path = std::filesystem::path(index_dir) / kIndexDbName;\n      if (std::filesystem::exists(index_path)) {\n        LOG(ERROR) << \"Index database '\" << index_path\n                   << \"' already exists. Either specify an empty --index_dir or\"\n                      \"use --delta or --database_only\";\n        return 1;\n      }\n      behavior = FileCopier::Behavior::kFailOnExistingFiles;\n    }\n  }\n\n  FileCopier file_copier(source_dir, index_dir, extra_dirs, behavior,\n                         absl::GetFlag(FLAGS_skip_missing_files));\n\n  std::unique_ptr<MergeQueue> merge_queue = MergeQueue::Create(\n      absl::GetFlag(FLAGS_merge_queues), absl::GetFlag(FLAGS_merge_queue_size));\n\n  auto executor = AllTUsToolExecutor(*db, absl::GetFlag(FLAGS_index_threads));\n  auto index_actions =\n      oss_fuzz::indexer::GetIndexActions(file_copier, *merge_queue);\n  auto index_error = executor.execute(index_actions);\n  if (index_error) {\n    LOG(ERROR) << \"Indexing errors:\\n\"\n               << llvm::toString(std::move(index_error));\n    if (!absl::GetFlag(FLAGS_ignore_indexing_errors)) {\n      merge_queue->Cancel();\n      std::error_code ignored_error_code;\n      std::filesystem::remove_all(std::filesystem::path(index_dir),\n                                  ignored_error_code);\n      return 1;\n    }\n  }\n\n  merge_queue->WaitUntilComplete();\n  auto index = merge_queue->TakeIndex();\n  if (!index) {\n    LOG(ERROR) << \"Failed to create index\";\n    std::error_code ignored_error_code;\n    std::filesystem::remove_all(std::filesystem::path(index_dir),\n                                ignored_error_code);\n    return 1;\n  }\n\n  if (!dry_run_regex.empty()) {\n    return 0;\n  }\n\n  LOG(INFO) << \"copying files\";\n  file_copier.CopyIndexedFiles();\n\n  LOG(INFO) << \"exporting index\";\n  auto flat_index = std::move(*index).Export();\n\n  bool saved = SaveAsSqlite(flat_index, index_path,\n                            absl::GetFlag(FLAGS_enable_expensive_checks));\n  return saved ? 0 : 1;\n}\n"
  },
  {
    "path": "infra/indexer/merge_queue.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/merge_queue.h\"\n\n#include <atomic>\n#include <cstddef>\n#include <memory>\n#include <queue>\n#include <thread>  // NOLINT\n#include <utility>\n#include <vector>\n\n#include \"indexer/index/in_memory_index.h\"\n#include \"indexer/queue_state.h\"\n#include \"absl/base/thread_annotations.h\"\n#include \"absl/log/check.h\"\n#include \"absl/synchronization/mutex.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nMergeQueue::~MergeQueue() = default;\n\n// Single threaded implementation of the MergeQueue interface, backed by a\n// ManagedQueue merging into a single owned InMemoryIndex.\nclass SingleThreadMergeQueue : public MergeQueue {\n public:\n  explicit SingleThreadMergeQueue(int queue_limit = 16);\n  ~SingleThreadMergeQueue() override\n      ABSL_LOCKS_EXCLUDED(queue_mutex_, index_mutex_);\n\n  void Add(std::unique_ptr<InMemoryIndex> index) override\n      ABSL_LOCKS_EXCLUDED(queue_mutex_);\n  void WaitUntilComplete() override;\n  void Cancel() override;\n  std::unique_ptr<InMemoryIndex> TakeIndex() override\n      ABSL_LOCKS_EXCLUDED(index_mutex_);\n\n private:\n  bool WaitForWriting() ABSL_EXCLUSIVE_LOCKS_REQUIRED(queue_mutex_);\n  bool WaitForReading() ABSL_EXCLUSIVE_LOCKS_REQUIRED(queue_mutex_);\n\n  void ThreadFunction() ABSL_LOCKS_EXCLUDED(queue_mutex_, index_mutex_);\n\n  absl::Mutex index_mutex_;\n  std::unique_ptr<InMemoryIndex> index_ ABSL_GUARDED_BY(index_mutex_);\n\n  const int queue_limit_;\n  absl::Mutex queue_mutex_;\n  QueueState state_ ABSL_GUARDED_BY(queue_mutex_);\n  std::queue<std::unique_ptr<InMemoryIndex>> queue_\n      ABSL_GUARDED_BY(queue_mutex_);\n\n  std::jthread thread_;\n};\n\nSingleThreadMergeQueue::SingleThreadMergeQueue(int queue_limit)\n    : index_(nullptr),\n      queue_limit_(queue_limit),\n      state_(QueueState::QueueType::kMerge) {\n  thread_ = std::jthread(&SingleThreadMergeQueue::ThreadFunction, this);\n}\n\nSingleThreadMergeQueue::~SingleThreadMergeQueue() { state_.SetDestroyed(); }\n\nbool SingleThreadMergeQueue::WaitForWriting() {\n  return state_.IsWaiting() || state_.IsFinished() ||\n         queue_.size() < queue_limit_;\n}\n\nbool SingleThreadMergeQueue::WaitForReading() {\n  return state_.IsWaiting() || state_.IsFinished() || !queue_.empty();\n}\n\nvoid SingleThreadMergeQueue::ThreadFunction() {\n  while (true) {\n    std::unique_ptr<InMemoryIndex> index_to_merge = nullptr;\n\n    {\n      absl::MutexLock queue_lock(queue_mutex_);\n      queue_mutex_.Await(\n        absl::Condition(this, &SingleThreadMergeQueue::WaitForReading)\n      );\n\n      // Either the queue has finished, or the queue is empty and the caller is\n      // waiting for us to finish.\n      if (state_.IsFinished() || queue_.empty()) {\n        return;\n      }\n\n      index_to_merge = std::move(queue_.front());\n      queue_.pop();\n    }  // Drop queue_mutex_\n\n    if (index_to_merge) {\n      absl::MutexLock index_lock(index_mutex_);\n      if (!index_) {\n        index_ = std::move(index_to_merge);\n      } else {\n        index_->Merge(*index_to_merge);\n        index_to_merge.reset();\n      }\n    }\n  }\n}\n\nvoid SingleThreadMergeQueue::Add(std::unique_ptr<InMemoryIndex> new_index) {\n  absl::MutexLock queue_lock(queue_mutex_);\n  state_.SetAdded();\n  queue_mutex_.Await(\n      absl::Condition(this, &SingleThreadMergeQueue::WaitForWriting));\n  if (!state_.IsFinished()) {\n    queue_.push(std::move(new_index));\n  }\n}\n\nvoid SingleThreadMergeQueue::WaitUntilComplete() {\n  {\n    absl::MutexLock queue_lock(queue_mutex_);\n    state_.SetWaiting();\n  }\n\n  thread_.join();\n\n  {\n    absl::MutexLock queue_lock(queue_mutex_);\n    state_.SetFinished();\n  }\n}\n\nvoid SingleThreadMergeQueue::Cancel() {\n  {\n    absl::MutexLock queue_lock(queue_mutex_);\n    state_.SetFinished(/*cancelled=*/true);\n  }\n\n  thread_.join();\n\n  (void)TakeIndex();\n}\n\nstd::unique_ptr<InMemoryIndex> SingleThreadMergeQueue::TakeIndex() {\n  {\n    absl::MutexLock queue_lock(queue_mutex_);\n    state_.SetTaken();\n  }\n\n  absl::MutexLock index_lock(index_mutex_);\n  return std::move(index_);\n}\n\n// Parallel merge queue implementation which round-robin schedules incoming\n// merge tasks onto one-of-N internal SingleThreadMergeQueues, and then once\n// indexing is complete does a parallel merge of those queues to produce a\n// single result index.\nclass ParallelMergeQueue : public MergeQueue {\n public:\n  explicit ParallelMergeQueue(int queue_count, int queue_limit = 16);\n  ~ParallelMergeQueue() override;\n\n  void Add(std::unique_ptr<InMemoryIndex> index) override;\n  void WaitUntilComplete() override;\n  void Cancel() override;\n  std::unique_ptr<InMemoryIndex> TakeIndex() override;\n\n private:\n  QueueState state_;\n  std::atomic<size_t> next_queue_;\n  std::vector<std::unique_ptr<SingleThreadMergeQueue>> queues_;\n};\n\nParallelMergeQueue::ParallelMergeQueue(int queue_count, int queue_limit)\n    : state_(QueueState::QueueType::kMerge), next_queue_(0) {\n  for (int i = 0; i < queue_count; ++i) {\n    queues_.emplace_back(std::make_unique<SingleThreadMergeQueue>(queue_limit));\n  }\n}\n\nParallelMergeQueue::~ParallelMergeQueue() { state_.SetDestroyed(); }\n\nvoid ParallelMergeQueue::Add(std::unique_ptr<InMemoryIndex> index) {\n  state_.SetAdded();\n  size_t queue_index = next_queue_.fetch_add(1, std::memory_order_relaxed);\n  queues_[queue_index % queues_.size()]->Add(std::move(index));\n}\n\nvoid ParallelMergeQueue::WaitUntilComplete() {\n  state_.SetWaiting();\n  while (queues_.size() > 1) {\n    auto merge_into = std::move(queues_.back());\n    queues_.pop_back();\n\n    auto merge_from = std::move(queues_.back());\n    queues_.pop_back();\n\n    merge_from->WaitUntilComplete();\n    merge_into->Add(merge_from->TakeIndex());\n\n    queues_.push_back(std::move(merge_into));\n  }\n\n  CHECK_EQ(queues_.size(), 1);\n  queues_[0]->WaitUntilComplete();\n  state_.SetFinished();\n}\n\nvoid ParallelMergeQueue::Cancel() {\n  state_.SetFinished(/*cancelled=*/true);\n  for (auto& queue : queues_) {\n    queue->Cancel();\n  }\n  state_.SetTaken();\n}\n\nstd::unique_ptr<InMemoryIndex> ParallelMergeQueue::TakeIndex() {\n  state_.SetTaken();\n  return queues_[0]->TakeIndex();\n}\n\n// static\nstd::unique_ptr<MergeQueue> MergeQueue::Create(int queue_count,\n                                               int queue_length) {\n  if (queue_count == 1) {\n    return std::make_unique<SingleThreadMergeQueue>(queue_length);\n  } else {\n    return std::make_unique<ParallelMergeQueue>(queue_count, queue_length);\n  }\n}\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/merge_queue.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_MERGE_QUEUE_H_\n#define OSS_FUZZ_INFRA_INDEXER_MERGE_QUEUE_H_\n\n#include <memory>\n\n#include \"indexer/index/in_memory_index.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\n// Interface for the merging queue.\n//\n// The `MergeQueue::Create` class function should be used to create an\n// appropriate queue instance for the provided parameters.\nclass MergeQueue {\n public:\n  virtual ~MergeQueue();\n\n  // Add implementations are required to be thread-safe, and support being\n  // called from multiple threads in parallel.\n  virtual void Add(std::unique_ptr<InMemoryIndex> index) = 0;\n\n  // WaitUntilComplete should ensure that all currently-queued merge tasks are\n  // complete before returning. It does not provide any guarantee that all\n  // future merge tasks are complete, so it should be ensured that all merge\n  // tasks have been queued (by a call to Add) before this is used.\n  virtual void WaitUntilComplete() = 0;\n\n  // Cancel should ensure that all currently queued merge tasks are cancelled\n  // or completed before returning. After cancellation, further attempts to add\n  // new merge tasks is considered a bug (and will result in a crash).\n  virtual void Cancel() = 0;\n\n  // TakeIndex should only be called after WaitUntilComplete has been called.\n  // It takes ownership of the completed merged index.\n  virtual std::unique_ptr<InMemoryIndex> TakeIndex() = 0;\n\n  static std::unique_ptr<MergeQueue> Create(int queue_count = 1,\n                                            int queue_length = 16);\n};\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_MERGE_QUEUE_H_\n"
  },
  {
    "path": "infra/indexer/queue_state.cc",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"indexer/queue_state.h\"\n\n#include <atomic>\n#include <string>\n#include <vector>\n\n#include \"absl/log/check.h\"\n#include \"absl/strings/str_join.h\"\n\nnamespace oss_fuzz {\nnamespace indexer {\nQueueState::QueueState(QueueType type) : type_(type) {}\n\nvoid QueueState::SetAdded() {\n  Advance(static_cast<State>(kNotAdded | kAdded), kAdded);\n}\n\nvoid QueueState::SetWaiting() {\n  Advance(static_cast<State>(kNotAdded | kAdded), kWaiting);\n}\n\nvoid QueueState::SetFinished(bool cancelled) {\n  if (cancelled) {\n    Advance(static_cast<State>(kNotAdded | kAdded | kWaiting), kFinished);\n  } else {\n    Advance(kWaiting, kFinished);\n  }\n}\n\nvoid QueueState::SetTaken() {\n  CHECK(type_ == QueueType::kMerge);\n  Advance(kFinished, kTaken);\n}\n\nvoid QueueState::SetDestroyed() {\n  if (type_ == QueueType::kIndex) {\n    Advance(static_cast<State>(kNotAdded | kFinished), kDestroyed);\n  } else {\n    Advance(static_cast<State>(kNotAdded | kTaken), kDestroyed);\n  }\n}\n\nbool QueueState::IsWaiting() const {\n  return state_.load(std::memory_order_acquire) == kWaiting;\n}\n\nbool QueueState::IsFinished() const {\n  return state_.load(std::memory_order_acquire) >= kFinished;\n}\n\nstd::string QueueState::StateToString(State state) {\n  std::vector<std::string> parts;\n  if (state & State::kNotAdded) {\n    parts.push_back(\"kNotAdded\");\n  }\n  if (state & State::kAdded) {\n    parts.push_back(\"kAdded\");\n  }\n  if (state & State::kWaiting) {\n    parts.push_back(\"kWaiting\");\n  }\n  if (state & State::kFinished) {\n    parts.push_back(\"kFinished\");\n  }\n  if (state & State::kTaken) {\n    parts.push_back(\"kTaken\");\n  }\n  if (state & State::kDestroyed) {\n    parts.push_back(\"kDestroyed\");\n  }\n  return absl::StrJoin(parts, \"|\");\n}\n\nvoid QueueState::Advance(State from, State to) {\n  State current = state_.load(std::memory_order_acquire);\n  CHECK_NE((current & from), 0)\n      << \"Found \" << StateToString(current) << \" while advancing \"\n      << StateToString(from) << \" -> \" << StateToString(to);\n  if (current != to) {\n    while (!state_.compare_exchange_weak(current, to, std::memory_order_release,\n                                         std::memory_order_relaxed)) {\n      CHECK_NE((current & from), 0)\n          << \"Found \" << StateToString(current) << \" while advancing \"\n          << StateToString(from) << \" -> \" << StateToString(to);\n    }\n  }\n}\n}  // namespace indexer\n}  // namespace oss_fuzz\n"
  },
  {
    "path": "infra/indexer/queue_state.h",
    "content": "// Copyright 2026 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OSS_FUZZ_INFRA_INDEXER_QUEUE_STATE_H_\n#define OSS_FUZZ_INFRA_INDEXER_QUEUE_STATE_H_\n\n#include <atomic>\n#include <string>\n\nnamespace oss_fuzz {\nnamespace indexer {\n// Since the IndexQueues and MergeQueues have a non-trivial state space, and run\n// across multiple threads, we have a small thread-safe state-machine used to\n// ensure that only valid state transitions are permitted.\n//\n// The logic is similar for both queue types, for illustration the allowed\n// transitions for an IndexQueue are:\n//\n//   kNotAdded -> kAdded     on queue->Add()\n//             -> kWaiting   on queue->WaitUntilComplete() entry\n//             -> kDestroyed on ~queue\n//\n//   kAdded    -> kWaiting   on queue->WaitUntilComplete() entry\n//\n//   kWaiting  -> kFinished    on queue->WaitUntilComplete() exit\n//\n//   kFinished -> kDestroyed on ~queue\n//\n// And for a MergeQueue:\n//\n//   kNotAdded -> kAdded     on queue->Add()\n//             -> kWaiting   on queue->WaitUntilComplete() entry\n//             -> kDestroyed on ~queue\n//\n//   kAdded    -> kWaiting   on queue->WaitUntilComplete() entry\n//\n//   kWaiting  -> kFinished    on queue->WaitUntilComplete() exit\n//\n//   kFinished -> kTaken     on queue->TakeIndex()\n//\n//   kTaken    -> kDestroyed on ~queue\n//\n// Attempting any other transitions will result in a CHECK failure.\nclass QueueState {\n public:\n  enum class QueueType { kIndex, kMerge };\n  explicit QueueState(QueueType type);\n\n  void SetAdded();\n  void SetWaiting();\n  void SetFinished(bool cancelled = false);\n  void SetTaken();\n  void SetDestroyed();\n\n  bool IsWaiting() const;\n  bool IsFinished() const;\n\n private:\n  enum State {\n    kNotAdded = 1,\n    kAdded = 1 << 1,\n    kWaiting = 1 << 2,\n    // Note that ordering is important here, and all states following kFinished\n    // are considered \"finished\".\n    kFinished = 1 << 3,\n    kTaken = 1 << 4,\n    kDestroyed = 1 << 5,\n  };\n\n  std::string StateToString(State state);\n  void Advance(State from, State to);\n\n  const QueueType type_;\n  std::atomic<State> state_ = kNotAdded;\n};\n}  // namespace indexer\n}  // namespace oss_fuzz\n\n#endif  // OSS_FUZZ_INFRA_INDEXER_QUEUE_STATE_H_\n"
  },
  {
    "path": "infra/indexer/ubuntu-20-04.Dockerfile",
    "content": "FROM gcr.io/oss-fuzz-base/base-clang-full:ubuntu-20-04\n\nRUN mkdir /indexer\nWORKDIR /indexer\nCOPY . /indexer\n\nRUN apt-get update && apt-get install -y libsqlite3-dev make zlib1g-dev\nRUN mkdir build && cd build && cmake .. && cmake --build . -j -v\n"
  },
  {
    "path": "infra/indexer/ubuntu-24-04.Dockerfile",
    "content": "FROM gcr.io/oss-fuzz-base/base-clang-full:ubuntu-24-04\n\nRUN mkdir /indexer\nWORKDIR /indexer\nCOPY . /indexer\n\nRUN apt-get update && apt-get install -y libsqlite3-dev make zlib1g-dev\nRUN mkdir build && cd build && cmake .. && cmake --build . -j -v\n"
  },
  {
    "path": "infra/manifest.py",
    "content": "#! /usr/bin/env python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script for pushing manifest files to docker that point to AMD64 and ARM\nimages.\"\"\"\nimport logging\nimport subprocess\nimport sys\n\n\ndef push_manifest(image):\n  \"\"\"Pushes a manifest file in place of |image| for ARM and AMD64 versions of\n  that image.\"\"\"\n  subprocess.run(['docker', 'pull', image], check=True)\n  amd64_image = f'{image}:manifest-amd64'\n  subprocess.run(['docker', 'tag', image, amd64_image], check=True)\n  subprocess.run(['docker', 'push', amd64_image], check=True)\n\n  arm_version = f'{image}-testing-arm'\n  subprocess.run(['docker', 'pull', arm_version], check=True)\n  arm64_image = f'{image}:manifest-arm64v8'\n  subprocess.run(['docker', 'tag', arm_version, arm64_image], check=True)\n\n  subprocess.run([\n      'docker', 'manifest', 'create', image, '--amend', arm64_image, '--amend',\n      amd64_image\n  ],\n                 check=True)\n  subprocess.run(['docker', 'manifest', 'push', image], check=True)\n  return True\n\n\ndef main():\n  \"\"\"Sets up manifests for base-builder and base-runner so they can be used for\n  ARM builds.\"\"\"\n  logging.info('Doing simple gcloud command to ensure 2FA passes. '\n               'Otherwise docker push fails.')\n  subprocess.run(['gcloud', 'projects', 'list', '--limit=1'], check=True)\n\n  images = [\n      'gcr.io/oss-fuzz-base/base-builder', 'gcr.io/oss-fuzz-base/base-runner'\n  ]\n  results = [push_manifest(image) for image in images]\n  return 0 if all(results) else 1\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/pr_helper.py",
    "content": "#!/usr/bin/env python\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Adds comments for PR to provide more information for approvers.\"\"\"\nimport base64\nimport json\nimport os\nimport subprocess\n\nimport requests\nimport yaml\n\nOWNER = 'google'\nREPO = 'oss-fuzz'\nGITHUB_URL = 'https://github.com/'\nGITHUB_NONREF_URL = f'https://www.github.com/{OWNER}/{REPO}'  # Github URL that doesn't send emails on linked issues.\nAPI_URL = 'https://api.github.com'\nBASE_URL = f'{API_URL}/repos/{OWNER}/{REPO}'\nBRANCH = 'master'\nCRITICALITY_SCORE_PATH = '/home/runner/go/bin/criticality_score'\nCOMMITS_LIMIT = 50  # Only process the most recent 50 commits.\n\n\ndef get_criticality_score(repo_url):\n  \"\"\"Gets the criticality score of the project.\"\"\"\n  # Criticality score does not support repo url ends with '.git'\n  if repo_url.endswith('.git'):\n    repo_url = repo_url[:-4]\n  report = subprocess.run([\n      CRITICALITY_SCORE_PATH, '--format', 'json',\n      '-gcp-project-id=clusterfuzz-external', '-depsdev-disable', repo_url\n  ],\n                          capture_output=True,\n                          text=True)\n\n  try:\n    report_dict = json.loads(report.stdout)\n  except:\n    print(f'Criticality score failed with stdout: {report.stdout}')\n    print(f'Criticality score failed with stderr: {report.stderr}')\n    return 'N/A'\n  return report_dict.get('default_score', 'N/A')\n\n\ndef is_known_contributor(content, email):\n  \"\"\"Checks if the author is in the contact list.\"\"\"\n  return (email == content.get('primary_contact') or\n          email in content.get('vendor_ccs', []) or\n          email in content.get('auto_ccs', []))\n\n\ndef save_env(message, is_ready_for_merge, is_internal=False):\n  \"\"\"Saves the outputs as environment variables.\"\"\"\n  with open(os.environ['GITHUB_ENV'], 'a') as github_env:\n    github_env.write(f'MESSAGE={message}\\n')\n    github_env.write(f'IS_READY_FOR_MERGE={is_ready_for_merge}\\n')\n    github_env.write(f'IS_INTERNAL={is_internal}')\n\n\ndef main():\n  \"\"\"Verifies if a PR is ready to merge.\"\"\"\n  github = GithubHandler()\n\n  # Bypasses PRs of the internal members.\n  if github.is_author_internal_member():\n    save_env(None, None, True)\n    return\n\n  message = ''\n  is_ready_for_merge = True\n  pr_author = github.get_pr_author()\n  # Gets all modified projects path.\n  projects_path = github.get_projects_path()\n  verified, email = github.get_author_email()\n\n  for project_path in projects_path:\n    project_url = f'{GITHUB_URL}/{OWNER}/{REPO}/tree/{BRANCH}/{project_path}'\n    content_dict = github.get_project_yaml(project_path)\n\n    # Gets information for the new integrating project.\n    if not content_dict:\n      is_ready_for_merge = False\n      new_project = github.get_integrated_project_info()\n      repo_url = new_project.get('main_repo')\n      if repo_url is None:\n        message += (f'{pr_author} is integrating a new project, '\n                    'but the `main_repo` is missing. '\n                    'The criticality score cannot be computed.<br/>')\n      else:\n        message += (f'{pr_author} is integrating a new project:<br/>'\n                    f'- Main repo: {repo_url}<br/> - Criticality score: '\n                    f'{get_criticality_score(repo_url)}<br/>')\n      continue\n\n    # Checks if the author is in the contact list.\n    if email:\n      if is_known_contributor(content_dict, email):\n        # Checks if the email is verified.\n        verified_marker = ' (verified)' if verified else ''\n        message += (\n            f'{pr_author}{verified_marker} is either the primary contact or '\n            f'is in the CCs list of [{project_path}]({project_url}).<br/>')\n        if verified:\n          continue\n\n    # Checks the previous commits.\n    commit_sha = github.has_author_modified_project(project_path)\n    if commit_sha is None:\n      history_message = ''\n      contributors = github.get_past_contributors(project_path)\n      if contributors:\n        history_message = 'The past contributors are: '\n        history_message += ', '.join(contributors)\n      message += (\n          f'{pr_author} is a new contributor to '\n          f'[{project_path}]({project_url}). The PR must be approved by known '\n          f'contributors before it can be merged. {history_message}<br/>')\n      is_ready_for_merge = False\n      continue\n\n    # If the previous commit is not associated with a pull request.\n    pr_message = (f'{pr_author} has previously contributed to '\n                  f'[{project_path}]({project_url}). The previous commit was '\n                  f'{GITHUB_NONREF_URL}/commit/{commit_sha}<br/>')\n\n    previous_pr_number = github.get_pull_request_number(commit_sha)\n    if previous_pr_number is not None:\n      pr_message = (f'{pr_author} has previously contributed to '\n                    f'[{project_path}]({project_url}). '\n                    f'The previous PR was [#{previous_pr_number}]'\n                    f'({GITHUB_NONREF_URL}/pull/{previous_pr_number})<br/>')\n    message += pr_message\n\n  save_env(message, is_ready_for_merge, False)\n\n\nclass GithubHandler:\n  \"\"\"Github requests handler.\"\"\"\n\n  def __init__(self):\n    self._pr_author = os.environ['PRAUTHOR']\n    self._token = os.environ['GITHUBTOKEN']\n    self._pr_number = os.environ['PRNUMBER']\n    self._headers = {\n        'Authorization': f'Bearer {self._token}',\n        'X-GitHub-Api-Version': '2022-11-28'\n    }\n    self._maintainers = set()\n    os.environ['GITHUB_AUTH_TOKEN'] = self._token\n\n  def get_pr_author(self):\n    \"\"\"Gets the pr author user name.\"\"\"\n    return self._pr_author\n\n  def get_projects_path(self):\n    \"\"\"Gets the current project path.\"\"\"\n    response = requests.get(f'{BASE_URL}/pulls/{self._pr_number}/files',\n                            headers=self._headers)\n    if not response.ok:\n      return []\n\n    projects_path = set()\n    for file in response.json():\n      file_path = file['filename']\n      dir_path = file_path.split(os.sep)\n      if len(dir_path) > 1 and dir_path[0] == 'projects':\n        projects_path.add(os.sep.join(dir_path[0:2]))\n    return list(projects_path)\n\n  def get_author_email(self):\n    \"\"\"Retrieves the author's email address for a pull request,\n    including non-public emails.\"\"\"\n    user_response = requests.get(f'{API_URL}/users/{self._pr_author}')\n    if user_response.ok:\n      email = user_response.json()['email']\n      if email:\n        return True, email\n\n    commits_response = requests.get(\n        f'{BASE_URL}/pulls/{self._pr_number}/commits', headers=self._headers)\n    if not commits_response.ok:\n      return False, None\n    email = commits_response.json()[0]['commit']['author']['email']\n    verified = commits_response.json()[0]['commit']['verification']['verified']\n    return verified, email\n\n  def get_project_yaml(self, project_path):\n    \"\"\"Gets the project yaml file.\"\"\"\n    contents_url = f'{BASE_URL}/contents/{project_path}/project.yaml'\n    return self.get_yaml_file_content(contents_url)\n\n  def get_yaml_file_content(self, contents_url):\n    \"\"\"Gets yaml file content.\"\"\"\n    response = requests.get(contents_url, headers=self._headers)\n    if not response.ok:\n      return {}\n    content = base64.b64decode(response.json()['content']).decode('UTF-8')\n    return yaml.safe_load(content)\n\n  def get_integrated_project_info(self):\n    \"\"\"Gets the new integrated project.\"\"\"\n    response = requests.get(f'{BASE_URL}/pulls/{self._pr_number}/files',\n                            headers=self._headers)\n\n    for file in response.json():\n      file_path = file['filename']\n      if 'project.yaml' in file_path:\n        return self.get_yaml_file_content(file['contents_url'])\n\n    return {}\n\n  def get_pull_request_number(self, commit):\n    \"\"\"Gets the pull request number.\"\"\"\n    pr_response = requests.get(f'{BASE_URL}/commits/{commit}/pulls',\n                               headers=self._headers)\n    if not pr_response.ok:\n      return None\n    return pr_response.json()[0]['number']\n\n  def get_past_contributors(self, project_path):\n    \"\"\"Returns a list of past contributors of a certain project.\"\"\"\n    commits_response = requests.get(f'{BASE_URL}/commits?path={project_path}',\n                                    headers=self._headers)\n\n    if not commits_response.ok:\n      return []\n    commits = commits_response.json()\n    contributors: dict[str, bool] = {}\n    for i, commit in enumerate(commits):\n      if i >= COMMITS_LIMIT:\n        break\n\n      if not commit['author'] or not commit['commit']:\n        continue\n\n      login = commit['author']['login']\n      verified = commit['commit']['verification']['verified']\n      if login in self._maintainers:\n        continue\n      if login not in contributors:\n        contributors[login] = verified\n      if verified:\n        # Override previous verification bit.\n        contributors[login] = True\n\n    all_contributors = []\n    for login, verified in contributors.items():\n      login_verify = login if verified else f'{login} (unverified)'\n      all_contributors.append(login_verify)\n\n    return all_contributors\n\n  def get_maintainers(self):\n    \"\"\"Get a list of internal members.\"\"\"\n    if self._maintainers:\n      return self._maintainers\n\n    response = requests.get(f'{BASE_URL}/contents/infra/MAINTAINERS.csv',\n                            headers=self._headers)\n    if not response.ok:\n      return self._maintainers\n\n    maintainers_file = base64.b64decode(\n        response.json()['content']).decode('UTF-8')\n    for line in maintainers_file.split(os.linesep):\n      self._maintainers.add(line.split(',')[2])\n    return self._maintainers\n\n  def is_author_internal_member(self):\n    \"\"\"Returns if the author is an internal member.\"\"\"\n    return self._pr_author in self.get_maintainers()\n\n  def has_author_modified_project(self, project_path):\n    \"\"\"Checks if the author has modified this project before.\"\"\"\n    commits_response = requests.get(\n        f'{BASE_URL}/commits?path={project_path}&author={self._pr_author}',\n        headers=self._headers)\n\n    if not commits_response.ok or not commits_response.json():\n      return None\n\n    commit = commits_response.json()[0]\n    return commit['sha']\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/presubmit.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#        http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Checks code for common issues before submitting.\"\"\"\n\nimport argparse\nimport os\nimport re\nimport subprocess\nimport sys\nimport unittest\nimport yaml\n\nimport constants\n\n_SRC_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nVALID_PROJECT_REGEX_STR = '^[a-z0-9_-]+$'\nVALID_PROJECT_REGEX = re.compile(VALID_PROJECT_REGEX_STR)\n\n\ndef _is_project_file(actual_path, expected_filename):\n  \"\"\"Returns True if actual_path's name is |expected_filename| and is a file\n  that exists and is in in projects/.\"\"\"\n  if os.path.basename(actual_path) != expected_filename:\n    return False\n\n  if os.path.basename(os.path.dirname(\n      os.path.dirname(actual_path))) != 'projects':\n    return False\n\n  return os.path.exists(actual_path)\n\n\n# TODO: Check for -fsanitize=fuzzer in files as well.\n\n\ndef _check_one_lib_fuzzing_engine(build_sh_file):\n  \"\"\"Returns False if |build_sh_file| contains -lFuzzingEngine.\n  This is deprecated behavior. $LIB_FUZZING_ENGINE should be used instead\n  so that -fsanitize=fuzzer is used.\"\"\"\n  if not _is_project_file(build_sh_file, 'build.sh'):\n    return True\n\n  with open(build_sh_file) as build_sh:\n    build_sh_lines = build_sh.readlines()\n  for line_num, line in enumerate(build_sh_lines):\n    uncommented_code = line.split('#')[0]\n    if '-lFuzzingEngine' in uncommented_code:\n      print('Error: build.sh contains deprecated \"-lFuzzingEngine\" on line: '\n            f'{line_num}. Please use \"$LIB_FUZZING_ENGINE\" instead.')\n      return False\n  return True\n\n\ndef check_lib_fuzzing_engine(paths):\n  \"\"\"Calls _check_one_lib_fuzzing_engine on each path in |paths|. Returns True\n  if the result of every call is True.\"\"\"\n  return all(_check_one_lib_fuzzing_engine(path) for path in paths)\n\n\nclass ProjectYamlChecker:\n  \"\"\"Checks for a project.yaml file.\"\"\"\n\n  # Sections in a project.yaml and the constant values that they are allowed\n  # to have.\n  SECTIONS_AND_CONSTANTS = {\n      'sanitizers': constants.SANITIZERS,\n      'architectures': constants.ARCHITECTURES,\n      'fuzzing_engines': constants.ENGINES,\n  }\n\n  # Note: this list must be updated when we allow new sections.\n  VALID_SECTION_NAMES = [\n      'architectures',\n      'auto_ccs',\n      'blackbox',\n      'builds_per_day',\n      'coverage_extra_args',\n      'disabled',\n      'disable_remediation',\n      'fuzzing_engines',\n      'help_url',\n      'homepage',\n      'language',\n      'labels',  # For internal use only, hard to lint as it uses fuzzer names.\n      'main_repo',\n      'primary_contact',\n      'run_tests',\n      'sanitizers',\n      'selective_unpack',\n      'vendor_ccs',\n      'view_restrictions',\n      'file_github_issue',\n      'indexer',  # Flags specific to infra/indexer.\n      'base_os_version',\n  ]\n\n  REQUIRED_SECTIONS = ['main_repo']\n\n  def __init__(self, filename):\n    self.filename = filename\n    with open(filename) as file_handle:\n      self.data = yaml.safe_load(file_handle)\n\n    self.success = True\n\n  def do_checks(self):\n    \"\"\"Does all project.yaml checks. Returns True if they pass.\"\"\"\n    if self.is_disabled():\n      return True\n\n    checks = [\n        self.check_project_yaml_constants,\n        self.check_required_sections,\n        self.check_valid_section_names,\n        self.check_valid_emails,\n        self.check_valid_language,\n        self.check_valid_project_name,\n    ]\n    for check_function in checks:\n      check_function()\n    return self.success\n\n  def is_disabled(self):\n    \"\"\"Returns True if this project is disabled.\"\"\"\n    return self.data.get('disabled', False)\n\n  def error(self, message):\n    \"\"\"Prints an error message and sets self.success to False.\"\"\"\n    self.success = False\n    print(f'Error in {self.filename}: {message}')\n\n  def check_valid_project_name(self):\n    \"\"\"Checks that the project has a valid name.\"\"\"\n    banned_names = ['google', 'g00gle']\n    project_name = os.path.basename(os.path.dirname(self.filename))\n    for banned_name in banned_names:\n      if banned_name in project_name:\n        self.error('Projects can\\'t have \\'google\\' in the name.')\n    if not VALID_PROJECT_REGEX.match(project_name):\n      self.error(f'Projects must conform to regex {VALID_PROJECT_REGEX_STR}')\n\n  def check_project_yaml_constants(self):\n    \"\"\"Returns True if certain sections only have certain constant values.\"\"\"\n    for section, allowed_constants in self.SECTIONS_AND_CONSTANTS.items():\n      if section not in self.data:\n        continue\n      actual_constants = self.data[section]\n      allowed_constants_str = ', '.join(allowed_constants)\n      for constant in actual_constants:\n        if isinstance(constant, str):\n          if constant not in allowed_constants:\n            self.error(f'{constant} (in {section} section) is not a valid '\n                       f'constant ({allowed_constants_str}).')\n        elif isinstance(constant, dict):\n          # The only alternative value allowed is the experimental flag, i.e.\n          # `constant == {'memory': {'experimental': True}}`. Do not check the\n          # experimental flag, but assert that the sanitizer is a valid one.\n          if (len(constant.keys()) > 1 or\n              list(constant.keys())[0] not in allowed_constants):\n            self.error(f'Not allowed value in the project.yaml: {constant}')\n        else:\n          self.error(f'Not allowed value in the project.yaml: {constant}')\n\n  def check_valid_section_names(self):\n    \"\"\"Returns True if all section names are valid.\"\"\"\n    for name in self.data:\n      if name not in self.VALID_SECTION_NAMES:\n        self.error(\n            f'{name} is not a valid section name ({self.VALID_SECTION_NAMES})')\n\n  def check_required_sections(self):\n    \"\"\"Returns True if all required sections are in |self.data|.\"\"\"\n    for section in self.REQUIRED_SECTIONS:\n      if section not in self.data:\n        self.error(f'{section} section is missing.')\n\n  def check_valid_emails(self):\n    \"\"\"Returns True if emails are valid looking..\"\"\"\n    # Get email addresses.\n    email_addresses = []\n    primary_contact = self.data.get('primary_contact')\n    if primary_contact:\n      email_addresses.append(primary_contact)\n    auto_ccs = self.data.get('auto_ccs')\n    if auto_ccs:\n      email_addresses.extend(auto_ccs)\n\n    # Check that email addresses seem normal.\n    for email_address in email_addresses:\n      if '@' not in email_address or '.' not in email_address:\n        self.error(f'{email_address} is an invalid email address.')\n\n  def check_valid_language(self):\n    \"\"\"Returns True if the language is specified and valid.\"\"\"\n    language = self.data.get('language')\n    if not language:\n      self.error('Missing \"language\" attribute in project.yaml.')\n    elif language not in constants.LANGUAGES:\n      self.error(\n          f'\"language: {language}\" is not supported ({constants.LANGUAGES}).')\n\n\ndef _check_one_project_yaml(project_yaml_filename):\n  \"\"\"Does checks on the project.yaml file. Returns True on success.\"\"\"\n  if _is_project_file(project_yaml_filename, 'project.yml'):\n    print(project_yaml_filename, 'must be named project.yaml.')\n    return False\n\n  if not _is_project_file(project_yaml_filename, 'project.yaml'):\n    return True\n\n  checker = ProjectYamlChecker(project_yaml_filename)\n  return checker.do_checks()\n\n\ndef check_project_yaml(paths):\n  \"\"\"Calls _check_one_project_yaml on each path in |paths|. Returns True if the\n  result of every call is True.\"\"\"\n  return all([_check_one_project_yaml(path) for path in paths])\n\n\ndef _check_one_seed_corpus(path):\n  \"\"\"Returns False and prints error if |path| is a seed corpus.\"\"\"\n  if os.path.basename(os.path.dirname(os.path.dirname(path))) != 'projects':\n    return True\n\n  if os.path.splitext(path)[1] == '.zip':\n    print('Don\\'t commit seed corpora into the ClusterFuzz repo,'\n          'they bloat it forever.')\n    return False\n\n  return True\n\n\ndef check_seed_corpus(paths):\n  \"\"\"Calls _check_one_seed_corpus on each path in |paths|. Returns True if the\n  result of every call is True.\"\"\"\n  return all([_check_one_seed_corpus(path) for path in paths])\n\n\ndef _check_one_apt_update(path):\n  \"\"\"Checks that a Dockerfile uses apt-update before apt-install\"\"\"\n  if os.path.basename(os.path.dirname(os.path.dirname(path))) != 'projects':\n    return True\n\n  if os.path.basename(path) != 'Dockerfile':\n    return True\n\n  with open(path, 'r') as file:\n    dockerfile = file.read()\n    if 'RUN apt install' in dockerfile or 'RUN apt-get install' in dockerfile:\n      print('Please add an \"apt-get update\" before \"apt-get install\". '\n            'Otherwise, a cached and outdated RUN layer may lead to install '\n            'failures in file %s.' % str(path))\n      return False\n\n  return True\n\n\ndef check_apt_update(paths):\n  \"\"\"Checks that all Dockerfile use apt-update before apt-install\"\"\"\n  return all([_check_one_apt_update(path) for path in paths])\n\n\ndef do_checks(changed_files):\n  \"\"\"Runs all presubmit checks. Returns False if any fails.\"\"\"\n  checks = [\n      check_license,\n      yapf,\n      check_project_yaml,\n      check_lib_fuzzing_engine,\n      check_seed_corpus,\n      check_apt_update,\n  ]\n  # Use a list comprehension here and in other cases where we use all() so that\n  # we don't quit early on failure. This is more user-friendly since the more\n  # errors we spit out at once, the less frequently the less check-fix-check\n  # cycles they need to do.\n  return all([check(changed_files) for check in checks])\n\n\n_CHECK_LICENSE_FILENAMES = ['Dockerfile']\n_CHECK_LICENSE_EXTENSIONS = [\n    '.bash',\n    '.c',\n    '.cc',\n    '.cpp',\n    '.css',\n    '.Dockerfile',\n    '.go',\n    '.h',\n    '.htm',\n    '.html',\n    '.java',\n    '.js',\n    '.proto',\n    '.py',\n    '.rs',\n    '.sh',\n    '.ts',\n]\nTHIRD_PARTY_DIR_NAME = 'third_party'\n\n_LICENSE_STRING = 'http://www.apache.org/licenses/LICENSE-2.0'\n\n\ndef check_license(paths):\n  \"\"\"Validates license header.\"\"\"\n  if not paths:\n    return True\n\n  success = True\n  for path in paths:\n    path_parts = str(path).split(os.sep)\n    if any(path_part == THIRD_PARTY_DIR_NAME for path_part in path_parts):\n      continue\n    filename = os.path.basename(path)\n    extension = os.path.splitext(path)[1]\n    if (filename not in _CHECK_LICENSE_FILENAMES and\n        extension not in _CHECK_LICENSE_EXTENSIONS):\n      continue\n\n    with open(path) as file_handle:\n      if _LICENSE_STRING not in file_handle.read():\n        print('Missing license header in file %s.' % str(path))\n        success = False\n\n  return success\n\n\ndef bool_to_returncode(success):\n  \"\"\"Returns 0 if |success|. Otherwise returns 1.\"\"\"\n  if success:\n    print('Success.')\n    return 0\n\n  print('Failed.')\n  return 1\n\n\ndef is_nonfuzzer_python(path):\n  \"\"\"Returns True if |path| ends in .py.\"\"\"\n  return os.path.splitext(path)[1] == '.py' and '/projects/' not in path\n\n\ndef lint(_=None):\n  \"\"\"Runs python's linter on infra. Returns False if it fails linting.\"\"\"\n\n  # Use --score no to make linting quieter.\n  command = ['python3', '-m', 'pylint', '--score', 'no', '-j', '0', 'infra']\n  returncode = subprocess.run(command, check=False).returncode\n  return returncode == 0\n\n\ndef yapf(paths, validate=True):\n  \"\"\"Does yapf on |path| if it is Python file. Only validates format if\n  |validate|. Otherwise, formats the file. Returns False if validation or\n  formatting fails.\"\"\"\n  paths = [path for path in paths if is_nonfuzzer_python(path)]\n  if not paths:\n    return True\n\n  validate_argument = '-d' if validate else '-i'\n  command = ['yapf', validate_argument, '-p']\n  command.extend(paths)\n\n  returncode = subprocess.run(command, check=False).returncode\n  return returncode == 0\n\n\ndef get_changed_files():\n  \"\"\"Returns a list of absolute paths of files changed in this git branch.\"\"\"\n  branch_commit_hash = subprocess.check_output(\n      ['git', 'merge-base', 'HEAD', 'origin/HEAD']).strip().decode()\n\n  diff_commands = [\n      # Return list of modified files in the commits on this branch.\n      ['git', 'diff', '--name-only', branch_commit_hash + '..'],\n      # Return list of modified files from uncommitted changes.\n      ['git', 'diff', '--name-only']\n  ]\n\n  changed_files = set()\n  for command in diff_commands:\n    file_paths = subprocess.check_output(command).decode().splitlines()\n    for file_path in file_paths:\n      if not os.path.isfile(file_path):\n        continue\n      changed_files.add(file_path)\n  print(f'Changed files: {\" \".join(changed_files)}')\n  return [os.path.abspath(f) for f in changed_files]\n\n\ndef run_build_tests():\n  \"\"\"Runs build tests because they can't be run in parallel.\"\"\"\n  suite_list = [\n      unittest.TestLoader().discover(os.path.join(_SRC_ROOT, 'infra', 'build'),\n                                     pattern='*_test.py'),\n  ]\n  suite = unittest.TestSuite(suite_list)\n  print('Running build tests.')\n  result = unittest.TextTestRunner().run(suite)\n  return not result.failures and not result.errors\n\n\ndef run_nonbuild_tests(parallel):\n  \"\"\"Runs all tests but build tests. Does them in parallel if |parallel|. The\n  reason why we exclude build tests is because they use an emulator that\n  prevents them from being used in parallel.\"\"\"\n  # We look for all project directories because otherwise pytest won't run tests\n  # that are not in valid modules (e.g. \"base-images\").\n  relevant_dirs = set()\n  all_files = get_all_files()\n  for file_path in all_files:\n    directory = os.path.dirname(file_path)\n    relevant_dirs.add(directory)\n\n  # Use ignore-glob because ignore doesn't seem to work properly with the way we\n  # pass directories to pytest.\n  command = [\n      'pytest',\n      '--ignore-glob=infra/base-images/base-builder/indexer/*',\n      '--ignore-glob=infra/build/*',\n      '--ignore-glob=projects/*',\n      '--ignore-glob=infra/experimental/contrib/*',\n      '--ignore-glob=infra/experimental/chronos/*',\n      '--ignore-glob=infra/experimental/mcp/*',\n  ]\n  if parallel:\n    command.extend(['-n', 'auto'])\n  command += list(relevant_dirs)\n  print('Running non-build tests.')\n\n  # TODO(metzman): Get rid of this once config_utils stops using it.\n  env = os.environ.copy()\n  env['CIFUZZ_TEST'] = '1'\n\n  return subprocess.run(command, check=False, env=env).returncode == 0\n\n\ndef run_tests(_=None, parallel=False, build_tests=True, nonbuild_tests=True):\n  \"\"\"Runs all unit tests.\"\"\"\n  build_success = True\n  nonbuild_success = True\n  if nonbuild_tests:\n    nonbuild_success = run_nonbuild_tests(parallel)\n  else:\n    print('Skipping nonbuild tests as specified.')\n\n  if build_tests:\n    build_success = run_build_tests()\n  else:\n    print('Skipping build tests as specified.')\n\n  return nonbuild_success and build_success\n\n\ndef run_systemsan_tests(_=None):\n  \"\"\"Runs SystemSan unit tests.\"\"\"\n  command = ['make', 'test']\n  return subprocess.run(command,\n                        cwd='infra/experimental/SystemSan',\n                        check=False).returncode == 0\n\n\ndef get_all_files():\n  \"\"\"Returns a list of absolute paths of files in this repo.\"\"\"\n  get_all_files_command = ['git', 'ls-files']\n  output = subprocess.check_output(get_all_files_command).decode().splitlines()\n  return [os.path.abspath(path) for path in output if os.path.isfile(path)]\n\n\ndef main():\n  \"\"\"Check changes on a branch for common issues before submitting.\"\"\"\n  # Get program arguments.\n  parser = argparse.ArgumentParser(description='Presubmit script for oss-fuzz.')\n  parser.add_argument(\n      'command',\n      choices=['format', 'lint', 'license', 'infra-tests', 'systemsan-tests'],\n      nargs='?')\n  parser.add_argument('-a',\n                      '--all-files',\n                      action='store_true',\n                      help='Run presubmit check(s) on all files',\n                      default=False)\n  parser.add_argument('-p',\n                      '--parallel',\n                      action='store_true',\n                      help='Run tests in parallel.',\n                      default=False)\n  parser.add_argument('-s',\n                      '--skip-build-tests',\n                      action='store_true',\n                      help='Skip build tests which are slow and must run '\n                      'sequentially.',\n                      default=False)\n  parser.add_argument('-n',\n                      '--skip-nonbuild-tests',\n                      action='store_true',\n                      help='Only do build tests.',\n                      default=False)\n  args = parser.parse_args()\n\n  if args.all_files:\n    relevant_files = get_all_files()\n  else:\n    relevant_files = get_changed_files()\n\n  os.chdir(_SRC_ROOT)\n\n  # Do one specific check if the user asked for it.\n  if args.command == 'format':\n    success = yapf(relevant_files, False)\n    return bool_to_returncode(success)\n\n  if args.command == 'lint':\n    success = lint()\n    return bool_to_returncode(success)\n\n  if args.command == 'license':\n    success = check_license(relevant_files)\n    return bool_to_returncode(success)\n\n  if args.command == 'infra-tests':\n    success = run_tests(relevant_files,\n                        parallel=args.parallel,\n                        build_tests=(not args.skip_build_tests),\n                        nonbuild_tests=(not args.skip_nonbuild_tests))\n    return bool_to_returncode(success)\n\n  if args.command == 'systemsan-tests':\n    success = run_systemsan_tests(relevant_files)\n    return bool_to_returncode(success)\n\n  # Do all the checks (but no tests).\n  success = do_checks(relevant_files)\n\n  return bool_to_returncode(success)\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/pytest.ini",
    "content": "[pytest]\npython_files = *_test.py\nlog_cli = true"
  },
  {
    "path": "infra/repo_manager.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Class to manage a git repository via python.\n\nThis class is to be used to implement git commands over\na python API and manage the current state of the git repo.\n\n  Typical usage example:\n\n    r_man =  RepoManager('https://github.com/google/oss-fuzz.git')\n    r_man.checkout('5668cc422c2c92d38a370545d3591039fb5bb8d4')\n\"\"\"\nimport datetime\nimport logging\nimport os\nimport shutil\n\nimport urllib.parse\n\nimport utils\n\n\nclass RepoManager:\n  \"\"\"Repo manager.\"\"\"\n\n  def __init__(self, repo_dir):\n    self.repo_dir = repo_dir\n\n  def _is_git_repo(self):\n    \"\"\"Test if the current repo dir is a git repo or not.\n\n    Returns:\n      True if the current repo_dir is a valid git repo.\n    \"\"\"\n    git_path = os.path.join(self.repo_dir, '.git')\n    return os.path.isdir(git_path)\n\n  def git(self, cmd, check_result=False):\n    \"\"\"Run a git command.\n\n    Args:\n      command: The git command as a list to be run.\n      check_result: Should an exception be thrown on failed command.\n\n    Returns:\n      stdout, stderr, error code.\n    \"\"\"\n    return utils.execute(['git'] + cmd,\n                         location=self.repo_dir,\n                         check_result=check_result)\n\n  def commit_exists(self, commit):\n    \"\"\"Checks to see if a commit exists in the project repo.\n\n    Args:\n      commit: The commit SHA you are checking.\n\n    Returns:\n      True if the commit exits in the project.\n    \"\"\"\n    if not commit.rstrip():\n      return False\n\n    _, _, err_code = self.git(['cat-file', '-e', commit])\n    return not err_code\n\n  def commit_date(self, commit):\n    \"\"\"Get the date of a commit.\n\n    Args:\n      commit: The commit hash.\n\n    Returns:\n      A datetime representing the date of the commit.\n    \"\"\"\n    out, _, _ = self.git(['show', '-s', '--format=%ct', commit],\n                         check_result=True)\n    return datetime.datetime.fromtimestamp(int(out), tz=datetime.timezone.utc)\n\n  def get_git_diff(self, base='origin...'):\n    \"\"\"Gets a list of files that have changed from the repo head.\n\n    Returns:\n      A list of changed file paths or None on Error.\n    \"\"\"\n    self.fetch_unshallow()\n    # Add '--' so that git knows we aren't talking about files.\n    command = ['diff', '--name-only', base, '--']\n    out, err_msg, err_code = self.git(command)\n    if err_code:\n      logging.error('Git diff failed with error message %s.', err_msg)\n      return None\n    if not out:\n      logging.error('No diff was found.')\n      return None\n    return [line for line in out.splitlines() if line]\n\n  def get_current_commit(self):\n    \"\"\"Gets the current commit SHA of the repo.\n\n    Returns:\n      The current active commit SHA.\n    \"\"\"\n    out, _, _ = self.git(['rev-parse', 'HEAD'], check_result=True)\n    return out.strip()\n\n  def get_parent(self, commit, count):\n    \"\"\"Gets the count'th parent of the given commit.\n\n    Returns:\n      The parent commit SHA.\n    \"\"\"\n    self.fetch_unshallow()\n    out, _, err_code = self.git(['rev-parse', commit + '~' + str(count)],\n                                check_result=False)\n    if err_code:\n      return None\n\n    return out.strip()\n\n  def fetch_all_remotes(self):\n    \"\"\"Fetch all remotes for checkouts that track a single branch.\"\"\"\n    self.git([\n        'config', 'remote.origin.fetch', '+refs/heads/*:refs/remotes/origin/*'\n    ],\n             check_result=True)\n    self.git(['remote', 'update'], check_result=True)\n\n  def get_commit_list(self, newest_commit, oldest_commit=None, limit=None):\n    \"\"\"Gets the list of commits(inclusive) between the old and new commits.\n\n    Args:\n      newest_commit: The newest commit to be in the list.\n      oldest_commit: The (optional) oldest commit to be in the list.\n\n    Returns:\n      The list of commit SHAs from newest to oldest.\n\n    Raises:\n      ValueError: When either the oldest or newest commit does not exist.\n      RuntimeError: When there is an error getting the commit list.\n    \"\"\"\n    self.fetch_unshallow()\n    if oldest_commit and not self.commit_exists(oldest_commit):\n      raise ValueError('The oldest commit %s does not exist' % oldest_commit)\n    if not self.commit_exists(newest_commit):\n      raise ValueError('The newest commit %s does not exist' % newest_commit)\n    if oldest_commit == newest_commit:\n      return [oldest_commit]\n\n    if oldest_commit:\n      commit_range = oldest_commit + '..' + newest_commit\n    else:\n      commit_range = newest_commit\n\n    limit_args = []\n    if limit:\n      limit_args.append(f'--max-count={limit}')\n\n    out, _, err_code = self.git(['rev-list', commit_range] + limit_args)\n    commits = out.split('\\n')\n    commits = [commit for commit in commits if commit]\n    if err_code or not commits:\n      raise RuntimeError('Error getting commit list between %s and %s ' %\n                         (oldest_commit, newest_commit))\n\n    # Make sure result is inclusive\n    if oldest_commit:\n      commits.append(oldest_commit)\n    return commits\n\n  def fetch_branch(self, branch):\n    \"\"\"Fetches a remote branch from origin.\"\"\"\n    return self.git(\n        ['fetch', 'origin', '{branch}:{branch}'.format(branch=branch)])\n\n  def fetch_unshallow(self):\n    \"\"\"Gets the current git repository history.\"\"\"\n    shallow_file = os.path.join(self.repo_dir, '.git', 'shallow')\n    if os.path.exists(shallow_file):\n      _, err, err_code = self.git(['fetch', '--unshallow'], check_result=False)\n      if err_code:\n        logging.error('Unshallow returned non-zero code: %s', err)\n\n  def checkout_pr(self, pr_ref):\n    \"\"\"Checks out a remote pull request.\n\n    Args:\n      pr_ref: The pull request reference to be checked out.\n    \"\"\"\n    self.fetch_unshallow()\n    self.git(['fetch', 'origin', pr_ref], check_result=True)\n    self.git(['checkout', '-f', 'FETCH_HEAD'], check_result=True)\n    self.git(['submodule', 'update', '-f', '--init', '--recursive'],\n             check_result=True)\n\n  def checkout_commit(self, commit, clean=True):\n    \"\"\"Checks out a specific commit from the repo.\n\n    Args:\n      commit: The commit SHA to be checked out.\n\n    Raises:\n      RuntimeError: when checkout is not successful.\n      ValueError: when commit does not exist.\n    \"\"\"\n    self.fetch_unshallow()\n    if not self.commit_exists(commit):\n      raise ValueError('Commit %s does not exist in current branch' % commit)\n    self.git(['checkout', '-f', commit], check_result=True)\n    self.git(['submodule', 'update', '-f', '--init', '--recursive'],\n             check_result=True)\n    if clean:\n      self.git(['clean', '-fxd'], check_result=True)\n    if self.get_current_commit() != commit:\n      raise RuntimeError('Error checking out commit %s' % commit)\n\n  def remove_repo(self):\n    \"\"\"Removes the git repo from disk.\"\"\"\n    if os.path.isdir(self.repo_dir):\n      shutil.rmtree(self.repo_dir)\n\n\ndef clone_repo_and_get_manager(repo_url,\n                               base_dir,\n                               repo_name=None,\n                               username=None,\n                               password=None):\n  \"\"\"Clones a repo and constructs a repo manager class.\n\n    Args:\n      repo_url: The github url needed to clone.\n      base_dir: The full file-path where the git repo is located.\n      repo_name: The name of the directory the repo is cloned to.\n    \"\"\"\n  if repo_name is None:\n    repo_name = os.path.basename(repo_url).replace('.git', '')\n  repo_dir = os.path.join(base_dir, repo_name)\n  manager = RepoManager(repo_dir)\n\n  if not os.path.exists(repo_dir):\n    _clone(repo_url, base_dir, repo_name, username=username, password=password)\n\n  return manager\n\n\ndef _clone(repo_url, base_dir, repo_name, username=None, password=None):\n  \"\"\"Creates a clone of the repo in the specified directory.\n\n     Raises:\n       ValueError: when the repo is not able to be cloned.\n  \"\"\"\n  if username and password:\n    parsed_url = urllib.parse.urlparse(repo_url)\n    new_netloc = f'{username}:{password}@{parsed_url.netloc}'\n    repo_url = urllib.parse.urlunparse(parsed_url._replace(netloc=new_netloc))\n\n  utils.execute(['git', 'clone', repo_url, repo_name],\n                location=base_dir,\n                check_result=True,\n                log_command=not password)\n"
  },
  {
    "path": "infra/repo_manager_test.py",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Test the functionality of the RepoManager class.\"\"\"\n\nimport contextlib\nimport os\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport repo_manager\nimport utils\n\n# pylint: disable=protected-access\n\nOSS_FUZZ_REPO_URL = 'https://github.com/google/oss-fuzz'\n\n\n@contextlib.contextmanager\ndef get_oss_fuzz_repo():\n  \"\"\"Clones a temporary copy of the OSS-Fuzz repo. Returns the path to the\n  repo.\"\"\"\n  repo_name = 'oss-fuzz'\n  with tempfile.TemporaryDirectory() as tmp_dir:\n    repo_manager._clone(OSS_FUZZ_REPO_URL, tmp_dir, repo_name)\n    yield os.path.join(tmp_dir, repo_name)\n\n\nclass CloneTest(unittest.TestCase):\n  \"\"\"Tests the _clone function.\"\"\"\n\n  @unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                   'INTEGRATION_TESTS=1 not set')\n  def test_clone_valid_repo_integration(self):\n    \"\"\"Integration test that tests the correct location of the git repo.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      git_path = os.path.join(oss_fuzz_repo, '.git')\n      self.assertTrue(os.path.isdir(git_path))\n\n  def test_clone_invalid_repo(self):\n    \"\"\"Tests that cloning an invalid repo will fail.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      with self.assertRaises(RuntimeError):\n        repo_manager._clone('https://github.com/oss-fuzz-not-real.git', tmp_dir,\n                            'oss-fuzz')\n\n  @mock.patch('utils.execute')\n  def test_clone_with_username(self, mock_execute):  # pylint: disable=no-self-use\n    \"\"\"Test clone with username.\"\"\"\n    repo_manager._clone('https://github.com/fake/repo.git',\n                        '/',\n                        'name',\n                        username='user',\n                        password='password')\n    mock_execute.assert_called_once_with([\n        'git', 'clone', 'https://user:password@github.com/fake/repo.git', 'name'\n    ],\n                                         location='/',\n                                         check_result=True,\n                                         log_command=False)\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass RepoManagerCheckoutTest(unittest.TestCase):\n  \"\"\"Tests the checkout functionality of RepoManager.\"\"\"\n\n  def test_checkout_valid_commit(self):\n    \"\"\"Tests that the git checkout command works.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      commit_to_test = '04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'\n      repo_man.checkout_commit(commit_to_test)\n      self.assertEqual(commit_to_test, repo_man.get_current_commit())\n\n  def test_checkout_invalid_commit(self):\n    \"\"\"Tests that the git checkout invalid commit fails.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      with self.assertRaises(ValueError):\n        repo_man.checkout_commit(' ')\n      with self.assertRaises(ValueError):\n        repo_man.checkout_commit('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')\n      with self.assertRaises(ValueError):\n        repo_man.checkout_commit('not-a-valid-commit')\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass RepoManagerGetCommitListTest(unittest.TestCase):\n  \"\"\"Tests the get_commit_list method of RepoManager.\"\"\"\n\n  def test_get_valid_commit_list(self):\n    \"\"\"Tests an accurate commit list can be retrieved from the repo manager.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      old_commit = '04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'\n      new_commit = 'fa662173bfeb3ba08d2e84cefc363be11e6c8463'\n      commit_list = [\n          'fa662173bfeb3ba08d2e84cefc363be11e6c8463',\n          '17035317a44fa89d22fe6846d868d4bf57def78b',\n          '97dee00a3c4ce95071c3e061592f5fd577dea886',\n          '04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'\n      ]\n      result_list = repo_man.get_commit_list(new_commit, old_commit)\n      self.assertListEqual(commit_list, result_list)\n\n  def test_get_invalid_commit_list(self):\n    \"\"\"Tests that the proper errors are thrown when invalid commits are\n    passed to get_commit_list.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      old_commit = '04ea24ee15bbe46a19e5da6c5f022a2ffdfbdb3b'\n      new_commit = 'fa662173bfeb3ba08d2e84cefc363be11e6c8463'\n      with self.assertRaises(ValueError):\n        repo_man.get_commit_list('fakecommit', new_commit)\n      with self.assertRaises(ValueError):\n        repo_man.get_commit_list(new_commit, 'fakecommit')\n      with self.assertRaises(RuntimeError):\n        repo_man.get_commit_list(old_commit, new_commit)  # pylint: disable=arguments-out-of-order\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass GitDiffTest(unittest.TestCase):\n  \"\"\"Tests get_git_diff.\"\"\"\n\n  def test_diff_exists(self):\n    \"\"\"Tests that a real diff is returned when a valid repo manager exists.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      with mock.patch.object(utils,\n                             'execute',\n                             return_value=('test.py\\ndiff.py', None, 0)):\n        diff = repo_man.get_git_diff()\n        self.assertCountEqual(diff, ['test.py', 'diff.py'])\n\n  def test_diff_empty(self):\n    \"\"\"Tests that None is returned when there is no difference between repos.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      with mock.patch.object(utils, 'execute', return_value=('', None, 0)):\n        diff = repo_man.get_git_diff()\n        self.assertIsNone(diff)\n\n  def test_error_on_command(self):\n    \"\"\"Tests that None is returned when the command errors out.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      with mock.patch.object(utils,\n                             'execute',\n                             return_value=('', 'Test error.', 1)):\n        diff = repo_man.get_git_diff()\n        self.assertIsNone(diff)\n\n  def test_diff_no_change(self):\n    \"\"\"Tests that None is returned when there is no difference between repos.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      diff = repo_man.get_git_diff()\n      self.assertIsNone(diff)\n\n\n@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),\n                 'INTEGRATION_TESTS=1 not set')\nclass CheckoutPrIntegrationTest(unittest.TestCase):\n  \"\"\"Does Integration tests on the checkout_pr method of RepoManager.\"\"\"\n\n  def test_pull_request_exists(self):\n    \"\"\"Tests that a diff is returned when a valid PR is checked out.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      repo_man.checkout_pr('refs/pull/3415/merge')\n      diff = repo_man.get_git_diff()\n      self.assertCountEqual(diff, ['README.md'])\n\n  def test_checkout_invalid_pull_request(self):\n    \"\"\"Tests that the git checkout invalid pull request fails.\"\"\"\n    with get_oss_fuzz_repo() as oss_fuzz_repo:\n      repo_man = repo_manager.RepoManager(oss_fuzz_repo)\n      with self.assertRaises(RuntimeError):\n        repo_man.checkout_pr(' ')\n      with self.assertRaises(RuntimeError):\n        repo_man.checkout_pr('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')\n      with self.assertRaises(RuntimeError):\n        repo_man.checkout_pr('not/a/valid/pr')\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "infra/retry.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Retry decorator. Copied from ClusterFuzz source.\"\"\"\n\nimport functools\nimport inspect\nimport logging\nimport sys\nimport time\n\n# pylint: disable=too-many-arguments,broad-except\n\n\ndef sleep(seconds):\n  \"\"\"Invoke time.sleep. This is to avoid the flakiness of time.sleep. See:\n    crbug.com/770375\"\"\"\n  time.sleep(seconds)\n\n\ndef get_delay(num_try, delay, backoff):\n  \"\"\"Compute backoff delay.\"\"\"\n  return delay * (backoff**(num_try - 1))\n\n\ndef wrap(retries,\n         delay,\n         backoff=2,\n         exception_type=Exception,\n         retry_on_false=False):\n  \"\"\"Retry decorator for a function.\"\"\"\n\n  assert delay > 0\n  assert backoff >= 1\n  assert retries >= 0\n\n  def decorator(func):\n    \"\"\"Decorator for the given function.\"\"\"\n    tries = retries + 1\n    is_generator = inspect.isgeneratorfunction(func)\n    function_with_type = func.__qualname__\n    if is_generator:\n      function_with_type += ' (generator)'\n\n    def handle_retry(num_try, exception=None):\n      \"\"\"Handle retry.\"\"\"\n      if (exception is None or\n          isinstance(exception, exception_type)) and num_try < tries:\n        logging.info('Retrying on %s failed with %s. Retrying again.',\n                     function_with_type,\n                     sys.exc_info()[1])\n        sleep(get_delay(num_try, delay, backoff))\n        return True\n\n      logging.error('Retrying on %s failed with %s. Raise.', function_with_type,\n                    sys.exc_info()[1])\n      return False\n\n    @functools.wraps(func)\n    def _wrapper(*args, **kwargs):\n      \"\"\"Regular function wrapper.\"\"\"\n      for num_try in range(1, tries + 1):\n        try:\n          result = func(*args, **kwargs)\n          if retry_on_false and not result:\n            if not handle_retry(num_try):\n              return result\n\n            continue\n          return result\n        except Exception as error:\n          if not handle_retry(num_try, exception=error):\n            raise\n\n    @functools.wraps(func)\n    def _generator_wrapper(*args, **kwargs):\n      \"\"\"Generator function wrapper.\"\"\"\n      # This argument is not applicable for generator functions.\n      assert not retry_on_false\n      already_yielded_element_count = 0\n      for num_try in range(1, tries + 1):\n        try:\n          for index, result in enumerate(func(*args, **kwargs)):\n            if index >= already_yielded_element_count:\n              yield result\n              already_yielded_element_count += 1\n          break\n        except Exception as error:\n          if not handle_retry(num_try, exception=error):\n            raise\n\n    if is_generator:\n      return _generator_wrapper\n    return _wrapper\n\n  return decorator\n"
  },
  {
    "path": "infra/run_fuzzers.Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Docker image for running fuzzers on CIFuzz (the run_fuzzers action on GitHub\n# actions).\n\nFROM gcr.io/oss-fuzz-base/cifuzz-base\n\n# Python file to execute when the docker container starts up.\n# We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var,\n# just expand to '/opt/oss-fuzz'.\nENTRYPOINT [\"python3\", \"/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py\"]\n\nWORKDIR ${OSS_FUZZ_ROOT}/infra\n\n# Copy infra source code.\nADD . ${OSS_FUZZ_ROOT}/infra\n\nRUN python3 -m pip install -r ${OSS_FUZZ_ROOT}/infra/cifuzz/requirements.txt\n"
  },
  {
    "path": "infra/run_fuzzers.ubuntu-24-04.Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Docker image for running fuzzers on CIFuzz (the run_fuzzers action on GitHub\n# actions).\n\nFROM gcr.io/oss-fuzz-base/cifuzz-base:ubuntu-24-04\n\n# Python file to execute when the docker container starts up.\n# We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var,\n# just expand to '/opt/oss-fuzz'.\nENTRYPOINT [\"python3\", \"/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py\"]\n\nWORKDIR ${OSS_FUZZ_ROOT}/infra\n\n# Copy infra source code.\nADD . ${OSS_FUZZ_ROOT}/infra\n\nRUN python3 -m pip install -r ${OSS_FUZZ_ROOT}/infra/cifuzz/requirements.txt\n"
  },
  {
    "path": "infra/templates.py",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Templates for OSS-Fuzz project files.\"\"\"\n\nPROJECT_YAML_TEMPLATE = \"\"\"\\\nhomepage: \"<your_project_homepage>\"\nlanguage: %(language)s\nprimary_contact: \"<primary_contact_email>\"\nmain_repo: \"https://path/to/main/repo.git\"\nfile_github_issue: true\n\"\"\"\n\nDOCKER_TEMPLATE = \"\"\"\\\n# Copyright %(year)d Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/%(base_builder)s\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 <git_url> %(project_name)s     # or use other version control\nWORKDIR %(project_name)s\nCOPY build.sh $SRC/\n\"\"\"\n\nEXTERNAL_DOCKER_TEMPLATE = \"\"\"\\\nFROM gcr.io/oss-fuzz-base/%(base_builder)s:v1\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nCOPY . $SRC/%(project_name)s\nWORKDIR %(project_name)s\nCOPY .clusterfuzzlite/build.sh $SRC/\n\"\"\"\n\nBUILD_TEMPLATE = \"\"\"\\\n#!/bin/bash -eu\n# Copyright %(year)d Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\n# e.g.\n# ./autogen.sh\n# ./configure\n# make -j$(nproc) all\n\n# build fuzzers\n# e.g.\n# $CXX $CXXFLAGS -std=c++11 -Iinclude \\\\\n#     /path/to/name_of_fuzzer.cc -o $OUT/name_of_fuzzer \\\\\n#     $LIB_FUZZING_ENGINE /path/to/library.a\n\"\"\"\n\nEXTERNAL_BUILD_TEMPLATE = \"\"\"\\\n#!/bin/bash -eu\n\n# build project\n# e.g.\n# ./autogen.sh\n# ./configure\n# make -j$(nproc) all\n\n# build fuzzers\n# e.g.\n# $CXX $CXXFLAGS -std=c++11 -Iinclude \\\\\n#     /path/to/name_of_fuzzer.cc -o $OUT/name_of_fuzzer \\\\\n#     $LIB_FUZZING_ENGINE /path/to/library.a\n\"\"\"\n\nEXTERNAL_PROJECT_YAML_TEMPLATE = \"\"\"\\\nlanguage: %(language)s\n\"\"\"\n\nTEMPLATES = {\n    'build.sh': BUILD_TEMPLATE,\n    'Dockerfile': DOCKER_TEMPLATE,\n    'project.yaml': PROJECT_YAML_TEMPLATE\n}\n\nEXTERNAL_TEMPLATES = {\n    'build.sh': EXTERNAL_BUILD_TEMPLATE,\n    'Dockerfile': EXTERNAL_DOCKER_TEMPLATE,\n    'project.yaml': EXTERNAL_PROJECT_YAML_TEMPLATE\n}\n"
  },
  {
    "path": "infra/test",
    "content": "\n"
  },
  {
    "path": "infra/test_repos.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"This module contains a list of test repository's used in unit/integration\ntests.\n\nNote: If you notice tests failing for unexpected reasons, make sure the data\nin the test repos are correct. This is because the test repos are dynamic and\nmay change.\n\nNote: This should be removed when a better method of testing is established.\n\"\"\"\n\nimport collections\nimport os\n\nExampleRepo = collections.namedtuple('ExampleRepo', [\n    'project_name', 'oss_repo_name', 'git_repo_name', 'image_location',\n    'git_url', 'new_commit', 'old_commit', 'intro_commit', 'fuzz_target',\n    'testcase_path'\n])\n\nTEST_DIR_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)),\n                             'testcases')\n\n# WARNING: Tests are dependent upon the following repos existing and the\n# specified commits existing.\n# TODO(metzman): Fix this problem.\n# TODO(metzman): The testcases got deleted here because the test that used them\n# was skipped. Probably worth deleting the test.\nTEST_REPOS = [\n    ExampleRepo(project_name='curl',\n                oss_repo_name='curl',\n                git_repo_name='curl',\n                image_location='/src',\n                git_url='https://github.com/curl/curl.git',\n                old_commit='df26f5f9c36e19cd503c0e462e9f72ad37b84c82',\n                new_commit='dda418266c99ceab368d723facb52069cbb9c8d5',\n                intro_commit='df26f5f9c36e19cd503c0e462e9f72ad37b84c82',\n                fuzz_target='curl_fuzzer_ftp',\n                testcase_path=os.path.join(TEST_DIR_PATH, 'curl_test_data')),\n    ExampleRepo(project_name='libarchive',\n                oss_repo_name='libarchive',\n                git_repo_name='libarchive',\n                image_location='/src',\n                git_url='https://github.com/libarchive/libarchive.git',\n                old_commit='5bd2a9b6658a3a6efa20bb9ad75bd39a44d71da6',\n                new_commit='458e49358f17ec58d65ab1c45cf299baaf3c98d1',\n                intro_commit='840266712006de5e737f8052db920dfea2be4260',\n                fuzz_target='libarchive_fuzzer',\n                testcase_path=os.path.join(TEST_DIR_PATH,\n                                           'libarchive_test_data')),\n    ExampleRepo(project_name='gonids',\n                oss_repo_name='gonids',\n                git_repo_name='gonids',\n                image_location='/root/go/src/github.com/google/',\n                git_url='https://github.com/google/gonids',\n                old_commit='',\n                new_commit='',\n                intro_commit='',\n                fuzz_target='',\n                testcase_path='')\n]\n\nINVALID_REPO = ExampleRepo(project_name='notaproj',\n                           oss_repo_name='notarepo',\n                           git_repo_name='notarepo',\n                           git_url='invalid.git',\n                           image_location='/src',\n                           old_commit='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n                           new_commit='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n                           intro_commit='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n                           fuzz_target='NONEFUZZER',\n                           testcase_path='not/a/path')\n"
  },
  {
    "path": "infra/tools/hold_back_images.py",
    "content": "#!/usr/bin/env python\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script for pinning builder images for projects that break on upgrades. Works\nwith projects that use language builders.\"\"\"\nimport argparse\nimport logging\nimport os\nimport re\nimport sys\nimport subprocess\n\nROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))\nPROJECTS_DIR = os.path.join(ROOT_DIR, 'projects')\n\nIMAGE_DIGEST_REGEX = re.compile(r'\\[(.+)\\]\\n')\nFROM_LINE_REGEX = re.compile(\n    r'FROM (gcr.io\\/oss-fuzz-base\\/base-builder[\\-a-z0-9]*)(\\@?.*)')\n\n\ndef get_latest_docker_image_digest(image):\n  \"\"\"Returns a pinnable version of the latest |image|. This version will have a\n  SHA.\"\"\"\n  subprocess.run(['docker', 'pull', image], check=True)\n  subprocess.run(['docker', 'pull', image], stdout=subprocess.PIPE, check=True)\n\n  command = [\n      'docker', 'image', 'inspect', '--format', '{{.RepoDigests}}', image\n  ]\n  output = subprocess.run(command, check=True,\n                          stdout=subprocess.PIPE).stdout.decode('utf-8')\n  return IMAGE_DIGEST_REGEX.match(output).groups(1)[0]\n\n\ndef get_args():\n  \"\"\"Returns parsed arguments.\"\"\"\n  parser = argparse.ArgumentParser(sys.argv[0],\n                                   description='Hold back builder images.')\n  parser.add_argument('projects', help='Projects.', nargs='+')\n\n  parser.add_argument('--hold-image-digest',\n                      required=False,\n                      nargs='?',\n                      default=None,\n                      help='Image to hold on to.')\n\n  parser.add_argument('--update-held',\n                      action='store_true',\n                      default=False,\n                      help='Update held images.')\n\n  parser.add_argument('--issue-number',\n                      required=False,\n                      nargs='?',\n                      default=None,\n                      help='Issue to reference.')\n\n  args = parser.parse_args()\n  return args\n\n\ndef get_hold_image_digest(line, hold_image_digest, update_held):\n  \"\"\"Returns the image digest for the |line| we want to pin. If the image is\n  already pinned then it is only updated if |update_held. If |hold_image_digest\n  is specified then it is returned, otherwise the latest pinnable version is\n  returned.\"\"\"\n  matches = FROM_LINE_REGEX.match(line).groups()\n  if matches[1] and not update_held:\n    return None, False\n  initial_image = matches[0]\n  if hold_image_digest:\n    return hold_image_digest, True\n  return get_latest_docker_image_digest(initial_image), True\n\n\ndef hold_image(project, hold_image_digest, update_held, issue_number):\n  \"\"\"Rewrites the Dockerfile of |project| to pin the base-builder image on\n  upgrade.\"\"\"\n  dockerfile_path = os.path.join(PROJECTS_DIR, project, 'Dockerfile')\n  with open(dockerfile_path, 'r') as dockerfile_handle:\n    dockerfile = dockerfile_handle.readlines()\n  for idx, line in enumerate(dockerfile[:]):\n    if not line.startswith('FROM gcr.io/oss-fuzz-base/base-builder'):\n      continue\n\n    hold_image_digest, should_hold = get_hold_image_digest(\n        line.strip(), hold_image_digest, update_held)\n    if not should_hold:\n      logging.error('Not holding back %s.', project)\n      break\n    dockerfile[idx] = f'FROM {hold_image_digest}\\n'\n    if issue_number:\n      comment = ('# Held back because of github.com/google/oss-fuzz/pull/'\n                 f'{issue_number}\\n# Please fix the build failure + upgrade.'\n                 '\\n\\n')\n      dockerfile.insert(idx, comment)\n    break\n  else:\n    # This path is taken when we don't break out of the loop.\n    assert None, f'Could not find FROM line in {project}'\n  dockerfile = ''.join(dockerfile)\n  with open(dockerfile_path, 'w') as dockerfile_handle:\n    dockerfile_handle.write(dockerfile)\n\n\ndef main():\n  \"\"\"Script for pinning builder images for projects that break on upgrades.\"\"\"\n  args = get_args()\n  for project in args.projects:\n    hold_image(project, args.hold_image_digest, args.update_held,\n               args.issue_number)\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/tools/wycheproof/.gitignore",
    "content": "wycheproof.zip"
  },
  {
    "path": "infra/tools/wycheproof/generate_job.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script for generating an OSS-Fuzz job for a wycheproof project.\"\"\"\nimport sys\n\n\ndef main():\n  \"\"\"Usage generate_job.py <project>.\"\"\"\n  project = sys.argv[1]\n  print(f'Name: wycheproof_nosanitizer_{project}')\n  job_definition = f\"\"\"CUSTOM_BINARY = False\nBAD_BUILD_CHECK = False\nAPP_NAME = WycheproofTarget.bash\nTHREAD_ALIVE_CHECK_INTERVAL = 10\nTEST_TIMEOUT = 3600\nCRASH_RETRIES = 1\nAGGREGATE_COVERAGE = False\nTESTCASE_COVERAGE = False\nFILE_GITHUB_ISSUE = False\nMANAGED = False\nMAX_FUZZ_THREADS = 1\nRELEASE_BUILD_BUCKET_PATH = gs://clusterfuzz-builds-wycheproof/{project}/{project}-none-([0-9]+).zip\nPROJECT_NAME = {project}\nSUMMARY_PREFIX = {project}\nREVISION_VARS_URL = https://commondatastorage.googleapis.com/clusterfuzz-builds-wycheproof/{project}/{project}-none-%s.srcmap.json\nFUZZ_LOGS_BUCKET = {project}-logs.clusterfuzz-external.appspot.com\nCORPUS_BUCKET = {project}-corpus.clusterfuzz-external.appspot.com\nQUARANTINE_BUCKET = {project}-quarantine.clusterfuzz-external.appspot.com\nBACKUP_BUCKET = {project}-backup.clusterfuzz-external.appspot.com\nAUTOMATIC_LABELS = Proj-{project},Engine-wycheproof\n\"\"\"\n  print(job_definition)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "infra/tools/wycheproof/launcher.py",
    "content": "#!/usr/bin/env python\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script for running wycheproof.\"\"\"\n\nimport logging\nimport sys\nimport subprocess\n\n\ndef main():\n  \"\"\"Runs wycheproof.\"\"\"\n  if len(sys.argv) < 3:\n    logging.error('Usage: %s <test_app> <testcase>.', sys.argv[0])\n    return 1\n\n  return subprocess.run(sys.argv[1:], check=False).returncode\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/tools/wycheproof/package.bash",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Script for zipping ClusterFuzz's blackbox fuzzer for wycheproof.\nzip wycheproof.zip run.py launcher.py\n"
  },
  {
    "path": "infra/tools/wycheproof/run.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\"\"\"Script for creating \"testcases\" to run wycheproof on.\"\"\"\n\nimport argparse\nimport os\nimport sys\n\n\ndef get_args():\n  \"\"\"Returns parsed program arguments.\"\"\"\n  parser = argparse.ArgumentParser()\n  parser.add_argument(\n      '--input_dir',\n      help='Ignored.',\n  )\n  parser.add_argument('--output_dir',\n                      help='Directory for writing testcases.',\n                      required=True)\n  parser.add_argument('--no_of_files', type=int, help='Ignored.')\n  return parser.parse_args()\n\n\ndef main():\n  \"\"\"Generates a dummy testcase for use by a ClusterFuzz blackbox fuzzer.\"\"\"\n  args = get_args()\n  if not os.path.exists(args.output_dir):\n    os.mkdir(args.output_dir)\n  testcase = os.path.join(args.output_dir, 'fuzz-0')\n  with open(testcase, 'w') as file_handle:\n    file_handle.write(' ')\n  return 0\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "infra/uploader/Dockerfile",
    "content": "from ubuntu:16.04\n\nRUN apt-get update && apt-get upgrade -y\nRUN apt-get install -y curl\n\nENTRYPOINT [\"curl\", \"--retry\", \"5\", \"-X\", \"PUT\", \"-T\"]\n\n"
  },
  {
    "path": "infra/utils.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Utilities for OSS-Fuzz infrastructure.\"\"\"\n\nimport logging\nimport os\nimport posixpath\nimport re\nimport shlex\nimport stat\nimport subprocess\nimport sys\n\nimport helper\n\nALLOWED_FUZZ_TARGET_EXTENSIONS = ['', '.exe']\nFUZZ_TARGET_SEARCH_STRING = 'LLVMFuzzerTestOneInput'\nVALID_TARGET_NAME_REGEX = re.compile(r'^[a-zA-Z0-9_-]+$')\nBLOCKLISTED_TARGET_NAME_REGEX = re.compile(r'^(jazzer_driver.*)$')\n\n# Location of google cloud storage for latest OSS-Fuzz builds.\nGCS_BASE_URL = 'https://storage.googleapis.com/'\n\n\ndef chdir_to_root():\n  \"\"\"Changes cwd to OSS-Fuzz root directory.\"\"\"\n  # Change to oss-fuzz main directory so helper.py runs correctly.\n  if os.getcwd() != helper.OSS_FUZZ_DIR:\n    os.chdir(helper.OSS_FUZZ_DIR)\n\n\ndef command_to_string(command):\n  \"\"\"Returns the stringfied version of |command| a list representing a binary to\n  run and arguments to pass to it or a string representing a binary to run.\"\"\"\n  if isinstance(command, str):\n    return command\n  return shlex.join(command)\n\n\ndef execute(command,\n            env=None,\n            location=None,\n            check_result=False,\n            log_command=True):\n  \"\"\"Runs a shell command in the specified directory location.\n\n  Args:\n    command: The command as a list to be run.\n    env: (optional) an environment to pass to Popen to run the command in.\n    location (optional): The directory to run command in.\n    check_result (optional): Should an exception be thrown on failure.\n\n  Returns:\n    stdout, stderr, returncode.\n\n  Raises:\n    RuntimeError: running a command resulted in an error.\n  \"\"\"\n\n  if not location:\n    location = os.getcwd()\n  process = subprocess.Popen(command,\n                             stdout=subprocess.PIPE,\n                             stderr=subprocess.PIPE,\n                             cwd=location,\n                             env=env)\n  out, err = process.communicate()\n  out = out.decode('utf-8', errors='ignore')\n  err = err.decode('utf-8', errors='ignore')\n\n  if log_command:\n    command_str = command_to_string(command)\n    display_err = err\n  else:\n    command_str = 'redacted'\n    display_err = 'redacted'\n\n  if err:\n    logging.debug('Stderr of command \"%s\" is: %s.', command_str, display_err)\n  if check_result and process.returncode:\n    raise RuntimeError('Executing command \"{0}\" failed with error: {1}.'.format(\n        command_str, display_err))\n  return out, err, process.returncode\n\n\ndef get_fuzz_targets(path):\n  \"\"\"Gets fuzz targets in a directory.\n\n  Args:\n    path: A path to search for fuzz targets in.\n\n  Returns:\n    A list of paths to fuzzers or an empty list if None.\n  \"\"\"\n  if not os.path.exists(path):\n    return []\n  fuzz_target_paths = []\n  for root, _, fuzzers in os.walk(path):\n    for fuzzer in fuzzers:\n      file_path = os.path.join(root, fuzzer)\n      if is_fuzz_target_local(file_path):\n        fuzz_target_paths.append(file_path)\n\n  return fuzz_target_paths\n\n\ndef get_container_name():\n  \"\"\"Gets the name of the current docker container you are in.\n\n  Returns:\n    Container name or None if not in a container.\n  \"\"\"\n  result = subprocess.run(  # pylint: disable=subprocess-run-check\n      ['systemd-detect-virt', '-c'],\n      stdout=subprocess.PIPE).stdout\n  if b'docker' not in result:\n    return None\n  with open('/etc/hostname') as file_handle:\n    return file_handle.read().strip()\n\n\ndef is_executable(file_path):\n  \"\"\"Returns True if |file_path| is an exectuable.\"\"\"\n  return os.path.exists(file_path) and os.access(file_path, os.X_OK)\n\n\ndef is_fuzz_target_local(file_path):\n  \"\"\"Returns whether |file_path| is a fuzz target binary (local path).\n  Copied from clusterfuzz src/python/bot/fuzzers/utils.py\n  with slight modifications.\n  \"\"\"\n  # pylint: disable=too-many-return-statements\n  filename, file_extension = os.path.splitext(os.path.basename(file_path))\n  if not VALID_TARGET_NAME_REGEX.match(filename):\n    # Check fuzz target has a valid name (without any special chars).\n    return False\n\n  if BLOCKLISTED_TARGET_NAME_REGEX.match(filename):\n    # Check fuzz target an explicitly disallowed name (e.g. binaries used for\n    # jazzer-based targets).\n    return False\n\n  if file_extension not in ALLOWED_FUZZ_TARGET_EXTENSIONS:\n    # Ignore files with disallowed extensions (to prevent opening e.g. .zips).\n    return False\n\n  if not is_executable(file_path):\n    return False\n\n  if filename.endswith('_fuzzer'):\n    return True\n\n  if os.path.exists(file_path) and not stat.S_ISREG(os.stat(file_path).st_mode):\n    return False\n\n  with open(file_path, 'rb') as file_handle:\n    return file_handle.read().find(FUZZ_TARGET_SEARCH_STRING.encode()) != -1\n\n\ndef binary_print(string):\n  \"\"\"Prints string. Can print a binary string.\"\"\"\n  if isinstance(string, bytes):\n    string += b'\\n'\n  else:\n    string += '\\n'\n  sys.stdout.buffer.write(string)\n  sys.stdout.flush()\n\n\ndef url_join(*url_parts):\n  \"\"\"Joins URLs together using the POSIX join method.\n\n  Args:\n    url_parts: Sections of a URL to be joined.\n\n  Returns:\n    Joined URL.\n  \"\"\"\n  return posixpath.join(*url_parts)\n\n\ndef gs_url_to_https(url):\n  \"\"\"Converts |url| from a GCS URL (beginning with 'gs://') to an HTTPS one.\"\"\"\n  return url_join(GCS_BASE_URL, remove_prefix(url, 'gs://'))\n\n\ndef remove_prefix(string, prefix):\n  \"\"\"Returns |string| without the leading substring |prefix|.\"\"\"\n  # Match behavior of removeprefix from python3.9:\n  # https://www.python.org/dev/peps/pep-0616/\n  if string.startswith(prefix):\n    return string[len(prefix):]\n\n  return string\n"
  },
  {
    "path": "infra/utils_test.py",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests the functionality of the utils module's functions\"\"\"\n\nimport os\nimport tempfile\nimport unittest\nfrom unittest import mock\n\nimport utils\nimport helper\n\nEXAMPLE_PROJECT = 'example'\n\nTEST_OUT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n                            'cifuzz', 'test_data', 'build-out')\n\n\nclass IsFuzzTargetLocalTest(unittest.TestCase):\n  \"\"\"Tests the is_fuzz_target_local function.\"\"\"\n\n  def test_invalid_filepath(self):\n    \"\"\"Tests the function with an invalid file path.\"\"\"\n    is_local = utils.is_fuzz_target_local('not/a/real/file')\n    self.assertFalse(is_local)\n    is_local = utils.is_fuzz_target_local('')\n    self.assertFalse(is_local)\n    is_local = utils.is_fuzz_target_local(' ')\n    self.assertFalse(is_local)\n\n  def test_valid_filepath(self):\n    \"\"\"Checks is_fuzz_target_local function with a valid filepath.\"\"\"\n\n    is_local = utils.is_fuzz_target_local(\n        os.path.join(TEST_OUT_DIR, 'example_crash_fuzzer'))\n    self.assertTrue(is_local)\n    is_local = utils.is_fuzz_target_local(TEST_OUT_DIR)\n    self.assertFalse(is_local)\n\n\nclass GetFuzzTargetsTest(unittest.TestCase):\n  \"\"\"Tests the get_fuzz_targets function.\"\"\"\n\n  def test_valid_filepath(self):\n    \"\"\"Tests that fuzz targets can be retrieved once the fuzzers are built.\"\"\"\n    fuzz_targets = utils.get_fuzz_targets(TEST_OUT_DIR)\n    crash_fuzzer_path = os.path.join(TEST_OUT_DIR, 'example_crash_fuzzer')\n    nocrash_fuzzer_path = os.path.join(TEST_OUT_DIR, 'example_nocrash_fuzzer')\n    self.assertCountEqual(fuzz_targets,\n                          [crash_fuzzer_path, nocrash_fuzzer_path])\n\n    # Testing on a arbitrary directory with no fuzz targets in it.\n    fuzz_targets = utils.get_fuzz_targets(\n        os.path.join(helper.OSS_FUZZ_DIR, 'infra', 'travis'))\n    self.assertFalse(fuzz_targets)\n\n  def test_invalid_filepath(self):\n    \"\"\"Tests what get_fuzz_targets return when invalid filepath is used.\"\"\"\n    fuzz_targets = utils.get_fuzz_targets('not/a/valid/file/path')\n    self.assertFalse(fuzz_targets)\n\n\nclass ExecuteTest(unittest.TestCase):\n  \"\"\"Tests the execute function.\"\"\"\n\n  def test_valid_command(self):\n    \"\"\"Tests that execute can produce valid output.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out, err, err_code = utils.execute(['ls', '.'],\n                                         location=tmp_dir,\n                                         check_result=False)\n      self.assertEqual(err_code, 0)\n      self.assertEqual(err, '')\n      self.assertEqual(out, '')\n      out, err, err_code = utils.execute(['mkdir', 'tmp'],\n                                         location=tmp_dir,\n                                         check_result=False)\n      self.assertEqual(err_code, 0)\n      self.assertEqual(err, '')\n      self.assertEqual(out, '')\n      out, err, err_code = utils.execute(['ls', '.'],\n                                         location=tmp_dir,\n                                         check_result=False)\n      self.assertEqual(err_code, 0)\n      self.assertEqual(err, '')\n      self.assertEqual(out, 'tmp\\n')\n\n  def test_error_command(self):\n    \"\"\"Tests that execute can correctly surface errors.\"\"\"\n    with tempfile.TemporaryDirectory() as tmp_dir:\n      out, err, err_code = utils.execute(['ls', 'notarealdir'],\n                                         location=tmp_dir,\n                                         check_result=False)\n      self.assertEqual(err_code, 2)\n      self.assertIsNotNone(err)\n      self.assertEqual(out, '')\n      with self.assertRaises(RuntimeError):\n        out, err, err_code = utils.execute(['ls', 'notarealdir'],\n                                           location=tmp_dir,\n                                           check_result=True)\n\n\nclass BinaryPrintTest(unittest.TestCase):\n  \"\"\"Tests for utils.binary_print.\"\"\"\n\n  @unittest.skip('Causes spurious failures because of side-effects.')\n  def test_string(self):  # pylint: disable=no-self-use\n    \"\"\"Tests that utils.binary_print can print a regular string.\"\"\"\n    # Should execute without raising any exceptions.\n    with mock.patch('sys.stdout.buffer.write') as mock_write:\n      utils.binary_print('hello')\n      mock_write.assert_called_with('hello\\n')\n\n  @unittest.skip('Causes spurious failures because of side-effects.')\n  def test_binary_string(self):  # pylint: disable=no-self-use\n    \"\"\"Tests that utils.binary_print can print a bianry string.\"\"\"\n    # Should execute without raising any exceptions.\n    with mock.patch('sys.stdout.buffer.write') as mock_write:\n      utils.binary_print(b'hello')\n      mock_write.assert_called_with(b'hello\\n')\n\n\nclass CommandToStringTest(unittest.TestCase):\n  \"\"\"Tests for command_to_string.\"\"\"\n\n  def test_string(self):\n    \"\"\"Tests that command_to_string returns the argument passed to it when it is\n    passed a string.\"\"\"\n    command = 'command'\n    self.assertEqual(utils.command_to_string(command), command)\n\n  def test_list(self):\n    \"\"\"Tests that command_to_string returns the correct stringwhen it is passed\n    a list.\"\"\"\n    command = ['command', 'arg1', 'arg2']\n    self.assertEqual(utils.command_to_string(command), 'command arg1 arg2')\n\n\nif __name__ == '__main__':\n  unittest.main()\n"
  },
  {
    "path": "projects/abseil-cpp/BUILD",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nload(\"@rules_fuzzing//fuzzing:cc_defs.bzl\", \"cc_fuzz_test\")\n\ncc_fuzz_test(\n    name = \"string_escape_fuzzer\",\n    srcs = [\"string_escape_fuzzer.cc\"],\n    deps = [\"@com_google_absl//absl/strings\"],\n)\n\ncc_fuzz_test(\n    name = \"string_utilities_fuzzer\",\n    srcs = [\"string_utilities_fuzzer.cc\"],\n    deps = [\n        \"@com_google_absl//absl/strings\",\n        \"@com_google_absl//absl/strings:cord\",\n        \"@com_google_absl//absl/strings:str_format\",\n        # The below are added for OSS-Fuzz-gen purposes. The goal is to make\n        # a general build rule from which we can build harnesses targeting\n        # most of the abseil-cpp codebase.\n        \"@com_google_absl//absl/algorithm:algorithm\",\n        \"@com_google_absl//absl/hash:hash\",\n        \"@com_google_absl//absl/crc:crc32c\",\n        \"@com_google_absl//absl/time:time\",\n        \"@com_google_absl//absl/base:base\",\n    ],\n)\n"
  },
  {
    "path": "projects/abseil-cpp/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/abseil/abseil-cpp.git\nCOPY BUILD WORKSPACE build.sh *_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/abseil-cpp/WORKSPACE",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nlocal_repository(\n    name = \"com_google_absl\",\n    path = \"abseil-cpp/\",\n)\n\n# released on 2023-11-07\nhttp_archive(\n    name = \"bazel_skylib\",\n    sha256 = \"cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz\",\n        \"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz\",\n    ],\n)\n\n# bazel_features is required by rules_cc compatibility_proxy_repo\nhttp_archive(\n    name = \"bazel_features\",\n    sha256 = \"af3d4fb1cf4f25942cb4a933b1ad93a0ea9fe9ee70c2af7f369fb72a67c266e5\",\n    strip_prefix = \"bazel_features-1.21.0\",\n    urls = [\"https://github.com/bazel-contrib/bazel_features/releases/download/v1.21.0/bazel_features-v1.21.0.tar.gz\"],\n)\n\nload(\"@bazel_features//:deps.bzl\", \"bazel_features_deps\")\n\nbazel_features_deps()\n\n# rules_cc required by abseil-cpp\nhttp_archive(\n    name = \"rules_cc\",\n    sha256 = \"a2fdfde2ab9b2176bd6a33afca14458039023edb1dd2e73e6823810809df4027\",\n    strip_prefix = \"rules_cc-0.2.14\",\n    urls = [\"https://github.com/bazelbuild/rules_cc/releases/download/0.2.14/rules_cc-0.2.14.tar.gz\"],\n)\n\nload(\"@rules_cc//cc:extensions.bzl\", \"compatibility_proxy_repo\")\n\ncompatibility_proxy_repo()\n\nload(\"@bazel_skylib//:workspace.bzl\", \"bazel_skylib_workspace\")\n\nbazel_skylib_workspace()\n\n# released on 2023-10-19\nhttp_archive(\n    name = \"rules_fuzzing\",\n    sha256 = \"ff52ef4845ab00e95d29c02a9e32e9eff4e0a4c9c8a6bcf8407a2f19eb3f9190\",\n    strip_prefix = \"rules_fuzzing-0.4.1\",\n    urls = [\"https://github.com/bazelbuild/rules_fuzzing/releases/download/v0.4.1/rules_fuzzing-0.4.1.zip\"],\n)\n\nload(\"@rules_fuzzing//fuzzing:repositories.bzl\", \"rules_fuzzing_dependencies\")\n\nrules_fuzzing_dependencies()\n\nload(\"@rules_fuzzing//fuzzing:init.bzl\", \"rules_fuzzing_init\")\n\nrules_fuzzing_init()\n\nload(\"@fuzzing_py_deps//:requirements.bzl\", \"install_deps\")\n\ninstall_deps()\n\n"
  },
  {
    "path": "projects/abseil-cpp/build.sh",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport USE_BAZEL_VERSION=7.4.0\n# Disable `layering_check` feature.\n# As per https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63223, it breaks\n# the build. Someone could figure out exactly why it breaks the build, but just\n# disabling it suffices because it doesn't actually matter for our purposes. ;)\n# Also use C++17 as required by abseil-cpp.\nexport BAZEL_EXTRA_BUILD_FLAGS='--features=-layering_check --cxxopt=-std=c++17'\n# The default query is complex and requires additional dependencies in order to\n# work (due to its use of `//...`) whereas this query is simple and sufficient.\nexport BAZEL_FUZZ_TEST_QUERY='filter(\"_fuzzer$\", //:all)'\nexec bazel_build_fuzz_tests\n\n"
  },
  {
    "path": "projects/abseil-cpp/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"abseil.io\"\nlanguage: c++\nprimary_contact: \"dmauro@google.com\"\nmain_repo: 'https://github.com/abseil/abseil-cpp.git'\n"
  },
  {
    "path": "projects/abseil-cpp/string_escape_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <string> \n\n#include \"absl/strings/escaping.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n\tstd::string str (reinterpret_cast<const char*>(data), size);\n\tstd::string escaped, unescaped;\n\tescaped = absl::CHexEscape(str);\n\tabsl::CUnescape(escaped, &unescaped);\n\tif (str != unescaped)\n\t\tabort();\n\n\tescaped = absl::CEscape(str);\n\tabsl::CUnescape(escaped, &unescaped);\n\tif (str != unescaped)\n\t\tabort();\n\n\tescaped = absl::Utf8SafeCEscape(str);\n\tabsl::CUnescape(escaped, &unescaped);\n\tif (str != unescaped)\n\t\tabort();\n\t\n\tescaped = absl::Utf8SafeCHexEscape(str);\n\tabsl::CUnescape(escaped, &unescaped);\n\tif (str != unescaped)\n\t\tabort();\n\t\n\tstd::string encoded, decoded;\n\tabsl::Base64Escape(str, &encoded);\n\tabsl::Base64Unescape(encoded, &decoded);\n\tif (str != unescaped)\n\t\tabort();\n\n\tabsl::WebSafeBase64Escape(str, &encoded);\n\tabsl::WebSafeBase64Unescape(encoded, &decoded);\n\tif (str != decoded)\n\t\tabort();\n\n\tstd::string hex_result, bytes_result;\n\thex_result = absl::BytesToHexString(str);\n\tbytes_result = absl::HexStringToBytes(hex_result);\n\tif (str != decoded)\n\t\tabort();\n\n\treturn 0;\n}"
  },
  {
    "path": "projects/abseil-cpp/string_utilities_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <string>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"absl/strings/str_format.h\"\n#include \"absl/strings/str_join.h\"\n#include \"absl/strings/str_split.h\"\n#include \"absl/strings/numbers.h\"\n#include \"absl/strings/str_cat.h\"\n\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n\tFuzzedDataProvider fuzzed_data(data, size);\n\tfloat float_value = fuzzed_data.ConsumeFloatingPoint<float>();\n\tdouble double_value = fuzzed_data.ConsumeFloatingPoint<double>();\n\tint int_value = fuzzed_data.ConsumeIntegral<int>();\n\tbool bool_value = fuzzed_data.ConsumeBool();\n\tstd::string str1 = fuzzed_data.ConsumeRandomLengthString();\n\tstd::string str2 = fuzzed_data.ConsumeRemainingBytesAsString();\n\n\tstd::string float_str = absl::StrFormat(\"%g\", float_value);\n\tstd::string double_str = absl::StrFormat(\"%g\", double_value);\n\tstd::string int_str = absl::StrFormat(\"%d\", int_value);\n\tstd::string bool_str = absl::StrFormat(\"%d\", bool_value);\n\t\n\tif (!absl::SimpleAtof(float_str, &float_value))\n\t\treturn 0;\n\tif (!absl::SimpleAtod(double_str, &double_value))\n\t\treturn 0;\n\tif (!absl::SimpleAtoi(int_str, &int_value))\n\t\treturn 0;\n\tif (!absl::SimpleAtob(bool_str, &bool_value))\n\t\treturn 0;\n\n\tabsl::StrAppend(&str1, str2);\n\tstd::string str_result = absl::StrCat(str1, float_value, double_value, int_value, bool_value);\n\tstd::vector<std::string> v = absl::StrSplit(str_result, \".\");\n\tabsl::StrJoin(v, \".\");\n\treturn 0;\n}"
  },
  {
    "path": "projects/abseil-py/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/abseil/abseil-py abseil-py\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/abseil-py\n"
  },
  {
    "path": "projects/abseil-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 -m pip install .\ncd ../\nmkdir fuzzbuilds\ncd fuzzbuilds\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/abseil-py/fuzz_argparse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport enum\nimport atheris\n\nfrom absl import flags\nfrom absl.flags import _exceptions\nfrom absl.flags import argparse_flags\n\nclass FuzzEnum(enum.Enum):\n  VAL1 = object()\n  VAL2 = object()\n\n\ndef TestOneInput(data):\n  \"\"\"Hits the logic in https://github.com/abseil/abseil-py/tree/main/absl/flags\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n\n  def rs(size):\n    return fdp.ConsumeUnicodeNoSurrogates(size)\n\n  fuzz_flag_values = flags.FlagValues()\n  try:\n    flags.DEFINE_string(rs(256), None, rs(256), flag_values = fuzz_flag_values)\n  except _exceptions.Error:\n    pass\n\n  try:\n    flags.DEFINE_float(rs(256), 0.0, rs(256), flag_values = fuzz_flag_values)\n  except _exceptions.Error:\n    pass\n\n  try:\n    flags.DEFINE_enum_class(rs(256), None, FuzzEnum, rs(256), flag_values = fuzz_flag_values)\n  except _exceptions.Error:\n    pass\n\n  try:\n    flags.DEFINE_integer(rs(256), rs(256), rs(256), flag_values = fuzz_flag_values)\n  except _exceptions.Error:\n    pass\n  \n  command_line_args = []\n  for idx in range(fdp.ConsumeIntInRange(1, 20)):\n    command_line_args.append(rs(256))\n\n  # Parse it all\n  try:\n    fuzz_flag_values(command_line_args)\n  except _exceptions.Error:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/abseil-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/abseil/abseil-py\nlanguage: python\nmain_repo: https://github.com/abseil/abseil-py\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ada-url/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone --depth 1 https://github.com/ada-url/ada ada-url\nRUN cp ada-url/fuzz/build.sh $SRC/\nWORKDIR ada-url\nCOPY run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/ada-url/project.yaml",
    "content": "homepage: \"https://ada-url.github.io/ada\"\nlanguage: c++\nprimary_contact: \"yagiz@nizipli.com\"\nauto_ccs:\n  - \"daniel@lemire.me\"\nmain_repo: \"https://github.com/ada-url/ada.git\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n  - centipede\nfile_github_issue: true\n"
  },
  {
    "path": "projects/ada-url/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build-tests\n"
  },
  {
    "path": "projects/adal/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/AzureAD/azure-activedirectory-library-for-python adsl\nWORKDIR adsl\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/adal/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/adal/fuzz_util.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport binascii\nwith atheris.instrument_imports():\n     from adal.util import *\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    is_http_success(fdp.ConsumeInt(10))\n\n    class DummyClass(object):\n        _call_context = {\n            'log_context':{'correlation_id':fdp.ConsumeString(20)},\n            'options':{'http':{\n                fdp.ConsumeString(10):fdp.ConsumeString(100),\n                fdp.ConsumeString(10):fdp.ConsumeString(100),\n                fdp.ConsumeString(10):fdp.ConsumeString(100)\n            }}\n        }\n\n        def geturl(self):\n           return fdp.ConsumeString(100)\n\n    create_request_options(DummyClass(),{\n        fdp.ConsumeString(10):fdp.ConsumeString(100),\n        fdp.ConsumeString(10):fdp.ConsumeString(100),\n        fdp.ConsumeString(10):fdp.ConsumeString(100),\n        'headers':{\n            fdp.ConsumeString(10):fdp.ConsumeString(100),\n            fdp.ConsumeString(10):fdp.ConsumeString(100),\n            fdp.ConsumeString(10):fdp.ConsumeString(100)\n        }\n    })\n\n    try:\n        copy_url(fdp.ConsumeString(100))\n        copy_url(DummyClass())\n    except ValueError as e:\n        if ((\"contains invalid characters\" not in str(e)) and\n            (\"Invalid IPv6 URL\" not in str(e))):\n            raise e\n\n    try:\n        base64_urlsafe_decode(fdp.ConsumeUnicodeNoSurrogates(100))\n    except binascii.Error as e:\n        if \"Invalid base64-encoded string\" not in str(e):\n            raise e\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n\n"
  },
  {
    "path": "projects/adal/fuzz_xmlutil.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\ntry:\n    from xml.etree import cElementTree as ET\nexcept ImportError:\n    from xml.etree import ElementTree as ET\nfrom xml.etree.ElementTree import ParseError\nwith atheris.instrument_imports():\n     from adal.xmlutil import *\n\nXMLTEMPLATE=\"\"\"\n<?xml version=\"1.0\"?>\n<%OUTTER%>\n    <%INNER% name=\"%INNERNAME%\">\n        <%LEAF1%>%LEAF1VALUE1%</%LEAF1%>\n        <%LEAF2%>%LEAF2VALUE1%</%LEAF2%>\n        <%LEAF3% name=\"%LEAF3NAME1%\" value=\"%LEAF3VALUE1%\"/>\n        <%LEAF3% name=\"%LEAF3NAME4%\" value=\"%LEAF3VALUE4%\"/>\n    </%INNER%>\n    <%INNER% name=\"%INNERNAME%\">\n        <%LEAF1%>%LEAF1VALUE2%</rank>\n        <%LEAF2%>%LEAF2VALUE2%</year>\n        <%LEAF3% name=\"%LEAF3NAME2%\" value=\"%LEAF3VALUE2%\"/>\n    </%INNER%>\n    <%INNER% name=\"%INNERNAME%\">\n        <%LEAF1%>%LEAF1VALUE3%</%LEAF1%>\n        <%LEAF2%>%LEAF2VALUE3%</%LEAF2%>\n        <%LEAF3% name=\"%LEAF3NAME3%\" value=\"%LEAF3VALUE3%\"/>\n    </%INNER%>\n</%OUTTER%>\n\"\"\"\n\ndef generate_sample_xml(fdp):\n    global XMLTEMPLATE\n    xml_string = XMLTEMPLATE\n\n    replace_tag = [\"%OUTTER%\",\"%INNER%\",\"%LEAF1%\",\"%LEAF2%\",\"%LEAF3%\"]\n    replace_value = [\"%INNERNAME%\",\n        \"%LEAF1VALUE1%\",\"%LEAF2VALUE1%\",\"%LEAF3NAME1%\",\"%LEAF3VALUE1%\",\n        \"%LEAF1VALUE2%\",\"%LEAF2VALUE2%\",\"%LEAF3NAME2%\",\"%LEAF3VALUE3%\",\n        \"%LEAF1VALUE3%\",\"%LEAF2VALUE3%\",\"%LEAF3NAME2%\",\"%LEAF3VALUE4%\",\n        \"%LEAF3NAME4\",\"%LEAF3VALUE4%\"\n    ]\n\n    for tag in replace_tag+replace_value:\n        xml_string = xml_string.replace(tag,fdp.ConsumeUnicodeNoSurrogates(10))\n\n    return xml_string\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        expand_q_names(fdp.ConsumeString(100))\n    except IndexError as e:\n        if \"Unable to parse XPath string:\" not in str(e):\n            raise e\n    except KeyError:\n        return\n\n    try:\n        dom = ET.fromstring(generate_sample_xml(fdp))\n    except ParseError:\n        return\n\n    xpath_find(dom,fdp.ConsumeString(30))\n    serialize_node_children(dom)\n    is_element_node(dom)\n    find_element_text(dom)\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/adal/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/AzureAD/azure-activedirectory-library-for-python\nlanguage: python\nmain_repo: https://github.com/AzureAD/azure-activedirectory-library-for-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/aiohttp/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y \\\n  pkg-config \\\n  zlib1g \\\n  zlib1g-dev \\\n  libjpeg-dev \\\n  libpng-dev \\\n  libffi-dev \\\n  make \\\n  autoconf \\\n  libtool\nRUN python3 -m pip install --upgrade pip\nRUN curl -sL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh\nRUN bash nodesource_setup.sh && apt-get install -y nodejs\nRUN git clone --recurse-submodules https://github.com/aio-libs/aiohttp\nCOPY build.sh $SRC/\nCOPY fuzz_* $SRC/aiohttp/\n\nWORKDIR $SRC/aiohttp\n"
  },
  {
    "path": "projects/aiohttp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Build the llhttp parser\ngit submodule update --init --recursive\npushd \"$SRC/aiohttp/vendor/llhttp/\"\nnpm ci\nmake\npopd # \"$SRC/aiohttp/vendor/llhttp/\"\n\n# Build & install aiohttp\nmake cythonize\nmake install-dev\n\n# Duplicate fuzzers to use Pure python code (in addition\n# to the existing C-compiled code).\ncp fuzz_http_parser.py fuzz_http_parser_pure_python.py\nsed -i 's/AIOHTTP_VAL=0/AIOHTTP_VAL=1/g' fuzz_http_parser_pure_python.py\ncp fuzz_http_payload_parser.py fuzz_http_payload_parser_pure_python.py\nsed -i 's/AIOHTTP_VAL=0/AIOHTTP_VAL=1/g' fuzz_http_payload_parser_pure_python.py\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/aiohttp/fuzz_http_parser.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nAIOHTTP_VAL=0\nif AIOHTTP_VAL == 0:\n  os.environ[\"AIOHTTP_NO_EXTENSIONS\"] = \"\"\nelse:\n  os.environ[\"AIOHTTP_NO_EXTENSIONS\"] = \"1\"\n\nimport sys\nimport atheris\n\n# aiohttp imports\nimport asyncio\nwith atheris.instrument_imports():\n    import aiohttp\n    from aiohttp.base_protocol import BaseProtocol\n    from aiohttp import http_exceptions, streams\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    loop = asyncio.get_event_loop()\n    pr = BaseProtocol(loop)\n    h_p = aiohttp.http_parser.HttpRequestParser(pr, loop, 32768)\n    try:\n        h_p.feed_data(data)\n        h_p.feed_eof()\n    except aiohttp.http_exceptions.HttpProcessingError:\n        None\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    loop = asyncio.get_event_loop()\n    asyncio.set_event_loop(loop)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/aiohttp/fuzz_http_payload_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nAIOHTTP_VAL=0\nif AIOHTTP_VAL == 0:\n  os.environ[\"AIOHTTP_NO_EXTENSIONS\"] = \"\"\nelse:\n  os.environ[\"AIOHTTP_NO_EXTENSIONS\"] = \"1\"\n\nimport sys\nimport atheris\n\n# aiohttp imports\nimport asyncio\nwith atheris.instrument_imports():\n    import aiohttp\n    from aiohttp.base_protocol import BaseProtocol\n    from aiohttp import http_exceptions, streams\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    loop = asyncio.get_event_loop()\n    pr = BaseProtocol(loop)\n    out = aiohttp.StreamReader(pr, 2**16, loop=None)\n    h_p = aiohttp.http_parser.HttpPayloadParser(out, loop, 32768)\n    try:\n        h_p.feed_data(data)\n    except aiohttp.http_exceptions.HttpProcessingError:\n        None\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    loop = asyncio.get_event_loop()\n    asyncio.set_event_loop(loop)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/aiohttp/fuzz_multipart.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport io\nimport sys\nimport atheris\n\n# aiohttp imports\nimport asyncio\nwith atheris.instrument_imports():\n    import aiohttp\n    from aiohttp.hdrs import (\n        CONTENT_TYPE,\n    )\n\nclass FuzzStream:\n    def __init__(self, content):\n        self.content = io.BytesIO(content)\n\n    async def read(self, size = None):\n        return self.content.read(size)\n\n    def at_eof(self):\n        return self.content.tell() == len(self.content.getbuffer())\n\n    async def readline(self):\n        return self.content.readline()\n\n    def unread_data(self, data):\n        self.content = io.BytesIO(data + self.content.read())\n\n\n@atheris.instrument_func\nasync def fuzz_bodypart_reader(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    obj = aiohttp.BodyPartReader(\n        b\"--:\",\n        {\n            CONTENT_TYPE: fdp.ConsumeUnicode(30),\n        },\n        FuzzStream(fdp.ConsumeBytes(atheris.ALL_REMAINING)),\n    )\n    if not obj.at_eof():\n        await obj.form()\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    try:\n        asyncio.run(fuzz_bodypart_reader(data))\n    except AssertionError:\n        return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    loop = asyncio.get_event_loop()\n    asyncio.set_event_loop(loop)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/aiohttp/fuzz_payload_url.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\n# aiohttp specific\nwith atheris.instrument_imports():\n    from aiohttp import http_exceptions, payload\n    from yarl import URL\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    original = fdp.ConsumeString(sys.maxsize)\n\n    try:\n        p = payload.StringPayload(original)\n    except UnicodeEncodeError:\n        None\n    try:\n        u = URL(original)\n    except ValueError:\n        None\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/aiohttp/fuzz_web_request.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\n# aiohttp imports\nimport asyncio\nwith atheris.instrument_imports():\n    import aiohttp\n    from aiohttp.test_utils import make_mocked_request\n    from multidict import CIMultiDict\n    from yarl import URL\n\n@atheris.instrument_func\nasync def fuzz_run_one_async(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    url_s = fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512))\n    try:\n        URL(url_s)\n    except Exception:\n        return\n\n    headers = CIMultiDict(\n        { fdp.ConsumeString(20) : fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)) }\n    )\n    req = make_mocked_request(\"GET\", url_s, headers=headers)\n\n    l1 = len(req.forwarded)\n    ret = await req.post()\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    asyncio.run(fuzz_run_one_async(data))\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    loop = asyncio.get_event_loop()\n    asyncio.set_event_loop(loop)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/aiohttp/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/aio-libs/aiohttp\nlanguage: python\nmain_repo: https://github.com/aio-libs/aiohttp\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/airflow/Dockerfile",
    "content": "# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get update && apt-get install -y sqlite3\nRUN pip3 install --upgrade pip\n\nRUN git clone --depth 1 https://github.com/apache/airflow $SRC/airflow\n\nWORKDIR airflow\n\nCOPY build.sh dag_fuzz.py $SRC/\n"
  },
  {
    "path": "projects/airflow/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/airflow\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install colorlog\npip3 install ./task-sdk ./airflow-core .\n\n# Build fuzzers in $OUT.\ncd $SRC\nCONFIG_TEMPLATES_PATH=$(python3 -c \"import os, airflow; print(os.path.join(os.path.dirname(airflow.__file__), 'config_templates'))\")\ncompile_python_fuzzer dag_fuzz.py --add-data \"$CONFIG_TEMPLATES_PATH:airflow/config_templates\" --hidden-import=\"airflow.utils.log.timezone_aware\" --hidden-import=\"aiosqlite\" --hidden-import=\"airflow.sdk.serde.serializers\"\n"
  },
  {
    "path": "projects/airflow/dag_fuzz.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport colorlog\nfrom datetime import datetime, timedelta\n\nwith atheris.instrument_imports(include=['airflow'], enable_loader_override=False):\n   import airflow\n   from airflow import DAG\n   from airflow.exceptions import AirflowException\n   \n   try:\n      from airflow.providers.standard.operators.empty import EmptyOperator as DummyOperator\n      from airflow.providers.standard.operators.python import PythonOperator\n   except ImportError:\n      try:\n          from airflow.operators.empty import EmptyOperator as DummyOperator\n          from airflow.operators.python import PythonOperator\n      except ImportError:\n          from airflow.operators.dummy_operator import DummyOperator\n          from airflow.operators.python_operator import PythonOperator\n\ndef py_func():\n   return\n\ndef TestInput(input_bytes):\n   fdp = atheris.FuzzedDataProvider(input_bytes)\n\n   default_args = {\n      'owner': fdp.ConsumeString(8),\n      'depends_on_past': fdp.ConsumeBool(),\n      'start_date': datetime.now() - timedelta(days=fdp.ConsumeIntInRange(1,5)),\n      'email': [fdp.ConsumeString(8)],\n      'email_on_failure': fdp.ConsumeBool(),\n      'email_on_retry': fdp.ConsumeBool(),\n      'retries': fdp.ConsumeIntInRange(1,5),\n      'retry_delay': timedelta(minutes=fdp.ConsumeIntInRange(1,5)),\n   }\n\n   try:\n      with DAG(fdp.ConsumeString(8), schedule_interval='@daily', default_args=default_args) as dag:\n         dummy_task = DummyOperator(task_id=fdp.ConsumeString(8), retries=fdp.ConsumeIntInRange(1,5))\n         python_task = PythonOperator(task_id=fdp.ConsumeString(8), python_callable=py_func)\n\n         dummy_task >> python_task\n   except (AirflowException, ValueError, TypeError):\n      pass\n\ndef main():\n   atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n   atheris.Fuzz()\n\nif __name__ == \"__main__\":\n   main()\n"
  },
  {
    "path": "projects/airflow/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/apache/airflow\nlanguage: python\nmain_repo: https://github.com/apache/airflow\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/alembic/Dockerfile",
    "content": "\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y build-essential zlib1g-dev zlib1g-dev:i386 python make automake\n\nRUN git clone -b v3.2.1 --depth 1 https://github.com/AcademySoftwareFoundation/imath $SRC/imath && \\\n    cd $SRC/imath && \\\n    mkdir build && \\\n    cd build && \\\n    cmake -D BUILD_SHARED_LIBS=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ../ && \\\n    make -j$(nproc) V=1 && make install\n\nRUN git clone --depth 1 https://github.com/alembic/alembic\n\nCOPY run_tests.sh build.sh *.h *.cc $SRC/\nWORKDIR $WORK/\n"
  },
  {
    "path": "projects/alembic/alembic_dump_info_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <err.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n#include \"alembic/lib/Alembic/AbcCoreFactory/All.h\"\n#include \"alembic/lib/Alembic/AbcCoreOgawa/All.h\"\n#include \"alembic/lib/Alembic/AbcGeom/All.h\"\n#include \"alembic/lib/Alembic/AbcMaterial/All.h\"\n\n#include \"fuzzer_temp_file.h\"\n\nusing Alembic::AbcCoreAbstract::PropertyHeader;\nusing Alembic::AbcCoreAbstract::PropertyType;\nusing Alembic::AbcCoreFactory::IFactory;\nusing Alembic::AbcGeom::C4fArraySamplePtr;\nusing Alembic::AbcGeom::IArchive;\nusing Alembic::AbcGeom::IC4fGeomParam;\nusing Alembic::AbcGeom::ICompoundProperty;\nusing Alembic::AbcGeom::ICurves;\nusing Alembic::AbcGeom::ICurvesSchema;\nusing Alembic::AbcGeom::IFaceSet;\nusing Alembic::AbcGeom::IFaceSetSchema;\nusing Alembic::AbcGeom::IGeomBaseSchema;\nusing Alembic::AbcGeom::IN3fGeomParam;\nusing Alembic::AbcGeom::index_t;\nusing Alembic::AbcGeom::Int32ArraySamplePtr;\nusing Alembic::AbcGeom::IObject;\nusing Alembic::AbcGeom::IPolyMesh;\nusing Alembic::AbcGeom::IPolyMeshSchema;\nusing Alembic::AbcGeom::ISubD;\nusing Alembic::AbcGeom::ISubDSchema;\nusing Alembic::AbcGeom::IV2fGeomParam;\nusing Alembic::AbcGeom::IXform;\nusing Alembic::AbcGeom::IXformSchema;\nusing Alembic::AbcGeom::M44d;\nusing Alembic::AbcGeom::M44f;\nusing Alembic::AbcGeom::N3fArraySamplePtr;\nusing Alembic::AbcGeom::ObjectHeader;\nusing Alembic::AbcGeom::P3fArraySamplePtr;\nusing Alembic::AbcGeom::UInt32ArraySamplePtr;\nusing Alembic::AbcGeom::V2fArraySamplePtr;\nusing Alembic::AbcMaterial::IMaterial;\nusing Alembic::AbcMaterial::IMaterialSchema;\n\ntemplate <typename T> void dumpAttributes(T const &schema) {\n\n  const size_t meshPropertyCount = schema.getNumProperties();\n\n  for (size_t p = 0; p < meshPropertyCount; p++) {\n    const PropertyHeader &header = schema.getPropertyHeader(p);\n    const PropertyType pType = header.getPropertyType();\n    const std::string &name = header.getName();\n\n    if (name == \"P\") {\n      schema.getNumSamples();\n    } else if (name == \"uv\" || name == \"st\") {\n      schema.getUVsParam().getNumSamples();\n    } else if (name == \".arbGeomParams\") {\n      // additional geometry elements (color sets, additional texture\n      // coordinates)\n      const ICompoundProperty geoParam = schema.getArbGeomParams();\n      const size_t geoPropCount = geoParam.getNumProperties();\n\n      for (size_t g = 0; g < geoPropCount; g++) {\n        const PropertyHeader &headerGeo = geoParam.getPropertyHeader(g);\n        const std::string &nameGeo = headerGeo.getName();\n      }\n    }\n  }\n}\n\nvoid dumpPolyMesh(const IObject &node) {\n  const ObjectHeader &header = node.getHeader();\n  const IPolyMesh mesh(node.getParent(), header.getName());\n  const IPolyMeshSchema &schema = mesh.getSchema();\n\n  // Mesh properties\n  dumpAttributes(schema);\n}\n\nvoid dumpSubD(const IObject &node) {\n  const ObjectHeader &header = node.getHeader();\n  const ISubD mesh(node.getParent(), header.getName());\n  const ISubDSchema &schema = mesh.getSchema();\n\n  dumpAttributes(schema);\n  schema.getSubdivisionSchemeProperty();\n  schema.getFaceVaryingInterpolateBoundaryProperty();\n  schema.getFaceVaryingPropagateCornersProperty();\n  schema.getInterpolateBoundaryProperty();\n}\n\nvoid dumpFaceSet(const IObject &node) {\n  const ObjectHeader &header = node.getHeader();\n  const IFaceSet faceSet(node.getParent(), header.getName());\n  const IFaceSetSchema &schema = faceSet.getSchema();\n  schema.getNumSamples();\n}\n\nvoid dumpCurves(const IObject &node) {\n  const ObjectHeader &header = node.getHeader();\n  const ICurves curves(node.getParent(), header.getName());\n  const ICurvesSchema &schema = curves.getSchema();\n\n  dumpAttributes(schema);\n}\n\nvoid dumpXform(const IObject &node) {\n  const ObjectHeader &header = node.getHeader();\n  const IXform xform(node.getParent(), header.getName());\n  const IXformSchema &schema = xform.getSchema();\n\n  schema.getNumSamples();\n  schema.getNumOps();\n}\n\nvoid dumpMaterial(const IObject &node) {\n  const ObjectHeader &header = node.getHeader();\n  IMaterial material(node.getParent(), header.getName());\n  IMaterialSchema &schema = material.getSchema();\n\n  std::vector<std::string> targetNames;\n  schema.getTargetNames(targetNames);\n\n  for (const std::string &target : targetNames) {\n    std::vector<std::string> shaderTypes;\n    schema.getShaderTypesForTarget(target, shaderTypes);\n    const size_t shaderTypeCount = shaderTypes.size();\n    for (size_t s = 0; s < shaderTypeCount; s++) {\n\n      ICompoundProperty parameters =\n          schema.getShaderParameters(target, shaderTypes[s]);\n      const size_t parameterCount = parameters.getNumProperties();\n    }\n  }\n}\n\nvoid dumpNodes(const IObject &node) {\n  const ObjectHeader &header = node.getHeader();\n  // Dump the general node information.\n  header.getName();\n  header.getFullName();\n  header.getMetaData().serialize();\n\n  // Dump the type specific information.\n  if (Alembic::AbcGeom::IPolyMesh::matches(header)) {\n    dumpPolyMesh(node);\n  } else if (Alembic::AbcGeom::ISubD::matches(header)) {\n    dumpSubD(node);\n  } else if (Alembic::AbcGeom::IFaceSet::matches(header)) {\n    dumpFaceSet(node);\n  } else if (Alembic::AbcGeom::ICurves::matches(header)) {\n    dumpCurves(node);\n  } else if (Alembic::AbcGeom::IXform::matches(header)) {\n    dumpXform(node);\n  } else if (Alembic::AbcMaterial::IMaterial::matches(header)) {\n    dumpMaterial(node);\n  } else { // Miscellaneous nodes such as the root.\n    ;\n  }\n\n  // Dump the child headers.\n  const size_t childCount = node.getNumChildren();\n  for (size_t i = 0; i < childCount; i++) {\n    dumpNodes(node.getChild(i));\n  }\n}\n\nvoid dumpInfo(const char *file) {\n  // Load the Alembic archive and verify that it is valid.\n  IFactory factory;\n  IArchive archive = factory.getArchive(file);\n\n  if (archive.valid()) {\n    archive.getName();\n    dumpNodes(archive.getTop());\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzerTemporaryFile tempFile(data, size);\n  dumpInfo(tempFile.filename());\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/alembic/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build alembic\nmkdir -p $WORK/build_alembic\ncd $WORK/build_alembic\ncmake $SRC/alembic -DALEMBIC_SHARED_LIBS=OFF\nmake -j$(nproc)\n\nINCLUDES=(\n  \"-I $SRC\"\n  \"-I ${SRC}/alembic/lib\"\n  \"-I ${WORK}/build_alembic/lib\"\n  \"-I /usr/local/include/Imath\"\n)\n\nfor fuzzer in $(find $SRC -name '*_fuzzer.cc'); do\n  fuzzer_basename=$(basename -s .cc $fuzzer)\n  $CXX $CXXFLAGS -std=c++11 ${INCLUDES[@]} \\\n    $fuzzer $WORK/build_alembic/lib/Alembic/libAlembic.a $LIB_FUZZING_ENGINE \\\n    -o $OUT/$fuzzer_basename $SRC/imath/build/src/Imath/libImath-3_2.a\ndone\n"
  },
  {
    "path": "projects/alembic/fuzzer_temp_file.h",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that\n// require a file instead of an input buffer.\n\n#ifndef FUZZER_TEMP_FILE_H_\n#define FUZZER_TEMP_FILE_H_\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n// Pure-C interface for creating and cleaning up temporary files.\n\nstatic char *fuzzer_get_tmpfile(const uint8_t *data, size_t size) {\n  char *filename_buffer = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n  if (!filename_buffer) {\n    perror(\"Failed to allocate file name buffer.\");\n    abort();\n  }\n  const int file_descriptor = mkstemp(filename_buffer);\n  if (file_descriptor < 0) {\n    perror(\"Failed to make temporary file.\");\n    abort();\n  }\n  FILE *file = fdopen(file_descriptor, \"wb\");\n  if (!file) {\n    perror(\"Failed to open file descriptor.\");\n    close(file_descriptor);\n    abort();\n  }\n  const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);\n  if (bytes_written != size) {\n    fclose(file);\n    fprintf(stderr, \"Failed to write all bytes to file (%zu out of %zu)\",\n            bytes_written, size);\n    abort();\n  }\n  fclose(file);\n  return filename_buffer;\n}\n\nstatic void fuzzer_release_tmpfile(char *filename) {\n  if (unlink(filename) != 0) {\n    perror(\"WARNING: Failed to delete temporary file.\");\n  }\n  free(filename);\n}\n\n// C++ RAII object for creating temporary files.\n\n#ifdef __cplusplus\nclass FuzzerTemporaryFile {\npublic:\n  FuzzerTemporaryFile(const uint8_t *data, size_t size)\n      : filename_(fuzzer_get_tmpfile(data, size)) {}\n\n  ~FuzzerTemporaryFile() { fuzzer_release_tmpfile(filename_); }\n\n  const char *filename() const { return filename_; }\n\nprivate:\n  char *filename_;\n};\n#endif\n\n#endif // FUZZER_TEMP_FILE_H_\n"
  },
  {
    "path": "projects/alembic/project.yaml",
    "content": "homepage: \"https://github.com/alembic/alembic\"\nlanguage: c++\nprimary_contact: \"miller.lucas@gmail.com\"\nsanitizers:\n  - address\nmain_repo: 'https://github.com/alembic/alembic'\n"
  },
  {
    "path": "projects/alembic/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build alembic\nctest --test-dir $WORK/build_alembic\n"
  },
  {
    "path": "projects/ampproject/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! This project was pinned after a clang bump. Please remove the pin, Try to fix any build warnings and errors, as well as runtime errors\nRUN apt-get update && apt-get install -y make autoconf automake libtool libomp-dev libgomp1 nodejs\nCOPY build.sh *.diff $SRC/\n\nRUN git clone --depth 1 https://github.com/ampproject/amphtml amphtml && \\\n    cd amphtml && \\\n    git apply  --ignore-space-change --ignore-whitespace $SRC/fuzz_patch.diff\nWORKDIR amphtml\n"
  },
  {
    "path": "projects/ampproject/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport USE_BAZEL_VERSION=5.4.0\ncd validator\nexport FUZZTEST_TARGET_FOLDER=\"//cpp/htmlparser:parser_fuzz_test\"\ncompile_fuzztests.sh\n"
  },
  {
    "path": "projects/ampproject/fuzz_patch.diff",
    "content": "diff --git a/validator/WORKSPACE b/validator/WORKSPACE\nindex 0510b05..26e878c 100644\n--- a/validator/WORKSPACE\n+++ b/validator/WORKSPACE\n@@ -101,3 +101,10 @@ local_repository(\n     name = \"amphtml-extensions\",\n     path = \"../extensions\",\n )\n+\n+http_archive(\n+    name = \"com_google_fuzztest\",\n+    sha256 = \"c75f224b34c3c62ee901381fb743f6326f7b91caae0ceb8fe62f3fd36f187627\",\n+    strip_prefix = \"fuzztest-58b4e7065924f1a284952b84ea827ce35a87e4dc\",\n+    urls = [\"https://github.com/google/fuzztest/archive/58b4e7065924f1a284952b84ea827ce35a87e4dc.zip\"],\n+)\ndiff --git a/validator/cpp/htmlparser/BUILD b/validator/cpp/htmlparser/BUILD\nindex 3d31520..41bfd93 100644\n--- a/validator/cpp/htmlparser/BUILD\n+++ b/validator/cpp/htmlparser/BUILD\n@@ -555,3 +555,15 @@ cc_test(\n         \"@com_google_absl//absl/flags:flag\",\n     ],\n )\n+\n+cc_test(\n+    name = \"parser_fuzz_test\",\n+    srcs = [\"parser_fuzz_test.cc\"],\n+    deps = [\n+        \":parser\",\n+        \"@com_google_fuzztest//fuzztest\",\n+        \"@com_google_fuzztest//fuzztest:fuzztest_gtest_main\",\n+        \"@com_google_googletest//:gtest_main\",\n+    ],\n+)\n+\ndiff --git a/validator/cpp/htmlparser/parser_fuzz_test.cc b/validator/cpp/htmlparser/parser_fuzz_test.cc\nnew file mode 100644\nindex 0000000..2ad7194\n--- /dev/null\n+++ b/validator/cpp/htmlparser/parser_fuzz_test.cc\n@@ -0,0 +1,10 @@\n+#include \"cpp/htmlparser/parser.h\"\n+\n+#include \"fuzztest/fuzztest.h\"\n+\n+void FuzzParser(std::string raw_html) {\n+  htmlparser::Parser parser(raw_html);\n+  parser.Parse();\n+}\n+\n+FUZZ_TEST(CC_FUZZING, FuzzParser);\n"
  },
  {
    "path": "projects/ampproject/project.yaml",
    "content": "homepage: \"https://github.com/ampproject/amphtml\"\nlanguage: c++\nmain_repo: \"https://github.com/ampproject/amphtml\"\nfuzzing_engines:\n - libfuzzer\nvendor_ccs:\n - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/angle/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y \\\n        lsb-release sudo pkg-config file\n\nRUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git\nENV PATH=/src/depot_tools:$PATH\nWORKDIR angle\nRUN fetch angle\n\nRUN ./build/install-build-deps.sh --no-prompt\n\nCOPY build.sh *.cc fuzzer_profile $SRC/\n\n# Add fuzzer profile\nRUN cat $SRC/fuzzer_profile >> $SRC/angle/BUILD.gn\n"
  },
  {
    "path": "projects/angle/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Fix sanitizer\nORIGINAL_SANITIZER=\"${SANITIZER:-}\"\n\nif [ \"$SANITIZER\" = \"coverage\" ] || [ \"$SANITIZER\" = \"introspector\" ] || [ \"$SANITIZER\" = \"none\" ]; then\n    export SANITIZER=\"address\"\nfi\n\n# Configure arguments for gn build\nARGS=\"treat_warnings_as_errors=false is_component_build=false libcxx_is_shared=false is_debug=false\"\nARGS+=\" use_custom_libcxx=false use_sysroot=true ozone_platform_x11=false\"\nARGS+=\" is_clang=true clang_use_chrome_plugins=false clang_base_path=\\\"/usr/local\\\"\"\n\n# Configure arguments for gn build\nif [ \"$SANITIZER\" = \"undefined\" ]; then\n    ARGS=\"$ARGS is_ubsan=true\"\nfi\n\n# Prepare fuzzer in gn directory\nmkdir -p src/fuzz\ncp $SRC/*.cc src/fuzz/\n\n# Generate ninja file for build\ngn gen out/fuzz --args=\"$ARGS\"\necho $SANITIZER\n# Build binary\nautoninja -C out/fuzz fuzz_sha1\nautoninja -C out/fuzz fuzz_translator\n\n# Copy binary to $OUT\ncp ./out/fuzz/fuzz_sha1 $OUT\ncp ./out/fuzz/fuzz_translator $OUT\n\n# Reset sanitizer\nif [ -n \"$ORIGINAL_SANITIZER\" ]; then\n    export SANITIZER=\"$ORIGINAL_SANITIZER\"\nfi\n"
  },
  {
    "path": "projects/angle/fuzz_sha1.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <cstddef>\n#include <cstdint>\n#include \"anglebase/sha1.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    if (size <= 32 || size > 1024) return 0;\n\n    angle::base::SecureHashAlgorithm sha;\n    sha.Update(data, size);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/angle/fuzzer_profile",
    "content": "declare_args() {\n  complete_static_lib = true\n}\n\nif (angle_has_build) {\n  executable(\"fuzz_sha1\") {\n    sources = [ \"src/fuzz/fuzz_sha1.cc\" ]\n    deps = [\n      \":angle_static\",\n      \":angle_common\",\n    ]\n\n    cflags = [\n      \"-fsanitize=\" + getenv(\"SANITIZER\"),\n      \"-O1\",\n      \"-fno-omit-frame-pointer\",\n      \"-g\",\n      \"-fprofile-instr-generate\",\n      \"-fcoverage-mapping\",\n      \"-resource-dir=/usr/local/lib/clang/22\",\n      \"-fcoverage-prefix-map=../../src/=/src/angle/src/\",\n      \"-fcoverage-prefix-map=../../include/=/src/angle/include/\",\n      \"-fdebug-compilation-dir=/src/angle\",\n    ]\n\n    ldflags = [\n      \"-fsanitize=\" + getenv(\"SANITIZER\"),\n      \"-fprofile-instr-generate\",\n    ]\n\n    if (getenv(\"FUZZING_ENGINE\") == \"centipede\") {\n      cflags += [ \"-fsanitize-coverage=trace-pc-guard,pc-table,inline-8bit-counters,trace-cmp,indirect-calls\" ]\n      ldflags += [ getenv(\"LIB_FUZZING_ENGINE\") ]\n    } else if (getenv(\"FUZZING_ENGINE\") == \"afl\") {\n      cflags += [ \"-fsanitize=fuzzer-no-link\" ]\n      ldflags += [\n        \"/out/afl-compiler-rt-64.o\",\n        getenv(\"LIB_FUZZING_ENGINE\"),\n      ]\n    } else if (getenv(\"FUZZING_ENGINE\") == \"libfuzzer\") {\n      cflags += [ \"-fsanitize=fuzzer-no-link\" ]\n      ldflags += [ getenv(\"LIB_FUZZING_ENGINE_DEPRECATED\") ]\n    } else {\n      cflags += [ \"-fsanitize=fuzzer-no-link\" ]\n      ldflags += [ getenv(\"LIB_FUZZING_ENGINE\") ]\n    }\n\n    configs -= [\"//build/config/compiler:thin_archive\"]\n\n    libs = [\n      \"/usr/local/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.fuzzer.a\",\n    ]\n  }\n\n  executable(\"fuzz_translator\") {\n    sources = [ \"src/compiler/fuzz/translator_fuzzer.cpp\" ]\n\n    include_dirs = [\n      \"include\",\n      \"src\",\n    ]\n\n    deps = [\n      \":translator\",\n    ]\n\n    cflags = [\n      \"-fsanitize=\" + getenv(\"SANITIZER\"),\n      \"-O1\",\n      \"-fno-omit-frame-pointer\",\n      \"-g\",\n      \"-fprofile-instr-generate\",\n      \"-fcoverage-mapping\",\n      \"-fsanitize=fuzzer-no-link\",\n      \"-resource-dir=/usr/local/lib/clang/22\",\n      \"-UANGLE_USE_ABSEIL\",\n      \"-fcoverage-prefix-map=../../src/=/src/angle/src/\",\n      \"-fcoverage-prefix-map=../../include/=/src/angle/include/\",\n      \"-fdebug-compilation-dir=/src/angle\",\n    ]\n\n    ldflags = [\n      \"-fsanitize=\" + getenv(\"SANITIZER\"),\n      \"-fprofile-instr-generate\",\n    ]\n\n    configs -= [\"//build/config/compiler:thin_archive\"]\n\n    libs = [\n      \"/usr/local/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.fuzzer.a\",\n    ]\n  }\n}\n"
  },
  {
    "path": "projects/angle/project.yaml",
    "content": "homepage: \"https://chromium.googlesource.com/angle/angle\"\nlanguage: c++\nprimary_contact: \"arthur.chan@adalogics.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\nmain_repo: 'https://chromium.googlesource.com/angle/angle'\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/angular/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/angular/angular.git\n\nCOPY compiler $SRC/angular/compiler\n\nCOPY babel.config.json $SRC/angular\n\nWORKDIR $SRC/angular\n"
  },
  {
    "path": "projects/angular/babel.config.json",
    "content": "{\n    \"plugins\": [\"@babel/plugin-transform-modules-commonjs\"],\n    \"ignore\": [\"**/@jazzer.js\", \"**/@babel\", \"**/istanbul-reports\"]\n}\n"
  },
  {
    "path": "projects/angular/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfunction change_type_to_commonjs() {\n  # Find all package.json files inside the node_modules directory\n  find \"$1\" -name \"package.json\" -type f | while read -r package_file; do\n    # Check if the file contains the \"type\" field\n    if grep -q '\"type\": \"module\"' \"$package_file\"; then\n      # Replace \"type\": \"module\" with \"type\": \"commonjs\"\n      sed -i 's/\"type\": \"module\"/\"type\": \"commonjs\"/' \"$package_file\"\n      echo \"Updated $package_file\"\n    fi\n  done\n}\n\nfunction transform_dir_into_commonjs() {\n  babel \"$1\" --keep-file-extension -D -d \"$1\"_commonjs\n  rm -r \"$1\"\n  mv \"$1\"_commonjs \"$1\"\n}\n\nfunction remove_dev_dependencies() {\n  package_json=$(cat package.json)\n\n  # Remove the \"devDependencies\" item from package.json\n  new_package_json=$(echo \"$package_json\" | jq 'del(.devDependencies)')\n\n  # Overwrite the package.json file with the updated content\n  echo \"$new_package_json\" > package.json\n\n}\n\nfunction copy_bazel_build_into_build_dir() {\n  local package=$1\n  local source_dir=$SRC/angular/dist/bin/packages/$package\n  local destination_dir=$2\n  local extensions=(\"mjs\" \"d.ts\")  # Add the extensions you want to copy here\n  mkdir -p \"$destination_dir\"\n  cp \"$SRC\"/angular/babel.config.json \"$destination_dir\"\n\n  # Copy files recursively from source directory to destination directory\n  find \"$source_dir\" -type f -name \"*.${extensions[0]}\" -o -name \"*.${extensions[1]}\" |\n  while read -r file; do\n    # Get the relative path of the file (relative to the source directory)\n    relative_path=\"${file#$source_dir}\"\n\n    # Remove leading slash if present\n    relative_path=\"${relative_path#/}\"\n\n    # Create the directory structure inside the destination directory\n    mkdir -p \"$destination_dir/$(dirname \"$relative_path\")\"\n\n    # Copy the file to the destination directory\n    cp \"$file\" \"$destination_dir/$relative_path\"\n  done\n}\n\nfunction rename_mjs_files() {\n  local destination_dir=$1\n  find \"$destination_dir\" -type f -name \"*.mjs\" |\n  while read -r file; do\n    filename=\"${file##*/}\"\n    extension=\"${filename##*.}\"\n\n    # Check if the file has the \"mjs\" extension\n    if [ \"$extension\" = \"mjs\" ]; then\n      new_filename=\"${file%.mjs}.js\"\n      mv \"$file\" \"$new_filename\"\n    fi\n  done\n}\n\n\nfunction build_package() {\n  local package=$1\n  local package_build_dir=$SRC/$package-build\n\n  yarn bazel build packages/\"$package\"\n  copy_bazel_build_into_build_dir \"$package\" \"$package_build_dir\"\n\n  rename_mjs_files \"$package_build_dir\"\n  chmod +w \"$package_build_dir\"\n\n  mkdir -p \"$package_build_dir\"\n  cp \"$SRC\"/angular/packages/\"$package\"/package.json \"$package_build_dir\"\n\n  pushd \"$package_build_dir\"\n\n  remove_dev_dependencies\n  npm install\n\n  npm install --save-dev @babel/core @babel/plugin-transform-modules-commonjs\n  npm install --save-dev @jazzer.js/core\n\n  transform_dir_into_commonjs \"$package_build_dir\"\n\n  change_type_to_commonjs \"$package_build_dir\"\n  popd\n\n  mkdir -p \"$SRC\"/angular/\"$package\"\n  cp \"$package_build_dir\"/* \"$SRC\"/angular/\"$package\"/ -r\n  rm \"$package_build_dir\" -r\n\n}\n\nnpm install --global yarn patch-package husky @babel/cli\nyarn install\n\nmkdir \"$OUT\"/angular\n\nbuild_package compiler\n\n# Build Fuzzers.\ncompile_javascript_fuzzer angular/compiler fuzz_tests/fuzz_parse_template --sync\ncompile_javascript_fuzzer angular/compiler fuzz_tests/fuzz_parser --sync\n\n"
  },
  {
    "path": "projects/angular/compiler/fuzz_tests/fuzz_parse_template.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst { parseTemplate } = require('../src/render3/view/template');\n\nmodule.exports.fuzz = function(data) {\n    const provider = new FuzzedDataProvider(data);\n\n    const templateContent = provider.consumeRemainingAsString();\n\n    try {\n        parseTemplate(templateContent);\n    } catch (error) {\n    }\n};\n"
  },
  {
    "path": "projects/angular/compiler/fuzz_tests/fuzz_parser.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst { Lexer } = require('../src/expression_parser/lexer');\nconst { Parser } = require('../src/expression_parser/parser');\n\nfunction createParser() {\n    return new Parser(new Lexer())\n}\nfunction parseAction(text, location = null, offset = 0) {\n    return createParser().parseAction(text, /* isAssignmentEvent */ false, location, offset);\n}\n\nfunction parseBinding(text, location = null, offset = 0) {\n    return createParser().parseBinding(text, location, offset);\n}\n\nfunction parseInterpolation(text, location = null, offset = 0) {\n    return createParser().parseInterpolation(text, location, offset, null);\n}\n\nfunction splitInterpolation(text, location = null) {\n    return createParser().splitInterpolation(text, location, null);\n}\n\nfunction parseSimpleBinding(text, location = null, offset = 0) {\n    return createParser().parseSimpleBinding(text, location, offset);\n}\n\nconst parsingTasks = [\n    parseAction,\n    parseBinding,\n    parseInterpolation,\n    parseSimpleBinding,\n    splitInterpolation\n]\n\nmodule.exports.fuzz = function(data) {\n    const provider = new FuzzedDataProvider(data);\n\n    const action = provider.consumeIntegralInRange(0, parsingTasks.length);\n    const text = provider.consumeRemainingAsString();\n    try {\n        parsingTasks[action](text);\n    } catch (error) {\n    }\n};\n"
  },
  {
    "path": "projects/angular/project.yaml",
    "content": "homepage: https://angular.io/\nlanguage: javascript\nmain_repo: https://github.com/angular/angular.git\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n- \"yakdan@code-intelligence.com\"\n- \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/angus-mail/ASCIIUtilityFuzzer.java",
    "content": "\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.lang.NumberFormatException;\n\nimport org.eclipse.angus.mail.util.ASCIIUtility;\n\npublic class ASCIIUtilityFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    byte[] input = data.consumeRemainingAsBytes();\n    try{\n      ASCIIUtility.parseInt(input, 0, input.length);\n      ASCIIUtility.parseLong(input, 0, input.length);\n    }\n    catch(NumberFormatException e){}\n\n    ASCIIUtility.toString(input);\n  }\n}\n"
  },
  {
    "path": "projects/angus-mail/BASE64EncoderStreamFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.lang.NumberFormatException;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\n\nimport org.eclipse.angus.mail.util.BASE64EncoderStream;\nimport org.eclipse.angus.mail.util.ASCIIUtility;\n\npublic class BASE64EncoderStreamFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    ByteArrayOutputStream baos = new ByteArrayOutputStream();\n    BASE64EncoderStream b64es = new BASE64EncoderStream(baos, Integer.MAX_VALUE);\n    try{\n      b64es.write(data.consumeRemainingAsBytes());\n    }\n    catch(IOException e){\n      return;\n    }\n    \n  }\n}\n"
  },
  {
    "path": "projects/angus-mail/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.6/bin/mvn\n\nRUN git clone --depth 1 https://github.com/eclipse-ee4j/angus-mail.git angus-mail\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/angus-mail\n"
  },
  {
    "path": "projects/angus-mail/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"core/target/angus-core-$CURRENT_VERSION.jar\" $OUT/angus-core.jar\n\nALL_JARS=\"angus-core.jar jakarta.mail-1.0.1-SNAPSHOT.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_includes=com.sun.mail.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/angus-mail/project.yaml",
    "content": "homepage: \"https://eclipse-ee4j.github.io/mail\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/eclipse-ee4j/angus-mail.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/anise/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth 1 --branch master https://github.com/nyx-space/anise anise\nRUN apt-get update && apt-get install -y tcsh libc++-dev libc++abi-dev && \\\n    apt-get clean && rm -rf /var/lib/apt/lists/* && \\\n    cd anise && ./dev-env-setup.sh\nENV RUSTUP_TOOLCHAIN=nightly-2025-07-03\nENV RUSTFLAGS=\"-C link-arg=-lc++\"\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/anise/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/anise/anise\ncargo fuzz build -O\n\nFUZZ_TARGET_OUTPUT_DIR=$SRC/anise/target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp \"$FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME\" \"$OUT/\"\ndone\n"
  },
  {
    "path": "projects/anise/project.yaml",
    "content": "homepage: \"https://docs.rs/anise/latest/anise/index.html\"\nlanguage: rust\nprimary_contact: \"christopher.rabotin@gmail.com\"\nmain_repo: \"https://github.com/nyx-space/anise.git\"\nfile_github_issue: true\nhelp_url: \"https://github.com/nyx-space/anise/blob/master/anise/fuzz/README.md\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/aniso8601/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://codeberg.org/nielsenb-jf/aniso8601 aniso8601\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/aniso8601\n"
  },
  {
    "path": "projects/aniso8601/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/aniso8601/fuzz_aniso8601.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport aniso8601\nfrom aniso8601.date import parse_date\nfrom aniso8601.decimalfraction import normalize\nfrom aniso8601.duration import parse_duration\nfrom aniso8601.interval import parse_interval\nfrom aniso8601.timezone import parse_timezone\n\n\ndef fuzz_date(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    parse_date(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (aniso8601.exceptions.ISOFormatError,\n          aniso8601.exceptions.RangeCheckError):\n    pass\n  except NotImplementedError:\n    # https://bitbucket.org/nielsenb/aniso8601/src/8819c46cb9548298da5b59b830782c1cc37ba295/aniso8601/date.py#lines-77\n    pass\n\n\ndef fuzz_decimal_fraction(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  normalize(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n\n\ndef fuzz_duration(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    parse_duration(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (aniso8601.exceptions.ISOFormatError,\n          aniso8601.exceptions.RangeCheckError):\n    pass\n  except NotImplementedError:\n    # https://bitbucket.org/nielsenb/aniso8601/src/8819c46cb9548298da5b59b830782c1cc37ba295/aniso8601/date.py#lines-77\n    pass\n\n\ndef fuzz_interval(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    parse_interval(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (aniso8601.exceptions.ISOFormatError,\n          aniso8601.exceptions.RangeCheckError):\n    pass\n  except NotImplementedError:\n    # https://bitbucket.org/nielsenb/aniso8601/src/8819c46cb9548298da5b59b830782c1cc37ba295/aniso8601/date.py#lines-77\n    pass\n\n\ndef fuzz_time(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    parse_timezone(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (aniso8601.exceptions.ISOFormatError,\n          aniso8601.exceptions.RangeCheckError):\n    pass\n  except NotImplementedError:\n    # https://bitbucket.org/nielsenb/aniso8601/src/8819c46cb9548298da5b59b830782c1cc37ba295/aniso8601/date.py#lines-77\n    pass\n\n\ndef TestOneInput(data):\n  fuzz_date(data)\n  fuzz_decimal_fraction(data)\n  fuzz_duration(data)\n  fuzz_interval(data)\n  fuzz_time(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/aniso8601/project.yaml",
    "content": "homepage: https://bitbucket.org/nielsenb/aniso8601\nmain_repo: https://bitbucket.org/nielsenb/aniso8601\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ansible/Dockerfile",
    "content": "# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y make autoconf automake build-essential\nRUN pip3 install --upgrade pip\n\nRUN git clone https://github.com/ansible/ansible\nRUN pip3 install --upgrade pip && \\\n    pip3 install cython cryptography\n\nRUN cd ansible && \\\n    pip3 install -r ./requirements.txt\n\nWORKDIR ansible\n\nCOPY build.sh fuzz_encrypt.sh *.py $SRC/\n"
  },
  {
    "path": "projects/ansible/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 ./setup.py install\n\ncd $SRC\n\n# Build parse and task fuzzers\ncompile_python_fuzzer fuzz_parse.py --add-data ansible/lib/ansible/config:ansible/config\ncompile_python_fuzzer fuzz_task.py --add-data ansible/lib/ansible/config:ansible/config\n\n# Build fuzz_encrypt with a specific wrapper only in non-coverage\nif [ \"$SANITIZER\" != \"coverage\" ]; then\n  compile_python_fuzzer fuzz_encrypt.py --add-data ansible/lib/ansible/config:ansible/config\n  cp $SRC/fuzz_encrypt.sh $OUT/fuzz_encrypt\n  chmod +x $OUT/fuzz_encrypt\nfi\n\ncp /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0 $OUT/libcrypt.so\n"
  },
  {
    "path": "projects/ansible/fuzz_encrypt.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n    import crypt\n    from ansible.plugins.filter.core import get_encrypted_password\n    from ansible.utils import encrypt\n    from ansible import errors\n\n\n@atheris.instrument_func\ndef TestInput(input_bytes):\n    if len(input_bytes) < 50:\n        return\n\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n    try:\n        for h in [ \"md5\", \"sha512\", \"pbkdf2_sha256\", \"crypt16\" ]:\n            get_encrypted_password(\n                fdp.ConsumeString(20),\n                h,\n                salt=fdp.ConsumeString(20)\n            )\n    except errors.AnsibleFilterError as e:\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/ansible/fuzz_encrypt.sh",
    "content": "#!/bin/sh\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=$(dirname \"$0\")\nchmod +x $this_dir/fuzz_encrypt.pkg\nLD_PRELOAD=\"$this_dir/sanitizer_with_fuzzer.so $this_dir/libcrypt.so\" ASAN_OPTIONS=$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=$this_dir/llvm-symbolizer:detect_leaks=0 $this_dir/fuzz_encrypt.pkg $@\n"
  },
  {
    "path": "projects/ansible/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests lib/ansible/parsing/\"\"\"\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from ansible.errors import AnsibleError, AnsibleParserError\n    from ansible.parsing import splitter\n    from ansible.parsing import quoting\n\n\n@atheris.instrument_func\ndef TestInput(input_bytes):\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n\n    try:\n        # Test splitter module\n        args = splitter.split_args(fdp.ConsumeString(50))\n        splitter.join_args(args)\n\n        # Test quoting module\n        quoting.is_quoted(fdp.ConsumeString(10))\n        quoting.unquote(fdp.ConsumeString(10))\n    except (AnsibleError, AnsibleParserError) as e:\n        pass\n\n\ndef main():\n   atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n   atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n   main()\n"
  },
  {
    "path": "projects/ansible/fuzz_task.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Tests ansible.playbook.task\"\"\"\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from ansible.errors import (\n        AnsibleError,\n        AnsibleParserError,\n        AnsibleUndefinedVariable\n    )\n    from ansible.playbook.task import Task\n\n@atheris.instrument_func\ndef TestInput(input_bytes):\n    if len(input_bytes) < 5:\n        return\n\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n\n    try:\n        task = Task.load(\n            {\n                'name': fdp.ConsumeString(10),\n                'shell': fdp.ConsumeString(10),\n                'action': fdp.ConsumeString(10),\n                'debug': fdp.ConsumeString(10)\n            }\n        )\n\n        task.get_vars()\n        task.get_include_params()\n        task.copy()\n        data = task.serialize()\n        task.deserialize(data)\n    except (\n        AnsibleError,\n        AnsibleParserError,\n        AnsibleUndefinedVariable\n    ) as e:\n        pass\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/ansible/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/ansible/ansible\nlanguage: python\nmain_repo: https://github.com/ansible/ansible\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/antlr3-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/antlr/antlr3.git antlr3\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/antlr3\n"
  },
  {
    "path": "projects/antlr3-java/GrammarFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.antlr.runtime.RecognitionException;\nimport org.antlr.tool.Grammar;\n\npublic class GrammarFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      new Grammar(data.consumeString(1000));\n    }\n    catch (RecognitionException | UnsupportedOperationException e){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/antlr3-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport MAVEN_OPTS=\"-Xmx1G\"\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"tool/target/antlr-$CURRENT_VERSION.jar\" $OUT/antlr3.jar\nALL_JARS=\"antlr3.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/antlr3-java/project.yaml",
    "content": "homepage: \"https://www.antlr.org\"\nlanguage: jvm\nmain_repo: \"https://github.com/antlr/antlr3.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n- david@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/antlr4-java/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/antlr/antlr4.git antlr4\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/antlr4\n"
  },
  {
    "path": "projects/antlr4-java/GrammarFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.antlr.v4.runtime.CharStreams;\nimport org.antlr.v4.runtime.CommonTokenStream;\nimport org.antlr.v4.runtime.LexerInterpreter;\nimport org.antlr.v4.runtime.ParserInterpreter;\nimport org.antlr.v4.runtime.RecognitionException;\nimport org.antlr.v4.tool.LexerGrammar;\nimport org.antlr.v4.tool.Grammar;\n\npublic class GrammarFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n    LexerGrammar lg;\n    Grammar g;\n    try{   \n      lg = new LexerGrammar(data.consumeString(1000));\n      g = new Grammar(data.consumeString(1000));\n    }\n    catch (org.antlr.runtime.RecognitionException | UnsupportedOperationException e){\n      return;\n    }\n\n    LexerInterpreter lexEngine = lg.createLexerInterpreter(CharStreams.fromString(data.consumeRemainingAsString()));\n    CommonTokenStream tokens = new CommonTokenStream(lexEngine);\n    ParserInterpreter parser = g.createParserInterpreter(tokens);\n  }\n}\n"
  },
  {
    "path": "projects/antlr4-java/build.sh",
    "content": "\n#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport MAVEN_OPTS=\"-Xmx1G\"\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"tool/target/antlr4-$CURRENT_VERSION.jar\" $OUT/antlr4.jar\n\nALL_JARS=\"antlr4.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/antlr4-java/project.yaml",
    "content": "homepage: \"https://www.antlr.org\"\nlanguage: jvm\nmain_repo: \"https://github.com/antlr/antlr4.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"terrence.parr@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-axis2/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME axis-axis2-java-core\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/apache/axis-axis2-java-core.git ${LIBRARY_NAME}\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}\n"
  },
  {
    "path": "projects/apache-axis2/axis-axis2-java-core-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>axis-axis2-java-core-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>1.8.2</fuzzedLibaryVersion>\n\t\t<exec.mainClass>ossfuzz.HttpInterfaceFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.axis2</groupId>\n\t\t\t<artifactId>axis2-adb</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.axis2</groupId>\n\t\t\t<artifactId>axis2-kernel</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.axis2</groupId>\n\t\t\t<artifactId>axis2-jaxws</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.axis2</groupId>\n    \t\t<artifactId>axis2-transport-http</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.axis2</groupId>\n    \t\t<artifactId>axis2-transport-local</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n            <groupId>org.apache.httpcomponents</groupId>\n            <artifactId>httpclient</artifactId>\n            <version>4.5.13</version>\n        </dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/apache-axis2/axis-axis2-java-core-fuzzer/src/main/java/org/apache/axis2/HttpInterfaceFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage org.apache.axis2;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.DataOutputStream;\nimport java.io.IOException;\nimport java.net.*;\nimport org.apache.http.client.utils.URIBuilder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\nimport org.apache.axis2.kernel.SimpleAxis2Server;\n\npublic class HttpInterfaceFuzzer extends SimpleAxis2Server {\n\n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public HttpInterfaceFuzzer(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        super(null, null);\n        this.fuzzedDataProvider = fuzzedDataProvider;\n\n        deployService(\"samples.quickstart.service.pojo.StockQuoteService\");\n    }\n\n    void test() {\n        // Begin cleanup\n        try {\n            stop();\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        \n        try {\n            start();\n\n            var client = HttpClient.newHttpClient();\n            String host = \"localhost\";\n            int port = getPort(); // Get the dynamically assigned port\n            URI uri = new URI(\"http://\" + host + \":\" + port + \"/axis2/services/StockQuoteService/\" + fuzzedDataProvider.consumeRemainingAsString());\n            var request = HttpRequest.newBuilder(uri)\n                        .GET()\n                        .build();\n            var reponse = client.send(request, HttpResponse.BodyHandlers.ofString());\n        } catch (Exception e) {\n            e.printStackTrace();\n        } finally {\n            try {\n                stop();\n            } catch (Exception ex) {\n                ex.printStackTrace();\n            }\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        HttpInterfaceFuzzer fixture = new HttpInterfaceFuzzer(fuzzedDataProvider);\n        fixture.test();\n\n        fixture = null;\n        Thread.sleep(100); // Ensure closed state ready for next instance\n    }\n\n    private int getPort() {\n        try (ServerSocket socket = new ServerSocket(0)) {\n            return socket.getLocalPort();\n        } catch (IOException e) {\n            e.printStackTrace();\n            return 6060; // Backup in failure of auto assign\n        }\n    }\n}"
  },
  {
    "path": "projects/apache-axis2/axis-axis2-java-core-fuzzer/src/main/java/samples/quickstart/service/pojo/StockQuoteService.java",
    "content": "/*\n * from https://github.com/apache/axis-axis2-java-core/blob/d8237fd1058354874a3e4c2f07da780a27bcf3ff/modules/samples/quickstart/src/samples/quickstart/service/pojo/StockQuoteService.java\n */\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage samples.quickstart.service.pojo;\n\nimport java.util.HashMap;\n\npublic class StockQuoteService {\n    private HashMap map = new HashMap();\n\n    void printMap(HashMap map) {\n        for (Object name: map.keySet()) {\n            String key = name.toString();\n            String value = map.get(name).toString();\n            System.out.println(key + \"=\" + value);\n        }\n    }\n\n    public double getPrice(String symbol) {\n        Double price = (Double) map.get(symbol);\n        if(price != null){\n            return price.doubleValue();\n        }\n        return 42.00;\n    }\n\n    public void update(String symbol, double price) {\n        map.put(symbol, new Double(price));\n    }\n}\n"
  },
  {
    "path": "projects/apache-axis2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-DskipTests\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}\"\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/apache-axis2/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/apache-axis2/project.yaml",
    "content": "homepage: \"https://axis.apache.org/axis2/java/core/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/axis-axis2-java-core.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-bcel/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/apache/commons-bcel.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/commons-bcel"
  },
  {
    "path": "projects/apache-commons-bcel/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/commons-bcel\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -DbcelVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/bcel-fuzzer-${CURRENT_VERSION}.jar ${OUT}/bcel-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} bcel-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\tstripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\techo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/apache-commons-bcel/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>bcel-fuzzer</artifactId>\n\t<version>${bcelVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<exec.mainClass>ossfuzz.BcelFuzzer</exec.mainClass>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.bcel</groupId>\n\t\t\t<artifactId>bcel</artifactId>\n\t\t\t<version>${bcelVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/apache-commons-bcel/project.yaml",
    "content": "homepage: \"https://commons.apache.org/proper/commons-bcel/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/commons-bcel.git\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-bcel/remove-rat.diff",
    "content": "--- a/pom.xml\n+++ b/pom.xml\n@@ -361,7 +361,7 @@\n   </dependencies>\n \n   <build>\n-    <defaultGoal>clean apache-rat:check checkstyle:check verify javadoc:javadoc</defaultGoal>\n+    <defaultGoal>clean checkstyle:check verify javadoc:javadoc</defaultGoal>\n     <plugins>\n       <plugin>\n         <groupId>org.apache.felix</groupId>\n"
  },
  {
    "path": "projects/apache-commons-bcel/src/main/java/ossfuzz/BcelFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n \n package ossfuzz;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.bcel.classfile.*;\n\npublic class BcelFuzzer {\n\n\tBcelFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\n\t}\n\n\tvoid test(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\tvar m_string = fuzzedDataProvider.consumeString(10);\n\t\tvar m_byte = fuzzedDataProvider.consumeRemainingAsBytes();\n\t\ttry {\n\t\t\tnew ClassParser(new ByteArrayInputStream(m_byte), m_string).parse();\n\t\t} catch (IOException e) {\n\t\t\t// documented ignore\n\t\t} catch (ClassFormatException e) {\n\t\t\t// documented ignore\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\tBcelFuzzer testClosure = new BcelFuzzer(fuzzedDataProvider);\n\n\t\ttestClosure.test(fuzzedDataProvider);\n\t}\n}"
  },
  {
    "path": "projects/apache-commons-beanutils/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/apache/commons-beanutils.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/commons-beanutils\n"
  },
  {
    "path": "projects/apache-commons-beanutils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-DskipTests\"\nALL_JARS=\"\"\n\n# install the build servers' jazzer-api into the maven repository\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/commons-beanutils\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -DbeanutilsVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/beanutils-fuzzer-${CURRENT_VERSION}.jar ${OUT}/beanutils-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} beanutils-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n  stripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n  # the .java was stripped by sed\n  if (echo ${stripped_path} | grep \".java$\"); then\n\tcontinue;\n  fi\n\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  fuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n  chmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/apache-commons-beanutils/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>beanutils-fuzzer</artifactId>\n\t<version>${beanutilsVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<exec.mainClass>ossfuzz.BeanutilsFuzzer</exec.mainClass>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\ton the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\tto avoid mismatching driver/api versions\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.commons</groupId>\n\t\t\t<artifactId>commons-beanutils2</artifactId>\n\t\t\t<version>${beanutilsVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/apache-commons-beanutils/project.yaml",
    "content": "homepage: \"https://commons.apache.org/proper/commons-beanutils/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/commons-beanutils.git\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-beanutils/src/main/java/ossfuzz/BeanutilsFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n \npackage ossfuzz;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport org.apache.commons.beanutils2.BasicDynaClass;\nimport org.apache.commons.beanutils2.DynaBean;\nimport org.apache.commons.beanutils2.DynaClass;\nimport org.apache.commons.beanutils2.DynaProperty;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\npublic class BeanutilsFuzzer {\n\n\tString m_string;\n\tint m_int;\n\tint m_int_array[];\n\tString m_string_array[];\n\tboolean m_bool;\n\tdouble m_double;\n\tfloat m_float;\n\tshort m_short;\n\tlong m_long;\n\tMap<String, Object> m_map;\n\n\tBeanutilsFuzzer(int integer, String string, int[] intArray, boolean bool, double dbl, float flt,\n\t\t\tMap<String, Object> map,\n\t\t\tString string_array[], short shrt, long lng) {\n\t\tm_int = integer;\n\t\tm_string = string;\n\t\tm_bool = bool;\n\t\tm_int_array = intArray;\n\t\tm_double = dbl;\n\t\tm_float = flt;\n\t\tm_map = map;\n\t\tm_string_array = string_array;\n\t\tm_short = shrt;\n\t\tm_long = lng;\n\t}\n\n\tBeanutilsFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tm_int = fuzzedDataProvider.consumeInt();\n\t\tm_int_array = fuzzedIntArray(fuzzedDataProvider);\n\t\tm_bool = fuzzedDataProvider.consumeBoolean();\n\t\tm_double = fuzzedDataProvider.consumeDouble();\n\t\tm_float = fuzzedDataProvider.consumeFloat();\n\t\tm_map = fuzzedMap(fuzzedDataProvider);\n\t\tm_string_array = fuzzedStringArray(fuzzedDataProvider);\n\t\tm_short = fuzzedDataProvider.consumeShort();\n\t\tm_long = fuzzedDataProvider.consumeLong();\n\n\t\tm_string = fuzzedDataProvider.consumeRemainingAsAsciiString();\n\t}\n\n\tprotected DynaClass createDynaClass() {\n\n\t\tfinal int[] intArray = new int[0];\n\t\tfinal String[] stringArray = new String[0];\n\n\t\tfinal DynaClass dynaClass = new BasicDynaClass(\"TestDynaClass\", null,\n\t\t\t\tnew DynaProperty[] {\n\t\t\t\t\t\tnew DynaProperty(\"booleanProperty\", Boolean.TYPE),\n\t\t\t\t\t\tnew DynaProperty(\"booleanSecond\", Boolean.TYPE),\n\t\t\t\t\t\tnew DynaProperty(\"doubleProperty\", Double.TYPE),\n\t\t\t\t\t\tnew DynaProperty(\"floatProperty\", Float.TYPE),\n\t\t\t\t\t\tnew DynaProperty(\"intArray\", intArray.getClass()),\n\t\t\t\t\t\tnew DynaProperty(\"intProperty\", Integer.TYPE),\n\t\t\t\t\t\tnew DynaProperty(\"longProperty\", Long.TYPE),\n\t\t\t\t\t\tnew DynaProperty(\"mappedProperty\", Map.class),\n\t\t\t\t\t\tnew DynaProperty(\"shortProperty\", Short.TYPE),\n\t\t\t\t\t\tnew DynaProperty(\"stringArray\", stringArray.getClass()),\n\t\t\t\t\t\tnew DynaProperty(\"stringProperty\", String.class),\n\t\t\t\t});\n\t\treturn dynaClass;\n\n\t}\n\n\tint[] fuzzedIntArray(FuzzedDataProvider fuzzedDataProvider) {\n\t\tint n = fuzzedDataProvider.consumeInt(1, 100);\n\t\tint array[] = new int[n];\n\t\tfor (int i = 0; i < n; ++i) {\n\t\t\tarray[i] = fuzzedDataProvider.consumeInt();\n\t\t}\n\t\treturn array;\n\t}\n\n\tString[] fuzzedStringArray(FuzzedDataProvider fuzzedDataProvider) {\n\t\tint n = fuzzedDataProvider.consumeInt(1, 100);\n\t\tString array[] = new String[n];\n\t\tfor (int i = 0; i < n; ++i) {\n\t\t\tarray[i] = fuzzedDataProvider.consumeString(16);\n\t\t}\n\t\treturn array;\n\t}\n\n\tMap<String, Object> fuzzedMap(FuzzedDataProvider fuzzedDataProvider) {\n\t\tint n = fuzzedDataProvider.consumeInt(1, 100);\n\t\tMap<String, Object> map = new HashMap<String, Object>();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tswitch (fuzzedDataProvider.consumeInt(0, 7)) {\n\t\t\t\tcase 0:\n\t\t\t\t\tmap.put(fuzzedDataProvider.consumeString(16), new Integer(fuzzedDataProvider.consumeInt()));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tmap.put(fuzzedDataProvider.consumeString(16), new Float(fuzzedDataProvider.consumeFloat()));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tmap.put(fuzzedDataProvider.consumeString(16), new Double(fuzzedDataProvider.consumeDouble()));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tmap.put(fuzzedDataProvider.consumeString(16), new String(fuzzedDataProvider.consumeString(16)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tmap.put(fuzzedDataProvider.consumeString(16), new Boolean(fuzzedDataProvider.consumeBoolean()));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tmap.put(fuzzedDataProvider.consumeString(16), fuzzedIntArray(fuzzedDataProvider));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tmap.put(fuzzedDataProvider.consumeString(16), fuzzedMap(fuzzedDataProvider));\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\treturn map;\n\t}\n\n\tvoid test() throws Exception {\n\n\t\tfinal DynaClass dynaClass = createDynaClass();\n\t\tDynaBean bean = dynaClass.newInstance();\n\n\t\tbean.set(\"booleanProperty\", new Boolean(m_bool));\n\t\tbean.set(\"booleanSecond\", new Boolean(m_bool));\n\n\t\tif (!bean.get(\"booleanSecond\").equals(new Boolean(m_bool))) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"doubleProperty\", new Double(m_double));\n\t\tif (!bean.get(\"doubleProperty\").equals(new Double(m_double))) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"floatProperty\", new Float(m_float));\n\t\tif (!bean.get(\"floatProperty\").equals(new Float(m_float))) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"intArray\", m_int_array);\n\t\tif (!bean.get(\"intArray\").equals(m_int_array)) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"stringArray\", m_string_array);\n\t\tif (!bean.get(\"stringArray\").equals(m_string_array)) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"mappedProperty\", m_map);\n\t\tif (!bean.get(\"mappedProperty\").equals(m_map)) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"intProperty\", new Integer(m_int));\n\t\tif (!bean.get(\"intProperty\").equals(new Integer(m_int))) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"longProperty\", new Long(m_long));\n\t\tif (!bean.get(\"longProperty\").equals(new Long(m_long))) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\n\t\tbean.set(\"shortProperty\", new Short(m_short));\n\t\tif (!bean.get(\"shortProperty\").equals(new Short(m_short))) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Data corruption detected\");\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\tBeanutilsFuzzer testClosure = new BeanutilsFuzzer(fuzzedDataProvider);\n\n\t\ttestClosure.test();\n\t}\n}"
  },
  {
    "path": "projects/apache-commons-cli/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/apache/commons-cli.git \n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/commons-cli\n"
  },
  {
    "path": "projects/apache-commons-cli/ParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.commons.cli.DefaultParser;\nimport org.apache.commons.cli.Options;\nimport org.apache.commons.cli.ParseException;\n\n\npublic class ParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n    DefaultParser parser = new DefaultParser();\n    parser = DefaultParser.builder().setStripLeadingAndTrailingQuotes(data.consumeBoolean()).setAllowPartialMatching(data.consumeBoolean()).build();\n\n    Options options = new Options();\n    options.addOption(\"a\", \"aa\", true, \"\");\n    options.addOption(\"b\", \"bb\", false, \"\");\n\n    try{\n      parser.parse(options, new String[]{data.consumeString(100), data.consumeRemainingAsString()});\n    }\n    catch (ParseException | StringIndexOutOfBoundsException e){\n      return;\n    } \n\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-cli/build.sh",
    "content": "\n#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/commons-cli-$CURRENT_VERSION.jar\" $OUT/commons-cli.jar\n\nALL_JARS=\"commons-cli.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-cli/project.yaml",
    "content": "homepage: \"https://commons.apache.org/proper/commons-cli/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/commons-cli.git\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-codec/BinaryEncodingFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.commons.codec.binary.Hex;\nimport org.apache.commons.codec.binary.BaseNCodecInputStream;\nimport org.apache.commons.codec.binary.Base64InputStream;\nimport org.apache.commons.codec.binary.Base32InputStream;\nimport org.apache.commons.codec.binary.Base16InputStream;\nimport org.apache.commons.codec.binary.BaseNCodecOutputStream;\nimport org.apache.commons.codec.binary.Base64OutputStream;\nimport org.apache.commons.codec.binary.Base32OutputStream;\nimport org.apache.commons.codec.binary.Base16OutputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.util.Arrays;\n\npublic class BinaryEncodingFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    int selection = data.consumeInt(1,3);\n    BaseNCodecInputStream bis;\n    BaseNCodecOutputStream bos;\n    ByteArrayOutputStream baos;\n    String encodingType;\n    \n    byte[] originalInput = data.consumeRemainingAsBytes();\n    final int SIZE = originalInput.length * 2;\n    byte[] encoded = new byte[SIZE];\n\n    //Base32 encoding requires 5 bytes per unencoded block\n    if(originalInput.length < 5){\n      return;\n    }\n\n    switch(selection){\n      case 1: bis = new Base16InputStream(new ByteArrayInputStream(originalInput), true);\n              baos = new ByteArrayOutputStream(SIZE);\n              bos = new Base16OutputStream(baos, false);\n              encodingType = \"Base16\";\n              break;\n\n      case 2: bis = new Base32InputStream(new ByteArrayInputStream(originalInput), true);\n              baos = new ByteArrayOutputStream(SIZE);\n              bos = new Base32OutputStream(baos, false);\n              encodingType = \"Base32\";\n              break;\n\n      case 3: bis = new Base64InputStream(new ByteArrayInputStream(originalInput), true);\n              baos = new ByteArrayOutputStream(SIZE);\n              bos = new Base64OutputStream(baos, false);\n              encodingType = \"Base64\";\n              break;\n\n      default: return;\n    }\n\n    try {\n      bis.read(encoded);\n    }\n    catch (IOException e){\n      return;\n    }\n    \n    \n    try{\n      bos.write(encoded, 0, SIZE);\n    }\n    catch (IOException e){\n      return;\n    }\n\n    byte[] decoded = baos.toByteArray();\n    \n    if(!Arrays.equals(originalInput, decoded)){\n      throw new IllegalStateException(\"Failed to decode: \" + Hex.encodeHexString(originalInput) + \"\\n\"\n                                    + \"Encoded using: \" + \"<type of encoder>\" + \"\\n\"\n                                    + \"Encoded data: \" + Hex.encodeHexString(encoded) + \"\\n\"\n                                    + \"Decoded data: \" + Hex.encodeHexString(decoded) + \"\\n\");\n    }\n\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/ChecksumFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.zip.Checksum;\nimport org.apache.commons.codec.digest.PureJavaCrc32;\nimport org.apache.commons.codec.digest.PureJavaCrc32C;\nimport org.apache.commons.codec.digest.XXHash32;\n\n/**\n * This fuzzer targets the methods in different Checksum implementation classes in the digest\n * package.\n */\npublic class ChecksumFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Checksum checksum = null;\n\n    // Create objects for different checksum implementation classes\n    switch (data.consumeInt(1, 3)) {\n      case 1:\n        checksum = new XXHash32(data.consumeInt());\n        break;\n      case 2:\n        checksum = new PureJavaCrc32();\n        break;\n      case 3:\n        checksum = new PureJavaCrc32C();\n        break;\n    }\n\n    // Fuzz methods of the Checksum implementation classes\n    if (checksum != null) {\n      byte[] byteArray = data.consumeRemainingAsBytes();\n      checksum.reset();\n      checksum.update(byteArray, 0, byteArray.length);\n      checksum.getValue();\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/CryptFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.codec.digest.Crypt;\n\n/** This fuzzer targets the crypt methods in the Crypt class. */\npublic class CryptFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      if (data.consumeBoolean()) {\n        Crypt.crypt(data.consumeRemainingAsBytes(), null);\n      } else {\n        Crypt.crypt(data.consumeBytes(data.remainingBytes()), data.consumeRemainingAsString());\n      }\n    } catch (IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/DigestUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport org.apache.commons.codec.digest.DigestUtils;\n\n/**\n * This fuzzer targets the static methods in the DigestUtils class for calculating the hex value of\n * using different hashing methods.\n */\npublic class DigestUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 12);\n      ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n\n      switch (choice) {\n        case 1:\n          DigestUtils.md2Hex(bais);\n          break;\n        case 2:\n          DigestUtils.md5Hex(bais);\n          break;\n        case 3:\n          DigestUtils.sha1Hex(bais);\n          break;\n        case 4:\n          DigestUtils.sha256Hex(bais);\n          break;\n        case 5:\n          DigestUtils.sha3_224Hex(bais);\n          break;\n        case 6:\n          DigestUtils.sha3_256Hex(bais);\n          break;\n        case 7:\n          DigestUtils.sha384Hex(bais);\n          break;\n        case 8:\n          DigestUtils.sha512Hex(bais);\n          break;\n        case 9:\n          DigestUtils.sha512_224Hex(bais);\n          break;\n        case 10:\n          DigestUtils.sha512_256Hex(bais);\n          break;\n        case 11:\n          DigestUtils.sha512Hex(bais);\n          break;\n        case 12:\n          DigestUtils.shaHex(bais);\n          break;\n      }\n    } catch (IOException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://gitbox.apache.org/repos/asf/commons-codec.git commons-codec\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/commons-codec\n"
  },
  {
    "path": "projects/apache-commons-codec/HmacUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport java.util.EnumSet;\nimport org.apache.commons.codec.digest.HmacAlgorithms;\nimport org.apache.commons.codec.digest.HmacUtils;\n\n/** This fuzzer targets the hmacHex methods in the HmacUtils class. */\npublic class HmacUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 4);\n\n      // Create HamcUtils object with random algorithm and key bytes\n      HmacUtils utils =\n          new HmacUtils(\n              data.pickValue(EnumSet.allOf(HmacAlgorithms.class)),\n              data.consumeBytes(data.remainingBytes()));\n\n      // Fuzz different hmacHex methods in HmacUtils class\n      switch (choice) {\n        case 1:\n          utils.hmacHex(data.consumeRemainingAsBytes());\n          break;\n        case 2:\n          utils.hmacHex(ByteBuffer.wrap(data.consumeRemainingAsBytes()));\n          break;\n        case 3:\n          utils.hmacHex(data.consumeRemainingAsString());\n          break;\n        case 4:\n          utils.hmacHex(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n          break;\n      }\n    } catch (IOException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/LanguageStringEncoderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.codec.EncoderException;\nimport org.apache.commons.codec.StringEncoder;\nimport org.apache.commons.codec.language.Caverphone1;\nimport org.apache.commons.codec.language.Caverphone2;\nimport org.apache.commons.codec.language.ColognePhonetic;\nimport org.apache.commons.codec.language.DaitchMokotoffSoundex;\nimport org.apache.commons.codec.language.DoubleMetaphone;\nimport org.apache.commons.codec.language.MatchRatingApproachEncoder;\nimport org.apache.commons.codec.language.Metaphone;\nimport org.apache.commons.codec.language.Nysiis;\nimport org.apache.commons.codec.language.RefinedSoundex;\nimport org.apache.commons.codec.language.Soundex;\nimport org.apache.commons.codec.language.bm.BeiderMorseEncoder;\n\n/**\n * This fuzzer targets the encode method in different StringEncoder implementation classes in the\n * language or language.bm package.\n */\npublic class LanguageStringEncoderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Create objects of different StringEncoder implementation classes\n      StringEncoder strEncoder = null;\n\n      switch (data.consumeInt(1, 11)) {\n        case 1:\n          strEncoder = new Caverphone1();\n          break;\n        case 2:\n          strEncoder = new Caverphone2();\n          break;\n        case 3:\n          strEncoder = new ColognePhonetic();\n          break;\n        case 4:\n          strEncoder = new DaitchMokotoffSoundex(data.consumeBoolean());\n          break;\n        case 5:\n          strEncoder = new DoubleMetaphone();\n          break;\n        case 6:\n          strEncoder = new MatchRatingApproachEncoder();\n          break;\n        case 7:\n          strEncoder = new Metaphone();\n          break;\n        case 8:\n          strEncoder = new Nysiis(data.consumeBoolean());\n          break;\n        case 9:\n          strEncoder = new RefinedSoundex(data.consumeString(data.remainingBytes()));\n          break;\n        case 10:\n          strEncoder =\n              new Soundex(data.consumeString(data.remainingBytes()), data.consumeBoolean());\n          break;\n        case 11:\n          strEncoder = new BeiderMorseEncoder();\n          break;\n      }\n\n      // Fuzz encode method of the StringEncoder object\n      if (strEncoder != null) {\n        strEncoder.encode(data.consumeRemainingAsString());\n      }\n    } catch (EncoderException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/MurmurHashFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.nio.BufferUnderflowException;\nimport java.nio.ByteBuffer;\nimport org.apache.commons.codec.digest.MurmurHash2;\nimport org.apache.commons.codec.digest.MurmurHash3;\n\n/**\n * This fuzzer argets different hashing methods in the MurmurHash2 and MurmurHash3 classes of the\n * digest package.\n */\npublic class MurmurHashFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 12);\n      Integer seed = data.consumeInt();\n      byte[] byteArray = data.consumeRemainingAsBytes();\n\n      switch (choice) {\n        case 1:\n          MurmurHash2.hash32(byteArray, byteArray.length, seed);\n          break;\n        case 2:\n          MurmurHash2.hash64(byteArray, byteArray.length, seed);\n          break;\n        case 3:\n          MurmurHash3.hash32x86(byteArray, 0, byteArray.length, seed);\n          break;\n        case 4:\n          MurmurHash3.hash32(ByteBuffer.wrap(byteArray).getLong(), seed);\n          break;\n        case 5:\n          MurmurHash3.hash128x64(byteArray, 0, byteArray.length, seed);\n          break;\n        case 6:\n          MurmurHash3.hash128(byteArray);\n          break;\n      }\n    } catch (BufferUnderflowException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/NetCodecFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.codec.BinaryDecoder;\nimport org.apache.commons.codec.BinaryEncoder;\nimport org.apache.commons.codec.DecoderException;\nimport org.apache.commons.codec.EncoderException;\nimport org.apache.commons.codec.StringDecoder;\nimport org.apache.commons.codec.StringEncoder;\nimport org.apache.commons.codec.net.BCodec;\nimport org.apache.commons.codec.net.PercentCodec;\nimport org.apache.commons.codec.net.QCodec;\nimport org.apache.commons.codec.net.QuotedPrintableCodec;\nimport org.apache.commons.codec.net.URLCodec;\n\n/**\n * This fuzzer targets the encode method in different BinaryEncoder and StringEncoder implementation\n * classes and the decode method in different BinaryDecoder and StringDecoder implementation classes\n * of the net package.\n */\npublic class NetCodecFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Create objects for fuzzing the encode and decode methods\n      BinaryEncoder binEncoder = null;\n      BinaryDecoder binDecoder = null;\n      StringEncoder strEncoder = null;\n      StringDecoder strDecoder = null;\n\n      switch (data.consumeInt(1, 5)) {\n        case 1:\n          BCodec bCodec = new BCodec();\n          strEncoder = bCodec;\n          strDecoder = bCodec;\n          break;\n        case 2:\n          PercentCodec pCodec =\n              new PercentCodec(data.consumeBytes(data.remainingBytes()), data.consumeBoolean());\n          binEncoder = pCodec;\n          binDecoder = pCodec;\n          break;\n        case 3:\n          QCodec qCodec = new QCodec();\n          strEncoder = qCodec;\n          strDecoder = qCodec;\n          break;\n        case 4:\n          QuotedPrintableCodec qPCodec = new QuotedPrintableCodec(data.consumeBoolean());\n          binEncoder = qPCodec;\n          binDecoder = qPCodec;\n          strEncoder = qPCodec;\n          strDecoder = qPCodec;\n          break;\n        case 5:\n          URLCodec uCodec = new URLCodec();\n          binEncoder = uCodec;\n          binDecoder = uCodec;\n          strEncoder = uCodec;\n          strDecoder = uCodec;\n          break;\n      }\n\n      // Fuzz encode and decode methods\n      if (binEncoder != null) {\n        binEncoder.encode(data.consumeRemainingAsBytes());\n      }\n      if (binDecoder != null) {\n        binDecoder.decode(data.consumeRemainingAsBytes());\n      }\n      if (strEncoder != null) {\n        strEncoder.encode(data.consumeRemainingAsString());\n      }\n      if (strDecoder != null) {\n        strDecoder.decode(data.consumeRemainingAsString());\n      }\n    } catch (EncoderException | DecoderException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/PhoneticEngineFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.EnumSet;\nimport org.apache.commons.codec.language.bm.NameType;\nimport org.apache.commons.codec.language.bm.PhoneticEngine;\nimport org.apache.commons.codec.language.bm.RuleType;\n\n/** This fuzzer targets the encode method in the PhoneticEngine class of the bm package. */\npublic class PhoneticEngineFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      PhoneticEngine engine =\n          new PhoneticEngine(\n              data.pickValue(EnumSet.allOf(NameType.class)),\n              data.pickValue(EnumSet.allOf(RuleType.class)),\n              data.consumeBoolean(),\n              data.consumeInt());\n      engine.encode(data.consumeRemainingAsString());\n    } catch (IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-codec/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/commons-codec-$CURRENT_VERSION.jar\" $OUT/commons-codec.jar\n\nALL_JARS=\"commons-codec.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-codec/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://commons.apache.org/proper/commons-codec/\nlanguage: jvm\nmain_repo: https://gitbox.apache.org/repos/asf/commons-codec.git\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nsanitizers:\n- address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/apache-commons-collections/CollectionsBidiMapFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.collections4.BidiMap;\nimport org.apache.commons.collections4.bidimap.TreeBidiMap;\n\npublic class CollectionsBidiMapFuzzer {\n\n    void runTest(FuzzedDataProvider data) {\n        // Initialize the BidiMap inside the method for each test run\n        BidiMap<String, String> m_bidiMap = new TreeBidiMap<>();\n\t    \n        switch(data.consumeInt(1, 5)) {\n            case 1:\n                String key = data.consumeString(data.consumeInt(5, 15));\n                String value = data.consumeString(data.consumeInt(5, 15));\n                try {\n                    m_bidiMap.put(key, value);\n                } catch (IllegalArgumentException ex) {\n                    \n                }\n                break;\n\n            case 2:\n                String getKey = data.consumeString(data.consumeInt(5, 15));\n                m_bidiMap.get(getKey);\n                break;\n\n            case 3:\n                String getValue = data.consumeString(data.consumeInt(5, 15));\n                m_bidiMap.getKey(getValue);\n                break;\n\n            case 4:\n                String removeValue = data.consumeString(data.consumeInt(5, 15));\n                try {\n                    m_bidiMap.removeValue(removeValue);\n                } catch (UnsupportedOperationException ex) {\n                    \n                }\n                break;\n\n            case 5:\n                m_bidiMap.inverseBidiMap();\n                break;\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        CollectionsBidiMapFuzzer testClosure = new CollectionsBidiMapFuzzer();\n        testClosure.runTest(data);\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-collections/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone https://github.com/apache/commons-collections\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/commons-collections"
  },
  {
    "path": "projects/apache-commons-collections/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests -Drat.ignoreErrors=true\"\n\nALL_JARS=\"\"\n\npushd \"${SRC}/commons-collections\"\n\t$MVN package $MAVEN_ARGS\n\tCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n\t\t-Dexpression=project.version -q -DforceStdout)\n\tcp -v target/commons-collections4-${CURRENT_VERSION}.jar \"$OUT/commons-collections4.jar\"\n\tALL_JARS=\"${ALL_JARS} commons-collections4.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-collections/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://commons.apache.org/proper/commons-collections/\nlanguage: jvm\nmain_repo: https://github.com/apache/commons-collections.git\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nsanitizers:\n- address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-compress/ArchiverArFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.ar.ArArchiveInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class ArchiverArFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzArchiveInputStream(new ArArchiveInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/ArchiverArjFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.arj.ArjArchiveInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class ArchiverArjFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzArchiveInputStream(new ArjArchiveInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/ArchiverCpioFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class ArchiverCpioFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzArchiveInputStream(new CpioArchiveInputStream(new ByteArrayInputStream(data)));\n        } catch (IllegalArgumentException | IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/ArchiverDumpFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.dump.DumpArchiveInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class ArchiverDumpFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzArchiveInputStream(new DumpArchiveInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/ArchiverTarStreamFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.tar.TarArchiveInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class ArchiverTarStreamFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzArchiveInputStream(new TarArchiveInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/ArchiverZipStreamFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class ArchiverZipStreamFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzArchiveInputStream(new ZipArchiveInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/BaseTests.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.ArchiveEntry;\nimport org.apache.commons.compress.archivers.ArchiveInputStream;\nimport org.apache.commons.compress.compressors.CompressorInputStream;\n\nimport java.io.IOException;\nimport java.util.logging.LogManager;\n\n// Class with common functionality shared among fuzzing harnesses\npublic class BaseTests {\n    public static void fuzzerInitialize() {\n        LogManager.getLogManager().reset();\n    }\n\n    // Fuzz archiver streams by reading every entry\n    public static void fuzzArchiveInputStream(ArchiveInputStream is) throws IOException {\n        ArchiveEntry entry;\n        while ((entry = is.getNextEntry()) != null) {\n            is.read(new byte[1024]);\n        }\n        is.close();\n    }\n\n    // Fuzz compressor streams by reading them\n    public static void fuzzCompressorInputStream(CompressorInputStream is) throws IOException {\n        is.read(new byte[1024]);\n        is.close();\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressSevenZFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry;\nimport org.apache.commons.compress.archivers.sevenz.SevenZFile;\nimport org.apache.commons.compress.archivers.sevenz.SevenZFileOptions;\nimport org.apache.commons.compress.utils.SeekableInMemoryByteChannel;\n\nimport java.io.InputStream;\nimport java.io.IOException;\n\n// Keeping class name the same so corpus doesn't change\n// See: https://google.github.io/oss-fuzz/faq/#what-happens-when-i-rename-a-fuzz-target-\npublic class CompressSevenZFuzzer extends BaseTests {\n    private static final SevenZFileOptions options = new SevenZFileOptions.Builder()\n        .withMaxMemoryLimitInKb(1_000_000)\n        .build();\n\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            SevenZFile sf = new SevenZFile(new SeekableInMemoryByteChannel(data), options);\n            SevenZArchiveEntry entry;\n            while((entry = sf.getNextEntry()) != null) {\n                InputStream is = sf.getInputStream(entry);\n                is.read(new byte[1024]);\n            }\n            sf.close();\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressTarFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.tar.TarArchiveEntry;\nimport org.apache.commons.compress.archivers.tar.TarFile;\n\nimport java.io.InputStream;\nimport java.io.IOException;\n\n// Keeping class name the same so corpus doesn't change\n// See: https://google.github.io/oss-fuzz/faq/#what-happens-when-i-rename-a-fuzz-target-\npublic class CompressTarFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            TarFile tf = new TarFile(data);\n            for (TarArchiveEntry entry : tf.getEntries()) {\n                InputStream is = tf.getInputStream(entry);\n                is.read(new byte[1024]);\n            }\n            tf.close();\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressZipFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.archivers.zip.ZipArchiveEntry;\nimport org.apache.commons.compress.archivers.zip.ZipFile;\nimport org.apache.commons.compress.utils.SeekableInMemoryByteChannel;\n\nimport java.io.InputStream;\nimport java.io.IOException;\nimport java.util.Enumeration;\n\n// Keeping class name the same so corpus doesn't change\n// See: https://google.github.io/oss-fuzz/faq/#what-happens-when-i-rename-a-fuzz-target-\npublic class CompressZipFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            ZipFile zf = new ZipFile(new SeekableInMemoryByteChannel(data));\n            Enumeration<? extends ZipArchiveEntry> entries = zf.getEntries();\n            while(entries.hasMoreElements()) {\n                ZipArchiveEntry entry = entries.nextElement();\n                InputStream is = zf.getInputStream(entry);\n                is.read(new byte[1024]);\n            }\n            zf.close();\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressorBZip2Fuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class CompressorBZip2Fuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzCompressorInputStream(new BZip2CompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressorDeflate64Fuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.compressors.deflate64.Deflate64CompressorInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class CompressorDeflate64Fuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzCompressorInputStream(new Deflate64CompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressorGzipFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class CompressorGzipFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzCompressorInputStream(new GzipCompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressorLZ4Fuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.compressors.lz4.BlockLZ4CompressorInputStream;\nimport org.apache.commons.compress.compressors.lz4.FramedLZ4CompressorInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class CompressorLZ4Fuzzer extends BaseTests {\n    // Test both LZ4 classes\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzCompressorInputStream(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n\n        try {\n            fuzzCompressorInputStream(new FramedLZ4CompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressorPack200Fuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class CompressorPack200Fuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzCompressorInputStream(new Pack200CompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressorSnappyFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream;\nimport org.apache.commons.compress.compressors.snappy.SnappyCompressorInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class CompressorSnappyFuzzer extends BaseTests {\n    // Test both Snappy classes\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            fuzzCompressorInputStream(new FramedSnappyCompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n\n        try {\n            fuzzCompressorInputStream(new SnappyCompressorInputStream(new ByteArrayInputStream(data)));\n        } catch (IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/CompressorZFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.commons.compress.compressors.z.ZCompressorInputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class CompressorZFuzzer extends BaseTests {\n    public static void fuzzerTestOneInput(byte[] data) {\n        try {\n            // Setting limit to avoid out of memory errors\n            fuzzCompressorInputStream(new ZCompressorInputStream(new ByteArrayInputStream(data), 1024*1024));\n        } catch (IllegalArgumentException | IOException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-compress/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.5/bin/mvn\n\n# Dictionaries\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/zip.dict $SRC/CompressZipFuzzer.dict && \\\n    mv fuzzing/dictionaries/bz2.dict $SRC/CompressorBZip2Fuzzer.dict && \\\n    rm -rf fuzzing\n\n# Seed corpus (go-fuzz-corpus)\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j0 $SRC/CompressTarFuzzer_seed_corpus.zip go-fuzz-corpus/tar/corpus/* && \\\n    zip -j0 $SRC/CompressZipFuzzer_seed_corpus.zip go-fuzz-corpus/zip/corpus/* && \\\n    zip -j0 $SRC/CompressorBZip2Fuzzer_seed_corpus.zip go-fuzz-corpus/bzip2/corpus/* && \\\n    zip -j0 $SRC/CompressorGzipFuzzer_seed_corpus.zip go-fuzz-corpus/gzip/corpus/* && \\\n    zip -j0 $SRC/CompressorSnappyFuzzer_seed_corpus.zip go-fuzz-corpus/snappy/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# Checkout out Compress source code\nRUN git clone --depth 1 https://gitbox.apache.org/repos/asf/commons-compress.git\n\n# Seed corpus (Compress source code)\nRUN \\\n    zip -j0  $SRC/ArchiverArFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.ar && \\\n    zip -uj0 $SRC/ArchiverArFuzzer_seed_corpus.zip commons-compress/src/test/resources/archives/*.ar && \\\n    zip -j0  $SRC/ArchiverArjFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.arj && \\\n    zip -j0  $SRC/ArchiverCpioFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.cpio && \\\n    zip -uj0 $SRC/ArchiverCpioFuzzer_seed_corpus.zip commons-compress/src/test/resources/archives/*.cpio && \\\n    zip -j0  $SRC/ArchiverDumpFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.dump && \\\n    zip -uj0 $SRC/ArchiverDumpFuzzer_seed_corpus.zip commons-compress/src/test/resources/org/apache/commons/compress/dump/*.dump && \\\n    zip -j0  $SRC/CompressSevenZFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.7z && \\\n    zip -uj0 $SRC/CompressTarFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.tar && \\\n    zip -uj0 $SRC/CompressTarFuzzer_seed_corpus.zip commons-compress/src/test/resources/archives/*.tar && \\\n    zip -uj0 $SRC/CompressTarFuzzer_seed_corpus.zip commons-compress/src/test/resources/longpath/*.tar && \\\n    zip -uj0 $SRC/CompressTarFuzzer_seed_corpus.zip commons-compress/src/test/resources/longsymlink/*.tar && \\\n    zip -uj0 $SRC/CompressZipFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.zip\n\nRUN \\\n    zip -uj0 $SRC/CompressorBZip2Fuzzer_seed_corpus.zip commons-compress/src/test/resources/*.bz2 && \\\n    zip -j0  $SRC/CompressorDeflate64Fuzzer_seed_corpus.zip commons-compress/src/test/resources/*.deflate && \\\n    zip -uj0 $SRC/CompressorGzipFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.gz && \\\n    zip -j0  $SRC/CompressorLZ4Fuzzer_seed_corpus.zip commons-compress/src/test/resources/*lz4 && \\\n    zip -j0  $SRC/CompressorPack200Fuzzer_seed_corpus.zip commons-compress/src/test/resources/*.pack && \\\n    zip -uj0 $SRC/CompressorPack200Fuzzer_seed_corpus.zip commons-compress/src/test/resources/pack200/*.pack && \\\n    zip -uj0 $SRC/CompressorSnappyFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.sz && \\\n    zip -j0  $SRC/CompressorZFuzzer_seed_corpus.zip commons-compress/src/test/resources/*.Z\n\n# Copy some corpuses and dictionaries\nRUN \\\n    cp $SRC/CompressTarFuzzer_seed_corpus.zip $SRC/ArchiverTarStreamFuzzer_seed_corpus.zip && \\\n    cp $SRC/CompressZipFuzzer.dict $SRC/ArchiverZipStreamFuzzer.dict && \\\n    cp $SRC/CompressZipFuzzer_seed_corpus.zip $SRC/ArchiverZipStreamFuzzer_seed_corpus.zip\n\n# Copy build script, all fuzzers and supporting files\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/apache-commons-compress/README.md",
    "content": "Note that classes that use third party libraries are excluded.\nThese are either being already fuzzed by oss-fuzz or cannot be\nfuzzed effectively. These include:\n* BrotliCompressorInputStream - uses Google's Brotli\n* DeflateCompressorInputStream - uses JDK's Inflater\n* LZMACompressorInputStream - uses XZ for Java\n* XZCompressorInputStream - uses XZ for Java\n* ZstdCompressorInputStream - uses zstd-jni\n"
  },
  {
    "path": "projects/apache-commons-compress/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\npushd \"$SRC/commons-compress\"\n  MAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n  $MVN package org.apache.maven.plugins:maven-shade-plugin:3.5.1:shade $MAVEN_ARGS\n  CURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate \\\n   -Dexpression=project.version -q -DforceStdout)\n  cp \"target/commons-compress-$CURRENT_VERSION.jar\" $OUT/commons-compress.jar\npopd\n\nALL_JARS=\"commons-compress.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n  cp $SRC/Base*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/apache-commons-compress/project.yaml",
    "content": "homepage: \"https://commons.apache.org\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/commons-compress\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\n  - \"brunodepaulak@gmail.com\"\n  - \"peteralfredlee@gmail.com\"\n  - \"boards@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-configuration/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n# Install a working version of Maven\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -f maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nENV TARGET_PACKAGE_PREFIX org.apache.commons.configuration2.*\n\n# Clone the commons-configuration library source code\nRUN git clone --depth=1 \"https://gitbox.apache.org/repos/asf/commons-configuration.git\" commons-configuration\n\n# Get the dictionaries\nRUN git clone --depth=1 \"https://github.com/google/fuzzing\" fuzzing\nRUN cp fuzzing/dictionaries/xml.dict $SRC/XMLConfigurationLoadFuzzer.dict\n\nRUN cp fuzzing/dictionaries/yaml.dict $SRC/YAMLConfigurationReadFuzzer.dict\nRUN cp $SRC/YAMLConfigurationReadFuzzer.dict $SRC/YAMLConfigurationWriteFuzzer.dict\n\nRUN cp fuzzing/dictionaries/json.dict $SRC/JSONConfigurationReadFuzzer.dict\nRUN cp $SRC/JSONConfigurationReadFuzzer.dict $SRC/JSONConfigurationWriteFuzzer.dict\n\nCOPY ini.dict $SRC/INIConfigurationReadFuzzer.dict\nRUN cp $SRC/INIConfigurationReadFuzzer.dict $SRC/INIConfigurationWriteFuzzer.dict\n\n# Get the corpora\nRUN git clone --depth=1 \"https://github.com/dvyukov/go-fuzz-corpus\" corpora\nRUN zip -q $SRC/XMLConfigurationLoadFuzzer_seed_corpus.zip corpora/xml/corpus/*\n\nRUN zip -q $SRC/JSONConfigurationReadFuzzer_seed_corpus.zip corpora/json/corpus/*\nRUN cp $SRC/JSONConfigurationReadFuzzer_seed_corpus.zip $SRC/JSONConfigurationWriteFuzzer_seed_corpus.zip\n\n# Copy the build script and all the fuzztargets\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/commons-configuration\n"
  },
  {
    "path": "projects/apache-commons-configuration/INIConfigurationReadFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.InputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\nimport org.apache.commons.configuration2.INIConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\n\npublic class INIConfigurationReadFuzzer extends INIConfiguration {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create helper objects from fuzzer data\n        final char commentCharacter = data.consumeChar();\n        final char separatorCharacter = data.consumeChar();\n        final byte[] byteArray = data.consumeBytes(Integer.MAX_VALUE);\n\n        // Create needed objects\n        INIConfiguration iniConfig = new INIConfiguration();\n        InputStream inputStream = new ByteArrayInputStream(byteArray);\n        InputStreamReader reader = new InputStreamReader(inputStream);\n\n        try {\n            iniConfig.setSeparatorUsedInInput(Character.toString(separatorCharacter));\n            iniConfig.setCommentLeadingCharsUsedInInput(Character.toString(commentCharacter));\n            iniConfig.read(reader);\n        } catch (IOException | ConfigurationException ignored) {\n            // expected Exceptions get ignored\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/INIConfigurationWriteFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.InputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStreamReader;\nimport java.io.StringWriter;\nimport java.io.IOException;\n\nimport org.apache.commons.configuration2.INIConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\n\npublic class INIConfigurationWriteFuzzer extends INIConfiguration {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create helper objects from fuzzer data\n        final char commentCharacter = data.consumeChar();\n        final char inputSeparatorCharacter = data.consumeChar();\n        final char outputSeparatorCharacter = data.consumeChar();\n        final byte[] byteArray = data.consumeBytes(Integer.MAX_VALUE);\n\n        // Create the needed objects\n        INIConfiguration iniConfig = new INIConfiguration();\n        InputStream inputStream = new ByteArrayInputStream(byteArray);\n        InputStreamReader reader = new InputStreamReader(inputStream);\n        StringWriter writer = new StringWriter();\n\n        try {\n            iniConfig.setSeparatorUsedInInput(Character.toString(inputSeparatorCharacter));\n            iniConfig.setCommentLeadingCharsUsedInInput(Character.toString(commentCharacter));\n            iniConfig.read(reader);\n\n            iniConfig.setSeparatorUsedInOutput(Character.toString(outputSeparatorCharacter));\n            iniConfig.write(writer);\n        } catch (IOException | ConfigurationException ignored) {\n            // expected Exceptions get ignored\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/JSONConfigurationReadFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.ByteArrayInputStream;\n\nimport org.apache.commons.configuration2.JSONConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\n\npublic class JSONConfigurationReadFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create helper objects from fuzzer data\n        final boolean useReader = data.consumeBoolean();\n        final byte[] byteArray = data.consumeBytes(Integer.MAX_VALUE);\n\n        // Create needed objects\n        final JSONConfiguration jsonConfig = new JSONConfiguration();\n        jsonConfig.setLogger(null); // disable logger\n\n        final InputStream inputStream = new ByteArrayInputStream(byteArray);\n        final InputStreamReader reader;\n\n        try {\n            if (useReader) {\n                reader = new InputStreamReader(inputStream);\n                jsonConfig.read(reader);\n            } else {\n                jsonConfig.read(inputStream);\n            }\n\n        } catch (ConfigurationException ignored) {\n            // expected Exceptions get ignored\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/JSONConfigurationWriteFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.ByteArrayInputStream;\nimport java.io.StringWriter;\nimport java.io.IOException;\n\nimport org.apache.commons.configuration2.JSONConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\n\npublic class JSONConfigurationWriteFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create helper objects from fuzzer data\n        final boolean useReader = data.consumeBoolean();\n        final byte[] byteArray = data.consumeBytes(Integer.MAX_VALUE);\n\n        // Create needed objects\n        JSONConfiguration jsonConfig = new JSONConfiguration();\n        jsonConfig.setLogger(null); // disable logger\n\n        InputStream inputStream = new ByteArrayInputStream(byteArray);\n        InputStreamReader reader;\n        StringWriter writer = new StringWriter();\n\n        try {\n            if (useReader) {\n                reader = new InputStreamReader(inputStream);\n                jsonConfig.read(reader);\n            } else {\n                jsonConfig.read(inputStream);\n            }\n            jsonConfig.write(writer);\n        } catch (IOException | ConfigurationException ignored) {\n            // expected Exceptions get ignored\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/XMLConfigurationLoadFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\n\nimport org.apache.commons.configuration2.XMLConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\nimport org.apache.commons.configuration2.io.FileHandler;\n\npublic class XMLConfigurationLoadFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create needed objects\n        final File tempFile;\n        try {\n            tempFile = File.createTempFile(\"XMLConfiguration\", \".xml\");\n        } catch (IOException ioe) {\n            return;\n        }\n\n        final String absoluteFilepath = tempFile.getAbsolutePath();\n        try {\n            final FileWriter fileWriter = new FileWriter(tempFile);\n            fileWriter.write(data.consumeRemainingAsString());\n            fileWriter.close();\n        } catch (IOException ioe) {\n            tempFile.delete();\n            return;\n        }\n\n        final XMLConfiguration xmlConfig = new XMLConfiguration();\n        xmlConfig.setLogger(null); // disable logger\n\n        final FileHandler fileHandler = new FileHandler(xmlConfig);\n        fileHandler.setPath(absoluteFilepath);\n\n        try {\n            fileHandler.load();\n        } catch (ConfigurationException ignored) {\n            // expected Exceptions get ignored\n        } finally {\n            tempFile.delete();\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/XMLConfigurationWriteFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.StringWriter;\n\nimport org.apache.commons.configuration2.XMLConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\nimport org.apache.commons.configuration2.io.FileHandler;\n\npublic class XMLConfigurationWriteFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create needed objects\n        final File tempFile;\n        try {\n            tempFile = File.createTempFile(\"XMLConfiguration\", \".xml\");\n        } catch (IOException ioe) {\n            return;\n        }\n\n        final String absoluteFilepath = tempFile.getAbsolutePath();\n        try {\n            final FileWriter fileWriter = new FileWriter(tempFile);\n            fileWriter.write(data.consumeRemainingAsString());\n            fileWriter.close();\n        } catch (IOException ioe) {\n            tempFile.delete();\n            return;\n        }\n\n        final XMLConfiguration xmlConfig = new XMLConfiguration();\n        xmlConfig.setLogger(null); // disable the logger\n\n        final FileHandler fileHandler = new FileHandler(xmlConfig);\n        fileHandler.setPath(absoluteFilepath);\n\n        try {\n            fileHandler.load();\n            xmlConfig.write(new StringWriter());\n        } catch (ConfigurationException | IOException ignored) {\n            // expected Exceptions get ignored\n        } finally {\n            tempFile.delete();\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/YAMLConfigurationReadFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport org.apache.commons.configuration2.YAMLConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\nimport org.yaml.snakeyaml.LoaderOptions;\n\npublic class YAMLConfigurationReadFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create helper objects from fuzzer data\n        final boolean useLoaderOptions = data.consumeBoolean();\n\n        // Create needed objects\n        final YAMLConfiguration yamlConfig = new YAMLConfiguration();\n        yamlConfig.setLogger(null); // disable logging\n\n        // the actual fuzzing starts here\n        try {\n            if (useLoaderOptions) {\n                final LoaderOptions loaderOptions = createLoaderOptions(data);\n                yamlConfig.read(new ByteArrayInputStream(data.consumeBytes(Integer.MAX_VALUE)), loaderOptions);\n            } else {\n                yamlConfig.read(new ByteArrayInputStream(data.consumeBytes(Integer.MAX_VALUE)));\n            }\n        } catch (ConfigurationException ignored) {\n            // expected Exceptions get ignored\n        }\n    }\n\n    private static LoaderOptions createLoaderOptions(FuzzedDataProvider data) {\n        LoaderOptions loaderOptions = new LoaderOptions();\n        loaderOptions.setAllowDuplicateKeys(data.consumeBoolean());\n        loaderOptions.setWrappedToRootException(data.consumeBoolean());\n        loaderOptions.setAllowRecursiveKeys(data.consumeBoolean());\n        loaderOptions.setProcessComments(data.consumeBoolean());\n        loaderOptions.setEnumCaseSensitive(data.consumeBoolean());\n\n        return loaderOptions;\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/YAMLConfigurationWriteFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.StringWriter;\n\nimport org.apache.commons.configuration2.YAMLConfiguration;\nimport org.apache.commons.configuration2.ex.ConfigurationException;\nimport org.yaml.snakeyaml.LoaderOptions;\n\npublic class YAMLConfigurationWriteFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create helper objects from fuzzer data\n        final boolean useLoaderOptions = data.consumeBoolean();\n\n        // Create needed objects\n        final YAMLConfiguration yamlConfig = new YAMLConfiguration();\n        yamlConfig.setLogger(null); // disable logging\n\n        // the actual fuzzing starts here\n        try {\n            if (useLoaderOptions) {\n                final LoaderOptions loaderOptions = createLoaderOptions(data);\n                yamlConfig.read(new ByteArrayInputStream(data.consumeBytes(Integer.MAX_VALUE)), loaderOptions);\n            } else {\n                yamlConfig.read(new ByteArrayInputStream(data.consumeBytes(Integer.MAX_VALUE)));\n            }\n\n            yamlConfig.write(new StringWriter());\n        } catch (IOException | ConfigurationException ignored) {\n            // expected Exceptions get ignored\n        }\n    }\n\n    private static LoaderOptions createLoaderOptions(FuzzedDataProvider data) {\n        LoaderOptions loaderOptions = new LoaderOptions();\n        loaderOptions.setAllowDuplicateKeys(data.consumeBoolean());\n        loaderOptions.setWrappedToRootException(data.consumeBoolean());\n        loaderOptions.setAllowRecursiveKeys(data.consumeBoolean());\n        loaderOptions.setProcessComments(data.consumeBoolean());\n        loaderOptions.setEnumCaseSensitive(data.consumeBoolean());\n\n        return loaderOptions;\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-configuration/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Moving the corpora and dictionaries to $OUT\nmv $SRC/{*.zip,*.dict} $OUT\n\n# Building the library\nMAVEN_ARGS=\"--no-transfer-progress -Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15 -Djdk.version=15\"\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n\n## maven-shade-plugin is for packaging all the dependencies into one .jar\n$MVN clean package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\ncp \"target/commons-configuration2-$CURRENT_VERSION.jar\" \"$OUT/commons-configuration.jar\"\n\nALL_JARS=\"commons-configuration.jar\"\n\n## The classpath at build-time includes the project jars in $OUT as well as the Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n## All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -iname '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n    javac -cp $BUILD_CLASSPATH $fuzzer\n    cp $SRC/$fuzzer_basename.class $OUT/\n\n    # Create an execution wrapper that executes Jazzer with the correct arguments.\n    echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:-Djava.awt.headless=true\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n\n    # Make the execution wrapper executable\n    chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-configuration/ini.dict",
    "content": "# sources:\n# - https://en.wikipedia.org/wiki/INI_file\n# - https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms717987(v=vs.85)\n\n# Basics\nassign=\"=\"\nsection_left_bracket=\"[\"\nsection_right_bracket=\"]\"\ncomment_semicolon=\";\"\ncomment_hash=\"#\"\napostrophe=\"'\"\ndouble_quotes=\"\\\"\"\n\n# Old section nesting symbols\nbackslash=\"\\\\\"\ncomma=\",\"\nperiod=\".\"\n\n# Escape sequences\nescaped_backslash=\"\\\\'\"\nescaped_double_quotes=\"\\\\\"\"\nescaped_null_byte=\"\\\\0\"\nescaped_alert=\"\\\\a\"\nescaped_backspace=\"\\\\b\"\nescaped_tab=\"\\\\t\"\nescaped_carriage_return=\"\\\\r\"\nescaped_linefeed=\"\\\\n\"\nescaped_semicolon=\"\\\\;\"\nescaped_hash=\"\\\\#\"\nescaped_equal_sign=\"\\\\=\"\nescaped_colon=\"\\\\:\"\nescaped_unicode_beginning=\"\\\\x\"\n"
  },
  {
    "path": "projects/apache-commons-configuration/project.yaml",
    "content": "homepage: \"https://commons.apache.org/proper/commons-configuration/\"\nlanguage: jvm\nmain_repo: \"https://gitbox.apache.org/repos/asf/commons-configuration.git\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n - libfuzzer\nsanitizers:\n - address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"yoshi.weber@gmail.com\""
  },
  {
    "path": "projects/apache-commons-csv/CSVParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.List;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.io.ByteArrayInputStream;\nimport java.io.UncheckedIOException;\nimport org.apache.commons.csv.CSVParser;\nimport org.apache.commons.csv.CSVFormat;\nimport org.apache.commons.csv.CSVRecord;\n\npublic class CSVParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    CSVFormat[] formats = { CSVFormat.DEFAULT,\n                            CSVFormat.DEFAULT.withHeader(),\n                            CSVFormat.EXCEL, \n                            CSVFormat.EXCEL.withHeader(), \n                            CSVFormat.INFORMIX_UNLOAD, \n                            CSVFormat.INFORMIX_UNLOAD.withHeader(), \n                            CSVFormat.INFORMIX_UNLOAD_CSV, \n                            CSVFormat.INFORMIX_UNLOAD_CSV.withHeader(), \n                            CSVFormat.MYSQL, \n                            CSVFormat.MYSQL.withHeader(), \n                            CSVFormat.RFC4180, \n                            CSVFormat.RFC4180.withHeader(), \n                            CSVFormat.ORACLE, \n                            CSVFormat.ORACLE.withHeader(), \n                            CSVFormat.POSTGRESQL_CSV, \n                            CSVFormat.POSTGRESQL_CSV.withHeader(), \n                            CSVFormat.POSTGRESQL_TEXT, \n                            CSVFormat.POSTGRESQL_TEXT.withHeader(), \n                            CSVFormat.TDF, \n                            CSVFormat.TDF.withHeader() \n                          };\n    ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n    CSVFormat format = data.pickValue(formats);\n    try{\n      CSVParser parser = CSVParser.parse(bais, StandardCharsets.UTF_8, format);\n      List<CSVRecord> records = parser.getRecords();\n    }\n    catch( IOException | java.io.UncheckedIOException e ){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-csv/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/csv.dict $SRC/csv.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/CSVParserFuzzer_seed_corpus.zip go-fuzz-corpus/csv/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/apache/commons-csv.git apache-commons-csv\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/apache-commons-csv\n"
  },
  {
    "path": "projects/apache-commons-csv/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/commons-csv-$CURRENT_VERSION.jar\" $OUT/commons-csv.jar\n\nALL_JARS=\"commons-csv.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-csv/project.yaml",
    "content": "homepage: \"https://github.com/apache/commons-csv\"\nlanguage: jvm\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nauto_ccs:\n  - \"security@commons.apache.org\"\nmain_repo: \"https://github.com/apache/commons-csv.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-fileupload/.gitignore",
    "content": "project-parent/apache-commons-fileupload\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup\nproject-parent/fuzz-targets/.cifuzz-corpus"
  },
  {
    "path": "projects/apache-commons-fileupload/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/http.dict $SRC/FileUploadFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/FileUploadFuzzer_seed_corpus.zip go-fuzz-corpus/multipart/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/apache-commons-fileupload\nRUN git clone --depth 1 https://github.com/apache/commons-fileupload.git $SRC/project-parent/apache-commons-fileupload\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/apache-commons-fileupload/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=apache-commons-fileupload\nPROJECT_GROUP_ID=org.apache.commons\nPROJECT_ARTIFACT_ID=commons-fileupload2\nMAIN_REPOSITORY=https://github.com/apache/commons-fileupload.git\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -Denforcer.skip=true -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:commons-fileupload2-core -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:commons-fileupload2-javax -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && mvn install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/apache-commons-fileupload/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.commons</groupId>\n            <artifactId>commons-fileupload2-core</artifactId>\n            <version>2.0-SNAPSHOT</version>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.commons</groupId>\n            <artifactId>commons-fileupload2-javax</artifactId>\n            <version>2.0-SNAPSHOT</version>\n        </dependency>\n        <dependency>\n            <groupId>javax.servlet</groupId>\n            <artifactId>servlet-api</artifactId>\n            <version>2.5</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/apache-commons-fileupload/project-parent/fuzz-targets/src/test/java/com/example/Constants.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\n/**\n * Constants used for testing.\n *\n * @since 1.4\n */\npublic final class Constants {\n\n    /**\n     * The content type used in several tests.\n     */\n    public static final String CONTENT_TYPE = \"multipart/form-data; boundary=---1234\";\n\n    private Constants() { }\n}\n"
  },
  {
    "path": "projects/apache-commons-fileupload/project-parent/fuzz-targets/src/test/java/com/example/FileUploadFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.apache.commons.fileupload2.core.FileItem;\nimport org.apache.commons.fileupload2.core.AbstractFileUpload;\nimport org.apache.commons.fileupload2.core.FileUploadException;\nimport org.apache.commons.fileupload2.core.MultipartInput;\nimport org.apache.commons.fileupload2.core.DiskFileItemFactory;\nimport org.apache.commons.fileupload2.javax.JavaxServletFileUpload;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.util.List;\n\n\npublic class FileUploadFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data)\n            throws IOException, FileUploadException {\n        DiskFileItemFactory factory = DiskFileItemFactory.builder()\n                .setPath(new File(\"/tmp/abc\").toPath())\n                .get();\n        AbstractFileUpload upload = new JavaxServletFileUpload(factory);\n\n        // is set to tomcats default to approach CVE-2023-24998\n        upload.setMaxFileCount(10000);\n\n        String contentType = data.consumeAsciiString(200);\n        String multipartData = data.consumeRemainingAsString();\n        List<FileItem> fileItems = null;\n\n        try {\n            Util.parseUpload(upload, \"-----1234\\r\\n\" + multipartData + \"-----1234--\\r\\n\");\n            Util.parseUpload(upload, multipartData.getBytes(StandardCharsets.US_ASCII), contentType);\n        } catch (Exception e) {\n\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-fileupload/project-parent/fuzz-targets/src/test/java/com/example/MockHttpServletRequest.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport org.apache.commons.fileupload2.core.AbstractFileUpload;\n\nimport javax.servlet.RequestDispatcher;\nimport javax.servlet.ServletInputStream;\nimport javax.servlet.http.Cookie;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpSession;\nimport java.io.*;\nimport java.security.Principal;\nimport java.util.Enumeration;\nimport java.util.Locale;\nimport java.util.Map;\n\npublic class MockHttpServletRequest implements HttpServletRequest {\n\n    private final InputStream mmRequestData;\n\n    private long length;\n\n    private final String mStrContentType;\n\n    private int readLimit = -1;\n\n    private final Map<String, String> mHeaders = new java.util.HashMap<>();\n\n    /**\n     * Creates a new instance with the given request data\n     * and content type.\n     */\n    public MockHttpServletRequest(\n            final byte[] requestData,\n            final String strContentType) {\n        this(new ByteArrayInputStream(requestData),\n                requestData.length, strContentType);\n    }\n\n    /**\n     * Creates a new instance with the given request data\n     * and content type.\n     */\n    public MockHttpServletRequest(\n            final InputStream requestData,\n            final long requestLength,\n            final String strContentType) {\n        mmRequestData = requestData;\n        length = requestLength;\n        mStrContentType = strContentType;\n        mHeaders.put(AbstractFileUpload.CONTENT_TYPE, strContentType);\n    }\n\n    /**\n     * @see HttpServletRequest#getAuthType()\n     */\n    @Override\n    public String getAuthType() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getCookies()\n     */\n    @Override\n    public Cookie[] getCookies() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getDateHeader(String)\n     */\n    @Override\n    public long getDateHeader(final String arg0) {\n        return 0;\n    }\n\n    /**\n     * @see HttpServletRequest#getHeader(String)\n     */\n    @Override\n    public String getHeader(final String headerName) {\n        return mHeaders.get(headerName);\n    }\n\n    /**\n     * @see HttpServletRequest#getHeaders(String)\n     */\n    @Override\n    public Enumeration<String> getHeaders(final String arg0) {\n        // todo - implement\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getHeaderNames()\n     */\n    @Override\n    public Enumeration<String> getHeaderNames() {\n        // todo - implement\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getIntHeader(String)\n     */\n    @Override\n    public int getIntHeader(final String arg0) {\n        return 0;\n    }\n\n    /**\n     * @see HttpServletRequest#getMethod()\n     */\n    @Override\n    public String getMethod() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getPathInfo()\n     */\n    @Override\n    public String getPathInfo() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getPathTranslated()\n     */\n    @Override\n    public String getPathTranslated() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getContextPath()\n     */\n    @Override\n    public String getContextPath() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getQueryString()\n     */\n    @Override\n    public String getQueryString() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getRemoteUser()\n     */\n    @Override\n    public String getRemoteUser() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#isUserInRole(String)\n     */\n    @Override\n    public boolean isUserInRole(final String arg0) {\n        return false;\n    }\n\n    /**\n     * @see HttpServletRequest#getUserPrincipal()\n     */\n    @Override\n    public Principal getUserPrincipal() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getRequestedSessionId()\n     */\n    @Override\n    public String getRequestedSessionId() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getRequestURI()\n     */\n    @Override\n    public String getRequestURI() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getRequestURL()\n     */\n    @Override\n    public StringBuffer getRequestURL() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getServletPath()\n     */\n    @Override\n    public String getServletPath() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getSession(boolean)\n     */\n    @Override\n    public HttpSession getSession(final boolean arg0) {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#getSession()\n     */\n    @Override\n    public HttpSession getSession() {\n        return null;\n    }\n\n    /**\n     * @see HttpServletRequest#isRequestedSessionIdValid()\n     */\n    @Override\n    public boolean isRequestedSessionIdValid() {\n        return false;\n    }\n\n    /**\n     * @see HttpServletRequest#isRequestedSessionIdFromCookie()\n     */\n    @Override\n    public boolean isRequestedSessionIdFromCookie() {\n        return false;\n    }\n\n    /**\n     * @see HttpServletRequest#isRequestedSessionIdFromURL()\n     */\n    @Override\n    public boolean isRequestedSessionIdFromURL() {\n        return false;\n    }\n\n    /**\n     * @see HttpServletRequest#isRequestedSessionIdFromUrl()\n     * @deprecated\n     */\n    @Override\n    @Deprecated\n    public boolean isRequestedSessionIdFromUrl() {\n        return false;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getAttribute(String)\n     */\n    @Override\n    public Object getAttribute(final String arg0) {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getAttributeNames()\n     */\n    @Override\n    public Enumeration<String> getAttributeNames() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getCharacterEncoding()\n     */\n    @Override\n    public String getCharacterEncoding() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#setCharacterEncoding(String)\n     */\n    @Override\n    public void setCharacterEncoding(final String arg0)\n        throws UnsupportedEncodingException {\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getContentLength()\n     */\n    @Override\n    public int getContentLength() {\n        int iLength;\n\n        if (null == mmRequestData) {\n            iLength = -1;\n        } else {\n            if (length > Integer.MAX_VALUE) {\n                throw new RuntimeException(\"Value '\" + length + \"' is too large to be converted to int\");\n            }\n            iLength = (int) length;\n        }\n        return iLength;\n    }\n\n    /**\n     * For testing attack scenarios in SizesTest.\n     */\n    public void setContentLength(final long length) {\n        this.length = length;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getContentType()\n     */\n    @Override\n    public String getContentType() {\n        return mStrContentType;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getInputStream()\n     */\n    @Override\n    public ServletInputStream getInputStream() throws IOException {\n        return new MyServletInputStream(mmRequestData, readLimit);\n    }\n\n    /**\n     * Sets the read limit. This can be used to limit the number of bytes to read ahead.\n     *\n     * @param readLimit the read limit to use\n     */\n    public void setReadLimit(final int readLimit) {\n        this.readLimit = readLimit;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getParameter(String)\n     */\n    @Override\n    public String getParameter(final String arg0) {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getParameterNames()\n     */\n    @Override\n    public Enumeration<String> getParameterNames() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getParameterValues(String)\n     */\n    @Override\n    public String[] getParameterValues(final String arg0) {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getParameterMap()\n     */\n    @Override\n    public Map<String, String[]> getParameterMap() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getProtocol()\n     */\n    @Override\n    public String getProtocol() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getScheme()\n     */\n    @Override\n    public String getScheme() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getServerName()\n     */\n    @Override\n    public String getServerName() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getLocalName()\n     */\n    @Override\n    @SuppressWarnings(\"javadoc\") // This is a Servlet 2.4 method\n    public String getLocalName() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getServerPort()\n     */\n    @Override\n    public int getServerPort() {\n        return 0;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getLocalPort()\n     */\n    @Override\n    @SuppressWarnings(\"javadoc\") // This is a Servlet 2.4 method\n    public int getLocalPort() {\n        return 0;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getRemotePort()\n     */\n    @Override\n    @SuppressWarnings(\"javadoc\") // This is a Servlet 2.4 method\n    public int getRemotePort() {\n        return 0;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getReader()\n     */\n    @Override\n    public BufferedReader getReader() throws IOException {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getRemoteAddr()\n     */\n    @Override\n    public String getRemoteAddr() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getLocalAddr()\n     */\n    @Override\n    @SuppressWarnings(\"javadoc\") // This is a Servlet 2.4 method\n    public String getLocalAddr() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getRemoteHost()\n     */\n    @Override\n    public String getRemoteHost() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#setAttribute(String, Object)\n     */\n    @Override\n    public void setAttribute(final String arg0, final Object arg1) {\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#removeAttribute(String)\n     */\n    @Override\n    public void removeAttribute(final String arg0) {\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getLocale()\n     */\n    @Override\n    public Locale getLocale() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getLocales()\n     */\n    @Override\n    public Enumeration<Locale> getLocales() {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#isSecure()\n     */\n    @Override\n    public boolean isSecure() {\n        return false;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getRequestDispatcher(String)\n     */\n    @Override\n    public RequestDispatcher getRequestDispatcher(final String arg0) {\n        return null;\n    }\n\n    /**\n     * @see javax.servlet.ServletRequest#getRealPath(String)\n     * @deprecated\n     */\n    @Override\n    @Deprecated\n    public String getRealPath(final String arg0) {\n        return null;\n    }\n\n    private static class MyServletInputStream\n        extends ServletInputStream {\n\n        private final InputStream in;\n        private final int readLimit;\n\n        /**\n         * Creates a new instance, which returns the given\n         * streams data.\n         */\n        public MyServletInputStream(final InputStream pStream, final int readLimit) {\n            in = pStream;\n            this.readLimit = readLimit;\n        }\n\n        @Override\n        public int read() throws IOException {\n            return in.read();\n        }\n\n        @Override\n        public int read(final byte[] b, final int off, final int len) throws IOException {\n            if (readLimit > 0) {\n                return in.read(b, off, Math.min(readLimit, len));\n            }\n            return in.read(b, off, len);\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "projects/apache-commons-fileupload/project-parent/fuzz-targets/src/test/java/com/example/Util.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport org.apache.commons.fileupload2.core.FileItem;\nimport org.apache.commons.fileupload2.core.AbstractFileUpload;\nimport org.apache.commons.fileupload2.core.FileUploadException;\nimport org.apache.commons.fileupload2.core.DiskFileItemFactory;\nimport org.apache.commons.fileupload2.javax.JavaxServletFileUpload;\nimport org.apache.commons.fileupload2.javax.JavaxServletRequestContext;\n\nimport javax.servlet.http.HttpServletRequest;\nimport java.io.UnsupportedEncodingException;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Test utility methods.\n *\n * @since 1.4\n */\npublic class Util {\n\n    public static List<FileItem> parseUpload(final AbstractFileUpload upload, final byte[] bytes) throws FileUploadException {\n        return parseUpload(upload, bytes, Constants.CONTENT_TYPE);\n    }\n\n    public static List<FileItem> parseUpload(final AbstractFileUpload upload, final byte[] bytes, final String contentType)\n            throws FileUploadException {\n        final HttpServletRequest request = new MockHttpServletRequest(bytes, contentType);\n        return upload.parseRequest(new JavaxServletRequestContext(request));\n    }\n\n    public static List<FileItem> parseUpload(final AbstractFileUpload upload, final String content)\n        throws UnsupportedEncodingException, FileUploadException {\n        final byte[] bytes = content.getBytes(StandardCharsets.US_ASCII);\n        return parseUpload(upload, bytes, Constants.CONTENT_TYPE);\n    }\n\n    /**\n     * Return a list of {@link AbstractFileUpload} implementations for parameterized tests.\n     * @return a list of {@link AbstractFileUpload} implementations\n     */\n    public static List<AbstractFileUpload> fileUploadImplementations() {\n        DiskFileItemFactory factory = DiskFileItemFactory.builder().get();\n        return Arrays.asList(\n                new JavaxServletFileUpload(factory));\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-fileupload/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>apache-commons-fileupload</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/apache-commons-fileupload/project.yaml",
    "content": "homepage: \"https://commons.apache.org/proper/commons-fileupload/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/commons-fileupload.git\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-geometry/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\n\n# Geometry\nRUN git clone --depth 1 https://gitbox.apache.org/repos/asf/commons-geometry.git\n\n# Copy build script and all fuzzers\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/apache-commons-geometry/GeometryObjFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.ByteArrayInputStream;\nimport java.io.UncheckedIOException;\n\nimport org.apache.commons.geometry.io.core.input.StreamGeometryInput;\nimport org.apache.commons.geometry.io.euclidean.threed.BoundaryReadHandler3D;\nimport org.apache.commons.geometry.io.euclidean.threed.obj.ObjBoundaryReadHandler3D;\nimport org.apache.commons.numbers.core.Precision;\n\npublic class GeometryObjFuzzer {\n    public static void fuzzerTestOneInput(final byte[] data) {\n        try {\n            final BoundaryReadHandler3D handler = new ObjBoundaryReadHandler3D();\n            final Precision.DoubleEquivalence precision = Precision.doubleEquivalenceOfEpsilon(1e-20);\n\n            // check standard read\n            handler.read(new StreamGeometryInput(new ByteArrayInputStream(data)), precision);\n\n            // check mesh read\n            handler.readTriangleMesh(new StreamGeometryInput(new ByteArrayInputStream(data)), precision);\n        } catch (UncheckedIOException | IllegalArgumentException | IllegalStateException ignored) {\n            // expected exception types; ignore\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-geometry/GeometryStlBinaryFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.ByteArrayInputStream;\nimport java.io.UncheckedIOException;\n\nimport org.apache.commons.geometry.io.core.input.StreamGeometryInput;\nimport org.apache.commons.geometry.io.euclidean.threed.BoundaryReadHandler3D;\nimport org.apache.commons.geometry.io.euclidean.threed.stl.StlBoundaryReadHandler3D;\nimport org.apache.commons.numbers.core.Precision;\n\npublic class GeometryStlBinaryFuzzer {\n    public static void fuzzerTestOneInput(final byte[] data) {\n        try {\n            final BoundaryReadHandler3D handler = new StlBoundaryReadHandler3D();\n            final Precision.DoubleEquivalence precision = Precision.doubleEquivalenceOfEpsilon(1e-20);\n\n            // check standard read\n            handler.read(new StreamGeometryInput(new ByteArrayInputStream(data)), precision);\n\n            // check mesh read\n            handler.readTriangleMesh(new StreamGeometryInput(new ByteArrayInputStream(data)), precision);\n        } catch (UncheckedIOException | IllegalArgumentException | IllegalStateException ignored) {\n            // expected exception types; ignore\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-geometry/GeometryStlTextFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.nio.charset.StandardCharsets;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.UncheckedIOException;\n\nimport org.apache.commons.geometry.io.core.input.StreamGeometryInput;\nimport org.apache.commons.geometry.io.euclidean.threed.BoundaryReadHandler3D;\nimport org.apache.commons.geometry.io.euclidean.threed.stl.StlBoundaryReadHandler3D;\nimport org.apache.commons.numbers.core.Precision;\n\npublic class GeometryStlTextFuzzer {\n    public static void fuzzerTestOneInput(final byte[] data) {\n        // prepend the \"solid\" STL keyword to the input to ensure it is interpreted\n        // as text STL input\n        final byte[] dataWithPrefix = join(\"solid \".getBytes(StandardCharsets.US_ASCII), data);\n\n        try {\n            final BoundaryReadHandler3D handler = new StlBoundaryReadHandler3D();\n\n            final Precision.DoubleEquivalence precision = Precision.doubleEquivalenceOfEpsilon(1e-20);\n\n            // check standard read\n            handler.read(new StreamGeometryInput(new ByteArrayInputStream(dataWithPrefix)), precision);\n\n            // check mesh read\n            handler.readTriangleMesh(new StreamGeometryInput(new ByteArrayInputStream(dataWithPrefix)), precision);\n        } catch (UncheckedIOException | IllegalArgumentException | IllegalStateException ignored) {\n            // expected exception types; ignore\n        }\n    }\n\n    private static byte[] join(final byte[] a, final byte[] b) {\n        final byte[] result = new byte[a.length + b.length];\n        System.arraycopy(a, 0, result, 0, a.length);\n        System.arraycopy(b, 0, result, a.length, b.length);\n\n        return result;\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-geometry/GeometryTextFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.ByteArrayInputStream;\nimport java.io.UncheckedIOException;\n\nimport org.apache.commons.geometry.io.core.input.StreamGeometryInput;\nimport org.apache.commons.geometry.io.euclidean.threed.BoundaryReadHandler3D;\nimport org.apache.commons.geometry.io.euclidean.threed.txt.TextBoundaryReadHandler3D;\nimport org.apache.commons.numbers.core.Precision;\n\npublic class GeometryTextFuzzer {\n    public static void fuzzerTestOneInput(final byte[] data) {\n        try {\n            final BoundaryReadHandler3D handler = new TextBoundaryReadHandler3D();\n\n            final Precision.DoubleEquivalence precision = Precision.doubleEquivalenceOfEpsilon(1e-20);\n\n            // check standard read\n            handler.read(new StreamGeometryInput(new ByteArrayInputStream(data)), precision);\n\n            // check mesh read\n            handler.readTriangleMesh(new StreamGeometryInput(new ByteArrayInputStream(data)), precision);\n        } catch (UncheckedIOException | IllegalArgumentException | IllegalStateException ignored) {\n            // expected exception types; ignore\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-geometry/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd \"$SRC/commons-geometry\"\n  MAVEN_ARGS=\"-DskipTests -Djavac.src.version=8 -Djavac.target.version=8\"\n  $MVN install $MAVEN_ARGS\n  CURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n   -Dexpression=project.version -q -DforceStdout)\n  # Run shade plugin on io-euclidean module specifically with package phase\n  $MVN -pl commons-geometry-io-euclidean package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\n  cp \"commons-geometry-io-euclidean/target/commons-geometry-io-euclidean-$CURRENT_VERSION.jar\" $OUT/commons-geometry.jar\npopd\n\nALL_JARS=\"commons-geometry.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-geometry/project.yaml",
    "content": "homepage: \"https://commons.apache.org\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/commons-geometry\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\n  - \"brunodepaulak@gmail.com\"\n  - \"peteralfredlee@gmail.com\"\n  - \"boards@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-imaging/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\n# Dictionaries\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/gif.dict $SRC/ImagingGifFuzzer.dict && \\\n    mv fuzzing/dictionaries/jpeg.dict $SRC/ImagingJpegFuzzer.dict && \\\n    mv fuzzing/dictionaries/png.dict $SRC/ImagingPngFuzzer.dict && \\\n    mv fuzzing/dictionaries/tiff.dict $SRC/ImagingTiffFuzzer.dict && \\\n    rm -rf fuzzing\n\n# Seed corpus (go-fuzz-corpus)\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/ImagingBmpFuzzer_seed_corpus.zip go-fuzz-corpus/bmp/corpus/* && \\\n    zip -j $SRC/ImagingGifFuzzer_seed_corpus.zip go-fuzz-corpus/gif/corpus/* && \\\n    zip -j $SRC/ImagingJpegFuzzer_seed_corpus.zip go-fuzz-corpus/jpeg/corpus/* && \\\n    zip -j $SRC/ImagingPngFuzzer_seed_corpus.zip go-fuzz-corpus/png/corpus/* && \\\n    zip -j $SRC/ImagingTiffFuzzer_seed_corpus.zip go-fuzz-corpus/tiff/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# Imaging\nRUN git clone --depth 1 https://gitbox.apache.org/repos/asf/commons-imaging.git\n\n# Copy build script and all fuzzers\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/apache-commons-imaging/ImagingBmpFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.IOException;\nimport org.apache.commons.imaging.bytesource.ByteSource;\nimport org.apache.commons.imaging.formats.bmp.BmpImageParser;\n\npublic class ImagingBmpFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    try {\n      new BmpImageParser().getBufferedImage(ByteSource.array(input), null);\n    } catch (IOException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-imaging/ImagingGifFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.IOException;\nimport org.apache.commons.imaging.bytesource.ByteSource;\nimport org.apache.commons.imaging.formats.gif.GifImageParser;\n\npublic class ImagingGifFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    try {\n      new GifImageParser().getBufferedImage(ByteSource.array(input), null);\n    } catch (IOException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-imaging/ImagingJpegFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.IOException;\nimport org.apache.commons.imaging.bytesource.ByteSource;\nimport org.apache.commons.imaging.formats.jpeg.JpegImageParser;\n\npublic class ImagingJpegFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    try {\n      new JpegImageParser().getBufferedImage(ByteSource.array(input), null);\n    } catch (IOException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-imaging/ImagingPngFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.IOException;\nimport org.apache.commons.imaging.bytesource.ByteSource;\nimport org.apache.commons.imaging.formats.png.PngImageParser;\n\npublic class ImagingPngFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    try {\n      new PngImageParser().getBufferedImage(ByteSource.array(input), null);\n    } catch (IOException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-imaging/ImagingTiffFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.IOException;\nimport org.apache.commons.imaging.bytesource.ByteSource;\nimport org.apache.commons.imaging.formats.tiff.TiffImageParser;\n\npublic class ImagingTiffFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    try {\n      new TiffImageParser().getBufferedImage(ByteSource.array(input), null);\n    } catch (IOException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-imaging/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\npushd \"$SRC/commons-imaging\"\n  MAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15 --no-transfer-progress\"\n  $MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\n  CURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n   -Dexpression=project.version -q -DforceStdout)\n  cp \"target/commons-imaging-$CURRENT_VERSION.jar\" $OUT/commons-imaging.jar\npopd\n\nALL_JARS=\"commons-imaging.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:-Djava.awt.headless=true\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/apache-commons-imaging/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://commons.apache.org\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/commons-imaging\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\n  - \"brunodepaulak@gmail.com\"\n  - \"peteralfredlee@gmail.com\"\n  - \"boards@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"norbert.schneider@code-intelligence.com\"\n  - \"ggregory@apache.org\"\n  - \"garydgregory@gmail.com\"\n"
  },
  {
    "path": "projects/apache-commons-io/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/XmlFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XmlFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/apache/commons-io.git commons-io\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/commons-io\n"
  },
  {
    "path": "projects/apache-commons-io/FileComparatorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.util.Comparator;\nimport java.util.LinkedList;\nimport java.util.List;\nimport org.apache.commons.io.comparator.CompositeFileComparator;\nimport org.apache.commons.io.comparator.DefaultFileComparator;\nimport org.apache.commons.io.comparator.DirectoryFileComparator;\nimport org.apache.commons.io.comparator.ExtensionFileComparator;\nimport org.apache.commons.io.comparator.LastModifiedFileComparator;\nimport org.apache.commons.io.comparator.NameFileComparator;\nimport org.apache.commons.io.comparator.PathFileComparator;\nimport org.apache.commons.io.comparator.SizeFileComparator;\n\n/** This fuzzer targets the different Comparator classes for files in the comparator package. */\npublic class FileComparatorFuzzer {\n  private static File file1;\n  private static File file2;\n\n  public static void fuzzerInitialize() {\n    try {\n      file1 = File.createTempFile(\"OSS-Fuzz-\", \"-OSS-Fuzz\");\n      file2 = File.createTempFile(\"OSS-Fuzz-\", \"-OSS-Fuzz\");\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    file1.delete();\n    file2.delete();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Randomize file content\n      FileWriter writer = new FileWriter(file1);\n      writer.write(data.consumeString(data.remainingBytes()));\n      writer.close();\n      writer = new FileWriter(file2);\n      writer.write(data.consumeString(data.remainingBytes()));\n      writer.close();\n\n      // Create list of files\n      List<File> files = new LinkedList<File>();\n      files.add(file1);\n      files.add(file2);\n\n      // Create objects of comparator\n      Integer comparatorCount = data.consumeInt(1, 10);\n      List<Comparator<File>> delegates = new LinkedList<Comparator<File>>();\n      for (Integer i = 0; i < comparatorCount; i++) {\n        switch (data.consumeInt(1, 28)) {\n          case 1:\n            delegates.add(DefaultFileComparator.DEFAULT_COMPARATOR);\n            break;\n          case 2:\n            delegates.add(DefaultFileComparator.DEFAULT_REVERSE);\n            break;\n          case 3:\n            delegates.add(DirectoryFileComparator.DIRECTORY_COMPARATOR);\n            break;\n          case 4:\n            delegates.add(DirectoryFileComparator.DIRECTORY_REVERSE);\n            break;\n          case 5:\n            delegates.add(ExtensionFileComparator.EXTENSION_COMPARATOR);\n            break;\n          case 6:\n            delegates.add(ExtensionFileComparator.EXTENSION_REVERSE);\n            break;\n          case 7:\n            delegates.add(ExtensionFileComparator.EXTENSION_INSENSITIVE_COMPARATOR);\n            break;\n          case 8:\n            delegates.add(ExtensionFileComparator.EXTENSION_INSENSITIVE_REVERSE);\n            break;\n          case 9:\n            delegates.add(ExtensionFileComparator.EXTENSION_SYSTEM_COMPARATOR);\n            break;\n          case 10:\n            delegates.add(ExtensionFileComparator.EXTENSION_SYSTEM_REVERSE);\n            break;\n          case 11:\n            delegates.add(LastModifiedFileComparator.LASTMODIFIED_COMPARATOR);\n            break;\n          case 12:\n            delegates.add(LastModifiedFileComparator.LASTMODIFIED_REVERSE);\n            break;\n          case 13:\n            delegates.add(NameFileComparator.NAME_COMPARATOR);\n            break;\n          case 14:\n            delegates.add(NameFileComparator.NAME_REVERSE);\n            break;\n          case 15:\n            delegates.add(NameFileComparator.NAME_INSENSITIVE_COMPARATOR);\n            break;\n          case 16:\n            delegates.add(NameFileComparator.NAME_INSENSITIVE_REVERSE);\n            break;\n          case 17:\n            delegates.add(NameFileComparator.NAME_SYSTEM_COMPARATOR);\n            break;\n          case 18:\n            delegates.add(NameFileComparator.NAME_SYSTEM_REVERSE);\n            break;\n          case 19:\n            delegates.add(PathFileComparator.PATH_COMPARATOR);\n            break;\n          case 20:\n            delegates.add(PathFileComparator.PATH_REVERSE);\n            break;\n          case 21:\n            delegates.add(PathFileComparator.PATH_INSENSITIVE_COMPARATOR);\n            break;\n          case 22:\n            delegates.add(PathFileComparator.PATH_INSENSITIVE_REVERSE);\n            break;\n          case 23:\n            delegates.add(PathFileComparator.PATH_SYSTEM_COMPARATOR);\n            break;\n          case 24:\n            delegates.add(PathFileComparator.PATH_SYSTEM_REVERSE);\n            break;\n          case 25:\n            delegates.add(SizeFileComparator.SIZE_COMPARATOR);\n            break;\n          case 26:\n            delegates.add(SizeFileComparator.SIZE_REVERSE);\n            break;\n          case 27:\n            delegates.add(SizeFileComparator.SIZE_SUMDIR_COMPARATOR);\n            break;\n          case 28:\n            delegates.add(SizeFileComparator.SIZE_SUMDIR_REVERSE);\n            break;\n        }\n      }\n\n      // Fuzz the comparator by calling sort method of the file list\n      files.sort(new CompositeFileComparator(delegates));\n    } catch (IOException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/FileFilterFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport org.apache.commons.io.filefilter.CanExecuteFileFilter;\nimport org.apache.commons.io.filefilter.CanReadFileFilter;\nimport org.apache.commons.io.filefilter.CanWriteFileFilter;\nimport org.apache.commons.io.filefilter.EmptyFileFilter;\nimport org.apache.commons.io.filefilter.FileEqualsFileFilter;\nimport org.apache.commons.io.filefilter.FileFilterUtils;\nimport org.apache.commons.io.filefilter.HiddenFileFilter;\nimport org.apache.commons.io.filefilter.IOFileFilter;\nimport org.apache.commons.io.filefilter.TrueFileFilter;\nimport org.apache.commons.io.filefilter.WildcardFileFilter;\n\n/**\n * This fuzzer targets the accept method of different FileFilter implementation classes in the\n * filefilter package.\n */\npublic class FileFilterFuzzer {\n  private static File file;\n\n  public static void fuzzerInitialize() {\n    try {\n      file = File.createTempFile(\"OSS-Fuzz-\", \"-OSS-Fuzz\");\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    file.delete();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Randomize file content\n      FileWriter writer = new FileWriter(file);\n      writer.write(data.consumeString(data.remainingBytes()));\n      writer.close();\n\n      // Create objects of IOFileFilter\n      Integer filterCount = data.consumeInt(1, 10);\n      IOFileFilter[] filters = new IOFileFilter[filterCount];\n      for (Integer i = 0; i < filterCount; i++) {\n        Boolean negate = data.consumeBoolean();\n        IOFileFilter filter = null;\n        switch (data.consumeInt(1, 19)) {\n          case 1:\n            filter = FileFilterUtils.ageFileFilter(data.consumeLong(), data.consumeBoolean());\n            break;\n          case 2:\n            filter = FileFilterUtils.directoryFileFilter();\n            break;\n          case 3:\n            filter = FileFilterUtils.falseFileFilter();\n            break;\n          case 4:\n            filter = FileFilterUtils.fileFileFilter();\n            break;\n          case 5:\n            filter =\n                FileFilterUtils.magicNumberFileFilter(data.consumeBytes(data.remainingBytes()));\n            break;\n          case 6:\n            filter = FileFilterUtils.nameFileFilter(data.consumeString(data.remainingBytes()));\n            break;\n          case 7:\n            filter = FileFilterUtils.prefixFileFilter(data.consumeString(data.remainingBytes()));\n            break;\n          case 8:\n            filter = FileFilterUtils.sizeFileFilter(data.consumeLong(), data.consumeBoolean());\n            break;\n          case 9:\n            filter = FileFilterUtils.sizeRangeFileFilter(data.consumeLong(), data.consumeLong());\n            break;\n          case 10:\n            filter = FileFilterUtils.suffixFileFilter(data.consumeString(data.remainingBytes()));\n            break;\n          case 11:\n            filter = CanExecuteFileFilter.CAN_EXECUTE;\n            break;\n          case 12:\n            filter = CanReadFileFilter.CAN_READ;\n            break;\n          case 13:\n            filter = CanReadFileFilter.READ_ONLY;\n            break;\n          case 14:\n            filter = CanWriteFileFilter.CAN_WRITE;\n            break;\n          case 15:\n            filter = EmptyFileFilter.EMPTY;\n            break;\n          case 16:\n            filter = new FileEqualsFileFilter(file);\n            break;\n          case 17:\n            filter = HiddenFileFilter.HIDDEN;\n            break;\n          case 18:\n            filter = TrueFileFilter.INSTANCE;\n            break;\n          case 19:\n            filter =\n                WildcardFileFilter.builder()\n                    .setWildcards(data.consumeString(data.remainingBytes()))\n                    .get();\n            break;\n        }\n        if (filter != null) {\n          if (negate) {\n            filters[i] = FileFilterUtils.notFileFilter(filter);\n          } else {\n            filters[i] = filter;\n          }\n        }\n      }\n\n      // Fuzz the accept methods of the filter list wrapped by AndFileFilter or OrFileFilter\n      if ((filterCount % 2) == 0) {\n        FileFilterUtils.filter(FileFilterUtils.and(filters), file);\n      } else {\n        FileFilterUtils.filter(FileFilterUtils.or(filters), file);\n      }\n    } catch (IOException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/FileUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.LocalDate;\nimport org.apache.commons.io.FileUtils;\n\n/** This fuzzer targets the static methods of the File related Utils class in the base package. */\npublic class FileUtilsFuzzer {\n  private static final String PREFIX = \"OSS-Fuzz\";\n  private static Path srcPath;\n  private static Path dstPath;\n  private static Path srcFile;\n  private static Path dstFile;\n\n  public static void fuzzerInitialize() {\n    try {\n      srcPath = Files.createTempDirectory(PREFIX);\n      dstPath = Files.createTempDirectory(PREFIX);\n      srcFile = Files.createTempFile(srcPath, PREFIX, PREFIX);\n      dstFile = Files.createTempFile(dstPath, PREFIX, PREFIX);\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    try {\n      Files.deleteIfExists(srcFile);\n      Files.deleteIfExists(dstFile);\n      Files.deleteIfExists(srcPath);\n      Files.deleteIfExists(dstPath);\n    } catch (IOException e) {\n      // Known exception\n    }\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Randomize file content\n      FileWriter writer = new FileWriter(srcFile.toFile());\n      writer.write(data.consumeString(data.remainingBytes()));\n      writer.close();\n\n      switch (data.consumeInt(1, 16)) {\n        case 1:\n          FileUtils.byteCountToDisplaySize(data.consumeLong());\n          break;\n        case 2:\n          FileUtils.checksumCRC32(srcFile.toFile());\n          break;\n        case 3:\n          FileUtils.contentEquals(srcFile.toFile(), dstFile.toFile());\n          break;\n        case 4:\n          FileUtils.contentEqualsIgnoreEOL(srcFile.toFile(), dstFile.toFile(), null);\n          break;\n        case 5:\n          FileUtils.copyDirectoryToDirectory(srcPath.toFile(), dstPath.toFile());\n          break;\n        case 6:\n          FileUtils.copyFile(srcFile.toFile(), dstFile.toFile());\n          break;\n        case 7:\n          FileUtils.copyFileToDirectory(srcFile.toFile(), dstPath.toFile());\n          break;\n        case 8:\n          FileUtils.copyToDirectory(srcFile.toFile(), dstPath.toFile());\n          break;\n        case 9:\n          FileUtils.isFileNewer(dstFile.toFile(), LocalDate.now());\n          break;\n        case 10:\n          FileUtils.isFileOlder(dstFile.toFile(), LocalDate.now());\n          break;\n        case 11:\n          FileUtils.lastModified(srcFile.toFile());\n          break;\n        case 12:\n          FileUtils.lineIterator(srcFile.toFile());\n          break;\n        case 13:\n          FileUtils.moveFile(srcFile.toFile(), dstFile.toFile());\n          break;\n        case 14:\n          FileUtils.streamFiles(srcPath.toFile(), true, null);\n          break;\n        case 15:\n          FileUtils.toFiles(srcFile.toUri().toURL());\n          break;\n        case 16:\n          FileUtils.toURLs(srcFile.toFile());\n          break;\n      }\n    } catch (IOException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/GeneralUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.nio.charset.Charset;\nimport java.time.Duration;\nimport org.apache.commons.io.ByteOrderParser;\nimport org.apache.commons.io.CopyUtils;\nimport org.apache.commons.io.EndianUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.apache.commons.io.ThreadUtils;\n\n/** This fuzzer targets the static methods of the Utils classes in the base package. */\npublic class GeneralUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      byte[] outArray = new byte[data.remainingBytes()];\n      ByteArrayOutputStream baos = new ByteArrayOutputStream(data.remainingBytes());\n      switch (data.consumeInt(1, 24)) {\n        case 1:\n          ByteOrderParser.parseByteOrder(data.consumeRemainingAsString());\n          break;\n        case 2:\n          CopyUtils.copy(\n              data.consumeRemainingAsString(), baos, Charset.defaultCharset().displayName());\n          break;\n        case 3:\n          EndianUtils.readSwappedDouble(data.consumeRemainingAsBytes(), 0);\n          break;\n        case 4:\n          EndianUtils.readSwappedFloat(data.consumeRemainingAsBytes(), 0);\n          break;\n        case 5:\n          EndianUtils.readSwappedShort(data.consumeRemainingAsBytes(), 0);\n          break;\n        case 6:\n          IOUtils.consume(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n          break;\n        case 7:\n          byte[] equals = data.consumeRemainingAsBytes();\n          IOUtils.contentEquals(new ByteArrayInputStream(equals), new ByteArrayInputStream(equals));\n          break;\n        case 8:\n          IOUtils.copy(new ByteArrayInputStream(data.consumeRemainingAsBytes()), baos);\n          break;\n        case 9:\n          IOUtils.read(\n              new ByteArrayInputStream(data.consumeRemainingAsBytes()),\n              outArray,\n              0,\n              outArray.length);\n          break;\n        case 10:\n          IOUtils.readFully(new ByteArrayInputStream(data.consumeRemainingAsBytes()), outArray);\n          break;\n        case 11:\n          IOUtils.resourceToByteArray(data.consumeRemainingAsString());\n          break;\n        case 12:\n          IOUtils.resourceToString(data.consumeRemainingAsString(), Charset.defaultCharset());\n          break;\n        case 13:\n          Long skip = data.consumeLong();\n          IOUtils.skip(new ByteArrayInputStream(data.consumeRemainingAsBytes()), skip);\n          break;\n        case 14:\n          IOUtils.toByteArray(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n          break;\n        case 15:\n          byte[] case15 = data.consumeRemainingAsBytes();\n          IOUtils.contentEquals(\n              new InputStreamReader(new ByteArrayInputStream(case15)),\n              new InputStreamReader(new ByteArrayInputStream(case15)));\n          break;\n        case 16:\n          byte[] case16 = data.consumeRemainingAsBytes();\n          IOUtils.contentEqualsIgnoreEOL(\n              new InputStreamReader(new ByteArrayInputStream(case16)),\n              new InputStreamReader(new ByteArrayInputStream(case16)));\n          break;\n        case 17:\n          IOUtils.copy(\n              new ByteArrayInputStream(data.consumeRemainingAsBytes()),\n              new OutputStreamWriter(baos),\n              Charset.defaultCharset().name());\n          break;\n        case 18:\n          IOUtils.copy(\n              new InputStreamReader(new ByteArrayInputStream(data.consumeRemainingAsBytes())),\n              new OutputStreamWriter(baos));\n          break;\n        case 19:\n          IOUtils.copyLarge(\n              new ByteArrayInputStream(data.consumeRemainingAsBytes()), baos, 0, outArray.length);\n          break;\n        case 20:\n          IOUtils.copyLarge(\n              new InputStreamReader(new ByteArrayInputStream(data.consumeRemainingAsBytes())),\n              new OutputStreamWriter(baos),\n              0,\n              outArray.length);\n          break;\n        case 21:\n          IOUtils.readFully(\n              new ByteArrayInputStream(data.consumeRemainingAsBytes()), outArray.length);\n          break;\n        case 22:\n          IOUtils.readLines(\n              new ByteArrayInputStream(data.consumeRemainingAsBytes()), Charset.defaultCharset());\n          break;\n        case 23:\n          Long skip23 = data.consumeLong();\n          IOUtils.skip(\n              new InputStreamReader(new ByteArrayInputStream(data.consumeRemainingAsBytes())),\n              skip23);\n          break;\n        case 24:\n          ThreadUtils.sleep(Duration.ofSeconds(data.consumeInt(-5, 5)));\n          break;\n      }\n    } catch (IOException | IllegalArgumentException | InterruptedException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/InputStreamFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.nio.charset.Charset;\nimport java.security.NoSuchAlgorithmException;\nimport org.apache.commons.io.input.AutoCloseInputStream;\nimport org.apache.commons.io.input.BOMInputStream;\nimport org.apache.commons.io.input.BoundedInputStream;\nimport org.apache.commons.io.input.BrokenInputStream;\nimport org.apache.commons.io.input.CharSequenceInputStream;\nimport org.apache.commons.io.input.CircularInputStream;\nimport org.apache.commons.io.input.ClassLoaderObjectInputStream;\nimport org.apache.commons.io.input.CloseShieldInputStream;\nimport org.apache.commons.io.input.ClosedInputStream;\nimport org.apache.commons.io.input.CountingInputStream;\nimport org.apache.commons.io.input.DemuxInputStream;\nimport org.apache.commons.io.input.InfiniteCircularInputStream;\nimport org.apache.commons.io.input.MarkShieldInputStream;\nimport org.apache.commons.io.input.MemoryMappedFileInputStream;\nimport org.apache.commons.io.input.MessageDigestInputStream;\nimport org.apache.commons.io.input.NullInputStream;\nimport org.apache.commons.io.input.QueueInputStream;\nimport org.apache.commons.io.input.ReadAheadInputStream;\nimport org.apache.commons.io.input.SwappedDataInputStream;\nimport org.apache.commons.io.input.TaggedInputStream;\nimport org.apache.commons.io.input.TeeInputStream;\nimport org.apache.commons.io.input.UncheckedFilterInputStream;\nimport org.apache.commons.io.input.UnixLineEndingInputStream;\nimport org.apache.commons.io.input.UnsynchronizedBufferedInputStream;\nimport org.apache.commons.io.input.UnsynchronizedByteArrayInputStream;\nimport org.apache.commons.io.input.UnsynchronizedFilterInputStream;\nimport org.apache.commons.io.input.WindowsLineEndingInputStream;\nimport org.apache.commons.io.input.buffer.PeekableInputStream;\nimport org.apache.commons.io.serialization.ValidatingObjectInputStream;\n\n/**\n * This fuzzer targets the read method of different InputStream implementation classes in the input\n * or input.buffer packages.\n */\npublic class InputStreamFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      InputStream is = null;\n      Integer size = data.remainingBytes();\n      Boolean boolValue = data.consumeBoolean();\n      Integer choice = data.consumeInt(1, 29);\n      byte[] srcBuffer = data.consumeRemainingAsBytes();\n      InputStream bais = new ByteArrayInputStream(srcBuffer);\n\n      // Randomly create an InputStream implementation object\n      switch (choice) {\n        case 1:\n          is = new PeekableInputStream(bais);\n          ((PeekableInputStream) is).peek(srcBuffer);\n          break;\n        case 2:\n          is = AutoCloseInputStream.builder().setInputStream(bais).get();\n          break;\n        case 3:\n          is =\n              BOMInputStream.builder()\n                  .setInputStream(bais)\n                  .setByteOrderMarks()\n                  .setInclude(boolValue)\n                  .get();\n          break;\n        case 4:\n          is = new BoundedInputStream(bais);\n          break;\n        case 5:\n          is = BrokenInputStream.INSTANCE;\n          break;\n        case 6:\n          is =\n              CharSequenceInputStream.builder()\n                  .setInputStream(bais)\n                  .setCharset(Charset.defaultCharset())\n                  .get();\n          break;\n        case 7:\n          is = new CircularInputStream(srcBuffer, (long) srcBuffer.length);\n          break;\n        case 8:\n          is = new ClassLoaderObjectInputStream(InputStreamFuzzer.class.getClassLoader(), bais);\n          break;\n        case 9:\n          is = CloseShieldInputStream.wrap(bais);\n          break;\n        case 10:\n          is = ClosedInputStream.INSTANCE;\n          break;\n        case 11:\n          is = new CountingInputStream(bais);\n          break;\n        case 12:\n          is = new DemuxInputStream().bindStream(bais);\n          break;\n        case 13:\n          is = new InfiniteCircularInputStream(srcBuffer);\n          break;\n        case 14:\n          is = new MarkShieldInputStream(bais);\n          break;\n        case 15:\n          is = MemoryMappedFileInputStream.builder().setInputStream(bais).get();\n          break;\n        case 16:\n          is =\n              MessageDigestInputStream.builder()\n                  .setInputStream(bais)\n                  .setMessageDigest(\"SHA-256\")\n                  .get();\n          break;\n        case 17:\n          is = new NullInputStream();\n          break;\n        case 18:\n          is =\n              QueueInputStream.builder()\n                  .setInputStream(bais)\n                  .setBlockingQueue(null)\n                  .setTimeout(null)\n                  .get();\n          break;\n        case 19:\n          is = ReadAheadInputStream.builder().setInputStream(bais).get();\n          break;\n        case 20:\n          is = new SwappedDataInputStream(bais);\n          break;\n        case 21:\n          is = new TaggedInputStream(bais);\n          break;\n        case 22:\n          OutputStream baos = new ByteArrayOutputStream(srcBuffer.length);\n          is = new TeeInputStream(bais, baos, boolValue);\n          break;\n        case 23:\n          is = UncheckedFilterInputStream.builder().setInputStream(bais).get();\n          break;\n        case 24:\n          is = new UnixLineEndingInputStream(bais, boolValue);\n          break;\n        case 25:\n          is = UnsynchronizedBufferedInputStream.builder().setInputStream(bais).get();\n          break;\n        case 26:\n          is = UnsynchronizedByteArrayInputStream.builder().setByteArray(srcBuffer).get();\n          break;\n        case 27:\n          is = UnsynchronizedFilterInputStream.builder().setByteArray(srcBuffer).get();\n          break;\n        case 28:\n          is = new WindowsLineEndingInputStream(bais, boolValue);\n          break;\n        case 29:\n          is = new ValidatingObjectInputStream(bais);\n          break;\n      }\n\n      if (is != null) {\n        // Fuzz the read method of the created InputStream object\n        byte[] buffer = new byte[size + 1];\n        is.reset();\n        if (is.available() > 0) {\n          is.read(buffer, 0, size + 1);\n        }\n        is.close();\n      }\n    } catch (IOException\n        | IllegalArgumentException\n        | NoSuchAlgorithmException\n        | UnsupportedOperationException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/InputXmlFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport org.apache.commons.io.input.XmlStreamReader;\n\npublic class InputXmlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      boolean lenient = data.consumeBoolean();\n      ByteArrayInputStream is = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n      XmlStreamReader xsr = new XmlStreamReader(is, lenient);\n    }\n    catch (IOException e){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/OutputStreamFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.io.OutputStreamWriter;\nimport java.nio.charset.Charset;\nimport org.apache.commons.io.output.AppendableOutputStream;\nimport org.apache.commons.io.output.BrokenOutputStream;\nimport org.apache.commons.io.output.ByteArrayOutputStream;\nimport org.apache.commons.io.output.ChunkedOutputStream;\nimport org.apache.commons.io.output.CloseShieldOutputStream;\nimport org.apache.commons.io.output.ClosedOutputStream;\nimport org.apache.commons.io.output.CountingOutputStream;\nimport org.apache.commons.io.output.DemuxOutputStream;\nimport org.apache.commons.io.output.NullOutputStream;\nimport org.apache.commons.io.output.ProxyOutputStream;\nimport org.apache.commons.io.output.QueueOutputStream;\nimport org.apache.commons.io.output.TaggedOutputStream;\nimport org.apache.commons.io.output.TeeOutputStream;\nimport org.apache.commons.io.output.ThresholdingOutputStream;\nimport org.apache.commons.io.output.UncheckedFilterOutputStream;\nimport org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;\nimport org.apache.commons.io.output.WriterOutputStream;\n\n/**\n * This fuzzer targets the read method of different OutputStream implementation classes in the\n * output package.\n */\npublic class OutputStreamFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      OutputStream os = null;\n      Integer choice = data.consumeInt(1, 16);\n      OutputStream baos = new ByteArrayOutputStream(1024);\n\n      // Randomly create an OutputStream implementation object\n      switch (choice) {\n        case 1:\n          os = new AppendableOutputStream<StringBuffer>(new StringBuffer());\n          break;\n        case 2:\n          os = BrokenOutputStream.INSTANCE;\n          break;\n        case 3:\n          os = ChunkedOutputStream.builder().setOutputStream(baos).get();\n          break;\n        case 4:\n          os = CloseShieldOutputStream.wrap(baos);\n          break;\n        case 5:\n          os = ClosedOutputStream.INSTANCE;\n          break;\n        case 6:\n          os = new CountingOutputStream(baos);\n          break;\n        case 7:\n          os = new DemuxOutputStream().bindStream(baos);\n          break;\n        case 8:\n          os = NullOutputStream.INSTANCE;\n          break;\n        case 9:\n          os = new ProxyOutputStream(baos);\n          break;\n        case 10:\n          os = new QueueOutputStream();\n          break;\n        case 11:\n          os = new TaggedOutputStream(baos);\n          break;\n        case 12:\n          OutputStream branch = new ByteArrayOutputStream(1024);\n          os = new TeeOutputStream(baos, branch);\n          break;\n        case 13:\n          os = new ThresholdingOutputStream(data.consumeInt());\n          break;\n        case 14:\n          os = UncheckedFilterOutputStream.builder().setOutputStream(baos).get();\n          break;\n        case 15:\n          os = UnsynchronizedByteArrayOutputStream.builder().setOutputStream(baos).get();\n          break;\n        case 16:\n          OutputStreamWriter writer = new OutputStreamWriter(baos);\n          os =\n              WriterOutputStream.builder()\n                  .setWriter(writer)\n                  .setCharset(Charset.defaultCharset())\n                  .setWriteImmediately(data.consumeBoolean())\n                  .get();\n          break;\n      }\n\n      if (os != null) {\n        // Fuzz the write method of the created OutStream object\n        byte[] srcBuffer = data.consumeRemainingAsBytes();\n        os.write(srcBuffer, 0, srcBuffer.length);\n        os.flush();\n        os.close();\n      }\n    } catch (IOException | IllegalArgumentException | UnsupportedOperationException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/PathUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport org.apache.commons.io.file.PathUtils;\n\n/** This fuzzer targets the static methods of the PathUtils class in the file package. */\npublic class PathUtilsFuzzer {\n  private static Path srcPath;\n  private static Path dstPath;\n  private static Path file;\n\n  public static void fuzzerInitialize() {\n    try {\n      srcPath = Files.createTempDirectory(\"OSS-Fuzz-\");\n      dstPath = Files.createTempDirectory(\"OSS-Fuzz-\");\n      file = Files.createTempFile(srcPath, \"OSS-Fuzz-\", \"-OSS-Fuzz\");\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    try {\n      Files.deleteIfExists(srcPath);\n      Files.deleteIfExists(dstPath);\n      Files.deleteIfExists(file);\n    } catch (IOException e) {\n      // Known exception\n    }\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Randomize file content\n      FileWriter writer = new FileWriter(file.toFile());\n      writer.write(data.consumeString(data.remainingBytes()));\n      writer.close();\n\n      switch (data.consumeInt(1, 8)) {\n        case 1:\n          PathUtils.cleanDirectory(dstPath);\n          break;\n        case 2:\n          PathUtils.copyDirectory(srcPath, dstPath);\n          break;\n        case 3:\n          PathUtils.copyFileToDirectory(file, dstPath);\n          break;\n        case 4:\n          PathUtils.countDirectory(dstPath);\n          break;\n        case 5:\n          PathUtils.createParentDirectories(dstPath);\n          break;\n        case 6:\n          PathUtils.directoryAndFileContentEquals(srcPath, dstPath);\n          break;\n        case 7:\n          PathUtils.directoryContentEquals(srcPath, dstPath);\n          break;\n        case 8:\n          PathUtils.fileContentEquals(srcPath, dstPath);\n          break;\n      }\n    } catch (IOException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/ReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.io.Reader;\nimport java.io.Writer;\nimport java.nio.charset.Charset;\nimport org.apache.commons.io.input.BoundedReader;\nimport org.apache.commons.io.input.BrokenReader;\nimport org.apache.commons.io.input.CharSequenceReader;\nimport org.apache.commons.io.input.CharacterFilterReader;\nimport org.apache.commons.io.input.CharacterSetFilterReader;\nimport org.apache.commons.io.input.CloseShieldReader;\nimport org.apache.commons.io.input.ClosedReader;\nimport org.apache.commons.io.input.NullReader;\nimport org.apache.commons.io.input.SequenceReader;\nimport org.apache.commons.io.input.TaggedReader;\nimport org.apache.commons.io.input.TeeReader;\nimport org.apache.commons.io.input.UncheckedBufferedReader;\nimport org.apache.commons.io.input.UncheckedFilterReader;\nimport org.apache.commons.io.input.XmlStreamReader;\n\n/**\n * This fuzzer targets the read method of different Reader implementation classes in the input\n * package.\n */\npublic class ReaderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Reader reader = null;\n      Integer size = data.remainingBytes();\n      Integer intValue = data.consumeInt();\n      Integer choice = data.consumeInt(1, 14);\n      byte[] srcBuffer = data.consumeRemainingAsBytes();\n      ByteArrayInputStream bais = new ByteArrayInputStream(srcBuffer);\n      Reader srcReader = new InputStreamReader(bais);\n\n      // Randomly create a Reader implementation object\n      switch (choice) {\n        case 1:\n          reader = new BoundedReader(srcReader, size);\n          break;\n        case 2:\n          reader = BrokenReader.INSTANCE;\n          break;\n        case 3:\n          reader = new CharSequenceReader(new String(srcBuffer, Charset.defaultCharset()));\n          break;\n        case 4:\n          reader = new CharacterFilterReader(srcReader, intValue);\n          break;\n        case 5:\n          reader = new CharacterSetFilterReader(srcReader, intValue);\n          break;\n        case 6:\n          reader = CloseShieldReader.wrap(srcReader);\n          break;\n        case 7:\n          reader = ClosedReader.INSTANCE;\n          break;\n        case 8:\n          reader = NullReader.INSTANCE;\n          break;\n        case 9:\n          reader = new SequenceReader(srcReader);\n          break;\n        case 10:\n          reader = new TaggedReader(srcReader);\n          break;\n        case 11:\n          Writer writer = new OutputStreamWriter(new ByteArrayOutputStream(size));\n          reader = new TeeReader(srcReader, writer);\n          break;\n        case 12:\n          reader = UncheckedBufferedReader.builder().setReader(srcReader).get();\n          break;\n        case 13:\n          reader = UncheckedFilterReader.builder().setReader(srcReader).get();\n          break;\n        case 14:\n          reader = XmlStreamReader.builder().setInputStream(bais).get();\n          break;\n      }\n\n      if (reader != null) {\n        // Fuzz the read method of the created Reader object\n        char[] buffer = new char[size + 1];\n        if (reader.ready()) {\n          reader.read(buffer, 0, size + 1);\n        }\n        reader.close();\n      }\n    } catch (IOException | IllegalArgumentException | UnsupportedOperationException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/WriterFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.io.OutputStreamWriter;\nimport java.io.Writer;\nimport java.nio.charset.Charset;\nimport org.apache.commons.io.output.AppendableWriter;\nimport org.apache.commons.io.output.BrokenWriter;\nimport org.apache.commons.io.output.ChunkedWriter;\nimport org.apache.commons.io.output.CloseShieldWriter;\nimport org.apache.commons.io.output.ClosedWriter;\nimport org.apache.commons.io.output.FileWriterWithEncoding;\nimport org.apache.commons.io.output.LockableFileWriter;\nimport org.apache.commons.io.output.NullWriter;\nimport org.apache.commons.io.output.ProxyCollectionWriter;\nimport org.apache.commons.io.output.ProxyWriter;\nimport org.apache.commons.io.output.StringBuilderWriter;\nimport org.apache.commons.io.output.TaggedWriter;\nimport org.apache.commons.io.output.TeeWriter;\nimport org.apache.commons.io.output.UncheckedFilterWriter;\nimport org.apache.commons.io.output.XmlStreamWriter;\n\n/**\n * This fuzzer targets the read method of different Writer implementation classes in the output\n * package.\n */\npublic class WriterFuzzer {\n  private static File file;\n\n  public static void fuzzerInitialize() {\n    try {\n      file = File.createTempFile(\"OSS-Fuzz-\", \"-OSS-Fuzz\");\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    file.delete();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Writer writer = null;\n      Integer choice = data.consumeInt(1, 15);\n      OutputStream os = new ByteArrayOutputStream(1024);\n      Writer outWriter = new OutputStreamWriter(os);\n\n      // Randomly create a Writer implementation object\n      switch (choice) {\n        case 1:\n          writer = new AppendableWriter<StringBuffer>(new StringBuffer());\n          break;\n        case 2:\n          writer = BrokenWriter.INSTANCE;\n          break;\n        case 3:\n          writer = new ChunkedWriter(outWriter);\n          break;\n        case 4:\n          writer = CloseShieldWriter.wrap(outWriter);\n          break;\n        case 5:\n          writer = ClosedWriter.INSTANCE;\n          break;\n        case 6:\n          writer =\n              FileWriterWithEncoding.builder()\n                  .setAppend(data.consumeBoolean())\n                  .setCharset(Charset.defaultCharset())\n                  .setFile(file)\n                  .get();\n          break;\n        case 7:\n          writer =\n              LockableFileWriter.builder()\n                  .setAppend(data.consumeBoolean())\n                  .setCharset(Charset.defaultCharset())\n                  .setFile(file)\n                  .setLockDirectory((String) null)\n                  .get();\n          break;\n        case 8:\n          writer = NullWriter.INSTANCE;\n          break;\n        case 9:\n          writer = new ProxyCollectionWriter(outWriter);\n          break;\n        case 10:\n          writer = new ProxyWriter(outWriter);\n          break;\n        case 11:\n          writer = new StringBuilderWriter(1024);\n          break;\n        case 12:\n          writer = new TaggedWriter(outWriter);\n          break;\n        case 13:\n          writer = new TeeWriter(outWriter);\n          break;\n        case 14:\n          writer = UncheckedFilterWriter.builder().setWriter(outWriter).get();\n          break;\n        case 15:\n          writer =\n              XmlStreamWriter.builder()\n                  .setOutputStream(os)\n                  .setCharset(Charset.defaultCharset())\n                  .get();\n          break;\n      }\n\n      if (writer != null) {\n        // Fuzz the write method of the created Writer object\n        String source = data.consumeRemainingAsString();\n        writer.write(source, 0, source.length());\n        writer.flush();\n        writer.close();\n      }\n    } catch (IOException | IllegalArgumentException | UnsupportedOperationException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-io/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/commons-io-$CURRENT_VERSION.jar\" $OUT/commons-io.jar\n\nALL_JARS=\"commons-io.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-io/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://commons.apache.org/proper/commons-io/\nlanguage: jvm\nmain_repo: https://gitbox.apache.org/repos/asf/commons-io.git\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\n  - \"garydgregory@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/apache-commons-jxpath/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/JXPathFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/JXPathFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/apache/commons-jxpath.git\n\nCOPY build.sh $SRC/\nCOPY JXPathFuzzer.java $SRC/\nWORKDIR $SRC/commons-jxpath\n"
  },
  {
    "path": "projects/apache-commons-jxpath/JXPathFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.StringReader;\nimport java.io.IOException;\n\nimport org.w3c.dom.Document;\nimport org.xml.sax.InputSource;\nimport org.xml.sax.SAXException;\n\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.ParserConfigurationException;\n\nimport org.apache.commons.jxpath.JXPathContext;\nimport org.apache.commons.jxpath.JXPathException;\n\n\npublic class JXPathFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        DocumentBuilder builder = null;\n        Document doc = null;\n        try {\n            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n            factory.setValidating(data.consumeBoolean());\n            factory.setNamespaceAware(data.consumeBoolean());\n            factory.setExpandEntityReferences(data.consumeBoolean());\n            builder = factory.newDocumentBuilder();\n        } catch (Exception parserConfigurationException) {\n        }\n\n        try {\n            doc = builder.parse(new InputSource(new StringReader(data.consumeString(2000))));\n        } catch (SAXException | IOException e) {\n        }\n\n        JXPathContext context = JXPathContext.newContext(doc);\n        try {\n            context.selectNodes(data.consumeRemainingAsString());\n        } catch (JXPathException e) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-jxpath/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/commons-jxpath-$CURRENT_VERSION.jar\" $OUT/commons-jxpath.jar\n\nALL_JARS=\"commons-jxpath.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-jxpath/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/apache/commons-jxpath.git\nlanguage: jvm\nmain_repo: https://github.com/apache/commons-jxpath.git\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nsanitizers:\n- address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n- yakdan@code-intelligence.com\n- patrice.salathe@code-intelligence.com\n- \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-lang/AnnotationUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.AnnotatedElement;\nimport java.util.HashSet;\nimport java.util.Set;\nimport org.apache.commons.lang3.AnnotationUtils;\nimport org.apache.commons.lang3.exception.UncheckedException;\n\n/** This fuzzer targets the methods of the AnnotationUtils class. */\npublic class AnnotationUtilsFuzzer extends ClassFuzzerBase {\n  private static Set<Annotation> annotationSet;\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      AnnotationUtils.isValidAnnotationMemberType(data.pickValue(classSet));\n\n      initializeAnnotationSet();\n\n      // Randomly pick 2 annotations object\n      Annotation annotation1 = data.pickValue(annotationSet);\n      Annotation annotation2 = data.pickValue(annotationSet);\n\n      switch (data.consumeInt(1, 3)) {\n        case 1:\n          AnnotationUtils.toString(annotation1);\n          AnnotationUtils.toString(annotation2);\n          break;\n        case 2:\n          AnnotationUtils.equals(annotation1, annotation2);\n          break;\n        case 3:\n          AnnotationUtils.hashCode(annotation1);\n          AnnotationUtils.hashCode(annotation2);\n          break;\n      }\n    } catch (UncheckedException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeAnnotationSet() {\n    if ((annotationSet == null) || (annotationSet.size() == 0)) {\n      annotationSet = new HashSet<Annotation>();\n      for (Class cls : classSet) {\n        try {\n          Set<AnnotatedElement> elements = new HashSet<AnnotatedElement>();\n          elements.add(cls);\n          elements.add(cls.getPackage());\n          elements.addAll(Set.of(cls.getConstructors()));\n          elements.addAll(Set.of(cls.getMethods()));\n          elements.addAll(Set.of(cls.getFields()));\n          for (AnnotatedElement element : elements) {\n            annotationSet.addAll(Set.of(element.getAnnotations()));\n          }\n        } catch (LinkageError e) {\n          // Ignore failing classes\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/ArrayUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.ArrayFill;\nimport org.apache.commons.lang3.ArraySorter;\nimport org.apache.commons.lang3.ArrayUtils;\n\n/** This fuzzer targets the methods of the ArrayUtils class in the base package. */\npublic class ArrayUtilsFuzzer {\n  private static boolean[] boolArray;\n  private static byte[] byteArray;\n  private static char[] charArray;\n  private static double[] doubleArray;\n  private static float[] floatArray;\n  private static int[] intArray;\n  private static long[] longArray;\n  private static short[] shortArray;\n  private static String[] strArray;\n\n  public static void fuzzerInitialize() {\n    boolArray = new boolean[1];\n    byteArray = new byte[1];\n    charArray = new char[1];\n    doubleArray = new double[1];\n    floatArray = new float[1];\n    intArray = new int[1];\n    longArray = new long[1];\n    shortArray = new short[1];\n    strArray = new String[1];\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      cleanLargeArray();\n\n      for (Integer count = 0; count < data.consumeInt(1, 10); count++) {\n        switch (data.consumeInt(1, 143)) {\n          case 1:\n            ArrayUtils.add(boolArray, data.consumeBoolean());\n            break;\n          case 2:\n            ArrayUtils.add(byteArray, data.consumeByte());\n            break;\n          case 3:\n            ArrayUtils.add(charArray, data.consumeChar());\n            break;\n          case 4:\n            ArrayUtils.add(doubleArray, data.consumeDouble());\n            break;\n          case 5:\n            ArrayUtils.add(floatArray, data.consumeFloat());\n            break;\n          case 6:\n            ArrayUtils.add(intArray, data.consumeInt());\n            break;\n          case 7:\n            ArrayUtils.add(longArray, data.consumeLong());\n            break;\n          case 8:\n            ArrayUtils.add(shortArray, data.consumeShort());\n            break;\n          case 9:\n            ArrayUtils.add(strArray, data.consumeString(10));\n            break;\n          case 10:\n            ArrayUtils.addAll(boolArray, data.consumeBoolean());\n            break;\n          case 11:\n            ArrayUtils.addAll(byteArray, data.consumeByte());\n            break;\n          case 12:\n            ArrayUtils.addAll(charArray, data.consumeChar());\n            break;\n          case 13:\n            ArrayUtils.addAll(doubleArray, data.consumeDouble());\n            break;\n          case 14:\n            ArrayUtils.addAll(floatArray, data.consumeFloat());\n            break;\n          case 15:\n            ArrayUtils.addAll(intArray, data.consumeInt());\n            break;\n          case 16:\n            ArrayUtils.addAll(longArray, data.consumeLong());\n            break;\n          case 17:\n            ArrayUtils.addAll(shortArray, data.consumeShort());\n            break;\n          case 18:\n            ArrayUtils.addAll(strArray, data.consumeString(10));\n            break;\n          case 19:\n            ArrayUtils.addFirst(boolArray, data.consumeBoolean());\n            break;\n          case 20:\n            ArrayUtils.addFirst(byteArray, data.consumeByte());\n            break;\n          case 21:\n            ArrayUtils.addFirst(charArray, data.consumeChar());\n            break;\n          case 22:\n            ArrayUtils.addFirst(doubleArray, data.consumeDouble());\n            break;\n          case 23:\n            ArrayUtils.addFirst(floatArray, data.consumeFloat());\n            break;\n          case 24:\n            ArrayUtils.addFirst(intArray, data.consumeInt());\n            break;\n          case 25:\n            ArrayUtils.addFirst(longArray, data.consumeLong());\n            break;\n          case 26:\n            ArrayUtils.addFirst(shortArray, data.consumeShort());\n            break;\n          case 27:\n            ArrayUtils.addFirst(strArray, data.consumeString(10));\n            break;\n          case 28:\n            ArrayUtils.reverse(boolArray);\n            break;\n          case 29:\n            ArrayUtils.reverse(byteArray);\n            break;\n          case 30:\n            ArrayUtils.reverse(charArray);\n            break;\n          case 31:\n            ArrayUtils.reverse(doubleArray);\n            break;\n          case 32:\n            ArrayUtils.reverse(floatArray);\n            break;\n          case 33:\n            ArrayUtils.reverse(intArray);\n            break;\n          case 34:\n            ArrayUtils.reverse(longArray);\n            break;\n          case 35:\n            ArrayUtils.reverse(shortArray);\n            break;\n          case 36:\n            ArrayUtils.reverse(strArray);\n            break;\n          case 37:\n            ArrayUtils.shift(boolArray, 10);\n            break;\n          case 38:\n            ArrayUtils.shift(byteArray, 10);\n            break;\n          case 39:\n            ArrayUtils.shift(charArray, 10);\n            break;\n          case 40:\n            ArrayUtils.shift(doubleArray, 10);\n            break;\n          case 41:\n            ArrayUtils.shift(floatArray, 10);\n            break;\n          case 42:\n            ArrayUtils.shift(intArray, 10);\n            break;\n          case 43:\n            ArrayUtils.shift(longArray, 10);\n            break;\n          case 44:\n            ArrayUtils.shift(shortArray, 10);\n            break;\n          case 45:\n            ArrayUtils.shift(strArray, 10);\n            break;\n          case 46:\n            ArrayUtils.shuffle(boolArray);\n            break;\n          case 47:\n            ArrayUtils.shuffle(byteArray);\n            break;\n          case 48:\n            ArrayUtils.shuffle(charArray);\n            break;\n          case 49:\n            ArrayUtils.shuffle(doubleArray);\n            break;\n          case 50:\n            ArrayUtils.shuffle(floatArray);\n            break;\n          case 51:\n            ArrayUtils.shuffle(intArray);\n            break;\n          case 52:\n            ArrayUtils.shuffle(longArray);\n            break;\n          case 53:\n            ArrayUtils.shuffle(shortArray);\n            break;\n          case 54:\n            ArrayUtils.shuffle(strArray);\n            break;\n          case 55:\n            ArrayUtils.swap(boolArray, 0, 1);\n            break;\n          case 56:\n            ArrayUtils.swap(byteArray, 0, 1);\n            break;\n          case 57:\n            ArrayUtils.swap(charArray, 0, 1);\n            break;\n          case 58:\n            ArrayUtils.swap(doubleArray, 0, 1);\n            break;\n          case 59:\n            ArrayUtils.swap(floatArray, 0, 1);\n            break;\n          case 60:\n            ArrayUtils.swap(intArray, 0, 1);\n            break;\n          case 61:\n            ArrayUtils.swap(longArray, 0, 1);\n            break;\n          case 62:\n            ArrayUtils.swap(shortArray, 0, 1);\n            break;\n          case 63:\n            ArrayUtils.swap(strArray, 0, 1);\n            break;\n          case 64:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(boolArray));\n            break;\n          case 65:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(byteArray));\n            break;\n          case 66:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(charArray));\n            break;\n          case 67:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(doubleArray));\n            break;\n          case 68:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(floatArray));\n            break;\n          case 69:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(intArray));\n            break;\n          case 70:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(longArray));\n            break;\n          case 71:\n            ArrayUtils.toPrimitive(ArrayUtils.toObject(shortArray));\n            break;\n          case 72:\n            ArrayUtils.removeElement(boolArray, data.consumeBoolean());\n            break;\n          case 73:\n            ArrayUtils.removeElement(byteArray, data.consumeByte());\n            break;\n          case 74:\n            ArrayUtils.removeElement(charArray, data.consumeChar());\n            break;\n          case 75:\n            ArrayUtils.removeElement(doubleArray, data.consumeDouble());\n            break;\n          case 76:\n            ArrayUtils.removeElement(floatArray, data.consumeFloat());\n            break;\n          case 77:\n            ArrayUtils.removeElement(intArray, data.consumeInt());\n            break;\n          case 78:\n            ArrayUtils.removeElement(longArray, data.consumeLong());\n            break;\n          case 79:\n            ArrayUtils.removeElement(shortArray, data.consumeShort());\n            break;\n          case 80:\n            ArrayUtils.removeElement(strArray, data.consumeString(10));\n            break;\n          case 81:\n            ArrayUtils.subarray(boolArray, 0, 1);\n            break;\n          case 82:\n            ArrayUtils.subarray(byteArray, 0, 1);\n            break;\n          case 83:\n            ArrayUtils.subarray(charArray, 0, 1);\n            break;\n          case 84:\n            ArrayUtils.subarray(doubleArray, 0, 1);\n            break;\n          case 85:\n            ArrayUtils.subarray(floatArray, 0, 1);\n            break;\n          case 86:\n            ArrayUtils.subarray(intArray, 0, 1);\n            break;\n          case 87:\n            ArrayUtils.subarray(longArray, 0, 1);\n            break;\n          case 88:\n            ArrayUtils.subarray(shortArray, 0, 1);\n            break;\n          case 89:\n            ArrayUtils.subarray(strArray, 0, 1);\n            break;\n          case 90:\n            ArrayUtils.contains(boolArray, data.consumeBoolean());\n            break;\n          case 91:\n            ArrayUtils.contains(byteArray, data.consumeByte());\n            break;\n          case 92:\n            ArrayUtils.contains(charArray, data.consumeChar());\n            break;\n          case 93:\n            ArrayUtils.contains(doubleArray, data.consumeDouble());\n            break;\n          case 94:\n            ArrayUtils.contains(floatArray, data.consumeFloat());\n            break;\n          case 95:\n            ArrayUtils.contains(intArray, data.consumeInt());\n            break;\n          case 96:\n            ArrayUtils.contains(longArray, data.consumeLong());\n            break;\n          case 97:\n            ArrayUtils.contains(shortArray, data.consumeShort());\n            break;\n          case 98:\n            ArrayUtils.contains(strArray, data.consumeString(10));\n            break;\n          case 99:\n            ArrayUtils.indexesOf(boolArray, data.consumeBoolean());\n            break;\n          case 100:\n            ArrayUtils.indexesOf(byteArray, data.consumeByte());\n            break;\n          case 101:\n            ArrayUtils.indexesOf(charArray, data.consumeChar());\n            break;\n          case 102:\n            ArrayUtils.indexesOf(doubleArray, data.consumeDouble());\n            break;\n          case 103:\n            ArrayUtils.indexesOf(floatArray, data.consumeFloat());\n            break;\n          case 104:\n            ArrayUtils.indexesOf(intArray, data.consumeInt());\n            break;\n          case 105:\n            ArrayUtils.indexesOf(longArray, data.consumeLong());\n            break;\n          case 106:\n            ArrayUtils.indexesOf(shortArray, data.consumeShort());\n            break;\n          case 107:\n            ArrayUtils.indexesOf(strArray, data.consumeString(10));\n            break;\n          case 108:\n            ArrayUtils.isSorted(boolArray);\n            break;\n          case 109:\n            ArrayUtils.isSorted(byteArray);\n            break;\n          case 110:\n            ArrayUtils.isSorted(charArray);\n            break;\n          case 111:\n            ArrayUtils.isSorted(doubleArray);\n            break;\n          case 112:\n            ArrayUtils.isSorted(floatArray);\n            break;\n          case 113:\n            ArrayUtils.isSorted(intArray);\n            break;\n          case 114:\n            ArrayUtils.isSorted(longArray);\n            break;\n          case 115:\n            ArrayUtils.isSorted(shortArray);\n            break;\n          case 116:\n            ArrayUtils.isSorted(strArray);\n            break;\n          case 117:\n            ArrayUtils.lastIndexOf(boolArray, data.consumeBoolean());\n            break;\n          case 118:\n            ArrayUtils.lastIndexOf(byteArray, data.consumeByte());\n            break;\n          case 119:\n            ArrayUtils.lastIndexOf(charArray, data.consumeChar());\n            break;\n          case 120:\n            ArrayUtils.lastIndexOf(doubleArray, data.consumeDouble());\n            break;\n          case 121:\n            ArrayUtils.lastIndexOf(floatArray, data.consumeFloat());\n            break;\n          case 122:\n            ArrayUtils.lastIndexOf(intArray, data.consumeInt());\n            break;\n          case 123:\n            ArrayUtils.lastIndexOf(longArray, data.consumeLong());\n            break;\n          case 124:\n            ArrayUtils.lastIndexOf(shortArray, data.consumeShort());\n            break;\n          case 125:\n            ArrayUtils.lastIndexOf(strArray, data.consumeString(10));\n            break;\n          case 126:\n            ArrayUtils.removeAllOccurrences(boolArray, data.consumeBoolean());\n            break;\n          case 127:\n            ArrayUtils.removeAllOccurrences(byteArray, data.consumeByte());\n            break;\n          case 128:\n            ArrayUtils.removeAllOccurrences(charArray, data.consumeChar());\n            break;\n          case 129:\n            ArrayUtils.removeAllOccurrences(doubleArray, data.consumeDouble());\n            break;\n          case 130:\n            ArrayUtils.removeAllOccurrences(floatArray, data.consumeFloat());\n            break;\n          case 131:\n            ArrayUtils.removeAllOccurrences(intArray, data.consumeInt());\n            break;\n          case 132:\n            ArrayUtils.removeAllOccurrences(longArray, data.consumeLong());\n            break;\n          case 133:\n            ArrayUtils.removeAllOccurrences(shortArray, data.consumeShort());\n            break;\n          case 134:\n            ArrayUtils.removeAllOccurrences(strArray, data.consumeString(10));\n            break;\n          case 135:\n            ArrayUtils.removeElements(boolArray, boolArray);\n            break;\n          case 136:\n            ArrayUtils.removeElements(byteArray, byteArray);\n            break;\n          case 137:\n            ArrayUtils.removeElements(charArray, charArray);\n            break;\n          case 138:\n            ArrayUtils.removeElements(doubleArray, doubleArray);\n            break;\n          case 139:\n            ArrayUtils.removeElements(floatArray, floatArray);\n            break;\n          case 140:\n            ArrayUtils.removeElements(intArray, intArray);\n            break;\n          case 141:\n            ArrayUtils.removeElements(longArray, longArray);\n            break;\n          case 142:\n            ArrayUtils.removeElements(shortArray, shortArray);\n            break;\n          case 143:\n            ArrayUtils.removeElements(strArray, strArray);\n            break;\n        }\n      }\n    } catch (IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n\n  private static void cleanLargeArray() {\n    if (boolArray.length > 256) {\n      boolArray = new boolean[1];\n    }\n    if (byteArray.length > 256) {\n      byteArray = new byte[1];\n      ArrayFill.fill(byteArray, (byte) 0);\n    }\n    if (charArray.length > 256) {\n      charArray = new char[1];\n      ArrayFill.fill(charArray, (char) 0);\n    }\n    if (doubleArray.length > 256) {\n      doubleArray = new double[1];\n      ArrayFill.fill(doubleArray, 0d);\n    }\n    if (floatArray.length > 256) {\n      floatArray = new float[1];\n      ArrayFill.fill(floatArray, 0f);\n    }\n    if (intArray.length > 256) {\n      intArray = new int[1];\n      ArrayFill.fill(intArray, 0);\n    }\n    if (longArray.length > 256) {\n      longArray = new long[1];\n      ArrayFill.fill(longArray, 0l);\n    }\n    if (shortArray.length > 256) {\n      shortArray = new short[1];\n      ArrayFill.fill(shortArray, (short) 0);\n    }\n    if (strArray.length > 256) {\n      strArray = new String[1];\n      ArrayFill.fill(strArray, \"\");\n    }\n\n    sortArray();\n  }\n\n  private static void sortArray() {\n    ArraySorter.sort(byteArray);\n    ArraySorter.sort(charArray);\n    ArraySorter.sort(doubleArray);\n    ArraySorter.sort(floatArray);\n    ArraySorter.sort(intArray);\n    ArraySorter.sort(longArray);\n    ArraySorter.sort(shortArray);\n    ArraySorter.sort(strArray);\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/BuilderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.builder.Builder;\nimport org.apache.commons.lang3.builder.CompareToBuilder;\nimport org.apache.commons.lang3.builder.DiffBuilder;\nimport org.apache.commons.lang3.builder.EqualsBuilder;\nimport org.apache.commons.lang3.builder.HashCodeBuilder;\nimport org.apache.commons.lang3.builder.ReflectionDiffBuilder;\nimport org.apache.commons.lang3.builder.ReflectionToStringBuilder;\nimport org.apache.commons.lang3.builder.ToStringStyle;\n\n/** This fuzzer targets the methods of the classes in the buidler package */\npublic class BuilderFuzzer {\n  private static final ToStringStyle[] styles = {\n    ToStringStyle.DEFAULT_STYLE, ToStringStyle.JSON_STYLE,\n    ToStringStyle.MULTI_LINE_STYLE, ToStringStyle.NO_CLASS_NAME_STYLE,\n    ToStringStyle.NO_FIELD_NAMES_STYLE, ToStringStyle.SHORT_PREFIX_STYLE,\n    ToStringStyle.SIMPLE_STYLE\n  };\n  private static CompareToBuilder compareTo;\n  private static DiffBuilder diff;\n  private static EqualsBuilder equals;\n  private static HashCodeBuilder hashCode;\n  private static ReflectionDiffBuilder reflectionDiff;\n  private static ReflectionToStringBuilder reflectionToString;\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Builder builder = null;\n      ToStringStyle styleChoice = data.pickValue(styles);\n      Integer choice = data.consumeInt(1, 10);\n      Object obj1 = getRandomObject(data);\n      Object obj2 = getRandomObject(data);\n\n      initializeBuilder(obj1, obj2, styleChoice);\n\n      switch (choice) {\n        case 1:\n          CompareToBuilder.reflectionCompare(obj1, obj2);\n          break;\n        case 2:\n          builder = compareTo.append(Object.class.cast(obj1), Object.class.cast(obj2));\n          break;\n        case 3:\n          builder =\n              diff.append(\n                  data.consumeRemainingAsString(),\n                  Object.class.cast(obj1),\n                  Object.class.cast(obj2));\n          break;\n        case 4:\n          EqualsBuilder.reflectionEquals(obj1, obj2, data.consumeBoolean());\n          break;\n        case 5:\n          builder = equals.append(Object.class.cast(obj1), Object.class.cast(obj2));\n          break;\n        case 6:\n          HashCodeBuilder.reflectionHashCode(obj1, data.consumeBoolean());\n          HashCodeBuilder.reflectionHashCode(obj2, data.consumeBoolean());\n          break;\n        case 7:\n          builder = hashCode.append(Object.class.cast(obj1)).append(Object.class.cast(obj2));\n          break;\n        case 8:\n          builder = reflectionDiff;\n          break;\n        case 9:\n          ReflectionToStringBuilder.toString(obj1, styleChoice);\n          ReflectionToStringBuilder.toString(obj2, styleChoice);\n          break;\n        case 10:\n          builder = reflectionToString.reflectionAppendArray(obj1).reflectionAppendArray(obj2);\n          break;\n      }\n\n      if (builder != null) {\n        builder.build();\n      }\n    } catch (IllegalArgumentException | ClassCastException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeBuilder(Object obj1, Object obj2, ToStringStyle style) {\n    compareTo = new CompareToBuilder();\n    diff = new DiffBuilder(obj1, obj2, style);\n    equals = new EqualsBuilder();\n    hashCode = new HashCodeBuilder();\n    reflectionDiff = new ReflectionDiffBuilder(obj1, obj2, style);\n    reflectionToString = new ReflectionToStringBuilder(obj1, style);\n  }\n\n  private static Object getRandomObject(FuzzedDataProvider data) {\n    Object obj = null;\n\n    switch (data.consumeInt(1, 18)) {\n      case 1:\n        obj = data.consumeBoolean();\n        break;\n      case 2:\n        obj = data.consumeBooleans(data.remainingBytes());\n        break;\n      case 3:\n        obj = data.consumeBytes(data.remainingBytes());\n        break;\n      case 4:\n        obj = data.consumeByte();\n        break;\n      case 5:\n        obj = data.consumeChar();\n        break;\n      case 6:\n        obj = data.consumeString(data.remainingBytes()).toCharArray();\n        break;\n      case 7:\n        obj = data.consumeDouble();\n        break;\n      case 8:\n        double[] doubleArray = new double[data.consumeInt(1, 5)];\n        for (Integer i = 0; i < doubleArray.length; i++) {\n          doubleArray[i] = data.consumeDouble();\n        }\n        obj = doubleArray;\n        break;\n      case 9:\n        obj = data.consumeFloat();\n        break;\n      case 10:\n        float[] floatArray = new float[data.consumeInt(1, 5)];\n        for (Integer i = 0; i < floatArray.length; i++) {\n          floatArray[i] = data.consumeFloat();\n        }\n        obj = floatArray;\n        break;\n      case 11:\n        obj = data.consumeInt();\n        break;\n      case 12:\n        obj = data.consumeInts(data.remainingBytes());\n        break;\n      case 13:\n        obj = data.consumeLong();\n        break;\n      case 14:\n        obj = data.consumeLongs(data.remainingBytes());\n        break;\n      case 15:\n        obj = data.consumeShort();\n        break;\n      case 16:\n        obj = data.consumeShorts(data.remainingBytes());\n        break;\n      case 17:\n        obj = data.consumeString(data.remainingBytes());\n        break;\n      case 18:\n        String[] strArray = new String[data.consumeInt(1, 5)];\n        for (Integer i = 0; i < strArray.length; i++) {\n          strArray[i] = data.consumeString(data.remainingBytes());\n        }\n        obj = strArray;\n        break;\n    }\n\n    return obj;\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/CharUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.CharSequenceUtils;\nimport org.apache.commons.lang3.CharSetUtils;\nimport org.apache.commons.lang3.CharUtils;\n\n/** This fuzzer targets the methods of the Char related utils classes. */\npublic class CharUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 10);\n\n      switch (choice) {\n        case 1:\n          CharSequenceUtils.subSequence(data.consumeRemainingAsString(), 0);\n          break;\n        case 2:\n          CharSequenceUtils.toCharArray(data.consumeRemainingAsString());\n          break;\n        case 3:\n          CharSetUtils.containsAny(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          break;\n        case 4:\n          CharSetUtils.count(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          break;\n        case 5:\n          CharSetUtils.delete(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          break;\n        case 6:\n          CharSetUtils.keep(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          break;\n        case 7:\n          CharSetUtils.squeeze(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          break;\n        case 8:\n          CharUtils.isAsciiAlphanumeric(data.consumeChar());\n          break;\n        case 9:\n          CharUtils.toCharacterObject(data.consumeRemainingAsString());\n          break;\n        case 10:\n          CharUtils.unicodeEscaped(data.consumeChar());\n          break;\n      }\n    } catch (IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/ClassFuzzerBase.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.google.common.reflect.ClassPath;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.stream.Collectors;\n\n/** This is the base class for fuzzers requiring random class type objects */\npublic abstract class ClassFuzzerBase {\n  private static final Integer MAX_CLASS = 64;\n  public static Set<Class> classSet;\n\n  public static void fuzzerInitialize() throws IOException {\n    Set<Class> all = getAllClasses();\n\n    classSet = new HashSet<Class>();\n    classSet.add(Object.class);\n    classSet.add(Throwable.class);\n    classSet.add(String.class);\n    classSet.add(Integer.class);\n    classSet.add(ArrayList.class);\n    classSet.add(Collections.class);\n    classSet.add(HashSet.class);\n    classSet.add(List.class);\n    classSet.add(Set.class);\n    classSet.add(Collectors.class);\n    classSet.add(ClassPath.class);\n\n    if (all != null) {\n      classSet.addAll(all);\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    classSet.clear();\n    classSet = null;\n  }\n\n  public static Set<Class> getAllClasses() throws IOException {\n    ClassLoader loader = ClassLoader.getSystemClassLoader();\n    Set<Class> set = new HashSet<Class>();\n\n    List<ClassPath.ClassInfo> classInfoList =\n        ClassPath.from(loader).getAllClasses().stream().collect(Collectors.toList());\n    Collections.shuffle(classInfoList);\n\n    for (ClassPath.ClassInfo c : classInfoList) {\n      if (set.size() >= MAX_CLASS) {\n        break;\n      }\n\n      Class cls = null;\n      try {\n        cls = c.load();\n      } catch (LinkageError e) {\n        // Ignore\n      }\n\n      if (cls != null) {\n        set.add(cls);\n      }\n    }\n\n    return set;\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/ConversionFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.Conversion;\n\n/** This fuzzer targets the methods of the Conversion class */\npublic class ConversionFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 15);\n      Integer size = data.consumeInt(1, 5);\n      Integer remaining = data.remainingBytes();\n\n      switch (choice) {\n        case 1:\n          Conversion.binaryBeMsb0ToHexDigit(data.consumeBooleans(data.consumeInt(1, 5)));\n          break;\n        case 2:\n          Conversion.binaryToByte(data.consumeBooleans(size), 0, (byte) 0, 0, size);\n          break;\n        case 3:\n          Conversion.binaryToHexDigit(data.consumeBooleans(data.consumeInt(1, 5)));\n          break;\n        case 4:\n          Conversion.binaryToHexDigitMsb0_4bits(data.consumeBooleans(data.consumeInt(1, 5)));\n          break;\n        case 5:\n          Conversion.binaryToInt(data.consumeBooleans(data.consumeInt(1, 5)), 0, 0, 0, size);\n          break;\n        case 6:\n          Conversion.binaryToLong(data.consumeBooleans(data.consumeInt(1, 5)), 0, 0l, 0, size);\n          break;\n        case 7:\n          Conversion.binaryToShort(\n              data.consumeBooleans(data.consumeInt(1, 5)), 0, (short) 0, 0, size);\n          break;\n        case 8:\n          Conversion.byteArrayToInt(data.consumeRemainingAsBytes(), 0, 0, 0, remaining);\n          break;\n        case 9:\n          Conversion.byteArrayToLong(data.consumeRemainingAsBytes(), 0, 0l, 0, remaining);\n          break;\n        case 10:\n          Conversion.byteArrayToShort(data.consumeRemainingAsBytes(), 0, (short) 0, 0, remaining);\n          break;\n        case 11:\n          Conversion.byteArrayToUuid(data.consumeRemainingAsBytes(), 0);\n          break;\n        case 12:\n          Conversion.hexToByte(data.consumeRemainingAsString(), 0, (byte) 0, 0, remaining);\n          break;\n        case 13:\n          Conversion.hexToInt(data.consumeRemainingAsString(), 0, 0, 0, remaining);\n          break;\n        case 14:\n          Conversion.hexToLong(data.consumeRemainingAsString(), 0, 0l, 0, remaining);\n          break;\n        case 15:\n          Conversion.hexToShort(data.consumeRemainingAsString(), 0, (short) 0, 0, remaining);\n          break;\n      }\n    } catch (IllegalArgumentException | NullPointerException | IndexOutOfBoundsException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/DateUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.text.ParseException;\nimport java.util.Calendar;\nimport java.util.Date;\nimport java.util.Locale;\nimport org.apache.commons.lang3.time.DateFormatUtils;\nimport org.apache.commons.lang3.time.DateUtils;\nimport org.apache.commons.lang3.time.DurationFormatUtils;\n\n/** This fuzzer targets the methods of the classes in the time package. */\npublic class DateUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Calendar calendar = Calendar.getInstance();\n      Date date = new Date();\n      Integer choice = data.consumeInt(1, 13);\n\n      switch (choice) {\n        case 1:\n          DateFormatUtils.format(calendar, data.consumeRemainingAsString());\n          break;\n        case 2:\n          DateFormatUtils.formatUTC(date, data.consumeRemainingAsString());\n          break;\n        case 3:\n          DateUtils.parseDate(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          break;\n        case 4:\n          DateUtils.parseDate(\n              data.consumeString(data.remainingBytes()),\n              Locale.getDefault(),\n              data.consumeRemainingAsString());\n          break;\n        case 5:\n          DateUtils.parseDateStrictly(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          break;\n        case 6:\n          DateUtils.parseDateStrictly(\n              data.consumeString(data.remainingBytes()),\n              Locale.getDefault(),\n              data.consumeRemainingAsString());\n          break;\n        case 7:\n          DateUtils.round(date, data.consumeInt());\n          break;\n        case 8:\n          DateUtils.round(calendar, data.consumeInt());\n          break;\n        case 9:\n          DateUtils.truncatedEquals(\n              calendar, DateUtils.truncate(calendar, data.consumeInt()), data.consumeInt());\n          break;\n        case 10:\n          DateUtils.truncatedEquals(\n              date, DateUtils.truncate(date, data.consumeInt()), data.consumeInt());\n          break;\n        case 11:\n          DurationFormatUtils.formatDuration(data.consumeLong(), data.consumeRemainingAsString());\n          break;\n        case 12:\n          DurationFormatUtils.formatDurationWords(\n              data.consumeLong(), data.consumeBoolean(), data.consumeBoolean());\n          break;\n        case 13:\n          DurationFormatUtils.formatPeriod(\n              data.consumeLong(), data.consumeLong(), data.consumeRemainingAsString());\n          break;\n      }\n    } catch (ParseException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\nRUN cat fuzzing/dictionaries/json.dict \\\n    fuzzing/dictionaries/xml.dict \\\n    > $SRC/StringEscapeUtilsFuzzer.dict\n\nRUN mv fuzzing/dictionaries/html.dict $SRC/EscapeHtmlFuzzer.dict\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/EscapeHtmlFuzzer_seed_corpus.zip go-fuzz-corpus/htmltemplate/corpus/* && \\\n    zip -q $SRC/StringEscapeUtilsFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* go-fuzz-corpus/csv/corpus/*\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\n\nRUN git clone --depth 1 https://github.com/apache/commons-lang commons-lang\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/commons-lang\n"
  },
  {
    "path": "projects/apache-commons-lang/EscapeHtmlFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.StringEscapeUtils;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport java.util.regex.*;\n\npublic class EscapeHtmlFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String safeHtml = StringEscapeUtils.escapeHtml3(data.consumeString(50));\n        assert !safeHtml.contains(\"</script\") \n            : new FuzzerSecurityIssueHigh(\"XSS Injection: Output contains </script\");\n        \n        safeHtml = StringEscapeUtils.escapeHtml4(data.consumeString(50));\n        assert !safeHtml.contains(\"</script\") \n            : new FuzzerSecurityIssueHigh(\"XSS Injection: Output contains </script\");\n    }\n}"
  },
  {
    "path": "projects/apache-commons-lang/FractionFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.math.Fraction;\n\n/** This fuzzer targets the methods of the Fraction class in the math package. */\npublic class FractionFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 10);\n      Integer intValue = data.consumeInt();\n      Fraction fraction1 = Fraction.getFraction(data.consumeString(data.remainingBytes()));\n      Fraction fraction2 = Fraction.getFraction(data.consumeRemainingAsString());\n\n      switch (choice) {\n        case 1:\n          fraction1.abs();\n          fraction2.abs();\n          break;\n        case 2:\n          fraction1.add(fraction2);\n          break;\n        case 3:\n          fraction1.compareTo(fraction2);\n          break;\n        case 4:\n          fraction1.divideBy(fraction2);\n          break;\n        case 5:\n          fraction1.invert();\n          fraction2.invert();\n          break;\n        case 6:\n          fraction1.multiplyBy(fraction2);\n          break;\n        case 7:\n          fraction1.pow(intValue);\n          fraction2.pow(intValue);\n          break;\n        case 8:\n          fraction1.reduce();\n          fraction2.reduce();\n          break;\n        case 9:\n          fraction1.subtract(fraction2);\n          break;\n        case 10:\n          fraction1.toProperString();\n          fraction2.toProperString();\n          break;\n      }\n    } catch (NumberFormatException | ArithmeticException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/LocaleUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.LocaleUtils;\n\n/** This fuzzer targets the methods of the LocaleUtils class in the base package. */\npublic class LocaleUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 5);\n\n      switch (choice) {\n        case 1:\n          LocaleUtils.countriesByLanguage(data.consumeRemainingAsString());\n          break;\n        case 2:\n          LocaleUtils.isAvailableLocale(LocaleUtils.toLocale(data.consumeRemainingAsString()));\n          break;\n        case 3:\n          LocaleUtils.isLanguageUndetermined(LocaleUtils.toLocale(data.consumeRemainingAsString()));\n          break;\n        case 4:\n          LocaleUtils.languagesByCountry(data.consumeRemainingAsString());\n          break;\n        case 5:\n          LocaleUtils.localeLookupList(LocaleUtils.toLocale(data.consumeRemainingAsString()));\n          break;\n      }\n    } catch (IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/MathUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.math.IEEE754rUtils;\nimport org.apache.commons.lang3.math.NumberUtils;\n\n/** This fuzzer targets the methods of the classes in the math package. */\npublic class MathUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 5);\n\n      switch (choice) {\n        case 1:\n          float[] floats = new float[data.consumeInt(1, 5)];\n          for (Integer i = 0; i < floats.length; i++) {\n            floats[i] = data.consumeFloat();\n          }\n          IEEE754rUtils.max(floats);\n          IEEE754rUtils.min(floats);\n          break;\n        case 2:\n          double[] doubles = new double[data.consumeInt(1, 5)];\n          for (Integer i = 0; i < doubles.length; i++) {\n            doubles[i] = data.consumeDouble();\n          }\n          IEEE754rUtils.max(doubles);\n          IEEE754rUtils.min(doubles);\n          break;\n        case 3:\n          NumberUtils.createNumber(data.consumeRemainingAsString());\n          break;\n        case 4:\n          NumberUtils.isCreatable(data.consumeRemainingAsString());\n          break;\n        case 5:\n          NumberUtils.isParsable(data.consumeRemainingAsString());\n          break;\n      }\n    } catch (NumberFormatException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/ReflectUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.reflect.ConstructorUtils;\nimport org.apache.commons.lang3.reflect.FieldUtils;\nimport org.apache.commons.lang3.reflect.InheritanceUtils;\nimport org.apache.commons.lang3.reflect.MethodUtils;\nimport org.apache.commons.lang3.reflect.TypeUtils;\n\n/** This fuzzer targets the methods of the Utils classes in the reflect package */\npublic class ReflectUtilsFuzzer extends ClassFuzzerBase {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Randomly pick 2 class objects\n      Class cls1 = data.pickValue(classSet);\n      Class cls2 = data.pickValue(classSet);\n\n      switch (data.consumeInt(1, 28)) {\n        case 1:\n          ConstructorUtils.getAccessibleConstructor(cls1, cls2);\n          break;\n        case 2:\n          ConstructorUtils.getAccessibleConstructor(data.pickValue(cls1.getConstructors()));\n          ConstructorUtils.getAccessibleConstructor(data.pickValue(cls2.getConstructors()));\n          break;\n        case 3:\n          ConstructorUtils.getMatchingAccessibleConstructor(cls1, cls2);\n          break;\n        case 4:\n          ConstructorUtils.invokeConstructor(cls1, cls2);\n          break;\n        case 5:\n          ConstructorUtils.invokeExactConstructor(cls1, cls2);\n          break;\n        case 6:\n          FieldUtils.getAllFields(cls1);\n          FieldUtils.getAllFields(cls2);\n          break;\n        case 7:\n          FieldUtils.getDeclaredField(cls1, data.consumeRemainingAsString());\n          break;\n        case 8:\n          FieldUtils.getField(cls1, data.consumeRemainingAsString());\n          break;\n        case 9:\n          FieldUtils.readDeclaredStaticField(cls1, data.consumeRemainingAsString());\n          break;\n        case 10:\n          FieldUtils.readDeclaredStaticField(cls1, data.consumeRemainingAsString());\n          break;\n        case 11:\n          FieldUtils.readField(cls1, data.consumeRemainingAsString());\n          break;\n        case 12:\n          FieldUtils.readStaticField(cls1, data.consumeRemainingAsString());\n          break;\n        case 13:\n          InheritanceUtils.distance(cls1, cls2);\n          break;\n        case 14:\n          MethodUtils.getAccessibleMethod(data.pickValue(cls1.getMethods()));\n          MethodUtils.getAccessibleMethod(data.pickValue(cls2.getMethods()));\n          break;\n        case 15:\n          MethodUtils.getAccessibleMethod(cls1, data.consumeRemainingAsString(), cls2);\n          break;\n        case 16:\n          MethodUtils.getMatchingAccessibleMethod(cls1, data.consumeRemainingAsString(), cls2);\n          break;\n        case 17:\n          MethodUtils.getMatchingMethod(cls1, data.consumeRemainingAsString(), cls2);\n          break;\n        case 18:\n          MethodUtils.invokeExactStaticMethod(cls1, data.consumeRemainingAsString(), cls2);\n          break;\n        case 19:\n          MethodUtils.invokeStaticMethod(cls1, data.consumeRemainingAsString(), cls2);\n          break;\n        case 20:\n          TypeUtils.containsTypeVariables(data.pickValue(cls1.getTypeParameters()));\n          TypeUtils.containsTypeVariables(data.pickValue(cls2.getTypeParameters()));\n          break;\n        case 21:\n          TypeUtils.equals(\n              data.pickValue(cls1.getTypeParameters()), data.pickValue(cls2.getTypeParameters()));\n          break;\n        case 22:\n          TypeUtils.genericArrayType(data.pickValue(cls1.getTypeParameters()));\n          TypeUtils.genericArrayType(data.pickValue(cls2.getTypeParameters()));\n          break;\n        case 23:\n          TypeUtils.getArrayComponentType(data.pickValue(cls1.getTypeParameters()));\n          TypeUtils.getArrayComponentType(data.pickValue(cls2.getTypeParameters()));\n          break;\n        case 24:\n          TypeUtils.getTypeArguments(data.pickValue(cls1.getTypeParameters()), cls1);\n          TypeUtils.getTypeArguments(data.pickValue(cls2.getTypeParameters()), cls2);\n          break;\n        case 25:\n          TypeUtils.isArrayType(data.pickValue(cls1.getTypeParameters()));\n          TypeUtils.isArrayType(data.pickValue(cls2.getTypeParameters()));\n          break;\n        case 26:\n          TypeUtils.isAssignable(\n              data.pickValue(cls1.getTypeParameters()), data.pickValue(cls2.getTypeParameters()));\n          break;\n        case 27:\n          TypeUtils.getTypeArguments(\n              TypeUtils.parameterize(cls1, data.pickValue(cls1.getTypeParameters())));\n          TypeUtils.getTypeArguments(\n              TypeUtils.parameterize(cls2, data.pickValue(cls2.getTypeParameters())));\n          break;\n        case 28:\n          TypeUtils.wrap(cls1);\n          TypeUtils.wrap(cls2);\n          break;\n      }\n    } catch (ReflectiveOperationException\n        | IllegalArgumentException\n        | IllegalStateException\n        | LinkageError e) {\n      // Known exception\n    } catch (NullPointerException e) {\n      // Some methods throw NullPointerException\n      if (!isExpectedNullPointerException(e)) {\n        // Throw unexpected NullPointerException\n        throw e;\n      }\n    }\n  }\n\n  private static Boolean isExpectedNullPointerException(NullPointerException e) {\n    final String[] expectedMessages = {\"Cannot locate\", \"Cannot invoke\"};\n\n    Boolean result = false;\n    for (String message : expectedMessages) {\n      result |= e.getMessage().contains(message);\n    }\n\n    return result;\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/SerializationUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.SerializationException;\nimport org.apache.commons.lang3.SerializationUtils;\n\n/** This fuzzer targets the methods of the SerializationUtils class in the base package. */\npublic class SerializationUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 4);\n      byte[] byteArray = data.consumeRemainingAsBytes();\n\n      switch (choice) {\n        case 1:\n          SerializationUtils.clone(byteArray);\n          break;\n        case 2:\n          SerializationUtils.roundtrip(byteArray);\n          break;\n        case 3:\n          SerializationUtils.serialize(byteArray);\n          break;\n        case 4:\n          SerializationUtils.deserialize(byteArray);\n          break;\n      }\n    } catch (SerializationException | NullPointerException | ClassCastException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/StringEscapeUtilsFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.StringEscapeUtils;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport java.util.regex.*;\n\npublic class StringEscapeUtilsFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Pattern escapeAllQuotePattern = Pattern.compile(\"[^\\\\\\\\]\\\\'|[^\\\\\\\\]\\\\\\\"\");\n        Pattern escapeDoubleQuotePattern = Pattern.compile(\"[^\\\\\\\\]\\\\\\\"\");\n        Pattern escapeCsvPattern = Pattern.compile(Pattern.quote(\"[^\\\\\\\"],|,[^\\\\\\\"]|[^\\\\\\\"]\\\\n|\\\\n[^\\\\\\\"]\"));\n\n        String safeJson = StringEscapeUtils.escapeJson(data.consumeString(50));\n        assert !escapeDoubleQuotePattern.matcher(safeJson).matches() : new FuzzerSecurityIssueHigh(\"JSON double quote injection\");\n\n        String safeJava = StringEscapeUtils.escapeJava(data.consumeString(50));\n        assert !escapeDoubleQuotePattern.matcher(safeJava).matches() : new FuzzerSecurityIssueHigh(\"Java double quote injection\");\n\n        String safeEcma = StringEscapeUtils.escapeEcmaScript(data.consumeString(50));\n        assert !escapeAllQuotePattern.matcher(safeEcma).matches() : new FuzzerSecurityIssueHigh(\"Ecma quote injection\");\n\n        String safeCsv = StringEscapeUtils.escapeCsv(data.consumeString(50));\n        assert !escapeCsvPattern.matcher(safeCsv).matches() : new FuzzerSecurityIssueHigh(\"CSV injection\");\n    }\n}"
  },
  {
    "path": "projects/apache-commons-lang/StringUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.commons.lang3.Validate;\n\n/** This fuzzer targets the methods of the StringUtils class in the base package. */\npublic class StringUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 61);\n      String string1 = data.consumeString(data.remainingBytes());\n      String string2 = data.consumeRemainingAsString();\n\n      switch (choice) {\n        case 1:\n          StringUtils.abbreviate(string1, string1.length());\n          break;\n        case 2:\n          StringUtils.abbreviateMiddle(string1, string2, string1.length());\n          break;\n        case 3:\n          StringUtils.appendIfMissing(string1, string2);\n          break;\n        case 4:\n          StringUtils.appendIfMissingIgnoreCase(string1, string2);\n          break;\n        case 5:\n          StringUtils.capitalize(string1);\n          break;\n        case 6:\n          StringUtils.center(string1, string1.length());\n          break;\n        case 7:\n          StringUtils.chomp(string1);\n          break;\n        case 8:\n          StringUtils.chop(string1);\n          break;\n        case 9:\n          StringUtils.compare(string1, string2);\n          break;\n        case 10:\n          StringUtils.compareIgnoreCase(string1, string2);\n          break;\n        case 11:\n          StringUtils.contains(string1, string2);\n          break;\n        case 12:\n          StringUtils.containsAny(string1, string2);\n          break;\n        case 13:\n          StringUtils.containsAnyIgnoreCase(string1, string2);\n          break;\n        case 14:\n          StringUtils.containsNone(string1, string2);\n          break;\n        case 15:\n          StringUtils.containsOnly(string1, string2);\n          break;\n        case 16:\n          StringUtils.containsWhitespace(string1);\n          break;\n        case 17:\n          StringUtils.countMatches(string1, string2);\n          break;\n        case 18:\n          StringUtils.deleteWhitespace(string1);\n          break;\n        case 19:\n          StringUtils.difference(string1, string2);\n          break;\n        case 20:\n          StringUtils.endsWith(string1, string2);\n          break;\n        case 21:\n          StringUtils.endsWithAny(string1, string2);\n          break;\n        case 22:\n          StringUtils.endsWithIgnoreCase(string1, string2);\n          break;\n        case 23:\n          StringUtils.equals(string1, string2);\n          break;\n        case 24:\n          StringUtils.equalsAny(string1, string2);\n          break;\n        case 25:\n          StringUtils.equalsAnyIgnoreCase(string1, string2);\n          break;\n        case 26:\n          StringUtils.equalsIgnoreCase(string1, string2);\n          break;\n        case 27:\n          StringUtils.getCommonPrefix(string1, string2);\n          break;\n        case 28:\n          StringUtils.getDigits(string1);\n          break;\n        case 29:\n          StringUtils.indexOf(string1, string2);\n          break;\n        case 30:\n          StringUtils.indexOfAny(string1, string2);\n          break;\n        case 31:\n          StringUtils.indexOfAnyBut(string1, string2);\n          break;\n        case 32:\n          StringUtils.indexOfDifference(string1, string2);\n          break;\n        case 33:\n          StringUtils.indexOfIgnoreCase(string1, string2);\n          break;\n        case 34:\n          StringUtils.isAllBlank(string1, string2);\n          break;\n        case 35:\n          StringUtils.isAllEmpty(string1, string2);\n          break;\n        case 36:\n          StringUtils.isAllLowerCase(string1);\n          break;\n        case 37:\n          StringUtils.isAllUpperCase(string1);\n          break;\n        case 38:\n          StringUtils.isMixedCase(string1);\n          break;\n        case 39:\n          if (string2.length() > 0) {\n            StringUtils.join(string1.toCharArray(), string2.toCharArray()[0], 0, string1.length());\n          }\n          break;\n        case 40:\n          if (string2.length() > 0) {\n            StringUtils.joinWith(string1, string2.toCharArray());\n          }\n          break;\n        case 41:\n          StringUtils.lastIndexOf(string1, string2);\n          break;\n        case 42:\n          StringUtils.lastIndexOfAny(string1, string2);\n          break;\n        case 43:\n          StringUtils.lastIndexOfIgnoreCase(string1, string2);\n          break;\n        case 44:\n          StringUtils.left(string1, string1.length());\n          break;\n        case 45:\n          StringUtils.leftPad(string1, string1.length() + 10);\n          break;\n        case 46:\n          StringUtils.mid(string1, 0, string1.length());\n          break;\n        case 47:\n          StringUtils.normalizeSpace(string1);\n          break;\n        case 48:\n          StringUtils.overlay(string1, string2, 0, string1.length());\n          break;\n        case 49:\n          StringUtils.right(string1, string1.length());\n          break;\n        case 50:\n          StringUtils.rightPad(string1, string1.length() + 10);\n          break;\n        case 51:\n          StringUtils.rotate(string1, string1.length());\n          break;\n        case 52:\n          StringUtils.split(string1);\n          break;\n        case 53:\n          StringUtils.splitByCharacterType(string1);\n          break;\n        case 54:\n          StringUtils.splitByCharacterTypeCamelCase(string1);\n          break;\n        case 55:\n          StringUtils.splitByWholeSeparator(string1, string2);\n          break;\n        case 56:\n          StringUtils.splitPreserveAllTokens(string1);\n          break;\n        case 57:\n          StringUtils.swapCase(string1);\n          break;\n        case 58:\n          StringUtils.truncate(string1, string1.length());\n          break;\n        case 59:\n          StringUtils.uncapitalize(string1);\n          break;\n        case 60:\n          StringUtils.wrap(string1, string2);\n          break;\n        case 61:\n          // TODO verify if regex injection is real\n          // Validate.matchesPattern(string1, string2);\n          break;\n      }\n    } catch (IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/apache-commons-lang/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true -DskipTests -Drat.ignoreErrors=true\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/commons-lang3-$CURRENT_VERSION.jar\" \"$OUT/commons-lang.jar\"\n\nmkdir -p $OUT/dependency\nwget -O $OUT/dependency/guava.jar https://repo1.maven.org/maven2/com/google/guava/guava/32.1.3-jre/guava-32.1.3-jre.jar\n\n# Compile ClassFuzzerBase\njavac -cp $OUT/dependency/guava.jar $SRC/ClassFuzzerBase.java\njar cvf $OUT/class-fuzzer-base.jar -C $SRC ClassFuzzerBase.class\n\nALL_JARS=\"commons-lang.jar class-fuzzer-base.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$OUT/dependency/guava.jar:$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir/dependency/guava.jar:\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-lang/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/apache/commons-lang\nlanguage: jvm\nmain_repo: https://github.com/apache/commons-lang.git\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nsanitizers:\n- address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/apache-commons-logging/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\n\nRUN git clone https://github.com/apache/commons-logging\nCOPY build.sh $SRC/\nCOPY *.java *.xml $SRC/\nCOPY Package $SRC/Package/\nWORKDIR $SRC/commons-logging\n"
  },
  {
    "path": "projects/apache-commons-logging/LoggingBasicFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\n\npublic class LoggingBasicFuzzer {\n\tpublic LoggingBasicFuzzer(FuzzedDataProvider data) {\n\t}\n\t\n\tvoid runTest(FuzzedDataProvider data) {\n\t\tLog logger = LogFactory.getLog(LoggingBasicFuzzer.class);\n\n\t\tlogger.isDebugEnabled();\n\t\tlogger.isErrorEnabled();\n\t\tlogger.isFatalEnabled();\n\t\tlogger.isInfoEnabled();\n\t\tlogger.isTraceEnabled();\n\t\tlogger.isWarnEnabled();\n\t\tlogger.debug(data.consumeString(10));\n\t\tlogger.error(data.consumeString(10));\n\t\tlogger.fatal(data.consumeString(10));\n\t\tlogger.info(data.consumeString(10));\n\t\tlogger.warn(data.consumeString(10));\n\t\tlogger.debug(data.consumeString(10), new NullPointerException());\n\t\tlogger.error(data.consumeString(10), new NullPointerException());\n\t\tlogger.fatal(data.consumeString(10), new NullPointerException());\n\t\tlogger.info(data.consumeString(10), new NullPointerException());\n\t\tlogger.warn(data.consumeString(10), new NullPointerException());\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tLoggingBasicFuzzer testClosure = new LoggingBasicFuzzer(data);\n\t\ttestClosure.runTest(data);\n\t}\n}\n"
  },
  {
    "path": "projects/apache-commons-logging/Package/MyAppender.java",
    "content": "package Package;\n\nimport java.time.Instant;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentMap;\n\nimport org.apache.logging.log4j.Level;\nimport org.apache.logging.log4j.core.Appender;\nimport org.apache.logging.log4j.core.Core;\nimport org.apache.logging.log4j.core.Filter;\nimport org.apache.logging.log4j.core.LogEvent;\nimport org.apache.logging.log4j.core.appender.AbstractAppender;\nimport org.apache.logging.log4j.core.config.plugins.Plugin;\nimport org.apache.logging.log4j.core.config.plugins.PluginAttribute;\nimport org.apache.logging.log4j.core.config.plugins.PluginElement;\nimport org.apache.logging.log4j.core.config.plugins.PluginFactory;\n\n@Plugin(\n  name = \"MyAppender\", \n  category = Core.CATEGORY_NAME, \n  elementType = Appender.ELEMENT_TYPE)\npublic class MyAppender extends AbstractAppender {\n    public MyAppender(String name, Filter filter) {\n        super(name, filter, null);\n    }\n\n    @PluginFactory\n    public static MyAppender createAppender(\n      @PluginAttribute(\"name\") String name, \n      @PluginElement(\"Filter\") Filter filter) {\n        return new MyAppender(name, filter);\n    }\n\n    @Override\n    public void append(LogEvent event) {\n    }\n}\n"
  },
  {
    "path": "projects/apache-commons-logging/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests -Drat.ignoreErrors=true\"\n\nALL_JARS=\"\"\n\npushd \"${SRC}/commons-logging\"\n\t$MVN package $MAVEN_ARGS\n\tCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n\t\t-Dexpression=project.version -q -DforceStdout)\n\tcp -v target/commons-logging-${CURRENT_VERSION}.jar \"$OUT/commons-logging.jar\"\n\tALL_JARS=\"${ALL_JARS} commons-logging.jar\"\npopd\n\nLOG4J_VERSION=$(curl -s 'https://api.github.com/repos/apache/logging-log4j2/tags?per_page=20' | jq -r '.[].name' | grep -E '^rel/2\\.[0-9]+\\.[0-9]+$' | head -1 | sed 's/^rel\\///')\ncurl \"https://archive.apache.org/dist/logging/log4j/$LOG4J_VERSION/apache-log4j-$LOG4J_VERSION-bin.zip\" -o apache-log4j-bin.zip\nunzip -q -o apache-log4j-bin.zip -d $SRC/apache-log4j-$LOG4J_VERSION-bin\nunlink apache-log4j-bin.zip\n\nfor jarFile in ${SRC}/apache-log4j-$LOG4J_VERSION-bin/log4j-api-$LOG4J_VERSION.jar ${SRC}/apache-log4j-$LOG4J_VERSION-bin/log4j-core-$LOG4J_VERSION.jar ${SRC}/apache-log4j-$LOG4J_VERSION-bin/log4j-1.2-api-$LOG4J_VERSION.jar ; do\n\tcp -v ${jarFile} \"$OUT/$(basename ${jarFile})\"\n\tALL_JARS=\"${ALL_JARS} $(basename ${jarFile})\"\ndone\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java $SRC/Package/*.java\nmkdir -p $OUT/Package\ncp -vr $SRC/Package/*.class $OUT/Package\ncp -v $SRC/*.class $OUT/\ncp -v $SRC/*.xml $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-logging/log4j2-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Configuration status=\"trace\"  packages=\"Package\" strict=\"true\">\n\t<Appenders>\n\t\t<MyAppender name=\"x\" />\n\t</Appenders>\n\t<Loggers>\n\t\t<Root level=\"trace\">\n\t\t\t<AppenderRef ref=\"x\" />\n\t\t</Root>\n\t</Loggers>\n</Configuration>"
  },
  {
    "path": "projects/apache-commons-logging/project.yaml",
    "content": "homepage: https://commons.apache.org/proper/commons-collections/\nlanguage: jvm\nmain_repo: https://gitbox.apache.org/repos/asf/commons-logging.git\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-math/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN=$SRC/maven/apache-maven-3.9.9/bin/mvn\n\n# Math\nRUN git clone --depth 1 https://github.com/apache/commons-math.git\n\n# Copy build script and all fuzzers\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/\n\n"
  },
  {
    "path": "projects/apache-commons-math/MathClusteringFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.ArrayList;\nimport org.apache.commons.math4.legacy.exception.ConvergenceException;\nimport org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;\nimport org.apache.commons.math4.legacy.exception.NotPositiveException;\nimport org.apache.commons.math4.legacy.ml.clustering.Clusterer;\nimport org.apache.commons.math4.legacy.ml.clustering.DBSCANClusterer;\nimport org.apache.commons.math4.legacy.ml.clustering.DoublePoint;\nimport org.apache.commons.math4.legacy.ml.clustering.ElkanKMeansPlusPlusClusterer;\nimport org.apache.commons.math4.legacy.ml.clustering.FuzzyKMeansClusterer;\nimport org.apache.commons.math4.legacy.ml.clustering.KMeansPlusPlusClusterer;\nimport org.apache.commons.math4.legacy.ml.clustering.MultiKMeansPlusPlusClusterer;\n\n\npublic class MathClusteringFuzzer {\n\n\tprotected int    m_clustersToFind;\n\tprotected int    m_iterations;\n\tprotected double m_fuzziness;\n\tprotected int    m_multiKMeansMaxTrials;\n\tprotected double m_dbscanMaxRadius;\n\tprotected int    m_dbscanMinPoints;\n\tprotected ArrayList<DoublePoint> m_data;\n\n\tpublic MathClusteringFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tm_clustersToFind = fuzzedDataProvider.consumeInt(1, 10); // let's be \"sane\" ... for the beginning\n\t\tm_iterations = fuzzedDataProvider.consumeInt(1, 10000); // again\n\t\tm_fuzziness = fuzzedDataProvider.consumeRegularDouble();\n\t\tm_multiKMeansMaxTrials = fuzzedDataProvider.consumeInt(0, 10);\n\t\tm_dbscanMaxRadius = fuzzedDataProvider.consumeRegularDouble();\n\t\tm_dbscanMinPoints = fuzzedDataProvider.consumeInt();\n\n\t\tint dimension = 2;\n\t\tint inputLength = (fuzzedDataProvider.remainingBytes() / 8 /*sizeof(double)*/) / dimension;\n\t\tif (inputLength < 1) {\n\t\t\tinputLength = 1;\n\t\t}\n\n\t\tm_data = new ArrayList<DoublePoint>(inputLength);\n\t\tfor (int i = 0; i < inputLength; ++i) {\n\t\t\tdouble dataPoint[] = new double[dimension];\n\t\t\tfor (int n = 0; n < dataPoint.length; ++n) {\n\t\t\t\tdataPoint[n] = fuzzedDataProvider.consumeRegularDouble();\n\t\t\t}\n\t\t\tm_data.add( new DoublePoint(dataPoint) );\n\t\t}\n\t}\n\n\tvoid runDBSCAN() {\n\t\ttry {\n\t\t\tDBSCANClusterer<DoublePoint> clusterer = new DBSCANClusterer<DoublePoint>(m_dbscanMaxRadius, m_dbscanMinPoints);\n\t\t\tclusterer.cluster(m_data);\n\t\t} catch (NotPositiveException ex) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t}\n\n\tvoid runElkanKMeansPlusPlus() {\n\t\ttry {\n\t\t\tElkanKMeansPlusPlusClusterer<DoublePoint> clusterer = new ElkanKMeansPlusPlusClusterer<DoublePoint>(m_clustersToFind);\n\t\t\tclusterer.cluster(m_data);\n\t\t} catch (MathIllegalArgumentException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (ConvergenceException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (IllegalArgumentException ex) {\n\t\t}\n\t}\n\n\tvoid runKMeansPlusPlus() {\n\t\ttry {\n\t\t\tKMeansPlusPlusClusterer<DoublePoint> clusterer = new KMeansPlusPlusClusterer<DoublePoint>(m_clustersToFind, m_iterations);\n\t\t\tclusterer.cluster(m_data);\n\t\t} catch (MathIllegalArgumentException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (ConvergenceException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (IllegalArgumentException ex) {\n\t\t}\n\t}\n\n\tvoid runFuzzyKMeans() {\n\t\ttry {\n\t\t\tFuzzyKMeansClusterer<DoublePoint> clusterer = new FuzzyKMeansClusterer<DoublePoint>(m_clustersToFind, m_fuzziness);\n\t\t\tclusterer.cluster(m_data);\n\t\t} catch (MathIllegalArgumentException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (ConvergenceException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (IllegalArgumentException ex) {\n\t\t}\n\t}\n\n\tvoid runMultiKMeans() {\n\t\ttry {\n\t\t\tKMeansPlusPlusClusterer<DoublePoint> kmeans = new KMeansPlusPlusClusterer<DoublePoint>(m_clustersToFind, m_iterations);\n\t\t\tMultiKMeansPlusPlusClusterer<DoublePoint> clusterer = new MultiKMeansPlusPlusClusterer<DoublePoint>(kmeans, m_multiKMeansMaxTrials);\n\t\t\tclusterer.cluster(m_data);\n\t\t} catch (MathIllegalArgumentException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (ConvergenceException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch (IllegalArgumentException ex) {\n\t\t}\n\t}\n\n\n\n\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tMathClusteringFuzzer testClosure = new MathClusteringFuzzer(data);\n\t\t\n\t\ttestClosure.runDBSCAN();\n\t\ttestClosure.runKMeansPlusPlus();\n\t\ttestClosure.runFuzzyKMeans();\n\t\ttestClosure.runElkanKMeansPlusPlus();\n\t\ttestClosure.runMultiKMeans();\n\t}\n}\n\n"
  },
  {
    "path": "projects/apache-commons-math/MathDistanceMeasureFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.ArrayList;\nimport org.apache.commons.math4.legacy.exception.DimensionMismatchException;\nimport org.apache.commons.math4.legacy.ml.distance.CanberraDistance;\nimport org.apache.commons.math4.legacy.ml.distance.ChebyshevDistance;\nimport org.apache.commons.math4.legacy.ml.distance.EarthMoversDistance;\nimport org.apache.commons.math4.legacy.ml.distance.EuclideanDistance;\nimport org.apache.commons.math4.legacy.ml.distance.ManhattanDistance;\n\npublic class MathDistanceMeasureFuzzer {\n\tdouble m_x0[];\n\tdouble m_x1[];\n\n\tpublic MathDistanceMeasureFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tm_x0 = new double[fuzzedDataProvider.consumeInt(1,100)];\n\t\tm_x1 = new double[fuzzedDataProvider.consumeInt(1,100)];\n\t\tfor (int i = 0; i < m_x0.length; ++i) {\n\t\t\tm_x0[i] = fuzzedDataProvider.consumeRegularDouble();\n\t\t}\n\t\tfor (int i = 0; i < m_x1.length; ++i) {\n\t\t\tm_x1[i] = fuzzedDataProvider.consumeRegularDouble();\n\t\t}\n\t}\n\n\tvoid computeDistances() {\n\t\ttry {\n\t\t\tnew CanberraDistance().compute(m_x0, m_x1);\n\t\t\tnew ChebyshevDistance().compute(m_x0, m_x1);\n\t\t\tnew EarthMoversDistance().compute(m_x0, m_x1);\n\t\t\tnew EuclideanDistance().compute(m_x0, m_x1);\n\t\t\tnew ManhattanDistance().compute(m_x0, m_x1);\n\t\t} catch (DimensionMismatchException ex) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tMathDistanceMeasureFuzzer testClosure = new MathDistanceMeasureFuzzer(data);\n\t\ttestClosure.computeDistances();\n\t}\n}"
  },
  {
    "path": "projects/apache-commons-math/MathSimplexSolverFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.ArrayList;\nimport org.apache.commons.math4.legacy.exception.DimensionMismatchException;\nimport org.apache.commons.math4.legacy.exception.TooManyIterationsException;\nimport org.apache.commons.math4.legacy.optim.linear.NoFeasibleSolutionException;\nimport org.apache.commons.math4.legacy.optim.linear.UnboundedSolutionException;\nimport org.apache.commons.math4.legacy.optim.PointValuePair;\nimport org.apache.commons.math4.legacy.optim.linear.LinearConstraint;\nimport org.apache.commons.math4.legacy.optim.linear.LinearConstraintSet;\nimport org.apache.commons.math4.legacy.optim.linear.LinearObjectiveFunction;\nimport org.apache.commons.math4.legacy.optim.linear.NonNegativeConstraint;\nimport org.apache.commons.math4.legacy.optim.linear.PivotSelectionRule;\nimport org.apache.commons.math4.legacy.optim.linear.SimplexSolver;\nimport org.apache.commons.math4.legacy.optim.linear.Relationship;\nimport org.apache.commons.math4.legacy.optim.nonlinear.scalar.GoalType;\nimport org.apache.commons.math4.legacy.optim.MaxIter;\n\npublic class MathSimplexSolverFuzzer {\n\n\tprotected LinearObjectiveFunction m_function;\n\tprotected ArrayList<LinearConstraint> m_constraints;\n\tprotected GoalType m_goal;\n\tprotected PivotSelectionRule m_pivotSelectionRule;\n\n\n\tdouble[] coefficients(FuzzedDataProvider fuzzedDataProvider) {\n\t\treturn new double[]{ fuzzedDataProvider.consumeRegularDouble(), fuzzedDataProvider.consumeRegularDouble(), fuzzedDataProvider.consumeRegularDouble() };\n\t}\n\n\tdouble rightHandSide(FuzzedDataProvider fuzzedDataProvider) {\n\t\treturn fuzzedDataProvider.consumeRegularDouble();\n\t}\n\n\tRelationship relation(FuzzedDataProvider fuzzedDataProvider) {\n\t\tRelationship available[] = { Relationship.EQ, Relationship.GEQ, Relationship.LEQ };\n\t\treturn available[fuzzedDataProvider.consumeInt(0, available.length-1)];\n\t}\n\n\tGoalType goalType(FuzzedDataProvider fuzzedDataProvider) {\n\t\tGoalType available[] = { GoalType.MAXIMIZE, GoalType.MINIMIZE };\n\t\treturn available[fuzzedDataProvider.consumeInt(0, available.length-1)];\n\t}\n\n\tPivotSelectionRule pivotSelectionRule(FuzzedDataProvider fuzzedDataProvider) {\n\t\tPivotSelectionRule available[] = { PivotSelectionRule.DANTZIG, PivotSelectionRule.BLAND };\n\t\treturn available[fuzzedDataProvider.consumeInt(0, available.length-1)];\n\t}\n\n\tpublic MathSimplexSolverFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\n\t\tm_function = new LinearObjectiveFunction(coefficients(fuzzedDataProvider), 0);\n\t\tm_constraints = new ArrayList<>();\n\t\t\n\t\tm_constraints.add(new LinearConstraint(coefficients(fuzzedDataProvider), relation(fuzzedDataProvider), rightHandSide(fuzzedDataProvider)));\n\t\tm_constraints.add(new LinearConstraint(coefficients(fuzzedDataProvider), relation(fuzzedDataProvider), rightHandSide(fuzzedDataProvider)));\n\t\tm_constraints.add(new LinearConstraint(coefficients(fuzzedDataProvider), relation(fuzzedDataProvider), rightHandSide(fuzzedDataProvider)));\n\n\t\tm_goal = goalType(fuzzedDataProvider);\n\t\tm_pivotSelectionRule = pivotSelectionRule(fuzzedDataProvider);\n\t}\n\n\tvoid solve() {\n\t\tSimplexSolver solver = new SimplexSolver();\n\t\ttry {\n\t\t\tsolver.optimize(\n\t\t\t\tnew MaxIter(1000),\n\t\t\t\tm_function,\n\t\t\t\tnew LinearConstraintSet(m_constraints),\n\t\t\t\tm_goal,\n\t\t\t\tnew NonNegativeConstraint(true),\n\t\t\t\tm_pivotSelectionRule\n\t\t\t);\n\t\t} catch(TooManyIterationsException ex) {\n\t\t\t/* documented, ignore */\n\t\t} catch(NoFeasibleSolutionException ex) {\n\t\t\t/* documented? */\n\t\t} catch(UnboundedSolutionException ex) {\n\t\t\t/* documented? */\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tMathSimplexSolverFuzzer testClosure = new MathSimplexSolverFuzzer(data);\n\t\ttestClosure.solve();\n\t}\n}\n"
  },
  {
    "path": "projects/apache-commons-math/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd \"$SRC/commons-math\"\n  MAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15 -Dmoditect.skip=true -pl commons-math-legacy -am\"\n  $MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\n  CURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n   -Dexpression=project.version -q -DforceStdout)\n  cp \"commons-math-legacy/target/commons-math4-legacy-$CURRENT_VERSION.jar\" $OUT/commons-math.jar\npopd\n\nALL_JARS=\"commons-math.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/apache-commons-math/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://commons.apache.org\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/commons-math\"\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@commons.apache.org\"\n  - \"brunodepaulak@gmail.com\"\n  - \"peteralfredlee@gmail.com\"\n  - \"boards@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-net/Base64Fuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.net.util.Base64;\n\npublic class Base64Fuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try{\n            Base64 b64 = new Base64(data.consumeInt(), data.consumeBytes(1000), data.consumeBoolean());\n            b64.encode(data.consumeBytes(4000));\n            b64.decode(data.consumeBytes(4000));\n        }\n        catch (java.lang.IllegalArgumentException e) {}\n    } \n}"
  },
  {
    "path": "projects/apache-commons-net/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget \n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/apache/commons-net.git commons-net\nWORKDIR commons-net\nCOPY build.sh $SRC/\nCOPY *.java $SRC/"
  },
  {
    "path": "projects/apache-commons-net/MLSxEntryParserFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.net.ftp.parser.*;\nimport org.apache.commons.net.ftp.FTPFileEntryParser;\n\npublic class MLSxEntryParserFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try{\n            FTPFileEntryParser parser = MLSxEntryParser.getInstance();\n            parser.parseFTPEntry(data.consumeRemainingAsString());\n        }\n        catch (java.lang.NumberFormatException e) {}\n        catch (java.lang.StringIndexOutOfBoundsException e) {}\n    } \n}"
  },
  {
    "path": "projects/apache-commons-net/NTFTPEntryParserFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.commons.net.ftp.FTPFileEntryParser;\nimport org.apache.commons.net.ftp.parser.NTFTPEntryParser;\n\npublic class NTFTPEntryParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      FTPFileEntryParser parser = new NTFTPEntryParser();\n      parser.parseFTPEntry(data.consumeRemainingAsString());\n    }\n    catch (java.lang.NumberFormatException e) {}\n  }\n}"
  },
  {
    "path": "projects/apache-commons-net/OS400FTPEntryParserFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.net.ftp.FTPFileEntryParser;\nimport org.apache.commons.net.ftp.parser.OS400FTPEntryParser;\n\npublic class OS400FTPEntryParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    FTPFileEntryParser parser = new OS400FTPEntryParser();\n    parser.parseFTPEntry(data.consumeRemainingAsString());\n  }\n}"
  },
  {
    "path": "projects/apache-commons-net/TelnetOptionFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.net.telnet.TelnetOption;\n\npublic class TelnetOptionFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try{\n            TelnetOption.getOption(data.consumeInt());\n            TelnetOption.isValidOption(data.consumeInt());\n        }\n        catch (java.lang.ArrayIndexOutOfBoundsException e) {}\n    }\n}"
  },
  {
    "path": "projects/apache-commons-net/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN clean package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./ -name \"commons-net-$CURRENT_VERSION.jar\" -exec mv {} $OUT/commons-net.jar \\;\n\nALL_JARS=\"commons-net.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-net/project.yaml",
    "content": "homepage: \"https://github.com/apache/commons-net\"\nlanguage: jvm\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nauto_ccs:\n  - \"security@commons.apache.org\"\n  - \"irali@google.com\"\nmain_repo: \"https://github.com/apache/commons-net.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/apache-commons-text/.gitignore",
    "content": "project-parent/apache-commons-text\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/apache-commons-text/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.12/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/apache-commons-text\nRUN git clone --depth 1 https://github.com/apache/commons-text.git $SRC/project-parent/apache-commons-text\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/apache-commons-text/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=apache-commons-text\nMODULE=org.apache.commons:commons-text\nPROJECT_GROUP_ID=org.apache.commons\nPROJECT_ARTIFACT_ID=commons-text\nMAIN_REPOSITORY=https://github.com/apache/commons-text/\nMVN_FLAGS=\"--no-transfer-progress\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN ${MVN_FLAGS} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN ${MVN_FLAGS} versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  # install\n  # skip RAT license check to avoid build error\n  mvn -pl $MODULE install -DskipTests -Drat.skip=true\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  # install\n  # skip RAT license check to avoid build error\n  $MVN ${MVN_FLAGS} -pl $MODULE install -DskipTests -Drat.skip=true -Dmaven.repo.local=$OUT/m2\n  $MVN ${MVN_FLAGS} -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN ${MVN_FLAGS} -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n  \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/apache-commons-text/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.commons</groupId>\n            <artifactId>commons-text</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>\n"
  },
  {
    "path": "projects/apache-commons-text/project-parent/fuzz-targets/src/test/java/com/example/StringSubstitutorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport java.util.*;\nimport org.apache.commons.text.*;\n\npublic class StringSubstitutorFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Map<String, String> valuesMap = new HashMap<>();\n        valuesMap.put(\"parameter1\", data.consumeRemainingAsString());\n        String templateString = \"The ${parameter1} was fuzzed\";\n        StringSubstitutor sub = new StringSubstitutor(valuesMap);\n        String resolvedString = sub.replace(templateString);\n    }\n}"
  },
  {
    "path": "projects/apache-commons-text/project-parent/fuzz-targets/src/test/java/com/example/StringSubstitutorInterpolatorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport java.util.*;\nimport org.apache.commons.text.*;\n\npublic class StringSubstitutorInterpolatorFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try {\n            final StringSubstitutor interpolator = StringSubstitutor.createInterpolator();\n            String out = interpolator.replace(data.consumeRemainingAsString());\n        }\n        catch (IllegalArgumentException e){\n            \n        }\n    }\n}"
  },
  {
    "path": "projects/apache-commons-text/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>apache-commons-text</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/apache-commons-text/project.yaml",
    "content": "homepage: \"https://github.com/apache/commons-text/\"\nlanguage: jvm\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nfuzzing_engines:\n  - \"libfuzzer\"\nmain_repo: \"https://github.com/apache/commons-text/\"\nsanitizers:\n  - \"address\"\nauto_ccs:\n  - \"security@commons.apache.org\"\nvendor_ccs:\n  - \"michael.nothhard@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-commons-validator/CreditCardValidatorFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.validator.routines.CreditCardValidator;\n\npublic class CreditCardValidatorFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        CreditCardValidator validator = new CreditCardValidator(data.consumeLong());\n        validator.isValid(data.consumeRemainingAsString());\n        validator.validate(data.consumeRemainingAsString());\n    }\n}"
  },
  {
    "path": "projects/apache-commons-validator/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget \n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/apache/commons-validator.git commons-validator\nWORKDIR commons-validator\nCOPY build.sh $SRC/\nCOPY *.java $SRC/"
  },
  {
    "path": "projects/apache-commons-validator/IBANValidatorFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.validator.routines.IBANValidator;\n\npublic class IBANValidatorFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        IBANValidator validator = IBANValidator.getInstance();\n        validator.isValid(data.consumeRemainingAsString());\n    }\n}"
  },
  {
    "path": "projects/apache-commons-validator/UrlValidator2Fuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.validator.UrlValidator;\n\npublic class UrlValidator2Fuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        UrlValidator validator = new UrlValidator(data.consumeInt());\n        validator.isValid(data.consumeRemainingAsString());\n    }\n}"
  },
  {
    "path": "projects/apache-commons-validator/UrlValidatorFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.commons.validator.routines.UrlValidator;\n\npublic class UrlValidatorFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        UrlValidator validator = UrlValidator.getInstance();\n        validator.isValid(data.consumeRemainingAsString());\n    }\n}"
  },
  {
    "path": "projects/apache-commons-validator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN clean package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./ -name \"commons-validator-$CURRENT_VERSION.jar\" -exec mv {} $OUT/commons-validator.jar \\;\n\nALL_JARS=\"commons-validator.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-commons-validator/project.yaml",
    "content": "homepage: \"https://github.com/apache/commons-validator\"\nlanguage: jvm\nprimary_contact: \"fuzz-testing@commons.apache.org\"\nauto_ccs:\n  - \"security@commons.apache.org\"\n  - \"irali@google.com\"\nmain_repo: \"https://github.com/apache/commons-validator.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/apache-cxf/.gitignore",
    "content": "project-parent/cxf\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/apache-cxf/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/xml.dict $SRC/XMLStreamReadersFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XMLStreamReadersFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/cxf\nRUN apt update && apt install -y openjdk-17-jdk\nRUN git clone --depth 1 https://github.com/apache/cxf/ $SRC/project-parent/cxf\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/apache-cxf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=cxf\nPROJECT_GROUP_ID=org.apache.cxf\nPROJECT_ARTIFACT_ID=cxf\nMAIN_REPOSITORY=https://github.com/apache/cxf/\n\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -Denforcer.skip=true -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  FUZZ_TARGET_DEPENDENCIES=\":cxf-core :cxf-rt-frontend-jaxrs :cxf-rt-transports-http :cxf-rt-rs-client :cxf-rt-rs-json-basic\"\n  \n  for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-17\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\n  LD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n  \\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n  --cp=$RUNTIME_CLASSPATH \\\n  --target_class=com.example.$fuzzer_basename \\\n  --jvm_args=\\\"\\$mem_settings\\\" \\\n  --instrumentation_includes=\\\"com.**:org.**\\\" \\\n  \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/apache-cxf/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>17</java.version>\n        <maven.compiler.source>17</maven.compiler.source>\n        <maven.compiler.target>17</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.cxf</groupId>\n            <artifactId>cxf-core</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.cxf</groupId>\n            <artifactId>cxf-rt-frontend-jaxrs</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.cxf</groupId>\n            <artifactId>cxf-rt-transports-http</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.cxf</groupId>\n            <artifactId>cxf-rt-rs-client</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.cxf</groupId>\n            <artifactId>cxf-rt-rs-json-basic</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n        \n        <dependency>\n            <groupId>jakarta.mail</groupId>\n            <artifactId>jakarta.mail-api</artifactId>\n            <version>2.1.1</version>\n            <scope>test</scope>\n        </dependency>\n        \n        <dependency>\n            <groupId>jakarta.xml.soap</groupId>\n            <artifactId>jakarta.xml.soap-api</artifactId>\n            <version>2.0.1</version>\n            <scope>test</scope>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/apache-cxf/project-parent/fuzz-targets/src/test/java/com/example/AttachmentDeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.*;\nimport java.util.Collection;\nimport java.util.Iterator;\n\nimport org.xml.sax.SAXException;\nimport org.xml.sax.helpers.DefaultHandler;\n\nimport javax.xml.parsers.SAXParser;\nimport javax.xml.parsers.SAXParserFactory;\nimport javax.xml.parsers.ParserConfigurationException;\n\nimport org.apache.cxf.message.Attachment;\nimport org.apache.cxf.message.Exchange;\nimport org.apache.cxf.message.ExchangeImpl;\nimport org.apache.cxf.message.Message;\nimport org.apache.cxf.message.MessageImpl;\nimport org.apache.cxf.attachment.AttachmentDeserializer;\nimport org.apache.cxf.attachment.HeaderSizeExceededException;\n\npublic class AttachmentDeserializerFuzzer {\n    static MessageImpl msg;\n    \n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        msg = new MessageImpl();\n        Exchange exchange = new ExchangeImpl();\n        msg.setExchange(exchange);\n\n        String ct = data.consumeString(500);\n        byte [] input = data.consumeRemainingAsBytes();\n\n        InputStream rawInputStream = new ByteArrayInputStream(input);\n        MessageImpl message = new MessageImpl();\n        message.setContent(InputStream.class, rawInputStream);\n        message.put(Message.CONTENT_TYPE, ct);\n\n        try {\n           new AttachmentDeserializer(message).initializeAttachments();\n           InputStream inputStreamWithoutAttachments = message.getContent(InputStream.class);\n           SAXParser parser = SAXParserFactory.newInstance().newSAXParser();\n           parser.parse(inputStreamWithoutAttachments, new DefaultHandler());\n           inputStreamWithoutAttachments.close();\n           rawInputStream.close();\n        } catch (IOException | ParserConfigurationException | SAXException | StringIndexOutOfBoundsException | HeaderSizeExceededException | ArrayIndexOutOfBoundsException e) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-cxf/project-parent/fuzz-targets/src/test/java/com/example/AttachmentSerializerDeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Iterator;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\n\nimport jakarta.activation.DataHandler;\nimport jakarta.mail.util.ByteArrayDataSource;\n\nimport org.apache.cxf.helpers.IOUtils;\nimport org.apache.cxf.message.Attachment;\nimport org.apache.cxf.message.Message;\nimport org.apache.cxf.message.MessageImpl;\nimport org.apache.cxf.attachment.AttachmentImpl;\nimport org.apache.cxf.attachment.AttachmentSerializer;\nimport org.apache.cxf.attachment.AttachmentDeserializer;\nimport org.apache.cxf.attachment.HeaderSizeExceededException;\n\npublic class AttachmentSerializerDeserializerFuzzer {\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        MessageImpl in = new MessageImpl();\n        MessageImpl msg = new MessageImpl();\n        Collection<Attachment> atts = new ArrayList<>();\n\n        String str0 = data.consumeString(250);\n        AttachmentImpl a = new AttachmentImpl(str0);\n\n        byte [] byteArr = data.consumeBytes(250);\n        InputStream is = new ByteArrayInputStream(byteArr);\n        ByteArrayOutputStream out = new ByteArrayOutputStream();\n\n        ByteArrayDataSource ds = null;\n        String str1 = data.consumeString(250);\n        try {\n            ds = new ByteArrayDataSource(is, str1);\n        } catch (IOException e) {\n            return;\n        }\n\n        a.setDataHandler(new DataHandler(ds));\n        atts.add(a);\n        in.setAttachments(atts);\n\n        String str2 = data.consumeString(250);\n        in.put(Message.CONTENT_TYPE, str2);\n        in.setContent(OutputStream.class, out);\n\n        AttachmentSerializer serializer = new AttachmentSerializer(in);\n        boolean xop = data.consumeBoolean();\n        if (!xop) {\n            serializer.setXop(xop);\n        }\n\n        byte [] byteArr2 = data.consumeBytes(250);\n        try {\n            serializer.writeProlog();\n            out.write(byteArr2);\n            serializer.writeAttachments();\n            out.flush();\n        } catch (IOException | StringIndexOutOfBoundsException | IllegalArgumentException e) {\n            return;\n        }\n\n        String str3 = data.consumeString(250);\n        msg.put(Message.CONTENT_TYPE, str3);\n        ByteArrayOutputStream baos = (ByteArrayOutputStream)in.getContent(OutputStream.class);\n        try {\n            ByteArrayInputStream content = new ByteArrayInputStream(baos.toByteArray());\n            msg.setContent(InputStream.class, content);\n\n            AttachmentDeserializer deserializer = new AttachmentDeserializer(msg);\n            deserializer.initializeAttachments();\n\n            Collection<Attachment> attsCollection = msg.getAttachments();\n            Iterator<Attachment> itr = attsCollection.iterator();\n            Attachment att = itr.next();\n\n            // check the cached output stream\n            InputStream attBody = msg.getContent(InputStream.class);\n            ByteArrayOutputStream attOut = new ByteArrayOutputStream();\n            IOUtils.copy(attBody, attOut);\n            is.close();\n        } catch (IOException | HeaderSizeExceededException | IndexOutOfBoundsException e) {\n        }\n    }\n}\n\n"
  },
  {
    "path": "projects/apache-cxf/project-parent/fuzz-targets/src/test/java/com/example/JsonMapObjectReaderWriterFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.util.*;\nimport java.io.Serializable;\nimport java.io.UncheckedIOException;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\n\nimport org.apache.cxf.jaxrs.json.basic.JsonMapObject;\nimport org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;\n\npublic class JsonMapObjectReaderWriterFuzzer {\n    static int cn = 29;\n    static JsonMapObjectReaderWriter jsonMapObjectReaderWriter = new JsonMapObjectReaderWriter();\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        int dummyNum = data.consumeInt(0, 2^cn - 1);\n\n        try {\n            Map<String, Object> map = new LinkedHashMap<>();\n\n            for (int i = 0; i < data.consumeInt(0, 50); ++i) {\n                DummyClass dummyClass = getDummyClass(data, dummyNum);\n                map.put(data.consumeString(50), dummyClass);\n            }\n\n            String json = jsonMapObjectReaderWriter.toJson(map);\n            String json2 = jsonMapObjectReaderWriter.toJson(new JsonMapObject(map));\n\n            jsonMapObjectReaderWriter.fromJson(json);\n            jsonMapObjectReaderWriter.fromJson(json2);\n            jsonMapObjectReaderWriter.fromJsonAsList(json);\n            jsonMapObjectReaderWriter.fromJsonAsList(json2);\n            jsonMapObjectReaderWriter.fromJsonToJsonObject(json);\n            jsonMapObjectReaderWriter.fromJsonToJsonObject(json2);\n        } catch (NumberFormatException | StringIndexOutOfBoundsException | UncheckedIOException e) {\n        }\n    }\n\n    public static DummyClass getDummyClass (FuzzedDataProvider data, int dummyNum) {\n        DummyClass dummyClass = new DummyClass();\n\n        for (int bit = 0; bit < cn; ++bit) {\n            if (((dummyNum >> bit) & 1) == 1) {\n                switch (bit) {\n                    case 0:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._treeMap.put(data.consumeString(50), data.consumeInt());\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 1:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._arrayList.add(data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 2:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._hashSet.add(data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 3:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._hashMap.put(data.consumeString(50), data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 4:\n                        Integer[] integerArr = new Integer[data.consumeInt(0, 50)];\n                        for (int i = 0; i < integerArr.length; i++) {\n                            integerArr[i] = data.consumeInt();\n                        }\n                        dummyClass._asList = Arrays.asList(integerArr);\n                        break;\n                    case 5:\n                        dummyClass._intArray = data.consumeInts(50);\n                        break;\n                    case 6:\n                        dummyClass._longArray = data.consumeLongs(50);\n                        break;\n                    case 7:\n                        dummyClass._shortArray = data.consumeShorts(50);\n                        break;\n                    case 8:\n                        float[] floatArr = new float[data.consumeInt(0, 50)];\n                        for (int i = 0; i < floatArr.length; i++) {\n                            floatArr[i] = data.consumeFloat();\n                        }\n                        dummyClass._floatArray = floatArr;\n                        break;\n                    case 9:\n                        double[] doubleArr = new double[data.consumeInt(0, 50)];\n                        for (int i = 0; i < doubleArr.length; i++) {\n                            doubleArr[i] = data.consumeDouble();\n                        }\n                        dummyClass._doubleArray = doubleArr;\n                        break;\n                    case 10:\n                        dummyClass._byteArray = data.consumeBytes(50);\n                        break;\n                    case 11:\n                        char[] charArr = new char[data.consumeInt(0, 50)];\n                        for (int i = 0; i < charArr.length; i++) {\n                            charArr[i] = data.consumeChar();\n                        }\n                        dummyClass._charArray = charArr;\n                        break;\n                    case 12:\n                        dummyClass._boolArray = data.consumeBooleans(50);\n                        break;\n                    case 13:\n                        String[] strArr = new String[data.consumeInt(0, 50)];\n                        for (int i = 0; i < strArr.length; i++) {\n                            strArr[i] = data.consumeString(50);\n                        }\n                        dummyClass._stringArray = strArr;\n                        break;\n                    case 14:\n                        BitSet bitSet = BitSet.valueOf(data.consumeLongs(50));\n                        dummyClass._bitSet = bitSet;\n                        break;\n                    case 15:\n                        SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n                        try {\n                            dummyClass._date = dateFormat.parse(data.consumeString(50));\n                        } catch (ParseException e) {\n                        }\n                        break;\n                    case 16:\n                        TimeZone tz = TimeZone.getTimeZone(data.consumeString(50));\n                        dummyClass._timeZone = tz;\n                        break;\n                    case 17:\n                        Calendar calendar = new GregorianCalendar(data.consumeInt(),data.consumeInt(),data.consumeInt());\n                        dummyClass._calendar = calendar;\n                        break;\n                    case 18:\n                        Locale locale = new Locale(data.consumeString(50));\n                        dummyClass._locale = locale;\n                        break;\n                    case 19:\n                        Integer[] integerArr2 = new Integer[data.consumeInt(0, 50)];\n                        for (int i = 0; i < integerArr2.length; i++) {\n                            integerArr2[i] = data.consumeInt();\n                        }\n                        dummyClass._integerArray = integerArr2;\n                        break;\n                    case 20:\n                        dummyClass._boolean = data.consumeBoolean();\n                        break;\n                    case 21:\n                        dummyClass._char = data.consumeChar();\n                        break;\n                    case 22:\n                        dummyClass._byte = data.consumeByte();\n                        break;\n                    case 23:\n                        dummyClass._short = data.consumeShort();\n                        break;\n                    case 24:\n                        dummyClass._int = data.consumeInt();\n                        break;\n                    case 25:\n                        dummyClass._float = data.consumeFloat();\n                        break;\n                    case 26:\n                        dummyClass._long = data.consumeLong();\n                        break;\n                    case 27:\n                        dummyClass._double = data.consumeDouble();\n                        break;\n                    case 28:\n                        dummyClass._string = data.consumeString(50);\n                        break;\n                }\n            }\n        }\n        return dummyClass;\n    }\n    public static class DummyClass implements Serializable {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList;\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public boolean[] _boolArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n        public Long _long;\n        public Double _double;\n        public String _string;\n    }\n}\n"
  },
  {
    "path": "projects/apache-cxf/project-parent/fuzz-targets/src/test/java/com/example/XMLStreamReadersFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.apache.cxf.staxutils.*;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.StringReader;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport javax.xml.namespace.QName;\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.XMLStreamReader;\nimport javax.xml.stream.XMLStreamWriter;\n\nimport org.w3c.dom.Document;\n\npublic class XMLStreamReadersFuzzer {\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        int i1 = data.consumeInt();\n        int i2 = data.consumeInt();\n        int i3 = data.consumeInt();\n        String str1 = data.consumeString(250);\n        String str2 = data.consumeString(250);\n        String str3 = data.consumeString(250);\n        String str4 = data.consumeString(250);\n        String str5 = data.consumeString(250);\n        String str6 = data.consumeString(250);\n        String str7 = data.consumeString(250);\n\n        Map<String, String> map = new HashMap<>();\n        map.put(str3, str4);\n        map.put(str5, str6);\n\n        try {\n            XMLStreamReader reader = StaxUtils.createXMLStreamReader(new StringReader(str7));\n            XMLStreamReader xmlStreamReaders [] = {\n                    reader,\n                    new DepthRestrictingStreamReader(reader, i1, i2, i3),\n                    new DepthXMLStreamReader(reader),\n                    new PartialXMLStreamReader(reader, new QName(str1, str2)),\n                    new FragmentStreamReader(reader),\n                    new PropertiesExpandingStreamReader(reader, map)\n            };\n\n            DepthRestrictingStreamReader depthRestrictingStreamReader = new DepthRestrictingStreamReader(data.pickValue(xmlStreamReaders), i1, i2, i3);\n            Document doc = StaxUtils.read(depthRestrictingStreamReader);\n            ByteArrayOutputStream bos = new ByteArrayOutputStream();\n            XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(bos);\n            StaxUtils.copy(doc, writer);\n            writer.flush();\n\n            DepthXMLStreamReader depthXMLStreamReader = new DepthXMLStreamReader(data.pickValue(xmlStreamReaders));\n            doc = StaxUtils.read(depthXMLStreamReader);\n            bos = new ByteArrayOutputStream();\n            writer = StaxUtils.createXMLStreamWriter(bos);\n            StaxUtils.copy(doc, writer);\n            writer.flush();\n\n            FragmentStreamReader fragmentStreamReader = new FragmentStreamReader(data.pickValue(xmlStreamReaders));\n            doc = StaxUtils.read(depthXMLStreamReader);\n            bos = new ByteArrayOutputStream();\n            writer = StaxUtils.createXMLStreamWriter(bos);\n            StaxUtils.copy(doc, writer);\n            writer.flush();\n\n            PartialXMLStreamReader partialXMLStreamReader = new PartialXMLStreamReader(data.pickValue(xmlStreamReaders), new QName(str1, str2));\n            doc = StaxUtils.read(partialXMLStreamReader);\n            bos = new ByteArrayOutputStream();\n            writer = StaxUtils.createXMLStreamWriter(bos);\n            StaxUtils.copy(doc, writer);\n            writer.flush();\n\n            PropertiesExpandingStreamReader propertiesExpandingStreamReader = new PropertiesExpandingStreamReader(data.pickValue(xmlStreamReaders), map);\n            doc = StaxUtils.read(partialXMLStreamReader);\n            bos = new ByteArrayOutputStream();\n            writer = StaxUtils.createXMLStreamWriter(bos);\n            StaxUtils.copy(doc, writer);\n            writer.flush();\n        } catch (XMLStreamException | RuntimeException e) {\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "projects/apache-cxf/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>cxf</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/apache-cxf/project.yaml",
    "content": "homepage: \"https://cxf.apache.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/cxf/\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-doris/project.yaml",
    "content": "homepage: \"https://doris.apache.org\"\nlanguage: c++\nprimary_contact: \"dataroaring@gmail.com\"\nmain_repo: \"https://github.com/apache/doris.git\""
  },
  {
    "path": "projects/apache-felix-dev/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nENV JAVA_HOME $JAVA_15_HOME\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $JAVA_HOME/bin:$PATH\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/apache/felix-dev.git apache-felix-dev     # or use other version control\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/json.dict $SRC/JSONParserFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/JSONParserFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR apache-felix-dev\n"
  },
  {
    "path": "projects/apache-felix-dev/JSONParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport org.apache.felix.utils.json.JSONParser;\n\npublic class JSONParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    \n    boolean switchConstructor = data.consumeBoolean();\n    int switchEncoding = data.consumeInt(0,2);\n    String string = data.consumeRemainingAsString();\n\n    try {\n      JSONParser jSONParser;\n      if (switchConstructor){\n        CharSequence charSeq = string;\n        jSONParser = new JSONParser(charSeq);\n      } else {\n        String encoding = \"UTF_8\";\n        switch (switchEncoding) {\n          case 0:\n            break;\n          case 1:\n          encoding = \"UTF_16\";\n            break;\n          case 2:\n          encoding = \"UTF_32\";\n            break;\n        }\n        \n        InputStream inputStream = new ByteArrayInputStream(string.getBytes(encoding));\n        jSONParser = new JSONParser(inputStream);\n      }\n      \n      List<Object> res = jSONParser.getParsedList();\n      Map<String, Object> parsed = jSONParser.getParsed();\n    }\n    catch(IllegalArgumentException  | IOException e){\n        \n    }\n  }\n  \n}\n"
  },
  {
    "path": "projects/apache-felix-dev/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$MVN -f utils/ clean install -Dmaven.test.skip=true\ncp ./utils/target/org.apache.felix.utils-1.11.9-SNAPSHOT.jar $OUT/felix.utils.jar\n\nALL_JARS=\"felix.utils.jar\"\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/apache-felix-dev/project.yaml",
    "content": "homepage: \"https://felix.apache.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/felix-dev.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/apache-httpd/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget \\\n                                         uuid-dev pkg-config libtool-bin \\\n                                         libbsd-dev\n\nRUN git clone https://github.com/PCRE2Project/pcre2 pcre2 && \\\n    cd pcre2 && \\\n    ./autogen.sh && \\\n    ./configure && \\\n    make && \\\n    make install\n\nRUN git clone https://github.com/AdaLogics/fuzz-headers\n\nRUN wget https://github.com/libexpat/libexpat/releases/download/R_2_4_1/expat-2.4.1.tar.gz && \\\n    tar -xf expat-2.4.1.tar.gz && \\\n    cd expat-2.4.1 && \\\n    ./configure && \\\n    make && \\\n    make install\n\nRUN git clone --depth=1 https://github.com/apache/httpd\nWORKDIR httpd\nCOPY build.sh $SRC/\nCOPY fuzz_*.c $SRC/\n"
  },
  {
    "path": "projects/apache-httpd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nunset CPP\nINITIAL_CXX=$CXX\nunset CXX\nexport LDFLAGS=\"-l:libbsd.a\"\n\n# Download apr and place in httpd srclib folder. Apr-2.0 includes apr-utils\nsvn checkout https://svn.apache.org/repos/asf/apr/apr/trunk/ srclib/apr\n\n# Build httpd\n./buildconf\n./configure --with-included-apr --enable-pool-debug\nmake -j$( nproc )\n\nstatic_pcre=($(find /src/pcre2 -name \"libpcre2-8.a\"))\n\n# Build the fuzzers\nfor fuzzname in utils parse tokenize addr_parse uri request preq; do\n  $CC $CFLAGS -c \\\n    -I$SRC/fuzz-headers/lang/c -I./include -I./os/unix \\\n    -I./srclib/apr/include -I./srclib/apr-util/include/ \\\n    $SRC/fuzz_${fuzzname}.c\n\n  $INITIAL_CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_${fuzzname}.o -o $OUT/fuzz_${fuzzname} \\\n    ./modules.o buildmark.o \\\n    -Wl,--start-group ./server/.libs/libmain.a \\\n                      ./modules/core/.libs/libmod_so.a \\\n                      ./modules/http/.libs/libmod_http.a \\\n                      ./server/mpm/event/.libs/libevent.a \\\n                      ./os/unix/.libs/libos.a \\\n                      ./srclib/apr/.libs/libapr-2.a \\\n    -Wl,--end-group -luuid -lcrypt -lexpat -l:libbsd.a ${static_pcre}\ndone\n"
  },
  {
    "path": "projects/apache-httpd/fuzz_addr_parse.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n\n#include \"apr_network_io.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  apr_pool_t *pool;\n  apr_pool_initialize();\n  if (apr_pool_create(&pool, NULL) != APR_SUCCESS) {\n    abort();\n  }\n\n  char *addr = NULL;\n  char *scope_id = NULL;\n  apr_port_t port = 0;\n  char *input_string = strndup((const char *)data, size);\n\n  apr_parse_addr_port(&addr, &scope_id, &port, input_string, pool);\n\n  free(input_string);\n  apr_pool_destroy(pool);\n  apr_pool_terminate();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/apache-httpd/fuzz_parse.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"apr.h\"\n#include \"apr_file_io.h\"\n#include \"apr_poll.h\"\n#include \"apr_portable.h\"\n#include \"apr_proc_mutex.h\"\n#include \"apr_signal.h\"\n#include \"apr_strings.h\"\n#include \"apr_thread_mutex.h\"\n#include \"apr_thread_proc.h\"\n\n#define APR_WANT_STRFUNC\n#include \"apr_file_io.h\"\n#include \"apr_fnmatch.h\"\n#include \"apr_want.h\"\n\n#include \"apr_poll.h\"\n#include \"apr_want.h\"\n\n#include \"ap_config.h\"\n#include \"ap_expr.h\"\n#include \"ap_listen.h\"\n#include \"ap_provider.h\"\n#include \"ap_regex.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char *new_str = (char *)malloc(size + 1);\n  if (new_str == NULL) {\n    return 0;\n  }\n  memcpy(new_str, data, size);\n  new_str[size] = '\\0';\n\n  apr_pool_initialize();\n  apr_pool_t *v = NULL;\n  apr_pool_create(&v, NULL);\n\n  int only_ascii = 1;\n  for (int i = 0; i < size; i++) {\n    // Avoid unnessary exits because of non-ascii characters.\n    if (new_str[i] < 0x01 || new_str[i] > 0x7f) {\n      only_ascii = 0;\n    }\n    // Avoid forced exits beause of, e.g. unsupported characters or recursion\n    // depth\n    if (new_str[i] == 0x5c || new_str[i] == '{') {\n      only_ascii = 0;\n    }\n  }\n\n  // Now parse\n  if (only_ascii) {\n    ap_expr_info_t val;\n    ap_expr_parse(v, v, &val, new_str, NULL);\n  }\n\n  apr_pool_terminate();\n  free(new_str);\n  return 0;\n}\n"
  },
  {
    "path": "projects/apache-httpd/fuzz_preq.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"apr.h\"\n#include \"apr_file_io.h\"\n#include \"apr_poll.h\"\n#include \"apr_portable.h\"\n#include \"apr_proc_mutex.h\"\n#include \"apr_signal.h\"\n#include \"apr_strings.h\"\n#include \"apr_thread_mutex.h\"\n#include \"apr_thread_proc.h\"\n\n#define APR_WANT_STRFUNC\n#include \"apr_file_io.h\"\n#include \"apr_fnmatch.h\"\n#include \"apr_want.h\"\n\n#include \"apr_poll.h\"\n#include \"apr_want.h\"\n\n#include \"ap_config.h\"\n#include \"ap_expr.h\"\n#include \"ap_listen.h\"\n#include \"ap_provider.h\"\n#include \"ap_regex.h\"\n\n#include \"ada_fuzz_header.h\"\n#include \"apreq_parser.h\"\n\napr_status_t hookfunc(apreq_hook_t *hook, apreq_param_t *param,\n                      apr_bucket_brigade *bb) {\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  af_gb_init();\n\n  const uint8_t *data2 = data;\n  size_t size2 = size;\n\n  /* get random data for the fuzzer */\n  char *new_str = af_gb_get_null_terminated(&data2, &size2);\n  char *new_str2 = af_gb_get_null_terminated(&data2, &size2);\n\n  if (new_str != NULL && new_str2 != NULL) {\n    apr_pool_initialize();\n    apr_pool_t *v = NULL;\n    apr_pool_create(&v, NULL);\n\n    apr_bucket_alloc_t *bucket = apr_bucket_alloc_create(v);\n    apr_bucket_brigade *brigade = apr_brigade_create(v, bucket);\n    apr_brigade_write(brigade, NULL, NULL, new_str, strlen(new_str));\n\n    apreq_parser_t parser;\n    parser.content_type = new_str2;\n    parser.temp_dir = \"/tmp/\";\n    parser.brigade_limit = 10;\n    parser.pool = v;\n    parser.ctx = NULL;\n    parser.bucket_alloc = bucket;\n\n    parser.hook = apreq_hook_make(parser.pool, hookfunc, NULL, parser.ctx);\n\n    apr_table_t *table = apr_table_make(parser.pool, 10);\n    if (af_get_short(&data2, &size2) % 2 == 0) {\n      apreq_parse_multipart(&parser, table, brigade);\n    } else {\n      apreq_parse_urlencoded(&parser, table, brigade);\n    }\n\n    apr_pool_terminate();\n  }\n  af_gb_cleanup();\n  return 0;\n}\n"
  },
  {
    "path": "projects/apache-httpd/fuzz_request.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"apr.h\"\n#include \"apr_file_io.h\"\n#include \"apr_poll.h\"\n#include \"apr_portable.h\"\n#include \"apr_proc_mutex.h\"\n#include \"apr_signal.h\"\n#include \"apr_strings.h\"\n#include \"apr_thread_mutex.h\"\n#include \"apr_thread_proc.h\"\n#include \"http_core.h\"\n\n#define APR_WANT_STRFUNC\n#include \"apr_file_io.h\"\n#include \"apr_fnmatch.h\"\n#include \"apr_want.h\"\n\n#include \"apr_poll.h\"\n#include \"apr_want.h\"\n\n#include \"ap_config.h\"\n#include \"ap_expr.h\"\n#include \"ap_listen.h\"\n#include \"ap_provider.h\"\n#include \"ap_regex.h\"\n\n#include \"http_log.h\"\n#include \"http_protocol.h\"\n\n#include \"ada_fuzz_header.h\"\n\nstatic const char *http_scheme2(const request_rec *r) {\n  /*\n   * The http module shouldn't return anything other than\n   * \"http\" (the default) or \"https\".\n   */\n  if (r->server->server_scheme &&\n      (strcmp(r->server->server_scheme, \"https\") == 0))\n    return \"https\";\n\n  return \"http\";\n}\n\nextern request_rec *ap_create_request(conn_rec *conn);\nextern int read_request_line(request_rec *r, apr_bucket_brigade *bb);\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n  apr_pool_create(&apr_hook_global_pool, NULL);\n  ap_open_stderr_log(apr_hook_global_pool);\n  ap_hook_http_scheme(http_scheme2, NULL, NULL, APR_HOOK_REALLY_LAST);\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  af_gb_init();\n\n  const uint8_t *data2 = data;\n  size_t size2 = size;\n\n  /* get random data for the fuzzer */\n  char *new_str = af_gb_get_null_terminated(&data2, &size2);\n  char *new_str2 = af_gb_get_null_terminated(&data2, &size2);\n  char *new_str3 = af_gb_get_null_terminated(&data2, &size2);\n  char *new_str4 = af_gb_get_null_terminated(&data2, &size2);\n  char *new_str5 = af_gb_get_null_terminated(&data2, &size2);\n  if (new_str != NULL && \n      new_str2 != NULL && \n      new_str3 != NULL &&\n      new_str4 != NULL && \n      new_str5 != NULL) {\n\n    /* this is the main fuzzing logic */\n\n    apr_pool_initialize();\n    apr_pool_t *v = NULL;\n    apr_pool_create(&v, NULL);\n\n    conn_rec conn;\n    conn.pool = v;\n    server_rec base_server;\n    conn.base_server = &base_server;\n    conn.bucket_alloc = apr_bucket_alloc_create(conn.pool);\n    ap_method_registry_init(conn.pool);\n\n    //server_rec server;\n\n    /* Simulate ap_read_request */\n    request_rec *r = NULL;\n    r = ap_create_request(&conn);\n\n    /* create a logs array for the request */\n    struct ap_logconf logs = {};\n    char *log_levels = calloc(1000, 1);\n    memset(log_levels, 0, 1000);\n    logs.module_levels = log_levels;\n    r->log = &logs;\n    if (r != NULL) {\n      apr_bucket_brigade *tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);\n      conn.keepalive = AP_CONN_UNKNOWN;\n\n      ap_run_pre_read_request(r, &conn);\n\n      core_server_config conf_mod;\n      conf_mod.http_conformance   = (char)af_get_short(&data2, &size2);\n      conf_mod.http09_enable      = (char)af_get_short(&data2, &size2);\n      conf_mod.http_methods       = (char)af_get_short(&data2, &size2);\n      void **module_config_arr = malloc(1000);\n      module_config_arr[0] = &conf_mod;\n\n      r->server->module_config = module_config_arr;\n      ap_set_core_module_config(r->server->module_config, &conf_mod);\n\n      /* randomise content of request */\n      r->unparsed_uri           = new_str;\n      r->uri                    = new_str2;\n      r->server->server_scheme  = new_str3;\n      r->method                 = new_str4;\n      r->the_request            = new_str5;\n\n      /* main target */\n      ap_parse_request_line(r);\n\n      free(module_config_arr);\n    }\n    free(log_levels);\n    apr_pool_terminate();\n  }\n\n  af_gb_cleanup();\n  return 0;\n}\n"
  },
  {
    "path": "projects/apache-httpd/fuzz_tokenize.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n\n#include \"apr_strings.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  apr_pool_t *pool;\n  apr_pool_initialize();\n  if (apr_pool_create(&pool, NULL) != APR_SUCCESS) {\n    abort();\n  }\n\n  char *arg_str = strndup((const char *)data, size);\n  char **argv_out;\n  apr_tokenize_to_argv(arg_str, &argv_out, pool);\n\n  free(arg_str);\n  apr_pool_destroy(pool);\n  apr_pool_terminate();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/apache-httpd/fuzz_uri.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"apr.h\"\n#include \"apr_file_io.h\"\n#include \"apr_poll.h\"\n#include \"apr_portable.h\"\n#include \"apr_proc_mutex.h\"\n#include \"apr_signal.h\"\n#include \"apr_strings.h\"\n#include \"apr_thread_mutex.h\"\n#include \"apr_thread_proc.h\"\n\n#define APR_WANT_STRFUNC\n#include \"apr_file_io.h\"\n#include \"apr_fnmatch.h\"\n#include \"apr_want.h\"\n\n#include \"apr_poll.h\"\n#include \"apr_want.h\"\n\n#include \"apr_uri.h\"\n\n#include \"ap_config.h\"\n#include \"ap_expr.h\"\n#include \"ap_listen.h\"\n#include \"ap_provider.h\"\n#include \"ap_regex.h\"\n\n#include \"ada_fuzz_header.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  af_gb_init();\n  const uint8_t *data2 = data;\n  size_t size2 = size;\n\n  // Get a NULL terminated string\n  char *cstr = af_gb_get_null_terminated(&data2, &size2);\n\n  // Fuzz URI routines\n  if (cstr && apr_pool_initialize() == APR_SUCCESS) {\n    apr_pool_t *pool = NULL;\n    apr_pool_create(&pool, NULL);\n\n    apr_uri_t tmp_uri;\n    if (apr_uri_parse(pool, cstr, &tmp_uri) == APR_SUCCESS) {\n      apr_uri_unparse(pool, &tmp_uri, 0);\n    }\n    apr_uri_parse_hostinfo(pool, cstr, &tmp_uri);\n\n    // Cleanup\n    apr_pool_terminate();\n  }\n\n  af_gb_cleanup();\n  return 0;\n}\n"
  },
  {
    "path": "projects/apache-httpd/fuzz_utils.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"apr.h\"\n#include \"apr_file_io.h\"\n#include \"apr_poll.h\"\n#include \"apr_portable.h\"\n#include \"apr_proc_mutex.h\"\n#include \"apr_signal.h\"\n#include \"apr_strings.h\"\n#include \"apr_thread_mutex.h\"\n#include \"apr_thread_proc.h\"\n\n#define APR_WANT_STRFUNC\n#include \"apr_file_io.h\"\n#include \"apr_fnmatch.h\"\n#include \"apr_want.h\"\n\n#include \"apr_poll.h\"\n#include \"apr_want.h\"\n\n#include \"ap_config.h\"\n#include \"ap_expr.h\"\n#include \"ap_listen.h\"\n#include \"ap_provider.h\"\n#include \"ap_regex.h\"\n\n#include <string.h>\n#include <unistd.h>\n\n#include \"ada_fuzz_header.h\"\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Initialize fuzzing garbage collector. We use this to easily\n  // get data types seeded with random input from the fuzzer.\n  af_gb_init();\n\n  const uint8_t *data2 = data;\n  size_t size2 = size;\n\n  char *new_str = af_gb_get_null_terminated(&data2, &size2);\n  char *new_dst = af_gb_get_null_terminated(&data2, &size2);\n  if (new_str != NULL && new_dst != NULL) {\n    size_t new_str_len = strlen(new_str);\n\n    // Targets that do not require a pool\n\n    ap_cstr_casecmp(new_str, new_dst);\n    if (new_str_len > 2) {\n      ap_cstr_casecmpn(new_str, new_str + 2, new_str_len - 2);\n    }\n    ap_strcmp_match(new_str, new_dst);\n    ap_strcasecmp_match(new_str, new_dst);\n    ap_strcasestr(new_str, new_dst);\n\n    apr_interval_time_t timeout;\n    ap_timeout_parameter_parse(new_str, &timeout, \"ms\");\n\n    new_dst = af_gb_get_null_terminated(&data2, &size2);\n    if (new_dst != NULL) {\n      ap_getparents(new_dst);\n    }\n\n    new_dst = af_gb_get_null_terminated(&data2, &size2);\n    if (new_dst != NULL) {\n      ap_no2slash(new_dst);\n    }\n\n    new_dst = af_gb_get_null_terminated(&data2, &size2);\n    if (new_dst != NULL) {\n      ap_unescape_url(new_dst);\n    }\n\n    new_dst = af_gb_get_null_terminated(&data2, &size2);\n    if (new_dst != NULL) {\n      ap_unescape_urlencoded(new_dst);\n    }\n\n    new_dst = af_gb_get_null_terminated(&data2, &size2);\n    if (new_dst != NULL) {\n      ap_content_type_tolower(new_dst);\n    }\n\n    new_dst = malloc(new_str_len*3+1); // big enough for worst-case URL-escaped (%nn)\n    ap_escape_path_segment_buffer(new_dst, new_str);\n    free(new_dst);\n\n    new_dst = malloc(new_str_len*4+1); // big enough for worst-case log-escaped (\\xnn)\n    ap_escape_errorlog_item(new_dst, new_str, new_str_len*4+1);\n    free(new_dst);\n\n    // Pool initialisation\n    if (apr_pool_initialize() == APR_SUCCESS) {\n      apr_pool_t *pool = NULL;\n      apr_pool_create(&pool, NULL);\n\n      // Targets that require a pool\n\n      new_dst = af_gb_get_null_terminated(&data2, &size2);\n      if (new_dst != NULL) {\n        ap_make_dirstr_parent(pool, new_dst);\n      }\n\n      ap_field_noparam(pool, new_str);\n\n      ap_escape_shell_cmd(pool, new_str);\n      ap_os_escape_path(pool, new_str, 0);\n      ap_escape_html2(pool, new_str, 0);\n      ap_escape_logitem(pool, new_str);\n\n      // This line causes some issues if something bad is allocated\n      ap_escape_quotes(pool, new_str);\n\n      // base64\n      ap_pbase64decode(pool, new_str);\n      ap_pbase64encode(pool, new_str);\n      new_dst = af_gb_get_null_terminated(&data2, &size2);\n      if (new_dst != NULL) {\n        char *d;\n        apr_size_t dlen;\n        ap_pbase64decode_strict(pool, new_dst, &d, &dlen);\n      }\n\n      // List functions\n      const char *tmp_s = new_str;\n      ap_get_list_item(pool, &tmp_s);\n      ap_find_list_item(pool, new_str, \"kjahsdfkj\");\n      ap_find_token(pool, new_str, \"klsjdfk\");\n      ap_find_last_token(pool, new_str, \"sdadf\");\n      apr_array_header_t *offers = NULL;\n      ap_parse_token_list_strict(pool, new_str, &offers, 0);\n\n      tmp_s = new_str;\n      ap_get_token(pool, &tmp_s, 1);\n\n      tmp_s = NULL;\n      ap_pstr2_alnum(pool, new_str, &tmp_s);\n\n      ap_is_chunked(pool, new_str);\n\n      // Word functions\n      tmp_s = new_str;\n      ap_getword(pool, &tmp_s, 0);\n      tmp_s = new_str;\n      ap_getword_conf2(pool, &tmp_s);\n      new_dst = af_gb_get_null_terminated(&data2, &size2);\n      if (new_dst != NULL) {\n        char *d = new_dst;\n        ap_getword_white_nc(pool, &d);\n      }\n\n      ap_escape_urlencoded(pool, new_str);\n\n\n\t\t\tchar filename[256];\n\t\t\tsprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\t\t\tFILE *fp = fopen(filename, \"wb\");\n\t\t\tfwrite(data, size, 1, fp);\n\t\t\tfclose(fp);\n\n\t\t\t// Fuzzer logic here\n\t\t\tap_configfile_t *cfg;\n\t\t\tap_pcfg_openfile(&cfg, pool, filename);\n      char tmp_line[100];\n      if ((af_get_short(&data2, &size2) % 2) == 0) {\n        ap_cfg_getline(tmp_line, 100, cfg);\n      }\n      else {\n        cfg->getstr = NULL;\n        ap_cfg_getline(tmp_line, 100, cfg);\n      }\n\t\t\t// Fuzzer logic end\n\n\t\t\tunlink(filename);\n\n      // Cleanup\n      apr_pool_terminate();\n    }\n  }\n\n  // Cleanup all of the memory allocated by the fuzz headers.\n  af_gb_cleanup();\n  return 0;\n}\n"
  },
  {
    "path": "projects/apache-httpd/project.yaml",
    "content": "homepage: \"https://httpd.apache.org/\"\nlanguage: c\nprimary_contact: \"david@adalogics.com\"\nauto_ccs:\n - \"stefan.eissing@gmail.com\"\n - \"covener@gmail.com\"\n - \"ylavic.dev@gmail.com\"\nmain_repo: \"https://github.com/apache/httpd\"\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/apache-logging-log4cxx/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Log4cxx build dependencies: https://logging.apache.org/log4cxx/latest_stable/build-cmake.html\nRUN apt-get update && apt-get install -y build-essential libapr1-dev libaprutil1-dev gzip zip\n\nRUN git clone --quiet --depth 1 --branch master --single-branch https://github.com/apache/logging-log4cxx\n\nCOPY run_tests.sh build.sh $SRC/\n\nWORKDIR $SRC/logging-log4cxx\n"
  },
  {
    "path": "projects/apache-logging-log4cxx/README.adoc",
    "content": "////\nCopyright 2024 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n////\n\nLog4cxx fuzz tests are distributed as a part of https://github.com/apache/logging-log4cxx[the official project sources].\nHere we only store the `Dockerfile` to build the container image to build and run fuzz tests.\nLikewise, `build.sh` simply delegates to a build script distributed with the Log4j source code.\n"
  },
  {
    "path": "projects/apache-logging-log4cxx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./src/fuzzers/bash/oss-fuzz-build.sh \"$OUT\"\n\n# Add seed corpus\nzip $OUT/DOMConfiguratorFuzzer_seed_corpus.zip $SRC/logging-log4cxx/src/test/resources/input/xml/*.xml\n\nmkdir build-tests\ncd build-tests\ncmake ..\nmake\n"
  },
  {
    "path": "projects/apache-logging-log4cxx/project.yaml",
    "content": "homepage: \"https://logging.apache.org/log4cxx\"\nmain_repo: \"https://github.com/apache/logging-log4cxx\"\nlanguage: c++\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n  - centipede\n\nsanitizers:\n  - address\n  - undefined\n\n# Apache Logging Services PMC members[1] that contribute the fuzz tests.\n# We cannot share `security@logging.apache.org` here, since it must be associated with a Google account[2].\n#\n# [1] https://logging.apache.org/team-list.html\n# [2] https://google.github.io/oss-fuzz/getting-started/new-project-guide/#primary\nprimary_contact: volkan@yazi.ci\nauto_ccs:\n  - piotr.karwasz@gmail.com\n  - osfan6313@gmail.com\n  - adam@adalogics.com\n  - swebb2066@gmail.com\n\n"
  },
  {
    "path": "projects/apache-logging-log4cxx/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Exclude deallocation mismatch and memory leak sanitizer\nexport ASAN_OPTIONS=\"alloc_dealloc_mismatch=0:detect_leaks=0\"\n\n# Exclude these failing test case temporarily\nctest --test-dir build-tests/ --output-on-failure -E \"filetestcase|optionconvertertestcase|stringtokenizertestcase|xloggertestcase\"\n"
  },
  {
    "path": "projects/apache-poi/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n# Newer Maven release are listed at https://archive.apache.org/dist/maven/maven-3/\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.9.12 && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven-3.9.12/apache-maven-3.9.12/bin/mvn\nENV TARGET_PACKAGE_PREFIX org.apache.poi.*:org.apache.xmlbeans.*\n\n# Newer JDK releases are listed at https://github.com/adoptium/temurin11-binaries/releases/\nRUN curl -L https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.29%2B7/OpenJDK11U-jdk_x64_linux_hotspot_11.0.29_7.tar.gz -o OpenJDK11U-jdk_x64_linux_hotspot_11.0.29_7.tar.gz && \\\n  tar xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.29_7.tar.gz && \\\n  rm -rf OpenJDK11U-jdk_x64_linux_hotspot_11.0.29_7.tar.gz\n\nENV JAVA_HOME_11 $SRC/jdk-11.0.29+7\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone --depth 1 https://github.com/apache/poi.git\n\n# install packages required for font-handling and other code in java.awt.*\nRUN apt-get update && apt-get install -y libxext6 libx11-6 libxrender1 libxtst6 libxi6 libxcb1 libxau6 libxdmcp6 libfreetype6 libpng16-16 \\\n&& apt-get clean autoclean \\\n&& apt-get autoremove --yes \\\n&& rm -rf /var/lib/{apt,dpkg,cache,log}/\n\n# Remove unused code-parts to speed up introspection\n# Need to keep some test-code which is used in the poi-integration module\nRUN cd ${SRC}/poi && rm `find \\\n    jenkins \\\n    osgi \\\n    poi/src/test/ \\\n    poi-examples/src/test \\\n    poi-excelant/src/test \\\n    poi-ooxml/src/test \\\n    poi-scratchpad/src/test \\\n    src \\\n    \\\n    -name *.java -a ! -name *DataSamples*.java -a ! -name Biff*.java`\n\n# run a small Gradle task to perform the downloading of Gradle distribution here\n# this avoids this step when using the Docker image later\nRUN cd ${SRC}/poi && chmod a+x gradlew && JAVA_HOME=$JAVA_HOME_11 ./gradlew wrapper\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/poi\n"
  },
  {
    "path": "projects/apache-poi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"--no-transfer-progress -DskipTests\"\nALL_JARS=\"\"\nLIBRARY_NAME=\"poi\"\nGRADLE_FLAGS=\"-x javadoc -x test -Dfile.encoding=UTF-8 -Porg.gradle.java.installations.fromEnv=JAVA_HOME_11 --console=plain\"\n\necho Copy libraries for java.awt in place\nls /usr/lib/x86_64-linux-gnu/\ncp /usr/lib/x86_64-linux-gnu/libXext.so.6* \\\n  /usr/lib/x86_64-linux-gnu/libX11.so.6* \\\n  /usr/lib/x86_64-linux-gnu/libXrender.so.1* \\\n  /usr/lib/x86_64-linux-gnu/libXtst.so.6* \\\n  /usr/lib/x86_64-linux-gnu/libXi.so.6* \\\n  /usr/lib/x86_64-linux-gnu/libxcb.so.1* \\\n  /usr/lib/x86_64-linux-gnu/libXau.so.6* \\\n  /usr/lib/x86_64-linux-gnu/libXdmcp.so.6* \\\n  /usr/lib/x86_64-linux-gnu/libfreetype.so.6* \\\n  /usr/lib/x86_64-linux-gnu/libpng16.so.16* \\\n  ${OUT}/\n\necho Main Java\n${JAVA_HOME}/bin/java -version\n\necho Java 11\n${JAVA_HOME_11}/bin/java -version\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.29.1\" \\\n\t\t-Dpackaging=jar \\\n\t\t ${MVN_FLAGS}\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}\"\n\t# build and publish current binaries\n\t./gradlew publishToMavenLocal :poi-integration:testJar :poi-fuzz:jar ${GRADLE_FLAGS}\n\n\t# determine current version-tag\n\tCURRENT_VERSION=$(./gradlew properties ${GRADLE_FLAGS} | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n\n  # additionally publish the testJar to MavenLocal\n  ${MVN} install:install-file -Dfile=build/dist/maven/poi-integration-tests/poi-integration-${CURRENT_VERSION}-tests.jar \\\n      -DgroupId=org.apache.poi \\\n      -DartifactId=poi-integration \\\n      -Dversion=${CURRENT_VERSION} \\\n      -Dpackaging=jar\n\n  # additionally publish the fuzz-targets to MavenLocal\n  ${MVN} install:install-file -Dfile=build/dist/maven/poi-fuzz/poi-fuzz-${CURRENT_VERSION}.jar \\\n      -DgroupId=org.apache.poi \\\n      -DartifactId=poi-fuzz \\\n      -Dversion=${CURRENT_VERSION} \\\n      -Dpackaging=jar\n\n\t# prepare some seed-corpus archives based on the test-data of Apache POI\n\t# we cannot do this automatically as there is not a 1:1 match of fuzz targets and formats\n\tzip -r $OUT/POIFileHandlerFuzzer_seed_corpus.zip test-data\n\tzip -r $OUT/POIFuzzer_seed_corpus.zip test-data\n\tzip -jr $OUT/POIHDGFFuzzer_seed_corpus.zip test-data/diagram/*.vsd\n\tzip -jr $OUT/POIHMEFFuzzer_seed_corpus.zip test-data/hmef/*\n\tzip -jr $OUT/POIHPBFFuzzer_seed_corpus.zip test-data/publisher/*\n\tzip -jr $OUT/POIHPSFFuzzer_seed_corpus.zip test-data/hpsf/*\n\tzip -jr $OUT/POIHSLFFuzzer_seed_corpus.zip test-data/slideshow/*.ppt\n\tzip -jr $OUT/POIHSMFFuzzer_seed_corpus.zip test-data/hsmf/*\n\tzip -jr $OUT/POIHSSFFuzzer_seed_corpus.zip test-data/spreadsheet/*.xls\n\tzip -jr $OUT/POIHWPFFuzzer_seed_corpus.zip test-data/document/*.doc test-data/document/*.DOC\n\tzip -jr $OUT/POIOldExcelFuzzer_seed_corpus.zip test-data/spreadsheet/*.xls test-data/spreadsheet/*.bin\n\tzip -jr $OUT/POIVisioFuzzer_seed_corpus.zip test-data/diagram/*\n\tzip -jr $OUT/POIXSLFFuzzer_seed_corpus.zip test-data/slideshow/* test-data/integration/*.pptx\n\tzip -jr $OUT/POIXSSFFuzzer_seed_corpus.zip test-data/spreadsheet/* test-data/integration/*.xslx\n\tzip -jr $OUT/POIXWPFFuzzer_seed_corpus.zip test-data/document/* test-data/integration/*.docx\n\tzip -jr $OUT/XLSX2CSVFuzzer_seed_corpus.zip test-data/spreadsheet/*\npopd\n\npushd \"${SRC}\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tmkdir -p ${OUT}/dependency\n\tinstall -v target/assembly/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tinstall -v target/assembly/${LIBRARY_NAME}-fuzzer-libs-${CURRENT_VERSION}.jar ${OUT}/dependency/${LIBRARY_NAME}-fuzzer-libs-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar dependency/${LIBRARY_NAME}-fuzzer-libs-${CURRENT_VERSION}.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(unzip -l ${OUT}/dependency/${LIBRARY_NAME}-fuzzer-libs-${CURRENT_VERSION}.jar | \\\n    grep Fuzzer.class | \\\n    sed -e 's|^.*\\(org/apache/poi/fuzz/.*\\).class$|\\1|g'); do\n\t# Get fuzzer-name from .class file-name in jar\n\tstripped_path=$(echo ${fuzzer} | sed -e 's|^org/apache/poi/fuzz/\\(.*\\).class$|\\1|');\n\n\tfuzzer_basename=$(basename ${fuzzer})\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--instrumentation_includes=org.apache.poi.**:org.apache.xmlbeans.** \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx1024m:-Dorg.apache.poi.ss.ignoreMissingFontSystem=true\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/apache-poi/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>poi-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>17</maven.compiler.source>\n\t\t<maven.compiler.target>17</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>5.5.1</fuzzedLibaryVersion>\n\t\t<exec.mainClass>org.apache.poi.XLSX2CSVFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t<repositories>\n\t\t<repository>\n\t\t\t<id>central</id>\n\t\t\t<name>Maven Central</name>\n\t\t\t<url>https://repo.maven.apache.org/maven2/</url>\n\t\t</repository>\n\t\t<repository>\n\t\t\t<id>apache-staging</id>\n\t\t\t<name>Apache Staging</name>\n\t\t\t<url>https://repository.apache.org/content/repositories/staging</url>\n\t\t</repository>\n\t</repositories>\n\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.29.1</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.poi</groupId>\n\t\t\t<artifactId>poi</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.poi</groupId>\n\t\t\t<artifactId>poi-ooxml</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.poi</groupId>\n\t\t\t<artifactId>poi-scratchpad</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.poi</groupId>\n\t\t\t<artifactId>poi-examples</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.poi</groupId>\n\t\t\t<artifactId>poi-integration</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.poi</groupId>\n\t\t\t<artifactId>poi-fuzz</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.junit.jupiter</groupId>\n\t\t\t<artifactId>junit-jupiter-api</artifactId>\n\t\t\t<version>5.13.4</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.logging.log4j</groupId>\n\t\t\t<artifactId>log4j-core</artifactId>\n\t\t\t<version>2.25.3</version>\n\t\t</dependency>\n\n\t\t<!-- Not a real dependency of Apache POI, but can be triggered via malformed documents -->\n\t\t<dependency>\n\t\t\t<groupId>com.github.luben</groupId>\n\t\t\t<artifactId>zstd-jni</artifactId>\n\t\t\t<version>1.5.7-4</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/LICENSE*</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/NOTICE*</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/DEPENDENCIES</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<id>shade-poi</id>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t\t<configuration>\n\t\t\t\t\t\t\t<outputFile>target/assembly/${project.artifactId}-${fuzzedLibaryVersion}.jar</outputFile>\n\t\t\t\t\t\t\t<artifactSet>\n\t\t\t\t\t\t\t\t<includes>\n\t\t\t\t\t\t\t\t\t<includes>org.apache.poi:poi</includes>\n\t\t\t\t\t\t\t\t\t<includes>org.apache.poi:poi-ooxml</includes>\n\t\t\t\t\t\t\t\t\t<includes>org.apache.poi:poi-scratchpad</includes>\n\t\t\t\t\t\t\t\t</includes>\n\t\t\t\t\t\t\t</artifactSet>\n\t\t\t\t\t\t</configuration>\n\t\t\t\t\t</execution>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<id>shade-non-poi</id>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t\t<configuration>\n\t\t\t\t\t\t\t<outputFile>target/assembly/${project.artifactId}-libs-${fuzzedLibaryVersion}.jar</outputFile>\n\t\t\t\t\t\t\t<artifactSet>\n\t\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t\t<excludes>org.apache.poi:poi</excludes>\n\t\t\t\t\t\t\t\t\t<excludes>org.apache.poi:poi-ooxml</excludes>\n\t\t\t\t\t\t\t\t\t<excludes>org.apache.poi:poi-scratchpad</excludes>\n\t\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t\t</artifactSet>\n\t\t\t\t\t\t</configuration>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/apache-poi/project.yaml",
    "content": "homepage: \"https://poi.apache.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/poi.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"centic@apache.org\"\n  - \"dominik.stadler@gmail.com\""
  },
  {
    "path": "projects/apache-poi/src/main/resources/log4j2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Configuration status=\"warn\">\n\t<Loggers>\n\t\t<Root level=\"off\"/>\n\t</Loggers>\n</Configuration>"
  },
  {
    "path": "projects/apache-tika/.gitignore",
    "content": "project-parent/tika\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/apache-tika/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM ghcr.io/aixcc-finals/base-builder-jvm:v1.3.0\n\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN=$SRC/maven/apache-maven-3.9.11/bin/mvn\n\nCOPY project-parent $SRC/project-parent/\n\nRUN git clone --depth 1 https://github.com/apache/tika/ $SRC/project-parent/tika\n\nCOPY build.sh build_seeds.sh $SRC/\n\nRUN cd $SRC && ./build_seeds.sh\n\nWORKDIR $SRC/project-parent/tika\n\n"
  },
  {
    "path": "projects/apache-tika/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=tika\nMAIN_REPOSITORY=https://github.com/apache/tika/\n\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests -Dcheckstyle.skip -Dossindex.skip --no-transfer-progress -am -pl :tika-app\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN --no-transfer-progress versions:use-dep-version -Dexcludes=com.code-intelligence:jazzer -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd $SRC/project-parent\n\nset_project_version_in_fuzz_targets_dependency\n\n#install\n(cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n$MVN --no-transfer-progress -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n# build classpath\ncp  $SRC/project-parent/fuzz-targets/target/fuzz-targets-0.0.1-SNAPSHOT.jar $OUT/fuzz-targets.jar\nRUNTIME_CLASSPATH_ABSOLUTE=\"$OUT/fuzz-targets.jar\"\n# replace $OUT with placeholder $this_dir that will be dissolved at runtime\nRUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\ncp ${SRC}/seeds/*_seed_corpus.zip ${OUT}/\n\nfor fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # skip helper class which is not a fuzz-target\n  if [ \"$fuzzer_basename\" == \"ParserFuzzer\"]; then\n    continue;\n  fi\n\n  # Create an execution wrapper for every fuzztarget\n  # This bumps memory to > 2gb to get around new byte[Integer.MAX_VALUE] single\n  # allocation issues that plague audio, video, image and other parsers.\n  # if we're able to get an oom > 2gb, we should really fix that.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  mem_settings='-Xmx3000m:-Xss1024k'\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n  \\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n  --cp=$RUNTIME_CLASSPATH \\\n  --target_class=com.example.$fuzzer_basename \\\n  -rss_limit_mb=3600mb \\\n  --jvm_args=\\\"\\$mem_settings\\\" \\\n  --instrumentation_includes=\\\"com.**:org.**\\\" \\\n  \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/apache-tika/build_seeds.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir ${SRC}/seeds\n#This packages the unit test files based on file extension from within the Tika project\n#we could also pull in other seeds from other parser projects.\n\nfind ${SRC}/project-parent/tika -name \"*-webm.noext\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*-mkv.noext\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.aif\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.au\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.flv\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.m4a\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.mkv\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.mp3\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.wav\" -print0 | xargs -0 zip -u ${SRC}/seeds/AudioVideoParsersFuzzer_seed_corpus.zip\n\n\nfind ${SRC}/project-parent/tika -name \"*.Z\" -print0 | xargs -0 zip -u ${SRC}/seeds/CompressorParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.bz2\" -print0 | xargs -0 zip -u ${SRC}/seeds/CompressorParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.gz\" -print0 | xargs -0 zip -u ${SRC}/seeds/CompressorParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.tbz2\" -print0 | xargs -0 zip -u ${SRC}/seeds/CompressorParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.tgz\" -print0 | xargs -0 zip -u ${SRC}/seeds/CompressorParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.zst\" -print0 | xargs -0 zip -u ${SRC}/seeds/CompressorParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.html\" -print0 | xargs -0 zip ${SRC}/seeds/HtmlParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.avif\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.bmp\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.bpg\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.gif\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.heic\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.icns\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.jp2\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.jb2\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.jpg\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.jxl\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.png\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.psd\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.tif\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.webp\" -print0 | xargs -0 zip -u ${SRC}/seeds/ImageParsersFuzzer_seed_corpus.zip\n\n\nfind ${SRC}/project-parent/tika -name \"*.mdb\" -print0 | xargs -0 zip ${SRC}/seeds/JackcessParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.accdb\" -print0 | xargs -0 zip ${SRC}/seeds/JackcessParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.one\" -print0 | xargs -0 zip ${SRC}/seeds/OneNoteParserFuzzer_seed_corpus.zip\n\n#we could get more seeds by cloning POI\nfind ${SRC}/project-parent/tika -name \"*.msg\" -print0 | xargs -0 zip -u ${SRC}/seeds/OfficeParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.doc\" -print0 | xargs -0 zip -u ${SRC}/seeds/OfficeParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.ppt\" -print0 | xargs -0 zip -u ${SRC}/seeds/OfficeParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.xls\" -print0 | xargs -0 zip -u ${SRC}/seeds/OfficeParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.docm\" -print0 | xargs -0 zip -u ${SRC}/seeds/OOXMLParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.docx\" -print0 | xargs -0 zip -u ${SRC}/seeds/OOXMLParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.pptm\" -print0 | xargs -0 zip -u ${SRC}/seeds/OOXMLParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.pptx\" -print0 | xargs -0 zip -u ${SRC}/seeds/OOXMLParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.xlsm\" -print0 | xargs -0 zip -u ${SRC}/seeds/OOXMLParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.xlsx\" -print0 | xargs -0 zip -u ${SRC}/seeds/OOXMLParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.7z\" -print0 | xargs -0 zip -u ${SRC}/seeds/PackageParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.ar\" -print0 | xargs -0 zip -u ${SRC}/seeds/PackageParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.jar\" -print0 | xargs -0 zip -u ${SRC}/seeds/PackageParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.rar\" -print0 | xargs -0 zip -u ${SRC}/seeds/PackageParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.tar\" -print0 | xargs -0 zip -u ${SRC}/seeds/PackageParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.zip\" -print0 | xargs -0 zip -u ${SRC}/seeds/PackageParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.zlib\" -print0 | xargs -0 zip -u ${SRC}/seeds/PackageParserFuzzer_seed_corpus.zip\n\n\n#we could get more seeds by cloning PDFBox or...?\nfind ${SRC}/project-parent/tika -name \"*.pdf\" -print0 | xargs -0 zip ${SRC}/seeds/PDFParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.eml\" -print0 | xargs -0 zip ${SRC}/seeds/RFC822ParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.rtf\" -print0 | xargs -0 zip ${SRC}/seeds/RTFParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.txt\" -print0 | xargs -0 zip ${SRC}/seeds/TextAndCSVParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.tsv\" -print0 | xargs -0 zip -u ${SRC}/seeds/TextAndCSVParserFuzzer_seed_corpus.zip\nfind ${SRC}/project-parent/tika -name \"*.csv\" -print0 | xargs -0 zip -u ${SRC}/seeds/TextAndCSVParserFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -name \"*.xml\" -print0 | xargs -0 zip ${SRC}/seeds/XMLReaderUtilsFuzzer_seed_corpus.zip\n\nfind ${SRC}/project-parent/tika -path '*/test-documents/*' -type f | xargs -n1 -d '\\n' zip ${SRC}/seeds/AutoDetectParserFuzzer_seed_corpus.zip\n\ncp ${SRC}/seeds/*_seed_corpus.zip ${OUT}/\n\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>17</java.version>\n        <maven.compiler.source>17</maven.compiler.source>\n        <maven.compiler.target>17</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer</artifactId>\n            <version>0.24.0</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.tika</groupId>\n            <artifactId>tika-core</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.tika</groupId>\n            <artifactId>tika-parsers-standard-package</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n    </dependencies>\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-shade-plugin</artifactId>\n                <version>3.6.1</version>\n                <executions>\n                    <execution>\n                        <phase>package</phase>\n                        <goals>\n                            <goal>shade</goal>\n                        </goals>\n                        <configuration>\n                            <createDependencyReducedPom>\n                                false\n                            </createDependencyReducedPom>\n                            <artifactSet>\n                                <excludes>\n                                    <exclude>org.apache.tika:tika-parsers-standard-package:jar:</exclude>\n                                </excludes>\n                            </artifactSet>\n                            <filters>\n                                <filter>\n                                    <artifact>*:*</artifact>\n                                    <excludes>\n                                        <exclude>META-INF/maven/plugin.xml</exclude>\n                                        <exclude>module-info.class</exclude>\n                                        <exclude>META-INF/*</exclude>\n                                        <exclude>LICENSE.txt</exclude>\n                                        <exclude>NOTICE.txt</exclude>\n                                        <exclude>CHANGES</exclude>\n                                        <exclude>README</exclude>\n                                        <exclude>builddef.lst</exclude>\n                                        <!-- https://issues.apache.org/jira/browse/TIKA-3650 -->\n                                        <exclude>javax/**/*</exclude>\n\n                                    </excludes>\n                                </filter>\n                            </filters>\n                            <transformers>\n                                <transformer implementation=\"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer\">\n                                    <!--<mainClass>org.apache.tika.cli.TikaCLI</mainClass>-->\n                                    <manifestEntries>\n                                        <Multi-Release>true</Multi-Release>\n                                    </manifestEntries>\n                                </transformer>\n                                <transformer implementation=\"org.apache.maven.plugins.shade.resource.ServicesResourceTransformer\" />\n                                <transformer implementation=\"org.apache.maven.plugins.shade.resource.IncludeResourceTransformer\">\n                                    <resource>META-INF/LICENSE</resource>\n                                    <file>target/classes/META-INF/LICENSE</file>\n                                </transformer>\n                                <transformer implementation=\"org.apache.maven.plugins.shade.resource.IncludeResourceTransformer\">\n                                    <resource>META-INF/NOTICE</resource>\n                                    <file>target/classes/META-INF/NOTICE</file>\n                                </transformer>\n                                <transformer implementation=\"org.apache.maven.plugins.shade.resource.IncludeResourceTransformer\">\n                                    <resource>META-INF/DEPENDENCIES</resource>\n                                    <file>target/classes/META-INF/DEPENDENCIES</file>\n                                </transformer>\n                                <transformer implementation=\"org.apache.maven.plugins.shade.resource.AppendingTransformer\">\n                                    <resource>META-INF/cxf/bus-extensions.txt</resource>\n                                </transformer>\n                            </transformers>\n                        </configuration>\n                    </execution>\n                </executions>\n            </plugin>\n        </plugins>\n    </build>\n\n</project>\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/AudioVideoParsersFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.parser.AutoDetectParser;\nimport org.apache.tika.parser.Parser;\n\nimport org.apache.tika.parser.audio.AudioParser;\nimport org.apache.tika.parser.audio.MidiParser;\nimport org.apache.tika.parser.mp3.Mp3Parser;\nimport org.apache.tika.parser.mp4.MP4Parser;\nimport org.apache.tika.parser.video.FLVParser;\n\nimport org.apache.tika.sax.ToTextContentHandler;\n\n\nclass AudioVideoParsersFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser[] parsers = new Parser[] {\n                new AudioParser(),\n                new MidiParser(),\n                new Mp3Parser(),\n                new MP4Parser(),\n                new FLVParser()\n        };\n        Parser p = new AutoDetectParser(parsers);\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/AutoDetectParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.parser.AutoDetectParser;\nimport org.apache.tika.parser.Parser;\n\nimport org.apache.tika.sax.ToTextContentHandler;\n\n\nclass AutoDetectParserFuzzer {\n    private static final Parser AUTO_DETECT_PARSER = new AutoDetectParser();\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        try {\n            ParserFuzzer.parseOne(AUTO_DETECT_PARSER, bytes);\n        } catch (AssertionError | RuntimeException | IOException | TikaException | SAXException e) {\n            //swallow\n        }\n        //now try rmeta\n        try {\n            ParserFuzzer.parseRMetaFile(AUTO_DETECT_PARSER, bytes);\n        } catch (AssertionError | RuntimeException | IOException | TikaException | SAXException e) {\n            //swallow\n        }\n    }\n\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/CompressorParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.parser.pkg.CompressorParser;\nimport org.apache.tika.parser.Parser;\n\n\nclass CompressorParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new CompressorParser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (NullPointerException | TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/HtmlParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.parser.Parser;\nimport org.apache.tika.parser.html.JSoupParser;\nimport org.xml.sax.SAXException;\n\nfinal class HtmlParserFuzzer {\n\n    public static void fuzzerTestOneInput(final byte[] bytes) throws Throwable {\n        Parser p = new JSoupParser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (TikaException | SAXException | IOException e) {\n          // swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/ImageParsersFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.parser.AutoDetectParser;\nimport org.apache.tika.parser.Parser;\n\nimport org.apache.tika.parser.image.BPGParser;\nimport org.apache.tika.parser.image.ImageParser;\nimport org.apache.tika.parser.image.PSDParser;\nimport org.apache.tika.parser.image.TiffParser;\nimport org.apache.tika.parser.image.WebPParser;\nimport org.apache.tika.parser.image.JpegParser;\nimport org.apache.tika.parser.image.HeifParser;\nimport org.apache.tika.parser.image.ICNSParser;\nimport org.apache.tika.parser.image.JXLParser;\n\n\nclass ImageParsersFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser[] parsers = new Parser[] {\n                new BPGParser(),\n                new ImageParser(),\n                new PSDParser(),\n                new TiffParser(),\n                new WebPParser(),\n                new JpegParser(),\n                new HeifParser(),\n                new ICNSParser(),\n                new JXLParser()\n        };\n        Parser p = new AutoDetectParser(parsers);\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/JackcessParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.parser.microsoft.JackcessParser;\nimport org.apache.tika.parser.Parser;\n\n\nclass JackcessParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new JackcessParser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (IllegalArgumentException | TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/OOXMLParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.metadata.Metadata;\nimport org.apache.tika.parser.microsoft.OfficeParserConfig;\nimport org.apache.tika.parser.microsoft.ooxml.OOXMLParser;\nimport org.apache.tika.parser.ParseContext;\nimport org.apache.tika.parser.Parser;\nimport org.apache.tika.sax.ToTextContentHandler;\n\n\nclass OOXMLParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new OOXMLParser();\n        ParseContext parseContext = new ParseContext();\n        OfficeParserConfig officeParserConfig = new OfficeParserConfig();\n        officeParserConfig.setExtractMacros(true);\n        parseContext.set(OfficeParserConfig.class, officeParserConfig);\n\n        try {\n            ParserFuzzer.parseOne(p, bytes, parseContext);\n        } catch (org.apache.poi.ooxml.POIXMLException | org.apache.poi.util.RecordFormatException |\n                 AssertionError | IllegalStateException | TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/OfficeParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.metadata.Metadata;\nimport org.apache.tika.parser.microsoft.OfficeParser;\nimport org.apache.tika.parser.microsoft.OfficeParserConfig;\nimport org.apache.tika.parser.ParseContext;\nimport org.apache.tika.parser.Parser;\nimport org.apache.tika.sax.ToTextContentHandler;\n\n\nclass OfficeParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new OfficeParser();\n        ParseContext parseContext = new ParseContext();\n        OfficeParserConfig officeParserConfig = new OfficeParserConfig();\n        officeParserConfig.setExtractMacros(true);\n        parseContext.set(OfficeParserConfig.class, officeParserConfig);\n\n        try {\n            ParserFuzzer.parseOne(p, bytes, parseContext);\n        } catch ( org.apache.poi.util.RecordFormatException |\n                  org.apache.poi.hssf.record.RecordInputStream.LeftoverDataException |\n                  org.apache.poi.hslf.exceptions.HSLFException |\n                  IndexOutOfBoundsException |\n                  AssertionError | IllegalArgumentException | IllegalStateException | java.util.NoSuchElementException |\n                  java.nio.BufferUnderflowException | NegativeArraySizeException | NullPointerException |\n                  TikaException | SAXException | IOException e) {\n            //swallow\n            //org.apache.poi.hssf.OldExcelFormatException subclasses IllegalArgumentException\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/OneNoteParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.parser.microsoft.onenote.OneNoteParser;\nimport org.apache.tika.parser.Parser;\n\n\nclass OneNoteParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new OneNoteParser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/PDFParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.parser.pdf.PDFParser;\nimport org.apache.tika.parser.pdf.PDFParserConfig;\nimport org.apache.tika.parser.ParseContext;\nimport org.apache.tika.parser.Parser;\n\n\nclass PDFParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new PDFParser();\n        PDFParserConfig config = new PDFParserConfig();\n        //what else do we want to exercise?\n        config.setExtractActions(true);\n        ParseContext parseContext = new ParseContext();\n        parseContext.set(PDFParserConfig.class, config);\n        try {\n            ParserFuzzer.parseOne(p, bytes, parseContext);\n        } catch (TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/PackageParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.parser.pkg.PackageParser;\nimport org.apache.tika.parser.Parser;\n\n\nclass PackageParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new PackageParser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (IllegalArgumentException | TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/ParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.InputStream;\n\nimport org.xml.sax.ContentHandler;\n\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.metadata.Metadata;\nimport org.apache.tika.parser.ParseContext;\nimport org.apache.tika.parser.Parser;\nimport org.apache.tika.parser.RecursiveParserWrapper;\nimport org.apache.tika.sax.BasicContentHandlerFactory;\nimport org.apache.tika.sax.RecursiveParserWrapperHandler;\nimport org.apache.tika.sax.ToTextContentHandler;\n\n\nclass ParserFuzzer {\n\n    public static void parseOne(Parser parser, byte[] bytes, ParseContext parseContext) throws Throwable {\n        parseBytes(parser, bytes, parseContext);\n        parseFile(parser, bytes, parseContext);\n    }\n\n\n    public static void parseOne(Parser parser, byte[] bytes) throws Throwable {\n        parseBytes(parser, bytes, new ParseContext());\n        parseFile(parser, bytes, new ParseContext());\n    }\n\n    public static void parseRMetaFile(Parser parser, byte[] bytes) throws Throwable {\n        RecursiveParserWrapper wrapper = new RecursiveParserWrapper(parser);\n        RecursiveParserWrapperHandler rpwh = new RecursiveParserWrapperHandler(\n                new BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE.XML, -1));\n        try (TikaInputStream tis = TikaInputStream.get(bytes)) {\n            tis.getPath();\n            wrapper.parse(tis, rpwh, new Metadata(), new ParseContext());\n        }\n    }\n\n    public static void parseBytes(Parser parser, byte[] bytes, ParseContext parseContext) throws Throwable {\n        ContentHandler handler = new ToTextContentHandler();\n        //make sure that other parsers cannot be invoked\n        parseContext.set(Parser.class, parser);\n        //try first with bytes\n        try (TikaInputStream is = TikaInputStream.get(bytes)) {\n            parser.parse(is, handler, new Metadata(), parseContext);\n        }\n    }\n\n    public static void parseFile(Parser parser, byte[] bytes, ParseContext parseContext) throws Throwable {\n        ContentHandler handler = new ToTextContentHandler();\n        //make sure that other parsers cannot be invoked\n        parseContext.set(Parser.class, parser);\n        try (TikaInputStream tis = TikaInputStream.get(bytes)) {\n            //force writing to tmp file\n            tis.getPath();\n            parser.parse(tis, handler, new Metadata(), parseContext);\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/RFC822ParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.parser.mail.RFC822Parser;\nimport org.apache.tika.parser.Parser;\n\n\nclass RFC822ParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new RFC822Parser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/RTFParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.metadata.Metadata;\nimport org.apache.tika.parser.ParseContext;\nimport org.apache.tika.parser.Parser;\nimport org.apache.tika.parser.microsoft.rtf.RTFParser;\nimport org.apache.tika.sax.ToTextContentHandler;\n\n\nclass RTFParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new RTFParser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (AssertionError | TikaException | SAXException | IOException |\n                 org.apache.tika.metadata.PropertyTypeException e) {\n            //swallow\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/TextAndCSVParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.metadata.Metadata;\nimport org.apache.tika.parser.ParseContext;\nimport org.apache.tika.parser.Parser;\nimport org.apache.tika.parser.csv.TextAndCSVParser;\nimport org.apache.tika.sax.ToTextContentHandler;\n\n\nclass TextAndCSVParserFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Throwable {\n        Parser p = new TextAndCSVParser();\n        try {\n            ParserFuzzer.parseOne(p, bytes);\n        } catch (TikaException | SAXException | IOException e) {\n            //swallow\n        }\n    }\n\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/java/com/example/XMLReaderUtilsFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.File;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Comparator;\nimport java.util.stream.Stream;\n\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.XMLStreamReader;\n\nimport org.w3c.dom.Document;\nimport org.xml.sax.ContentHandler;\nimport org.xml.sax.SAXException;\nimport org.xml.sax.SAXParseException;\n\nimport org.apache.tika.exception.TikaException;\nimport org.apache.tika.io.TikaInputStream;\nimport org.apache.tika.parser.ParseContext;\nimport org.apache.tika.sax.ToTextContentHandler;\nimport org.apache.tika.utils.XMLReaderUtils;\n\n\nclass XMLReaderUtilsFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] bytes) throws Exception {\n        try {\n            parseOne(bytes);\n        } catch (java.io.FileNotFoundException e) {\n            //this should be rethrown because it could signal an XMLParser looking for a DTD\n            throw e;\n        } catch (TikaException | IOException | SAXException e) {\n            e.printStackTrace();\n        }\n    }\n\n    private static void parseOne(byte[] bytes) throws TikaException, IOException, SAXException {\n\n        //dom\n        try (InputStream is = TikaInputStream.get(bytes)) {\n            Document doc = XMLReaderUtils.buildDOM(is, new ParseContext());\n        } catch (SAXParseException e) {\n            //swallow\n        }\n        //sax\n        try (InputStream is = TikaInputStream.get(bytes)) {\n            ToTextContentHandler toTextContentHandler = new ToTextContentHandler();\n            XMLReaderUtils.parseSAX(is, toTextContentHandler, new ParseContext());\n        } catch (SAXException e) {\n            //swallow\n        }\n\n        //stax\n        try (InputStream is = TikaInputStream.get(bytes)) {\n            XMLStreamReader reader = XMLReaderUtils.getXMLInputFactory(new ParseContext())\n                .createXMLStreamReader(is);\n            while (reader.hasNext()) {\n                reader.next();\n            }\n        } catch (java.util.MissingResourceException | XMLStreamException e) {\n            //MissingResourceException can be thrown when an internal DTD has an InvalidCharInDTD\n            //throw new TikaException(\"xml stream\", e);\n        }\n    }\n}\n"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/resources/log4j2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Configuration status=\"WARN\">\n  <Appenders>\n    <Console name=\"Console\" target=\"SYSTEM_OUT\">\n      <PatternLayout pattern=\"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n\"/>\n    </Console>\n  </Appenders>\n  <Loggers>\n    <Root level=\"OFF\">\n      <AppenderRef ref=\"Console\"/>\n    </Root>\n  </Loggers>\n</Configuration>"
  },
  {
    "path": "projects/apache-tika/project-parent/fuzz-targets/src/main/resources/tika-config.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n<!--\n  Licensed to the Apache Software Foundation (ASF) under one\n  or more contributor license agreements.  See the NOTICE file\n  distributed with this work for additional information\n  regarding copyright ownership.  The ASF licenses this file\n  to you under the Apache License, Version 2.0 (the\n  \"License\"); you may not use this file except in compliance\n  with the License.  You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing,\n  software distributed under the License is distributed on an\n  \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n  KIND, either express or implied.  See the License for the\n  specific language governing permissions and limitations\n  under the License.\n-->\n<properties>\n  <service-loader initializableProblemHandler=\"throw\"/>\n  <parsers>\n    <parser class=\"org.apache.tika.parser.DefaultParser\">\n      <parser-exclude class=\"org.apache.tika.parser.pdf.PDFParser\"/>\n    </parser>\n    <parser class=\"org.apache.tika.parser.pdf.PDFParser\">\n      <params>\n        <!-- this is the one that matters -->\n        <param name=\"extractAcroFormContent\" type=\"bool\">false</param>\n        <!-- this can override the above. make absolutely sure this is false -->\n        <param name=\"ifXFAExtractOnlyXFA\" type=\"bool\">false</param>\n      </params>\n    </parser>\n  </parsers>\n</properties>\n"
  },
  {
    "path": "projects/apache-tika/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>tika</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/apache-tika/project.yaml",
    "content": "homepage: \"https://tika.apache.org/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/tika/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"dev-owner@tika.apache.org\"\n  - \"tallison@apache.org\"\n  - \"tallison314159@gmail.com\"\n"
  },
  {
    "path": "projects/aptos-core/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libclang-dev libtool pkg-config libudev-dev\nRUN git clone --depth=1 https://github.com/aptos-labs/aptos-core.git\nENV RUSTUP_TOOLCHAIN nightly-2024-09-05\nWORKDIR aptos-core\nCOPY build.sh $SRC\n"
  },
  {
    "path": "projects/aptos-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd testsuite/fuzzer\nbash fuzz.sh build-oss-fuzz $OUT"
  },
  {
    "path": "projects/aptos-core/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://aptos.dev\"\nlanguage: rust\nprimary_contact: \"andrea.cappa@aptoslabs.com\"\nmain_repo: \"https://github.com/aptos-labs/aptos-core\"\nauto_ccs:\n  - \"oss-fuzz-notifications@aptoslabs.com\"\n  - \"security@aptoslabs.com\"\n  - \"marco.ilardi@aptoslabs.com\"\n  - \"george@aptoslabs.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\ncoverage_extra_args: -ignore-filename-regex=.*/rustc/.*"
  },
  {
    "path": "projects/archaius-core/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/Netflix/archaius\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nCOPY pom-core.xml $SRC/archaius/archaius-core/pom.xml\nWORKDIR $SRC/archaius"
  },
  {
    "path": "projects/archaius-core/DynamicPropertyFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.netflix.config.*;\n\nimport java.util.*;\n\npublic class DynamicPropertyFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tString property = data.consumeString(50);\n\t\tString value = data.consumeString(100);\n\n\t\tDynamicLongProperty dpLong =  new DynamicLongProperty(property, data.consumeLong());\n\t\tdpLong.get();\n\n\t\tDynamicFloatProperty dpFloat = new DynamicFloatProperty(property, data.consumeFloat());\n\t\tdpFloat.get();\n\n\t\tDynamicStringProperty dpString = new DynamicStringProperty(property, value);\n\t\tdpString.get();\n\n\t\tDynamicStringSetProperty dpStringSet = new DynamicStringSetProperty(property, value);\n\t\tdpStringSet.get();\n\n\t\tDynamicStringMapProperty dpStringMap = new DynamicStringMapProperty(property, value);\n\t\tdpStringMap.get();\n\n\t\tDynamicStringListProperty dpStringList = new DynamicStringListProperty(property, value);\n\t\tdpStringList.get();\n\n\t\tDynamicContextualProperty dpContextual = new DynamicContextualProperty<Object>(property, value);\n\t} \n}"
  },
  {
    "path": "projects/archaius-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd archaius-core\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/archaius-core-$CURRENT_VERSION-jar-with-dependencies.jar\" \"$OUT/archaius-core.jar\"\n\nALL_JARS=\"archaius-core.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/archaius-core/pom-core.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n    <name>archaius-core</name> \n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.netflix.archaius</groupId>\n    <artifactId>archaius-core</artifactId>\n    <version>0.6.0</version>\n    <packaging>jar</packaging>\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-assembly-plugin</artifactId>\n                <executions>\n                    <execution>\n                        <phase>package</phase>\n                        <goals>\n                            <goal>single</goal>\n                        </goals>\n                        <configuration>\n                            <descriptorRefs>\n                                <descriptorRef>jar-with-dependencies</descriptorRef>\n                            </descriptorRefs>\n                        </configuration>\n                    </execution>\n                </executions>\n            </plugin>\n        </plugins>\n      </build>\n    <properties>\n        <maven.compiler.source>1.7</maven.compiler.source>\n        <maven.compiler.target>1.7</maven.compiler.target>\n    </properties>\n    <dependencies>\n        <dependency>\n            <groupId>javax.annotation</groupId>\n            <artifactId>javax.annotation-api</artifactId>\n            <version>1.3.2</version>\n        </dependency>\n        <dependency>\n            <groupId>com.google.code.findbugs</groupId>\n            <artifactId>jsr305</artifactId>\n            <version>3.0.2</version>\n        </dependency>\n        <dependency>\n            <groupId>commons-configuration</groupId>\n            <artifactId>commons-configuration</artifactId>\n            <version>1.8</version>\n        </dependency>\n        <dependency>\n            <groupId>org.slf4j</groupId>\n            <artifactId>slf4j-api</artifactId>\n            <version>1.6.2</version>\n        </dependency>\n        <dependency>\n            <groupId>org.slf4j</groupId>\n            <artifactId>slf4j-nop</artifactId>\n            <version>1.7.5</version>\n        </dependency>\n        <dependency>\n            <groupId>com.google.guava</groupId>\n            <artifactId>guava</artifactId>\n            <version>16.0</version>\n        </dependency>\n        <dependency>\n            <groupId>com.fasterxml.jackson.core</groupId>\n            <artifactId>jackson-annotations</artifactId>\n            <version>2.4.3</version>\n        </dependency>\n        <dependency>\n            <groupId>com.fasterxml.jackson.core</groupId>\n            <artifactId>jackson-core</artifactId>\n            <version>2.4.3</version>\n        </dependency>\n        <dependency>\n            <groupId>com.fasterxml.jackson.core</groupId>\n            <artifactId>jackson-databind</artifactId>\n            <version>2.4.3</version>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.derby</groupId>\n            <artifactId>derby</artifactId>\n            <version>10.8.2.2</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>commons-io</groupId>\n            <artifactId>commons-io</artifactId>\n            <version>1.3.2</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.mockito</groupId>\n            <artifactId>mockito-core</artifactId>\n            <version>1.9.5</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>junit</groupId>\n            <artifactId>junit</artifactId>\n            <version>4.11</version>\n            <scope>test</scope>\n        </dependency>\n    </dependencies>\n    <description>archaius-core</description>\n    <url>https://github.com/Netflix/archaius</url>\n</project>\n"
  },
  {
    "path": "projects/archaius-core/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/Netflix/archaius\"\nlanguage: jvm\nmain_repo: \"https://github.com/Netflix/archaius.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/arduinojson/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make zip git\nRUN git clone --depth 1 https://github.com/bblanchon/ArduinoJson.git arduinojson\nWORKDIR arduinojson\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/arduinojson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build fuzzers\ncd extras/fuzzing\nmake\n\n# Build unit testing\nif [[ \"$SANITIZER\" == \"memory\" ]]\nthen\n  # Unit test building with MSAN requires explicit sanitizer flags.\n  export LDFLAGS=\"-fsanitize=$SANITIZER\"\nfi\n\nmkdir $SRC/arduinojson/build-tests\ncd $SRC/arduinojson/build-tests\ncmake .. -DCMAKE_CXX_FLAGS=\"-Wno-error=deprecated-literal-operator\"\nmake -C \"extras/tests/\" -j$(nproc)\nmake -C \"extras/fuzzing/\" -j$(nproc)\n"
  },
  {
    "path": "projects/arduinojson/project.yaml",
    "content": "homepage: \"https://github.com/bblanchon/ArduinoJson\"\nlanguage: c++\nprimary_contact: \"benoit.blanchon@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/bblanchon/ArduinoJson.git'\n"
  },
  {
    "path": "projects/arduinojson/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [[ \"$SANITIZER\" == \"memory\" ]]\nthen\n  # Unit test will failed on these test cases because of uninitialized memory, thus skipping them.\n  ctest --test-dir $SRC/arduinojson/build-tests -j$(nproc) -E \\\n    \"Cpp17|Cpp20|Deprecated|IntegrationTests|JsonArray|JsonArrayConst|JsonDeserializer|JsonDocument|JsonObject|JsonObjectConst|JsonSerializer|JsonVariant|JsonVariantConst|ResourceManager|Misc|MixedConfiguration|MsgPackDeserializer|MsgPackSerializer|Numbers|TextFormatter|json_fuzzer|msgpack_fuzzer\"\nelse\n  ctest --test-dir $SRC/arduinojson/build-tests -j$(nproc)\nfi\n"
  },
  {
    "path": "projects/argcomplete/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/kislyuk/argcomplete argcomplete\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/argcomplete\n"
  },
  {
    "path": "projects/argcomplete/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/argcomplete/fuzz_shlex.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets the lexical routines used by argcomplete.\"\"\"\nimport sys\nimport atheris\nimport argcomplete\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    argcomplete.split_line(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (argcomplete.ArgcompleteException):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/argcomplete/project.yaml",
    "content": "homepage: https://github.com/kislyuk/argcomplete\nmain_repo: https://github.com/kislyuk/argcomplete\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/argo/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN apt-get update && apt-get install -y wget zip\nRUN git clone --depth 1 https://github.com/argoproj/argo-cd\nRUN git clone --depth 1 https://github.com/argoproj/argo-workflows\nRUN git clone --depth 1 https://github.com/argoproj/argo-events\nRUN git clone --depth 1 https://github.com/argoproj/gitops-engine\nRUN git clone --depth 1 https://github.com/argoproj/argo-rollouts\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN wget https://github.com/facebook/zstd/releases/download/v1.4.2/zstd-1.4.2.tar.gz && \\\n    tar xzf zstd-1.4.2.tar.gz && \\\n    cd zstd-1.4.2 && \\\n    export CC=clang && \\\n    export CXX=clang++ && \\\n    export CXXFLAGS=\"-stdlib=libc++\" && \\\n    make -j$(nproc)\nCOPY build.sh $SRC/\nWORKDIR $SRC/argo-cd\n"
  },
  {
    "path": "projects/argo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/argo/build.sh\n\n\n"
  },
  {
    "path": "projects/argo/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://argoproj.github.io/\"\nmain_repo: \"https://github.com/argoproj\"\nprimary_contact: \"terrytangyuan@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"henrik.blixt@gmail.com\"\n  - \"jfischer@redhat.com\"\n  - \"alexander_matyushentsev@intuit.com\"\n  - \"qianbo_huai@intuit.com\"\n  - \"alex_collins@intuit.com\"\n  - \"derek_wang@intuit.com\"\n  - \"saravanan_balasubramanian@intuit.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/args/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y \\\n    make \\\n    cmake\n\nRUN git clone --depth 1 https://github.com/Taywee/args.git $SRC/args/\n\nCOPY build.sh run_tests.sh $SRC/\nWORKDIR $SRC/args/\n\n"
  },
  {
    "path": "projects/args/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\n\ncmake -DCMAKE_BUILD_TYPE=Release -DARGS_BUILD_TESTS=ON ..\nmake -j4\n\nfor fuzzer in $(find $SRC/args/fuzz/ -name \"*_fuzzer.cpp\"); do\n    fuzzer_basename=$(basename -s .cpp $fuzzer)\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n        -I$SRC/args \\\n        $fuzzer \\\n        -o $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/args/project.yaml",
    "content": "homepage: \"https://taywee.github.io/args/\"\nmain_repo: \"https://github.com/Taywee/args\"\nlanguage: c++\nprimary_contact: \"taylor@axfive.net\"\n\n"
  },
  {
    "path": "projects/args/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd build\nctest --output-on-failure\n"
  },
  {
    "path": "projects/args4j/CmdLineParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.kohsuke.args4j.*;\nimport org.kohsuke.args4j.spi.StringArrayOptionHandler;\n\nimport java.io.File;\nimport java.util.*;\n\npublic class CmdLineParserFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ParserProperties props = ParserProperties.defaults();\n        try {\n            props.withAtSyntax(data.consumeBoolean());\n            props.withShowDefaults(data.consumeBoolean());\n            props.withUsageWidth(data.consumeInt());\n            props.withOptionValueDelimiter(data.consumeString(100));\n        } catch (IllegalArgumentException e) {}\n\n        Collection<String> args = new HashSet<String>();\n        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n            args.add(data.consumeString(100));\n        }\n\n        CmdLineParser parser = new CmdLineParser(DummyClass.class);\n        try {\n            parser.parseArgument(args);\n        } catch (CmdLineException e) {}\n    }\n\n    static class DummyClass {\n        @Option(name=\"-str\",usage=\"set a string\")\n        public String str = \"pretty string\";\n\n        @Option(name=\"-req\",usage=\"set a string\", required = true)\n        public String req = \"required\";\n\n        @Option(name=\"-noDefault\")\n        public String noDefault;\n\n        @Option(name=\"-noDefaultReq\", required = true)\n        public String noDefaultReq;\n\n        @Option(name=\"-byteVal\", usage = \"my favorite byte\")\n        public byte byteVal;\n\n        @Option(name=\"-strArray\", usage=\"my favorite strarr\")\n        public String strArray[] = new String[] { \"san\", \"dra\", \"chen\"};\n\n        public enum DrinkName {\n            BEER,\n            WHISKEY,\n            SCOTCH,\n            BOURBON,\n            BRANDY\n        };\n\n        @Option(name=\"-drinkArray\", usage=\"my favorite drinks\")\n        public DrinkName drinkArray[] = new DrinkName[] { DrinkName.BEER, DrinkName.BOURBON };\n\n        @Option(name=\"-drink\", usage=\"my favorite drink\")\n        public DrinkName drink = DrinkName.BEER;\n\n        @Option(name=\"-drinkList\", usage=\"my favorite drinks\")\n        public List<DrinkName> drinkList = Arrays.asList(DrinkName.BEER, DrinkName.BRANDY);\n\n        @Argument\n        public String arguments[] = new String[] { \"foo\", \"bar\" };\n\n        @Option(name=\"-o\", usage=\"output to this file\", metaVar=\"OUTPUT\")\n        private File out = new File(\".\");\n\n        @Option(name=\"-hidden-str\", hidden=true, usage=\"hidden option\")\n        private String hiddenStr = \"(default value)\";\n\n        @Option(name=\"-n\", usage=\"repeat <n> times\\n\")\n        private int num = -1;\n\n        @Option(name=\"-boolean\")\n        public boolean _boolean;\n\n        @Option(name=\"-byte\")\n        public byte _byte;\n\n        @Option(name=\"-char\")\n        public char _char;\n\n        @Option(name=\"-double\")\n        public double _double;\n\n        @Option(name=\"-float\")\n        public float _float;\n\n        @Option(name=\"-int\")\n        public int _int;\n\n        @Option(name=\"-long\")\n        public long _long;\n\n        @Option(name=\"-short\")\n        public short _short;\n\n        @Option(name = \"-z\", depends ={\"-y\"})\n        int a;\n\n        @Option(name = \"-y\", depends ={\"-z\"})\n        int b;\n\n        @Option(name = \"-a\", aliases=\"--alpha\")\n        int w;\n\n        @Option(name = \"-b\", aliases=\"--bravo\")\n        int x;\n\n        @Option(name = \"-c\", depends ={\"--alpha\"})\n        int y;\n\n        @Option(name = \"-d\", depends ={\"-b\", \"-c\"})\n        int z;\n\n        @Option(name = \"-h\", forbids ={\"-a\", \"-b\"})\n        int o;\n\n        @Option(name=\"-list\")\n        List<String> list;\n\n        @Option(name=\"-string\")\n        String string;\n\n        @Option(name=\"-array\")\n        String[] array;\n\n        @Option(name=\"-multivalued-array\", handler = StringArrayOptionHandler.class)\n        String[] multiValuedArray;\n    }\n}\n"
  },
  {
    "path": "projects/args4j/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone --depth 1 https://github.com/kohsuke/args4j $SRC/args4j\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/args4j\n"
  },
  {
    "path": "projects/args4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n\n$MVN package -pl -args4j-tools -pl -args4j-maven-plugin -pl -args4j-maven-plugin-example\n\ncp \"../args4j/args4j/target/args4j-$CURRENT_VERSION.jar\" $OUT/\n\nALL_JARS=$(find $OUT/ -name *.jar ! -name jazzer*.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone "
  },
  {
    "path": "projects/args4j/project.yaml",
    "content": "homepage: \"https://github.com/kohsuke/args4j\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/kohsuke/args4j\"\nsanitizers:\n  - address\nvendor_ccs:\n"
  },
  {
    "path": "projects/arrow/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nENV DEBIAN_FRONTEND=noninteractive\nRUN apt-get update -y -q && \\\n    apt-get install -y -q --no-install-recommends \\\n        bison \\\n        flex \\\n        ninja-build\n\nARG boost_version=1.89.0\n# uuid and locale needed for Thrift source build\nARG boost_components=filesystem;system;process;multiprecision;crc;uuid;locale\n\nRUN wget https://github.com/boostorg/boost/releases/download/boost-${boost_version}/boost-${boost_version}-cmake.tar.gz && \\\n    tar -xf boost-${boost_version}-cmake.tar.gz && \\\n    cd boost-${boost_version}/ && \\\n    mkdir -p build / && \\\n    cd build/ && \\\n    cmake .. -GNinja -DBOOST_INCLUDE_LIBRARIES=\"${boost_components}\" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \\\n    cmake --build . --target install\n\nRUN git clone --depth=1 --recurse-submodules \\\n    https://github.com/apache/arrow.git $SRC/arrow\n\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/arrow/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# 1. Build instrumented OpenSSL\n\nOPENSSL_VERSION=3.5.4\n\ncd ${SRC}\nwget https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz\ntar -xf openssl-${OPENSSL_VERSION}.tar.gz\ncd openssl-${OPENSSL_VERSION}\n# Assembler snippets would not be instrumented, disable them\n./Configure no-apps no-docs no-tests no-shared no-asm\nmake -j\nmake install\n\n# 2. Build Arrow C++ proper\n\nARROW=${SRC}/arrow/cpp\n\nBUILD_DIR=${SRC}/build-dir\nmkdir -p ${BUILD_DIR}\ncd ${BUILD_DIR}\n\ncmake ${ARROW} -GNinja \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DARROW_DEPENDENCY_SOURCE=BUNDLED \\\n    -DARROW_OPENSSL_USE_SHARED=off \\\n    -DBOOST_SOURCE=SYSTEM \\\n    -DARROW_BOOST_USE_SHARED=off \\\n    -DCMAKE_C_FLAGS=\"${CFLAGS}\" \\\n    -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\" \\\n    -DARROW_EXTRA_ERROR_CONTEXT=off \\\n    \\\n    -DARROW_BUILD_SHARED=off \\\n    -DARROW_BUILD_STATIC=on \\\n    -DARROW_BUILD_BENCHMARKS=off \\\n    -DARROW_BUILD_EXAMPLES=off \\\n    -DARROW_BUILD_INTEGRATION=off \\\n    -DARROW_BUILD_TESTS=on \\\n    -DARROW_BUILD_UTILITIES=off \\\n    -DARROW_TEST_LINKAGE=static \\\n    -DPARQUET_BUILD_EXAMPLES=off \\\n    -DPARQUET_BUILD_EXECUTABLES=off \\\n    -DPARQUET_REQUIRE_ENCRYPTION=on \\\n    \\\n    -DARROW_CSV=on \\\n    -DARROW_JEMALLOC=off \\\n    -DARROW_MIMALLOC=off \\\n    -DARROW_PARQUET=on \\\n    -DARROW_WITH_BROTLI=on \\\n    -DARROW_WITH_BZ2=off \\\n    -DARROW_WITH_LZ4=on \\\n    -DARROW_WITH_SNAPPY=on \\\n    -DARROW_WITH_ZLIB=on \\\n    -DARROW_WITH_ZSTD=on \\\n    \\\n    -DARROW_USE_ASAN=off \\\n    -DARROW_USE_UBSAN=off \\\n    -DARROW_USE_TSAN=off \\\n    -DARROW_FUZZING=on \\\n\ncmake --build . -j$(nproc)\n\n${ARROW}/build-support/fuzzing/generate_corpuses.sh ${BUILD_DIR}/release\n\n# Copy fuzz targets\nfind . -executable -name \"*-fuzz\" -exec cp -a -v '{}' ${OUT} \\;\n# Copy seed corpuses\nfind . -name \"*-fuzz_seed_corpus.zip\" -exec cp -a -v '{}' ${OUT} \\;\n"
  },
  {
    "path": "projects/arrow/project.yaml",
    "content": "homepage: \"https://arrow.apache.org/\"\nlanguage: c++\nprimary_contact: \"antoine@python.org\"\nauto_ccs:\n  - \"bengilgit@gmail.com\"\n  - \"dewey.dunnington@gmail.com\"\n  - \"emkornfield@gmail.com\"\n  - \"felipekde@gmail.com\"\n  - \"fsaintjacques@gmail.com\"\n  - \"jinpengz@google.com\"\n  - \"maplewish117@gmail.com\"\n  - \"micahk@google.com\"\n  - \"muraken@gmail.com\"\n  - \"panahi@google.com\"\n  - \"raulcumplido@gmail.com\"\n  - \"szucs.krisztian@gmail.com\"\n  - \"wesmckinn@gmail.com\"\n  - \"xhochy@gmail.com\"\n  - \"ustcwg@gmail.com\"\n  - \"will.jones127@gmail.com\"\n  - \"zanmato1984@gmail.com\"\n  - \"zotthewizard@gmail.com\"\nmain_repo: 'https://github.com/apache/arrow.git'\n"
  },
  {
    "path": "projects/arrow/replay_build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nARROW=${SRC}/arrow/cpp\n\nBUILD_DIR=${SRC}/build-dir\ncd ${BUILD_DIR}\n\ncmake --build . -j$(nproc)\n\n# Copy fuzz targets\nfind . -executable -name \"*-fuzz\" -exec cp -a -v '{}' ${OUT} \\;\n"
  },
  {
    "path": "projects/arrow/run_tests.sh",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nset -eux\n\ncd $SRC/build-dir\n\nexport PARQUET_TEST_DATA=$SRC/arrow/cpp/submodules/parquet-testing/data/\nexport ARROW_TEST_DATA=$SRC/arrow/testing/data\nASAN_OPTIONS=\"detect_leaks=0\" ctest -j$(nproc)\n"
  },
  {
    "path": "projects/arrow-java/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nENV JAVA_HOME=$JAVA_15_HOME\nENV JVM_LD_LIBRARY_PATH=$JAVA_HOME/lib/server\nENV PATH=$JAVA_HOME/bin:$PATH\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN=$SRC/maven/apache-maven-3.9.11/bin/mvn\n\nRUN git clone https://github.com/apache/arrow-java.git $SRC/arrow-java\n\nRUN git clone https://github.com/apache/arrow-testing.git $SRC/arrow-testing\n\n# Seed corpus\nRUN zip -j $SRC/FuzzIpcFile_seed_corpus.zip $SRC/arrow-testing/data/arrow-ipc-file/clusterfuzz-testcase-arrow-ipc-file-fuzz-* && \\\n    zip -j $SRC/FuzzIpcStream_seed_corpus.zip $SRC/arrow-testing/data/arrow-ipc-stream/clusterfuzz-testcase-arrow-ipc-stream-fuzz-*\n\n# Copy build script and all fuzzers\nCOPY build.sh $SRC/\nCOPY Fuzz*.java $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/arrow-java/FuzzIpcFile.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\nimport org.apache.arrow.memory.BufferAllocator;\nimport org.apache.arrow.memory.RootAllocator;\nimport org.apache.arrow.vector.VectorSchemaRoot;\nimport org.apache.arrow.vector.ipc.ArrowFileReader;\nimport org.apache.arrow.vector.ipc.InvalidArrowFileException;\nimport org.apache.arrow.vector.ipc.SeekableReadChannel;\nimport org.apache.arrow.vector.util.ByteArrayReadableSeekableByteChannel;\nimport org.apache.arrow.vector.util.ValueVectorUtility;\n\npublic class FuzzIpcFile {\n\n    public static void fuzzerTestOneInput(byte[] data) {\n        BufferAllocator allocator = new RootAllocator(Integer.MAX_VALUE);\n        try (SeekableReadChannel channel = new SeekableReadChannel(new ByteArrayReadableSeekableByteChannel(data));\n            ArrowFileReader reader = new ArrowFileReader(channel, allocator)) {\n            VectorSchemaRoot root = reader.getVectorSchemaRoot();\n\n            // validate schema\n            ValueVectorUtility.validate(root);\n\n            while (reader.loadNextBatch()) {\n                ValueVectorUtility.validateFull(root);\n            }\n        } catch (IOException | InvalidArrowFileException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/arrow-java/FuzzIpcStream.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\nimport org.apache.arrow.memory.BufferAllocator;\nimport org.apache.arrow.memory.RootAllocator;\nimport org.apache.arrow.vector.VectorSchemaRoot;\nimport org.apache.arrow.vector.ipc.ArrowStreamReader;\nimport org.apache.arrow.vector.util.ValueVectorUtility;\n\npublic class FuzzIpcStream {\n\n    public static void fuzzerTestOneInput(byte[] data) {\n        BufferAllocator allocator = new RootAllocator(Integer.MAX_VALUE);\n        try (ArrowStreamReader reader = new ArrowStreamReader(new ByteArrayInputStream(data), allocator)) {\n            VectorSchemaRoot root = reader.getVectorSchemaRoot();\n\n            // validate schema\n            ValueVectorUtility.validate(root);\n\n            while (reader.loadNextBatch()) {\n                ValueVectorUtility.validateFull(root);\n            }\n        } catch (IOException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/arrow-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Only build the Java module\nMAVEN_ARGS=\"-DskipTests\"\ncd arrow-java\n$MVN install ${MAVEN_ARGS}\n\n# copy dependencies\n$MVN dependency:copy-dependencies -DoutputDirectory=$OUT\n\n# setup class path\nALL_JARS=\"\"\nfor jar in $(find $OUT -name '*.jar'); do\n  jar_name=$(basename $jar)\n  ALL_JARS=$ALL_JARS\" \"$jar_name\ndone\n\ncd ../..\n\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -name 'Fuzz*.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\n\nexport JAVA_HOME=$JAVA_15_HOME\nexport JVM_LD_LIBRARY_PATH=$JAVA_HOME/lib/server\nexport PATH=$JAVA_HOME/bin:$PATH\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/arrow-java/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://arrow.apache.org/\"\nlanguage: jvm\nprimary_contact: \"liya.fan03@gmail.com\"\nauto_ccs:\n  - \"emkornfield@gmail.com\"\n  - \"jacques@apache.org\"\n  - \"wesmckinn@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/arrow-java\"\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/arrow-py/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/arrow-py/arrow arrow\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/arrow\n"
  },
  {
    "path": "projects/arrow-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/arrow-py/fuzz_datetime.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport arrow\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  datetime_string = fdp.ConsumeUnicodeNoSurrogates(\n      fdp.ConsumeIntInRange(1, 4096))\n\n  # Class target.\n  try:\n    c1 = arrow.parser.DateTimeParser()\n    c1.parse_iso(datetime_string)\n  except (\n      arrow.parser.ParserMatchError,\n      arrow.parser.ParserError,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/arrow-py/fuzz_tzinfo.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport arrow\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  tzinfo_string = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n\n  # Class target.\n  try:\n    c1 = arrow.parser.TzinfoParser()\n    c1.parse(tzinfo_string)\n  except (arrow.parser.ParserError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/arrow-py/project.yaml",
    "content": "homepage: https://github.com/arrow-py/arrow\nmain_repo: https://github.com/arrow-py/arrow\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nprimary_contact: me@krisfremen.com\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/askama/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/askama-rs/askama.git askama\nWORKDIR askama/fuzzing\n\n# The current default toolchain used by OSS-Fuzz (1.81) is too old for askama v0.15,\n# which needs at least 1.88.\nENV RUSTUP_TOOLCHAIN nightly-2025-07-04\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/askama/build.sh",
    "content": "#!/bin/bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -euxo pipefail\n\ntarget_out_dir=target/x86_64-unknown-linux-gnu/release\ncargo fuzz build --release\ncargo fuzz list | while read i; do\n    zip --recurse-paths --junk-paths --quiet \"${OUT}/${i}_seed_corpus.zip\" \"./fuzz/corpus/${i}/\"\n    mv -t \"${OUT}/\" \"$target_out_dir/${i}\"\ndone\n"
  },
  {
    "path": "projects/askama/project.yaml",
    "content": "homepage: \"https://askama.readthedocs.io/\"\nmain_repo: \"https://github.com/askama-rs/askama\"\nlanguage: rust\nprimary_contact: \"rene.kijewski@fu-berlin.de\"\nauto_ccs:\n  - \"guillaume1.gomez@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/rustc/.*\n  -ignore-filename-regex=.*/rust/.*\n"
  },
  {
    "path": "projects/asn1crypto/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/wbond/asn1crypto asn1crypto\nWORKDIR asn1crypto\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/asn1crypto/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/asn1crypto/fuzz_parse.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nimport sys\nimport atheris\nfrom asn1crypto import parser\n\ndef TestOneInput(data):\n    try:\n        parser.parse(data)\n    except (ValueError, TypeError) as e:\n        # Raises ValueError and TypeError:\n        # https://github.com/wbond/asn1crypto/blob/b5f03e6f9797c691a3b812a5bb1acade3a1f4eeb/asn1crypto/parser.py#L91-L92\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/asn1crypto/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/wbond/asn1crypto\nlanguage: python\nmain_repo: https://github.com/wbond/asn1crypto\nsanitizers:\n- address\nprimary_contact: \"will@wbond.net\"\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/aspectj/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nENV TARGET_PACKAGE_PREFIX org.aspectj.*\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/eclipse/org.aspectj\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/org.aspectj\n"
  },
  {
    "path": "projects/aspectj/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-Dmaven.compiler.source=15 -Dmaven.compiler.target=15 -DskipTests\"\nALL_JARS=\"\"\n\n# install the build servers' jazzer-api into the maven repository\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/org.aspectj\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -DaspectjVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/aspectj-fuzzer-${CURRENT_VERSION}.jar ${OUT}/aspectj-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} aspectj-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n  stripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n  # the .java was stripped by sed\n  if (echo ${stripped_path} | grep \".java$\"); then\n\tcontinue;\n  fi\n\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  fuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n  chmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/aspectj/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>aspectj-fuzzer</artifactId>\n\t<version>${aspectjVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<exec.mainClass>ossfuzz.ASTFuzzer</exec.mainClass>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\ton the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\tto avoid mismatching driver/api versions\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.aspectj</groupId>\n\t\t\t<artifactId>aspectjrt</artifactId>\n\t\t\t<version>${aspectjVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.aspectj</groupId>\n\t\t\t<artifactId>aspectjtools</artifactId>\n\t\t\t<version>${aspectjVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.aspectj</groupId>\n\t\t\t<artifactId>aspectjweaver</artifactId>\n\t\t\t<version>${aspectjVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/aspectj/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.eclipse.org/aspectj/\"\nlanguage: jvm\nmain_repo: \"https://github.com/eclipse/org.aspectj\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/aspectj/src/main/java/ossfuzz/ASTFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.HashMap;\n\nimport org.aspectj.org.eclipse.jdt.core.dom.AST;\nimport org.aspectj.org.eclipse.jdt.core.dom.ASTParser;\nimport org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;\n\npublic class ASTFuzzer {\n\t// Valid AST JLS levels supported by AspectJ/Eclipse JDT\n\tprivate static final int[] VALID_AST_LEVELS = {\n\t\tAST.JLS2,   // 2\n\t\tAST.JLS3,   // 3\n\t\tAST.JLS4,   // 4\n\t\tAST.JLS8,   // 8\n\t\tAST.JLS9,   // 9\n\t\tAST.JLS10,  // 10\n\t\tAST.JLS11,  // 11\n\t\tAST.JLS12,  // 12\n\t\tAST.JLS13,  // 13\n\t\tAST.JLS14,  // 14\n\t\tAST.JLS15,  // 15\n\t\tAST.JLS16,  // 16\n\t\tAST.JLS17,  // 17\n\t\tAST.JLS18,  // 18\n\t\tAST.JLS19,  // 19\n\t\tAST.JLS20,  // 20\n\t};\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\ttry {\n\t\t\tint astlevel = fuzzedDataProvider.pickValue(VALID_AST_LEVELS);\n\t\t\tString source = fuzzedDataProvider.consumeRemainingAsString();\n\t\t\n\t\t\tASTParser parser = ASTParser.newParser(astlevel);\n\t\t\tparser.setSource(source.toCharArray());\n\t\t\tparser.setCompilerOptions(new HashMap());\n\t\t\tCompilationUnit cu = (CompilationUnit) parser.createAST(null);\n\t\t\tcu.getAST();\n\t\t} catch (IllegalArgumentException | VerifyError | NoClassDefFoundError ex) {\n\t\t\t/* ignore - IllegalArgumentException for invalid inputs, \n\t\t\t   VerifyError/NoClassDefFoundError for bytecode issues during class loading */\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/aspell/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/gnuaspell/aspell.git $SRC/aspell\nRUN git clone --depth 1 -b master https://github.com/gnuaspell/aspell-fuzz.git $SRC/aspell-fuzz\n\nWORKDIR $SRC/aspell-fuzz\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/aspell/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the OSS-Fuzz script in the fuzzer project.\npushd $SRC/aspell-fuzz\n./ossfuzz.sh\npopd\n"
  },
  {
    "path": "projects/aspell/project.yaml",
    "content": "homepage: \"https://github.com/GNUAspell/aspell\"\nlanguage: c++\nprimary_contact: \"kevina@gnu.org\"\nauto_ccs:\n  - \"kevinatkn@gmail.com\"\n  - \"cmeister2@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory:\n      experimental: true\nmain_repo: 'https://github.com/gnuaspell/aspell.git'\n"
  },
  {
    "path": "projects/assimp/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake ninja-build zip\nRUN git clone --depth 1 --recursive https://github.com/assimp/assimp.git\nWORKDIR assimp\nCOPY build.sh run_tests.sh $SRC/\n\n"
  },
  {
    "path": "projects/assimp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build directory\nmkdir -p build\ncd build\n\n# Configure\ncmake .. \\\n  -G Ninja \\\n  -DCMAKE_C_COMPILER=\"${CC}\" \\\n  -DCMAKE_CXX_COMPILER=\"${CXX}\" \\\n  -DCMAKE_C_FLAGS=\"${CFLAGS}\" \\\n  -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\" \\\n  -DASSIMP_BUILD_ZLIB=ON \\\n  -DASSIMP_BUILD_TESTS=OFF \\\n  -DASSIMP_BUILD_ASSIMP_TOOLS=OFF \\\n  -DBUILD_SHARED_LIBS=OFF \\\n  -DASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT=ON \\\n  -DASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT=ON\n\n# Build the library\nninja\n\n# Helper function to build fuzzers\nbuild_fuzzer() {\n    local fuzzer_name=$1\n    local source_file=$2\n\n    echo \"Building $fuzzer_name...\"\n    $CXX $CXXFLAGS -I../include -I../build/include -c \"$source_file\" -o \"${fuzzer_name}.o\"\n\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \"${fuzzer_name}.o\" -o \"$OUT/${fuzzer_name}\" \\\n        ./lib/libassimp.a \\\n        ./contrib/zlib/libzlibstatic.a \\\n        -lpthread -ldl\n}\n\n# 1. Generic Fuzzer\nbuild_fuzzer \"assimp_fuzzer\" \"../fuzz/assimp_fuzzer.cc\"\n# Corpus for generic fuzzer (all models)\n(cd ../test/models && zip -q -r $OUT/assimp_fuzzer_seed_corpus.zip .)\n# Dictionary\ncp ../fuzz/assimp_fuzzer.dict $OUT/assimp_fuzzer.dict || true\n\n\n# 2. OBJ Fuzzer\nbuild_fuzzer \"assimp_fuzzer_obj\" \"../fuzz/assimp_fuzzer_obj.cc\"\nif [ -d \"../test/models/OBJ\" ]; then\n    (cd ../test/models/OBJ && zip -q -r $OUT/assimp_fuzzer_obj_seed_corpus.zip .)\nfi\ncp ../fuzz/assimp_fuzzer.dict $OUT/assimp_fuzzer_obj.dict || true\n\n\n# 3. GLTF Fuzzer (text format only, glTF and glTF2 versions)\nbuild_fuzzer \"assimp_fuzzer_gltf\" \"../fuzz/assimp_fuzzer_gltf.cc\"\nmkdir -p gltf_corpus\n[ -d \"../test/models/glTF\" ] && cp -r ../test/models/glTF/* gltf_corpus/\n[ -d \"../test/models/glTF2\" ] && cp -r ../test/models/glTF2/* gltf_corpus/\nif [ -d \"gltf_corpus\" ] && [ \"$(ls -A gltf_corpus)\" ]; then\n    (cd gltf_corpus && zip -q -r $OUT/assimp_fuzzer_gltf_seed_corpus.zip .)\nfi\nrm -rf gltf_corpus\ncp ../fuzz/assimp_fuzzer.dict $OUT/assimp_fuzzer_gltf.dict || true\n\n\n# 4. GLB Fuzzer (binary glTF format)\nbuild_fuzzer \"assimp_fuzzer_glb\" \"../fuzz/assimp_fuzzer_glb.cc\"\nmkdir -p glb_corpus\n# GLB files can be found in glTF and glTF2 directories\n[ -d \"../test/models/glTF\" ] && find ../test/models/glTF -name \"*.glb\" -exec cp {} glb_corpus/ \\; 2>/dev/null || true\n[ -d \"../test/models/glTF2\" ] && find ../test/models/glTF2 -name \"*.glb\" -exec cp {} glb_corpus/ \\; 2>/dev/null || true\nif [ -d \"glb_corpus\" ] && [ \"$(ls -A glb_corpus)\" ]; then\n    (cd glb_corpus && zip -q -r $OUT/assimp_fuzzer_glb_seed_corpus.zip .)\nfi\nrm -rf glb_corpus\ncp ../fuzz/assimp_fuzzer.dict $OUT/assimp_fuzzer_glb.dict || true\n\n\n# 5. FBX Fuzzer\nbuild_fuzzer \"assimp_fuzzer_fbx\" \"../fuzz/assimp_fuzzer_fbx.cc\"\nif [ -d \"../test/models/FBX\" ]; then\n    (cd ../test/models/FBX && zip -q -r $OUT/assimp_fuzzer_fbx_seed_corpus.zip .)\nfi\ncp ../fuzz/assimp_fuzzer.dict $OUT/assimp_fuzzer_fbx.dict || true\n\n\n# 6. Collada Fuzzer\nbuild_fuzzer \"assimp_fuzzer_collada\" \"../fuzz/assimp_fuzzer_collada.cc\"\nif [ -d \"../test/models/Collada\" ]; then\n    (cd ../test/models/Collada && zip -q -r $OUT/assimp_fuzzer_collada_seed_corpus.zip .)\nfi\ncp ../fuzz/assimp_fuzzer.dict $OUT/assimp_fuzzer_collada.dict || true\n\n\n# 7. STL Fuzzer\nbuild_fuzzer \"assimp_fuzzer_stl\" \"../fuzz/assimp_fuzzer_stl.cc\"\nif [ -d \"../test/models/STL\" ]; then\n    (cd ../test/models/STL && zip -q -r $OUT/assimp_fuzzer_stl_seed_corpus.zip .)\nfi\ncp ../fuzz/assimp_fuzzer.dict $OUT/assimp_fuzzer_stl.dict || true\n"
  },
  {
    "path": "projects/assimp/project.yaml",
    "content": "homepage: \"https://github.com/assimp/assimp\"\nmain_repo: \"https://github.com/assimp/assimp\"\nlanguage: c++\nprimary_contact: \"kim.kulling@assimp.org\"\nauto_ccs:\n  - \"kim.kulling@googlemail.com\"\n  - \"realmccoy+ossfuzz@fastmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n"
  },
  {
    "path": "projects/assimp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbin/unit\n"
  },
  {
    "path": "projects/astc-encoder/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/ARM-software/astc-encoder\nWORKDIR astc-encoder/Source\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/astc-encoder/build.sh",
    "content": "# !/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project and project-hosted fuzzers\nsed -i 's/c++14/c++17/g' $SRC/astc-encoder/Source/Fuzzers/build.sh\n$SRC/astc-encoder/Source/Fuzzers/build.sh\n"
  },
  {
    "path": "projects/astc-encoder/project.yaml",
    "content": "homepage: \"https://github.com/ARM-software/astc-encoder\"\nlanguage: c++\nprimary_contact: \"peter.harris@arm.com\"\nmain_repo: 'https://github.com/ARM-software/astc-encoder'\n"
  },
  {
    "path": "projects/asteval/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/newville/asteval asteval\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/asteval\n"
  },
  {
    "path": "projects/asteval/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/asteval/fuzz_eval.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport asteval\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_expr = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n\n  # Class target.\n  try:\n    interpreter = asteval.asteval.Interpreter()\n    interpreter.eval(fuzz_expr)\n  except (ValueError, OSError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/asteval/project.yaml",
    "content": "homepage: https://github.com/newville/asteval\nmain_repo: https://github.com/newville/asteval\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/astro-compiler/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/withastro/compiler.git\n\nRUN go install github.com/AdamKorcz/go-118-fuzz-build@latest\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/compiler"
  },
  {
    "path": "projects/astro-compiler/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Fuzz internal/transform\nprintf \"package transform\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > $SRC/compiler/internal/transform/registerfuzzdep.go\ngo mod tidy\ngo get -u github.com/AdamKorcz/go-118-fuzz-build/testing\n\ncompile_native_go_fuzzer $SRC/compiler/internal/transform FuzzScopeHTML fuzz_scope_html\ncompile_native_go_fuzzer $SRC/compiler/internal/transform FuzzTransformScoping fuzz_transform_scoping"
  },
  {
    "path": "projects/astro-compiler/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/withastro/compiler\"\nlanguage: go\nmain_repo: \"https://github.com/withastro/compiler\"\nprimary_contact: \"cable023@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"nate@astro.build\""
  },
  {
    "path": "projects/astroid/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN pip3 install --disable-pip-version-check --no-cache-dir pip==25.1.1\n\nRUN git clone --depth=1 --no-tags https://github.com/pylint-dev/astroid\n\nCOPY *.py *.sh \"$SRC/\"\n\nWORKDIR \"$SRC/astroid\"\n"
  },
  {
    "path": "projects/astroid/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\n# Build a fuzz_parse seed corpus consisting of all the .py files from the astroid repo\nCORPUS_DIR=\"$WORK/corpus\"\nmkdir -p \"$CORPUS_DIR\"\n\nFILES=$(find \"$SRC/astroid\" -type f -iname \"*.py\")\nfor file in $FILES; do\n  cp \"$file\" \"$CORPUS_DIR/$(md5sum \"$file\" | cut -f 1 -d ' ').py\"\ndone\n\nzip -r \"$OUT/fuzz_parse_seed_corpus.zip\" \"$CORPUS_DIR\"/*\n"
  },
  {
    "path": "projects/astroid/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport astroid\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  code = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  try:\n    astroid.builder.parse(code)\n  except (\n      astroid.exceptions._NonDeducibleTypeHierarchy,\n      astroid.modutils.NoSourceFile,\n      astroid.exceptions.AstroidError,\n      astroid.exceptions.UseInferenceDefault,\n      RecursionError,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/astroid/project.yaml",
    "content": "homepage: https://github.com/pylint-dev/astroid\nmain_repo: https://github.com/pylint-dev/astroid\nlanguage: python\nprimary_contact: \"jacobtylerwalls@gmail.com\"\nauto_ccs:\n  - \"correctmost@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/asttokens/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/gristlabs/asttokens asttokens\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/asttokens\n"
  },
  {
    "path": "projects/asttokens/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/asttokens/fuzz_asttokens.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport asttokens, ast\nimport atheris\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  source_to_parse = fdp.ConsumeUnicodeNoSurrogates(4196)\n  try:\n    ast.parse(source_to_parse)\n  except:\n    # Avoid anything that throws any issues in ast.parse.\n    return\n  try:\n    atok = asttokens.ASTTokens(source_to_parse, parse=True)\n  except SyntaxError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/asttokens/project.yaml",
    "content": "homepage: https://github.com/gristlabs/asttokens\nmain_repo: https://github.com/gristlabs/asttokens\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/async-http-client/.gitignore",
    "content": "project-parent/async-http-client\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/async-http-client/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cat fuzzing/dictionaries/http.dict fuzzing/dictionaries/url.dict > $SRC/AsyncHttpClientFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/AsyncHttpClientFuzzer_seed_corpus.zip go-fuzz-corpus/httpreq/corpus/* && \\\n    zip -uj $SRC/AsyncHttpClientFuzzer_seed_corpus.zip go-fuzz-corpus/http2/corpus/* && \\\n    zip -uj $SRC/AsyncHttpClientFuzzer_seed_corpus.zip go-fuzz-corpus/url/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/async-http-client\nRUN apt update && apt install -y openjdk-11-jdk\nRUN git clone --depth 1 https://github.com/AsyncHttpClient/async-http-client/ $SRC/project-parent/async-http-client\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/async-http-client/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=async-http-client\nPROJECT_GROUP_ID=org.asynchttpclient\nPROJECT_ARTIFACT_ID=async-http-client\nMAIN_REPOSITORY=https://github.com/AsyncHttpClient/async-http-client/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -Denforcer.skip=true -DskipTests -Dgpg.skip\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-11\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/async-http-client/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.asynchttpclient</groupId>\n            <artifactId>async-http-client</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty.toolchain</groupId>\n            <artifactId>jetty-jakarta-servlet-api</artifactId>\n            <version>5.0.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-server</artifactId>\n            <version>11.0.14</version>\n            <scope>test</scope>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/async-http-client/project-parent/fuzz-targets/src/test/java/com/example/AsyncHttpClientFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.asynchttpclient.Response;\nimport org.asynchttpclient.AsyncHttpClient;\nimport org.asynchttpclient.util.HttpConstants;\nimport io.netty.handler.codec.http.HttpHeaders;\nimport io.netty.handler.codec.http.DefaultHttpHeaders;\nimport io.netty.handler.codec.http.cookie.DefaultCookie;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\n\nimport java.util.*;\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport java.util.concurrent.ExecutionException;\n\nimport static org.asynchttpclient.Dsl.*;\n\nclass AsyncHttpClientFuzzer {\n    static Server server;\n    static int port1 = -1;\n\n    static String [] methods = {\n            HttpConstants.Methods.CONNECT,\n            HttpConstants.Methods.DELETE,\n            HttpConstants.Methods.GET,\n            HttpConstants.Methods.HEAD,\n            HttpConstants.Methods.OPTIONS,\n            HttpConstants.Methods.PATCH,\n            HttpConstants.Methods.POST,\n            HttpConstants.Methods.PUT,\n            HttpConstants.Methods.TRACE\n    };\n\n    @BeforeAll\n    static void setUp() {\n        server = new Server();\n        ServerConnector connector1 = addHttpConnector(server);\n        try {\n            server.start();\n        } catch (Exception e) {\n            return;\n        }\n        port1 = connector1.getLocalPort();\n    }\n\n    @AfterAll\n    static void cleanUp() {\n        if (server != null) {\n            try {\n                server.stop();\n            } catch (Exception e) {\n            }\n        }\n    }\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try (AsyncHttpClient client = asyncHttpClient()) {\n            HttpHeaders httpHeaders = new DefaultHttpHeaders();\n\n            for (int i = 0; i < data.consumeInt(0, 50); ++i) {\n                httpHeaders.add(data.consumeString(500), data.consumeString(500));\n            }\n\n            Map<String, List<String>> formParams = new HashMap<>();\n            for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                formParams.put(data.consumeString(500), Collections.singletonList(data.consumeString(500)));\n            }\n\n            Map<String, List<String>> queryParams = new HashMap<>();\n            for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                queryParams.put(data.consumeString(500), Collections.singletonList(data.consumeString(500)));\n            }\n\n            Collection<io.netty.handler.codec.http.cookie.Cookie> cookies = new ArrayList<>();\n            for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                io.netty.handler.codec.http.cookie.Cookie cookie = new DefaultCookie(data.consumeString(500), data.consumeString(500));\n                cookie.setDomain(data.consumeString(500));\n                cookie.setPath(data.consumeString(500));\n                cookie.setMaxAge(data.consumeInt());\n                cookie.setSecure(data.consumeBoolean());\n                cookie.setHttpOnly(data.consumeBoolean());\n                cookies.add(cookie);\n            }\n\n            Response resp = client.prepare(data.pickValue(methods), data.consumeString(500))\n                    .setCookies(cookies)\n                    .setHeaders(httpHeaders)\n                    .setFormParams(formParams)\n                    .setQueryParams(queryParams)\n                    .setVirtualHost(data.consumeString(500))\n                    .setBody(new ByteArrayInputStream(data.consumeRemainingAsBytes()))\n                    .execute()\n                    .get();\n        } catch (IOException | InterruptedException | ExecutionException | IllegalArgumentException | IllegalStateException e) {\n        }\n    }\n\n    public static ServerConnector addHttpConnector(Server server) {\n        ServerConnector connector = new ServerConnector(server);\n        server.addConnector(connector);\n        return connector;\n    }\n}"
  },
  {
    "path": "projects/async-http-client/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>async-http-client</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/async-http-client/project.yaml",
    "content": "homepage: \"https://github.com/AsyncHttpClient/async-http-client/\"\nlanguage: jvm\nprimary_contact: \"aayush@shieldblaze.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/AsyncHttpClient/async-http-client/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/atomic/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/uber-go/atomic\nWORKDIR $SRC/atomic\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/atomic/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\nprintf \"package atomic\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer go.uber.org/atomic FuzzTest FuzzTest\n"
  },
  {
    "path": "projects/atomic/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage atomic\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzTest(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data []byte, oldS, newS string) {\n\t\ts := &String{}\n\t\ts.UnmarshalText(data)\n\t\ts.MarshalText()\n\t\ts.CompareAndSwap(oldS, newS)\n\t\ts.Load()\n\t})\n}\n"
  },
  {
    "path": "projects/atomic/project.yaml",
    "content": "homepage: \"https://github.com/uber-go/atomic\"\nlanguage: go\nmain_repo: \"https://github.com/uber-go/atomic\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/attrs/Dockerfile",
    "content": "#!/usr/bin/python3\n\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/python-attrs/attrs.git\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/attrs\n"
  },
  {
    "path": "projects/attrs/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --hidden-import=html.parser\ndone\n"
  },
  {
    "path": "projects/attrs/fuzz_attrs.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\nimport attrs\nfrom string import ascii_letters\n\ndef consumeIdentifier(fdp):\n    return fdp.ConsumeUnicode(8)\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  clsname = consumeIdentifier(fdp)\n  attrcount = fdp.ConsumeIntInRange(0, 12)\n  attrnames = [consumeIdentifier(fdp)\n               for _ in range(attrcount)]\n  attrvalues = [None] * attrcount\n\n  # Create class from attrs.make_class\n  try:\n    C0 = attrs.make_class(clsname, attrnames)\n  except Exception as e:\n      if any(not name.isidentifier() for name in [clsname] + attrnames):\n          return\n      raise\n  c0 = C0(**{k: v for k, v in zip(attrnames, attrvalues)})\n  d0 = attrs.asdict(c0)\n  c0_p = C0(**d0)\n  assert c0 == c0_p\n\n  # Create class from attrs.define\n  C1 = attrs.define(type(clsname, (), {f: attrs.field() for f in attrnames}))\n  c1 = C1(**{k: v for k, v in zip(attrnames, attrvalues)})\n  d1 = attrs.asdict(c1)\n  c1_p = C1(**d1)\n  assert c1 == c1_p\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/attrs/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://www.attrs.org\nlanguage: python\nmain_repo: https://github.com/python-attrs/attrs.git\nsanitizers:\n- address\nvendor_ccs:\n- sergesanspaille@free.fr\n"
  },
  {
    "path": "projects/augeas/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y libreadline-dev libselinux1-dev \\\n    libxml2-dev make autoconf automake libtool pkg-config bison flex\n\nRUN git clone --depth 1 https://github.com/hercules-team/augeas\nWORKDIR augeas\n\nCOPY run_tests.sh build.sh $SRC/\nCOPY augeas_escape_name_fuzzer.cc $SRC/\nCOPY augeas_fa_fuzzer.cc $SRC/\nCOPY augeas_api_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/augeas/augeas_api_fuzzer.cc",
    "content": "/*\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n\n#include \"config.h\"\n#include \"augeas.h\"\n#include \"internal.h\"\n#include \"memory.h\"\n#include \"syntax.h\"\n#include \"transform.h\"\n#include \"errcode.h\"\n\n\n#include <fnmatch.h>\n#include <argz.h>\n#include <string.h>\n#include <stdarg.h>\n#include <locale.h>\n\n\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tif(size<3){\n\t\treturn 0;\n\t}\n\t\n\tchar *loadpath = NULL;\n\tconst char *value;\n\tconst char *label;\n\tchar *new_str = (char *)malloc(size+1);\n\tif (new_str == NULL){\n\t\treturn 0;\n\t}\n\tmemcpy(new_str, data, size);\n\tnew_str[size] = '\\0';\n\t\n\tstruct augeas *aug = aug_init(new_str, loadpath, AUG_NO_STDINC|AUG_NO_LOAD);\n\taug_defvar(aug, new_str, &new_str[1]);\n\taug_get(aug, new_str, &value);\n\taug_label(aug, new_str, &label);\n\t\n\taug_rename(aug, new_str, &new_str[1]);\n\taug_text_store(aug, &new_str[1], new_str, &new_str[2]);\t\n\taug_print(aug, stdout, new_str);\n\taug_setm(aug, new_str, NULL, &new_str[1]);\t\n\t\n\tfree(new_str);\n\taug_close(aug);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/augeas/augeas_escape_name_fuzzer.cc",
    "content": "/*\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <string>\n\n#include <augeas.h>\n\nint escape_match(const uint8_t *data, size_t size){\n    augeas *aug = aug_init(NULL, NULL, AUG_NONE);\n    std::string data_string(reinterpret_cast<const char*>(data), size);\n    char *out = NULL;\n    aug_escape_name(aug, data_string.c_str(), &out);\n    if (out != NULL){\n        aug_match(aug, out, NULL);\n    }\n    else{\n        aug_match(aug, data_string.c_str(), NULL);\n    }\n    aug_close(aug);\n    free(out);\n    return 0;\n}\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {\n    escape_match(Data, Size);\n    return 0;\n}\n"
  },
  {
    "path": "projects/augeas/augeas_fa_fuzzer.cc",
    "content": "/*\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n\n\n#include <stdio.h>\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n\n// Augea includes\n#include \"augeas.h\"\n#include \"config.h\"\n#include \"fa.h\"\n#include \"internal.h\"\n\n\n/*\n * FA fuzzer. \n */\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size){\n\tif(Size<3){\n\t\treturn 0;\n\t}\n\tchar *new_str = (char *)malloc(Size+1);\n\tif (new_str == NULL){\n\t\treturn 0;\n\t}\n\tmemcpy(new_str, Data, Size);\n\tnew_str[Size] = '\\0';\n\tint intSize = (int)Size;\t\n\tchar *s;\n\n\n\tsize_t len;\n\tint r = fa_expand_nocase(new_str, intSize, &s, &len);\n\t\n\tstruct fa *fa2 = NULL; \n\tint r2 = fa_compile(new_str, intSize, &fa2);\n\n\tstruct fa *fa1 = NULL;\t\n\tfa_compile(&new_str[1], intSize, &fa1);\n\tstruct fa *fa_min;\n\tfa_min = fa_minus(fa1, fa2);\n\t\n\tif (fa2 != NULL)\n\t{\n\t\tchar* word = NULL;\n\t\tsize_t word_len = 0;\n\t\tfa_example(fa2, &word, &word_len);\n\t\t\n\t\tif(word != NULL) \n\t\t\tfree(word);\n\n\t\tfa_json(stdout, fa2);\n\t\tfa_minimize(fa2);\n\t\tfa_dot(stdout, fa2);\n\t}\n\n\tstruct fa *fa_b = fa_make_basic(intSize);\n\t\n\t// cleanup\n\tif (s != NULL) \t\tfree(s);\n\tif (new_str != NULL) \tfree(new_str);\n\tif (fa_b != NULL)\tfa_free(fa_b);\n\tif (fa_min != NULL) \tfa_free(fa_min);\n\tif (fa1 != NULL)\tfa_free(fa1);\n\tif (fa2 != NULL)\tfa_free(fa2);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/augeas/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n./autogen.sh\n./configure --enable-static --disable-shared --without-selinux\nmake -j$(nproc)\n\n# Add extern \"C\" guards for C++ compilation using awk\n# This handles both the opening and closing guards\nawk '\n/#define FA_H_/ {\n    print\n    print \"\"\n    print \"#ifdef __cplusplus\"\n    print \"extern \\\"C\\\" {\"\n    print \"#endif\"\n    print \"\"\n    next\n}\n/^#endif$/ && !done {\n    print \"\"\n    print \"#ifdef __cplusplus\"\n    print \"}\"\n    print \"#endif\"\n    print \"\"\n    done = 1\n}\n{ print }\n' src/fa.h > src/fa.h.tmp && mv src/fa.h.tmp src/fa.h\n\nASAN_OPTIONS=detect_leaks=0\n\ncp $SRC/augeas_escape_name_fuzzer.cc .\ncp $SRC/augeas_fa_fuzzer.cc .\ncp $SRC/augeas_api_fuzzer.cc .\n\n\nfor fuzzer in augeas_api_fuzzer augeas_escape_name_fuzzer augeas_fa_fuzzer; do\n    $CXX $CXXFLAGS -std=c++11 -Isrc/ `xml2-config --cflags` \\\n        $fuzzer.cc -o $OUT/$fuzzer $LIB_FUZZING_ENGINE \\\n        src/.libs/libaugeas.a src/.libs/libfa.a ./gnulib/lib/.libs/libgnu.a \\\n        /usr/lib/x86_64-linux-gnu/libxml2.a\ndone\n"
  },
  {
    "path": "projects/augeas/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/hercules-team/augeas\nlanguage: c++\nprimary_contact: lutter@watzmann.net\nauto_ccs:\n  - hhan@redhat.com\n  - adam@adalogics.com\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/hercules-team/augeas'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/augeas/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer/null return check and run unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0:allocator_may_return_null=1\"\nmake check -j$(nproc) -C $SRC/augeas/tests\n"
  },
  {
    "path": "projects/autoflake/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://www.github.com/PyCQA/autoflake autoflake\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/autoflake\n"
  },
  {
    "path": "projects/autoflake/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/autoflake/fuzz_fix_code.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport autoflake\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  source_code = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  autoflake.fix_code(source_code)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/autoflake/project.yaml",
    "content": "homepage: https://www.github.com/PyCQA/autoflake\nmain_repo: https://www.github.com/PyCQA/autoflake\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/autopep8/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/hhatto/autopep8 autopep8\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/autopep8\n"
  },
  {
    "path": "projects/autopep8/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/autopep8/fuzz_fix_file.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-3\n# Imports by the generated code\nimport autopep8\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_file = '/tmp/random_file.txt'\n  with open(fuzz_file, 'wb') as f:\n    f.write(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 4096)))\n  autopep8.fix_file(fuzz_file)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/autopep8/project.yaml",
    "content": "homepage: https://github.com/hhatto/autopep8\nmain_repo: https://github.com/hhatto/autopep8\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/avahi/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/avahi/avahi\nWORKDIR avahi\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/avahi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfuzz/oss-fuzz.sh\n"
  },
  {
    "path": "projects/avahi/project.yaml",
    "content": "homepage: \"https://avahi.org/\"\nlanguage: c++\nprimary_contact: trent@lloyd.id.au\nauto_ccs:\n  - alex.gaynor@gmail.com\n  - evverx@gmail.com\n  - msekleta@redhat.com\n  - pemensik@redhat.com\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/avahi/avahi'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nfile_github_issue: True\nbuilds_per_day: 4\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/avro/.gitignore",
    "content": "project-parent/avro\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/avro/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.2/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/avro\nRUN git clone --depth 1 https://github.com/apache/avro/ $SRC/project-parent/avro\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/avro/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=avro\nPROJECT_GROUP_ID=org.apache.avro\nPROJECT_ARTIFACT_ID=avro\nMAIN_REPOSITORY=https://github.com/apache/avro/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  FUZZ_TARGET_DEPENDENCIES=\":avro :avro-mapred\"\n  \n  for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/avro/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.avro</groupId>\n            <artifactId>avro</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.avro</groupId>\n            <artifactId>avro-mapred</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.hadoop</groupId>\n            <artifactId>hadoop-client</artifactId>\n            <version>3.3.5</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/avro/project-parent/fuzz-targets/src/test/java/com/example/AvroSerializationFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.apache.avro.Schema;\nimport org.apache.avro.mapred.AvroKey;\nimport org.apache.avro.mapred.AvroValue;\nimport org.apache.avro.mapreduce.AvroJob;\nimport org.apache.avro.mapred.AvroWrapper;\nimport org.apache.avro.generic.GenericData;\nimport org.apache.avro.AvroRuntimeException;\nimport org.apache.avro.hadoop.io.AvroSerialization;\nimport org.apache.hadoop.mapreduce.Job;\nimport org.apache.hadoop.conf.Configuration;\nimport org.apache.hadoop.util.ReflectionUtils;\nimport org.apache.hadoop.io.serializer.Serializer;\nimport org.apache.hadoop.io.serializer.Deserializer;\nimport org.junit.jupiter.api.BeforeAll;\n\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\n\n\nclass AvroSerializationFuzzer {\n    static Job job = null;\n    Class [] classes = {AvroKey.class, AvroValue.class};\n\n    @BeforeAll\n    static void setUp(){\n        try {\n            job = new Job(new Configuration());\n        } catch (IOException e) {\n        }\n    }\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            int opt = 7;\n            int num = data.consumeInt(0, 2^opt - 1);\n            for (int bit = 0; bit < opt; ++bit) {\n                if (((num >> bit) & 1) == 1) {\n                    switch (bit) {\n                        case 0:\n                            AvroJob.setMapOutputKeySchema(job, data.pickValue(new Schema[]{Schema.create(data.pickValue(Schema.Type.values())),\n                                    new Schema.Parser().parse(data.consumeString(1000))}));\n                            break;\n                        case 1:\n                            AvroJob.setMapOutputValueSchema(job, data.pickValue(new Schema[]{Schema.create(data.pickValue(Schema.Type.values())),\n                                    new Schema.Parser().parse(data.consumeString(1000))}));\n                            break;\n                        case 2:\n                            AvroJob.setInputKeySchema(job, data.pickValue(new Schema[]{Schema.create(data.pickValue(Schema.Type.values())),\n                                    new Schema.Parser().parse(data.consumeString(1000))}));\n                            break;\n                        case 3:\n                            AvroJob.setInputValueSchema(job, data.pickValue(new Schema[]{Schema.create(data.pickValue(Schema.Type.values())),\n                                    new Schema.Parser().parse(data.consumeString(1000))}));\n                            break;\n                        case 4:\n                            AvroJob.setOutputKeySchema(job, data.pickValue(new Schema[]{Schema.create(data.pickValue(Schema.Type.values())),\n                                    new Schema.Parser().parse(data.consumeString(1000))}));\n                            break;\n                        case 5:\n                            AvroJob.setOutputValueSchema(job, data.pickValue(new Schema[]{Schema.create(data.pickValue(Schema.Type.values())),\n                                    new Schema.Parser().parse(data.consumeString(1000))}));\n                            break;\n                        case 6:\n                            AvroJob.setDataModelClass(job, GenericData.class);\n                            break;\n                    }\n                }\n            }\n\n            AvroSerialization serialization = ReflectionUtils.newInstance(AvroSerialization.class, job.getConfiguration());\n            Serializer serializer = serialization.getSerializer(data.pickValue(classes));\n            Deserializer deserializer = serialization.getDeserializer(data.pickValue(classes));\n\n            ByteArrayOutputStream baos = new ByteArrayOutputStream();\n            serializer.open(baos);\n            serializer.serialize(data.consumeBytes(1000));\n            serializer.close();\n\n            ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n            deserializer.open(bais);\n            AvroWrapper<CharSequence> result = null;\n            deserializer.deserialize(result);\n            deserializer.close();\n        } catch (IOException e) {\n        } catch (AvroRuntimeException | UnsupportedOperationException | ClassCastException | IllegalArgumentException | NullPointerException e) {\n            // Need to catch to find more interesting findings.\n        }\n    }\n}"
  },
  {
    "path": "projects/avro/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>avro</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/avro/project.yaml",
    "content": "homepage: \"https://avro.apache.org/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/avro\"\nsanitizers:\n  - address\nprimary_contact: \"martin.grigorov@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/azure-sdk-for-python/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/azure/azure-sdk-for-python azure-sdk-for-python\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/azure-sdk-for-python\n"
  },
  {
    "path": "projects/azure-sdk-for-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/azure-sdk-for-python/sdk/core/azure-core\npip3 install .\n\ncd $SRC/azure-sdk-for-python/sdk/dynatrace/azure-mgmt-dynatrace/\npip3 install .\n\ncompile_python_fuzzer $SRC/fuzz_mgmt_serialization.py\n"
  },
  {
    "path": "projects/azure-sdk-for-python/fuzz_mgmt_serialization.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport json\nimport atheris\n\nfrom azure.mgmt.dynatrace import _serialization\nfrom azure.mgmt.dynatrace.models import _models_py3\nfrom azure.core.exceptions import (\n  DeserializationError,\n  SerializationError\n)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    payload = json.loads(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except:\n    return\n  model = _models_py3.AccountInfo()\n\n  # Overwrite the types, this is easier than creating a new class.\n  model._attribute_map = payload\n\n  try:\n    serialized_data = model.serialize()\n    serialized = True\n  except SerializationError:\n    serialized = False\n\n  deserializer = _serialization.Deserializer()\n  if serialized:\n    # Anything serialized should be unserializable\n    deserializer._deserialize(model, serialized_data)\n  else:\n    # Otherwise we deserialize random data and catch exceptions\n    try:\n      deserializer._deserialize(\n        model,\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))\n      )\n    except DeserializationError:\n      pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/azure-sdk-for-python/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/azure/azure-sdk-for-python\nlanguage: python\nmain_repo: https://github.com/azure/azure-sdk-for-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com"
  },
  {
    "path": "projects/babel/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && pip3 install cython\nRUN git clone https://github.com/python-babel/babel babel\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/babel\n"
  },
  {
    "path": "projects/babel/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/babel/fuzz_lexer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom babel.messages.jslexer import tokenize\nimport babel\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    l1 = list(tokenize(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)))\n  except (\n    babel.messages.pofile.PoFileError,\n    babel.core.UnknownLocaleError,\n    babel.messages.catalog.TranslationError,\n    babel.numbers.UnknownCurrencyError,\n    babel.plural.RuleError\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/babel/fuzz_profile.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom babel.messages.pofile import read_po\nimport babel\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    read_po(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (\n    babel.messages.pofile.PoFileError,\n    babel.core.UnknownLocaleError,\n    babel.messages.catalog.TranslationError,\n    babel.plural.RuleError\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/babel/project.yaml",
    "content": "homepage: https://github.com/python-babel/babel\nmain_repo: https://github.com/python-babel/babel\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/bad_example/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\n# Using a real zlib project, but with broken build script and/or fuzz target.\n\nRUN git clone --depth 1 https://github.com/madler/zlib.git\nWORKDIR zlib\nCOPY build.sh bad_example_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/bad_example/bad_example_fuzzer.cc",
    "content": "// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\n#include <signal.h>\n#include <unistd.h>\n\n#include \"zlib.h\"\n\nstatic Bytef buffer[256 * 1024] = { 0 };\n\n\n#ifdef INTENTIONAL_STARTUP_CRASH\nvoid bad_term_handler(int signum) {\n  _exit(0);\n}\n#endif\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n#ifdef INTENTIONAL_STARTUP_CRASH\n  // Simulates the worst case, fuzz target silently dies without any error.\n  struct sigaction action = { 0 };\n  action.sa_handler = bad_term_handler;\n  sigaction(SIGTERM, &action, NULL);\n\n  // Cannot call _exit(0) directly, as it's even worse -- sancov does not print\n  // any coverage information in that case.\n  kill(getpid(), SIGTERM);\n#endif\n\n  uLongf buffer_length = static_cast<uLongf>(sizeof(buffer));\n  if (Z_OK != uncompress(buffer, &buffer_length, data,\n                         static_cast<uLong>(size))) {\n    return 0;\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/bad_example/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n#!/bin/bash -eu\n\n# Testcase 1. Valid fuzzer build.\n################################################################################\n./configure\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n$CXX $CXXFLAGS -std=c++11 -I. \\\n    $SRC/bad_example_fuzzer.cc -o $OUT/bad_example_valid_build \\\n    $LIB_FUZZING_ENGINE ./libz.a\n\n\n# Testcase 2. Silent startup crash.\n################################################################################\n./configure\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n$CXX $CXXFLAGS -std=c++11 -I. -DINTENTIONAL_STARTUP_CRASH \\\n    $SRC/bad_example_fuzzer.cc -o $OUT/bad_example_startup_crash \\\n    $LIB_FUZZING_ENGINE ./libz.a\n\n\n# The latest two examples won't work for coverage or introspector, bail out.\nif [[ $SANITIZER = *coverage* || $SANITIZER = *introspector* ]]; then\n  exit 0\nfi\n\n\n# Testcase 3. Partially ignore the flags provided by OSS-Fuzz.\n################################################################################\nexport CFLAGS_ORIG=\"$CFLAGS\"\nexport CFLAGS=\"-O1\"\nexport CXXFLAGS_ORIG=\"$CXXFLAGS\"\nexport CXXFLAGS=\"-O1 -stdlib=libc++\"\n\n# We need to pass static as zlib fails to build shared lib in OSS-Fuzz env.\n./configure --static\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n$CXX -fsanitize=$SANITIZER $CXXFLAGS_ORIG -std=c++11 -I. \\\n    $SRC/bad_example_fuzzer.cc -o $OUT/bad_example_partial_instrumentation \\\n    $LIB_FUZZING_ENGINE ./libz.a\n\n\n# Testcase 4. Completely ignore the flags provided by OSS-Fuzz.\n################################################################################\n# We need to pass static as zlib fails to build shared lib in OSS-Fuzz env.\n./configure --static\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n$CXX -fsanitize=$SANITIZER $CXXFLAGS -std=c++11 -I. \\\n    $SRC/bad_example_fuzzer.cc -o $OUT/bad_example_no_instrumentation \\\n    $LIB_FUZZING_ENGINE ./libz.a\n\n\n# Testcase 5. Enable multiple sanitizers.\n################################################################################\n# Add UBSan to ASan or MSan build. Add ASan to UBSan build.\nEXTRA_SANITIZER=\"undefined\"\nif [[ $SANITIZER = *undefined* ]]; then\n  EXTRA_SANITIZER=\"address\"\nfi\n\nexport CFLAGS=\"$CFLAGS_ORIG -fsanitize=$EXTRA_SANITIZER\"\nexport CXXFLAGS=\"$CXXFLAGS_ORIG -fsanitize=$EXTRA_SANITIZER\"\n\n./configure\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n$CXX $CXXFLAGS -std=c++11 -I. \\\n    $SRC/bad_example_fuzzer.cc -o $OUT/bad_example_mixed_sanitizers \\\n    $LIB_FUZZING_ENGINE ./libz.a\n"
  },
  {
    "path": "projects/bad_example/project.yaml",
    "content": "base_os_version: ubuntu-24-04\ndisabled: true\nhomepage: http://www.zlib.net/\nlanguage: c++\nmain_repo: https://github.com/madler/zlib\nsanitizers:\n- address\n- memory\n- undefined\nvendor_ccs: []\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/bazel-rules-fuzzing-test/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y python-is-python3\n\nRUN git clone https://github.com/bazelbuild/rules_fuzzing.git\nWORKDIR $SRC/rules_fuzzing/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bazel-rules-fuzzing-test/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Work around https://github.com/bazelbuild/bazel/issues/21592: \n# The `layering_check` feature does not work with `--spawn_strategy=standalone`,\n# which is the default for OSS-Fuzz builds.\nexport BAZEL_EXTRA_BUILD_FLAGS=\"--spawn_strategy=sandboxed\"\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/bazel-rules-fuzzing-test/project.yaml",
    "content": "homepage: \"https://github.com/bazelbuild/rules_fuzzing\"\nmain_repo: \"https://github.com/bazelbuild/rules_fuzzing\"\nlanguage: c++\nprimary_contact: \"test@example.com\"\n\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n\nsanitizers:\n  - address\n  - undefined\n  - memory\n\n# This is a test project.\ndisabled: true\n"
  },
  {
    "path": "projects/bazel-rules-fuzzing-test-java/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && \\\n    apt-get install -y python-is-python3\n\nRUN git clone https://github.com/bazelbuild/rules_fuzzing.git\nWORKDIR $SRC/rules_fuzzing/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bazel-rules-fuzzing-test-java/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Work around https://github.com/bazelbuild/bazel/issues/21592: \n# The `layering_check` feature does not work with `--spawn_strategy=standalone`,\n# which is the default for OSS-Fuzz builds.\nexport BAZEL_EXTRA_BUILD_FLAGS=\"--spawn_strategy=sandboxed\"\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/bazel-rules-fuzzing-test-java/project.yaml",
    "content": "homepage: \"https://github.com/bazelbuild/rules_fuzzing\"\nmain_repo: \"https://github.com/bazelbuild/rules_fuzzing\"\nlanguage: jvm\nprimary_contact: \"test@example.com\"\n\nfuzzing_engines:\n  - libfuzzer\n\nsanitizers:\n  - address\n  - undefined\n\n# This is a test project.\ndisabled: true\n"
  },
  {
    "path": "projects/bc-gh/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/gavinhoward/bc.git bc-gh\nWORKDIR bc-gh\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bc-gh/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./configure -Z\nmake -j$(nproc) all\n\ncp bin/*_fuzzer_* $OUT/\n"
  },
  {
    "path": "projects/bc-gh/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://git.gavinhoward.com/gavin/bc\nmain_repo: https://github.com/gavinhoward/bc\nlanguage: c\nprimary_contact: gavin.d.howard@gmail.com\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n  - centipede\ndisabled: true\n"
  },
  {
    "path": "projects/bc-java/CMSEnvelopedDataParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.bouncycastle.cms.CMSEnvelopedDataParser;\nimport org.bouncycastle.cms.CMSEnvelopedDataGenerator;\nimport org.bouncycastle.cms.jcajce.JceKeyTransRecipientInfoGenerator;\nimport org.bouncycastle.cms.jcajce.JceCMSContentEncryptorBuilder;\nimport org.bouncycastle.cms.test.CMSTestUtil;\nimport org.bouncycastle.cms.CMSAlgorithm;\nimport org.bouncycastle.cms.CMSTypedData;\nimport org.bouncycastle.cms.CMSException;\nimport org.bouncycastle.cms.CMSProcessableByteArray;\nimport org.bouncycastle.cms.CMSEnvelopedData;\nimport org.bouncycastle.operator.OperatorCreationException;\n\nimport java.io.IOException;\nimport java.security.cert.X509Certificate;\nimport java.security.KeyPair;\nimport java.security.GeneralSecurityException;\nimport java.security.cert.CertificateEncodingException;\n\npublic class CMSEnvelopedDataParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    X509Certificate _reciCert;\n    String _signDN   = \"O=Bouncy Castle, C=AU\";\n    KeyPair _signKP   = CMSTestUtil.makeKeyPair();\n    String _reciDN   = \"CN=Doug, OU=Sales, O=Bouncy Castle, C=AU\";\n    KeyPair _reciKP   = CMSTestUtil.makeKeyPair();\n    try{\n\t    _reciCert = CMSTestUtil.makeCertificate(_reciKP, _reciDN, _signKP, _signDN);\n    }\n    catch(GeneralSecurityException | IOException | OperatorCreationException e){\n    \treturn;\n    }\n  \n    try{\n      CMSTypedData msg     = new CMSProcessableByteArray(data.consumeRemainingAsBytes());\n      CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();\n      \n      try{\n\t      edGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(_reciCert).setProvider(\"BC\")) ;\n      }\n      catch(CertificateEncodingException e){\n      \treturn;\n      }\n      \n      CMSEnvelopedData ed = edGen.generate(\n                                        msg,\n                                        new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)\n                                           .setProvider(\"BC\").build());\n      CMSEnvelopedDataParser cedp = new CMSEnvelopedDataParser(ed.getEncoded());\n      cedp.getEncryptionAlgParams();      \n    }\n      catch (CMSException | IOException e){\n        return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/bc-java/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN wget https://services.gradle.org/distributions/gradle-8.10-bin.zip -O gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE=$SRC/gradle/gradle-8.10/bin/gradle\n\nRUN git clone --depth 1 https://github.com/bcgit/bc-java.git bc-java\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/bc-java\n"
  },
  {
    "path": "projects/bc-java/EncodingFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.bouncycastle.util.encoders.Base64;\nimport org.bouncycastle.util.encoders.Hex;\nimport java.lang.StringBuffer;\n\nimport java.util.Arrays;\n\npublic class EncodingFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    byte[] originalInput = data.consumeRemainingAsBytes();\n\n    byte[] encodedB64 = Base64.encode(originalInput);\n    byte[] decodedB64 = Base64.decode(encodedB64);\n    if(!Arrays.equals(originalInput, decodedB64)){\n      throw new IllegalStateException(\"Base64 encoding / decoding failure\\n\" \n                                      + \"Original input: \" + encodeHexString(originalInput) + \"\\n\"\n                                      + \"Encoded data: \" + encodeHexString(encodedB64) + \"\\n\"\n                                      + \"Decoded data: \" + encodeHexString(decodedB64) + \"\\n\");\n    }\n\n    byte[] encodedHex = Hex.encode(originalInput);\n    byte[] decodedHex = Hex.decode(encodedHex);\n\n    if(!Arrays.equals(originalInput, decodedHex)){\n      throw new IllegalStateException(\"Hex encoding / decoding failure\\n\" \n                                      + \"Original input: \" + encodeHexString(originalInput) + \"\\n\"\n                                      + \"Encoded data: \" + encodeHexString(encodedHex) + \"\\n\"\n                                      + \"Decoded data: \" + encodeHexString(decodedHex) + \"\\n\");\n    }\n  }\n  \n  // These two methods were taken from: https://www.baeldung.com/java-byte-arrays-hex-strings\n  private static String encodeHexString(byte[] byteArray) {\n    StringBuffer hexStringBuffer = new StringBuffer();\n    for (int i = 0; i < byteArray.length; i++) {\n        hexStringBuffer.append(byteToHex(byteArray[i]));\n    }\n    return hexStringBuffer.toString();\n  }\n\n  private static String byteToHex(byte num) {\n      char[] hexDigits = new char[2];\n      hexDigits[0] = Character.forDigit((num >> 4) & 0xF, 16);\n      hexDigits[1] = Character.forDigit((num & 0xF), 16);\n      return new String(hexDigits);\n  }\n  \n}\n"
  },
  {
    "path": "projects/bc-java/PEMParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.Reader;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.ByteArrayInputStream;\nimport org.bouncycastle.openssl.PEMParser;\nimport java.io.IOException;\nimport org.bouncycastle.util.encoders.DecoderException;\n\npublic class PEMParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n    Reader reader = new BufferedReader(new InputStreamReader(bais));\n    PEMParser pemparser = new PEMParser(reader);\n\n    try{\n      while (pemparser.readObject() != null){\n        //empty body\n      }\n    }\n    catch(IOException | DecoderException e){\n      return;\n    }\n\n  }\n}\n"
  },
  {
    "path": "projects/bc-java/X509CertPairParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.IOException;\nimport org.bouncycastle.x509.util.StreamParsingException;\nimport org.bouncycastle.jce.provider.X509CertPairParser;\nimport java.io.ByteArrayInputStream;\n\npublic class X509CertPairParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    X509CertPairParser xcpp = new X509CertPairParser();\n    xcpp.engineInit(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n    \n    try{\n      xcpp.engineRead();\n    }\n    catch (StreamParsingException e){\n      return;\n    }\n    \n  }\n}\n"
  },
  {
    "path": "projects/bc-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Set encoding to UTF-8 for Java compilation\nexport JAVA_TOOL_OPTIONS=\"-Dfile.encoding=UTF-8\"\n\n# Disable ErrorProne by removing it from annotation processor path\n# ErrorProne requires Java 21+ but the base image has Java 17\ncat > /tmp/disable-errorprone.gradle << 'EOF'\nallprojects {\n    afterEvaluate {\n        tasks.withType(JavaCompile).configureEach {\n            options.errorprone.enabled = false\n            options.compilerArgs.removeAll { it.startsWith('-Xplugin:ErrorProne') }\n        }\n        // Remove errorprone from annotation processor configuration\n        configurations.matching { it.name.toLowerCase().contains('errorprone') }.all {\n            dependencies.clear()\n        }\n    }\n}\nEOF\n\n# Build only Java 8/11/15/17 compatible versions, skip Java 25 tasks\n$GRADLE jar -x compileJava25Java -x java25Classes --init-script /tmp/disable-errorprone.gradle\nfind . -name \"core*.jar\" -exec cp {} $OUT/core.jar \\;\nfind . -name \"bcpkix*.jar\" -exec cp {} $OUT/bcpkix.jar \\;\nfind . -name \"bcutil*.jar\" -exec cp {} $OUT/bcutil.jar \\;\nfind . -name \"bcprov*.jar\" -exec cp {} $OUT/bcprov.jar \\;\n\nALL_JARS=\"core.jar bcpkix.jar bcutil.jar bcprov.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH:/src/bc-java/pkix/src/test/java/\n\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -encoding UTF-8 -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--keep_going=20 \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\nmkdir -p $OUT/org/bouncycastle/cms/test\ncp -r /src/bc-java/pkix/src/test/java/org $OUT\n"
  },
  {
    "path": "projects/bc-java/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.bouncycastle.org/\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/bcgit/bc-java.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/bearssl/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget python\nRUN git clone --depth 1 https://www.bearssl.org/git/BearSSL\nRUN git clone --depth 1 --branch 3.10.0 https://github.com/randombit/botan.git\nRUN git clone --depth 1 https://github.com/MozillaSecurity/cryptofuzz\nRUN wget https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bearssl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Not using OpenSSL\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -Wno-deprecated-literal-operator\"\n\n# Install Boost headers\n    cd $SRC/\n    tar jxf boost_1_84_0.tar.bz2\n    cd boost_1_84_0/\n    CFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\n    CFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\n    cp -R boost/ /usr/include/\n\n# Generate lookup tables. This only needs to be done once.\n    cd $SRC/cryptofuzz\n    python gen_repository.py\n\n# Only test primitives which BearSSL supports\n    rm extra_options.h\n    echo -n '\"' >>extra_options.h\n    echo -n '--force-module=BearSSL ' >>extra_options.h\n    echo -n '--digests=MD5,SHA1,SHA224,SHA256,SHA384,SHA512,MD5_SHA1,SHAKE128,SHAKE256 ' >>extra_options.h\n    echo -n '--ciphers=AES_128_GCM,AES_192_GCM,AES_256_GCM,AES_128_CCM,AES_192_CCM,AES_256_CCM,CHACHA20,CHACHA20_POLY1305 ' >>extra_options.h\n    echo -n '--operations=Digest,HMAC,SymmetricEncrypt,SymmetricDecrypt,KDF_HKDF,KDF_TLS1_PRF,ECC_GenerateKeyPair,ECC_PrivateToPublic,ECDSA_Verify,ECDSA_Sign' >>extra_options.h\n    echo -n '\"' >>extra_options.h\n\n# Compile BearSSL\n    cd $SRC/BearSSL/\n    sed -i '/^CC = /d' conf/Unix.mk\n    sed -i '/^CFLAGS = /d' conf/Unix.mk\n    make -j$(nproc) lib\n\n    export BEARSSL_INCLUDE_PATH=$(realpath inc/)\n    export LIBBEARSSL_A_PATH=$(realpath ./build/libbearssl.a)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BEARSSL\"\n\n    # Compile Cryptofuzz BearSSL module\n    cd $SRC/cryptofuzz/modules/bearssl\n    make -B\n\n# Compile Botan\n    cd $SRC/botan\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        if [[ $CFLAGS != *sanitize=memory* ]]\n        then\n            ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\n        else\n            ./configure.py --disable-asm --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\n        fi\n    else\n        ./configure.py --cpu=x86_32 --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\n    fi\n    make -j$(nproc)\n\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BOTAN\"\n    export LIBBOTAN_A_PATH=\"$SRC/botan/libbotan-3.a\"\n    export BOTAN_INCLUDE_PATH=\"$SRC/botan/build/include\"\n\n    # Compile Cryptofuzz Botan module\n    cd $SRC/cryptofuzz/modules/botan\n    make -B\n\n# Compile Cryptofuzz\n    cd $SRC/cryptofuzz\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc) >/dev/null\n\n    # Generate dictionary\n    ./generate_dict\n\n    # Copy fuzzer\n    cp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-bearssl\n    # Copy dictionary\n    cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-bearssl.dict\n"
  },
  {
    "path": "projects/bearssl/project.yaml",
    "content": "homepage: \"https://bearssl.org/\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://www.bearssl.org/git/BearSSL\"\nauto_ccs:\n    - \"pornin@gmail.com\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n - x86_64\n - i386\n"
  },
  {
    "path": "projects/behaviortreecpp/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool cmake pkg-config wget libsodium-dev libgtest-dev\nRUN git clone --depth 1 https://github.com/BehaviorTree/BehaviorTree.CPP.git behaviortreecpp\nWORKDIR behaviortreecpp\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/behaviortreecpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport CXXFLAGS=\"${CXXFLAGS} -std=c++17 -stdlib=libstdc++\"\n\n# ===== BUILD Sqlite =====\nSQLITE_VER=sqlite-autoconf-3480000\n\nwget https://www.sqlite.org/2025/${SQLITE_VER}.tar.gz\ntar xzf ${SQLITE_VER}.tar.gz\ncd ${SQLITE_VER}\n./configure --enable-static --disable-shared\nmake -j\"$(nproc)\"\nmake install\ncd ..\n\n# ===== BUILD zeroMQ =====\ngit clone https://github.com/zeromq/libzmq.git\ncd libzmq\nmkdir build && cd build\ncmake .. -DBUILD_SHARED=OFF -DBUILD_STATIC=ON -DZMQ_BUILD_TESTS=OFF\nmake -j\"$(nproc)\"\nmake install\ncd ../..\n\n# ===== Build BehaviorTree.CPP =====\nmkdir build && cd build\n\nCMAKE_FLAGS=(\n  \"-DCMAKE_BUILD_TYPE=Release\"\n  \"-DENABLE_FUZZING=ON\"\n  \"-DFORCE_STATIC_LINKING=ON\"\n)\n\ncmake .. \"${CMAKE_FLAGS[@]}\"\nmake -j\"$(nproc)\"\n\nfor fuzzer in bt_fuzzer script_fuzzer bb_fuzzer; do\n  cp $fuzzer \"$OUT/\"\n\n  if [ -d ../fuzzing/corpus/${fuzzer} ]; then\n    zip -j \"$OUT/${fuzzer}_seed_corpus.zip\" ../fuzzing/corpus/${fuzzer}/*\n  fi\ndone\n"
  },
  {
    "path": "projects/behaviortreecpp/project.yaml",
    "content": "homepage: \"https://www.behaviortree.dev/\"\nlanguage: c++\nprimary_contact: \"christopher.krah@tii.ae\"\nmain_repo: \"https://github.com/BehaviorTree/BehaviorTree.CPP\"\nfile_github_issue: true\nvendor_ccs:\n  - \"dfaconti@aurynrobotics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/behaviortreecpp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build\n"
  },
  {
    "path": "projects/bignum-fuzzer/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! Project pinned after a clang update and an afl link error. Log: https://oss-fuzz-gcb-logs.storage.googleapis.com/log-6083635a-3f72-444d-80ef-3a0a26670cf7.txt\nRUN apt-get update && apt-get install -y software-properties-common curl sudo mercurial autoconf bison texinfo libboost-all-dev cmake wget lzip\nRUN wget https://go.dev/dl/go1.17.5.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.5.linux-amd64.tar.gz && ldconfig\nENV PATH=$PATH:/usr/local/go/bin\n\nRUN apt-get update && apt-get install -y \\\n    python-all-dev \\\n    python3-all-dev \\\n    python3-pip\n# mbedtls needs jsonschema which needs rpds-py which needs pip>=20\n# or a Rust toolchain.\nRUN pip3 install 'pip>=20'\n\nRUN git clone --depth 1 --recurse-submodules -b mbedtls-3.6 https://github.com/Mbed-TLS/mbedtls\n# Install Python packages from PyPI\nRUN pip3 install -r $SRC/mbedtls/scripts/basic.requirements.txt\n\nRUN wget https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.0.tar.gz\nRUN git clone --depth 1 https://github.com/guidovranken/bignum-fuzzer\nRUN git clone --depth 1 https://github.com/openssl/openssl\nRUN git clone https://boringssl.googlesource.com/boringssl\nRUN hg clone https://gmplib.org/repo/gmp/ libgmp/ || \\\n    (wget 'https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz' && tar xf gmp-6.2.1.tar.lz && mv $SRC/gmp-6.2.1/ $SRC/libgmp/)\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bignum-fuzzer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install Rust nightly\n#curl https://sh.rustup.rs -sSf | sh -s -- -y\n#source $HOME/.cargo/env\n\n# Build libmpdec\ntar zxf mpdecimal-4.0.0.tar.gz\ncd mpdecimal-4.0.0\n./configure && make -j$(nproc)\n\ncd $SRC/openssl\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n  CFLAGS+=\" -DOPENSSL_NO_ASM=1\"\nfi\n./config --debug no-fips no-shared no-tests\nmake -j$(nproc)\n\n# Build libgmp\ncd $SRC/libgmp\nautoreconf -ivf\n./configure --enable-maintainer-mode\nmake -j$(nproc)\n\n# Build OpenSSL module\ncd $SRC/bignum-fuzzer/modules/openssl\nOPENSSL_INCLUDE_PATH=$SRC/openssl/include OPENSSL_LIBCRYPTO_A_PATH=$SRC/openssl/libcrypto.a make\n\n# Build Go module\ncd $SRC/bignum-fuzzer/modules/go\nmake\n\n# Build Rust module\n#cd $SRC/bignum-fuzzer/modules/rust\n#make\n\n# Build C++-Boost module\ncd $SRC/bignum-fuzzer/modules/cpp_boost\nmake\n\n# Build libgmp module\ncd $SRC/bignum-fuzzer/modules/libgmp\nLIBGMP_INCLUDE_PATH=$SRC/libgmp LIBGMP_A_PATH=$SRC/libgmp/.libs/libgmp.a make\n\n# Build libmpdec module\ncd $SRC/bignum-fuzzer/modules/libmpdec\nLIBMPDEC_A_PATH=$SRC/mpdecimal-4.0.0/libmpdec/libmpdec.a LIBMPDEC_INCLUDE_PATH=$SRC/mpdecimal-4.0.0/libmpdec make\n\nBASE_CXXFLAGS=$CXXFLAGS\n\n# Build OpenSSL/Go fuzzer\ncd $SRC/bignum-fuzzer\n./config-modules.sh openssl go\nCXXFLAGS=\"$BASE_CXXFLAGS -DBNFUZZ_FLAG_NO_NEGATIVE=1 -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1\"\nLIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make\n\n# Copy OpenSSL/Go fuzzer to the designated location\ncp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_openssl_go_no_negative_num_len_1200_all_operations\n\n# Build OpenSSL/Rust fuzzer\n#cd $SRC/bignum-fuzzer\n#make clean\n#./config-modules.sh openssl rust\n#CXXFLAGS=\"$BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1\"\n#LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make\n\n# Copy OpenSSL/Rust fuzzer to the designated location\n#cp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_openssl_rust_num_len_1200_all_operations_num_loops_1\n\n# Build OpenSSL/C++-Boost fuzzer\ncd $SRC/bignum-fuzzer\nmake clean\n./config-modules.sh openssl cpp_boost\nCXXFLAGS=\"$BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1\"\nLIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make\n\n# Copy OpenSSL/C++-Boost fuzzer to the designated location\ncp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_openssl_cpp_boost_num_len_1200_all_operations_num_loops_1\n\n# Build OpenSSL/libgmp fuzzer\ncd $SRC/bignum-fuzzer\nmake clean\n./config-modules.sh openssl libgmp\nCXXFLAGS=\"$BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1\"\nLIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make\n\n# Copy OpenSSL/libgmp fuzzer to the designated location\ncp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_openssl_libgmp_num_len_1200_all_operations_num_loops_1\n\n# Build mbedtls\ncd $SRC/mbedtls\nmake lib -j$(nproc)\n\n# Build BoringSSL\ncd $SRC/boringssl\nmkdir build\ncd build\ncmake -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" -DCMAKE_C_FLAGS=\"$CFLAGS\" -DBORINGSSL_ALLOW_CXX_RUNTIME=1 ..\nmake -j$(nproc)\n\n# Build BoringSSL module\ncd $SRC/bignum-fuzzer/modules/openssl\nmake clean\nCFLAGS=\"$CFLAGS -DBIGNUM_FUZZER_BORINGSSL\" OPENSSL_INCLUDE_PATH=$SRC/boringssl/include OPENSSL_LIBCRYPTO_A_PATH=$SRC/boringssl/build/crypto/libcrypto.a make\n\n# Build mbedtls module\ncd $SRC/bignum-fuzzer/modules/mbedtls\nMBEDTLS_LIBMBEDCRYPTO_A_PATH=$SRC/mbedtls/library/libmbedcrypto.a MBEDTLS_INCLUDE_PATH=$SRC/mbedtls/include make\n\n# Build BoringSSL/mbedtls fuzzer\ncd $SRC/bignum-fuzzer\nmake clean\n./config-modules.sh boringssl mbedtls\nCXXFLAGS=\"$BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=100 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1\"\nLIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make\n\n# Copy BoringSSL/mbedtls fuzzer to the designated location\ncp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_boringssl_mbedtls_num_len_100_all_operations_num_loops_1\n\n# Build BoringSSL/libmpdec fuzzer\ncd $SRC/bignum-fuzzer\nmake clean\n./config-modules.sh boringssl libmpdec\nCXXFLAGS=\"$BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=100 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1\"\nLIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make\n\n# Copy BoringSSL/libmpdec fuzzer to the designated location\ncp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_boringssl_libmpdec_num_len_100_all_operations_num_loops_1\n\n# Copy seed corpora to the designated location\ncp $SRC/bignum-fuzzer/corpora/fuzzer_openssl_go_no_negative_num_len_1200_all_operations_seed_corpus.zip $OUT\n#cp $SRC/bignum-fuzzer/corpora/fuzzer_openssl_rust_num_len_1200_all_operations_num_loops_1_seed_corpus.zip $OUT\ncp $SRC/bignum-fuzzer/corpora/fuzzer_openssl_cpp_boost_num_len_1200_all_operations_num_loops_1_seed_corpus.zip $OUT\ncp $SRC/bignum-fuzzer/corpora/fuzzer_openssl_libgmp_num_len_1200_all_operations_num_loops_1_seed_corpus.zip $OUT\ncp $SRC/bignum-fuzzer/corpora/fuzzer_boringssl_mbedtls_num_len_100_all_operations_num_loops_1_seed_corpus.zip $OUT\ncp $SRC/bignum-fuzzer/corpora/fuzzer_boringssl_mbedtls_num_len_100_all_operations_num_loops_1_seed_corpus.zip $OUT/fuzzer_boringssl_libmpdec_num_len_100_all_operations_num_loops_1_seed_corpus.zip\n"
  },
  {
    "path": "projects/bignum-fuzzer/project.yaml",
    "content": "homepage: \"https://github.com/guidovranken/bignum-fuzzer\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nauto_ccs:\n    - \"martin.swende@ethereum.org\"\n    - \"cdetrio@ethereum.org\"\n    - \"openssl-security@openssl.org\"\n    - \"kurt@roeckx.be\"\n    - \"caswell.matt@googlemail.com\"\n    - \"jz.maddock@gmail.com\"\n    - \"jz.maddock@googlemail.com\"\n    - \"agl@google.com\"\n    - \"davidben@google.com\"\n    - \"svaldez@google.com\"\n    - \"mbed-tls-security@lists.trustedfirmware.org\"\n    - \"libmpdec4@gmail.com\"\n    - \"richard@levitte.org\"\nmain_repo: 'https://github.com/guidovranken/bignum-fuzzer'\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n"
  },
  {
    "path": "projects/bincode/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust as builder\nRUN apt-get update\nRUN git clone --depth 1 https://git.sr.ht/~stygianentity/bincode\nENV RUSTUP_TOOLCHAIN nightly-2025-01-10\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bincode/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/bincode\ncargo fuzz build -O\ncp $SRC/bincode/fuzz/target/x86_64-unknown-linux-gnu/release/compat $OUT/\ncp $SRC/bincode/fuzz/target/x86_64-unknown-linux-gnu/release/roundtrip $OUT/"
  },
  {
    "path": "projects/bincode/project.yaml",
    "content": "homepage: \"https://git.sr.ht/~stygianentity/bincode\"\nlanguage: rust\nprimary_contact: \"nathan@mccarty.io\"\nauto_ccs:\n  - \"zoey@dos.cafe\"\n  - \"github@trangar.com\"\n  - \"ty@pre-alpha.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://git.sr.ht/~stygianentity/bincode'\n"
  },
  {
    "path": "projects/bind9/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nENV DEBIAN_FRONTEND noninteractive\nRUN apt-get -y update && apt-get -y dist-upgrade\nRUN apt-get -y install\t\t\\\n\tautoconf\t\t\\\n\tautomake\t\t\\\n\tautotools-dev\t\t\\\n\tbison\t\t\t\\\n\tbuild-essential\t\t\\\n\tlibcap-dev\t\t\\\n\tlibnghttp2-dev\t\t\\\n\tlibssl-dev\t\t\\\n\tlibtool\t\t\t\\\n\tlibtool-bin\t\t\\\n\tliburcu-dev\t\t\\\n\tlibuv1-dev\t\t\\\n\tpkg-config\t\t\\\n\tzip \\\n    libcmocka-dev && \\\n    python3 -m pip install  -U meson ninja\n\nRUN git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9.git\nWORKDIR bind9\nCOPY *.sh *.diff $SRC/\n"
  },
  {
    "path": "projects/bind9/build.sh",
    "content": "#!/bin/sh -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"${CFLAGS} -fPIC -Wl,--allow-multiple-definition\"\nexport CXXFLAGS=\"${CXXFLAGS} -fPIC -Wl,--allow-multiple-definition\"\n\ngit apply  --ignore-space-change --ignore-whitespace $SRC/patch.diff\n\n# Use valid value for -Dfuzzing (enabled/disabled/auto)\nmeson setup build -Dfuzzing=enabled -Dcmocka=enabled \\\n  -Dc_link_args=\"$CFLAGS\" -Dcpp_link_args=\"$CXXFLAGS\" \\\n  -Dc_args=\"$CFLAGS\" -Dcpp_args=\"$CXXFLAGS\" \\\n  -Ddefault_library=static -Dprefer_static=true \\\n  -Db_lto=false \\\n  -Dnamed-lto=disabled\nmeson compile -C build fuzz_dns_master_load fuzz_dns_message_checksig fuzz_dns_message_parse fuzz_dns_name_fromtext_target fuzz_dns_name_fromwire fuzz_dns_qp fuzz_dns_qpkey_name fuzz_dns_rdata_fromtext fuzz_dns_rdata_fromwire_text fuzz_isc_lex_getmastertoken fuzz_isc_lex_gettoken --verbose\n\nfor fuzzname in fuzz_dns_master_load fuzz_dns_message_checksig fuzz_dns_message_parse fuzz_dns_name_fromtext_target fuzz_dns_name_fromwire fuzz_dns_qp fuzz_dns_qpkey_name fuzz_dns_rdata_fromtext fuzz_dns_rdata_fromwire_text fuzz_isc_lex_getmastertoken fuzz_isc_lex_gettoken; do\n  fuzzer_basename=\"${fuzzname:5}\"\n  fuzzer_name=\"${fuzzname:5}_fuzzer\"\n  cp build/${fuzzname} $OUT/${fuzzer_name}\n  zip -j \"${OUT}/${fuzzer_name}_seed_corpus.zip\" ./fuzz/${fuzzer_basename}.in/* || true\ndone\n"
  },
  {
    "path": "projects/bind9/patch.diff",
    "content": "diff --git a/meson.build b/meson.build\nindex d4a675b..f5cb72a 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -1584,7 +1584,7 @@ foreach name, sources : fuzz_binaries\n         implicit_include_directories: true,\n         install: false,\n         c_args: ['-Wno-vla'],\n-        link_args: fuzz_link_args,\n+        link_args: fuzz_link_args + ['-fsanitize=fuzzer'],\n         dependencies: [\n             libdns_dep,\n             libisc_dep,\ndiff --git a/tests/meson.build b/tests/meson.build\nindex 416ba51..6feb638 100644\n--- a/tests/meson.build\n+++ b/tests/meson.build\n@@ -15,7 +15,7 @@ test_inc = include_directories(\n     '..' / 'lib' / 'dns',\n )\n \n-libtest = shared_library(\n+libtest = static_library(\n     'bindtest',\n     files(\n         'libtest/dns.c',\n"
  },
  {
    "path": "projects/bind9/project.yaml",
    "content": "homepage: \"https://gitlab.isc.org/isc-projects/bind9\"\nlanguage: c\nprimary_contact: \"ondrej@isc.org\"\nauto_ccs:\n  - \"artem@isc.org\"\n  - \"aram@isc.org\"\n  - \"each@isc.org\"\n  - \"marka@isc.org\"\n  - \"matthijs@isc.org\"\n  - \"michal@isc.org\"\n  - \"mnowak@isc.org\"\n  - \"pspacek@isc.org\"\nsanitizers:\n  - address\nmain_repo: 'https://gitlab.isc.org/isc-projects/bind9.git'\n\nfuzzing_engines:\n  - libfuzzer\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/bind9/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmeson test -C build\n"
  },
  {
    "path": "projects/binutils/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make texinfo libgmp-dev libmpfr-dev\nRUN apt-get install -y flex bison\nRUN git clone --depth=1 https://github.com/DavidKorczynski/binary-samples binary-samples\nRUN git clone --recursive --depth 1 git://sourceware.org/git/binutils-gdb.git binutils-gdb\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fuzz_*.c $SRC/\n"
  },
  {
    "path": "projects/binutils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nif [ \"$SANITIZER\" = undefined ]; then\n    export CFLAGS=\"$CFLAGS -fno-sanitize=unsigned-integer-overflow\"\n    export CXXFLAGS=\"$CXXFLAGS -fno-sanitize=unsigned-integer-overflow\"\nfi\ncd binutils-gdb\n\n# Comment out the lines of logging to stderror from elfcomm.c\n# This is to make it nicer to read the output of libfuzzer.\ncd binutils\nsed -i 's/vfprintf (stderr/\\/\\//' elfcomm.c\nsed -i 's/fprintf (stderr/\\/\\//' elfcomm.c\n\n# Fix a dlltool leak, which won't be fixed upstream because it uses a\n# non-posix yacc feature.  It also isn't seen as a direct leak when\n# running dlltool stand-alone.\nsed -i '/^%%$/i%destructor { free (\\$\\$); } ID' defparse.y\n\ncd ../\n\n./configure --disable-gdb --disable-gdbserver --disable-gdbsupport \\\n\t    --disable-libdecnumber --disable-readline --disable-sim \\\n\t    --disable-libbacktrace --disable-gas --disable-ld --disable-werror \\\n      --enable-targets=all\nmake clean\nmake MAKEINFO=true -j$(nproc) && true\n\n\n# Make fuzzer directory\nmkdir fuzz\ncp ../fuzz_*.c fuzz/\ncd fuzz\n\nLIBS=\"../opcodes/libopcodes.a ../libctf/.libs/libctf.a ../bfd/.libs/libbfd.a ../zlib/libz.a ../libsframe/.libs/libsframe.a ../libiberty/libiberty.a\"\nfor i in fuzz_disassemble fuzz_bfd fuzz_bfd_ext; do\n    $CC $CFLAGS -I ../include -I ../bfd -I ../opcodes -c $i.c -o $i.o\n    $CXX $CXXFLAGS $i.o -o $OUT/$i $LIB_FUZZING_ENGINE -Wl,--start-group ${LIBS} -Wl,--end-group\ndone\n\n# Build targeted disassembly fuzzers\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n  echo \"Skipping specialised disassembly fuzzers in CI to reduce build time\"\nelse\n  for ARCH_TARGET in bfd_arch_arm bfd_arch_mips bfd_arch_i386 bfd_arch_arc bfd_arch_csky bfd_arch_mep; do\n      $CC $CFLAGS -I ../include -I ../bfd -I ../opcodes -c fuzz_disas_ext.c -DFUZZ_TARGET_ARCH=$ARCH_TARGET \\\n        -o fuzz_disas_ext-$ARCH_TARGET.o\n      $CXX $CXXFLAGS fuzz_disas_ext-$ARCH_TARGET.o -o $OUT/fuzz_disas_ext-$ARCH_TARGET $LIB_FUZZING_ENGINE \\\n        -Wl,--start-group ${LIBS} -Wl,--end-group\n  done\nfi\n\n# Now compile the src/binutils fuzzers\ncd ../binutils\n\n# Compile the fuzzers.\n# The general strategy is to remove main functions such that the fuzzer (which has its own main)\n# can link against the code.\n\n#\n# Patching\n#\n# First do readelf. We do this by changing readelf.c to readelf.h - the others will be changed\n# to fuzz_readelf.h where readelf is their respective name. The reason it's different for readelf\n# is because readelf does not have a header file so we can use readelf.h instead, and changing it\n# might cause an annoyance on monorail since bugs will be relocated as the files will be different.\ncp ../../fuzz_*.c .\nsed 's/main (int argc/old_main (int argc, char **argv);\\nint old_main (int argc/' readelf.c >> readelf.h\n\n# Special handling of dlltool\nsed 's/main (int ac/old_main32 (int ac, char **av);\\nint old_main32 (int ac/' dlltool.c > fuzz_dlltool.h\n\n# Patch the rest\nfor i in objdump nm objcopy windres strings addr2line; do\n    sed -i 's/strip_main/strip_mian/g' $i.c\n    sed -i 's/copy_main/copy_mian/g' $i.c\n    sed 's/main (int argc/old_main32 (int argc, char **argv);\\nint old_main32 (int argc/' $i.c > fuzz_$i.h\n    sed -i 's/copy_mian/copy_main/g' fuzz_$i.h\ndone\n\n#\n# Compile fuzzers\n#\nfuzz_compile () {\n  src=$1\n  dst=$2\n  extraflags=$3\n  $CC $CFLAGS ${extraflags} -DHAVE_CONFIG_H -DOBJDUMP_PRIVATE_VECTORS=\"\" -I. -I../bfd -I./../bfd -I./../include \\\n    -I./../zlib -DLOCALEDIR=\"\\\"/usr/local/share/locale\\\"\" \\\n    -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -MT \\\n    fuzz_$dst.o -MD -MP -c -o fuzz_$dst.o fuzz_$src.c\n}\nfor i in objdump readelf nm objcopy windres ranlib_simulation strings addr2line dwarf; do\n  fuzz_compile $i $i \"\"\ndone\n\n# Fuzzers that need additional flags\nfuzz_compile dlltool dlltool \"-DDLLTOOL_I386 -DDLLTOOL_DEFAULT_I386\"\nfuzz_compile objdump objdump_safe \"-DOBJDUMP_SAFE\"\nfuzz_compile readelf readelf_pef \"-DREADELF_TARGETED=\\\"pef\\\"\"\nfuzz_compile readelf readelf_elf32_bigarm \"-DREADELF_TARGETED=\\\"elf32-bigarm\\\"\"\nfuzz_compile readelf readelf_elf32_littlearm \"-DREADELF_TARGETED=\\\"elf32-littlearm\\\"\"\nfuzz_compile readelf readelf_elf64_mmix \"-DREADELF_TARGETED=\\\"elf64-mmix\\\"\"\nfuzz_compile readelf readelf_elf32_csky \"-DREADELF_TARGETED=\\\"elf32-csky\\\"\"\n\n#\n# Link fuzzers\n#\n# Link the files, but only if everything went well, which we verify by checking\n# the presence of some object files.\nLINK_LIBS=\"-Wl,--start-group ${LIBS} -Wl,--end-group\"\nOBJ1=\"bucomm.o version.o filemode.o\"\nOBJ2=\"version.o unwind-ia64.o dwarf.o elfcomm.o demanguse.o\"\nOBJ3=\"dwarf.o prdbg.o rddbg.o unwind-ia64.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o od-xcoff.o demanguse.o\"\n\ndeclare -A fl\nfl[\"readelf\"]=${OBJ2}\nfl[\"readelf_pef\"]=${OBJ2}\nfl[\"readelf_elf32_bigarm\"]=${OBJ2}\nfl[\"readelf_elf32_littlearm\"]=${OBJ2}\nfl[\"readelf_elf64_mmix\"]=${OBJ2}\nfl[\"readelf_elf32_csky\"]=${OBJ2}\nfl[\"objdump\"]=${OBJ3}\nfl[\"objdump_safe\"]=${OBJ3}\nfl[\"dwarf\"]=${OBJ3}\nfl[\"addr2line\"]=${OBJ1}\nfl[\"objcopy\"]=\"rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o ${OBJ1}\"\nfl[\"nm\"]=\"${OBJ1} demanguse.o\"\nfl[\"dlltool\"]=\"defparse.o deflex.o ${OBJ1}\"\nfl[\"windres\"]=\"resrc.o rescoff.o resbin.o rcparse.o rclex.o winduni.o resres.o ${OBJ1}\"\nfl[\"ranlib_simulation\"]=\" \"\nfl[\"strings\"]=${OBJ1}\nfor fuzzer in ${!fl[@]}; do\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE -W -Wall -I./../zlib \\\n    -o $OUT/fuzz_${fuzzer} fuzz_${fuzzer}.o \\\n    ${fl[${fuzzer}]} ${LINK_LIBS}\ndone\n\n# Build GAS fuzzer. Will keep this here in case GAS fuzzer is used in the future.\nif [ \"$FUZZING_ENGINE\" != \"afl\" ]\nthen\n  cd ../gas\n  ./configure --enable-leak-check\n  make -j$(nproc)\n  sed 's/main (int argc/old_main32 (int argc, char **argv);\\nint old_main32 (int argc/' as.c > fuzz_as.h\n  rm as.o || true\n  ar r libar.a *.o\n\n  $CC $CFLAGS -DHAVE_CONFIG_H -I.  -I. -I. -I../bfd -I./config -I./../include -I./.. -I./../bfd \\\n      -DLOCALEDIR=\"\\\"/usr/local/share/locale\\\"\" -I./../zlib -c $SRC/fuzz_as.c -o fuzz_as.o\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE -I./../zlib -o $OUT/fuzz_as ./fuzz_as.o \\\n      libar.a config/tc-i386.o config/obj-elf.o config/atof-ieee.o  \\\n      ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a \\\n      -L/src/binutils-gdb/zlib ../libsframe/.libs/libsframe.a ../libiberty/libiberty.a -lz\nfi\n\n# Copy seeds out\nfor fuzzname in readelf_pef readelf_elf32_csky readelf_elf64_mmix readelf_elf32_littlearm readelf_elf32_bigarm objdump objdump_safe nm objcopy bfd windres addr2line dwarf; do\n  cp $SRC/binary-samples/oss-fuzz-binutils/general_seeds.zip $OUT/fuzz_${fuzzname}_seed_corpus.zip\ndone\n# Seed targeted the pef file format\ncp $SRC/binary-samples/oss-fuzz-binutils/fuzz_bfd_ext_seed_corpus.zip $OUT/fuzz_bfd_ext_seed_corpus.zip\n\n# Copy options files\nfor ft in readelf readelf_pef readelf_elf32_csky readelf_elf64_mmix readelf_elf32_littlearm readelf_elf32_bigarm objcopy objdump dlltool disas_ext-bfd_arch_csky nm as windres objdump_safe ranlib_simulation addr2line dwarf; do\n  echo \"[libfuzzer]\" > $OUT/fuzz_${ft}.options\n  echo \"detect_leaks=0\" >> $OUT/fuzz_${ft}.options\ndone\n"
  },
  {
    "path": "projects/binutils/fuzz_addr2line.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert addr2line.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include \"fuzz_addr2line.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  program_name = filename;\n\n  char **c2 = xmalloc(sizeof(char*)*6);\n  c2[0] = xstrdup(\"AAABC\");\n  c2[1] = xstrdup(\"BBC\");\n  c2[2] = xstrdup(\"0xbeefbeef\");\n  c2[3] = xstrdup(\"0xcafebabe\");\n  c2[4] = xstrdup(\"5123423\");\n  c2[5] = NULL;\n\n  naddr = 5;\n  addr = c2;\n\n  // Main fuzz entrypoint in addr2line.c\n  process_file(filename, NULL, NULL);\n\n  for (int i = 5; --i >= 0; )\n    free(c2[i]);\n  free(c2);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_as.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert as.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include <fuzz_as.h>\n\n/* Don't allow cleanups.  libiberty's function of the same name adds\n   cleanups to a list without any means of clearing the list.  The\n   list must be clear at the start if LLVMFuzzerTestOneInput is to run\n   more than once, otherwise we will get multiple copies of the same\n   cleanup on the list which leads to double frees if xexit is called.\n   Also a cleanup from the first run can result in use-after-free\n   errors when as_fatal is hit as in issue 56429.  */\nint\nxatexit (void (*fn) (void) ATTRIBUTE_UNUSED)\n{\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size > 1024)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer-%d.s\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  reg_section = NULL;\n\n  char *fakeArgv[3];\n  fakeArgv[0] = \"fuzz_as\";\n  fakeArgv[1] = filename; // Assemble our fake source file.\n  fakeArgv[2] = NULL;\n\n  int argc = 2;\n  char **argv = fakeArgv;\n  gas_early_init (&argc, &argv);\n\n  out_file_name = \"/tmp/tmp-out\";\n\n  gas_init ();\n\n  // Main fuzzer target. Assemble our random data.\n  perform_an_assembly_pass (argc, argv);\n\n  // Cleanup\n  cond_finish_check (-1);\n  codeview_finish ();\n  dwarf2_finish ();\n  cfi_finish ();\n  input_scrub_end ();\n\n  keep_it = 0;\n  output_file_close ();\n  free_notes ();\n  unlink(filename);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_bfd.c",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"sysdep.h\"\n#include \"bfd.h\"\n\n#include <stdint.h>\n#include <stdio.h>\n#include <unistd.h>\n\nstatic int bufferToFile(char * name, const uint8_t *Data, size_t Size) {\n    int fd = mkstemp(name);\n    if (fd < 0) {\n        printf(\"failed mkstemp, errno=%d\\n\", errno);\n        return -2;\n    }\n    if (write (fd, Data, Size) != Size) {\n        printf(\"failed write, errno=%d\\n\", errno);\n        close(fd);\n        return -3;\n    }\n    close(fd);\n    return 0;\n}\n\n//TODO? part of fuzzing\nchar *target = NULL;\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  if (Size > 16384)\n    return 0;\n    char tmpfilename[32];\n\n    if (bfd_init() != BFD_INIT_MAGIC)\n      abort();\n\n    strncpy(tmpfilename, \"/tmp/fuzz.bfd-XXXXXX\", 31);\n    if (bufferToFile(tmpfilename, Data, Size) < 0) {\n        return 0;\n    }\n    bfd *file = bfd_openr (tmpfilename, target);\n    if (file == NULL)\n    {\n        remove(tmpfilename);\n        return 0;\n    }\n    bfd_check_format (file, bfd_archive);\n    //TODO loop over subfiles and more processing\n    bfd_close (file);\n    remove(tmpfilename);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_bfd_ext.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n\n/*\n * This is an example fuzzer targeted a given architecture. The point of this is\n * that the general fuzz_bfd fuzzer has too large reacability which makes it\n * difficult to reach the entire codebase in practice. The goal is to create\n * more targeted fuzzers that are more likely to explore a given code area.\n *\n */\n#include \"sysdep.h\"\n#include \"bfd.h\"\n#include \"libbfd.h\"\n\n#include <stdint.h>\n#include <stdio.h>\n#include <unistd.h>\n\nstatic int bufferToFile(char *name, const uint8_t *Data, size_t Size) {\n  int fd = mkstemp(name);\n  if (fd < 0) {\n    printf(\"failed mkstemp, errno=%d\\n\", errno);\n    return -2;\n  }\n  if (write(fd, Data, Size) != Size) {\n    printf(\"failed write, errno=%d\\n\", errno);\n    close(fd);\n    return -3;\n  }\n  close(fd);\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  if (Size > 16384)\n    return 0;\n  char tmpfilename[32];\n\n  if (bfd_init() != BFD_INIT_MAGIC)\n    abort();\n\n  /*\n      char **names = bfd_target_list();\n      while (*names != NULL) {\n        printf(\"Name: %s\\n\", *names);\n        names++;\n      }\n  */\n\n  bfd_cleanup cleanup = NULL;\n\n  strncpy(tmpfilename, \"/tmp/fuzz.bfd-XXXXXX\", 31);\n  if (bufferToFile(tmpfilename, Data, Size) < 0) {\n    return 0;\n  }\n  // bfd *file = bfd_openr (tmpfilename, \"elf32-frv\");\n  bfd *file = bfd_openr(tmpfilename, \"pef\");\n  if (file == NULL) {\n    remove(tmpfilename);\n    return 0;\n  }\n\n  if (!bfd_read_p(file) ||\n      (unsigned int)file->format >= (unsigned int)bfd_type_end) {\n    bfd_close(file);\n    return 0;\n  }\n\n  bool doAnalysis = false;\n  if (bfd_seek(file, (file_ptr)0, SEEK_SET) == 0) {\n    file->format = bfd_object;\n    cleanup = BFD_SEND_FMT(file, _bfd_check_format, (file));\n    if (cleanup) {\n      doAnalysis = true;\n      cleanup(file);\n    }\n    file->format = bfd_unknown;\n  }\n\n  if (file != NULL) {\n    bfd_close(file);\n  }\n\n  if (doAnalysis) {\n    // We have a file with the target data we want.\n    // Let's open as a write file this time, which should trigger\n    // more actions on the code when calling bfd_close.\n    // TODO: do more processing on this, e.g. use the file as\n    // input to some of the other utilities.\n    bfd *wFile = bfd_openw(tmpfilename, \"pef\");\n    if (file != NULL) {\n      bfd_close(wFile);\n    }\n  }\n\n  remove(tmpfilename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_disas_ext.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * This disassemble fuzzer can be used for targetting specific architectures\n * and also initilises the target architecture with a random options string.\n * This is useful, for example, to hit architectures the general disassembly\n * fuzzer may not be hitting, and also to fuzz disassemblers in different\n * settings. This fuzzer also targets both big and small endianness. Down\n * the line this fuzzer can be expanded on, e.g. to include symobls and data\n * in the memory that is to be disassembled.\n */\n#include \"sysdep.h\"\n#include \"bfd.h\"\n#include \"dis-asm.h\"\n#include \"disassemble.h\"\n\n#include <stdint.h>\n\n#define MAX_TEXT_SIZE 256\n\ntypedef struct\n{\n  char *buffer;\n  size_t pos;\n} SFILE;\n\nstatic int\nfuzz_disasm_null_styled_printf (void *stream,\n             enum disassembler_style style,\n             const char *format, ...)\n{\n  return 0;\n}\n\n\nstatic int objdump_sprintf (void *vf, const char *format, ...)\n{\n  SFILE *f = (SFILE *) vf;\n  size_t n;\n  va_list args;\n\n  va_start (args, format);\n  if (f->pos >= MAX_TEXT_SIZE){\n    printf(\"buffer needs more space\\n\");\n    //reset\n    f->pos=0;\n    return 0;\n  }\n  n = vsnprintf (f->buffer + f->pos, MAX_TEXT_SIZE - f->pos, format, args);\n  //vfprintf(stdout, format, args);\n  va_end (args);\n  f->pos += n;\n  return n;\n}\n\nchar options[100]; // Enable the disassemblers to have random options.\n\nvoid\ndisassemble_architecture(int arch, const uint8_t *Data, size_t Size, int big) {\n  char AssemblyText[MAX_TEXT_SIZE];\n  struct disassemble_info disasm_info;\n  SFILE s;\n\n  init_disassemble_info (&disasm_info, stdout, (fprintf_ftype) fprintf, fuzz_disasm_null_styled_printf);\n  disasm_info.fprintf_func = objdump_sprintf;\n  disasm_info.print_address_func = generic_print_address;\n  disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE;\n  disasm_info.buffer = (bfd_byte *) Data;\n  disasm_info.buffer_vma = 0x1000;\n  disasm_info.buffer_length = Size-10;\n  disasm_info.insn_info_valid = 0;\n  disasm_info.disassembler_options = options;\n  disasm_info.created_styled_output = false;\n\n  s.buffer = AssemblyText;\n  s.pos = 0;\n  disasm_info.stream = &s;\n  disasm_info.bytes_per_line = 0;\n\n  disasm_info.flags |= USER_SPECIFIED_MACHINE_TYPE;\n  disasm_info.arch = arch;\n  disasm_info.mach = bfd_getl64(&Data[Size-9]);\n  disasm_info.flavour = Data[Size-10];\n\n  if (bfd_lookup_arch (disasm_info.arch, disasm_info.mach) != NULL) {\n    disassembler_ftype disasfunc = disassembler(disasm_info.arch, big, disasm_info.mach, NULL);\n    if (disasfunc != NULL) {\n      disassemble_init_for_target(&disasm_info);\n      while (1) {\n        s.pos = 0;\n        int octets = disasfunc(disasm_info.buffer_vma, &disasm_info);\n        if (octets < (int) disasm_info.octets_per_byte)\n          break;\n        if (disasm_info.buffer_length <= (size_t) octets)\n          break;\n        disasm_info.buffer += octets;\n        disasm_info.buffer_vma += octets / disasm_info.octets_per_byte;\n        disasm_info.buffer_length -= octets;\n      }\n      disassemble_free_target(&disasm_info);\n    }\n  }\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  if (Size < 110 || Size > 16394) {\n    // 110 bytes for options\n    // 16394 limit code to prevent timeouts\n    return 0;\n  }\n  char arch = *Data;\n\n  // Create a random options string\n  memcpy(options, Data, 100);\n  options[99] = '\\0';\n  Data += 100;\n  Size -= 100;\n\n  // FUZZ_TARGET_ARCH must be defined and should be the architecture\n  // you target.\n  disassemble_architecture(FUZZ_TARGET_ARCH, Data, Size, 1);\n  disassemble_architecture(FUZZ_TARGET_ARCH, Data, Size, 0);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_disassemble.c",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"sysdep.h\"\n#include \"bfd.h\"\n#include \"dis-asm.h\"\n#include \"disassemble.h\"\n\n#include <stdint.h>\n\n#define MAX_TEXT_SIZE 256\n\ntypedef struct\n{\n    char *buffer;\n    size_t pos;\n} SFILE;\n\nstatic int\nfuzz_disasm_null_styled_printf (void *stream,\n\t\t\t       enum disassembler_style style,\n\t\t\t       const char *format, ...)\n{\n  return 0;\n}\n\nstatic int objdump_sprintf (void *vf, const char *format, ...)\n{\n    SFILE *f = (SFILE *) vf;\n    size_t n;\n    va_list args;\n\n    va_start (args, format);\n    if (f->pos >= MAX_TEXT_SIZE){\n        printf(\"buffer needs more space\\n\");\n        //reset\n        f->pos=0;\n        return 0;\n    }\n    n = vsnprintf (f->buffer + f->pos, MAX_TEXT_SIZE - f->pos, format, args);\n    //vfprintf(stdout, format, args);\n    va_end (args);\n    f->pos += n;\n    return n;\n}\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    char AssemblyText[MAX_TEXT_SIZE];\n    struct disassemble_info disasm_info;\n    SFILE s;\n\n    if (Size < 10 || Size > 16394) {\n        // 10 bytes for options\n        // 16394 limit code to prevent timeouts\n        return 0;\n    }\n\n    init_disassemble_info (&disasm_info, stdout, (fprintf_ftype) fprintf, fuzz_disasm_null_styled_printf);\n    disasm_info.fprintf_func = objdump_sprintf;\n    disasm_info.print_address_func = generic_print_address;\n    disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE;\n    disasm_info.buffer = (bfd_byte *) Data;\n    disasm_info.buffer_vma = 0x1000;\n    disasm_info.buffer_length = Size-10;\n    disasm_info.insn_info_valid = 0;\n    disasm_info.created_styled_output = false;\n    s.buffer = AssemblyText;\n    s.pos = 0;\n    disasm_info.stream = &s;\n    disasm_info.bytes_per_line = 0;\n\n    disasm_info.flags |= USER_SPECIFIED_MACHINE_TYPE;\n    disasm_info.arch = Data[Size-1];\n    disasm_info.mach = bfd_getl64(&Data[Size-9]);\n    disasm_info.flavour = Data[Size-10];\n\n    if (bfd_lookup_arch (disasm_info.arch, disasm_info.mach) != NULL) {\n        disassembler_ftype disasfunc = disassembler(disasm_info.arch, 0, disasm_info.mach, NULL);\n        if (disasfunc != NULL) {\n            disassemble_init_for_target(&disasm_info);\n            while (1) {\n                s.pos = 0;\n                int octets = disasfunc(disasm_info.buffer_vma, &disasm_info);\n                if (octets < (int) disasm_info.octets_per_byte)\n                    break;\n                if (disasm_info.buffer_length <= (size_t) octets)\n                    break;\n                disasm_info.buffer += octets;\n                disasm_info.buffer_vma += octets / disasm_info.octets_per_byte;\n                disasm_info.buffer_length -= octets;\n            }\n            disassemble_free_target(&disasm_info);\n        }\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_dlltool.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert dlltool.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include \"fuzz_dlltool.h\"\n\nvoid\ninit_dlltool_global_state() {\n  import_list = NULL;\n  as_name = NULL;\n  as_flags = \"\";\n  tmp_prefix = NULL;\n  exp_name = NULL;\n  imp_name = NULL;\n  delayimp_name = NULL;\n  identify_imp_name = NULL;\n  identify_strict = false;\n  head_label = NULL;\n  imp_name_lab = NULL;\n  dll_name = NULL;\n  dll_name_set_by_exp_name = 0;\n  add_indirect = 0;\n  add_underscore = 0;\n  add_stdcall_underscore = 0;\n  leading_underscore = \"_\";\n  dontdeltemps = 0;\n  do_default_excludes = true;\n  use_nul_prefixed_import_tables = false;\n  def_file = NULL;\n}\n\nvoid callIntoDlltool(char *, char*, bool);\nvoid\ncallIntoDlltool(char *deffile, char *objfile, bool var_export_all_symbols) {\n  init_dlltool_global_state();\n  program_name = \"fuzz_dlltool\";\n  mname = \"mcore-elf\";\n  export_all_symbols = var_export_all_symbols;\n\n  // At the moment we focus on the def file processing\n  def_file = deffile;\n  process_def_file(deffile);\n  scan_obj_file(objfile);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size < 512 || size > 16384)\n    return 0;\n\n  /* def file */\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, 412, 1, fp);\n  fclose(fp);\n\n  data += 412;\n  size -= 412;\n\n  char filename2[256];\n  sprintf(filename2, \"/tmp/libfuzzer-2.%d\", getpid());\n  FILE *fp2 = fopen(filename2, \"wb\");\n  if (!fp2) {\n    return 0;\n  }\n\n  fwrite(data, size, 1, fp2);\n  fclose(fp2);\n\n  callIntoDlltool(filename, filename2, true);\n  callIntoDlltool(filename, filename2, false);\n\n  unlink(filename);\n  unlink(filename2);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_dwarf.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer that targets load_separate_debug_files in dwarf.c\n * To do this we rely on some of the logic in objdump.c\n */\n#include \"fuzz_objdump.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  bfd *file = bfd_openr (filename, NULL);\n  if (file)\n    {\n      if (bfd_check_format (file, bfd_object))\n\t{\n\t  load_separate_debug_files (file, bfd_get_filename (file));\n\t  free_debug_memory ();\n\t}\n      bfd_close_all_done (file);\n    }\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_nm.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert nm.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include \"fuzz_nm.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  // Globals\n  line_numbers = 1;\n  no_sort = 0;\n  sort_numerically = 1;\n  sort_by_size = 0;\n  filename_per_symbol = 1;\n\n\n  // Main fuzz entrypoint in nm.c\n  display_file(filename);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_objcopy.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert objcopy.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#define is_strip 0\n#include \"fuzz_objcopy.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\n\nvoid\ninit_objcopy_global_state() {\n  // status is a global variable that is set to 0 initially,\n  // and we should ensure the state is not maintained for each iteration.\n  status = 0;\n  pe_file_alignment = (bfd_vma) -1;\n  pe_heap_commit = (bfd_vma) -1;\n  pe_heap_reserve = (bfd_vma) -1;\n  pe_image_base = (bfd_vma) -1;\n  pe_section_alignment = (bfd_vma) -1;\n  pe_stack_commit = (bfd_vma) -1;\n  pe_stack_reserve = (bfd_vma) -1;\n  pe_subsystem = -1;\n  pe_major_subsystem_version = -1;\n  pe_minor_subsystem_version = -1;\n  section_rename_list = NULL;\n  isympp = NULL;\n  osympp = NULL;\n  copy_byte = -1;\n  interleave = 0;\n  copy_width = 1;\n  keep_section_symbols = false;\n  deterministic = -1;\n  status = 0;\n  merge_notes = false;\n  strip_symbols = STRIP_UNDEF;\n  change_sections = NULL;\n  change_start = 0;\n  set_start_set = false;\n  change_section_address = 0;\n  gap_fill_set = false;\n  gap_fill = 0;\n  pad_to_set = false;\n  use_alt_mach_code = 0;\n  add_sections = NULL;\n  update_sections = NULL;\n  dump_sections = NULL;\n  gnu_debuglink_filename = NULL;\n  convert_debugging = false;\n  change_leading_char = false;\n  remove_leading_char = false;\n  wildcard = false;\n  localize_hidden = false;\n  strip_specific_htab = NULL;\n  strip_unneeded_htab = NULL;\n  keep_specific_htab = NULL;\n  localize_specific_htab = NULL;\n  globalize_specific_htab = NULL;\n  keepglobal_specific_htab = NULL;\n  weaken_specific_htab = NULL;\n  redefine_specific_htab = NULL;\n  redefine_specific_reverse_htab = NULL;\n  add_sym_tail = &add_sym_list;\n  add_symbols = 0;\n  strip_specific_buffer = NULL;\n  strip_unneeded_buffer = NULL;\n  keep_specific_buffer = NULL;\n  localize_specific_buffer = NULL;\n  globalize_specific_buffer = NULL;\n  keepglobal_specific_buffer = NULL;\n  weaken_specific_buffer = NULL;\n  weaken = false;\n  keep_file_symbols = false;\n  prefix_symbols_string = 0;\n  prefix_sections_string = 0;\n  prefix_alloc_sections_string = 0;\n  extract_symbol = false;\n\n  create_symbol_htabs();\n}\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  program_name = filename;\n\n  if (bfd_init() != BFD_INIT_MAGIC)\n    abort();\n\n  set_default_bfd_target();\n\n  init_objcopy_global_state();\n\n  /* glibc getopt has internal static state.  Setting optind to zero\n     reinitialises it.  Do this every second run, which effectively\n     alternates objcopy with options then objcopy without options.\n     (optind will be 9 when copy_main returns.)  */\n  static int iter;\n  if (++iter & 1)\n    optind = 0;\n\n  char *fakeArgv[12];\n  fakeArgv[0] = \"fuzz_objcopy\";\n  fakeArgv[1] = \"-S\";\n  fakeArgv[2] = \"--decompress-debug-sections\";\n  fakeArgv[3] = \"--extract-dwo\";\n  fakeArgv[4] = \"--merge-notes\";\n  fakeArgv[5] = \"--pure\";\n  fakeArgv[6] = \"--debugging\";\n  fakeArgv[7] = \"--compress-debug-sections\";\n  fakeArgv[8] = \"--extract-symbol\";\n  fakeArgv[9] = filename;\n  fakeArgv[10] = \"/tmp/random.out\";\n  fakeArgv[11] = NULL;\n  copy_main(11, fakeArgv);\n\n  // Cleanup\n  free (strip_specific_buffer);\n  free (strip_unneeded_buffer);\n  free (keep_specific_buffer);\n  free (localize_specific_buffer);\n  free (globalize_specific_buffer);\n  free (keepglobal_specific_buffer);\n  free (weaken_specific_buffer);\n  delete_symbol_htabs ();\n\n  unlink(filename);\n  remove(\"/tmp/random.out\");\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/binutils/fuzz_objdump.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert objdump.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include \"fuzz_objdump.h\"\n\nvoid objdump_reset() {\n  process_links = true;\n  do_follow_links = true;\n  dump_section_contents = true;\n  dump_section_headers = true;\n  dump_private_headers = true;\n  dump_ar_hdrs = true;\n  dump_dwarf_section_info = true;\n  // We must call both dwarf_select_sections_by_letters and dwarf_select_sections_all\n  // since dwarf_select_sections_all does not set do_debug_lines |= FLAG_DEBUG_LINES_DECODED;\n  dwarf_select_sections_by_letters(\"L\");\n  dwarf_select_sections_all ();\n  dump_debugging = true;\n\n  dump_stab_section_info = true;\n  disassemble_all = true;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  program_name = filename;\n\n  objdump_reset();\n\n  // These flags contain a large set of calls to bfd_fatal (which calls\n  // exit), so to enable fuzzing of objdump with a fuzzer that lives for\n  // a longer period of time (more than 10 seconds) define\n  // OBJDUMP_SAFE\n#ifndef OBJDUMP_SAFE\n  dump_reloc_info = true;\n  // ctf section and reloc are simply too quick to exit and disrupts\n  // fuzzing too much. Will leave this commented out for now.\n  //dump_dynamic_reloc_info = true;\n  //dump_ctf_section_info = true;\n  disassemble = true;\n#endif\n\n  // Main fuzz entrypoint in objdump.c\n  display_file(filename, NULL);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_ranlib_simulation.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * The goal of this fuzzer is to simulate the logic for ranlib. We implement the\n * fuzzer without calling ar.c itself in order to avoid bfd_fatal calls.\n */\n#include \"sysdep.h\"\n#include \"bfd.h\"\n#include \"libiberty.h\"\n#include \"getopt.h\"\n#include \"aout/ar.h\"\n#include \"bucomm.h\"\n#include \"arsup.h\"\n#include \"filenames.h\"\n#include \"binemul.h\"\n#include \"plugin-api.h\"\n#include \"plugin.h\"\n#include \"ansidecl.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  int f;\n  bfd *arch;\n\n  f = open (filename, O_RDWR | O_BINARY, 0);\n  if (f < 0) {\n    return 0;\n  }\n\n  arch = bfd_fdopenr (filename, (const char *) NULL, f);\n  if (arch == NULL) {\n    close(f);\n    return 0;\n  }\n  if (! bfd_check_format (arch, bfd_archive)) {\n    bfd_close(arch);\n    return 0;\n  }\n\n  if (! bfd_has_map (arch)) {\n    bfd_close(arch);\n    return 0;\n  }\n\n  bfd_is_thin_archive (arch);\n\n  bfd_update_armap_timestamp(arch);\n  bfd_close(arch);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_readelf.c",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert readelf.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include \"readelf.h\"\n\n#include \"bfd.h\"\n#include \"libbfd.h\"\n\nint check_architecture(char *tmpfilename, char *arch_string) {\n  bfd_cleanup cleanup = NULL;\n  bfd *file = bfd_openr(tmpfilename, arch_string);\n  if (file == NULL) {\n    remove(tmpfilename);\n    return 0;\n  }\n\n  if (!bfd_read_p(file) ||\n      (unsigned int)file->format >= (unsigned int)bfd_type_end) {\n    bfd_close(file);\n    return 0;\n  }\n\n  bool doAnalysis = false;\n  if (bfd_seek(file, (file_ptr)0, SEEK_SET) == 0) {\n    file->format = bfd_object;\n    cleanup = BFD_SEND_FMT(file, _bfd_check_format, (file));\n    if (cleanup) {\n      doAnalysis = true;\n      cleanup(file);\n    }\n    file->format = bfd_unknown;\n  }\n\n  if (file != NULL) {\n    bfd_close(file);\n  }\n\n  // return 1 if the architecture matches.\n  if (doAnalysis) {\n    return 1;\n  }\n  return 0;\n}\n\n// int gb=0;\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp)\n    return 0;\n\n    /* Code to quickly extract target list.\n     * This is used to identify new targets but should\n     * not be in the fuzz code.\n    if (gb == 0) {\n      char **doublel = bfd_target_list();\n      while (*doublel != NULL) {\n        printf(\"Target: %s\\n\", *doublel);\n        doublel++;\n      }\n      gb=1;\n    }\n    exit(0);\n    */\n\n#ifdef READELF_TARGETED\n  if (check_architecture(filename, READELF_TARGETED) == 0) {\n    unlink(filename);\n    return 0;\n  }\n#endif\n\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n  do_syms = true;\n  do_reloc = true;\n  do_unwind = true;\n  do_dynamic = true;\n  do_header = true;\n  do_sections = true;\n  do_section_groups = true;\n  do_segments = true;\n  do_version = true;\n  do_histogram = true;\n  do_arch = true;\n  do_notes = true;\n\n  // Enable DWARF analysis\n  // We must call both dwarf_select_sections_by_letters and\n  // dwarf_select_sections_all since dwarf_select_sections_all does not set\n  // do_debug_lines |= FLAG_DEBUG_LINES_DECODED;\n  dwarf_select_sections_by_letters(\"L\");\n  dwarf_select_sections_all();\n\n  // Main fuzz entrypoint\n  process_file(filename);\n\n  unlink(filename);\n\n  free(dump_ctf_symtab_name);\n  dump_ctf_symtab_name = NULL;\n  free(dump_ctf_strtab_name);\n  dump_ctf_strtab_name = NULL;\n  free(dump_ctf_parent_name);\n  dump_ctf_parent_name = NULL;\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_strings.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert strings.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include \"fuzz_strings.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  program_name = \"fuzz_strings\";\n\n  string_min = 4;\n  encoding = 's';\n  encoding_bytes = 1;\n  datasection_only = true;\n\n  // Main fuzz entrypoint in strings.c\n  strings_object_file(filename);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/fuzz_windres.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * We convert windres.c into a header file to make convenient for fuzzing.\n * We do this for several of the binutils applications when creating\n * the binutils fuzzers.\n */\n#include \"fuzz_windres.h\"\n\n/*\n *\n * This fuzzer performs initial checks on the data\n * that are similar to what the windres application does, however\n * with the caveat that windres will fatally exit and the fuzzer simply returns, i.e.\n * fuzzing continues. The purpose is to enable further analysis.\n *\n * Down the line, perhaps it makes sense to chage binutils to have less fatals and\n * more graceful exits. This would be useful for the fuzzing.\n */\n\nstatic enum res_format\nfuzz_format_check_from_mem(const uint8_t *data, size_t size) {\n  int magic;\n  if (size < 2) {\n\treturn RES_FORMAT_UNKNOWN;\n  }\n  if (data[0] == 0x4d && data[1] == 0x5a) {\n\treturn RES_FORMAT_COFF;\n  }\n  magic = data[0] << 8 | data[1];\n  if (magic == 0x14c || magic == 0x166 || magic == 0x184 || magic == 0x268 || magic == 0x1f0 || magic == 0x290) {\n      return RES_FORMAT_COFF;\n  }\n\treturn RES_FORMAT_UNKNOWN;\n}\n\nint\nfuzz_check_coff_rsrc (const char *filename, const char *target)\n{\n  int retval = 0;\n  bfd *abfd;\n  windres_bfd wrbfd;\n  asection *sec;\n\n  abfd = bfd_openr (filename, target);\n  if (abfd == NULL) {\n    return 0;\n  }\n\n  if (! bfd_check_format (abfd, bfd_object)) {\n\t  retval = 0;\n\t  goto cleanup;\n    }\n\n  sec = bfd_get_section_by_name (abfd, \".rsrc\");\n  if (sec == NULL || sec->size == 0) {\n\t  retval = 0;\n\t  goto cleanup;\n    }\n\n  set_windres_bfd (&wrbfd, abfd, sec, WR_KIND_BFD);\n\n  bfd_size_type filesize = get_file_size (filename);\n  if ((ufile_ptr) sec->filepos > filesize\n      || sec->size > filesize - sec->filepos) {\n\t  retval = 0;\n\t  goto cleanup;\n  }\n\n  retval = 1;\ncleanup:\n  bfd_close (abfd);\n  return retval;\n}\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  if (size > 16384)\n    return 0;\n  enum res_format input_format;\n   input_format = fuzz_format_check_from_mem(data, size);;\n\tif (input_format != RES_FORMAT_COFF) {\n\t\treturn 0;\n\t}\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n\n  program_name = \"fuzz_windres\";\n\n  // For now we only check FORMAT_COFF, this can be extended to\n  // the two additional formats later.\n  if (input_format == RES_FORMAT_COFF) {\n\t  if (fuzz_check_coff_rsrc(filename, NULL) != 0) {\n\t\t  res_init ();\n\t\t  read_coff_rsrc (filename, NULL);\n\t\t  obstack_free (&res_obstack, NULL);\n\t  }\n  }\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/binutils/project.yaml",
    "content": "homepage: \"https://www.gnu.org/software/binutils/\"\nmain_repo: \"https://github.com/bminor/binutils-gdb\"\nlanguage: c++\nprimary_contact: \"bug-binutils@gnu.org\"\nauto_ccs :\n  - \"p.antoine@catenacyber.fr\"\n  - \"nickc@redhat.com\"\n  - \"amodra@gmail.com\"\n  - \"david@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - centipede\n"
  },
  {
    "path": "projects/bios-bmc-smm-error-logger/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && apt-get install --reinstall -y patchelf make ninja-build meson libgtest-dev libgmock-dev pkg-config libsystemd-dev python3-pip libboost-all-dev && pip3 install inflection pyyaml mako jsonschema --break-system-packages\n\nRUN git clone https://github.com/openbmc/bios-bmc-smm-error-logger\nCOPY *.sh *.diff $SRC/\nWORKDIR $SRC/bios-bmc-smm-error-logger\n\nRUN git clone https://github.com/google/googletest.git --branch v1.15.2 subprojects/googletest\nRUN git clone https://github.com/openbmc/libbej subprojects/libbej\nRUN git clone https://github.com/nlohmann/json.git subprojects/nlohmann_json\nRUN git clone https://github.com/openbmc/phosphor-dbus-interfaces.git subprojects/phosphor-dbus-interfaces\n\n"
  },
  {
    "path": "projects/bios-bmc-smm-error-logger/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit apply  --ignore-space-change --ignore-whitespace $SRC/fuzz-patch.diff\n\n# Remove system gtest/gmock to force using the subproject (built with libc++)\n# This fixes linker errors due to ABI mismatch (libstdc++ vs libc++)\napt-get remove -y libgtest-dev libgmock-dev googletest google-mock || true\nrm -rf /usr/src/googletest\nrm -rf /usr/src/gtest\nrm -rf /usr/src/gmock\n# Ensure cmake is installed for the subproject build\napt-get update && apt-get install -y cmake\n\n# Download subprojects explicitly so we can patch them\nmeson subprojects download\n\n# Force googletest to build statically by patching its CMakeLists.txt\n# This is more reliable than trying to patch test/meson.build to pass cmake options\nif [ -d \"subprojects/googletest\" ]; then\n    find subprojects/googletest -name CMakeLists.txt -exec sed -i '1i set(BUILD_SHARED_LIBS OFF CACHE BOOL \"Force static\" FORCE)' {} +\nfi\n\n# Fix bug in test/meson.build where 'cmake' variable is used but not defined\nsed -i \"s/gtest_proj = cmake.subproject(/gtest_proj = import('cmake').subproject(/g\" test/meson.build\n\n# Configure the build\n# -Dtests=enabled: to build the fuzzer defined in test/meson.build\n# -Ddefault_library=static: to build static libraries (good for fuzzing)\n# -Dfuzz_engine: pass the fuzzing engine flags to the fuzzer executable\nrm -rf build\nmeson setup build \\\n    -Dtests=enabled \\\n    -Ddefault_library=static \\\n    -Dgoogletest:default_library=static \\\n    -Dcpp_args=\"-stdlib=libc++ -Wno-error=character-conversion -Wno-error=deprecated-declarations $CXXFLAGS\" \\\n    -Dc_args=\"$CFLAGS\" \\\n    -Dcpp_link_args=\"${LDFLAGS:-$CXXFLAGS}\" \\\n    -Dfuzz_engine=\"$LIB_FUZZING_ENGINE\"\n\n# Patch stdexec to fix missing <new> header (provides std::launder)\nif [ -f subprojects/stdexec/include/stdexec/__detail/__utility.hpp ]; then\n    sed -i '1i#include <new>' subprojects/stdexec/include/stdexec/__detail/__utility.hpp\nfi\n\n# Patch stdplus to fix missing includes and ambiguous references\nif [ -f subprojects/stdplus/include/stdplus/function_view.hpp ]; then\n    sed -i '1i#include <cstddef>\\n#include <concepts>\\n#include <type_traits>\\n#include <memory>' subprojects/stdplus/include/stdplus/function_view.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/debug/lifetime.hpp ]; then\n    sed -i '1i#include <cstddef>' subprojects/stdplus/include/stdplus/debug/lifetime.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/hash.hpp ]; then\n    sed -i '1i#include <functional>' subprojects/stdplus/include/stdplus/hash.hpp\n    # Remove conflicting forward declaration of std::hash in namespace std\n    # Use ^namespace std$ to avoid matching namespace stdplus\n    sed -i '/^namespace std$/,/}/ { /template <class Key>/d; /struct hash;/d; }' subprojects/stdplus/include/stdplus/hash.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/net/addr/ip.hpp ]; then\n    sed -i '1i#include <format>' subprojects/stdplus/include/stdplus/net/addr/ip.hpp\n    # Remove conflicting forward declaration of std::formatter\n    sed -i '/template <typename T, typename CharT>/d' subprojects/stdplus/include/stdplus/net/addr/ip.hpp\n    sed -i '/struct formatter;/d' subprojects/stdplus/include/stdplus/net/addr/ip.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/net/addr/subnet.hpp ]; then\n    sed -i '1i#include <format>' subprojects/stdplus/include/stdplus/net/addr/subnet.hpp\n    # Remove conflicting forward declaration of std::formatter\n    sed -i '/template <typename T, typename CharT>/d' subprojects/stdplus/include/stdplus/net/addr/subnet.hpp\n    sed -i '/struct formatter;/d' subprojects/stdplus/include/stdplus/net/addr/subnet.hpp\nfi\n\nif [ -f subprojects/stdplus/include/stdplus/str/cat.hpp ]; then\n    sed -i '1i#include <algorithm>' subprojects/stdplus/include/stdplus/str/cat.hpp\nfi\n\nif [ -f subprojects/sdbusplus/include/sdbusplus/asio/connection.hpp ]; then\n    sed -i 's/std::move_only_function/std::function/g' subprojects/sdbusplus/include/sdbusplus/asio/connection.hpp\nfi\n\n# Build everything\nninja -C build -v\n\n# Copy the fuzzer to $OUT\ncp build/test/rde_fuzz $OUT/\n"
  },
  {
    "path": "projects/bios-bmc-smm-error-logger/fuzz-patch.diff",
    "content": "diff --git a/include/read_loop.hpp b/include/read_loop.hpp\nnew file mode 100644\nindex 0000000..30d1515\n--- /dev/null\n+++ b/include/read_loop.hpp\n@@ -0,0 +1,19 @@\n+#pragma once\n+\n+#include \"buffer.hpp\"\n+#include \"rde/rde_handler.hpp\"\n+\n+#include <boost/asio/steady_timer.hpp>\n+#include <boost/system/error_code.hpp>\n+\n+#include <memory>\n+\n+namespace bios_bmc_smm_error_logger\n+{\n+\n+void readLoop(boost::asio::steady_timer* t,\n+              const std::shared_ptr<BufferInterface>& bufferInterface,\n+              const std::shared_ptr<rde::RdeCommandHandler>& rdeCommandHandler,\n+              const boost::system::error_code& error);\n+\n+} // namespace bios_bmc_smm_error_logger\ndiff --git a/meson.build b/meson.build\nindex 9c08597..e18021c 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -35,4 +35,4 @@ if get_option('tests').allowed()\n endif\n \n # installation of systemd service files\n-subdir('service_files')\n+# subdir('service_files')\ndiff --git a/meson.options b/meson.options\nindex ce07181..85aaa1a 100644\n--- a/meson.options\n+++ b/meson.options\n@@ -67,3 +67,5 @@ option(\n     value: 4,\n     description: 'Magic Number array[3] for validity, consists of 4 * uint32_t',\n )\n+\n+option('fuzz_engine', type: 'string', value: '', description: 'Fuzzing engine flags')\ndiff --git a/src/main.cpp b/src/main.cpp\nindex 97f7bcb..c36dc7a 100644\n--- a/src/main.cpp\n+++ b/src/main.cpp\n@@ -2,6 +2,7 @@\n \n #include \"buffer.hpp\"\n #include \"pci_handler.hpp\"\n+#include \"read_loop.hpp\"\n #include \"rde/external_storer_file.hpp\"\n #include \"rde/external_storer_interface.hpp\"\n #include \"rde/rde_handler.hpp\"\n@@ -24,8 +25,8 @@\n namespace\n {\n constexpr std::chrono::milliseconds readIntervalinMs(READ_INTERVAL_MS);\n-constexpr std::size_t memoryRegionSize = MEMORY_REGION_SIZE;\n-constexpr std::size_t memoryRegionOffset = MEMORY_REGION_OFFSET;\n+[[maybe_unused]] constexpr std::size_t memoryRegionSize = MEMORY_REGION_SIZE;\n+[[maybe_unused]] constexpr std::size_t memoryRegionOffset = MEMORY_REGION_OFFSET;\n constexpr uint32_t bmcInterfaceVersion = BMC_INTERFACE_VERSION;\n constexpr uint16_t queueSize = QUEUE_REGION_SIZE;\n constexpr uint16_t ueRegionSize = UE_REGION_SIZE;\n@@ -36,6 +37,9 @@ static constexpr std::array<uint32_t, 4> magicNumber = {\n \n using namespace bios_bmc_smm_error_logger;\n \n+namespace bios_bmc_smm_error_logger\n+{\n+\n void readLoop(boost::asio::steady_timer* t,\n               const std::shared_ptr<BufferInterface>& bufferInterface,\n               const std::shared_ptr<rde::RdeCommandHandler>& rdeCommandHandler,\n@@ -168,6 +172,9 @@ void readLoop(boost::asio::steady_timer* t,\n         std::bind_front(readLoop, t, bufferInterface, rdeCommandHandler));\n }\n \n+} // namespace bios_bmc_smm_error_logger\n+\n+#ifndef BIOS_BMC_FUZZING\n int main()\n {\n     boost::asio::io_context io;\n@@ -207,3 +214,4 @@ int main()\n \n     return 0;\n }\n+#endif\ndiff --git a/src/meson.build b/src/meson.build\nindex 58a8040..56aaa5b 100644\n--- a/src/meson.build\n+++ b/src/meson.build\n@@ -1,6 +1,6 @@\n bios_bmc_smm_error_logger_pre = declare_dependency(\n     include_directories: [root_inc, bios_bmc_smm_error_logger_inc],\n-    dependencies: [dependency('threads'), dependency('stdplus')],\n+    dependencies: [dependency('threads'), dependency('stdplus'), dependency('boost')],\n )\n \n bios_bmc_smm_error_logger_lib = static_library(\n@@ -8,7 +8,7 @@ bios_bmc_smm_error_logger_lib = static_library(\n     'pci_handler.cpp',\n     'buffer.cpp',\n     implicit_include_directories: false,\n-    dependencies: bios_bmc_smm_error_logger_pre,\n+    dependencies: [bios_bmc_smm_error_logger_pre, rde_dep],\n )\n \n bios_bmc_smm_error_logger_dep = declare_dependency(\ndiff --git a/test/meson.build b/test/meson.build\nindex 18f7732..ae63cce 100644\n--- a/test/meson.build\n+++ b/test/meson.build\n@@ -42,6 +42,16 @@ foreach t : gtests\n             build_by_default: false,\n             implicit_include_directories: false,\n             dependencies: test_dep,\n+            cpp_args: ['-Wno-error=character-conversion', '-Wno-error=sign-compare'],\n         ),\n     )\n endforeach\n+\n+executable(\n+    'rde_fuzz',\n+    ['rde_fuzz.cpp', '../src/main.cpp'],\n+    dependencies: [rde_dep, bios_bmc_smm_error_logger_dep],\n+    install: true,\n+    link_args: get_option('fuzz_engine').split(),\n+    cpp_args: ['-DBIOS_BMC_FUZZING'],\n+)\ndiff --git a/test/rde_fuzz.cpp b/test/rde_fuzz.cpp\nnew file mode 100644\nindex 0000000..c3c736d\n--- /dev/null\n+++ b/test/rde_fuzz.cpp\n@@ -0,0 +1,150 @@\n+#include \"config.h\"\n+\n+#include \"buffer.hpp\"\n+#include \"pci_handler.hpp\"\n+#include \"read_loop.hpp\"\n+#include \"rde/external_storer_file.hpp\"\n+#include \"rde/external_storer_interface.hpp\"\n+#include \"rde/rde_handler.hpp\"\n+\n+#include <boost/asio.hpp>\n+#include <boost/endian/conversion.hpp>\n+#include <sdbusplus/asio/object_server.hpp>\n+#include <stdplus/fd/create.hpp>\n+#include <stdplus/fd/impl.hpp>\n+#include <stdplus/fd/managed.hpp>\n+\n+#include <filesystem>\n+#include <format>\n+#include <fstream>\n+#include <functional>\n+#include <memory>\n+#include <stdexcept>\n+#include <cstring>\n+#include <vector>\n+#include <unistd.h>\n+#include <stdlib.h>\n+\n+namespace\n+{\n+constexpr std::chrono::milliseconds readIntervalinMs(READ_INTERVAL_MS);\n+constexpr std::size_t memoryRegionSize = MEMORY_REGION_SIZE;\n+constexpr std::size_t memoryRegionOffset = MEMORY_REGION_OFFSET;\n+constexpr uint32_t bmcInterfaceVersion = BMC_INTERFACE_VERSION;\n+constexpr uint16_t queueSize = QUEUE_REGION_SIZE;\n+constexpr uint16_t ueRegionSize = UE_REGION_SIZE;\n+static constexpr std::array<uint32_t, 4> magicNumber = {\n+    MAGIC_NUMBER_BYTE1, MAGIC_NUMBER_BYTE2, MAGIC_NUMBER_BYTE3,\n+    MAGIC_NUMBER_BYTE4};\n+} // namespace\n+\n+using namespace bios_bmc_smm_error_logger;\n+\n+// Mock PciDataHandler to use a file instead of /dev/mem\n+class MockPciDataHandler : public PciDataHandler\n+{\n+  public:\n+    MockPciDataHandler(uint32_t /*regionAddress*/, size_t regionSize,\n+                       stdplus::ManagedFd fd) :\n+        PciDataHandler(0, regionSize,\n+                       std::make_unique<stdplus::ManagedFd>(std::move(fd)))\n+    {}\n+};\n+\n+// Mock ExternalStorerInterface to avoid DBus calls\n+class MockExternalStorerInterface : public rde::ExternalStorerInterface\n+{\n+  public:\n+    MockExternalStorerInterface() = default;\n+\n+    bool publishJson(std::string_view /*json*/) override\n+    {\n+        return true;\n+    }\n+};\n+\n+extern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n+{\n+    // Create a temporary file to simulate memory region\n+    std::string tempFileName = \"/tmp/fuzz_mem_XXXXXX\";\n+    int fd = mkstemp(tempFileName.data());\n+    if (fd == -1)\n+    {\n+        return 0;\n+    }\n+\n+    // Write fuzz data to the temporary file\n+    // Ensure the file is at least as large as the memory region\n+    std::vector<uint8_t> buffer(memoryRegionSize, 0);\n+    if (size > memoryRegionSize)\n+    {\n+        size = memoryRegionSize;\n+    }\n+    std::memcpy(buffer.data(), data, size);\n+\n+    // Patch the header to ensure it passes validation\n+    if (buffer.size() >= sizeof(CircularBufferHeader))\n+    {\n+        auto* header = reinterpret_cast<CircularBufferHeader*>(buffer.data());\n+\n+        // Fix magic number\n+        for (size_t i = 0; i < 4; ++i)\n+        {\n+            header->magicNumber[i] =\n+                boost::endian::native_to_little(magicNumber[i]);\n+        }\n+\n+        // Fix sizes\n+        header->queueSize = boost::endian::native_to_little(queueSize);\n+        header->ueRegionSize = boost::endian::native_to_little(ueRegionSize);\n+        header->bmcInterfaceVersion =\n+            boost::endian::native_to_little(bmcInterfaceVersion);\n+\n+        // Fix pointers to be within bounds\n+        // maxOffset calculation from BufferImpl::getMaxOffset()\n+        size_t maxOffset =\n+            queueSize - ueRegionSize - sizeof(struct CircularBufferHeader);\n+\n+        uint32_t writePtr =\n+            boost::endian::little_to_native(header->biosWritePtr);\n+        header->biosWritePtr =\n+            boost::endian::native_to_little(writePtr % (maxOffset + 1));\n+\n+        uint32_t readPtr = boost::endian::little_to_native(header->bmcReadPtr);\n+        header->bmcReadPtr =\n+            boost::endian::native_to_little(readPtr % (maxOffset + 1));\n+    }\n+\n+    write(fd, buffer.data(), memoryRegionSize);\n+    lseek(fd, 0, SEEK_SET);\n+\n+    // Setup Boost ASIO\n+    boost::asio::io_context io;\n+    boost::asio::steady_timer t(io, readIntervalinMs);\n+\n+    // Setup Buffer Interface with Mock PciDataHandler\n+    stdplus::ManagedFd managedFd(std::move(fd));\n+    std::unique_ptr<DataInterface> pciDataHandler =\n+        std::make_unique<MockPciDataHandler>(memoryRegionOffset,\n+                                             memoryRegionSize,\n+                                             std::move(managedFd));\n+    std::shared_ptr<BufferInterface> bufferHandler =\n+        std::make_shared<BufferImpl>(std::move(pciDataHandler));\n+\n+    // Setup RDE Command Handler with Mock ExternalStorerInterface\n+    std::unique_ptr<rde::ExternalStorerInterface> exFileIface =\n+        std::make_unique<MockExternalStorerInterface>();\n+    std::shared_ptr<rde::RdeCommandHandler> rdeCommandHandler =\n+        std::make_unique<rde::RdeCommandHandler>(std::move(exFileIface));\n+\n+    // Do NOT call initialize(), as it wipes the buffer.\n+    // Instead, we rely on the patched header we wrote to the file.\n+\n+    // Run readLoop once\n+    readLoop(&t, bufferHandler, rdeCommandHandler, boost::system::error_code());\n+\n+    // Cleanup\n+    std::filesystem::remove(tempFileName);\n+\n+    return 0;\n+}\ndiff --git a/test/rde_handler_test.cpp b/test/rde_handler_test.cpp\nindex c13feaa..fa26e60 100644\n--- a/test/rde_handler_test.cpp\n+++ b/test/rde_handler_test.cpp\n@@ -773,7 +773,7 @@ TEST_F(RdeHandlerTest, DictionaryStartAndEndTest)\n     EXPECT_THAT(rdeH->getDictionaryCount(), 2);\n \n     // Send the encoded payload.\n-    EXPECT_CALL(*mockExStorerPtr, publishJson(exJson)).WillOnce(Return(true));\n+    EXPECT_CALL(*mockExStorerPtr, publishJson(std::string_view(exJson))).WillOnce(Return(true));\n     EXPECT_THAT(rdeH->decodeRdeCommand(std::span(mInitOp),\n                                        RdeCommandType::RdeOperationInitRequest),\n                 RdeDecodeStatus::RdeOk);\n@@ -802,7 +802,7 @@ TEST_F(RdeHandlerTest, DictionaryStartThenEndTest)\n     EXPECT_THAT(rdeH->getDictionaryCount(), 2);\n \n     // Send the encoded payload.\n-    EXPECT_CALL(*mockExStorerPtr, publishJson(exJson)).WillOnce(Return(true));\n+    EXPECT_CALL(*mockExStorerPtr, publishJson(std::string_view(exJson))).WillOnce(Return(true));\n     EXPECT_THAT(rdeH->decodeRdeCommand(std::span(mInitOp),\n                                        RdeCommandType::RdeOperationInitRequest),\n                 RdeDecodeStatus::RdeOk);\n@@ -847,7 +847,7 @@ TEST_F(RdeHandlerTest, DictionaryStartMidEndTest)\n     EXPECT_THAT(rdeH->getDictionaryCount(), 2);\n \n     // Send the encoded payload.\n-    EXPECT_CALL(*mockExStorerPtr, publishJson(exJson)).WillOnce(Return(true));\n+    EXPECT_CALL(*mockExStorerPtr, publishJson(std::string_view(exJson))).WillOnce(Return(true));\n     EXPECT_THAT(rdeH->decodeRdeCommand(std::span(mInitOp),\n                                        RdeCommandType::RdeOperationInitRequest),\n                 RdeDecodeStatus::RdeOk);\n"
  },
  {
    "path": "projects/bios-bmc-smm-error-logger/project.yaml",
    "content": "homepage: \"https://github.com/openbmc/docs/blob/master/designs/bios-bmc-smm-error-logging.md\"\nlanguage: c++\nprimary_contact: \"javanlacerda@google.com\"\nauto_ccs:\n  - pedroysb@google.com\n  - cloud-ti-fuzzing+bugs@google.com\n\nmain_repo: \"https://github.com/javanlacerda/bios-bmc-smm-error-logger\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/bitcoin-core/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Packages taken from:\n# * https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#dependency-build-instructions\n# * https://github.com/bitcoin/bitcoin/blob/master/depends/README.md#for-linux-including-i386-arm-cross-compilation\nRUN apt-get update && apt-get install -y \\\n  build-essential curl g++-multilib make \\\n  patch pkgconf python3 wget zip\n\nRUN git clone --depth=1 https://github.com/bitcoin/bitcoin.git bitcoin-core\nRUN git clone --depth=1 https://github.com/bitcoin-core/qa-assets bitcoin-core/assets && \\\n  rm -rf bitcoin-core/assets/.git  # Remove git history to save storage\nRUN git clone --depth 1 https://github.com/bitcoin-core/secp256k1.git\nWORKDIR bitcoin-core\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bitcoin-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Print date to embed it into build logs\ndate\n\ncd $SRC/bitcoin-core/\n\n# Build dependencies\n# This will also force static builds\nif [ \"$ARCHITECTURE\" = \"i386\" ]; then\n  export BUILD_TRIPLET=\"i386-linux-gnu\"\nelse\n  export BUILD_TRIPLET=\"x86_64-pc-linux-gnu\"\nfi\n\n\nexport CFLAGS=\"$CFLAGS -flto=full\"\nexport CXXFLAGS=\"$CXXFLAGS -flto=full\"\n# Use lld to workaround <module> referenced in <section> of /tmp/lto-llvm-*.o: defined in discarded section\nexport LDFLAGS=\"-fuse-ld=lld -flto=full\"\n\nexport CPPFLAGS=\"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG -DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE\"\n\n(\n  cd depends\n  sed -i --regexp-extended '/.*rm -rf .*extract_dir.*/d' ./funcs.mk  # Keep extracted source\n  # Disable IPC until a fuzz test actually needs it\n  # At that point, as workaround can be added to remove capnps\n  # internal oss-fuzz detection: https://github.com/google/oss-fuzz/pull/14203#issuecomment-3461008642\n  make HOST=$BUILD_TRIPLET DEBUG=1 NO_QT=1 NO_ZMQ=1 NO_USDT=1 \\\n       NO_IPC=1 \\\n       AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib STRIP=llvm-strip \\\n       -j$(nproc)\n)\n\n# Build the fuzz targets\n\nsed -i \"s|PROVIDE_FUZZ_MAIN_FUNCTION|NEVER_PROVIDE_MAIN_FOR_OSS_FUZZ|g\" \"./src/test/fuzz/util/CMakeLists.txt\"\n\n# OSS-Fuzz will provide CC, CXX, etc. So only set:\n# * -DBUILD_FOR_FUZZING=ON, see https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md\n# * --toolchain, see https://github.com/bitcoin/bitcoin/blob/master/depends/README.md\nEXTRA_BUILD_OPTIONS=\nif [ \"$SANITIZER\" = \"memory\" ]; then\n  # _FORTIFY_SOURCE is not compatible with MSAN.\n  EXTRA_BUILD_OPTIONS=\"-DAPPEND_CPPFLAGS='-U_FORTIFY_SOURCE'\"\nfi\n\ncmake -B build_fuzz \\\n  --toolchain depends/${BUILD_TRIPLET}/toolchain.cmake \\\n  `# Setting these flags to an empty string ensures that the flags set by an OSS-Fuzz environment remain unaltered` \\\n  -DCMAKE_C_FLAGS_RELWITHDEBINFO=\"\" \\\n  -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=\"\" \\\n  -DBUILD_FOR_FUZZING=ON \\\n  -DFUZZ_LIBS=\"$LIB_FUZZING_ENGINE\" \\\n  $EXTRA_BUILD_OPTIONS\n\ncmake --build build_fuzz -j$(nproc)\n\nWRITE_ALL_FUZZ_TARGETS_AND_ABORT=\"/tmp/a\" \"./build_fuzz/bin/fuzz\" || true\nreadarray FUZZ_TARGETS < \"/tmp/a\"\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n  # When running in CI, check the first targets only to save time and disk space\n  FUZZ_TARGETS=( ${FUZZ_TARGETS[@]:0:2} )\nfi\n\n# OSS-Fuzz requires a separate and self-contained binary for each fuzz target.\n# To inject the fuzz target name in the finished binary, compile the fuzz\n# executable with a \"magic string\" as the name of the fuzz target.\n#\n# An alternative to mocking the string in the finished binary would be to\n# replace the string in the source code and re-invoke 'cmake --build'. This is slower,\n# so use the hack.\nexport MAGIC_STR=\"b5813eee2abc9d3358151f298b75a72264ffa119d2f71ae7fefa15c4b70b4bc5b38e87e3107a730f25891ea428b2b4fabe7a84f5bfa73c79e0479e085e4ff157\"\nsed -i \"s|std::getenv(\\\"FUZZ\\\")|\\\"$MAGIC_STR\\\"|g\" \"./src/test/fuzz/fuzz.cpp\"\ncmake --build build_fuzz -j$(nproc)\n\n# Replace the magic string with the actual name of each fuzz target\nfor fuzz_target in ${FUZZ_TARGETS[@]}; do\n  df --human-readable ./src\n  python3 -c \"c_str_target=b\\\"${fuzz_target}\\x00\\\";c_str_magic=b\\\"$MAGIC_STR\\\";dat=open('./build_fuzz/bin/fuzz','rb').read();dat=dat.replace(c_str_magic, c_str_target+c_str_magic[len(c_str_target):]);open(\\\"$OUT/$fuzz_target\\\",'wb').write(dat)\"\n\n  chmod +x \"$OUT/$fuzz_target\"\n  (\n    cd assets/fuzz_corpora\n    if [ -d \"$fuzz_target\" ]; then\n      zip --recurse-paths --quiet --junk-paths \"$OUT/${fuzz_target}_seed_corpus.zip\" \"${fuzz_target}\"\n    fi\n  )\ndone\n\ncp assets/fuzz_dicts/*.dict $OUT/\n"
  },
  {
    "path": "projects/bitcoin-core/descriptor_parse.options",
    "content": "[libfuzzer]\ndict = descriptors.dict\n"
  },
  {
    "path": "projects/bitcoin-core/i2p.options",
    "content": "[libfuzzer]\ndict = i2p.dict\n"
  },
  {
    "path": "projects/bitcoin-core/miniscript_string.options",
    "content": "[libfuzzer]\ndict = descriptors.dict\n"
  },
  {
    "path": "projects/bitcoin-core/process_messages.options",
    "content": "[libfuzzer]\ndict = net_processing.dict\n"
  },
  {
    "path": "projects/bitcoin-core/project.yaml",
    "content": "homepage: \"https://bitcoincore.org/\"\nmain_repo: 'https://github.com/bitcoin/bitcoin.git'\nlanguage: c++\nprimary_contact: \"macro.fuzzing.uxuga@aleeas.com\"\nauto_ccs:\n  - \"fanquake@gmail.com\"\n  - \"jonas@chaincode.com\"\n  - \"pieter@chaincode.com\"\n  - \"n.goeggi@gmail.com\"\n  - \"achow101@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n#  - i386 disabled for now: https://github.com/google/clusterfuzz/pull/4773\nselective_unpack: true  # Required to avoid out-of-space when executing AFL on clusterfuzz bots\nfuzzing_engines:\n  - afl\n#  - centipede # temporarily disabled due to spurious \"Step #22 - \"build-check-centipede-none-x86_64\": OSError: [Errno 28] No space left on device\"\n  - libfuzzer\n  - honggfuzz\n"
  },
  {
    "path": "projects/black/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/psf/black black\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/black\n"
  },
  {
    "path": "projects/black/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data 'src/blib2to3:blib2to3'\ndone\n"
  },
  {
    "path": "projects/black/fuzz_format_filecontents.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport black\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    black.format_file_contents(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 2048)),\n                               mode=black.Mode(),\n                               fast=fdp.ConsumeBool())\n  except black.InvalidInput:\n    pass\n  except black.NothingChanged:\n    pass\n  except AssertionError:\n    pass\n  except KeyError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/black/fuzz_lib2to3_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport black\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    black.lib2to3_parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except black.InvalidInput:\n    pass\n  except AssertionError:\n    pass\n  except KeyError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/black/fuzz_raw_format_filecontents.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport black\n\n\ndef TestOneInput(data):\n  if len(data) < 50:\n    return\n\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    black.format_file_contents(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize),\n                               mode=black.Mode(),\n                               fast=False)\n  except black.InvalidInput:\n    pass\n  except black.NothingChanged:\n    pass\n  except AssertionError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/black/project.yaml",
    "content": "homepage: https://github.com/psf/black\nmain_repo: https://github.com/psf/black\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/blackfriday/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 --branch v2 https://github.com/russross/blackfriday\nRUN wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.23.4.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.23.4.linux-amd64.tar.gz\nCOPY build.sh render_fuzzer.go $SRC/\nWORKDIR $SRC/blackfriday\n"
  },
  {
    "path": "projects/blackfriday/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/render_fuzzer.go .\n\nrm go.mod\ngo mod init github.com/russross/blackfriday\n\ncompile_go_fuzzer github.com/russross/blackfriday Fuzz render_fuzzer\n"
  },
  {
    "path": "projects/blackfriday/project.yaml",
    "content": "homepage: \"https://github.com/russross/blackfriday\"\nmain_repo: \"https://github.com/russross/blackfriday\"\nprimary_contact: \"security-tps@google.com\"\nauto_ccs :\n  - \"Adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/blackfriday/render_fuzzer.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage blackfriday\n\nfunc Fuzz(data []byte) int {\n\tRun(data)\n\treturn 0\n}\n"
  },
  {
    "path": "projects/bleach/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone \\\n\t--depth 1 \\\n\t--branch main \\\n\thttps://github.com/mozilla/bleach.git\n\nWORKDIR bleach\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\n\nCOPY build.sh sanitize_fuzzer.py linkify_fuzzer.py $SRC/\n"
  },
  {
    "path": "projects/bleach/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\n# Copy fuzzer dictionaries to $OUT\ncp fuzzing/dictionaries/html.dict \"$OUT/linkify_fuzzer.dict\"\ncp fuzzing/dictionaries/html.dict \"$OUT/sanitize_fuzzer.dict\"\n"
  },
  {
    "path": "projects/bleach/linkify_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n  import bleach\n\n\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  data = fdp.ConsumeUnicode(atheris.ALL_REMAINING)\n\n  bleach.linkify(data)\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/bleach/project.yaml",
    "content": "homepage: \"https://github.com/mozilla/bleach\"\nmain_repo: \"https://github.com/mozilla/bleach\"\nlanguage: python\nprimary_contact: \"wkahngreene@mozilla.com\"\nauto_ccs:\n  - \"ipudney@google.com\"\n  - \"gguthe@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/bleach/sanitize_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n  import bleach\n\n\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  data = fdp.ConsumeUnicode(atheris.ALL_REMAINING)\n\n  bleach.clean(data)\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/bloaty/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake ninja-build g++ libz-dev\nRUN git clone --depth 1 https://github.com/google/bloaty.git bloaty\nWORKDIR bloaty\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bloaty/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $WORK\ncmake -G Ninja -DBUILD_TESTING=false $SRC/bloaty\nninja -j$(nproc)\ncp fuzz_target $OUT\nzip -j $OUT/fuzz_target_seed_corpus.zip $SRC/bloaty/tests/testdata/fuzz_corpus/*\n"
  },
  {
    "path": "projects/bloaty/project.yaml",
    "content": "homepage: \"https://github.com/google/bloaty\"\nlanguage: c++\nprimary_contact: \"jhaberman@gmail.com\"\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/google/bloaty.git'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/bls-signatures/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget python lzip libgmp-dev\nRUN git clone --depth 1 https://github.com/MozillaSecurity/cryptofuzz\nRUN git clone --depth 1 https://github.com/supranational/blst\nRUN git clone --depth 1 https://github.com/herumi/mcl.git\nRUN git clone --depth 1 https://github.com/randombit/botan.git\nRUN git clone --depth 1 https://github.com/mratsim/constantine\nRUN wget -q https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\nRUN wget -q https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz\nRUN wget -q https://nim-lang.org/download/nim-2.0.8-linux_x64.tar.xz\nRUN wget -q https://nim-lang.org/download/nim-2.0.8-linux_x32.tar.xz\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bls-signatures/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -D_LIBCPP_DEBUG=1\"\nif [[ \"$SANITIZER\" = \"memory\" ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\nexport LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\"\nexport LINK_FLAGS=\"\"\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_84_0.tar.bz2\ncd boost_1_84_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\ncp -R boost/ /usr/include/\n\n# Configure Cryptofuzz\ncd $SRC/cryptofuzz/\npython gen_repository.py\nrm extra_options.h\necho -n '\"' >>extra_options.h\necho -n \"--force-module=blst \" >>extra_options.h\necho -n \"--operations=\" >>extra_options.h\necho -n \"BignumCalc,\" >>extra_options.h\necho -n \"BignumCalc_Fp2,\" >>extra_options.h\necho -n \"BignumCalc_Fp12,\" >>extra_options.h\necho -n \"BLS_BatchVerify,\" >>extra_options.h\necho -n \"BLS_FinalExp,\" >>extra_options.h\necho -n \"BLS_GenerateKeyPair,\" >>extra_options.h\necho -n \"BLS_HashToG1,\" >>extra_options.h\necho -n \"BLS_HashToG2,\" >>extra_options.h\necho -n \"BLS_IsG1OnCurve,\" >>extra_options.h\necho -n \"BLS_IsG2OnCurve,\" >>extra_options.h\necho -n \"BLS_Pairing,\" >>extra_options.h\necho -n \"BLS_PrivateToPublic,\" >>extra_options.h\necho -n \"BLS_PrivateToPublic_G2,\" >>extra_options.h\necho -n \"BLS_Sign,\" >>extra_options.h\necho -n \"BLS_Verify,\" >>extra_options.h\necho -n \"BLS_Compress_G1,\" >>extra_options.h\necho -n \"BLS_Compress_G2,\" >>extra_options.h\necho -n \"BLS_Decompress_G1,\" >>extra_options.h\necho -n \"BLS_Decompress_G2,\" >>extra_options.h\necho -n \"BLS_G1_Add,\" >>extra_options.h\necho -n \"BLS_G1_Mul,\" >>extra_options.h\necho -n \"BLS_G1_IsEq,\" >>extra_options.h\necho -n \"BLS_G1_Neg,\" >>extra_options.h\necho -n \"BLS_G2_Add,\" >>extra_options.h\necho -n \"BLS_G2_Mul,\" >>extra_options.h\necho -n \"BLS_G2_IsEq,\" >>extra_options.h\necho -n \"BLS_G2_Neg,\" >>extra_options.h\necho -n \"BLS_Aggregate_G1\", >>extra_options.h\necho -n \"BLS_Aggregate_G2\", >>extra_options.h\necho -n \"BLS_MapToG1\", >>extra_options.h\necho -n \"BLS_MapToG2\", >>extra_options.h\necho -n \"BignumCalc_Mod_BLS12_381_P,\" >>extra_options.h\necho -n \"BignumCalc_Mod_BLS12_381_R,\" >>extra_options.h\necho -n \"KDF_HKDF,\" >>extra_options.h\necho -n \"Misc \" >>extra_options.h\necho -n \"--digests=SHA256 \" >>extra_options.h\necho -n \"--curves=BLS12_381 \" >>extra_options.h\necho -n '\"' >>extra_options.h\n\n# Build arkworks-algebra\nif [[ \"$SANITIZER\" != \"memory\" ]]\nthen\n    cd $SRC/cryptofuzz/modules/arkworks-algebra/\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        make\n    else\n        rustup target add i686-unknown-linux-gnu\n        make -f Makefile-i386\n    fi\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_ARKWORKS_ALGEBRA\"\nfi\n\n# Build Constantine\nif [[ \"$SANITIZER\" != \"memory\" ]]\nthen\n    cd $SRC/\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        tar Jxf nim-2.0.8-linux_x64.tar.xz\n    else\n        tar Jxf nim-2.0.8-linux_x32.tar.xz\n    fi\n    export NIM_PATH=$(realpath nim-2.0.8)\n\n    export CONSTANTINE_PATH=$SRC/constantine/\n\n    cd $SRC/cryptofuzz/modules/constantine/\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        make\n    else\n        make -f Makefile-i386\n    fi\n\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_CONSTANTINE\"\nfi\n\nif [[ $CFLAGS = *-m32* ]]\nthen\n    # Build and install libgmp\n    cd $SRC/\n    mkdir $SRC/libgmp-install\n    tar xf gmp-6.2.1.tar.lz\n    cd $SRC/gmp-6.2.1/\n    autoreconf -ivf\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        ./configure --prefix=\"$SRC/libgmp-install/\" --enable-cxx\n    else\n        setarch i386 ./configure --prefix=\"$SRC/libgmp-install/\" --enable-cxx\n    fi\n    make -j$(nproc)\n    make install\n    export CXXFLAGS=\"$CXXFLAGS -I $SRC/libgmp-install/include/\"\nfi\n\nfunction build_blst() {\n    if [[ \"$SANITIZER\" == \"memory\" ]]\n    then\n        CFLAGS=\"$CFLAGS -D__BLST_NO_ASM__ -D__BLST_PORTABLE__ -Dllimb_t=__uint128_t -D__builtin_assume(x)=(void)(x)\" ./build.sh\n    else\n        ./build.sh\n    fi\n\n    export BLST_LIBBLST_A_PATH=$(realpath libblst.a)\n    export BLST_INCLUDE_PATH=$(realpath bindings/)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BLST\"\n}\n\n# Build blst (normal)\ncp -R $SRC/blst/ $SRC/blst_normal/\ncd $SRC/blst_normal/\nbuild_blst\n\n# Build mcl\nif [[ \"$SANITIZER\" != \"memory\" && $CFLAGS != *-m32* ]]\nthen\n    cd $SRC/mcl/\n    mkdir build/\n    cd build/\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        cmake .. -DMCL_STATIC_LIB=on\n        export LINK_FLAGS=\"$LINK_FLAGS -lgmp\"\n    else\n        cmake .. -DMCL_STATIC_LIB=on \\\n        -DGMP_INCLUDE_DIR=\"$SRC/libgmp-install/include/\" \\\n        -DGMP_LIBRARY=\"$SRC/libgmp-install/lib/libgmp.a\" \\\n        -DGMP_GMPXX_INCLUDE_DIR=\"$SRC/libgmp-install/include/\" \\\n        -DGMP_GMPXX_LIBRARY=\"$SRC/libgmp-install/lib/libgmpxx.a\" \\\n        -DMCL_USE_ASM=off\n        export LINK_FLAGS=\"$LINK_FLAGS $SRC/libgmp-install/lib/libgmp.a\"\n    fi\n    make\n    export MCL_INCLUDE_PATH=$(realpath ../include/)\n    export MCL_LIBMCL_A_PATH=$(realpath lib/libmcl.a)\n    export MCL_LIBMCLBN384_A_PATH=$(realpath lib/libmclbn384.a)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_MCL\"\nfi\n\n# Build Botan\ncd $SRC/botan/\nif [[ $CFLAGS != *-m32* ]]\nthen\n    ./configure.py --cc-bin=$CXX \\\n    --cc-abi-flags=\"$CXXFLAGS\" \\\n    --disable-shared \\\n    --disable-modules=locking_allocator,x509 \\\n    --build-targets=static \\\n    --without-documentation\nelse\n    ./configure.py --cpu=x86_32 \\\n    --cc-bin=$CXX \\\n    --cc-abi-flags=\"$CXXFLAGS\" \\\n    --disable-shared \\\n    --disable-modules=locking_allocator,x509 \\\n    --build-targets=static \\\n    --without-documentation\nfi\nmake -j$(nproc)\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BOTAN -DCRYPTOFUZZ_BOTAN_IS_ORACLE\"\nexport LIBBOTAN_A_PATH=\"$SRC/botan/libbotan-3.a\"\nexport BOTAN_INCLUDE_PATH=\"$SRC/botan/build/include\"\n\n# Build modules\ncd $SRC/cryptofuzz/modules/botan/\nmake -B\n\ncd $SRC/cryptofuzz/modules/blst/\nmake -B\n\nif [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\nthen\n    cd $SRC/cryptofuzz/modules/mcl/\n    make -B\nfi\n\n# Build Cryptofuzz\ncd $SRC/cryptofuzz/\nmake -B -j\n\ncp cryptofuzz $OUT/cryptofuzz-bls-signatures\n\n# Build blst (optimized for size)\ncp -R $SRC/blst/ $SRC/blst_optimize_size/\ncd $SRC/blst_optimize_size/\nexport CFLAGS=\"$CFLAGS -D__OPTIMIZE_SIZE__\"\nbuild_blst\n\ncd $SRC/cryptofuzz/modules/blst/\nmake -B\n\n# Build Cryptofuzz\ncd $SRC/cryptofuzz/\nrm entry.o; make\n\ncp cryptofuzz $OUT/cryptofuzz-bls-signatures_optimize_size\n"
  },
  {
    "path": "projects/bls-signatures/project.yaml",
    "content": "homepage: \"https://github.com/supranational/blst\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://github.com/supranational/blst.git\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n - x86_64\n - i386\nauto_ccs:\n - \"kelly@supranational.net\"\n - \"diederik.loerakker@ethereum.org\"\n - \"hoffmang@chia.net\"\n - \"bram@chia.net\"\n - \"mariano@chia.net\"\n - \"arvid@chia.net\"\n - \"bill@chia.net\"\n - \"pratyush795@gmail.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/bluez/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Install necessary packages\nRUN apt-get update && apt-get install -y \\\n    make autoconf automake libtool pkg-config \\\n    libdbus-1-dev libreadline8 libreadline-dev \\\n    python-docutils libudev-dev udev libical-dev \\\n    libdbus-1-dev systemd libbluetooth-dev\n\nRUN python3 -m pip install --upgrade pip && python3 -m pip install packaging\nRUN python3 -m pip install -U meson ninja\n\n# Clone necessary repositories\nRUN git clone git://git.kernel.org/pub/scm/libs/ell/ell.git\nRUN git clone --depth 1 https://github.com/bluez/bluez bluez\nRUN git clone https://github.com/GNOME/glib && \\\n    cd glib && \\\n    meson _build -Db_lundef=false -Ddefault_library=static -Dlibmount=disabled && \\\n    ninja -C _build && \\\n    ninja -C _build install\n\nWORKDIR bluez\nCOPY *.sh $SRC/\nCOPY *.c $SRC/\n"
  },
  {
    "path": "projects/bluez/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./bootstrap\nautoreconf -f\n./configure --disable-systemd\nmake -j$(nproc)\n\nINCLUDES=\"-I. -I./src -I./lib -I./gobex -I/usr/local/include/glib-2.0/ -I/src/glib/_build/glib/ -I/usr/include/bluetooth\"\nSTATIC_LIBS=\"./src/.libs/libshared-glib.a ./lib/.libs/libbluetooth-internal.a  -l:libical.a -l:libicalss.a -l:libicalvcal.a -l:libdbus-1.a /src/glib/_build/glib/libglib-2.0.a\"\n\n$CC $CFLAGS $INCLUDES $SRC/fuzz_xml.c -c\n$CC $CFLAGS $INCLUDES $SRC/fuzz_sdp.c -c\n$CC $CFLAGS $INCLUDES $SRC/fuzz_textfile.c -c\n$CC $CFLAGS $INCLUDES $SRC/fuzz_gobex.c -c\n$CC $CFLAGS $INCLUDES $SRC/fuzz_hci.c -c\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n ./src/bluetoothd-sdp-xml.o fuzz_xml.o -o $OUT/fuzz_xml \\\n $STATIC_LIBS -ldl -lpthread\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n fuzz_sdp.o -o $OUT/fuzz_sdp $STATIC_LIBS -ldl -lpthread\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_textfile.o -o $OUT/fuzz_textfile \\\n  $STATIC_LIBS -ldl -lpthread src/textfile.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n  fuzz_gobex.o ./gobex/gobex*.o -o $OUT/fuzz_gobex \\\n $STATIC_LIBS -ldl -lpthread\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n fuzz_hci.o ./gobex/gobex*.o -o $OUT/fuzz_hci \\\n $STATIC_LIBS -ldl -lpthread\n\necho \"[libfuzzer]\" > $OUT/fuzz_gobex.options\necho \"detect_leaks=0\" >> $OUT/fuzz_gobex.options\n"
  },
  {
    "path": "projects/bluez/fuzz_gobex.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <config.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n\n#include \"gobex/gobex.h\"\n#include \"gobex/gobex-packet.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  uint8_t buf[255];\n  GObexPacket *pkt;\n  GError *err = NULL;\n  pkt = g_obex_packet_decode(data, size, 0, G_OBEX_DATA_REF, &err);\n  if (pkt != NULL) {\n    /* Anything that decodes must encode */\n    g_obex_packet_encode(pkt, buf, sizeof(buf));\n    g_obex_packet_free(pkt);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/bluez/fuzz_hci.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <config.h>\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <syslog.h>\n\n#include \"bluetooth.h\"\n#include \"sdp.h\"\n#include \"sdp_lib.h\"\n#include \"hci_lib.h\"\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  int to_copy = size;\n  uint8_t features[8];\n\n  if (size > 8) {\n    to_copy = 8;\n  }\n\n  char *null_terminated = malloc(to_copy+1);\n  memcpy(null_terminated, data, to_copy);\n  null_terminated[to_copy] = '\\0';\n/*\n  char *tmp = lmp_featurestostr(features, null_terminated, to_copy);\n  if (tmp) {\n    free(tmp);\n  }\n*/\n  char *tmp = NULL;\n\n  size -= to_copy;\n  data += to_copy;\n\n  /*\n  uint8_t cmds[64];\n  bzero(cmds, 64);\n  for (int i = 0; i < 64 && i < size; i++) {\n    cmds[i] = data[i];\n  }\n  tmp = hci_commandstostr(cmds, NULL, 0);\n  if (tmp) {\n    free(tmp);\n  }\n  */\n  if (size > 4) {\n    uint16_t id = *(uint16_t*)data;\n    bt_compidtostr(id);\n  }\n\n  free(null_terminated);\n  return 0;\n}\n"
  },
  {
    "path": "projects/bluez/fuzz_sdp.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <config.h>\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <syslog.h>\n\n#include \"bluetooth.h\"\n#include \"sdp.h\"\n#include \"sdp_lib.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  /* Target sdp_extract_pdu */\n  int scanned = 0;\n  sdp_record_t *out = NULL;\n  openlog(\"fuzz_sdp\", LOG_PERROR, LOG_LOCAL0);\n  out = sdp_extract_pdu(data, size, &scanned);\n  if (out) {\n    sdp_record_t *copy = sdp_copy_record(out);\n    if (copy) {\n      sdp_record_free(copy);\n    }\n    sdp_record_free(out);\n  }\n  closelog();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/bluez/fuzz_textfile.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <config.h>\n\n#include <stdint.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <syslog.h>\n#include <fcntl.h>\n#include <unistd.h>\n\n#include \"src/textfile.h\"\n\n\nchar *get_null_terminated(const uint8_t **data, size_t *size) {\n#define STR_SIZE 75\n  if (*size < STR_SIZE || (int)*size < 0) {\n    return NULL;\n  }\n\n  char *new_s = malloc(STR_SIZE + 1);\n  memcpy(new_s, *data, STR_SIZE);\n  new_s[STR_SIZE] = '\\0';\n\n  *data = *data+STR_SIZE;\n  *size -= STR_SIZE;\n  return new_s;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  uint8_t *data_ptr = data;\n  size_t size_val = size;\n\n  char *key1 = get_null_terminated(&data_ptr, &size_val);\n  char *val1 = get_null_terminated(&data_ptr, &size_val);\n  char *key2 = get_null_terminated(&data_ptr, &size_val);\n\n  if (!key1 || !val1 || !key2) {\n    goto cleanup;\n  }\n  // Create a file with rest of content\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data_ptr, size_val, 1, fp);\n  fclose(fp);\n\n  textfile_put(filename, key1, val1);\n  textfile_get(filename, key2);\n\n  unlink(filename);\n\ncleanup:\n\n  if (key1 != NULL) {\n    free(key1);\n    key1 = NULL;\n  }\n  if (val1 != NULL) {\n    free(val1);\n    val1 = NULL;\n  }\n  if (key2 != NULL) {\n    free(key2);\n    key2 = NULL;\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/bluez/fuzz_xml.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <config.h>\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <syslog.h>\n\n#include \"bluetooth.h\"\n#include \"sdp.h\"\n#include \"sdp_lib.h\"\n#include \"sdp-xml.h\"\n\nvoid empty_func(void *d, const char *s) {\n  return;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  sdp_record_t *rec;\n  rec = sdp_xml_parse_record(data, size);\n  if (rec != NULL) {\n    convert_sdp_record_to_xml(rec, 0, empty_func);\n    sdp_record_free(rec);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/bluez/project.yaml",
    "content": "homepage: \"https://github.com/bluez/bluez\"\nlanguage: c\nprimary_contact: \"bluez.test.bot@gmail.com\"\nmain_repo: \"https://github.com/bluez/bluez\"\nauto_ccs:\n  - \"hj.tedd.an@gmail.com\"\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\n  # - centipede disabled due to https://github.com/google/oss-fuzz/pull/10248#issuecomment-1579657163\n"
  },
  {
    "path": "projects/bluez/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\n# Remove tests that are not building with the fuzzing set up\nmv unit/test-mesh-crypto.c /tmp/\nmv unit/test-midi.c /tmp/\nfor unit_test in $(ls unit/test-*.c); do\n  unit_name=$(basename ${unit_test})\n  unit_name=\"${unit_name%.*}\"\n  echo ${unit_name}\n\n  make unit/${unit_name}\n  ./unit/${unit_name}\ndone\n\nmv /tmp/test-mesh-crypto.c unit/test-mesh-crypto.c\nmv /tmp/test-midi.c unit/test-midi.c\n"
  },
  {
    "path": "projects/bmcweb/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y \\\n    pkg-config \\\n    cmake \\\n    python3-pip \\\n    libpam0g-dev \\\n    libsystemd-dev \\\n    zlib1g-dev \\\n    libzstd-dev\n\nRUN pip3 install -U meson ninja inflection pyyaml mako\n\nRUN git clone --depth 1 https://github.com/openbmc/bmcweb $SRC/bmcweb\n\nCOPY build.sh $SRC/\nCOPY *_fuzzer.cpp $SRC/\n\nWORKDIR $SRC/bmcweb\n"
  },
  {
    "path": "projects/bmcweb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/bmcweb\n\nexport CFLAGS=\"${CFLAGS} -fPIC\"\nexport CXXFLAGS=\"${CXXFLAGS} -fPIC\"\n\n# Stub systemd.pc – bmcweb only uses it for unit-file install paths.\nmkdir -p $WORK/pkgconfig\ncat > $WORK/pkgconfig/systemd.pc <<'EOF'\nprefix=/usr\nsystemd_system_unit_dir=${prefix}/lib/systemd/system\nName: systemd\nDescription: systemd (stub for fuzzing)\nVersion: 245\nEOF\nexport PKG_CONFIG_PATH=\"$WORK/pkgconfig:${PKG_CONFIG_PATH:-}\"\n\n# Configure with most features disabled – we only need parsing/utility code.\nmeson setup build \\\n  -Ddefault_library=static \\\n  -Dprefer_static=true \\\n  -Db_lto=false \\\n  -Dwerror=false \\\n  -Dtests=disabled \\\n  -Dkvm=disabled \\\n  -Dvm-websocket=disabled \\\n  -Drest=disabled \\\n  -Dhost-serial-socket=disabled \\\n  -Dstatic-hosting=disabled \\\n  -Dredfish-bmc-journal=disabled \\\n  -Dredfish-cpu-log=disabled \\\n  -Dredfish-dump-log=disabled \\\n  -Dredfish-dbus-log=disabled \\\n  -Dredfish-host-logger=disabled \\\n  -Dinsecure-disable-ssl=enabled \\\n  -Dinsecure-disable-auth=enabled \\\n  -Dbmcweb-logging=disabled \\\n  -Dcpp_args=\"${CXXFLAGS}\" \\\n  -Dcpp_link_args=\"${CXXFLAGS}\" \\\n  -Dc_args=\"${CFLAGS}\" \\\n  -Dc_link_args=\"${CFLAGS}\"\n\n# Build as much as possible. The sdbusplus subproject fails to compile but\n# all bmcweb object files and other subproject libraries succeed.\nninja -C build -k 0 || true\n\n# Extract compile flags from meson's compile_commands.json so the fuzzer\n# sources are compiled with exactly the same flags as bmcweb itself.\nCOMPILE_FLAGS=$(python3 -c \"\nimport json, shlex, os\nbuilddir = os.path.abspath('build')\nwith open('build/compile_commands.json') as f:\n    for entry in json.load(f):\n        if 'json_html_serializer.cpp' in entry['file']:\n            args = shlex.split(entry['command'])\n            out = []\n            i = 1  # skip compiler binary\n            while i < len(args):\n                a = args[i]\n                if a in ('-MF', '-MQ', '-o'):\n                    i += 2; continue\n                if a in ('-c', '-MD') or a.endswith('.cpp') or a.endswith('.o') or a.endswith('.d'):\n                    i += 1; continue\n                # Convert relative include paths to absolute\n                for prefix in ('-I', '-isystem'):\n                    if a.startswith(prefix) and not a.startswith(prefix + '/'):\n                        path = a[len(prefix):]\n                        a = prefix + os.path.normpath(os.path.join(builddir, path))\n                        break\n                out.append(a)\n                i += 1\n            print(' '.join(out))\n            break\n\")\n\n# Find the bmcweb object files produced by ninja that our fuzzers need.\nBMCWEB_OBJS=\"\"\nfor name in boost_asio boost_beast json_html_serializer filter_expr_printer; do\n  obj=$(find build -name \"*${name}.cpp.o\" -print -quit)\n  if [ -z \"$obj\" ]; then\n    echo \"ERROR: object file for $name not found in build dir\"\n    exit 1\n  fi\n  BMCWEB_OBJS=\"$BMCWEB_OBJS $obj\"\ndone\n\n# Collect all subproject static libraries for linking.\nLINK_LIBS=$(find build/subprojects -name \"*.a\" 2>/dev/null)\n\n# Build each fuzzer.\nfor fuzzer_src in $SRC/*_fuzzer.cpp; do\n  fuzzer_name=$(basename \"$fuzzer_src\" .cpp)\n\n  $CXX $COMPILE_FLAGS \\\n    -I$SRC/bmcweb \\\n    -c \"$fuzzer_src\" -o \"$WORK/${fuzzer_name}.o\"\n\n  $CXX $CXXFLAGS -std=c++23 \\\n    \"$WORK/${fuzzer_name}.o\" $BMCWEB_OBJS \\\n    $LIB_FUZZING_ENGINE $LINK_LIBS \\\n    -lsystemd -lz -lzstd -lssl -lcrypto -latomic -lpam \\\n    -o \"$OUT/${fuzzer_name}\"\ndone\n"
  },
  {
    "path": "projects/bmcweb/content_type_fuzzer.cpp",
    "content": "/* Copyright 2026 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"http_utility.hpp\"\n\n#include <array>\n#include <cstddef>\n#include <cstdint>\n#include <span>\n#include <string_view>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    if (size == 0)\n    {\n        return 0;\n    }\n\n    std::string_view input(reinterpret_cast<const char*>(data), size);\n\n    // Test content type parser\n    http_helpers::getContentType(input);\n\n    // Test preferred content type parser with various preference orders\n    constexpr std::array<http_helpers::ContentType, 3> defaultPrefs = {\n        http_helpers::ContentType::JSON, http_helpers::ContentType::HTML,\n        http_helpers::ContentType::CBOR};\n    http_helpers::getPreferredContentType(input, defaultPrefs);\n\n    // Test content type allowed check\n    http_helpers::isContentTypeAllowed(input, http_helpers::ContentType::JSON,\n                                       true);\n    http_helpers::isContentTypeAllowed(input, http_helpers::ContentType::JSON,\n                                       false);\n\n    // Test encoding parser\n    constexpr std::array<http_helpers::Encoding, 3> defaultEncodings = {\n        http_helpers::Encoding::ZSTD, http_helpers::Encoding::GZIP,\n        http_helpers::Encoding::UnencodedBytes};\n    http_helpers::getPreferredEncoding(input, defaultEncodings);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/bmcweb/filter_expr_fuzzer.cpp",
    "content": "/* Copyright 2026 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"filter_expr_printer.hpp\"\n\n#include <cstddef>\n#include <cstdint>\n#include <optional>\n#include <string>\n#include <string_view>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    if (size == 0)\n    {\n        return 0;\n    }\n\n    std::string_view input(reinterpret_cast<const char*>(data), size);\n\n    // Use parseFilter which exercises phrase_parse (space-skipping) and\n    // the FilterExpressionPrinter on successful parses\n    std::optional<redfish::filter_ast::LogicalAnd> result =\n        redfish::parseFilter(input);\n\n    if (result)\n    {\n        // Exercise the AST printer on successfully parsed expressions\n        redfish::FilterExpressionPrinter printer;\n        std::string printed = printer(*result);\n        (void)printed;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/bmcweb/json_html_serializer_fuzzer.cpp",
    "content": "/* Copyright 2026 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"json_html_serializer.hpp\"\n\n#include <nlohmann/json.hpp>\n\n#include <cstddef>\n#include <cstdint>\n#include <optional>\n#include <string>\n\n// Reuse bmcweb's own SAX parser to limit depth/width\n#include \"http/parsing.hpp\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    if (size == 0)\n    {\n        return 0;\n    }\n\n    std::string input(reinterpret_cast<const char*>(data), size);\n\n    // Parse JSON using bmcweb's own SAX parser (with depth/width limits)\n    std::optional<nlohmann::json> parsed = parseStringAsJson(input);\n\n    if (parsed)\n    {\n        // Exercise the HTML serializer on successfully parsed JSON\n        std::string html;\n        json_html_util::dumpHtml(html, *parsed);\n        (void)html;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/bmcweb/json_parser_fuzzer.cpp",
    "content": "/* Copyright 2026 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"http/parsing.hpp\"\n\n#include <cstddef>\n#include <cstdint>\n#include <string>\n#include <string_view>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    std::string input(reinterpret_cast<const char*>(data), size);\n\n    // Exercise the main JSON parser with depth/width limits\n    parseStringAsJson(input);\n\n    // Also exercise content-type checking (cheap, reuses same input)\n    std::string_view sv(reinterpret_cast<const char*>(data), size);\n    isJsonContentType(sv);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/bmcweb/multipart_parser_fuzzer.cpp",
    "content": "/* Copyright 2026 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"multipart_parser.hpp\"\n\n#include <cstddef>\n#include <cstdint>\n#include <string>\n#include <string_view>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    if (size < 4)\n    {\n        return 0;\n    }\n\n    // Use first byte to determine boundary length (1-64 chars)\n    uint8_t boundaryLen =\n        static_cast<uint8_t>((data[0] % 64) + 1); // 1-64 chars\n    size_t offset = 1;\n\n    if (offset + boundaryLen > size)\n    {\n        return 0;\n    }\n\n    std::string boundary(reinterpret_cast<const char*>(data + offset),\n                         boundaryLen);\n    offset += boundaryLen;\n\n    std::string_view body(reinterpret_cast<const char*>(data + offset),\n                          size - offset);\n\n    std::string contentType = \"multipart/form-data; boundary=\";\n    contentType += boundary;\n\n    MultipartParser parser;\n    parser.parse(contentType, body);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/bmcweb/project.yaml",
    "content": "homepage: \"https://github.com/openbmc/bmcweb\"\nlanguage: c++\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/openbmc/bmcweb.git'\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/boost/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y g++ python\n\nRUN git clone --recursive https://github.com/boostorg/boost.git\nWORKDIR boost\n# Preferably, move boost_regex_fuzzer.cc to the boost repository.\nCOPY build.sh *.zip *.cc $SRC/\n"
  },
  {
    "path": "projects/boost/boost_datetime_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/date_time/gregorian/gregorian.hpp>\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n\nusing namespace boost::gregorian;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    FuzzedDataProvider fdp(data, size);\n\n    try {\n        std::string s(fdp.ConsumeRandomLengthString(15));\n        date d(from_simple_string(s));\n        to_simple_string(d);\n\n        date d1(from_undelimited_string(s));\n        to_iso_extended_string(d1);\n        \n        date::ymd_type ymd = d1.year_month_day();\n        greg_weekday wd = d1.day_of_week();\n        wd.as_long_string();\n        ymd.month.as_long_string();\n    } catch(...) {\n    }\n    return 0;\n}"
  },
  {
    "path": "projects/boost/boost_filesystem_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/filesystem.hpp>\n#include <boost/filesystem/fstream.hpp>\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    FuzzedDataProvider fdp(data, size);\n    try {\n        boost::filesystem::path p(fdp.ConsumeRandomLengthString(5));\n\n        p.replace_filename(fdp.ConsumeRandomLengthString(5));\n        \n        p.has_extension();\n        p.extension();\n        p.replace_extension(fdp.ConsumeRandomLengthString(3));\n        \n        boost::filesystem::path p1(fdp.ConsumeRandomLengthString(5));\n        p.concat(p1);\n        p.append(p1);\n        p.remove_filename_and_trailing_separators();\n        p /= (p1);\n        p += (p1);\n        \n        p.lexically_relative(p1);\n        p.filename_is_dot();\n        p.remove_filename();\n        \n        p.swap(p1);\n        p.root_directory();\n        p.relative_path();\n        p.parent_path();\n        p.has_stem();\n    } catch(...) {\n    }\n    return 0;\n}"
  },
  {
    "path": "projects/boost/boost_graph_graphml_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/graph/adjacency_list.hpp>\n#include <boost/graph/graphml.hpp>\n#include <boost/range/irange.hpp>\n#ifdef DEBUG\n#include <iostream>\n#endif\n#include <string>\n#include <sstream>\n#include <fuzzer/FuzzedDataProvider.h>\n\ntypedef boost::adjacency_list<\n    boost::vecS, boost::vecS, boost::directedS,\n    boost::property<boost::vertex_name_t, std::string>,\n    boost::property<boost::edge_weight_t, double>\n> Graph;\n\nusing namespace boost;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    FuzzedDataProvider fdp(data, size);\n    try\n    {\n        Graph g;\n        boost::dynamic_properties dp(boost::ignore_other_properties);\n        std::stringstream input(fdp.ConsumeRemainingBytesAsString());\n        read_graphml(input, g, dp);\n        auto viter = make_iterator_range(vertices(g));\n#ifdef DEBUG\n        for (auto v : viter) {\n            std::cout << v << \" \";\n        }\n#endif\n    } catch(...) {\n    }\n    return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_graph_graphviz_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/graph/adjacency_list.hpp>\n#include <boost/graph/graphviz.hpp>\n#include <boost/property_map/dynamic_property_map.hpp>\n#include <boost/exception/exception.hpp>\n#include <boost/exception/diagnostic_information.hpp>\n#ifdef DEBUG\n#include <iostream>\n#endif\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n\nstruct DotVertex {\n    std::string name;\n    std::string label;\n    int peripheries;\n};\n\nstruct DotEdge {\n    std::string label;\n};\n\ntypedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,\n        DotVertex, DotEdge> graph_t;\n\nusing namespace boost;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    FuzzedDataProvider fdp(data, size);\n    try\n    {\n        graph_t graphviz;\n        boost::dynamic_properties dp(boost::ignore_other_properties);\n        dp.property(\"node_id\", boost::get(&DotVertex::name, graphviz));\n        read_graphviz(fdp.ConsumeRemainingBytesAsString(), graphviz, dp);\n        auto viter = make_iterator_range(vertices(graphviz));\n#ifdef DEBUG\n        for (auto v : viter) {\n            std::cout << v << \" \";\n        }\n#endif\n    } catch(...) {\n    }\n    return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_programoptions_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/program_options.hpp>\nnamespace po = boost::program_options;\n\n#include <sstream>\n#include <fuzzer/FuzzedDataProvider.h>\n\nusing namespace std;\n\npo::options_description set_options()\n{\n    po::options_description opts;\n    opts.add_options()\n        (\"global_string\", po::value<string>())\n\n        (\"strings.word\", po::value<string>())\n        (\"strings.phrase\", po::value<string>())\n        (\"strings.quoted\", po::value<string>())\n\n        (\"ints.positive\", po::value<int>())\n        (\"ints.negative\", po::value<int>())\n        (\"ints.hex\", po::value<int>())\n        (\"ints.oct\", po::value<int>())\n        (\"ints.bin\", po::value<int>())\n\n        (\"floats.positive\", po::value<float>())\n        (\"floats.negative\", po::value<float>())\n        (\"floats.double\", po::value<double>())\n        (\"floats.int\", po::value<float>())\n        (\"floats.int_dot\", po::value<float>())\n        (\"floats.dot\", po::value<float>())\n        (\"floats.exp_lower\", po::value<float>())\n        (\"floats.exp_upper\", po::value<float>())\n        (\"floats.exp_decimal\", po::value<float>())\n        (\"floats.exp_negative\", po::value<float>())\n        (\"floats.exp_negative_val\", po::value<float>())\n        (\"floats.exp_negative_negative_val\", po::value<float>())\n\n        (\"booleans.number_true\", po::bool_switch())\n        (\"booleans.number_false\", po::bool_switch())\n        (\"booleans.yn_true\", po::bool_switch())\n        (\"booleans.yn_false\", po::bool_switch())\n        (\"booleans.tf_true\", po::bool_switch())\n        (\"booleans.tf_false\", po::bool_switch())\n        (\"booleans.onoff_true\", po::bool_switch())\n        (\"booleans.onoff_false\", po::bool_switch())\n        (\"booleans.present_equal_true\", po::bool_switch())\n       (\"booleans.present_no_equal_true\", po::bool_switch())\n       ;\n    return opts;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    try {\n        FuzzedDataProvider fdp(data, size);\n        auto opts = set_options();\n        po::variables_map vars;\n        stringstream st(fdp.ConsumeRemainingBytesAsString());\n\n        const bool ALLOW_UNREGISTERED = true;\n\n        po::parsed_options parsed = parse_config_file(st, opts, ALLOW_UNREGISTERED);\n        store(parsed, vars);\n        vector<string> unregistered = po::collect_unrecognized(parsed.options, po::exclude_positional);\n        notify(vars);\n    } catch(...) {\n    }\n    return 0;\n}"
  },
  {
    "path": "projects/boost/boost_ptree_inforead_fuzzer.cc",
    "content": "/*\n * Fuzzing of boost property tree parsers.\n * by Paul Dreik 20180818\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <boost/property_tree/info_parser.hpp>\n#include <sstream>\n\nint\nreadInfo(const char* Data, size_t Size)\n{\n\n  namespace pt = boost::property_tree;\n\n  std::stringstream ss;\n  ss.write(Data, Size);\n\n  pt::ptree tree;\n\n  try {\n    pt::read_info(ss, tree);\n\n    return tree.size() ? 1 : 0;\n  } catch (...) {\n    return 0;\n  }\n}\n\nextern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)\n{\n  readInfo(reinterpret_cast<const char*>(Data), Size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_ptree_iniread_fuzzer.cc",
    "content": "/*\n * Fuzzing of boost property tree parsers.\n * by Paul Dreik 20180818\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <boost/property_tree/ini_parser.hpp>\n#include <sstream>\n\nint\nreadIni(const char* Data, size_t Size)\n{\n\n  namespace pt = boost::property_tree;\n\n  std::stringstream ss;\n  ss.write(Data, Size);\n\n  pt::ptree tree;\n\n  try {\n    pt::read_ini(ss, tree);\n\n    return tree.size() ? 1 : 0;\n  } catch (...) {\n    return 0;\n  }\n}\n\nextern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)\n{\n  readIni(reinterpret_cast<const char*>(Data), Size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_ptree_jsonread_fuzzer.cc",
    "content": "/*\n * Fuzzing of boost property tree parsers.\n * by Paul Dreik 20180818\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <boost/property_tree/json_parser.hpp>\n#include <sstream>\n\nint\nreadJson(const char* Data, size_t Size)\n{\n\n  namespace pt = boost::property_tree;\n\n  std::stringstream ss;\n  ss.write(Data, Size);\n\n  pt::ptree tree;\n\n  try {\n    pt::read_json(ss, tree);\n\n    return tree.size() ? 1 : 0;\n  } catch (...) {\n    return 0;\n  }\n}\n\nextern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)\n{\n  readJson(reinterpret_cast<const char*>(Data), Size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_ptree_xmlread_fuzzer.cc",
    "content": "/*\n * Fuzzing of boost property tree parsers.\n * by Paul Dreik 20180818\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <boost/property_tree/xml_parser.hpp>\n#include <sstream>\n\nint\nreadXml(const char* Data, size_t Size)\n{\n\n  namespace pt = boost::property_tree;\n\n  if (Size < 1) {\n    // no data to use for flags - skip.\n    return 0;\n  }\n\n  std::stringstream ss;\n  const auto firstbyte = Data[0];\n\n  ss.write(Data + 1, Size - 1);\n\n  pt::ptree tree;\n\n  try {\n    // set the parse flags based on the first byte\n    int flags = 0;\n    if (firstbyte & 0x1) {\n      flags |= pt::xml_parser::no_concat_text;\n    }\n    if (firstbyte & 0x2) {\n      flags |= pt::xml_parser::no_comments;\n    }\n    if (firstbyte & 0x4) {\n      flags |= pt::xml_parser::trim_whitespace;\n    }\n    pt::read_xml(ss, tree, flags);\n\n    return tree.size() ? 1 : 0;\n  } catch (...) {\n    return 0;\n  }\n}\n\nextern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)\n{\n  readXml(reinterpret_cast<const char*>(Data), Size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_regex_fuzzer.cc",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// From https://svn.boost.org/trac10/ticket/12818\n// This fuzz target can likely be enhanced to exercise more code.\n// The ideal place for this fuzz target is the boost repository.\n#ifdef DEBUG\n#include <iostream>\n#endif\n\n#include <boost/regex.hpp>\n#include <fuzzer/FuzzedDataProvider.h>\n\nnamespace {\n  void assertPostConditions(boost::match_results<std::string::const_iterator> const& match, boost::regex const& e)\n  {\n    // See https://www.boost.org/doc/libs/1_71_0/libs/regex/doc/html/boost_regex/ref/regex_match.html\n    assert(match.size() == e.mark_count() + 1);\n    assert(!match.empty());\n    assert(!match.prefix().matched);\n    assert(!match.suffix().matched);\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  FuzzedDataProvider fuzzed_data(Data, Size);\n  // First value is length of the regex string\n  size_t regex_length = fuzzed_data.ConsumeIntegral<uint8_t>();\n  // Second value is regexp string whose length is `regex_length`\n  std::string regex_string = fuzzed_data.ConsumeBytesAsString(regex_length);\n  try {\n    boost::regex e(regex_string);\n    // Last value is the text to be matched\n    std::string text = fuzzed_data.ConsumeRemainingBytesAsString();\n\n#ifdef DEBUG\n    std::cout << \"Regexp string: \" << regex_string << \"Size: \" << regex_string.size() << std::endl;\n    std::cout << \"Text: \" << text << \"Size: \" << text.size() << std::endl;\n#endif\n\n    boost::match_results<std::string::const_iterator> what;\n    bool match = boost::regex_match(text, what, e,\n                       boost::match_default | boost::match_partial);\n    if (match)\n      assertPostConditions(what, e);\n  }\n  catch (const std::runtime_error &) {\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_regex_pattern_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/regex.hpp>\n#ifdef DEBUG\n#include <iostream>\n#endif\n#include <string>\n#include <vector>\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    FuzzedDataProvider fdp(Data, Size);\n    // Currently, we just consume all the fuzzed corpus into the regex pattern\n    std::string regex_string = fdp.ConsumeRemainingBytesAsString();\n    const uint8_t where_array[] = {0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48};\n    std::string random(where_array, where_array + sizeof(where_array));\n    std::string empty(\"\");\n    std::string spaces(\"                         \");\n    try {\n        std::vector<std::string> wheres;\n        wheres.push_back(random);\n        wheres.push_back(empty);\n        wheres.push_back(spaces);\n        boost::regex e(regex_string);\n        // We're using multiple texts to be matched.\n#ifdef DEBUG\n        std::cout << \"Regexp string: \" << regex_string << \"Size: \" << regex_string.size() << std::endl;\n#endif\n\n        for (const auto& where : wheres) {\n            try {\n                boost::match_results<std::string::const_iterator> what;\n                bool match = boost::regex_match(where, what, e, boost::match_default | boost::match_partial | boost::match_posix | boost::match_any);\n            } catch(...) {\n            }\n\n            try {\n                boost::match_results<std::string::const_iterator> what;\n                bool match = boost::regex_match(where, what, e, boost::match_default | boost::match_partial | boost::match_perl | boost::match_any);\n            } catch(...) {\n            }\n        }\n    } catch(...) {\n    }\n    return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_regex_replace_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/regex.hpp>\n#ifdef DEBUG\n#include <iostream>\n#endif\n#include <sstream>\n#include <string>\n#include <iterator>\n#include <fuzzer/FuzzedDataProvider.h>\n\n// purpose of the fuzzer:\n// fuzz the format string syntax used in match-replace\n//\n// the mutator comes from a boost example that:\n// takes the contents of a file and transform to\n// syntax highlighted code in html format\n\nboost::regex e1, e2;\nextern const char* expression_text;\nextern const char* pre_expression;\nextern const char* pre_format;\nextern const char* match_against;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) \n{\n    FuzzedDataProvider fdp(Data, Size);\n    std::string format_string = fdp.ConsumeRemainingBytesAsString();\n    try{\n        e1.assign(expression_text);\n        e2.assign(pre_expression);\n        std::string in;\n        in.assign(match_against);\n        std::ostringstream t(std::ios::out | std::ios::binary);\n        std::ostream_iterator<char, char> oi(t);\n        boost::regex_replace(oi, in.begin(), in.end(),\n            e2, format_string, boost::match_default | boost::format_all);\n        std::string s(t.str());\n#ifdef DEBUG\n        std::cout << s << std::endl;\n#endif\n    } catch(...) {\n    }\n    return 0;\n}\n\nconst char* pre_expression = \"(<)|(>)|(&)|\\\\r\";\nconst char* pre_format = \"(?1&lt;)(?2&gt;)(?3&amp;)\";\n\n\nconst char* expression_text =\n    // preprocessor directives: index 1\n    \"(^[[:blank:]]*#(?:[^\\\\\\\\\\\\n]|\\\\\\\\[^\\\\n[:punct:][:word:]]*[\\\\n[:punct:][:word:]])*)|\"\n    // comment: index 2\n    \"(//[^\\\\n]*|/\\\\*.*?\\\\*/)|\"\n    // literals: index 3\n    \"\\\\<([+-]?(?:(?:0x[[:xdigit:]]+)|(?:(?:[[:digit:]]*\\\\.)?[[:digit:]]+\"\n    \"(?:[eE][+-]?[[:digit:]]+)?))u?(?:(?:int(?:8|16|32|64))|L)?)\\\\>|\"\n    // string literals: index 4\n    \"('(?:[^\\\\\\\\']|\\\\\\\\.)*'|\\\"(?:[^\\\\\\\\\\\"]|\\\\\\\\.)*\\\")|\"\n    // keywords: index 5\n    \"\\\\<(__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import\"\n    \"|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall\"\n    \"|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|bool\"\n    \"|break|case|catch|cdecl|char|class|const|const_cast|continue|default|delete\"\n    \"|do|double|dynamic_cast|else|enum|explicit|extern|false|float|for|friend|goto\"\n    \"|if|inline|int|long|mutable|namespace|new|operator|pascal|private|protected\"\n    \"|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_cast\"\n    \"|struct|switch|template|this|throw|true|try|typedef|typeid|typename|union|unsigned\"\n    \"|using|virtual|void|volatile|wchar_t|while)\\\\>\"\n    ;\n\n\nconst char* match_against = \"#include <iostream>\"\n\"#include <string>\"\n\"#include <vector>\"\n\"#include <boost/regex.hpp>\"\n\"\"\n\"\"\n\"extern \\\"C\\\" int main(int argc, char** argv) {\"\n\"\t  std::string regex_string;\"\n\"\t    std::getline(std::cin, regex_string);\"\n\"\t      std::string where(\\\"AAAA\\\");\"\n\"\t        try {\"\n\"\t\t\t    boost::regex e(regex_string);\"\n\"\t\t\t        std::cout << \\\"Regexp string: \\\" << regex_string << \\\"Size: \\\" << regex_string.size() << std::endl;\"\n\"\t\t\t\t    boost::match_results<std::string::const_iterator> what;\"\n\"\t\t\t\t        bool match = boost::regex_match(where, what, e, boost::match_default | boost::match_partial | boost::match_perl | boost::match_posix | boost::match_any);\"\n\"\t\t\t\t\t    if (match)\"\n\"\t\t\t\t\t\t    \t    std::cout << match << std::endl;\"\n\"\t\t\t\t\t      }\"\n\"\t\t  catch (const std::runtime_error &err) {\"\n\"\t\t\t          std::cerr << \\\"Caught exception: \\\" << err.what() << std::endl;\"\n\"\t\t\t\t    }\"\n\"\t\t    return 0;\"\n\"}\";\n\n"
  },
  {
    "path": "projects/boost/boost_stralg_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/algorithm/string.hpp>\n#include <boost/algorithm/string/find_iterator.hpp>\n#include <boost/throw_exception.hpp>\n#include <string>\n#include <iterator>\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)\n{\n    try{\n        FuzzedDataProvider fdp(Data, Size);\n        std::string x = fdp.ConsumeRemainingBytesAsString();\n\n        boost::algorithm::to_upper_copy(x);\n        boost::algorithm::trim_copy(x);\n        boost::algorithm::replace_all_copy(x, \"A\", \"LHVBSLDFVSDJHKG\");\n\n        typedef boost::algorithm::find_iterator<std::string::iterator> string_find_iterator;\n        for(string_find_iterator It=boost::algorithm::make_find_iterator(x, boost::algorithm::first_finder(\"A\", boost::algorithm::is_iequal()));\n            It!=string_find_iterator();\n            ++It\n            ){\n                boost::copy_range<std::string>(*It);\n        }\n\n        typedef boost::algorithm::split_iterator<std::string::iterator> string_split_iterator;\n        for(string_split_iterator It=boost::algorithm::make_split_iterator(x, boost::algorithm::first_finder(\" \", boost::algorithm::is_iequal()));\n            It!=string_split_iterator();\n            ++It\n            ){\n                boost::copy_range<std::string>(*It);\n        }\n\n        boost::algorithm::erase_all_copy(x, \"A\");\n        boost::algorithm::erase_head_copy(x, 2147483647);\n        boost::algorithm::erase_head_copy(x, -2147483648);\n        boost::algorithm::erase_tail_copy(x, 2147483647);\n        boost::algorithm::erase_tail_copy(x, -2147483648);\n\n    } catch(...) {\n    }\n    return 0;\n}\n"
  },
  {
    "path": "projects/boost/boost_uuid_fuzzer.cc",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// The ideal place for this fuzz target is the boost repository.\n#include <boost/uuid/string_generator.hpp>\n#include <boost/uuid/name_generator.hpp>\n#include <boost/uuid/uuid_hash.hpp>\n#include <boost/uuid/uuid.hpp>\n#include <boost/uuid/uuid_io.hpp>\n#include <boost/uuid/nil_generator.hpp>\n#include <fuzzer/FuzzedDataProvider.h>\n\nusing namespace std;\nusing namespace boost::uuids;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size){\n    \n    try{\n        FuzzedDataProvider fdp(Data, Size);\n        std::string s = fdp.ConsumeRemainingBytesAsString();\n\n        string_generator gen_string;\n        name_generator_sha1 gen_name(ns::url());\n        hash<uuid> hasher;\n\n        uuid u_string, u_name;\n\n        u_string = gen_string(s);\n        u_name = gen_name(s);\n        \n        size_t string_hash = hasher(u_string);\n        size_t name_hash = hash_value(u_name);\n        size_t uuid_hash_value = hasher(boost::uuids::uuid());\n\n        string out_string = to_string(u_string);\n        wstring out_wstring = to_wstring(u_string);\n\n        swap(u_string, u_name);\n    } catch(...) {\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/boost/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Work around build issue\ncp \"/usr/local/include/x86_64-unknown-linux-gnu/c++/v1/__config_site\" \"/usr/local/include/c++/v1/\"\n\n# Build boost\nCXXFLAGS=\"$CXXFLAGS -stdlib=libc++ -pthread\" LDFLAGS=\"-stdlib=libc++\" \\\n    ./bootstrap.sh --with-toolset=clang --prefix=/usr;\necho \"using clang : ossfuzz : $CXX : <compileflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"${LIB_FUZZING_ENGINE}\\\" ;\" >user-config.jam\n./b2 --user-config=user-config.jam --toolset=clang-ossfuzz link=static --with-headers --with-graph --with-filesystem --with-program_options headers stage;\n\n# Very simple build rule, but sufficient here.\n#boost regexp\n$CXX $CXXFLAGS -I . ../boost_regex_fuzzer.cc libs/regex/src/*.cpp $LIB_FUZZING_ENGINE -o boost_regex_fuzzer\n$CXX $CXXFLAGS -I . ../boost_regex_pattern_fuzzer.cc libs/regex/src/*.cpp $LIB_FUZZING_ENGINE -o boost_regex_pattern_fuzzer\n$CXX $CXXFLAGS -I . ../boost_regex_replace_fuzzer.cc libs/regex/src/*.cpp $LIB_FUZZING_ENGINE -o boost_regex_replace_fuzzer\n\n#boost property tree parsers\n$CXX $CXXFLAGS -I . ../boost_ptree_xmlread_fuzzer.cc  $LIB_FUZZING_ENGINE -o boost_ptree_xmlread_fuzzer\n$CXX $CXXFLAGS -I . ../boost_ptree_jsonread_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_ptree_jsonread_fuzzer\n$CXX $CXXFLAGS -I . ../boost_ptree_iniread_fuzzer.cc  $LIB_FUZZING_ENGINE -o boost_ptree_iniread_fuzzer\n$CXX $CXXFLAGS -I . ../boost_ptree_inforead_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_ptree_inforead_fuzzer\n\n#boost graph graphviz\n$CXX $CXXFLAGS -I . ../boost_graph_graphviz_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_graph_graphviz_fuzzer stage/lib/libboost_graph.a\n$CXX $CXXFLAGS -I . ../boost_graph_graphml_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_graph_graphml_fuzzer stage/lib/libboost_graph.a\n\n#boost datetime\n$CXX $CXXFLAGS -I . ../boost_datetime_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_datetime_fuzzer\n\n#boost filesystem\n$CXX $CXXFLAGS -I . ../boost_filesystem_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_filesystem_fuzzer stage/lib/libboost_filesystem.a\n\n#boost algorithm/strings\n$CXX $CXXFLAGS -I . ../boost_stralg_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_stralg_fuzzer\n\n#boost uuid\n$CXX $CXXFLAGS -I . ../boost_uuid_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_uuid_fuzzer\n\n#boost programoptions\n$CXX $CXXFLAGS -I . ../boost_programoptions_fuzzer.cc $LIB_FUZZING_ENGINE -o boost_programoptions_fuzzer stage/lib/libboost_program_options.a\n\n# Copy the fuzzer executables, zip-ed corpora, option and dictionary files to $OUT\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\n# find . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'     # If you have dictionaries.\n# find . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'  # If you have custom options.\nfind . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';' # If you have seed corpora (you better have them!)\n"
  },
  {
    "path": "projects/boost/project.yaml",
    "content": "homepage: \"http://www.boost.org/\"\nlanguage: c++\nprimary_contact: \"mclow@boost.org\"\nauto_ccs:  \n   - \"jz.maddock@googlemail.com\"\n   - \"bshas3@gmail.com\"\n   - \"jking@apache.org\"\n   - \"jeremy.william.murphy@gmail.com\"\n   - \"christian.mazakas@gmail.com\"\n   - \"research@shielder.it\"\nmain_repo: 'https://github.com/boostorg/boost.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/boost-beast/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder:v1\n\nRUN git clone --depth 1 --single-branch --branch master https://github.com/boostorg/boost.git\nWORKDIR boost\nRUN git submodule update --init libs/beast\nRUN git -C libs/beast checkout develop\nRUN git submodule update --init tools/boostdep\nRUN python3 tools/boostdep/depinst/depinst.py --git_args \"--jobs 3\" beast\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/boost-beast/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n./bootstrap.sh\n\necho \"using clang : ossfuzz : $CXX : <compileflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"${LIB_FUZZING_ENGINE}\\\" ;\" >user-config.jam\n\n./b2 --user-config=user-config.jam --toolset=clang-ossfuzz --prefix=$WORK/stage --with-headers link=static install\n\ntar -xvf libs/beast/test/fuzz/seeds.tar -C libs/beast/test/fuzz\n\nfor i in libs/beast/test/fuzz/*.cpp; do\n    fuzzer=$(basename $i .cpp)\n    $CXX $CXXFLAGS -pthread -I $WORK/stage/include libs/beast/test/fuzz/$fuzzer.cpp $LIB_FUZZING_ENGINE -o $OUT/$fuzzer\n\n    if [ -d \"libs/beast/test/fuzz/seeds/$fuzzer\" ]; then\n        zip -q -r -j $OUT/\"$fuzzer\"_seed_corpus.zip libs/beast/test/fuzz/seeds/$fuzzer\n    fi\ndone\n"
  },
  {
    "path": "projects/boost-beast/project.yaml",
    "content": "homepage: \"https://www.boost.org/\"\nlanguage: c++\nprimary_contact: \"vinnie.falco@gmail.com\"\nauto_ccs:\n   - \"ashtumashtum@gmail.com\"\nmain_repo: 'https://github.com/boostorg/beast.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/boost-json/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 --single-branch --branch master https://github.com/boostorg/boost.git\nRUN pwd\nRUN ls\nRUN git -C boost submodule update --init libs/json\nRUN git -C boost/libs/json checkout develop\nRUN git -C boost submodule update --init --depth 1 \\\nlibs/assert \\\nlibs/config/ \\\nlibs/compat \\\nlibs/container \\\nlibs/container_hash/ \\\nlibs/core \\\nlibs/describe \\\nlibs/endian \\\nlibs/headers/ \\\nlibs/intrusive/ \\\nlibs/move/ \\\nlibs/mp11/ \\\nlibs/predef/ \\\nlibs/system/ \\\nlibs/throw_exception/ \\\nlibs/winapi/ \\\nlibs/variant2/ \\\ntools/boost_install \\\ntools/build\n\nWORKDIR boost\nCOPY build.sh $SRC/\n\n"
  },
  {
    "path": "projects/boost-json/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./bootstrap.sh --with-toolset=clang\n\necho \"using clang : ossfuzz : $CXX : <compileflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"${LIB_FUZZING_ENGINE}\\\" ;\" >user-config.jam\n\n./b2 --user-config=user-config.jam                              \\\n     --toolset=clang-ossfuzz                                    \\\n     --prefix=$WORK/stage                                       \\\n     --with-json                                                \\\n     include=/usr/local/include/x86_64-unknown-linux-gnu/c++/v1 \\\n     link=static                                                \\\n     install\n\nfor i in libs/json/fuzzing/*.cpp; do\n   fuzzer=$(basename $i .cpp)\n   $CXX $CXXFLAGS -pthread libs/json/fuzzing/$fuzzer.cpp -I $WORK/stage/include/ $WORK/stage/lib/*.a $LIB_FUZZING_ENGINE -o $OUT/$fuzzer\n   zip -q -r -j $OUT/${fuzzer}_seed_corpus.zip libs/json/fuzzing/old_crashes\ndone\n\n"
  },
  {
    "path": "projects/boost-json/project.yaml",
    "content": "homepage: \"http://www.boost.org/\"\nlanguage: c++\nprimary_contact: \"pauldreikossfuzz@gmail.com\"\nauto_ccs:\n   - \"vinnie.falco@gmail.com\"\n   - \"grisumbras@gmail.com\"\n   - \"pdimov@gmail.com\"\nmain_repo: 'https://github.com/boostorg/json.git'\n"
  },
  {
    "path": "projects/boringssl/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y wget \\\n    binutils cmake ninja-build liblzma-dev libz-dev \\\n    pkg-config autoconf libtool\nRUN git clone --depth 1 https://boringssl.googlesource.com/boringssl\n# Use ASN.1 pdu protobuf and converter from the google/fuzzing repo.\nRUN git clone --depth 1 https://github.com/google/fuzzing.git\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja)\nCOPY *.cc build.sh $SRC/\n"
  },
  {
    "path": "projects/boringssl/build.sh",
    "content": "#!/bin/bash -eux\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmkdir -p $WORK/boringssl\ncd $WORK/boringssl\n\nCFLAGS=\"$CFLAGS -DBORINGSSL_UNSAFE_FUZZER_MODE\"\nCXXFLAGS=\"$CXXFLAGS -DBORINGSSL_UNSAFE_FUZZER_MODE\"\n\nCMAKE_DEFINES=\"-DBORINGSSL_ALLOW_CXX_RUNTIME=1\"\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n  CMAKE_DEFINES+=\" -DOPENSSL_NO_ASM=1\"\nfi\n\ncmake -GNinja -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \\\n      -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n      $CMAKE_DEFINES $SRC/boringssl/\nninja\n\nfuzzerFiles=$(find $SRC/boringssl/fuzz/ -name \"*.cc\")\n\nfind . -name \"*.a\"\n\nfor F in $fuzzerFiles; do\n  fuzzerName=$(basename $F .cc)\n  echo \"Building fuzzer $fuzzerName\"\n  $CXX $CXXFLAGS \\\n      -D_BORINGSSL_LIBPKI_ -std=c++1z \\\n      -o $OUT/${fuzzerName} $LIB_FUZZING_ENGINE $F \\\n      -I $SRC/boringssl/include ./libpki.a ./libssl.a  ./libcrypto.a\n\n  if [ -d \"$SRC/boringssl/fuzz/${fuzzerName}_corpus\" ]; then\n    zip -j $OUT/${fuzzerName}_seed_corpus.zip $SRC/boringssl/fuzz/${fuzzerName}_corpus/*\n  fi\ndone\n\nif [[ $CFLAGS != *sanitize=memory* ]]; then\n  fuzzerLPMFiles=$(find $SRC/ -maxdepth 1 -name \"*.cc\")\n\n  cp $SRC/fuzzing/proto/asn1-pdu/* $SRC/\n\n  rm -rf genfiles && mkdir genfiles && $SRC/LPM/external.protobuf/bin/protoc asn1_pdu.proto --cpp_out=genfiles --proto_path=$SRC/\n\n  for F in $fuzzerLPMFiles\n  do\n    fuzzerName=$(echo ${F#*_})\n    fuzzerName=$(basename $fuzzerName .cc)\n    echo \"Building fuzzer $fuzzerName\"\n    $CXX $CXXFLAGS -I genfiles -I . -I $SRC/libprotobuf-mutator/ -I $SRC/LPM/external.protobuf/include -I include $LIB_FUZZING_ENGINE \\\n        -DNDEBUG \\\n        -I $SRC/boringssl/include \\\n        $F genfiles/asn1_pdu.pb.cc $SRC/asn1_pdu_to_der.cc $SRC/common.cc \\\n        ./libssl.a ./libcrypto.a \\\n        $SRC/LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n        $SRC/LPM/src/libprotobuf-mutator.a \\\n        -Wl,--start-group $SRC/LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n        -o $OUT/\"${fuzzerName}_lpm\"\n  done\nfi\n"
  },
  {
    "path": "projects/boringssl/fuzz_certs.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n// This fuzz target fuzzes the same API as\n// https://github.com/google/boringssl/blob/master/fuzz/cert.cc, but it employs\n// libprotobuf-mutator for structure-aware fuzzing.\n\n#include <openssl/err.h>\n#include <openssl/mem.h>\n#include <openssl/x509.h>\n#include \"asn1_pdu.pb.h\"\n#include \"asn1_pdu_to_der.h\"\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n\nDEFINE_PROTO_FUZZER(const asn1_pdu::PDU& asn1) {\n  asn1_pdu::ASN1PDUToDER converter;\n  std::vector<uint8_t> encoded = converter.PDUToDER(asn1);\n  const uint8_t* buf = encoded.data();\n  size_t len = encoded.size();\n\n  X509* x509 = d2i_X509(NULL, &buf, len);\n  if (x509 != NULL) {\n    // Extract the public key.\n    EVP_PKEY_free(X509_get_pubkey(x509));\n\n    // Reserialize the structure.\n    uint8_t* der = NULL;\n    i2d_X509(x509, &der);\n    OPENSSL_free(der);\n  }\n  X509_free(x509);\n  ERR_clear_error();\n}"
  },
  {
    "path": "projects/boringssl/fuzz_pkcs12.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n// This fuzz target fuzzes the same API as\n// https://github.com/google/boringssl/blob/master/fuzz/pkcs12.cc, but it\n// employs libprotobuf-mutator for structure-aware fuzzing.\n\n#include <openssl/bytestring.h>\n#include <openssl/evp.h>\n#include <openssl/pkcs8.h>\n#include <openssl/x509.h>\n#include \"asn1_pdu.pb.h\"\n#include \"asn1_pdu_to_der.h\"\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n\nDEFINE_PROTO_FUZZER(const asn1_pdu::PDU& asn1) {\n  asn1_pdu::ASN1PDUToDER converter;\n  std::vector<uint8_t> encoded = converter.PDUToDER(asn1);\n  const uint8_t* buf = encoded.data();\n  size_t len = encoded.size();\n\n  bssl::UniquePtr<STACK_OF(X509)> certs(sk_X509_new_null());\n  EVP_PKEY* key = nullptr;\n  CBS cbs;\n  CBS_init(&cbs, buf, len);\n  PKCS12_get_key_and_certs(&key, certs.get(), &cbs, \"foo\");\n  EVP_PKEY_free(key);\n}"
  },
  {
    "path": "projects/boringssl/fuzz_pkcs8.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n// This fuzz target fuzzes the same API as\n// https://github.com/google/boringssl/blob/master/fuzz/pkcs8.cc, but it employs\n// libprotobuf-mutator for structure-aware fuzzing.\n\n#include <openssl/bytestring.h>\n#include <openssl/err.h>\n#include <openssl/evp.h>\n#include <openssl/mem.h>\n#include \"asn1_pdu.pb.h\"\n#include \"asn1_pdu_to_der.h\"\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n\nDEFINE_PROTO_FUZZER(const asn1_pdu::PDU& asn1) {\n  asn1_pdu::ASN1PDUToDER converter;\n  std::vector<uint8_t> encoded = converter.PDUToDER(asn1);\n  const uint8_t* buf = encoded.data();\n  size_t len = encoded.size();\n\n  CBS cbs;\n  CBS_init(&cbs, buf, len);\n  bssl::UniquePtr<EVP_PKEY> pkey(EVP_parse_private_key(&cbs));\n  if (pkey == NULL) {\n    return;\n  }\n\n  uint8_t* der;\n  size_t der_len;\n  bssl::ScopedCBB cbb;\n  if (CBB_init(cbb.get(), 0) &&\n      EVP_marshal_private_key(cbb.get(), pkey.get()) &&\n      CBB_finish(cbb.get(), &der, &der_len)) {\n    OPENSSL_free(der);\n  }\n  ERR_clear_error();\n}"
  },
  {
    "path": "projects/boringssl/project.yaml",
    "content": "homepage: \"https://boringssl.googlesource.com/boringssl/\"\nlanguage: c++\nprimary_contact: \"agl@google.com\"\nauto_ccs:\n - \"bbe@google.com\"\n - \"davidben@google.com\"\n - \"svaldez@google.com\"\nsanitizers:\n- address\n- undefined\n- memory\nmain_repo: 'https://boringssl.googlesource.com/boringssl'\n"
  },
  {
    "path": "projects/botan/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make python\nRUN git clone --depth 1 https://github.com/randombit/botan.git botan\nRUN git clone --depth 1 https://github.com/randombit/crypto-corpus.git fuzzer_corpus\nWORKDIR botan\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/botan/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/botan\n\nln -s $SRC/fuzzer_corpus .\n\n./src/scripts/config_for_oss_fuzz.py $CXX \"$CXXFLAGS\"\n\nmake -j$(nproc) libs fuzzers\nmake fuzzer_corpus_zip\n\n# the seed corpus zips will also be in this directory\ncp build/fuzzer/* $OUT\n"
  },
  {
    "path": "projects/botan/project.yaml",
    "content": "homepage: \"https://botan.randombit.net\"\nlanguage: c++\nprimary_contact: \"jack.lloyd@gmail.com\"\nauto_ccs:\n  - \"re.korthaus@googlemail.com\"\n  - \"droelf@googlemail.com\"\n  - \"norritt@bytefortress.de\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/randombit/botan.git'\nfuzzing_engines:\n  - afl\n  - centipede\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/botan/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##############################################################################\n\nmake -j$(nproc) check\n"
  },
  {
    "path": "projects/botocore/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth=1 https://github.com/boto/botocore botocore\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/botocore\n"
  },
  {
    "path": "projects/botocore/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/botocore/fuzz_serialization.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nimport io\nimport botocore\nfrom botocore import serialize\nfrom botocore.model import ServiceModel\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  protocols = [\n    'rest-xml', 'json', 'query'\n  ]\n  protocol_str = protocols[fdp.ConsumeIntInRange(0, len(protocols)-1)]\n\n  # Simple model with a single shape of type blob\n  model = {\n    'metadata': {'protocol': protocol_str, 'apiVersion': '2022-01-01'},\n    'documentation': '',\n    'operations': {\n      'FuzzOperation': {\n        'name': 'FuzzOperation',\n        'http': {\n          'method': 'POST',\n          'requestUri': '/',\n        },\n        'input': {'shape': 'FuzzInputShape'},\n      }\n    },\n    'shapes': {\n      'FuzzInputShape': {\n        'type': 'structure',\n        'members': {\n          'Blob': {'shape': 'BlobType'},\n        },\n      },\n      'BlobType': {\n        'type': 'blob',\n      },\n    },\n  }\n\n  service_model = ServiceModel(model)\n  request_serializer = serialize.create_serializer(\n    service_model.metadata['protocol']\n  )\n  body = io.BytesIO(data)\n  try:\n    request_serializer.serialize_to_request(\n      body,\n      service_model.operation_model('FuzzOperation')\n    )\n  except botocore.exceptions.ParamValidationError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n\n"
  },
  {
    "path": "projects/botocore/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/boto/botocore\nlanguage: python\nmain_repo: https://github.com/boto/botocore\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/bottleneck/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip && pip3 install cython numpy\nRUN git clone --depth 1 https://github.com/pydata/bottleneck\nWORKDIR bottleneck\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/bottleneck/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncd $SRC/bottleneck\npip3 install .\npython3 setup.py install\n\n# Build fuzzers and put them in $OUT/\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/bottleneck/fuzz_bn.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Scalar equivalene checker\"\"\"\n\nimport os\nimport sys\nimport atheris\n\nimport numpy as np\nfrom numpy.testing import assert_array_almost_equal\nimport bottleneck as bn\n\n\ndef gen_random_array(data, fdp = None):\n  if fdp is None:\n    fdp = atheris.FuzzedDataProvider(data)\n  l1 = list()\n  for i in range(fdp.ConsumeIntInRange(5, 3000)):\n    l1.append(fdp.ConsumeIntInRange(1,10000))\n  a = np.array(l1)\n  return a\n\ndef TestOneInput(data):\n  \"\"\"Tests scalar equivalence and also move operations\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  a = gen_random_array(data, fdp)\n\n  func_pairs = [\n    (bn.nansum, bn.slow.nansum),\n    (bn.nanmean, bn.slow.nanmean),\n    (bn.nanstd, bn.slow.nanstd),\n    (bn.nanvar, bn.slow.nanvar),\n    (bn.nanmin, bn.slow.nanmin),\n    (bn.median, bn.slow.median),\n    (bn.nanmedian, bn.slow.nanmedian),\n    (bn.ss, bn.slow.ss),\n    (bn.nanargmin, bn.slow.nanargmin),\n    (bn.nanargmax, bn.slow.nanargmax),\n    (bn.anynan, bn.slow.anynan),\n    (bn.allnan, bn.slow.allnan),\n  ]\n\n  idx = 0\n  for func0, func1 in func_pairs:\n    idx = idx + 1\n    actual = func0(a)\n    desired = func1(a)\n    assert_array_almost_equal(\n      actual,\n      desired,\n      err_msg=\"Failed scalar equivalence\"\n    )\n\n\n  # Test move operations\n  window = fdp.ConsumeIntInRange(2, 50)\n  min_count = fdp.ConsumeIntInRange(1, window)\n  try:\n    actual = bn.move_median(\n      a,\n      window=window,\n      min_count = fdp.ConsumeIntInRange(1,100)\n    )\n  except ValueError:\n    return\n  try:\n    desired = bn.slow.move_median(\n      a,\n      window=window,\n      min_count=fdp.ConsumeIntInRange(1, 100)\n    )\n  except ValueError:\n    return\n  assert_array_almost_equal(\n    actual,\n    desired,\n    err_msg=\"Failed move operation\"\n  )\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/bottleneck/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pydata/bottleneck\nlanguage: python\nmain_repo: https://github.com/pydata/bottleneck\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/brotli/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake libtool make\n\nRUN git clone --depth 1 https://github.com/google/brotli.git\nWORKDIR brotli\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/brotli/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncmake . -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=OFF\nmake clean\nmake -j$(nproc)\n\n$CC $CFLAGS -c -std=c99 -I. -I./c/include c/fuzz/decode_fuzzer.c \n\n$CXX $CXXFLAGS ./decode_fuzzer.o  -o $OUT/decode_fuzzer \\\n    $LIB_FUZZING_ENGINE ./libbrotlidec.a ./libbrotlicommon.a\n\ncp java/org/brotli/integration/fuzz_data.zip $OUT/decode_fuzzer_seed_corpus.zip\nchmod a-x $OUT/decode_fuzzer_seed_corpus.zip # we will try to run it otherwise\n"
  },
  {
    "path": "projects/brotli/project.yaml",
    "content": "homepage: \"https://github.com/google/brotli\"\nlanguage: c++\nprimary_contact: \"eustas@chromium.org\"\nvendor_ccs:\n  - \"jkew@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/google/brotli.git'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/brotli/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/brotli\nmake test\n"
  },
  {
    "path": "projects/brotli-java/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/brotli brotli-java\nWORKDIR brotli-java\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/brotli-java/FuzzDecode.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.*;\nimport org.brotli.dec.BrotliInputStream;\n\npublic class FuzzDecode {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    byte[] buffer = new byte[65536];\n    byte[] inputBytes = data.consumeBytes(65536);\n    // Brotli allows 0-bit prefix codes - thus even small input could produce large output.\n    long totalOutputCap = Math.min(4096L * inputBytes.length, 3L << 24);\n    totalOutputCap = Math.max(totalOutputCap, 1L << 20);\n    long totalOutput = 0;\n    ByteArrayInputStream input = new ByteArrayInputStream(inputBytes);\n    try {\n      BrotliInputStream brotliInput = new BrotliInputStream(input);\n      while (true) {\n        int len = brotliInput.read(buffer, 0, buffer.length);\n        if (len <= 0) {\n          break;\n        }\n        totalOutput += len;\n        if (totalOutput >= totalOutputCap) break;\n      }\n    } catch (IOException expected) {}\n  }\n}\n"
  },
  {
    "path": "projects/brotli-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd java/org/brotli\nsed -i 's/1.6</1.7</g' ./pom.xml\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=11 -Djavac.target.version=11 -X\"\n$MVN package\nfind ./dec -name \"org.brotli.dec-*.jar\" -exec mv {} $OUT/dec.jar \\;\n\nALL_JARS=\"dec.jar\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -name 'Fuzz*.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/brotli-java/project.yaml",
    "content": "homepage: \"https://github.com/google/brotli/tree/master/java\"\nlanguage: jvm\nprimary_contact: \"eustas@chromium.org\"\nmain_repo: \"https://github.com/google/brotli\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nfile_github_issue: True\n"
  },
  {
    "path": "projects/brpc/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgtest-dev libgoogle-perftools-dev libsnappy-dev\nRUN git clone --depth 1 https://github.com/apache/brpc.git\nRUN cp $SRC/brpc/test/fuzzing/oss-fuzz.sh $SRC/build.sh\nWORKDIR $SRC/brpc/\nCOPY run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/brpc/project.yaml",
    "content": "homepage: \"https://brpc.apache.org\"\nlanguage: c++\nprimary_contact: \"security@apache.org\"\nvendor_ccs:\n  - \"zhujiashun2010@gmail.com\"\n  - \"wangweibing@baidu.com\"\n  - \"serverglen@gmail.com\"\n  - \"jerrytan@apache.org\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\nmain_repo: \"https://github.com/apache/incubator-brpc\"\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/brpc/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Disable failing testing and tests requires network connection and run the remaining unit testings\nmake -C $SRC/brpc/build/test -j$(nproc) && ctest --test-dir $SRC/brpc/build --output-on-failure -j$(nproc) -E \\\n  \"test_butil|bthread_timer_thread_unittest|brpc_alpn_protocol_unittest|brpc_channel_unittest|brpc_interceptor_unittest|brpc_ssl_unittest|bthread_mutex_unittest|bthread_cond_unittest|bthread_butex_unittest|bthread_dispatcher_unittest|bthread_fd_unittest|bthread_setconcurrency_unittest|brpc_http_rpc_protocol_unittest|brpc_naming_service_unittest|brpc_event_dispatcher_unittest|brpc_server_unittest|brpc_streaming_rpc_unittest|brpc_socket_unittest\"\n"
  },
  {
    "path": "projects/brunsli/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake libtool make\n\nRUN git clone --depth 1 https://github.com/google/brunsli.git && \\\n    cd brunsli && \\\n    git submodule update --init --depth 1\nWORKDIR brunsli\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/brunsli/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Bump gtest to work with llvm21: https://github.com/google/oss-fuzz/pull/13915\nsed -i 's/e2239ee6043f73722e7aa812a459f54a28552929/6910c9d9165801d8827d628cb72eb7ea9dd538c5/g' CMakeLists.txt\ncmake . -DBUILD_TESTING=ON\nmake clean\nmake -j$(nproc) all\n\n# TODO(eustas): add seed corpus\n\n$CXX $CXXFLAGS -std=c++11 -I./c/include c/tests/fuzz_decode.cc \\\n    ./CMakeFiles/build_huffman_table_test.dir/c/tests/test_utils.cc.o \\\n    -o $OUT/fuzz_decode $LIB_FUZZING_ENGINE \\\n    ./artifacts/libbrunslidec-static.a ./artifacts/libbrunslicommon-static.a \\\n    ./_deps/brotli-build/libbrotlidec-static.a \\\n    ./_deps/brotli-build/libbrotlicommon-static.a\n\n$CXX $CXXFLAGS -std=c++11 -I./c/include c/tests/fuzz_decode_streaming.cc \\\n    ./CMakeFiles/build_huffman_table_test.dir/c/tests/test_utils.cc.o \\\n    -o $OUT/fuzz_decode_streaming $LIB_FUZZING_ENGINE \\\n    ./artifacts/libbrunslidec-static.a ./artifacts/libbrunslicommon-static.a \\\n    ./_deps/brotli-build/libbrotlidec-static.a \\\n    ./_deps/brotli-build/libbrotlicommon-static.a\n"
  },
  {
    "path": "projects/brunsli/project.yaml",
    "content": "homepage: \"https://github.com/google/brunsli\"\nlanguage: c++\nprimary_contact: \"eustas@chromium.org\"\nvendor_ccs:\n  - \"jkew@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/google/brunsli.git'\nfile_github_issue: True\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/brunsli/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake test\n"
  },
  {
    "path": "projects/bs4/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y bzr git libxslt-dev libxml2-dev zlib1g-dev\nRUN python3 -m pip install --upgrade pip\nRUN python3 -m pip install soupsieve html5lib lxml\nRUN python3 -m pip install git+https://git.launchpad.net/beautifulsoup\n\nCOPY build.sh bs4_fuzzer.py $SRC/\n"
  },
  {
    "path": "projects/bs4/bs4_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n  import logging\n  import warnings\n  from bs4 import BeautifulSoup, ParserRejectedMarkup\n  import soupsieve\n  from soupsieve.util import SelectorSyntaxError\n\n\ntry:\n  import HTMLParser\n  HTMLParseError = HTMLParser.HTMLParseError\nexcept ImportError:\n  # HTMLParseError is removed in Python 3.5. Since it can never be\n  # thrown in 3.5, we can just define our own class as a placeholder.\n\n  class HTMLParseError(Exception):\n    pass\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  \"\"\"TestOneInput gets random data from the fuzzer, and throws it at bs4.\"\"\"\n  if len(data) < 12:\n    return\n\n  parsers = ['lxml-xml', 'html5lib', 'html.parser', 'lxml']\n  try:\n    idx = int(data[0]) % len(parsers)\n  except ValueError:\n    return\n\n  css_selector, data = data[1:10], data[10:]\n\n  try:\n    soup = BeautifulSoup(data[1:], features=parsers[idx])\n  except HTMLParseError:\n    return\n  except ValueError:\n    return\n  except ParserRejectedMarkup:\n    return\n\n  list(soup.find_all(True))\n  if soup.css:\n      try:\n          soup.css.select(css_selector.decode('utf-8', 'replace'))\n      except SelectorSyntaxError:\n          return\n      except NotImplementedError:\n          return\n  soup.prettify()\n\n\ndef main():\n  logging.disable(logging.CRITICAL)\n  warnings.filterwarnings('ignore')\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/bs4/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/bs4/project.yaml",
    "content": "homepage: \"https://www.crummy.com/software/BeautifulSoup/\"\nmain_repo: \"https://code.launchpad.net/~leonardr/beautifulsoup/bs4\"\nlanguage: python\nprimary_contact: \"leonard.richardson@gmail.com\"\nauto_ccs:\n  - \"julien.voisin@dustri.org\"\n  - \"ipudney@google.com\"\n  - \"security@tidelift.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nbase_os_version: ubuntu-24-04"
  },
  {
    "path": "projects/bson-rust/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/mongodb/bson-rust bson-rust\nWORKDIR bson-rust\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/bson-rust/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nset -eox pipefail\n\ntarget_out_dir=fuzz/target/x86_64-unknown-linux-gnu/release\ncargo fuzz build -O\ncargo fuzz list | while read i; do\n  [[ \"$i\" == \"generate_corpus\" ]] && continue\n  cp $target_out_dir/$i $OUT/\ndone\n"
  },
  {
    "path": "projects/bson-rust/project.yaml",
    "content": "homepage: \"https://github.com/mongodb/bson-rust\"\nlanguage: rust\nmain_repo: \"https://github.com/mongodb/bson-rust\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/burntsushi-toml/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/BurntSushi/toml toml\nCOPY build.sh $SRC/\nWORKDIR $SRC/toml\n"
  },
  {
    "path": "projects/burntsushi-toml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer  github.com/BurntSushi/toml/ossfuzz FuzzToml fuzz_toml gofuzz\n"
  },
  {
    "path": "projects/burntsushi-toml/project.yaml",
    "content": "homepage: \"https://github.com/BurntSushi/toml\"\nlanguage: go\nmain_repo: \"https://github.com/BurntSushi/toml\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/bz2file/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/nvawda/bz2file bz2file\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/bz2file\n"
  },
  {
    "path": "projects/bz2file/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone"
  },
  {
    "path": "projects/bz2file/fuzz_bz2file.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport bz2file\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  bzfile_path = '/tmp/random_file.txt'\n  with open(bzfile_path, 'wb') as f:\n    f.write(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 2048)))\n\n  try:\n    with bz2file.open(bzfile_path) as target_file:\n      target_file.seek(fdp.ConsumeIntInRange(-1, 100))\n      target_file.read(size=fdp.ConsumeIntInRange(-1, 100))\n  except (ValueError,EOFError,OSError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/bz2file/project.yaml",
    "content": "homepage: https://github.com/nvawda/bz2file\nmain_repo: https://github.com/nvawda/bz2file\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/bzip2/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone git://sourceware.org/git/bzip2.git\nRUN git clone git://sourceware.org/git/bzip2-tests.git\nCOPY run_tests.sh build.sh *.c $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/bzip2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd bzip2\nSRCL=(blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o)\n\nfor source in ${SRCL[@]}; do\n    name=$(basename $source .o)\n    $CC $CFLAGS -c ${name}.c\ndone\nrm -f libbz2.a\nar cq libbz2.a ${SRCL[@]} && ranlib libbz2.a\n\n# build fuzzers\nfor file in $SRC/*.c;\ndo\n    name=$(basename $file .c)\n    $CC $CFLAGS -c -I . $SRC/${name}.c -o $OUT/${name}.o\n    $CXX $CXXFLAGS -o $OUT/${name} $OUT/${name}.o $LIB_FUZZING_ENGINE \\\n    libbz2.a\n    rm -f $OUT/${name}.o\ndone\n\n# build decompress seed corpus from \".bz2\" samples\n# 1) look for all \".bz2\" files in ./bzip2 and ./bzip2-test that are <100k\n# 2) remove base file name collisions\n# 3) add to (bzip2_decompress_target_seed_corpus.zip) archive\nfind $SRC/bzip2* -type f -name \"*.bz2\" -size -100k \\\n  | awk -F/ '{a[$NF]=$0}END{for(i in a)print a[i]}' \\\n  | zip -j0r bzip2_decompress_target_seed_corpus.zip -@\n"
  },
  {
    "path": "projects/bzip2/bzip2_compress_target.c",
    "content": "/*\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n*/\n\n#include \"bzlib.h\"\n#include <stdint.h>\n#include <stdlib.h>\n#include <assert.h>\n#include <string.h>\n\nextern int BZ2_bzBuffToBuffCompress(char* dest,\n                           unsigned int* destLen,\n                           char*         source,\n                           unsigned int  sourceLen,\n                           int           blockSize100k,\n                           int           verbosity,\n                           int           workFactor);\n\nextern int BZ2_bzBuffToBuffDecompress(char* dest,\n                                      unsigned int* destLen,\n                                      char*         source,\n                                      unsigned int  sourceLen,\n                                      int           small,\n                                      int           verbosity);\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    int r, blockSize100k, workFactor, small;\n    unsigned int nZ, nOut;\n\n    /* Copying @julian-seward1's comment from\n     * https://github.com/google/oss-fuzz/pull/1887#discussion_r226852388\n     *\n     * They just reflect the fact that the worst case output size is 101%\n     * of the input size + 600 bytes (I assume -- this is now nearly 20\n     * years old). Since the buffer is in mallocville, presumably asan\n     * will complain if it gets overrun. I doubt that will happen though.\n     */\n    nZ = size + 600 + (size / 100);\n    char *zbuf = malloc(nZ);\n\n    blockSize100k = (size % 11) + 1;\n    if (blockSize100k > 9) {\n        blockSize100k = 9;\n    }\n    workFactor = size % 251;\n\n    // Choose highest compression (blockSize100k=9)\n    r = BZ2_bzBuffToBuffCompress(zbuf, &nZ, (char *)data, size,\n            blockSize100k, /*verbosity=*/0, workFactor);\n    if (r != BZ_OK) {\n#ifdef __DEBUG__\n        fprintf(stdout, \"Compression error: %d\\n\", r);\n#endif\n        free(zbuf);\n        return 0;\n    }\n\n    nOut = size*2;\n    char *outbuf = malloc(nOut);\n    small = size % 2;\n    r = BZ2_bzBuffToBuffDecompress(outbuf, &nOut, zbuf, nZ, small,\n            /*verbosity=*/0);\n    if (r != BZ_OK) {\n#ifdef __DEBUG__\n        fprintf(stdout, \"Decompression error: %d\\n\", r);\n#endif\n        free(zbuf);\n        free(outbuf);\n        return 0;\n    }\n\n    assert(nOut == size);\n    assert(memcmp(data, outbuf, size) == 0);\n    free(zbuf);\n    free(outbuf);\n    return 0;\n}"
  },
  {
    "path": "projects/bzip2/bzip2_decompress_target.c",
    "content": "/*\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n*/\n\n#include \"bzlib.h\"\n#include <stdint.h>\n#include <stdlib.h>\n#include <assert.h>\n#include <string.h>\n\nextern int BZ2_bzBuffToBuffDecompress(char* dest,\n                                      unsigned int* destLen,\n                                      char*         source,\n                                      unsigned int  sourceLen,\n                                      int           small,\n                                      int           verbosity);\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    int r, small;\n    unsigned int nZ, nOut;\n\n    // See: https://github.com/google/bzip2-rpc/blob/master/unzcrash.c#L39\n    nOut = size*2;\n    char *outbuf = malloc(nOut);\n    small = size % 2;\n    r = BZ2_bzBuffToBuffDecompress(outbuf, &nOut, (char *)data, size,\n            small, /*verbosity=*/0);\n\n    if (r != BZ_OK) {\n#ifdef __DEBUG__\n        fprintf(stdout, \"Decompression error: %d\\n\", r);\n#endif\n    }\n    free(outbuf);\n    return 0;\n}"
  },
  {
    "path": "projects/bzip2/bzip2_fd.c",
    "content": "/*\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n*/\n\n#include \"bzlib.h\"\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n#include <stdio.h>\n#include <fcntl.h>\n\nstatic void fuzzer_write_data(FILE *file, const uint8_t *data, size_t size) {\n  int    bzerr         = 0;\n  int    blockSize100k = 9;\n  int    verbosity     = 0;\n  int    workFactor    = 30;\n  unsigned int nbytes_in_lo32, nbytes_in_hi32;\n  unsigned int nbytes_out_lo32, nbytes_out_hi32;\n\n  BZFILE* bzf = BZ2_bzWriteOpen(&bzerr, file,\n                           blockSize100k, verbosity, workFactor);\n  if (bzerr != BZ_OK) return;\n\n  /* Use low-level BZ2_bzWrite (was incorrectly using high-level BZ2_bzwrite) */\n  BZ2_bzWrite(&bzerr, bzf, (void*)data, size);\n\n  BZ2_bzWriteClose64(&bzerr, bzf, 0,\n                      &nbytes_in_lo32, &nbytes_in_hi32,\n                      &nbytes_out_lo32, &nbytes_out_hi32);\n}\n\nstatic void fuzzer_read_data(const int file_descriptor) {\n  int    bzerr         = 0;\n  char   obuf[BZ_MAX_UNUSED];\n\n  BZFILE* bzf2 = BZ2_bzdopen(file_descriptor, \"rb\");\n  if (!bzf2) return;\n\n  while (bzerr == BZ_OK) {\n      int nread = BZ2_bzRead(&bzerr, bzf2, obuf, BZ_MAX_UNUSED);\n      if (nread == 0 && bzerr == BZ_OK) break;\n  }\n\n  BZ2_bzclose(bzf2);\n}\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  char* filename = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n  if (!filename) {\n    return 0;\n  }\n  const int file_descriptor = mkstemp(filename);\n  if (file_descriptor < 0) {\n    free(filename);\n    return 0;\n  }\n  FILE* file = fdopen(file_descriptor, \"wb\");\n\n  if (!file) {\n    close(file_descriptor);\n    free(filename);\n    return 0;\n  }\n\n  fuzzer_write_data(file, data, size);\n\n  fflush(file);\n\n  int read_fd = open(filename, O_RDONLY);\n  if (read_fd >= 0) {\n    fuzzer_read_data(read_fd);\n  }\n\n  /* Removed BZ2_bzflush(file) - it expects BZFILE*, not FILE* */\n  fclose(file);\n\n  unlink(filename);\n  free(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/bzip2/bzip2_filename.c",
    "content": "/*\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n*/\n\n#include \"bzlib.h\"\n#include <stdint.h>\n#include <stdlib.h>\n#include <assert.h>\n#include <string.h>\n#include <stddef.h>\n#include <unistd.h>\n#include <stdio.h>\n#include <stdbool.h>\n\nstatic void fuzzer_write_data(FILE *file, const uint8_t *data, size_t size) {\n  int    bzerr         = 0;\n  int    blockSize100k = 9;\n  int    verbosity     = 0;\n  int    workFactor    = 30;\n  uint   nbytes_in_lo32, nbytes_in_hi32;\n  uint   nbytes_out_lo32, nbytes_out_hi32;\n\n  BZFILE* bzf = BZ2_bzWriteOpen ( &bzerr, file,\n                           blockSize100k, verbosity, workFactor );\n\n  BZ2_bzWrite (&bzerr, bzf, (void*)data, size);\n\n  BZ2_bzWriteClose64 ( &bzerr, bzf, 0,\n                        &nbytes_in_lo32, &nbytes_in_hi32,\n                        &nbytes_out_lo32, &nbytes_out_hi32 );\n  return;\n}\n\nstatic void fuzzer_read_data(char *filename) {\n  int    bzerr          = 0;\n  char   obuf[BZ_MAX_UNUSED];\n \n  BZFILE* bzf2 = BZ2_bzopen(filename,\"rb\");\n\n  while (bzerr == BZ_OK) {\n      BZ2_bzRead ( &bzerr, bzf2, obuf, BZ_MAX_UNUSED);\n  }\n\n  BZ2_bzReadClose ( &bzerr, bzf2);\n  return;\n}\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  char* filename = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n  if (!filename) {\n    perror(\"Failed to allocate file name buffer.\");\n    abort();\n  }\n  const int file_descriptor = mkstemp(filename);\n  if (file_descriptor < 0) {\n    perror(\"Failed to make temporary file.\");\n    abort();\n  }\n  FILE* file = fdopen(file_descriptor, \"wb\");\n  if (!file) {\n    perror(\"Failed to open file descriptor.\");\n    close(file_descriptor);\n    abort();\n  }\n\n  fuzzer_write_data(file, data, size);\n\n  fuzzer_read_data(filename);\n\n  BZ2_bzlibVersion();\n\n  BZ2_bzflush(file);\n  fclose(file);\n\n  if (unlink(filename) != 0) {\n    perror(\"WARNING: Failed to delete temporary file.\");\n  }\n  free(filename);\n  return 0;\n}"
  },
  {
    "path": "projects/bzip2/project.yaml",
    "content": "homepage: \"https://sourceware.org/bzip2/\"\nlanguage: c++\nprimary_contact: \"bzip2fuzzer@gmail.com\"\nauto_ccs:\n  - \"bshas3@gmail.com\"\nvendor_ccs:\n  - \"twsmith@mozilla.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\n"
  },
  {
    "path": "projects/bzip2/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/bzip2-tests/run-tests.sh --tests-dir=bzip2-tests/\n"
  },
  {
    "path": "projects/c-ares/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config\nRUN git clone --depth 1 https://github.com/c-ares/c-ares.git\nRUN git clone --depth 1 https://github.com/google/googletest\n\nWORKDIR c-ares\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/c-ares/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/googletest\nmkdir build\ncd build\ncmake ..\nmake -j$(nproc)\nmake install\n\ncd $SRC/c-ares\n\n# Build the project.\n./buildconf\n./configure --enable-debug --enable-tests\nmake clean\nmake -j$(nproc) V=1 all\n\n# Build the fuzzers.\n$CC $CFLAGS -Iinclude -Isrc/lib -c $SRC/c-ares/test/ares-test-fuzz.c -o $WORK/ares-test-fuzz.o\n$CXX $CXXFLAGS -std=c++11 $WORK/ares-test-fuzz.o \\\n    -o $OUT/ares_parse_reply_fuzzer \\\n    $LIB_FUZZING_ENGINE $SRC/c-ares/src/lib/.libs/libcares.a\n\n$CC $CFLAGS -Iinclude -Isrc/lib -c $SRC/c-ares/test/ares-test-fuzz-name.c \\\n    -o $WORK/ares-test-fuzz-name.o\n$CXX $CXXFLAGS -std=c++11 $WORK/ares-test-fuzz-name.o \\\n    -o $OUT/ares_create_query_fuzzer \\\n    $LIB_FUZZING_ENGINE $SRC/c-ares/src/lib/.libs/libcares.a\n\n# Archive and copy to $OUT seed corpus if the build succeeded.\nzip -j $OUT/ares_parse_reply_fuzzer_seed_corpus.zip $SRC/c-ares/test/fuzzinput/*\nzip -j $OUT/ares_create_query_fuzzer_seed_corpus.zip \\\n    $SRC/c-ares/test/fuzznames/*\n"
  },
  {
    "path": "projects/c-ares/project.yaml",
    "content": "homepage: \"https://c-ares.haxx.se/\"\nlanguage: c++\nprimary_contact: \"drysdale@google.com\"\nauto_ccs:\n  - \"daniel.haxx@gmail.com\"\n  - \"brad@brad-house.com\"\nfuzzing_engines:\n  - afl\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/c-ares/c-ares.git'\n"
  },
  {
    "path": "projects/c-ares/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/c-ares/test\nmake test\n"
  },
  {
    "path": "projects/c-blosc/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake make\nRUN git clone --depth 1 https://github.com/Blosc/c-blosc.git c-blosc\nWORKDIR c-blosc\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/c-blosc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build with fuzzer and unit test (Turn on shared build for unit testing only)\n# Shared library of local zstd requires x64 architecture, thus disable it\n# in i386 architecture\nif [ \"$ARCHITECTURE\" = \"i386\" ]; then\n    cmake . -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n            -DBUILD_FUZZERS=ON -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=OFF \\\n            -DBUILD_STATIC=ON -DBUILD_SHARED=ON -DDEACTIVATE_ZSTD=ON\nelse\n    cmake . -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n            -DBUILD_FUZZERS=ON -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=OFF \\\n            -DBUILD_STATIC=ON -DBUILD_SHARED=ON\nfi\nmake clean\nmake -j$(nproc)\n\n# Package seed corpus\nzip -j $OUT/decompress_fuzzer_seed_corpus.zip compat/*.cdata\n\n# Copy the fuzzer executables, zip-ed corpora, and dictionary files to $OUT\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';'\n"
  },
  {
    "path": "projects/c-blosc/project.yaml",
    "content": "homepage: \"https://github.com/Blosc/c-blosc\"\nlanguage: c++\nprimary_contact: \"blosc.oss.fuzz@gmail.com\"\nauto_ccs:\n  - \"nathan.moinvaziri@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/Blosc/c-blosc.git'\n"
  },
  {
    "path": "projects/c-blosc/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\n# Disable leak sanitizer and run unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nctest --test-dir .\n"
  },
  {
    "path": "projects/c-blosc2/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake make\nRUN git clone --depth 1 https://github.com/Blosc/c-blosc2.git c-blosc2\nWORKDIR c-blosc2\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/c-blosc2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build project\nexport LDSHARED=lld\n\n# Build with fuzzer and unit test\ncmake . -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n        -DBUILD_FUZZERS=ON -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=OFF \\\n        -DBUILD_EXAMPLES=OFF -DBUILD_STATIC=ON -DBUILD_SHARED=OFF\nmake clean\nmake -j$(nproc)\n\n# Package seed corpus\nzip -j $OUT/decompress_chunk_fuzzer_seed_corpus.zip compat/*.cdata\nzip -j $OUT/decompress_frame_fuzzer_seed_corpus.zip tests/fuzz/corpus/*\n\n# Copy the fuzzer executables, zip-ed corpora, and dictionary files to $OUT\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';'\n"
  },
  {
    "path": "projects/c-blosc2/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/Blosc/c-blosc2\"\nlanguage: c++\nprimary_contact: \"blosc.oss.fuzz@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/Blosc/c-blosc2.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/c-blosc2/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\n# Disable leak sanitizer and run unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nctest --test-dir .\n"
  },
  {
    "path": "projects/cachetools/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/tkem/cachetools/\nCOPY build.sh *.py $SRC/\nWORKDIR cachetools\n"
  },
  {
    "path": "projects/cachetools/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/cachetools/fuzz_cached.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport cachetools\nimport random\nimport datetime\nfrom threading import Lock\n\ndef get_ttu(_key, value, now):\n    # assume value.ttl contains the item's time-to-live in hours\n    return datetime.datetime.now() + random.random() * datetime.timedelta(days=200000)\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    cache_size = fdp.ConsumeIntInRange(1,32)\n    cache_ttl = fdp.ConsumeProbability()\n    cache_lock = None\n    if fdp.ConsumeBool():\n        cache_lock = Lock()\n\n    # Random caching types\n    CACHE_TYPES = [\n        {},\n        cachetools.FIFOCache(maxsize=cache_size),\n        cachetools.LFUCache(maxsize=cache_size),\n        cachetools.LRUCache(maxsize=cache_size),\n        # cachetools.MRUCache(maxsize=cache_size),\n        cachetools.RRCache(maxsize=cache_size, choice=random.choice),\n        cachetools.TTLCache(maxsize=cache_size, ttl=cache_ttl),\n        cachetools.TLRUCache(maxsize=cache_size, ttu=get_ttu, timer=datetime.datetime.now)\n    ]\n\n    # Generate a random cached function\n    @cachetools.cached(cache=fdp.PickValueInList(CACHE_TYPES), lock=cache_lock, info=fdp.ConsumeBool())\n    def fib(n):\n        return n if n < 2 else fib(n - 1) + fib(n - 2)\n    \n    for i in range(20):\n        fib(fdp.ConsumeIntInRange(1, 20))\n        # Try and get coverage of different properties\n        try:\n            fib.maxsize()\n            fib.currsize()\n        except AttributeError:\n            pass\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    atheris.instrument_all()\n    main()\n"
  },
  {
    "path": "projects/cachetools/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/tkem/cachetools/\nlanguage: python\nmain_repo: https://github.com/tkem/cachetools/\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- sean@compactcloud.co.uk\n"
  },
  {
    "path": "projects/caddy/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth 1  https://github.com/caddyserver/caddy caddy\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/caddy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# We move the caddy folder in here rather than the Dockerfile to make CI work.\n# See here for the failure that triggered this: https://github.com/caddyserver/caddy/pull/4449\nmkdir -p $GOPATH/src/github.com/caddyserver/caddy/\nmv $SRC/caddy $GOPATH/src/github.com/caddyserver/caddy/v2\ncd \"$GOPATH\"/src/github.com/caddyserver/caddy/v2\n\nfind . -name '*_fuzz.go' | while read -r target\ndo\n# Arguments are :\n#     path of the package with the fuzz target\n#     name of the fuzz function\n#     name of the fuzzer to be built\n#     optional tag to be used by go build and such\n\n    fuzzed_func=$(grep -o \"Fuzz[a-zA-Z]\\+\" \"$target\")\n    fuzzer_name=$(echo \"$fuzzed_func\" | sed -E 's/([A-Z])/-\\L\\1/g' | sed 's/^-//')\n    # find the relative directory and remove the first `.` (`./` is removed for root)\n    target_dir=$(dirname \"$target\"); target_dir=\"${target_dir//.}\";\n    target_corpus_name=\"${fuzzer_name}_seed_corpus.zip\"\n\n    curl -s -f -O \"https://raw.githubusercontent.com/caddyserver/caddy/fuzz-seed-corpus/${target_corpus_name}\" || true\n    compile_go_fuzzer github.com/caddyserver/caddy/v2\"$target_dir\" \"$fuzzed_func\" \"$fuzzer_name\" gofuzz\ndone\n"
  },
  {
    "path": "projects/caddy/project.yaml",
    "content": "homepage: \"https://caddyserver.com/\"\nlanguage: go\nprimary_contact: \"msaa1990@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/caddyserver/caddy.git\""
  },
  {
    "path": "projects/caffeine/CaffeineSpecFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.github.benmanes.caffeine.cache.CaffeineSpec;\nimport java.lang.IllegalArgumentException;\n\npublic class CaffeineSpecFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      CaffeineSpec spec = CaffeineSpec.parse(data.consumeRemainingAsString());\n      if (spec == null) {\n        throw new FuzzerSecurityIssueLow(\"null specification\");\n      }\n    } catch (IllegalArgumentException e) {\n      /* documented to be thrown, ignore */\n    } catch (Exception e) {\n      e.printStackTrace(System.out);\n      throw new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n    }\n  }\n}\n"
  },
  {
    "path": "projects/caffeine/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone --depth 1 https://github.com/ben-manes/caffeine\n\nRUN apt update && apt install -y openjdk-11-jdk-headless openjdk-21-jdk-headless\nENV JAVA_HOME /usr/lib/jvm/java-21-openjdk-amd64\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/caffeine\n"
  },
  {
    "path": "projects/caffeine/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nALL_JARS=\"\"\n\npushd \"${SRC}/caffeine\"\n  ./gradlew --no-daemon caffeine:jar\n  install -v ./caffeine/build/libs/caffeine-*-SNAPSHOT.jar \"$OUT/caffeine.jar\"\n  ALL_JARS=\"${ALL_JARS} caffeine.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac --release 11 -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/caffeine/project.yaml",
    "content": "homepage: \"https://github.com/ben-manes/caffeine\"\nlanguage: jvm\nmain_repo: \"https://github.com/ben-manes/caffeine.git\"\nprimary_contact: \"ben.manes@gmail.com\"\nauto_ccs:\n  - \"cpovirk@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/cairo/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y python3-pip gtk-doc-tools libffi-dev autotools-dev libtool gperf\nRUN pip3 install -U meson==1.4.0 ninja packaging\n\nRUN git clone --depth 1 git://git.sv.nongnu.org/freetype/freetype2.git\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/glib\nRUN git clone --depth 1 https://gitlab.freedesktop.org/cairo/cairo.git && \\\n    zip -q $SRC/cairo_seed_corpus.zip $SRC/cairo/test/reference/* && \\\n    zip -q $SRC/svg-render-fuzzer_seed_corpus.zip $SRC/cairo/test/svg/*.svg\n\nADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/png.dict $SRC/cairo.dict\nADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/svg.dict $SRC/svg-render-fuzzer.dict\n\nWORKDIR $SRC/cairo\nCOPY targets $SRC/fuzz\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cairo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nPREFIX=$WORK/prefix\nmkdir -p $PREFIX\n\nexport PKG_CONFIG=\"`which pkg-config` --static\"\nexport PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\nexport PATH=$PREFIX/bin:$PATH\n\nBUILD=$WORK/build\n\nrm -rf $WORK/*\nrm -rf $BUILD\nmkdir -p $BUILD\n\n# Build glib\npushd $SRC/glib/\nmeson \\\n    setup \\\n    --prefix=$PREFIX \\\n    --libdir=lib \\\n    --default-library=static \\\n    -Db_lundef=false \\\n    -Doss_fuzz=enabled \\\n    -Dlibmount=disabled \\\n    _builddir\nninja -C _builddir\nninja -C _builddir install\npopd\n\npushd $SRC/freetype2\n./autogen.sh\n./configure --prefix=\"$PREFIX\" --disable-shared PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"\nmake -j$(nproc)\nmake install\n\n# Build cairo\npushd $SRC/cairo\nCFLAGS=\"-DDEBUG_SVG_RENDER $CFLAGS\" meson \\\n    setup \\\n    --prefix=$PREFIX \\\n    --libdir=lib \\\n    --default-library=static \\\n    _builddir\nninja -C _builddir\nninja -C _builddir install\npopd\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nif [ ! -f \"${OUT}/cairo_seed_corpus.zip\" ]; then\n  echo \"missing seed corpus\"\n  exit 1\nfi\n\nif [ ! -f \"${OUT}/cairo.dict\" ]; then\n  echo \"missing dictionary\"\n  exit 1\nfi\n\nPREDEPS_LDFLAGS=\"-Wl,-Bdynamic -ldl -lm -lc -pthread -lrt -lpthread\"\nDEPS=\"gmodule-2.0 glib-2.0 gio-2.0 gobject-2.0 freetype2 cairo cairo-gobject\"\nBUILD_CFLAGS=\"$CFLAGS `pkg-config --static --cflags $DEPS`\"\nBUILD_LDFLAGS=\"-Wl,-static `pkg-config --static --libs $DEPS`\"\n\nfuzzers=$(find $SRC/fuzz/ -name \"*_fuzzer.c\")\nfor f in $fuzzers ; do\n  fuzzer_name=$(basename $f .c)\n  $CC $CFLAGS $BUILD_CFLAGS \\\n    -c $f -o $WORK/${fuzzer_name}.o\n  $CXX $CXXFLAGS \\\n    $WORK/${fuzzer_name}.o -o $OUT/${fuzzer_name} \\\n    $PREDEPS_LDFLAGS \\\n    $BUILD_LDFLAGS \\\n    $LIB_FUZZING_ENGINE \\\n    -Wl,-Bdynamic\n  cd $OUT; ln -sf cairo_seed_corpus.zip ${fuzzer_name}_seed_corpus.zip\n  cd $OUT; ln -sf cairo.dict ${fuzzer_name}.dict\ndone\n\n# Fuzzers with non-PNG dict/seed corpus.\nfor f in $SRC/cairo/test/svg/fuzzer/svg-render-fuzzer.c ; do\n  fuzzer_name=$(basename $f .c)\n  $CC $CFLAGS $BUILD_CFLAGS \\\n    -c $f -o $WORK/${fuzzer_name}.o\n  $CXX $CXXFLAGS \\\n    $WORK/${fuzzer_name}.o -o $OUT/${fuzzer_name} \\\n    $PREDEPS_LDFLAGS \\\n    $BUILD_LDFLAGS \\\n    $LIB_FUZZING_ENGINE \\\n    -Wl,-Bdynamic\ndone\n"
  },
  {
    "path": "projects/cairo/project.yaml",
    "content": "homepage: https://gitlab.freedesktop.org/cairo/cairo\nlanguage: c\nprimary_contact: security-tps@google.com\nauto_ccs:\n  - \"psychon@znc.in\"\nsanitizers:\n  - address\n  - undefined\nvendor_ccs:\n  - \"jkew@mozilla.com\"\n  - \"jmuizelaar@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nview_restrictions: none\nmain_repo: 'https://gitlab.freedesktop.org/cairo/cairo.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/cairo/targets/fuzzer_temp_file.h",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that\n// require a file instead of an input buffer.\n\n#ifndef FUZZER_TEMP_FILE_H_\n#define FUZZER_TEMP_FILE_H_\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n// Pure-C interface for creating and cleaning up temporary files.\n\nstatic char* fuzzer_get_tmpfile(const uint8_t* data, size_t size) {\n    char* filename_buffer = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n    if (!filename_buffer) {\n        perror(\"Failed to allocate file name buffer.\");\n        abort();\n    }\n    const int file_descriptor = mkstemp(filename_buffer);\n    if (file_descriptor < 0) {\n        perror(\"Failed to make temporary file.\");\n        abort();\n    }\n    FILE* file = fdopen(file_descriptor, \"wb\");\n    if (!file) {\n        perror(\"Failed to open file descriptor.\");\n        close(file_descriptor);\n        abort();\n    }\n    const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);\n    if (bytes_written < size) {\n        close(file_descriptor);\n        fprintf(stderr, \"Failed to write all bytes to file (%zu out of %zu)\",\n                bytes_written, size);\n        abort();\n    }\n    fclose(file);\n    return filename_buffer;\n}\n\nstatic void fuzzer_release_tmpfile(char* filename) {\n    if (unlink(filename) != 0) {\n        perror(\"WARNING: Failed to delete temporary file.\");\n    }\n    free(filename);\n}\n\n// C++ RAII object for creating temporary files.\n\n#ifdef __cplusplus\nclass FuzzerTemporaryFile {\n    public:\n        FuzzerTemporaryFile(const uint8_t* data, size_t size)\n            : filename_(fuzzer_get_tmpfile(data, size)) {}\n\n        ~FuzzerTemporaryFile() { fuzzer_release_tmpfile(filename_); }\n\n        const char* filename() const { return filename_; }\n\n    private:\n        char* filename_;\n};\n#endif\n\n#endif  // FUZZER_TEMP_FILE_H_\n"
  },
  {
    "path": "projects/cairo/targets/pdf_surface_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cairo.h>\n#include <cairo-pdf.h>\n#include \"fuzzer_temp_file.h\"\n\nconst double width_in_inches = 3;\nconst double height_in_inches = 3;\nconst double width_in_points = width_in_inches * 72.0;\nconst double height_in_points = height_in_inches * 72.0;\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    cairo_t *cr;\n    cairo_surface_t *surface;\n    cairo_status_t status;\n\n    if (size == 0) {\n        return 0;\n    }\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    surface = cairo_pdf_surface_create(tmpfile, width_in_points, height_in_points);\n    status = cairo_surface_status(surface);\n    if (status != CAIRO_STATUS_SUCCESS) {\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n\n    char *buf = (char *) calloc(size + 1, sizeof(char));\n    memcpy(buf, data, size);\n    buf[size] = '\\0';\n\n    cairo_pdf_surface_set_metadata(surface, CAIRO_PDF_METADATA_TITLE, buf);\n    cr = cairo_create(surface);\n    cairo_tag_begin(cr, buf, NULL);\n    cairo_tag_end(cr, buf);\n\n    cairo_destroy(cr);\n    cairo_surface_destroy(surface);\n    free(buf);\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/cairo/targets/raster_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cairo.h>\n#include <cairo-pdf.h>\n#include \"fuzzer_temp_file.h\"\n\nstatic cairo_surface_t *\nacquire (cairo_pattern_t *pattern, void *closure,\n\t     cairo_surface_t *target,\n\t     const cairo_rectangle_int_t *extents)\n{\n    return cairo_image_surface_create_from_png(closure);\n}\n\nstatic void\nrelease (cairo_pattern_t *pattern, void *closure, cairo_surface_t *surface)\n{\n    cairo_surface_destroy(surface);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    cairo_t *cr;\n    cairo_surface_t *surface;\n    cairo_pattern_t *pattern;\n    cairo_content_t content;\n    cairo_status_t status;\n    int w, h;\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    surface = cairo_image_surface_create_from_png(tmpfile);\n    status = cairo_surface_status (surface);\n    if (status != CAIRO_STATUS_SUCCESS) {\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n\n    cr = cairo_create(surface);\n    content = cairo_surface_get_content(surface);\n    w = cairo_image_surface_get_width(surface);\n    h = cairo_image_surface_get_height(surface);\n\n    char *buf = (char *) calloc(size + 1, sizeof(char));\n    memcpy(buf, data, size);\n    buf[size] = '\\0';\n\n    pattern = cairo_pattern_create_raster_source(buf, content, w, h);\n    cairo_raster_source_pattern_set_acquire (pattern, acquire, release);\n    cairo_set_source(cr, pattern);\n    cairo_pdf_surface_set_page_label(surface, buf);\n    cairo_pdf_surface_set_metadata(surface, CAIRO_PDF_METADATA_KEYWORDS, buf);\n    cairo_paint(cr);\n\n    cairo_destroy(cr);\n    cairo_pattern_destroy(pattern);\n    cairo_surface_destroy(surface);\n    free(buf);\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/cairo/targets/surface_write_png_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cairo.h>\n#include \"fuzzer_temp_file.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    cairo_surface_t *image;\n    cairo_surface_t *surface;\n    cairo_status_t status;\n    cairo_format_t format;\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    image = cairo_image_surface_create_from_png(tmpfile);\n    status = cairo_surface_status (image);\n    if (status != CAIRO_STATUS_SUCCESS) {\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n\n    format = cairo_image_surface_get_format(image);\n    surface = cairo_image_surface_create_for_data((unsigned char*)data, format, 1, 1, size);\n    status = cairo_surface_status (surface);\n    if (status != CAIRO_STATUS_SUCCESS) {\n        cairo_surface_destroy(image);\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n    cairo_surface_write_to_png(surface, tmpfile);\n\n    cairo_surface_destroy(surface);\n    cairo_surface_destroy(image);\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/cairo/targets/text_glyphs_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cairo.h>\n#include \"fuzzer_temp_file.h\"\n\nconst int glyph_range = 9;\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size < glyph_range) {\n        return 0;\n    }\n    cairo_t *cr;\n    cairo_surface_t *surface;\n    cairo_status_t status;\n    cairo_text_extents_t extents;\n    cairo_text_cluster_t cluster;\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    surface = cairo_image_surface_create_from_png(tmpfile);\n    status = cairo_surface_status(surface);\n    if (status != CAIRO_STATUS_SUCCESS) {\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n\n    char *buf = (char *) calloc(size + 1, sizeof(char));\n    memcpy(buf, data, size);\n    buf[size] = '\\0';\n\n    cr = cairo_create(surface);\n    cairo_text_extents(cr, buf, &extents);\n    cluster.num_bytes = size;\n    cluster.num_glyphs = 1;\n    for (int i = 0; i < glyph_range; i++) {\n        // Taken from test/text-glyph-range.c\n        cairo_glyph_t glyph = {\n            (long int)data[i], 10 * i, 25\n        };\n        cairo_show_text_glyphs(cr, buf, size, &glyph, 1, &cluster, 1, 0);\n    }\n\n    cairo_destroy(cr);\n    cairo_surface_destroy(surface);\n    free(buf);\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/calcite/.gitignore",
    "content": "project-parent/calcite\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/calcite/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/sql.dict $SRC/SqlParserFuzzer.dict && \\\n    cp fuzzing/dictionaries/sql.dict $SRC/CalciteFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/SqlParserFuzzer_seed_corpus.zip go-fuzz-corpus/sqlparser/corpus/* && \\\n    zip -j $SRC/CalciteFuzzer_seed_corpus.zip go-fuzz-corpus/sqlparser/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/calcite\nRUN git clone --depth 1 https://github.com/apache/calcite/ $SRC/project-parent/calcite\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/calcite/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=calcite\nPROJECT_GROUP_ID=org.apache.calcite\nPROJECT_ARTIFACT_ID=calcite\nMAIN_REPOSITORY=https://github.com/apache/calcite/\n\nGRADLE_ARGS=\"-x test -x javadoc\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  # set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && ./gradlew publishToMavenLocal $GRADLE_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  pushd $PROJECT\n    export CALCITE_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n  popd\n\n  #install\n  (cd $PROJECT && ./gradlew publishToMavenLocal $GRADLE_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/calcite/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>15</java.version>\n        <maven.compiler.source>15</maven.compiler.source>\n        <maven.compiler.target>15</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.calcite</groupId>\n            <artifactId>calcite-core</artifactId>\n           <version>${env.CALCITE_VERSION}</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.hsqldb</groupId>\n            <artifactId>hsqldb</artifactId>\n            <version>2.7.2</version>\n            <scope>test</scope>\n        </dependency>\n\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/calcite/project-parent/fuzz-targets/src/test/java/com/example/CalciteFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.apache.calcite.adapter.jdbc.JdbcSchema;\nimport org.apache.calcite.jdbc.CalciteConnection;\nimport org.apache.calcite.plan.Contexts;\nimport org.apache.calcite.rel.RelNode;\nimport org.apache.calcite.runtime.CalciteException;\nimport org.apache.calcite.schema.SchemaPlus;\nimport org.apache.calcite.sql.SqlNode;\nimport org.apache.calcite.sql.SqlWriter;\nimport org.apache.calcite.sql.parser.SqlParseException;\nimport org.apache.calcite.sql.parser.SqlParser;\nimport org.apache.calcite.sql.pretty.SqlPrettyWriter;\nimport org.apache.calcite.tools.*;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\n\nimport java.sql.*;\nimport javax.sql.DataSource;\nimport java.util.concurrent.atomic.AtomicInteger;\n\n\nclass CalciteFuzzer {\n    static String jdbcUrl;\n    static Connection connection;\n    static CalciteConnection calciteConnection;\n    static DataSource mockDataSource;\n    static SqlParser.Config parserConfig;\n    static SchemaPlus rootSchema;\n\n    @BeforeAll\n    static void setUp() throws SQLException, ClassNotFoundException {\n        Class.forName(\"org.hsqldb.jdbcDriver\");\n\n        jdbcUrl = MockDb.INSTANCE.getUrl();\n        connection = DriverManager.getConnection(jdbcUrl, \"\", \"\");\n\n        try (Statement s = connection.createStatement()) {\n            s.execute(\"create table testtable(\" +\n                    \"key integer,\" +\n                    \"value varchar(25))\");\n\n            s.execute(\"insert into testtable values(1, 'test1')\");\n            s.execute(\"insert into testtable values(2, 'test2')\");\n        }\n\n        mockDataSource = JdbcSchema.dataSource(jdbcUrl, \"org.hsqldb.jdbcDriver\", \"\", \"\");\n    }\n\n    @AfterAll\n    static void cleanUp() {\n        try {\n            connection.close();\n            calciteConnection.close();\n        } catch (Exception e) {\n        }\n    }\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            connection = DriverManager.getConnection(\"jdbc:calcite:\");\n            calciteConnection = connection.unwrap(CalciteConnection.class);\n        } catch (SQLException e) {\n            return;\n        }\n\n        try {\n            int key = data.consumeInt();\n            PreparedStatement preparedStatement = calciteConnection.prepareStatement(\"UPDATE testtable SET value=? WHERE key=\" + key);\n            preparedStatement.setString(key, data.consumeString(5000));\n            preparedStatement.executeUpdate();\n        } catch (SQLException e) {\n        }\n\n        parserConfig = SqlParser.config();\n        rootSchema = calciteConnection.getRootSchema();\n        rootSchema.add(\"exampleSchema\", JdbcSchema.create(rootSchema, \"exampleSchema\", mockDataSource, null, null));\n\n        try {\n            Frameworks.ConfigBuilder configBuilder = Frameworks.newConfigBuilder()\n                    .defaultSchema(rootSchema)\n                    .parserConfig(parserConfig)\n                    .context(Contexts.of(calciteConnection.config()));\n\n            Planner planner = Frameworks.getPlanner(configBuilder.build());\n            SqlNode node = planner.parse(data.consumeString(5000));\n            SqlNode validateNode = planner.validate(node);\n            SqlWriter writer = new SqlPrettyWriter();\n            validateNode.unparse(writer, 0,0);\n        } catch (SqlParseException | ValidationException e) {\n        } catch (AssertionError e) {\n            // Need to catch in order to find more interesting findings.\n        }\n\n        try {\n            FrameworkConfig config = Frameworks.newConfigBuilder()\n                    .defaultSchema(rootSchema)\n                    .build();\n\n            RelBuilder r = RelBuilder.create(config);\n            RelNode node = r\n                    .scan(\"exampleSchema\", \"TESTTABLE\")\n                    .filter(r.equals(r.field(data.consumeString(1000)), r.literal(data.consumeInt())))\n                    .project(r.field(data.consumeString(1000)), r.field(data.consumeRemainingAsString()))\n                    .build();\n\n            RelRunner runner = connection.unwrap(RelRunner.class);\n            PreparedStatement ps = runner.prepareStatement(node);\n            ps.execute();\n            ps.getResultSet();\n        } catch (SQLException e) {\n        } catch (CalciteException | IllegalArgumentException e) {\n            // Need to catch in order to find more interesting findings.\n        }\n    }\n\n    static class MockDb {\n        MockDb() {}\n        static final MockDb INSTANCE = new MockDb();\n        private final AtomicInteger id = new AtomicInteger(1);\n\n        public String getUrl() {\n            return \"jdbc:hsqldb:mem:db\" + id.getAndIncrement();\n        }\n    }\n}"
  },
  {
    "path": "projects/calcite/project-parent/fuzz-targets/src/test/java/com/example/SqlParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.apache.calcite.sql.parser.SqlParser;\nimport org.apache.calcite.sql.parser.SqlParseException;\nimport org.apache.calcite.sql.parser.impl.SqlParserImpl;\n\n\nclass SqlParserFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            SqlParser.Config sqlParserConfig = SqlParser\n                    .configBuilder()\n                    .setParserFactory(SqlParserImpl.FACTORY)\n                    .build();\n            String input = data.consumeRemainingAsString();\n            SqlParser parser = SqlParser.create(input, sqlParserConfig);\n\n            parser.parseQuery();\n            parser.parseStmt();\n            parser.parseStmtList();\n            parser.parseExpression();\n        } catch (SqlParseException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/calcite/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <!-- <module>calcite</module> -->\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/calcite/project.yaml",
    "content": "homepage: \"https://calcite.apache.org/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/calcite/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/calcite-avatica/Base64Fuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.IOException;\nimport org.apache.calcite.avatica.util.Base64;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.apache.calcite.avatica.util.Base64] public static java.lang.String encodeBytes(byte[],int) throws java.io.IOException\npublic class Base64Fuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      if (data.consumeBoolean()) {\n        Base64.encodeBytes(data.consumeRemainingAsBytes());\n      } else {\n        Base64.decode(data.consumeRemainingAsBytes());\n      }\n    } catch (IOException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/calcite-avatica/ConnectStringParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.sql.SQLException;\nimport java.util.Properties;\nimport org.apache.calcite.avatica.ConnectStringParser;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.apache.calcite.avatica.ConnectStringParser] public static java.util.Properties parse(java.lang.String) throws java.sql.SQLException\npublic class ConnectStringParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      ConnectStringParser.parse(data.consumeRemainingAsString());\n    } catch (SQLException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/calcite-avatica/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN git clone --depth 1 https://github.com/apache/calcite-avatica calcite-avatica\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/calcite-avatica\n"
  },
  {
    "path": "projects/calcite-avatica/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\n# Gradle build with gradle wrapper\nrm -rf $HOME/.gradle/caches/\n./gradlew clean build shadowJar -x test\n./gradlew --stop\n\nCURRENT_VERSION=$(./gradlew properties | grep ^version: | cut -d\" \" -f2)\ncp \"./shaded/core/build/libs/avatica-$CURRENT_VERSION-shadow.jar\" $OUT/avatica.jar\nALL_JARS=\"avatica.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/calcite-avatica/project.yaml",
    "content": "homepage: https://github.com/apache/calcite-avatica\nmain_repo: https://github.com/apache/calcite-avatica\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/canvg/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/canvg/canvg\n\nCOPY fuzz.js $SRC/canvg\nCOPY babel.config.json $SRC/canvg\nCOPY package.patch $SRC/canvg\n\nWORKDIR $SRC/canvg\n"
  },
  {
    "path": "projects/canvg/babel.config.json",
    "content": "\n{\n  \"presets\": [\"@babel/preset-typescript\"],\n  \"plugins\": [\n    \"@babel/plugin-transform-modules-commonjs\",\n    \"@babel/plugin-transform-typescript\"\n  ],\n  \"ignore\": [\"**/@jazzer.js\", \"**/@babel\", \"**/istanbul-reports\", \"**/test/**\", \"**/tests/**\", \"**/__tests__/**\"]\n}\n"
  },
  {
    "path": "projects/canvg/build.sh",
    "content": "#!/bin/bash\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# We sadly need some updated dependencies to build canvg\npatch package.json <package.patch\n\n# Install dependencies.\nnpm install -g @babel/cli\nnpm install --save-dev @babel/core \\\n\t@babel/node \\\n\t@babel/plugin-transform-modules-commonjs \\\n\t@babel/plugin-transform-typescript \\\n\t@babel/preset-env \\\n\t@babel/preset-typescript \\\n\t@jazzer.js/core \\\n\tcanvas \\\n\txmldom \\\n\tnode-fetch-commonjs \\\n\ttypescript \\\n\t@types/node\n\n# Build the project.\nnpm i\n# FIXME: This fails at some point but the build succeeds to a point\n# that we can use the fuzzer. So we ignore the error for now.\nnpm run build || true\n\nfunction change_type_to_commonjs() {\n\t# Find all package.json files inside the node_modules directory\n\tfind \"$1\" -name \"package.json\" -type f | while read -r package_file; do\n\t\t# Check if the file contains the \"type\" field\n\t\tif grep -q '\"type\": \"module\"' \"$package_file\"; then\n\t\t\t# Replace \"type\": \"module\" with \"type\": \"commonjs\"\n\t\t\tsed -i 's/\"type\": \"module\"/\"type\": \"commonjs\"/' \"$package_file\"\n\t\t\techo \"Updated $package_file\"\n\t\tfi\n\tdone\n}\n\nfunction transform_dir_into_commonjs() {\n\tbabel \"$1\" --keep-file-extension -D -d \"$1\"_commonjs\n\trm -r \"$1\"\n\tmv \"$1\"_commonjs \"$1\"\n}\n\nfunction remove_dev_dependencies() {\n\tpackage_json=$(cat package.json)\n\n\t# Remove the \"devDependencies\" item from package.json\n\tnew_package_json=$(echo \"$package_json\" | jq 'del(.devDependencies)')\n\n\t# Overwrite the package.json file with the updated content\n\techo \"$new_package_json\" >package.json\n\n}\n\ntransform_dir_into_commonjs \"$SRC/canvg/src\"\ntransform_dir_into_commonjs \"$SRC/canvg/dist\"\nchange_type_to_commonjs \"$SRC/canvg\"\n\n# Build Fuzzers.\ncompile_javascript_fuzzer canvg fuzz.js -i canvg\n"
  },
  {
    "path": "projects/canvg/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst canvg = require('./dist/index.js');\nconst canvas = require('canvas');\nconst fetch = require(\"node-fetch-commonjs\");\nconst { DOMParser } = require('xmldom');\n\nconst preset = canvg.presets.node({\n  DOMParser,\n  canvas,\n  fetch\n});\n\nmodule.exports.fuzz = async function(data) {\n  try {\n    const provider = new FuzzedDataProvider(data);\n    const func = provider.consumeIntegralInRange(0, 3);\n    const canvasWidth = provider.consumeIntegralInRange(0, 9999);\n    const canvasHeight = provider.consumeIntegralInRange(0, 9999);\n    const svgStr = provider.consumeRemainingAsString();\n\n    switch (func) {\n      case 0:\n        const canvas = preset.createCanvas(canvasWidth, canvasHeight);\n        const ctx = canvas.getContext('2d');\n        const svg = canvg.Canvg.fromString(ctx, svgStr, preset);\n        await svg.render();\n        canvas.toBuffer();\n        break;\n      case 1:\n        const parser = new canvg.Parser({ DOMParser: DOMParser });\n        parser.parse(svgStr);\n        break;\n      case 2:\n        const canvgInstance = new canvg.Canvg('', svgStr, preset);\n        canvgInstance.start();\n        canvgInstance.stop();\n        break;\n      case 3:\n        const canvgInstance2 = new canvg.Canvg('', svgStr, preset);\n        canvgInstance2.start();\n        await new Promise(resolve => setTimeout(resolve, 1000));\n        canvgInstance2.stop();\n        break;\n    }\n\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [\n  \"Cannot read properties\",\n  \"Cannot set properties\",\n  \"Attribute class redefined\",\n  \"Expected positive number\",\n  \"Unterminated command\",\n  \"Unexpected character\",\n  \"Attribute height redefined\",\n  \"Attribute\",\n  \"Invalid number ending\",\n  \"Expected a flag\",\n  \"end tag name\",\n];\n\n"
  },
  {
    "path": "projects/canvg/package.patch",
    "content": "diff --git a/package.json b/package.json\nindex fe964f2..1fe1188 100644\n--- a/package.json\n+++ b/package.json\n@@ -92,8 +92,8 @@\n     \"@rollup/plugin-node-resolve\": \"^13.0.5\",\n     \"@rollup/plugin-replace\": \"^4.0.0\",\n     \"@size-limit/preset-small-lib\": \"^7.0.8\",\n-    \"@swc/core\": \"^1.2.136\",\n-    \"@swc/helpers\": \"^0.3.2\",\n+    \"@swc/core\": \"^1.3.66\",\n+    \"@swc/helpers\": \"^0.5.0\",\n     \"@swc/jest\": \"^0.2.17\",\n     \"@trigen/babel-preset\": \"^8.0.0-alpha.5\",\n     \"@trigen/browserslist-config\": \"^8.0.0-alpha.2\",\n\n"
  },
  {
    "path": "projects/canvg/project.yaml",
    "content": "homepage: https://canvg.js.org/\nlanguage: javascript\nmain_repo: https://github.com/canvg/canvg\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/capnproto/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake libtool zlib1g-dev\nRUN git clone --depth 1 https://github.com/capnproto/capnproto\nWORKDIR $SRC/capnproto\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/capnproto/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\ncd c++\nautoreconf -i\n./configure --disable-shared\nmake -j$(nproc)\nmake -j$(nproc) capnp-llvm-fuzzer-testcase\ncp *fuzzer* $OUT/\n"
  },
  {
    "path": "projects/capnproto/project.yaml",
    "content": "homepage: \"https://capnproto.org\"\nlanguage: c++\nprimary_contact: \"security@sandstorm.io\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n  - \"kenton@cloudflare.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/capnproto/capnproto'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/capstone/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make cmake\nRUN pip3 install --upgrade setuptools build wheel pip\nRUN git clone --depth 1 --branch v5 https://github.com/capstone-engine/capstone.git capstonev5\nRUN git clone --depth 1 --branch next https://github.com/capstone-engine/capstone.git capstonenext\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/capstone/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#add next branch\nfor branch in v5 next\ndo\n    cd $SRC/capstone$branch\n    # build project\n    mkdir build\n    # does not seem to work in source directory\n    # + make.sh overwrites CFLAGS\n    cd build\n    cmake -DCAPSTONE_BUILD_SHARED=0 ..\n    make\n\n    cd $SRC/capstone$branch/bindings/python\n    #better debug info\n    sed -i -e 's/#print/print/' capstone/__init__.py\n    (\n    export CFLAGS=\"\"\n    export AFL_NOOPT=1\n    python3 -m pip install .\n    )\n    cd $SRC/capstone$branch/suite\n    mkdir fuzz/corpus\n    find MC/ -name *.cs | ./test_corpus3.py\n    cd fuzz\n    zip -r fuzz_disasm\"$branch\"_seed_corpus.zip corpus/\n    cp fuzz_disasm\"$branch\"_seed_corpus.zip $OUT/\n\n    # export other associated stuff\n    cp fuzz_disasm.options $OUT/fuzz_disasm$branch.options\n\n    cd ../../build\n    # build fuzz target\n    FUZZO=CMakeFiles/fuzz_disasm.dir/suite/fuzz/fuzz_disasm.c.o\n    if [ -f CMakeFiles/fuzz_disasm.dir/suite/fuzz/platform.c.o ]; then\n        FUZZO=\"$FUZZO CMakeFiles/fuzz_disasm.dir/suite/fuzz/platform.c.o\"\n    fi\n    $CXX $CXXFLAGS $FUZZO -o $OUT/fuzz_disasm$branch libcapstone.a $LIB_FUZZING_ENGINE\n\n    python3 -m pip uninstall -y capstone\ndone\n"
  },
  {
    "path": "projects/capstone/project.yaml",
    "content": "homepage: \"https://www.capstone-engine.org\"\nlanguage: c++\nprimary_contact: \"capstone.engine@gmail.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n  - \"stalkr@stalkr.net\"\n  - \"kabeor00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/capstone-engine/capstone.git'\n"
  },
  {
    "path": "projects/cascadia/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/andybalholm/cascadia\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/cascadia\n"
  },
  {
    "path": "projects/cascadia/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncompile_go_fuzzer github.com/andybalholm/cascadia/fuzz Fuzz fuzz\n"
  },
  {
    "path": "projects/cascadia/project.yaml",
    "content": "homepage: \"https://github.com/andybalholm/cascadia\"\nprimary_contact: \"cascadia@balholm.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/andybalholm/cascadia'\n"
  },
  {
    "path": "projects/casync/Dockerfile",
    "content": "# Copyright 2018 Red Hat Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y \\\n        python3-pip pkg-config wget \\\n        liblzma-dev \\\n        libzstd-dev \\\n        libcurl4-openssl-dev \\\n        libssl-dev \\\n        libudev-dev \\\n        zlib1g-dev \\\n        libacl1-dev \\\n        libfuse-dev \\\n        rsync \\\n        udev \\\n        && \\\n    pip3 install meson ninja\nRUN git clone --depth 1 https://github.com/systemd/casync casync\nWORKDIR casync\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/casync/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Red Hat Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ntools/oss-fuzz.sh\n"
  },
  {
    "path": "projects/casync/project.yaml",
    "content": "homepage: \"https://github.com/casync/casync\"\nlanguage: c++\nprimary_contact: \"lennart@poettering.net\"\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nauto_ccs:\n  - zbyszek@in.waw.pl\n  - poettering@gmail.com\n  - fsumsal@redhat.com\nmain_repo: 'https://github.com/systemd/casync'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/catapult/project.yaml",
    "content": "homepage: \"https://github.com/nemtech/catapult-server\"\nmain_repo: \"https://github.com/nemtech/catapult-server\"\nprimary_contact: \"wayonb@gmail.com\"\nauto_ccs:\n  - \"gimer.outer.space@gmail.com\"\n  - \"jaguar5pow4@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\n"
  },
  {
    "path": "projects/cbor-java/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://android.googlesource.com/platform/external/cbor-java cbor-java\n\nWORKDIR cbor-java\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/cbor-java/FuzzDec.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.*;\nimport co.nstant.in.cbor.CborDecoder;\nimport co.nstant.in.cbor.CborException;\n\npublic class FuzzDec {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n    CborDecoder decoder = new CborDecoder(bais);\n    try {\n      decoder.decode();\n    } catch (CborException e) {}\n  }\n}\n"
  },
  {
    "path": "projects/cbor-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=11 -Djavac.target.version=11 -X\"\n$MVN package $MAVEN_ARGS\n\nfind . -name \"cbor-0.8.jar\" -exec cp {} $OUT/cbor.jar \\;\n\nALL_JARS=\"cbor.jar\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -name 'Fuzz*.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/cbor-java/project.yaml",
    "content": "homepage: \"https://android.googlesource.com/platform/external/cbor-java/+/refs/heads/master\"\nlanguage: jvm\nprimary_contact: \"constantin.rack@gmail.com\"\nmain_repo: \"https://android.googlesource.com/platform/external/cbor-java/+/refs/heads/master\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/cbor2/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth 1 https://github.com/agronholm/cbor2.git\nWORKDIR cbor2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cbor2/build.sh",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ensure C extension gets built\nexport CBOR2_BUILD_C_EXTENSION=1\n\n# Build and install project (using current CFLAGS, CXXFLAGS). This is required\n# for projects with C extensions so that they're built with the proper flags.\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n    compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/cbor2/project.yaml",
    "content": "homepage: \"https://github.com/agronholm/cbor2\"\nmain_repo: \"https://github.com/agronholm/cbor2\"\nlanguage: python\nprimary_contact: \"alex.gronholm@nextday.fi\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/cctz/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf libgtest-dev libgmock-dev\nRUN git clone --depth 1 https://github.com/google/cctz\n\nCOPY run_tests.sh build.sh $SRC/\nCOPY fuzz_* $SRC/\n\nRUN mkdir -p gtest-build && cd gtest-build && \\\n      cmake /usr/src/googletest && \\\n      make install && rm -rf gtest-build\n\nWORKDIR $SRC/cctz\n"
  },
  {
    "path": "projects/cctz/build.sh",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Set BUILD_TESTING=ON for unit testing in run_tests.sh\nmkdir build && cd build\ncmake -DBUILD_TESTING=ON -DBUILD_BENCHMARK=OFF ../\nmake\n\n# Compile fuzzers\ncp $SRC/fuzz_* .\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./fuzz_cctz.cc ./libcctz.a  -I../include/ -o $OUT/fuzz_cctz\n"
  },
  {
    "path": "projects/cctz/fuzz_cctz.cc",
    "content": "/* Copyright 2020 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <iostream>\n#include <string>\n\n#include \"cctz/civil_time.h\"\n#include \"cctz/time_zone.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tFuzzedDataProvider fuzzed_data(data, size);\n\n\tcctz::time_zone lax;\n\tstd::string tz = fuzzed_data.ConsumeRandomLengthString();\n\tif (load_time_zone(tz, &lax)) {\n\t\tstd::chrono::system_clock::time_point tp;\n\t\tstd::string date_format = fuzzed_data.ConsumeRandomLengthString();\n\t\tstd::string parse_format = fuzzed_data.ConsumeRandomLengthString();\n\t\tcctz::parse(parse_format, date_format, lax, &tp);\n\n\t\tconst auto t1 = cctz::convert(cctz::civil_second(\n\t\t\t\tfuzzed_data.ConsumeIntegral<uint32_t>(),\n\t\t\t\tfuzzed_data.ConsumeIntegral<uint32_t>(),\n\t\t\t\tfuzzed_data.ConsumeIntegral<uint32_t>(),\n\t\t\t\tfuzzed_data.ConsumeIntegral<uint32_t>(),\n\t\t\t\tfuzzed_data.ConsumeIntegral<uint32_t>(),\n\t\t\t\tfuzzed_data.ConsumeIntegral<uint32_t>()), lax);\n\t\tstd::string format = fuzzed_data.ConsumeRandomLengthString();\n\t\tcctz::format(format, t1, lax);\n\t}\n\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/cctz/project.yaml",
    "content": "homepage: https://github.com/google/cctz\nmain_repo: https://github.com/google/cctz\nlanguage: c++\nvendor_ccs:\n- david@adalogics.com\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/cctz/run_tests.sh",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build\n"
  },
  {
    "path": "projects/cel-cpp/.bazelrc",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Force the use of Clang for C++ builds.\nbuild --action_env=CC=clang\nbuild --action_env=CXX=clang++\n\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:oss_fuzz\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=oss-fuzz\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_sanitizer=none\nbuild:oss-fuzz --cxxopt=-stdlib=libc++\nbuild:oss-fuzz --linkopt=-lc++\nbuild:oss-fuzz --verbose_failures\nbuild:oss-fuzz --spawn_strategy=standalone\n"
  },
  {
    "path": "projects/cel-cpp/BUILD",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nload(\"@rules_fuzzing//fuzzing:cc_defs.bzl\", \"cc_fuzz_test\")\n\ncc_fuzz_test(\n\tname = \"fuzz_parse\",\n\tdeps = [\"//parser\"],\n\tsrcs = [\"fuzz_parse.cc\"],\n)\n"
  },
  {
    "path": "projects/cel-cpp/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install python3 openjdk-11-jdk -y\nRUN git clone --depth 1 https://github.com/google/cel-cpp/\nCOPY build.sh $SRC/\nRUN mkdir $SRC/cel-cpp/fuzz/\nCOPY build.sh $SRC/cel-cpp\nCOPY BUILD fuzz*.cc $SRC/cel-cpp/fuzz/\nCOPY MODULE.bazel .bazelrc $SRC/\nRUN cat MODULE.bazel >> $SRC/cel-cpp/MODULE.bazel\nRUN cat .bazelrc >> $SRC/cel-cpp/.bazelrc\nWORKDIR $SRC/cel-cpp\n# This is to fix Fuzz Introspector build by using LLVM old pass manager\n# re https://github.com/ossf/fuzz-introspector/issues/305\nENV OLD_LLVMPASS=1\n"
  },
  {
    "path": "projects/cel-cpp/MODULE.bazel",
    "content": "\nbazel_dep(name = \"rules_fuzzing\", version = \"0.6.0\")\n"
  },
  {
    "path": "projects/cel-cpp/WORKSPACE",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"fuzzing_rules_python\",\n    urls = [\"https://github.com/bazelbuild/rules_python/archive/refs/tags/0.11.0.tar.gz\"],\n    sha256 = \"c03246c11efd49266e8e41e12931090b613e12a59e6f55ba2efd29a7cb8b4258\",\n    strip_prefix = \"rules_python-0.11.0\",\n)\n\nhttp_archive(\n    name = \"rules_fuzzing\",\n    sha256 = \"23bb074064c6f488d12044934ab1b0631e8e6898d5cf2f6bde087adb01111573\",\n    strip_prefix = \"rules_fuzzing-0.3.1\",\n    urls = [\"https://github.com/bazelbuild/rules_fuzzing/archive/v0.3.1.zip\"],\n    repo_mapping = {\n        \"@rules_python\": \"@fuzzing_rules_python\",\n    },\n)\n\nload(\"@rules_fuzzing//fuzzing:repositories.bzl\", \"rules_fuzzing_dependencies\")\n\nrules_fuzzing_dependencies()\n\nload(\"@rules_fuzzing//fuzzing:init.bzl\", \"rules_fuzzing_init\")\n\nrules_fuzzing_init()\n"
  },
  {
    "path": "projects/cel-cpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport USE_BAZEL_VERSION=\"7.3.2\"\nexport CC=${CC:-clang}\nexport CXX=${CXX:-clang++}\n\n# modified version of bazel_build_fuzz_tests to work around issues with\n# bzlmod dependency on rules_fuzzing\n\nbazel build -c opt --config=oss-fuzz //fuzz:fuzz_parse_oss_fuzz\n\nfor oss_fuzz_archive in $(find bazel-bin/ -name \"*oss_fuzz.tar\"); do\n    tar --no-same-owner -xvf \"${oss_fuzz_archive}\" -C \"${OUT}\"\ndone\n\nif [ \"$SANITIZER\" = \"coverage\" ]; then\n    echo \"Collecting the repository source files for coverage tracking.\"\n    declare -r COVERAGE_SOURCES=\"${OUT}/proc/self/cwd\"\n    mkdir -p \"${COVERAGE_SOURCES}\"\n    declare -r RSYNC_FILTER_ARGS=(\n        \"--include\" \"*.h\"\n        \"--include\" \"*.cc\"\n        \"--include\" \"*.hpp\"\n        \"--include\" \"*.cpp\"\n        \"--include\" \"*.c\"\n        \"--include\" \"*.inc\"\n        \"--include\" \"*/\"\n        \"--exclude\" \"*\"\n    )\n    rsync -avLk \"${RSYNC_FILTER_ARGS[@]}\" \\\n        \"$(bazel info execution_root)/\" \\\n        \"${COVERAGE_SOURCES}/\"\nfi"
  },
  {
    "path": "projects/cel-cpp/fuzz_parse.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <string>\n\n#include \"parser/options.h\"\n#include \"parser/parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n    std::string str (reinterpret_cast<const char*>(data), size);\n    google::api::expr::parser::ParserOptions options;\n    options.max_recursion_depth = 128;\n    options.expression_size_codepoint_limit = 1 << 20;\n    try {\n        auto parse_status = google::api::expr::parser::Parse(str, \"fuzzinput\", options);\n        if (!parse_status.ok()) {\n            static_cast<void>(parse_status.status().message());\n        }\n    } catch (const std::exception& e) {\n        return 0;\n    }\n    return 0;\n}\n"
  },
  {
    "path": "projects/cel-cpp/project.yaml",
    "content": "homepage: \"https://cel.dev\"\nlanguage: c++\nprimary_contact: \"tswadell@google.com\"\nauto_ccs :\n- \"jdtatum@google.com\"\n- \"kyessenov@google.com\"\n- \"p.antoine@catenacyber.fr\"\n\nsanitizers:\n- address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\nmain_repo: 'https://github.com/google/cel-cpp'\nfile_github_issue: True\n\nfuzzing_engines:\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/cel-go/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/google/cel-go\n\nRUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev binutils cmake \\\n   ninja-build liblzma-dev libz-dev pkg-config autoconf libtool\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN mkdir LPM; \\\n  cd LPM; \\\n  cmake $SRC/libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release; \\\n  ninja;\n\nRUN git clone --depth 1 https://github.com/mdempsky/go114-fuzz-build.git\n\nRUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n\nCOPY go-lpm.cc $SRC/\n\nCOPY fuzz*.go $SRC/cel-go/cel/\nCOPY build.sh $SRC/\nCOPY *.proto $SRC/\nWORKDIR $SRC/cel-go\n"
  },
  {
    "path": "projects/cel-go/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir fuzzlpm\n$SRC/LPM/external.protobuf/bin/protoc --cpp_out=fuzzlpm/ -I$SRC/ $SRC/cel-go-lpm.proto\n\n$CXX $CXXFLAGS -DNDEBUG -c -I fuzzlpm/ -I $SRC/LPM/external.protobuf/include fuzzlpm/cel-go-lpm.pb.cc\n$CXX $CXXFLAGS -DNDEBUG -c -I. -I ../libprotobuf-mutator/ -I $SRC/LPM/external.protobuf/include $SRC/go-lpm.cc\n\n(\ncd $SRC/go114-fuzz-build\nsed -i -e 's/LLVMFuzzerTestOneInput/LPMFuzzerTestOneInput/' main.go\ngo build\n)\n\n$SRC/LPM/external.protobuf/bin/protoc --go_out=fuzzlpm/ -I$SRC/ $SRC/cel-go-lpm.proto\ncp fuzzlpm/github.com/google/cel-go/cel/*.pb.go cel/\n\n$SRC/go114-fuzz-build/go114-fuzz-build -func FuzzEval -o fuzz_lpm.a github.com/google/cel-go/cel\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE cel-go-lpm.pb.o go-lpm.o \\\n  fuzz_lpm.a \\\n  $SRC/LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n  $SRC/LPM/src/libprotobuf-mutator.a \\\n  -Wl,--start-group $SRC/LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n  -o $OUT/fuzz_lpm\n\ncompile_go_fuzzer github.com/google/cel-go/cel FuzzCompile fuzz_compile\n"
  },
  {
    "path": "projects/cel-go/cel-go-lpm.proto",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nsyntax = \"proto3\";\npackage celgolpm;\n\noption go_package = \"github.com/google/cel-go/cel\";\n\nmessage FuzzVariables {\n  string expr = 1;\n  map<string,string> inputs = 2;\n}\n"
  },
  {
    "path": "projects/cel-go/fuzz_compile.go",
    "content": "package cel\n\nfunc FuzzCompile(data []byte) int {\n\tenv, err := getCELFuzzEnv()\n\tif err != nil {\n\t\tpanic(\"impossible to create env\")\n\t}\n\tast, issues := env.Compile(string(data))\n\tif issues != nil && issues.Err() != nil {\n\t\treturn 0\n\t}\n\t_, err = env.Program(ast)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn 1\n}\n"
  },
  {
    "path": "projects/cel-go/fuzz_env.go",
    "content": "package cel\n\n// Create environment for running under Address sanitizer without timing out.\nfunc getCELFuzzEnv() (*Env, error) {\n\t// Very dense expressions (balanced trees) can cause address sanitizer to\n\t// timeout even though they typically fail in under a second uninstrumented.\n\treturn NewEnv(ParserRecursionLimit(60))\n}\n"
  },
  {
    "path": "projects/cel-go/fuzz_eval.go",
    "content": "package cel\n\nimport (\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"github.com/google/cel-go/checker/decls\"\n\texprpb \"google.golang.org/genproto/googleapis/api/expr/v1alpha1\"\n)\n\nfunc FuzzEval(data []byte) int {\n\tgen := &FuzzVariables{}\n\terr := proto.Unmarshal(data, gen)\n\tif err != nil {\n\t\tpanic(\"Failed to unmarshal LPM generated variables\")\n\t}\n\n\tdeclares := make([]*exprpb.Decl, 0, len(gen.Inputs))\n\tfor k, _ := range gen.Inputs {\n\t\tdeclares = append(declares, decls.NewVar(k, decls.String))\n\t}\n\tenv, err := getCELFuzzEnv()\n\tif err != nil {\n\t\tpanic(\"impossible to create env\")\n\t}\n\n\tenv, err = env.Extend(Declarations(declares...))\n\tif err != nil {\n\t\tpanic(\"impossible to create env\")\n\t}\n\n\tast, issues := env.Compile(gen.Expr)\n\tif issues != nil && issues.Err() != nil {\n\t\treturn 0\n\t}\n\tprg, err := env.Program(ast)\n\tif err != nil {\n\t\treturn 0\n\t}\n\t//fmt.Printf(\"loltry %#+v\\n\", gen)\n\n\t_, _, err = prg.Eval(gen.Inputs)\n\n\treturn 1\n}\n"
  },
  {
    "path": "projects/cel-go/go-lpm.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"fuzzlpm/cel-go-lpm.pb.h\"\n#include \"src/libfuzzer/libfuzzer_macro.h\"\n\nextern \"C\" void  LPMFuzzerTestOneInput(const uint8_t *buffer, size_t size);\n\nDEFINE_PROTO_FUZZER(const celgolpm::FuzzVariables& input) {\n    size_t size = input.ByteSizeLong();\n    if (size > 0) {\n        uint8_t *buffer = (uint8_t *) malloc(size);\n        //printf(\"debugs %d: %s\\n\", size, input.DebugString().c_str());\n        input.SerializeToArray((uint8_t *) buffer, size);\n        LPMFuzzerTestOneInput(buffer, size);\n        free(buffer);\n    }\n}\n"
  },
  {
    "path": "projects/cel-go/project.yaml",
    "content": "homepage: \"https://opensource.google/projects/cel\"\nprimary_contact: \"tswadell@google.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/google/cel-go'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/cert-manager/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/cert-manager/cert-manager --depth=1\nCOPY build.sh pki_fuzzer.go $SRC/\nWORKDIR $SRC/cert-manager\n"
  },
  {
    "path": "projects/cert-manager/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/pki_fuzzer.go $SRC/cert-manager/pkg/util/pki/\n\n# These test files break the build, so removing; the fuzz tests don't need them\nrm $SRC/cert-manager/pkg/controller/certificates/trigger/trigger_controller_test.go\nrm $SRC/cert-manager/pkg/controller/certificates/revisionmanager/revisionmanager_controller_test.go\n\ncd $SRC/cert-manager\ngo mod tidy\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/internal/webhook/admission/certificaterequest/approval FuzzValidate FuzzValidate_approval\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificates/trigger FuzzProcessItem FuzzProcessItem_trigger\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificates/revisionmanager FuzzProcessItem FuzzProcessItem_revisionmanager\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificates/issuing FuzzProcessItem FuzzProcessItem_issuing\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificates/readiness FuzzProcessItem FuzzProcessItem_readiness\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificates/keymanager FuzzProcessItem FuzzProcessItem_keymanager\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificates/requestmanager FuzzProcessItem FuzzProcessItem_requestmanager\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificaterequests/vault FuzzVaultCRController FuzzVaultCRController\ncompile_native_go_fuzzer_v2 github.com/cert-manager/cert-manager/pkg/controller/certificaterequests/venafi FuzzVenafiCRController FuzzVenafiCRController\ncompile_go_fuzzer github.com/cert-manager/cert-manager/pkg/util/pki FuzzUnmarshalSubjectStringToRDNSequence FuzzUnmarshalSubjectStringToRDNSequence\ncompile_go_fuzzer github.com/cert-manager/cert-manager/pkg/util/pki FuzzDecodePrivateKeyBytes FuzzDecodePrivateKeyBytes\n\n"
  },
  {
    "path": "projects/cert-manager/pki_fuzzer.go",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage pki\n\nfunc FuzzUnmarshalSubjectStringToRDNSequence(data []byte) int {\n\tUnmarshalSubjectStringToRDNSequence(string(data))\n\treturn 1\n}\n\nfunc FuzzDecodePrivateKeyBytes(data []byte) int {\n\tDecodePrivateKeyBytes(data)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/cert-manager/project.yaml",
    "content": "homepage: \"https://cert-manager.io\"\n# Send reports to the cert-manager-security distribution list.\n# - https://cert-manager.io/docs/contributing/security/\n# - https://github.com/cert-manager/community/blob/main/SECURITY.md#reporting-process\nprimary_contact: \"cert-manager-security@googlegroups.com\"\n# Allow people listed in maintainers.csv file to sign in to https://oss-fuzz.com/\n# - https://github.com/cert-manager/community/blob/main/maintainers.csv\nauto_ccs:\n  - \"ashley.davis@venafi.com\" # Ashley Davis,sgtcodfish,Venafi\n  - \"i@am.so-aweso.me\"        # Jake Sanders,jakexks,G-Research\n  - \"irbekrm@gmail.com\"       # Irbe Krumina,irbekrm,Tailscale\n  - \"jmunnelly@apple.com\"     # James Munnelly,munnerz,Apple\n  - \"mael.valais@gmail.com\"   # Maël Valais,maelvls,Venafi\n  - \"me@joshvanl.dev\"         # Josh van Leeuwen,joshvanl,Diagrid\n  - \"richard.wall@venafi.com\" # Richard Wall,wallrj,Venafi\n  - \"tim.ramlot@venafi.com\"   # Tim Ramlot,inteon,Venafi\nvendor_ccs :\n  - \"adam@adalogics.com\"      # Adam Korczynski,AdamKorcz,ADALogics\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/cert-manager/cert-manager'\n"
  },
  {
    "path": "projects/cfengine/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n  build-essential libpcre2-dev libtool autoconf automake bison flex libssl-dev \\\n  libbison-dev libacl1 libacl1-dev lmdb-utils liblmdb-dev libpam0g-dev libtool \\\n  libyaml-dev libxml2-dev\n\n\nRUN git clone --branch pcre2-10.39 https://github.com/PhilipHazel/pcre2 pcre2 && \\\n  cd pcre2 && \\\n  ./autogen.sh && \\\n  ./configure && \\\n  make all && \\\n  make install && \\\n  sed -i \"s/\\$libS\\$libR \\(-lpcre2-8$\\)/\\$libS\\$libR -Wl,-Bstatic \\1 -Wl,-Bdynamic/\" /usr/local/bin/pcre2-config\n\nRUN git clone --depth=1 https://github.com/librsync/librsync\nRUN git clone --depth 1 https://github.com/cfengine/core --recursive\nWORKDIR core\nCOPY build.sh string_fuzzer.c $SRC/\n"
  },
  {
    "path": "projects/cfengine/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/librsync\ncmake . -DBUILD_SHARED_LIBS=OFF\nmake install\n\ncd $SRC/core\n./autogen.sh\n./configure --enable-static --disable-shared\nmake V=1 -j$(nproc)\n\ncd libpromises\nmv $SRC/string_fuzzer.c .\nfind . -name \"*.o\" -exec ar rcs fuzz_lib.a {} \\;\n$CC $CFLAGS -I./ -c string_fuzzer.c -o string_fuzzer.o\n$CC $CXXFLAGS $LIB_FUZZING_ENGINE string_fuzzer.o \\\n    -o $OUT/string_fuzzer fuzz_lib.a \\\n    ../libntech/libutils/.libs/libutils.a\n"
  },
  {
    "path": "projects/cfengine/project.yaml",
    "content": "homepage: \"https://github.com/cfengine/core\"\nmain_repo: \"https://github.com/cfengine/core\"\nlanguage: c++\nprimary_contact: \"vratislav.podzimek@northern.tech\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n  - memory\n"
  },
  {
    "path": "projects/cfengine/string_fuzzer.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <string_expressions.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n    if(size<4) {\n        return 0;\n    }\n    for (int i=0; i<size; i++) {\n        if(data[i]==0) {\n            return 0;\n        }\n    }\n    char *new_str = (char *)malloc(size+1);\n    if (new_str == NULL){\n        return 0;\n    }\n    memcpy(new_str, data, size);\n    new_str[size] = '\\0';\n    int len = strlen(new_str);\n\n    StringParseResult res = ParseStringExpression(new_str, 0, len);\n\n    FreeStringExpression(res.result);\n    free(new_str);\n    return 0;\n}\n"
  },
  {
    "path": "projects/cffi/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get install -y libffi-dev mercurial\nRUN hg clone https://foss.heptapod.net/pypy/cffi cffi\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/cffi\n"
  },
  {
    "path": "projects/cffi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/cffi/fuzz_recompiler.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom cffi import FFI, VerificationError, FFIError, CDefError\nfrom cffi import recompiler\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  ffi = FFI()\n  try:\n    ffi.cdef(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    recomp = recompiler.Recompiler(ffi, 'fuzzmod')\n\n    # Call functions on the recompiler object.\n    recomp.collect_type_table()\n    recomp.collect_step_tables()\n  except (VerificationError, FFIError, CDefError) as e:\n    pass\n  except AssertionError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/cffi/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://foss.heptapod.net/pypy/cffi\nlanguage: python\nmain_repo: https://foss.heptapod.net/pypy/cffi\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/cgif/Dockerfile",
    "content": "# Copyright 2023 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip zip\nRUN pip3 install meson ninja\nRUN git clone --depth 1 https://github.com/dloebl/cgif.git\nWORKDIR cgif\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/cgif/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build and install cgif\nmeson setup -Dfuzzer=true --prefix=$WORK --libdir=lib --default-library=static build\nmeson install -C build\n# run tests:\n# This is going to generate the seed corpus from all the tests\nmeson test -C build\n\ncp \"build/fuzz/cgif_fuzzer_seed_corpus.zip\" $OUT/.\ncp \"build/fuzz/cgif_file_fuzzer_seed_corpus.zip\" $OUT/.\ncp \"build/fuzz/cgif_rgb_fuzzer_seed_corpus.zip\" $OUT/.\n\n# build cgif's fuzz targets\n$CXX $CXXFLAGS -o \"$OUT/cgif_fuzzer\" -I\"$WORK/include\" \\\n  $LIB_FUZZING_ENGINE fuzz/cgif_fuzzer.c \"$WORK/lib/libcgif.a\"\n\n$CXX $CXXFLAGS -o \"$OUT/cgif_file_fuzzer\" -I\"$WORK/include\" \\\n  $LIB_FUZZING_ENGINE fuzz/cgif_file_fuzzer.c \"$WORK/lib/libcgif.a\"\n\n$CXX $CXXFLAGS -o \"$OUT/cgif_rgb_fuzzer\" -I\"$WORK/include\" \\\n  $LIB_FUZZING_ENGINE fuzz/cgif_rgb_fuzzer.c \"$WORK/lib/libcgif.a\"\n"
  },
  {
    "path": "projects/cgif/project.yaml",
    "content": "homepage: \"https://github.com/dloebl/cgif\"\nlanguage: c\nprimary_contact: \"dloebl.2000@gmail.com\"\nauto_ccs:\n  - \"matthias.loebl@rwth-aachen.de\"\nsanitizers:\n- address\n- undefined\n- memory\narchitectures:\n  - x86_64\n  - i386\nmain_repo: \"https://github.com/dloebl/cgif.git\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/cgif/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmeson test -C build\n"
  },
  {
    "path": "projects/cglib/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nENV JAVA_HOME $JAVA_15_HOME\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $JAVA_HOME/bin:$PATH\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/cglib/cglib\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/cglib\n"
  },
  {
    "path": "projects/cglib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#\n# cglib uses different variables for the java version.\n#\nMVN_FLAGS=\"-Dmaven.compiler.source=15 -Dmaven.compiler.target=15 -DskipTests  -Djava.version.source=15 -Djava.version.target=15 -Djavac.target=15\"\nALL_JARS=\"\"\n\n# install the build servers' jazzer-api into the maven repository\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/cglib\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -DcglibVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/cglib-fuzzer-${CURRENT_VERSION}.jar ${OUT}/cglib-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} cglib-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n  stripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n  # the .java was stripped by sed\n  if (echo ${stripped_path} | grep \".java$\"); then\n\tcontinue;\n  fi\n\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  fuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\n\nexport JAVA_HOME=$JAVA_15_HOME\nexport JVM_LD_LIBRARY_PATH=$JAVA_HOME/lib/server\nexport PATH=$JAVA_HOME/bin:$PATH\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n  chmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/cglib/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>cglib-fuzzer</artifactId>\n\t<version>${cglibVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<exec.mainClass>ossfuzz.ASTFuzzer</exec.mainClass>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\ton the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\tto avoid mismatching driver/api versions\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<!-- https://mvnrepository.com/artifact/cglib/cglib -->\n\t\t<dependency>\n\t\t\t<groupId>cglib</groupId>\n\t\t\t<artifactId>cglib</artifactId>\n\t\t\t<version>${cglibVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/cglib/project.yaml",
    "content": "homepage: \"https://github.com/cglib/cglib/wiki\"\nlanguage: jvm\nmain_repo: \"https://github.com/cglib/cglib\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/cglib/src/main/java/ossfuzz/EnhancerFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport java.lang.reflect.Method;\nimport net.sf.cglib.proxy.Enhancer;\nimport net.sf.cglib.proxy.FixedValue;\nimport net.sf.cglib.proxy.MethodInterceptor;\nimport net.sf.cglib.proxy.MethodProxy;\n\nclass SampleClass {\n\n\tString test() {\n\t\treturn \"Hello World\";\n\t}\n\n\tString test(String string) {\n\t\treturn string;\n\t}\n};\n\nclass FixedValueCallback implements FixedValue {\n\tFixedValueCallback(String string) {\n\t\tm_string = string;\n\t}\n\n\t@Override\n\tpublic Object loadObject() throws Exception {\n\t\treturn m_string;\n\t}\n\n\tpublic String getString() {\n\t\treturn m_string;\n\t}\n\n\tprotected String m_string;\n}\n\nclass MethodInterceptorCallback implements MethodInterceptor {\n\n\tMethodInterceptorCallback(String string) {\n\t\tm_string = string;\n\t}\n\n\t@Override\n\tpublic Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {\n\t\tif (method.getDeclaringClass() == SampleClass.class) {\n\t\t\tif (method.getParameterCount() == 0) {\n\t\t\t\treturn m_string;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn proxy.invokeSuper(obj, args);\n\t}\n\n\tpublic String getString() {\n\t\treturn m_string;\n\t}\n\n\tprotected String m_string;\n}\n\npublic class EnhancerFuzzer {\n\n\tpublic static void fixedValueCallback(FuzzedDataProvider fuzzedDataProvider) {\n\t\tEnhancer enhancer = new Enhancer();\n\t\tenhancer.setSuperclass(SampleClass.class);\n\n\t\tFixedValueCallback fixedValueCallback = new FixedValueCallback(fuzzedDataProvider.consumeRemainingAsString());\n\t\tenhancer.setCallback(fixedValueCallback);\n  \n\t\tSampleClass proxy = (SampleClass) enhancer.create();\n\t\tif (!proxy.test().equals(fixedValueCallback.getString())) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"FixedValue defect\");\n\t\t}\n\t\tif (!proxy.test(\"someString\").equals(fixedValueCallback.getString())) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"FixedValue defect\");\n\t\t}\n\t}\n\n\tpublic static void methodInterceptorCallback(FuzzedDataProvider fuzzedDataProvider) {\n\t\t\n\t\tEnhancer enhancer = new Enhancer();\n\t\tenhancer.setSuperclass(SampleClass.class);\n\n\t\tMethodInterceptorCallback methodInterceptorCallback = new MethodInterceptorCallback(fuzzedDataProvider.consumeString(5));\n\t\tenhancer.setCallback(methodInterceptorCallback);\n  \n\t\tSampleClass proxy = (SampleClass) enhancer.create();\n\t\tif (!proxy.test().equals(methodInterceptorCallback.getString())) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"MethodInterceptor defect\");\n\t\t}\n\n\t\tString argument = fuzzedDataProvider.consumeRemainingAsString();\n\t\tif (!proxy.test(argument).equals(argument)) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"MethodInterceptor defect\");\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\tfixedValueCallback(fuzzedDataProvider);\n\t\tmethodInterceptorCallback(fuzzedDataProvider);\n\t}\n}"
  },
  {
    "path": "projects/chardet/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/erikrose/chardet chardet\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/chardet\n"
  },
  {
    "path": "projects/chardet/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/chardet/fuzz_detector.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport chardet\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  # General detection.\n  chardet.detect(data)\n\n  # Incremental feeding>\n  detector = chardet.universaldetector.UniversalDetector()\n  for b in data:\n    detector.feed(b)\n    if detector.done:\n      break\n  detector.close()\n  res = detector.result\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/chardet/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/erikrose/chardet\nlanguage: python\nmain_repo: https://github.com/erikrose/chardet\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/charset_normalizer/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/jawah/charset_normalizer charset_normalizer\nWORKDIR charset_normalizer\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/charset_normalizer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Enable pysecsan\nexport ENABLE_PYSECSAN=\"1\"\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/charset_normalizer/fuzz_normalize.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom charset_normalizer import from_bytes\n\n\ndef TestOneInput(data):\n    \"\"\"Simply pass fuzz data directly into charset_normaliser\"\"\"\n    # No exceptions thrown\n    from_bytes(data)\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/charset_normalizer/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/jawah/charset_normalizer\nlanguage: python\nmain_repo: https://github.com/jawah/charset_normalizer\nprimary_contact: tahri.ahmed@proton.me\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/checker-framework/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/typetools/checker-framework\n\nWORKDIR checker-framework\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/"
  },
  {
    "path": "projects/checker-framework/UtilCheckerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.checkerframework.checker.formatter.util.FormatUtil;\nimport org.checkerframework.checker.i18nformatter.qual.I18nConversionCategory;\nimport org.checkerframework.checker.i18nformatter.util.I18nFormatUtil;\nimport java.lang.IllegalArgumentException;\nimport org.checkerframework.checker.regex.util.RegexUtil;\n\npublic class UtilCheckerFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      fuzzChecker(data);\n    } catch (IllegalArgumentException ignored) {}\n  }\n\n  private static void fuzzChecker(FuzzedDataProvider data) {\n    int choice = data.consumeInt(0, 2);\n    String content;\n    switch (choice) {\n      case 0:\n        content = data.consumeRemainingAsString();\n        FormatUtil.formatParameterCategories(content);\n        FormatUtil.tryFormatSatisfiability(content);\n        break;\n      case 1:\n        I18nConversionCategory[] categories = {\n          I18nConversionCategory.NUMBER,\n          I18nConversionCategory.DATE,\n          I18nConversionCategory.NUMBER,\n          I18nConversionCategory.UNUSED,\n          I18nConversionCategory.stringToI18nConversionCategory(data.consumeString(100))\n        };\n        I18nConversionCategory category = data.pickValue(categories);\n        I18nFormatUtil.hasFormat(data.consumeRemainingAsString(), category);\n        break;\n      case 2:\n        content = data.consumeRemainingAsString();\n        if (RegexUtil.isRegex(content)) {\n          RegexUtil.asRegex(content);\n        }\n        break;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/checker-framework/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n#mv $SRC/{*.zip,*.dict} $OUT\n\nln -s $MVN /bin/mvn\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nCURRENT_VERSION=$(./gradlew properties --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n\n./gradlew build -x test -x :checker:javadoc -x :framework-test:spotlessJavaCheck\n\ncp \"./checker/build/libs/checker-$CURRENT_VERSION-all.jar\" \"$OUT/checker.jar\"\ncp \"./framework/build/libs/framework-$CURRENT_VERSION.jar\" \"$OUT/checker-framework.jar\"\n\nALL_JARS=\"checker.jar checker-framework.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 15\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_excludes=com.fasterxml.jackson.core.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.RegexInjection\\\"\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/checker-framework/project.yaml",
    "content": "homepage: \"https://github.com/typetools/checker-framework\"\nlanguage: jvm\nmain_repo: \"git@github.com:typetools/checker-framework.git\"\nprimary_contact: \"michael.ernst@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\nrun_tests: False"
  },
  {
    "path": "projects/checkstyle/CheckstyleFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.puppycrawl.tools.checkstyle.JavaParser;\nimport com.puppycrawl.tools.checkstyle.api.CheckstyleException;\nimport com.puppycrawl.tools.checkstyle.api.FileContents;\nimport com.puppycrawl.tools.checkstyle.api.FileText;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\n// jvm-autofuzz-heuristics-1\npublic class CheckstyleFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    // Heuristic name: jvm-autofuzz-heuristics-1\n    Path path = null;\n    try {\n      path = Files.createTempFile(\"oss-fuzz.\", \".oss-fuzz\");\n      Files.write(path, data.consumeRemainingAsBytes());\n      FileContents content = new FileContents(new FileText(path.toFile(), \"UTF-8\"));\n\n      JavaParser.parse(content);\n    } catch (IOException | CheckstyleException | NoClassDefFoundError e) {\n      // Known exception\n    } finally {\n      if (path != null) {\n        try {\n          Files.deleteIfExists(path);\n        } catch (IOException e) {\n          // Known Exception\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "projects/checkstyle/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n  -o maven.zip && \\\n  unzip maven.zip -d $SRC/maven && \\\n  rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/checkstyle/checkstyle checkstyle\nCOPY *.sh *Fuzzer.java $SRC/\nWORKDIR $SRC/checkstyle\n"
  },
  {
    "path": "projects/checkstyle/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nexport TARGET_PACKAGE_PREFIX=\"com.puppycrawl.tools.checkstyle.\"\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15 --update-snapshots\"\n$MVN clean package $MAVEN_ARGS\n\nBUILD_CLASSPATH=\nRUNTIME_CLASSPATH=\n\nfor JARFILE in $(find ./ -name *.jar)\ndo\n  cp $JARFILE $OUT/\n  BUILD_CLASSPATH=$BUILD_CLASSPATH$OUT/$(basename $JARFILE):\n  RUNTIME_CLASSPATH=$RUNTIME_CLASSPATH\\$this_dir/$(basename $JARFILE):\ndone\n\n# Build corpus with valid java files\nmkdir $SRC/tmp-corpus\nfind $SRC -name \"*.java\" -exec cp {} $SRC/tmp-corpus/ \\;\nzip -j $OUT/CheckstyleFuzzer_seed_corpus.zip $SRC/tmp-corpus/*\n\n# Retrieve apache-common-lang3 library\n# This library provides method to translate primitive type arrays to\n# their respective class object arrays to avoid compilation error.\nwget -P $OUT/ https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar\nwget -P $OUT/ https://repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.11.1/antlr4-runtime-4.11.1.jar\n\nBUILD_CLASSPATH=$BUILD_CLASSPATH:$JAZZER_API_PATH:$OUT/commons-lang3-3.12.0.jar:$OUT/antlr4-runtime-4.11.1.jar\nRUNTIME_CLASSPATH=$RUNTIME_CLASSPATH:\\$this_dir/commons-lang3-3.12.0.jar:\\$this_dir/antlr4-runtime-4.11.1.jar:\\$this_dir\n\nfor fuzzer in $(ls $SRC/*Fuzzer.java)\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n  \\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n  --cp=$RUNTIME_CLASSPATH \\\n  --target_class=$fuzzer_basename \\\n  --jvm_args=\\\"\\$mem_settings\\\" \\\n  \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/checkstyle/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/checkstyle/checkstyle\nlanguage: jvm\nmain_repo: https://github.com/checkstyle/checkstyle\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- arthur.chan@adalogics.com\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/chrono/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/chronotope/chrono chrono\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/chrono/build.sh",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Note: This project creates Rust fuzz targets exclusively\ncd $SRC/chrono\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_reader $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_format $OUT/\n"
  },
  {
    "path": "projects/chrono/project.yaml",
    "content": "homepage: \"https://github.com/chronotope/chrono\"\nmain_repo: \"https://github.com/chronotope/chrono.git\"\nlanguage: rust\nprimary_contact: \"dirkjan@ochtman.nl\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/cifuzz-example/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN git clone https://github.com/jonathanmetzman/cifuzz-example.git --depth 1\nWORKDIR cifuzz-example\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cifuzz-example/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake clean  # Not strictly necessary, since we are building in a fresh dir.\nmake -j$(nproc) all    # Build the fuzz targets.\n# make -j$(nproc) check  # Sanity check, not strictly required, but nice to have.\n\n# Copy the fuzzer executables, zip-ed corpora, option and dictionary files to $OUT\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'     # If you have dictionaries.\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'  # If you have custom options.\nfind . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';' # If you have seed corpora (you better have them!)\n"
  },
  {
    "path": "projects/cifuzz-example/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nlanguage: c++\nsanitizers:\n  - address\n\ndisabled: true\n\nprimary_contact:\n  fake@example.com\nmain_repo: 'https://github.com/jonathanmetzman/cifuzz-example.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/cilium/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y wget\nRUN wget https://raw.githubusercontent.com/google/AFL/master/dictionaries/json.dict -O $OUT/fuzz.dict\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/cilium/cilium\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN git clone --depth 1 https://github.com/cilium/proxy\nCOPY build.sh $SRC/\nWORKDIR $SRC/cilium\n"
  },
  {
    "path": "projects/cilium/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n$SRC/cilium/test/fuzzing/oss-fuzz-build.sh\n$SRC/cncf-fuzzing/projects/cilium/build.sh\n\nzip \"$OUT/fuzz_seed_corpus.zip\" \"$SRC\"/go-fuzz-corpus/json/corpus/*\n"
  },
  {
    "path": "projects/cilium/project.yaml",
    "content": "homepage: \"https://cilium.io\"\nlanguage: go\nprimary_contact: \"security@cilium.io\"\nauto_ccs:\n- \"andre@isovalent.com\"\n- \"joe@isovalent.com\"\n- \"natalia@isovalent.com\"\n- \"robin@isovalent.com\"\n- \"adam@adalogics.com\"\n- \"david@adalogics.com\"\n- \"liz@isovalent.com\"\n- \"chris@isovalent.com\"\nmain_repo: \"https://github.com/cilium/cilium.git\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/circl/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget python\nRUN git clone --depth 1 https://github.com/MozillaSecurity/cryptofuzz\nRUN git clone --depth 1 --branch 3.9.0 --single-branch https://github.com/randombit/botan.git\nRUN git clone --depth 1 https://github.com/supranational/blst.git\nRUN wget -nv https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/circl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_CIRCL\"\nexport LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\"\nexport LINK_FLAGS=\"\"\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_84_0.tar.bz2\ncd boost_1_84_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\ncp -R boost/ /usr/include/\n\n# Configure Cryptofuzz\ncd $SRC/cryptofuzz/\npython gen_repository.py\necho -n '\"' >>extra_options.h\necho -n \"--force-module=circl \" >>extra_options.h\necho -n \"--curves=secp384r1,bls12_381 \" >>extra_options.h\necho -n \"--operations=\" >>extra_options.h\necho -n \"ECC_PrivateToPublic,\" >>extra_options.h\necho -n \"ECC_Point_Add,\" >>extra_options.h\necho -n \"ECC_Point_Mul,\" >>extra_options.h\necho -n \"ECC_Point_Dbl,\" >>extra_options.h\necho -n \"BLS_PrivateToPublic,\" >>extra_options.h\necho -n \"BLS_G1_Add,\" >>extra_options.h\necho -n \"BLS_G1_Mul,\" >>extra_options.h\necho -n \"BLS_G1_Neg,\" >>extra_options.h\necho -n \"BLS_G1_IsEq,\" >>extra_options.h\necho -n \"BLS_IsG1OnCurve,\" >>extra_options.h\necho -n \"BLS_HashToG1,\" >>extra_options.h\necho -n \"BLS_PrivateToPublic_G2,\" >>extra_options.h\necho -n \"BLS_G2_Add,\" >>extra_options.h\necho -n \"BLS_G2_Mul,\" >>extra_options.h\necho -n \"BLS_G2_Neg,\" >>extra_options.h\necho -n \"BLS_G2_IsEq,\" >>extra_options.h\necho -n \"BLS_IsG2OnCurve,\" >>extra_options.h\necho -n \"BLS_HashToG2,\" >>extra_options.h\necho -n \"BLS_Compress_G1,\" >>extra_options.h\necho -n \"BLS_Decompress_G1,\" >>extra_options.h\necho -n \"BLS_Pairing,\" >>extra_options.h\necho -n \"BignumCalc_Mod_BLS12_381_P,\" >>extra_options.h\necho -n \"BignumCalc_Mod_BLS12_381_R\" >>extra_options.h\necho -n '\"' >>extra_options.h\n\n# Build Botan\ncd $SRC/botan\nif [[ $CFLAGS != *-m32* ]]\nthen\n    ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\nelse\n    ./configure.py --cpu=x86_32 --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\nfi\nmake -j$(nproc)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BOTAN -DCRYPTOFUZZ_BOTAN_IS_ORACLE\"\nexport LIBBOTAN_A_PATH=\"$SRC/botan/libbotan-3.a\"\nexport BOTAN_INCLUDE_PATH=\"$SRC/botan/build/include\"\ncd $SRC/cryptofuzz/modules/botan/\nmake -f Makefile-oracle -j $(nproc)\n\n# Build blst\ncd $SRC/blst/\n./build.sh\nexport BLST_LIBBLST_A_PATH=$(realpath libblst.a)\nexport BLST_INCLUDE_PATH=$(realpath bindings/)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BLST\"\ncd $SRC/cryptofuzz/modules/blst/\nmake -j $(nproc)\n\ncd $SRC/cryptofuzz/modules/circl/\ngo mod init cryptofuzz/circl\ngo mod tidy\nmake -j $(nproc)\n\ncd $SRC/cryptofuzz/\nmake -j $(nproc)\n\ncp cryptofuzz $OUT/\n"
  },
  {
    "path": "projects/circl/project.yaml",
    "content": "homepage: \"https://github.com/cloudflare/circl\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://github.com/cloudflare/circl.git\"\nauto_ccs:\n  - \"armfazh@cloudflare.com\"\n  - \"bas@cloudflare.com\"\nsanitizers:\n - address\narchitectures:\n - x86_64\n"
  },
  {
    "path": "projects/cirq/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone \\\n    --depth 1 \\\n    --branch main \\\n    https://github.com/quantumlib/Cirq.git\n\nWORKDIR $SRC/Cirq\n\n# Install pip dependencies.\nRUN --mount=type=cache,target=/root/.cache/pip \\\n    export PIP_ROOT_USER_ACTION=ignore && \\\n    pip3 install --upgrade pip && \\\n    pip3 install -r dev_tools/requirements/dev.env.txt\n\n# Install Cirq-related modules.\nRUN export PIP_ROOT_USER_ACTION=ignore && \\\n    pip3 install --no-cache-dir \\\n    ./cirq-core \\\n    ./cirq-aqt \\\n    ./cirq-web \\\n    ./cirq-ionq \\\n    ./cirq-google \\\n    ./cirq-pasqal\n\nCOPY build.sh fuzz_circuit.py $SRC/\n"
  },
  {
    "path": "projects/cirq/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n fuzzer_basename=$(basename -s .py $fuzzer)\n fuzzer_package=${fuzzer_basename}.pkg\n\n pyinstaller --distpath $OUT --onefile --name $fuzzer_package --hidden-import \"scipy._cyutility\" --hidden-import \"numpy._core._exceptions\" $fuzzer\n\n echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_PRELOAD=\\$this_dir/sanitizer_with_fuzzer.so \\\nASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$this_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$this_dir/$fuzzer_package \\$@\" > $OUT/$fuzzer_basename\n chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/cirq/fuzz_circuit.py",
    "content": "#!/usr/bin/python3\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nimport atheris\nimport sys\nimport cirq\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    \"\"\"Fuzzing target for Cirq circuit operations.\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n\n    # Test basic circuit creation\n    circuit = cirq.Circuit()\n\n    # Generate random number of qubits\n    num_qubits = fdp.ConsumeIntInRange(1, 3)\n    qubits = cirq.LineQubit.range(num_qubits)\n\n    # Generate random number of operations\n    num_ops = fdp.ConsumeIntInRange(1, 5)\n\n    for _ in range(num_ops):\n        if not fdp.remaining_bytes():\n            break\n\n        # Choose random gate type\n        gate_type = fdp.ConsumeIntInRange(0, 5)\n\n        if gate_type == 0 and len(qubits) >= 1:\n            # Single qubit X gate\n            qubit_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            circuit.append(cirq.X(qubits[qubit_idx]))\n\n        elif gate_type == 1 and len(qubits) >= 1:\n            # Single qubit Y gate\n            qubit_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            circuit.append(cirq.Y(qubits[qubit_idx]))\n\n        elif gate_type == 2 and len(qubits) >= 1:\n            # Single qubit Z gate\n            qubit_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            circuit.append(cirq.Z(qubits[qubit_idx]))\n\n        elif gate_type == 3 and len(qubits) >= 1:\n            # Hadamard gate\n            qubit_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            circuit.append(cirq.H(qubits[qubit_idx]))\n\n        elif gate_type == 4 and len(qubits) >= 2:\n            # CNOT gate\n            control_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            target_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            if control_idx != target_idx:\n                circuit.append(cirq.CNOT(qubits[control_idx], qubits[target_idx]))\n\n        elif gate_type == 5 and len(qubits) >= 2:\n            # CZ gate\n            control_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            target_idx = fdp.ConsumeIntInRange(0, len(qubits) - 1)\n            if control_idx != target_idx:\n                circuit.append(cirq.CZ(qubits[control_idx], qubits[target_idx]))\n\n    simulator = cirq.Simulator()\n    simulator.simulate(circuit)\n\ndef main():\n    \"\"\"Main entry point for the fuzzer.\"\"\"\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cirq/project.yaml",
    "content": "homepage: \"https://github.com/quantumlib/Cirq\"\nlanguage: python\nprimary_contact: \"quantum-oss-maintainers@google.com\"\nauto_ccs:\n  - \"mhucka@google.com\"\n  - \"mrtoastcheng@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: \"https://github.com/quantumlib/Cirq.git\"\n"
  },
  {
    "path": "projects/civetweb/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y zlib1g-dev\nRUN git clone https://github.com/civetweb/civetweb\n\nWORKDIR $SRC/civetweb\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/civetweb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nsed -i 's/CFLAGS += -g -fsanitize=address,fuzzer,undefined/#CFLAGS += -g -fsanitize=address,fuzzer,undefined/' ./Makefile\nexport LDFLAGS=\"${LIB_FUZZING_ENGINE} ${CFLAGS}\"\n\nchmod +x ./fuzztest/build.sh\n./fuzztest/build.sh\nmv civetweb_fuzz* $OUT/\n"
  },
  {
    "path": "projects/civetweb/project.yaml",
    "content": "homepage: \"https://github.com/civetweb/civetweb\"\nprimary_contact: \"bel2125@gmail.com\"\nlanguage: c\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nauto_ccs:\n  - \"xt4ubq@gmail.com\"\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/civetweb/civetweb'\n"
  },
  {
    "path": "projects/cjson/Dockerfile",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n\nRUN apt-get update && apt-get install -y cmake\n\nRUN git clone --depth 1 https://github.com/DaveGamble/cJSON.git cjson\n\nWORKDIR cjson\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cjson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project\n$SRC/cjson/fuzzing/ossfuzz.sh"
  },
  {
    "path": "projects/cjson/project.yaml",
    "content": "homepage: \"https://github.com/DaveGamble/cJSON\"\nlanguage: c++\nprimary_contact: \"max@maxbruckner.de\"\nauto_ccs:\n  - \"randy440088@gmail.com\"\n  - \"wp_scut@163.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/DaveGamble/cJSON.git'\n"
  },
  {
    "path": "projects/clamav/Dockerfile",
    "content": "# Copyright (C) 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y \\\n    flex bison \\\n    python3-dev \\\n    pkg-config\n\n#\n# We need the latest toolchain to reliably build clamav.\n# oss-fuzz requires nightly for the -Z option, so we use that as well.\n#\nRUN rustup update nightly\nENV RUSTUP_TOOLCHAIN=nightly-x86_64-unknown-linux-gnu\n\n#\n# Build static libs for dependencies\n#\nRUN python3 -m pip install --upgrade pip\nRUN python3 -m pip install mussels\nRUN git clone --depth 1 https://github.com/Cisco-Talos/clamav-mussels-cookbook.git\n\nRUN mkdir /mussels\nRUN cd ${SRC}/clamav-mussels-cookbook && \\\n    msl build libclamav_deps -t host-static -w /mussels/work -i /mussels/install\n\n# Collect clamav source & fuzz corpus\nRUN git clone --depth 1 https://github.com/Cisco-Talos/clamav.git\n\nWORKDIR clamav\nCOPY build.sh replay_build.sh $SRC/\n"
  },
  {
    "path": "projects/clamav/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -ex\nexport GIT_DISCOVERY_ACROSS_FILESYSTEM=1\n\n#\n# Build the library.\n#\nrm -rf ${SRC}/build\nmkdir -p ${SRC}/build\ncd ${SRC}/build\n\n#\n# Run ./configure\n#\nexport CLAMAV_DEPENDENCIES=/mussels/install\ncmake ${SRC}/clamav \\\n    -DENABLE_FUZZ=ON                                                   \\\n    -DHAVE_MMAP=OFF                                                    \\\n    -DJSONC_INCLUDE_DIR=\"$CLAMAV_DEPENDENCIES/include/json-c\"          \\\n    -DJSONC_LIBRARY=\"$CLAMAV_DEPENDENCIES/lib/libjson-c.a\"             \\\n    -DENABLE_JSON_SHARED=OFF                                           \\\n    -DBZIP2_INCLUDE_DIR=\"$CLAMAV_DEPENDENCIES/include\"                 \\\n    -DBZIP2_LIBRARY_RELEASE=\"$CLAMAV_DEPENDENCIES/lib/libbz2.a\"        \\\n    -DOPENSSL_ROOT_DIR=\"$CLAMAV_DEPENDENCIES\"                          \\\n    -DOPENSSL_INCLUDE_DIR=\"$CLAMAV_DEPENDENCIES/include\"               \\\n    -DOPENSSL_CRYPTO_LIBRARY=\"$CLAMAV_DEPENDENCIES/lib/libcrypto.a\"    \\\n    -DOPENSSL_SSL_LIBRARY=\"$CLAMAV_DEPENDENCIES/lib/libssl.a\"          \\\n    -DZLIB_LIBRARY=\"$CLAMAV_DEPENDENCIES/lib/libssl.a\"                 \\\n    -DLIBXML2_INCLUDE_DIR=\"$CLAMAV_DEPENDENCIES/include/libxml2\"       \\\n    -DLIBXML2_LIBRARY=\"$CLAMAV_DEPENDENCIES/lib/libxml2.a\"             \\\n    -DPCRE2_INCLUDE_DIR=\"$CLAMAV_DEPENDENCIES/include\"                 \\\n    -DPCRE2_LIBRARY=\"$CLAMAV_DEPENDENCIES/lib/libpcre2-8.a\"            \\\n    -DZLIB_INCLUDE_DIR=\"$CLAMAV_DEPENDENCIES/include\"                  \\\n    -DZLIB_LIBRARY=\"$CLAMAV_DEPENDENCIES/lib/libz.a\"                   \\\n    -DCMAKE_INSTALL_PREFIX=\"install\"\n\n# Build libclamav and the fuzz targets\nmake -j$(nproc)\ncp ./fuzz/clamav_* ${OUT}/.\n\n#\n# Collect the fuzz corpora.\n#\n\n# `scanfile` & `scanmap`\n# ----------\nmkdir ${SRC}/all-scantype-seeds\ngit clone --depth 1 https://github.com/Cisco-Talos/clamav-fuzz-corpus.git $SRC/clamav-fuzz-corpus\n\nfor type in ARCHIVE MAIL OLE2 PDF HTML PE ELF SWF XMLDOCS HWP3; do\n    # Prepare seed corpus for the type-specific fuzz targets.\n    zip ${OUT}/clamav_scanfile_${type}_fuzzer_seed_corpus.zip ${SRC}/clamav-fuzz-corpus/scantype/${type}/*\n    zip ${OUT}/clamav_scanmap_${type}_fuzzer_seed_corpus.zip ${SRC}/clamav-fuzz-corpus/scantype/${type}/*\n\n    # Prepare dictionary for the type-specific fuzz targets (may not exist for all types).\n    cp ${SRC}/clamav-fuzz-corpus/scantype/${type}.dict ${OUT}/clamav_scanfile_${type}_fuzzer.dict 2>/dev/null || :\n    cp ${SRC}/clamav-fuzz-corpus/scantype/${type}.dict ${OUT}/clamav_scanmap_${type}_fuzzer.dict 2>/dev/null || :\n\n    # Copy seeds for the generic fuzz target.\n    cp ${SRC}/clamav-fuzz-corpus/scantype/${type}/* ${SRC}/all-scantype-seeds/\ndone\n\n# Add weird files\ngit clone --depth=1 https://github.com/corkami/pocs\nfind ./pocs/ -type f -print0 | xargs -0 -I % mv -f % ${SRC}/all-scantype-seeds/\n\n# Prepare seed corpus for the generic fuzz target.\ncp ${SRC}/clamav-fuzz-corpus/scantype/other/* ${SRC}/all-scantype-seeds/\nzip ${OUT}/clamav_scanfile_fuzzer_seed_corpus.zip ${SRC}/all-scantype-seeds/*\nzip ${OUT}/clamav_scanmap_fuzzer_seed_corpus.zip ${SRC}/all-scantype-seeds/*\nrm -r ${SRC}/all-scantype-seeds\n\n# `dbload`\n# --------\nfor type in CDB CFG CRB FP FTM HDB HSB IDB IGN IGN2 LDB MDB MSB NDB PDB WDB YARA; do\n    # Prepare seed corpus for the type-specific fuzz targets.\n    zip ${OUT}/clamav_dbload_${type}_fuzzer_seed_corpus.zip ${SRC}/clamav-fuzz-corpus/database/${type}/*\n\n    # Prepare dictionary for the type-specific fuzz targets (may not exist for all types).\n    cp ${SRC}/clamav-fuzz-corpus/database/${type}.dict ${OUT}/clamav_dbload_${type}_fuzzer.dict 2>/dev/null || :\ndone\n"
  },
  {
    "path": "projects/clamav/clamav-scanfile-fuzzer.options",
    "content": "[libfuzzer]\n"
  },
  {
    "path": "projects/clamav/project.yaml",
    "content": "homepage: \"https://www.clamav.net/\"\nlanguage: c++\nprimary_contact: \"clamav.fuzz@gmail.com\"\nauto_ccs:\n    - clamav-bugs@external.cisco.com\nsanitizers:\n - address\n - undefined\nfuzzing_engines:\n - libfuzzer\n - afl\nmain_repo: 'https://github.com/Cisco-Talos/clamav-devel.git'\n"
  },
  {
    "path": "projects/clamav/replay_build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script is useful for OSS-Fuzz infrastructure which is used to rebuild\n# code from cached images. This is to support various ongoing efforts in\n# OSS-Fuzz.\n\ncd ${SRC}/build\nmake -j$(nproc)\ncp ./fuzz/clamav_* ${OUT}/.\n"
  },
  {
    "path": "projects/clib/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake libcurl4-gnutls-dev -qq\nRUN git clone --depth 1 https://github.com/clibs/clib\nWORKDIR $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/clib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd clib\nmake -j$(nproc)\n\nsed 's/int main(int argc/int main2(int argc/g' -i ./src/clib-search.c\nsed 's/int main(int argc/int main2(int argc/g' -i ./src/clib-configure.c\n\nfind . -name \"*.o\" -exec ar rcs fuzz_lib.a {} \\;\n\n$CC $CFLAGS -Wno-unused-function -U__STRICT_ANSI__  \\\n\t-DHAVE_PTHREADS=1 -pthread \\\n\t-c src/common/clib-cache.c src/clib-configure.c \\\n        src/common/clib-settings.c src/common/clib-package.c \\\n        test/fuzzing/fuzz_manifest.c -I./asprintf -I./deps/ \\\n\t-I./deps/asprintf\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_manifest.o \\\n\t-o $OUT/fuzz_manifest  clib-cache.o clib-configure.o clib-settings.o clib-package.o \\\n\t-I./deps/asprintf -I./deps -I./asprintf \\\n\tfuzz_lib.a -L/usr/lib/x86_64-linux-gnu -lcurl\n\necho \"[libfuzzer]\" > $OUT/fuzz_manifest.options\necho \"detect_leaks=0\" >> $OUT/fuzz_manifest.options\n"
  },
  {
    "path": "projects/clib/project.yaml",
    "content": "homepage: \"https://github.com/clibs/clib\"\nlanguage: c\nprimary_contact: \"joseph.werle@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"isty001@gmail.com\"\nmain_repo: 'https://github.com/clibs/clib'\n"
  },
  {
    "path": "projects/click/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/pallets/click click\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/click\n"
  },
  {
    "path": "projects/click/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/click/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport click\nfrom click.parser import OptionParser\nfrom click import exceptions\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  # Create a parser we can fuzz.\n  # This can be extended further by creating logic that will create arbitrary\n  # parser.\n  ctx = click.Context(click.Command(\"fuzz\"))\n  parser = OptionParser(ctx)\n  click.Option(\"+z\", is_flag=True).add_to_parser(parser, ctx)\n  click.Option(\"-b\", is_flag=False).add_to_parser(parser, ctx)\n  click.Option(\"+c\", multiple=fdp.ConsumeBool()).add_to_parser(parser, ctx)\n  click.Option(\"-d\", default=\"abc\").add_to_parser(parser, ctx)\n  click.Option(\"+e\", type=int).add_to_parser(parser, ctx)\n  click.Option(\"-f\", type=click.Choice([\"option1\", \"option2\"])).add_to_parser(parser, ctx)\n  click.Option(\"!g\", type=click.Choice([\"option1\", \"option2\"])).add_to_parser(parser, ctx)\n  click.Option(\"!h\", default=\"abcd\").add_to_parser(parser, ctx)\n  \n  args = []\n  for idx in range(fdp.ConsumeIntInRange(1, 15)):\n    args.append(fdp.ConsumeUnicodeNoSurrogates(64))\n  try:\n    parser.parse_args(args)\n  except exceptions.ClickException:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/click/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pallets/click\nlanguage: python\nmain_repo: https://github.com/pallets/click\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/clickhouse/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update -y \\\n    && env DEBIAN_FRONTEND=noninteractive \\\n        apt-get install --yes --no-install-recommends \\\n            bash \\\n            wget \\\n            curl \\\n            ccache \\\n            expect \\\n            ninja-build \\\n            perl \\\n            pkg-config \\\n            python3 \\\n            python3-lxml \\\n            python3-requests \\\n            python3-termcolor \\\n            protobuf-compiler \\\n            libprotoc-dev \\\n            libgrpc++-dev \\\n            protobuf-compiler-grpc \\\n            libprotobuf-dev \\\n            sudo \\\n            tzdata \\\n            nasm\n\nRUN git clone -j 8 --recursive https://github.com/ClickHouse/ClickHouse $SRC/ClickHouse\nWORKDIR $SRC/ClickHouse\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/clickhouse/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nmkdir -p $SRC/ClickHouse/build && cd $SRC/ClickHouse/build\n\n[ -e CMakeLists ] && rm -rf CMakeFiles\n[ -e CMakeCache.txt ] && rm -rf CMakeCache.txt\n\nsed -i -e '/warnings.cmake)/d' $SRC/ClickHouse/CMakeLists.txt\n\n# It will be hard to maintain any compilation fails (if any) in two repositories.\n# Also ClickHouse won't compile without this.\n# It is very strange, because we have as many warnings as you could imagine.\nsed -i -e 's/add_warning(/no_warning(/g' $SRC/ClickHouse/CMakeLists.txt\n\n# ClickHouse uses libcxx from contrib.\n# Enabling libstdc++ manually will cause duplicate symbols at linker stage.\n# Plus we want to fuzz the same binary as we have in our CI\n# https://github.com/ClickHouse/ClickHouse/blob/2e2ef087129ed072404bdc084e8028a5c5869dc0/PreLoad.cmake#L23\nunset CFLAGS\nunset CXXFLAGS\nunset LDFLAGS\n\n# ClickHouse builds `protoc` from sources to be dependent only on compiler\n# but if we build ClickHouse with any kind of sanitizer, then `protoc`\n# will be built with sanitizer too...\n# Protoc will be used during ClickHouse builds to generate .cpp sources from .proto files\n# and everything works in our CI, but not here...\n# We use libprotobuf-mutator and self-written script to generate SQL-based AST from mutated .proto\n# Maybe some of proto files are too complex and this is the cause of `protoc` failures\n# So, this flag only helps to supress error from `protoc` built with any kind of sanitizer\nexport MSAN_OPTIONS=exit_code=0\n\nprintenv\n\nNUM_JOBS=$(nproc || grep -c ^processor /proc/cpuinfo)\n\nif (( $NUM_JOBS > 10 )); then\n    NUM_JOBS=$(expr $NUM_JOBS / 4)\nfi\n\nCLICKHOUSE_CMAKE_FLAGS=(\n    \"-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/ccache\"\n    \"-DCMAKE_C_COMPILER=$CC\"\n    \"-DCMAKE_CXX_COMPILER=$CXX\"\n    \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\"\n    \"-DLIB_FUZZING_ENGINE:STRING=$LIB_FUZZING_ENGINE\"\n    \"-DENABLE_FUZZING=1\"\n    \"-DENABLE_PROTOBUF=1\"\n    \"-DPARALLEL_COMPILE_JOBS=$NUM_JOBS\"\n)\n\nif [ \"$SANITIZER\" = \"coverage\" ]; then\n    cmake  -G Ninja $SRC/ClickHouse ${CLICKHOUSE_CMAKE_FLAGS[@]} -DWITH_COVERAGE=1\nelse\n    cmake  -G Ninja $SRC/ClickHouse ${CLICKHOUSE_CMAKE_FLAGS[@]} -DSANITIZE=$SANITIZER\nfi\n\nTARGETS=$(find $SRC/ClickHouse/src $SRC/ClickHouse/programs -name '*_fuzzer.cpp' -\\! -name '*gtest_*' -prune -execdir basename {} .cpp ';' | tr '\\n' ' ')\n\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n  # When running in CI, check the first targets only to save time and disk space\n  TARGETS=( ${TARGETS[@]:0:2} )\nfi\n\nfor FUZZER_TARGET in $TARGETS\ndo\n    # Skip this fuzzer because of linker errors (the size of the binary is too big)\n    if [ \"$FUZZER_TARGET\" = \"execute_query_fuzzer\" ]; then\n        continue\n    fi\n    ninja -j $NUM_JOBS $FUZZER_TARGET\n    # Find this binary in build directory and strip it\n    TEMP=$(find $SRC/ClickHouse/build -name $FUZZER_TARGET)\n    # We have to preserve certain symbols e.g. LLVMFuzzerTestOneInput and some sanitizer-related once to not fail build checks:\n    # https://github.com/google/oss-fuzz/blob/860447a7121e344cc1627f492f67f3a23e86e6c5/infra/base-images/base-runner/bad_build_check#L173\n    # https://github.com/google/oss-fuzz/blob/860447a7121e344cc1627f492f67f3a23e86e6c5/infra/base-images/base-runner/test_all.py#L92-L96\n    # because of that we strip only debug symbols\n    strip --strip-debug $TEMP\ndone\n\n# copy out fuzzer binaries\nfind $SRC/ClickHouse/build -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\n\n# copy out fuzzer options and dictionaries\ncp $SRC/ClickHouse/tests/fuzz/*.dict $OUT/\ncp $SRC/ClickHouse/tests/fuzz/*.options $OUT/\n\n# prepare corpus dirs\nmkdir -p $SRC/ClickHouse/tests/fuzz/lexer_fuzzer.in/\nmkdir -p $SRC/ClickHouse/tests/fuzz/select_parser_fuzzer.in/\nmkdir -p $SRC/ClickHouse/tests/fuzz/create_parser_fuzzer.in/\nmkdir -p $SRC/ClickHouse/tests/fuzz/execute_query_fuzzer.in/\n\n# prepare corpus\ncp $SRC/ClickHouse/tests/queries/0_stateless/*.sql $SRC/ClickHouse/tests/fuzz/lexer_fuzzer.in/\ncp $SRC/ClickHouse/tests/queries/0_stateless/*.sql $SRC/ClickHouse/tests/fuzz/select_parser_fuzzer.in/\ncp $SRC/ClickHouse/tests/queries/0_stateless/*.sql $SRC/ClickHouse/tests/fuzz/create_parser_fuzzer.in/\ncp $SRC/ClickHouse/tests/queries/0_stateless/*.sql $SRC/ClickHouse/tests/fuzz/execute_query_fuzzer.in/\ncp $SRC/ClickHouse/tests/queries/1_stateful/*.sql $SRC/ClickHouse/tests/fuzz/lexer_fuzzer.in/\ncp $SRC/ClickHouse/tests/queries/1_stateful/*.sql $SRC/ClickHouse/tests/fuzz/select_parser_fuzzer.in/\ncp $SRC/ClickHouse/tests/queries/1_stateful/*.sql $SRC/ClickHouse/tests/fuzz/create_parser_fuzzer.in/\ncp $SRC/ClickHouse/tests/queries/1_stateful/*.sql $SRC/ClickHouse/tests/fuzz/execute_query_fuzzer.in/\n\n# copy out corpus\ncd $SRC/ClickHouse/tests/fuzz\nfor dir in *_fuzzer.in; do\n    fuzzer=$(basename $dir .in)\n    zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n\n# copy sources for code coverage if required\nif [ \"$SANITIZER\" = \"coverage\" ]; then\n    mkdir -p $OUT/src/ClickHouse/\n    cp -rL --parents $SRC/ClickHouse/src $OUT\n    cp -rL --parents $SRC/ClickHouse/base $OUT\nfi\n\n# Just check binaries size\nBINARIES_SIZE=$(find $SRC/ClickHouse/build -name '*_fuzzer' -exec du -sh '{}' ';')\n"
  },
  {
    "path": "projects/clickhouse/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://clickhouse.com/\"\nlanguage: c++\nprimary_contact: \"security@clickhouse.com\"\nauto_ccs:\n - \"jakalletti@gmail.com\"\n - \"man2gm@gmail.com\"\n - \"kochetovnicolai@gmail.com\"\n - \"hq.zero.iq@gmail.com\"\n - \"milovidov@clickhouse.com\"\n - \"ivan@clickhouse.com\"\n - \"avogar@clickhouse.com\"\n - \"Nikita.Taranov@clickhouse.com\"\n - \"Antonio@clickhouse.com\"\n - \"Nikolay.Degterinskii@clickhouse.com\"\n - \"sergei@clickhouse.com\"\n - \"tavplubix@clickhouse.com\"\n - \"felixoid@clickhouse.com\"\n - \"n0vik@clickhouse.com\"\n - \"yakov@clickhouse.com\"\n - \"maksim@clickhouse.com\"\n - \"nk@clickhouse.com\"\n - \"nikitamikhaylov@clickhouse.com\"\n - \"alesapin@clickhouse.com\"\n - \"vdimir@clickhouse.com\"\n - \"qoega@clickhouse.com\"\n - \"kssenii@clickhouse.com\"\n - \"anton@clickhouse.com\"\n - \"oleksandr@clickhouse.com\"\n - \"vitlibar@clickhouse.com\"\n - \"igor@clickhouse.com\"\n - \"robert@clickhouse.com\"\n - \"sema.checherinda@clickhouse.com\"\n - \"Jianfei.Hu@clickhouse.com\"\n - \"san.tran@clickhouse.com\"\n\nsanitizers:\n - address\n - memory\n - undefined\nfuzzing_engines:\n - libfuzzer\nmain_repo: 'https://github.com/ClickHouse/ClickHouse.git'\n"
  },
  {
    "path": "projects/clock/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/benbjohnson/clock\nWORKDIR clock\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/clock/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/fuzz_test.go $SRC/clock/\ngo mod tidy\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ncompile_native_go_fuzzer github.com/benbjohnson/clock FuzzClock FuzzClock\n"
  },
  {
    "path": "projects/clock/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage clock\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc FuzzClock(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, addString, setString, timerString string) {\n\t\taddTime, err := time.ParseDuration(addString)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tsetTime, err := time.Parse(time.RFC3339, setString)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\ttimerTime, err := time.ParseDuration(timerString)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tm := NewMock()\n\t\tm.Add(addTime)\n\t\tm.Set(setTime)\n\t\tm.Timer(timerTime)\n\t})\n}\n"
  },
  {
    "path": "projects/clock/project.yaml",
    "content": "homepage: \"https://github.com/benbjohnson/clock\"\nlanguage: go\nmain_repo: \"https://github.com/benbjohnson/clock\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/closure-compiler/.gitignore",
    "content": "project-parent/closure-compiler\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/closure-compiler/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/closure-compiler\nRUN wget -O \"./bazelisk\" \"https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64\"\nRUN chmod +x bazelisk\nRUN mv bazelisk /usr/local/bin/bazelisk\nRUN git clone --depth 1 https://github.com/google/closure-compiler/ $SRC/project-parent/closure-compiler\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/closure-compiler/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=closure-compiler\nPROJECT_GROUP_ID=com.google.javascript\nPROJECT_ARTIFACT_ID=closure-compiler\nMAIN_REPOSITORY=https://github.com/google/closure-compiler/\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  mvn -pl $PROJECT install -DskipTests\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  #install\n  (cd $PROJECT && bazelisk build //:all) \n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  cp $SRC/project-parent/closure-compiler/bazel-bin/compiler_uberjar_deploy.jar $OUT/\n\n  ALL_JARS=\"compiler_uberjar_deploy.jar\"\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes:$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\").\"\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/closure-compiler/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.javascript</groupId>\n            <artifactId>closure-compiler</artifactId>\n            <version>1.0</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../closure-compiler/bazel-bin/compiler_uberjar_deploy.jar</systemPath>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/closure-compiler/project-parent/fuzz-targets/src/test/java/com/example/ParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport com.google.javascript.jscomp.parsing.Config;\nimport com.google.javascript.jscomp.parsing.Config.JsDocParsing;\nimport com.google.javascript.jscomp.parsing.Config.LanguageMode;\nimport com.google.javascript.jscomp.parsing.ParserRunner;\nimport com.google.javascript.jscomp.parsing.ParserRunner.ParseResult;\nimport com.google.javascript.rhino.*;\nimport com.google.javascript.rhino.StaticSourceFile.SourceKind;\n\n\nclass ParserFuzzer {\n    static SourceKind [] sourceKinds = {SourceKind.STRONG, SourceKind.WEAK, SourceKind.EXTERN, SourceKind.NON_CODE};\n    static LanguageMode [] languageModes = {LanguageMode.ECMASCRIPT3, LanguageMode.ECMASCRIPT5,\n            LanguageMode.ECMASCRIPT_2015, LanguageMode.ECMASCRIPT_2016, LanguageMode.ECMASCRIPT_2017, LanguageMode.ECMASCRIPT_2018,\n            LanguageMode.ECMASCRIPT_2019, LanguageMode.ECMASCRIPT_2020, LanguageMode.ECMASCRIPT_2021, LanguageMode.ES_NEXT,\n            LanguageMode.UNSTABLE, LanguageMode.UNSUPPORTED};\n    static JsDocParsing [] jsDocParsings = {JsDocParsing.INCLUDE_ALL_COMMENTS, JsDocParsing.TYPES_ONLY,\n            JsDocParsing.INCLUDE_DESCRIPTIONS_WITH_WHITESPACE, JsDocParsing.INCLUDE_DESCRIPTIONS_NO_WHITESPACE};\n    static Config.RunMode [] runModes = {Config.RunMode.KEEP_GOING, Config.RunMode.STOP_AFTER_ERROR};\n    static Config.StrictMode [] strictModes = {Config.StrictMode.STRICT, Config.StrictMode.SLOPPY};\n    static TestErrorReporter [] testErrorReporters = {new TestErrorReporter().expectAllWarnings(), new TestErrorReporter().expectAllErrors()};\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            String name = data.consumeString(200);\n            StaticSourceFile file = new SimpleSourceFile(name, data.pickValue(sourceKinds));\n            Config config = ParserRunner.createConfig(data.pickValue(languageModes), data.pickValue(jsDocParsings),\n                    data.pickValue(runModes), null, data.consumeBoolean(), data.pickValue(strictModes));\n            TestErrorReporter testErrorReporter = data.pickValue(testErrorReporters);\n            String sourceString = data.consumeRemainingAsString();\n            ParseResult result = ParserRunner.parse(file, sourceString, config, testErrorReporter);\n        } catch (RuntimeException e) {\n            // Need to catch RuntimeException to pass fuzzing blocker.\n        }\n    }\n\n     static class TestErrorReporter implements ErrorReporter {\n        private final ArrayList<String> expectedErrors = new ArrayList<>();\n        private final ArrayList<String> expectedWarnings = new ArrayList<>();\n        private final ArrayList<String> seenErrors = new ArrayList<>();\n        private final ArrayList<String> seenWarnings = new ArrayList<>();\n\n        @Override\n        public void error(String message, String sourceName, int line, int lineOffset) {\n            this.seenErrors.add(message);\n        }\n\n        @Override\n        public void warning(String message, String sourceName, int line, int lineOffset) {\n            this.seenWarnings.add(message);\n        }\n\n        public TestErrorReporter expectAllErrors(String... errors) {\n            Collections.addAll(this.expectedErrors, errors);\n            return this;\n        }\n\n        public TestErrorReporter expectAllWarnings(String... warnings) {\n            Collections.addAll(this.expectedWarnings, warnings);\n            return this;\n        }\n    }\n}"
  },
  {
    "path": "projects/closure-compiler/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n<!--    <module>closure-compiler</module>-->\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/closure-compiler/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://developers.google.com/closure/compiler/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/google/closure-compiler/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/closure-library/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN  git clone --depth 1 https://github.com/google/closure-library.git\n\nCOPY fuzz.js $SRC/closure-library\n\nWORKDIR $SRC/closure-library\n"
  },
  {
    "path": "projects/closure-library/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer closure-library fuzz.js -i closure-library --sync\n"
  },
  {
    "path": "projects/closure-library/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nrequire(\"google-closure-library\");\nconst SafeHtml = goog.require('goog.html.SafeHtml');\nconst googString = goog.require('goog.string.Const');\nconst TrustedResourceUrl = goog.require('goog.html.TrustedResourceUrl');\nconst UncheckedResourceUrl = goog.require('goog.html.UncheckedResourceUrl');\n\nmodule.exports.fuzz = function(data) {\n  const provider = new FuzzedDataProvider(data);\n\n  const html = provider.consumeString(300);\n  const shouldWrap = provider.consumeBoolean();\n  const tagName = shouldWrap ? provider.consumeString(10) : '';\n\n  let safeHtml;\n  try {\n    const method = provider.consumeIntegralInRange(1, 6);\n\n    switch (method) {\n      case 1:\n        safeHtml = SafeHtml.create(tagName, { innerHtml: html });\n        break;\n      case 2:\n        safeHtml = SafeHtml.fromConstant(googString.from(html));\n        break;\n      case 3:\n        safeHtml = SafeHtml.fromTrustedResourceUrl(TrustedResourceUrl.fromConstant(googString.from(html)));\n        break;\n      case 4:\n        safeHtml = SafeHtml.fromUntrustedResourceUrl(UncheckedResourceUrl.fromConstant(googString.from(html)));\n        break;\n      case 5:\n        safeHtml = SafeHtml.unwrap(SafeHtml.create(tagName, { innerHtml: html }));\n        break;\n      case 6:\n        safeHtml = SafeHtml.concat(SafeHtml.create(tagName, { innerHtml: html }), SafeHtml.EMPTY);\n        break;\n    }\n\n    const htmlString = SafeHtml.unwrap(safeHtml);\n    const isEmpty = provider.consumeBoolean();\n    const emptySafeHtml = isEmpty ? SafeHtml.EMPTY : safeHtml;\n    const concatenatedSafeHtml = SafeHtml.concat(safeHtml, emptySafeHtml);\n    const isTrusted = provider.consumeBoolean();\n    const trustedSafeHtml = isTrusted ? SafeHtml.htmlEscape(htmlString) : concatenatedSafeHtml;\n    SafeHtml.unwrap(trustedSafeHtml);\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [\n  \"Cannot read properties of\"\n];\n"
  },
  {
    "path": "projects/closure-library/project.yaml",
    "content": "homepage: https://developers.google.com/closure/library/\nlanguage: javascript\nmain_repo: https://github.com/google/closure-library\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/cloud-custodian/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN git clone https://github.com/cloud-custodian/cloud-custodian\nRUN apt-get install build-essential libssl-dev libffi-dev pkg-config python3-dev cargo -y\nRUN pip3 install --upgrade pip\nRUN curl https://sh.rustup.rs -sSf | sh -s -- -y\nENV PATH=\"/root/.cargo/bin:${PATH}\"\nRUN rustup install nightly\nRUN rustup default stable\n\nCOPY *.sh *.py $SRC/\nWORKDIR $SRC/cloud-custodian\n"
  },
  {
    "path": "projects/cloud-custodian/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\npython3 -m pip install tools/c7n_gcp\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_actions_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom botocore.exceptions import ProfileNotFound\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n\n    from c7n.resources import aws, rdsparamgroup, elasticache, ec2\n    from c7n.resources import emr, account, apigw, elb, s3, glue\n    from c7n.resources import appelb\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    registry_type = [\n        'c7n.data', 'rds-param-group', 'elasticache', 'ec2', 'emr',\n        'aws.account', 'rest-account', 'elb', 's3', 'iac', 'rds',\n        'glue-catalog', 'app-elb-target-group'\n    ]\n    provider = 'aws'\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n    type = fdp.PickValueInList(registry_type)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n    resource_manager = manager.ResourceManager(FuzzContext(provider, option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        action_registry.parse(data, resource_manager)\n    except (exceptions.PolicyValidationError, ProfileNotFound):\n        pass\n    except (KeyError, TypeError):\n        pass\n\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    aws.AWS()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_actions_process.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom botocore.exceptions import ProfileNotFound\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager, data\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n\n    from c7n.actions import autotag, network, notify\n    from c7n.actions import invoke, webhook, autoscaling\n    from c7n.actions import metric, policy\n\n    from c7n.resources import aws, rdsparamgroup, elasticache, ec2\n    from c7n.resources import emr, account, apigw, elb, s3, glue\n    from c7n.resources import appelb\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    registry_type = [\n        'c7n.data', 'rds-param-group', 'elasticache', 'ec2', 'emr',\n        'aws.account', 'rest-account', 'elb', 's3', 'iac', 'rds',\n        'glue-catalog', 'app-elb-target-group'\n    ]\n    provider = 'aws'\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 6)\n    object = None\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    event = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n    type = fdp.PickValueInList(registry_type)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    resource_manager = manager.ResourceManager(FuzzContext(provider, option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        if choice == 1:\n            object = autotag.AutoTagUser(data, resource_manager)\n            object.validate()\n        elif choice == 2:\n            object = notify.Notify(data, resource_manager)\n            object.validate()\n        elif choice == 3:\n            object = invoke.LambdaInvoke(data, resource_manager)\n        elif choice == 4:\n            resource_manager.config = FuzzConfig(fdp)\n            object = webhook.Webhook(data, resource_manager)\n        elif choice == 5:\n            object = autoscaling.AutoscalingBase(data, resource_manager)\n        elif choice == 6:\n            object = metric.PutMetric(data, resource_manager)\n\n        if object:\n            object.process(resources, event)\n    except (exceptions.PolicyValidationError, ProfileNotFound):\n        pass\n    except (KeyError, TypeError):\n        pass\n\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    aws.AWS()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_actions_validate.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom botocore.exceptions import ProfileNotFound\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager, data\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n\n    from c7n.actions import autotag, network, notify\n\n    from c7n.resources import aws, rdsparamgroup, elasticache, ec2\n    from c7n.resources import emr, account, apigw, elb, s3, glue\n    from c7n.resources import appelb\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    registry_type = [\n        'c7n.data', 'rds-param-group', 'elasticache', 'ec2', 'emr',\n        'aws.account', 'rest-account', 'elb', 's3', 'iac', 'rds',\n        'glue-catalog', 'app-elb-target-group'\n    ]\n    provider = 'aws'\n    object = None\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 3)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n    type = fdp.PickValueInList(registry_type)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n    resource_manager = manager.ResourceManager(FuzzContext(provider, option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        if choice == 1:\n            object = autotag.AutoTagUser(data, resource_manager)\n        elif choice == 2:\n            object = network.ModifyVpcSecurityGroupsAction(data, resource_manager)\n            object.type = fdp.ConsumeUnicodeNoSurrogates(1024)\n        elif choice == 3:\n            object = notify.Notify(data, resource_manager)\n\n        if object:\n            object.validate()\n    except (exceptions.PolicyValidationError, ProfileNotFound):\n        pass\n    except (KeyError, TypeError):\n        pass\n\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    aws.AWS()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_filters_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom botocore.exceptions import ProfileNotFound\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n\n    from c7n.filters import offhours\n\n    from c7n.resources import aws, rdsparamgroup, elasticache, ec2\n    from c7n.resources import emr, account, apigw, elb, s3, glue\n    from c7n.resources import appelb\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    registry_type = [\n        'c7n.data', 'rds-param-group', 'elasticache', 'ec2', 'emr',\n        'aws.account', 'rest-account', 'elb', 's3', 'iac', 'rds',\n        'glue-catalog', 'app-elb-target-group'\n    ]\n    provider = 'aws'\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n\n    type = fdp.PickValueInList(registry_type)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    resource_manager = manager.ResourceManager(FuzzContext(provider, option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        if fdp.ConsumeBool():\n            filter_registry.parse(data, resource_manager)\n        else:\n            schedule_tag = fdp.ConsumeUnicodeNoSurrogates(1024)\n            offhours.OffHour(data, resource_manager).parser.parse(schedule_tag)\n            offhours.OnHour(data, resource_manager).parser.parse(schedule_tag)\n    except (exceptions.PolicyValidationError, ProfileNotFound):\n        pass\n    except (KeyError, TypeError):\n        pass\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    aws.AWS()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_filters_process.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom botocore.exceptions import ProfileNotFound\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager, data\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n\n    from c7n.filters import multiattr, missing, metrics\n    from c7n.filters import offhours, vpc, revisions\n    from c7n.filters import backup, health, iamaccess\n    from c7n.filters import policystatement, iamanalyzer\n\n    from c7n.resources import aws, rdsparamgroup, elasticache, ec2\n    from c7n.resources import emr, account, apigw, elb, s3, glue\n    from c7n.resources import appelb\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    registry_type = [\n        'c7n.data', 'rds-param-group', 'elasticache', 'ec2', 'emr',\n        'aws.account', 'rest-account', 'elb', 's3', 'iac', 'rds',\n        'glue-catalog', 'app-elb-target-group'\n    ]\n    provider = 'aws'\n    object = None\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 12)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    event = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n\n    type = fdp.PickValueInList(registry_type)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    resource_manager = manager.ResourceManager(FuzzContext(provider, option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        if choice == 1:\n            object = multiattr.MultiAttrFilter(data, resource_manager)\n            object.validate()\n        elif choice == 2:\n            data['policy'] = resource_manager.ctx.policy\n            object = missing.Missing(data, resource_manager)\n            object.validate()\n        elif choice == 3:\n            object = offhours.OnHour(data, resource_manager)\n            object.validate()\n        elif choice == 4:\n            object = offhours.OffHour(data, resource_manager)\n            object.validate()\n        elif choice == 5:\n            object = vpc.SubnetFilter(data, resource_manager)\n            object.validate()\n        elif choice == 6:\n            object = vpc.NetworkLocation(data, resource_manager)\n            object.validate()\n        elif choice == 7:\n            object = revisions.Diff(data, resource_manager)\n            object.validate()\n        elif choice == 8:\n            object = backup.ConsecutiveAwsBackupsFilter(data, resource_manager)\n        elif choice == 9:\n            object = health.HealthEventFilter(data, resource_manager)\n        elif choice == 10:\n            object = policystatement.HasStatementFilter(data, resource_manager)\n        elif choice == 11:\n            resource_manager.config = FuzzConfig(fdp)\n            object = iamaccess.CrossAccountAccessFilter(data, resource_manager)\n        elif choice == 12:\n            object = iamanalyzer.AccessAnalyzer(data, resource_manager)\n\n        if object:\n            object.process(resources, event)\n    except (exceptions.PolicyValidationError, ProfileNotFound):\n        pass\n    except ValueError as e:\n        if \"Filter requires resource expression\" not in str(e):\n            raise e\n    except (KeyError, TypeError):\n        pass\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    aws.AWS()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_filters_validate.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom botocore.exceptions import ProfileNotFound\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager, data\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n\n    from c7n.filters import multiattr, missing, metrics\n    from c7n.filters import offhours, vpc, revisions\n\n    from c7n.resources import aws, rdsparamgroup, elasticache, ec2\n    from c7n.resources import emr, account, apigw, elb, s3, glue\n    from c7n.resources import appelb\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    registry_type = [\n        'c7n.data', 'rds-param-group', 'elasticache', 'ec2', 'emr',\n        'aws.account', 'rest-account', 'elb', 's3', 'iac', 'rds',\n        'glue-catalog', 'app-elb-target-group'\n    ]\n    provider = 'aws'\n    object = None\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 10)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n\n    type = fdp.PickValueInList(registry_type)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    resource_manager = manager.ResourceManager(FuzzContext(provider, option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        if choice == 1:\n            object = multiattr.MultiAttrFilter(data, resource_manager)\n        elif choice == 2:\n            data['policy'] = resource_manager.ctx.policy\n            object = missing.Missing(data, resource_manager)\n        elif choice == 3:\n            object = metrics.MetricsFilter(data, resource_manager)\n        elif choice == 4:\n            object = offhours.OnHour(data, resource_manager)\n        elif choice == 5:\n            object = offhours.OffHour(data, resource_manager)\n        elif choice == 6:\n            object = vpc.SecurityGroupFilter(data, resource_manager)\n        elif choice == 7:\n            object = vpc.SubnetFilter(data, resource_manager)\n        elif choice == 8:\n            object = vpc.VpcFilter(data, resource_manager)\n        elif choice == 9:\n            object = vpc.NetworkLocation(data, resource_manager)\n        elif choice == 10:\n            object = revisions.Diff(data, resource_manager)\n\n        if object:\n            object.validate()\n    except (exceptions.PolicyValidationError, ProfileNotFound):\n        pass\n    except ValueError as e:\n        if \"Filter requires resource expression\" not in str(e):\n            raise e\n    except (KeyError, TypeError):\n        pass\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    aws.AWS()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_gcp_actions_validate_process.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom google.auth.exceptions import DefaultCredentialsError\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager, data\n\n    from c7n.filters import FilterRegistry, FilterValidationError\n    from c7n.actions import ActionRegistry\n\n    from c7n_gcp import provider\n    from c7n_gcp.actions import labels, cscc, notify\n\n    from c7n_gcp.resources import iam, dns, armor, build, secret\n    from c7n_gcp.resources import pubsub, logging, network, mlengine\n    from c7n_gcp.resources import bigquery, cloudrun, appengine\n    from c7n_gcp.resources import loadbalancer, sql, service, gke\n    from c7n_gcp.resources import bigtable, memstore, kms, datafusion\n    from c7n_gcp.resources import cloudbilling, function, spanner\n    from c7n_gcp.resources import resourcemanager, source, osconfig\n    from c7n_gcp.resources import dataproc, notebook, artifactregistry\n    from c7n_gcp.resources import compute, storage, deploymentmanager\n    from c7n_gcp.resources import dataflow\n\n\ndef TestOneInput(data):\n    \"\"\"Fuzz tools/c7n_gcp\"\"\"\n    object = None\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 4)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n\n    type = fdp.ConsumeUnicodeNoSurrogates(1024)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    resource_manager = manager.ResourceManager(FuzzContext(\"gcp\", option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        if choice == 1:\n            object = labels.SetLabelsAction(data, resource_manager)\n            object.validate()\n        elif choice == 2:\n            object = labels.LabelDelayedAction(data, resource_manager)\n            object.validate()\n        elif choice == 3:\n            event = _generate_random_dict(fdp)\n            object = cscc.PostFinding(data, resource_manager)\n            object.validate()\n            object.process(resources, event)\n        elif choice == 4:\n            object = notify.Notify(data, resource_manager)\n            object.process(resources)\n\n    except (\n        exceptions.PolicyValidationError,\n        DefaultCredentialsError,\n        FilterValidationError):\n        pass\n    except ValueError as e:\n        if \"Filter requires resource expression\" not in str(e) and \"No GCP Project ID\" not in str(e):\n            raise e\n    except (KeyError, TypeError):\n        pass\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    provider.GoogleCloud()\n\n\ndef main():\n    initializeProviders()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_gcp_filters_validate_process.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom google.auth.exceptions import DefaultCredentialsError\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager, data\n\n    from c7n.filters import FilterRegistry, FilterValidationError\n    from c7n.actions import ActionRegistry\n\n    from c7n_gcp import provider\n\n    from c7n_gcp.filters import labels, recommender, metrics, alerts\n    from c7n_gcp.filters import sccfindings, timerange, iampolicy\n\n    from c7n_gcp.resources import iam, dns, armor, build, secret\n    from c7n_gcp.resources import pubsub, logging, network, mlengine\n    from c7n_gcp.resources import bigquery, cloudrun, appengine\n    from c7n_gcp.resources import loadbalancer, sql, service, gke\n    from c7n_gcp.resources import bigtable, memstore, kms, datafusion\n    from c7n_gcp.resources import cloudbilling, function, spanner\n    from c7n_gcp.resources import resourcemanager, source, osconfig\n    from c7n_gcp.resources import dataproc, notebook, artifactregistry\n    from c7n_gcp.resources import compute, storage, deploymentmanager\n    from c7n_gcp.resources import dataflow\n\n\ndef TestOneInput(data):\n    \"\"\"Fuzz tools/c7n_gcp\"\"\"\n    object = None\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 7)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    event = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n\n    type = fdp.ConsumeUnicodeNoSurrogates(1024)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    resource_manager = resourcemanager.Organization(FuzzContext(\"gcp\", option), manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resources = manager.resources\n\n    try:\n        if choice == 1:\n            object = labels.LabelActionFilter(data, resource_manager)\n            object.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n            object.validate()\n        elif choice == 2:\n            object = recommender.RecommenderFilter(data, resource_manager)\n            object.validate()\n        elif choice == 3:\n            object = metrics.GCPMetricsFilter(data, resource_manager)\n            object.validate()\n        elif choice == 4:\n            object = sccfindings.SecurityComandCenterFindingsFilter(data, resource_manager)\n        elif choice == 5:\n            object = timerange.TimeRangeFilter(data, resource_manager)\n        elif choice == 6:\n            object = iampolicy.IamPolicyFilter(data, resource_manager)\n        elif choice == 7:\n            object = alerts.AlertsFilter(data, resource_manager)\n\n        if object:\n            object.process(resources, event)\n    except (\n        exceptions.PolicyValidationError,\n        DefaultCredentialsError,\n        FilterValidationError):\n        pass\n    except ValueError as e:\n        if \"Filter requires resource expression\" not in str(e) and \"not enough values to unpack\" not in str(e):\n            raise e\n    except OSError as e:\n        if \"Network is unreachable\" not in str(e):\n            raise e\n    except (KeyError, TypeError):\n        pass\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    provider.GoogleCloud()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_gcp_resources_process.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom google.auth.exceptions import DefaultCredentialsError\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, manager, data\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n\n    from c7n_gcp import provider\n\n    from c7n_gcp.resources import iam, dns, armor, build, secret\n    from c7n_gcp.resources import pubsub, logging, network, mlengine\n    from c7n_gcp.resources import bigquery, cloudrun, appengine\n    from c7n_gcp.resources import loadbalancer, sql, service, gke\n    from c7n_gcp.resources import bigtable, memstore, kms, datafusion\n    from c7n_gcp.resources import cloudbilling, function, spanner\n    from c7n_gcp.resources import resourcemanager, source, osconfig\n    from c7n_gcp.resources import dataproc, notebook, artifactregistry\n    from c7n_gcp.resources import compute, storage, deploymentmanager\n    from c7n_gcp.resources import dataflow\n\n\ndef TestOneInput(data):\n    \"\"\"Fuzz tools/c7n_gcp\"\"\"\n    object = None\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 14)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    event = None\n    manager_data = _generate_random_dict(fdp)\n\n    type = fdp.ConsumeUnicodeNoSurrogates(1024)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    resource_manager = manager.ResourceManager(FuzzContext(\"gcp\", option), manager_data)\n\n    try:\n        if choice == 1:\n            object = gke.ServerConfig(data, resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 2:\n            resource_manager = sql.SqlInstance(FuzzContext(provider, option), manager_data)\n            object = sql.SqlInstanceDelete(data, resource_manager)\n        elif choice == 3:\n            object = kms.KmsLocationKmsKeyringFilter(data, resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 4:\n            resource_manager = compute.Instance(FuzzContext(provider, option), manager_data)\n            object = compute.EffectiveFirewall(data, resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 5:\n            object = resourcemanager.HierarchyAction(data, resource_manager)\n        elif choice == 6:\n            object = resourcemanager.AccessApprovalFilter(data, resource_manager)\n        elif choice == 7:\n            object = resourcemanager.AccessApprovalFilter(data, resource_manager)\n\n        resource_manager.action_registry = action_registry\n        resource_manager.filter_registry = filter_registry\n        resource_manager.type = type\n        resources = manager.resources\n\n        if object:\n            if event:\n                object.process(resources, event)\n            else:\n                object.process(resources)\n    except (exceptions.PolicyValidationError, DefaultCredentialsError):\n        pass\n    except ValueError as e:\n        if \"Filter requires resource expression\" not in str(e):\n            raise e\n    except (KeyError, TypeError):\n        pass\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    provider.GoogleCloud()\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_query_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom c7n import exceptions, utils\n\n\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        qp = utils.QueryParser.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n    except exceptions.PolicyValidationError:\n        pass\n\n    c7njme = utils.C7NJMESPathParser()\n    try:\n        c7njme.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n    except:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_resources_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom c7n import exceptions\nfrom c7n.resources import ec2, aws, health, sagemaker, emr\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 5)\n\n    try:\n        if choice == 1:\n            ec2.QueryFilter.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n        elif choice == 2:\n            aws.Arn.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n        elif choice == 3:\n            health.QueryFilter.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n        elif choice == 4:\n            sagemaker.QueryFilter.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n        elif choice == 5:\n            emr.QueryFilter.parse(fdp.ConsumeUnicodeNoSurrogates(1024))\n    except (exceptions.PolicyValidationError, ValueError, TypeError):\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_resources_process.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom botocore.exceptions import ClientError, ProfileNotFound\n\nwith atheris.instrument_imports():\n    from c7n import policy as c7n_policy\n    from c7n import exceptions, data, query, manager\n\n    from c7n.filters import FilterRegistry\n    from c7n.actions import ActionRegistry\n    from c7n.resources.aws import AWS\n\n    from c7n.resources import ml, sar, s3control, ec2, ebs\n    from c7n.resources import batch, mq, route53, securityhub\n    from c7n.resources import vpc, shield, iam, sfn, cloudtrail\n    from c7n.resources import code, appflow, awslambda, emr, ami\n    from c7n.resources import secretsmanager, airflow, account\n    from c7n.resources import cloudfront, elasticsearch\n\ndef TestOneInput(data):\n    \"\"\"Fuzz validate functions in resources package\"\"\"\n    registry_type = [\n        'c7n.data', 'rds-param-group', 'elasticache', 'ec2', 'emr',\n        'aws.account', 'rest-account', 'elb', 's3', 'iac', 'rds',\n        'glue-catalog', 'app-elb-target-group'\n    ]\n    provider = 'aws'\n    object = None\n    event = None\n    resources_object = None\n\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 58)\n\n    option = FuzzOption(fdp)\n    data = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n\n    type = fdp.PickValueInList(registry_type)\n    action_registry = ActionRegistry(\"%s.actions\" % type)\n    filter_registry = FilterRegistry(\"%s.filters\" % type)\n\n    context = FuzzContext(provider, option)\n    resource_manager = query.QueryResourceManager(context, manager_data)\n    resource_manager.action_registry = action_registry\n    resource_manager.filter_registry = filter_registry\n    resource_manager.type = type\n    resource_manager.config = FuzzConfig(fdp)\n    resources = manager.resources\n\n    initializeResources(context, manager_data)\n\n    try:\n        if choice == 1:\n            object = ml.DeleteMLModel(data = data, manager = resource_manager)\n        elif choice == 2:\n            object = sar.Delete(data = data, manager = resource_manager)\n        elif choice == 3:\n            object = sar.CrossAccount(data = data, manager = resource_manager)\n        elif choice == 4:\n            object = s3control.AccessPointCrossAccount(data = data, manager = resource_manager)\n        elif choice == 5:\n            object = s3control.Delete(data = data, manager = resource_manager)\n        elif choice == 6:\n            object = ec2.MonitorInstances(data = data, manager = resource_manager)\n        elif choice == 7:\n            resources_object = batch.UpdateComputeEnvironment(data = data, manager = resource_manager)\n        elif choice == 8:\n            resources_object = batch.DeleteComputeEnvironment(data = data, manager = resource_manager)\n        elif choice == 9:\n            resources_object = batch.DefinitionDeregister(data = data, manager = resource_manager)\n        elif choice == 10:\n            resources_object = mq.Delete(data = data, manager = resource_manager)\n        elif choice == 11:\n            resources_object = route53.SetQueryLogging(data = data, manager = resource_manager)\n            resources_object.validate()\n        elif choice == 12:\n            resources_object = route53.IsQueryLoggingEnabled(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 13:\n            resources_object = route53.ResolverQueryLogConfigAssociate(data = data, manager = resource_manager)\n        elif choice == 14:\n            resources_object = route53.ReadinessCheckCrossAccount(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 15:\n            resources_object = securityhub.SecurityHubFindingFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n            resources_object.validate()\n        elif choice == 16:\n            resources_object = securityhub.PostFinding(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n            resources_object.validate()\n        elif choice == 17:\n            resources_object = cloudfront.IsWafEnabled(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 18:\n            resources_object = vpc.ModifyVpc(data = data, manager = resource_manager)\n        elif choice == 19:\n            resources_object = vpc.DeleteVpc(data = data, manager = resource_manager)\n        elif choice == 20:\n            resources_object = shield.SetShieldProtection(data = data, manager = resource_manager)\n        elif choice == 21:\n            resources_object = iam.SetBoundary(data = data, manager = resource_manager)\n            resources_object.validate()\n        elif choice == 22:\n            resources_object = iam.CertificateDelete(data = data, manager = resource_manager)\n        elif choice == 23:\n            resources_object = iam.SetPolicy(data = data, manager = resource_manager)\n            resources_object.validate()\n        elif choice == 24:\n            resources_object = iam.RoleDelete(data = data, manager = resource_manager)\n        elif choice == 25:\n            resources_object = sfn.InvokeStepFunction(data = data, manager = resource_manager)\n        elif choice == 26:\n            resources_object = cloudtrail.Status(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 27:\n            resources_object = cloudtrail.EventSelectors(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 28:\n            resources_object = cloudtrail.UpdateTrail(data = data, manager = resource_manager)\n            resources_object.validate()\n        elif choice == 29:\n            resources_object = cloudtrail.DeleteTrail(data = data, manager = resource_manager)\n        elif choice == 30:\n            resources_object = code.DeleteApplication(data = data, manager = resource_manager)\n        elif choice == 31:\n            resources_object = code.DeleteDeploymentGroup(data = data, manager = resource_manager)\n        elif choice == 32:\n            resources_object = appflow.DeleteAppFlowResource(data = data, manager = resource_manager)\n        elif choice == 33:\n            resources_object = awslambda.LambdaEnableXrayTracing(data = data, manager = resource_manager)\n        elif choice == 34:\n            resources_object = awslambda.LambdaEventSource(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 35:\n            resources_object = awslambda.LambdaCrossAccountAccessFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 36:\n            resources_object = awslambda.VersionTrim(data = data, manager = resource_manager)\n        elif choice == 37:\n            resources_object = awslambda.RemovePolicyStatement(data = data, manager = resource_manager)\n        elif choice == 38:\n            resources_object = awslambda.LayerCrossAccount(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 39:\n            resources_object = awslambda.LayerRemovePermissions(data = data, manager = resource_manager)\n        elif choice == 40:\n            resources_object = awslambda.DeleteLayerVersion(data = data, manager = resource_manager)\n        elif choice == 41:\n            resources_object = emr.EMRSecurityConfigurationFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 42:\n            resources_object = emr.DeleteEMRSecurityConfiguration(data = data, manager = resource_manager)\n        elif choice == 43:\n            resources_object = emr.EMRServerlessDelete(data = data, manager = resource_manager)\n        elif choice == 44:\n            resources_object = ami.AmiCrossAccountFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 45:\n            resources_object = secretsmanager.CrossAccountAccessFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 46:\n            resources_object = secretsmanager.HasStatementFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 47:\n            resources_object = airflow.UpdateApacheAirflowEnvironment(data = data, manager = resource_manager)\n        elif choice == 48:\n            resources_object = airflow.DeleteApacheAirflowEnvironment(data = data, manager = resource_manager)\n        elif choice == 49:\n            resources_object = account.AccountCredentialReport(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 50:\n            resources_object = account.AccountOrganization(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 51:\n            resources_object = account.MacieEnabled(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 52:\n            resources_object = account.CloudTrailEnabled(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 53:\n            resources_object = account.ConfigEnabled(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 54:\n            resources_object = account.IAMSummary(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 55:\n            resources_object = account.AccessAnalyzer(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 56:\n            resources_object = account.AccountPasswordPolicy(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 57:\n            resources_object = elasticsearch.ElasticSearchCrossAccountAccessFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n        elif choice == 58:\n            resources_object = elasticsearch.ElasticSearchCrossClusterFilter(data = data, manager = resource_manager)\n            event = _generate_random_dict(fdp)\n\n        if object:\n            object.process(data)\n        if resources_object:\n            if event:\n                resources_object.process(resources, event)\n            else:\n                resources_object.process(resources)\n    except (\n        ValueError, ClientError, ProfileNotFound,\n        KeyError, TypeError,\n        exceptions.PolicyValidationError):\n        pass\n    except AttributeError as e:\n        if \"object has no attribute\" not in str(e):\n            raise e\n\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    map[\"name\"] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef initializeProviders():\n    AWS()\n\n\ndef initializeResources(ctx, data):\n    ebs.EBS(ctx, data)\n    ebs.Snapshot(ctx, data)\n    ami.AMI(ctx, data)\n    route53.ResolverQueryLogConfig(ctx, data)\n    emr.EMRSecurityConfiguration(ctx, data)\n\n\ndef main():\n    initializeProviders()\n\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nclass FuzzContext:\n    def __init__(self, name, option):\n        self.options = None\n        self.session_factory = c7n_policy.get_session_factory(name, option)\n        self.policy = FuzzPolicy(name)\n        self.tracer = FuzzTracer()\n        self.execution_id = \"id\"\n        self.start_time = \"1234567890\"\n\n\nclass FuzzPolicy:\n    def __init__(self, provider_name):\n        self.provider_name = provider_name\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nclass FuzzOption:\n    def __init__(self, fdp):\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.profile = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.assume_role = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.external_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nclass FuzzConfig:\n    def __init__(self, fdp):\n        self.account_id = fdp.ConsumeUnicodeNoSurrogates(1024)\n        self.region = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n\nif __name__ == \"__main__\":\n    main()\n\n"
  },
  {
    "path": "projects/cloud-custodian/fuzz_resources_validate.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\n# with atheris.instrument_imports(): # For local testing\nfrom c7n import exceptions, manager\nfrom c7n.resources import health, kafka, sagemaker, ebs, emr, route53\nfrom c7n.resources import awslambda, cw, ec2, ecr, servicecatalog, asg\nfrom c7n.resources import secretsmanager, account, redshift, eks, glue\nfrom c7n.resources import securityhub, cloudtrail, ssm, rds, efs, vpc\nfrom c7n.resources import rdscluster, iam, ami, appelb, s3, cloudfront\n\ndef TestOneInput(data):\n    \"\"\"Fuzz validate functions in resources package\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    choice = fdp.ConsumeIntInRange(1, 56)\n    object = None\n\n    data = _generate_random_dict(fdp)\n    manager_data = _generate_random_dict(fdp)\n    resource_manager = manager.ResourceManager(FuzzContext(FuzzPolicy), manager_data)\n\n    try:\n        if choice == 1:\n            object = health.QueryFilter(data)\n        elif choice == 2:\n            object = kafka.SetMonitoring(data = data, manager = resource_manager)\n        elif choice == 3:\n            object = sagemaker.QueryFilter(data)\n        elif choice == 4:\n            object = ebs.CopySnapshot(data = data, manager = resource_manager)\n        elif choice == 5:\n            object = emr.QueryFilter(data)\n        elif choice == 6:\n            object = awslambda.SetConcurrency(data = data, manager = resource_manager)\n        elif choice == 7:\n            object = cw.EncryptLogGroup(data = data, manager = resource_manager)\n        elif choice == 8:\n            object = ec2.DisableApiStop(data = data, manager = resource_manager)\n        elif choice == 9:\n            object = ec2.Snapshot(data = data, manager = resource_manager)\n        elif choice == 10:\n            object = ec2.QueryFilter(data)\n        elif choice == 11:\n            object = ecr.SetLifecycle(data = data, manager = resource_manager)\n        elif choice == 12:\n            object = route53.SetQueryLogging(data = data, manager = resource_manager)\n        elif choice == 13:\n            object = servicecatalog.RemoveSharedAccounts(data = data, manager = resource_manager)\n        elif choice == 14:\n            object = account.SetAccountPasswordPolicy(data = data, manager = resource_manager)\n        elif choice == 15:\n            object = account.ServiceLimit(data = data, manager = resource_manager)\n        elif choice == 16:\n            object = account.EnableDataEvents(data = data, manager = resource_manager)\n        elif choice == 17:\n            object = account.SetS3PublicBlock(data = data, manager = resource_manager)\n        elif choice == 18:\n            object = account.GlueCatalogEncryptionEnabled(data)\n        elif choice == 19:\n             object = ebs.CopySnapshot(data = data, manager = resource_manager)\n        elif choice == 20:\n             object = ebs.EncryptInstanceVolumes(data = data, manager = resource_manager)\n        elif choice == 21:\n             object = ebs.CreateSnapshot(data = data, manager = resource_manager)\n        elif choice == 22:\n             object = ebs.ModifyVolume(data = data, manager = resource_manager)\n        elif choice == 23:\n             object = eks.UpdateConfig(data = data, manager = resource_manager)\n        elif choice == 24:\n             object = redshift.SetRedshiftLogging(data = data, manager = resource_manager)\n        elif choice == 25:\n             object = redshift.RedshiftSetAttributes(data = data, manager = resource_manager)\n        elif choice == 26:\n             object = glue.SecurityConfigFilter(data)\n        elif choice == 27:\n             object = asg.PropagateTags(data = data, manager = resource_manager)\n        elif choice == 28:\n             object = asg.Update(data = data, manager = resource_manager)\n        elif choice == 29:\n             object = securityhub.SecurityHubFindingFilter(data)\n        elif choice == 30:\n             object = securityhub.PostFinding(data = data, manager = resource_manager)\n        elif choice == 31:\n             object = cloudtrail.UpdateTrail(data = data, manager = resource_manager)\n        elif choice == 32:\n             object = ssm.SendCommand(data = data, manager = resource_manager)\n        elif choice == 33:\n             object = rds.Delete(data = data, manager = resource_manager)\n        elif choice == 34:\n             object = rds.SetPermissions(data = data, manager = resource_manager)\n        elif choice == 35:\n             object = rds.RegionCopySnapshot(data = data, manager = resource_manager)\n        elif choice == 36:\n             object = rds.ModifyDb(data = data, manager = resource_manager)\n        elif choice == 37:\n             object = efs.ConfigureLifecycle(data = data, manager = resource_manager)\n        elif choice == 38:\n             object = rdscluster.ModifyDbCluster(data = data, manager = resource_manager)\n        elif choice == 39:\n             object = vpc.FlowLogv2Filter(data)\n        elif choice == 40:\n             object = vpc.DhcpOptionsFilter(data)\n        elif choice == 41:\n             object = vpc.SGPermission(data)\n        elif choice == 42:\n             object = vpc.SetPermissions(data = data, manager = resource_manager)\n        elif choice == 43:\n             object = iam.SetBoundary(data = data, manager = resource_manager)\n        elif choice == 44:\n             object = iam.SetGroups(data = data, manager = resource_manager)\n        elif choice == 45:\n             object = iam.SetPolicy(data = data, manager = resource_manager)\n        elif choice == 46:\n             object = ami.SetDeprecation(data = data, manager = resource_manager)\n        elif choice == 47:\n             object = ami.SetPermissions(data = data, manager = resource_manager)\n        elif choice == 48:\n             object = appelb.SetS3Logging(data = data, manager = resource_manager)\n        elif choice == 49:\n             object = appelb.SetS3Logging(data = data, manager = resource_manager)\n        elif choice == 50:\n             object = s3.ToggleLogging(data = data, manager = resource_manager)\n        elif choice == 51:\n             object = s3.BucketEncryption(data = data, manager = resource_manager)\n        elif choice == 52:\n             object = s3.BucketEncryption(data = data, manager = resource_manager)\n        elif choice == 53:\n             object = cloudfront.DistributionUpdateAction(data = data, manager = resource_manager)\n        elif choice == 54:\n             object = cloudfront.BaseUpdateAction(data = data, manager = resource_manager)\n        elif choice == 55:\n             object = cloudfront.StreamingDistributionUpdateAction(data = data, manager = resource_manager)\n        elif choice == 56:\n             object = cloudfront.StreamingDistributionUpdateAction(data = data, manager = resource_manager)\n\n        if object:\n            object.validate()\n    except (exceptions.PolicyValidationError, ValueError):\n        pass\n#    except (KeyError, TypeError):\n#        pass\n\ndef _generate_random_dict(fdp):\n    map = dict()\n\n    for count in range(fdp.ConsumeIntInRange(1, 100)):\n        map[fdp.ConsumeUnicodeNoSurrogates(1024)] = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n    return map\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nclass FuzzContext:\n    def __init__(self, policy):\n        self.session_factory = None\n        self.options = None\n        self.policy = policy\n        self.tracer = FuzzTracer()\n\n\nclass FuzzPolicy:\n    def __init__(self):\n        self.provider_name = \"FuzzProviderName\"\n        self.name = \"FuzzName\"\n\n\nclass FuzzTracer:\n    def subsegment(type):\n        return True\n\n\nif __name__ == \"__main__\":\n    main()\n\n"
  },
  {
    "path": "projects/cloud-custodian/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/cloud-custodian/cloud-custodian\nlanguage: python\nmain_repo: https://github.com/cloud-custodian/cloud-custodian\nsanitizers:\n- address\n- undefined\nprimary_contact: \"kapil@stacklet.io\"\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/cloud-hypervisor/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust as builder\n\n## Install build dependencies.\nRUN apt-get update\nRUN git clone --depth 1 https://github.com/cloud-hypervisor/cloud-hypervisor.git\n\n# Always use the latest nightly toolchain since that's the version being\n# validated with Cloud Hypervisor CI\nENV RUSTUP_TOOLCHAIN nightly\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cloud-hypervisor/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/cloud-hypervisor\ncargo fuzz build -O\n\nFUZZ_TARGET_OUTPUT_DIR=target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp fuzz/$FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/cloud-hypervisor/project.yaml",
    "content": "homepage: \"https://github.com/cloud-hypervisor/cloud-hypervisor\"\nlanguage: rust\nprimary_contact: \"bo.arvin.chen@gmail.com\"\nauto_ccs:\n  - \"michael2012zhao@hotmail.com\"\n  - \"Henry.Wang@arm.com\"\n  - \"rbradford@rivosinc.com\"\n  - \"samuel.e.ortiz@protonmail.com\"\n  - \"liuwe@microsoft.com\"\n  - \"seb@rivosinc.com\"\n  - \"nistephe@microsoft.com\"\n  - \"fabduchene@microsoft.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/cloud-hypervisor/cloud-hypervisor'\n"
  },
  {
    "path": "projects/cmake/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Install minimal build dependencies\n# Note: We don't install libssl-dev because it would break MSan\n# (all code must be instrumented for MSan to work properly)\nRUN apt-get update && apt-get install -y \\\n    make \\\n    autoconf \\\n    automake \\\n    libtool \\\n    pkg-config\n\n# Clone official CMake repository (fuzzing support merged in fad74f77)\nRUN git clone --depth 1 https://gitlab.kitware.com/cmake/cmake CMake\nRUN git clone --depth 1 https://github.com/strongcourage/fuzzing-corpus\n\nWORKDIR CMake\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cmake/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build CMake with all bundled dependencies for proper sanitizer support.\n# MSan requires all code to be instrumented, so we use bundled libraries\n# and disable OpenSSL (which would require building from source).\n\nmkdir build-dir && cd build-dir\n\n# Configure CMake\n# - Enable fuzzing targets\n# - Use bundled libraries (required for MSan - all code must be instrumented)\n# - Disable OpenSSL (not needed for fuzzing, avoids uninstrumented code)\n# - Disable server mode (deprecated)\n# - Disable tests (not needed for fuzzing)\ncmake .. \\\n  -DCMAKE_C_COMPILER=\"${CC}\" \\\n  -DCMAKE_CXX_COMPILER=\"${CXX}\" \\\n  -DCMAKE_C_FLAGS=\"${CFLAGS}\" \\\n  -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\" \\\n  -DCMake_BUILD_FUZZING=ON \\\n  -DCMAKE_USE_SYSTEM_LIBRARIES=OFF \\\n  -DCMAKE_USE_OPENSSL=OFF \\\n  -DBUILD_TESTING=OFF \\\n  -DCMAKE_BUILD_TYPE=Release\n\n# Build CMakeLib (contains all the code we want to fuzz)\nmake -j$(nproc) CMakeLib\n\n# Store paths for fuzzer linking\nCMAKE_SOURCE=\"${SRC}/CMake\"\nCMAKE_BUILD=\"${CMAKE_SOURCE}/build-dir\"\nCMAKE_LIB_DIR=\"${CMAKE_BUILD}/Source\"\nUTILITIES_DIR=\"${CMAKE_BUILD}/Utilities\"\n\n# Common include paths\nINCLUDE_FLAGS=\"-I${CMAKE_SOURCE}/Source\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_BUILD}/Source\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_BUILD}/Utilities\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_SOURCE}/Utilities/std\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_SOURCE}/Utilities/cmlibuv/include\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_SOURCE}/Utilities/cmlibrhash\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_SOURCE}/Utilities/cm3p\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_SOURCE}/Utilities\"\nINCLUDE_FLAGS=\"${INCLUDE_FLAGS} -I${CMAKE_SOURCE}/Source/LexerParser\"\n\n# Common libraries to link (order matters for static linking!)\n# NOTE: This list may need updating if CMake adds/removes bundled dependencies\nCOMMON_LIBS=\"${CMAKE_LIB_DIR}/libCMakeLib.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${CMAKE_LIB_DIR}/kwsys/libcmsys.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/std/libcmstd.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmcppdap/libcmcppdap.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmexpat/libcmexpat.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmlibarchive/libarchive/libcmlibarchive.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmliblzma/libcmliblzma.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmzstd/libcmzstd.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmzlib/libcmzlib.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmbzip2/libcmbzip2.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmcurl/lib/libcmcurl.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmnghttp2/libcmnghttp2.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmjsoncpp/libcmjsoncpp.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmlibrhash/libcmlibrhash.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmlibuv/libcmlibuv.a\"\nCOMMON_LIBS=\"${COMMON_LIBS} ${UTILITIES_DIR}/cmllpkgc/libcmllpkgc.a\"\n\n# System libs needed\nSYS_LIBS=\"-lpthread -ldl -lrt\"\n\n# Function to build a fuzzer\nbuild_fuzzer() {\n    local name=$1\n    local source=$2\n    echo \"Building ${name}...\"\n    $CXX $CXXFLAGS ${INCLUDE_FLAGS} -c \"${source}\" -o \"${name}.o\"\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \"${name}.o\" ${COMMON_LIBS} ${SYS_LIBS} -o \"$OUT/${name}\"\n}\n\n# Build fuzzers\ncd ../Tests/Fuzzing\n\n# 1. XML Parser Fuzzer (existing)\nbuild_fuzzer \"xml_parser_fuzzer\" \"xml_parser_fuzzer.cc\"\n\n# 2. ListFile Lexer Fuzzer\nbuild_fuzzer \"cmListFileLexerFuzzer\" \"cmListFileLexerFuzzer.cxx\"\n\n# 3. Generator Expression Fuzzer\nbuild_fuzzer \"cmGeneratorExpressionFuzzer\" \"cmGeneratorExpressionFuzzer.cxx\"\n\n# 4. ELF Fuzzer\nbuild_fuzzer \"cmELFFuzzer\" \"cmELFFuzzer.cxx\"\n\n# 5. Archive Extract Fuzzer\nbuild_fuzzer \"cmArchiveExtractFuzzer\" \"cmArchiveExtractFuzzer.cxx\"\n\n# 6. File Lock Fuzzer\nbuild_fuzzer \"cmFileLockFuzzer\" \"cmFileLockFuzzer.cxx\"\n\n# 7. Expression Parser Fuzzer\nbuild_fuzzer \"cmExprParserFuzzer\" \"cmExprParserFuzzer.cxx\"\n\n# 8. PkgConfig Parser Fuzzer\nbuild_fuzzer \"cmPkgConfigParserFuzzer\" \"cmPkgConfigParserFuzzer.cxx\"\n\n# 9. JSON Parser Fuzzer\nbuild_fuzzer \"cmJSONParserFuzzer\" \"cmJSONParserFuzzer.cxx\"\n\n# 10. Script Fuzzer (highest coverage - executes CMake scripts)\nbuild_fuzzer \"cmScriptFuzzer\" \"cmScriptFuzzer.cxx\"\n\n# 11. String Algorithms Fuzzer\nbuild_fuzzer \"cmStringAlgorithmsFuzzer\" \"cmStringAlgorithmsFuzzer.cxx\"\n\n# 12. Version Fuzzer\nbuild_fuzzer \"cmVersionFuzzer\" \"cmVersionFuzzer.cxx\"\n\n# 13. CMake Path Fuzzer\nbuild_fuzzer \"cmCMakePathFuzzer\" \"cmCMakePathFuzzer.cxx\"\n\n# 14. GCC Depfile Fuzzer\nbuild_fuzzer \"cmGccDepfileFuzzer\" \"cmGccDepfileFuzzer.cxx\"\n\n# 15. Glob Fuzzer\nbuild_fuzzer \"cmGlobFuzzer\" \"cmGlobFuzzer.cxx\"\n\n# Build seed corpora\necho \"Building seed corpora...\"\n\n# Helper function for corpus\nbuild_corpus() {\n    local name=$1\n    local dir=$2\n    if [ -d \"${dir}\" ]; then\n        zip -j \"$OUT/${name}_seed_corpus.zip\" \"${dir}\"/* 2>/dev/null || true\n    fi\n}\n\n# XML corpus (existing)\nzip -j $OUT/xml_parser_fuzzer_seed_corpus.zip \\\n    $SRC/fuzzing-corpus/xml/*.xml 2>/dev/null || true\n\n# New corpora\nbuild_corpus \"cmListFileLexerFuzzer\" \"corpus/listfile\"\nbuild_corpus \"cmGeneratorExpressionFuzzer\" \"corpus/genex\"\nbuild_corpus \"cmELFFuzzer\" \"corpus/elf\"\nbuild_corpus \"cmArchiveExtractFuzzer\" \"corpus/archive\"\nbuild_corpus \"cmFileLockFuzzer\" \"corpus/filelock\"\nbuild_corpus \"cmExprParserFuzzer\" \"corpus/expr\"\nbuild_corpus \"cmPkgConfigParserFuzzer\" \"corpus/pkgconfig\"\nbuild_corpus \"cmJSONParserFuzzer\" \"corpus/json\"\nbuild_corpus \"cmScriptFuzzer\" \"corpus/script\"\nbuild_corpus \"cmStringAlgorithmsFuzzer\" \"corpus/string\"\nbuild_corpus \"cmVersionFuzzer\" \"corpus/version\"\nbuild_corpus \"cmCMakePathFuzzer\" \"corpus/path\"\nbuild_corpus \"cmGccDepfileFuzzer\" \"corpus/depfile\"\n# Note: No corpus/glob directory in upstream - glob patterns are simple strings\n\n# Copy dictionaries (cmFoo.dict -> cmFooFuzzer.dict)\necho \"Copying dictionaries...\"\nfor dict in *.dict; do\n    if [ -f \"$dict\" ]; then\n        base=\"${dict%.dict}\"\n        if [ \"$base\" = \"xml_parser\" ]; then\n            cp \"$dict\" \"$OUT/xml_parser_fuzzer.dict\"\n        else\n            cp \"$dict\" \"$OUT/${base}Fuzzer.dict\"\n        fi\n    fi\ndone\n\n# Copy options files (for timeout/memory limits)\necho \"Copying options files...\"\nfor opts in *.options; do\n    if [ -f \"$opts\" ]; then\n        cp \"$opts\" \"$OUT/\"\n    fi\ndone\n\necho \"Build complete! Built 15 fuzzers with corpora, dictionaries, and options.\"\n"
  },
  {
    "path": "projects/cmake/project.yaml",
    "content": "homepage: \"https://gitlab.kitware.com/cmake/cmake\"\nmain_repo: \"https://gitlab.kitware.com/cmake/cmake\"\nlanguage: c++\nprimary_contact: \"brad.king@kitware.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"tyler.yankee@kitware.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n"
  },
  {
    "path": "projects/cmark/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake python3\nRUN git clone --depth 1 https://github.com/commonmark/cmark.git cmark\nWORKDIR cmark\nCOPY run_tests.sh build.sh *.dict *.options $SRC/\n"
  },
  {
    "path": "projects/cmark/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\ncmake -DBUILD_TESTING=ON ../\nmake -j$(nproc)\ncd ..\n\n$CC $CFLAGS -Isrc -Ibuild/src -c fuzz/cmark-fuzz.c -o cmark_fuzzer.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE cmark_fuzzer.o build/src/libcmark.a -o $OUT/cmark_fuzzer\ncp $SRC/*.options $OUT/\ncp fuzz/dictionary $OUT/cmark.dict\n\nmkdir -p corpus\npython3 test/spec_tests.py --fuzz-corpus corpus --spec test/spec.txt\npython3 test/spec_tests.py --fuzz-corpus corpus --spec test/regression.txt\npython3 test/spec_tests.py --fuzz-corpus corpus --spec test/smart_punct.txt\nzip -j $OUT/cmark_fuzzer_seed_corpus.zip corpus/*\n"
  },
  {
    "path": "projects/cmark/cmark_fuzzer.options",
    "content": "[libfuzzer]\ndict = cmark.dict\n"
  },
  {
    "path": "projects/cmark/project.yaml",
    "content": "homepage: \"http://commonmark.org\"\nlanguage: c++\nprimary_contact: \"jgm@berkeley.edu\"\nauto_ccs:\n  - \"wellnhofer@aevum.de\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/commonmark/cmark.git'\n"
  },
  {
    "path": "projects/cmark/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd build\nmake test\n"
  },
  {
    "path": "projects/cockroachdb/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/cockroachdb/cockroach.git cockroach\nRUN wget https://go.dev/dl/go1.22.9.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.22.9.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\nWORKDIR cockroach\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cockroachdb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cockroach/build/oss-fuzz/build.sh"
  },
  {
    "path": "projects/cockroachdb/project.yaml",
    "content": "homepage: \"https://www.cockroachlabs.com/\"\nlanguage: go\nprimary_contact: \"stan@cockroachlabs.com\"\nauto_ccs:\n  - \"renato@cockroachlabs.com\"\n  - \"herko@cockroachlabs.com\"\n  - \"darryl@cockroachlabs.com\"\nmain_repo: \"https://github.com/cockroachdb/cockroach.git\"\nfile_github_issue: true\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/compress/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/klauspost/compress\nRUN git clone --depth 1 https://github.com/klauspost/compress-fuzz\nWORKDIR compress\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/compress/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the OSS-Fuzz script in the project\n$SRC/compress/ossfuzz/ossfuzz.sh\n"
  },
  {
    "path": "projects/compress/project.yaml",
    "content": "homepage: \"https://github.com/klauspost/compress\"\nlanguage: go\nprimary_contact: \"klauspost@gmail.com\"\nmain_repo: \"https://github.com/klauspost/compress\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/config-validator/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\n# Clone the actual repo with the fuzz target.\nRUN git clone --depth 1 https://github.com/GoogleCloudPlatform/config-validator $GOPATH/src/github.com/GoogleCloudPlatform/config-validator\n\nCOPY build.sh $SRC/\n\n# Required to avoid 'working directory is not part of a module' error.\nWORKDIR $GOPATH/src/github.com/GoogleCloudPlatform/config-validator\n"
  },
  {
    "path": "projects/config-validator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Copy the library files needed to initialize the validator.\nmkdir -p $OUT/validatorfiles\ncp -a 'test/cf/constraints' $OUT/validatorfiles\ncp -a 'test/cf/library' $OUT/validatorfiles\ncp -a 'test/cf/templates' $OUT/validatorfiles\n\n# Copy the corpus.\nzip -jr $OUT/fuzz_config_validator_seed_corpus.zip internal/fuzz/corpus\n\n# Compile the fuzzer.\ncompile_go_fuzzer github.com/GoogleCloudPlatform/config-validator/internal/fuzz Fuzz fuzz_config_validator\n"
  },
  {
    "path": "projects/config-validator/project.yaml",
    "content": "homepage: \"https://github.com/GoogleCloudPlatform/config-validator/\"\nmain_repo: \"https://github.com/GoogleCloudPlatform/config-validator/\"\nprimary_contact: \"mpetkov@google.com\"\nauto_ccs:\n- morgantep@google.com\n- martin.p.petkov@gmail.com\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/configparser/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN python -m pip install 'setuptools~=69.0'\nRUN git clone https://github.com/jaraco/configparser/ configparser\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/configparser\n"
  },
  {
    "path": "projects/configparser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython -m pip install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/configparser/fuzz_dict.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport json\nfrom backports import configparser\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    json_dict = json.loads(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except:\n    return\n  if not isinstance(json_dict, dict):\n    return\n\n  config_parser = configparser.ConfigParser()\n  try:\n    config_parser.read_dict(json_dict)\n  except (configparser.Error):\n    pass\n  except ValueError:\n    # Thrown at: https://github.com/jaraco/configparser/blob/8b5181b4f270be88f3e4572300406587fdbd4a6e/src/backports/configparser/__init__.py#L422\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/configparser/fuzz_read.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom backports import configparser\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  config_parser = configparser.ConfigParser()\n\n  try:\n    config_parser.read_string(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (configparser.Error):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/configparser/project.yaml",
    "content": "homepage: https://github.com/jaraco/configparser/\nmain_repo: https://github.com/jaraco/configparser/\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/connectedhomeip/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\n# Install prerequisite packages\n# See connectedhomeip/docs/guides/BUILDING.md#prerequisites\nRUN apt-get update && \\\n    apt-get install -y --no-install-recommends pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libglib2.0-0\\\n        libavahi-client-dev ninja-build libmount-dev libblkid-dev \\\n        unzip libgirepository1.0-dev libcairo2-dev libreadline-dev patchelf file libevent-dev\n\n# Install Rust for building `cryptography` python package when bootstraping pigweed\nRUN curl https://sh.rustup.rs -sSf | sh -s -- -y\nENV PATH=\"/root/.cargo/bin:${PATH}\"\nRUN rustup install nightly\nRUN rustup default nightly\n\nRUN git clone --depth=1 https://github.com/project-chip/connectedhomeip.git connectedhomeip\n\n# PW_PROJECT_ROOT is used in requirements.build.txt\nENV PW_PROJECT_ROOT=$SRC/connectedhomeip\n\n# Ensure global python has access to build requirements\nRUN pip3 install -r connectedhomeip/scripts/setup/requirements.build.txt\n\n# checkout submodules required for linux\nRUN cd $SRC/connectedhomeip && scripts/checkout_submodules.py --shallow --platform linux\n\n# Bootstrap pigweed environment\nSHELL [\"/bin/bash\", \"-c\"]\nRUN cd $SRC/connectedhomeip && . scripts/bootstrap.sh\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/connectedhomeip/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# workaround to get Fuzz Introspector to build; making it link with lld instead of the environment's gold linker which gives an error\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n  export CFLAGS=$(echo \"$CFLAGS\" | sed 's/gold/lld/g')\n  export CXXFLAGS=$(echo \"$CXXFLAGS\" | sed 's/gold/lld/g')\nfi\n\ncd $SRC/connectedhomeip\n\n# Activate Pigweed environment\nset +u\nPW_ENVSETUP_QUIET=1 source scripts/activate.sh\nset -u\n\n#This adds zap-cli to PATH, needed for fuzzing all-clusters-app\nexport PATH=\"/src/connectedhomeip/.environment/cipd/packages/zap/:$PATH\"\n\n# Create a build directory with the following options:\n# - `oss_fuzz` enables OSS-Fuzz build\n# - `is_clang` selects clang toolchains (does not support AFL fuzzing engine)\n# - `enable_rrti` enables RTTI to support UBSan build\n# - `chip_enable_thread_safety_checks` disabled since OSS-Fuzz clang does not\n#   seem to currently support or need this analysis\n# - `chip_enable_openthread` disabled since OSS-Fuzz clang issues a compile\n#   error on GenericConnectivityManagerImpl_Thread.ipp and current fuzzing\n#   does not differentiate between thread/Wifi/TCP/UDP/BLE connectivity\n#   implementations.\n# - `target_ldflags` forces compiler to use LLVM's linker\ngn gen out/fuzz_targets \\\n  --args=\"\n    oss_fuzz=true \\\n    is_clang=true \\\n    enable_rtti=true \\\n    chip_enable_thread_safety_checks=false \\\n    chip_enable_thread=false \\\n    target_ldflags=[\\\"-fuse-ld=lld\\\"]\"\n\n# Deactivate Pigweed environment to use OSS-Fuzz toolchains\ndeactivate\n\n# Compile fuzz targets\nninja -C out/fuzz_targets fuzz_tests\n\ncp out/fuzz_targets/tests/* $OUT/\n\n# Copy some GLib and GIO runtime libraries into $OUT so fuzzed all-clusters app can run under OSS-Fuzz base-runner, which does not provide these libraries.\nmkdir -p $OUT/lib\ncp /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 $OUT/lib/\n\nfor f in $OUT/fuzz-*; do\n    file \"$f\" | grep -q \"ELF\" && patchelf --set-rpath '$ORIGIN/lib' \"$f\"\ndone\npatchelf --set-rpath '$ORIGIN' $OUT/lib/*.so* 2>/dev/null\n\t\n"
  },
  {
    "path": "projects/connectedhomeip/project.yaml",
    "content": "homepage: \"https://buildwithmatter.com/\"\nlanguage: c++\nprimary_contact: \"andreilitvin@google.com\"\nbase_os_version: ubuntu-24-04\nauto_ccs:\n  - \"asad_haque@comcast.com\"\n  - \"lalabdulkarim@csa-iot.org\"\n  - \"mboyington@google.com\"\n  - \"szewczyk@google.com\"\n  - \"tennessee@google.com\"\n  - \"aalami@csa-iot.org\"\nsanitizers:\n  - address\n  - undefined\n# MemorySanitizer is deactivated due to false positives related to Glib\n# For MSan; Glib and all others libs should be compiled with MSan\n#  - memory\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - centipede\nmain_repo: 'https://github.com/project-chip/connectedhomeip.git'\n"
  },
  {
    "path": "projects/connexion/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip asgiref flask\nRUN git clone --depth=1 https://github.com/python-jsonschema/jsonschema-specifications jsonschema_specifications\nRUN git clone https://github.com/spec-first/connexion connexion\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/connexion\n"
  },
  {
    "path": "projects/connexion/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  # Add relevant data and two hidden modules\n  compile_python_fuzzer $fuzzer \\\n      --add-data ./connexion/resources/schemas/:connexion/resources/schemas/ \\\n      --add-data $SRC/jsonschema_specifications/jsonschema_specifications/schemas:jsonschema_specifications/schemas \\\n      --hidden-import=asgiref \\\n      --hidden-import=flask\ndone\n"
  },
  {
    "path": "projects/connexion/fuzz_query_resolving.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport connexion\n\nfrom werkzeug.datastructures import MultiDict\n\n\ndef fixed_params(data):\n  \"\"\"Create a given URI parser and pass in fixed params for the URI object\n  and a random query.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  collection_formats = ['csv', 'pipes', 'multi']\n  parameters = [{\n      \"name\": \"letters\",\n      \"in\": \"query\",\n      \"type\": \"string\",\n      \"items\": {\n          \"type\": \"string\"\n      },\n      \"collectionFormat\": fdp.PickValueInList(collection_formats),\n  }]\n\n  parser_classes = [\n      connexion.uri_parsing.OpenAPIURIParser,\n      connexion.uri_parsing.Swagger2URIParser,\n      connexion.uri_parsing.AlwaysMultiURIParser,\n      connexion.uri_parsing.FirstValueURIParser,\n  ]\n  parser_class = fdp.PickValueInList(parser_classes)\n  parser = parser_class(parameters, {})\n  param_dict = MultiDict([\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24)),\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24)),\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24)),\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24))\n  ])\n  parser.resolve_query(param_dict.to_dict(flat=False))\n\n\ndef arbitrary(data):\n  \"\"\"Create a given URI parser and pass in random params as well as random\n  query params.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  collection_formats = ['csv', 'pipes', 'multi']\n  parameters = [{\n      fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24),\n      fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24),\n      fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24),\n      fdp.ConsumeUnicodeNoSurrogates(24): {\n          fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24)\n      },\n      \"collectionFormat\": fdp.PickValueInList(collection_formats),\n  }]\n\n  parser_classes = [\n      connexion.uri_parsing.OpenAPIURIParser,\n      connexion.uri_parsing.Swagger2URIParser,\n      connexion.uri_parsing.AlwaysMultiURIParser,\n      connexion.uri_parsing.FirstValueURIParser,\n  ]\n  parser_class = fdp.PickValueInList(parser_classes)\n  try:\n    parser = parser_class(parameters, {})\n  except KeyError:\n    return\n  param_dict = MultiDict([\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24)),\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24)),\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24)),\n      (fdp.ConsumeUnicodeNoSurrogates(24), fdp.ConsumeUnicodeNoSurrogates(24))\n  ])\n  parser.resolve_query(param_dict.to_dict(flat=False))\n\n\ndef TestOneInput(data):\n  fixed_params(data)\n  arbitrary(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/connexion/project.yaml",
    "content": "homepage: https://github.com/spec-first/connexion\nmain_repo: https://github.com/spec-first/connexion\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/containerd/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN apt-get update && apt-get install -y btrfs-progs libc-dev pkg-config libseccomp-dev gcc wget libbtrfs-dev\nRUN git clone --depth 1 https://github.com/containerd/containerd\nRUN git clone --depth=1 https://github.com/AdamKorcz/instrumentation\nCOPY build.sh $SRC/\nWORKDIR $SRC/containerd\n"
  },
  {
    "path": "projects/containerd/build.sh",
    "content": "#/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/containerd/contrib/fuzz/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/containerd/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/containerd/containerd\"\nmain_repo: \"https://github.com/containerd/containerd\"\nprimary_contact: \"security@containerd.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"samuelkarp@google.com\"\n  - \"derek@mcgstyle.net\"\n  - \"estesp@gmail.com\"\n  - \"mikebrow@gmail.com\"\n  - \"cjingram@google.com\"\n  - \"kato.kazuyoshi@gmail.com\"\n  - \"vinaygo@google.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/coreutils/project.yaml",
    "content": "homepage: \"http://www.gnu.org/software/coreutils/\"\nmain_repo: \"https://github.com/coreutils/coreutils\"\nprimary_contact: \"P@draigBrady.com\"\n"
  },
  {
    "path": "projects/cosign/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/sigstore/cosign\n# For json corpus\nRUN git clone --depth=1 https://github.com/dvyukov/go-fuzz-corpus\n# For json dictionary\nRUN git clone --depth=1 https://github.com/rc0r/afl-fuzz\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/cosign\n"
  },
  {
    "path": "projects/cosign/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./test/fuzz/oss_fuzz_build.sh\n\n"
  },
  {
    "path": "projects/cosign/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://sigstore.dev\"\nmain_repo: \"https://github.com/sigstore/cosign\"\nprimary_contact: \"security@sigstore.dev\"\nauto_ccs:\n  - lhinds@sigstore.dev\n  - hblauzvern@sigstore.dev\n  - codysoyland@sigstore.dev\n  - bcallaway@sigstore.dev\nvendor_ccs:\n  - adam@adalogics.com\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/cosmos-sdk/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/cosmos/cosmos-sdk\n\nCOPY build.sh $SRC\nWORKDIR $SRC/cosmos-sdk\n"
  },
  {
    "path": "projects/cosmos-sdk/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash -x ./fuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/cosmos-sdk/project.yaml",
    "content": "homepage: \"https://github.com/cosmos/cosmos-sdk\"\nprimary_contact: \"fuzzing@orijtech.com\"\nauto_ccs:\n  - emmanuel@orijtech.com\n  - cuong@orijtech.com\n  - elias@orijtech.com\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/cosmos/cosmos-sdk\"\n"
  },
  {
    "path": "projects/coturn/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake libssl-dev libevent-dev\nRUN git clone https://github.com/coturn/coturn\nCOPY build.sh $SRC/\nWORKDIR $SRC/coturn/\n"
  },
  {
    "path": "projects/coturn/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir my_build\n\npushd my_build/\ncmake -DFUZZER=ON -DLIB_FUZZING_ENGINE=\"$LIB_FUZZING_ENGINE\" \\\n    -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath,'\\$ORIGIN/lib'\" -DWITH_MYSQL=OFF -Wno-dev ../.\nmake -j$(nproc)\npopd\n\npushd my_build/fuzzing/\ncp FuzzStun $OUT/FuzzStun\ncp FuzzStunClient $OUT/FuzzStunClient\npopd\n\npushd fuzzing/input/\ncp FuzzStun_seed_corpus.zip $OUT/FuzzStun_seed_corpus.zip\ncp FuzzStunClient_seed_corpus.zip $OUT/FuzzStunClient_seed_corpus.zip\npopd\n\npushd /lib/x86_64-linux-gnu/\nmkdir $OUT/lib/\ncp libevent* $OUT/lib/.\npopd\n"
  },
  {
    "path": "projects/coturn/project.yaml",
    "content": "homepage: \"https://github.com/coturn/coturn\"\nlanguage: c\nbase_os_version: ubuntu-24-04\nprimary_contact: \"eakraly@gmail.com\"\nauto_ccs:\n  - \"eakraly@gmail.com\"\n  - \"gustavogb@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/coturn/coturn'\n"
  },
  {
    "path": "projects/coveragepy/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/nedbat/coveragepy\nWORKDIR coveragepy\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/coveragepy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/coveragepy/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom coverage.exceptions import NotPython\nfrom coverage.parser import PythonParser\n\n\ndef TestOneInput(data):\n    \"\"\"Fuzzer for PythonParser\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    \n    t = fdp.ConsumeUnicodeNoSurrogates(1024)\n    if not t:\n        return\n    \n    try:\n        p = PythonParser(text = t)\n        p.parse_source()\n    except (NotPython, MemoryError) as e2:\n        # Catch Memory error for stack overflows\n        # Catch NotPython issues raised by coveragepy\n        pass\n    except ValueError as e:\n        if \"source code string cannot contain null bytes\" in str(e):\n            # Not interesting\n            pass\n        else:\n            raise e\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/coveragepy/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/nedbat/coveragepy/\nlanguage: python\nmain_repo: https://github.com/nedbat/coveragepy\nprimary_contact: nedbat@gmail.com\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n# Bug reports are public by default:\nview_restrictions: none\n"
  },
  {
    "path": "projects/cpp-httplib/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\n# Install brotli.\nRUN apt-get install -y libbrotli-dev\n\n# Install zlib.\nRUN apt-get update && apt-get install -y zlib1g-dev\n\nRUN git clone --depth 1 https://github.com/yhirose/cpp-httplib.git cpp-httplib\n\nWORKDIR cpp-httplib\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cpp-httplib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build fuzz targets specified  in test/Makefile.\ncd test/fuzzing && make -j$(nproc) server_fuzzer\n\n# Copy the fuzzer executables, zip-ed corpora, option and dictionary files to $OUT.\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'          # Copy fuzz-target.\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'     # Copy dictionaries.\nfind . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';' # Copy seed corpora.\n"
  },
  {
    "path": "projects/cpp-httplib/project.yaml",
    "content": "homepage: \"https://github.com/yhirose/cpp-httplib\"\nlanguage: c++\nprimary_contact: \"yuji.hirose.bug@gmail.com\"\nauto_ccs :\n  - \"cpp-httplib-oss-fuzz@googlegroups.com\"\n  - \"omkarjadhav@google.com\"\n  - \"hlivingstone@google.com\"\n  - \"kalaskar@google.com\"\n  - \"ankitlohia@google.com\"\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nmain_repo: 'https://github.com/yhirose/cpp-httplib.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/cppcheck/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth=1 https://github.com/danmar/cppcheck.git\n\nWORKDIR cppcheck\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cppcheck/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build fuzzer\n\ncd $SRC/cppcheck/oss-fuzz\nmake -j$(nproc) oss-fuzz-client\ncp oss-fuzz-client $OUT/\n\n\n"
  },
  {
    "path": "projects/cppcheck/project.yaml",
    "content": "homepage: \"https://cppcheck.sourceforge.net\"\nlanguage: c++\nprimary_contact: \"daniel.marjamaki@gmail.com\"\nauto_ccs:\n  - \"daniel.marjamaki@gmail.com\"\n  - \"ettl.martin78@gmail.com\"\n  - \"firewave0000@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/danmar/cppcheck.git'\n"
  },
  {
    "path": "projects/cppitertools/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/ryanhaining/cppitertools cppitertools\nWORKDIR cppitertools\nCOPY build.sh *.cpp $SRC/\n"
  },
  {
    "path": "projects/cppitertools/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_* .\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -I./ -I./cppitertools fuzz_cppitertools.cpp -std=c++17 -o $OUT/fuzz_cppitertools\n"
  },
  {
    "path": "projects/cppitertools/fuzz_cppitertools.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <chain.hpp>\n#include <combinations.hpp>\n#include <compress.hpp>\n#include <cycle.hpp>\n#include <groupby.hpp>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <iterator>\n#include <string>\n#include <utility>\n#include <vector>\n\nusing iter::chain;\nusing iter::combinations;\nusing iter::compress;\nusing iter::cycle;\nusing iter::groupby;\n\nvoid FuzzChained(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  std::vector<char> v;\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<int>(1, 1024); i++) {\n    v.push_back((char)fdp.ConsumeIntegral<char>());\n  }\n  const auto ch = chain(v, v, v);\n  std::vector<char> v2(std::begin(ch), std::end(ch));\n}\n\nint length(const std::string &s) { return s.size(); }\n\nvoid FuzzGroupby(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  std::vector<std::string> v;\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<int>(1, 1024); i++) {\n    v.push_back(fdp.ConsumeRandomLengthString());\n  }\n  for (auto &&gb : groupby(v, length)) {\n  }\n}\n\nvoid FuzzCycle(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  std::vector<int> v;\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<int>(1, 1024); i++) {\n    v.push_back(fdp.ConsumeIntegral<int>());\n  }\n  auto ch = cycle(v);\n\n  std::vector<int> o;\n  size_t count = 0;\n  for (auto val : ch) {\n    o.push_back(val);\n    count++;\n    if (count > 1500) {\n      break;\n    }\n  }\n}\n\nvoid FuzzCombinations(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  std::string s = fdp.ConsumeRandomLengthString();\n  std::vector<std::vector<char>> sc;\n  size_t count = 0;\n  for (auto &&v : combinations(s, fdp.ConsumeIntegralInRange(1, 16))) {\n    sc.emplace_back(std::begin(v), std::end(v));\n    count++;\n    if (count > 1500) {\n      break;\n    }\n  }\n}\n\nvoid FuzzCompress(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  std::vector<int> ivec;\n  std::vector<bool> bvec;\n  for (int i = 0; i < 100; i++) {\n    ivec.push_back(fdp.ConsumeIntegralInRange(1, 1000000));\n    bvec.push_back(fdp.ConsumeBool());\n  }\n  auto c = compress(ivec, bvec);\n  std::vector<int> v(std::begin(c), std::end(c));\n  const auto &c2 = c;\n  (void)(std::begin(c) == std::end(c2));\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzChained(data, size);\n  FuzzGroupby(data, size);\n  FuzzCycle(data, size);\n  FuzzCombinations(data, size);\n  FuzzCompress(data, size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/cppitertools/project.yaml",
    "content": "homepage: \"https://github.com/ryanhaining/cppitertools\"\nmain_repo: \"https://github.com/ryanhaining/cppitertools\"\nlanguage: c++\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/cpuinfo/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/pytorch/cpuinfo\nWORKDIR cpuinfo\nCOPY build.sh *.c $SRC/\n"
  },
  {
    "path": "projects/cpuinfo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Use fuzzer-file paths instead of kernel paths\nsed -i 's/\"\\/proc\\/cpuinfo\"/\"\\/tmp\\/libfuzzer.config\"/g' src/x86/linux/cpuinfo.c\nsed -i 's/\"\\/sys\\/devices\\/system\\/cpu\\/kernel_max\"/\"\\/tmp\\/libfuzzer.config\"/g' src/linux/processors.c\nmkdir build\ncd build\ncmake \\\n    -DCPUINFO_BUILD_UNIT_TESTS=OFF \\\n    -DCPUINFO_BUILD_MOCK_TESTS=OFF \\\n    -DCPUINFO_BUILD_BENCHMARKS=OFF \\\n    ..\nmake\n\n\n$CC $CFLAGS -c $SRC/fuzz_cpuinfo.c -o fuzz_cpuinfo.o \\\n    -I/src/cpuinfo/src -I/src/cpuinfo/include\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_cpuinfo.o -o $OUT/fuzz_cpuinfo \\\n    ./libcpuinfo.a\n"
  },
  {
    "path": "projects/cpuinfo/fuzz_cpuinfo.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <fcntl.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <unistd.h>\n\n#include <linux/api.h>\n#include <x86/linux/api.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.config\");\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  struct cpuinfo_x86_linux_processor processors[256];\n  cpuinfo_x86_linux_parse_proc_cpuinfo(256, processors);\n  cpuinfo_linux_get_max_processors_count();\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/cpuinfo/project.yaml",
    "content": "homepage: \"https://github.com/pytorch/cpuinfo\"\nmain_repo: \"https://github.com/pytorch/cpuinfo\"\nlanguage: c\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/cpython3/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y build-essential libncursesw5-dev \\\n\tlibreadline-dev libssl-dev libgdbm-dev \\\n\tlibc6-dev libsqlite3-dev tk-dev libbz2-dev \\\n\tzlib1g-dev libffi-dev\n\nRUN git clone https://github.com/python/cpython.git cpython3\nWORKDIR cpython3\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/cpython3/build.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ignore memory leaks from python scripts invoked in the build\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nexport MSAN_OPTIONS=\"halt_on_error=0:exitcode=0:report_umrs=0\"\n\n# Remove -pthread from CFLAGS, this trips up ./configure\n# which thinks pthreads are available without any CLI flags\nCFLAGS=${CFLAGS//\"-pthread\"/}\n\n# Ensure assert statements are enabled. It may help identify problems\n# earlier if those fire.\nCFLAGS=\"${CFLAGS} -UNDEBUG\"\n\n# We use some internal CPython API.\nCFLAGS=\"${CFLAGS} -IInclude/internal/\"\n\nFLAGS=()\ncase $SANITIZER in\n  address)\n    FLAGS+=(\"--with-address-sanitizer\")\n    ;;\n  memory)\n    FLAGS+=(\"--with-memory-sanitizer\")\n    # installing ensurepip takes a while with MSAN instrumentation, so\n    # we disable it here\n    FLAGS+=(\"--without-ensurepip\")\n    # -msan-keep-going is needed to allow MSAN's halt_on_error to function\n    FLAGS+=(\"CFLAGS=-mllvm -msan-keep-going=1\")\n    ;;\n  undefined)\n    FLAGS+=(\"--with-undefined-behavior-sanitizer\")\n    ;;\nesac\n./configure \"${FLAGS[@]:-}\" --prefix $OUT\n\n# We use altinstall to avoid having the Makefile create symlinks\nmake -j$(nproc) altinstall\n\nFUZZ_DIR=Modules/_xxtestfuzz\nfor fuzz_test in $(cat $FUZZ_DIR/fuzz_tests.txt)\ndo\n  # Build (but don't link) the fuzzing stub with a C compiler\n  $CC $CFLAGS $($OUT/bin/python*-config --cflags) $FUZZ_DIR/fuzzer.c \\\n    -D _Py_FUZZ_ONE -D _Py_FUZZ_$fuzz_test -c -Wno-unused-function \\\n    -o $WORK/$fuzz_test.o\n  # Link with C++ compiler to appease libfuzzer\n  $CXX $CXXFLAGS -rdynamic $WORK/$fuzz_test.o -o $OUT/$fuzz_test \\\n    $LIB_FUZZING_ENGINE $($OUT/bin/python*-config --ldflags --embed)\n\n  # Zip up and copy any seed corpus\n  if [ -d \"${FUZZ_DIR}/${fuzz_test}_corpus\" ]; then\n    zip -j \"${OUT}/${fuzz_test}_seed_corpus.zip\" ${FUZZ_DIR}/${fuzz_test}_corpus/*\n  fi\n  # Copy over the dictionary for this test\n  if [ -e \"${FUZZ_DIR}/dictionaries/${fuzz_test}.dict\" ]; then\n    cp \"${FUZZ_DIR}/dictionaries/${fuzz_test}.dict\" \"$OUT/${fuzz_test}.dict\"\n  fi\ndone\n\n# A little bit hacky but we have to copy $OUT/include to\n# $OUT/$OUT/include as the coverage build needs all source\n# files used in execution and expects it to be there.\n#   See projects/tensorflow/build.sh for prior art\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  mkdir -p $OUT/$OUT\n  cp -r $OUT/include $OUT/$OUT/\nfi\n"
  },
  {
    "path": "projects/cpython3/project.yaml",
    "content": "homepage: \"https://python.org/\"\nlanguage: c++\nprimary_contact: \"seth@python.org\"\nmain_repo: \"https://github.com/python/cpython\"\nauto_ccs:\n - \"alex.gaynor@gmail.com\"\n - \"ammar@ammaraskar.com\"\n - \"greg@krypto.org\"\n - \"pablogsal@python.org\"\n - \"stanulbrych@gmail.com\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nsanitizers:\n - address\n - memory\n - undefined\n"
  },
  {
    "path": "projects/cpython3/run_tests.sh",
    "content": "#!/bin/bash\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ignore memory leaks from python scripts invoked in the build\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Skip network related unit test case\nmake test TESTOPTS=\"-u all,-network,-urlfetch\"\n"
  },
  {
    "path": "projects/cras/Dockerfile",
    "content": "# Copyright 2017 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n#\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Defines a docker image that can build cras fuzzers.\n#\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN apt-get -y update && \\\n      apt-get install -y \\\n      automake \\\n      build-essential \\\n      cmake \\\n      g++ \\\n      git \\\n      libasound-dev \\\n      libdbus-1-dev \\\n      libgtest-dev \\\n      libncurses5-dev \\\n      libsbc-dev \\\n      libspeexdsp-dev \\\n      libsystemd-dev \\\n      libclang1 \\\n      libtool \\\n      libudev-dev \\\n      wget \\\n      zip\nRUN apt-get clean\n\nRUN cd /tmp && git clone https://github.com/google/googletest.git -b v1.8.x && \\\n      cd googletest && \\\n      mkdir build && cd build && \\\n      cmake .. -DBUILD_SHARED_LIBS=ON \\\n         -DINSTALL_GTEST=ON \\\n         -DCMAKE_INSTALL_PREFIX:PATH=/usr && \\\n      make && make install\n\n# Need to build and install alsa so there is a static lib.\nRUN mkdir -p /tmp/alsa-build && cd /tmp/alsa-build && \\\n      wget https://alsa-project.org/files/pub/lib/alsa-lib-1.1.4.1.tar.bz2 && \\\n      echo 91bb870c14d1c7c269213285eeed874fa3d28112077db061a3af8010d0885b76 alsa-lib-1.1.4.1.tar.bz2 | sha256sum -c && \\\n      tar xjf alsa-lib-* && \\\n      cd alsa-lib-* && \\\n      ./configure --enable-static --disable-shared && \\\n      make clean && \\\n      make -j$(nproc) all && \\\n      make install\n\nRUN cd $SRC && git clone https://chromium.googlesource.com/chromiumos/third_party/adhd\nWORKDIR adhd\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cras/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2017 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n#\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd ${SRC}/adhd\ndevtools/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/cras/project.yaml",
    "content": "homepage: \"https://www.chromium.org\"\nlanguage: rust\nprimary_contact: \"cujomalainey@chromium.org\"\nauto_ccs:\n  - \"hychao@chromium.org\"\n  - \"cychiang@chromium.org\"\n  - \"yuhsuan@chromium.org\"\n  - \"enshuo@chromium.org\"\n  - \"judyhsiao@chromium.org\"\n  - \"johnylin@chromium.org\"\n  - \"aaronyu@google.com\"\n  - \"hunghsienchen@chromium.org\"\n  - \"htcheong@chromium.org\"\n  - \"jrwu@chromium.org\"\n  - \"cranelw@google.com\"\n  - \"eddyhsu@google.com\"\n  - \"andyross@google.com\"\n  - \"bailideng@google.com\"\n  - \"normanbt@google.com\"\n  - \"pteerapong@google.com\"\n  - \"whalechang@google.com\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nbuilds_per_day: 4\nmain_repo: 'https://chromium.googlesource.com/chromiumos/third_party/adhd'\n"
  },
  {
    "path": "projects/cri-o/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y libaio-dev autoconf gettext texinfo \\\n\tlibbtrfs-dev git libassuan-dev libdevmapper-dev libglib2.0-dev libc6-dev \\\n\tlibgpgme-dev libgpg-error-dev libseccomp-dev libsystemd-dev libselinux1-dev \\\n\tpkg-config go-md2man libudev-dev software-properties-common systemd\nRUN wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.23.4.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\nRUN git clone --depth 1 https://github.com/cri-o/cri-o\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nCOPY build.sh $SRC/\nRUN wget https://sourceware.org/ftp/lvm2/LVM2.2.03.15.tgz \\\n    && tar -xvzf ./LVM2.2.03.15.tgz \\\n    && cd LVM2.2.03.15 \\\n    && ./configure --disable-selinux \\\n    && make\nWORKDIR $SRC/cri-o\n"
  },
  {
    "path": "projects/cri-o/build.sh",
    "content": "#/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/cri-o/build.sh"
  },
  {
    "path": "projects/cri-o/project.yaml",
    "content": "homepage: \"https://cri-o.io/\"\nmain_repo: \"https://github.com/cri-o/cri-o\"\nprimary_contact: \"cncf-crio-security@lists.cncf.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"pehunt@redhat.com\"\n  - \"sgrunert@redhat.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/croaring/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/RoaringBitmap/CRoaring croaring\nRUN mv croaring/fuzz/* $SRC/\nRUN sed -i 's/DENABLE_ROARING_TESTS=OFF/DENABLE_ROARING_TESTS=ON/g' $SRC/build.sh\nCOPY run_tests.sh $SRC/\nWORKDIR $SRC/croaring\n\n"
  },
  {
    "path": "projects/croaring/project.yaml",
    "content": "homepage: \"https://roaringbitmap.org\"\nlanguage: c\nprimary_contact: \"lemire@gmail.com\"\nauto_ccs:\n  - \"k2@ktwo.ca\"\n  - \"lemire@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory:\n      experimental: True\nmain_repo: \"https://github.com/RoaringBitmap/CRoaring\"\nfuzzing_engines:\n  - libfuzzer\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/croaring/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\n# Skipping realdata_unit as it is failing\nctest --test-dir build-dir -E realdata_unit\n"
  },
  {
    "path": "projects/cron-utils/CronParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.cronutils.parser.CronParser;\nimport com.cronutils.model.definition.CronDefinition;\nimport com.cronutils.model.definition.CronDefinitionBuilder;\nimport com.cronutils.model.CronType;\n\npublic class CronParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    CronType[] cronTypes = { CronType.CRON4J, CronType.QUARTZ, CronType.UNIX, CronType.SPRING, CronType.SPRING53 };\n    CronType cronType = data.pickValue(cronTypes);\n\n    CronDefinition cronDef = CronDefinitionBuilder.instanceDefinitionFor(cronType);\n    CronParser parser = new CronParser(cronDef);\n    try{\n      parser.parse(data.consumeRemainingAsString());\n    }\n    catch(IllegalArgumentException | ArrayIndexOutOfBoundsException e){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/cron-utils/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/jmrozanec/cron-utils.git cron-utils\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/cron-utils\n"
  },
  {
    "path": "projects/cron-utils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/cron-utils-$CURRENT_VERSION.jar\" $OUT/cron-utils.jar\n\nALL_JARS=\"cron-utils.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/cron-utils/project.yaml",
    "content": "homepage: \"https://github.com/jmrozanec/cron-utils\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/jmrozanec/cron-utils.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/croniter/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/kiorky/croniter\nCOPY build.sh *.py $SRC/\nWORKDIR croniter\n"
  },
  {
    "path": "projects/croniter/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Workaround for oss-fuzz not being able to recognise which croniter modules are used\n# See https://github.com/ossf/fuzz-introspector/issues/1010\nexport PYFUZZPACKAGE=$SRC/croniter/src/croniter\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/croniter/fuzz_iter.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nfrom datetime import datetime\nfrom croniter import croniter\nfrom croniter.croniter import CroniterError, CroniterBadTypeRangeError\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  base = datetime(2012, 4, 6, 13, 26, 10)\n  try:\n    cron_str = fdp.ConsumeString(50)\n    hash_id = fdp.ConsumeBytes(2)\n    croniter.is_valid(cron_str, hash_id=hash_id)\n    itr = croniter(cron_str, base, hash_id=hash_id)\n    idx = 0\n    for v in itr.all_next():\n      idx += 1\n      if idx > 10:\n        break\n    itr.get_next()\n    itr.get_prev()\n  except (CroniterError, CroniterBadTypeRangeError) as e:\n    pass\n  except NameError as e:\n    # Catch https://github.com/kiorky/croniter/blob/bb5a45196e5f8f15fd0890f4ee5e9697671a3fe2/src/croniter/croniter.py#L781\n    if not \"'exc' is not defined\" in str(e):\n      raise e\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/croniter/fuzz_match.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport datetime\nfrom croniter import croniter\nfrom croniter.croniter import CroniterError, CroniterBadTypeRangeError\n\n\ndef RandomDateTime(fdp):\n    return datetime.datetime.now() + fdp.ConsumeProbability() * datetime.timedelta(days=200000)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  cron_str = fdp.ConsumeString(50)\n  testdate = RandomDateTime(fdp)\n  try:\n    croniter.match(cron_str, testdate)\n  except (CroniterError, CroniterBadTypeRangeError) as e:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/croniter/fuzz_range.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport datetime\nfrom croniter import croniter_range\nfrom croniter.croniter import CroniterError, CroniterBadTypeRangeError\n\n\ndef RandomDateTime(fdp):\n    return datetime.datetime.now() + fdp.ConsumeProbability() * datetime.timedelta(days=200000)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  cron_str = fdp.ConsumeString(50)\n  start = RandomDateTime(fdp)\n  stop = RandomDateTime(fdp)\n  try:\n    idx = 0\n    for dt in croniter_range(start, stop, cron_str):\n      idx += 1\n      if idx > 10:\n        break\n  except (CroniterError, CroniterBadTypeRangeError) as e:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/croniter/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/kiorky/croniter\nlanguage: python\nmain_repo: https://github.com/kiorky/croniter\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- sean@compactcloud.co.uk\n"
  },
  {
    "path": "projects/crossplane/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/crossplane/crossplane-runtime $SRC/crossplane-runtime\nRUN git clone --depth 1 https://github.com/crossplane/crossplane $SRC/crossplane\nCOPY build.sh $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/crossplane/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/crossplane\n$SRC/crossplane/test/fuzz/oss_fuzz_build.sh\ncd $SRC/crossplane-runtime\n$SRC/crossplane-runtime/test/fuzz/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/crossplane/project.yaml",
    "content": "homepage: \"https://github.com/crossplane/crossplane\"\nmain_repo: \"https://github.com/crossplane/crossplane\"\nprimary_contact: \"jbw976@gmail.com\"\nauto_ccs :\n  - \"me@muvaf.com\"\n  - \"nicc@rk0n.org\"\n  - \"alper.oss.fuzz@gmail.com\"\n  - \"p.scorsolini@gmail.com\"\nvendor_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/crosvm/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth=1 --recursive https://chromium.googlesource.com/crosvm/crosvm $SRC/crosvm\n\nRUN apt-get update && apt-get install --yes --no-install-recommends \\\n    libclang-dev \\\n    pkg-config \\\n    libcap-dev\n\nCOPY build.sh $SRC\n"
  },
  {
    "path": "projects/crosvm/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd crosvm\n\n# Build crosvm fuzzers\n# Unset the SRC variable as it will interfere with minijail's common.mk framework.\nenv -u SRC cargo fuzz build -O\n\n# Copy fuzzer binaries to $OUT\nFUZZ_TARGET_OUTPUT_DIR=\"target/x86_64-unknown-linux-gnu/release\"\nfor f in fuzz/fuzz_targets/*.rs; do\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp \"${FUZZ_TARGET_OUTPUT_DIR}/${FUZZ_TARGET_NAME}\" \"$OUT/\"\ndone\n"
  },
  {
    "path": "projects/crosvm/project.yaml",
    "content": "homepage: \"http://crosvm.dev\"\nlanguage: rust\nprimary_contact: \"denniskempin@google.com\"\nauto_ccs:\n  - \"crosvm-core@google.com\"\n  - \"dverkamp@google.com\"\n  - \"fmayle@google.com\"\n  - \"keiichiw@google.com\"\n  - \"takayas@google.com\"\n  - \"zihanchen@google.com\"\nmain_repo: \"https://chromium.googlesource.com/crosvm/crosvm\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/crow/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake make libasio-dev\n\nRUN git clone --depth 1 https://github.com/CrowCpp/Crow.git crow\nRUN cp $SRC/crow/tests/fuzz/build.sh $SRC/\nCOPY run_tests.sh $SRC/run_tests.sh\nWORKDIR crow\n\n"
  },
  {
    "path": "projects/crow/project.yaml",
    "content": "homepage: \"https://crowcpp.org/master/\"\nlanguage: c++\nprimary_contact: \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/CrowCpp/Crow\"\n"
  },
  {
    "path": "projects/crow/run_tests.sh",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/crow/build\nASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure -j$(nproc)\n"
  },
  {
    "path": "projects/cryptofuzz/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust@sha256:c5216a9896a598dced7ce6708bb3226e443473f567045b4f282595776cc641f1\n# ! Project pinned after a clang update and an afl link error. Log: https://oss-fuzz-gcb-logs.storage.googleapis.com/log-8bc8a5ea-9bfb-421d-bfe9-911828e88741.txt\n\nRUN apt-get update && \\\n    apt-get install -y software-properties-common wget make autoconf automake libtool build-essential cmake mercurial gyp ninja-build zlib1g-dev libsqlite3-dev bison flex texinfo lzip bsdmainutils\n\n# mbedtls needs jsonschema which needs rpds-py which needs pip>=20\n# or a Rust toolchain.\nRUN pip3 install 'pip>=20'\n\nRUN wget https://go.dev/dl/go1.22.7.linux-amd64.tar.gz\nRUN wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz\nRUN git clone --depth 1 https://github.com/golang/go go-dev\nRUN git clone --depth 1 https://github.com/golang/crypto go-crypto\nRUN git clone --depth 1 https://github.com/golang/sys.git go-sys\nRUN git clone --depth 1 https://github.com/guidovranken/cryptofuzz\nRUN git clone --depth 1 https://github.com/guidovranken/cryptofuzz-corpora\nRUN git clone --depth 1 https://github.com/openssl/openssl\nRUN git clone --depth 1 https://boringssl.googlesource.com/boringssl\nRUN git clone --depth 1 git://git.gnupg.org/libgcrypt.git\nRUN git clone --depth 1 https://github.com/weidai11/cryptopp/\nRUN wget https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.49.tar.bz2\nRUN git clone --depth 1 -b oss-fuzz https://github.com/project-everest/hacl-star evercrypt\nRUN git clone --depth 1 https://github.com/google/cityhash.git\nRUN git clone --depth 1 https://github.com/randombit/botan.git\nRUN git clone --depth 1 https://github.com/wolfSSL/wolfssl.git\nRUN git clone --depth 1 https://github.com/wolfSSL/wolfsm\nRUN git clone --depth 1 --recurse-submodules -b mbedtls-3.6 https://github.com/Mbed-TLS/mbedtls.git\nRUN hg clone https://hg.mozilla.org/projects/nspr\nRUN hg clone https://hg.mozilla.org/projects/nss\nRUN git clone --depth 1 https://github.com/jedisct1/libsodium.git\nRUN git clone --depth 1 https://github.com/libtom/libtomcrypt.git\nRUN git clone --depth 1 https://github.com/microsoft/SymCrypt.git\nRUN hg clone https://gmplib.org/repo/gmp/ libgmp/ || \\\n    (wget 'https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz' && tar xf gmp-6.2.1.tar.lz && mv $SRC/gmp-6.2.1/ $SRC/libgmp/)\nRUN wget https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.0.tar.gz\nRUN git clone --depth 1 https://github.com/indutny/bn.js.git\nRUN git clone --depth 1 https://github.com/MikeMcl/bignumber.js.git\nRUN git clone --depth 1 https://github.com/guidovranken/libfuzzer-js.git\nRUN git clone --depth 1 https://github.com/brix/crypto-js.git\nRUN git clone --depth 1 https://github.com/trezor/trezor-firmware.git\nRUN git clone --depth 1 https://github.com/Cyan4973/xxHash.git\nRUN git clone --depth 1 https://github.com/paulmillr/noble-ed25519.git\nRUN git clone --depth 1 https://github.com/paulmillr/noble-bls12-381.git\nRUN git clone --depth 1 https://github.com/paulmillr/noble-secp256k1.git\nRUN git clone --depth 1 https://github.com/supranational/blst.git\nRUN git clone --depth 1 https://github.com/bitcoin-core/secp256k1.git\nRUN apt-get remove -y libunwind8\nRUN apt-get update && apt-get install -y libssl-dev\nRUN wget https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\nRUN wget https://nodejs.org/dist/v14.17.1/node-v14.17.1-linux-x64.tar.xz\nRUN pip3 install -r $SRC/mbedtls/scripts/basic.requirements.txt\nRUN bash -c \"wget $(curl https://ziglang.org/download/index.json | jq -r '.master.\"x86_64-linux\".tarball') -O zig-latest.tar.xz\"\n\nCOPY build.sh xxd.c $SRC/\n"
  },
  {
    "path": "projects/cryptofuzz/README.md",
    "content": "This OSS-Fuzz project is a composite of multiple cryptographic libraries. It invokes a large amount of implementations for cryptographic primitives across multiple popular libraries, coordinated from a single fuzzing harness.\n\nIts objectives are:\n\n1. To assert programmatic soundness: find memory bugs, crashes and time-outs with the help of sanitizers.\n2. To assert semantic soundness: detect invalid output occurring under legal use of the library's API.\n\nOne method to detect invalid results (point 2) is to assert equivalence between two or more outputs generated by a single library with the same input (but where each output allowed to be computed differently), aka \"self-differential\" testing. See [here](https://github.com/openssl/openssl/issues/8675) for a bug found with self-differential testing.\n\nAnother method is to compare a result against the result of different library, where both results are expected to be the same. If they are not the same, this indicates a bug in at least one library. This second method is what merits the composite setup of the project; adherence to the normative specification of a cryptographic primitive is implicitly asserted under the assumption that at least one implementation gets it right. Because determining which one of libraries gets it wrong cannot be reliably automated, all library maintainers are notified in this event, so that the cause of discrepancy can be resolved collaboratively.\n\nLibrary builds embedding optimized assembly language code and those using pure C implementations have been assigned separate fuzzer targets (binaries), because either implementation can have distinct bugs that will not transpire if only the other one is tested.\n\nOpenSSL, BoringSSL and LibreSSL are assigned separate fuzzing targets because their exported symbols largely overlap and can therefore not be bundled into a single binary.\n\nAt this time of writing, no differential testing is performed, because support for additional libraries is not ready yet, but I intend to support mbed TLS and libsodium shortly, and support for popular or built-in cryptography implementations for Go, Rust, Java and Javascript is planned.\n\nTo further clear things up, at some point in the future, the matrix of support libraries versus fuzzing binaries could look like this:\n\nA binary embedding OpenSSL, mbed TLS, libsodium, Go, Rust, Java, Javascript, ..., ...\n\nA binary embedding BoringSSL, mbed TLS, libsodium, Go, Rust, Java, Javascript, ..., ...\n\nA binary embedding LibreSSL, mbed TLS, libsodium, Go, Rust, Java, Javascript, ..., ...\n\nand another 3 binaries for all of the pure C versions (no assembly language optimizations) of these libraries.\n\nAs more libraries are added, I will add a throttle mechanism to Cryptofuzz to ensure that no more than, say, 4 libraries will be called during a single iteration, so that no amount of supported libraries will impact the overall speed of the fuzzing process.\n\nMore information can be found at [Cryptofuzz](https://github.com/guidovranken/cryptofuzz).\n"
  },
  {
    "path": "projects/cryptofuzz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# TODO(metzman): Switch this to LIB_FUZZING_ENGINE when it works.\n# https://github.com/google/oss-fuzz/issues/2336\n\nexport CXXFLAGS=\"$CXXFLAGS -D_LIBCPP_DEBUG=1\"\nexport GO111MODULE=off\n\n# Install Go stable binaries\nmkdir $SRC/go-bootstrap\ncd $SRC/go-bootstrap\n\ntar zxf $SRC/go1.23.1.linux-amd64.tar.gz\nmv go/ go-123\nexport GOROOT_123=$SRC/go-bootstrap/go-123/\nexport GOPATH_123=$GOROOT_123/packages/\nmkdir $GOPATH_123\nmkdir -p $GOPATH_123/src/golang.org/x/crypto/\ncp -R $SRC/go-crypto/* $GOPATH_123/src/golang.org/x/crypto/\nmkdir -p $GOPATH_123/src/golang.org/x/sys/\ncp -R $SRC/go-sys/* $GOPATH_123/src/golang.org/x/sys/\nexport PATH_GO_123=$GOROOT_123/bin:$GOROOT_123/packages/bin:$PATH\n\ntar zxf $SRC/go1.22.7.linux-amd64.tar.gz\nmv go/ go-122\nexport GOROOT_122=$SRC/go-bootstrap/go-122/\nexport GOPATH_122=$GOROOT_122/packages/\nmkdir $GOPATH_122\nmkdir -p $GOPATH_122/src/golang.org/x/crypto/\ncp -R $SRC/go-crypto/* $GOPATH_122/src/golang.org/x/crypto/\nmkdir -p $GOPATH_122/src/golang.org/x/sys/\ncp -R $SRC/go-sys/* $GOPATH_122/src/golang.org/x/sys/\nexport PATH_GO_122=$GOROOT_122/bin:$GOROOT_122/packages/bin:$PATH\n\n# Compile Go development version\ncd $SRC/go-dev/src/\nexport OLD_PATH=$PATH\nPATH=\"$PATH_GO_123\" ./make.bash\nexport GOROOT_DEV=$(realpath ../)\nexport GOPATH_DEV=$GOROOT_DEV/packages\nmkdir $GOPATH_DEV\nmkdir -p $GOPATH_DEV/src/golang.org/x/crypto/\ncp -R $SRC/go-crypto/* $GOPATH_DEV/src/golang.org/x/crypto/\nmkdir -p $GOPATH_DEV/src/golang.org/x/sys/\ncp -R $SRC/go-sys/* $GOPATH_DEV/src/golang.org/x/sys/\nexport PATH_GO_DEV=$GOROOT_DEV/bin:$GOROOT_DEV/packages/bin:$PATH\n\nif [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_GOLANG\"\nfi\n\nif [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\nthen\n    # Install nodejs/npm\n    # It is required for building noble-bls12-381\n    cd $SRC/\n    tar Jxf node-v14.17.1-linux-x64.tar.xz\n    export PATH=\"$PATH:$SRC/node-v14.17.1-linux-x64/bin/\"\nfi\n\n# Compile xxd\n$CC $SRC/xxd.c -o /usr/bin/xxd\n\n# Copy the upstream checkout of xxHash over the old version\nrm -rf $SRC/cryptofuzz/modules/reference/xxHash/\ncp -R $SRC/xxHash/ $SRC/cryptofuzz/modules/reference/\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_84_0.tar.bz2\ncd boost_1_84_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\ncp -R boost/ /usr/include/\n\nexport LINK_FLAGS=\"\"\nif [[ $CFLAGS = *-m32* ]]\nthen\n    export LINK_FLAGS=\"$LINK_FLAGS -latomic\"\nfi\nexport INCLUDE_PATH_FLAGS=\"\"\n\n# Generate lookup tables. This only needs to be done once.\ncd $SRC/cryptofuzz\npython gen_repository.py\n\n# This enables runtime checks for C++-specific undefined behaviour.\nexport CXXFLAGS=\"$CXXFLAGS -D_GLIBCXX_DEBUG\"\n\n# wolfCrypt uses a slightly different ECDH algorithm than Trezor and libsecp256k1.\n# This disables running ECDH in Trezor and libsecp256k1 to prevent mismatches.\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_DISABLE_SPECIAL_ECDH\"\n\nexport CXXFLAGS=\"$CXXFLAGS -I $SRC/cryptofuzz/fuzzing-headers/include\"\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\nif [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\nthen\n    # Compile libfuzzer-js (required for all JavaScript libraries)\n    export LIBFUZZER_A_PATH=\"$LIB_FUZZING_ENGINE\"\n    cd $SRC/libfuzzer-js/\n    make\n    export LIBFUZZER_JS_PATH=$(realpath .)\n    export LINK_FLAGS=\"$LINK_FLAGS $LIBFUZZER_JS_PATH/js.o $LIBFUZZER_JS_PATH/quickjs/libquickjs.a\"\n\n    # Compile bn.js module\n    export BN_JS_PATH=\"$SRC/bn.js/lib/bn.js\"\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BN_JS\"\n    cd $SRC/cryptofuzz/modules/bn.js/\n    make\n\n    # Compile bignumber.js module\n    export BIGNUMBER_JS_PATH=\"$SRC/bignumber.js/bignumber.js\"\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BIGNUMBER_JS\"\n    cd $SRC/cryptofuzz/modules/bignumber.js/\n    make\n\n    export CRYPTO_JS_PATH=\"$SRC/crypto-js/\"\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_CRYPTO_JS\"\n    cd $SRC/cryptofuzz/modules/crypto-js/\n    make\nfi\n\nif [[ $CFLAGS != *-m32* && \"$SANITIZER\" != \"coverage\" ]]\nthen\n    cd $SRC/\n    tar Jxf zig-latest.tar.xz\n    export ZIG_BIN=$(realpath zig-linux-x86_64*/zig)\n\n    cd $SRC/cryptofuzz/modules/zig/\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_ZIG\"\nfi\n\n# Compile NSS\nif [[ $CFLAGS != *-m32* ]]\nthen\n    mkdir $SRC/nss-nspr\n    mv $SRC/nss $SRC/nss-nspr/\n    mv $SRC/nspr $SRC/nss-nspr/\n    cd $SRC/nss-nspr/\n\n    # Prevent compilation error with Clang\n    export CFLAGS=\"$CFLAGS -Wno-unused-but-set-variable\"\n\n    CXX=\"$CXX -stdlib=libc++\" LDFLAGS=\"$CFLAGS\" nss/build.sh --enable-fips --static --disable-tests --fuzz=oss\n\n    export NSS_NSPR_PATH=$(realpath $SRC/nss-nspr/)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NSS\"\n    export LINK_FLAGS=\"$LINK_FLAGS -lsqlite3\"\n\n    # Compile Cryptofuzz NSS module\n    cd $SRC/cryptofuzz/modules/nss\n    make -B\nfi\n\n# Rename blake2b_* functions to avoid symbol collisions with other libraries\ncd $SRC/trezor-firmware/crypto\nsed -i \"s/\\<blake2b_\\([A-Za-z_]\\)/trezor_blake2b_\\1/g\" *.c *.h\nsed -i 's/\\<blake2b(/trezor_blake2b(/g' *.c *.h\n\n# Compile Cryptofuzz trezor module\nexport TREZOR_FIRMWARE_PATH=$(realpath $SRC/trezor-firmware)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_TREZOR_FIRMWARE\"\ncd $SRC/cryptofuzz/modules/trezor\nmake -B\n\n# Compile libtomcrypt\ncd $SRC/libtomcrypt\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_LIBTOMCRYPT\"\n    export LIBTOMCRYPT_INCLUDE_PATH=$(realpath src/headers/)\n    export LIBTOMCRYPT_A_PATH=$(realpath libtomcrypt.a)\n\n    # Compile Cryptofuzz libtomcrypt module\n    cd $SRC/cryptofuzz/modules/libtomcrypt\n    make -B\nfi\n\n## Build blst\n#cd $SRC/blst/\n## Patch to disable assembly\n## This is to prevent false positives, see:\n## https://github.com/google/oss-fuzz/issues/5914\n#touch new_no_asm.h\n#echo \"#if LIMB_T_BITS==32\" >>new_no_asm.h\n#echo \"typedef unsigned long long llimb_t;\" >>new_no_asm.h\n#echo \"#else\" >>new_no_asm.h\n#echo \"typedef __uint128_t llimb_t;\" >>new_no_asm.h\n#echo \"#endif\" >>new_no_asm.h\n#cat src/no_asm.h >>new_no_asm.h\n#mv new_no_asm.h src/no_asm.h\n#CFLAGS=\"$CFLAGS -D__BLST_NO_ASM__ -D__BLST_PORTABLE__\" ./build.sh\n#export BLST_LIBBLST_A_PATH=$(realpath libblst.a)\n#export BLST_INCLUDE_PATH=$(realpath bindings/)\n#export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BLST\"\n#\n## Compile Cryptofuzz blst module\n#cd $SRC/cryptofuzz/modules/blst/\n#make -B -j$(nproc)\n\n# Build libsecp256k1\ncd $SRC/secp256k1/\nautoreconf -ivf\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_SECP256K1\"\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    ./configure --enable-static --disable-tests --disable-benchmark --disable-exhaustive-tests --enable-module-recovery --enable-experimental --enable-module-schnorrsig --enable-module-ecdh --with-asm=no\nelse\n    ./configure --enable-static --disable-tests --disable-benchmark --disable-exhaustive-tests --enable-module-recovery --enable-experimental --enable-module-schnorrsig --enable-module-ecdh\nfi\nmake\nexport SECP256K1_INCLUDE_PATH=$(realpath .)\nexport LIBSECP256K1_A_PATH=$(realpath .libs/libsecp256k1.a)\n\n# Compile Cryptofuzz libsecp256k1 module\ncd $SRC/cryptofuzz/modules/secp256k1/\nmake -B -j$(nproc)\n\n#if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\n#then\n# noble-secp256k1\n#    cd $SRC/noble-secp256k1/\n#    npm install && npm run build\n#    export NOBLE_SECP256K1_PATH=$(realpath lib/index.js)\n#\n#    cd $SRC/cryptofuzz/modules/noble-secp256k1/\n#    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NOBLE_SECP256K1\"\n#    make -B\n\n# noble-bls12-381\n#    cd $SRC/noble-bls12-381/\n#    cp math.ts new_index.ts\n#    $(awk '/^export/ {print \"tail -n +\"FNR+1\" index.ts\"; exit}' index.ts) >>new_index.ts\n#    mv new_index.ts index.ts\n#    npm install && npm run build\n#    export NOBLE_BLS12_381_PATH=$(realpath index.js)\n#    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NOBLE_BLS12_381\"\n#    cd $SRC/cryptofuzz/modules/noble-bls12-381/\n#    make -B\n\n# noble-ed25519\n#    cd $SRC/cryptofuzz/modules/noble-ed25519/\n#    export NOBLE_ED25519_PATH=\"$SRC/noble-ed25519/index.js\"\n#    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NOBLE_ED25519\"\n#    make -B\n#fi\n\n## Compile SymCrypt\nif [[ $CFLAGS != *-m32* ]]\nthen\n    cd $SRC/SymCrypt/\n\n    # Disable speculative load hardening because\n    # this results in MSAN false positives\n    sed -i '/.*x86-speculative-load-hardening.*/d' lib/CMakeLists.txt\n\n    # Unittests don't build with clang and are not needed anyway\n    sed -i \"s/^add_subdirectory(unittest)$//g\" CMakeLists.txt\n\n    mkdir b/\n    cd b/\n    if [[ $CFLAGS = *sanitize=memory* ]]\n    then\n        cmake -DSYMCRYPT_USE_ASM=off ../\n    else\n        cmake ../\n    fi\n\n    make symcrypt_common symcrypt_generic -j$(nproc)\n\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_SYMCRYPT\"\n    export SYMCRYPT_INCLUDE_PATH=$(realpath ../inc/)\n    export LIBSYMCRYPT_COMMON_A_PATH=$(realpath lib/libsymcrypt_common.a)\n    export SYMCRYPT_GENERIC_A_PATH=$(realpath lib/symcrypt_generic.a)\n\n    # Compile Cryptofuzz SymCrypt module\n    cd $SRC/cryptofuzz/modules/symcrypt\n    make -B\nfi\n\n# Compile libgmp\ncd $SRC/libgmp/\nautoreconf -ivf\nif [[ $CFLAGS = *-m32* ]]\nthen\n    setarch i386 ./configure --enable-maintainer-mode --enable-assert\nelif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    ./configure --enable-maintainer-mode --enable-assert --disable-assembly\nelse\n    ./configure --enable-maintainer-mode --enable-assert\nfi\nmake -j$(nproc)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_LIBGMP\"\nexport LIBGMP_INCLUDE_PATH=$(realpath .)\nexport LIBGMP_A_PATH=$(realpath .libs/libgmp.a)\n# Compile Cryptofuzz libgmp module\ncd $SRC/cryptofuzz/modules/libgmp\nmake -B\n\n# Compile mpdecimal\ncd $SRC/\ntar zxf mpdecimal-4.0.0.tar.gz\ncd mpdecimal-4.0.0/\n./configure\ncd libmpdec/\nmake libmpdec.a -j$(nproc)\ncd ../\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_MPDECIMAL\"\nexport LIBMPDEC_A_PATH=$(realpath libmpdec/libmpdec.a)\nexport LIBMPDEC_INCLUDE_PATH=$(realpath libmpdec/)\n# Compile Cryptofuzz mpdecimal module\ncd $SRC/cryptofuzz/modules/mpdecimal\nmake -B\n\n# Compile Cityhash\ncd $SRC/cityhash\nif [[ $CFLAGS != *-m32* ]]\nthen\n    CXXFLAGS=\"$CXXFLAGS -msse4.2\" ./configure --disable-shared\nelse\n    ./configure --disable-shared\nfi\nmake -j$(nproc)\n\nexport CXXFLAGS=\"$CXXFLAGS -I$SRC/cityhash/src\"\nexport CRYPTOFUZZ_REFERENCE_CITY_O_PATH=\"$SRC/cityhash/src/city.o\"\n\n##############################################################################\n# Compile cryptopp\ncd $SRC/cryptopp\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    make libcryptopp.a -j$(nproc)\nelse\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOPP_DISABLE_ASM=1\"\n    make libcryptopp.a -j$(nproc)\nfi\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_CRYPTOPP\"\nexport LIBCRYPTOPP_A_PATH=\"$SRC/cryptopp/libcryptopp.a\"\nexport CRYPTOPP_INCLUDE_PATH=\"$SRC/cryptopp\"\n\n# Compile Cryptofuzz cryptopp module\ncd $SRC/cryptofuzz/modules/cryptopp\nmake -B\n\n##############################################################################\n# Compile Mbed TLS\ncd $SRC/mbedtls/\nscripts/config.py set MBEDTLS_PLATFORM_MEMORY\nscripts/config.py set MBEDTLS_CMAC_C\nscripts/config.py set MBEDTLS_NIST_KW_C\nscripts/config.py set MBEDTLS_ARIA_C\nif [[ $CFLAGS == *sanitize=memory* ]]\nthen\n    scripts/config.py unset MBEDTLS_HAVE_ASM\n    scripts/config.py unset MBEDTLS_PADLOCK_C\n    scripts/config.py unset MBEDTLS_AESNI_C\n    scripts/config.py unset MBEDTLS_AESCE_C\nfi\nmkdir build/\ncd build/\ncmake .. -DENABLE_PROGRAMS=0 -DENABLE_TESTING=0\nmake -j$(nproc)\nexport MBEDTLS_LIBMBEDCRYPTO_A_PATH=\"$SRC/mbedtls/build/library/libmbedcrypto.a\"\nexport MBEDTLS_INCLUDE_PATH=\"$SRC/mbedtls/include\"\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_MBEDTLS -DCRYPTOFUZZ_TF_PSA_CRYPTO\"\n\n# Compile Cryptofuzz module for Mbed TLS with the legacy crypto API\ncd $SRC/cryptofuzz/modules/mbedtls\nmake -B\n\n# Compile Cryptofuzz module for Mbed TLS with the PSA crypto API\ncd $SRC/cryptofuzz/modules/tf-psa-crypto\nmake -B\n\n##############################################################################\n# Compile Botan\ncd $SRC/botan\nif [[ $CFLAGS != *-m32* ]]\nthen\n    if [[ $CFLAGS != *sanitize=memory* ]]\n    then\n        ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\n    else\n        ./configure.py --disable-asm --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\n    fi\nelse\n    ./configure.py --cpu=x86_32 --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\nfi\nmake -j$(nproc)\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BOTAN\"\nexport LIBBOTAN_A_PATH=\"$SRC/botan/libbotan-3.a\"\nexport BOTAN_INCLUDE_PATH=\"$SRC/botan/build/include\"\n\n# Compile Cryptofuzz Botan module\ncd $SRC/cryptofuzz/modules/botan\nmake -B\n\n##############################################################################\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    # Compile libgpg-error (dependency of libgcrypt)\n    cd $SRC/\n    tar jxvf libgpg-error-1.49.tar.bz2\n    cd libgpg-error-1.49/\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        ./configure --enable-static\n    else\n        ./configure --enable-static --host=i386\n    fi\n    ASAN_OPTIONS=detect_leaks=0 make -j$(nproc)\n    make install\n    export LINK_FLAGS=\"$LINK_FLAGS $SRC/libgpg-error-1.49/src/.libs/libgpg-error.a\"\n\n    # Compile libgcrypt\n    cd $SRC/libgcrypt\n    autoreconf -ivf\n    if [[ $CFLAGS = *-m32* ]]\n    then\n        ./configure --enable-static --disable-doc --disable-jent-support --host=i386\n    else\n        ./configure --enable-static --disable-doc --disable-jent-support\n    fi\n    make -j$(nproc)\n\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_LIBGCRYPT\"\n    export LIBGCRYPT_A_PATH=\"$SRC/libgcrypt/src/.libs/libgcrypt.a\"\n    export LIBGCRYPT_INCLUDE_PATH=\"$SRC/libgcrypt/src\"\n\n    # Compile Cryptofuzz libgcrypt module\n    cd $SRC/cryptofuzz/modules/libgcrypt\n    make -B\nfi\n\n# Compile libsodium\ncd $SRC/libsodium\nautoreconf -ivf\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    ./configure\nelse\n    ./configure --disable-asm\nfi\nmake -j$(nproc)\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_LIBSODIUM\"\nexport LIBSODIUM_A_PATH=\"$SRC/libsodium/src/libsodium/.libs/libsodium.a\"\nexport LIBSODIUM_INCLUDE_PATH=\"$SRC/libsodium/src/libsodium/include\"\n\n# Compile Cryptofuzz libsodium module\ncd $SRC/cryptofuzz/modules/libsodium\nmake -B\n\n# Disabled because NSS now also embeds evercrypt, leading to symbol collisions\n#if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\n#then\n#    # Compile EverCrypt (with assembly)\n#    cd $SRC/evercrypt/dist\n#    make -C portable -j$(nproc) libevercrypt.a\n#    make -C kremlin/kremlib/dist/minimal -j$(nproc)\n#\n#    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_EVERCRYPT\"\n#    export EVERCRYPT_A_PATH=\"$SRC/evercrypt/dist/portable/libevercrypt.a\"\n#    export KREMLIN_A_PATH=\"$SRC/evercrypt/dist/kremlin/kremlib/dist/minimal/*.o\"\n#    export EVERCRYPT_INCLUDE_PATH=\"$SRC/evercrypt/dist\"\n#    export KREMLIN_INCLUDE_PATH=\"$SRC/evercrypt/dist/kremlin/include\"\n#    export INCLUDE_PATH_FLAGS=\"$INCLUDE_PATH_FLAGS -I $EVERCRYPT_INCLUDE_PATH -I $KREMLIN_INCLUDE_PATH\"\n#\n#    # Compile Cryptofuzz EverCrypt (with assembly) module\n#    cd $SRC/cryptofuzz/modules/evercrypt\n#    make -B\n#fi\n\n##############################################################################\n# Compile Cryptofuzz reference (without assembly) module\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_REFERENCE\"\ncd $SRC/cryptofuzz/modules/reference\nmake -B\n\n##############################################################################\n# Compile Cryptofuzz Veracrypt (without assembly) module\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_VERACRYPT\"\ncd $SRC/cryptofuzz/modules/veracrypt\nmake -B\n\n##############################################################################\n# Compile Cryptofuzz Monero (without assembly) module\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_MONERO\"\ncd $SRC/cryptofuzz/modules/monero\nmake -B\n\n##############################################################################\n# Compile Cryptofuzz Golang (123) module\nif [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\nthen\n    cd $SRC/cryptofuzz/modules/golang\n    GOROOT=\"$GOROOT_123\" GOPATH=\"$GOPATH_123\" PATH=\"$PATH_GO_123\" make -B\nfi\n\nif [[ $CFLAGS != *-m32* ]]\nthen\n    # Compile Cryptofuzz (NSS-based)\n    cd $SRC/cryptofuzz\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL $INCLUDE_PATH_FLAGS\" make -B -j$(nproc)\n\n    # Generate dictionary\n    ./generate_dict\n\n    # Patch fuzzer\n    if [ \"$SANITIZER\" = undefined ]; then\n        patchelf --set-rpath '$ORIGIN/lib/jdk-18.0.1/lib/server/' $SRC/cryptofuzz/cryptofuzz\n    fi\n\n    # Copy fuzzer\n    cp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-nss\n    # Copy dictionary\n    cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-nss.dict\n    # Copy seed corpus\n    cp $SRC/cryptofuzz-corpora/libressl_latest.zip $OUT/cryptofuzz-nss_seed_corpus.zip\n\n    rm $SRC/cryptofuzz/modules/nss/module.a\n\n    CXXFLAGS=${CXXFLAGS//\"-DCRYPTOFUZZ_NSS\"/}\n    LINK_FLAGS=${LINK_FLAGS//\"-lsqlite3\"/}\nfi\n\nrm -f $SRC/cryptofuzz/modules/golang/module.a\n\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    # libtomcrypt can only be compiled with NSS, because OpenSSL, LibreSSL and\n    # BoringSSL have symbol collisions with libtomcrypt.\n    #\n    # So, now that NSS-based Cryptofuzz has been compiled, remove libtomcrypt\n    export CXXFLAGS=${CXXFLAGS/-DCRYPTOFUZZ_LIBTOMCRYPT/}\n    rm -rf \"$LIBTOMCRYPT_A_PATH\"\nfi\n\n##############################################################################\n# Compile wolfCrypt\ncd $SRC/wolfsm/\n./install.sh\ncd $SRC/wolfssl\n# Enable additional wolfCrypt features which cannot be activated through arguments to ./configure\nexport CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP\"\nautoreconf -ivf\n\nexport WOLFCRYPT_CONFIGURE_PARAMS=\"--enable-static --enable-md2 --enable-md4 --enable-ripemd --enable-blake2 --enable-blake2s --enable-pwdbased --enable-scrypt --enable-hkdf --enable-cmac --enable-arc4 --enable-camellia --enable-aesccm --enable-aesctr --enable-xts --enable-des3 --enable-x963kdf --enable-harden --enable-aescfb --enable-aesofb --enable-aeskeywrap --enable-aessiv --enable-shake256 --enable-curve25519 --enable-curve448 --disable-crypttests --disable-examples --enable-keygen --enable-compkey --enable-ed448 --enable-ed25519 --enable-ecccustcurves --enable-xchacha --enable-cryptocb --enable-eccencrypt --enable-aesgcm-stream --enable-shake128 --enable-siphash --enable-eccsi --with-eccminsz=0 --enable-aeseax --enable-ed25519-stream --enable-ed448-stream --enable-sm2 --enable-sm3 --enable-sm4-cbc --enable-sm4-ccm --enable-sm4-ctr --enable-sm4-ecb --enable-sm4-gcm --enable-smallstack\"\n\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export WOLFCRYPT_CONFIGURE_PARAMS=\"$WOLFCRYPT_CONFIGURE_PARAMS -disable-asm\"\nfi\n\nif [[ $CFLAGS = *-m32* ]]\nthen\n    export WOLFCRYPT_CONFIGURE_PARAMS=\"$WOLFCRYPT_CONFIGURE_PARAMS -disable-fastmath\"\nfi\n\n./configure $WOLFCRYPT_CONFIGURE_PARAMS\nmake -j$(nproc)\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_WOLFCRYPT\"\nexport WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl/src/.libs/libwolfssl.a\"\nexport WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl\"\n\n# Compile Cryptofuzz wolfcrypt (without assembly) module\ncd $SRC/cryptofuzz/modules/wolfcrypt\nmake -B\n\n##############################################################################\n# Compile Cryptofuzz Golang (122) module\nif [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\nthen\n    cd $SRC/cryptofuzz/modules/golang\n    GOROOT=\"$GOROOT_122\" GOPATH=\"$GOPATH_122\" PATH=\"$PATH_GO_122\" make -B\nfi\n\n# OpenSSL can currently not be used together with wolfCrypt due to symbol collisions\nexport SAVE_CXXFLAGS=\"$CXXFLAGS\"\nexport CXXFLAGS=${CXXFLAGS/-DCRYPTOFUZZ_WOLFCRYPT/}\n\n##############################################################################\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    # Compile Openssl (with assembly)\n    cd $SRC/openssl\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        ./config --debug enable-md2 enable-rc5\n    else\n        setarch i386 ./config --debug enable-md2 enable-rc5\n    fi\n    make -j$(nproc)\n\n    # Compile Cryptofuzz OpenSSL (with assembly) module\n    cd $SRC/cryptofuzz/modules/openssl\n    OPENSSL_INCLUDE_PATH=\"$SRC/openssl/include\" OPENSSL_LIBCRYPTO_A_PATH=\"$SRC/openssl/libcrypto.a\" make -B\n\n    # Compile Cryptofuzz\n    cd $SRC/cryptofuzz\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" CXXFLAGS=\"$CXXFLAGS -I $SRC/openssl/include $INCLUDE_PATH_FLAGS\" make -B -j$(nproc)\n\n    # Generate dictionary\n    ./generate_dict\n\n    # Patch fuzzer\n    if [ \"$SANITIZER\" = undefined ]; then\n        patchelf --set-rpath '$ORIGIN/lib/jdk-18.0.1/lib/server/' $SRC/cryptofuzz/cryptofuzz\n    fi\n\n    # Copy fuzzer\n    cp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-openssl\n    # Copy dictionary\n    cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-openssl.dict\n    # Copy seed corpus\n    cp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl_seed_corpus.zip\nfi\n\n##############################################################################\n# Compile Openssl (without assembly)\ncd $SRC/openssl\nif [[ $CFLAGS != *-m32* ]]\nthen\n    ./config --debug no-asm enable-md2 enable-rc5\nelse\n    setarch i386 ./config --debug no-asm enable-md2 enable-rc5\nfi\nmake clean\nmake -j$(nproc)\n\n# Compile Cryptofuzz OpenSSL (without assembly) module\ncd $SRC/cryptofuzz/modules/openssl\nOPENSSL_INCLUDE_PATH=\"$SRC/openssl/include\" OPENSSL_LIBCRYPTO_A_PATH=\"$SRC/openssl/libcrypto.a\" make -B\n\n# Compile Cryptofuzz\ncd $SRC/cryptofuzz\nLIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" CXXFLAGS=\"$CXXFLAGS -I $SRC/openssl/include $INCLUDE_PATH_FLAGS\" make -B -j$(nproc)\n\n# Generate dictionary\n./generate_dict\n\n# Patch fuzzer\nif [ \"$SANITIZER\" = undefined ]; then\n    patchelf --set-rpath '$ORIGIN/lib/jdk-18.0.1/lib/server/' $SRC/cryptofuzz/cryptofuzz\nfi\n\n# Copy fuzzer\ncp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-openssl-noasm\n# Copy dictionary\ncp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-openssl-noasm.dict\n# Copy seed corpus\ncp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl-noasm_seed_corpus.zip\n\nrm -f $SRC/cryptofuzz/modules/golang/module.a\n\nexport CXXFLAGS=\"$SAVE_CXXFLAGS\"\n\n##############################################################################\n# Compile Cryptofuzz Golang (dev branch) module\nif [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]\nthen\n    cd $SRC/cryptofuzz/modules/golang\n    GOROOT=\"$GOROOT_DEV\" GOPATH=\"$GOPATH_DEV\" PATH=\"$PATH_GO_DEV\" make -B\nfi\n\n##############################################################################\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    # Compile BoringSSL (with assembly)\n    cd $SRC/boringssl\n    rm -rf build ; mkdir build\n    cd build\n    if [[ $CFLAGS = *-m32* ]]\n    then\n        GOROOT=\"$GOROOT_DEV\" GOPATH=\"$GOPATH_DEV\" PATH=\"$PATH_GO_DEV\" setarch i386 cmake -DCMAKE_CXX_FLAGS=\"$CXXFLAGS -fno-sanitize=vptr\" -DCMAKE_C_FLAGS=\"$CFLAGS -fno-sanitize=vptr\" -DBORINGSSL_ALLOW_CXX_RUNTIME=1 -DCMAKE_ASM_FLAGS=\"-m32\" ..\n    else\n        GOROOT=\"$GOROOT_DEV\" GOPATH=\"$GOPATH_DEV\" PATH=\"$PATH_GO_DEV\" cmake -DCMAKE_CXX_FLAGS=\"$CXXFLAGS -fno-sanitize=vptr\" -DCMAKE_C_FLAGS=\"$CFLAGS -fno-sanitize=vptr\" -DBORINGSSL_ALLOW_CXX_RUNTIME=1 ..\n    fi\n    make -j$(nproc) crypto\n\n    # Compile Cryptofuzz BoringSSL (with assembly) module\n    cd $SRC/cryptofuzz/modules/openssl\n    OPENSSL_INCLUDE_PATH=\"$SRC/boringssl/include\" OPENSSL_LIBCRYPTO_A_PATH=\"$SRC/boringssl/build/crypto/libcrypto.a\" CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BORINGSSL\" make -B\n\n    # Compile Cryptofuzz\n    cd $SRC/cryptofuzz\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" CXXFLAGS=\"$CXXFLAGS -I $SRC/openssl/include $INCLUDE_PATH_FLAGS\" make -B -j$(nproc)\n\n    # Generate dictionary\n    ./generate_dict\n\n    # Patch fuzzer\n    if [ \"$SANITIZER\" = undefined ]; then\n        patchelf --set-rpath '$ORIGIN/lib/jdk-18.0.1/lib/server/' $SRC/cryptofuzz/cryptofuzz\n    fi\n\n    # Copy fuzzer\n    cp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-boringssl\n    # Copy dictionary\n    cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-boringssl.dict\n    # Copy seed corpus\n    cp $SRC/cryptofuzz-corpora/boringssl_latest.zip $OUT/cryptofuzz-boringssl_seed_corpus.zip\nfi\n\n# Compile Cryptofuzz libgmp mini-gmp module\ncd $SRC/cryptofuzz/modules/libgmp\nmake -B -f Makefile-mini-gmp\n\n##############################################################################\n# Compile BoringSSL (without assembly)\ncd $SRC/boringssl\nrm -rf build ; mkdir build\ncd build\nGOROOT=\"$GOROOT_DEV\" GOPATH=\"$GOPATH_DEV\" PATH=\"$PATH_GO_DEV\" cmake -DCMAKE_CXX_FLAGS=\"$CXXFLAGS -fno-sanitize=vptr\" -DCMAKE_C_FLAGS=\"$CFLAGS -fno-sanitize=vptr\" -DBORINGSSL_ALLOW_CXX_RUNTIME=1 -DOPENSSL_NO_ASM=1 ..\nmake -j$(nproc) crypto\n\n# Compile Cryptofuzz BoringSSL (without assembly) module\ncd $SRC/cryptofuzz/modules/openssl\nOPENSSL_INCLUDE_PATH=\"$SRC/boringssl/include\" OPENSSL_LIBCRYPTO_A_PATH=\"$SRC/boringssl/build/crypto/libcrypto.a\" CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BORINGSSL\" make -B\n\n# Compile Cryptofuzz\ncd $SRC/cryptofuzz\nLIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" CXXFLAGS=\"$CXXFLAGS -I $SRC/openssl/include $INCLUDE_PATH_FLAGS\" make -B -j$(nproc)\n\n# Generate dictionary\n./generate_dict\n\n# Patch fuzzer\nif [ \"$SANITIZER\" = undefined ]; then\n    patchelf --set-rpath '$ORIGIN/lib/jdk-18.0.1/lib/server/' $SRC/cryptofuzz/cryptofuzz\nfi\n\n# Copy fuzzer\ncp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-boringssl-noasm\n# Copy dictionary\ncp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-boringssl-noasm.dict\n# Copy seed corpus\ncp $SRC/cryptofuzz-corpora/boringssl_latest.zip $OUT/cryptofuzz-boringssl-noasm_seed_corpus.zip\n"
  },
  {
    "path": "projects/cryptofuzz/project.yaml",
    "content": "homepage: \"https://github.com/guidovranken/cryptofuzz\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nauto_ccs:\n  - kurt@roeckx.be\n  - agl@google.com\n  - davidben@google.com\n  - svaldez@google.com\n  - beck@obtuse.com\n  - joel.sing@gmail.com\n  - kinichiro.inoguchi@gmail.com\n  - github@pureftpd.org\n  - jussi.kivilinna@gmail.com\n  - szanella@gmail.com\n  - karthik.bhargavan@gmail.com\n  - jonathan.protzenko@gmail.com\n  - richard@levitte.org\n  - ppzgs1@gmail.com\n  - jack.lloyd@gmail.com\n  - shane.lontis@hotmail.com\n  - david@wolfssl.com\n  - kaleb@wolfssl.com\n  - jacob@wolfssl.com\n  - sledru@mozilla.com\n  - bbeurdouche@mozilla.com\n  - matthias.st.pierre@gmail.com\n  - kaleb.himes@gmail.com\n  - polubelovam@gmail.com\n  - mbed-tls-security@lists.trustedfirmware.org\n  - choller@mozilla.com\n  - djackson@mozilla.com\n  - dkeeler@mozilla.com\n  - jkratzer@mozilla.com\n  - jschanck@mozilla.com\n  - jschwartzentruber@mozilla.com\n  - nkulatova@mozilla.com\n  - twsmith@mozilla.com\n  - mdauer@mozilla.com\nvendor_ccs:\n  - oss-fuzz@mozilla-fuzzing.iam.gserviceaccount.com\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/guidovranken/cryptofuzz'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/cryptofuzz/xxd.c",
    "content": "/* xxd: my hexdump facility. jw\n *\n *  2.10.90 changed to word output\n *  3.03.93 new indent style, dumb bug inserted and fixed.\n *\t    -c option, mls\n * 26.04.94 better option parser, -ps, -l, -s added.\n *  1.07.94 -r badly needs - as input file.  Per default autoskip over\n *\t       consecutive lines of zeroes, as unix od does.\n *\t    -a shows them too.\n *\t    -i dump as c-style #include \"file.h\"\n *  1.11.95 if \"xxd -i\" knows the filename, an 'unsigned char filename_bits[]'\n *\t    array is written in correct c-syntax.\n *\t    -s improved, now defaults to absolute seek, relative requires a '+'.\n *\t    -r improved, now -r -s -0x... is supported.\n *\t       change/suppress leading '\\0' bytes.\n *\t    -l n improved: stops exactly after n bytes.\n *\t    -r improved, better handling of partial lines with trailing garbage.\n *\t    -r improved, now -r -p works again!\n *\t    -r improved, less flushing, much faster now! (that was silly)\n *  3.04.96 Per repeated request of a single person: autoskip defaults to off.\n * 15.05.96 -v added. They want to know the version.\n *\t    -a fixed, to show last line inf file ends in all zeros.\n *\t    -u added: Print upper case hex-letters, as preferred by unix bc.\n *\t    -h added to usage message. Usage message extended.\n *\t    Now using outfile if specified even in normal mode, aehem.\n *\t    No longer mixing of ints and longs. May help doze people.\n *\t    Added binify ioctl for same reason. (Enough Doze stress for 1996!)\n * 16.05.96 -p improved, removed occasional superfluous linefeed.\n * 20.05.96 -l 0 fixed. tried to read anyway.\n * 21.05.96 -i fixed. now honours -u, and prepends __ to numeric filenames.\n *\t    compile -DWIN32 for NT or W95. George V. Reilly, * -v improved :-)\n *\t    support --gnuish-longhorn-options\n * 25.05.96 MAC support added: CodeWarrior already uses ``outline'' in Types.h\n *\t    which is included by MacHeaders (Axel Kielhorn). Renamed to\n *\t    xxdline().\n *  7.06.96 -i printed 'int' instead of 'char'. *blush*\n *\t    added Bram's OS2 ifdefs...\n * 18.07.96 gcc -Wall @ SunOS4 is now slient.\n *\t    Added osver for MSDOS/DJGPP/WIN32.\n * 29.08.96 Added size_t to strncmp() for Amiga.\n * 24.03.97 Windows NT support (Phil Hanna). Clean exit for Amiga WB (Bram)\n * 02.04.97 Added -E option, to have EBCDIC translation instead of ASCII\n *\t    (azc10@yahoo.com)\n * 22.05.97 added -g (group octets) option (jcook@namerica.kla.com).\n * 23.09.98 nasty -p -r misfeature fixed: slightly wrong output, when -c was\n *\t    missing or wrong.\n * 26.09.98 Fixed: 'xxd -i infile outfile' did not truncate outfile.\n * 27.10.98 Fixed: -g option parser required blank.\n *\t    option -b added: 01000101 binary output in normal format.\n * 16.05.00 Added VAXC changes by Stephen P. Wall\n * 16.05.00 Improved MMS file and merge for VMS by Zoltan Arpadffy\n * 2011 March  Better error handling by Florian Zumbiehl.\n * 2011 April  Formatting by Bram Moolenaar\n * 08.06.2013  Little-endian hexdump (-e) and offset (-o) by Vadim Vygonets.\n *\n * (c) 1990-1998 by Juergen Weigert (jnweiger@informatik.uni-erlangen.de)\n *\n * I hereby grant permission to distribute and use xxd\n * under X11-MIT or GPL-2.0 (at the user's choice).\n *\n * Small changes made afterwards by Bram Moolenaar et al.\n *\n * Distribute freely and credit me,\n * make money and share with me,\n * lose money and don't ask me.\n */\n\n/* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */\n#if _MSC_VER >= 1400\n# define _CRT_SECURE_NO_DEPRECATE\n# define _CRT_NONSTDC_NO_DEPRECATE\n#endif\n#if !defined(CYGWIN) && (defined(CYGWIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__))\n# define CYGWIN\n#endif\n\n#include <stdio.h>\n#ifdef VAXC\n# include <file.h>\n#else\n# include <fcntl.h>\n#endif\n#if defined(WIN32) || defined(__BORLANDC__) || defined(CYGWIN)\n# include <io.h>\t/* for setmode() */\n#else\n# ifdef UNIX\n#  include <unistd.h>\n# endif\n#endif\n#include <stdlib.h>\n#include <string.h>\t/* for strncmp() */\n#include <ctype.h>\t/* for isalnum() */\n#if __MWERKS__ && !defined(BEBOX)\n# include <unix.h>\t/* for fdopen() on MAC */\n#endif\n\n#if defined(__BORLANDC__) && __BORLANDC__ <= 0x0410 && !defined(fileno)\n/* Missing define and prototype grabbed from the BC 4.0 <stdio.h> */\n# define fileno(f)       ((f)->fd)\nFILE   _FAR *_Cdecl _FARFUNC fdopen(int __handle, char _FAR *__type);\n#endif\n\n\n/*  This corrects the problem of missing prototypes for certain functions\n *  in some GNU installations (e.g. SunOS 4.1.x).\n *  Darren Hiebert <darren@hmi.com> (sparc-sun-sunos4.1.3_U1/2.7.2.2)\n */\n#if defined(__GNUC__) && defined(__STDC__)\n# ifndef __USE_FIXED_PROTOTYPES__\n#  define __USE_FIXED_PROTOTYPES__\n# endif\n#endif\n\n#ifndef __USE_FIXED_PROTOTYPES__\n/*\n * This is historic and works only if the compiler really has no prototypes:\n *\n * Include prototypes for Sun OS 4.x, when using an ANSI compiler.\n * FILE is defined on OS 4.x, not on 5.x (Solaris).\n * if __SVR4 is defined (some Solaris versions), don't include this.\n */\n#if defined(sun) && defined(FILE) && !defined(__SVR4) && defined(__STDC__)\n#  define __P(a) a\n/* excerpt from my sun_stdlib.h */\nextern int fprintf __P((FILE *, char *, ...));\nextern int fputs   __P((char *, FILE *));\nextern int _flsbuf __P((unsigned char, FILE *));\nextern int _filbuf __P((FILE *));\nextern int fflush  __P((FILE *));\nextern int fclose  __P((FILE *));\nextern int fseek   __P((FILE *, long, int));\nextern int rewind  __P((FILE *));\n\nextern void perror __P((char *));\n# endif\n#endif\n\nextern long int strtol();\nextern long int ftell();\n\nchar version[] = \"xxd V1.10 27oct98 by Juergen Weigert\";\n#ifdef WIN32\nchar osver[] = \" (Win32)\";\n#else\nchar osver[] = \"\";\n#endif\n\n#if defined(WIN32)\n# define BIN_READ(yes)  ((yes) ? \"rb\" : \"rt\")\n# define BIN_WRITE(yes) ((yes) ? \"wb\" : \"wt\")\n# define BIN_CREAT(yes) ((yes) ? (O_CREAT|O_BINARY) : O_CREAT)\n# define BIN_ASSIGN(fp, yes) setmode(fileno(fp), (yes) ? O_BINARY : O_TEXT)\n# define PATH_SEP '\\\\'\n#elif defined(CYGWIN)\n# define BIN_READ(yes)  ((yes) ? \"rb\" : \"rt\")\n# define BIN_WRITE(yes) ((yes) ? \"wb\" : \"w\")\n# define BIN_CREAT(yes) ((yes) ? (O_CREAT|O_BINARY) : O_CREAT)\n# define BIN_ASSIGN(fp, yes) ((yes) ? (void) setmode(fileno(fp), O_BINARY) : (void) (fp))\n# define PATH_SEP '/'\n#else\n# ifdef VMS\n#  define BIN_READ(dummy)  \"r\"\n#  define BIN_WRITE(dummy) \"w\"\n#  define BIN_CREAT(dummy) O_CREAT\n#  define BIN_ASSIGN(fp, dummy) fp\n#  define PATH_SEP ']'\n#  define FILE_SEP '.'\n# else\n#  define BIN_READ(dummy)  \"r\"\n#  define BIN_WRITE(dummy) \"w\"\n#  define BIN_CREAT(dummy) O_CREAT\n#  define BIN_ASSIGN(fp, dummy) fp\n#  define PATH_SEP '/'\n# endif\n#endif\n\n/* open has only to arguments on the Mac */\n#if __MWERKS__\n# define OPEN(name, mode, umask) open(name, mode)\n#else\n# define OPEN(name, mode, umask) open(name, mode, umask)\n#endif\n\n#ifdef AMIGA\n# define STRNCMP(s1, s2, l) strncmp(s1, s2, (size_t)l)\n#else\n# define STRNCMP(s1, s2, l) strncmp(s1, s2, l)\n#endif\n\n#ifndef __P\n# if defined(__STDC__) || defined(WIN32) || defined(__BORLANDC__)\n#  define __P(a) a\n# else\n#  define __P(a) ()\n# endif\n#endif\n\n/* Let's collect some prototypes */\n/* CodeWarrior is really picky about missing prototypes */\nstatic void exit_with_usage __P((void));\nstatic void die __P((int));\nstatic int huntype __P((FILE *, FILE *, FILE *, int, int, long));\nstatic void xxdline __P((FILE *, char *, int));\n\n#define TRY_SEEK\t/* attempt to use lseek, or skip forward by reading */\n#define COLS 256\t/* change here, if you ever need more columns */\n#define LLEN (12 + (9*COLS-1) + COLS + 2)\n\nchar hexxa[] = \"0123456789abcdef0123456789ABCDEF\", *hexx = hexxa;\n\n/* the different hextypes known by this program: */\n#define HEX_NORMAL 0\n#define HEX_POSTSCRIPT 1\n#define HEX_CINCLUDE 2\n#define HEX_BITS 3\t\t/* not hex a dump, but bits: 01111001 */\n#define HEX_LITTLEENDIAN 4\n\nstatic char *pname;\n\n  static void\nexit_with_usage(void)\n{\n  fprintf(stderr, \"Usage:\\n       %s [options] [infile [outfile]]\\n\", pname);\n  fprintf(stderr, \"    or\\n       %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\\n\", pname);\n  fprintf(stderr, \"Options:\\n\");\n  fprintf(stderr, \"    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.\\n\");\n  fprintf(stderr, \"    -b          binary digit dump (incompatible with -ps,-i,-r). Default hex.\\n\");\n  fprintf(stderr, \"    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\\n\");\n  fprintf(stderr, \"    -E          show characters in EBCDIC. Default ASCII.\\n\");\n  fprintf(stderr, \"    -e          little-endian dump (incompatible with -ps,-i,-r).\\n\");\n  fprintf(stderr, \"    -g          number of octets per group in normal output. Default 2 (-e: 4).\\n\");\n  fprintf(stderr, \"    -h          print this summary.\\n\");\n  fprintf(stderr, \"    -i          output in C include file style.\\n\");\n  fprintf(stderr, \"    -l len      stop after <len> octets.\\n\");\n  fprintf(stderr, \"    -o off      add <off> to the displayed file position.\\n\");\n  fprintf(stderr, \"    -ps         output in postscript plain hexdump style.\\n\");\n  fprintf(stderr, \"    -r          reverse operation: convert (or patch) hexdump into binary.\\n\");\n  fprintf(stderr, \"    -r -s off   revert with <off> added to file positions found in hexdump.\\n\");\n  fprintf(stderr, \"    -s %sseek  start at <seek> bytes abs. %sinfile offset.\\n\",\n#ifdef TRY_SEEK\n\t  \"[+][-]\", \"(or +: rel.) \");\n#else\n\t  \"\", \"\");\n#endif\n  fprintf(stderr, \"    -u          use upper case hex letters.\\n\");\n  fprintf(stderr, \"    -v          show version: \\\"%s%s\\\".\\n\", version, osver);\n  exit(1);\n}\n\n  static void\ndie(int ret)\n{\n  fprintf(stderr, \"%s: \", pname);\n  perror(NULL);\n  exit(ret);\n}\n\n/*\n * Max. cols binary characters are decoded from the input stream per line.\n * Two adjacent garbage characters after evaluated data delimit valid data.\n * Everything up to the next newline is discarded.\n *\n * The name is historic and came from 'undo type opt h'.\n */\n  static int\nhuntype(\n  FILE *fpi,\n  FILE *fpo,\n  FILE *fperr,\n  int cols,\n  int hextype,\n  long base_off)\n{\n  int c, ign_garb = 1, n1 = -1, n2 = 0, n3, p = cols;\n  long have_off = 0, want_off = 0;\n\n  rewind(fpi);\n\n  while ((c = getc(fpi)) != EOF)\n    {\n      if (c == '\\r')\t/* Doze style input file? */\n\tcontinue;\n\n      /* Allow multiple spaces.  This doesn't work when there is normal text\n       * after the hex codes in the last line that looks like hex, thus only\n       * use it for PostScript format. */\n      if (hextype == HEX_POSTSCRIPT && (c == ' ' || c == '\\n' || c == '\\t'))\n\tcontinue;\n\n      n3 = n2;\n      n2 = n1;\n\n      if (c >= '0' && c <= '9')\n\tn1 = c - '0';\n      else if (c >= 'a' && c <= 'f')\n\tn1 = c - 'a' + 10;\n      else if (c >= 'A' && c <= 'F')\n\tn1 = c - 'A' + 10;\n      else\n\t{\n\t  n1 = -1;\n\t  if (ign_garb)\n\t    continue;\n\t}\n\n      ign_garb = 0;\n\n      if (p >= cols)\n\t{\n\t  if (!hextype)\n\t    {\n\t      if (n1 < 0)\n\t\t{\n\t\t  p = 0;\n\t\t  continue;\n\t\t}\n\t      want_off = (want_off << 4) | n1;\n\t      continue;\n\t    }\n\t  else\n\t    p = 0;\n\t}\n\n      if (base_off + want_off != have_off)\n\t{\n\t  if (fflush(fpo) != 0)\n\t    die(3);\n#ifdef TRY_SEEK\n\t  c = fseek(fpo, base_off + want_off - have_off, 1);\n\t  if (c >= 0)\n\t    have_off = base_off + want_off;\n#endif\n\t  if (base_off + want_off < have_off)\n\t    {\n\t      fprintf(fperr, \"%s: sorry, cannot seek backwards.\\n\", pname);\n\t      return 5;\n\t    }\n\t  for (; have_off < base_off + want_off; have_off++)\n\t    if (putc(0, fpo) == EOF)\n\t      die(3);\n\t}\n\n      if (n2 >= 0 && n1 >= 0)\n\t{\n\t  if (putc((n2 << 4) | n1, fpo) == EOF)\n\t    die(3);\n\t  have_off++;\n\t  want_off++;\n\t  n1 = -1;\n\t  if ((++p >= cols) && !hextype)\n\t    {\n\t      /* skip rest of line as garbage */\n\t      want_off = 0;\n\t      while ((c = getc(fpi)) != '\\n' && c != EOF)\n\t\t;\n\t      if (c == EOF && ferror(fpi))\n\t\tdie(2);\n\t      ign_garb = 1;\n\t    }\n\t}\n      else if (n1 < 0 && n2 < 0 && n3 < 0)\n\t{\n\t  /* already stumbled into garbage, skip line, wait and see */\n\t  if (!hextype)\n\t    want_off = 0;\n\t  while ((c = getc(fpi)) != '\\n' && c != EOF)\n\t    ;\n\t  if (c == EOF && ferror(fpi))\n\t    die(2);\n\t  ign_garb = 1;\n\t}\n    }\n  if (fflush(fpo) != 0)\n    die(3);\n#ifdef TRY_SEEK\n  fseek(fpo, 0L, 2);\n#endif\n  if (fclose(fpo) != 0)\n    die(3);\n  if (fclose(fpi) != 0)\n    die(2);\n  return 0;\n}\n\n/*\n * Print line l. If nz is false, xxdline regards the line a line of\n * zeroes. If there are three or more consecutive lines of zeroes,\n * they are replaced by a single '*' character.\n *\n * If the output ends with more than two lines of zeroes, you\n * should call xxdline again with l being the last line and nz\n * negative. This ensures that the last line is shown even when\n * it is all zeroes.\n *\n * If nz is always positive, lines are never suppressed.\n */\n  static void\nxxdline(FILE *fp, char *l, int nz)\n{\n  static char z[LLEN+1];\n  static int zero_seen = 0;\n\n  if (!nz && zero_seen == 1)\n    strcpy(z, l);\n\n  if (nz || !zero_seen++)\n    {\n      if (nz)\n\t{\n\t  if (nz < 0)\n\t    zero_seen--;\n\t  if (zero_seen == 2)\n\t    if (fputs(z, fp) == EOF)\n\t      die(3);\n\t  if (zero_seen > 2)\n\t    if (fputs(\"*\\n\", fp) == EOF)\n\t      die(3);\n\t}\n      if (nz >= 0 || zero_seen > 0)\n\tif (fputs(l, fp) == EOF)\n\t  die(3);\n      if (nz)\n\tzero_seen = 0;\n    }\n}\n\n/* This is an EBCDIC to ASCII conversion table */\n/* from a proposed BTL standard April 16, 1979 */\nstatic unsigned char etoa64[] =\n{\n    0040,0240,0241,0242,0243,0244,0245,0246,\n    0247,0250,0325,0056,0074,0050,0053,0174,\n    0046,0251,0252,0253,0254,0255,0256,0257,\n    0260,0261,0041,0044,0052,0051,0073,0176,\n    0055,0057,0262,0263,0264,0265,0266,0267,\n    0270,0271,0313,0054,0045,0137,0076,0077,\n    0272,0273,0274,0275,0276,0277,0300,0301,\n    0302,0140,0072,0043,0100,0047,0075,0042,\n    0303,0141,0142,0143,0144,0145,0146,0147,\n    0150,0151,0304,0305,0306,0307,0310,0311,\n    0312,0152,0153,0154,0155,0156,0157,0160,\n    0161,0162,0136,0314,0315,0316,0317,0320,\n    0321,0345,0163,0164,0165,0166,0167,0170,\n    0171,0172,0322,0323,0324,0133,0326,0327,\n    0330,0331,0332,0333,0334,0335,0336,0337,\n    0340,0341,0342,0343,0344,0135,0346,0347,\n    0173,0101,0102,0103,0104,0105,0106,0107,\n    0110,0111,0350,0351,0352,0353,0354,0355,\n    0175,0112,0113,0114,0115,0116,0117,0120,\n    0121,0122,0356,0357,0360,0361,0362,0363,\n    0134,0237,0123,0124,0125,0126,0127,0130,\n    0131,0132,0364,0365,0366,0367,0370,0371,\n    0060,0061,0062,0063,0064,0065,0066,0067,\n    0070,0071,0372,0373,0374,0375,0376,0377\n};\n\n  int\nmain(int argc, char *argv[])\n{\n  FILE *fp, *fpo;\n  int c, e, p = 0, relseek = 1, negseek = 0, revert = 0;\n  int cols = 0, nonzero = 0, autoskip = 0, hextype = HEX_NORMAL;\n  int ebcdic = 0;\n  int octspergrp = -1;\t/* number of octets grouped in output */\n  int grplen;\t\t/* total chars per octet group */\n  long length = -1, n = 0, seekoff = 0, displayoff = 0;\n  static char l[LLEN+1];  /* static because it may be too big for stack */\n  char *pp;\n\n#ifdef AMIGA\n  /* This program doesn't work when started from the Workbench */\n  if (argc == 0)\n    exit(1);\n#endif\n\n  pname = argv[0];\n  for (pp = pname; *pp; )\n    if (*pp++ == PATH_SEP)\n      pname = pp;\n#ifdef FILE_SEP\n  for (pp = pname; *pp; pp++)\n    if (*pp == FILE_SEP)\n      {\n\t*pp = '\\0';\n\tbreak;\n      }\n#endif\n\n  while (argc >= 2)\n    {\n      pp = argv[1] + (!STRNCMP(argv[1], \"--\", 2) && argv[1][2]);\n\t   if (!STRNCMP(pp, \"-a\", 2)) autoskip = 1 - autoskip;\n      else if (!STRNCMP(pp, \"-b\", 2)) hextype = HEX_BITS;\n      else if (!STRNCMP(pp, \"-e\", 2)) hextype = HEX_LITTLEENDIAN;\n      else if (!STRNCMP(pp, \"-u\", 2)) hexx = hexxa + 16;\n      else if (!STRNCMP(pp, \"-p\", 2)) hextype = HEX_POSTSCRIPT;\n      else if (!STRNCMP(pp, \"-i\", 2)) hextype = HEX_CINCLUDE;\n      else if (!STRNCMP(pp, \"-r\", 2)) revert++;\n      else if (!STRNCMP(pp, \"-E\", 2)) ebcdic++;\n      else if (!STRNCMP(pp, \"-v\", 2))\n\t{\n\t  fprintf(stderr, \"%s%s\\n\", version, osver);\n\t  exit(0);\n\t}\n      else if (!STRNCMP(pp, \"-c\", 2))\n\t{\n\t  if (pp[2] && STRNCMP(\"ols\", pp + 2, 3))\n\t    cols = (int)strtol(pp + 2, NULL, 0);\n\t  else\n\t    {\n\t      if (!argv[2])\n\t\texit_with_usage();\n\t      cols = (int)strtol(argv[2], NULL, 0);\n\t      argv++;\n\t      argc--;\n\t    }\n\t}\n      else if (!STRNCMP(pp, \"-g\", 2))\n\t{\n\t  if (pp[2] && STRNCMP(\"group\", pp + 2, 5))\n\t    octspergrp = (int)strtol(pp + 2, NULL, 0);\n\t  else\n\t    {\n\t      if (!argv[2])\n\t\texit_with_usage();\n\t      octspergrp = (int)strtol(argv[2], NULL, 0);\n\t      argv++;\n\t      argc--;\n\t    }\n\t}\n      else if (!STRNCMP(pp, \"-o\", 2))\n\t{\n\t  if (pp[2] && STRNCMP(\"ffset\", pp + 2, 5))\n\t    displayoff = (int)strtol(pp + 2, NULL, 0);\n\t  else\n\t    {\n\t      if (!argv[2])\n\t\texit_with_usage();\n\t      displayoff = (int)strtol(argv[2], NULL, 0);\n\t      argv++;\n\t      argc--;\n\t    }\n\t}\n      else if (!STRNCMP(pp, \"-s\", 2))\n\t{\n\t  relseek = 0;\n\t  negseek = 0;\n\t  if (pp[2] && STRNCMP(\"kip\", pp+2, 3) && STRNCMP(\"eek\", pp+2, 3))\n\t    {\n#ifdef TRY_SEEK\n\t      if (pp[2] == '+')\n\t\trelseek++;\n\t      if (pp[2+relseek] == '-')\n\t\tnegseek++;\n#endif\n\t      seekoff = strtol(pp + 2+relseek+negseek, (char **)NULL, 0);\n\t    }\n\t  else\n\t    {\n\t      if (!argv[2])\n\t\texit_with_usage();\n#ifdef TRY_SEEK\n\t      if (argv[2][0] == '+')\n\t\trelseek++;\n\t      if (argv[2][relseek] == '-')\n\t\tnegseek++;\n#endif\n\t      seekoff = strtol(argv[2] + relseek+negseek, (char **)NULL, 0);\n\t      argv++;\n\t      argc--;\n\t    }\n\t}\n      else if (!STRNCMP(pp, \"-l\", 2))\n\t{\n\t  if (pp[2] && STRNCMP(\"en\", pp + 2, 2))\n\t    length = strtol(pp + 2, (char **)NULL, 0);\n\t  else\n\t    {\n\t      if (!argv[2])\n\t\texit_with_usage();\n\t      length = strtol(argv[2], (char **)NULL, 0);\n\t      argv++;\n\t      argc--;\n\t    }\n\t}\n      else if (!strcmp(pp, \"--\"))\t/* end of options */\n\t{\n\t  argv++;\n\t  argc--;\n\t  break;\n\t}\n      else if (pp[0] == '-' && pp[1])\t/* unknown option */\n\texit_with_usage();\n      else\n\tbreak;\t\t\t\t/* not an option */\n\n      argv++;\t\t\t\t/* advance to next argument */\n      argc--;\n    }\n\n  if (!cols)\n    switch (hextype)\n      {\n      case HEX_POSTSCRIPT:\tcols = 30; break;\n      case HEX_CINCLUDE:\tcols = 12; break;\n      case HEX_BITS:\t\tcols = 6; break;\n      case HEX_NORMAL:\n      case HEX_LITTLEENDIAN:\n      default:\t\t\tcols = 16; break;\n      }\n\n  if (octspergrp < 0)\n    switch (hextype)\n      {\n      case HEX_BITS:\t\toctspergrp = 1; break;\n      case HEX_NORMAL:\t\toctspergrp = 2; break;\n      case HEX_LITTLEENDIAN:\toctspergrp = 4; break;\n      case HEX_POSTSCRIPT:\n      case HEX_CINCLUDE:\n      default:\t\t\toctspergrp = 0; break;\n      }\n\n  if (cols < 1 || ((hextype == HEX_NORMAL || hextype == HEX_BITS || hextype == HEX_LITTLEENDIAN)\n\t\t\t\t\t\t\t    && (cols > COLS)))\n    {\n      fprintf(stderr, \"%s: invalid number of columns (max. %d).\\n\", pname, COLS);\n      exit(1);\n    }\n\n  if (octspergrp < 1 || octspergrp > cols)\n    octspergrp = cols;\n  else if (hextype == HEX_LITTLEENDIAN && (octspergrp & (octspergrp-1)))\n    {\n      fprintf(stderr,\n\t      \"%s: number of octets per group must be a power of 2 with -e.\\n\",\n\t      pname);\n      exit(1);\n    }\n\n  if (argc > 3)\n    exit_with_usage();\n\n  if (argc == 1 || (argv[1][0] == '-' && !argv[1][1]))\n    BIN_ASSIGN(fp = stdin, !revert);\n  else\n    {\n      if ((fp = fopen(argv[1], BIN_READ(!revert))) == NULL)\n\t{\n\t  fprintf(stderr,\"%s: \", pname);\n\t  perror(argv[1]);\n\t  return 2;\n\t}\n    }\n\n  if (argc < 3 || (argv[2][0] == '-' && !argv[2][1]))\n    BIN_ASSIGN(fpo = stdout, revert);\n  else\n    {\n      int fd;\n      int mode = revert ? O_WRONLY : (O_TRUNC|O_WRONLY);\n\n      if (((fd = OPEN(argv[2], mode | BIN_CREAT(revert), 0666)) < 0) ||\n\t  (fpo = fdopen(fd, BIN_WRITE(revert))) == NULL)\n\t{\n\t  fprintf(stderr, \"%s: \", pname);\n\t  perror(argv[2]);\n\t  return 3;\n\t}\n      rewind(fpo);\n    }\n\n  if (revert)\n    {\n      if (hextype && (hextype != HEX_POSTSCRIPT))\n\t{\n\t  fprintf(stderr, \"%s: sorry, cannot revert this type of hexdump\\n\", pname);\n\t  return -1;\n\t}\n      return huntype(fp, fpo, stderr, cols, hextype,\n\t\tnegseek ? -seekoff : seekoff);\n    }\n\n  if (seekoff || negseek || !relseek)\n    {\n#ifdef TRY_SEEK\n      if (relseek)\n\te = fseek(fp, negseek ? -seekoff : seekoff, 1);\n      else\n\te = fseek(fp, negseek ? -seekoff : seekoff, negseek ? 2 : 0);\n      if (e < 0 && negseek)\n\t{\n\t  fprintf(stderr, \"%s: sorry cannot seek.\\n\", pname);\n\t  return 4;\n\t}\n      if (e >= 0)\n\tseekoff = ftell(fp);\n      else\n#endif\n\t{\n\t  long s = seekoff;\n\n\t  while (s--)\n\t    if (getc(fp) == EOF)\n\t    {\n\t      if (ferror(fp))\n\t\t{\n\t\t  die(2);\n\t\t}\n\t      else\n\t\t{\n\t\t  fprintf(stderr, \"%s: sorry cannot seek.\\n\", pname);\n\t\t  return 4;\n\t\t}\n\t    }\n\t}\n    }\n\n  if (hextype == HEX_CINCLUDE)\n    {\n      if (fp != stdin)\n\t{\n\t  if (fprintf(fpo, \"unsigned char %s\", isdigit((int)argv[1][0]) ? \"__\" : \"\") < 0)\n\t    die(3);\n\t  for (e = 0; (c = argv[1][e]) != 0; e++)\n\t    if (putc(isalnum(c) ? c : '_', fpo) == EOF)\n\t      die(3);\n\t  if (fputs(\"[] = {\\n\", fpo) == EOF)\n\t    die(3);\n\t}\n\n      p = 0;\n      c = 0;\n      while ((length < 0 || p < length) && (c = getc(fp)) != EOF)\n\t{\n\t  if (fprintf(fpo, (hexx == hexxa) ? \"%s0x%02x\" : \"%s0X%02X\",\n\t\t(p % cols) ? \", \" : &\",\\n  \"[2*!p],  c) < 0)\n\t    die(3);\n\t  p++;\n\t}\n      if (c == EOF && ferror(fp))\n\tdie(2);\n\n      if (p && fputs(\"\\n\", fpo) == EOF)\n\tdie(3);\n      if (fputs(&\"};\\n\"[3 * (fp == stdin)], fpo) == EOF)\n\tdie(3);\n\n      if (fp != stdin)\n\t{\n\t  if (fprintf(fpo, \"unsigned int %s\", isdigit((int)argv[1][0]) ? \"__\" : \"\") < 0)\n\t    die(3);\n\t  for (e = 0; (c = argv[1][e]) != 0; e++)\n\t    if (putc(isalnum(c) ? c : '_', fpo) == EOF)\n\t      die(3);\n\t  if (fprintf(fpo, \"_len = %d;\\n\", p) < 0)\n\t    die(3);\n\t}\n\n      if (fclose(fp))\n\tdie(2);\n      if (fclose(fpo))\n\tdie(3);\n      return 0;\n    }\n\n  if (hextype == HEX_POSTSCRIPT)\n    {\n      p = cols;\n      e = 0;\n      while ((length < 0 || n < length) && (e = getc(fp)) != EOF)\n\t{\n\t  if (putc(hexx[(e >> 4) & 0xf], fpo) == EOF\n\t\t  || putc(hexx[e & 0xf], fpo) == EOF)\n\t    die(3);\n\t  n++;\n\t  if (!--p)\n\t    {\n\t      if (putc('\\n', fpo) == EOF)\n\t\tdie(3);\n\t      p = cols;\n\t    }\n\t}\n      if (e == EOF && ferror(fp))\n\tdie(2);\n      if (p < cols)\n\tif (putc('\\n', fpo) == EOF)\n\t  die(3);\n      if (fclose(fp))\n\tdie(2);\n      if (fclose(fpo))\n\tdie(3);\n      return 0;\n    }\n\n  /* hextype: HEX_NORMAL or HEX_BITS or HEX_LITTLEENDIAN */\n\n  if (hextype != HEX_BITS)\n    grplen = octspergrp + octspergrp + 1;\t/* chars per octet group */\n  else\t/* hextype == HEX_BITS */\n    grplen = 8 * octspergrp + 1;\n\n  e = 0;\n  while ((length < 0 || n < length) && (e = getc(fp)) != EOF)\n    {\n      if (p == 0)\n\t{\n\t  sprintf(l, \"%08lx:\",\n\t    ((unsigned long)(n + seekoff + displayoff)) & 0xffffffff);\n\t  for (c = 9; c < LLEN; l[c++] = ' ');\n\t}\n      if (hextype == HEX_NORMAL)\n\t{\n\t  l[c = (10 + (grplen * p) / octspergrp)] = hexx[(e >> 4) & 0xf];\n\t  l[++c]\t\t\t\t  = hexx[ e       & 0xf];\n\t}\n      else if (hextype == HEX_LITTLEENDIAN)\n\t{\n\t  int x = p ^ (octspergrp-1);\n\t  l[c = (10 + (grplen * x) / octspergrp)] = hexx[(e >> 4) & 0xf];\n\t  l[++c]\t\t\t\t  = hexx[ e       & 0xf];\n\t}\n      else /* hextype == HEX_BITS */\n\t{\n\t  int i;\n\n\t  c = (10 + (grplen * p) / octspergrp) - 1;\n\t  for (i = 7; i >= 0; i--)\n\t    l[++c] = (e & (1 << i)) ? '1' : '0';\n\t}\n      if (ebcdic)\n\te = (e < 64) ? '.' : etoa64[e-64];\n      /* When changing this update definition of LLEN above. */\n      l[12 + (grplen * cols - 1)/octspergrp + p] =\n#ifdef __MVS__\n\t  (e >= 64)\n#else\n\t  (e > 31 && e < 127)\n#endif\n\t  ? e : '.';\n      if (e)\n\tnonzero++;\n      n++;\n      if (++p == cols)\n\t{\n\t  l[c = (12 + (grplen * cols - 1)/octspergrp + p)] = '\\n'; l[++c] = '\\0';\n\t  xxdline(fpo, l, autoskip ? nonzero : 1);\n\t  nonzero = 0;\n\t  p = 0;\n\t}\n    }\n  if (e == EOF && ferror(fp))\n    die(2);\n  if (p)\n    {\n      l[c = (12 + (grplen * cols - 1)/octspergrp + p)] = '\\n'; l[++c] = '\\0';\n      xxdline(fpo, l, 1);\n    }\n  else if (autoskip)\n    xxdline(fpo, l, -1);\t/* last chance to flush out suppressed lines */\n\n  if (fclose(fp))\n    die(2);\n  if (fclose(fpo))\n    die(3);\n  return 0;\n}\n\n/* vi:set ts=8 sw=4 sts=2 cino+={2 cino+=n-2 : */\n"
  },
  {
    "path": "projects/cryptography/Dockerfile",
    "content": "# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN git clone https://github.com/pyca/cryptography\nRUN apt-get update && apt-get install build-essential libssl-dev libffi-dev pkg-config python3-dev cargo -y\nRUN pip3 install --upgrade pip\nRUN curl https://sh.rustup.rs -sSf | sh -s -- -y\n\nENV PATH=\"/root/.cargo/bin:${PATH}\"\nRUN rustup install nightly\nRUN rustup default nightly\nWORKDIR cryptography\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/cryptography/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build fuzzers in $OUT.\npython3 -m pip cache purge\n# Compiling with sancov is causing some issues at the moment. This is likely\n# due to some missing flags propagated throughout.\nunset RUSTFLAGS\nunset CXXFLAGS\nunset CFLAGS\npython3 -m pip install .\n\ncd $SRC\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n   compile_python_fuzzer $fuzzer \ndone\n"
  },
  {
    "path": "projects/cryptography/fuzz_aead.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n    import cryptography.hazmat.primitives.ciphers.aead as aead\n\ndef TestInput(input_bytes):\n    if len(input_bytes) < 12:\n        return\n\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n\n    choice = fdp.ConsumeIntInRange(1,4)\n\n    if choice == 1:\n        cipher = aead.ChaCha20Poly1305(aead.ChaCha20Poly1305.generate_key())\n    if choice == 2:\n        cipher = aead.AESGCM(aead.AESGCM.generate_key(bit_length=128))\n    if choice == 3:\n        cipher = aead.AESOCB3(aead.AESOCB3.generate_key(bit_length=128))\n    if choice == 4:\n        cipher = aead.AESCCM(aead.AESCCM.generate_key(bit_length=128))\n   \n    msg = fdp.ConsumeBytes(32)\n    authentext =  fdp.ConsumeBytes(32)\n    nonce = fdp.ConsumeBytes(12)\n   \n    if len(nonce) < 12:\n        return\n\n    ciphertext = cipher.encrypt(nonce, msg, authentext)\n    plaintext = cipher.decrypt(nonce, ciphertext, authentext)\n\n    assert (plaintext == msg), \"Encryption/Decrption error!\"\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=False)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n   main()\n"
  },
  {
    "path": "projects/cryptography/fuzz_dh.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n    from cryptography.hazmat.primitives import hashes\n    from cryptography.hazmat.primitives.asymmetric import dh\n    from cryptography.hazmat.primitives.kdf.hkdf import HKDF\n\ndef TestInput(input_bytes):\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n\n    try:\n        parameters = dh.generate_parameters(\n            generator=(2 if fdp.ConsumeBool() else 5), \n            key_size=fdp.ConsumeInt(4)\n        )\n    except ValueError as e:\n        # This can only happen if the key_size isn't valid\n        return\n\n    server_private_key = parameters.generate_private_key()\n    peer_private_key = parameters.generate_private_key()\n    server_derived_shared_key = server_private_key.exchange(peer_private_key.public_key())\n    peer_derived_shared_key = peer_private_key.exchange(server_private_key.public_key())\n\n    infobytes = fdp.ConsumeBytes(10)\n\n    server_derived_key = HKDF(\n        algorithm=hashes.SHA256(),\n        length=32,\n        salt=None,\n        info=infobytes,\n    ).derive(server_derived_shared_key)\n\n    peer_derived_key = HKDF(\n        algorithm=hashes.SHA256(),\n        length=32,\n        salt=None,\n        info=infobytes,\n    ).derive(peer_derived_shared_key)\n\n    assert (server_derived_key == peer_derived_key), \"Key Derivation Error!!\"\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=False)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cryptography/fuzz_dsa.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n    from cryptography.hazmat.primitives import hashes\n    from cryptography.hazmat.primitives.asymmetric import dsa, utils\n\ndef TestInput(input_bytes):\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n\n    private_key = dsa.generate_private_key(key_size=1024)\n    public_key = private_key.public_key()\n\n    data = fdp.ConsumeBytes(20)\n    more_data = fdp.ConsumeBytes(20)\n\n    hasher = hashes.Hash(hashes.SHA256())\n    hasher.update(data)\n    hasher.update(more_data)\n    digest = hasher.finalize()\n\n    sig1 = private_key.sign(data,hashes.SHA256())\n    sig2 = private_key.sign(digest,utils.Prehashed(hashes.SHA256()))\n\n    public_key.verify(sig1,data,hashes.SHA256())\n    public_key.verify(sig2,digest,utils.Prehashed(hashes.SHA256()))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=False)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cryptography/fuzz_rsa.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n    from cryptography.hazmat.primitives import hashes\n    from cryptography.hazmat.primitives.asymmetric import rsa, utils, padding\n\ndef TestInput(input_bytes):\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n\n    private_key = rsa.generate_private_key(key_size=1024, public_exponent=65537)\n    public_key = private_key.public_key()\n\n    data = fdp.ConsumeBytes(20)\n    more_data = fdp.ConsumeBytes(20)\n\n    hasher = hashes.Hash(hashes.SHA256())\n    hasher.update(data)\n    hasher.update(more_data)\n    digest = hasher.finalize()\n\n    sig1 = private_key.sign(data, padding.PSS(mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH), hashes.SHA256())\n    sig2 = private_key.sign(digest, padding.PSS(mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH), utils.Prehashed(hashes.SHA256()))\n\n    public_key.verify(sig1, data, padding.PSS(mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH), hashes.SHA256())\n    public_key.verify(sig2, digest, padding.PSS(mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH), utils.Prehashed(hashes.SHA256()))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=False)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cryptography/fuzz_sym.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport base64\nimport atheris\nwith atheris.instrument_imports():\n     from cryptography.fernet import Fernet\n     from cryptography.hazmat.primitives import hashes\n     from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC\n\ndef TestInput(input_bytes):\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n    plaintext = fdp.ConsumeBytes(32)\n\n    key = Fernet(Fernet.generate_key())\n    token = key.encrypt(plaintext)\n    text = key.decrypt(token)\n    assert (plaintext == text), \"Encryption/Decrption error!\"\n\n    password = fdp.ConsumeBytes(8)\n    salt = fdp.ConsumeBytes(16)\n    kdf = PBKDF2HMAC(\n        algorithm=hashes.SHA256(),\n        length=32,\n        salt=salt,\n        iterations=1,\n    )\n    key = Fernet(base64.urlsafe_b64encode(kdf.derive(password)))\n    token = key.encrypt(plaintext)\n    text = key.decrypt(token)\n    assert (plaintext == text), \"Encryption/Decrption error!\"\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=False)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/cryptography/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nauto_ccs:\n- paul.l.kehrer@gmail.com\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pyca/cryptography\nlanguage: python\nmain_repo: https://github.com/pyca/cryptography\nprimary_contact: alex.gaynor@gmail.com\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/cryptsetup/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://gitlab.com/cryptsetup/cryptsetup.git\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/cryptsetup/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./cryptsetup/tests/fuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/cryptsetup/project.yaml",
    "content": "homepage: \"https://gitlab.com/cryptsetup/cryptsetup\"\nlanguage: c\nbuilds_per_day: 2\nprimary_contact: \"gmazyland@gmail.com\"\nauto_ccs:\n  - okozina@redhat.com\n  - vtrefny@redhat.com\n  - daniel.zatovic@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: \"https://gitlab.com/cryptsetup/cryptsetup.git\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/cssselect/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/scrapy/cssselect cssselect\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/cssselect\n"
  },
  {
    "path": "projects/cssselect/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/cssselect/fuzz_parse.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport cssselect\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  css = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  try:\n    cssselect.parser.parse(css)\n  except (cssselect.parser.SelectorError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/cssselect/fuzz_xpath.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport cssselect\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  css = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  try:\n    translator = cssselect.xpath.GenericTranslator()\n    translator.css_to_xpath(css)\n  except(cssselect.parser.SelectorError,TypeError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/cssselect/project.yaml",
    "content": "homepage: https://github.com/scrapy/cssselect\nmain_repo: https://github.com/scrapy/cssselect\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/cubefs/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/cubefs/cubefs\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing.git\nCOPY build.sh $SRC/\nRUN cd /src/cubefs && make cli \nWORKDIR $SRC/cubefs\n"
  },
  {
    "path": "projects/cubefs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed 's/go 1.17/go 1.21/g' -i ./go.mod\n$SRC/cncf-fuzzing/projects/cubefs/build.sh\n"
  },
  {
    "path": "projects/cubefs/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/cubefs/cubefs\"\nmain_repo: \"https://github.com/cubefs/cubefs\"\nprimary_contact: \"626148589@qq.com\"\nauto_ccs:\n  - \"changliang@oppo.com\"\n  - \"baijiaruo@126.com\"\n  - \"tangjingyu@oppo.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/cups/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y zlib1g-dev libavahi-client-dev libsystemd-dev\nRUN git clone --depth 1 https://github.com/OpenPrinting/cups\nRUN git clone --depth 1 https://github.com/OpenPrinting/fuzzing.git\nRUN cp $SRC/fuzzing/projects/cups/oss_fuzz_build.sh $SRC/build.sh\nCOPY run_tests.sh *.diff $SRC/\nRUN cd $SRC/fuzzing && git apply $SRC/test_patch.diff\nWORKDIR $SRC/cups\n"
  },
  {
    "path": "projects/cups/project.yaml",
    "content": "homepage: \"https://openprinting.github.io/cups/\"\nmain_repo: 'https://github.com/OpenPrinting/cups'\n# help_url:\nlanguage: c\n\nprimary_contact: \"jiongchiyu@gmail.com\"\nauto_ccs:\n  - \"till.kamppeter@gmail.com\"\n  - \"ossfuzz@iosifache.me\"\n  - \"msweet@msweet.org\"\n  - \"pushinliu@gmail.com\"\n# vendor_ccs:\n\narchitectures:\n  - x86_64\n  # - i386\n\nsanitizers:\n  - address\n  - memory\n  # - undefined\n\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n\n# builds_per_day: 2"
  },
  {
    "path": "projects/cups/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# build the unit tests\nexport ASAN_OPTIONS=detect_leaks=0\n\ncd $SRC/cups\n# these locales fail:\nrm locale/cups_hu.po\nrm locale/cups_pt.po\n\n# Below we run two test suites.\n# cups has another test suite which is part\n# of `make test`: `cd test; ./run-stp-tests.sh`,\n# however, this requires a non-root user and\n# network interfaces that OSS-Fuzz doesn't support.\n\npushd cups\n  make test\npopd\npushd scheduler\n  make test\npopd\n\n"
  },
  {
    "path": "projects/cups/test_patch.diff",
    "content": "diff --git a/projects/cups/oss_fuzz_build.sh b/projects/cups/oss_fuzz_build.sh\nindex 01ebaf3..f72b756 100755\n--- a/projects/cups/oss_fuzz_build.sh\n+++ b/projects/cups/oss_fuzz_build.sh\n@@ -34,7 +34,7 @@ popd\n pushd $SRC/cups\n # Show build version\n echo \"CUPS version: $(git rev-parse HEAD)\"\n-./configure --enable-static --disable-shared\n+./configure --enable-unit-tests --enable-static --disable-shared\n make # -j$(nproc)\n popd\n \n"
  },
  {
    "path": "projects/cups-filters/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool build-essential \n\n### for cups-filters-2.x\n# RUN sed --in-place 's/focal/noble/g' /etc/apt/sources.list\n# RUN apt update && apt-get install -y chrpath gnutls-dev libppd-dev libavahi-common-dev libavahi-client-dev autopoint gettext libcups2-dev ghostscript mupdf-tools \n# RUN git clone --depth 1 https://github.com/OpenPrinting/cups-filters.git\n\n### for cups-filters-1.x\nRUN apt update && apt-get install -y libexif-dev libglib2.0-dev libavahi-glib-dev liblcms2-dev libfreetype6-dev libfontconfig1-dev libqpdf-dev libpoppler-cpp-dev poppler-utils \\\nlibunistring-dev libsystemd-dev libcap-dev gettext autopoint libcups2-dev libavahi-client-dev ghostscript mupdf-tools \n\n# ubuntu 20.04 only supports cups-filters 1.x\nRUN git clone --depth 1 -b \"1.x\" https://github.com/OpenPrinting/cups-filters.git\nRUN git clone --depth 1 https://github.com/OpenPrinting/fuzzing.git\n        \nRUN cp $SRC/fuzzing/projects/cups-filters/oss_fuzz_build.sh $SRC/build.sh\n\nWORKDIR $SRC/cups-filters                   \nCOPY run_tests.sh $SRC/\n\n"
  },
  {
    "path": "projects/cups-filters/project.yaml",
    "content": "homepage: \"https://github.com/OpenPrinting/cups-filters\"\nmain_repo: \"https://github.com/OpenPrinting/cups-filters.git\"\n# help_url:\nlanguage: c++\n\nprimary_contact: \"jiongchiyu@gmail.com\"\nauto_ccs:\n  - \"till.kamppeter@gmail.com\"\n  - \"ossfuzz@iosifache.me\"\n  - \"msweet@msweet.org\"\n  # - \"jsmeix@suse.de\"\n  # - \"debian@alteholz.de\"\n  # - \"zdohnal@redhat.com\"\n  # - \"basu.aveek@gmail.com\"\n# vendor_ccs:\n\narchitectures:\n  - x86_64\n  # - i386\n\nsanitizers:\n  - address\n  - memory\n  # - undefined   \n\nfuzzing_engines:\n  - libfuzzer\n  # - afl\n  # - honggfuzz\n\n# builds_per_day: 2"
  },
  {
    "path": "projects/cups-filters/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check\n"
  },
  {
    "path": "projects/cura-engine/project.yaml",
    "content": "homepage: \"https://github.com/Ultimaker/CuraEngine\"\nlanguage: c++\nprimary_contact: \"j.vankessel@ultimaker.com\"\nauto_ccs:\n  - \"artem.smotrakov@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: \"https://github.com/Ultimaker/CuraEngine.git\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/curl/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN git clone --depth 1 https://github.com/curl/curl.git /src/curl\nRUN git clone --depth 1 https://github.com/curl/curl-fuzzer.git /src/curl_fuzzer\n\n# Use curl-fuzzer's scripts to get latest dependencies.\nRUN $SRC/curl_fuzzer/scripts/ossfuzzdeps.sh\n\nWORKDIR $SRC/curl_fuzzer\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/curl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the OSS-Fuzz script in the curl-fuzzer project.\n\nif [[ ! -z \"${REPLAY_ENABLED-}\" ]]; then\n  # If we don't do this, the curl library won't rebuild.\n  rm -f $SRC/curl_fuzzer/build/curl-install/lib/libcurl.a\n  pushd $SRC/curl\n  make install\n  popd\nfi\n\n./ossfuzz.sh\n"
  },
  {
    "path": "projects/curl/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://curl.haxx.se/\"\nlanguage: c++\nprimary_contact: \"daniel@haxx.se\"\nauto_ccs:\n  - \"daniel.haxx@gmail.com\"\n  - \"cmeister2@gmail.com\"\n  - \"stefan.eissing@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/curl/curl.git'\n"
  },
  {
    "path": "projects/curl/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/curl\nmake test\n"
  },
  {
    "path": "projects/curvesapi/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/virtuald/curvesapi curvesapi\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/curvesapi\n"
  },
  {
    "path": "projects/curvesapi/ParseFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.graphbuilder.math.ExpressionTree;\nimport com.graphbuilder.math.Expression;\nimport com.graphbuilder.math.ExpressionParseException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [com.graphbuilder.math.ExpressionTree] public static com.graphbuilder.math.Expression parse(java.lang.String)\npublic class ParseFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      com.graphbuilder.math.ExpressionTree.parse(data.consumeRemainingAsString());\n    } catch (ExpressionParseException e1) {}\n  }\n}\n"
  },
  {
    "path": "projects/curvesapi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\nfind ./ -name pom.xml -exec sed -i 's/source>1.5</source>1.8</g' {} \\;\nfind ./ -name pom.xml -exec sed -i 's/target>1.5</target>1.8</g' {} \\;\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false dependency:copy-dependencies\n\nJARFILE_LIST=\nfor JARFILE in $(find ./target  -name *.jar)\ndo\n  cp $JARFILE $OUT/\n  JARFILE_LIST=\"$JARFILE_LIST$(basename $JARFILE) \"\ndone\n\ncurr_dir=$(pwd)\nrm -rf $OUT/jar_temp\nmkdir $OUT/jar_temp\ncd $OUT/jar_temp\nfor JARFILE in $JARFILE_LIST\ndo\n  jar -xf $OUT/$JARFILE\ndone\ncd $curr_dir\n\nBUILD_CLASSPATH=$JAZZER_API_PATH:$OUT/jar_temp\nRUNTIME_CLASSPATH=\\$this_dir/jar_temp:\\$this_dir\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \"\\$0\")\nif [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\nthen\nmem_settings='-Xmx1900m:-Xss900k'\nelse\nmem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir         \\\n  \\$this_dir/jazzer_driver                                \\\n  --agent_path=\\$this_dir/jazzer_agent_deploy.jar         \\\n  --cp=$RUNTIME_CLASSPATH                                 \\\n  --target_class=$fuzzer_basename                         \\\n  --jvm_args=\"\\$mem_settings\"                             \\\n  \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/curvesapi/project.yaml",
    "content": "homepage: https://github.com/virtuald/curvesapi\nmain_repo: https://github.com/virtuald/curvesapi\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/cxxopts/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y python3\nRUN git clone --depth 1 https://github.com/jarro2783/cxxopts.git cxxopts\nWORKDIR cxxopts\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/cxxopts/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable ccache for chronos check since ccache is not compatible with bazel\nexport PATH=$(echo $PATH | tr ':' '\\n' | grep -v ccache | tr '\\n' ':' | sed 's/:$//')\n\nexport CXXFLAGS=\"${CXXFLAGS} -std=c++17\"\nexport USE_BAZEL_VERSION=7.4.0\nbazel_build_fuzz_tests\n\n# Build unit test\n$CXX $CXXFLAGS -o unittest -Iinclude -Itest test/main.cpp test/options.cpp\n"
  },
  {
    "path": "projects/cxxopts/project.yaml",
    "content": "homepage: \"https://github.com/jarro2783/cxxopts\"\nlanguage: c++\nprimary_contact: \"jarro.2783@gmail.com\"\nmain_repo: \"https://github.com/jarro2783/cxxopts\"\nauto_ccs:\n  - nathaniel@rough.run\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/cxxopts/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./unittest\n"
  },
  {
    "path": "projects/cyclonedds/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt install -y \\\n    autoconf \\\n    automake \\\n    libssl-dev \\\n    libcunit1 \\\n    libcunit1-dev \\\n    bison \\\n    libbison-dev\n\nRUN git clone --depth 1 https://github.com/eclipse-cyclonedds/cyclonedds\n\nCOPY build.sh $SRC\nWORKDIR $SRC/cyclonedds\n# This is to fix Fuzz Introspector build by using LLVM old pass manager\n# re https://github.com/ossf/fuzz-introspector/issues/305\nENV OLD_LLVMPASS 1\n"
  },
  {
    "path": "projects/cyclonedds/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsource fuzz/oss-fuzz-build.sh"
  },
  {
    "path": "projects/cyclonedds/project.yaml",
    "content": "homepage: \"https://projects.eclipse.org/projects/iot.cyclonedds\"\nlanguage: c\nauto_ccs:\n  - \"federico.maggi@gmail.com\"\nprimary_contact: \"eb@ilities.com\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/eclipse-cyclonedds/cyclonedds.git'\n"
  },
  {
    "path": "projects/d3/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/d3/d3.git\n\nRUN #mkdir -p $SRC/d3/fuzz_tests\n\nCOPY fuzz_tests $SRC/d3/fuzz_tests\n\nCOPY babel.config.json $SRC/d3\n\nWORKDIR $SRC/d3\n"
  },
  {
    "path": "projects/d3/babel.config.json",
    "content": "{\n    \"plugins\": [\"@babel/plugin-transform-modules-commonjs\"],\n    \"ignore\": [\"**/@jazzer.js\", \"**/@babel\", \"**/istanbul-reports\"]\n}\n"
  },
  {
    "path": "projects/d3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfunction change_type_to_commonjs() {\n    # Find all package.json files inside the node_modules directory\n    find \"$1\" -name \"package.json\" -type f | while read -r package_file; do\n        # Check if the file contains the \"type\" field\n        if grep -q '\"type\": \"module\"' \"$package_file\"; then\n            # Replace \"type\": \"module\" with \"type\": \"commonjs\"\n            sed -i 's/\"type\": \"module\"/\"type\": \"commonjs\"/' \"$package_file\"\n            echo \"Updated $package_file\"\n        fi\n    done\n}\n\nfunction transform_dir_into_commonjs() {\n    babel \"$1\" --keep-file-extension -D -d \"$1\"_commonjs\n    rm -r \"$1\"\n    mv \"$1\"_commonjs \"$1\"\n}\n\nfunction remove_dev_dependencies() {\n    package_json=$(cat package.json)\n\n    # Remove the \"devDependencies\" item from package.json\n    new_package_json=$(echo \"$package_json\" | jq 'del(.devDependencies)')\n\n    # Overwrite the package.json file with the updated content\n    echo \"$new_package_json\" > package.json\n\n}\n\n# Install dependencies.\nremove_dev_dependencies\n\nnpm install --global yarn\nyarn install\n\nnpm install -g @babel/cli\nyarn add --dev @babel/core @babel/plugin-transform-modules-commonjs\nyarn add --dev @jazzer.js/core\n\ntransform_dir_into_commonjs $SRC/d3/src\ntransform_dir_into_commonjs $SRC/d3/node_modules\n\nchange_type_to_commonjs $SRC/d3\n\n\n# Build Fuzzers.\ncompile_javascript_fuzzer d3 fuzz_tests/fuzz_csv_parse -i d3- --sync\n\n"
  },
  {
    "path": "projects/d3/fuzz_tests/fuzz_csv_parse.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst d3 = require(\"../src/index.js\");\n\nmodule.exports.fuzz = function (data) {\n    d3.csvParse(data.toString())\n};\n"
  },
  {
    "path": "projects/d3/project.yaml",
    "content": "homepage: https://d3js.org/\nlanguage: javascript\nmain_repo: https://github.com/d3/d3.git\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n- yakdan@code-intelligence.com\n- norbert.schneider@code-intelligence.com\n- peter.samarin@code-intelligence.com\n"
  },
  {
    "path": "projects/dapr/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/dapr/dapr\nRUN git clone --depth 1 https://github.com/dapr/kit\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nWORKDIR $SRC/dapr\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/dapr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport CXXFLAGS=\"${CXXFLAGS} -lresolv\"\n$SRC/cncf-fuzzing/projects/dapr/build.sh\n"
  },
  {
    "path": "projects/dapr/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://dapr.io/\"\nlanguage: go\nprimary_contact: \"schneideryaron@gmail.com\"\nmain_repo: \"https://github.com/dapr\"\nauto_ccs:\n  - \"artur04@gmail.com\"\nvendor_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/dart/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y g++-multilib git python3 curl\n\nRUN git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git\nENV PATH=\"${SRC}/depot_tools:${PATH}\"\nRUN mkdir dart-sdk && cd dart-sdk && fetch dart\nCOPY build.sh $SRC\nCOPY patch.diff $SRC\nWORKDIR $SRC/dart-sdk/sdk\n# This is to fix Fuzz Introspector build by using LLVM old pass manager\n# re https://github.com/ossf/fuzz-introspector/issues/305\nENV OLD_LLVMPASS=1\n"
  },
  {
    "path": "projects/dart/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\n# Apply patch to fix libfuzzer compatibility with MSan stubs\ngit apply ../../patch.diff\n./tools/build.py -j$(nproc) -m debug -a x64 --sanitizer=asan dart_libfuzzer\ncp out/DebugASANX64/*fuzzer $OUT/\n"
  },
  {
    "path": "projects/dart/patch.diff",
    "content": "diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc\n--- a/runtime/vm/runtime_entry.cc\n+++ b/runtime/vm/runtime_entry.cc\n@@ -5280,10 +5280,12 @@ extern \"C\" void dart_msan_write16(void* addr) {\n   __msan_unpoison(addr, 16);\n }\n #else\n+// These stubs are needed because libFuzzer may call these functions.\n+// They should be no-ops instead of UNREACHABLE() to avoid crashes.\n extern \"C\" void __msan_unpoison(const volatile void*, size_t) {\n-  UNREACHABLE();\n+  // No-op when MSan is not enabled.\n }\n extern \"C\" void __msan_unpoison_param(size_t) {\n-  UNREACHABLE();\n+  // No-op when MSan is not enabled.\n }\n #endif\n"
  },
  {
    "path": "projects/dart/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://dart.dev\"\nlanguage: c++\nprimary_contact: \"scheglov@google.com\"\nauto_ccs :\n- \"p.antoine@catenacyber.fr\"\n\nsanitizers:\n- address\nfuzzing_engines:\n- libfuzzer\nmain_repo: 'https://github.com/dart-lang/sdk.git'\n"
  },
  {
    "path": "projects/dask/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y pkg-config\nRUN git clone https://github.com/dask/dask\nCOPY build.sh fuzz_fuse.py $SRC/\nWORKDIR $SRC/dask\n\n"
  },
  {
    "path": "projects/dask/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/dask/fuzz_fuse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nimport dask\nfrom dask.optimization import (\n    fuse,\n    fuse_linear,\n)\nfrom dask.utils_test import dec, inc, add\n\ndef get_fuse_dict(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuse_dict = dict()\n  number_of_entries = fdp.ConsumeIntInRange(1, 50)\n  operations = [dec, inc, add]\n\n  previous_keys = list()\n\n  key=\"a\"\n  fuse_dict[key] = 1\n  previous_keys.append(key)\n\n  for i in range(number_of_entries):\n    newk=key+str(i)\n    val_op = operations[fdp.ConsumeIntInRange(0, 2)]\n    val_id = previous_keys[fdp.ConsumeIntInRange(0, len(previous_keys)-1)]\n\n    fuse_dict[newk] = (val_op, val_id)\n    previous_keys.append(newk)\n  return fuse_dict\n  \n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  if len(data) < 10:\n    return\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzzed_dict = get_fuse_dict(data)\n  if len(fuzzed_dict) == 0:\n    return\n\n  if fdp.ConsumeBool():\n    fuse(\n      fuzzed_dict,\n      rename_keys=fdp.ConsumeBool()\n    )\n  else:\n    fuse_linear(\n      fuzzed_dict,\n      rename_keys=fdp.ConsumeBool()\n    )\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/dask/fuzz_serialize.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nimport json\nfrom dask.config import (\n    deserialize,\n    serialize\n)\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    fuzzed_dict = json.loads(fdp.ConsumeString(sys.maxsize))\n  except json.JSONDecodeError:\n    return\n\n  if type(fuzzed_dict) is not dict:\n    return\n  serialized = serialize(fuzzed_dict)\n  config = deserialize(serialized)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/dask/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/dask/dask\nlanguage: python\nmain_repo: https://github.com/dask/dask\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/data-encoding/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool curl cmake python\n\nRUN git clone https://github.com/ia0/data-encoding\nWORKDIR $SRC/data-encoding\n\n# The default toolchain used by OSS-Fuzz is too old for our fuzzing crate.\nENV RUSTUP_TOOLCHAIN nightly-2025-07-16\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/data-encoding/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd lib\ncargo fuzz build\n\nfind $SRC/data-encoding/target/x86_64-unknown-linux-gnu/release -maxdepth 1 \\\n    -type f -perm -u=x -exec cp {} $OUT \\;\n"
  },
  {
    "path": "projects/data-encoding/project.yaml",
    "content": "homepage: \"https://github.com/ia0/data-encoding\"\nmain_repo: \"https://github.com/ia0/data-encoding.git\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nprimary_contact: \"github@ia0.eu\"\nauto_ccs:\n  - \"cretin@google.com\"\n  - \"fuzzing@fuchsia.dev\"\nvendor_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/date/project.yaml",
    "content": "homepage: \"https://howardhinnant.github.io/date/date.html\"\nlanguage: c++\nprimary_contact: \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/HowardHinnant/date\"\n"
  },
  {
    "path": "projects/dateparser/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone --depth 1 https://github.com/scrapinghub/dateparser.git dateparser \\\n        && cp dateparser/fuzzing/build.sh $SRC/ \\\n        && mv dateparser/fuzzing/corpus $SRC/\nWORKDIR $SRC/dateparser\n\n"
  },
  {
    "path": "projects/dateparser/project.yaml",
    "content": "homepage: \"https://dateparser.readthedocs.io/en/latest/\"\nlanguage: python\nprimary_contact: \"opensource@zyte.com\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\nmain_repo: \"https://github.com/scrapinghub/dateparser.git\"\n"
  },
  {
    "path": "projects/dav1d/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y curl python3-pip python3-setuptools python3-wheel nasm && \\\n    pip3 install meson ninja\nRUN curl --silent -O https://storage.googleapis.com/aom-test-data/fuzzer/dec_fuzzer_seed_corpus.zip\nRUN curl --silent -O https://download.videolan.org/contrib/dav1d/dav1d_fuzzer_seed_corpus.zip\nRUN git clone --depth 1 https://code.videolan.org/videolan/dav1d.git dav1d\nRUN cd dav1d && git clone https://code.videolan.org/videolan/dav1d-test-data.git tests/dav1d-test-data\nWORKDIR dav1d\nCOPY build.sh run_tests.sh $SRC/\nCOPY linux32.meson $SRC/\n"
  },
  {
    "path": "projects/dav1d/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# setup\nbuild=${WORK}/build\n\n# cleanup\nrm -rf ${build}\nmkdir -p ${build}\n\n# prepare cross file for i386 compiliation\nif [ \"$ARCHITECTURE\" = \"i386\" ]; then\n\tMESON_CFLAGS=\"'$(echo $CFLAGS | sed -e 's/ /;, ;/g' | tr \\; \\')'\"\n\tMESON_CXXFLAGS=\"'$(echo $CXXFLAGS | sed -e 's/ /;, ;/g' | tr \\; \\')'\"\n\tsed -e \"s/CC$/'$CC'/; s/CXX$/'$CXX'/; s/CFLAGS$/[$MESON_CFLAGS]/; s/CXXFLAGS$/[$MESON_CXXFLAGS]/\" < ${SRC}/linux32.meson > ${WORK}/linux32.meson\n\tCROSS=\"--cross-file ${WORK}/linux32.meson\"\nfi\n\n# build library\nmeson -Denable_tools=false -Dfuzzing_engine=oss-fuzz \\\n      -Db_lundef=false -Ddefault_library=static -Dbuildtype=debugoptimized \\\n      -Dlogging=false -Dfuzzer_ldflags=$LIB_FUZZING_ENGINE \\\n      -Dtestdata_tests=true \\\n      ${CROSS:-} \\\n      ${build}\nninja -j $(nproc) -C ${build}\n\n# prepare seed corpus\nrm -rf ${WORK}/tmp\nmkdir -p ${WORK}/tmp/testdata\nunzip -q $SRC/dav1d_fuzzer_seed_corpus.zip -d ${WORK}/tmp/testdata\ncp $SRC/dec_fuzzer_seed_corpus.zip ${WORK}/tmp/seed_corpus.zip\n(cd ${WORK}/tmp && zip -q -m -r -0 ${WORK}/tmp/seed_corpus.zip testdata)\n\n# copy fuzzers and link testdata\nfor fuzzer in $(find ${build}/tests/libfuzzer -maxdepth 1 -type f -executable -name 'dav1d_fuzzer*'); do\n\tcp \"${fuzzer}\" $OUT/\n\tcp ${WORK}/tmp/seed_corpus.zip $OUT/$(basename \"$fuzzer\")_seed_corpus.zip\ndone\n"
  },
  {
    "path": "projects/dav1d/linux32.meson",
    "content": "[binaries]\nc = CC\ncpp = CXX\nar = 'ar'\nstrip = 'strip'\n\n[properties]\nc_args = CFLAGS\nc_link_args = CFLAGS\ncpp_args = CXXFLAGS\ncpp_link_args = CXXFLAGS\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'x86'\ncpu = 'i686'\nendian = 'little'\n\n"
  },
  {
    "path": "projects/dav1d/project.yaml",
    "content": "homepage: \"https://code.videolan.org/videolan/dav1d\"\nlanguage: c++\nprimary_contact: \"janne.grunau@gmail.com\"\nauto_ccs:\n  - \"rsbultje@gmail.com\"\n  - \"kempfjb@gmail.com\"\n  - \"b@rr-dav.id.au\"\n  - \"dav1d-fuzz@videolan.org\"\n  - \"psilokos@twoorioles.com\"\n  - \"gramner@twoorioles.com\"\nvendor_ccs:\n  - \"media-alerts@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\ncoverage_extra_args: -ignore-filename-regex=.*dump.h\narchitectures:\n  - i386\n  - x86_64\nmain_repo: 'https://code.videolan.org/videolan/dav1d.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/dav1d/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd /work/build\nmeson test\n"
  },
  {
    "path": "projects/dbus-broker/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/bus1/dbus-broker\n\n# RUSTUP_TOOLCHAIN is set explicitly to match the latest images\n# to get around https://github.com/google/oss-fuzz/issues/14220.\n# It should be removed once that issue is resolved.\nENV RUSTUP_TOOLCHAIN nightly-2025-09-05\n\nRUN cargo install bindgen-cli\nWORKDIR dbus-broker\nCOPY *.c build.sh $SRC/\n"
  },
  {
    "path": "projects/dbus-broker/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# The MESON_* variables are passed to meson to build dbus-broker itself and the original\n# variables are used to build the fuzz target without meson to make the script compatible\n# with fuzz-introspector. Once the fuzz target is built with meson as well the MESON_*\n# variables can be safely removed and CFLAGS/CXXFLAGS/LDFLAGS can be tweaked directly\n# instead: https://github.com/google/oss-fuzz/pull/7583#issuecomment-1104011067\nMESON_CFLAGS=${CFLAGS:-}\nMESON_CXXFLAGS=${CXXFLAGS:-}\nMESON_LDFLAGS=${LDFLAGS:-}\n\nif [[ \"$SANITIZER\" == introspector ]]; then\n    MESON_CFLAGS=\"${MESON_CFLAGS//-fuse-ld=gold/ }\"\n    MESON_CXXFLAGS=\"${MESON_CXXFLAGS//-fuse-ld=gold/ }\"\n    MESON_LDFLAGS=\"${MESON_LDFLAGS//-fuse-ld=gold/ }\"\n    MESON_LDFLAGS+=\" -flto\"\n    export CC_LD=gold\n    export CXX_LD=gold\nfi\n\napt-get update -y\napt-get install -y libclang-dev\n\nif [[ \"$ARCHITECTURE\" == i386 ]]; then\n    apt-get install -y pkg-config:i386\n\n    RUST_TARGET=i686-unknown-linux-gnu\n    rustup target add \"$RUST_TARGET\"\n    export RUSTC=\"rustc --target=$RUST_TARGET\"\n    export BINDGEN_EXTRA_CLANG_ARGS=\"--target=$RUST_TARGET\"\nelse\n    apt-get install -y pkg-config\nfi\n\nif [[ \"$SANITIZER\" == undefined ]]; then\n    additional_ubsan_checks=alignment\n    UBSAN_FLAGS=\"-fsanitize=$additional_ubsan_checks -fno-sanitize-recover=$additional_ubsan_checks\"\n    CFLAGS+=\" $UBSAN_FLAGS\"\n    CXXFLAGS+=\" $UBSAN_FLAGS\"\n    MESON_CFLAGS+=\" $UBSAN_FLAGS\"\n    MESON_CXXFLAGS+=\" $UBSAN_FLAGS\"\nfi\n\npip3 install meson ninja\n\nif ! CFLAGS=\"$MESON_CFLAGS\" CXXFLAGS=\"$MESON_CXXFLAGS\" LDFLAGS=\"$MESON_LDFLAGS\" meson -Db_lundef=false -Dlauncher=false build; then\n    cat build/meson-logs/meson-log.txt\n    exit 1\nfi\n\nninja -C ./build -v\n$CC $CFLAGS -c -o fuzz-message.o -Isrc -I subprojects/libcstdaux-*/src -std=c11 -D_GNU_SOURCE \"$SRC/fuzz-message.c\"\n$CXX $CXXFLAGS -o \"$OUT/fuzz-message\" \\\n    fuzz-message.o \\\n    build/src/libbus-static.a \\\n    build/subprojects/libcdvar-*/src/libcdvar-*.a \\\n    build/subprojects/libcutf8-*/src/libcutf8-*.a \\\n    $LIB_FUZZING_ENGINE\n"
  },
  {
    "path": "projects/dbus-broker/fuzz-message.c",
    "content": "/*\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n*/\n#include <stddef.h>\n#include <stdint.h>\n\n#include \"dbus/message.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n        _c_cleanup_(message_unrefp) Message *message = NULL;\n        MessageHeader *header = (void *)data;\n        int r;\n\n        if (size < sizeof(MessageHeader))\n                return 0;\n\n        r = message_new_incoming(&message, *header);\n        if (r != 0)\n                return 0;\n\n        if (message->n_data > size)\n                return 0;\n\n        memcpy(message->data + sizeof(*header), data + sizeof(*header), message->n_data - sizeof(*header));\n\n        r = message_parse_metadata(message);\n        if (r)\n                return 0;\n\n        message_stitch_sender(message, 1);\n\n        return 0;\n}\n"
  },
  {
    "path": "projects/dbus-broker/project.yaml",
    "content": "homepage: \"https://github.com/bus1/dbus-broker\"\nlanguage: c\nprimary_contact: \"david.rheinsberg@gmail.com\"\nbuilds_per_day: 4\nsanitizers:\n  - address\n  - undefined\n  - memory\nauto_ccs:\n  - evverx@gmail.com\n  - fsumsal@redhat.com\nmain_repo: \"https://github.com/bus1/dbus-broker\"\narchitectures:\n  - x86_64\n  - i386\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/dcmtk/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y --no-install-recommends     cmake ninja-build make pkg-config zlib1g-dev python3 &&     rm -rf /var/lib/apt/lists/*\n\nRUN git clone --depth 1 https://github.com/DCMTK/dcmtk $SRC/dcmtk\nRUN git clone --depth 1 https://github.com/DCMTK/dcmtk-fuzzers $SRC/dcmtk-fuzzers\n\nCOPY build.sh $SRC/\nCOPY dcmtk_dicom_fuzzer.dict make_seed_corpus.py $SRC/dcmtk-fuzzers/\nCOPY dcmtk_dicom_fuzzer.cc dcmtk_meta_fuzzer.cc $SRC/dcmtk-fuzzers/\n\nWORKDIR $SRC/dcmtk-fuzzers\n"
  },
  {
    "path": "projects/dcmtk/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFUZZERS=(\n  dcmtk_dicom_fuzzer\n  dcmtk_meta_fuzzer\n)\n\n# Build DCMTK (static) with iconv enabled so liboficonv is present.\ncd \"$SRC\"\ncmake -S dcmtk -B dcmtk-build \\\n  -DBUILD_SHARED_LIBS=OFF \\\n  -DDCMTK_WITH_OPENSSL=OFF \\\n  -DDCMTK_WITH_PNG=OFF \\\n  -DDCMTK_WITH_TIFF=OFF \\\n  -DDCMTK_WITH_XML=OFF \\\n  -DDCMTK_WITH_ICONV=ON \\\n  -DDCMTK_WITH_ZLIB=ON \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DCMAKE_INSTALL_PREFIX=\"$WORK/dcmtk-install\"\ncmake --build dcmtk-build -j\"$(nproc)\"\ncmake --install dcmtk-build\n\n# Ship the DICOM dictionary (for cleaner logs at runtime).\nDICT_SRC=$(ls \"$WORK\"/dcmtk-install/share/dcmtk-*/dicom.dic 2>/dev/null || true)\nif [ -n \"$DICT_SRC\" ]; then\n  cp \"$DICT_SRC\" \"$OUT/dicom.dic\" || true\nfi\n\ncd \"$SRC/dcmtk-fuzzers\"\nDCMTK_INC=\"$WORK/dcmtk-install/include\"\nDCMTK_LIBDIR=\"$WORK/dcmtk-install/lib\"\n\n# Derive robust link set from pkg-config and filter to installed libs.\nexport PKG_CONFIG_PATH=\"$DCMTK_LIBDIR/pkgconfig:${PKG_CONFIG_PATH:-}\"\nRAW_LIBS=\"$(pkg-config --static --libs dcmtk 2>/dev/null || true)\"\nFILTERED_LIBS=\"\"\nfor tok in $RAW_LIBS; do\n  # Keep every token: -L paths, -l libs (both DCMTK and system ones like -lz)\n  FILTERED_LIBS+=\" $tok\"\ndone\n[ -z \"$FILTERED_LIBS\" ] && FILTERED_LIBS=\"-ldcmdata -loflog -lofstd -loficonv -lz\"\nDCMTK_LIBS=\"-Wl,--start-group ${FILTERED_LIBS} -Wl,--end-group -lpthread -ldl\"\n\nbuild_one() {\n  local src=\"$1\"\n  local out=\"$2\"\n  \"$CXX\" $CXXFLAGS -std=c++17 -I\"$DCMTK_INC\" \\\n    \"$src\" -o \"$OUT/$out\" \\\n    $LIB_FUZZING_ENGINE -L\"$DCMTK_LIBDIR\" ${DCMTK_LIBS}\n}\n\nfor fz in \"${FUZZERS[@]}\"; do\n  echo \"Building $fz...\"\n  build_one \"${fz}.cc\" \"$fz\"\ndone\n\n# .options: use *relative* dictionary path so check_build works after files are copied.\ncat > \"$OUT/dcmtk_dicom_fuzzer.options\" << 'EOF'\n[libfuzzer]\nmax_len = 131072\ntimeout = 25\nrss_limit_mb = 2560\ndict = dcmtk_dicom_fuzzer.dict\nEOF\n\ncat > \"$OUT/dcmtk_meta_fuzzer.options\" << 'EOF'\n[libfuzzer]\nmax_len = 65536\ntimeout = 25\nrss_limit_mb = 2560\ndict = dcmtk_dicom_fuzzer.dict\nEOF\n\n# Seed corpus next to binaries\npython3 \"$SRC/dcmtk-fuzzers/make_seed_corpus.py\"\n\n# Copy dictionary next to binaries under both names (defensive)\ncp \"$SRC/dcmtk-fuzzers/dcmtk_dicom_fuzzer.dict\" \"$OUT/dcmtk_dicom_fuzzer.dict\" || true\ncp \"$SRC/dcmtk-fuzzers/dcmtk_dicom_fuzzer.dict\" \"$OUT/dcmtk_meta_fuzzer.dict\" || true\n"
  },
  {
    "path": "projects/dcmtk/dcmtk_dicom_fuzzer.cc",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n#include <cstdint>\n#include <cstddef>\n#include <cstdlib>\n#include <new>\n#include <string>\n\n#include \"dcmtk/dcmdata/dctk.h\"\n#include \"dcmtk/dcmdata/dcistrmb.h\"\n#include \"dcmtk/dcmdata/dcdeftag.h\"\n#include \"dcmtk/dcmdata/dcxfer.h\"\n\nstatic constexpr std::size_t kNewNothrowCap = 8 * 1024 * 1024;\n\nvoid* operator new(std::size_t n, const std::nothrow_t&) noexcept {\n  if (n > kNewNothrowCap) return nullptr;\n  try { return ::operator new(n); } catch (...) { return nullptr; }\n}\nvoid* operator new[](std::size_t n, const std::nothrow_t&) noexcept {\n  if (n > kNewNothrowCap) return nullptr;\n  try { return ::operator new[](n); } catch (...) { return nullptr; }\n}\n\nstatic void walkDataset(DcmItem* item) {\n  if (!item) return;\n  DcmStack stack;\n  if (item->nextObject(stack, OFTrue).good()) {\n    do {\n      DcmObject* obj = stack.top();\n      if (!obj) break;\n      (void)obj->ident();\n      (void)obj->getTag();\n    } while (item->nextObject(stack, OFFalse).good());\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static bool dict_set = (setenv(\"DCMDICTPATH\", \"/out/dicom.dic\", 0), true);\n  (void)dict_set;\n\n  DcmInputBufferStream in;\n  in.setBuffer((void*)data, size);\n  in.setEos();\n\n  DcmFileFormat file;\n  const Uint32 kMaxReadLen = 256 * 1024;\n\n  if (file.read(in, EXS_Unknown, EGL_noChange, kMaxReadLen).good()) {\n    if (auto* ds = file.getDataset()) {\n      (void)ds->chooseRepresentation(EXS_LittleEndianExplicit, nullptr);\n      (void)ds->calcElementLength(EXS_LittleEndianExplicit, EET_ExplicitLength);\n\n      OFString s;\n      (void)ds->findAndGetOFString(DCM_PatientName, s);\n      (void)ds->findAndGetOFString(DCM_StudyInstanceUID, s);\n      (void)ds->findAndGetOFString(DCM_SOPClassUID, s);\n\n      walkDataset(ds);\n    }\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/dcmtk/dcmtk_dicom_fuzzer.dict",
    "content": "\"DICM\"\n\"AE\"\n\"AS\"\n\"AT\"\n\"CS\"\n\"DA\"\n\"DS\"\n\"DT\"\n\"FL\"\n\"FD\"\n\"IS\"\n\"LO\"\n\"LT\"\n\"OB\"\n\"OD\"\n\"OF\"\n\"OL\"\n\"OW\"\n\"PN\"\n\"SH\"\n\"SL\"\n\"SQ\"\n\"SS\"\n\"ST\"\n\"TM\"\n\"UC\"\n\"UI\"\n\"UL\"\n\"UN\"\n\"UR\"\n\"US\"\n\"UT\"\n\"ISO_IR 100\"\n\"ISO_IR 192\"\n\"ISO 2022 IR 87\"\n\"ISO 2022 IR 149\"\n\"1.2.840.10008.1.2\"\n\"1.2.840.10008.1.2.1\"\n\"1.2.840.10008.1.2.2\"\n\"1.2.840.10008.5.1.4.1.1.2\"\n\"1.2.840.10008.5.1.4.1.1.4\"\n\"1.2.840.10008.5.1.4.1.1.128\"\n\"\\xFE\\xFF\\x00\\xE0\"\n\"\\xFE\\xFF\\x0D\\xE0\"\n\"\\xFE\\xFF\\xDD\\xE0\"\n"
  },
  {
    "path": "projects/dcmtk/dcmtk_meta_fuzzer.cc",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\n#include <cstdint>\n#include <cstddef>\n#include <new>\n\n#include \"dcmtk/dcmdata/dcmetinf.h\"\n#include \"dcmtk/dcmdata/dcistrmb.h\"\n#include \"dcmtk/dcmdata/dcdeftag.h\"\n#include \"dcmtk/dcmdata/dcxfer.h\"\n\nstatic constexpr std::size_t kNewCap = 2 * 1024 * 1024;\nvoid* operator new(std::size_t n, const std::nothrow_t&) noexcept {\n  if (n > kNewCap) return nullptr;\n  try { return ::operator new(n); } catch (...) { return nullptr; }\n}\nvoid* operator new[](std::size_t n, const std::nothrow_t&) noexcept {\n  if (n > kNewCap) return nullptr;\n  try { return ::operator new[](n); } catch (...) { return nullptr; }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  DcmInputBufferStream in;\n  in.setBuffer((void*)data, size);\n  in.setEos();\n\n  DcmMetaInfo mi;\n  const Uint32 kMaxReadLen = 128 * 1024;\n  if (mi.read(in, EXS_LittleEndianExplicit, EGL_noChange, kMaxReadLen).good()) {\n    OFString s;\n    (void)mi.findAndGetOFString(DCM_TransferSyntaxUID, s);\n    (void)mi.findAndGetOFString(DCM_SourceApplicationEntityTitle, s);\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/dcmtk/make_seed_corpus.py",
    "content": "##################################################################################\n## Copyright 2026 Google LLC\n##\n## Licensed under the Apache License, Version 2.0 (the \"License\");\n## you may not use this file except in compliance with the License.\n## You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n##\n##################################################################################\n#!/usr/bin/env python3\nimport struct, os, zipfile, io\n\ndef u16(x, be=False): return struct.pack('>H' if be else '<H', x)\ndef u32(x, be=False): return struct.pack('>I' if be else '<I', x)\nLONG_VR = {b'OB', b'OW', b'OF', b'SQ', b'UC', b'UR', b'UT', b'UN', b'OD', b'OL', b'OV'}\n\ndef pad(vr: bytes, s: str, text_enc='latin-1') -> bytes:\n    if vr == b'UI':\n        b = s.encode('ascii')\n        if len(b) % 2: b += b'\\x00'\n    else:\n        b = s.encode(text_enc, 'replace')\n        if len(b) % 2: b += b' '\n    return b\n\ndef el_explicit(g,e,vr,val,be=False):\n    if isinstance(vr, str): vr = vr.encode('ascii')\n    out = io.BytesIO()\n    out.write(u16(g,be)); out.write(u16(e,be))\n    out.write(vr)\n    if vr in LONG_VR:\n        out.write(b'\\x00\\x00'); out.write(u32(len(val), be)); out.write(val)\n    else:\n        out.write(u16(len(val), be)); out.write(val)\n    return out.getvalue()\n\ndef el_implicit(g,e,val,be=False):\n    out = io.BytesIO()\n    out.write(u16(g,be)); out.write(u16(e,be))\n    out.write(u32(len(val), be)); out.write(val)\n    return out.getvalue()\n\ndef item_defined(payload, be=False):\n    return u16(0xFFFE,be) + u16(0xE000,be) + u32(len(payload),be) + payload\n\ndef item_undef(payload, be=False):\n    return (u16(0xFFFE,be) + u16(0xE000,be) + u32(0xFFFFFFFF,be) + payload +\n            u16(0xFFFE,be) + u16(0xE00D,be) + u32(0,be))\n\ndef seq_defined_explicit(g,e,items, be=False):\n    body = b''.join(item_defined(p, be) for p in items)\n    return el_explicit(g,e,b'SQ', body, be)\n\ndef seq_undef_explicit(g,e,items, be=False):\n    body = b''.join(item_undef(p, be) for p in items) + (u16(0xFFFE,be)+u16(0xE0DD,be)+u32(0,be))\n    hdr = u16(g,be)+u16(e,be)+b'SQ'+b'\\x00\\x00'+u32(0xFFFFFFFF,be)\n    return hdr + body\n\ndef seq_defined_implicit(g,e,items, be=False):\n    body = b''.join(item_defined(p, be) for p in items)\n    return el_implicit(g,e, body, be)\n\ndef seq_undef_implicit(g,e,items, be=False):\n    body = b''.join(item_undef(p, be) for p in items) + (u16(0xFFFE,be)+u16(0xE0DD,be)+u32(0,be))\n    return u16(g,be)+u16(e,be)+u32(0xFFFFFFFF,be)+body\n\ndef meta_group(ts_uid: str, with_gl=True):\n    parts = []\n    parts.append(el_explicit(0x0002,0x0001,b'OB', b'\\x00\\x01', be=False))\n    parts.append(el_explicit(0x0002,0x0002,b'UI', pad(b'UI','1.2.840.10008.5.1.4.1.1.2'), be=False))\n    parts.append(el_explicit(0x0002,0x0003,b'UI', pad(b'UI','1.2.826.0.1.3680043.8.498.1000001'), be=False))\n    parts.append(el_explicit(0x0002,0x0010,b'UI', pad(b'UI', ts_uid), be=False))\n    parts.append(el_explicit(0x0002,0x0012,b'UI', pad(b'UI','1.2.826.0.1.3680043.8.498.1'), be=False))\n    parts.append(el_explicit(0x0002,0x0016,b'AE', pad(b'AE','FUZZ'), be=False))\n    body = b''.join(parts)\n    if not with_gl:\n        return body\n    gl = el_explicit(0x0002,0x0000,b'UL', struct.pack('<I', len(body)), be=False)\n    return gl + body\n\ndef part10(path, ts_uid: str, dataset: bytes, with_gl=True):\n    with open(path, 'wb') as f:\n        f.write(b'\\x00'*128 + b'DICM')\n        f.write(meta_group(ts_uid, with_gl))\n        f.write(dataset)\n\ndef seed_explicit_le_basic(path):\n    be=False\n    ds = b''.join([\n        el_explicit(0x0008,0x0020,b'DA', pad(b'DA','20250101'), be),\n        el_explicit(0x0008,0x0031,b'TM', pad(b'TM','120101'), be),\n        el_explicit(0x0010,0x0010,b'PN', pad(b'PN','FUZZ^TEST'), be),\n        seq_defined_explicit(0x0010,0x1002, [\n            el_explicit(0x0010,0x0020,b'LO', pad(b'LO','12345'), be)\n        ], be),\n    ])\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_implicit_le_basic(path):\n    be=False\n    item = el_implicit(0x0010,0x0020, pad(b'LO','ABC123'))\n    ds = b''.join([\n        el_implicit(0x0010,0x0010, pad(b'PN','IMPL^LE')),\n        seq_undef_implicit(0x0010,0x1002, [ item ], be),\n    ])\n    part10(path, '1.2.840.10008.1.2', ds, with_gl=True)\n\ndef seed_explicit_be(path):\n    be=True\n    ds = b''.join([\n        el_explicit(0x0010,0x0010,b'PN', pad(b'PN','BIG^END'), be),\n        el_explicit(0x0008,0x0020,b'DA', pad(b'DA','19991231'), be),\n    ])\n    part10(path, '1.2.840.10008.1.2.2', ds, with_gl=True)\n\ndef seed_sq_undef_explicit(path):\n    be=False\n    item_payload = b''.join([\n        el_explicit(0x0008,0x0100,b'SH', pad(b'SH','CODE'), be),\n        el_explicit(0x0008,0x0102,b'SH', pad(b'SH','SYS'), be),\n    ])\n    ds = seq_undef_explicit(0x0040,0x0275, [item_payload], be)\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_pixel_ob_small(path):\n    be=False\n    ds = b''.join([\n        el_explicit(0x0028,0x0010,b'US', struct.pack('<H',1), be),\n        el_explicit(0x0028,0x0011,b'US', struct.pack('<H',1), be),\n        el_explicit(0x7FE0,0x0010,b'OB', b'\\x00\\x01\\x02\\x03', be),\n    ])\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_private_tags(path):\n    be=False\n    ds = b''.join([\n        el_explicit(0x0009,0x0010,b'LO', pad(b'LO','ACME 1.0'), be),\n        el_explicit(0x0009,0x1001,b'UN', b'\\x01\\x02\\x03\\x04', be),\n    ])\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_charset_latin1(path):\n    be=False\n    name = 'MÖLLER^JÜRGEN'\n    ds = b''.join([\n        el_explicit(0x0008,0x0005,b'CS', pad(b'CS','ISO_IR 100'), be),\n        el_explicit(0x0010,0x0010,b'PN', pad(b'PN',name,'latin-1'), be),\n    ])\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_zero_len_and_odd_pad(path):\n    be=False\n    ds = b''.join([\n        el_explicit(0x0008,0x1030,b'LO', pad(b'LO','A'), be),\n        el_explicit(0x0008,0x0018,b'UI', pad(b'UI',''), be),\n    ])\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_un_bytes(path):\n    be=False\n    ds = b''.join([\n        el_explicit(0x0008,0x0008,b'CS', pad(b'CS','DERIVED\\\\SECONDARY'), be),\n        el_explicit(0x0040,0xA160,b'UT', pad(b'UT','NOTE'), be),\n        el_explicit(0x0008,0x9123,b'UN', b'\\xDE\\xAD\\xBE\\xEF', be),\n    ])\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_ul_us_extremes(path):\n    be=False\n    ds = b''.join([\n        el_explicit(0x0020,0x0012,b'IS', pad(b'IS','1'), be),\n        el_explicit(0x0028,0x0002,b'US', struct.pack('<H', 0xFFFF), be),\n        el_explicit(0x0008,0x1312,b'UL', struct.pack('<I', 0xFFFFFFFF), be),\n    ])\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=True)\n\ndef seed_meta_without_group_length(path):\n    be=False\n    ds = el_explicit(0x0010,0x0010,b'PN', pad(b'PN','NOGL^META'), be)\n    part10(path, '1.2.840.10008.1.2.1', ds, with_gl=False)\n\nout_dir = '/tmp/dcmtk_seeds'\nos.makedirs(out_dir, exist_ok=True)\nmakers = [\n  ('seed-exp-le.dcm', seed_explicit_le_basic),\n  ('seed-impl-le.dcm', seed_implicit_le_basic),\n  ('seed-exp-be.dcm', seed_explicit_be),\n  ('seed-sq-undef.dcm', seed_sq_undef_explicit),\n  ('seed-pixel-ob.dcm', seed_pixel_ob_small),\n  ('seed-private.dcm', seed_private_tags),\n  ('seed-charset-latin1.dcm', seed_charset_latin1),\n  ('seed-zero-odd.dcm', seed_zero_len_and_odd_pad),\n  ('seed-un-bytes.dcm', seed_un_bytes),\n  ('seed-ul-us-max.dcm', seed_ul_us_extremes),\n  ('seed-meta-nogl.dcm', seed_meta_without_group_length),\n]\nfor name, fn in makers[:10]:\n  fn(os.path.join(out_dir, name))\n\nwith zipfile.ZipFile('/out/dcmtk_dicom_fuzzer_seed_corpus.zip', 'w', zipfile.ZIP_DEFLATED) as z:\n  for name, _ in makers[:10]:\n    z.write(os.path.join(out_dir, name), arcname=name)\nprint(\"Seed corpus written to /out/dcmtk_dicom_fuzzer_seed_corpus.zip\")\n"
  },
  {
    "path": "projects/dcmtk/project.yaml",
    "content": "homepage: \"https://dicom.offis.de/dcmtk.php.en\"\nmain_repo: \"https://github.com/DCMTK/dcmtk.git\"\nlanguage: c++\nprimary_contact: \"bugs@dcmtk.org\"\nauto_ccs:\n  - \"arash.vre@gmail.com\"\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - x86_64\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/decorator/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/micheles/decorator\nWORKDIR decorator\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/decorator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/decorator/fuzz_decorator.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport random\nwith atheris.instrument_imports():\n     from decorator import *\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    @decorator\n    def dummy_decorator(func, dummy=1, *args, **kw):\n        result = func(*args, **kw)\n\n    @decoratorx\n    def dummy_decoratorx(func, *args, **kw):\n        result = func(*args, **kw)\n\n    def dummy_decorate(func, dummy=1, *args, **kw):\n        result = func(*args, **kw)\n\n    @dummy_decorator(dummy=fdp.ConsumeInt(8))\n    def func1(dummy):\n        pass\n\n    @dummy_decoratorx\n    def func2(dummy):\n        pass\n\n    def func3(dummy):\n        pass\n\n    choice = fdp.ConsumeIntInRange(1,3)\n\t\n    if choice == 1:\n        func1(fdp.ConsumeBytes(fdp.ConsumeIntInRange(1,1000)))\n    if choice == 2:\n        func2(fdp.ConsumeBytes(fdp.ConsumeIntInRange(1,1000)))\n    if choice == 3:\n        decorate(func3,dummy_decorate,fdp.ConsumeInt(fdp.ConsumeIntInRange(1,1000)))\n        func3(fdp.ConsumeBytes(10))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/decorator/fuzz_funcmarker.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport random\nwith atheris.instrument_imports():\n     from decorator import *\n\ndef base_func(*args, **kw):\n    pass\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        FunctionMaker.create(\n            \"f%s(%s)\"%(fdp.ConsumeString(20),fdp.ConsumeString(20)),\n            \"base_func()\",\n            dict(f=base_func),\n            addsource=fdp.ConsumeBool()\n        )\n    except Exception as e:\n        if \"Error in generated code\" not in str(e):\n             raise e\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/decorator/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/micheles/decorator\nlanguage: python\nmain_repo: https://github.com/micheles/decorator\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/defusedxml/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/tiran/defusedxml defusedxml\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/defusedxml\n"
  },
  {
    "path": "projects/defusedxml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/defusedxml/fuzz_etree_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets the parse function\"\"\"\nimport io\nimport sys\nimport atheris\nimport xml\nimport defusedxml\nfrom defusedxml.ElementTree import parse\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  in_mem_file = io.StringIO(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  try:\n    parse(in_mem_file)\n  except xml.etree.ElementTree.ParseError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/defusedxml/fuzz_parse_string.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets parseString\"\"\"\nimport sys\nimport atheris\nimport xml\nfrom defusedxml.pulldom import parseString as pulldom_parseString\nfrom defusedxml.minidom import parseString as minidom_parseString\nfrom defusedxml.expatbuilder import parseString as expatbuilder_parseString\nimport defusedxml\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  pulldom_parseString(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  try:\n    minidom_parseString(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    expatbuilder_parseString(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except xml.parsers.expat.error:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/defusedxml/project.yaml",
    "content": "homepage: https://github.com/tiran/defusedxml\nmain_repo: https://github.com/tiran/defusedxml\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/demangle/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/ianlancetaylor/demangle\nWORKDIR $SRC/demangle\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/demangle/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\nprintf \"package demangle\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/ianlancetaylor/demangle FuzzTest FuzzTest\n"
  },
  {
    "path": "projects/demangle/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage demangle\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzTest(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data string) {\n\t\t_, _ = ToString(data)\n\t})\n}\n"
  },
  {
    "path": "projects/demangle/project.yaml",
    "content": "homepage: \"https://github.com/ianlancetaylor/demangle\"\nlanguage: go\nmain_repo: \"https://github.com/ianlancetaylor/demangle\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/deno/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y \\\n        cmake protobuf-compiler pkg-config python3 libclang-dev \\\n        libdbus-1-dev lld\n\nENV RUSTUP_TOOLCHAIN nightly-2025-12-15\n\nRUN rustup install $RUSTUP_TOOLCHAIN\nRUN rustup component add rust-src --toolchain $RUSTUP_TOOLCHAIN\n\nRUN git clone --depth 1 https://github.com/denoland/deno $SRC/deno\n\nWORKDIR $SRC/deno\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/deno/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/deno\n\nexport CARGO_INCREMENTAL=0\n\n# Strip sanitizer and coverage flags from C/C++ compiler flags.\n# The Rust compiler handles sanitizer instrumentation via RUSTFLAGS.\nexport CFLAGS=\"-O1 -fno-omit-frame-pointer -gline-tables-only\"\nexport CXXFLAGS=\"-O1 -fno-omit-frame-pointer -gline-tables-only -stdlib=libc++\"\n\n# Deno uses --export-dynamic-symbol-list which requires lld\nexport RUSTFLAGS=\"$RUSTFLAGS -Clink-arg=-fuse-ld=lld\"\n\ncargo build --release --target x86_64-unknown-linux-gnu -j$(($(nproc) / 8))\n\ncp target/x86_64-unknown-linux-gnu/release/deno $OUT/\n"
  },
  {
    "path": "projects/deno/project.yaml",
    "content": "homepage: \"https://github.com/denoland/deno\"\nlanguage: rust\nmain_repo: \"https://github.com/denoland/deno\"\nfuzzing_engines:\n  - none\nsanitizers:\n  - address\nindexer:\n  targets:\n    - deno\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/dgraph/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN wget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.3.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.24.3.linux-amd64.tar.gz\nRUN git clone --depth 1 https://github.com/dgraph-io/dgraph\nCOPY build.sh fuzz_parser_test.go $SRC/\nWORKDIR $SRC/dgraph\n"
  },
  {
    "path": "projects/dgraph/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/fuzz_parser_test.go $SRC/dgraph/dql/\nprintf \"package dql\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > dql/register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/dgraph-io/dgraph/v25/dql FuzzParserTest parser_fuzzer\n"
  },
  {
    "path": "projects/dgraph/fuzz_parser_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage dql\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzParserTest(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, in []byte) {\n\t\t_, _ = Parse(Request{Str: string(in)})\n\t})\n}\n"
  },
  {
    "path": "projects/dgraph/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://dgraph.io\"\nmain_repo: \"https://github.com/dgraph-io/dgraph\"\nprimary_contact: \"security@hypermode.com\"\nauto_ccs :\n  - \"harshil@hypermode.com\"\n  - \"ryan@hypermode.com\"\n  - \"aman@hypermode.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/digest/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/bmc/digest digest\nWORKDIR digest\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/digest/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\n"
  },
  {
    "path": "projects/digest/fuzz_digest.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nimport io\nimport digest\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    alg = fdp.ConsumeUnicodeNoSurrogates(15)\n    b1 = fdp.ConsumeBytes(sys.maxsize)\n    try:\n        s1 = digest.digest(io.BytesIO(b1), alg, len(b1))\n    except SystemExit:\n        pass\n    except TypeError as e:\n        if \"name must be a string\" in str(e):\n            # non-interesting bug. Let the fuzzer continue\n            pass\n        else:\n            raise e\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/digest/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/bmc/digest\nlanguage: python\nmain_repo: https://github.com/bmc/digest\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/dill/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d223a882810372830fd7968eb3e64533f3a2318c90be43ac753a46a15946faec\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/uqfoundation/dill dill\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/dill\n"
  },
  {
    "path": "projects/dill/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/dill/fuzz_dumps.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom dill import dumps, loads\n\n\ndef TestOneInput(data):\n  # Anything loadable should be dumpable\n  try:\n    dilled = loads(data)\n  except:\n    return\n  try:\n    dumps(dilled)\n  except RecursionError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/dill/project.yaml",
    "content": "homepage: https://github.com/uqfoundation/dill\nmain_repo: https://github.com/uqfoundation/dill\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/distlib/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/pypa/distlib distlib\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/distlib\n"
  },
  {
    "path": "projects/distlib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/distlib/fuzz_marker.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom distlib.markers import interpret\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    interpret(fdp.ConsumeUnicodeNoSurrogates(1024))\n  except SyntaxError:\n    return\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/distlib/fuzz_metadata.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom distlib import DistlibException\nfrom distlib.compat import StringIO\nfrom distlib.metadata import (LegacyMetadata, Metadata)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    metadata = LegacyMetadata()\n    metadata.read_file(StringIO(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))))\n  except ValueError:\n    # ValueErrors are raised varies places, e.g.\n    # https://github.com/pypa/distlib/blob/05375908c1b2d6b0e74bdeb574569d3609db9f56/distlib/version.py#L106\n    pass\n  except SyntaxError:\n    pass\n\n  try:\n    metadata = Metadata(fileobj=StringIO(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))))\n  except ValueError:\n    # ValueErrors are raised varies places, e.g.\n    # https://github.com/pypa/distlib/blob/05375908c1b2d6b0e74bdeb574569d3609db9f56/distlib/version.py#L106\n    pass\n  except SyntaxError:\n    pass\n  except DistlibException:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/distlib/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pypa/distlib\nlanguage: python\nmain_repo: https://github.com/pypa/distlib\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/distribution/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/distribution/distribution\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=november-backup\nRUN wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.23.4.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.23.4.linux-amd64.tar.gz\nCOPY build.sh $SRC/\nWORKDIR $SRC/distribution\n"
  },
  {
    "path": "projects/distribution/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/distribution/build.sh\n\n"
  },
  {
    "path": "projects/distribution/project.yaml",
    "content": "homepage: \"https://github.com/distribution/distribution\"\nmain_repo: \"https://github.com/distribution/distribution\"\nprimary_contact: \"cncf-distribution-security@lists.cncf.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"chrispat@github.com\"\n  - \"clarkbw@github.com\"\n  - \"csnider@mirantis.com\"\n  - \"hswimelar@gitlab.com\"\n  - \"hweiwei@vmware.com\"\n  - \"jpereira@gitlab.com\"\n  - \"justin.cormack@docker.com\"\n  - \"ksquizzato@mirantis.com\"\n  - \"milos.gajdos@docker.com\"\n  - \"sargun@sargun.me\"\n  - \"wwarren@digitalocean.com\"\n  - \"wangyan@vmware.com\"\n  - \"steve.lasker@microsoft.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/django/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\n# Install dependencies for building Python from source\nRUN apt-get update && apt-get install -y \\\n    build-essential \\\n    zlib1g-dev \\\n    libncurses5-dev \\\n    libgdbm-dev \\\n    libnss3-dev \\\n    libssl-dev \\\n    libreadline-dev \\\n    libffi-dev \\\n    libsqlite3-dev \\\n    libbz2-dev \\\n    liblzma-dev \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Build and install Python 3.12 from source (Django main branch requires Python 3.12+)\nRUN cd /tmp && \\\n    curl -O https://www.python.org/ftp/python/3.12.12/Python-3.12.12.tgz && \\\n    tar -xzf Python-3.12.12.tgz && \\\n    cd Python-3.12.12 && \\\n    ./configure --enable-optimizations --enable-shared --prefix=/usr/local/python3.12 && \\\n    make -j$(nproc) && \\\n    make install && \\\n    rm -rf /tmp/Python-3.12.12*\n\n# Add Python 3.12 libs to LD_LIBRARY_PATH\nENV LD_LIBRARY_PATH=\"/usr/local/python3.12/lib:$LD_LIBRARY_PATH\"\n\n# Create symlinks for python3.12\nRUN ln -sf /usr/local/python3.12/bin/python3.12 /usr/local/bin/python3.12 && \\\n    ln -sf /usr/local/python3.12/bin/pip3.12 /usr/local/bin/pip3.12\n\nRUN python3.12 -m pip install --upgrade pip cython\nRUN git clone --depth 1 https://github.com/django/django.git\nRUN git clone --depth 1 https://github.com/django/django-fuzzers.git\n\nCOPY build.sh $SRC/\n\nWORKDIR $SRC/django\n"
  },
  {
    "path": "projects/django/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Make Python 3.12 the default python3 for this build\nexport PATH=\"/usr/local/python3.12/bin:$PATH\"\nexport LD_LIBRARY_PATH=\"/usr/local/python3.12/lib:$LD_LIBRARY_PATH\"\nln -sf /usr/local/python3.12/bin/python3.12 /usr/local/bin/python3\nln -sf /usr/local/python3.12/bin/pip3.12 /usr/local/bin/pip3\n\n# Install atheris and pyinstaller for Python 3.12\npython3 -m pip install atheris pyinstaller\n\n# Build and install project (using current CFLAGS, CXXFLAGS). This is required\n# for projects with C extensions so that they're built with the proper flags.\npython3 -m pip install .\n\nexport DJANGO_SETTINGS_MODULE=fuzzer_project.settings\n\n# Build fuzzers into $OUT. These could be detected in other ways.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer --add-data django/conf/locale/en/LC_MESSAGES:django/conf/locale/en/LC_MESSAGES\ndone\n"
  },
  {
    "path": "projects/django/project.yaml",
    "content": "auto_ccs:\n- jammamarkus@gmail.com\n- guidovranken@gmail.com\n- info+django+security@markusholtermann.eu\n- jacobtylerwalls@gmail.com\nfuzzing_engines:\n- libfuzzer\nhomepage: https://www.djangoproject.com/\nlanguage: python\nmain_repo: https://github.com/django/django.git\nprimary_contact: f.apolloner@gmail.com\nsanitizers:\n- address\n- undefined\n"
  },
  {
    "path": "projects/dlplibs/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n# install build requirements\nRUN apt-get update && \\\n    apt-get install -y wget xz-utils autoconf automake libtool pkg-config \\\n        gperf libglm-dev patch libboost-dev\nADD https://dev-www.libreoffice.org/src/lcms2-2.8.tar.gz \\\n    https://dev-www.libreoffice.org/src/zlib-1.2.11.tar.xz \\\n    https://dev-www.libreoffice.org/src/libpng-1.6.34.tar.xz \\\n    https://dev-www.libreoffice.org/src/libxml2-2.9.7.tar.gz \\\n    https://dev-www.libreoffice.org/src/icu4c-60_2-src.tgz \\\n    https://dev-www.libreoffice.org/src/mdds-1.3.1.tar.bz2 \\\n    $SRC/\n# download fuzzing corpora\nADD https://dev-www.libreoffice.org/corpus/olefuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/pubfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/zipfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/cdrfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/vsdfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/zmffuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/pmdfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/fhfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/cmxfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/sdcfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/bmifuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/abwfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/sdafuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/sddfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/sdwfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/key6fuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/vsdxfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/vdxfuzzer_seed_corpus.zip \\\n    https://dev-www.libreoffice.org/corpus/qxpfuzzer_seed_corpus.zip \\\n    $SRC/\nRUN wget -q --show-progress --progress=bar:force \\\n    https://sourceforge.net/projects/libwpd/files/corpus/wpdfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwpg/files/corpus/wpgfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/wpsfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/actafuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libebook/files/corpus/lrffuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/wksfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/wdbfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/docfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/wrifuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/powerpointfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/mswrdfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/mswksfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/123fuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/wqfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libebook/files/corpus/pdbfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/beaglewksfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/clariswksfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/greatwksfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/applepictfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/clarisdrawfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/cricketdrawfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/freehandfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/macdraftfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/macdrawfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/macpaintfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/pixelpaintfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/superpaintfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/wingzfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/docmkrfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/edocfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/fullwrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/hanmacwrdfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/lightwaytxtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/macdocfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/macwrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/marinerwrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/maxwrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/mindwrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/morefuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/mousewrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/nisuswrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/ragtimefuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/stylefuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/teachtxtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/writenowfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/writerplsfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/zwrtfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libmwaw/files/corpus/multiplanfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libwps/files/corpus/mpfuzzer_seed_corpus.zip \\\n    https://sourceforge.net/projects/libebook/files/corpus/fb2fuzzer_seed_corpus.zip \\\n    -P $SRC\n# clone sources\nRUN git clone --depth 1 git://git.code.sf.net/p/libwpd/librevenge\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libmspub\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libcdr\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libvisio\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libzmf\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libpagemaker\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libfreehand\nRUN git clone --depth 1 git://git.code.sf.net/p/libwpd/code libwpd\nRUN git clone --depth 1 git://git.code.sf.net/p/libwpg/code libwpg\nRUN git clone --depth 1 https://github.com/fosnola/libstaroffice\nRUN git clone --depth 1 git://git.code.sf.net/p/libwps/code libwps\nRUN git clone --depth 1 git://git.code.sf.net/p/libmwaw/libmwaw\nRUN git clone --depth 1 git://git.code.sf.net/p/libebook/code libe-book\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libabw\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libetonyek\nRUN git clone --depth 1 git://gerrit.libreoffice.org/libqxp\nWORKDIR $SRC\nCOPY build.sh *.options *.patch $SRC/\n"
  },
  {
    "path": "projects/dlplibs/abwfuzzer.options",
    "content": "[libfuzzer]\ndict = abw.dict\n"
  },
  {
    "path": "projects/dlplibs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Suppress C++17 errors from old dependency headers (lcms2 uses 'register')\nexport CXXFLAGS=\"$CXXFLAGS -Wno-register\"\n\ntar -xJf $SRC/zlib-1.2.11.tar.xz\npushd zlib-1.2.11\n./configure --static\nmake -j$(nproc)\nexport ZLIB_CFLAGS=\"-I$(pwd)\"\nexport ZLIB_LIBS=\"-L$(pwd) -lz\"\npopd\n\ntar -xzf $SRC/lcms2-2.8.tar.gz\npushd lcms2-2.8\n./configure --disable-shared --enable-static --without-jpeg --without-tiff\nmake -C src -j$(nproc)\nexport LCMS2_CFLAGS=\"-I$(pwd)/include\"\nexport LCMS2_LIBS=\"-L$(pwd)/src -llcms2\"\npopd\n\ntar -xJf $SRC/libpng-1.6.34.tar.xz\npushd libpng-1.6.34\n./configure --disable-shared --enable-static CPPFLAGS=\"$ZLIB_CFLAGS\" LDFLAGS=\"$ZLIB_LIBS\"\nmake -j$(nproc)\nexport LIBPNG_CFLAGS=\"-I$(pwd)\"\nexport LIBPNG_LIBS=\"-L$(pwd) -lpng16\"\npopd\n\ntar -xzf $SRC/libxml2-2.9.7.tar.gz\npushd libxml2-2.9.7\n./configure --disable-shared --enable-static --disable-ipv6 --without-python --without-zlib --without-lzma\nmake -j$(nproc)\nexport LIBXML_CFLAGS=\"-I$(pwd)/include\"\nexport LIBXML_LIBS=\"-L$(pwd) -lxml2\"\nexport XML_CFLAGS=\"$LIBXML_CFLAGS\"\nexport XML_LIBS=\"$LIBXML_LIBS\"\npopd\n\ntar -xzf $SRC/icu4c-60_2-src.tgz\npushd icu/source\npatch -p2 < $SRC/icu4c-ubsan.patch\npatch -p3 < $SRC/ofz3670.patch\npatch -p3 < $SRC/ofz4860.patch\n./configure --disable-shared --enable-static --with-data-packaging=static --disable-dyload --disable-strict \\\n    --disable-layout --disable-samples --disable-extras --disable-icuio --disable-plugins \\\n    CPPFLAGS=-DU_USE_STRTOD_L=0\nmake -j$(nproc)\nexport ICU_CFLAGS=\"-I$(pwd) -I$(pwd)/i18n -I$(pwd)/common\"\nexport ICU_LIBS=\"-L$(pwd)/lib -licui18n -licuuc -licudata\"\npopd\n\n# System boost from libboost-dev package is used (headers in /usr/include/boost/)\n\ntar -xjf $SRC/mdds-1.3.1.tar.bz2\npushd mdds-1.3.1\n./configure\nexport MDDS_CFLAGS=\"-I$(pwd)/include\"\nexport MDDS_LIBS=' '\npopd\n\npushd librevenge\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tests --enable-fuzzers\nmake -j$(nproc)\nrvnginc=$(pwd)/inc\nrvnglib=$(pwd)/src/lib\nexport REVENGE_CFLAGS=\"-I$(pwd)/inc\"\nexport REVENGE_LIBS=\"-L$(pwd)/src/lib -lrevenge-0.0\"\nexport REVENGE_STREAM_CFLAGS=\"-I$(pwd)/inc\"\nexport REVENGE_STREAM_LIBS=\"-L$(pwd)/src/lib -lrevenge-stream-0.0\"\nexport REVENGE_GENERATORS_CFLAGS=\"-I$(pwd)/inc\"\nexport REVENGE_GENERATORS_LIBS=\"-L$(pwd)/src/lib -lrevenge-generators-0.0\"\npopd\n\npushd libmspub\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers\nmake -j$(nproc)\npopd\n\npushd libcdr\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests\nmake -j$(nproc)\npopd\n\npushd libvisio\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests\nmake -j$(nproc)\npopd\n\npushd libzmf\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests\nmake -j$(nproc)\npopd\n\npushd libpagemaker\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers\nmake -j$(nproc)\npopd\n\npushd libfreehand\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests\nmake -j$(nproc)\npopd\n\npushd libwpd\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers\nmake -j$(nproc)\nexport WPD_CFLAGS=-I$(pwd)/inc\nexport WPD_LIBS=\"-L$(pwd)/src/lib -lwpd-0.10\"\npopd\n\npushd libwpg\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers\nmake -j$(nproc)\npopd\n\npushd libstaroffice\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers\nmake -j$(nproc)\npopd\n\npushd libwps\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers\nmake -j$(nproc)\npopd\n\npushd libmwaw\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --disable-zip --enable-fuzzers\nmake -C src/lib -j$(nproc)\n# Link with less parallelism to avoid memory problems on the builders\nmake -j2\npopd\n\npushd libe-book\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static \\\n    --without-tools --enable-fuzzers --without-liblangtag --disable-tests\nmake -j$(nproc)\npopd\n\npushd libabw\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers\nmake -j$(nproc)\npopd\n\npushd libetonyek\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static \\\n    --without-tools --enable-fuzzers --with-mdds=0.x --without-liblangtag --disable-tests\nmake -j$(nproc)\npopd\n\npushd libqxp\n./autogen.sh\n./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests\nmake -j$(nproc)\npopd\n\ncp */src/fuzz/*fuzzer $OUT\ncp */src/fuzz/*.dict $OUT\ncp *_seed_corpus.zip $OUT\ncp *.options $OUT\n"
  },
  {
    "path": "projects/dlplibs/fb2fuzzer.options",
    "content": "[libfuzzer]\ndict = fb2.dict\n"
  },
  {
    "path": "projects/dlplibs/icu4c-ubsan.patch",
    "content": "diff -ur icu.org/source/common/rbbidata.h icu/source/common/rbbidata.h\n--- icu.org/source/common/rbbidata.h\t2017-02-03 19:57:23.000000000 +0100\n+++ icu/source/common/rbbidata.h\t2017-04-21 22:46:25.371651160 +0200\n@@ -115,7 +115,7 @@\n                                     /*     StatusTable of the set of matching             */\n                                     /*     tags (rule status values)                      */\n     int16_t          fReserved;\n-    uint16_t         fNextState[2]; /*  Next State, indexed by char category.             */\n+    uint16_t         fNextState[1]; /*  Next State, indexed by char category.             */\n                                     /*  This array does not have two elements             */\n                                     /*    Array Size is actually fData->fHeader->fCatCount         */\n                                     /*    CAUTION:  see RBBITableBuilder::getTableSize()  */\n@@ -128,7 +128,7 @@\n     uint32_t         fRowLen;       /*  Length of a state table row, in bytes.            */\n     uint32_t         fFlags;        /*  Option Flags for this state table                 */\n     uint32_t         fReserved;     /*  reserved                                          */\n-    char             fTableData[4]; /*  First RBBIStateTableRow begins here.              */\n+    char             fTableData[1]; /*  First RBBIStateTableRow begins here.              */\n                                     /*    (making it char[] simplifies ugly address       */\n                                     /*     arithmetic for indexing variable length rows.) */\n };\ndiff -ur icu.org/source/common/rbbitblb.cpp icu/source/common/rbbitblb.cpp\n--- icu.org/source/common/rbbitblb.cpp\t2017-01-20 01:20:31.000000000 +0100\n+++ icu/source/common/rbbitblb.cpp\t2017-04-21 22:46:25.373651159 +0200\n@@ -1095,15 +1095,15 @@\n         return 0;\n     }\n \n-    size    = sizeof(RBBIStateTable) - 4;    // The header, with no rows to the table.\n+    size    = offsetof(RBBIStateTable, fTableData);    // The header, with no rows to the table.\n \n     numRows = fDStates->size();\n     numCols = fRB->fSetBuilder->getNumCharCategories();\n \n-    //  Note  The declaration of RBBIStateTableRow is for a table of two columns.\n-    //        Therefore we subtract two from numCols when determining\n+    //  Note  The declaration of RBBIStateTableRow is for a table of one columns.\n+    //        Therefore we subtract one from numCols when determining\n     //        how much storage to add to a row for the total columns.\n-    rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-2);\n+    rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-1);\n     size   += numRows * rowSize;\n     return size;\n }\n@@ -1133,7 +1133,7 @@\n     }\n \n     table->fRowLen    = sizeof(RBBIStateTableRow) +\n-                            sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 2);\n+                            sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 1);\n     table->fNumStates = fDStates->size();\n     table->fFlags     = 0;\n     if (fRB->fLookAheadHardBreak) {\ndiff -ur icu.org/source/common/ubidiimp.h icu/source/common/ubidiimp.h\n--- icu.org/source/common/ubidiimp.h\t2017-02-03 19:57:23.000000000 +0100\n+++ icu/source/common/ubidiimp.h\t2017-04-21 22:46:25.374651159 +0200\n@@ -198,8 +198,8 @@\n /* in a Run, logicalStart will get this bit set if the run level is odd */\n #define INDEX_ODD_BIT (1UL<<31)\n \n-#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31))\n-#define ADD_ODD_BIT_FROM_LEVEL(x, level)  ((x)|=((int32_t)(level)<<31))\n+#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31))\n+#define ADD_ODD_BIT_FROM_LEVEL(x, level)  ((x)|=((uint32_t)(level)<<31))\n #define REMOVE_ODD_BIT(x)                 ((x)&=~INDEX_ODD_BIT)\n \n #define GET_INDEX(x)   ((x)&~INDEX_ODD_BIT)\ndiff -ur icu.org/source/common/ucmndata.cpp icu/source/common/ucmndata.cpp\n--- icu.org/source/common/ucmndata.cpp\t2017-03-08 16:34:47.000000000 +0100\n+++ icu/source/common/ucmndata.cpp\t2017-04-21 22:46:25.376651159 +0200\n@@ -77,7 +77,7 @@\n typedef struct  {\n     uint32_t          count;\n     uint32_t          reserved;\n-    PointerTOCEntry   entry[2];   /* Actual size is from count. */\n+    PointerTOCEntry   entry[1];   /* Actual size is from count. */\n }  PointerTOC;\n \n \ndiff -ur icu.org/source/common/ucmndata.h icu/source/common/ucmndata.h\n--- icu.org/source/common/ucmndata.h\t2017-01-20 01:20:31.000000000 +0100\n+++ icu/source/common/ucmndata.h\t2017-04-21 22:46:25.377651159 +0200\n@@ -52,7 +52,7 @@\n \n typedef struct {\n     uint32_t count;\n-    UDataOffsetTOCEntry entry[2];    /* Actual size of array is from count. */\n+    UDataOffsetTOCEntry entry[1];    /* Actual size of array is from count. */\n } UDataOffsetTOC;\n \n /**\n"
  },
  {
    "path": "projects/dlplibs/ofz2894.patch",
    "content": "From 3d8a80c4f3470fea0169f6774320e61619bac52b Mon Sep 17 00:00:00 2001\nFrom: David Tardon <dtardon@redhat.com>\nDate: Mon, 2 Oct 2017 16:22:36 +0200\nSubject: [PATCH] ofz#2894 avoid signed integer overflow\n\n/usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:86:48: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself\n---\n include/boost/spirit/home/qi/numeric/detail/real_impl.hpp | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp\nindex 9aa5bb8bb..3e7ab18a9 100644\n--- a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp\n+++ b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp\n@@ -81,12 +81,13 @@ namespace boost { namespace spirit { namespace traits\n                 detail::compensate_roundoff(n, acc_n);\n                 n /= pow10<T>(-min_exp);\n \n-                // return false if (-exp + min_exp) exceeds the -min_exp\n+                // return false if exp still exceeds the min_exp\n                 // do this check only for primitive types!\n-                if (is_floating_point<T>() && (-exp + min_exp) > -min_exp)\n+                exp += -min_exp;\n+                if (is_floating_point<T>() && exp < min_exp)\n                     return false;\n \n-                n /= pow10<T>(-exp + min_exp);\n+                n /= pow10<T>(-exp);\n             }\n             else\n             {\n-- \n2.14.1\n\n"
  },
  {
    "path": "projects/dlplibs/ofz3670.patch",
    "content": "From b0537ec9a7047d55d365a64e9ec9559cf1f28792 Mon Sep 17 00:00:00 2001\nFrom: David Tardon <dtardon@redhat.com>\nDate: Mon, 13 Nov 2017 16:56:23 +0100\nSubject: [PATCH] avoid target buffer overflow\n\n---\n icu4c/source/common/ucnv_u8.cpp | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/icu4c/source/common/ucnv_u8.cpp b/icu4c/source/common/ucnv_u8.cpp\nindex 951988ed9..caaf18ae3 100644\n--- a/icu4c/source/common/ucnv_u8.cpp\n+++ b/icu4c/source/common/ucnv_u8.cpp\n@@ -770,6 +770,11 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs,\n             oldToULength=0;\n             toULength=1;\n             toULimit=U8_COUNT_BYTES_NON_ASCII(b);\n+            if (toULimit > (const uint8_t *)pFromUArgs->targetLimit - target)\n+            {\n+                *pErrorCode = U_BUFFER_OVERFLOW_ERROR;\n+                break;\n+            }\n             c=b;\n moreBytes:\n             while(toULength<toULimit) {\n-- \n2.14.1\n\n"
  },
  {
    "path": "projects/dlplibs/ofz4303.patch",
    "content": "From debdf8ce55d2d42c15bc99a09bd2c37c4c910630 Mon Sep 17 00:00:00 2001\nFrom: David Tardon <dtardon@redhat.com>\nDate: Sat, 18 Nov 2017 10:06:24 +0100\nSubject: [PATCH] ofz#4303 avoid signed integer overflow\n\n/usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:110:26: runtime error: signed integer overflow: -2147483647 - 19 cannot be represented in type 'int'\n---\n include/boost/spirit/home/qi/numeric/detail/real_impl.hpp | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp\nindex 3e7ab18a9..4a65bd79c 100644\n--- a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp\n+++ b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp\n@@ -108,6 +108,8 @@ namespace boost { namespace spirit { namespace traits\n     inline bool\n     scale(int exp, int frac, T& n, AccT acc_n)\n     {\n+        if (exp < std::numeric_limits<int>::min() + frac)\n+            return false;\n         return scale(exp - frac, n, acc_n);\n     }\n \n-- \n2.14.3\n\n"
  },
  {
    "path": "projects/dlplibs/ofz4860.patch",
    "content": "From 529ba01ee606940ca273b187be8ce9ba31cf2d90 Mon Sep 17 00:00:00 2001\nFrom: David Tardon <dtardon@redhat.com>\nDate: Fri, 19 Jan 2018 10:41:02 +0100\nSubject: [PATCH] ofz#4860 fix past-the-end read from array\n\n---\n icu4c/source/common/locmap.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/icu4c/source/common/locmap.cpp b/icu4c/source/common/locmap.cpp\nindex cbb2b810a..6d62d8310 100644\n--- a/icu4c/source/common/locmap.cpp\n+++ b/icu4c/source/common/locmap.cpp\n@@ -1015,7 +1015,7 @@ static const char*\n getPosixID(const ILcidPosixMap *this_0, uint32_t hostID)\n {\n     uint32_t i;\n-    for (i = 0; i <= this_0->numRegions; i++)\n+    for (i = 0; i < this_0->numRegions; i++)\n     {\n         if (this_0->regionMaps[i].hostID == hostID)\n         {\n-- \n2.14.3\n\n"
  },
  {
    "path": "projects/dlplibs/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.documentliberation.org\"\nlanguage: c++\nprimary_contact: \"dtardon@redhat.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\n  - undefined\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/dlplibs/vdxfuzzer.options",
    "content": "[libfuzzer]\ndict = vdx.dict\n"
  },
  {
    "path": "projects/dlplibs/vsdxfuzzer.options",
    "content": "[libfuzzer]\ndict = vsdx.dict\n"
  },
  {
    "path": "projects/dng_sdk/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget cmake libjpeg-turbo8-dev zlib1g-dev libxmp-dev\nRUN git clone https://android.googlesource.com/platform/external/dng_sdk/\n\n# For seed corpus\nRUN git clone --depth=1 https://github.com/ianare/exif-samples exif-samples\nRUN git clone --depth=1 https://github.com/image-rs/image-tiff image-tiff\nRUN git clone --depth=1 https://github.com/yigolden/TiffLibrary TiffLibrary\n\nCOPY build.sh $SRC/\nCOPY *_fuzzer.cpp $SRC/\nWORKDIR dng_sdk\n"
  },
  {
    "path": "projects/dng_sdk/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# compile source\ncd ./source\nrm dng_xmp*\nfind . -name \"*.cpp\" -exec $CXX $CXXFLAGS -DqDNGUseLibJPEG=1 -DqDNGUseXMP=0 -DqDNGThreadSafe=1 -c {} \\;\nar cr libdns_sdk.a *.o\n\n# compile fuzzer\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ../fuzzer/dng_parser_fuzzer.cpp -o $OUT/dng_parser_fuzzer \\\n  ./libdns_sdk.a -I./ -l:libjpeg.a -lz\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/dng_stage_fuzzer.cpp -o $OUT/dng_stage_fuzzer \\\n  ./libdns_sdk.a -I./ -l:libjpeg.a -lz\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/dng_camera_profile_fuzzer.cpp -o $OUT/dng_camera_profile_fuzzer \\\n  ./libdns_sdk.a -I./ -l:libjpeg.a -lz\n\nsed -i 's/main/main2/g' $SRC/dng_sdk/source/dng_validate.cpp\nsed -i 's/printf (\"Val/\\/\\//g' $SRC/dng_sdk/source/dng_validate.cpp\nsed -i 's/static//g' $SRC/dng_sdk/source/dng_validate.cpp\n\ncat $SRC/dng_sdk/source/dng_validate.cpp $SRC/dng_validate_fuzzer.cpp >> $SRC/dng_validate_fuzzer.tmp\nmv $SRC/dng_validate_fuzzer.tmp $SRC/dng_validate_fuzzer.cpp\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -DqDNGValidateTarget \\\n  $SRC/dng_sdk/source/dng_globals.cpp \\\n  $SRC/dng_validate_fuzzer.cpp \\\n  -o $OUT/dng_validate_fuzzer \\\n  ./libdns_sdk.a -I./ -l:libjpeg.a -lz\n\ncat $SRC/dng_sdk/source/dng_validate.cpp $SRC/dng_fixed_validate_fuzzer.cpp >> $SRC/dng_fixed_validate_fuzzer.tmp\nmv $SRC/dng_fixed_validate_fuzzer.tmp $SRC/dng_fixed_validate_fuzzer.cpp\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -DqDNGValidateTarget \\\n  $SRC/dng_sdk/source/dng_globals.cpp \\\n  $SRC/dng_fixed_validate_fuzzer.cpp \\\n  -o $OUT/dng_fixed_validate_fuzzer \\\n  ./libdns_sdk.a -I./ -l:libjpeg.a -lz\n\n\n# Create seed corpus and distribute to fuzzers\nmkdir $SRC/seed_corpus\ncp $SRC/dng_sdk/fuzzer/seeds/CVE_2020_9589/*.dng $SRC/seed_corpus/\nfind $SRC/image-tiff/ -regextype sed -regex \".*\\.\\(pbm\\|pgm\\|tif\\|tiff\\|png\\|ppm\\|jpg\\|exif\\)\" -exec cp {} $SRC/seed_corpus/ \\;\nfind $SRC/TiffLibrary/ -regextype sed -regex \".*\\.\\(pbm\\|pgm\\|tif\\|tiff\\|png\\|ppm\\|jpg\\|exif\\)\" -exec cp {} $SRC/seed_corpus/ \\;\nfind $SRC/exif-samples/ -regextype sed -regex \".*\\.\\(pbm\\|pgm\\|tif\\|tiff\\|png\\|ppm\\|jpg\\|exif\\)\" -exec cp {} $SRC/seed_corpus/ \\;\n\n# Download a compressed JPEG\nwget https://upload.wikimedia.org/wikipedia/commons/b/b2/JPEG_compression_Example.jpg -O $SRC/seed_corpus/compressed_JPEG.jpg\n\nzip -r -j $OUT/dng_parser_fuzzer_seed_corpus.zip $SRC/seed_corpus\ncp $OUT/dng_parser_fuzzer_seed_corpus.zip $OUT/dng_stage_fuzzer_seed_corpus.zip\ncp $OUT/dng_parser_fuzzer_seed_corpus.zip $OUT/dng_fixed_validate_fuzzer_seed_corpus.zip\n"
  },
  {
    "path": "projects/dng_sdk/dng_camera_profile_fuzzer.cpp",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#include \"dng_color_space.h\"\n#include \"dng_date_time.h\"\n#include \"dng_exceptions.h\"\n#include \"dng_file_stream.h\"\n#include \"dng_globals.h\"\n#include \"dng_host.h\"\n#include \"dng_ifd.h\"\n#include \"dng_image_writer.h\"\n#include \"dng_info.h\"\n#include \"dng_linearization_info.h\"\n#include \"dng_mosaic_info.h\"\n#include \"dng_negative.h\"\n#include \"dng_preview.h\"\n#include \"dng_render.h\"\n#include \"dng_simple_image.h\"\n#include \"dng_tag_codes.h\"\n#include \"dng_tag_types.h\"\n#include \"dng_tag_values.h\"\n#include \"dng_camera_profile.h\"\n\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider provider(data, size);\n  std::string s1 = provider.ConsumeRandomLengthString();\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n      return 0;\n  }\n  fwrite(s1.c_str(), s1.size(), 1, fp);\n  fclose(fp);\n  \n  // Create a file stream\n  dng_file_stream fStream(filename, false, 0);\n\n  // Create a custom camera profile based on the fstream above\n  try {\n    AutoPtr<dng_camera_profile> customCameraProfile (new dng_camera_profile ());\n    customCameraProfile->ParseExtended(fStream);\n\n    // The profile is not stubeed, so we can calculate the fingerprint.\n    const dng_fingerprint &fPrint = customCameraProfile->Fingerprint();\n  } catch (dng_exception &e) {}\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/dng_sdk/dng_fixed_validate_fuzzer.cpp",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Set the various sizes\n  gPreferredSize = 0;\n  gMinimumSize = 0;\n  gMaximumSize = 0;\n\n  gDumpDNG.Clear();\n  char dumpDNGFilename[256];\n  sprintf(dumpDNGFilename, \"/tmp/libfuzzer-dng.%d.dng\", getpid());\n  gDumpDNG.Set(dumpDNGFilename); \n\n  gDumpStage1.Clear();\n  char dumpStage1Filename[256];\n  sprintf(dumpStage1Filename, \"/tmp/libfuzzer-stage1.%d.dng\", getpid());\n  gDumpStage1.Set(dumpStage1Filename); \n\n  gDumpStage2.Clear();\n  char dumpStage2Filename[256];\n  sprintf(dumpStage2Filename, \"/tmp/libfuzzer-stage2.%d.dng\", getpid());\n  gDumpStage2.Set(dumpStage2Filename); \n\n  gDumpStage3.Clear();\n  char dumpStage3Filename[256];\n  sprintf(dumpStage3Filename, \"/tmp/libfuzzer-stage3.%d.dng\", getpid());\n  gDumpStage3.Set(dumpStage3Filename); \n\n  gDumpTIF.Clear();\n  char dumpTifFilename[256];\n  sprintf(dumpTifFilename, \"/tmp/libfuzzer-tif.%d.tif\", getpid());\n  gDumpTIF.Set(dumpTifFilename); \n\n  gProxyDNGSize = 1024;\n  gMosaicPlane = 32;\n\n\n  gFourColorBayer = true;\n  gFinalSpace = &dng_space_sRGB::Get ();\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n      return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  // Target\n  dng_validate(filename);\n\n  // cleanup file\n  unlink(filename);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/dng_sdk/dng_stage_fuzzer.cpp",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#include \"dng_color_space.h\"\n#include \"dng_date_time.h\"\n#include \"dng_exceptions.h\"\n#include \"dng_file_stream.h\"\n#include \"dng_globals.h\"\n#include \"dng_host.h\"\n#include \"dng_ifd.h\"\n#include \"dng_image_writer.h\"\n#include \"dng_info.h\"\n#include \"dng_linearization_info.h\"\n#include \"dng_mosaic_info.h\"\n#include \"dng_negative.h\"\n#include \"dng_preview.h\"\n#include \"dng_render.h\"\n#include \"dng_simple_image.h\"\n#include \"dng_tag_codes.h\"\n#include \"dng_tag_types.h\"\n#include \"dng_tag_values.h\"\n#include \"dng_camera_profile.h\"\n\n// Run a set of the operations high-level operations on the dng_sdk\n// This code is inspired by dng_validate.cpp and performs many of the same\n// operations in a simplified manner.\nvoid runFuzzerWithVariableHost(char *filename, uint32_t dng_version,\n                               bool linear, bool preview, bool should_proxy,\n                               bool KeepOriginalFile, bool NeedsMeta,\n                               bool NeedsImage, int do_color_coding,\n                               bool setFuji) {\n  dng_host host;\n  host.SetPreferredSize(0);\n  host.SetMinimumSize(0);\n  host.SetMaximumSize(0);\n  host.SetSaveDNGVersion(dng_version);\n  host.SetSaveLinearDNG(linear);\n  host.SetForPreview(preview);\n  host.ValidateSizes();\n  host.SetKeepOriginalFile(KeepOriginalFile);\n  host.SetNeedsMeta(NeedsMeta);\n  host.SetNeedsImage(NeedsImage);\n\n  AutoPtr<dng_camera_profile> customCameraProfile (new dng_camera_profile ());\n  customCameraProfile->SetName(\"custom profile\");\n\n  AutoPtr<dng_negative> negative;\n  try {\n    dng_info info;\n    dng_file_stream stream((const char *)filename);\n    info.Parse(host, stream);\n    info.PostParse(host);\n\n    if (setFuji && info.fIFDCount > 0) {\n      info.fIFD[0]->CanRead();\n    }\n\n    if (info.IsValidDNG()) {\n      negative.Reset(host.Make_dng_negative());\n      negative->AddProfile(customCameraProfile);\n\n      if (do_color_coding == 1) {\n        negative->SetDefaultCropSize((uint32)100,(uint32)100);\n        negative->SetDefaultCropOrigin((uint32)50,(uint32)100);\n      }\n      else if (do_color_coding == 2) {\n        negative->ResetDefaultUserCrop();\n      }\n      else {\n        negative->SetDefaultUserCropT(dng_urational(0, 1));\n      }\n      \n      negative->SetStage3Gain(2);\n      negative->SetIsPreview(true);\n\n      negative->Parse(host, stream, info);\n      negative->PostParse(host, stream, info);\n      negative->ReadStage1Image(host, stream, info);\n      if (info.fMaskIndex != -1) {\n        negative->ReadTransparencyMask(host, stream, info);\n      }\n\n      if (do_color_coding == 2) {\n        const char fingerprint_raw[32] = { 'a', 'a','a','a','a','a',\n          'a','a','a','a','a','a','a','a','a','a','a','a','a',\n          'a','a','a','a','a','a','a','a','a','a','a','a','a'};\n\n        dng_fingerprint fp;\n        fp.FromUtf8HexString(fingerprint_raw);\n        dng_camera_profile_id dcpi(\"random id\", fp);\n        negative->ProfileByID(dcpi, true);\n      }\n      negative->SynchronizeMetadata();\n      negative->SetFourColorBayer();\n      if (do_color_coding == 1) {\n        negative->SetRGB();\n      }\n      else if (do_color_coding == 2) {\n        negative->SetCMY();\n      }\n      else if (do_color_coding == 3) {\n        negative->SetGMCY();\n      }\n      negative->BuildStage2Image(host);\n      negative->BuildStage3Image(host, 1);\n\n      if (should_proxy) {\n        dng_image_writer writer;\n        negative->ConvertToProxy(host, writer, 1);\n      }\n\n      if (negative->NeedFlattenTransparency(host)) {\n        negative->FlattenTransparency(host);\n      }\n\n      // Write DNG\n      dng_file_stream stream3(\"/tmp/randdng1\", true);\n      dng_image_writer writer3;\n      dng_preview_list previewList;\n      writer3.WriteDNG(host, stream3, *negative.Get(), &previewList,\n                       dng_version, false);\n\n      // Write TIFF\n      uint32_t compression_arr[8] = { ccUncompressed, ccLZW, ccOldJPEG, ccJPEG,\n        ccDeflate, ccPackBits, ccOldDeflate, ccLossyJPEG};\n      for (int c = 0; c < 8; c++) {\n        dng_file_stream stream2(\"/tmp/randpng\", true);\n        const dng_image &stage3 = *negative->Stage3Image();\n        dng_image_writer writer2;\n        writer2.WriteTIFF(host, stream2, stage3,\n                          stage3.Planes() >= 3 ? piRGB : piBlackIsZero, compression_arr[c]);\n      }\n\n      // Create a renderer\n      dng_render render(host, *negative);\n      AutoPtr<dng_image> finalImage;\n      finalImage.Reset(render.Render());\n\n      // Use a random var to determine if we should clear profiles from disk.\n      if (do_color_coding == 3) {\n      negative->ClearProfiles(true, true);\n      }\n    }\n  } catch (dng_exception &e) {\n    // dng_sdk throws C++ exceptions on errors\n    // catch them here to prevent libFuzzer from crashing.\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  // parse the data using a variable set of options for dng_host\n  runFuzzerWithVariableHost(filename, dngVersion_None, true, false, false, true, true, true, 1, true);\n  runFuzzerWithVariableHost(filename, dngVersion_1_0_0_0, true, true, false, true, true, true, 2, false);\n  runFuzzerWithVariableHost(filename, dngVersion_1_1_0_0, true, true, false, true, true, true, 3, true);\n  runFuzzerWithVariableHost(filename, dngVersion_1_2_0_0, true, true, false, true, true, true, 4, false);\n  runFuzzerWithVariableHost(filename, dngVersion_1_3_0_0, true, true, false, true, true, true, 1, true);\n  runFuzzerWithVariableHost(filename, dngVersion_1_4_0_0, true, true, false, true, true, true, 2, false);\n  runFuzzerWithVariableHost(filename, dngVersion_1_4_0_0, false, false, true, true, true, true, 3, false);\n  runFuzzerWithVariableHost(filename, dngVersion_1_4_0_0, false, false, true, true, true, true, 3, true);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/dng_sdk/dng_validate_fuzzer.cpp",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <fuzzer/FuzzedDataProvider.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider provider(data, size);\n\n  // Set the various sizes\n  gPreferredSize = provider.ConsumeIntegral<uint32_t>();\n  gMinimumSize = provider.ConsumeIntegral<uint32_t>();\n  gMaximumSize = provider.ConsumeIntegral<uint32_t>();\n\n  gDumpDNG.Clear();\n  char dumpDNGFilename[256];\n  if (provider.ConsumeBool()) {\n    sprintf(dumpDNGFilename, \"/tmp/libfuzzer-dng.%d.dng\", getpid());\n    gDumpDNG.Set(dumpDNGFilename); \n  }\n\n  gDumpStage1.Clear();\n  char dumpStage1Filename[256];\n  if (provider.ConsumeBool()) {\n    sprintf(dumpStage1Filename, \"/tmp/libfuzzer-stage1.%d.dng\", getpid());\n    gDumpStage1.Set(dumpStage1Filename); \n  }\n  \n\n  gDumpStage2.Clear();\n  char dumpStage2Filename[256];\n  if (provider.ConsumeBool()) {\n    sprintf(dumpStage2Filename, \"/tmp/libfuzzer-stage2.%d.dng\", getpid());\n    gDumpStage2.Set(dumpStage2Filename); \n  }\n\n  gDumpStage3.Clear();\n  char dumpStage3Filename[256];\n  if (provider.ConsumeBool()) {\n    sprintf(dumpStage3Filename, \"/tmp/libfuzzer-stage3.%d.dng\", getpid());\n    gDumpStage3.Set(dumpStage3Filename); \n  }\n\n  gDumpTIF.Clear();\n  char dumpTifFilename[256];\n  if (provider.ConsumeBool()) {\n    sprintf(dumpTifFilename, \"/tmp/libfuzzer-tif.%d.tif\", getpid());\n    gDumpTIF.Set(dumpTifFilename); \n  }\n\n  gProxyDNGSize = provider.ConsumeIntegral<uint32_t>();\n  gMosaicPlane = provider.ConsumeIntegral<int32_t>();\n\n\n  gFourColorBayer = provider.ConsumeBool();\n\n  switch (provider.ConsumeIntegralInRange(0, 7)) {\n    case 0:\n      gFinalSpace = &dng_space_sRGB::Get ();\n      break;\n    case 1:\n      gFinalSpace = &dng_space_AdobeRGB::Get ();\n      break;\n    case 2:\n      gFinalSpace = &dng_space_ProPhoto::Get ();\n      break;\n    case 3:\n      gFinalSpace = &dng_space_ColorMatch::Get ();\n      break;\n    case 4:\n      gFinalSpace = &dng_space_GrayGamma18::Get ();\n      break;\n    case 5:\n      gFinalSpace = &dng_space_GrayGamma22::Get ();\n      break;\n    default:\n      gFinalSpace = &dng_space_sRGB::Get ();\n      break;\n  }\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n  std::string restData = provider.ConsumeRemainingBytesAsString();\n  if (restData.size() > 0) {\n    FILE *fp = fopen(filename, \"wb\");\n    if (!fp) {\n        return 0;\n    }\n    fwrite(restData.c_str(), restData.size(), 1, fp);\n    fclose(fp);\n\n    // Target\n    dng_validate(filename);\n\n    // cleanup file\n    unlink(filename);\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/dng_sdk/project.yaml",
    "content": "homepage: \"https://android.googlesource.com/platform/external/dng_sdk/\"\nlanguage: c++\nprimary_contact: \"adaubert@google.com\"\nauto_ccs:\n  - david@adalogics.com\nmain_repo: 'https://android.googlesource.com/platform/external/dng_sdk/'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/dnsmasq/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 git://thekelleys.org.uk/dnsmasq.git dnsmasq    \nWORKDIR dnsmasq\nCOPY build.sh $SRC/\nCOPY fuzz*.c $SRC/\nCOPY fuzz*.cc $SRC/\nCOPY fuzz*.h $SRC/\n\nCOPY fuzz_patch.patch $SRC/\n"
  },
  {
    "path": "projects/dnsmasq/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n#git apply  --ignore-space-change --ignore-whitespace $SRC/fuzz_patch.patch \n\nexport OSS_CFLAGS=\"$CFLAGS -g\"\n\nsed -i 's/CFLAGS        =/CFLAGS        = ${OSS_CFLAGS} /g' ./Makefile\nsed -i 's/LDFLAGS       =/LDFLAGS       = ${OSS_CFLAGS} /g' ./Makefile\n\n# Do some modificatiosn to the source\n#sed -i 's/recvmsg(/fuzz_recvmsg(/g' ./src/dhcp-common.c \n#sed -i 's/recvmsg(/fuzz_recvmsg(/g' ./src/netlink.c \n#sed -i 's/ioctl(/fuzz_ioctl(/g' ./src/dhcp.c\n#sed -i 's/ioctl(/fuzz_ioctl(/g' ./src/network.c\n\n#sed -i 's/if (errno != 0/if (errno == 123123/g' ./src/netlink.c\n\n#echo \"\" >> ./src/dnsmasq.c \n#echo \"ssize_t fuzz_recvmsg(int sockfd, struct msghdr *msg, int flags) {return -1;}\" >> ./src/dnsmasq.c\n#echo \"int fuzz_ioctl(int fd, unsigned long request, void *arg) {return -1;}\" >> ./src/dnsmasq.c\nmake\n\n# Remove main function and create an archive\ncd ./src\nsed -i 's/int main (/int main2 (/g' ./dnsmasq.c\n#sed -i 's/fuzz_recvmsg(/fuzz_recvmsg2(/g' ./dnsmasq.c\n#sed -i 's/fuzz_ioctl(/fuzz_ioctl2(/g' ./dnsmasq.c\n\nrm dnsmasq.o\n$CC $CFLAGS -c dnsmasq.c -o dnsmasq.o -I./ -DVERSION=\\'\\\"UNKNOWN\\\"\\' \nar cr libdnsmasq.a *.o\n\nsed -i 's/class/class2/g' ./dnsmasq.h\nsed -i 's/new/new2/g' ./dnsmasq.h\n\n# Build the fuzzers\n$CXX $CXXFLAGS -c $SRC/fuzz_util.cc -I./ -I$SRC/ -DVERSION=\\'\\\"UNKNOWN\\\"\\' -g\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./fuzz_util.o libdnsmasq.a -o $OUT/fuzz_util\n"
  },
  {
    "path": "projects/dnsmasq/fuzz_auth.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"fuzz_header.h\"\n\n/* \n * Targets answer_auth\n */\nvoid FuzzAuth(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n  \n  int i1 = get_int(&data, &size);\n  int i2 = get_int(&data, &size);\n  int i3 = get_int(&data, &size);\n\n  if (size > (sizeof(struct dns_header) +50)) {\n    char *new_data = malloc(size+1);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    new_data[size] = '\\0';\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    time_t now;\n\t\tunion mysockaddr peer_addr;\n\t\tanswer_auth((struct dns_header *)new_data, new_data + size, size, now, &peer_addr, i1, i2, i3);\n  }\n}\n\n/*\n * Fuzzer entrypoint.\n */ \nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  daemon = NULL;\n  if (size < 1) {\n    return 0;\n  }\n\n  // Initialize mini garbage collector\n  gb_init();\n\n  // Get a value we can use to decide which target to hit.\n  int i = (int)data[0];\n  data += 1;\n  size -= 1;\n\n  int succ = init_daemon(&data, &size);\n\n  if (succ == 0) {\n    cache_init();\n    blockdata_init();\n\n\t\tFuzzAuth(&data, &size);\n\n    cache_start_insert();\n    fuzz_blockdata_cleanup();\n  }\n\n  // Free data in mini garbage collector.\n  gb_cleanup();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/dnsmasq/fuzz_dhcp.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"fuzz_header.h\"\n\n/* \n * Targets answer_auth\n */\nvoid FuzzDhcp(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n  time_t now;\n  int pxe_fd = 0;\n\n  struct iovec *dhpa = malloc(sizeof(struct iovec));\n  if (dhpa == NULL) return;\n\n  char *content = malloc(sizeof(struct dhcp_packet));\n  if (content == NULL) {\n    free(dhpa);\n    return;\n  }\n  \n  dhpa->iov_base = content;\n  dhpa->iov_len = sizeof(struct dhcp_packet);\n\n  daemon->dhcp_packet = *dhpa;\n\n  syscall_data = data;\n  syscall_size = size;\n  \n  dhcp_packet(now, pxe_fd);\n\n  // dnsmasq may change the iov_base if the buffer needs expansion.\n  // Do not free in that case, only free if the buffer stays that same.\n  free(daemon->dhcp_packet.iov_base);\n  free(dhpa);\n}\n\n/*\n * Fuzzer entrypoint.\n */ \nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  daemon = NULL;\n  if (size < 1) {\n    return 0;\n  }\n\n  // Initialize mini garbage collector\n  gb_init();\n\n  // Get a value we can use to decide which target to hit.\n  int i = (int)data[0];\n  data += 1;\n  size -= 1;\n\n  int succ = init_daemon(&data, &size);\n\n  if (succ == 0) {\n    cache_init();\n    blockdata_init();\n\n\t\tFuzzDhcp(&data, &size);\n\n    cache_start_insert();\n    fuzz_blockdata_cleanup();\n  }\n\n  // Free data in mini garbage collector.\n  gb_cleanup();\n  return 0;\n}\n"
  },
  {
    "path": "projects/dnsmasq/fuzz_dhcp6.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"fuzz_header.h\"\n\n/* \n * Targets answer_auth\n */\n  static int val213 = 0;\nvoid FuzzDhcp(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n  \n\n  time_t now;\n  int pxe_fd = 0;\n\n  struct iovec *dhpa = malloc(sizeof(struct iovec));\n  if (dhpa == NULL) return;\n\n  char *content = malloc(300);\n  if (content == NULL) {\n    free(dhpa);\n    return;\n  }\n  \n  dhpa->iov_base = content;\n  dhpa->iov_len = 300;\n\n  daemon->dhcp_packet = *dhpa;\n\n  syscall_data = data;\n  syscall_size = size;\n\n  dhcp6_packet(now);\n\n  free(dhpa);\n  free(content);\n}\n\n/*\n * Fuzzer entrypoint.\n */ \nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  daemon = NULL;\n  if (size < 1) {\n    return 0;\n  }\n\n  // Initialize mini garbage collector\n  gb_init();\n\n  // Get a value we can use to decide which target to hit.\n  int i = (int)data[0];\n  data += 1;\n  size -= 1;\n\n  int succ = init_daemon(&data, &size);\n\n  if (succ == 0) {\n    cache_init();\n    blockdata_init();\n\n\t\tFuzzDhcp(&data, &size);\n\n    cache_start_insert();\n    fuzz_blockdata_cleanup();\n  }\n\n  // Free data in mini garbage collector.\n  gb_cleanup();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/dnsmasq/fuzz_header.h",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"dnsmasq.h\"\n\nextern void fuzz_blockdata_cleanup();\n\n// Simple garbage collector \n#define GB_SIZE 100\n\nvoid *pointer_arr[GB_SIZE];\nstatic int pointer_idx = 0;\n\n// If the garbage collector is used then this must be called as first thing\n// during a fuzz run.\nvoid gb_init() {\n  pointer_idx = 0;\n\n   for (int i = 0; i < GB_SIZE; i++) {\n     pointer_arr[i] = NULL;\n   }\n}\n\nvoid gb_cleanup() {\n  for(int i = 0; i < GB_SIZE; i++) {\n    if (pointer_arr[i] != NULL) {\n      free(pointer_arr[i]);\n    }\n  }\n}\n\nchar *get_len_null_terminated(const uint8_t **data, size_t *size, size_t to_get) {\n  if (*size < to_get || (int)*size < 0) {\n    return NULL;\n  }\n\n  char *new_s = malloc(to_get + 1);\n  memcpy(new_s, *data, to_get);\n  new_s[to_get] = '\\0';\n\n  *data = *data+to_get;\n  *size -= to_get;\n  return new_s;\n}\n\nchar *get_null_terminated(const uint8_t **data, size_t *size) {\n#define STR_SIZE 75\n  return get_len_null_terminated(data, size, STR_SIZE);\n}\n\nchar *gb_get_random_data(const uint8_t **data, size_t *size, size_t to_get) {\n  if (*size < to_get || (int)*size < 0) {\n    return NULL;\n  }\n\n  char *new_s = malloc(to_get);\n  memcpy(new_s, *data, to_get);\n\n  pointer_arr[pointer_idx++] = (void*)new_s;\n  \n  *data = *data + to_get;\n  *size -= to_get;\n\n  return new_s;\n}\n\nchar *gb_get_null_terminated(const uint8_t **data, size_t *size) {\n\n  char *nstr = get_null_terminated(data, size);\n  if (nstr == NULL) {\n    return NULL;\n  }\n  pointer_arr[pointer_idx++] = (void*)nstr;\n  return nstr;\n}\n\nchar *gb_get_len_null_terminated(const uint8_t **data, size_t *size, size_t to_get) {\n\n  char *nstr = get_len_null_terminated(data, size, to_get);\n  if (nstr != NULL) {\n    pointer_arr[pointer_idx++] = (void*)nstr;\n  }\n  return nstr;\n}\n\nchar *gb_alloc_data(size_t len) {\n  char *ptr = calloc(1, len);\n  pointer_arr[pointer_idx++] = (void*)ptr;\n  \n  return ptr;\n}\n\nshort get_short(const uint8_t **data, size_t *size) {\n  if (*size <= 0) return 0;\n  short c = (short)(*data)[0];\n  *data += 1;\n  *size-=1;\n  return c;\n}\n\nint get_int(const uint8_t **data, size_t *size) {\n  if (*size <= 4) return 0;\n  const uint8_t *ptr = *data;\n  int val = *((int*)ptr);\n  *data += 4;\n  *size -= 4;\n  return val;\n}\n// end simple garbage collector.\n\nconst uint8_t *syscall_data = NULL;\nsize_t syscall_size = 0;\n\n\nint fuzz_ioctl(int fd, unsigned long request, void *arg) {\n  int fd2 = fd;\n  unsigned long request2 = request;\n  void *arg_ptr = arg;\n\n  // SIOCGSTAMP\n  if (request == SIOCGSTAMP) {\n    struct timeval *tv = (struct timeval*)arg_ptr;\n    if (tv == NULL) {\n      return 0;\n    }\n\n    char *rand_tv = gb_get_random_data(&syscall_data, &syscall_size, sizeof(struct timeval));\n    if (rand_tv == NULL) {\n      return -1;\n    }\n\n    memcpy(tv, rand_tv, sizeof(struct timeval));\n    return 0;\n  }\n\n  if (request == SIOCGIFNAME) {\n    //printf(\"We got a SIOCGIFNAME\\n\");\n    struct ifreq *ifr = (struct ifreq*)arg_ptr;\n    if (ifr == NULL) {\n      return -1;\n    }\n    for (int i = 0; i < IF_NAMESIZE; i++) {\n      if (syscall_size > 0 && syscall_data != NULL) {\n        ifr->ifr_name[i] = (char)*syscall_data;\n        syscall_data += 1;\n        syscall_size -= 1;\n      }\n      else {\n        ifr->ifr_name[i] = 'A';\n      }\n    }\n    ifr->ifr_name[IF_NAMESIZE-1] = '\\0';\n    return 0;\n    //return -1;\n  }\n  if (request == SIOCGIFFLAGS) {\n    return 0;\n  }\n  if (request == SIOCGIFADDR) {\n    return 0;\n  }\n\n  // \n  int retval = ioctl(fd2, request2, arg_ptr); \n  return retval;\n}\n\n\n// Sysytem call wrappers\nstatic char v = 0;\nssize_t fuzz_recvmsg(int sockfd, struct msghdr *msg, int flags) {\n  \n  struct iovec *target = msg->msg_iov;\n\n  //printf(\"recvmsg 1 \\n\");\n  if (syscall_size > 1) {\n    char r = *syscall_data;\n    syscall_data += 1;\n    syscall_size -= 1;\n\n    if (r == 12) {\n      //printf(\"recvmsg 2\\n\");\n      return -1;\n    }\n  }\n\n  int j = 0;\n  if (msg->msg_control != NULL) {\n    for (;j < CMSG_SPACE(sizeof(struct in_pktinfo)); j++)\n    {\n      if (syscall_size > 0 && syscall_data != NULL) {\n        ((char*)msg->msg_control)[j] = *syscall_data;\n        syscall_data += 1;\n        syscall_size -= 1;\n      }\n      else {\n        ((char*)msg->msg_control)[j] = 'A';\n      }\n    }\n  }\n\n  int i = 0;\n  for (; i < target->iov_len; i++) {\n    if (syscall_size > 0 && syscall_data != NULL) {\n      ((char*)target->iov_base)[i] = *syscall_data;\n      syscall_data += 1;\n      syscall_size -= 1;\n    }\n    else {\n      ((char*)target->iov_base)[i] = 'A';\n    }\n  }\n\n  if (msg->msg_namelen > 0) {\n    memset(msg->msg_name, 0, msg->msg_namelen);\n  }\n\n  return i;\n}\n\n\n// dnsmasq specific stuff\nint init_daemon(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  int retval = 0;\n\n#define CLEAN_IF_NULL(arg) if (arg == NULL) goto cleanup;\n\n  // Initialize daemon\n  daemon = (struct daemon*)gb_alloc_data(sizeof(struct daemon));\n  CLEAN_IF_NULL(daemon)\n\n  // daemon misc\n  daemon->max_ttl = get_int(&data, &size);\n  daemon->neg_ttl = get_int(&data, &size);\n  daemon->local_ttl = get_int(&data, &size);\n  daemon->min_cache_ttl = get_int(&data, &size);\n\n  // daemon->namebuff.\n  char *daemon_namebuff = gb_get_len_null_terminated(&data, &size, MAXDNAME);\n  daemon->namebuff = daemon_namebuff;\n\n  // daemon->naptr\n  struct naptr *naptr_ptr = (struct naptr*)gb_alloc_data(sizeof(struct naptr));\n  char *naptr_name = gb_get_null_terminated(&data, &size);\n  char *naptr_replace = gb_get_null_terminated(&data, &size);\n  char *naptr_regexp = gb_get_null_terminated(&data, &size);\n  char *naptr_services = gb_get_null_terminated(&data, &size);\n  char *naptr_flags = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(naptr_ptr)\n  CLEAN_IF_NULL(naptr_name)\n  CLEAN_IF_NULL(naptr_replace)\n  CLEAN_IF_NULL(naptr_regexp)\n  CLEAN_IF_NULL(naptr_services)\n  CLEAN_IF_NULL(naptr_flags)\n\n  naptr_ptr->name = naptr_name;\n  naptr_ptr->replace = naptr_replace;\n  naptr_ptr->regexp = naptr_regexp;\n  naptr_ptr->services = naptr_services;\n  naptr_ptr->flags = naptr_flags;\n\n  daemon->naptr = naptr_ptr;\n\n  // daemon->int_names\n  struct interface_name *int_namses = (struct interface_name*)gb_alloc_data(sizeof(struct interface_name));\n\n  char *int_name = gb_get_null_terminated(&data, &size);\n  char *int_intr = gb_get_null_terminated(&data, &size);\n  CLEAN_IF_NULL(int_namses)\n  CLEAN_IF_NULL(int_name)\n  CLEAN_IF_NULL(int_intr)\n  int_namses->name = int_name;\n  int_namses->intr = int_intr;\n\n  struct addrlist *d_addrlist = (struct addrlist*)gb_alloc_data(sizeof(struct addrlist));\n  CLEAN_IF_NULL(d_addrlist)\n  d_addrlist->flags = get_int(&data, &size);\n  d_addrlist->prefixlen = get_int(&data, &size);\n  int_namses->addr = d_addrlist;\n\n  daemon->int_names = int_namses;\n\n  if (size > *size2) {\n    goto cleanup;\n  }\n\n  // daemon->addrbuf\n  char *adbuf = gb_alloc_data(200);\n  CLEAN_IF_NULL(adbuf)\n  daemon->addrbuff = adbuf;\n\n  // daemon->auth_zones\n  struct auth_zone *d_az = (struct auth_zone*)gb_alloc_data(sizeof(struct auth_zone));\n  char *auth_domain = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(d_az)\n  CLEAN_IF_NULL(auth_domain)\n  d_az->domain = auth_domain;\n  daemon->auth_zones = d_az;\n\n  // deamon->mxnames\n  struct mx_srv_record *mx_srv_rec = (struct mx_srv_record*)gb_alloc_data(sizeof(struct mx_srv_record));\n  char *mx_name = gb_get_null_terminated(&data, &size);\n  char *mx_target = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(mx_srv_rec)\n  CLEAN_IF_NULL(mx_target)\n  CLEAN_IF_NULL(mx_name)\n\n  mx_srv_rec->next = daemon->mxnames;\n  daemon->mxnames = mx_srv_rec;\n  mx_srv_rec->name = mx_name;\n  mx_srv_rec->target = mx_target;\n  mx_srv_rec->issrv = get_int(&data, &size);\n  mx_srv_rec->weight = get_int(&data, &size);\n  mx_srv_rec->priority = get_int(&data, &size);\n  mx_srv_rec->srvport = get_int(&data, &size);\n  //data += 40;\n  //size -= 40;\n\n  if (size > *size2) {\n    goto cleanup;\n  }\n\n  // daemon->txt\n  struct txt_record *txt_record = (struct txt_record *)gb_alloc_data(sizeof(struct txt_record));\n  char *txt_record_name =  gb_get_null_terminated(&data, &size);\n  char *txt_record_txt = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(txt_record)\n  CLEAN_IF_NULL(txt_record_name)\n  CLEAN_IF_NULL(txt_record_txt)\n\n  txt_record->name = txt_record_name;\n  txt_record->txt = (unsigned char*)txt_record_txt;\n  txt_record->class2 = (get_short(&data, &size) % 10);\n  daemon->txt = txt_record;\n\n  // daemon->rr\n  struct txt_record *rr_record = (struct txt_record *)gb_alloc_data(sizeof(struct txt_record));\n  char *rr_record_name =  gb_get_null_terminated(&data, &size);\n  char *rr_record_txt = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(rr_record)\n  CLEAN_IF_NULL(rr_record_name)\n  CLEAN_IF_NULL(rr_record_txt)\n\n  rr_record->name = rr_record_name;\n  rr_record->txt = (unsigned char*)rr_record_txt;\n  rr_record->class2 = (get_short(&data, &size) % 10);\n  daemon->rr = rr_record;\n\n  if (size > *size2) {\n    goto cleanup;\n  }\n\n  // daemon->relay4\n  //struct dhcp_relay *dr = (struct dhcp_relay*)gb_alloc_data(sizeof(struct dhcp_relay));\n  struct dhcp_relay *dr = (struct dhcp_relay*)gb_get_random_data(&data, &size, sizeof(struct dhcp_relay));\n  char *dr_interface = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(dr)\n  CLEAN_IF_NULL(dr_interface)\n  dr->interface = dr_interface;\n  dr->next = NULL;\n  //dr->current = NULL;\n  daemon->relay4 = dr;\n\n  // deamon->bridges\n  struct dhcp_bridge *db = (struct dhcp_bridge*)gb_alloc_data(sizeof(struct dhcp_bridge));\n  char *db_interface = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(db)\n  CLEAN_IF_NULL(db_interface)\n\n  if (strlen(db_interface) > IF_NAMESIZE) {\n    for (int i = 0; i < IF_NAMESIZE; i++) {\n      db->iface[i] = db_interface[i];\n    }\n  } else {\n    for (int i = 0; i < strlen(db_interface); i++) {\n      db->iface[i] = db_interface[i];\n    }\n  }\n\n\n  struct dhcp_bridge *db_alias = (struct dhcp_bridge*)gb_alloc_data(sizeof(struct dhcp_bridge));\n  //struct dhcp_bridge *db_alias = (struct dhcp_bridge*)gb_get_random_data(&data, &size, sizeof(struct dhcp_bridge));\n  char *db_alias_interface = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(db_alias)\n  CLEAN_IF_NULL(db_alias_interface)\n\n  if (strlen(db_alias_interface) > IF_NAMESIZE) {\n    for (int i = 0; i < IF_NAMESIZE; i++) {\n      db_alias->iface[i] = db_alias_interface[i];\n    }\n  } else {\n    for (int i = 0; i < strlen(db_alias_interface); i++) {\n      db_alias->iface[i] = db_alias_interface[i];\n    }\n  }\n  db->alias = db_alias;\n  daemon->bridges = db;\n\n  // daemon->if_names\n  struct iname *in = (struct iname*)gb_get_random_data(&data, &size, sizeof(struct iname));\n  char *iname_name = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(in)\n  CLEAN_IF_NULL(iname_name)\n\n  in->name = iname_name;\n  in->next = NULL;\n\n  daemon->if_names = in;\n\n  // daemon->if_addrs\n  struct iname *in_addr = (struct iname*)gb_get_random_data(&data, &size, sizeof(struct iname));\n  char *iname_name_addr = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(in_addr)\n  CLEAN_IF_NULL(iname_name_addr)\n\n  in_addr->name = iname_name_addr;\n  in_addr->next = NULL;\n\n  daemon->if_addrs = in_addr;\n\n  // daemon->if_except\n  struct iname *in_except = (struct iname*)gb_get_random_data(&data, &size, sizeof(struct iname));\n  char *iname_name_except = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(in_except)\n  CLEAN_IF_NULL(iname_name_except)\n\n  in_except->name = iname_name_except;\n  in_except->next = NULL;\n\n  daemon->if_except = in_except;\n\n  // daemon->dhcp_except\n  struct iname *except = (struct iname*)gb_get_random_data(&data, &size, sizeof(struct iname));\n  char *name_except = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(except)\n  CLEAN_IF_NULL(name_except)\n\n  except->name = name_except;\n  except->next = NULL;\n\n  daemon->dhcp_except = except;\n\n  // daemon->authinterface\n  struct iname *auth_interface = (struct iname*)gb_get_random_data(&data, &size, sizeof(struct iname));\n  char *auth_name = gb_get_null_terminated(&data, &size);\n  \n  CLEAN_IF_NULL(auth_interface)\n  CLEAN_IF_NULL(auth_name)\n\n  auth_interface->name = auth_name;\n  auth_interface->next = NULL;\n\n  daemon->authinterface = auth_interface;\n\n\n  // daemon->cnames\n  struct cname *cn = (struct cname*)gb_alloc_data(sizeof(struct cname));\n  char *cname_alias = gb_get_null_terminated(&data, &size);\n  char *cname_target = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(cn)\n  CLEAN_IF_NULL(cname_alias)\n  CLEAN_IF_NULL(cname_target)\n\n  cn->alias = cname_alias;\n  cn->target = cname_target;\n  daemon->cnames = cn;\n\n\n  // daemon->ptr\n  struct ptr_record *ptr = (struct ptr_record *)gb_alloc_data(sizeof(struct ptr_record));\n  CLEAN_IF_NULL(ptr)\n\n  char *ptr_name = gb_get_null_terminated(&data, &size);\n  CLEAN_IF_NULL(ptr_name)\n  ptr->name = ptr_name;\n  daemon->ptr = ptr;\n\n  if (size > *size2) {\n    goto cleanup;\n  }\n\n  // daemon->dhcp\n  struct dhcp_context *dhcp_c = (struct dhcp_context *) gb_get_random_data(&data, &size, sizeof(struct dhcp_context));\n  \n  char *dhcp_c_temp_in = gb_get_null_terminated(&data, &size);\n\n  struct dhcp_netid *dhcp_c_netid = (struct dhcp_netid *) gb_alloc_data(sizeof(struct dhcp_netid));\n  char *dhcp_netid_net = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(dhcp_c)\n  CLEAN_IF_NULL(dhcp_c_temp_in)\n  CLEAN_IF_NULL(dhcp_c_netid)\n  CLEAN_IF_NULL(dhcp_netid_net)\n\n  dhcp_c->next = NULL;\n  dhcp_c->current = NULL;\n  dhcp_c_netid->net = dhcp_netid_net;\n  dhcp_c->filter = dhcp_c_netid;\n  dhcp_c->template_interface = dhcp_c_temp_in;\n\n  daemon->dhcp = dhcp_c;\n\n\n  // daemon->dhcp6\n  struct dhcp_context *dhcp6_c = (struct dhcp_context *) gb_get_random_data(&data, &size, sizeof(struct dhcp_context));\n  \n  char *dhcp6_c_temp_in = gb_get_null_terminated(&data, &size);\n\n  struct dhcp_netid *dhcp6_c_netid = (struct dhcp_netid *) gb_alloc_data(sizeof(struct dhcp_netid));\n  char *dhcp6_netid_net = gb_get_null_terminated(&data, &size);\n\n  CLEAN_IF_NULL(dhcp6_c)\n  CLEAN_IF_NULL(dhcp6_c_temp_in)\n  CLEAN_IF_NULL(dhcp6_c_netid)\n  CLEAN_IF_NULL(dhcp6_netid_net)\n\n  dhcp6_c->next = NULL;\n  dhcp6_c->current = NULL;\n  dhcp6_c_netid->net = dhcp6_netid_net;\n  dhcp6_c->filter = dhcp6_c_netid;\n  dhcp6_c->template_interface = dhcp6_c_temp_in;\n\n  daemon->dhcp6 = dhcp6_c;\n\n  // daemon->doing_dhcp6\n  daemon->doing_dhcp6 = 1;\n\n  // daemon->dhcp_buffs\n  char *dhcp_buff = gb_alloc_data(DHCP_BUFF_SZ);\n  char *dhcp_buff2 = gb_alloc_data(DHCP_BUFF_SZ);\n  char *dhcp_buff3 = gb_alloc_data(DHCP_BUFF_SZ);\n\n  CLEAN_IF_NULL(dhcp_buff)\n  CLEAN_IF_NULL(dhcp_buff2)\n  CLEAN_IF_NULL(dhcp_buff3)\n\n  daemon->dhcp_buff = dhcp_buff;\n  daemon->dhcp_buff2 = dhcp_buff2;\n  daemon->dhcp_buff3 = dhcp_buff3;\n\n\n\n  // daemon->ignore_addr\n  struct bogus_addr *bb = (struct bogus_addr *)gb_alloc_data(sizeof(struct bogus_addr));\n  CLEAN_IF_NULL(bb)\n\n  daemon->ignore_addr = bb;\n\n  // daemon->doctors\n  if (size > *size2) {\n    goto cleanup;\n  }\n\n  struct doctor *doctors = (struct doctor *)gb_alloc_data(sizeof(struct doctor));\n  CLEAN_IF_NULL(doctors)\n\n  doctors->next = NULL;\n  daemon->doctors = doctors;\n\n  retval = 0;\n  goto ret;\ncleanup:\n  retval = -1;\n\nret:\n  return retval;\n}\n"
  },
  {
    "path": "projects/dnsmasq/fuzz_patch.patch",
    "content": "diff --git a/Makefile b/Makefile\nindex a503c82..331ee3b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -24,8 +24,8 @@ MANDIR        = $(PREFIX)/share/man\n LOCALEDIR     = $(PREFIX)/share/locale\n BUILDDIR      = $(SRC)\n DESTDIR       = \n-CFLAGS        = -Wall -W -O2\n-LDFLAGS       = \n+#CFLAGS        = -Wall -W -O2\n+LDFLAGS       = $(CFLAGS)\n COPTS         = \n RPM_OPT_FLAGS = \n LIBS          = \n"
  },
  {
    "path": "projects/dnsmasq/fuzz_rfc1035.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"fuzz_header.h\"\n\n/*\n *  Targets \"extract_addresses\"\n */\nvoid FuzzExtractTheAddress(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  char *new_name = NULL;\n  new_name = get_len_null_terminated(&data, &size, MAXDNAME);\n  pointer_arr[pointer_idx++] = (void*)new_name;\n\n  int is_sign = get_int(&data, &size);\n  int check_rebind = get_int(&data, &size);\n  int secure =  get_int(&data, &size);\n\n  if (size > (sizeof(struct dns_header) +50)) {\n    char *new_data = malloc(size);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    pointer_arr[pointer_idx++] = (void*)new_data;\n    \n    time_t now; \n    int doctored = 0;\n    extract_addresses((struct dns_header *)new_data, size, new_name, now, NULL, NULL, is_sign, check_rebind, 0, secure, &doctored);\n  }\n}\n\n\n/*\n * Targets \"answer_request\"\n */\nvoid FuzzAnswerTheRequest(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  struct in_addr local_addr;\n  struct in_addr local_netmask;\n  time_t now;\n\n  int i1 = get_int(&data, &size);\n  int i2 = get_int(&data, &size);\n  int i3 = get_int(&data, &size);\n\n  if (size > (sizeof(struct dns_header) +50)) {\n    char *new_data = malloc(size);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    answer_request((struct dns_header *)new_data, new_data+size, size, local_addr, local_netmask, now, i1, i2, i3);\n  }\n\n}\n\n/*\n * Targets \"check_for_ignored_address\"\n */\nvoid FuzzIgnoredAddress(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  if (size > (sizeof(struct dns_header) +50)) {\n    //return 0;\n    char *new_data = malloc(size);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    check_for_ignored_address((struct dns_header *)new_data, size);\n  }\n}\n\n/*\n * Targets \"check_for_local_domain\"\n */\nvoid FuzzCheckLocalDomain(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  \n    char *new_data = malloc(size+1);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    new_data[size] = '\\0';\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    time_t now;\n    check_for_local_domain(new_data, now);\n}\n\n/*\n * Targets \"extract_request\"\n */\nvoid FuzzExtractRequest(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  char *new_name = NULL;\n  new_name = get_len_null_terminated(&data, &size, MAXDNAME);\n\n  if (new_name == NULL) {\n    return ;\n  }\n  pointer_arr[pointer_idx++] = (void*)new_name;\n\n  if (size > (sizeof(struct dns_header) +50)) {\n    char *new_data = malloc(size+1);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    new_data[size] = '\\0';\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    unsigned short typeb;\n    extract_request((struct dns_header *)new_data, size, new_name, &typeb);\n  }\n}\n\n\n/*\n * Targets \"in_arpa_name_2_addr\"\n */\nvoid FuzzArpaName2Addr(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  char *new_name = NULL;\n  new_name = get_null_terminated(&data, &size);\n\n  if (new_name == NULL) {\n    return ;\n  }\n  pointer_arr[pointer_idx++] = (void*)new_name;\n  union all_addr addr;\n  in_arpa_name_2_addr(new_name, &addr);\n  return;\n}\n\nvoid FuzzResizePacket(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n\n  char *new_packet = malloc(50);\n\n  if (size > (sizeof(struct dns_header) + 50)) {\n    char *new_data = malloc(size+1);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    new_data[size] = '\\0';\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    resize_packet((struct dns_header *)new_data, size, (unsigned char*)new_packet, 50);    \n  }\n  free(new_packet);\n}\n\nvoid FuzzSetupReply(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n  \n  if (size > (sizeof(struct dns_header) + 50)) {\n    char *new_data = malloc(size+1);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    new_data[size] = '\\0';\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    setup_reply((struct dns_header *)new_data, 0, 0);\n  }\n}\n\n\nvoid FuzzCheckForBogusWildcard(const uint8_t **data2, size_t *size2) {\n  const uint8_t *data = *data2;\n  size_t size = *size2;\n  \n  char *nname = gb_get_len_null_terminated(&data, &size, MAXDNAME);\n  if (nname == NULL) {\n    return;\n  }\n\n\n  if (size > (sizeof(struct dns_header) + 50)) {\n    char *new_data = malloc(size+1);\n    memset(new_data, 0, size);\n    memcpy(new_data, data, size);\n    new_data[size] = '\\0';\n    pointer_arr[pointer_idx++] = (void*)new_data;\n\n    time_t now;\n    check_for_bogus_wildcard((struct dns_header *)new_data, size, nname, now);\n  }\n}\n\n\n/*\n * Fuzzer entrypoint.\n */ \n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  daemon = NULL;\n  //printf(\"Running fuzzer\\n\");\n  if (size < 1) {\n    return 0;\n  }\n\n  // Initialize mini garbage collector\n  gb_init();\n\n  // Get a value we can use to decide which target to hit.\n  int i = (int)data[0];\n  data += 1;\n  size -= 1;\n\n  int succ = init_daemon(&data, &size);\n\n  if (succ == 0) {\n    cache_init();\n    blockdata_init();\n\n    //i = 7;\n#define TS 9\n    if ((i % TS) == 0) {\n      FuzzExtractTheAddress(&data,&size);\n    }\n    else if ((i % TS) == 1) {\n      FuzzAnswerTheRequest(&data,&size);\n    }\n    else if ((i % TS) == 2) {\n      FuzzCheckLocalDomain(&data, &size);\n    }\n    else if ((i % TS) == 3) {\n      FuzzExtractRequest(&data, &size);\n    }\n    else if ((i % TS) == 4) {\n      FuzzArpaName2Addr(&data, &size);\n    }\n    else if ((i %TS) == 5) {\n      FuzzResizePacket(&data, &size);\n    }\n    else if ((i %TS) == 6) {\n      FuzzSetupReply(&data, &size);\n    }\n    else if ((i % TS) == 7) {\n      FuzzCheckForBogusWildcard(&data, &size);\n    }\n    else {\n      FuzzIgnoredAddress(&data, &size);\n    } \n    cache_start_insert();\n    fuzz_blockdata_cleanup();\n  }\n\n  // Free data in mini garbage collector.\n  gb_cleanup();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/dnsmasq/fuzz_util.cc",
    "content": "/* Copyright 2026 Google LLC\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n      http://www.apache.org/licenses/LICENSE-2.0\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\nextern \"C\" {\r\n#include \"dnsmasq.h\"\r\n}\r\n\r\n#include <fuzzer/FuzzedDataProvider.h>\r\n#include <cstdlib>\r\n#include <cstring>\r\n#include <string>\r\n#include <vector>\r\n\r\n#define STR_SIZE 75\r\n\r\nstatic int init_daemon(FuzzedDataProvider &provider,\r\n                       std::vector<void *> &allocs,\r\n                       std::vector<std::string> &strings) {\r\n  auto alloc = [&](size_t sz) -> void * {\r\n    void *p = calloc(1, sz);\r\n    if (p) allocs.push_back(p);\r\n    return p;\r\n  };\r\n\r\n  auto make_string = [&](size_t max_len) -> char * {\r\n    strings.push_back(provider.ConsumeRandomLengthString(max_len));\r\n    return strings.back().data();\r\n  };\r\n\r\n  // Allocate daemon separately (not via alloc) so it can be freed last.\r\n  // dnsmasq's free_real() dereferences daemon for metrics tracking.\r\n  daemon = (struct daemon *)calloc(1, sizeof(struct daemon));\r\n  if (!daemon) return -1;\r\n\r\n  daemon->max_ttl = provider.ConsumeIntegral<int>();\r\n  daemon->neg_ttl = provider.ConsumeIntegral<int>();\r\n  daemon->local_ttl = provider.ConsumeIntegral<int>();\r\n  daemon->min_cache_ttl = provider.ConsumeIntegral<int>();\r\n\r\n  daemon->namebuff = make_string(MAXDNAME);\r\n\r\n  // daemon->naptr\r\n  struct naptr *naptr_ptr = (struct naptr *)alloc(sizeof(struct naptr));\r\n  if (!naptr_ptr) return -1;\r\n  naptr_ptr->name = make_string(STR_SIZE);\r\n  naptr_ptr->replace = make_string(STR_SIZE);\r\n  naptr_ptr->regexp = make_string(STR_SIZE);\r\n  naptr_ptr->services = make_string(STR_SIZE);\r\n  naptr_ptr->flags = make_string(STR_SIZE);\r\n  daemon->naptr = naptr_ptr;\r\n\r\n  // daemon->int_names\r\n  struct interface_name *int_namses =\r\n      (struct interface_name *)alloc(sizeof(struct interface_name));\r\n  if (!int_namses) return -1;\r\n  int_namses->name = make_string(STR_SIZE);\r\n  int_namses->intr = make_string(STR_SIZE);\r\n\r\n  struct addrlist *d_addrlist = (struct addrlist *)alloc(sizeof(struct addrlist));\r\n  if (!d_addrlist) return -1;\r\n  d_addrlist->flags = provider.ConsumeIntegral<int>();\r\n  d_addrlist->prefixlen = provider.ConsumeIntegral<int>();\r\n  int_namses->addr = d_addrlist;\r\n  daemon->int_names = int_namses;\r\n\r\n  // daemon->addrbuf\r\n  char *adbuf = (char *)alloc(200);\r\n  if (!adbuf) return -1;\r\n  daemon->addrbuff = adbuf;\r\n\r\n  // daemon->auth_zones\r\n  struct auth_zone *d_az = (struct auth_zone *)alloc(sizeof(struct auth_zone));\r\n  if (!d_az) return -1;\r\n  d_az->domain = make_string(STR_SIZE);\r\n  daemon->auth_zones = d_az;\r\n\r\n  // daemon->mxnames\r\n  struct mx_srv_record *mx_srv_rec =\r\n      (struct mx_srv_record *)alloc(sizeof(struct mx_srv_record));\r\n  if (!mx_srv_rec) return -1;\r\n  mx_srv_rec->next = daemon->mxnames;\r\n  daemon->mxnames = mx_srv_rec;\r\n  mx_srv_rec->name = make_string(STR_SIZE);\r\n  mx_srv_rec->target = make_string(STR_SIZE);\r\n  mx_srv_rec->issrv = provider.ConsumeIntegral<int>();\r\n  mx_srv_rec->weight = provider.ConsumeIntegral<int>();\r\n  mx_srv_rec->priority = provider.ConsumeIntegral<int>();\r\n  mx_srv_rec->srvport = provider.ConsumeIntegral<int>();\r\n\r\n  // daemon->txt\r\n  struct txt_record *txt_record =\r\n      (struct txt_record *)alloc(sizeof(struct txt_record));\r\n  if (!txt_record) return -1;\r\n  txt_record->name = make_string(STR_SIZE);\r\n  txt_record->txt = (unsigned char *)make_string(STR_SIZE);\r\n  txt_record->class2 = provider.ConsumeIntegralInRange<short>(0, 9);\r\n  daemon->txt = txt_record;\r\n\r\n  // daemon->rr\r\n  struct txt_record *rr_record =\r\n      (struct txt_record *)alloc(sizeof(struct txt_record));\r\n  if (!rr_record) return -1;\r\n  rr_record->name = make_string(STR_SIZE);\r\n  rr_record->txt = (unsigned char *)make_string(STR_SIZE);\r\n  rr_record->class2 = provider.ConsumeIntegralInRange<short>(0, 9);\r\n  daemon->rr = rr_record;\r\n\r\n  // daemon->relay4\r\n  struct dhcp_relay *dr = (struct dhcp_relay *)alloc(sizeof(struct dhcp_relay));\r\n  if (!dr) return -1;\r\n  dr->interface = make_string(STR_SIZE);\r\n  dr->next = NULL;\r\n  daemon->relay4 = dr;\r\n\r\n  // daemon->bridges\r\n  struct dhcp_bridge *db = (struct dhcp_bridge *)alloc(sizeof(struct dhcp_bridge));\r\n  if (!db) return -1;\r\n  {\r\n    std::string iface_str = provider.ConsumeRandomLengthString(IF_NAMESIZE - 1);\r\n    memcpy(db->iface, iface_str.c_str(), iface_str.size() + 1);\r\n  }\r\n\r\n  struct dhcp_bridge *db_alias =\r\n      (struct dhcp_bridge *)alloc(sizeof(struct dhcp_bridge));\r\n  if (!db_alias) return -1;\r\n  {\r\n    std::string alias_str = provider.ConsumeRandomLengthString(IF_NAMESIZE - 1);\r\n    memcpy(db_alias->iface, alias_str.c_str(), alias_str.size() + 1);\r\n  }\r\n  db->alias = db_alias;\r\n  daemon->bridges = db;\r\n\r\n  // daemon->if_names, if_addrs, if_except, dhcp_except, authinterface\r\n  auto make_iname = [&]() -> struct iname * {\r\n    struct iname *in = (struct iname *)alloc(sizeof(struct iname));\r\n    if (!in) return nullptr;\r\n    in->name = make_string(STR_SIZE);\r\n    in->next = NULL;\r\n    return in;\r\n  };\r\n\r\n  daemon->if_names = make_iname();\r\n  daemon->if_addrs = make_iname();\r\n  daemon->if_except = make_iname();\r\n  daemon->dhcp_except = make_iname();\r\n  daemon->authinterface = make_iname();\r\n  if (!daemon->if_names || !daemon->if_addrs || !daemon->if_except ||\r\n      !daemon->dhcp_except || !daemon->authinterface)\r\n    return -1;\r\n\r\n  // daemon->cnames\r\n  struct cname *cn = (struct cname *)alloc(sizeof(struct cname));\r\n  if (!cn) return -1;\r\n  cn->alias = make_string(STR_SIZE);\r\n  cn->target = make_string(STR_SIZE);\r\n  daemon->cnames = cn;\r\n\r\n  // daemon->ptr\r\n  struct ptr_record *ptr = (struct ptr_record *)alloc(sizeof(struct ptr_record));\r\n  if (!ptr) return -1;\r\n  ptr->name = make_string(STR_SIZE);\r\n  daemon->ptr = ptr;\r\n\r\n  // daemon->dhcp\r\n  struct dhcp_context *dhcp_c =\r\n      (struct dhcp_context *)alloc(sizeof(struct dhcp_context));\r\n  if (!dhcp_c) return -1;\r\n  dhcp_c->next = NULL;\r\n  dhcp_c->current = NULL;\r\n  struct dhcp_netid *dhcp_c_netid =\r\n      (struct dhcp_netid *)alloc(sizeof(struct dhcp_netid));\r\n  if (!dhcp_c_netid) return -1;\r\n  dhcp_c_netid->net = make_string(STR_SIZE);\r\n  dhcp_c->filter = dhcp_c_netid;\r\n  dhcp_c->template_interface = make_string(STR_SIZE);\r\n  daemon->dhcp = dhcp_c;\r\n\r\n  // daemon->dhcp6\r\n  struct dhcp_context *dhcp6_c =\r\n      (struct dhcp_context *)alloc(sizeof(struct dhcp_context));\r\n  if (!dhcp6_c) return -1;\r\n  dhcp6_c->next = NULL;\r\n  dhcp6_c->current = NULL;\r\n  struct dhcp_netid *dhcp6_c_netid =\r\n      (struct dhcp_netid *)alloc(sizeof(struct dhcp_netid));\r\n  if (!dhcp6_c_netid) return -1;\r\n  dhcp6_c_netid->net = make_string(STR_SIZE);\r\n  dhcp6_c->filter = dhcp6_c_netid;\r\n  dhcp6_c->template_interface = make_string(STR_SIZE);\r\n  daemon->dhcp6 = dhcp6_c;\r\n\r\n  daemon->doing_dhcp6 = 1;\r\n\r\n  // daemon->dhcp_buffs\r\n  daemon->dhcp_buff = (char *)alloc(DHCP_BUFF_SZ);\r\n  daemon->dhcp_buff2 = (char *)alloc(DHCP_BUFF_SZ);\r\n  daemon->dhcp_buff3 = (char *)alloc(DHCP_BUFF_SZ);\r\n  if (!daemon->dhcp_buff || !daemon->dhcp_buff2 || !daemon->dhcp_buff3)\r\n    return -1;\r\n\r\n  // daemon->ignore_addr\r\n  struct bogus_addr *bb = (struct bogus_addr *)alloc(sizeof(struct bogus_addr));\r\n  if (!bb) return -1;\r\n  daemon->ignore_addr = bb;\r\n\r\n  // daemon->doctors\r\n  struct doctor *doctors = (struct doctor *)alloc(sizeof(struct doctor));\r\n  if (!doctors) return -1;\r\n  doctors->next = NULL;\r\n  daemon->doctors = doctors;\r\n\r\n  return 0;\r\n}\r\n\r\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\r\n  FuzzedDataProvider provider(data, size);\r\n\r\n  std::vector<void *> allocs;\r\n  std::vector<std::string> strings;\r\n  strings.reserve(40);\r\n\r\n  int succ = init_daemon(provider, allocs, strings);\r\n  if (succ == 0) {\r\n    std::string t1_str = provider.ConsumeRandomLengthString(MAXDNAME);\r\n    std::string t2_str = provider.ConsumeRandomLengthString(MAXDNAME);\r\n    if (t1_str.empty() || t2_str.empty())\r\n      goto cleanup;\r\n\r\n    char *t1 = t1_str.data();\r\n    char *t2 = t2_str.data();\r\n\r\n    // Util logic\r\n    hostname_isequal(t1, t2);\r\n\r\n    legal_hostname(t1);\r\n    char *tmp = canonicalise(t2, NULL);\r\n    if (tmp != NULL) {\r\n      free(tmp);\r\n    }\r\n\r\n    char *tmp_out = (char *)malloc(30);\r\n    if (tmp_out) {\r\n      int mac_type;\r\n      parse_hex(t1, (unsigned char *)tmp_out, 30, NULL, NULL);\r\n      parse_hex(t1, (unsigned char *)tmp_out, 30, NULL, &mac_type);\r\n      free(tmp_out);\r\n    }\r\n\r\n    wildcard_match(t1, t2);\r\n    if (t1_str.size() < t2_str.size()) {\r\n      wildcard_matchn(t1, t2, t1_str.size());\r\n    } else {\r\n      wildcard_matchn(t1, t2, t2_str.size());\r\n    }\r\n    hostname_issubdomain(t1, t2);\r\n\r\n    union all_addr addr1;\r\n    memset(&addr1, 0, sizeof(union all_addr));\r\n    is_name_synthetic(0, t1, &addr1);\r\n  }\r\n\r\ncleanup:\r\n  for (void *p : allocs)\r\n    free(p);\r\n  // Free daemon last since dnsmasq's free_real() dereferences it.\r\n  free(daemon);\r\n  daemon = NULL;\r\n\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "projects/dnsmasq/project.yaml",
    "content": "homepage: \"https://thekelleys.org.uk/dnsmasq/doc.html\"\nlanguage: c\nprimary_contact: \"simon@thekelleys.org.uk\"\nmain_repo: \"git://thekelleys.org.uk/dnsmasq.git\"\nauto_ccs:\n - \"david@adalogics.com\"\n - \"pemensik@redhat.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/dnspython/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/rthalley/dnspython dnspython\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/dnspython\n"
  },
  {
    "path": "projects/dnspython/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/dnspython/fuzz_message.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport dns.message\nimport dns.exception\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    dns.message.from_text(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except dns.exception.DNSException:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/dnspython/fuzz_token.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport dns.tokenizer\nimport dns.exception\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  token = dns.tokenizer.Tokenizer(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  try:\n    list(iter(token))\n  except dns.exception.DNSException:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/dnspython/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/rthalley/dnspython\nlanguage: python\nmain_repo: https://github.com/rthalley/dnspython\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/docker-client/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/spotify/docker-client docker-client\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/docker-client\n"
  },
  {
    "path": "projects/docker-client/RegistryAuthFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.spotify.docker.client.DockerConfigReader;\nimport com.spotify.docker.client.messages.RegistryAuth;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport java.io.IOException;\nimport java.io.PrintWriter;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-6\n// Heuristic name: jvm-autofuzz-heuristics-6\n// Target method: [com.spotify.docker.client.DockerConfigReader] public com.spotify.docker.client.messages.RegistryAuth fromConfig(java.nio.file.Path,java.lang.String) throws java.io.IOException\npublic class RegistryAuthFuzzer {\n  private static File tempDirectory;\n  private static File tempFile;\n  public static void fuzzerInitialize() {\n    try {\n      tempDirectory =\n          Files.createTempDirectory(\"oss-fuzz\").toFile().getAbsoluteFile();\n      tempFile = new File(tempDirectory, \"oss-fuzz-temp\").getAbsoluteFile();\n    } catch (IOException e) {\n      // Known exception\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    tempFile.delete();\n    tempDirectory.delete();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      PrintWriter printWriter = new PrintWriter(new FileWriter(tempFile));\n      printWriter.print(data.consumeString(data.remainingBytes() / 2));\n      printWriter.close();\n    } catch (IOException e) {\n      // Known exception\n    }\n    try {\n      DockerConfigReader obj = new DockerConfigReader();\n      obj.fromConfig(tempFile.toPath(), data.consumeRemainingAsString());\n    } catch (IOException e1) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/docker-client/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True dependency:copy-dependencies \\\n    org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./target/docker-client-$CURRENT_VERSION-shaded.jar\" $OUT/docker-client.jar\nls -d ./target/dependency/slf4j-api-*.jar | head -1 | xargs -I {} cp {} $OUT/slf4j-api.jar\n\nALL_JARS='docker-client.jar slf4j-api.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/docker-client/project.yaml",
    "content": "homepage: https://github.com/spotify/docker-client\nmain_repo: https://github.com/spotify/docker-client\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/docutils/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth=1 https://github.com/jwilk-mirrors/docutils docutils\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/docutils\n"
  },
  {
    "path": "projects/docutils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/docutils/fuzz_rst.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom docutils.parsers.rst import Parser\nfrom docutils.frontend import get_default_settings\nfrom docutils.utils import new_document\nfrom docutils import nodes\nfrom docutils import ApplicationError\nfrom docutils.parsers.rst import tableparser\nfrom docutils.statemachine import StringList, string2lines\nfrom docutils.transforms.universal import (SmartQuotes, TestMessages,\n                                           Decorations, ExposeInternals,\n                                           Messages, FilterMessages,\n                                           StripComments,\n                                           StripClassesAndElements)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  parser = Parser()\n  settings = get_default_settings(Parser)\n  settings.warning_stream = \"\"\n  settings.smart_quotes = fdp.ConsumeBool()\n  settings.trim_footnote_ref_space = fdp.ConsumeBool()\n  settings.report = fdp.ConsumeIntInRange(0, 5)\n\n  doc = new_document(fdp.ConsumeUnicodeNoSurrogates(64), settings.copy())\n  try:\n    parser.parse(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 2048)), doc)\n    if fdp.ConsumeBool():\n      doc.transformer.add_transforms([TestMessages])\n    if fdp.ConsumeBool():\n      doc.transformer.add_transform(SmartQuotes)\n    if fdp.ConsumeBool():\n      doc.transformer.add_transform(Decorations)\n    if fdp.ConsumeBool():\n      doc.transformer.add_transform(ExposeInternals)\n    if fdp.ConsumeBool():\n      doc.transformer.add_transform(Messages)\n    if fdp.ConsumeBool():\n      doc.transformer.add_transform(FilterMessages)\n    if fdp.ConsumeBool():\n      doc.transformer.add_transform(StripComments)\n    if fdp.ConsumeBool():\n      doc.transformer.add_transform(StripClassesAndElements)\n    doc.transformer.apply_transforms()\n    o = doc.pformat()\n\n    visitor = nodes.TreeCopyVisitor(doc)\n    doc.walkabout(visitor)\n    newtree = visitor.get_tree_copy()\n  except ApplicationError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/docutils/fuzz_rst_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom docutils import parsers, frontend, utils, ApplicationError\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    rst_parser_class = parsers.get_parser_class('rst')\n    parser = rst_parser_class()\n    document = utils.new_document(\n        fdp.ConsumeUnicodeNoSurrogates(124),\n        frontend.get_default_settings(parser)\n    )\n    try:\n        parser.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize), document)\n    except ApplicationError:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n\n"
  },
  {
    "path": "projects/docutils/fuzz_table.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom docutils import ApplicationError\nfrom docutils.parsers.rst import tableparser\nfrom docutils.statemachine import StringList, string2lines\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  parser = tableparser.GridTableParser()\n  lines_input = StringList(\n      string2lines(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)), 'fuzz data')\n  if len(lines_input) < 1:\n    return\n  parser.setup(lines_input)\n  try:\n    parser.find_head_body_sep()\n    parser.parse_table()\n  except ApplicationError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/docutils/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/jwilk-mirrors/docutils\nlanguage: python\nmain_repo: https://github.com/jwilk-mirrors/docutils\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/dom4j/DOMReaderFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.BugDetectors;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.dom4j.io.DOMReader;\nimport java.io.IOException;\nimport org.xml.sax.SAXException;\nimport javax.xml.parsers.ParserConfigurationException;\nimport java.lang.IllegalArgumentException;\n\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport java.io.ByteArrayInputStream;\nimport java.util.List;\n\npublic class DOMReaderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n    try (AutoCloseable ignored = BugDetectors.allowNetworkConnections()) {\n\n      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n      DocumentBuilder builder;\n      org.w3c.dom.Document doc;\n\n      try {\n        builder = factory.newDocumentBuilder();\n      } catch (ParserConfigurationException e) {\n        return;\n      }\n\n      try {\n        doc = builder.parse(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n      } catch (SAXException | IOException e) {\n        return;\n      }\n\n      DOMReader reader = new DOMReader();\n\n      try {\n        reader.read(doc);\n      } catch (IllegalArgumentException e) {\n        return;\n      }\n    } catch (Exception e) {\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/dom4j/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n# Ensure Java 11 is installed\nRUN apt-get update && \\\n    apt-get install -y openjdk-11-jdk && \\\n    rm -rf /var/lib/apt/lists/*\n\nENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $JAVA_HOME/bin:$PATH\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/xml.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/DOMReaderFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/dom4j/dom4j.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/dom4j\n"
  },
  {
    "path": "projects/dom4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\n# Set UTF-8 encoding and skip Javadoc\n./gradlew -x test -x javadoc build -Dfile.encoding=UTF-8\ncp \"build/libs/dom4j.jar\" $OUT/dom4j.jar\n\nALL_JARS=\"dom4j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/dom4j/project.yaml",
    "content": "homepage: \"https://github.com/dom4j/dom4j\"\nlanguage: jvm\nmain_repo: \"https://github.com/dom4j/dom4j.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/double-conversion/Dockerfile",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y --no-install-recommends \\\n        cmake ninja-build && \\\n    apt-get clean\n\nRUN git clone --single-branch \\\n    https://github.com/google/double-conversion.git double-conversion\nWORKDIR double-conversion\nCOPY run_tests.sh build.sh $SRC/\nCOPY *.cc $SRC/\n"
  },
  {
    "path": "projects/double-conversion/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir -p ${WORK}/double-conversion\ncd ${WORK}/double-conversion\n\ncmake -GNinja -DBUILD_TESTING=ON ${SRC}/double-conversion/\nninja\n\nfuzzer=\"string_to_double_fuzzer\"\n\n${CXX} ${CXXFLAGS} -std=c++11 -I${SRC}/double-conversion/double-conversion \\\n    -c ${SRC}/${fuzzer}.cc \\\n    -o ${fuzzer}.o\n${CXX} ${CXXFLAGS} -std=c++11 ${fuzzer}.o \\\n    -o ${OUT}/${fuzzer} \"${LIB_FUZZING_ENGINE}\" libdouble-conversion.a\n"
  },
  {
    "path": "projects/double-conversion/project.yaml",
    "content": "homepage: \"https://github.com/google/double-conversion\"\nlanguage: c++\nprimary_contact: \"florian@loitsch.com\"\nauto_ccs:\n  - \"sbucur@google.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nlabels:\n  string_to_double_fuzzer:\n    - sundew\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/google/double-conversion.git'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/double-conversion/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $WORK/double-conversion\nninja test\n"
  },
  {
    "path": "projects/double-conversion/string_to_double_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n#include <cstdlib>\n\n#include \"double-conversion.h\"\n\nusing double_conversion::StringToDoubleConverter;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  StringToDoubleConverter converter(\n      StringToDoubleConverter::ALLOW_HEX |\n          StringToDoubleConverter::ALLOW_OCTALS |\n          StringToDoubleConverter::ALLOW_TRAILING_JUNK |\n          StringToDoubleConverter::ALLOW_LEADING_SPACES |\n          StringToDoubleConverter::ALLOW_TRAILING_SPACES |\n          StringToDoubleConverter::ALLOW_SPACES_AFTER_SIGN |\n          StringToDoubleConverter::ALLOW_CASE_INSENSIBILITY |\n          StringToDoubleConverter::ALLOW_HEX_FLOATS,\n      /*empty_string_value=*/0.0,\n      /*junk_string_value=*/0.0, \"inf\", \"nan\");\n  int num_digits_unused;\n  converter.StringToDouble(reinterpret_cast<const char*>(data), size,\n                           &num_digits_unused);\n  return 0;\n}\n"
  },
  {
    "path": "projects/dovecot/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget gettext automake libxml2-dev m4 pkg-config bison flex python3.8-venv libssl-dev zlib1g-dev libtool-bin\nRUN git clone --depth 1 --single-branch --branch main https://github.com/dovecot/core dovecot\nRUN git clone --depth 1 --single-branch --branch main https://github.com/dovecot/pigeonhole pigeonhole\nCOPY build.sh $SRC/\n#COPY fuzz-* $SRC/\n"
  },
  {
    "path": "projects/dovecot/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd dovecot\n# Patch ldflags\nfind . -name \"Makefile.am\" -exec sed -i -e 's,(FUZZER_LDFLAGS),(FUZZER_LDFLAGS) -static-libtool-libs,' {} \\;\n./autogen.sh\n./configure PANDOC=false --with-fuzzer=clang --prefix=$OUT\nmake -j$(nproc)\n# Copy over the fuzzers\nfind . -name \"fuzz-*\" -executable -exec libtool install install -m0755 {} $OUT/ \\;\ncd ../pigeonhole\nfind . -name \"Makefile.am\" -exec sed -i -e 's,(FUZZER_LDFLAGS),(FUZZER_LDFLAGS) -static-libtool-libs,' {} \\;\n./autogen.sh\n./configure --with-dovecot=../dovecot --with-fuzzer=clang --prefix=$OUT\nmake -j$(nproc)\n# Copy over the fuzzers\nfind . -name \"fuzz-*\" -executable -exec libtool install install -m0755 {} $OUT/ \\;\n"
  },
  {
    "path": "projects/dovecot/project.yaml",
    "content": "homepage: \"https://www.dovecot.org/\"\nlanguage: c\nprimary_contact: \"oss-fuzz@open-xchange.com\"\nauto_ccs:\n    - \"david@adalogics.com\"\n    - \"p.antoine@catenacyber.fr\"\n    - \"cmousefi@gmail.com\"\n    - \"boschstephan@gmail.com\"\n    - \"timo.sirainen@gmail.com\"\nmain_repo: 'https://github.com/dovecot/core'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/dpp/project.yaml",
    "content": "homepage: \"https://github.com/brainboxdotcc/DPP\"\nlanguage: c++\nprimary_contact: \"craigedwardsbrainbox@gmail.com\"\nauto_ccs:\n  - \"craigedwards@brainbox.cc\"\nsanitizers:\n  - address\n  - memory:\n     experimental: True\n  - undefined\nmain_repo: 'https://github.com/brainboxdotcc/DPP.git'\n\n"
  },
  {
    "path": "projects/draco/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y git cmake make pkg-config\nRUN git clone --depth 1 https://github.com/google/draco draco\nCOPY build.sh $SRC/\nWORKDIR $WORK/\n"
  },
  {
    "path": "projects/draco/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsh $SRC/draco/src/draco/tools/fuzz/build.sh\n"
  },
  {
    "path": "projects/draco/project.yaml",
    "content": "homepage: \"https://github.com/google/draco\"\nlanguage: c++\nprimary_contact: \"fgalligan@google.com\"\nauto_ccs:\n  - \"ostava@google.com\"\n  - \"vytyaz@google.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - centipede\nmain_repo: 'https://github.com/google/draco'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/dragonfly/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone https://github.com/dragonflyoss/Dragonfly\nCOPY build.sh $SRC/\nWORKDIR $SRC/Dragonfly\n"
  },
  {
    "path": "projects/dragonfly/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/dragonflyoss/Dragonfly/dfget/core/uploader FuzzParseParams uploader_fuzz\ncompile_go_fuzzer github.com/dragonflyoss/Dragonfly/supernode/daemon/mgr/cdn Fuzz cdn_fuzz\n"
  },
  {
    "path": "projects/dragonfly/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/dragonflyoss/Dragonfly\"\nprimary_contact: \"zj3142063@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/dragonflyoss/Dragonfly'\n"
  },
  {
    "path": "projects/dropbear/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y libz-dev autoconf mercurial\nRUN hg clone https://hg.ucc.asn.au/dropbear-fuzzcorpus dropbear-corpus\nRUN git clone https://github.com/mkj/dropbear dropbear\nWORKDIR dropbear\nCOPY build.sh *.options $SRC/\n\n"
  },
  {
    "path": "projects/dropbear/build.sh",
    "content": "#!/bin/bash\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n$SRC/dropbear/configure --enable-fuzz --disable-harden --disable-zlib\n\nmake -j$(nproc) fuzz-targets FUZZLIB=$LIB_FUZZING_ENGINE\n\nTARGETS=\"$(make list-fuzz-targets)\"\n\nmake -C $SRC/dropbear-corpus\n\ncp -v $TARGETS $OUT/\ncp -v *.options $OUT/\ncp -v $SRC/dropbear-corpus/*.zip $OUT/\ncp -v $SRC/dropbear-corpus/*.dict $OUT/\n"
  },
  {
    "path": "projects/dropbear/project.yaml",
    "content": "homepage: \"https://matt.ucc.asn.au/dropbear/dropbear.html\"\nlanguage: c++\nprimary_contact: \"matt@ucc.asn.au\"\nbuilds_per_day: 4\nmain_repo: \"https://github.com/mkj/dropbear\"\n"
  },
  {
    "path": "projects/dropwizard/DefaultServerFactoryFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.codahale.metrics.MetricRegistry;\nimport com.codahale.metrics.health.HealthCheckRegistry;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.core.JsonFactory;\nimport com.fasterxml.jackson.core.JsonFactoryBuilder;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport io.dropwizard.core.Configuration;\nimport io.dropwizard.core.server.DefaultServerFactory;\nimport io.dropwizard.core.setup.Environment;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-6\n// Heuristic name: jvm-autofuzz-heuristics-6\n// Target method: [io.dropwizard.core.server.DefaultServerFactory] public void\n// configure(io.dropwizard.core.setup.Environment)\npublic class DefaultServerFactoryFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    DefaultServerFactory obj = new DefaultServerFactory();\n    obj.setAdminMaxThreads(data.consumeInt());\n    obj.setAdminMinThreads(data.consumeInt());\n    obj.setApplicationContextPath(data.consumeString(data.remainingBytes() / 2));\n    obj.setAdminContextPath(data.consumeString(data.remainingBytes() / 2));\n    obj.configure(new Environment(data.consumeRemainingAsString()));\n  }\n}\n"
  },
  {
    "path": "projects/dropwizard/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN curl -L https://download.java.net/openjdk/jdk17/ri/openjdk-17+35_linux-x64_bin.tar.gz -o jdk.tar.gz && \\\n    tar zxf jdk.tar.gz && \\\n    rm -rf jdk.tar.gz\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nENV JAVA_HOME=\"$SRC/jdk-17\"\nRUN git clone --depth 1 https://github.com/dropwizard/dropwizard dropwizard\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/dropwizard\n"
  },
  {
    "path": "projects/dropwizard/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\nJARFILE_LIST=\nfor JARFILE in $(find ./  -name *.jar)\ndo\n  if [[ \"$JARFILE\" == *\"target/\"* ]] && [[ \"$JARFILE\" != *original*.jar ]]\n  then\n    if [[ \"$JARFILE\" != *sources.jar ]] && [[ \"$JARFILE\" != *javadoc.jar ]] && [[ \"$JARFILE\" != *tests.jar ]]\n    then\n      cp $JARFILE $OUT/\n      JARFILE_LIST=\"$JARFILE_LIST$(basename $JARFILE) \"\n    fi\n  fi\ndone\n\ncurr_dir=$(pwd)\nrm -rf $OUT/jar_temp\nmkdir $OUT/jar_temp\ncd $OUT/jar_temp\nfor JARFILE in $JARFILE_LIST\ndo\n  jar -xf $OUT/$JARFILE\ndone\ncd $curr_dir\n\ncp -r $JAVA_HOME $OUT/\n\nBUILD_CLASSPATH=$JAZZER_API_PATH:$OUT/jar_temp\nRUNTIME_CLASSPATH=\\$this_dir/jar_temp:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  $JAVA_HOME/bin/javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  export JAVA_HOME=\\$this_dir/$(basename $JAVA_HOME)\n  export LD_LIBRARY_PATH=\"\\$JAVA_HOME/lib/server\":\\$this_dir\n  export PATH=\\$JAVA_HOME/bin:\\$PATH\n\n  \\$this_dir/jazzer_driver                          \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/dropwizard/project.yaml",
    "content": "homepage: https://github.com/dropwizard/dropwizard\nmain_repo: https://github.com/dropwizard/dropwizard\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/duckdb/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth=1 https://github.com/duckdb/duckdb duckdb\nWORKDIR duckdb\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/duckdb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake relassert CRASH_ON_ASSERT=1 DISABLE_SANITIZER=1\nEXTENSION_LIBS=$(find ./build/relassert/extension/ -name \"*.a\")\nTHIRD_PARTY_LIBS=$(find ./build/relassert/third_party/ -name \"*.a\")\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./test/ossfuzz/parse_fuzz_test.cpp \\\n    -o $OUT/parse_fuzz_test -I./ -I./src/include \\\n    ./build/relassert/src/libduckdb_static.a \\\n    ${EXTENSION_LIBS} ${THIRD_PARTY_LIBS}\n"
  },
  {
    "path": "projects/duckdb/project.yaml",
    "content": "homepage: \"https://duckdb.org/\"\nlanguage: c++\nprimary_contact: \"quack@duckdb.org\"\nmain_repo: \"https://github.com/duckdb/duckdb/\"\nauto_ccs: \n  - \"hannes.muehleisen@gmail.com\"\n  - \"mark@duckdblabs.com\"\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/dulwich/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN git clone https://github.com/jelmer/dulwich.git dulwich\nRUN $SRC/dulwich/fuzzing/oss-fuzz-scripts/container-environment-bootstrap.sh\n\nCOPY *.sh $SRC/\nWORKDIR $SRC/dulwich\n"
  },
  {
    "path": "projects/dulwich/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n. \"$SRC/dulwich/fuzzing/oss-fuzz-scripts/build.sh\"\n"
  },
  {
    "path": "projects/dulwich/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/jelmer/dulwich\"\nmain_repo: \"https://github.com/jelmer/dulwich\"\nlanguage: python\nprimary_contact: \"jvernooij@gmail.com\"\nauto_ccs:\n  - \"david.js.lakin@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/e2fsprogs/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y git make texinfo\nRUN git clone --depth 1 https://github.com/tytso/e2fsprogs\n\nCOPY build.sh $SRC/\nCOPY fuzz/ $SRC/fuzz/\nWORKDIR $SRC/e2fsprogs\n"
  },
  {
    "path": "projects/e2fsprogs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nexport LDFLAGS=\"$CXXFLAGS\"\n$SRC/e2fsprogs/configure\nmake -j$(nproc) all\n\n# build fuzzers\nfor fuzzer in $(find $SRC/fuzz -name '*_fuzzer.cc'); do\n  fuzzer_basename=$(basename -s .cc $fuzzer)\n  $CXX $CXXFLAGS \\\n      $LIB_FUZZING_ENGINE \\\n      -I $SRC/e2fsprogs/lib \\\n      $fuzzer \\\n      -L'./lib/ext2fs' -lext2fs \\\n      -L'./lib/et' -lcom_err \\\n      -o $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/e2fsprogs/fuzz/ext2fs_check_directory_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <fcntl.h>\n#include <unistd.h>\n\n#include \"ext2fs/ext2fs.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  static const char* fname = \"/tmp/ext2_test_file\";\n\n  // Write our data to a temp file.\n  int fd = open(fname, O_RDWR|O_CREAT|O_TRUNC);\n  write(fd, data, size);\n  close(fd);\n\n  ext2_filsys fs;\n  errcode_t retval = ext2fs_open(\n      fname,\n      EXT2_FLAG_IGNORE_CSUM_ERRORS, 0, 0,\n      unix_io_manager,\n      &fs);\n\n  if (!retval) {\n    retval = ext2fs_check_directory(fs, EXT2_ROOT_INO);\n    ext2fs_close(fs);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/e2fsprogs/fuzz/ext2fs_image_read_write_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <unistd.h>\n#include <assert.h>\n#include <sys/syscall.h>\n#include <linux/memfd.h>\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"ext2fs/ext2fs.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  enum FuzzerType {\n    ext2fsImageBitmapRead,\n    ext2fsImageInodeRead,\n    ext2fsImageSuperRead,\n    ext2fsImageBitmapWrite,\n    ext2fsImageInodeWrite,\n    ext2fsImageSuperWrite,\n    kMaxValue = ext2fsImageSuperWrite\n  };\n\n  FuzzedDataProvider stream(data, size);\n  const FuzzerType f = stream.ConsumeEnum<FuzzerType>();\n  (void) stream.ConsumeIntegral<int>();\n  // Keep this here to not spoil the corpus or reproducers\n\n  static const char* fname = \"ext2_test_file\";\n\n  // Write our data to a temp file.\n  int fd = syscall(SYS_memfd_create, fname, 0);\n  std::vector<char> buffer = stream.ConsumeRemainingBytes<char>();\n  write(fd, buffer.data(), buffer.size());\n\n  std::string fspath(\"/proc/self/fd/\" + std::to_string(fd));\n\n  ext2_filsys fs;\n  errcode_t retval = ext2fs_open(\n      fspath.c_str(),\n      EXT2_FLAG_IGNORE_CSUM_ERRORS, 0, 0,\n      unix_io_manager,\n      &fs);\n\n  if (!retval) {\n    switch (f) {\n      case ext2fsImageBitmapRead: {\n        ext2fs_image_bitmap_read(fs, fd, 0);\n        break;\n      }\n      case ext2fsImageInodeRead: {\n        ext2fs_image_inode_read(fs, fd, 0);\n        break;\n      }\n      case ext2fsImageSuperRead: {\n        ext2fs_image_super_read(fs, fd, 0);\n        break;\n      }\n      case ext2fsImageBitmapWrite: {\n        ext2fs_image_bitmap_write(fs, fd, 0);\n        break;\n      }\n      case ext2fsImageInodeWrite: {\n        ext2fs_image_inode_write(fs, fd, 0);\n        break;\n      }\n      case ext2fsImageSuperWrite: {\n        ext2fs_image_super_write(fs, fd, 0);\n        break;\n      }\n      default: {\n        assert(false);\n      }\n    }\n    ext2fs_close(fs);\n  }\n  close(fd);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/e2fsprogs/fuzz/ext2fs_read_bitmap_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <unistd.h>\n#include <assert.h>\n#include <sys/syscall.h>\n#include <linux/memfd.h>\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"ext2fs/ext2fs.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  enum FuzzerType {\n    ext2fsReadBlockBitmap,\n    ext2fsReadInodeBitmap,\n    kMaxValue = ext2fsReadInodeBitmap\n  };\n\n  FuzzedDataProvider stream(data, size);\n  const FuzzerType f = stream.ConsumeEnum<FuzzerType>();\n  (void) stream.ConsumeIntegral<int>();\n\n  static const char* fname = \"ext2_test_file\";\n\n  // Write our data to a temp file.\n  int fd = syscall(SYS_memfd_create, fname, 0);\n  std::vector<char> buffer = stream.ConsumeRemainingBytes<char>();\n  write(fd, buffer.data(), buffer.size());\n\n  std::string fspath(\"/proc/self/fd/\" + std::to_string(fd));\n\n  ext2_filsys fs;\n  errcode_t retval = ext2fs_open(\n      fspath.c_str(),\n      EXT2_FLAG_IGNORE_CSUM_ERRORS, 0, 0,\n      unix_io_manager,\n      &fs);\n\n  if (!retval) {\n    switch (f) {\n      case ext2fsReadBlockBitmap: {\n        ext2fs_read_block_bitmap(fs);\n        break;\n      }\n      case ext2fsReadInodeBitmap: {\n        ext2fs_read_inode_bitmap(fs);\n        break;\n      }\n      default: {\n        assert(false);\n      }\n    }\n    ext2fs_close(fs);\n  }\n  close(fd);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/e2fsprogs/project.yaml",
    "content": "homepage: \"https://github.com/tytso/e2fsprogs\"\nlanguage: c\nprimary_contact: \"tytso@mit.edu\"\nauto_ccs:\n  - \"theodore.tso@gmail.com\"\n  - \"tytso@google.com\"\n  - \"mxms@google.com\"\nmain_repo: 'https://github.com/tytso/e2fsprogs'\nbase_os_version: ubuntu-24-04\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/easywsclient/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/dhbaird/easywsclient easywsclient\nWORKDIR easywsclient\nCOPY build.sh *.cpp $SRC/\n"
  },
  {
    "path": "projects/easywsclient/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfor f in $(find $SRC -name '*_fuzzer.cpp'); do\n    b=$(basename -s .cpp $f)\n    $CXX $CXXFLAGS -std=c++17 -g easywsclient.cpp -I. \\\n        $f -o $OUT/$b $LIB_FUZZING_ENGINE\ndone\n"
  },
  {
    "path": "projects/easywsclient/easyws_fuzzer.cpp",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\n#include \"easywsclient.hpp\"\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  std::string str(reinterpret_cast<const char*>(data), size);\n  easywsclient::WebSocket::from_url(str);\n  return 0;\n}\n"
  },
  {
    "path": "projects/easywsclient/project.yaml",
    "content": "homepage: \"https://github.com/dhbaird/easywsclient\"\nlanguage: c++\nprimary_contact: \"dhbaird@gmail.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/dhbaird/easywsclient'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/ecc-diff-fuzzer/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nENV GOPATH /root/go\nENV PATH $PATH:/root/.go/bin:$GOPATH/bin\nRUN install_go.sh\nRUN apt-get update && apt-get install -y make cmake bzip2 autoconf automake gettext libtool python curl\nRUN rustup target add i686-unknown-linux-gnu\n#use different package sources for recent npm\nRUN curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh\nRUN bash nodesource_setup.sh\nRUN apt install -y nodejs\nRUN npm install -g browserify\nRUN npm install elliptic\n# mbedtls needs jsonschema which needs rpds-py which needs pip>=20\n# or a Rust toolchain.\nRUN pip3 install 'pip>=20'\n\nRUN git clone --depth 1 https://github.com/bellard/quickjs quickjs\nRUN git clone --depth 1 https://github.com/catenacyber/elliptic-curve-differential-fuzzer.git ecfuzzer\nRUN git clone --recursive --depth 1 -b development https://github.com/Mbed-TLS/mbedtls.git mbedtls\n# needed to compile mbedtls\nRUN pip3 install -r $SRC/mbedtls/scripts/basic.requirements.txt\nRUN git clone --depth 1 https://github.com/libecc/libecc.git libecc\nRUN git clone --depth 1 https://github.com/openssl/openssl.git openssl\nRUN git clone --depth 1 git://git.gnupg.org/libgpg-error.git libgpg-error\nRUN git clone --depth 1 git://git.gnupg.org/libgcrypt.git gcrypt\nRUN git clone --depth 1 https://github.com/weidai11/cryptopp cryptopp\nADD https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.bz2 gmp-6.2.1.tar.bz2\nRUN git clone --depth 1 https://github.com/gnutls/nettle.git nettle\nRUN git clone --depth 1 https://github.com/randombit/botan.git botan\nWORKDIR $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/ecc-diff-fuzzer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# use a linker that supports Dwarf v5\nexport LDFLAGS=\"-fuse-ld=lld\"\n\n# build projects\n#nettle\n(\ncd nettle\ntar -xvf ../gmp-6.2.1.tar.bz2\ncd gmp-6.2.1\n#do not use assembly instructions as we do not know if they will be available on the machine who will run the fuzzer\n#we could do instead --enable-fat\n./configure --disable-shared --disable-assembly\nmake -j$(nproc)\nmake install\ncd ..\nautoreconf\n./configure --disable-shared --disable-openssl\nmake -j$(nproc)\nmake install\n)\n\n#cryptopp\n(\ncd cryptopp\nmake -j$(nproc)\nmake install\n)\n\n#gcrypt\n(\ncd libgpg-error\n# fix for following error\n# error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version 0.19 but the autoconf macros are from gettext version 0.20\ntimeout 3 gettextize -f || true\n./autogen.sh\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n    ./configure -host=i386 --disable-doc --enable-static --disable-shared\nelse\n    ./configure --disable-doc --enable-static --disable-shared\nfi\nmake -j$(nproc)\nmake install\ncd ../gcrypt\n./autogen.sh\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n    ./configure -host=i386 --enable-static --disable-shared --disable-doc --enable-maintainer-mode\nelse\n    ./configure --enable-static --disable-shared --disable-doc --enable-maintainer-mode\nfi\nmake -j$(nproc)\nmake install\n# defined at aria.o:(aria_encrypt) in archive /lib/x86_64-linux-gnu/libcrypto.a\nsed -i -e s/aria_encrypt/ariagencrypt/ /usr/local/lib/libgcrypt.a\n)\n\n#mbedtls\n(\ncd mbedtls\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n    export CFLAGS=\"$CFLAGS -maes -mpclmul\"\nfi\ncmake . -DENABLE_PROGRAMS=0 -DENABLE_TESTING=0\nmake -j$(nproc) all\nmake install\n)\n\n#openssl\n(\ncd openssl\n#option to not have the same exported function poly1305_blocks as in gcrypt\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n    setarch i386 ./config no-poly1305 no-shared no-threads -m32\nelse\n    ./config no-poly1305 no-shared no-threads\nfi\nmake build_generated libcrypto.a\nmake install\n)\n\n#libecc\n(\ncd libecc\n#required by libecc\n(export CFLAGS=\"$CFLAGS -fPIC\"; make; cp build/*.a /usr/local/lib; cp -r include/* /usr/local/include/)\n)\n\n#botan\n(\ncd botan\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n    ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" \\\n               --disable-shared --disable-modules=locking_allocator --disable-shared-library \\\n               --without-os-features=getrandom,getentropy --cpu x86_32\nelse\n    ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" \\\n               --disable-shared --disable-modules=locking_allocator --disable-shared-library \\\n               --without-os-features=getrandom,getentropy\nfi\nmake -j$(nproc) libs\nmake install\n)\n\n#quickjs\n(\ncd quickjs\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n    make qjsc\n    cp qjsc /usr/local/bin/\n    make clean\n    # Makefile should not override CFLAGS\n    sed -i -e 's/CFLAGS=/CFLAGS+=/' Makefile\n    CFLAGS=\"-m32\" make libquickjs.a\nelse\n    make && make install\nfi\ncp quickjs*.h /usr/local/include/\ncp libquickjs.a /usr/local/lib/\n)\n\nexport CARGO_BUILD_TARGET=\"x86_64-unknown-linux-gnu\"\n#build fuzz target\ncd ecfuzzer\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n    export GOARCH=386\n#needed explicitly because of cross compilation cf https://golang.org/cmd/cgo/\n    export CGO_ENABLED=1\n    export CARGO_BUILD_TARGET=i686-unknown-linux-gnu\nfi\nzip -r fuzz_ec_seed_corpus.zip corpus/\ncp fuzz_ec_seed_corpus.zip $OUT/\ncp fuzz_ec.dict $OUT/\ncp fuzz_ec.dict $OUT/fuzz_ec_noblocker.dict\n\nmkdir build\ncd build\n#no afl with long javascript initialization\nif [ \"$FUZZING_ENGINE\" != 'afl' ]; then\n    cmake ..\n    make -j$(nproc)\n    cp ecfuzzer $OUT/fuzz_ec\n    rm -Rf *\nfi\n\n#another target without javascript\ncmake -DDISABLE_JS=ON ..\nmake -j$(nproc)\ncp ecfuzzer $OUT/fuzz_ec_noblocker\n"
  },
  {
    "path": "projects/ecc-diff-fuzzer/project.yaml",
    "content": "homepage: \"https://github.com/catenacyber/elliptic-curve-differential-fuzzer\"\nlanguage: c++\nprimary_contact: \"p.antoine@catenacyber.fr\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nmain_repo: https://github.com/catenacyber/elliptic-curve-differential-fuzzer\narchitectures:\n- x86_64\n- i386\n"
  },
  {
    "path": "projects/ecdsa-python/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/starkbank/ecdsa-python/\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fuzz_* $SRC/\n"
  },
  {
    "path": "projects/ecdsa-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd ecdsa-python\npython3 ./setup.py install\n\n# Build fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ecdsa-python/fuzz_private_key.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n  from ellipticcurve import Ecdsa, Signature, PublicKey, PrivateKey\n\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n\n  privateKey1 = PrivateKey()\n  publicKey1 = privateKey1.publicKey()\n\n  privateKeyPem = privateKey1.toPem()\n  publicKeyPem = publicKey1.toPem()\n\n  privateKey2 = PrivateKey.fromPem(privateKeyPem)\n  publicKey2 = PublicKey.fromPem(publicKeyPem)\n\n  message = fdp.ConsumeUnicode(sys.maxsize)\n\n  signatureBase64 = Ecdsa.sign(message=message,\n                               privateKey=privateKey2).toBase64()\n\n  signature = Signature.fromBase64(signatureBase64)\n  assert(Ecdsa.verify(message=message, signature=signature, publicKey=publicKey2))\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ecdsa-python/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/starkbank/ecdsa-python\nlanguage: python\nmain_repo: https://github.com/starkbank/ecdsa-python/\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/eclipse-equinox/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME equinox\nWORKDIR ${SRC}\n#\n# Clone repository. eclipse-equinox has an auxillary repository, which\n# also has to be cloned...\n#\nRUN git clone https://github.com/eclipse-equinox/equinox\nRUN git clone https://github.com/eclipse-equinox/equinox.binaries\n\n#\n# Multiple JDK versions are required in order to build equinox, and they\n# also need to be configured into a maven toolchain for concurrent use.\n#\nRUN apt update && apt install -y openjdk-8-jdk-headless openjdk-11-jdk-headless openjdk-17-jdk-headless\nENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64\nADD maven-toolchains.xml ${SRC}/ \nRUN mkdir -p ~/.m2 && \\\n\tcp ${SRC}/maven-toolchains.xml ~/.m2/toolchains.xml\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}"
  },
  {
    "path": "projects/eclipse-equinox/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_SUBDIR=\"\"\n#MVN_FLAGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests -Drt.equinox.binaries.loc=${SRC}/equinox.binaries\"\nMVN_FLAGS=\"-DskipTests -Drt.equinox.binaries.loc=${SRC}/equinox.binaries -Pbuild-individual-bundles -Pbree-libs -Papi-check -Dcompare-version-with-baselines.skip=false -Dproject.build.sourceEncoding=UTF-8 -Dmaven.test.failure.ignore=true\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.14.0\" \\\n\t\t-Dpackaging=jar\npopd\n\n# Build needs to be run in the CVSROOT\npushd \"${SRC}/${LIBRARY_NAME}/${SRC_SUBDIR}\"\n\t${MVN} install ${MVN_FLAGS}\npopd\n\n# ... while the subprojects have varying versions\npushd \"${SRC}/${LIBRARY_NAME}/bundles/org.eclipse.osgi\"\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/eclipse-equinox/equinox-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>equinox-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>3.18.200</fuzzedLibaryVersion>\n\t</properties>\n\n\t<!-- This repositories list is copy and pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.14.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.14.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.eclipse.osgi</groupId>\n\t\t\t<artifactId>org.eclipse.osgi</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.eclipse.platform</groupId>\n\t\t\t<artifactId>org.eclipse.core.runtime</artifactId>\n\t\t\t<version>3.26.100</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/eclipse-equinox/equinox-fuzzer/src/main/java/org/eclipse/osgi/ConditionInfoFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage org.eclipse.osgi;\n\nimport org.osgi.service.condpermadmin.ConditionInfo;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\npublic class ConditionInfoFuzzer {\n\n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public ConditionInfoFuzzer(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        this.fuzzedDataProvider = fuzzedDataProvider;\n    }\n\n    void test() {\n        try {\n            ConditionInfo info = new ConditionInfo(fuzzedDataProvider.consumeRemainingAsAsciiString());\n            info.toString();\n        } catch (IllegalArgumentException ex) {\n            /* ignore */\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider)  throws Exception {\n\n        ConditionInfoFuzzer fixture = new ConditionInfoFuzzer(fuzzedDataProvider);\n        fixture.test();\n    }\n}"
  },
  {
    "path": "projects/eclipse-equinox/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/eclipse-equinox/maven-toolchains.xml",
    "content": "<toolchains>\n\t<!-- JDK toolchains -->\n\t<toolchain>\n\t\t<type>jdk</type>\n\t\t<provides>\n\t\t\t<id>JavaSE-1.8</id>\n\t\t</provides>\n\t\t<configuration>\n\t\t\t<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64</jdkHome>\n\t\t</configuration>\n\t</toolchain>\n\t<toolchain>\n\t\t<type>jdk</type>\n\t\t<provides>\n\t\t\t<version>11</version>\n\t\t</provides>\n\t\t<configuration>\n\t\t\t<jdkHome>/usr/lib/jvm/java-11-openjdk-amd64</jdkHome>\n\t\t</configuration>\n\t</toolchain>\n\t<toolchain>\n\t\t<type>jdk</type>\n\t\t<provides>\n\t\t\t<version>17</version>\n\t\t</provides>\n\t\t<configuration>\n\t\t\t<jdkHome>/usr/lib/jvm/java-17-openjdk-amd64</jdkHome>\n\t\t</configuration>\n\t</toolchain>\n</toolchains>"
  },
  {
    "path": "projects/eclipse-equinox/project.yaml",
    "content": "homepage: \"https://github.com/eclipse-equinox/equinox\"\nlanguage: jvm\nmain_repo: \"https://github.com/eclipse-equinox/equinox\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/edk2/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y \\\n    python3 nasm uuid-dev\n\nRUN git clone https://github.com/tianocore/edk2.git --recursive\nRUN git clone https://github.com/intel/hbfa-fl\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/edk2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Fix hbfa-fl compatibility with edk2 that removed GCC5/GCC48/GCC49 toolchains.\n# Replace GCC5_/GCC48_/GCC49_ macro references with GCC_ in the customized tools_def.\nsed -i 's/GCC5_/GCC_/g; s/GCC48_/GCC_/g; s/GCC49_/GCC_/g' \\\n    $SRC/hbfa-fl/HBFA/UefiHostFuzzTestPkg/Conf/tools_def.customized\n\n# Fix HBFAEnvSetup.py regex to match new GCC_ALL_CC_FLAGS (no version digits).\nsed -i 's/GCC\\\\\\\\d{1,2}_ALL_CC_FLAGS/GCC\\\\\\\\d{0,2}_ALL_CC_FLAGS/' \\\n    $SRC/hbfa-fl/HBFA/UefiHostTestTools/HBFAEnvSetup.py\n\n# Fix RunLibFuzzer.py to use GCC toolchain instead of removed GCC5.\nsed -i 's/BuildCmdList.append(.GCC5.)/BuildCmdList.append(\"GCC\")/' \\\n    $SRC/hbfa-fl/HBFA/UefiHostTestTools/RunLibFuzzer.py\n\nhbfa-fl/oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/edk2/project.yaml",
    "content": "homepage: \"https://www.tianocore.org\"\nlanguage: c\nfuzzing_engines:\n   - libfuzzer\nsanitizers:\n   - address\n   - undefined\nprimary_contact: \"tamas.k.lengyel@gmail.com\"\nauto_ccs:\n   - \"rowanbhart@gmail.com\"\nvendor_ccs:\n   - \"edk2-hbfa-ossfuzz@intel.com\"\nmain_repo: \"https://github.com/tianocore/edk2\"\nfile_github_issue: false\n"
  },
  {
    "path": "projects/eigen/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install --yes cmake mercurial\nRUN git clone https://gitlab.com/libeigen/eigen.git\nWORKDIR eigen\nCOPY build.sh *.cc $SRC/\n"
  },
  {
    "path": "projects/eigen/basicstuff_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"Eigen/Core\"\n\nnamespace {\n\nstatic constexpr Eigen::Index kEigenTestMaxSize = 64;\nstatic constexpr Eigen::Index kEigenIndexOne = static_cast<Eigen::Index>(1);\n\ntemplate <typename T>\nT ConsumeValue(FuzzedDataProvider* stream) {\n  return stream->ConsumeIntegral<T>();\n}\n\ntemplate <>\nfloat ConsumeValue(FuzzedDataProvider* stream) {\n  return stream->ConsumeFloatingPoint<float>();\n}\n\ntemplate <>\ndouble ConsumeValue(FuzzedDataProvider* stream) {\n  return stream->ConsumeFloatingPoint<double>();\n}\n\ntemplate <>\nlong double ConsumeValue(FuzzedDataProvider* stream) {\n  return stream->ConsumeFloatingPoint<long double>();\n}\n\ntemplate <>\nstd::complex<float> ConsumeValue(FuzzedDataProvider* stream) {\n  return std::complex<float>(stream->ConsumeFloatingPoint<float>(),\n                             stream->ConsumeFloatingPoint<float>());\n}\n\ntemplate <>\nstd::complex<double> ConsumeValue(FuzzedDataProvider* stream) {\n  return std::complex<float>(stream->ConsumeFloatingPoint<double>(),\n                             stream->ConsumeFloatingPoint<double>());\n}\n\ntemplate <typename MatrixType>\nMatrixType GenerateTestMatrix(size_t rows, size_t cols,\n                              FuzzedDataProvider* stream) {\n  std::vector<typename MatrixType::value_type> test_data(rows * cols);\n  for (auto& value : test_data) {\n    value = ConsumeValue<typename MatrixType::value_type>(stream);\n  }\n  Eigen::Map<MatrixType> mapped_map(test_data.data(), rows, cols);\n  return MatrixType(mapped_map);\n}\n\ntemplate <typename MatrixType>\nvoid basicStuff(const MatrixType& m, FuzzedDataProvider* stream) {\n  typedef typename MatrixType::Scalar Scalar;\n  typedef Eigen::Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;\n  typedef Eigen::Matrix<Scalar, MatrixType::RowsAtCompileTime,\n                        MatrixType::RowsAtCompileTime>\n      SquareMatrixType;\n\n  Eigen::Index rows = m.rows();\n  Eigen::Index cols = m.cols();\n\n  MatrixType m1 = GenerateTestMatrix<MatrixType>(rows, cols, stream),\n             m2 = GenerateTestMatrix<MatrixType>(rows, cols, stream),\n             m3(rows, cols), mzero = MatrixType::Zero(rows, cols),\n             square = GenerateTestMatrix<\n                 Eigen::Matrix<Scalar, MatrixType::RowsAtCompileTime,\n                               MatrixType::RowsAtCompileTime>>(rows, rows,\n                                                               stream);\n  VectorType v1 = GenerateTestMatrix<VectorType>(rows, 1, stream),\n             vzero = VectorType::Zero(rows);\n  SquareMatrixType sm1 = SquareMatrixType::Random(rows, rows), sm2(rows, rows);\n\n  Scalar x = ConsumeValue<typename MatrixType::Scalar>(stream);\n\n  Eigen::Index r = stream->ConsumeIntegralInRange(\n                   std::min(kEigenIndexOne, rows - 1), rows - 1),\n               c = stream->ConsumeIntegralInRange(\n                   std::min(kEigenIndexOne, cols - 1), cols - 1);\n\n  m1.coeffRef(r, c) = x;\n  m1(r, c) = x;\n  v1.coeffRef(r) = x;\n  v1(r) = x;\n  v1[r] = x;\n\n  Eigen::Index r1 = stream->ConsumeIntegralInRange(\n      static_cast<Eigen::Index>(0),\n      std::min(static_cast<Eigen::Index>(127), rows - 1));\n  x = v1(static_cast<char>(r1));\n  x = v1(static_cast<signed char>(r1));\n  x = v1(static_cast<unsigned char>(r1));\n  x = v1(static_cast<signed short>(r1));\n  x = v1(static_cast<unsigned short>(r1));\n  x = v1(static_cast<signed int>(r1));\n  x = v1(static_cast<unsigned int>(r1));\n  x = v1(static_cast<signed long>(r1));\n  x = v1(static_cast<unsigned long>(r1));\n  x = v1(static_cast<long long int>(r1));\n  x = v1(static_cast<unsigned long long int>(r1));\n\n  // now test copying a row-vector into a (column-)vector and conversely.\n  square.col(r) = square.row(r).eval();\n  Eigen::Matrix<Scalar, 1, MatrixType::RowsAtCompileTime> rv(rows);\n  Eigen::Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> cv(rows);\n  rv = square.row(r);\n  cv = square.col(r);\n\n  cv.transpose();\n\n  m3.real() = m1.real();\n  m1 = m2;\n\n  sm2.setZero();\n  for (Eigen::Index i = 0; i < rows; ++i) sm2.col(i) = sm1.row(i);\n\n  sm2.setZero();\n  for (Eigen::Index i = 0; i < rows; ++i) sm2.col(i).noalias() = sm1.row(i);\n\n  sm2.setZero();\n  for (Eigen::Index i = 0; i < rows; ++i) sm2.col(i).noalias() += sm1.row(i);\n\n  sm2.setZero();\n  for (Eigen::Index i = 0; i < rows; ++i) sm2.col(i).noalias() -= sm1.row(i);\n}\n\ntemplate <typename MatrixType>\nvoid basicStuffComplex(const MatrixType& m, FuzzedDataProvider* stream) {\n  typedef typename MatrixType::Scalar Scalar;\n  typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;\n  typedef Eigen::Matrix<RealScalar, MatrixType::RowsAtCompileTime,\n                        MatrixType::ColsAtCompileTime>\n      RealMatrixType;\n\n  Eigen::Index rows = m.rows();\n  Eigen::Index cols = m.cols();\n\n  RealMatrixType rm1 = GenerateTestMatrix<RealMatrixType>(rows, cols, stream),\n                 rm2 = GenerateTestMatrix<RealMatrixType>(rows, cols, stream);\n  MatrixType cm(rows, cols);\n  cm.real() = rm1;\n  cm.imag() = rm2;\n  rm1.setZero();\n  rm2.setZero();\n  rm1 = cm.real();\n  rm2 = cm.imag();\n  cm.real().setZero();\n}\n\n}  // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider stream(data, size);\n\n  basicStuff(\n      Eigen::MatrixXcf(\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize),\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize)),\n      &stream);\n  basicStuff(\n      Eigen::MatrixXi(\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize),\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize)),\n      &stream);\n  basicStuff(\n      Eigen::MatrixXcd(\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize),\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize)),\n      &stream);\n  basicStuff(\n      Eigen::Matrix<long double, Eigen::Dynamic, Eigen::Dynamic>(\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize),\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize)),\n      &stream);\n  basicStuffComplex(\n      Eigen::MatrixXcf(\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize),\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize)),\n      &stream);\n  basicStuffComplex(\n      Eigen::MatrixXcd(\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize),\n          stream.ConsumeIntegralInRange(kEigenIndexOne, kEigenTestMaxSize)),\n      &stream);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/eigen/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir build_dir && cd build_dir\ncmake ..\nmake install\ncd ..\n\n# build fuzzers\nfor fuzzers in $(find $SRC -name '*_fuzzer.cc'); do\n  fuzz_basename=$(basename -s .cc $fuzzers)\n  $CXX $CXXFLAGS -I. -Isrc/Eigen/Core \\\n  $fuzzers -o $OUT/$fuzz_basename $LIB_FUZZING_ENGINE\ndone\n"
  },
  {
    "path": "projects/eigen/project.yaml",
    "content": "homepage: \"http://eigen.tuxfamily.org/index.php?title=Main_Page\"\nlanguage: c++\nprimary_contact: \"eigen-core-team@lists.tuxfamily.org\"\nsanitizers:\n - address\n - memory\n - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://gitlab.com/libeigen/eigen.git'\n"
  },
  {
    "path": "projects/eigen/solver_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n#include <cstdlib>\n#include <string>\n\n#include \"Eigen/Core\"\n\nusing ::Eigen::Matrix;\nusing ::Eigen::Dynamic;\nusing ::Eigen::Lower;\nusing ::Eigen::Upper;\n\nint ConsumeNextInt(const uint8_t** data, size_t* size) {\n  if (*size < sizeof(int)) {\n    return 0;\n  }\n  int result;\n  memcpy(&result, *data, sizeof(int));\n  *size -= sizeof(int);\n  *data += sizeof(int);\n  return result;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  const size_t rows = static_cast<size_t>(ConsumeNextInt(&data, &size));\n  const size_t columns = static_cast<size_t>(ConsumeNextInt(&data, &size));\n\n  if (rows == 0 || columns == 0) {\n    return 0;\n  }\n  if (rows > 1024 || columns > 1024) {\n    return 0;\n  }\n\n  // We can do this same fuzz test with other templated types. Here, we just use\n  // an int.\n  Matrix<int, Dynamic, 1> vec(rows);\n  for (size_t i = 0; i < rows; ++i) {\n    vec(i) = ConsumeNextInt(&data, &size);\n  }\n  Matrix<int, Dynamic, Dynamic> matrix(rows, columns);\n  for (int i = 0; i < rows; ++i) {\n    for (int j = 0; j < columns; ++j) {\n      matrix(i, j) = ConsumeNextInt(&data, &size);\n    }\n  }\n\n  matrix.template triangularView<Lower>().solve(vec);\n  matrix.template triangularView<Upper>().solve(vec);\n  matrix.conjugate().template triangularView<Lower>().solve(vec);\n  matrix.conjugate().template triangularView<Upper>().solve(vec);\n  matrix.transpose().template triangularView<Lower>().solve(vec);\n  matrix.transpose().template triangularView<Upper>().solve(vec);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/elfutils/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && \\\n    apt-get install -y pkg-config make autoconf autopoint zlib1g-dev zlib1g-dev:i386 flex gawk bison\nRUN git clone --depth 1 https://sourceware.org/git/elfutils.git\nWORKDIR elfutils\nCOPY build.sh *.c *.zip $SRC/\n"
  },
  {
    "path": "projects/elfutils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script is supposed to be compatible with OSS-Fuzz, i.e. it has to use\n# environment variables like $CC, $CFLAGS, $OUT, link the fuzz targets with CXX\n# (even though the project is written in C) and so on:\n# https://google.github.io/oss-fuzz/getting-started/new-project-guide/#buildsh\n\n# It can be used to build and run the fuzz targets using Docker and the images\n# provided by the OSS-Fuzz project: https://google.github.io/oss-fuzz/advanced-topics/reproducing/#building-using-docker\n\n# It can also be used to build and run the fuzz target locally without Docker.\n# After installing clang and the build dependencies of libelf by running something\n# like `dnf build-dep elfutils-devel` on Fedora or `apt-get build-dep libelf-dev`\n# on Debian/Ubuntu, the following commands should be run:\n#\n#  $ git clone https://github.com/google/oss-fuzz\n#  $ cd oss-fuzz/projects/elfutils\n#  $ git clone https://sourceware.org/git/elfutils.git\n#  $ ./build.sh\n#  $ wget -O fuzz-dwfl-core-corpus.zip \"https://storage.googleapis.com/elfutils-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/elfutils_fuzz-dwfl-core/public.zip\"\n#  $ unzip -d CORPUS fuzz-dwfl-core-corpus.zip\n#  $ ./out/fuzz-dwfl-core CORPUS/\n\nset -eux\n\nSANITIZER=${SANITIZER:-address}\nflags=\"-O1 -fno-omit-frame-pointer -g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=$SANITIZER -fsanitize=fuzzer-no-link\"\n\nexport CC=${CC:-clang}\nexport CFLAGS=${CFLAGS:-$flags}\n\nexport CXX=${CXX:-clang++}\nexport CXXFLAGS=${CXXFLAGS:-$flags}\n\nexport SRC=${SRC:-$(realpath -- $(dirname -- \"$0\"))}\nexport OUT=${OUT:-\"$SRC/out\"}\nmkdir -p \"$OUT\"\n\nexport LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}\n\ncd \"$SRC/elfutils\"\n\n# ASan isn't compatible with -Wl,--no-undefined: https://github.com/google/sanitizers/issues/380\nsed -i 's/^\\(NO_UNDEFINED=\\).*/\\1/' configure.ac\n\n# ASan isn't compatible with -Wl,-z,defs either:\n# https://clang.llvm.org/docs/AddressSanitizer.html#usage\nsed -i 's/^\\(ZDEFS_LDFLAGS=\\).*/\\1/' configure.ac\n\n# srcfiles.cxx started failing to compile with the OSS-Fuzz toolchain\n# when it was switched from clang-18.0.0 to clang-18.1.8 in\n# https://github.com/google/oss-fuzz/pull/12365.\n# https://github.com/google/oss-fuzz/pull/12365#discussion_r1784702452\n# It's probably an OSS-Fuzz toolchain bug but it doesn't matter much\n# because the srcfiles binary isn't relevant in terms of fuzzing and\n# can safely be excluded.\nsed -i 's/^\\(srcfiles_\\)/#/' src/Makefile.am\nsed -i 's/\\bsrcfiles\\b//' src/Makefile.am\n\nif [[ \"$SANITIZER\" == undefined ]]; then\n    additional_ubsan_checks=alignment\n    UBSAN_FLAGS=\"-fsanitize=$additional_ubsan_checks -fno-sanitize-recover=$additional_ubsan_checks\"\n    CFLAGS=\"$CFLAGS $UBSAN_FLAGS\"\n    CXXFLAGS=\"$CXXFLAGS $UBSAN_FLAGS\"\n\n    # That's basicaly what --enable-sanitize-undefined does to turn off unaligned access\n    # elfutils heavily relies on on i386/x86_64 but without changing compiler flags along the way\n    sed -i 's/\\(check_undefined_val\\)=[0-9]/\\1=1/' configure.ac\nfi\n\nif [[ \"$SANITIZER\" == memory ]]; then\n    CFLAGS+=\" -U_FORTIFY_SOURCE\"\n    CXXFLAGS+=\" -U_FORTIFY_SOURCE\"\nfi\n\n$CC --version\nautoreconf -i -f\nif ! ./configure --enable-maintainer-mode --disable-debuginfod --disable-libdebuginfod \\\n            --disable-demangler --without-bzlib --without-lzma --without-zstd \\\n\t    CC=\"$CC\" CFLAGS=\"-Wno-error $CFLAGS\" CXX=\"$CXX\" CXXFLAGS=\"-Wno-error $CXXFLAGS\" LDFLAGS=\"$CFLAGS\"; then\n    cat config.log\n    exit 1\nfi\n\nASAN_OPTIONS=detect_leaks=0 make -j$(nproc) V=1\n\n# External dependencies used by the fuzz targets have to be built\n# with MSan explicitly to avoid bogus \"security\" bug reports like\n# https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45630,\n# https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45631 and\n# https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45633\n# To make sure all the fuzz targets use the same version of zlib\n# it's also built with ASan and UBSan.\ngit clone https://github.com/madler/zlib\npushd zlib\ngit checkout v1.3.1\nif ! ./configure --static; then\n    cat configure.log\n    exit 1\nfi\nmake -j$(nproc) V=1\npopd\nzlib=zlib/libz.a\n\n# When new fuzz targets are added it usually makes sense to notify the maintainers of\n# the elfutils project using the mailing list: elfutils-devel@sourceware.org. There\n# fuzz targets can be reviewed properly (to make sure they don't fail to compile\n# with -Werror for example), their names can be chosen accordingly (so as not to spam\n# the mailing list with bogus bug reports that are opened and closed once they are renamed)\n# and so on. Also since a lot of bug reports coming out of the blue aren't exactly helpful\n# fuzz targets should probably be added one at a time to make it easier to keep track\n# of them.\nCFLAGS+=\" -Werror -Wall -Wextra\"\nCXXFLAGS+=\" -Werror -Wall -Wextra\"\n\n# fuzz-dwfl-core is kind of a systemd fuzz target in the sense that it resembles the\n# code systemd uses to parse coredumps. Please ping @evverx if it's changed.\n$CC $CFLAGS \\\n\t-D_GNU_SOURCE -DHAVE_CONFIG_H \\\n\t-I. -I./lib -I./libelf -I./libebl -I./libdw -I./libdwelf -I./libdwfl -I./libasm \\\n\t-c \"$SRC/fuzz-dwfl-core.c\" -o fuzz-dwfl-core.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz-dwfl-core.o \\\n\t./libdw/libdw.a ./libelf/libelf.a ./lib/libeu.a \"$zlib\" \\\n\t-o \"$OUT/fuzz-dwfl-core\"\n\n$CC $CFLAGS \\\n  -D_GNU_SOURCE -DHAVE_CONFIG_H \\\n  -I. -I./lib -I./libelf -I./libebl -I./libdw -I./libdwelf -I./libdwfl -I./libasm \\\n  -c \"$SRC/fuzz-libelf.c\" -o fuzz-libelf.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz-libelf.o \\\n\t./libasm/libasm.a ./libebl/libebl.a ./backends/libebl_backends.a ./libcpu/libcpu.a \\\n  ./libdw/libdw.a ./libelf/libelf.a ./lib/libeu.a \"$zlib\" \\\n\t-o \"$OUT/fuzz-libelf\"\n\n$CC $CFLAGS \\\n  -D_GNU_SOURCE -DHAVE_CONFIG_H \\\n  -I. -I./lib -I./libelf -I./libebl -I./libdw -I./libdwelf -I./libdwfl -I./libasm \\\n  -c \"$SRC/fuzz-libdwfl.c\" -o fuzz-libdwfl.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz-libdwfl.o \\\n\t./libasm/libasm.a ./libebl/libebl.a ./backends/libebl_backends.a ./libcpu/libcpu.a \\\n  ./libdw/libdw.a ./libelf/libelf.a ./lib/libeu.a \"$zlib\" \\\n\t-o \"$OUT/fuzz-libdwfl\"\n"
  },
  {
    "path": "projects/elfutils/fuzz-dwfl-core.c",
    "content": "/*\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#include <assert.h>\n#include <config.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include ELFUTILS_HEADER(dwfl)\n\nstatic const Dwfl_Callbacks core_callbacks = {\n\t.find_elf = dwfl_build_id_find_elf,\n\t.find_debuginfo = dwfl_standard_find_debuginfo,\n};\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tchar name[] = \"/tmp/fuzz-dwfl-core.XXXXXX\";\n\tint fd = -1;\n\tssize_t n;\n\toff_t offset;\n\tElf *core = NULL;\n\tDwfl *dwfl = NULL;\n\n\tfd = mkstemp(name);\n\tassert(fd >= 0);\n\n\tn = write(fd, data, size);\n\tassert(n == (ssize_t) size);\n\n\toffset = lseek(fd, 0, SEEK_SET);\n\tassert(offset == 0);\n\n\telf_version(EV_CURRENT);\n\tcore = elf_begin(fd, ELF_C_READ_MMAP, NULL);\n\tif (core == NULL)\n\t\tgoto cleanup;\n\tdwfl = dwfl_begin(&core_callbacks);\n\tassert(dwfl != NULL);\n\tif (dwfl_core_file_report(dwfl, core, NULL) < 0)\n\t\tgoto cleanup;\n\tif (dwfl_report_end(dwfl, NULL, NULL) != 0)\n\t\tgoto cleanup;\n\tif (dwfl_core_file_attach(dwfl, core) < 0)\n\t\tgoto cleanup;\n\ncleanup:\n\tdwfl_end(dwfl);\n\telf_end(core);\n\tclose(fd);\n\tunlink(name);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/elfutils/fuzz-libdwfl.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <assert.h>\n#include <fcntl.h>\n#include <gelf.h>\n#include <inttypes.h>\n#include <libelf.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include \"libdwfl.h\"\n#include \"system.h\"\n\nstatic const char *debuginfo_path = \"\";\nstatic const Dwfl_Callbacks cb  = {\n  NULL,\n  dwfl_standard_find_debuginfo,\n  NULL,\n  (char **)&debuginfo_path,\n};\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[] = \"/tmp/fuzz-libdwfl.XXXXXX\";\n  int fd;\n  ssize_t n;\n\n  fd = mkstemp(filename);\n  assert(fd >= 0);\n\n  n = write_retry(fd, data, size);\n  assert(n == (ssize_t) size);\n\n  close(fd);\n\n  Dwarf_Addr bias = 0;\n  Dwfl *dwfl = dwfl_begin(&cb);\n  dwfl_report_begin(dwfl);\n\n  Dwfl_Module *mod = dwfl_report_offline(dwfl, filename, filename, -1);\n  dwfl_module_getdwarf(mod, &bias);\n\n  dwfl_end (dwfl);\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/elfutils/fuzz-libelf.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <assert.h>\n#include <fcntl.h>\n#include <gelf.h>\n#include <inttypes.h>\n#include <libelf.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include \"system.h\"\n\n\nvoid fuzz_logic_one(char *filename, int compression_type) {\n  (void)elf_version(EV_CURRENT);\n  int fd = open(filename, O_RDONLY);\n  Elf *elf = elf_begin(fd, ELF_C_READ, NULL);\n  if (elf != NULL) {\n    size_t strndx;\n    elf_getshdrstrndx(elf, &strndx);\n\n    Elf_Scn *scn = NULL;\n    // Iterate through sections\n    while ((scn = elf_nextscn(elf, scn)) != NULL) {\n      GElf_Shdr mem;\n      GElf_Shdr *shdr = gelf_getshdr(scn, &mem);\n      const char *name = elf_strptr(elf, strndx, shdr->sh_name);\n\n      // Two options for reading sections. We keep the code structure\n      // so it resembles the test code.\n      // Compress and get data of the section\n      if ((shdr->sh_flags & SHF_COMPRESSED) != 0) {\n        if (elf_compress(scn, compression_type, 0) >= 0) {\n          elf_getdata(scn, NULL);\n        }\n      } else if (name != NULL) {\n        if (name[0] == '.' && name[1] == 'z') {\n          if (elf_compress_gnu(scn, 0, 0) >= 0) {\n            elf_getdata(scn, NULL);\n          }\n        }\n      }\n    }\n    elf_end(elf);\n  }\n  close(fd);\n}\n\nvoid fuzz_logic_twice(char *filename, int open_flags, Elf_Cmd cmd) {\n  (void)elf_version(EV_CURRENT);\n  int fd = open(filename, open_flags);\n  Elf *elf = elf_begin(fd, cmd, NULL);\n  if (elf != NULL) {\n    size_t elf_size = 0;\n    elf_rawfile(elf, &elf_size);\n    elf_end(elf);\n  }\n  close(fd);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[] = \"/tmp/fuzz-libelf.XXXXXX\";\n  int fd;\n  ssize_t n;\n\n  fd = mkstemp(filename);\n  assert(fd >= 0);\n\n  n = write_retry(fd, data, size);\n  assert(n == (ssize_t) size);\n\n  close(fd);\n\n  fuzz_logic_one(filename, 0);\n  fuzz_logic_one(filename, 1);\n  fuzz_logic_twice(filename, O_RDONLY, ELF_C_READ);\n  fuzz_logic_twice(filename, O_RDONLY | O_WRONLY, ELF_C_RDWR);\n  fuzz_logic_twice(filename, O_RDONLY, ELF_C_READ_MMAP);\n  fuzz_logic_twice(filename, O_RDONLY | O_WRONLY, ELF_C_RDWR_MMAP);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/elfutils/project.yaml",
    "content": "homepage: \"https://sourceware.org/elfutils/\"\nlanguage: c++\nbuilds_per_day: 4\nprimary_contact: \"david@adalogics.com\"\nmain_repo: \"https://sourceware.org/git/elfutils.git\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nview_restrictions: none\nauto_ccs:\n  - amerey@redhat.com\n  - izzeem@google.com\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/envoy/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:56905c98ae0083d14da0e7371184e694560a74750533f321ac0e9145af0e8d2e\n# ! This project was pinned after a clang bump. Please remove the pin, Try to fix any build warnings and errors, as well as runtime errors\n# see https://github.com/google/oss-fuzz/pull/12365\n\n\nRUN apt-get update && apt-get -y install  \\\n\tbuild-essential \\\n\topenjdk-8-jdk   \\\n\tmake            \\\n    ninja-build     \\\n    curl            \\\n    autoconf        \\\n    libtool         \\\n    wget            \\\n    golang          \\\n    rsync           \\\n    python3\n\nRUN git clone https://github.com/envoyproxy/envoy.git\nWORKDIR $SRC/envoy/\nCOPY build.sh $SRC/\nCOPY WORKSPACE $SRC/envoy/\n"
  },
  {
    "path": "projects/envoy/WORKSPACE",
    "content": "workspace(name = \"envoy\")\n\nload(\"//bazel:api_binding.bzl\", \"envoy_api_binding\")\n\nenvoy_api_binding()\n\nload(\"//bazel:api_repositories.bzl\", \"envoy_api_dependencies\")\n\nenvoy_api_dependencies()\n\nload(\"//bazel:repositories.bzl\", \"envoy_dependencies\")\n\nenvoy_dependencies()\n\nload(\"//bazel:bazel_deps.bzl\", \"envoy_bazel_dependencies\")\n\nenvoy_bazel_dependencies()\n\nload(\"//bazel:repositories_extra.bzl\", \"envoy_dependencies_extra\")\n\nenvoy_dependencies_extra(ignore_root_user_error=True)\n\nload(\"//bazel:python_dependencies.bzl\", \"envoy_python_dependencies\")\n\nenvoy_python_dependencies()\n\nload(\"//bazel:dependency_imports.bzl\", \"envoy_dependency_imports\")\n\nenvoy_dependency_imports()\n\nload(\"//bazel:repo.bzl\", \"envoy_repo\")\n\nenvoy_repo()\n\nload(\"//bazel:toolchains.bzl\", \"envoy_toolchains\")\n\nenvoy_toolchains()\n"
  },
  {
    "path": "projects/envoy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Overcome missing dependency declaration with path mapping issue. This is\n# similar to the current abseil build (see\n# https://github.com/google/oss-fuzz/pull/12858), to overcome the issue\n# mentioned in https://github.com/bazelbuild/bazel/issues/23681.\nexport USE_BAZEL_VERSION=7.4.0\n\ndeclare -r FUZZ_TARGET_QUERY='\n  let all_fuzz_tests = attr(tags, \"fuzz_target\", \"test/...\") in\n  $all_fuzz_tests - attr(tags, \"no_fuzz\", $all_fuzz_tests)\n'\n\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n  # CI has fewer resources so restricting to a small number of fuzz targets.\n  # Choosing the header_parser, and header_map_impl.\n  declare -r OSS_FUZZ_TARGETS=\"$(bazel query \"${FUZZ_TARGET_QUERY}\" | grep ':header' | sed 's/$/_oss_fuzz/')\"\nelse\n  declare -r OSS_FUZZ_TARGETS=\"$(bazel query \"${FUZZ_TARGET_QUERY}\" | sed 's/$/_oss_fuzz/')\"\nfi\n\ndeclare -r EXTRA_BAZEL_FLAGS=\"$(\n# Disabling layering_check because it breaks the abseil build. See\n# https://github.com/google/oss-fuzz/blob/f0fa8b5cd3f99b5905e91b336d07a870ca1bc2e3/projects/abseil-cpp/build.sh#L17-L21.\necho \"--features=-layering_check\"\nif [ -n \"$CC\" ]; then\n  echo \"--action_env=CC=${CC}\"\nfi\nif [ -n \"$CXX\" ]; then\n  echo \"--action_env=CXX=${CXX}\"\nfi\necho \"--host_action_env=CC=gcc\"\nif [ \"$SANITIZER\" = \"undefined\" ]\nthen\n  # Bazel uses clang to link binary, which does not link clang_rt ubsan library for C++ automatically.\n  # See issue: https://github.com/bazelbuild/bazel/issues/8777\n  echo \"--linkopt=$(clang -print-file-name=libclang_rt.ubsan_standalone_cxx.a)\"\n  echo \"--linkopt=-fsanitize=undefined\"\nelif [ \"$SANITIZER\" = \"address\" ]\nthen\n  echo \"--copt=-D__SANITIZE_ADDRESS__\" \"--copt=-DADDRESS_SANITIZER=1\" \"--linkopt=-fsanitize=address\"\nfi\n)\"\n\n# The Envoy build configuration may clobber CFLAGS/CXXFLAGS, so we use separate\n# environment variables that are understood by rules_fuzzing.\nexport FUZZING_CFLAGS=\"$CFLAGS\"\nexport FUZZING_CXXFLAGS=\"$CXXFLAGS\"\n\n# Disable instrumentation in various external libraries. These\n# are fuzzed elsewhere.\n# The following disables both coverage-instrumentation and other sanitizer instrumentation.\n# We disable instrumentation in:\n#  antlr4\n#  google_protobuf\n#  absl\n#  googltest\n#  grpc\n#  boringssl\n#  re2\n#  upb\n#  brotli\n#  cel_cpp\n#  yaml_cpp\n#  wasm_cpp_host\n#  libprotobuf-mutator\n#  google_url (gurl)\n#  lightstep_tracer\n# In addition to this, we disable instrumentation in all *.pb.cc (protobuf-generated files)\n# and everything in the bazel-out directory.\ndeclare -r DI=\"$(\nif [ \"$SANITIZER\" != \"coverage\" ]\nthen\n# Envoy code. Disable coverage instrumentation\n  echo \" --per_file_copt=^.*source/extensions/access_loggers/.*\\.cc\\$@-fsanitize-coverage=0\"\n  echo \" --per_file_copt=^.*source/common/protobuf/.*\\.cc\\$@-fsanitize-coverage=0\"\n\n# Envoy test code. Disable coverage instrumentation\n  echo \" --per_file_copt=^.*test/.*\\.cc\\$@-fsanitize-coverage=0\"\n\n# External dependencies. Disable all instrumentation.\n  echo \" --per_file_copt=^.*com_google_protobuf.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*com_google_absl.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*com_github_grpc_grpc.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*boringssl.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*com_googlesource_code_re2.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*upb.*\\.cpp\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*org_brotli.*\\.cpp\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*com_github_jbeder_yaml_cpp.*\\.cpp\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*proxy_wasm_cpp_host/.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*com_github_google_libprotobuf_mutator/.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*com_googlesource_googleurl/.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*com_lightstep_tracer_cpp/.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n\n# External dependency which needs to be compiled with sanitizers. Disable\n# coverage instrumentation.\n  echo \" --per_file_copt=^.*com_google_cel_cpp.*\\.cpp\\$@-fsanitize-coverage=0\"\n  echo \" --per_file_copt=^.*antlr4_runtimes.*\\.cpp\\$@-fsanitize-coverage=0\"\n  echo \" --per_file_copt=^.*googletest.*\\.cc\\$@-fsanitize-coverage=0\"\n\n# All protobuf code and code in bazel-out\n  echo \" --per_file_copt=^.*\\.pb\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\n  echo \" --per_file_copt=^.*bazel-out/.*\\.cc\\$@-fsanitize-coverage=0,-fno-sanitize=all\"\nfi\n)\"\n\n\n# Asssuming we have ~32 cores and ~28.8 GiB RAM. By limiting the\n# number of CPUs (--local_cpu_resources) we limit the per-CPU mem-usage.\n# Benchmark about 3.6 GB per CPU (8 threads for 28.8 GB RAM)\n# TODO(asraa): Remove deprecation warnings when Envoy and deps moves to C++17\nbazel build --verbose_failures --dynamic_mode=off ${DI} \\\n  --spawn_strategy=standalone --genrule_strategy=standalone \\\n  --local_cpu_resources=HOST_CPUS*0.256 \\\n  --//source/extensions/wasm_runtime/v8:enabled=false \\\n  --build_tag_filters=-no_asan --config=oss-fuzz \\\n  ${EXTRA_BAZEL_FLAGS} \\\n  ${OSS_FUZZ_TARGETS[*]}\n\n# Profiling with coverage requires that we resolve+copy all Bazel symlinks and\n# also remap everything under proc/self/cwd to correspond to Bazel build paths.\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  # The build invoker looks for sources in $SRC, but it turns out that we need\n  # to not be buried under src/, paths are expected at out/proc/self/cwd by\n  # the profiler.\n  declare -r REMAP_PATH=\"${OUT}/proc/self/cwd\"\n  mkdir -p \"${REMAP_PATH}\"\n  # Copy the cc and header files that will be covered.\n  rsync -av \"${SRC}\"/envoy/source \"${REMAP_PATH}\"\n  rsync -av \"${SRC}\"/envoy/test \"${REMAP_PATH}\"\n  rsync -av \"${SRC}\"/envoy/envoy \"${REMAP_PATH}\"\n  # Envoy currently uses a modified version of http_parser (see:\n  # https://github.com/envoyproxy/envoy/issues/19749).\n  declare -r BAZEL_EXTERNAL_REMAP_PATH=\"${REMAP_PATH}/external/envoy/bazel/external\"\n  mkdir -p \"${BAZEL_EXTERNAL_REMAP_PATH}\"\n  rsync -av \"${SRC}\"/envoy/bazel/external/http_parser \"${BAZEL_EXTERNAL_REMAP_PATH}\"\n  # Remove filesystem loop manually.\n  rm -rf \"${SRC}\"/envoy/bazel-envoy/external/envoy\n  # Clean up symlinks with a missing referrant.\n  find \"${SRC}\"/envoy/bazel-envoy/external -follow -type l -ls -delete || echo \"Symlink cleanup soft fail\"\n  rsync -avLk \"${SRC}\"/envoy/bazel-envoy/external \"${REMAP_PATH}\"\n  # For .h, and some generated artifacts, we need bazel-out/. Need to heavily\n  # filter out the build objects from bazel-out/. Also need to resolve symlinks,\n  # since they don't make sense outside the build container.\n  declare -r RSYNC_FILTER_ARGS=(\"--include\" \"*.h\" \"--include\" \"*.cc\" \"--include\" \\\n    \"*.hpp\" \"--include\" \"*.cpp\" \"--include\" \"*.c\" \"--include\" \"*/\" \"--exclude\" \"*\")\n  rsync -avLk \"${RSYNC_FILTER_ARGS[@]}\" \"${SRC}\"/envoy/bazel-out \"${REMAP_PATH}\"\n  rsync -avLkR \"${RSYNC_FILTER_ARGS[@]}\" \"${HOME}\" \"${OUT}\"\n  rsync -avLkR \"${RSYNC_FILTER_ARGS[@]}\" /tmp \"${OUT}\"\nfi\n\nfor oss_fuzz_archive in $(find bazel-bin/ -name '*_oss_fuzz.tar'); do\n    tar -xvf \"${oss_fuzz_archive}\" -C \"${OUT}\"\ndone\n\n# Cleanup bazel- symlinks to avoid oss-fuzz trying to copy out of the build\n# cache.\nrm -f bazel-*\n"
  },
  {
    "path": "projects/envoy/project.yaml",
    "content": "homepage: \"https://www.envoyproxy.io/\"\nlanguage: c++\nprimary_contact: \"htuch@google.com\"\nauto_ccs:\n  - \"mattklein123@gmail.com\"\n  - \"jmarantz@google.com\"\n  - \"envoy-security@googlegroups.com\"\n  - \"yavlasov@google.com\"\n  - \"adip@google.com\"\n  - \"yanjunxiang@google.com\"\n  - \"tgschwen@google.com\"\n  - \"boteng@google.com\"\n  - \"pgal@google.com\"\n  - \"leonti@google.com\"\n  - \"copybara-watcher-pod-watcher-git@system.gserviceaccount.com\"\n  - \"copybara-worker@system.gserviceaccount.com\"\ncoverage_extra_args: -ignore-filename-regex=.*\\.cache.*envoy_deps_cache.*\nmain_repo: 'https://github.com/envoyproxy/envoy.git'\nsanitizers:\n - address\n - undefined\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nlabels:\n  \"*\":\n    - ossfuzz-bugz-1149782\n\n"
  },
  {
    "path": "projects/esp-v2/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n## This file was copied from envoy (with minor changes).\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get -y install  \\\n    build-essential \\\n    openjdk-8-jdk   \\\n    make            \\\n    ninja-build     \\\n    curl            \\\n    autoconf        \\\n    libtool         \\\n    wget            \\\n    golang          \\\n    python          \\\n    rsync\n\n# Install Bazelisk\nRUN wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v0.0.8/bazelisk-linux-amd64; \\\n    chmod +x /usr/local/bin/bazel\n\nRUN git clone --depth 1 https://github.com/GoogleCloudPlatform/esp-v2.git\nWORKDIR $SRC/esp-v2/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/esp-v2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncat <<EOF >> .bazelrc\n#build:oss-fuzz --config=fuzzing\nbuild:oss-fuzz --define=FUZZING_ENGINE=oss-fuzz\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=oss-fuzz\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_sanitizer=none\nbuild:oss-fuzz --dynamic_mode=off\nbuild:oss-fuzz --strip=never\nbuild:oss-fuzz --copt=-fno-sanitize=vptr\nbuild:oss-fuzz --linkopt=-fno-sanitize=vptr\nbuild:oss-fuzz --define=tcmalloc=disabled\nbuild:oss-fuzz --define=signal_trace=disabled\nbuild:oss-fuzz --copt=-D_LIBCPP_DISABLE_DEPRECATION_WARNINGS\nbuild:oss-fuzz --define=force_libcpp=enabled\nbuild:oss-fuzz --linkopt=-lc++\nbuild:oss-fuzz --linkopt=-pthread\nEOF\n\n## Copied from envoy\nexport CFLAGS=\"$CFLAGS\"\nexport CXXFLAGS=\"$CXXFLAGS\"\n\n# Copy $CFLAGS and $CXXFLAGS into Bazel command-line flags, for both\n# compilation and linking.\n#\n# Some flags, such as `-stdlib=libc++`, generate warnings if used on a C source\n# file. Since the build runs with `-Werror` this will cause it to break, so we\n# use `--conlyopt` and `--cxxopt` instead of `--copt`.\n#\ndeclare -r EXTRA_BAZEL_FLAGS=\"$(\nfor f in ${CFLAGS}; do\n  echo \"--conlyopt=${f}\" \"--linkopt=${f}\"\ndone\nfor f in ${CXXFLAGS}; do\n  echo \"--cxxopt=${f}\" \"--linkopt=${f}\"\ndone\nif [ \"$SANITIZER\" = \"undefined\" ]\nthen\n  # Bazel uses clang to link binary, which does not link clang_rt ubsan library for C++ automatically.\n  # See issue: https://github.com/bazelbuild/bazel/issues/8777\n  echo \"--linkopt=$(find $(llvm-config --libdir) -name libclang_rt.ubsan_standalone_cxx-x86_64.a | head -1)\"\n  echo \"--linkopt=-fsanitize=undefined\"\nelif [ \"$SANITIZER\" = \"address\" ]\nthen\n  echo \"--copt=-D__SANITIZE_ADDRESS__\" \"--copt=-DADDRESS_SANITIZER=1\" \"--linkopt=-fsanitize=address\"\nfi\n)\"\n\n# Find targets\ndeclare BAZEL_BUILD_TARGETS=\"\"\ndeclare BAZEL_CORPUS_TARGETS=\"\"\ndeclare FILTERED_FUZZER_TARGETS=\"\"\n\n# In CI we only build a single target as otherwise we exhaust resources in the CI\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n  fuzz_suffix='json_struct_fuzz_test$'\nelse\n  fuzz_suffix='_fuzz_test$'\nfi\n\nfor t in $(bazel query 'src/...' --output label | grep $fuzz_suffix)\ndo\n  declare TAGGED=$(bazel query \"attr('tags', 'no_fuzz', ${t})\")\n  if [ -z \"${TAGGED}\" ]\n  then\n    BASE_PATH=${t//://}\n    BASE_PATH=${BASE_PATH#\"//\"}\n    FILTERED_FUZZER_TARGETS+=\"${BASE_PATH} \"\n    BAZEL_BUILD_TARGETS+=\"${t} \"\n    BAZEL_CORPUS_TARGETS+=\"${t}_corpus \"\n  fi\ndone\n\n# Build driverless libraries.\n# Benchmark about 3 GB per CPU (10 threads for 28.8 GB RAM)\n# TODO(nareddyt): Remove deprecation warnings when Envoy and deps moves to C++17\nbazel build --verbose_failures --dynamic_mode=off --spawn_strategy=sandboxed \\\n  --local_cpu_resources=HOST_CPUS*0.32 \\\n  --genrule_strategy=standalone --strip=never \\\n  --copt=-fno-sanitize=vptr --linkopt=-fno-sanitize=vptr \\\n  --define tcmalloc=disabled --define signal_trace=disabled \\\n  --define ENVOY_CONFIG_ASAN=1 \\\n  --define force_libcpp=enabled --build_tag_filters=-no_asan \\\n  --linkopt=-lc++ --linkopt=-pthread ${EXTRA_BAZEL_FLAGS} --config=oss-fuzz \\\n  ${BAZEL_BUILD_TARGETS[*]} ${BAZEL_CORPUS_TARGETS[*]}\n\n# Profiling with coverage requires that we resolve+copy all Bazel symlinks and\n# also remap everything under proc/self/cwd to correspond to Bazel build paths.\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  # The build invoker looks for sources in $SRC, but it turns out that we need\n  # to not be buried under src/, paths are expected at out/proc/self/cwd by\n  # the profiler.\n  declare -r REMAP_PATH=\"${OUT}/proc/self/cwd\"\n  mkdir -p \"${REMAP_PATH}\"\n\n  rsync -av \"${SRC}\"/esp-v2/src \"${REMAP_PATH}\"\n  # Remove filesystem loop manually.\n  rm -rf \"${SRC}\"/esp-v2/bazel-esp-v2/external/esp-v2\n  # Clean up symlinks with a missing referrant.\n  find \"${SRC}\"/esp-v2/bazel-esp-v2/external -follow -type l -ls -delete || echo \"Symlink cleanup soft fail\"\n  rsync -avLk \"${SRC}\"/esp-v2/bazel-esp-v2/external \"${REMAP_PATH}\"\n  # For .h, and some generated artifacts, we need bazel-out/. Need to heavily\n  # filter out the build objects from bazel-out/. Also need to resolve symlinks,\n  # since they don't make sense outside the build container.\n  declare -r RSYNC_FILTER_ARGS=(\"--include\" \"*.h\" \"--include\" \"*.cc\" \"--include\" \\\n    \"*.hpp\" \"--include\" \"*.cpp\" \"--include\" \"*.c\" \"--include\" \"*/\" \"--exclude\" \"*\")\n  rsync -avLk \"${RSYNC_FILTER_ARGS[@]}\" \"${SRC}\"/esp-v2/bazel-out \"${REMAP_PATH}\"\n  rsync -avLkR \"${RSYNC_FILTER_ARGS[@]}\" \"${HOME}\" \"${OUT}\"\n  # Some low-level libraries are built located /tmp.\n  # But ESPv2 engineeers don't really look at them.\n  # rsync -avLkR \"${RSYNC_FILTER_ARGS[@]}\" /tmp \"${OUT}\"\nfi\n\n# Copy out test driverless binaries from bazel-bin/.\nfor t in ${FILTERED_FUZZER_TARGETS}\ndo\n  TARGET_BASE=\"$(expr \"$t\" : '.*/\\(.*\\)_fuzz_test')\"\n  TARGET_DRIVERLESS=bazel-bin/\"${t}\"\n  echo \"Copying fuzzer $t\"\n  cp \"${TARGET_DRIVERLESS}\" \"${OUT}\"/\"${TARGET_BASE}\"_fuzz_test\ndone\n\n# Zip up related test corpuses.\n# TODO(nareddyt): just use the .tar directly when\n# https://github.com/google/oss-fuzz/issues/1918 is fixed.\nCORPUS_UNTAR_PATH=\"${PWD}\"/_tmp_corpus\nfor t in ${FILTERED_FUZZER_TARGETS}\ndo\n  echo \"Extracting and zipping fuzzer $t corpus\"\n  TARGET_BASE=\"$(expr \"$t\" : '.*/\\(.*\\)_fuzz_test')\"\n  zip \"${OUT}/${TARGET_BASE}\"_seed_corpus.zip bazel-bin/\"${t}\"_corpus/*\ndone\n\n# Cleanup bazel- symlinks to avoid oss-fuzz trying to copy out of the build\n# cache.\nrm -f bazel-*\n"
  },
  {
    "path": "projects/esp-v2/project.yaml",
    "content": "homepage: \"https://github.com/GoogleCloudPlatform/esp-v2\"\nlanguage: c++\nprimary_contact: \"nareddyt@google.com\"\nauto_ccs:\n- \"taoxuy@google.com\"\n- \"qiwzhang@google.com\"\nsanitizers:\n- address\n- undefined\ncoverage_extra_args: -ignore-filename-regex=.*\\.cache.* -ignore-filename-regex=.*bazel-out.*\nmain_repo: 'https://github.com/GoogleCloudPlatform/esp-v2.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/espeak-ng/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt install -y cmake pkg-config\nRUN git clone --depth 1 https://github.com/espeak-ng/espeak-ng\nCOPY build.sh $SRC\nWORKDIR $SRC/espeak-ng\n"
  },
  {
    "path": "projects/espeak-ng/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project with cmake\nexport ASAN_OPTIONS=detect_leaks=0\nmkdir -p build\ncd build\ncmake .. -DCMAKE_C_COMPILER=\"$CC\" \\\n         -DCMAKE_CXX_COMPILER=\"$CXX\" \\\n         -DCMAKE_C_FLAGS=\"$CFLAGS\" \\\n         -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n         -DBUILD_SHARED_LIBS=OFF\nmake -j$(nproc)\ncd ..\n\n# Build the ssml-fuzzer manually with $LIB_FUZZING_ENGINE\n$CC $CFLAGS -Ibuild/src/libespeak-ng/include -I. -Isrc/include -c tests/ssml-fuzzer.c -o tests/ssml-fuzzer.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE tests/ssml-fuzzer.o \\\n    build/src/libespeak-ng/libespeak-ng.a \\\n    build/src/speechPlayer/libspeechPlayer.a \\\n    build/src/ucd-tools/libucd.a -o $OUT/ssml-fuzzer -lm\n\ncp -r build/espeak-ng-data/ $OUT/\n"
  },
  {
    "path": "projects/espeak-ng/project.yaml",
    "content": "homepage: \"https://github.com/espeak-ng/espeak-ng\"\nlanguage: c++\nprimary_contact: \"msclrhd@googlemail.com\"\nauto_ccs:\n- \"valdis.vitolins@gmail.com\"\n- \"p.antoine@catenacyber.fr\"\n- \"sascha.brawer@gmail.com\"\n\nsanitizers:\n- address\nfuzzing_engines:\n- libfuzzer\n- afl\nmain_repo: 'https://github.com/espeak-ng/espeak-ng'\n"
  },
  {
    "path": "projects/et-xmlfile/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/lxml/lxml\nRUN apt-get install -y libxml2-dev libxslt-dev zlib1g-dev\nRUN pip3 install Cython\n\nRUN git clone --depth 1 https://github.com/biydnd/et_xmlfile et_xmlfile\nWORKDIR et_xmlfile\nRUN mkdir $SRC/et-xmlfile-fuzzers\nCOPY *.py $SRC/et-xmlfile-fuzzers/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/et-xmlfile/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/lxml\npython3 ./setup.py install\n\ncd $SRC/et_xmlfile\npip3 install .\nfor fuzzer in $(find $SRC/et-xmlfile-fuzzers/ -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/et-xmlfile/fuzz_write.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom io import BytesIO\n\ntry:\n    import lxml\nexcept ImportError:\n    raise ImportError(\"lxml is required to run the tests.\")\n\nfrom et_xmlfile import xmlfile\n\ndef recursive_write(xf, fdp, level):\n    if level == 1:\n        xf.write(fdp.ConsumeUnicodeNoSurrogates(50))\n    else:\n        with xf.element(fdp.ConsumeUnicodeNoSurrogates(50)):\n            recursive_write(xf, fdp, level-1)\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    f2 = BytesIO()\n    # Call write on et_xmlfile 10 times.\n    with xmlfile(f2) as xf:\n        recursive_write(xf, fdp, 10)\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/et-xmlfile/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/biydnd/et_xmlfile\nlanguage: python\nmain_repo: https://github.com/biydnd/et_xmlfile\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/etcd/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/etcd-io/etcd\nRUN git clone --depth 1 https://github.com/etcd-io/raft\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.23.4.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\nCOPY build.sh $SRC/\nWORKDIR $SRC/etcd\n"
  },
  {
    "path": "projects/etcd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/etcd/build.sh\n"
  },
  {
    "path": "projects/etcd/project.yaml",
    "content": "homepage: \"https://etcd.io\"\nmain_repo: \"https://github.com/etcd-io/etcd\"\nprimary_contact: \"ptab@google.com\"\nauto_ccs :\n  - \"etcd-maintainers@googlegroups.com\"\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"sahdev.zala1@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/evo-inflector/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/atteo/evo-inflector evo-inflector\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/evo-inflector\n"
  },
  {
    "path": "projects/evo-inflector/EnglishFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.atteo.evo.inflector.English;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.atteo.evo.inflector.English] public static java.lang.String\n// plural(java.lang.String)\npublic class EnglishFuzzer {\n  private static English.MODE[] mode = {\n      English.MODE.ENGLISH_ANGLICIZED, English.MODE.ENGLISH_CLASSICAL};\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    English.setMode(data.pickValue(mode));\n    Boolean choice = data.consumeBoolean();\n    if (choice) {\n      English.plural(data.consumeRemainingAsString());\n    } else {\n      Integer int1 = data.consumeInt();\n      English.plural(data.consumeRemainingAsString(), int1);\n    }\n  }\n}\n"
  },
  {
    "path": "projects/evo-inflector/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nfind ./ -name pom.xml -exec sed -i 's/source>1.6</source>1.8</g' {} \\;\nfind ./ -name pom.xml -exec sed -i 's/target>1.6</target>1.8</g' {} \\;\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/evo-inflector-$CURRENT_VERSION.jar\" $OUT/evo-inflector.jar\n\nALL_JARS=\"evo-inflector.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/evo-inflector/project.yaml",
    "content": "homepage: https://github.com/atteo/evo-inflector\nmain_repo: https://github.com/atteo/evo-inflector\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/example/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\n\n# Get *your* source code here.\nRUN git clone https://github.com/google/oss-fuzz.git my-git-repo\nWORKDIR my-git-repo\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/example/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd projects/example/my-api-repo\nmake clean  # Not strictly necessary, since we are building in a fresh dir.\nmake -j$(nproc) all    # Build the fuzz targets.\nmake -j$(nproc) check  # Sanity check, not strictly required, but nice to have.\n\n# Copy the fuzzer executables, zip-ed corpora, option and dictionary files to $OUT\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'     # If you have dictionaries.\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'  # If you have custom options.\nfind . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';' # If you have seed corpora (you better have them!)\n"
  },
  {
    "path": "projects/example/my-api-repo/Makefile",
    "content": "# Copyright 2017 Google Inc. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n\n# Simple example of a build file that nicely integrates a fuzz target\n# with the rest of the project.\n#\n# We use 'make' as the build system, but these ideas are applicable\n# to any other build system\n\n# By default, use our own standalone_fuzz_target_runner.\n# This runner does no fuzzing, but simply executes the inputs\n# provided via parameters.\n# Run e.g. \"make all LIB_FUZZING_ENGINE=/path/to/libFuzzer.a\"\n# to link the fuzzer(s) against a real fuzzing engine.\n#\n# OSS-Fuzz will define its own value for LIB_FUZZING_ENGINE.\nLIB_FUZZING_ENGINE ?= standalone_fuzz_target_runner.o\n\n# Values for CC, CFLAGS, CXX, CXXFLAGS are provided by OSS-Fuzz.\n# Outside of OSS-Fuzz use the ones you prefer or rely on the default values.\n# Do not use the -fsanitize=* flags by default.\n# OSS-Fuzz will use different -fsanitize=* flags for different builds (asan, ubsan, msan, ...)\n\n# You may add extra compiler flags like this:\nCXXFLAGS += -std=c++11\n\nall: do_stuff_unittest do_stuff_fuzzer\n\nclean:\n\trm -fv *.a *.o *unittest *_fuzzer *_seed_corpus.zip crash-* *.zip\n\n# Continuos integration system should run \"make clean && make check\"\ncheck: all\n\t./do_stuff_unittest\n\t./do_stuff_fuzzer do_stuff_test_data/*\n\n# Unit tests\ndo_stuff_unittest: do_stuff_unittest.cpp my_api.a\n\t${CXX} ${CXXFLAGS} $< my_api.a -o $@\n\n# Fuzz target, links against $LIB_FUZZING_ENGINE, so that\n# you may choose which fuzzing engine to use.\ndo_stuff_fuzzer: do_stuff_fuzzer.cpp my_api.a standalone_fuzz_target_runner.o\n\t${CXX} ${CXXFLAGS} $< my_api.a ${LIB_FUZZING_ENGINE} -o $@\n\tzip -q -r do_stuff_fuzzer_seed_corpus.zip do_stuff_test_data\n\n\n# The library itself.\nmy_api.a: my_api.cpp my_api.h\n\t${CXX} ${CXXFLAGS} $< -c\n\tar ruv my_api.a my_api.o\n\n# The standalone fuzz target runner.\nstandalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cpp\n"
  },
  {
    "path": "projects/example/my-api-repo/README.md",
    "content": "Example of [OSS-Fuzz ideal integration](https://google.github.io/oss-fuzz/advanced-topics/ideal-integration/).\n\nThis directory contains an example software project that has most of the traits of [ideal](https://google.github.io/oss-fuzz/advanced-topics/ideal-integration/) support for fuzzing. \n\n## Files in my-api-repo\nImagine that these files reside in your project's repository:\n\n* [my_api.h](my_api.h): and [my_api.cpp](my_api.cpp) implement the API we want to test/fuzz. The function `DoStuff()` inside [my_api.cpp](my_api.cpp) contains a bug. (Find it!)\n* [do_stuff_unittest.cpp](do_stuff_unittest.cpp): is a unit test for `DoStuff()`. Unit tests are not necessary for fuzzing but are generally a good practice.\n* [do_stuff_fuzzer.cpp](do_stuff_fuzzer.cpp): is a [fuzz target](https://llvm.org/docs/LibFuzzer.html#fuzz-target) for `DoStuff()`.\n* [do_stuff_test_data](do_stuff_test_data): corpus directory for [do_stuff_fuzzer.cpp](do_stuff_fuzzer.cpp).\n* [do_stuff_fuzzer.dict](do_stuff_fuzzer.dict): a [fuzzing dictionary file](https://google.github.io/oss-fuzz/getting-started/new-project-guide#dictionaries) for `DoStuff()`. Optional, but may improve fuzzing in many cases. \n* [Makefile](Makefile): is a build file (the same can be done with other build systems):\n  * accepts external compiler flags via `$CC`, `$CXX`, `$CFLAGS`, `$CXXFLAGS`\n  * accepts external fuzzing engine via `$LIB_FUZZING_ENGINE`, by default uses [standalone_fuzz_target_runner.cpp](standalone_fuzz_target_runner.cpp)\n  * builds the fuzz target(s) and their corpus archive(s)\n  * `make check` executes [do_stuff_fuzzer.cpp](do_stuff_fuzzer.cpp) on [`do_stuff_test_data/*`](do_stuff_test_data), thus ensures that the fuzz target is up to date and uses it as a regression test.\n* [standalone_fuzz_target_runner.cpp](standalone_fuzz_target_runner.cpp): is a simple standalone runner for fuzz targets. You may use it to execute a fuzz target on given files w/o having to link in libFuzzer or other fuzzing engine.\n\n## Files in OSS-Fuzz repository\n* [oss-fuzz/projects/example](..)\n  * [Dockerfile](../Dockerfile): sets up the build environment\n  * [build.sh](../build.sh): builds the fuzz target(s). The smaller this file the better (most of the logic should be inside the project's build system).\n  * [project.yaml](../project.yaml): short project description and contact info.\n\n## Example bug\nExample bug report filed automatically: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1562\n\n\n"
  },
  {
    "path": "projects/example/my-api-repo/do_stuff_fuzzer.cpp",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n#include \"my_api.h\"\n\n#include <string>\n\n// Simple fuzz target for DoStuff().\n// See https://llvm.org/docs/LibFuzzer.html for details.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  std::string str(reinterpret_cast<const char *>(data), size);\n  DoStuff(str);  // Disregard the output.\n  return 0;\n}\n"
  },
  {
    "path": "projects/example/my-api-repo/do_stuff_fuzzer.dict",
    "content": "# A dictionary for more efficient fuzzing of DoStuff(). \n# If the inputs contain multi-byte tokens, list them here.\n# See https://llvm.org/docs/LibFuzzer.html#dictionaries\n\"foo\"\n\"bar\"\n\"ouch\"\n"
  },
  {
    "path": "projects/example/my-api-repo/do_stuff_test_data/410c23d234e7f97a2dd6265eb2909324deb8c13a",
    "content": "fomgo"
  },
  {
    "path": "projects/example/my-api-repo/do_stuff_test_data/7a74862169c3375f4149daff75187cbca7372a38",
    "content": "fbaro"
  },
  {
    "path": "projects/example/my-api-repo/do_stuff_test_data/a835d6f1c6b2ae4a35e8c0a4a0576715c8b27283",
    "content": "fo"
  },
  {
    "path": "projects/example/my-api-repo/do_stuff_test_data/fc09d362f05ab97efdfcd873dacad6a9c29e57ff",
    "content": "_oouch"
  },
  {
    "path": "projects/example/my-api-repo/do_stuff_unittest.cpp",
    "content": "// Copyright 2017 Google Inc. All Rights Reserved.\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n\n// Simple unit test for DoStuff().\n// This unit test does not cover the existing bug in DoStuff(),\n// unless you pass an extra parameter (\"BUG\").\n#include \"my_api.h\"\n\n#include <cassert>\n#include <iostream>\n\nvoid TestDoStuff(const std::string &str, size_t Expected) {\n  size_t Result = DoStuff(str);\n  std::cerr << str << \" => \" << Result << std::endl;\n  assert(Result == Expected);\n}\n\nint main(int argc, char **argv) {\n  // Test some simple inputs, verify the output.\n  TestDoStuff(\"\", 0);\n  TestDoStuff(\"foo\", 1);\n  TestDoStuff(\"omg\", 1);\n  TestDoStuff(\"bar\", 1);\n  TestDoStuff(\"ouch\", 1);\n  TestDoStuff(\"foobar\", 3);\n  TestDoStuff(\"foouchbar\", 4);\n  if (argc == 2 && std::string(argv[1]) == \"BUG\") {\n    // This is the missing test that actually triggers the bug.\n    TestDoStuff(\"foouchbaromg\", 4);\n  }\n}\n"
  },
  {
    "path": "projects/example/my-api-repo/my_api.cpp",
    "content": "// Copyright 2017 Google Inc. All Rights Reserved.\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n\n// Implementation of \"my_api\".\n#include \"my_api.h\"\n\n#include <vector>\n\n// Do some computations with 'str', return the result.\n// This function contains a bug. Can you spot it?\nsize_t DoStuff(const std::string &str) {\n  std::vector<int> Vec({0, 1, 2, 3, 4});\n  size_t Idx = 0;\n  if (str.size() > 5)\n    Idx++;\n  if (str.find(\"foo\") != std::string::npos)\n    Idx++;\n  if (str.find(\"bar\") != std::string::npos)\n    Idx++;\n  if (str.find(\"ouch\") != std::string::npos)\n    Idx++;\n  if (str.find(\"omg\") != std::string::npos)\n    Idx++;\n  return Vec[Idx];\n}\n"
  },
  {
    "path": "projects/example/my-api-repo/my_api.h",
    "content": "// Copyright 2017 Google Inc. All Rights Reserved.\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n\n// A library that does ... stuff.\n// Serves as an example of good fuzz testing and OSS-Fuzz integration.\n#include <string>\n\nsize_t DoStuff(const std::string &str);\n"
  },
  {
    "path": "projects/example/my-api-repo/standalone_fuzz_target_runner.cpp",
    "content": "// Copyright 2017 Google Inc. All Rights Reserved.\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n\n// Example of a standalone runner for \"fuzz targets\".\n// It reads all files passed as parameters and feeds their contents\n// one by one into the fuzz target (LLVMFuzzerTestOneInput).\n// This runner does not do any fuzzing, but allows us to run the fuzz target\n// on the test corpus (e.g. \"do_stuff_test_data\") or on a single file,\n// e.g. the one that comes from a bug report.\n\n#include <cassert>\n#include <iostream>\n#include <fstream>\n#include <vector>\n\n// Forward declare the \"fuzz target\" interface.\n// We deliberately keep this inteface simple and header-free.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n\nint main(int argc, char **argv) {\n  for (int i = 1; i < argc; i++) {\n    std::ifstream in(argv[i]);\n    in.seekg(0, in.end);\n    size_t length = in.tellg();\n    in.seekg (0, in.beg);\n    std::cout << \"Reading \" << length << \" bytes from \" << argv[i] << std::endl;\n    // Allocate exactly length bytes so that we reliably catch buffer overflows.\n    std::vector<char> bytes(length);\n    in.read(bytes.data(), bytes.size());\n    assert(in);\n    LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()),\n                           bytes.size());\n    std::cout << \"Execution successful\" << std::endl;\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/example/project.yaml",
    "content": "disabled: true\nhomepage: https://my-api.example.com\nmain_repo: https://github.com/example/my-api\nlanguage: c++\nvendor_ccs: []\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/exiv2/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone https://github.com/Exiv2/exiv2 exiv2\nRUN ./exiv2/ci/install_dependencies.sh\nWORKDIR exiv2\n\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/exiv2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Added to fix a false positive result: https://github.com/google/oss-fuzz/issues/6489\nCXXFLAGS=\"${CXXFLAGS} -fno-sanitize=float-divide-by-zero\"\n\n# Build Exiv2\nmkdir -p build\ncd build\ncmake -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=OFF -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER=\"${CXX}\" -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\" -DEXIV2_BUILD_FUZZ_TESTS=ON -DEXIV2_TEAM_OSS_FUZZ=ON -DLIB_FUZZING_ENGINE=\"${LIB_FUZZING_ENGINE}\" -DEXIV2_ENABLE_INIH=OFF -DCMAKE_CXX_STANDARD=20 ..\nmake -j $(nproc)\n\n# Copy binaries and dictionary to $OUT\ncp ./bin/fuzz-read-print-write $OUT\ncp ./bin/fuzz-read-write $OUT\ncp ./bin/fuzz-preview $OUT\ncp ../fuzz/exiv2.dict $OUT/fuzz-read-print-write.dict\ncp ../fuzz/exiv2.dict $OUT/fuzz-read-write.dict\ncp ../fuzz/exiv2.dict $OUT/fuzz-preview.dict\n\n# Initialize the corpus, using the files in test/data\nmkdir corpus\nfor f in $(find ../test/data -type f -size -20k); do\n    s=$(sha1sum \"$f\" | awk '{print $1}')\n    cp $f corpus/$s\ndone\n\nzip -j $OUT/fuzz-read-print-write.zip corpus/*\nzip -j $OUT/fuzz-read-write.zip corpus/*\nzip -j $OUT/fuzz-preview.zip corpus/*\n"
  },
  {
    "path": "projects/exiv2/project.yaml",
    "content": "homepage: \"https://www.exiv2.org\"\nlanguage: c++\nprimary_contact: \"kevinbackhouse@github.com\"\nauto_ccs:\n  - \"piponazo@gmail.com\"\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/Exiv2/exiv2'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/exiv2/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build -R bugfixTests --output-on-failure\nctest --test-dir build -R tiffTests --output-on-failure\nctest --test-dir build -R versionTests --output-on-failure\nctest --test-dir build -R regressionTests --output-on-failure\n"
  },
  {
    "path": "projects/exp4j/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/fasseg/exp4j exp4j\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/exp4j\n"
  },
  {
    "path": "projects/exp4j/ExpressionBuilderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.EmptyStackException;\nimport net.objecthunter.exp4j.ExpressionBuilder;\nimport net.objecthunter.exp4j.function.Function;\nimport net.objecthunter.exp4j.function.Functions;\nimport net.objecthunter.exp4j.operator.Operator;\nimport net.objecthunter.exp4j.operator.Operators;\n\npublic class ExpressionBuilderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 10));\n\n      ExpressionBuilder builder =\n          new ExpressionBuilder(data.consumeString(data.remainingBytes() / 2));\n      for (Integer choice : choices) {\n        String string = data.consumeString(data.remainingBytes() / choices.length);\n        switch (choice % 3) {\n          case 0:\n            Function func = Functions.getBuiltinFunction(string);\n            if (func != null) {\n              builder = builder.function(func);\n            }\n            break;\n          case 1:\n            Operator op = Operators.getBuiltinOperator(string.charAt(choice % string.length()), 1);\n            if (op != null) {\n              builder = builder.operator(op);\n            }\n            break;\n          case 2:\n            builder = builder.variable(string);\n            break;\n        }\n      }\n      builder.build();\n    } catch (IllegalArgumentException | EmptyStackException | ArithmeticException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/exp4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/exp4j-$CURRENT_VERSION.jar\" $OUT/exp4j.jar\n\nALL_JARS=\"exp4j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/exp4j/project.yaml",
    "content": "homepage: https://github.com/fasseg/exp4j\nmain_repo: https://github.com/fasseg/exp4j\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/expat/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n# Copyright 2025 Sebastian Pipping <sebastian@pipping.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n            cmake \\\n            libprotobuf-dev:amd64 \\\n            libprotobuf-dev:i386 \\\n            libstdc++-9-dev:i386 \\\n            make \\\n            protobuf-compiler\n\nRUN git clone --depth 1 https://github.com/libexpat/libexpat expat\nWORKDIR expat\nCOPY run_tests.sh build.sh *.dict $SRC/\n"
  },
  {
    "path": "projects/expat/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n# Copyright 2025 Sebastian Pipping <sebastian@pipping.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# NOTE: We need to drop -stdlib=libc++ to not get (pages of) link errors when\n#       linking against system Protobuf that is linked against GCC's libstdc++\n#       rather than Clang's own libstdc++\nCXXFLAGS=\"${CXXFLAGS/-stdlib=libc++/ }\"\n\n# NOTE: Without -static-libstdc++, the bad build checker in base-runner\n#       will fail with output:\n#       > error while loading shared libraries: libstdc++.so.6:\n#       > cannot open shared object file: No such file or directory\n#       The addition of -Wno-unused-command-line-argument silences Clang's\n#       misleading output on argument -static-libstdc++ appearing as unused.\nCXXFLAGS=\"${CXXFLAGS} -static-libstdc++ -Wno-unused-command-line-argument\"\n\n: ${LD:=\"${CXX}\"}\n: ${LDFLAGS:=\"${CXXFLAGS}\"}  # to make sure we link with sanitizer runtime\n\ncmake_args=(\n    # Specific to Expat\n    -DEXPAT_BUILD_DOCS=OFF\n    -DEXPAT_BUILD_EXAMPLES=OFF\n    -DEXPAT_BUILD_FUZZERS=ON\n    -DEXPAT_BUILD_TESTS=ON\n    -DEXPAT_BUILD_TOOLS=OFF\n    -DEXPAT_OSSFUZZ_BUILD=ON\n    -DEXPAT_SHARED_LIBS=OFF\n    -DProtobuf_USE_STATIC_LIBS=ON\n\n    # C compiler\n    -DCMAKE_C_COMPILER=\"${CC}\"\n    -DCMAKE_C_FLAGS=\"${CFLAGS}\"\n\n    # C++ compiler\n    -DCMAKE_CXX_COMPILER=\"${CXX}\"\n    -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\"\n\n    # Linker\n    -DCMAKE_LINKER=\"${LD}\"\n    -DCMAKE_EXE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_MODULE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_SHARED_LINKER_FLAGS=\"${LDFLAGS}\"\n)\n\nmkdir -p build\ncd build\ncmake ../expat \"${cmake_args[@]}\"\nmake -j$(nproc)\n\nfor fuzzer in fuzz/*;\ndo\n  cp $fuzzer $OUT\n  fuzzer_name=$(basename $fuzzer)\n  if [[ ${fuzzer_name} =~ ^.*UTF-16$ ]]; then\n    cp $SRC/xml_UTF_16.dict $OUT/${fuzzer_name}.dict\n  elif [[ ${fuzzer_name} =~ ^.*UTF-16LE$ ]]; then\n    cp $SRC/xml_UTF_16LE.dict $OUT/${fuzzer_name}.dict\n  elif [[ ${fuzzer_name} =~ ^.*UTF-16BE$ ]]; then\n    cp $SRC/xml_UTF_16BE.dict $OUT/${fuzzer_name}.dict\n  else\n    cp $SRC/xml.dict $OUT/${fuzzer_name}.dict\n  fi\ndone\n"
  },
  {
    "path": "projects/expat/project.yaml",
    "content": "homepage: \"https://github.com/libexpat/libexpat\"\nlanguage: c++\nprimary_contact: \"sebastian@pipping.org\"\nauto_ccs:\n - \"berkay.ueruen@siemens.com\"\n - \"hanno@hboeck.de\"\n - \"webmaster@hartwork.org\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/libexpat/libexpat'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/expat/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd build\nmake test\n"
  },
  {
    "path": "projects/expat/xml.dict",
    "content": "#\n# AFL dictionary for XML\n# ----------------------\n#\n# Several basic syntax elements and attributes, modeled on libxml2.\n#\n# Created by Michal Zalewski <lcamtuf@google.com>\n#\n\nattr_encoding=\" encoding=\\\"1\\\"\"\nattr_generic=\" a=\\\"1\\\"\"\nattr_href=\" href=\\\"1\\\"\"\nattr_standalone=\" standalone=\\\"no\\\"\"\nattr_version=\" version=\\\"1\\\"\"\nattr_xml_base=\" xml:base=\\\"1\\\"\"\nattr_xml_id=\" xml:id=\\\"1\\\"\"\nattr_xml_lang=\" xml:lang=\\\"1\\\"\"\nattr_xml_space=\" xml:space=\\\"1\\\"\"\nattr_xmlns=\" xmlns=\\\"1\\\"\"\n\nentity_builtin=\"&lt;\"\nentity_decimal=\"&#1;\"\nentity_external=\"&a;\"\nentity_hex=\"&#x1;\"\n\n# keywords\n\"ANY\"\n\"ATTLIST\"\n\"CDATA\"\n\"DOCTYPE\"\n\"ELEMENT\"\n\"EMPTY\"\n\"ENTITIES\"\n\"ENTITY\"\n\"FIXED\"\n\"ID\"\n\"IDREF\"\n\"IDREFS\"\n\"IGNORE\"\n\"IMPLIED\"\n\"INCLUDE\"\n\"NDATA\"\n\"NMTOKEN\"\n\"NMTOKENS\"\n\"NOTATION\"\n\"PCDATA\"\n\"PUBLIC\"\n\"REQUIRED\"\n\"SYSTEM\"\n\n# Various tag parts\n\"<\"\n\">\"\n\"/>\"\n\"</\"\n\"<?\"\n\"?>\"\n\"<!\"\n\"!>\"\n\"[]\"\n\"]]\"\n\"<![CDATA[\"\n\"<![CDATA[]]>\"\n\"\\\"\\\"\"\n\"''\"\n\"=\\\"\\\"\"\n\"=''\"\n\n# DTD\n\"<!ATTLIST\"\n\"<!DOCTYPE\"\n\"<!ELEMENT\"\n\"<!ENTITY\"\n\"<![IGNORE[\"\n\"<![INCLUDE[\"\n\"<!NOTATION\"\n\"#CDATA\"\n\"#FIXED\"\n\"#IMPLIED\"\n\"#PCDATA\"\n\"#REQUIRED\"\n\n# Encodings\n\"ISO-8859-1\"\n\"US-ASCII\"\n\"UTF-8\"\n\"UTF-16\"\n\"UTF-16BE\"\n\"UTF-16LE\"\n\n# Namespaces and schemas\n\"xmlns\"\n\"xmlns:\"\n\"xmlns:xhtml=\\\"http://www.w3.org/1999/xhtml\\\"\"\n\"xmlns:xml=\\\"http://www.w3.org/XML/1998/namespace\\\"\"\n\"xmlns:xmlns=\\\"http://www.w3.org/2000/xmlns\\\"\"\n\nstring_col_fallback=\":fallback\"\nstring_col_generic=\":a\"\nstring_col_include=\":include\"\nstring_dashes=\"--\"\nstring_parentheses=\"()\"\nstring_percent=\"%a\"\nstring_schema=\":schema\"\nstring_ucs4=\"UCS-4\"\ntag_close=\"</a>\"\ntag_open=\"<a>\"\ntag_open_close=\"<a />\"\n\n\n\"<?xml?>\"\n\"http://docboo\"\n\"http://www.w\"\n\"he30\"\n\"he2\"\n\"IET\"\n\"FDF-10\"\n\"aDUCS-4OPveb:\"\n\"a>\"\n\"UT\"\n\"xMl\"\n\"/usr/share/sg\"\n\"ha07\"\n\"http://www.oa\"\n\"cle\"\n"
  },
  {
    "path": "projects/expat/xml_UTF_16.dict",
    "content": "# xml.dict converted to UTF-16 encoding.\n\"\\xff\\xfe \\x00e\\x00n\\x00c\\x00o\\x00d\\x00i\\x00n\\x00g\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00a\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00h\\x00r\\x00e\\x00f\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00s\\x00t\\x00a\\x00n\\x00d\\x00a\\x00l\\x00o\\x00n\\x00e\\x00=\\x00\\\\\\x00\"\\x00n\\x00o\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00v\\x00e\\x00r\\x00s\\x00i\\x00o\\x00n\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00x\\x00m\\x00l\\x00:\\x00b\\x00a\\x00s\\x00e\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00x\\x00m\\x00l\\x00:\\x00i\\x00d\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00x\\x00m\\x00l\\x00:\\x00l\\x00a\\x00n\\x00g\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00x\\x00m\\x00l\\x00:\\x00s\\x00p\\x00a\\x00c\\x00e\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe \\x00x\\x00m\\x00l\\x00n\\x00s\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe&\\x00l\\x00t\\x00;\\x00\"\n\"\\xff\\xfe&\\x00#\\x001\\x00;\\x00\"\n\"\\xff\\xfe&\\x00a\\x00;\\x00\"\n\"\\xff\\xfe&\\x00#\\x00x\\x001\\x00;\\x00\"\n\"\\xff\\xfeA\\x00N\\x00Y\\x00\"\n\"\\xff\\xfeA\\x00T\\x00T\\x00L\\x00I\\x00S\\x00T\\x00\"\n\"\\xff\\xfeC\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"\\xff\\xfeD\\x00O\\x00C\\x00T\\x00Y\\x00P\\x00E\\x00\"\n\"\\xff\\xfeE\\x00L\\x00E\\x00M\\x00E\\x00N\\x00T\\x00\"\n\"\\xff\\xfeE\\x00M\\x00P\\x00T\\x00Y\\x00\"\n\"\\xff\\xfeE\\x00N\\x00T\\x00I\\x00T\\x00I\\x00E\\x00S\\x00\"\n\"\\xff\\xfeE\\x00N\\x00T\\x00I\\x00T\\x00Y\\x00\"\n\"\\xff\\xfeF\\x00I\\x00X\\x00E\\x00D\\x00\"\n\"\\xff\\xfeI\\x00D\\x00\"\n\"\\xff\\xfeI\\x00D\\x00R\\x00E\\x00F\\x00\"\n\"\\xff\\xfeI\\x00D\\x00R\\x00E\\x00F\\x00S\\x00\"\n\"\\xff\\xfeI\\x00G\\x00N\\x00O\\x00R\\x00E\\x00\"\n\"\\xff\\xfeI\\x00M\\x00P\\x00L\\x00I\\x00E\\x00D\\x00\"\n\"\\xff\\xfeI\\x00N\\x00C\\x00L\\x00U\\x00D\\x00E\\x00\"\n\"\\xff\\xfeN\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"\\xff\\xfeN\\x00M\\x00T\\x00O\\x00K\\x00E\\x00N\\x00\"\n\"\\xff\\xfeN\\x00M\\x00T\\x00O\\x00K\\x00E\\x00N\\x00S\\x00\"\n\"\\xff\\xfeN\\x00O\\x00T\\x00A\\x00T\\x00I\\x00O\\x00N\\x00\"\n\"\\xff\\xfeP\\x00C\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"\\xff\\xfeP\\x00U\\x00B\\x00L\\x00I\\x00C\\x00\"\n\"\\xff\\xfeR\\x00E\\x00Q\\x00U\\x00I\\x00R\\x00E\\x00D\\x00\"\n\"\\xff\\xfeS\\x00Y\\x00S\\x00T\\x00E\\x00M\\x00\"\n\"\\xff\\xfe<\\x00\"\n\"\\xff\\xfe>\\x00\"\n\"\\xff\\xfe/\\x00>\\x00\"\n\"\\xff\\xfe<\\x00/\\x00\"\n\"\\xff\\xfe<\\x00?\\x00\"\n\"\\xff\\xfe?\\x00>\\x00\"\n\"\\xff\\xfe<\\x00!\\x00\"\n\"\\xff\\xfe!\\x00>\\x00\"\n\"\\xff\\xfe[\\x00]\\x00\"\n\"\\xff\\xfe]\\x00]\\x00\"\n\"\\xff\\xfe<\\x00!\\x00[\\x00C\\x00D\\x00A\\x00T\\x00A\\x00[\\x00\"\n\"\\xff\\xfe<\\x00!\\x00[\\x00C\\x00D\\x00A\\x00T\\x00A\\x00[\\x00]\\x00]\\x00>\\x00\"\n\"\\xff\\xfe\\\\\\x00\"\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe'\\x00'\\x00\"\n\"\\xff\\xfe=\\x00\\\\\\x00\"\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe=\\x00'\\x00'\\x00\"\n\"\\xff\\xfe<\\x00!\\x00A\\x00T\\x00T\\x00L\\x00I\\x00S\\x00T\\x00\"\n\"\\xff\\xfe<\\x00!\\x00D\\x00O\\x00C\\x00T\\x00Y\\x00P\\x00E\\x00\"\n\"\\xff\\xfe<\\x00!\\x00E\\x00L\\x00E\\x00M\\x00E\\x00N\\x00T\\x00\"\n\"\\xff\\xfe<\\x00!\\x00E\\x00N\\x00T\\x00I\\x00T\\x00Y\\x00\"\n\"\\xff\\xfe<\\x00!\\x00[\\x00I\\x00G\\x00N\\x00O\\x00R\\x00E\\x00[\\x00\"\n\"\\xff\\xfe<\\x00!\\x00[\\x00I\\x00N\\x00C\\x00L\\x00U\\x00D\\x00E\\x00[\\x00\"\n\"\\xff\\xfe<\\x00!\\x00N\\x00O\\x00T\\x00A\\x00T\\x00I\\x00O\\x00N\\x00\"\n\"\\xff\\xfe#\\x00C\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"\\xff\\xfe#\\x00F\\x00I\\x00X\\x00E\\x00D\\x00\"\n\"\\xff\\xfe#\\x00I\\x00M\\x00P\\x00L\\x00I\\x00E\\x00D\\x00\"\n\"\\xff\\xfe#\\x00P\\x00C\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"\\xff\\xfe#\\x00R\\x00E\\x00Q\\x00U\\x00I\\x00R\\x00E\\x00D\\x00\"\n\"\\xff\\xfeI\\x00S\\x00O\\x00-\\x008\\x008\\x005\\x009\\x00-\\x001\\x00\"\n\"\\xff\\xfeU\\x00S\\x00-\\x00A\\x00S\\x00C\\x00I\\x00I\\x00\"\n\"\\xff\\xfeU\\x00T\\x00F\\x00-\\x008\\x00\"\n\"\\xff\\xfeU\\x00T\\x00F\\x00-\\x001\\x006\\x00\"\n\"\\xff\\xfeU\\x00T\\x00F\\x00-\\x001\\x006\\x00B\\x00E\\x00\"\n\"\\xff\\xfeU\\x00T\\x00F\\x00-\\x001\\x006\\x00L\\x00E\\x00\"\n\"\\xff\\xfex\\x00m\\x00l\\x00n\\x00s\\x00\"\n\"\\xff\\xfex\\x00m\\x00l\\x00n\\x00s\\x00:\\x00\"\n\"\\xff\\xfex\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00h\\x00t\\x00m\\x00l\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x001\\x009\\x009\\x009\\x00/\\x00x\\x00h\\x00t\\x00m\\x00l\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfex\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00m\\x00l\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x00X\\x00M\\x00L\\x00/\\x001\\x009\\x009\\x008\\x00/\\x00n\\x00a\\x00m\\x00e\\x00s\\x00p\\x00a\\x00c\\x00e\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfex\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00m\\x00l\\x00n\\x00s\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x002\\x000\\x000\\x000\\x00/\\x00x\\x00m\\x00l\\x00n\\x00s\\x00\\\\\\x00\"\\x00\"\n\"\\xff\\xfe:\\x00f\\x00a\\x00l\\x00l\\x00b\\x00a\\x00c\\x00k\\x00\"\n\"\\xff\\xfe:\\x00a\\x00\"\n\"\\xff\\xfe:\\x00i\\x00n\\x00c\\x00l\\x00u\\x00d\\x00e\\x00\"\n\"\\xff\\xfe-\\x00-\\x00\"\n\"\\xff\\xfe(\\x00)\\x00\"\n\"\\xff\\xfe%\\x00a\\x00\"\n\"\\xff\\xfe:\\x00s\\x00c\\x00h\\x00e\\x00m\\x00a\\x00\"\n\"\\xff\\xfeU\\x00C\\x00S\\x00-\\x004\\x00\"\n\"\\xff\\xfe<\\x00/\\x00a\\x00>\\x00\"\n\"\\xff\\xfe<\\x00a\\x00>\\x00\"\n\"\\xff\\xfe<\\x00a\\x00 \\x00/\\x00>\\x00\"\n\"\\xff\\xfe<\\x00?\\x00x\\x00m\\x00l\\x00?\\x00>\\x00\"\n\"\\xff\\xfeh\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00d\\x00o\\x00c\\x00b\\x00o\\x00o\\x00\"\n\"\\xff\\xfeh\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x00\"\n\"\\xff\\xfeh\\x00e\\x003\\x000\\x00\"\n\"\\xff\\xfeh\\x00e\\x002\\x00\"\n\"\\xff\\xfeI\\x00E\\x00T\\x00\"\n\"\\xff\\xfeF\\x00D\\x00F\\x00-\\x001\\x000\\x00\"\n\"\\xff\\xfea\\x00D\\x00U\\x00C\\x00S\\x00-\\x004\\x00O\\x00P\\x00v\\x00e\\x00b\\x00:\\x00\"\n\"\\xff\\xfea\\x00>\\x00\"\n\"\\xff\\xfeU\\x00T\\x00\"\n\"\\xff\\xfex\\x00M\\x00l\\x00\"\n\"\\xff\\xfe/\\x00u\\x00s\\x00r\\x00/\\x00s\\x00h\\x00a\\x00r\\x00e\\x00/\\x00s\\x00g\\x00\"\n\"\\xff\\xfeh\\x00a\\x000\\x007\\x00\"\n\"\\xff\\xfeh\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00o\\x00a\\x00\"\n\"\\xff\\xfec\\x00l\\x00e\\x00\"\n"
  },
  {
    "path": "projects/expat/xml_UTF_16BE.dict",
    "content": "# xml.dict converted to UTF-16BE encoding.\n\"\\x00 \\x00e\\x00n\\x00c\\x00o\\x00d\\x00i\\x00n\\x00g\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00a\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00h\\x00r\\x00e\\x00f\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00s\\x00t\\x00a\\x00n\\x00d\\x00a\\x00l\\x00o\\x00n\\x00e\\x00=\\x00\\\\\\x00\"\\x00n\\x00o\\x00\\\\\\x00\"\"\n\"\\x00 \\x00v\\x00e\\x00r\\x00s\\x00i\\x00o\\x00n\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00x\\x00m\\x00l\\x00:\\x00b\\x00a\\x00s\\x00e\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00x\\x00m\\x00l\\x00:\\x00i\\x00d\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00x\\x00m\\x00l\\x00:\\x00l\\x00a\\x00n\\x00g\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00x\\x00m\\x00l\\x00:\\x00s\\x00p\\x00a\\x00c\\x00e\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00 \\x00x\\x00m\\x00l\\x00n\\x00s\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\"\n\"\\x00&\\x00l\\x00t\\x00;\"\n\"\\x00&\\x00#\\x001\\x00;\"\n\"\\x00&\\x00a\\x00;\"\n\"\\x00&\\x00#\\x00x\\x001\\x00;\"\n\"\\x00A\\x00N\\x00Y\"\n\"\\x00A\\x00T\\x00T\\x00L\\x00I\\x00S\\x00T\"\n\"\\x00C\\x00D\\x00A\\x00T\\x00A\"\n\"\\x00D\\x00O\\x00C\\x00T\\x00Y\\x00P\\x00E\"\n\"\\x00E\\x00L\\x00E\\x00M\\x00E\\x00N\\x00T\"\n\"\\x00E\\x00M\\x00P\\x00T\\x00Y\"\n\"\\x00E\\x00N\\x00T\\x00I\\x00T\\x00I\\x00E\\x00S\"\n\"\\x00E\\x00N\\x00T\\x00I\\x00T\\x00Y\"\n\"\\x00F\\x00I\\x00X\\x00E\\x00D\"\n\"\\x00I\\x00D\"\n\"\\x00I\\x00D\\x00R\\x00E\\x00F\"\n\"\\x00I\\x00D\\x00R\\x00E\\x00F\\x00S\"\n\"\\x00I\\x00G\\x00N\\x00O\\x00R\\x00E\"\n\"\\x00I\\x00M\\x00P\\x00L\\x00I\\x00E\\x00D\"\n\"\\x00I\\x00N\\x00C\\x00L\\x00U\\x00D\\x00E\"\n\"\\x00N\\x00D\\x00A\\x00T\\x00A\"\n\"\\x00N\\x00M\\x00T\\x00O\\x00K\\x00E\\x00N\"\n\"\\x00N\\x00M\\x00T\\x00O\\x00K\\x00E\\x00N\\x00S\"\n\"\\x00N\\x00O\\x00T\\x00A\\x00T\\x00I\\x00O\\x00N\"\n\"\\x00P\\x00C\\x00D\\x00A\\x00T\\x00A\"\n\"\\x00P\\x00U\\x00B\\x00L\\x00I\\x00C\"\n\"\\x00R\\x00E\\x00Q\\x00U\\x00I\\x00R\\x00E\\x00D\"\n\"\\x00S\\x00Y\\x00S\\x00T\\x00E\\x00M\"\n\"\\x00<\"\n\"\\x00>\"\n\"\\x00/\\x00>\"\n\"\\x00<\\x00/\"\n\"\\x00<\\x00?\"\n\"\\x00?\\x00>\"\n\"\\x00<\\x00!\"\n\"\\x00!\\x00>\"\n\"\\x00[\\x00]\"\n\"\\x00]\\x00]\"\n\"\\x00<\\x00!\\x00[\\x00C\\x00D\\x00A\\x00T\\x00A\\x00[\"\n\"\\x00<\\x00!\\x00[\\x00C\\x00D\\x00A\\x00T\\x00A\\x00[\\x00]\\x00]\\x00>\"\n\"\\x00\\\\\\x00\"\\x00\\\\\\x00\"\"\n\"\\x00'\\x00'\"\n\"\\x00=\\x00\\\\\\x00\"\\x00\\\\\\x00\"\"\n\"\\x00=\\x00'\\x00'\"\n\"\\x00<\\x00!\\x00A\\x00T\\x00T\\x00L\\x00I\\x00S\\x00T\"\n\"\\x00<\\x00!\\x00D\\x00O\\x00C\\x00T\\x00Y\\x00P\\x00E\"\n\"\\x00<\\x00!\\x00E\\x00L\\x00E\\x00M\\x00E\\x00N\\x00T\"\n\"\\x00<\\x00!\\x00E\\x00N\\x00T\\x00I\\x00T\\x00Y\"\n\"\\x00<\\x00!\\x00[\\x00I\\x00G\\x00N\\x00O\\x00R\\x00E\\x00[\"\n\"\\x00<\\x00!\\x00[\\x00I\\x00N\\x00C\\x00L\\x00U\\x00D\\x00E\\x00[\"\n\"\\x00<\\x00!\\x00N\\x00O\\x00T\\x00A\\x00T\\x00I\\x00O\\x00N\"\n\"\\x00#\\x00C\\x00D\\x00A\\x00T\\x00A\"\n\"\\x00#\\x00F\\x00I\\x00X\\x00E\\x00D\"\n\"\\x00#\\x00I\\x00M\\x00P\\x00L\\x00I\\x00E\\x00D\"\n\"\\x00#\\x00P\\x00C\\x00D\\x00A\\x00T\\x00A\"\n\"\\x00#\\x00R\\x00E\\x00Q\\x00U\\x00I\\x00R\\x00E\\x00D\"\n\"\\x00I\\x00S\\x00O\\x00-\\x008\\x008\\x005\\x009\\x00-\\x001\"\n\"\\x00U\\x00S\\x00-\\x00A\\x00S\\x00C\\x00I\\x00I\"\n\"\\x00U\\x00T\\x00F\\x00-\\x008\"\n\"\\x00U\\x00T\\x00F\\x00-\\x001\\x006\"\n\"\\x00U\\x00T\\x00F\\x00-\\x001\\x006\\x00B\\x00E\"\n\"\\x00U\\x00T\\x00F\\x00-\\x001\\x006\\x00L\\x00E\"\n\"\\x00x\\x00m\\x00l\\x00n\\x00s\"\n\"\\x00x\\x00m\\x00l\\x00n\\x00s\\x00:\"\n\"\\x00x\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00h\\x00t\\x00m\\x00l\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x001\\x009\\x009\\x009\\x00/\\x00x\\x00h\\x00t\\x00m\\x00l\\x00\\\\\\x00\"\"\n\"\\x00x\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00m\\x00l\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x00X\\x00M\\x00L\\x00/\\x001\\x009\\x009\\x008\\x00/\\x00n\\x00a\\x00m\\x00e\\x00s\\x00p\\x00a\\x00c\\x00e\\x00\\\\\\x00\"\"\n\"\\x00x\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00m\\x00l\\x00n\\x00s\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x002\\x000\\x000\\x000\\x00/\\x00x\\x00m\\x00l\\x00n\\x00s\\x00\\\\\\x00\"\"\n\"\\x00:\\x00f\\x00a\\x00l\\x00l\\x00b\\x00a\\x00c\\x00k\"\n\"\\x00:\\x00a\"\n\"\\x00:\\x00i\\x00n\\x00c\\x00l\\x00u\\x00d\\x00e\"\n\"\\x00-\\x00-\"\n\"\\x00(\\x00)\"\n\"\\x00%\\x00a\"\n\"\\x00:\\x00s\\x00c\\x00h\\x00e\\x00m\\x00a\"\n\"\\x00U\\x00C\\x00S\\x00-\\x004\"\n\"\\x00<\\x00/\\x00a\\x00>\"\n\"\\x00<\\x00a\\x00>\"\n\"\\x00<\\x00a\\x00 \\x00/\\x00>\"\n\"\\x00<\\x00?\\x00x\\x00m\\x00l\\x00?\\x00>\"\n\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00d\\x00o\\x00c\\x00b\\x00o\\x00o\"\n\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\"\n\"\\x00h\\x00e\\x003\\x000\"\n\"\\x00h\\x00e\\x002\"\n\"\\x00I\\x00E\\x00T\"\n\"\\x00F\\x00D\\x00F\\x00-\\x001\\x000\"\n\"\\x00a\\x00D\\x00U\\x00C\\x00S\\x00-\\x004\\x00O\\x00P\\x00v\\x00e\\x00b\\x00:\"\n\"\\x00a\\x00>\"\n\"\\x00U\\x00T\"\n\"\\x00x\\x00M\\x00l\"\n\"\\x00/\\x00u\\x00s\\x00r\\x00/\\x00s\\x00h\\x00a\\x00r\\x00e\\x00/\\x00s\\x00g\"\n\"\\x00h\\x00a\\x000\\x007\"\n\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00o\\x00a\"\n\"\\x00c\\x00l\\x00e\"\n"
  },
  {
    "path": "projects/expat/xml_UTF_16LE.dict",
    "content": "# xml.dict converted to UTF-16LE encoding.\n\" \\x00e\\x00n\\x00c\\x00o\\x00d\\x00i\\x00n\\x00g\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00a\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00h\\x00r\\x00e\\x00f\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00s\\x00t\\x00a\\x00n\\x00d\\x00a\\x00l\\x00o\\x00n\\x00e\\x00=\\x00\\\\\\x00\"\\x00n\\x00o\\x00\\\\\\x00\"\\x00\"\n\" \\x00v\\x00e\\x00r\\x00s\\x00i\\x00o\\x00n\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00x\\x00m\\x00l\\x00:\\x00b\\x00a\\x00s\\x00e\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00x\\x00m\\x00l\\x00:\\x00i\\x00d\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00x\\x00m\\x00l\\x00:\\x00l\\x00a\\x00n\\x00g\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00x\\x00m\\x00l\\x00:\\x00s\\x00p\\x00a\\x00c\\x00e\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\" \\x00x\\x00m\\x00l\\x00n\\x00s\\x00=\\x00\\\\\\x00\"\\x001\\x00\\\\\\x00\"\\x00\"\n\"&\\x00l\\x00t\\x00;\\x00\"\n\"&\\x00#\\x001\\x00;\\x00\"\n\"&\\x00a\\x00;\\x00\"\n\"&\\x00#\\x00x\\x001\\x00;\\x00\"\n\"A\\x00N\\x00Y\\x00\"\n\"A\\x00T\\x00T\\x00L\\x00I\\x00S\\x00T\\x00\"\n\"C\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"D\\x00O\\x00C\\x00T\\x00Y\\x00P\\x00E\\x00\"\n\"E\\x00L\\x00E\\x00M\\x00E\\x00N\\x00T\\x00\"\n\"E\\x00M\\x00P\\x00T\\x00Y\\x00\"\n\"E\\x00N\\x00T\\x00I\\x00T\\x00I\\x00E\\x00S\\x00\"\n\"E\\x00N\\x00T\\x00I\\x00T\\x00Y\\x00\"\n\"F\\x00I\\x00X\\x00E\\x00D\\x00\"\n\"I\\x00D\\x00\"\n\"I\\x00D\\x00R\\x00E\\x00F\\x00\"\n\"I\\x00D\\x00R\\x00E\\x00F\\x00S\\x00\"\n\"I\\x00G\\x00N\\x00O\\x00R\\x00E\\x00\"\n\"I\\x00M\\x00P\\x00L\\x00I\\x00E\\x00D\\x00\"\n\"I\\x00N\\x00C\\x00L\\x00U\\x00D\\x00E\\x00\"\n\"N\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"N\\x00M\\x00T\\x00O\\x00K\\x00E\\x00N\\x00\"\n\"N\\x00M\\x00T\\x00O\\x00K\\x00E\\x00N\\x00S\\x00\"\n\"N\\x00O\\x00T\\x00A\\x00T\\x00I\\x00O\\x00N\\x00\"\n\"P\\x00C\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"P\\x00U\\x00B\\x00L\\x00I\\x00C\\x00\"\n\"R\\x00E\\x00Q\\x00U\\x00I\\x00R\\x00E\\x00D\\x00\"\n\"S\\x00Y\\x00S\\x00T\\x00E\\x00M\\x00\"\n\"<\\x00\"\n\">\\x00\"\n\"/\\x00>\\x00\"\n\"<\\x00/\\x00\"\n\"<\\x00?\\x00\"\n\"?\\x00>\\x00\"\n\"<\\x00!\\x00\"\n\"!\\x00>\\x00\"\n\"[\\x00]\\x00\"\n\"]\\x00]\\x00\"\n\"<\\x00!\\x00[\\x00C\\x00D\\x00A\\x00T\\x00A\\x00[\\x00\"\n\"<\\x00!\\x00[\\x00C\\x00D\\x00A\\x00T\\x00A\\x00[\\x00]\\x00]\\x00>\\x00\"\n\"\\\\\\x00\"\\x00\\\\\\x00\"\\x00\"\n\"'\\x00'\\x00\"\n\"=\\x00\\\\\\x00\"\\x00\\\\\\x00\"\\x00\"\n\"=\\x00'\\x00'\\x00\"\n\"<\\x00!\\x00A\\x00T\\x00T\\x00L\\x00I\\x00S\\x00T\\x00\"\n\"<\\x00!\\x00D\\x00O\\x00C\\x00T\\x00Y\\x00P\\x00E\\x00\"\n\"<\\x00!\\x00E\\x00L\\x00E\\x00M\\x00E\\x00N\\x00T\\x00\"\n\"<\\x00!\\x00E\\x00N\\x00T\\x00I\\x00T\\x00Y\\x00\"\n\"<\\x00!\\x00[\\x00I\\x00G\\x00N\\x00O\\x00R\\x00E\\x00[\\x00\"\n\"<\\x00!\\x00[\\x00I\\x00N\\x00C\\x00L\\x00U\\x00D\\x00E\\x00[\\x00\"\n\"<\\x00!\\x00N\\x00O\\x00T\\x00A\\x00T\\x00I\\x00O\\x00N\\x00\"\n\"#\\x00C\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"#\\x00F\\x00I\\x00X\\x00E\\x00D\\x00\"\n\"#\\x00I\\x00M\\x00P\\x00L\\x00I\\x00E\\x00D\\x00\"\n\"#\\x00P\\x00C\\x00D\\x00A\\x00T\\x00A\\x00\"\n\"#\\x00R\\x00E\\x00Q\\x00U\\x00I\\x00R\\x00E\\x00D\\x00\"\n\"I\\x00S\\x00O\\x00-\\x008\\x008\\x005\\x009\\x00-\\x001\\x00\"\n\"U\\x00S\\x00-\\x00A\\x00S\\x00C\\x00I\\x00I\\x00\"\n\"U\\x00T\\x00F\\x00-\\x008\\x00\"\n\"U\\x00T\\x00F\\x00-\\x001\\x006\\x00\"\n\"U\\x00T\\x00F\\x00-\\x001\\x006\\x00B\\x00E\\x00\"\n\"U\\x00T\\x00F\\x00-\\x001\\x006\\x00L\\x00E\\x00\"\n\"x\\x00m\\x00l\\x00n\\x00s\\x00\"\n\"x\\x00m\\x00l\\x00n\\x00s\\x00:\\x00\"\n\"x\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00h\\x00t\\x00m\\x00l\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x001\\x009\\x009\\x009\\x00/\\x00x\\x00h\\x00t\\x00m\\x00l\\x00\\\\\\x00\"\\x00\"\n\"x\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00m\\x00l\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x00X\\x00M\\x00L\\x00/\\x001\\x009\\x009\\x008\\x00/\\x00n\\x00a\\x00m\\x00e\\x00s\\x00p\\x00a\\x00c\\x00e\\x00\\\\\\x00\"\\x00\"\n\"x\\x00m\\x00l\\x00n\\x00s\\x00:\\x00x\\x00m\\x00l\\x00n\\x00s\\x00=\\x00\\\\\\x00\"\\x00h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x003\\x00.\\x00o\\x00r\\x00g\\x00/\\x002\\x000\\x000\\x000\\x00/\\x00x\\x00m\\x00l\\x00n\\x00s\\x00\\\\\\x00\"\\x00\"\n\":\\x00f\\x00a\\x00l\\x00l\\x00b\\x00a\\x00c\\x00k\\x00\"\n\":\\x00a\\x00\"\n\":\\x00i\\x00n\\x00c\\x00l\\x00u\\x00d\\x00e\\x00\"\n\"-\\x00-\\x00\"\n\"(\\x00)\\x00\"\n\"%\\x00a\\x00\"\n\":\\x00s\\x00c\\x00h\\x00e\\x00m\\x00a\\x00\"\n\"U\\x00C\\x00S\\x00-\\x004\\x00\"\n\"<\\x00/\\x00a\\x00>\\x00\"\n\"<\\x00a\\x00>\\x00\"\n\"<\\x00a\\x00 \\x00/\\x00>\\x00\"\n\"<\\x00?\\x00x\\x00m\\x00l\\x00?\\x00>\\x00\"\n\"h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00d\\x00o\\x00c\\x00b\\x00o\\x00o\\x00\"\n\"h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00w\\x00\"\n\"h\\x00e\\x003\\x000\\x00\"\n\"h\\x00e\\x002\\x00\"\n\"I\\x00E\\x00T\\x00\"\n\"F\\x00D\\x00F\\x00-\\x001\\x000\\x00\"\n\"a\\x00D\\x00U\\x00C\\x00S\\x00-\\x004\\x00O\\x00P\\x00v\\x00e\\x00b\\x00:\\x00\"\n\"a\\x00>\\x00\"\n\"U\\x00T\\x00\"\n\"x\\x00M\\x00l\\x00\"\n\"/\\x00u\\x00s\\x00r\\x00/\\x00s\\x00h\\x00a\\x00r\\x00e\\x00/\\x00s\\x00g\\x00\"\n\"h\\x00a\\x000\\x007\\x00\"\n\"h\\x00t\\x00t\\x00p\\x00:\\x00/\\x00/\\x00w\\x00w\\x00w\\x00.\\x00o\\x00a\\x00\"\n\"c\\x00l\\x00e\\x00\"\n"
  },
  {
    "path": "projects/expr/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/expr-lang/expr.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/expr\n"
  },
  {
    "path": "projects/expr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/expr/test/fuzz/fuzz_expr_seed_corpus.zip $OUT/\ncp $SRC/expr/test/fuzz/fuzz_expr.dict $OUT/\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ncompile_native_go_fuzzer github.com/expr-lang/expr/test/fuzz FuzzExpr fuzz_expr\n"
  },
  {
    "path": "projects/expr/project.yaml",
    "content": "homepage: \"https://github.com/expr-lang/expr\"\nprimary_contact: \"martin.swende@ethereum.org\"\nauto_ccs:\n  - \"antonmedvio@gmail.com\"\n  - \"ville@vesilehto.fi\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/expr-lang/expr.git\"\nfile_github_issue: True\n"
  },
  {
    "path": "projects/exprtk/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/ArashPartow/exprtk.git exprtk\nWORKDIR exprtk\nCOPY build.sh exprtk_fuzzer.cpp exprtk_test_expressions.dict $SRC/\n"
  },
  {
    "path": "projects/exprtk/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/*.dict $OUT/\n\nCXXFLAGS=\"${CXXFLAGS} -O2 -fno-sanitize=integer-divide-by-zero,float-divide-by-zero\"\n\n$CXX -std=c++11 $CXXFLAGS -I. -I$SRC/exprtk \\\n     $SRC/exprtk_fuzzer.cpp -o $OUT/exprtk_fuzzer \\\n     $LIB_FUZZING_ENGINE\n"
  },
  {
    "path": "projects/exprtk/exprtk_fuzzer.cpp",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n\n#include <chrono>\n#include <cstdint>\n#include <string>\n\n#define exprtk_enable_range_runtime_checks\n#include \"exprtk.hpp\"\n\n\nconstexpr auto max_test_duration = std::chrono::seconds(58); // OSSFuzz test time is 60seconds\nconst     auto global_timeout_tp = std::chrono::steady_clock::now() + max_test_duration;\n\nstruct timeout_rtc_handler : public exprtk::loop_runtime_check\n{\n   timeout_rtc_handler()\n   : exprtk::loop_runtime_check()\n   {}\n\n   class timeout_exception : public std::runtime_error\n   {\n   public:\n       timeout_exception(const std::string& what = \"\")\n       : std::runtime_error(what)\n       {}\n   };\n\n   static constexpr std::size_t max_iterations = 5000000;\n\n   using time_point_t = std::chrono::time_point<std::chrono::steady_clock>;\n\n   void set_timeout_time(const time_point_t& timeout_tp)\n   {\n      timeout_tp_ = timeout_tp;\n   }\n\n   bool check() override\n   {\n      if (++iterations_ >= max_iterations)\n      {\n         if (std::chrono::steady_clock::now() >= timeout_tp_)\n         {\n            return false;\n         }\n\n         iterations_ = 0;\n      }\n\n      return true;\n   }\n\n   void handle_runtime_violation(const violation_context& /*context*/) override\n   {\n      throw timeout_exception(\"ExprTk Loop run-time timeout violation.\");\n   }\n\n   std::size_t iterations_ = 0;\n   time_point_t timeout_tp_;\n};\n\nstruct compilation_timeout_check final : public exprtk::compilation_check\n{\n   static constexpr std::size_t max_iters_per_check = 500;\n\n   bool continue_compilation(compilation_context& context) override\n   {\n      if (++iterations_ >= max_iters_per_check)\n      {\n         if (std::chrono::steady_clock::now() >= timeout_tp_)\n         {\n            context.error_message = \"Compilation has timed-out\";\n            return false;\n         }\n\n         iterations_ = 0;\n      }\n\n      return true;\n   }\n\n   using time_point_t = std::chrono::time_point<std::chrono::steady_clock>;\n\n   void set_timeout_time(const time_point_t& timeout_tp)\n   {\n      timeout_tp_ = timeout_tp;\n   }\n\n   std::size_t iterations_ = max_iters_per_check;\n   time_point_t timeout_tp_;\n};\n\nstruct vector_access_rtc final : public exprtk::vector_access_runtime_check\n{\n   bool handle_runtime_violation(violation_context& /*context*/) override\n   {\n      throw std::runtime_error(\"Runtime vector access violation.\");\n      return false;\n   }\n};\n\nstruct assert_handler final : public exprtk::assert_check\n{\n   void handle_assert(const assert_context& /*context*/) override\n   {\n      throw std::runtime_error(\"assert: vector access violation.\");\n   }\n};\n\ntemplate <typename T>\nvoid run(const std::string& expression_string)\n{\n   using symbol_table_t       = exprtk::symbol_table<T>;\n   using expression_t         = exprtk::expression<T>;\n   using parser_t             = exprtk::parser<T>;\n   using loop_runtime_check_t = exprtk::loop_runtime_check;\n\n   T x = T(1.2345);\n   T y = T(2.2345);\n   T z = T(3.2345);\n   T w = T(4.2345);\n\n   symbol_table_t symbol_table;\n   symbol_table.add_variable(\"x\",x);\n   symbol_table.add_variable(\"y\",y);\n   symbol_table.add_variable(\"z\",z);\n   symbol_table.add_variable(\"w\",w);\n   symbol_table.add_constants();\n\n   expression_t expression;\n   expression.register_symbol_table(symbol_table);\n\n   timeout_rtc_handler loop_runtime_check;\n   loop_runtime_check.loop_set = loop_runtime_check_t::e_all_loops;\n   loop_runtime_check.max_loop_iterations = 100000;\n\n   compilation_timeout_check compilation_timeout_chck;\n   vector_access_rtc         vector_rtc;\n   assert_handler            asrt_handler;\n\n   parser_t parser;\n\n   parser.settings().set_max_stack_depth(400);\n   parser.settings().set_max_node_depth (400);\n   parser.settings().set_max_local_vector_size(10000000); // double: 80MB float: 40MB\n\n   parser.register_compilation_timeout_check  (compilation_timeout_chck);\n   parser.register_loop_runtime_check         (loop_runtime_check      );\n   parser.register_vector_access_runtime_check(vector_rtc              );\n   parser.register_assert_check               (asrt_handler            );\n\n   compilation_timeout_chck.set_timeout_time(global_timeout_tp);\n\n   if (parser.compile(expression_string, expression))\n   {\n      const std::size_t max_expression_size = 64 * 1024;\n\n      if (expression_string.size() <= max_expression_size)\n      {\n         loop_runtime_check.set_timeout_time(global_timeout_tp);\n\n         try\n         {\n            expression.value();\n         }\n         catch (std::runtime_error& rte)\n         {}\n         catch (...)\n         {}\n\n         parser.clear_loop_runtime_check();\n      }\n   }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n   const std::string expression(reinterpret_cast<const char*>(data), size);\n\n   run<double>(expression);\n   run<float> (expression);\n\n   return 0;\n}\n"
  },
  {
    "path": "projects/exprtk/exprtk_test_expressions.dict",
    "content": "\"1\"\n\"a\"\n\"()\"\n\"a*2\"\n\"a+1\"\n\"a+b\"\n\"(())\"\n\"a+-b\"\n\"(a*e)\"\n\"(a+e)\"\n\"(a-a)\"\n\"(b*e)\"\n\"(b+a)\"\n\"(b-b)\"\n\"(e*e)\"\n\"1+a^2\"\n\"2*a+1\"\n\"a*2.2\"\n\"a*b*c\"\n\"a*b+c\"\n\"a+1.1\"\n\"a+b*c\"\n\"a+b+c\"\n\"a+b-c\"\n\"a-b-c\"\n\"a/b/c\"\n\"a^2+1\"\n\"a^2^3\"\n\"b^2*2\"\n\"x*y*z\"\n\"x*y+z\"\n\"x*y-z\"\n\"x*y/z\"\n\"x+y*z\"\n\"x+y+z\"\n\"x+y-z\"\n\"x+y/z\"\n\"x-y*z\"\n\"x-y/z\"\n\"x/y*z\"\n\"x/y+z\"\n\"x/y-z\"\n\"x/y/z\"\n\"((()))\"\n\"(pi*b)\"\n\"(pi+b)\"\n\"(x)(x)\"\n\"[x][x]\"\n\"abs(a)\"\n\"cos(a)\"\n\"sin(a)\"\n\"tan(a)\"\n\"{x}{x}\"\n\"(a+b)*3\"\n\"(pi+pi)\"\n\"1.1*a^2\"\n\"1.1+a^2\"\n\"2*(a+b)\"\n\"2.2*b^2\"\n\"2.2*y*z\"\n\"2.2*y+z\"\n\"2.2*y-z\"\n\"2.2*y/z\"\n\"2.2+y*z\"\n\"2.2+y+z\"\n\"2.2+y-z\"\n\"2.2+y/z\"\n\"2.2-y*z\"\n\"2.2-y/z\"\n\"2.2/y*z\"\n\"2.2/y+z\"\n\"2.2/y-z\"\n\"2.2/y/z\"\n\"a*2+b*2\"\n\"a^2+b^2\"\n\"sqrt(a)\"\n\"x*3.3*z\"\n\"x*3.3+z\"\n\"x*3.3-z\"\n\"x*3.3/z\"\n\"x*y*4.4\"\n\"x*y*z+w\"\n\"x*y*z-w\"\n\"x*y+4.4\"\n\"x*y+z*w\"\n\"x*y+z+w\"\n\"x*y+z-w\"\n\"x*y+z/w\"\n\"x*y-4.4\"\n\"x*y-z*w\"\n\"x*y-z+w\"\n\"x*y-z-w\"\n\"x*y-z/w\"\n\"x*y/4.4\"\n\"x*y/z+w\"\n\"x*y/z-w\"\n\"x+3.3*z\"\n\"x+3.3+z\"\n\"x+3.3-z\"\n\"x+3.3/z\"\n\"x+y*4.4\"\n\"x+y*z*w\"\n\"x+y*z-w\"\n\"x+y*z/w\"\n\"x+y+4.4\"\n\"x+y+z*w\"\n\"x+y+z-w\"\n\"x+y+z/w\"\n\"x+y-4.4\"\n\"x+y-z*w\"\n\"x+y-z-w\"\n\"x+y-z/w\"\n\"x+y/4.4\"\n\"x+y/z*w\"\n\"x+y/z+w\"\n\"x+y/z-w\"\n\"x+y/z/w\"\n\"x-3.3*z\"\n\"x-3.3/z\"\n\"x-y*4.4\"\n\"x-y*z*w\"\n\"x-y*z-w\"\n\"x-y*z/w\"\n\"x-y+z*w\"\n\"x-y+z+w\"\n\"x-y+z/w\"\n\"x-y-z*w\"\n\"x-y-z+w\"\n\"x-y-z/w\"\n\"x-y/4.4\"\n\"x-y/z*w\"\n\"x-y/z-w\"\n\"x-y/z/w\"\n\"x/3.3*z\"\n\"x/3.3+z\"\n\"x/3.3-z\"\n\"x/3.3/z\"\n\"x/y*4.4\"\n\"x/y*z+w\"\n\"x/y*z-w\"\n\"x/y+4.4\"\n\"x/y+z*w\"\n\"x/y+z+w\"\n\"x/y+z-w\"\n\"x/y+z/w\"\n\"x/y-4.4\"\n\"x/y-z*w\"\n\"x/y-z+w\"\n\"x/y-z-w\"\n\"x/y-z/w\"\n\"x/y/4.4\"\n\"x/y/z+w\"\n\"x/y/z-w\"\n\"(3.70/b)\"\n\"(a/0.20)\"\n\"(b+2.07)\"\n\"(b+3.52)\"\n\"-(b^1.1)\"\n\"((a/a)+e)\"\n\"((b/a)/a)\"\n\"((e/b)+e)\"\n\"((x*y*z))\"\n\"((x*y+z))\"\n\"((x*y-z))\"\n\"((x*y/z))\"\n\"((x+y*z))\"\n\"((x+y+z))\"\n\"((x+y-z))\"\n\"((x+y/z))\"\n\"((x-y*z))\"\n\"((x-y+z))\"\n\"((x-y-z))\"\n\"((x-y/z))\"\n\"((x/y*z))\"\n\"((x/y+z))\"\n\"((x/y-z))\"\n\"((x/y/z))\"\n\"(2*a+1)*3\"\n\"(2*a+2*a)\"\n\"(3.00+pi)\"\n\"(a+b)*3.3\"\n\"2.2*(a+b)\"\n\"2.2*a+1.1\"\n\"2.2*y*4.4\"\n\"2.2*y*z+w\"\n\"2.2*y*z-w\"\n\"2.2*y+4.4\"\n\"2.2*y+z*w\"\n\"2.2*y+z+w\"\n\"2.2*y+z-w\"\n\"2.2*y+z/w\"\n\"2.2*y-4.4\"\n\"2.2*y-z*w\"\n\"2.2*y-z+w\"\n\"2.2*y-z-w\"\n\"2.2*y-z/w\"\n\"2.2*y/4.4\"\n\"2.2*y/z+w\"\n\"2.2*y/z-w\"\n\"2.2+y*4.4\"\n\"2.2+y*z*w\"\n\"2.2+y*z-w\"\n\"2.2+y*z/w\"\n\"2.2+y+4.4\"\n\"2.2+y+z*w\"\n\"2.2+y+z-w\"\n\"2.2+y+z/w\"\n\"2.2+y-4.4\"\n\"2.2+y-z*w\"\n\"2.2+y-z-w\"\n\"2.2+y-z/w\"\n\"2.2+y/4.4\"\n\"2.2+y/z*w\"\n\"2.2+y/z+w\"\n\"2.2+y/z-w\"\n\"2.2+y/z/w\"\n\"2.2-y*4.4\"\n\"2.2-y*z*w\"\n\"2.2-y*z-w\"\n\"2.2-y*z/w\"\n\"2.2-y+z*w\"\n\"2.2-y+z+w\"\n\"2.2-y+z/w\"\n\"2.2-y-z*w\"\n\"2.2-y-z+w\"\n\"2.2-y-z/w\"\n\"2.2-y/4.4\"\n\"2.2-y/z*w\"\n\"2.2-y/z-w\"\n\"2.2-y/z/w\"\n\"2.2/y*4.4\"\n\"2.2/y*z+w\"\n\"2.2/y*z-w\"\n\"2.2/y+4.4\"\n\"2.2/y+z*w\"\n\"2.2/y+z+w\"\n\"2.2/y+z-w\"\n\"2.2/y+z/w\"\n\"2.2/y-4.4\"\n\"2.2/y-z*w\"\n\"2.2/y-z+w\"\n\"2.2/y-z-w\"\n\"2.2/y-z/w\"\n\"2.2/y/4.4\"\n\"2.2/y/z+w\"\n\"2.2/y/z-w\"\n\"a+b*(a+b)\"\n\"a^2^3-a^8\"\n\"tan(1.29)\"\n\"x*3.3*4.4\"\n\"x*3.3*z+w\"\n\"x*3.3*z-w\"\n\"x*3.3+4.4\"\n\"x*3.3+z*w\"\n\"x*3.3+z+w\"\n\"x*3.3+z-w\"\n\"x*3.3+z/w\"\n\"x*3.3-4.4\"\n\"x*3.3-z*w\"\n\"x*3.3-z+w\"\n\"x*3.3-z-w\"\n\"x*3.3-z/w\"\n\"x*3.3/4.4\"\n\"x*3.3/z+w\"\n\"x*3.3/z-w\"\n\"x*y*4.4+w\"\n\"x*y*4.4-w\"\n\"x*y*z+5.5\"\n\"x*y*z-5.5\"\n\"x*y+4.4*w\"\n\"x*y+4.4+w\"\n\"x*y+4.4-w\"\n\"x*y+4.4/w\"\n\"x*y+z*5.5\"\n\"x*y+z+5.5\"\n\"x*y+z-5.5\"\n\"x*y+z/5.5\"\n\"x*y-4.4*w\"\n\"x*y-4.4+w\"\n\"x*y-4.4-w\"\n\"x*y-4.4/w\"\n\"x*y-z*5.5\"\n\"x*y-z+5.5\"\n\"x*y-z-5.5\"\n\"x*y-z/5.5\"\n\"x*y/4.4+w\"\n\"x*y/4.4-w\"\n\"x*y/z+5.5\"\n\"x*y/z-5.5\"\n\"x+3.3*4.4\"\n\"x+3.3*z*w\"\n\"x+3.3*z-w\"\n\"x+3.3*z/w\"\n\"x+3.3+4.4\"\n\"x+3.3+z*w\"\n\"x+3.3+z-w\"\n\"x+3.3+z/w\"\n\"x+3.3-4.4\"\n\"x+3.3-z*w\"\n\"x+3.3-z-w\"\n\"x+3.3-z/w\"\n\"x+3.3/4.4\"\n\"x+3.3/z*w\"\n\"x+3.3/z+w\"\n\"x+3.3/z-w\"\n\"x+3.3/z/w\"\n\"x+y*4.4*w\"\n\"x+y*4.4-w\"\n\"x+y*4.4/w\"\n\"x+y*z*5.5\"\n\"x+y*z-5.5\"\n\"x+y*z/5.5\"\n\"x+y+4.4*w\"\n\"x+y+4.4-w\"\n\"x+y+4.4/w\"\n\"x+y+z*5.5\"\n\"x+y+z-5.5\"\n\"x+y+z/5.5\"\n\"x+y-4.4*w\"\n\"x+y-4.4-w\"\n\"x+y-4.4/w\"\n\"x+y-z*5.5\"\n\"x+y-z-5.5\"\n\"x+y-z/5.5\"\n\"x+y/4.4*w\"\n\"x+y/4.4+w\"\n\"x+y/4.4-w\"\n\"x+y/4.4/w\"\n\"x+y/z*5.5\"\n\"x+y/z+5.5\"\n\"x+y/z-5.5\"\n\"x+y/z/5.5\"\n\"x-3.3*4.4\"\n\"x-3.3*z*w\"\n\"x-3.3*z-w\"\n\"x-3.3*z/w\"\n\"x-3.3+z*w\"\n\"x-3.3+z+w\"\n\"x-3.3+z/w\"\n\"x-3.3-z*w\"\n\"x-3.3-z+w\"\n\"x-3.3-z/w\"\n\"x-3.3/4.4\"\n\"x-3.3/z*w\"\n\"x-3.3/z-w\"\n\"x-3.3/z/w\"\n\"x-y*4.4*w\"\n\"x-y*4.4-w\"\n\"x-y*4.4/w\"\n\"x-y*z*5.5\"\n\"x-y*z-5.5\"\n\"x-y*z/5.5\"\n\"x-y+4.4*w\"\n\"x-y+4.4+w\"\n\"x-y+4.4/w\"\n\"x-y+z*5.5\"\n\"x-y+z+5.5\"\n\"x-y+z/5.5\"\n\"x-y-4.4*w\"\n\"x-y-4.4+w\"\n\"x-y-4.4/w\"\n\"x-y-z*5.5\"\n\"x-y-z+5.5\"\n\"x-y-z/5.5\"\n\"x-y/4.4*w\"\n\"x-y/4.4-w\"\n\"x-y/4.4/w\"\n\"x-y/z*5.5\"\n\"x-y/z-5.5\"\n\"x-y/z/5.5\"\n\"x/3.3*4.4\"\n\"x/3.3*z+w\"\n\"x/3.3*z-w\"\n\"x/3.3+4.4\"\n\"x/3.3+z*w\"\n\"x/3.3+z+w\"\n\"x/3.3+z-w\"\n\"x/3.3+z/w\"\n\"x/3.3-4.4\"\n\"x/3.3-z*w\"\n\"x/3.3-z+w\"\n\"x/3.3-z-w\"\n\"x/3.3-z/w\"\n\"x/3.3/4.4\"\n\"x/3.3/z+w\"\n\"x/3.3/z-w\"\n\"x/y*4.4+w\"\n\"x/y*4.4-w\"\n\"x/y*z+5.5\"\n\"x/y*z-5.5\"\n\"x/y+4.4*w\"\n\"x/y+4.4+w\"\n\"x/y+4.4-w\"\n\"x/y+4.4/w\"\n\"x/y+z*5.5\"\n\"x/y+z+5.5\"\n\"x/y+z-5.5\"\n\"x/y+z/5.5\"\n\"x/y-4.4*w\"\n\"x/y-4.4+w\"\n\"x/y-4.4-w\"\n\"x/y-4.4/w\"\n\"x/y-z*5.5\"\n\"x/y-z+5.5\"\n\"x/y-z-5.5\"\n\"x/y-z/5.5\"\n\"x/y/4.4+w\"\n\"x/y/4.4-w\"\n\"x/y/z+5.5\"\n\"x/y/z-5.5\"\n\"((b/b)/pi)\"\n\"((x))((x))\"\n\"(1+b)*(-3)\"\n\"(b+(pi*a))\"\n\"-a^2^3-a^8\"\n\"1.1*a^2.01\"\n\"[[x]][[x]]\"\n\"e^log(7*a)\"\n\"{{x}}{{x}}\"\n\"(((x*y)*z))\"\n\"(((x*y)+z))\"\n\"(((x*y)-z))\"\n\"(((x*y)/z))\"\n\"(((x+y)*z))\"\n\"(((x+y)+z))\"\n\"(((x+y)-z))\"\n\"(((x+y)/z))\"\n\"(((x-y)*z))\"\n\"(((x-y)/z))\"\n\"(((x/y)*z))\"\n\"(((x/y)+z))\"\n\"(((x/y)-z))\"\n\"(((x/y)/z))\"\n\"((a-pi)*pi)\"\n\"((x*(y*z)))\"\n\"((x*(y+z)))\"\n\"((x*(y-z)))\"\n\"((x*(y/z)))\"\n\"((x*y*z+w))\"\n\"((x*y*z-w))\"\n\"((x*y+z*w))\"\n\"((x*y+z+w))\"\n\"((x*y+z-w))\"\n\"((x*y+z/w))\"\n\"((x*y-z*w))\"\n\"((x*y-z+w))\"\n\"((x*y-z-w))\"\n\"((x*y-z/w))\"\n\"((x*y/z+w))\"\n\"((x*y/z-w))\"\n\"((x+(y*z)))\"\n\"((x+(y+z)))\"\n\"((x+(y-z)))\"\n\"((x+(y/z)))\"\n\"((x+y*z*w))\"\n\"((x+y*z-w))\"\n\"((x+y*z/w))\"\n\"((x+y+z*w))\"\n\"((x+y+z-w))\"\n\"((x+y+z/w))\"\n\"((x+y-z*w))\"\n\"((x+y-z-w))\"\n\"((x+y-z/w))\"\n\"((x+y/z*w))\"\n\"((x+y/z+w))\"\n\"((x+y/z-w))\"\n\"((x+y/z/w))\"\n\"((x-(y*z)))\"\n\"((x-(y+z)))\"\n\"((x-(y-z)))\"\n\"((x-(y/z)))\"\n\"((x-y*z*w))\"\n\"((x-y*z+w))\"\n\"((x-y*z-w))\"\n\"((x-y*z/w))\"\n\"((x-y+z*w))\"\n\"((x-y+z+w))\"\n\"((x-y+z/w))\"\n\"((x-y-z*w))\"\n\"((x-y-z+w))\"\n\"((x-y-z/w))\"\n\"((x-y/z*w))\"\n\"((x-y/z+w))\"\n\"((x-y/z-w))\"\n\"((x-y/z/w))\"\n\"((x/(y*z)))\"\n\"((x/(y+z)))\"\n\"((x/(y-z)))\"\n\"((x/(y/z)))\"\n\"((x/y*z+w))\"\n\"((x/y*z-w))\"\n\"((x/y+z*w))\"\n\"((x/y+z+w))\"\n\"((x/y+z-w))\"\n\"((x/y+z/w))\"\n\"((x/y-z*w))\"\n\"((x/y-z+w))\"\n\"((x/y-z-w))\"\n\"((x/y-z/w))\"\n\"((x/y/z+w))\"\n\"((x/y/z-w))\"\n\"1-(a/b*0.5)\"\n\"10^log(3+b)\"\n\"2.2*a^1+1.1\"\n\"2.2*y*4.4+w\"\n\"2.2*y*4.4-w\"\n\"2.2*y*z+5.5\"\n\"2.2*y*z-5.5\"\n\"2.2*y+4.4*w\"\n\"2.2*y+4.4+w\"\n\"2.2*y+4.4-w\"\n\"2.2*y+4.4/w\"\n\"2.2*y+z*5.5\"\n\"2.2*y+z+5.5\"\n\"2.2*y+z-5.5\"\n\"2.2*y+z/5.5\"\n\"2.2*y-4.4*w\"\n\"2.2*y-4.4+w\"\n\"2.2*y-4.4-w\"\n\"2.2*y-4.4/w\"\n\"2.2*y-z*5.5\"\n\"2.2*y-z+5.5\"\n\"2.2*y-z-5.5\"\n\"2.2*y-z/5.5\"\n\"2.2*y/4.4+w\"\n\"2.2*y/4.4-w\"\n\"2.2*y/z+5.5\"\n\"2.2*y/z-5.5\"\n\"2.2+y*4.4*w\"\n\"2.2+y*4.4-w\"\n\"2.2+y*4.4/w\"\n\"2.2+y*z*5.5\"\n\"2.2+y*z-5.5\"\n\"2.2+y*z/5.5\"\n\"2.2+y+4.4*w\"\n\"2.2+y+4.4-w\"\n\"2.2+y+4.4/w\"\n\"2.2+y+z*5.5\"\n\"2.2+y+z-5.5\"\n\"2.2+y+z/5.5\"\n\"2.2+y-4.4*w\"\n\"2.2+y-4.4-w\"\n\"2.2+y-4.4/w\"\n\"2.2+y-z*5.5\"\n\"2.2+y-z-5.5\"\n\"2.2+y-z/5.5\"\n\"2.2+y/4.4*w\"\n\"2.2+y/4.4+w\"\n\"2.2+y/4.4-w\"\n\"2.2+y/4.4/w\"\n\"2.2+y/z*5.5\"\n\"2.2+y/z+5.5\"\n\"2.2+y/z-5.5\"\n\"2.2+y/z/5.5\"\n\"2.2-y*4.4*w\"\n\"2.2-y*4.4-w\"\n\"2.2-y*4.4/w\"\n\"2.2-y*z*5.5\"\n\"2.2-y*z-5.5\"\n\"2.2-y*z/5.5\"\n\"2.2-y+4.4*w\"\n\"2.2-y+4.4+w\"\n\"2.2-y+4.4/w\"\n\"2.2-y+z*5.5\"\n\"2.2-y+z+5.5\"\n\"2.2-y+z/5.5\"\n\"2.2-y-4.4*w\"\n\"2.2-y-4.4+w\"\n\"2.2-y-4.4/w\"\n\"2.2-y-z*5.5\"\n\"2.2-y-z+5.5\"\n\"2.2-y-z/5.5\"\n\"2.2-y/4.4*w\"\n\"2.2-y/4.4-w\"\n\"2.2-y/4.4/w\"\n\"2.2-y/z*5.5\"\n\"2.2-y/z-5.5\"\n\"2.2-y/z/5.5\"\n\"2.2/y*4.4+w\"\n\"2.2/y*4.4-w\"\n\"2.2/y*z+5.5\"\n\"2.2/y*z-5.5\"\n\"2.2/y+4.4*w\"\n\"2.2/y+4.4+w\"\n\"2.2/y+4.4-w\"\n\"2.2/y+4.4/w\"\n\"2.2/y+z*5.5\"\n\"2.2/y+z+5.5\"\n\"2.2/y+z-5.5\"\n\"2.2/y+z/5.5\"\n\"2.2/y-4.4*w\"\n\"2.2/y-4.4+w\"\n\"2.2/y-4.4-w\"\n\"2.2/y-4.4/w\"\n\"2.2/y-z*5.5\"\n\"2.2/y-z+5.5\"\n\"2.2/y-z-5.5\"\n\"2.2/y-z/5.5\"\n\"2.2/y/4.4+w\"\n\"2.2/y/4.4-w\"\n\"2.2/y/z+5.5\"\n\"2.2/y/z-5.5\"\n\"sin(tan(b))\"\n\"x*3.3*4.4+w\"\n\"x*3.3*4.4-w\"\n\"x*3.3*z+5.5\"\n\"x*3.3*z-5.5\"\n\"x*3.3+4.4*w\"\n\"x*3.3+4.4+w\"\n\"x*3.3+4.4-w\"\n\"x*3.3+4.4/w\"\n\"x*3.3+z*5.5\"\n\"x*3.3+z+5.5\"\n\"x*3.3+z-5.5\"\n\"x*3.3+z/5.5\"\n\"x*3.3-4.4*w\"\n\"x*3.3-4.4+w\"\n\"x*3.3-4.4-w\"\n\"x*3.3-4.4/w\"\n\"x*3.3-z*5.5\"\n\"x*3.3-z+5.5\"\n\"x*3.3-z-5.5\"\n\"x*3.3-z/5.5\"\n\"x*3.3/4.4+w\"\n\"x*3.3/4.4-w\"\n\"x*3.3/z+5.5\"\n\"x*3.3/z-5.5\"\n\"x*y*z-x*y/z\"\n\"x*y+z+x*y-z\"\n\"x*y/z-x*y*z\"\n\"x+3.3*4.4*w\"\n\"x+3.3*4.4-w\"\n\"x+3.3*4.4/w\"\n\"x+3.3*z*5.5\"\n\"x+3.3*z-5.5\"\n\"x+3.3*z/5.5\"\n\"x+3.3+4.4*w\"\n\"x+3.3+4.4-w\"\n\"x+3.3+4.4/w\"\n\"x+3.3+z*5.5\"\n\"x+3.3+z-5.5\"\n\"x+3.3+z/5.5\"\n\"x+3.3-4.4*w\"\n\"x+3.3-4.4-w\"\n\"x+3.3-4.4/w\"\n\"x+3.3-z*5.5\"\n\"x+3.3-z-5.5\"\n\"x+3.3-z/5.5\"\n\"x+3.3/4.4*w\"\n\"x+3.3/4.4-w\"\n\"x+3.3/4.4/w\"\n\"x+3.3/z*5.5\"\n\"x+3.3/z+5.5\"\n\"x+3.3/z-5.5\"\n\"x+3.3/z/5.5\"\n\"x+y-z-x+y+z\"\n\"x+y/z+x+y*z\"\n\"x+y/z-x+y+z\"\n\"x-3.3*4.4*w\"\n\"x-3.3*4.4-w\"\n\"x-3.3*4.4/w\"\n\"x-3.3*z*5.5\"\n\"x-3.3*z-5.5\"\n\"x-3.3*z/5.5\"\n\"x-3.3+4.4*w\"\n\"x-3.3+4.4+w\"\n\"x-3.3+4.4/w\"\n\"x-3.3+z*5.5\"\n\"x-3.3+z+5.5\"\n\"x-3.3+z/5.5\"\n\"x-3.3-4.4*w\"\n\"x-3.3-4.4+w\"\n\"x-3.3-4.4/w\"\n\"x-3.3-z*5.5\"\n\"x-3.3-z+5.5\"\n\"x-3.3-z/5.5\"\n\"x-3.3/4.4*w\"\n\"x-3.3/4.4-w\"\n\"x-3.3/4.4/w\"\n\"x-3.3/z*5.5\"\n\"x-3.3/z-5.5\"\n\"x-3.3/z/5.5\"\n\"x-y*z+x+y*z\"\n\"x-y/z*x-y*z\"\n\"x-y/z*x-y/z\"\n\"x/3.3*4.4+w\"\n\"x/3.3*4.4-w\"\n\"x/3.3*z+5.5\"\n\"x/3.3*z-5.5\"\n\"x/3.3+4.4*w\"\n\"x/3.3+4.4+w\"\n\"x/3.3+4.4-w\"\n\"x/3.3+4.4/w\"\n\"x/3.3+z*5.5\"\n\"x/3.3+z+5.5\"\n\"x/3.3+z-5.5\"\n\"x/3.3+z/5.5\"\n\"x/3.3-4.4*w\"\n\"x/3.3-4.4+w\"\n\"x/3.3-4.4-w\"\n\"x/3.3-4.4/w\"\n\"x/3.3-z*5.5\"\n\"x/3.3-z+5.5\"\n\"x/3.3-z-5.5\"\n\"x/3.3-z/5.5\"\n\"x/3.3/4.4+w\"\n\"x/3.3/4.4-w\"\n\"x/3.3/z+5.5\"\n\"x/3.3/z-5.5\"\n\"x/y*z*x/y/z\"\n\"x/y+z*x/y-z\"\n\"x/y+z-x/y-z\"\n\"x/y/z+x/y*z\"\n\"(((((())))))\"\n\"((1.11+a)*a)\"\n\"((3.08+e)-b)\"\n\"((a+b)+3.55)\"\n\"((b*b)*2.41)\"\n\"(b/(b*0.06))\"\n\"a+b-e*pi/5^6\"\n\"a^-2^3-1/a^8\"\n\"a^b/e*pi-5+6\"\n\"(((a-a)+e)/a)\"\n\"(((b+e)+a)-a)\"\n\"((0.73+pi)*e)\"\n\"((3.123*y*z))\"\n\"((3.123*y+z))\"\n\"((3.123*y-z))\"\n\"((3.123*y/z))\"\n\"((3.123+y*z))\"\n\"((3.123+y+z))\"\n\"((3.123+y-z))\"\n\"((3.123+y/z))\"\n\"((3.123-y*z))\"\n\"((3.123-y+z))\"\n\"((3.123-y-z))\"\n\"((3.123-y/z))\"\n\"((3.123/y*z))\"\n\"((3.123/y+z))\"\n\"((3.123/y-z))\"\n\"((3.123/y/z))\"\n\"((a/pi)-2.55)\"\n\"((b*(b+b))*b)\"\n\"((pi/2.23)-a)\"\n\"((x*5.123*z))\"\n\"((x*5.123+z))\"\n\"((x*5.123-z))\"\n\"((x*5.123/z))\"\n\"((x*y*7.123))\"\n\"((x*y+7.123))\"\n\"((x*y-7.123))\"\n\"((x*y/7.123))\"\n\"((x+5.123*z))\"\n\"((x+5.123+z))\"\n\"((x+5.123-z))\"\n\"((x+5.123/z))\"\n\"((x+y*7.123))\"\n\"((x+y+7.123))\"\n\"((x+y-7.123))\"\n\"((x+y/7.123))\"\n\"((x-5.123*z))\"\n\"((x-5.123+z))\"\n\"((x-5.123-z))\"\n\"((x-5.123/z))\"\n\"((x-y*7.123))\"\n\"((x-y+7.123))\"\n\"((x-y-7.123))\"\n\"((x-y/7.123))\"\n\"((x/5.123*z))\"\n\"((x/5.123+z))\"\n\"((x/5.123-z))\"\n\"((x/5.123/z))\"\n\"((x/y*7.123))\"\n\"((x/y+7.123))\"\n\"((x/y-7.123))\"\n\"((x/y/7.123))\"\n\"(a*(b-(b/b)))\"\n\"(cos(2.41)/b)\"\n\"+a^+2^+3-a^+8\"\n\"123456.123456\"\n\"2.2*y*4.4-5.5\"\n\"2.2*y/4.4-5.5\"\n\"2.2+y*4.4*5.5\"\n\"2.2+y*4.4-5.5\"\n\"2.2+y*4.4/5.5\"\n\"2.2+y+4.4*5.5\"\n\"2.2+y+4.4/5.5\"\n\"2.2+y-4.4*5.5\"\n\"2.2+y-4.4/5.5\"\n\"2.2+y/4.4*5.5\"\n\"2.2+y/4.4+5.5\"\n\"2.2+y/4.4-5.5\"\n\"2.2+y/4.4/5.5\"\n\"2.2-y*4.4*5.5\"\n\"2.2-y*4.4-5.5\"\n\"2.2-y*4.4/5.5\"\n\"2.2-y+4.4*5.5\"\n\"2.2-y+4.4/5.5\"\n\"2.2-y-4.4*5.5\"\n\"2.2-y-4.4/5.5\"\n\"2.2-y/4.4*5.5\"\n\"2.2-y/4.4-5.5\"\n\"2.2-y/4.4/5.5\"\n\"2.2/y*4.4-5.5\"\n\"2.2/y/4.4-5.5\"\n\"sin(a)+sin(b)\"\n\"sqrt(a^2+b^2)\"\n\"tan((3.59-e))\"\n\"x*3.3*4.4-5.5\"\n\"x*3.3/4.4-5.5\"\n\"x+3.3*4.4-5.5\"\n\"x+3.3/4.4-5.5\"\n\"x-3.3*4.4-5.5\"\n\"x-3.3/4.4-5.5\"\n\"x/3.3*4.4-5.5\"\n\"x/3.3/4.4-5.5\"\n\"(((x)))(((x)))\"\n\"(1.1+b)*(-3.3)\"\n\"-(sin(pi+a)+1)\"\n\"[[[x]]][[[x]]]\"\n\"sqrt(a)<sin(8)\"\n\"tan(((e+e)/a))\"\n\"{{{x}}}{{{x}}}\"\n\"((((x*y)*z)-w))\"\n\"((((x*y)/z)-w))\"\n\"((((x+y)*z)-w))\"\n\"((((x+y)/z)-w))\"\n\"((((x-y)*z)-w))\"\n\"((((x-y)/z)-w))\"\n\"((((x/y)*z)-w))\"\n\"((((x/y)/z)-w))\"\n\"(((3.123*y)*z))\"\n\"(((3.123*y)+z))\"\n\"(((3.123*y)-z))\"\n\"(((3.123*y)/z))\"\n\"(((3.123+y)*z))\"\n\"(((3.123+y)+z))\"\n\"(((3.123+y)-z))\"\n\"(((3.123+y)/z))\"\n\"(((3.123-y)*z))\"\n\"(((3.123-y)/z))\"\n\"(((3.123/y)*z))\"\n\"(((3.123/y)+z))\"\n\"(((3.123/y)-z))\"\n\"(((3.123/y)/z))\"\n\"(((x*5.123)*z))\"\n\"(((x*5.123)+z))\"\n\"(((x*5.123)-z))\"\n\"(((x*5.123)/z))\"\n\"(((x*y)*(z+w)))\"\n\"(((x*y)*(z-w)))\"\n\"(((x*y)*7.123))\"\n\"(((x*y)+(z*w)))\"\n\"(((x*y)+(z+w)))\"\n\"(((x*y)+(z-w)))\"\n\"(((x*y)+(z/w)))\"\n\"(((x*y)+7.123))\"\n\"(((x*y)-(z*w)))\"\n\"(((x*y)-(z+w)))\"\n\"(((x*y)-(z-w)))\"\n\"(((x*y)-(z/w)))\"\n\"(((x*y)-7.123))\"\n\"(((x*y)/(z+w)))\"\n\"(((x*y)/(z-w)))\"\n\"(((x*y)/7.123))\"\n\"(((x+5.123)*z))\"\n\"(((x+5.123)+z))\"\n\"(((x+5.123)-z))\"\n\"(((x+5.123)/z))\"\n\"(((x+y)*(z*w)))\"\n\"(((x+y)*(z-w)))\"\n\"(((x+y)*(z/w)))\"\n\"(((x+y)*7.123))\"\n\"(((x+y)+(z*w)))\"\n\"(((x+y)+(z-w)))\"\n\"(((x+y)+(z/w)))\"\n\"(((x+y)+7.123))\"\n\"(((x+y)-(z*w)))\"\n\"(((x+y)-(z-w)))\"\n\"(((x+y)-(z/w)))\"\n\"(((x+y)-7.123))\"\n\"(((x+y)/(z*w)))\"\n\"(((x+y)/(z-w)))\"\n\"(((x+y)/(z/w)))\"\n\"(((x+y)/7.123))\"\n\"(((x-5.123)*z))\"\n\"(((x-5.123)/z))\"\n\"(((x-y)*(z*w)))\"\n\"(((x-y)*(z+w)))\"\n\"(((x-y)*(z/w)))\"\n\"(((x-y)*7.123))\"\n\"(((x-y)+(z*w)))\"\n\"(((x-y)+(z+w)))\"\n\"(((x-y)+(z/w)))\"\n\"(((x-y)-(z*w)))\"\n\"(((x-y)-(z+w)))\"\n\"(((x-y)-(z/w)))\"\n\"(((x-y)/(z*w)))\"\n\"(((x-y)/(z+w)))\"\n\"(((x-y)/(z/w)))\"\n\"(((x-y)/7.123))\"\n\"(((x/5.123)*z))\"\n\"(((x/5.123)+z))\"\n\"(((x/5.123)-z))\"\n\"(((x/5.123)/z))\"\n\"(((x/y)*(z+w)))\"\n\"(((x/y)*(z-w)))\"\n\"(((x/y)*7.123))\"\n\"(((x/y)+(z+w)))\"\n\"(((x/y)+(z-w)))\"\n\"(((x/y)+(z/w)))\"\n\"(((x/y)+7.123))\"\n\"(((x/y)-(z*w)))\"\n\"(((x/y)-(z+w)))\"\n\"(((x/y)-(z-w)))\"\n\"(((x/y)-(z/w)))\"\n\"(((x/y)-7.123))\"\n\"(((x/y)/(z+w)))\"\n\"(((x/y)/(z-w)))\"\n\"(((x/y)/7.123))\"\n\"((3.123*(y*z)))\"\n\"((3.123*(y+z)))\"\n\"((3.123*(y-z)))\"\n\"((3.123*(y/z)))\"\n\"((3.123*y*z+w))\"\n\"((3.123*y*z-w))\"\n\"((3.123*y+z*w))\"\n\"((3.123*y+z+w))\"\n\"((3.123*y+z-w))\"\n\"((3.123*y+z/w))\"\n\"((3.123*y-z*w))\"\n\"((3.123*y-z+w))\"\n\"((3.123*y-z-w))\"\n\"((3.123*y-z/w))\"\n\"((3.123*y/z+w))\"\n\"((3.123*y/z-w))\"\n\"((3.123+(y*z)))\"\n\"((3.123+(y+z)))\"\n\"((3.123+(y-z)))\"\n\"((3.123+(y/z)))\"\n\"((3.123+y*z*w))\"\n\"((3.123+y*z-w))\"\n\"((3.123+y*z/w))\"\n\"((3.123+y+z*w))\"\n\"((3.123+y+z-w))\"\n\"((3.123+y+z/w))\"\n\"((3.123+y-z*w))\"\n\"((3.123+y-z-w))\"\n\"((3.123+y-z/w))\"\n\"((3.123+y/z*w))\"\n\"((3.123+y/z+w))\"\n\"((3.123+y/z-w))\"\n\"((3.123+y/z/w))\"\n\"((3.123-(y*z)))\"\n\"((3.123-(y+z)))\"\n\"((3.123-(y-z)))\"\n\"((3.123-(y/z)))\"\n\"((3.123-y*z*w))\"\n\"((3.123-y*z+w))\"\n\"((3.123-y*z-w))\"\n\"((3.123-y*z/w))\"\n\"((3.123-y+z*w))\"\n\"((3.123-y+z+w))\"\n\"((3.123-y+z/w))\"\n\"((3.123-y-z*w))\"\n\"((3.123-y-z+w))\"\n\"((3.123-y-z/w))\"\n\"((3.123-y/z*w))\"\n\"((3.123-y/z+w))\"\n\"((3.123-y/z-w))\"\n\"((3.123-y/z/w))\"\n\"((3.123/(y*z)))\"\n\"((3.123/(y+z)))\"\n\"((3.123/(y-z)))\"\n\"((3.123/(y/z)))\"\n\"((3.123/y*z+w))\"\n\"((3.123/y*z-w))\"\n\"((3.123/y+z*w))\"\n\"((3.123/y+z+w))\"\n\"((3.123/y+z-w))\"\n\"((3.123/y+z/w))\"\n\"((3.123/y-z*w))\"\n\"((3.123/y-z+w))\"\n\"((3.123/y-z-w))\"\n\"((3.123/y-z/w))\"\n\"((3.123/y/z+w))\"\n\"((3.123/y/z-w))\"\n\"((3.27-b)-0.73)\"\n\"((a+sin(a))-pi)\"\n\"((x*(5.123*z)))\"\n\"((x*(5.123+z)))\"\n\"((x*(5.123-z)))\"\n\"((x*(5.123/z)))\"\n\"((x*(y*7.123)))\"\n\"((x*(y+(z*w))))\"\n\"((x*(y+7.123)))\"\n\"((x*(y-(z*w))))\"\n\"((x*(y-7.123)))\"\n\"((x*(y/7.123)))\"\n\"((x*5.123*z+w))\"\n\"((x*5.123*z-w))\"\n\"((x*5.123+z*w))\"\n\"((x*5.123+z+w))\"\n\"((x*5.123+z-w))\"\n\"((x*5.123+z/w))\"\n\"((x*5.123-z*w))\"\n\"((x*5.123-z+w))\"\n\"((x*5.123-z-w))\"\n\"((x*5.123-z/w))\"\n\"((x*5.123/z+w))\"\n\"((x*5.123/z-w))\"\n\"((x*y*7.123+w))\"\n\"((x*y*7.123-w))\"\n\"((x*y*z+9.123))\"\n\"((x*y*z+x+y/z))\"\n\"((x*y*z-9.123))\"\n\"((x*y*z-x/y*z))\"\n\"((x*y+7.123*w))\"\n\"((x*y+7.123+w))\"\n\"((x*y+7.123-w))\"\n\"((x*y+7.123/w))\"\n\"((x*y+z*9.123))\"\n\"((x*y+z*x-y*z))\"\n\"((x*y+z*x/y*z))\"\n\"((x*y+z+9.123))\"\n\"((x*y+z-9.123))\"\n\"((x*y+z/9.123))\"\n\"((x*y-7.123*w))\"\n\"((x*y-7.123+w))\"\n\"((x*y-7.123-w))\"\n\"((x*y-7.123/w))\"\n\"((x*y-z*9.123))\"\n\"((x*y-z+9.123))\"\n\"((x*y-z-9.123))\"\n\"((x*y-z/9.123))\"\n\"((x*y-z/x+y*z))\"\n\"((x*y-z/x/y+z))\"\n\"((x*y/7.123+w))\"\n\"((x*y/7.123-w))\"\n\"((x*y/z+9.123))\"\n\"((x*y/z+x/y-z))\"\n\"((x*y/z-9.123))\"\n\"((x*y/z-x+y+z))\"\n\"((x+((y*z)*w)))\"\n\"((x+((y*z)/w)))\"\n\"((x+((y+z)*w)))\"\n\"((x+((y+z)/w)))\"\n\"((x+((y-z)*w)))\"\n\"((x+((y-z)/w)))\"\n\"((x+((y/z)*w)))\"\n\"((x+((y/z)+w)))\"\n\"((x+((y/z)/w)))\"\n\"((x+(5.123*z)))\"\n\"((x+(5.123+z)))\"\n\"((x+(5.123-z)))\"\n\"((x+(5.123/z)))\"\n\"((x+(y*(z/w))))\"\n\"((x+(y*7.123)))\"\n\"((x+(y+7.123)))\"\n\"((x+(y-7.123)))\"\n\"((x+(y/(z*w))))\"\n\"((x+(y/7.123)))\"\n\"((x+5.123*z*w))\"\n\"((x+5.123*z-w))\"\n\"((x+5.123*z/w))\"\n\"((x+5.123+z*w))\"\n\"((x+5.123+z-w))\"\n\"((x+5.123+z/w))\"\n\"((x+5.123-z*w))\"\n\"((x+5.123-z-w))\"\n\"((x+5.123-z/w))\"\n\"((x+5.123/z*w))\"\n\"((x+5.123/z+w))\"\n\"((x+5.123/z-w))\"\n\"((x+5.123/z/w))\"\n\"((x+y*7.123*w))\"\n\"((x+y*7.123-w))\"\n\"((x+y*7.123/w))\"\n\"((x+y*z*9.123))\"\n\"((x+y*z*x+y+z))\"\n\"((x+y*z-9.123))\"\n\"((x+y*z-x*y/z))\"\n\"((x+y*z/9.123))\"\n\"((x+y+7.123*w))\"\n\"((x+y+7.123-w))\"\n\"((x+y+7.123/w))\"\n\"((x+y+z*9.123))\"\n\"((x+y+z+x-y*z))\"\n\"((x+y+z-9.123))\"\n\"((x+y+z/9.123))\"\n\"((x+y+z/x/y+z))\"\n\"((x+y-7.123*w))\"\n\"((x+y-7.123-w))\"\n\"((x+y-7.123/w))\"\n\"((x+y-z*9.123))\"\n\"((x+y-z*x*y*z))\"\n\"((x+y-z-9.123))\"\n\"((x+y-z-x*y+z))\"\n\"((x+y-z/9.123))\"\n\"((x+y/7.123*w))\"\n\"((x+y/7.123+w))\"\n\"((x+y/7.123-w))\"\n\"((x+y/7.123/w))\"\n\"((x+y/z*9.123))\"\n\"((x+y/z+9.123))\"\n\"((x+y/z+x*y-z))\"\n\"((x+y/z-9.123))\"\n\"((x+y/z/9.123))\"\n\"((x+y/z/x-y/z))\"\n\"((x-((y*z)*w)))\"\n\"((x-((y*z)/w)))\"\n\"((x-((y+z)*w)))\"\n\"((x-((y+z)/w)))\"\n\"((x-((y-z)*w)))\"\n\"((x-((y-z)/w)))\"\n\"((x-((y/z)*w)))\"\n\"((x-((y/z)/w)))\"\n\"((x-(5.123*z)))\"\n\"((x-(5.123+z)))\"\n\"((x-(5.123-z)))\"\n\"((x-(5.123/z)))\"\n\"((x-(y*(z/w))))\"\n\"((x-(y*7.123)))\"\n\"((x-(y+7.123)))\"\n\"((x-(y-7.123)))\"\n\"((x-(y/(z*w))))\"\n\"((x-(y/7.123)))\"\n\"((x-5.123*z*w))\"\n\"((x-5.123*z+w))\"\n\"((x-5.123*z-w))\"\n\"((x-5.123*z/w))\"\n\"((x-5.123+z*w))\"\n\"((x-5.123+z+w))\"\n\"((x-5.123+z/w))\"\n\"((x-5.123-z*w))\"\n\"((x-5.123-z+w))\"\n\"((x-5.123-z/w))\"\n\"((x-5.123/z*w))\"\n\"((x-5.123/z+w))\"\n\"((x-5.123/z-w))\"\n\"((x-5.123/z/w))\"\n\"((x-y*7.123*w))\"\n\"((x-y*7.123+w))\"\n\"((x-y*7.123-w))\"\n\"((x-y*7.123/w))\"\n\"((x-y*z*9.123))\"\n\"((x-y*z+9.123))\"\n\"((x-y*z-9.123))\"\n\"((x-y*z-x+y-z))\"\n\"((x-y*z-x/y/z))\"\n\"((x-y*z/9.123))\"\n\"((x-y+7.123*w))\"\n\"((x-y+7.123+w))\"\n\"((x-y+7.123/w))\"\n\"((x-y+z*9.123))\"\n\"((x-y+z*x+y-z))\"\n\"((x-y+z+9.123))\"\n\"((x-y+z/9.123))\"\n\"((x-y-7.123*w))\"\n\"((x-y-7.123+w))\"\n\"((x-y-7.123/w))\"\n\"((x-y-z*9.123))\"\n\"((x-y-z+9.123))\"\n\"((x-y-z/9.123))\"\n\"((x-y-z/x+y/z))\"\n\"((x-y/7.123*w))\"\n\"((x-y/7.123+w))\"\n\"((x-y/7.123-w))\"\n\"((x-y/7.123/w))\"\n\"((x-y/z*9.123))\"\n\"((x-y/z+9.123))\"\n\"((x-y/z+x+y*z))\"\n\"((x-y/z+x/y-z))\"\n\"((x-y/z-9.123))\"\n\"((x-y/z/9.123))\"\n\"((x/(5.123*z)))\"\n\"((x/(5.123+z)))\"\n\"((x/(5.123-z)))\"\n\"((x/(5.123/z)))\"\n\"((x/(y*7.123)))\"\n\"((x/(y+(z*w))))\"\n\"((x/(y+7.123)))\"\n\"((x/(y-(z*w))))\"\n\"((x/(y-7.123)))\"\n\"((x/(y/7.123)))\"\n\"((x/5.123*z+w))\"\n\"((x/5.123*z-w))\"\n\"((x/5.123+z*w))\"\n\"((x/5.123+z+w))\"\n\"((x/5.123+z-w))\"\n\"((x/5.123+z/w))\"\n\"((x/5.123-z*w))\"\n\"((x/5.123-z+w))\"\n\"((x/5.123-z-w))\"\n\"((x/5.123-z/w))\"\n\"((x/5.123/z+w))\"\n\"((x/5.123/z-w))\"\n\"((x/y*7.123+w))\"\n\"((x/y*7.123-w))\"\n\"((x/y*z+9.123))\"\n\"((x/y*z+x-y-z))\"\n\"((x/y*z-9.123))\"\n\"((x/y*z-x*y*z))\"\n\"((x/y+7.123*w))\"\n\"((x/y+7.123+w))\"\n\"((x/y+7.123-w))\"\n\"((x/y+7.123/w))\"\n\"((x/y+z*9.123))\"\n\"((x/y+z*x*y/z))\"\n\"((x/y+z*x/y/z))\"\n\"((x/y+z+9.123))\"\n\"((x/y+z-9.123))\"\n\"((x/y+z/9.123))\"\n\"((x/y-7.123*w))\"\n\"((x/y-7.123+w))\"\n\"((x/y-7.123-w))\"\n\"((x/y-7.123/w))\"\n\"((x/y-z*9.123))\"\n\"((x/y-z+9.123))\"\n\"((x/y-z-9.123))\"\n\"((x/y-z/9.123))\"\n\"((x/y-z/x*y+z))\"\n\"((x/y-z/x-y+z))\"\n\"((x/y/7.123+w))\"\n\"((x/y/7.123-w))\"\n\"((x/y/z+9.123))\"\n\"((x/y/z+x*y-z))\"\n\"((x/y/z-9.123))\"\n\"((x/y/z-x-y/z))\"\n\"(0.1*a+1)*a+1.1\"\n\"(2.2*a+1.1)*3.3\"\n\"(b+a/b)*(a-b/a)\"\n\"(pi+sin((a/b)))\"\n\"1.1*a^2+2.2*b^3\"\n\"1.1*a^7+2.2*b^8\"\n\"2.2*y*z-2.2*y/z\"\n\"2.2*y+z+2.2*y-z\"\n\"2.2*y/z-2.2*y*z\"\n\"2.2+y-z-2.2+y+z\"\n\"2.2+y/z+2.2+y*z\"\n\"2.2+y/z-2.2+y+z\"\n\"2.2-y*z+2.2+y*z\"\n\"2.2-y/z*2.2-y*z\"\n\"2.2-y/z*2.2-y/z\"\n\"2.2/y*z*2.2/y/z\"\n\"2.2/y+z*2.2/y-z\"\n\"2.2/y+z-2.2/y-z\"\n\"2.2/y/z+2.2/y*z\"\n\"a^-2^-3-1/a^1/8\"\n\"tan(((a-b)+pi))\"\n\"x*3.3*z-x*3.3/z\"\n\"x*3.3+z+x*3.3-z\"\n\"x*3.3/z-x*3.3*z\"\n\"x*y*4.4-x*y/4.4\"\n\"x*y*z+w-x/y*z+w\"\n\"x*y*z-w-x/y*z-w\"\n\"x*y+4.4+x*y-4.4\"\n\"x*y+z*w*x*y-z*w\"\n\"x*y+z+w+x/y+z+w\"\n\"x*y+z-w-x/y+z-w\"\n\"x*y-z*w-x*y+z/w\"\n\"x*y-z+w*x/y-z+w\"\n\"x*y-z-w*x/y-z-w\"\n\"x*y-z/w*x/y+z/w\"\n\"x*y/4.4-x*y*4.4\"\n\"x*y/z+w*x/y/z+w\"\n\"x*y/z-w+x/y/z-w\"\n\"x+3.3-z-x+3.3+z\"\n\"x+3.3/z+x+3.3*z\"\n\"x+3.3/z-x+3.3+z\"\n\"x+y*z*w+x+y*z/w\"\n\"x+y*z/w*x+y*z*w\"\n\"x+y+z*w-x+y+z/w\"\n\"x+y+z-w*x+y+z-w\"\n\"x+y+z/w+x+y+z*w\"\n\"x+y-4.4-x+y+4.4\"\n\"x+y-z*w+x+y-z/w\"\n\"x+y-z-w-x+y-z-w\"\n\"x+y-z/w-x+y-z*w\"\n\"x+y/4.4+x+y*4.4\"\n\"x+y/4.4-x+y+4.4\"\n\"x+y/z*w-x+y/z/w\"\n\"x+y/z*w-x-y+z/w\"\n\"x+y/z+w+x+y/z/w\"\n\"x-3.3*z+x+3.3*z\"\n\"x-3.3/z*x-3.3*z\"\n\"x-3.3/z*x-3.3/z\"\n\"x-y*4.4+x+y*4.4\"\n\"x-y*z*w+x-y*z/w\"\n\"x-y*z*w-x-y/z/w\"\n\"x-y*z-w+x*y*z-w\"\n\"x-y+z*w*x-y+z/w\"\n\"x-y+z*w*x-y-z/w\"\n\"x-y+z+w-x-y+z+w\"\n\"x-y-z*w+x-y*z/w\"\n\"x-y-z*w+x-y-z/w\"\n\"x-y-z+w+x-y-z+w\"\n\"x-y/4.4*x-y*4.4\"\n\"x-y/4.4*x-y/4.4\"\n\"x-y/z*w*x+y*z-w\"\n\"x-y/z*w*x-y/z/w\"\n\"x-y/z-w*x*y/z-w\"\n\"x/3.3*z*x/3.3/z\"\n\"x/3.3+z*x/3.3-z\"\n\"x/3.3+z-x/3.3-z\"\n\"x/3.3/z+x/3.3*z\"\n\"x/y*4.4*x/y/4.4\"\n\"x/y*z-w-x+y/z-w\"\n\"x/y+4.4*x/y-4.4\"\n\"x/y+4.4-x/y-4.4\"\n\"x/y+z*w-x/y-z*w\"\n\"x/y-z/w+x/y-z*w\"\n\"x/y/4.4+x/y*4.4\"\n\"x/y/z-w+x*y+z*w\"\n\"(((1.06+a)*e)+e)\"\n\"(((3.55-b)+a)+b)\"\n\"((a+(a+2.13))*e)\"\n\"((sin(b)+pi)*pi)\"\n\"a-(e^(log(7+b)))\"\n\"(((2.85+a)*pi)/a)\"\n\"((3.123*5.123*z))\"\n\"((3.123*5.123+z))\"\n\"((3.123*5.123-z))\"\n\"((3.123*5.123/z))\"\n\"((3.123*y*7.123))\"\n\"((3.123*y+7.123))\"\n\"((3.123*y-7.123))\"\n\"((3.123*y/7.123))\"\n\"((3.123+5.123*z))\"\n\"((3.123+5.123+z))\"\n\"((3.123+5.123-z))\"\n\"((3.123+5.123/z))\"\n\"((3.123+y*7.123))\"\n\"((3.123+y+7.123))\"\n\"((3.123+y-7.123))\"\n\"((3.123+y/7.123))\"\n\"((3.123-5.123*z))\"\n\"((3.123-5.123+z))\"\n\"((3.123-5.123-z))\"\n\"((3.123-5.123/z))\"\n\"((3.123-y*7.123))\"\n\"((3.123-y+7.123))\"\n\"((3.123-y-7.123))\"\n\"((3.123-y/7.123))\"\n\"((3.123/5.123*z))\"\n\"((3.123/5.123+z))\"\n\"((3.123/5.123-z))\"\n\"((3.123/5.123/z))\"\n\"((3.123/y*7.123))\"\n\"((3.123/y+7.123))\"\n\"((3.123/y-7.123))\"\n\"((3.123/y/7.123))\"\n\"((x*5.123*7.123))\"\n\"((x*5.123+7.123))\"\n\"((x*5.123-7.123))\"\n\"((x*5.123/7.123))\"\n\"((x+5.123*7.123))\"\n\"((x+5.123+7.123))\"\n\"((x+5.123-7.123))\"\n\"((x+5.123/7.123))\"\n\"((x-5.123*7.123))\"\n\"((x-5.123/7.123))\"\n\"((x/5.123*7.123))\"\n\"((x/5.123+7.123))\"\n\"((x/5.123-7.123))\"\n\"((x/5.123/7.123))\"\n\"(1.99-sin((b-b)))\"\n\"1-((a*b)+(a/b))-3\"\n\"a/((a+b)*(a-b))/b\"\n\"tan(((b*2.56)*b))\"\n\"((((b*pi)+a)*b)-a)\"\n\"((pi-((a+b)*b))*a)\"\n\"(0.32+((pi+b)+pi))\"\n\"(cos(((e/a)+e))+a)\"\n\"(tan((b+(a-b)))*b)\"\n\"sin(2*a)+cos(pi/b)\"\n\"((((3.123*y)*z)-w))\"\n\"((((3.123*y)/z)-w))\"\n\"((((3.123+y)*z)-w))\"\n\"((((3.123+y)/z)-w))\"\n\"((((3.123-y)*z)-w))\"\n\"((((3.123-y)/z)-w))\"\n\"((((3.123/y)*z)-w))\"\n\"((((3.123/y)/z)-w))\"\n\"((((x*5.123)*z)-w))\"\n\"((((x*5.123)/z)-w))\"\n\"((((x*y)*7.123)-w))\"\n\"((((x*y)*z)-9.123))\"\n\"((((x*y)/7.123)-w))\"\n\"((((x*y)/z)-9.123))\"\n\"((((x+5.123)*z)-w))\"\n\"((((x+5.123)/z)-w))\"\n\"((((x+y)*7.123)-w))\"\n\"((((x+y)*z)-9.123))\"\n\"((((x+y)/7.123)-w))\"\n\"((((x+y)/z)-9.123))\"\n\"((((x-5.123)*z)-w))\"\n\"((((x-5.123)/z)-w))\"\n\"((((x-y)*7.123)-w))\"\n\"((((x-y)*z)-9.123))\"\n\"((((x-y)/7.123)-w))\"\n\"((((x-y)/z)-9.123))\"\n\"((((x/5.123)*z)-w))\"\n\"((((x/5.123)/z)-w))\"\n\"((((x/y)*7.123)-w))\"\n\"((((x/y)*z)-9.123))\"\n\"((((x/y)/7.123)-w))\"\n\"((((x/y)/z)-9.123))\"\n\"(((2.12-a)+2.76)+b)\"\n\"(((3.123*y)*(z+w)))\"\n\"(((3.123*y)*(z-w)))\"\n\"(((3.123*y)*7.123))\"\n\"(((3.123*y)+(z*w)))\"\n\"(((3.123*y)+(z+w)))\"\n\"(((3.123*y)+(z-w)))\"\n\"(((3.123*y)+(z/w)))\"\n\"(((3.123*y)+7.123))\"\n\"(((3.123*y)-(z*w)))\"\n\"(((3.123*y)-(z+w)))\"\n\"(((3.123*y)-(z-w)))\"\n\"(((3.123*y)-(z/w)))\"\n\"(((3.123*y)-7.123))\"\n\"(((3.123*y)/(z+w)))\"\n\"(((3.123*y)/(z-w)))\"\n\"(((3.123*y)/7.123))\"\n\"(((3.123+y)*(z*w)))\"\n\"(((3.123+y)*(z-w)))\"\n\"(((3.123+y)*(z/w)))\"\n\"(((3.123+y)*7.123))\"\n\"(((3.123+y)+(z*w)))\"\n\"(((3.123+y)+(z-w)))\"\n\"(((3.123+y)+(z/w)))\"\n\"(((3.123+y)+7.123))\"\n\"(((3.123+y)-(z*w)))\"\n\"(((3.123+y)-(z-w)))\"\n\"(((3.123+y)-(z/w)))\"\n\"(((3.123+y)-7.123))\"\n\"(((3.123+y)/(z*w)))\"\n\"(((3.123+y)/(z-w)))\"\n\"(((3.123+y)/(z/w)))\"\n\"(((3.123+y)/7.123))\"\n\"(((3.123-y)*(z*w)))\"\n\"(((3.123-y)*(z+w)))\"\n\"(((3.123-y)*(z/w)))\"\n\"(((3.123-y)*7.123))\"\n\"(((3.123-y)+(z*w)))\"\n\"(((3.123-y)+(z+w)))\"\n\"(((3.123-y)+(z/w)))\"\n\"(((3.123-y)-(z*w)))\"\n\"(((3.123-y)-(z+w)))\"\n\"(((3.123-y)-(z/w)))\"\n\"(((3.123-y)/(z*w)))\"\n\"(((3.123-y)/(z+w)))\"\n\"(((3.123-y)/(z/w)))\"\n\"(((3.123-y)/7.123))\"\n\"(((3.123/y)*(z+w)))\"\n\"(((3.123/y)*(z-w)))\"\n\"(((3.123/y)*7.123))\"\n\"(((3.123/y)+(z+w)))\"\n\"(((3.123/y)+(z-w)))\"\n\"(((3.123/y)+(z/w)))\"\n\"(((3.123/y)+7.123))\"\n\"(((3.123/y)-(z*w)))\"\n\"(((3.123/y)-(z+w)))\"\n\"(((3.123/y)-(z-w)))\"\n\"(((3.123/y)-(z/w)))\"\n\"(((3.123/y)-7.123))\"\n\"(((3.123/y)/(z+w)))\"\n\"(((3.123/y)/(z-w)))\"\n\"(((3.123/y)/7.123))\"\n\"(((3.88/a)-a)-2.08)\"\n\"(((x*5.123)*(z+w)))\"\n\"(((x*5.123)*(z-w)))\"\n\"(((x*5.123)*7.123))\"\n\"(((x*5.123)+(z*w)))\"\n\"(((x*5.123)+(z+w)))\"\n\"(((x*5.123)+(z-w)))\"\n\"(((x*5.123)+(z/w)))\"\n\"(((x*5.123)+7.123))\"\n\"(((x*5.123)-(z*w)))\"\n\"(((x*5.123)-(z+w)))\"\n\"(((x*5.123)-(z-w)))\"\n\"(((x*5.123)-(z/w)))\"\n\"(((x*5.123)-7.123))\"\n\"(((x*5.123)/(z+w)))\"\n\"(((x*5.123)/(z-w)))\"\n\"(((x*5.123)/7.123))\"\n\"(((x*y)*(7.123+w)))\"\n\"(((x*y)*(7.123-w)))\"\n\"(((x*y)*(z+9.123)))\"\n\"(((x*y)*(z-9.123)))\"\n\"(((x*y)+(7.123*w)))\"\n\"(((x*y)+(7.123+w)))\"\n\"(((x*y)+(7.123-w)))\"\n\"(((x*y)+(7.123/w)))\"\n\"(((x*y)+(z*9.123)))\"\n\"(((x*y)+(z+9.123)))\"\n\"(((x*y)+(z-9.123)))\"\n\"(((x*y)+(z/9.123)))\"\n\"(((x*y)-(7.123*w)))\"\n\"(((x*y)-(7.123+w)))\"\n\"(((x*y)-(7.123-w)))\"\n\"(((x*y)-(7.123/w)))\"\n\"(((x*y)-(z*9.123)))\"\n\"(((x*y)-(z+9.123)))\"\n\"(((x*y)-(z-9.123)))\"\n\"(((x*y)-(z/9.123)))\"\n\"(((x*y)/(7.123+w)))\"\n\"(((x*y)/(7.123-w)))\"\n\"(((x*y)/(z+9.123)))\"\n\"(((x*y)/(z-9.123)))\"\n\"(((x+5.123)*(z*w)))\"\n\"(((x+5.123)*(z-w)))\"\n\"(((x+5.123)*(z/w)))\"\n\"(((x+5.123)*7.123))\"\n\"(((x+5.123)+(z*w)))\"\n\"(((x+5.123)+(z-w)))\"\n\"(((x+5.123)+(z/w)))\"\n\"(((x+5.123)+7.123))\"\n\"(((x+5.123)-(z*w)))\"\n\"(((x+5.123)-(z-w)))\"\n\"(((x+5.123)-(z/w)))\"\n\"(((x+5.123)-7.123))\"\n\"(((x+5.123)/(z*w)))\"\n\"(((x+5.123)/(z-w)))\"\n\"(((x+5.123)/(z/w)))\"\n\"(((x+5.123)/7.123))\"\n\"(((x+y)*(7.123*w)))\"\n\"(((x+y)*(7.123-w)))\"\n\"(((x+y)*(7.123/w)))\"\n\"(((x+y)*(z*9.123)))\"\n\"(((x+y)*(z-9.123)))\"\n\"(((x+y)*(z/9.123)))\"\n\"(((x+y)+(7.123*w)))\"\n\"(((x+y)+(7.123-w)))\"\n\"(((x+y)+(7.123/w)))\"\n\"(((x+y)+(z*9.123)))\"\n\"(((x+y)+(z-9.123)))\"\n\"(((x+y)+(z/9.123)))\"\n\"(((x+y)-(7.123*w)))\"\n\"(((x+y)-(7.123-w)))\"\n\"(((x+y)-(7.123/w)))\"\n\"(((x+y)-(z*9.123)))\"\n\"(((x+y)-(z-9.123)))\"\n\"(((x+y)-(z/9.123)))\"\n\"(((x+y)/(7.123*w)))\"\n\"(((x+y)/(7.123-w)))\"\n\"(((x+y)/(7.123/w)))\"\n\"(((x+y)/(z*9.123)))\"\n\"(((x+y)/(z-9.123)))\"\n\"(((x+y)/(z/9.123)))\"\n\"(((x-5.123)*(z*w)))\"\n\"(((x-5.123)*(z+w)))\"\n\"(((x-5.123)*(z/w)))\"\n\"(((x-5.123)*7.123))\"\n\"(((x-5.123)+(z*w)))\"\n\"(((x-5.123)+(z+w)))\"\n\"(((x-5.123)+(z/w)))\"\n\"(((x-5.123)-(z*w)))\"\n\"(((x-5.123)-(z+w)))\"\n\"(((x-5.123)-(z/w)))\"\n\"(((x-5.123)/(z*w)))\"\n\"(((x-5.123)/(z+w)))\"\n\"(((x-5.123)/(z/w)))\"\n\"(((x-5.123)/7.123))\"\n\"(((x-y)*(7.123*w)))\"\n\"(((x-y)*(7.123+w)))\"\n\"(((x-y)*(7.123/w)))\"\n\"(((x-y)*(z*9.123)))\"\n\"(((x-y)*(z+9.123)))\"\n\"(((x-y)*(z/9.123)))\"\n\"(((x-y)+(7.123*w)))\"\n\"(((x-y)+(7.123+w)))\"\n\"(((x-y)+(7.123/w)))\"\n\"(((x-y)+(z*9.123)))\"\n\"(((x-y)+(z+9.123)))\"\n\"(((x-y)+(z/9.123)))\"\n\"(((x-y)-(7.123*w)))\"\n\"(((x-y)-(7.123+w)))\"\n\"(((x-y)-(7.123/w)))\"\n\"(((x-y)-(z*9.123)))\"\n\"(((x-y)-(z+9.123)))\"\n\"(((x-y)-(z/9.123)))\"\n\"(((x-y)/(7.123*w)))\"\n\"(((x-y)/(7.123+w)))\"\n\"(((x-y)/(7.123/w)))\"\n\"(((x-y)/(z*9.123)))\"\n\"(((x-y)/(z+9.123)))\"\n\"(((x-y)/(z/9.123)))\"\n\"(((x/5.123)*(z+w)))\"\n\"(((x/5.123)*(z-w)))\"\n\"(((x/5.123)*7.123))\"\n\"(((x/5.123)+(z+w)))\"\n\"(((x/5.123)+(z-w)))\"\n\"(((x/5.123)+(z/w)))\"\n\"(((x/5.123)+7.123))\"\n\"(((x/5.123)-(z*w)))\"\n\"(((x/5.123)-(z+w)))\"\n\"(((x/5.123)-(z-w)))\"\n\"(((x/5.123)-(z/w)))\"\n\"(((x/5.123)-7.123))\"\n\"(((x/5.123)/(z+w)))\"\n\"(((x/5.123)/(z-w)))\"\n\"(((x/5.123)/7.123))\"\n\"(((x/y)*(7.123+w)))\"\n\"(((x/y)*(7.123-w)))\"\n\"(((x/y)*(z+9.123)))\"\n\"(((x/y)*(z-9.123)))\"\n\"(((x/y)+(7.123+w)))\"\n\"(((x/y)+(7.123-w)))\"\n\"(((x/y)+(7.123/w)))\"\n\"(((x/y)+(z+9.123)))\"\n\"(((x/y)+(z-9.123)))\"\n\"(((x/y)+(z/9.123)))\"\n\"(((x/y)-(7.123*w)))\"\n\"(((x/y)-(7.123+w)))\"\n\"(((x/y)-(7.123-w)))\"\n\"(((x/y)-(7.123/w)))\"\n\"(((x/y)-(z*9.123)))\"\n\"(((x/y)-(z+9.123)))\"\n\"(((x/y)-(z-9.123)))\"\n\"(((x/y)-(z/9.123)))\"\n\"(((x/y)/(7.123+w)))\"\n\"(((x/y)/(7.123-w)))\"\n\"(((x/y)/(z+9.123)))\"\n\"(((x/y)/(z-9.123)))\"\n\"((3.123*(5.123*z)))\"\n\"((3.123*(5.123+z)))\"\n\"((3.123*(5.123-z)))\"\n\"((3.123*(5.123/z)))\"\n\"((3.123*(y*7.123)))\"\n\"((3.123*(y+(z*w))))\"\n\"((3.123*(y+7.123)))\"\n\"((3.123*(y-(z*w))))\"\n\"((3.123*(y-7.123)))\"\n\"((3.123*(y/7.123)))\"\n\"((3.123*y*7.123+w))\"\n\"((3.123*y*7.123-w))\"\n\"((3.123*y*z+9.123))\"\n\"((3.123*y*z-9.123))\"\n\"((3.123*y+7.123*w))\"\n\"((3.123*y+7.123+w))\"\n\"((3.123*y+7.123-w))\"\n\"((3.123*y+7.123/w))\"\n\"((3.123*y+z*9.123))\"\n\"((3.123*y+z+9.123))\"\n\"((3.123*y+z-9.123))\"\n\"((3.123*y+z/9.123))\"\n\"((3.123*y-7.123*w))\"\n\"((3.123*y-7.123+w))\"\n\"((3.123*y-7.123-w))\"\n\"((3.123*y-7.123/w))\"\n\"((3.123*y-z*9.123))\"\n\"((3.123*y-z+9.123))\"\n\"((3.123*y-z-9.123))\"\n\"((3.123*y-z/9.123))\"\n\"((3.123*y/7.123+w))\"\n\"((3.123*y/7.123-w))\"\n\"((3.123*y/z+9.123))\"\n\"((3.123*y/z-9.123))\"\n\"((3.123+((y*z)*w)))\"\n\"((3.123+((y*z)/w)))\"\n\"((3.123+((y+z)*w)))\"\n\"((3.123+((y+z)/w)))\"\n\"((3.123+((y-z)*w)))\"\n\"((3.123+((y-z)/w)))\"\n\"((3.123+((y/z)*w)))\"\n\"((3.123+((y/z)+w)))\"\n\"((3.123+((y/z)/w)))\"\n\"((3.123+(5.123*z)))\"\n\"((3.123+(5.123+z)))\"\n\"((3.123+(5.123-z)))\"\n\"((3.123+(5.123/z)))\"\n\"((3.123+(y*(z/w))))\"\n\"((3.123+(y*7.123)))\"\n\"((3.123+(y+7.123)))\"\n\"((3.123+(y-7.123)))\"\n\"((3.123+(y/(z*w))))\"\n\"((3.123+(y/7.123)))\"\n\"((3.123+y*7.123*w))\"\n\"((3.123+y*7.123-w))\"\n\"((3.123+y*7.123/w))\"\n\"((3.123+y*z*9.123))\"\n\"((3.123+y*z-9.123))\"\n\"((3.123+y*z/9.123))\"\n\"((3.123+y+7.123*w))\"\n\"((3.123+y+7.123-w))\"\n\"((3.123+y+7.123/w))\"\n\"((3.123+y+z*9.123))\"\n\"((3.123+y+z-9.123))\"\n\"((3.123+y+z/9.123))\"\n\"((3.123+y-7.123*w))\"\n\"((3.123+y-7.123-w))\"\n\"((3.123+y-7.123/w))\"\n\"((3.123+y-z*9.123))\"\n\"((3.123+y-z-9.123))\"\n\"((3.123+y-z/9.123))\"\n\"((3.123+y/7.123*w))\"\n\"((3.123+y/7.123+w))\"\n\"((3.123+y/7.123-w))\"\n\"((3.123+y/7.123/w))\"\n\"((3.123+y/z*9.123))\"\n\"((3.123+y/z+9.123))\"\n\"((3.123+y/z-9.123))\"\n\"((3.123+y/z/9.123))\"\n\"((3.123-((y*z)*w)))\"\n\"((3.123-((y*z)/w)))\"\n\"((3.123-((y+z)*w)))\"\n\"((3.123-((y+z)/w)))\"\n\"((3.123-((y-z)*w)))\"\n\"((3.123-((y-z)/w)))\"\n\"((3.123-((y/z)*w)))\"\n\"((3.123-((y/z)/w)))\"\n\"((3.123-(5.123*z)))\"\n\"((3.123-(5.123+z)))\"\n\"((3.123-(5.123-z)))\"\n\"((3.123-(5.123/z)))\"\n\"((3.123-(y*(z/w))))\"\n\"((3.123-(y*7.123)))\"\n\"((3.123-(y+7.123)))\"\n\"((3.123-(y-7.123)))\"\n\"((3.123-(y/(z*w))))\"\n\"((3.123-(y/7.123)))\"\n\"((3.123-y*7.123*w))\"\n\"((3.123-y*7.123+w))\"\n\"((3.123-y*7.123-w))\"\n\"((3.123-y*7.123/w))\"\n\"((3.123-y*z*9.123))\"\n\"((3.123-y*z+9.123))\"\n\"((3.123-y*z-9.123))\"\n\"((3.123-y*z/9.123))\"\n\"((3.123-y+7.123*w))\"\n\"((3.123-y+7.123+w))\"\n\"((3.123-y+7.123/w))\"\n\"((3.123-y+z*9.123))\"\n\"((3.123-y+z+9.123))\"\n\"((3.123-y+z/9.123))\"\n\"((3.123-y-7.123*w))\"\n\"((3.123-y-7.123+w))\"\n\"((3.123-y-7.123/w))\"\n\"((3.123-y-z*9.123))\"\n\"((3.123-y-z+9.123))\"\n\"((3.123-y-z/9.123))\"\n\"((3.123-y/7.123*w))\"\n\"((3.123-y/7.123+w))\"\n\"((3.123-y/7.123-w))\"\n\"((3.123-y/7.123/w))\"\n\"((3.123-y/z*9.123))\"\n\"((3.123-y/z+9.123))\"\n\"((3.123-y/z-9.123))\"\n\"((3.123-y/z/9.123))\"\n\"((3.123/(5.123*z)))\"\n\"((3.123/(5.123+z)))\"\n\"((3.123/(5.123-z)))\"\n\"((3.123/(5.123/z)))\"\n\"((3.123/(y*7.123)))\"\n\"((3.123/(y+(z*w))))\"\n\"((3.123/(y+7.123)))\"\n\"((3.123/(y-(z*w))))\"\n\"((3.123/(y-7.123)))\"\n\"((3.123/(y/7.123)))\"\n\"((3.123/y*7.123+w))\"\n\"((3.123/y*7.123-w))\"\n\"((3.123/y*z+9.123))\"\n\"((3.123/y*z-9.123))\"\n\"((3.123/y+7.123*w))\"\n\"((3.123/y+7.123+w))\"\n\"((3.123/y+7.123-w))\"\n\"((3.123/y+7.123/w))\"\n\"((3.123/y+z*9.123))\"\n\"((3.123/y+z+9.123))\"\n\"((3.123/y+z-9.123))\"\n\"((3.123/y+z/9.123))\"\n\"((3.123/y-7.123*w))\"\n\"((3.123/y-7.123+w))\"\n\"((3.123/y-7.123-w))\"\n\"((3.123/y-7.123/w))\"\n\"((3.123/y-z*9.123))\"\n\"((3.123/y-z+9.123))\"\n\"((3.123/y-z-9.123))\"\n\"((3.123/y-z/9.123))\"\n\"((3.123/y/7.123+w))\"\n\"((3.123/y/7.123-w))\"\n\"((3.123/y/z+9.123))\"\n\"((3.123/y/z-9.123))\"\n\"((b+sin((pi-a)))-a)\"\n\"((tan(tan(e))*e)*e)\"\n\"((x*(5.123+(z*w))))\"\n\"((x*(5.123-(z*w))))\"\n\"((x*(y+(7.123*w))))\"\n\"((x*(y+(z*9.123))))\"\n\"((x*(y-(7.123*w))))\"\n\"((x*(y-(z*9.123))))\"\n\"((x*3.123*z+9.123))\"\n\"((x*3.123*z-9.123))\"\n\"((x*3.123+z*9.123))\"\n\"((x*3.123+z+9.123))\"\n\"((x*3.123+z-9.123))\"\n\"((x*3.123+z/9.123))\"\n\"((x*3.123-z*9.123))\"\n\"((x*3.123-z+9.123))\"\n\"((x*3.123-z-9.123))\"\n\"((x*3.123-z/9.123))\"\n\"((x*3.123/z+9.123))\"\n\"((x*3.123/z-9.123))\"\n\"((x*5.123*7.123+w))\"\n\"((x*5.123*7.123-w))\"\n\"((x*5.123+7.123*w))\"\n\"((x*5.123+7.123+w))\"\n\"((x*5.123+7.123-w))\"\n\"((x*5.123+7.123/w))\"\n\"((x*5.123-7.123*w))\"\n\"((x*5.123-7.123+w))\"\n\"((x*5.123-7.123-w))\"\n\"((x*5.123-7.123/w))\"\n\"((x*5.123/7.123+w))\"\n\"((x*5.123/7.123-w))\"\n\"((x*y*z+w+x+y/z/w))\"\n\"((x*y*z-w*x-y*z/w))\"\n\"((x*y*z-w/x+y+z*w))\"\n\"((x*y+z*w*x/y-z+w))\"\n\"((x*y+z*w-x+y-z-w))\"\n\"((x*y+z+w*x/y/z-w))\"\n\"((x*y+z-w+x/y*z-w))\"\n\"((x*y+z/w/x+y*z-w))\"\n\"((x*y-z*w*x+y+z-w))\"\n\"((x*y-z*w/x*y+z+w))\"\n\"((x*y-z+w+x/y/z+w))\"\n\"((x*y-z-w*x-y*z/w))\"\n\"((x*y-z/w+x+y/z-w))\"\n\"((x*y/z+w*x-y+z/w))\"\n\"((x*y/z-w+x-y-z/w))\"\n\"((x*y/z-w/x-y-z*w))\"\n\"((x+((5.123*z)*w)))\"\n\"((x+((5.123*z)/w)))\"\n\"((x+((5.123+z)*w)))\"\n\"((x+((5.123+z)/w)))\"\n\"((x+((5.123-z)*w)))\"\n\"((x+((5.123-z)/w)))\"\n\"((x+((5.123/z)*w)))\"\n\"((x+((5.123/z)+w)))\"\n\"((x+((5.123/z)/w)))\"\n\"((x+((y*7.123)*w)))\"\n\"((x+((y*7.123)/w)))\"\n\"((x+((y*z)*9.123)))\"\n\"((x+((y*z)/9.123)))\"\n\"((x+((y+7.123)*w)))\"\n\"((x+((y+7.123)/w)))\"\n\"((x+((y+z)*9.123)))\"\n\"((x+((y+z)/9.123)))\"\n\"((x+((y-7.123)*w)))\"\n\"((x+((y-7.123)/w)))\"\n\"((x+((y-z)*9.123)))\"\n\"((x+((y-z)/9.123)))\"\n\"((x+((y/7.123)*w)))\"\n\"((x+((y/7.123)+w)))\"\n\"((x+((y/7.123)/w)))\"\n\"((x+((y/z)*9.123)))\"\n\"((x+((y/z)+9.123)))\"\n\"((x+((y/z)/9.123)))\"\n\"((x+(5.123*(z/w))))\"\n\"((x+(5.123/(z*w))))\"\n\"((x+(y*(7.123/w))))\"\n\"((x+(y*(z/9.123))))\"\n\"((x+(y/(7.123*w))))\"\n\"((x+(y/(z*9.123))))\"\n\"((x+3.123*z*9.123))\"\n\"((x+3.123*z-9.123))\"\n\"((x+3.123*z/9.123))\"\n\"((x+3.123+z*9.123))\"\n\"((x+3.123+z-9.123))\"\n\"((x+3.123+z/9.123))\"\n\"((x+3.123-z*9.123))\"\n\"((x+3.123-z-9.123))\"\n\"((x+3.123-z/9.123))\"\n\"((x+3.123/z*9.123))\"\n\"((x+3.123/z+9.123))\"\n\"((x+3.123/z-9.123))\"\n\"((x+3.123/z/9.123))\"\n\"((x+5.123*7.123*w))\"\n\"((x+5.123*7.123-w))\"\n\"((x+5.123*7.123/w))\"\n\"((x+5.123+7.123*w))\"\n\"((x+5.123+7.123-w))\"\n\"((x+5.123+7.123/w))\"\n\"((x+5.123-7.123*w))\"\n\"((x+5.123-7.123-w))\"\n\"((x+5.123-7.123/w))\"\n\"((x+5.123/7.123*w))\"\n\"((x+5.123/7.123-w))\"\n\"((x+5.123/7.123/w))\"\n\"((x+y*z*w+x-y/z*w))\"\n\"((x+y*z*w-x/y/z-w))\"\n\"((x+y*z-w*x-y/z/w))\"\n\"((x+y*z-w-x+y-z*w))\"\n\"((x+y*z/w+x*y/z-w))\"\n\"((x+y*z/w+x-y/z/w))\"\n\"((x+y*z/w-x+y+z/w))\"\n\"((x+y+z*w*x/y+z-w))\"\n\"((x+y+z*w-x/y*z-w))\"\n\"((x+y+z-w-x-y/z*w))\"\n\"((x+y+z/w+x*y*z-w))\"\n\"((x+y+z/w/x*y-z-w))\"\n\"((x+y-z*w+x/y+z+w))\"\n\"((x+y-z*w/x-y/z-w))\"\n\"((x+y-z-w+x+y/z/w))\"\n\"((x+y-z/w*x+y/z-w))\"\n\"((x+y-z/w-x*y+z-w))\"\n\"((x+y/z*w*x+y*z-w))\"\n\"((x+y/z*w*x+y+z*w))\"\n\"((x+y/z*w+x*y+z/w))\"\n\"((x+y/z+w*x*y+z*w))\"\n\"((x+y/z-w-x-y+z*w))\"\n\"((x+y/z-w/x-y*z*w))\"\n\"((x+y/z/w/x*y-z*w))\"\n\"((x+y/z/w/x+y-z/w))\"\n\"((x-((5.123*z)*w)))\"\n\"((x-((5.123*z)/w)))\"\n\"((x-((5.123+z)*w)))\"\n\"((x-((5.123+z)/w)))\"\n\"((x-((5.123-z)*w)))\"\n\"((x-((5.123-z)/w)))\"\n\"((x-((5.123/z)*w)))\"\n\"((x-((5.123/z)/w)))\"\n\"((x-((y*7.123)*w)))\"\n\"((x-((y*7.123)/w)))\"\n\"((x-((y*z)*9.123)))\"\n\"((x-((y*z)/9.123)))\"\n\"((x-((y+7.123)*w)))\"\n\"((x-((y+7.123)/w)))\"\n\"((x-((y+z)*9.123)))\"\n\"((x-((y+z)/9.123)))\"\n\"((x-((y-7.123)*w)))\"\n\"((x-((y-7.123)/w)))\"\n\"((x-((y-z)*9.123)))\"\n\"((x-((y-z)/9.123)))\"\n\"((x-((y/7.123)*w)))\"\n\"((x-((y/7.123)/w)))\"\n\"((x-((y/z)*9.123)))\"\n\"((x-((y/z)/9.123)))\"\n\"((x-(5.123*(z/w))))\"\n\"((x-(5.123/(z*w))))\"\n\"((x-(y*(7.123/w))))\"\n\"((x-(y*(z/9.123))))\"\n\"((x-(y/(7.123*w))))\"\n\"((x-(y/(z*9.123))))\"\n\"((x-3.123*z*9.123))\"\n\"((x-3.123*z+9.123))\"\n\"((x-3.123*z-9.123))\"\n\"((x-3.123*z/9.123))\"\n\"((x-3.123+z*9.123))\"\n\"((x-3.123+z+9.123))\"\n\"((x-3.123+z/9.123))\"\n\"((x-3.123-z*9.123))\"\n\"((x-3.123-z+9.123))\"\n\"((x-3.123-z/9.123))\"\n\"((x-3.123/z*9.123))\"\n\"((x-3.123/z+9.123))\"\n\"((x-3.123/z-9.123))\"\n\"((x-3.123/z/9.123))\"\n\"((x-5.123*7.123*w))\"\n\"((x-5.123*7.123+w))\"\n\"((x-5.123*7.123-w))\"\n\"((x-5.123*7.123/w))\"\n\"((x-5.123+7.123*w))\"\n\"((x-5.123+7.123+w))\"\n\"((x-5.123+7.123/w))\"\n\"((x-5.123-7.123*w))\"\n\"((x-5.123-7.123+w))\"\n\"((x-5.123-7.123/w))\"\n\"((x-5.123/7.123*w))\"\n\"((x-5.123/7.123+w))\"\n\"((x-5.123/7.123-w))\"\n\"((x-5.123/7.123/w))\"\n\"((x-y*z*w*x+y*z*w))\"\n\"((x-y*z*w*x/y-z*w))\"\n\"((x-y*z+w*x/y*z+w))\"\n\"((x-y*z-w*x+y-z/w))\"\n\"((x-y*z/w-x-y/z*w))\"\n\"((x-y*z/w-x/y+z*w))\"\n\"((x-y*z/w/x+y/z+w))\"\n\"((x-y+z*w*x/y+z/w))\"\n\"((x-y+z*w+x/y-z-w))\"\n\"((x-y+z+w-x*y*z+w))\"\n\"((x-y+z/w-x*y-z/w))\"\n\"((x-y+z/w-x+y*z*w))\"\n\"((x-y-z*w*x+y*z/w))\"\n\"((x-y-z*w+x/y-z*w))\"\n\"((x-y-z+w+x-y*z/w))\"\n\"((x-y-z/w/x+y/z*w))\"\n\"((x-y-z/w/x/y-z/w))\"\n\"((x-y/z*w+x*y-z*w))\"\n\"((x-y/z*w+x+y-z*w))\"\n\"((x-y/z*w/x-y*z-w))\"\n\"((x-y/z+w/x*y/z+w))\"\n\"((x-y/z-w*x-y+z/w))\"\n\"((x-y/z/w-x+y*z/w))\"\n\"((x-y/z/w/x*y+z*w))\"\n\"((x/(5.123+(z*w))))\"\n\"((x/(5.123-(z*w))))\"\n\"((x/(y+(7.123*w))))\"\n\"((x/(y+(z*9.123))))\"\n\"((x/(y-(7.123*w))))\"\n\"((x/(y-(z*9.123))))\"\n\"((x/3.123*z+9.123))\"\n\"((x/3.123*z-9.123))\"\n\"((x/3.123+z*9.123))\"\n\"((x/3.123+z+9.123))\"\n\"((x/3.123+z-9.123))\"\n\"((x/3.123+z/9.123))\"\n\"((x/3.123-z*9.123))\"\n\"((x/3.123-z+9.123))\"\n\"((x/3.123-z-9.123))\"\n\"((x/3.123-z/9.123))\"\n\"((x/3.123/z+9.123))\"\n\"((x/3.123/z-9.123))\"\n\"((x/5.123*7.123+w))\"\n\"((x/5.123*7.123-w))\"\n\"((x/5.123+7.123*w))\"\n\"((x/5.123+7.123+w))\"\n\"((x/5.123+7.123-w))\"\n\"((x/5.123+7.123/w))\"\n\"((x/5.123-7.123*w))\"\n\"((x/5.123-7.123+w))\"\n\"((x/5.123-7.123-w))\"\n\"((x/5.123-7.123/w))\"\n\"((x/5.123/7.123+w))\"\n\"((x/5.123/7.123-w))\"\n\"((x/y*z+w-x+y/z*w))\"\n\"((x/y*z-w+x+y+z/w))\"\n\"((x/y*z-w/x-y*z*w))\"\n\"((x/y+z*w+x-y/z+w))\"\n\"((x/y+z+w/x*y*z-w))\"\n\"((x/y+z-w-x+y*z/w))\"\n\"((x/y+z/w-x-y-z+w))\"\n\"((x/y-z*w-x*y-z+w))\"\n\"((x/y-z*w/x-y*z+w))\"\n\"((x/y-z+w-x*y/z-w))\"\n\"((x/y-z-w/x+y/z*w))\"\n\"((x/y-z/w*x-y+z+w))\"\n\"((x/y/z+w/x-y+z*w))\"\n\"((x/y/z-w+x-y-z/w))\"\n\"((x/y/z-w-x-y-z*w))\"\n\"(1.1*(2.2/3.3))-4.4\"\n\"(1.1+a^2)+(2.2+b^2)\"\n\"(a^2^3/4)-(a^2^3/4)\"\n\"2.2*y*z+w-2.2/y*z+w\"\n\"2.2*y*z-w-2.2/y*z-w\"\n\"2.2*y+z*w*2.2*y-z*w\"\n\"2.2*y+z+w+2.2/y+z+w\"\n\"2.2*y+z-w-2.2/y+z-w\"\n\"2.2*y-z*w-2.2*y+z/w\"\n\"2.2*y-z+w*2.2/y-z+w\"\n\"2.2*y-z-w*2.2/y-z-w\"\n\"2.2*y-z/w*2.2/y+z/w\"\n\"2.2*y/z+w*2.2/y/z+w\"\n\"2.2*y/z-w+2.2/y/z-w\"\n\"2.2+y*z*w+2.2+y*z/w\"\n\"2.2+y*z/w*2.2+y*z*w\"\n\"2.2+y+z*w-2.2+y+z/w\"\n\"2.2+y+z-w*2.2+y+z-w\"\n\"2.2+y+z/w+2.2+y+z*w\"\n\"2.2+y-z*w+2.2+y-z/w\"\n\"2.2+y-z-w-2.2+y-z-w\"\n\"2.2+y-z/w-2.2+y-z*w\"\n\"2.2+y/z*w-2.2+y/z/w\"\n\"2.2+y/z*w-2.2-y+z/w\"\n\"2.2+y/z+w+2.2+y/z/w\"\n\"2.2-y*z*w+2.2-y*z/w\"\n\"2.2-y*z*w-2.2-y/z/w\"\n\"2.2-y*z-w+2.2*y*z-w\"\n\"2.2-y+z*w*2.2-y+z/w\"\n\"2.2-y+z*w*2.2-y-z/w\"\n\"2.2-y+z+w-2.2-y+z+w\"\n\"2.2-y-z*w+2.2-y*z/w\"\n\"2.2-y-z*w+2.2-y-z/w\"\n\"2.2-y-z+w+2.2-y-z+w\"\n\"2.2-y/z*w*2.2+y*z-w\"\n\"2.2-y/z*w*2.2-y/z/w\"\n\"2.2-y/z-w*2.2*y/z-w\"\n\"2.2/y*z-w-2.2+y/z-w\"\n\"2.2/y+z*w-2.2/y-z*w\"\n\"2.2/y-z/w+2.2/y-z*w\"\n\"2.2/y/z-w+2.2*y+z*w\"\n\"3.3*a^2+2.2*a^1+1.1\"\n\"cos(((cos(b)/b)-b))\"\n\"sin(pi/2)+cos(pi/2)\"\n\"x*3.3*z+w-x/3.3*z+w\"\n\"x*3.3*z-w-x/3.3*z-w\"\n\"x*3.3+z*w*x*3.3-z*w\"\n\"x*3.3+z+w+x/3.3+z+w\"\n\"x*3.3+z-w-x/3.3+z-w\"\n\"x*3.3-z*w-x*3.3+z/w\"\n\"x*3.3-z+w*x/3.3-z+w\"\n\"x*3.3-z-w*x/3.3-z-w\"\n\"x*3.3-z/w*x/3.3+z/w\"\n\"x*3.3/z+w*x/3.3/z+w\"\n\"x*3.3/z-w+x/3.3/z-w\"\n\"x*y*4.4+w-x/y*4.4+w\"\n\"x*y*4.4-w-x/y*4.4-w\"\n\"x*y*z+5.5-x/y*z+5.5\"\n\"x*y*z-5.5-x/y*z-5.5\"\n\"x*y+4.4*w*x*y-4.4*w\"\n\"x*y+4.4+w+x/y+4.4+w\"\n\"x*y+4.4-w-x/y+4.4-w\"\n\"x*y+z*5.5*x*y-z*5.5\"\n\"x*y+z+5.5+x/y+z+5.5\"\n\"x*y+z-5.5-x/y+z-5.5\"\n\"x*y-4.4*w-x*y+4.4/w\"\n\"x*y-4.4+w*x/y-4.4+w\"\n\"x*y-4.4-w*x/y-4.4-w\"\n\"x*y-4.4/w*x/y+4.4/w\"\n\"x*y-z*5.5-x*y+z/5.5\"\n\"x*y-z+5.5*x/y-z+5.5\"\n\"x*y-z-5.5*x/y-z-5.5\"\n\"x*y-z/5.5*x/y+z/5.5\"\n\"x*y/4.4+w*x/y/4.4+w\"\n\"x*y/4.4-w+x/y/4.4-w\"\n\"x*y/z+5.5*x/y/z+5.5\"\n\"x*y/z-5.5+x/y/z-5.5\"\n\"x+3.3*z*w+x+3.3*z/w\"\n\"x+3.3*z/w*x+3.3*z*w\"\n\"x+3.3+z*w-x+3.3+z/w\"\n\"x+3.3+z-w*x+3.3+z-w\"\n\"x+3.3+z/w+x+3.3+z*w\"\n\"x+3.3-z*w+x+3.3-z/w\"\n\"x+3.3-z-w-x+3.3-z-w\"\n\"x+3.3-z/w-x+3.3-z*w\"\n\"x+3.3/z*w-x+3.3/z/w\"\n\"x+3.3/z*w-x-3.3+z/w\"\n\"x+3.3/z+w+x+3.3/z/w\"\n\"x+y*4.4*w+x+y*4.4/w\"\n\"x+y*4.4/w*x+y*4.4*w\"\n\"x+y*z*5.5+x+y*z/5.5\"\n\"x+y*z/5.5*x+y*z*5.5\"\n\"x+y+4.4*w-x+y+4.4/w\"\n\"x+y+4.4-w*x+y+4.4-w\"\n\"x+y+4.4/w+x+y+4.4*w\"\n\"x+y+z*5.5-x+y+z/5.5\"\n\"x+y+z-5.5*x+y+z-5.5\"\n\"x+y+z/5.5+x+y+z*5.5\"\n\"x+y-4.4*w+x+y-4.4/w\"\n\"x+y-4.4-w-x+y-4.4-w\"\n\"x+y-4.4/w-x+y-4.4*w\"\n\"x+y-z*5.5+x+y-z/5.5\"\n\"x+y-z-5.5-x+y-z-5.5\"\n\"x+y-z/5.5-x+y-z*5.5\"\n\"x+y/4.4*w-x+y/4.4/w\"\n\"x+y/4.4*w-x-y+4.4/w\"\n\"x+y/4.4+w+x+y/4.4/w\"\n\"x+y/z*5.5-x+y/z/5.5\"\n\"x+y/z*5.5-x-y+z/5.5\"\n\"x+y/z+5.5+x+y/z/5.5\"\n\"x-3.3*z*w+x-3.3*z/w\"\n\"x-3.3*z*w-x-3.3/z/w\"\n\"x-3.3*z-w+x*3.3*z-w\"\n\"x-3.3+z*w*x-3.3+z/w\"\n\"x-3.3+z*w*x-3.3-z/w\"\n\"x-3.3+z+w-x-3.3+z+w\"\n\"x-3.3-z*w+x-3.3*z/w\"\n\"x-3.3-z*w+x-3.3-z/w\"\n\"x-3.3-z+w+x-3.3-z+w\"\n\"x-3.3/z*w*x+3.3*z-w\"\n\"x-3.3/z*w*x-3.3/z/w\"\n\"x-3.3/z-w*x*3.3/z-w\"\n\"x-y*4.4*w+x-y*4.4/w\"\n\"x-y*4.4*w-x-y/4.4/w\"\n\"x-y*4.4-w+x*y*4.4-w\"\n\"x-y*z*5.5+x-y*z/5.5\"\n\"x-y*z*5.5-x-y/z/5.5\"\n\"x-y*z-5.5+x*y*z-5.5\"\n\"x-y+4.4*w*x-y+4.4/w\"\n\"x-y+4.4*w*x-y-4.4/w\"\n\"x-y+4.4+w-x-y+4.4+w\"\n\"x-y+z*5.5*x-y+z/5.5\"\n\"x-y+z*5.5*x-y-z/5.5\"\n\"x-y+z+5.5-x-y+z+5.5\"\n\"x-y-4.4*w+x-y*4.4/w\"\n\"x-y-4.4*w+x-y-4.4/w\"\n\"x-y-4.4+w+x-y-4.4+w\"\n\"x-y-z*5.5+x-y*z/5.5\"\n\"x-y-z*5.5+x-y-z/5.5\"\n\"x-y-z+5.5+x-y-z+5.5\"\n\"x-y/4.4*w*x+y*4.4-w\"\n\"x-y/4.4*w*x-y/4.4/w\"\n\"x-y/4.4-w*x*y/4.4-w\"\n\"x-y/z*5.5*x+y*z-5.5\"\n\"x-y/z*5.5*x-y/z/5.5\"\n\"x-y/z-5.5*x*y/z-5.5\"\n\"x/3.3*z-w-x+3.3/z-w\"\n\"x/3.3+z*w-x/3.3-z*w\"\n\"x/3.3-z/w+x/3.3-z*w\"\n\"x/3.3/z-w+x*3.3+z*w\"\n\"x/y*4.4-w-x+y/4.4-w\"\n\"x/y*z-5.5-x+y/z-5.5\"\n\"x/y+4.4*w-x/y-4.4*w\"\n\"x/y+z*5.5-x/y-z*5.5\"\n\"x/y-4.4/w+x/y-4.4*w\"\n\"x/y-z/5.5+x/y-z*5.5\"\n\"x/y/4.4-w+x*y+4.4*w\"\n\"x/y/z-5.5+x*y+z*5.5\"\n\"((((b/b)-b)+b)+0.94)\"\n\"(((b+(3.51+b))+b)-e)\"\n\"((b/((a/b)+e))+3.10)\"\n\"(-1+a^2^3)-(a^2^3-1)\"\n\"1-sin(2*a)+cos(pi/b)\"\n\"sin(2.2*a)+cos(pi/b)\"\n\"(((((b/e)+a)+a)-b)+b)\"\n\"((((b-pi)*a)+2.77)+a)\"\n\"((((pi/a)+e)+b)*1.94)\"\n\"(((x*y)*z)-(x/(y*z)))\"\n\"(((x*y)+z)*((x/y)*z))\"\n\"(((x*y)-z)/(x/(y+z)))\"\n\"(((x*y)/z)+(x/(y-z)))\"\n\"(((x+y)*z)-((x*y)/z))\"\n\"(((x+y)+z)/((x/y)+z))\"\n\"(((x+y)-z)*((x*y)*z))\"\n\"(((x+y)/z)+((x*y)-z))\"\n\"(((x-y)*z)-((x/y)/z))\"\n\"(((x-y)/z)+((x/y)-z))\"\n\"(((x/y)*z)-(x*(y*z)))\"\n\"(((x/y)+z)*(x/(y/z)))\"\n\"(((x/y)-z)/(x*(y+z)))\"\n\"(((x/y)/z)+(x*(y-z)))\"\n\"((x*(y*z))+(x+(y/z)))\"\n\"((x*(y+z))*(x-(y*z)))\"\n\"((x*(y-z))/(x+(y*z)))\"\n\"((x*(y/z))-(x+(y+z)))\"\n\"((x+(y*z))*((x+y)+z))\"\n\"((x+(y+z))+((x-y)*z))\"\n\"((x+(y-z))-((x*y)+z))\"\n\"((x+(y/z))/((x-y)/z))\"\n\"((x-(y*z))-((x+y)-z))\"\n\"((x-(y+z))*(x+(y-z)))\"\n\"((x-(y-z))/((x+y)/z))\"\n\"((x-(y/z))+((x+y)*z))\"\n\"((x/(y*z))+(x-(y-z)))\"\n\"((x/(y+z))*(x*(y/z)))\"\n\"((x/(y-z))/(x-(y+z)))\"\n\"((x/(y/z))-(x-(y/z)))\"\n\"(-1*a^2^3)-(a^2^3*-1)\"\n\"(a^2/sin(2*pi/b))-a/2\"\n\"(b+(((2.59+b)*b)+pi))\"\n\"(cos(((e+b)+0.71))-a)\"\n\"(tan(((b/3.21)-a))+e)\"\n\"1.1*a^2.01+2.2*b^3.01\"\n\"1.1-((a*b)+(a/b))-3.3\"\n\"sin(pi/6)+cos(2*pi/6)\"\n\"tan(((b+(a*1.99))*a))\"\n\"(0.1*a+1)*a+1.1-sin(a)\"\n\"1-sin(2.2*a)+cos(pi/b)\"\n\"tan((((pi+2.69)/a)/b))\"\n\"(((((e+a)/e)*b)+pi)*pi)\"\n\"((((3.123*y)*7.123)-w))\"\n\"((((3.123*y)*z)-9.123))\"\n\"((((3.123*y)/7.123)-w))\"\n\"((((3.123*y)/z)-9.123))\"\n\"((((3.123+y)*7.123)-w))\"\n\"((((3.123+y)*z)-9.123))\"\n\"((((3.123+y)/7.123)-w))\"\n\"((((3.123+y)/z)-9.123))\"\n\"((((3.123-y)*7.123)-w))\"\n\"((((3.123-y)*z)-9.123))\"\n\"((((3.123-y)/7.123)-w))\"\n\"((((3.123-y)/z)-9.123))\"\n\"((((3.123/y)*7.123)-w))\"\n\"((((3.123/y)*z)-9.123))\"\n\"((((3.123/y)/7.123)-w))\"\n\"((((3.123/y)/z)-9.123))\"\n\"((((x*3.123)*z)-9.123))\"\n\"((((x*3.123)/z)-9.123))\"\n\"((((x*5.123)*7.123)-w))\"\n\"((((x*5.123)/7.123)-w))\"\n\"((((x+3.123)*z)-9.123))\"\n\"((((x+3.123)/z)-9.123))\"\n\"((((x+5.123)*7.123)-w))\"\n\"((((x+5.123)/7.123)-w))\"\n\"((((x-3.123)*z)-9.123))\"\n\"((((x-3.123)/z)-9.123))\"\n\"((((x-5.123)*7.123)-w))\"\n\"((((x-5.123)/7.123)-w))\"\n\"((((x/3.123)*z)-9.123))\"\n\"((((x/3.123)/z)-9.123))\"\n\"((((x/5.123)*7.123)-w))\"\n\"((((x/5.123)/7.123)-w))\"\n\"(((3.123*y)*(7.123+w)))\"\n\"(((3.123*y)*(7.123-w)))\"\n\"(((3.123*y)*(z+9.123)))\"\n\"(((3.123*y)*(z-9.123)))\"\n\"(((3.123*y)+(7.123*w)))\"\n\"(((3.123*y)+(7.123+w)))\"\n\"(((3.123*y)+(7.123-w)))\"\n\"(((3.123*y)+(7.123/w)))\"\n\"(((3.123*y)+(z*9.123)))\"\n\"(((3.123*y)+(z+9.123)))\"\n\"(((3.123*y)+(z-9.123)))\"\n\"(((3.123*y)+(z/9.123)))\"\n\"(((3.123*y)-(7.123*w)))\"\n\"(((3.123*y)-(7.123+w)))\"\n\"(((3.123*y)-(7.123-w)))\"\n\"(((3.123*y)-(7.123/w)))\"\n\"(((3.123*y)-(z*9.123)))\"\n\"(((3.123*y)-(z+9.123)))\"\n\"(((3.123*y)-(z-9.123)))\"\n\"(((3.123*y)-(z/9.123)))\"\n\"(((3.123*y)/(7.123+w)))\"\n\"(((3.123*y)/(7.123-w)))\"\n\"(((3.123*y)/(z+9.123)))\"\n\"(((3.123*y)/(z-9.123)))\"\n\"(((3.123+y)*(7.123*w)))\"\n\"(((3.123+y)*(7.123-w)))\"\n\"(((3.123+y)*(7.123/w)))\"\n\"(((3.123+y)*(z*9.123)))\"\n\"(((3.123+y)*(z-9.123)))\"\n\"(((3.123+y)*(z/9.123)))\"\n\"(((3.123+y)+(7.123*w)))\"\n\"(((3.123+y)+(7.123-w)))\"\n\"(((3.123+y)+(7.123/w)))\"\n\"(((3.123+y)+(z*9.123)))\"\n\"(((3.123+y)+(z-9.123)))\"\n\"(((3.123+y)+(z/9.123)))\"\n\"(((3.123+y)-(7.123*w)))\"\n\"(((3.123+y)-(7.123-w)))\"\n\"(((3.123+y)-(7.123/w)))\"\n\"(((3.123+y)-(z*9.123)))\"\n\"(((3.123+y)-(z-9.123)))\"\n\"(((3.123+y)-(z/9.123)))\"\n\"(((3.123+y)/(7.123*w)))\"\n\"(((3.123+y)/(7.123-w)))\"\n\"(((3.123+y)/(7.123/w)))\"\n\"(((3.123+y)/(z*9.123)))\"\n\"(((3.123+y)/(z-9.123)))\"\n\"(((3.123+y)/(z/9.123)))\"\n\"(((3.123-y)*(7.123*w)))\"\n\"(((3.123-y)*(7.123+w)))\"\n\"(((3.123-y)*(7.123/w)))\"\n\"(((3.123-y)*(z*9.123)))\"\n\"(((3.123-y)*(z+9.123)))\"\n\"(((3.123-y)*(z/9.123)))\"\n\"(((3.123-y)+(7.123*w)))\"\n\"(((3.123-y)+(7.123+w)))\"\n\"(((3.123-y)+(7.123/w)))\"\n\"(((3.123-y)+(z*9.123)))\"\n\"(((3.123-y)+(z+9.123)))\"\n\"(((3.123-y)+(z/9.123)))\"\n\"(((3.123-y)-(7.123*w)))\"\n\"(((3.123-y)-(7.123+w)))\"\n\"(((3.123-y)-(7.123/w)))\"\n\"(((3.123-y)-(z*9.123)))\"\n\"(((3.123-y)-(z+9.123)))\"\n\"(((3.123-y)-(z/9.123)))\"\n\"(((3.123-y)/(7.123*w)))\"\n\"(((3.123-y)/(7.123+w)))\"\n\"(((3.123-y)/(7.123/w)))\"\n\"(((3.123-y)/(z*9.123)))\"\n\"(((3.123-y)/(z+9.123)))\"\n\"(((3.123-y)/(z/9.123)))\"\n\"(((3.123/y)*(7.123+w)))\"\n\"(((3.123/y)*(7.123-w)))\"\n\"(((3.123/y)*(z+9.123)))\"\n\"(((3.123/y)*(z-9.123)))\"\n\"(((3.123/y)+(7.123+w)))\"\n\"(((3.123/y)+(7.123-w)))\"\n\"(((3.123/y)+(7.123/w)))\"\n\"(((3.123/y)+(z+9.123)))\"\n\"(((3.123/y)+(z-9.123)))\"\n\"(((3.123/y)+(z/9.123)))\"\n\"(((3.123/y)-(7.123*w)))\"\n\"(((3.123/y)-(7.123+w)))\"\n\"(((3.123/y)-(7.123-w)))\"\n\"(((3.123/y)-(7.123/w)))\"\n\"(((3.123/y)-(z*9.123)))\"\n\"(((3.123/y)-(z+9.123)))\"\n\"(((3.123/y)-(z-9.123)))\"\n\"(((3.123/y)-(z/9.123)))\"\n\"(((3.123/y)/(7.123+w)))\"\n\"(((3.123/y)/(7.123-w)))\"\n\"(((3.123/y)/(z+9.123)))\"\n\"(((3.123/y)/(z-9.123)))\"\n\"(((x*3.123)*(z+9.123)))\"\n\"(((x*3.123)*(z-9.123)))\"\n\"(((x*3.123)+(z*9.123)))\"\n\"(((x*3.123)+(z+9.123)))\"\n\"(((x*3.123)+(z-9.123)))\"\n\"(((x*3.123)+(z/9.123)))\"\n\"(((x*3.123)-(z*9.123)))\"\n\"(((x*3.123)-(z+9.123)))\"\n\"(((x*3.123)-(z-9.123)))\"\n\"(((x*3.123)-(z/9.123)))\"\n\"(((x*3.123)/(z+9.123)))\"\n\"(((x*3.123)/(z-9.123)))\"\n\"(((x*5.123)*(7.123+w)))\"\n\"(((x*5.123)*(7.123-w)))\"\n\"(((x*5.123)+(7.123*w)))\"\n\"(((x*5.123)+(7.123+w)))\"\n\"(((x*5.123)+(7.123-w)))\"\n\"(((x*5.123)+(7.123/w)))\"\n\"(((x*5.123)-(7.123*w)))\"\n\"(((x*5.123)-(7.123+w)))\"\n\"(((x*5.123)-(7.123-w)))\"\n\"(((x*5.123)-(7.123/w)))\"\n\"(((x*5.123)/(7.123+w)))\"\n\"(((x*5.123)/(7.123-w)))\"\n\"(((x+3.123)*(z*9.123)))\"\n\"(((x+3.123)*(z-9.123)))\"\n\"(((x+3.123)*(z/9.123)))\"\n\"(((x+3.123)+(z*9.123)))\"\n\"(((x+3.123)+(z-9.123)))\"\n\"(((x+3.123)+(z/9.123)))\"\n\"(((x+3.123)-(z*9.123)))\"\n\"(((x+3.123)-(z-9.123)))\"\n\"(((x+3.123)-(z/9.123)))\"\n\"(((x+3.123)/(z*9.123)))\"\n\"(((x+3.123)/(z-9.123)))\"\n\"(((x+3.123)/(z/9.123)))\"\n\"(((x+5.123)*(7.123*w)))\"\n\"(((x+5.123)*(7.123-w)))\"\n\"(((x+5.123)*(7.123/w)))\"\n\"(((x+5.123)+(7.123*w)))\"\n\"(((x+5.123)+(7.123-w)))\"\n\"(((x+5.123)+(7.123/w)))\"\n\"(((x+5.123)-(7.123*w)))\"\n\"(((x+5.123)-(7.123-w)))\"\n\"(((x+5.123)-(7.123/w)))\"\n\"(((x+5.123)/(7.123*w)))\"\n\"(((x+5.123)/(7.123-w)))\"\n\"(((x+5.123)/(7.123/w)))\"\n\"(((x-3.123)*(z*9.123)))\"\n\"(((x-3.123)*(z+9.123)))\"\n\"(((x-3.123)*(z/9.123)))\"\n\"(((x-3.123)+(z*9.123)))\"\n\"(((x-3.123)+(z+9.123)))\"\n\"(((x-3.123)+(z/9.123)))\"\n\"(((x-3.123)-(z*9.123)))\"\n\"(((x-3.123)-(z+9.123)))\"\n\"(((x-3.123)-(z/9.123)))\"\n\"(((x-3.123)/(z*9.123)))\"\n\"(((x-3.123)/(z+9.123)))\"\n\"(((x-3.123)/(z/9.123)))\"\n\"(((x-5.123)*(7.123*w)))\"\n\"(((x-5.123)*(7.123+w)))\"\n\"(((x-5.123)*(7.123/w)))\"\n\"(((x-5.123)+(7.123*w)))\"\n\"(((x-5.123)+(7.123+w)))\"\n\"(((x-5.123)+(7.123/w)))\"\n\"(((x-5.123)-(7.123*w)))\"\n\"(((x-5.123)-(7.123+w)))\"\n\"(((x-5.123)-(7.123/w)))\"\n\"(((x-5.123)/(7.123*w)))\"\n\"(((x-5.123)/(7.123+w)))\"\n\"(((x-5.123)/(7.123/w)))\"\n\"(((x/3.123)*(z+9.123)))\"\n\"(((x/3.123)*(z-9.123)))\"\n\"(((x/3.123)+(z+9.123)))\"\n\"(((x/3.123)+(z-9.123)))\"\n\"(((x/3.123)+(z/9.123)))\"\n\"(((x/3.123)-(z*9.123)))\"\n\"(((x/3.123)-(z+9.123)))\"\n\"(((x/3.123)-(z-9.123)))\"\n\"(((x/3.123)-(z/9.123)))\"\n\"(((x/3.123)/(z+9.123)))\"\n\"(((x/3.123)/(z-9.123)))\"\n\"(((x/5.123)*(7.123+w)))\"\n\"(((x/5.123)*(7.123-w)))\"\n\"(((x/5.123)+(7.123+w)))\"\n\"(((x/5.123)+(7.123-w)))\"\n\"(((x/5.123)+(7.123/w)))\"\n\"(((x/5.123)-(7.123*w)))\"\n\"(((x/5.123)-(7.123+w)))\"\n\"(((x/5.123)-(7.123-w)))\"\n\"(((x/5.123)-(7.123/w)))\"\n\"(((x/5.123)/(7.123+w)))\"\n\"(((x/5.123)/(7.123-w)))\"\n\"((3.123*(y+(7.123*w))))\"\n\"((3.123*(y+(z*9.123))))\"\n\"((3.123*(y-(7.123*w))))\"\n\"((3.123*(y-(z*9.123))))\"\n\"((3.123*y*z+3.123+y/z))\"\n\"((3.123*y*z-3.123/y*z))\"\n\"((3.123*y+z*3.123-y*z))\"\n\"((3.123*y+z*3.123/y*z))\"\n\"((3.123*y-z/3.123+y*z))\"\n\"((3.123*y-z/3.123/y+z))\"\n\"((3.123*y/z+3.123/y-z))\"\n\"((3.123*y/z-3.123+y+z))\"\n\"((3.123+((y*7.123)*w)))\"\n\"((3.123+((y*7.123)/w)))\"\n\"((3.123+((y*z)*9.123)))\"\n\"((3.123+((y*z)/9.123)))\"\n\"((3.123+((y+7.123)*w)))\"\n\"((3.123+((y+7.123)/w)))\"\n\"((3.123+((y+z)*9.123)))\"\n\"((3.123+((y+z)/9.123)))\"\n\"((3.123+((y-7.123)*w)))\"\n\"((3.123+((y-7.123)/w)))\"\n\"((3.123+((y-z)*9.123)))\"\n\"((3.123+((y-z)/9.123)))\"\n\"((3.123+((y/7.123)*w)))\"\n\"((3.123+((y/7.123)+w)))\"\n\"((3.123+((y/7.123)/w)))\"\n\"((3.123+((y/z)*9.123)))\"\n\"((3.123+((y/z)+9.123)))\"\n\"((3.123+((y/z)/9.123)))\"\n\"((3.123+(y*(7.123/w))))\"\n\"((3.123+(y*(z/9.123))))\"\n\"((3.123+(y/(7.123*w))))\"\n\"((3.123+(y/(z*9.123))))\"\n\"((3.123+y*z*3.123+y+z))\"\n\"((3.123+y*z-3.123*y/z))\"\n\"((3.123+y+z+3.123-y*z))\"\n\"((3.123+y+z/3.123/y+z))\"\n\"((3.123+y-z*3.123*y*z))\"\n\"((3.123+y-z-3.123*y+z))\"\n\"((3.123+y/z+3.123*y-z))\"\n\"((3.123+y/z/3.123-y/z))\"\n\"((3.123-((y*7.123)*w)))\"\n\"((3.123-((y*7.123)/w)))\"\n\"((3.123-((y*z)*9.123)))\"\n\"((3.123-((y*z)/9.123)))\"\n\"((3.123-((y+7.123)*w)))\"\n\"((3.123-((y+7.123)/w)))\"\n\"((3.123-((y+z)*9.123)))\"\n\"((3.123-((y+z)/9.123)))\"\n\"((3.123-((y-7.123)*w)))\"\n\"((3.123-((y-7.123)/w)))\"\n\"((3.123-((y-z)*9.123)))\"\n\"((3.123-((y-z)/9.123)))\"\n\"((3.123-((y/7.123)*w)))\"\n\"((3.123-((y/7.123)/w)))\"\n\"((3.123-((y/z)*9.123)))\"\n\"((3.123-((y/z)/9.123)))\"\n\"((3.123-(y*(7.123/w))))\"\n\"((3.123-(y*(z/9.123))))\"\n\"((3.123-(y/(7.123*w))))\"\n\"((3.123-(y/(z*9.123))))\"\n\"((3.123-y*z-3.123+y-z))\"\n\"((3.123-y*z-3.123/y/z))\"\n\"((3.123-y+z*3.123+y-z))\"\n\"((3.123-y-z/3.123+y/z))\"\n\"((3.123-y/z+3.123+y*z))\"\n\"((3.123-y/z+3.123/y-z))\"\n\"((3.123/(y+(7.123*w))))\"\n\"((3.123/(y+(z*9.123))))\"\n\"((3.123/(y-(7.123*w))))\"\n\"((3.123/(y-(z*9.123))))\"\n\"((3.123/y*z+3.123-y-z))\"\n\"((3.123/y*z-3.123*y*z))\"\n\"((3.123/y+z*3.123*y/z))\"\n\"((3.123/y+z*3.123/y/z))\"\n\"((3.123/y-z/3.123*y+z))\"\n\"((3.123/y-z/3.123-y+z))\"\n\"((3.123/y/z+3.123*y-z))\"\n\"((3.123/y/z-3.123-y/z))\"\n\"((x*(3.123+(z*9.123))))\"\n\"((x*(3.123-(z*9.123))))\"\n\"((x*(5.123+(7.123*w))))\"\n\"((x*(5.123-(7.123*w))))\"\n\"((x*5.123*z+x+5.123/z))\"\n\"((x*5.123*z-x/5.123*z))\"\n\"((x*5.123+z*x-5.123*z))\"\n\"((x*5.123+z*x/5.123*z))\"\n\"((x*5.123-z/x+5.123*z))\"\n\"((x*5.123-z/x/5.123+z))\"\n\"((x*5.123/z+x/5.123-z))\"\n\"((x*5.123/z-x+5.123+z))\"\n\"((x*y*7.123+x+y/7.123))\"\n\"((x*y*7.123-x/y*7.123))\"\n\"((x*y+7.123*x-y*7.123))\"\n\"((x*y+7.123*x/y*7.123))\"\n\"((x*y-7.123/x+y*7.123))\"\n\"((x*y-7.123/x/y+7.123))\"\n\"((x*y/7.123+x/y-7.123))\"\n\"((x*y/7.123-x+y+7.123))\"\n\"((x+((3.123*z)*9.123)))\"\n\"((x+((3.123*z)/9.123)))\"\n\"((x+((3.123+z)*9.123)))\"\n\"((x+((3.123+z)/9.123)))\"\n\"((x+((3.123-z)*9.123)))\"\n\"((x+((3.123-z)/9.123)))\"\n\"((x+((3.123/z)*9.123)))\"\n\"((x+((3.123/z)+9.123)))\"\n\"((x+((3.123/z)/9.123)))\"\n\"((x+(3.123*(z/9.123))))\"\n\"((x+(3.123/(z*9.123))))\"\n\"((x+(5.123*(7.123/w))))\"\n\"((x+(5.123/(7.123*w))))\"\n\"((x+5.123*z*x+5.123+z))\"\n\"((x+5.123*z-x*5.123/z))\"\n\"((x+5.123+z+x-5.123*z))\"\n\"((x+5.123+z/x/5.123+z))\"\n\"((x+5.123-z*x*5.123*z))\"\n\"((x+5.123-z-x*5.123+z))\"\n\"((x+5.123/z+x*5.123-z))\"\n\"((x+5.123/z/x-5.123/z))\"\n\"((x+y*7.123*x+y+7.123))\"\n\"((x+y*7.123-x*y/7.123))\"\n\"((x+y+7.123+x-y*7.123))\"\n\"((x+y+7.123/x/y+7.123))\"\n\"((x+y-7.123*x*y*7.123))\"\n\"((x+y-7.123-x*y+7.123))\"\n\"((x+y/7.123+x*y-7.123))\"\n\"((x+y/7.123/x-y/7.123))\"\n\"((x-((3.123*z)*9.123)))\"\n\"((x-((3.123*z)/9.123)))\"\n\"((x-((3.123+z)*9.123)))\"\n\"((x-((3.123+z)/9.123)))\"\n\"((x-((3.123-z)*9.123)))\"\n\"((x-((3.123-z)/9.123)))\"\n\"((x-((3.123/z)*9.123)))\"\n\"((x-((3.123/z)/9.123)))\"\n\"((x-(3.123*(z/9.123))))\"\n\"((x-(3.123/(z*9.123))))\"\n\"((x-(5.123*(7.123/w))))\"\n\"((x-(5.123/(7.123*w))))\"\n\"((x-5.123*z-x+5.123-z))\"\n\"((x-5.123*z-x/5.123/z))\"\n\"((x-5.123+z*x+5.123-z))\"\n\"((x-5.123-z/x+5.123/z))\"\n\"((x-5.123/z+x+5.123*z))\"\n\"((x-5.123/z+x/5.123-z))\"\n\"((x-y*7.123-x+y-7.123))\"\n\"((x-y*7.123-x/y/7.123))\"\n\"((x-y+7.123*x+y-7.123))\"\n\"((x-y-7.123/x+y/7.123))\"\n\"((x-y/7.123+x+y*7.123))\"\n\"((x-y/7.123+x/y-7.123))\"\n\"((x/(3.123+(z*9.123))))\"\n\"((x/(3.123-(z*9.123))))\"\n\"((x/(5.123+(7.123*w))))\"\n\"((x/(5.123-(7.123*w))))\"\n\"((x/5.123*z+x-5.123-z))\"\n\"((x/5.123*z-x*5.123*z))\"\n\"((x/5.123+z*x*5.123/z))\"\n\"((x/5.123+z*x/5.123/z))\"\n\"((x/5.123-z/x*5.123+z))\"\n\"((x/5.123-z/x-5.123+z))\"\n\"((x/5.123/z+x*5.123-z))\"\n\"((x/5.123/z-x-5.123/z))\"\n\"((x/y*7.123+x-y-7.123))\"\n\"((x/y*7.123-x*y*7.123))\"\n\"((x/y+7.123*x*y/7.123))\"\n\"((x/y+7.123*x/y/7.123))\"\n\"((x/y-7.123/x*y+7.123))\"\n\"((x/y-7.123/x-y+7.123))\"\n\"((x/y/7.123+x*y-7.123))\"\n\"((x/y/7.123-x-y/7.123))\"\n\"(10+sqrt(a))<(sin(8)^2)\"\n\"(a^2.1/3.3)+(b^2.1/3.3)\"\n\"(a^2/sin(2*pi/b))-a/2.2\"\n\"1.1*a^2+2.2*b^3+3.3*c^4\"\n\"1.1*x^2+2.2*1.1/y^3-2.2\"\n\"1.1*x^2+2.2+1.1/y^3-2.2\"\n\"1.1*x^2+2.2-1.1/y^3-2.2\"\n\"tan(((b/cos((a-b)))+e))\"\n\"x*y*z-x*y/z*x-y/z*x-y/z\"\n\"x*y/z-x*y*z*x/y+z*x/y-z\"\n\"x+y/z+x+y*z+x+y-z-x+y+z\"\n\"x-y*z+x+y*z+x+y/z-x+y+z\"\n\"x-y/z*x-y*z-x*y+z+x*y-z\"\n\"x/y*z*x/y/z-x*y+z+x*y-z\"\n\"x/y/z+x/y*z+x/y+z-x/y-z\"\n\"(((((a+a)-1.83)*b)/a)+b)\"\n\"((((0.50-(b-a))-b)*a)+b)\"\n\"((((pi/b)*2.66)*0.31)/pi)\"\n\"((((sin(b)*1.61)/a)/a)*a)\"\n\"(((tan((3.80/b))+b)+a)+e)\"\n\"((1.1+a)/2.2)+(b-(3.3*c))\"\n\"((7.7*(2.2/3.3))-4.4)^2.1\"\n\"((b+(((1.56+pi)*b)-a))+b)\"\n\"((cos(cos(tan(pi)))+a)/a)\"\n\"(cos((((e+e)+3.21)/b))-a)\"\n\"((((((x))))))((((((x))))))\"\n\"(((((b-1.19)+a)+pi)+a)-pi)\"\n\"((sin(sin((b+b)))/1.06)-a)\"\n\"((tan(((3.70*pi)-a))*b)-b)\"\n\"[[[[[[x]]]]]][[[[[[x]]]]]]\"\n\"{{{{{{x}}}}}}{{{{{{x}}}}}}\"\n\"((2/3)-(3/2))*((3/2)-(2/3))\"\n\"((3.123*y*z+w+3.123+y/z/w))\"\n\"((3.123*y*z-w*3.123-y*z/w))\"\n\"((3.123*y*z-w/3.123+y+z*w))\"\n\"((3.123*y+z*w*3.123/y-z+w))\"\n\"((3.123*y+z*w-3.123+y-z-w))\"\n\"((3.123*y+z+w*3.123/y/z-w))\"\n\"((3.123*y+z-w+3.123/y*z-w))\"\n\"((3.123*y+z/w/3.123+y*z-w))\"\n\"((3.123*y-z*w*3.123+y+z-w))\"\n\"((3.123*y-z*w/3.123*y+z+w))\"\n\"((3.123*y-z+w+3.123/y/z+w))\"\n\"((3.123*y-z-w*3.123-y*z/w))\"\n\"((3.123*y-z/w+3.123+y/z-w))\"\n\"((3.123*y/z+w*3.123-y+z/w))\"\n\"((3.123*y/z-w+3.123-y-z/w))\"\n\"((3.123*y/z-w/3.123-y-z*w))\"\n\"((3.123+y*z*w+3.123-y/z*w))\"\n\"((3.123+y*z*w-3.123/y/z-w))\"\n\"((3.123+y*z-w*3.123-y/z/w))\"\n\"((3.123+y*z-w-3.123+y-z*w))\"\n\"((3.123+y*z/w+3.123*y/z-w))\"\n\"((3.123+y*z/w+3.123-y/z/w))\"\n\"((3.123+y*z/w-3.123+y+z/w))\"\n\"((3.123+y+z*w*3.123/y+z-w))\"\n\"((3.123+y+z*w-3.123/y*z-w))\"\n\"((3.123+y+z-w-3.123-y/z*w))\"\n\"((3.123+y+z/w+3.123*y*z-w))\"\n\"((3.123+y+z/w/3.123*y-z-w))\"\n\"((3.123+y-z*w+3.123/y+z+w))\"\n\"((3.123+y-z*w/3.123-y/z-w))\"\n\"((3.123+y-z-w+3.123+y/z/w))\"\n\"((3.123+y-z/w*3.123+y/z-w))\"\n\"((3.123+y-z/w-3.123*y+z-w))\"\n\"((3.123+y/z*w*3.123+y*z-w))\"\n\"((3.123+y/z*w*3.123+y+z*w))\"\n\"((3.123+y/z*w+3.123*y+z/w))\"\n\"((3.123+y/z+w*3.123*y+z*w))\"\n\"((3.123+y/z-w-3.123-y+z*w))\"\n\"((3.123+y/z-w/3.123-y*z*w))\"\n\"((3.123+y/z/w/3.123*y-z*w))\"\n\"((3.123+y/z/w/3.123+y-z/w))\"\n\"((3.123-y*z*w*3.123+y*z*w))\"\n\"((3.123-y*z*w*3.123/y-z*w))\"\n\"((3.123-y*z+w*3.123/y*z+w))\"\n\"((3.123-y*z-w*3.123+y-z/w))\"\n\"((3.123-y*z/w-3.123-y/z*w))\"\n\"((3.123-y*z/w-3.123/y+z*w))\"\n\"((3.123-y*z/w/3.123+y/z+w))\"\n\"((3.123-y+z*w*3.123/y+z/w))\"\n\"((3.123-y+z*w+3.123/y-z-w))\"\n\"((3.123-y+z+w-3.123*y*z+w))\"\n\"((3.123-y+z/w-3.123*y-z/w))\"\n\"((3.123-y+z/w-3.123+y*z*w))\"\n\"((3.123-y-z*w*3.123+y*z/w))\"\n\"((3.123-y-z*w+3.123/y-z*w))\"\n\"((3.123-y-z+w+3.123-y*z/w))\"\n\"((3.123-y-z/w/3.123+y/z*w))\"\n\"((3.123-y-z/w/3.123/y-z/w))\"\n\"((3.123-y/z*w+3.123*y-z*w))\"\n\"((3.123-y/z*w+3.123+y-z*w))\"\n\"((3.123-y/z*w/3.123-y*z-w))\"\n\"((3.123-y/z+w/3.123*y/z+w))\"\n\"((3.123-y/z-w*3.123-y+z/w))\"\n\"((3.123-y/z/w-3.123+y*z/w))\"\n\"((3.123-y/z/w/3.123*y+z*w))\"\n\"((3.123/y*z+w-3.123+y/z*w))\"\n\"((3.123/y*z-w+3.123+y+z/w))\"\n\"((3.123/y*z-w/3.123-y*z*w))\"\n\"((3.123/y+z*w+3.123-y/z+w))\"\n\"((3.123/y+z+w/3.123*y*z-w))\"\n\"((3.123/y+z-w-3.123+y*z/w))\"\n\"((3.123/y+z/w-3.123-y-z+w))\"\n\"((3.123/y-z*w-3.123*y-z+w))\"\n\"((3.123/y-z*w/3.123-y*z+w))\"\n\"((3.123/y-z+w-3.123*y/z-w))\"\n\"((3.123/y-z-w/3.123+y/z*w))\"\n\"((3.123/y-z/w*3.123-y+z+w))\"\n\"((3.123/y/z+w/3.123-y+z*w))\"\n\"((3.123/y/z-w+3.123-y-z/w))\"\n\"((3.123/y/z-w-3.123-y-z*w))\"\n\"((cos(((1.12+b)+pi))+pi)+b)\"\n\"((x*5.123*z+w+x+5.123/z/w))\"\n\"((x*5.123*z-w*x-5.123*z/w))\"\n\"((x*5.123*z-w/x+5.123+z*w))\"\n\"((x*5.123+z*w*x/5.123-z+w))\"\n\"((x*5.123+z*w-x+5.123-z-w))\"\n\"((x*5.123+z+w*x/5.123/z-w))\"\n\"((x*5.123+z-w+x/5.123*z-w))\"\n\"((x*5.123+z/w/x+5.123*z-w))\"\n\"((x*5.123-z*w*x+5.123+z-w))\"\n\"((x*5.123-z*w/x*5.123+z+w))\"\n\"((x*5.123-z+w+x/5.123/z+w))\"\n\"((x*5.123-z-w*x-5.123*z/w))\"\n\"((x*5.123-z/w+x+5.123/z-w))\"\n\"((x*5.123/z+w*x-5.123+z/w))\"\n\"((x*5.123/z-w+x-5.123-z/w))\"\n\"((x*5.123/z-w/x-5.123-z*w))\"\n\"((x*y*7.123+w+x+y/7.123/w))\"\n\"((x*y*7.123-w*x-y*7.123/w))\"\n\"((x*y*7.123-w/x+y+7.123*w))\"\n\"((x*y*z+9.123+x+y/z/9.123))\"\n\"((x*y*z+x+y/z+x+y+z+x-y*z))\"\n\"((x*y*z-9.123*x-y*z/9.123))\"\n\"((x*y*z-9.123/x+y+z*9.123))\"\n\"((x*y*z-x/y*z-x/y/z-x-y/z))\"\n\"((x*y+7.123*w*x/y-7.123+w))\"\n\"((x*y+7.123*w-x+y-7.123-w))\"\n\"((x*y+7.123+w*x/y/7.123-w))\"\n\"((x*y+7.123-w+x/y*7.123-w))\"\n\"((x*y+7.123/w/x+y*7.123-w))\"\n\"((x*y+z*9.123*x/y-z+9.123))\"\n\"((x*y+z*9.123-x+y-z-9.123))\"\n\"((x*y+z*x-y*z*x+y*z*x+y+z))\"\n\"((x*y+z*x/y*z*x/y+z*x*y/z))\"\n\"((x*y+z+9.123*x/y/z-9.123))\"\n\"((x*y+z-9.123+x/y*z-9.123))\"\n\"((x*y+z/9.123/x+y*z-9.123))\"\n\"((x*y-7.123*w*x+y+7.123-w))\"\n\"((x*y-7.123*w/x*y+7.123+w))\"\n\"((x*y-7.123+w+x/y/7.123+w))\"\n\"((x*y-7.123-w*x-y*7.123/w))\"\n\"((x*y-7.123/w+x+y/7.123-w))\"\n\"((x*y-z*9.123*x+y+z-9.123))\"\n\"((x*y-z*9.123/x*y+z+9.123))\"\n\"((x*y-z+9.123+x/y/z+9.123))\"\n\"((x*y-z-9.123*x-y*z/9.123))\"\n\"((x*y-z/9.123+x+y/z-9.123))\"\n\"((x*y-z/x+y*z/x+y/z/x-y/z))\"\n\"((x*y-z/x/y+z/x/y-z/x-y+z))\"\n\"((x*y/7.123+w*x-y+7.123/w))\"\n\"((x*y/7.123-w+x-y-7.123/w))\"\n\"((x*y/7.123-w/x-y-7.123*w))\"\n\"((x*y/z+9.123*x-y+z/9.123))\"\n\"((x*y/z+x/y-z+x/y*z+x-y-z))\"\n\"((x*y/z-9.123+x-y-z/9.123))\"\n\"((x*y/z-9.123/x-y-z*9.123))\"\n\"((x*y/z-x+y+z-x+y-z-x*y+z))\"\n\"((x+5.123*z*w+x-5.123/z*w))\"\n\"((x+5.123*z*w-x/5.123/z-w))\"\n\"((x+5.123*z-w*x-5.123/z/w))\"\n\"((x+5.123*z-w-x+5.123-z*w))\"\n\"((x+5.123*z/w+x*5.123/z-w))\"\n\"((x+5.123*z/w+x-5.123/z/w))\"\n\"((x+5.123*z/w-x+5.123+z/w))\"\n\"((x+5.123+z*w*x/5.123+z-w))\"\n\"((x+5.123+z*w-x/5.123*z-w))\"\n\"((x+5.123+z-w-x-5.123/z*w))\"\n\"((x+5.123+z/w+x*5.123*z-w))\"\n\"((x+5.123+z/w/x*5.123-z-w))\"\n\"((x+5.123-z*w+x/5.123+z+w))\"\n\"((x+5.123-z*w/x-5.123/z-w))\"\n\"((x+5.123-z-w+x+5.123/z/w))\"\n\"((x+5.123-z/w*x+5.123/z-w))\"\n\"((x+5.123-z/w-x*5.123+z-w))\"\n\"((x+5.123/z*w*x+5.123*z-w))\"\n\"((x+5.123/z*w*x+5.123+z*w))\"\n\"((x+5.123/z*w+x*5.123+z/w))\"\n\"((x+5.123/z+w*x*5.123+z*w))\"\n\"((x+5.123/z-w-x-5.123+z*w))\"\n\"((x+5.123/z-w/x-5.123*z*w))\"\n\"((x+5.123/z/w/x*5.123-z*w))\"\n\"((x+5.123/z/w/x+5.123-z/w))\"\n\"((x+y*7.123*w+x-y/7.123*w))\"\n\"((x+y*7.123*w-x/y/7.123-w))\"\n\"((x+y*7.123-w*x-y/7.123/w))\"\n\"((x+y*7.123-w-x+y-7.123*w))\"\n\"((x+y*7.123/w+x*y/7.123-w))\"\n\"((x+y*7.123/w+x-y/7.123/w))\"\n\"((x+y*7.123/w-x+y+7.123/w))\"\n\"((x+y*z*9.123+x-y/z*9.123))\"\n\"((x+y*z*9.123-x/y/z-9.123))\"\n\"((x+y*z*x+y+z*x-y/z+x/y-z))\"\n\"((x+y*z-9.123*x-y/z/9.123))\"\n\"((x+y*z-9.123-x+y-z*9.123))\"\n\"((x+y*z-x*y/z-x*y*z-x/y*z))\"\n\"((x+y*z/9.123+x*y/z-9.123))\"\n\"((x+y*z/9.123+x-y/z/9.123))\"\n\"((x+y*z/9.123-x+y+z/9.123))\"\n\"((x+y+7.123*w*x/y+7.123-w))\"\n\"((x+y+7.123*w-x/y*7.123-w))\"\n\"((x+y+7.123-w-x-y/7.123*w))\"\n\"((x+y+7.123/w+x*y*7.123-w))\"\n\"((x+y+7.123/w/x*y-7.123-w))\"\n\"((x+y+z*9.123*x/y+z-9.123))\"\n\"((x+y+z*9.123-x/y*z-9.123))\"\n\"((x+y+z+x-y*z+x*y+z*x/y*z))\"\n\"((x+y+z-9.123-x-y/z*9.123))\"\n\"((x+y+z/9.123+x*y*z-9.123))\"\n\"((x+y+z/9.123/x*y-z-9.123))\"\n\"((x+y+z/x/y+z/x/y-z/x*y+z))\"\n\"((x+y-7.123*w+x/y+7.123+w))\"\n\"((x+y-7.123*w/x-y/7.123-w))\"\n\"((x+y-7.123-w+x+y/7.123/w))\"\n\"((x+y-7.123/w*x+y/7.123-w))\"\n\"((x+y-7.123/w-x*y+7.123-w))\"\n\"((x+y-z*9.123+x/y+z+9.123))\"\n\"((x+y-z*9.123/x-y/z-9.123))\"\n\"((x+y-z*x*y*z*x/y+z*x/y/z))\"\n\"((x+y-z-9.123+x+y/z/9.123))\"\n\"((x+y-z-x*y+z-x*y-z/x/y+z))\"\n\"((x+y-z/9.123*x+y/z-9.123))\"\n\"((x+y-z/9.123-x*y+z-9.123))\"\n\"((x+y/7.123*w*x+y*7.123-w))\"\n\"((x+y/7.123*w*x+y+7.123*w))\"\n\"((x+y/7.123*w+x*y+7.123/w))\"\n\"((x+y/7.123+w*x*y+7.123*w))\"\n\"((x+y/7.123-w-x-y+7.123*w))\"\n\"((x+y/7.123-w/x-y*7.123*w))\"\n\"((x+y/7.123/w/x*y-7.123*w))\"\n\"((x+y/7.123/w/x+y-7.123/w))\"\n\"((x+y/z*9.123*x+y*z-9.123))\"\n\"((x+y/z*9.123*x+y+z*9.123))\"\n\"((x+y/z*9.123+x*y+z/9.123))\"\n\"((x+y/z+9.123*x*y+z*9.123))\"\n\"((x+y/z+x*y-z+x*y/z+x/y-z))\"\n\"((x+y/z-9.123-x-y+z*9.123))\"\n\"((x+y/z-9.123/x-y*z*9.123))\"\n\"((x+y/z/9.123/x*y-z*9.123))\"\n\"((x+y/z/9.123/x+y-z/9.123))\"\n\"((x+y/z/x-y/z/x-y*z-x/y/z))\"\n\"((x-5.123*z*w*x+5.123*z*w))\"\n\"((x-5.123*z*w*x/5.123-z*w))\"\n\"((x-5.123*z+w*x/5.123*z+w))\"\n\"((x-5.123*z-w*x+5.123-z/w))\"\n\"((x-5.123*z/w-x-5.123/z*w))\"\n\"((x-5.123*z/w-x/5.123+z*w))\"\n\"((x-5.123*z/w/x+5.123/z+w))\"\n\"((x-5.123+z*w*x/5.123+z/w))\"\n\"((x-5.123+z*w+x/5.123-z-w))\"\n\"((x-5.123+z+w-x*5.123*z+w))\"\n\"((x-5.123+z/w-x*5.123-z/w))\"\n\"((x-5.123+z/w-x+5.123*z*w))\"\n\"((x-5.123-z*w*x+5.123*z/w))\"\n\"((x-5.123-z*w+x/5.123-z*w))\"\n\"((x-5.123-z+w+x-5.123*z/w))\"\n\"((x-5.123-z/w/x+5.123/z*w))\"\n\"((x-5.123-z/w/x/5.123-z/w))\"\n\"((x-5.123/z*w+x*5.123-z*w))\"\n\"((x-5.123/z*w+x+5.123-z*w))\"\n\"((x-5.123/z*w/x-5.123*z-w))\"\n\"((x-5.123/z+w/x*5.123/z+w))\"\n\"((x-5.123/z-w*x-5.123+z/w))\"\n\"((x-5.123/z/w-x+5.123*z/w))\"\n\"((x-5.123/z/w/x*5.123+z*w))\"\n\"((x-y*7.123*w*x+y*7.123*w))\"\n\"((x-y*7.123*w*x/y-7.123*w))\"\n\"((x-y*7.123+w*x/y*7.123+w))\"\n\"((x-y*7.123-w*x+y-7.123/w))\"\n\"((x-y*7.123/w-x-y/7.123*w))\"\n\"((x-y*7.123/w-x/y+7.123*w))\"\n\"((x-y*7.123/w/x+y/7.123+w))\"\n\"((x-y*z*9.123*x+y*z*9.123))\"\n\"((x-y*z*9.123*x/y-z*9.123))\"\n\"((x-y*z+9.123*x/y*z+9.123))\"\n\"((x-y*z-9.123*x+y-z/9.123))\"\n\"((x-y*z-x+y-z-x+y+z/x/y+z))\"\n\"((x-y*z-x/y/z-x/y*z-x*y*z))\"\n\"((x-y*z/9.123-x-y/z*9.123))\"\n\"((x-y*z/9.123-x/y+z*9.123))\"\n\"((x-y*z/9.123/x+y/z+9.123))\"\n\"((x-y+7.123*w*x/y+7.123/w))\"\n\"((x-y+7.123*w+x/y-7.123-w))\"\n\"((x-y+7.123+w-x*y*7.123+w))\"\n\"((x-y+7.123/w-x*y-7.123/w))\"\n\"((x-y+7.123/w-x+y*7.123*w))\"\n\"((x-y+z*9.123*x/y+z/9.123))\"\n\"((x-y+z*9.123+x/y-z-9.123))\"\n\"((x-y+z*x+y-z*x+y/z+x*y-z))\"\n\"((x-y+z+9.123-x*y*z+9.123))\"\n\"((x-y+z/9.123-x*y-z/9.123))\"\n\"((x-y+z/9.123-x+y*z*9.123))\"\n\"((x-y-7.123*w*x+y*7.123/w))\"\n\"((x-y-7.123*w+x/y-7.123*w))\"\n\"((x-y-7.123+w+x-y*7.123/w))\"\n\"((x-y-7.123/w/x+y/7.123*w))\"\n\"((x-y-7.123/w/x/y-7.123/w))\"\n\"((x-y-z*9.123*x+y*z/9.123))\"\n\"((x-y-z*9.123+x/y-z*9.123))\"\n\"((x-y-z+9.123+x-y*z/9.123))\"\n\"((x-y-z/9.123/x+y/z*9.123))\"\n\"((x-y-z/9.123/x/y-z/9.123))\"\n\"((x-y-z/x+y/z/x+y*z-x*y/z))\"\n\"((x-y/7.123*w+x*y-7.123*w))\"\n\"((x-y/7.123*w+x+y-7.123*w))\"\n\"((x-y/7.123*w/x-y*7.123-w))\"\n\"((x-y/7.123+w/x*y/7.123+w))\"\n\"((x-y/7.123-w*x-y+7.123/w))\"\n\"((x-y/7.123/w-x+y*7.123/w))\"\n\"((x-y/7.123/w/x*y+7.123*w))\"\n\"((x-y/z*9.123+x*y-z*9.123))\"\n\"((x-y/z*9.123+x+y-z*9.123))\"\n\"((x-y/z*9.123/x-y*z-9.123))\"\n\"((x-y/z+9.123/x*y/z+9.123))\"\n\"((x-y/z+x+y*z+x+y-z*x*y*z))\"\n\"((x-y/z+x/y-z+x/y/z+x*y-z))\"\n\"((x-y/z-9.123*x-y+z/9.123))\"\n\"((x-y/z/9.123-x+y*z/9.123))\"\n\"((x-y/z/9.123/x*y+z*9.123))\"\n\"((x/5.123*z+w-x+5.123/z*w))\"\n\"((x/5.123*z-w+x+5.123+z/w))\"\n\"((x/5.123*z-w/x-5.123*z*w))\"\n\"((x/5.123+z*w+x-5.123/z+w))\"\n\"((x/5.123+z+w/x*5.123*z-w))\"\n\"((x/5.123+z-w-x+5.123*z/w))\"\n\"((x/5.123+z/w-x-5.123-z+w))\"\n\"((x/5.123-z*w-x*5.123-z+w))\"\n\"((x/5.123-z*w/x-5.123*z+w))\"\n\"((x/5.123-z+w-x*5.123/z-w))\"\n\"((x/5.123-z-w/x+5.123/z*w))\"\n\"((x/5.123-z/w*x-5.123+z+w))\"\n\"((x/5.123/z+w/x-5.123+z*w))\"\n\"((x/5.123/z-w+x-5.123-z/w))\"\n\"((x/5.123/z-w-x-5.123-z*w))\"\n\"((x/y*7.123+w-x+y/7.123*w))\"\n\"((x/y*7.123-w+x+y+7.123/w))\"\n\"((x/y*7.123-w/x-y*7.123*w))\"\n\"((x/y*z+9.123-x+y/z*9.123))\"\n\"((x/y*z+x-y-z+x-y/z+x+y*z))\"\n\"((x/y*z-9.123+x+y+z/9.123))\"\n\"((x/y*z-9.123/x-y*z*9.123))\"\n\"((x/y*z-x*y*z-x*y/z-x+y+z))\"\n\"((x/y+7.123*w+x-y/7.123+w))\"\n\"((x/y+7.123+w/x*y*7.123-w))\"\n\"((x/y+7.123-w-x+y*7.123/w))\"\n\"((x/y+7.123/w-x-y-7.123+w))\"\n\"((x/y+z*9.123+x-y/z+9.123))\"\n\"((x/y+z*x*y/z*x-y+z*x+y-z))\"\n\"((x/y+z*x/y/z*x*y+z*x-y*z))\"\n\"((x/y+z+9.123/x*y*z-9.123))\"\n\"((x/y+z-9.123-x+y*z/9.123))\"\n\"((x/y+z/9.123-x-y-z+9.123))\"\n\"((x/y-7.123*w-x*y-7.123+w))\"\n\"((x/y-7.123*w/x-y*7.123+w))\"\n\"((x/y-7.123+w-x*y/7.123-w))\"\n\"((x/y-7.123-w/x+y/7.123*w))\"\n\"((x/y-7.123/w*x-y+7.123+w))\"\n\"((x/y-z*9.123-x*y-z+9.123))\"\n\"((x/y-z*9.123/x-y*z+9.123))\"\n\"((x/y-z+9.123-x*y/z-9.123))\"\n\"((x/y-z-9.123/x+y/z*9.123))\"\n\"((x/y-z/9.123*x-y+z+9.123))\"\n\"((x/y-z/x*y+z/x*y-z/x+y*z))\"\n\"((x/y-z/x-y+z/x-y-z/x+y/z))\"\n\"((x/y/7.123+w/x-y+7.123*w))\"\n\"((x/y/7.123-w+x-y-7.123/w))\"\n\"((x/y/7.123-w-x-y-7.123*w))\"\n\"((x/y/z+9.123/x-y+z*9.123))\"\n\"((x/y/z+x*y-z+x*y*z+x+y/z))\"\n\"((x/y/z-9.123+x-y-z/9.123))\"\n\"((x/y/z-9.123-x-y-z*9.123))\"\n\"((x/y/z-x-y/z-x-y*z-x+y-z))\"\n\"(abs((x-y)/z)*exp((x-y)*z))\"\n\"(abs((x/y)+z)*exp((x/y)-z))\"\n\"(abs(x-(y/z))*exp(x-(y/z)))\"\n\"(abs(x/(y*z))*exp(x/(y/z)))\"\n\"(sin((x*y)+z)+cos((x*y)-z))\"\n\"(sin((x+y)/z)+cos((x+y)*z))\"\n\"(sin((x/y)/z)+cos((x/y)*z))\"\n\"(sin(x*(y+z))+cos(x*(y-z)))\"\n\"(sin(x-(y*z))+cos(x+(y*z)))\"\n\"4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"abs(sin(sqrt(a*a+b*b))*255)\"\n\"abs(sin(sqrt(a^2+b^2))*255)\"\n\"(((b*(((0.91/b)+b)+a))*b)/b)\"\n\"(1.123*cos(a)-3.1235)/3.1238\"\n\"(1.123*sin(a)+2.1234)/3.1237\"\n\"(1.123*tan(a)+2.1236)/3.1239\"\n\"sin((1+2/2*3)*4^5)+cos(6*pi)\"\n\"sqrt(1-sin(2*a)+cos(pi/b)/3)\"\n\"(((((pi-2.92)/a)/pi)+3.68)*b)\"\n\"((((x*y)*z)-w)/((x+y)+(z*w)))\"\n\"((((x*y)/z)-w)/((x-y)-(z*w)))\"\n\"((((x+y)*z)-w)-((x+y)-(z*w)))\"\n\"((((x+y)/z)-w)-((x-y)+(z*w)))\"\n\"((((x-y)*z)-w)*((x+y)-(z/w)))\"\n\"((((x-y)/z)-w)*((x-y)+(z/w)))\"\n\"((((x/y)*z)-w)+((x+y)+(z/w)))\"\n\"((((x/y)/z)-w)+((x-y)-(z/w)))\"\n\"(((3.123*y)*z)-(3.123/(y*z)))\"\n\"(((3.123*y)+z)*((3.123/y)*z))\"\n\"(((3.123*y)-z)/(3.123/(y+z)))\"\n\"(((3.123*y)/z)+(3.123/(y-z)))\"\n\"(((3.123+y)*z)-((3.123*y)/z))\"\n\"(((3.123+y)+z)/((3.123/y)+z))\"\n\"(((3.123+y)-z)*((3.123*y)*z))\"\n\"(((3.123+y)/z)+((3.123*y)-z))\"\n\"(((3.123-y)*z)-((3.123/y)/z))\"\n\"(((3.123-y)/z)+((3.123/y)-z))\"\n\"(((3.123/y)*z)-(3.123*(y*z)))\"\n\"(((3.123/y)+z)*(3.123/(y/z)))\"\n\"(((3.123/y)-z)/(3.123*(y+z)))\"\n\"(((3.123/y)/z)+(3.123*(y-z)))\"\n\"(((x*5.123)*z)-(x/(5.123*z)))\"\n\"(((x*5.123)+z)*((x/5.123)*z))\"\n\"(((x*5.123)-z)/(x/(5.123+z)))\"\n\"(((x*5.123)/z)+(x/(5.123-z)))\"\n\"(((x*y)*(z+w))+(x+((y/z)/w)))\"\n\"(((x*y)*(z-w))*(x-((y*z)/w)))\"\n\"(((x*y)*7.123)-(x/(y*7.123)))\"\n\"(((x*y)+(z*w))-((x+y)-(z-w)))\"\n\"(((x*y)+(z+w))*((x/y)/(z-w)))\"\n\"(((x*y)+(z-w))+((x/y)*(z-w)))\"\n\"(((x*y)+(z/w))/((x+y)*(z-w)))\"\n\"(((x*y)+7.123)*((x/y)*7.123))\"\n\"(((x*y)-(z*w))*((x+y)+(z-w)))\"\n\"(((x*y)-(z+w))+((x/y)/(z+w)))\"\n\"(((x*y)-(z-w))*(x-(y*(z/w))))\"\n\"(((x*y)-(z/w))+((x+y)/(z-w)))\"\n\"(((x*y)-7.123)/(x/(y+7.123)))\"\n\"(((x*y)/(z+w))*(x-((y+z)/w)))\"\n\"(((x*y)/(z-w))+(x-((y-z)/w)))\"\n\"(((x*y)/7.123)+(x/(y-7.123)))\"\n\"(((x+5.123)*z)-((x*5.123)/z))\"\n\"(((x+5.123)+z)/((x/5.123)+z))\"\n\"(((x+5.123)-z)*((x*5.123)*z))\"\n\"(((x+5.123)/z)+((x*5.123)-z))\"\n\"(((x+y)*(z*w))+(x-(y/(z*w))))\"\n\"(((x+y)*(z-w))*((x-y)/(z/w)))\"\n\"(((x+y)*(z/w))-(x+((y+z)/w)))\"\n\"(((x+y)*7.123)-((x*y)/7.123))\"\n\"(((x+y)+(z*w))*((x/y)+(z-w)))\"\n\"(((x+y)+(z-w))-((x-y)/(z*w)))\"\n\"(((x+y)+(z/w))/((x*y)-(z-w)))\"\n\"(((x+y)+7.123)/((x/y)+7.123))\"\n\"(((x+y)-(z*w))+((x/y)+(z+w)))\"\n\"(((x+y)-(z-w))+((x+y)/(z/w)))\"\n\"(((x+y)-(z/w))-((x*y)+(z-w)))\"\n\"(((x+y)-7.123)*((x*y)*7.123))\"\n\"(((x+y)/(z*w))*(x+((y+z)*w)))\"\n\"(((x+y)/(z-w))/((x-y)*(z*w)))\"\n\"(((x+y)/(z/w))/(x+((y-z)/w)))\"\n\"(((x+y)/7.123)+((x*y)-7.123))\"\n\"(((x-5.123)*z)-((x/5.123)/z))\"\n\"(((x-5.123)/z)+((x/5.123)-z))\"\n\"(((x-y)*(z*w))*(x+((y*z)*w)))\"\n\"(((x-y)*(z+w))*((x/y)*(z+w)))\"\n\"(((x-y)*(z/w))/(x+((y/z)+w)))\"\n\"(((x-y)*7.123)-((x/y)/7.123))\"\n\"(((x-y)+(z*w))+((x/y)-(z-w)))\"\n\"(((x-y)+(z+w))-((x*y)*(z+w)))\"\n\"(((x-y)+(z/w))-((x+y)*(z*w)))\"\n\"(((x-y)-(z*w))*((x+y)*(z/w)))\"\n\"(((x-y)-(z+w))+((x-y)*(z/w)))\"\n\"(((x-y)-(z/w))/((x+y)/(z*w)))\"\n\"(((x-y)/(z*w))+(x+((y-z)*w)))\"\n\"(((x-y)/(z+w))/((x*y)/(z+w)))\"\n\"(((x-y)/(z/w))-(x+((y*z)/w)))\"\n\"(((x-y)/7.123)+((x/y)-7.123))\"\n\"(((x/5.123)*z)-(x*(5.123*z)))\"\n\"(((x/5.123)+z)*(x/(5.123/z)))\"\n\"(((x/5.123)-z)/(x*(5.123+z)))\"\n\"(((x/5.123)/z)+(x*(5.123-z)))\"\n\"(((x/y)*(z+w))-(x+((y/z)*w)))\"\n\"(((x/y)*(z-w))/(x-((y*z)*w)))\"\n\"(((x/y)*7.123)-(x*(y*7.123)))\"\n\"(((x/y)+(z+w))/((x*y)*(z-w)))\"\n\"(((x/y)+(z-w))-(x+(y*(z/w))))\"\n\"(((x/y)+(z/w))-((x-y)-(z+w)))\"\n\"(((x/y)+7.123)*(x/(y/7.123)))\"\n\"(((x/y)-(z*w))/((x-y)*(z+w)))\"\n\"(((x/y)-(z+w))-((x*y)/(z-w)))\"\n\"(((x/y)-(z-w))/(x+(y/(z*w))))\"\n\"(((x/y)-(z/w))*((x-y)+(z+w)))\"\n\"(((x/y)-7.123)/(x*(y+7.123)))\"\n\"(((x/y)/(z+w))/(x-((y+z)*w)))\"\n\"(((x/y)/(z-w))-(x-((y-z)*w)))\"\n\"(((x/y)/7.123)+(x*(y-7.123)))\"\n\"((1.1*x^2+2.2)*(1.1/y^3-2.2))\"\n\"((1.1*x^2+2.2)+(1.1/y^3-2.2))\"\n\"((1.1*x^2+2.2)-(1.1/y^3-2.2))\"\n\"((3.123*(y*z))+(3.123+(y/z)))\"\n\"((3.123*(y+z))*(3.123-(y*z)))\"\n\"((3.123*(y-z))/(3.123+(y*z)))\"\n\"((3.123*(y/z))-(3.123+(y+z)))\"\n\"((3.123+(y*z))*((3.123+y)+z))\"\n\"((3.123+(y+z))+((3.123-y)*z))\"\n\"((3.123+(y-z))-((3.123*y)+z))\"\n\"((3.123+(y/z))/((3.123-y)/z))\"\n\"((3.123-(y*z))-((3.123+y)-z))\"\n\"((3.123-(y+z))*(3.123+(y-z)))\"\n\"((3.123-(y-z))/((3.123+y)/z))\"\n\"((3.123-(y/z))+((3.123+y)*z))\"\n\"((3.123/(y*z))+(3.123-(y-z)))\"\n\"((3.123/(y+z))*(3.123*(y/z)))\"\n\"((3.123/(y-z))/(3.123-(y+z)))\"\n\"((3.123/(y/z))-(3.123-(y/z)))\"\n\"((x*(5.123*z))+(x+(5.123/z)))\"\n\"((x*(5.123+z))*(x-(5.123*z)))\"\n\"((x*(5.123-z))/(x+(5.123*z)))\"\n\"((x*(5.123/z))-(x+(5.123+z)))\"\n\"((x*(y*7.123))+(x+(y/7.123)))\"\n\"((x*(y+(z*w)))*((x/y)-(z+w)))\"\n\"((x*(y+7.123))*(x-(y*7.123)))\"\n\"((x*(y-(z*w)))/((x*y)+(z+w)))\"\n\"((x*(y-7.123))/(x+(y*7.123)))\"\n\"((x*(y/7.123))-(x+(y+7.123)))\"\n\"((x+((y*z)*w))-(((x/y)/z)-w))\"\n\"((x+((y*z)/w))+(((x*y)/z)-w))\"\n\"((x+((y+z)*w))-(((x/y)*z)-w))\"\n\"((x+((y+z)/w))+(((x*y)*z)-w))\"\n\"((x+((y-z)*w))/(((x-y)/z)-w))\"\n\"((x+((y-z)/w))*(((x+y)/z)-w))\"\n\"((x+((y/z)*w))+((x*y)+(z/w)))\"\n\"((x+((y/z)+w))*((x*y)+(z*w)))\"\n\"((x+((y/z)/w))/((x*y)-(z*w)))\"\n\"((x+(5.123*z))*((x+5.123)+z))\"\n\"((x+(5.123+z))+((x-5.123)*z))\"\n\"((x+(5.123-z))-((x*5.123)+z))\"\n\"((x+(5.123/z))/((x-5.123)/z))\"\n\"((x+(y*(z/w)))+(x-((y/z)/w)))\"\n\"((x+(y*7.123))*((x+y)+7.123))\"\n\"((x+(y+7.123))+((x-y)*7.123))\"\n\"((x+(y-7.123))-((x*y)+7.123))\"\n\"((x+(y/(z*w)))*(((x+y)*z)-w))\"\n\"((x+(y/7.123))/((x-y)/7.123))\"\n\"((x-((y*z)*w))*(x/(y-(z*w))))\"\n\"((x-((y*z)/w))-(x/(y+(z*w))))\"\n\"((x-((y+z)*w))*((x/y)+(z/w)))\"\n\"((x-((y+z)/w))-((x*y)-(z/w)))\"\n\"((x-((y-z)*w))+((x/y)-(z*w)))\"\n\"((x-((y-z)/w))/((x/y)-(z/w)))\"\n\"((x-((y/z)*w))+(x*(y-(z*w))))\"\n\"((x-((y/z)/w))/(x*(y+(z*w))))\"\n\"((x-(5.123*z))-((x+5.123)-z))\"\n\"((x-(5.123+z))*(x+(5.123-z)))\"\n\"((x-(5.123-z))/((x+5.123)/z))\"\n\"((x-(5.123/z))+((x+5.123)*z))\"\n\"((x-(y*(z/w)))-(x-((y/z)*w)))\"\n\"((x-(y*7.123))-((x+y)-7.123))\"\n\"((x-(y+7.123))*(x+(y-7.123)))\"\n\"((x-(y-7.123))/((x+y)/7.123))\"\n\"((x-(y/(z*w)))/(((x-y)*z)-w))\"\n\"((x-(y/7.123))+((x+y)*7.123))\"\n\"((x/(5.123*z))+(x-(5.123-z)))\"\n\"((x/(5.123+z))*(x*(5.123/z)))\"\n\"((x/(5.123-z))/(x-(5.123+z)))\"\n\"((x/(5.123/z))-(x-(5.123/z)))\"\n\"((x/(y*7.123))+(x-(y-7.123)))\"\n\"((x/(y+(z*w)))+((x-y)/(z+w)))\"\n\"((x/(y+7.123))*(x*(y/7.123)))\"\n\"((x/(y-(z*w)))-((x*y)-(z+w)))\"\n\"((x/(y-7.123))/(x-(y+7.123)))\"\n\"((x/(y/7.123))-(x-(y/7.123)))\"\n\"(a/cos((sin((2.64+0.17))+b)))\"\n\"(((((1.98/b)/a)/1.61)*a)*2.12)\"\n\"((((((3.51+a)/b)+e)-1.31)+a)-a)\"\n\"((((((a-a)+3.73)+a)*a)/2.50)+e)\"\n\"((((((b*e)*b)/3.79)+a)/1.87)-a)\"\n\"((((((b/3.58)+e)-e)*2.90)/b)+a)\"\n\"(((((e+(a/2.87))+e)+2.73)-b)*b)\"\n\"(((((pi+1.95)-3.85)-a)*1.80)+b)\"\n\"((((tan((b/a))*e)+pi)+pi)*3.37)\"\n\"((b*tan(cos((b/((b*b)+b)))))+a)\"\n\"((b/tan((b*tan((b*pi)))))+0.42)\"\n\"(abs((2.2-y)/z)*exp((2.2-y)*z))\"\n\"(abs((2.2/y)+z)*exp((2.2/y)-z))\"\n\"(abs((x-3.3)/z)*exp((x-3.3)*z))\"\n\"(abs((x-y)/4.4)*exp((x-y)*4.4))\"\n\"(abs((x/3.3)+z)*exp((x/3.3)-z))\"\n\"(abs((x/y)+4.4)*exp((x/y)-4.4))\"\n\"(abs(2.2-(y/z))*exp(2.2-(y/z)))\"\n\"(abs(2.2/(y*z))*exp(2.2/(y/z)))\"\n\"(abs(x-(3.3/z))*exp(x-(3.3/z)))\"\n\"(abs(x-(y/4.4))*exp(x-(y/4.4)))\"\n\"(abs(x/(3.3*z))*exp(x/(3.3/z)))\"\n\"(abs(x/(y*4.4))*exp(x/(y/4.4)))\"\n\"(sin((2.2*y)+z)+cos((2.2*y)-z))\"\n\"(sin((2.2+y)/z)+cos((2.2+y)*z))\"\n\"(sin((2.2/y)/z)+cos((2.2/y)*z))\"\n\"(sin((x*3.3)+z)+cos((x*3.3)-z))\"\n\"(sin((x*y)+4.4)+cos((x*y)-4.4))\"\n\"(sin((x+3.3)/z)+cos((x+3.3)*z))\"\n\"(sin((x+y)/4.4)+cos((x+y)*4.4))\"\n\"(sin((x/3.3)/z)+cos((x/3.3)*z))\"\n\"(sin((x/y)/4.4)+cos((x/y)*4.4))\"\n\"(sin(2.2*(y+z))+cos(2.2*(y-z)))\"\n\"(sin(2.2-(y*z))+cos(2.2+(y*z)))\"\n\"(sin(x*(3.3+z))+cos(x*(3.3-z)))\"\n\"(sin(x*(y+4.4))+cos(x*(y-4.4)))\"\n\"(sin(x-(3.3*z))+cos(x+(3.3*z)))\"\n\"(sin(x-(y*4.4))+cos(x+(y*4.4)))\"\n\"1.1*a^2+2.2*b^3+3.3*c^4+3.3*a^5\"\n\"1.1234567*(2.1234567/3.1234567)\"\n\"2.2*y*z-2.2*y/z*2.2-y/z*2.2-y/z\"\n\"2.2*y/z-2.2*y*z*2.2/y+z*2.2/y-z\"\n\"2.2+y/z+2.2+y*z+2.2+y-z-2.2+y+z\"\n\"2.2-y*z+2.2+y*z+2.2+y/z-2.2+y+z\"\n\"2.2-y/z*2.2-y*z-2.2*y+z+2.2*y-z\"\n\"2.2/y*z*2.2/y/z-2.2*y+z+2.2*y-z\"\n\"2.2/y/z+2.2/y*z+2.2/y+z-2.2/y-z\"\n\"a^2.2^3.3-a^13.4894687605338489\"\n\"abs(sin(sqrt(a^2.1+b^2.1))*255)\"\n\"x*3.3*z-x*3.3/z*x-3.3/z*x-3.3/z\"\n\"x*3.3/z-x*3.3*z*x/3.3+z*x/3.3-z\"\n\"x*y*4.4-x*y/4.4*x-y/4.4*x-y/4.4\"\n\"x*y*z+w-x/y*z+w*x*y/z+w*x/y/z+w\"\n\"x*y+z-w-x/y+z-w*x*y-z-w*x/y-z-w\"\n\"x*y-z+w*x/y-z+w-x*y+z+w+x/y+z+w\"\n\"x*y-z/w*x/y+z/w-x/y-z/w+x/y-z*w\"\n\"x*y/4.4-x*y*4.4*x/y+4.4*x/y-4.4\"\n\"x*y/z-w+x/y/z-w+x*y*z-w-x/y*z-w\"\n\"x+3.3/z+x+3.3*z+x+3.3-z-x+3.3+z\"\n\"x+y*z*w+x+y*z/w+x+y/z*w-x+y/z/w\"\n\"x+y*z/w*x+y*z*w-x+y/z+w+x+y/z/w\"\n\"x+y+z/w+x+y+z*w+x+y-z/w-x+y-z*w\"\n\"x+y-z*w+x+y-z/w+x+y+z*w-x+y+z/w\"\n\"x+y-z-w-x+y-z-w*x+y+z-w*x+y+z-w\"\n\"x+y/4.4+x+y*4.4+x+y-4.4-x+y+4.4\"\n\"x+y/z*w-x-y+z/w*x-y+z*w*x-y-z/w\"\n\"x-3.3*z+x+3.3*z+x+3.3/z-x+3.3+z\"\n\"x-3.3/z*x-3.3*z-x*3.3+z+x*3.3-z\"\n\"x-y*4.4+x+y*4.4+x+y/4.4-x+y+4.4\"\n\"x-y+z*w*x-y+z/w-x-y-z*w+x-y-z/w\"\n\"x-y-z*w+x-y*z/w+x-y*z*w-x-y/z/w\"\n\"x-y-z+w+x-y-z+w+x-y+z+w-x-y+z+w\"\n\"x-y/4.4*x-y*4.4-x*y+4.4+x*y-4.4\"\n\"x-y/z*w*x+y*z-w-x-y*z-w+x*y*z-w\"\n\"x-y/z*w*x-y/z/w-x-y*z*w+x-y*z/w\"\n\"x/3.3*z*x/3.3/z-x*3.3+z+x*3.3-z\"\n\"x/3.3/z+x/3.3*z+x/3.3+z-x/3.3-z\"\n\"x/y*4.4*x/y/4.4-x*y+4.4+x*y-4.4\"\n\"x/y*z-w-x+y/z-w*x-y/z-w*x*y/z-w\"\n\"x/y+z*w-x/y-z*w*x*y+z*w*x*y-z*w\"\n\"x/y/4.4+x/y*4.4+x/y+4.4-x/y-4.4\"\n\"x/y/z-w+x*y+z*w+x*y-z*w-x*y+z/w\"\n\"(((e*(((b+2.82)+b)*pi))+a)+2.25)\"\n\"((e/(a*(tan((3.59-2.74))-b)))+b)\"\n\"1.1*a^2.01+2.2*b^3.01+3.3*c^4.01\"\n\"cos((pi/((((pi+pi)*b)+a)*0.95)))\"\n\"sqrt(1-sin(2.2*a)+cos(pi/b)/3.3)\"\n\"(((cos(((pi+1.46)+b))/b)+2.91)+b)\"\n\"(b-((((a+((b+3.21)+a))*b)*pi)*a))\"\n\"(sin((((((e+a)/a)-a)+a)*b))+1.23)\"\n\"cos((((b-(a*((e*2.28)*a)))-a)*a))\"\n\"sin((((((2.35/b)*b)*3.80)/b)-pi))\"\n\"(((((((b+a)+a)-a)+pi)/pi)/0.06)*a)\"\n\"(((((b-((pi-3.59)-e))-pi)+e)+a)/b)\"\n\"(((0.30/((pi*tan(b))/3.04))*b)*pi)\"\n\"(((e*(((a/0.64)/b)+2.61))*2.89)+b)\"\n\"(((((((b-0.28)+e)+b)+b)*b)/1.12)*e)\"\n\"((((((3.80/b)-pi)*0.61)-3.21)*b)-b)\"\n\"((a/(((((b*a)/3.17)-pi)/pi)+pi))+b)\"\n\"((x*y*z+w+x+y/z/w+x+y/z+w*x*y+z*w))\"\n\"((x*y*z-w*x-y*z/w*x-y-z*w+x/y-z*w))\"\n\"((x*y*z-w/x+y+z*w/x+y-z/w-x*y+z-w))\"\n\"((x*y+z*w*x/y-z+w*x*y-z+w+x/y/z+w))\"\n\"((x*y+z*w-x+y-z-w-x-y-z/w/x+y/z*w))\"\n\"((x*y+z+w*x/y/z-w*x*y/z-w+x-y-z/w))\"\n\"((x*y+z-w+x/y*z-w+x*y*z-w*x-y*z/w))\"\n\"((x*y+z/w/x+y*z-w/x+y+z-w-x-y/z*w))\"\n\"((x*y-z*w*x+y+z-w*x+y-z-w+x+y/z/w))\"\n\"((x*y-z*w/x*y+z+w/x/y-z+w-x*y/z-w))\"\n\"((x*y-z+w+x/y/z+w+x*y/z+w*x-y+z/w))\"\n\"((x*y-z-w*x-y*z/w*x+y*z/w+x-y/z/w))\"\n\"((x*y-z/w+x+y/z-w+x+y*z-w*x-y/z/w))\"\n\"((x*y/z+w*x-y+z/w*x+y/z*w+x*y+z/w))\"\n\"((x*y/z-w+x-y-z/w+x-y+z*w*x/y+z/w))\"\n\"((x*y/z-w/x-y-z*w/x-y+z/w-x+y*z*w))\"\n\"((x+y*z*w+x-y/z*w+x+y/z*w*x+y*z-w))\"\n\"((x+y*z*w-x/y/z-w-x*y/z-w/x-y-z*w))\"\n\"((x+y*z-w*x-y/z/w*x-y/z*w+x+y-z*w))\"\n\"((x+y*z-w-x+y-z*w-x*y-z*w/x*y+z+w))\"\n\"((x+y*z/w+x*y/z-w+x-y/z-w*x-y+z/w))\"\n\"((x+y*z/w+x-y/z/w+x-y*z*w*x/y-z*w))\"\n\"((x+y*z/w-x+y+z/w-x-y/z*w/x-y*z-w))\"\n\"((x+y+z*w*x/y+z-w*x*y+z-w+x/y*z-w))\"\n\"((x+y+z*w-x/y*z-w-x*y*z-w/x+y+z*w))\"\n\"((x+y+z-w-x-y/z*w-x+y/z/w/x+y-z/w))\"\n\"((x+y+z/w+x*y*z-w+x-y*z-w*x+y-z/w))\"\n\"((x+y+z/w/x*y-z-w/x/y+z-w-x+y*z/w))\"\n\"((x+y-z*w+x/y+z+w+x*y+z+w*x/y/z-w))\"\n\"((x+y-z*w/x-y/z-w/x+y/z-w-x-y+z*w))\"\n\"((x+y-z-w+x+y/z/w+x+y/z*w*x+y+z*w))\"\n\"((x+y-z/w*x+y/z-w*x/y*z-w+x+y+z/w))\"\n\"((x+y-z/w-x*y+z-w-x/y+z+w/x*y*z-w))\"\n\"((x+y/z*w*x+y*z-w*x-y/z*w+x*y-z*w))\"\n\"((x+y/z*w*x+y+z*w*x+y+z/w+x*y*z-w))\"\n\"((x+y/z*w+x*y+z/w+x*y-z*w*x+y+z-w))\"\n\"((x+y/z+w*x*y+z*w*x/y/z-w+x-y-z/w))\"\n\"((x+y/z-w-x-y+z*w-x+y+z/w/x*y-z-w))\"\n\"((x+y/z-w/x-y*z*w/x-y/z/w-x+y*z/w))\"\n\"((x+y/z/w/x*y-z*w/x*y+z*w-x+y-z-w))\"\n\"((x+y/z/w/x+y-z/w/x+y+z*w-x/y*z-w))\"\n\"((x-y*z*w*x+y*z*w*x+y*z/w+x*y/z-w))\"\n\"((x-y*z*w*x/y-z*w*x/y+z*w+x-y/z+w))\"\n\"((x-y*z+w*x/y*z+w*x*y*z+w+x+y/z/w))\"\n\"((x-y*z-w*x+y-z/w*x+y-z*w+x/y+z+w))\"\n\"((x-y*z/w-x-y/z*w-x-y/z/w/x*y+z*w))\"\n\"((x-y*z/w-x/y+z*w-x/y-z*w/x-y*z+w))\"\n\"((x-y*z/w/x+y/z+w/x+y*z*w-x/y/z-w))\"\n\"((x-y+z*w*x/y+z/w*x*y-z/w+x+y/z-w))\"\n\"((x-y+z*w+x/y-z-w+x*y-z-w*x-y*z/w))\"\n\"((x-y+z+w-x*y*z+w-x-y*z/w/x+y/z+w))\"\n\"((x-y+z/w-x*y-z/w-x*y+z/w/x+y*z-w))\"\n\"((x-y+z/w-x+y*z*w-x/y-z-w/x+y/z*w))\"\n\"((x-y-z*w*x+y*z/w*x+y*z*w+x-y/z*w))\"\n\"((x-y-z*w+x/y-z*w+x/y-z/w*x-y+z+w))\"\n\"((x-y-z+w+x-y*z/w+x-y*z*w*x+y*z*w))\"\n\"((x-y-z/w/x+y/z*w/x+y*z/w-x+y+z/w))\"\n\"((x-y-z/w/x/y-z/w/x/y+z/w-x-y-z+w))\"\n\"((x-y/z*w+x*y-z*w+x*y+z*w*x/y-z+w))\"\n\"((x-y/z*w+x+y-z*w+x+y-z/w*x+y/z-w))\"\n\"((x-y/z*w/x-y*z-w/x+y*z-w-x+y-z*w))\"\n\"((x-y/z+w/x*y/z+w/x/y*z+w-x+y/z*w))\"\n\"((x-y/z-w*x-y+z/w*x-y+z*w+x/y-z-w))\"\n\"((x-y/z/w-x+y*z/w-x+y-z*w/x-y/z-w))\"\n\"((x-y/z/w/x*y+z*w/x/y-z*w-x*y-z+w))\"\n\"((x/y*z+w-x+y/z*w-x+y/z/w/x*y-z*w))\"\n\"((x/y*z-w+x+y+z/w+x+y+z*w*x/y+z-w))\"\n\"((x/y*z-w/x-y*z*w/x-y*z/w-x/y+z*w))\"\n\"((x/y+z*w+x-y/z+w+x-y*z+w*x/y*z+w))\"\n\"((x/y+z+w/x*y*z-w/x/y/z-w-x-y-z*w))\"\n\"((x/y+z-w-x+y*z/w-x/y*z-w/x-y*z*w))\"\n\"((x/y+z/w-x-y-z+w-x+y/z-w/x-y*z*w))\"\n\"((x/y-z*w-x*y-z+w-x-y/z+w/x*y/z+w))\"\n\"((x/y-z*w/x-y*z+w/x-y+z+w-x*y*z+w))\"\n\"((x/y-z+w-x*y/z-w-x/y/z+w/x-y+z*w))\"\n\"((x/y-z-w/x+y/z*w/x-y*z/w-x-y/z*w))\"\n\"((x/y-z/w*x-y+z+w*x-y-z+w+x-y*z/w))\"\n\"((x/y/z+w/x-y+z*w/x-y+z/w-x*y-z/w))\"\n\"((x/y/z-w+x-y-z/w+x-y-z*w*x+y*z/w))\"\n\"((x/y/z-w-x-y-z*w-x-y-z/w/x/y-z/w))\"\n\"(0.1*a+1)*a+1.1-sin(a)-log(a)/a*3/4\"\n\"(1-2)+(2-3)+(3-4)+(4-5)+(5-6)+(6-7)\"\n\"(a-((((((pi-(a*pi))*b)/a)*b)+b)/a))\"\n\"5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"cos(((tan(tan(((b*b)*b)))+b)-0.28))\"\n\"(((((b/(((a+e)*a)-b))/1.89)-a)-b)+e)\"\n\"((0.09*((sin((1.11*pi))+1.15)-a))+b)\"\n\"(sin(sin(sin((3.62+((pi*e)+a)))))+a)\"\n\"tan(sin(((pi*tan(((a+0.06)-b)))*a)))\"\n\"((((3.123*y)*z)-w)/((3.123+y)+(z*w)))\"\n\"((((3.123*y)/z)-w)/((3.123-y)-(z*w)))\"\n\"((((3.123+y)*z)-w)-((3.123+y)-(z*w)))\"\n\"((((3.123+y)/z)-w)-((3.123-y)+(z*w)))\"\n\"((((3.123-y)*z)-w)*((3.123+y)-(z/w)))\"\n\"((((3.123-y)/z)-w)*((3.123-y)+(z/w)))\"\n\"((((3.123/y)*z)-w)+((3.123+y)+(z/w)))\"\n\"((((3.123/y)/z)-w)+((3.123-y)-(z/w)))\"\n\"((((x*5.123)*z)-w)/((x+5.123)+(z*w)))\"\n\"((((x*5.123)/z)-w)/((x-5.123)-(z*w)))\"\n\"((((x*y)*7.123)-w)/((x+y)+(7.123*w)))\"\n\"((((x*y)*z)-9.123)/((x+y)+(z*9.123)))\"\n\"((((x*y)/7.123)-w)/((x-y)-(7.123*w)))\"\n\"((((x*y)/z)-9.123)/((x-y)-(z*9.123)))\"\n\"((((x+5.123)*z)-w)-((x+5.123)-(z*w)))\"\n\"((((x+5.123)/z)-w)-((x-5.123)+(z*w)))\"\n\"((((x+y)*7.123)-w)-((x+y)-(7.123*w)))\"\n\"((((x+y)*z)-9.123)-((x+y)-(z*9.123)))\"\n\"((((x+y)/7.123)-w)-((x-y)+(7.123*w)))\"\n\"((((x+y)/z)-9.123)-((x-y)+(z*9.123)))\"\n\"((((x-5.123)*z)-w)*((x+5.123)-(z/w)))\"\n\"((((x-5.123)/z)-w)*((x-5.123)+(z/w)))\"\n\"((((x-y)*7.123)-w)*((x+y)-(7.123/w)))\"\n\"((((x-y)*z)-9.123)*((x+y)-(z/9.123)))\"\n\"((((x-y)/7.123)-w)*((x-y)+(7.123/w)))\"\n\"((((x-y)/z)-9.123)*((x-y)+(z/9.123)))\"\n\"((((x/5.123)*z)-w)+((x+5.123)+(z/w)))\"\n\"((((x/5.123)/z)-w)+((x-5.123)-(z/w)))\"\n\"((((x/y)*7.123)-w)+((x+y)+(7.123/w)))\"\n\"((((x/y)*z)-9.123)+((x+y)+(z/9.123)))\"\n\"((((x/y)/7.123)-w)+((x-y)-(7.123/w)))\"\n\"((((x/y)/z)-9.123)+((x-y)-(z/9.123)))\"\n\"(((3.123*y)*(z+w))+(3.123+((y/z)/w)))\"\n\"(((3.123*y)*(z-w))*(3.123-((y*z)/w)))\"\n\"(((3.123*y)+(z*w))-((3.123+y)-(z-w)))\"\n\"(((3.123*y)+(z+w))*((3.123/y)/(z-w)))\"\n\"(((3.123*y)+(z-w))+((3.123/y)*(z-w)))\"\n\"(((3.123*y)+(z/w))/((3.123+y)*(z-w)))\"\n\"(((3.123*y)-(z*w))*((3.123+y)+(z-w)))\"\n\"(((3.123*y)-(z+w))+((3.123/y)/(z+w)))\"\n\"(((3.123*y)-(z-w))*(3.123-(y*(z/w))))\"\n\"(((3.123*y)-(z/w))+((3.123+y)/(z-w)))\"\n\"(((3.123*y)/(z+w))*(3.123-((y+z)/w)))\"\n\"(((3.123*y)/(z-w))+(3.123-((y-z)/w)))\"\n\"(((3.123+y)*(z*w))+(3.123-(y/(z*w))))\"\n\"(((3.123+y)*(z-w))*((3.123-y)/(z/w)))\"\n\"(((3.123+y)*(z/w))-(3.123+((y+z)/w)))\"\n\"(((3.123+y)+(z*w))*((3.123/y)+(z-w)))\"\n\"(((3.123+y)+(z-w))-((3.123-y)/(z*w)))\"\n\"(((3.123+y)+(z/w))/((3.123*y)-(z-w)))\"\n\"(((3.123+y)-(z*w))+((3.123/y)+(z+w)))\"\n\"(((3.123+y)-(z-w))+((3.123+y)/(z/w)))\"\n\"(((3.123+y)-(z/w))-((3.123*y)+(z-w)))\"\n\"(((3.123+y)/(z*w))*(3.123+((y+z)*w)))\"\n\"(((3.123+y)/(z-w))/((3.123-y)*(z*w)))\"\n\"(((3.123+y)/(z/w))/(3.123+((y-z)/w)))\"\n\"(((3.123-y)*(z*w))*(3.123+((y*z)*w)))\"\n\"(((3.123-y)*(z+w))*((3.123/y)*(z+w)))\"\n\"(((3.123-y)*(z/w))/(3.123+((y/z)+w)))\"\n\"(((3.123-y)+(z*w))+((3.123/y)-(z-w)))\"\n\"(((3.123-y)+(z+w))-((3.123*y)*(z+w)))\"\n\"(((3.123-y)+(z/w))-((3.123+y)*(z*w)))\"\n\"(((3.123-y)-(z*w))*((3.123+y)*(z/w)))\"\n\"(((3.123-y)-(z+w))+((3.123-y)*(z/w)))\"\n\"(((3.123-y)-(z/w))/((3.123+y)/(z*w)))\"\n\"(((3.123-y)/(z*w))+(3.123+((y-z)*w)))\"\n\"(((3.123-y)/(z+w))/((3.123*y)/(z+w)))\"\n\"(((3.123-y)/(z/w))-(3.123+((y*z)/w)))\"\n\"(((3.123/y)*(z+w))-(3.123+((y/z)*w)))\"\n\"(((3.123/y)*(z-w))/(3.123-((y*z)*w)))\"\n\"(((3.123/y)+(z+w))/((3.123*y)*(z-w)))\"\n\"(((3.123/y)+(z-w))-(3.123+(y*(z/w))))\"\n\"(((3.123/y)+(z/w))-((3.123-y)-(z+w)))\"\n\"(((3.123/y)-(z*w))/((3.123-y)*(z+w)))\"\n\"(((3.123/y)-(z+w))-((3.123*y)/(z-w)))\"\n\"(((3.123/y)-(z-w))/(3.123+(y/(z*w))))\"\n\"(((3.123/y)-(z/w))*((3.123-y)+(z+w)))\"\n\"(((3.123/y)/(z+w))/(3.123-((y+z)*w)))\"\n\"(((3.123/y)/(z-w))-(3.123-((y-z)*w)))\"\n\"(((pi/(b+(((b*0.10)/pi)*b)))*e)+1.97)\"\n\"(((x*5.123)*(z+w))+(x+((5.123/z)/w)))\"\n\"(((x*5.123)*(z-w))*(x-((5.123*z)/w)))\"\n\"(((x*5.123)+(z*w))-((x+5.123)-(z-w)))\"\n\"(((x*5.123)+(z+w))*((x/5.123)/(z-w)))\"\n\"(((x*5.123)+(z-w))+((x/5.123)*(z-w)))\"\n\"(((x*5.123)+(z/w))/((x+5.123)*(z-w)))\"\n\"(((x*5.123)-(z*w))*((x+5.123)+(z-w)))\"\n\"(((x*5.123)-(z+w))+((x/5.123)/(z+w)))\"\n\"(((x*5.123)-(z-w))*(x-(5.123*(z/w))))\"\n\"(((x*5.123)-(z/w))+((x+5.123)/(z-w)))\"\n\"(((x*5.123)/(z+w))*(x-((5.123+z)/w)))\"\n\"(((x*5.123)/(z-w))+(x-((5.123-z)/w)))\"\n\"(((x*y)*(7.123+w))+(x+((y/7.123)/w)))\"\n\"(((x*y)*(7.123-w))*(x-((y*7.123)/w)))\"\n\"(((x*y)*(z+9.123))+(x+((y/z)/9.123)))\"\n\"(((x*y)*(z-9.123))*(x-((y*z)/9.123)))\"\n\"(((x*y)+(7.123*w))-((x+y)-(7.123-w)))\"\n\"(((x*y)+(7.123+w))*((x/y)/(7.123-w)))\"\n\"(((x*y)+(7.123-w))+((x/y)*(7.123-w)))\"\n\"(((x*y)+(7.123/w))/((x+y)*(7.123-w)))\"\n\"(((x*y)+(z*9.123))-((x+y)-(z-9.123)))\"\n\"(((x*y)+(z+9.123))*((x/y)/(z-9.123)))\"\n\"(((x*y)+(z-9.123))+((x/y)*(z-9.123)))\"\n\"(((x*y)+(z/9.123))/((x+y)*(z-9.123)))\"\n\"(((x*y)-(7.123*w))*((x+y)+(7.123-w)))\"\n\"(((x*y)-(7.123+w))+((x/y)/(7.123+w)))\"\n\"(((x*y)-(7.123-w))*(x-(y*(7.123/w))))\"\n\"(((x*y)-(7.123/w))+((x+y)/(7.123-w)))\"\n\"(((x*y)-(z*9.123))*((x+y)+(z-9.123)))\"\n\"(((x*y)-(z+9.123))+((x/y)/(z+9.123)))\"\n\"(((x*y)-(z-9.123))*(x-(y*(z/9.123))))\"\n\"(((x*y)-(z/9.123))+((x+y)/(z-9.123)))\"\n\"(((x*y)/(7.123+w))*(x-((y+7.123)/w)))\"\n\"(((x*y)/(7.123-w))+(x-((y-7.123)/w)))\"\n\"(((x*y)/(z+9.123))*(x-((y+z)/9.123)))\"\n\"(((x*y)/(z-9.123))+(x-((y-z)/9.123)))\"\n\"(((x+5.123)*(z*w))+(x-(5.123/(z*w))))\"\n\"(((x+5.123)*(z-w))*((x-5.123)/(z/w)))\"\n\"(((x+5.123)*(z/w))-(x+((5.123+z)/w)))\"\n\"(((x+5.123)+(z*w))*((x/5.123)+(z-w)))\"\n\"(((x+5.123)+(z-w))-((x-5.123)/(z*w)))\"\n\"(((x+5.123)+(z/w))/((x*5.123)-(z-w)))\"\n\"(((x+5.123)-(z*w))+((x/5.123)+(z+w)))\"\n\"(((x+5.123)-(z-w))+((x+5.123)/(z/w)))\"\n\"(((x+5.123)-(z/w))-((x*5.123)+(z-w)))\"\n\"(((x+5.123)/(z*w))*(x+((5.123+z)*w)))\"\n\"(((x+5.123)/(z-w))/((x-5.123)*(z*w)))\"\n\"(((x+5.123)/(z/w))/(x+((5.123-z)/w)))\"\n\"(((x+y)*(7.123*w))+(x-(y/(7.123*w))))\"\n\"(((x+y)*(7.123-w))*((x-y)/(7.123/w)))\"\n\"(((x+y)*(7.123/w))-(x+((y+7.123)/w)))\"\n\"(((x+y)*(z*9.123))+(x-(y/(z*9.123))))\"\n\"(((x+y)*(z-9.123))*((x-y)/(z/9.123)))\"\n\"(((x+y)*(z/9.123))-(x+((y+z)/9.123)))\"\n\"(((x+y)+(7.123*w))*((x/y)+(7.123-w)))\"\n\"(((x+y)+(7.123-w))-((x-y)/(7.123*w)))\"\n\"(((x+y)+(7.123/w))/((x*y)-(7.123-w)))\"\n\"(((x+y)+(z*9.123))*((x/y)+(z-9.123)))\"\n\"(((x+y)+(z-9.123))-((x-y)/(z*9.123)))\"\n\"(((x+y)+(z/9.123))/((x*y)-(z-9.123)))\"\n\"(((x+y)-(7.123*w))+((x/y)+(7.123+w)))\"\n\"(((x+y)-(7.123-w))+((x+y)/(7.123/w)))\"\n\"(((x+y)-(7.123/w))-((x*y)+(7.123-w)))\"\n\"(((x+y)-(z*9.123))+((x/y)+(z+9.123)))\"\n\"(((x+y)-(z-9.123))+((x+y)/(z/9.123)))\"\n\"(((x+y)-(z/9.123))-((x*y)+(z-9.123)))\"\n\"(((x+y)/(7.123*w))*(x+((y+7.123)*w)))\"\n\"(((x+y)/(7.123-w))/((x-y)*(7.123*w)))\"\n\"(((x+y)/(7.123/w))/(x+((y-7.123)/w)))\"\n\"(((x+y)/(z*9.123))*(x+((y+z)*9.123)))\"\n\"(((x+y)/(z-9.123))/((x-y)*(z*9.123)))\"\n\"(((x+y)/(z/9.123))/(x+((y-z)/9.123)))\"\n\"(((x-5.123)*(z*w))*(x+((5.123*z)*w)))\"\n\"(((x-5.123)*(z+w))*((x/5.123)*(z+w)))\"\n\"(((x-5.123)*(z/w))/(x+((5.123/z)+w)))\"\n\"(((x-5.123)+(z*w))+((x/5.123)-(z-w)))\"\n\"(((x-5.123)+(z+w))-((x*5.123)*(z+w)))\"\n\"(((x-5.123)+(z/w))-((x+5.123)*(z*w)))\"\n\"(((x-5.123)-(z*w))*((x+5.123)*(z/w)))\"\n\"(((x-5.123)-(z+w))+((x-5.123)*(z/w)))\"\n\"(((x-5.123)-(z/w))/((x+5.123)/(z*w)))\"\n\"(((x-5.123)/(z*w))+(x+((5.123-z)*w)))\"\n\"(((x-5.123)/(z+w))/((x*5.123)/(z+w)))\"\n\"(((x-5.123)/(z/w))-(x+((5.123*z)/w)))\"\n\"(((x-y)*(7.123*w))*(x+((y*7.123)*w)))\"\n\"(((x-y)*(7.123+w))*((x/y)*(7.123+w)))\"\n\"(((x-y)*(7.123/w))/(x+((y/7.123)+w)))\"\n\"(((x-y)*(z*9.123))*(x+((y*z)*9.123)))\"\n\"(((x-y)*(z+9.123))*((x/y)*(z+9.123)))\"\n\"(((x-y)*(z/9.123))/(x+((y/z)+9.123)))\"\n\"(((x-y)+(7.123*w))+((x/y)-(7.123-w)))\"\n\"(((x-y)+(7.123+w))-((x*y)*(7.123+w)))\"\n\"(((x-y)+(7.123/w))-((x+y)*(7.123*w)))\"\n\"(((x-y)+(z*9.123))+((x/y)-(z-9.123)))\"\n\"(((x-y)+(z+9.123))-((x*y)*(z+9.123)))\"\n\"(((x-y)+(z/9.123))-((x+y)*(z*9.123)))\"\n\"(((x-y)-(7.123*w))*((x+y)*(7.123/w)))\"\n\"(((x-y)-(7.123+w))+((x-y)*(7.123/w)))\"\n\"(((x-y)-(7.123/w))/((x+y)/(7.123*w)))\"\n\"(((x-y)-(z*9.123))*((x+y)*(z/9.123)))\"\n\"(((x-y)-(z+9.123))+((x-y)*(z/9.123)))\"\n\"(((x-y)-(z/9.123))/((x+y)/(z*9.123)))\"\n\"(((x-y)/(7.123*w))+(x+((y-7.123)*w)))\"\n\"(((x-y)/(7.123+w))/((x*y)/(7.123+w)))\"\n\"(((x-y)/(7.123/w))-(x+((y*7.123)/w)))\"\n\"(((x-y)/(z*9.123))+(x+((y-z)*9.123)))\"\n\"(((x-y)/(z+9.123))/((x*y)/(z+9.123)))\"\n\"(((x-y)/(z/9.123))-(x+((y*z)/9.123)))\"\n\"(((x/5.123)*(z+w))-(x+((5.123/z)*w)))\"\n\"(((x/5.123)*(z-w))/(x-((5.123*z)*w)))\"\n\"(((x/5.123)+(z+w))/((x*5.123)*(z-w)))\"\n\"(((x/5.123)+(z-w))-(x+(5.123*(z/w))))\"\n\"(((x/5.123)+(z/w))-((x-5.123)-(z+w)))\"\n\"(((x/5.123)-(z*w))/((x-5.123)*(z+w)))\"\n\"(((x/5.123)-(z+w))-((x*5.123)/(z-w)))\"\n\"(((x/5.123)-(z-w))/(x+(5.123/(z*w))))\"\n\"(((x/5.123)-(z/w))*((x-5.123)+(z+w)))\"\n\"(((x/5.123)/(z+w))/(x-((5.123+z)*w)))\"\n\"(((x/5.123)/(z-w))-(x-((5.123-z)*w)))\"\n\"(((x/y)*(7.123+w))-(x+((y/7.123)*w)))\"\n\"(((x/y)*(7.123-w))/(x-((y*7.123)*w)))\"\n\"(((x/y)*(z+9.123))-(x+((y/z)*9.123)))\"\n\"(((x/y)*(z-9.123))/(x-((y*z)*9.123)))\"\n\"(((x/y)+(7.123+w))/((x*y)*(7.123-w)))\"\n\"(((x/y)+(7.123-w))-(x+(y*(7.123/w))))\"\n\"(((x/y)+(7.123/w))-((x-y)-(7.123+w)))\"\n\"(((x/y)+(z+9.123))/((x*y)*(z-9.123)))\"\n\"(((x/y)+(z-9.123))-(x+(y*(z/9.123))))\"\n\"(((x/y)+(z/9.123))-((x-y)-(z+9.123)))\"\n\"(((x/y)-(7.123*w))/((x-y)*(7.123+w)))\"\n\"(((x/y)-(7.123+w))-((x*y)/(7.123-w)))\"\n\"(((x/y)-(7.123-w))/(x+(y/(7.123*w))))\"\n\"(((x/y)-(7.123/w))*((x-y)+(7.123+w)))\"\n\"(((x/y)-(z*9.123))/((x-y)*(z+9.123)))\"\n\"(((x/y)-(z+9.123))-((x*y)/(z-9.123)))\"\n\"(((x/y)-(z-9.123))/(x+(y/(z*9.123))))\"\n\"(((x/y)-(z/9.123))*((x-y)+(z+9.123)))\"\n\"(((x/y)/(7.123+w))/(x-((y+7.123)*w)))\"\n\"(((x/y)/(7.123-w))-(x-((y-7.123)*w)))\"\n\"(((x/y)/(z+9.123))/(x-((y+z)*9.123)))\"\n\"(((x/y)/(z-9.123))-(x-((y-z)*9.123)))\"\n\"((3.123*(y+(z*w)))*((3.123/y)-(z+w)))\"\n\"((3.123*(y-(z*w)))/((3.123*y)+(z+w)))\"\n\"((3.123+((y*z)*w))-(((3.123/y)/z)-w))\"\n\"((3.123+((y*z)/w))+(((3.123*y)/z)-w))\"\n\"((3.123+((y+z)*w))-(((3.123/y)*z)-w))\"\n\"((3.123+((y+z)/w))+(((3.123*y)*z)-w))\"\n\"((3.123+((y-z)*w))/(((3.123-y)/z)-w))\"\n\"((3.123+((y-z)/w))*(((3.123+y)/z)-w))\"\n\"((3.123+((y/z)*w))+((3.123*y)+(z/w)))\"\n\"((3.123+((y/z)+w))*((3.123*y)+(z*w)))\"\n\"((3.123+((y/z)/w))/((3.123*y)-(z*w)))\"\n\"((3.123+(y*(z/w)))+(3.123-((y/z)/w)))\"\n\"((3.123+(y/(z*w)))*(((3.123+y)*z)-w))\"\n\"((3.123-((y*z)*w))*(3.123/(y-(z*w))))\"\n\"((3.123-((y*z)/w))-(3.123/(y+(z*w))))\"\n\"((3.123-((y+z)*w))*((3.123/y)+(z/w)))\"\n\"((3.123-((y+z)/w))-((3.123*y)-(z/w)))\"\n\"((3.123-((y-z)*w))+((3.123/y)-(z*w)))\"\n\"((3.123-((y-z)/w))/((3.123/y)-(z/w)))\"\n\"((3.123-((y/z)*w))+(3.123*(y-(z*w))))\"\n\"((3.123-((y/z)/w))/(3.123*(y+(z*w))))\"\n\"((3.123-(y*(z/w)))-(3.123-((y/z)*w)))\"\n\"((3.123-(y/(z*w)))/(((3.123-y)*z)-w))\"\n\"((3.123/(y+(z*w)))+((3.123-y)/(z+w)))\"\n\"((3.123/(y-(z*w)))-((3.123*y)-(z+w)))\"\n\"((tan((tan(((0.69-b)/a))*b))+e)*3.51)\"\n\"((x*(5.123+(z*w)))*((x/5.123)-(z+w)))\"\n\"((x*(5.123-(z*w)))/((x*5.123)+(z+w)))\"\n\"((x*(y+(7.123*w)))*((x/y)-(7.123+w)))\"\n\"((x*(y+(z*9.123)))*((x/y)-(z+9.123)))\"\n\"((x*(y-(7.123*w)))/((x*y)+(7.123+w)))\"\n\"((x*(y-(z*9.123)))/((x*y)+(z+9.123)))\"\n\"((x+((5.123*z)*w))-(((x/5.123)/z)-w))\"\n\"((x+((5.123*z)/w))+(((x*5.123)/z)-w))\"\n\"((x+((5.123+z)*w))-(((x/5.123)*z)-w))\"\n\"((x+((5.123+z)/w))+(((x*5.123)*z)-w))\"\n\"((x+((5.123-z)*w))/(((x-5.123)/z)-w))\"\n\"((x+((5.123-z)/w))*(((x+5.123)/z)-w))\"\n\"((x+((5.123/z)*w))+((x*5.123)+(z/w)))\"\n\"((x+((5.123/z)+w))*((x*5.123)+(z*w)))\"\n\"((x+((5.123/z)/w))/((x*5.123)-(z*w)))\"\n\"((x+((y*7.123)*w))-(((x/y)/7.123)-w))\"\n\"((x+((y*7.123)/w))+(((x*y)/7.123)-w))\"\n\"((x+((y*z)*9.123))-(((x/y)/z)-9.123))\"\n\"((x+((y*z)/9.123))+(((x*y)/z)-9.123))\"\n\"((x+((y+7.123)*w))-(((x/y)*7.123)-w))\"\n\"((x+((y+7.123)/w))+(((x*y)*7.123)-w))\"\n\"((x+((y+z)*9.123))-(((x/y)*z)-9.123))\"\n\"((x+((y+z)/9.123))+(((x*y)*z)-9.123))\"\n\"((x+((y-7.123)*w))/(((x-y)/7.123)-w))\"\n\"((x+((y-7.123)/w))*(((x+y)/7.123)-w))\"\n\"((x+((y-z)*9.123))/(((x-y)/z)-9.123))\"\n\"((x+((y-z)/9.123))*(((x+y)/z)-9.123))\"\n\"((x+((y/7.123)*w))+((x*y)+(7.123/w)))\"\n\"((x+((y/7.123)+w))*((x*y)+(7.123*w)))\"\n\"((x+((y/7.123)/w))/((x*y)-(7.123*w)))\"\n\"((x+((y/z)*9.123))+((x*y)+(z/9.123)))\"\n\"((x+((y/z)+9.123))*((x*y)+(z*9.123)))\"\n\"((x+((y/z)/9.123))/((x*y)-(z*9.123)))\"\n\"((x+(5.123*(z/w)))+(x-((5.123/z)/w)))\"\n\"((x+(5.123/(z*w)))*(((x+5.123)*z)-w))\"\n\"((x+(y*(7.123/w)))+(x-((y/7.123)/w)))\"\n\"((x+(y*(z/9.123)))+(x-((y/z)/9.123)))\"\n\"((x+(y/(7.123*w)))*(((x+y)*7.123)-w))\"\n\"((x+(y/(z*9.123)))*(((x+y)*z)-9.123))\"\n\"((x-((5.123*z)*w))*(x/(5.123-(z*w))))\"\n\"((x-((5.123*z)/w))-(x/(5.123+(z*w))))\"\n\"((x-((5.123+z)*w))*((x/5.123)+(z/w)))\"\n\"((x-((5.123+z)/w))-((x*5.123)-(z/w)))\"\n\"((x-((5.123-z)*w))+((x/5.123)-(z*w)))\"\n\"((x-((5.123-z)/w))/((x/5.123)-(z/w)))\"\n\"((x-((5.123/z)*w))+(x*(5.123-(z*w))))\"\n\"((x-((5.123/z)/w))/(x*(5.123+(z*w))))\"\n\"((x-((y*7.123)*w))*(x/(y-(7.123*w))))\"\n\"((x-((y*7.123)/w))-(x/(y+(7.123*w))))\"\n\"((x-((y*z)*9.123))*(x/(y-(z*9.123))))\"\n\"((x-((y*z)/9.123))-(x/(y+(z*9.123))))\"\n\"((x-((y+7.123)*w))*((x/y)+(7.123/w)))\"\n\"((x-((y+7.123)/w))-((x*y)-(7.123/w)))\"\n\"((x-((y+z)*9.123))*((x/y)+(z/9.123)))\"\n\"((x-((y+z)/9.123))-((x*y)-(z/9.123)))\"\n\"((x-((y-7.123)*w))+((x/y)-(7.123*w)))\"\n\"((x-((y-7.123)/w))/((x/y)-(7.123/w)))\"\n\"((x-((y-z)*9.123))+((x/y)-(z*9.123)))\"\n\"((x-((y-z)/9.123))/((x/y)-(z/9.123)))\"\n\"((x-((y/7.123)*w))+(x*(y-(7.123*w))))\"\n\"((x-((y/7.123)/w))/(x*(y+(7.123*w))))\"\n\"((x-((y/z)*9.123))+(x*(y-(z*9.123))))\"\n\"((x-((y/z)/9.123))/(x*(y+(z*9.123))))\"\n\"((x-(5.123*(z/w)))-(x-((5.123/z)*w)))\"\n\"((x-(5.123/(z*w)))/(((x-5.123)*z)-w))\"\n\"((x-(y*(7.123/w)))-(x-((y/7.123)*w)))\"\n\"((x-(y*(z/9.123)))-(x-((y/z)*9.123)))\"\n\"((x-(y/(7.123*w)))/(((x-y)*7.123)-w))\"\n\"((x-(y/(z*9.123)))/(((x-y)*z)-9.123))\"\n\"((x/(5.123+(z*w)))+((x-5.123)/(z+w)))\"\n\"((x/(5.123-(z*w)))-((x*5.123)-(z+w)))\"\n\"((x/(y+(7.123*w)))+((x-y)/(7.123+w)))\"\n\"((x/(y+(z*9.123)))+((x-y)/(z+9.123)))\"\n\"((x/(y-(7.123*w)))-((x*y)-(7.123+w)))\"\n\"((x/(y-(z*9.123)))-((x*y)-(z+9.123)))\"\n\"(5.5+a)+(2*b-2/3*a)*(b/3+a/4)+(b+7.7)\"\n\"(a+(a+((tan((b+(b+(b*1.85))))/a)+b)))\"\n\"1/(a*sqrt(2*pi))*e^(-0.5*((b-a)/a)^2)\"\n\"(((a*((cos(cos(pi))/a)+2.48))+3.59)/b)\"\n\"((e-(((((1.59+a)-e)/b)*3.20)+1.99))+a)\"\n\"(pi/((((((((b-b)+b)-a)+b)-a)*e)/e)+e))\"\n\"(((((((0.93+b)+e)*0.61)+b)+e)+pi)-0.38)\"\n\"((7-2)+(2-3)*(3-4))/((4-5)*(5-6)+(6-9))\"\n\"((b*((((cos(sin(pi))/e)/b)+3.49)+b))*a)\"\n\"2.2*y*z+w-2.2/y*z+w*2.2*y/z+w*2.2/y/z+w\"\n\"2.2*y+z-w-2.2/y+z-w*2.2*y-z-w*2.2/y-z-w\"\n\"2.2*y-z+w*2.2/y-z+w-2.2*y+z+w+2.2/y+z+w\"\n\"2.2*y-z/w*2.2/y+z/w-2.2/y-z/w+2.2/y-z*w\"\n\"2.2*y/z-w+2.2/y/z-w+2.2*y*z-w-2.2/y*z-w\"\n\"2.2+y*z*w+2.2+y*z/w+2.2+y/z*w-2.2+y/z/w\"\n\"2.2+y*z/w*2.2+y*z*w-2.2+y/z+w+2.2+y/z/w\"\n\"2.2+y+z/w+2.2+y+z*w+2.2+y-z/w-2.2+y-z*w\"\n\"2.2+y-z*w+2.2+y-z/w+2.2+y+z*w-2.2+y+z/w\"\n\"2.2+y-z-w-2.2+y-z-w*2.2+y+z-w*2.2+y+z-w\"\n\"2.2+y/z*w-2.2-y+z/w*2.2-y+z*w*2.2-y-z/w\"\n\"2.2-y+z*w*2.2-y+z/w-2.2-y-z*w+2.2-y-z/w\"\n\"2.2-y-z*w+2.2-y*z/w+2.2-y*z*w-2.2-y/z/w\"\n\"2.2-y-z+w+2.2-y-z+w+2.2-y+z+w-2.2-y+z+w\"\n\"2.2-y/z*w*2.2+y*z-w-2.2-y*z-w+2.2*y*z-w\"\n\"2.2-y/z*w*2.2-y/z/w-2.2-y*z*w+2.2-y*z/w\"\n\"2.2/y*z-w-2.2+y/z-w*2.2-y/z-w*2.2*y/z-w\"\n\"2.2/y+z*w-2.2/y-z*w*2.2*y+z*w*2.2*y-z*w\"\n\"2.2/y/z-w+2.2*y+z*w+2.2*y-z*w-2.2*y+z/w\"\n\"x*3.3*z+w-x/3.3*z+w*x*3.3/z+w*x/3.3/z+w\"\n\"x*3.3+z-w-x/3.3+z-w*x*3.3-z-w*x/3.3-z-w\"\n\"x*3.3-z+w*x/3.3-z+w-x*3.3+z+w+x/3.3+z+w\"\n\"x*3.3-z/w*x/3.3+z/w-x/3.3-z/w+x/3.3-z*w\"\n\"x*3.3/z-w+x/3.3/z-w+x*3.3*z-w-x/3.3*z-w\"\n\"x*y*4.4+w-x/y*4.4+w*x*y/4.4+w*x/y/4.4+w\"\n\"x*y*z+5.5-x/y*z+5.5*x*y/z+5.5*x/y/z+5.5\"\n\"x*y+4.4-w-x/y+4.4-w*x*y-4.4-w*x/y-4.4-w\"\n\"x*y+z-5.5-x/y+z-5.5*x*y-z-5.5*x/y-z-5.5\"\n\"x*y-4.4+w*x/y-4.4+w-x*y+4.4+w+x/y+4.4+w\"\n\"x*y-4.4/w*x/y+4.4/w-x/y-4.4/w+x/y-4.4*w\"\n\"x*y-z+5.5*x/y-z+5.5-x*y+z+5.5+x/y+z+5.5\"\n\"x*y-z/5.5*x/y+z/5.5-x/y-z/5.5+x/y-z*5.5\"\n\"x*y/4.4-w+x/y/4.4-w+x*y*4.4-w-x/y*4.4-w\"\n\"x*y/z-5.5+x/y/z-5.5+x*y*z-5.5-x/y*z-5.5\"\n\"x+3.3*z*w+x+3.3*z/w+x+3.3/z*w-x+3.3/z/w\"\n\"x+3.3*z/w*x+3.3*z*w-x+3.3/z+w+x+3.3/z/w\"\n\"x+3.3+z/w+x+3.3+z*w+x+3.3-z/w-x+3.3-z*w\"\n\"x+3.3-z*w+x+3.3-z/w+x+3.3+z*w-x+3.3+z/w\"\n\"x+3.3-z-w-x+3.3-z-w*x+3.3+z-w*x+3.3+z-w\"\n\"x+3.3/z*w-x-3.3+z/w*x-3.3+z*w*x-3.3-z/w\"\n\"x+y*4.4*w+x+y*4.4/w+x+y/4.4*w-x+y/4.4/w\"\n\"x+y*4.4/w*x+y*4.4*w-x+y/4.4+w+x+y/4.4/w\"\n\"x+y*z*5.5+x+y*z/5.5+x+y/z*5.5-x+y/z/5.5\"\n\"x+y*z/5.5*x+y*z*5.5-x+y/z+5.5+x+y/z/5.5\"\n\"x+y+4.4/w+x+y+4.4*w+x+y-4.4/w-x+y-4.4*w\"\n\"x+y+z/5.5+x+y+z*5.5+x+y-z/5.5-x+y-z*5.5\"\n\"x+y-4.4*w+x+y-4.4/w+x+y+4.4*w-x+y+4.4/w\"\n\"x+y-4.4-w-x+y-4.4-w*x+y+4.4-w*x+y+4.4-w\"\n\"x+y-z*5.5+x+y-z/5.5+x+y+z*5.5-x+y+z/5.5\"\n\"x+y-z-5.5-x+y-z-5.5*x+y+z-5.5*x+y+z-5.5\"\n\"x+y/4.4*w-x-y+4.4/w*x-y+4.4*w*x-y-4.4/w\"\n\"x+y/z*5.5-x-y+z/5.5*x-y+z*5.5*x-y-z/5.5\"\n\"x-3.3+z*w*x-3.3+z/w-x-3.3-z*w+x-3.3-z/w\"\n\"x-3.3-z*w+x-3.3*z/w+x-3.3*z*w-x-3.3/z/w\"\n\"x-3.3-z+w+x-3.3-z+w+x-3.3+z+w-x-3.3+z+w\"\n\"x-3.3/z*w*x+3.3*z-w-x-3.3*z-w+x*3.3*z-w\"\n\"x-3.3/z*w*x-3.3/z/w-x-3.3*z*w+x-3.3*z/w\"\n\"x-y+4.4*w*x-y+4.4/w-x-y-4.4*w+x-y-4.4/w\"\n\"x-y+z*5.5*x-y+z/5.5-x-y-z*5.5+x-y-z/5.5\"\n\"x-y-4.4*w+x-y*4.4/w+x-y*4.4*w-x-y/4.4/w\"\n\"x-y-4.4+w+x-y-4.4+w+x-y+4.4+w-x-y+4.4+w\"\n\"x-y-z*5.5+x-y*z/5.5+x-y*z*5.5-x-y/z/5.5\"\n\"x-y-z+5.5+x-y-z+5.5+x-y+z+5.5-x-y+z+5.5\"\n\"x-y/4.4*w*x+y*4.4-w-x-y*4.4-w+x*y*4.4-w\"\n\"x-y/4.4*w*x-y/4.4/w-x-y*4.4*w+x-y*4.4/w\"\n\"x-y/z*5.5*x+y*z-5.5-x-y*z-5.5+x*y*z-5.5\"\n\"x-y/z*5.5*x-y/z/5.5-x-y*z*5.5+x-y*z/5.5\"\n\"x/3.3*z-w-x+3.3/z-w*x-3.3/z-w*x*3.3/z-w\"\n\"x/3.3+z*w-x/3.3-z*w*x*3.3+z*w*x*3.3-z*w\"\n\"x/3.3/z-w+x*3.3+z*w+x*3.3-z*w-x*3.3+z/w\"\n\"x/y*4.4-w-x+y/4.4-w*x-y/4.4-w*x*y/4.4-w\"\n\"x/y*z-5.5-x+y/z-5.5*x-y/z-5.5*x*y/z-5.5\"\n\"x/y+4.4*w-x/y-4.4*w*x*y+4.4*w*x*y-4.4*w\"\n\"x/y+z*5.5-x/y-z*5.5*x*y+z*5.5*x*y-z*5.5\"\n\"x/y/4.4-w+x*y+4.4*w+x*y-4.4*w-x*y+4.4/w\"\n\"x/y/z-5.5+x*y+z*5.5+x*y-z*5.5-x*y+z/5.5\"\n\"((((((2.34+1.80)/pi)+pi)-0.54)*0.15)-pi)\"\n\"((((a*((((b-1.50)+1.82)-a)/pi))/a)*a)+e)\"\n\"(cos(cos((((cos((b+3.96))-b)+pi)/a)))/e)\"\n\"((((((cos(1.78)/pi)+pi)*a)-b)*2.50)-3.77)\"\n\"(((cos(sin((cos((b/tan(b)))+a)))+a)+a)*e)\"\n\"((b/sin(cos(sin(((cos(pi)+b)+a)))))+2.83)\"\n\"(e+(((((((b+2.05)+a)-2.99)-e)*b)/pi)/pi))\"\n\"((((((((e+pi)-2.53)+a)+pi)+b)*1.84)+pi)+a)\"\n\"(((((((b*(1.69-e))+b)-0.17)+a)-a)+0.20)+e)\"\n\"((((((b/((b*2.74)+e))*e)*b)*1.85)-1.71)/a)\"\n\"(((cos(((((0.78+b)+a)+a)+pi))+e)*3.73)+pi)\"\n\"sin((((tan(sin(((pi/e)+pi)))-2.94)+e)+pi))\"\n\"sin((1.1+2.2/2.2*3.3)*4.4^5.5)+cos(6.6*pi)\"\n\"(((((sin(((0.62*pi)-e))/pi)+3.34)+pi)*b)+e)\"\n\"((((a+((((b-0.68)-pi)/a)+b))+1.47)*e)*1.38)\"\n\"((3.123*y*z+3.123+y/z+3.123+y+z+3.123-y*z))\"\n\"((3.123*y*z-3.123/y*z-3.123/y/z-3.123-y/z))\"\n\"((3.123*y+z*3.123-y*z*3.123+y*z*3.123+y+z))\"\n\"((3.123*y+z*3.123/y*z*3.123/y+z*3.123*y/z))\"\n\"((3.123*y-z/3.123+y*z/3.123+y/z/3.123-y/z))\"\n\"((3.123*y-z/3.123/y+z/3.123/y-z/3.123-y+z))\"\n\"((3.123*y/z+3.123/y-z+3.123/y*z+3.123-y-z))\"\n\"((3.123*y/z-3.123+y+z-3.123+y-z-3.123*y+z))\"\n\"((3.123+y*z*3.123+y+z*3.123-y/z+3.123/y-z))\"\n\"((3.123+y*z-3.123*y/z-3.123*y*z-3.123/y*z))\"\n\"((3.123+y+z+3.123-y*z+3.123*y+z*3.123/y*z))\"\n\"((3.123+y+z/3.123/y+z/3.123/y-z/3.123*y+z))\"\n\"((3.123+y-z*3.123*y*z*3.123/y+z*3.123/y/z))\"\n\"((3.123+y-z-3.123*y+z-3.123*y-z/3.123/y+z))\"\n\"((3.123+y/z+3.123*y-z+3.123*y/z+3.123/y-z))\"\n\"((3.123+y/z/3.123-y/z/3.123-y*z-3.123/y/z))\"\n\"((3.123-y*z-3.123+y-z-3.123+y+z/3.123/y+z))\"\n\"((3.123-y*z-3.123/y/z-3.123/y*z-3.123*y*z))\"\n\"((3.123-y+z*3.123+y-z*3.123+y/z+3.123*y-z))\"\n\"((3.123-y-z/3.123+y/z/3.123+y*z-3.123*y/z))\"\n\"((3.123-y/z+3.123+y*z+3.123+y-z*3.123*y*z))\"\n\"((3.123-y/z+3.123/y-z+3.123/y/z+3.123*y-z))\"\n\"((3.123/y*z+3.123-y-z+3.123-y/z+3.123+y*z))\"\n\"((3.123/y*z-3.123*y*z-3.123*y/z-3.123+y+z))\"\n\"((3.123/y+z*3.123*y/z*3.123-y+z*3.123+y-z))\"\n\"((3.123/y+z*3.123/y/z*3.123*y+z*3.123-y*z))\"\n\"((3.123/y-z/3.123*y+z/3.123*y-z/3.123+y*z))\"\n\"((3.123/y-z/3.123-y+z/3.123-y-z/3.123+y/z))\"\n\"((3.123/y/z+3.123*y-z+3.123*y*z+3.123+y/z))\"\n\"((3.123/y/z-3.123-y/z-3.123-y*z-3.123+y-z))\"\n\"((b+(b+tan(((a+(tan((a/a))+b))+1.81))))+pi)\"\n\"((x*5.123*z+x+5.123/z+x+5.123+z+x-5.123*z))\"\n\"((x*5.123*z-x/5.123*z-x/5.123/z-x-5.123/z))\"\n\"((x*5.123+z*x-5.123*z*x+5.123*z*x+5.123+z))\"\n\"((x*5.123+z*x/5.123*z*x/5.123+z*x*5.123/z))\"\n\"((x*5.123-z/x+5.123*z/x+5.123/z/x-5.123/z))\"\n\"((x*5.123-z/x/5.123+z/x/5.123-z/x-5.123+z))\"\n\"((x*5.123/z+x/5.123-z+x/5.123*z+x-5.123-z))\"\n\"((x*5.123/z-x+5.123+z-x+5.123-z-x*5.123+z))\"\n\"((x*y*7.123+x+y/7.123+x+y+7.123+x-y*7.123))\"\n\"((x*y*7.123-x/y*7.123-x/y/7.123-x-y/7.123))\"\n\"((x*y+7.123*x-y*7.123*x+y*7.123*x+y+7.123))\"\n\"((x*y+7.123*x/y*7.123*x/y+7.123*x*y/7.123))\"\n\"((x*y-7.123/x+y*7.123/x+y/7.123/x-y/7.123))\"\n\"((x*y-7.123/x/y+7.123/x/y-7.123/x-y+7.123))\"\n\"((x*y/7.123+x/y-7.123+x/y*7.123+x-y-7.123))\"\n\"((x*y/7.123-x+y+7.123-x+y-7.123-x*y+7.123))\"\n\"((x+5.123*z*x+5.123+z*x-5.123/z+x/5.123-z))\"\n\"((x+5.123*z-x*5.123/z-x*5.123*z-x/5.123*z))\"\n\"((x+5.123+z+x-5.123*z+x*5.123+z*x/5.123*z))\"\n\"((x+5.123+z/x/5.123+z/x/5.123-z/x*5.123+z))\"\n\"((x+5.123-z*x*5.123*z*x/5.123+z*x/5.123/z))\"\n\"((x+5.123-z-x*5.123+z-x*5.123-z/x/5.123+z))\"\n\"((x+5.123/z+x*5.123-z+x*5.123/z+x/5.123-z))\"\n\"((x+5.123/z/x-5.123/z/x-5.123*z-x/5.123/z))\"\n\"((x+y*7.123*x+y+7.123*x-y/7.123+x/y-7.123))\"\n\"((x+y*7.123-x*y/7.123-x*y*7.123-x/y*7.123))\"\n\"((x+y+7.123+x-y*7.123+x*y+7.123*x/y*7.123))\"\n\"((x+y+7.123/x/y+7.123/x/y-7.123/x*y+7.123))\"\n\"((x+y-7.123*x*y*7.123*x/y+7.123*x/y/7.123))\"\n\"((x+y-7.123-x*y+7.123-x*y-7.123/x/y+7.123))\"\n\"((x+y/7.123+x*y-7.123+x*y/7.123+x/y-7.123))\"\n\"((x+y/7.123/x-y/7.123/x-y*7.123-x/y/7.123))\"\n\"((x-5.123*z-x+5.123-z-x+5.123+z/x/5.123+z))\"\n\"((x-5.123*z-x/5.123/z-x/5.123*z-x*5.123*z))\"\n\"((x-5.123+z*x+5.123-z*x+5.123/z+x*5.123-z))\"\n\"((x-5.123-z/x+5.123/z/x+5.123*z-x*5.123/z))\"\n\"((x-5.123/z+x+5.123*z+x+5.123-z*x*5.123*z))\"\n\"((x-5.123/z+x/5.123-z+x/5.123/z+x*5.123-z))\"\n\"((x-y*7.123-x+y-7.123-x+y+7.123/x/y+7.123))\"\n\"((x-y*7.123-x/y/7.123-x/y*7.123-x*y*7.123))\"\n\"((x-y+7.123*x+y-7.123*x+y/7.123+x*y-7.123))\"\n\"((x-y-7.123/x+y/7.123/x+y*7.123-x*y/7.123))\"\n\"((x-y/7.123+x+y*7.123+x+y-7.123*x*y*7.123))\"\n\"((x-y/7.123+x/y-7.123+x/y/7.123+x*y-7.123))\"\n\"((x/5.123*z+x-5.123-z+x-5.123/z+x+5.123*z))\"\n\"((x/5.123*z-x*5.123*z-x*5.123/z-x+5.123+z))\"\n\"((x/5.123+z*x*5.123/z*x-5.123+z*x+5.123-z))\"\n\"((x/5.123+z*x/5.123/z*x*5.123+z*x-5.123*z))\"\n\"((x/5.123-z/x*5.123+z/x*5.123-z/x+5.123*z))\"\n\"((x/5.123-z/x-5.123+z/x-5.123-z/x+5.123/z))\"\n\"((x/5.123/z+x*5.123-z+x*5.123*z+x+5.123/z))\"\n\"((x/5.123/z-x-5.123/z-x-5.123*z-x+5.123-z))\"\n\"((x/y*7.123+x-y-7.123+x-y/7.123+x+y*7.123))\"\n\"((x/y*7.123-x*y*7.123-x*y/7.123-x+y+7.123))\"\n\"((x/y+7.123*x*y/7.123*x-y+7.123*x+y-7.123))\"\n\"((x/y+7.123*x/y/7.123*x*y+7.123*x-y*7.123))\"\n\"((x/y-7.123/x*y+7.123/x*y-7.123/x+y*7.123))\"\n\"((x/y-7.123/x-y+7.123/x-y-7.123/x+y/7.123))\"\n\"((x/y/7.123+x*y-7.123+x*y*7.123+x+y/7.123))\"\n\"((x/y/7.123-x-y/7.123-x-y*7.123-x+y-7.123))\"\n\"1.1*a^2.01+2.2*b^3.01+3.3*c^4.01+4.4*a^5.01\"\n\"6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"a+(cos(b-sin(2/a*pi))-sin(a-cos(2*b/pi)))-b\"\n\"(((((((((pi*e)*a)-a)+b)*2.76)+a)+a)/0.96)+b)\"\n\"(((((((0.36/2.21)+pi)*pi)-pi)*3.05)*3.32)/b)\"\n\"1.1234567*a^17+2.1234567*b^28+2.1234567*c^38\"\n\"cos((cos(tan((sin((cos(a)/3.44))+1.08)))+b))\"\n\"(((((((((b-a)*e)+b)+pi)*b)+pi)+2.31)/a)-0.23)\"\n\"(((((((((e+1.35)+pi)/pi)-a)+b)-b)+a)/e)+0.81)\"\n\"(((((((7*a+6)*a+5)*a+4)*a+3)*a+2)*a+1)*a+0.1)\"\n\"((((x*y)*z)-(x/(y*z)))-((x/(y/z))-(x-(y/z))))\"\n\"((((x*y)+z)*((x/y)*z))*((x/(y+z))*(x*(y/z))))\"\n\"((((x*y)-z)/(x/(y+z)))/((x/(y-z))/(x-(y+z))))\"\n\"((((x*y)/z)+(x/(y-z)))+((x/(y*z))+(x-(y-z))))\"\n\"((((x+y)*z)-((x*y)/z))-(((x*y)*z)-(x/(y*z))))\"\n\"((((x+y)+z)/((x/y)+z))/(((x/y)-z)/(x*(y+z))))\"\n\"((((x+y)-z)*((x*y)*z))*(((x/y)+z)*(x/(y/z))))\"\n\"((((x+y)/z)+((x*y)-z))+(((x*y)/z)+(x/(y-z))))\"\n\"((((x-y)*z)-((x/y)/z))-(((x/y)*z)-(x*(y*z))))\"\n\"((((x-y)/z)+((x/y)-z))+(((x/y)/z)+(x*(y-z))))\"\n\"((((x/y)*z)-(x*(y*z)))-((x*(y/z))-(x+(y+z))))\"\n\"((((x/y)+z)*(x/(y/z)))*((x*(y+z))*(x-(y*z))))\"\n\"((((x/y)-z)/(x*(y+z)))/((x*(y-z))/(x+(y*z))))\"\n\"((((x/y)/z)+(x*(y-z)))+((x*(y*z))+(x+(y/z))))\"\n\"(((x*(y*z))+(x+(y/z)))+((x+(y+z))+((x-y)*z)))\"\n\"(((x*(y+z))*(x-(y*z)))*((x+(y*z))*((x+y)+z)))\"\n\"(((x*(y-z))/(x+(y*z)))/((x+(y/z))/((x-y)/z)))\"\n\"(((x*(y/z))-(x+(y+z)))-((x+(y-z))-((x*y)+z)))\"\n\"(((x+(y*z))*((x+y)+z))*(((x-y)/z)+((x/y)-z)))\"\n\"(((x+(y+z))+((x-y)*z))+(((x*y)+z)*((x/y)*z)))\"\n\"(((x+(y-z))-((x*y)+z))-(((x*y)-z)/(x/(y+z))))\"\n\"(((x+(y/z))/((x-y)/z))/(((x-y)*z)-((x/y)/z)))\"\n\"(((x-(y*z))-((x+y)-z))-(((x+y)+z)/((x/y)+z)))\"\n\"(((x-(y+z))*(x+(y-z)))*(((x+y)/z)+((x*y)-z)))\"\n\"(((x-(y-z))/((x+y)/z))/(((x+y)*z)-((x*y)/z)))\"\n\"(((x-(y/z))+((x+y)*z))+(((x+y)-z)*((x*y)*z)))\"\n\"(((x/(y*z))+(x-(y-z)))+((x-(y/z))+((x+y)*z)))\"\n\"(((x/(y+z))*(x*(y/z)))*((x-(y+z))*(x+(y-z))))\"\n\"(((x/(y-z))/(x-(y+z)))/((x-(y-z))/((x+y)/z)))\"\n\"(((x/(y/z))-(x-(y/z)))-((x-(y*z))-((x+y)-z)))\"\n\"((b+((((((((b/a)+e)+b)+pi)+a)+2.71)+a)+b))*e)\"\n\"7*a^7+6*a^6+5*a^5+4*a^4+3*a^3+2*a^2+1*a^1+0.1\"\n\"((((((((((1.36*e)+b)+pi)*pi)/b)+a)-a)+a)+a)+a)\"\n\"((((((((0.68-1.49)/e)+a)+pi)*b)+0.75)+b)/2.78)\"\n\"((((tan(tan((e*(cos(3.57)+b))))-a)*a)+a)+0.45)\"\n\"(b/((((tan((cos(((b+b)/b))+e))-b)+2.15)*e)+b))\"\n\"(cos((((1.45*(((3.50+1.35)-a)+e))*b)/a))+2.02)\"\n\"(((((((((a+a)*1.53)+a)-a)+b)/b)*0.18)+0.61)+pi)\"\n\"((((((((a/b)*1.1)*2.2)*3.3)*4.4)*5.5)*6.6)*7.7)\"\n\"((((((((a/b)+1.1)+2.2)+3.3)+4.4)+5.5)+6.6)+7.7)\"\n\"((0.09*((((a-(((a-0.88)*b)+1.92))+pi)+a)-a))*b)\"\n\"((a/cos((cos(((tan(cos(e))+a)/3.36))/0.05)))*e)\"\n\"(1.1*(2.2*(3.3*(4.4*(5.5*(6.6*(7.7*(a+b))))))))\"\n\"(1.1+(2.2+(3.3+(4.4+(5.5+(6.6+(7.7+(a*b))))))))\"\n\"1.1*x^2+2.2*1.1/y^3-2.2-1.1*x^2+2.2+1.1/y^3-2.2\"\n\"1.1*x^2+2.2*1.1/y^3-2.2-1.1*x^2+2.2-1.1/y^3-2.2\"\n\"1.1*x^2+2.2+1.1/y^3-2.2*1.1*x^2+2.2*1.1/y^3-2.2\"\n\"1.1*x^2+2.2+1.1/y^3-2.2*1.1*x^2+2.2-1.1/y^3-2.2\"\n\"1.1*x^2+2.2-1.1/y^3-2.2+1.1*x^2+2.2*1.1/y^3-2.2\"\n\"1.1*x^2+2.2-1.1/y^3-2.2+1.1*x^2+2.2+1.1/y^3-2.2\"\n\"cos(((1.09+(pi+((cos(((b+e)+pi))+a)+e)))+1.35))\"\n\"x*y/z-x*y*z*x/y+z*x/y-z*x/y/z+x/y*z+x/y+z-x/y-z\"\n\"x+y/z+x+y*z+x+y-z-x+y+z+x-y/z*x-y*z-x*y+z+x*y-z\"\n\"x/y*z*x/y/z-x*y+z+x*y-z-x*y*z-x*y/z*x-y/z*x-y/z\"\n\"((((((((((b-e)/pi)*a)*b)/a)+a)+e)+b)/1.63)-3.35)\"\n\"(((((sin(((e*((a+a)/0.23))-b))+a)+b)+a)-3.93)+a)\"\n\"((((pi*(((pi+(((a-e)*b)+1.99))+a)/b))+pi)+pi)+a)\"\n\"(3.90-((b+((((((pi+b)+2.55)+b)+pi)+3.80)*a))-e))\"\n\"(pi+((((((((2.93*1.77)/a)-pi)*e)+e)+e)/a)+2.61))\"\n\"(pi-tan(((cos((((((a*b)*a)*b)*pi)+1.80))-b)/b)))\"\n\"(((((((((b-0.79)+2.44)+b)+2.13)/3.71)-b)+a)-a)+a)\"\n\"(tan(sin(sin((((((pi+pi)*a)+3.56)+b)+pi))))+1.50)\"\n\"((((tan((a+((((e+3.01)/e)*b)-0.93)))*pi)+pi)/a)-b)\"\n\"(e+(tan(((((((e+3.54)+2.95)+b)/1.72)+1.01)-e))+b))\"\n\"cos((((tan(tan(((b+((3.89-b)-a))/3.42)))+a)/a)+b))\"\n\"cos(tan(((((((a/cos(pi))*e)-e)-2.89)+2.65)-1.24)))\"\n\"((((((((((e+a)/1.07)*e)*e)/pi)+0.02)+a)/a)*b)+2.61)\"\n\"((3.123*y*z+w+3.123+y/z/w+3.123+y/z+w*3.123*y+z*w))\"\n\"((3.123*y*z-w*3.123-y*z/w*3.123-y-z*w+3.123/y-z*w))\"\n\"((3.123*y*z-w/3.123+y+z*w/3.123+y-z/w-3.123*y+z-w))\"\n\"((3.123*y+z*w*3.123/y-z+w*3.123*y-z+w+3.123/y/z+w))\"\n\"((3.123*y+z*w-3.123+y-z-w-3.123-y-z/w/3.123+y/z*w))\"\n\"((3.123*y+z+w*3.123/y/z-w*3.123*y/z-w+3.123-y-z/w))\"\n\"((3.123*y+z-w+3.123/y*z-w+3.123*y*z-w*3.123-y*z/w))\"\n\"((3.123*y+z/w/3.123+y*z-w/3.123+y+z-w-3.123-y/z*w))\"\n\"((3.123*y-z*w*3.123+y+z-w*3.123+y-z-w+3.123+y/z/w))\"\n\"((3.123*y-z*w/3.123*y+z+w/3.123/y-z+w-3.123*y/z-w))\"\n\"((3.123*y-z+w+3.123/y/z+w+3.123*y/z+w*3.123-y+z/w))\"\n\"((3.123*y-z-w*3.123-y*z/w*3.123+y*z/w+3.123-y/z/w))\"\n\"((3.123*y-z/w+3.123+y/z-w+3.123+y*z-w*3.123-y/z/w))\"\n\"((3.123*y/z+w*3.123-y+z/w*3.123+y/z*w+3.123*y+z/w))\"\n\"((3.123*y/z-w+3.123-y-z/w+3.123-y+z*w*3.123/y+z/w))\"\n\"((3.123*y/z-w/3.123-y-z*w/3.123-y+z/w-3.123+y*z*w))\"\n\"((3.123+y*z*w+3.123-y/z*w+3.123+y/z*w*3.123+y*z-w))\"\n\"((3.123+y*z*w-3.123/y/z-w-3.123*y/z-w/3.123-y-z*w))\"\n\"((3.123+y*z-w*3.123-y/z/w*3.123-y/z*w+3.123+y-z*w))\"\n\"((3.123+y*z-w-3.123+y-z*w-3.123*y-z*w/3.123*y+z+w))\"\n\"((3.123+y*z/w+3.123*y/z-w+3.123-y/z-w*3.123-y+z/w))\"\n\"((3.123+y*z/w+3.123-y/z/w+3.123-y*z*w*3.123/y-z*w))\"\n\"((3.123+y*z/w-3.123+y+z/w-3.123-y/z*w/3.123-y*z-w))\"\n\"((3.123+y+z*w*3.123/y+z-w*3.123*y+z-w+3.123/y*z-w))\"\n\"((3.123+y+z*w-3.123/y*z-w-3.123*y*z-w/3.123+y+z*w))\"\n\"((3.123+y+z-w-3.123-y/z*w-3.123+y/z/w/3.123+y-z/w))\"\n\"((3.123+y+z/w+3.123*y*z-w+3.123-y*z-w*3.123+y-z/w))\"\n\"((3.123+y+z/w/3.123*y-z-w/3.123/y+z-w-3.123+y*z/w))\"\n\"((3.123+y-z*w+3.123/y+z+w+3.123*y+z+w*3.123/y/z-w))\"\n\"((3.123+y-z*w/3.123-y/z-w/3.123+y/z-w-3.123-y+z*w))\"\n\"((3.123+y-z-w+3.123+y/z/w+3.123+y/z*w*3.123+y+z*w))\"\n\"((3.123+y-z/w*3.123+y/z-w*3.123/y*z-w+3.123+y+z/w))\"\n\"((3.123+y-z/w-3.123*y+z-w-3.123/y+z+w/3.123*y*z-w))\"\n\"((3.123+y/z*w*3.123+y*z-w*3.123-y/z*w+3.123*y-z*w))\"\n\"((3.123+y/z*w*3.123+y+z*w*3.123+y+z/w+3.123*y*z-w))\"\n\"((3.123+y/z*w+3.123*y+z/w+3.123*y-z*w*3.123+y+z-w))\"\n\"((3.123+y/z+w*3.123*y+z*w*3.123/y/z-w+3.123-y-z/w))\"\n\"((3.123+y/z-w-3.123-y+z*w-3.123+y+z/w/3.123*y-z-w))\"\n\"((3.123+y/z-w/3.123-y*z*w/3.123-y/z/w-3.123+y*z/w))\"\n\"((3.123+y/z/w/3.123*y-z*w/3.123*y+z*w-3.123+y-z-w))\"\n\"((3.123+y/z/w/3.123+y-z/w/3.123+y+z*w-3.123/y*z-w))\"\n\"((3.123-y*z*w*3.123+y*z*w*3.123+y*z/w+3.123*y/z-w))\"\n\"((3.123-y*z*w*3.123/y-z*w*3.123/y+z*w+3.123-y/z+w))\"\n\"((3.123-y*z+w*3.123/y*z+w*3.123*y*z+w+3.123+y/z/w))\"\n\"((3.123-y*z-w*3.123+y-z/w*3.123+y-z*w+3.123/y+z+w))\"\n\"((3.123-y*z/w-3.123-y/z*w-3.123-y/z/w/3.123*y+z*w))\"\n\"((3.123-y*z/w-3.123/y+z*w-3.123/y-z*w/3.123-y*z+w))\"\n\"((3.123-y*z/w/3.123+y/z+w/3.123+y*z*w-3.123/y/z-w))\"\n\"((3.123-y+z*w*3.123/y+z/w*3.123*y-z/w+3.123+y/z-w))\"\n\"((3.123-y+z*w+3.123/y-z-w+3.123*y-z-w*3.123-y*z/w))\"\n\"((3.123-y+z+w-3.123*y*z+w-3.123-y*z/w/3.123+y/z+w))\"\n\"((3.123-y+z/w-3.123*y-z/w-3.123*y+z/w/3.123+y*z-w))\"\n\"((3.123-y+z/w-3.123+y*z*w-3.123/y-z-w/3.123+y/z*w))\"\n\"((3.123-y-z*w*3.123+y*z/w*3.123+y*z*w+3.123-y/z*w))\"\n\"((3.123-y-z*w+3.123/y-z*w+3.123/y-z/w*3.123-y+z+w))\"\n\"((3.123-y-z+w+3.123-y*z/w+3.123-y*z*w*3.123+y*z*w))\"\n\"((3.123-y-z/w/3.123+y/z*w/3.123+y*z/w-3.123+y+z/w))\"\n\"((3.123-y-z/w/3.123/y-z/w/3.123/y+z/w-3.123-y-z+w))\"\n\"((3.123-y/z*w+3.123*y-z*w+3.123*y+z*w*3.123/y-z+w))\"\n\"((3.123-y/z*w+3.123+y-z*w+3.123+y-z/w*3.123+y/z-w))\"\n\"((3.123-y/z*w/3.123-y*z-w/3.123+y*z-w-3.123+y-z*w))\"\n\"((3.123-y/z+w/3.123*y/z+w/3.123/y*z+w-3.123+y/z*w))\"\n\"((3.123-y/z-w*3.123-y+z/w*3.123-y+z*w+3.123/y-z-w))\"\n\"((3.123-y/z/w-3.123+y*z/w-3.123+y-z*w/3.123-y/z-w))\"\n\"((3.123-y/z/w/3.123*y+z*w/3.123/y-z*w-3.123*y-z+w))\"\n\"((3.123/y*z+w-3.123+y/z*w-3.123+y/z/w/3.123*y-z*w))\"\n\"((3.123/y*z-w+3.123+y+z/w+3.123+y+z*w*3.123/y+z-w))\"\n\"((3.123/y*z-w/3.123-y*z*w/3.123-y*z/w-3.123/y+z*w))\"\n\"((3.123/y+z*w+3.123-y/z+w+3.123-y*z+w*3.123/y*z+w))\"\n\"((3.123/y+z+w/3.123*y*z-w/3.123/y/z-w-3.123-y-z*w))\"\n\"((3.123/y+z-w-3.123+y*z/w-3.123/y*z-w/3.123-y*z*w))\"\n\"((3.123/y+z/w-3.123-y-z+w-3.123+y/z-w/3.123-y*z*w))\"\n\"((3.123/y-z*w-3.123*y-z+w-3.123-y/z+w/3.123*y/z+w))\"\n\"((3.123/y-z*w/3.123-y*z+w/3.123-y+z+w-3.123*y*z+w))\"\n\"((3.123/y-z+w-3.123*y/z-w-3.123/y/z+w/3.123-y+z*w))\"\n\"((3.123/y-z-w/3.123+y/z*w/3.123-y*z/w-3.123-y/z*w))\"\n\"((3.123/y-z/w*3.123-y+z+w*3.123-y-z+w+3.123-y*z/w))\"\n\"((3.123/y/z+w/3.123-y+z*w/3.123-y+z/w-3.123*y-z/w))\"\n\"((3.123/y/z-w+3.123-y-z/w+3.123-y-z*w*3.123+y*z/w))\"\n\"((3.123/y/z-w-3.123-y-z*w-3.123-y-z/w/3.123/y-z/w))\"\n\"((pi+(0.76+(sin((tan(cos((e/0.36)))*1.15))*e)))*pi)\"\n\"((x*5.123*z+w+x+5.123/z/w+x+5.123/z+w*x*5.123+z*w))\"\n\"((x*5.123*z-w*x-5.123*z/w*x-5.123-z*w+x/5.123-z*w))\"\n\"((x*5.123*z-w/x+5.123+z*w/x+5.123-z/w-x*5.123+z-w))\"\n\"((x*5.123+z*w*x/5.123-z+w*x*5.123-z+w+x/5.123/z+w))\"\n\"((x*5.123+z*w-x+5.123-z-w-x-5.123-z/w/x+5.123/z*w))\"\n\"((x*5.123+z+w*x/5.123/z-w*x*5.123/z-w+x-5.123-z/w))\"\n\"((x*5.123+z-w+x/5.123*z-w+x*5.123*z-w*x-5.123*z/w))\"\n\"((x*5.123+z/w/x+5.123*z-w/x+5.123+z-w-x-5.123/z*w))\"\n\"((x*5.123-z*w*x+5.123+z-w*x+5.123-z-w+x+5.123/z/w))\"\n\"((x*5.123-z*w/x*5.123+z+w/x/5.123-z+w-x*5.123/z-w))\"\n\"((x*5.123-z+w+x/5.123/z+w+x*5.123/z+w*x-5.123+z/w))\"\n\"((x*5.123-z-w*x-5.123*z/w*x+5.123*z/w+x-5.123/z/w))\"\n\"((x*5.123-z/w+x+5.123/z-w+x+5.123*z-w*x-5.123/z/w))\"\n\"((x*5.123/z+w*x-5.123+z/w*x+5.123/z*w+x*5.123+z/w))\"\n\"((x*5.123/z-w+x-5.123-z/w+x-5.123+z*w*x/5.123+z/w))\"\n\"((x*5.123/z-w/x-5.123-z*w/x-5.123+z/w-x+5.123*z*w))\"\n\"((x*y*7.123+w+x+y/7.123/w+x+y/7.123+w*x*y+7.123*w))\"\n\"((x*y*7.123-w*x-y*7.123/w*x-y-7.123*w+x/y-7.123*w))\"\n\"((x*y*7.123-w/x+y+7.123*w/x+y-7.123/w-x*y+7.123-w))\"\n\"((x*y*z+9.123+x+y/z/9.123+x+y/z+9.123*x*y+z*9.123))\"\n\"((x*y*z+x+y/z+x+y+z+x-y*z+x+y-z-x*y+z-x*y-z/x/y+z))\"\n\"((x*y*z-9.123*x-y*z/9.123*x-y-z*9.123+x/y-z*9.123))\"\n\"((x*y*z-9.123/x+y+z*9.123/x+y-z/9.123-x*y+z-9.123))\"\n\"((x*y*z-x/y*z-x/y/z-x-y/z-x*y+z*x-y*z*x+y*z*x+y+z))\"\n\"((x*y+7.123*w*x/y-7.123+w*x*y-7.123+w+x/y/7.123+w))\"\n\"((x*y+7.123*w-x+y-7.123-w-x-y-7.123/w/x+y/7.123*w))\"\n\"((x*y+7.123+w*x/y/7.123-w*x*y/7.123-w+x-y-7.123/w))\"\n\"((x*y+7.123-w+x/y*7.123-w+x*y*7.123-w*x-y*7.123/w))\"\n\"((x*y+7.123/w/x+y*7.123-w/x+y+7.123-w-x-y/7.123*w))\"\n\"((x*y+z*9.123*x/y-z+9.123*x*y-z+9.123+x/y/z+9.123))\"\n\"((x*y+z*9.123-x+y-z-9.123-x-y-z/9.123/x+y/z*9.123))\"\n\"((x*y+z*x-y*z*x+y*z*x+y+z*x+y/z/x-y/z/x-y*z-x/y/z))\"\n\"((x*y+z*x/y*z*x/y+z*x*y/z*x/y-z/x-y+z/x-y-z/x+y/z))\"\n\"((x*y+z+9.123*x/y/z-9.123*x*y/z-9.123+x-y-z/9.123))\"\n\"((x*y+z-9.123+x/y*z-9.123+x*y*z-9.123*x-y*z/9.123))\"\n\"((x*y+z/9.123/x+y*z-9.123/x+y+z-9.123-x-y/z*9.123))\"\n\"((x*y-7.123*w*x+y+7.123-w*x+y-7.123-w+x+y/7.123/w))\"\n\"((x*y-7.123*w/x*y+7.123+w/x/y-7.123+w-x*y/7.123-w))\"\n\"((x*y-7.123+w+x/y/7.123+w+x*y/7.123+w*x-y+7.123/w))\"\n\"((x*y-7.123-w*x-y*7.123/w*x+y*7.123/w+x-y/7.123/w))\"\n\"((x*y-7.123/w+x+y/7.123-w+x+y*7.123-w*x-y/7.123/w))\"\n\"((x*y-z*9.123*x+y+z-9.123*x+y-z-9.123+x+y/z/9.123))\"\n\"((x*y-z*9.123/x*y+z+9.123/x/y-z+9.123-x*y/z-9.123))\"\n\"((x*y-z+9.123+x/y/z+9.123+x*y/z+9.123*x-y+z/9.123))\"\n\"((x*y-z-9.123*x-y*z/9.123*x+y*z/9.123+x-y/z/9.123))\"\n\"((x*y-z/9.123+x+y/z-9.123+x+y*z-9.123*x-y/z/9.123))\"\n\"((x*y-z/x+y*z/x+y/z/x-y/z/x+y+z+x-y*z+x*y+z*x/y*z))\"\n\"((x*y-z/x/y+z/x/y-z/x-y+z/x/y*z+x-y-z+x-y/z+x+y*z))\"\n\"((x*y/7.123+w*x-y+7.123/w*x+y/7.123*w+x*y+7.123/w))\"\n\"((x*y/7.123-w+x-y-7.123/w+x-y+7.123*w*x/y+7.123/w))\"\n\"((x*y/7.123-w/x-y-7.123*w/x-y+7.123/w-x+y*7.123*w))\"\n\"((x*y/z+9.123*x-y+z/9.123*x+y/z*9.123+x*y+z/9.123))\"\n\"((x*y/z+x/y-z+x/y*z+x-y-z+x/y/z-x-y/z-x-y*z-x+y-z))\"\n\"((x*y/z-9.123+x-y-z/9.123+x-y+z*9.123*x/y+z/9.123))\"\n\"((x*y/z-9.123/x-y-z*9.123/x-y+z/9.123-x+y*z*9.123))\"\n\"((x*y/z-x+y+z-x+y-z-x*y+z-x+y/z+x*y-z+x*y/z+x/y-z))\"\n\"((x+5.123*z*w+x-5.123/z*w+x+5.123/z*w*x+5.123*z-w))\"\n\"((x+5.123*z*w-x/5.123/z-w-x*5.123/z-w/x-5.123-z*w))\"\n\"((x+5.123*z-w*x-5.123/z/w*x-5.123/z*w+x+5.123-z*w))\"\n\"((x+5.123*z-w-x+5.123-z*w-x*5.123-z*w/x*5.123+z+w))\"\n\"((x+5.123*z/w+x*5.123/z-w+x-5.123/z-w*x-5.123+z/w))\"\n\"((x+5.123*z/w+x-5.123/z/w+x-5.123*z*w*x/5.123-z*w))\"\n\"((x+5.123*z/w-x+5.123+z/w-x-5.123/z*w/x-5.123*z-w))\"\n\"((x+5.123+z*w*x/5.123+z-w*x*5.123+z-w+x/5.123*z-w))\"\n\"((x+5.123+z*w-x/5.123*z-w-x*5.123*z-w/x+5.123+z*w))\"\n\"((x+5.123+z-w-x-5.123/z*w-x+5.123/z/w/x+5.123-z/w))\"\n\"((x+5.123+z/w+x*5.123*z-w+x-5.123*z-w*x+5.123-z/w))\"\n\"((x+5.123+z/w/x*5.123-z-w/x/5.123+z-w-x+5.123*z/w))\"\n\"((x+5.123-z*w+x/5.123+z+w+x*5.123+z+w*x/5.123/z-w))\"\n\"((x+5.123-z*w/x-5.123/z-w/x+5.123/z-w-x-5.123+z*w))\"\n\"((x+5.123-z-w+x+5.123/z/w+x+5.123/z*w*x+5.123+z*w))\"\n\"((x+5.123-z/w*x+5.123/z-w*x/5.123*z-w+x+5.123+z/w))\"\n\"((x+5.123-z/w-x*5.123+z-w-x/5.123+z+w/x*5.123*z-w))\"\n\"((x+5.123/z*w*x+5.123*z-w*x-5.123/z*w+x*5.123-z*w))\"\n\"((x+5.123/z*w*x+5.123+z*w*x+5.123+z/w+x*5.123*z-w))\"\n\"((x+5.123/z*w+x*5.123+z/w+x*5.123-z*w*x+5.123+z-w))\"\n\"((x+5.123/z+w*x*5.123+z*w*x/5.123/z-w+x-5.123-z/w))\"\n\"((x+5.123/z-w-x-5.123+z*w-x+5.123+z/w/x*5.123-z-w))\"\n\"((x+5.123/z-w/x-5.123*z*w/x-5.123/z/w-x+5.123*z/w))\"\n\"((x+5.123/z/w/x*5.123-z*w/x*5.123+z*w-x+5.123-z-w))\"\n\"((x+5.123/z/w/x+5.123-z/w/x+5.123+z*w-x/5.123*z-w))\"\n\"((x+y*7.123*w+x-y/7.123*w+x+y/7.123*w*x+y*7.123-w))\"\n\"((x+y*7.123*w-x/y/7.123-w-x*y/7.123-w/x-y-7.123*w))\"\n\"((x+y*7.123-w*x-y/7.123/w*x-y/7.123*w+x+y-7.123*w))\"\n\"((x+y*7.123-w-x+y-7.123*w-x*y-7.123*w/x*y+7.123+w))\"\n\"((x+y*7.123/w+x*y/7.123-w+x-y/7.123-w*x-y+7.123/w))\"\n\"((x+y*7.123/w+x-y/7.123/w+x-y*7.123*w*x/y-7.123*w))\"\n\"((x+y*7.123/w-x+y+7.123/w-x-y/7.123*w/x-y*7.123-w))\"\n\"((x+y*z*9.123+x-y/z*9.123+x+y/z*9.123*x+y*z-9.123))\"\n\"((x+y*z*9.123-x/y/z-9.123-x*y/z-9.123/x-y-z*9.123))\"\n\"((x+y*z*x+y+z*x-y/z+x/y-z*x-y*z-x/y/z-x/y*z-x*y*z))\"\n\"((x+y*z-9.123*x-y/z/9.123*x-y/z*9.123+x+y-z*9.123))\"\n\"((x+y*z-9.123-x+y-z*9.123-x*y-z*9.123/x*y+z+9.123))\"\n\"((x+y*z-x*y/z-x*y*z-x/y*z-x/y+z*x/y/z*x*y+z*x-y*z))\"\n\"((x+y*z/9.123+x*y/z-9.123+x-y/z-9.123*x-y+z/9.123))\"\n\"((x+y*z/9.123+x-y/z/9.123+x-y*z*9.123*x/y-z*9.123))\"\n\"((x+y*z/9.123-x+y+z/9.123-x-y/z*9.123/x-y*z-9.123))\"\n\"((x+y+7.123*w*x/y+7.123-w*x*y+7.123-w+x/y*7.123-w))\"\n\"((x+y+7.123*w-x/y*7.123-w-x*y*7.123-w/x+y+7.123*w))\"\n\"((x+y+7.123-w-x-y/7.123*w-x+y/7.123/w/x+y-7.123/w))\"\n\"((x+y+7.123/w+x*y*7.123-w+x-y*7.123-w*x+y-7.123/w))\"\n\"((x+y+7.123/w/x*y-7.123-w/x/y+7.123-w-x+y*7.123/w))\"\n\"((x+y+z*9.123*x/y+z-9.123*x*y+z-9.123+x/y*z-9.123))\"\n\"((x+y+z*9.123-x/y*z-9.123-x*y*z-9.123/x+y+z*9.123))\"\n\"((x+y+z+x-y*z+x*y+z*x/y*z+x*y-z/x/y+z/x/y-z/x-y+z))\"\n\"((x+y+z-9.123-x-y/z*9.123-x+y/z/9.123/x+y-z/9.123))\"\n\"((x+y+z/9.123+x*y*z-9.123+x-y*z-9.123*x+y-z/9.123))\"\n\"((x+y+z/9.123/x*y-z-9.123/x/y+z-9.123-x+y*z/9.123))\"\n\"((x+y+z/x/y+z/x/y-z/x*y+z/x/y/z+x*y-z+x*y*z+x+y/z))\"\n\"((x+y-7.123*w+x/y+7.123+w+x*y+7.123+w*x/y/7.123-w))\"\n\"((x+y-7.123*w/x-y/7.123-w/x+y/7.123-w-x-y+7.123*w))\"\n\"((x+y-7.123-w+x+y/7.123/w+x+y/7.123*w*x+y+7.123*w))\"\n\"((x+y-7.123/w*x+y/7.123-w*x/y*7.123-w+x+y+7.123/w))\"\n\"((x+y-7.123/w-x*y+7.123-w-x/y+7.123+w/x*y*7.123-w))\"\n\"((x+y-z*9.123+x/y+z+9.123+x*y+z+9.123*x/y/z-9.123))\"\n\"((x+y-z*9.123/x-y/z-9.123/x+y/z-9.123-x-y+z*9.123))\"\n\"((x+y-z*x*y*z*x/y+z*x/y/z*x/y-z/x*y+z/x*y-z/x+y*z))\"\n\"((x+y-z-9.123+x+y/z/9.123+x+y/z*9.123*x+y+z*9.123))\"\n\"((x+y-z-x*y+z-x*y-z/x/y+z-x*y/z+x/y-z+x/y*z+x-y-z))\"\n\"((x+y-z/9.123*x+y/z-9.123*x/y*z-9.123+x+y+z/9.123))\"\n\"((x+y-z/9.123-x*y+z-9.123-x/y+z+9.123/x*y*z-9.123))\"\n\"((x+y/7.123*w*x+y*7.123-w*x-y/7.123*w+x*y-7.123*w))\"\n\"((x+y/7.123*w*x+y+7.123*w*x+y+7.123/w+x*y*7.123-w))\"\n\"((x+y/7.123*w+x*y+7.123/w+x*y-7.123*w*x+y+7.123-w))\"\n\"((x+y/7.123+w*x*y+7.123*w*x/y/7.123-w+x-y-7.123/w))\"\n\"((x+y/7.123-w-x-y+7.123*w-x+y+7.123/w/x*y-7.123-w))\"\n\"((x+y/7.123-w/x-y*7.123*w/x-y/7.123/w-x+y*7.123/w))\"\n\"((x+y/7.123/w/x*y-7.123*w/x*y+7.123*w-x+y-7.123-w))\"\n\"((x+y/7.123/w/x+y-7.123/w/x+y+7.123*w-x/y*7.123-w))\"\n\"((x+y/z*9.123*x+y*z-9.123*x-y/z*9.123+x*y-z*9.123))\"\n\"((x+y/z*9.123*x+y+z*9.123*x+y+z/9.123+x*y*z-9.123))\"\n\"((x+y/z*9.123+x*y+z/9.123+x*y-z*9.123*x+y+z-9.123))\"\n\"((x+y/z+9.123*x*y+z*9.123*x/y/z-9.123+x-y-z/9.123))\"\n\"((x+y/z+x*y-z+x*y/z+x/y-z+x*y*z-x/y*z-x/y/z-x-y/z))\"\n\"((x+y/z-9.123-x-y+z*9.123-x+y+z/9.123/x*y-z-9.123))\"\n\"((x+y/z-9.123/x-y*z*9.123/x-y/z/9.123-x+y*z/9.123))\"\n\"((x+y/z/9.123/x*y-z*9.123/x*y+z*9.123-x+y-z-9.123))\"\n\"((x+y/z/9.123/x+y-z/9.123/x+y+z*9.123-x/y*z-9.123))\"\n\"((x+y/z/x-y/z/x-y*z-x/y/z/x*y+z*x/y*z*x/y+z*x*y/z))\"\n\"((x-5.123*z*w*x+5.123*z*w*x+5.123*z/w+x*5.123/z-w))\"\n\"((x-5.123*z*w*x/5.123-z*w*x/5.123+z*w+x-5.123/z+w))\"\n\"((x-5.123*z+w*x/5.123*z+w*x*5.123*z+w+x+5.123/z/w))\"\n\"((x-5.123*z-w*x+5.123-z/w*x+5.123-z*w+x/5.123+z+w))\"\n\"((x-5.123*z/w-x-5.123/z*w-x-5.123/z/w/x*5.123+z*w))\"\n\"((x-5.123*z/w-x/5.123+z*w-x/5.123-z*w/x-5.123*z+w))\"\n\"((x-5.123*z/w/x+5.123/z+w/x+5.123*z*w-x/5.123/z-w))\"\n\"((x-5.123+z*w*x/5.123+z/w*x*5.123-z/w+x+5.123/z-w))\"\n\"((x-5.123+z*w+x/5.123-z-w+x*5.123-z-w*x-5.123*z/w))\"\n\"((x-5.123+z+w-x*5.123*z+w-x-5.123*z/w/x+5.123/z+w))\"\n\"((x-5.123+z/w-x*5.123-z/w-x*5.123+z/w/x+5.123*z-w))\"\n\"((x-5.123+z/w-x+5.123*z*w-x/5.123-z-w/x+5.123/z*w))\"\n\"((x-5.123-z*w*x+5.123*z/w*x+5.123*z*w+x-5.123/z*w))\"\n\"((x-5.123-z*w+x/5.123-z*w+x/5.123-z/w*x-5.123+z+w))\"\n\"((x-5.123-z+w+x-5.123*z/w+x-5.123*z*w*x+5.123*z*w))\"\n\"((x-5.123-z/w/x+5.123/z*w/x+5.123*z/w-x+5.123+z/w))\"\n\"((x-5.123-z/w/x/5.123-z/w/x/5.123+z/w-x-5.123-z+w))\"\n\"((x-5.123/z*w+x*5.123-z*w+x*5.123+z*w*x/5.123-z+w))\"\n\"((x-5.123/z*w+x+5.123-z*w+x+5.123-z/w*x+5.123/z-w))\"\n\"((x-5.123/z*w/x-5.123*z-w/x+5.123*z-w-x+5.123-z*w))\"\n\"((x-5.123/z+w/x*5.123/z+w/x/5.123*z+w-x+5.123/z*w))\"\n\"((x-5.123/z-w*x-5.123+z/w*x-5.123+z*w+x/5.123-z-w))\"\n\"((x-5.123/z/w-x+5.123*z/w-x+5.123-z*w/x-5.123/z-w))\"\n\"((x-5.123/z/w/x*5.123+z*w/x/5.123-z*w-x*5.123-z+w))\"\n\"((x-y*7.123*w*x+y*7.123*w*x+y*7.123/w+x*y/7.123-w))\"\n\"((x-y*7.123*w*x/y-7.123*w*x/y+7.123*w+x-y/7.123+w))\"\n\"((x-y*7.123+w*x/y*7.123+w*x*y*7.123+w+x+y/7.123/w))\"\n\"((x-y*7.123-w*x+y-7.123/w*x+y-7.123*w+x/y+7.123+w))\"\n\"((x-y*7.123/w-x-y/7.123*w-x-y/7.123/w/x*y+7.123*w))\"\n\"((x-y*7.123/w-x/y+7.123*w-x/y-7.123*w/x-y*7.123+w))\"\n\"((x-y*7.123/w/x+y/7.123+w/x+y*7.123*w-x/y/7.123-w))\"\n\"((x-y*z*9.123*x+y*z*9.123*x+y*z/9.123+x*y/z-9.123))\"\n\"((x-y*z*9.123*x/y-z*9.123*x/y+z*9.123+x-y/z+9.123))\"\n\"((x-y*z+9.123*x/y*z+9.123*x*y*z+9.123+x+y/z/9.123))\"\n\"((x-y*z-9.123*x+y-z/9.123*x+y-z*9.123+x/y+z+9.123))\"\n\"((x-y*z-x+y-z-x+y+z/x/y+z-x-y/z+x/y-z+x/y/z+x*y-z))\"\n\"((x-y*z-x/y/z-x/y*z-x*y*z-x/y+z*x*y/z*x-y+z*x+y-z))\"\n\"((x-y*z/9.123-x-y/z*9.123-x-y/z/9.123/x*y+z*9.123))\"\n\"((x-y*z/9.123-x/y+z*9.123-x/y-z*9.123/x-y*z+9.123))\"\n\"((x-y*z/9.123/x+y/z+9.123/x+y*z*9.123-x/y/z-9.123))\"\n\"((x-y+7.123*w*x/y+7.123/w*x*y-7.123/w+x+y/7.123-w))\"\n\"((x-y+7.123*w+x/y-7.123-w+x*y-7.123-w*x-y*7.123/w))\"\n\"((x-y+7.123+w-x*y*7.123+w-x-y*7.123/w/x+y/7.123+w))\"\n\"((x-y+7.123/w-x*y-7.123/w-x*y+7.123/w/x+y*7.123-w))\"\n\"((x-y+7.123/w-x+y*7.123*w-x/y-7.123-w/x+y/7.123*w))\"\n\"((x-y+z*9.123*x/y+z/9.123*x*y-z/9.123+x+y/z-9.123))\"\n\"((x-y+z*9.123+x/y-z-9.123+x*y-z-9.123*x-y*z/9.123))\"\n\"((x-y+z*x+y-z*x+y/z+x*y-z*x+y*z-x*y/z-x*y*z-x/y*z))\"\n\"((x-y+z+9.123-x*y*z+9.123-x-y*z/9.123/x+y/z+9.123))\"\n\"((x-y+z/9.123-x*y-z/9.123-x*y+z/9.123/x+y*z-9.123))\"\n\"((x-y+z/9.123-x+y*z*9.123-x/y-z-9.123/x+y/z*9.123))\"\n\"((x-y-7.123*w*x+y*7.123/w*x+y*7.123*w+x-y/7.123*w))\"\n\"((x-y-7.123*w+x/y-7.123*w+x/y-7.123/w*x-y+7.123+w))\"\n\"((x-y-7.123+w+x-y*7.123/w+x-y*7.123*w*x+y*7.123*w))\"\n\"((x-y-7.123/w/x+y/7.123*w/x+y*7.123/w-x+y+7.123/w))\"\n\"((x-y-7.123/w/x/y-7.123/w/x/y+7.123/w-x-y-7.123+w))\"\n\"((x-y-z*9.123*x+y*z/9.123*x+y*z*9.123+x-y/z*9.123))\"\n\"((x-y-z*9.123+x/y-z*9.123+x/y-z/9.123*x-y+z+9.123))\"\n\"((x-y-z+9.123+x-y*z/9.123+x-y*z*9.123*x+y*z*9.123))\"\n\"((x-y-z/9.123/x+y/z*9.123/x+y*z/9.123-x+y+z/9.123))\"\n\"((x-y-z/9.123/x/y-z/9.123/x/y+z/9.123-x-y-z+9.123))\"\n\"((x-y-z/x+y/z/x+y*z-x*y/z/x+y-z*x*y*z*x/y+z*x/y/z))\"\n\"((x-y/7.123*w+x*y-7.123*w+x*y+7.123*w*x/y-7.123+w))\"\n\"((x-y/7.123*w+x+y-7.123*w+x+y-7.123/w*x+y/7.123-w))\"\n\"((x-y/7.123*w/x-y*7.123-w/x+y*7.123-w-x+y-7.123*w))\"\n\"((x-y/7.123+w/x*y/7.123+w/x/y*7.123+w-x+y/7.123*w))\"\n\"((x-y/7.123-w*x-y+7.123/w*x-y+7.123*w+x/y-7.123-w))\"\n\"((x-y/7.123/w-x+y*7.123/w-x+y-7.123*w/x-y/7.123-w))\"\n\"((x-y/7.123/w/x*y+7.123*w/x/y-7.123*w-x*y-7.123+w))\"\n\"((x-y/z*9.123+x*y-z*9.123+x*y+z*9.123*x/y-z+9.123))\"\n\"((x-y/z*9.123+x+y-z*9.123+x+y-z/9.123*x+y/z-9.123))\"\n\"((x-y/z*9.123/x-y*z-9.123/x+y*z-9.123-x+y-z*9.123))\"\n\"((x-y/z+9.123/x*y/z+9.123/x/y*z+9.123-x+y/z*9.123))\"\n\"((x-y/z+x+y*z+x+y-z*x*y*z+x+y+z/x/y+z/x/y-z/x*y+z))\"\n\"((x-y/z+x/y-z+x/y/z+x*y-z+x/y*z-x*y*z-x*y/z-x+y+z))\"\n\"((x-y/z-9.123*x-y+z/9.123*x-y+z*9.123+x/y-z-9.123))\"\n\"((x-y/z/9.123-x+y*z/9.123-x+y-z*9.123/x-y/z-9.123))\"\n\"((x-y/z/9.123/x*y+z*9.123/x/y-z*9.123-x*y-z+9.123))\"\n\"((x/5.123*z+w-x+5.123/z*w-x+5.123/z/w/x*5.123-z*w))\"\n\"((x/5.123*z-w+x+5.123+z/w+x+5.123+z*w*x/5.123+z-w))\"\n\"((x/5.123*z-w/x-5.123*z*w/x-5.123*z/w-x/5.123+z*w))\"\n\"((x/5.123+z*w+x-5.123/z+w+x-5.123*z+w*x/5.123*z+w))\"\n\"((x/5.123+z+w/x*5.123*z-w/x/5.123/z-w-x-5.123-z*w))\"\n\"((x/5.123+z-w-x+5.123*z/w-x/5.123*z-w/x-5.123*z*w))\"\n\"((x/5.123+z/w-x-5.123-z+w-x+5.123/z-w/x-5.123*z*w))\"\n\"((x/5.123-z*w-x*5.123-z+w-x-5.123/z+w/x*5.123/z+w))\"\n\"((x/5.123-z*w/x-5.123*z+w/x-5.123+z+w-x*5.123*z+w))\"\n\"((x/5.123-z+w-x*5.123/z-w-x/5.123/z+w/x-5.123+z*w))\"\n\"((x/5.123-z-w/x+5.123/z*w/x-5.123*z/w-x-5.123/z*w))\"\n\"((x/5.123-z/w*x-5.123+z+w*x-5.123-z+w+x-5.123*z/w))\"\n\"((x/5.123/z+w/x-5.123+z*w/x-5.123+z/w-x*5.123-z/w))\"\n\"((x/5.123/z-w+x-5.123-z/w+x-5.123-z*w*x+5.123*z/w))\"\n\"((x/5.123/z-w-x-5.123-z*w-x-5.123-z/w/x/5.123-z/w))\"\n\"((x/y*7.123+w-x+y/7.123*w-x+y/7.123/w/x*y-7.123*w))\"\n\"((x/y*7.123-w+x+y+7.123/w+x+y+7.123*w*x/y+7.123-w))\"\n\"((x/y*7.123-w/x-y*7.123*w/x-y*7.123/w-x/y+7.123*w))\"\n\"((x/y*z+9.123-x+y/z*9.123-x+y/z/9.123/x*y-z*9.123))\"\n\"((x/y*z+x-y-z+x-y/z+x+y*z+x-y*z-x+y-z-x+y+z/x/y+z))\"\n\"((x/y*z-9.123+x+y+z/9.123+x+y+z*9.123*x/y+z-9.123))\"\n\"((x/y*z-9.123/x-y*z*9.123/x-y*z/9.123-x/y+z*9.123))\"\n\"((x/y*z-x*y*z-x*y/z-x+y+z-x-y+z*x+y-z*x+y/z+x*y-z))\"\n\"((x/y+7.123*w+x-y/7.123+w+x-y*7.123+w*x/y*7.123+w))\"\n\"((x/y+7.123+w/x*y*7.123-w/x/y/7.123-w-x-y-7.123*w))\"\n\"((x/y+7.123-w-x+y*7.123/w-x/y*7.123-w/x-y*7.123*w))\"\n\"((x/y+7.123/w-x-y-7.123+w-x+y/7.123-w/x-y*7.123*w))\"\n\"((x/y+z*9.123+x-y/z+9.123+x-y*z+9.123*x/y*z+9.123))\"\n\"((x/y+z*x*y/z*x-y+z*x+y-z*x-y-z/x+y/z/x+y*z-x*y/z))\"\n\"((x/y+z*x/y/z*x*y+z*x-y*z*x*y-z/x+y*z/x+y/z/x-y/z))\"\n\"((x/y+z+9.123/x*y*z-9.123/x/y/z-9.123-x-y-z*9.123))\"\n\"((x/y+z-9.123-x+y*z/9.123-x/y*z-9.123/x-y*z*9.123))\"\n\"((x/y+z/9.123-x-y-z+9.123-x+y/z-9.123/x-y*z*9.123))\"\n\"((x/y-7.123*w-x*y-7.123+w-x-y/7.123+w/x*y/7.123+w))\"\n\"((x/y-7.123*w/x-y*7.123+w/x-y+7.123+w-x*y*7.123+w))\"\n\"((x/y-7.123+w-x*y/7.123-w-x/y/7.123+w/x-y+7.123*w))\"\n\"((x/y-7.123-w/x+y/7.123*w/x-y*7.123/w-x-y/7.123*w))\"\n\"((x/y-7.123/w*x-y+7.123+w*x-y-7.123+w+x-y*7.123/w))\"\n\"((x/y-z*9.123-x*y-z+9.123-x-y/z+9.123/x*y/z+9.123))\"\n\"((x/y-z*9.123/x-y*z+9.123/x-y+z+9.123-x*y*z+9.123))\"\n\"((x/y-z+9.123-x*y/z-9.123-x/y/z+9.123/x-y+z*9.123))\"\n\"((x/y-z-9.123/x+y/z*9.123/x-y*z/9.123-x-y/z*9.123))\"\n\"((x/y-z/9.123*x-y+z+9.123*x-y-z+9.123+x-y*z/9.123))\"\n\"((x/y-z/x*y+z/x*y-z/x+y*z/x*y*z+x+y/z+x+y+z+x-y*z))\"\n\"((x/y-z/x-y+z/x-y-z/x+y/z/x-y/z+x+y*z+x+y-z*x*y*z))\"\n\"((x/y/7.123+w/x-y+7.123*w/x-y+7.123/w-x*y-7.123/w))\"\n\"((x/y/7.123-w+x-y-7.123/w+x-y-7.123*w*x+y*7.123/w))\"\n\"((x/y/7.123-w-x-y-7.123*w-x-y-7.123/w/x/y-7.123/w))\"\n\"((x/y/z+9.123/x-y+z*9.123/x-y+z/9.123-x*y-z/9.123))\"\n\"((x/y/z+x*y-z+x*y*z+x+y/z+x*y/z-x+y+z-x+y-z-x*y+z))\"\n\"((x/y/z-9.123+x-y-z/9.123+x-y-z*9.123*x+y*z/9.123))\"\n\"((x/y/z-9.123-x-y-z*9.123-x-y-z/9.123/x/y-z/9.123))\"\n\"((x/y/z-x-y/z-x-y*z-x+y-z-x+y*z*x+y+z*x-y/z+x/y-z))\"\n\"7.7*a^6+6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"cos(((((a+(((a-((sin(e)+3.14)+a))*b)-pi))/b)-b)/e))\"\n\"(((3.79-((tan((((sin(a)+0.12)-a)*0.94))+b)+b))*b)+b)\"\n\"((0.96*(((((tan(sin((b*b)))*b)+e)*3.49)+0.03)/a))-b)\"\n\"((e*((((2.17-(1.53-(((b+a)+pi)/pi)))-e)+b)-b))-2.58)\"\n\"((((((a/(((((a*a)*e)+a)/3.36)/0.05))*e)-pi)-pi)+a)*a)\"\n\"(2.2*(3.3*(4.4*(5.5*(((((a-b)+9.9)+8.8)+7.7)+6.6)))))\"\n\"(2.2+(3.3+(4.4+(5.5+(((((a*b)*9.9)*8.8)*7.7)*6.6)))))\"\n\"(sin((((((((tan(pi)+0.98)/e)+e)-2.32)/1.46)*a)*e))-a)\"\n\"(((e+((((((((b/b)-0.99)+b)+b)+b)+a)+b)+2.24))/a)/3.99)\"\n\"(((((((2.27/(((e/(a/a))*b)+b))/b)+3.73)*a)*3.17)*b)*pi)\"\n\"((((x+y)-(x+y)*(x+z)-(x-w))/((x-y)-(x+y)-(x+z)-(x-w))))\"\n\"((((x+y)/(x+y)+(x+z)/(x-w))-((x-y)-(x+y)-(x+z)-(x-w))))\"\n\"((((x-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((x-y)+(x+y)-(x+z)+(x+w))*((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((x-y)/(x+y)+(x+z)/(x-w))-((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((y+x)-(y+z)*(y+w)-(y-w))/((x-y)-(x+y)-(x+z)+(x-w))))\"\n\"((((y+x)/(y+z)+(y+w)/(y+y))-((x-y)-(x+y)-(x+z)+(x-w))))\"\n\"((((y-x)*(y+z)/(y+w)*(y+x))+((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((y-x)+(y+z)-(y+w)+(y+z))*((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((y-x)+(y+z)-(y+w)+(y-z))*((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((y-x)/(y+z)+(y+w)/(y+y))-((x-y)-(x-y)-(x-z)+(x-w))))\"\n\"(2.88*((((((((((e*pi)+1.02)-b)*pi)-b)/b)-a)+b)-b)+0.31))\"\n\"(b-(a/((((sin((b-((a+(pi-2.29))+a)))*1.39)/b)-b)+3.83)))\"\n\"(cos((((sin(((cos(((e-b)+pi))*pi)/a))-b)+2.66)-0.06))/a)\"\n\"(tan((sin((a*(tan(((b+(e-(2.97+a)))-2.81))-b)))/pi))/pi)\"\n\"cos((((((((((2.29+3.99)+a)/1.50)/a)/pi)-b)+1.90)+pi)/a))\"\n\"tan((((tan((((b*((cos(2.39)/b)/pi))-b)*a))+pi)*1.98)+e))\"\n\"(((((((((((((a-a)+a)+b)+pi)+e)*b)+e)/b)-a)*b)+1.25)-a)+a)\"\n\"((((((((((e+3.06)/2.16)/a)+pi)*b)-3.32)+3.38)-a)+b)+2.89)\"\n\"((((((a-(b-(2.95+(((e+b)-a)+e))))*1.32)+0.87)-1.54)-b)-a)\"\n\"(((((a+sin(((((((a+b)+b)+a)+e)-b)*pi)))+1.97)/a)-a)+2.98)\"\n\"((abs((x-y)/z)*exp((x-y)*z))-(sin((x*y)+z)+cos((x*y)-z)))\"\n\"((abs(x/(y*z))*exp(x/(y/z)))-(sin(x*(y+z))+cos(x*(y-z))))\"\n\"tan(tan((((((e*sin((b/(e-cos((b+b))))))-b)-1.36)+a)+pi)))\"\n\"((((((((((((a+pi)+a)-2.96)/b)-a)+pi)-b)+pi)+0.21)/a)+e)-a)\"\n\"((((((((((((e+a)*pi)/a)/pi)*a)*0.81)+1.42)+pi)+b)+b)+b)/e)\"\n\"(((((((((((a/2.01)*a)-b)+b)/0.59)+3.04)+b)+b)-1.51)+pi)*a)\"\n\"(((((sin((e-(((sin(pi)+pi)+a)+e)))+b)-2.65)*3.08)*1.91)+a)\"\n\"(((tan(sin(((sin(sin(sin(cos((b+a)))))*a)/a)))/b)+3.74)/b)\"\n\"((cos((a/((sin(((0.58+(cos(b)/b))-a))+1.23)+a)))+2.78)+pi)\"\n\"((e+((((a+((((((e+e)-b)/a)-3.17)*2.75)*e))+e)/a)/1.52))/e)\"\n\"(pi/(pi-((((((((((e-pi)+pi)*a)+a)-0.45)+a)*pi)/e)-b)*pi)))\"\n\"cos((b/((a+(((cos(tan(tan((tan(e)-3.84))))*e)+e)+pi))/a)))\"\n\"((((((((123.456/654.321)*1.1)*2.2)*3.3)*4.4)*5.5)*6.6)*7.7)\"\n\"((((((((123.456/654.321)+1.1)+2.2)+3.3)+4.4)+5.5)+6.6)+7.7)\"\n\"((0.93*((((((((0.71+3.99)+e)*a)+0.91)/0.81)/pi)*pi)+b))/pi)\"\n\"(1.1*(2.2*(3.3*(4.4*(5.5*(6.6*(7.7*(123.456+654.321))))))))\"\n\"(1.1*2.2*3.3*4.4*5.5*6.6*7.7)/(1.1*2.2*3.3*4.4*5.5*6.6*7.7)\"\n\"7.7*a^7+6.6*a^6+5.6*a^5+4.4*a^4+3.3*a^3+2.2*a^2+1.1*a^1+0.1\"\n\"8.8*a^7+7.7*a^6+6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"(((((((((((3.05*e)-b)+3.99)+pi)+pi)/0.99)+a)*pi)-b)-1.16)-b)\"\n\"(((((((((((e-3.40)+a)+e)+b)-a)*3.40)*b)-0.67)+e)+3.61)*0.23)\"\n\"(((1.50*((b*((((((a+((a+b)/a))+b)+b)+a)+e)-b))*pi))+1.97)/a)\"\n\"((1.59*(((0.52+(((((0.36+1.11)-e)+1.53)+a)-0.30))+b)/e))+pi)\"\n\"cos(((a+((tan((b+(3.78-((b*(cos(a)*a))-pi))))+a)-1.50))+pi))\"\n\"tan(((sin(((sin(sin(((a-(sin(a)+2.20))/e)))/0.31)/b))-b)+a))\"\n\"((((((((((((b*b)*pi)*b)*pi)/a)+pi)+b)+2.17)+e)-3.87)/e)*0.92)\"\n\"((((((((((0.32/(pi+b))+b)/b)+2.28)-a)+b)+0.32)+e)*1.64)-2.00)\"\n\"(((((x*y)*z)-w)/((x+y)+(z*w)))/(((x+y)-(z/w))-((x*y)+(z-w))))\"\n\"(((((x*y)/z)-w)/((x-y)-(z*w)))/(((x-y)+(z/w))-((x+y)*(z*w))))\"\n\"(((((x+y)*z)-w)-((x+y)-(z*w)))-((x*(y-(z*w)))/((x*y)+(z+w))))\"\n\"(((((x+y)/z)-w)-((x-y)+(z*w)))-(((x+y)+(z/w))/((x*y)-(z-w))))\"\n\"(((((x-y)*z)-w)*((x+y)-(z/w)))*(((x+y)-(z*w))+((x/y)+(z+w))))\"\n\"(((((x-y)/z)-w)*((x-y)+(z/w)))*(((x-y)+(z*w))+((x/y)-(z-w))))\"\n\"(((((x/y)*z)-w)+((x+y)+(z/w)))+(((x+y)+(z*w))*((x/y)+(z-w))))\"\n\"(((((x/y)/z)-w)+((x-y)-(z/w)))+(((x-y)-(z*w))*((x+y)*(z/w))))\"\n\"((((3.123*y)*z)-(3.123/(y*z)))-((3.123/(y/z))-(3.123-(y/z))))\"\n\"((((3.123*y)+z)*((3.123/y)*z))*((3.123/(y+z))*(3.123*(y/z))))\"\n\"((((3.123*y)-z)/(3.123/(y+z)))/((3.123/(y-z))/(3.123-(y+z))))\"\n\"((((3.123*y)/z)+(3.123/(y-z)))+((3.123/(y*z))+(3.123-(y-z))))\"\n\"((((3.123+y)*z)-((3.123*y)/z))-(((3.123*y)*z)-(3.123/(y*z))))\"\n\"((((3.123+y)+z)/((3.123/y)+z))/(((3.123/y)-z)/(3.123*(y+z))))\"\n\"((((3.123+y)-z)*((3.123*y)*z))*(((3.123/y)+z)*(3.123/(y/z))))\"\n\"((((3.123+y)/z)+((3.123*y)-z))+(((3.123*y)/z)+(3.123/(y-z))))\"\n\"((((3.123-y)*z)-((3.123/y)/z))-(((3.123/y)*z)-(3.123*(y*z))))\"\n\"((((3.123-y)/z)+((3.123/y)-z))+(((3.123/y)/z)+(3.123*(y-z))))\"\n\"((((3.123/y)*z)-(3.123*(y*z)))-((3.123*(y/z))-(3.123+(y+z))))\"\n\"((((3.123/y)+z)*(3.123/(y/z)))*((3.123*(y+z))*(3.123-(y*z))))\"\n\"((((3.123/y)-z)/(3.123*(y+z)))/((3.123*(y-z))/(3.123+(y*z))))\"\n\"((((3.123/y)/z)+(3.123*(y-z)))+((3.123*(y*z))+(3.123+(y/z))))\"\n\"((((x*5.123)*z)-(x/(5.123*z)))-((x/(5.123/z))-(x-(5.123/z))))\"\n\"((((x*5.123)+z)*((x/5.123)*z))*((x/(5.123+z))*(x*(5.123/z))))\"\n\"((((x*5.123)-z)/(x/(5.123+z)))/((x/(5.123-z))/(x-(5.123+z))))\"\n\"((((x*5.123)/z)+(x/(5.123-z)))+((x/(5.123*z))+(x-(5.123-z))))\"\n\"((((x*y)*(z+w))+(x+((y/z)/w)))+((x+((y/z)+w))*((x*y)+(z*w))))\"\n\"((((x*y)*(z-w))*(x-((y*z)/w)))*((x-((y-z)*w))+((x/y)-(z*w))))\"\n\"((((x*y)*7.123)-(x/(y*7.123)))-((x/(y/7.123))-(x-(y/7.123))))\"\n\"((((x*y)+(z*w))-((x+y)-(z-w)))-(((x-y)-(z/w))/((x+y)/(z*w))))\"\n\"((((x*y)+(z+w))*((x/y)/(z-w)))*(((x*y)/(z-w))+(x-((y-z)/w))))\"\n\"((((x*y)+(z-w))+((x/y)*(z-w)))+(((x*y)*(z-w))*(x-((y*z)/w))))\"\n\"((((x*y)+(z/w))/((x+y)*(z-w)))/(((x+y)+(z-w))-((x-y)/(z*w))))\"\n\"((((x*y)+7.123)*((x/y)*7.123))*((x/(y+7.123))*(x*(y/7.123))))\"\n\"((((x*y)-(z*w))*((x+y)+(z-w)))*(((x+y)-(z-w))+((x+y)/(z/w))))\"\n\"((((x*y)-(z+w))+((x/y)/(z+w)))+(((x*y)/(z+w))*(x-((y+z)/w))))\"\n\"((((x*y)-(z-w))*(x-(y*(z/w))))*((x+(y*(z/w)))+(x-((y/z)/w))))\"\n\"((((x*y)-(z/w))+((x+y)/(z-w)))+(((x+y)*(z-w))*((x-y)/(z/w))))\"\n\"((((x*y)-7.123)/(x/(y+7.123)))/((x/(y-7.123))/(x-(y+7.123))))\"\n\"((((x*y)/(z+w))*(x-((y+z)/w)))*((x+((y/z)*w))+((x*y)+(z/w))))\"\n\"((((x*y)/(z-w))+(x-((y-z)/w)))+((x-((y+z)*w))*((x/y)+(z/w))))\"\n\"((((x*y)/7.123)+(x/(y-7.123)))+((x/(y*7.123))+(x-(y-7.123))))\"\n\"((((x+5.123)*z)-((x*5.123)/z))-(((x*5.123)*z)-(x/(5.123*z))))\"\n\"((((x+5.123)+z)/((x/5.123)+z))/(((x/5.123)-z)/(x*(5.123+z))))\"\n\"((((x+5.123)-z)*((x*5.123)*z))*(((x/5.123)+z)*(x/(5.123/z))))\"\n\"((((x+5.123)/z)+((x*5.123)-z))+(((x*5.123)/z)+(x/(5.123-z))))\"\n\"((((x+y)*(z*w))+(x-(y/(z*w))))+((x+(y/(z*w)))*(((x+y)*z)-w)))\"\n\"((((x+y)*(z-w))*((x-y)/(z/w)))*(((x-y)/(z*w))+(x+((y-z)*w))))\"\n\"((((x+y)*(z/w))-(x+((y+z)/w)))-((x-(y/(z*w)))/(((x-y)*z)-w)))\"\n\"((((x+y)*7.123)-((x*y)/7.123))-(((x*y)*7.123)-(x/(y*7.123))))\"\n\"((((x+y)+(z*w))*((x/y)+(z-w)))*(((x*y)+(z-w))+((x/y)*(z-w))))\"\n\"((((x+y)+(z-w))-((x-y)/(z*w)))-(((x+y)/(z/w))/(x+((y-z)/w))))\"\n\"((((x+y)+(z/w))/((x*y)-(z-w)))/(((x/y)+(z-w))-(x+(y*(z/w)))))\"\n\"((((x+y)+7.123)/((x/y)+7.123))/(((x/y)-7.123)/(x*(y+7.123))))\"\n\"((((x+y)-(z*w))+((x/y)+(z+w)))+(((x*y)+(z+w))*((x/y)/(z-w))))\"\n\"((((x+y)-(z-w))+((x+y)/(z/w)))+(((x+y)/(z*w))*(x+((y+z)*w))))\"\n\"((((x+y)-(z/w))-((x*y)+(z-w)))-(((x/y)+(z+w))/((x*y)*(z-w))))\"\n\"((((x+y)-7.123)*((x*y)*7.123))*(((x/y)+7.123)*(x/(y/7.123))))\"\n\"((((x+y)/(z*w))*(x+((y+z)*w)))*((x+((y+z)/w))+(((x*y)*z)-w)))\"\n\"((((x+y)/(z-w))/((x-y)*(z*w)))/(((x-y)/(z/w))-(x+((y*z)/w))))\"\n\"((((x+y)/(z/w))/(x+((y-z)/w)))/((x+((y+z)*w))-(((x/y)*z)-w)))\"\n\"((((x+y)/7.123)+((x*y)-7.123))+(((x*y)/7.123)+(x/(y-7.123))))\"\n\"((((x-5.123)*z)-((x/5.123)/z))-(((x/5.123)*z)-(x*(5.123*z))))\"\n\"((((x-5.123)/z)+((x/5.123)-z))+(((x/5.123)/z)+(x*(5.123-z))))\"\n\"((((x-y)*(z*w))*(x+((y*z)*w)))*((x+((y*z)/w))+(((x*y)/z)-w)))\"\n\"((((x-y)*(z+w))*((x/y)*(z+w)))*(((x*y)*(z+w))+(x+((y/z)/w))))\"\n\"((((x-y)*(z/w))/(x+((y/z)+w)))/((x+((y*z)*w))-(((x/y)/z)-w)))\"\n\"((((x-y)*7.123)-((x/y)/7.123))-(((x/y)*7.123)-(x*(y*7.123))))\"\n\"((((x-y)+(z*w))+((x/y)-(z-w)))+(((x*y)-(z-w))*(x-(y*(z/w)))))\"\n\"((((x-y)+(z+w))-((x*y)*(z+w)))-(((x-y)*(z/w))/(x+((y/z)+w))))\"\n\"((((x-y)+(z/w))-((x+y)*(z*w)))-(((x/y)-(z-w))/(x+(y/(z*w)))))\"\n\"((((x-y)-(z*w))*((x+y)*(z/w)))*(((x+y)*(z*w))+(x-(y/(z*w)))))\"\n\"((((x-y)-(z+w))+((x-y)*(z/w)))+(((x-y)*(z*w))*(x+((y*z)*w))))\"\n\"((((x-y)-(z/w))/((x+y)/(z*w)))/(((x+y)*(z/w))-(x+((y+z)/w))))\"\n\"((((x-y)/(z*w))+(x+((y-z)*w)))+((x+((y-z)/w))*(((x+y)/z)-w)))\"\n\"((((x-y)/(z+w))/((x*y)/(z+w)))/(((x/y)*(z+w))-(x+((y/z)*w))))\"\n\"((((x-y)/(z/w))-(x+((y*z)/w)))-((x+((y-z)*w))/(((x-y)/z)-w)))\"\n\"((((x-y)/7.123)+((x/y)-7.123))+(((x/y)/7.123)+(x*(y-7.123))))\"\n\"((((x/5.123)*z)-(x*(5.123*z)))-((x*(5.123/z))-(x+(5.123+z))))\"\n\"((((x/5.123)+z)*(x/(5.123/z)))*((x*(5.123+z))*(x-(5.123*z))))\"\n\"((((x/5.123)-z)/(x*(5.123+z)))/((x*(5.123-z))/(x+(5.123*z))))\"\n\"((((x/5.123)/z)+(x*(5.123-z)))+((x*(5.123*z))+(x+(5.123/z))))\"\n\"((((x/y)*(z+w))-(x+((y/z)*w)))-((x+((y/z)/w))/((x*y)-(z*w))))\"\n\"((((x/y)*(z-w))/(x-((y*z)*w)))/((x-((y*z)/w))-(x/(y+(z*w)))))\"\n\"((((x/y)*7.123)-(x*(y*7.123)))-((x*(y/7.123))-(x+(y+7.123))))\"\n\"((((x/y)+(z+w))/((x*y)*(z-w)))/(((x/y)/(z-w))-(x-((y-z)*w))))\"\n\"((((x/y)+(z-w))-(x+(y*(z/w))))-(((x/y)*(z-w))/(x-((y*z)*w))))\"\n\"((((x/y)+(z/w))-((x-y)-(z+w)))-(((x+y)/(z-w))/((x-y)*(z*w))))\"\n\"((((x/y)+7.123)*(x/(y/7.123)))*((x*(y+7.123))*(x-(y*7.123))))\"\n\"((((x/y)-(z*w))/((x-y)*(z+w)))/(((x-y)+(z+w))-((x*y)*(z+w))))\"\n\"((((x/y)-(z+w))-((x*y)/(z-w)))-(((x/y)/(z+w))/(x-((y+z)*w))))\"\n\"((((x/y)-(z-w))/(x+(y/(z*w))))/((x-(y*(z/w)))-(x-((y/z)*w))))\"\n\"((((x/y)-(z/w))*((x-y)+(z+w)))*(((x-y)-(z+w))+((x-y)*(z/w))))\"\n\"((((x/y)-7.123)/(x*(y+7.123)))/((x*(y-7.123))/(x+(y*7.123))))\"\n\"((((x/y)/(z+w))/(x-((y+z)*w)))/((x-((y+z)/w))-((x*y)-(z/w))))\"\n\"((((x/y)/(z-w))-(x-((y-z)*w)))-((x-((y-z)/w))/((x/y)-(z/w))))\"\n\"((((x/y)/7.123)+(x*(y-7.123)))+((x*(y*7.123))+(x+(y/7.123))))\"\n\"(((1.1*x^2+2.2)*(1.1/y^3-2.2))-((1.1*x^2+2.2)+(1.1/y^3-2.2)))\"\n\"(((1.1*x^2+2.2)*(1.1/y^3-2.2))-((1.1*x^2+2.2)-(1.1/y^3-2.2)))\"\n\"(((1.1*x^2+2.2)+(1.1/y^3-2.2))*((1.1*x^2+2.2)*(1.1/y^3-2.2)))\"\n\"(((1.1*x^2+2.2)+(1.1/y^3-2.2))*((1.1*x^2+2.2)-(1.1/y^3-2.2)))\"\n\"(((1.1*x^2+2.2)-(1.1/y^3-2.2))+((1.1*x^2+2.2)*(1.1/y^3-2.2)))\"\n\"(((1.1*x^2+2.2)-(1.1/y^3-2.2))+((1.1*x^2+2.2)+(1.1/y^3-2.2)))\"\n\"(((3.123*(y*z))+(3.123+(y/z)))+((3.123+(y+z))+((3.123-y)*z)))\"\n\"(((3.123*(y+z))*(3.123-(y*z)))*((3.123+(y*z))*((3.123+y)+z)))\"\n\"(((3.123*(y-z))/(3.123+(y*z)))/((3.123+(y/z))/((3.123-y)/z)))\"\n\"(((3.123*(y/z))-(3.123+(y+z)))-((3.123+(y-z))-((3.123*y)+z)))\"\n\"(((3.123+(y*z))*((3.123+y)+z))*(((3.123-y)/z)+((3.123/y)-z)))\"\n\"(((3.123+(y+z))+((3.123-y)*z))+(((3.123*y)+z)*((3.123/y)*z)))\"\n\"(((3.123+(y-z))-((3.123*y)+z))-(((3.123*y)-z)/(3.123/(y+z))))\"\n\"(((3.123+(y/z))/((3.123-y)/z))/(((3.123-y)*z)-((3.123/y)/z)))\"\n\"(((3.123-(y*z))-((3.123+y)-z))-(((3.123+y)+z)/((3.123/y)+z)))\"\n\"(((3.123-(y+z))*(3.123+(y-z)))*(((3.123+y)/z)+((3.123*y)-z)))\"\n\"(((3.123-(y-z))/((3.123+y)/z))/(((3.123+y)*z)-((3.123*y)/z)))\"\n\"(((3.123-(y/z))+((3.123+y)*z))+(((3.123+y)-z)*((3.123*y)*z)))\"\n\"(((3.123/(y*z))+(3.123-(y-z)))+((3.123-(y/z))+((3.123+y)*z)))\"\n\"(((3.123/(y+z))*(3.123*(y/z)))*((3.123-(y+z))*(3.123+(y-z))))\"\n\"(((3.123/(y-z))/(3.123-(y+z)))/((3.123-(y-z))/((3.123+y)/z)))\"\n\"(((3.123/(y/z))-(3.123-(y/z)))-((3.123-(y*z))-((3.123+y)-z)))\"\n\"(((x*(5.123*z))+(x+(5.123/z)))+((x+(5.123+z))+((x-5.123)*z)))\"\n\"(((x*(5.123+z))*(x-(5.123*z)))*((x+(5.123*z))*((x+5.123)+z)))\"\n\"(((x*(5.123-z))/(x+(5.123*z)))/((x+(5.123/z))/((x-5.123)/z)))\"\n\"(((x*(5.123/z))-(x+(5.123+z)))-((x+(5.123-z))-((x*5.123)+z)))\"\n\"(((x*(y*7.123))+(x+(y/7.123)))+((x+(y+7.123))+((x-y)*7.123)))\"\n\"(((x*(y+(z*w)))*((x/y)-(z+w)))*(((x*y)-(z+w))+((x/y)/(z+w))))\"\n\"(((x*(y+7.123))*(x-(y*7.123)))*((x+(y*7.123))*((x+y)+7.123)))\"\n\"(((x*(y-(z*w)))/((x*y)+(z+w)))/(((x/y)-(z+w))-((x*y)/(z-w))))\"\n\"(((x*(y-7.123))/(x+(y*7.123)))/((x+(y/7.123))/((x-y)/7.123)))\"\n\"(((x*(y/7.123))-(x+(y+7.123)))-((x+(y-7.123))-((x*y)+7.123)))\"\n\"(((x+((y*z)*w))-(((x/y)/z)-w))-((((x*y)/z)-w)/((x-y)-(z*w))))\"\n\"(((x+((y*z)/w))+(((x*y)/z)-w))+((((x-y)/z)-w)*((x-y)+(z/w))))\"\n\"(((x+((y+z)*w))-(((x/y)*z)-w))-((((x*y)*z)-w)/((x+y)+(z*w))))\"\n\"(((x+((y+z)/w))+(((x*y)*z)-w))+((((x-y)*z)-w)*((x+y)-(z/w))))\"\n\"(((x+((y-z)*w))/(((x-y)/z)-w))/((((x+y)/z)-w)-((x-y)+(z*w))))\"\n\"(((x+((y-z)/w))*(((x+y)/z)-w))*((((x/y)*z)-w)+((x+y)+(z/w))))\"\n\"(((x+((y/z)*w))+((x*y)+(z/w)))+(((x*y)-(z*w))*((x+y)+(z-w))))\"\n\"(((x+((y/z)+w))*((x*y)+(z*w)))*((((x/y)/z)-w)+((x-y)-(z/w))))\"\n\"(((x+((y/z)/w))/((x*y)-(z*w)))/(((x*y)+(z*w))-((x+y)-(z-w))))\"\n\"(((x+(5.123*z))*((x+5.123)+z))*(((x-5.123)/z)+((x/5.123)-z)))\"\n\"(((x+(5.123+z))+((x-5.123)*z))+(((x*5.123)+z)*((x/5.123)*z)))\"\n\"(((x+(5.123-z))-((x*5.123)+z))-(((x*5.123)-z)/(x/(5.123+z))))\"\n\"(((x+(5.123/z))/((x-5.123)/z))/(((x-5.123)*z)-((x/5.123)/z)))\"\n\"(((x+(y*(z/w)))+(x-((y/z)/w)))+((x-((y*z)*w))*(x/(y-(z*w)))))\"\n\"(((x+(y*7.123))*((x+y)+7.123))*(((x-y)/7.123)+((x/y)-7.123)))\"\n\"(((x+(y+7.123))+((x-y)*7.123))+(((x*y)+7.123)*((x/y)*7.123)))\"\n\"(((x+(y-7.123))-((x*y)+7.123))-(((x*y)-7.123)/(x/(y+7.123))))\"\n\"(((x+(y/(z*w)))*(((x+y)*z)-w))*((x-((y/z)*w))+(x*(y-(z*w)))))\"\n\"(((x+(y/7.123))/((x-y)/7.123))/(((x-y)*7.123)-((x/y)/7.123)))\"\n\"(((x-((y*z)*w))*(x/(y-(z*w))))*((x/(y+(z*w)))+((x-y)/(z+w))))\"\n\"(((x-((y*z)/w))-(x/(y+(z*w))))-(((x/y)-(z*w))/((x-y)*(z+w))))\"\n\"(((x-((y+z)*w))*((x/y)+(z/w)))*(((x*y)-(z/w))+((x+y)/(z-w))))\"\n\"(((x-((y+z)/w))-((x*y)-(z/w)))-(((x*y)+(z/w))/((x+y)*(z-w))))\"\n\"(((x-((y-z)*w))+((x/y)-(z*w)))+(((x/y)-(z/w))*((x-y)+(z+w))))\"\n\"(((x-((y-z)/w))/((x/y)-(z/w)))/(((x/y)+(z/w))-((x-y)-(z+w))))\"\n\"(((x-((y/z)*w))+(x*(y-(z*w))))+((x*(y+(z*w)))*((x/y)-(z+w))))\"\n\"(((x-((y/z)/w))/(x*(y+(z*w))))/((x/(y-(z*w)))-((x*y)-(z+w))))\"\n\"(((x-(5.123*z))-((x+5.123)-z))-(((x+5.123)+z)/((x/5.123)+z)))\"\n\"(((x-(5.123+z))*(x+(5.123-z)))*(((x+5.123)/z)+((x*5.123)-z)))\"\n\"(((x-(5.123-z))/((x+5.123)/z))/(((x+5.123)*z)-((x*5.123)/z)))\"\n\"(((x-(5.123/z))+((x+5.123)*z))+(((x+5.123)-z)*((x*5.123)*z)))\"\n\"(((x-(y*(z/w)))-(x-((y/z)*w)))-((x-((y/z)/w))/(x*(y+(z*w)))))\"\n\"(((x-(y*7.123))-((x+y)-7.123))-(((x+y)+7.123)/((x/y)+7.123)))\"\n\"(((x-(y+7.123))*(x+(y-7.123)))*(((x+y)/7.123)+((x*y)-7.123)))\"\n\"(((x-(y-7.123))/((x+y)/7.123))/(((x+y)*7.123)-((x*y)/7.123)))\"\n\"(((x-(y/(z*w)))/(((x-y)*z)-w))/((((x+y)*z)-w)-((x+y)-(z*w))))\"\n\"(((x-(y/7.123))+((x+y)*7.123))+(((x+y)-7.123)*((x*y)*7.123)))\"\n\"(((x/(5.123*z))+(x-(5.123-z)))+((x-(5.123/z))+((x+5.123)*z)))\"\n\"(((x/(5.123+z))*(x*(5.123/z)))*((x-(5.123+z))*(x+(5.123-z))))\"\n\"(((x/(5.123-z))/(x-(5.123+z)))/((x-(5.123-z))/((x+5.123)/z)))\"\n\"(((x/(5.123/z))-(x-(5.123/z)))-((x-(5.123*z))-((x+5.123)-z)))\"\n\"(((x/(y*7.123))+(x-(y-7.123)))+((x-(y/7.123))+((x+y)*7.123)))\"\n\"(((x/(y+(z*w)))+((x-y)/(z+w)))+(((x-y)*(z+w))*((x/y)*(z+w))))\"\n\"(((x/(y+7.123))*(x*(y/7.123)))*((x-(y+7.123))*(x+(y-7.123))))\"\n\"(((x/(y-(z*w)))-((x*y)-(z+w)))-(((x-y)/(z+w))/((x*y)/(z+w))))\"\n\"(((x/(y-7.123))/(x-(y+7.123)))/((x-(y-7.123))/((x+y)/7.123)))\"\n\"(((x/(y/7.123))-(x-(y/7.123)))-((x-(y*7.123))-((x+y)-7.123)))\"\n\"sin(tan(sin((3.49*(pi*((cos((b-(cos(a)-2.26)))+3.01)+pi))))))\"\n\"((((((((((((pi-a)+a)*b)-e)+3.72)+2.27)/b)+3.35)+a)*a)+1.60)*a)\"\n\"((((((((((pi/((((0.78+b)/b)+a)*a))/b)+a)/e)/a)/b)/pi)+b)-e)/b)\"\n\"((((b-(((b-((((((a*e)+3.89)+1.22)/b)*b)+a))*e)+a))-2.31)+b)-e)\"\n\"((((b+(((b+((((((b/a)+e)-2.64)+b)/b)+pi))-b)+2.29))-e)-b)+3.15)\"\n\"(((0.71*((2.59+((0.98*((((b+3.89)+a)-b)*a))+b))-a))/2.37)+3.17)\"\n\"((sin(((tan((sin((cos(((cos(b)+e)*0.15))+pi))*b))/pi)/e))+b)+b)\"\n\"(cos((((((b-(b/(cos(tan(cos((pi-b))))+pi)))*pi)-b)-b)+0.53))/b)\"\n\"2.2*y/z-2.2*y*z*2.2/y+z*2.2/y-z*2.2/y/z+2.2/y*z+2.2/y+z-2.2/y-z\"\n\"2.2+y/z+2.2+y*z+2.2+y-z-2.2+y+z+2.2-y/z*2.2-y*z-2.2*y+z+2.2*y-z\"\n\"2.2/y*z*2.2/y/z-2.2*y+z+2.2*y-z-2.2*y*z-2.2*y/z*2.2-y/z*2.2-y/z\"\n\"x*3.3/z-x*3.3*z*x/3.3+z*x/3.3-z*x/3.3/z+x/3.3*z+x/3.3+z-x/3.3-z\"\n\"x*y+z-w-x/y+z-w*x*y-z-w*x/y-z-w-x+y*z*w+x+y*z/w+x+y/z*w-x+y/z/w\"\n\"x*y/4.4-x*y*4.4*x/y+4.4*x/y-4.4*x/y/4.4+x/y*4.4+x/y+4.4-x/y-4.4\"\n\"x+3.3/z+x+3.3*z+x+3.3-z-x+3.3+z+x-3.3/z*x-3.3*z-x*3.3+z+x*3.3-z\"\n\"x+y+z/w+x+y+z*w+x+y-z/w-x+y-z*w+x+y*z/w*x+y*z*w-x+y/z+w+x+y/z/w\"\n\"x+y/4.4+x+y*4.4+x+y-4.4-x+y+4.4+x-y/4.4*x-y*4.4-x*y+4.4+x*y-4.4\"\n\"x+y/z*w-x-y+z/w*x-y+z*w*x-y-z/w-x-y-z*w+x-y*z/w+x-y*z*w-x-y/z/w\"\n\"x-y+z*w*x-y+z/w-x-y-z*w+x-y-z/w*x+y-z-w-x+y-z-w*x+y+z-w*x+y+z-w\"\n\"x-y-z+w+x-y-z+w+x-y+z+w-x-y+z+w+x*y-z+w*x/y-z+w-x*y+z+w+x/y+z+w\"\n\"x-y/z*w*x+y*z-w-x-y*z-w+x*y*z-w*x/y*z-w-x+y/z-w*x-y/z-w*x*y/z-w\"\n\"x-y/z*w*x-y/z/w-x-y*z*w+x-y*z/w*x*y*z+w-x/y*z+w*x*y/z+w*x/y/z+w\"\n\"x/3.3*z*x/3.3/z-x*3.3+z+x*3.3-z-x*3.3*z-x*3.3/z*x-3.3/z*x-3.3/z\"\n\"x/y*4.4*x/y/4.4-x*y+4.4+x*y-4.4-x*y*4.4-x*y/4.4*x-y/4.4*x-y/4.4\"\n\"x/y+z*w-x/y-z*w*x*y+z*w*x*y-z*w-x+y-z*w+x+y-z/w+x+y+z*w-x+y+z/w\"\n\"x/y/z-w+x*y+z*w+x*y-z*w-x*y+z/w+x*y-z/w*x/y+z/w-x/y-z/w+x/y-z*w\"\n\"((((((((((((((((+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)\"\n\"(((((((((((((((b/b)+a)+b)-a)/a)-e)+a)+a)+b)-0.02)/a)-a)-a)+e)+b)\"\n\"((((0.76-(((((((a+((pi-a)+b))*b)-e)+e)/e)+pi)*2.44))+3.19)+a)+b)\"\n\"(((e/((tan((tan(cos(tan(cos(cos(0.02)))))/a))+3.33)*b))/b)-3.49)\"\n\"(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+))))))))))))))))\"\n\"(cos(cos(sin((((sin(sin(((tan((0.64+b))/b)/b)))+pi)-pi)*e))))+a)\"\n\"((((((((((((a+(2.26-(b/pi)))*b)*b)/b)*pi)+a)/b)+e)+b)*a)/1.55)/a)\"\n\"(((0.03+((((((a+(((a+e)+b)+b))+e)+pi)-e)+2.79)/0.91))*1.22)/2.23)\"\n\"((abs((2.2-y)/z)*exp((2.2-y)*z))-(sin((2.2*y)+z)+cos((2.2*y)-z)))\"\n\"((abs((x-3.3)/z)*exp((x-3.3)*z))-(sin((x*3.3)+z)+cos((x*3.3)-z)))\"\n\"((abs((x-y)/4.4)*exp((x-y)*4.4))-(sin((x*y)+4.4)+cos((x*y)-4.4)))\"\n\"((abs(2.2/(y*z))*exp(2.2/(y/z)))-(sin(2.2*(y+z))+cos(2.2*(y-z))))\"\n\"((abs(x/(3.3*z))*exp(x/(3.3/z)))-(sin(x*(3.3+z))+cos(x*(3.3-z))))\"\n\"((abs(x/(y*4.4))*exp(x/(y/4.4)))-(sin(x*(y+4.4))+cos(x*(y-4.4))))\"\n\"((b+(a+((((((((((((a-e)-e)+a)+b)+b)/1.00)+e)+e)*pi)+b)+a)/a)))/b)\"\n\"(2.2*(3.3*(4.4*(5.5*(((((123.456-654.321)+9.9)+8.8)+7.7)+6.6)))))\"\n\"(2.2+(3.3+(4.4+(5.5+(((((123.456*654.321)*9.9)*8.8)*7.7)*6.6)))))\"\n\"tan(((tan((tan(((((e+((b+0.32)+e))*1.64)-2.00)+2.95))-b))+pi)+a))\"\n\"tan(tan((a-sin(((((((tan((b+a))-b)-a)-0.99)/1.20)/1.45)/2.44)))))\"\n\"(((((((((((((0.92+pi)+a)/b)-b)+3.58)+a)+b)/b)*3.17)/3.22)+b)+a)+e)\"\n\"((((((((((((b*pi)+1.80)-b)/b)*b)+pi)-3.49)*2.35)+0.19)+1.42)-b)-b)\"\n\"(((((pi-(((0.79*((((pi/a)/b)+3.48)-2.92))-b)/2.74))+e)/1.40)*a)*b)\"\n\"(((sin((((((a-(2.69/((sin(sin(b))+a)-a)))+b)*a)+b)+b))/b)+3.90)+b)\"\n\"((cos(((tan((cos(tan(sin(((cos(3.47)/a)-3.40))))-pi))+e)-e))+a)-e)\"\n\"(((((((((((a/b)*1.1)*2.2)*3.3)+4.4)+5.5)+6.6)*7.7)*8.8)+9.9)+10.10)\"\n\"(((((a-((((((((b+1.03)*e)*0.91)-pi)+a)*pi)*a)+a))-a)+3.80)/e)+0.00)\"\n\"(((((b-((b*(((((((e-a)-a)-pi)*e)*a)+1.60)+pi))+b))/3.81)*b)+pi)+pi)\"\n\"((x*y*z+w+x+y/z/w+x+y/z+w*x*y+z*w+x+y/z/w/x*y-z*w/x*y+z*w-x+y-z-w))\"\n\"((x*y*z-w*x-y*z/w*x-y-z*w+x/y-z*w*x-y*z/w-x/y+z*w-x/y-z*w/x-y*z+w))\"\n\"((x*y*z-w/x+y+z*w/x+y-z/w-x*y+z-w/x+y+z*w*x/y+z-w*x*y+z-w+x/y*z-w))\"\n\"((x*y+z*w*x/y-z+w*x*y-z+w+x/y/z+w*x/y-z+w-x*y/z-w-x/y/z+w/x-y+z*w))\"\n\"((x*y+z*w-x+y-z-w-x-y-z/w/x+y/z*w-x+y-z-w+x+y/z/w+x+y/z*w*x+y+z*w))\"\n\"((x*y+z+w*x/y/z-w*x*y/z-w+x-y-z/w*x/y/z-w-x-y-z*w-x-y-z/w/x/y-z/w))\"\n\"((x*y+z-w+x/y*z-w+x*y*z-w*x-y*z/w+x/y*z-w/x-y*z*w/x-y*z/w-x/y+z*w))\"\n\"((x*y+z/w/x+y*z-w/x+y+z-w-x-y/z*w/x+y*z-w*x-y/z/w*x-y/z*w+x+y-z*w))\"\n\"((x*y-z*w*x+y+z-w*x+y-z-w+x+y/z/w*x+y+z-w-x-y/z*w-x+y/z/w/x+y-z/w))\"\n\"((x*y-z*w/x*y+z+w/x/y-z+w-x*y/z-w/x*y+z+w*x/y/z-w*x*y/z-w+x-y-z/w))\"\n\"((x*y-z+w+x/y/z+w+x*y/z+w*x-y+z/w+x/y/z+w/x-y+z*w/x-y+z/w-x*y-z/w))\"\n\"((x*y-z-w*x-y*z/w*x+y*z/w+x-y/z/w*x-y*z/w-x-y/z*w-x-y/z/w/x*y+z*w))\"\n\"((x*y-z/w+x+y/z-w+x+y*z-w*x-y/z/w+x+y/z-w/x-y*z*w/x-y/z/w-x+y*z/w))\"\n\"((x*y/z+w*x-y+z/w*x+y/z*w+x*y+z/w*x-y+z/w-x*y-z/w-x*y+z/w/x+y*z-w))\"\n\"((x*y/z-w+x-y-z/w+x-y+z*w*x/y+z/w+x-y-z/w/x/y-z/w/x/y+z/w-x-y-z+w))\"\n\"((x*y/z-w/x-y-z*w/x-y+z/w-x+y*z*w/x-y-z*w*x+y*z/w*x+y*z*w+x-y/z*w))\"\n\"((x+y*z*w+x-y/z*w+x+y/z*w*x+y*z-w+x-y/z*w/x-y*z-w/x+y*z-w-x+y-z*w))\"\n\"((x+y*z*w-x/y/z-w-x*y/z-w/x-y-z*w-x/y/z-w+x-y-z/w+x-y-z*w*x+y*z/w))\"\n\"((x+y*z-w*x-y/z/w*x-y/z*w+x+y-z*w*x-y/z/w-x+y*z/w-x+y-z*w/x-y/z-w))\"\n\"((x+y*z-w-x+y-z*w-x*y-z*w/x*y+z+w-x+y-z*w+x/y+z+w+x*y+z+w*x/y/z-w))\"\n\"((x+y*z/w+x*y/z-w+x-y/z-w*x-y+z/w+x*y/z-w/x-y-z*w/x-y+z/w-x+y*z*w))\"\n\"((x+y*z/w+x-y/z/w+x-y*z*w*x/y-z*w+x-y/z/w/x*y+z*w/x/y-z*w-x*y-z+w))\"\n\"((x+y*z/w-x+y+z/w-x-y/z*w/x-y*z-w-x+y+z/w+x*y*z-w+x-y*z-w*x+y-z/w))\"\n\"((x+y+z*w*x/y+z-w*x*y+z-w+x/y*z-w*x/y+z-w-x+y*z/w-x/y*z-w/x-y*z*w))\"\n\"((x+y+z*w-x/y*z-w-x*y*z-w/x+y+z*w-x/y*z-w+x+y+z/w+x+y+z*w*x/y+z-w))\"\n\"((x+y+z-w-x-y/z*w-x+y/z/w/x+y-z/w-x-y/z*w+x+y-z*w+x+y-z/w*x+y/z-w))\"\n\"((x+y+z/w+x*y*z-w+x-y*z-w*x+y-z/w+x*y*z-w/x+y+z*w/x+y-z/w-x*y+z-w))\"\n\"((x+y+z/w/x*y-z-w/x/y+z-w-x+y*z/w/x*y-z-w*x-y*z/w*x+y*z/w+x-y/z/w))\"\n\"((x+y-z*w+x/y+z+w+x*y+z+w*x/y/z-w+x/y+z+w/x*y*z-w/x/y/z-w-x-y-z*w))\"\n\"((x+y-z*w/x-y/z-w/x+y/z-w-x-y+z*w/x-y/z-w*x-y+z/w*x-y+z*w+x/y-z-w))\"\n\"((x+y-z-w+x+y/z/w+x+y/z*w*x+y+z*w+x+y/z/w/x+y-z/w/x+y+z*w-x/y*z-w))\"\n\"((x+y-z/w*x+y/z-w*x/y*z-w+x+y+z/w*x+y/z-w-x-y+z*w-x+y+z/w/x*y-z-w))\"\n\"((x+y-z/w-x*y+z-w-x/y+z+w/x*y*z-w-x*y+z-w+x/y*z-w+x*y*z-w*x-y*z/w))\"\n\"((x+y/z*w*x+y*z-w*x-y/z*w+x*y-z*w*x+y*z-w-x+y-z*w-x*y-z*w/x*y+z+w))\"\n\"((x+y/z*w*x+y+z*w*x+y+z/w+x*y*z-w*x+y+z*w-x/y*z-w-x*y*z-w/x+y+z*w))\"\n\"((x+y/z*w+x*y+z/w+x*y-z*w*x+y+z-w+x*y+z/w/x+y*z-w/x+y+z-w-x-y/z*w))\"\n\"((x+y/z+w*x*y+z*w*x/y/z-w+x-y-z/w*x*y+z*w-x+y-z-w-x-y-z/w/x+y/z*w))\"\n\"((x+y/z-w-x-y+z*w-x+y+z/w/x*y-z-w-x-y+z*w+x/y-z-w+x*y-z-w*x-y*z/w))\"\n\"((x+y/z-w/x-y*z*w/x-y/z/w-x+y*z/w/x-y*z*w*x+y*z*w*x+y*z/w+x*y/z-w))\"\n\"((x+y/z/w/x*y-z*w/x*y+z*w-x+y-z-w/x*y-z*w*x+y+z-w*x+y-z-w+x+y/z/w))\"\n\"((x+y/z/w/x+y-z/w/x+y+z*w-x/y*z-w/x+y-z/w*x+y/z-w*x/y*z-w+x+y+z/w))\"\n\"((x-y*z*w*x+y*z*w*x+y*z/w+x*y/z-w*x+y*z*w-x/y/z-w-x*y/z-w/x-y-z*w))\"\n\"((x-y*z*w*x/y-z*w*x/y+z*w+x-y/z+w*x/y-z*w-x*y-z+w-x-y/z+w/x*y/z+w))\"\n\"((x-y*z+w*x/y*z+w*x*y*z+w+x+y/z/w*x/y*z+w-x+y/z*w-x+y/z/w/x*y-z*w))\"\n\"((x-y*z-w*x+y-z/w*x+y-z*w+x/y+z+w*x+y-z/w-x*y+z-w-x/y+z+w/x*y*z-w))\"\n\"((x-y*z/w-x-y/z*w-x-y/z/w/x*y+z*w-x-y/z*w+x*y-z*w+x*y+z*w*x/y-z+w))\"\n\"((x-y*z/w-x/y+z*w-x/y-z*w/x-y*z+w-x/y+z*w+x-y/z+w+x-y*z+w*x/y*z+w))\"\n\"((x-y*z/w/x+y/z+w/x+y*z*w-x/y/z-w/x+y/z+w*x*y+z*w*x/y/z-w+x-y-z/w))\"\n\"((x-y+z*w*x/y+z/w*x*y-z/w+x+y/z-w*x/y+z/w-x-y-z+w-x+y/z-w/x-y*z*w))\"\n\"((x-y+z*w+x/y-z-w+x*y-z-w*x-y*z/w+x/y-z-w/x+y/z*w/x-y*z/w-x-y/z*w))\"\n\"((x-y+z+w-x*y*z+w-x-y*z/w/x+y/z+w-x*y*z+w+x+y/z/w+x+y/z+w*x*y+z*w))\"\n\"((x-y+z/w-x*y-z/w-x*y+z/w/x+y*z-w-x*y-z/w+x+y/z-w+x+y*z-w*x-y/z/w))\"\n\"((x-y+z/w-x+y*z*w-x/y-z-w/x+y/z*w-x+y*z*w+x-y/z*w+x+y/z*w*x+y*z-w))\"\n\"((x-y-z*w*x+y*z/w*x+y*z*w+x-y/z*w*x+y*z/w-x+y+z/w-x-y/z*w/x-y*z-w))\"\n\"((x-y-z*w+x/y-z*w+x/y-z/w*x-y+z+w+x/y-z*w/x-y*z+w/x-y+z+w-x*y*z+w))\"\n\"((x-y-z+w+x-y*z/w+x-y*z*w*x+y*z*w+x-y*z/w/x+y/z+w/x+y*z*w-x/y/z-w))\"\n\"((x-y-z/w/x+y/z*w/x+y*z/w-x+y+z/w/x+y/z*w*x+y+z*w*x+y+z/w+x*y*z-w))\"\n\"((x-y-z/w/x/y-z/w/x/y+z/w-x-y-z+w/x/y-z/w*x-y+z+w*x-y-z+w+x-y*z/w))\"\n\"((x-y/z*w+x*y-z*w+x*y+z*w*x/y-z+w+x*y-z*w/x*y+z+w/x/y-z+w-x*y/z-w))\"\n\"((x-y/z*w+x+y-z*w+x+y-z/w*x+y/z-w+x+y-z*w/x-y/z-w/x+y/z-w-x-y+z*w))\"\n\"((x-y/z*w/x-y*z-w/x+y*z-w-x+y-z*w/x-y*z-w*x+y-z/w*x+y-z*w+x/y+z+w))\"\n\"((x-y/z+w/x*y/z+w/x/y*z+w-x+y/z*w/x*y/z+w*x-y+z/w*x+y/z*w+x*y+z/w))\"\n\"((x-y/z-w*x-y+z/w*x-y+z*w+x/y-z-w*x-y+z/w-x+y*z*w-x/y-z-w/x+y/z*w))\"\n\"((x-y/z/w-x+y*z/w-x+y-z*w/x-y/z-w-x+y*z/w+x*y/z-w+x-y/z-w*x-y+z/w))\"\n\"((x-y/z/w/x*y+z*w/x/y-z*w-x*y-z+w/x*y+z*w*x/y-z+w*x*y-z+w+x/y/z+w))\"\n\"((x/y*z+w-x+y/z*w-x+y/z/w/x*y-z*w-x+y/z*w+x*y+z/w+x*y-z*w*x+y+z-w))\"\n\"((x/y*z-w+x+y+z/w+x+y+z*w*x/y+z-w+x+y+z/w/x*y-z-w/x/y+z-w-x+y*z/w))\"\n\"((x/y*z-w/x-y*z*w/x-y*z/w-x/y+z*w/x-y*z*w*x/y-z*w*x/y+z*w+x-y/z+w))\"\n\"((x/y+z*w+x-y/z+w+x-y*z+w*x/y*z+w+x-y/z+w/x*y/z+w/x/y*z+w-x+y/z*w))\"\n\"((x/y+z+w/x*y*z-w/x/y/z-w-x-y-z*w/x*y*z-w*x-y*z/w*x-y-z*w+x/y-z*w))\"\n\"((x/y+z-w-x+y*z/w-x/y*z-w/x-y*z*w-x+y*z/w+x-y/z/w+x-y*z*w*x/y-z*w))\"\n\"((x/y+z/w-x-y-z+w-x+y/z-w/x-y*z*w-x-y-z+w+x-y*z/w+x-y*z*w*x+y*z*w))\"\n\"((x/y-z*w-x*y-z+w-x-y/z+w/x*y/z+w-x*y-z+w+x/y/z+w+x*y/z+w*x-y+z/w))\"\n\"((x/y-z*w/x-y*z+w/x-y+z+w-x*y*z+w/x-y*z+w*x/y*z+w*x*y*z+w+x+y/z/w))\"\n\"((x/y-z+w-x*y/z-w-x/y/z+w/x-y+z*w-x*y/z-w+x-y-z/w+x-y+z*w*x/y+z/w))\"\n\"((x/y-z-w/x+y/z*w/x-y*z/w-x-y/z*w/x+y/z*w*x+y*z-w*x-y/z*w+x*y-z*w))\"\n\"((x/y-z/w*x-y+z+w*x-y-z+w+x-y*z/w*x-y+z+w-x*y*z+w-x-y*z/w/x+y/z+w))\"\n\"((x/y/z+w/x-y+z*w/x-y+z/w-x*y-z/w/x-y+z*w*x/y+z/w*x*y-z/w+x+y/z-w))\"\n\"((x/y/z-w+x-y-z/w+x-y-z*w*x+y*z/w+x-y-z/w/x+y/z*w/x+y*z/w-x+y+z/w))\"\n\"((x/y/z-w-x-y-z*w-x-y-z/w/x/y-z/w-x-y-z*w+x/y-z*w+x/y-z/w*x-y+z+w))\"\n\"(1.1*(2.2*(3.3*(4.4+(5.5+(6.6+(7.7*(8.8*(9.9*(10.10*(a+b)))))))))))\"\n\"9.9*a^8+8.8*a^7+7.7*a^6+6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"cos(((cos(cos((e+cos(((sin(((((b+e)/b)*pi)-3.28))/e)-a)))))+e)*pi))\"\n\"(((((a+((((((((a/e)-0.51)+0.57)/a)+e)/b)*2.85)+a))/3.94)+a)*b)-0.23)\"\n\"((((3.58/(((((((((1.91*b)-e)-b)+a)*1.19)/a)+a)-2.06)+e))*e)*e)*0.72)\"\n\"((cos(tan((cos((((((tan((cos(a)/b))+0.95)/0.89)-b)*b)*b))+a)))*e)*e)\"\n\"(pi/((((((((((((((a+a)/e)/a)*0.56)+a)/b)-b)+1.71)+b)+a)+b)*b)/b)+b))\"\n\"cos(sin(tan(cos(tan((b*(b+(cos(tan((a*(((pi*b)/pi)+pi))))*pi))))))))\"\n\"((((((((3.26+(((((((3.74+a)/a)*e)*e)-pi)-e)*e))+pi)+b)+b)-a)/a)+e)+a)\"\n\"(((b/((((((1.94+(pi+((tan(cos(3.91))-b)+a)))/b)*a)+b)*3.43)-b))-b)+b)\"\n\"((pi+(((1.15/((cos((cos(((b/sin(a))+pi))*a))+pi)+3.05))+2.22)+pi))+b)\"\n\"((sin(((a-sin(cos(cos(((((pi*(pi-a))/3.15)+a)+2.54)))))+0.21))*a)*pi)\"\n\"(((a+((((((((pi+(((b+(b-a))+b)+a))*a)/pi)/b)+a)*b)+pi)/2.19))*3.22)+e)\"\n\"((pi*(b+((((((((((((b+b)/2.01)+a)*b)*3.74)/a)-a)+b)-pi)-b)+pi)+e)))-b)\"\n\"(pi-(3.49-(((e*(((((tan(sin(((a+a)/e)))+e)-3.39)/0.03)*e)-pi))+e)-e)))\"\n\"(tan((b+(((sin((((sin((((((e-b)+pi)*b)/b)+e))+a)*pi)-b))*a)+a)+a)))+e)\"\n\"(tan(tan((b/(((b/((a+((((b/((e+0.23)*e))*a)*b)+pi))*b))/3.44)-b))))+a)\"\n\"(((((((((1.16+(((((2.07*pi)*1.33)*a)+b)-a))/b)*b)+b)/b)-a)-0.23)+a)*pi)\"\n\"(((((e+(cos(sin(((((tan((sin(pi)+b))+pi)*a)+2.45)/e)))-e))+e)*e)+e)-pi)\"\n\"(((((pi+(b+((((a/(2.47*((e/(pi/1.01))*2.12)))/b)-b)/pi)))-pi)+pi)+a)*b)\"\n\"((cos((3.99/((pi/(cos((e+(1.94*(((2.07+0.79)+b)+e))))+a))+2.07)))/b)/a)\"\n\"((tan((((((((((tan(((b/(a/a))-e))+a)+a)+b)-0.02)/a)-a)-a)+e)+b))/pi)*b)\"\n\"((((((((a-((((((pi/0.73)+e)*a)+1.95)-pi)*pi))+a)-2.27)*b)+e)*3.87)+b)*b)\"\n\"(((((a+(((((((((3.57-a)+a)+3.66)-3.78)+e)/1.04)+pi)-b)-pi))*a)+pi)*a)-a)\"\n\"(((((b/((a*((((((((b+(pi+b))*a)+b)-b)-e)*b)/1.51)*pi))+a))*a)*pi)+pi)*b)\"\n\"((2.57*(cos(tan((((((tan(((tan(pi)*b)+b))/a)+a)+pi)-b)*0.35)))+b))-0.76)\"\n\"((((((((((((((a-3.00)+e)-pi)+a)-a)-1.99)/3.68)*e)+a)+b)+2.49)-0.21)*e)+b)\"\n\"((((((((b+tan((e*((((((a+a)+a)/a)/a)-b)+2.35))))-1.32)+b)+a)+e)/b)+pi)/a)\"\n\"(((((((tan(((cos(((2.34+3.44)/0.44))/b)+b))/1.35)+b)+e)*a)-a)/0.36)-2.06)\"\n\"((b+((tan(((((sin(((cos((2.64+b))/b)+pi))-b)+2.29)-e)-b))+3.15)+b))/3.43)\"\n\"(sin((((((tan((tan((cos((b*((1.03+pi)*pi)))-b))+b))-b)-b)/2.71)+b)/a))+a)\"\n\"((((((((((pi+(((pi+((e+b)-3.15))-e)+2.58))*pi)+a)/b)+e)/0.20)+pi)*b)+b)-b)\"\n\"((((((((1.94+(pi+((((((3.91-b)+a)/b)*a)+b)*3.43)))-b)-b)+b)/a)*1.21)+a)/b)\"\n\"(((b-sin(tan((sin(((((3.22-((0.02/e)*3.49))+pi)*b)/pi))-3.60))))+pi)-3.41)\"\n\"((((tan(((cos(((a+(((((3.66-3.78)+e)/1.04)+pi)-b))-pi))*a)+pi))*a)-a)+e)+b)\"\n\"1.1*a^9+9.9*a^8+8.8*a^7+7.7*a^6+6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"(((cos((a*(((cos((cos(tan((e+((3.11*b)+b))))+2.76))+b)-1.39)/b)))+pi)+a)*pi)\"\n\"((tan(((((cos((cos((((((cos((a/b))+a)/a)*a)+b)-3.91))*a))+b)/a)+e)-e))/e)+b)\"\n\"(1.78+((tan(cos((sin(sin(((((sin((1.07-1.16))*a)-b)-pi)*a)))*pi)))*1.92)-b))\"\n\"((((((((((((((((a-a)*e)/0.87)+a)-e)/b)/b)-2.98)*b)-e)+1.75)+e)+a)/0.84)/b)*e)\"\n\"((((((((((((((1.88-(((b-1.96)/pi)+e))/e)/b)-b)+a)+a)/pi)*a)/e)*b)-a)+b)/e)*b)\"\n\"((((((((e+(((b+(((((2.76+b)-1.39)/b)+pi)+a))*pi)+pi))-b)+e)+0.86)-b)*b)+b)/e)\"\n\"(((((3.123*y)*z)-w)/((3.123+y)+(z*w)))/(((3.123+y)-(z/w))-((3.123*y)+(z-w))))\"\n\"(((((3.123*y)/z)-w)/((3.123-y)-(z*w)))/(((3.123-y)+(z/w))-((3.123+y)*(z*w))))\"\n\"(((((3.123+y)*z)-w)-((3.123+y)-(z*w)))-((3.123*(y-(z*w)))/((3.123*y)+(z+w))))\"\n\"(((((3.123+y)/z)-w)-((3.123-y)+(z*w)))-(((3.123+y)+(z/w))/((3.123*y)-(z-w))))\"\n\"(((((3.123-y)*z)-w)*((3.123+y)-(z/w)))*(((3.123+y)-(z*w))+((3.123/y)+(z+w))))\"\n\"(((((3.123-y)/z)-w)*((3.123-y)+(z/w)))*(((3.123-y)+(z*w))+((3.123/y)-(z-w))))\"\n\"(((((3.123/y)*z)-w)+((3.123+y)+(z/w)))+(((3.123+y)+(z*w))*((3.123/y)+(z-w))))\"\n\"(((((3.123/y)/z)-w)+((3.123-y)-(z/w)))+(((3.123-y)-(z*w))*((3.123+y)*(z/w))))\"\n\"(((((x*5.123)*z)-w)/((x+5.123)+(z*w)))/(((x+5.123)-(z/w))-((x*5.123)+(z-w))))\"\n\"(((((x*5.123)/z)-w)/((x-5.123)-(z*w)))/(((x-5.123)+(z/w))-((x+5.123)*(z*w))))\"\n\"(((((x*y)*7.123)-w)/((x+y)+(7.123*w)))/(((x+y)-(7.123/w))-((x*y)+(7.123-w))))\"\n\"(((((x*y)*z)-9.123)/((x+y)+(z*9.123)))/(((x+y)-(z/9.123))-((x*y)+(z-9.123))))\"\n\"(((((x*y)/7.123)-w)/((x-y)-(7.123*w)))/(((x-y)+(7.123/w))-((x+y)*(7.123*w))))\"\n\"(((((x*y)/z)-9.123)/((x-y)-(z*9.123)))/(((x-y)+(z/9.123))-((x+y)*(z*9.123))))\"\n\"(((((x+5.123)*z)-w)-((x+5.123)-(z*w)))-((x*(5.123-(z*w)))/((x*5.123)+(z+w))))\"\n\"(((((x+5.123)/z)-w)-((x-5.123)+(z*w)))-(((x+5.123)+(z/w))/((x*5.123)-(z-w))))\"\n\"(((((x+y)*7.123)-w)-((x+y)-(7.123*w)))-((x*(y-(7.123*w)))/((x*y)+(7.123+w))))\"\n\"(((((x+y)*z)-9.123)-((x+y)-(z*9.123)))-((x*(y-(z*9.123)))/((x*y)+(z+9.123))))\"\n\"(((((x+y)/7.123)-w)-((x-y)+(7.123*w)))-(((x+y)+(7.123/w))/((x*y)-(7.123-w))))\"\n\"(((((x+y)/z)-9.123)-((x-y)+(z*9.123)))-(((x+y)+(z/9.123))/((x*y)-(z-9.123))))\"\n\"(((((x-5.123)*z)-w)*((x+5.123)-(z/w)))*(((x+5.123)-(z*w))+((x/5.123)+(z+w))))\"\n\"(((((x-5.123)/z)-w)*((x-5.123)+(z/w)))*(((x-5.123)+(z*w))+((x/5.123)-(z-w))))\"\n\"(((((x-y)*7.123)-w)*((x+y)-(7.123/w)))*(((x+y)-(7.123*w))+((x/y)+(7.123+w))))\"\n\"(((((x-y)*z)-9.123)*((x+y)-(z/9.123)))*(((x+y)-(z*9.123))+((x/y)+(z+9.123))))\"\n\"(((((x-y)/7.123)-w)*((x-y)+(7.123/w)))*(((x-y)+(7.123*w))+((x/y)-(7.123-w))))\"\n\"(((((x-y)/z)-9.123)*((x-y)+(z/9.123)))*(((x-y)+(z*9.123))+((x/y)-(z-9.123))))\"\n\"(((((x/5.123)*z)-w)+((x+5.123)+(z/w)))+(((x+5.123)+(z*w))*((x/5.123)+(z-w))))\"\n\"(((((x/5.123)/z)-w)+((x-5.123)-(z/w)))+(((x-5.123)-(z*w))*((x+5.123)*(z/w))))\"\n\"(((((x/y)*7.123)-w)+((x+y)+(7.123/w)))+(((x+y)+(7.123*w))*((x/y)+(7.123-w))))\"\n\"(((((x/y)*z)-9.123)+((x+y)+(z/9.123)))+(((x+y)+(z*9.123))*((x/y)+(z-9.123))))\"\n\"(((((x/y)/7.123)-w)+((x-y)-(7.123/w)))+(((x-y)-(7.123*w))*((x+y)*(7.123/w))))\"\n\"(((((x/y)/z)-9.123)+((x-y)-(z/9.123)))+(((x-y)-(z*9.123))*((x+y)*(z/9.123))))\"\n\"((((3.123*y)*(z+w))+(3.123+((y/z)/w)))+((3.123+((y/z)+w))*((3.123*y)+(z*w))))\"\n\"((((3.123*y)*(z-w))*(3.123-((y*z)/w)))*((3.123-((y-z)*w))+((3.123/y)-(z*w))))\"\n\"((((3.123*y)+(z*w))-((3.123+y)-(z-w)))-(((3.123-y)-(z/w))/((3.123+y)/(z*w))))\"\n\"((((3.123*y)+(z+w))*((3.123/y)/(z-w)))*(((3.123*y)/(z-w))+(3.123-((y-z)/w))))\"\n\"((((3.123*y)+(z-w))+((3.123/y)*(z-w)))+(((3.123*y)*(z-w))*(3.123-((y*z)/w))))\"\n\"((((3.123*y)+(z/w))/((3.123+y)*(z-w)))/(((3.123+y)+(z-w))-((3.123-y)/(z*w))))\"\n\"((((3.123*y)-(z*w))*((3.123+y)+(z-w)))*(((3.123+y)-(z-w))+((3.123+y)/(z/w))))\"\n\"((((3.123*y)-(z+w))+((3.123/y)/(z+w)))+(((3.123*y)/(z+w))*(3.123-((y+z)/w))))\"\n\"((((3.123*y)-(z-w))*(3.123-(y*(z/w))))*((3.123+(y*(z/w)))+(3.123-((y/z)/w))))\"\n\"((((3.123*y)-(z/w))+((3.123+y)/(z-w)))+(((3.123+y)*(z-w))*((3.123-y)/(z/w))))\"\n\"((((3.123*y)/(z+w))*(3.123-((y+z)/w)))*((3.123+((y/z)*w))+((3.123*y)+(z/w))))\"\n\"((((3.123*y)/(z-w))+(3.123-((y-z)/w)))+((3.123-((y+z)*w))*((3.123/y)+(z/w))))\"\n\"((((3.123+y)*(z*w))+(3.123-(y/(z*w))))+((3.123+(y/(z*w)))*(((3.123+y)*z)-w)))\"\n\"((((3.123+y)*(z-w))*((3.123-y)/(z/w)))*(((3.123-y)/(z*w))+(3.123+((y-z)*w))))\"\n\"((((3.123+y)*(z/w))-(3.123+((y+z)/w)))-((3.123-(y/(z*w)))/(((3.123-y)*z)-w)))\"\n\"((((3.123+y)+(z*w))*((3.123/y)+(z-w)))*(((3.123*y)+(z-w))+((3.123/y)*(z-w))))\"\n\"((((3.123+y)+(z-w))-((3.123-y)/(z*w)))-(((3.123+y)/(z/w))/(3.123+((y-z)/w))))\"\n\"((((3.123+y)+(z/w))/((3.123*y)-(z-w)))/(((3.123/y)+(z-w))-(3.123+(y*(z/w)))))\"\n\"((((3.123+y)-(z*w))+((3.123/y)+(z+w)))+(((3.123*y)+(z+w))*((3.123/y)/(z-w))))\"\n\"((((3.123+y)-(z-w))+((3.123+y)/(z/w)))+(((3.123+y)/(z*w))*(3.123+((y+z)*w))))\"\n\"((((3.123+y)-(z/w))-((3.123*y)+(z-w)))-(((3.123/y)+(z+w))/((3.123*y)*(z-w))))\"\n\"((((3.123+y)/(z*w))*(3.123+((y+z)*w)))*((3.123+((y+z)/w))+(((3.123*y)*z)-w)))\"\n\"((((3.123+y)/(z-w))/((3.123-y)*(z*w)))/(((3.123-y)/(z/w))-(3.123+((y*z)/w))))\"\n\"((((3.123+y)/(z/w))/(3.123+((y-z)/w)))/((3.123+((y+z)*w))-(((3.123/y)*z)-w)))\"\n\"((((3.123-y)*(z*w))*(3.123+((y*z)*w)))*((3.123+((y*z)/w))+(((3.123*y)/z)-w)))\"\n\"((((3.123-y)*(z+w))*((3.123/y)*(z+w)))*(((3.123*y)*(z+w))+(3.123+((y/z)/w))))\"\n\"((((3.123-y)*(z/w))/(3.123+((y/z)+w)))/((3.123+((y*z)*w))-(((3.123/y)/z)-w)))\"\n\"((((3.123-y)+(z*w))+((3.123/y)-(z-w)))+(((3.123*y)-(z-w))*(3.123-(y*(z/w)))))\"\n\"((((3.123-y)+(z+w))-((3.123*y)*(z+w)))-(((3.123-y)*(z/w))/(3.123+((y/z)+w))))\"\n\"((((3.123-y)+(z/w))-((3.123+y)*(z*w)))-(((3.123/y)-(z-w))/(3.123+(y/(z*w)))))\"\n\"((((3.123-y)-(z*w))*((3.123+y)*(z/w)))*(((3.123+y)*(z*w))+(3.123-(y/(z*w)))))\"\n\"((((3.123-y)-(z+w))+((3.123-y)*(z/w)))+(((3.123-y)*(z*w))*(3.123+((y*z)*w))))\"\n\"((((3.123-y)-(z/w))/((3.123+y)/(z*w)))/(((3.123+y)*(z/w))-(3.123+((y+z)/w))))\"\n\"((((3.123-y)/(z*w))+(3.123+((y-z)*w)))+((3.123+((y-z)/w))*(((3.123+y)/z)-w)))\"\n\"((((3.123-y)/(z+w))/((3.123*y)/(z+w)))/(((3.123/y)*(z+w))-(3.123+((y/z)*w))))\"\n\"((((3.123-y)/(z/w))-(3.123+((y*z)/w)))-((3.123+((y-z)*w))/(((3.123-y)/z)-w)))\"\n\"((((3.123/y)*(z+w))-(3.123+((y/z)*w)))-((3.123+((y/z)/w))/((3.123*y)-(z*w))))\"\n\"((((3.123/y)*(z-w))/(3.123-((y*z)*w)))/((3.123-((y*z)/w))-(3.123/(y+(z*w)))))\"\n\"((((3.123/y)+(z+w))/((3.123*y)*(z-w)))/(((3.123/y)/(z-w))-(3.123-((y-z)*w))))\"\n\"((((3.123/y)+(z-w))-(3.123+(y*(z/w))))-(((3.123/y)*(z-w))/(3.123-((y*z)*w))))\"\n\"((((3.123/y)+(z/w))-((3.123-y)-(z+w)))-(((3.123+y)/(z-w))/((3.123-y)*(z*w))))\"\n\"((((3.123/y)-(z*w))/((3.123-y)*(z+w)))/(((3.123-y)+(z+w))-((3.123*y)*(z+w))))\"\n\"((((3.123/y)-(z+w))-((3.123*y)/(z-w)))-(((3.123/y)/(z+w))/(3.123-((y+z)*w))))\"\n\"((((3.123/y)-(z-w))/(3.123+(y/(z*w))))/((3.123-(y*(z/w)))-(3.123-((y/z)*w))))\"\n\"((((3.123/y)-(z/w))*((3.123-y)+(z+w)))*(((3.123-y)-(z+w))+((3.123-y)*(z/w))))\"\n\"((((3.123/y)/(z+w))/(3.123-((y+z)*w)))/((3.123-((y+z)/w))-((3.123*y)-(z/w))))\"\n\"((((3.123/y)/(z-w))-(3.123-((y-z)*w)))-((3.123-((y-z)/w))/((3.123/y)-(z/w))))\"\n\"((((x*5.123)*(z+w))+(x+((5.123/z)/w)))+((x+((5.123/z)+w))*((x*5.123)+(z*w))))\"\n\"((((x*5.123)*(z-w))*(x-((5.123*z)/w)))*((x-((5.123-z)*w))+((x/5.123)-(z*w))))\"\n\"((((x*5.123)+(z*w))-((x+5.123)-(z-w)))-(((x-5.123)-(z/w))/((x+5.123)/(z*w))))\"\n\"((((x*5.123)+(z+w))*((x/5.123)/(z-w)))*(((x*5.123)/(z-w))+(x-((5.123-z)/w))))\"\n\"((((x*5.123)+(z-w))+((x/5.123)*(z-w)))+(((x*5.123)*(z-w))*(x-((5.123*z)/w))))\"\n\"((((x*5.123)+(z/w))/((x+5.123)*(z-w)))/(((x+5.123)+(z-w))-((x-5.123)/(z*w))))\"\n\"((((x*5.123)-(z*w))*((x+5.123)+(z-w)))*(((x+5.123)-(z-w))+((x+5.123)/(z/w))))\"\n\"((((x*5.123)-(z+w))+((x/5.123)/(z+w)))+(((x*5.123)/(z+w))*(x-((5.123+z)/w))))\"\n\"((((x*5.123)-(z-w))*(x-(5.123*(z/w))))*((x+(5.123*(z/w)))+(x-((5.123/z)/w))))\"\n\"((((x*5.123)-(z/w))+((x+5.123)/(z-w)))+(((x+5.123)*(z-w))*((x-5.123)/(z/w))))\"\n\"((((x*5.123)/(z+w))*(x-((5.123+z)/w)))*((x+((5.123/z)*w))+((x*5.123)+(z/w))))\"\n\"((((x*5.123)/(z-w))+(x-((5.123-z)/w)))+((x-((5.123+z)*w))*((x/5.123)+(z/w))))\"\n\"((((x*y)*(7.123+w))+(x+((y/7.123)/w)))+((x+((y/7.123)+w))*((x*y)+(7.123*w))))\"\n\"((((x*y)*(7.123-w))*(x-((y*7.123)/w)))*((x-((y-7.123)*w))+((x/y)-(7.123*w))))\"\n\"((((x*y)*(z+9.123))+(x+((y/z)/9.123)))+((x+((y/z)+9.123))*((x*y)+(z*9.123))))\"\n\"((((x*y)*(z-9.123))*(x-((y*z)/9.123)))*((x-((y-z)*9.123))+((x/y)-(z*9.123))))\"\n\"((((x*y)+(7.123*w))-((x+y)-(7.123-w)))-(((x-y)-(7.123/w))/((x+y)/(7.123*w))))\"\n\"((((x*y)+(7.123+w))*((x/y)/(7.123-w)))*(((x*y)/(7.123-w))+(x-((y-7.123)/w))))\"\n\"((((x*y)+(7.123-w))+((x/y)*(7.123-w)))+(((x*y)*(7.123-w))*(x-((y*7.123)/w))))\"\n\"((((x*y)+(7.123/w))/((x+y)*(7.123-w)))/(((x+y)+(7.123-w))-((x-y)/(7.123*w))))\"\n\"((((x*y)+(z*9.123))-((x+y)-(z-9.123)))-(((x-y)-(z/9.123))/((x+y)/(z*9.123))))\"\n\"((((x*y)+(z+9.123))*((x/y)/(z-9.123)))*(((x*y)/(z-9.123))+(x-((y-z)/9.123))))\"\n\"((((x*y)+(z-9.123))+((x/y)*(z-9.123)))+(((x*y)*(z-9.123))*(x-((y*z)/9.123))))\"\n\"((((x*y)+(z/9.123))/((x+y)*(z-9.123)))/(((x+y)+(z-9.123))-((x-y)/(z*9.123))))\"\n\"((((x*y)-(7.123*w))*((x+y)+(7.123-w)))*(((x+y)-(7.123-w))+((x+y)/(7.123/w))))\"\n\"((((x*y)-(7.123+w))+((x/y)/(7.123+w)))+(((x*y)/(7.123+w))*(x-((y+7.123)/w))))\"\n\"((((x*y)-(7.123-w))*(x-(y*(7.123/w))))*((x+(y*(7.123/w)))+(x-((y/7.123)/w))))\"\n\"((((x*y)-(7.123/w))+((x+y)/(7.123-w)))+(((x+y)*(7.123-w))*((x-y)/(7.123/w))))\"\n\"((((x*y)-(z*9.123))*((x+y)+(z-9.123)))*(((x+y)-(z-9.123))+((x+y)/(z/9.123))))\"\n\"((((x*y)-(z+9.123))+((x/y)/(z+9.123)))+(((x*y)/(z+9.123))*(x-((y+z)/9.123))))\"\n\"((((x*y)-(z-9.123))*(x-(y*(z/9.123))))*((x+(y*(z/9.123)))+(x-((y/z)/9.123))))\"\n\"((((x*y)-(z/9.123))+((x+y)/(z-9.123)))+(((x+y)*(z-9.123))*((x-y)/(z/9.123))))\"\n\"((((x*y)/(7.123+w))*(x-((y+7.123)/w)))*((x+((y/7.123)*w))+((x*y)+(7.123/w))))\"\n\"((((x*y)/(7.123-w))+(x-((y-7.123)/w)))+((x-((y+7.123)*w))*((x/y)+(7.123/w))))\"\n\"((((x*y)/(z+9.123))*(x-((y+z)/9.123)))*((x+((y/z)*9.123))+((x*y)+(z/9.123))))\"\n\"((((x*y)/(z-9.123))+(x-((y-z)/9.123)))+((x-((y+z)*9.123))*((x/y)+(z/9.123))))\"\n\"((((x+5.123)*(z*w))+(x-(5.123/(z*w))))+((x+(5.123/(z*w)))*(((x+5.123)*z)-w)))\"\n\"((((x+5.123)*(z-w))*((x-5.123)/(z/w)))*(((x-5.123)/(z*w))+(x+((5.123-z)*w))))\"\n\"((((x+5.123)*(z/w))-(x+((5.123+z)/w)))-((x-(5.123/(z*w)))/(((x-5.123)*z)-w)))\"\n\"((((x+5.123)+(z*w))*((x/5.123)+(z-w)))*(((x*5.123)+(z-w))+((x/5.123)*(z-w))))\"\n\"((((x+5.123)+(z-w))-((x-5.123)/(z*w)))-(((x+5.123)/(z/w))/(x+((5.123-z)/w))))\"\n\"((((x+5.123)+(z/w))/((x*5.123)-(z-w)))/(((x/5.123)+(z-w))-(x+(5.123*(z/w)))))\"\n\"((((x+5.123)-(z*w))+((x/5.123)+(z+w)))+(((x*5.123)+(z+w))*((x/5.123)/(z-w))))\"\n\"((((x+5.123)-(z-w))+((x+5.123)/(z/w)))+(((x+5.123)/(z*w))*(x+((5.123+z)*w))))\"\n\"((((x+5.123)-(z/w))-((x*5.123)+(z-w)))-(((x/5.123)+(z+w))/((x*5.123)*(z-w))))\"\n\"((((x+5.123)/(z*w))*(x+((5.123+z)*w)))*((x+((5.123+z)/w))+(((x*5.123)*z)-w)))\"\n\"((((x+5.123)/(z-w))/((x-5.123)*(z*w)))/(((x-5.123)/(z/w))-(x+((5.123*z)/w))))\"\n\"((((x+5.123)/(z/w))/(x+((5.123-z)/w)))/((x+((5.123+z)*w))-(((x/5.123)*z)-w)))\"\n\"((((x+y)*(7.123*w))+(x-(y/(7.123*w))))+((x+(y/(7.123*w)))*(((x+y)*7.123)-w)))\"\n\"((((x+y)*(7.123-w))*((x-y)/(7.123/w)))*(((x-y)/(7.123*w))+(x+((y-7.123)*w))))\"\n\"((((x+y)*(7.123/w))-(x+((y+7.123)/w)))-((x-(y/(7.123*w)))/(((x-y)*7.123)-w)))\"\n\"((((x+y)*(z*9.123))+(x-(y/(z*9.123))))+((x+(y/(z*9.123)))*(((x+y)*z)-9.123)))\"\n\"((((x+y)*(z-9.123))*((x-y)/(z/9.123)))*(((x-y)/(z*9.123))+(x+((y-z)*9.123))))\"\n\"((((x+y)*(z/9.123))-(x+((y+z)/9.123)))-((x-(y/(z*9.123)))/(((x-y)*z)-9.123)))\"\n\"((((x+y)+(7.123*w))*((x/y)+(7.123-w)))*(((x*y)+(7.123-w))+((x/y)*(7.123-w))))\"\n\"((((x+y)+(7.123-w))-((x-y)/(7.123*w)))-(((x+y)/(7.123/w))/(x+((y-7.123)/w))))\"\n\"((((x+y)+(7.123/w))/((x*y)-(7.123-w)))/(((x/y)+(7.123-w))-(x+(y*(7.123/w)))))\"\n\"((((x+y)+(z*9.123))*((x/y)+(z-9.123)))*(((x*y)+(z-9.123))+((x/y)*(z-9.123))))\"\n\"((((x+y)+(z-9.123))-((x-y)/(z*9.123)))-(((x+y)/(z/9.123))/(x+((y-z)/9.123))))\"\n\"((((x+y)+(z/9.123))/((x*y)-(z-9.123)))/(((x/y)+(z-9.123))-(x+(y*(z/9.123)))))\"\n\"((((x+y)-(7.123*w))+((x/y)+(7.123+w)))+(((x*y)+(7.123+w))*((x/y)/(7.123-w))))\"\n\"((((x+y)-(7.123-w))+((x+y)/(7.123/w)))+(((x+y)/(7.123*w))*(x+((y+7.123)*w))))\"\n\"((((x+y)-(7.123/w))-((x*y)+(7.123-w)))-(((x/y)+(7.123+w))/((x*y)*(7.123-w))))\"\n\"((((x+y)-(z*9.123))+((x/y)+(z+9.123)))+(((x*y)+(z+9.123))*((x/y)/(z-9.123))))\"\n\"((((x+y)-(z-9.123))+((x+y)/(z/9.123)))+(((x+y)/(z*9.123))*(x+((y+z)*9.123))))\"\n\"((((x+y)-(z/9.123))-((x*y)+(z-9.123)))-(((x/y)+(z+9.123))/((x*y)*(z-9.123))))\"\n\"((((x+y)/(7.123*w))*(x+((y+7.123)*w)))*((x+((y+7.123)/w))+(((x*y)*7.123)-w)))\"\n\"((((x+y)/(7.123-w))/((x-y)*(7.123*w)))/(((x-y)/(7.123/w))-(x+((y*7.123)/w))))\"\n\"((((x+y)/(7.123/w))/(x+((y-7.123)/w)))/((x+((y+7.123)*w))-(((x/y)*7.123)-w)))\"\n\"((((x+y)/(z*9.123))*(x+((y+z)*9.123)))*((x+((y+z)/9.123))+(((x*y)*z)-9.123)))\"\n\"((((x+y)/(z-9.123))/((x-y)*(z*9.123)))/(((x-y)/(z/9.123))-(x+((y*z)/9.123))))\"\n\"((((x+y)/(z/9.123))/(x+((y-z)/9.123)))/((x+((y+z)*9.123))-(((x/y)*z)-9.123)))\"\n\"((((x-5.123)*(z*w))*(x+((5.123*z)*w)))*((x+((5.123*z)/w))+(((x*5.123)/z)-w)))\"\n\"((((x-5.123)*(z+w))*((x/5.123)*(z+w)))*(((x*5.123)*(z+w))+(x+((5.123/z)/w))))\"\n\"((((x-5.123)*(z/w))/(x+((5.123/z)+w)))/((x+((5.123*z)*w))-(((x/5.123)/z)-w)))\"\n\"((((x-5.123)+(z*w))+((x/5.123)-(z-w)))+(((x*5.123)-(z-w))*(x-(5.123*(z/w)))))\"\n\"((((x-5.123)+(z+w))-((x*5.123)*(z+w)))-(((x-5.123)*(z/w))/(x+((5.123/z)+w))))\"\n\"((((x-5.123)+(z/w))-((x+5.123)*(z*w)))-(((x/5.123)-(z-w))/(x+(5.123/(z*w)))))\"\n\"((((x-5.123)-(z*w))*((x+5.123)*(z/w)))*(((x+5.123)*(z*w))+(x-(5.123/(z*w)))))\"\n\"((((x-5.123)-(z+w))+((x-5.123)*(z/w)))+(((x-5.123)*(z*w))*(x+((5.123*z)*w))))\"\n\"((((x-5.123)-(z/w))/((x+5.123)/(z*w)))/(((x+5.123)*(z/w))-(x+((5.123+z)/w))))\"\n\"((((x-5.123)/(z*w))+(x+((5.123-z)*w)))+((x+((5.123-z)/w))*(((x+5.123)/z)-w)))\"\n\"((((x-5.123)/(z+w))/((x*5.123)/(z+w)))/(((x/5.123)*(z+w))-(x+((5.123/z)*w))))\"\n\"((((x-5.123)/(z/w))-(x+((5.123*z)/w)))-((x+((5.123-z)*w))/(((x-5.123)/z)-w)))\"\n\"((((x-y)*(7.123*w))*(x+((y*7.123)*w)))*((x+((y*7.123)/w))+(((x*y)/7.123)-w)))\"\n\"((((x-y)*(7.123+w))*((x/y)*(7.123+w)))*(((x*y)*(7.123+w))+(x+((y/7.123)/w))))\"\n\"((((x-y)*(7.123/w))/(x+((y/7.123)+w)))/((x+((y*7.123)*w))-(((x/y)/7.123)-w)))\"\n\"((((x-y)*(z*9.123))*(x+((y*z)*9.123)))*((x+((y*z)/9.123))+(((x*y)/z)-9.123)))\"\n\"((((x-y)*(z+9.123))*((x/y)*(z+9.123)))*(((x*y)*(z+9.123))+(x+((y/z)/9.123))))\"\n\"((((x-y)*(z/9.123))/(x+((y/z)+9.123)))/((x+((y*z)*9.123))-(((x/y)/z)-9.123)))\"\n\"((((x-y)+(7.123*w))+((x/y)-(7.123-w)))+(((x*y)-(7.123-w))*(x-(y*(7.123/w)))))\"\n\"((((x-y)+(7.123+w))-((x*y)*(7.123+w)))-(((x-y)*(7.123/w))/(x+((y/7.123)+w))))\"\n\"((((x-y)+(7.123/w))-((x+y)*(7.123*w)))-(((x/y)-(7.123-w))/(x+(y/(7.123*w)))))\"\n\"((((x-y)+(z*9.123))+((x/y)-(z-9.123)))+(((x*y)-(z-9.123))*(x-(y*(z/9.123)))))\"\n\"((((x-y)+(z+9.123))-((x*y)*(z+9.123)))-(((x-y)*(z/9.123))/(x+((y/z)+9.123))))\"\n\"((((x-y)+(z/9.123))-((x+y)*(z*9.123)))-(((x/y)-(z-9.123))/(x+(y/(z*9.123)))))\"\n\"((((x-y)-(7.123*w))*((x+y)*(7.123/w)))*(((x+y)*(7.123*w))+(x-(y/(7.123*w)))))\"\n\"((((x-y)-(7.123+w))+((x-y)*(7.123/w)))+(((x-y)*(7.123*w))*(x+((y*7.123)*w))))\"\n\"((((x-y)-(7.123/w))/((x+y)/(7.123*w)))/(((x+y)*(7.123/w))-(x+((y+7.123)/w))))\"\n\"((((x-y)-(z*9.123))*((x+y)*(z/9.123)))*(((x+y)*(z*9.123))+(x-(y/(z*9.123)))))\"\n\"((((x-y)-(z+9.123))+((x-y)*(z/9.123)))+(((x-y)*(z*9.123))*(x+((y*z)*9.123))))\"\n\"((((x-y)-(z/9.123))/((x+y)/(z*9.123)))/(((x+y)*(z/9.123))-(x+((y+z)/9.123))))\"\n\"((((x-y)/(7.123*w))+(x+((y-7.123)*w)))+((x+((y-7.123)/w))*(((x+y)/7.123)-w)))\"\n\"((((x-y)/(7.123+w))/((x*y)/(7.123+w)))/(((x/y)*(7.123+w))-(x+((y/7.123)*w))))\"\n\"((((x-y)/(7.123/w))-(x+((y*7.123)/w)))-((x+((y-7.123)*w))/(((x-y)/7.123)-w)))\"\n\"((((x-y)/(z*9.123))+(x+((y-z)*9.123)))+((x+((y-z)/9.123))*(((x+y)/z)-9.123)))\"\n\"((((x-y)/(z+9.123))/((x*y)/(z+9.123)))/(((x/y)*(z+9.123))-(x+((y/z)*9.123))))\"\n\"((((x-y)/(z/9.123))-(x+((y*z)/9.123)))-((x+((y-z)*9.123))/(((x-y)/z)-9.123)))\"\n\"((((x/5.123)*(z+w))-(x+((5.123/z)*w)))-((x+((5.123/z)/w))/((x*5.123)-(z*w))))\"\n\"((((x/5.123)*(z-w))/(x-((5.123*z)*w)))/((x-((5.123*z)/w))-(x/(5.123+(z*w)))))\"\n\"((((x/5.123)+(z+w))/((x*5.123)*(z-w)))/(((x/5.123)/(z-w))-(x-((5.123-z)*w))))\"\n\"((((x/5.123)+(z-w))-(x+(5.123*(z/w))))-(((x/5.123)*(z-w))/(x-((5.123*z)*w))))\"\n\"((((x/5.123)+(z/w))-((x-5.123)-(z+w)))-(((x+5.123)/(z-w))/((x-5.123)*(z*w))))\"\n\"((((x/5.123)-(z*w))/((x-5.123)*(z+w)))/(((x-5.123)+(z+w))-((x*5.123)*(z+w))))\"\n\"((((x/5.123)-(z+w))-((x*5.123)/(z-w)))-(((x/5.123)/(z+w))/(x-((5.123+z)*w))))\"\n\"((((x/5.123)-(z-w))/(x+(5.123/(z*w))))/((x-(5.123*(z/w)))-(x-((5.123/z)*w))))\"\n\"((((x/5.123)-(z/w))*((x-5.123)+(z+w)))*(((x-5.123)-(z+w))+((x-5.123)*(z/w))))\"\n\"((((x/5.123)/(z+w))/(x-((5.123+z)*w)))/((x-((5.123+z)/w))-((x*5.123)-(z/w))))\"\n\"((((x/5.123)/(z-w))-(x-((5.123-z)*w)))-((x-((5.123-z)/w))/((x/5.123)-(z/w))))\"\n\"((((x/y)*(7.123+w))-(x+((y/7.123)*w)))-((x+((y/7.123)/w))/((x*y)-(7.123*w))))\"\n\"((((x/y)*(7.123-w))/(x-((y*7.123)*w)))/((x-((y*7.123)/w))-(x/(y+(7.123*w)))))\"\n\"((((x/y)*(z+9.123))-(x+((y/z)*9.123)))-((x+((y/z)/9.123))/((x*y)-(z*9.123))))\"\n\"((((x/y)*(z-9.123))/(x-((y*z)*9.123)))/((x-((y*z)/9.123))-(x/(y+(z*9.123)))))\"\n\"((((x/y)+(7.123+w))/((x*y)*(7.123-w)))/(((x/y)/(7.123-w))-(x-((y-7.123)*w))))\"\n\"((((x/y)+(7.123-w))-(x+(y*(7.123/w))))-(((x/y)*(7.123-w))/(x-((y*7.123)*w))))\"\n\"((((x/y)+(7.123/w))-((x-y)-(7.123+w)))-(((x+y)/(7.123-w))/((x-y)*(7.123*w))))\"\n\"((((x/y)+(z+9.123))/((x*y)*(z-9.123)))/(((x/y)/(z-9.123))-(x-((y-z)*9.123))))\"\n\"((((x/y)+(z-9.123))-(x+(y*(z/9.123))))-(((x/y)*(z-9.123))/(x-((y*z)*9.123))))\"\n\"((((x/y)+(z/9.123))-((x-y)-(z+9.123)))-(((x+y)/(z-9.123))/((x-y)*(z*9.123))))\"\n\"((((x/y)-(7.123*w))/((x-y)*(7.123+w)))/(((x-y)+(7.123+w))-((x*y)*(7.123+w))))\"\n\"((((x/y)-(7.123+w))-((x*y)/(7.123-w)))-(((x/y)/(7.123+w))/(x-((y+7.123)*w))))\"\n\"((((x/y)-(7.123-w))/(x+(y/(7.123*w))))/((x-(y*(7.123/w)))-(x-((y/7.123)*w))))\"\n\"((((x/y)-(7.123/w))*((x-y)+(7.123+w)))*(((x-y)-(7.123+w))+((x-y)*(7.123/w))))\"\n\"((((x/y)-(z*9.123))/((x-y)*(z+9.123)))/(((x-y)+(z+9.123))-((x*y)*(z+9.123))))\"\n\"((((x/y)-(z+9.123))-((x*y)/(z-9.123)))-(((x/y)/(z+9.123))/(x-((y+z)*9.123))))\"\n\"((((x/y)-(z-9.123))/(x+(y/(z*9.123))))/((x-(y*(z/9.123)))-(x-((y/z)*9.123))))\"\n\"((((x/y)-(z/9.123))*((x-y)+(z+9.123)))*(((x-y)-(z+9.123))+((x-y)*(z/9.123))))\"\n\"((((x/y)/(7.123+w))/(x-((y+7.123)*w)))/((x-((y+7.123)/w))-((x*y)-(7.123/w))))\"\n\"((((x/y)/(7.123-w))-(x-((y-7.123)*w)))-((x-((y-7.123)/w))/((x/y)-(7.123/w))))\"\n\"((((x/y)/(z+9.123))/(x-((y+z)*9.123)))/((x-((y+z)/9.123))-((x*y)-(z/9.123))))\"\n\"((((x/y)/(z-9.123))-(x-((y-z)*9.123)))-((x-((y-z)/9.123))/((x/y)-(z/9.123))))\"\n\"(((3.123*(y+(z*w)))*((3.123/y)-(z+w)))*(((3.123*y)-(z+w))+((3.123/y)/(z+w))))\"\n\"(((3.123*(y-(z*w)))/((3.123*y)+(z+w)))/(((3.123/y)-(z+w))-((3.123*y)/(z-w))))\"\n\"(((3.123+((y*z)*w))-(((3.123/y)/z)-w))-((((3.123*y)/z)-w)/((3.123-y)-(z*w))))\"\n\"(((3.123+((y*z)/w))+(((3.123*y)/z)-w))+((((3.123-y)/z)-w)*((3.123-y)+(z/w))))\"\n\"(((3.123+((y+z)*w))-(((3.123/y)*z)-w))-((((3.123*y)*z)-w)/((3.123+y)+(z*w))))\"\n\"(((3.123+((y+z)/w))+(((3.123*y)*z)-w))+((((3.123-y)*z)-w)*((3.123+y)-(z/w))))\"\n\"(((3.123+((y-z)*w))/(((3.123-y)/z)-w))/((((3.123+y)/z)-w)-((3.123-y)+(z*w))))\"\n\"(((3.123+((y-z)/w))*(((3.123+y)/z)-w))*((((3.123/y)*z)-w)+((3.123+y)+(z/w))))\"\n\"(((3.123+((y/z)*w))+((3.123*y)+(z/w)))+(((3.123*y)-(z*w))*((3.123+y)+(z-w))))\"\n\"(((3.123+((y/z)+w))*((3.123*y)+(z*w)))*((((3.123/y)/z)-w)+((3.123-y)-(z/w))))\"\n\"(((3.123+((y/z)/w))/((3.123*y)-(z*w)))/(((3.123*y)+(z*w))-((3.123+y)-(z-w))))\"\n\"(((3.123+(y*(z/w)))+(3.123-((y/z)/w)))+((3.123-((y*z)*w))*(3.123/(y-(z*w)))))\"\n\"(((3.123+(y/(z*w)))*(((3.123+y)*z)-w))*((3.123-((y/z)*w))+(3.123*(y-(z*w)))))\"\n\"(((3.123-((y*z)*w))*(3.123/(y-(z*w))))*((3.123/(y+(z*w)))+((3.123-y)/(z+w))))\"\n\"(((3.123-((y*z)/w))-(3.123/(y+(z*w))))-(((3.123/y)-(z*w))/((3.123-y)*(z+w))))\"\n\"(((3.123-((y+z)*w))*((3.123/y)+(z/w)))*(((3.123*y)-(z/w))+((3.123+y)/(z-w))))\"\n\"(((3.123-((y+z)/w))-((3.123*y)-(z/w)))-(((3.123*y)+(z/w))/((3.123+y)*(z-w))))\"\n\"(((3.123-((y-z)*w))+((3.123/y)-(z*w)))+(((3.123/y)-(z/w))*((3.123-y)+(z+w))))\"\n\"(((3.123-((y-z)/w))/((3.123/y)-(z/w)))/(((3.123/y)+(z/w))-((3.123-y)-(z+w))))\"\n\"(((3.123-((y/z)*w))+(3.123*(y-(z*w))))+((3.123*(y+(z*w)))*((3.123/y)-(z+w))))\"\n\"(((3.123-((y/z)/w))/(3.123*(y+(z*w))))/((3.123/(y-(z*w)))-((3.123*y)-(z+w))))\"\n\"(((3.123-(y*(z/w)))-(3.123-((y/z)*w)))-((3.123-((y/z)/w))/(3.123*(y+(z*w)))))\"\n\"(((3.123-(y/(z*w)))/(((3.123-y)*z)-w))/((((3.123+y)*z)-w)-((3.123+y)-(z*w))))\"\n\"(((3.123/(y+(z*w)))+((3.123-y)/(z+w)))+(((3.123-y)*(z+w))*((3.123/y)*(z+w))))\"\n\"(((3.123/(y-(z*w)))-((3.123*y)-(z+w)))-(((3.123-y)/(z+w))/((3.123*y)/(z+w))))\"\n\"(((x*(5.123+(z*w)))*((x/5.123)-(z+w)))*(((x*5.123)-(z+w))+((x/5.123)/(z+w))))\"\n\"(((x*(5.123-(z*w)))/((x*5.123)+(z+w)))/(((x/5.123)-(z+w))-((x*5.123)/(z-w))))\"\n\"(((x*(y+(7.123*w)))*((x/y)-(7.123+w)))*(((x*y)-(7.123+w))+((x/y)/(7.123+w))))\"\n\"(((x*(y+(z*9.123)))*((x/y)-(z+9.123)))*(((x*y)-(z+9.123))+((x/y)/(z+9.123))))\"\n\"(((x*(y-(7.123*w)))/((x*y)+(7.123+w)))/(((x/y)-(7.123+w))-((x*y)/(7.123-w))))\"\n\"(((x*(y-(z*9.123)))/((x*y)+(z+9.123)))/(((x/y)-(z+9.123))-((x*y)/(z-9.123))))\"\n\"(((x+((5.123*z)*w))-(((x/5.123)/z)-w))-((((x*5.123)/z)-w)/((x-5.123)-(z*w))))\"\n\"(((x+((5.123*z)/w))+(((x*5.123)/z)-w))+((((x-5.123)/z)-w)*((x-5.123)+(z/w))))\"\n\"(((x+((5.123+z)*w))-(((x/5.123)*z)-w))-((((x*5.123)*z)-w)/((x+5.123)+(z*w))))\"\n\"(((x+((5.123+z)/w))+(((x*5.123)*z)-w))+((((x-5.123)*z)-w)*((x+5.123)-(z/w))))\"\n\"(((x+((5.123-z)*w))/(((x-5.123)/z)-w))/((((x+5.123)/z)-w)-((x-5.123)+(z*w))))\"\n\"(((x+((5.123-z)/w))*(((x+5.123)/z)-w))*((((x/5.123)*z)-w)+((x+5.123)+(z/w))))\"\n\"(((x+((5.123/z)*w))+((x*5.123)+(z/w)))+(((x*5.123)-(z*w))*((x+5.123)+(z-w))))\"\n\"(((x+((5.123/z)+w))*((x*5.123)+(z*w)))*((((x/5.123)/z)-w)+((x-5.123)-(z/w))))\"\n\"(((x+((5.123/z)/w))/((x*5.123)-(z*w)))/(((x*5.123)+(z*w))-((x+5.123)-(z-w))))\"\n\"(((x+((y*7.123)*w))-(((x/y)/7.123)-w))-((((x*y)/7.123)-w)/((x-y)-(7.123*w))))\"\n\"(((x+((y*7.123)/w))+(((x*y)/7.123)-w))+((((x-y)/7.123)-w)*((x-y)+(7.123/w))))\"\n\"(((x+((y*z)*9.123))-(((x/y)/z)-9.123))-((((x*y)/z)-9.123)/((x-y)-(z*9.123))))\"\n\"(((x+((y*z)/9.123))+(((x*y)/z)-9.123))+((((x-y)/z)-9.123)*((x-y)+(z/9.123))))\"\n\"(((x+((y+7.123)*w))-(((x/y)*7.123)-w))-((((x*y)*7.123)-w)/((x+y)+(7.123*w))))\"\n\"(((x+((y+7.123)/w))+(((x*y)*7.123)-w))+((((x-y)*7.123)-w)*((x+y)-(7.123/w))))\"\n\"(((x+((y+z)*9.123))-(((x/y)*z)-9.123))-((((x*y)*z)-9.123)/((x+y)+(z*9.123))))\"\n\"(((x+((y+z)/9.123))+(((x*y)*z)-9.123))+((((x-y)*z)-9.123)*((x+y)-(z/9.123))))\"\n\"(((x+((y-7.123)*w))/(((x-y)/7.123)-w))/((((x+y)/7.123)-w)-((x-y)+(7.123*w))))\"\n\"(((x+((y-7.123)/w))*(((x+y)/7.123)-w))*((((x/y)*7.123)-w)+((x+y)+(7.123/w))))\"\n\"(((x+((y-z)*9.123))/(((x-y)/z)-9.123))/((((x+y)/z)-9.123)-((x-y)+(z*9.123))))\"\n\"(((x+((y-z)/9.123))*(((x+y)/z)-9.123))*((((x/y)*z)-9.123)+((x+y)+(z/9.123))))\"\n\"(((x+((y/7.123)*w))+((x*y)+(7.123/w)))+(((x*y)-(7.123*w))*((x+y)+(7.123-w))))\"\n\"(((x+((y/7.123)+w))*((x*y)+(7.123*w)))*((((x/y)/7.123)-w)+((x-y)-(7.123/w))))\"\n\"(((x+((y/7.123)/w))/((x*y)-(7.123*w)))/(((x*y)+(7.123*w))-((x+y)-(7.123-w))))\"\n\"(((x+((y/z)*9.123))+((x*y)+(z/9.123)))+(((x*y)-(z*9.123))*((x+y)+(z-9.123))))\"\n\"(((x+((y/z)+9.123))*((x*y)+(z*9.123)))*((((x/y)/z)-9.123)+((x-y)-(z/9.123))))\"\n\"(((x+((y/z)/9.123))/((x*y)-(z*9.123)))/(((x*y)+(z*9.123))-((x+y)-(z-9.123))))\"\n\"(((x+(5.123*(z/w)))+(x-((5.123/z)/w)))+((x-((5.123*z)*w))*(x/(5.123-(z*w)))))\"\n\"(((x+(5.123/(z*w)))*(((x+5.123)*z)-w))*((x-((5.123/z)*w))+(x*(5.123-(z*w)))))\"\n\"(((x+(y*(7.123/w)))+(x-((y/7.123)/w)))+((x-((y*7.123)*w))*(x/(y-(7.123*w)))))\"\n\"(((x+(y*(z/9.123)))+(x-((y/z)/9.123)))+((x-((y*z)*9.123))*(x/(y-(z*9.123)))))\"\n\"(((x+(y/(7.123*w)))*(((x+y)*7.123)-w))*((x-((y/7.123)*w))+(x*(y-(7.123*w)))))\"\n\"(((x+(y/(z*9.123)))*(((x+y)*z)-9.123))*((x-((y/z)*9.123))+(x*(y-(z*9.123)))))\"\n\"(((x-((5.123*z)*w))*(x/(5.123-(z*w))))*((x/(5.123+(z*w)))+((x-5.123)/(z+w))))\"\n\"(((x-((5.123*z)/w))-(x/(5.123+(z*w))))-(((x/5.123)-(z*w))/((x-5.123)*(z+w))))\"\n\"(((x-((5.123+z)*w))*((x/5.123)+(z/w)))*(((x*5.123)-(z/w))+((x+5.123)/(z-w))))\"\n\"(((x-((5.123+z)/w))-((x*5.123)-(z/w)))-(((x*5.123)+(z/w))/((x+5.123)*(z-w))))\"\n\"(((x-((5.123-z)*w))+((x/5.123)-(z*w)))+(((x/5.123)-(z/w))*((x-5.123)+(z+w))))\"\n\"(((x-((5.123-z)/w))/((x/5.123)-(z/w)))/(((x/5.123)+(z/w))-((x-5.123)-(z+w))))\"\n\"(((x-((5.123/z)*w))+(x*(5.123-(z*w))))+((x*(5.123+(z*w)))*((x/5.123)-(z+w))))\"\n\"(((x-((5.123/z)/w))/(x*(5.123+(z*w))))/((x/(5.123-(z*w)))-((x*5.123)-(z+w))))\"\n\"(((x-((y*7.123)*w))*(x/(y-(7.123*w))))*((x/(y+(7.123*w)))+((x-y)/(7.123+w))))\"\n\"(((x-((y*7.123)/w))-(x/(y+(7.123*w))))-(((x/y)-(7.123*w))/((x-y)*(7.123+w))))\"\n\"(((x-((y*z)*9.123))*(x/(y-(z*9.123))))*((x/(y+(z*9.123)))+((x-y)/(z+9.123))))\"\n\"(((x-((y*z)/9.123))-(x/(y+(z*9.123))))-(((x/y)-(z*9.123))/((x-y)*(z+9.123))))\"\n\"(((x-((y+7.123)*w))*((x/y)+(7.123/w)))*(((x*y)-(7.123/w))+((x+y)/(7.123-w))))\"\n\"(((x-((y+7.123)/w))-((x*y)-(7.123/w)))-(((x*y)+(7.123/w))/((x+y)*(7.123-w))))\"\n\"(((x-((y+z)*9.123))*((x/y)+(z/9.123)))*(((x*y)-(z/9.123))+((x+y)/(z-9.123))))\"\n\"(((x-((y+z)/9.123))-((x*y)-(z/9.123)))-(((x*y)+(z/9.123))/((x+y)*(z-9.123))))\"\n\"(((x-((y-7.123)*w))+((x/y)-(7.123*w)))+(((x/y)-(7.123/w))*((x-y)+(7.123+w))))\"\n\"(((x-((y-7.123)/w))/((x/y)-(7.123/w)))/(((x/y)+(7.123/w))-((x-y)-(7.123+w))))\"\n\"(((x-((y-z)*9.123))+((x/y)-(z*9.123)))+(((x/y)-(z/9.123))*((x-y)+(z+9.123))))\"\n\"(((x-((y-z)/9.123))/((x/y)-(z/9.123)))/(((x/y)+(z/9.123))-((x-y)-(z+9.123))))\"\n\"(((x-((y/7.123)*w))+(x*(y-(7.123*w))))+((x*(y+(7.123*w)))*((x/y)-(7.123+w))))\"\n\"(((x-((y/7.123)/w))/(x*(y+(7.123*w))))/((x/(y-(7.123*w)))-((x*y)-(7.123+w))))\"\n\"(((x-((y/z)*9.123))+(x*(y-(z*9.123))))+((x*(y+(z*9.123)))*((x/y)-(z+9.123))))\"\n\"(((x-((y/z)/9.123))/(x*(y+(z*9.123))))/((x/(y-(z*9.123)))-((x*y)-(z+9.123))))\"\n\"(((x-(5.123*(z/w)))-(x-((5.123/z)*w)))-((x-((5.123/z)/w))/(x*(5.123+(z*w)))))\"\n\"(((x-(5.123/(z*w)))/(((x-5.123)*z)-w))/((((x+5.123)*z)-w)-((x+5.123)-(z*w))))\"\n\"(((x-(y*(7.123/w)))-(x-((y/7.123)*w)))-((x-((y/7.123)/w))/(x*(y+(7.123*w)))))\"\n\"(((x-(y*(z/9.123)))-(x-((y/z)*9.123)))-((x-((y/z)/9.123))/(x*(y+(z*9.123)))))\"\n\"(((x-(y/(7.123*w)))/(((x-y)*7.123)-w))/((((x+y)*7.123)-w)-((x+y)-(7.123*w))))\"\n\"(((x-(y/(z*9.123)))/(((x-y)*z)-9.123))/((((x+y)*z)-9.123)-((x+y)-(z*9.123))))\"\n\"(((x/(5.123+(z*w)))+((x-5.123)/(z+w)))+(((x-5.123)*(z+w))*((x/5.123)*(z+w))))\"\n\"(((x/(5.123-(z*w)))-((x*5.123)-(z+w)))-(((x-5.123)/(z+w))/((x*5.123)/(z+w))))\"\n\"(((x/(y+(7.123*w)))+((x-y)/(7.123+w)))+(((x-y)*(7.123+w))*((x/y)*(7.123+w))))\"\n\"(((x/(y+(z*9.123)))+((x-y)/(z+9.123)))+(((x-y)*(z+9.123))*((x/y)*(z+9.123))))\"\n\"(((x/(y-(7.123*w)))-((x*y)-(7.123+w)))-(((x-y)/(7.123+w))/((x*y)/(7.123+w))))\"\n\"(((x/(y-(z*9.123)))-((x*y)-(z+9.123)))-(((x-y)/(z+9.123))/((x*y)/(z+9.123))))\"\n\"((0.96+(((0.96-((((((((((e+b)+a)/a)*a)-1.01)*b)-3.19)+pi)*b)+e))-a)+2.07))/a)\"\n\"((b+((((((((((((((2.44*pi)+b)-pi)-b)+a)+e)*a)*a)/2.41)-a)*pi)*a)*2.70)/b))*a)\"\n\"((pi/((((((((((((b+(((pi-pi)-pi)/b))/a)-e)*a)/e)*a)/e)+pi)-a)/1.82)+b)*a))*a)\"\n\"(b/((((((pi+(((((((((b+b)*3.92)*a)*a)/pi)/a)*0.27)-0.23)+a))+a)*e)+pi)-a)/e))\"\n\"cos(((e+((e+(tan((sin((((1.55-(((a+pi)/b)/pi))+pi)+e))-a))+3.94))+2.45))+pi))\"\n\"((a+(((((((((((a+(((((3.77/pi)+b)+a)+e)+b))+a)-a)+b)-e)+a)-a)-pi)*b)+b)*a))+a)\"\n\"tan(((a/((((a+(b+(cos(cos(tan((((3.14/3.54)*a)+0.34))))/e)))+b)-pi)+3.13))*e))\"\n\"(((((((((((123.456-654.321)*1.1)*2.2)*3.3)+4.4)+5.5)+6.6)*7.7)*8.8)+9.9)+10.10)\"\n\"((1.01*(((((((cos(tan(((sin(((a*b)/a))/pi)+b)))+pi)/b)/b)+a)-e)+b)*2.38))+0.88)\"\n\"((tan((((((pi+((b*((tan(((a*(e+1.09))-pi))+b)/e))*b))+1.55)+a)+0.01)+pi))/a)*a)\"\n\"(1.1*(2.2*(3.3*(4.4+(5.5+(6.6+(7.7*(8.8*(9.9*(10.10*(123.456+654.321)))))))))))\"\n\"2.2*y+z-w-2.2/y+z-w*2.2*y-z-w*2.2/y-z-w-2.2+y*z*w+2.2+y*z/w+2.2+y/z*w-2.2+y/z/w\"\n\"2.2+y+z/w+2.2+y+z*w+2.2+y-z/w-2.2+y-z*w+2.2+y*z/w*2.2+y*z*w-2.2+y/z+w+2.2+y/z/w\"\n\"2.2+y/z*w-2.2-y+z/w*2.2-y+z*w*2.2-y-z/w-2.2-y-z*w+2.2-y*z/w+2.2-y*z*w-2.2-y/z/w\"\n\"2.2-y+z*w*2.2-y+z/w-2.2-y-z*w+2.2-y-z/w*2.2+y-z-w-2.2+y-z-w*2.2+y+z-w*2.2+y+z-w\"\n\"2.2-y-z+w+2.2-y-z+w+2.2-y+z+w-2.2-y+z+w+2.2*y-z+w*2.2/y-z+w-2.2*y+z+w+2.2/y+z+w\"\n\"2.2-y/z*w*2.2+y*z-w-2.2-y*z-w+2.2*y*z-w*2.2/y*z-w-2.2+y/z-w*2.2-y/z-w*2.2*y/z-w\"\n\"2.2-y/z*w*2.2-y/z/w-2.2-y*z*w+2.2-y*z/w*2.2*y*z+w-2.2/y*z+w*2.2*y/z+w*2.2/y/z+w\"\n\"2.2/y+z*w-2.2/y-z*w*2.2*y+z*w*2.2*y-z*w-2.2+y-z*w+2.2+y-z/w+2.2+y+z*w-2.2+y+z/w\"\n\"2.2/y/z-w+2.2*y+z*w+2.2*y-z*w-2.2*y+z/w+2.2*y-z/w*2.2/y+z/w-2.2/y-z/w+2.2/y-z*w\"\n\"sin((((sin((tan((((((((2.98+((a*a)+3.96))/pi)+e)+pi)+e)*a)+a))+a))+3.35)+e)+b))\"\n\"sin((tan((((((tan(sin(((cos(((((a+2.04)-b)/e)/e))-pi)+e)))+a)+pi)+a)+b)+b))+a))\"\n\"x*3.3+z-w-x/3.3+z-w*x*3.3-z-w*x/3.3-z-w-x+3.3*z*w+x+3.3*z/w+x+3.3/z*w-x+3.3/z/w\"\n\"x*y+4.4-w-x/y+4.4-w*x*y-4.4-w*x/y-4.4-w-x+y*4.4*w+x+y*4.4/w+x+y/4.4*w-x+y/4.4/w\"\n\"x*y+z-5.5-x/y+z-5.5*x*y-z-5.5*x/y-z-5.5-x+y*z*5.5+x+y*z/5.5+x+y/z*5.5-x+y/z/5.5\"\n\"x+3.3+z/w+x+3.3+z*w+x+3.3-z/w-x+3.3-z*w+x+3.3*z/w*x+3.3*z*w-x+3.3/z+w+x+3.3/z/w\"\n\"x+3.3/z*w-x-3.3+z/w*x-3.3+z*w*x-3.3-z/w-x-3.3-z*w+x-3.3*z/w+x-3.3*z*w-x-3.3/z/w\"\n\"x+y+4.4/w+x+y+4.4*w+x+y-4.4/w-x+y-4.4*w+x+y*4.4/w*x+y*4.4*w-x+y/4.4+w+x+y/4.4/w\"\n\"x+y+z/5.5+x+y+z*5.5+x+y-z/5.5-x+y-z*5.5+x+y*z/5.5*x+y*z*5.5-x+y/z+5.5+x+y/z/5.5\"\n\"x+y/4.4*w-x-y+4.4/w*x-y+4.4*w*x-y-4.4/w-x-y-4.4*w+x-y*4.4/w+x-y*4.4*w-x-y/4.4/w\"\n\"x+y/z*5.5-x-y+z/5.5*x-y+z*5.5*x-y-z/5.5-x-y-z*5.5+x-y*z/5.5+x-y*z*5.5-x-y/z/5.5\"\n\"x-3.3+z*w*x-3.3+z/w-x-3.3-z*w+x-3.3-z/w*x+3.3-z-w-x+3.3-z-w*x+3.3+z-w*x+3.3+z-w\"\n\"x-3.3-z+w+x-3.3-z+w+x-3.3+z+w-x-3.3+z+w+x*3.3-z+w*x/3.3-z+w-x*3.3+z+w+x/3.3+z+w\"\n\"x-3.3/z*w*x+3.3*z-w-x-3.3*z-w+x*3.3*z-w*x/3.3*z-w-x+3.3/z-w*x-3.3/z-w*x*3.3/z-w\"\n\"x-3.3/z*w*x-3.3/z/w-x-3.3*z*w+x-3.3*z/w*x*3.3*z+w-x/3.3*z+w*x*3.3/z+w*x/3.3/z+w\"\n\"x-y+4.4*w*x-y+4.4/w-x-y-4.4*w+x-y-4.4/w*x+y-4.4-w-x+y-4.4-w*x+y+4.4-w*x+y+4.4-w\"\n\"x-y+z*5.5*x-y+z/5.5-x-y-z*5.5+x-y-z/5.5*x+y-z-5.5-x+y-z-5.5*x+y+z-5.5*x+y+z-5.5\"\n\"x-y-4.4+w+x-y-4.4+w+x-y+4.4+w-x-y+4.4+w+x*y-4.4+w*x/y-4.4+w-x*y+4.4+w+x/y+4.4+w\"\n\"x-y-z+5.5+x-y-z+5.5+x-y+z+5.5-x-y+z+5.5+x*y-z+5.5*x/y-z+5.5-x*y+z+5.5+x/y+z+5.5\"\n\"x-y/4.4*w*x+y*4.4-w-x-y*4.4-w+x*y*4.4-w*x/y*4.4-w-x+y/4.4-w*x-y/4.4-w*x*y/4.4-w\"\n\"x-y/4.4*w*x-y/4.4/w-x-y*4.4*w+x-y*4.4/w*x*y*4.4+w-x/y*4.4+w*x*y/4.4+w*x/y/4.4+w\"\n\"x-y/z*5.5*x+y*z-5.5-x-y*z-5.5+x*y*z-5.5*x/y*z-5.5-x+y/z-5.5*x-y/z-5.5*x*y/z-5.5\"\n\"x-y/z*5.5*x-y/z/5.5-x-y*z*5.5+x-y*z/5.5*x*y*z+5.5-x/y*z+5.5*x*y/z+5.5*x/y/z+5.5\"\n\"x/3.3+z*w-x/3.3-z*w*x*3.3+z*w*x*3.3-z*w-x+3.3-z*w+x+3.3-z/w+x+3.3+z*w-x+3.3+z/w\"\n\"x/3.3/z-w+x*3.3+z*w+x*3.3-z*w-x*3.3+z/w+x*3.3-z/w*x/3.3+z/w-x/3.3-z/w+x/3.3-z*w\"\n\"x/y+4.4*w-x/y-4.4*w*x*y+4.4*w*x*y-4.4*w-x+y-4.4*w+x+y-4.4/w+x+y+4.4*w-x+y+4.4/w\"\n\"x/y+z*5.5-x/y-z*5.5*x*y+z*5.5*x*y-z*5.5-x+y-z*5.5+x+y-z/5.5+x+y+z*5.5-x+y+z/5.5\"\n\"x/y/4.4-w+x*y+4.4*w+x*y-4.4*w-x*y+4.4/w+x*y-4.4/w*x/y+4.4/w-x/y-4.4/w+x/y-4.4*w\"\n\"x/y/z-5.5+x*y+z*5.5+x*y-z*5.5-x*y+z/5.5+x*y-z/5.5*x/y+z/5.5-x/y-z/5.5+x/y-z*5.5\"\n\"(((2.64+((3.73-((((((b-(((((b/a)-a)/3.37)-b)+a))-0.35)*e)/1.85)+e)+b))+e))*a)-b)\"\n\"(((a*((cos(((tan(cos((3.45+(sin(tan(((b-b)+b)))*e))))-b)+a))/1.47)+pi))/a)/0.09)\"\n\"cos((tan(((tan((((((((pi-tan((3.86-pi)))/b)-e)+0.90)/a)+a)/1.49))-pi)/2.24))*b))\"\n\"tan((((((((tan(cos((b+((((a/a)-0.94)/a)*b))))/pi)*1.89)/1.57)+0.57)-e)/0.15)/b))\"\n\"(((((((((((((0.38+((((a*a)-e)+b)-e))+3.29)+2.12)+b)/e)+b)/e)*a)*b)+b)+e)+2.06)/e)\"\n\"(((((((((((((((b+((a+pi)/0.14))-3.53)-a)*e)*b)+b)/b)+3.90)*b)+1.01)/e)+b)+e)*a)+b)\"\n\"(((((pi+(((((1.97+((((((b+3.90)+a)+a)+a)+a)+2.03))-pi)+0.00)+a)+a))+3.07)*a)+e)*a)\"\n\"((((tan(sin((((cos(((pi*(tan((e*(b/a)))/a))+b))+b)+3.90)+0.32)))+b)/1.30)-0.08)*a)\"\n\"(cos(((tan(sin(tan(((((sin(((tan((tan(e)+b))+b)/a))*a)/a)-a)+e))))-e)/1.63))*0.14)\"\n\"(((((((((((((((1.40+(a-pi))+b)*pi)*e)+pi)+a)+b)*2.51)/a)-3.58)/e)-3.62)-2.28)-e)/e)\"\n\"((3.123*y*z+3.123+y/z+3.123+y+z+3.123-y*z+3.123+y-z-3.123*y+z-3.123*y-z/3.123/y+z))\"\n\"((3.123*y*z-3.123/y*z-3.123/y/z-3.123-y/z-3.123*y+z*3.123-y*z*3.123+y*z*3.123+y+z))\"\n\"((3.123*y+z*3.123-y*z*3.123+y*z*3.123+y+z*3.123+y/z/3.123-y/z/3.123-y*z-3.123/y/z))\"\n\"((3.123*y+z*3.123/y*z*3.123/y+z*3.123*y/z*3.123/y-z/3.123-y+z/3.123-y-z/3.123+y/z))\"\n\"((3.123*y-z/3.123+y*z/3.123+y/z/3.123-y/z/3.123+y+z+3.123-y*z+3.123*y+z*3.123/y*z))\"\n\"((3.123*y-z/3.123/y+z/3.123/y-z/3.123-y+z/3.123/y*z+3.123-y-z+3.123-y/z+3.123+y*z))\"\n\"((3.123*y/z+3.123/y-z+3.123/y*z+3.123-y-z+3.123/y/z-3.123-y/z-3.123-y*z-3.123+y-z))\"\n\"((3.123*y/z-3.123+y+z-3.123+y-z-3.123*y+z-3.123+y/z+3.123*y-z+3.123*y/z+3.123/y-z))\"\n\"((3.123+y*z*3.123+y+z*3.123-y/z+3.123/y-z*3.123-y*z-3.123/y/z-3.123/y*z-3.123*y*z))\"\n\"((3.123+y*z-3.123*y/z-3.123*y*z-3.123/y*z-3.123/y+z*3.123/y/z*3.123*y+z*3.123-y*z))\"\n\"((3.123+y+z+3.123-y*z+3.123*y+z*3.123/y*z+3.123*y-z/3.123/y+z/3.123/y-z/3.123-y+z))\"\n\"((3.123+y+z/3.123/y+z/3.123/y-z/3.123*y+z/3.123/y/z+3.123*y-z+3.123*y*z+3.123+y/z))\"\n\"((3.123+y-z*3.123*y*z*3.123/y+z*3.123/y/z*3.123/y-z/3.123*y+z/3.123*y-z/3.123+y*z))\"\n\"((3.123+y-z-3.123*y+z-3.123*y-z/3.123/y+z-3.123*y/z+3.123/y-z+3.123/y*z+3.123-y-z))\"\n\"((3.123+y/z+3.123*y-z+3.123*y/z+3.123/y-z+3.123*y*z-3.123/y*z-3.123/y/z-3.123-y/z))\"\n\"((3.123+y/z/3.123-y/z/3.123-y*z-3.123/y/z/3.123*y+z*3.123/y*z*3.123/y+z*3.123*y/z))\"\n\"((3.123-y*z-3.123+y-z-3.123+y+z/3.123/y+z-3.123-y/z+3.123/y-z+3.123/y/z+3.123*y-z))\"\n\"((3.123-y*z-3.123/y/z-3.123/y*z-3.123*y*z-3.123/y+z*3.123*y/z*3.123-y+z*3.123+y-z))\"\n\"((3.123-y+z*3.123+y-z*3.123+y/z+3.123*y-z*3.123+y*z-3.123*y/z-3.123*y*z-3.123/y*z))\"\n\"((3.123-y-z/3.123+y/z/3.123+y*z-3.123*y/z/3.123+y-z*3.123*y*z*3.123/y+z*3.123/y/z))\"\n\"((3.123-y/z+3.123+y*z+3.123+y-z*3.123*y*z+3.123+y+z/3.123/y+z/3.123/y-z/3.123*y+z))\"\n\"((3.123-y/z+3.123/y-z+3.123/y/z+3.123*y-z+3.123/y*z-3.123*y*z-3.123*y/z-3.123+y+z))\"\n\"((3.123/y*z+3.123-y-z+3.123-y/z+3.123+y*z+3.123-y*z-3.123+y-z-3.123+y+z/3.123/y+z))\"\n\"((3.123/y*z-3.123*y*z-3.123*y/z-3.123+y+z-3.123-y+z*3.123+y-z*3.123+y/z+3.123*y-z))\"\n\"((3.123/y+z*3.123*y/z*3.123-y+z*3.123+y-z*3.123-y-z/3.123+y/z/3.123+y*z-3.123*y/z))\"\n\"((3.123/y+z*3.123/y/z*3.123*y+z*3.123-y*z*3.123*y-z/3.123+y*z/3.123+y/z/3.123-y/z))\"\n\"((3.123/y-z/3.123*y+z/3.123*y-z/3.123+y*z/3.123*y*z+3.123+y/z+3.123+y+z+3.123-y*z))\"\n\"((3.123/y-z/3.123-y+z/3.123-y-z/3.123+y/z/3.123-y/z+3.123+y*z+3.123+y-z*3.123*y*z))\"\n\"((3.123/y/z+3.123*y-z+3.123*y*z+3.123+y/z+3.123*y/z-3.123+y+z-3.123+y-z-3.123*y+z))\"\n\"((3.123/y/z-3.123-y/z-3.123-y*z-3.123+y-z-3.123+y*z*3.123+y+z*3.123-y/z+3.123/y-z))\"\n\"((x*5.123*z+x+5.123/z+x+5.123+z+x-5.123*z+x+5.123-z-x*5.123+z-x*5.123-z/x/5.123+z))\"\n\"((x*5.123*z-x/5.123*z-x/5.123/z-x-5.123/z-x*5.123+z*x-5.123*z*x+5.123*z*x+5.123+z))\"\n\"((x*5.123+z*x-5.123*z*x+5.123*z*x+5.123+z*x+5.123/z/x-5.123/z/x-5.123*z-x/5.123/z))\"\n\"((x*5.123+z*x/5.123*z*x/5.123+z*x*5.123/z*x/5.123-z/x-5.123+z/x-5.123-z/x+5.123/z))\"\n\"((x*5.123-z/x+5.123*z/x+5.123/z/x-5.123/z/x+5.123+z+x-5.123*z+x*5.123+z*x/5.123*z))\"\n\"((x*5.123-z/x/5.123+z/x/5.123-z/x-5.123+z/x/5.123*z+x-5.123-z+x-5.123/z+x+5.123*z))\"\n\"((x*5.123/z+x/5.123-z+x/5.123*z+x-5.123-z+x/5.123/z-x-5.123/z-x-5.123*z-x+5.123-z))\"\n\"((x*5.123/z-x+5.123+z-x+5.123-z-x*5.123+z-x+5.123/z+x*5.123-z+x*5.123/z+x/5.123-z))\"\n\"((x*y*7.123+x+y/7.123+x+y+7.123+x-y*7.123+x+y-7.123-x*y+7.123-x*y-7.123/x/y+7.123))\"\n\"((x*y*7.123-x/y*7.123-x/y/7.123-x-y/7.123-x*y+7.123*x-y*7.123*x+y*7.123*x+y+7.123))\"\n\"((x*y+7.123*x-y*7.123*x+y*7.123*x+y+7.123*x+y/7.123/x-y/7.123/x-y*7.123-x/y/7.123))\"\n\"((x*y+7.123*x/y*7.123*x/y+7.123*x*y/7.123*x/y-7.123/x-y+7.123/x-y-7.123/x+y/7.123))\"\n\"((x*y-7.123/x+y*7.123/x+y/7.123/x-y/7.123/x+y+7.123+x-y*7.123+x*y+7.123*x/y*7.123))\"\n\"((x*y-7.123/x/y+7.123/x/y-7.123/x-y+7.123/x/y*7.123+x-y-7.123+x-y/7.123+x+y*7.123))\"\n\"((x*y/7.123+x/y-7.123+x/y*7.123+x-y-7.123+x/y/7.123-x-y/7.123-x-y*7.123-x+y-7.123))\"\n\"((x*y/7.123-x+y+7.123-x+y-7.123-x*y+7.123-x+y/7.123+x*y-7.123+x*y/7.123+x/y-7.123))\"\n\"((x+5.123*z*x+5.123+z*x-5.123/z+x/5.123-z*x-5.123*z-x/5.123/z-x/5.123*z-x*5.123*z))\"\n\"((x+5.123*z-x*5.123/z-x*5.123*z-x/5.123*z-x/5.123+z*x/5.123/z*x*5.123+z*x-5.123*z))\"\n\"((x+5.123+z+x-5.123*z+x*5.123+z*x/5.123*z+x*5.123-z/x/5.123+z/x/5.123-z/x-5.123+z))\"\n\"((x+5.123+z/x/5.123+z/x/5.123-z/x*5.123+z/x/5.123/z+x*5.123-z+x*5.123*z+x+5.123/z))\"\n\"((x+5.123-z*x*5.123*z*x/5.123+z*x/5.123/z*x/5.123-z/x*5.123+z/x*5.123-z/x+5.123*z))\"\n\"((x+5.123-z-x*5.123+z-x*5.123-z/x/5.123+z-x*5.123/z+x/5.123-z+x/5.123*z+x-5.123-z))\"\n\"((x+5.123/z+x*5.123-z+x*5.123/z+x/5.123-z+x*5.123*z-x/5.123*z-x/5.123/z-x-5.123/z))\"\n\"((x+5.123/z/x-5.123/z/x-5.123*z-x/5.123/z/x*5.123+z*x/5.123*z*x/5.123+z*x*5.123/z))\"\n\"((x+y*7.123*x+y+7.123*x-y/7.123+x/y-7.123*x-y*7.123-x/y/7.123-x/y*7.123-x*y*7.123))\"\n\"((x+y*7.123-x*y/7.123-x*y*7.123-x/y*7.123-x/y+7.123*x/y/7.123*x*y+7.123*x-y*7.123))\"\n\"((x+y+7.123+x-y*7.123+x*y+7.123*x/y*7.123+x*y-7.123/x/y+7.123/x/y-7.123/x-y+7.123))\"\n\"((x+y+7.123/x/y+7.123/x/y-7.123/x*y+7.123/x/y/7.123+x*y-7.123+x*y*7.123+x+y/7.123))\"\n\"((x+y-7.123*x*y*7.123*x/y+7.123*x/y/7.123*x/y-7.123/x*y+7.123/x*y-7.123/x+y*7.123))\"\n\"((x+y-7.123-x*y+7.123-x*y-7.123/x/y+7.123-x*y/7.123+x/y-7.123+x/y*7.123+x-y-7.123))\"\n\"((x+y/7.123+x*y-7.123+x*y/7.123+x/y-7.123+x*y*7.123-x/y*7.123-x/y/7.123-x-y/7.123))\"\n\"((x+y/7.123/x-y/7.123/x-y*7.123-x/y/7.123/x*y+7.123*x/y*7.123*x/y+7.123*x*y/7.123))\"\n\"((x-5.123*z-x+5.123-z-x+5.123+z/x/5.123+z-x-5.123/z+x/5.123-z+x/5.123/z+x*5.123-z))\"\n\"((x-5.123*z-x/5.123/z-x/5.123*z-x*5.123*z-x/5.123+z*x*5.123/z*x-5.123+z*x+5.123-z))\"\n\"((x-5.123+z*x+5.123-z*x+5.123/z+x*5.123-z*x+5.123*z-x*5.123/z-x*5.123*z-x/5.123*z))\"\n\"((x-5.123-z/x+5.123/z/x+5.123*z-x*5.123/z/x+5.123-z*x*5.123*z*x/5.123+z*x/5.123/z))\"\n\"((x-5.123/z+x+5.123*z+x+5.123-z*x*5.123*z+x+5.123+z/x/5.123+z/x/5.123-z/x*5.123+z))\"\n\"((x-5.123/z+x/5.123-z+x/5.123/z+x*5.123-z+x/5.123*z-x*5.123*z-x*5.123/z-x+5.123+z))\"\n\"((x-y*7.123-x+y-7.123-x+y+7.123/x/y+7.123-x-y/7.123+x/y-7.123+x/y/7.123+x*y-7.123))\"\n\"((x-y*7.123-x/y/7.123-x/y*7.123-x*y*7.123-x/y+7.123*x*y/7.123*x-y+7.123*x+y-7.123))\"\n\"((x-y+7.123*x+y-7.123*x+y/7.123+x*y-7.123*x+y*7.123-x*y/7.123-x*y*7.123-x/y*7.123))\"\n\"((x-y-7.123/x+y/7.123/x+y*7.123-x*y/7.123/x+y-7.123*x*y*7.123*x/y+7.123*x/y/7.123))\"\n\"((x-y/7.123+x+y*7.123+x+y-7.123*x*y*7.123+x+y+7.123/x/y+7.123/x/y-7.123/x*y+7.123))\"\n\"((x-y/7.123+x/y-7.123+x/y/7.123+x*y-7.123+x/y*7.123-x*y*7.123-x*y/7.123-x+y+7.123))\"\n\"((x/5.123*z+x-5.123-z+x-5.123/z+x+5.123*z+x-5.123*z-x+5.123-z-x+5.123+z/x/5.123+z))\"\n\"((x/5.123*z-x*5.123*z-x*5.123/z-x+5.123+z-x-5.123+z*x+5.123-z*x+5.123/z+x*5.123-z))\"\n\"((x/5.123+z*x*5.123/z*x-5.123+z*x+5.123-z*x-5.123-z/x+5.123/z/x+5.123*z-x*5.123/z))\"\n\"((x/5.123+z*x/5.123/z*x*5.123+z*x-5.123*z*x*5.123-z/x+5.123*z/x+5.123/z/x-5.123/z))\"\n\"((x/5.123-z/x*5.123+z/x*5.123-z/x+5.123*z/x*5.123*z+x+5.123/z+x+5.123+z+x-5.123*z))\"\n\"((x/5.123-z/x-5.123+z/x-5.123-z/x+5.123/z/x-5.123/z+x+5.123*z+x+5.123-z*x*5.123*z))\"\n\"((x/5.123/z+x*5.123-z+x*5.123*z+x+5.123/z+x*5.123/z-x+5.123+z-x+5.123-z-x*5.123+z))\"\n\"((x/5.123/z-x-5.123/z-x-5.123*z-x+5.123-z-x+5.123*z*x+5.123+z*x-5.123/z+x/5.123-z))\"\n\"((x/y*7.123+x-y-7.123+x-y/7.123+x+y*7.123+x-y*7.123-x+y-7.123-x+y+7.123/x/y+7.123))\"\n\"((x/y*7.123-x*y*7.123-x*y/7.123-x+y+7.123-x-y+7.123*x+y-7.123*x+y/7.123+x*y-7.123))\"\n\"((x/y+7.123*x*y/7.123*x-y+7.123*x+y-7.123*x-y-7.123/x+y/7.123/x+y*7.123-x*y/7.123))\"\n\"((x/y+7.123*x/y/7.123*x*y+7.123*x-y*7.123*x*y-7.123/x+y*7.123/x+y/7.123/x-y/7.123))\"\n\"((x/y-7.123/x*y+7.123/x*y-7.123/x+y*7.123/x*y*7.123+x+y/7.123+x+y+7.123+x-y*7.123))\"\n\"((x/y-7.123/x-y+7.123/x-y-7.123/x+y/7.123/x-y/7.123+x+y*7.123+x+y-7.123*x*y*7.123))\"\n\"((x/y/7.123+x*y-7.123+x*y*7.123+x+y/7.123+x*y/7.123-x+y+7.123-x+y-7.123-x*y+7.123))\"\n\"((x/y/7.123-x-y/7.123-x-y*7.123-x+y-7.123-x+y*7.123*x+y+7.123*x-y/7.123+x/y-7.123))\"\n\"((((a+((((((((((2.61*(((a/a)/a)-a))+3.20)/a)+a)+b)+b)/a)+pi)+pi)-2.19))*a)*pi)+1.91)\"\n\"(e*((tan(((((b+sin(sin((((((((e*a)+b)+0.60)/3.37)+b)/a)-e))))+a)-b)/0.12))+a)+1.04))\"\n\"2.2*a^10+1.1*a^9+9.9*a^8+8.8*a^7+7.7*a^6+6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"(((((((((e/((((((e-(e+((b/b)/a)))+a)/b)/3.64)-a)+a))+b)/3.44)-a)/b)+2.48)*a)/0.59)+a)\"\n\"((((((pi/((e-(((((((((pi+b)+a)+2.26)/pi)*e)/3.17)+a)/a)-0.67))+a))+a)*3.32)-pi)/a)*e)\"\n\"(((cos(((sin((b*(pi+((b*((cos((((2.46+1.72)+3.77)+b))/1.02)+a))*a))))/a)+a))*a)-a)*b)\"\n\"((e-(((((((((((((2.79+((pi+e)/e))*b)*b)*e)-0.20)+a)-a)-0.04)*e)/1.40)+b)+b)+1.23))-b)\"\n\"(((((((((((((((pi+((b/a)*pi))+pi)/2.70)-pi)*a)+3.10)+a)+0.52)/b)/pi)-b)+b)+a)-3.38)+a)\"\n\"(((((((((b*(((pi/((((a+((b*a)/b))*2.40)*b)+a))-pi)/b))+e)+3.72)-a)+a)*pi)-pi)/a)/2.84)\"\n\"((((tan((((3.51+((((1.30-((b-((pi+b)/e))*e))-2.31)/1.96)-0.04))*3.50)+b))/e)/a)+pi)-e)\"\n\"(((tan((((cos(((((cos((a/(((b+b)+a)+b)))+pi)-e)/a)+e))/2.19)+2.51)*2.55))+1.93)-a)+pi)\"\n\"((cos((cos(sin(cos(((((cos(((((cos(pi)/3.34)*b)+3.95)+b))*pi)+1.04)*b)/a))))-a))-e)/e)\"\n\"(0.76-((((((((((((e*((((((a-b)/1.15)-b)*b)+e)/pi))-pi)+a)+e)*a)*a)+e)-e)-a)/e)*pi)+e))\"\n\"(sin(cos((a-(cos((((sin(((b*cos((((pi+(a/b))-0.82)*0.02)))-a))/0.12)/pi)*a))/b))))/pi)\"\n\"sin((b-sin(cos((a-(sin(((((cos((sin(sin((((a/e)*3.19)+0.46)))+a))+e)*a)*a)-a))*a))))))\"\n\"(((((((b*((b+(((((b-(((e*2.43)+b)*a))/b)+1.04)-e)-b))/e))+2.24)+a)+a)/3.02)/3.41)/0.96)\"\n\"((1.1+a+2.2+b+3.3)+c+4.4+a+5.5+b+6.6+c+7.7)/(1.1+a+2.2+b+3.3+c+4.4+a+5.5+(b+6.6+c+7.7))\"\n\"(1.1+a+2.2+b+3.3+c+4.4+(a+5.5+b+6.6)+c+7.7)*(1.1+(a+2.2+b+3.3)+c+4.4+a+5.5+b+6.6+c+7.7)\"\n\"(a/((((b+(((e*(((((pi*((((3.45*((pi+a)+pi))+b)+b)*a))+0.68)+e)+a)/a))+a)+b))+b)*a)-pi))\"\n\"((((b*((a/(((((((1.94+((((((b+a)+b)-b)-2.67)+b)+b))+pi)/3.93)+e)+pi)+a)/b))-a))+a)*a)-a)\"\n\"((2.81-(tan((((((sin((cos(tan(((((tan(e)/b)+e)/0.84)+b)))-b))-a)*e)/pi)/2.47)*a))/e))-a)\"\n\"((((((((((((((((((b-0.27)*a)*0.65)-b)+e)+e)-3.26)*b)*3.54)+b)*b)-a)-a)*0.09)+pi)+b)-a)/e)\"\n\"((((((((a/b)*(1.1/2.2))*(2.2/3.3))*(3.3/4.4))*(4.4/5.5))*(5.5/6.6))*(6.6/7.7))*(7.7/8.8))\"\n\"((((((((a/b)+(1.1/2.2))+(2.2/3.3))+(3.3/4.4))+(4.4/5.5))+(5.5/6.6))+(6.6/7.7))+(7.7/8.8))\"\n\"((((e-sin(((cos(tan((((((2.79+sin((((e/e)*b)*b)))*e)-0.20)+a)-a)))-0.04)*e)))/1.40)+b)+b)\"\n\"((((((((((pi-(((1.43*(((((((b-e)*pi)-b)*2.49)/a)+b)*e))+a)-e))-pi)+a)/e)/b)/b)+a)*a)-a)/b)\"\n\"(((((a/((((((a+(((((3.44/((0.99*b)*a))+b)/pi)-2.31)/b))*a)*b)+2.62)/pi)/a))+b)-a)+a)*1.70)\"\n\"(sin((b-((tan((tan(tan((cos(((cos(cos((((a-(a+b))/a)*b)))+b)/b))+e)))/1.00))/a)/0.33)))+a)\"\n\"tan(cos(sin(((((((tan(((cos((((pi+(sin(e)-a))*b)+pi))+a)+3.29))+a)+1.23)+3.89)/e)/e)-b))))\"\n\"((((((((((((((((((pi/0.04)-0.93)/3.48)+pi)+b)+b)+b)+b)/b)-2.93)/b)*b)+a)*3.05)+pi)+e)+a)/b)\"\n\"((((a+((((tan((cos(((sin(((e+((2.96*0.40)/3.81))*pi))-1.87)+e))+a))/pi)+a)+b)+pi))*e)+a)+a)\"\n\"(((a*(((b/(((((((pi*(((((e/2.80)*e)*0.33)+b)+a))-e)*3.35)+a)*a)+2.99)-0.38))+b)+pi))-a)+pi)\"\n\"((sin(cos((cos((((a+((sin(((cos(sin((tan((b/a))+pi)))/a)+b))-b)+0.70))+e)-e))*a)))-b)+1.55)\"\n\"(b+(((((((((pi+(((((((((b*3.17)+a)+a)+pi)+2.69)/a)/b)+b)*a))*3.97)-b)/b)/b)+e)-e)/3.02)+e))\"\n\"(b+(((2.46-(e/sin(tan((0.32+(((((((tan(cos(cos(pi)))-2.11)/b)+1.39)+a)-e)+e)/b))))))+e)*e))\"\n\"cos(((((((tan((e-((cos(tan(((sin((a+(1.81/b)))+b)+b)))/0.05)-a)))*pi)+e)*2.03)-a)+0.52)+a))\"\n\"cos(((tan(((tan(tan(tan((tan(((((sin((((b+3.63)/a)+a))/b)+b)+0.43)-a))+b))))+b)*pi))+e)+a))\"\n\"(((((((((((((((((((a/(b-a))+1.06)/b)+a)+pi)*a)*a)+2.39)+b)+b)*e)-b)+b)+0.28)+a)+a)/e)-a)+pi)\"\n\"(((a*((sin(cos(((((((((e+((((2.78/b)/b)*e)-e))/0.28)+b)+a)-pi)+b)/a)*3.21)))+a)+b))+0.55)-a)\"\n\"((((((sin(((((((((((0.44+((e-a)*pi))*b)+2.60)*a)+a)-pi)-0.14)+b)+e)-b))+a)+b)+a)+b)+pi)/0.52)\"\n\"(((((x*y)*z)-(x/(y*z)))-((x/(y/z))-(x-(y/z))))-(((x*(y+z))*(x-(y*z)))*((x+(y*z))*((x+y)+z))))\"\n\"(((((x*y)+z)*((x/y)*z))*((x/(y+z))*(x*(y/z))))*(((x/(y-z))/(x-(y+z)))/((x-(y-z))/((x+y)/z))))\"\n\"(((((x*y)-z)/(x/(y+z)))/((x/(y-z))/(x-(y+z))))/(((x/(y*z))+(x-(y-z)))+((x-(y/z))+((x+y)*z))))\"\n\"(((((x*y)/z)+(x/(y-z)))+((x/(y*z))+(x-(y-z))))+(((x/(y/z))-(x-(y/z)))-((x-(y*z))-((x+y)-z))))\"\n\"(((((x+y)*z)-((x*y)/z))-(((x*y)*z)-(x/(y*z))))-((((x/y)+z)*(x/(y/z)))*((x*(y+z))*(x-(y*z)))))\"\n\"(((((x+y)+z)/((x/y)+z))/(((x/y)-z)/(x*(y+z))))/((((x/y)/z)+(x*(y-z)))+((x*(y*z))+(x+(y/z)))))\"\n\"(((((x+y)-z)*((x*y)*z))*(((x/y)+z)*(x/(y/z))))*((((x/y)-z)/(x*(y+z)))/((x*(y-z))/(x+(y*z)))))\"\n\"(((((x+y)/z)+((x*y)-z))+(((x*y)/z)+(x/(y-z))))+((((x*y)*z)-(x/(y*z)))-((x/(y/z))-(x-(y/z)))))\"\n\"(((((x-y)*z)-((x/y)/z))-(((x/y)*z)-(x*(y*z))))-(((x/(y+z))*(x*(y/z)))*((x-(y+z))*(x+(y-z)))))\"\n\"(((((x-y)/z)+((x/y)-z))+(((x/y)/z)+(x*(y-z))))+((((x/y)*z)-(x*(y*z)))-((x*(y/z))-(x+(y+z)))))\"\n\"(((((x/y)*z)-(x*(y*z)))-((x*(y/z))-(x+(y+z))))-(((x-(y+z))*(x+(y-z)))*(((x+y)/z)+((x*y)-z))))\"\n\"(((((x/y)+z)*(x/(y/z)))*((x*(y+z))*(x-(y*z))))*(((x*(y-z))/(x+(y*z)))/((x+(y/z))/((x-y)/z))))\"\n\"(((((x/y)-z)/(x*(y+z)))/((x*(y-z))/(x+(y*z))))/(((x*(y*z))+(x+(y/z)))+((x+(y+z))+((x-y)*z))))\"\n\"(((((x/y)/z)+(x*(y-z)))+((x*(y*z))+(x+(y/z))))+(((x*(y/z))-(x+(y+z)))-((x+(y-z))-((x*y)+z))))\"\n\"((((x*(y*z))+(x+(y/z)))+((x+(y+z))+((x-y)*z)))+(((x+(y-z))-((x*y)+z))-(((x*y)-z)/(x/(y+z)))))\"\n\"((((x*(y+z))*(x-(y*z)))*((x+(y*z))*((x+y)+z)))*(((x+(y/z))/((x-y)/z))/(((x-y)*z)-((x/y)/z))))\"\n\"((((x*(y-z))/(x+(y*z)))/((x+(y/z))/((x-y)/z)))/(((x+(y+z))+((x-y)*z))+(((x*y)+z)*((x/y)*z))))\"\n\"((((x*(y/z))-(x+(y+z)))-((x+(y-z))-((x*y)+z)))-((((x+y)/z)+((x*y)-z))+(((x*y)/z)+(x/(y-z)))))\"\n\"((((x+(y*z))*((x+y)+z))*(((x-y)/z)+((x/y)-z)))*((((x-y)*z)-((x/y)/z))-(((x/y)*z)-(x*(y*z)))))\"\n\"((((x+(y+z))+((x-y)*z))+(((x*y)+z)*((x/y)*z)))+((((x*y)-z)/(x/(y+z)))/((x/(y-z))/(x-(y+z)))))\"\n\"((((x+(y-z))-((x*y)+z))-(((x*y)-z)/(x/(y+z))))-((((x*y)/z)+(x/(y-z)))+((x/(y*z))+(x-(y-z)))))\"\n\"((((x+(y/z))/((x-y)/z))/(((x-y)*z)-((x/y)/z)))/((((x*y)+z)*((x/y)*z))*((x/(y+z))*(x*(y/z)))))\"\n\"((((x-(y*z))-((x+y)-z))-(((x+y)+z)/((x/y)+z)))-((((x-y)/z)+((x/y)-z))+(((x/y)/z)+(x*(y-z)))))\"\n\"((((x-(y+z))*(x+(y-z)))*(((x+y)/z)+((x*y)-z)))*((((x+y)*z)-((x*y)/z))-(((x*y)*z)-(x/(y*z)))))\"\n\"((((x-(y-z))/((x+y)/z))/(((x+y)*z)-((x*y)/z)))/((((x+y)-z)*((x*y)*z))*(((x/y)+z)*(x/(y/z)))))\"\n\"((((x-(y/z))+((x+y)*z))+(((x+y)-z)*((x*y)*z)))+((((x+y)+z)/((x/y)+z))/(((x/y)-z)/(x*(y+z)))))\"\n\"((((x/(y*z))+(x-(y-z)))+((x-(y/z))+((x+y)*z)))+(((x-(y*z))-((x+y)-z))-(((x+y)+z)/((x/y)+z))))\"\n\"((((x/(y+z))*(x*(y/z)))*((x-(y+z))*(x+(y-z))))*(((x-(y-z))/((x+y)/z))/(((x+y)*z)-((x*y)/z))))\"\n\"((((x/(y-z))/(x-(y+z)))/((x-(y-z))/((x+y)/z)))/(((x-(y/z))+((x+y)*z))+(((x+y)-z)*((x*y)*z))))\"\n\"((((x/(y/z))-(x-(y/z)))-((x-(y*z))-((x+y)-z)))-(((x+(y*z))*((x+y)+z))*(((x-y)/z)+((x/y)-z))))\"\n\"((b*((a*((tan((cos(cos((b*(((((cos(((a-b)+a))+a)+b)*2.48)*a)+0.61))))*a))*0.87)*a))/a))*0.02)\"\n\"(a/tan((cos(cos(((sin(((tan((((b-((cos((a+((a*b)*e)))+3.06)/b))+a)+e))*0.82)+e))*e)/e)))-e)))\"\n\"3.3*a^11+2.2*a^10+1.1*a^9+9.9*a^8+8.8*a^7+7.7*a^6+6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"(pi/(((((((((e*(a/((((b+(((e*sin(tan(2.63)))+pi)+1.04))*a)+e)/b)))-b)/b)+b)*0.43)-a)+b)/a)-e))\"\n\"(((((((((((((((((((b+e)+b)+a)+1.48)+1.61)-a)-b)+3.19)+e)/e)+e)+b)+b)-a)+0.58)-e)-1.22)-3.12)+a)\"\n\"((((((((((((b+(((((((((a*a)+b)*a)-b)-e)-1.21)+b)*a)/e))+1.65)+a)+e)*a)/e)*1.16)+a)+e)*b)+e)+pi)\"\n\"(((b-((((((((((((((((((2.65*a)+a)/a)-b)*e)+a)/e)+b)-b)*2.96)/a)-pi)+b)+e)/a)+b)+3.14)-b))+e)*e)\"\n\"((3.47+(((((((pi-(cos(tan(((cos((0.03/(3.18+a)))-b)-3.88)))+3.77))*b)-pi)+b)+3.76)+3.54)*b))-a)\"\n\"1.1*x^2+2.2*1.1/y^3-2.2-1.1*x^2+2.2-1.1/y^3-2.2-1.1*x^2+2.2+1.1/y^3-2.2*1.1*x^2+2.2-1.1/y^3-2.2\"\n\"1.1*x^2+2.2+1.1/y^3-2.2*1.1*x^2+2.2*1.1/y^3-2.2+1.1*x^2+2.2-1.1/y^3-2.2+1.1*x^2+2.2+1.1/y^3-2.2\"\n\"1.1*x^2+2.2-1.1/y^3-2.2+1.1*x^2+2.2*1.1/y^3-2.2*1.1*x^2+2.2*1.1/y^3-2.2-1.1*x^2+2.2+1.1/y^3-2.2\"\n\"tan(((sin((((((((2.48/tan((sin(tan((((2.85/3.51)+b)*1.83)))*3.19)))/b)+a)+e)*b)+pi)+e))/pi)-a))\"\n\"(((((((((a*(((((((((((b-e)*e)*3.81)/b)*b)+b)+e)*1.80)+a)-b)+e))/b)*0.25)+b)+b)-2.61)*0.89)/a)*a)\"\n\"(((((a-((((2.43+((((b/(b+((((a/3.08)-b)+b)*a)))*e)+pi)+2.56))-a)+2.96)*0.40))/3.81)*pi)-1.87)+e)\"\n\"(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1++1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)\"\n\"(((((((((cos(((pi-(tan(((sin((((a/a)+b)+e))/b)+1.98))/e))*a))+1.17)+a)/a)-3.84)/a)+2.53)/b)+b)+b)\"\n\"((((a-(((((((((b*(((((b/((b*b)+b))+a)-a)+3.86)-a))+2.80)-b)+0.73)*a)+a)-2.62)+3.75)+a))*a)+e)+pi)\"\n\"(a*(((((((((a*(((((((a-((((a+2.82)+a)+b)-e))*a)/b)/b)+b)*b)+a))+1.91)-b)*e)+b)+a)*0.77)+a)/2.57))\"\n\"((((((((((((1.46-((((((e*0.09)/e)+e)/3.22)/3.48)+pi))-b)/3.41)/2.54)+3.37)*b)+b)+b)/b)-3.57)+a)+b)\"\n\"(((((((((((((e+(((((((((b*b)/a)*a)+pi)/a)+a)*pi)+e)+pi))+a)+b)*pi)-a)+e)/pi)*0.56)+a)-pi)+pi)/b)*b)\"\n\"((((((((((((0.51+(((((e+((a/a)-3.02))-e)+3.93)-e)+1.04))/b)/1.41)/a)/b)+a)/pi)/a)-b)-1.72)*b)*0.81)\"\n\"((((a*((((((((((((e-((((1.35-(1.72+a))-b)*a)+b))+a)*2.34)/a)*pi)+b)+b)*e)-b)+e)+a)+pi))*e)-e)-0.95)\"\n\"(((b/(2.22+(a+(((((((((((((pi-((a+e)+b))+b)-3.79)/e)*b)-pi)*2.66)/pi)+a)*0.32)+b)/1.09)-b))))+a)-e)\"\n\"((3.123*y*z+w+3.123+y/z/w+3.123+y/z+w*3.123*y+z*w+3.123+y/z/w/3.123*y-z*w/3.123*y+z*w-3.123+y-z-w))\"\n\"((3.123*y*z-w*3.123-y*z/w*3.123-y-z*w+3.123/y-z*w*3.123-y*z/w-3.123/y+z*w-3.123/y-z*w/3.123-y*z+w))\"\n\"((3.123*y*z-w/3.123+y+z*w/3.123+y-z/w-3.123*y+z-w/3.123+y+z*w*3.123/y+z-w*3.123*y+z-w+3.123/y*z-w))\"\n\"((3.123*y+z*w*3.123/y-z+w*3.123*y-z+w+3.123/y/z+w*3.123/y-z+w-3.123*y/z-w-3.123/y/z+w/3.123-y+z*w))\"\n\"((3.123*y+z*w-3.123+y-z-w-3.123-y-z/w/3.123+y/z*w-3.123+y-z-w+3.123+y/z/w+3.123+y/z*w*3.123+y+z*w))\"\n\"((3.123*y+z+w*3.123/y/z-w*3.123*y/z-w+3.123-y-z/w*3.123/y/z-w-3.123-y-z*w-3.123-y-z/w/3.123/y-z/w))\"\n\"((3.123*y+z-w+3.123/y*z-w+3.123*y*z-w*3.123-y*z/w+3.123/y*z-w/3.123-y*z*w/3.123-y*z/w-3.123/y+z*w))\"\n\"((3.123*y+z/w/3.123+y*z-w/3.123+y+z-w-3.123-y/z*w/3.123+y*z-w*3.123-y/z/w*3.123-y/z*w+3.123+y-z*w))\"\n\"((3.123*y-z*w*3.123+y+z-w*3.123+y-z-w+3.123+y/z/w*3.123+y+z-w-3.123-y/z*w-3.123+y/z/w/3.123+y-z/w))\"\n\"((3.123*y-z*w/3.123*y+z+w/3.123/y-z+w-3.123*y/z-w/3.123*y+z+w*3.123/y/z-w*3.123*y/z-w+3.123-y-z/w))\"\n\"((3.123*y-z+w+3.123/y/z+w+3.123*y/z+w*3.123-y+z/w+3.123/y/z+w/3.123-y+z*w/3.123-y+z/w-3.123*y-z/w))\"\n\"((3.123*y-z-w*3.123-y*z/w*3.123+y*z/w+3.123-y/z/w*3.123-y*z/w-3.123-y/z*w-3.123-y/z/w/3.123*y+z*w))\"\n\"((3.123*y-z/w+3.123+y/z-w+3.123+y*z-w*3.123-y/z/w+3.123+y/z-w/3.123-y*z*w/3.123-y/z/w-3.123+y*z/w))\"\n\"((3.123*y/z+w*3.123-y+z/w*3.123+y/z*w+3.123*y+z/w*3.123-y+z/w-3.123*y-z/w-3.123*y+z/w/3.123+y*z-w))\"\n\"((3.123*y/z-w+3.123-y-z/w+3.123-y+z*w*3.123/y+z/w+3.123-y-z/w/3.123/y-z/w/3.123/y+z/w-3.123-y-z+w))\"\n\"((3.123*y/z-w/3.123-y-z*w/3.123-y+z/w-3.123+y*z*w/3.123-y-z*w*3.123+y*z/w*3.123+y*z*w+3.123-y/z*w))\"\n\"((3.123+y*z*w+3.123-y/z*w+3.123+y/z*w*3.123+y*z-w+3.123-y/z*w/3.123-y*z-w/3.123+y*z-w-3.123+y-z*w))\"\n\"((3.123+y*z*w-3.123/y/z-w-3.123*y/z-w/3.123-y-z*w-3.123/y/z-w+3.123-y-z/w+3.123-y-z*w*3.123+y*z/w))\"\n\"((3.123+y*z-w*3.123-y/z/w*3.123-y/z*w+3.123+y-z*w*3.123-y/z/w-3.123+y*z/w-3.123+y-z*w/3.123-y/z-w))\"\n\"((3.123+y*z-w-3.123+y-z*w-3.123*y-z*w/3.123*y+z+w-3.123+y-z*w+3.123/y+z+w+3.123*y+z+w*3.123/y/z-w))\"\n\"((3.123+y*z/w+3.123*y/z-w+3.123-y/z-w*3.123-y+z/w+3.123*y/z-w/3.123-y-z*w/3.123-y+z/w-3.123+y*z*w))\"\n\"((3.123+y*z/w+3.123-y/z/w+3.123-y*z*w*3.123/y-z*w+3.123-y/z/w/3.123*y+z*w/3.123/y-z*w-3.123*y-z+w))\"\n\"((3.123+y*z/w-3.123+y+z/w-3.123-y/z*w/3.123-y*z-w-3.123+y+z/w+3.123*y*z-w+3.123-y*z-w*3.123+y-z/w))\"\n\"((3.123+y+z*w*3.123/y+z-w*3.123*y+z-w+3.123/y*z-w*3.123/y+z-w-3.123+y*z/w-3.123/y*z-w/3.123-y*z*w))\"\n\"((3.123+y+z*w-3.123/y*z-w-3.123*y*z-w/3.123+y+z*w-3.123/y*z-w+3.123+y+z/w+3.123+y+z*w*3.123/y+z-w))\"\n\"((3.123+y+z-w-3.123-y/z*w-3.123+y/z/w/3.123+y-z/w-3.123-y/z*w+3.123+y-z*w+3.123+y-z/w*3.123+y/z-w))\"\n\"((3.123+y+z/w+3.123*y*z-w+3.123-y*z-w*3.123+y-z/w+3.123*y*z-w/3.123+y+z*w/3.123+y-z/w-3.123*y+z-w))\"\n\"((3.123+y+z/w/3.123*y-z-w/3.123/y+z-w-3.123+y*z/w/3.123*y-z-w*3.123-y*z/w*3.123+y*z/w+3.123-y/z/w))\"\n\"((3.123+y-z*w+3.123/y+z+w+3.123*y+z+w*3.123/y/z-w+3.123/y+z+w/3.123*y*z-w/3.123/y/z-w-3.123-y-z*w))\"\n\"((3.123+y-z*w/3.123-y/z-w/3.123+y/z-w-3.123-y+z*w/3.123-y/z-w*3.123-y+z/w*3.123-y+z*w+3.123/y-z-w))\"\n\"((3.123+y-z-w+3.123+y/z/w+3.123+y/z*w*3.123+y+z*w+3.123+y/z/w/3.123+y-z/w/3.123+y+z*w-3.123/y*z-w))\"\n\"((3.123+y-z/w*3.123+y/z-w*3.123/y*z-w+3.123+y+z/w*3.123+y/z-w-3.123-y+z*w-3.123+y+z/w/3.123*y-z-w))\"\n\"((3.123+y-z/w-3.123*y+z-w-3.123/y+z+w/3.123*y*z-w-3.123*y+z-w+3.123/y*z-w+3.123*y*z-w*3.123-y*z/w))\"\n\"((3.123+y/z*w*3.123+y*z-w*3.123-y/z*w+3.123*y-z*w*3.123+y*z-w-3.123+y-z*w-3.123*y-z*w/3.123*y+z+w))\"\n\"((3.123+y/z*w*3.123+y+z*w*3.123+y+z/w+3.123*y*z-w*3.123+y+z*w-3.123/y*z-w-3.123*y*z-w/3.123+y+z*w))\"\n\"((3.123+y/z*w+3.123*y+z/w+3.123*y-z*w*3.123+y+z-w+3.123*y+z/w/3.123+y*z-w/3.123+y+z-w-3.123-y/z*w))\"\n\"((3.123+y/z+w*3.123*y+z*w*3.123/y/z-w+3.123-y-z/w*3.123*y+z*w-3.123+y-z-w-3.123-y-z/w/3.123+y/z*w))\"\n\"((3.123+y/z-w-3.123-y+z*w-3.123+y+z/w/3.123*y-z-w-3.123-y+z*w+3.123/y-z-w+3.123*y-z-w*3.123-y*z/w))\"\n\"((3.123+y/z-w/3.123-y*z*w/3.123-y/z/w-3.123+y*z/w/3.123-y*z*w*3.123+y*z*w*3.123+y*z/w+3.123*y/z-w))\"\n\"((3.123+y/z/w/3.123*y-z*w/3.123*y+z*w-3.123+y-z-w/3.123*y-z*w*3.123+y+z-w*3.123+y-z-w+3.123+y/z/w))\"\n\"((3.123+y/z/w/3.123+y-z/w/3.123+y+z*w-3.123/y*z-w/3.123+y-z/w*3.123+y/z-w*3.123/y*z-w+3.123+y+z/w))\"\n\"((3.123-y*z*w*3.123+y*z*w*3.123+y*z/w+3.123*y/z-w*3.123+y*z*w-3.123/y/z-w-3.123*y/z-w/3.123-y-z*w))\"\n\"((3.123-y*z*w*3.123/y-z*w*3.123/y+z*w+3.123-y/z+w*3.123/y-z*w-3.123*y-z+w-3.123-y/z+w/3.123*y/z+w))\"\n\"((3.123-y*z+w*3.123/y*z+w*3.123*y*z+w+3.123+y/z/w*3.123/y*z+w-3.123+y/z*w-3.123+y/z/w/3.123*y-z*w))\"\n\"((3.123-y*z-w*3.123+y-z/w*3.123+y-z*w+3.123/y+z+w*3.123+y-z/w-3.123*y+z-w-3.123/y+z+w/3.123*y*z-w))\"\n\"((3.123-y*z/w-3.123-y/z*w-3.123-y/z/w/3.123*y+z*w-3.123-y/z*w+3.123*y-z*w+3.123*y+z*w*3.123/y-z+w))\"\n\"((3.123-y*z/w-3.123/y+z*w-3.123/y-z*w/3.123-y*z+w-3.123/y+z*w+3.123-y/z+w+3.123-y*z+w*3.123/y*z+w))\"\n\"((3.123-y*z/w/3.123+y/z+w/3.123+y*z*w-3.123/y/z-w/3.123+y/z+w*3.123*y+z*w*3.123/y/z-w+3.123-y-z/w))\"\n\"((3.123-y+z*w*3.123/y+z/w*3.123*y-z/w+3.123+y/z-w*3.123/y+z/w-3.123-y-z+w-3.123+y/z-w/3.123-y*z*w))\"\n\"((3.123-y+z*w+3.123/y-z-w+3.123*y-z-w*3.123-y*z/w+3.123/y-z-w/3.123+y/z*w/3.123-y*z/w-3.123-y/z*w))\"\n\"((3.123-y+z+w-3.123*y*z+w-3.123-y*z/w/3.123+y/z+w-3.123*y*z+w+3.123+y/z/w+3.123+y/z+w*3.123*y+z*w))\"\n\"((3.123-y+z/w-3.123*y-z/w-3.123*y+z/w/3.123+y*z-w-3.123*y-z/w+3.123+y/z-w+3.123+y*z-w*3.123-y/z/w))\"\n\"((3.123-y+z/w-3.123+y*z*w-3.123/y-z-w/3.123+y/z*w-3.123+y*z*w+3.123-y/z*w+3.123+y/z*w*3.123+y*z-w))\"\n\"((3.123-y-z*w*3.123+y*z/w*3.123+y*z*w+3.123-y/z*w*3.123+y*z/w-3.123+y+z/w-3.123-y/z*w/3.123-y*z-w))\"\n\"((3.123-y-z*w+3.123/y-z*w+3.123/y-z/w*3.123-y+z+w+3.123/y-z*w/3.123-y*z+w/3.123-y+z+w-3.123*y*z+w))\"\n\"((3.123-y-z+w+3.123-y*z/w+3.123-y*z*w*3.123+y*z*w+3.123-y*z/w/3.123+y/z+w/3.123+y*z*w-3.123/y/z-w))\"\n\"((3.123-y-z/w/3.123+y/z*w/3.123+y*z/w-3.123+y+z/w/3.123+y/z*w*3.123+y+z*w*3.123+y+z/w+3.123*y*z-w))\"\n\"((3.123-y-z/w/3.123/y-z/w/3.123/y+z/w-3.123-y-z+w/3.123/y-z/w*3.123-y+z+w*3.123-y-z+w+3.123-y*z/w))\"\n\"((3.123-y/z*w+3.123*y-z*w+3.123*y+z*w*3.123/y-z+w+3.123*y-z*w/3.123*y+z+w/3.123/y-z+w-3.123*y/z-w))\"\n\"((3.123-y/z*w+3.123+y-z*w+3.123+y-z/w*3.123+y/z-w+3.123+y-z*w/3.123-y/z-w/3.123+y/z-w-3.123-y+z*w))\"\n\"((3.123-y/z*w/3.123-y*z-w/3.123+y*z-w-3.123+y-z*w/3.123-y*z-w*3.123+y-z/w*3.123+y-z*w+3.123/y+z+w))\"\n\"((3.123-y/z+w/3.123*y/z+w/3.123/y*z+w-3.123+y/z*w/3.123*y/z+w*3.123-y+z/w*3.123+y/z*w+3.123*y+z/w))\"\n\"((3.123-y/z-w*3.123-y+z/w*3.123-y+z*w+3.123/y-z-w*3.123-y+z/w-3.123+y*z*w-3.123/y-z-w/3.123+y/z*w))\"\n\"((3.123-y/z/w-3.123+y*z/w-3.123+y-z*w/3.123-y/z-w-3.123+y*z/w+3.123*y/z-w+3.123-y/z-w*3.123-y+z/w))\"\n\"((3.123-y/z/w/3.123*y+z*w/3.123/y-z*w-3.123*y-z+w/3.123*y+z*w*3.123/y-z+w*3.123*y-z+w+3.123/y/z+w))\"\n\"((3.123/y*z+w-3.123+y/z*w-3.123+y/z/w/3.123*y-z*w-3.123+y/z*w+3.123*y+z/w+3.123*y-z*w*3.123+y+z-w))\"\n\"((3.123/y*z-w+3.123+y+z/w+3.123+y+z*w*3.123/y+z-w+3.123+y+z/w/3.123*y-z-w/3.123/y+z-w-3.123+y*z/w))\"\n\"((3.123/y*z-w/3.123-y*z*w/3.123-y*z/w-3.123/y+z*w/3.123-y*z*w*3.123/y-z*w*3.123/y+z*w+3.123-y/z+w))\"\n\"((3.123/y+z*w+3.123-y/z+w+3.123-y*z+w*3.123/y*z+w+3.123-y/z+w/3.123*y/z+w/3.123/y*z+w-3.123+y/z*w))\"\n\"((3.123/y+z+w/3.123*y*z-w/3.123/y/z-w-3.123-y-z*w/3.123*y*z-w*3.123-y*z/w*3.123-y-z*w+3.123/y-z*w))\"\n\"((3.123/y+z-w-3.123+y*z/w-3.123/y*z-w/3.123-y*z*w-3.123+y*z/w+3.123-y/z/w+3.123-y*z*w*3.123/y-z*w))\"\n\"((3.123/y+z/w-3.123-y-z+w-3.123+y/z-w/3.123-y*z*w-3.123-y-z+w+3.123-y*z/w+3.123-y*z*w*3.123+y*z*w))\"\n\"((3.123/y-z*w-3.123*y-z+w-3.123-y/z+w/3.123*y/z+w-3.123*y-z+w+3.123/y/z+w+3.123*y/z+w*3.123-y+z/w))\"\n\"((3.123/y-z*w/3.123-y*z+w/3.123-y+z+w-3.123*y*z+w/3.123-y*z+w*3.123/y*z+w*3.123*y*z+w+3.123+y/z/w))\"\n\"((3.123/y-z+w-3.123*y/z-w-3.123/y/z+w/3.123-y+z*w-3.123*y/z-w+3.123-y-z/w+3.123-y+z*w*3.123/y+z/w))\"\n\"((3.123/y-z-w/3.123+y/z*w/3.123-y*z/w-3.123-y/z*w/3.123+y/z*w*3.123+y*z-w*3.123-y/z*w+3.123*y-z*w))\"\n\"((3.123/y-z/w*3.123-y+z+w*3.123-y-z+w+3.123-y*z/w*3.123-y+z+w-3.123*y*z+w-3.123-y*z/w/3.123+y/z+w))\"\n\"((3.123/y/z+w/3.123-y+z*w/3.123-y+z/w-3.123*y-z/w/3.123-y+z*w*3.123/y+z/w*3.123*y-z/w+3.123+y/z-w))\"\n\"((3.123/y/z-w+3.123-y-z/w+3.123-y-z*w*3.123+y*z/w+3.123-y-z/w/3.123+y/z*w/3.123+y*z/w-3.123+y+z/w))\"\n\"((3.123/y/z-w-3.123-y-z*w-3.123-y-z/w/3.123/y-z/w-3.123-y-z*w+3.123/y-z*w+3.123/y-z/w*3.123-y+z+w))\"\n\"((x*5.123*z+w+x+5.123/z/w+x+5.123/z+w*x*5.123+z*w+x+5.123/z/w/x*5.123-z*w/x*5.123+z*w-x+5.123-z-w))\"\n\"((x*5.123*z-w*x-5.123*z/w*x-5.123-z*w+x/5.123-z*w*x-5.123*z/w-x/5.123+z*w-x/5.123-z*w/x-5.123*z+w))\"\n\"((x*5.123*z-w/x+5.123+z*w/x+5.123-z/w-x*5.123+z-w/x+5.123+z*w*x/5.123+z-w*x*5.123+z-w+x/5.123*z-w))\"\n\"((x*5.123+z*w*x/5.123-z+w*x*5.123-z+w+x/5.123/z+w*x/5.123-z+w-x*5.123/z-w-x/5.123/z+w/x-5.123+z*w))\"\n\"((x*5.123+z*w-x+5.123-z-w-x-5.123-z/w/x+5.123/z*w-x+5.123-z-w+x+5.123/z/w+x+5.123/z*w*x+5.123+z*w))\"\n\"((x*5.123+z+w*x/5.123/z-w*x*5.123/z-w+x-5.123-z/w*x/5.123/z-w-x-5.123-z*w-x-5.123-z/w/x/5.123-z/w))\"\n\"((x*5.123+z-w+x/5.123*z-w+x*5.123*z-w*x-5.123*z/w+x/5.123*z-w/x-5.123*z*w/x-5.123*z/w-x/5.123+z*w))\"\n\"((x*5.123+z/w/x+5.123*z-w/x+5.123+z-w-x-5.123/z*w/x+5.123*z-w*x-5.123/z/w*x-5.123/z*w+x+5.123-z*w))\"\n\"((x*5.123-z*w*x+5.123+z-w*x+5.123-z-w+x+5.123/z/w*x+5.123+z-w-x-5.123/z*w-x+5.123/z/w/x+5.123-z/w))\"\n\"((x*5.123-z*w/x*5.123+z+w/x/5.123-z+w-x*5.123/z-w/x*5.123+z+w*x/5.123/z-w*x*5.123/z-w+x-5.123-z/w))\"\n\"((x*5.123-z+w+x/5.123/z+w+x*5.123/z+w*x-5.123+z/w+x/5.123/z+w/x-5.123+z*w/x-5.123+z/w-x*5.123-z/w))\"\n\"((x*5.123-z-w*x-5.123*z/w*x+5.123*z/w+x-5.123/z/w*x-5.123*z/w-x-5.123/z*w-x-5.123/z/w/x*5.123+z*w))\"\n\"((x*5.123-z/w+x+5.123/z-w+x+5.123*z-w*x-5.123/z/w+x+5.123/z-w/x-5.123*z*w/x-5.123/z/w-x+5.123*z/w))\"\n\"((x*5.123/z+w*x-5.123+z/w*x+5.123/z*w+x*5.123+z/w*x-5.123+z/w-x*5.123-z/w-x*5.123+z/w/x+5.123*z-w))\"\n\"((x*5.123/z-w+x-5.123-z/w+x-5.123+z*w*x/5.123+z/w+x-5.123-z/w/x/5.123-z/w/x/5.123+z/w-x-5.123-z+w))\"\n\"((x*5.123/z-w/x-5.123-z*w/x-5.123+z/w-x+5.123*z*w/x-5.123-z*w*x+5.123*z/w*x+5.123*z*w+x-5.123/z*w))\"\n\"((x*y*7.123+w+x+y/7.123/w+x+y/7.123+w*x*y+7.123*w+x+y/7.123/w/x*y-7.123*w/x*y+7.123*w-x+y-7.123-w))\"\n\"((x*y*7.123-w*x-y*7.123/w*x-y-7.123*w+x/y-7.123*w*x-y*7.123/w-x/y+7.123*w-x/y-7.123*w/x-y*7.123+w))\"\n\"((x*y*7.123-w/x+y+7.123*w/x+y-7.123/w-x*y+7.123-w/x+y+7.123*w*x/y+7.123-w*x*y+7.123-w+x/y*7.123-w))\"\n\"((x*y*z+9.123+x+y/z/9.123+x+y/z+9.123*x*y+z*9.123+x+y/z/9.123/x*y-z*9.123/x*y+z*9.123-x+y-z-9.123))\"\n\"((x*y*z-9.123*x-y*z/9.123*x-y-z*9.123+x/y-z*9.123*x-y*z/9.123-x/y+z*9.123-x/y-z*9.123/x-y*z+9.123))\"\n\"((x*y*z-9.123/x+y+z*9.123/x+y-z/9.123-x*y+z-9.123/x+y+z*9.123*x/y+z-9.123*x*y+z-9.123+x/y*z-9.123))\"\n\"((x*y+7.123*w*x/y-7.123+w*x*y-7.123+w+x/y/7.123+w*x/y-7.123+w-x*y/7.123-w-x/y/7.123+w/x-y+7.123*w))\"\n\"((x*y+7.123*w-x+y-7.123-w-x-y-7.123/w/x+y/7.123*w-x+y-7.123-w+x+y/7.123/w+x+y/7.123*w*x+y+7.123*w))\"\n\"((x*y+7.123+w*x/y/7.123-w*x*y/7.123-w+x-y-7.123/w*x/y/7.123-w-x-y-7.123*w-x-y-7.123/w/x/y-7.123/w))\"\n\"((x*y+7.123-w+x/y*7.123-w+x*y*7.123-w*x-y*7.123/w+x/y*7.123-w/x-y*7.123*w/x-y*7.123/w-x/y+7.123*w))\"\n\"((x*y+7.123/w/x+y*7.123-w/x+y+7.123-w-x-y/7.123*w/x+y*7.123-w*x-y/7.123/w*x-y/7.123*w+x+y-7.123*w))\"\n\"((x*y+z*9.123*x/y-z+9.123*x*y-z+9.123+x/y/z+9.123*x/y-z+9.123-x*y/z-9.123-x/y/z+9.123/x-y+z*9.123))\"\n\"((x*y+z*9.123-x+y-z-9.123-x-y-z/9.123/x+y/z*9.123-x+y-z-9.123+x+y/z/9.123+x+y/z*9.123*x+y+z*9.123))\"\n\"((x*y+z+9.123*x/y/z-9.123*x*y/z-9.123+x-y-z/9.123*x/y/z-9.123-x-y-z*9.123-x-y-z/9.123/x/y-z/9.123))\"\n\"((x*y+z-9.123+x/y*z-9.123+x*y*z-9.123*x-y*z/9.123+x/y*z-9.123/x-y*z*9.123/x-y*z/9.123-x/y+z*9.123))\"\n\"((x*y+z/9.123/x+y*z-9.123/x+y+z-9.123-x-y/z*9.123/x+y*z-9.123*x-y/z/9.123*x-y/z*9.123+x+y-z*9.123))\"\n\"((x*y-7.123*w*x+y+7.123-w*x+y-7.123-w+x+y/7.123/w*x+y+7.123-w-x-y/7.123*w-x+y/7.123/w/x+y-7.123/w))\"\n\"((x*y-7.123*w/x*y+7.123+w/x/y-7.123+w-x*y/7.123-w/x*y+7.123+w*x/y/7.123-w*x*y/7.123-w+x-y-7.123/w))\"\n\"((x*y-7.123+w+x/y/7.123+w+x*y/7.123+w*x-y+7.123/w+x/y/7.123+w/x-y+7.123*w/x-y+7.123/w-x*y-7.123/w))\"\n\"((x*y-7.123-w*x-y*7.123/w*x+y*7.123/w+x-y/7.123/w*x-y*7.123/w-x-y/7.123*w-x-y/7.123/w/x*y+7.123*w))\"\n\"((x*y-7.123/w+x+y/7.123-w+x+y*7.123-w*x-y/7.123/w+x+y/7.123-w/x-y*7.123*w/x-y/7.123/w-x+y*7.123/w))\"\n\"((x*y-z*9.123*x+y+z-9.123*x+y-z-9.123+x+y/z/9.123*x+y+z-9.123-x-y/z*9.123-x+y/z/9.123/x+y-z/9.123))\"\n\"((x*y-z*9.123/x*y+z+9.123/x/y-z+9.123-x*y/z-9.123/x*y+z+9.123*x/y/z-9.123*x*y/z-9.123+x-y-z/9.123))\"\n\"((x*y-z+9.123+x/y/z+9.123+x*y/z+9.123*x-y+z/9.123+x/y/z+9.123/x-y+z*9.123/x-y+z/9.123-x*y-z/9.123))\"\n\"((x*y-z-9.123*x-y*z/9.123*x+y*z/9.123+x-y/z/9.123*x-y*z/9.123-x-y/z*9.123-x-y/z/9.123/x*y+z*9.123))\"\n\"((x*y-z/9.123+x+y/z-9.123+x+y*z-9.123*x-y/z/9.123+x+y/z-9.123/x-y*z*9.123/x-y/z/9.123-x+y*z/9.123))\"\n\"((x*y/7.123+w*x-y+7.123/w*x+y/7.123*w+x*y+7.123/w*x-y+7.123/w-x*y-7.123/w-x*y+7.123/w/x+y*7.123-w))\"\n\"((x*y/7.123-w+x-y-7.123/w+x-y+7.123*w*x/y+7.123/w+x-y-7.123/w/x/y-7.123/w/x/y+7.123/w-x-y-7.123+w))\"\n\"((x*y/7.123-w/x-y-7.123*w/x-y+7.123/w-x+y*7.123*w/x-y-7.123*w*x+y*7.123/w*x+y*7.123*w+x-y/7.123*w))\"\n\"((x*y/z+9.123*x-y+z/9.123*x+y/z*9.123+x*y+z/9.123*x-y+z/9.123-x*y-z/9.123-x*y+z/9.123/x+y*z-9.123))\"\n\"((x*y/z-9.123+x-y-z/9.123+x-y+z*9.123*x/y+z/9.123+x-y-z/9.123/x/y-z/9.123/x/y+z/9.123-x-y-z+9.123))\"\n\"((x*y/z-9.123/x-y-z*9.123/x-y+z/9.123-x+y*z*9.123/x-y-z*9.123*x+y*z/9.123*x+y*z*9.123+x-y/z*9.123))\"\n\"((x+5.123*z*w+x-5.123/z*w+x+5.123/z*w*x+5.123*z-w+x-5.123/z*w/x-5.123*z-w/x+5.123*z-w-x+5.123-z*w))\"\n\"((x+5.123*z*w-x/5.123/z-w-x*5.123/z-w/x-5.123-z*w-x/5.123/z-w+x-5.123-z/w+x-5.123-z*w*x+5.123*z/w))\"\n\"((x+5.123*z-w*x-5.123/z/w*x-5.123/z*w+x+5.123-z*w*x-5.123/z/w-x+5.123*z/w-x+5.123-z*w/x-5.123/z-w))\"\n\"((x+5.123*z-w-x+5.123-z*w-x*5.123-z*w/x*5.123+z+w-x+5.123-z*w+x/5.123+z+w+x*5.123+z+w*x/5.123/z-w))\"\n\"((x+5.123*z/w+x*5.123/z-w+x-5.123/z-w*x-5.123+z/w+x*5.123/z-w/x-5.123-z*w/x-5.123+z/w-x+5.123*z*w))\"\n\"((x+5.123*z/w+x-5.123/z/w+x-5.123*z*w*x/5.123-z*w+x-5.123/z/w/x*5.123+z*w/x/5.123-z*w-x*5.123-z+w))\"\n\"((x+5.123*z/w-x+5.123+z/w-x-5.123/z*w/x-5.123*z-w-x+5.123+z/w+x*5.123*z-w+x-5.123*z-w*x+5.123-z/w))\"\n\"((x+5.123+z*w*x/5.123+z-w*x*5.123+z-w+x/5.123*z-w*x/5.123+z-w-x+5.123*z/w-x/5.123*z-w/x-5.123*z*w))\"\n\"((x+5.123+z*w-x/5.123*z-w-x*5.123*z-w/x+5.123+z*w-x/5.123*z-w+x+5.123+z/w+x+5.123+z*w*x/5.123+z-w))\"\n\"((x+5.123+z-w-x-5.123/z*w-x+5.123/z/w/x+5.123-z/w-x-5.123/z*w+x+5.123-z*w+x+5.123-z/w*x+5.123/z-w))\"\n\"((x+5.123+z/w+x*5.123*z-w+x-5.123*z-w*x+5.123-z/w+x*5.123*z-w/x+5.123+z*w/x+5.123-z/w-x*5.123+z-w))\"\n\"((x+5.123+z/w/x*5.123-z-w/x/5.123+z-w-x+5.123*z/w/x*5.123-z-w*x-5.123*z/w*x+5.123*z/w+x-5.123/z/w))\"\n\"((x+5.123-z*w+x/5.123+z+w+x*5.123+z+w*x/5.123/z-w+x/5.123+z+w/x*5.123*z-w/x/5.123/z-w-x-5.123-z*w))\"\n\"((x+5.123-z*w/x-5.123/z-w/x+5.123/z-w-x-5.123+z*w/x-5.123/z-w*x-5.123+z/w*x-5.123+z*w+x/5.123-z-w))\"\n\"((x+5.123-z-w+x+5.123/z/w+x+5.123/z*w*x+5.123+z*w+x+5.123/z/w/x+5.123-z/w/x+5.123+z*w-x/5.123*z-w))\"\n\"((x+5.123-z/w*x+5.123/z-w*x/5.123*z-w+x+5.123+z/w*x+5.123/z-w-x-5.123+z*w-x+5.123+z/w/x*5.123-z-w))\"\n\"((x+5.123-z/w-x*5.123+z-w-x/5.123+z+w/x*5.123*z-w-x*5.123+z-w+x/5.123*z-w+x*5.123*z-w*x-5.123*z/w))\"\n\"((x+5.123/z*w*x+5.123*z-w*x-5.123/z*w+x*5.123-z*w*x+5.123*z-w-x+5.123-z*w-x*5.123-z*w/x*5.123+z+w))\"\n\"((x+5.123/z*w*x+5.123+z*w*x+5.123+z/w+x*5.123*z-w*x+5.123+z*w-x/5.123*z-w-x*5.123*z-w/x+5.123+z*w))\"\n\"((x+5.123/z*w+x*5.123+z/w+x*5.123-z*w*x+5.123+z-w+x*5.123+z/w/x+5.123*z-w/x+5.123+z-w-x-5.123/z*w))\"\n\"((x+5.123/z+w*x*5.123+z*w*x/5.123/z-w+x-5.123-z/w*x*5.123+z*w-x+5.123-z-w-x-5.123-z/w/x+5.123/z*w))\"\n\"((x+5.123/z-w-x-5.123+z*w-x+5.123+z/w/x*5.123-z-w-x-5.123+z*w+x/5.123-z-w+x*5.123-z-w*x-5.123*z/w))\"\n\"((x+5.123/z-w/x-5.123*z*w/x-5.123/z/w-x+5.123*z/w/x-5.123*z*w*x+5.123*z*w*x+5.123*z/w+x*5.123/z-w))\"\n\"((x+5.123/z/w/x*5.123-z*w/x*5.123+z*w-x+5.123-z-w/x*5.123-z*w*x+5.123+z-w*x+5.123-z-w+x+5.123/z/w))\"\n\"((x+5.123/z/w/x+5.123-z/w/x+5.123+z*w-x/5.123*z-w/x+5.123-z/w*x+5.123/z-w*x/5.123*z-w+x+5.123+z/w))\"\n\"((x+y*7.123*w+x-y/7.123*w+x+y/7.123*w*x+y*7.123-w+x-y/7.123*w/x-y*7.123-w/x+y*7.123-w-x+y-7.123*w))\"\n\"((x+y*7.123*w-x/y/7.123-w-x*y/7.123-w/x-y-7.123*w-x/y/7.123-w+x-y-7.123/w+x-y-7.123*w*x+y*7.123/w))\"\n\"((x+y*7.123-w*x-y/7.123/w*x-y/7.123*w+x+y-7.123*w*x-y/7.123/w-x+y*7.123/w-x+y-7.123*w/x-y/7.123-w))\"\n\"((x+y*7.123-w-x+y-7.123*w-x*y-7.123*w/x*y+7.123+w-x+y-7.123*w+x/y+7.123+w+x*y+7.123+w*x/y/7.123-w))\"\n\"((x+y*7.123/w+x*y/7.123-w+x-y/7.123-w*x-y+7.123/w+x*y/7.123-w/x-y-7.123*w/x-y+7.123/w-x+y*7.123*w))\"\n\"((x+y*7.123/w+x-y/7.123/w+x-y*7.123*w*x/y-7.123*w+x-y/7.123/w/x*y+7.123*w/x/y-7.123*w-x*y-7.123+w))\"\n\"((x+y*7.123/w-x+y+7.123/w-x-y/7.123*w/x-y*7.123-w-x+y+7.123/w+x*y*7.123-w+x-y*7.123-w*x+y-7.123/w))\"\n\"((x+y*z*9.123+x-y/z*9.123+x+y/z*9.123*x+y*z-9.123+x-y/z*9.123/x-y*z-9.123/x+y*z-9.123-x+y-z*9.123))\"\n\"((x+y*z*9.123-x/y/z-9.123-x*y/z-9.123/x-y-z*9.123-x/y/z-9.123+x-y-z/9.123+x-y-z*9.123*x+y*z/9.123))\"\n\"((x+y*z-9.123*x-y/z/9.123*x-y/z*9.123+x+y-z*9.123*x-y/z/9.123-x+y*z/9.123-x+y-z*9.123/x-y/z-9.123))\"\n\"((x+y*z-9.123-x+y-z*9.123-x*y-z*9.123/x*y+z+9.123-x+y-z*9.123+x/y+z+9.123+x*y+z+9.123*x/y/z-9.123))\"\n\"((x+y*z/9.123+x*y/z-9.123+x-y/z-9.123*x-y+z/9.123+x*y/z-9.123/x-y-z*9.123/x-y+z/9.123-x+y*z*9.123))\"\n\"((x+y*z/9.123+x-y/z/9.123+x-y*z*9.123*x/y-z*9.123+x-y/z/9.123/x*y+z*9.123/x/y-z*9.123-x*y-z+9.123))\"\n\"((x+y*z/9.123-x+y+z/9.123-x-y/z*9.123/x-y*z-9.123-x+y+z/9.123+x*y*z-9.123+x-y*z-9.123*x+y-z/9.123))\"\n\"((x+y+7.123*w*x/y+7.123-w*x*y+7.123-w+x/y*7.123-w*x/y+7.123-w-x+y*7.123/w-x/y*7.123-w/x-y*7.123*w))\"\n\"((x+y+7.123*w-x/y*7.123-w-x*y*7.123-w/x+y+7.123*w-x/y*7.123-w+x+y+7.123/w+x+y+7.123*w*x/y+7.123-w))\"\n\"((x+y+7.123-w-x-y/7.123*w-x+y/7.123/w/x+y-7.123/w-x-y/7.123*w+x+y-7.123*w+x+y-7.123/w*x+y/7.123-w))\"\n\"((x+y+7.123/w+x*y*7.123-w+x-y*7.123-w*x+y-7.123/w+x*y*7.123-w/x+y+7.123*w/x+y-7.123/w-x*y+7.123-w))\"\n\"((x+y+7.123/w/x*y-7.123-w/x/y+7.123-w-x+y*7.123/w/x*y-7.123-w*x-y*7.123/w*x+y*7.123/w+x-y/7.123/w))\"\n\"((x+y+z*9.123*x/y+z-9.123*x*y+z-9.123+x/y*z-9.123*x/y+z-9.123-x+y*z/9.123-x/y*z-9.123/x-y*z*9.123))\"\n\"((x+y+z*9.123-x/y*z-9.123-x*y*z-9.123/x+y+z*9.123-x/y*z-9.123+x+y+z/9.123+x+y+z*9.123*x/y+z-9.123))\"\n\"((x+y+z-9.123-x-y/z*9.123-x+y/z/9.123/x+y-z/9.123-x-y/z*9.123+x+y-z*9.123+x+y-z/9.123*x+y/z-9.123))\"\n\"((x+y+z/9.123+x*y*z-9.123+x-y*z-9.123*x+y-z/9.123+x*y*z-9.123/x+y+z*9.123/x+y-z/9.123-x*y+z-9.123))\"\n\"((x+y+z/9.123/x*y-z-9.123/x/y+z-9.123-x+y*z/9.123/x*y-z-9.123*x-y*z/9.123*x+y*z/9.123+x-y/z/9.123))\"\n\"((x+y-7.123*w+x/y+7.123+w+x*y+7.123+w*x/y/7.123-w+x/y+7.123+w/x*y*7.123-w/x/y/7.123-w-x-y-7.123*w))\"\n\"((x+y-7.123*w/x-y/7.123-w/x+y/7.123-w-x-y+7.123*w/x-y/7.123-w*x-y+7.123/w*x-y+7.123*w+x/y-7.123-w))\"\n\"((x+y-7.123-w+x+y/7.123/w+x+y/7.123*w*x+y+7.123*w+x+y/7.123/w/x+y-7.123/w/x+y+7.123*w-x/y*7.123-w))\"\n\"((x+y-7.123/w*x+y/7.123-w*x/y*7.123-w+x+y+7.123/w*x+y/7.123-w-x-y+7.123*w-x+y+7.123/w/x*y-7.123-w))\"\n\"((x+y-7.123/w-x*y+7.123-w-x/y+7.123+w/x*y*7.123-w-x*y+7.123-w+x/y*7.123-w+x*y*7.123-w*x-y*7.123/w))\"\n\"((x+y-z*9.123+x/y+z+9.123+x*y+z+9.123*x/y/z-9.123+x/y+z+9.123/x*y*z-9.123/x/y/z-9.123-x-y-z*9.123))\"\n\"((x+y-z*9.123/x-y/z-9.123/x+y/z-9.123-x-y+z*9.123/x-y/z-9.123*x-y+z/9.123*x-y+z*9.123+x/y-z-9.123))\"\n\"((x+y-z-9.123+x+y/z/9.123+x+y/z*9.123*x+y+z*9.123+x+y/z/9.123/x+y-z/9.123/x+y+z*9.123-x/y*z-9.123))\"\n\"((x+y-z/9.123*x+y/z-9.123*x/y*z-9.123+x+y+z/9.123*x+y/z-9.123-x-y+z*9.123-x+y+z/9.123/x*y-z-9.123))\"\n\"((x+y-z/9.123-x*y+z-9.123-x/y+z+9.123/x*y*z-9.123-x*y+z-9.123+x/y*z-9.123+x*y*z-9.123*x-y*z/9.123))\"\n\"((x+y/7.123*w*x+y*7.123-w*x-y/7.123*w+x*y-7.123*w*x+y*7.123-w-x+y-7.123*w-x*y-7.123*w/x*y+7.123+w))\"\n\"((x+y/7.123*w*x+y+7.123*w*x+y+7.123/w+x*y*7.123-w*x+y+7.123*w-x/y*7.123-w-x*y*7.123-w/x+y+7.123*w))\"\n\"((x+y/7.123*w+x*y+7.123/w+x*y-7.123*w*x+y+7.123-w+x*y+7.123/w/x+y*7.123-w/x+y+7.123-w-x-y/7.123*w))\"\n\"((x+y/7.123+w*x*y+7.123*w*x/y/7.123-w+x-y-7.123/w*x*y+7.123*w-x+y-7.123-w-x-y-7.123/w/x+y/7.123*w))\"\n\"((x+y/7.123-w-x-y+7.123*w-x+y+7.123/w/x*y-7.123-w-x-y+7.123*w+x/y-7.123-w+x*y-7.123-w*x-y*7.123/w))\"\n\"((x+y/7.123-w/x-y*7.123*w/x-y/7.123/w-x+y*7.123/w/x-y*7.123*w*x+y*7.123*w*x+y*7.123/w+x*y/7.123-w))\"\n\"((x+y/7.123/w/x*y-7.123*w/x*y+7.123*w-x+y-7.123-w/x*y-7.123*w*x+y+7.123-w*x+y-7.123-w+x+y/7.123/w))\"\n\"((x+y/7.123/w/x+y-7.123/w/x+y+7.123*w-x/y*7.123-w/x+y-7.123/w*x+y/7.123-w*x/y*7.123-w+x+y+7.123/w))\"\n\"((x+y/z*9.123*x+y*z-9.123*x-y/z*9.123+x*y-z*9.123*x+y*z-9.123-x+y-z*9.123-x*y-z*9.123/x*y+z+9.123))\"\n\"((x+y/z*9.123*x+y+z*9.123*x+y+z/9.123+x*y*z-9.123*x+y+z*9.123-x/y*z-9.123-x*y*z-9.123/x+y+z*9.123))\"\n\"((x+y/z*9.123+x*y+z/9.123+x*y-z*9.123*x+y+z-9.123+x*y+z/9.123/x+y*z-9.123/x+y+z-9.123-x-y/z*9.123))\"\n\"((x+y/z+9.123*x*y+z*9.123*x/y/z-9.123+x-y-z/9.123*x*y+z*9.123-x+y-z-9.123-x-y-z/9.123/x+y/z*9.123))\"\n\"((x+y/z-9.123-x-y+z*9.123-x+y+z/9.123/x*y-z-9.123-x-y+z*9.123+x/y-z-9.123+x*y-z-9.123*x-y*z/9.123))\"\n\"((x+y/z-9.123/x-y*z*9.123/x-y/z/9.123-x+y*z/9.123/x-y*z*9.123*x+y*z*9.123*x+y*z/9.123+x*y/z-9.123))\"\n\"((x+y/z/9.123/x*y-z*9.123/x*y+z*9.123-x+y-z-9.123/x*y-z*9.123*x+y+z-9.123*x+y-z-9.123+x+y/z/9.123))\"\n\"((x+y/z/9.123/x+y-z/9.123/x+y+z*9.123-x/y*z-9.123/x+y-z/9.123*x+y/z-9.123*x/y*z-9.123+x+y+z/9.123))\"\n\"((x-5.123*z*w*x+5.123*z*w*x+5.123*z/w+x*5.123/z-w*x+5.123*z*w-x/5.123/z-w-x*5.123/z-w/x-5.123-z*w))\"\n\"((x-5.123*z*w*x/5.123-z*w*x/5.123+z*w+x-5.123/z+w*x/5.123-z*w-x*5.123-z+w-x-5.123/z+w/x*5.123/z+w))\"\n\"((x-5.123*z+w*x/5.123*z+w*x*5.123*z+w+x+5.123/z/w*x/5.123*z+w-x+5.123/z*w-x+5.123/z/w/x*5.123-z*w))\"\n\"((x-5.123*z-w*x+5.123-z/w*x+5.123-z*w+x/5.123+z+w*x+5.123-z/w-x*5.123+z-w-x/5.123+z+w/x*5.123*z-w))\"\n\"((x-5.123*z/w-x-5.123/z*w-x-5.123/z/w/x*5.123+z*w-x-5.123/z*w+x*5.123-z*w+x*5.123+z*w*x/5.123-z+w))\"\n\"((x-5.123*z/w-x/5.123+z*w-x/5.123-z*w/x-5.123*z+w-x/5.123+z*w+x-5.123/z+w+x-5.123*z+w*x/5.123*z+w))\"\n\"((x-5.123*z/w/x+5.123/z+w/x+5.123*z*w-x/5.123/z-w/x+5.123/z+w*x*5.123+z*w*x/5.123/z-w+x-5.123-z/w))\"\n\"((x-5.123+z*w*x/5.123+z/w*x*5.123-z/w+x+5.123/z-w*x/5.123+z/w-x-5.123-z+w-x+5.123/z-w/x-5.123*z*w))\"\n\"((x-5.123+z*w+x/5.123-z-w+x*5.123-z-w*x-5.123*z/w+x/5.123-z-w/x+5.123/z*w/x-5.123*z/w-x-5.123/z*w))\"\n\"((x-5.123+z+w-x*5.123*z+w-x-5.123*z/w/x+5.123/z+w-x*5.123*z+w+x+5.123/z/w+x+5.123/z+w*x*5.123+z*w))\"\n\"((x-5.123+z/w-x*5.123-z/w-x*5.123+z/w/x+5.123*z-w-x*5.123-z/w+x+5.123/z-w+x+5.123*z-w*x-5.123/z/w))\"\n\"((x-5.123+z/w-x+5.123*z*w-x/5.123-z-w/x+5.123/z*w-x+5.123*z*w+x-5.123/z*w+x+5.123/z*w*x+5.123*z-w))\"\n\"((x-5.123-z*w*x+5.123*z/w*x+5.123*z*w+x-5.123/z*w*x+5.123*z/w-x+5.123+z/w-x-5.123/z*w/x-5.123*z-w))\"\n\"((x-5.123-z*w+x/5.123-z*w+x/5.123-z/w*x-5.123+z+w+x/5.123-z*w/x-5.123*z+w/x-5.123+z+w-x*5.123*z+w))\"\n\"((x-5.123-z+w+x-5.123*z/w+x-5.123*z*w*x+5.123*z*w+x-5.123*z/w/x+5.123/z+w/x+5.123*z*w-x/5.123/z-w))\"\n\"((x-5.123-z/w/x+5.123/z*w/x+5.123*z/w-x+5.123+z/w/x+5.123/z*w*x+5.123+z*w*x+5.123+z/w+x*5.123*z-w))\"\n\"((x-5.123-z/w/x/5.123-z/w/x/5.123+z/w-x-5.123-z+w/x/5.123-z/w*x-5.123+z+w*x-5.123-z+w+x-5.123*z/w))\"\n\"((x-5.123/z*w+x*5.123-z*w+x*5.123+z*w*x/5.123-z+w+x*5.123-z*w/x*5.123+z+w/x/5.123-z+w-x*5.123/z-w))\"\n\"((x-5.123/z*w+x+5.123-z*w+x+5.123-z/w*x+5.123/z-w+x+5.123-z*w/x-5.123/z-w/x+5.123/z-w-x-5.123+z*w))\"\n\"((x-5.123/z*w/x-5.123*z-w/x+5.123*z-w-x+5.123-z*w/x-5.123*z-w*x+5.123-z/w*x+5.123-z*w+x/5.123+z+w))\"\n\"((x-5.123/z+w/x*5.123/z+w/x/5.123*z+w-x+5.123/z*w/x*5.123/z+w*x-5.123+z/w*x+5.123/z*w+x*5.123+z/w))\"\n\"((x-5.123/z-w*x-5.123+z/w*x-5.123+z*w+x/5.123-z-w*x-5.123+z/w-x+5.123*z*w-x/5.123-z-w/x+5.123/z*w))\"\n\"((x-5.123/z/w-x+5.123*z/w-x+5.123-z*w/x-5.123/z-w-x+5.123*z/w+x*5.123/z-w+x-5.123/z-w*x-5.123+z/w))\"\n\"((x-5.123/z/w/x*5.123+z*w/x/5.123-z*w-x*5.123-z+w/x*5.123+z*w*x/5.123-z+w*x*5.123-z+w+x/5.123/z+w))\"\n\"((x-y*7.123*w*x+y*7.123*w*x+y*7.123/w+x*y/7.123-w*x+y*7.123*w-x/y/7.123-w-x*y/7.123-w/x-y-7.123*w))\"\n\"((x-y*7.123*w*x/y-7.123*w*x/y+7.123*w+x-y/7.123+w*x/y-7.123*w-x*y-7.123+w-x-y/7.123+w/x*y/7.123+w))\"\n\"((x-y*7.123+w*x/y*7.123+w*x*y*7.123+w+x+y/7.123/w*x/y*7.123+w-x+y/7.123*w-x+y/7.123/w/x*y-7.123*w))\"\n\"((x-y*7.123-w*x+y-7.123/w*x+y-7.123*w+x/y+7.123+w*x+y-7.123/w-x*y+7.123-w-x/y+7.123+w/x*y*7.123-w))\"\n\"((x-y*7.123/w-x-y/7.123*w-x-y/7.123/w/x*y+7.123*w-x-y/7.123*w+x*y-7.123*w+x*y+7.123*w*x/y-7.123+w))\"\n\"((x-y*7.123/w-x/y+7.123*w-x/y-7.123*w/x-y*7.123+w-x/y+7.123*w+x-y/7.123+w+x-y*7.123+w*x/y*7.123+w))\"\n\"((x-y*7.123/w/x+y/7.123+w/x+y*7.123*w-x/y/7.123-w/x+y/7.123+w*x*y+7.123*w*x/y/7.123-w+x-y-7.123/w))\"\n\"((x-y*z*9.123*x+y*z*9.123*x+y*z/9.123+x*y/z-9.123*x+y*z*9.123-x/y/z-9.123-x*y/z-9.123/x-y-z*9.123))\"\n\"((x-y*z*9.123*x/y-z*9.123*x/y+z*9.123+x-y/z+9.123*x/y-z*9.123-x*y-z+9.123-x-y/z+9.123/x*y/z+9.123))\"\n\"((x-y*z+9.123*x/y*z+9.123*x*y*z+9.123+x+y/z/9.123*x/y*z+9.123-x+y/z*9.123-x+y/z/9.123/x*y-z*9.123))\"\n\"((x-y*z-9.123*x+y-z/9.123*x+y-z*9.123+x/y+z+9.123*x+y-z/9.123-x*y+z-9.123-x/y+z+9.123/x*y*z-9.123))\"\n\"((x-y*z/9.123-x-y/z*9.123-x-y/z/9.123/x*y+z*9.123-x-y/z*9.123+x*y-z*9.123+x*y+z*9.123*x/y-z+9.123))\"\n\"((x-y*z/9.123-x/y+z*9.123-x/y-z*9.123/x-y*z+9.123-x/y+z*9.123+x-y/z+9.123+x-y*z+9.123*x/y*z+9.123))\"\n\"((x-y*z/9.123/x+y/z+9.123/x+y*z*9.123-x/y/z-9.123/x+y/z+9.123*x*y+z*9.123*x/y/z-9.123+x-y-z/9.123))\"\n\"((x-y+7.123*w*x/y+7.123/w*x*y-7.123/w+x+y/7.123-w*x/y+7.123/w-x-y-7.123+w-x+y/7.123-w/x-y*7.123*w))\"\n\"((x-y+7.123*w+x/y-7.123-w+x*y-7.123-w*x-y*7.123/w+x/y-7.123-w/x+y/7.123*w/x-y*7.123/w-x-y/7.123*w))\"\n\"((x-y+7.123+w-x*y*7.123+w-x-y*7.123/w/x+y/7.123+w-x*y*7.123+w+x+y/7.123/w+x+y/7.123+w*x*y+7.123*w))\"\n\"((x-y+7.123/w-x*y-7.123/w-x*y+7.123/w/x+y*7.123-w-x*y-7.123/w+x+y/7.123-w+x+y*7.123-w*x-y/7.123/w))\"\n\"((x-y+7.123/w-x+y*7.123*w-x/y-7.123-w/x+y/7.123*w-x+y*7.123*w+x-y/7.123*w+x+y/7.123*w*x+y*7.123-w))\"\n\"((x-y+z*9.123*x/y+z/9.123*x*y-z/9.123+x+y/z-9.123*x/y+z/9.123-x-y-z+9.123-x+y/z-9.123/x-y*z*9.123))\"\n\"((x-y+z*9.123+x/y-z-9.123+x*y-z-9.123*x-y*z/9.123+x/y-z-9.123/x+y/z*9.123/x-y*z/9.123-x-y/z*9.123))\"\n\"((x-y+z+9.123-x*y*z+9.123-x-y*z/9.123/x+y/z+9.123-x*y*z+9.123+x+y/z/9.123+x+y/z+9.123*x*y+z*9.123))\"\n\"((x-y+z/9.123-x*y-z/9.123-x*y+z/9.123/x+y*z-9.123-x*y-z/9.123+x+y/z-9.123+x+y*z-9.123*x-y/z/9.123))\"\n\"((x-y+z/9.123-x+y*z*9.123-x/y-z-9.123/x+y/z*9.123-x+y*z*9.123+x-y/z*9.123+x+y/z*9.123*x+y*z-9.123))\"\n\"((x-y-7.123*w*x+y*7.123/w*x+y*7.123*w+x-y/7.123*w*x+y*7.123/w-x+y+7.123/w-x-y/7.123*w/x-y*7.123-w))\"\n\"((x-y-7.123*w+x/y-7.123*w+x/y-7.123/w*x-y+7.123+w+x/y-7.123*w/x-y*7.123+w/x-y+7.123+w-x*y*7.123+w))\"\n\"((x-y-7.123+w+x-y*7.123/w+x-y*7.123*w*x+y*7.123*w+x-y*7.123/w/x+y/7.123+w/x+y*7.123*w-x/y/7.123-w))\"\n\"((x-y-7.123/w/x+y/7.123*w/x+y*7.123/w-x+y+7.123/w/x+y/7.123*w*x+y+7.123*w*x+y+7.123/w+x*y*7.123-w))\"\n\"((x-y-7.123/w/x/y-7.123/w/x/y+7.123/w-x-y-7.123+w/x/y-7.123/w*x-y+7.123+w*x-y-7.123+w+x-y*7.123/w))\"\n\"((x-y-z*9.123*x+y*z/9.123*x+y*z*9.123+x-y/z*9.123*x+y*z/9.123-x+y+z/9.123-x-y/z*9.123/x-y*z-9.123))\"\n\"((x-y-z*9.123+x/y-z*9.123+x/y-z/9.123*x-y+z+9.123+x/y-z*9.123/x-y*z+9.123/x-y+z+9.123-x*y*z+9.123))\"\n\"((x-y-z+9.123+x-y*z/9.123+x-y*z*9.123*x+y*z*9.123+x-y*z/9.123/x+y/z+9.123/x+y*z*9.123-x/y/z-9.123))\"\n\"((x-y-z/9.123/x+y/z*9.123/x+y*z/9.123-x+y+z/9.123/x+y/z*9.123*x+y+z*9.123*x+y+z/9.123+x*y*z-9.123))\"\n\"((x-y-z/9.123/x/y-z/9.123/x/y+z/9.123-x-y-z+9.123/x/y-z/9.123*x-y+z+9.123*x-y-z+9.123+x-y*z/9.123))\"\n\"((x-y/7.123*w+x*y-7.123*w+x*y+7.123*w*x/y-7.123+w+x*y-7.123*w/x*y+7.123+w/x/y-7.123+w-x*y/7.123-w))\"\n\"((x-y/7.123*w+x+y-7.123*w+x+y-7.123/w*x+y/7.123-w+x+y-7.123*w/x-y/7.123-w/x+y/7.123-w-x-y+7.123*w))\"\n\"((x-y/7.123*w/x-y*7.123-w/x+y*7.123-w-x+y-7.123*w/x-y*7.123-w*x+y-7.123/w*x+y-7.123*w+x/y+7.123+w))\"\n\"((x-y/7.123+w/x*y/7.123+w/x/y*7.123+w-x+y/7.123*w/x*y/7.123+w*x-y+7.123/w*x+y/7.123*w+x*y+7.123/w))\"\n\"((x-y/7.123-w*x-y+7.123/w*x-y+7.123*w+x/y-7.123-w*x-y+7.123/w-x+y*7.123*w-x/y-7.123-w/x+y/7.123*w))\"\n\"((x-y/7.123/w-x+y*7.123/w-x+y-7.123*w/x-y/7.123-w-x+y*7.123/w+x*y/7.123-w+x-y/7.123-w*x-y+7.123/w))\"\n\"((x-y/7.123/w/x*y+7.123*w/x/y-7.123*w-x*y-7.123+w/x*y+7.123*w*x/y-7.123+w*x*y-7.123+w+x/y/7.123+w))\"\n\"((x-y/z*9.123+x*y-z*9.123+x*y+z*9.123*x/y-z+9.123+x*y-z*9.123/x*y+z+9.123/x/y-z+9.123-x*y/z-9.123))\"\n\"((x-y/z*9.123+x+y-z*9.123+x+y-z/9.123*x+y/z-9.123+x+y-z*9.123/x-y/z-9.123/x+y/z-9.123-x-y+z*9.123))\"\n\"((x-y/z*9.123/x-y*z-9.123/x+y*z-9.123-x+y-z*9.123/x-y*z-9.123*x+y-z/9.123*x+y-z*9.123+x/y+z+9.123))\"\n\"((x-y/z+9.123/x*y/z+9.123/x/y*z+9.123-x+y/z*9.123/x*y/z+9.123*x-y+z/9.123*x+y/z*9.123+x*y+z/9.123))\"\n\"((x-y/z-9.123*x-y+z/9.123*x-y+z*9.123+x/y-z-9.123*x-y+z/9.123-x+y*z*9.123-x/y-z-9.123/x+y/z*9.123))\"\n\"((x-y/z/9.123-x+y*z/9.123-x+y-z*9.123/x-y/z-9.123-x+y*z/9.123+x*y/z-9.123+x-y/z-9.123*x-y+z/9.123))\"\n\"((x-y/z/9.123/x*y+z*9.123/x/y-z*9.123-x*y-z+9.123/x*y+z*9.123*x/y-z+9.123*x*y-z+9.123+x/y/z+9.123))\"\n\"((x/5.123*z+w-x+5.123/z*w-x+5.123/z/w/x*5.123-z*w-x+5.123/z*w+x*5.123+z/w+x*5.123-z*w*x+5.123+z-w))\"\n\"((x/5.123*z-w+x+5.123+z/w+x+5.123+z*w*x/5.123+z-w+x+5.123+z/w/x*5.123-z-w/x/5.123+z-w-x+5.123*z/w))\"\n\"((x/5.123*z-w/x-5.123*z*w/x-5.123*z/w-x/5.123+z*w/x-5.123*z*w*x/5.123-z*w*x/5.123+z*w+x-5.123/z+w))\"\n\"((x/5.123+z*w+x-5.123/z+w+x-5.123*z+w*x/5.123*z+w+x-5.123/z+w/x*5.123/z+w/x/5.123*z+w-x+5.123/z*w))\"\n\"((x/5.123+z+w/x*5.123*z-w/x/5.123/z-w-x-5.123-z*w/x*5.123*z-w*x-5.123*z/w*x-5.123-z*w+x/5.123-z*w))\"\n\"((x/5.123+z-w-x+5.123*z/w-x/5.123*z-w/x-5.123*z*w-x+5.123*z/w+x-5.123/z/w+x-5.123*z*w*x/5.123-z*w))\"\n\"((x/5.123+z/w-x-5.123-z+w-x+5.123/z-w/x-5.123*z*w-x-5.123-z+w+x-5.123*z/w+x-5.123*z*w*x+5.123*z*w))\"\n\"((x/5.123-z*w-x*5.123-z+w-x-5.123/z+w/x*5.123/z+w-x*5.123-z+w+x/5.123/z+w+x*5.123/z+w*x-5.123+z/w))\"\n\"((x/5.123-z*w/x-5.123*z+w/x-5.123+z+w-x*5.123*z+w/x-5.123*z+w*x/5.123*z+w*x*5.123*z+w+x+5.123/z/w))\"\n\"((x/5.123-z+w-x*5.123/z-w-x/5.123/z+w/x-5.123+z*w-x*5.123/z-w+x-5.123-z/w+x-5.123+z*w*x/5.123+z/w))\"\n\"((x/5.123-z-w/x+5.123/z*w/x-5.123*z/w-x-5.123/z*w/x+5.123/z*w*x+5.123*z-w*x-5.123/z*w+x*5.123-z*w))\"\n\"((x/5.123-z/w*x-5.123+z+w*x-5.123-z+w+x-5.123*z/w*x-5.123+z+w-x*5.123*z+w-x-5.123*z/w/x+5.123/z+w))\"\n\"((x/5.123/z+w/x-5.123+z*w/x-5.123+z/w-x*5.123-z/w/x-5.123+z*w*x/5.123+z/w*x*5.123-z/w+x+5.123/z-w))\"\n\"((x/5.123/z-w+x-5.123-z/w+x-5.123-z*w*x+5.123*z/w+x-5.123-z/w/x+5.123/z*w/x+5.123*z/w-x+5.123+z/w))\"\n\"((x/5.123/z-w-x-5.123-z*w-x-5.123-z/w/x/5.123-z/w-x-5.123-z*w+x/5.123-z*w+x/5.123-z/w*x-5.123+z+w))\"\n\"((x/y*7.123+w-x+y/7.123*w-x+y/7.123/w/x*y-7.123*w-x+y/7.123*w+x*y+7.123/w+x*y-7.123*w*x+y+7.123-w))\"\n\"((x/y*7.123-w+x+y+7.123/w+x+y+7.123*w*x/y+7.123-w+x+y+7.123/w/x*y-7.123-w/x/y+7.123-w-x+y*7.123/w))\"\n\"((x/y*7.123-w/x-y*7.123*w/x-y*7.123/w-x/y+7.123*w/x-y*7.123*w*x/y-7.123*w*x/y+7.123*w+x-y/7.123+w))\"\n\"((x/y*z+9.123-x+y/z*9.123-x+y/z/9.123/x*y-z*9.123-x+y/z*9.123+x*y+z/9.123+x*y-z*9.123*x+y+z-9.123))\"\n\"((x/y*z-9.123+x+y+z/9.123+x+y+z*9.123*x/y+z-9.123+x+y+z/9.123/x*y-z-9.123/x/y+z-9.123-x+y*z/9.123))\"\n\"((x/y*z-9.123/x-y*z*9.123/x-y*z/9.123-x/y+z*9.123/x-y*z*9.123*x/y-z*9.123*x/y+z*9.123+x-y/z+9.123))\"\n\"((x/y+7.123*w+x-y/7.123+w+x-y*7.123+w*x/y*7.123+w+x-y/7.123+w/x*y/7.123+w/x/y*7.123+w-x+y/7.123*w))\"\n\"((x/y+7.123+w/x*y*7.123-w/x/y/7.123-w-x-y-7.123*w/x*y*7.123-w*x-y*7.123/w*x-y-7.123*w+x/y-7.123*w))\"\n\"((x/y+7.123-w-x+y*7.123/w-x/y*7.123-w/x-y*7.123*w-x+y*7.123/w+x-y/7.123/w+x-y*7.123*w*x/y-7.123*w))\"\n\"((x/y+7.123/w-x-y-7.123+w-x+y/7.123-w/x-y*7.123*w-x-y-7.123+w+x-y*7.123/w+x-y*7.123*w*x+y*7.123*w))\"\n\"((x/y+z*9.123+x-y/z+9.123+x-y*z+9.123*x/y*z+9.123+x-y/z+9.123/x*y/z+9.123/x/y*z+9.123-x+y/z*9.123))\"\n\"((x/y+z+9.123/x*y*z-9.123/x/y/z-9.123-x-y-z*9.123/x*y*z-9.123*x-y*z/9.123*x-y-z*9.123+x/y-z*9.123))\"\n\"((x/y+z-9.123-x+y*z/9.123-x/y*z-9.123/x-y*z*9.123-x+y*z/9.123+x-y/z/9.123+x-y*z*9.123*x/y-z*9.123))\"\n\"((x/y+z/9.123-x-y-z+9.123-x+y/z-9.123/x-y*z*9.123-x-y-z+9.123+x-y*z/9.123+x-y*z*9.123*x+y*z*9.123))\"\n\"((x/y-7.123*w-x*y-7.123+w-x-y/7.123+w/x*y/7.123+w-x*y-7.123+w+x/y/7.123+w+x*y/7.123+w*x-y+7.123/w))\"\n\"((x/y-7.123*w/x-y*7.123+w/x-y+7.123+w-x*y*7.123+w/x-y*7.123+w*x/y*7.123+w*x*y*7.123+w+x+y/7.123/w))\"\n\"((x/y-7.123+w-x*y/7.123-w-x/y/7.123+w/x-y+7.123*w-x*y/7.123-w+x-y-7.123/w+x-y+7.123*w*x/y+7.123/w))\"\n\"((x/y-7.123-w/x+y/7.123*w/x-y*7.123/w-x-y/7.123*w/x+y/7.123*w*x+y*7.123-w*x-y/7.123*w+x*y-7.123*w))\"\n\"((x/y-7.123/w*x-y+7.123+w*x-y-7.123+w+x-y*7.123/w*x-y+7.123+w-x*y*7.123+w-x-y*7.123/w/x+y/7.123+w))\"\n\"((x/y-z*9.123-x*y-z+9.123-x-y/z+9.123/x*y/z+9.123-x*y-z+9.123+x/y/z+9.123+x*y/z+9.123*x-y+z/9.123))\"\n\"((x/y-z*9.123/x-y*z+9.123/x-y+z+9.123-x*y*z+9.123/x-y*z+9.123*x/y*z+9.123*x*y*z+9.123+x+y/z/9.123))\"\n\"((x/y-z+9.123-x*y/z-9.123-x/y/z+9.123/x-y+z*9.123-x*y/z-9.123+x-y-z/9.123+x-y+z*9.123*x/y+z/9.123))\"\n\"((x/y-z-9.123/x+y/z*9.123/x-y*z/9.123-x-y/z*9.123/x+y/z*9.123*x+y*z-9.123*x-y/z*9.123+x*y-z*9.123))\"\n\"((x/y-z/9.123*x-y+z+9.123*x-y-z+9.123+x-y*z/9.123*x-y+z+9.123-x*y*z+9.123-x-y*z/9.123/x+y/z+9.123))\"\n\"((x/y/7.123+w/x-y+7.123*w/x-y+7.123/w-x*y-7.123/w/x-y+7.123*w*x/y+7.123/w*x*y-7.123/w+x+y/7.123-w))\"\n\"((x/y/7.123-w+x-y-7.123/w+x-y-7.123*w*x+y*7.123/w+x-y-7.123/w/x+y/7.123*w/x+y*7.123/w-x+y+7.123/w))\"\n\"((x/y/7.123-w-x-y-7.123*w-x-y-7.123/w/x/y-7.123/w-x-y-7.123*w+x/y-7.123*w+x/y-7.123/w*x-y+7.123+w))\"\n\"((x/y/z+9.123/x-y+z*9.123/x-y+z/9.123-x*y-z/9.123/x-y+z*9.123*x/y+z/9.123*x*y-z/9.123+x+y/z-9.123))\"\n\"((x/y/z-9.123+x-y-z/9.123+x-y-z*9.123*x+y*z/9.123+x-y-z/9.123/x+y/z*9.123/x+y*z/9.123-x+y+z/9.123))\"\n\"((x/y/z-9.123-x-y-z*9.123-x-y-z/9.123/x/y-z/9.123-x-y-z*9.123+x/y-z*9.123+x/y-z/9.123*x-y+z+9.123))\"\n\"(cos((sin((((a-tan(tan(sin(sin(((((b+(((tan(a)*1.07)+a)+a))+3.45)-e)+0.89))))))/2.85)+a))*2.61))+a)\"\n\"sin(((b+(((tan(((((((sin(((((tan(((b-e)-1.21))+b)*a)/e)+1.65))+a)+e)*a)/e)*1.16)+a))+e)*b)+e))+pi))\"\n\"tan((((cos((cos((tan(((sin((a+((a/sin(((sin(tan(a))/e)/pi)))-1.43)))-3.32)+b))+e))-2.62))/a)+a)-a))\"\n\"tan((1.38*((e-(1.51/((((cos(cos(((tan((((sin((1.62+a))-b)+a)-2.24))/b)+pi)))-pi)-b)/1.91)*a)))+b)))\"\n\"((((((((((((b+((b+((((((e+e)+b)+2.84)+0.70)+e)+pi))/a))*0.75)+b)+b)/b)+b)/3.41)/b)*2.56)-2.04)/a)/a)\"\n\"(((sin(((2.59/(a*(((((cos(tan((b*((((a/((2.22*e)+pi))*pi)-pi)-a))))/e)+b)+b)/2.00)-b)))/b))+e)+a)/e)\"\n\"((b-sin(tan((sin((((sin(cos((e/sin((((sin((((1.39+b)/b)+0.70))/a)-0.41)+b)))))*a)/2.93)/b))+a))))/e)\"\n\"(cos(((a+(tan((a+(cos((2.41+(tan(((tan(tan((sin((cos(pi)-b))+0.69)))+b)/0.45))-e)))+b)))*b))+b))+pi)\"\n\"tan((((((cos(tan(((2.87+((pi+(((cos((pi-(tan(a)+a)))-2.70)+b)-e))*b))+3.16)))-b)-a)+0.55)*1.69)+pi))\"\n\"tan((pi-sin((((sin(((2.56*(b/(((sin((sin(((b+((b/0.83)/b))*a))+1.82))+a)+1.53)*a)))*pi))-b)+b)/a))))\"\n\"((((((((123.456/654.321)*(1.1/2.2))*(2.2/3.3))*(3.3/4.4))*(4.4/5.5))*(5.5/6.6))*(6.6/7.7))*(7.7/8.8))\"\n\"((((((((123.456/654.321)+(1.1/2.2))+(2.2/3.3))+(3.3/4.4))+(4.4/5.5))+(5.5/6.6))+(6.6/7.7))+(7.7/8.8))\"\n\"((sin((((cos(((sin(((b-(tan(((cos(sin((3.88+(((a+a)/b)+1.88))))+b)*a))/b))+b))*a)*b))+b)+a)+a))-b)+a)\"\n\"(b+1.1)*(b+2.2)*(b+3.3)*(b+4.4)*(b+5.5)*(b+6.6)*(b+7.7)*(b+8.8)*(b+9.9)*(b+10.10)*(b+11.11)*(b+12.12)\"\n\"((((((((((e-(((3.32/((((((a*b)+pi)-a)/3.19)/a)-a))-1.54)-b))+0.34)/0.74)-b)*a)*b)*e)*3.64)/1.81)/3.78)\"\n\"(((((tan(((b+(pi*((sin(sin((((sin((((pi*a)*b)*e))/e)/1.06)/pi)))-b)*b)))-pi))+pi)+3.20)-0.48)+b)-0.68)\"\n\"(pi*((cos((tan(((3.49-(cos((cos((1.86-((a+(3.83*(2.93/(pi-b))))-3.19)))*b))+pi))-2.85))+pi))/2.86)*b))\"\n\"4.4*a^12+3.3*a^11+2.2*a^10+1.1*a^9+9.9*a^8+8.8*a^7+7.7*a^6+6.6*a^5+5.5*a^4+4.4*a^3+3.3*a^2+2.2*a^1+1.1\"\n\"sin(sin(tan(((((tan((e/(cos((cos((tan(cos(cos((cos((b/tan(a)))*3.88))))*0.38))+a))+b)))*a)+a)+b)*b))))\"\n\"((((((((((((((((a-((((a*1.18)+2.29)-2.64)+b))-1.19)+pi)+b)+b)+b)-0.48)-e)+a)+a)+3.61)+a)+b)+1.22)+e)-a)\"\n\"((((b/(((sin((cos((((((tan(sin((a*sin(((a/b)/e)))))/2.27)-pi)-pi)+pi)/3.19))/a))/b)+pi)*b))+0.81)/b)+e)\"\n\"((2.2/3.3)*((3.3/4.4)*((4.4/5.5)*((5.5/6.6)*(((((a*b)+(9.9/10.10))+(8.8/9.9))+(7.7/8.8))+(6.6/8.8))))))\"\n\"((2.2/3.3)+((3.3/4.4)+((4.4/5.5)+((5.5/6.6)+(((((a*b)*(9.9/10.10))*(8.8/9.9))*(7.7/8.8))*(6.6/8.8))))))\"\n\"(sin((((((tan(((((tan((b+(sin(((((cos(cos(e))-a)+b)-pi)+a))+b)))/a)+a)/b)/1.94))+a)+a)-e)*pi)*3.69))+a)\"\n\"(((((((b-((b-((((((((b+((3.28+((0.73*e)+a))*a))*pi)+1.18)*b)/a)+1.01)-b)*b))*b))+b)-a)/a)*2.41)+3.33)+a)\"\n\"((((((1.93+((((((((((e*(((3.50+(((a-a)+b)-0.83))-b)+b))+a)-0.74)+pi)+e)+b)+a)-b)/pi)/b))+b)-pi)+b)*a)*b)\"\n\"(((2.30*((1.22/((0.12-((1.04/((((((2.62*((((a+((e+pi)-pi))/a)+pi)+a))-b)-pi)+e)/b)+b))*b))+b))*a))/a)*b)\"\n\"((0.51+((((((((((b+(((((((((a*b)*e)+e)+3.99)/a)-b)+a)-0.48)+b))/a)*3.21)*3.00)-e)+b)+2.53)/a)+a)*b))/pi)\"\n\"((((((((((((((2.39+((((((b*((b+e)+a))/pi)-3.10)-pi)+a)/b))+a)*a)-1.53)-b)+e)+a)*a)-pi)+pi)*a)*3.60)/b)+a)\"\n\"(((((((a*(((((e-((sin((cos((a-(tan(((b+1.18)-b))-e)))/e))*b)+a))/a)/a)+pi)+2.14))+2.04)+pi)+pi)+pi)*e)+a)\"\n\"(((e+(((a*(((((((((((((pi-2.35)+2.74)/1.05)-3.03)/pi)+2.58)/2.51)+pi)/a)*a)-3.76)-1.27)+pi))+a)-e))+a)*a)\"\n\"(pi+((pi*(((((((((((pi+((a-(((0.30+a)/1.89)*0.35))+0.12))-a)*3.06)*b)+2.71)+b)/0.40)/2.64)+b)/pi)+a))/b))\"\n\"cos(sin((a+((((((((((((sin((((tan((cos(((b/b)+a))*a))/b)+a)/e))/a)/b)/pi)+b)-e)/b)-b)+a)+b)-pi)+a)-pi))))\"\n\"(((((2.86+(tan((((3.68+((((b+((a*(pi+tan(((b*3.08)+a))))/b))+a)+pi)/0.08))-a)+b))-b))-a)*1.83)+2.17)*0.30)\"\n\"((((((((b+(((((((a/((pi+((((a*(2.74/a))*1.76)*b)-b))*pi))-pi)-pi)-0.14)-b)*pi)+a))+a)-a)*b)/a)/2.77)+b)+pi)\"\n\"((((x+y)-(x+y)*(x+z)-(x-w))/((x-y)-(x+y)-(x+z)-(x-w))+((x-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((x+y)-(x+y)*(x+z)-(x-w))/((x-y)-(x+y)-(x+z)-(x-w))+((y-x)+(y+z)-(y+w)+(y-z))*((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((x+y)/(x+y)+(x+z)/(x-w))-((x-y)-(x+y)-(x+z)-(x-w))+((x-y)+(x+y)-(x+z)+(x+w))*((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((x+y)/(x+y)+(x+z)/(x-w))-((x-y)-(x+y)-(x+z)-(x-w))+((y-x)*(y+z)/(y+w)*(y-x))+((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((x-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(x-z)-(x-w))+((x+y)/(x+y)+(x+z)/(x-w))-((x-y)-(x+y)-(x+z)-(x-w))))\"\n\"((((x-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(x-z)-(x-w))+((x-y)/(x+y)+(x+z)/(x-w))-((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((x-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(x-z)-(x-w))+((y+x)-(y+z)*(y+w)-(y+w))/((x-y)-(x+y)-(x+z)+(x-w))))\"\n\"((((x-y)+(x+y)-(x+z)+(x+w))*((x-y)-(x-y)-(x-z)-(x-w))+((x+y)-(x+y)*(x+z)-(x-w))/((x-y)-(x+y)-(x+z)-(x-w))))\"\n\"((((x-y)+(x+y)-(x+z)+(x+w))*((x-y)-(x-y)-(x-z)-(x-w))+((y+x)/(y+z)+(y+w)/(y+y))-((x-y)-(x+y)-(x+z)+(x-w))))\"\n\"((((x-y)/(x+y)+(x+z)/(x-w))-((x-y)-(x-y)-(x-z)-(x-w))+((y-x)*(y+z)/(y+w)*(y-x))+((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((y+x)-(y+z)*(y+w)-(y-w))/((x-y)-(x+y)-(x+z)+(x-w))+((x-y)+(x+y)-(x+z)+(x+w))*((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((y+x)-(y+z)*(y+w)-(y-w))/((x-y)-(x+y)-(x+z)+(x-w))+((y-x)*(y+z)/(y+w)*(y+x))+((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((y+x)/(y+z)+(y+w)/(y+y))-((x-y)-(x+y)-(x+z)+(x-w))+((x-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((y+x)/(y+z)+(y+w)/(y+y))-((x-y)-(x+y)-(x+z)+(x-w))+((y-x)+(y+z)-(y+w)+(y-z))*((x-y)-(x-y)-(x-z)-(x+w))))\"\n\"((((y-x)*(y+z)/(y+w)*(y+x))+((x-y)-(x-y)-(x-z)-(x+w))+((x+y)-(x+y)*(x+z)-(x-w))/((x-y)-(x+y)-(x+z)-(x-w))))\"\n\"((((y-x)*(y+z)/(y+w)*(y+x))+((x-y)-(x-y)-(x-z)-(x+w))+((y+x)/(y+z)+(y+w)/(y+y))-((x-y)-(x+y)-(x+z)+(x-w))))\"\n\"((((y-x)*(y+z)/(y+w)*(y+x))+((x-y)-(x-y)-(x-z)-(x+w))+((y-x)/(y+z)+(y+w)/(y+y))-((x-y)-(x-y)-(x-z)+(x-w))))\"\n\"((((y-x)+(y+z)-(y+w)+(y+z))*((x-y)-(x-y)-(x-z)-(x+w))+((y+x)-(y+z)*(y+w)-(y-w))/((x-y)-(x+y)-(x+z)+(x-w))))\"\n\"((((y-x)+(y+z)-(y+w)+(y-z))*((x-y)-(x-y)-(x-z)-(x+w))+((x+y)/(x+y)+(x+z)/(x-w))-((x-y)-(x+y)-(x+z)-(x-w))))\"\n\"((((y-x)/(y+z)+(y+w)/(y+y))-((x-y)-(x-y)-(x-z)+(x-w))+((x-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(x-z)-(x-w))))\"\n\"((((((((((((((((((b+((b-3.60)+1.66))/a)+a)+a)+pi)*pi)*b)*3.58)*b)+2.20)-pi)*2.79)*e)+1.40)+0.74)+a)-1.75)*a)\"\n\"((((a+(((((pi+(((((((((((((((a+e)+e)+a)/a)+a)-a)*a)+pi)+e)+b)*a)+a)+2.64)+e)+0.87))+b)/b)-a)-2.91))+e)-b)*a)\"\n\"(((0.86+(0.66/(b-((((((b/(a-(((((3.49*(((((pi-b)/3.08)*1.74)-e)-2.55))*e)-b)+a)-b)))-a)+a)-e)*b)*b))))*e)+a)\"\n\"(((1.37/(((((2.46-(((((((((((((b/e)+a)*2.17)*1.58)-pi)+b)*pi)/a)*1.31)/a)/b)*e)/e))-e)/e)+a)-a))*1.91)/1.72)\"\n\"((b+((((((((((((((((e/(((b+((((e-pi)/a)+a)+a))*a)-a))-pi)/e)+3.11)/b)+b)*e)+b)/e)*e)+a)*pi)-a)*pi)-a)/e))-e)\"\n\"(e/(cos(tan(((tan(((tan(((((cos(((((((((e-a)+pi)*b)-pi)*2.29)-3.77)+e)+b))-b)-a)*pi)+b))-pi)+a))-b)/b)))/b))\"\n\"((((((((((a+((((((((3.91-(b+((a*a)+e)))+3.60)/0.51)/b)+e)+a)+pi)-0.99))/a)+a)-3.33)+pi)*a)-b)+2.60)-2.73)*pi)\"\n\"((((a*((((0.79-((((((1.06+(e*((((1.87*(((a-a)*a)+pi))+a)*2.77)+b)))/e)+2.15)*0.69)+e)*a))-b)/a)/a))*pi)-e)/a)\"\n\"(((2.81-(((((e*(((b/((a+(((((((((b/e)-3.84)*e)+e)+pi)/a)-b)*a)*a))*2.36))+1.29)+b))*3.47)/a)-3.40)-pi))+e)-e)\"\n\"(((cos((sin(sin((a-(e+tan((((((((((((a/(pi/a))+a)/0.19)-a)+b)*pi)-a)+pi)*2.49)+a)/pi))))))+0.10))+3.27)+b)+b)\"\n\"(((sin(((sin(((((((((tan((cos((((cos(e)-e)*0.16)*b))+0.31))*pi)/0.73)*e)+pi)/e)/a)/a)+1.76))+e)+e))-b)+b)/pi)\"\n\"(((((((sin((((a+(((((a+(((cos((a+1.63))-2.15)*2.52)*1.95))*a)+a)-b)/0.45))*b)*3.41))/pi)+b)*e)+a)+pi)/3.54)+e)\"\n\"((((sin((cos(cos(((2.12/(((((((((((sin((pi+a))*a)-a)/b)-b)/a)+a)*e)+a)+b)/3.84)+b))*3.63)))*e))+2.48)-b)*a)+a)\"\n\"(1.1+(b+1)*(b+2))*(2.2+(b+3)*(b+4))*(3.3+(b+5)*(b+6))*(4.4+(b+7)*(b+8))*(5.5+(b+9)*(b+10))*(6.6+(b+11)*(b+12))\"\n\"cos(sin(((sin((((2.61*sin(((cos((sin((0.51+((((tan(((1.45+b)*b))/a)+a)-b)+pi)))/e))/3.24)-b)))-a)+pi))+a)-a)))\"\n\"(((((((((((((((((((((((b/b)/b)*e)+b)-pi)-2.26)-a)+pi)*a)/0.92)/a)+pi)/b)+a)-pi)+a)+2.56)-pi)*b)-a)+2.11)/pi)+e)\"\n\"(((sin((((((((a+((0.97/(((((cos(((b*((a/3.77)/1.77))*2.44))*b)-2.05)-a)+pi)+a))+b))+a)+a)*a)*a)+b)+e))+e)/a)/e)\"\n\"(tan(((((((((1.71/(cos((pi/(cos(((((((0.79+2.44)+b)+2.13)/3.71)-b)+a))-a)))+a))/3.62)+b)+0.38)/pi)+b)/a)+e))+b)\"\n\"(2.41-(((((((a*((((((1.25-((((((((((a+a)*a)+e)+b)+a)*2.06)-a)*b)/b)*a))+a)+1.26)+a)*b)-e))/b)-b)+a)-e)+a)/3.71))\"\n\"(cos((((((cos(((e+(((b+tan((tan(((((sin(((pi-e)-3.12))-1.07)/a)*b)+e))+b)))/e)-a))+a))/a)/3.47)-1.66)+b)+pi))*b)\"\n\"(((((((a-(((e+(((((((((e/(b-a))/3.39)+e)+pi)+0.84)+a)*3.08)-pi)+2.53))*1.11)*2.11))-b)*0.47)+a)+1.74)*0.76)*2.82)\"\n\"(((cos(((((a+((pi*(e+tan((cos((((((b+(tan(((1.60*a)-0.34))-0.76))-a)+pi)+3.27)+a))/pi))))-a))+b)*b)-e))+e)/e)+pi)\"\n\"(cos(((sin(tan(((((((tan(cos(tan(cos(((tan(cos((sin(e)*pi)))+1.02)-b)))))*pi)-b)/b)-a)+b)-b)))+0.31)+0.11))-3.13)\"\n\"cos((((((tan((b+sin(((cos((sin((2.63+((b+(sin((b+(2.88*0.47)))/3.31))*3.77)))/a))*b)-pi))))-e)-a)-3.39)-2.28)+e))\"\n\"((((((((((((pi+((((0.14*(((a+((((b*pi)+a)-2.73)*b))/3.27)/b))+b)-a)/b))+pi)*pi)+e)-a)/0.06)*pi)-a)*a)+2.13)+b)*pi)\"\n\"((((((((((((pi-(((((b+(a+((((0.48-0.29)+pi)+a)+e)))-pi)/b)*pi)*pi))-0.77)+0.95)*b)-a)-a)*pi)/b)+pi)-0.09)+2.33)+a)\"\n\"((((((((((tan(((((sin((pi+sin(sin(((1.34-a)/b)))))*3.87)+1.81)/2.91)+a))-b)+3.62)-e)+b)+3.03)/a)+0.68)+a)+1.51)*e)\"\n\"((0.42+(((((((((e+(((a*((((((((a+e)/2.67)+pi)+a)/pi)-0.87)*b)+pi))*2.94)-3.07))/b)-pi)+1.54)-b)*a)/2.31)-a)-b))/a)\"\n\"(b-((2.51*((((a-((((((((b-((((((((b*b)-a)/a)*a)+0.26)-pi)-pi)+1.19))+pi)-2.53)+b)/b)+b)+a)*a))*0.50)/0.47)*b))-e))\"\n\"(tan((a/(a/sin(((sin((((((((sin(((((((2.41+e)*2.58)-0.25)+a)-a)/b))-1.48)+b)+b)+a)+1.52)/1.22)+a))+a)-b)))))/3.06)\"\n\"(((((((((((((((((((((((((b/e)*a)/1.88)/a)*a)-b)*3.26)+a)+b)-b)+1.92)/pi)+b)+e)/a)*e)*a)/e)-1.89)*b)/a)+b)/a)/pi)/b)\"\n\"((((e-(2.57*((((((((((((((((((0.19*b)/pi)-b)-b)+a)+1.35)+a)/1.60)+b)+pi)/a)+pi)*2.97)/a)-a)*2.81)+a)/b)))/pi)-a)/e)\"\n\"(((b+(a-((((tan((b*((((((a+(cos((cos(tan(((a+a)*3.33)))-b))/2.52))*e)/b)+3.07)+0.86)+b)))*3.95)/0.39)*b)+a)))+a)*b)\"\n\"((2.2/3.3)*((3.3/4.4)*((4.4/5.5)*((5.5/6.6)*(((((123.456*654.321)+(9.9/10.10))+(8.8/9.9))+(7.7/8.8))+(6.6/8.8))))))\"\n\"((2.2/3.3)+((3.3/4.4)+((4.4/5.5)+((5.5/6.6)+(((((123.456*654.321)*(9.9/10.10))*(8.8/9.9))*(7.7/8.8))*(6.6/8.8))))))\"\n\"cos(cos(cos(cos((tan((((((tan(tan(tan(cos((((tan(tan(((sin((a+e))+b)+a)))-a)*a)/pi)))))*b)+pi)*pi)+a)*0.78))+b)))))\"\n\"((((((((((((((((a-(a+(((((e*(0.81*(pi/a)))+1.29)*3.02)+b)+b)))-a)-a)/1.11)+2.33)/3.58)*b)+b)*a)+a)+e)-b)+b)+e)-b)/a)\"\n\"((((a/(((((tan((b*(a/(a/cos(((pi*(cos((((tan((pi*(sin(b)+e)))+1.22)*b)-b))*a))*a))))))-pi)-a)+e)+b)-a))-3.84)+a)-pi)\"\n\"((0.74+cos((tan(((((((0.68+(((((((((cos((((a+a)+b)-b))-b)-e)+2.16)+b)-a)-b)-a)+b)+b))*b)*pi)+a)-2.73)*b))/3.27)))/b)\"\n\"((((((((((((((0.32+(b*((pi-(pi-((((((b-a)-3.84)+a)-pi)*b)-1.61)))+pi)))/b)+3.76)-b)+a)+a)*a)+b)/b)-b)+a)+a)-pi)+0.73)\"\n\"(((((1.0-y)/(x+y)+(x+z)/(x-w))-((x-y)-(x-y)-(1.0-z)-(x-w))+((y-x)*(y+z)/(y+w)*(1.0-x))+((x-y)-(x-y)-(x-z)-(1.0+w)))))\"\n\"(((((9.1-y)*(x+y)/(x+z)*(x+w))+((x-y)-(x-y)-(9.1-z)-(x-w))+((y+x)-(y+z)*(y+w)-(9.1+w))/((x-y)-(x+y)-(x+z)+(9.1-w)))))\"\n\"(((((y+x)-(y+4.6)*(y+w)-(y-w))/((x-4.6)-(x+y)-(x+z)+(x-w))+((y-x)*(y+4.6)/(y+w)*(4.6+x))+((x-y)-(x-y)-(x-z)-(x+w)))))\"\n\"(((((y+x)-(y+8.2)*(y+w)-(y-w))/((x-8.2)-(x+y)-(x+z)+(x-w))+((x-y)+(x+8.2)-(x+z)+(8.2+w))*((x-y)-(x-y)-(x-z)-(x-w)))))\"\n\"(((((y+x)/(y+2.8)+(y+w)/(y+y))-((x-2.8)-(x+y)-(x+z)+(x-w))+((y-x)+(y+2.8)-(y+w)+(2.8-z))*((x-y)-(x-y)-(x-z)-(x+w)))))\"\n\"(((((y+x)/(y+6.4)+(y+w)/(y+y))-((x-6.4)-(x+y)-(x+z)+(x-w))+((x-y)*(x+6.4)/(x+z)*(6.4+w))+((x-y)-(x-y)-(x-z)-(x-w)))))\"\n\"(((((y-x)*(y+1.9)/(y+w)*(y+x))+((x-1.9)-(x-y)-(x-z)-(x+w))+((y+x)/(y+1.9)+(y+w)/(1.9+y))-((x-y)-(x+y)-(x+z)+(x-w)))))\"\n\"(((((y-x)*(y+5.5)/(y+w)*(y+x))+((x-5.5)-(x-y)-(x-z)-(x+w))+((y-x)/(y+5.5)+(y+w)/(5.5+y))-((x-y)-(x-y)-(x-z)+(x-w)))))\"\n\"(((((y-x)*(y+9.1)/(y+w)*(y+x))+((x-9.1)-(x-y)-(x-z)-(x+w))+((x+y)-(x+9.1)*(x+z)-(9.1-w))/((x-y)-(x+y)-(x+z)-(x-w)))))\"\n\"(((((y-x)+(y+3.7)-(y+w)+(y+z))*((x-3.7)-(x-y)-(x-z)-(x+w))+((y+x)-(y+3.7)*(y+w)-(3.7-w))/((x-y)-(x+y)-(x+z)+(x-w)))))\"\n\"(((((y-x)+(y+7.3)-(y+w)+(y-z))*((x-7.3)-(x-y)-(x-z)-(x+w))+((x+y)/(x+7.3)+(x+z)/(7.3-w))-((x-y)-(x+y)-(x+z)-(x-w)))))\"\n\"(((((y-x)/(y+1.0)+(y+w)/(y+y))-((x-1.0)-(x-y)-(x-z)+(x-w))+((x-y)*(x+1.0)/(x+z)*(1.0+w))+((x-y)-(x-y)-(x-z)-(x-w)))))\"\n\"((a/((e*(((((((((((b+((((((((((a+b)/b)/pi)+b)/pi)+b)+a)+pi)+0.23)/e))*b)+3.10)+1.04)+a)-pi)/b)+a)+e)/2.22)/a))/a))/b)\"\n\"(tan(cos(((cos((((((cos((sin(((((((sin((((b*b)+a)-0.94))+2.12)-b)*b)+a)+e)+2.82))+pi))+a)-a)+e)/a)*e))/e)-2.96)))-pi)\"\n\"tan(tan((3.81+(((2.10+(e+((((pi+cos((((b+(tan((0.12+sin((cos(3.50)+a))))-pi))*b)+1.38)))*e)+0.22)/b)))+1.08)+3.64))))\"\n\"((((((((((((((((((((((a*(pi-3.90))-3.78)+b)+b)/pi)/3.62)*1.05)*2.74)*b)*a)+2.82)+e)/b)*a)+a)-b)+1.02)+e)+pi)-a)+b)+pi)\"\n\"(((((((((((((e+((a+(((((((((a*1.26)+a)/0.76)+e)-e)+a)+3.67)+a)*0.32))+a))-a)/pi)+b)-pi)-0.48)/a)+e)/b)+a)-b)-3.25)+pi)\"\n\"((((((sin((a-(a+(sin(cos(cos((e*((((((sin((sin(cos((1.43-a)))-0.78))+a)/b)*a)-pi)-e)*e)))))*e))))/2.42)*a)+b)-b)+b)/b)\"\n\"(((((a+(((((((e+(((((((((((((1.13+b)*0.53)+e)-a)/b)+b)-a)-e)-0.68)-b)/b)/3.07)+e))-a)+b)*pi)/pi)/a)*a))*b)-a)+e)+3.82)\"\n\"((e+((tan((cos(((((sin(((sin((((tan((((tan((a+e))*2.86)+pi)*b))*b)*2.17)/e))-b)+a))-b)*a)+b)-2.15))-pi))+pi)*2.19))*b)\"\n\"((sin(tan((tan((cos(cos(sin((cos((b-(e*tan(sin((a/((b/cos(((2.76*((sin(e)/a)+b))*b)))*a)))))))*a))))/a))*0.92)))-e)+e)\"\n\"((((((((((((((((((((((((pi-b)/0.07)/0.29)-pi)+a)*a)+a)-a)-2.46)-e)*a)+a)+a)/1.80)*b)+a)/0.65)+pi)/0.99)+a)+pi)+a)+b)*b)\"\n\"(((((cos((cos(((sin(((((cos((((b+sin(tan(((pi+b)-1.93))))+pi)/a))+b)+2.79)/3.93)/1.91))+a)+b))-3.26))+a)+1.08)-b)+b)/a)\"\n\"((((((((((b+(((b/(b/(((((((((a-b)+0.53)*1.03)/3.46)+e)+a)+2.48)-3.09)+pi)))+2.09)-a))/pi)*b)/pi)*a)-a)/1.49)+1.64)/b)-b)\"\n\"((((a*(sin((0.79-((((((1.06+(e*((((1.87*(sin(((3.27*pi)-b))/a))-1.91)/a)/b)))/a)*1.70)+b)-0.77)-0.54)))+pi))*e)+e)*2.07)\"\n\"(1.16-((((((((((tan(((((cos(tan(tan((((((3.03*e)+e)/2.59)/0.76)+3.85))))+b)-b)/a)+e))+e)*pi)+2.29)/b)/a)+a)*a)+e)-a)+e))\"\n\"(sin((((a*tan((((b/((sin(((cos(tan((pi+sin(((((3.94/(((pi+2.51)/pi)+b))+1.74)+b)-b)))))/e)+pi))+b)+b))/b)+e)))*b)+b))+a)\"\n\"cos((cos(((((cos(((cos((tan(((((((cos(((sin(pi)-3.90)-3.78))+b)+b)/pi)/3.62)*1.05)*2.74))*b))*a)+2.82))+e)/b)*a)+a))-b))\"\n\"(((((((((((((e+(((pi+(2.85+((((((((2.52+pi)*pi)*2.79)*e)+pi)/b)*a)-2.97)))-b)*b))+b)*a)+b)/a)/0.82)+e)-e)+b)*a)-pi)+b)+e)\"\n\"(((((((((1.27*((((((((((((a+(((a*2.13)*pi)-a))*pi)/b)/b)*1.70)+a)+0.00)+3.33)/b)-b)*2.44)*pi))-b)+3.87)/a)+b)*a)/e)+b)*e)\"\n\"(((1.1*x^2+2.2)*(1.1/y^3-2.2))-((1.1*x^2+2.2)-(1.1/y^3-2.2))-((1.1*x^2+2.2)+(1.1/y^3-2.2))*((1.1*x^2+2.2)-(1.1/y^3-2.2)))\"\n\"(((1.1*x^2+2.2)+(1.1/y^3-2.2))*((1.1*x^2+2.2)*(1.1/y^3-2.2))+((1.1*x^2+2.2)-(1.1/y^3-2.2))+((1.1*x^2+2.2)+(1.1/y^3-2.2)))\"\n\"(((1.1*x^2+2.2)-(1.1/y^3-2.2))+((1.1*x^2+2.2)*(1.1/y^3-2.2))*((1.1*x^2+2.2)*(1.1/y^3-2.2))-((1.1*x^2+2.2)+(1.1/y^3-2.2)))\"\n\"(((sin(((sin((a/((cos(tan((((tan((tan((((sin((tan(tan(pi))/pi))/b)*b)-pi))+b))+pi)-3.77)+b)))*e)-pi)))-a)+a))+b)+b)+0.05)\"\n\"(sin((sin(cos((tan((((cos(sin(cos((((((tan(((cos((sin(tan(b))+a))+a)*2.08))+a)+a)+e)/b)/e))))/pi)+pi)+pi))/e)))/e))/2.67)\"\n\"(((0.27/(((((((((((((((b*(((((((e+3.03)/pi)+b)+b)+a)+1.12)*a))+a)+a)*e)+b)-e)+e)+e)/a)*pi)-1.60)+e)+0.13)*pi)*e))/2.30)*b)\"\n\"((b+((((((a*((((a/((((((pi+((((((((2.79+a)-e)+a)+pi)/a)+b)+b)*pi))*b)+pi)-b)*0.99)+a))/a)+a)+3.72))-a)+b)+pi)*a)-1.77))-a)\"\n\"(a/((((sin((sin(cos((0.68-(((((((a/((a+(cos(cos((((((a/a)+e)+b)*e)-b)))-a))+a))+a)/pi)-a)*b)+3.04)-a))))/b))+b)+pi)*e)+a))\"\n\"(((e-((((((((((e*((((((((((0.23+a)+3.81)+pi)+pi)*a)-b)*1.79)*1.50)/1.59)*a))+2.39)-pi)+e)/b)+b)/1.94)+a)*2.44)*e))/1.85)*b)\"\n\"(0.68-((((((pi/cos(tan((tan(tan(tan(cos(cos((((sin(((pi*((e*e)+a))*e))/3.66)+a)*a))))))*0.03))))/pi)+1.29)*2.87)+1.88)+pi))\"\n\"((((b+((((((((((((((((((((((((b+e)-e)+b)+b)-pi)+e)-e)*a)*e)*pi)+pi)/1.85)-e)/0.35)-b)/a)+a)-b)+b)*e)/b)/pi)/e)*a))+b)*b)+pi)\"\n\"(((1.20-(((((tan((((a/sin((3.44*(tan(((((tan((b/(cos(pi)+e)))+b)+a)/2.57)+0.07))+3.43))))-1.59)/a))*a)-b)+e)*e)*b))/0.77)-b)\"\n\"(a*(((((((a*sin((((((((b/(((a+tan((b+tan(((((e/3.48)+e)-pi)/b)))))+a)-pi))+1.34)*a)+a)+0.36)+a)+b)))-pi)-0.40)-pi)-e)+a)*a))\"\n\"tan(((1.98/((b/cos((e+(((sin(cos((((((cos(tan((b+((((pi*3.71)+a)+pi)-1.17))))/b)/e)+a)+3.08)-e)))+a)+3.15)*b))))*0.70))/pi))\"\n\"((((((((((((((((((((((((pi/a)/b)+pi)*a)+0.68)+a)-0.14)-2.38)/1.45)/b)*1.52)+b)+b)*3.56)+3.40)-a)-0.29)+b)*b)-e)+a)/b)+pi)-pi)\"\n\"((((((x*y)*z)-w)/((x+y)+(z*w)))/(((x+y)-(z/w))-((x*y)+(z-w))))/((((x+y)+(z*w))*((x/y)+(z-w)))*(((x*y)+(z-w))+((x/y)*(z-w)))))\"\n\"((((((x*y)/z)-w)/((x-y)-(z*w)))/(((x-y)+(z/w))-((x+y)*(z*w))))/((((x-y)-(z*w))*((x+y)*(z/w)))*(((x+y)*(z*w))+(x-(y/(z*w))))))\"\n\"((((((x+y)*z)-w)-((x+y)-(z*w)))-((x*(y-(z*w)))/((x*y)+(z+w))))-((((x+y)-(z*w))+((x/y)+(z+w)))+(((x*y)+(z+w))*((x/y)/(z-w)))))\"\n\"((((((x+y)/z)-w)-((x-y)+(z*w)))-(((x+y)+(z/w))/((x*y)-(z-w))))-((((x-y)+(z*w))+((x/y)-(z-w)))+(((x*y)-(z-w))*(x-(y*(z/w))))))\"\n\"((((((x-y)*z)-w)*((x+y)-(z/w)))*(((x+y)-(z*w))+((x/y)+(z+w))))*((((x+y)-(z/w))-((x*y)+(z-w)))-(((x/y)+(z+w))/((x*y)*(z-w)))))\"\n\"((((((x-y)/z)-w)*((x-y)+(z/w)))*(((x-y)+(z*w))+((x/y)-(z-w))))*((((x-y)+(z/w))-((x+y)*(z*w)))-(((x/y)-(z-w))/(x+(y/(z*w))))))\"\n\"((((((x/y)*z)-w)+((x+y)+(z/w)))+(((x+y)+(z*w))*((x/y)+(z-w))))+((((x+y)+(z/w))/((x*y)-(z-w)))/(((x/y)+(z-w))-(x+(y*(z/w))))))\"\n\"((((((x/y)/z)-w)+((x-y)-(z/w)))+(((x-y)-(z*w))*((x+y)*(z/w))))+((((x-y)-(z/w))/((x+y)/(z*w)))/(((x+y)*(z/w))-(x+((y+z)/w)))))\"\n\"(((((3.123*y)*z)-(3.123/(y*z)))-((3.123/(y/z))-(3.123-(y/z))))-(((3.123*(y+z))*(3.123-(y*z)))*((3.123+(y*z))*((3.123+y)+z))))\"\n\"(((((3.123*y)+z)*((3.123/y)*z))*((3.123/(y+z))*(3.123*(y/z))))*(((3.123/(y-z))/(3.123-(y+z)))/((3.123-(y-z))/((3.123+y)/z))))\"\n\"(((((3.123*y)-z)/(3.123/(y+z)))/((3.123/(y-z))/(3.123-(y+z))))/(((3.123/(y*z))+(3.123-(y-z)))+((3.123-(y/z))+((3.123+y)*z))))\"\n\"(((((3.123*y)/z)+(3.123/(y-z)))+((3.123/(y*z))+(3.123-(y-z))))+(((3.123/(y/z))-(3.123-(y/z)))-((3.123-(y*z))-((3.123+y)-z))))\"\n\"(((((3.123+y)*z)-((3.123*y)/z))-(((3.123*y)*z)-(3.123/(y*z))))-((((3.123/y)+z)*(3.123/(y/z)))*((3.123*(y+z))*(3.123-(y*z)))))\"\n\"(((((3.123+y)+z)/((3.123/y)+z))/(((3.123/y)-z)/(3.123*(y+z))))/((((3.123/y)/z)+(3.123*(y-z)))+((3.123*(y*z))+(3.123+(y/z)))))\"\n\"(((((3.123+y)-z)*((3.123*y)*z))*(((3.123/y)+z)*(3.123/(y/z))))*((((3.123/y)-z)/(3.123*(y+z)))/((3.123*(y-z))/(3.123+(y*z)))))\"\n\"(((((3.123+y)/z)+((3.123*y)-z))+(((3.123*y)/z)+(3.123/(y-z))))+((((3.123*y)*z)-(3.123/(y*z)))-((3.123/(y/z))-(3.123-(y/z)))))\"\n\"(((((3.123-y)*z)-((3.123/y)/z))-(((3.123/y)*z)-(3.123*(y*z))))-(((3.123/(y+z))*(3.123*(y/z)))*((3.123-(y+z))*(3.123+(y-z)))))\"\n\"(((((3.123-y)/z)+((3.123/y)-z))+(((3.123/y)/z)+(3.123*(y-z))))+((((3.123/y)*z)-(3.123*(y*z)))-((3.123*(y/z))-(3.123+(y+z)))))\"\n\"(((((3.123/y)*z)-(3.123*(y*z)))-((3.123*(y/z))-(3.123+(y+z))))-(((3.123-(y+z))*(3.123+(y-z)))*(((3.123+y)/z)+((3.123*y)-z))))\"\n\"(((((3.123/y)+z)*(3.123/(y/z)))*((3.123*(y+z))*(3.123-(y*z))))*(((3.123*(y-z))/(3.123+(y*z)))/((3.123+(y/z))/((3.123-y)/z))))\"\n\"(((((3.123/y)-z)/(3.123*(y+z)))/((3.123*(y-z))/(3.123+(y*z))))/(((3.123*(y*z))+(3.123+(y/z)))+((3.123+(y+z))+((3.123-y)*z))))\"\n\"(((((3.123/y)/z)+(3.123*(y-z)))+((3.123*(y*z))+(3.123+(y/z))))+(((3.123*(y/z))-(3.123+(y+z)))-((3.123+(y-z))-((3.123*y)+z))))\"\n\"(((((x*5.123)*z)-(x/(5.123*z)))-((x/(5.123/z))-(x-(5.123/z))))-(((x*(5.123+z))*(x-(5.123*z)))*((x+(5.123*z))*((x+5.123)+z))))\"\n\"(((((x*5.123)+z)*((x/5.123)*z))*((x/(5.123+z))*(x*(5.123/z))))*(((x/(5.123-z))/(x-(5.123+z)))/((x-(5.123-z))/((x+5.123)/z))))\"\n\"(((((x*5.123)-z)/(x/(5.123+z)))/((x/(5.123-z))/(x-(5.123+z))))/(((x/(5.123*z))+(x-(5.123-z)))+((x-(5.123/z))+((x+5.123)*z))))\"\n\"(((((x*5.123)/z)+(x/(5.123-z)))+((x/(5.123*z))+(x-(5.123-z))))+(((x/(5.123/z))-(x-(5.123/z)))-((x-(5.123*z))-((x+5.123)-z))))\"\n\"(((((x*y)*(z+w))+(x+((y/z)/w)))+((x+((y/z)+w))*((x*y)+(z*w))))+(((x+((y/z)/w))/((x*y)-(z*w)))/(((x*y)+(z*w))-((x+y)-(z-w)))))\"\n\"(((((x*y)*(z-w))*(x-((y*z)/w)))*((x-((y-z)*w))+((x/y)-(z*w))))*(((x-((y*z)/w))-(x/(y+(z*w))))-(((x/y)-(z*w))/((x-y)*(z+w)))))\"\n\"(((((x*y)*7.123)-(x/(y*7.123)))-((x/(y/7.123))-(x-(y/7.123))))-(((x*(y+7.123))*(x-(y*7.123)))*((x+(y*7.123))*((x+y)+7.123))))\"\n\"(((((x*y)+(z*w))-((x+y)-(z-w)))-(((x-y)-(z/w))/((x+y)/(z*w))))-((((x+y)-(z-w))+((x+y)/(z/w)))+(((x+y)/(z*w))*(x+((y+z)*w)))))\"\n\"(((((x*y)+(z+w))*((x/y)/(z-w)))*(((x*y)/(z-w))+(x-((y-z)/w))))*((((x/y)/(z-w))-(x-((y-z)*w)))-((x-((y-z)/w))/((x/y)-(z/w)))))\"\n\"(((((x*y)+(z-w))+((x/y)*(z-w)))+(((x*y)*(z-w))*(x-((y*z)/w))))+((((x/y)*(z-w))/(x-((y*z)*w)))/((x-((y*z)/w))-(x/(y+(z*w))))))\"\n\"(((((x*y)+(z/w))/((x+y)*(z-w)))/(((x+y)+(z-w))-((x-y)/(z*w))))/((((x+y)*(z-w))*((x-y)/(z/w)))*(((x-y)/(z*w))+(x+((y-z)*w)))))\"\n\"(((((x*y)+7.123)*((x/y)*7.123))*((x/(y+7.123))*(x*(y/7.123))))*(((x/(y-7.123))/(x-(y+7.123)))/((x-(y-7.123))/((x+y)/7.123))))\"\n\"(((((x*y)-(z*w))*((x+y)+(z-w)))*(((x+y)-(z-w))+((x+y)/(z/w))))*((((x+y)+(z-w))-((x-y)/(z*w)))-(((x+y)/(z/w))/(x+((y-z)/w)))))\"\n\"(((((x*y)-(z+w))+((x/y)/(z+w)))+(((x*y)/(z+w))*(x-((y+z)/w))))+((((x/y)/(z+w))/(x-((y+z)*w)))/((x-((y+z)/w))-((x*y)-(z/w)))))\"\n\"(((((x*y)-(z-w))*(x-(y*(z/w))))*((x+(y*(z/w)))+(x-((y/z)/w))))*(((x-(y*(z/w)))-(x-((y/z)*w)))-((x-((y/z)/w))/(x*(y+(z*w))))))\"\n\"(((((x*y)-(z/w))+((x+y)/(z-w)))+(((x+y)*(z-w))*((x-y)/(z/w))))+((((x+y)/(z-w))/((x-y)*(z*w)))/(((x-y)/(z/w))-(x+((y*z)/w)))))\"\n\"(((((x*y)-7.123)/(x/(y+7.123)))/((x/(y-7.123))/(x-(y+7.123))))/(((x/(y*7.123))+(x-(y-7.123)))+((x-(y/7.123))+((x+y)*7.123))))\"\n\"(((((x*y)/(z+w))*(x-((y+z)/w)))*((x+((y/z)*w))+((x*y)+(z/w))))*(((x-((y+z)/w))-((x*y)-(z/w)))-(((x*y)+(z/w))/((x+y)*(z-w)))))\"\n\"(((((x*y)/(z-w))+(x-((y-z)/w)))+((x-((y+z)*w))*((x/y)+(z/w))))+(((x-((y-z)/w))/((x/y)-(z/w)))/(((x/y)+(z/w))-((x-y)-(z+w)))))\"\n\"(((((x*y)/7.123)+(x/(y-7.123)))+((x/(y*7.123))+(x-(y-7.123))))+(((x/(y/7.123))-(x-(y/7.123)))-((x-(y*7.123))-((x+y)-7.123))))\"\n\"(((((x+5.123)*z)-((x*5.123)/z))-(((x*5.123)*z)-(x/(5.123*z))))-((((x/5.123)+z)*(x/(5.123/z)))*((x*(5.123+z))*(x-(5.123*z)))))\"\n\"(((((x+5.123)+z)/((x/5.123)+z))/(((x/5.123)-z)/(x*(5.123+z))))/((((x/5.123)/z)+(x*(5.123-z)))+((x*(5.123*z))+(x+(5.123/z)))))\"\n\"(((((x+5.123)-z)*((x*5.123)*z))*(((x/5.123)+z)*(x/(5.123/z))))*((((x/5.123)-z)/(x*(5.123+z)))/((x*(5.123-z))/(x+(5.123*z)))))\"\n\"(((((x+5.123)/z)+((x*5.123)-z))+(((x*5.123)/z)+(x/(5.123-z))))+((((x*5.123)*z)-(x/(5.123*z)))-((x/(5.123/z))-(x-(5.123/z)))))\"\n\"(((((x+y)*(z*w))+(x-(y/(z*w))))+((x+(y/(z*w)))*(((x+y)*z)-w)))+(((x-(y/(z*w)))/(((x-y)*z)-w))/((((x+y)*z)-w)-((x+y)-(z*w)))))\"\n\"(((((x+y)*(z-w))*((x-y)/(z/w)))*(((x-y)/(z*w))+(x+((y-z)*w))))*((((x-y)/(z/w))-(x+((y*z)/w)))-((x+((y-z)*w))/(((x-y)/z)-w))))\"\n\"(((((x+y)*(z/w))-(x+((y+z)/w)))-((x-(y/(z*w)))/(((x-y)*z)-w)))-(((x+((y+z)/w))+(((x*y)*z)-w))+((((x-y)*z)-w)*((x+y)-(z/w)))))\"\n\"(((((x+y)*7.123)-((x*y)/7.123))-(((x*y)*7.123)-(x/(y*7.123))))-((((x/y)+7.123)*(x/(y/7.123)))*((x*(y+7.123))*(x-(y*7.123)))))\"\n\"(((((x+y)+(z*w))*((x/y)+(z-w)))*(((x*y)+(z-w))+((x/y)*(z-w))))*((((x/y)+(z-w))-(x+(y*(z/w))))-(((x/y)*(z-w))/(x-((y*z)*w)))))\"\n\"(((((x+y)+(z-w))-((x-y)/(z*w)))-(((x+y)/(z/w))/(x+((y-z)/w))))-((((x-y)/(z*w))+(x+((y-z)*w)))+((x+((y-z)/w))*(((x+y)/z)-w))))\"\n\"(((((x+y)+(z/w))/((x*y)-(z-w)))/(((x/y)+(z-w))-(x+(y*(z/w)))))/((((x*y)-(z-w))*(x-(y*(z/w))))*((x+(y*(z/w)))+(x-((y/z)/w)))))\"\n\"(((((x+y)+7.123)/((x/y)+7.123))/(((x/y)-7.123)/(x*(y+7.123))))/((((x/y)/7.123)+(x*(y-7.123)))+((x*(y*7.123))+(x+(y/7.123)))))\"\n\"(((((x+y)-(z*w))+((x/y)+(z+w)))+(((x*y)+(z+w))*((x/y)/(z-w))))+((((x/y)+(z+w))/((x*y)*(z-w)))/(((x/y)/(z-w))-(x-((y-z)*w)))))\"\n\"(((((x+y)-(z-w))+((x+y)/(z/w)))+(((x+y)/(z*w))*(x+((y+z)*w))))+((((x+y)/(z/w))/(x+((y-z)/w)))/((x+((y+z)*w))-(((x/y)*z)-w))))\"\n\"(((((x+y)-(z/w))-((x*y)+(z-w)))-(((x/y)+(z+w))/((x*y)*(z-w))))-((((x*y)+(z-w))+((x/y)*(z-w)))+(((x*y)*(z-w))*(x-((y*z)/w)))))\"\n\"(((((x+y)-7.123)*((x*y)*7.123))*(((x/y)+7.123)*(x/(y/7.123))))*((((x/y)-7.123)/(x*(y+7.123)))/((x*(y-7.123))/(x+(y*7.123)))))\"\n\"(((((x+y)/(z*w))*(x+((y+z)*w)))*((x+((y+z)/w))+(((x*y)*z)-w)))*(((x+((y+z)*w))-(((x/y)*z)-w))-((((x*y)*z)-w)/((x+y)+(z*w)))))\"\n\"(((((x+y)/(z-w))/((x-y)*(z*w)))/(((x-y)/(z/w))-(x+((y*z)/w))))/((((x-y)*(z*w))*(x+((y*z)*w)))*((x+((y*z)/w))+(((x*y)/z)-w))))\"\n\"(((((x+y)/(z/w))/(x+((y-z)/w)))/((x+((y+z)*w))-(((x/y)*z)-w)))/(((x+((y-z)/w))*(((x+y)/z)-w))*((((x/y)*z)-w)+((x+y)+(z/w)))))\"\n\"(((((x+y)/7.123)+((x*y)-7.123))+(((x*y)/7.123)+(x/(y-7.123))))+((((x*y)*7.123)-(x/(y*7.123)))-((x/(y/7.123))-(x-(y/7.123)))))\"\n\"(((((x-5.123)*z)-((x/5.123)/z))-(((x/5.123)*z)-(x*(5.123*z))))-(((x/(5.123+z))*(x*(5.123/z)))*((x-(5.123+z))*(x+(5.123-z)))))\"\n\"(((((x-5.123)/z)+((x/5.123)-z))+(((x/5.123)/z)+(x*(5.123-z))))+((((x/5.123)*z)-(x*(5.123*z)))-((x*(5.123/z))-(x+(5.123+z)))))\"\n\"(((((x-y)*(z*w))*(x+((y*z)*w)))*((x+((y*z)/w))+(((x*y)/z)-w)))*(((x+((y*z)*w))-(((x/y)/z)-w))-((((x*y)/z)-w)/((x-y)-(z*w)))))\"\n\"(((((x-y)*(z+w))*((x/y)*(z+w)))*(((x*y)*(z+w))+(x+((y/z)/w))))*((((x/y)*(z+w))-(x+((y/z)*w)))-((x+((y/z)/w))/((x*y)-(z*w)))))\"\n\"(((((x-y)*(z/w))/(x+((y/z)+w)))/((x+((y*z)*w))-(((x/y)/z)-w)))/(((x+((y/z)+w))*((x*y)+(z*w)))*((((x/y)/z)-w)+((x-y)-(z/w)))))\"\n\"(((((x-y)*7.123)-((x/y)/7.123))-(((x/y)*7.123)-(x*(y*7.123))))-(((x/(y+7.123))*(x*(y/7.123)))*((x-(y+7.123))*(x+(y-7.123)))))\"\n\"(((((x-y)+(z*w))+((x/y)-(z-w)))+(((x*y)-(z-w))*(x-(y*(z/w)))))+((((x/y)-(z-w))/(x+(y/(z*w))))/((x-(y*(z/w)))-(x-((y/z)*w)))))\"\n\"(((((x-y)+(z+w))-((x*y)*(z+w)))-(((x-y)*(z/w))/(x+((y/z)+w))))-((((x*y)*(z+w))+(x+((y/z)/w)))+((x+((y/z)+w))*((x*y)+(z*w)))))\"\n\"(((((x-y)+(z/w))-((x+y)*(z*w)))-(((x/y)-(z-w))/(x+(y/(z*w)))))-((((x+y)*(z*w))+(x-(y/(z*w))))+((x+(y/(z*w)))*(((x+y)*z)-w))))\"\n\"(((((x-y)-(z*w))*((x+y)*(z/w)))*(((x+y)*(z*w))+(x-(y/(z*w)))))*((((x+y)*(z/w))-(x+((y+z)/w)))-((x-(y/(z*w)))/(((x-y)*z)-w))))\"\n\"(((((x-y)-(z+w))+((x-y)*(z/w)))+(((x-y)*(z*w))*(x+((y*z)*w))))+((((x-y)*(z/w))/(x+((y/z)+w)))/((x+((y*z)*w))-(((x/y)/z)-w))))\"\n\"(((((x-y)-(z/w))/((x+y)/(z*w)))/(((x+y)*(z/w))-(x+((y+z)/w))))/((((x+y)/(z*w))*(x+((y+z)*w)))*((x+((y+z)/w))+(((x*y)*z)-w))))\"\n\"(((((x-y)/(z*w))+(x+((y-z)*w)))+((x+((y-z)/w))*(((x+y)/z)-w)))+(((x+((y-z)*w))/(((x-y)/z)-w))/((((x+y)/z)-w)-((x-y)+(z*w)))))\"\n\"(((((x-y)/(z+w))/((x*y)/(z+w)))/(((x/y)*(z+w))-(x+((y/z)*w))))/((((x*y)/(z+w))*(x-((y+z)/w)))*((x+((y/z)*w))+((x*y)+(z/w)))))\"\n\"(((((x-y)/(z/w))-(x+((y*z)/w)))-((x+((y-z)*w))/(((x-y)/z)-w)))-(((x+((y*z)/w))+(((x*y)/z)-w))+((((x-y)/z)-w)*((x-y)+(z/w)))))\"\n\"(((((x-y)/7.123)+((x/y)-7.123))+(((x/y)/7.123)+(x*(y-7.123))))+((((x/y)*7.123)-(x*(y*7.123)))-((x*(y/7.123))-(x+(y+7.123)))))\"\n\"(((((x/5.123)*z)-(x*(5.123*z)))-((x*(5.123/z))-(x+(5.123+z))))-(((x-(5.123+z))*(x+(5.123-z)))*(((x+5.123)/z)+((x*5.123)-z))))\"\n\"(((((x/5.123)+z)*(x/(5.123/z)))*((x*(5.123+z))*(x-(5.123*z))))*(((x*(5.123-z))/(x+(5.123*z)))/((x+(5.123/z))/((x-5.123)/z))))\"\n\"(((((x/5.123)-z)/(x*(5.123+z)))/((x*(5.123-z))/(x+(5.123*z))))/(((x*(5.123*z))+(x+(5.123/z)))+((x+(5.123+z))+((x-5.123)*z))))\"\n\"(((((x/5.123)/z)+(x*(5.123-z)))+((x*(5.123*z))+(x+(5.123/z))))+(((x*(5.123/z))-(x+(5.123+z)))-((x+(5.123-z))-((x*5.123)+z))))\"\n\"(((((x/y)*(z+w))-(x+((y/z)*w)))-((x+((y/z)/w))/((x*y)-(z*w))))-(((x+((y/z)*w))+((x*y)+(z/w)))+(((x*y)-(z*w))*((x+y)+(z-w)))))\"\n\"(((((x/y)*(z-w))/(x-((y*z)*w)))/((x-((y*z)/w))-(x/(y+(z*w)))))/(((x-((y*z)*w))*(x/(y-(z*w))))*((x/(y+(z*w)))+((x-y)/(z+w)))))\"\n\"(((((x/y)*7.123)-(x*(y*7.123)))-((x*(y/7.123))-(x+(y+7.123))))-(((x-(y+7.123))*(x+(y-7.123)))*(((x+y)/7.123)+((x*y)-7.123))))\"\n\"(((((x/y)+(z+w))/((x*y)*(z-w)))/(((x/y)/(z-w))-(x-((y-z)*w))))/((((x*y)*(z-w))*(x-((y*z)/w)))*((x-((y-z)*w))+((x/y)-(z*w)))))\"\n\"(((((x/y)+(z-w))-(x+(y*(z/w))))-(((x/y)*(z-w))/(x-((y*z)*w))))-(((x+(y*(z/w)))+(x-((y/z)/w)))+((x-((y*z)*w))*(x/(y-(z*w))))))\"\n\"(((((x/y)+(z/w))-((x-y)-(z+w)))-(((x+y)/(z-w))/((x-y)*(z*w))))-((((x-y)-(z+w))+((x-y)*(z/w)))+(((x-y)*(z*w))*(x+((y*z)*w)))))\"\n\"(((((x/y)+7.123)*(x/(y/7.123)))*((x*(y+7.123))*(x-(y*7.123))))*(((x*(y-7.123))/(x+(y*7.123)))/((x+(y/7.123))/((x-y)/7.123))))\"\n\"(((((x/y)-(z*w))/((x-y)*(z+w)))/(((x-y)+(z+w))-((x*y)*(z+w))))/((((x-y)*(z+w))*((x/y)*(z+w)))*(((x*y)*(z+w))+(x+((y/z)/w)))))\"\n\"(((((x/y)-(z+w))-((x*y)/(z-w)))-(((x/y)/(z+w))/(x-((y+z)*w))))-((((x*y)/(z-w))+(x-((y-z)/w)))+((x-((y+z)*w))*((x/y)+(z/w)))))\"\n\"(((((x/y)-(z-w))/(x+(y/(z*w))))/((x-(y*(z/w)))-(x-((y/z)*w))))/(((x+(y/(z*w)))*(((x+y)*z)-w))*((x-((y/z)*w))+(x*(y-(z*w))))))\"\n\"(((((x/y)-(z/w))*((x-y)+(z+w)))*(((x-y)-(z+w))+((x-y)*(z/w))))*((((x-y)+(z+w))-((x*y)*(z+w)))-(((x-y)*(z/w))/(x+((y/z)+w)))))\"\n\"(((((x/y)-7.123)/(x*(y+7.123)))/((x*(y-7.123))/(x+(y*7.123))))/(((x*(y*7.123))+(x+(y/7.123)))+((x+(y+7.123))+((x-y)*7.123))))\"\n\"(((((x/y)/(z+w))/(x-((y+z)*w)))/((x-((y+z)/w))-((x*y)-(z/w))))/(((x-((y+z)*w))*((x/y)+(z/w)))*(((x*y)-(z/w))+((x+y)/(z-w)))))\"\n\"(((((x/y)/(z-w))-(x-((y-z)*w)))-((x-((y-z)/w))/((x/y)-(z/w))))-(((x-((y-z)*w))+((x/y)-(z*w)))+(((x/y)-(z/w))*((x-y)+(z+w)))))\"\n\"(((((x/y)/7.123)+(x*(y-7.123)))+((x*(y*7.123))+(x+(y/7.123))))+(((x*(y/7.123))-(x+(y+7.123)))-((x+(y-7.123))-((x*y)+7.123))))\"\n\"((((3.123*(y*z))+(3.123+(y/z)))+((3.123+(y+z))+((3.123-y)*z)))+(((3.123+(y-z))-((3.123*y)+z))-(((3.123*y)-z)/(3.123/(y+z)))))\"\n\"((((3.123*(y+z))*(3.123-(y*z)))*((3.123+(y*z))*((3.123+y)+z)))*(((3.123+(y/z))/((3.123-y)/z))/(((3.123-y)*z)-((3.123/y)/z))))\"\n\"((((3.123*(y-z))/(3.123+(y*z)))/((3.123+(y/z))/((3.123-y)/z)))/(((3.123+(y+z))+((3.123-y)*z))+(((3.123*y)+z)*((3.123/y)*z))))\"\n\"((((3.123*(y/z))-(3.123+(y+z)))-((3.123+(y-z))-((3.123*y)+z)))-((((3.123+y)/z)+((3.123*y)-z))+(((3.123*y)/z)+(3.123/(y-z)))))\"\n\"((((3.123+(y*z))*((3.123+y)+z))*(((3.123-y)/z)+((3.123/y)-z)))*((((3.123-y)*z)-((3.123/y)/z))-(((3.123/y)*z)-(3.123*(y*z)))))\"\n\"((((3.123+(y+z))+((3.123-y)*z))+(((3.123*y)+z)*((3.123/y)*z)))+((((3.123*y)-z)/(3.123/(y+z)))/((3.123/(y-z))/(3.123-(y+z)))))\"\n\"((((3.123+(y-z))-((3.123*y)+z))-(((3.123*y)-z)/(3.123/(y+z))))-((((3.123*y)/z)+(3.123/(y-z)))+((3.123/(y*z))+(3.123-(y-z)))))\"\n\"((((3.123+(y/z))/((3.123-y)/z))/(((3.123-y)*z)-((3.123/y)/z)))/((((3.123*y)+z)*((3.123/y)*z))*((3.123/(y+z))*(3.123*(y/z)))))\"\n\"((((3.123-(y*z))-((3.123+y)-z))-(((3.123+y)+z)/((3.123/y)+z)))-((((3.123-y)/z)+((3.123/y)-z))+(((3.123/y)/z)+(3.123*(y-z)))))\"\n\"((((3.123-(y+z))*(3.123+(y-z)))*(((3.123+y)/z)+((3.123*y)-z)))*((((3.123+y)*z)-((3.123*y)/z))-(((3.123*y)*z)-(3.123/(y*z)))))\"\n\"((((3.123-(y-z))/((3.123+y)/z))/(((3.123+y)*z)-((3.123*y)/z)))/((((3.123+y)-z)*((3.123*y)*z))*(((3.123/y)+z)*(3.123/(y/z)))))\"\n\"((((3.123-(y/z))+((3.123+y)*z))+(((3.123+y)-z)*((3.123*y)*z)))+((((3.123+y)+z)/((3.123/y)+z))/(((3.123/y)-z)/(3.123*(y+z)))))\"\n\"((((3.123/(y*z))+(3.123-(y-z)))+((3.123-(y/z))+((3.123+y)*z)))+(((3.123-(y*z))-((3.123+y)-z))-(((3.123+y)+z)/((3.123/y)+z))))\"\n\"((((3.123/(y+z))*(3.123*(y/z)))*((3.123-(y+z))*(3.123+(y-z))))*(((3.123-(y-z))/((3.123+y)/z))/(((3.123+y)*z)-((3.123*y)/z))))\"\n\"((((3.123/(y-z))/(3.123-(y+z)))/((3.123-(y-z))/((3.123+y)/z)))/(((3.123-(y/z))+((3.123+y)*z))+(((3.123+y)-z)*((3.123*y)*z))))\"\n\"((((3.123/(y/z))-(3.123-(y/z)))-((3.123-(y*z))-((3.123+y)-z)))-(((3.123+(y*z))*((3.123+y)+z))*(((3.123-y)/z)+((3.123/y)-z))))\"\n\"((((x*(5.123*z))+(x+(5.123/z)))+((x+(5.123+z))+((x-5.123)*z)))+(((x+(5.123-z))-((x*5.123)+z))-(((x*5.123)-z)/(x/(5.123+z)))))\"\n\"((((x*(5.123+z))*(x-(5.123*z)))*((x+(5.123*z))*((x+5.123)+z)))*(((x+(5.123/z))/((x-5.123)/z))/(((x-5.123)*z)-((x/5.123)/z))))\"\n\"((((x*(5.123-z))/(x+(5.123*z)))/((x+(5.123/z))/((x-5.123)/z)))/(((x+(5.123+z))+((x-5.123)*z))+(((x*5.123)+z)*((x/5.123)*z))))\"\n\"((((x*(5.123/z))-(x+(5.123+z)))-((x+(5.123-z))-((x*5.123)+z)))-((((x+5.123)/z)+((x*5.123)-z))+(((x*5.123)/z)+(x/(5.123-z)))))\"\n\"((((x*(y*7.123))+(x+(y/7.123)))+((x+(y+7.123))+((x-y)*7.123)))+(((x+(y-7.123))-((x*y)+7.123))-(((x*y)-7.123)/(x/(y+7.123)))))\"\n\"((((x*(y+(z*w)))*((x/y)-(z+w)))*(((x*y)-(z+w))+((x/y)/(z+w))))*((((x/y)-(z+w))-((x*y)/(z-w)))-(((x/y)/(z+w))/(x-((y+z)*w)))))\"\n\"((((x*(y+7.123))*(x-(y*7.123)))*((x+(y*7.123))*((x+y)+7.123)))*(((x+(y/7.123))/((x-y)/7.123))/(((x-y)*7.123)-((x/y)/7.123))))\"\n\"((((x*(y-(z*w)))/((x*y)+(z+w)))/(((x/y)-(z+w))-((x*y)/(z-w))))/((((x*y)+(z+w))*((x/y)/(z-w)))*(((x*y)/(z-w))+(x-((y-z)/w)))))\"\n\"((((x*(y-7.123))/(x+(y*7.123)))/((x+(y/7.123))/((x-y)/7.123)))/(((x+(y+7.123))+((x-y)*7.123))+(((x*y)+7.123)*((x/y)*7.123))))\"\n\"((((x*(y/7.123))-(x+(y+7.123)))-((x+(y-7.123))-((x*y)+7.123)))-((((x+y)/7.123)+((x*y)-7.123))+(((x*y)/7.123)+(x/(y-7.123)))))\"\n\"((((x+((y*z)*w))-(((x/y)/z)-w))-((((x*y)/z)-w)/((x-y)-(z*w))))-(((((x/y)/z)-w)+((x-y)-(z/w)))+(((x-y)-(z*w))*((x+y)*(z/w)))))\"\n\"((((x+((y*z)/w))+(((x*y)/z)-w))+((((x-y)/z)-w)*((x-y)+(z/w))))+(((((x*y)/z)-w)/((x-y)-(z*w)))/(((x-y)+(z/w))-((x+y)*(z*w)))))\"\n\"((((x+((y+z)*w))-(((x/y)*z)-w))-((((x*y)*z)-w)/((x+y)+(z*w))))-(((((x/y)*z)-w)+((x+y)+(z/w)))+(((x+y)+(z*w))*((x/y)+(z-w)))))\"\n\"((((x+((y+z)/w))+(((x*y)*z)-w))+((((x-y)*z)-w)*((x+y)-(z/w))))+(((((x*y)*z)-w)/((x+y)+(z*w)))/(((x+y)-(z/w))-((x*y)+(z-w)))))\"\n\"((((x+((y-z)*w))/(((x-y)/z)-w))/((((x+y)/z)-w)-((x-y)+(z*w))))/(((((x-y)/z)-w)*((x-y)+(z/w)))*(((x-y)+(z*w))+((x/y)-(z-w)))))\"\n\"((((x+((y-z)/w))*(((x+y)/z)-w))*((((x/y)*z)-w)+((x+y)+(z/w))))*(((((x+y)/z)-w)-((x-y)+(z*w)))-(((x+y)+(z/w))/((x*y)-(z-w)))))\"\n\"((((x+((y/z)*w))+((x*y)+(z/w)))+(((x*y)-(z*w))*((x+y)+(z-w))))+((((x*y)+(z/w))/((x+y)*(z-w)))/(((x+y)+(z-w))-((x-y)/(z*w)))))\"\n\"((((x+((y/z)+w))*((x*y)+(z*w)))*((((x/y)/z)-w)+((x-y)-(z/w))))*((((x*y)+(z*w))-((x+y)-(z-w)))-(((x-y)-(z/w))/((x+y)/(z*w)))))\"\n\"((((x+((y/z)/w))/((x*y)-(z*w)))/(((x*y)+(z*w))-((x+y)-(z-w))))/((((x*y)-(z*w))*((x+y)+(z-w)))*(((x+y)-(z-w))+((x+y)/(z/w)))))\"\n\"((((x+(5.123*z))*((x+5.123)+z))*(((x-5.123)/z)+((x/5.123)-z)))*((((x-5.123)*z)-((x/5.123)/z))-(((x/5.123)*z)-(x*(5.123*z)))))\"\n\"((((x+(5.123+z))+((x-5.123)*z))+(((x*5.123)+z)*((x/5.123)*z)))+((((x*5.123)-z)/(x/(5.123+z)))/((x/(5.123-z))/(x-(5.123+z)))))\"\n\"((((x+(5.123-z))-((x*5.123)+z))-(((x*5.123)-z)/(x/(5.123+z))))-((((x*5.123)/z)+(x/(5.123-z)))+((x/(5.123*z))+(x-(5.123-z)))))\"\n\"((((x+(5.123/z))/((x-5.123)/z))/(((x-5.123)*z)-((x/5.123)/z)))/((((x*5.123)+z)*((x/5.123)*z))*((x/(5.123+z))*(x*(5.123/z)))))\"\n\"((((x+(y*(z/w)))+(x-((y/z)/w)))+((x-((y*z)*w))*(x/(y-(z*w)))))+(((x-((y/z)/w))/(x*(y+(z*w))))/((x/(y-(z*w)))-((x*y)-(z+w)))))\"\n\"((((x+(y*7.123))*((x+y)+7.123))*(((x-y)/7.123)+((x/y)-7.123)))*((((x-y)*7.123)-((x/y)/7.123))-(((x/y)*7.123)-(x*(y*7.123)))))\"\n\"((((x+(y+7.123))+((x-y)*7.123))+(((x*y)+7.123)*((x/y)*7.123)))+((((x*y)-7.123)/(x/(y+7.123)))/((x/(y-7.123))/(x-(y+7.123)))))\"\n\"((((x+(y-7.123))-((x*y)+7.123))-(((x*y)-7.123)/(x/(y+7.123))))-((((x*y)/7.123)+(x/(y-7.123)))+((x/(y*7.123))+(x-(y-7.123)))))\"\n\"((((x+(y/(z*w)))*(((x+y)*z)-w))*((x-((y/z)*w))+(x*(y-(z*w)))))*(((((x+y)*z)-w)-((x+y)-(z*w)))-((x*(y-(z*w)))/((x*y)+(z+w)))))\"\n\"((((x+(y/7.123))/((x-y)/7.123))/(((x-y)*7.123)-((x/y)/7.123)))/((((x*y)+7.123)*((x/y)*7.123))*((x/(y+7.123))*(x*(y/7.123)))))\"\n\"((((x-((y*z)*w))*(x/(y-(z*w))))*((x/(y+(z*w)))+((x-y)/(z+w))))*(((x/(y-(z*w)))-((x*y)-(z+w)))-(((x-y)/(z+w))/((x*y)/(z+w)))))\"\n\"((((x-((y*z)/w))-(x/(y+(z*w))))-(((x/y)-(z*w))/((x-y)*(z+w))))-(((x/(y+(z*w)))+((x-y)/(z+w)))+(((x-y)*(z+w))*((x/y)*(z+w)))))\"\n\"((((x-((y+z)*w))*((x/y)+(z/w)))*(((x*y)-(z/w))+((x+y)/(z-w))))*((((x/y)+(z/w))-((x-y)-(z+w)))-(((x+y)/(z-w))/((x-y)*(z*w)))))\"\n\"((((x-((y+z)/w))-((x*y)-(z/w)))-(((x*y)+(z/w))/((x+y)*(z-w))))-((((x*y)-(z/w))+((x+y)/(z-w)))+(((x+y)*(z-w))*((x-y)/(z/w)))))\"\n\"((((x-((y-z)*w))+((x/y)-(z*w)))+(((x/y)-(z/w))*((x-y)+(z+w))))+((((x/y)-(z*w))/((x-y)*(z+w)))/(((x-y)+(z+w))-((x*y)*(z+w)))))\"\n\"((((x-((y-z)/w))/((x/y)-(z/w)))/(((x/y)+(z/w))-((x-y)-(z+w))))/((((x/y)-(z/w))*((x-y)+(z+w)))*(((x-y)-(z+w))+((x-y)*(z/w)))))\"\n\"((((x-((y/z)*w))+(x*(y-(z*w))))+((x*(y+(z*w)))*((x/y)-(z+w))))+(((x*(y-(z*w)))/((x*y)+(z+w)))/(((x/y)-(z+w))-((x*y)/(z-w)))))\"\n\"((((x-((y/z)/w))/(x*(y+(z*w))))/((x/(y-(z*w)))-((x*y)-(z+w))))/(((x*(y+(z*w)))*((x/y)-(z+w)))*(((x*y)-(z+w))+((x/y)/(z+w)))))\"\n\"((((x-(5.123*z))-((x+5.123)-z))-(((x+5.123)+z)/((x/5.123)+z)))-((((x-5.123)/z)+((x/5.123)-z))+(((x/5.123)/z)+(x*(5.123-z)))))\"\n\"((((x-(5.123+z))*(x+(5.123-z)))*(((x+5.123)/z)+((x*5.123)-z)))*((((x+5.123)*z)-((x*5.123)/z))-(((x*5.123)*z)-(x/(5.123*z)))))\"\n\"((((x-(5.123-z))/((x+5.123)/z))/(((x+5.123)*z)-((x*5.123)/z)))/((((x+5.123)-z)*((x*5.123)*z))*(((x/5.123)+z)*(x/(5.123/z)))))\"\n\"((((x-(5.123/z))+((x+5.123)*z))+(((x+5.123)-z)*((x*5.123)*z)))+((((x+5.123)+z)/((x/5.123)+z))/(((x/5.123)-z)/(x*(5.123+z)))))\"\n\"((((x-(y*(z/w)))-(x-((y/z)*w)))-((x-((y/z)/w))/(x*(y+(z*w)))))-(((x-((y/z)*w))+(x*(y-(z*w))))+((x*(y+(z*w)))*((x/y)-(z+w)))))\"\n\"((((x-(y*7.123))-((x+y)-7.123))-(((x+y)+7.123)/((x/y)+7.123)))-((((x-y)/7.123)+((x/y)-7.123))+(((x/y)/7.123)+(x*(y-7.123)))))\"\n\"((((x-(y+7.123))*(x+(y-7.123)))*(((x+y)/7.123)+((x*y)-7.123)))*((((x+y)*7.123)-((x*y)/7.123))-(((x*y)*7.123)-(x/(y*7.123)))))\"\n\"((((x-(y-7.123))/((x+y)/7.123))/(((x+y)*7.123)-((x*y)/7.123)))/((((x+y)-7.123)*((x*y)*7.123))*(((x/y)+7.123)*(x/(y/7.123)))))\"\n\"((((x-(y/(z*w)))/(((x-y)*z)-w))/((((x+y)*z)-w)-((x+y)-(z*w))))/(((((x-y)*z)-w)*((x+y)-(z/w)))*(((x+y)-(z*w))+((x/y)+(z+w)))))\"\n\"((((x-(y/7.123))+((x+y)*7.123))+(((x+y)-7.123)*((x*y)*7.123)))+((((x+y)+7.123)/((x/y)+7.123))/(((x/y)-7.123)/(x*(y+7.123)))))\"\n\"((((x/(5.123*z))+(x-(5.123-z)))+((x-(5.123/z))+((x+5.123)*z)))+(((x-(5.123*z))-((x+5.123)-z))-(((x+5.123)+z)/((x/5.123)+z))))\"\n\"((((x/(5.123+z))*(x*(5.123/z)))*((x-(5.123+z))*(x+(5.123-z))))*(((x-(5.123-z))/((x+5.123)/z))/(((x+5.123)*z)-((x*5.123)/z))))\"\n\"((((x/(5.123-z))/(x-(5.123+z)))/((x-(5.123-z))/((x+5.123)/z)))/(((x-(5.123/z))+((x+5.123)*z))+(((x+5.123)-z)*((x*5.123)*z))))\"\n\"((((x/(5.123/z))-(x-(5.123/z)))-((x-(5.123*z))-((x+5.123)-z)))-(((x+(5.123*z))*((x+5.123)+z))*(((x-5.123)/z)+((x/5.123)-z))))\"\n\"((((x/(y*7.123))+(x-(y-7.123)))+((x-(y/7.123))+((x+y)*7.123)))+(((x-(y*7.123))-((x+y)-7.123))-(((x+y)+7.123)/((x/y)+7.123))))\"\n\"((((x/(y+(z*w)))+((x-y)/(z+w)))+(((x-y)*(z+w))*((x/y)*(z+w))))+((((x-y)/(z+w))/((x*y)/(z+w)))/(((x/y)*(z+w))-(x+((y/z)*w)))))\"\n\"((((x/(y+7.123))*(x*(y/7.123)))*((x-(y+7.123))*(x+(y-7.123))))*(((x-(y-7.123))/((x+y)/7.123))/(((x+y)*7.123)-((x*y)/7.123))))\"\n\"((((x/(y-(z*w)))-((x*y)-(z+w)))-(((x-y)/(z+w))/((x*y)/(z+w))))-((((x*y)-(z+w))+((x/y)/(z+w)))+(((x*y)/(z+w))*(x-((y+z)/w)))))\"\n\"((((x/(y-7.123))/(x-(y+7.123)))/((x-(y-7.123))/((x+y)/7.123)))/(((x-(y/7.123))+((x+y)*7.123))+(((x+y)-7.123)*((x*y)*7.123))))\"\n\"((((x/(y/7.123))-(x-(y/7.123)))-((x-(y*7.123))-((x+y)-7.123)))-(((x+(y*7.123))*((x+y)+7.123))*(((x-y)/7.123)+((x/y)-7.123))))\"\n\"((0.43*((((((((((((((((((((sin((a+a))-pi)/0.93)-pi)/2.65)+2.40)+pi)/b)+3.69)-b)+a)*a)*e)*2.99)+b)-0.38)+b)+a)-a)*a)-1.03))-b)\"\n\"((sin((b/((((cos(sin(((cos(tan(((((sin(cos((tan(((((a*e)+e)-1.16)*2.81))-a)))+a)+a)+b)+b)))-0.65)+0.86)))-a)+b)+b)*a)))*a)*e)\"\n\"((((a+(((((((((((((((((((2.46/a)+b)-a)*a)/3.46)+1.50)*2.67)*b)*0.61)*a)/a)*1.43)+a)*b)*e)*0.03)+1.91)+e)*0.57))-a)+3.13)-0.89)\"\n\"((a+(((((b+(a*((((((a/((((((((((((a-1.63)/3.60)-pi)+e)-pi)-a)+pi)-2.13)-a)+e)/a)*pi))-pi)+b)/3.14)+pi)-a)))*b)-a)+b)+0.22))+b)\"\n\"((cos(tan((((sin((b+cos((((((((((b+(((cos(tan((cos(sin((1.07*a)))-a)))+e)+e)/a))+e)/pi)+b)-b)+a)+a)*a)-b))))*b)+e)/e)))*pi)/e)\"\n\"(((((((((((((2.69/(((((((e*(((3.79/a)/pi)+b))+e)+0.54)/2.70)+1.45)-pi)+pi))+2.74)+pi)/b)/pi)+b)-b)+0.15)*pi)+2.75)/a)+3.11)/pi)\"\n\"(((((1.99-((((((((((b+((((((a-(((((2.33-pi)/b)+2.46)+b)-b))/pi)-b)*pi)/b)*pi))+0.42)/a)+e)/a)*pi)/a)+0.06)-b)*a))/pi)-pi)+e)-b)\"\n\"((2.72/((((e+(((((((((((((((((((((((2.18*pi)*a)*b)*a)-b)-a)-e)/b)+a)+pi)-e)-pi)+a)+b)/e)-b)+b)*e)+a)/e)-a)-b)-a))+b)/b)+pi))-a)\"\n\"((e+(((((((((pi+((((((((3.51+((((1.30-(0.35+2.88))/pi)+b)/e))*e)-2.31)/1.96)-0.04)*3.50)+b)/e))/a)+pi)-e)+a)*b)+a)-b)/e))*3.82)\"\n\"(cos(tan(cos((((((cos(sin(cos((a+cos((((((((((tan(((a+3.21)/a))/b)*e)+b)-b)*pi)*e)/0.12)+b)-a))))))/b)-0.27)-a)*pi)*a))))-3.85)\"\n\"(e*tan(sin((((b*((b/((((tan((e/((sin(tan(sin((((tan((b+sin(cos(a))))*a)/3.09)+b))))/1.03)*e)))-b)*pi)+b)*3.80))/a))+b)*3.81))))\"\n\"x+y+z/w+x+y+z*w+x+y-z/w-x+y-z*w+x+y*z/w*x+y*z*w-x+y/z+w+x+y/z/w+x+y/z*w-x-y+z/w*x-y+z*w*x-y-z/w-x-y-z*w+x-y*z/w+x-y*z*w-x-y/z/w\"\n\"x-y-z+w+x-y-z+w+x-y+z+w-x-y+z+w+x*y-z+w*x/y-z+w-x*y+z+w+x/y+z+w+x*y+z-w-x/y+z-w*x*y-z-w*x/y-z-w-x+y*z*w+x+y*z/w+x+y/z*w-x+y/z/w\"\n\"x-y/z*w*x+y*z-w-x-y*z-w+x*y*z-w*x/y*z-w-x+y/z-w*x-y/z-w*x*y/z-w-x/y/z-w+x*y+z*w+x*y-z*w-x*y+z/w+x*y-z/w*x/y+z/w-x/y-z/w+x/y-z*w\"\n\"x/y+z*w-x/y-z*w*x*y+z*w*x*y-z*w-x+y-z*w+x+y-z/w+x+y+z*w-x+y+z/w*x-y+z*w*x-y+z/w-x-y-z*w+x-y-z/w*x+y-z-w-x+y-z-w*x+y+z-w*x+y+z-w\"\n\"(((((((((((((((((((((((((b+e)+pi)-e)-b)*1.94)*b)+3.48)+b)+a)*pi)*a)/2.09)-a)-2.93)-b)-pi)-a)-3.49)/1.72)+pi)*0.76)-e)/pi)+a)+pi)\"\n\"(((((b+((((((((((((((2.12+(((((((pi+1.34)*a)+a)+0.36)+a)+b)-pi))-0.40)-pi)-e)+a)*a)*e)+1.74)+a)*pi)/b)+b)/a)+a))/e)*1.23)-pi)+a)\"\n\"((((sin((tan((tan(tan(tan((((((((tan((b+(((sin((b/((1.60*a)+b)))/e)*1.56)*a)))+1.64)/a)*b)-3.35)*pi)/a)/a))))+a))+b))+a)+b)/a)-b)\"\n\"((b+(((((((a-((((((((((((((1.13+((b*b)-b))-a)-e)*b)-1.52)*b)+pi)+e)*3.56)/1.80)+0.13)-1.36)/2.64)-b))/b)+0.95)+pi)/a)+1.29)/e))+a)\"\n\"cos((a-(sin((((pi-tan((tan((sin((((cos((((((((sin(cos((((b/b)*b)-b)))+b)-a)+b)-a)*e)/e)+e))+2.59)-pi)+pi))-e))+a)))/1.07)*e))*e)))\"\n\"((((((((((((((((((((((((((b/0.86)/b)+b)-b)+3.31)/3.15)+e)+b)*a)+b)/pi)-pi)/pi)*a)+b)/pi)/2.17)/2.58)+pi)+a)+3.44)-b)-a)/e)+b)+3.71)\"\n\"(((((((((((((((((((((((((a+(2.03/pi))*b)+b)*3.69)*a)-b)+a)+a)+a)/e)-a)-0.23)+a)+b)/a)+1.45)*0.86)*0.94)+e)+0.22)/3.49)+b)/pi)+b)/b)\"\n\"(((((((3.80/((((((a+(((((1.59/(((b*((((a-a)*pi)+a)*pi))/1.13)+0.65))*a)+2.86)*e)+b))+e)-a)*pi)/a)+0.85))+2.45)+a)+b)+3.26)/b)/3.78)\"\n\"((3.74*((b*(tan(sin((2.75-(((((((sin((((((tan((cos(((e*e)-pi))/pi))*2.93)-a)-e)+a)-a))*a)/0.96)/2.54)+e)*b)-e)/b))))+3.57))-pi))*a)\"\n\"((sin(((tan((((((tan(cos((pi*((tan(((3.80/((((((a+0.40)+a)-2.93)+1.03)/pi)/a))/a))-a)*pi))))+a)*pi)/1.13)+0.65)*a))+2.86)*e))+b)+e)\"\n\"cos((((((1.25/(a+(sin((((tan((((0.97+((((sin((cos(((pi*b)-a))+pi))/b)-a)+pi)*0.60))*1.41)/3.44))*a)+b)+pi))/2.85)))+2.45)+a)+a)+a))\"\n\"tan(sin(cos((tan(((tan((a+(((sin(((tan(((((((((b+(sin(a)-pi))+0.73)/a)*3.23)+a)+b)-e)*pi))+a)+pi))+b)+2.20)/1.13)))+b)*0.53))+e))))\"\n\"(cos(sin(((tan(((b/((((sin((tan(sin(cos((sin(cos((((tan((((b-pi)/2.60)+b))+b)+b)+0.04)))+e))))+b))+a)/3.36)-a)+a))*b))*0.10)*b)))+a)\"\n\"tan((cos(((b+cos(((((sin(((pi-cos(sin((tan((cos((((e*((cos(((cos(pi)+pi)/b))+e)+e))-e)-b))+a))*b))))-e))+0.08)*a)-0.05)+a)))/a))-a))\"\n\"((((((((((((((((((((((a+((((pi-b)+pi)-pi)+b))+a)+b)+0.98)+2.37)/a)-b)+a)*e)-1.17)*1.43)+1.80)/b)+a)+a)+b)+0.94)*pi)+e)+e)+1.64)-2.45)\"\n\"((((((((3.09+(((3.33+(((((((((((((((((e*a)/b)*a)-pi)-e)+a)+a)+b)-a)/pi)-1.40)*2.07)+a)*a)/b)+0.72)+a))*b)-b))+a)/a)+e)/a)*0.56)/a)-b)\"\n\"(((((a*(((((((((((((pi-(((((((((b+a)-2.28)*a)*e)/e)-pi)+b)+1.65)+a))/1.22)/b)+a)/b)+b)*e)*a)/3.43)+a)+2.97)+b)+1.24))/pi)/2.21)*b)/a)\"\n\"((e+cos((((((a/tan((cos(tan(((pi*((2.39+(e/tan(((((a+(((cos(sin((a+b)))+pi)-e)*b))+e)+a)*e))))/2.78))*b)))/pi)))+pi)+e)/e)+0.80)))/b)\"\n\"cos(((pi+((a-tan(((b/(((2.38-((sin((a*(b+tan((e+((sin(cos((((tan(((b+e)/b))/a)+pi)+2.90)))*b)+1.85))))))-e)+b))+e)+a))/e)))/pi))+pi))\"\n\"sin(sin((((((a+(3.45-((((((cos((tan((((sin(tan(((((0.75+a)/e)+e)+b)))+a)*b)+0.89))-b))+a)+a)-pi)/1.44)+e)+1.82)))+e)-1.77)-a)*3.33)))\"\n\"(((((((((((((((a+((b/(((e/((((((((b+pi)/3.15)*pi)/a)+e)+2.71)+a)/b))*b)/b))+pi))+0.18)/a)+a)+a)+b)*b)-3.96)-0.14)+b)*3.50)-b)+a)/e)*b)\"\n\"(((0.44+(((tan((((b+(cos(((((sin(((((tan((cos((1.59*1.71))+b))+b)-0.34)+b)-2.95))*e)-a)*3.89)-1.07))+pi))*a)+2.54))*b)*0.50)*b))*b)/a)\"\n\"((tan(((tan(tan((cos(sin((tan(((((tan(sin((((((0.91+(cos((2.72+1.16))*b))+pi)+a)+2.90)*b)))/a)+b)/b)*e))*2.08)))-e)))*3.02)+pi))/a)-a)\"\n\"(e-tan((((((((((((((((sin((a-(((2.21+(cos((((a/pi)-e)-pi))-3.45))+b)+b)))/e)/b)/1.89)/pi)+b)*pi)/a)-e)+0.27)/b)+2.31)+2.81)+e)+b)*a)))\"\n\"(sin(((cos((((((cos(((((0.54/sin((((tan((((((((a+a)-b)+b)+pi)+b)-pi)/b))+b)*b)+3.07)))-1.27)-0.49)-2.23))/a)+b)+a)+b)*b))/1.63)-a))/b)\"\n\"((((((((((((((((a-(((((((b-(((pi-((3.41-b)-pi))/b)*pi))/1.06)/a)-a)*1.15)*a)/pi))+b)+b)*pi)-a)-3.92)+b)+b)/b)*a)+3.07)+a)-b)-pi)/pi)*b)\"\n\"(((a+(((((a+((((((((((((((((((1.84-(3.61/b))-a)-b)+0.84)-a)+a)*a)-b)/e)-2.63)*a)*pi)*0.70)+a)/a)/a)+e)+a))-pi)-2.55)-a)-0.55))+0.05)/b)\"\n\"(pi*((((((((((((((((((((((((((1.96+1.54)+1.47)+a)*a)-b)+1.70)+3.28)+b)+b)-b)/b)/b)-0.26)-pi)+pi)/e)+a)/3.48)+pi)-b)-pi)-b)+a)+a)/e)*b))\"\n\"((((((((((0.75+(((3.86+((a/(((((e*((((a-((e/b)+b))/pi)+a)/3.71))*1.10)+0.38)-e)+a))-2.56))+0.78)*a))-b)-a)+b)+1.98)/b)+2.69)+b)+e)-1.90)\"\n\"(pi+(a+(tan((sin((((sin((cos(((a+((((((tan(sin(((sin(((a-cos(tan(a)))-e))/b)/b)))/a)+a)-a)/e)-pi)/e))-b))+a))*1.23)*3.86)+pi))+b))+pi)))\"\n\"((sin((0.45-(cos((((cos(((((cos((((tan(((0.27*((cos(((b+(b/a))*b))+e)-a))+a))-a)+1.36)/2.15))*a)*0.62)+pi)+b))/e)*b)/2.76))+3.55)))/a)+a)\"\n\"(1.95/(((b-(sin((((((cos((e/((0.35+(tan((sin((b-sin(((sin(((tan(3.04)/pi)+a))-pi)/pi))))*0.10))+a))/0.97)))+a)+pi)-e)+b)/e))+a))+pi)+pi))\"\n\"sin((tan((a*(((((((b/((sin((b-((cos((sin((((sin((((((b/pi)+b)/b)+b)+a))+pi)/pi)+a))/b))/pi)+1.24)))+0.12)*b))+a)+0.27)+pi)*a)+b)+b)))/a))\"\n\"(((((((((1.57/((((((((((((((pi/((3.22*((b+b)*a))*b))+pi)+pi)*3.95)+b)-b)/b)+e)+a)+a)+b)-3.33)/b)+a))*b)/pi)+e)+1.46)/0.09)*2.78)/pi)/3.85)\"\n\"((((b-(((((1.88+(((e-(2.19*(((((((pi*(((((((a+pi)/b)/pi)/b)/a)+3.33)/a))-b)/a)*pi)+a)/e)*pi)))-a)+b))*0.55)+b)-1.99)*3.57))+0.28)+e)-1.31)\"\n\"(((a+(((pi+sin(((cos((((((((2.27/(sin(cos((((tan(((tan(((b/b)+3.73))*a)*3.17))*b)*pi)*b)))+e))-pi)-2.06)/b)-e)/a)+e))/b)+a)))/b)+a))*e)*a)\"\n\"((((((((((((((((((((a*(((((b/(((((b-3.86)-pi)+pi)+pi)-3.94))/b)+pi)+2.51)/pi))+b)+1.74)+b)-b)/e)+pi)+b)+b)/b)+e)*b)+b)+a)+a)+a)/b)+b)+b)-a)\"\n\"((((((e+(((((((e-(((((b+((((((((e+(2.83+((b*a)*a)))+b)+a)-pi)+3.91)-e)-e)*b))+b)*a)-b)/0.83))+pi)-a)-0.27)+pi)/1.95)+1.93))*e)+b)+b)+a)-pi)\"\n\"(sin(((((((a*((cos((((((((((a+(cos((((a+sin(((e+0.21)-b)))/0.25)/0.96))*e))-e)/a)+e)+b)/b)*b)/pi)-b))+0.93)/3.90))+0.67)+a)*a)*e)/e))+1.67)\"\n\"((((((((((((((((((((((((((((a/a)-b)+b)-b)/3.07)-b)*0.79)/b)*b)/2.94)+0.76)-0.04)*0.60)/a)+a)+b)/1.05)-a)+b)/a)/e)-2.16)+b)+e)*a)*e)+e)*0.87)\"\n\"(((((((((1.43-((((((((((((((b-((((b+b)-b)/pi)/b))+pi)-pi)+pi)*b)+1.34)-a)/b)*3.87)+1.81)/2.91)+a)-b)+3.62))-e)+b)+3.03)/a)+0.68)+a)+1.51)*e)\"\n\"(((((b+((((((((((((((((((((((a/pi)/a)/a)/0.82)*e)-e)*1.67)*pi)+pi)-a)-b)+e)-a)+pi)+2.45)-b)+2.72)+3.72)+a)*b)/3.78)+b))+0.94)-0.47)/1.03)*b)\"\n\"(((((tan(((((tan((sin((((((pi*((b-(sin(((((pi*e)*0.86)-pi)+3.04))/a))+a))+e)+3.81)*e)+b))+a))+pi)+a)-3.18)*2.67))/b)-1.90)+2.89)+1.25)+3.93)\"\n\"((((((((((b+(((((((((((((((((0.75*pi)+2.45)/pi)+b)-e)+3.63)*pi)/2.47)-b)-2.80)-a)-b)*e)+pi)/b)+b)-2.78))+e)/2.20)-a)*pi)/pi)-b)+1.99)-pi)-pi)\"\n\"((((pi*((((((((3.85/(((((((((((((((((b+a)/pi)+pi)-a)+a)/b)+a)-0.68)/b)/3.05)/a)+a)+3.72)*a)-e)*a)+e))-e)+a)/1.96)-e)*a)-b)-b))+0.81)-e)/2.79)\"\n\"(a+cos((((pi-(cos((((((cos((((2.07/((((tan(tan((sin((sin(tan(((b*2.18)-pi)))+a))*pi)))+pi)-b)/a)+a))+a)/e))+2.96)/a)+1.92)*a)-a))-e))+b)/b)))\"\n\"cos(((cos(((cos(tan(sin(sin((((((((((sin(cos((2.38+(((((pi-a)*2.96)-a)/e)+b))))/2.60)+3.41)+pi)+b)/a)/a)-1.86)*3.57)+e)))))/pi)-2.41))+b)/a))\"\n\"cos(((tan(((tan((b+(b+(((sin(((a+cos(cos((tan(tan((2.70+(0.15*(((2.37-cos(cos(b)))/b)/a)))))/a))))-1.15))+b)+1.96)+pi))))*1.40)+a))*1.62)+b))\"\n\"sin(((pi-((tan((cos((((((cos((sin(((tan((((((pi+(((3.17*(a*3.32))+pi)*b))/b)+a)+a)*3.87))+a)-2.05))*e))-b)-b)+b)+b)/0.96))+b))+pi)+1.89))+b))\"\n\"((b+((((((((((((a+(b-((((e-(pi*(((((((((b-b)+pi)-pi)-b)*1.77)*2.53)*3.35)+a)+a)))*e)+pi)+b)))-b)+b)-a)+pi)+pi)/a)+a)*1.31)/1.16)*a)-pi))*3.69)\"\n\"(((((((((((((((((((((((((((((((3.05*2.33)-e)+a)-a)*1.81)-2.57)+a)*b)/2.89)/e)/a)*pi)+pi)+b)-a)*pi)-b)/a)/b)/b)/e)+b)/b)+b)-b)+e)*b)/b)/b)-a)-b)\"\n\"((((1.59/((((((3.51-((((((((((((((((((1.99-a)-a)+a)*b)+a)/e)+2.74)/pi)*e)*3.74)+e)+e)/3.87)*3.78)+e)/b)/b)*b))-0.12)*a)-2.37)+pi)*a))+a)+e)+pi)\"\n\"cos((sin(sin(((sin((((((((((sin((((e+sin(((pi*tan((((((tan(2.85)+e)+0.96)/a)-b)*a)))+b)))+a)*a))+b)/1.65)/e)+b)+e)-b)+1.55)*pi)/a))+a)+a)))-b))\"\n\"tan((((1.95-((pi/tan((((3.37+(a-((((sin((sin(sin(((tan(tan((((a/(((1.01+1.22)*b)/b))-a)+a)))+1.55)+b)))*2.05))-b)+b)+b)-a)))/e)+a)))+b))+e)-a))\"\n\"(((((((b+(((((((b+(((((((a-(((((e+(((((a/b)*b)+b)+b)+b))+3.15)-a)*b)/e))+b)/e)*pi)-a)+b)/a))*2.28)+b)-e)+1.90)+e)+a))-a)-2.81)+a)-0.75)+e)-3.43)\"\n\"((((b-((((((((e+((((((((((((((2.28*(((0.51/((pi*a)*e))+a)-b))+pi)+b)+pi)*b)*b)*1.49)/b)*e)/b)-e)*a)/b)/b))*b)/e)-0.66)+e)+b)*e)+e))+pi)-a)*1.78)\"\n\"(0.70/((a+tan((((sin(((cos(((pi*(((((b+(((sin(((((((a+pi)+3.07)+b)+3.52)-0.55)*a))-b)-1.65)+a))-1.92)+b)/2.80)+a))+0.20))+a)+a))/pi)+b)/a)))/a))\"\n\"(b/(cos(((((((a-((tan(((((b+sin(cos((cos((tan(tan(((cos((0.30-(((b+a)+pi)+a)))+pi)+a)))*a))+1.02))))/a)/1.09)/b))-a)/b))+b)-0.98)*e)/a)/a))-pi))\"\n\"((((((((((((((((((2.05*((((((b+((((pi*b)+b)*a)-3.89))+a)+0.31)*pi)-2.86)+a))*0.74)/e)/1.93)+a)-e)+b)/3.44)*b)*0.50)*2.06)/b)+e)-e)*a)+2.28)/a)/e)\"\n\"(((((((a+(((((b+((b+(((b+((b+((((((((((a-b)+b)+1.54)+3.69)*0.85)+0.54)+a)*a)-b)-1.01))+a))/pi)-b))*a))*a)/a)+0.23)-3.29))/2.04)*e)+1.04)/a)+b)-a)\"\n\"(b*(((b+(((((((((((((((((((((((((((pi+a)/e)+e)+b)/pi)-pi)/a)+0.85)/b)*3.94)/pi)-a)*pi)-a)-a)+pi)*pi)+b)*a)+a)+b)+pi)-a)-2.49)+a)-0.28)/a))-b)+b))\"\n\"((((((((((((((((((((e+(((e/(a+(((((b+b)*e)+b)*pi)*3.48)))-b)-3.41))-a)/2.12)*e)+e)-b)+a)*3.00)-a)/a)-pi)-1.11)-a)-a)+2.44)+0.04)-3.79)-a)+2.01)-a)\"\n\"(((((((((((((((((1.17-(pi-(b-((((((((((1.38+b)+a)+b)+e)-a)+0.89)+a)*2.38)*pi)+a))))-b)-a)+b)-b)/a)+pi)/4.00)-a)/2.66)/b)*b)+pi)+2.29)+2.05)*pi)*a)\"\n\"(((((2.17-(pi*((((((((((((((((((((a/(((((b+b)-e)*b)*a)-b))/a)+b)+a)+a)/1.88)-3.41)-e)*1.51)*a)/e)-a)+b)/1.83)/a)-pi)*a)/1.31)+b)+b)))*e)/e)*a)*pi)\"\n\"(((b-((((((2.17+((((((((((((((((((b/(((a+0.63)/b)+pi))-pi)/a)*0.11)-e)+a)/a)+3.51)+pi)*e)+e)+pi)-3.04)/1.94)-a)*a)/a)-a))-e)/e)/b)*a)/0.27))+e)/b)\"\n\"((1.34+((((a-((((((((a-(((((((1.68+(((((((((e+e)+e)+0.82)+a)+e)+e)+b)+b)/a))*a)/a)-a)+e)-e)/1.63))*0.14)*a)+a)*a)/3.72)-0.13)*b))-pi)-3.00)-a))-b)\"\n\"(pi-sin(((cos(tan(((2.73+cos(tan(((((((((((((((sin(sin((((b+b)+a)-b)))-a)+pi)+b)*3.31)+3.68)/b)-3.28)+a)-b)*a)-1.77)+a)/e)*2.39))))+b)))+a)*1.51)))\"\n\"tan((3.80*cos(((((((2.52-(sin((a+((sin((tan((((b-(1.24*((cos((((((b-0.38)*a)+a)+0.73)-a))-b)+a)))+a)*pi))+1.20))+b)/a)))-b))*pi)+0.37)+a)-pi)*b))))\"\n\"tan(tan(((((tan((((((((tan(cos(cos((((e-((((((cos((((b+(e*a))-a)/pi))+b)/b)/b)+0.47)-b)*b))-b)-pi))))/1.94)+a)/a)-pi)*3.99)+0.31)+e))*a)+a)+b)+b)))\"\n\"(a+(((((e/((((((2.42+((((e*(1.24+((((((2.78/((((3.53+(a-((b/b)*b)))*b)*a)*3.14))+a)*b)+b)-1.75)+pi)))*b)+e)-pi))+0.87)*e)+pi)+a)*b))*1.21)+a)-a)+b))\"\n\"((((((((((((((((((((((((2.14+((((a+((3.62-pi)+2.46))*2.18)+b)-a))+e)+0.96)+a)+pi)*2.09)*a)*e)+a)/2.72)/a)+a)/e)+b)*a)+a)/a)+a)*b)+0.28)+b)/pi)*a)+pi)\"\n\"(((((((((((pi+((e+(a*((((a-(((((((((((pi/pi)/0.75)-pi)-1.56)+b)/1.40)/a)/a)*a)*a)*pi))-3.24)+a)*b)))+3.43))-0.66)/a)+1.42)*0.01)-0.06)/a)-b)-a)*e)+a)\"\n\"((((((((((b+(((((((e+(((3.30+(b*(((1.54*((3.80*(pi+a))+1.89))/0.32)/a)))+3.98)-b))-b)/b)-b)-1.91)-3.06)+1.71))/e)+b)/1.90)+0.75)-a)-a)+0.82)+0.26)*b)\"\n\"(((a*((((a+(b+(((b+((tan((((b*(b+sin(((((a/(((b+tan((tan((((cos(a)*1.25)*a)+pi))-pi)))-b)/b))+b)*b)+e))))+a)-a))+b)*a))*e)*2.97)))*b)*b)/pi))/pi)-pi)\"\n\"((tan((tan(tan((((((((((((tan(((pi-(a-(tan(tan((e+(tan(((3.13+1.42)+a))+b))))+a)))+0.03))+b)+pi)+a)*pi)-pi)-1.61)*e)-a)*pi)*pi)*1.59)))/pi))-3.30)+b)\"\n\"((3.18-(tan(((cos((pi-((b-(2.13-((((((((cos(((pi+((sin(((tan(3.97)+0.11)/0.68))-b)/a))+a))*b)+1.61)*e)+0.01)/b)*b)-1.36)/a)))+1.11)))-b)-b))*a))-1.54)\"\n\"(3.71/((((tan(sin((sin((cos((((a+((((((((cos((((cos(sin(cos(b)))+b)-2.53)+3.33))*pi)-pi)+1.78)+2.02)*pi)-b)-2.86)+b))+a)*e))/e))+b)))+3.13)*a)*e)/pi))\"\n\"(b+((sin((a+sin((((tan(((tan((((cos((tan((a*(2.30/((((cos(cos((((a+b)+0.08)-a)))/2.02)-b)-2.19)/b))))/a))-b)*e)/pi))*b)+0.53))/a)+1.98)+pi))))+pi)+a))\"\n\"(cos(((tan(sin(((tan(tan((cos(cos(((b+(tan(cos(((sin(((((sin(cos((((0.05/3.18)/0.05)-b)))+e)+a)/pi)-3.10))-pi)+a)))/b))+a)))*a)))-1.53)-b)))+e)+a))*a)\"\n\"(((2.41-(cos(((((a*((((((1.25-((((((tan(((((b+tan((b/((((a*2.06)-a)*b)/b))))*a)+a)+1.26))+a)*b)-e)/b)-b)+a))-e)+a)/3.71)*3.27)*pi))-e)*e)/b))/b))/e)+b)\"\n\"(((tan(cos(((((tan((((pi*(b+cos(tan((((((((((((((((e-2.36)+b)-b)+0.93)+3.52)+a)*a)+pi)/3.61)/a)+e)+a)-pi)/1.95)+b)))))+a)/a))+a)/b)-b)+a)))/2.99)+b)-e)\"\n\"(pi*(((((((((((((((b+(3.48-((((((((2.17*((((b*e)-1.20)-pi)/b))*b)/0.59)-e)+1.70)+pi)/b)+pi)))*e)-b)/e)/pi)*0.61)+pi)/2.92)*pi)-b)*a)-2.53)+b)+1.09)+e))\"\n\"((cos(sin(((b-(cos(((b*(1.36*tan(((((cos((a*tan((pi/(e+(a/((((b+((cos((((b+e)*3.56)+b))+pi)-2.92))/a)/pi)+3.68)))))))*b)/e)+b)+b))))-b))*a))*a)))*pi)+e)\"\n\"((a+(tan(((3.44/(((b-(tan(((((((((2.31/((tan((pi/(cos((cos(((((((3.76*b)*pi)*b)/a)+e)*pi))-b))+a)))/e)*b))/a)/b)+a)-a)*b)+a)/a))/b))+e)*b))/a))+b))*3.78)\"\n\"((b/(tan((b+(tan((((b-tan(((((((cos((((cos(sin(((((sin(tan(((a/b)+3.58)))/a)+b)+2.69)+0.06)))+a)+a)+b))-pi)*3.68)+pi)+a)+b)+3.89)))/e)/e))/2.72)))*b))*b)\"\n\"tan(sin((((tan((((sin(cos((((tan((a+tan((((3.88+(3.63/(tan(sin((((a+(((a+b)/b)-a))/1.71)/1.69)))*0.71)))-pi)*b))))+3.90)/pi)-b)))*b)+b)+b))+1.09)+b)-a)))\"\n\"((a-cos((((a+tan((tan((cos(((((((((((1.47+((((((tan(tan((e-a)))/1.27)*b)*a)-0.10)*1.54)-pi))+0.35)*1.97)+pi)+b)/e)*b)+0.09)-pi)/b))-1.73))+a)))+b)/a)))+e)\"\n\"((((cos(tan(((a*cos((0.20+cos((2.66+tan((cos(((e*cos((1.36+((cos((((tan((0.66/(((1.42*0.01)-0.06)/a)))-b)-a)*e))+a)/b))))+e))-b)))))))/pi)))+e)+b)*b)+1.01)\"\n\"(b-(((((sin((sin(((0.89+tan((cos((((pi*(((e+((b/(a/((sin(cos(cos((tan(((1.81+pi)*a))/1.04))))*e)+2.05)))+a))+e)*b))+e)/a))-b)))+b))*0.48))+b)/a)*a)*pi)-a))\"\n\"(((tan(((tan(tan(((3.48+(sin(((((((tan((e+(((a+(((a-((cos((1.93*b))/3.31)*1.39))+b)-0.84))-b)-0.58)))+pi)+3.05)*e)+3.85)/b)+e))+b))*pi)))+0.26)*a))+e)+a)-e)\"\n\"((sin(cos((cos(((((((((a*((((sin(cos((((((sin((((sin(e)/1.51)+a)+1.34))*pi)+a)*3.00)-1.64)*e)))/a)*2.85)+b)*a))+b)*b)+2.44)+b)*0.18)/b)-b))/3.69)))-1.10)*b)\"\n\"(cos((e*cos((b-cos((sin((pi/tan(tan(((((((((((b+(((3.52+((cos(((((b*3.66)-a)/2.90)+a))*b)+0.35))*1.02)/1.43))*b)/b)*1.64)-pi)-a)+a)+a)-a)+b)))))-a))))))*pi)\"\n\"(e+cos(sin((cos(((((((sin((tan((cos((((sin(cos(tan(cos(cos(((1.88-((((((1.96/pi)+e)/e)/b)-b)+a))+a))))))/pi)*a)/e))*b))-a))+b)/e)*b)+2.12)*3.30)*pi))*pi))))\"\n\"((((((3.123*y)*z)-w)/((3.123+y)+(z*w)))/(((3.123+y)-(z/w))-((3.123*y)+(z-w))))/((((3.123+y)+(z*w))*((3.123/y)+(z-w)))*(((3.123*y)+(z-w))+((3.123/y)*(z-w)))))\"\n\"((((((3.123*y)/z)-w)/((3.123-y)-(z*w)))/(((3.123-y)+(z/w))-((3.123+y)*(z*w))))/((((3.123-y)-(z*w))*((3.123+y)*(z/w)))*(((3.123+y)*(z*w))+(3.123-(y/(z*w))))))\"\n\"((((((3.123+y)*z)-w)-((3.123+y)-(z*w)))-((3.123*(y-(z*w)))/((3.123*y)+(z+w))))-((((3.123+y)-(z*w))+((3.123/y)+(z+w)))+(((3.123*y)+(z+w))*((3.123/y)/(z-w)))))\"\n\"((((((3.123+y)/z)-w)-((3.123-y)+(z*w)))-(((3.123+y)+(z/w))/((3.123*y)-(z-w))))-((((3.123-y)+(z*w))+((3.123/y)-(z-w)))+(((3.123*y)-(z-w))*(3.123-(y*(z/w))))))\"\n\"((((((3.123-y)*z)-w)*((3.123+y)-(z/w)))*(((3.123+y)-(z*w))+((3.123/y)+(z+w))))*((((3.123+y)-(z/w))-((3.123*y)+(z-w)))-(((3.123/y)+(z+w))/((3.123*y)*(z-w)))))\"\n\"((((((3.123-y)/z)-w)*((3.123-y)+(z/w)))*(((3.123-y)+(z*w))+((3.123/y)-(z-w))))*((((3.123-y)+(z/w))-((3.123+y)*(z*w)))-(((3.123/y)-(z-w))/(3.123+(y/(z*w))))))\"\n\"((((((3.123/y)*z)-w)+((3.123+y)+(z/w)))+(((3.123+y)+(z*w))*((3.123/y)+(z-w))))+((((3.123+y)+(z/w))/((3.123*y)-(z-w)))/(((3.123/y)+(z-w))-(3.123+(y*(z/w))))))\"\n\"((((((3.123/y)/z)-w)+((3.123-y)-(z/w)))+(((3.123-y)-(z*w))*((3.123+y)*(z/w))))+((((3.123-y)-(z/w))/((3.123+y)/(z*w)))/(((3.123+y)*(z/w))-(3.123+((y+z)/w)))))\"\n\"((((((x*5.123)*z)-w)/((x+5.123)+(z*w)))/(((x+5.123)-(z/w))-((x*5.123)+(z-w))))/((((x+5.123)+(z*w))*((x/5.123)+(z-w)))*(((x*5.123)+(z-w))+((x/5.123)*(z-w)))))\"\n\"((((((x*5.123)/z)-w)/((x-5.123)-(z*w)))/(((x-5.123)+(z/w))-((x+5.123)*(z*w))))/((((x-5.123)-(z*w))*((x+5.123)*(z/w)))*(((x+5.123)*(z*w))+(x-(5.123/(z*w))))))\"\n\"((((((x*y)*7.123)-w)/((x+y)+(7.123*w)))/(((x+y)-(7.123/w))-((x*y)+(7.123-w))))/((((x+y)+(7.123*w))*((x/y)+(7.123-w)))*(((x*y)+(7.123-w))+((x/y)*(7.123-w)))))\"\n\"((((((x*y)*z)-9.123)/((x+y)+(z*9.123)))/(((x+y)-(z/9.123))-((x*y)+(z-9.123))))/((((x+y)+(z*9.123))*((x/y)+(z-9.123)))*(((x*y)+(z-9.123))+((x/y)*(z-9.123)))))\"\n\"((((((x*y)/7.123)-w)/((x-y)-(7.123*w)))/(((x-y)+(7.123/w))-((x+y)*(7.123*w))))/((((x-y)-(7.123*w))*((x+y)*(7.123/w)))*(((x+y)*(7.123*w))+(x-(y/(7.123*w))))))\"\n\"((((((x*y)/z)-9.123)/((x-y)-(z*9.123)))/(((x-y)+(z/9.123))-((x+y)*(z*9.123))))/((((x-y)-(z*9.123))*((x+y)*(z/9.123)))*(((x+y)*(z*9.123))+(x-(y/(z*9.123))))))\"\n\"((((((x+5.123)*z)-w)-((x+5.123)-(z*w)))-((x*(5.123-(z*w)))/((x*5.123)+(z+w))))-((((x+5.123)-(z*w))+((x/5.123)+(z+w)))+(((x*5.123)+(z+w))*((x/5.123)/(z-w)))))\"\n\"((((((x+5.123)/z)-w)-((x-5.123)+(z*w)))-(((x+5.123)+(z/w))/((x*5.123)-(z-w))))-((((x-5.123)+(z*w))+((x/5.123)-(z-w)))+(((x*5.123)-(z-w))*(x-(5.123*(z/w))))))\"\n\"((((((x+y)*7.123)-w)-((x+y)-(7.123*w)))-((x*(y-(7.123*w)))/((x*y)+(7.123+w))))-((((x+y)-(7.123*w))+((x/y)+(7.123+w)))+(((x*y)+(7.123+w))*((x/y)/(7.123-w)))))\"\n\"((((((x+y)*z)-9.123)-((x+y)-(z*9.123)))-((x*(y-(z*9.123)))/((x*y)+(z+9.123))))-((((x+y)-(z*9.123))+((x/y)+(z+9.123)))+(((x*y)+(z+9.123))*((x/y)/(z-9.123)))))\"\n\"((((((x+y)/7.123)-w)-((x-y)+(7.123*w)))-(((x+y)+(7.123/w))/((x*y)-(7.123-w))))-((((x-y)+(7.123*w))+((x/y)-(7.123-w)))+(((x*y)-(7.123-w))*(x-(y*(7.123/w))))))\"\n\"((((((x+y)/z)-9.123)-((x-y)+(z*9.123)))-(((x+y)+(z/9.123))/((x*y)-(z-9.123))))-((((x-y)+(z*9.123))+((x/y)-(z-9.123)))+(((x*y)-(z-9.123))*(x-(y*(z/9.123))))))\"\n\"((((((x-5.123)*z)-w)*((x+5.123)-(z/w)))*(((x+5.123)-(z*w))+((x/5.123)+(z+w))))*((((x+5.123)-(z/w))-((x*5.123)+(z-w)))-(((x/5.123)+(z+w))/((x*5.123)*(z-w)))))\"\n\"((((((x-5.123)/z)-w)*((x-5.123)+(z/w)))*(((x-5.123)+(z*w))+((x/5.123)-(z-w))))*((((x-5.123)+(z/w))-((x+5.123)*(z*w)))-(((x/5.123)-(z-w))/(x+(5.123/(z*w))))))\"\n\"((((((x-y)*7.123)-w)*((x+y)-(7.123/w)))*(((x+y)-(7.123*w))+((x/y)+(7.123+w))))*((((x+y)-(7.123/w))-((x*y)+(7.123-w)))-(((x/y)+(7.123+w))/((x*y)*(7.123-w)))))\"\n\"((((((x-y)*z)-9.123)*((x+y)-(z/9.123)))*(((x+y)-(z*9.123))+((x/y)+(z+9.123))))*((((x+y)-(z/9.123))-((x*y)+(z-9.123)))-(((x/y)+(z+9.123))/((x*y)*(z-9.123)))))\"\n\"((((((x-y)/7.123)-w)*((x-y)+(7.123/w)))*(((x-y)+(7.123*w))+((x/y)-(7.123-w))))*((((x-y)+(7.123/w))-((x+y)*(7.123*w)))-(((x/y)-(7.123-w))/(x+(y/(7.123*w))))))\"\n\"((((((x-y)/z)-9.123)*((x-y)+(z/9.123)))*(((x-y)+(z*9.123))+((x/y)-(z-9.123))))*((((x-y)+(z/9.123))-((x+y)*(z*9.123)))-(((x/y)-(z-9.123))/(x+(y/(z*9.123))))))\"\n\"((((((x/5.123)*z)-w)+((x+5.123)+(z/w)))+(((x+5.123)+(z*w))*((x/5.123)+(z-w))))+((((x+5.123)+(z/w))/((x*5.123)-(z-w)))/(((x/5.123)+(z-w))-(x+(5.123*(z/w))))))\"\n\"((((((x/5.123)/z)-w)+((x-5.123)-(z/w)))+(((x-5.123)-(z*w))*((x+5.123)*(z/w))))+((((x-5.123)-(z/w))/((x+5.123)/(z*w)))/(((x+5.123)*(z/w))-(x+((5.123+z)/w)))))\"\n\"((((((x/y)*7.123)-w)+((x+y)+(7.123/w)))+(((x+y)+(7.123*w))*((x/y)+(7.123-w))))+((((x+y)+(7.123/w))/((x*y)-(7.123-w)))/(((x/y)+(7.123-w))-(x+(y*(7.123/w))))))\"\n\"((((((x/y)*z)-9.123)+((x+y)+(z/9.123)))+(((x+y)+(z*9.123))*((x/y)+(z-9.123))))+((((x+y)+(z/9.123))/((x*y)-(z-9.123)))/(((x/y)+(z-9.123))-(x+(y*(z/9.123))))))\"\n\"((((((x/y)/7.123)-w)+((x-y)-(7.123/w)))+(((x-y)-(7.123*w))*((x+y)*(7.123/w))))+((((x-y)-(7.123/w))/((x+y)/(7.123*w)))/(((x+y)*(7.123/w))-(x+((y+7.123)/w)))))\"\n\"((((((x/y)/z)-9.123)+((x-y)-(z/9.123)))+(((x-y)-(z*9.123))*((x+y)*(z/9.123))))+((((x-y)-(z/9.123))/((x+y)/(z*9.123)))/(((x+y)*(z/9.123))-(x+((y+z)/9.123)))))\"\n\"(((((3.123*y)*(z+w))+(3.123+((y/z)/w)))+((3.123+((y/z)+w))*((3.123*y)+(z*w))))+(((3.123+((y/z)/w))/((3.123*y)-(z*w)))/(((3.123*y)+(z*w))-((3.123+y)-(z-w)))))\"\n\"(((((3.123*y)*(z-w))*(3.123-((y*z)/w)))*((3.123-((y-z)*w))+((3.123/y)-(z*w))))*(((3.123-((y*z)/w))-(3.123/(y+(z*w))))-(((3.123/y)-(z*w))/((3.123-y)*(z+w)))))\"\n\"(((((3.123*y)+(z*w))-((3.123+y)-(z-w)))-(((3.123-y)-(z/w))/((3.123+y)/(z*w))))-((((3.123+y)-(z-w))+((3.123+y)/(z/w)))+(((3.123+y)/(z*w))*(3.123+((y+z)*w)))))\"\n\"(((((3.123*y)+(z+w))*((3.123/y)/(z-w)))*(((3.123*y)/(z-w))+(3.123-((y-z)/w))))*((((3.123/y)/(z-w))-(3.123-((y-z)*w)))-((3.123-((y-z)/w))/((3.123/y)-(z/w)))))\"\n\"(((((3.123*y)+(z-w))+((3.123/y)*(z-w)))+(((3.123*y)*(z-w))*(3.123-((y*z)/w))))+((((3.123/y)*(z-w))/(3.123-((y*z)*w)))/((3.123-((y*z)/w))-(3.123/(y+(z*w))))))\"\n\"(((((3.123*y)+(z/w))/((3.123+y)*(z-w)))/(((3.123+y)+(z-w))-((3.123-y)/(z*w))))/((((3.123+y)*(z-w))*((3.123-y)/(z/w)))*(((3.123-y)/(z*w))+(3.123+((y-z)*w)))))\"\n\"(((((3.123*y)-(z*w))*((3.123+y)+(z-w)))*(((3.123+y)-(z-w))+((3.123+y)/(z/w))))*((((3.123+y)+(z-w))-((3.123-y)/(z*w)))-(((3.123+y)/(z/w))/(3.123+((y-z)/w)))))\"\n\"(((((3.123*y)-(z+w))+((3.123/y)/(z+w)))+(((3.123*y)/(z+w))*(3.123-((y+z)/w))))+((((3.123/y)/(z+w))/(3.123-((y+z)*w)))/((3.123-((y+z)/w))-((3.123*y)-(z/w)))))\"\n\"(((((3.123*y)-(z-w))*(3.123-(y*(z/w))))*((3.123+(y*(z/w)))+(3.123-((y/z)/w))))*(((3.123-(y*(z/w)))-(3.123-((y/z)*w)))-((3.123-((y/z)/w))/(3.123*(y+(z*w))))))\"\n\"(((((3.123*y)-(z/w))+((3.123+y)/(z-w)))+(((3.123+y)*(z-w))*((3.123-y)/(z/w))))+((((3.123+y)/(z-w))/((3.123-y)*(z*w)))/(((3.123-y)/(z/w))-(3.123+((y*z)/w)))))\"\n\"(((((3.123*y)/(z+w))*(3.123-((y+z)/w)))*((3.123+((y/z)*w))+((3.123*y)+(z/w))))*(((3.123-((y+z)/w))-((3.123*y)-(z/w)))-(((3.123*y)+(z/w))/((3.123+y)*(z-w)))))\"\n\"(((((3.123*y)/(z-w))+(3.123-((y-z)/w)))+((3.123-((y+z)*w))*((3.123/y)+(z/w))))+(((3.123-((y-z)/w))/((3.123/y)-(z/w)))/(((3.123/y)+(z/w))-((3.123-y)-(z+w)))))\"\n\"(((((3.123+y)*(z*w))+(3.123-(y/(z*w))))+((3.123+(y/(z*w)))*(((3.123+y)*z)-w)))+(((3.123-(y/(z*w)))/(((3.123-y)*z)-w))/((((3.123+y)*z)-w)-((3.123+y)-(z*w)))))\"\n\"(((((3.123+y)*(z-w))*((3.123-y)/(z/w)))*(((3.123-y)/(z*w))+(3.123+((y-z)*w))))*((((3.123-y)/(z/w))-(3.123+((y*z)/w)))-((3.123+((y-z)*w))/(((3.123-y)/z)-w))))\"\n\"(((((3.123+y)*(z/w))-(3.123+((y+z)/w)))-((3.123-(y/(z*w)))/(((3.123-y)*z)-w)))-(((3.123+((y+z)/w))+(((3.123*y)*z)-w))+((((3.123-y)*z)-w)*((3.123+y)-(z/w)))))\"\n\"(((((3.123+y)+(z*w))*((3.123/y)+(z-w)))*(((3.123*y)+(z-w))+((3.123/y)*(z-w))))*((((3.123/y)+(z-w))-(3.123+(y*(z/w))))-(((3.123/y)*(z-w))/(3.123-((y*z)*w)))))\"\n\"(((((3.123+y)+(z-w))-((3.123-y)/(z*w)))-(((3.123+y)/(z/w))/(3.123+((y-z)/w))))-((((3.123-y)/(z*w))+(3.123+((y-z)*w)))+((3.123+((y-z)/w))*(((3.123+y)/z)-w))))\"\n\"(((((3.123+y)+(z/w))/((3.123*y)-(z-w)))/(((3.123/y)+(z-w))-(3.123+(y*(z/w)))))/((((3.123*y)-(z-w))*(3.123-(y*(z/w))))*((3.123+(y*(z/w)))+(3.123-((y/z)/w)))))\"\n\"(((((3.123+y)-(z*w))+((3.123/y)+(z+w)))+(((3.123*y)+(z+w))*((3.123/y)/(z-w))))+((((3.123/y)+(z+w))/((3.123*y)*(z-w)))/(((3.123/y)/(z-w))-(3.123-((y-z)*w)))))\"\n\"(((((3.123+y)-(z-w))+((3.123+y)/(z/w)))+(((3.123+y)/(z*w))*(3.123+((y+z)*w))))+((((3.123+y)/(z/w))/(3.123+((y-z)/w)))/((3.123+((y+z)*w))-(((3.123/y)*z)-w))))\"\n\"(((((3.123+y)-(z/w))-((3.123*y)+(z-w)))-(((3.123/y)+(z+w))/((3.123*y)*(z-w))))-((((3.123*y)+(z-w))+((3.123/y)*(z-w)))+(((3.123*y)*(z-w))*(3.123-((y*z)/w)))))\"\n\"(((((3.123+y)/(z*w))*(3.123+((y+z)*w)))*((3.123+((y+z)/w))+(((3.123*y)*z)-w)))*(((3.123+((y+z)*w))-(((3.123/y)*z)-w))-((((3.123*y)*z)-w)/((3.123+y)+(z*w)))))\"\n\"(((((3.123+y)/(z-w))/((3.123-y)*(z*w)))/(((3.123-y)/(z/w))-(3.123+((y*z)/w))))/((((3.123-y)*(z*w))*(3.123+((y*z)*w)))*((3.123+((y*z)/w))+(((3.123*y)/z)-w))))\"\n\"(((((3.123+y)/(z/w))/(3.123+((y-z)/w)))/((3.123+((y+z)*w))-(((3.123/y)*z)-w)))/(((3.123+((y-z)/w))*(((3.123+y)/z)-w))*((((3.123/y)*z)-w)+((3.123+y)+(z/w)))))\"\n\"(((((3.123-y)*(z*w))*(3.123+((y*z)*w)))*((3.123+((y*z)/w))+(((3.123*y)/z)-w)))*(((3.123+((y*z)*w))-(((3.123/y)/z)-w))-((((3.123*y)/z)-w)/((3.123-y)-(z*w)))))\"\n\"(((((3.123-y)*(z+w))*((3.123/y)*(z+w)))*(((3.123*y)*(z+w))+(3.123+((y/z)/w))))*((((3.123/y)*(z+w))-(3.123+((y/z)*w)))-((3.123+((y/z)/w))/((3.123*y)-(z*w)))))\"\n\"(((((3.123-y)*(z/w))/(3.123+((y/z)+w)))/((3.123+((y*z)*w))-(((3.123/y)/z)-w)))/(((3.123+((y/z)+w))*((3.123*y)+(z*w)))*((((3.123/y)/z)-w)+((3.123-y)-(z/w)))))\"\n\"(((((3.123-y)+(z*w))+((3.123/y)-(z-w)))+(((3.123*y)-(z-w))*(3.123-(y*(z/w)))))+((((3.123/y)-(z-w))/(3.123+(y/(z*w))))/((3.123-(y*(z/w)))-(3.123-((y/z)*w)))))\"\n\"(((((3.123-y)+(z+w))-((3.123*y)*(z+w)))-(((3.123-y)*(z/w))/(3.123+((y/z)+w))))-((((3.123*y)*(z+w))+(3.123+((y/z)/w)))+((3.123+((y/z)+w))*((3.123*y)+(z*w)))))\"\n\"(((((3.123-y)+(z/w))-((3.123+y)*(z*w)))-(((3.123/y)-(z-w))/(3.123+(y/(z*w)))))-((((3.123+y)*(z*w))+(3.123-(y/(z*w))))+((3.123+(y/(z*w)))*(((3.123+y)*z)-w))))\"\n\"(((((3.123-y)-(z*w))*((3.123+y)*(z/w)))*(((3.123+y)*(z*w))+(3.123-(y/(z*w)))))*((((3.123+y)*(z/w))-(3.123+((y+z)/w)))-((3.123-(y/(z*w)))/(((3.123-y)*z)-w))))\"\n\"(((((3.123-y)-(z+w))+((3.123-y)*(z/w)))+(((3.123-y)*(z*w))*(3.123+((y*z)*w))))+((((3.123-y)*(z/w))/(3.123+((y/z)+w)))/((3.123+((y*z)*w))-(((3.123/y)/z)-w))))\"\n\"(((((3.123-y)-(z/w))/((3.123+y)/(z*w)))/(((3.123+y)*(z/w))-(3.123+((y+z)/w))))/((((3.123+y)/(z*w))*(3.123+((y+z)*w)))*((3.123+((y+z)/w))+(((3.123*y)*z)-w))))\"\n\"(((((3.123-y)/(z*w))+(3.123+((y-z)*w)))+((3.123+((y-z)/w))*(((3.123+y)/z)-w)))+(((3.123+((y-z)*w))/(((3.123-y)/z)-w))/((((3.123+y)/z)-w)-((3.123-y)+(z*w)))))\"\n\"(((((3.123-y)/(z+w))/((3.123*y)/(z+w)))/(((3.123/y)*(z+w))-(3.123+((y/z)*w))))/((((3.123*y)/(z+w))*(3.123-((y+z)/w)))*((3.123+((y/z)*w))+((3.123*y)+(z/w)))))\"\n\"(((((3.123-y)/(z/w))-(3.123+((y*z)/w)))-((3.123+((y-z)*w))/(((3.123-y)/z)-w)))-(((3.123+((y*z)/w))+(((3.123*y)/z)-w))+((((3.123-y)/z)-w)*((3.123-y)+(z/w)))))\"\n\"(((((3.123/y)*(z+w))-(3.123+((y/z)*w)))-((3.123+((y/z)/w))/((3.123*y)-(z*w))))-(((3.123+((y/z)*w))+((3.123*y)+(z/w)))+(((3.123*y)-(z*w))*((3.123+y)+(z-w)))))\"\n\"(((((3.123/y)*(z-w))/(3.123-((y*z)*w)))/((3.123-((y*z)/w))-(3.123/(y+(z*w)))))/(((3.123-((y*z)*w))*(3.123/(y-(z*w))))*((3.123/(y+(z*w)))+((3.123-y)/(z+w)))))\"\n\"(((((3.123/y)+(z+w))/((3.123*y)*(z-w)))/(((3.123/y)/(z-w))-(3.123-((y-z)*w))))/((((3.123*y)*(z-w))*(3.123-((y*z)/w)))*((3.123-((y-z)*w))+((3.123/y)-(z*w)))))\"\n\"(((((3.123/y)+(z-w))-(3.123+(y*(z/w))))-(((3.123/y)*(z-w))/(3.123-((y*z)*w))))-(((3.123+(y*(z/w)))+(3.123-((y/z)/w)))+((3.123-((y*z)*w))*(3.123/(y-(z*w))))))\"\n\"(((((3.123/y)+(z/w))-((3.123-y)-(z+w)))-(((3.123+y)/(z-w))/((3.123-y)*(z*w))))-((((3.123-y)-(z+w))+((3.123-y)*(z/w)))+(((3.123-y)*(z*w))*(3.123+((y*z)*w)))))\"\n\"(((((3.123/y)-(z*w))/((3.123-y)*(z+w)))/(((3.123-y)+(z+w))-((3.123*y)*(z+w))))/((((3.123-y)*(z+w))*((3.123/y)*(z+w)))*(((3.123*y)*(z+w))+(3.123+((y/z)/w)))))\"\n\"(((((3.123/y)-(z+w))-((3.123*y)/(z-w)))-(((3.123/y)/(z+w))/(3.123-((y+z)*w))))-((((3.123*y)/(z-w))+(3.123-((y-z)/w)))+((3.123-((y+z)*w))*((3.123/y)+(z/w)))))\"\n\"(((((3.123/y)-(z-w))/(3.123+(y/(z*w))))/((3.123-(y*(z/w)))-(3.123-((y/z)*w))))/(((3.123+(y/(z*w)))*(((3.123+y)*z)-w))*((3.123-((y/z)*w))+(3.123*(y-(z*w))))))\"\n\"(((((3.123/y)-(z/w))*((3.123-y)+(z+w)))*(((3.123-y)-(z+w))+((3.123-y)*(z/w))))*((((3.123-y)+(z+w))-((3.123*y)*(z+w)))-(((3.123-y)*(z/w))/(3.123+((y/z)+w)))))\"\n\"(((((3.123/y)/(z+w))/(3.123-((y+z)*w)))/((3.123-((y+z)/w))-((3.123*y)-(z/w))))/(((3.123-((y+z)*w))*((3.123/y)+(z/w)))*(((3.123*y)-(z/w))+((3.123+y)/(z-w)))))\"\n\"(((((3.123/y)/(z-w))-(3.123-((y-z)*w)))-((3.123-((y-z)/w))/((3.123/y)-(z/w))))-(((3.123-((y-z)*w))+((3.123/y)-(z*w)))+(((3.123/y)-(z/w))*((3.123-y)+(z+w)))))\"\n\"(((((x*5.123)*(z+w))+(x+((5.123/z)/w)))+((x+((5.123/z)+w))*((x*5.123)+(z*w))))+(((x+((5.123/z)/w))/((x*5.123)-(z*w)))/(((x*5.123)+(z*w))-((x+5.123)-(z-w)))))\"\n\"(((((x*5.123)*(z-w))*(x-((5.123*z)/w)))*((x-((5.123-z)*w))+((x/5.123)-(z*w))))*(((x-((5.123*z)/w))-(x/(5.123+(z*w))))-(((x/5.123)-(z*w))/((x-5.123)*(z+w)))))\"\n\"(((((x*5.123)+(z*w))-((x+5.123)-(z-w)))-(((x-5.123)-(z/w))/((x+5.123)/(z*w))))-((((x+5.123)-(z-w))+((x+5.123)/(z/w)))+(((x+5.123)/(z*w))*(x+((5.123+z)*w)))))\"\n\"(((((x*5.123)+(z+w))*((x/5.123)/(z-w)))*(((x*5.123)/(z-w))+(x-((5.123-z)/w))))*((((x/5.123)/(z-w))-(x-((5.123-z)*w)))-((x-((5.123-z)/w))/((x/5.123)-(z/w)))))\"\n\"(((((x*5.123)+(z-w))+((x/5.123)*(z-w)))+(((x*5.123)*(z-w))*(x-((5.123*z)/w))))+((((x/5.123)*(z-w))/(x-((5.123*z)*w)))/((x-((5.123*z)/w))-(x/(5.123+(z*w))))))\"\n\"(((((x*5.123)+(z/w))/((x+5.123)*(z-w)))/(((x+5.123)+(z-w))-((x-5.123)/(z*w))))/((((x+5.123)*(z-w))*((x-5.123)/(z/w)))*(((x-5.123)/(z*w))+(x+((5.123-z)*w)))))\"\n\"(((((x*5.123)-(z*w))*((x+5.123)+(z-w)))*(((x+5.123)-(z-w))+((x+5.123)/(z/w))))*((((x+5.123)+(z-w))-((x-5.123)/(z*w)))-(((x+5.123)/(z/w))/(x+((5.123-z)/w)))))\"\n\"(((((x*5.123)-(z+w))+((x/5.123)/(z+w)))+(((x*5.123)/(z+w))*(x-((5.123+z)/w))))+((((x/5.123)/(z+w))/(x-((5.123+z)*w)))/((x-((5.123+z)/w))-((x*5.123)-(z/w)))))\"\n\"(((((x*5.123)-(z-w))*(x-(5.123*(z/w))))*((x+(5.123*(z/w)))+(x-((5.123/z)/w))))*(((x-(5.123*(z/w)))-(x-((5.123/z)*w)))-((x-((5.123/z)/w))/(x*(5.123+(z*w))))))\"\n\"(((((x*5.123)-(z/w))+((x+5.123)/(z-w)))+(((x+5.123)*(z-w))*((x-5.123)/(z/w))))+((((x+5.123)/(z-w))/((x-5.123)*(z*w)))/(((x-5.123)/(z/w))-(x+((5.123*z)/w)))))\"\n\"(((((x*5.123)/(z+w))*(x-((5.123+z)/w)))*((x+((5.123/z)*w))+((x*5.123)+(z/w))))*(((x-((5.123+z)/w))-((x*5.123)-(z/w)))-(((x*5.123)+(z/w))/((x+5.123)*(z-w)))))\"\n\"(((((x*5.123)/(z-w))+(x-((5.123-z)/w)))+((x-((5.123+z)*w))*((x/5.123)+(z/w))))+(((x-((5.123-z)/w))/((x/5.123)-(z/w)))/(((x/5.123)+(z/w))-((x-5.123)-(z+w)))))\"\n\"(((((x*y)*(7.123+w))+(x+((y/7.123)/w)))+((x+((y/7.123)+w))*((x*y)+(7.123*w))))+(((x+((y/7.123)/w))/((x*y)-(7.123*w)))/(((x*y)+(7.123*w))-((x+y)-(7.123-w)))))\"\n\"(((((x*y)*(7.123-w))*(x-((y*7.123)/w)))*((x-((y-7.123)*w))+((x/y)-(7.123*w))))*(((x-((y*7.123)/w))-(x/(y+(7.123*w))))-(((x/y)-(7.123*w))/((x-y)*(7.123+w)))))\"\n\"(((((x*y)*(z+9.123))+(x+((y/z)/9.123)))+((x+((y/z)+9.123))*((x*y)+(z*9.123))))+(((x+((y/z)/9.123))/((x*y)-(z*9.123)))/(((x*y)+(z*9.123))-((x+y)-(z-9.123)))))\"\n\"(((((x*y)*(z-9.123))*(x-((y*z)/9.123)))*((x-((y-z)*9.123))+((x/y)-(z*9.123))))*(((x-((y*z)/9.123))-(x/(y+(z*9.123))))-(((x/y)-(z*9.123))/((x-y)*(z+9.123)))))\"\n\"(((((x*y)+(7.123*w))-((x+y)-(7.123-w)))-(((x-y)-(7.123/w))/((x+y)/(7.123*w))))-((((x+y)-(7.123-w))+((x+y)/(7.123/w)))+(((x+y)/(7.123*w))*(x+((y+7.123)*w)))))\"\n\"(((((x*y)+(7.123+w))*((x/y)/(7.123-w)))*(((x*y)/(7.123-w))+(x-((y-7.123)/w))))*((((x/y)/(7.123-w))-(x-((y-7.123)*w)))-((x-((y-7.123)/w))/((x/y)-(7.123/w)))))\"\n\"(((((x*y)+(7.123-w))+((x/y)*(7.123-w)))+(((x*y)*(7.123-w))*(x-((y*7.123)/w))))+((((x/y)*(7.123-w))/(x-((y*7.123)*w)))/((x-((y*7.123)/w))-(x/(y+(7.123*w))))))\"\n\"(((((x*y)+(7.123/w))/((x+y)*(7.123-w)))/(((x+y)+(7.123-w))-((x-y)/(7.123*w))))/((((x+y)*(7.123-w))*((x-y)/(7.123/w)))*(((x-y)/(7.123*w))+(x+((y-7.123)*w)))))\"\n\"(((((x*y)+(z*9.123))-((x+y)-(z-9.123)))-(((x-y)-(z/9.123))/((x+y)/(z*9.123))))-((((x+y)-(z-9.123))+((x+y)/(z/9.123)))+(((x+y)/(z*9.123))*(x+((y+z)*9.123)))))\"\n\"(((((x*y)+(z+9.123))*((x/y)/(z-9.123)))*(((x*y)/(z-9.123))+(x-((y-z)/9.123))))*((((x/y)/(z-9.123))-(x-((y-z)*9.123)))-((x-((y-z)/9.123))/((x/y)-(z/9.123)))))\"\n\"(((((x*y)+(z-9.123))+((x/y)*(z-9.123)))+(((x*y)*(z-9.123))*(x-((y*z)/9.123))))+((((x/y)*(z-9.123))/(x-((y*z)*9.123)))/((x-((y*z)/9.123))-(x/(y+(z*9.123))))))\"\n\"(((((x*y)+(z/9.123))/((x+y)*(z-9.123)))/(((x+y)+(z-9.123))-((x-y)/(z*9.123))))/((((x+y)*(z-9.123))*((x-y)/(z/9.123)))*(((x-y)/(z*9.123))+(x+((y-z)*9.123)))))\"\n\"(((((x*y)-(7.123*w))*((x+y)+(7.123-w)))*(((x+y)-(7.123-w))+((x+y)/(7.123/w))))*((((x+y)+(7.123-w))-((x-y)/(7.123*w)))-(((x+y)/(7.123/w))/(x+((y-7.123)/w)))))\"\n\"(((((x*y)-(7.123+w))+((x/y)/(7.123+w)))+(((x*y)/(7.123+w))*(x-((y+7.123)/w))))+((((x/y)/(7.123+w))/(x-((y+7.123)*w)))/((x-((y+7.123)/w))-((x*y)-(7.123/w)))))\"\n\"(((((x*y)-(7.123-w))*(x-(y*(7.123/w))))*((x+(y*(7.123/w)))+(x-((y/7.123)/w))))*(((x-(y*(7.123/w)))-(x-((y/7.123)*w)))-((x-((y/7.123)/w))/(x*(y+(7.123*w))))))\"\n\"(((((x*y)-(7.123/w))+((x+y)/(7.123-w)))+(((x+y)*(7.123-w))*((x-y)/(7.123/w))))+((((x+y)/(7.123-w))/((x-y)*(7.123*w)))/(((x-y)/(7.123/w))-(x+((y*7.123)/w)))))\"\n\"(((((x*y)-(z*9.123))*((x+y)+(z-9.123)))*(((x+y)-(z-9.123))+((x+y)/(z/9.123))))*((((x+y)+(z-9.123))-((x-y)/(z*9.123)))-(((x+y)/(z/9.123))/(x+((y-z)/9.123)))))\"\n\"(((((x*y)-(z+9.123))+((x/y)/(z+9.123)))+(((x*y)/(z+9.123))*(x-((y+z)/9.123))))+((((x/y)/(z+9.123))/(x-((y+z)*9.123)))/((x-((y+z)/9.123))-((x*y)-(z/9.123)))))\"\n\"(((((x*y)-(z-9.123))*(x-(y*(z/9.123))))*((x+(y*(z/9.123)))+(x-((y/z)/9.123))))*(((x-(y*(z/9.123)))-(x-((y/z)*9.123)))-((x-((y/z)/9.123))/(x*(y+(z*9.123))))))\"\n\"(((((x*y)-(z/9.123))+((x+y)/(z-9.123)))+(((x+y)*(z-9.123))*((x-y)/(z/9.123))))+((((x+y)/(z-9.123))/((x-y)*(z*9.123)))/(((x-y)/(z/9.123))-(x+((y*z)/9.123)))))\"\n\"(((((x*y)/(7.123+w))*(x-((y+7.123)/w)))*((x+((y/7.123)*w))+((x*y)+(7.123/w))))*(((x-((y+7.123)/w))-((x*y)-(7.123/w)))-(((x*y)+(7.123/w))/((x+y)*(7.123-w)))))\"\n\"(((((x*y)/(7.123-w))+(x-((y-7.123)/w)))+((x-((y+7.123)*w))*((x/y)+(7.123/w))))+(((x-((y-7.123)/w))/((x/y)-(7.123/w)))/(((x/y)+(7.123/w))-((x-y)-(7.123+w)))))\"\n\"(((((x*y)/(z+9.123))*(x-((y+z)/9.123)))*((x+((y/z)*9.123))+((x*y)+(z/9.123))))*(((x-((y+z)/9.123))-((x*y)-(z/9.123)))-(((x*y)+(z/9.123))/((x+y)*(z-9.123)))))\"\n\"(((((x*y)/(z-9.123))+(x-((y-z)/9.123)))+((x-((y+z)*9.123))*((x/y)+(z/9.123))))+(((x-((y-z)/9.123))/((x/y)-(z/9.123)))/(((x/y)+(z/9.123))-((x-y)-(z+9.123)))))\"\n\"(((((x+5.123)*(z*w))+(x-(5.123/(z*w))))+((x+(5.123/(z*w)))*(((x+5.123)*z)-w)))+(((x-(5.123/(z*w)))/(((x-5.123)*z)-w))/((((x+5.123)*z)-w)-((x+5.123)-(z*w)))))\"\n\"(((((x+5.123)*(z-w))*((x-5.123)/(z/w)))*(((x-5.123)/(z*w))+(x+((5.123-z)*w))))*((((x-5.123)/(z/w))-(x+((5.123*z)/w)))-((x+((5.123-z)*w))/(((x-5.123)/z)-w))))\"\n\"(((((x+5.123)*(z/w))-(x+((5.123+z)/w)))-((x-(5.123/(z*w)))/(((x-5.123)*z)-w)))-(((x+((5.123+z)/w))+(((x*5.123)*z)-w))+((((x-5.123)*z)-w)*((x+5.123)-(z/w)))))\"\n\"(((((x+5.123)+(z*w))*((x/5.123)+(z-w)))*(((x*5.123)+(z-w))+((x/5.123)*(z-w))))*((((x/5.123)+(z-w))-(x+(5.123*(z/w))))-(((x/5.123)*(z-w))/(x-((5.123*z)*w)))))\"\n\"(((((x+5.123)+(z-w))-((x-5.123)/(z*w)))-(((x+5.123)/(z/w))/(x+((5.123-z)/w))))-((((x-5.123)/(z*w))+(x+((5.123-z)*w)))+((x+((5.123-z)/w))*(((x+5.123)/z)-w))))\"\n\"(((((x+5.123)+(z/w))/((x*5.123)-(z-w)))/(((x/5.123)+(z-w))-(x+(5.123*(z/w)))))/((((x*5.123)-(z-w))*(x-(5.123*(z/w))))*((x+(5.123*(z/w)))+(x-((5.123/z)/w)))))\"\n\"(((((x+5.123)-(z*w))+((x/5.123)+(z+w)))+(((x*5.123)+(z+w))*((x/5.123)/(z-w))))+((((x/5.123)+(z+w))/((x*5.123)*(z-w)))/(((x/5.123)/(z-w))-(x-((5.123-z)*w)))))\"\n\"(((((x+5.123)-(z-w))+((x+5.123)/(z/w)))+(((x+5.123)/(z*w))*(x+((5.123+z)*w))))+((((x+5.123)/(z/w))/(x+((5.123-z)/w)))/((x+((5.123+z)*w))-(((x/5.123)*z)-w))))\"\n\"(((((x+5.123)-(z/w))-((x*5.123)+(z-w)))-(((x/5.123)+(z+w))/((x*5.123)*(z-w))))-((((x*5.123)+(z-w))+((x/5.123)*(z-w)))+(((x*5.123)*(z-w))*(x-((5.123*z)/w)))))\"\n\"(((((x+5.123)/(z*w))*(x+((5.123+z)*w)))*((x+((5.123+z)/w))+(((x*5.123)*z)-w)))*(((x+((5.123+z)*w))-(((x/5.123)*z)-w))-((((x*5.123)*z)-w)/((x+5.123)+(z*w)))))\"\n\"(((((x+5.123)/(z-w))/((x-5.123)*(z*w)))/(((x-5.123)/(z/w))-(x+((5.123*z)/w))))/((((x-5.123)*(z*w))*(x+((5.123*z)*w)))*((x+((5.123*z)/w))+(((x*5.123)/z)-w))))\"\n\"(((((x+5.123)/(z/w))/(x+((5.123-z)/w)))/((x+((5.123+z)*w))-(((x/5.123)*z)-w)))/(((x+((5.123-z)/w))*(((x+5.123)/z)-w))*((((x/5.123)*z)-w)+((x+5.123)+(z/w)))))\"\n\"(((((x+y)*(7.123*w))+(x-(y/(7.123*w))))+((x+(y/(7.123*w)))*(((x+y)*7.123)-w)))+(((x-(y/(7.123*w)))/(((x-y)*7.123)-w))/((((x+y)*7.123)-w)-((x+y)-(7.123*w)))))\"\n\"(((((x+y)*(7.123-w))*((x-y)/(7.123/w)))*(((x-y)/(7.123*w))+(x+((y-7.123)*w))))*((((x-y)/(7.123/w))-(x+((y*7.123)/w)))-((x+((y-7.123)*w))/(((x-y)/7.123)-w))))\"\n\"(((((x+y)*(7.123/w))-(x+((y+7.123)/w)))-((x-(y/(7.123*w)))/(((x-y)*7.123)-w)))-(((x+((y+7.123)/w))+(((x*y)*7.123)-w))+((((x-y)*7.123)-w)*((x+y)-(7.123/w)))))\"\n\"(((((x+y)*(z*9.123))+(x-(y/(z*9.123))))+((x+(y/(z*9.123)))*(((x+y)*z)-9.123)))+(((x-(y/(z*9.123)))/(((x-y)*z)-9.123))/((((x+y)*z)-9.123)-((x+y)-(z*9.123)))))\"\n\"(((((x+y)*(z-9.123))*((x-y)/(z/9.123)))*(((x-y)/(z*9.123))+(x+((y-z)*9.123))))*((((x-y)/(z/9.123))-(x+((y*z)/9.123)))-((x+((y-z)*9.123))/(((x-y)/z)-9.123))))\"\n\"(((((x+y)*(z/9.123))-(x+((y+z)/9.123)))-((x-(y/(z*9.123)))/(((x-y)*z)-9.123)))-(((x+((y+z)/9.123))+(((x*y)*z)-9.123))+((((x-y)*z)-9.123)*((x+y)-(z/9.123)))))\"\n\"(((((x+y)+(7.123*w))*((x/y)+(7.123-w)))*(((x*y)+(7.123-w))+((x/y)*(7.123-w))))*((((x/y)+(7.123-w))-(x+(y*(7.123/w))))-(((x/y)*(7.123-w))/(x-((y*7.123)*w)))))\"\n\"(((((x+y)+(7.123-w))-((x-y)/(7.123*w)))-(((x+y)/(7.123/w))/(x+((y-7.123)/w))))-((((x-y)/(7.123*w))+(x+((y-7.123)*w)))+((x+((y-7.123)/w))*(((x+y)/7.123)-w))))\"\n\"(((((x+y)+(7.123/w))/((x*y)-(7.123-w)))/(((x/y)+(7.123-w))-(x+(y*(7.123/w)))))/((((x*y)-(7.123-w))*(x-(y*(7.123/w))))*((x+(y*(7.123/w)))+(x-((y/7.123)/w)))))\"\n\"(((((x+y)+(z*9.123))*((x/y)+(z-9.123)))*(((x*y)+(z-9.123))+((x/y)*(z-9.123))))*((((x/y)+(z-9.123))-(x+(y*(z/9.123))))-(((x/y)*(z-9.123))/(x-((y*z)*9.123)))))\"\n\"(((((x+y)+(z-9.123))-((x-y)/(z*9.123)))-(((x+y)/(z/9.123))/(x+((y-z)/9.123))))-((((x-y)/(z*9.123))+(x+((y-z)*9.123)))+((x+((y-z)/9.123))*(((x+y)/z)-9.123))))\"\n\"(((((x+y)+(z/9.123))/((x*y)-(z-9.123)))/(((x/y)+(z-9.123))-(x+(y*(z/9.123)))))/((((x*y)-(z-9.123))*(x-(y*(z/9.123))))*((x+(y*(z/9.123)))+(x-((y/z)/9.123)))))\"\n\"(((((x+y)-(7.123*w))+((x/y)+(7.123+w)))+(((x*y)+(7.123+w))*((x/y)/(7.123-w))))+((((x/y)+(7.123+w))/((x*y)*(7.123-w)))/(((x/y)/(7.123-w))-(x-((y-7.123)*w)))))\"\n\"(((((x+y)-(7.123-w))+((x+y)/(7.123/w)))+(((x+y)/(7.123*w))*(x+((y+7.123)*w))))+((((x+y)/(7.123/w))/(x+((y-7.123)/w)))/((x+((y+7.123)*w))-(((x/y)*7.123)-w))))\"\n\"(((((x+y)-(7.123/w))-((x*y)+(7.123-w)))-(((x/y)+(7.123+w))/((x*y)*(7.123-w))))-((((x*y)+(7.123-w))+((x/y)*(7.123-w)))+(((x*y)*(7.123-w))*(x-((y*7.123)/w)))))\"\n\"(((((x+y)-(z*9.123))+((x/y)+(z+9.123)))+(((x*y)+(z+9.123))*((x/y)/(z-9.123))))+((((x/y)+(z+9.123))/((x*y)*(z-9.123)))/(((x/y)/(z-9.123))-(x-((y-z)*9.123)))))\"\n\"(((((x+y)-(z-9.123))+((x+y)/(z/9.123)))+(((x+y)/(z*9.123))*(x+((y+z)*9.123))))+((((x+y)/(z/9.123))/(x+((y-z)/9.123)))/((x+((y+z)*9.123))-(((x/y)*z)-9.123))))\"\n\"(((((x+y)-(z/9.123))-((x*y)+(z-9.123)))-(((x/y)+(z+9.123))/((x*y)*(z-9.123))))-((((x*y)+(z-9.123))+((x/y)*(z-9.123)))+(((x*y)*(z-9.123))*(x-((y*z)/9.123)))))\"\n\"(((((x+y)/(7.123*w))*(x+((y+7.123)*w)))*((x+((y+7.123)/w))+(((x*y)*7.123)-w)))*(((x+((y+7.123)*w))-(((x/y)*7.123)-w))-((((x*y)*7.123)-w)/((x+y)+(7.123*w)))))\"\n\"(((((x+y)/(7.123-w))/((x-y)*(7.123*w)))/(((x-y)/(7.123/w))-(x+((y*7.123)/w))))/((((x-y)*(7.123*w))*(x+((y*7.123)*w)))*((x+((y*7.123)/w))+(((x*y)/7.123)-w))))\"\n\"(((((x+y)/(7.123/w))/(x+((y-7.123)/w)))/((x+((y+7.123)*w))-(((x/y)*7.123)-w)))/(((x+((y-7.123)/w))*(((x+y)/7.123)-w))*((((x/y)*7.123)-w)+((x+y)+(7.123/w)))))\"\n\"(((((x+y)/(z*9.123))*(x+((y+z)*9.123)))*((x+((y+z)/9.123))+(((x*y)*z)-9.123)))*(((x+((y+z)*9.123))-(((x/y)*z)-9.123))-((((x*y)*z)-9.123)/((x+y)+(z*9.123)))))\"\n\"(((((x+y)/(z-9.123))/((x-y)*(z*9.123)))/(((x-y)/(z/9.123))-(x+((y*z)/9.123))))/((((x-y)*(z*9.123))*(x+((y*z)*9.123)))*((x+((y*z)/9.123))+(((x*y)/z)-9.123))))\"\n\"(((((x+y)/(z/9.123))/(x+((y-z)/9.123)))/((x+((y+z)*9.123))-(((x/y)*z)-9.123)))/(((x+((y-z)/9.123))*(((x+y)/z)-9.123))*((((x/y)*z)-9.123)+((x+y)+(z/9.123)))))\"\n\"(((((x-5.123)*(z*w))*(x+((5.123*z)*w)))*((x+((5.123*z)/w))+(((x*5.123)/z)-w)))*(((x+((5.123*z)*w))-(((x/5.123)/z)-w))-((((x*5.123)/z)-w)/((x-5.123)-(z*w)))))\"\n\"(((((x-5.123)*(z+w))*((x/5.123)*(z+w)))*(((x*5.123)*(z+w))+(x+((5.123/z)/w))))*((((x/5.123)*(z+w))-(x+((5.123/z)*w)))-((x+((5.123/z)/w))/((x*5.123)-(z*w)))))\"\n\"(((((x-5.123)*(z/w))/(x+((5.123/z)+w)))/((x+((5.123*z)*w))-(((x/5.123)/z)-w)))/(((x+((5.123/z)+w))*((x*5.123)+(z*w)))*((((x/5.123)/z)-w)+((x-5.123)-(z/w)))))\"\n\"(((((x-5.123)+(z*w))+((x/5.123)-(z-w)))+(((x*5.123)-(z-w))*(x-(5.123*(z/w)))))+((((x/5.123)-(z-w))/(x+(5.123/(z*w))))/((x-(5.123*(z/w)))-(x-((5.123/z)*w)))))\"\n\"(((((x-5.123)+(z+w))-((x*5.123)*(z+w)))-(((x-5.123)*(z/w))/(x+((5.123/z)+w))))-((((x*5.123)*(z+w))+(x+((5.123/z)/w)))+((x+((5.123/z)+w))*((x*5.123)+(z*w)))))\"\n\"(((((x-5.123)+(z/w))-((x+5.123)*(z*w)))-(((x/5.123)-(z-w))/(x+(5.123/(z*w)))))-((((x+5.123)*(z*w))+(x-(5.123/(z*w))))+((x+(5.123/(z*w)))*(((x+5.123)*z)-w))))\"\n\"(((((x-5.123)-(z*w))*((x+5.123)*(z/w)))*(((x+5.123)*(z*w))+(x-(5.123/(z*w)))))*((((x+5.123)*(z/w))-(x+((5.123+z)/w)))-((x-(5.123/(z*w)))/(((x-5.123)*z)-w))))\"\n\"(((((x-5.123)-(z+w))+((x-5.123)*(z/w)))+(((x-5.123)*(z*w))*(x+((5.123*z)*w))))+((((x-5.123)*(z/w))/(x+((5.123/z)+w)))/((x+((5.123*z)*w))-(((x/5.123)/z)-w))))\"\n\"(((((x-5.123)-(z/w))/((x+5.123)/(z*w)))/(((x+5.123)*(z/w))-(x+((5.123+z)/w))))/((((x+5.123)/(z*w))*(x+((5.123+z)*w)))*((x+((5.123+z)/w))+(((x*5.123)*z)-w))))\"\n\"(((((x-5.123)/(z*w))+(x+((5.123-z)*w)))+((x+((5.123-z)/w))*(((x+5.123)/z)-w)))+(((x+((5.123-z)*w))/(((x-5.123)/z)-w))/((((x+5.123)/z)-w)-((x-5.123)+(z*w)))))\"\n\"(((((x-5.123)/(z+w))/((x*5.123)/(z+w)))/(((x/5.123)*(z+w))-(x+((5.123/z)*w))))/((((x*5.123)/(z+w))*(x-((5.123+z)/w)))*((x+((5.123/z)*w))+((x*5.123)+(z/w)))))\"\n\"(((((x-5.123)/(z/w))-(x+((5.123*z)/w)))-((x+((5.123-z)*w))/(((x-5.123)/z)-w)))-(((x+((5.123*z)/w))+(((x*5.123)/z)-w))+((((x-5.123)/z)-w)*((x-5.123)+(z/w)))))\"\n\"(((((x-y)*(7.123*w))*(x+((y*7.123)*w)))*((x+((y*7.123)/w))+(((x*y)/7.123)-w)))*(((x+((y*7.123)*w))-(((x/y)/7.123)-w))-((((x*y)/7.123)-w)/((x-y)-(7.123*w)))))\"\n\"(((((x-y)*(7.123+w))*((x/y)*(7.123+w)))*(((x*y)*(7.123+w))+(x+((y/7.123)/w))))*((((x/y)*(7.123+w))-(x+((y/7.123)*w)))-((x+((y/7.123)/w))/((x*y)-(7.123*w)))))\"\n\"(((((x-y)*(7.123/w))/(x+((y/7.123)+w)))/((x+((y*7.123)*w))-(((x/y)/7.123)-w)))/(((x+((y/7.123)+w))*((x*y)+(7.123*w)))*((((x/y)/7.123)-w)+((x-y)-(7.123/w)))))\"\n\"(((((x-y)*(z*9.123))*(x+((y*z)*9.123)))*((x+((y*z)/9.123))+(((x*y)/z)-9.123)))*(((x+((y*z)*9.123))-(((x/y)/z)-9.123))-((((x*y)/z)-9.123)/((x-y)-(z*9.123)))))\"\n\"(((((x-y)*(z+9.123))*((x/y)*(z+9.123)))*(((x*y)*(z+9.123))+(x+((y/z)/9.123))))*((((x/y)*(z+9.123))-(x+((y/z)*9.123)))-((x+((y/z)/9.123))/((x*y)-(z*9.123)))))\"\n\"(((((x-y)*(z/9.123))/(x+((y/z)+9.123)))/((x+((y*z)*9.123))-(((x/y)/z)-9.123)))/(((x+((y/z)+9.123))*((x*y)+(z*9.123)))*((((x/y)/z)-9.123)+((x-y)-(z/9.123)))))\"\n\"(((((x-y)+(7.123*w))+((x/y)-(7.123-w)))+(((x*y)-(7.123-w))*(x-(y*(7.123/w)))))+((((x/y)-(7.123-w))/(x+(y/(7.123*w))))/((x-(y*(7.123/w)))-(x-((y/7.123)*w)))))\"\n\"(((((x-y)+(7.123+w))-((x*y)*(7.123+w)))-(((x-y)*(7.123/w))/(x+((y/7.123)+w))))-((((x*y)*(7.123+w))+(x+((y/7.123)/w)))+((x+((y/7.123)+w))*((x*y)+(7.123*w)))))\"\n\"(((((x-y)+(7.123/w))-((x+y)*(7.123*w)))-(((x/y)-(7.123-w))/(x+(y/(7.123*w)))))-((((x+y)*(7.123*w))+(x-(y/(7.123*w))))+((x+(y/(7.123*w)))*(((x+y)*7.123)-w))))\"\n\"(((((x-y)+(z*9.123))+((x/y)-(z-9.123)))+(((x*y)-(z-9.123))*(x-(y*(z/9.123)))))+((((x/y)-(z-9.123))/(x+(y/(z*9.123))))/((x-(y*(z/9.123)))-(x-((y/z)*9.123)))))\"\n\"(((((x-y)+(z+9.123))-((x*y)*(z+9.123)))-(((x-y)*(z/9.123))/(x+((y/z)+9.123))))-((((x*y)*(z+9.123))+(x+((y/z)/9.123)))+((x+((y/z)+9.123))*((x*y)+(z*9.123)))))\"\n\"(((((x-y)+(z/9.123))-((x+y)*(z*9.123)))-(((x/y)-(z-9.123))/(x+(y/(z*9.123)))))-((((x+y)*(z*9.123))+(x-(y/(z*9.123))))+((x+(y/(z*9.123)))*(((x+y)*z)-9.123))))\"\n\"(((((x-y)-(7.123*w))*((x+y)*(7.123/w)))*(((x+y)*(7.123*w))+(x-(y/(7.123*w)))))*((((x+y)*(7.123/w))-(x+((y+7.123)/w)))-((x-(y/(7.123*w)))/(((x-y)*7.123)-w))))\"\n\"(((((x-y)-(7.123+w))+((x-y)*(7.123/w)))+(((x-y)*(7.123*w))*(x+((y*7.123)*w))))+((((x-y)*(7.123/w))/(x+((y/7.123)+w)))/((x+((y*7.123)*w))-(((x/y)/7.123)-w))))\"\n\"(((((x-y)-(7.123/w))/((x+y)/(7.123*w)))/(((x+y)*(7.123/w))-(x+((y+7.123)/w))))/((((x+y)/(7.123*w))*(x+((y+7.123)*w)))*((x+((y+7.123)/w))+(((x*y)*7.123)-w))))\"\n\"(((((x-y)-(z*9.123))*((x+y)*(z/9.123)))*(((x+y)*(z*9.123))+(x-(y/(z*9.123)))))*((((x+y)*(z/9.123))-(x+((y+z)/9.123)))-((x-(y/(z*9.123)))/(((x-y)*z)-9.123))))\"\n\"(((((x-y)-(z+9.123))+((x-y)*(z/9.123)))+(((x-y)*(z*9.123))*(x+((y*z)*9.123))))+((((x-y)*(z/9.123))/(x+((y/z)+9.123)))/((x+((y*z)*9.123))-(((x/y)/z)-9.123))))\"\n\"(((((x-y)-(z/9.123))/((x+y)/(z*9.123)))/(((x+y)*(z/9.123))-(x+((y+z)/9.123))))/((((x+y)/(z*9.123))*(x+((y+z)*9.123)))*((x+((y+z)/9.123))+(((x*y)*z)-9.123))))\"\n\"(((((x-y)/(7.123*w))+(x+((y-7.123)*w)))+((x+((y-7.123)/w))*(((x+y)/7.123)-w)))+(((x+((y-7.123)*w))/(((x-y)/7.123)-w))/((((x+y)/7.123)-w)-((x-y)+(7.123*w)))))\"\n\"(((((x-y)/(7.123+w))/((x*y)/(7.123+w)))/(((x/y)*(7.123+w))-(x+((y/7.123)*w))))/((((x*y)/(7.123+w))*(x-((y+7.123)/w)))*((x+((y/7.123)*w))+((x*y)+(7.123/w)))))\"\n\"(((((x-y)/(7.123/w))-(x+((y*7.123)/w)))-((x+((y-7.123)*w))/(((x-y)/7.123)-w)))-(((x+((y*7.123)/w))+(((x*y)/7.123)-w))+((((x-y)/7.123)-w)*((x-y)+(7.123/w)))))\"\n\"(((((x-y)/(z*9.123))+(x+((y-z)*9.123)))+((x+((y-z)/9.123))*(((x+y)/z)-9.123)))+(((x+((y-z)*9.123))/(((x-y)/z)-9.123))/((((x+y)/z)-9.123)-((x-y)+(z*9.123)))))\"\n\"(((((x-y)/(z+9.123))/((x*y)/(z+9.123)))/(((x/y)*(z+9.123))-(x+((y/z)*9.123))))/((((x*y)/(z+9.123))*(x-((y+z)/9.123)))*((x+((y/z)*9.123))+((x*y)+(z/9.123)))))\"\n\"(((((x-y)/(z/9.123))-(x+((y*z)/9.123)))-((x+((y-z)*9.123))/(((x-y)/z)-9.123)))-(((x+((y*z)/9.123))+(((x*y)/z)-9.123))+((((x-y)/z)-9.123)*((x-y)+(z/9.123)))))\"\n\"(((((x/5.123)*(z+w))-(x+((5.123/z)*w)))-((x+((5.123/z)/w))/((x*5.123)-(z*w))))-(((x+((5.123/z)*w))+((x*5.123)+(z/w)))+(((x*5.123)-(z*w))*((x+5.123)+(z-w)))))\"\n\"(((((x/5.123)*(z-w))/(x-((5.123*z)*w)))/((x-((5.123*z)/w))-(x/(5.123+(z*w)))))/(((x-((5.123*z)*w))*(x/(5.123-(z*w))))*((x/(5.123+(z*w)))+((x-5.123)/(z+w)))))\"\n\"(((((x/5.123)+(z+w))/((x*5.123)*(z-w)))/(((x/5.123)/(z-w))-(x-((5.123-z)*w))))/((((x*5.123)*(z-w))*(x-((5.123*z)/w)))*((x-((5.123-z)*w))+((x/5.123)-(z*w)))))\"\n\"(((((x/5.123)+(z-w))-(x+(5.123*(z/w))))-(((x/5.123)*(z-w))/(x-((5.123*z)*w))))-(((x+(5.123*(z/w)))+(x-((5.123/z)/w)))+((x-((5.123*z)*w))*(x/(5.123-(z*w))))))\"\n\"(((((x/5.123)+(z/w))-((x-5.123)-(z+w)))-(((x+5.123)/(z-w))/((x-5.123)*(z*w))))-((((x-5.123)-(z+w))+((x-5.123)*(z/w)))+(((x-5.123)*(z*w))*(x+((5.123*z)*w)))))\"\n\"(((((x/5.123)-(z*w))/((x-5.123)*(z+w)))/(((x-5.123)+(z+w))-((x*5.123)*(z+w))))/((((x-5.123)*(z+w))*((x/5.123)*(z+w)))*(((x*5.123)*(z+w))+(x+((5.123/z)/w)))))\"\n\"(((((x/5.123)-(z+w))-((x*5.123)/(z-w)))-(((x/5.123)/(z+w))/(x-((5.123+z)*w))))-((((x*5.123)/(z-w))+(x-((5.123-z)/w)))+((x-((5.123+z)*w))*((x/5.123)+(z/w)))))\"\n\"(((((x/5.123)-(z-w))/(x+(5.123/(z*w))))/((x-(5.123*(z/w)))-(x-((5.123/z)*w))))/(((x+(5.123/(z*w)))*(((x+5.123)*z)-w))*((x-((5.123/z)*w))+(x*(5.123-(z*w))))))\"\n\"(((((x/5.123)-(z/w))*((x-5.123)+(z+w)))*(((x-5.123)-(z+w))+((x-5.123)*(z/w))))*((((x-5.123)+(z+w))-((x*5.123)*(z+w)))-(((x-5.123)*(z/w))/(x+((5.123/z)+w)))))\"\n\"(((((x/5.123)/(z+w))/(x-((5.123+z)*w)))/((x-((5.123+z)/w))-((x*5.123)-(z/w))))/(((x-((5.123+z)*w))*((x/5.123)+(z/w)))*(((x*5.123)-(z/w))+((x+5.123)/(z-w)))))\"\n\"(((((x/5.123)/(z-w))-(x-((5.123-z)*w)))-((x-((5.123-z)/w))/((x/5.123)-(z/w))))-(((x-((5.123-z)*w))+((x/5.123)-(z*w)))+(((x/5.123)-(z/w))*((x-5.123)+(z+w)))))\"\n\"(((((x/y)*(7.123+w))-(x+((y/7.123)*w)))-((x+((y/7.123)/w))/((x*y)-(7.123*w))))-(((x+((y/7.123)*w))+((x*y)+(7.123/w)))+(((x*y)-(7.123*w))*((x+y)+(7.123-w)))))\"\n\"(((((x/y)*(7.123-w))/(x-((y*7.123)*w)))/((x-((y*7.123)/w))-(x/(y+(7.123*w)))))/(((x-((y*7.123)*w))*(x/(y-(7.123*w))))*((x/(y+(7.123*w)))+((x-y)/(7.123+w)))))\"\n\"(((((x/y)*(z+9.123))-(x+((y/z)*9.123)))-((x+((y/z)/9.123))/((x*y)-(z*9.123))))-(((x+((y/z)*9.123))+((x*y)+(z/9.123)))+(((x*y)-(z*9.123))*((x+y)+(z-9.123)))))\"\n\"(((((x/y)*(z-9.123))/(x-((y*z)*9.123)))/((x-((y*z)/9.123))-(x/(y+(z*9.123)))))/(((x-((y*z)*9.123))*(x/(y-(z*9.123))))*((x/(y+(z*9.123)))+((x-y)/(z+9.123)))))\"\n\"(((((x/y)+(7.123+w))/((x*y)*(7.123-w)))/(((x/y)/(7.123-w))-(x-((y-7.123)*w))))/((((x*y)*(7.123-w))*(x-((y*7.123)/w)))*((x-((y-7.123)*w))+((x/y)-(7.123*w)))))\"\n\"(((((x/y)+(7.123-w))-(x+(y*(7.123/w))))-(((x/y)*(7.123-w))/(x-((y*7.123)*w))))-(((x+(y*(7.123/w)))+(x-((y/7.123)/w)))+((x-((y*7.123)*w))*(x/(y-(7.123*w))))))\"\n\"(((((x/y)+(7.123/w))-((x-y)-(7.123+w)))-(((x+y)/(7.123-w))/((x-y)*(7.123*w))))-((((x-y)-(7.123+w))+((x-y)*(7.123/w)))+(((x-y)*(7.123*w))*(x+((y*7.123)*w)))))\"\n\"(((((x/y)+(z+9.123))/((x*y)*(z-9.123)))/(((x/y)/(z-9.123))-(x-((y-z)*9.123))))/((((x*y)*(z-9.123))*(x-((y*z)/9.123)))*((x-((y-z)*9.123))+((x/y)-(z*9.123)))))\"\n\"(((((x/y)+(z-9.123))-(x+(y*(z/9.123))))-(((x/y)*(z-9.123))/(x-((y*z)*9.123))))-(((x+(y*(z/9.123)))+(x-((y/z)/9.123)))+((x-((y*z)*9.123))*(x/(y-(z*9.123))))))\"\n\"(((((x/y)+(z/9.123))-((x-y)-(z+9.123)))-(((x+y)/(z-9.123))/((x-y)*(z*9.123))))-((((x-y)-(z+9.123))+((x-y)*(z/9.123)))+(((x-y)*(z*9.123))*(x+((y*z)*9.123)))))\"\n\"(((((x/y)-(7.123*w))/((x-y)*(7.123+w)))/(((x-y)+(7.123+w))-((x*y)*(7.123+w))))/((((x-y)*(7.123+w))*((x/y)*(7.123+w)))*(((x*y)*(7.123+w))+(x+((y/7.123)/w)))))\"\n\"(((((x/y)-(7.123+w))-((x*y)/(7.123-w)))-(((x/y)/(7.123+w))/(x-((y+7.123)*w))))-((((x*y)/(7.123-w))+(x-((y-7.123)/w)))+((x-((y+7.123)*w))*((x/y)+(7.123/w)))))\"\n\"(((((x/y)-(7.123-w))/(x+(y/(7.123*w))))/((x-(y*(7.123/w)))-(x-((y/7.123)*w))))/(((x+(y/(7.123*w)))*(((x+y)*7.123)-w))*((x-((y/7.123)*w))+(x*(y-(7.123*w))))))\"\n\"(((((x/y)-(7.123/w))*((x-y)+(7.123+w)))*(((x-y)-(7.123+w))+((x-y)*(7.123/w))))*((((x-y)+(7.123+w))-((x*y)*(7.123+w)))-(((x-y)*(7.123/w))/(x+((y/7.123)+w)))))\"\n\"(((((x/y)-(z*9.123))/((x-y)*(z+9.123)))/(((x-y)+(z+9.123))-((x*y)*(z+9.123))))/((((x-y)*(z+9.123))*((x/y)*(z+9.123)))*(((x*y)*(z+9.123))+(x+((y/z)/9.123)))))\"\n\"(((((x/y)-(z+9.123))-((x*y)/(z-9.123)))-(((x/y)/(z+9.123))/(x-((y+z)*9.123))))-((((x*y)/(z-9.123))+(x-((y-z)/9.123)))+((x-((y+z)*9.123))*((x/y)+(z/9.123)))))\"\n\"(((((x/y)-(z-9.123))/(x+(y/(z*9.123))))/((x-(y*(z/9.123)))-(x-((y/z)*9.123))))/(((x+(y/(z*9.123)))*(((x+y)*z)-9.123))*((x-((y/z)*9.123))+(x*(y-(z*9.123))))))\"\n\"(((((x/y)-(z/9.123))*((x-y)+(z+9.123)))*(((x-y)-(z+9.123))+((x-y)*(z/9.123))))*((((x-y)+(z+9.123))-((x*y)*(z+9.123)))-(((x-y)*(z/9.123))/(x+((y/z)+9.123)))))\"\n\"(((((x/y)/(7.123+w))/(x-((y+7.123)*w)))/((x-((y+7.123)/w))-((x*y)-(7.123/w))))/(((x-((y+7.123)*w))*((x/y)+(7.123/w)))*(((x*y)-(7.123/w))+((x+y)/(7.123-w)))))\"\n\"(((((x/y)/(7.123-w))-(x-((y-7.123)*w)))-((x-((y-7.123)/w))/((x/y)-(7.123/w))))-(((x-((y-7.123)*w))+((x/y)-(7.123*w)))+(((x/y)-(7.123/w))*((x-y)+(7.123+w)))))\"\n\"(((((x/y)/(z+9.123))/(x-((y+z)*9.123)))/((x-((y+z)/9.123))-((x*y)-(z/9.123))))/(((x-((y+z)*9.123))*((x/y)+(z/9.123)))*(((x*y)-(z/9.123))+((x+y)/(z-9.123)))))\"\n\"(((((x/y)/(z-9.123))-(x-((y-z)*9.123)))-((x-((y-z)/9.123))/((x/y)-(z/9.123))))-(((x-((y-z)*9.123))+((x/y)-(z*9.123)))+(((x/y)-(z/9.123))*((x-y)+(z+9.123)))))\"\n\"((((3.123*(y+(z*w)))*((3.123/y)-(z+w)))*(((3.123*y)-(z+w))+((3.123/y)/(z+w))))*((((3.123/y)-(z+w))-((3.123*y)/(z-w)))-(((3.123/y)/(z+w))/(3.123-((y+z)*w)))))\"\n\"((((3.123*(y-(z*w)))/((3.123*y)+(z+w)))/(((3.123/y)-(z+w))-((3.123*y)/(z-w))))/((((3.123*y)+(z+w))*((3.123/y)/(z-w)))*(((3.123*y)/(z-w))+(3.123-((y-z)/w)))))\"\n\"((((3.123+((y*z)*w))-(((3.123/y)/z)-w))-((((3.123*y)/z)-w)/((3.123-y)-(z*w))))-(((((3.123/y)/z)-w)+((3.123-y)-(z/w)))+(((3.123-y)-(z*w))*((3.123+y)*(z/w)))))\"\n\"((((3.123+((y*z)/w))+(((3.123*y)/z)-w))+((((3.123-y)/z)-w)*((3.123-y)+(z/w))))+(((((3.123*y)/z)-w)/((3.123-y)-(z*w)))/(((3.123-y)+(z/w))-((3.123+y)*(z*w)))))\"\n\"((((3.123+((y+z)*w))-(((3.123/y)*z)-w))-((((3.123*y)*z)-w)/((3.123+y)+(z*w))))-(((((3.123/y)*z)-w)+((3.123+y)+(z/w)))+(((3.123+y)+(z*w))*((3.123/y)+(z-w)))))\"\n\"((((3.123+((y+z)/w))+(((3.123*y)*z)-w))+((((3.123-y)*z)-w)*((3.123+y)-(z/w))))+(((((3.123*y)*z)-w)/((3.123+y)+(z*w)))/(((3.123+y)-(z/w))-((3.123*y)+(z-w)))))\"\n\"((((3.123+((y-z)*w))/(((3.123-y)/z)-w))/((((3.123+y)/z)-w)-((3.123-y)+(z*w))))/(((((3.123-y)/z)-w)*((3.123-y)+(z/w)))*(((3.123-y)+(z*w))+((3.123/y)-(z-w)))))\"\n\"((((3.123+((y-z)/w))*(((3.123+y)/z)-w))*((((3.123/y)*z)-w)+((3.123+y)+(z/w))))*(((((3.123+y)/z)-w)-((3.123-y)+(z*w)))-(((3.123+y)+(z/w))/((3.123*y)-(z-w)))))\"\n\"((((3.123+((y/z)*w))+((3.123*y)+(z/w)))+(((3.123*y)-(z*w))*((3.123+y)+(z-w))))+((((3.123*y)+(z/w))/((3.123+y)*(z-w)))/(((3.123+y)+(z-w))-((3.123-y)/(z*w)))))\"\n\"((((3.123+((y/z)+w))*((3.123*y)+(z*w)))*((((3.123/y)/z)-w)+((3.123-y)-(z/w))))*((((3.123*y)+(z*w))-((3.123+y)-(z-w)))-(((3.123-y)-(z/w))/((3.123+y)/(z*w)))))\"\n\"((((3.123+((y/z)/w))/((3.123*y)-(z*w)))/(((3.123*y)+(z*w))-((3.123+y)-(z-w))))/((((3.123*y)-(z*w))*((3.123+y)+(z-w)))*(((3.123+y)-(z-w))+((3.123+y)/(z/w)))))\"\n\"((((3.123+(y*(z/w)))+(3.123-((y/z)/w)))+((3.123-((y*z)*w))*(3.123/(y-(z*w)))))+(((3.123-((y/z)/w))/(3.123*(y+(z*w))))/((3.123/(y-(z*w)))-((3.123*y)-(z+w)))))\"\n\"((((3.123+(y/(z*w)))*(((3.123+y)*z)-w))*((3.123-((y/z)*w))+(3.123*(y-(z*w)))))*(((((3.123+y)*z)-w)-((3.123+y)-(z*w)))-((3.123*(y-(z*w)))/((3.123*y)+(z+w)))))\"\n\"((((3.123-((y*z)*w))*(3.123/(y-(z*w))))*((3.123/(y+(z*w)))+((3.123-y)/(z+w))))*(((3.123/(y-(z*w)))-((3.123*y)-(z+w)))-(((3.123-y)/(z+w))/((3.123*y)/(z+w)))))\"\n\"((((3.123-((y*z)/w))-(3.123/(y+(z*w))))-(((3.123/y)-(z*w))/((3.123-y)*(z+w))))-(((3.123/(y+(z*w)))+((3.123-y)/(z+w)))+(((3.123-y)*(z+w))*((3.123/y)*(z+w)))))\"\n\"((((3.123-((y+z)*w))*((3.123/y)+(z/w)))*(((3.123*y)-(z/w))+((3.123+y)/(z-w))))*((((3.123/y)+(z/w))-((3.123-y)-(z+w)))-(((3.123+y)/(z-w))/((3.123-y)*(z*w)))))\"\n\"((((3.123-((y+z)/w))-((3.123*y)-(z/w)))-(((3.123*y)+(z/w))/((3.123+y)*(z-w))))-((((3.123*y)-(z/w))+((3.123+y)/(z-w)))+(((3.123+y)*(z-w))*((3.123-y)/(z/w)))))\"\n\"((((3.123-((y-z)*w))+((3.123/y)-(z*w)))+(((3.123/y)-(z/w))*((3.123-y)+(z+w))))+((((3.123/y)-(z*w))/((3.123-y)*(z+w)))/(((3.123-y)+(z+w))-((3.123*y)*(z+w)))))\"\n\"((((3.123-((y-z)/w))/((3.123/y)-(z/w)))/(((3.123/y)+(z/w))-((3.123-y)-(z+w))))/((((3.123/y)-(z/w))*((3.123-y)+(z+w)))*(((3.123-y)-(z+w))+((3.123-y)*(z/w)))))\"\n\"((((3.123-((y/z)*w))+(3.123*(y-(z*w))))+((3.123*(y+(z*w)))*((3.123/y)-(z+w))))+(((3.123*(y-(z*w)))/((3.123*y)+(z+w)))/(((3.123/y)-(z+w))-((3.123*y)/(z-w)))))\"\n\"((((3.123-((y/z)/w))/(3.123*(y+(z*w))))/((3.123/(y-(z*w)))-((3.123*y)-(z+w))))/(((3.123*(y+(z*w)))*((3.123/y)-(z+w)))*(((3.123*y)-(z+w))+((3.123/y)/(z+w)))))\"\n\"((((3.123-(y*(z/w)))-(3.123-((y/z)*w)))-((3.123-((y/z)/w))/(3.123*(y+(z*w)))))-(((3.123-((y/z)*w))+(3.123*(y-(z*w))))+((3.123*(y+(z*w)))*((3.123/y)-(z+w)))))\"\n\"((((3.123-(y/(z*w)))/(((3.123-y)*z)-w))/((((3.123+y)*z)-w)-((3.123+y)-(z*w))))/(((((3.123-y)*z)-w)*((3.123+y)-(z/w)))*(((3.123+y)-(z*w))+((3.123/y)+(z+w)))))\"\n\"((((3.123/(y+(z*w)))+((3.123-y)/(z+w)))+(((3.123-y)*(z+w))*((3.123/y)*(z+w))))+((((3.123-y)/(z+w))/((3.123*y)/(z+w)))/(((3.123/y)*(z+w))-(3.123+((y/z)*w)))))\"\n\"((((3.123/(y-(z*w)))-((3.123*y)-(z+w)))-(((3.123-y)/(z+w))/((3.123*y)/(z+w))))-((((3.123*y)-(z+w))+((3.123/y)/(z+w)))+(((3.123*y)/(z+w))*(3.123-((y+z)/w)))))\"\n\"((((x*(5.123+(z*w)))*((x/5.123)-(z+w)))*(((x*5.123)-(z+w))+((x/5.123)/(z+w))))*((((x/5.123)-(z+w))-((x*5.123)/(z-w)))-(((x/5.123)/(z+w))/(x-((5.123+z)*w)))))\"\n\"((((x*(5.123-(z*w)))/((x*5.123)+(z+w)))/(((x/5.123)-(z+w))-((x*5.123)/(z-w))))/((((x*5.123)+(z+w))*((x/5.123)/(z-w)))*(((x*5.123)/(z-w))+(x-((5.123-z)/w)))))\"\n\"((((x*(y+(7.123*w)))*((x/y)-(7.123+w)))*(((x*y)-(7.123+w))+((x/y)/(7.123+w))))*((((x/y)-(7.123+w))-((x*y)/(7.123-w)))-(((x/y)/(7.123+w))/(x-((y+7.123)*w)))))\"\n\"((((x*(y+(z*9.123)))*((x/y)-(z+9.123)))*(((x*y)-(z+9.123))+((x/y)/(z+9.123))))*((((x/y)-(z+9.123))-((x*y)/(z-9.123)))-(((x/y)/(z+9.123))/(x-((y+z)*9.123)))))\"\n\"((((x*(y-(7.123*w)))/((x*y)+(7.123+w)))/(((x/y)-(7.123+w))-((x*y)/(7.123-w))))/((((x*y)+(7.123+w))*((x/y)/(7.123-w)))*(((x*y)/(7.123-w))+(x-((y-7.123)/w)))))\"\n\"((((x*(y-(z*9.123)))/((x*y)+(z+9.123)))/(((x/y)-(z+9.123))-((x*y)/(z-9.123))))/((((x*y)+(z+9.123))*((x/y)/(z-9.123)))*(((x*y)/(z-9.123))+(x-((y-z)/9.123)))))\"\n\"((((x+((5.123*z)*w))-(((x/5.123)/z)-w))-((((x*5.123)/z)-w)/((x-5.123)-(z*w))))-(((((x/5.123)/z)-w)+((x-5.123)-(z/w)))+(((x-5.123)-(z*w))*((x+5.123)*(z/w)))))\"\n\"((((x+((5.123*z)/w))+(((x*5.123)/z)-w))+((((x-5.123)/z)-w)*((x-5.123)+(z/w))))+(((((x*5.123)/z)-w)/((x-5.123)-(z*w)))/(((x-5.123)+(z/w))-((x+5.123)*(z*w)))))\"\n\"((((x+((5.123+z)*w))-(((x/5.123)*z)-w))-((((x*5.123)*z)-w)/((x+5.123)+(z*w))))-(((((x/5.123)*z)-w)+((x+5.123)+(z/w)))+(((x+5.123)+(z*w))*((x/5.123)+(z-w)))))\"\n\"((((x+((5.123+z)/w))+(((x*5.123)*z)-w))+((((x-5.123)*z)-w)*((x+5.123)-(z/w))))+(((((x*5.123)*z)-w)/((x+5.123)+(z*w)))/(((x+5.123)-(z/w))-((x*5.123)+(z-w)))))\"\n\"((((x+((5.123-z)*w))/(((x-5.123)/z)-w))/((((x+5.123)/z)-w)-((x-5.123)+(z*w))))/(((((x-5.123)/z)-w)*((x-5.123)+(z/w)))*(((x-5.123)+(z*w))+((x/5.123)-(z-w)))))\"\n\"((((x+((5.123-z)/w))*(((x+5.123)/z)-w))*((((x/5.123)*z)-w)+((x+5.123)+(z/w))))*(((((x+5.123)/z)-w)-((x-5.123)+(z*w)))-(((x+5.123)+(z/w))/((x*5.123)-(z-w)))))\"\n\"((((x+((5.123/z)*w))+((x*5.123)+(z/w)))+(((x*5.123)-(z*w))*((x+5.123)+(z-w))))+((((x*5.123)+(z/w))/((x+5.123)*(z-w)))/(((x+5.123)+(z-w))-((x-5.123)/(z*w)))))\"\n\"((((x+((5.123/z)+w))*((x*5.123)+(z*w)))*((((x/5.123)/z)-w)+((x-5.123)-(z/w))))*((((x*5.123)+(z*w))-((x+5.123)-(z-w)))-(((x-5.123)-(z/w))/((x+5.123)/(z*w)))))\"\n\"((((x+((5.123/z)/w))/((x*5.123)-(z*w)))/(((x*5.123)+(z*w))-((x+5.123)-(z-w))))/((((x*5.123)-(z*w))*((x+5.123)+(z-w)))*(((x+5.123)-(z-w))+((x+5.123)/(z/w)))))\"\n\"((((x+((y*7.123)*w))-(((x/y)/7.123)-w))-((((x*y)/7.123)-w)/((x-y)-(7.123*w))))-(((((x/y)/7.123)-w)+((x-y)-(7.123/w)))+(((x-y)-(7.123*w))*((x+y)*(7.123/w)))))\"\n\"((((x+((y*7.123)/w))+(((x*y)/7.123)-w))+((((x-y)/7.123)-w)*((x-y)+(7.123/w))))+(((((x*y)/7.123)-w)/((x-y)-(7.123*w)))/(((x-y)+(7.123/w))-((x+y)*(7.123*w)))))\"\n\"((((x+((y*z)*9.123))-(((x/y)/z)-9.123))-((((x*y)/z)-9.123)/((x-y)-(z*9.123))))-(((((x/y)/z)-9.123)+((x-y)-(z/9.123)))+(((x-y)-(z*9.123))*((x+y)*(z/9.123)))))\"\n\"((((x+((y*z)/9.123))+(((x*y)/z)-9.123))+((((x-y)/z)-9.123)*((x-y)+(z/9.123))))+(((((x*y)/z)-9.123)/((x-y)-(z*9.123)))/(((x-y)+(z/9.123))-((x+y)*(z*9.123)))))\"\n\"((((x+((y+7.123)*w))-(((x/y)*7.123)-w))-((((x*y)*7.123)-w)/((x+y)+(7.123*w))))-(((((x/y)*7.123)-w)+((x+y)+(7.123/w)))+(((x+y)+(7.123*w))*((x/y)+(7.123-w)))))\"\n\"((((x+((y+7.123)/w))+(((x*y)*7.123)-w))+((((x-y)*7.123)-w)*((x+y)-(7.123/w))))+(((((x*y)*7.123)-w)/((x+y)+(7.123*w)))/(((x+y)-(7.123/w))-((x*y)+(7.123-w)))))\"\n\"((((x+((y+z)*9.123))-(((x/y)*z)-9.123))-((((x*y)*z)-9.123)/((x+y)+(z*9.123))))-(((((x/y)*z)-9.123)+((x+y)+(z/9.123)))+(((x+y)+(z*9.123))*((x/y)+(z-9.123)))))\"\n\"((((x+((y+z)/9.123))+(((x*y)*z)-9.123))+((((x-y)*z)-9.123)*((x+y)-(z/9.123))))+(((((x*y)*z)-9.123)/((x+y)+(z*9.123)))/(((x+y)-(z/9.123))-((x*y)+(z-9.123)))))\"\n\"((((x+((y-7.123)*w))/(((x-y)/7.123)-w))/((((x+y)/7.123)-w)-((x-y)+(7.123*w))))/(((((x-y)/7.123)-w)*((x-y)+(7.123/w)))*(((x-y)+(7.123*w))+((x/y)-(7.123-w)))))\"\n\"((((x+((y-7.123)/w))*(((x+y)/7.123)-w))*((((x/y)*7.123)-w)+((x+y)+(7.123/w))))*(((((x+y)/7.123)-w)-((x-y)+(7.123*w)))-(((x+y)+(7.123/w))/((x*y)-(7.123-w)))))\"\n\"((((x+((y-z)*9.123))/(((x-y)/z)-9.123))/((((x+y)/z)-9.123)-((x-y)+(z*9.123))))/(((((x-y)/z)-9.123)*((x-y)+(z/9.123)))*(((x-y)+(z*9.123))+((x/y)-(z-9.123)))))\"\n\"((((x+((y-z)/9.123))*(((x+y)/z)-9.123))*((((x/y)*z)-9.123)+((x+y)+(z/9.123))))*(((((x+y)/z)-9.123)-((x-y)+(z*9.123)))-(((x+y)+(z/9.123))/((x*y)-(z-9.123)))))\"\n\"((((x+((y/7.123)*w))+((x*y)+(7.123/w)))+(((x*y)-(7.123*w))*((x+y)+(7.123-w))))+((((x*y)+(7.123/w))/((x+y)*(7.123-w)))/(((x+y)+(7.123-w))-((x-y)/(7.123*w)))))\"\n\"((((x+((y/7.123)+w))*((x*y)+(7.123*w)))*((((x/y)/7.123)-w)+((x-y)-(7.123/w))))*((((x*y)+(7.123*w))-((x+y)-(7.123-w)))-(((x-y)-(7.123/w))/((x+y)/(7.123*w)))))\"\n\"((((x+((y/7.123)/w))/((x*y)-(7.123*w)))/(((x*y)+(7.123*w))-((x+y)-(7.123-w))))/((((x*y)-(7.123*w))*((x+y)+(7.123-w)))*(((x+y)-(7.123-w))+((x+y)/(7.123/w)))))\"\n\"((((x+((y/z)*9.123))+((x*y)+(z/9.123)))+(((x*y)-(z*9.123))*((x+y)+(z-9.123))))+((((x*y)+(z/9.123))/((x+y)*(z-9.123)))/(((x+y)+(z-9.123))-((x-y)/(z*9.123)))))\"\n\"((((x+((y/z)+9.123))*((x*y)+(z*9.123)))*((((x/y)/z)-9.123)+((x-y)-(z/9.123))))*((((x*y)+(z*9.123))-((x+y)-(z-9.123)))-(((x-y)-(z/9.123))/((x+y)/(z*9.123)))))\"\n\"((((x+((y/z)/9.123))/((x*y)-(z*9.123)))/(((x*y)+(z*9.123))-((x+y)-(z-9.123))))/((((x*y)-(z*9.123))*((x+y)+(z-9.123)))*(((x+y)-(z-9.123))+((x+y)/(z/9.123)))))\"\n\"((((x+(5.123*(z/w)))+(x-((5.123/z)/w)))+((x-((5.123*z)*w))*(x/(5.123-(z*w)))))+(((x-((5.123/z)/w))/(x*(5.123+(z*w))))/((x/(5.123-(z*w)))-((x*5.123)-(z+w)))))\"\n\"((((x+(5.123/(z*w)))*(((x+5.123)*z)-w))*((x-((5.123/z)*w))+(x*(5.123-(z*w)))))*(((((x+5.123)*z)-w)-((x+5.123)-(z*w)))-((x*(5.123-(z*w)))/((x*5.123)+(z+w)))))\"\n\"((((x+(y*(7.123/w)))+(x-((y/7.123)/w)))+((x-((y*7.123)*w))*(x/(y-(7.123*w)))))+(((x-((y/7.123)/w))/(x*(y+(7.123*w))))/((x/(y-(7.123*w)))-((x*y)-(7.123+w)))))\"\n\"((((x+(y*(z/9.123)))+(x-((y/z)/9.123)))+((x-((y*z)*9.123))*(x/(y-(z*9.123)))))+(((x-((y/z)/9.123))/(x*(y+(z*9.123))))/((x/(y-(z*9.123)))-((x*y)-(z+9.123)))))\"\n\"((((x+(y/(7.123*w)))*(((x+y)*7.123)-w))*((x-((y/7.123)*w))+(x*(y-(7.123*w)))))*(((((x+y)*7.123)-w)-((x+y)-(7.123*w)))-((x*(y-(7.123*w)))/((x*y)+(7.123+w)))))\"\n\"((((x+(y/(z*9.123)))*(((x+y)*z)-9.123))*((x-((y/z)*9.123))+(x*(y-(z*9.123)))))*(((((x+y)*z)-9.123)-((x+y)-(z*9.123)))-((x*(y-(z*9.123)))/((x*y)+(z+9.123)))))\"\n\"((((x-((5.123*z)*w))*(x/(5.123-(z*w))))*((x/(5.123+(z*w)))+((x-5.123)/(z+w))))*(((x/(5.123-(z*w)))-((x*5.123)-(z+w)))-(((x-5.123)/(z+w))/((x*5.123)/(z+w)))))\"\n\"((((x-((5.123*z)/w))-(x/(5.123+(z*w))))-(((x/5.123)-(z*w))/((x-5.123)*(z+w))))-(((x/(5.123+(z*w)))+((x-5.123)/(z+w)))+(((x-5.123)*(z+w))*((x/5.123)*(z+w)))))\"\n\"((((x-((5.123+z)*w))*((x/5.123)+(z/w)))*(((x*5.123)-(z/w))+((x+5.123)/(z-w))))*((((x/5.123)+(z/w))-((x-5.123)-(z+w)))-(((x+5.123)/(z-w))/((x-5.123)*(z*w)))))\"\n\"((((x-((5.123+z)/w))-((x*5.123)-(z/w)))-(((x*5.123)+(z/w))/((x+5.123)*(z-w))))-((((x*5.123)-(z/w))+((x+5.123)/(z-w)))+(((x+5.123)*(z-w))*((x-5.123)/(z/w)))))\"\n\"((((x-((5.123-z)*w))+((x/5.123)-(z*w)))+(((x/5.123)-(z/w))*((x-5.123)+(z+w))))+((((x/5.123)-(z*w))/((x-5.123)*(z+w)))/(((x-5.123)+(z+w))-((x*5.123)*(z+w)))))\"\n\"((((x-((5.123-z)/w))/((x/5.123)-(z/w)))/(((x/5.123)+(z/w))-((x-5.123)-(z+w))))/((((x/5.123)-(z/w))*((x-5.123)+(z+w)))*(((x-5.123)-(z+w))+((x-5.123)*(z/w)))))\"\n\"((((x-((5.123/z)*w))+(x*(5.123-(z*w))))+((x*(5.123+(z*w)))*((x/5.123)-(z+w))))+(((x*(5.123-(z*w)))/((x*5.123)+(z+w)))/(((x/5.123)-(z+w))-((x*5.123)/(z-w)))))\"\n\"((((x-((5.123/z)/w))/(x*(5.123+(z*w))))/((x/(5.123-(z*w)))-((x*5.123)-(z+w))))/(((x*(5.123+(z*w)))*((x/5.123)-(z+w)))*(((x*5.123)-(z+w))+((x/5.123)/(z+w)))))\"\n\"((((x-((y*7.123)*w))*(x/(y-(7.123*w))))*((x/(y+(7.123*w)))+((x-y)/(7.123+w))))*(((x/(y-(7.123*w)))-((x*y)-(7.123+w)))-(((x-y)/(7.123+w))/((x*y)/(7.123+w)))))\"\n\"((((x-((y*7.123)/w))-(x/(y+(7.123*w))))-(((x/y)-(7.123*w))/((x-y)*(7.123+w))))-(((x/(y+(7.123*w)))+((x-y)/(7.123+w)))+(((x-y)*(7.123+w))*((x/y)*(7.123+w)))))\"\n\"((((x-((y*z)*9.123))*(x/(y-(z*9.123))))*((x/(y+(z*9.123)))+((x-y)/(z+9.123))))*(((x/(y-(z*9.123)))-((x*y)-(z+9.123)))-(((x-y)/(z+9.123))/((x*y)/(z+9.123)))))\"\n\"((((x-((y*z)/9.123))-(x/(y+(z*9.123))))-(((x/y)-(z*9.123))/((x-y)*(z+9.123))))-(((x/(y+(z*9.123)))+((x-y)/(z+9.123)))+(((x-y)*(z+9.123))*((x/y)*(z+9.123)))))\"\n\"((((x-((y+7.123)*w))*((x/y)+(7.123/w)))*(((x*y)-(7.123/w))+((x+y)/(7.123-w))))*((((x/y)+(7.123/w))-((x-y)-(7.123+w)))-(((x+y)/(7.123-w))/((x-y)*(7.123*w)))))\"\n\"((((x-((y+7.123)/w))-((x*y)-(7.123/w)))-(((x*y)+(7.123/w))/((x+y)*(7.123-w))))-((((x*y)-(7.123/w))+((x+y)/(7.123-w)))+(((x+y)*(7.123-w))*((x-y)/(7.123/w)))))\"\n\"((((x-((y+z)*9.123))*((x/y)+(z/9.123)))*(((x*y)-(z/9.123))+((x+y)/(z-9.123))))*((((x/y)+(z/9.123))-((x-y)-(z+9.123)))-(((x+y)/(z-9.123))/((x-y)*(z*9.123)))))\"\n\"((((x-((y+z)/9.123))-((x*y)-(z/9.123)))-(((x*y)+(z/9.123))/((x+y)*(z-9.123))))-((((x*y)-(z/9.123))+((x+y)/(z-9.123)))+(((x+y)*(z-9.123))*((x-y)/(z/9.123)))))\"\n\"((((x-((y-7.123)*w))+((x/y)-(7.123*w)))+(((x/y)-(7.123/w))*((x-y)+(7.123+w))))+((((x/y)-(7.123*w))/((x-y)*(7.123+w)))/(((x-y)+(7.123+w))-((x*y)*(7.123+w)))))\"\n\"((((x-((y-7.123)/w))/((x/y)-(7.123/w)))/(((x/y)+(7.123/w))-((x-y)-(7.123+w))))/((((x/y)-(7.123/w))*((x-y)+(7.123+w)))*(((x-y)-(7.123+w))+((x-y)*(7.123/w)))))\"\n\"((((x-((y-z)*9.123))+((x/y)-(z*9.123)))+(((x/y)-(z/9.123))*((x-y)+(z+9.123))))+((((x/y)-(z*9.123))/((x-y)*(z+9.123)))/(((x-y)+(z+9.123))-((x*y)*(z+9.123)))))\"\n\"((((x-((y-z)/9.123))/((x/y)-(z/9.123)))/(((x/y)+(z/9.123))-((x-y)-(z+9.123))))/((((x/y)-(z/9.123))*((x-y)+(z+9.123)))*(((x-y)-(z+9.123))+((x-y)*(z/9.123)))))\"\n\"((((x-((y/7.123)*w))+(x*(y-(7.123*w))))+((x*(y+(7.123*w)))*((x/y)-(7.123+w))))+(((x*(y-(7.123*w)))/((x*y)+(7.123+w)))/(((x/y)-(7.123+w))-((x*y)/(7.123-w)))))\"\n\"((((x-((y/7.123)/w))/(x*(y+(7.123*w))))/((x/(y-(7.123*w)))-((x*y)-(7.123+w))))/(((x*(y+(7.123*w)))*((x/y)-(7.123+w)))*(((x*y)-(7.123+w))+((x/y)/(7.123+w)))))\"\n\"((((x-((y/z)*9.123))+(x*(y-(z*9.123))))+((x*(y+(z*9.123)))*((x/y)-(z+9.123))))+(((x*(y-(z*9.123)))/((x*y)+(z+9.123)))/(((x/y)-(z+9.123))-((x*y)/(z-9.123)))))\"\n\"((((x-((y/z)/9.123))/(x*(y+(z*9.123))))/((x/(y-(z*9.123)))-((x*y)-(z+9.123))))/(((x*(y+(z*9.123)))*((x/y)-(z+9.123)))*(((x*y)-(z+9.123))+((x/y)/(z+9.123)))))\"\n\"((((x-(5.123*(z/w)))-(x-((5.123/z)*w)))-((x-((5.123/z)/w))/(x*(5.123+(z*w)))))-(((x-((5.123/z)*w))+(x*(5.123-(z*w))))+((x*(5.123+(z*w)))*((x/5.123)-(z+w)))))\"\n\"((((x-(5.123/(z*w)))/(((x-5.123)*z)-w))/((((x+5.123)*z)-w)-((x+5.123)-(z*w))))/(((((x-5.123)*z)-w)*((x+5.123)-(z/w)))*(((x+5.123)-(z*w))+((x/5.123)+(z+w)))))\"\n\"((((x-(y*(7.123/w)))-(x-((y/7.123)*w)))-((x-((y/7.123)/w))/(x*(y+(7.123*w)))))-(((x-((y/7.123)*w))+(x*(y-(7.123*w))))+((x*(y+(7.123*w)))*((x/y)-(7.123+w)))))\"\n\"((((x-(y*(z/9.123)))-(x-((y/z)*9.123)))-((x-((y/z)/9.123))/(x*(y+(z*9.123)))))-(((x-((y/z)*9.123))+(x*(y-(z*9.123))))+((x*(y+(z*9.123)))*((x/y)-(z+9.123)))))\"\n\"((((x-(y/(7.123*w)))/(((x-y)*7.123)-w))/((((x+y)*7.123)-w)-((x+y)-(7.123*w))))/(((((x-y)*7.123)-w)*((x+y)-(7.123/w)))*(((x+y)-(7.123*w))+((x/y)+(7.123+w)))))\"\n\"((((x-(y/(z*9.123)))/(((x-y)*z)-9.123))/((((x+y)*z)-9.123)-((x+y)-(z*9.123))))/(((((x-y)*z)-9.123)*((x+y)-(z/9.123)))*(((x+y)-(z*9.123))+((x/y)+(z+9.123)))))\"\n\"((((x/(5.123+(z*w)))+((x-5.123)/(z+w)))+(((x-5.123)*(z+w))*((x/5.123)*(z+w))))+((((x-5.123)/(z+w))/((x*5.123)/(z+w)))/(((x/5.123)*(z+w))-(x+((5.123/z)*w)))))\"\n\"((((x/(5.123-(z*w)))-((x*5.123)-(z+w)))-(((x-5.123)/(z+w))/((x*5.123)/(z+w))))-((((x*5.123)-(z+w))+((x/5.123)/(z+w)))+(((x*5.123)/(z+w))*(x-((5.123+z)/w)))))\"\n\"((((x/(y+(7.123*w)))+((x-y)/(7.123+w)))+(((x-y)*(7.123+w))*((x/y)*(7.123+w))))+((((x-y)/(7.123+w))/((x*y)/(7.123+w)))/(((x/y)*(7.123+w))-(x+((y/7.123)*w)))))\"\n\"((((x/(y+(z*9.123)))+((x-y)/(z+9.123)))+(((x-y)*(z+9.123))*((x/y)*(z+9.123))))+((((x-y)/(z+9.123))/((x*y)/(z+9.123)))/(((x/y)*(z+9.123))-(x+((y/z)*9.123)))))\"\n\"((((x/(y-(7.123*w)))-((x*y)-(7.123+w)))-(((x-y)/(7.123+w))/((x*y)/(7.123+w))))-((((x*y)-(7.123+w))+((x/y)/(7.123+w)))+(((x*y)/(7.123+w))*(x-((y+7.123)/w)))))\"\n\"((((x/(y-(z*9.123)))-((x*y)-(z+9.123)))-(((x-y)/(z+9.123))/((x*y)/(z+9.123))))-((((x*y)-(z+9.123))+((x/y)/(z+9.123)))+(((x*y)/(z+9.123))*(x-((y+z)/9.123)))))\"\n\"(((tan((tan(((((cos(((((cos(cos((cos(cos((((((sin(cos((0.90-(((cos((b-e))/b)-b)/e))))*3.88)+e)+1.87)/a)+b)))+b)))+pi)+pi)/a)+b))+e)+pi)+pi)/a))+pi))+b)+a)+a)\"\n\"(tan((tan((((a+cos((((pi+cos(tan((cos((pi+((b+(cos(cos((((((a*sin(sin(cos((((e/1.91)/1.01)+a)))))-e)/2.90)/a)+e)))+b))-pi)))+pi))))*b)+a)))+pi)/b))-3.28))/a)\"\n\"(tan(tan(((b+((b/(e+(sin((sin((b/((((a-((3.84-(e*(pi/(((((cos((cos(((cos(e)+b)/3.18))+pi))*0.41)-b)+e)/b)*0.45))))-e))*b)/1.93)+3.79)))-pi))+a)))/b))/b)))+b)\"\n\"(sin(sin((((((((((cos((cos(cos((((cos((((((((b/((b/(tan(((3.10+1.04)+a))-pi))/b))+a)+e)/2.22)/a)/a)/b))/e)/a)+pi)))+e))/a)/b)/b)-pi)-a)+1.75)*e)+3.51)*b)))/e)\"\n\"(tan(((cos((((sin(cos((sin((((cos(tan((pi/tan((sin(cos((((((2.87+(e+(((1.14/pi)+a)*b)))+a)+b)/e)+a)))-0.34)))))+a)+a)+b))/b)))+b)+b)+1.12))+0.70)/3.73))/0.37)\"\n\"(e+tan(((((sin((sin((sin(((2.77+((sin(((cos(((cos(((((((3.51+(cos(((0.96*a)/pi))+a))+3.79)-a)*e)*a)-a))/b)+b))+b)+b))+1.84)-pi))+e))-pi))/a))/a)*2.85)*pi)-e)))\"\n\"2.2+y+z/w+2.2+y+z*w+2.2+y-z/w-2.2+y-z*w+2.2+y*z/w*2.2+y*z*w-2.2+y/z+w+2.2+y/z/w+2.2+y/z*w-2.2-y+z/w*2.2-y+z*w*2.2-y-z/w-2.2-y-z*w+2.2-y*z/w+2.2-y*z*w-2.2-y/z/w\"\n\"2.2-y-z+w+2.2-y-z+w+2.2-y+z+w-2.2-y+z+w+2.2*y-z+w*2.2/y-z+w-2.2*y+z+w+2.2/y+z+w+2.2*y+z-w-2.2/y+z-w*2.2*y-z-w*2.2/y-z-w-2.2+y*z*w+2.2+y*z/w+2.2+y/z*w-2.2+y/z/w\"\n\"2.2-y/z*w*2.2+y*z-w-2.2-y*z-w+2.2*y*z-w*2.2/y*z-w-2.2+y/z-w*2.2-y/z-w*2.2*y/z-w-2.2/y/z-w+2.2*y+z*w+2.2*y-z*w-2.2*y+z/w+2.2*y-z/w*2.2/y+z/w-2.2/y-z/w+2.2/y-z*w\"\n\"2.2/y+z*w-2.2/y-z*w*2.2*y+z*w*2.2*y-z*w-2.2+y-z*w+2.2+y-z/w+2.2+y+z*w-2.2+y+z/w*2.2-y+z*w*2.2-y+z/w-2.2-y-z*w+2.2-y-z/w*2.2+y-z-w-2.2+y-z-w*2.2+y+z-w*2.2+y+z-w\"\n\"sin((((((a+sin(tan(cos((((tan(((((((sin(((sin(sin(((cos(((tan(tan(0.79))/e)+a))+3.81)+pi)))+a)*3.33))/1.89)/pi)*a)+a)/3.08)-a))/e)+0.34)*b)))))*a)+b)+3.70)+a))\"\n\"x+3.3+z/w+x+3.3+z*w+x+3.3-z/w-x+3.3-z*w+x+3.3*z/w*x+3.3*z*w-x+3.3/z+w+x+3.3/z/w+x+3.3/z*w-x-3.3+z/w*x-3.3+z*w*x-3.3-z/w-x-3.3-z*w+x-3.3*z/w+x-3.3*z*w-x-3.3/z/w\"\n\"x+y+4.4/w+x+y+4.4*w+x+y-4.4/w-x+y-4.4*w+x+y*4.4/w*x+y*4.4*w-x+y/4.4+w+x+y/4.4/w+x+y/4.4*w-x-y+4.4/w*x-y+4.4*w*x-y-4.4/w-x-y-4.4*w+x-y*4.4/w+x-y*4.4*w-x-y/4.4/w\"\n\"x+y+z/5.5+x+y+z*5.5+x+y-z/5.5-x+y-z*5.5+x+y*z/5.5*x+y*z*5.5-x+y/z+5.5+x+y/z/5.5+x+y/z*5.5-x-y+z/5.5*x-y+z*5.5*x-y-z/5.5-x-y-z*5.5+x-y*z/5.5+x-y*z*5.5-x-y/z/5.5\"\n\"x-3.3-z+w+x-3.3-z+w+x-3.3+z+w-x-3.3+z+w+x*3.3-z+w*x/3.3-z+w-x*3.3+z+w+x/3.3+z+w+x*3.3+z-w-x/3.3+z-w*x*3.3-z-w*x/3.3-z-w-x+3.3*z*w+x+3.3*z/w+x+3.3/z*w-x+3.3/z/w\"\n\"x-3.3/z*w*x+3.3*z-w-x-3.3*z-w+x*3.3*z-w*x/3.3*z-w-x+3.3/z-w*x-3.3/z-w*x*3.3/z-w-x/3.3/z-w+x*3.3+z*w+x*3.3-z*w-x*3.3+z/w+x*3.3-z/w*x/3.3+z/w-x/3.3-z/w+x/3.3-z*w\"\n\"x-y-4.4+w+x-y-4.4+w+x-y+4.4+w-x-y+4.4+w+x*y-4.4+w*x/y-4.4+w-x*y+4.4+w+x/y+4.4+w+x*y+4.4-w-x/y+4.4-w*x*y-4.4-w*x/y-4.4-w-x+y*4.4*w+x+y*4.4/w+x+y/4.4*w-x+y/4.4/w\"\n\"x-y-z+5.5+x-y-z+5.5+x-y+z+5.5-x-y+z+5.5+x*y-z+5.5*x/y-z+5.5-x*y+z+5.5+x/y+z+5.5+x*y+z-5.5-x/y+z-5.5*x*y-z-5.5*x/y-z-5.5-x+y*z*5.5+x+y*z/5.5+x+y/z*5.5-x+y/z/5.5\"\n\"x-y/4.4*w*x+y*4.4-w-x-y*4.4-w+x*y*4.4-w*x/y*4.4-w-x+y/4.4-w*x-y/4.4-w*x*y/4.4-w-x/y/4.4-w+x*y+4.4*w+x*y-4.4*w-x*y+4.4/w+x*y-4.4/w*x/y+4.4/w-x/y-4.4/w+x/y-4.4*w\"\n\"x-y/z*5.5*x+y*z-5.5-x-y*z-5.5+x*y*z-5.5*x/y*z-5.5-x+y/z-5.5*x-y/z-5.5*x*y/z-5.5-x/y/z-5.5+x*y+z*5.5+x*y-z*5.5-x*y+z/5.5+x*y-z/5.5*x/y+z/5.5-x/y-z/5.5+x/y-z*5.5\"\n\"x/3.3+z*w-x/3.3-z*w*x*3.3+z*w*x*3.3-z*w-x+3.3-z*w+x+3.3-z/w+x+3.3+z*w-x+3.3+z/w*x-3.3+z*w*x-3.3+z/w-x-3.3-z*w+x-3.3-z/w*x+3.3-z-w-x+3.3-z-w*x+3.3+z-w*x+3.3+z-w\"\n\"x/y+4.4*w-x/y-4.4*w*x*y+4.4*w*x*y-4.4*w-x+y-4.4*w+x+y-4.4/w+x+y+4.4*w-x+y+4.4/w*x-y+4.4*w*x-y+4.4/w-x-y-4.4*w+x-y-4.4/w*x+y-4.4-w-x+y-4.4-w*x+y+4.4-w*x+y+4.4-w\"\n\"x/y+z*5.5-x/y-z*5.5*x*y+z*5.5*x*y-z*5.5-x+y-z*5.5+x+y-z/5.5+x+y+z*5.5-x+y+z/5.5*x-y+z*5.5*x-y+z/5.5-x-y-z*5.5+x-y-z/5.5*x+y-z-5.5-x+y-z-5.5*x+y+z-5.5*x+y+z-5.5\"\n\"(sin(((sin((cos(((b-(((sin(tan(tan(((sin((tan(cos((e+(((tan((((tan(((3.51/b)+2.91))*1.47)/a)/a))+b)*e)/pi))))*2.44))+b)+pi))))-b)+a)*3.23))/0.97))+b))+e)*a))+e)\"\n\"sin(cos((((cos((((((((((sin((tan((cos(((((b-(((sin((cos((e*cos((a-pi))))+a))+e)+b)-1.65))+b)*1.55)/2.57))+b))+b))+pi)/b)/b)+a)+pi)-b)/b)-1.70)/0.40))+e)+pi)-e)))\"\n\"sin((((((((sin(((tan(tan(((((((((((((sin((((pi-(((a/b)/2.49)+e))+a)-e))/1.49)+e)+0.42)*pi)+3.68)-a)+b)+2.60)*a)/0.80)-a)+a)))+b)/0.59))*1.22)/a)+a)+e)*0.46)+a)/b))\"\n\"((((3.65-(cos(sin(((b+((((((((cos((((((pi/((tan((sin(((((1.15+(((b+a)+b)/b))+a)+a)+pi))-2.20))/1.83)+b))+a)+b)*pi)+e))*b)*b)+a)-3.53)+e)-a)-b)+a))*a)))+b))+e)*b)+b)\"\n\"tan(((tan((a+((((sin((cos(cos((((pi*(tan(cos((tan((cos(tan(sin(cos(((tan(cos(sin((((a/1.32)-a)-e))))+b)+e)))))*pi))/b)))+pi))-a)+b)))/2.99))-b)-e)*a)+e)))+3.95)+b))\"\n\"tan((b/tan((e+((((((b-(((e+((tan((sin(((cos((cos(((sin((cos((((a*a)*0.25)/e))+1.46))+b)*1.76))-3.16))-2.32)+0.23))*e))*a)/b))+e)+b))*3.77)/1.73)-pi)*3.02)-2.26)))))\"\n\"((((((tan(((pi+(((b+((((a+(sin(((pi-(sin(((((((sin(((tan(((e*((e+a)*3.95))+b))-a)*pi))-e)-pi)+pi)+pi)+b)*a))+b))-b))-e))*b)/1.51)*pi))+a)*a))*pi))+pi)*b)/a)/b)-b)*e)\"\n\"((((cos(tan(((a+(cos(((a+tan(sin((tan((cos((cos((sin((tan((a*tan(cos((tan(tan(tan((sin((1.72/a))*b))))+b)))))-3.86))+pi))/b))*a))*a))))-1.18))+2.23))+a)))*e)+b)-e)/e)\"\n\"(tan(tan((((cos((((((((sin((((((sin((cos(((b/sin(cos((((sin(((1.92/a)-b))+a)*pi)*b))))/b))-1.44))+0.28)-b)+e)+2.00)-pi))+b)+2.55)+b)+pi)+3.80)*a)-e))+b)-a)*3.22)))/b)\"\n\"tan(sin(sin(cos(((cos((((((tan((((e*((b+(cos((a-cos(sin(((pi-((tan((((((a+b)*a)*2.70)+0.72)/3.46))/e)+b))+b)))))+1.36))+a))/pi)-b))-b)+2.41)-e)*3.80)/e))/0.20)+b)))))\"\n\"(2.10+sin((sin(tan((cos((cos((((sin((pi-((cos(cos(cos(cos((((((((2.83*(tan(((a+e)+e))+b))*a)*b)-3.86)+2.02)-2.50)-2.13)))))+1.31)/2.33)))*a)/a)+b))+1.81))/2.56)))+a)))\"\n\"(sin((cos((((((((a+(e*sin((((tan(cos(cos(((a+(0.53+cos(((((tan(((3.12*(cos(cos(pi))-b))+e))+a)+b)/b)*b))))*3.87))))+b)+4.00)+0.40))))/pi)+e)-0.44)+pi)-a)+pi))+pi))+pi)\"\n\"sin(((((tan((((tan(sin(((tan(((((((((tan((cos((sin(((pi+(((e+(1.98-(2.62+a)))-b)+b))/b))*b))/a))-pi)/pi)+b)*a)*1.59)-0.23)/pi)/b))*b)/a)))+b)+a)*a))*e)*0.11)*b)+2.50))\"\n\"(b*((sin(tan((((sin((tan(cos(sin((tan((((cos((a-(sin((cos(tan(cos(sin(tan((tan((((((tan(b)/e)+b)-e)/b)-pi))+a))))))/e))/b)))*e)+b)*0.02))+a))))+a))/a)+a)+b)))/1.76)+a))\"\n\"cos((((b+((((((3.00-(a*(sin(((b-cos((cos((tan((((e-(0.34-((((1.52/((e+(a/tan((((b/a)*a)/e))))-e))/a)+a)+e)))-a)*b))*2.32))*3.61)))/0.01))+b)))*a)/3.11)/b)/pi)-b))/b)/e))\"\n\"((cos(((b*cos((((cos((cos((cos((((((((((((tan(((0.30*(((((0.70-pi)+e)+b)*e)-b))*pi))+a)/a)/a)+1.31)/b)+2.74)-pi)+a)-pi)/a)-3.93))*e))+0.33))/a)-pi)-1.15)))/1.12))-b)+1.37)\"\n\"(((cos(((((tan(sin(cos(((sin(((a-(((((cos(sin(cos(cos(((cos(((((2.48+((b*b)+e))+0.72)-b)/e))+b)*3.38)))))/a)/e)+0.61)+b)-b))/2.54))/pi)*0.89))))*3.32)+a)+pi)*a))-a)+pi)+pi)\"\n\"tan((cos(((tan((sin((tan((((((((sin(((cos(tan(cos((tan((3.17*(sin(((((e*((b*a)-a))*0.42)-a)+a))-pi)))/pi))))+3.86)*2.26))+b)+b)/e)+a)*2.61)+pi)+e))+a))-1.27))-b)+2.97))/b))\"\n\"(b*(sin((b/((cos((cos((((((sin(((cos(tan(sin((tan((((sin((3.78+(((((sin((tan(((pi-pi)+b))*b))-a)+pi)+pi)-e)+b)))-b)-a)-pi))/b))))+a)*b))+e)-e)/b)+3.43)/pi))+a))+a)-pi)))-b))\"\n\"(((pi+(tan((((cos((pi+(((sin((((((cos((cos((cos(((sin(sin(sin(cos((tan((tan((1.06+0.35))+3.92))*b)))))/a)+b))+e))/e))*a)-1.37)+0.33)/a)/e))*b)*a)+a)))-0.23)+pi)*b))+b))+a)+e)\"\n\"((cos(cos((cos((tan(((e+sin((sin(tan((0.32+((cos(((((((sin(((((tan(cos((((cos(((a-b)+pi))+1.56)+pi)*b)))-a)+b)/a)+2.26))*b)+b)-pi)/b)*pi)/b))/a)-e))))/b)))-a))+a))+pi)))-b)/a)\"\n\"(tan(sin(((((((((((cos(cos(((((0.23+((((((((((2.27-(cos((((e-b)*a)+e))*0.41))+b)+pi)*3.47)-a)+3.78)-a)+pi)/b)+pi))/b)/e)+pi)))-1.84)-a)+pi)/0.86)-0.35)*a)-b)+b)-e)-3.10)))*pi)\"\n\"(tan(((b+((3.41/(a+(sin(((sin((sin(cos((((((((((((((((sin((tan((sin(sin(pi))/b))/b))/b)*e)+b)-pi)-2.26)-a)+pi)*a)/0.92)/a)+pi)/b)+a)-pi)+a)))+2.56))-pi)*b))-a)))+2.11))/pi))+e)\"\n\"cos((sin((((((((((((pi-sin((((cos((((tan((pi*(tan((((cos((b+(((tan((pi/a))-a)+0.61)/b)))+pi)-b)-b))+b)))-e)/a)-1.31))+b)+e)/e)))-b)-a)+e)+2.73)*3.13)*b)-b)+b)-pi)*2.98))/3.63))\"\n\"(((a*((1.22-(b+((((cos((sin(tan((((tan(tan(((a/sin(cos(((((2.68+(((((tan(tan(b))+3.93)-pi)+e)/pi)/pi))+b)/e)-a))))+a)))+3.04)*0.85)+a)))*b))/1.70)-b)-0.20)-2.46)))-pi))+b)*0.41)\"\n\"((((((((b-cos(((cos(cos((((tan(((((((0.97/(0.56/(cos((cos(((((((((b*(pi-b))/e)+a)-e)/b)+a)-e)-2.93))+a))*b)))/b)/a)+a)/b)/3.64))-a)+a)+b)))/3.44)-a)))/b)+2.48)*a)/0.59)+a)/a)+pi)\"\n\"((((tan(sin((1.27*(cos(((((sin((((a+sin((((e*cos((tan((2.10-((((((cos(sin((((sin(a)+a)/b)+1.96)))/pi)*0.16)*a)+a)+b)+e)))*pi)))/a)+pi)))+a)/a))+e)+0.69)-e)/b))/e))))+pi)*b)+b)*b)\"\n\"(cos(((((((sin((cos((e*sin((((((cos((((cos(sin((((sin(cos(sin((tan((e/((b+3.61)*1.43)))*e))))*2.74)-0.86)+1.45)))+pi)+e)-a))-e)+b)-a)-e)*a))))-a))/b)/b)*0.49)+pi)/1.47)*b))*1.83)\"\n\"((((2.80/(((cos(((tan((cos(cos(((((((cos(((((b+tan(sin((((tan((a+(((((a+e)-b)+e)*b)-a)))+b)-2.38)+a))))+e)/pi)+a))*b)+e)*a)*1.97)+e)/e)))+0.63))/e)+1.23))/1.39)+a)+a))+0.88)+a)+a)\"\n\"((((a+(sin((a+(pi*(((cos(sin(sin((((cos(((((sin(cos(((3.79+(((sin((((b*((((b+a)+a)+e)+pi))+a)+b))*1.40)+3.98)/3.45))/0.68)))+a)/e)-b)-b))/a)-a)/e))))/pi)-b)+b))))*a))+a)/pi)+1.29)\"\n\"(((e+tan((e+(((((sin((((((sin(sin(tan((sin(((cos((tan(sin(tan((e/((b+(((0.59+3.04)+b)+b))-1.51)))))+pi))*a)-pi))/2.14))))+3.03)-a)+e)+3.51)*a))/3.55)/b)+0.59)+a)-a))))+1.99)/2.62)\"\n\"((0.20+((((((((2.84-(((sin(((cos(((cos(((((a+tan(((((((1.83-sin(((((a+b)-pi)-b)+pi)))/3.16)+a)/a)+a)/e)))/0.84)-a)+3.56))-b)+b))*b)+b))/0.49)+b)-b))/pi)+2.42)-a)+2.80)+a)-b)*b))*b)\"\n\"((2.63*((tan((cos((((((((((tan(((((((pi-(pi-(1.85+((b+((tan(((sin((3.09+(a*b)))+b)*a))/a)+a))*pi))))-b)/3.67)+e)*3.23)-2.21))-b)+b)-b)+b)+3.55)-e)/1.57)-1.99)*b))*0.01))+pi)/a))+b)\"\n\"sin((((b+sin(tan((cos((tan((((tan(((((cos((2.57-(3.77+(b/(a-(((a*(b*cos((sin((((b*sin((0.74-(b-(pi+b)))))*a)+b))-0.95))))-b)-a))))))*a)+e)-1.85)+pi))/b)*b)-e))+b))/pi))))+a)+1.26))\"\n\"(((((tan(cos(((cos(((((((sin(sin((sin((((((sin((((tan((((a/sin((1.09/pi)))+a)/b))-b)+0.94)*0.24))/pi)+b)-a)+0.94)*b))/0.82)))*a)+1.26)+a)*2.96)-b)/pi))+b)+a)))*pi)*a)*0.68)+a)-0.25)\"\n\"((((cos((b*(sin(tan((((((e+(3.01+(((((((sin((((((b+tan((sin(((cos(tan((b/pi)))/pi)/e))/a)))+b)+b)-0.40)/pi))*a)+b)+a)*1.18)/1.51)/a)/b)))+1.02)-b)+a)+a)))-a)))*pi)-2.01)+0.35)+3.46)\"\n\"sin((((b*(1.97+((tan(((tan(((cos(cos(((((e+(1.92/(b-(((a-(b-sin(tan(cos(((e/sin(((sin(cos(cos(((a/b)/3.17))))+a)/a)))+e))))))-a)+a))))*b)*3.19)*b)))*b)-b))/a)-a))+a)-a)))*pi)+0.95))\"\n\"(((((sin(((cos(cos((((cos((((2.51/tan((a+sin((((b+((2.80/((3.84+sin(sin((((sin((a/e))+a)*pi)-pi))))-b))/0.90))+2.50)/1.02)))))*b)-pi))*3.56)*pi)+b)))*b)+pi))+e)+3.96)+1.29)-pi)+3.05)\"\n\"((cos(((tan((((((3.95+(((3.49+((tan(((tan((((((0.95+((((b/(e+tan(sin(cos((((b+0.48)*0.95)+2.21))))))+b)+a)/pi))*a)+pi)-a)*0.86))/b)+a))/b)-a))-1.30)+e))+a)/3.34)+a)-a))+a)/a))-pi)/e)\"\n\"((pi/(b/((((1.40/((((sin((((((2.13-((((((e*(cos(((((cos((((a/((a*a)+pi))*b)+a))+e)+e)+2.33)-e))+e))+b)-3.99)+1.63)/b)*b))-1.42)/a)/1.09)+2.38))-0.97)/a)-2.93)-1.50))*2.88)/b)/b)))+b)\"\n\"tan(((((3.17-(3.66+((b-(((sin(sin((((b/cos((a/((0.58*(e*(((sin((b+sin(sin(sin(cos(tan(((sin((e-0.53))+3.14)/b))))))))+3.99)+0.63)+b)))*a))))-1.72)/b)))+e)-a)*0.87))+b)))-3.79)+a)*b))\"\n\"(pi+tan((((((cos((((3.06*cos((((a+((((tan((3.99-((((sin((b-(((sin(((b/((1.61*(b+a))+3.74))*pi))+a)+1.64)+0.56)))*b)-1.49)+2.41)+e)))*a)-b)/b)/a))/a)/b)))+a)*pi))/pi)-a)+a)+pi)-0.49)))\"\n\"((((sin(tan((((cos((((a/(((b+cos((sin((a-tan((e/(((((cos(sin(((sin((a+tan((sin((e/(pi*a)))+pi))))/a)+2.25)))/b)*1.71)/b)+b)*0.01)))))+e)))/a)-e))+pi)*a))*b)-0.64)-1.26)))-e)*0.84)+a)*b)\"\n\"((b+(1.73*(a+(tan((((((cos((((sin((tan(tan(((3.19*sin((tan((((a-((tan((sin(sin((a+((cos(pi)+a)+a))))-a))+a)*1.83))-b)/pi))/2.37)))/a)))/pi))+e)/2.14)*b))/b)*3.91)+2.43)/pi)-a))/a))))*b)\"\n\"cos(sin((1.01/sin(((((sin((cos(((tan((cos((tan(tan(((a-(tan(cos((tan((((((a+(((sin((1.62-0.90))+pi)+b)+b))-b)/a)-1.22)+a))*1.82)))-e))/pi)))/e))+3.31))+b)*a))+a))*a)+pi)+3.26)/3.57)))))\"\n\"(((((1.79*sin(((tan(sin((((((b+(tan(((cos(((((b/sin((cos(((tan((cos(((tan(e)+1.15)/a))/a))*2.93)+1.84))+a)))/0.44)+3.75)-2.12))+1.75)+b))/1.82))+a)-pi)*pi)+2.23)))+a)*b)))/b)/a)+1.06)+a)\"\n\"(((pi-((((sin(((((cos((sin((sin((cos(((((((((a+((b/(((e/(((cos((sin(((b+a)/2.85))/b))-b)*a)/a))*a)/e))+a))*b)*a)+e)*b)-b)+a)*e))/1.56))+1.28))+b))/1.79)+0.57)*a)+pi))-3.98)+a)*e)*b))-e)+a)\"\n\"((((cos(sin(sin(((cos((tan(cos(tan(cos(cos(cos((cos(((tan(((b-((2.78+((((((b*((((cos(((((b/e)-b)+b)*e))+a)/e)-a)-b))-a)+b)/b)+pi)-a))/b))+pi))+e)+pi))*a)))))))-2.47))/pi)+pi))))-e)+a)-a)+b)\"\n\"(((b+tan(((tan((cos(((cos(cos((((((((cos(sin((tan((a+(((((((((b*cos(((0.90*b)*3.43)))/a)-a)+pi)*b)-3.40)+b)+a)+0.35)))/a)))-0.75)+b)/b)-1.67)+pi)/b)+1.74)))*1.74)+pi))+pi))*1.90)/e)))/e)-a)\"\n\"(((((cos((((a*((a-((((((sin(((tan((((((cos((sin(((tan(((1.02*((tan(cos(e))*3.41)*b))+3.95))*2.52)-0.11))+b))+pi)/e)-0.07)/a)+a))/a)*b))*b)/a)/a)/a)+2.39)+a))+b))*a)+b))*0.54)+1.05)/a)+b)+pi)\"\n\"((cos((sin(((((pi*((b+(sin((b/(pi+((a-(pi+sin(sin(sin(sin(((cos((sin(((sin(((sin((b-(cos(sin(((3.25*2.01)/a)))*pi)))+a)-b))-pi)+a))+a))-a)+a)))))))*1.43))))/e))*3.89))+a)+e)-a))+a))+b)+0.97)\"\n\"sin(((e+(tan(((((tan(cos((b-((b-(sin(((tan((tan((pi/((a/(cos((a+cos((((sin(sin(((((((a+1.20)/b)*2.62)+0.84)*3.15)/e)))+3.69)+a)+b))))*a))+a)))-b))+a)-2.95))*a))*b))))+a)/b)+b)+a))/b))+3.45))\"\n\"(2.74+((((((sin((((((cos((((((((tan(sin((tan(cos((tan((((sin((1.67+sin((cos(tan(tan(e)))/1.44))))+b)-2.91)+b))-a)))+a)))-e)+0.82)+a)+a)/b)*b)-b))-a)-e)+b)+0.32)+pi))+a)/e)/1.08)/pi)/2.99)+b))\"\n\"(cos((((((a/sin((tan(((sin((((sin((cos(((((e+((tan(cos(((cos(cos(((cos((((((a+(a*b))+pi)-b)/3.53)+b))+2.27)+a)))-b)/b)))+a)*2.54))+a)/a)+e))/0.68))+0.05)+b)-a))/e)+b))-a)))-b)*a)+b)+a))+2.46)\"\n\"cos((sin(((e-cos(((tan((((((a*(((((((((cos(((((b/(((((cos((tan((e*((tan(e)+b)*b)))*a))*e)+pi)-e)/a)*a))-1.40)*b)*2.92))/0.17)+a)+0.24)/a)*b)+e)+b)*1.73)/b))+a)/b)+2.19)-a))+a)+b)))+1.01))+a))\"\n\"(((0.57-(((((a*((sin(cos((a+cos((((((sin(((sin(((((b/(b+((((((((((3.81-e)/0.34)+e)*0.45)+e)/a)-pi)*a)-e)+2.79)))+1.17)*e)/e))-b)-b))+e)/e)+a)+b)+a)))))/2.86)+0.55))+e)/0.22)+b)-e))/2.11)*2.18)\"\n\"cos((((b+((e*(sin(((b*tan((pi+((((((((((((((((sin((((((a+(((((sin((b-0.10))/a)*a)+e)/a)-0.04))*e)*a)*b)+pi))+a)+a)-pi)/1.03)+pi)+3.89)/e)+e)+a)+e)*e)*a)/pi)-2.85)+pi)+b))))/b))*e))*b))/b)-pi))\"\n\"tan((((((((tan(cos((b/sin((((((cos(((sin(tan(cos(sin(tan((e/((cos(cos(tan(cos((e+tan((e+sin((tan(((pi/b)*e))-b)))))))))+pi)+1.13)))))))/a)*b))/a)/a)/0.04)+a)/b)))))+b)+e)+2.20)+a)/0.30)*b)-pi))\"\n\"(((tan((2.10+(1.40/(e+(a/(((((((tan((tan((((tan((((sin(((tan((2.57/(((cos(((((1.78+a)+a)+b)/0.73))+b)+a)-b)))+a)+1.24))-0.68)*pi)/e))+0.01)-b)*a))/e))+3.27)+b)+3.39)*b)+2.35)+b)+b))))))/a)+pi)/a)\"\n\"((tan((0.70*(0.09*(0.08*(((tan((tan(((((cos(tan(((a-sin(cos((((((sin((((a-cos(cos((sin(tan(cos(((3.22-pi)/a))))-a))))-a)/b))/a)*pi)/a)*2.82)*a))))+pi)))*e)-b)*a)+2.63))+0.67))+b)+b)+e)))))*pi)-b)\"\n\"cos((((tan(((a/(b-sin((e/((((tan(((((sin(cos((((a*((sin(tan((tan((((((2.14-(((((a*tan(e))-pi)-pi)*3.70)-b))-a)*2.91)*a)/a))+a)))+a)+3.54))+3.88)/a)))-pi)-b)-b)+a))-b)/a)-pi)+pi)))))*a))-b)*e)/e))\"\n\"((((((0.51+(((((e+(sin(tan(((1.66/(((((a/(a-((((cos(((cos(((((((cos(sin(1.02))+pi)-1.76)+e)-b)+b)/e))+a)*b))*a)/3.14)*a)-b)))-3.60)+1.66)/a)+a))+a)))+pi))*pi)*b)*3.58)*b))+2.20)-pi)*2.79)*e)+1.40)\"\n\"((((3.40+(tan(cos((((tan((cos((sin(sin((b/sin((a-((((0.03+(tan(tan((a+(((((((tan(((((e*pi)/pi)/b)*e))-b)-2.62)-pi)*pi)+3.67)*b)*0.63))))+a))+a)+0.05)+a))))))*a))/pi))+b)*e)+a)))-2.26))+b)-1.34)+a)\"\n\"((tan(cos(((3.82+(sin((cos(((1.49/(sin((((((tan(((sin(((((tan((tan(sin(((((((cos(a)+1.23)+b)/pi)-pi)+a)+b)))*b))+b)*pi)+a)/1.02))-1.75)/e))+pi)*e)/b)/pi)-a))-3.28))+b))+3.45))+0.78))/a)))/2.19)+e)\"\n\"(a*((a/((a+cos((((((((((pi/(a-(((((b-(a*sin((b-tan(((pi+((((((pi/cos(cos((tan(tan((tan(tan(3.30))*2.76)))-b))))*2.98)/b)-b)+pi)+e))+pi))))))+a)+3.08)+e)-b)))-a)*0.18)/a)-pi)+pi)+b)*b)+a)))-e))-b))\"\n\"cos(cos((((((sin(((((3.94+((sin(((tan(tan(((sin((((tan((((sin(((cos(((((1.89/(3.75+a))*b)/pi)/a))+a)/e))+e)+0.44)-b))+b)-e)*b))*b)/1.32)))*3.89)+3.65))+pi)+b))*b)*3.89)*3.18))+1.43)-e)-a)*pi)+b)))\"\n\"sin(((e+(((sin((b+cos((((((pi/(sin((b/cos((sin((1.19/(2.01*(e*((0.92-(1.01-(tan((((((((((((3.39+a)-b)/a)/2.82)-e)-pi)+2.47)+a)+pi)-a)*b))-pi)))/a)))))*a))))+3.01))*a)*pi)+b)+b))))-e)+pi)-e))/3.27))\"\n\"((tan(((tan((cos((tan((((1.17-(cos(cos(sin(sin(((a+(((sin(sin(((((((0.28+(((((((((a/b)+b)*0.82)*3.26)+pi)-e)+a)-pi)+pi))-b)*a)*a)/a)+b)))+1.49)+a)-3.54))*a)))))*a))+b)-b))/a))-e))-b)-e))+3.37)+3.99)\"\n\"((((tan(((1.17*cos(((2.48+(((((((b+((b/((sin((cos(((1.40-sin(cos(cos((sin(tan(tan((((sin(((3.54-b)+a))+b)-0.79)*3.78))))-3.22)))))+b))-1.54))-e)-0.34))*a))+a)+a)/b)+pi)+e)-a))/3.66)))*e))/b)+b)-b)/a)\"\n\"(((cos(cos((((b*(((pi-tan((0.14-((cos(sin((sin((cos(((0.95/((tan((e+(((cos((cos(((2.51*tan(((a-cos(cos(b)))-0.49)))*a))+a))*b)+b)*b)))-a)/a))*a))+0.26))-pi)))-pi)+1.19))))+pi)-2.53))+b)/b)))+b)+a)*a)\"\n\"tan((cos((((tan(((e*(a-(((b/(((((cos((sin(cos((b+((2.54-((0.21*(cos(((cos(cos(sin(cos((((cos((a+b))*a)/b)-b)))))+b)/pi))-pi))+0.56))/a))))-a))/pi)+b)-2.31)/pi)-pi))+a)*pi)))+0.64))+2.78)-b)+a))+2.36))\"\n\"(cos(((b/((0.85*((tan(((((((tan(((((((((2.36/sin(sin((cos(((cos((a*((sin((((b+(b/(b/(1.37-pi))))*a)+a))/a)/0.45)))+pi)/pi))/b))))-b)+e)/2.54)+a)*b)/0.79)/b))+b)*b)+e)/e)+b)+b))+b)+e))+pi))+2.27))*1.70)\"\n\"(sin(((b-(sin(((b+cos((((cos(tan((((sin(sin(sin((((cos(((b*((tan(((((b/((((a*((pi*((b*b)/b))+b))-e)+b)+a))+e)+1.51)-b))-pi)+a))*a))+2.54)-2.36)-0.90))))*e)+b)/b)))/b)*3.23)+3.84)))+b))+2.12))+3.99))+a)\"\n\"sin(cos(((0.50-((((((b/tan((((((((e*(cos((sin((e+(cos((a-((e*((cos(((((((b-tan(((((pi*e)+e)-2.87)*b)))+a)*b)+e)*e)-1.39))*e)*a))+b)))*3.16)))*1.01))*a))+0.95)+b)/a)/e)*pi)*b)))/2.81)-b)+b)-e)+a))/pi)))\"\n\"(2.71/((sin((cos((tan(((a+(b-(((((b+(e-(sin(tan((sin((b-cos((2.58+(cos((((((2.57/(tan(((((1.54*(b+a))+b)-a)+b))/2.58))/2.19)/1.05)+pi)+0.23))+b)))))+b)))/b)))-a)+pi)-e)-a)))+2.34))*b))+pi))*2.87)+2.07))\"\n\"(a*(a/cos(sin((((a+sin((sin((((b/cos(cos(((2.08+(((sin(((((((((cos((((tan(((((pi+(((tan(e)-b)+pi)/pi))-a)*e)/e))-2.17)-2.66)-0.97))/a)/pi)+pi)*a)+b)+a)-a)/a))*b)/b)+a))/2.19))))-b)+1.49))+b)))+a)/b)))))\"\n\"(sin(((sin((1.99-cos(sin((pi*(1.22/((0.12-((1.04/cos(tan(((2.62*((((a+(cos(((cos((pi/(((cos(((sin((sin(cos((e/b)))+b))*b)+b))*a)/a)*b)))/pi)/e))*0.23))+b)*3.78)*a))+2.48))))+2.93))-a)))))))+a)+b))+2.74)\"\n\"(((((sin((tan((tan((pi+sin(((((tan(tan(((2.69-(cos(tan(sin((((((sin((((((((((((((pi*e)/a)+a)*pi)+a)+a)+a)/e)+e)*e)/0.98)/pi)/2.21))-b)+b)/a)/b)-b))))/pi))+pi)))-e)-b)+0.48)-pi))))*b))-a))+pi)+b)+b)-b)+a)\"\n\"(sin((cos(((tan((1.16+((((cos(cos((cos(sin(tan(tan(((tan(((((tan((((((((((sin(sin(((2.05/0.46)-0.96)))+a)-0.96)-b)+0.65)+pi)+b)/b)/b)+e))*e)+1.68)-e)/a))/b)-0.64)))))+b)))-a)-a)*a)-a)))-e)-3.82))/a))+pi)\"\n\"sin(tan(((((((sin(((pi*((sin(sin((cos((sin((((tan(((((((((((0.43-cos(cos(((e+((e+((((a+b)*1.12)/e)+b))+b))+1.07))))*b)+pi)/b)+a)*e)/b)/b)-pi)/3.44))+a)*b)+2.37))+b))+e)))*a)/b))+a))-pi)+b)-pi)+e)*a)*a)))\"\n\"((((sin(cos(((cos(tan((b/((tan(tan(((a*(sin(((((b+(sin(tan((sin((((cos(tan((sin((sin(sin(tan((2.02*e))))*2.47))-b)))/b)*a)+b))+1.71)))+a))+pi)+pi)/b))+2.53))*b)))+pi)+1.05))))+a)+1.76)))+3.09)-e)+e)-2.51)\"\n\"(((sin(((((tan((cos((((tan(((cos(((2.51+cos((b+(cos((e/sin((b/((((sin((((((cos(((((cos((pi-3.64))+b)*e)/b)/e))*b)+e)*a)/b)+pi))*a)*b)+a)*pi)))))-a))))+a))*b)+pi))/b)*pi)+pi))/b))-a)+a)*a)+2.89))-pi)/e)/e)\"\n\"(((tan(((sin(((sin((((((b-((((3.62*((b-((tan(tan((((sin(((((sin((b+sin((tan((((b*sin(a))/2.89)+a))/1.29))))*b)*e)/a)/a))*a)+3.61)/1.83)))/a)+a))+b))+e)+b)+b))*a)-pi)+a)-b))-3.94)+3.21))+a)*b))+3.73)+b)-b)\"\n\"((b/((((((0.13/((cos((b/(((((sin(tan(cos((tan((a+((((sin(cos((((b+sin((tan(((((b/((pi/tan(cos(a)))/b))*e)+e)-b))+e)))*1.79)+e)))*b)+pi)*b)/a)))-b))))/b)+b)-pi)*pi)*a)))/1.19)*a))-3.43)*1.97)/pi)/e)*b))-a)\"\n\"(((sin((cos((sin(((cos((((cos((((((tan(((a-(cos(cos((sin((((e+((a+(sin((tan((((((e-(((e+b)+b)/b))+a)+a)-e)+a))+a))+b))+b))/2.15)/a))+a)))-b))+pi))*b)-0.61)+1.39)+b)+a))+a)+a)*b))/a)*a))*3.46))-e))/b)-b)+a)\"\n\"(sin((((0.91-cos((tan((((((a-(pi-(tan(sin(((sin((sin(((((((a/(0.70+(3.86-(tan(((b-(2.22*(tan(sin(sin(a)))/0.43)))+a))+e))))+1.76)/1.57)*0.68)+2.12)+e))/a))+b)/b)))+0.73)))+e)/e)+b)*b))*1.22)))*2.01)+b))+a)\"\n\"sin(((sin((b+cos((((b/tan(sin(sin(((2.61-(tan(cos(cos((a*((((e/((b-((b+((((a*cos((cos(sin((pi/sin(((sin(((((b*b)+b)*a)-2.28))/a)*pi)))))+b)))/a)+b)+a))+0.66))-a))+b)-a)+a)))))-a))+e)))))/3.16)/pi))))/a)*b))\"\n\"cos((((b+((pi/(cos((0.96/(cos((((((((((pi-(((((tan(((a*((((tan(((((((tan(((b-pi)/pi))+1.97)+a)*b)-b)*a)+pi))-0.29)*a)+3.18)+2.57))/0.28))+pi)/e)+2.22)+a)*b))/b)-b)*pi)*pi)/e)/b)-e)/a))*a)))-0.59))*b))*pi)+b))\"\n\"(cos((cos(((((tan(tan(((((cos(((sin(cos(((((tan(tan(sin(tan((sin((((sin((((cos((((b+(e+cos(1.14)))+a)*a))+b)+a)*1.93))/3.01)/a)+b))+3.90)))))/pi)-a)-pi)-b)))/e)/pi))+a)/b)+a)+0.96)))+2.84)-pi)-a)-0.52))-a))-b)\"\n\"((((((((((((((((tan((cos(cos((tan((b+sin(tan(((((cos(((((tan((cos(((((1.29/b)*3.26)+b)/a))/a))-a)+3.76)*pi)*3.00))+b)*0.32)*pi)/pi)))))-a)))+0.33))/pi)/a)/e)+b)+pi)+b)+1.74)-a)-0.86)*b)/b)*b)+pi)/a)+3.45)+3.37)\"\n\"(sin((cos((((((3.76+((((((cos(((((a+((((cos((((((tan(((((e*((((b+((tan(((e+a)-a))*pi)*1.08))*3.94)/b)-1.33))+pi)*pi)/a))*2.90)+b)/e)-2.68)+b))*a)*b)*b)+a))+b)+pi)+b))+a)+pi)-a)/a)+e)+a))*b)+b)-1.29)-e))*a))+pi)\"\n\"(((3.47-(((e/(cos((((cos(((b/((a/(a*sin(sin((sin((sin(((((((tan(sin(((tan((tan(((cos(cos(cos(sin(b))))-a)-a))+3.05))*a)+a)))/e)+b)-2.98)/b)*0.94)+b))/b))-e)))))-e))/b))/b)+2.93)*0.04))*pi))+1.10)/1.30))*b)-1.19)\"\n\"((pi*sin((pi+(sin(((cos((sin(((cos((((((((sin(((((((cos(sin(sin(tan((cos((b/((b+(b*((cos(((a+b)/a))/a)*1.35)))-a)))/b)))))/b)/b)-b)-b)+a)-1.27))/b)/3.78)-b)/0.32)/b)/a)+b))-b)-0.24))-b))*0.32)+2.23))*3.64))))/b)\"\n\"(((b+(tan(((cos((((((((((e*(((tan((cos(((sin(((((((cos((tan((((tan((((cos(pi)-pi)+2.65)+3.87))+3.01)/2.57)*a))/a))+a)+b)*1.52)/a)/e)-b))-e)*a))+e))/b)-e)-b))/0.08)*1.98)/pi)+2.88)*b)+b)*b)-a))*a)/0.58))*b))+e)+b)\"\n\"(((sin((((((((tan(cos(tan((a+(cos((((b*(1.00-((((((((0.71+tan((a+(2.72-tan(sin((((b+(sin(((b+b)*a))+3.87))-2.62)*pi)))))))-0.93)-a)-b)+2.18)/e)*2.12)/pi)))/b)+a))+b)))))+3.28)*pi)+a)+pi)*e)/0.23)/0.13))+e)+pi)*a)\"\n\"((b+((1.43*((e*cos(sin((e+(a+((((3.19/sin(cos(sin((pi-(((((cos((tan(sin(tan((cos(((1.51+cos((((tan((a+cos(sin(tan(((e+a)/e))))))-b)*2.29)/b)))*b))/a))))+pi))+a)+3.60)*pi)*a)*e))))))+1.06)*a)/e))))))+a))-2.52))*b)\"\n\"((sin((3.73+(((tan(sin((1.00/tan((tan((((((((((((cos(((pi+(((((((((cos((cos(((pi+(b-0.01))/pi))-a))/3.09)+b)+b)-0.30)+b)-a)+3.48)/3.91)-b))*pi))/a)+b)*pi)+0.18)+a)+e)/b)/a)/1.55)-1.96)+b))+a)))))+b)+a)+a)))/b)*a)\"\n\"(2.54*((((tan((sin((((cos((b/((3.95-cos((tan((cos(((3.58*(1.71+((tan(((cos((tan((((2.28*cos((b*(sin(sin((((1.04+e)+e)*a)))+b))))*b)+b))*pi))+0.27)-a))-1.42)+2.36)))/b))-b))-b)))/a)))-a)*b)-b))+3.68))-a)*b)-e)/a))\"\n\"(a/((cos((((1.77-((b-((((((1.57/(((((((cos(sin((((pi/((3.22*sin((sin(((sin((sin(((((b*cos((b+a)))+a)*b)*b))-b))+b)*a))+e)))+b))+0.61)+pi)))*b)+a)-e)+1.77)/pi)+pi)+e))/0.97)+a)*0.86)+pi)/pi))+a))*pi)+b))+e)+0.55))\"\n\"sin((sin(sin((tan((1.75/((cos((((((tan(sin(((((((sin((sin((((((cos((((pi+(((tan(((b+tan(b))-0.19))*0.13)+a)+2.51))*a)/1.20))/pi)-pi)*b)*1.43)/a))+b))+a)-b)-pi)+a)/b)*2.63)))/e)/b)+3.47)+e)-a))-pi)*b)))*a)))+3.38))\"\n\"tan(((b-(sin(((pi+(e/(((3.02+((cos(sin((((tan((cos(sin(cos(((cos((a+((sin((((((tan(sin((0.38+(cos(sin(2.21))+1.11))))/0.14)+a)/pi)-b)*pi))+b)*pi)))+pi)/e))))+1.62))+pi)+a)*3.74)))*pi)*b))/a)/b)))+b))*1.87))-0.30))\"\n\"(2.18-((((b/((cos((b/cos((sin((b*((1.53*((b-(2.44+sin(((2.96*(((((pi*(((pi+cos(((((pi*(e*((((tan((b+((1.28+a)-b)))+2.84)*b)+pi)+0.12)))*a)-a)*a)))+e)*b))-pi)-b)*e)+1.62))/0.32))))+b))+1.48)))+a))))+a)-b))-b)+a)/b))\"\n\"((tan(((cos((sin(tan(((2.56/cos((((((tan((((((2.31+(sin(cos((((((pi+(b+cos(((a/(2.47*((e/tan((((2.11*cos((a+b)))/a)*e)))*pi)))-1.91))))+e)*b)+e)+b)))*a))+a)*3.78)-a)-pi))+pi)+pi)+a)+e)/0.71)))+a)))*b))*a)*a))/pi)*e)\"\n\"(e+cos((((((sin(((((((((3.02/(tan((2.42+((tan((((((((tan((sin((0.88-(b/((tan((tan(cos(((a/cos((e+b)))*b)))/pi))/b)+a))))*3.44))+b)/3.88)-pi)*a)+b)/pi)-1.28))/b)+a)))*a))*a)/pi)/1.57)+e)/pi)+pi)+pi))+a)/b)/a)+a)+1.50)))\"\n\"((((b-tan((sin(((sin(tan(tan((pi+((((sin(((((pi+tan(sin((tan(((b+((sin((cos(((a/((tan((cos(((sin(((a-b)/a))/a)-b))+0.47))-2.02)+e))+2.25))*e))/2.40)/pi))/b))-b))))-b)/a)-pi))/pi)/3.74)+pi)+a)))))*b)/b))+1.72)))+b)+b)+b)\"\n\"(cos(((0.68+(b*sin((tan(tan((2.36*((a/(sin((tan((((b*((((tan(((sin((((cos(((tan((((e*(pi+((a+(a/((((1.33*sin(a))+e)+b)+a)))*pi)))-e)*2.25))+b)+3.59))+b)*a)/a))-pi)+b))*b)*a)/a)-a))/2.34)*e))-pi))-a))-e))))+a))))-e))+pi)\"\n\"(((((cos((sin((((cos((cos(sin((e-(e*(((cos(((((((1.67*(cos(((a*(((tan(((((a*(sin((cos((a-(((0.51+a)/a)*a)))+2.73))+pi))+a)/e)+a))/e)/a)-a))*b))*2.94))+a)/b)-e)+b)+e))/a)+0.98)*pi)))))/b))-pi)-b)*1.03))/e))-a)+a)+a)+a)+b)\"\n\"((cos((pi-((3.01/(a-((((((((a+(b+tan((a-sin(tan(cos((cos(tan((cos(sin(((((((((((((sin(((3.31/(pi/(3.01*0.89)))+2.78))*e)*b)+e)+3.60)/b)+e)*b)+a)+a)+2.01)*b)*b)))/0.63)))+e))))))))-b)/1.46)/pi)+2.68)+a)+b)-b)))/b)))+a)*a)\"\n\"cos(tan(((pi-cos(((((tan((((a*tan((e+tan((sin((((0.73*((tan(sin((((((((b+(((((tan(((((sin(((tan(((a+b)+b))*e)-a))+a)/e)/e)+e))*b)/b)-pi)*e)/a))*2.03)+b)+e)/a)-e)-b)))/b)*e))*pi)/2.03))*e)))))*b)*b))+b)-0.19)/b)+b)))-a)))\"\n\"sin(tan(((a+tan((pi+tan(tan(cos((((tan(((tan(((2.99-(cos((a+((((((cos(((((cos(((sin(tan((a+(b+(a+(sin(cos((pi-(a+2.91))))/b))))))/b)+a))+e)/a)+0.73)*a))+pi)+3.40)+2.95)*pi)/b)-pi)))*a))/a))+a)+b))+pi)+2.81)/a)))))))-e)))\"\n\"cos(((sin((2.38+(cos((b+(tan(tan(cos((sin(sin(cos((3.28*(((cos((3.60*sin(((sin(((((((tan(((((((tan((cos(((a-a)/1.03))-pi))/pi)+0.67)*b)-e)*e)-0.71))/b)/b)-e)+e)/b)-a))*a)+1.36))))+e)*a)/1.81)))))+pi))))-e)))+b)))-b)*0.47))\"\n\"((e*((((2.17-(1.53-((((((((((((((2.86+((((b-(pi+(e+((((((((b/(cos(sin((((((((((b-b)+a)*e)-a)+b)/a)+a)*a)/e)))+a))*pi)/a)/pi)*a)*0.81)+1.42)+pi))))+b)+b)+b))/e)+e)-3.58)/pi)-b)/a)+1.91)*b)-e)-b)+a)*1.19)/a)))+a)-2.06)+e))*e)\"\n\"(((cos(((((sin(tan((((((tan(cos(((cos((cos(((tan(sin((tan((((((cos(((sin((((((tan((pi/a))+0.25)/b)/2.16)*a)+a))/a)/2.54))+b)+b)/a)+3.61)*a))*e)))+a)+3.97))*b))/b)+2.46)))/a)+b)-a)*a)/3.46)))+1.50)*2.67)*b)*0.61))*a)/a)*1.43)\"\n\"((sin((pi/((((((((sin(((a-cos((sin((tan(((sin(((cos(((((((cos(sin((((cos(sin(((tan(sin((tan((a/e))*b)))-e)+1.93)))+pi)/b)-a)))/b)-pi)/b)-a)-a)-pi))+b)-a))+e)+a))+1.36))*b)))+3.28))-2.14)+b)-2.89)/a)+e)/a)-0.96)-a)))/2.12)+a)\"\n\"(((cos(((cos((a/(((cos((((e+(cos(((3.92-(sin(((tan((sin(((((((b/(cos(((a*sin((((pi+((((cos(sin(b))-3.44)+a)-2.29)-a))/e)/b)))+a))+1.02))+3.38)-e)/a)+b)/pi))*a))-e)-pi))+b))+a))+e))-3.24)*a))/e)-a)+1.16)))*a)-2.32))/1.66)+a)+e)\"\n\"(cos(((sin(sin(((tan(sin(((((e-(((2.03-(cos((tan(((tan((tan((((cos((cos(sin((cos(((sin(((sin(((b-a)/0.05))-b)-b))-3.06)*a))/a)))+a))+2.42)-a)/2.88))/2.21))-b)*b))*3.23))+0.91))*0.68)+e))+a)*3.57)-pi)))+0.78)+a)))/1.55)/pi))*a)\"\n\"((((((b*(e-((((((((((((a+(((((cos((((((((((e-((tan(sin(((sin(((((((1.63-a)*0.64)-b)*1.09)*e)+b))+3.06)+e)))*b)+b))+pi)/e)/pi)+a)+pi)+b)-b)+pi))/e)+a)+b)-e)/a))/0.23)/a)/pi)/b)+pi)+b)+0.20)+b)+1.52)-a)*pi)))/b)+1.62)/b)-a)-0.12)\"\n\"(cos(sin(sin(sin(((((e+((cos(cos((((((cos(((cos(cos(((b+tan(cos(((((((tan(cos((b-sin(((pi+sin((((((a/(tan((b-pi))/a))*b)+1.88)-1.57)+2.70)))+e)))))/b)+a)*e)/a)*1.09)-b))))+e)))-b)+e))*b)+a)+b)+pi)+b)))-e)+0.64))+e)/b)-pi)))))-b)\"\n\"((((b-(cos(((cos(((cos(cos(sin(((a+(sin((b-tan((sin((((((0.09+cos((((b+((sin((((sin((2.69/cos(cos(sin((e*(((tan(tan(b))/pi)+b)/pi)))))))-b)*pi)*1.34))/b)/3.38))-e)*b)))+b)/b)+a)+pi))-a))))*b))*pi))))+a)*b))*e)+2.16))+a))+b)+e)*e)\"\n\"(((((pi/(a/((2.53+(1.11-(((a+(pi*((tan((((((pi+(tan((((((((b-(a+tan(sin(((pi-(a-((((b+tan(((((a-e)-e)*b)*a)))*2.79)*a)+3.38)))*2.67)))))+e)+1.96)+1.73)+a)*a)*a))/pi))+0.76)+e)+2.11)+b))*a)*0.27)))*b)*2.31)))*e)))/a)+2.82)+0.10)*b)\"\n\"tan(((((((b+cos(((b*cos(((cos(((tan(((sin((a+(((((((((e/sin((tan((2.93*(cos(((tan(tan(((b+sin((pi*((1.11/a)+e))))-3.08)))-b)-3.45))+a)))+2.37)))-b)+1.26)+b)/b)*a)-a)/2.02)+e)))/e)+pi))*b)/pi))/a)*e)))+0.77)))+pi)*pi)+pi)+b)+2.45))\"\n\"((((((b+((cos((((sin((((sin((e*(a+(pi-((((((sin(sin((tan(cos((e+(2.41-tan((1.26/(((sin((((sin(((pi/pi)/a))+pi)+a)+a))/a)+pi)+3.72)))))))-e)))/1.89)/3.01)-a)+2.67)+a)-a)))))+b)+b)*a))*b)+2.33)/pi))-3.93)-0.90))*3.86)+a)/a)*1.05)*pi)\"\n\"(((((b-(cos((((pi+tan((sin(tan(sin(((a*(((e*((cos(tan(cos(((((((cos(sin(((((tan(((((a+((0.04-(3.76+b))-1.97))*b)+e)-b))+b)-3.97)+b)+pi)))-1.69)+0.20)-b)+3.36)*a)/b))))*b)+a))+b)+pi))/b))))*2.41)))/0.49)+e))+0.81))+a)/a)*3.64)/2.12)\"\n\"(((((cos((pi-(cos((1.61*(sin(sin(((a/(((((((((a/tan(((b+((sin(((a+(((1.04+(sin(tan(((cos(cos(((b-b)-pi)))+0.51)-b)))/pi))*1.36)+0.85))-a))-1.64)+a))/b)))-1.78)+pi)/1.05)*b)+a)*pi)-e)-3.76))+e)))+2.82)))/0.94)))/e)*1.11)+b)/a)*2.19)\"\n\"(((a+((2.44/(((a+((((tan((((tan(((1.54+(sin((b-(sin(sin(cos(((tan(((sin(sin((b+sin((1.88+(((tan((b+(((tan(b)+0.06)*b)/0.27)))+pi)+e)+pi))))))+1.93)+a))-1.31)*b))))+a)))*a))+b))-3.30)*3.23)+b))-a)*2.75)*b)+a))-a)+0.56))+b))+1.64)-b)\"\n\"((sin((sin((tan(cos((cos(((((((((e*(a+(0.62*(tan((sin((((((((a+tan(((((((((((e-(sin(tan((b/a)))-a))*b)+pi)-a)/3.19)/a)-a)-1.54)-b)+0.34)))/0.74)-b)*a)*b)*e)*3.64))/1.81))/3.78))))/e)*a)-a)-2.38)-e)+a)+e))/pi)))-e))/3.92))+0.77)*pi)\"\n\"(a+((((1.14+cos(((cos(((sin((((((tan(((b+(((a+(tan((((cos(((2.61*((((((((((((a+tan((((((a-a)+b)+b)*pi)/a)))*e)+b)/b)-3.55)-a)+b)/b)+a)*e)+b)*pi))+a))+b)*b)/b))-b))*b)*b))-3.30))+a)+2.07)-b)+a)-2.06))-pi)/b))*3.28)+b)))*3.08)/a)+e))\"\n\"((((b-cos((((sin((((a+cos((((((b/((((((e+tan(cos(sin((((a-((cos((a+(((((((2.77*tan(((((sin(pi)/b)/0.94)*b)-b)))+a)*pi)+b)*b)/b)-0.81)))*a)+1.28))*3.77)-a)))))*b)+a)+pi)+a)*b))-3.56)-a)-a)+pi)))-2.72)*b))/a)+pi)+2.40)))*e)+0.27)+2.82)\"\n\"sin((0.89+((1.81+(b*((((tan(sin(sin((cos(((a+(((((sin(cos(sin(((((e*(cos((sin((cos(((((a+(((((tan(((sin(b)+pi)/3.94))/pi)+b)-a)+b)*b))*1.28)-b)-a))*a))-pi))/a))-b)+a)+3.75))))+3.92)+3.90)*a)-2.27)*pi))+b))-a))))+e)*a)+b)+2.74)))+a)))\"\n\"(((a+(sin(((cos(((e+(((tan(((cos(((((tan((sin((((sin((sin((tan(tan(cos((e-(tan(((((((((((b+(pi-0.95))*e)+b)+a)+a)/a)+0.64)+b)-a)-b))-e)))))/0.62))-pi))+a)+a)/3.50))*a))-a)+a)+pi)*e))+0.83)*2.71))-pi)+b)/e))+b))/1.80)+b))/a))-pi)+0.99)\"\n\"(((pi*(((cos(tan(((((pi+((b-(((((1.88+(sin(cos(((2.19*tan(((tan((pi*tan(cos((((((b+sin(tan(((((cos(((((b+1.02)+b)/a)*a))/b)/b)*a)+3.93))))+e)-a)+a)*1.92)))))-b)-b)))*a)))-2.08))*a)-2.89)+e)+a))*a))+2.87)/e)+a)))*a)*pi)+e))*0.97)+1.03)\"\n\"tan((pi+sin(((tan((tan((((((tan((a*(1.83*(((((((cos(((b*(((0.91/((((((((sin(((((sin(cos((a/cos(1.59))))+a)-e)/b)*3.20))+1.99)+a)/pi)+2.66)-b)*a)*2.43)-b))/a)+b))+3.44))-a)+b)-3.30)+b)+b)/a)+a))))*1.53)+a)-a)+b)/b))*0.18))+0.61)+pi))))\"\n\"(b+((sin((((b+tan((((sin(((((cos(sin((((cos(cos(((cos(((tan(((((((((((((a+cos((((tan(b)+e)/2.04)/3.86)))+b)+a)+pi)*b)+b)*a)*b)*a)*0.74)+1.01)/a))-1.74)+b))+1.23)+1.63)))*b)/e)-3.09)))+b)/b)*pi)*2.11))+b)/1.09)-a)))-pi)+2.52))/a)*1.47))\"\n\"tan((2.46-(((cos((a-((tan((((((a+((cos(((((b*(((((((b*sin(cos((((((tan(((sin((sin((((a+tan((3.79*a)))/3.35)-1.95))+b))+a)+2.08))*b)*e)-pi)+a)/a))))+3.57)/a)*e)+1.76)/3.18)+b))/2.75)+e)+pi))+3.54)+b))+1.11)-a)/b)+b))-pi)+e)))/b)-pi)+b)))\"\n\"((tan(((pi+tan(cos((2.46/(((sin((a/cos((((((((sin((pi+tan(cos((2.09*(pi/((sin((sin(((tan(((((b/(cos(tan(cos((((1.57/b)*b)/a))))/2.68))-3.31)+a)/b))+pi)+b))*e))/1.95)*0.23)))))))/3.61)*e)*b)*b)+b)/e)+b))))*b)+b)/0.60)))))*3.68))*pi)-2.18)\"\n\"(cos(((b-cos(((((b+(((tan(((sin(((2.54*(tan(cos(((((cos((cos((((cos((tan(((((((((((a+cos((((pi+b)/b)*pi)))+a)-1.01)*pi)*pi)-e)*b)+b)-2.56)*b))+pi))+b)-pi)+1.17))+a))*pi)+b)-a)-0.36)))+pi))+a))*pi)+e))+b)/e)+a))+0.56)*a)*1.79)))-3.07))+a)\"\n\"tan(sin(((((((((pi*(((((((cos(tan((sin((((cos(cos(((((((tan((((sin((((cos((3.82*((cos(a)-b)/b)))/b)/3.17)-1.23))/e)/a)+pi))+b)+3.36)+b)/e)+a)+e)))+1.00)-b)*e))/1.26)))-2.13)+a)+b)+3.94)-a)-2.46)+3.10))/1.02)*pi)-1.45)/a)+2.55)*a)-1.28)))\"\n\"((((((tan((3.22-sin((((b+(((2.20/((cos((((1.32/(((((1.11*cos(((((((tan((0.21*(((0.46+sin(((((((a*b)-0.24)*a)+a)/a)*b)))+3.17)/1.26)))*a)+1.87)*e)/pi)/b)-pi)))-pi)+a)/a)+b))/b)*pi))/e)+2.10))-pi)*0.82))/b)-b))))+1.21)-a)+2.76)*b)-pi)*3.03)\"\n\"(((((0.79+((b*cos(tan(((pi/(cos(((pi+sin((b/(((3.91/(((b*(((a+((tan((2.64/sin((sin((((((tan((((((b+((((e-e)-pi)*0.39)+b))*b)*e)/a)-a))+b)+0.32)/pi)*0.43)/0.51))-a))))*1.70)-b))/b)+e))+0.22)+3.93))/a)+b))))+a))+b))-a))))-3.56))+b)+a)/a)*b)\"\n\"cos(sin(((((b+sin((cos((((((((((a+((((cos(((sin(cos(cos((cos(((((tan((b*((((tan((sin((a*(((1.45/a)+a)*e)))/pi))+2.08)+b)-3.91)*a)))+a)+3.56)/pi)-e))+0.59))))-0.68)+0.39))*a)*1.69)*1.23)+a))-a)+pi)/2.64)+pi)+1.60)+b)+b)*a))/b)))*b)/b)-e)))\"\n\"tan((((cos(tan(((tan((((1.92+(pi/(pi-sin((cos(((((tan((((sin((((sin((0.40+cos((tan((tan((((sin(((((((e+2.58)+3.88)+b)-b)+a)+e))*0.10)+a)+b))*e))*a))))+a)+pi)/0.78))+a)/pi)*3.29))*a)/b)/2.71)*3.53))+1.87)))))/2.72)/e))/a)+0.49)))+pi)+a)-b))\"\n\"cos(cos((a+(((b-((b*((((((cos(cos(((((sin(tan(cos(cos(((((0.24*sin((tan(tan(tan(sin((((tan(sin(((((a+(cos(((cos(a)+a)-a))/a))/a)+a)+pi)))+pi)-a)*0.73)))))/2.23)))/b)-b)+2.76)))))-2.45)+e)+1.39)/b)))-3.73)-b)+pi)-b)-a)+2.24))+b))+0.82)+b))))\"\n\"(((((((a+(((((tan(sin((((tan((((cos(((((((sin((b-((((((sin(cos(((sin((a*sin(((cos((((b+b)/pi)+2.97))-b)+e))))+e)/b)))+e)+e)-3.39)+2.10)*e)*b)))+b)/b)+3.57)*e)+pi)-3.21))*3.03)+e)+a))/e)*b)+pi)))*pi)/b)/b)+a)+0.55))-b)/1.95)+2.86)-e)/3.47)*b)\"\n\"(((((tan((((((tan((tan((sin(cos((sin((((tan((((tan(sin(((cos(((((((sin((((b+cos((e/(sin((a*((3.58/a)-2.92)))/a))))+3.92)*e))+0.45)+b)-b)+a)-b)+1.12))+pi)*b)))-3.21)+b)/a))-b)+b)+1.54))+3.69)))*0.85))+0.54))+a)*a)-b)-1.01)+a))/pi)-b)*a)*a)/a)\"\n\"tan(sin((1.38/tan(((a/(1.33/sin(((((tan(((((((((e*(((((((3.01-(((tan(cos((cos((tan(tan((((((((cos((a/pi))/pi)-b)+b)-3.72)+a)+e)/b)))/0.60))*a)))-1.28)+1.26)+2.75))-a)/0.27)*pi)/a)-0.13)/3.64))/b)-a)*a)/0.23)+b)-pi)*a))+e)-pi)+b)/b))))+a)))))\"\n\"(((((a+cos((pi+(((((((((((sin(cos(((((a-((tan(sin(((a+cos((((tan(cos((((((b/(((a+tan(sin((((2.31+a)-a)+a))))+pi)*pi))*a)-b)*b)/pi)))*b)/pi)-a)))*0.04)))+2.43)*b))-a)*pi)/b)))+a)/e)+3.55)/3.98)/3.19)+e)/a)+1.25)-3.32)+a)+0.57))))/e)+1.05)+e)/b)\"\n\"(tan((((a+(sin(((((a+((cos((((2.76+(((sin((((((sin((((((cos(cos(cos(((((a/((sin(((((2.83/(((pi/pi)+a)-pi))*0.44)+0.41)+pi))/a)/b))-e)+b)/a))))+pi)+2.28)+b)*a)+b))-pi)*pi)+0.29)/a)*b))+1.87)*pi)/a))/1.59)/pi))+pi)*0.72))*a)*b)+a))+b))-a)+e))-e)\"\n\"cos(tan(tan(tan((((e-(sin((tan((((sin((3.77+((b*((((0.52/((((cos((((((((sin(cos(cos((((a*((((a/((tan((e*0.95))+b)/e))+b)/3.79)/b))+e)/e))))+a)/e)+e)+1.29)*a)*2.28)/1.25))/pi)/0.59)+b)+b))+b)-3.22)*a))*a)))-pi)+b)+0.72))*2.37))+b))/a)*3.87)))))\"\n\"((a-((cos(cos((a-(((((sin((((a+tan((((e/((((((2.42+((((e*(1.24+((tan(((2.78/(tan((3.53+(a-sin((((((tan((tan(e)+2.11))*b)+a)+a)+pi)*0.78)))))*2.24))-pi))*pi)/pi)))-a)/b)*b))+b)+a)-0.07)/a)+b))+e)*a)))+e)/e))+b)+2.78)*b)+b)+b))))/pi)-0.32))-2.28)\"\n\"(sin(((((b+(((((sin(((0.70*tan(((((((cos((((2.90-((cos(((((sin(cos(tan(((((((((cos((((((pi+b)+b)+0.59)+1.86)*b))/pi)/b)+0.86)+e)+b)+3.99)/b)+a))))*b)-1.17)*b)/2.26))+e)/pi))*3.26)+pi))+a)+a)/a)+a)+3.89)+a)))-b))*a)/e)+3.63)+pi)-a))/a)-e)-pi))/b)\"\n\"((0.97-((2.02/(e/((3.84+(sin((sin((((((a*tan(sin(tan((((((b*(a+(((3.30-cos((1.16*sin(cos((cos((((sin((((cos(((cos((tan((cos(b)/e))/e))+a)+b))+e)*3.65)/e))-b)-b)*pi))-b))))))/3.10)/e)))+2.68)-0.68)*1.86)+a)))))/pi)-a)+pi)+a))+b))/pi))*b)))+e))*0.05)\"\n\"((a+(a+(((e*(0.81*((cos((((sin(cos((((((((tan((((((sin((cos((tan(sin(tan(((tan(tan(((((sin((((((b*3.14)+pi)-pi)-a)+pi))/b)-a)-a)+e)))*a)+a))))+a))*3.98))+b)/pi)+3.03)+3.90)+2.97))/0.03)+1.83)-3.34)*b)+b)-1.39)+a)))*a)+1.54)-pi))/3.98)*pi)))+a)-b)))+a)\"\n\"(b-cos(sin(tan(cos(((sin(((((sin(((((3.70+(2.48+sin((b/(sin(((3.46*sin(sin(((cos((cos(sin(((tan(((((0.74*((sin((0.10-((cos(cos((tan(a)/a)))+2.68)-b)))*b)*b))+pi)-2.83)-b))+a)+pi)))*0.89))/pi)+b))))+3.72))*a)))))+e)+e)/pi))*1.03)*2.24)+b)/a))/pi)+1.53))))))\"\n\"((((((((x*y)*7.123)-w)/((x+y)+(7.123*w)))/(((x+y)-(7.123/w))-((x*y)+(7.123-w))))/((((x+y)+(7.123*w))*((x/y)+(7.123-w)))*(((x*y)+(7.123-w))+((x/y)*(7.123-w)))))/((((x/(y+(7.321*w)))+((x-y)/(7.321+w)))+(((x-y)*(7.321+w))*((x/y)*(7.321+w))))+((((x-y)/(7.321+w))/((x*y)/(7.321+w)))/(((x/y)*(7.321+w))-(x+((y/7.321)*w)))))))\"\n\"((((((((x*y)/7.123)-w)/((x-y)-(7.123*w)))/(((x-y)+(7.123/w))-((x+y)*(7.123*w))))/((((x-y)-(7.123*w))*((x+y)*(7.123/w)))*(((x+y)*(7.123*w))+(x-(y/(7.123*w))))))/(((((x+y)-(7.321*w))+((x/y)+(7.321+w)))+(((x*y)+(7.321+w))*((x/y)/(7.321-w))))+((((x/y)+(7.321+w))/((x*y)*(7.321-w)))/(((x/y)/(7.321-w))-(x-((y-7.321)*w)))))))\"\n\"((((((((x+y)*7.123)-w)-((x+y)-(7.123*w)))-((x*(y-(7.123*w)))/((x*y)+(7.123+w))))-((((x+y)-(7.123*w))+((x/y)+(7.123+w)))+(((x*y)+(7.123+w))*((x/y)/(7.123-w)))))-(((((x/y)-(7.321/w))*((x-y)+(7.321+w)))*(((x-y)-(7.321+w))+((x-y)*(7.321/w))))*((((x-y)+(7.321+w))-((x*y)*(7.321+w)))-(((x-y)*(7.321/w))/(x+((y/7.321)+w)))))))\"\n\"((((((((x+y)/7.123)-w)-((x-y)+(7.123*w)))-(((x+y)+(7.123/w))/((x*y)-(7.123-w))))-((((x-y)+(7.123*w))+((x/y)-(7.123-w)))+(((x*y)-(7.123-w))*(x-(y*(7.123/w))))))-((((x*(y+(7.321*w)))*((x/y)-(7.321+w)))*(((x*y)-(7.321+w))+((x/y)/(7.321+w))))*((((x/y)-(7.321+w))-((x*y)/(7.321-w)))-(((x/y)/(7.321+w))/(x-((y+7.321)*w)))))))\"\n\"((((((((x-y)*7.123)-w)*((x+y)-(7.123/w)))*(((x+y)-(7.123*w))+((x/y)+(7.123+w))))*((((x+y)-(7.123/w))-((x*y)+(7.123-w)))-(((x/y)+(7.123+w))/((x*y)*(7.123-w)))))*(((((x/y)-(7.321*w))/((x-y)*(7.321+w)))/(((x-y)+(7.321+w))-((x*y)*(7.321+w))))/((((x-y)*(7.321+w))*((x/y)*(7.321+w)))*(((x*y)*(7.321+w))+(x+((y/7.321)/w)))))))\"\n\"((((((((x-y)/7.123)-w)*((x-y)+(7.123/w)))*(((x-y)+(7.123*w))+((x/y)-(7.123-w))))*((((x-y)+(7.123/w))-((x+y)*(7.123*w)))-(((x/y)-(7.123-w))/(x+(y/(7.123*w))))))*((((x*(y-(7.321*w)))/((x*y)+(7.321+w)))/(((x/y)-(7.321+w))-((x*y)/(7.321-w))))/((((x*y)+(7.321+w))*((x/y)/(7.321-w)))*(((x*y)/(7.321-w))+(x-((y-7.321)/w)))))))\"\n\"((((((((x/y)*7.123)-w)+((x+y)+(7.123/w)))+(((x+y)+(7.123*w))*((x/y)+(7.123-w))))+((((x+y)+(7.123/w))/((x*y)-(7.123-w)))/(((x/y)+(7.123-w))-(x+(y*(7.123/w))))))+((((x/(y-(7.321*w)))-((x*y)-(7.321+w)))-(((x-y)/(7.321+w))/((x*y)/(7.321+w))))-((((x*y)-(7.321+w))+((x/y)/(7.321+w)))+(((x*y)/(7.321+w))*(x-((y+7.321)/w)))))))\"\n\"((((((((x/y)/7.123)-w)+((x-y)-(7.123/w)))+(((x-y)-(7.123*w))*((x+y)*(7.123/w))))+((((x-y)-(7.123/w))/((x+y)/(7.123*w)))/(((x+y)*(7.123/w))-(x+((y+7.123)/w)))))+(((((x+y)-(7.321/w))-((x*y)+(7.321-w)))-(((x/y)+(7.321+w))/((x*y)*(7.321-w))))-((((x*y)+(7.321-w))+((x/y)*(7.321-w)))+(((x*y)*(7.321-w))*(x-((y*7.321)/w)))))))\"\n\"(((((((x*y)*(7.123+w))+(x+((y/7.123)/w)))+((x+((y/7.123)+w))*((x*y)+(7.123*w))))+(((x+((y/7.123)/w))/((x*y)-(7.123*w)))/(((x*y)+(7.123*w))-((x+y)-(7.123-w)))))+((((x+((y+7.321)*w))-(((x/y)*7.321)-w))-((((x*y)*7.321)-w)/((x+y)+(7.321*w))))-(((((x/y)*7.321)-w)+((x+y)+(7.321/w)))+(((x+y)+(7.321*w))*((x/y)+(7.321-w)))))))\"\n\"(((((((x*y)*(7.123-w))*(x-((y*7.123)/w)))*((x-((y-7.123)*w))+((x/y)-(7.123*w))))*(((x-((y*7.123)/w))-(x/(y+(7.123*w))))-(((x/y)-(7.123*w))/((x-y)*(7.123+w)))))*((((x+((y/7.321)/w))/((x*y)-(7.321*w)))/(((x*y)+(7.321*w))-((x+y)-(7.321-w))))/((((x*y)-(7.321*w))*((x+y)+(7.321-w)))*(((x+y)-(7.321-w))+((x+y)/(7.321/w)))))))\"\n\"(((((((x*y)+(7.123*w))-((x+y)-(7.123-w)))-(((x-y)-(7.123/w))/((x+y)/(7.123*w))))-((((x+y)-(7.123-w))+((x+y)/(7.123/w)))+(((x+y)/(7.123*w))*(x+((y+7.123)*w)))))-(((((x+y)+(7.321*w))*((x/y)+(7.321-w)))*(((x*y)+(7.321-w))+((x/y)*(7.321-w))))*((((x/y)+(7.321-w))-(x+(y*(7.321/w))))-(((x/y)*(7.321-w))/(x-((y*7.321)*w)))))))\"\n\"(((((((x*y)+(7.123+w))*((x/y)/(7.123-w)))*(((x*y)/(7.123-w))+(x-((y-7.123)/w))))*((((x/y)/(7.123-w))-(x-((y-7.123)*w)))-((x-((y-7.123)/w))/((x/y)-(7.123/w)))))*(((((x-y)*(7.321/w))/(x+((y/7.321)+w)))/((x+((y*7.321)*w))-(((x/y)/7.321)-w)))/(((x+((y/7.321)+w))*((x*y)+(7.321*w)))*((((x/y)/7.321)-w)+((x-y)-(7.321/w)))))))\"\n\"(((((((x*y)+(7.123-w))+((x/y)*(7.123-w)))+(((x*y)*(7.123-w))*(x-((y*7.123)/w))))+((((x/y)*(7.123-w))/(x-((y*7.123)*w)))/((x-((y*7.123)/w))-(x/(y+(7.123*w))))))+(((((x/y)*(7.321+w))-(x+((y/7.321)*w)))-((x+((y/7.321)/w))/((x*y)-(7.321*w))))-(((x+((y/7.321)*w))+((x*y)+(7.321/w)))+(((x*y)-(7.321*w))*((x+y)+(7.321-w)))))))\"\n\"(((((((x*y)+(7.123/w))/((x+y)*(7.123-w)))/(((x+y)+(7.123-w))-((x-y)/(7.123*w))))/((((x+y)*(7.123-w))*((x-y)/(7.123/w)))*(((x-y)/(7.123*w))+(x+((y-7.123)*w)))))/(((((x-y)+(7.321*w))+((x/y)-(7.321-w)))+(((x*y)-(7.321-w))*(x-(y*(7.321/w)))))+((((x/y)-(7.321-w))/(x+(y/(7.321*w))))/((x-(y*(7.321/w)))-(x-((y/7.321)*w)))))))\"\n\"(((((((x*y)-(7.123*w))*((x+y)+(7.123-w)))*(((x+y)-(7.123-w))+((x+y)/(7.123/w))))*((((x+y)+(7.123-w))-((x-y)/(7.123*w)))-(((x+y)/(7.123/w))/(x+((y-7.123)/w)))))*(((((x+y)+(7.321/w))/((x*y)-(7.321-w)))/(((x/y)+(7.321-w))-(x+(y*(7.321/w)))))/((((x*y)-(7.321-w))*(x-(y*(7.321/w))))*((x+(y*(7.321/w)))+(x-((y/7.321)/w)))))))\"\n\"(((((((x*y)-(7.123+w))+((x/y)/(7.123+w)))+(((x*y)/(7.123+w))*(x-((y+7.123)/w))))+((((x/y)/(7.123+w))/(x-((y+7.123)*w)))/((x-((y+7.123)/w))-((x*y)-(7.123/w)))))+(((((x-y)/(7.321/w))-(x+((y*7.321)/w)))-((x+((y-7.321)*w))/(((x-y)/7.321)-w)))-(((x+((y*7.321)/w))+(((x*y)/7.321)-w))+((((x-y)/7.321)-w)*((x-y)+(7.321/w)))))))\"\n\"(((((((x*y)-(7.123-w))*(x-(y*(7.123/w))))*((x+(y*(7.123/w)))+(x-((y/7.123)/w))))*(((x-(y*(7.123/w)))-(x-((y/7.123)*w)))-((x-((y/7.123)/w))/(x*(y+(7.123*w))))))*(((((x/y)/(7.321+w))/(x-((y+7.321)*w)))/((x-((y+7.321)/w))-((x*y)-(7.321/w))))/(((x-((y+7.321)*w))*((x/y)+(7.321/w)))*(((x*y)-(7.321/w))+((x+y)/(7.321-w)))))))\"\n\"(((((((x*y)-(7.123/w))+((x+y)/(7.123-w)))+(((x+y)*(7.123-w))*((x-y)/(7.123/w))))+((((x+y)/(7.123-w))/((x-y)*(7.123*w)))/(((x-y)/(7.123/w))-(x+((y*7.123)/w)))))+(((((x-y)+(7.321/w))-((x+y)*(7.321*w)))-(((x/y)-(7.321-w))/(x+(y/(7.321*w)))))-((((x+y)*(7.321*w))+(x-(y/(7.321*w))))+((x+(y/(7.321*w)))*(((x+y)*7.321)-w))))))\"\n\"(((((((x*y)/(7.123+w))*(x-((y+7.123)/w)))*((x+((y/7.123)*w))+((x*y)+(7.123/w))))*(((x-((y+7.123)/w))-((x*y)-(7.123/w)))-(((x*y)+(7.123/w))/((x+y)*(7.123-w)))))*((((x+((y-7.321)*w))/(((x-y)/7.321)-w))/((((x+y)/7.321)-w)-((x-y)+(7.321*w))))/(((((x-y)/7.321)-w)*((x-y)+(7.321/w)))*(((x-y)+(7.321*w))+((x/y)-(7.321-w)))))))\"\n\"(((((((x*y)/(7.123-w))+(x-((y-7.123)/w)))+((x-((y+7.123)*w))*((x/y)+(7.123/w))))+(((x-((y-7.123)/w))/((x/y)-(7.123/w)))/(((x/y)+(7.123/w))-((x-y)-(7.123+w)))))+((((x+((y*7.321)*w))-(((x/y)/7.321)-w))-((((x*y)/7.321)-w)/((x-y)-(7.321*w))))-(((((x/y)/7.321)-w)+((x-y)-(7.321/w)))+(((x-y)-(7.321*w))*((x+y)*(7.321/w)))))))\"\n\"(((((((x+y)*(7.123*w))+(x-(y/(7.123*w))))+((x+(y/(7.123*w)))*(((x+y)*7.123)-w)))+(((x-(y/(7.123*w)))/(((x-y)*7.123)-w))/((((x+y)*7.123)-w)-((x+y)-(7.123*w)))))+(((((x/y)/(7.321-w))-(x-((y-7.321)*w)))-((x-((y-7.321)/w))/((x/y)-(7.321/w))))-(((x-((y-7.321)*w))+((x/y)-(7.321*w)))+(((x/y)-(7.321/w))*((x-y)+(7.321+w)))))))\"\n\"(((((((x+y)*(7.123-w))*((x-y)/(7.123/w)))*(((x-y)/(7.123*w))+(x+((y-7.123)*w))))*((((x-y)/(7.123/w))-(x+((y*7.123)/w)))-((x+((y-7.123)*w))/(((x-y)/7.123)-w))))*(((((x/y)-(7.321-w))/(x+(y/(7.321*w))))/((x-(y*(7.321/w)))-(x-((y/7.321)*w))))/(((x+(y/(7.321*w)))*(((x+y)*7.321)-w))*((x-((y/7.321)*w))+(x*(y-(7.321*w))))))))\"\n\"(((((((x+y)*(7.123/w))-(x+((y+7.123)/w)))-((x-(y/(7.123*w)))/(((x-y)*7.123)-w)))-(((x+((y+7.123)/w))+(((x*y)*7.123)-w))+((((x-y)*7.123)-w)*((x+y)-(7.123/w)))))-(((((x*y)*(7.321-w))*(x-((y*7.321)/w)))*((x-((y-7.321)*w))+((x/y)-(7.321*w))))*(((x-((y*7.321)/w))-(x/(y+(7.321*w))))-(((x/y)-(7.321*w))/((x-y)*(7.321+w)))))))\"\n\"(((((((x+y)+(7.123*w))*((x/y)+(7.123-w)))*(((x*y)+(7.123-w))+((x/y)*(7.123-w))))*((((x/y)+(7.123-w))-(x+(y*(7.123/w))))-(((x/y)*(7.123-w))/(x-((y*7.123)*w)))))*(((((x-y)/(7.321+w))/((x*y)/(7.321+w)))/(((x/y)*(7.321+w))-(x+((y/7.321)*w))))/((((x*y)/(7.321+w))*(x-((y+7.321)/w)))*((x+((y/7.321)*w))+((x*y)+(7.321/w)))))))\"\n\"(((((((x+y)+(7.123-w))-((x-y)/(7.123*w)))-(((x+y)/(7.123/w))/(x+((y-7.123)/w))))-((((x-y)/(7.123*w))+(x+((y-7.123)*w)))+((x+((y-7.123)/w))*(((x+y)/7.123)-w))))-(((((x*y)-(7.321-w))*(x-(y*(7.321/w))))*((x+(y*(7.321/w)))+(x-((y/7.321)/w))))*(((x-(y*(7.321/w)))-(x-((y/7.321)*w)))-((x-((y/7.321)/w))/(x*(y+(7.321*w))))))))\"\n\"(((((((x+y)+(7.123/w))/((x*y)-(7.123-w)))/(((x/y)+(7.123-w))-(x+(y*(7.123/w)))))/((((x*y)-(7.123-w))*(x-(y*(7.123/w))))*((x+(y*(7.123/w)))+(x-((y/7.123)/w)))))/(((((x*y)-(7.321+w))+((x/y)/(7.321+w)))+(((x*y)/(7.321+w))*(x-((y+7.321)/w))))+((((x/y)/(7.321+w))/(x-((y+7.321)*w)))/((x-((y+7.321)/w))-((x*y)-(7.321/w)))))))\"\n\"(((((((x+y)-(7.123*w))+((x/y)+(7.123+w)))+(((x*y)+(7.123+w))*((x/y)/(7.123-w))))+((((x/y)+(7.123+w))/((x*y)*(7.123-w)))/(((x/y)/(7.123-w))-(x-((y-7.123)*w)))))+(((((x-y)+(7.321+w))-((x*y)*(7.321+w)))-(((x-y)*(7.321/w))/(x+((y/7.321)+w))))-((((x*y)*(7.321+w))+(x+((y/7.321)/w)))+((x+((y/7.321)+w))*((x*y)+(7.321*w)))))))\"\n\"(((((((x+y)-(7.123-w))+((x+y)/(7.123/w)))+(((x+y)/(7.123*w))*(x+((y+7.123)*w))))+((((x+y)/(7.123/w))/(x+((y-7.123)/w)))/((x+((y+7.123)*w))-(((x/y)*7.123)-w))))+(((((x/y)+(7.321-w))-(x+(y*(7.321/w))))-(((x/y)*(7.321-w))/(x-((y*7.321)*w))))-(((x+(y*(7.321/w)))+(x-((y/7.321)/w)))+((x-((y*7.321)*w))*(x/(y-(7.321*w))))))))\"\n\"(((((((x+y)-(7.123/w))-((x*y)+(7.123-w)))-(((x/y)+(7.123+w))/((x*y)*(7.123-w))))-((((x*y)+(7.123-w))+((x/y)*(7.123-w)))+(((x*y)*(7.123-w))*(x-((y*7.123)/w)))))-(((((x-y)*(7.321+w))*((x/y)*(7.321+w)))*(((x*y)*(7.321+w))+(x+((y/7.321)/w))))*((((x/y)*(7.321+w))-(x+((y/7.321)*w)))-((x+((y/7.321)/w))/((x*y)-(7.321*w)))))))\"\n\"(((((((x+y)/(7.123*w))*(x+((y+7.123)*w)))*((x+((y+7.123)/w))+(((x*y)*7.123)-w)))*(((x+((y+7.123)*w))-(((x/y)*7.123)-w))-((((x*y)*7.123)-w)/((x+y)+(7.123*w)))))*(((((x/y)*(7.321-w))/(x-((y*7.321)*w)))/((x-((y*7.321)/w))-(x/(y+(7.321*w)))))/(((x-((y*7.321)*w))*(x/(y-(7.321*w))))*((x/(y+(7.321*w)))+((x-y)/(7.321+w)))))))\"\n\"(((((((x+y)/(7.123-w))/((x-y)*(7.123*w)))/(((x-y)/(7.123/w))-(x+((y*7.123)/w))))/((((x-y)*(7.123*w))*(x+((y*7.123)*w)))*((x+((y*7.123)/w))+(((x*y)/7.123)-w))))/(((((x+y)*(7.321*w))+(x-(y/(7.321*w))))+((x+(y/(7.321*w)))*(((x+y)*7.321)-w)))+(((x-(y/(7.321*w)))/(((x-y)*7.321)-w))/((((x+y)*7.321)-w)-((x+y)-(7.321*w)))))))\"\n\"(((((((x+y)/(7.123/w))/(x+((y-7.123)/w)))/((x+((y+7.123)*w))-(((x/y)*7.123)-w)))/(((x+((y-7.123)/w))*(((x+y)/7.123)-w))*((((x/y)*7.123)-w)+((x+y)+(7.123/w)))))/((((x+(y*(7.321/w)))+(x-((y/7.321)/w)))+((x-((y*7.321)*w))*(x/(y-(7.321*w)))))+(((x-((y/7.321)/w))/(x*(y+(7.321*w))))/((x/(y-(7.321*w)))-((x*y)-(7.321+w)))))))\"\n\"(((((((x-y)*(7.123*w))*(x+((y*7.123)*w)))*((x+((y*7.123)/w))+(((x*y)/7.123)-w)))*(((x+((y*7.123)*w))-(((x/y)/7.123)-w))-((((x*y)/7.123)-w)/((x-y)-(7.123*w)))))*((((x-(y/(7.321*w)))/(((x-y)*7.321)-w))/((((x+y)*7.321)-w)-((x+y)-(7.321*w))))/(((((x-y)*7.321)-w)*((x+y)-(7.321/w)))*(((x+y)-(7.321*w))+((x/y)+(7.321+w)))))))\"\n\"(((((((x-y)*(7.123+w))*((x/y)*(7.123+w)))*(((x*y)*(7.123+w))+(x+((y/7.123)/w))))*((((x/y)*(7.123+w))-(x+((y/7.123)*w)))-((x+((y/7.123)/w))/((x*y)-(7.123*w)))))*(((((x+y)/(7.321/w))/(x+((y-7.321)/w)))/((x+((y+7.321)*w))-(((x/y)*7.321)-w)))/(((x+((y-7.321)/w))*(((x+y)/7.321)-w))*((((x/y)*7.321)-w)+((x+y)+(7.321/w)))))))\"\n\"(((((((x-y)*(7.123/w))/(x+((y/7.123)+w)))/((x+((y*7.123)*w))-(((x/y)/7.123)-w)))/(((x+((y/7.123)+w))*((x*y)+(7.123*w)))*((((x/y)/7.123)-w)+((x-y)-(7.123/w)))))/((((x+((y+7.321)/w))+(((x*y)*7.321)-w))+((((x-y)*7.321)-w)*((x+y)-(7.321/w))))+(((((x*y)*7.321)-w)/((x+y)+(7.321*w)))/(((x+y)-(7.321/w))-((x*y)+(7.321-w)))))))\"\n\"(((((((x-y)+(7.123*w))+((x/y)-(7.123-w)))+(((x*y)-(7.123-w))*(x-(y*(7.123/w)))))+((((x/y)-(7.123-w))/(x+(y/(7.123*w))))/((x-(y*(7.123/w)))-(x-((y/7.123)*w)))))+(((((x/y)-(7.321+w))-((x*y)/(7.321-w)))-(((x/y)/(7.321+w))/(x-((y+7.321)*w))))-((((x*y)/(7.321-w))+(x-((y-7.321)/w)))+((x-((y+7.321)*w))*((x/y)+(7.321/w)))))))\"\n\"(((((((x-y)+(7.123+w))-((x*y)*(7.123+w)))-(((x-y)*(7.123/w))/(x+((y/7.123)+w))))-((((x*y)*(7.123+w))+(x+((y/7.123)/w)))+((x+((y/7.123)+w))*((x*y)+(7.123*w)))))-(((((x+y)/(7.321*w))*(x+((y+7.321)*w)))*((x+((y+7.321)/w))+(((x*y)*7.321)-w)))*(((x+((y+7.321)*w))-(((x/y)*7.321)-w))-((((x*y)*7.321)-w)/((x+y)+(7.321*w)))))))\"\n\"(((((((x-y)+(7.123/w))-((x+y)*(7.123*w)))-(((x/y)-(7.123-w))/(x+(y/(7.123*w)))))-((((x+y)*(7.123*w))+(x-(y/(7.123*w))))+((x+(y/(7.123*w)))*(((x+y)*7.123)-w))))-(((((x*y)+(7.321+w))*((x/y)/(7.321-w)))*(((x*y)/(7.321-w))+(x-((y-7.321)/w))))*((((x/y)/(7.321-w))-(x-((y-7.321)*w)))-((x-((y-7.321)/w))/((x/y)-(7.321/w)))))))\"\n\"(((((((x-y)-(7.123*w))*((x+y)*(7.123/w)))*(((x+y)*(7.123*w))+(x-(y/(7.123*w)))))*((((x+y)*(7.123/w))-(x+((y+7.123)/w)))-((x-(y/(7.123*w)))/(((x-y)*7.123)-w))))*(((((x/y)+(7.321+w))/((x*y)*(7.321-w)))/(((x/y)/(7.321-w))-(x-((y-7.321)*w))))/((((x*y)*(7.321-w))*(x-((y*7.321)/w)))*((x-((y-7.321)*w))+((x/y)-(7.321*w)))))))\"\n\"(((((((x-y)-(7.123+w))+((x-y)*(7.123/w)))+(((x-y)*(7.123*w))*(x+((y*7.123)*w))))+((((x-y)*(7.123/w))/(x+((y/7.123)+w)))/((x+((y*7.123)*w))-(((x/y)/7.123)-w))))+(((((x+y)*(7.321/w))-(x+((y+7.321)/w)))-((x-(y/(7.321*w)))/(((x-y)*7.321)-w)))-(((x+((y+7.321)/w))+(((x*y)*7.321)-w))+((((x-y)*7.321)-w)*((x+y)-(7.321/w)))))))\"\n\"(((((((x-y)-(7.123/w))/((x+y)/(7.123*w)))/(((x+y)*(7.123/w))-(x+((y+7.123)/w))))/((((x+y)/(7.123*w))*(x+((y+7.123)*w)))*((x+((y+7.123)/w))+(((x*y)*7.123)-w))))/(((((x*y)+(7.321-w))+((x/y)*(7.321-w)))+(((x*y)*(7.321-w))*(x-((y*7.321)/w))))+((((x/y)*(7.321-w))/(x-((y*7.321)*w)))/((x-((y*7.321)/w))-(x/(y+(7.321*w))))))))\"\n\"(((((((x-y)/(7.123*w))+(x+((y-7.123)*w)))+((x+((y-7.123)/w))*(((x+y)/7.123)-w)))+(((x+((y-7.123)*w))/(((x-y)/7.123)-w))/((((x+y)/7.123)-w)-((x-y)+(7.123*w)))))+((((x-(y*(7.321/w)))-(x-((y/7.321)*w)))-((x-((y/7.321)/w))/(x*(y+(7.321*w)))))-(((x-((y/7.321)*w))+(x*(y-(7.321*w))))+((x*(y+(7.321*w)))*((x/y)-(7.321+w)))))))\"\n\"(((((((x-y)/(7.123+w))/((x*y)/(7.123+w)))/(((x/y)*(7.123+w))-(x+((y/7.123)*w))))/((((x*y)/(7.123+w))*(x-((y+7.123)/w)))*((x+((y/7.123)*w))+((x*y)+(7.123/w)))))/(((((x-y)/(7.321*w))+(x+((y-7.321)*w)))+((x+((y-7.321)/w))*(((x+y)/7.321)-w)))+(((x+((y-7.321)*w))/(((x-y)/7.321)-w))/((((x+y)/7.321)-w)-((x-y)+(7.321*w)))))))\"\n\"(((((((x-y)/(7.123/w))-(x+((y*7.123)/w)))-((x+((y-7.123)*w))/(((x-y)/7.123)-w)))-(((x+((y*7.123)/w))+(((x*y)/7.123)-w))+((((x-y)/7.123)-w)*((x-y)+(7.123/w)))))-((((x+(y/(7.321*w)))*(((x+y)*7.321)-w))*((x-((y/7.321)*w))+(x*(y-(7.321*w)))))*(((((x+y)*7.321)-w)-((x+y)-(7.321*w)))-((x*(y-(7.321*w)))/((x*y)+(7.321+w)))))))\"\n\"(((((((x/y)*(7.123+w))-(x+((y/7.123)*w)))-((x+((y/7.123)/w))/((x*y)-(7.123*w))))-(((x+((y/7.123)*w))+((x*y)+(7.123/w)))+(((x*y)-(7.123*w))*((x+y)+(7.123-w)))))-((((x+((y-7.321)/w))*(((x+y)/7.321)-w))*((((x/y)*7.321)-w)+((x+y)+(7.321/w))))*(((((x+y)/7.321)-w)-((x-y)+(7.321*w)))-(((x+y)+(7.321/w))/((x*y)-(7.321-w)))))))\"\n\"(((((((x/y)*(7.123-w))/(x-((y*7.123)*w)))/((x-((y*7.123)/w))-(x/(y+(7.123*w)))))/(((x-((y*7.123)*w))*(x/(y-(7.123*w))))*((x/(y+(7.123*w)))+((x-y)/(7.123+w)))))/((((x+((y/7.321)*w))+((x*y)+(7.321/w)))+(((x*y)-(7.321*w))*((x+y)+(7.321-w))))+((((x*y)+(7.321/w))/((x+y)*(7.321-w)))/(((x+y)+(7.321-w))-((x-y)/(7.321*w)))))))\"\n\"(((((((x/y)+(7.123+w))/((x*y)*(7.123-w)))/(((x/y)/(7.123-w))-(x-((y-7.123)*w))))/((((x*y)*(7.123-w))*(x-((y*7.123)/w)))*((x-((y-7.123)*w))+((x/y)-(7.123*w)))))/(((((x*y)*(7.321+w))+(x+((y/7.321)/w)))+((x+((y/7.321)+w))*((x*y)+(7.321*w))))+(((x+((y/7.321)/w))/((x*y)-(7.321*w)))/(((x*y)+(7.321*w))-((x+y)-(7.321-w)))))))\"\n\"(((((((x/y)+(7.123-w))-(x+(y*(7.123/w))))-(((x/y)*(7.123-w))/(x-((y*7.123)*w))))-(((x+(y*(7.123/w)))+(x-((y/7.123)/w)))+((x-((y*7.123)*w))*(x/(y-(7.123*w))))))-(((((x*y)/(7.321+w))*(x-((y+7.321)/w)))*((x+((y/7.321)*w))+((x*y)+(7.321/w))))*(((x-((y+7.321)/w))-((x*y)-(7.321/w)))-(((x*y)+(7.321/w))/((x+y)*(7.321-w)))))))\"\n\"(((((((x/y)+(7.123/w))-((x-y)-(7.123+w)))-(((x+y)/(7.123-w))/((x-y)*(7.123*w))))-((((x-y)-(7.123+w))+((x-y)*(7.123/w)))+(((x-y)*(7.123*w))*(x+((y*7.123)*w)))))-(((((x-y)-(7.321*w))*((x+y)*(7.321/w)))*(((x+y)*(7.321*w))+(x-(y/(7.321*w)))))*((((x+y)*(7.321/w))-(x+((y+7.321)/w)))-((x-(y/(7.321*w)))/(((x-y)*7.321)-w))))))\"\n\"(((((((x/y)-(7.123*w))/((x-y)*(7.123+w)))/(((x-y)+(7.123+w))-((x*y)*(7.123+w))))/((((x-y)*(7.123+w))*((x/y)*(7.123+w)))*(((x*y)*(7.123+w))+(x+((y/7.123)/w)))))/(((((x+y)-(7.321-w))+((x+y)/(7.321/w)))+(((x+y)/(7.321*w))*(x+((y+7.321)*w))))+((((x+y)/(7.321/w))/(x+((y-7.321)/w)))/((x+((y+7.321)*w))-(((x/y)*7.321)-w))))))\"\n\"(((((((x/y)-(7.123+w))-((x*y)/(7.123-w)))-(((x/y)/(7.123+w))/(x-((y+7.123)*w))))-((((x*y)/(7.123-w))+(x-((y-7.123)/w)))+((x-((y+7.123)*w))*((x/y)+(7.123/w)))))-(((((x-y)*(7.321*w))*(x+((y*7.321)*w)))*((x+((y*7.321)/w))+(((x*y)/7.321)-w)))*(((x+((y*7.321)*w))-(((x/y)/7.321)-w))-((((x*y)/7.321)-w)/((x-y)-(7.321*w)))))))\"\n\"(((((((x/y)-(7.123-w))/(x+(y/(7.123*w))))/((x-(y*(7.123/w)))-(x-((y/7.123)*w))))/(((x+(y/(7.123*w)))*(((x+y)*7.123)-w))*((x-((y/7.123)*w))+(x*(y-(7.123*w))))))/(((((x*y)/(7.321-w))+(x-((y-7.321)/w)))+((x-((y+7.321)*w))*((x/y)+(7.321/w))))+(((x-((y-7.321)/w))/((x/y)-(7.321/w)))/(((x/y)+(7.321/w))-((x-y)-(7.321+w)))))))\"\n\"(((((((x/y)-(7.123/w))*((x-y)+(7.123+w)))*(((x-y)-(7.123+w))+((x-y)*(7.123/w))))*((((x-y)+(7.123+w))-((x*y)*(7.123+w)))-(((x-y)*(7.123/w))/(x+((y/7.123)+w)))))*(((((x-y)-(7.321/w))/((x+y)/(7.321*w)))/(((x+y)*(7.321/w))-(x+((y+7.321)/w))))/((((x+y)/(7.321*w))*(x+((y+7.321)*w)))*((x+((y+7.321)/w))+(((x*y)*7.321)-w))))))\"\n\"(((((((x/y)/(7.123+w))/(x-((y+7.123)*w)))/((x-((y+7.123)/w))-((x*y)-(7.123/w))))/(((x-((y+7.123)*w))*((x/y)+(7.123/w)))*(((x*y)-(7.123/w))+((x+y)/(7.123-w)))))/((((x+((y*7.321)/w))+(((x*y)/7.321)-w))+((((x-y)/7.321)-w)*((x-y)+(7.321/w))))+(((((x*y)/7.321)-w)/((x-y)-(7.321*w)))/(((x-y)+(7.321/w))-((x+y)*(7.321*w)))))))\"\n\"(((((((x/y)/(7.123-w))-(x-((y-7.123)*w)))-((x-((y-7.123)/w))/((x/y)-(7.123/w))))-(((x-((y-7.123)*w))+((x/y)-(7.123*w)))+(((x/y)-(7.123/w))*((x-y)+(7.123+w)))))-((((x+((y/7.321)+w))*((x*y)+(7.321*w)))*((((x/y)/7.321)-w)+((x-y)-(7.321/w))))*((((x*y)+(7.321*w))-((x+y)-(7.321-w)))-(((x-y)-(7.321/w))/((x+y)/(7.321*w)))))))\"\n\"((((((x*(y+(7.123*w)))*((x/y)-(7.123+w)))*(((x*y)-(7.123+w))+((x/y)/(7.123+w))))*((((x/y)-(7.123+w))-((x*y)/(7.123-w)))-(((x/y)/(7.123+w))/(x-((y+7.123)*w)))))*(((((x+y)/(7.321-w))/((x-y)*(7.321*w)))/(((x-y)/(7.321/w))-(x+((y*7.321)/w))))/((((x-y)*(7.321*w))*(x+((y*7.321)*w)))*((x+((y*7.321)/w))+(((x*y)/7.321)-w))))))\"\n\"((((((x*(y-(7.123*w)))/((x*y)+(7.123+w)))/(((x/y)-(7.123+w))-((x*y)/(7.123-w))))/((((x*y)+(7.123+w))*((x/y)/(7.123-w)))*(((x*y)/(7.123-w))+(x-((y-7.123)/w)))))/(((((x-y)-(7.321+w))+((x-y)*(7.321/w)))+(((x-y)*(7.321*w))*(x+((y*7.321)*w))))+((((x-y)*(7.321/w))/(x+((y/7.321)+w)))/((x+((y*7.321)*w))-(((x/y)/7.321)-w))))))\"\n\"((((((x+((y*7.123)*w))-(((x/y)/7.123)-w))-((((x*y)/7.123)-w)/((x-y)-(7.123*w))))-(((((x/y)/7.123)-w)+((x-y)-(7.123/w)))+(((x-y)-(7.123*w))*((x+y)*(7.123/w)))))-((((((x-y)*7.321)-w)*((x+y)-(7.321/w)))*(((x+y)-(7.321*w))+((x/y)+(7.321+w))))*((((x+y)-(7.321/w))-((x*y)+(7.321-w)))-(((x/y)+(7.321+w))/((x*y)*(7.321-w)))))))\"\n\"((((((x+((y*7.123)/w))+(((x*y)/7.123)-w))+((((x-y)/7.123)-w)*((x-y)+(7.123/w))))+(((((x*y)/7.123)-w)/((x-y)-(7.123*w)))/(((x-y)+(7.123/w))-((x+y)*(7.123*w)))))+((((((x+y)*7.321)-w)-((x+y)-(7.321*w)))-((x*(y-(7.321*w)))/((x*y)+(7.321+w))))-((((x+y)-(7.321*w))+((x/y)+(7.321+w)))+(((x*y)+(7.321+w))*((x/y)/(7.321-w)))))))\"\n\"((((((x+((y+7.123)*w))-(((x/y)*7.123)-w))-((((x*y)*7.123)-w)/((x+y)+(7.123*w))))-(((((x/y)*7.123)-w)+((x+y)+(7.123/w)))+(((x+y)+(7.123*w))*((x/y)+(7.123-w)))))-((((x-((y*7.321)*w))*(x/(y-(7.321*w))))*((x/(y+(7.321*w)))+((x-y)/(7.321+w))))*(((x/(y-(7.321*w)))-((x*y)-(7.321+w)))-(((x-y)/(7.321+w))/((x*y)/(7.321+w)))))))\"\n\"((((((x+((y+7.123)/w))+(((x*y)*7.123)-w))+((((x-y)*7.123)-w)*((x+y)-(7.123/w))))+(((((x*y)*7.123)-w)/((x+y)+(7.123*w)))/(((x+y)-(7.123/w))-((x*y)+(7.123-w)))))+((((x-((y*7.321)/w))-(x/(y+(7.321*w))))-(((x/y)-(7.321*w))/((x-y)*(7.321+w))))-(((x/(y+(7.321*w)))+((x-y)/(7.321+w)))+(((x-y)*(7.321+w))*((x/y)*(7.321+w)))))))\"\n\"((((((x+((y-7.123)*w))/(((x-y)/7.123)-w))/((((x+y)/7.123)-w)-((x-y)+(7.123*w))))/(((((x-y)/7.123)-w)*((x-y)+(7.123/w)))*(((x-y)+(7.123*w))+((x/y)-(7.123-w)))))/((((x-((y/7.321)*w))+(x*(y-(7.321*w))))+((x*(y+(7.321*w)))*((x/y)-(7.321+w))))+(((x*(y-(7.321*w)))/((x*y)+(7.321+w)))/(((x/y)-(7.321+w))-((x*y)/(7.321-w)))))))\"\n\"((((((x+((y-7.123)/w))*(((x+y)/7.123)-w))*((((x/y)*7.123)-w)+((x+y)+(7.123/w))))*(((((x+y)/7.123)-w)-((x-y)+(7.123*w)))-(((x+y)+(7.123/w))/((x*y)-(7.123-w)))))*((((x-((y/7.321)/w))/(x*(y+(7.321*w))))/((x/(y-(7.321*w)))-((x*y)-(7.321+w))))/(((x*(y+(7.321*w)))*((x/y)-(7.321+w)))*(((x*y)-(7.321+w))+((x/y)/(7.321+w)))))))\"\n\"((((((x+((y/7.123)*w))+((x*y)+(7.123/w)))+(((x*y)-(7.123*w))*((x+y)+(7.123-w))))+((((x*y)+(7.123/w))/((x+y)*(7.123-w)))/(((x+y)+(7.123-w))-((x-y)/(7.123*w)))))+((((((x+y)/7.321)-w)-((x-y)+(7.321*w)))-(((x+y)+(7.321/w))/((x*y)-(7.321-w))))-((((x-y)+(7.321*w))+((x/y)-(7.321-w)))+(((x*y)-(7.321-w))*(x-(y*(7.321/w))))))))\"\n\"((((((x+((y/7.123)+w))*((x*y)+(7.123*w)))*((((x/y)/7.123)-w)+((x-y)-(7.123/w))))*((((x*y)+(7.123*w))-((x+y)-(7.123-w)))-(((x-y)-(7.123/w))/((x+y)/(7.123*w)))))*((((((x*y)*7.321)-w)/((x+y)+(7.321*w)))/(((x+y)-(7.321/w))-((x*y)+(7.321-w))))/((((x+y)+(7.321*w))*((x/y)+(7.321-w)))*(((x*y)+(7.321-w))+((x/y)*(7.321-w)))))))\"\n\"((((((x+((y/7.123)/w))/((x*y)-(7.123*w)))/(((x*y)+(7.123*w))-((x+y)-(7.123-w))))/((((x*y)-(7.123*w))*((x+y)+(7.123-w)))*(((x+y)-(7.123-w))+((x+y)/(7.123/w)))))/((((((x/y)*7.321)-w)+((x+y)+(7.321/w)))+(((x+y)+(7.321*w))*((x/y)+(7.321-w))))+((((x+y)+(7.321/w))/((x*y)-(7.321-w)))/(((x/y)+(7.321-w))-(x+(y*(7.321/w))))))))\"\n\"((((((x+(y*(7.123/w)))+(x-((y/7.123)/w)))+((x-((y*7.123)*w))*(x/(y-(7.123*w)))))+(((x-((y/7.123)/w))/(x*(y+(7.123*w))))/((x/(y-(7.123*w)))-((x*y)-(7.123+w)))))+((((x-((y+7.321)/w))-((x*y)-(7.321/w)))-(((x*y)+(7.321/w))/((x+y)*(7.321-w))))-((((x*y)-(7.321/w))+((x+y)/(7.321-w)))+(((x+y)*(7.321-w))*((x-y)/(7.321/w)))))))\"\n\"((((((x+(y/(7.123*w)))*(((x+y)*7.123)-w))*((x-((y/7.123)*w))+(x*(y-(7.123*w)))))*(((((x+y)*7.123)-w)-((x+y)-(7.123*w)))-((x*(y-(7.123*w)))/((x*y)+(7.123+w)))))*((((x-((y-7.321)/w))/((x/y)-(7.321/w)))/(((x/y)+(7.321/w))-((x-y)-(7.321+w))))/((((x/y)-(7.321/w))*((x-y)+(7.321+w)))*(((x-y)-(7.321+w))+((x-y)*(7.321/w)))))))\"\n\"((((((x-((y*7.123)*w))*(x/(y-(7.123*w))))*((x/(y+(7.123*w)))+((x-y)/(7.123+w))))*(((x/(y-(7.123*w)))-((x*y)-(7.123+w)))-(((x-y)/(7.123+w))/((x*y)/(7.123+w)))))*(((((x*y)+(7.321/w))/((x+y)*(7.321-w)))/(((x+y)+(7.321-w))-((x-y)/(7.321*w))))/((((x+y)*(7.321-w))*((x-y)/(7.321/w)))*(((x-y)/(7.321*w))+(x+((y-7.321)*w)))))))\"\n\"((((((x-((y*7.123)/w))-(x/(y+(7.123*w))))-(((x/y)-(7.123*w))/((x-y)*(7.123+w))))-(((x/(y+(7.123*w)))+((x-y)/(7.123+w)))+(((x-y)*(7.123+w))*((x/y)*(7.123+w)))))-(((((x*y)-(7.321*w))*((x+y)+(7.321-w)))*(((x+y)-(7.321-w))+((x+y)/(7.321/w))))*((((x+y)+(7.321-w))-((x-y)/(7.321*w)))-(((x+y)/(7.321/w))/(x+((y-7.321)/w)))))))\"\n\"((((((x-((y+7.123)*w))*((x/y)+(7.123/w)))*(((x*y)-(7.123/w))+((x+y)/(7.123-w))))*((((x/y)+(7.123/w))-((x-y)-(7.123+w)))-(((x+y)/(7.123-w))/((x-y)*(7.123*w)))))*((((((x*y)/7.321)-w)/((x-y)-(7.321*w)))/(((x-y)+(7.321/w))-((x+y)*(7.321*w))))/((((x-y)-(7.321*w))*((x+y)*(7.321/w)))*(((x+y)*(7.321*w))+(x-(y/(7.321*w))))))))\"\n\"((((((x-((y+7.123)/w))-((x*y)-(7.123/w)))-(((x*y)+(7.123/w))/((x+y)*(7.123-w))))-((((x*y)-(7.123/w))+((x+y)/(7.123-w)))+(((x+y)*(7.123-w))*((x-y)/(7.123/w)))))-((((((x-y)/7.321)-w)*((x-y)+(7.321/w)))*(((x-y)+(7.321*w))+((x/y)-(7.321-w))))*((((x-y)+(7.321/w))-((x+y)*(7.321*w)))-(((x/y)-(7.321-w))/(x+(y/(7.321*w))))))))\"\n\"((((((x-((y-7.123)*w))+((x/y)-(7.123*w)))+(((x/y)-(7.123/w))*((x-y)+(7.123+w))))+((((x/y)-(7.123*w))/((x-y)*(7.123+w)))/(((x-y)+(7.123+w))-((x*y)*(7.123+w)))))+(((((x*y)+(7.321*w))-((x+y)-(7.321-w)))-(((x-y)-(7.321/w))/((x+y)/(7.321*w))))-((((x+y)-(7.321-w))+((x+y)/(7.321/w)))+(((x+y)/(7.321*w))*(x+((y+7.321)*w)))))))\"\n\"((((((x-((y-7.123)/w))/((x/y)-(7.123/w)))/(((x/y)+(7.123/w))-((x-y)-(7.123+w))))/((((x/y)-(7.123/w))*((x-y)+(7.123+w)))*(((x-y)-(7.123+w))+((x-y)*(7.123/w)))))/((((((x/y)/7.321)-w)+((x-y)-(7.321/w)))+(((x-y)-(7.321*w))*((x+y)*(7.321/w))))+((((x-y)-(7.321/w))/((x+y)/(7.321*w)))/(((x+y)*(7.321/w))-(x+((y+7.321)/w)))))))\"\n\"((((((x-((y/7.123)*w))+(x*(y-(7.123*w))))+((x*(y+(7.123*w)))*((x/y)-(7.123+w))))+(((x*(y-(7.123*w)))/((x*y)+(7.123+w)))/(((x/y)-(7.123+w))-((x*y)/(7.123-w)))))+(((((x/y)+(7.321/w))-((x-y)-(7.321+w)))-(((x+y)/(7.321-w))/((x-y)*(7.321*w))))-((((x-y)-(7.321+w))+((x-y)*(7.321/w)))+(((x-y)*(7.321*w))*(x+((y*7.321)*w)))))))\"\n\"((((((x-((y/7.123)/w))/(x*(y+(7.123*w))))/((x/(y-(7.123*w)))-((x*y)-(7.123+w))))/(((x*(y+(7.123*w)))*((x/y)-(7.123+w)))*(((x*y)-(7.123+w))+((x/y)/(7.123+w)))))/(((((x*y)-(7.321/w))+((x+y)/(7.321-w)))+(((x+y)*(7.321-w))*((x-y)/(7.321/w))))+((((x+y)/(7.321-w))/((x-y)*(7.321*w)))/(((x-y)/(7.321/w))-(x+((y*7.321)/w)))))))\"\n\"((((((x-(y*(7.123/w)))-(x-((y/7.123)*w)))-((x-((y/7.123)/w))/(x*(y+(7.123*w)))))-(((x-((y/7.123)*w))+(x*(y-(7.123*w))))+((x*(y+(7.123*w)))*((x/y)-(7.123+w)))))-((((x-((y+7.321)*w))*((x/y)+(7.321/w)))*(((x*y)-(7.321/w))+((x+y)/(7.321-w))))*((((x/y)+(7.321/w))-((x-y)-(7.321+w)))-(((x+y)/(7.321-w))/((x-y)*(7.321*w)))))))\"\n\"((((((x-(y/(7.123*w)))/(((x-y)*7.123)-w))/((((x+y)*7.123)-w)-((x+y)-(7.123*w))))/(((((x-y)*7.123)-w)*((x+y)-(7.123/w)))*(((x+y)-(7.123*w))+((x/y)+(7.123+w)))))/((((x-((y-7.321)*w))+((x/y)-(7.321*w)))+(((x/y)-(7.321/w))*((x-y)+(7.321+w))))+((((x/y)-(7.321*w))/((x-y)*(7.321+w)))/(((x-y)+(7.321+w))-((x*y)*(7.321+w)))))))\"\n\"((((((x/(y+(7.123*w)))+((x-y)/(7.123+w)))+(((x-y)*(7.123+w))*((x/y)*(7.123+w))))+((((x-y)/(7.123+w))/((x*y)/(7.123+w)))/(((x/y)*(7.123+w))-(x+((y/7.123)*w)))))+(((((x+y)+(7.321-w))-((x-y)/(7.321*w)))-(((x+y)/(7.321/w))/(x+((y-7.321)/w))))-((((x-y)/(7.321*w))+(x+((y-7.321)*w)))+((x+((y-7.321)/w))*(((x+y)/7.321)-w))))))\"\n\"((((((x/(y-(7.123*w)))-((x*y)-(7.123+w)))-(((x-y)/(7.123+w))/((x*y)/(7.123+w))))-((((x*y)-(7.123+w))+((x/y)/(7.123+w)))+(((x*y)/(7.123+w))*(x-((y+7.123)/w)))))-(((((x+y)*(7.321-w))*((x-y)/(7.321/w)))*(((x-y)/(7.321*w))+(x+((y-7.321)*w))))*((((x-y)/(7.321/w))-(x+((y*7.321)/w)))-((x+((y-7.321)*w))/(((x-y)/7.321)-w))))))\"\n\"(0)for(var i;i){(())}()\"\n\"0and for(var i;i<<0){()}\"\n\"0and(0)for(var i:=0;i){()}\"\n\"cos(0)for(var i;i){()}\"\n\"floor(0)for(var i;i){}()\"\n\"for(){{}}\"\n\"for(vAr i:=0;i)\"\n\"for(var i:=0;i)\"\n\"for(var i:=0;i){()}\"\n\"for(var i:=0;i){()}()\"\n\"for(var i:=0;i){{(){}}}()\"\n\"for(var i:=0;i){}\"\n\"for(var i:=0;i,0){()}\"\n\"for(var i;(i)){()}\"\n\"for(var i;i!0){()}\"\n\"for(var i;i)\"\n\"for(var i;i){(())(())}\"\n\"for(var i;i){(())(())}()\"\n\"for(var i;i){(())}()\"\n\"for(var i;i){()}\"\n\"for(var i;i){()}()\"\n\"for(var i;i){}\"\n\"frac(0)for(var i;i){()}\"\n\"root(0,0)for(var i;i){()}\"\n\"var V:=1;var s0appe0:=false;repeat s0appe0 false for(){(){}}(())\"\n\"var r:=0;for(r)\"\n\"var r:=0;for(r){((()))}\"\n\"var r:=0;for(r){(())(())}()\"\n\"var r:=0;for(r){(())()}()\"\n\"var r:=0;for(r){(())}\"\n\"var r:=0;for(r){()()}()\"\n\"var r:=0;for(r){()}\"\n\"var r:=0;for(r){()}()\"\n\"var r:=0;for(var i:=0;i){()}\"\n\"var r:=0;r for(())\"\n\"var r:=0;r for()\"\n\"var r:=for(Var i:=0;i){()}\"\n\"var r:=for(var i:=0;i)\"\n\"var r:=for(var i:=0;i){()}\"\n\"var r:=for(var i:=0;i){}\"\n\"var r:=for(var i;(0)z i)\"\n\"var r:=for(var i;I){(())(())}\"\n\"var r:=for(var i;i)\"\n\"var r:=for(var i;i){(())(())}\"\n\"var r:=for(var i;i){(())(())}()\"\n\"var r:=for(var i;i){(())}\"\n\"var r:=for(var i;i){(())}()\"\n\"var r:=for(var i;i){(())}(){{{}}}()\"\n\"var r:=for(var i;i){()()}\"\n\"var r:=for(var i;i){()}\"\n\"var r:=for(var i;i){()}()\"\n\"var r:=for(var i;i){}()\"\n\"var r:=for(var i;i+0){()}\"\n\"var r;for(r){(())(())}()\"\n\"var r;for(r){()}\"\n\"var r;for(r){}()\"\n\"var r;for(var i:=0;i)\"\n\"0 ? 1 : 2\"\n\"[(0)] ? [(1)] : [(2)]\"\n\"(0 ? 1 : 2) == 2\"\n\"'01234'              == '01234567890123456789'[:r1-r0]\"\n\"'0123456'            == '01234567890123456789'[:  r1]\"\n\"'0123456789'[0:] == '01234567890123456789'[0:9]\"\n\"'0123456789'[:]  == '01234567890123456789'[0:9]\"\n\"'0123456789'     == '01234567890123456789'[0:9]\"\n\"'0123456789'[:]  == '01234567890123456789'[10:]\"\n\"'01234567890123456789'[0:9] == '0123456789'\"\n\"'01234567890123456789'[0:9] == '0123456789'[0:]\"\n\"'01234567890123456789'[0:9] == '0123456789'[:9]\"\n\"'01234567890123456789'[0:9] != '123456789'\"\n\"'01234567890123456789'[0:9] != '123456789'[0:]\"\n\"'01234567890123456789'[0:9] != '123456789'[:8]\"\n\"'01234567890123456789'[10:] == '0123456789'[:]\"\n\"'01234567890123456789'[10:] != '123456789'[:]\"\n\"'01234567890123456789'[1+1:r1]  == '23456'\"\n\"'01234567890123456789'[2*6:10+6] == '23456'\"\n\"'01234567890123456789'[2: r1]   == '23456'\"\n\"'01234567890123456789'[:9]  == '0123456789'[:9]\"\n\"'01234567890123456789'[:9]  != '123456789'[:8]\"\n\"'01234567890123456789'[r0:  ]   == '234567890123456789'\"\n\"'01234567890123456789'[r0+2:r1] == '456'\"\n\"'01234567890123456789'[r0:3*2]  == '23456'\"\n\"'01234567890123456789'[r0: 6]   == '23456'\"\n\"'01234567890123456789'[r0:r1+2] == '2345678'\"\n\"'01234567890123456789'[r0:r1]   == '23456'\"\n\"'01234567890123456789'[:  r1]   == '0123456'\"\n\"'01234567890123456789'[:r1-r0]  == '01234'\"\n\"'01234567890123456789'[r1-r0:]  == '4567890123456789'\"\n\"'0123456789'[3:3] == '3'[:]\"\n\"'0123456789'[3:3] == '3'[0:0]\"\n\"'0123456789'[:9] == '01234567890123456789'[0:9]\"\n\"'0123456789'[:9] == '01234567890123456789'[:9]\"\n\"0 * (abs  (x) + acos (y) + asin (x) + atan (y))\"\n\"0 * (ceil (x) + cos  (y) + cosh (x) + exp  (y))\"\n\"0 * (deg2grad(x) + grad2deg(y) + rad2deg(x) + deg2rad(y))\"\n\"0 * (erf  (x) + erfc (y) + sgn  (y) + frac (y))\"\n\"0 * (floor(x) + log  (y) + log10(x) + round(y))\"\n\"0 == (for (var i := 0; i < 10; i += 1) { ~{break[i]; continue; i += i} })\"\n\"0 == (for (var i := 0; i < 10; i += 1) { ~{continue; break[7]; i += i} })\"\n\"0 * (log1p(x) + expm1(y) + acosh(x) + asinh(y))\"\n\"0 * (sec  (x) + csc  (y) + tanh (x) + cot  (y))\"\n\"0 * (sin  (x) + sinh (y) + sqrt (x) + tan  (y))\"\n\"(1 + 1 < 3 + 3 ? 7 : 9) == 7\"\n\"(1 + 1 > 3 + 3 ? 7 : 9) == 9\"\n\"(1 + 1 < 3 ? 7 : 9) == 7\"\n\"(1 + 1 > 3 ? 7 : 9) == 9\"\n\"(1 < 2 ? 3 : 4) == 3\"\n\"(1 > 2 ? 3 : 4) == 4\"\n\"'123456789'[0:]  != '01234567890123456789'[0:9]\"\n\"'123456789'[:]   != '01234567890123456789'[0:9]\"\n\"'123456789'      != '01234567890123456789'[0:9]\"\n\"'123456789'[:]   != '01234567890123456789'[10:]\"\n\"'123456789'[:8]  != '01234567890123456789'[0:9]\"\n\"'123456789'[:8]  != '01234567890123456789'[:9]\"\n\"(1 > 2 ? 3 : 4 + 5) == 9\"\n\"(1 < 2 ? 3 + 5 : 4) == 8\"\n\"'123' in 'aaa123'\"\n\"12 == (if (1 > 2) { var x:= 2; } else { var x[3] := {7,2,3}; sum(x); })\"\n\"12 == (if (1 < 2) { var x[3] := {7,2,3}; sum(x); } else { var x:= 2; })\"\n\" 1 ? 3 : 4\"\n\"(1 ? 3 : 4) == 3\"\n\"1 == (for (var i := 0; i < 10; i += 1) { ~{break[i += 1]; continue; i += i} })\"\n\"'1XYZ2' ilike '*xyz*'\"\n\"21 == (for (var i := 0; i < 10; i += 1) { if (i > 2) { break [i * 7]; i += 1; i += 2; i += 3; }; })\"\n\"21 == (for (var i := 0; i < 10; i += 1) { if (i > 2) { break [i * 7]; return [i * 8]; i += 1; i += 2; i += 3; }; })\"\n\"(2 < 3 + 3 ? 7 : 9) == 7\"\n\"(2 > 3 + 3 ? 7 : 9) == 9\"\n\"'23456'              == '01234567890123456789'[1+1:r1]\"\n\"'23456' == '01234567890123456789'[2*6:10+6]\"\n\"'23456'              == '01234567890123456789'[2: r1]\"\n\"'23456'              == '01234567890123456789'[r0:3*2]\"\n\"'23456'              == '01234567890123456789'[r0: 6]\"\n\"'23456'              == '01234567890123456789'[r0:r1]\"\n\"'2345678'            == '01234567890123456789'[r0:r1+2]\"\n\"'234567890123456789' == '01234567890123456789'[r0:  ]\"\n\"2 == for (var i := 0; i < 10; i += 1) { if (i > 2) { continue; i += 1; i += 2; i += 3; } else i; }\"\n\"2 == for (var i := 0; i < 10; i += 1) { if (i > 2) { continue; return [i * 8]; i += 1; i += 2; i += 3; } else i; }\"\n\"'456'                == '01234567890123456789'[r0+2:r1]\"\n\"'4567890123456789'   == '01234567890123456789'[r1-r0:]\"\n\"7 == (for (var i := 0; i < 10; i += 1) { ~{break[7]; continue; i += i} })\"\n\"'a123b' like '*123*'\"\n\"'aaa' + '123' == 'aaa123'\"\n\"'aaa123' == 'aaa' + '123'\"\n\"'aaa' == 'aaa'\"\n\"'aaa' <= 'bbb'\"\n\"'aaa'  < 'bbb'\"\n\"'aaa' in 'aaa123'\"\n\"'bbb' >= 'aaa'\"\n\"'bbb' >  'aaa'\"\n\"[*] { case 1 < 2 : 1 / 2; case (1 < 3) : 2 / 2; case 1 < 4 : 3 / 2; case (1 < 5) : 4 / 2; }\"\n\"[*]{ case x < y : x + y; case y < x : y - x; }\"\n\"equal((2.2*pi^2.2^3.3),2.2*(pi^13.4894687605338489))\"\n\"equal((2*pi^2^3),2*(pi^8))\"\n\"equal((pi^2.2^3.3*2),2*(pi^13.4894687605338489))\"\n\"equal((pi^2.2^3.3/2.2),(pi^13.4894687605338489)/2.2)\"\n\"equal((pi^2.2^3.3),(pi^13.4894687605338489))\"\n\"equal((pi^-2^-3),1/(pi^(1/8)))\"\n\"equal((pi^-2^3),1/(pi^8))\"\n\"equal((pi^2^3*2),2*(pi^8))\"\n\"equal((pi^2^3/2),(pi^8)/2)\"\n\"equal((pi^2^-3),(pi^(1/8)))\"\n\"equal((pi^2^3),(pi^8))\"\n\"equal(pi^2^3-pi^8,0)\"\n\"equal(\\t \\n(\\n \\r1.1\\t\\t - \\n\\n 2.2\\n\\n/\\r3.3\\t),(1.1-2.2/3.3))\"\n\"for(var i := 0; (i < 10) and (i != y); i+=2) { x += i; }; x;\"\n\"for(var i := 0; (i < 10) and (i != y);) { x += i; i+=2; }; x;\"\n\"for(var i := 0; (i < 10);) { i += 1; }; x;\"\n\"for(var i := 0; (i < y); i += 1) { if (i <= (y / 2)) continue; else x += i; }; x;\"\n\"for(var i := 0; (i < y); i += 1) { if (i <= (y / 2)) x += i; else break; }; x;\"\n\"if (1 < 2) { 1+2; 3;} == 3\"\n\"if (1 < 2) { 1+2; 3;} else {1+2; 4;} == 3\"\n\"if (1 > 2) { 1+2; 3;} else {1+2; 4;} == 4\"\n\"if (1 < 2) { 1+2; 3;} else 4; == 3\"\n\"if (1 > 2) { 1+2; 3;} else 4; == 4\"\n\"if (1 < 2) { 1+2; 3;} else if (1 < 2) {1+2; 4;} == 3\"\n\"if (1 > 2) { 1+2; 3;} else if (1 < 2) {1+2; 4;} == 4\"\n\"if (1 > 2) { 1+2; 3;} else if (1 > 2) {1+2; 4;} == null\"\n\"if (1 < 2) { 1+2; 3;} else if (1 < 2) 4; == 3\"\n\"if (1 > 2) { 1+2; 3;} else if (1 < 2) 4; == 4\"\n\"if (1 > 2) { 1+2; 3;} else if (1 > 2) 4; == null\"\n\"if (1 > 2) { 1+2; 3;} == null\"\n\"if (1 < 2) 3; == 3\"\n\"if (1 < 2) 3; else {1+2; 4;} == 3\"\n\"if (1 > 2) 3; else {1+2; 4;} == 4\"\n\"if (1 < 2) 3; else 4; == 3\"\n\"if (1 > 2) 3; else 4; == 4\"\n\"if (1 < 2) 3; else if (1 < 2) {1+2; 4;} == 3\"\n\"if (1 > 2) 3; else if (1 < 2) {1+2; 4;} == 4\"\n\"if (1 > 2) 3; else if (1 > 2) {1+2; 4;} == null\"\n\"if (1 < 2) 3; else if (1 < 2) 4; == 3\"\n\"if (1 > 2) 3; else if (1 < 2) 4; == 4\"\n\"if (1 > 2) 3; else if (1 > 2) 4; == null\"\n\"if (1 > 2) 3; == null\"\n\"inrange('aaa','bbb','ccc')\"\n\"(min(0,1) ? 1 + 3 : 1 + 4) == 5\"\n\"(min(1,2) ? 1 + 3 : 1 + 4) == 4\"\n\"repeat 1.1 + 2.2 until (1 < 2)\"\n\"repeat 1.1234; 1 < 2; 1.1 + 2.2 until (1 < 2)\"\n\"switch { case 1 > 1 : 1; case 2 > 2 : 2; case 3 = 3 : 3; case 4 > 4 : 4; default : 5; }\"\n\"switch { case (1 >  2) : 0; case (1 <= 2) : 1; default: 1.12345; }\"\n\"switch { case (1 <= 2) : 1; default: 1.12345; }\"\n\"switch { case (1 <= 2) : switch { case (1 <= 2) : 1; default: 1.12345; }; default: 1.12345; }\"\n\"switch { case ([x >  y]) : [0]; case ([x <= y]) : [y - x]; default: 1.12345; }\"\n\"switch { case (x >  y) : 0; case (x <= y) : (y - x); default: 1.12345; }\"\n\"switch { case {(x <= y)} : switch { case ({x <= y}) : x; default: 1.12345; }; default: 1.12345; }\"\n\"switch { case {x <= y} : switch { case {x <= y} : x; default: 1.12345; }; default: 1.12345; }\"\n\"switch { case (x <= y) : switch { case (x <= y) : (y - x); default: 1.12345; }; default: 1.12345; }\"\n\"switch { case {x <= y} : x; default: 1.12345; }\"\n\"switch { case [(x <= y)] : {y - x}; default: 1.12345; }\"\n\"switch { case (x <= y) : (y - x); default: 1.12345; }\"\n\"var s := 'abc';  ~{1 + 2; 'abc' + s; s} == s\"\n\"var s := 'abc';  ~{1 + 2; var x := 'ab'; x + 'c'} == s\"\n\"var s := 'abc';  ~{'ab' + 'c'} == s\"\n\"var s := 'abc';  ~{'abc'     } == s\"\n\"var s := 'abc';  s == ~{'ab' + 'c'}\"\n\"var s := 'abc';  s == ~{'abc'     }\"\n\"var s := 'abc';  ~{s         } == s\"\n\"var s := 'abc';  s == ~{s         }\"\n\"var v0[3] := {1,2, 3}; var v1[3] := {1,1,1}; v0 -= v1; (v0[0] == 0) and (v0[1] == 1) and (v0[2] == 2)\"\n\"var v0[3] := {1,2, 3}; var v1[3] := {1,1,1}; v0 += v1; (v0[0] == 2) and (v0[1] == 3) and (v0[2] == 4)\"\n\"var v0[3] := {1,2, 3}; var v1[3] := {2,2,2}; v0 *= v1; (v0[0] == 2) and (v0[1] == 4) and (v0[2] == 6)\"\n\"var v0[3] := [1]; var v1[3] := [1]; v0 -= v1; (v0[0] == v0[1]) and (v0[0] == v0[2]) and (v0[0] == 0)\"\n\"var v0[3] := [1]; var v1[3] := [1]; v0 += v1; (v0[0] == v0[1]) and (v0[0] == v0[2]) and (v0[0] == 2)\"\n\"var v0[3] := [1]; var v1[3] := [2]; v0 *= v1; (v0[0] == v0[1]) and (v0[0] == v0[2]) and (v0[0] == 2)\"\n\"var v0[3] := {3,9,15}; var v1[3] := {3,3,3}; v0 /= v1; (v0[0] == 1) and (v0[1] == 3) and (v0[2] == 5)\"\n\"var v0[3] := [3]; var v1[3] := [3]; v0 /= v1; (v0[0] == v0[1]) and (v0[0] == v0[2]) and (v0[0] == 1)\"\n\"var v[2] := {1,2}; swap(v[0],v[1]); (v[0] == 2) and (v[1] == 1)\"\n\"var v[2] := {1,2}; swap(v[2 * zero],v[(2 * one) / (1 + 1)]); (v[2 * zero] == 2) and (v[(2 * one) / (1 + 1)] == 1)\"\n\"var v[2] := {1,2}; swap(v[zero],v[one]); (v[zero] == 2) and (v[one] == 1)\"\n\"var v[2] := {1,2}; v[0] <=> v[1]  ; (v[0] == 2) and (v[1] == 1)\"\n\"var v[2] := {1,2}; ~(v[2 * zero] <=> v[(2 * one) / (1 + 1)]  , (v[2 * zero] == 2) and (v[(2 * one) / (1 + 1)] == 1))\"\n\"var v[2] := {1,2}; v[2 * zero] <=> v[(2*one)/(1+1)]  ; (v[2 * zero] == 2) and (v[(2 * one) / (1 + 1)] == 1)\"\n\"var v[2] := {1,2}; v[zero] <=> v[one]  ; (v[zero] == 2) and (v[one] == 1)\"\n\"var v[3] := {1,2, 3}; v -= 1; (v[0] == 0) and (v[1] == 1) and (v[2] == 2)\"\n\"var v[3] := {1,2, 3}; v += 1; (v[0] == 2) and (v[1] == 3) and (v[2] == 4)\"\n\"var v[3] := {1,2, 3}; v *= 2; (v[0] == 2) and (v[1] == 4) and (v[2] == 6)\"\n\"var v[3] := [1]; v -= 1; (v[0] == v[1]) and (v[0] == v[2]) and (v[0] == 0)\"\n\"var v[3] := [1]; v += 1; (v[0] == v[1]) and (v[0] == v[2]) and (v[0] == 2)\"\n\"var v[3] := [1]; v *= 2; (v[0] == v[1]) and (v[0] == v[2]) and (v[0] == 2)\"\n\"var v[3] := {3,9,15}; v /= 3; (v[0] == 1) and (v[1] == 3) and (v[2] == 5)\"\n\"var v[3] := [3]; v /= 3; (v[0] == v[1]) and (v[0] == v[2]) and (v[0] == 1)\"\n\"var x; 1\"\n\"var x[10] := [-1]; var y[10] := [-1]; for (var i := 0; i < 10; i += 1) { x[i] := i; y[i] := 2 * x[i]; }; (sum(x) == 45) and (sum(y) == (2 * sum(x)));\"\n\"var x[10^6]:=[2];var y[10^6]:=[3]; var s:=0;equal(for(var i:=0; i<10;i+=1){s+= sum(5 *(2x-y/3)) + i;},150000045.0)\"\n\"var x[10^6] := null; var y[10^7] := null; 0 * (min(x) + min(y)) + x[] + y[] == 10^7 + 10^6\"\n\"(~{~{ var x[1] := [1] }} + ~{ var x[1] := [1] } + ~{ var x[1] := [2] } + ~{{ var x[1] := [2] }}) == 6\"\n\"(~{~{ var x[1] := [1] }} + ~{ var x[1] := [1] } + ~{ var x[1] := [2] } + ~{{ var x    := [2] }}) == 6\"\n\"(~{~{ var x[1] := [1] }} + ~{ var x[1] := [1] } + ~{ var x    := [2] } + ~{{ var x[1] := [2] }}) == 6\"\n\"(~{ var x[1] := [1] } + ~{ var x[1] := [2] } + ~{~{ var x[1] := [1] } + ~{ var x[1] := [2] }}) == 6\"\n\"(~{ var x[1] := [1] } + ~{ var x[1] := [2] } + ~{~{ var x[1] := [1] } + ~{ var x    := [2] }}) == 6\"\n\"(~{~{~{var x[1] := [1]}}} + ~{~{var x[1] := [2]}} + ~{var x[1] := [3]}) == 6\"\n\"(~{ var x[1] := [1] } + ~{ var x[1] := [2] } + ~{~{ var x    := [1] } + ~{ var x[1] := [2] }}) == 6\"\n\"(~{~{ var x[1] := [1] }} + ~{ var x    := [1] } + ~{ var x[1] := [2] } + ~{{ var x[1] := [2] }}) == 6\"\n\"(~{ var x[1] := [1] } + ~{ var x    := [2] } + ~{~{ var x[1] := [1] } + ~{ var x[1] := [2] }}) == 6\"\n\"var x:=1;  2-(3+abs(x)) == -2\"\n\"var x:=1;  2/(3*abs(x)) == (2/3)\"\n\"var x:=1;  2+(3-abs(x)) == 4\"\n\"var x:=1;  2+(3+abs(x)) == 6\"\n\"~{var x := '123'; x[]} + ~{~{var x := '1234'; x[]}} == 7\"\n\"~{var x := '123'; x[]} + ~{var x := '1234'; x[]}    == 7\"\n\"~{var x := '123'; x[]} + ~{~{var x := 4}}           == 7\"\n\"~{var x := '123'; x[]} + ~{var x := 4}              == 7\"\n\"var x:=1;  2+(abs(x)-3) == 0\"\n\"var x:=1;  2-(abs(x)+3) == -2\"\n\"var x:=1;  2*(abs(x)/3) == (2/3)\"\n\"var x:=1;  2+(abs(x)+3) == 6\"\n\"var x:=1;  (3+abs(x))-2 ==  2\"\n\"var x:=1;  (3*abs(x))/2 == (3/2)\"\n\"var x:=1;  (3-abs(x))+2 == 4\"\n\"var x:=1;  (3+abs(x))+2 == 6\"\n\"var x:=1;  (abs(x)-3)+2 == 0\"\n\"var x:=1;  (abs(x)/3)/2 == (1/6)\"\n\"var x:=1;  (abs(x)+3)-2 ==  2\"\n\"var x:=1;  (abs(x)/3)*2 == (2/3)\"\n\"var x:=1;  (abs(x)*3)/2 == (3/2)\"\n\"var x:=1;  (abs(x)+3)+2 == 6\"\n\"(~{~{ var x    := [1] }} + ~{ var x[1] := [1] } + ~{ var x[1] := [2] } + ~{{ var x[1] := [2] }}) == 6\"\n\"(~{ var x    := [1] } + ~{ var x[1] := [2] } + ~{~{ var x[1] := [1] } + ~{ var x[1] := [2] }}) == 6\"\n\"~{ var x := 1 } + ~{ var x := 2 } == 3\"\n\"(~{ var x := 1 } + ~{ var x := 2 } + ~{~{ var x := 1 } + ~{ var x := 2 }}) == 6\"\n\"(~{ var x := 1 } + ~{ var x := 2 }) == (~{ var x := 2 } + ~{ var x := 1 })\"\n\"(~{ var x := 1 } + ~{ var x[6] := {6,5,4,3,2,1} }) == 7\"\n\"var x := 1; var y := 2; 1\"\n\"var x := 1; var y := 2; swap(x,y); (x == 2) and (y == 1)\"\n\"var x := 1; var y := 2; ~(swap(x,y),(x == 2) and (y == 1))\"\n\"var x := 1; var y := 2; var v[2] := {3,4}; swap(x,v[0]); swap(v[1],y); (x == 3) and (y == 4)\"\n\"var x := 1; var y := 2; var v[2] := {3,4}; swap(x,v[2 * zero]); swap(v[(2 * one) / (1 + 1)],y); (x == 3) and (y == 4)\"\n\"var x := 1; var y := 2; var v[2] := {3,4}; swap(x,v[zero]); swap(v[one],y); (x == 3) and (y == 4)\"\n\"var x := 1; var y := 2; var v[2] := {3,4}; x <=> v[0]; v[1] <=> y; (x == 3) and (y == 4)\"\n\"var x := 1; var y := 2; var v[2] := {3,4}; x <=> v[zero / 3]; v[(2 * one)/(1 + 1)] <=> y; (x == 3) and (y == 4)\"\n\"var x := 1; var y := 2; var v[2] := {3,4}; x <=> v[zero]; v[one] <=> y; (x == 3) and (y == 4)\"\n\"var x := 1; var y := 2; x\"\n\"var x := 1; var y := 2; x <=> y     ; (x    == 2) and (y    == 1)\"\n\"var x := 1; x\"\n\"var x := 2; (~{ for (var i := 0; i < 10; i += 1) { for (var j := 0; j <= i; j += 1) { var y := 3; if ((i + j + y + x) < 6) { y += x; continue; } else break[i + j]; } } } + ~{ for (var i := 0; i < 10; i += 1) { for (var j := 0; j <= i; j += 1) { var y := 3; if ((i + j + y + x) < 6) { y += x; continue; } else break[i + j]; } } }) == 18\"\n\"var x := 2; var v0[3] := {1,2,3}; ( ~{ for (var i := 0; i < 10; i += 1) { for (var j := 0; j <= i; j += 1) { var y := 3; var v2[3] := {1,2,3}; if ( (i + j + y + x + abs(v0[i % v0[]] - v2[j % v2[]])) < 6) { var v3[3] := {1,2,3}; y += x / v3[j % v3[]]; continue; } else break[i + j]; } } } + ~{ for (var i := 0; i < 10; i += 1) { for (var j := 0; j <= i; j += 1)  { var y := 3; var v2[3] := {1,2,3}; if ((i + j + y + x + abs(v0[i % v0[]] - v2[j % v2[]])) < 6) { var v3[3] := {1,2,3}; y += x / v3[j % v3[]]; continue; } else break[i + j]; } } } ) == 18\"\n\"var x:= 2; var y := 3; (-abs(x + 0)+abs(y - 0))  ==  1\"\n\"var x:= 2; var y := 3; (-abs(x + 0)--abs(y - 0)) ==  1\"\n\"var x:= 2; var y := 3; (-abs(x + 0)/-abs(y - 0)) ==  (2/3)\"\n\"var x:= 2; var y := 3; (abs(x + 0)--abs(y - 0))  ==  5\"\n\"var x:= 2; var y := 3; (-abs(x + 0)-abs(y - 0))  == -5\"\n\"var x:= 2; var y := 3; (-abs(x + 0)+-abs(y - 0)) == -5\"\n\"var x:= 2; var y := 3; (-abs(x + 0)*-abs(y - 0)) ==  6\"\n\"var x:= 2; var y := 3; (-abs(x)+abs(y))  ==  1\"\n\"var x:= 2; var y := 3; (-abs(x)--abs(y)) ==  1\"\n\"var x:= 2; var y := 3; (-abs(x)/-abs(y)) ==  (2/3)\"\n\"var x:= 2; var y := 3; (abs(x)--abs(y))  ==  5\"\n\"var x:= 2; var y := 3; (-abs(x)-abs(y))  == -5\"\n\"var x:= 2; var y := 3; (-abs(x)+-abs(y)) == -5\"\n\"var x:= 2; var y := 3; (-abs(x)*-abs(y)) ==  6\"\n\"var x[3] := {0.1,0.2,0.3}; sum(trunc(x)) == 0\"\n\"var x[3] := [0]; var y[1] := {1};       x <= y\"\n\"var x[3] := [0]; var y[1] := {1};       x <  Y\"\n\"var x[3] := [0]; var y[1] := {1};       x < (y += 1)\"\n\"var x[3] := [0]; var y[1] := {5};       (x += 1) < y\"\n\"var x[3] := [0]; var y[1] := {5};       (x += 1) < (y += 1)\"\n\"var x[3] := [0]; var y[2] := {1,2};     x <= y\"\n\"var x[3] := [0]; var y[2] := {1,2};     X <  y\"\n\"var x[3] := [0]; var y[2] := {1,2};     x < (y += 1)\"\n\"var x[3] := [0]; var y[2] := {5,6};     (x += 1) < y\"\n\"var x[3] := [0]; var y[2] := {5,6};     (x += 1) < (y += 1)\"\n\"var x[3] := [0]; var y[3] := {1,2,3};   x <= y\"\n\"var x[3] := [0]; var y[3] := {1,2,3};   x <  Y\"\n\"var x[3] := [0]; var y[3] := {1,2,3};   x < (y += 1)\"\n\"var x[3] := [0]; var y[3] := {5,6,7};   (x += 1) < y\"\n\"var x[3] := [0]; var y[3] := {5,6,7};   (x += 1) < (y += 1)\"\n\"var x[3] := [0]; var y[4] := {1,2,3,4}; x <= y\"\n\"var x[3] := [0]; var y[4] := {1,2,3,4}; X <  y\"\n\"var x[3] := [0]; var y[4] := {1,2,3,4}; x < (y += 1)\"\n\"var x[3] := [0]; var y[4] := {5,6,7,8}; (x += 1) < y\"\n\"var x[3] := [0]; var y[4] := {5,6,7,8}; (x += 1) < (y += 1)\"\n\"var x[3] := {1,1,1};  var y := 1; x == y\"\n\"var x[3] := {1,1,1};  var y := 1; y == x\"\n\"var x[3] := {1,1,1};  var y := 2; x == y - 1\"\n\"var x[3] := {1,1,1};  var y := 2; y - 1 == x\"\n\"var x[3] := {-1,-2,-3};    sum(abs(x)  ) == 6\"\n\"var x[3] := {1,2,3};  var y := 3; equal(true,(x -= 1) < y + 1)\"\n\"var x[3] := {1,2,3};  var y := 3; x <= y + 1\"\n\"var x[3] := {1,2,3};  var y := 3; x < y + 1\"\n\"var x[3] := {1,2,3};  var y := 3; y >= x\"\n\"var x[3] := {1,2,3};  var y := 5; equal(true,(x -= 1) <= y)\"\n\"var x[3] := {1,2,3};  var y := 5; equal(true,(x += 1) < y)\"\n\"var x[3] := {1,2,3};  var y := 5; x <= y\"\n\"var x[3] := {1,2,3};  var y := 5; x < y\"\n\"var x[3] := {1,2,3};  var y := 5; y + 1 > x\"\n\"var x[3] := {1,2,3};  var y := 5; y + 1 > (x += 1)\"\n\"var x[3] := {1,2,3};  var y := 5; y > x\"\n\"var x[3] := {1,2,3};  var y := 5; y > (x += 1)\"\n\"var x[3] := {1,2,3}; (x[0] == 1) and (x[1] == 2) and (x[2] == 3)\"\n\"var x[3] := {1,2};   (x[0] == 1) and (x[1] == 2) and (x[2] == 0)\"\n\"(~{ var x[3] := [1] } + ~{ var x[6] := {6,5,4,3,2,1}}) == 7\"\n\"var x[3] := [1]; var y[1] := {1};       var z[3] := [1]; z := 2(x * y)/3; z == 2(x * y)/3\"\n\"var x[3] := [1]; var y[1] := {1};       var z[3] := [1]; z := 2(x * y); z == (x * y)2\"\n\"var x[3] := [1]; var y[1] := {1};       var z[3] := [1]; z := (x * y); z == (x * y)\"\n\"var x[3] := [1]; var y[1] := [1];       x == y\"\n\"var x[3] := [1]; var y[1] := [2];       x != y\"\n\"var x[3] := [1]; var y[2] := {1,2};     var z[3] := [1]; z := 2(x / y)/3; z == 2(x / y)/3\"\n\"var x[3] := [1]; var y[2] := {1,2};     var z[3] := [1]; z := 2(x / y); z == (x / y)2\"\n\"var x[3] := [1]; var y[2] := {1,2};     var z[3] := [1]; z := (x / y); z == (x / y)\"\n\"var x[3] := [1]; var y[2] := [1];       x == y\"\n\"var x[3] := [1]; var y[2] := [2];       x != y\"\n\"var x[3] := [1]; var y[3] := {1,2,3};   var z[3] := [1]; z := 2(x - y)/3; z == 2(x - y)/3\"\n\"var x[3] := [1]; var y[3] := {1,2,3};   var z[3] := [1]; z := 2(x - y); z == (x - y)2\"\n\"var x[3] := [1]; var y[3] := {1,2,3};   var z[3] := [1]; z := (x - y); z == (x - y)\"\n\"var x[3] := [1]; var y[3] := [1];       x == y\"\n\"var x[3] := [1]; var y[3] := [2];       x != y\"\n\"var x[3] := [1]; var y[4] := {1,2,3,4}; var z[3] := [1]; z := 2(x + y)/3; z == 2(x + y)/3\"\n\"var x[3] := [1]; var y[4] := {1,2,3,4}; var z[3] := [1]; z := 2(x + y); z == (x + y)2\"\n\"var x[3] := [1]; var y[4] := {1,2,3,4}; var z[3] := [1]; z := (x + y); z == (x + y)\"\n\"var x[3] := [1]; var y[4] := [1];       x == y\"\n\"var x[3] := [1]; var y[4] := [2];       x != y\"\n\"var x[3] := [1];     (x[0] == 1) and (x[1] == 1) and (x[2] == 1)\"\n\"var x[3] := {2,2,2};  var y := 0; y + 1 == (x -= 1)\"\n\"var x[3] := {2,2,2};  var y := 1; (x -= 1) == y\"\n\"var x[3] := {2,2,2};  var y := 1; y == (x -= 1)\"\n\"var x[3] := [5]; var y[1] := {1};       x >= y\"\n\"var x[3] := [5]; var y[1] := {1};       x >  y\"\n\"var x[3] := [5]; var y[2] := {1,2};     x >= y\"\n\"var x[3] := [5]; var y[2] := {1,2};     x >  y\"\n\"var x[3] := [5]; var y[3] := {1,2,3};   x >= y\"\n\"var x[3] := [5]; var y[3] := {1,2,3};   x >  y\"\n\"var x[3] := [5]; var y[4] := {1,2,3,4}; x >= y\"\n\"var x[3] := [5]; var y[4] := {1,2,3,4}; x >  y\"\n\"var x[3] := [8]; var y[1] := {1};       (x += 1) <=> (y += 1); (x[0] == 2) and (x[1] == 9) and (x[2] == 9)\"\n\"var x[3] := [8]; var y[1] := {1};       (x += 1) <=> y; (x[0] == 1) and (x[1] == 9) and (x[2] == 9)\"\n\"var x[3] := [8]; var y[2] := {1,2};     (x += 1) <=> (y += 1); (x[0] == 2) and (x[1] == 3) and (x[2] == 9)\"\n\"var x[3] := [8]; var y[2] := {1,2};     (x += 1) <=> y; (x[0] == 1) and (x[1] == 2) and (x[2] == 9)\"\n\"var x[3] := [8]; var y[3] := {1,2,3};   (x += 1) <=> (y += 1); (x[0] == 2) and (x[1] == 3) and (x[2] == 4)\"\n\"var x[3] := [8]; var y[3] := {1,2,3};   (x += 1) <=> y; (x[0] == 1) and (x[1] == 2) and (x[2] == 3)\"\n\"var x[3] := [8]; var y[4] := {1,2,3,4}; (x += 1) <=> (y += 1); (x[0] == 2) and (x[1] == 3) and (x[2] == 4)\"\n\"var x[3] := [8]; var y[4] := {1,2,3,4}; (x += 1) <=> y; (x[0] == 1) and (x[1] == 2) and (x[2] == 3)\"\n\"var x[3] := [9]; var y[1] := {1};       x <=> (y += 1); (x[0] == 2) and (x[1] == 9) and (x[2] == 9)\"\n\"var x[3] := [9]; var y[1] := {1};       x <=> y; (x[0] == 1) and (x[1] == 9) and (x[2] == 9)\"\n\"var x[3] := [9]; var y[2] := {1,2};     x <=> (y += 1); (x[0] == 2) and (x[1] == 3) and (x[2] == 9)\"\n\"var x[3] := [9]; var y[2] := {1,2};     x <=> y; (x[0] == 1) and (x[1] == 2) and (x[2] == 9)\"\n\"var x[3] := [9]; var y[3] := {1,2,3};   x <=> (y += 1); (x[0] == 2) and (x[1] == 3) and (x[2] == 4)\"\n\"var x[3] := [9]; var y[3] := {1,2,3};   x <=> y; (x[0] == 1) and (x[1] == 2) and (x[2] == 3)\"\n\"var x[3] := [9]; var y[4] := {1,2,3,4}; x <=> (y += 1); (x[0] == 2) and (x[1] == 3) and (x[2] == 4)\"\n\"var x[3] := [9]; var y[4] := {1,2,3,4}; x <=> y; (x[0] == 1) and (x[1] == 2) and (x[2] == 3)\"\n\"~{~{var x := 3}} + ~{var x := '1234'; x[]}          == 7\"\n\"~{var x := 3} + ~{var x := '1234'; x[]}             == 7\"\n\"var x[3] := {};  var y[1] := {1};       x := (y+=1); (x[0] == y[0]) and (x[1] ==    0) and (x[2] ==    0)\"\n\"var x[3] := {};  var y[1] := {1};       x := y; (x[0] == y[0]) and (x[1] ==    0) and (x[2] ==    0)\"\n\"var x[3] := {};  var y[2] := {1,2};     x := (y+=1); (x[0] == y[0]) and (x[1] == y[1]) and (x[2] ==    0)\"\n\"var x[3] := {};  var y[2] := {1,2};     x := y; (x[0] == y[0]) and (x[1] == y[1]) and (x[2] ==    0)\"\n\"var x[3] := {};  var y[3] := {1,2,3};   x := (y+=1); (x[0] == y[0]) and (x[1] == y[1]) and (x[2] == y[2])\"\n\"var x[3] := {};  var y[3] := {1,2,3};   x := y; (x[0] == y[0]) and (x[1] == y[1]) and (x[2] == y[2])\"\n\"var x[3] := {};  var y[4] := {1,2,3,4}; x := (y+=1); (x[0] == y[0]) and (x[1] == y[1]) and (x[2] == y[2])\"\n\"var x[3] := {};  var y[4] := {1,2,3,4}; x := y; (x[0] == y[0]) and (x[1] == y[1]) and (x[2] == y[2])\"\n\"var x := 3; var y := 6; -x * -y == 18\"\n\"var x:=3; var y:=6; -(-(-x))*-(-(-y))         ==  18\"\n\"var x:=3; var y:=6; -(-x)*-(-(-y))            == -18\"\n\"var x:=3; var y:=6; -(-x)*-(-y)               ==  18\"\n\"var x := 3; var y := 6;  x + -y == -3\"\n\"var x := 3; var y := 6; -x - -y ==  3\"\n\"var x := 3; var y := 6;  x - -y ==  9\"\n\"var x := 3; var y := 6; -x + -y == -9\"\n\"var x:=3; var y:=6; -(-(-(x+y)))*-(-(-(y+x))) ==  81\"\n\"var x:=3; var y:=6; -(-(-(x+y)))*-(-(y+x))    == -81\"\n\"var x:=3; var y:=6; -(-(x+y))*-(-(y+x))       ==  81\"\n\"var x[3] := {};      (x[0] == 0) and (x[1] == 0) and (x[2] == 0)\"\n\"var x[6] := {1,2,3,4,5,6}; equal(sqrt(sum([x - avg(x)]^2) / x[]),1.7078251277)\"\n\"(~{ var x[6] := {6,5,4,3,2,1} } + ~{ var x := 1 }) == 7\"\n\"var x := 6; var y := 3; -x / -y ==  2\"\n\"var x:=6; var y:=4;  3 / -x == -0.5\"\n\"var x:=6; var y:=4; -3 / -x ==  0.5\"\n\"var x:=6; var y:=4;  3 * -x ==  -18\"\n\"var x:=6; var y:=4; -3 * -x ==   18\"\n\"var x:=6; var y:=4;  3 + -x ==   -3\"\n\"var x:=6; var y:=4; -3 - -x ==    3\"\n\"var x:=6; var y:=4;  3 - -x ==    9\"\n\"var x:=6; var y:=4; -3 + -x ==   -9\"\n\"var x:=6; var y:=4; x * -3  == -18\"\n\"var x:=6; var y:=4; x / -3  ==  -2\"\n\"var x:=6; var y:=4; -x - -3 ==  -3\"\n\"var x:=6; var y:=4; x + -3  ==   3\"\n\"var x:=6; var y:=4; -x + -3 ==  -9\"\n\"var x:=6; var y:=4; x - -3  ==   9\"\n\"var x := 'abc'; var y := '123'; x != y\"\n\"var x := 'abc'; var y := '123' + x; y == '123abc'\"\n\"var x := 'abc'; var y := x + '123'; y == 'abc123'\"\n\"var x := 'abc'; x == 'abc'\"\n\"~{var x := 'xxx'; var y := 'yyy';~{((x + '2') != x ? x : y) == x  }}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{(x == (x + '1') ? x : y) == y  }}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{'xxx1' == (x < y ? x + '1' : y)}}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{x == (x != (x + '2') ? x : y)  }}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{(x < y ? x + '1' : y) == 'xxx1'}}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{(x > y ? x : y + '2') == 'yyy2'}}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{(x < y ? x : y) == x           }}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{(x > y ? x : y) == y           }}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{y == (x == (x + '1') ? x : y)  }}\"\n\"~{var x := 'xxx'; var y := 'yyy';~{'yyy2' == (x > y ? x : y + '2')}}\"\n\"'abcd'      like 'abcd*'\"\n\"'abcd'      like 'abc*'\"\n\"'abcd'      like 'ab*'\"\n\"'abcd'      like 'a*'\"\n\"'abcd'      like 'abcd?'\"\n\"'abcd'      like 'abc?'\"\n\"'abcd'      like 'abc??'\"\n\"'abcd'      like 'ab???'\"\n\"'abcd'      like 'a????'\"\n\"'abcd'      like '?????'\"\n\"'a'         like 'a*'\"\n\"'ab'        like 'a*'\"\n\"'abcd'      like 'abcd*'\"\n\"''          like ''\"\n\"'abcd'      like 'abcd'\"\n\"'abcd'      like 'abc*'\"\n\"'abcd'      like '*bcd'\"\n\"'abcd'      like 'abc?'\"\n\"'abcd'      like '?bcd'\"\n\"'abcd'      like 'ab?d'\"\n\"'abcd'      like 'ab*d'\"\n\"'abcd'      like 'a?cd'\"\n\"'abcd'      like 'a*cd'\"\n\"'abcd'      like 'a??d'\"\n\"'abcd'      like 'a*?d'\"\n\"'abcd'      like '*bc*'\"\n\"'abcd'      like '?bc?'\"\n\"'abcd'      like '????'\"\n\"'abcd'      like 'a???'\"\n\"'abcd'      like 'ab??'\"\n\"'abcd'      like 'abc?'\"\n\"'abcd'      like '???d'\"\n\"'abcd'      like '??cd'\"\n\"'abcd'      like '?bcd'\"\n\"'abcd'      like '?b?d'\"\n\"'abcd'      like 'a?c?'\"\n\"'abcd'      like 'a??d'\"\n\"'abcd'      like '?bc?'\"\n\"'abcd'      like 'ab**'\"\n\"'abcd'      like 'ab*?'\"\n\"'abcd'      like 'a***'\"\n\"'abcd'      like '**cd'\"\n\"'abcd'      like '*?cd'\"\n\"'abcd'      like '***d'\"\n\"'abcd'      like '?*?d'\"\n\"'abcd'      like '?*?d'\"\n\"'abcd'      like '*bc*'\"\n\"'abcd'      like '*bc?'\"\n\"'abcd'      like '*b??'\"\n\"'abcd'      like '?bc*'\"\n\"'abcd'      like '??c*'\"\n\"'abcd'      like '*b?*'\"\n\"'abcd'      like '*b*d'\"\n\"'abcd'      like 'a*c*'\"\n\"'abcd'      like '?*cd'\"\n\"'abcd'      like 'ab?*'\"\n\"'abcd'      like 'ab*?'\"\n\"'abcd'      like 'a?*d'\"\n\"'ab'        like 'a*'\"\n\"'ab'        like 'a?'\"\n\"'a'         like 'a*'\"\n\"'a'         like 'a?'\"\n\"'xalabcd'   like '*abcd*'\"\n\"'xablabcd'  like '*abcd*'\"\n\"'xabclabcd' like '*abcd*'\"\n\"'aaaaa'     like '*aa?'\"\n\"'abcd'      like 'xyzw'\"\n\"'abcd'      like 'xyz'\"\n\"'abc'       like 'xyzw'\"\n\"'abcd'      like 'ab?'\"\n\"'abcd'      like 'a?'\"\n\"'abcd'      ilike 'abcd*'\"\n\"'abcd'      ilike 'abc*'\"\n\"'abcd'      ilike 'ab*'\"\n\"'abcd'      ilike 'a*'\"\n\"'abcd'      ilike 'abcd?'\"\n\"'abcd'      ilike 'abc?'\"\n\"'abcd'      ilike 'abc??'\"\n\"'abcd'      ilike 'ab???'\"\n\"'abcd'      ilike 'a????'\"\n\"'abcd'      ilike '?????'\"\n\"'a'         ilike 'a*'\"\n\"'ab'        ilike 'a*'\"\n\"'abcd'      ilike 'abcd*'\"\n\"''          ilike ''\"\n\"'abcd'      ilike 'abcd'\"\n\"'abcd'      ilike 'abc*'\"\n\"'abcd'      ilike '*bcd'\"\n\"'abcd'      ilike 'abc?'\"\n\"'abcd'      ilike '?bcd'\"\n\"'abcd'      ilike 'ab?d'\"\n\"'abcd'      ilike 'ab*d'\"\n\"'abcd'      ilike 'a?cd'\"\n\"'abcd'      ilike 'a*cd'\"\n\"'abcd'      ilike 'a??d'\"\n\"'abcd'      ilike 'a*?d'\"\n\"'abcd'      ilike '*bc*'\"\n\"'abcd'      ilike '?bc?'\"\n\"'abcd'      ilike '????'\"\n\"'abcd'      ilike 'a???'\"\n\"'abcd'      ilike 'ab??'\"\n\"'abcd'      ilike 'abc?'\"\n\"'abcd'      ilike '???d'\"\n\"'abcd'      ilike '??cd'\"\n\"'abcd'      ilike '?bcd'\"\n\"'abcd'      ilike '?b?d'\"\n\"'abcd'      ilike 'a?c?'\"\n\"'abcd'      ilike 'a??d'\"\n\"'abcd'      ilike '?bc?'\"\n\"'abcd'      ilike 'ab**'\"\n\"'abcd'      ilike 'ab*?'\"\n\"'abcd'      ilike 'a***'\"\n\"'abcd'      ilike '**cd'\"\n\"'abcd'      ilike '*?cd'\"\n\"'abcd'      ilike '***d'\"\n\"'abcd'      ilike '?*?d'\"\n\"'abcd'      ilike '?*?d'\"\n\"'abcd'      ilike '*bc*'\"\n\"'abcd'      ilike '*bc?'\"\n\"'abcd'      ilike '*b??'\"\n\"'abcd'      ilike '?bc*'\"\n\"'abcd'      ilike '??c*'\"\n\"'abcd'      ilike '*b?*'\"\n\"'abcd'      ilike '*b*d'\"\n\"'abcd'      ilike 'a*c*'\"\n\"'abcd'      ilike '?*cd'\"\n\"'abcd'      ilike 'ab?*'\"\n\"'abcd'      ilike 'ab*?'\"\n\"'abcd'      ilike 'a?*d'\"\n\"'ab'        ilike 'a*'\"\n\"'ab'        ilike 'a?'\"\n\"'a'         ilike 'a*'\"\n\"'a'         ilike 'a?'\"\n\"'xalabcd'   ilike '*abcd*'\"\n\"'xablabcd'  ilike '*abcd*'\"\n\"'xabclabcd' ilike '*abcd*'\"\n\"'aaaaa'     ilike '*aa?'\"\n\"'abcd'      ilike 'xyzw'\"\n\"'abcd'      ilike 'xyz'\"\n\"'abc'       ilike 'xyzw'\"\n\"'abcd'      ilike 'ab?'\"\n\"'abcd'      ilike 'a?'\"\n\"~{var s := ~{var n := 1; var m := 2; if (n < m) 'n < m';  else 'n >= m'; }; (s == 'n < m')}\"\n\"~{var s := ~{var n := 1; var m := 2; if (n > m) 'n <= m'; else 'n > m'; }; (s == 'n > m')}\"\n\"~{var s := ~{var n := 1; var m := 2; if (n < m) 'n < m';  else 'n >' + '= m'; }; (s == 'n < m')}\"\n\"~{var s := ~{var n := 1; var m := 2; if (n < m) 'n ' + '< m'; else 'n >= m'; }; (s == 'n < m')}\"\n\"~{var s := ~{var n := 1; var m := 2; if (n > m) 'n <= m'; else 'n ' + '> m'; }; (s == 'n > m')}\"\n\"~{var s := ~{var n := 1; var m := 2; if (n > m) 'n <' + '= m'; else 'n > m'; }; (s == 'n > m')}\"\n\"~{var s := ~{var n := 1; var m := 2; var r0 := 'n < m'; var r1 := 'n >= m'; if (n < m) r0; else r1; }; (s == 'n < m')}\"\n\"~{var s := ~{var n := 1; var m := 2; var r0 := 'n < m'; var r1 := 'n >= m'; if (n < m) r0 + ''; else r1 + ''; }; (s == 'n < m')}\"\n\"~{var s := ~{var n := 1; var m := 2; var r0 := 'n < m'; var r1 := 'n >= m'; if (n < m) '' + r0; else '' + r1; }; (s == 'n < m')}\""
  },
  {
    "path": "projects/exprtk/project.yaml",
    "content": "homepage: \"https://www.partow.net/programming/exprtk/index.html\"\nlanguage: c++\nprimary_contact: \"exprtk.dev@gmail.com\"\nauto_ccs:\n    - \"exprtk.dev@gmail.com\"\nfuzzing_engines:\n    - libfuzzer\n    - afl\n    - honggfuzz\nsanitizers:\n    - address\n    - undefined\n    - memory\nmain_repo: 'https://github.com/ArashPartow/exprtk.git'\n"
  },
  {
    "path": "projects/faad2/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3\nRUN git clone https://github.com/knik0/faad2 faad2\nWORKDIR faad2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/faad2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport USE_BAZEL_VERSION=7.4.0\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/faad2/project.yaml",
    "content": "homepage: \"https://sourceforge.net/projects/faac\"\nmain_repo: \"https://github.com/knik0/faad2\"\nlanguage: c\nprimary_contact: \"eustas@chromium.org\"\nauto_ccs:\n - \"david@adalogics.com\"\nsanitizers:\n - address\n - memory\n - undefined\n"
  },
  {
    "path": "projects/fabric/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/hyperledger/fabric\nRUN git clone --depth 1 https://github.com/hyperledger/fabric-lib-go\nCOPY build.sh ccprovider_fuzzer.go \\\n\t persistence_fuzzer.go \\\n\t policydsl_fuzzer.go \\\n\t fabenc_fuzzer.go \\\n\t msp_fuzzer.go $SRC/\nWORKDIR $SRC/fabric\n\nCOPY *.options $SRC/\n"
  },
  {
    "path": "projects/fabric/FuzzExtractFileEntries.options",
    "content": "[libfuzzer]\nmax_len = 1800000\nlen_control = 0"
  },
  {
    "path": "projects/fabric/FuzzParseChaincodePackage.options",
    "content": "[libfuzzer]\nmax_len = 1800000\nlen_control = 0"
  },
  {
    "path": "projects/fabric/FuzzPersistence.options",
    "content": "[libfuzzer]\nmax_len = 1800000\nlen_control = 0"
  },
  {
    "path": "projects/fabric/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# Temporarily disable coverage build in OSS-Fuzz's CI\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n\tif [ \"${SANITIZER}\" = 'coverage' ]\n\tthen\n\t\texit 0\n\tfi\n\nfi\n\nrm -r $SRC/fabric/cmd/cryptogen\n\ncp $SRC/ccprovider_fuzzer.go ./core/common/ccprovider/\ncp $SRC/persistence_fuzzer.go ./core/chaincode/persistence/mock/\ncp $SRC/policydsl_fuzzer.go $SRC/fabric/common/policydsl/\ncp $SRC/msp_fuzzer.go $SRC/fabric/msp/\ncp $SRC/fabenc_fuzzer.go $SRC/fabric-lib-go/common/flogging/fabenc/\n\ncd $SRC/fabric\ngo mod tidy && go mod vendor\n\ngo get github.com/AdaLogics/go-fuzz-headers\ngo mod tidy\ngo mod vendor\n\ncompile_go_fuzzer github.com/hyperledger/fabric/core/chaincode/persistence/mock FuzzPersistence fuzz_persistence\ncompile_go_fuzzer github.com/hyperledger/fabric/core/chaincode/persistence/mock FuzzChaincodePackageStreamerMetadatabytes FuzzChaincodePackageStreamerMetadatabytes\ncompile_go_fuzzer github.com/hyperledger/fabric/core/chaincode/persistence/mock FuzzParseChaincodePackage FuzzParseChaincodePackage\ncompile_go_fuzzer github.com/hyperledger/fabric/core/common/ccprovider FuzzExtractFileEntries FuzzExtractFileEntries\ncompile_go_fuzzer github.com/hyperledger/fabric/common/policydsl FuzzFromString fuzz_from_string\ncompile_go_fuzzer github.com/hyperledger/fabric/msp FuzzDeserializeIdentity fuzz_deserialize_identity\ncd $SRC/fabric-lib-go\ncompile_go_fuzzer github.com/hyperledger/fabric-lib-go/common/flogging/fabenc FuzzParseFormat fuzz_parse_format\n\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/fabric/ccprovider_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage ccprovider\n\nimport (\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc FuzzExtractFileEntries(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\ttarBytes, err := f.TarBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tdatabaseType, err := f.GetString()\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_, _ = ExtractFileEntries(tarBytes, databaseType)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/fabric/fabenc_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage fabenc\n\nfunc FuzzParseFormat(data []byte) int {\n\t_, _ = ParseFormat(string(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/fabric/msp_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage msp\n\nfunc FuzzDeserializeIdentity(data []byte) int {\n\tm := &mspManagerImpl{}\n\tm.up = true\n\t_, _ = m.DeserializeIdentity(data)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/fabric/persistence_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage mock\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n\t\"github.com/hyperledger/fabric/core/chaincode/persistence\"\n\ttm \"github.com/stretchr/testify/mock\"\n\t\"os\"\n)\n\nfunc FuzzPersistence(data []byte) int {\n\tvar ccpp persistence.ChaincodePackageParser\n\tmockMetaProvider := &MetadataProvider{}\n\tmockMetaProvider.On(\"GetDBArtifacts\", tm.Anything).Return([]byte(\"DB artefacts\"), nil)\n\tccpp.MetadataProvider = mockMetaProvider\n\t_, _ = ccpp.Parse(data)\n\treturn 1\n}\n\nfunc FuzzChaincodePackageStreamerMetadatabytes(data []byte) int {\n\terr := os.WriteFile(\"demoTar.tar\", data, 0666)\n\tif err != nil {\n\t\treturn 0\n\t}\n\tdefer os.Remove(\"demoTar.tar\")\n\tcps := &persistence.ChaincodePackageStreamer{PackagePath: \"demoTar.tar\"}\n\t_, _ = cps.MetadataBytes()\n\treturn 1\n}\n\nfunc FuzzParseChaincodePackage(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tsource, err := f.TarBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tvar b bytes.Buffer\n\tw := gzip.NewWriter(&b)\n\tw.Write(source)\n\tw.Close()\n\t_, _, _ = persistence.ParseChaincodePackage(b.Bytes())\n\treturn 1\n}\n"
  },
  {
    "path": "projects/fabric/policydsl_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage policydsl\n\nfunc FuzzFromString(data []byte) int {\n\t_, _ = FromString(string(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/fabric/project.yaml",
    "content": "homepage: \"https://www.hyperledger.org\"\nmain_repo: \"https://github.com/hyperledger/fabric\"\nprimary_contact: \"ale.linux@sopit.net\"\nauto_ccs:\n  - \"gari.r.singh@gmail.com\"\nvendor_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/face/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/mahmoud/face face\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/face\n"
  },
  {
    "path": "projects/face/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/face/fuzz_command.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport face\n\n\ndef empty():\n  return\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  args = []\n  for idx in range(fdp.ConsumeIntInRange(1, 100)):\n    args.append(fdp.ConsumeUnicodeNoSurrogates(124))\n\n  cmd = face.Command(empty, name='fuzz')\n  for idx in range(fdp.ConsumeIntInRange(1, 15)):\n    try:\n      cmd.add(fdp.ConsumeUnicodeNoSurrogates(64),\n              char=fdp.ConsumeUnicodeNoSurrogates(5),\n              parse_as=fdp.ConsumeBool(),\n              doc=fdp.ConsumeUnicodeNoSurrogates(64))\n    except face.errors.FaceException:\n      pass\n    except ValueError:\n      # Raised by face: https://github.com/mahmoud/face/blob/eb56873b9081852f4500b1a61f178ca0cc8666bc/face/utils.py#L80\n      pass\n\n  # Create a command and parse the args\n  try:\n    cmd.parse(args)\n  except face.errors.FaceException:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/face/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport face\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  args = []\n  for idx in range(fdp.ConsumeIntInRange(1, 100)):\n    args.append(fdp.ConsumeUnicodeNoSurrogates(124))\n\n  # Create a command and parse the args\n  cmd = face.Command(lambda flag, part: None, name='cmd')\n  try:\n    cmd.parse(args)\n  except face.errors.FaceException:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/face/project.yaml",
    "content": "homepage: https://github.com/mahmoud/face\nmain_repo: https://github.com/mahmoud/face\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/fast-dds/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt install -y autoconf automake pkg-config\nRUN git clone --depth 1 https://github.com/leethomason/tinyxml2\nRUN git clone --depth 1 --branch asio-1-18-1 https://github.com/chriskohlhoff/asio/\nRUN git clone --depth 1 https://github.com/eProsima/Fast-CDR.git\nRUN git clone --depth 1 https://github.com/eProsima/foonathan_memory_vendor.git\nRUN git clone --depth 1 https://github.com/eProsima/Fast-DDS.git\nCOPY build.sh $SRC\nWORKDIR $SRC/Fast-DDS\n"
  },
  {
    "path": "projects/fast-dds/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n(\ncd ../tinyxml2\nmake clean\nmake -j$(nproc) all\ncp libtinyxml2.a /usr/local/lib/\ncp *.h /usr/local/include/\n)\n\n(\ncd ../asio/asio\nsh autogen.sh\n./configure\nmake -j$(nproc) install\n)\n\n(\ncd ..\nmkdir Fast-CDR/build && cd Fast-CDR/build\ncmake .. -DBUILD_SHARED_LIBS=OFF\ncmake --build . --target install\n)\n\n(\ncd ..\ncd foonathan_memory_vendor\nmkdir build && cd build\ncmake .. -DBUILD_SHARED_LIBS=OFF\ncmake --build . --target install\n)\n\n# build project\nexport CFLAGS=\"${CFLAGS} -Wno-error=nonnull\"\nexport CXXFLAGS=\"${CXXFLAGS} -Wno-error=nonnull\"\nmkdir build && cd build\ncmake .. -DBUILD_SHARED_LIBS=OFF\nmake -j $(nproc)\ncd ..\n\nfind build/fuzz -maxdepth 3 -type f -name 'fuzz_*' | while read fuzzer; do\n    cp \"$fuzzer\" $OUT/\ndone\n\nfind fuzz/ -type d -name 'fuzz_*_seed_corpus' | while read corpus_dir; do\n  zip -j $OUT/$(basename \"$corpus_dir\").zip $corpus_dir/*\ndone\n"
  },
  {
    "path": "projects/fast-dds/project.yaml",
    "content": "homepage: \"https://www.eprosima.com/\"\nlanguage: c++\nprimary_contact: \"miguelcompany@eprosima.com\"\nauto_ccs:\n- \"p.antoine@catenacyber.fr\"\n- \"federico.maggi@gmail.com\"\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/eProsima/Fast-DDS.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/fast-xml-parser/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/NaturalIntelligence/fast-xml-parser\n\nCOPY fuzz.js $SRC/fast-xml-parser\n\nWORKDIR $SRC/fast-xml-parser\n"
  },
  {
    "path": "projects/fast-xml-parser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer fast-xml-parser fuzz.js -i fast-xml-parser --sync\n"
  },
  {
    "path": "projects/fast-xml-parser/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst XMLParser = require('./src/xmlparser/XMLParser');\nconst XMLBuilder = require('./src/xmlbuilder/json2xml');\nconst XMLValidator = require('./src/fxp').XMLValidator;\n\nmodule.exports.fuzz = function(data) {\n  try {\n    const provider = new FuzzedDataProvider(data);\n    const xmlString = provider.consumeString(1024);\n    const parser = new XMLParser();\n    let jObj = parser.parse(xmlString);\n    let builder = new XMLBuilder();\n    const xmlContent = builder.build(jObj);\n\n    XMLValidator.validate(xmlContent, {\n      allowBooleanAttributes: true,\n    });\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = ['Cannot read properties', 'is not closed', 'Invalid Tag'];\n\n"
  },
  {
    "path": "projects/fast-xml-parser/project.yaml",
    "content": "homepage: https://naturalintelligence.github.io/fast-xml-parser/\nlanguage: javascript\nmain_repo: https://github.com/NaturalIntelligence/fast-xml-parser\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/fast_float/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://github.com/fastfloat/fast_float.git fast_float\nWORKDIR fast_float\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/fast_float/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build fuzzers\nsh ./fuzz/build.sh\n"
  },
  {
    "path": "projects/fast_float/project.yaml",
    "content": "homepage: \"https://github.com/fastfloat/fast_float\"\nlanguage: c++\nprimary_contact: \"lemire@gmail.com\"\nauto_ccs:\n  - \"nathaniel.brough@gmail.com\"\nmain_repo: \"https://github.com/fastfloat/fast_float.git\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/fast_float/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake test -j$(nproc)\n"
  },
  {
    "path": "projects/fastcsv/CsvReaderFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStreamReader;\nimport java.nio.charset.StandardCharsets;\n\nimport de.siegmar.fastcsv.reader.CsvReader;\nimport de.siegmar.fastcsv.reader.CsvParseException;\n\npublic class CsvReaderFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    try {\n      CsvReader.builder()\n        .ofCsvRecord(new InputStreamReader(new ByteArrayInputStream(input), StandardCharsets.UTF_8))\n        .stream()\n        .toList();\n    } catch (CsvParseException e) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/fastcsv/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/csv.dict $SRC/csv.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/CSVParserFuzzer_seed_corpus.zip go-fuzz-corpus/csv/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/osiegmar/FastCSV.git fastcsv\n\nWORKDIR fastcsv\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\n"
  },
  {
    "path": "projects/fastcsv/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\n./gradlew --console=plain lib:jar\ncp lib/build/libs/fastcsv-*.jar $OUT/fastcsv.jar\n\nALL_JARS=\"fastcsv.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/fastcsv/project.yaml",
    "content": "homepage: \"https://github.com/osiegmar/FastCSV\"\nlanguage: jvm\nprimary_contact: \"oliver@siegmar.de\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/osiegmar/FastCSV.git\"\n"
  },
  {
    "path": "projects/fasthttp/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/valyala/fasthttp\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/fasthttp\n"
  },
  {
    "path": "projects/fasthttp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nrm lbclient_example_test.go\nrm client_example_test.go\nrm requestctx_setbodystreamwriter_example_test.go\nrm fs_handler_example_test.go\nrm server_example_test.go\nrm fs_example_test.go\ncompile_native_go_fuzzer_v2 github.com/valyala/fasthttp FuzzCookieParse fuzzCookieParse\ncompile_native_go_fuzzer_v2 github.com/valyala/fasthttp FuzzVisitHeaderParams fuzzVisitHeaderParams\ncompile_native_go_fuzzer_v2 github.com/valyala/fasthttp FuzzResponseReadLimitBody fuzzResponseReadLimitBody\ncompile_native_go_fuzzer_v2 github.com/valyala/fasthttp FuzzRequestReadLimitBody fuzzRequestReadLimitBody\ncompile_native_go_fuzzer_v2 github.com/valyala/fasthttp FuzzURIUpdateBytes fuzzURIUpdateBytes\ncompile_native_go_fuzzer_v2 github.com/valyala/fasthttp FuzzURIParse fuzzURIParse\ncompile_native_go_fuzzer_v2 github.com/valyala/fasthttp FuzzTestHeaderScanner fuzzTestHeaderScanner\n"
  },
  {
    "path": "projects/fasthttp/project.yaml",
    "content": "homepage: \"https://github.com/valyala/fasthttp\"\nprimary_contact: \"erik@dubbelboer.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/valyala/fasthttp'\n"
  },
  {
    "path": "projects/fastify/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN npm install -g n && n 19.2\n\nRUN git clone --depth 1 https://github.com/fastify/fastify fastify\nRUN git clone --depth 1 https://github.com/fastify/fast-json-stringify fast-json-stringify\nRUN git clone --depth 1 https://github.com/fastify/secure-json-parse secure-json-parse \nRUN git clone --depth 1 https://github.com/fastify/fastify-jwt fastify-jwt\nRUN git clone --depth 1 https://github.com/fastify/fastify-response-validation fastify-response-validation\nRUN git clone --depth 1 https://github.com/fastify/fastify-auth fastify-auth\nRUN git clone --depth 1 https://github.com/fastify/fast-content-type-parse fast-content-type-parse\nRUN git clone --depth 1 https://github.com/fastify/fastify-basic-auth fastify-basic-auth\nRUN git clone --depth 1 https://github.com/fastify/fastify-bearer-auth fastify-bearer-auth\nRUN git clone --depth 1 http://github.com/fastify/fastify-plugin fastify-plugin\nRUN git clone --depth 1 http://github.com/fastify/fastify-cookie fastify-cookie\nRUN git clone --depth 1 http://github.com/fastify/fastify-cors fastify-cors\nRUN git clone --depth 1 http://github.com/fastify/fastify-secure-session fastify-secure-session\n\nRUN git clone --depth 1 https://github.com/AdaLogics/ada-fuzzers fuzzers\n\nWORKDIR $SRC/fastify\n"
  },
  {
    "path": "projects/fastify/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncp $SRC/fuzzers/projects/fastify/*.js $SRC/fastify\n$SRC/fuzzers/projects/fastify/build.sh\n"
  },
  {
    "path": "projects/fastify/project.yaml",
    "content": "homepage: https://www.fastify.dev\nlanguage: javascript\nmain_repo: https://github.com/fastify/fastify\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nprimary_contact: \"matteo.collina@gmail.com\"\nauto_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/fastjson/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/valyala/fastjson\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/fastjson\n"
  },
  {
    "path": "projects/fastjson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncompile_go_fuzzer github.com/valyala/fastjson Fuzz fuzz\n"
  },
  {
    "path": "projects/fastjson/project.yaml",
    "content": "homepage: \"https://github.com/valyala/fastjson\"\nprimary_contact: \"valyala@gmail.com\"\nauto_ccs :\n- \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/valyala/fastjson'\n"
  },
  {
    "path": "projects/fastjson2/Dockerfile",
    "content": "\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\nRUN apt-get update && apt-get install -y maven\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cat fuzzing/dictionaries/json.dict > $SRC/JsonFuzzer.dict\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/JsonFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/*\n\nRUN git clone --depth 1 https://github.com/alibaba/fastjson2\n\nCOPY build.sh $SRC/\nCOPY JsonFuzzer.java $SRC/\nWORKDIR $SRC/fastjson2\n"
  },
  {
    "path": "projects/fastjson2/JsonFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.alibaba.fastjson2.JSON;\nimport com.alibaba.fastjson2.JSONException;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic class JsonFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      JSON.parse(data.consumeRemainingAsString());\n    } catch (JSONException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/fastjson2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Copy seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\nmvn package -Dmaven.test.skip=true -Djdk.version=15\nCURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"core/target/fastjson2-$CURRENT_VERSION.jar\" $OUT/fastjson2.jar\n\nPROJECT_JARS=\"fastjson2.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/fastjson2/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/alibaba/fastjson2\"\nlanguage: jvm\nprimary_contact: \"shaojin.wensj@alibaba-inc.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/alibaba/fastjson2\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/feign/BodyTemplateFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport feign.template.BodyTemplate;\nimport java.util.regex.Pattern;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [feign.template.BodyTemplate] public static feign.template.BodyTemplate create(java.lang.String)\npublic class BodyTemplateFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      BodyTemplate.create(Pattern.quote(data.consumeRemainingAsString()));\n    } catch (IllegalArgumentException e1) {}\n  }\n}\n"
  },
  {
    "path": "projects/feign/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN curl -L https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_linux-x64_bin.tar.gz -o jdk.tar.gz && \\\n    tar zxf jdk.tar.gz && \\\n    rm -rf jdk.tar.gz\nENV MVN=\"$SRC/maven/apache-maven-3.9.2/bin/mvn\"\nENV JAVA_HOME=\"$SRC/jdk-21.0.2\"\nRUN git clone --depth 1 https://github.com/openfeign/feign feign\nCOPY *.sh *.java *.xml $SRC/\nWORKDIR $SRC/feign\n# Ensure the ~/.m2 directory exists and copy toolchains.xml there\nRUN mkdir -p ~/.m2 && cp $SRC/toolchains.xml ~/.m2/toolchains.xml\n# Use the Maven settings file to resolve dependencies\nRUN $MVN --settings $SRC/settings.xml clean package -Dmaven.javadoc.skip=true \\\n        -DskipTests=true -Dpmd.skip=true -Dencoding=UTF-8 \\\n        -Dmaven.antrun.skip=true -Dcheckstyle.skip=true -Denforcer.fail=false \\\n        dependency:copy-dependencies\n"
  },
  {
    "path": "projects/feign/UriUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport feign.template.UriUtils;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [feign.template.UriUtils] public static java.lang.String\n// encode(java.lang.String,boolean)\npublic class UriUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Boolean value = data.consumeBoolean();\n    UriUtils.encode(data.consumeRemainingAsString(), value);\n  }\n}\n"
  },
  {
    "path": "projects/feign/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n# Ensure directories exist\n\nif [[ ! -d ~/.m2 ]]; then\n  mkdir ~/.m2\nfi\n\ncp $SRC/toolchains.xml ~/.m2/toolchains.xml\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false dependency:copy-dependencies\n\nJARFILE_LIST=\nfor JARFILE in $(find ./  -name *.jar)\ndo\n  if [[ \"$JARFILE\" == *\"target/\"* ]] || [[ \"$JARFILE\" == *\"build/\"* ]]\n  then\n    if [[ \"$JARFILE\" != *sources.jar ]] && [[ \"$JARFILE\" != *javadoc.jar ]] && [[ \"$JARFILE\" != *tests.jar ]]\n    then\n      cp $JARFILE $OUT/\n      JARFILE_LIST=\"$JARFILE_LIST$(basename $JARFILE) \"\n    fi\n  fi\ndone\n\ncurr_dir=$(pwd)\nrm -rf $OUT/jar_temp\nmkdir $OUT/jar_temp\ncd $OUT/jar_temp\nfor JARFILE in $JARFILE_LIST\ndo\n  jar -xf $OUT/$JARFILE\ndone\ncd $curr_dir\n\nBUILD_CLASSPATH=$JAZZER_API_PATH:$OUT/jar_temp\nRUNTIME_CLASSPATH=\\$this_dir/jar_temp:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \"\\$0\")\nif [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\nthen\nmem_settings='-Xmx1900m:-Xss900k'\nelse\nmem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir         \\\n  \\$this_dir/jazzer_driver                                \\\n  --agent_path=\\$this_dir/jazzer_agent_deploy.jar         \\\n  --cp=$RUNTIME_CLASSPATH                                 \\\n  --target_class=$fuzzer_basename                         \\\n  --jvm_args=\"\\$mem_settings\"                             \\\n  \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/feign/project.yaml",
    "content": "homepage: https://github.com/openfeign/feign\nmain_repo: https://github.com/openfeign/feign\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/feign/settings.xml",
    "content": "<settings xmlns=\"http://maven.apache.org/POM/4.0.0\"\n          xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n          xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0\n                              http://maven.apache.org/xsd/settings-1.0.0.xsd\">\n  <profiles>\n    <profile>\n      <id>snapshots</id>\n      <repositories>\n        <repository>\n          <id>ossrh</id>\n          <url>https://oss.sonatype.org/content/repositories/snapshots</url>\n          <snapshots>\n            <enabled>true</enabled>\n          </snapshots>\n        </repository>\n      </repositories>\n    </profile>\n  </profiles>\n  <activeProfiles>\n    <activeProfile>snapshots</activeProfile>\n  </activeProfiles>\n</settings>"
  },
  {
    "path": "projects/feign/toolchains.xml",
    "content": "<toolchains><toolchain><type>jdk</type>\n    <provides><version>1.8</version></provides>\n\t<configuration><jdkHome>${env.JAVA_HOME}</jdkHome></configuration></toolchain>\n\t<toolchain><type>jdk</type><provides><version>11</version></provides>\n\t<configuration><jdkHome>${env.JAVA_HOME}</jdkHome></configuration></toolchain>\n\t<toolchain><type>jdk</type><provides><version>14</version></provides>\n\t<configuration><jdkHome>${env.JAVA_HOME}</jdkHome></configuration></toolchain>\n\t<toolchain><type>jdk</type><provides><version>15</version></provides>\n\t<configuration><jdkHome>${env.JAVA_HOME}</jdkHome></configuration></toolchain>\n\t<toolchain><type>jdk</type><provides><version>17</version></provides>\n\t<configuration><jdkHome>${env.JAVA_HOME}</jdkHome></configuration></toolchain>\n\t<toolchain><type>jdk</type><provides><version>21</version></provides>\n\t<configuration><jdkHome>${env.JAVA_HOME}</jdkHome></configuration></toolchain>\n</toolchains>\n"
  },
  {
    "path": "projects/ffmpeg/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y nasm pkg-config rsync libtool gperf\nRUN curl -LO https://mirrors.kernel.org/ubuntu/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\n    apt install ./automake_1.16.5-1.3_all.deb\nRUN curl -LO https://mirrors.kernel.org/ubuntu/pool/main/a/autoconf/autoconf_2.72-3.1ubuntu1_all.deb && \\\n    apt install ./autoconf_2.72-3.1ubuntu1_all.deb\n# Meson is pinned to get around https://github.com/mesonbuild/meson/issues/14533\nRUN python3 -m pip install --upgrade pip && python3 -m pip install -U meson==1.7.2 ninja\n\nRUN git clone --depth 1 https://github.com/FFmpeg/FFmpeg ffmpeg\n\nRUN curl -O https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.12.tar.bz2\nRUN git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git\nRUN git clone --depth 1 https://gitlab.freedesktop.org/fontconfig/fontconfig.git\nRUN git clone --depth 1 https://gitlab.freedesktop.org/freetype/freetype.git\nRUN git clone --depth 1 https://github.com/fribidi/fribidi\nRUN git clone --depth 1 https://github.com/harfbuzz/harfbuzz\nRUN git clone --depth 1 https://github.com/libass/libass\nRUN git clone --depth 1 https://github.com/madler/zlib\nRUN git clone --depth 1 https://gitlab.com/federicomenaquintero/bzip2\nRUN git clone --depth 1 https://chromium.googlesource.com/webm/libvpx\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/ogg.git\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/opus.git\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/theora.git\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/vorbis.git\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git\n\nCOPY build.sh replay_build.sh run_tests.sh group_seed_corpus.py name_mappings.py $SRC/\n"
  },
  {
    "path": "projects/ffmpeg/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable UBSan vptr since several targets built with -fno-rtti.\nexport CFLAGS=\"$CFLAGS -fno-sanitize=vptr\"\nexport CXXFLAGS=\"$CXXFLAGS -fno-sanitize=vptr\"\n\nif [[ \"$CXXFLAGS\" == *\"-fsanitize=address\"* ]]; then\n    export CXXFLAGS=\"$CXXFLAGS -fno-sanitize-address-use-odr-indicator\"\nfi\n\nif [[ \"$CFLAGS\" == *\"-fsanitize=address\"* ]]; then\n    export CFLAGS=\"$CFLAGS -fno-sanitize-address-use-odr-indicator\"\nfi\n\nif [[ \"$ARCHITECTURE\" == i386 ]]; then\n  export CFLAGS=\"$CFLAGS -m32\"\n  export CXXFLAGS=\"$CXXFLAGS -m32\"\nfi\n\n# Build dependencies.\nexport FFMPEG_DEPS_PATH=$SRC/ffmpeg_deps\nmkdir -p $FFMPEG_DEPS_PATH\n\n\nif [[ \"$ARCHITECTURE\" == i386 ]]; then\n  LIBDIR='lib/i386-linux-gnu'\n  export PKG_CONFIG_PATH=\"$FFMPEG_DEPS_PATH/$LIBDIR/pkgconfig:$FFMPEG_DEPS_PATH/lib/pkgconfig\"\nelse\n  LIBDIR='lib/x86_64-linux-gnu'\n  export PKG_CONFIG_PATH=\"$FFMPEG_DEPS_PATH/$LIBDIR/pkgconfig:$FFMPEG_DEPS_PATH/lib/pkgconfig\"\nfi\n\n# The option `-fuse-ld=gold` can't be passed via `CFLAGS` or `CXXFLAGS` because\n# Meson injects `-Werror=ignored-optimization-argument` during compile tests.\n# Remove the `-fuse-ld=` and let Meson handle it.\n# https://github.com/mesonbuild/meson/issues/6377#issuecomment-575977919\nexport MESON_CFLAGS=\"$CFLAGS\"\nif [[ \"$CFLAGS\" == *\"-fuse-ld=gold\"* ]]; then\n    export MESON_CFLAGS=\"${CFLAGS//-fuse-ld=gold/}\"\n    export CC_LD=gold\nfi\nexport MESON_CXXFLAGS=\"$CXXFLAGS\"\nif [[ \"$CXXFLAGS\" == *\"-fuse-ld=gold\"* ]]; then\n    export MESON_CXXFLAGS=\"${CXXFLAGS//-fuse-ld=gold/}\"\n    export CXX_LD=gold\nfi\n\nmeson_install() {\n  cd $SRC/$1\n  CFLAGS=\"$MESON_CFLAGS\" CXXFLAGS=\"$MESON_CXXFLAGS\" \\\n  meson setup build -Dprefix=\"$FFMPEG_DEPS_PATH\" -Ddefault_library=static -Dprefer_static=true \\\n                    --wrap-mode=nofallback --libdir \"$LIBDIR\" ${2:-}\n  meson install -C build\n}\n\nmeson_install bzip2\n\ncd $SRC/zlib\n./configure --prefix=\"$FFMPEG_DEPS_PATH\" --enable-static --disable-shared\nmake -j$(nproc) install\n\ncd $SRC/libxml2\n./autogen.sh --prefix=\"$FFMPEG_DEPS_PATH\" --enable-static \\\n      --without-debug --without-ftp --without-http \\\n      --without-legacy --without-python\nmake -j$(nproc) install\nmeson_install freetype \"-Dharfbuzz=disabled\"\nmeson_install fribidi \"-Ddocs=false -Dtests=false\"\nmeson_install harfbuzz \"-Ddocs=disabled -Dtests=disabled\"\nmeson_install fontconfig \"-Dtests=disabled -Dtools=disabled\"\n\ncd $SRC/libass\n./autogen.sh\n./configure --prefix=\"$FFMPEG_DEPS_PATH\" --enable-static --disable-shared --disable-asm\nmake -j$(nproc) install\n\ncd $SRC\nbzip2 -f -d alsa-lib-*\ntar xf alsa-lib-*\nrm alsa-lib-*.tar\ncd alsa-lib-*\n./configure --prefix=\"$FFMPEG_DEPS_PATH\" --enable-static --disable-shared\nmake -j$(nproc) install\n\ncd $SRC/fdk-aac\nautoreconf -fiv\nCXXFLAGS=\"$CXXFLAGS -fno-sanitize=shift-base,signed-integer-overflow\" \\\n./configure --prefix=\"$FFMPEG_DEPS_PATH\" --disable-shared\nmake -j$(nproc) install\n\ncd $SRC/libvpx\nif [[ \"$SANITIZER\" == \"memory\" ]] || [[ \"$FUZZING_ENGINE\" == \"centipede\" ]]; then\n      LIBVPX_BUILD_ARGS=\"--disable-x86-asm\"\nelif [[ \"$ARCHITECTURE\" == i386 ]]; then\n      LIBVPX_BUILD_ARGS=\"--target=x86-linux-gcc\"\nelse\n      LIBVPX_BUILD_ARGS=\"\"\nfi\n\nLDFLAGS=\"$CXXFLAGS\" ./configure --prefix=\"$FFMPEG_DEPS_PATH\" \\\n        --disable-docs --disable-examples --disable-tools --disable-unit-tests \\\n        --enable-vp9-highbitdepth \\\n        --size-limit=12288x12288 \\\n        --extra-cflags=\"-DVPX_MAX_ALLOCABLE_MEMORY=1073741824\" \\\n        $LIBVPX_BUILD_ARGS\n\nmake -j$(nproc) install\n\ncd $SRC/ogg\n./autogen.sh\n./configure --prefix=\"$FFMPEG_DEPS_PATH\" --enable-static --disable-crc\nmake -j$(nproc) install\n\ncd $SRC/opus\n./autogen.sh\n./configure --prefix=\"$FFMPEG_DEPS_PATH\" --enable-static\nmake -j$(nproc) install\n\ncd $SRC/theora\nif [[ \"$ARCHITECTURE\" == i386 ]]; then\n\n      THEORA_BUILD_ARGS='--disable-asm'\nelse\n      THEORA_BUILD_ARGS=''\nfi\n# theora requires ogg, need to pass its location to the \"configure\" script.\nCFLAGS=\"$CFLAGS -fPIC\" LDFLAGS=\"-L$FFMPEG_DEPS_PATH/lib/\" \\\n      CPPFLAGS=\"$CXXFLAGS -I$FFMPEG_DEPS_PATH/include/\" \\\n      LD_LIBRARY_PATH=\"$FFMPEG_DEPS_PATH/lib/\" \\\n      ./autogen.sh\n./configure --with-ogg=\"$FFMPEG_DEPS_PATH\" --prefix=\"$FFMPEG_DEPS_PATH\" \\\n      --enable-static --disable-examples $THEORA_BUILD_ARGS\nmake -j$(nproc) install\n\ncd $SRC/vorbis\n./autogen.sh\n./configure --prefix=\"$FFMPEG_DEPS_PATH\" --enable-static\nmake -j$(nproc) install\n\n# Remove shared libraries to avoid accidental linking against them.\nrm $FFMPEG_DEPS_PATH/lib/*.so\nrm $FFMPEG_DEPS_PATH/lib/*.so.*\n\n# Build ffmpeg.\ncd $SRC/ffmpeg\nif [[ \"$ARCHITECTURE\" == i386 ]]; then\n\n      FFMPEG_BUILD_ARGS='--arch=\"i386\" --cpu=\"i386\" --disable-inline-asm --disable-asm'\nelse\n      FFMPEG_BUILD_ARGS='--disable-asm'\nfi\n\nif [ \"$SANITIZER\" = \"memory\" ] || [ \"$FUZZING_ENGINE\" = \"centipede\" ]; then\n  FFMPEG_BUILD_ARGS=\"$FFMPEG_BUILD_ARGS --disable-asm\"\nfi\n\n./configure \\\n        --cc=$CC --cxx=$CXX --ld=\"$CXX $CXXFLAGS -std=c++11\" \\\n        --extra-cflags=\"-I$FFMPEG_DEPS_PATH/include\" \\\n        --extra-ldflags=\"-L$FFMPEG_DEPS_PATH/lib\" \\\n        --prefix=\"$FFMPEG_DEPS_PATH\" \\\n        --pkg-config-flags=\"--static\" \\\n        --enable-ossfuzz \\\n        --libfuzzer=$LIB_FUZZING_ENGINE \\\n        --optflags=-O1 \\\n        --enable-gpl \\\n        --enable-nonfree \\\n        --enable-libass \\\n        --enable-libfdk-aac \\\n        --enable-libfreetype \\\n        --enable-libopus \\\n        --enable-libtheora \\\n        --enable-libvorbis \\\n        --enable-libvpx \\\n        --enable-libxml2 \\\n        --enable-nonfree \\\n        --disable-libdrm \\\n        --disable-muxers \\\n        --disable-protocols \\\n        --disable-demuxer=rtp,rtsp,sdp \\\n        --disable-devices \\\n        --disable-shared \\\n        --disable-doc \\\n        --disable-programs \\\n        --enable-demuxers \\\n        --samples=fate-suite/ \\\n        $FFMPEG_BUILD_ARGS\n\n# Download test samples, will be used as seed corpus.\n# DISABLED.\n# TODO: implement a better way to maintain a minimized seed corpora\n# for all targets. As of 2017-05-04 now the combined size of corpora\n# is too big for ClusterFuzz (over 10Gb compressed data).\nexport TEST_SAMPLES_PATH=$SRC/ffmpeg/fate-suite/\nmake fate-rsync SAMPLES=$TEST_SAMPLES_PATH\n\nif [[ -n ${CAPTURE_REPLAY_SCRIPT-} ]]; then\n  exit 0\nfi\n\nrsync -av rsync://samples.ffmpeg.org/samples/avi/ffv1/testset/ $SRC/ffmpeg/ffv1testset\n\n# Build the fuzzers.\ncd $SRC/ffmpeg\n\nFUZZ_TARGET_SOURCE=$SRC/ffmpeg/tools/target_dec_fuzzer.c\n\nexport TEMP_VAR_CODEC=\"AV_CODEC_ID_H264\"\nexport TEMP_VAR_CODEC_TYPE=\"VIDEO\"\n\ndeclare -a BSF_TARGETS=()\ndeclare -a BSF_FUZZER_NAMES=()\ndeclare -a DECODER_TARGETS=()\ndeclare -a DECODER_FUZZER_NAMES=()\ndeclare -a ENCODER_TARGETS=()\ndeclare -a ENCODER_FUZZER_NAMES=()\n\n# Collect bitstream filters targets\nCONDITIONALS=$(grep 'BSF 1$' config_components.h | sed 's/#define CONFIG_\\(.*\\)_BSF 1/\\1/')\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n      # When running in CI, check the first targets only to save time and disk space\n      CONDITIONALS=(${CONDITIONALS[@]:0:2})\nfi\nfor c in $CONDITIONALS; do\n      fuzzer_name=$($SRC/name_mappings.py binary_name bsf ${c})\n      symbol=$(echo $c | sed \"s/.*/\\L\\0/\")\n      BSF_TARGETS+=(\"tools/target_bsf_${symbol}_fuzzer\")\n      BSF_FUZZER_NAMES+=(\"${fuzzer_name}\")\ndone\n\n# Collect decoder targets\nCONDITIONALS=$(grep 'DECODER 1$' config_components.h | sed 's/#define CONFIG_\\(.*\\)_DECODER 1/\\1/')\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n      # When running in CI, check the first targets only to save time and disk space\n      CONDITIONALS=(${CONDITIONALS[@]:0:2})\nfi\nfor c in $CONDITIONALS; do\n      fuzzer_name=$($SRC/name_mappings.py binary_name decoder ${c})\n      symbol=$(echo $c | sed \"s/.*/\\L\\0/\")\n      DECODER_TARGETS+=(\"tools/target_dec_${symbol}_fuzzer\")\n      DECODER_FUZZER_NAMES+=(\"${fuzzer_name}\")\ndone\n\n# Collect encoder targets\nCONDITIONALS=$(grep 'ENCODER 1$' config_components.h | sed 's/#define CONFIG_\\(.*\\)_ENCODER 1/\\1/')\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n      # When running in CI, check the first targets only to save time and disk space\n      CONDITIONALS=(${CONDITIONALS[@]:0:2})\nfi\nfor c in $CONDITIONALS; do\n      fuzzer_name=$($SRC/name_mappings.py binary_name encoder ${c})\n      symbol=$(echo $c | sed \"s/.*/\\L\\0/\")\n      ENCODER_TARGETS+=(\"tools/target_enc_${symbol}_fuzzer\")\n      ENCODER_FUZZER_NAMES+=(\"${fuzzer_name}\")\ndone\n\nOTHER_TARGETS=(\"tools/target_sws_fuzzer\" \"tools/target_swr_fuzzer\" \"tools/target_dem_fuzzer\" \"tools/target_io_dem_fuzzer\")\nALL_TARGETS=(\"${BSF_TARGETS[@]}\" \"${DECODER_TARGETS[@]}\" \"${ENCODER_TARGETS[@]}\" \"${OTHER_TARGETS[@]}\")\nif [ ${#ALL_TARGETS[@]} -eq 0 ]; then\n      echo \"ERROR: No targets found to build!\" >&2\n      exit 1\nfi\nmake -j$(nproc) \"${ALL_TARGETS[@]}\"\n\nfor i in \"${!BSF_TARGETS[@]}\"; do\n      echo -en \"[libfuzzer]\\nmax_len = 1000000\\n\" >$OUT/${BSF_FUZZER_NAMES[$i]}.options\n      mv ${BSF_TARGETS[$i]} $OUT/${BSF_FUZZER_NAMES[$i]}\ndone\n\nfor i in \"${!DECODER_TARGETS[@]}\"; do\n      echo -en \"[libfuzzer]\\nmax_len = 1000000\\n\" >$OUT/${DECODER_FUZZER_NAMES[$i]}.options\n      mv ${DECODER_TARGETS[$i]} $OUT/${DECODER_FUZZER_NAMES[$i]}\ndone\n\nfor i in \"${!ENCODER_TARGETS[@]}\"; do\n      echo -en \"[libfuzzer]\\nmax_len = 1000000\\n\" >$OUT/${ENCODER_FUZZER_NAMES[$i]}.options\n      mv ${ENCODER_TARGETS[$i]} $OUT/${ENCODER_FUZZER_NAMES[$i]}\ndone\n\n# Move fuzzer for sws\nfuzzer_name=$($SRC/name_mappings.py binary_name other SWS)\necho -en \"[libfuzzer]\\nmax_len = 1000000\\n\" >$OUT/${fuzzer_name}.options\nmv tools/target_sws_fuzzer $OUT/${fuzzer_name}\n\n# Move fuzzer for swr\nfuzzer_name=$($SRC/name_mappings.py binary_name other SWR)\necho -en \"[libfuzzer]\\nmax_len = 1000000\\n\" >$OUT/${fuzzer_name}.options\nmv tools/target_swr_fuzzer $OUT/${fuzzer_name}\n\n# Move fuzzer for demuxer\nfuzzer_name=$($SRC/name_mappings.py binary_name other DEM)\necho -en \"[libfuzzer]\\nmax_len = 1000000\\n\" >$OUT/${fuzzer_name}.options\nmv tools/target_dem_fuzzer $OUT/${fuzzer_name}\n\n# We do not need raw reference files for the muxer\nrm $(find fate-suite -name '*.s16')\nrm $(find fate-suite -name '*.dec')\nrm $(find fate-suite -name '*.pcm')\n\nzip -r $OUT/${fuzzer_name}_seed_corpus.zip fate-suite\nzip -r $OUT/ffmpeg_AV_CODEC_ID_HEVC_fuzzer_seed_corpus.zip fate-suite/hevc fate-suite/hevc-conformance\nzip -r $OUT/ffmpeg_AV_CODEC_ID_FFV1_fuzzer_seed_corpus.zip ffv1testset\n\n# Build fuzzer for demuxer fed at IO level\nfuzzer_name=$($SRC/name_mappings.py binary_name other IO_DEM)\nmv tools/target_io_dem_fuzzer $OUT/${fuzzer_name}\n\n# Clean before reconfiguring for demuxers\nmake distclean\n\n# Reduce size of demuxer fuzzers by disabling various components.\n./configure \\\n        --cc=$CC --cxx=$CXX --ld=\"$CXX $CXXFLAGS -std=c++11\" \\\n        --extra-cflags=\"-I$FFMPEG_DEPS_PATH/include\" \\\n        --extra-ldflags=\"-L$FFMPEG_DEPS_PATH/lib\" \\\n        --prefix=\"$FFMPEG_DEPS_PATH\" \\\n        --pkg-config-flags=\"--static\" \\\n        --enable-ossfuzz \\\n        --libfuzzer=$LIB_FUZZING_ENGINE \\\n        --optflags=-O1 \\\n        --enable-gpl \\\n        --enable-libxml2 \\\n        --disable-libdrm \\\n        --disable-muxers \\\n        --disable-protocols \\\n        --disable-devices \\\n        --disable-shared \\\n        --disable-encoders \\\n        --disable-filters \\\n        --disable-muxers \\\n        --disable-parsers \\\n        --disable-decoders \\\n        --disable-hwaccels \\\n        --disable-bsfs \\\n        --disable-vaapi \\\n        --disable-vdpau \\\n        --disable-v4l2_m2m \\\n        --disable-cuda_llvm \\\n        --enable-demuxers \\\n        --disable-demuxer=rtp,rtsp,sdp \\\n        --disable-doc \\\n        --disable-programs \\\n        $FFMPEG_BUILD_ARGS\n\ndeclare -a DEMUXER_TARGETS=()\ndeclare -a DEMUXER_FUZZER_NAMES=()\n\nCONDITIONALS=$(grep 'DEMUXER 1$' config_components.h | sed 's/#define CONFIG_\\(.*\\)_DEMUXER 1/\\1/')\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n      # When running in CI, check the first targets only to save time and disk space\n      CONDITIONALS=(${CONDITIONALS[@]:0:2})\nfi\n\nfor c in $CONDITIONALS; do\n      fuzzer_name=$($SRC/name_mappings.py binary_name demuxer ${c})\n      symbol=$(echo $c | sed \"s/.*/\\L\\0/\")\n      DEMUXER_TARGETS+=(\"tools/target_dem_${symbol}_fuzzer\")\n      DEMUXER_FUZZER_NAMES+=(\"${fuzzer_name}\")\ndone\n\nif [ ${#DEMUXER_TARGETS[@]} -eq 0 ]; then\n      echo \"ERROR: No demuxer targets found to build!\" >&2\n      exit 1\nfi\nmake -j$(nproc) \"${DEMUXER_TARGETS[@]}\"\n\nfor i in \"${!DEMUXER_TARGETS[@]}\"; do\n      mv ${DEMUXER_TARGETS[$i]} $OUT/${DEMUXER_FUZZER_NAMES[$i]}\ndone\n\n# Find relevant corpus in test samples and archive them for every fuzzer.\n#cd $SRC\n#python group_seed_corpus.py $TEST_SAMPLES_PATH $OUT/\n"
  },
  {
    "path": "projects/ffmpeg/group_seed_corpus.py",
    "content": "#!/usr/bin/env python\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfrom __future__ import print_function\nimport logging\nimport os\nimport re\nimport sys\nimport zipfile\n\n\nlogging.basicConfig(level=logging.INFO, format='INFO: %(message)s')\nCODEC_NAME_REGEXP = re.compile(r'codec_id_(.+?)_fuzzer')\n\n\ndef get_fuzzer_tags(fuzzer_name):\n  \"\"\"Extract tags (are used to filter samples) from the given fuzzer name.\"\"\"\n  tags = []\n  fuzzer_name = fuzzer_name.lower()\n  # All subtitle samples are in 'sub' directory, need to add 'sub' tag manually.\n  if 'subtitle' in fuzzer_name:\n    tags.append('sub')\n  m = CODEC_NAME_REGEXP.search(fuzzer_name)\n  if m:\n    codec_name = m.group(1)\n    # Some names are complex, need to split them and filter common strings.\n    codec_name_parts = codec_name.split('_')\n    for codec in codec_name_parts:\n      # Remove common strings from codec names like 'mpeg1video' or 'msvideo1'.\n      codec = codec.split('video')[0]\n      codec = codec.split('audio')[0]\n      codec = codec.split('subtitle')[0]\n      codec = codec.split('text')[0]\n      if codec:\n        # Some codec names have trailing characters: 'VP6F','FLV1', 'JPEGLS'.\n        # Use only first 3 characters for long enough codec names.\n        if len(codec) > 3:\n          tags.append(codec[:3])\n        else:\n          tags.append(codec)\n\n  return tags\n\n\ndef parse_corpus(corpus_directory):\n  \"\"\"Recursively list all files in the given directory and ignore checksums.\"\"\"\n  all_corpus_files = []\n  for root, dirs, files in os.walk(corpus_directory):\n    for filename in files:\n      # Skip checksum files, they are useless in corpus.\n      if 'md5sum' in filename:\n        continue\n      path = os.path.join(root, filename)\n      all_corpus_files.append(path)\n\n  logging.info('Parsed %d corpus files from %s' % (len(all_corpus_files),\n                                                   corpus_directory))\n  return all_corpus_files\n\n\ndef parse_fuzzers(fuzzers_directory):\n  \"\"\"Recursively list all fuzzers in the given directory.\"\"\"\n  all_fuzzers = []\n  for filename in os.listdir(fuzzers_directory):\n    # Skip non-ffmpeg and non-fuzzer files in the given directory,\n    if not filename.startswith('ffmpeg_') or not filename.endswith('_fuzzer'):\n      continue\n    fuzzer_path = os.path.join(fuzzers_directory, filename)\n    all_fuzzers.append(fuzzer_path)\n\n  logging.info('Parsed %d fuzzers from %s' % (len(all_fuzzers),\n                                              fuzzers_directory))\n  return all_fuzzers\n \n\ndef zip_relevant_corpus(corpus_files, fuzzers):\n  \"\"\"Find relevant corpus files and archive them for every fuzzer given.\"\"\"\n  for fuzzer in fuzzers:\n    fuzzer_name = os.path.basename(fuzzer)\n    fuzzer_directory = os.path.dirname(fuzzer)\n    fuzzer_tags = get_fuzzer_tags(fuzzer_name)\n    relevant_corpus_files = set()\n    for filename in corpus_files:\n      # Remove 'ffmpeg' substring to do not use everything for 'MPEG' codec.\n      sanitized_filename = filename.replace('ffmpeg', '').lower()\n      for tag in fuzzer_tags:\n        if tag in sanitized_filename:\n          relevant_corpus_files.add(filename)\n\n      if not relevant_corpus_files:\n        # Strip last symbol from tags if we haven't found relevant corpus.\n        # It helps for such codecs as 'RV40' ('RV4' -> 'RV') or 'PCX' (-> 'PC').\n        for tag in fuzzer_tags:\n          if tag[:-1] in sanitized_filename:\n            relevant_corpus_files.add(filename)\n\n    logging.info(\n        'Found %d relevant samples for %s' % (len(relevant_corpus_files),\n                                              fuzzer_name))\n\n    if not relevant_corpus_files:\n      continue\n\n    zip_archive_name = fuzzer + \"_seed_corpus.zip\"\n    with zipfile.ZipFile(zip_archive_name, 'w') as archive:\n      for filename in relevant_corpus_files:\n        archive.write(filename)\n\n\ndef main():\n  if len(sys.argv) < 3:\n    print('Usage: %s <seed_corpus_directory> <fuzzers_directory>' % __file__)\n    sys.exit(1)\n\n  seed_corpus_directory = sys.argv[1]\n  fuzzers_directory = sys.argv[2]\n\n  corpus_files = parse_corpus(seed_corpus_directory)\n  fuzzers = parse_fuzzers(fuzzers_directory)\n  zip_relevant_corpus(corpus_files, fuzzers)\n\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "projects/ffmpeg/name_mappings.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script converts between OSS-Fuzz binary names and FFmpeg build targets.\n# Context: https://github.com/google/oss-fuzz/issues/13472\n\nimport argparse\nfrom enum import StrEnum, auto\n\n# List of \"legacy\" decoders where we need to keep the existing name the same\n# (ffmpeg_AV_CODEC_ID_<ID>_fuzzer).\n# This is to ensure we don't break bisections, and don't have to migrate open\n# testcases and corpora.\n#\n# Any new decoder fuzzer with an ID not in this list must have the format\n# ffmpeg_AV_CODEC_ID_<ID>_DEC_fuzzer.\n#\n# Any new encoder fuzzer with an ID in this list (e.g. a new encoder was added\n# where we previously only supported decoding) must have the format\n# ffmpeg_AV_CODEC_ID_<ID>_ENC_fuzzer.\nLEGACY_DECODERS = (\n    'AAC_FIXED',\n    'AAC_LATM',\n    'AASC',\n    'ACELP_KELVIN',\n    'ADPCM_4XM',\n    'ADPCM_AFC',\n    'ADPCM_AGM',\n    'ADPCM_AICA',\n    'ADPCM_CT',\n    'ADPCM_DTK',\n    'ADPCM_EA',\n    'ADPCM_EA_MAXIS_XA',\n    'ADPCM_EA_R1',\n    'ADPCM_EA_R2',\n    'ADPCM_EA_R3',\n    'ADPCM_EA_XAS',\n    'ADPCM_IMA_ACORN',\n    'ADPCM_IMA_APC',\n    'ADPCM_IMA_CUNNING',\n    'ADPCM_IMA_DAT4',\n    'ADPCM_IMA_DK3',\n    'ADPCM_IMA_DK4',\n    'ADPCM_IMA_EA_EACS',\n    'ADPCM_IMA_EA_SEAD',\n    'ADPCM_IMA_ISS',\n    'ADPCM_IMA_MOFLEX',\n    'ADPCM_IMA_MTF',\n    'ADPCM_IMA_OKI',\n    'ADPCM_IMA_RAD',\n    'ADPCM_IMA_SMJPEG',\n    'ADPCM_IMA_XBOX',\n    'ADPCM_MTAF',\n    'ADPCM_PSX',\n    'ADPCM_SBPRO_2',\n    'ADPCM_SBPRO_3',\n    'ADPCM_SBPRO_4',\n    'ADPCM_THP',\n    'ADPCM_THP_LE',\n    'ADPCM_VIMA',\n    'ADPCM_XA',\n    'ADPCM_XMD',\n    'ADPCM_ZORK',\n    'AGM',\n    'AIC',\n    'ALS',\n    'AMRNB',\n    'AMRWB',\n    'ANM',\n    'ANSI',\n    'APAC',\n    'APE',\n    'APV',\n    'ARBC',\n    'ARGO',\n    'ATRAC1',\n    'ATRAC3',\n    'ATRAC3AL',\n    'ATRAC3P',\n    'ATRAC3PAL',\n    'ATRAC9',\n    'AURA',\n    'AURA2',\n    'AV1',\n    'AVRN',\n    'AVS',\n    'BETHSOFTVID',\n    'BFI',\n    'BINK',\n    'BINKAUDIO_DCT',\n    'BINKAUDIO_RDFT',\n    'BINTEXT',\n    'BMV_AUDIO',\n    'BMV_VIDEO',\n    'BONK',\n    'BRENDER_PIX',\n    'C93',\n    'CAVS',\n    'CBD2_DPCM',\n    'CCAPTION',\n    'CDGRAPHICS',\n    'CDTOONS',\n    'CDXL',\n    'CLEARVIDEO',\n    'CLLC',\n    'COOK',\n    'CPIA',\n    'CRI',\n    'CSCD',\n    'CYUV',\n    'DDS',\n    'DERF_DPCM',\n    'DFA',\n    'DIRAC',\n    'DOLBY_E',\n    'DSD_LSBF',\n    'DSD_LSBF_PLANAR',\n    'DSD_MSBF',\n    'DSD_MSBF_PLANAR',\n    'DSICINAUDIO',\n    'DSICINVIDEO',\n    'DSS_SP',\n    'DST',\n    'DVAUDIO',\n    'DXA',\n    'DXTORY',\n    'EACMV',\n    'EAMAD',\n    'EATGQ',\n    'EATGV',\n    'EATQI',\n    'EIGHTBPS',\n    'EIGHTSVX_EXP',\n    'EIGHTSVX_FIB',\n    'ESCAPE124',\n    'ESCAPE130',\n    'EVRC',\n    'FASTAUDIO',\n    'FFWAVESYNTH',\n    'FIC',\n    'FLIC',\n    'FMVC',\n    'FOURXM',\n    'FRAPS',\n    'FRWU',\n    'FTR',\n    'G2M',\n    'G729',\n    'GDV',\n    'GEM',\n    'GREMLIN_DPCM',\n    'GSM',\n    'GSM_MS',\n    'H263I',\n    'H264',\n    'HAP',\n    'HCA',\n    'HCOM',\n    'HEVC',\n    'HNM4_VIDEO',\n    'HQX',\n    'HQ_HQA',\n    'HYMT',\n    'IAC',\n    'IDCIN',\n    'IDF',\n    'IFF_ILBM',\n    'ILBC',\n    'IMC',\n    'IMM4',\n    'IMM5',\n    'INDEO2',\n    'INDEO3',\n    'INDEO4',\n    'INDEO5',\n    'INTERPLAY_ACM',\n    'INTERPLAY_DPCM',\n    'INTERPLAY_VIDEO',\n    'IPU',\n    'JACOSUB',\n    'JV',\n    'KGV1',\n    'KMVC',\n    'LAGARITH',\n    'LEAD',\n    'LOCO',\n    'LSCR',\n    'M101',\n    'MACE3',\n    'MACE6',\n    'MDEC',\n    'MEDIA100',\n    'METASOUND',\n    'MICRODVD',\n    'MIMIC',\n    'MISC4',\n    'MJPEGB',\n    'MMVIDEO',\n    'MOBICLIP',\n    'MOTIONPIXELS',\n    'MP1',\n    'MP1FLOAT',\n    'MP2FLOAT',\n    'MP3',\n    'MP3ADU',\n    'MP3ADUFLOAT',\n    'MP3FLOAT',\n    'MP3ON4',\n    'MP3ON4FLOAT',\n    'MPC7',\n    'MPC8',\n    'MPEG1_V4L2M2M',\n    'MPEG2_V4L2M2M',\n    'MPEGVIDEO',\n    'MPL2',\n    'MSA1',\n    'MSCC',\n    'MSMPEG4V1',\n    'MSNSIREN',\n    'MSP2',\n    'MSS1',\n    'MSS2',\n    'MSZH',\n    'MTS2',\n    'MV30',\n    'MVC1',\n    'MVC2',\n    'MVDV',\n    'MVHA',\n    'MWSC',\n    'MXPEG',\n    'NOTCHLC',\n    'NUV',\n    'ON2AVC',\n    'OSQ',\n    'PAF_AUDIO',\n    'PAF_VIDEO',\n    'PCM_F16LE',\n    'PCM_F24LE',\n    'PCM_LXF',\n    'PCM_SGA',\n    'PDV',\n    'PGSSUB',\n    'PGX',\n    'PHOTOCD',\n    'PICTOR',\n    'PIXLET',\n    'PJS',\n    'PROSUMER',\n    'PSD',\n    'PTX',\n    'QCELP',\n    'QDM2',\n    'QDMC',\n    'QDRAW',\n    'QOA',\n    'QPEG',\n    'RALF',\n    'RASC',\n    'RA_288',\n    'REALTEXT',\n    'RKA',\n    'RL2',\n    'RSCC',\n    'RTV1',\n    'RV30',\n    'RV40',\n    'RV60',\n    'SAMI',\n    'SANM',\n    'SCPR',\n    'SCREENPRESSO',\n    'SDX2_DPCM',\n    'SGA',\n    'SGIRLE',\n    'SHEERVIDEO',\n    'SHORTEN',\n    'SIMBIOSIS_IMX',\n    'SIPR',\n    'SIREN',\n    'SMACKAUD',\n    'SMACKER',\n    'SMVJPEG',\n    'SOL_DPCM',\n    'SONIC',\n    'SP5X',\n    'SPEEX',\n    'SRGC',\n    'STL',\n    'SUBVIEWER',\n    'SUBVIEWER1',\n    'SVQ3',\n    'TAK',\n    'TARGA_Y216',\n    'TDSC',\n    'THEORA',\n    'THP',\n    'TIERTEXSEQVIDEO',\n    'TMV',\n    'TRUEMOTION1',\n    'TRUEMOTION2',\n    'TRUEMOTION2RT',\n    'TRUESPEECH',\n    'TSCC',\n    'TSCC2',\n    'TWINVQ',\n    'TXD',\n    'ULTI',\n    'V210X',\n    'VB',\n    'VBLE',\n    'VC1',\n    'VC1IMAGE',\n    'VC1_V4L2M2M',\n    'VCR1',\n    'VMDAUDIO',\n    'VMDVIDEO',\n    'VMIX',\n    'VMNC',\n    'VP3',\n    'VP4',\n    'VP5',\n    'VP6',\n    'VP6A',\n    'VP6F',\n    'VP7',\n    'VP8',\n    'VP9',\n    'VP9_V4L2M2M',\n    'VPLAYER',\n    'VQA',\n    'VQC',\n    'VVC',\n    'WADY_DPCM',\n    'WAVARC',\n    'WCMV',\n    'WEBP',\n    'WMALOSSLESS',\n    'WMAPRO',\n    'WMAVOICE',\n    'WMV3',\n    'WMV3IMAGE',\n    'WNV1',\n    'WS_SND1',\n    'XAN_DPCM',\n    'XAN_WC3',\n    'XAN_WC4',\n    'XBIN',\n    'XL',\n    'XMA1',\n    'XMA2',\n    'XPM',\n    'YLC',\n    'YOP',\n    'ZERO12V',\n    'ZEROCODEC',\n)\n\n\nclass IDType(StrEnum):\n  DECODER = auto()\n  ENCODER = auto()\n  DEMUXER = auto()\n  BSF = auto()\n  OTHER = auto()\n\n\ndef binary_name(type: IDType, id: str) -> str:\n  if type == IDType.OTHER:\n    id = id.upper().replace('DEM', 'DEMUXER')\n    return f'ffmpeg_{id}_fuzzer'\n\n  if type == IDType.DEMUXER:\n    id = id.upper()\n    return f'ffmpeg_dem_{id}_fuzzer'\n\n  if type == IDType.BSF:\n    id = id.upper()\n    return f'ffmpeg_BSF_{id}_fuzzer'\n\n  if id in LEGACY_DECODERS:\n    if type == IDType.DECODER:\n      return f'ffmpeg_AV_CODEC_ID_{id}_fuzzer'\n    if type == IDType.ENCODER:\n      # New encoder got added where there was previously only a decoder.\n      # Differentiate it.\n      return f'ffmpeg_AV_CODEC_ID_{id}_ENC_fuzzer'\n\n  if type == IDType.DECODER:\n    # New decoder. Differentiate it.\n    return f'ffmpeg_AV_CODEC_ID_{id}_DEC_fuzzer'\n\n  # By default, encoder fuzzers will map to this.\n  return f'ffmpeg_AV_CODEC_ID_{id}_fuzzer'\n\n\ndef build_target_name(binary_name: str) -> str:\n  name = binary_name.removeprefix('ffmpeg_').removesuffix('_fuzzer')\n  if name.startswith('AV_CODEC_ID_'):\n    name = name.removeprefix('AV_CODEC_ID_')\n\n    if name.endswith('_DEC') or name in LEGACY_DECODERS:\n      name = name.removesuffix('_DEC')\n      return f'target_dec_{name.lower()}_fuzzer'\n\n    name = name.removesuffix('_ENC')\n    return f'target_enc_{name.lower()}_fuzzer'\n\n  return f'target_{name.lower().replace(\"demuxer\", \"dem\")}_fuzzer'\n\n\ndef main():\n  parser = argparse.ArgumentParser(\n      description='FFmpeg fuzzer name mapping utility.')\n  subparsers = parser.add_subparsers(dest='command',\n                                     help='Available commands',\n                                     required=True)\n\n  binary_parser = subparsers.add_parser(\n      'binary_name', help='Generate binary name for a codec ID and type.')\n  binary_parser.add_argument(\n      'type',\n      type=IDType,\n      choices=list(IDType),\n      help='Type of ID (DECODER, ENCODER, DEMUXER, BSF, OTHER)')\n  binary_parser.add_argument('id', type=str, help='Codec ID (e.g., AAC_FIXED)')\n  binary_parser.set_defaults(\n      func=lambda args: print(binary_name(args.type, args.id)))\n\n  target_parser = subparsers.add_parser(\n      'build_target_name',\n      help='Generate build target name from a binary name.')\n  target_parser.add_argument(\n      'name',\n      type=str,\n      help='Binary name (e.g., ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer)')\n  target_parser.set_defaults(\n      func=lambda args: print(build_target_name(args.name)))\n\n  args = parser.parse_args()\n  args.func(args)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "projects/ffmpeg/project.yaml",
    "content": "homepage: \"https://www.ffmpeg.org\"\nlanguage: c++\nprimary_contact: \"ffmpeg-security@ffmpeg.org\"\narchitectures:\n - x86_64\n - i386\nauto_ccs:\n - \"michaelni@gmx.at\"\n - \"michael@niedermayer.cc\"\n - \"tfoucu@google.com\"\n - \"twsmith@mozilla.com\"\n - \"kempfjb@gmail.com\"\n - \"jordyzomer@google.com\"\n - \"epirat07@gmail.com\"\n - \"kasper93@gmail.com\"\n - \"jzern@google.com\"\nfuzzing_engines:\n - afl\n - honggfuzz\n - libfuzzer\nsanitizers:\n - address\n - memory\n - undefined\nselective_unpack: true\nmain_repo: 'https://github.com/FFmpeg/FFmpeg'\n"
  },
  {
    "path": "projects/ffmpeg/replay_build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable UBSan vptr since several targets built with -fno-rtti.\nexport CFLAGS=\"$CFLAGS -fno-sanitize=vptr\"\nexport CXXFLAGS=\"$CXXFLAGS -fno-sanitize=vptr\"\n\nif [[ \"$CXXFLAGS\" == *\"-fsanitize=address\"* ]]; then\n    export CXXFLAGS=\"$CXXFLAGS -fno-sanitize-address-use-odr-indicator\"\nfi\n\nif [[ \"$CFLAGS\" == *\"-fsanitize=address\"* ]]; then\n    export CFLAGS=\"$CFLAGS -fno-sanitize-address-use-odr-indicator\"\nfi\n\nif [[ \"$ARCHITECTURE\" == i386 ]]; then\n  export CFLAGS=\"$CFLAGS -m32\"\n  export CXXFLAGS=\"$CXXFLAGS -m32\"\nfi\n\n# The option `-fuse-ld=gold` can't be passed via `CFLAGS` or `CXXFLAGS` because\n# Meson injects `-Werror=ignored-optimization-argument` during compile tests.\n# Remove the `-fuse-ld=` and let Meson handle it.\n# https://github.com/mesonbuild/meson/issues/6377#issuecomment-575977919\nexport MESON_CFLAGS=\"$CFLAGS\"\nif [[ \"$CFLAGS\" == *\"-fuse-ld=gold\"* ]]; then\n    export MESON_CFLAGS=\"${CFLAGS//-fuse-ld=gold/}\"\n    export CC_LD=gold\nfi\nexport MESON_CXXFLAGS=\"$CXXFLAGS\"\nif [[ \"$CXXFLAGS\" == *\"-fuse-ld=gold\"* ]]; then\n    export MESON_CXXFLAGS=\"${CXXFLAGS//-fuse-ld=gold/}\"\n    export CXX_LD=gold\nfi\n\ncd $SRC/ffmpeg\nmake -j$(nproc) install\n\nif [ \"$#\" -lt 1 ]; then\n  exit 0\nfi\n\nmake_target=$($SRC/name_mappings.py build_target_name \"$1\")\n\nmake tools/${make_target}\nmv tools/${make_target} $OUT/$1"
  },
  {
    "path": "projects/ffmpeg/run_tests.sh",
    "content": "#!/bin/bash -e\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/ffmpeg\n\n# TODO: Since the h264dsp test is failing, we are using a patch to skip it\n# entirely. Although adding --ignore-tests=checkasm-h264dsp to ./configure is an\n#option, it still compiles the test and wastes a lot of time.\nmv tests/checkasm/h264dsp.c tests/checkasm/h264dsp.c.backup\ncp tests/checkasm/Makefile tests/checkasm/Makefile.backup\ncp tests/checkasm/checkasm.c tests/checkasm/checkasm.c.backup\n\nsed -i '/^AVCODECOBJS-\\$(CONFIG_H264DSP)/d' tests/checkasm/Makefile\nsed -i -e '/extern.*checkasm_check_h264dsp/d' \\\n        -e '/\"h264dsp\"/d' tests/checkasm/checkasm.c\n\nmake -j\"$(nproc)\" fate SAMPLES=fate-suite/\n\n# Undo patches.\nmv tests/checkasm/h264dsp.c.backup tests/checkasm/h264dsp.c\nmv tests/checkasm/Makefile.backup tests/checkasm/Makefile\nmv tests/checkasm/checkasm.c.backup tests/checkasm/checkasm.c\n"
  },
  {
    "path": "projects/ffms2/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y python-is-python3 build-essential \\\n    autoconf automake libtool zlib1g-dev pkg-config nasm\n\nRUN git clone --depth 1 --branch n7.1 https://github.com/FFmpeg/FFmpeg.git ffmpeg\nRUN cd $SRC/ffmpeg && \\\n    ./configure --prefix=/usr --enable-shared --disable-static \\\n        --disable-doc --disable-programs --disable-debug \\\n        --cc=clang --cxx=clang++ && \\\n    make -j$(nproc) && \\\n    make install && \\\n    ldconfig\n\nRUN git clone https://github.com/FFMS/ffms2 ffms2\nCOPY build.sh $SRC/\nCOPY *_fuzzer.cc $SRC/\nWORKDIR $SRC/ffms2\n"
  },
  {
    "path": "projects/ffms2/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\nmake install-libLTLIBRARIES\n\n# The media libraries has a significant set of dynamic library dependencies,\n# and to resolve this we copy them all over.\nfind /usr/local/lib -name \"libffms2.so*\" -exec cp \"{}\" $OUT \\;\nDYNLIBS_TO_COPY=\"libavformat.so* libavcodec.so* libavutil.so* libswscale.so* libswresample.so* libxml2.so* libgme.so* libopenmpt.so* libchromaprint.so* libbluray.so* libssh-gcrypt.so* libvpx.so* libwebpmux.so* libwebp.so* librsvg-2.so* libgobject-2.0.so* libglib-2.0.so* libcairo.so* libzvbi.so* libsnappy.so* libaom.so* libcodec2.so* libgsm.so* libmp3lame.so* libopenjp2.so* libopus.so* libshine.so* libspeex.so* libtheoraenc.so* libtheoradec.so* libtwolame.so* libvorbis.so* libvorbisenc.so* libwavpack.so* libx264.so* libx265.so* libxvidcore.so* libva.so* libva-drm.so* libva-x11.so* libvdpau.so* libX11.so* libxcb.so* libdrm.so* libOpenCL.so* libfontconfig.so* libfreetype.so* libpixman-1.so* libpng16.so* libxcb-shm.so* libxcb-render.so* libXrender.so* libXext.so* libmpg123.so* libvorbisfile.so* libcairo-gobject.so* libgdk_pixbuf-2.0.so* libgmodule-2.0.so* libgio-2.0.so* libpangocairo-1.0.so* libpango-1.0.so* libfribidi.so* libthai.so* libharfbuzz.so* libgraphite2.so* libpangoft2-1.0.so* libsoxr.so* libdatrie.so* libogg.so* libXfixes.so* libnuma.so* libXau.so* libXdmcp.so* libbsd.so* libicuuc.so* libicudata.so*\"\n\nfor dynlibname in $DYNLIBS_TO_COPY; do\n  find /usr/lib -name \"${dynlibname}\" -exec cp {} $OUT \\;\ndone\n\nfor f in $SRC/*_fuzzer.cc; do\n  fuzzer=$(basename \"$f\" _fuzzer.cc)\n  $CXX $CXXFLAGS -std=c++11 -I$SRC/ffms2/include \\\n    $SRC/${fuzzer}_fuzzer.cc -o $OUT/${fuzzer}_fuzzer \\\n    $LIB_FUZZING_ENGINE -lpthread $OUT/libffms2.so \\\n    $OUT/*.so*\n\n  patchelf --set-rpath '$ORIGIN/' $OUT/${fuzzer}_fuzzer\ndone\n"
  },
  {
    "path": "projects/ffms2/ffms2_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <ffms.h>\n#include <string>\n\n#include <sys/types.h>\n#include <unistd.h>\n\n\n/* Overwrite atexit to make linker happy */\nint atexit(void (*function)(void)) {\n  return 1;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FFMS_Init(0, 0);\n\n  char errmsg[1024];\n  FFMS_ErrorInfo errinfo;\n  errinfo.Buffer = errmsg;\n  errinfo.BufferSize = sizeof(errmsg);\n  errinfo.ErrorType = FFMS_ERROR_SUCCESS;\n  errinfo.SubType = FFMS_ERROR_SUCCESS;\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  FFMS_Indexer *indexer = FFMS_CreateIndexer(filename, &errinfo);\n  if (indexer != NULL) {\n    FFMS_Index *index = FFMS_DoIndexing2(indexer, FFMS_IEH_ABORT, &errinfo);\n    if (index != NULL) {\n      int trackno = FFMS_GetFirstTrackOfType(index, FFMS_TYPE_VIDEO, &errinfo);\n    }\n    FFMS_DestroyIndex(index);\n  }\n\n  unlink(filename);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/ffms2/project.yaml",
    "content": "homepage: \"https://github.com/FFMS/ffms2\"\nmain_repo: \"https://github.com/FFMS/ffms2\"\nlanguage: c++\nfuzzing_engines:\n- libfuzzer\n- honggfuzz\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- \"david@adalogics.com\"\n- \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/fftw3/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y build-essential ocaml ocamlbuild texinfo \\\n    autoconf automake indent libtool libnum-ocaml-dev fig2dev\n\nRUN git clone https://github.com/FFTW/fftw3 fftw3\nCOPY run_tests.sh build.sh *.cc $SRC/\nWORKDIR $SRC/fftw3\n"
  },
  {
    "path": "projects/fftw3/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nsh bootstrap.sh\nmake -j4\n\nfor f in $SRC/*_fuzzer.cc; do\n  fuzzer=$(basename \"$f\" _fuzzer.cc)\n  $CXX $CXXFLAGS -I$SRC/fftw3 -I$SRC/fftw3/api \\\n    $SRC/${fuzzer}_fuzzer.cc -o $OUT/${fuzzer}_fuzzer \\\n    $LIB_FUZZING_ENGINE -lpthread ./.libs/libfftw3.a\ndone\n\n"
  },
  {
    "path": "projects/fftw3/fftw3_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <fftw3.h>\n#include <string>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // For reference, fftw_compelx is defined:\n  // typedef double fftw_complex[2]\n  if (size < 1) {\n    return 0;\n  }\n  uint8_t ARRAY_SIZE = (*data) % 250 + 1;\n  data++;\n  size -= 1;\n  if ((ARRAY_SIZE * sizeof(double) * 2) > size) {\n    return 0;\n  }\n  fftw_complex signal[ARRAY_SIZE];\n  fftw_complex result[ARRAY_SIZE];\n\n  // Seed the signals with fuzz data\n  memcpy(signal, data, (ARRAY_SIZE * sizeof(double) * 2));\n\n  fftw_plan plan =\n      fftw_plan_dft_1d(ARRAY_SIZE, signal, result, FFTW_FORWARD, FFTW_ESTIMATE);\n\n  fftw_execute(plan);\n  fftw_destroy_plan(plan);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/fftw3/project.yaml",
    "content": "homepage: \"http://fftw.org/\"\nmain_repo: \"https://github.com/fftw/fftw3.git\"\nlanguage: c++\nvendor_ccs:\n- \"david@adalogics.com\"\n- \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/fftw3/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/file/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt install -y make autoconf automake libtool shtool\nRUN apt-get update && apt install -y libbz2-dev      liblzma-dev      zlib1g-dev      libzstd-dev      liblz4-dev\nRUN apt-get update && apt install -y libbz2-dev:i386 liblzma-dev:i386 zlib1g-dev:i386 libzstd-dev:i386 liblz4-dev:i386 \nRUN git clone --depth 1 https://github.com/file/file.git\n\n# Supplement file's existing test files\nRUN git clone --depth 1 https://github.com/DavidKorczynski/binary-samples.git\nRUN git clone --depth 1 https://github.com/corkami/pocs\n\nWORKDIR file\nCOPY build.sh fuzzer_temp_file.h magic_fuzzer.cc magic_fuzzer_loaddb.cc magic_fuzzer_fd.cc $SRC/\n"
  },
  {
    "path": "projects/file/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nautoreconf -i\n./configure --enable-static --enable-fsect-man5\nmake V=1 all\n\n$CXX $CXXFLAGS -std=c++11 -Isrc/ \\\n     $SRC/magic_fuzzer.cc -o $OUT/magic_fuzzer \\\n     $LIB_FUZZING_ENGINE ./src/.libs/libmagic.a -l:libz.a -l:liblz4.a -l:libbz2.a -l:liblzma.a -l:libzstd.a\n$CXX $CXXFLAGS -std=c++11 -Isrc/ \\\n     $SRC/magic_fuzzer_loaddb.cc -o $OUT/magic_fuzzer_loaddb \\\n     $LIB_FUZZING_ENGINE ./src/.libs/libmagic.a -l:libz.a -l:liblz4.a -l:libbz2.a -l:liblzma.a -l:libzstd.a\n$CXX $CXXFLAGS -std=c++11 -Isrc/ \\\n     $SRC/magic_fuzzer_fd.cc -o $OUT/magic_fuzzer_fd \\\n     $LIB_FUZZING_ENGINE ./src/.libs/libmagic.a -l:libz.a -l:liblz4.a -l:libbz2.a -l:liblzma.a -l:libzstd.a\n\ncp ./magic/magic.mgc $OUT/\n\nmkdir pocs_all\nfind $SRC/pocs/ -type f -print0 | xargs -0 -I % mv -f % ./pocs_all\n\nzip -j $OUT/magic_fuzzer_seed_corpus.zip ./tests/*.testfile $SRC/binary-samples/{elf,pe}-* $SRC/pocs_all\n"
  },
  {
    "path": "projects/file/fuzzer_temp_file.h",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that\n// require a file instead of an input buffer.\n\n#ifndef FUZZER_TEMP_FILE_H_\n#define FUZZER_TEMP_FILE_H_\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n// Pure-C interface for creating and cleaning up temporary files.\n\nstatic char* fuzzer_get_tmpfile(const uint8_t* data, size_t size) {\n    char* filename_buffer = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n    if (!filename_buffer) {\n        perror(\"Failed to allocate file name buffer.\");\n        abort();\n    }\n    const int file_descriptor = mkstemp(filename_buffer);\n    if (file_descriptor < 0) {\n        perror(\"Failed to make temporary file.\");\n        abort();\n    }\n    FILE* file = fdopen(file_descriptor, \"wb\");\n    if (!file) {\n        perror(\"Failed to open file descriptor.\");\n        close(file_descriptor);\n        abort();\n    }\n    const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);\n    if (bytes_written < size) {\n        close(file_descriptor);\n        fprintf(stderr, \"Failed to write all bytes to file (%zu out of %zu)\",\n                bytes_written, size);\n        abort();\n    }\n    fclose(file);\n    return filename_buffer;\n}\n\nstatic void fuzzer_release_tmpfile(char* filename) {\n    if (unlink(filename) != 0) {\n        perror(\"WARNING: Failed to delete temporary file.\");\n    }\n    free(filename);\n}\n\n// C++ RAII object for creating temporary files.\n\n#ifdef __cplusplus\nclass FuzzerTemporaryFile {\n    public:\n        FuzzerTemporaryFile(const uint8_t* data, size_t size)\n            : filename_(fuzzer_get_tmpfile(data, size)) {}\n\n        ~FuzzerTemporaryFile() { fuzzer_release_tmpfile(filename_); }\n\n        const char* filename() const { return filename_; }\n\n    private:\n        char* filename_;\n};\n#endif\n\n#endif  // FUZZER_TEMP_FILE_H_\n"
  },
  {
    "path": "projects/file/magic_fuzzer.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <libgen.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string>\n\n#include <magic.h>\n\nstruct Environment {\n  Environment(std::string data_dir) {\n    magic = magic_open(MAGIC_COMPRESS|MAGIC_CONTINUE|MAGIC_NO_COMPRESS_FORK);\n    std::string magic_path = data_dir + \"/magic\";\n    if (magic_load(magic, magic_path.c_str())) {\n      fprintf(stderr, \"error loading magic file: %s\\n\", magic_error(magic));\n      exit(1);\n    }\n  }\n\n  magic_t magic;\n};\n\nstatic Environment* env;\n\nextern \"C\" int LLVMFuzzerInitialize(int* argc, char*** argv) {\n  char* exe_path = (*argv)[0];\n  // dirname() can modify its argument.\n  char* exe_path_copy = strdup(exe_path);\n  char* dir = dirname(exe_path_copy);\n  env = new Environment(dir);\n  free(exe_path_copy);\n  return 0;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  if (size < 1)\n    return 0;\n  magic_buffer(env->magic, data, size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/file/magic_fuzzer_fd.cc",
    "content": "// Copyright 2022 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <libgen.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string>\n#include <fcntl.h>\n\n#include \"fuzzer_temp_file.h\"\n\n#include <magic.h>\n\nstruct Environment {\n  Environment(std::string data_dir) {\n    magic = magic_open(MAGIC_COMPRESS|MAGIC_CONTINUE|MAGIC_NO_COMPRESS_FORK);\n    std::string magic_path = data_dir + \"/magic\";\n    if (magic_load(magic, magic_path.c_str())) {\n      fprintf(stderr, \"error loading magic file: %s\\n\", magic_error(magic));\n      exit(1);\n    }\n  }\n\n  magic_t magic;\n};\n\nstatic Environment* env;\n\nextern \"C\" int LLVMFuzzerInitialize(int* argc, char*** argv) {\n  char* exe_path = (*argv)[0];\n  // dirname() can modify its argument.\n  char* exe_path_copy = strdup(exe_path);\n  char* dir = dirname(exe_path_copy);\n  env = new Environment(dir);\n  free(exe_path_copy);\n  return 0;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzerTemporaryFile ftf (data, size);\n  int fd = open(ftf.filename(), O_RDONLY);\n  magic_descriptor(env->magic, fd);\n  close(fd);\n  return 0;\n}\n"
  },
  {
    "path": "projects/file/magic_fuzzer_loaddb.cc",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <libgen.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include <magic.h>\n\n#include \"fuzzer_temp_file.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  if (size < 1)\n    return 0;\n  \n  FuzzerTemporaryFile ftf (data, size);\n  magic_t magic = magic_open(MAGIC_NONE);\n  \n  magic_check(magic, ftf.filename());\n  magic_compile(magic, ftf.filename());\n  magic_close(magic);\n  return 0;\n}\n"
  },
  {
    "path": "projects/file/project.yaml",
    "content": "homepage: \"http://www.darwinsys.com/file/\"\nlanguage: c++\nprimary_contact: \"zoulasc@gmail.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/file/file.git'\n"
  },
  {
    "path": "projects/filelock/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN python3 -m pip install --upgrade pip\nRUN git clone --depth 1 https://github.com/tox-dev/py-filelock filelock\nWORKDIR filelock\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/filelock/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/filelock/fuzz_filelock.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport filelock\n\nfrom filelock import BaseFileLock, FileLock, SoftFileLock, Timeout, UnixFileLock\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    filepath = os.path.join(\"/tmp/tmp1.txt\")\n    with open(filepath, \"w\") as f:\n        f.write(\"random\")\n\n    lock = filelock.FileLock(filepath)\n    for i in range(fdp.ConsumeIntInRange(10, 100)):\n        try:\n            lock.acquire()\n        except IsADirectoryError:\n            pass\n    assert lock.is_locked\n    lock.release(force=True)\n    assert not lock.is_locked\n    \n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/filelock/project.yaml",
    "content": "homepage: \"https://github.com/google/oss-fuzz/pull/8244\"\nlanguage: python\nprimary_contact: \"gaborjbernat@gmail.com\"\nmain_repo: \"https://github.com/tox-dev/py-filelock\"\nauto_ccs:\n- \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/filesystem_spec/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip aiohttp requests\nRUN git clone https://github.com/fsspec/filesystem_spec filesystem_spec\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/filesystem_spec\n"
  },
  {
    "path": "projects/filesystem_spec/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/filesystem_spec/fuzz_http.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport io\nimport sys\nimport atheris\nimport pathlib\n\nfrom fsspec.implementations import http\nimport fsspec\nfrom fsspec.exceptions import FSTimeoutError\n\n# Import aiohttp and requests for pyinstaller\nfrom requests import *\nfrom aiohttp import *\nfrom aiohttp.client_exceptions import ClientError\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  path = fdp.ConsumeUnicodeNoSurrogates(124)\n\n  # Ensure it's a file vs directory\n  path = path + \"the_file.txt\"\n  h = fsspec.filesystem(\"http\", use_listings_cache=True)\n  tmp_path = pathlib.Path(path)\n  try:\n    tmp_path.write_bytes(data)\n  except:\n    # Don't care about errors in pathlib\n    try:\n      tmp_path.unlink()\n    except:\n      pass\n    return\n\n  try:\n    h.put_file(tmp_path, path, method=\"put\", timeout=0.5)\n  except FSTimeoutError:\n    try:\n      tmp_path.unlink()\n    except:\n      pass\n    return\n  except (\n    ClientError,\n    TypeError,\n    AssertionError\n  ) as e:\n    # Abandon if aiohttp threw an error.\n    try:\n      tmp_path.unlink()\n    except:\n      pass\n    return\n\n  # Reading the file should be possible now.\n  with h.open(path) as http_f:\n    http_f.read()\n\n  try:\n    tmp_path.unlink()\n  except:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/filesystem_spec/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/fsspec/filesystem_spec\nlanguage: python\nmain_repo: https://github.com/fsspec/filesystem_spec\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/fio/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libcunit1 libcunit1-dev\nRUN git clone --depth 1 https://github.com/axboe/fio.git fio\nWORKDIR $SRC/fio\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/fio/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nexport LDFLAGS=\"$CXXFLAGS\"\n./configure\nmake -j$(nproc)\nmake unittests/unittest\ncp t/fuzz/fuzz_parseini $OUT/\n\n# builds corpus\nzip -r $OUT/fuzz_parseini_seed_corpus.zip examples\n"
  },
  {
    "path": "projects/fio/project.yaml",
    "content": "homepage: \"http://git.kernel.dk/fio.git\"\nlanguage: c++\nprimary_contact: \"axboe@kernel.dk\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n  - \"sitsofe@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/axboe/fio.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/fio/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n./unittests/unittest\n"
  },
  {
    "path": "projects/fips203/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/integritychain/fips203     # or use other version control\nWORKDIR fips203\nENV FUZZING_LANGUAGE=rust\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/fips203/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build fuzzers, zip corpus\n\ncd $SRC/fips203\ncargo fuzz build -O --debug-assertions\ncp fuzz/target/x86_64-unknown-linux-gnu/release/ml_kem_fuzz $OUT/\nzip -q $OUT/ml_kem_fuzz_seed_corpus.zip fuzz/corpus/ml_kem_fuzz/*\n\n\n"
  },
  {
    "path": "projects/fips203/project.yaml",
    "content": "homepage: \"https://crates.io/crates/fips203\"\nmain_repo: \"https://github.com/integritychain/fips203\"\nlanguage: rust\nprimary_contact: \"eschorn@integritychain.com\"\nauto_ccs:\n  - \"eschorn@gmail.com\"\nfile_github_issue: true\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/firefox/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y software-properties-common && \\\n    add-apt-repository -y ppa:ubuntu-toolchain-r/test && \\\n    apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y --no-install-recommends \\\n      cmake \\\n      gawk \\\n      git \\\n      libstdc++6 \\\n      m4 \\\n      nasm \\\n      python \\\n      python3-pip \\\n      python3-setuptools \\\n      python3-wheel\n\n# install Firefox deps\n# built using https://packages.ubuntu.com/focal/firefox as a reference\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    libasound2 \\\n    libatk1.0-0 \\\n    libc6 \\\n    libcairo-gobject2 \\\n    libcairo2 \\\n    libdbus-1-3 \\\n    libdbus-glib-1-2 \\\n    libffi7 \\\n    libfontconfig1 \\\n    libfreetype6 \\\n    libgcc-s1 \\\n    libgdk-pixbuf2.0-0 \\\n    libglib2.0-0 \\\n    libgtk-3-0 \\\n    libharfbuzz0b \\\n    libpango-1.0-0 \\\n    libpangocairo-1.0-0 \\\n    libpangoft2-1.0-0 \\\n    libstdc++6 \\\n    libx11-6 \\\n    libx11-xcb1 \\\n    libxcb-shm0 \\\n    libxcb1 \\\n    libxcomposite1 \\\n    libxcursor1 \\\n    libxdamage1 \\\n    libxext6 \\\n    libxfixes3 \\\n    libxi6 \\\n    libxrandr2 \\\n    libxrender1 \\\n    libxt6 \\\n    libxtst6 \\\n    lsb-release \\\n    libcanberra0 \\\n    libdbusmenu-glib4 \\\n    libdbusmenu-gtk3-4\n\nRUN pip3 install meson ninja\n\n# This wrapper of cargo seems to interfere with our build system.\nRUN rm -f /usr/local/bin/cargo\n\nRUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $SRC/rustbuild.sh && \\\n    chmod +x $SRC/rustbuild.sh && \\\n    $SRC/rustbuild.sh -y\n\nRUN git clone --depth 1 https://github.com/mozilla/gecko-dev mozilla-central\nWORKDIR mozilla-central\n# Install OS dependencies.\n# Will be re-run in build.sh to install missing dependencies.\nENV SHELL /bin/bash\nRUN ./mach --no-interactive bootstrap --application-choice browser\nCOPY build.sh target.c *.options mozconfig.* $SRC/\n"
  },
  {
    "path": "projects/firefox/ImageBMP.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\n"
  },
  {
    "path": "projects/firefox/ImageGIF.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\n"
  },
  {
    "path": "projects/firefox/SdpParser.options",
    "content": "[libfuzzer]\nmax_len = 25600\n"
  },
  {
    "path": "projects/firefox/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  touch $OUT/exit\n  exit 0\nfi\n\nsource $HOME/.cargo/env\n\n# Case-sensitive names of internal Firefox fuzzing targets. Edit to add more.\nFUZZ_TARGETS=(\n  ContentSecurityPolicyParser\n  FeaturePolicyParser\n  # WebRTC\n  SdpParser\n  StunParser\n  # Image\n  ImageGIF\n  ImageICO\n  ImageBMP\n  # Demuxing\n  MediaADTS\n  MediaFlac\n  MediaMP3\n  MediaOgg\n  MediaWebM\n  # MediaWAV disabled due to frequent OOMs\n)\n\n# Firefox object (build) directory and configuration file.\nexport MOZ_OBJDIR=$WORK/obj-fuzz\nexport MOZCONFIG=$SRC/mozconfig.$SANITIZER\n\n# Without this, a host tool used during Rust part of the build will fail\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Install remaining dependencies.\nexport SHELL=/bin/bash\n\nrustup default nightly\n\n./mach --no-interactive bootstrap --application-choice browser\n\n# Skip patches for now\nrm tools/fuzzing/libfuzzer/patches/*.patch\ntouch tools/fuzzing/libfuzzer/patches/dummy.patch\n\n# Build!\n./mach build\n./mach gtest buildbutdontrun\n\n# Packages Firefox only to immediately extract the archive. Some files are\n# replaced with gtest-variants, which is required by the fuzzing interface.\n# Weighs in shy of 1GB afterwards. About double for coverage builds.\n./mach package\ntar -xf $MOZ_OBJDIR/dist/firefox*.linux-x86_64.tar.xz -C $OUT\ncp -L $MOZ_OBJDIR/dist/bin/gtest/libxul.so $OUT/firefox\ncp $OUT/firefox/dependentlibs.list $OUT/firefox/dependentlibs.list.gtest\n\n# Get absolute paths of the required system libraries.\nLIBRARIES=$({\n  xargs -I{} ldd $OUT/firefox/{} | gawk '/=> [/]/ {print $3}' | sort -u\n} < $OUT/firefox/dependentlibs.list)\n\n# Copy libraries. Less than 50MB total.\nmkdir -p $OUT/lib\nfor LIBRARY in $LIBRARIES; do cp -L $LIBRARY $OUT/lib; done\n\n# Build a wrapper binary for each target to set environment variables.\nfor FUZZ_TARGET in ${FUZZ_TARGETS[@]}\ndo\n  $CC $CFLAGS -O0 \\\n    -DFUZZ_TARGET=$FUZZ_TARGET \\\n    $SRC/target.c -o $OUT/$FUZZ_TARGET\ndone\n\ncp $SRC/*.options $OUT\n\n# SdpParser\nfind media/webrtc -iname \"*.sdp\" \\\n  -type f -exec zip -qu $OUT/SdpParser_seed_corpus.zip \"{}\" \\;\n\n# StunParser\nfind media/webrtc -iname \"*.stun\" \\\n  -type f -exec zip -qu $OUT/StunParser_seed_corpus.zip \"{}\" \\;\n\n"
  },
  {
    "path": "projects/firefox/mozconfig.address",
    "content": ". $SRC/mozconfig.coverage\n\nac_add_options --enable-address-sanitizer\n\n# Don't use standard CFLAGS/CXXFLAGS provided by oss-fuzz\nexport CFLAGS=\"\"\nexport CXXFLAGS=\"\"\n"
  },
  {
    "path": "projects/firefox/mozconfig.coverage",
    "content": "mk_add_options AUTOCLOBBER=1\nac_add_options --disable-debug\nac_add_options --disable-elf-hack\nac_add_options --disable-jemalloc\nac_add_options --disable-crashreporter\nac_add_options --enable-fuzzing\nac_add_options --enable-optimize=-O1\nac_add_options --enable-debug-symbols=-gline-tables-only\n"
  },
  {
    "path": "projects/firefox/mozconfig.undefined",
    "content": ". $SRC/mozconfig.coverage\n\nac_add_options --enable-undefined-sanitizer=bool,bounds,return,pointer-overflow,signed-integer-overflow,vla-bound\nmk_add_options CFLAGS= CXXFLAGS=\n"
  },
  {
    "path": "projects/firefox/project.yaml",
    "content": "homepage: \"https://www.mozilla.org/firefox/\"\nlanguage: c++\nmain_repo: https://hg.mozilla.org/mozilla-central/\nprimary_contact: \"choller@mozilla.com\"\nauto_ccs:\n  - twsmith@mozilla.com\n  - sledru@mozilla.com\nvendor_ccs:\n  - oss-fuzz@mozilla-fuzzing.iam.gserviceaccount.com\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nrun_tests: False\n# libraries from $OUT/firefox/dependentlibs.list\ncoverage_extra_args: >\n -object firefox/firefox\n -object firefox/libnspr4.so\n -object firefox/libplc4.so\n -object firefox/libplds4.so\n -object firefox/libmozsandbox.so\n -object firefox/liblgpllibs.so\n -object firefox/libnssutil3.so\n -object firefox/libnss3.so\n -object firefox/libsmime3.so\n -object firefox/libmozsqlite3.so\n -object firefox/libssl3.so\n -object firefox/libmozgtk.so\n -object firefox/libxul.so\n"
  },
  {
    "path": "projects/firefox/target.c",
    "content": "#include <limits.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n#define STRINGLIT(S) #S\n#define STRINGIFY(S) STRINGLIT(S)\n\n// Required for oss-fuzz to consider the binary a target.\nstatic const char* magic __attribute__((used)) = \"LLVMFuzzerTestOneInput\";\n\nint main(int argc, char* argv[]) {\n  char path[PATH_MAX] = {0};\n\n  // Handle (currently not used) relative binary path.\n  if (**argv != '/') {\n    if (!getcwd(path, PATH_MAX - 1)) {\n      perror(\"getcwd\");\n      exit(1);\n    }\n    strcat(path, \"/\");\n  }\n\n  if (strlen(path) + strlen(*argv) + 40 >= PATH_MAX) {\n    fprintf(stderr, \"Path length would exceed PATH_MAX\\n\");\n    exit(1);\n  }\n\n  strcat(path, *argv);\n  char* solidus = strrchr(path, '/');\n  *solidus = 0; // terminate path before last /\n\n  char ld_path[PATH_MAX] = {0};\n  strcpy(ld_path, path);\n  strcat(ld_path, \"/lib\");\n\n  // Expects LD_LIBRARY_PATH to not also be set by oss-fuzz.\n  setenv(\"LD_LIBRARY_PATH\", ld_path, 0);\n  setenv(\"HOME\", \"/tmp\", 0);\n  setenv(\"FUZZER\", STRINGIFY(FUZZ_TARGET), 1);\n\n  // ContentParentIPC\n  char blacklist_path[PATH_MAX] = {0};\n  strcpy(blacklist_path, path);\n  strcat(blacklist_path, \"/firefox/libfuzzer.content.blacklist.txt\");\n  setenv(\"MOZ_IPC_MESSAGE_FUZZ_BLACKLIST\", blacklist_path, 1);\n\n  // Temporary (or permanent?) work-arounds for fuzzing interface bugs.\n  char* options = getenv(\"ASAN_OPTIONS\");\n  if (options) {\n    char* ptr;\n    char* new_options = strdup(options);\n    // https://bugzilla.mozilla.org/1477846\n    ptr = strstr(new_options, \"detect_stack_use_after_return=1\");\n    if (ptr) ptr[30] = '0';\n    // https://bugzilla.mozilla.org/1477844\n    ptr = strstr(new_options, \"detect_leaks=1\");\n    if (ptr) ptr[13] = '0';\n    setenv(\"ASAN_OPTIONS\", new_options, 1);\n    free(new_options);\n  }\n\n  char ff_path[PATH_MAX] = {0};\n  strcpy(ff_path, path);\n  strcat(ff_path, \"/firefox/firefox\");\n\n  int ret = execv(ff_path, argv);\n  if (ret)\n    perror(\"execv\");\n  return ret;\n}\n"
  },
  {
    "path": "projects/firestore/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget golang python python-protobuf python-six\nRUN git clone --depth 1 https://github.com/firebase/firebase-ios-sdk.git\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/firestore/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $WORK\n\n# Disable UBSan vptr since Firestore depends on other libraries that are built\n# with -fno-rtti.\nexport CFLAGS=\"$CFLAGS -Wno-error=unknown-warning-option -fno-sanitize=vptr -Wno-error=missing-template-arg-list-after-template-kw -Wno-error=deprecated-builtins -Wno-error=deprecated-literal-operator\"\nexport CXXFLAGS=\"$CXXFLAGS -Wno-error=unknown-warning-option -fno-sanitize=vptr -Wno-error=missing-template-arg-list-after-template-kw -Wno-error=deprecated-builtins -Wno-error=deprecated-literal-operator\"\n\n# Build the project using cmake with FUZZING option enabled to link to OSS Fuzz\n# fuzzing library defined in ${LIB_FUZZING_ENGINE}.\ncd $SRC/firebase-ios-sdk\n\n# Do not use Werror anywhere\nsed -i 's/-Werror=reorder//g' ./cmake/compiler_setup.cmake\nsed -i 's/-Werror=return-type//g' ./cmake/compiler_setup.cmake\nsed -i 's/-Wall -Wextra -Werror//g' ./cmake/compiler_setup.cmake\nsed -i 's/-Wuninitialized/#-Wu/g' ./cmake/compiler_setup.cmake\nsed -i 's/-Wfno-common/#-Wu/g' ./cmake/compiler_setup.cmake\nsed -i 's/-Werror//g' ./scripts/sync_project.rb\nsed -i 's/-Werror=reorder//g' ./FirebaseFirestore.podspec\nsed -i 's/ReadContext context/\\/\\/ReadContext/g' ./Firestore/fuzzing/serializer_fuzzer.cc\nsed -i 's/serializer.Dec/\\/\\/serializer/g' ./Firestore/fuzzing/serializer_fuzzer.cc\n\nmkdir build && cd build\ncmake -DFIREBASE_IOS_BUILD_TESTS=OFF -DFIREBASE_IOS_BUILD_BENCHMARKS=OFF -DFUZZING=ON ..\nmake -j$(nproc)\n\n# Copy fuzzing targets, dictionaries, and zipped corpora to $OUT.\nFUZZERS_DIR=Firestore/fuzzing\nfind ${FUZZERS_DIR} -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind ${FUZZERS_DIR} -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind ${FUZZERS_DIR} -name \"*_fuzzer_seed_corpus\" -type d -execdir zip -r ${OUT}/{}.zip {} ';'\n"
  },
  {
    "path": "projects/firestore/project.yaml",
    "content": "homepage: \"https://firebase.google.com/docs/firestore/\"\nlanguage: c++\nprimary_contact: \"varconst@google.com\"\nauto_ccs:\n  - \"varconst@google.com\"\n  - \"rgowman@google.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/firebase/firebase-ios-sdk.git'\n"
  },
  {
    "path": "projects/flac/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool libtool-bin pkg-config gettext sudo default-jdk\nRUN git clone --depth 1 https://github.com/xiph/flac.git\nRUN git clone --depth 1 https://github.com/xiph/ogg.git\nRUN git clone --depth 1 https://github.com/google/ExoPlayer.git\nCOPY fuzzer_exo.cpp $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/flac/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\nif [[ $CFLAGS = *sanitize=address* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DASAN\"\nfi\n\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\nexport CFLAGS=\"$CFLAGS -D_FORTIFY_SOURCE=0\"\nexport CXXFLAGS=\"$CXXFLAGS -D_FORTIFY_SOURCE=0 -D_GLIBCXX_DEBUG\"\n\n# Build libogg\nmkdir $SRC/libogg-install\ncd $SRC/ogg\n./autogen.sh\n./configure --disable-crc --disable-shared --prefix=\"$SRC/libogg-install\"\nmake -j$(nproc)\nmake install\n\n# Build libflac\ncd $SRC/flac/\n./autogen.sh\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    LD_LIBRARY_PATH=\"$SRC/libogg-install/lib\" ./configure --with-ogg=\"$SRC/libogg-install\" --enable-static --disable-shared --disable-oggtest --disable-examples --disable-programs --disable-xmms-plugin --disable-asm-optimizations --disable-sse --enable-oss-fuzzers\nelse\n    LD_LIBRARY_PATH=\"$SRC/libogg-install/lib\" ./configure --with-ogg=\"$SRC/libogg-install\" --enable-static --disable-shared --disable-oggtest --disable-examples --disable-programs --disable-xmms-plugin --enable-oss-fuzzers\nfi\nmake -j$(nproc)\n\n# Copy decoder fuzzers\ncd $SRC/flac/oss-fuzz\ncp fuzzer_* $OUT\ncd $SRC\n\n# Build fuzzer_exo\n$CXX $CXXFLAGS -I $SRC/flac/oss-fuzz/ -I $SRC/flac/include/ -I $SRC/ExoPlayer/extensions/flac/src/main/jni/ -I /usr/lib/jvm/java-11-openjdk-amd64/include/ -I /usr/lib/jvm/java-11-openjdk-amd64/include/linux/ fuzzer_exo.cpp \\\n    $SRC/flac/src/libFLAC++/.libs/libFLAC++.a $SRC/flac/src/libFLAC/.libs/libFLAC.a $SRC/libogg-install/lib/libogg.a $LIB_FUZZING_ENGINE -o $OUT/fuzzer_exo\n\n# Build libflac again for encoder fuzzers, but now with additional define\ncd $SRC/flac/\necho \"#define FUZZING_BUILD_MODE_FLAC_SANITIZE_SIGNED_INTEGER_OVERFLOW\" >> config.h\n\nmake -j$(nproc)\n\n# Copy encoder fuzzers\ncd $SRC/flac/oss-fuzz\ncp fuzzer_encoder fuzzer_encoder_v2 $OUT\n\n# Copy seed corpus\ncd $SRC/flac/oss-fuzz/seedcorpus || exit 0\nfor fuzzerName in *; do\n    zip -j $OUT/${fuzzerName}_seed_corpus.zip ${fuzzerName}/*\ndone\n"
  },
  {
    "path": "projects/flac/fuzzer_exo.cpp",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <assert.h>\n#include <string>\n\n#include \"include/flac_parser.h\"\n\n#include <jni.h>\n\n// #include <android/log.h>\n\n#include <cassert>\n#include <cstdlib>\n#include <cstring>\n\n#include \"common.h\"\n\n#define LOG_TAG \"FLACParser\"\n\n#define LITERAL_TO_STRING_INTERNAL(x) #x\n#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x)\n\n#define CHECK(x) if (!(x)) return 0;\n\nconst int endian = 1;\n#define isBigEndian() (*(reinterpret_cast<const char *>(&endian)) == 0)\n\n// The FLAC parser calls our C++ static callbacks using C calling conventions,\n// inside FLAC__stream_decoder_process_until_end_of_metadata\n// and FLAC__stream_decoder_process_single.\n// We immediately then call our corresponding C++ instance methods\n// with the same parameter list, but discard redundant information.\n\nFLAC__StreamDecoderReadStatus FLACParser::read_callback(\n    const FLAC__StreamDecoder * /* decoder */, FLAC__byte buffer[],\n    size_t *bytes, void *client_data) {\n  return reinterpret_cast<FLACParser *>(client_data)\n      ->readCallback(buffer, bytes);\n}\n\nFLAC__StreamDecoderSeekStatus FLACParser::seek_callback(\n    const FLAC__StreamDecoder * /* decoder */,\n    FLAC__uint64 absolute_byte_offset, void *client_data) {\n  return reinterpret_cast<FLACParser *>(client_data)\n      ->seekCallback(absolute_byte_offset);\n}\n\nFLAC__StreamDecoderTellStatus FLACParser::tell_callback(\n    const FLAC__StreamDecoder * /* decoder */,\n    FLAC__uint64 *absolute_byte_offset, void *client_data) {\n  return reinterpret_cast<FLACParser *>(client_data)\n      ->tellCallback(absolute_byte_offset);\n}\n\nFLAC__StreamDecoderLengthStatus FLACParser::length_callback(\n    const FLAC__StreamDecoder * /* decoder */, FLAC__uint64 *stream_length,\n    void *client_data) {\n  return reinterpret_cast<FLACParser *>(client_data)\n      ->lengthCallback(stream_length);\n}\n\nFLAC__bool FLACParser::eof_callback(const FLAC__StreamDecoder * /* decoder */,\n                                    void *client_data) {\n  return reinterpret_cast<FLACParser *>(client_data)->eofCallback();\n}\n\nFLAC__StreamDecoderWriteStatus FLACParser::write_callback(\n    const FLAC__StreamDecoder * /* decoder */, const FLAC__Frame *frame,\n    const FLAC__int32 *const buffer[], void *client_data) {\n  return reinterpret_cast<FLACParser *>(client_data)\n      ->writeCallback(frame, buffer);\n}\n\nvoid FLACParser::metadata_callback(const FLAC__StreamDecoder * /* decoder */,\n                                   const FLAC__StreamMetadata *metadata,\n                                   void *client_data) {\n  reinterpret_cast<FLACParser *>(client_data)->metadataCallback(metadata);\n}\n\nvoid FLACParser::error_callback(const FLAC__StreamDecoder * /* decoder */,\n                                FLAC__StreamDecoderErrorStatus status,\n                                void *client_data) {\n  reinterpret_cast<FLACParser *>(client_data)->errorCallback(status);\n}\n\n// These are the corresponding callbacks with C++ calling conventions\n\nFLAC__StreamDecoderReadStatus FLACParser::readCallback(FLAC__byte buffer[],\n                                                       size_t *bytes) {\n  size_t requested = *bytes;\n  ssize_t actual = mDataSource->readAt(mCurrentPos, buffer, requested);\n  if (0 > actual) {\n    *bytes = 0;\n    return FLAC__STREAM_DECODER_READ_STATUS_ABORT;\n  } else if (0 == actual) {\n    *bytes = 0;\n    mEOF = true;\n    return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;\n  } else {\n    assert(actual <= requested);\n    *bytes = actual;\n    mCurrentPos += actual;\n    return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;\n  }\n}\n\nFLAC__StreamDecoderSeekStatus FLACParser::seekCallback(\n    FLAC__uint64 absolute_byte_offset) {\n  mCurrentPos = absolute_byte_offset;\n  mEOF = false;\n  return FLAC__STREAM_DECODER_SEEK_STATUS_OK;\n}\n\nFLAC__StreamDecoderTellStatus FLACParser::tellCallback(\n    FLAC__uint64 *absolute_byte_offset) {\n  *absolute_byte_offset = mCurrentPos;\n  return FLAC__STREAM_DECODER_TELL_STATUS_OK;\n}\n\nFLAC__StreamDecoderLengthStatus FLACParser::lengthCallback(\n    FLAC__uint64 *stream_length) {\n  return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED;\n}\n\nFLAC__bool FLACParser::eofCallback() { return mEOF; }\n\nFLAC__StreamDecoderWriteStatus FLACParser::writeCallback(\n    const FLAC__Frame *frame, const FLAC__int32 *const buffer[]) {\n  if (mWriteRequested) {\n    mWriteRequested = false;\n    // FLAC parser doesn't free or realloc buffer until next frame or finish\n    mWriteHeader = frame->header;\n    mWriteBuffer = buffer;\n    mWriteCompleted = true;\n    return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;\n  } else {\n    return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;\n  }\n}\n\nvoid FLACParser::metadataCallback(const FLAC__StreamMetadata *metadata) {\n  switch (metadata->type) {\n    case FLAC__METADATA_TYPE_STREAMINFO:\n      if (!mStreamInfoValid) {\n        mStreamInfo = metadata->data.stream_info;\n        mStreamInfoValid = true;\n      } else {\n        break;\n      }\n      break;\n    case FLAC__METADATA_TYPE_SEEKTABLE:\n      mSeekTable = &metadata->data.seek_table;\n      break;\n    case FLAC__METADATA_TYPE_VORBIS_COMMENT:\n      if (!mVorbisCommentsValid) {\n        FLAC__StreamMetadata_VorbisComment vorbisComment =\n            metadata->data.vorbis_comment;\n        for (FLAC__uint32 i = 0; i < vorbisComment.num_comments; ++i) {\n          FLAC__StreamMetadata_VorbisComment_Entry vorbisCommentEntry =\n              vorbisComment.comments[i];\n          if (vorbisCommentEntry.entry != NULL) {\n            std::string comment(\n                reinterpret_cast<char *>(vorbisCommentEntry.entry),\n                vorbisCommentEntry.length);\n            mVorbisComments.push_back(comment);\n          }\n        }\n        mVorbisCommentsValid = true;\n      } else {\n        break;\n      }\n      break;\n    case FLAC__METADATA_TYPE_PICTURE: {\n      const FLAC__StreamMetadata_Picture *parsedPicture =\n          &metadata->data.picture;\n      FlacPicture picture;\n      picture.mimeType.assign(std::string(parsedPicture->mime_type));\n      picture.description.assign(\n          std::string((char *)parsedPicture->description));\n      picture.data.assign(parsedPicture->data,\n                          parsedPicture->data + parsedPicture->data_length);\n      picture.width = parsedPicture->width;\n      picture.height = parsedPicture->height;\n      picture.depth = parsedPicture->depth;\n      picture.colors = parsedPicture->colors;\n      picture.type = parsedPicture->type;\n      mPictures.push_back(picture);\n      mPicturesValid = true;\n      break;\n    }\n    default:\n      break;\n  }\n}\n\nvoid FLACParser::errorCallback(FLAC__StreamDecoderErrorStatus status) {\n  mErrorStatus = status;\n}\n\n// Copy samples from FLAC native 32-bit non-interleaved to\n// correct bit-depth (non-zero padded), interleaved.\n// These are candidates for optimization if needed.\nstatic void copyToByteArrayBigEndian(int8_t *dst, const int *const *src,\n                                     unsigned bytesPerSample, unsigned nSamples,\n                                     unsigned nChannels) {\n  for (unsigned i = 0; i < nSamples; ++i) {\n    for (unsigned c = 0; c < nChannels; ++c) {\n      // point to the first byte of the source address\n      // and then skip the first few bytes (most significant bytes)\n      // depending on the bit depth\n      const int8_t *byteSrc =\n          reinterpret_cast<const int8_t *>(&src[c][i]) + 4 - bytesPerSample;\n      memcpy(dst, byteSrc, bytesPerSample);\n      dst = dst + bytesPerSample;\n    }\n  }\n}\n\nstatic void copyToByteArrayLittleEndian(int8_t *dst, const int *const *src,\n                                        unsigned bytesPerSample,\n                                        unsigned nSamples, unsigned nChannels) {\n  for (unsigned i = 0; i < nSamples; ++i) {\n    for (unsigned c = 0; c < nChannels; ++c) {\n      // with little endian, the most significant bytes will be at the end\n      // copy the bytes in little endian will remove the most significant byte\n      // so we are good here.\n      memcpy(dst, &(src[c][i]), bytesPerSample);\n      dst = dst + bytesPerSample;\n    }\n  }\n}\n\nstatic void copyTrespass(int8_t * /* dst */, const int *const * /* src */,\n                         unsigned /* bytesPerSample */, unsigned /* nSamples */,\n                         unsigned /* nChannels */) {\n  ;\n}\n\n// FLACParser\n\nFLACParser::FLACParser(DataSource *source)\n    : mDataSource(source),\n      mCopy(copyTrespass),\n      mDecoder(NULL),\n      mCurrentPos(0LL),\n      mEOF(false),\n      mStreamInfoValid(false),\n      mSeekTable(NULL),\n      firstFrameOffset(0LL),\n      mVorbisCommentsValid(false),\n      mPicturesValid(false),\n      mWriteRequested(false),\n      mWriteCompleted(false),\n      mWriteBuffer(NULL),\n      mErrorStatus((FLAC__StreamDecoderErrorStatus)-1) {\n  memset(&mStreamInfo, 0, sizeof(mStreamInfo));\n  memset(&mWriteHeader, 0, sizeof(mWriteHeader));\n}\n\nFLACParser::~FLACParser() {\n  if (mDecoder != NULL) {\n    FLAC__stream_decoder_delete(mDecoder);\n    mDecoder = NULL;\n  }\n}\n\nbool FLACParser::init() {\n  // setup libFLAC parser\n  mDecoder = FLAC__stream_decoder_new();\n  if (mDecoder == NULL) {\n    // The new should succeed, since probably all it does is a malloc\n    // that always succeeds in Android.  But to avoid dependence on the\n    // libFLAC internals, we check and log here.\n    return false;\n  }\n  FLAC__stream_decoder_set_md5_checking(mDecoder, false);\n  FLAC__stream_decoder_set_metadata_ignore_all(mDecoder);\n  FLAC__stream_decoder_set_metadata_respond(mDecoder,\n                                            FLAC__METADATA_TYPE_STREAMINFO);\n  FLAC__stream_decoder_set_metadata_respond(mDecoder,\n                                            FLAC__METADATA_TYPE_SEEKTABLE);\n  FLAC__stream_decoder_set_metadata_respond(mDecoder,\n                                            FLAC__METADATA_TYPE_VORBIS_COMMENT);\n  FLAC__stream_decoder_set_metadata_respond(mDecoder,\n                                            FLAC__METADATA_TYPE_PICTURE);\n  FLAC__StreamDecoderInitStatus initStatus;\n  initStatus = FLAC__stream_decoder_init_stream(\n      mDecoder, read_callback, seek_callback, tell_callback, length_callback,\n      eof_callback, write_callback, metadata_callback, error_callback,\n      reinterpret_cast<void *>(this));\n  if (initStatus != FLAC__STREAM_DECODER_INIT_STATUS_OK) {\n    // A failure here probably indicates a programming error and so is\n    // unlikely to happen. But we check and log here similarly to above.\n    return false;\n  }\n  return true;\n}\n\nbool FLACParser::decodeMetadata() {\n  // parse all metadata\n  if (!FLAC__stream_decoder_process_until_end_of_metadata(mDecoder)) {\n    return false;\n  }\n  // store first frame offset\n  FLAC__stream_decoder_get_decode_position(mDecoder, &firstFrameOffset);\n\n  if (mStreamInfoValid) {\n    // check channel count\n    if (getChannels() == 0 || getChannels() > 8) {\n      return false;\n    }\n    // check bit depth\n    switch (getBitsPerSample()) {\n      case 8:\n      case 16:\n      case 24:\n      case 32:\n        break;\n      default:\n        return false;\n    }\n    // configure the appropriate copy function based on device endianness.\n    if (isBigEndian()) {\n      mCopy = copyToByteArrayBigEndian;\n    } else {\n      mCopy = copyToByteArrayLittleEndian;\n    }\n  } else {\n    return false;\n  }\n  return true;\n}\n\nsize_t FLACParser::readBuffer(void *output, size_t output_size) {\n  mWriteRequested = true;\n  mWriteCompleted = false;\n\n  if (!FLAC__stream_decoder_process_single(mDecoder)) {\n    return -1;\n  }\n  if (!mWriteCompleted) {\n    if (FLAC__stream_decoder_get_state(mDecoder) !=\n        FLAC__STREAM_DECODER_END_OF_STREAM) {\n    }\n    return -1;\n  }\n\n  // verify that block header keeps the promises made by STREAMINFO\n  unsigned blocksize = mWriteHeader.blocksize;\n  if (blocksize == 0 || blocksize > getMaxBlockSize()) {\n    return -1;\n  }\n  if (mWriteHeader.sample_rate != getSampleRate() ||\n      mWriteHeader.channels != getChannels() ||\n      mWriteHeader.bits_per_sample != getBitsPerSample()) {\n    return -1;\n  }\n\n  unsigned bytesPerSample = getBitsPerSample() >> 3;\n  size_t bufferSize = blocksize * getChannels() * bytesPerSample;\n  if (bufferSize > output_size) {\n    return -1;\n  }\n\n  // copy PCM from FLAC write buffer to our media buffer, with interleaving.\n  (*mCopy)(reinterpret_cast<int8_t *>(output), mWriteBuffer, bytesPerSample,\n           blocksize, getChannels());\n\n  // fill in buffer metadata\n  CHECK(mWriteHeader.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER);\n\n  return bufferSize;\n}\n\nbool FLACParser::getSeekPositions(int64_t timeUs,\n                                  std::array<int64_t, 4> &result) {\n  if (!mSeekTable) {\n    return false;\n  }\n\n  unsigned sampleRate = getSampleRate();\n  int64_t totalSamples = getTotalSamples();\n  int64_t targetSampleNumber = (timeUs * sampleRate) / 1000000LL;\n  if (targetSampleNumber >= totalSamples) {\n    targetSampleNumber = totalSamples - 1;\n  }\n\n  FLAC__StreamMetadata_SeekPoint* points = mSeekTable->points;\n  unsigned length = mSeekTable->num_points;\n\n  for (unsigned i = length; i != 0; i--) {\n    int64_t sampleNumber = points[i - 1].sample_number;\n    if (sampleNumber == -1) {  // placeholder\n      continue;\n    }\n    if (sampleNumber <= targetSampleNumber) {\n      result[0] = (sampleNumber * 1000000LL) / sampleRate;\n      result[1] = firstFrameOffset + points[i - 1].stream_offset;\n      if (sampleNumber == targetSampleNumber || i >= length ||\n          points[i].sample_number == -1) {  // placeholder\n        // exact seek, or no following non-placeholder seek point\n        result[2] = result[0];\n        result[3] = result[1];\n      } else {\n        result[2] = (points[i].sample_number * 1000000LL) / sampleRate;\n        result[3] = firstFrameOffset + points[i].stream_offset;\n      }\n      return true;\n    }\n  }\n  result[0] = 0;\n  result[1] = firstFrameOffset;\n  result[2] = 0;\n  result[3] = firstFrameOffset;\n  return true;\n}\n\nnamespace {\n\n  class FuzzDataSource : public DataSource {\n    const uint8_t *data_;\n    size_t size_;\n\n   public:\n    FuzzDataSource(const uint8_t *data, size_t size) {\n      data_ = data;\n      size_ = size;\n    }\n\n    ssize_t readAt(off64_t offset, void *const data, size_t size) {\n      if (offset > size_)\n        return -1;\n      size_t remaining = size_ - offset;\n      if (remaining < size)\n        size = remaining;\n      memcpy(data, data_ + offset, size);\n      return size;\n    }\n  };\n\n}  // namespace\n\n// Fuzz FLAC format and instrument the result as exoplayer JNI would:\n// https://github.com/google/ExoPlayer/blob/release-v2/extensions/flac/src/main/jni/\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzDataSource source(data, size);\n  FLACParser parser(&source);\n\n  // Early parsing\n  if (!parser.init() || !parser.decodeMetadata())\n    return 0;\n\n  auto streamInfo = parser.getStreamInfo();\n\n  // Similar implementation than ExoPlayer\n  int buffer_size = streamInfo.max_blocksize * streamInfo.channels * 2;\n  assert(buffer_size >= 0);  // Not expected\n  auto buffer = new uint8_t[buffer_size];\n\n  while (parser.readBuffer(buffer, buffer_size) < ((size_t)-1));\n  delete[] buffer;\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/flac/project.yaml",
    "content": "homepage: \"https://xiph.org/flac/\"\nlanguage: c++\nprimary_contact: \"mvanb1@gmail.com\"\nauto_ccs:\n - \"erik.de.castro.lopo@gmail.com\"\nvendor_ccs:\n - \"media-alerts@mozilla.com\"\n - \"twsmith@mozilla.com\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n - x86_64\n - i386\ncoverage_extra_args: -ignore-filename-regex=/usr/lib/jvm/.*\nmain_repo: 'https://github.com/xiph/flac.git'\n"
  },
  {
    "path": "projects/flask/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y libffi-dev\nRUN python3 -m pip install --upgrade pip\nRUN git clone https://github.com/pallets/flask\nRUN git clone https://github.com/pallets/werkzeug\nRUN git clone https://github.com/corydolphin/flask-cors\nRUN git clone --depth=1 https://github.com/google/fuzzing/\nRUN pip3 install markupsafe itsdangerous jinja2\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/flask/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build Werkzeug from latest\ncd $SRC/werkzeug\npip3 install .\n\n# Build flask\ncd $SRC/flask\npython3 -m pip install importlib_metadata\npip3 install .\n\n# Build flask-cors\ncd $SRC/flask-cors\npip3 install requests\npip3 install .\n\n# Build flask-cors fuzzers\ncd $SRC/flask-cors\ncompile_python_fuzzer $SRC/cors_fuzz_flask.py\n\n# Build flask fuzzers\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\n# Copy dictionaries out\ncp $SRC/fuzzing/dictionaries/http.dict $OUT/fuzz_werkzeug_http.dict\n"
  },
  {
    "path": "projects/flask/cors_fuzz_flask.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport argparse\nimport requests\nimport threading\nimport time\nimport atheris\n\nwith atheris.instrument_imports():\n  from flask import Flask\n  from flask_cors import CORS\n  from flask import request\n\napp = Flask(__name__)\nCORS(app)\noutput = \"\"\nruns_left = None\n\n@app.errorhandler(500)\ndef internal_error(error):\n  print(\n    \"Catching exception error from flask. The exception is likely \"\n    \"printed already right above this message in the log.\"\n  )\n  return str(error), 500\n\n@app.route(\"/\")\ndef fuzz_echo():\n  global output\n  return output\n\ndef shutdown_server():\n  func = request.environ.get('werkzeug.server.shutdown')\n  if func is None:\n    raise RuntimeError('Not running with the Werkzeug Server')\n  func()\n\n# We use this to force a shutdown of the app. This is to\n# have a clean exit when a crash is found.\n@app.route('/shutdown')\ndef shutdown():\n  shutdown_server()\n  return \"Server shutdown\"\n\nclass ServerThread(threading.Thread):\n  def __init__(self):\n    threading.Thread.__init__(self)\n\n  def run(self):\n    global app\n    app.run()\n\ndef TestOneInput(data):\n  global output, runs_left\n  output = data\n\n  # We use runs_left to ensure proper exit in coverage.\n  if runs_left != None:\n      runs_left -= 1\n      # 5 may be too much here, as we will cut off some inputs. However,\n      # this is to guarantee exit for now.\n      if runs_left < 5:\n        try:\n          requests.get('http://127.0.0.1:5000/shutdown', timeout=1.02)\n        except Exception:\n          None\n        return\n\n\n  try:\n    r = requests.get('http://127.0.0.1:5000', timeout=0.5)\n    if r.status_code == 500:\n        raise Exception(r.text)\n  except requests.exceptions.ConnectionError:\n    None\n  except Exception as e:\n    # Every other exception is raised, but we need to shutdown\n    # the server before raising it.\n    requests.get('http://127.0.0.1:5000/shutdown', timeout=1.02)\n    raise e\n\n\ndef get_run_count_if_there():\n  parser = argparse.ArgumentParser()\n  parser.add_argument(\"-atheris_runs\", required=False, default=None)\n  args, _ = parser.parse_known_args()\n  if args.atheris_runs is None:\n    print(\"None args\")\n    return None\n  print(f\"Got a fixed set of runs {args.atheris_runs}\")\n  return args.atheris_runs\n\n\ndef main():\n  global runs_left\n  max_runs = get_run_count_if_there()\n  if max_runs is not None:\n    runs_left = int(max_runs)\n\n  t1 = ServerThread()\n  t1.start()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/flask/fuzz_json.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys, os\n\nwith atheris.instrument_imports():\n  import flask\n  from flask import Flask as _Flask\n  from werkzeug.http import parse_set_header\n\n\nclass FuzzFlask(_Flask):\n  testing = True\n  secret_key = \"fuzz test key\"\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  app = FuzzFlask(\"flask_test\", root_path=os.path.dirname(__file__))\n  app.config[\"DEBUG\"] = True\n  app.config[\"TRAP_BAD_REQUEST_ERRORS\"] = False\n\n  @app.route(\"/json\", methods=[\"POST\"])\n  def post_json():\n    flask.request.get_json()\n    return None\n\n  parse_set_header(fdp.ConsumeUnicode(fdp.ConsumeIntInRange(0, 512)))\n  \n  client = app.test_client()\n\n  try:\n    app.add_url_rule(\n      fdp.ConsumeUnicode(fdp.ConsumeIntInRange(0, 512)),\n      endpoint = \"randomendpoint\"\n    )\n  except ValueError:\n    None\n\n  try:\n    client.post(\n      \"/json\",\n      data=fdp.ConsumeUnicode(fdp.ConsumeIntInRange(0, 512)),\n      content_type=\"application/json\"\n    )\n  except (TypeError, UnicodeEncodeError):\n    None\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/flask/fuzz_werkzeug_formparser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport io\nimport sys\n\nwith atheris.instrument_imports():\n  from werkzeug.formparser import FormDataParser\n  from werkzeug.formparser import MultiPartParser\n\ndef TestOneInput(data):\n  parser = FormDataParser()\n  parser.parse(io.BytesIO(data), \"multipart/form-data\", 0)\n  parser.parse(io.BytesIO(data), \"application/x-url-encoded\", 0)\n  parser.parse(io.BytesIO(data), \"application/x-www-form-urlencoded\", 0)\n\n  multiparser = MultiPartParser(len(data))\n  try:\n    multiparser.parse(io.BytesIO(data), b\"\", len(data)) \n  except ValueError as e:\n    if \"Invalid form-data\" in str(e):\n      return\n    raise e\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/flask/fuzz_werkzeug_http.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  import werkzeug.http as whttp\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    whttp.parse_content_range_header(fdp.ConsumeUnicode(100))\n    whttp.parse_range_header(fdp.ConsumeUnicode(100))\n    whttp.parse_set_header(fdp.ConsumeUnicode(100))\n    whttp.parse_etags(fdp.ConsumeUnicode(100))\n    whttp.parse_if_range_header(fdp.ConsumeUnicode(100))\n    whttp.parse_dict_header(fdp.ConsumeUnicode(100))\n  except ValueError as e:\n    if \"Bad range provided\" in str(e):\n      # https://github.com/pallets/werkzeug/blob/main/src/werkzeug/datastructures.py#L2580\n      # https://github.com/pallets/werkzeug/blob/main/src/werkzeug/datastructures.py#L2596\n      pass\n    else:\n      raise e\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/flask/fuzz_werkzeug_url.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    import werkzeug\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        werkzeug.urls.iri_to_uri(fdp.ConsumeUnicode(30))  #\n    except UnicodeEncodeError as e2:\n        return\n    except ValueError as e:\n        if not \"IPv6\" in str(e):\n            raise e\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/flask/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pallets/flask\nlanguage: python\nmain_repo: https://github.com/pallets/flask\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/flask-jwt-extended/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/vimalloc/flask-jwt-extended flask-jwt-extended\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/flask-jwt-extended\n"
  },
  {
    "path": "projects/flask-jwt-extended/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/flask-jwt-extended/fuzz_jwt.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport jwt\nimport atheris\n\nfrom flask import Flask\nfrom flask import jsonify\n\nfrom flask_jwt_extended import create_access_token\nfrom flask_jwt_extended import decode_token\nfrom flask_jwt_extended import jwt_required\nfrom flask_jwt_extended import JWTManager\nfrom flask_jwt_extended import verify_jwt_in_request\n\n\ndef get_app(key):\n  \"\"\"Helper method to get a flask app.\"\"\"\n  app = Flask(__name__)\n  app.config[\"JWT_SECRET_KEY\"] = key if key != \"\" else \"randomfuzzkey\"\n  app.config[\"JWT_TOKEN_LOCATION\"] = [\"query_string\"]\n  JWTManager(app)\n\n  @app.route(\"/protected\", methods=[\"GET\"])\n  @jwt_required()\n  def access_protected():\n    return jsonify(foo=\"bar\")\n\n  return app\n\n\ndef test_encodings(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  app = get_app(fdp.ConsumeUnicodeNoSurrogates(64))\n  with app.test_request_context():\n    token = create_access_token(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    decoded_token = decode_token(token)\n\n\ndef test_get(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  app = get_app(fdp.ConsumeUnicodeNoSurrogates(64))\n\n  @app.route(\"/custom\", methods=[\"GET\"])\n  def custom():\n    jwt_header, jwt_data = verify_jwt_in_request(optional=fdp.ConsumeBool(),\n                                                 fresh=fdp.ConsumeBool(),\n                                                 refresh=fdp.ConsumeBool())\n    if fdp.ConsumeBool():\n      return jsonify(foo=fdp.ConsumeUnicodeNoSurrogates(256))\n    else:\n      return {\n          fdp.ConsumeUnicodeNoSurrogates(124):\n              fdp.ConsumeUnicodeNoSurrogates(124)\n      }\n\n  url = \"/custom\"\n  test_client = app.test_client()\n  with app.test_request_context():\n    try:\n      token = create_access_token(fdp.ConsumeUnicodeNoSurrogates(256))\n    except jwt.exceptions.InvalidKeyError:\n      return\n\n  headers = {\"Authorization\": \"Bearer {}\".format(token)}\n  response = test_client.get(url, headers=headers)\n\n  # Get the json return from /custom\n  response.get_json()\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  if fdp.ConsumeBool():\n    test_get(data)\n  else:\n    test_encodings(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/flask-jwt-extended/project.yaml",
    "content": "homepage: https://github.com/vimalloc/flask-jwt-extended\nmain_repo: https://github.com/vimalloc/flask-jwt-extended\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/flask-restx/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip && pip3 install werkzeug==2.1.2\nRUN git clone --depth 1 https://github.com/python-restx/flask-restx flask-restx\nWORKDIR flask-restx\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/flask-restx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed -i \"s/werkzeug !=2.0.0/werkzeug ==2.1.2/g\" ./requirements/install.pip\ncd $SRC/flask-restx\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/flask-restx/fuzz_reqparse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport traceback\n\nfrom werkzeug.wrappers import Request\nimport flask\nfrom flask_restx.reqparse import RequestParser\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        req = Request.from_values(fdp.ConsumeUnicodeNoSurrogates(1024))\n    except:\n        # We don't care about errors in werkzeug Request.\n        return\n\n    app = flask.Flask(\"fuzz\")\n    try:\n        with app.app_context():\n            parser = RequestParser()\n            parser.add_argument(\"ex1\")\n            parser.add_argument(\"ex2\")\n            # Parse arbitrary req\n            parser.parse_args(req)\n    except Exception as e2:\n        tb = traceback.format_exc()\n        # We don't care about werkzeug errors\n        if \"werkzeug\" in str(tb):\n            pass\n        else:\n            raise e2\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/flask-restx/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/python-restx/flask-restx\nlanguage: python\nmain_repo: https://github.com/python-restx/flask-restx\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/flask-wtf/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip flask wtforms babel flask_babel\nRUN git clone https://github.com/wtforms/flask-wtf flask-wtf\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/flask-wtf\n"
  },
  {
    "path": "projects/flask-wtf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/flask-wtf/fuzz_flask_wtf.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom flask import Flask\nfrom flask_wtf.csrf import validate_csrf, generate_csrf\nfrom flask_wtf.i18n import translations\nfrom wtforms import ValidationError\n\n\ndef get_app(fdp):\n  \"\"\"Helper method to get a flask app.\"\"\"\n  app = Flask(__name__)\n  key1 = fdp.ConsumeUnicodeNoSurrogates(124)\n  key2 = fdp.ConsumeUnicodeNoSurrogates(124)\n  app.secret_key = key1 if key1 != \"\" else \"random key\"\n  app.config[\"WTF_CSRF_SECRET_KEY\"] = key2 if key2 != \"\" else \"random key 2\"\n  return app\n\n\ndef fuzz_i18n(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  translations.gettext(fdp.ConsumeUnicodeNoSurrogates(124))\n  translations.ngettext(fdp.ConsumeUnicodeNoSurrogates(124),\n                        fdp.ConsumeUnicodeNoSurrogates(124), 2)\n\n\ndef fuzz_csrf(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  app = get_app(fdp)\n  with app.test_request_context():\n    try:\n      validate_csrf(\n          generate_csrf(secret_key=fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n                        token_key=fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))))\n    except ValidationError:\n      pass\n\n\ndef TestOneInput(data):\n  fuzz_i18n(data)\n  fuzz_csrf(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/flask-wtf/project.yaml",
    "content": "homepage: https://github.com/wtforms/flask-wtf/\nmain_repo: https://github.com/wtforms/flask-wtf/\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/flatbuffers/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone https://github.com/google/flatbuffers\n\nWORKDIR $SRC/\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/flatbuffers/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build fuzzer only\ncd $SRC/flatbuffers\nmkdir build\ncd build\ncmake -DOSS_FUZZ:BOOL=ON -G \"Unix Makefiles\" ../tests/fuzzer\nmake\n\ncp ../tests/fuzzer/*.dict $OUT/\ncp *.bfbs $OUT/\ncp *_fuzzer $OUT/\n\n# Build unit test\nmkdir $SRC/flatbuffers/build-tests\ncd $SRC/flatbuffers/build-tests\ncmake -DFLATBUFFERS_BUILD_FLATC=ON -DFLATBUFFERS_BUILD_TESTS=ON ..\nmake flattests -j$(nproc)\n"
  },
  {
    "path": "projects/flatbuffers/project.yaml",
    "content": "homepage: \"https://github.com/google/flatbuffers\"\nlanguage: c++\nprimary_contact: \"derekbailey@google.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"vglavnyy@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/google/flatbuffers'\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/flatbuffers/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir $SRC/flatbuffers/build-tests -j$(nproc)\n"
  },
  {
    "path": "projects/flate2-rs/Dockerfile",
    "content": "# Copyright 2021 Google LL\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth 1 https://github.com/rust-lang/flate2-rs\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/flate2-rs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/flate2-rs\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_gz_roundtrip $OUT/fuzz_gz_roundtrip\n"
  },
  {
    "path": "projects/flate2-rs/project.yaml",
    "content": "homepage: \"https://github.com/rust-lang/flate2-rs\"\nmain_repo: \"https://github.com/rust-lang/flate2-rs\"\nprimary_contact: \"david@adalogics.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"alex@alexcrichton.com\"\n"
  },
  {
    "path": "projects/flex/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool m4 \\\n                                         gettext help2man bison autopoint  \\\n                                         lzip texinfo texlive flex\nRUN git clone --depth 1 https://github.com/westes/flex flex\nWORKDIR flex\nCOPY build.sh *.c *.diff *.options $SRC/\n"
  },
  {
    "path": "projects/flex/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n./autogen.sh\n./configure\nmake V=1\n\ngit apply $SRC/flex-patch.diff\ncd src\n$CC $CFLAGS -c main.c -DM4=2 -o main.o\ncd ../\n\n# Remove some object files we dont need. This is needed because we will link to\n# all othero bject files in the src folder.\nmv ./src/stage1*.o /tmp/ || true\nmv ./src/libmain.o /tmp/ || true\nmv ./src/flex-main.o /tmp/ || true\nmv ./src/libyywrap.o /tmp/ || true\n\n$CC $CFLAGS -c $SRC/fuzz-scanopt.c -I$SRC/flex/src\n$CC $CFLAGS -c src/scan.c -I$SRC/flex/src\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./fuzz-scanopt.o ./src/*.o -o $OUT/fuzz-scanopt scan.o\n\n$CC $CFLAGS -c $SRC/fuzz-main.c -I$SRC/flex/src\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./fuzz-main.o ./src/*.o -o $OUT/fuzz-main scan.o\n\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/flex/flex-patch.diff",
    "content": "diff --git a/src/main.c b/src/main.c\nindex eb2c09f..bab11db 100644\n--- a/src/main.c\n+++ b/src/main.c\n@@ -38,7 +38,7 @@\n #include \"tables.h\"\n #include \"parse.h\"\n \n-static char flex_version[] = FLEX_VERSION;\n+static char flex_version[] =\"ran\";// FLEX_VERSION;\n \n /* declare functions that have forward references */\n \n@@ -144,17 +144,18 @@ int flex_main (int argc, char *argv[])\n \t\t\tfflush(stdout);\n \t\t\tfclose(stdout);\n \t\t}\n+\t\treturn 0;\n+\t\t/*\n \t\twhile (wait(&child_status) > 0){\n \t\t\tif (!WIFEXITED (child_status)\n \t\t\t    || WEXITSTATUS (child_status) != 0){\n-\t\t\t\t/* report an error of a child\n-\t\t\t\t */\n \t\t\t\tif( exit_status <= 1 )\n \t\t\t\t\texit_status = 2;\n \n \t\t\t}\n \t\t}\n \t\treturn exit_status - 1;\n+\t\t*/\n \t}\n \n \tflexinit (argc, argv);\n@@ -271,7 +272,7 @@ int flex_main (int argc, char *argv[])\n }\n \n /* Wrapper around flex_main, so flex_main can be built as a library. */\n-int main (int argc, char *argv[])\n+int main2 (int argc, char *argv[])\n {\n #if defined(ENABLE_NLS) && ENABLE_NLS\n #if HAVE_LOCALE_H\n@@ -293,7 +294,7 @@ void initialize_output_filters(void)\n \n \toutput_chain = filter_create_int(NULL, filter_tee_header, env.headerfilename);\n \tif ( !(m4 = getenv(\"M4\"))) {\n-\t\tm4 = M4;\n+\t\tm4 = NULL;\n \t}\n \tfilter_create_ext(output_chain, m4, \"-P\", (char *) 0);\n \tfilter_create_int(output_chain, filter_fix_linedirs, NULL);\n"
  },
  {
    "path": "projects/flex/fuzz-main.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"flexdef.h\"\n#include \"options.h\"\n#include \"scanopt.h\"\n\nchar *my_argv[3];\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  my_argv[0] = \"/tmp/fakefuzzer\";\n  my_argv[1] = filename;\n  my_argv[2] = NULL;\n\n  flex_main(2, my_argv);\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/flex/fuzz-main.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/flex/fuzz-scanopt.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"flexdef.h\"\n#include \"options.h\"\n#include \"scanopt.h\"\n\nchar *my_argv[4];\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 24) {\n    return 0;\n  }\n  char *opt_fuzz = malloc(24);\n\n  memcpy(opt_fuzz, data, 23);\n  opt_fuzz[23] = 0;\n  data += 23;\n  size -= 23;\n\n  char *new_str = (char *)malloc(size + 1);\n  if (new_str == NULL) {\n    return 0;\n  }\n  memcpy(new_str, data, size);\n  new_str[size] = '\\0';\n  my_argv[0] = \"/tmp/fuzz/\";\n  my_argv[1] = opt_fuzz;\n  my_argv[2] = new_str;\n  my_argv[3] = NULL;\n\n  scanopt_t sopt;\n  sopt = scanopt_init(flexopts, 3, my_argv, 0);\n  if (!sopt) {\n    free(new_str);\n    free(opt_fuzz);\n    return 0;\n  }\n  int optind;\n  char *arg;\n  scanopt(sopt, &arg, &optind);\n  scanopt_destroy(sopt);\n\n  free(new_str);\n  free(opt_fuzz);\n  return 0;\n}\n"
  },
  {
    "path": "projects/flex/project.yaml",
    "content": "homepage: \"https://github.com/westes/flex\"\nmain_repo: \"https://github.com/westes/flex\"\nlanguage: c\nvendor_ccs:\n- \"david@adalogics.com\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/fluent-bit/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make cmake flex bison libssl-dev libyaml-dev\nRUN git clone --depth 1 https://github.com/fluent/fluent-bit/ fluent-bit\n\n# Update the libs in fluent-bit to use the latest patches for optimizing fuzzing workflow\nRUN cd $SRC/fluent-bit/lib && \\\n    rm -rf ./ctraces && \\\n    git clone --depth 1 https://github.com/fluent/ctraces ctraces && \\\n    rm -rf ./cmetrics && \\\n    git clone --depth 1 https://github.com/fluent/cmetrics\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/fluent-bit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfind /usr/ -name \"libyaml*.so\" -exec rm {} \\;\nfind /usr/ -name \"libyaml-0*\" -exec rm {} \\;\n\n# For fuzz-introspector, cxclude all functions in the fluent-bit/lib/ directory\nexport FUZZ_INTROSPECTOR_CONFIG=$SRC/fuzz_introspector_exclusion.config\ncat > $FUZZ_INTROSPECTOR_CONFIG <<EOF\nFILES_TO_AVOID\nfluent-bit/lib\nEOF\n\ncd fluent-bit\n\n# Patch files for fuzzing purposes. Only do if they have not already been patched.\nif [ $(grep \"fuzz\" -ic ./lib/msgpack-c/src/zone.c) -eq 0 ]\nthen\n  # Avoid building tests we don't need\n  sed -i 's/prepare_unit_tests(flb/#prepare_unit_tests(flb/g' ./tests/internal/CMakeLists.txt\n  sed -i 's/malloc(/fuzz_malloc(/g' ./lib/msgpack-c/src/zone.c\n  sed -i 's/struct msgpack_zone_chunk {/void *fuzz_malloc(size_t size) {if (size > 0xa00000) return NULL;\\nreturn malloc(size);}\\nstruct msgpack_zone_chunk {/g' ./lib/msgpack-c/src/zone.c\nfi\n\n# Remove the existing build, which makes it more convenient to build \n# fuzzers with multiple sanitizers using the same working directory.\nrm -rf ./build\nmkdir build\ncd build\nexport CFLAGS=\"$CFLAGS -fcommon -DFLB_TESTS_OSSFUZZ=ON\"\nexport CXXFLAGS=\"$CXXFLAGS -fcommon -DFLB_TESTS_OSSFUZZ=ON\"\n\n# Plugins enabled/disabled\nINPUT_PLUGINS=\"-DFLB_IN_COLLECTD=OFF \\\n  -DFLB_IN_CPU=OFF     \\\n  -DFLB_IN_DISK=OFF    \\\n  -DFLB_IN_DOCKER=OFF  \\\n  -DFLB_IN_EXEC=OFF    \\\n  -DFLB_IN_FORWARD=OFF \\\n  -DFLB_IN_HEAD=OFF    \\\n  -DFLB_IN_HEALTH=OFF  \\\n  -DFLB_IN_KMSG=OFF    \\\n  -DFLB_IN_MEM=OFF     \\\n  -DFLB_IN_MQTT=OFF    \\\n  -DFLB_IN_NETIF=OFF   \\\n  -DFLB_IN_PROC=OFF    \\\n  -DFLB_IN_RANDOM=OFF  \\\n  -DFLB_IN_SERIAL=OFF  \\\n  -DFLB_IN_STDIN=OFF   \\\n  -DFLB_IN_SYSLOG=OFF  \\\n  -DFLB_IN_SYSTEMD=OFF \\\n  -DFLB_IN_TAIL=OFF    \\\n  -DFLB_IN_TCP=OFF     \\\n  -DFLB_IN_THERMAL=OFF \\\n  -DFLB_IN_WINLOG=OFF\"\n\nOUTPUT_PLUGINS=\"-DFLB_OUT_AZURE=OFF  \\\n  -DFLB_OUT_BIGQUERY=OFF      \\\n  -DFLB_OUT_COUNTER=OFF       \\\n  -DFLB_OUT_DATADOG=OFF       \\\n  -DFLB_OUT_ES=OFF            \\\n  -DFLB_OUT_FILE=OFF          \\\n  -DFLB_OUT_FLOWCOUNTER=OFF   \\\n  -DFLB_OUT_FORWARD=OFF       \\\n  -DFLB_OUT_GELF=OFF          \\\n  -DFLB_OUT_HTTP=ON           \\\n  -DFLB_OUT_INFLUXDB=OFF      \\\n  -DFLB_OUT_KAFKA=OFF         \\\n  -DFLB_OUT_KAFKA_REST=OFF    \\\n  -DFLB_OUT_LOKI=OFF          \\\n  -DFLB_OUT_NATS=OFF          \\\n  -DFLB_OUT_NRLOGS=OFF        \\\n  -DFLB_OUT_NULL=OFF          \\\n  -DFLB_OUT_PGSQL=OFF         \\\n  -DFLB_OUT_PLOT=OFF          \\\n  -DFLB_OUT_SLACK=OFF         \\\n  -DFLB_OUT_SPLUNK=OFF        \\\n  -DFLB_OUT_STACKDRIVER=OFF   \\\n  -DFLB_OUT_STDOUT=ON         \\\n  -DFLB_OUT_SYSLOG=OFF        \\\n  -DFLB_OUT_TCP=OFF\"\n\nMISC_PLUGINS=\"-DFLB_LUAJIT=OFF \\\n  -DFLB_STREAM_PROCESSOR=OFF\"\n\nFILTER_PLUGINS=\"-DFLB_FILTER_ALTER_SIZE=ON  \\\n  -DFLB_FILTER_AWS=ON              \\\n  -DFLB_FILTER_GREP=ON             \\\n  -DFLB_FILTER_KUBERNETES=ON       \\\n  -DFLB_FILTER_MODIFY=ON           \\\n  -DFLB_FILTER_NEST=ON             \\\n  -DFLB_FILTER_PARSER=ON           \\\n  -DFLB_FILTER_RECORD_MODIFIER=ON  \\\n  -DFLB_FILTER_REWRITE_TAG=ON      \\\n  -DFLB_FILTER_THROTTLE=ON\"\n\nEXTRA_FLAGS=\"-DFLB_BINARY=OFF \\\n  -DFLB_EXAMPLES=OFF \\\n  -DFLB_METRICS=ON   \\\n  -DFLB_DEBUG=ON     \\\n  -DMBEDTLS_FATAL_WARNINGS=OFF \\\n  -DFLB_CONFIG_YAML=ON\"\n\ncmake -DFLB_TESTS_INTERNAL=ON \\\n      -DFLB_TESTS_INTERNAL_FUZZ=ON \\\n      -DFLB_TESTS_OSSFUZZ=ON \\\n      ${EXTRA_FLAGS} \\\n      ${INPUT_PLUGINS} \\\n      ${FILTER_PLUGINS} \\\n      ${MISC_PLUGINS} \\\n      ${OUTPUT_PLUGINS} \\\n      ..\n\nif [[ \"$SANITIZER\" == introspector ]]; then\n  make\nelse\n  make -j$(nproc)\nfi\n\ncp $SRC/fluent-bit/build/bin/*OSSFUZZ ${OUT}/\n\n# Add seeds to config-yaml fuzzer\nmkdir -p $SRC/config_yaml_seeds\ncd $SRC/config_yaml_seeds\nfind $SRC/fluent-bit/tests/internal/data/config_format/yaml -name \"*.yaml\" -exec cp {} . \\;\nzip -rj $OUT/flb-it-fuzz-config_yaml_fuzzer_OSSFUZZ_seed_corpus.zip $SRC/config_yaml_seeds/*\n"
  },
  {
    "path": "projects/fluent-bit/project.yaml",
    "content": "homepage: \"https://github.com/fluent/fluent-bit\"\nprimary_contact: \"edsiper@gmail.com\"\nlanguage: c++\nbase_os_version: ubuntu-24-04\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"wppttt@amazon.com\"\n  - \"zh0512xx@gmail.com\"\n  - \"leonardo@calyptia.com\"\nmain_repo: 'https://github.com/fluent/fluent-bit/'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/fluxcd/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nENV GOPATH=\"${GOPATH:-/root/go}\"\nENV ORG_ROOT=\"${ORG_ROOT:-${GOPATH}/src/github.com/fluxcd}\"\n\nRUN mkdir -p \"${ORG_ROOT}\"\n\n# Flux has its components scattered around multiple repositories due to its architecture. \n# Here we clone all of them. The build process happens as build.sh iterate over each one of them.\nARG REPOSITORIES=\"pkg notification-controller kustomize-controller helm-controller image-reflector-controller source-controller image-automation-controller\"\nRUN for repo in ${REPOSITORIES}; do git clone --depth 1 \"https://github.com/fluxcd/${repo}\" \"${ORG_ROOT}/${repo}\"; done\n\nCOPY build.sh $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/fluxcd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This code improves the use of Go Native by:\n# - Dynamically discovering and building all fuzz tests within the project root path.\n# - Supporting single (during PR checks) or multiple repositories (oss-fuzz).\n# - Enabling execution via CI builds and Makefile targets for each repo.\n\nGOPATH=\"${GOPATH:-/root/go}\"\nORG_ROOT=\"${ORG_ROOT:-${GOPATH}/src/github.com/fluxcd}\"\nPREBUILD_SCRIPT_PATH=\"${PREBUILD_SCRIPT_PATH:-tests/fuzz/oss_fuzz_prebuild.sh}\"\nPOSTBUILD_SCRIPT_PATH=\"${POSTBUILD_SCRIPT_PATH:-tests/fuzz/oss_fuzz_postbuild.sh}\"\n\n# source_prebuild_script sources the prebuild script, which executes project-specific\n# code and exposes environment variables that are needed during the generic build process.\n#\n# Examples of usage may be organising directory structure for embedding\n# files, downloading artifacts or setting environment variables.\nfunction source_prebuild_script(){\n\tif [ -f \"${PREBUILD_SCRIPT_PATH}\" ]; then\n\t\t# shellcheck source=/dev/null\n\t\t. \"${PREBUILD_SCRIPT_PATH}\"\n\tfi\n}\n\n# source_postbuild_script sources the postbuild script, which executes project-specific\n# code and unset environment variables that may break follow-up processes.\nfunction source_postbuild_script(){\n\tif [ -f \"${POSTBUILD_SCRIPT_PATH}\" ]; then\n\t\t# shellcheck source=/dev/null\n\t\t. \"${POSTBUILD_SCRIPT_PATH}\"\n\tfi\n}\n\n# go_native_build_all_fuzzers builds all Go Native fuzz tests defined in modules within\n# the given project dir.\n#\n# Args:\n# \tproject_dir\nfunction go_native_build_all_fuzzers(){\n\tlocal project_path=\"$1\"\n\n\tcd \"${project_path}\"\n\n\tsource_prebuild_script\n\n\tmodules=$(find . -mindepth 1 -maxdepth 4 -type f -name 'go.mod' | cut -c 3- | sed 's|/[^/]*$$||' | sort -u | sed 's;/go.mod;;g' | sed 's;go.mod;.;g')\n\tfor module in ${modules}; do\n\t\tcd \"${project_path}/${module}\"\n\n\t\tlocal test_files\n\t\ttest_files=$(grep -r --include='**_test.go' --files-with-matches 'func Fuzz' . || echo \"\")\n\t\tif [ -z \"${test_files}\" ]; then\n\t\t\tcontinue\n\t\tfi\n\n\t\t# go-118-fuzz-build is required for each module.\n\t\tgo get -u github.com/AdamKorcz/go-118-fuzz-build/testing\n\n\t\t# The go get command above can affect transient dependencies, may lead\n\t\t# to the go.sym to become out of sync, which would cause build to break.\n\t\t# go mod tidy will only work if the current module has a reference\n\t\t# to the above dependency, so we create one.\n\t\tlocal pkgName\n\t\tpkgName=\"$(grep -h '^package ' -- *.go | head -n 1)\"\n\t\tif [ -z \"${test_files}\" ]; then\n\t\t\tpkgName=\"package fuzz\"\n\t\tfi\n\t\t\n\t\tcat <<EOF > dep-placeholder.go\n${pkgName}\n\nimport _ \"github.com/AdamKorcz/go-118-fuzz-build/testing\"\nEOF\n\t\t# With the reference above, this updates go.sum.\n\t\tgo mod tidy\n\n\t\t# Iterate through all Go Fuzz targets, compiling each into a fuzzer.\n\t\tfor file in ${test_files}; do\n\t\t\t# If the subdir is a module, skip this file, as it will be handled\n\t\t\t# at the next iteration of the outer loop. \n\t\t\tif [ -f \"$(dirname \"${file}\")/go.mod\" ]; then\n\t\t\t\tcontinue\n\t\t\tfi\n\n\t\t\ttargets=$(grep -oP 'func \\K(Fuzz\\w*)' \"${file}\")\n\t\t\tfor target_name in ${targets}; do\n\t\t\t\tlocal module_name\n\t\t\t\tlocal fuzzer_name\n\t\t\t\tlocal target_dir\n\n\t\t\t\t# Transform module path into module name (e.g. git/libgit2 to git_libgit2).\n\t\t\t\tmodule_name=\"${module/\\//_}_\"\n\t\t\t\t# If module equal '._', use empty string instead.\n\t\t\t\tmodule_name=\"${module/#%._}\"\n\n\t\t\t\t# Compose fuzzer name based on the lowercase version of the func names.\n\t\t\t\tfuzzer_name=\"${target_name,,}\"\n\t\t\t\t# The module name is added after the fuzz prefix, for better discoverability.\n\t\t\t\tfuzzer_name=\"${target_name/fuzz_/fuzz_${module_name}}\"\n\t\t\t\ttarget_dir=$(dirname \"${file}\")\n\n\t\t\t\techo \"Building ${file}.${target_name} into ${fuzzer_name}\"\n\t\t\t\tcompile_native_go_fuzzer \"${target_dir}\" \"${target_name}\" \"${fuzzer_name}\"\n\t\t\tdone\n\t\tdone\n\tdone\n}\n\nfunction loop_through_org_repositories(){\n\tlocal repos=\"\"\n\trepos=\"$(find \"${ORG_ROOT}\" -type d -mindepth 1 -maxdepth 1)\"\n\tfor repo in ${repos}; do\n\t\tgo_native_build_all_fuzzers \"${repo}\"\n\tdone\n}\n\nfunction main(){\n\t# If SRC is set to a Flux project, only its fuzzers will be built.\n\tif grep -h '^module github.com/fluxcd/' \"${SRC}/go.mod\"; then\n\t\techo \"Building Go Native fuzzers for ${SRC}\"\n\t\tgo_native_build_all_fuzzers \"${SRC}\"\n\t\texit $?\n\tfi\n\t\n\techo \"Going through all repositories in ${ORG_ROOT}\"\n\tloop_through_org_repositories \n}\n\nmain\n"
  },
  {
    "path": "projects/fluxcd/project.yaml",
    "content": "homepage: \"https://fluxcd.io/\"\nmain_repo: \"https://github.com/fluxcd/flux2\"\nprimary_contact: \"cncf-flux-security@lists.cncf.io\"\nauto_ccs :\n  - \"hidde@weave.works\"\n  - \"scott@r6by.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\n  - \"max@e13.dev\"\n  - \"matheuscscp@gmail.com\"\n  - \"stefan.prodan@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/flyway/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone https://github.com/DataGrip/mongo-jdbc-driver\nRUN git clone --depth 1 https://github.com/flyway/flyway flyway\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/flyway/LocationFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport java.util.regex.PatternSyntaxException;\nimport org.flywaydb.core.api.FlywayException;\nimport org.flywaydb.core.api.Location;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-11\n// Heuristic name: jvm-autofuzz-heuristics-11\n// Target method: [org.flywaydb.core.api.Location] public  <init>(java.lang.String)\npublic class LocationFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      new Location(data.consumeRemainingAsString());\n    } catch (FlywayException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/flyway/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\n# Install mongo-jdbc-dependency required byu flyway\ncd mongo-jdbc-driver/\ngit checkout v1.21\n./gradlew clean shadowJar\n$MVN install:install-file \\\n  -Dfile=../mongo-jdbc-driver/build/libs/mongo-jdbc-standalone-1.21.jar \\\n  -DgroupId=com.github.kornilova203 -DartifactId=mongo-jdbc-driver \\\n  -Dversion=1.21 -Dpackaging=jar -DgeneratePom=true\n\n# Buuild flyway\ncd ../flyway\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True dependency:copy-dependencies -fn\n\nJARFILE_LIST=\nfor JARFILE in $(find ./  -name *.jar)\ndo\n  if [[ \"$JARFILE\" == *\"target/\"* ]] || [[ \"$JARFILE\" == *\"build/\"* ]] || [[ \"$JARFILE\" == *\"dist/\"* ]]\n  then\n    if [[ \"$JARFILE\" != *sources.jar ]] && [[ \"$JARFILE\" != *javadoc.jar ]] && [[ \"$JARFILE\" != *tests.jar ]]\n    then\n      cp $JARFILE $OUT/\n      JARFILE_LIST=\"$JARFILE_LIST$(basename $JARFILE) \"\n    fi\n  fi\ndone\n\ncurr_dir=$(pwd)\nrm -rf $OUT/jar_temp\nmkdir $OUT/jar_temp\ncd $OUT/jar_temp\nfor JARFILE in $JARFILE_LIST\ndo\n  jar -xf $OUT/$JARFILE\ndone\ncd $curr_dir\n\nBUILD_CLASSPATH=$JAZZER_API_PATH:$OUT/jar_temp\nRUNTIME_CLASSPATH=\\$this_dir/jar_temp:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/flyway/project.yaml",
    "content": "homepage: https://github.com/flyway/flyway\nmain_repo: https://github.com/flyway/flyway\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n\n"
  },
  {
    "path": "projects/fmt/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN echo \"CXX=$CXX\"\nRUN echo \"CXXFLAGS=$CXXFLAGS\"\nRUN apt-get update && apt-get install -y cmake ninja-build\n\nRUN git clone --depth 1 --branch master \\\n  https://github.com/fmtlib/fmt.git\n\nWORKDIR fmt\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/fmt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#create zip files with initial corpus, taken from version control.\n#for f in $(ls fuzzers/initial_corpus/) ;do\n#  zip -j -r $OUT/fuzzer_${f}_seed_corpus.zip fuzzers/initial_corpus/$f\n#done\n\nmkdir build\ncd build\n\n# use C++ 14 instead of 17, because even if clang is\n# bleeding edge, cmake is old in the oss fuzz image.\n\ncmake .. \\\n-GNinja \\\n-DCMAKE_BUILD_TYPE=Debug \\\n-DCMAKE_CXX_STANDARD=14 \\\n-DFMT_DOC=Off \\\n-DFMT_TEST=On \\\n-DFMT_SAFE_DURATION_CAST=On \\\n-DFMT_FUZZ=On \\\n-DFMT_FUZZ_LINKMAIN=Off \\\n-DFMT_FUZZ_LDFLAGS=$LIB_FUZZING_ENGINE\n\ncmake --build .\n\ncp bin/*fuzzer $OUT\n"
  },
  {
    "path": "projects/fmt/project.yaml",
    "content": "homepage: \"https://github.com/fmtlib/fmt\"\nlanguage: c++\nprimary_contact: \"pauldreikossfuzz@gmail.com\"\nauto_ccs:\n - \"victor.zverovich@gmail.com\"\nmain_repo: 'https://github.com/fmtlib/fmt.git'\n"
  },
  {
    "path": "projects/fmt/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd build\nninja test\n"
  },
  {
    "path": "projects/fontations/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Based on https://google.github.io/oss-fuzz/getting-started/new-project-guide/rust-lang/\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/googlefonts/fontations\nWORKDIR $SRC/fontations\n\nCOPY build.sh $SRC/"
  },
  {
    "path": "projects/fontations/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# To test:\n#   export SRC=/tmp\n#   export OUT=/tmp\n#   git clone --depth 1 https://github.com/googlefonts/fontations /tmp/fontations\n#   rm -rf /tmp/{font_srcs,corpus_tmp}\n#   projects/fontations/build.sh\n\nCLONE_TMP=\"$SRC/font_srcs\"\nCORPUS_TMP=\"$SRC/corpus_tmp\"\nmkdir \"$CLONE_TMP\"\nmkdir \"$CORPUS_TMP\"\n\npushd \"$CLONE_TMP\"\ngit clone --depth 1 https://github.com/unicode-org/text-rendering-tests.git\ngit clone --depth 1 https://github.com/googlefonts/color-fonts.git\ngit clone --depth 1 https://github.com/harfbuzz/harfbuzz.git\nfor d in text-rendering-tests/fonts color-fonts/fonts harfbuzz/test; do\n    find $d -name '*.[ot]t[fc]' -execdir cp {} ${CORPUS_TMP} \\;\ndone\npopd\n\npushd \"$CORPUS_TMP\"\nzip seed_corpus.zip *\npopd\n\ncd $SRC/fontations\n# Add +nightly after cargo if running locally and getting: error: the option `Z` is only accepted on the nightly compiler\ncargo fuzz build -O --debug-assertions\n\n# Based on zip-rs\nRELEASE_DIR=target/x86_64-unknown-linux-gnu/release\nnum_fuzzers=0\nfor fuzzer in $(find $RELEASE_DIR -maxdepth 1 -type f -executable -name 'fuzz_*'  -exec basename {} \\;); do\n    cp -v \"$CORPUS_TMP/seed_corpus.zip\" $(basename $fuzzer)_seed_corpus.zip\n    cp -v \"$RELEASE_DIR/$fuzzer\" $OUT/\n    num_fuzzers=$((num_fuzzers+1))\ndone\n\n# If we found 0 fuzzers something is very wrong\n[[ \"$num_fuzzers\" -gt 0 ]] || { echo \"No fuzzers!\"; exit 1; }"
  },
  {
    "path": "projects/fontations/project.yaml",
    "content": "homepage: \"https://github.com/googlefonts/fontations\"\nlanguage: rust\nprimary_contact: \"rsheeter@google.com\"\nauto_ccs:\n  - \"drott@google.com\"\n  - \"grieger@google.com\"\n  - \"colin.rofls@gmail.com\"\n  - \"cbrokaw@google.com\"\n  - \"clupo@google.com\"\n  - \"behdad.esfahbod@gmail.com\"\n  - \"qxliu@google.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/googlefonts/fontations'"
  },
  {
    "path": "projects/freeimage/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget dos2unix\nRUN svn checkout https://svn.code.sf.net/p/freeimage/svn/ freeimage-svn\nWORKDIR $SRC/freeimage-svn/FreeImage/trunk/\nRUN wget \"https://salsa.debian.org/debian-phototools-team/jxrlib/-/raw/7e12ab1185b347c0edfd893471c055e3ae7830b5/debian/patches/082bb032be1f6c75173bf603252e4f37bfded9fa.patch\" --output-document=$SRC/jxrlib_tmpnam.patch\nCOPY run_tests.sh build.sh $SRC/\nCOPY load_from_memory_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/freeimage/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# b44ExpLogTable.cpp only contains a definition of main().\nsed -i 's/Source\\/OpenEXR\\/IlmImf\\/b44ExpLogTable.cpp//' Makefile.srcs\nsed -i 's/Source\\/LibTIFF4\\/tif_getimage.c/Source\\/LibTIFF4\\/tif_getimage.c Source\\/LibTIFF4\\/tif_hash_set.c/g' ./Makefile.srcs\nexport CXXFLAGS=\"$CXXFLAGS -std=c++14\"  # Avoid C++17 build error\n(\n # Avoid tmpnam link error\n cd Source/LibJXR\n dos2unix ./image/encode/strenc.c\n patch -p1 -i $SRC/jxrlib_tmpnam.patch\n)\nmake LIBRARIES=-lc++ -j$(nproc) -f Makefile.gnu libfreeimage.a\n\nINSTALL_DIR=$PWD\n\ncd $SRC\n\n$CXX $CXXFLAGS -I${INSTALL_DIR}/ -I${INSTALL_DIR}/Source $LIB_FUZZING_ENGINE \\\n  load_from_memory_fuzzer.cc ${INSTALL_DIR}/libfreeimage.a \\\n  -o $OUT/load_from_memory_fuzzer\n\n\n# Build unit testing when it is not coverage or introspector build\n# Temporarily skipping testMemIO and testThumbnail because both of them throws ASAN crash of heap overflow\nif [[ \"$SANITIZER\" != \"introspector\" && \"$SANITIZER\" != \"coverage\" ]]\nthen\n    cd $SRC/freeimage-svn/FreeImage/trunk/TestAPI\n    sed -i 's#testMemIO#//testMemIO#g' MainTestSuite.cpp\n    sed -i 's#testThumbnail#//testThumbnail#g' MainTestSuite.cpp\n    $CXX $CXXFLAGS  -I../Source MainTestSuite.cpp testChannels.cpp testHeaderOnly.cpp testImageType.cpp testJPEG.cpp \\\n        testMPage.cpp testMPageMemory.cpp testMPageStream.cpp testPlugins.cpp testTools.cpp testWrappedBuffer.cpp \\\n        ../libfreeimage.a -fsanitize=$SANITIZER -o testAPI\nfi\n"
  },
  {
    "path": "projects/freeimage/load_from_memory_fuzzer.cc",
    "content": "#include <cstddef>\n#include <cstdint>\n#include <cstdlib>\n#include <vector>\n#include <FreeImage.h>\n\nnamespace {\n\n// Returns true if the format should be attempted to loaded from memory.\nbool SafeToLoadFromMemory(FREE_IMAGE_FORMAT fif) {\n  // For now, just load if it is a BMP. Future heuristics may need to be based\n  // on the expected size in different formats for memory regions to avoid OOMs.\n  return fif == FIF_BMP;\n}\n\n}  // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static bool initialized = false;\n  if (!initialized) {\n    FreeImage_Initialise();\n  }\n\n  if (size > 100 * 1000) {\n    return 0;\n  }\n\n  std::vector<uint8_t> fuzzer_data_vector(data, data + size);\n  FIMEMORY* fiMem = FreeImage_OpenMemory(\n      reinterpret_cast<unsigned char*>(fuzzer_data_vector.data()),\n      fuzzer_data_vector.size());\n\n  FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(fiMem, 0);\n  if (SafeToLoadFromMemory(fif)) {\n    FIBITMAP* fiBitmap = FreeImage_LoadFromMemory(fif, fiMem);\n    FreeImage_Unload(fiBitmap);\n  }\n  FreeImage_CloseMemory(fiMem);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/freeimage/project.yaml",
    "content": "homepage: \"http://freeimage.sourceforge.net/\"\nmain_repo: 'https://svn.code.sf.net/p/freeimage/svn/'\nlanguage: c++\nprimary_contact: \"drolon@infonie.fr\"\n\nsanitizers:\n  - address\n  - undefined\n\nlabels:\n  load_from_memory_fuzzer:\n    - sundew\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/freeimage/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/freeimage-svn/FreeImage/trunk/TestAPI && ./testAPI\n"
  },
  {
    "path": "projects/freeradius/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y gnupg\nRUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BE18FC5A41382202\nRUN echo \"deb http://packages.networkradius.com/extras/ubuntu/focal focal  main\" > /etc/apt/sources.list.d/networkradius-extras.list\nRUN apt-get update && apt-get install -y libtalloc-dev libkqueue-dev libunwind-dev libjson-c-dev\n\n# OpenSSL 3.0\nARG OPENSSL_VERSION=3.0.15\nARG OPENSSL_HASH=23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533\nRUN set -ex \\\n    && curl -s -L -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \\\n    && echo \"${OPENSSL_HASH}  openssl-${OPENSSL_VERSION}.tar.gz\" | sha256sum -c \\\n    && tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \\\n    && cd openssl-${OPENSSL_VERSION} \\\n    && ./Configure linux-x86_64 no-shared no-module --static \"$CFLAGS\" \\\n    && make build_generated \\\n    && make libcrypto.a \\\n    && make install\nENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}\n\nRUN git clone --depth 1 https://github.com/FreeRADIUS/freeradius-server.git\nCOPY build.sh $SRC/\n# COPY patch.diff $SRC\nWORKDIR $SRC/freeradius-server\n"
  },
  {
    "path": "projects/freeradius/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfunction copy_lib\n    {\n    local fuzzer_path=$1\n    local lib=$2\n    cp $(ldd ${fuzzer_path} | grep \"${lib}\" | awk '{ print $3 }') ${OUT}/lib\n    }\n\nmkdir -p $OUT/lib\n\n# git apply --ignore-whitespace $SRC/patch.diff\n# build project\n./configure --enable-fuzzer --enable-coverage --enable-address-sanitizer\n# make tries to compile regular programs as fuzz targets\n# so -i flag ignores these errors\nmake -i -j$(nproc)\nmake -i install\n# use shared libraries\nldconfig\nls ./build/bin/local/fuzzer_* | while read i; do\n    patchelf --set-rpath '$ORIGIN/lib' ${i}\n    copy_lib ${i} libfreeradius\n    copy_lib ${i} talloc\n    copy_lib ${i} kqueue\n    copy_lib ${i} libunwind\n    cp ${i} $OUT/\ndone\ncp -r /usr/local/share/freeradius/dictionary $OUT/dict\n# export FR_DICTIONARY_DIR=/out/dictionary/\n# export FR_LIBRARY_PATH=/out/lib/\n"
  },
  {
    "path": "projects/freeradius/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://freeradius.org\"\nlanguage: c++\nprimary_contact: \"a.cudbardb@gmail.com\"\nauto_ccs:\n- \"adekok@gmail.com\"\n- \"p.antoine@catenacyber.fr\"\n- \"arthur.chan@adalogics.com\"\n- \"david@adalogics.com\"\n- \"adam@adalogics.com\"\nmain_repo: 'https://github.com/FreeRADIUS/freeradius-server.git'\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/freerdp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# See https://github.com/FreeRDP/FreeRDP/wiki/Compilation\n# Install Git and base dependences.\nRUN apt-get update && apt-get install -y devscripts equivs \\\n\tbuild-essential git-core cmake ninja-build pkg-config ccache\n\nRUN git clone --depth 1 https://github.com/FreeRDP/FreeRDP.git\n\nWORKDIR FreeRDP\n\n# Install all dependencies required by the nightly package.\nRUN mk-build-deps --install --tool 'apt-get --yes --no-remove --no-install-recommends' packaging/deb/freerdp-nightly/control\n\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/freerdp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Avoid compilation issue due to some undefined references. They are defined in\n# libc++ and used by Centipede so -lc++ needs to come after centipede's lib.\nif [[ $FUZZING_ENGINE == centipede ]]\nthen\n    sed -i \\\n        '/$ENV{LIB_FUZZING_ENGINE}/a \\ \\ \\ \\ \\ \\ \\ \\ -lc++' \\\n        cmake/ConfigOptions.cmake\nfi\n\ncase $SANITIZER in\n  address) SANITIZERS_ARGS=\"-DWITH_SANITIZE_ADDRESS=ON\" ;;\n  memory) SANITIZERS_ARGS=\"-DWITH_SANITIZE_MEMORY=ON\" ;;\n  *) SANITIZERS_ARGS=\"\" ;;\nesac\n\n: ${LD:=\"${CXX}\"}\n: ${LDFLAGS:=\"${CXXFLAGS}\"}  # to make sure we link with sanitizer runtime\n\ncmake_args=(\n    # clang-15 segfaults on linking binaries when LTO is enabled,\n    # see https://github.com/google/oss-fuzz/pull/10448#issuecomment-1578160436\n    -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF\n\n    $SANITIZERS_ARGS\n\n    -DCMAKE_BUILD_TYPE=Debug\n    -DBUILD_SHARED_LIBS=OFF\n\n    # C compiler\n    -DCMAKE_C_COMPILER=\"${CC}\"\n    -DCMAKE_C_FLAGS=\"${CFLAGS}\"\n\n    # C++ compiler\n    -DCMAKE_CXX_COMPILER=\"${CXX}\"\n    -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\"\n\n    # Linker\n    -DCMAKE_LINKER=\"${LD}\"\n    -DCMAKE_EXE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_MODULE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_SHARED_LINKER_FLAGS=\"${LDFLAGS}\"\n)\n\n# Build the project and fuzzers.\nrm -rf build\ncmake \"${cmake_args[@]}\" -S . -B build -G Ninja -C ci/cmake-preloads/config-oss-fuzz.cmake\ncmake --build build --parallel --target fuzzers\n\nfor f in $(find build/Testing/ -name 'TestFuzz*' -type f);\ndo\n    cp $f $OUT/\ndone\n\n# Build test\nmkdir $SRC/FreeRDP/build-test\ncd $SRC/FreeRDP/build-test\ncmake -DBUILD_TESTING=True ..\nmake\n"
  },
  {
    "path": "projects/freerdp/project.yaml",
    "content": "homepage: \"https://www.freerdp.com/\"\nmain_repo: \"https://github.com/FreeRDP/FreeRDP\"\nlanguage: c\nprimary_contact: \"team@freerdp.com\"\nauto_ccs:\n  - \"freerdpproject@gmail.com\"\n  - \"estetus@gmail.com\"\nbuilds_per_day: 4\nfuzzing_engines:\n  - afl\n  - centipede\n  - honggfuzz\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - x86_64\n"
  },
  {
    "path": "projects/freerdp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build-test --output-on-failure\n"
  },
  {
    "path": "projects/freetype2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update &&  \\\n    apt-get install -y \\\n      autoconf         \\\n      cmake            \\\n      libtool          \\\n      pkg-config       \\\n      make             \\\n      ninja-build\n\n# For run_tests.sh\nRUN python3 -m pip install meson ninja requests\n\n# Get some files for the seed corpus\nADD https://github.com/adobe-fonts/adobe-variable-font-prototype/releases/download/1.001/AdobeVFPrototype.otf $SRC/font-corpus/\nRUN git clone https://github.com/unicode-org/text-rendering-tests.git && cp text-rendering-tests/fonts/* $SRC/font-corpus\n\nRUN git clone --depth 1 https://github.com/freetype/freetype2-testing.git\nWORKDIR freetype2-testing\n\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/freetype2/build.sh",
    "content": "#!/bin/bash -eux\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Tell CMake what fuzzing engine to link:\nexport CMAKE_FUZZING_ENGINE=\"$LIB_FUZZING_ENGINE\"\n\nbash \"fuzzing/scripts/build-fuzzers.sh\"\nbash \"fuzzing/scripts/prepare-oss-fuzz.sh\"\n\n# Rename the `legacy' target to `ftfuzzer' for historical reasons:\nfor f in \"${OUT}/legacy\"*; do\n    mv \"${f}\" \"${f/legacy/ftfuzzer}\"\ndone\n\nzip -ju \"${OUT}/ftfuzzer_seed_corpus.zip\" \"${SRC}/font-corpus/\"*\n"
  },
  {
    "path": "projects/freetype2/project.yaml",
    "content": "homepage: \"https://www.freetype.org/\"\nlanguage: c++\nprimary_contact: \"lemzwerg@gmail.com\"\nauto_ccs:\n  - \"lemzwerg@googlemail.com\"\n  - \"HinTak.Leung@gmail.com\"\n  - \"ewaldhew@gmail.com\"\n  - \"apodtele@gmail.com\"\n  - \"prince.cherusker@gmail.com\"\n  - \"bungeman@chromium.org\"\n  - \"thestig@chromium.org\"\nvendor_ccs:\n  - \"jkew@mozilla.com\"\n  - \"jmuizelaar@mozilla.com\"\n  - \"lsalzman@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/freetype/freetype2-testing.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/freetype2/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\ncd external/freetype2/\npython3 tests/scripts/download-test-fonts.py\n\n# The tests build with meson so we are forced to rebuild with meson here.\n# The harnesses are build with Makefiles.\nmeson setup out -Dtests=enabled\nmeson compile -C out\nmeson test -C out\n"
  },
  {
    "path": "projects/fribidi/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip pkg-config && \\\n    pip3 install meson==0.54.0 ninja\nRUN git clone --depth 1 https://github.com/fribidi/fribidi.git\nWORKDIR fribidi\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/fribidi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# setup\nbuild=$WORK/build\n\n# cleanup\nrm -rf $build\nmkdir -p $build\n\n# Build the library.\nmeson --default-library=static --wrap-mode=nodownload -Ddocs=false \\\n      -Dfuzzer_ldflags=\"$(echo $LIB_FUZZING_ENGINE)\" \\\n      $build \\\n  || (cat build/meson-logs/meson-log.txt && false)\n\n# Build the fuzzers.\nninja -v -j$(nproc) -C $build bin/fribidi-fuzzer\nmv $build/bin/fribidi-fuzzer $OUT/\n\n# Archive and copy to $OUT seed corpus if the build succeeded.\nzip $OUT/fribidi-fuzzer_seed_corpus.zip test/*.{input,reference} test/fuzzing/*\n"
  },
  {
    "path": "projects/fribidi/project.yaml",
    "content": "homepage: \"https://github.com/fribidi/fribidi\"\nlanguage: c\nprimary_contact: \"dov.grobgeld@gmail.com\"\nauto_ccs:\n  - \"behdad.esfahbod@gmail.com\"\n  - \"behdad@gnu.org\"\n  - \"ebrahim@gnu.org\"\n  - \"dr.khaled.hosny@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/fribidi/fribidi.git'\n"
  },
  {
    "path": "projects/fribidi/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmeson test -C $WORK/build\n\n"
  },
  {
    "path": "projects/frr/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y git autoconf automake libtool make \\\n   libreadline-dev texinfo libjson-c-dev pkg-config bison flex python3-pip \\\n   libc-ares-dev python3-dev python3-sphinx build-essential libsystemd-dev \\\n   libsnmp-dev libcap-dev libelf-dev libpcre3-dev libpcre2-dev \\\n   protobuf-c-compiler libprotobuf-c-dev\nRUN git clone -b v2.0.0 https://github.com/CESNET/libyang.git\n\nRUN git clone --depth 1 --branch fuzz https://github.com/FRRouting/frr\n\nRUN git clone --depth 1 https://github.com/qlyoung/corpi\nRUN git clone --depth 1 https://github.com/pytest-dev/pytest\nCOPY build.sh run_tests.sh $SRC/\nWORKDIR $SRC/frr\n"
  },
  {
    "path": "projects/frr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Inherit system packages to support Indexer building.\npython3 -m venv --system-site-packages $SRC/venv\nsource $SRC/venv/bin/activate\npip3 install pytest\n\nfunction copy_lib\n    {\n    local fuzzer_path=$1\n    local lib=$2\n    cp $(ldd ${fuzzer_path} | grep \"${lib}\" | awk '{ print $3 }') ${OUT}/lib/ || true\n    }\n\nmkdir -p $OUT/lib\n\n# build dependency\n(\ncd $SRC/libyang\nmkdir build; cd build\ncmake -DBUILD_SHARED_LIBS=OFF -DENABLE_LYD_PRIV=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr \\\n    -D CMAKE_BUILD_TYPE:String=\"Release\" ..\nmake -j$(nproc)\nmake install\n)\n\n# build project\nexport ASAN_OPTIONS=detect_leaks=0\nexport CFLAGS=\"${CFLAGS} -DFUZZING_OVERRIDE_LLVMFuzzerTestOneInput\"\nexport CXXFLAGS=\"${CXXFLAGS} -DFUZZING_OVERRIDE_LLVMFuzzerTestOneInput\"\n./bootstrap.sh\n./configure --enable-libfuzzer --enable-static --enable-static-bin --sbindir=$SRC/bin\nmake -j$(nproc)\nmake install\ncp ./lib/.libs/libfrr.so.0 $OUT/lib/\ncp $SRC/bin/bgpd $OUT/\ncp $SRC/bin/ospfd $OUT/\ncp $SRC/bin/pimd $OUT/\ncp $SRC/bin/zebra $OUT/\n\n# build corpus\ncd $SRC/corpi\nfind . -type d -maxdepth 1 | while read i; do zip -j $OUT/\"$i\"_seed_corpus.zip \"$i\"/*; done\n\nfind $OUT -maxdepth 1 -type f -executable | while read i; do\n    grep \"LLVMFuzzerTestOneInput\" ${i} > /dev/null 2>&1 || continue\n    patchelf --set-rpath '$ORIGIN/lib' ${i}\n    copy_lib ${i} libpcre2\n    copy_lib ${i} libyang\n    copy_lib ${i} libelf\n    copy_lib ${i} libjson-c\n    copy_lib ${i} libprotobuf-c\ndone\n\npatchelf --remove-needed libpcre2-8.so.0 $OUT/lib/libyang.so.2\n"
  },
  {
    "path": "projects/frr/project.yaml",
    "content": "homepage: \"https://frrouting.org\"\nlanguage: c++\nprimary_contact: \"security@lists.frrouting.org\"\nauto_ccs:\n- \"qlyoung@qlyoung.net\"\n- \"equinox-ossfuzz@diac24.net\"\n- \"menotdonald@gmail.com\"\n- \"mjs.ietf@gmail.com\"\n- \"rwgbsd@gmail.com\"\nfuzzing_engines:\n - libfuzzer\nsanitizers:\n - address\nmain_repo: 'https://github.com/FRRouting/frr'\n"
  },
  {
    "path": "projects/frr/run_tests.sh",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# remove broken tests\n# TODO: Check if these can be fixed\n# or if they fix themselves over time\nexport TMPDIR=/tmp/frr-tests\nmkdir /tmp/frr-tests\nmv tests/bgpd/test_peer_attr.py $TMPDIR/\nmv tests/bgpd/test_mp_attr.py $TMPDIR/\nmv tests/bgpd/test_mpath.py $TMPDIR/\nmv tests/isisd/test_isis_spf.py $TMPDIR/\nmv tests/lib/northbound/test_oper_data.py $TMPDIR/\nmv tests/lib/test_timer_correctness.py $TMPDIR/\nmv tests/lib/test_xref.py $TMPDIR/\nmv tests/lib/cli/test_cli.py $TMPDIR/\nmv tests/ospf6d/test_lsdb.py $TMPDIR/\nmv tests/ospfd/test_ospf_spf.py $TMPDIR/\nmv tests/zebra/test_lm_plugin.py $TMPDIR/\n\nsource $SRC/venv/bin/activate\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# run tests\ntest_output=$(make check)\ntest_exit_code=$?\n\n# restore broken tests\nmv $TMPDIR/test_peer_attr.py tests/bgpd/\nmv $TMPDIR/test_mp_attr.py tests/bgpd/\nmv $TMPDIR/test_mpath.py tests/bgpd/\nmv $TMPDIR/test_isis_spf.py tests/isisd/\nmv $TMPDIR/test_oper_data.py tests/lib/northbound/\nmv $TMPDIR/test_timer_correctness.py tests/lib/\nmv $TMPDIR/test_xref.py tests/lib/\nmv $TMPDIR/test_cli.py tests/lib/cli/\nmv $TMPDIR/test_lsdb.py tests/ospf6d/\nmv $TMPDIR/test_ospf_spf.py tests/ospfd/\nmv $TMPDIR/test_lm_plugin.py tests/zebra/\n\nexit $test_exit_code\n"
  },
  {
    "path": "projects/fsnotify/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/fsnotify/fsnotify\nWORKDIR $SRC/fsnotify\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/fsnotify/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/fsnotify\n\ncp $SRC/fuzz_test.go ./\ncompile_native_go_fuzzer_v2 github.com/fsnotify/fsnotify FuzzInotify FuzzInotify\n"
  },
  {
    "path": "projects/fsnotify/fuzz_test.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage fsnotify\n\nimport (\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc FuzzInotify(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, op1, op2, op3, op4, op5, op6, op7, op8,\n\t\top9, op10, op11, op12, op13, op14, op15, op16 uint8,\n\t\tdata1, data2, data3, data4, data5, data6,\n\t\tdata7, data8 string) {\n\t\tops := []int{int(op1), int(op2), int(op3), int(op4), int(op5),\n\t\t\tint(op6), int(op7), int(op8), int(op8), int(op8),\n\t\t\tint(op9), int(op10), int(op11), int(op12), int(op13),\n\t\t\tint(op14), int(op15), int(op16)}\n\t\tdata := []string{data1, data2, data3, data4, data5, data6, data7, data8}\n\n\t\topCounter := 0\n\t\tdataCounter := 0\n\n\t\tcreatedFiles := make([]string, 0)\n\t\tcreatedSubDirs := make([]string, 0)\n\t\tcreatedSubDirs = append(createdSubDirs, \".\")\n\n\t\ttmp := t.TempDir()\n\t\tw := newCollector(t, tmp)\n\t\tw.collect(t)\n\t\tvar sb strings.Builder\n\t\tvar wantLogger strings.Builder\n\n\t\tfor i := 0; i < 5; i++ {\n\t\t\tswitch ops[opCounter] % 3 {\n\t\t\tcase 0:\n\t\t\t\t// Create file\n\t\t\t\tt.Log(\"In case 0\")\n\t\t\t\tfilename, err := getSanitizedName([]byte(data[dataCounter]))\n\t\t\t\tdataCounter += 1\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tparentDir := createdSubDirs[ops[opCounter]%len(createdSubDirs)]\n\t\t\t\topCounter += 1\n\t\t\t\tfilename = filepath.Join(parentDir, filename)\n\n\t\t\t\tt.Log(\"checking if exists...\")\n\t\t\t\tfi, err := os.Stat(filepath.Join(filepath.Join(tmp, filename)))\n\t\t\t\tswitch {\n\t\t\t\tcase errors.Is(err, os.ErrNotExist):\n\t\t\t\t\tsb.WriteString(fmt.Sprintf(\"CREATE    /%s\\n\", filename))\n\t\t\t\t\tt.Logf(\"touching file: %s\", filename)\n\t\t\t\tcase fi.Mode().IsDir():\n\t\t\t\t\tcontinue\n\t\t\t\tcase err == nil:\n\t\t\t\t\tsb.WriteString(fmt.Sprintf(\"WRITE    /%s\\n\", filename))\n\t\t\t\t\tt.Logf(\"touch/writing file: %s\", filename)\n\t\t\t\t}\n\t\t\t\tt.Log(\"done checking if exists\")\n\n\t\t\t\tfuzzTouch(t, tmp, filename)\n\t\t\t\tif !slices.Contains(createdFiles, filename) {\n\t\t\t\t\tcreatedFiles = append(createdFiles, filename)\n\t\t\t\t}\n\t\t\tcase 1:\n\t\t\t\t// Create and write file\n\t\t\t\tt.Log(\"In case 1\")\n\t\t\t\tfilename, err := getSanitizedName([]byte(data[dataCounter]))\n\t\t\t\tdataCounter += 1\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Log(\"____have name\")\n\t\t\t\tparentDir := createdSubDirs[ops[opCounter]%len(createdSubDirs)]\n\t\t\t\topCounter += 1\n\t\t\t\tfilename = filepath.Join(parentDir, filename)\n\t\t\t\tfileContents := data[dataCounter]\n\t\t\t\tdataCounter += 1\n\t\t\t\tvar fileExists bool\n\t\t\t\tif fi, err := os.Stat(filepath.Join(filepath.Join(tmp, filename))); errors.Is(err, os.ErrNotExist) {\n\t\t\t\t\tfileExists = false\n\t\t\t\t} else if fi.Mode().IsDir() {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tfileExists = true\n\t\t\t\t}\n\t\t\t\tif !slices.Contains(createdFiles, filename) {\n\t\t\t\t\tcreatedFiles = append(createdFiles, filename)\n\t\t\t\t}\n\t\t\t\tt.Logf(\"len of file contents: %d\", len(fileContents))\n\t\t\t\techoAppend(t, fileContents, tmp, filename)\n\t\t\t\tif !fileExists {\n\t\t\t\t\tsb.WriteString(fmt.Sprintf(\"CREATE    /%s\\n\", filename))\n\t\t\t\t\tt.Logf(\"CREATE'ing %s\", filename)\n\t\t\t\t}\n\t\t\t\tif len(fileContents) != 0 {\n\t\t\t\t\tt.Logf(\"Writing %s\", filename)\n\t\t\t\t\tsb.WriteString(fmt.Sprintf(\"WRITE    /%s\\n\", filename))\n\t\t\t\t\tt.Logf(\"echo appending file: %s\", filename)\n\t\t\t\t}\n\t\t\tcase 2:\n\t\t\t\t// Create subdir in the watched dir\n\t\t\t\tt.Log(\"In case 2\")\n\t\t\t\tsubDirName, err := getSanitizedName([]byte(data[dataCounter]))\n\t\t\t\tdataCounter += 1\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Log(\"____have name\")\n\n\t\t\t\t// Select a parent dir to create the new subdir in\n\t\t\t\topCounter += 1\n\t\t\t\tparentDir := createdSubDirs[ops[opCounter]%len(createdSubDirs)]\n\t\t\t\tif _, err := os.Stat(filepath.Join(filepath.Join(tmp, parentDir, subDirName))); errors.Is(err, os.ErrNotExist) {\n\t\t\t\t\tcreatedSubDirs = append(createdSubDirs, filepath.Join(parentDir, subDirName))\n\t\t\t\t\tt.Logf(\"Creating subdir: %s\", filepath.Join(parentDir, subDirName))\n\t\t\t\t\tmkdir(t, tmp, parentDir, subDirName)\n\t\t\t\t\tsb.WriteString(fmt.Sprintf(\"CREATE    /%s\\n\", filepath.Join(parentDir, subDirName)))\n\t\t\t\t\tif err := w.w.Add(filepath.Join(tmp, parentDir, subDirName)); err != nil {\n\t\t\t\t\t\tt.Fatal(err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevs := w.stop(t)\n\t\ts := sb.String()\n\t\tfmt.Println(wantLogger.String())\n\t\tcmpEvents(t, tmp, evs, newEvents(t, s))\n\t\treturn\n\t})\n}\n\nfunc getSanitizedName(data []byte) (string, error) {\n\tb64Name := base64.URLEncoding.EncodeToString(data)\n\tnameWoSlashes := strings.Replace(b64Name, \"/\", \"\", -1)\n\tif len(nameWoSlashes) == 0 {\n\t\treturn \"\", errors.New(\"Too short name\")\n\t}\n\tsanitizedName := filepath.Clean(nameWoSlashes)\n\tif len(sanitizedName) > 60 {\n\t\tsanitizedName = sanitizedName[:60]\n\t}\n\treturn sanitizedName, nil\n}\n\n// touch but without fatal'ing if it could not create the file\n// error means that the touch did not create a file\nfunc fuzzTouch(t *testing.T, path ...string) error {\n\tt.Helper()\n\tif len(path) < 1 {\n\t\tt.Fatalf(\"touch: path must have at least one element: %s\", path)\n\t}\n\tfp, err := os.Create(join(path...))\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = fp.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"touch(%q): %s\", join(path...), err)\n\t}\n\tif shouldWait(path...) {\n\t\teventSeparator()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "projects/fsnotify/project.yaml",
    "content": "homepage: \"https://github.com/fsnotify/fsnotify\"\nlanguage: go\nmain_repo: \"https://github.com/fsnotify/fsnotify\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/ftfy/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/rspeer/python-ftfy ftfy\nWORKDIR ftfy\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/ftfy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ftfy/fuzz_fix.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    import ftfy\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        ftfy.fix_text(fdp.ConsumeUnicodeNoSurrogates(100))\n        plan1 = ftfy.fix_and_explain(fdp.ConsumeUnicodeNoSurrogates(100))[1]\n        ftfy.apply_plan(fdp.ConsumeUnicodeNoSurrogates(100), plan1)\n        ftfy.fix_text_segment(fdp.ConsumeUnicodeNoSurrogates(100))\n\n        f = open(\"temp.txt\", \"w\")\n        f.write(fdp.ConsumeUnicodeNoSurrogates(1000))\n        f.close()\n        f = open(\"temp.txt\", \"r\")\n        ftfy.fix_file(f)\n        f.close()\n\n        ftfy.guess_bytes(fdp.ConsumeBytes(100))\n    except UnicodeEncodeError as e2:\n        pass\n    except UnicodeError as e:\n        if \"Hey wait, this isn't Unicode.\" not in str(e):\n            raise e\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/ftfy/fuzz_format.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    import ftfy.formatting as ftfy\n    import ftfy.fixes as fixes\n\ndef TestInput(data):\n    if len(data) < 1:\n        return\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    ftfy.character_width(chr(fdp.ConsumeIntInRange(1,1114110)))\n    ftfy.monospaced_width(fdp.ConsumeUnicodeNoSurrogates(1000))\n\n    choice = fdp.ConsumeIntInRange(1,3)\n    if choice == 1:\n        ftfy.display_ljust(fdp.ConsumeUnicodeNoSurrogates(1000),fdp.ConsumeIntInRange(1,2000))\n    if choice == 2:\n        ftfy.display_rjust(fdp.ConsumeUnicodeNoSurrogates(1000),fdp.ConsumeIntInRange(1,2000))\n    if choice == 3:\n        ftfy.display_center(fdp.ConsumeUnicodeNoSurrogates(1000),fdp.ConsumeIntInRange(1,2000))\n    fixes.remove_bom(fdp.ConsumeUnicodeNoSurrogates(1000))\n    \ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/ftfy/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/rspeer/python-ftfy\nlanguage: python\nmain_repo: https://github.com/rspeer/python-ftfy\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/fuzzing-puzzles/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nADD https://raw.githubusercontent.com/llvm-mirror/compiler-rt/master/test/fuzzer/MultipleConstraintsOnSmallInputTest.cpp \\\n    $SRC/fuzzing-puzzles/\nWORKDIR fuzzing-puzzles\nCOPY build.sh $SRC/\n\n"
  },
  {
    "path": "projects/fuzzing-puzzles/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$CXX $CXXFLAGS $SRC/fuzzing-puzzles/MultipleConstraintsOnSmallInputTest.cpp \\\n    -o $OUT/multiple_constraints_on_small_input_honggfuzz_fuzzer \\\n    $LIB_FUZZING_ENGINE\n"
  },
  {
    "path": "projects/fuzzing-puzzles/project.yaml",
    "content": "homepage: https://github.com/google/fuzzer-test-suite\nlanguage: c++\nprimary_contact: kcc@google.com\nmain_repo: https://github.com/google/fuzzer-test-suite\nauto_ccs:\n  - \"metzman@google.com\"\n  - \"mmoroz@google.com\"\n\nsanitizers:\n  - address\n\nfuzzing_engines:\n  - honggfuzz\n\ndisabled: True\n"
  },
  {
    "path": "projects/fuzztest-example/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth=1 https://github.com/google/fuzztest\nCOPY build.sh $SRC/\nCOPY fuzztest-enable-fuzzers.diff $SRC/\n"
  },
  {
    "path": "projects/fuzztest-example/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd fuzztest\ngit apply  --ignore-space-change --ignore-whitespace $SRC/fuzztest-enable-fuzzers.diff\n\n# Compile gfuzztests\ncd codelab\ncompile_fuzztests.sh\n"
  },
  {
    "path": "projects/fuzztest-example/fuzztest-enable-fuzzers.diff",
    "content": "diff --git a/codelab/escaping_test.cc b/codelab/escaping_test.cc\nindex 5e5310e..d83901e 100644\n--- a/codelab/escaping_test.cc\n+++ b/codelab/escaping_test.cc\n@@ -48,20 +48,20 @@ TEST(EscapingTest, UnescapingReplacesEscapeSequences) {\n \n // Comment out the following fuzz tests:\n \n-// void UnescapingEscapedStringGivesOriginal(std::string_view s) {\n-//   EXPECT_EQ(s, Unescape(Escape(s)));\n-// }\n-// FUZZ_TEST(EscapingTest, UnescapingEscapedStringGivesOriginal);\n+void UnescapingEscapedStringGivesOriginal(std::string_view s) {\n+  EXPECT_EQ(s, Unescape(Escape(s)));\n+}\n+FUZZ_TEST(EscapingTest, UnescapingEscapedStringGivesOriginal);\n \n-// void EscapingAStringNeverTriggersUndefinedBehavior(std::string_view s) {\n-//   Escape(s);\n-// }\n-// FUZZ_TEST(EscapingTest, EscapingAStringNeverTriggersUndefinedBehavior);\n+void EscapingAStringNeverTriggersUndefinedBehavior(std::string_view s) {\n+  Escape(s);\n+}\n+FUZZ_TEST(EscapingTest, EscapingAStringNeverTriggersUndefinedBehavior);\n \n-// void UnescapingAStringNeverTriggersUndefinedBehavior(std::string_view s) {\n-//   Unescape(s);\n-// }\n-// FUZZ_TEST(EscapingTest, UnescapingAStringNeverTriggersUndefinedBehavior);\n+void UnescapingAStringNeverTriggersUndefinedBehavior(std::string_view s) {\n+   Unescape(s);\n+}\n+FUZZ_TEST(EscapingTest, UnescapingAStringNeverTriggersUndefinedBehavior);\n \n }  // namespace\n }  // namespace codelab\n"
  },
  {
    "path": "projects/fuzztest-example/project.yaml",
    "content": "homepage: \"https://github.com/google/fuzztest\"\nlanguage: c++\nprimary_contact: \"david@adalogics.com\"\nmain_repo: \"https://github.com/google/fuzztest\"\nfuzzing_engines:\n - libfuzzer\n"
  },
  {
    "path": "projects/fuzztest-raksha/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool default-jdk bison m4 \\\n    build-essential\\\n    curl \\\n    doxygen \\\n    flex \\\n    libffi-dev \\\n    libncurses5-dev \\\n    libtool \\\n    libsqlite3-dev \\\n    mcpp \\\n    sqlite \\\n    uuid-runtime \\\n    zlib1g-dev \n\nRUN wget https://github.com/bazelbuild/buildtools/releases/download/4.2.5/buildifier-linux-amd64 \\\n    -O /usr/local/bin/buildifier && chmod a+x /usr/local/bin/buildifier\n\nRUN git clone https://github.com/google-research/raksha raksha\n\nCOPY build.sh $SRC/\nCOPY *.diff $SRC/\n"
  },
  {
    "path": "projects/fuzztest-raksha/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Extend with oss-fuzz settings. To be upsteamed?\ncd $SRC/raksha\ngit apply  --ignore-space-change --ignore-whitespace $SRC/raksha-fuzztest.diff\n\n# Compile gfuzztests\nexport FUZZTEST_TARGET_FOLDER=\"//src/...\"\ncompile_fuzztests.sh\n"
  },
  {
    "path": "projects/fuzztest-raksha/project.yaml",
    "content": "homepage: \"https://github.com/google/fuzztest\"\nlanguage: c++\nprimary_contact: \"david@adalogics.com\"\nmain_repo: \"https://github.com/google/fuzztest\"\nfuzzing_engines:\n - libfuzzer\n"
  },
  {
    "path": "projects/fuzztest-raksha/raksha-fuzztest.diff",
    "content": "diff --git a/WORKSPACE b/WORKSPACE\nindex 73e0e75..33aae53 100644\n--- a/WORKSPACE\n+++ b/WORKSPACE\n@@ -238,12 +238,12 @@ http_archive(\n     ],\n )\n \n-fuzztest_commit_hash = \"4a8253b7299cf1764550054fae55f1b58a65bbaa\"\n+fuzztest_commit_hash = \"c8ae15a574068f5ed8cd2944bdb5e56b2a1e9d71\"\n \n # Fuzztest\n http_archive(\n-    name = \"fuzztest\",\n-    sha256 = \"72ae2d28323748d2c466396fa47038351ae81bedc50b8a3c6f1de6a9f02cde33\",\n+    name = \"com_google_fuzztest\",\n+    sha256 = \"ab7cdadecde55e645cc38dfec7bb9bab9e43ea508c9e13ed2aad884a23020240\",\n     strip_prefix = \"fuzztest-\" + fuzztest_commit_hash,\n     urls = [\"https://github.com/google/fuzztest/archive/\" + fuzztest_commit_hash + \".zip\"],\n )\ndiff --git a/src/ir/BUILD b/src/ir/BUILD\nindex d525046..a16cd0f 100644\n--- a/src/ir/BUILD\n+++ b/src/ir/BUILD\n@@ -206,10 +206,11 @@ cc_test(\n         \":module\",\n         \":storage\",\n         \":value\",\n-        \"//src/common/testing:gtest\",\n         \"//src/common/utils:map_iter\",\n         \"//src/ir/types\",\n-        \"@fuzztest//fuzztest\",\n+        \"@com_google_fuzztest//fuzztest\",\n+\t\"@com_google_fuzztest//fuzztest:fuzztest_gtest_main\",\n+        \"//src/common/testing:gtest\",\n     ],\n )\n \ndiff --git a/src/ir/datalog/BUILD b/src/ir/datalog/BUILD\nindex 6b3a0c7..f571f31 100644\n--- a/src/ir/datalog/BUILD\n+++ b/src/ir/datalog/BUILD\n@@ -131,9 +131,10 @@ cc_test(\n     srcs = [\"value_test.cc\"],\n     deps = [\n         \":value\",\n-        \"//src/common/testing:gtest\",\n         \"@com_google_absl//absl/strings\",\n-        \"@fuzztest//fuzztest\",\n+\t\"@com_google_fuzztest//fuzztest\",\n+\t\"@com_google_fuzztest//fuzztest:fuzztest_gtest_main\",\n+        \"//src/common/testing:gtest\",\n     ],\n )\n \n"
  },
  {
    "path": "projects/fuzzywuzzy/DiffUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport me.xdrop.diffutils.DiffUtils;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [me.xdrop.diffutils.DiffUtils] public static\n// me.xdrop.diffutils.structs.MatchingBlock[] getMatchingBlocks(java.lang.String,java.lang.String)\npublic class DiffUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    DiffUtils.getMatchingBlocks(\n        data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/fuzzywuzzy/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/xdrop/fuzzywuzzy fuzzywuzzy\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/fuzzywuzzy\n"
  },
  {
    "path": "projects/fuzzywuzzy/FuzzySearchFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport me.xdrop.fuzzywuzzy.FuzzySearch;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [me.xdrop.fuzzywuzzy.FuzzySearch] public static int\n// weightedRatio(java.lang.String,java.lang.String)\npublic class FuzzySearchFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    FuzzySearch.weightedRatio(\n        data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/fuzzywuzzy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"package/target/fuzzywuzzy-$CURRENT_VERSION.jar\" $OUT/fuzzywuzzy.jar\ncp \"build/target/fuzzywuzzy-build-$CURRENT_VERSION.jar\" $OUT/fuzzywuzzy-build.jar\ncp diffutils/target/diffutils-*.jar $OUT/diffutils.jar\n\nALL_JARS=\"fuzzywuzzy.jar:fuzzywuzzy-build.jar:diffutils.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir     \\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar     --cp=$RUNTIME_CLASSPATH     --target_class=$fuzzer_basename     --jvm_args=\"\\$mem_settings\"     \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/fuzzywuzzy/project.yaml",
    "content": "homepage: https://github.com/xdrop/fuzzywuzzy\nmain_repo: https://github.com/xdrop/fuzzywuzzy\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/fwupd/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y pkg-config zlib1g-dev libffi-dev liblzma-dev libcbor-dev\nRUN python3 -m pip install -U jinja2 packaging meson ninja\nRUN git clone --depth 1 https://github.com/fwupd/fwupd.git fwupd\nWORKDIR .\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/fwupd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 fwupd/contrib/ci/oss-fuzz.py\n"
  },
  {
    "path": "projects/fwupd/project.yaml",
    "content": "homepage: \"https://github.com/fwupd/fwupd\"\nlanguage: c\nprimary_contact: \"hughsient@gmail.com\"\nmain_repo: 'https://github.com/fwupd/fwupd'\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/g-api-auth-httplib2/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip && pip install mock\nRUN git clone --depth 1 https://github.com/googleapis/google-auth-library-python-httplib2\nWORKDIR google-auth-library-python-httplib2\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/g-api-auth-httplib2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-auth-httplib2/fuzz_http.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nimport six\nfrom six.moves import http_client\nimport mock\nimport httplib2\nimport google_auth_httplib2\n\n\n# Mocks for fuzzing. Inspired by testing infra. Main difference is we have\n# added logic to handle the event where the MockHTTP has run out of\n# responses an appropriate exception is thrown that we catch in the fuzzer.\nclass FuzzMockHttp(object):\n    def __init__(self, responses, headers=None):\n        self.responses = responses\n        self.requests = []\n        self.headers = headers or {}\n        self.add_certificate = mock.Mock(return_value=None)\n\n    def request(\n        self,\n        url,\n        method=\"GET\",\n        body=None,\n        headers=None,\n        redirections=httplib2.DEFAULT_MAX_REDIRECTS,\n        connection_type=None,\n    ):\n        self.requests.append(\n            (method, url, body, headers, redirections, connection_type)\n        )\n        if len(self.responses) == 0:\n            raise Exception(\"FUZZ: No more responses\")\n        return self.responses.pop(0)\n\n\nclass FuzzMockResponse(object):\n    def __init__(self, status=http_client.OK, data=b\"\"):\n        self.status = status\n        self.data = data\n\n    def __iter__(self):\n        yield self\n        yield self.data\n\n\nclass FuzzMockCredentials(object):\n    def __init__(self, token=\"token\"):\n        self.token = token\n\n    def apply(self, headers):\n        headers[\"authorization\"] = self.token\n\n    def before_request(self, request, method, url, headers):\n        self.apply(headers)\n\n    def refresh(self, request):\n        self.token += \"1\"\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    mock_credentials = mock.Mock(wraps=FuzzMockCredentials(fdp.ConsumeUnicodeNoSurrogates(10)))\n    if fdp.ConsumeBool() == True:\n        mock_credentials.apply({'authorization': \"\"})\n\n    # Create responses. We need at least two.\n    http_codes = [400, 401, 403, 404, 405, 413, 415, 429, 500, 503, 504]\n    mock_responses = []\n    for i in range(fdp.ConsumeIntInRange(1, 10)):\n        mock_responses.append(\n            FuzzMockResponse(\n                status = http_codes[fdp.ConsumeIntInRange(0, len(http_codes)-1)],\n                data = fdp.ConsumeBytes(100)\n            )\n        )\n    mock_http = FuzzMockHttp(mock_responses)\n\n    authed_http = google_auth_httplib2.AuthorizedHttp(\n        mock_credentials, http=mock_http\n    )\n    try:\n        r, d = authed_http.request(\n            \"http://localhost:8001\",\n            fdp.ConsumeUnicodeNoSurrogates(10),\n            None,\n            None,\n            httplib2.DEFAULT_MAX_REDIRECTS,\n            None\n        )\n    except Exception as e:\n        if \"FUZZ\" in str(e):\n            pass\n        else:\n            raise e\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-auth-httplib2/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-auth-library-python-httplib2\nlanguage: python\nmain_repo: https://github.com/googleapis/google-auth-library-python-httplib2/\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-auth-library-python/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/googleapis/google-auth-library-python\nCOPY build.sh *.py $SRC/\nWORKDIR google-auth-library-python\n"
  },
  {
    "path": "projects/g-api-auth-library-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install -r docs/requirements-docs.txt\npip3 install .\n\n# Embed certificates and private key too\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data \"$PWD/tests/data/privatekey.pem:.\" --add-data \"$PWD/tests/data/public_cert.pem:.\"\ndone\n"
  },
  {
    "path": "projects/g-api-auth-library-python/fuzz_jwt.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom google.auth import jwt\nfrom google.auth import crypt\n\nbundle_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))\npath_to_public_cert = os.path.abspath(os.path.join(bundle_dir, 'public_cert.pem'))\n\nif os.path.isfile(path_to_public_cert):\n  with open(path_to_public_cert, \"rb\") as fh:\n    PUBLIC_CERT_BYTES = fh.read()\nelse:\n  raise Exception(\"Could not find public cert\")\n\n@atheris.instrument_func\ndef test_token_decode(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    jwt.decode(fdp.ConsumeString(200), certs=PUBLIC_CERT_BYTES)\n  except ValueError:  # ValueError is thrown if any failed verification checks\n    pass\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  test_token_decode(data)\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.instrument_all()\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-api-auth-library-python/fuzz_jwt_roundtrip.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nbundle_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))\npath_to_public_cert = os.path.abspath(os.path.join(bundle_dir, 'public_cert.pem'))\npath_to_private_key = os.path.abspath(os.path.join(bundle_dir, 'privatekey.pem'))\n\n# We instrument all imports below\nfrom google.auth import jwt\nfrom google.auth import crypt\n\nif os.path.isfile(path_to_private_key):\n  with open(path_to_private_key, \"rb\") as fh:\n    PRIVATE_KEY_BYTES = fh.read()\nelse:\n  raise Exception(\"Could not find private key\")\n\nif os.path.isfile(path_to_public_cert):\n  with open(path_to_public_cert, \"rb\") as fh:\n    PUBLIC_CERT_BYTES = fh.read()\nelse:\n  raise Exception(\"Could not find public cert\")\n\n@atheris.instrument_func\ndef test_roundtrip_unverified(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  signer = crypt.RSASigner.from_string(PRIVATE_KEY_BYTES, \"1\")\n\n  to_header = fdp.ConsumeIntInRange(1, 100)\n  if to_header < 50:\n    header = None\n  else:\n    header = {\n      \"alg\" : fdp.ConsumeString(100),\n    }\n  to_keyid = fdp.ConsumeIntInRange(1, 100)\n  raw_data = fdp.ConsumeString(200)\n\n  key_id = fdp.ConsumeString(50) if to_keyid < 50 else None\n  encoded = jwt.encode(signer, raw_data, header = header, key_id = key_id)\n  try:\n    _, decoded_data, _, _ = jwt.decode(encoded, PUBLIC_CERT_BYTES)\n  except ValueError as e:\n    return\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  test_roundtrip_unverified(data)\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.instrument_all()\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-api-auth-library-python/project.yaml",
    "content": "auto_ccs:\n- saisunder@google.com\n- stim@google.com\n- clundin@google.com\n- sijunliu@google.com\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-auth-library-python\nlanguage: python\nmain_repo: https://github.com/googleapis/google-auth-library-python\nprimary_contact: kittureddy@google.com\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-pubsub/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && pip install google-api-core google-cloud-core\nRUN git clone https://github.com/googleapis/python-pubsub\nCOPY build.sh *.py $SRC/\nWORKDIR python-pubsub\n"
  },
  {
    "path": "projects/g-api-pubsub/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-pubsub/fuzz_msg.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport queue\nimport atheris\nimport datetime\n\n# We instrument all at the bottom\nfrom google.cloud.pubsub_v1.subscriber import message\nfrom google.protobuf import timestamp_pb2\nfrom google.pubsub_v1 import types as gapic_types\n\nRECEIVED = datetime.datetime(2012, 4, 21, 15, 0, tzinfo=datetime.timezone.utc)\nPUBLISHED_MICROS = 123456\nPUBLISHED = RECEIVED + datetime.timedelta(days=1, microseconds=PUBLISHED_MICROS)\nPUBLISHED_SECONDS = 1234543\n\nis_once = True\n\ndef fuzz_exactly_once_delivery_enabled_func():\n    if is_once:\n        return True\n    return False\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    is_once = fdp.ConsumeBool()\n    gapic_pubsub_message = gapic_types.PubsubMessage(\n      data=data,\n      message_id=\"message_id\",\n      publish_time=timestamp_pb2.Timestamp(\n        seconds=PUBLISHED_SECONDS, nanos=PUBLISHED_MICROS * 1000\n      ),\n      ordering_key=fdp.ConsumeUnicodeNoSurrogates(20),\n    )\n\n    msg = message.Message(\n      message=gapic_pubsub_message._pb,\n      ack_id = fdp.ConsumeUnicodeNoSurrogates(20),\n      delivery_attempt = fdp.ConsumeIntInRange(1, 1000),\n      request_queue=queue.Queue(),\n      exactly_once_delivery_enabled_func = fuzz_exactly_once_delivery_enabled_func\n    )\n    msg.modify_ack_deadline_with_response(fdp.ConsumeIntInRange(1, 1000))\n    msg.ack_with_response()\n    msg.nack_with_response()\n\n    s1 = repr(msg)\n\n    return msg.ack_id\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-pubsub/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-pubsub\nlanguage: python\nmain_repo: https://github.com/googleapis/python-pubsub\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-py-api-common-protos/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool zlib1g-dev pkg-config\nRUN pip3 install --upgrade pip && pip3 install google-api-core\nRUN git clone --depth 1 --recursive https://github.com/protocolbuffers/protobuf.git\nRUN git clone --depth 1 https://github.com/googleapis/python-api-common-protos\nCOPY build.sh fuzz_* $SRC/\n\nWORKDIR python-api-common-protos\n"
  },
  {
    "path": "projects/g-api-py-api-common-protos/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build protoc with default options.\nunset CFLAGS CXXFLAGS\nmkdir $SRC/protobuf-install/\ncd $SRC/protobuf-install/\ncmake -Dprotobuf_BUILD_TESTS=OFF $SRC/protobuf\nmake -j$(nproc)\nmake install\nldconfig\n\ncd $SRC/protobuf/python\npython3 setup.py build\npip3 install .\n\n# Compile .proto specs\ncd $SRC/python-api-common-protos/\nfor target in quota billing routing log; do\n  protoc --python_out=. --proto_path=. google/api/$target.proto\ndone\n\n# Compile fuzzer\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-py-api-common-protos/fuzz_api.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports(enable_loader_override=False):\n  import google.api.quota_pb2\n  import google.api.billing_pb2\n  import google.api.routing_pb2\n  import google.api.log_pb2\n  from google.protobuf.message import DecodeError, EncodeError\n\n\n@atheris.instrument_func\ndef protobuf_roundtrip(proto_target, input_bytes):\n  try:\n    proto_target.ParseFromString(input_bytes)\n  except DecodeError:\n    None\n\n  try:\n    proto_target.SerializeToString()\n  except EncodeError:\n    None\n\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  \"\"\"Test ParseFromString with bytes string\"\"\"\n\n  protobuf_roundtrip(google.api.quota_pb2.QuotaLimit(), input_bytes)\n  protobuf_roundtrip(google.api.billing_pb2.Billing(), input_bytes)\n  protobuf_roundtrip(google.api.routing_pb2.RoutingRule(), input_bytes)\n  protobuf_roundtrip(google.api.log_pb2.LogDescriptor(), input_bytes)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-api-py-api-common-protos/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-api-common-protos\nlanguage: python\nmain_repo: https://github.com/googleapis/python-api-common-protos\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/g-api-py-oauthlib/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip && pip3 install mock\nRUN git clone --depth 1 https://github.com/googleapis/google-auth-library-python-oauthlib\nWORKDIR google-auth-library-python-oauthlib\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/g-api-py-oauthlib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-py-oauthlib/fuzz_config.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport mock\nimport atheris\nimport tempfile\n\nimport json\nimport mock\nfrom google_auth_oauthlib import helpers\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    config_file = tempfile.NamedTemporaryFile(mode=\"wt\")\n    try:\n        payload = json.loads(fdp.ConsumeUnicodeNoSurrogates(1024))\n    except:\n        return\n    if type(payload) is not dict:\n        return\n    config_file.write(json.dumps(payload))\n\n    try:\n        helpers.session_from_client_secrets_file(\n            config_file.name, scopes=mock.sentinel.scopes\n        )\n    except ValueError as ve:\n        legit_exceptions = [\n            \"Client secrets must be for a web or installed app.\",\n            \"Client secrets is not in the correct format.\"\n        ]\n        legit = False\n        for msg in legit_exceptions:\n            if msg in str(ve):\n                legit = True\n        if not legit:\n            raise ve\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-py-oauthlib/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-auth-library-python-oauthlib\nlanguage: python\nmain_repo: https://github.com/googleapis/google-auth-library-python-oauthlib\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/g-api-python-bigquery-storage/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/googleapis/python-bigquery-storage python-bigquery-storage\nRUN python3 -m pip install --upgrade pip mock google-api-core google-cloud-core fastavro\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-bigquery-storage\n"
  },
  {
    "path": "projects/g-api-python-bigquery-storage/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nGRPC_PYTHON_CFLAGS=\"${CFLAGS}\" GRPC_PYTHON_BUILD_SYSTEM_RE2=true GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true GRPC_PYTHON_BUILD_SYSTEM_ZLIB=true pip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-python-bigquery-storage/fuzz_avroparser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom google.cloud.bigquery_storage_v1.types import ReadSession\nfrom google.protobuf.json_format import Parse\n\n\ndef TestOneInput(data):\n    \"\"\"Fuzzer that creates a random read session and parses\n    the attached avro session. The main point is to ensure\n    none of the parsing routines have insecure calls and\n    that the parsing routines can work with arbitrary ReadSessions.\n    \"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        # Create a random session\n        msg = Parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize), ReadSession())\n    except Exception:\n        return\n\n    avro_parser = _AvroStreamParser(msg)\n    avro_parser.to_dataframe()\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-python-bigquery-storage/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-bigquery-storage\nlanguage: python\nmain_repo: https://github.com/googleapis/python-bigquery-storage\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/g-api-python-client/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/googleapis/google-api-python-client\nCOPY build.sh *.py $SRC/\nWORKDIR google-api-python-client\n"
  },
  {
    "path": "projects/g-api-python-client/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Build flask fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-python-client/fuzz_mimeparser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from googleapiclient import mimeparse\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  mimeparse.best_match(\n    ['application/xbel+xml', 'text/xml'],\n    fdp.ConsumeString(200)\n  )\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-api-python-client/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-api-python-client\nlanguage: python\nmain_repo: https://github.com/googleapis/google-api-python-client\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-python-cloud-core/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/googleapis/python-cloud-core\nCOPY build.sh *.py $SRC/\nWORKDIR python-cloud-core\n"
  },
  {
    "path": "projects/g-api-python-cloud-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-python-cloud-core/fuzz_helpers.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport json\n\n# We instrument all functions when initiating atheris\nfrom google.cloud import _helpers\n\ndef TestOneInput(data):\n  if len(data) < 100:\n    return\n\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    loaded_data = json.loads(fdp.ConsumeString(300))\n    success = True\n  except Exception:\n    success = False\n\n  if success:\n    try:\n      _helpers._ensure_tuple_or_list(loaded_data)\n    except TypeError:\n      pass\n\n  try:\n    _helpers._bytes_to_unicode(data)\n  except ValueError:\n    pass\n\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    _helpers._time_from_iso8601_time_naive(fdp.ConsumeString(100))\n  except ValueError:\n    pass\n\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    _helpers._rfc3339_nanos_to_datetime(fdp.ConsumeString(100))\n  except ValueError:\n    pass\n\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    _helpers._name_from_project_path(\n      fdp.ConsumeString(60),\n      fdp.ConsumeString(60),\n      fdp.ConsumeString(60)\n    )\n  except ValueError:\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-api-python-cloud-core/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-cloud-core\nlanguage: python\nmain_repo: https://github.com/googleapis/python-cloud-core\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-python-firestore/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && pip3 install mock\nRUN git clone https://github.com/googleapis/python-firestore\nCOPY build.sh *.py $SRC/\nWORKDIR python-firestore\n"
  },
  {
    "path": "projects/g-api-python-firestore/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-python-firestore/fuzz_test.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport mock\nimport atheris\n\nimport google.auth.credentials\nfrom google.cloud.firestore_v1.query import CollectionGroup\nfrom google.cloud.firestore_v1.client import Client\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  credentials = mock.Mock(spec=google.auth.credentials.Credentials)\n  client = Client(\n    project=\"fuzz_project\",\n    credentials = credentials\n  )\n  try:\n    parent = client.collection(fdp.ConsumeString(100))\n  except ValueError:\n    return\n  \n  query = CollectionGroup(parent).limit(fdp.ConsumeIntInRange(1, 10))\n  try:\n    _ = list(query.get_partitions(fdp.ConsumeIntInRange(1, 50)))\n  except ValueError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-api-python-firestore/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-firestore\nlanguage: python\nmain_repo: https://github.com/googleapis/python-firestore\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-python-tasks/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && \\\n    apt-get install -y libre2-dev zlib1g-dev libssl-dev\nRUN python3 -m pip install --upgrade pip && \\\n    python3 -m pip install --upgrade  mock\nRUN python3 -m pip install charset_normalizer\nRUN git clone --depth 1 https://github.com/googleapis/google-cloud-python $SRC/google-cloud-python\nWORKDIR $SRC/google-cloud-python/packages/google-cloud-tasks\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/g-api-python-tasks/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Reinstall grpcio to fix potential build issues\npython3 -m pip install --force-reinstall --upgrade grpcio\n\nGRPC_PYTHON_CFLAGS=\"${CFLAGS}\" \\\nGRPC_PYTHON_BUILD_SYSTEM_RE2=true \\\nGRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true \\\nGRPC_PYTHON_BUILD_SYSTEM_ZLIB=true \\\nMAX_JOBS=$(nproc) \\\npython3 -m pip install -v . --no-binary :all:\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-python-tasks/fuzz_cloudtask_client.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport mock\nimport atheris\n\nwith atheris.instrument_imports():\n    from google.auth import credentials as ga_credentials\n    from google.cloud.tasks_v2.services.cloud_tasks import CloudTasksClient\n    from google.cloud.tasks_v2.types import queue\n    from google.cloud.tasks_v2.types import cloudtasks\n\n\ndef get_request_queue(fdp, client):\n    request = cloudtasks.GetQueueRequest()\n    request.name = fdp.ConsumeUnicodeNoSurrogates(20)\n    with mock.patch.object(type(client.transport.get_queue), \"__call__\") as call:\n        call.return_value = queue.Queue()\n        client.get_queue(request)\n\n\ndef update_queue(fdp, client):\n    request = cloudtasks.UpdateQueueRequest()\n    with mock.patch.object(type(client.transport.update_queue), \"__call__\") as call:\n        call.return_value = queue.Queue(\n            name=fdp.ConsumeUnicodeNoSurrogates(20),\n            state=queue.Queue.State.RUNNING,\n        )\n        response = client.update_queue(request)\n\n\ndef delete_queue(fdp, client):\n    request = cloudtasks.DeleteQueueRequest()\n    request.name = fdp.ConsumeUnicodeNoSurrogates(20)\n    with mock.patch.object(type(client.transport.delete_queue), \"__call__\") as call:\n        call.return_value = None\n        response = client.delete_queue(request)\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    client = CloudTasksClient(\n        credentials=ga_credentials.AnonymousCredentials(),\n    )\n\n    api_targets = [\n        get_request_queue,\n        update_queue,\n        delete_queue\n    ]\n    num_of_calls = fdp.ConsumeIntInRange(1, 10)\n    for i in range(num_of_calls):\n        target = api_targets[fdp.ConsumeIntInRange(0, len(api_targets)-1)]\n        target(fdp, client)\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-python-tasks/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-tasks\nlanguage: python\nmain_repo: https://github.com/googleapis/google-cloud-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/g-api-resource-manager/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && \\\n    apt-get install -y libre2-dev zlib1g-dev libssl-dev\nRUN python3 -m pip install --upgrade pip && \\\n    python3 -m pip install --upgrade mock\nRUN git clone --depth 1 https://github.com/googleapis/google-cloud-python $SRC/google-cloud-python\nWORKDIR $SRC/google-cloud-python/packages/google-cloud-resource-manager\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/g-api-resource-manager/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nGRPC_PYTHON_CFLAGS=\"${CFLAGS}\" \\\nGRPC_PYTHON_BUILD_SYSTEM_RE2=true \\\nGRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true \\\nGRPC_PYTHON_BUILD_SYSTEM_ZLIB=true \\\nMAX_JOBS=$(nproc) \\\npython3 -m pip install -v . --no-binary :all:\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-resource-manager/fuzz_tag_values_client.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer for google/cloud/resourcemanager_v3/services/tag_values/client.py\"\"\"\n\nimport sys\nimport mock\nimport atheris\n\nwith atheris.instrument_imports():\n    from google.auth import credentials as ga_credentials\n    from google.longrunning import operations_pb2\n    from google.iam.v1 import iam_policy_pb2\n    from google.iam.v1 import policy_pb2\n    from google.cloud.resourcemanager_v3.services.tag_values import (\n        TagValuesAsyncClient,\n        TagValuesClient,\n        pagers,\n        transports,\n    )\n    from google.cloud.resourcemanager_v3.types import tag_values\n\n\ndef test_get_tag_value(fdp, client):\n    if fdp.ConsumeBool():\n        request = tag_values.GetTagValueRequest()\n    else:\n        request = dict()\n\n    with mock.patch.object(type(client.transport.get_tag_value), \"__call__\") as call:\n        call.return_value = tag_values.TagValue(\n            name=fdp.ConsumeUnicodeNoSurrogates(10),\n            parent=fdp.ConsumeUnicodeNoSurrogates(10),\n            short_name=fdp.ConsumeUnicodeNoSurrogates(10),\n            namespaced_name=fdp.ConsumeUnicodeNoSurrogates(10),\n            description=fdp.ConsumeUnicodeNoSurrogates(10),\n            etag=fdp.ConsumeUnicodeNoSurrogates(10),\n        )\n\n        response = client.get_tag_value(request)\n\n\ndef test_create_tag_value(fdp, client):\n    if fdp.ConsumeBool():\n        request = tag_values.CreateTagValueRequest()\n    else:\n        request = dict()\n\n    with mock.patch.object(type(client.transport.create_tag_value), \"__call__\") as call:\n        call.return_value = operations_pb2.Operation(name=fdp.ConsumeUnicodeNoSurrogates(20))\n        response = client.create_tag_value(request)\n\ndef test_update_tag_value(fdp, client):\n    if fdp.ConsumeBool():\n        request = tag_values.UpdateTagValueRequest()\n    else:\n        request = dict()\n\n    with mock.patch.object(type(client.transport.update_tag_value), \"__call__\") as call:\n        call.return_value = operations_pb2.Operation(name=fdp.ConsumeUnicodeNoSurrogates(20))\n        response = client.update_tag_value(request)\n\n\ndef test_delete_tag_value(fdp, client):\n    if fdp.ConsumeBool():\n        request = tag_values.DeleteTagValueRequest()\n    else:\n        request = dict()\n\n    with mock.patch.object(type(client.transport.delete_tag_value), \"__call__\") as call:\n        call.return_value = operations_pb2.Operation(name=\"operations/spam\")\n        response = client.delete_tag_value(request)\n\ndef test_get_iam_policy(fdp, client):\n    if fdp.ConsumeBool():\n        request = iam_policy_pb2.GetIamPolicyRequest()\n    else:\n        request = dict()\n\n    with mock.patch.object(type(client.transport.get_iam_policy), \"__call__\") as call:\n        call.return_value = policy_pb2.Policy(\n            version=774,\n            etag=fdp.ConsumeBytes(20),\n        )\n        response = client.get_iam_policy(request)\n\ndef test_set_iam_policy(fdp, client):\n    if fdp.ConsumeBool():\n        request = iam_policy_pb2.SetIamPolicyRequest()\n    else:\n        request = dict()\n\n    with mock.patch.object(type(client.transport.set_iam_policy), \"__call__\") as call:\n        call.return_value = policy_pb2.Policy(\n            version=774,\n            etag=fdp.ConsumeBytes(20),\n        )\n        response = client.set_iam_policy(request)\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    # Create our client\n    client = TagValuesClient(\n        credentials=ga_credentials.AnonymousCredentials(),\n        transport=\"grpc\",\n    )\n\n    # Call a set of operations on the client. Using mocked responses.\n    operations = [\n        test_get_tag_value,\n        test_create_tag_value,\n        test_update_tag_value,\n        test_delete_tag_value,\n        test_get_iam_policy,\n        test_set_iam_policy\n    ]\n    number_of_calls = 20\n    for i in range(number_of_calls):\n        target = operations[fdp.ConsumeIntInRange(0, len(operations)-1)]\n        target(fdp, client)\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-resource-manager/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-resource-manager\nlanguage: python\nmain_repo: https://github.com/googleapis/google-cloud-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-resumable-media-python/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/googleapis/google-resumable-media-python\nCOPY build.sh *.py $SRC/\nWORKDIR google-resumable-media-python\n"
  },
  {
    "path": "projects/g-api-resumable-media-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-resumable-media-python/fuzz_uploader.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport io\n\n# All code is instrumented by calling atheris.instrument_all below\nfrom google.resumable_media import _upload\n\ndef test_simple(data):\n  upload = _upload.SimpleUpload(\"localhost:8008/index.html\")\n  upload._prepare_request(data, None)\n\ndef test_multipart(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  headers = {\"spin\": \"doctors\"}\n  upload = _upload.MultipartUpload(\n    \"localhost:8008/index.html\",\n    headers=headers,\n    checksum=\"md5\"\n  )\n  try:\n    upload._prepare_request(\n      fdp.ConsumeBytes(200),\n      {},\n      fdp.ConsumeString(200)\n    )\n  except UnicodeEncodeError:\n    pass\n\ndef _upload_in_flight(data, headers=None, checksum=None):\n  upload = _upload.ResumableUpload(\n    \"localhost:8008://heyo\",\n    1024 * 1024,\n    headers=headers,\n    checksum=checksum\n  )\n  upload._stream = io.BytesIO(data)\n  upload._content_type = \"text/plain\"\n  upload._total_bytes = len(data)\n  upload._resumable_url = \"localhost:8009/test.invalid?upload_id=not-none\"\n  return upload\n\n\ndef test_checksum(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  for cs in [\"md5\", \"crc32\"]:\n    upload = _upload_in_flight(fdp.ConsumeBytes(200), checksum=cs)\n    try:\n      start_byte, payload, _ = _upload.get_next_chunk(\n        upload._stream,\n        fdp.ConsumeIntInRange(1, 250),\n        fdp.ConsumeIntInRange(1, 250)\n      )\n    except ValueError:\n      pass\n  \n\ndef TestOneInput(data):\n  test_simple(data)\n  test_multipart(data)\n  test_checksum(data)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-api-resumable-media-python/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-resumable-media-python\nlanguage: python\nmain_repo: https://github.com/googleapis/google-resumable-media-python\nprimary_contact: gorcester@google.com\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-api-secret-manager/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip && pip install google-api-core google-cloud-core mock\nRUN git clone --depth 1 https://github.com/googleapis/google-cloud-python\nRUN python3 -m pip install --upgrade pip\nWORKDIR google-cloud-python\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/g-api-secret-manager/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd packages/google-cloud-secret-manager/\n\nGRPC_PYTHON_CFLAGS=\"${CFLAGS}\" GRPC_PYTHON_BUILD_SYSTEM_RE2=true GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true GRPC_PYTHON_BUILD_SYSTEM_ZLIB=true python3 -m pip install -v .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-api-secret-manager/fuzz_client.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport mock\n\nfrom google.auth import credentials\nfrom google.cloud.secretmanager_v1beta1.services.secret_manager_service import (\n    SecretManagerServiceAsyncClient,\n    SecretManagerServiceClient,\n    pagers,\n    transports,\n)\nfrom google.cloud.secretmanager_v1beta1.types import resources, service\n\ndef test_add_secret_version(client, fdp):\n    \"\"\"Calls add_secret_version on the client with data from the fuzzer\"\"\"\n\n    # Create the input.\n    if fdp.ConsumeBool():\n        request = service.AddSecretVersionRequest()\n        try:\n            request.parent = fdp.ConsumeUnicodeNoSurrogates(20)\n        except:\n            request.parent = None\n    else:\n        request = {}\n\n    parent = None\n    payload = None\n    if fdp.ConsumeBool():\n        parent = fdp.ConsumeUnicodeNoSurrogates(10)\n        request = None\n        payload = resources.SecretPayload()\n        payload.data = fdp.ConsumeBytes(10)\n\n\n    # Mock call within the gRPC stub and fake the request.\n    with mock.patch.object(\n        type(client.transport.add_secret_version), \"__call__\"\n    ) as call:\n        # Create return value for the call.\n        call.return_value = resources.SecretVersion(\n            name=\"name_value\",\n            state=resources.SecretVersion.State.ENABLED,\n        )\n\n        response = client.add_secret_version(\n            request = request,\n            parent = parent,\n            payload = payload\n        )\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    # Create a client we can call.\n    client = SecretManagerServiceClient(\n        credentials=credentials.AnonymousCredentials(),\n        transport=\"grpc\",\n    )\n    \n    test_add_secret_version(client, fdp)\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-secret-manager/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom google.cloud.secretmanager_v1beta1.services.secret_manager_service import (\n    SecretManagerServiceClient,\n)\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    SecretManagerServiceClient.parse_secret_path(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)))\n    SecretManagerServiceClient.parse_common_location_path(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)))\n    SecretManagerServiceClient.parse_common_project_path(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)))\n    SecretManagerServiceClient.parse_common_organization_path(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)))\n    SecretManagerServiceClient.parse_common_folder_path(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)))\n    SecretManagerServiceClient.parse_common_billing_account_path(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)))\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-api-secret-manager/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-secret-manager\nlanguage: python\nmain_repo: https://github.com/googleapis/python-secret-manager\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-apis-py-api-core/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/googleapis/python-api-core\nCOPY build.sh *.py $SRC/\nWORKDIR python-api-core\n"
  },
  {
    "path": "projects/g-apis-py-api-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Build flask fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-apis-py-api-core/fuzz_path_template.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from google.api_core import path_template\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  targets = [\n    \"expand\",\n    \"transcode\",\n    \"validate\"\n  ]\n  target = targets[fdp.ConsumeIntInRange(0, len(targets)-1)]\n  if target == \"expand\":\n    s1 = fdp.ConsumeString(200)\n    s2 = fdp.ConsumeString(200)\n    try:\n      path_template.expand(s1, s2)\n    except ValueError:\n      # ValueError is raised\n      # https://github.com/googleapis/python-api-core/blob/5b5e77563229687c901d77b5fdecc18168b535e6/google/api_core/path_template.py#L123\n      pass\n  elif target == \"transcode\":\n    s1 = fdp.ConsumeString(200)\n    s2 = fdp.ConsumeString(200)\n    s3 = fdp.ConsumeString(200)\n    try:\n        path_template.transcode([{'uri' : s1, 'body' : s2,'method' : s3}])\n    except ValueError:\n        # ValueError is raised:\n        # https://github.com/googleapis/python-api-core/blob/main/google/api_core/path_template.py#L260\n        pass\n  elif target == \"validate\":\n    s1 = fdp.ConsumeString(200)\n    s2 = fdp.ConsumeString(200)\n    path_template.validate(s1, s2)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-apis-py-api-core/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-api-core\nlanguage: python\nmain_repo: https://github.com/googleapis/python-api-core\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-auth-library-java/.gitignore",
    "content": "project-parent/google-auth-library-java\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/g-auth-library-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/google-auth-library-java\nRUN git clone --depth 1 https://github.com/googleapis/google-auth-library-java/ $SRC/project-parent/google-auth-library-java\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/g-auth-library-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=google-auth-library-java\nPROJECT_GROUP_ID=com.google.auth\nPROJECT_ARTIFACT_ID=google-auth-library\nMAIN_REPOSITORY=https://github.com/googleapis/google-auth-library-java/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  FUZZ_TARGET_DEPENDENCIES=\":google-auth-library-oauth2-http :google-auth-library-credentials :google-auth-library-appengine\"\n  \n  for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/g-auth-library-java/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.auth</groupId>\n            <artifactId>google-auth-library-oauth2-http</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.auth</groupId>\n            <artifactId>google-auth-library-credentials</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.auth</groupId>\n            <artifactId>google-auth-library-appengine</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.api-client</groupId>\n            <artifactId>google-api-client</artifactId>\n            <version>2.2.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.cloud</groupId>\n            <artifactId>google-cloud-storage</artifactId>\n            <version>1.113.2</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/g-auth-library-java/project-parent/fuzz-targets/src/test/java/com/example/CredentialsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.google.auth.oauth2.*;\nimport com.google.auth.http.HttpTransportFactory;\nimport com.google.api.client.http.HttpTransport;\nimport com.google.api.client.testing.http.MockHttpTransport;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\n\nclass CredentialsFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        boolean b = data.consumeBoolean();\n        MockHttpTransportFactory transportFactory = new MockHttpTransportFactory();\n        ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n        \n        try {\n            GoogleCredentials [] credentials = {\n                    b ? GoogleCredentials.fromStream(bais) : GoogleCredentials.fromStream(bais, transportFactory), \n                    b ? ServiceAccountCredentials.fromStream(bais) : ServiceAccountCredentials.fromStream(bais, transportFactory),\n                    b ? ExternalAccountCredentials.fromStream(bais) : ExternalAccountCredentials.fromStream(bais, transportFactory),\n                    b ? ExternalAccountAuthorizedUserCredentials.fromStream(bais) : ExternalAccountAuthorizedUserCredentials.fromStream(bais, transportFactory),\n                    b ? UserCredentials.fromStream(bais) : UserCredentials.fromStream(bais, transportFactory)\n                    };\n            \n            GoogleCredentials googleCredentials = data.pickValue(credentials);\n            googleCredentials.refreshIfExpired();\n            googleCredentials.refreshAccessToken();\n            googleCredentials.getAccessToken();\n        } catch (IOException expected) {\n        } catch (IllegalArgumentException | NullPointerException | ClassCastException | IllegalStateException ignored) {\n            // Need to catch in order to find more interesting bugs.\n        }\n    }\n\n    static class MockHttpTransportFactory implements HttpTransportFactory {\n        MockHttpTransport transport = new MockHttpTransport();\n\n        @Override\n        public HttpTransport create() {\n            return transport;\n        }\n    }\n}"
  },
  {
    "path": "projects/g-auth-library-java/project-parent/fuzz-targets/src/test/java/com/example/TokenVerifierFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.google.api.client.json.webtoken.JsonWebSignature;\nimport com.google.auth.oauth2.TokenVerifier;\n\nimport java.security.GeneralSecurityException;\n\nclass TokenVerifierFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        TokenVerifier tokenVerifier = TokenVerifier.newBuilder().build();\n\n        try {\n            JsonWebSignature jsonWebSignature = tokenVerifier.verify(data.consumeRemainingAsString());\n            jsonWebSignature.verifySignature();\n        } catch (TokenVerifier.VerificationException | GeneralSecurityException e) {\n        } catch (IllegalArgumentException | NullPointerException e) {\n            // Need to catch in order to find more interesting findings.\n        }\n    }\n}"
  },
  {
    "path": "projects/g-auth-library-java/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>google-auth-library-java</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/g-auth-library-java/project.yaml",
    "content": "homepage: \"developers.google.com/identity\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/googleapis/google-auth-library-java/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/g-cloud-logging-py/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/googleapis/python-logging gcloud-logging\nRUN pip3 install --upgrade pip mock\nWORKDIR gcloud-logging\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/g-cloud-logging-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-cloud-logging-py/fuzz_entries.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport google.cloud.logging_v2.entries as entries\nfrom google.cloud.logging_v2.client import Client\nfrom google.cloud.logging_v2.resource import Resource\n\ndef create_dummy_log_entry(fdp):\n    return entries.LogEntry(\n        log_name=fdp.ConsumeString(20),\n        labels={\n            fdp.ConsumeString(10):fdp.ConsumeString(20),\n            fdp.ConsumeString(10):fdp.ConsumeString(20)\n        },\n        insert_id=fdp.ConsumeString(20),\n        timestamp=fdp.ConsumeString(20),\n        resource=Resource(type=\"global\", labels={}),\n        trace=fdp.ConsumeString(20),\n        span_id=fdp.ConsumeString(20),\n        trace_sampled=fdp.ConsumeBool(),\n        source_location=LogEntrySourceLocation(\n            file=fdp.ConsumeString(20),\n            line=fdp.ConsumeString(20),\n            function=fdp.ConsumeString(20)\n        ),\n        operation=LogEntryOperation(\n            id=fdp.ConsumeString(20),\n            producer=fdp.ConsumeString(20),\n            first=fdp.ConsumeBool(),\n            last=fdp.ConsumeBool()\n        )\n    )\n\ndef TestInput(data):\n    if len(data) < 1:\n       return\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        entries._int_or_none(fdp.ConsumeInt(100))\n        entries.logger_name_from_path(fdp.ConsumeString(100))\n        entries.logger_name_from_path(fdp.ConsumeString(100),fdp.ConsumeString(50))\n\n        log_entry = create_dummy_log_entry(fdp)\n        log_entry.to_api_repr()\n\n        TextEntry(log_entry).to_api_repr()\n        StructEntry(log_entry).to_api_repr()\n        \n        protobuf_entry = ProtobufEntry(log_entry)\n        protobuf_entry.payload_pb()\n        protobuf_entry.payload_json()\n        protobuf_entry.to_api_repr()\n    except ValueError as e:\n        if \"did not match expected pattern\" not in str(e):\n            raise e\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-cloud-logging-py/fuzz_handlers.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport logging\nwith atheris.instrument_imports():\n    import google.cloud.logging_v2.handlers.handlers as handlers\n    import google.cloud.logging_v2.handlers.structured_log as log    \n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    logname = fdp.ConsumeString(100)\n    message = fdp.ConsumeString(100)\n    record = logging.LogRecord(\n        logname, logging.INFO, None, None, message, None, None\n    )\n\n    handlers.CloudLoggingFilter._infer_source_location(record)\n    filter = handlers.CloudLoggingFilter(record)\n\n    handler = log.StructuredLogHandler(\n        labels={\n            fdp.ConsumeString(10):fdp.ConsumeString(20),\n            fdp.ConsumeString(10):fdp.ConsumeString(20)\n        },\n        project_id=fdp.ConsumeString(100)\n    )\n    try:\n        handler.format(record)\n        handlers._format_and_parse_message(record, handler)\n        handlers.setup_logging(handler)\n    except ValueError as e:\n        if \"Formatting field not found in record\" not in str(e):\n            raise e\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-cloud-logging-py/fuzz_helpers.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport google.cloud.logging_v2._helpers as helpers\nimport google.cloud.logging_v2.handlers._helpers as handlers_helpers\n\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    op = fdp.ConsumeIntInRange(0, 4)\n    if op == 0:\n        helpers._normalize_severity(fdp.ConsumeInt(fdp.ConsumeIntInRange(0, 512)))\n    elif op == 1:\n        helpers._add_defaults_to_filter(fdp.ConsumeUnicodeNoSurrogates(40))\n    elif op == 2:\n        handlers_helpers._parse_trace_parent(fdp.ConsumeUnicodeNoSurrogates(300))\n    else:\n        handlers_helpers._parse_xcloud_trace(fdp.ConsumeUnicodeNoSurrogates(300))\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-cloud-logging-py/fuzz_resources.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport mock\n\nwith atheris.instrument_imports():\n    from google.cloud.logging_v2.handlers import _monitored_resources\n\n\nglobal_fdp = None\ndef mock_retrieve_metadata_server(endpoint):\n    \"\"\"Mock for retrieve_metadata_server\"\"\"\n    if global_fdp is None:\n        return None\n    if global_fdp.ConsumeIntInRange(1, 10) < 3:\n        return None\n    return global_fdp.ConsumeUnicodeNoSurrogates(30)\n\ndef TestInput(data):\n    global global_fdp\n    global_fdp = atheris.FuzzedDataProvider(data)\n\n    # Mock the metadata server to avoid connections. The\n    # retrieve_metadata_server will return fuzzer-seeded data.\n    patch = mock.patch(\n        \"google.cloud.logging_v2.handlers._monitored_resources.retrieve_metadata_server\",\n        wraps=mock_retrieve_metadata_server,\n    )\n    # TODO: randomise relevant environment variables.\n    with patch:\n        _monitored_resources.detect_resource()\n\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/g-cloud-logging-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-logging\nlanguage: python\nmain_repo: https://github.com/googleapis/python-logging\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-http-java-client/.gitignore",
    "content": "project-parent/google-http-java-client\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/g-http-java-client/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/google-http-java-client\nRUN git clone --depth 1 https://github.com/googleapis/google-http-java-client/ $SRC/project-parent/google-http-java-client\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/g-http-java-client/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=google-http-java-client\nPROJECT_GROUP_ID=com.google.http-client\nPROJECT_ARTIFACT_ID=google-http-client\nMAIN_REPOSITORY=https://github.com/googleapis/google-http-java-client/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -Denforcer.skip=true -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  FUZZ_TARGET_DEPENDENCIES=\":google-http-client :google-http-client-gson\"\n  \n  for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--target_class=com.example.$fuzzer_basename \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/g-http-java-client/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.http-client</groupId>\n            <artifactId>google-http-client</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.http-client</groupId>\n            <artifactId>google-http-client-gson</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/g-http-java-client/project-parent/fuzz-targets/src/test/java/com/example/JsonObjectParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.ByteArrayInputStream;\nimport java.nio.charset.Charset;\nimport java.lang.IllegalArgumentException;\nimport java.lang.NullPointerException;\nimport com.google.api.client.json.GenericJson;\nimport com.google.api.client.json.gson.GsonFactory;\nimport com.google.api.client.json.JsonObjectParser;\n\n\nclass JsonObjectParserFuzzer {\n  static String [] charsetArray = {\"ISO-8859-1\", \"US-ASCII\", \"UTF-16\", \"UTF-16BE\", \"UTF-16LE\", \"UTF-8\"};\n\n  @FuzzTest\n  void myFuzzTest(FuzzedDataProvider data) {\n    Charset charset = Charset.forName(data.pickValue(charsetArray));\n    boolean readLeniency = data.consumeBoolean();\n    String input = data.consumeRemainingAsString();\n\n    try {\n      JsonObjectParser parser = new JsonObjectParser(GsonFactory.builder().setReadLeniency(readLeniency).build());\n      InputStream inputStream = new ByteArrayInputStream(input.getBytes(charset));\n      GenericJson json = parser.parseAndClose(inputStream, charset, GenericJson.class);\n    } catch (IOException | IllegalArgumentException | NullPointerException e) {\n    }\n    \n  }\n}"
  },
  {
    "path": "projects/g-http-java-client/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>google-http-java-client</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/g-http-java-client/project.yaml",
    "content": "homepage: \"https://github.com/googleapis/google-http-java-client/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/googleapis/google-http-java-client/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/g-oauth-java-client/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/googleapis/google-oauth-java-client google-oauth-java-client\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/google-oauth-java-client\n"
  },
  {
    "path": "projects/g-oauth-java-client/OauthSignerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.google.api.client.auth.oauth.OAuthSigner;\nimport com.google.api.client.auth.oauth.OAuthHmacSigner;\nimport com.google.api.client.auth.oauth.OAuthHmacSha256Signer;\nimport com.google.api.client.auth.oauth.OAuthRsaSigner;\nimport java.security.GeneralSecurityException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [com.google.api.client.auth.oauth.OAuthHmacSha256Signer] public java.lang.String computeSignature(java.lang.String) throws java.security.GeneralSecurityException\n// Target method: [com.google.api.client.auth.oauth.OAuthHmacSigner] public java.lang.String computeSignature(java.lang.String) throws java.security.GeneralSecurityException\n// Target method: [com.google.api.client.auth.oauth.OAuthRsaSigner] public java.lang.String computeSignature(java.lang.String) throws java.security.GeneralSecurityException\npublic class OauthSignerFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      OAuthSigner obj = null;\n      switch (data.consumeInt(1, 3)) {\n        case 1:\n          obj = new OAuthHmacSigner();\n          break;\n        case 2:\n          obj = new OAuthHmacSha256Signer(data.consumeString(data.remainingBytes() / 2));\n          break;\n        case 3:\n          obj = new OAuthRsaSigner();\n          break;\n      }\n      obj.computeSignature(data.consumeRemainingAsString());\n    } catch (GeneralSecurityException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/g-oauth-java-client/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\ncp \"./google-oauth-client/target/google-oauth-client-$CURRENT_VERSION.jar\" $OUT/oauth.jar\n\nALL_JARS='oauth.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/g-oauth-java-client/project.yaml",
    "content": "homepage: https://github.com/googleapis/google-oauth-java-client\nmain_repo: https://github.com/googleapis/google-oauth-java-client\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/g-py-bigquery/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && \\\n    pip3 install numpy ipython grpcio\nRUN git clone https://github.com/googleapis/python-bigquery\nCOPY build.sh *.py $SRC/\nWORKDIR python-bigquery\n"
  },
  {
    "path": "projects/g-py-bigquery/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Build flask fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-py-bigquery/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport IPython\n\nwith atheris.instrument_imports():\n  from google.cloud.bigquery.magics.line_arg_parser.lexer import Lexer\n  from google.cloud.bigquery.magics.line_arg_parser.parser import Parser\n  from google.cloud.bigquery.magics.line_arg_parser.parser import ParseError\n  from google.cloud.bigquery.magics.line_arg_parser.parser import QueryParamsParseError\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  s1 = fdp.ConsumeString(sys.maxsize)\n\n  tokens = list(Lexer(s1))\n  if len(tokens) == 0:\n    return\n\n  lexer = Lexer(s1)\n  parser = Parser(lexer)\n  try:\n    parser.input_line()\n  except ParseError:\n    pass\n\n  lexer = Lexer(s1)\n  parser = Parser(lexer)\n  try:\n    parser.collection_items()\n  except QueryParamsParseError:\n    pass\n\n  lexer = Lexer(s1)\n  parser = Parser(lexer)\n  try:\n    parser.dict_items()\n  except QueryParamsParseError:\n    pass\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-py-bigquery/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-bigquery\nlanguage: python\nmain_repo: https://github.com/googleapis/python-bigquery\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/g-py-crc32c/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/googleapis/python-crc32c\nCOPY build.sh *.py $SRC/\nWORKDIR python-crc32c\n"
  },
  {
    "path": "projects/g-py-crc32c/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit submodule update --init --recursive\n\nmkdir usr\nexport CRC32C_INSTALL_PREFIX=$(pwd)/usr\n\nmkdir google_crc32c/build\ncd google_crc32c/build\ncmake \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DCRC32C_BUILD_TESTS=no \\\n  -DCRC32C_BUILD_BENCHMARKS=no \\\n  -DBUILD_SHARED_LIBS=yes \\\n  -DCMAKE_INSTALL_PREFIX:PATH=${CRC32C_INSTALL_PREFIX} \\\n  ../\nmake all install\ncd ../../\n\n\npython3 setup.py build_ext \\\n  --include-dirs=$(pwd)/usr/include \\\n  --library-dirs=$(pwd)/usr/lib \\\n  --rpath=$(pwd)/usr/lib\npip3 install -e .[testing]\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/g-py-crc32c/fuzz_checksum.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  import google_crc32c\n\ndef TestOneInput(data):\n  val1 = google_crc32c.value(data)\n  val2 = google_crc32c.Checksum(data)._crc\n  assert val1 == val2\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/g-py-crc32c/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-crc32c\nlanguage: python\nmain_repo: https://github.com/googleapis/python-crc32c\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/gast/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN git clone https://github.com/serge-sans-paille/gast gast\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/gast\n"
  },
  {
    "path": "projects/gast/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/gast/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/serge-sans-paille/gast\nlanguage: python\nmain_repo: https://github.com/serge-sans-paille/gast\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/gateway/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN apt-get update \\\n    && apt-get install -y btrfs-progs libbtrfs-dev\n\nRUN git clone --depth 1 https://github.com/envoyproxy/gateway.git\n\nRUN cd $SRC/gateway && \\\n    GO_VERSION=$(grep -oP '^go \\K[0-9]+\\.[0-9]+(\\.[0-9]+)?' go.mod | head -1) && \\\n    wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && \\\n    mkdir temp-go && \\\n    rm -rf /root/.go/* && \\\n    tar -C temp-go/ -xzf go${GO_VERSION}.linux-amd64.tar.gz && \\\n    mv temp-go/go/* /root/.go/ && \\\n    rm -rf temp-go go${GO_VERSION}.linux-amd64.tar.gz\n\nCOPY build.sh default.options $SRC/"
  },
  {
    "path": "projects/gateway/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/gateway/test/fuzz/oss_fuzz_build.sh\n\n# Copy default.options to all fuzzers in $OUT if they don't have specific options files\nfor fuzzer in \"$OUT\"/*; do\n  # Skip non-files and files with extensions\n  [[ ! -f \"$fuzzer\" ]] || [[ \"$fuzzer\" == *.* ]] && continue\n  \n  fuzzer_name=$(basename \"$fuzzer\")\n  options_file=\"$OUT/${fuzzer_name}.options\"\n  \n  if [[ ! -f \"$options_file\" ]] && [[ -f \"$SRC/default.options\" ]]; then\n    cp \"$SRC/default.options\" \"$options_file\"\n  fi\ndone\n"
  },
  {
    "path": "projects/gateway/default.options",
    "content": "[libfuzzer]\n# Increase timeout for corpus pruning\ntimeout = 300\n"
  },
  {
    "path": "projects/gateway/project.yaml",
    "content": "homepage: \"https://gateway.envoyproxy.io/\"\nmain_repo: \"https://github.com/envoyproxy/gateway.git\"\nprimary_contact: \"envoy-gateway-security@googlegroups.com\"\nauto_ccs :\n  - \"tnareddy@confluent.io\"\n  - \"sudiptobaral.me@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\n"
  },
  {
    "path": "projects/gc-iam/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && \\\n    apt-get install -y libre2-dev zlib1g-dev libssl-dev\nRUN python3 -m pip install --upgrade pip\nRUN git clone --depth 1 https://github.com/googleapis/google-cloud-python $SRC/google-cloud-python\nWORKDIR $SRC/google-cloud-python/packages/google-cloud-iam\nCOPY build.sh fuzz_*.py $SRC/\n# Ensure all relevant dependencies are installed\nRUN python3 -m pip install -r requirements.txt || :\n"
  },
  {
    "path": "projects/gc-iam/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies from setup.py\npython3 -m pip install .\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\nGRPC_PYTHON_CFLAGS=\"${CFLAGS}\" \\\nGRPC_PYTHON_BUILD_SYSTEM_RE2=true \\\nGRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true \\\nGRPC_PYTHON_BUILD_SYSTEM_ZLIB=true \\\npython3 setup.py install\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/gc-iam/fuzz_credentials.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    import google.cloud.iam_credentials_v1.services.iam_credentials as iam\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    iam.IAMCredentialsClient.service_account_path(\n        fdp.ConsumeString(100),\n        fdp.ConsumeString(100)\n    )\n    iam.IAMCredentialsClient.parse_service_account_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_service_account_path(\n        \"projects/%s/serviceAccounts/%s\"%(\n            fdp.ConsumeString(100),\n            fdp.ConsumeString(100)\n        )\n    )\n\n    iam.IAMCredentialsClient.common_billing_account_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_billing_account_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_billing_account_path(\n        \"billingAccounts/%s/\"%fdp.ConsumeString(100)\n    )\n\n    iam.IAMCredentialsClient.common_folder_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_folder_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_folder_path(\n        \"folders/%s/\"%fdp.ConsumeString(100)\n    )\n\n    iam.IAMCredentialsClient.common_organization_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_organization_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_organization_path(\n        \"organizations/%s/\"%fdp.ConsumeString(100)\n    )\n\n    iam.IAMCredentialsClient.common_project_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_project_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_project_path(\n        \"projects/%s/\"%fdp.ConsumeString(100)\n    )\n\n    iam.IAMCredentialsClient.common_location_path(\n        fdp.ConsumeString(100),\n        fdp.ConsumeString(100)\n    )\n    iam.IAMCredentialsClient.parse_common_location_path(fdp.ConsumeString(100))\n    iam.IAMCredentialsClient.parse_common_location_path(\n        \"projects/%s/locations/%s\"%(\n            fdp.ConsumeString(100),\n            fdp.ConsumeString(100)\n        )\n    )\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/gc-iam/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-iam\nlanguage: python\nmain_repo: https://github.com/googleapis/google-cloud-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/gcloud-error-py/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/googleapis/python-error-reporting gce\nWORKDIR gce\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/gcloud-error-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install mock\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/gcloud-error-py/fuzz_util.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport mock\nwith atheris.instrument_imports():\n    from google.cloud import error_reporting as error\n\nclass SampleRequest(object):\n    def __init__(self, url, method, user_agent, referrer, remote_addr):\n        self.url = url\n        self.method = method\n        self.user_agent = user_agent\n        self.referrer = referrer\n        self.remote_addr = remote_addr\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    request = SampleRequest(\n        \"http://127.0.0.1\",\n        \"GET\" if fdp.ConsumeBool() else \"POST\",\n        mock.Mock(string=fdp.ConsumeString(100)),\n        fdp.ConsumeString(100),\n        \"127.0.0.1\"\n    )\n    error.util.build_flask_context(request)\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/gcloud-error-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-error-reporting\nlanguage: python\nmain_repo: https://github.com/googleapis/python-error-reporting\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/gcloud-go/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nLABEL maintainer=\"codyoss@google.com\"\nRUN git clone https://github.com/googleapis/google-cloud-go\nCOPY build.sh $SRC/\nWORKDIR $SRC/google-cloud-go/spanner/\n"
  },
  {
    "path": "projects/gcloud-go/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n\ncompile_go_fuzzer cloud.google.com/go/spanner/spansql FuzzParseQuery fuzz_parse_query\n"
  },
  {
    "path": "projects/gcloud-go/project.yaml",
    "content": "homepage: \"https://github.com/googleapis/google-cloud-go\"\nmain_repo: \"https://github.com/googleapis/google-cloud-go\"\nprimary_contact: \"codyoss@google.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/gcp-python-cloud-storage/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && pip3 install mock\nRUN git clone https://github.com/googleapis/python-storage\nCOPY build.sh fuzz_fileio.py $SRC/\nWORKDIR python-storage\n"
  },
  {
    "path": "projects/gcp-python-cloud-storage/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/gcp-python-cloud-storage/fuzz_fileio.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport mock\n\nwith atheris.instrument_imports():\n    from google.cloud.storage.fileio import BlobReader\n\n\nglobal_data = None\ndef TestOneInput(data):\n    global_data = data\n    fdp = atheris.FuzzedDataProvider(data)\n\n    blob = mock.Mock()\n    def read_fuzz_data(start=0, end=None, **_):\n        return global_data[start:end]\n\n    blob.download_as_bytes = mock.Mock(side_effect=read_fuzz_data)\n    blob.size = len(data)\n    blob.chunk_size = None\n    download_kwargs = {\"if_metageneration_match\": 1}\n    reader = BlobReader(blob, **download_kwargs)\n    try:\n        reader.read(fdp.ConsumeIntInRange(0, len(data)*2))\n    except UnicodeDecodeError:\n        return\n\n    reader.seek(\n        pos = fdp.ConsumeIntInRange(0, len(data)*2),\n        whence = fdp.ConsumeIntInRange(0, 2)\n    )\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/gcp-python-cloud-storage/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/python-storage\nlanguage: python\nmain_repo: https://github.com/googleapis/python-storage\nprimary_contact: gorcester@google.com\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/gdal/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool g++ curl cmake sqlite3 pkg-config\n\nRUN git clone --depth 1 https://github.com/OSGeo/gdal gdal\n\nRUN cp gdal/fuzzers/build.sh $SRC/\n\nWORKDIR gdal\n\n"
  },
  {
    "path": "projects/gdal/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://gdal.org\"\nlanguage: c++\nprimary_contact: \"even.rouault@gmail.com\"\nauto_ccs:\n  - \"schwehr@gmail.com\"\n  - \"bishop.dev@gmail.com\"\n  - \"juergen.fischer@gmail.com\"\n  - \"athomas@thinkspatial.com.au\"\n  - \"ari.jolma@gmail.com\"\n  - \"bjorn.harrtell@gmail.com\"\n  - \"nyall.dawson@gmail.com\"\n  - \"uygabel@gmail.com\"\n  - \"apasotti@gmail.com\"\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/OSGeo/gdal'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/gdbm/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get -qq update && \\\n    apt-get install -qq \\\n      build-essential\\\n      git\\\n      autopoint\\\n      automake\\\n      bison\\\n      flex\\\n      libtool\\\n      texinfo\\\n      gettext\nRUN set -- $(apt-cache policy autoconf | \\\n             sed -n -r -e '/^[[:space:]]+Candidate:[[:space:]]+/{' \\\n\t            -e s/// \\\n\t\t    -e 's/-.*//' \\\n\t\t    -e 's/\\./ /g' \\\n\t\t    -e 'p}'); \\\n    if [ \"$2\" -ge 71 ]; then \\\n       apt-get install -qq autoconf; \\\n    else \\\n       (cd /usr/src && \\\n        curl -oautoconf-2.71.tar.gz https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz && \\\n\ttar xf autoconf-2.71.tar.gz && \\\n\tcd autoconf-2.71 && \\\n\t./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && \\\n\tmake install); \\\n    fi\nRUN git clone --depth 1 https://git.gnu.org.ua/gdbm.git\nWORKDIR gdbm\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/gdbm/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Bootstrap and configure project\n./bootstrap --no-po\n./configure --disable-shared --enable-debug --disable-nls\n# Build project\nmake -j$(nproc) all\n# Build fuzzer\ncd fuzz\n$CC $CFLAGS -c -I.. -I../src -I../tools -ogdbm_fuzzer.o gdbm_fuzzer.c\n$CXX $CXXFLAGS -ogdbm_fuzzer gdbm_fuzzer.o ../tools/libgdbmapp.a ../src/.libs/libgdbm.a $LIB_FUZZING_ENGINE\n\ncp gdbm_fuzzer $OUT\ncp gdbm_fuzzer.rc $OUT\n\n# Create seed\nPATH=$SRC/gdbm/tools:$PATH sh ./build_seed.sh -C seed\nzip -rj \"$OUT/gdbm_fuzzer_seed_corpus.zip\" seed/\n"
  },
  {
    "path": "projects/gdbm/project.yaml",
    "content": "homepage: \"https://www.gnu.org.ua/software/gdbm\"\nlanguage: c\nprimary_contact: \"sergey.poznyakoff@gmail.com\"\nauto_ccs:\n  - \"gray@gnu.org\"\nmain_repo: \"https://git.gnu.org.ua/gdbm.git\"\n"
  },
  {
    "path": "projects/gdbm/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Backup testsuite.at for later restore\ncp tests/testsuite.at tests/testsuite.at.backup\n\n# Temporarily disable 3 unit tests that are failing\nsed -i '/m4_include(\\[emptydatum.at\\])/d' tests/testsuite.at\nsed -i '/m4_include(\\[dumpload.at\\])/d' tests/testsuite.at\nsed -i '/m4_include(\\[coalesce.at\\])/d' tests/testsuite.at\n\nmake check -j$(nproc)\n\n# Restore the testsuite.at to pass integrity check of run_tests.sh\nmv tests/testsuite.at.backup tests/testsuite.at\n"
  },
  {
    "path": "projects/gdk-pixbuf/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y ffmpeg python3-pip gtk-doc-tools libffi-dev && \\\n    apt-get clean && \\\n    rm -rf /var/lib/apt/lists/*\nRUN pip3 install --disable-pip-version-check --no-cache-dir \\\n        pip==25.1.1\nRUN pip3 install --disable-pip-version-check --no-cache-dir \\\n        corpus-replicator \\\n        meson==1.8.2 \\\n        ninja==1.11.1.4\n\nRUN git clone --depth=1 --no-tags https://gitlab.gnome.org/GNOME/gdk-pixbuf.git\nRUN git clone --depth=1 --branch=2.84.3 https://gitlab.gnome.org/GNOME/glib.git\n\nRUN corpus-replicator -o corpus image_gif_gif_ffmpeg.yml image_jpg_jpg_ffmpeg.yml image_png_png_ffmpeg.yml image\nRUN git clone --depth=1 --no-tags https://github.com/glennrp/libpng.git && \\\n    find $SRC/gdk-pixbuf/tests/ \\( -name '*.jpeg' -o -name '*.jpg' -o -name '*.png' \\) -exec cp -v '{}' corpus/ ';' && \\\n    find $SRC/libpng -name \"*.png\" | grep -v crashers | xargs cp -t corpus/ && \\\n    zip -q $SRC/gdk-pixbuf_seed_corpus.zip corpus/* && \\\n    rm -rf libpng corpus\n\nADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/png.dict $SRC/png.dict\nADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/jpeg.dict $SRC/jpeg.dict\nADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/gif.dict $SRC/gif.dict\nRUN awk 1 $SRC/*.dict > $SRC/gdk-pixbuf.dict && \\\n    rm -f $SRC/png.dict $SRC/jpeg.dict $SRC/gif.dict\n\nWORKDIR $SRC/gdk-pixbuf\nCOPY targets $SRC/fuzz\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/gdk-pixbuf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nPREFIX=$WORK/prefix\nmkdir -p $PREFIX\n\nexport PKG_CONFIG=\"`which pkg-config` --static\"\nexport PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\nexport PATH=$PREFIX/bin:$PATH\n\nBUILD=$WORK/build\n\nrm -rf $WORK/*\nrm -rf $BUILD\nmkdir -p $BUILD\n\n# Build glib\npushd $SRC/glib\nmeson setup \\\n    --prefix=$PREFIX \\\n    --libdir=lib \\\n    --default-library=static \\\n    -Db_lundef=false \\\n    -Doss_fuzz=enabled \\\n    -Dlibmount=disabled \\\n    -Dman-pages=disabled \\\n    -Dsysprof=disabled \\\n    -Dtests=false \\\n    _builddir\nninja -C _builddir\nninja -C _builddir install\npopd\n\n# Build gdk-pixbuf\n# TODO: Enable tiff support\npushd $SRC/gdk-pixbuf\nmeson setup \\\n    --prefix=$PREFIX \\\n    --libdir=lib \\\n    --default-library=static \\\n    -Dintrospection=disabled \\\n    -Dman=false \\\n    -Ddocumentation=false \\\n    -Dtests=true \\\n    -Dinstalled_tests=false \\\n    -Dthumbnailer=disabled \\\n    -Dglycin=disabled \\\n    -Dbuiltin_loaders='all' \\\n    -Djpeg=enabled \\\n    -Dpng=enabled \\\n    -Dgif=enabled \\\n    -Dothers=enabled \\\n    -Dtiff=disabled \\\n    _builddir\nninja -C _builddir\nninja -C _builddir install\npopd\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nif [ ! -f \"${OUT}/gdk-pixbuf_seed_corpus.zip\" ]; then\n  echo \"missing seed corpus\"\n  exit 1\nfi\n\nif [ ! -f \"${OUT}/gdk-pixbuf.dict\" ]; then\n  echo \"missing dictionary\"\n  exit 1\nfi\n\nPREDEPS_LDFLAGS=\"-Wl,-Bdynamic -ldl -lm -lc -pthread -lrt -lpthread\"\nDEPS=\"gmodule-2.0 glib-2.0 gio-2.0 gobject-2.0 gdk-pixbuf-2.0\"\nBUILD_CFLAGS=\"$CFLAGS `pkg-config --static --cflags $DEPS`\"\nBUILD_LDFLAGS=\"-Wl,-static `pkg-config --static --libs $DEPS`\"\n\nfuzzers=$(find $SRC/fuzz/ -name \"*_fuzzer.c\")\nfor f in $fuzzers; do\n  fuzzer_name=$(basename $f .c)\n  $CC $CFLAGS $BUILD_CFLAGS -c $f -o $WORK/${fuzzer_name}.o\n  $CXX $CXXFLAGS \\\n    $WORK/${fuzzer_name}.o -o $OUT/${fuzzer_name} \\\n    $PREDEPS_LDFLAGS \\\n    $BUILD_LDFLAGS \\\n    $LIB_FUZZING_ENGINE \\\n    -Wl,-Bdynamic\n  ln -sf $OUT/gdk-pixbuf_seed_corpus.zip $OUT/${fuzzer_name}_seed_corpus.zip\n  ln -sf $OUT/gdk-pixbuf.dict $OUT/${fuzzer_name}.dict\ndone\n"
  },
  {
    "path": "projects/gdk-pixbuf/project.yaml",
    "content": "homepage: https://gitlab.gnome.org/GNOME/gdk-pixbuf/\nlanguage: c\nprimary_contact: ebassi@gnome.org\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://gitlab.gnome.org/GNOME/gdk-pixbuf.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/gdk-pixbuf/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Exclude the test case in the slow suite which are always killed because of timeout\nmeson test -C _builddir --no-suite \"slow\" -j$(nproc)\n"
  },
  {
    "path": "projects/gdk-pixbuf/targets/animation_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <gdk-pixbuf/gdk-pixbuf.h>\n\n#include \"fuzzer_temp_file.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size < 1) {\n        return 0;\n    }\n    GError *error = NULL;\n    GdkPixbuf *pixbuf;\n    GdkPixbufAnimation *anim;\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    anim = gdk_pixbuf_animation_new_from_file(tmpfile, &error);\n    if (error != NULL) {\n        g_clear_error(&error);\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n\n    char *buf = (char *) calloc(size + 1, sizeof(char));\n    memcpy(buf, data, size);\n    buf[size] = '\\0';\n\n    pixbuf = gdk_pixbuf_animation_get_static_image(anim);\n    if (pixbuf != NULL) {\n        unsigned int rot_amount = ((unsigned int) data[0]) % 4;\n        pixbuf = gdk_pixbuf_rotate_simple(pixbuf, rot_amount * 90);\n        gdk_pixbuf_set_option(pixbuf, buf, buf);\n        gdk_pixbuf_get_pixels(pixbuf);\n        gdk_pixbuf_get_width(pixbuf);\n        gdk_pixbuf_get_height(pixbuf);\n        g_object_unref(pixbuf);\n    }\n\n    free(buf);\n    g_object_unref(anim);\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/gdk-pixbuf/targets/fuzzer_temp_file.h",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that\n// require a file instead of an input buffer.\n\n#ifndef FUZZER_TEMP_FILE_H_\n#define FUZZER_TEMP_FILE_H_\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n// Pure-C interface for creating and cleaning up temporary files.\n\nstatic char *fuzzer_get_tmpfile(const uint8_t *data, size_t size) {\n  char *filename_buffer = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n  if (!filename_buffer) {\n    perror(\"Failed to allocate file name buffer.\");\n    abort();\n  }\n  const int file_descriptor = mkstemp(filename_buffer);\n  if (file_descriptor < 0) {\n    perror(\"Failed to make temporary file.\");\n    abort();\n  }\n  FILE *file = fdopen(file_descriptor, \"wb\");\n  if (!file) {\n    perror(\"Failed to open file descriptor.\");\n    close(file_descriptor);\n    abort();\n  }\n  const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);\n  if (bytes_written < size) {\n    close(file_descriptor);\n    fprintf(stderr, \"Failed to write all bytes to file (%zu out of %zu)\",\n            bytes_written, size);\n    abort();\n  }\n  fclose(file);\n  return filename_buffer;\n}\n\nstatic void fuzzer_release_tmpfile(char *filename) {\n  if (unlink(filename) != 0) {\n    perror(\"WARNING: Failed to delete temporary file.\");\n  }\n  free(filename);\n}\n\n// C++ RAII object for creating temporary files.\n\n#ifdef __cplusplus\nclass FuzzerTemporaryFile {\npublic:\n  FuzzerTemporaryFile(const uint8_t *data, size_t size)\n      : filename_(fuzzer_get_tmpfile(data, size)) {}\n\n  ~FuzzerTemporaryFile() { fuzzer_release_tmpfile(filename_); }\n\n  const char *filename() const { return filename_; }\n\nprivate:\n  char *filename_;\n};\n#endif\n\n#endif // FUZZER_TEMP_FILE_H_\n"
  },
  {
    "path": "projects/gdk-pixbuf/targets/pixbuf_cons_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <gdk-pixbuf/gdk-pixbuf.h>\n\n#define WIDTH 10\n#define HEIGHT 20\n#define ROWSTRIDE (WIDTH * 4)\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (!(size >= WIDTH * HEIGHT * 4)) {\n        return 0;\n    }\n    const gchar *profile;\n    GdkPixbuf *pixbuf, *tmp;\n    GBytes *bytes;\n    bytes = g_bytes_new_static(data, size);\n    pixbuf = g_object_new(GDK_TYPE_PIXBUF,\n            \"width\", WIDTH,\n            \"height\", HEIGHT,\n            \"rowstride\", ROWSTRIDE,\n            \"bits-per-sample\", 8,\"n-channels\", 3,\n            \"has-alpha\", FALSE,\n            \"pixel-bytes\", bytes,\n            NULL);\n    if (pixbuf == NULL) {\n        return 0;\n    }\n    gdk_pixbuf_scale(pixbuf, pixbuf,\n            0, 0, \n            gdk_pixbuf_get_width(pixbuf) / 4, \n            gdk_pixbuf_get_height(pixbuf) / 4,\n            0, 0, 0.5, 0.5,\n            GDK_INTERP_NEAREST);\n    unsigned int rot_amount = ((unsigned int) data[0]) % 4;\n    tmp = gdk_pixbuf_rotate_simple(pixbuf, rot_amount * 90);\n    tmp = gdk_pixbuf_flip(pixbuf, TRUE);\n    tmp = gdk_pixbuf_composite_color_simple(pixbuf,\n            gdk_pixbuf_get_width(pixbuf) / 4, \n            gdk_pixbuf_get_height(pixbuf) / 4,\n            GDK_INTERP_NEAREST,\n            128,\n            8,\n            G_MAXUINT32,\n            G_MAXUINT32/2);\n\n    char *buf = (char *) calloc(size + 1, sizeof(char));\n    memcpy(buf, data, size);\n    buf[size] = '\\0';\n\n    gdk_pixbuf_set_option(pixbuf, buf, buf);\n    profile = gdk_pixbuf_get_option(pixbuf, buf);\n    tmp = gdk_pixbuf_new_from_data(gdk_pixbuf_get_pixels(pixbuf),\n            GDK_COLORSPACE_RGB,\n            FALSE,\n            gdk_pixbuf_get_bits_per_sample(pixbuf),\n            gdk_pixbuf_get_width(pixbuf), \n            gdk_pixbuf_get_height(pixbuf),\n            gdk_pixbuf_get_rowstride(pixbuf),\n            NULL,\n            NULL);\n    tmp = gdk_pixbuf_flip(tmp, TRUE);\n\n    free(buf);\n    g_object_unref(pixbuf);\n    g_object_unref(tmp);\n    return 0;\n}\n"
  },
  {
    "path": "projects/gdk-pixbuf/targets/pixbuf_file_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <gdk-pixbuf/gdk-pixbuf.h>\n\n#include \"fuzzer_temp_file.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size < 1) {\n        return 0;\n    }\n    GdkPixbuf *pixbuf, *rotated, *scaled;\n    GError *error = NULL;\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    pixbuf = gdk_pixbuf_new_from_file(tmpfile, &error);\n    if (error != NULL) {\n        g_clear_error(&error);\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n\n    char *buf = (char *) calloc(size + 1, sizeof(char));\n    memcpy(buf, data, size);\n    buf[size] = '\\0';\n\n    gdk_pixbuf_get_width(pixbuf);\n    gdk_pixbuf_get_height(pixbuf);\n    gdk_pixbuf_get_bits_per_sample(pixbuf);\n\n    scaled = gdk_pixbuf_scale_simple(pixbuf,\n            gdk_pixbuf_get_width(pixbuf) / 4,\n            gdk_pixbuf_get_height(pixbuf) / 4,\n            GDK_INTERP_NEAREST);\n    if (scaled) g_object_unref(scaled);\n\n    unsigned int rot_amount = ((unsigned int) data[0]) % 4;\n    rotated = gdk_pixbuf_rotate_simple(pixbuf, rot_amount * 90);\n    g_object_unref(pixbuf);\n    pixbuf = rotated;\n\n    gdk_pixbuf_set_option(pixbuf, buf, buf);\n    gdk_pixbuf_get_option(pixbuf, buf);\n\n    free(buf);\n    g_clear_object(&pixbuf);\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/gdk-pixbuf/targets/pixbuf_scale_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <gdk-pixbuf/gdk-pixbuf.h>\n\n#include \"fuzzer_temp_file.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size < 1) {\n        return 0;\n    }\n    GError *error = NULL;\n    GdkPixbuf *pixbuf;\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    pixbuf = gdk_pixbuf_new_from_file_at_scale(tmpfile, 1, size, TRUE, &error);\n    if (pixbuf != NULL) {\n        g_clear_object(&pixbuf);\n    } else {\n        g_clear_error(&error);\n    }\n    pixbuf = gdk_pixbuf_new_from_file_at_scale(tmpfile, 1, size, FALSE, &error);\n    if (pixbuf != NULL) {\n        g_clear_object(&pixbuf);\n    } else {\n        g_clear_error(&error);\n    }\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/gdk-pixbuf/targets/stream_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <gdk-pixbuf/gdk-pixbuf.h>\n\n#include \"fuzzer_temp_file.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    GError *error = NULL;\n    GdkPixbuf *pixbuf;\n    GFile *file;\n    GInputStream *stream;\n\n    char *tmpfile = fuzzer_get_tmpfile(data, size);\n    file = g_file_new_for_path(tmpfile);\n    stream = (GInputStream *) g_file_read(file, NULL, &error);\n    if (error != NULL) {\n        g_clear_error(&error);\n        g_object_unref(file);\n        fuzzer_release_tmpfile(tmpfile);\n        return 0;\n    }\n\n    pixbuf = gdk_pixbuf_new_from_stream(stream, NULL, &error);\n    if (pixbuf != NULL) {\n        g_object_unref(pixbuf);\n    }\n\n    g_clear_error(&error);\n    g_object_unref(stream);\n    g_object_unref(file);\n    fuzzer_release_tmpfile(tmpfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/genshi/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/edgewall/genshi genshi\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/genshi\n"
  },
  {
    "path": "projects/genshi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/genshi/fuzz_html.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport genshi\n\nfrom genshi.path import PathSyntaxError\nfrom genshi.template.base import TemplateError\nfrom genshi.input import ParseError\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  html_raw = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  try:\n    genshi.input.HTML(html_raw)\n  except (\n      PathSyntaxError,\n      TemplateError,\n      ParseError,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/genshi/project.yaml",
    "content": "homepage: https://github.com/edgewall/genshi\nmain_repo: https://github.com/edgewall/genshi\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/geos/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake\n# fallback to github if main git server is not responding\nRUN git clone --depth 1 https://git.osgeo.org/gitea/geos/geos.git || git clone --depth 1 https://github.com/libgeos/geos.git\nCOPY run_tests.sh build.sh $SRC/\nCOPY patch.diff $SRC\nWORKDIR $SRC/geos\nRUN git apply ../patch.diff\n"
  },
  {
    "path": "projects/geos/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir build\ncd build\ncmake -DBUILD_SHARED_LIBS=OFF ..\nmake -j$(nproc)\ncp bin/fuzz* $OUT/\n"
  },
  {
    "path": "projects/geos/patch.diff",
    "content": "diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt\nindex 3401775c8..70af383b4 100644\n--- a/tests/CMakeLists.txt\n+++ b/tests/CMakeLists.txt\n@@ -10,3 +10,4 @@\n ################################################################################\n add_subdirectory(unit)\n add_subdirectory(xmltester)\n+add_subdirectory(fuzz)\ndiff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt\nnew file mode 100644\nindex 000000000..d0bd7a020\n--- /dev/null\n+++ b/tests/fuzz/CMakeLists.txt\n@@ -0,0 +1,15 @@\n+################################################################################\n+# Part of CMake configuration for GEOS\n+#\n+# Copyright (C) 2018 Mateusz Loskot <mateusz@loskot.net>\n+#\n+# This is free software; you can redistribute and/or modify it under\n+# the terms of the GNU Lesser General Public Licence as published\n+# by the Free Software Foundation.\n+# See the COPYING file for more information.\n+################################################################################\n+if(DEFINED ENV{LIB_FUZZING_ENGINE})\n+  add_executable(fuzz_geo2 fuzz_geo2.c)\n+  target_include_directories(fuzz_geo2 PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)\n+  target_link_libraries(fuzz_geo2 geos_c $ENV{LIB_FUZZING_ENGINE})\n+endif()\ndiff --git a/tests/fuzz/fuzz_geo2.c b/tests/fuzz/fuzz_geo2.c\nnew file mode 100644\nindex 000000000..ceee7ea6b\n--- /dev/null\n+++ b/tests/fuzz/fuzz_geo2.c\n@@ -0,0 +1,69 @@\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <stdint.h>\n+#include <stdarg.h>\n+#include <string.h>\n+\n+#include \"geos_c.h\"\n+\n+static int initialized = 0;\n+FILE * flogOut;\n+\n+void\n+notice(const char *fmt, ...) {\n+    va_list ap;\n+    fprintf( flogOut, \"NOTICE: \");\n+    va_start (ap, fmt);\n+    vfprintf( flogOut, fmt, ap);\n+    va_end(ap);\n+    fprintf( flogOut, \"\\n\" );\n+}\n+\n+void\n+log_and_exit(const char *fmt, ...) {\n+    va_list ap;\n+    fprintf( flogOut, \"ERROR: \");\n+    va_start (ap, fmt);\n+    vfprintf( flogOut, fmt, ap);\n+    va_end(ap);\n+    fprintf( flogOut, \"\\n\" );\n+}\n+\n+int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n+    if (initialized == 0) {\n+        flogOut = fopen(\"/dev/null\", \"wb\");\n+        initGEOS(notice, log_and_exit);\n+        initialized = 1;\n+    }\n+    size_t sep;\n+    for (sep = 0; sep < Size; sep ++) {\n+        if (Data[sep] == 0) {\n+            break;\n+        }\n+    }\n+    if (sep == Size) {\n+        return 0;\n+    }\n+    GEOSGeometry *g1 = GEOSGeomFromWKT(Data);\n+\n+    if (g1 != NULL) {\n+        GEOSGeometry *g2 = GEOSGeomFromWKB_buf(Data+sep, Size-sep);\n+        if (g2 != NULL) {\n+            size_t usize;\n+            GEOSGeometry *g3 = GEOSIntersection(g1, g2);\n+            GEOSGeom_destroy(g3);\n+            g3 = GEOSDifference(g1, g2);\n+            GEOSGeom_destroy(g3);\n+            g3 = GEOSUnion(g1, g2);\n+            GEOSGeom_destroy(g3);\n+            unsigned char* uptr = GEOSGeomToWKB_buf(g1, &usize);\n+            free(uptr);\n+            GEOSGeom_destroy(g2);\n+        }\n+        char * r = GEOSGeomToWKT(g1);\n+        free(r);\n+        GEOSGeom_destroy(g1);\n+    }\n+    return 0;\n+}\n+\n"
  },
  {
    "path": "projects/geos/project.yaml",
    "content": "homepage: \"https://geos.osgeo.org\"\nlanguage: c++\nprimary_contact: \"mtnclimb@gmail.com\"\nauto_ccs :\n- \"strk@kbt.io\"\n- \"lr@pcorp.us\"\n- \"p.antoine@catenacyber.fr\"\n\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://git.osgeo.org/gitea/geos/geos.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/geos/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build\n"
  },
  {
    "path": "projects/gfwx/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/guidovranken/gfwx-fuzzers.git gfwx-fuzzers\nWORKDIR gfwx-fuzzers\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/gfwx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\nmake\n\ncp fuzzer-encoder $OUT/\ncp fuzzer-encoder_seed_corpus.zip $OUT/\n\ncp fuzzer-decoder $OUT/\ncp fuzzer-decoder_seed_corpus.zip $OUT/\n"
  },
  {
    "path": "projects/gfwx/project.yaml",
    "content": "homepage: \"http://www.gfwx.org/\"\nlanguage: c++\nprimary_contact: \"fyffe@google.com\"\nmain_repo: \"https://github.com/kalcutter/gfwx\"\nsanitizers:\n - address\n - undefined\n - memory\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/ghostscript/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y autoconf zlibc libtool liblcms2-dev libpng-dev\nRUN git clone --branch branch-2.2 --single-branch --depth 1 https://github.com/apple/cups.git cups\nRUN git clone --branch VER-2-14-0 --single-branch --depth 1 https://git.savannah.gnu.org/git/freetype/freetype2.git freetype\nRUN git clone --single-branch --depth 1 git://git.ghostscript.com/ghostpdl.git ghostpdl\nRUN mkdir ghostpdl/fuzz\n\nCOPY pdf_seeds $SRC/pdf_seeds\nCOPY dicts $SRC/dicts\n\nWORKDIR ghostpdl\n\nCOPY *.cc *.options *.h $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/ghostscript/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build CUPS\npushd $SRC/cups\n# Fix bad line\nsed -i '2110s/\\(\\s\\)f->value/\\1(int)f->value/' cups/ppd-cache.c\n\nLSB_BUILD=y ./configure --prefix=\"$WORK\" --libdir=\"$OUT\" --disable-gnutls \\\n   --disable-libusb --with-components=core\n\nmake clean\nmake install-headers install-libs\nmake -C filter libs install-libs\ninstall -m755 cups-config \"$WORK\"/cups-config\npopd\n\nrm -rf cups/libs || die\nrm -rf freetype || die\nrm -rf zlib || die\n\nmv $SRC/freetype freetype\n\nCUPSCONFIG=\"$WORK/cups-config\"\nCUPS_CFLAGS=$($CUPSCONFIG --cflags)\nCUPS_LDFLAGS=$($CUPSCONFIG --ldflags)\nCUPS_LIBS=$($CUPSCONFIG --image --libs)\nexport CXXFLAGS=\"$CXXFLAGS $CUPS_CFLAGS\"\n\nCPPFLAGS=\"${CPPFLAGS:-} $CUPS_CFLAGS -DPACIFY_VALGRIND\" ./autogen.sh \\\n  CUPSCONFIG=$CUPSCONFIG \\\n  --enable-freetype --enable-fontconfig \\\n  --enable-cups --with-ijs --with-jbig2dec \\\n  --with-drivers=pdfwrite,cups,ljet4,laserjet,pxlmono,pxlcolor,pcl3,uniprint,pgmraw,ps2write,png16m,tiffsep1,faxg3,psdcmyk,eps2write,bmpmono,xpswrite\nmake -j$(nproc) libgs\n\nfuzzers=\"gstoraster_fuzzer                \\\n         gstoraster_fuzzer_all_colors     \\\n         gstoraster_ps_fuzzer             \\\n         gstoraster_pdf_fuzzer            \\\n         gs_device_pdfwrite_fuzzer        \\\n         gs_device_pxlmono_fuzzer         \\\n         gs_device_pgmraw_fuzzer          \\\n         gs_device_ps2write_fuzzer        \\\n         gs_device_png16m_fuzzer          \\\n         gs_device_psdcmyk_fuzzer         \\\n         gs_device_eps2write_fuzzer       \\\n         gs_device_faxg3_fuzzer           \\\n         gs_device_bmpmono_fuzzer         \\\n         gs_device_xpswrite_fuzzer        \\\n         gs_device_pxlcolor_fuzzer        \\\n         gs_device_tiffsep1_fuzzer        \\\n         gs_device_pdfwrite_opts_fuzzer\"\n\nfor fuzzer in $fuzzers; do\n  $CXX $CXXFLAGS $CUPS_LDFLAGS -std=c++11 -I. -I$SRC \\\n    $SRC/${fuzzer}.cc \\\n    -o \"$OUT/${fuzzer}\" \\\n    -Wl,-rpath='$ORIGIN' \\\n    $CUPS_LIBS \\\n    $LIB_FUZZING_ENGINE bin/gs.a\ndone\n\n# Create PDF seed corpus\nzip -j \"$OUT/gstoraster_pdf_fuzzer_seed_corpus.zip\" $SRC/pdf_seeds/*\n\n# Create corpus for gstoraster_fuzzer_all_colors. Only use seeds of a few KB in size.\nmkdir -p \"$WORK/all_color_seeds\"\nfor f in examples/ridt91.eps examples/snowflak.ps $SRC/pdf_seeds/pdf.pdf; do\n  # Prepend a single byte to seed, because it's used to determine the color\n  # scheme in the gstoraster_fuzzer_all_colors.\n  printf \"\\x01\" | cat - \"$f\" > tmp_file.txt\n  mv tmp_file.txt $f\n  s=$(sha1sum \"$f\" | awk '{print $1}')\n  cp \"$f\" \"$WORK/all_color_seeds/$s\"\ndone\nzip -j \"$OUT/gstoraster_fuzzer_all_colors_seed_corpus.zip\" \"$WORK\"/all_color_seeds/*\n\n# Do the same thing with pdfwrites opt fuzzer, but multiple bytes\nmkdir -p \"$WORK/gs_device_pdfwrite_opts_fuzzer_seeds\"\nfor f in examples/ridt91.eps examples/snowflak.ps $SRC/pdf_seeds/pdf.pdf; do\n  # Prepend the number of bytes used for picking options in the opts fuzzer\n  printf \"\\x01\\x01\" | cat - \"$f\" > tmp_file.txt\n  mv tmp_file.txt $f\n  s=$(sha1sum \"$f\" | awk '{print $1}')\n  cp \"$f\" \"$WORK/gs_device_pdfwrite_opts_fuzzer_seeds/$s\"\ndone\nzip -j \"$OUT/gs_device_pdfwrite_opts_fuzzer_seed_corpus.zip\" \"$WORK\"/gs_device_pdfwrite_opts_fuzzer_seeds/*\n\n# Create seeds for gstoraster_fuzzer\nmkdir -p \"$WORK/seeds\"\nfor f in examples/*.{ps,pdf}; do\n  s=$(sha1sum \"$f\" | awk '{print $1}')\n  cp \"$f\" \"$WORK/seeds/$s\"\ndone\n\n# Create corpus for gstoraster_fuzzer\nzip -j \"$OUT/gstoraster_fuzzer_seed_corpus.zip\" \"$WORK\"/seeds/*\ncp \"$OUT/gstoraster_fuzzer_seed_corpus.zip\" \"$OUT/gs_device_pdfwrite_fuzzer_seed_corpus.zip\"\ncp \"$OUT/gstoraster_fuzzer_seed_corpus.zip\" \"$OUT/gs_device_pxlmono_fuzzer_seed_corpus.zip\"\ncp \"$OUT/gstoraster_fuzzer_seed_corpus.zip\" \"$OUT/gs_device_eps2write_fuzzer_seed_corpus.zip\"\ncp \"$OUT/gstoraster_fuzzer_seed_corpus.zip\" \"$OUT/gs_device_bmpmono_fuzzer_seed_corpus.zip\"\ncp \"$OUT/gstoraster_fuzzer_seed_corpus.zip\" \"$OUT/gs_device_xpswrite_fuzzer_seed_corpus.zip\"\ncp \"$OUT/gstoraster_fuzzer_seed_corpus.zip\" \"$OUT/gs_device_pxlcolor_fuzzer_seed_corpus.zip\"\n\n# Copy out options\ncp $SRC/*.options $OUT/\n\n# Copy out dictionary\nfuzzers_with_dict=\"gstoraster_fuzzer  \\\n         gstoraster_fuzzer_all_colors \\\n         gstoraster_pdf_fuzzer        \\\n         gs_device_pdfwrite_fuzzer    \\\n         gs_device_faxg3_fuzzer       \\\n         gs_device_bmpmono_fuzzer     \\\n         gs_device_xpswrite_fuzzer\"\n\nfor fuzzer in $fuzzers_with_dict; do\n  cp $SRC/dicts/pdf.dict $OUT/${fuzzer}.dict\ndone\ncp $SRC/dicts/ps.dict $OUT/gstoraster_ps_fuzzer.dict\n"
  },
  {
    "path": "projects/ghostscript/dicts/pdf.dict",
    "content": "#\n# AFL dictionary for PDF\n# ----------------------\n#\n# This is a pretty big PDF dictionary constructed by Ben by manually reviewing\n# the spec and combining that with the data pulled out of a corpus of sample\n# PDFs.\n#\n# Contributed by Ben Nagy <ben@iagu.net>\n#\n\n\"#\"\n\"%\"\n\"%%\"\n\"%%EOF\"\n\"%FDF-1.7\"\n\"%PDF-1.7\"\n\"(\"\n\"(/xdp:xdp)\"\n\"(\\\\001)\"\n\"(config)\"\n\"(datasets)\"\n\"(template)\"\n\"(xdp:xdp)\"\n\")\"\n\"-1\"\n\"-1.0\"\n\"..\"\n\"/\"\n\"/#23clipboard\"\n\"/.notdef\"\n\"/1\"\n\"/1.0\"\n\"/1.3\"\n\"/3D\"\n\"/3DA\"\n\"/3DAnimationStyle\"\n\"/3DB\"\n\"/3DD\"\n\"/3DI\"\n\"/3DLightingScheme\"\n\"/3DRenderMode\"\n\"/3DV\"\n\"/3DView\"\n\"/90pv-RKSJ-H\"\n\"/A\"\n\"/A0\"\n\"/A85\"\n\"/AA\"\n\"/AAIC\"\n\"/AAPL\"\n\"/ABCDEF+ACaslonPro-Regular\"\n\"/ABCDEF+AJensonPro-LtIt\"\n\"/ABCDEF+AdobeCorpID-MinionRg\"\n\"/ABCDEF+Arial,Bold\"\n\"/ABCDEF+BankGothicMdBT\"\n\"/ABCDEF+Bauhaus-Heavy\"\n\"/ABCDEF+BluesClues\"\n\"/ABCDEF+BodegaSans\"\n\"/ABCDEF+BodoniMTCondensed\"\n\"/ABCDEF+BookAntiqua\"\n\"/ABCDEF+CMBX10\"\n\"/ABCDEF+CaflischScriptPro-Regular\"\n\"/ABCDEF+CityBlueprint\"\n\"/ABCDEF+CourierNewPSMT\"\n\"/ABCDEF+FixedsysExcelsior2.00\"\n\"/ABCDEF+MSTT31854bd45bo188067S00\"\n\"/ABCDEF+MinionPro-BoldCnIt\"\n\"/ABCDEF+MyriadMM-It_400_300_\"\n\"/ABCDEF+Wingdings\"\n\"/ABCDEF+ZapfDingbats\"\n\"/AC\"\n\"/ADBE\"\n\"/ADB_DEVICE_DEFAULT_STYLE\"\n\"/ADB_DefaultStyle\"\n\"/ADB_NO_TRAP_STYLE\"\n\"/AE\"\n\"/AESV2\"\n\"/AGaramond\"\n\"/AH\"\n\"/AI8DstIndex\"\n\"/AI8SrcIndex\"\n\"/AIMetaData\"\n\"/AIPDFPrivateData1\"\n\"/AIS\"\n\"/AL\"\n\"/AN\"\n\"/AP\"\n\"/AS\"\n\"/ASCII85Decode\"\n\"/ASCIIHexDecode\"\n\"/ASomewhatLongerName\"\n\"/AU\"\n\"/Aacute\"\n\"/Acc.#20Prod.#202501#20#2F2#20#20\"\n\"/Accounts#20payable\"\n\"/AccurateScreens\"\n\"/Acircumflex\"\n\"/AcroForm\"\n\"/Action\"\n\"/Actual\"\n\"/Add\"\n\"/Adieresis\"\n\"/Adobe\"\n\"/Adobe#20PDF#20Library\"\n\"/Adobe.PPKLite\"\n\"/AdobeCorpID-Acrobat\"\n\"/AdobeCorpID-MinionRg\"\n\"/AdobePhotoshop\"\n\"/Agrave\"\n\"/All\"\n\"/AllKO\"\n\"/AllOn\"\n\"/Alt\"\n\"/Alternate\"\n\"/AlternatePresentations\"\n\"/Alternates\"\n\"/Amex\"\n\"/And\"\n\"/Angle\"\n\"/Annot\"\n\"/Annots\"\n\"/AntiAlias\"\n\"/AnyOn\"\n\"/Apag_PDFX_Checkup\"\n\"/App\"\n\"/Architecture-Normal\"\n\"/Arial\"\n\"/Aring\"\n\"/Art\"\n\"/ArtBox\"\n\"/Article\"\n\"/Artifact\"\n\"/Artwork\"\n\"/Ascent\"\n\"/Aspect\"\n\"/Assistant\"\n\"/Atilde\"\n\"/AuthEvent\"\n\"/Author\"\n\"/Avenir-Heavy\"\n\"/Avenir-MediumOblique\"\n\"/AvgWidth\"\n\"/BBox\"\n\"/BC\"\n\"/BCL\"\n\"/BDC\"\n\"/BDL\"\n\"/BE\"\n\"/BFSOL\"\n\"/BG\"\n\"/BG2\"\n\"/BM\"\n\"/BMC\"\n\"/BS\"\n\"/BW\"\n\"/Bank\"\n\"/BaseEncoding\"\n\"/BaseFont\"\n\"/BaseState\"\n\"/BaseVersion\"\n\"/Birch\"\n\"/BitsPerComponent\"\n\"/BitsPerCoordinate\"\n\"/BitsPerFlag\"\n\"/BitsPerSample\"\n\"/Bl\"\n\"/BlCDel\"\n\"/BlMiNu\"\n\"/Black\"\n\"/BlackIs1\"\n\"/BlackOP\"\n\"/BlackPoint\"\n\"/BleedBox\"\n\"/Blend\"\n\"/Block\"\n\"/Blue\"\n\"/BluesClues\"\n\"/Bookshelf\"\n\"/Border\"\n\"/Bounds\"\n\"/BoxColorInfo\"\n\"/Btn\"\n\"/BulmerMT-BoldDisplay\"\n\"/ByteRange\"\n\"/C\"\n\"/C0\"\n\"/C0_0\"\n\"/C1\"\n\"/C2W\"\n\"/C3\"\n\"/CALS_AIS\"\n\"/CALS_BM\"\n\"/CALS_HT\"\n\"/CALS_SMASK\"\n\"/CALS_ca\"\n\"/CAM\"\n\"/CB\"\n\"/CC\"\n\"/CCH\"\n\"/CCITTFaxDecode\"\n\"/CD\"\n\"/CDL\"\n\"/CEN\"\n\"/CF\"\n\"/CFM\"\n\"/CI\"\n\"/CIDFontType0\"\n\"/CIDFontType0C\"\n\"/CIDFontType2\"\n\"/CIDInit\"\n\"/CIDSet\"\n\"/CIDSystemInfo\"\n\"/CIDToGIDMap\"\n\"/CMV_LabBar\"\n\"/CMV_LabControl\"\n\"/CMYK\"\n\"/CMYK#20#2880,#208,#2034,#200#29\"\n\"/CMap\"\n\"/CMapName\"\n\"/CMapType\"\n\"/CMapVersion\"\n\"/CO\"\n\"/CP\"\n\"/CS\"\n\"/CS0\"\n\"/CT\"\n\"/CV\"\n\"/CalGray\"\n\"/CalRGB\"\n\"/CapHeight\"\n\"/Caption\"\n\"/Caslon540BT-Roman\"\n\"/CaslonBT-Bold\"\n\"/CaslonBT-BoldItalic\"\n\"/Catalog\"\n\"/Category\"\n\"/Ccedilla\"\n\"/CenturySchoolbookBT-Roman\"\n\"/Ch\"\n\"/Chair\"\n\"/Chap\"\n\"/Chaparral-Display\"\n\"/CharProcs\"\n\"/CharSet\"\n\"/CheckSum\"\n\"/Circle\"\n\"/ClarendonBT-Black\"\n\"/ClassMap\"\n\"/Clearface-Black\"\n\"/Clip\"\n\"/ClippedText\"\n\"/Cn\"\n\"/Collection\"\n\"/CollectionItem\"\n\"/CollectionSchema\"\n\"/CollectionSubitem\"\n\"/Color\"\n\"/ColorBurn\"\n\"/ColorDodge\"\n\"/ColorMatch\"\n\"/ColorSpace\"\n\"/ColorTransform\"\n\"/ColorType\"\n\"/Colorants\"\n\"/Colors\"\n\"/Columns\"\n\"/ComicSansMS,Bold\"\n\"/Comment\"\n\"/Comments\"\n\"/Company\"\n\"/Compatibility\"\n\"/Compatible\"\n\"/Components\"\n\"/CompressArt\"\n\"/Condensed\"\n\"/Configs\"\n\"/Consultant\"\n\"/ContainerVersion\"\n\"/Contents\"\n\"/Coords\"\n\"/Copy\"\n\"/Copy#20center\"\n\"/Cor\"\n\"/Corner#20surface\"\n\"/CosineDot\"\n\"/Count\"\n\"/Cour\"\n\"/Courier\"\n\"/Create\"\n\"/CreationDate\"\n\"/Creator\"\n\"/CreatorInfo\"\n\"/CreatorVersion\"\n\"/CropBox\"\n\"/CropFixed\"\n\"/CropRect\"\n\"/Crypt\"\n\"/CryptFilter\"\n\"/CryptFilterDecodeParms\"\n\"/Cs12\"\n\"/Cs3\"\n\"/Cyan\"\n\"/D\"\n\"/DA\"\n\"/DCTDecode\"\n\"/DIC#202525p*\"\n\"/DIS\"\n\"/DL\"\n\"/DOS\"\n\"/DP\"\n\"/DR\"\n\"/DS\"\n\"/DSz\"\n\"/DV\"\n\"/DW\"\n\"/DamagedRowsBeforeError\"\n\"/Darken\"\n\"/Data\"\n\"/Date\"\n\"/Decode\"\n\"/DecodeParms\"\n\"/DefEmbeddedFile\"\n\"/Default\"\n\"/DefaultCryptFilter\"\n\"/DefaultForPrinting\"\n\"/DefaultRGB\"\n\"/Delete\"\n\"/Delta\"\n\"/DescendantFonts\"\n\"/Descent\"\n\"/Description\"\n\"/Design\"\n\"/Dest\"\n\"/DestOutputProfile\"\n\"/DestOutputProfileRef\"\n\"/Dests\"\n\"/DeviceCMYK\"\n\"/DeviceGray\"\n\"/DeviceN\"\n\"/DeviceRGB\"\n\"/Difference\"\n\"/Differences\"\n\"/DigestLocation\"\n\"/DigestMethod\"\n\"/DigestValue\"\n\"/Dimmed\"\n\"/Direction\"\n\"/DisplayDocTitle\"\n\"/Dissolve\"\n\"/Div\"\n\"/Dm\"\n\"/DocMDP\"\n\"/DocOpen\"\n\"/Document\"\n\"/Documents\"\n\"/Domain\"\n\"/Door\"\n\"/DotGain\"\n\"/Draw\"\n\"/Dt\"\n\"/Dur\"\n\"/Dynamic#20connector\"\n\"/E\"\n\"/EF\"\n\"/EFF\"\n\"/EMC\"\n\"/Eacute\"\n\"/EarlyChange\"\n\"/Ecircumflex\"\n\"/Edieresis\"\n\"/Editable\"\n\"/Egrave\"\n\"/EmbedFonts\"\n\"/EmbedICCProfile\"\n\"/Embedded\"\n\"/EmbeddedFile\"\n\"/EmbeddedFiles\"\n\"/Encode\"\n\"/EncodedByteAlign\"\n\"/Encoding\"\n\"/Encrypt\"\n\"/EncryptMetadata\"\n\"/EndIndent\"\n\"/EndOfBlock\"\n\"/EndOfLine\"\n\"/Euro\"\n\"/Euro.037\"\n\"/Event\"\n\"/ExData\"\n\"/Exchange-Pro\"\n\"/Exclude\"\n\"/Exclusion\"\n\"/Executive\"\n\"/Export\"\n\"/ExportCrispy\"\n\"/ExportState\"\n\"/ExtGState\"\n\"/Extend\"\n\"/Extends\"\n\"/ExtensionLevel\"\n\"/Extensions\"\n\"/F1\"\n\"/F1.0\"\n\"/F12\"\n\"/F13\"\n\"/F3\"\n\"/F5\"\n\"/F6\"\n\"/F7\"\n\"/F8\"\n\"/FB\"\n\"/FD\"\n\"/FDecodeParms\"\n\"/FFilter\"\n\"/FICL\"\n\"/FM\"\n\"/FOV\"\n\"/FRM\"\n\"/FS\"\n\"/FT\"\n\"/Facilities\"\n\"/Fade\"\n\"/False\"\n\"/Feature\"\n\"/FedEx#20Orange\"\n\"/FedEx#20Purple\"\n\"/Field\"\n\"/Fields\"\n\"/Figure\"\n\"/File\"\n\"/Files\"\n\"/Filespec\"\n\"/FillIn\"\n\"/Filter\"\n\"/First\"\n\"/FirstChar\"\n\"/FirstPage\"\n\"/Fit\"\n\"/FitB\"\n\"/FitBH\"\n\"/FitBV\"\n\"/FitH\"\n\"/FitR\"\n\"/FitV\"\n\"/FitWindow\"\n\"/FixedPrint\"\n\"/Flags\"\n\"/FlateDecode\"\n\"/Fm0\"\n\"/Fm4\"\n\"/Fo\"\n\"/Focoltone#201047\"\n\"/Font\"\n\"/FontBBox\"\n\"/FontDescriptor\"\n\"/FontFamily\"\n\"/FontFile\"\n\"/FontFile2\"\n\"/FontMatrix\"\n\"/FontName\"\n\"/FontStretch\"\n\"/FontWeight\"\n\"/Form\"\n\"/FormEx\"\n\"/FormType\"\n\"/FreeText\"\n\"/FreeTextCallout\"\n\"/Frequency\"\n\"/FullSave\"\n\"/FullScreen\"\n\"/Function\"\n\"/FunctionType\"\n\"/Functions\"\n\"/Futura-Bold\"\n\"/Futura-CondensedExtraBold\"\n\"/G\"\n\"/G02\"\n\"/GLGR\"\n\"/GS0\"\n\"/GS1\"\n\"/GS2\"\n\"/GTS\"\n\"/GTS_PDFA1\"\n\"/GTS_PDFX\"\n\"/GTS_PDFXConformance\"\n\"/GTS_PDFXVersion\"\n\"/GWG#20Green\"\n\"/Gamma\"\n\"/Garamond\"\n\"/Georgia,Bold\"\n\"/GoTo\"\n\"/GoTo3DView\"\n\"/GoToE\"\n\"/GoToR\"\n\"/Gold\"\n\"/Goudy\"\n\"/Gray\"\n\"/Green\"\n\"/GreymantleMVB\"\n\"/GrotesqueMT\"\n\"/Group\"\n\"/H\"\n\"/HDAG_Tools\"\n\"/HKana\"\n\"/HT\"\n\"/HT2\"\n\"/Halftone\"\n\"/HalftoneName\"\n\"/HalftoneType\"\n\"/HardLight\"\n\"/HeBo\"\n\"/Head1\"\n\"/Headlamp\"\n\"/Height\"\n\"/HeiseiMin\"\n\"/Helv\"\n\"/Helvetica\"\n\"/Helvetica-Bold\"\n\"/Helvetica-BoldOblique\"\n\"/Helvetica-Condensed\"\n\"/HelveticaNeue-Black\"\n\"/Hide\"\n\"/HonMincho-M\"\n\"/Horizontal\"\n\"/Hue\"\n\"/I\"\n\"/I0\"\n\"/IC\"\n\"/ICCBased\"\n\"/ICCVersion\"\n\"/ID\"\n\"/IDS\"\n\"/IDTree\"\n\"/IEC\"\n\"/IF\"\n\"/IN\"\n\"/ISO32000Registry\"\n\"/ISO_PDFE1\"\n\"/ISO_PDFEVersion\"\n\"/IT\"\n\"/ITO\"\n\"/ITP\"\n\"/IV\"\n\"/IX\"\n\"/Icircumflex\"\n\"/Icon\"\n\"/Identity\"\n\"/Identity-H\"\n\"/IgnEP\"\n\"/Illustrator\"\n\"/Illustrator8.0\"\n\"/Im0\"\n\"/Im1\"\n\"/Im2\"\n\"/Im3\"\n\"/Im4\"\n\"/Image\"\n\"/Image1\"\n\"/ImageB\"\n\"/ImageC\"\n\"/ImageI\"\n\"/ImageMask\"\n\"/ImageResources\"\n\"/ImageType\"\n\"/Import\"\n\"/ImportData\"\n\"/ImpressBT-Regular\"\n\"/Index\"\n\"/Indexed\"\n\"/Info\"\n\"/Information#20services\"\n\"/Ink\"\n\"/InkList\"\n\"/InsertPages\"\n\"/Insignia\"\n\"/IntegerItem\"\n\"/Intent\"\n\"/Interpolate\"\n\"/ItalicAngle\"\n\"/ItcKabel-Ultra\"\n\"/Item1\"\n\"/Item2\"\n\"/JBIG2Decode\"\n\"/JBIG2Globals\"\n\"/JPXDecode\"\n\"/JS\"\n\"/JT\"\n\"/JTC\"\n\"/JTF\"\n\"/JTFile\"\n\"/JTM\"\n\"/JavaScript\"\n\"/JobTicketContents\"\n\"/Justify\"\n\"/Keywords\"\n\"/Kids\"\n\"/L\"\n\"/L1\"\n\"/L1a\"\n\"/L1b\"\n\"/L2R\"\n\"/L50188\"\n\"/LBody\"\n\"/LI\"\n\"/LL\"\n\"/LLE\"\n\"/LLO\"\n\"/LS\"\n\"/LSP\"\n\"/LZW\"\n\"/LZWDecode\"\n\"/Lab\"\n\"/Lang\"\n\"/Last\"\n\"/LastChar\"\n\"/LastItem\"\n\"/LastModified\"\n\"/Lateral#20file\"\n\"/Launch\"\n\"/Layout\"\n\"/Lbl\"\n\"/Leading\"\n\"/Legal\"\n\"/Length\"\n\"/Length1\"\n\"/Length2\"\n\"/Length3\"\n\"/LetterspaceFlags\"\n\"/Lighten\"\n\"/Limits\"\n\"/Line\"\n\"/LineDimension\"\n\"/LineHeight\"\n\"/Linear\"\n\"/Linearized\"\n\"/Link\"\n\"/Locked\"\n\"/LogoGreen\"\n\"/LrTb\"\n\"/Lslash\"\n\"/Luminosity\"\n\"/M\"\n\"/MB\"\n\"/MC\"\n\"/MC0\"\n\"/MCD\"\n\"/MCID\"\n\"/MCR\"\n\"/MD5\"\n\"/MH\"\n\"/MIT\"\n\"/MK\"\n\"/MMType1\"\n\"/MP\"\n\"/MR\"\n\"/MS\"\n\"/MUX#20#2F#20DEMUX\"\n\"/Mac\"\n\"/MacRomanEncoding\"\n\"/Magenta\"\n\"/Manager\"\n\"/MarkInfo\"\n\"/Marked\"\n\"/MarkedPDF\"\n\"/Marker#20board\"\n\"/Markup3D\"\n\"/Mask\"\n\"/Mastercard\"\n\"/Matrix\"\n\"/Max\"\n\"/MaxLen\"\n\"/MaxWidth\"\n\"/Me\"\n\"/Measure\"\n\"/MediaBox\"\n\"/MetaData\"\n\"/Min\"\n\"/MinionMM\"\n\"/MissingWidth\"\n\"/MixedContainer\"\n\"/MixingHints\"\n\"/ModDate\"\n\"/Mode\"\n\"/Modify\"\n\"/Movie\"\n\"/Msg\"\n\"/MurrayHillBT-Bold\"\n\"/MxGeom\"\n\"/MxLaNu\"\n\"/MxPts\"\n\"/MyriadPro-Black\"\n\"/NA\"\n\"/NChannel\"\n\"/ND\"\n\"/NL\"\n\"/NM\"\n\"/NR\"\n\"/Name\"\n\"/Name1\"\n\"/Named\"\n\"/Names\"\n\"/NeedsRendering\"\n\"/NewCenturySchlbk-Italic\"\n\"/NewWindow\"\n\"/Next\"\n\"/NextPage\"\n\"/No\"\n\"/NonEFontNoWarn\"\n\"/NonStruct\"\n\"/None\"\n\"/Normal\"\n\"/Not\"\n\"/NotDefSpecial\"\n\"/NumBlock\"\n\"/Nums\"\n\"/OB\"\n\"/OBJR\"\n\"/OC\"\n\"/OC2\"\n\"/OC3\"\n\"/OC4\"\n\"/OCG\"\n\"/OCGs\"\n\"/OCL\"\n\"/OCMD\"\n\"/OCProperties\"\n\"/OE\"\n\"/OFF\"\n\"/OLN\"\n\"/ON\"\n\"/OOL\"\n\"/OPBG\"\n\"/OPBS\"\n\"/OPI\"\n\"/OPM\"\n\"/OS\"\n\"/OT\"\n\"/Oacute\"\n\"/Obj\"\n\"/ObjStm\"\n\"/Ocircumflex\"\n\"/Odieresis\"\n\"/Ograve\"\n\"/Omega\"\n\"/OneColumn\"\n\"/Online\"\n\"/Open\"\n\"/OpenAction\"\n\"/Operation\"\n\"/Opt\"\n\"/OptionSet\"\n\"/Options\"\n\"/Or\"\n\"/Orange\"\n\"/Order\"\n\"/Ordering\"\n\"/OriginalLayerName\"\n\"/Oslash\"\n\"/Otilde\"\n\"/Outlines\"\n\"/OutputCondition\"\n\"/OutputConditionIdentifier\"\n\"/OutputIntent\"\n\"/OutputIntents\"\n\"/Overlay\"\n\"/P0\"\n\"/P1\"\n\"/P2\"\n\"/P2,#2300ff007900000000,PANTONE#20151#20C\"\n\"/PANTONE\"\n\"/PANTONE#20158-5#20CVS\"\n\"/PANTONE#20221#20CVU\"\n\"/PANTONE#203405#20C\"\n\"/PANTONE#20399#20CVC\"\n\"/PANTONE#20Blue#20072#20C\"\n\"/PANTONE#20Orange#20021#20C\"\n\"/PANTONE#20Orange#20021#20CVC\"\n\"/PANTONE#20Yellow#20C\"\n\"/PC\"\n\"/PDFDocEncoding\"\n\"/PIX\"\n\"/PO\"\n\"/PS\"\n\"/PUBLISHER\"\n\"/PZ\"\n\"/Pa0\"\n\"/Page\"\n\"/PageElement\"\n\"/PageLabels\"\n\"/PageLayout\"\n\"/PageMode\"\n\"/PageRange\"\n\"/Pages\"\n\"/PaintType\"\n\"/Palatino,Bold\"\n\"/Pale#20Brown.c\"\n\"/Panose\"\n\"/Paper#20tray\"\n\"/Para\"\n\"/Params\"\n\"/Parent\"\n\"/ParentTree\"\n\"/ParentTreeNextKey\"\n\"/Part\"\n\"/Pattern\"\n\"/PatternType\"\n\"/PcZ\"\n\"/Perceptual\"\n\"/Perms\"\n\"/Pg\"\n\"/Pgf\"\n\"/PieceInfo\"\n\"/PitStop\"\n\"/Placement\"\n\"/Play\"\n\"/Polygon\"\n\"/PolygonCloud\"\n\"/Popup\"\n\"/Position\"\n\"/PowerUpPDF\"\n\"/PrOut\"\n\"/PrRGBGra\"\n\"/PrRGBIma\"\n\"/Predictor\"\n\"/PresSteps\"\n\"/PreserveRB\"\n\"/Prev\"\n\"/PrevPage\"\n\"/Preview\"\n\"/Print\"\n\"/PrintRecord\"\n\"/PrintScaling\"\n\"/PrintState\"\n\"/PrintStyle\"\n\"/Printed\"\n\"/PrintingOrder\"\n\"/Private\"\n\"/ProcSet\"\n\"/Process\"\n\"/ProcessBlue\"\n\"/ProcessGreen\"\n\"/ProcessRed\"\n\"/Producer\"\n\"/ProfileCS\"\n\"/ProfileName\"\n\"/Prop_Build\"\n\"/Properties\"\n\"/Proportional\"\n\"/PubSec\"\n\"/Q\"\n\"/QuadPoints\"\n\"/R1\"\n\"/RBGroups\"\n\"/RC\"\n\"/RD\"\n\"/REC\"\n\"/REx\"\n\"/RF\"\n\"/RGB\"\n\"/RI\"\n\"/RICMYKGra\"\n\"/RICMYKIma\"\n\"/RICalGra\"\n\"/RICalIma\"\n\"/RIDefault\"\n\"/RIDevNGra\"\n\"/RIDevNIma\"\n\"/RIRGBGra\"\n\"/RIRGBIma\"\n\"/RL\"\n\"/RM\"\n\"/RV\"\n\"/Range\"\n\"/Rect\"\n\"/Red\"\n\"/Redact\"\n\"/Ref\"\n\"/Reference\"\n\"/Registry\"\n\"/RegistryName\"\n\"/RelativeColorimetric\"\n\"/Rendition\"\n\"/Renditions\"\n\"/Requirements\"\n\"/ResetForm\"\n\"/Resolution\"\n\"/Resources\"\n\"/ReversedChars\"\n\"/RoleMap\"\n\"/Root\"\n\"/Rotate\"\n\"/Round\"\n\"/RoundTrip\"\n\"/RoundtripVersion\"\n\"/Router\"\n\"/Rows\"\n\"/RunLengthDecode\"\n\"/Ryumin\"\n\"/SA\"\n\"/SBDraft\"\n\"/SC\"\n\"/SE\"\n\"/SFSSL\"\n\"/SFTWS\"\n\"/SI\"\n\"/SL\"\n\"/SLA\"\n\"/SM\"\n\"/SMask\"\n\"/SMaskInData\"\n\"/SP\"\n\"/SPS\"\n\"/STL\"\n\"/SU\"\n\"/SW\"\n\"/Saturation\"\n\"/SaveAs\"\n\"/SaveContents\"\n\"/SaveResource\"\n\"/SavedBy\"\n\"/Scaron\"\n\"/Schema\"\n\"/Screen\"\n\"/Sect\"\n\"/SemiCondensed\"\n\"/SemiExpanded\"\n\"/Separation\"\n\"/SeparationInfo\"\n\"/SetOCGState\"\n\"/SettingsFileName\"\n\"/Sh0\"\n\"/Sh1\"\n\"/Shading\"\n\"/ShadingType\"\n\"/Shape\"\n\"/Sig\"\n\"/SigFlags\"\n\"/SigRef\"\n\"/Signature\"\n\"/Signed\"\n\"/SinglePage\"\n\"/Size\"\n\"/SlideShow\"\n\"/SoftLight\"\n\"/Solid\"\n\"/Solidities\"\n\"/SomeName\"\n\"/Sort\"\n\"/Sound\"\n\"/Space\"\n\"/SpaceAfter\"\n\"/SpaceBefore\"\n\"/Span\"\n\"/SpawnTemplate\"\n\"/SpdrArt\"\n\"/SpiderInfo\"\n\"/Split\"\n\"/Spot\"\n\"/Spot1\"\n\"/Spot2\"\n\"/SpotFunction\"\n\"/SpotMap\"\n\"/St\"\n\"/Stamp\"\n\"/StandardImageFileData\"\n\"/Star\"\n\"/Start\"\n\"/StartIndent\"\n\"/StartResource\"\n\"/State\"\n\"/StdCF\"\n\"/StemH\"\n\"/StemV\"\n\"/Stm\"\n\"/StmF\"\n\"/Stop\"\n\"/Story\"\n\"/StrF\"\n\"/StrikeOut\"\n\"/StringItem\"\n\"/StructElem\"\n\"/StructParent\"\n\"/StructParents\"\n\"/StructTreeRoot\"\n\"/Style\"\n\"/SubFilter\"\n\"/SubType\"\n\"/Subdictionary\"\n\"/Subform\"\n\"/Subj\"\n\"/Subject\"\n\"/SubmitForm\"\n\"/SubmitStandalone\"\n\"/SubsetFontsBelow\"\n\"/SubsetFontsRatio\"\n\"/Supplement\"\n\"/Swiss721BT-Black\"\n\"/Switch\"\n\"/T\"\n\"/T1\"\n\"/T1_0\"\n\"/TB\"\n\"/TC\"\n\"/TCS\"\n\"/TF\"\n\"/TID\"\n\"/TK\"\n\"/TM\"\n\"/TO\"\n\"/TOC\"\n\"/TOCI\"\n\"/TOYO#200004pc\"\n\"/TP\"\n\"/TR\"\n\"/TR2\"\n\"/TRUMATCH#206-e\"\n\"/TS\"\n\"/TSV\"\n\"/TT\"\n\"/TT0\"\n\"/TTRefMan\"\n\"/TU\"\n\"/TV\"\n\"/TW\"\n\"/TWS\"\n\"/TWY\"\n\"/Tabs\"\n\"/TagSuspect\"\n\"/TargetCS\"\n\"/Technical\"\n\"/Template\"\n\"/TemplateInstantiated\"\n\"/Templates\"\n\"/Text\"\n\"/TextAlign\"\n\"/TextBox\"\n\"/TextIndent\"\n\"/The\"\n\"/This\"\n\"/Thorn\"\n\"/Thread\"\n\"/Threads\"\n\"/Thumb\"\n\"/Thumbnail\"\n\"/Thumbs\"\n\"/Ti\"\n\"/TiBI\"\n\"/TilingType\"\n\"/Times-BoldItalic\"\n\"/Times-Roman\"\n\"/Title\"\n\"/ToUnicode\"\n\"/Toggle\"\n\"/Trans\"\n\"/TransferFunction\"\n\"/TransformMethod\"\n\"/TransformParams\"\n\"/Transparency\"\n\"/TrapInfo\"\n\"/TrapMagicNumber\"\n\"/TrapRegions\"\n\"/TrapSet\"\n\"/Trapped\"\n\"/Trapping\"\n\"/TrappingDetails\"\n\"/TrappingParameters\"\n\"/TrimBox\"\n\"/True\"\n\"/TrueType\"\n\"/TrustedMode\"\n\"/TwoColumnLeft\"\n\"/Tx\"\n\"/Type\"\n\"/Type0\"\n\"/U3D\"\n\"/UA\"\n\"/UCR\"\n\"/UCR2\"\n\"/UIDOffset\"\n\"/UR\"\n\"/UR3\"\n\"/URI\"\n\"/URL\"\n\"/URLs\"\n\"/Uacute\"\n\"/Ucircumflex\"\n\"/Udieresis\"\n\"/Ugrave\"\n\"/Univers-BoldExt\"\n\"/Unix\"\n\"/Unknown\"\n\"/Usage\"\n\"/UseAttachments\"\n\"/UseNone\"\n\"/UseOC\"\n\"/UseOutlines\"\n\"/UseThumbs\"\n\"/UsedCMYK\"\n\"/UserProperties\"\n\"/UserUnit\"\n\"/V2\"\n\"/VA\"\n\"/VE\"\n\"/VP\"\n\"/Verdana,Bold\"\n\"/Version\"\n\"/Vertical\"\n\"/VeryLastItem\"\n\"/View\"\n\"/ViewerPreferences\"\n\"/Visa\"\n\"/Visible\"\n\"/Volume\"\n\"/W2\"\n\"/WAI\"\n\"/WAN\"\n\"/WMode\"\n\"/WP\"\n\"/WarnockPro-BoldIt\"\n\"/Watermark\"\n\"/WebCapture\"\n\"/Which\"\n\"/WhiteBG\"\n\"/WhitePoint\"\n\"/Widget\"\n\"/Width\"\n\"/Widths\"\n\"/Win\"\n\"/WinAnsiEncoding\"\n\"/Window\"\n\"/Windows\"\n\"/Work#20surface\"\n\"/Workbook\"\n\"/Worksheet\"\n\"/WritingMode\"\n\"/X\"\n\"/X1\"\n\"/XFA\"\n\"/XHeight\"\n\"/XML\"\n\"/XN\"\n\"/XObject\"\n\"/XRef\"\n\"/XRefStm\"\n\"/XStep\"\n\"/XUID\"\n\"/XYZ\"\n\"/Y\"\n\"/YStep\"\n\"/Yacute\"\n\"/Ydieresis\"\n\"/Yellow\"\n\"/Z\"\n\"/Z7KNXbN\"\n\"/ZaDb\"\n\"/ZapfDingbats\"\n\"/Zcaron\"\n\"/Zoom\"\n\"/_No_paragraph_style_\"\n\"/a1\"\n\"/acute\"\n\"/adbe.pkcs7.detached\"\n\"/ampersand\"\n\"/apple\"\n\"/approxequal\"\n\"/asciicircum\"\n\"/asciitilde\"\n\"/asterisk\"\n\"/at\"\n\"/audio#2Fmpeg\"\n\"/b\"\n\"/backslash\"\n\"/bar\"\n\"/blank\"\n\"/braceleft\"\n\"/braceright\"\n\"/bracketleft\"\n\"/bracketright\"\n\"/breve\"\n\"/brokenbar\"\n\"/bullet\"\n\"/c108\"\n\"/cCompKind\"\n\"/cCompQuality\"\n\"/cCompression\"\n\"/cRes\"\n\"/cResolution\"\n\"/ca\"\n\"/caron\"\n\"/cedilla\"\n\"/cent\"\n\"/circumflex\"\n\"/colon\"\n\"/comma\"\n\"/copyright\"\n\"/currency\"\n\"/dagger\"\n\"/daggerdbl\"\n\"/degree\"\n\"/deviceNumber\"\n\"/dieresis\"\n\"/divide\"\n\"/dollar\"\n\"/dotaccent\"\n\"/dotlessi\"\n\"/dotlessj\"\n\"/eight\"\n\"/ellipsis\"\n\"/emdash\"\n\"/endash\"\n\"/equal\"\n\"/eth\"\n\"/exclam\"\n\"/exclamdown\"\n\"/f\"\n\"/ff\"\n\"/ffi\"\n\"/ffl\"\n\"/fi\"\n\"/five\"\n\"/fl\"\n\"/florin\"\n\"/four\"\n\"/fraction\"\n\"/gCompKind\"\n\"/gCompQuality\"\n\"/gCompression\"\n\"/gRes\"\n\"/gResolution\"\n\"/germandbls\"\n\"/go1\"\n\"/grave\"\n\"/greater\"\n\"/greaterequal\"\n\"/guillemotleft\"\n\"/guillemotright\"\n\"/guilsinglleft\"\n\"/guilsinglright\"\n\"/hungarumlaut\"\n\"/hyphen\"\n\"/iacute\"\n\"/idieresis\"\n\"/igrave\"\n\"/infinity\"\n\"/integral\"\n\"/j\"\n\"/k\"\n\"/less\"\n\"/lessequal\"\n\"/logicalnot\"\n\"/lozenge\"\n\"/lt#20blue\"\n\"/mCompKind\"\n\"/mCompression\"\n\"/mRes\"\n\"/mResolution\"\n\"/macron\"\n\"/minus\"\n\"/mu\"\n\"/multiply\"\n\"/n\"\n\"/n0\"\n\"/nine\"\n\"/notequal\"\n\"/ntilde\"\n\"/numbersign\"\n\"/o\"\n\"/ogonek\"\n\"/one\"\n\"/onehalf\"\n\"/onequarter\"\n\"/onesuperior\"\n\"/op\"\n\"/ordfeminine\"\n\"/ordmasculine\"\n\"/p\"\n\"/pageH\"\n\"/pageV\"\n\"/paragraph\"\n\"/parenleft\"\n\"/parenright\"\n\"/partialdiff\"\n\"/pdf\"\n\"/pdfx\"\n\"/percent\"\n\"/period\"\n\"/periodcentered\"\n\"/perthousand\"\n\"/pi\"\n\"/plus\"\n\"/plusminus\"\n\"/pms#208400\"\n\"/printX\"\n\"/product\"\n\"/question\"\n\"/questiondown\"\n\"/quotedbl\"\n\"/quotedblbase\"\n\"/quotedblleft\"\n\"/quotedblright\"\n\"/quoteleft\"\n\"/quoteright\"\n\"/quotesinglbase\"\n\"/quotesingle\"\n\"/r\"\n\"/radical\"\n\"/registered\"\n\"/ring\"\n\"/s\"\n\"/s1\"\n\"/sd1\"\n\"/sd2\"\n\"/section\"\n\"/semicolon\"\n\"/seven\"\n\"/six\"\n\"/slash\"\n\"/sterling\"\n\"/summation\"\n\"/thinspace\"\n\"/three\"\n\"/threequarters\"\n\"/threesuperior\"\n\"/tilde\"\n\"/trademark\"\n\"/two\"\n\"/twosuperior\"\n\"/u\"\n\"/underscore\"\n\"/v\"\n\"/w\"\n\"/y1\"\n\"/yen\"\n\"/yes\"\n\"/zero\"\n\"0 R\"\n\"1\"\n\"1.0\"\n\"<\"\n\"<<\"\n\">\"\n\">>\"\n\"Adobe.PPKLite\"\n\"Adobe.PubSec\"\n\"B*\"\n\"BDC\"\n\"BI\"\n\"BMC\"\n\"BT\"\n\"BX\"\n\"CS\"\n\"DP\"\n\"Do\"\n\"EI\"\n\"EMC\"\n\"ET\"\n\"EX\"\n\"Entrust.PPKEF\"\n\"ID\"\n\"MP\"\n\"R\"\n\"T*\"\n\"TJ\"\n\"TL\"\n\"Tc\"\n\"Td\"\n\"Tf\"\n\"Tj\"\n\"Tm\"\n\"Tr\"\n\"Ts\"\n\"Tw\"\n\"W*\"\n\"[\"\n\"[0.0 0.0 0.0 0.0 0.0 0.0]\"\n\"[1 1 1]\"\n\"[1.0 -1.0 1.0 -1.0]\"\n\"[1.0 -1.0]\"\n\"\\\\\"\n\"]\"\n\"abs\"\n\"adbe.pkcs7.s3\"\n\"adbe.pkcs7.s4\"\n\"adbe.pkcs7.s5\"\n\"add\"\n\"and\"\n\"atan\"\n\"begin\"\n\"beginarrangedfont\"\n\"beginbfchar\"\n\"begincidrange\"\n\"begincmap\"\n\"begincodespacerange\"\n\"beginnotdefchar\"\n\"beginnotdefrange\"\n\"beginusematrix\"\n\"bitshift\"\n\"ceiling\"\n\"cm\"\n\"copy\"\n\"cos\"\n\"cvi\"\n\"cvr\"\n\"d0\"\n\"d1\"\n\"div\"\n\"dup\"\n\"end\"\n\"endarrangedfont\"\n\"endbfchar\"\n\"endcidrange\"\n\"endcmap\"\n\"endcodespacerange\"\n\"endnotdefchar\"\n\"endnotdefrange\"\n\"endobj\"\n\"endstream\"\n\"endusematrix\"\n\"eq\"\n\"exch\"\n\"exp\"\n\"f*\"\n\"false\"\n\"findresource\"\n\"floor\"\n\"ge\"\n\"gs\"\n\"gt\"\n\"idiv\"\n\"if\"\n\"ifelse\"\n\"index\"\n\"le\"\n\"ln\"\n\"log\"\n\"lt\"\n\"mod\"\n\"mul\"\n\"ne\"\n\"neg\"\n\"not\"\n\"null\"\n\"obj\"\n\"or\"\n\"page\"\n\"pop\"\n\"re\"\n\"rg\"\n\"ri\"\n\"roll\"\n\"round\"\n\"sin\"\n\"sqrt\"\n\"startxref\"\n\"stream\"\n\"sub\"\n\"trailer\"\n\"true\"\n\"truncate\"\n\"usecmap\"\n\"usefont\"\n\"xor\"\n\"xref\"\n\"{\"\n\"}\"\n"
  },
  {
    "path": "projects/ghostscript/dicts/ps.dict",
    "content": "\"exch\"\n\"pop\"\n\"copy\"\n\"dup\"\n\"index\"\n\"roll\"\n\"clear\"\n\"count\"\n\"mark\"\n\"cleartomark\"\n\"countomark\"\n\"add\"\n\"div\"\n\"sub\"\n\"idiv\"\n\"mul\"\n\"mod\"\n\"abs\"\n\"neg\"\n\"ceiling\"\n\"floor\"\n\"round\"\n\"truncate\"\n\"sqrt\"\n\"atan\"\n\"cos\"\n\"sin\"\n\"exp\"\n\"ln\"\n\"log\"\n\"rand\"\n\"srand\"\n\"rrand\"\n\"array\"\n\"[\"\n\"]\"\n\"length\"\n\"get\"\n\"put\"\n\"getinterval\"\n\"putinterval\"\n\"aload\"\n\"astore\"\n\"copy\"\n\"forall\"\n\"dict\"\n\"length\"\n\"maxlength\"\n\"begin\"\n\"end\"\n\"def\"\n\"load\"\n\"store\"\n\"get\"\n\"put\"\n\"known\"\n\"where\"\n\"copy\"\n\"forall\"\n\"errordict\"\n\"systemdict\"\n\"userdict\"\n\"currentdict\"\n\"countdictstack\"\n\"dictstack\"\n\"string\"\n\"anchorsearch\"\n\"search\"\n\"token\"\n\"eq\"\n\"ne\"\n\"ge\"\n\"gt\"\n\"le\"\n\"lt\"\n\"and\"\n\"not\"\n\"or\"\n\"xor\"\n\"true\"\n\"false\"\n\"bitshift\"\n\"exec\"\n\"if\"\n\"ifself\"\n\"for\"\n\"repeat\"\n\"loop\"\n\"exit\"\n\"stop\"\n\"stopped\"\n\"countexecstack\"\n\"quit\"\n\"start\"\n\"type\"\n\"cvlit\"\n\"cvx\"\n\"xcheck\"\n\"executeonly\"\n\"noaccess\"\n\"readonly\"\n\"rcheck\"\n\"wcheck\"\n\"cvi\"\n\"cvn\"\n\"cvr\"\n\"cvrs\"\n\"cvs\"\n\"file\"\n\"closefile\"\n\"read\"\n\"write\"\n\"readhexstring\"\n\"writehexstring\"\n\"readstring\"\n\"writestring\"\n\"readline\"\n\"bytesavailable\"\n\"flush\"\n\"flushfile\"\n\"resetfile\"\n\"status\"\n\"run\"\n\"currentfile\"\n\"print\"\n\"=\"\n\"stack\"\n\"==\"\n\"pstack\"\n\"prompt\"\n\"echo\"\n\"save\"\n\"restore\"\n\"vmstatus\"\n\"bind\"\n\"null\"\n\"usertime\"\n\"version\"\n\"gsave\"\n\"grestore\"\n\"grestoreall\"\n\"initgraphics\"\n\"setlinewidth\"\n\"currentlinewidth\"\n\"setlinecap\"\n\"currentlinecap\"\n\"setlinejoine\"\n\"currentlinejoin\"\n\"setmiterlimit\"\n\"currentmiterlimit\"\n\"setdash\"\n\"currentdash\"\n\"setflat\"\n\"currentflat\"\n\"setgray\"\n\"currentgray\"\n\"sethsbcolor\"\n\"currenthsbcolor\"\n\"setrgbcolor\"\n\"currentrgbcolor\"\n\"setscreen\"\n\"currentscreen\"\n\"settransfer\"\n\"currenttransfer\"\n\"matrix\"\n\"initmatrix\"\n\"identmatrix2\"\n\"defaultmatrix\"\n\"currentmatrix\"\n\"setmatrix\"\n\"translate\"\n\"scale\"\n\"rotate\"\n\"concat\"\n\"concatmatrix\"\n\"transform\"\n\"dtransform\"\n\"itransform\"\n\"idtransform\"\n\"invertmatrix\"\n\"newpath\"\n\"currentpoint\"\n\"moveto\"\n\"rmoveto\"\n\"lineto\"\n\"rlineto\"\n\"arc\"\n\"arcn\"\n\"arcto\"\n\"curveto\"\n\"rcurveto\"\n\"closepath\"\n\"flattenpath\"\n\"reversepath\"\n\"strokepath\"\n\"charpath\"\n\"clippath\"\n\"pathbbox\"\n\"pathforall\"\n\"initclip\"\n\"clip\"\n\"eoclip\"\n\"erasepage\"\n\"fill\"\n\"eofill\"\n\"stroke\"\n\"image\"\n\"imagemask\"\n\"showpage\"\n\"copypage\"\n\"banddevice\"\n\"framedevice\"\n\"nulldevice\"\n\"renderbands\"\n\"definefont\"\n\"findfont\"\n\"scalefont\"\n\"makefont\"\n\"setfont\"\n\"currentfont\"\n\"show\"\n\"ashow\"\n\"widthshow\"\n\"awidthshow\"\n\"kshow\"\n\"stringwidth\"\n\"FontDirectory\"\n\"standardEncoding\"\n\"cachestatus\"\n\"setcachedevice\"\n\"setcharwidth\"\n\"setcachelimit\"\n"
  },
  {
    "path": "projects/ghostscript/gs_device_bmpmono_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"bmpmono\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_eps2write_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"eps2write\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_faxg3_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"faxg3\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_pdfwrite_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"pdfwrite\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_pdfwrite_opts_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tif (size < 2) {\n\t\treturn 0;\n\t}\n\tint color_scheme = ((int)data[0] % 63);\n\tint do_interpolation = ((int)data[1] % 2);\n  data += 2;\n  size -= 2;\n\tfuzz_gs_device(data, size, color_scheme, \"pdfwrite\", \"/dev/null\", do_interpolation);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_pgmraw_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"pgmraw\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_png16m_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"png16m\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_ps2write_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"ps2write\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_psdcmyk_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"psdcmyk\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_pxlcolor_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"pxlcolor\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_pxlmono_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"pxlmono\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_tiffsep1_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <sys/types.h>\n#include <unistd.h>\n#include <stdio.h>\n\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tchar filename[256];\n\tsprintf(filename, \"/tmp/libfuzzer.%d.tiff\", getpid());\n\tfuzz_gs_device(data, size, 1, \"tiffsep1\", filename, 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_device_xpswrite_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tfuzz_gs_device(data, size, 1, \"xpswrite\", \"/dev/null\", 0);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gs_fuzzlib.h",
    "content": "/*\n# Copyright 2019 The Chromium OS Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <base/gserrors.h>\n#include <psi/iapi.h>\n\n#include <limits.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdint.h>\n\nstatic const unsigned char *g_data;\nstatic size_t g_size;\n\nint fuzz_gs_device(\n\tconst unsigned char *buf,\n\tsize_t size,\n\tint color_scheme,\n\tconst char *device_target,\n\tconst char *output_file,\n\tint do_interpolation\n);\n\n#define min(x, y) ((x) < (y) ? (x) : (y))\n\nstatic int gs_stdin(void *inst, char *buf, int len)\n{\n\tsize_t to_copy = min(len, g_size);\n\tto_copy = min(INT_MAX, to_copy);\n\n\tmemcpy(buf, g_data, to_copy);\n\n\tg_data += to_copy;\n\tg_size -= to_copy;\n\n\treturn to_copy;\n}\n\nstatic int gs_stdnull(void *inst, const char *buf, int len)\n{\n\t/* Just discard everything. */\n\treturn len;\n}\n\nint gs_to_raster_fuzz(\n\tconst unsigned char *buf,\n\tsize_t size,\n\tint color_scheme\n)\n{\n\treturn fuzz_gs_device(buf, size, color_scheme, \"cups\", \"/dev/null\", 0);\n}\n\nint fuzz_gs_device(\n\tconst unsigned char *buf,\n\tsize_t size,\n\tint color_scheme,\n\tconst char *device_target,\n\tconst char *output_file,\n\tint do_interpolation\n)\n{\n\tint ret;\n\tvoid *gs = NULL;\n\tchar color_space[50];\n\tchar gs_device[50];\n\tchar gs_o[100];\n\tchar opt_interpolation[50];\n\t/*\n\t * We are expecting color_scheme to be in the [0:62] interval.\n\t * This corresponds to the color schemes defined here:\n\t * https://github.com/ArtifexSoftware/ghostpdl/blob/8c97d5adce0040ac38a1fb4d7954499c65f582ff/cups/libs/cups/raster.h#L102\n\t */\n\tsprintf(color_space, \"-dcupsColorSpace=%d\", color_scheme);\n\tsprintf(gs_device, \"-sDEVICE=%s\", device_target);\n\tsprintf(gs_o, \"-sOutputFile=%s\", output_file);\n\tif (do_interpolation) {\n\t\tsprintf(opt_interpolation, \"-dDOINTERPOLATE\");\n\t}\n\telse {\n\t\tsprintf(opt_interpolation, \"-dNOINTERPOLATE\");\n\t}\n\t/* Mostly stolen from cups-filters gstoraster. */\n\tchar *args[] = {\n\t\t\"gs\",\n\t\t\"-K1048576\",\n\t\t\"-r200x200\",\n\t\t\"-sBandListStorage=memory\",\n\t\t\"-dMaxBitmap=0\",\n\t\t\"-dBufferSpace=450k\",\n\t\t\"-dMediaPosition=1\",\n\t\tcolor_space,\n\t\t\"-dQUIET\",\n\t\t\"-dSAFER\",\n\t\t\"-dNOPAUSE\",\n\t\t\"-dBATCH\",\n\t\topt_interpolation,\n\t\t\"-dNOMEDIAATTRS\",\n\t\t\"-sstdout=%%stderr\",\n\t\tgs_o,\n\t\tgs_device,\n\t\t\"-_\",\n\t};\n\tint argc = sizeof(args) / sizeof(args[0]);\n\n\t/* Stash buffers globally, for gs_stdin(). */\n\tg_data = buf;\n\tg_size = size;\n\n\tret = gsapi_new_instance(&gs, NULL);\n\tif (ret < 0) {\n\t\tfprintf(stderr, \"gsapi_new_instance: error %d\\n\", ret);\n\t\treturn ret;\n\t}\n\n\tgsapi_set_stdio(gs, gs_stdin, gs_stdnull, gs_stdnull);\n\tret = gsapi_set_arg_encoding(gs, GS_ARG_ENCODING_UTF8);\n\tif (ret < 0) {\n\t\tfprintf(stderr, \"gsapi_set_arg_encoding: error %d\\n\", ret);\n\t\tgsapi_delete_instance(gs);\n\t\treturn ret;\n\t}\n\n\tret = gsapi_init_with_args(gs, argc, args);\n\tif (ret && ret != gs_error_Quit)\n\t\t/* Just keep going, to cleanup. */\n\t\tfprintf(stderr, \"gsapi_init_with_args: error %d\\n\", ret);\n\n\tret = gsapi_exit(gs);\n\tif (ret < 0 && ret != gs_error_Quit) {\n\t\tfprintf(stderr, \"gsapi_exit: error %d\\n\", ret);\n\t\treturn ret;\n\t}\n\n\tgsapi_delete_instance(gs);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gstoraster_fuzzer.cc",
    "content": "/*\n# Copyright 2019 The Chromium OS Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\t/* Tests RGB color scheme */\n\tgs_to_raster_fuzz(data, size, 1);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gstoraster_fuzzer_all_colors.cc",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"gs_fuzzlib.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tif (size == 0) {\n\t\treturn 0;\n\t}\n\t// Modulo the possibilities: https://github.com/ArtifexSoftware/ghostpdl/blob/8c97d5adce0040ac38a1fb4d7954499c65f582ff/cups/libs/cups/raster.h#L102\n\t// This enables the fuzzer to explore all color schemes\n\tint color_scheme = ((int)data[0] % 63);\n\tdata++;\n\tsize--;\n\n\tgs_to_raster_fuzz(data, size, color_scheme);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gstoraster_fuzzer_all_colors.options",
    "content": "[libfuzzer]\nmax_len = 16834\n"
  },
  {
    "path": "projects/ghostscript/gstoraster_pdf_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"gs_fuzzlib.h\"\n\n// Returns 1 if this has a valid PDF header and 0 otherwise\nstatic int quick_check_pdf(const uint8_t *data, size_t size) {\n\t// PDF checks. Exit early if we don't have a valid PDF signature.\n\tif (size < 5) {\n\t\treturn 0;\n\t}\n\n\t// Check PDF tag. We do this because we want to use seeds\n\tif (data[0] != 0x25 || data[1] != 0x50 || data[2] != 0x44 || data[3] != 0x46 || data[4] != 0x2d) {\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tif (quick_check_pdf(data, size) != 1) {\n\t\treturn 0;\n\t}\n\n\t/* Tests using RGB color scheme */\n\tgs_to_raster_fuzz(data, size, 1);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gstoraster_ps_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"gs_fuzzlib.h\"\n\n/* Returns 1 if the data has a PDF header and 0 otherwise */\nstatic int is_pdf(const uint8_t *data, size_t size) {\n\t/* Two bytes are needed for the check */\n        if (size < 2) {\n                return 0;\n        }\n\n        /* Check for \"%P\" tag. */\n        if (data[0] == 0x25 || data[1] == 0x50) {\n                return 1;\n        }\n        return 0;\n}\n\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\t/* Avoid PDF files */\n\tif (size == 0 || is_pdf(data, size)) {\n\t\treturn 0;\n\t}\n\n\t/* \n\t * Modulo the possibilities: https://github.com/ArtifexSoftware/ghostpdl/blob/8c97d5adce0040ac38a1fb4d7954499c65f582ff/cups/libs/cups/raster.h#L102\n\t   This enables the fuzzer to explore all color schemes\n\t */\n\tint color_scheme = ((int)data[0] % 63);\n\tdata++;\n\tsize--;\n\n\tgs_to_raster_fuzz(data, size, color_scheme);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/ghostscript/gstoraster_ps_fuzzer.options",
    "content": "[libfuzzer]\nmax_len = 16834\nonly_ascii = 1\n"
  },
  {
    "path": "projects/ghostscript/project.yaml",
    "content": "homepage: \"https://ghostscript.com\"\nlanguage: c++\nprimary_contact: \"skau@google.com\"\nauto_ccs:\n  - \"henry.stiles@artifex.com\"\n  - \"bmgordon@google.com\"\n  - \"skau@google.com\"\n  - \"sebastian.rasmussen@artifex.com\"\n  - \"julians.artifex@gmail.com\"\n  - \"chris.liddell@artifex.com\"\n  - \"ken.sharp@artifex.com\"\n  - \"david@adalogics.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nmain_repo: 'git://git.ghostscript.com/ghostpdl.git'\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n"
  },
  {
    "path": "projects/giflib/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update -y && \\\n    apt-get install -y cmake liblzma-dev libz-dev make ninja-build wget zlib1g-dev\nRUN git clone --depth=1 https://git.code.sf.net/p/giflib/code $SRC/giflib-code\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja)\nCOPY *.c *.options build.sh *.h *.cc *.cpp *.proto $SRC/\n"
  },
  {
    "path": "projects/giflib/ProtoToGif.cpp",
    "content": "#include \"ProtoToGif.h\"\n\nusing namespace gifProtoFuzzer;\nusing namespace std;\n\nconstexpr unsigned char ProtoConverter::m_sig[];\nconstexpr unsigned char ProtoConverter::m_ver89a[];\nconstexpr unsigned char ProtoConverter::m_ver87a[];\n\nstring ProtoConverter::gifProtoToString(GifProto const &proto)\n{\n\tvisit(proto);\n\treturn m_output.str();\n}\n\nvoid ProtoConverter::visit(GifProto const &gif)\n{\n\tvisit(gif.header());\n\tvisit(gif.lsd());\n\tif (m_hasGCT)\n\t\tvisit(gif.gct());\n\tfor (auto const &chunk : gif.chunks())\n\t\tvisit(chunk);\n\tvisit(gif.trailer());\n}\n\nvoid ProtoConverter::visit(Header const &header)\n{\n\t// Signature GIF\n\tm_output.write((const char *)m_sig, sizeof(m_sig));\n\n\tswitch (header.ver())\n\t{\n\tcase Header::ENA:\n\t\tm_output.write((const char *)m_ver89a, sizeof(m_ver89a));\n\t\tbreak;\n\tcase Header::ESA:\n\t\tm_output.write((const char *)m_ver87a, sizeof(m_ver87a));\n\t\tbreak;\n\t// We simply don't write anything if it's an invalid version\n\t// Bytes that follow (LSD) will be interpreted as version\n\tcase Header::INV:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(LogicalScreenDescriptor const &lsd)\n{\n\twriteWord(extractWordFromUInt32(lsd.screenwidth()));\n\twriteWord(extractWordFromUInt32(lsd.screenheight()));\n\n\tuint8_t packedByte = extractByteFromUInt32(lsd.packed());\n\t// If MSB of packed byte is 1, GCT follows\n\tif (packedByte & 0x80)\n\t{\n\t\tm_hasGCT = true;\n\t\t// N: 2^(N+1) colors in GCT\n\t\tm_globalColorExp = packedByte & 0x07;\n\t}\n\twriteByte(packedByte);\n\twriteByte(extractByteFromUInt32(lsd.backgroundcolor()));\n\twriteByte(extractByteFromUInt32(lsd.aspectratio()));\n}\n\nvoid ProtoConverter::visit(GlobalColorTable const &gct)\n{\n\t//[TODO 27/04/2019 VU]: Should it really be exactly the same size? Or do we want some deterministic randomness here?\n\t// TODO BS: We never overflow expected table size due to the use of min\n\tuint32_t tableSize = min((uint32_t)gct.colors().size(), tableExpToTableSize(m_globalColorExp));\n\tm_output.write(gct.colors().data(), tableSize);\n}\n\nvoid ProtoConverter::visit(GraphicControlExtension const &gce)\n{\n\twriteByte(0x21); // Extension Introducer\n\twriteByte(0xF9); // Graphic Control Label\n\twriteByte(4);\t// Block size\n\tuint8_t packedByte = extractByteFromUInt32(gce.packed());\n\t// packed byte\n\twriteByte(packedByte);\n\t// Delay time is 2 bytes\n\twriteWord(extractWordFromUInt32(gce.delaytime()));\n\t// Transparent color index is 1 byte\n\twriteByte(extractByteFromUInt32(gce.transparentcolorindex()));\n\twriteByte(0x0); // Block Terminator\n}\n\nvoid ProtoConverter::visit(ImageChunk const &chunk)\n{\n\tswitch (chunk.chunk_oneof_case())\n\t{\n\tcase ImageChunk::kBasic:\n\t\tvisit(chunk.basic());\n\t\tbreak;\n\tcase ImageChunk::kPlaintext:\n\t\tvisit(chunk.plaintext());\n\t\tbreak;\n\tcase ImageChunk::kAppExt:\n\t\tvisit(chunk.appext());\n\t\tbreak;\n\tcase ImageChunk::kComExt:\n\t\tvisit(chunk.comext());\n\t\tbreak;\n\tcase ImageChunk::CHUNK_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(const BasicChunk &chunk)\n{\n\t// Visit GCExt if necessary\n\tif (chunk.has_gcext())\n\t\tvisit(chunk.gcext());\n\tvisit(chunk.imdescriptor());\n\tif (m_hasLCT)\n\t\tvisit(chunk.lct());\n\tvisit(chunk.img());\n}\n\nvoid ProtoConverter::visit(LocalColorTable const &lct)\n{\n\t//[TODO 27/04/2019 VU]: Should it really be exactly the same size? Or do we want some deterministic randomness here?\n\t// TODO BS: We never overflow expected table size due to the use of min\n\tuint32_t tableSize = min((uint32_t)lct.colors().size(), tableExpToTableSize(m_localColorExp));\n\tm_output.write(lct.colors().data(), tableSize);\n}\n\nvoid ProtoConverter::visit(ImageDescriptor const &descriptor)\n{\n\t// TODO: Remove seperator from proto since it is always 2C\n\twriteByte(0x2C);\n\twriteWord(extractWordFromUInt32(descriptor.left()));\n\twriteWord(extractWordFromUInt32(descriptor.top()));\n\twriteWord(extractWordFromUInt32(descriptor.height()));\n\twriteWord(extractWordFromUInt32(descriptor.width()));\n\tuint8_t packedByte = extractByteFromUInt32(descriptor.packed());\n\tif (packedByte & 0x80)\n\t{\n\t\tm_hasLCT = true;\n\t\tm_localColorExp = packedByte & 0x07;\n\t}\n\telse\n\t\tm_hasLCT = false;\n}\n\nvoid ProtoConverter::visit(SubBlock const &block)\n{\n\tuint8_t len = extractByteFromUInt32(block.len());\n\tif (len == 0)\n\t{\n\t\twriteByte(0x00);\n\t}\n\telse\n\t{\n\t\t// TODO BS: We never overflow expected block size due to the use of min\n\t\tuint32_t write_len = min((uint32_t)len, (uint32_t)block.data().size());\n\t\tm_output.write(block.data().data(), write_len);\n\t}\n}\n\nvoid ProtoConverter::visit(ImageData const &img)\n{\n\t// TODO: Verify we are writing the image data correctly\n\t// LZW\n\twriteByte(extractByteFromUInt32(img.lzw()));\n\t// Sub-blocks\n\tfor (auto const &block : img.subs())\n\t\tvisit(block);\n\t// NULL sub block signals end of image data\n\twriteByte(0x00);\n}\n\nvoid ProtoConverter::visit(PlainTextExtension const &ptExt)\n{\n\t// Visit GCExt if necessary\n\tif (ptExt.has_gcext())\n\t\tvisit(ptExt.gcext());\n\n\t// First two bytes are 0x21 0x01\n\twriteByte(0x21);\n\twriteByte(0x01);\n\t// Skip zero bytes\n\twriteByte(0x00);\n\tfor (auto const &block : ptExt.subs())\n\t\tvisit(block);\n\t// NULL sub block signals end\n\twriteByte(0x00);\n}\n\nvoid ProtoConverter::visit(CommentExtension const &comExt)\n{\n\t// First two bytes are 0x21 0xFE\n\twriteByte(0x21);\n\twriteByte(0xFE);\n\t// Sub-blocks\n\tfor (auto const &block : comExt.subs())\n\t\tvisit(block);\n\t// NULL sub block signals end of image data\n\twriteByte(0x00);\n}\n\nvoid ProtoConverter::visit(ApplicationExtension const &appExt)\n{\n\t// First two bytes are 0x21 0xFF\n\twriteByte(0x21);\n\twriteByte(0xFF);\n\t// Next, we write \"11\" decimal or 0x0B\n\twriteByte(0x0B);\n\twriteLong(appExt.appid());\n\t// We hardcode the auth code to 1.0 or 0x31 0x2E 0x30\n\twriteByte(0x31);\n\twriteByte(0x2E);\n\twriteByte(0x30);\n\t// Sub-blocks\n\tfor (auto const &block : appExt.subs())\n\t\tvisit(block);\n\t// NULL sub block signals end of image data\n\twriteByte(0x00);\n}\n\nvoid ProtoConverter::visit(Trailer const &)\n{\n\twriteByte(0x3B);\n}\n\n// =============================================================\n// Utility functions\n// =============================================================\nvoid ProtoConverter::writeByte(uint8_t x)\n{\n\tm_output.write((char *)&x, sizeof(x));\n}\n\nvoid ProtoConverter::writeWord(uint16_t x)\n{\n\tm_output.write((char *)&x, sizeof(x));\n}\n\nvoid ProtoConverter::writeInt(uint32_t x)\n{\n\tm_output.write((char *)&x, sizeof(x));\n}\n\nvoid ProtoConverter::writeLong(uint64_t x)\n{\n\tm_output.write((char *)&x, sizeof(x));\n}\n\nuint16_t ProtoConverter::extractWordFromUInt32(uint32_t a)\n{\n\tuint16_t first_byte = (a & 0xFF);\n\tuint16_t second_byte = ((a >> 8) & 0xFF) << 8;\n\treturn first_byte | second_byte;\n}\n\nuint8_t ProtoConverter::extractByteFromUInt32(uint32_t a)\n{\n\tuint8_t byte = a & 0x80;\n\treturn byte;\n}\n\n/**\n * Given an exponent, returns the global/local color table size, given by 3*2^(exp+1)\n * @param tableExp The exponent\n * @return The actual color table size\n */\nuint32_t ProtoConverter::tableExpToTableSize(uint32_t tableExp)\n{\n\t// 0 <= tableExp <= 7\n\t// 6 <= tableSize <= 768\n\tuint32_t tableSize = 3 * (pow(2, tableExp + 1));\n\treturn tableSize;\n}\n"
  },
  {
    "path": "projects/giflib/ProtoToGif.h",
    "content": "#include <string>\n#include <sstream>\n#include <cmath>\n#include <algorithm>\n#include \"gif_fuzz_proto.pb.h\"\n\nnamespace gifProtoFuzzer\n{\nclass ProtoConverter\n{\n  public:\n\tstd::string gifProtoToString(GifProto const &proto);\n\n  private:\n\ttemplate <class T>\n\tvoid visit(google::protobuf::RepeatedPtrField<T> const &_repeated_field);\n\tvoid visit(const GifProto &);\n\tvoid visit(const Header &);\n\tvoid visit(const LogicalScreenDescriptor &);\n\tvoid visit(const GlobalColorTable &);\n\tvoid visit(const ImageChunk &);\n\tvoid visit(const BasicChunk &);\n\tvoid visit(const ImageData &);\n\tvoid visit(const SubBlock &);\n\tvoid visit(const ImageDescriptor &);\n\tvoid visit(const LocalColorTable &);\n\tvoid visit(const GraphicControlExtension &);\n\tvoid visit(const PlainTextExtension &);\n\tvoid visit(const ApplicationExtension &);\n\tvoid visit(const CommentExtension &);\n\tvoid visit(const Trailer &);\n\n\t// Utility functions\n\tvoid writeByte(uint8_t x);\n\tvoid writeWord(uint16_t x);\n\tvoid writeInt(uint32_t x);\n\tvoid writeLong(uint64_t x);\n\tstatic uint16_t extractWordFromUInt32(uint32_t a);\n\tstatic uint8_t extractByteFromUInt32(uint32_t a);\n\tstatic uint32_t tableExpToTableSize(uint32_t tableExp);\n\n\tstd::stringstream m_output;\n\tbool m_hasGCT = false;\n\tbool m_hasLCT = false;\n\tuint8_t m_globalColorExp = 0;\n\tuint8_t m_localColorExp = 0;\n\n\tstatic constexpr unsigned char m_sig[] = {0x47, 0x49, 0x46};\n\tstatic constexpr unsigned char m_ver89a[] = {0x38, 0x39, 0x61};\n\tstatic constexpr unsigned char m_ver87a[] = {0x38, 0x37, 0x61};\n};\n} // namespace gifProtoFuzzer"
  },
  {
    "path": "projects/giflib/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -e\nSOURCES=(dgif_lib.c egif_lib.c getarg.c gifalloc.c gif_err.c gif_font.c \\\n        gif_hash.c openbsd-reallocarray.c qprintf.c quantize.c)\ncd $SRC/giflib-code\nrm -f *.o\nfor file in ${SOURCES[@]};\ndo\n    name=$(basename $file .c)\n    $CC -c -I . $CFLAGS $file -o $name.o\ndone\nar rc libgif.a *.o\n\ncd $SRC\n$CXX $CFLAGS -Wall -c -I giflib-code dgif_target.cc -o dgif_target.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -std=c++11  -I giflib-code dgif_fuzz_common.cc dgif_target.o  \\\n        -o $OUT/dgif_target giflib-code/libgif.a\n\n$CXX $CXXFLAGS -Wall -c -I giflib-code egif_target.cc -o egif_target.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -std=c++11  -I giflib-code egif_fuzz_common.cc egif_target.o  \\\n        -o $OUT/egif_target giflib-code/libgif.a\n\nrm -rf genfiles && mkdir genfiles && LPM/external.protobuf/bin/protoc gif_fuzz_proto.proto --cpp_out=genfiles\n\n$CXX $CXXFLAGS -DNDEBUG -Wall -c -I giflib-code dgif_protobuf_target.cc -I libprotobuf-mutator/ \\\n-I genfiles \\\n-I LPM/external.protobuf/include \\\n -o dgif_protobuf_target.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -DNDEBUG -std=c++14 -I. -I giflib-code dgif_protobuf_target.o dgif_fuzz_common.cc genfiles/gif_fuzz_proto.pb.cc \\\nProtoToGif.cpp \\\n-I LPM/external.protobuf/include \\\n-I genfiles \\\nLPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\nLPM/src/libprotobuf-mutator.a \\\n-Wl,--start-group LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n        -o $OUT/dgif_protobuf_target giflib-code/libgif.a\n\n\n# Place dict and config in OUT\nwget -O $OUT/gif.dict \\\n  https://raw.githubusercontent.com/mirrorer/afl/master/dictionaries/gif.dict \\\n  &> /dev/null\ncp $SRC/*.options $OUT/\nfind $SRC/giflib-code -iname \"*.gif\" -exec \\\n  zip -ujq $OUT/dgif_target_seed_corpus.zip \"{}\" \\;\n"
  },
  {
    "path": "projects/giflib/dgif_fuzz_common.cc",
    "content": "#include \"dgif_fuzz_common.h\"\n#include <iostream>\n\nusing namespace std;\n\nextern \"C\" void PrintGifError(int ErrorCode);\n\nint stub_input_reader(GifFileType *gifFileType, GifByteType *gifByteType, int len)\n{\n\tstruct gifUserData *gud = (struct gifUserData *)gifFileType->UserData;\n\tif (gud->gifLen == 0)\n\t\treturn 0;\n\tint read_len = (len > gud->gifLen ? gud->gifLen : len);\n\tmemcpy(gifByteType, gud->gifData, read_len);\n\tgud->gifData += read_len;\n\tgud->gifLen -= read_len;\n\treturn read_len;\n}\n\nint fuzz_dgif(const uint8_t *Data, size_t Size)\n{\n\tGifFileType *GifFile;\n\tint Error;\n\tuint8_t *gifData = (uint8_t *)malloc(Size);\n\tmemcpy(gifData, Data, Size);\n\tstruct gifUserData gUData = {Size, gifData};\n\n\tGifFile = DGifOpen((void *)&gUData, stub_input_reader, &Error);\n\tif (GifFile != NULL)\n\t{\n\t\tDGifSlurp(GifFile);\n\t\tDGifCloseFile(GifFile, &Error);\n\t}\n\tfree(gifData);\n\treturn 0;\n}\n\nint fuzz_dgif_extended(const uint8_t *Data, size_t Size)\n{\n\tGifFileType *GifFile;\n\tint Error;\n\tuint8_t *gifData = (uint8_t *)malloc(Size);\n\tmemcpy(gifData, Data, Size);\n\tstruct gifUserData gUData = {Size, gifData};\n\n\tGifFile = DGifOpen((void *)&gUData, stub_input_reader, &Error);\n\tif (GifFile == NULL)\n\t{\n\t\tfree(gifData);\n\t\treturn 0;\n\t}\n\tif (DGifSlurp(GifFile) != GIF_OK)\n\t{\n\t\tDGifCloseFile(GifFile, &Error);\n\t\tfree(gifData);\n\t\treturn 0;\n\t}\n\tGraphicsControlBlock gcb;\n\tfor (int i = 0; i < GifFile->ImageCount; i++)\n\t{\n\t\tDGifSavedExtensionToGCB(GifFile, i, &gcb);\n\t}\n\tconst ColorMapObject *cmap = GifFile->SColorMap;\n\tif (cmap)\n\t{\n\t\tDGifSavedExtensionToGCB(GifFile, 0, &gcb);\n\t}\n\tDGifCloseFile(GifFile, &Error);\n\tfree(gifData);\n\treturn 0;\n}\n\nstatic Color8888 gifColorToColor8888(const GifColorType &color)\n{\n\treturn ARGB_TO_COLOR8888(0xff, color.Red, color.Green, color.Blue);\n}\n\nstatic bool willBeCleared(const GraphicsControlBlock &gcb)\n{\n\treturn gcb.DisposalMode == DISPOSE_BACKGROUND || gcb.DisposalMode == DISPOSE_PREVIOUS;\n}\n\nstatic long getDelayMs(GraphicsControlBlock &gcb)\n{\n\treturn gcb.DelayTime * 10;\n}\n\nint fuzz_dgif_ala_android(const uint8_t *Data, size_t Size)\n{\n\tGifFileType *GifFile;\n\tint Error;\n\tuint8_t *gifData = (uint8_t *)malloc(Size);\n\tmemcpy(gifData, Data, Size);\n\tstruct gifUserData gUData = {Size, gifData};\n\n\tGifFile = DGifOpen((void *)&gUData, stub_input_reader, &Error);\n\tif (GifFile == NULL)\n\t{\n\t\tfree(gifData);\n\t\treturn 0;\n\t}\n\n\tif (DGifSlurp(GifFile) != GIF_OK)\n\t{\n\t\tPrintGifError(GifFile->Error);\n\t\tDGifCloseFile(GifFile, &Error);\n\t\tfree(gifData);\n\t\treturn 0;\n\t}\n\n\tlong durationMs = 0;\n\tint lastUnclearedFrame = -1;\n\tbool *preservedFrames = new bool[GifFile->ImageCount];\n\tint *restoringFrames = new int[GifFile->ImageCount];\n\tint loopCount = 0;\n\tColor8888 bgColor = 0;\n\n\tGraphicsControlBlock gcb;\n\tfor (int i = 0; i < GifFile->ImageCount; i++)\n\t{\n\t\tconst SavedImage &image = GifFile->SavedImages[i];\n\t\t// find the loop extension pair\n\t\tfor (int j = 0; (j + 1) < image.ExtensionBlockCount; j++)\n\t\t{\n\t\t\tExtensionBlock *eb1 = image.ExtensionBlocks + j;\n\t\t\tExtensionBlock *eb2 = image.ExtensionBlocks + j + 1;\n\t\t\tif (eb1->Function == APPLICATION_EXT_FUNC_CODE\n\t\t\t\t// look for \"NETSCAPE2.0\" app extension\n\t\t\t\t&& eb1->ByteCount == 11 && !memcmp((const char *)(eb1->Bytes), \"NETSCAPE2.0\", 11)\n\t\t\t\t// verify extension contents and get loop count\n\t\t\t\t&& eb2->Function == CONTINUE_EXT_FUNC_CODE && eb2->ByteCount == 3 && eb2->Bytes[0] == 1)\n\t\t\t{\n\t\t\t\tloopCount = (int)(eb2->Bytes[2] << 8) + (int)(eb2->Bytes[1]);\n\t\t\t}\n\t\t}\n\t\tDGifSavedExtensionToGCB(GifFile, i, &gcb);\n\t\t// timing\n\t\tdurationMs += getDelayMs(gcb);\n\t\t// preserve logic\n\t\tpreservedFrames[i] = false;\n\t\trestoringFrames[i] = -1;\n\t\tif (gcb.DisposalMode == DISPOSE_PREVIOUS && lastUnclearedFrame >= 0)\n\t\t{\n\t\t\tpreservedFrames[lastUnclearedFrame] = true;\n\t\t\trestoringFrames[i] = lastUnclearedFrame;\n\t\t}\n\t\tif (!willBeCleared(gcb))\n\t\t{\n\t\t\tlastUnclearedFrame = i;\n\t\t}\n\t\t// Draw\n\t\t// assert(y+8 <= Image->ImageDesc.Height);\n\t\t// assert(x+8*strlen(legend) <= Image->ImageDesc.Width);\n\t\tint imgHeight = GifFile->SavedImages[i].ImageDesc.Height;\n\t\tint imgWidth = GifFile->SavedImages[i].ImageDesc.Width;\n\t\t// TODO: Source x,y, string, and color from fuzzer input\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint strLen = 6;\n\t\tif (y + 8 <= imgHeight && x + 8 * strLen <= imgWidth)\n\t\t\tGifDrawText8x8(&GifFile->SavedImages[i], 0, 0, \"legend\", 42);\n\t}\n#if GIF_DEBUG\n\tALOGD(\"FrameSequence_gif created with size %d %d, frames %d dur %ld\",\n\t\t  GifFile->SWidth, GifFile->SHeight, GifFile->ImageCount, durationMs);\n\tfor (int i = 0; i < GifFile->ImageCount; i++)\n\t{\n\t\tDGifSavedExtensionToGCB(GifFile, i, &gcb);\n\t\tALOGD(\"    Frame %d - must preserve %d, restore point %d, trans color %d\",\n\t\t\t  i, preservedFrames[i], restoringFrames[i], gcb.TransparentColor);\n\t}\n#endif\n\tconst ColorMapObject *cmap = GifFile->SColorMap;\n\tif (cmap)\n\t{\n\t\t// calculate bg color\n\t\tGraphicsControlBlock gcb;\n\t\tDGifSavedExtensionToGCB(GifFile, 0, &gcb);\n\t\tif (gcb.TransparentColor == NO_TRANSPARENT_COLOR && GifFile->SBackGroundColor < cmap->ColorCount)\n\t\t{\n\t\t\tbgColor = gifColorToColor8888(cmap->Colors[GifFile->SBackGroundColor]);\n\t\t}\n\t}\n\n\tDGifCloseFile(GifFile, &Error);\n\tfree(gifData);\n\tdelete[] preservedFrames;\n\tdelete[] restoringFrames;\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/giflib/dgif_fuzz_common.h",
    "content": "#include \"gif_lib.h\"\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define ARGB_TO_COLOR8888(a, r, g, b) \\\n\t((a) << 24 | (b) << 16 | (g) << 8 | (r))\n\ntypedef uint32_t Color8888;\n\nstruct gifUserData\n{\n\tsize_t gifLen;\n\tuint8_t *gifData;\n};\n\nint stub_input_reader(GifFileType *gifFileType, GifByteType *gifByteType, int len);\nint fuzz_dgif(const uint8_t *Data, size_t Size);\nint fuzz_dgif_extended(const uint8_t *Data, size_t Size);\nint fuzz_dgif_ala_android(const uint8_t *Data, size_t Size);"
  },
  {
    "path": "projects/giflib/dgif_protobuf_target.cc",
    "content": "#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n#include <string>\n#include <sstream>\n#include <fstream>\n#include \"dgif_fuzz_common.h\"\n\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n#include \"ProtoToGif.h\"\n\nusing namespace gifProtoFuzzer;\n\nDEFINE_PROTO_FUZZER(const GifProto &gif_proto)\n{\n\t// Instantiate ProtoConverter object\n\tProtoConverter converter;\n\tstd::string gifRawData = converter.gifProtoToString(gif_proto);\n\tif (const char *dump_path = getenv(\"PROTO_FUZZER_DUMP_PATH\"))\n\t{\n\t\t// With libFuzzer binary run this to generate a GIF from proto:\n\t\t// PROTO_FUZZER_DUMP_PATH=x.gif ./fuzzer proto-input\n\t\tstd::ofstream of(dump_path);\n\t\tof.write(gifRawData.data(), gifRawData.size());\n\t}\n\tfuzz_dgif_extended((const uint8_t *)gifRawData.data(), gifRawData.size());\n}"
  },
  {
    "path": "projects/giflib/dgif_target.cc",
    "content": "#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n#include \"dgif_fuzz_common.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)\n{\n\treturn fuzz_dgif_extended(Data, Size);\n}"
  },
  {
    "path": "projects/giflib/dgif_target.options",
    "content": "[libfuzzer]\ndict = gif.dict\n"
  },
  {
    "path": "projects/giflib/egif_fuzz_common.cc",
    "content": "#include \"egif_fuzz_common.h\"\n#define GIF_IMAGE_WIDTH 100\n// This is rgb byte stream length per horizontal line = GIF_IMAGE_WIDTH * 3\n#define GIF_IMAGE_LINE 300\n\nextern \"C\" void PrintGifError(int ErrorCode);\n\nint stub_output_writer(GifFileType *gifFileType, const uint8_t *buf, int len)\n{\n\tstruct gifUserData *gud = (struct gifUserData *)gifFileType->UserData;\n\n\tif (gud == NULL || gud->gifData == NULL || len == 0)\n\t\treturn 0;\n\tif (gud->allocatedSize < (gud->gifLen + len))\n\t{\n\t\t// Reallocate gifFileType\n\t\tint newSize = (gud->gifLen + len) * 2;\n\t\tuint8_t *oldGud = gud->gifData;\n\t\tgud->gifData = (uint8_t *)realloc(oldGud, newSize);\n\t\t// Assert when realloc fails.\n\t\tassert(gud->gifData != NULL);\n\t\tgud->allocatedSize = newSize;\n\t}\n\tmemcpy(gud->gifData + gud->gifLen, buf, len);\n\tgud->gifLen += len;\n\treturn len;\n}\n\n// RGB to GIF converter\nstatic bool rgb_to_gif(const uint8_t *data, size_t size)\n{\n\t// Bail if total size is not a multiple of GIF_IMAGE_LINE (see below)\n\t// Keep a fixed width e.g., GIF_IMAGE_WIDTH\n\t// size/3 = GIF_IMAGE_WIDTH * height\n\t// height = size/GIF_IMAGE_LINE\n\n\t// Extract height\n\tint height = size / GIF_IMAGE_LINE;\n\n\t// GifByteType is unsigned char (raw byte)\n\t// mem holds the raw RGB byte stream for the entire image\n\tGifByteType *mem = (GifByteType *)malloc(sizeof(GifByteType) * height * GIF_IMAGE_WIDTH * 3);\n\tif (!mem)\n\t\treturn false;\n\n\t// Copy RGB data to mem\n\tmemcpy(mem, data, size);\n\n\tGifByteType *red_buf = mem;\n\tGifByteType *green_buf = mem + (GIF_IMAGE_WIDTH * height);\n\tGifByteType *blue_buf = mem + (GIF_IMAGE_WIDTH * height * 2);\n\n\t// ColorMapObject *GifMakeMapObject(int ColorCount, GifColorType *ColorMap)\n\t// Allocate storage for a color map object with the given number of RGB triplet slots.\n\t// If the second argument is non-NULL, initialize the color table portion of\n\t// the new map from it. Returns NULL if memory is exhausted or if the size is\n\t// not a power of 2 <= 256.\n\t// TODO: Fuzz color map size (has to be a power of 2 less than equal to 256)\n\t// TODO: Fuzz color table initialization\n\tint color_map_size = 256;\n\tColorMapObject *output_color_map = GifMakeMapObject(color_map_size, NULL);\n\tif (!output_color_map)\n\t{\n\t\tfree(mem);\n\t\treturn false;\n\t}\n\n\t// gif output will be written to output_buf\n\tsize_t out_size = sizeof(GifByteType) * GIF_IMAGE_WIDTH * height;\n\tGifByteType *output_buf = (GifByteType *)malloc(out_size);\n\tif (!output_buf)\n\t{\n\t\tGifFreeMapObject(output_color_map);\n\t\tfree(mem);\n\t\treturn false;\n\t}\n\n\tif (GifQuantizeBuffer(GIF_IMAGE_WIDTH, height, &color_map_size,\n\t\t\t\t\t\t  red_buf, green_buf, blue_buf,\n\t\t\t\t\t\t  output_buf, output_color_map->Colors) == GIF_ERROR)\n\t{\n\t\tGifFreeMapObject(output_color_map);\n\t\tfree(output_buf);\n\t\tfree(mem);\n\t\treturn false;\n\t}\n\n\t// Now that raw RGB data has been quantized, we no longer need it.\n\tfree(mem);\n\n\tGifFileType *GifFile;\n\tint Error;\n\t// We start with 1024, but resize dynamically\n\t// see stub_output_writer\n\tuint8_t *gifData = (uint8_t *)malloc(1024);\n\tstruct gifUserData gUData = {0, 1024, gifData};\n\n\t/* GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *ErrorCode)\n\t * Description:\n\t *  Open a new GIF file using the given userPtr (in binary mode, if under Windows).\n\t *  writeFunc is a function pointer that writes to output gif file.\n\t *  If any error occurs, NULL is returned and the ErrorCode is set.\n\t */\n\tGifFile = EGifOpen((void *)&gUData, stub_output_writer, &Error);\n\tif (GifFile == NULL)\n\t{\n\t\tPrintGifError(GifFile->Error);\n\t\tGifFreeMapObject(output_color_map);\n\t\tfree(output_buf);\n\t\tfree(gUData.gifData);\n\t\treturn false;\n\t}\n\n\t/* void EGifSetGifVersion(GifFileType *GifFile, bool gif89)\n\t * Description:\n\t * \tSet the GIF type, to GIF89 if the argument is true and GIF87 if it is false.\n\t * \tThe default type is GIF87. This function may be called after the GifFile\n\t * \trecord is allocated but before EGifPutScreenDesc().\n\t */\n\tEGifSetGifVersion(GifFile, false);\n\n\t/* int EGifPutScreenDesc(GifFileType *GifFile,\n     *   const int GifWidth, const GifHeight,\n     *   const int GifColorRes, const int GifBackGround,\n     *   ColorMapObject *GifColorMap)\n     *\n\t *  Update the GifFile Screen parameters, in GifFile structure and in the real file.\n\t *  If error occurs, returns GIF_ERROR (see gif_lib.h), otherwise GIF_OK.\n\t * \tThis routine should be called immediately after the GIF file was opened.\n\t */\n\tif (EGifPutScreenDesc(GifFile, GIF_IMAGE_WIDTH, height, color_map_size, 0, output_color_map) == GIF_ERROR)\n\t{\n\t\tPrintGifError(GifFile->Error);\n\t\tGifFreeMapObject(output_color_map);\n\t\tfree(output_buf);\n\t\tEGifCloseFile(GifFile, &Error);\n\t\tfree(gUData.gifData);\n\t\treturn false;\n\t}\n\n\t/* int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop,\n\t * const int GifWidth, const GifHeight, const bool GifInterlace, ColorMapObject *GifColorMap)\n\t * Description\n\t *  Update GifFile Image parameters, in GifFile structure and in the real file.\n\t *  if error occurs returns GIF_ERROR (see gif_lib.h), otherwise GIF_OK.\n\t *  This routine should be called each time a new image must be dumped to the file.\n\t */\n\tif (EGifPutImageDesc(GifFile, 0, 0, GIF_IMAGE_WIDTH, height, false, NULL) == GIF_ERROR)\n\t{\n\t\tPrintGifError(GifFile->Error);\n\t\tGifFreeMapObject(output_color_map);\n\t\tfree(output_buf);\n\t\tEGifCloseFile(GifFile, &Error);\n\t\tfree(gUData.gifData);\n\t\treturn false;\n\t}\n\n\tGifByteType *output_bufp = output_buf;\n\tfor (int i = 0; i < height; i++)\n\t{\n\t\t/* int EGifPutLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen)\n\t\t * Description:\n\t\t *  Dumps a block of pixels out to the GIF file. The slab can be of any length.\n\t\t *  More than that, this routine may be interleaved with EGifPutPixel(),\n\t\t *  until all pixels have been sent.\n\t\t *  Returns GIF_ERROR if something went wrong, GIF_OK otherwise.\n\t\t */\n\t\tif (EGifPutLine(GifFile, output_bufp, GIF_IMAGE_WIDTH) == GIF_ERROR)\n\t\t{\n\t\t\tPrintGifError(GifFile->Error);\n\t\t\tGifFreeMapObject(output_color_map);\n\t\t\tfree(output_buf);\n\t\t\tEGifCloseFile(GifFile, &Error);\n\t\t\tfree(gUData.gifData);\n\t\t\treturn false;\n\t\t}\n\t\toutput_bufp += GIF_IMAGE_WIDTH;\n\t}\n\n\t/* void GifFreeMapObject(ColorMapObject *Object)\n\t * Description\n\t *  Free the storage occupied by a ColorMapObject that is no longer needed.\n\t */\n\tGifFreeMapObject(output_color_map);\n\tfree(output_buf);\n\tEGifCloseFile(GifFile, &Error);\n\tfree(gUData.gifData);\n\treturn true;\n}\n\nint fuzz_egif(const uint8_t *Data, size_t Size)\n{\n\t// We treat fuzzed data as a raw RGB stream for a picture\n\t// with a fixed width of GIF_IMAGE_WIDTH.\n\t// Since we need 3 color bytes per pixel (RGB), height = size/GIF_IMAGE_LINE\n\t//      where GIF_IMAGE_LINE = GIF_IMAGE_WIDTH * 3\n\t// For integral height, we need Size to be a multiple of GIF_IMAGE_LINE\n\tif ((Size == 0) || ((Size % GIF_IMAGE_LINE) != 0))\n\t\treturn 0;\n\tbool status = rgb_to_gif(Data, Size);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/giflib/egif_fuzz_common.h",
    "content": "#include \"gif_lib.h\"\n#include \"assert.h\"\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\nstruct gifUserData\n{\n\tsize_t gifLen;\n\tsize_t allocatedSize;\n\tuint8_t *gifData;\n};\n\nextern \"C\" int GifQuantizeBuffer(unsigned int Width, unsigned int Height,\n                   int *ColorMapSize, GifByteType * RedInput,\n                   GifByteType * GreenInput, GifByteType * BlueInput,\n                   GifByteType * OutputBuffer,\n                   GifColorType * OutputColorMap);\n\nint stub_output_writer(GifFileType *gifFileType, GifByteType *gifByteType, int len);\nint fuzz_egif(const uint8_t *Data, size_t Size);\n"
  },
  {
    "path": "projects/giflib/egif_target.cc",
    "content": "#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n#include \"egif_fuzz_common.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)\n{\n\treturn fuzz_egif(Data, Size);\n}"
  },
  {
    "path": "projects/giflib/gif_fuzz_proto.proto",
    "content": "syntax = \"proto2\";\n// Proto description of the gif format.\n// Refer to: https://www.fileformat.info/format/gif/egff.htm\n// https://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp\n\n// TODO: Verify if this is correct\n\nmessage LogicalScreenDescriptor {\n    required uint32 ScreenWidth = 1;\n    required uint32 ScreenHeight= 2;\n    required uint32 Packed = 3;\n    required uint32 BackgroundColor = 4;\n    required uint32 AspectRatio = 5;\n}\n\nmessage GlobalColorTable {\n    required bytes colors = 1;\n}\n\nmessage ImageDescriptor {\n  required uint32 Seperator =1;\n  required uint32 Left =2;\n  required uint32 Top = 3;\n  required uint32 Width = 4;\n  required uint32 Height = 5;\n  required uint32 Packed = 6;\n}\n\nmessage GraphicControlExtension {\n  required uint32 Packed = 1;\n  required uint32 DelayTime = 2;\n  required uint32 transparentColorIndex = 3;\n}\n\nmessage PlainTextExtension {\n  repeated SubBlock subs = 1;\n  optional GraphicControlExtension gcExt = 2;\n}\n\nmessage LocalColorTable {\n  required bytes colors = 1;\n}\n\nmessage SubBlock {\n  required uint32 len = 1;\n  required bytes data = 2;\n}\n\nmessage ImageData {\n  required uint32 lzw = 1;\n  repeated SubBlock subs = 2;\n}\n\nmessage BasicChunk {\n  required ImageDescriptor imDescriptor =1;\n  required LocalColorTable lct = 2;\n  required ImageData img = 3;\n  optional GraphicControlExtension gcExt = 4;\n}\n\nmessage ApplicationExtension {\n  required fixed64 appid = 1;\n  repeated SubBlock subs = 2;\n}\n\nmessage CommentExtension {\n  repeated SubBlock subs = 1;\n}\n\nmessage Header {\n  enum Version {\n    ENA = 1;\n    ESA = 2;\n    INV = 3;\n  }\n  required Version ver = 1;\n}\n\nmessage Trailer {}\n\nmessage ImageChunk {\n  oneof chunk_oneof {\n    BasicChunk basic = 1;\n    PlainTextExtension plaintext = 2;\n    ApplicationExtension appExt = 3;\n    CommentExtension comExt = 4;\n  }\n}\n\nmessage GifProto {\n  required Header header = 1;\n  required LogicalScreenDescriptor lsd = 2;\n  // Instead of making GCT optional here, we condition its visit on LSD's packed byte\n  // in the converter\n  required GlobalColorTable gct = 3;\n  repeated ImageChunk chunks = 4;\n  required Trailer trailer = 5;\n}\n\npackage gifProtoFuzzer;"
  },
  {
    "path": "projects/giflib/project.yaml",
    "content": "homepage: \"http://giflib.sourceforge.net/\"\nmain_repo: \"https://git.code.sf.net/p/giflib/code\"\nlanguage: c++\nprimary_contact: \"esr@thyrsus.com\"\nauto_ccs:\n  - \"vincent.ulitzsch@live.de\"\n  - \"bshas3@gmail.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\ncoverage_extra_args: -ignore-filename-regex=.*/LPM/.*\n"
  },
  {
    "path": "projects/gimli/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/gimli-rs/gimli gimli\nRUN git clone --depth 1 https://github.com/gimli-rs/gimli-libfuzzer-corpora $SRC/gimli/fuzz/corpus\nWORKDIR gimli\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/gimli/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build -O\ncargo fuzz list | while read i; do\n    cp fuzz/target/x86_64-unknown-linux-gnu/release/$i $OUT/\n\n    if [ -d \"$SRC/gimli/fuzz/corpus/${i}\" ]; then\n        zip -rj \"$OUT/${i}_seed_corpus.zip\" \"$SRC/gimli/fuzz/corpus/${i}\"\n    fi\ndone\n"
  },
  {
    "path": "projects/gimli/project.yaml",
    "content": "homepage: \"https://github.com/gimli-rs/gimli\"\nlanguage: rust\nprimary_contact: \"philipjcraig@gmail.com\"\nmain_repo: \"https://github.com/gimli-rs/gimli\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/git/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y \\\n        cvs cvsps gettext libcgi-pm-perl libcurl4-gnutls-dev \\\n        libdbd-sqlite3-perl liberror-perl libexpat1-dev libhttp-date-perl \\\n        libio-pty-perl libmailtools-perl libpcre2-dev libpcre3-dev libsvn-perl \\\n        perl-modules libyaml-perl libz-dev python subversion tcl unzip \\\n        asciidoc docbook-xsl xmlto libssl-dev zip\nRUN git clone --depth 1 https://github.com/git/git git\nRUN git clone --depth 1 https://github.com/madler/zlib\nWORKDIR $SRC/git\nCOPY run_tests.sh build.sh $SRC/\n# This is to fix Fuzz Introspector build by using LLVM old pass manager\n# re https://github.com/ossf/fuzz-introspector/issues/305\nENV OLD_LLVMPASS=1\n\n"
  },
  {
    "path": "projects/git/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build zlib\npushd \"$SRC/zlib\"\n./configure --static --prefix=\"$WORK\"\nmake -j$(nproc) CFLAGS=\"$CFLAGS -fPIC\"\nmake install\npopd\nexport ZLIB_PATH=$WORK\n\n# Enable a timeout for lockfiles rather than exit immediately. This is to\n# overcome in case multiple processes try to lock a file around the same\n# time. \nsed -i 's/hold_lock_file_for_update_timeout(lk, path, flags, 0);/hold_lock_file_for_update_timeout(lk, path, flags, 5000);/g' lockfile.h\n\n# Override GITLIBS to exclude common-main.o. The fuzzing engine (libFuzzer or AFL)\n# provides its own main() that calls LLVMFuzzerTestOneInput().\n# For AFL, we also need --whole-archive to force include the AFL driver's main().\nif [ \"${FUZZING_ENGINE:-}\" = \"afl\" ]; then\n  FUZZING_ENGINE_FLAGS=\"-Wl,--whole-archive $LIB_FUZZING_ENGINE -Wl,--no-whole-archive\"\nelse\n  FUZZING_ENGINE_FLAGS=\"$LIB_FUZZING_ENGINE\"\nfi\n\n# build fuzzers\nmake -j$(nproc) CC=$CC CXX=$CXX CFLAGS=\"$CFLAGS\" \\\n  FUZZ_CXXFLAGS=\"$CXXFLAGS\" \\\n  LIB_FUZZING_ENGINE=\"$FUZZING_ENGINE_FLAGS\" \\\n  GITLIBS=libgit.a fuzz-all\n\nFUZZERS=\"\"\nFUZZERS=\"$FUZZERS fuzz-commit-graph\"\nFUZZERS=\"$FUZZERS fuzz-config\"\nFUZZERS=\"$FUZZERS fuzz-credential-from-url-gently\"\nFUZZERS=\"$FUZZERS fuzz-date\"\nFUZZERS=\"$FUZZERS fuzz-pack-headers\"\nFUZZERS=\"$FUZZERS fuzz-pack-idx\"\nFUZZERS=\"$FUZZERS fuzz-parse-attr-line\"\nFUZZERS=\"$FUZZERS fuzz-url-decode-mem\"\n\n# copy fuzzers\nfor fuzzer in $FUZZERS ; do\n  cp oss-fuzz/$fuzzer $OUT\ndone\n\nfor fuzzer in $FUZZERS ; do\n  cat >$OUT/$fuzzer.options << EOF\n[libfuzzer]\ndetect_leaks = 0\nEOF\ndone\n\n"
  },
  {
    "path": "projects/git/project.yaml",
    "content": "homepage: \"https://git-scm.com\"\nlanguage: c++\nprimary_contact: \"steadmon@google.com\"\nauto_ccs:\n  - \"git-fuzz-reports@google.com\"\n  - \"emilyshaffer@google.com\"\n  - \"jonathantanmy@google.com\"\n  - \"jrn@google.com\"\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\nmain_repo: 'https://github.com/git/git'\n\n# Disable honggfuzz due to undiagnosed build failures\nfuzzing_engines:\n  - libfuzzer\n  - afl\n"
  },
  {
    "path": "projects/git/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake test -j$(nproc)\n"
  },
  {
    "path": "projects/gitdb/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/gitpython-developers/gitdb gitdb\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/gitdb\n"
  },
  {
    "path": "projects/gitdb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/gitdb/fuzz_gitdb.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer for several modules in gitdb. We keep it in\none fuzzer for ease of development\n\"\"\"\n\nimport sys\nimport atheris\n\n\nimport zlib\nfrom gitdb import (\n  DecompressMemMapReader,\n  LooseObjectDB,\n  MemoryDB\n) \n\nfrom gitdb.pack import (\n    PackFile\n)\n\nfrom gitdb.exc import ParseError\n\n\ndef fuzz_decompression_map_reader(data):\n  \"\"\"Targets gitdb/stream.py#DecompressMemMapReader\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n\n  zdata = zlib.compress(data)\n  test_reader = DecompressMemMapReader(zdata, True)\n  try:\n    bytes_read = test_reader.read(fdp.ConsumeIntInRange(0, 10000))\n  except ValueError:\n    # Ignore these as they're uninteresting\n    return\n\n\ndef fuzz_loose_obj_db(data):\n  \"\"\"Targets gitdb/db/loose.py\"\"\"\n  path = \"/tmp/loosedb.db\"\n  with open(path, \"wb\") as f:\n    f.write(data)\n  if not os.path.isfile(path):\n    return\n\n  ldb = LooseObjectDB(path)\n  if ldb.size() != 0:\n    mdb = MemoryDB()\n    mdb.stream_copy(mdb.sha_iter(), ldb)\n\n    for sha1 in ldb.sha_iter():\n      ldb.info(sha1)\n      ldb.stream(sha1)\n\n\ndef fuzz_pack_file(data):\n  \"\"\"Targets code in gitdb/pack.py\"\"\"\n\n  # Ensure we have enough data for a packet\n  if len(data) < 100:\n    return\n  path = \"/tmp/packfile.idx\"\n  with open(path, \"wb\") as f:\n    f.write(data)\n  if not os.path.isfile(path):\n    return\n\n  pack_file = PackFile(path)\n  try:\n    pack_file.version()\n  except ParseError:\n    return\n\n  if pack_file.size() <= 0:\n    return\n\n  for obj in pack_file.stream_iter():\n    info = pack_file.info(obj.pack_offset)\n\ndef TestOneInput(data):\n  fuzz_decompression_map_reader(data)\n  fuzz_loose_obj_db(data)\n  fuzz_pack_file(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/gitdb/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/gitpython-developers/gitdb\nlanguage: python\nmain_repo: https://github.com/gitpython-developers/gitdb\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/gitea/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/go-gitea/gitea\nCOPY build.sh $SRC/\nWORKDIR $SRC/gitea\n"
  },
  {
    "path": "projects/gitea/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ncompile_native_go_fuzzer code.gitea.io/gitea/tests/fuzz FuzzMarkdownRenderRaw fuzz_markdown_render_raw gofuzz\ncompile_native_go_fuzzer code.gitea.io/gitea/tests/fuzz FuzzMarkupPostProcess fuzz_markup_post_process gofuzz\n"
  },
  {
    "path": "projects/gitea/project.yaml",
    "content": "homepage: \"https://github.com/go-gitea/gitea\"\nprimary_contact: \"security@gitea.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"xiaolunwen@gmail.com\"\n  - \"lauris@nix.lv\"\n  - \"techknowlogick@gitea.io\"\n  - \"sapk@sapk.fr\"\n  - \"zeripath@gmail.com\"\n  - \"john.olheiser@gmail.com\"\n  - \"the6543dev@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/go-gitea/gitea\"\n"
  },
  {
    "path": "projects/github_scarecrow/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN pip3 install requests\nRUN git clone --depth 1 https://github.com/Alan32Liu/github-scarecrow.git $SRC/github-scarecrow\nWORKDIR $SRC/github-scarecrow\nRUN git clone --depth 1 https://github.com/google/oss-fuzz\nRUN cd oss-fuzz/infra/experimental/SystemSan && make\nCOPY shell_injection_poc_fuzzer.py fakelib.py build.sh $SRC/\n"
  },
  {
    "path": "projects/github_scarecrow/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_python_fuzzer ../shell_injection_poc_fuzzer.py\n"
  },
  {
    "path": "projects/github_scarecrow/fakelib.py",
    "content": "#!/usr/bin/env python\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nRAN_ONCE = False\n\ndef do_something(data):\n    global RAN_ONCE\n    if not RAN_ONCE:\n        RAN_ONCE = True\n    if not data:\n        return\n    if data[0]:\n        print('hello')\n    else:\n        print('bye')\n"
  },
  {
    "path": "projects/github_scarecrow/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\n# dummy\nhomepage: 'https://github.com/Alan32Liu/github-scarecrow'\nprimary_contact: 'donggeliu@google.com'\nlanguage: python\nsanitizers:\n  - address\nmain_repo: 'https://github.com/Alan32Liu/github-scarecrow'\nfile_github_issue: True\nauto_ccs:\n  - 'gongh@google.com'"
  },
  {
    "path": "projects/github_scarecrow/shell_injection_poc_fuzzer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n  import os\n  # To trick atheris\n  import fakelib\n\ndef TestOneInput(data):\n    fakelib.do_something(data)\n    if not data:\n        return\n    if not data[0]:\n        return\n    if any(0 == c for c in data):\n        return\n    try:\n        os.system(data)\n    except ValueError as e:\n        print(e)\n        return\n    return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/gitoxide/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth 1 https://github.com/Byron/gitoxide.git gitoxide\nRUN rustup update nightly\nWORKDIR gitoxide\nRUN rustup component add rust-src\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/gitoxide/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -eox pipefail\n\nexport CARGO_BUILD_TARGET_DIR=$WORK/shared_cache\n\nFUZZ_CRATE_DIRS=$(find . -type d -name fuzz -exec dirname $(readlink -f {}) \\;)\n\nfor CRATE_DIR in ${FUZZ_CRATE_DIRS[@]};\ndo\n  echo \"Building crate: $CRATE_DIR\"\n  cd $CRATE_DIR\n  cargo +nightly fuzz build -O --debug-assertions\n  FUZZ_TARGET_OUTPUT_DIR=$CARGO_BUILD_TARGET_DIR/x86_64-unknown-linux-gnu/release\n  for f in fuzz/fuzz_targets/*.rs\n  do\n      FUZZ_TARGET_NAME=$(basename ${f%.*})\n      CRATE_NAME=$(basename $CRATE_DIR)\n      OUT_FUZZER_NAME=$OUT/$CRATE_NAME-$FUZZ_TARGET_NAME\n      cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT_FUZZER_NAME\n      FUZZ_CORPUS_BUILDER=./fuzz/fuzz_targets/${FUZZ_TARGET_NAME}_corpus_builder.sh\n      if test -f \"$FUZZ_CORPUS_BUILDER\"; then\n          $FUZZ_CORPUS_BUILDER $SRC/gitoxide ${OUT_FUZZER_NAME}_seed_corpus.zip\n      fi\n      FUZZ_DICT=./fuzz/fuzz_targets/${FUZZ_TARGET_NAME}.dict\n      if test -f \"$FUZZ_DICT\"; then\n            cp $FUZZ_DICT ${OUT_FUZZER_NAME}.dict\n      fi\n  done\ndone\n"
  },
  {
    "path": "projects/gitoxide/project.yaml",
    "content": "homepage: \"https://crates.io/crates/gitoxide\"\nlanguage: rust\nprimary_contact: \"byronimo@gmail.com\"\nauto_ccs:\n  - \"nathaniel.brough@gmail.com\"\n  - \"eliahkagan@gmail.com\"\nmain_repo: \"https://github.com/GitoxideLabs/gitoxide\"\nfile_github_issue: true\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/rustc/.*\n"
  },
  {
    "path": "projects/gitpython/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/gitpython-developers/gitpython gitpython\nRUN $SRC/gitpython/fuzzing/oss-fuzz-scripts/container-environment-bootstrap.sh\n\nCOPY *.sh $SRC/\nWORKDIR $SRC/gitpython\n"
  },
  {
    "path": "projects/gitpython/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n. \"$SRC/gitpython/fuzzing/oss-fuzz-scripts/build.sh\"\n"
  },
  {
    "path": "projects/gitpython/project.yaml",
    "content": "homepage: \"https://github.com/gitpython-developers/gitpython\"\nlanguage: python\nprimary_contact: \"byronimo@gmail.com\"\nauto_ccs:\n  - \"david.js.lakin@gmail.com\"\n  - \"eliahkagan@gmail.com\"\nmain_repo: \"https://github.com/gitpython-developers/gitpython\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/glaze/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n# RUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/stephenberry/glaze\nWORKDIR glaze\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/glaze/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfuzzing/ossfuzz.sh\n"
  },
  {
    "path": "projects/glaze/project.yaml",
    "content": "homepage: \"https://github.com/stephenberry/glaze\"\nlanguage: c++\nprimary_contact: \"pauldreikossfuzz@gmail.com\"\nauto_ccs:\n   - \"stephenberry.developer@gmail.com\"\nmain_repo: \"https://github.com/stephenberry/glaze.git\"\nfile_github_issue: true\n"
  },
  {
    "path": "projects/glaze/run_tests.sh",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd build\nASAN_OPTIONS=detect_leaks=0 ctest -C Release -j$(nproc) --output-on-failure\n"
  },
  {
    "path": "projects/glib/0001-deflate-Zero-initialise-the-prev-and-window-buffers.patch",
    "content": "From 73aa394ed2e45876945ae90d1e2fd0fb0dfb84b7 Mon Sep 17 00:00:00 2001\nFrom: Philip Withnall <pwithnall@gnome.org>\nDate: Mon, 1 Dec 2025 19:16:55 +0000\nSubject: [PATCH] deflate: Zero-initialise the prev and window buffers\n\nThis is the combination of patches:\n - https://github.com/chromium/chromium/blob/main/third_party/zlib/patches/0003-uninitializedjump.patch\n - https://github.com/chromium/chromium/blob/main/third_party/zlib/patches/0007-zero-init-deflate-window.patch\n - https://github.com/chromium/chromium/blob/main/third_party/zlib/patches/0017-deflate-move-zmemzero-after-null-check.patch\n\nauthored by Adenilson Cavalcanti, Hans Wennborg and pedro martelletto\nfor Chromium.\n\nThey needed to be combined and re-rolled as a patch to avoid having to\napply all the other Chromium zlib patches so they would apply properly.\n\nThey fix some msan errors from deflate which have been reported to zlib\nupstream but not fixed yet. See the original patches for details.\n\nAlso clear the `head` and `pending_buf` buffers similarly (my own\nchanges).\n---\n deflate.c | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/deflate.c b/deflate.c\nindex 012ea81..e626727 100644\n--- a/deflate.c\n+++ b/deflate.c\n@@ -503,6 +503,16 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,\n         deflateEnd (strm);\n         return Z_MEM_ERROR;\n     }\n+    /* Avoid use of unitialized values in the window, see crbug.com/1137613 and\n+     * crbug.com/1144420 */\n+    zmemzero(s->window, s->w_size * (2 * sizeof(Byte)));\n+    /* Avoid use of uninitialized value, see:\n+     * https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11360\n+     */\n+    zmemzero(s->prev, s->w_size * sizeof(Pos));\n+    /* Same for the other buffers */\n+    zmemzero(s->head, s->hash_size * sizeof(Pos));\n+    zmemzero(s->pending_buf, s->lit_bufsize * LIT_BUFS);\n #ifdef LIT_MEM\n     s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1));\n     s->l_buf = s->pending_buf + (s->lit_bufsize << 2);\n-- \n2.51.1\n\n"
  },
  {
    "path": "projects/glib/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake libtool pkg-config python3-pip\nRUN unset CFLAGS CXXFLAGS && pip3 install -U meson ninja packaging\nRUN git clone --depth 1 --branch v1.3.1 --no-tags https://github.com/madler/zlib.git\nRUN git clone --depth 1 --no-tags https://gitlab.gnome.org/GNOME/glib\nWORKDIR glib\nCOPY build.sh $SRC/\nCOPY 0001-deflate-Zero-initialise-the-prev-and-window-buffers.patch $SRC/\n"
  },
  {
    "path": "projects/glib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPREFIX=$WORK/prefix\nmkdir -p $PREFIX\n\nexport PKG_CONFIG=\"`which pkg-config` --static\"\nexport PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\nexport PATH=$PREFIX/bin:$PATH\n\nBUILD=$WORK/build\n\nrm -rf $WORK/*\nrm -rf $BUILD\nmkdir -p $BUILD\n\n# Build zlib locally so it definitely has fsanitize support\n# Apply some patches from Chromium to fix known msan issues\n# which are not yet fixed upstream.\npushd $SRC/zlib\npatch -p1 < $SRC/0001-deflate-Zero-initialise-the-prev-and-window-buffers.patch\nmkdir build && cd build\nCFLAGS=-fPIC ../configure --static --prefix=$PREFIX\nmake install -j$(nproc)\npopd\n\n# Build GLib itself\nmeson $BUILD \\\n  -Doss_fuzz=enabled \\\n  -Db_lundef=false \\\n  --prefix=$PREFIX \\\n  --libdir=lib \\\n  -Ddefault_library=static \\\n  -Dlibmount=disabled\n\nninja -C $BUILD\n\nfind $BUILD/fuzzing -maxdepth 1 -executable -type f -exec cp \"{}\" $OUT \\;\n\nfind fuzzing -type f -name \"*.dict\" -exec cp \"{}\" $OUT \\;\n\nfor CORPUS in $(find fuzzing -type f -name \"*.corpus\"); do\n  BASENAME=${CORPUS##*/}\n  zip $OUT/${BASENAME%%.*}_seed_corpus.zip . -ws -r -i@$CORPUS\ndone\n"
  },
  {
    "path": "projects/glib/project.yaml",
    "content": "homepage: \"https://gitlab.gnome.org/GNOME/glib/\"\nlanguage: c++\nprimary_contact: \"bugzilla@tecnocode.co.uk\"\nauto_ccs:\n- philip.withnall@gmail.com\n- mwl458@gmail.com\n- iain@orangesquash.org.uk\n- slomo@coaxion.net\n- trevi55@gmail.com\n- mcatanza@redhat.com\n- tcullum@redhat.com\nsanitizers:\n- address\n- memory\n- undefined\nhelp_url: https://gitlab.gnome.org/GNOME/glib/tree/master/fuzzing#how-to-reproduce-oss-fuzz-bugs-locally\nmain_repo: 'https://gitlab.gnome.org/GNOME/glib'\n"
  },
  {
    "path": "projects/globaleaks-whistleblowing-software/project.yaml",
    "content": "homepage: \"https://www.globaleaks.org/\"\nlanguage: python\nprimary_contact: \"giovanni.pellerano@globaleaks.org\"\nmain_repo: 'https://github.com/globaleaks/globaleaks-whistleblowing-software.git'\n"
  },
  {
    "path": "projects/glog/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/google/glog\n\nCOPY run_tests.sh build.sh $SRC/\nWORKDIR $SRC/glog\n"
  },
  {
    "path": "projects/glog/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\ncmake .. -DWITH_FUZZING=ossfuzz -DBUILD_SHARED_LIBS=OFF\nmake -j$(nproc)\ncp fuzz_* $OUT/\n"
  },
  {
    "path": "projects/glog/project.yaml",
    "content": "homepage: \"https://github.com/google/glog\"\nlanguage: c++\nprimary_contact: \"sergiu.deitsch@gmail.com\"\nauto_ccs :\n- \"p.antoine@catenacyber.fr\"\n\nmain_repo: 'https://github.com/google/glog'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/glog/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build -E \"stacktrace|symbolize|includes_logging|includes_vlog_is_on|includes_raw_logging\"\n"
  },
  {
    "path": "projects/glom/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/mahmoud/glom\nCOPY build.sh *.py $SRC/\nWORKDIR glom\n"
  },
  {
    "path": "projects/glom/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/glom/fuzz_core.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport glom\nimport json\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  val = {'d': {'e': ['f']}}\n  try:\n    glom.core.glom(val, glom.core.Inspect(fdp.ConsumeUnicodeNoSurrogates(64)))\n  except glom.GlomError:\n    pass\n\n  try:\n    glom.core.glom(\n        val,\n        glom.core.Coalesce(fdp.ConsumeUnicodeNoSurrogates(32),\n                           fdp.ConsumeUnicodeNoSurrogates(32),\n                           fdp.ConsumeUnicodeNoSurrogates(32)))\n  except glom.GlomError:\n    pass\n  # Create a random dictionary. In this case if any\n  # error happens during random dict creation we just\n  # exit.\n  try:\n    json_dict = json.loads(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 512)))\n  except Exception:\n    return\n  if not isinstance(json_dict, dict):\n    return\n\n  # Use random dict as input to glom\n  try:\n    glom.core.glom(json_dict, fdp.ConsumeString(30))\n  except glom.GlomError:\n    pass\n\n  try:\n    spec = glom.T['a']['b']['c']\n    glom.core.glom(json_dict, spec)\n  except glom.GlomError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/glom/fuzz_glom.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport glom\nimport json\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  val = {'d': {'e': ['f']}}\n  try:\n    glom.core.glom(val, fdp.ConsumeString(30))\n  except glom.core.PathAccessError:\n    pass\n\n  # Create a random dictionary. In this case if any\n  # error happens during random dict creation we just\n  # exit.\n  try:\n    json_dict = json.loads(fdp.ConsumeString(100))\n  except Exception:\n    return\n  if not isinstance(json_dict, dict):\n    return\n\n  # Use random dict as input to glom\n  try:\n    glom.core.glom(json_dict, fdp.ConsumeString(30))\n  except glom.core.PathAccessError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/glom/fuzz_matching.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport glom\nimport json\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  spec = glom.matching.Match([{\n      'fuzz1': str,\n      'fuzz2': str,\n      'fuzz3': int,\n      'fuzz4': dict\n  }])\n\n  # Create a random object using json\n  try:\n    json_val = json.loads(fdp.ConsumeString(sys.maxsize))\n  except Exception:\n    return\n\n  try:\n    glom.glom(json_val, spec)\n  except glom.GlomError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/glom/fuzz_mutation.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport glom\nimport json\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    glom.mutation.delete({'a': [{\n        'f': 'z'\n    }, {'ff', 'zz'}]}, fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except (glom.GlomError, ValueError):\n    pass\n\n  # Create a random object using json\n  try:\n    json_val = json.loads(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 1024)))\n  except Exception:\n    return\n\n  try:\n    glom.mutation.delete(json_val, 'a.1.b.2.c')\n  except (glom.GlomError, ValueError, TypeError):\n    pass\n\n  try:\n    glom.mutation.delete(json_val, fdp.ConsumeUnicodeNoSurrogates(64))\n  except (glom.GlomError, ValueError, TypeError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/glom/fuzz_reduction.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nimport glom\nimport json\n\n\ndef test_flatten(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  list_of_lists = []\n  for idx in range(fdp.ConsumeIntInRange(1, 1000)):\n    list_of_lists.append(\n        fdp.ConsumeIntListInRange(fdp.ConsumeIntInRange(1, 100), -100000,\n                                  10000))\n  glom.reduction.flatten(list_of_lists)\n\n\ndef test_merge(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  list_of_dicts = []\n  for idx in range(fdp.ConsumeIntInRange(1, 1000)):\n    tmp_dict = {}\n    tmp_dict[fdp.ConsumeUnicodeNoSurrogates(\n        12)] = fdp.ConsumeUnicodeNoSurrogates(12)\n    tmp_dict[fdp.ConsumeUnicodeNoSurrogates(\n        12)] = fdp.ConsumeUnicodeNoSurrogates(12)\n    tmp_dict[fdp.ConsumeUnicodeNoSurrogates(\n        12)] = fdp.ConsumeUnicodeNoSurrogates(12)\n    tmp_dict[fdp.ConsumeUnicodeNoSurrogates(\n        12)] = fdp.ConsumeUnicodeNoSurrogates(12)\n    tmp_dict[fdp.ConsumeUnicodeNoSurrogates(\n        12)] = fdp.ConsumeUnicodeNoSurrogates(12)\n    tmp_dict[fdp.ConsumeUnicodeNoSurrogates(\n        12)] = fdp.ConsumeUnicodeNoSurrogates(12)\n    tmp_dict[fdp.ConsumeUnicodeNoSurrogates(\n        12)] = fdp.ConsumeUnicodeNoSurrogates(12)\n    list_of_dicts.append(tmp_dict)\n  glom.reduction.merge(list_of_dicts)\n\n\ndef TestOneInput(data):\n  test_flatten(data)\n  test_merge(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/glom/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/mahmoud/glom\nlanguage: python\nmain_repo: https://github.com/mahmoud/glom\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/glslang/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y python-is-python3 build-essential \\\n    autoconf automake libtool pkg-config\nRUN git clone https://github.com/khronosgroup/glslang glslang\nCOPY *_fuzzer.cc *.sh $SRC/\nWORKDIR $SRC/glslang\n"
  },
  {
    "path": "projects/glslang/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir -p build\ncd build\ncmake -DCMAKE_BUILD_TYPE=Release \\\n      -DGLSLANG_TESTS=ON \\\n      -DCMAKE_VERBOSE_MAKEFILE=ON \\\n      -DENABLE_OPT=0 ../\nmake V=1 -j$(nproc) install\n\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/compile_fuzzer.cc \\\n\t-DENABLE_HLSL -DENABLE_OPT=0 -DGLSLANG_OSINCLUDE_UNIX \\\n\t-I/src/glslang/glslang/Include/ -I/src/glslang/glslang/.. \\\n\t-I/src/glslang/build/include -I/src/glslang/SPIRV/.. \\\n\t./glslang/libglslang.a ./SPIRV/libSPIRV.a \\\n\t./glslang/libglslang-default-resource-limits.a \\\n\t-lpthread ./glslang/libMachineIndependent.a \\\n\t./glslang/OSDependent/Unix/libOSDependent.a \\\n\t./glslang/libGenericCodeGen.a \\\n\t-o $OUT/compile_fuzzer\n"
  },
  {
    "path": "projects/glslang/compile_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"glslang/Public/ResourceLimits.h\"\n#include \"glslang/Public/ShaderLang.h\"\n\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  glslang::InitializeProcess();\n  EShMessages controls;\n  glslang::TShader shader(EShLangVertex);\n\n  const char *dataPtr = (const char*)data;\n  const int dataSize = (const int)size;\n\n  shader.setStringsWithLengths(&dataPtr, &dataSize, 1);\n  shader.setEntryPoint(\"ep\");\n\n  // Parse the shader\n  shader.parse(GetDefaultResources(), 100, false, controls);\n\n  glslang::FinalizeProcess();\n  return 0;\n}\n"
  },
  {
    "path": "projects/glslang/project.yaml",
    "content": "homepage: \"https://github.com/khronosgroup/glslang\"\nmain_repo: \"https://github.com/khronosgroup/glslang\"\nlanguage: c++\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/glslang/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\ncd build\nmake test\n"
  },
  {
    "path": "projects/gluon/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/ProtonMail/gluon.git\nRUN go install github.com/AdamKorcz/go-118-fuzz-build@latest\nCOPY build.sh $SRC/\nWORKDIR $SRC/gluon\n"
  },
  {
    "path": "projects/gluon/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\ncompile_native_go_fuzzer github.com/ProtonMail/gluon/imap       FuzzNewParsedMessage    fuzz_new_parsed_message\ncompile_native_go_fuzzer github.com/ProtonMail/gluon/rfc5322    FuzzParseAddress        fuzz_parse_address\ncompile_native_go_fuzzer github.com/ProtonMail/gluon/rfc5322    FuzzRFC5322             fuzz_rfc5322\ncompile_native_go_fuzzer github.com/ProtonMail/gluon/rfc822     FuzzParseDec            fuzz_parse_dec\n"
  },
  {
    "path": "projects/gluon/project.yaml",
    "content": "homepage: \"https://proton.me\"\nlanguage: go\nprimary_contact: \"security@proton.me\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/ProtonMail/gluon\"\n"
  },
  {
    "path": "projects/gnucobol/project.yaml",
    "content": "homepage: \"https://www.gnu.org/software/gnucobol/\"\r\nlanguage: c\r\n\r\nprimary_contact: \"simonsobisch@gmail.com\"\r\nauto_ccs:\r\n  - \"simonsobisch@gnu.org\"\r\n\r\nsanitizers:\r\n  - address\r\n  - memory:\r\n     experimental: True\r\n  - undefined\r\n\r\narchitectures:\r\n - x86_64\r\n - i386\r\n\r\n# 'https://svn.code.sf.net/p/gnucobol/code/trunk' is the \"next big version\" (unstable),\r\n# code installed in OS package managers is found in 3.x branch\r\nmain_repo: 'https://svn.code.sf.net/p/gnucobol/code/branches/gnucobol-3.x'\r\n"
  },
  {
    "path": "projects/gnupg/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf libtool bzip2 bison flex gettext pkg-config\n\nRUN wget http://ftp.de.debian.org/debian/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\n   apt install -y ./automake_1.16.5-1.3_all.deb\n\nRUN git clone --depth 1 git://git.gnupg.org/libgpg-error.git libgpg-error\nRUN git clone --depth 1 git://git.gnupg.org/libgcrypt.git libgcrypt\nRUN git clone --depth 1 git://git.gnupg.org/libassuan.git libassuan\nRUN git clone --depth 1 git://git.gnupg.org/libksba.git libksba\nRUN git clone --depth 1 git://git.gnupg.org/npth.git npth\n\n# Build dependencies once in the Docker image\nRUN cd libgpg-error && ./autogen.sh && \\\n    ./configure --enable-static --disable-shared --disable-doc --disable-tests CFLAGS=\"-O0\" && \\\n    make -j$(nproc) && make install\n\nRUN cd libgcrypt && ./autogen.sh && \\\n    ./configure --enable-static --disable-shared --disable-doc --disable-tests --disable-asm CFLAGS=\"-O0\" && \\\n    make -j$(nproc) && make install\n\nRUN cd libassuan && ./autogen.sh && \\\n    ./configure --enable-static --disable-shared --disable-doc CFLAGS=\"-O0\" && \\\n    make -j$(nproc) && make install\n\nRUN cd libksba && ./autogen.sh && \\\n    ./configure --enable-static --disable-shared --disable-doc CFLAGS=\"-O0\" && \\\n    make -j$(nproc) && make install\n\nRUN cd npth && ./autogen.sh && \\\n    ./configure --enable-static --disable-shared CFLAGS=\"-O0\" && \\\n    make -j$(nproc) && make install\n\nRUN git clone --depth 1 git://git.gnupg.org/gnupg.git $SRC/gnupg\n\nWORKDIR $SRC/gnupg\nCOPY fuzz_* $SRC/\nCOPY fuzzer_stubs.c $SRC/\nCOPY build.sh $SRC/\n# This is to fix Fuzz Introspector build by using LLVM old pass manager\n# re https://github.com/ossf/fuzz-introspector/issues/305\nENV OLD_LLVMPASS 1\n\n"
  },
  {
    "path": "projects/gnupg/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Dependencies are already built in the Docker image\ncd /src/gnupg\n./autogen.sh  \n./configure --enable-maintainer-mode --disable-doc --disable-tests --disable-nls \\\n  --disable-sqlite --disable-gnutls --disable-ldap --disable-card-support \\\n  CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\"\n\n# Generate built sources first (status-codes.h, audit-events.h, etc.)\nmake -j$(nproc) -C common audit-events.h status-codes.h\nmake -j$(nproc) -C regexp _unicode_mapping.c\n# Build only needed components  \nmake -j$(nproc) -C common libcommon.a libcommonpth.a libgpgrl.a\nmake -j$(nproc) -C regexp libregexp.a\nmake -j$(nproc) -C kbx libkeybox.a\n# Build g10 - just build the gpg program which compiles all needed objects\nmake -j$(nproc) -C g10 gpg\n# Create a library archive from all the compiled objects, excluding gpg.o which has main()\nmkdir -p g10/.libs\nfind g10 -name '*.o' -type f ! -name 'gpg.o' ! -name 't-*.o' | xargs ar cru g10/.libs/libgpg.a\nranlib g10/.libs/libgpg.a\n\n# Build fuzzers\ncd /src/gnupg\n\n# Compile the fuzzer stubs that provide opt and glo_ctrl\n$CC $CFLAGS -I. -Icommon -Ig10 -c /src/fuzzer_stubs.c -o fuzzer_stubs.o\n\nfor fuzzer in fuzz_decrypt fuzz_import fuzz_list fuzz_verify; do\n  [ -f /src/${fuzzer}.c ] || continue\n  $CC $CFLAGS -I. -Icommon -Ig10 -c /src/${fuzzer}.c -o ${fuzzer}.o\n  $CXX $CXXFLAGS fuzzer_stubs.o ${fuzzer}.o \\\n    g10/.libs/libgpg.a \\\n    kbx/libkeybox.a \\\n    common/libcommonpth.a \\\n    regexp/libregexp.a \\\n    common/libgpgrl.a \\\n    $LIB_FUZZING_ENGINE \\\n    -lgcrypt -lgpg-error -lassuan -lksba -lnpth -lutil \\\n    -o $OUT/${fuzzer}\ndone\n\ncp /src/*.options $OUT/ 2>/dev/null || true\n\n"
  },
  {
    "path": "projects/gnupg/fuzz_decrypt.c",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdbool.h>\n#include <ftw.h>\n\n#include \"config.h\"\n#include \"gpg.h\"\n#include \"../common/types.h\"\n#include \"../common/iobuf.h\"\n#include \"keydb.h\"\n#include \"keyedit.h\"\n#include \"../common/util.h\"\n#include \"main.h\"\n#include \"trustdb.h\"\n\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <sys/mount.h>\n\nstatic bool initialized = false;\nctrl_t ctrlGlobal;\nint fd;\nchar *filename;\n\n//hack not to include gpg.c which has main function\nextern int g10_errors_seen;\nextern int assert_signer_true;\nextern int assert_pubkey_algo_false;\n\nvoid\ng10_exit( int rc )\n{\n    gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE);\n    gcry_control (GCRYCTL_TERM_SECMEM );\n    /* Don't exit in fuzzer - just return to allow fuzzing to continue */\n    (void)rc;\n    return;\n}\n\nstatic void\ngpg_deinit_default_ctrl (ctrl_t ctrl)\n{\n#ifdef USE_TOFU\n    tofu_closedbs (ctrl);\n#endif\n    gpg_dirmngr_deinit_session_data (ctrl);\n\n    keydb_release (ctrl->cached_getkey_kdb);\n}\n\nstatic void\nmy_gcry_logger (void *dummy, int level, const char *format, va_list arg_ptr)\n{\n    return;\n}\n\nstatic int unlink_cb(const char *fpath, const struct stat *sb, int typeflag)\n{\n    if (typeflag == FTW_F){\n        unlink(fpath);\n    }\n    return 0;\n}\n\nstatic void rmrfdir(char *path)\n{\n    ftw(path, unlink_cb, 16);\n    if (rmdir(path) != 0) {\n        printf(\"failed rmdir, errno=%d\\n\", errno);\n    }\n}\n\n// 65kb should be enough ;-)\n#define MAX_LEN 0x10000\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n\n    if (! initialized) {\n        ctrlGlobal = (ctrl_t) malloc(sizeof(*ctrlGlobal));\n        if (!ctrlGlobal) {\n            exit(1);\n        }\n        //deletes previous tmp dir and (re)create it as a ramfs\n        //system(\"umount /tmp/fuzzdirdecrypt\");\n        rmrfdir(\"/tmp/fuzzdirdecrypt\");\n        mkdir(\"/tmp/fuzzdirdecrypt\", 0700);\n        //system(\"mount -t tmpfs -o size=64M tmpfs /tmp/fuzzdirdecrypt\");\n        filename=strdup(\"/tmp/fuzzdirdecrypt/fuzz.gpg\");\n        if (!filename) {\n            free(ctrlGlobal);\n            return 0;\n        }\n        fd = open(\"/tmp/fuzzdirdecrypt/fuzz.gpg\", O_RDWR | O_CREAT, 0600);\n        if (fd == -1) {\n            free(ctrlGlobal);\n            free(filename);\n            return 0;\n        }\n        gnupg_set_homedir(\"/tmp/fuzzdirdecrypt/\");\n        if (keydb_add_resource (\"pubring\" EXTSEP_S GPGEXT_GPG,\n                                KEYDB_RESOURCE_FLAG_DEFAULT) != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            return 0;\n        }\n        if (setup_trustdb (1, NULL) != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            return 0;\n        }\n        //populate /tmp/fuzzdirdecrypt/ as homedir ~/.gnupg\n        strlist_t sl = NULL;\n        public_key_list (ctrlGlobal, sl, 0, 0);\n        free_strlist(sl);\n        //no output for stderr\n        log_set_file(\"/dev/null\");\n        gcry_set_log_handler (my_gcry_logger, NULL);\n        //gnupg_initialize_compliance (GNUPG_MODULE_NAME_GPG);\n        //overwrite output file\n        //opt.batch = 1;\n        //opt.answer_yes = 1;\n        initialized = true;\n    }\n\n    memset(ctrlGlobal, 0, sizeof(*ctrlGlobal));\n    ctrlGlobal->magic = SERVER_CONTROL_MAGIC;\n    if (Size > MAX_LEN) {\n        // limit maximum size to avoid long computing times\n        Size = MAX_LEN;\n    }\n\n    if (ftruncate(fd, Size) == -1) {\n        return 0;\n    }\n    if (lseek (fd, 0, SEEK_SET) < 0) {\n        return 0;\n    }\n    if (write (fd, Data, Size) != Size) {\n        return 0;\n    }\n\n    decrypt_messages(ctrlGlobal, 1, &filename);\n    gpg_deinit_default_ctrl (ctrlGlobal);\n    memset(ctrlGlobal, 0, sizeof(*ctrlGlobal));\n    ctrlGlobal->magic = SERVER_CONTROL_MAGIC;\n    decrypt_message(ctrlGlobal, filename, NULL);\n    gpg_deinit_default_ctrl (ctrlGlobal);\n\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/gnupg/fuzz_decrypt.options",
    "content": "[libfuzzer]\nclose_fd_mask = 1\n"
  },
  {
    "path": "projects/gnupg/fuzz_import.c",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdbool.h>\n#include <ftw.h>\n\n#include \"config.h\"\n#include \"gpg.h\"\n#include \"../common/types.h\"\n#include \"../common/iobuf.h\"\n#include \"keydb.h\"\n#include \"keyedit.h\"\n#include \"../common/util.h\"\n#include \"main.h\"\n#include \"options.h\"\n#include \"trustdb.h\"\n\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <sys/mount.h>\n\n// 8kb should be enough ;-)\n#define MAX_LEN 0x2000\n\nstatic bool initialized = false;\nctrl_t ctrlGlobal;\nint fd;\nchar *filename;\n\n//hack not to include gpg.c which has main function\nextern int g10_errors_seen;\nextern int assert_signer_true;\nextern int assert_pubkey_algo_false;\n\nvoid\ng10_exit( int rc )\n{\n    gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE);\n    gcry_control (GCRYCTL_TERM_SECMEM );\n    /* Don't exit in fuzzer - just return to allow fuzzing to continue */\n    (void)rc;\n    return;\n}\n\nstatic void\ngpg_deinit_default_ctrl (ctrl_t ctrl)\n{\n#ifdef USE_TOFU\n    tofu_closedbs (ctrl);\n#endif\n    gpg_dirmngr_deinit_session_data (ctrl);\n\n    keydb_release (ctrl->cached_getkey_kdb);\n}\n\nstatic void\nmy_gcry_logger (void *dummy, int level, const char *format, va_list arg_ptr)\n{\n    return;\n}\n\nstatic int unlink_cb(const char *fpath, const struct stat *sb, int typeflag)\n{\n    if (typeflag == FTW_F){\n        unlink(fpath);\n    }\n    return 0;\n}\n\nstatic void rmrfdir(char *path)\n{\n    ftw(path, unlink_cb, 16);\n    if (rmdir(path) != 0) {\n        printf(\"failed rmdir, errno=%d\\n\", errno);\n    }\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    if (! initialized) {\n        ctrlGlobal = (ctrl_t) malloc(sizeof(*ctrlGlobal));\n        if (!ctrlGlobal) {\n            exit(1);\n        }\n        //deletes previous tmp dir and (re)create it as a ramfs\n        //system(\"umount /tmp/fuzzdirimport\");\n        rmrfdir(\"/tmp/fuzzdirimport\");\n        if (mkdir(\"/tmp/fuzzdirimport\", 0700) < 0) {\n            printf(\"failed mkdir, errno=%d\\n\", errno);\n            if (errno != EEXIST) {\n                return 0;\n            }\n        }\n        //system(\"mount -t tmpfs -o size=64M tmpfs /tmp/fuzzdirimport\");\n        filename=strdup(\"/tmp/fuzzdirimport/fuzz.gpg\");\n        if (!filename) {\n            free(ctrlGlobal);\n            return 0;\n        }\n        fd = open(filename, O_RDWR | O_CREAT, 0666);\n        if (fd == -1) {\n            free(filename);\n            free(ctrlGlobal);\n            printf(\"failed open, errno=%d\\n\", errno);\n            return 0;\n        }\n        gnupg_set_homedir(\"/tmp/fuzzdirimport/\");\n        gpg_error_t gpgerr = keydb_add_resource (\"pubring\" EXTSEP_S GPGEXT_GPG, KEYDB_RESOURCE_FLAG_DEFAULT);\n        if (gpgerr != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            printf(\"failed keydb_add_resource, errno=%d\\n\", gpgerr);\n            return 0;\n        }\n        gpgerr = setup_trustdb (1, NULL);\n        if (gpgerr != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            printf(\"failed setup_trustdb, errno=%d\\n\", gpgerr);\n            return 0;\n        }\n        //populate /tmp/fuzzdirimport/ as homedir ~/.gnupg\n        strlist_t sl = NULL;\n        public_key_list (ctrlGlobal, sl, 0, 0);\n        free_strlist(sl);\n        //no output for stderr\n        log_set_file(\"/dev/null\");\n        gcry_set_log_handler (my_gcry_logger, NULL);\n        //gnupg_initialize_compliance (GNUPG_MODULE_NAME_GPG);\n        initialized = true;\n    }\n\n    memset(ctrlGlobal, 0, sizeof(*ctrlGlobal));\n    ctrlGlobal->magic = SERVER_CONTROL_MAGIC;\n    if (Size > MAX_LEN) {\n        // limit maximum size to avoid long computing times\n        Size = MAX_LEN;\n    }\n\n    if (ftruncate(fd, Size) == -1) {\n        return 0;\n    }\n    if (lseek (fd, 0, SEEK_SET) < 0) {\n        return 0;\n    }\n    if (write (fd, Data, Size) != Size) {\n        return 0;\n    }\n\n    import_keys (ctrlGlobal, &filename, 1, NULL, IMPORT_REPAIR_KEYS, 0, NULL);\n    gpg_deinit_default_ctrl (ctrlGlobal);\n    /*memset(ctrlGlobal, 0, sizeof(*ctrlGlobal));\n    ctrlGlobal->magic = SERVER_CONTROL_MAGIC;\n    PKT_public_key pk;\n    get_pubkey_fromfile (ctrlGlobal, &pk, filename);\n    release_public_key_parts (&pk);\n    gpg_deinit_default_ctrl (ctrlGlobal);*/\n\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/gnupg/fuzz_list.c",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdbool.h>\n#include <ftw.h>\n\n#include \"config.h\"\n#include \"gpg.h\"\n#include \"../common/types.h\"\n#include \"../common/iobuf.h\"\n#include \"keydb.h\"\n#include \"keyedit.h\"\n#include \"../common/util.h\"\n#include \"main.h\"\n#include \"trustdb.h\"\n\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <sys/mount.h>\n\nstatic bool initialized = false;\nctrl_t ctrlGlobal;\nint fd;\nchar *filename;\n\n//hack not to include gpg.c which has main function\nextern int g10_errors_seen;\nextern int assert_signer_true;\nextern int assert_pubkey_algo_false;\n\nvoid\ng10_exit( int rc )\n{\n    gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE);\n    gcry_control (GCRYCTL_TERM_SECMEM );\n    /* Don't exit in fuzzer - just return to allow fuzzing to continue */\n    (void)rc;\n    return;\n}\n\nstatic void\ngpg_deinit_default_ctrl (ctrl_t ctrl)\n{\n#ifdef USE_TOFU\n    tofu_closedbs (ctrl);\n#endif\n    gpg_dirmngr_deinit_session_data (ctrl);\n\n    keydb_release (ctrl->cached_getkey_kdb);\n}\n\nstatic void\nmy_gcry_logger (void *dummy, int level, const char *format, va_list arg_ptr)\n{\n    return;\n}\n\nstatic int unlink_cb(const char *fpath, const struct stat *sb, int typeflag)\n{\n    if (typeflag == FTW_F){\n        unlink(fpath);\n    }\n    return 0;\n}\n\nstatic void rmrfdir(char *path)\n{\n    ftw(path, unlink_cb, 16);\n    if (rmdir(path) != 0) {\n        printf(\"failed rmdir, errno=%d\\n\", errno);\n    }\n}\n\n// 65kb should be enough ;-)\n#define MAX_LEN 0x10000\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    IOBUF a;\n    armor_filter_context_t *afx = NULL;\n\n    if (! initialized) {\n        ctrlGlobal = (ctrl_t) malloc(sizeof(*ctrlGlobal));\n        if (!ctrlGlobal) {\n            exit(1);\n        }\n        //deletes previous tmp dir and (re)create it as a ramfs\n        //system(\"umount /tmp/fuzzdirlist\");\n        rmrfdir(\"/tmp/fuzzdirlist\");\n        if (mkdir(\"/tmp/fuzzdirlist\", 0700) < 0) {\n            printf(\"failed mkdir, errno=%d\\n\", errno);\n            if (errno != EEXIST) {\n                return 0;\n            }\n        }\n        //system(\"mount -t tmpfs -o size=64M tmpfs /tmp/fuzzdirlist\");\n        filename=strdup(\"/tmp/fuzzdirlist/fuzz.gpg\");\n        if (!filename) {\n            free(ctrlGlobal);\n            return 0;\n        }\n        fd = open(filename, O_RDWR | O_CREAT, 0666);\n        if (fd == -1) {\n            free(filename);\n            free(ctrlGlobal);\n            printf(\"failed open, errno=%d\\n\", errno);\n            return 0;\n        }\n        gnupg_set_homedir(\"/tmp/fuzzdirlist/\");\n        gpg_error_t gpgerr = keydb_add_resource (\"pubring\" EXTSEP_S GPGEXT_GPG, KEYDB_RESOURCE_FLAG_DEFAULT);\n        if (gpgerr != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            printf(\"failed keydb_add_resource, errno=%d\\n\", gpgerr);\n            return 0;\n        }\n        gpgerr = setup_trustdb (1, NULL);\n        if (gpgerr != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            printf(\"failed setup_trustdb, errno=%d\\n\", gpgerr);\n            return 0;\n        }\n        //populate /tmp/fuzzdirlist/ as homedir ~/.gnupg\n        strlist_t sl = NULL;\n        public_key_list (ctrlGlobal, sl, 0, 0);\n        free_strlist(sl);\n        //no output for stderr\n        log_set_file(\"/dev/null\");\n        gcry_set_log_handler (my_gcry_logger, NULL);\n        //gnupg_initialize_compliance (GNUPG_MODULE_NAME_GPG);\n        //opt.list_packets=1;\n        // Disable packet listing during fuzzing to avoid output flooding\n        //set_packet_list_mode(1);\n        initialized = true;\n    }\n\n    if (Size > MAX_LEN) {\n        // limit maximum size to avoid long computing times\n        return 0;\n    }\n\n    memset(ctrlGlobal, 0, sizeof(*ctrlGlobal));\n    ctrlGlobal->magic = SERVER_CONTROL_MAGIC;\n\n    if (ftruncate(fd, Size) == -1) {\n        return 0;\n    }\n    if (lseek (fd, 0, SEEK_SET) < 0) {\n        return 0;\n    }\n    if (write (fd, Data, Size) != Size) {\n        return 0;\n    }\n\n    a = iobuf_open(filename);\n    if( !a ) {\n        printf(\"failed iobuf_open\\n\");\n        return 0;\n    }\n    if( use_armor_filter( a ) ) {\n        afx = new_armor_context ();\n        push_armor_filter (afx, a);\n    }\n    proc_packets (ctrlGlobal, NULL, a );\n    iobuf_close(a);\n    release_armor_context (afx);\n    gpg_deinit_default_ctrl (ctrlGlobal);\n\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/gnupg/fuzz_list.options",
    "content": "[libfuzzer]\nclose_fd_mask = 1\n"
  },
  {
    "path": "projects/gnupg/fuzz_verify.c",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdbool.h>\n#include <ftw.h>\n\n#include \"config.h\"\n#include \"gpg.h\"\n#include \"../common/types.h\"\n#include \"../common/iobuf.h\"\n#include \"keydb.h\"\n#include \"keyedit.h\"\n#include \"../common/util.h\"\n#include \"main.h\"\n#include \"trustdb.h\"\n\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <sys/mount.h>\n\nstatic bool initialized = false;\nctrl_t ctrlGlobal;\nint fd;\nchar *filename;\n\n//hack not to include gpg.c which has main function\nextern int g10_errors_seen;\nextern int assert_signer_true;\nextern int assert_pubkey_algo_false;\n\nvoid\ng10_exit( int rc )\n{\n    gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE);\n    gcry_control (GCRYCTL_TERM_SECMEM );\n    /* Don't exit in fuzzer - just return to allow fuzzing to continue */\n    (void)rc;\n    return;\n}\n\nstatic void\ngpg_deinit_default_ctrl (ctrl_t ctrl)\n{\n#ifdef USE_TOFU\n    tofu_closedbs (ctrl);\n#endif\n    gpg_dirmngr_deinit_session_data (ctrl);\n\n    keydb_release (ctrl->cached_getkey_kdb);\n}\n\nstatic void\nmy_gcry_logger (void *dummy, int level, const char *format, va_list arg_ptr)\n{\n    return;\n}\n\nstatic int unlink_cb(const char *fpath, const struct stat *sb, int typeflag)\n{\n    if (typeflag == FTW_F){\n        unlink(fpath);\n    }\n    return 0;\n}\n\nstatic void rmrfdir(char *path)\n{\n    ftw(path, unlink_cb, 16);\n    if (rmdir(path) != 0) {\n        printf(\"failed rmdir, errno=%d\\n\", errno);\n    }\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n\n    if (! initialized) {\n        ctrlGlobal = (ctrl_t) malloc(sizeof(*ctrlGlobal));\n        if (!ctrlGlobal) {\n            exit(1);\n        }\n        //deletes previous tmp dir and (re)create it as a ramfs\n        //system(\"umount /tmp/fuzzdirverify\");\n        rmrfdir(\"/tmp/fuzzdirverify\");\n        mkdir(\"/tmp/fuzzdirverify/\", 0700);\n        //system(\"mount -t tmpfs -o size=64M tmpfs /tmp/fuzzdirverify\");\n        filename=strdup(\"/tmp/fuzzdirverify/fuzz.gpg\");\n        if (!filename) {\n            free(ctrlGlobal);\n            return 0;\n        }\n        fd = open(\"/tmp/fuzzdirverify/fuzz.gpg\", O_RDWR | O_CREAT, 0600);\n        if (fd == -1) {\n            free(ctrlGlobal);\n            free(filename);\n            return 0;\n        }\n        gnupg_set_homedir(\"/tmp/fuzzdirverify/\");\n        if (keydb_add_resource (\"pubring\" EXTSEP_S GPGEXT_GPG,\n                                KEYDB_RESOURCE_FLAG_DEFAULT) != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            return 0;\n        }\n        if (setup_trustdb (1, NULL) != GPG_ERR_NO_ERROR) {\n            free(filename);\n            free(ctrlGlobal);\n            close(fd);\n            return 0;\n        }\n        //populate /tmp/fuzzdirverify/ as homedir ~/.gnupg\n        strlist_t sl = NULL;\n        public_key_list (ctrlGlobal, sl, 0, 0);\n        free_strlist(sl);\n        //no output for stderr\n        log_set_file(\"/dev/null\");\n        gcry_set_log_handler (my_gcry_logger, NULL);\n        //gnupg_initialize_compliance (GNUPG_MODULE_NAME_GPG);\n        initialized = true;\n    }\n\n    memset(ctrlGlobal, 0, sizeof(*ctrlGlobal));\n    ctrlGlobal->magic = SERVER_CONTROL_MAGIC;\n\n    if (ftruncate(fd, Size) == -1) {\n        return 0;\n    }\n    if (lseek (fd, 0, SEEK_SET) < 0) {\n        return 0;\n    }\n    if (write (fd, Data, Size) != Size) {\n        return 0;\n    }\n\n    verify_signatures(ctrlGlobal, 1, &filename);\n    gpg_deinit_default_ctrl (ctrlGlobal);\n    memset(ctrlGlobal, 0, sizeof(*ctrlGlobal));\n    ctrlGlobal->magic = SERVER_CONTROL_MAGIC;\n    verify_files(ctrlGlobal, 1, &filename);\n    gpg_deinit_default_ctrl (ctrlGlobal);\n\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/gnupg/fuzzer_stubs.c",
    "content": "/* Copyright 2025 Google LLC.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/* Stub definitions for fuzzer linking */\n\n#define INCLUDED_BY_MAIN_MODULE 1\n#include \"config.h\"\n#include \"gpg.h\"\n#include \"main.h\"\n#include \"options.h\"\n\n/* These are needed but gpg.c is excluded */\nint g10_errors_seen = 0;\nint assert_signer_true = 0;\nint assert_pubkey_algo_false = 0;\n\n"
  },
  {
    "path": "projects/gnupg/fuzzgnupg.diff",
    "content": "diff --git a/configure.ac b/configure.ac\nindex fea504e..131595e 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -989,6 +989,18 @@ if test x\"$use_tofu\" = xyes ; then\n *** $tmp]])\n   fi\n fi\n+\n+# TODO choose when to build fuzzing with option ?\n+AC_CHECK_LIB(FuzzingEngine, main,\n+            [ LIB_FUZZING_ENGINE=\"$LIB_FUZZING_ENGINE\"\n+              have_fuzz=yes\n+            ])\n+AC_SUBST(LIB_FUZZING_ENGINE)\n+AC_CHECK_PROG(HAVE_CLANGXX, clang++, 1)\n+AM_CONDITIONAL(HAVE_LIB_FUZZING_ENGINE, [test \"$have_fuzz\" = yes -a \"$HAVE_CLANGXX\" = 1])\n+\n+\n+\n if test \"$have_sqlite\" != \"yes\"; then\n     build_keyboxd=no\n fi\n@@ -2151,6 +2163,7 @@ tests/migrations/Makefile\n tests/tpm2dtests/Makefile\n tests/gpgme/Makefile\n tests/pkits/Makefile\n+tests/fuzz/Makefile\n g10/gpg.w32-manifest\n tools/gpg-connect-agent.w32-manifest\n tools/gpgconf.w32-manifest\ndiff --git a/g10/Makefile.am b/g10/Makefile.am\nindex eb23573b7..785ac2b4b 100644\n--- a/g10/Makefile.am\n+++ b/g10/Makefile.am\n@@ -47,6 +47,7 @@ endif\n # NB: We use noinst_ for gpg and gpgv so that we can install them with\n # the install-hook target under the name gpg2/gpgv2.\n noinst_PROGRAMS = gpg\n+noinst_LIBRARIES = libgpg.a\n if !HAVE_W32CE_SYSTEM\n noinst_PROGRAMS += gpgv\n endif\n@@ -164,6 +165,9 @@ gpg_sources = server.c          \\\n gpg_SOURCES  = gpg.c \\\n \tkeyedit.c keyedit.h\t\\\n \t$(gpg_sources)\n+libgpg_a_SOURCES  = keyedit.c keyedit.h\t\\\n+\t$(gpg_sources)\n+\n \n gpgv_SOURCES = gpgv.c           \\\n \t      $(common_source)  \\\ndiff --git a/g10/armor.c b/g10/armor.c\nindex eb2d28bca..594f5bd2d 100644\n--- a/g10/armor.c\n+++ b/g10/armor.c\n@@ -313,7 +313,9 @@ static void\n invalid_armor(void)\n {\n     write_status(STATUS_BADARMOR);\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n     g10_exit(1); /* stop here */\n+#endif\n }\n \n \ndiff --git a/g10/call-dirmngr.h b/g10/call-dirmngr.h\nindex c0f1e0cec..52652a0e0 100644\n--- a/g10/call-dirmngr.h\n+++ b/g10/call-dirmngr.h\n@@ -19,6 +19,8 @@\n #ifndef GNUPG_G10_CALL_DIRMNGR_H\n #define GNUPG_G10_CALL_DIRMNGR_H\n \n+#include \"options.h\"\n+\n void gpg_dirmngr_deinit_session_data (ctrl_t ctrl);\n \n gpg_error_t gpg_dirmngr_ks_list (ctrl_t ctrl, char **r_keyserver);\ndiff --git a/g10/compress-bz2.c b/g10/compress-bz2.c\nindex 45aa40dfc..1a74a89d7 100644\n--- a/g10/compress-bz2.c\n+++ b/g10/compress-bz2.c\n@@ -155,8 +155,15 @@ do_uncompress( compress_filter_context_t *zfx, bz_stream *bzs,\n \t\t  (unsigned)bzs->avail_in, (unsigned)bzs->avail_out, zrc);\n       if( zrc == BZ_STREAM_END )\n \trc = -1; /* eof */\n-      else if( zrc != BZ_OK && zrc != BZ_PARAM_ERROR )\n-\tlog_fatal(\"bz2lib inflate problem: rc=%d\\n\", zrc );\n+      else if( zrc != BZ_OK && zrc != BZ_PARAM_ERROR ) {\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+            log_error(\"bz2lib inflate problem: rc=%d\\n\", zrc );\n+            rc = GPG_ERR_BAD_DATA;\n+            break;\n+#else\n+            log_fatal(\"bz2lib inflate problem: rc=%d\\n\", zrc );\n+#endif\n+        }\n       else if (zrc == BZ_OK && eofseen\n                && !bzs->avail_in && bzs->avail_out > 0)\n         {\ndiff --git a/g10/compress.c b/g10/compress.c\nindex e7a6f2b11..9a9ab5460 100644\n--- a/g10/compress.c\n+++ b/g10/compress.c\n@@ -204,10 +204,19 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,\n \tif( zrc == Z_STREAM_END )\n \t    rc = -1; /* eof */\n \telse if( zrc != Z_OK && zrc != Z_BUF_ERROR ) {\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+        rc = -1;\n+        zrc = Z_BUF_ERROR;\n+\t    if( zs->msg )\n+\t\tlog_error(\"zlib inflate problem: %s\\n\", zs->msg );\n+\t    else\n+\t\tlog_error(\"zlib inflate problem: rc=%d\\n\", zrc );\n+#else\n \t    if( zs->msg )\n \t\tlog_fatal(\"zlib inflate problem: %s\\n\", zs->msg );\n \t    else\n \t\tlog_fatal(\"zlib inflate problem: rc=%d\\n\", zrc );\n+#endif\n \t}\n     } while (zs->avail_out && zrc != Z_STREAM_END && zrc != Z_BUF_ERROR\n              && !leave);\ndiff --git a/g10/parse-packet.c b/g10/parse-packet.c\nindex bb05eabb7..638d895d0 100644\n--- a/g10/parse-packet.c\n+++ b/g10/parse-packet.c\n@@ -806,7 +806,12 @@ parse (parse_packet_ctx_t ctx, PACKET *pkt, int onlykeypkts, off_t * retpos,\n        * the uncompressing layer - in some error cases it just loops\n        * and spits out 0xff bytes. */\n       log_error (\"%s: garbled packet detected\\n\", iobuf_where (inp));\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+      rc = gpg_error (GPG_ERR_INV_PACKET);\n+      goto leave;\n+#else\n       g10_exit (2);\n+#endif\n     }\n \n   if (out && pkttype)\ndiff --git a/g10/plaintext.c b/g10/plaintext.c\nindex 3e169d93f..aa83ffbe0 100644\n--- a/g10/plaintext.c\n+++ b/g10/plaintext.c\n@@ -617,10 +617,16 @@ ask_for_detached_datafile (gcry_md_hd_t md, gcry_md_hd_t md2,\n \n   if (!fp)\n     {\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+        errno = ENOENT;\n+        rc = gpg_error_from_syserror ();\n+        goto leave;\n+#else\n       if (opt.verbose)\n \tlog_info (_(\"reading stdin ...\\n\"));\n       fp = iobuf_open (NULL);\n       log_assert (fp);\n+#endif\n     }\n   do_hash (md, md2, fp, textmode);\n   iobuf_close (fp);\ndiff --git a/g10/sig-check.c b/g10/sig-check.c\nindex 8dd18b2e2..9f5db89f9 100644\n--- a/g10/sig-check.c\n+++ b/g10/sig-check.c\n@@ -783,8 +783,9 @@ check_revocation_keys (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig)\n \t    {\n               gcry_md_hd_t md;\n \n-              if (gcry_md_open (&md, sig->digest_algo, 0))\n-                BUG ();\n+              rc = gcry_md_open (&md, sig->digest_algo, 0);\n+              if (rc)\n+                  return rc;\n               hash_public_key(md,pk);\n \t      /* Note: check_signature only checks that the signature\n \t\t is good.  It does not fail if the key is revoked.  */\ndiff --git a/tests/Makefile.am b/tests/Makefile.am\nindex f29b68a53..e788c9916 100644\n--- a/tests/Makefile.am\n+++ b/tests/Makefile.am\n@@ -24,7 +24,13 @@ else\n tpm2dtests =\n endif\n \n-SUBDIRS = gpgscm openpgp cms migrations gpgme pkits $(tpm2dtests) .\n+SUBDIRS = gpgscm openpgp cms migrations gpgme pkits $(tpm2dtests)\n+\n+if MAINTAINER_MODE\n+SUBDIRS += fuzz\n+endif\n+\n+SUBDIRS += .\n \n GPGSM = ../sm/gpgsm\n \ndiff --git a/tests/fuzz/Makefile.am b/tests/fuzz/Makefile.am\nnew file mode 100644\nindex 000000000..eb2216d3e\n--- /dev/null\n+++ b/tests/fuzz/Makefile.am\n@@ -0,0 +1,84 @@\n+# Makefile.am - For tests/fuzz\n+# Copyright (C) 2018 Free Software Foundation, Inc.\n+#\n+# This file is part of GnuPG.\n+#\n+# GnuPG is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# GnuPG is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, see <https://www.gnu.org/licenses/>.\n+# Process this file with automake to create Makefile.in\n+\n+\n+# Programs required before we can run these tests.\n+required_pgms = ../../g10/gpg$(EXEEXT)\n+\n+\n+# Force linking with clang++ even if we have pure C fuzzing targets\n+CCLD = clang++\n+AM_LDFLAGS = -stdlib=libc++\n+\n+AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/g10\n+include $(top_srcdir)/am/cmacros.am\n+\n+noinst_PROGRAMS = fuzz_verify fuzz_import fuzz_decrypt fuzz_list\n+\n+fuzz_verify_SOURCES = fuzz_verify.c\n+\n+fuzz_verify_LDADD = $(top_srcdir)/g10/libgpg.a ../../kbx/libkeybox.a ../../common/libcommon.a ../../common/libgpgrl.a  $(LIB_FUZZING_ENGINE) \\\n+         $(ZLIBS) $(LIBINTL) $(CAPLIBS) $(NETLIBS) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \\\n+             $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) \\\n+\t     $(LIBICONV) $(resource_objs) $(extra_sys_libs)\n+\n+fuzz_verify_DEPENDENCIES = fuzz_verify_seed_corpus.zip\n+\n+fuzz_verify_seed_corpus.zip:\n+\tcd .. && zip -r fuzz/fuzz_verify_seed_corpus.zip openpgp/tofu/conflicting/* openpgp/tofu/cross-sigs/* openpgp/samplemsgs/*\n+\n+fuzz_import_SOURCES = fuzz_import.c\n+\n+fuzz_import_LDADD =  $(top_srcdir)/g10/libgpg.a ../../kbx/libkeybox.a ../../common/libcommon.a ../../common/libgpgrl.a  $(LIB_FUZZING_ENGINE)\\\n+         $(ZLIBS) $(LIBINTL) $(CAPLIBS) $(NETLIBS) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \\\n+             $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) \\\n+\t     $(LIBICONV) $(resource_objs) $(extra_sys_libs)\n+\n+fuzz_import_DEPENDENCIES = fuzz_import_seed_corpus.zip\n+\n+fuzz_import_seed_corpus.zip:\n+\tcd .. && zip -r fuzz/fuzz_import_seed_corpus.zip openpgp/samplekeys/* openpgp/key-selection/* openpgp/*.asc openpgp/trust-pgp/*.asc openpgp/tofu/conflicting/* openpgp/tofu/cross-sigs/*\n+\n+fuzz_decrypt_SOURCES = fuzz_decrypt.c\n+\n+fuzz_decrypt_LDADD =  $(top_srcdir)/g10/libgpg.a ../../kbx/libkeybox.a ../../common/libcommon.a ../../common/libgpgrl.a  $(LIB_FUZZING_ENGINE)\\\n+         $(ZLIBS) $(LIBINTL) $(CAPLIBS) $(NETLIBS) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \\\n+             $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) \\\n+\t     $(LIBICONV) $(resource_objs) $(extra_sys_libs)\n+\n+fuzz_decrypt_DEPENDENCIES = fuzz_decrypt_seed_corpus.zip\n+\n+fuzz_decrypt_seed_corpus.zip:\n+\tcd .. && zip -r fuzz/fuzz_decrypt_seed_corpus.zip openpgp/tofu/conflicting/* openpgp/tofu/cross-sigs/* openpgp/samplemsgs/*\n+\n+fuzz_list_SOURCES = fuzz_list.c\n+\n+fuzz_list_LDADD =  $(top_srcdir)/g10/libgpg.a ../../kbx/libkeybox.a ../../common/libcommon.a ../../common/libgpgrl.a  $(LIB_FUZZING_ENGINE)\\\n+$(ZLIBS) $(LIBINTL) $(CAPLIBS) $(NETLIBS) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \\\n+$(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) \\\n+$(LIBICONV) $(resource_objs) $(extra_sys_libs)\n+\n+fuzz_list_DEPENDENCIES = fuzz_list_seed_corpus.zip\n+\n+fuzz_list_seed_corpus.zip:\n+\tcd .. && zip -r fuzz/fuzz_list_seed_corpus.zip openpgp/\n+\n+# We need to depend on a couple of programs so that the tests don't\n+# start before all programs are built.\n+all-local: $(required_pgms)\n"
  },
  {
    "path": "projects/gnupg/project.yaml",
    "content": "homepage: \"https://www.gnupg.org\"\nlanguage: c++\nprimary_contact: \"p.antoine@catenacyber.fr\"\nmain_repo: 'git://git.gnupg.org/gnupg.git'\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n"
  },
  {
    "path": "projects/gnutls/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n make \\\n pkg-config \\\n autoconf \\\n automake \\\n autogen \\\n autopoint \\\n libtool \\\n gperf \\\n bison \\\n texinfo \\\n curl \\\n gettext \\\n gengetopt \\\n wget \\\n python \\\n mercurial \\\n gtk-doc-tools \\\n libtasn1-bin \\\n lzip\n\nENV GNULIB_TOOL $SRC/gnulib/gnulib-tool\nRUN git clone --depth=500 git://git.savannah.gnu.org/gnulib.git\nRUN wget -qO- https://ftp.gnu.org/gnu/libunistring/libunistring-latest.tar.gz | tar xz && mv libunistring-* libunistring\nRUN wget -qO- https://ftp.gnu.org/gnu/libidn/libidn2-latest.tar.gz | tar xz && mv libidn2-* libidn2\nRUN wget -qO- https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.gz | tar xz && mv gmp-* gmp\nRUN wget -qO- https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.20.0.tar.gz | tar xz && mv libtasn1-* libtasn1\nRUN git clone --depth=1 https://git.lysator.liu.se/nettle/nettle.git --branch=nettle_3.10.1_release_20241230\n\n# Try twice in case of network issues.\nRUN git clone --depth=1 --recursive https://gitlab.com/gnutls/gnutls.git || git clone --depth=1 --recursive https://gitlab.com/gnutls/gnutls.git\n\nWORKDIR gnutls\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/gnutls/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport DEPS_PATH=$SRC/deps\nexport PKG_CONFIG_PATH=$DEPS_PATH/lib64/pkgconfig:$DEPS_PATH/lib/pkgconfig\nexport CPPFLAGS=\"-I$DEPS_PATH/include\"\nexport LDFLAGS=\"-L$DEPS_PATH/lib -L$DEPS_PATH/lib64\"\nexport GNULIB_SRCDIR=$SRC/gnulib\n\n# gnutls requires autoconf 2.71 minimum which is not available in the Ubuntu 20 base image\n# Skip this step if a newer base image is used\nif grep -q -F \"20.04\" /etc/os-release ; then\n    cd /tmp\n    wget https://archive.ubuntu.com/ubuntu/pool/main/a/autoconf/autoconf_2.71-2_all.deb\n    # Ensure file is not modified or corrupted before install\n    if echo \"96b528889794c4134015a63c75050f93d8aecdf5e3f2a20993c1433f4c61b80e autoconf_2.71-2_all.deb\" | sha256sum --check --status ; then\n    \t# Install but use G option to prevent downgrade in case this is\n    \tdpkg -i -G /tmp/autoconf_2.71-2_all.deb\n    fi\nfi\n\ncd \"$SRC\"/libunistring\nASAN_OPTIONS=detect_leaks=0 \\\n  ./configure --enable-static --disable-shared --prefix=\"$DEPS_PATH\"\nmake -j\"$(nproc)\"\nmake install\n\ncd \"$SRC\"/libidn2\nASAN_OPTIONS=detect_leaks=0 \\\n  ./configure --enable-static --disable-shared --disable-doc --disable-gcc-warnings --prefix=\"$DEPS_PATH\"\nmake -j\"$(nproc)\"\nmake install\n\n# always disable assembly in GMP to avoid issues due to SIGILL\n#   https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3119\n#   https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3159\nGMP_CONFIGURE_FLAGS=\"--disable-assembly --disable-fat\"\n\ncd \"$SRC\"/gmp\nASAN_OPTIONS=detect_leaks=0 \\\n  ./configure --disable-shared --prefix=\"$DEPS_PATH\" $GMP_CONFIGURE_FLAGS\nmake -j\"$(nproc)\"\nmake install\n\ncd $SRC/libtasn1\n./configure --disable-gcc-warnings --disable-gtk-doc --disable-gtk-doc-pdf --disable-doc \\\n  --disable-shared --enable-static --prefix=\"$DEPS_PATH\"\nmake -j\"$(nproc)\"\nmake install\n\nNETTLE_CONFIGURE_FLAGS=\"--disable-assembler\"  # Temporarily disalbe asm to work around error \"undefined reference to [...]\"\nif [[ $CFLAGS = *sanitize=memory* ]]; then\n  NETTLE_CONFIGURE_FLAGS=\"--disable-assembler --disable-fat\"\nfi\ncd \"$SRC\"/nettle\nbash .bootstrap\nASAN_OPTIONS=detect_leaks=0 \\\n  ./configure --enable-static --disable-shared --disable-documentation --prefix=\"$DEPS_PATH\" $NETTLE_CONFIGURE_FLAGS\n( make -j\"$(nproc)\" || make -j\"$(nproc)\" ) && make install\nif test $? != 0; then\n  echo \"Failed to compile nettle\"\n  exit 1\nfi\n\n\nGNUTLS_CONFIGURE_FLAGS=\"\"\nif [[ $CFLAGS = *sanitize=memory* ]]; then\n  GNUTLS_CONFIGURE_FLAGS=\"--disable-hardware-acceleration\"\nfi\ncd \"$SRC\"/gnutls\n./bootstrap\nASAN_OPTIONS=detect_leaks=0 LIBS=\"-lunistring\" CXXFLAGS=\"$CXXFLAGS -L$DEPS_PATH/lib\" \\\n  ./configure --enable-fuzzer-target --disable-gcc-warnings --enable-static --disable-shared --disable-doc --disable-tests \\\n    --disable-tools --disable-cxx --disable-maintainer-mode --disable-libdane --without-p11-kit \\\n    --disable-full-test-suite $GNUTLS_CONFIGURE_FLAGS\n\n# Do not use the syscall interface for randomness in oss-fuzz, it seems\n# to confuse memory sanitizer.\nsed -i 's|include <sys/syscall.h>|include <sys/syscall.h>\\n#undef SYS_getrandom|' lib/nettle/sysrng-linux.c\n\nmake -j\"$(nproc)\" -C gl\nmake -j\"$(nproc)\" -C lib\n\ncd fuzz\nmake oss-fuzz\nfind . -name '*_fuzzer' -exec cp -v '{}' \"$OUT\" ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' \"$OUT\" ';'\nfind . -name '*_fuzzer.options' -exec cp -v '{}' \"$OUT\" ';'\n\nfor dir in *_fuzzer.in; do\n    fuzzer=$(basename \"$dir\" .in)\n    zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n"
  },
  {
    "path": "projects/gnutls/project.yaml",
    "content": "homepage: \"https://www.gnutls.org\"\nlanguage: c++\nprimary_contact: \"daiki.ueno@gmail.com\"\nauto_ccs:\n  - \"rockdaboot@gmail.com\"\n  - \"nisse@lysator.liu.se\"\n  - \"anderjuaristi.cictg@gmail.com\"\n  - \"dbaryshkov@gmail.com\"\n  - \"zfridric@redhat.com\"\n\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://gitlab.com/gnutls/gnutls.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/go-attestation/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth 1 https://github.com/google/go-attestation\nRUN wget https://go.dev/dl/go1.24.6.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.6.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.24.6.linux-amd64.tar.gz\n\nWORKDIR go-attestation\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/go-attestation/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n\ncompile_go_fuzzer github.com/google/go-attestation/attest FuzzParseEventLog \\\n    parse_event_log_fuzzer\ncompile_go_fuzzer github.com/google/go-attestation/attest FuzzParseAKPublic \\\n    parse_ak_public_fuzzer\ncompile_go_fuzzer github.com/google/go-attestation/attest FuzzParseAKPublic \\\n    parse_ak_public_fuzzer\ncompile_go_fuzzer github.com/google/go-attestation/attest FuzzParseEKCertificate \\\n    parse_ek_certificate_fuzzer\n"
  },
  {
    "path": "projects/go-attestation/project.yaml",
    "content": "homepage: \"https://github.com/google/go-attestation\"\nprimary_contact: \"bweeks@google.com\"\nauto_ccs:\n  - \"ericchiang@google.com\"\n  - \"jsonp@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nlanguage: go\nmain_repo: 'https://github.com/google/go-attestation'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/go-cmp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/google/go-cmp\nWORKDIR go-cmp\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/go-cmp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./cmp/\ngo mod tidy\nprintf \"package cmp\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/google/go-cmp/cmp FuzzDiff FuzzDiff\n"
  },
  {
    "path": "projects/go-cmp/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage cmp\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzDiff(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data1, data2 []byte) {\n\t\t_ = Diff(data1, data2)\n\t})\n}\n"
  },
  {
    "path": "projects/go-cmp/project.yaml",
    "content": "homepage: \"https://github.com/google/go-cmp/cmp\"\nlanguage: go\nmain_repo: \"https://github.com/google/go-cmp/cmp\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-coap/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/plgd-dev/go-coap.git\nRUN go install github.com/AdamKorcz/go-118-fuzz-build@latest\nCOPY build.sh $SRC/\nWORKDIR $SRC/go-coap\n"
  },
  {
    "path": "projects/go-coap/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\ncompile_native_go_fuzzer $(pwd)/udp/coder       FuzzDecode          fuzz_decode_udp\ncompile_native_go_fuzzer $(pwd)/tcp/coder       FuzzDecode          fuzz_decode_tcp\ncompile_native_go_fuzzer $(pwd)/message         FuzzUnmarshalData   fuzz_unmarshal_data\ncompile_native_go_fuzzer $(pwd)/message/codes   FuzzUnmarshalJSON   fuzz_unmarshal_json\n"
  },
  {
    "path": "projects/go-coap/project.yaml",
    "content": "homepage: \"https://plgd.dev\"\nlanguage: go\nprimary_contact: \"daniel.adam@plgd.dev\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/plgd-dev/go-coap\"\n"
  },
  {
    "path": "projects/go-containerregistry/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/google/go-containerregistry\nWORKDIR $SRC/go-containerregistry\nCOPY build.sh fuzz.go $SRC/\n"
  },
  {
    "path": "projects/go-containerregistry/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncp $SRC/fuzz.go $SRC/go-containerregistry/pkg/name/\ncompile_go_fuzzer github.com/google/go-containerregistry/pkg/name FuzzParseReference fuzz_parse_reference\n"
  },
  {
    "path": "projects/go-containerregistry/fuzz.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//    http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage name\n\nfunc FuzzParseReference(data []byte) int {\n\t_, _ = ParseReference(string(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/go-containerregistry/project.yaml",
    "content": "homepage: \"https://github.com/google/go-containerregistry\"\nlanguage: go\nprimary_contact: \"jason@chainguard.dev\"\nmain_repo: \"https://github.com/google/go-containerregistry\"\nauto_ccs:\n  - \"go-containerregistry@chainguard.dev\"\nvendor_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-coredns/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nENV GO111MODULE=on\nRUN git clone --depth 1  https://github.com/coredns/coredns $GOPATH/src/github.com/coredns/coredns\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/go-coredns/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Same as usual except for added -tags gofuzz.\n\ncd $GOPATH/src/github.com/coredns/coredns\n\n#make\nls plugin/*/fuzz.go | while read target\ndo\n    fuzzed_plugin=`echo $target | cut -d'/' -f 2`\n    compile_go_fuzzer github.com/coredns/coredns/plugin/$fuzzed_plugin Fuzz fuzz_plugin_$fuzzed_plugin gofuzz\ndone\n\ncompile_go_fuzzer github.com/coredns/coredns/test Fuzz fuzz_core gofuzz\n"
  },
  {
    "path": "projects/go-coredns/project.yaml",
    "content": "homepage: \"https://coredns.io\"\nprimary_contact: \"security@coredns.io\"\nmain_repo: 'https://github.com/coredns/coredns.git'\nauto_ccs :\n- \"miek@miek.nl\"\n- \"p.antoine@catenacyber.fr\"\n- \"yong.tang.github@gmail.com\"\n- \"ville@vesilehto.fi\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/go-dhcp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/insomniacslk/dhcp.git\nRUN go install github.com/AdamKorcz/go-118-fuzz-build@latest\nCOPY build.sh $SRC/\nWORKDIR $SRC/dhcp\n"
  },
  {
    "path": "projects/go-dhcp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\ngo get github.com/stretchr/testify/assert@v1.6.1\nsed -i '58s/^/\\/\\//g' dhcpv6/dhcpv6_test.go\n\ncompile_native_go_fuzzer github.com/insomniacslk/dhcp/dhcpv4       FuzzDHCPv4    fuzz_DHCPv4\ncompile_native_go_fuzzer github.com/insomniacslk/dhcp/dhcpv6       FuzzDHCPv6    fuzz_DHCPv6\ncompile_native_go_fuzzer github.com/insomniacslk/dhcp/rfc1035label FuzzLabel     fuzz_Label\n"
  },
  {
    "path": "projects/go-dhcp/project.yaml",
    "content": "homepage: \"https://github.com/insomniacslk/dhcp\"\nlanguage: go\nprimary_contact: \"insomniac@slackware.it\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/insomniacslk/dhcp.git\"\n"
  },
  {
    "path": "projects/go-dns/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#FROM gcr.io/oss-fuzz-base/base-builder-go\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/miekg/dns.git\nRUN wget https://go.dev/dl/go1.24.6.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.6.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.24.6.linux-amd64.tar.gz\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/dns\n"
  },
  {
    "path": "projects/go-dns/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# Same as usual except for added -tags fuzz.\ncompile_go_fuzzer github.com/miekg/dns FuzzNewRR fuzz_newrr fuzz\ncompile_go_fuzzer github.com/miekg/dns Fuzz fuzz_msg_unpack fuzz\n"
  },
  {
    "path": "projects/go-dns/project.yaml",
    "content": "homepage: \"https://github.com/miekg/dns\"\nprimary_contact: \"miek@miek.nl\"\nauto_ccs:\n  - \"me+google@tomthorogood.co.uk\"\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/miekg/dns\"\n"
  },
  {
    "path": "projects/go-ethereum/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --single-branch --depth=1 https://github.com/ethereum/go-ethereum $GOPATH/src/github.com/ethereum/go-ethereum \nRUN (cd $GOPATH/src/github.com/ethereum/go-ethereum && go mod download)\n\nRUN cp $GOPATH/src/github.com/ethereum/go-ethereum/oss-fuzz.sh $SRC/build.sh\n# Enable this for easier local testing / repro\n#ADD build.sh $SRC/build.sh\n\nWORKDIR $SRC/\n\n"
  },
  {
    "path": "projects/go-ethereum/project.yaml",
    "content": "homepage: \"https://github.com/ethereum/go-ethereum\"\nprimary_contact: \"peter@ethereum.org\"\nauto_ccs :\n  - \"fjl@ethereum.org\"\n  - \"martin.swende@ethereum.org\"\n  - \"marius.vanderwijden@ethereum.org\"\n  - \"garyrong@ethereum.org\"\n  - \"zsfelfoldi@ethereum.org\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/ethereum/go-ethereum'\n"
  },
  {
    "path": "projects/go-git/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nENV GOPATH=\"${GOPATH:-/root/go}\"\nENV ORG_ROOT=\"${GOPATH}/src/github.com/go-git\"\n\nRUN mkdir -p \"${ORG_ROOT}\"\n\n# The fuzzed components are scattered around multiple repositories.\n# Here we clone all of them and cache their go dependencies.\n# The build process happens as build.sh iterate over each one of them.\nARG REPOSITORIES=\"go-git go-billy\"\nRUN for repo in ${REPOSITORIES}; do \\\n    git clone --depth 1 \"https://github.com/go-git/${repo}\" \"${ORG_ROOT}/${repo}\"; \\\n    cd \"${ORG_ROOT}/${repo}\"; \\\n    go mod download; \\\n    cd -; \\\n    done\n\n# Install go imports as the import section needs to reflect some of the changes\n# made by build.sh.\nRUN go install golang.org/x/tools/cmd/goimports@latest\n\nCOPY build.sh $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/go-git/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This code improves the use of Go Native by:\n# - Dynamically discovering and building all fuzz tests within the project root path.\n# - Supporting single (during PR checks) or multiple repositories (oss-fuzz).\n# - Enabling execution via CI builds and Makefile targets for each repo.\n\nGOPATH=\"${GOPATH:-/root/go}\"\nORG_ROOT=\"${ORG_ROOT:-${GOPATH}/src/github.com/go-git}\"\nPREBUILD_SCRIPT_PATH=\"${PREBUILD_SCRIPT_PATH:-tests/fuzz/oss_fuzz_prebuild.sh}\"\nPOSTBUILD_SCRIPT_PATH=\"${POSTBUILD_SCRIPT_PATH:-tests/fuzz/oss_fuzz_postbuild.sh}\"\n\n# source_prebuild_script sources the prebuild script, which executes project-specific\n# code and exposes environment variables that are needed during the generic build process.\n#\n# Examples of usage may be organising directory structure for embedding\n# files, downloading artifacts or setting environment variables.\nfunction source_prebuild_script(){\n\tif [ -f \"${PREBUILD_SCRIPT_PATH}\" ]; then\n\t\t# shellcheck source=/dev/null\n\t\t. \"${PREBUILD_SCRIPT_PATH}\"\n\tfi\n}\n\n# source_postbuild_script sources the postbuild script, which executes project-specific\n# code and unset environment variables that may break follow-up processes.\nfunction source_postbuild_script(){\n\tif [ -f \"${POSTBUILD_SCRIPT_PATH}\" ]; then\n\t\t# shellcheck source=/dev/null\n\t\t. \"${POSTBUILD_SCRIPT_PATH}\"\n\tfi\n}\n\n# go_native_build_all_fuzzers builds all Go Native fuzz tests defined in modules within\n# the given project dir.\n#\n# Args:\n# \tproject_dir\nfunction go_native_build_all_fuzzers(){\n\tlocal project_path=\"$1\"\n\n\tcd \"${project_path}\"\n\n\tsource_prebuild_script\n\n\tmodules=$(find . -mindepth 1 -maxdepth 4 -type f -name 'go.mod' | cut -c 3- | sed 's|/[^/]*$$||' | sort -u | sed 's;/go.mod;;g' | sed 's;go.mod;.;g')\n\tfor module in ${modules}; do\n\t\tcd \"${project_path}/${module}\"\n\n\t\tlocal test_files\n\t\ttest_files=$(grep -r --include='**_test.go' --files-with-matches 'func Fuzz' . || echo \"\")\n\t\tif [ -z \"${test_files}\" ]; then\n\t\t\tcontinue\n\t\tfi\n\n\t\t# go-118-fuzz-build is required for each module.\n\t\tgo get -u github.com/AdamKorcz/go-118-fuzz-build/testing\n\n\t\t# The go get command above can affect transient dependencies, may lead\n\t\t# to the go.sym to become out of sync, which would cause build to break.\n\t\t# go mod tidy will only work if the current module has a reference\n\t\t# to the above dependency, so we create one.\n\t\tlocal pkgName\n\t\tpkgName=\"$(grep -h '^package ' -- *.go | head -n 1)\"\n\t\tif [ -z \"${test_files}\" ]; then\n\t\t\tpkgName=\"package fuzz\"\n\t\tfi\n\t\t\n\t\tcat <<EOF > dep-placeholder.go\n${pkgName}\n\nimport _ \"github.com/AdamKorcz/go-118-fuzz-build/testing\"\nEOF\n\t\t# With the reference above, this updates go.sum.\n\t\tgo mod tidy\n\n\t\t# Iterate through all Go Fuzz targets, compiling each into a fuzzer.\n\t\tfor file in ${test_files}; do\n\t\t\t# If the subdir is a module, skip this file, as it will be handled\n\t\t\t# at the next iteration of the outer loop. \n\t\t\tif [ -f \"$(dirname \"${file}\")/go.mod\" ]; then\n\t\t\t\tcontinue\n\t\t\tfi\n\t\t\t\n\t\t\t# Remove all funcs that are not Fuzz tests. Some were resulting\n\t\t\t# in errors due to referring to other test files.\n\t\t\t#\n\t\t\t# Suite based tests funcs were also failing with the error:\n\t\t\t#   cannot use t (variable of type ...) as *\"testing\".T value in argument to suite.Run\n\t\t\t#\n\t\t\t# As those are not needed for fuzzing purposes they are removed.\n\t\t\tsed -i '/^func Fuzz/!{/^func /,/^}/d}' \"${file}\"\n\t\t\t# Remove global declarations and any comments.\n\t\t\tsed -i '/^\\(var\\|const\\)\\b/d; /^\\s*\\/\\//d; /^\\s*\\/\\*/,/\\*\\//d' \"${file}\"\n\t\t\t# Remove structs which may be referring to subtypes from other test files.\n\t\t\tsed -i '/^type .* struct {/,/^}/d' \"${file}\"\n\n\t\t\t# Ensure the file is still properly formatted.\n\t\t\tgo fmt \"${file}\"\n\t\t\tgoimports -w \"${file}\"\n\n\t\t\ttargets=$(grep -oP 'func \\K(Fuzz\\w*)' \"${file}\")\n\t\t\tfor target_name in ${targets}; do\n\t\t\t\tlocal module_name\n\t\t\t\tlocal fuzzer_name\n\t\t\t\tlocal target_dir\n\n\t\t\t\t# Transform module path into module name (e.g. git/libgit2 to git_libgit2).\n\t\t\t\tmodule_name=\"${module/\\//_}_\"\n\t\t\t\t# If module equal '._', use empty string instead.\n\t\t\t\tmodule_name=\"${module/#%._}\"\n\n\t\t\t\t# Compose fuzzer name based on the lowercase version of the func names.\n\t\t\t\tfuzzer_name=\"${target_name,,}\"\n\t\t\t\t# The module name is added after the fuzz prefix, for better discoverability.\n\t\t\t\tfuzzer_name=\"${target_name/fuzz_/fuzz_${module_name}}\"\n\t\t\t\ttarget_dir=$(dirname \"${file}\")\n\n\t\t\t\techo \"Building ${file}.${target_name} into ${fuzzer_name}\"\n\t\t\t\tcat \"${file}\"\n\t\t\t\tcompile_native_go_fuzzer \"${target_dir}\" \"${target_name}\" \"${fuzzer_name}\"\n\t\t\tdone\n\t\tdone\n\tdone\n}\n\nfunction loop_through_org_repositories(){\n\tlocal repos=\"\"\n\trepos=\"$(find \"${ORG_ROOT}\" -type d -mindepth 1 -maxdepth 1)\"\n\tfor repo in ${repos}; do\n\t\tgo_native_build_all_fuzzers \"${repo}\"\n\tdone\n}\n\nfunction main(){\n\tif grep -h '^module github.com/go-git/' \"${SRC}/go.mod\"; then\n\t\techo \"Building Go Native fuzzers for ${SRC}\"\n\t\tgo_native_build_all_fuzzers \"${SRC}\"\n\t\texit $?\n\tfi\n\t\n\techo \"Going through all repositories in ${ORG_ROOT}\"\n\tloop_through_org_repositories \n}\n\nmain\n"
  },
  {
    "path": "projects/go-git/project.yaml",
    "content": "homepage: \"https://github.com/go-git/go-git\"\nlanguage: go\nprimary_contact: \"go-git-security@googlegroups.com\"\nauto_ccs:\n  - \"paulo.gomes.uk@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/go-git/go-git\"\n"
  },
  {
    "path": "projects/go-humanize/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/dustin/go-humanize\nWORKDIR $SRC/go-humanize\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/go-humanize/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\nprintf \"package humanize\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\necho building\ncompile_native_go_fuzzer github.com/dustin/go-humanize FuzzParseBytes FuzzParseBytes\n"
  },
  {
    "path": "projects/go-humanize/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage humanize\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzParseBytes(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data string) {\n\t\t_, _ = ParseBytes(data)\n\t})\n}\n"
  },
  {
    "path": "projects/go-humanize/project.yaml",
    "content": "homepage: \"https://github.com/dustin/go-humanize\"\nlanguage: go\nmain_repo: \"https://github.com/dustin/go-humanize\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-json-iterator/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone https://github.com/json-iterator/go json-iterator\n\nCOPY fuzz_json.go $SRC/json-iterator/\nCOPY build.sh $SRC/\nWORKDIR $SRC/json-iterator/\n"
  },
  {
    "path": "projects/go-json-iterator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncompile_go_fuzzer github.com/json-iterator/go Fuzz fuzz_json\n"
  },
  {
    "path": "projects/go-json-iterator/fuzz_json.go",
    "content": "// Copyright 2015 go-fuzz project authors. All rights reserved.\n// Use of this source code is governed by Apache 2 LICENSE.\n// Modified from original file https://github.com/dvyukov/go-fuzz-corpus/blob/master/json/json.go\n\npackage jsoniter\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc Fuzz(data []byte) int {\n\tscore := 0\n\tfor _, ctor := range []func() interface{}{\n\t\t//func() interface{} { return nil },\n\t\tfunc() interface{} { return new([]interface{}) },\n\t\tfunc() interface{} { m := map[string]string{}; return &m },\n\t\tfunc() interface{} { m := map[string]interface{}{}; return &m },\n\t\tfunc() interface{} { return new(S) },\n\t} {\n\t\tv := ctor()\n\t\tif ConfigCompatibleWithStandardLibrary.Unmarshal(data, v) != nil {\n\t\t\tcontinue\n\t\t}\n\t\tscore = 1\n\t\tvj := ctor()\n\t\terr := json.Unmarshal(data, vj)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif !reflect.DeepEqual(v, vj) {\n\t\t\tfmt.Printf(\"v0: %#v\\n\", v)\n\t\t\tfmt.Printf(\"v1: %#v\\n\", vj)\n\t\t\tpanic(\"not equal\")\n\t\t}\n\n\t\tdata1, err := ConfigCompatibleWithStandardLibrary.Marshal(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tv1 := ctor()\n\t\tif ConfigCompatibleWithStandardLibrary.Unmarshal(data1, v1) != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(v, v1) {\n\t\t\tfmt.Printf(\"v0: %#v\\n\", v)\n\t\t\tfmt.Printf(\"v1: %#v\\n\", v1)\n\t\t\tpanic(\"not equal\")\n\t\t}\n\t}\n\treturn score\n}\n\ntype S struct {\n\tA int    `json:\",omitempty\"`\n\tB string `json:\"B1,omitempty\"`\n\tC float64\n\tD bool\n\tE uint8\n\tF []byte\n\tG interface{}\n\tH map[string]interface{}\n\tI map[string]string\n\tJ []interface{}\n\tK []string\n\tL S1\n\tM *S1\n\tN *int\n\tO **int\n\t//\tP json.RawMessage\n\tQ Marshaller\n\tR int `json:\"-\"`\n\tS int `json:\",string\"`\n}\n\ntype S1 struct {\n\tA int\n\tB string\n}\n\ntype Marshaller struct {\n\tv string\n}\n\nfunc (m *Marshaller) MarshalJSON() ([]byte, error) {\n\treturn ConfigCompatibleWithStandardLibrary.Marshal(m.v)\n}\n\nfunc (m *Marshaller) UnmarshalJSON(data []byte) error {\n\treturn ConfigCompatibleWithStandardLibrary.Unmarshal(data, &m.v)\n}\n"
  },
  {
    "path": "projects/go-json-iterator/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://jsoniter.com\"\nmain_repo: \"https://github.com/json-iterator/go\"\nprimary_contact: \"taowen@gmail.com\"\nauto_ccs:\n- \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/go-ldap/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/go-ldap/ldap.git\nRUN go install github.com/AdamKorcz/go-118-fuzz-build@latest\nCOPY build.sh $SRC/\nWORKDIR $SRC/ldap\n"
  },
  {
    "path": "projects/go-ldap/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\ncompile_native_go_fuzzer github.com/go-ldap/ldap    FuzzParseDN                 fuzz_parse_dn\ncompile_native_go_fuzzer github.com/go-ldap/ldap    FuzzDecodeEscapedSymbols    fuzz_decode_escaped_symbols\ncompile_native_go_fuzzer github.com/go-ldap/ldap    FuzzEscapeDN                fuzz_escape_dn\n"
  },
  {
    "path": "projects/go-ldap/project.yaml",
    "content": "homepage: \"https://github.com/go-ldap/ldap\"\nlanguage: go\nprimary_contact: \"cp@lumen.sh\"\nauto_ccs:\n  - \"johnweldon4@gmail.com\"\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/go-ldap/ldap\"\n"
  },
  {
    "path": "projects/go-ole/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/go-ole/go-ole\nWORKDIR $SRC/go-ole\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/go-ole/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\nprintf \"package ole\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/go-ole/go-ole FuzzGUID FuzzGUID\n"
  },
  {
    "path": "projects/go-ole/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage ole\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzGUID(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data string) {\n\t\tg := NewGUID(data)\n\t\t_ = g.String()\n\t})\n}\n\n"
  },
  {
    "path": "projects/go-ole/project.yaml",
    "content": "homepage: \"https://github.com/go-ole/go-ole\"\nlanguage: go\nmain_repo: \"https://github.com/go-ole/go-ole\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-pprof/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/google/pprof\nWORKDIR $SRC/pprof\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/go-pprof/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/fuzz_test.go $SRC/pprof/profile/\ncompile_native_go_fuzzer_v2 github.com/google/pprof/profile FuzzParseData FuzzParseData\n"
  },
  {
    "path": "projects/go-pprof/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage profile\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzParseData(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data []byte) {\n\t\tParseData(data)\n\t})\n}\n"
  },
  {
    "path": "projects/go-pprof/project.yaml",
    "content": "homepage: \"https://github.com/google/pprof\"\nlanguage: go\nmain_repo: \"https://github.com/google/pprof\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-readline/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/chzyer/readline\nWORKDIR readline\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/go-readline/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo mod tidy\nprintf \"package readline\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > ./register.go\ngo mod tidy\ncp $SRC/fuzz_test.go ./\ncompile_native_go_fuzzer github.com/chzyer/readline FuzzReadline FuzzReadline\n"
  },
  {
    "path": "projects/go-readline/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage readline\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzReadline(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, line string) {\n\t\trl, err := New(line)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tdefer rl.Close()\n\n\t\tfor {\n\t\t\t_, err := rl.Readline()\n\t\t\tif err != nil { // io.EOF\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "projects/go-readline/project.yaml",
    "content": "homepage: \"https://github.com/chzyer/readline\"\nlanguage: go\nmain_repo: \"https://github.com/chzyer/readline\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-redis/Dockerfile",
    "content": "# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/redis/go-redis redis\nCOPY build.sh $SRC/\nWORKDIR $SRC/redis\n\n"
  },
  {
    "path": "projects/go-redis/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\ncompile_go_fuzzer github.com/redis/go-redis/v9/fuzz Fuzz fuzz gofuzz\n"
  },
  {
    "path": "projects/go-redis/project.yaml",
    "content": "homepage: \"https://github.com/redis/go-redis\"\nmain_repo: \"https://github.com/redis/go-redis\"\nprimary_contact: \"vladimir.webdev@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-sftp/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/pkg/sftp\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/sftp\n"
  },
  {
    "path": "projects/go-sftp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer . Fuzz fuzz_sftp\n"
  },
  {
    "path": "projects/go-sftp/project.yaml",
    "content": "homepage: \"https://github.com/pkg/sftp\"\nprimary_contact: \"nicola.murino@gmail.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/pkg/sftp'\n"
  },
  {
    "path": "projects/go-shlex/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/google/shlex\nWORKDIR $SRC/shlex\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/go-shlex/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\ncompile_native_go_fuzzer_v2 github.com/google/shlex FuzzLexer FuzzLexer\n"
  },
  {
    "path": "projects/go-shlex/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage shlex\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"testing\"\n)\n\nfunc FuzzLexer(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data []byte) {\n\t\tl := NewLexer(bytes.NewReader(data))\n\t\tfor {\n\t\t\t_, err := l.Next()\n\t\t\tif err == io.EOF {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "projects/go-shlex/project.yaml",
    "content": "homepage: \"https://github.com/google/shlex\"\nlanguage: go\nmain_repo: \"https://github.com/google/shlex\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/go-snappy/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/golang/snappy\n\nCOPY build.sh $SRC/\nCOPY fuzz.go $SRC/snappy\nWORKDIR $SRC/snappy\n"
  },
  {
    "path": "projects/go-snappy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer . FuzzRoundTrip fuzz_roundtrip gofuzz\ncompile_go_fuzzer . FuzzDecode fuzz_decode gofuzz\n"
  },
  {
    "path": "projects/go-snappy/fuzz.go",
    "content": "// +build gofuzz\n\npackage snappy\n\nimport (\n\t\"bytes\"\n)\n\nfunc FuzzRoundTrip(data []byte) int {\n\tif len(data) > 1234567 {\n\t\treturn 0\n\t}\n\tencoded := Encode(nil, data)\n\tdecoded, err := Decode(nil, encoded)\n\tif err != nil {\n\t\tpanic(\"Error decoding snappy-encoded\")\n\t}\n\tif !bytes.Equal(data, decoded) {\n\t\tpanic(\"Different result on roundtrip encode/decode\")\n\t}\n\treturn 1\n}\n\nfunc FuzzDecode(data []byte) int {\n\tif n, _ := DecodedLen(data); n > 1234567 {\n\t\treturn 0\n\t}\n\t_, err := Decode(nil, data)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/go-snappy/project.yaml",
    "content": "homepage: \"https://github.com/golang/snappy\"\nprimary_contact: \"nigeltao@golang.org\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/golang/snappy'\ndisabled: true\n"
  },
  {
    "path": "projects/go-sqlite3/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 http://github.com/mattn/go-sqlite3 $GOPATH/src/github.com/mattn/go-sqlite3\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/go-sqlite3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $GOPATH/src/github.com/mattn/go-sqlite3\n\ncompile_go_fuzzer github.com/mattn/go-sqlite3/_example/fuzz FuzzOpenExec fuzz_open_exec\n\n# generate corpus\ngo run _example/simple/simple.go\necho -n -e \"select id, name from foo\\x00\" > simple.fuzc\ncat foo.db >> simple.fuzc\nzip -r $OUT/fuzz_open_exec_seed_corpus.zip simple.fuzc\n"
  },
  {
    "path": "projects/go-sqlite3/project.yaml",
    "content": "homepage: \"http://mattn.github.io/go-sqlite3/\"\nprimary_contact: \"mattn.jp@gmail.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/mattn/go-sqlite3/'\n"
  },
  {
    "path": "projects/go-toml/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 --single-branch --branch v2 https://github.com/pelletier/go-toml go-toml\nCOPY build.sh $SRC/\nWORKDIR $SRC/go-toml\n"
  },
  {
    "path": "projects/go-toml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir -p $OUT/benchmark\ncp benchmark/benchmark.toml $OUT/benchmark/benchmark.toml\ncompile_go_fuzzer github.com/pelletier/go-toml/v2/ossfuzz FuzzToml fuzz_toml gofuzz\n"
  },
  {
    "path": "projects/go-toml/project.yaml",
    "content": "homepage: \"https://github.com/pelletier/go-toml\"\nlanguage: go\nmain_repo: \"https://github.com/pelletier/go-toml\"\nprimary_contact: \"pelletier.thomas@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - maxnair.dev@gmail.com\nfile_github_issue: true\n"
  },
  {
    "path": "projects/go-yaml/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/go-yaml/yaml\nWORKDIR yaml\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/go-yaml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\nprintf \"package yaml\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer gopkg.in/yaml.v3 FuzzDecode FuzzDecode\n\n"
  },
  {
    "path": "projects/go-yaml/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage yaml\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\ntype FuzzType struct {\n\tfield1 string\n\tField2 string\n\tfield3 []byte\n\tField4 []byte\n}\n\nfunc FuzzDecode(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data []byte) {\n\t\td := NewDecoder(bytes.NewReader(data))\n\t\td.Decode(&FuzzType{})\n\t})\n}\n"
  },
  {
    "path": "projects/go-yaml/project.yaml",
    "content": "homepage: \"https://github.com/go-yaml/yaml\"\nlanguage: go\nmain_repo: \"https://github.com/go-yaml/yaml\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/gobgp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/osrg/gobgp.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/gobgp\n"
  },
  {
    "path": "projects/gobgp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\nsed -i '/func BenchmarkNormalizeFlowSpecOpValues(/,/^}/ s/^/\\/\\//' pkg/packet/bgp/bgp_test.go\n\ncompile_native_go_fuzzer $PWD/pkg/packet/rtr           FuzzParseRTR                fuzz_parse_rtr\ncompile_native_go_fuzzer $PWD/pkg/packet/bmp           FuzzParseBMPMessage         fuzz_parse_bmp_message\ncompile_native_go_fuzzer $PWD/pkg/packet/bgp           FuzzParseBGPMessage         fuzz_parse_bgp_message\ncompile_native_go_fuzzer $PWD/pkg/packet/bgp           FuzzParseLargeCommunity     fuzz_parse_large_community\ncompile_native_go_fuzzer $PWD/pkg/packet/bgp           FuzzParseFlowSpecComponents fuzz_parse_flow_spec_components\ncompile_native_go_fuzzer $PWD/pkg/packet/mrt           FuzzMRT                     fuzz_mrt\ncompile_native_go_fuzzer $PWD/pkg/zebra                FuzzZapi                    fuzz_zapi\n"
  },
  {
    "path": "projects/gobgp/project.yaml",
    "content": "homepage: \"https://osrg.github.io/gobgp\"\nlanguage: go\nprimary_contact: \"fujita.tomonori@gmail.com\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/osrg/gobgp\"\n"
  },
  {
    "path": "projects/gogo-protobuf/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/gogo/protobuf\nWORKDIR $SRC/protobuf\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/gogo-protobuf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir fuzzing\ncp $SRC/fuzz_test.go ./fuzzing/\ncd fuzzing\ngo mod tidy\nprintf \"package fuzzing\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\necho building\ncompile_native_go_fuzzer github.com/gogo/protobuf/fuzzing FuzzProtoUnmarshal FuzzProtoUnmarshal\n"
  },
  {
    "path": "projects/gogo-protobuf/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage fuzzing\n\nimport (\n\t\"testing\"\n\t\"github.com/gogo/protobuf/proto\"\n\ttpb \"github.com/gogo/protobuf/proto/proto3_proto\"\n)\n\nfunc FuzzProtoUnmarshal(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, raw []byte) {\n\t\tvar msgBlackhole = new(tpb.Message)\n\t\tproto.Unmarshal(raw, msgBlackhole)\n\t})\n}\n"
  },
  {
    "path": "projects/gogo-protobuf/project.yaml",
    "content": "homepage: \"https://github.com/gogo/protobuf\"\nlanguage: go\nmain_repo: \"https://github.com/gogo/protobuf\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/goipp/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth 1 https://github.com/OpenPrinting/goipp.git $SRC/goipp\nRUN git clone --depth 1 https://github.com/OpenPrinting/fuzzing.git $SRC/fuzzing\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/goipp\n"
  },
  {
    "path": "projects/goipp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nchmod +x $SRC/fuzzing/projects/goipp/oss_fuzz_build.sh\n$SRC/fuzzing/projects/goipp/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/goipp/project.yaml",
    "content": "homepage: \"https://github.com/OpenPrinting/goipp\"\nmain_repo: \"https://github.com/OpenPrinting/goipp\"\nprimary_contact: \"mdimad005@gmail.com\"\nauto_ccs:\n  - \"till.kamppeter@gmail.com\"\n  - \"ossfuzz@iosifache.me\"\n  - \"jiongchiyu@gmail.com\"\n  - \"pzz@apevzner.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address"
  },
  {
    "path": "projects/golang/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus golang\nRUN git clone --depth 1 https://github.com/golang/go\nRUN git clone --depth 1 https://github.com/golang/net\nRUN git clone --depth 1 https://github.com/golang/image\nRUN git clone --depth 1 https://github.com/golang/crypto\nRUN git clone --depth 1 https://github.com/golang/text\nRUN git clone --depth=1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=november-backup\nRUN wget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.3.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\nCOPY build.sh text_fuzzer.go \\\n     math_big_fuzzer.go \\\n     fuzz_tar_reader.go \\\n     fuzz_tar_reader.options \\\n     regexp_fuzzer.go \\\n     language_fuzzer.go \\\n     unicode_fuzzer.go \\\n     x509_fuzzer.go \\\n     ecdsa_fuzzer.go \\\n     dsa_fuzzer.go \\\n     aes_fuzzer.go \\\n     h2c_fuzzer.go \\\n     fuzz_x_h2c.options \\\n     elf_fuzzer.go \\\n     tiff_fuzzer.go \\\n     fuzz_tiff_decode.options \\\n     openpgp_fuzzer.go \\\n     webp_fuzzer.go \\\n     fuzz_webp_decode.options \\\n     filepath_fuzzer.go \\\n     strings_fuzzer.go \\\n     multipart_fuzzer.go \\\n     encoding_fuzzer.go \\\n     glob_fuzzer.options $SRC/\n\nWORKDIR $SRC/golang\n"
  },
  {
    "path": "projects/golang/aes_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage aes\n\nimport (\n\t\"crypto/aes\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc catchPanics() {\n\tif r := recover(); r != nil {\n\t\tvar err string\n\t\tswitch r.(type) {\n\t\tcase string:\n\t\t\terr = r.(string)\n\t\tcase runtime.Error:\n\t\t\terr = r.(runtime.Error).Error()\n\t\tcase error:\n\t\t\terr = r.(error).Error()\n\t\t}\n\t\tif strings.Contains(err, \"not full block\") {\n\t\t\treturn\n\t\t} else if strings.Contains(err, \"invalid buffer overlap\") {\n\t\t\treturn\n\t\t} else {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\nfunc FuzzAesCipherDecrypt(data []byte) int {\n\tif len(data) < 5 {\n\t\treturn 0\n\t}\n\tkeyIndex := int(data[0])\n\tlenIn := int(data[1])\n\tif lenIn < aes.BlockSize {\n\t\treturn 0\n\t}\n\tdata = data[2:]\n\n\tif (keyIndex + 5) > len(data) {\n\t\treturn 0\n\t}\n\tkey := data[:keyIndex]\n\tc, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tdst := make([]byte, lenIn)\n\tsrc := data[keyIndex+1:]\n\tdefer catchPanics()\n\tc.Decrypt(dst, src)\n\treturn 1\n}\n\nfunc FuzzAesCipherEncrypt(data []byte) int {\n\tif len(data) < 5 {\n\t\treturn 0\n\t}\n\tkeyIndex := int(data[0])\n\tlenIn := int(data[1])\n\tdata = data[2:]\n\n\tif (keyIndex + 5) > len(data) {\n\t\treturn 0\n\t}\n\tkey := data[:keyIndex]\n\tc, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tdst := make([]byte, lenIn)\n\tsrc := data[keyIndex+1:]\n\tdefer catchPanics()\n\tc.Encrypt(dst, src)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/build.sh",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Temporarily disable coverage build in OSS-Fuzz's CI\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n\tif [ \"${SANITIZER}\" = 'coverage' ]\n\tthen\n\t\texit 0\n\tfi\n\nfi\n\nexport GOTOOLCHAIN=\"local\"\n\nexport FUZZ_ROOT=\"github.com/dvyukov/go-fuzz-corpus\"\n\ncd $SRC/go-118-fuzz-build\ngo build .\nmv go-118-fuzz-build /root/go/bin/\n\ncd $SRC/text\ncp $SRC/unicode_fuzzer.go ./encoding/unicode/\nfind . -name \"*_test.go\" ! -name 'fuzz_test.go' -type f -exec rm -f {} +\ncompile_go_fuzzer golang.org/x/text/encoding/unicode FuzzUnicodeTransform fuzz_unicode_transform\n\nfunction setup_golang_fuzzers() {\n\tcd $SRC/golang\n\t# These two directories cause build issues and are not used by oss-fuzz.\n\t# They can be removed:\n\trm -r sqlparser\n\trm -r parser\n\n\tmkdir $SRC/golang/math && cp $SRC/math_big_fuzzer.go $SRC/golang/math/\n\n\tmkdir $SRC/golang/text && cp $SRC/text_fuzzer.go $SRC/golang/text/\n\tcp $SRC/language_fuzzer.go $SRC/golang/text/\n\n\tmkdir -p $SRC/golang/crypto/x509\n\tcp $SRC/x509_fuzzer.go $SRC/golang/crypto/x509/\n\n\tmkdir -p $SRC/golang/crypto/ecdsa\n\tcp $SRC/ecdsa_fuzzer.go ./crypto/ecdsa/\n\n\tmkdir -p $SRC/golang/crypto/dsa\n\tcp $SRC/dsa_fuzzer.go ./crypto/dsa/\n\n\tmkdir -p $SRC/golang/crypto/aes\n\tcp $SRC/aes_fuzzer.go ./crypto/aes/\n\n\tmkdir $SRC/golang/fp\n\tcp $SRC/filepath_fuzzer.go $SRC/golang/fp/\n\n\tcp $SRC/strings_fuzzer.go $SRC/golang/strings/\n\n\tcp $SRC/multipart_fuzzer.go $SRC/golang/multipart/main.go\n\n\tmkdir $SRC/golang/encoding && cp $SRC/encoding_fuzzer.go $SRC/golang/encoding/\n\n\tgo mod init \"github.com/dvyukov/go-fuzz-corpus\"\n\tmkdir fuzzingdep\n\tprintf \"package fuzzingdep\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > fuzzingdep/register.go\n\tgo mod edit -replace github.com/AdamKorcz/go-118-fuzz-build=\"$SRC\"/go-118-fuzz-build\n\tgo mod tidy\n}\n\nfunction compile_fuzzers() {\n\t# version is used as suffix for the binaries\n\tversion=$1\n\tcompile_go_fuzzer $FUZZ_ROOT/encoding FuzzEncoding fuzz_encoding$version\n\tcompile_go_fuzzer $FUZZ_ROOT/strings FuzzStringsSplit fuzz_strings_split$version\n\tcompile_go_fuzzer $FUZZ_ROOT/fp FuzzFpGlob glob_fuzzer$version\n\tif [ \"${version}\" != '_latest_master' ]\n        then\n\t\tcompile_go_fuzzer $FUZZ_ROOT/crypto/ecdsa FuzzEcdsaSign FuzzEcdsaSign$version\n\t\tcompile_native_go_fuzzer $FUZZ_ROOT/crypto/ecdsa FuzzEcdsaVerify FuzzEcdsaVerify$version\n\t\tcompile_native_go_fuzzer $FUZZ_ROOT/crypto/dsa FuzzDsaSign FuzzDsaSign$version\n\t\tcompile_native_go_fuzzer $FUZZ_ROOT/crypto/dsa FuzzDsaVerify FuzzDsaVerify$version\n        fi\n\tcompile_go_fuzzer $FUZZ_ROOT/crypto/x509 FuzzParseCert fuzz_parse_cert$version\n\tcompile_go_fuzzer $FUZZ_ROOT/crypto/x509 FuzzPemDecrypt fuzz_pem_decrypt$version\n\tcompile_go_fuzzer $FUZZ_ROOT/crypto/aes FuzzAesCipherDecrypt fuzz_aes_cipher_decrypt$version\n\tcompile_go_fuzzer $FUZZ_ROOT/crypto/aes FuzzAesCipherEncrypt fuzz_aes_cipher_encrypt$version\n\tcompile_go_fuzzer $FUZZ_ROOT/text FuzzAcceptLanguage accept_language_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/text FuzzMultipleParsers fuzz_multiple_parsers$version\n\tcompile_go_fuzzer $FUZZ_ROOT/text FuzzCurrency currency_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/math FuzzFloatSetString fuzz_float_set_string$version\n\tcompile_go_fuzzer $FUZZ_ROOT/math FuzzBigGobdecode fuzz_big_gobdecode$version\n\tcompile_go_fuzzer $FUZZ_ROOT/math FuzzBigIntCmp1 big_cmp_fuzzer1$version\n\tcompile_go_fuzzer $FUZZ_ROOT/math FuzzBigIntCmp2 big_cmp_fuzzer2$version\n\tcompile_go_fuzzer $FUZZ_ROOT/math FuzzRatSetString big_rat_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/math FuzzFloat64SpecialCases fuzz_float64_special_cases$version\n\tcompile_go_fuzzer $FUZZ_ROOT/asn1 Fuzz asn_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/csv Fuzz csv_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/elliptic Fuzz elliptic_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/flate Fuzz flate_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/fmt Fuzz fmt_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/gzip Fuzz gzip_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/httpreq Fuzz httpreq_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/jpeg Fuzz jpeg_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/json Fuzz json_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/lzw Fuzz lzw_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/mime Fuzz mime_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/multipart Fuzz multipart_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/png Fuzz png_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/tar Fuzz tar_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/time Fuzz time_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/xml Fuzz xml_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/zip Fuzz zip_fuzzer$version\n\tcompile_go_fuzzer $FUZZ_ROOT/zlib Fuzz zlib_fuzzer$version\n\n\tzip $OUT/fuzz_pem_decrypt${version}_seed_corpus.zip $SRC/go/src/crypto/x509/testdata/*\n\tzip $OUT/fuzz_parse_cert${version}_seed_corpus.zip $SRC/go/src/crypto/x509/testdata/*\n}\n\n\n# Build fuzzers with Go 1.18\nsetup_golang_fuzzers\ncompile_fuzzers \"\"\n\ncd $SRC/go/src/regexp\ncp $SRC/regexp_fuzzer.go ./\ngo mod init regexpPackage\ngo mod tidy\nfind . -name \"*_test.go\" ! -name 'fuzz_test.go' -type f -exec rm -f {} +\ncompile_go_fuzzer regexpPackage FuzzCompile fuzz_regexp_compile\ncompile_go_fuzzer regexpPackage FuzzCompilePOSIX fuzz_compile_posix\ncompile_go_fuzzer regexpPackage FuzzReplaceAll fuzz_replace_all\ncompile_go_fuzzer regexpPackage FuzzFindMatchApis fuzz_find_match_apis\n\n#cd $SRC/go/src/archive/tar\n#go mod init tarPackage\n#go mod tidy\n#find . -name \"*_test.go\" ! -name 'fuzz_test.go' -type f -exec rm -f {} +\n#go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes\n#go get github.com/AdamKorcz/go-118-fuzz-build/utils\n#compile_native_go_fuzzer tarPackage FuzzReader fuzz_std_lib_tar_reader\n#zip $OUT/fuzz_std_lib_tar_reader_seed_corpus.zip $SRC/go/src/archive/tar/testdata/*.tar\n\ncp $SRC/h2c_fuzzer.go $SRC/net/http2/h2c/\ncd $SRC/net/http2/h2c\ngo mod tidy\ncompile_go_fuzzer . FuzzH2c fuzz_x_h2c\nmv $SRC/fuzz_x_h2c.options $OUT/\n\ncp $SRC/openpgp_fuzzer.go $SRC/crypto/openpgp/packet\ncd $SRC/crypto/openpgp/packet\ngo mod tidy\ncompile_go_fuzzer . FuzzOpenpgpRead fuzz_openpgp_read\n\ncd $SRC/image/webp\ncp $SRC/webp_fuzzer.go ./\ncompile_go_fuzzer . FuzzWebpDecode fuzz_webp_decode\nzip $OUT/fuzz_webp_decode_seed_corpus.zip $SRC/image/testdata/*.webp\n\ncd $SRC/image/tiff\ncp $SRC/tiff_fuzzer.go ./\ncompile_go_fuzzer . FuzzTiffDecode fuzz_tiff_decode\ncp $SRC/fuzz_tiff_decode.options $OUT/\nzip $OUT/fuzz_tiff_decode_seed_corpus.zip $SRC/image/testdata/*.tiff\n\ncd $SRC/go/src/archive/tar\ncp $SRC/fuzz_tar_reader.go ./\nrm ./*_test.go\n\n#compile_go_fuzzer tarPackage FuzzTarReader fuzz_tar_reader\n#mv $SRC/fuzz_tar_reader.options $OUT/\n#zip $OUT/fuzz_tar_reader_seed_corpus.zip $SRC/go/src/archive/tar/testdata/*.tar\n\n#cd $SRC/go/src/archive/zip\n#go mod init zipPackage\n#go mod tidy\n#find . -name \"*_test.go\" ! -name 'fuzz_test.go' -type f -exec rm -f {} +\n#go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes\n#go get github.com/AdamKorcz/go-118-fuzz-build/utils\n#compile_native_go_fuzzer zipPackage FuzzReader fuzz_std_lib_zip_reader\n#zip $OUT/fuzz_std_lib_zip_reader_seed_corpus.zip $SRC/go/src/archive/zip/testdata/*.zip\n\ncd $SRC/go/src/internal/saferio\ngo mod init saferioPackage\ngo mod tidy\n\ncd $SRC/go/src/internal/zstd\ngo mod init zstdPackage\ngo mod tidy\n\ncd $SRC/go/src/image/png\ngo mod init pngPackage\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ngo mod edit -replace github.com/AdamKorcz/go-118-fuzz-build=\"$SRC\"/go-118-fuzz-build\ncompile_native_go_fuzzer pngPackage FuzzDecode fuzz_png_decode\nzip $OUT/fuzz_png_decode_seed_corpus.zip ./testdata/*.png\n\ncd $SRC/go/src/compress/gzip\ngo mod init gzipPackage\ngo mod tidy\nfind . -name \"*_test.go\" ! -name 'fuzz_test.go' -type f -exec rm -f {} +\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ngo mod edit -replace github.com/AdamKorcz/go-118-fuzz-build=\"$SRC\"/go-118-fuzz-build\ncompile_native_go_fuzzer gzipPackage FuzzReader fuzz_std_lib_gzip_reader\nzip $OUT/fuzz_std_lib_gzip_reader_seed_corpus.zip $SRC/go/src/compress/gzip/testdata/*\n\n# golangs build from source currently breaks.\n\ncd $SRC/go/src/html\ngo mod init htmlPackage\ngo mod tidy\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ngo mod edit -replace github.com/AdamKorcz/go-118-fuzz-build=\"$SRC\"/go-118-fuzz-build\ncompile_native_go_fuzzer htmlPackage FuzzEscapeUnescape fuzz_html_escape_unescape\n\n# Install latest Go from master branch and build fuzzers again\ncd $SRC\nrm -r go\nrm -r golang\ngit clone --depth 1 https://github.com/golang/go\ngit clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus $SRC/golang\ncd $SRC/go/src\n# delete failing test\nrm ./cmd/cgo/internal/testsanitizers/msan_test.go\n\n# These tests are currently broken so let's remove them\nrm ./cmd/go/internal/modfetch/codehost/git_test.go\nrm ./cmd/go/internal/vcweb/vcstest/vcstest_test.go\nGOMEMLIMIT=2048MiB ./all.bash\nls /src/go/bin\nexport GOROOT=\"/src/go\"\nexport PATH=/src/go/bin:$PATH\n\n# build fuzzers\nsetup_golang_fuzzers\ncompile_fuzzers \"_latest_master\"\n\n# options files\ncp $SRC/glob_fuzzer.options $OUT/\ncp $SRC/glob_fuzzer.options $OUT/glob_fuzzer_latest_master.options\n"
  },
  {
    "path": "projects/golang/dsa_fuzzer.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage dsa\n\nimport (\n\t\"bytes\"\n\t\"crypto/dsa\"\n\t\"math/big\"\n\t\"testing\"\n)\n\nfunc FuzzDsaVerify(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data1, data2, data3 []byte, s1, s2 string, s uint8) {\n\t\tbi1, ok := new(big.Int).SetString(s1, 16)\n\t\tbi2, ok2 := new(big.Int).SetString(s2, 16)\n\t\tif !ok || !ok2 {\n\t\t\treturn\n\t\t}\n\t\tvar priv dsa.PrivateKey\n\t\tparams := &priv.Parameters\n\t\tsizes := []dsa.ParameterSizes{\n\t\t\tdsa.L1024N160,\n\t\t\tdsa.L2048N224,\n\t\t\tdsa.L2048N256,\n\t\t\tdsa.L3072N256,\n\t\t}\n\t\terr := dsa.GenerateParameters(params, bytes.NewReader(data1), sizes[int(s)%len(sizes)])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = dsa.GenerateKey(&priv, bytes.NewReader(data2))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tdsa.Verify(&priv.PublicKey, data3, bi1, bi2)\n\t})\n}\n\nfunc FuzzDsaSign(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data1, data2, data3, data4 []byte, s uint8) {\n\t\tvar priv dsa.PrivateKey\n\t\tparams := &priv.Parameters\n\t\tsizes := []dsa.ParameterSizes{\n\t\t\tdsa.L1024N160,\n\t\t\tdsa.L2048N224,\n\t\t\tdsa.L2048N256,\n\t\t\tdsa.L3072N256,\n\t\t}\n\t\terr := dsa.GenerateParameters(params, bytes.NewReader(data1), sizes[int(s)%len(sizes)])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = dsa.GenerateKey(&priv, bytes.NewReader(data2))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tdsa.Sign(bytes.NewReader(data3), &priv, data4)\n\t})\n}\n"
  },
  {
    "path": "projects/golang/ecdsa_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage ecdsa\n\nimport (\n\t\"bytes\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"testing\"\n)\n\nfunc FuzzEcdsaSign(data []byte) int {\n\tif len(data) < 5 {\n\t\treturn 0\n\t}\n\tc := []elliptic.Curve{\n\t\telliptic.P256(),\n\t\telliptic.P224(),\n\t\telliptic.P384(),\n\t\telliptic.P521(),\n\t}\n\tcIndex := int(data[0] % 4)\n\tfirstRandReaderLen := int(data[1])\n\tdata = data[2:]\n\tif (firstRandReaderLen + 3) > len(data) {\n\t\treturn 0\n\t}\n\trandReader := bytes.NewReader(data[:firstRandReaderLen])\n\tpriv, err := ecdsa.GenerateKey(c[cIndex], randReader)\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_, _, _ = ecdsa.Sign(randReader, priv, data[firstRandReaderLen+1:])\n\treturn 1\n}\n\nfunc FuzzEcdsaVerify(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, rand1, rand2, sig []byte, cIndex uint8) {\n\n\t\tcs := []elliptic.Curve{\n\t\t\telliptic.P256(),\n\t\t\telliptic.P224(),\n\t\t\telliptic.P384(),\n\t\t\telliptic.P521(),\n\t\t}\n\t\tc := int(cIndex) % len(cs)\n\t\trandReader := bytes.NewReader(rand1)\n\t\tpriv, err := ecdsa.GenerateKey(cs[c], randReader)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tpub := priv.Public()\n\t\tecdsa.VerifyASN1(pub.(*ecdsa.PublicKey), rand2, sig)\n\t})\n}\n"
  },
  {
    "path": "projects/golang/elf_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage elf\n\nimport (\n\t\"os\"\n)\n\nfunc FuzzElfOpen(data []byte) int {\n\tdefer os.Remove(\"tmpFile\")\n\tf, err := os.Create(\"tmpFile\")\n\tif err != nil {\n\t\treturn 0\n\t}\n\tdefer f.Close()\n\t_, err = f.Write(data)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\t_, err = Open(\"tmpFile\")\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/encoding_fuzzer.go",
    "content": "package encoding\n\nimport (\n\t\"bytes\"\n\t\"encoding/base32\"\n\t\"encoding/base64\"\n\t\"encoding/gob\"\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc FuzzEncoding(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tdecType, err := f.GetInt()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tb1, err := f.GetBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tswitch decType % 5 {\n\tcase 0:\n\t\te, err := f.GetString()\n\t\tif err != nil || len(e) != 32 {\n\t\t\treturn 0\n\t\t}\n\t\tenc := base32.NewEncoding(e)\n\t\td := base32.NewDecoder(enc, bytes.NewReader(b1))\n\t\tdbuf := make([]byte, enc.DecodedLen(len(e)))\n\t\t_, _ = d.Read(dbuf)\n\tcase 1:\n\t\te, err := f.GetString()\n\t\tif err != nil || len(e) != 64 {\n\t\t\treturn 0\n\t\t}\n\t\tfor i := 0; i < len(e); i++ {\n\t\t\tif e[i] == '\\n' || e[i] == '\\r' {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t\tenc := base64.NewEncoding(e)\n\t\td := base64.NewDecoder(enc, bytes.NewReader(b1))\n\t\tdbuf := make([]byte, enc.DecodedLen(len(e)))\n\t\t_, _ = d.Read(dbuf)\n\tcase 2:\n\t\tb2, err := f.GetBytes()\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\td := gob.NewDecoder(bytes.NewReader(b1))\n\t\t_ = d.Decode(b2)\n\tcase 3:\n\t\tb2, err := f.GetBytes()\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\td := json.NewDecoder(bytes.NewReader(b1))\n\t\t_ = d.Decode(b2)\n\tcase 4:\n\t\td := xml.NewDecoder(bytes.NewReader(b1))\n\t\t_, _ = d.Token()\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/filepath_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage fp\n\nimport (\n\t\"path/filepath\"\n)\n\nfunc FuzzFpGlob(data []byte) int {\n\t_, _ = filepath.Glob(string(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/fuzz_tar_reader.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage tar\n\nimport (\n\t\"bytes\"\n\t\"io\"\n)\n\nfunc FuzzTarReader(data []byte) int {\n\tr := bytes.NewReader(data)\n\ttarReader := NewReader(r)\n\tfor {\n\t\t_, err := tarReader.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/fuzz_tar_reader.options",
    "content": "[libfuzzer]\nmax_len = 1500000\nlen_control = 0\n"
  },
  {
    "path": "projects/golang/fuzz_tiff_decode.options",
    "content": "[libfuzzer]\nmax_len = 1500000\nlen_control = 0\nrss_limit_mb=6000\n"
  },
  {
    "path": "projects/golang/fuzz_webp_decode.options",
    "content": "[libfuzzer]\ntimeout = 120\n"
  },
  {
    "path": "projects/golang/fuzz_x_h2c.options",
    "content": "[libfuzzer]\nmax_len = 1600000\nlen_control = 0"
  },
  {
    "path": "projects/golang/glob_fuzzer.options",
    "content": "[libfuzzer]\nmax_len = 1500000\nlen_control = 0\n"
  },
  {
    "path": "projects/golang/h2c_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage h2c\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"golang.org/x/net/http2\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/textproto\"\n\t\"net/url\"\n\t\"runtime\"\n\t\"strings\"\n)\n\ntype FakeHttpWriter struct {\n\tHeaderStatus int\n\tPayload      []byte\n}\n\nfunc (f *FakeHttpWriter) Header() http.Header {\n\treturn http.Header{}\n}\n\nfunc (f *FakeHttpWriter) Write(body []byte) (int, error) {\n\tf.Payload = body\n\treturn len(body), nil\n}\n\nfunc (f *FakeHttpWriter) WriteHeader(status int) {\n\tf.HeaderStatus = status\n}\n\nfunc (f *FakeHttpWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {\n\tr1 := bytes.NewReader([]byte{})\n\tr2 := bufio.NewReader(r1)\n\tw := bufio.NewWriter(ioutil.Discard)\n\trw := bufio.NewReadWriter(r2, w)\n\treturn nil, rw, nil\n}\n\n// We ignore these panics, as they don't represent real bugs.\nfunc catchPanics() {\n\tif r := recover(); r != nil {\n\t\tvar err string\n\t\tswitch r.(type) {\n\t\tcase string:\n\t\t\terr = r.(string)\n\t\tcase runtime.Error:\n\t\t\terr = r.(runtime.Error).Error()\n\t\tcase error:\n\t\t\terr = r.(error).Error()\n\t\t}\n\t\t// Very hacky for now, but it rids us of a lot of instantiation\n\t\tif strings.Contains(err, \"invalid memory address or nil pointer dereference\") {\n\t\t\treturn\n\t\t} else {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\nfunc FuzzH2c(data []byte) int {\n\tif len(data) < 10 {\n\t\treturn 0\n\t}\n\theaderMap := make(map[string][]string)\n\theaderMap[textproto.CanonicalMIMEHeaderKey(\"Upgrade\")] = []string{\"h2c\"}\n\theaderMap[textproto.CanonicalMIMEHeaderKey(\"Connection\")] = []string{\"HTTP2-Settings\"}\n\theaderMap[textproto.CanonicalMIMEHeaderKey(\"HTTP2-Settings\")] = []string{\"\"}\n\thandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprint(w, \"Hello world\")\n\t})\n\th2s := &http2.Server{\n\t\t// ...\n\t}\n\th := NewHandler(handler, h2s)\n\tw := &FakeHttpWriter{}\n\tr, err := http.NewRequestWithContext(context.Background(), \"PUT\", \"nil\", bytes.NewReader(data))\n\tif err != nil {\n\t\treturn -1\n\t}\n\tr.Header = headerMap\n\tu, err := url.Parse(\"http://localhost:8001\")\n\tif err != nil {\n\t\treturn 0\n\t}\n\tr.URL = u\n\tdefer catchPanics()\n\th.ServeHTTP(w, r)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/language_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage fuzztext\n\nimport (\n\t\"golang.org/x/text/currency\"\n\t\"golang.org/x/text/language\"\n\t\"golang.org/x/text/unicode/cldr\"\n)\n\nfunc FuzzMultipleParsers(data []byte) int {\n\tif len(data) < 2 {\n\t\treturn 0\n\t}\n\tparser_type := int(data[0])\n\tdata = data[1:]\n\n\tswitch parser_type % 7 {\n\tcase 0:\n\t\t_, _ = language.ParseExtension(string(data))\n\tcase 1:\n\t\t_, _ = language.ParseBase(string(data))\n\tcase 2:\n\t\t_, _ = language.ParseScript(string(data))\n\tcase 3:\n\t\t_, _ = language.ParseRegion(string(data))\n\tcase 4:\n\t\t_, _ = language.ParseVariant(string(data))\n\tcase 5:\n\t\t_, _ = cldr.ParseDraft(string(data))\n\tcase 6:\n\t\t_, _ = currency.ParseISO(string(data))\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/math_big_fuzzer.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage mathfuzzer\n\nimport (\n\t\"fmt\"\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n\t\"math\"\n\t\"math/big\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc FuzzBigIntCmp1(data []byte) int {\n\tif !isDivisibleBy(len(data), 2) {\n\t\treturn -1\n\t}\n\ti1 := new(big.Int)\n\ti2 := new(big.Int)\n\n\thalf := len(data) / 2\n\n\thalfOne := data[:half]\n\thalfTwo := data[half:]\n\n\ti1.SetBytes(halfOne)\n\ti2.SetBytes(halfTwo)\n\n\ti1.Cmp(i2)\n\treturn 1\n}\n\nfunc FuzzBigIntCmp2(data []byte) int {\n\tif !isDivisibleBy(len(data), 2) {\n\t\treturn -1\n\t}\n\tx, y := new(big.Int), new(big.Int)\n\thalf := len(data) / 2\n\tif err := x.UnmarshalText(data[:half]); err != nil {\n\t\treturn 0\n\t}\n\tif err := y.UnmarshalText(data[half:]); err != nil {\n\t\treturn 0\n\t}\n\tx.Cmp(y)\n\treturn 1\n}\n\nfunc FuzzRatSetString(data []byte) int {\n\t_, _ = new(big.Rat).SetString(string(data))\n\treturn 1\n}\n\nfunc FuzzFloatSetString(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tf64, err := f.GetFloat64()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tif math.IsNaN(f64) {\n\t\treturn 0\n\t}\n\ts, err := f.GetString()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tfl := big.NewFloat(f64)\n\tfl.SetString(s)\n\treturn 1\n}\n\nfunc FuzzBigGobdecode(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tbuf, err := f.GetBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\ttarget, err := f.GetInt()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tswitch target % 2 {\n\tcase 0:\n\t\ti, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\tbi := big.NewInt(int64(i))\n\t\tbi.GobDecode(buf)\n\tcase 1:\n\t\ti1, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\ti2, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\tif int64(i2) == 0 {\n\t\t\treturn 0\n\t\t}\n\t\tr := big.NewRat(int64(i1), int64(i2))\n\t\tr.GobDecode(buf)\n\t}\n\treturn 1\n}\n\nfunc isDivisibleBy(n int, divisibleby int) bool {\n\treturn (n % divisibleby) == 0\n}\n\nfunc FuzzFloat64SpecialCases(data []byte) int {\n\tinput := string(data)\n\tif strings.HasPrefix(input, \"long:\") {\n\t\tinput = input[len(\"long:\"):]\n\t}\n\n\tr, ok := new(big.Rat).SetString(input)\n\tif !ok {\n\t\treturn 0\n\t}\n\tf, exact := r.Float64()\n\n\t// 1. Check string -> Rat -> float64 conversions are\n\t// consistent with strconv.ParseFloat.\n\t// Skip this check if the input uses \"a/b\" rational syntax.\n\tif !strings.Contains(input, \"/\") {\n\t\te, _ := strconv.ParseFloat(input, 64)\n\n\t\t// Careful: negative Rats too small for\n\t\t// float64 become -0, but Rat obviously cannot\n\t\t// preserve the sign from SetString(\"-0\").\n\t\tswitch {\n\t\tcase math.Float64bits(e) == math.Float64bits(f):\n\t\t\t// Ok: bitwise equal.\n\t\tcase f == 0 && r.Num().BitLen() == 0:\n\t\t\t// Ok: Rat(0) is equivalent to both +/- float64(0).\n\t\tdefault:\n\t\t\treturn 0\n\t\t\tpanic(fmt.Sprintf(\"strconv.ParseFloat(%q) = %g (%b), want %g (%b); delta = %g\\n\", input, e, e, f, f, f-e))\n\t\t}\n\t}\n\n\tif !isFiniteFuzz(f) {\n\t\treturn 0\n\t}\n\n\t// 2. Check f is best approximation to r.\n\tif !checkIsBestApprox64Fuzz(f, r) {\n\t\t// Append context information.\n\t\tpanic(fmt.Sprintf(\"(input was %q\\n)\", input))\n\t}\n\n\t// 3. Check f->R->f roundtrip is non-lossy.\n\tcheckNonLossyRoundtrip64Fuzz(f)\n\n\t// 4. Check exactness using slow algorithm.\n\tif wasExact := new(big.Rat).SetFloat64(f).Cmp(r) == 0; wasExact != exact {\n\t\tfmt.Println(input)\n\t\tpanic(fmt.Sprintf(\"Rat.SetString(%q).Float64().exact = %t, want %t\\n\", input, exact, wasExact))\n\t}\n\treturn 1\n}\n\nfunc checkNonLossyRoundtrip64Fuzz(f float64) {\n\tif !isFiniteFuzz(f) {\n\t\treturn\n\t}\n\tr := new(big.Rat).SetFloat64(f)\n\tif r == nil {\n\t\tpanic(fmt.Sprintf(\"Rat.SetFloat64(%g (%b)) == nil\\n\", f, f))\n\t}\n\tf2, exact := r.Float64()\n\tif f != f2 || !exact {\n\t\tpanic(fmt.Sprintf(\"Rat.SetFloat64(%g).Float64() = %g (%b), %v, want %g (%b), %v; delta = %b\\n\",\n\t\t\tf, f2, f2, exact, f, f, true, f2-f))\n\t}\n}\n\nfunc isFiniteFuzz(f float64) bool {\n\treturn math.Abs(f) <= math.MaxFloat64\n}\n\nfunc checkIsBestApprox64Fuzz(f float64, r *big.Rat) bool {\n\tif math.Abs(f) >= math.MaxFloat64 {\n\t\t// Cannot check +Inf, -Inf, nor the float next to them (MaxFloat64).\n\t\t// But we have tests for these special cases.\n\t\treturn true\n\t}\n\n\t// r must be strictly between f0 and f1, the floats bracketing f.\n\tf0 := math.Nextafter(f, math.Inf(-1))\n\tf1 := math.Nextafter(f, math.Inf(+1))\n\n\t// For f to be correct, r must be closer to f than to f0 or f1.\n\tdf := deltaFuzz(r, f)\n\tdf0 := deltaFuzz(r, f0)\n\tdf1 := deltaFuzz(r, f1)\n\tif df.Cmp(df0) > 0 {\n\t\tpanic(fmt.Sprintf(\"Rat(%v).Float64() = %g (%b), but previous float64 %g (%b) is closer\", r, f, f, f0, f0))\n\t}\n\tif df.Cmp(df1) > 0 {\n\t\tpanic(fmt.Sprintf(\"Rat(%v).Float64() = %g (%b), but next float64 %g (%b) is closer\", r, f, f, f1, f1))\n\t}\n\tif df.Cmp(df0) == 0 && !isEven64Fuzz(f) {\n\t\tpanic(fmt.Sprintf(\"Rat(%v).Float64() = %g (%b); halfway should have rounded to %g (%b) instead\", r, f, f, f0, f0))\n\t}\n\tif df.Cmp(df1) == 0 && !isEven64Fuzz(f) {\n\t\tpanic(fmt.Sprintf(\"Rat(%v).Float64() = %g (%b); halfway should have rounded to %g (%b) instead\", r, f, f, f1, f1))\n\t}\n\treturn true\n}\n\nfunc deltaFuzz(r *big.Rat, f float64) *big.Rat {\n\td := new(big.Rat).Sub(r, new(big.Rat).SetFloat64(f))\n\treturn d.Abs(d)\n}\n\nfunc isEven64Fuzz(f float64) bool { return math.Float64bits(f)&1 == 0 }\n"
  },
  {
    "path": "projects/golang/multipart_fuzzer.go",
    "content": "// Copyright 2015 go-fuzz project authors. All rights reserved.\n// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.\n\npackage multipart\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"mime/multipart\"\n\t\"net/textproto\"\n\t\"runtime\"\n\n\t\"github.com/dvyukov/go-fuzz-corpus/fuzz\"\n)\n\ntype Part struct {\n\thdr  textproto.MIMEHeader\n\tdata []byte\n}\n\nfunc Fuzz(data []byte) int {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t}\n\t\truntime.GC()\n\t}()\n\tconst boundary = \"dfhjksd23f43242f43fv4b4g2g2g23vf2\"\n\t{\n\t\tr := multipart.NewReader(bytes.NewReader(data), boundary)\n\t\tf, err := r.ReadForm(1 << 20)\n\t\tif err == nil {\n\t\t\tf.RemoveAll()\n\t\t}\n\t}\n\tfmt.Println(\"Creating multipart reader\")\n\tr := multipart.NewReader(bytes.NewReader(data), boundary)\n\tfmt.Println(\"Reading\")\n\tvar parts []Part\n\tfor {\n\t\tp, err := r.NextPart()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\tp.FileName()\n\t\tp.FormName()\n\t\tpdata, err := ioutil.ReadAll(p)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\tp.Close()\n\t\t// The parser is loose here.\n\t\t// If data contains \\n followed by boundary (but without \\r),\n\t\t// it parses it as part body. However, when it serializes it back,\n\t\t// it writes \\r\\n followed by boundary, which becomes new part separator.\n\t\tif bytes.Contains(pdata, []byte(boundary)) {\n\t\t\tcontinue\n\t\t}\n\t\tparts = append(parts, Part{p.Header, pdata})\n\t}\n\tif len(parts) == 0 {\n\t\treturn 0\n\t}\n\n\tfmt.Println(\"Creating new writer\")\n\tbuf := new(bytes.Buffer)\n\tw := multipart.NewWriter(buf)\n\tw.SetBoundary(boundary)\n\tfmt.Println(\"Writing data\")\n\tfor _, p := range parts {\n\t\tpw, err := w.CreatePart(p.hdr)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tn, err := pw.Write(p.data)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif n != len(p.data) {\n\t\t\tpanic(\"partial write\")\n\t\t}\n\t}\n\tw.Close()\n\n\tfmt.Println(\"Time to compare\")\n\tdata1 := buf.Bytes()\n\tr1 := multipart.NewReader(buf, boundary)\n\tvar parts1 []Part\n\tfor {\n\t\tp, err := r1.NextPart()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"parts0: %+v\\n\", parts)\n\t\t\tfmt.Printf(\"data0: %q\\n\", data)\n\t\t\tfmt.Printf(\"data1: %q\\n\", data1)\n\t\t\tpanic(err)\n\t\t}\n\t\tp.FileName()\n\t\tp.FormName()\n\t\tpdata, err := ioutil.ReadAll(p)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tp.Close()\n\t\tparts1 = append(parts1, Part{p.Header, pdata})\n\t}\n\n\tfmt.Println(\"Performing deep equal\")\n\n\tif !fuzz.DeepEqual(parts, parts1) {\n\t\tfmt.Printf(\"parts0: %+v\\n\", parts)\n\t\tfmt.Printf(\"parts1: %+v\\n\", parts1)\n\t\tfmt.Printf(\"data0: %q\\n\", data)\n\t\tfmt.Printf(\"data1: %q\\n\", data1)\n\t\tpanic(\"data has changed\")\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/openpgp_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage packet\n\nimport (\n\t\"bytes\"\n)\n\nfunc FuzzOpenpgpRead(data []byte) int {\n\t_, _ = Read(bytes.NewReader(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/project.yaml",
    "content": "homepage: \"https://golang.org/\"\nmain_repo: \"https://github.com/golang/go\"\nprimary_contact: \"security@golang.org\"\nauto_ccs:\n - \"bracewell@google.com\"\n - \"dneil@google.com\"\n - \"nealpatel@google.com\"\n - \"rsc@google.com\"\n - \"Adam@adalogics.com\"\nlanguage: go\nsanitizers:\n - address\nfuzzing_engines:\n - libfuzzer\n"
  },
  {
    "path": "projects/golang/regexp_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage regexp\n\nfunc FuzzCompile(data []byte) int {\n\t_, _ = Compile(string(data))\n\treturn 1\n}\n\nfunc FuzzCompilePOSIX(data []byte) int {\n\t_, _ = CompilePOSIX(string(data))\n\treturn 1\n}\n\nfunc FuzzReplaceAll(data []byte) int {\n\tif len(data) < 5 {\n\t\treturn 0\n\t}\n\tchunk1Len := int(data[0])\n\tchunk2Len := int(data[1])\n\n\tif chunk2Len <= chunk1Len || chunk1Len < 3 || len(data) < (chunk2Len+2) {\n\t\treturn 0\n\t}\n\n\tchunk1 := data[2:chunk1Len]\n\tchunk2 := data[chunk1Len+1 : chunk2Len]\n\tchunk3 := data[chunk2Len+1:]\n\n\tre, err := Compile(string(chunk1))\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\t_ = re.ReplaceAll(chunk2, chunk3)\n\treturn 1\n}\n\nfunc FuzzFindMatchApis(data []byte) int {\n\tif len(data) < 5 {\n\t\treturn 0\n\t}\n\tcallType := int(data[0])\n\tchunk1Len := int(data[1])\n\n\tdata = data[2:]\n\n\tif chunk1Len+2 >= len(data) {\n\t\treturn 0\n\t}\n\n\treString := string(data[:chunk1Len])\n\tapiPayload := data[chunk1Len+1:]\n\tre, err := Compile(reString)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tswitch callType % 6 {\n\tcase 0:\n\t\t_ = re.FindIndex(apiPayload)\n\tcase 1:\n\t\t_ = re.FindString(string(apiPayload))\n\tcase 2:\n\t\t_ = re.FindStringIndex(string(apiPayload))\n\tcase 3:\n\t\t_ = re.FindSubmatch(apiPayload)\n\tcase 4:\n\t\t_ = re.MatchString(string(apiPayload))\n\tcase 5:\n\t\t_ = re.Match(apiPayload)\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/strings_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage strings\n\nimport (\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n\t\"strings\"\n)\n\nfunc FuzzStringsSplit(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tstr1, err := f.GetString()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tstr2, err := f.GetString()\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_ = strings.Split(str1, str2)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/text_fuzzer.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage fuzztext\n\nimport (\n\t\"golang.org/x/text/currency\"\n\t\"golang.org/x/text/language\"\n)\n\nfunc FuzzAcceptLanguage(data []byte) int {\n\t_, _, _ = language.ParseAcceptLanguage(string(data))\n\treturn 1\n}\n\nfunc FuzzCurrency(data []byte) int {\n\t// Create tag\n\tt, err := language.Parse(string(data))\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_, _ = currency.FromTag(t)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/tiff_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage tiff\n\nimport (\n\t\"bytes\"\n\t\"runtime\"\n)\n\nfunc FuzzTiffDecode(data []byte) int {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t}\n\t\truntime.GC()\n\t}()\n\tconfig, err := DecodeConfig(bytes.NewReader(data))\n\tif err != nil || config.Width > 16384 || config.Height > 16384 {\n\t\treturn 1\n\t}\n\t_, _ = Decode(bytes.NewReader(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/unicode_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage unicode\n\nimport (\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n\t\"golang.org/x/text/encoding/charmap\"\n)\n\nvar (\n\tutf16LEIB = UTF16(LittleEndian, IgnoreBOM) // UTF-16LE (atypical interpretation)\n\tutf16LEUB = UTF16(LittleEndian, UseBOM)    // UTF-16, LE\n\tutf16LEEB = UTF16(LittleEndian, ExpectBOM) // UTF-16, LE, Expect\n\tutf16BEIB = UTF16(BigEndian, IgnoreBOM)    // UTF-16BE (atypical interpretation)\n\tutf16BEUB = UTF16(BigEndian, UseBOM)       // UTF-16 default\n\tutf16BEEB = UTF16(BigEndian, ExpectBOM)    // UTF-16 Expect\n)\n\nfunc FuzzUnicodeTransform(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tsizeDest, err := f.GetInt()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tb, err := f.GetBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tb2 := make([]byte, sizeDest)\n\n\tdecoderType, err := f.GetInt()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tboo, err := f.GetBool()\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tswitch decoderType % 10 {\n\tcase 0:\n\t\tutf16LEIB.NewDecoder().Transform(b2, b, boo)\n\tcase 1:\n\t\tutf16LEUB.NewDecoder().Transform(b2, b, boo)\n\tcase 2:\n\t\tutf16LEEB.NewDecoder().Transform(b2, b, boo)\n\tcase 3:\n\t\tutf16BEIB.NewDecoder().Transform(b2, b, boo)\n\tcase 4:\n\t\tutf16BEUB.NewDecoder().Transform(b2, b, boo)\n\tcase 5:\n\t\tutf16BEEB.NewDecoder().Transform(b2, b, boo)\n\tcase 6:\n\t\tUTF8.NewDecoder().Transform(b2, b, boo)\n\tcase 7:\n\t\tUTF8BOM.NewDecoder().Transform(b2, b, boo)\n\tcase 8:\n\t\ttr := UTF8BOM.NewEncoder()\n\t\ttr.Reset()\n\t\ttr.Transform(b2, b, boo)\n\tcase 9:\n\t\ttr := BOMOverride(charmap.CodePage437.NewDecoder())\n\t\ttr.Reset()\n\t\ttr.Transform(b2, b, boo)\n\t}\n\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/webp_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage webp\n\nimport (\n\t\"bytes\"\n)\n\nfunc FuzzWebpDecode(data []byte) int {\n\tconf, err := DecodeConfig(bytes.NewReader(data))\n\tif err != nil {\n\t\treturn 0\n\t}\n\ttotalSize := conf.Width * conf.Height\n\tif totalSize > 1e6 {\n\t\treturn 0\n\t}\n\t_, _ = Decode(bytes.NewReader(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang/x509_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage x509\n\nimport (\n\t\"crypto/x509\"\n\t\"encoding/pem\"\n)\n\nfunc FuzzParseCert(data []byte) int {\n\tif len(data) < 2 {\n\t\treturn 1\n\t}\n\tplural := int(data[0])%2 == 0\n\tdata = data[1:]\n\tif plural {\n\t\t_, _ = x509.ParseCertificates(data)\n\t} else {\n\t\t_, _ = x509.ParseCertificate(data)\n\t}\n\treturn 1\n}\n\nfunc FuzzPemDecrypt(data []byte) int {\n\tif len(data) < 6 {\n\t\treturn 0\n\t}\n\tpemDataLen := int(data[0])\n\tif (pemDataLen + 5) > len(data) {\n\t\treturn 0\n\t}\n\tdata = data[1:]\n\tpemData := data[:pemDataLen]\n\tpassword := data[pemDataLen+1:]\n\tblock, _ := pem.Decode(pemData)\n\tif block == nil {\n\t\treturn 0\n\t}\n\n\t_, _ = x509.DecryptPEMBlock(block, password)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/golang-appengine/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/golang/appengine\nWORKDIR $SRC/appengine\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/golang-appengine/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./v2/blobstore/\ncd $SRC/appengine/v2\ngo mod tidy\nprintf \"package appengine\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer google.golang.org/appengine/v2/blobstore FuzzParseUpload FuzzParseUpload\n"
  },
  {
    "path": "projects/golang-appengine/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage blobstore\n\nimport (\n\t\"bytes\"\n\t\"net/http\"\n\t\"testing\"\n\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc FuzzParseUpload(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, body, headers []byte) {\n\t\tr, err := http.NewRequest(\"POST\", \"\", bytes.NewReader(body))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tff := fuzz.NewConsumer(headers)\n\t\th := make(map[string][]string, 0)\n\t\tff.FuzzMap(&h)\n\t\tif len(h) == 0 {\n\t\t\treturn\n\t\t}\n\t\t_, ok := h[\"Content-Type\"]\n\t\tif !ok {\n\t\t\thSlice := make([]string, 0)\n\t\t\terr := ff.CreateSlice(&hSlice)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\th[\"Content-Type\"] = hSlice\n\t\t}\n\t\tr.Header = h\n\t\tParseUpload(r)\n\t})\n}\n"
  },
  {
    "path": "projects/golang-appengine/project.yaml",
    "content": "homepage: \"https://github.com/golang/appengine\"\nlanguage: go\nmain_repo: \"https://github.com/golang/appengine\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/golang-protobuf/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone https://go.googlesource.com/protobuf $GOPATH/src/google.golang.org/protobuf\nCOPY build.sh $SRC/\nWORKDIR $GOPATH/src/google.golang.org/protobuf\n"
  },
  {
    "path": "projects/golang-protobuf/build.sh",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n. internal/fuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/golang-protobuf/project.yaml",
    "content": "homepage: \"https://github.com/protocolbuffers/protobuf-go\"\nmain_repo: \"https://github.com/protocolbuffers/protobuf-go\"\nprimary_contact: \"stapelberg@google.com\"\nauto_ccs:\n - \"lassefolger@google.com\"\n - \"stapelberg@google.com\"\n - \"dneil@google.com\"\nsanitizers:\n - address\nfuzzing_engines:\n - libfuzzer\nlanguage: go\n"
  },
  {
    "path": "projects/gonids/372f9bd.diff",
    "content": "From 372f9bdd0a914945296123b51df92eed4ece3df6 Mon Sep 17 00:00:00 2001\nFrom: Keith Randall <khr@golang.org>\nDate: Thu, 11 Nov 2021 19:58:23 -0500\nSubject: [PATCH] [release-branch.go1.17] reflect: keep pointer in aggregate-typed args live in Call\n\nWhen register ABI is used, reflect.Value.Call prepares the call\narguments in a memory representation of the argument registers.\nIt has special handling to keep the pointers in arguments live.\nCurrently, this handles pointer-typed arguments. But when an\nargument is an aggregate-type that contains pointers and passed\nin registers, it currently doesn't keep the pointers live. Do\nso in this CL.\n\nFixes #49961\n\nChange-Id: I9264a8767e2a2c48573f6047144759b845dcf480\n---\n\ndiff --git a/src/internal/abi/abi.go b/src/internal/abi/abi.go\nindex aaff9ce..aa5083a 100644\n--- a/src/internal/abi/abi.go\n+++ b/src/internal/abi/abi.go\n@@ -33,6 +33,24 @@\n \tReturnIsPtr IntArgRegBitmap\n }\n \n+func (r *RegArgs) Dump() {\n+\tprint(\"Ints:\")\n+\tfor _, x := range r.Ints {\n+\t\tprint(\" \", x)\n+\t}\n+\tprintln()\n+\tprint(\"Floats:\")\n+\tfor _, x := range r.Floats {\n+\t\tprint(\" \", x)\n+\t}\n+\tprintln()\n+\tprint(\"Ptrs:\")\n+\tfor _, x := range r.Ptrs {\n+\t\tprint(\" \", x)\n+\t}\n+\tprintln()\n+}\n+\n // IntArgRegBitmap is a bitmap large enough to hold one bit per\n // integer argument/return register.\n type IntArgRegBitmap [(IntArgRegs + 7) / 8]uint8\ndiff --git a/src/reflect/all_test.go b/src/reflect/all_test.go\nindex eac27e8..6f350af 100644\n--- a/src/reflect/all_test.go\n+++ b/src/reflect/all_test.go\n@@ -6270,6 +6270,29 @@\n \t*CallGC = false\n }\n \n+func TestCallArgLive(t *testing.T) {\n+\ttype T struct{ X, Y *string } // pointerful aggregate\n+\n+\tF := func(t T) { *t.X = \"ok\" }\n+\n+\t// In reflect.Value.Call, trigger a garbage collection in reflect.call\n+\t// between marshaling argument and the actual call.\n+\t*CallGC = true\n+\n+\tx := new(string)\n+\truntime.SetFinalizer(x, func(p *string) {\n+\t\tif *p != \"ok\" {\n+\t\t\tt.Errorf(\"x dead prematurely\")\n+\t\t}\n+\t})\n+\tv := T{x, nil}\n+\n+\tValueOf(F).Call([]Value{ValueOf(v)})\n+\n+\t// Stop garbage collecting during reflect.call.\n+\t*CallGC = false\n+}\n+\n func TestMakeFuncStackCopy(t *testing.T) {\n \ttarget := func(in []Value) []Value {\n \t\truntime.GC()\ndiff --git a/src/reflect/value.go b/src/reflect/value.go\nindex 6f878eb..520dc69 100644\n--- a/src/reflect/value.go\n+++ b/src/reflect/value.go\n@@ -352,7 +352,7 @@\n \treturn v.call(\"CallSlice\", in)\n }\n \n-var callGC bool // for testing; see TestCallMethodJump\n+var callGC bool // for testing; see TestCallMethodJump and TestCallArgLive\n \n const debugReflectCall = false\n \n@@ -509,12 +509,16 @@\n \t\t\t\t// Copy values to \"integer registers.\"\n \t\t\t\tif v.flag&flagIndir != 0 {\n \t\t\t\t\toffset := add(v.ptr, st.offset, \"precomputed value offset\")\n-\t\t\t\t\tmemmove(unsafe.Pointer(&regArgs.Ints[st.ireg]), offset, st.size)\n-\t\t\t\t} else {\n \t\t\t\t\tif st.kind == abiStepPointer {\n \t\t\t\t\t\t// Duplicate this pointer in the pointer area of the\n \t\t\t\t\t\t// register space. Otherwise, there's the potential for\n \t\t\t\t\t\t// this to be the last reference to v.ptr.\n+\t\t\t\t\t\tregArgs.Ptrs[st.ireg] = *(*unsafe.Pointer)(offset)\n+\t\t\t\t\t}\n+\t\t\t\t\tmemmove(unsafe.Pointer(&regArgs.Ints[st.ireg]), offset, st.size)\n+\t\t\t\t} else {\n+\t\t\t\t\tif st.kind == abiStepPointer {\n+\t\t\t\t\t\t// See the comment in abiStepPointer case above.\n \t\t\t\t\t\tregArgs.Ptrs[st.ireg] = v.ptr\n \t\t\t\t\t}\n \t\t\t\t\tregArgs.Ints[st.ireg] = uintptr(v.ptr)\n@@ -539,6 +543,15 @@\n \t// Mark pointers in registers for the return path.\n \tregArgs.ReturnIsPtr = abi.outRegPtrs\n \n+\tif debugReflectCall {\n+\t\tregArgs.Dump()\n+\t}\n+\n+\t// For testing; see TestCallArgLive.\n+\tif callGC {\n+\t\truntime.GC()\n+\t}\n+\n \t// Call.\n \tcall(frametype, fn, stackArgs, uint32(frametype.size), uint32(abi.retOffset), uint32(frameSize), &regArgs)\n \n"
  },
  {
    "path": "projects/gonids/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/google/gonids\n\nADD https://rules.emergingthreats.net/open/suricata/emerging.rules.zip emerging.rules.zip\n\nCOPY build.sh $SRC/\nCOPY *.diff $SRC/\nWORKDIR $SRC/gonids\n"
  },
  {
    "path": "projects/gonids/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/google/gonids FuzzParseRule fuzz_parserule\n\ncd $SRC\nunzip emerging.rules.zip\ncd rules\ni=0\nmkdir corpus\n# quit output for commands\nset +x\ncat *.rules | while read l; do echo $l > corpus/$i.rule; i=$((i+1)); done\nset -x\nzip -q -r $OUT/fuzz_parserule_seed_corpus.zip corpus\n\n"
  },
  {
    "path": "projects/gonids/project.yaml",
    "content": "homepage: \"https://github.com/google/gonids\"\nprimary_contact: \"duane.security@gmail.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/google/gonids'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/gopacket/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone https://github.com/google/gopacket.git\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/gopacket\n"
  },
  {
    "path": "projects/gopacket/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n\ncompile_go_fuzzer github.com/google/gopacket/layers FuzzLayer fuzz_layers\n"
  },
  {
    "path": "projects/gopacket/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/google/gopacket\"\nprimary_contact: \"gconnell@google.com\"\nauto_ccs :\n- \"p.antoine@catenacyber.fr\"\n\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/google/gopacket'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/gopsutil/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/shirou/gopsutil\nWORKDIR $SRC/gopsutil\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/gopsutil/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./process/\ngo mod tidy\nprintf \"package process\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > ./process/register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/shirou/gopsutil/v4/process FuzzTest FuzzTest\n"
  },
  {
    "path": "projects/gopsutil/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage process\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc init() {\n\tos.Setenv(\"HOST_PROC\", \".\")\n}\n\nfunc FuzzTest(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data []byte) {\n\t\tp := &Process{Pid: int32(1)}\n\t\tif len(data) < 5 {\n\t\t\treturn\n\t\t}\n\t\terr := os.Mkdir(\"1\", 0750)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tdefer os.RemoveAll(\"1\")\n\t\tfile := filepath.Join(\".\", \"1\", \"limits\")\n\t\terr = os.WriteFile(file, data, 0666)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tp.RlimitUsageWithContext(context.Background(), true)\n\t})\n}\n"
  },
  {
    "path": "projects/gopsutil/project.yaml",
    "content": "homepage: \"https://github.com/shirou/gopsutil\"\nlanguage: go\nmain_repo: \"https://github.com/shirou/gopsutil\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/gosnmp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/gosnmp/gosnmp.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/gosnmp\n"
  },
  {
    "path": "projects/gosnmp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\nsed -i '5,6d' marshal_test.go\nsed -i '/func BenchmarkSendOneRequest(/,/^}/ s/^/\\/\\//' marshal_test.go\n\ncompile_native_go_fuzzer github.com/gosnmp/gosnmp FuzzUnmarshal  fuzz_unmarshal marshal\n"
  },
  {
    "path": "projects/gosnmp/project.yaml",
    "content": "homepage: \"https://github.com/gosnmp/gosnmp\"\nlanguage: go\nprimary_contact: \"tim.rots@protonmail.ch\"\nauto_ccs:\n  - \"superq@gmail.com\"\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/gosnmp/gosnmp\"\n"
  },
  {
    "path": "projects/gpac/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y build-essential pkg-config libz-dev\nRUN git clone https://github.com/gpac/gpac && cd gpac && git submodule update --init --remote --recursive\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/gpac"
  },
  {
    "path": "projects/gpac/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./configure --static-build --extra-cflags=\"${CFLAGS}\" --extra-ldflags=\"${CFLAGS}\"\nmake\n\n\nfuzzers=$(find $SRC/gpac/testsuite/oss-fuzzers -name \"fuzz_*.c\")\nfor f in $fuzzers; do\n\n    fuzzerName=$(basename $f .c)\n    echo \"Building fuzzer $fuzzerName\"\n\n    $CC $CFLAGS -I./include -I./ -DGPAC_HAVE_CONFIG_H -c $f\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzerName.o -o $OUT/$fuzzerName \\\n      ./bin/gcc/libgpac_static.a \\\n      -lm -lz -lpthread -lssl -lcrypto -DGPAC_HAVE_CONFIG_H\n\n\n    if [ -d \"$SRC/gpac/testsuite/oss-fuzzers/${fuzzerName}_corpus\" ]; then\n        zip -j $OUT/${fuzzerName}_seed_corpus.zip $SRC/gpac/testsuite/oss-fuzzers/${fuzzerName}_corpus/*\n    fi\n\ndone"
  },
  {
    "path": "projects/gpac/project.yaml",
    "content": "homepage: \"https://gpac.io\"\nmain_repo: \"https://github.com/gpac/gpac\"\nprimary_contact: \"project.gpac@gmail.com\"\nlanguage: c\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/gprof2dot/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/jrfonseca/gprof2dot gprof2dot\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/gprof2dot\n"
  },
  {
    "path": "projects/gprof2dot/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/gprof2dot/fuzz_profile.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport gprof2dot\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  funcName = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  try:\n    profile = gprof2dot.Profile()\n    profile.getFunctionIds(funcName)\n  except (\n      gprof2dot.XmlTokenMismatch,\n      gprof2dot.UndefinedEvent,\n      gprof2dot.ParseError,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/gprof2dot/project.yaml",
    "content": "homepage: https://github.com/jrfonseca/gprof2dot\nmain_repo: https://github.com/jrfonseca/gprof2dot\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/gpsd/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y scons python3-distutils\nRUN git clone --depth 1 https://gitlab.com/gpsd/gpsd\nRUN git clone --depth 1 https://github.com/adalogics/ada-fuzzers\nRUN cp $SRC/ada-fuzzers/projects/gpsd/build.sh $SRC/ && \\\n    cp -r $SRC/ada-fuzzers/projects/gpsd/fuzzer $SRC/gpsd/fuzzer && \\\n    cp -r $SRC/ada-fuzzers/projects/gpsd/corp $SRC/gpsd/corp\nWORKDIR $SRC/gpsd/\n"
  },
  {
    "path": "projects/gpsd/project.yaml",
    "content": "homepage: \"https://gpsd.io\"\nlanguage: c\nprimary_contact: \"gem@rellim.com\"\nauto_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\nmain_repo: 'https://gitlab.com/gpsd/gpsd'\n"
  },
  {
    "path": "projects/graphicsmagick/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Needed tools\nRUN apt-get update && \\\n    apt-get install -y \\\n    mercurial \\\n    autoconf \\\n    autopoint \\\n    cmake \\\n    libtool \\\n    nasm \\\n    pkg-config \\\n    po4a \\\n    ninja-build \\\n    libgflags-dev \\\n    yasm\n\n# Due to libtiff requirements, build requires autoconf 2.71 (or later)\nRUN curl -LO https://mirrors.edge.kernel.org/ubuntu/pool/main/a/autoconf/autoconf_2.72-3.1ubuntu1_all.deb && \\\n    apt install ./autoconf_2.72-3.1ubuntu1_all.deb\n\n# Due to libxml2 requirements, build requires automake 1.16.3 (or later)\nRUN curl -LO https://mirrors.edge.kernel.org/ubuntu/pool/main/a/automake-1.17/automake_1.17-4ubuntu1_all.deb && \\\n    apt install ./automake_1.17-4ubuntu1_all.deb\n\n# GraphicsMagick\nRUN hg clone --time -b default https://foss.heptapod.net/graphicsmagick/graphicsmagick graphicsmagick || \\\n    hg clone --time -b default https://foss.heptapod.net/graphicsmagick/graphicsmagick graphicsmagick || \\\n    hg clone --time -b default https://foss.heptapod.net/graphicsmagick/graphicsmagick graphicsmagick\n\n# Libtiff\nRUN git clone --depth 1 https://gitlab.com/libtiff/libtiff\n\n# h.265 codec implementation needed by libheif\nRUN git clone --depth 1 https://github.com/strukturag/libde265 || \\\n    printf \"https://github.com/strukturag/libde265 is not available!\\n\"\n\n# x265 HEVC Encoder needed by libheif\n# https://bitbucket.org/multicoreware/x265_git/src/stable/\n# https://bitbucket.org/multicoreware/x265_git/src/master/\nRUN git clone --depth 1 https://bitbucket.org/multicoreware/x265_git/src/stable/ x265 || \\\n    printf \"https://bitbucket.org/multicoreware/x265_git/src/stable/ is not available!\\n\"\n\n# AV1 Codec Library needed by libheif\nRUN git clone --depth 1 https://aomedia.googlesource.com/aom aom || \\\n    printf \"https://aomedia.googlesource.com/aom is not available!\\n\"\n\n# AVC (OpenH264) Codec Library needed by libheif\nRUN git clone --depth 1 https://github.com/cisco/openh264 openh264\n\n# JPEG 2000 (OpenJPEG) Library needed by libheif\nRUN git clone --depth 1 https://github.com/uclouvain/openjpeg openjpeg\n\n# Libheif\nRUN git clone --depth 1 https://github.com/strukturag/libheif\n\n# WebP\nRUN git clone --depth 1 https://github.com/webmproject/libwebp\n\n# Zlib\nRUN git clone --depth 1 https://github.com/madler/zlib\n\n# XZ\nRUN git clone --depth 1 https://github.com/tukaani-project/xz\n\n# Zstd\nRUN git clone --depth 1 https://github.com/facebook/zstd\n\n# libjpeg-turbo\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo\n\n# Freetype\nRUN git clone --depth 1 https://github.com/freetype/freetype\n\n# Libpng\nRUN git clone --depth 1 https://github.com/pnggroup/libpng\n\n# Little-CMS\nRUN git clone --depth 1 https://github.com/mm2/Little-CMS\n\n# Bzip2\nRUN git clone --depth 1 https://gitlab.com/federicomenaquintero/bzip2.git\n\n# Jasper\nRUN git clone --depth 1 https://github.com/jasper-software/jasper\n\n# Libxml2 (fall back to github mirror if gitlab.gnome.org is overloaded)\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git || \\\n    git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git || \\\n    git clone --depth 1 https://github.com/GNOME/libxml2\n\n# Libjxl\nRUN git clone --depth 1 https://github.com/libjxl/libjxl.git\n\n# Libzip\nRUN git clone --depth 1 https://github.com/nih-at/libzip.git\n\n# Libjxl sub-repositories\n# Borrowed from projects/libjxl/Dockerfile\nRUN git -C libjxl submodule update --init --recommend-shallow \\\n  third_party/brotli \\\n  third_party/highway \\\n  third_party/libjpeg-turbo \\\n  third_party/skcms\n\n# JBIG-kit\nRUN git clone https://www.cl.cam.ac.uk/~mgk25/git/jbigkit # does not support shallow\n\n# libwmf\nRUN git clone --depth 1 https://github.com/caolanm/libwmf.git\n\n# vvdec\nRUN git clone --depth 1 https://github.com/fraunhoferhhi/vvdec.git\n\n# vvenc\nRUN git clone --depth 1 https://github.com/fraunhoferhhi/vvenc.git\n\n# x264\nRUN git clone --depth 1 https://code.videolan.org/videolan/x264.git\n\n# OpenJPH\nRUN git clone --depth 1 https://github.com/aous72/OpenJPH.git\n\n# Build!\nWORKDIR $SRC/graphicsmagick\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/graphicsmagick/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./fuzzing/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/graphicsmagick/project.yaml",
    "content": "homepage: \"http://www.graphicsmagick.org/\"\nmain_repo: \"https://foss.heptapod.net/graphicsmagick/graphicsmagick\"\nlanguage: c++\nprimary_contact: \"bobjfriesenhahn@gmail.com\"\nauto_ccs:\n    - troyjp@gmail.com\n    - alex.gaynor@gmail.com\n    - paul.l.kehrer@gmail.com\nsanitizers:\n    - address\n    - memory\n    - undefined\narchitectures:\n    - x86_64\n    - i386\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\n"
  },
  {
    "path": "projects/graphql-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN git clone --depth 1 https://github.com/graphql-java/graphql-java graphql-java\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/graphql-java\n"
  },
  {
    "path": "projects/graphql-java/GraphqlFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport graphql.GraphQL;\nimport graphql.GraphQLException;\nimport graphql.schema.GraphQLSchema;\nimport graphql.schema.idl.RuntimeWiring;\nimport graphql.schema.idl.SchemaGenerator;\nimport graphql.schema.idl.SchemaParser;\nimport graphql.schema.idl.TypeDefinitionRegistry;\n\npublic class GraphqlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    GraphQLSchema graphQLSchema;\n    SchemaParser schemaParser = new SchemaParser();\n    SchemaGenerator schemaGenerator = new SchemaGenerator();\n\n    try {\n      if (data.consumeBoolean()) {\n        TypeDefinitionRegistry registry =\n            schemaParser.parse(data.consumeString(data.remainingBytes() / 2));\n        graphQLSchema = schemaGenerator.makeExecutableSchema(\n            registry, RuntimeWiring.newRuntimeWiring().build());\n      } else {\n        graphQLSchema =\n            schemaGenerator.createdMockedSchema(data.consumeString(data.remainingBytes() / 2));\n      }\n\n      GraphQL.newGraphQL(graphQLSchema).build().execute(data.consumeRemainingAsString());\n    } catch (GraphQLException | ClassCastException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/graphql-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n# Retrieve JDK-17\nwget https://download.java.net/openjdk/jdk17/ri/openjdk-17+35_linux-x64_bin.tar.gz -O openjdk-17.tar.gz\ntar -zxf openjdk-17.tar.gz\nrm -f openjdk-17.tar.gz\ncp -r jdk-17 $OUT/\nJAVA_HOME=$OUT/jdk-17\nPATH=$JAVA_HOME/bin:$PATH\n\n# Add task for copy dependency jars\necho \"\ntask copyToLib(type: Copy) {\n    into \\\"\\${buildDir}/dependencies\\\"\n    from configurations.runtimeClasspath\n}\" >> ./build.gradle\n\n# Gradle build with gradle wrapper\nrm -rf $HOME/.gradle/caches/\n./gradlew clean build shadowJar copyToLib -x test -x javadoc -x sources\n./gradlew --stop\n\ncp \"./build/libs/$(basename ./build/tmp/jar/*.jar)\" $OUT/graphql-java.jar\n\nALL_JARS=\"graphql-java.jar\"\n\n# Copy dependency jars\nfor JARFILE in $(ls ./build/dependencies/*.jar)\ndo\n  cp $JARFILE $OUT/\n  ALL_JARS=$ALL_JARS\" $(basename $JARFILE)\"\ndone\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/graphql-java/project.yaml",
    "content": "homepage: https://github.com/graphql-java/graphql-java\nmain_repo: https://github.com/graphql-java/graphql-java\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/greenmail/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone --depth 1 https://github.com/greenmail-mail-test/greenmail.git greenmail\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.4/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/greenmail\n"
  },
  {
    "path": "projects/greenmail/UserManagerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\n\nimport com.icegreen.greenmail.util.GreenMail;\nimport com.icegreen.greenmail.util.ServerSetup;\nimport com.icegreen.greenmail.user.GreenMailUser;\nimport com.icegreen.greenmail.user.UserManager;\nimport com.icegreen.greenmail.user.UserException;\n\n\npublic class UserManagerFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        \n        GreenMail greenMail = new GreenMail(ServerSetup.ALL);\n        String email = data.consumeString(240);\n        String login = data.consumeString(240);\n        String pwd = data.consumeRemainingAsString();\n        try {\n            \n            UserManager userManger = greenMail.getUserManager();\n            userManger.createUser(email, login, pwd);\n            \n            GreenMailUser greenMailUser = userManger.getUser(login);\n\n            if (!greenMailUser.getLogin().equals(login)) {\n                throw new FuzzerSecurityIssueMedium(\"User is not created\");\n            }\n            if (!userManger.test(login, pwd)) {\n                throw new FuzzerSecurityIssueMedium(\"Loggin is not possible!\");\n            }\n\n            userManger.deleteUser(greenMailUser);\n\n        } catch (UserException e) { }\n    }\n}\n"
  },
  {
    "path": "projects/greenmail/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15 -Djdk.version=15\"\n$MVN clean package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\ncp ./greenmail-core/target/greenmail-$CURRENT_VERSION.jar $OUT/greenmail-core.jar\n\nALL_JARS=\"greenmail-core.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/greenmail/project.yaml",
    "content": "homepage: \"https://github.com/greenmail-mail-test/greenmail\"\nlanguage: jvm\nmain_repo: \"https://github.com/greenmail-mail-test/greenmail.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/grok/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --recursive --depth 1 https://github.com/GrokImageCompression/grok.git grok\nRUN git clone --depth 1 https://github.com/GrokImageCompression/grok-test-data.git grok-data\nWORKDIR grok\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/grok/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Configure Test Data Path\nexport GRK_DATA_ROOT=$SRC/grok-data\n\n# Build grok core code and unit test\nmkdir build\ncd build\ncmake .. -DGRK_BUILD_CODEC=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON\nmake clean -s\nmake -j$(nproc) -s\ncd ..\n\n./tests/fuzzers/build_google_oss_fuzzers.sh\n./tests/fuzzers/build_seed_corpus.sh\n"
  },
  {
    "path": "projects/grok/project.yaml",
    "content": "homepage: \"https://github.com/GrokImageCompression/grok\"\nprimary_contact: \"boxerab@gmail.com\"\nlanguage: c++\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/GrokImageCompression/grok.git'\n"
  },
  {
    "path": "projects/grok/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable allocator problem and leak problem for unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0:allocator_may_return_null=1\"\nctest --test-dir build\n"
  },
  {
    "path": "projects/groovy/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone https://github.com/apache/groovy.git\nCOPY *.diff $SRC/\nRUN cd groovy && tr -d '\\015' < $SRC/add-shadow-to-test.diff | git apply\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/groovy\n"
  },
  {
    "path": "projects/groovy/DurationFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport groovy.time.*;\n\npublic class DurationFuzzer {\n\n\tint years[] = null;\n\tint months[] = null;\n\tint days[] = null;\n\tint hours[] = null;\n\tint minutes[] = null;\n\tint seconds[] = null;\n\tint millis[] = null;\n\n\tpublic DurationFuzzer(FuzzedDataProvider data) {\n\t\tyears=new int[] { data.consumeInt(), data.consumeInt() };\n\t\tmonths=new int[] { data.consumeInt(), data.consumeInt() };\n\t\tdays=new int[] { data.consumeInt(), data.consumeInt() };\n\t\thours=new int[] { data.consumeInt(), data.consumeInt() };\n\t\tminutes=new int[] { data.consumeInt(), data.consumeInt() };\n\t\tseconds=new int[] { data.consumeInt(), data.consumeInt() };\n\t\tmillis=new int[] { data.consumeInt(), data.consumeInt() };\n\t}\n\t\n\tvoid runTest(BaseDuration duration1, BaseDuration duration2) {\n\t\tduration1.getAgo();\n\t\tduration1.compareTo(duration2);\n\t\tduration1.getHours();\n\t\tduration1.getMillis();\n\t\tduration1.getMinutes();\n\t\tduration1.getMonths();\n\t\tduration1.getSeconds();\n\t\tduration1.getYears();\n\t\tduration1.toString();\n\t\tduration1.getFrom();\n\t\tduration1.getFrom().getNow();\n\t\tduration1.getFrom().getToday();\n\t\tduration1.toMilliseconds();\n\t}\n\n\tvoid runTest(Duration duration1, Duration duration2) {\n\t\trunTest((BaseDuration)duration1, duration2);\n\t\tduration1.minus(duration2);\n\t\tduration1.plus(duration2);\n\t}\n\tvoid runTest(TimeDuration duration1, TimeDuration duration2) {\n\t\trunTest((BaseDuration)duration1, duration2);\n\t\tduration1.minus(duration2);\n\t\tduration1.plus(duration2);\n\t}\n\tvoid runTest(DatumDependentDuration duration1, DatumDependentDuration duration2) {\n\t\trunTest((BaseDuration)duration1, duration2);\n\t\tduration1.minus(duration2);\n\t\tduration1.plus(duration2);\n\t}\n\tvoid runTest(DatumDependentDuration duration1, TimeDatumDependentDuration duration2) {\n\t\trunTest((BaseDuration)duration1, duration2);\n\t\tduration1.plus(duration2);\n\t}\n\n\tvoid runTest(FuzzedDataProvider data) {\n\n\t\trunTest(new Duration(days[0], hours[0], minutes[0], seconds[0], millis[0]), new Duration(days[1], hours[1], minutes[1], seconds[1], millis[1]));\n\t\trunTest(new TimeDuration(days[0], hours[0], minutes[0], seconds[0], millis[0]), new TimeDuration(days[1], hours[1], minutes[1], seconds[1], millis[1]));\n\t\trunTest(new DatumDependentDuration(years[0], months[0],days[0], hours[0], minutes[0], seconds[0], millis[0]), new TimeDuration(days[1], hours[1], minutes[1], seconds[1], millis[1]));\n\t\trunTest(new DatumDependentDuration(years[0], months[0],days[0], hours[0], minutes[0], seconds[0], millis[0]), new TimeDatumDependentDuration(years[1], months[1], days[1], hours[1], minutes[1], seconds[1], millis[1]));\n\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tDurationFuzzer testClosure = new DurationFuzzer(data);\n\t\ttestClosure.runTest(data);\n\t}\n}\n"
  },
  {
    "path": "projects/groovy/TestFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\n\nimport groovy.test.*;\nimport junit.framework.AssertionFailedError;\nimport static groovy.test.GroovyAssert.shouldFail;\nimport java.util.Arrays;\nimport groovy.lang.*;\n\nclass MyObject {\n\tboolean a, b;\n\n\tMyObject(boolean a, boolean b) {\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t}\n\n\tpublic boolean equals(Object anotherObject) {\n\t\tMyObject other = (MyObject) anotherObject;\n\t\tif (a != other.a) {\n\t\t\treturn false;\n\t\t}\n\t\tif (b != other.b) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n}\n\nclass MyClosure extends Closure<MyClosure> {\n\tboolean shouldFail;\n\n\tMyClosure(FuzzedDataProvider data) {\n\t\tsuper(null);\n\t\tshouldFail = data.consumeBoolean();\n\t}\n\n\tpublic Object doCall(Object args) {\n\t\tif (shouldFail) {\n\t\t\tObject x = null;\n\t\t\tx.hashCode();\n\t\t}\n\t\treturn null;\n\t}\n}\n\npublic class TestFuzzer extends GroovyTestCase {\n\n\tpublic TestFuzzer(FuzzedDataProvider data) {\n\t}\n\n\tMyObject getObject(FuzzedDataProvider data) {\n\t\treturn new MyObject(data.consumeBoolean(), data.consumeBoolean());\n\t}\n\n\tMyClosure getClosure(FuzzedDataProvider data) {\n\t\treturn new MyClosure(data);\n\t}\n\n\tvoid printPos() {\n\t\ttry {\n\t\t\tthrow new Exception();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.out);\n\t\t}\n\t}\n\n\tvoid assertLengthArrayTest(FuzzedDataProvider data) {\n\t\tvar n = data.consumeInt();\n\t\tvar intArray = new int[] { data.consumeInt(), data.consumeInt() };\n\t\tboolean wasEqual;\n\t\tboolean equal = (n == intArray.length);\n\t\ttry {\n\t\t\tassertLength(n, intArray);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertLength mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid assertLengthArrayTestTwo(FuzzedDataProvider data) {\n\t\tvar length = data.consumeInt();\n\t\tvar intArray = new int[data.consumeInt(1, 10)];\n\t\tboolean wasEqual;\n\t\tboolean equal = (length == intArray.length);\n\t\ttry {\n\t\t\tassertLength(length, intArray);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertLength mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid assertLengthCharTest(FuzzedDataProvider data) {\n\t\tvar n = data.consumeInt();\n\t\tvar charArray = new char[] { data.consumeChar(), data.consumeChar() };\n\t\tboolean wasEqual;\n\t\tboolean equal = (n == charArray.length);\n\t\ttry {\n\t\t\tassertLength(n, charArray);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertLength mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid assertLengthObjectTest(FuzzedDataProvider data) {\n\t\tvar length = data.consumeInt();\n\t\tvar objectArray = new MyObject[] { getObject(data), getObject(data) };\n\t\tboolean wasEqual;\n\t\tboolean equal = (length == objectArray.length);\n\t\ttry {\n\t\t\tassertLength(length, objectArray);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertObjectLength mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid assertEqualsStringTest(FuzzedDataProvider data) {\n\t\tvar actual = data.consumeString(1000);\n\t\tvar expected = data.consumeString(1000);\n\t\tboolean wasEqual;\n\t\tboolean equal = (actual.equals(expected));\n\t\ttry {\n\t\t\tassertEquals(actual, expected);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertEqual mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid assertEqualsObjectWithMessageTest(FuzzedDataProvider data) {\n\t\tvar message = data.consumeString(100);\n\t\tvar actual = getObject(data);\n\t\tvar expected = getObject(data);\n\t\tboolean wasEqual;\n\t\tboolean equal = (actual.equals(expected));\n\t\ttry {\n\t\t\tassertEquals(message, actual, expected);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"Object mismatch not detected.\");\n\t\t}\n\t}\n\n\tvoid assertEqualsObjectTest(FuzzedDataProvider data) {\n\t\tvar actual = getObject(data);\n\t\tvar expected = getObject(data);\n\t\tboolean wasEqual;\n\t\tboolean equal = (actual.equals(expected));\n\t\ttry {\n\t\t\tassertEquals(actual, expected);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"Object mismatch not detected.\");\n\t\t}\n\t}\n\n\tvoid assertObjectEqualsTest(FuzzedDataProvider data) {\n\t\tvar expected = getObject(data);\n\t\tvar actual = getObject(data);\n\t\tboolean wasEqual;\n\t\tboolean equal = (expected.equals(actual));\n\t\ttry {\n\t\t\tassertEquals(expected, actual);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertEquals mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid assertObjectArrayEqualsTest(FuzzedDataProvider data) {\n\t\tvar expected = new MyObject[] { getObject(data), getObject(data) };\n\t\tvar actual = new MyObject[] { getObject(data), getObject(data) };\n\t\tboolean wasEqual;\n\t\tboolean equal = (Arrays.equals(expected, actual));\n\t\ttry {\n\t\t\tassertArrayEquals(expected, actual);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertObjectArrayEquals mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid assertInspectTest(FuzzedDataProvider data) {\n\t\tvar value = getObject(data);\n\t\tvar expected = data.consumeString(100);\n\t\tboolean wasEqual;\n\t\tboolean equal = (value.toString() == expected);\n\t\ttry {\n\t\t\tassertInspect(value, expected);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertInspect mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid shouldFailTest(FuzzedDataProvider data) {\n\t\tMyClosure c = new MyClosure(data);\n\t\tboolean hasFailed;\n\t\ttry {\n\t\t\tshouldFail(c);\n\t\t\thasFailed = true;\n\t\t} catch (AssertionError er) {\n\t\t\thasFailed = false;\n\t\t}\n\t\tif (c.shouldFail != hasFailed) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"failure not detected\");\n\t\t}\n\t}\n\n\tvoid shouldFailClassCLosureTest(FuzzedDataProvider data) {\n\t\tMyClosure c = new MyClosure(data);\n\t\tboolean hasFailed;\n\t\ttry {\n\t\t\tshouldFail(NullPointerException.class, c);\n\t\t\thasFailed = true;\n\t\t} catch (AssertionError er) {\n\t\t\thasFailed = false;\n\t\t}\n\t\tif (c.shouldFail != hasFailed) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"failure not detected\");\n\t\t}\n\t}\n\n\tvoid shouldFailWithCauseTest(FuzzedDataProvider data) {\n\t\tMyClosure c = new MyClosure(data);\n\t\tboolean hasFailed;\n\t\ttry {\n\t\t\tshouldFailWithCause(NullPointerException.class, c);\n\t\t\thasFailed = true;\n\t\t} catch (AssertionError er) {\n\t\t\thasFailed = false;\n\t\t}\n\t\tif (c.shouldFail != hasFailed) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"failure not detected\");\n\t\t}\n\t}\n\n\tvoid shouldFailStringTest(FuzzedDataProvider data) {\n\t\ttry {\n\t\t\tshouldFail(data.consumeString(1000));\n\t\t} catch (AssertionError er) {\n\t\t}\n\t}\n\n\tvoid assertToStringTest(FuzzedDataProvider data) {\n\t\tvar value = getObject(data);\n\t\tvar expected = data.consumeString(100);\n\t\tboolean wasEqual;\n\t\tboolean equal = (value.toString() == expected);\n\t\ttry {\n\t\t\tassertToString(value, expected);\n\t\t\twasEqual = true;\n\t\t} catch (AssertionFailedError er) {\n\t\t\twasEqual = false;\n\t\t}\n\t\tif (equal != wasEqual) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"assertToString mismatch not detected\");\n\t\t}\n\t}\n\n\tvoid runFuzzerTest(FuzzedDataProvider data) {\n\t\tassertObjectArrayEqualsTest(data);\n\t\tassertObjectEqualsTest(data);\n\n\t\ttry {\n\t\t\tassertContains(data.consumeChar(), new char[] { data.consumeChar(), data.consumeChar() });\n\t\t} catch (AssertionFailedError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tassertContains(data.consumeInt(), new int[] { data.consumeInt(), data.consumeInt() });\n\t\t} catch (AssertionFailedError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\tassertEqualsObjectWithMessageTest(data);\n\t\tassertEqualsObjectTest(data);\n\t\tassertEqualsStringTest(data);\n\t\tassertInspectTest(data);\n\t\tassertLengthCharTest(data);\n\t\tassertLengthArrayTest(data);\n\t\tassertLengthArrayTestTwo(data);\n\t\tassertLengthObjectTest(data);\n\t\tassertToStringTest(data);\n\n\t\ttry {\n\t\t\tfixEOLs(data.consumeString(1000));\n\t\t} catch (AssertionFailedError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tgetMethodName();\n\t\t} catch (AssertionFailedError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tgetName();\n\t\t} catch (AssertionFailedError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tgetTestClassName();\n\t\t} catch (AssertionFailedError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tnotYetImplemented(getObject(data));\n\t\t} catch (Exception er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tassertScript(data.consumeString(1000));\n\t\t} catch (Exception er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tnotYetImplemented();\n\t\t} catch (AssertionError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\tshouldFailTest(data);\n\t\tshouldFailStringTest(data);\n\n\t\ttry {\n\t\t\tshouldFail(NullPointerException.class, data.consumeString(100));\n\t\t} catch (AssertionError er) {\n\t\t\t/* documented ignore */\n\t\t}\n\n\t\tshouldFailClassCLosureTest(data);\n\t\tshouldFailWithCauseTest(data);\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tTestFuzzer testClosure = new TestFuzzer(data);\n\t\ttestClosure.runFuzzerTest(data);\n\t}\n}\n"
  },
  {
    "path": "projects/groovy/add-shadow-to-test.diff",
    "content": "diff --git a/subprojects/groovy-test/build.gradle b/subprojects/groovy-test/build.gradle\nindex 655944cb0b..604a54a9da 100644\n--- a/subprojects/groovy-test/build.gradle\n+++ b/subprojects/groovy-test/build.gradle\n@@ -17,6 +17,7 @@\n  *  under the License.\n  */\n plugins {\n+    id 'com.github.johnrengelman.shadow' version '7.1.2'\n     id 'org.apache.groovy-library'\n }\n \n"
  },
  {
    "path": "projects/groovy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nALL_JARS=\"\"\n\npushd \"${SRC}/groovy\"\n  ./gradlew shadowJar --info\n  JAR_PATH=$(find ./build/libs/ -name \"groovy-*.jar\" | head -n 1)\n  if [[ -f $JAR_PATH ]]; then\n    cp -v \"$JAR_PATH\" \"$OUT/groovy.jar\"\n    ALL_JARS=\"${ALL_JARS} groovy.jar\"\n  else\n    echo \"Error: No JAR file found in ./build/libs/\"\n    exit 1\n  fi\n\n\n  if ls ./subprojects/groovy-test/build/libs/groovy-test-*-SNAPSHOT-all.jar 1> /dev/null 2>&1; then\n    cp -v ./subprojects/groovy-test/build/libs/groovy-test-*-SNAPSHOT-all.jar \"$OUT/groovy-test.jar\"\n    ALL_JARS=\"${ALL_JARS} groovy-test.jar\"\n  else\n    echo \"Error: ./subprojects/groovy-test/build/libs/groovy-test-*-SNAPSHOT-all.jar not found\"\n    exit 1\n  fi\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\n  done\n"
  },
  {
    "path": "projects/groovy/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://groovy-lang.org/\nlanguage: jvm\nmain_repo: https://github.com/apache/groovy.git\nsanitizers:\n- address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/grpc-gateway/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nENV GO111MODULE on\nRUN git clone https://github.com/grpc-ecosystem/grpc-gateway\nCOPY build.sh $SRC/\nWORKDIR $SRC/grpc-gateway\n"
  },
  {
    "path": "projects/grpc-gateway/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule Fuzz fuzz gofuzz\n"
  },
  {
    "path": "projects/grpc-gateway/project.yaml",
    "content": "homepage: \"https://github.com/grpc-ecosystem/grpc-gateway\"\nprimary_contact: \"grpc-gateway-maintainers@googlegroups.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/grpc-ecosystem/grpc-gateway'\n"
  },
  {
    "path": "projects/grpc-go/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/grpc/grpc-go\n\nRUN git clone --depth 1 https://github.com/grpc/grpc-go $GOPATH/src/google.golang.org/grpc\n\nCOPY build.sh fuzz_*.go $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/grpc-go/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz*.go $GOPATH/src/google.golang.org/grpc/examples/\n\n# seems needed to build the targets with the golang modules...\ncd $GOPATH/src/google.golang.org/grpc/examples/\ncompile_go_fuzzer google.golang.org/grpc/examples FuzzHelloClient fuzz_helloclient\ncompile_go_fuzzer google.golang.org/grpc/examples FuzzHelloServer fuzz_helloserver\n"
  },
  {
    "path": "projects/grpc-go/fuzz_hello.go",
    "content": "package grpc_hello_fuzz\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"net\"\n\t\"time\"\n\n\t\"google.golang.org/grpc\"\n\tpb \"google.golang.org/grpc/examples/helloworld/helloworld\"\n)\n\nvar initialized = 0\n\ntype server struct {\n\tpb.UnimplementedGreeterServer\n}\n\n// SayHello implements helloworld.GreeterServer\nfunc (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {\n\tlog.Printf(\"Received: %v\", in.GetName())\n\treturn &pb.HelloReply{Message: \"Hello \" + in.GetName()}, nil\n}\n\nfunc FuzzHelloServer(data []byte) int {\n\tif initialized == 0 {\n\t\tlis, err := net.Listen(\"tcp\", \":50051\")\n\t\tif err != nil {\n\t\t\tlog.Printf(\"failed to listen: %v\\n\", err)\n\t\t\treturn 0\n\t\t}\n\t\ts := grpc.NewServer()\n\t\tpb.RegisterGreeterServer(s, &server{})\n\t\t// start server as a separate goroutine\n\t\tgo func() {\n\t\t\tif err := s.Serve(lis); err != nil {\n\t\t\t\tlog.Printf(\"failed to serve: %v\\n\", err)\n\t\t\t}\n\t\t}()\n\t\tinitialized = 1\n\t}\n\n\tconn, err := net.Dial(\"tcp\", \"localhost:50051\")\n\tif err != nil {\n\t\tlog.Printf(\"failed to dial: %v\\n\", err)\n\t\treturn 0\n\t}\n\tconn.Write(data)\n\tresponse := make([]byte, 1+len(data))\n\tn, err := conn.Read(response)\n\tconn.Close()\n\tif err != nil || n == 0 {\n\t\treturn 0\n\t}\n\treturn 1\n}\n\nvar fuzzdata []byte\n\nfunc FuzzHelloClient(data []byte) int {\n\tif len(data) == 0 {\n\t\treturn 0\n\t}\n\tif initialized == 0 {\n\t\tlis, err := net.Listen(\"tcp\", \":50051\")\n\t\tif err != nil {\n\t\t\tlog.Printf(\"failed to listen: %v\\n\", err)\n\t\t\treturn 0\n\t\t}\n\t\tgo func() {\n\t\t\tfor {\n\t\t\t\tconn, err := lis.Accept()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"did not accept: %v\", err)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tconn.SetDeadline(time.Now().Add(time.Millisecond * 100))\n\t\t\t\trequest := make([]byte, 24)\n\t\t\t\tn, err := conn.Read(request)\n\t\t\t\tif err != nil || n == 0 {\n\t\t\t\t\tlog.Printf(\"did not read: %v\", err)\n\t\t\t\t\tconn.Close()\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tn, err = conn.Write(fuzzdata)\n\t\t\t\tif err != nil || n == 0 {\n\t\t\t\t\tlog.Printf(\"did not write: %v\", err)\n\t\t\t\t}\n\t\t\t\tconn.Close()\n\t\t\t}\n\t\t}()\n\t\tinitialized = 1\n\t}\n\n\tfuzzdata = data\n\t// Set up a connection to the server.\n\tctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10)\n\tdefer cancel()\n\tconn, err := grpc.DialContext(ctx, \"localhost:50051\", grpc.WithInsecure(), grpc.WithBlock())\n\tif err != nil {\n\t\treturn 0\n\t}\n\tdefer conn.Close()\n\tc := pb.NewGreeterClient(conn)\n\n\t// Contact the server and print out its response.\n\tr, err := c.SayHello(ctx, &pb.HelloRequest{Name: \"world\"})\n\tif err != nil {\n\t\treturn 0\n\t}\n\tr.GetMessage()\n\treturn 1\n}\n"
  },
  {
    "path": "projects/grpc-go/project.yaml",
    "content": "homepage: \"https://grpc.io/\"\nprimary_contact: \"menghanl@google.com\"\nauto_ccs:\n  - \"dfawley@google.com\"\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/grpc/grpc-go'\n"
  },
  {
    "path": "projects/grpc-httpjson-transcoding/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Todo: unpin to support llvm 22\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04@sha256:d34b94e3cf868e49d2928c76ddba41fd4154907a1a381b3a263fafffb7c3dce0\nMAINTAINER nareddyt@google.com\n\nRUN apt-get update && apt-get install python3 -y\nRUN git clone https://github.com/grpc-ecosystem/grpc-httpjson-transcoding.git\nWORKDIR $SRC/grpc-httpjson-transcoding/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/grpc-httpjson-transcoding/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This project uses bazel rules_fuzzing.\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/grpc-httpjson-transcoding/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/grpc-ecosystem/grpc-httpjson-transcoding\"\nmain_repo: \"https://github.com/grpc-ecosystem/grpc-httpjson-transcoding.git\"\nlanguage: c++\nprimary_contact: \"nareddyt@google.com\"\nauto_ccs:\n- \"yangshuo@google.com\"\n- \"taoxuy@google.com\"\n- \"qiwzhang@google.com\"\n- \"justinmp@google.com\"\n\nfuzzing_engines:\n- libfuzzer\n- afl\n- honggfuzz\n\nsanitizers:\n- address\n- undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory"
  },
  {
    "path": "projects/grpc-py/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt install python3-dev libssl-dev libre2-dev -y\nRUN git clone https://github.com/grpc/grpc grpc && \\\n    cd grpc && \\\n    git submodule update --init\nWORKDIR grpc\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/grpc-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install --upgrade pip\npip3 install -r ./requirements.txt\n\nGRPC_PYTHON_CFLAGS=\"${CFLAGS}\" GRPC_PYTHON_BUILD_SYSTEM_RE2=true GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true GRPC_PYTHON_BUILD_SYSTEM_ZLIB=true pip3 install -v . \n\n# Install grpcio_status\ncd src/python/grpcio_status\npip3 install .\n\ncd $SRC/grpc/examples/python/helloworld\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data helloworld_pb2.py:. --add-data helloworld_pb2_grpc.py:.\ndone\n"
  },
  {
    "path": "projects/grpc-py/fuzz_server.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzz grpc server using the Greeter example\"\"\"\n\nimport os\nimport sys\nimport time\nimport grpc\nfrom google.protobuf import any_pb2\nfrom google.rpc import status_pb2\nfrom grpc_status import rpc_status\n\nimport socket\nimport atheris\nimport threading\nimport argparse\nfrom concurrent.futures import ThreadPoolExecutor\nfrom google.protobuf.internal import builder as _builder\n\n# Extract path of fuzzer so we can include protobuf modules\nif getattr(sys, 'frozen', False):\n    app_path = os.path.dirname(sys.executable)\nelif __file__:\n    app_path = os.path.dirname(__file__)\nelse:\n    raise Exception(\"Could not extract path needed to import loop.py\")\nsys.path.append(app_path)\n\nimport helloworld_pb2\nimport helloworld_pb2_grpc\n\nruns_left = None\nserver = None\n\n# Simple server\nclass FuzzGreeter(helloworld_pb2_grpc.GreeterServicer):\n    def SayHello(self, request, context):\n        print(\"In server\")\n        return helloworld_pb2.HelloReply(message='Hello from fuzz server, %s!' % request.name)\n\n\ndef serve() -> None:\n    \"\"\"Starts fuzz server\"\"\"\n    global server\n    server = grpc.server(ThreadPoolExecutor(max_workers=1))\n    helloworld_pb2_grpc.add_GreeterServicer_to_server(FuzzGreeter(), server)\n    server.add_insecure_port('[::]:50051')\n    server.start()\n    #server.wait_for_termination()\n    return\n\n@atheris.instrument_func\ndef TestInput(input_bytes):\n    \"\"\"Send fuzzing input to the server\"\"\"\n    global runs_left\n    global server\n    if runs_left != None:\n        runs_left = runs_left - 1\n        if runs_left <= 2:\n            server.stop()\n            return\n\n    time.sleep(0.02)\n    try:\n        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n            s.connect((\"localhost\", 50051))\n            s.sendall(input_bytes)\n            data = s.recv(1024)\n    except OSError:\n        # We don't want to report network errors\n        return\n\n    # Hit the rpc_status too\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n    try:\n        rich_status = status_pb2.Status(\n            code=fdp.ConsumeIntInRange(1,30000),\n            message=fdp.ConsumeUnicodeNoSurrogates(60)\n        )\n        rpc_status.to_status(rich_status)\n    except ValueError:\n        pass\n\n    return\n\n\ndef get_run_count_if_there():\n    \"\"\"Ensure proper exit for coverage builds\"\"\"\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"-atheris_runs\", required=False, default=None)\n    args, _ = parser.parse_known_args()\n    if args.atheris_runs is None:\n        print(\"None args\")\n        return None\n    print(f\"Got a fixed set of runs {args.atheris_runs}\")\n    return args.atheris_runs\n\n\ndef main():\n    global runs_left\n    max_runs = get_run_count_if_there()\n    if max_runs is not None:\n        runs_left = int(max_runs)\n\n    # Launch a grpc server\n    serve()\n\n    # Start fuzzing\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/grpc-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/grpc/grpc\nprimary_contact: \"j.belleville.richard@gmail.com\"\nlanguage: python\nmain_repo: https://github.com/grpc/grpc\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/grpc-swift/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-swift\n\n# specific to project\nRUN apt-get update && apt-get install -y zlib1g-dev\nRUN git clone --depth 1 https://github.com/grpc/grpc-swift\nCOPY build.sh $SRC\nWORKDIR $SRC/grpc-swift\n"
  },
  {
    "path": "projects/grpc-swift/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n. precompile_swift\n# build project\ncd FuzzTesting\nswift build -c debug $SWIFTFLAGS\n\n(\ncd .build/debug/\nfind . -maxdepth 1 -type f -name \"*Fuzzer\" -executable | while read i; do cp $i $OUT/\"$i\"-debug; done\n)\nswift build -c release $SWIFTFLAGS\n(\ncd .build/release/\nfind . -maxdepth 1 -type f -name \"*Fuzzer\" -executable | while read i; do cp $i $OUT/\"$i\"-release; done\n)\n"
  },
  {
    "path": "projects/grpc-swift/project.yaml",
    "content": "homepage: \"https://github.com/grpc/grpc-swift\"\nlanguage: swift\nprimary_contact: \"gbarnett@apple.com\"\nauto_ccs :\n- \"lukasa@apple.com\"\n- \"pp_adams@apple.com\"\n- \"p.antoine@catenacyber.fr\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- thread\nmain_repo: 'https://github.com/grpc/grpc-swift'\n"
  },
  {
    "path": "projects/gson/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-17-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/gson gson\nWORKDIR gson\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/gson/FuzzParse.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.*;\nimport com.google.gson.*;\n\npublic class FuzzParse {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      JsonParser.parseString(data.consumeRemainingAsString());\n    } catch (JsonParseException expected) { }\n  }\n}\n"
  },
  {
    "path": "projects/gson/FuzzReader.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.*;\nimport com.google.gson.*;\nimport com.google.gson.stream.JsonReader;\nimport com.google.gson.stream.JsonToken;\n\npublic class FuzzReader {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    TypeAdapter<JsonElement> adapter = new Gson().getAdapter(JsonElement.class);\n    boolean lenient = data.consumeBoolean();\n    JsonReader reader = new JsonReader(new StringReader(data.consumeRemainingAsString()));\n    reader.setLenient(lenient);\n    try {\n      while (reader.peek() != JsonToken.END_DOCUMENT) {\n        adapter.read(reader);\n      }\n    } catch (JsonParseException | IllegalStateException | NumberFormatException | IOException expected) { }\n  }\n}\n"
  },
  {
    "path": "projects/gson/FuzzStreamParser.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.*;\nimport com.google.gson.*;\n\npublic class FuzzStreamParser {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      JsonStreamParser parser = new JsonStreamParser(data.consumeRemainingAsString());\n      JsonElement element;\n      while (parser.hasNext() == true) {\n        // We do not catch NoSuchElementException here as we \n        // have just checked an element exists.\n        element = parser.next();\n      }\n    } catch (JsonParseException expected) { }\n  }\n}\n"
  },
  {
    "path": "projects/gson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\n# Skip ProGuard because it is only needed for tests (which are skipped as well) and\n# because it would fail since `jmods` JDK folder is removed from this Docker image\nMAVEN_ARGS=\"-DskipTests -Dproguard.skip\"\n# Only build 'gson' Maven module\ncd gson\n$MVN --batch-mode --update-snapshots package ${MAVEN_ARGS}\ncd ..\nfind ./gson -name \"gson-*.jar\" -exec mv {} $OUT/gson.jar \\;\n\nALL_JARS=\"gson.jar\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name 'Fuzz*.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/gson/project.yaml",
    "content": "homepage: \"https://github.com/google/gson\"\nlanguage: jvm\nprimary_contact: \"emcmanus@google.com\"\nmain_repo: \"https://github.com/google/gson\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nfile_github_issue: True\n"
  },
  {
    "path": "projects/gss-ntlmssp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n    autoconf \\\n    docbook-xsl \\\n    gettext \\\n    libkrb5-dev \\\n    libtool \\\n    libunistring-dev \\\n    libxml2-utils \\\n    make \\\n    xsltproc \\\n    zlib1g-dev\nRUN git clone --depth 1 https://github.com/gssapi/gss-ntlmssp\nCOPY *.sh $SRC/\nCOPY fuzzing/ $SRC/gss-ntlmssp/fuzzing/\nWORKDIR $SRC/gss-ntlmssp/\n"
  },
  {
    "path": "projects/gss-ntlmssp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nautoreconf -f -i\n./configure --disable-shared --enable-static --without-wbclient\nmake -j$(nproc)\n\npushd fuzzing/\nmake fuzzer\n\ncp fuzz-accept-sec-context $OUT/\ncp fuzz-accept-sec-context.dict $OUT/\npopd\n"
  },
  {
    "path": "projects/gss-ntlmssp/fuzzing/Makefile",
    "content": "all: fuzzer\n\nfuzzer:\n\t$(CC) $(CFLAGS) $(EXTCFLAGS) -I../include -I../src -c fuzz-accept-sec-context.c\n\t$(CXX) $(CFLAGS) -o fuzz-accept-sec-context fuzz-accept-sec-context.o ../.libs/gssntlmssp.a $(LIB_FUZZING_ENGINE) -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lunistring -lz\n"
  },
  {
    "path": "projects/gss-ntlmssp/fuzzing/fuzz-accept-sec-context.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <string.h>\n\n#include <krb5.h>\n#include <gssapi.h>\n#include \"gss_ntlmssp.h\"\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)\n{\n    OM_uint32 maj_stat, min_stat;\n\n    gss_ctx_id_t ctx = GSS_C_NO_CONTEXT;\n    gss_name_t client_name = GSS_C_NO_NAME;\n    gss_cred_id_t deleg_cred = GSS_C_NO_CREDENTIAL;\n\n    /* Each fuzz input contains multiple tokens preceded by a length field.\n     * Process them in turn with gss_accept_sec_context while\n     * GSS_S_CONTINUE_NEEDED is set\n     */\n    do {\n        unsigned short token_length;\n\n        gss_buffer_desc input_token, output_token = GSS_C_EMPTY_BUFFER;\n\n        if (Size < sizeof(token_length))\n            break;\n\n        token_length = *(unsigned short *)Data;\n\n        Data += sizeof(token_length);\n        Size -= sizeof(token_length);\n\n        if (token_length == 0 || token_length > Size)\n            break;\n\n        input_token.length = token_length;\n        input_token.value = malloc(token_length);\n        memcpy(input_token.value, Data, token_length);\n\n        Data += token_length;\n        Size -= token_length;\n\n        maj_stat = gssntlm_accept_sec_context(\n            &min_stat,\n            &ctx,\n            GSS_C_NO_CREDENTIAL, /* server_creds */\n            &input_token,\n            GSS_C_NO_CHANNEL_BINDINGS, /* input_bindings */\n            &client_name,\n            NULL, /* mech_type */\n            &output_token,\n            NULL, /* ret_flags */\n            NULL, /* time */\n            &deleg_cred\n        );\n\n        gss_release_buffer(&min_stat, &input_token);\n        gss_release_buffer(&min_stat, &output_token);\n    } while(maj_stat == GSS_S_CONTINUE_NEEDED);\n\n    gss_release_name(&min_stat, &client_name);\n    gss_release_cred(&min_stat, &deleg_cred);\n\n    gss_delete_sec_context(&min_stat, &ctx, GSS_C_NO_BUFFER);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/gss-ntlmssp/fuzzing/fuzz-accept-sec-context.dict",
    "content": "\"BAR\\\\foo\"\n\"foo@BAR\"\n\"foo\\\\@bar.example.com\"\n\"foo\\\\@bar.example.com@BAR\"\n\"\\\\foo@bar.example.com\"\n\"BAR\\\\foo@bar.example.com\"\n\"BAR@dom\\\\foo@bar.example.com\"\n"
  },
  {
    "path": "projects/gss-ntlmssp/project.yaml",
    "content": "homepage: \"https://github.com/gssapi/gss-ntlmssp\"\nlanguage: c\nprimary_contact: \"ssorce@redhat.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: \"https://github.com/gssapi/gss-ntlmssp\"\n"
  },
  {
    "path": "projects/gss-ntlmssp/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/gstreamer/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n   apt-get install -y make autoconf automake libtool build-essential pkg-config bison flex patchelf\n\nRUN pip3 install --disable-pip-version-check --no-cache-dir \\\n        pip==25.1.1\nRUN pip3 install --disable-pip-version-check --no-cache-dir \\\n        corpus-replicator \\\n        meson==1.8.2 \\\n        ninja==1.11.1.4\n\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/vorbis.git vorbis\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/ogg.git ogg\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/theora.git theora\n\n# Checkout repository\nRUN git clone --depth 1 --recursive https://gitlab.freedesktop.org/gstreamer/gstreamer.git gstreamer\n\nWORKDIR gstreamer\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/gstreamer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# gstreamer requires autoconf 2.71 minimum which is not available in the Ubuntu 20 base image\n# Skip this step if a newer base image is used\nif grep -q -F \"20.04\" /etc/os-release ; then\n    cd /tmp\n    wget https://archive.ubuntu.com/ubuntu/pool/main/a/autoconf/autoconf_2.71-2_all.deb\n    # Ensure file is not modified or corrupted before install\n    if echo \"96b528889794c4134015a63c75050f93d8aecdf5e3f2a20993c1433f4c61b80e autoconf_2.71-2_all.deb\" | sha256sum --check --status ; then\n        # Install but use G option to prevent downgrade in case this is\n        dpkg -i -G /tmp/autoconf_2.71-2_all.deb\n    fi\nfi\n\n\n$SRC/gstreamer/ci/fuzzing/build-oss-fuzz.sh\n"
  },
  {
    "path": "projects/gstreamer/project.yaml",
    "content": "homepage: \"https://gstreamer.freedesktop.org/\"\nlanguage: c++\nprimary_contact: \"gstreamer-security@lists.freedesktop.org\"\nauto_ccs:\n - \"bilboed@bilboed.com\"\n - \"tim@centricular.com\"\n - \"slomo@coaxion.net\"\n - \"mduponchelle1@gmail.com\"\n - \"saunierthibault@gmail.com\"\n - \"ystreet00@gmail.com\"\n - \"thaytan@noraisin.net\"\n - \"adam@adalogics.com\"\n - \"arthur.chan@adalogics.com\"\n - \"david@adalogics.com\"\nmain_repo: 'https://gitlab.freedesktop.org/gstreamer/gstreamer.git'\n\nfuzzing_engines:\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/guava/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/guava\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/guava"
  },
  {
    "path": "projects/guava/HashingFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.google.common.hash.HashCode;\nimport com.google.common.hash.Hasher;\nimport com.google.common.hash.HashFunction;\nimport com.google.common.hash.Hashing;\nimport java.lang.IllegalStateException;\n\npublic class HashingFuzzer {\n\n\tpublic static class HashInputData {\n\n\t\tpublic HashInputData(FuzzedDataProvider fuzzedDataProvider) {\n\t\t\tm_bool = fuzzedDataProvider.consumeBoolean();\n\t\t\tm_bytes = fuzzedDataProvider.consumeBytes(2);\n\t\t\tm_char = fuzzedDataProvider.consumeChar();\n\t\t\tm_double = fuzzedDataProvider.consumeDouble();\n\t\t\tm_float = fuzzedDataProvider.consumeFloat();\n\t\t\tm_int = fuzzedDataProvider.consumeInt();\n\t\t\tm_long = fuzzedDataProvider.consumeLong();\n\t\t\tm_short = fuzzedDataProvider.consumeShort();\n\t\t\tm_string = fuzzedDataProvider.consumeRemainingAsString();\n\t\t}\n\n\t\tpublic boolean getBoolean() {\n\t\t\treturn m_bool;\n\t\t}\n\n\t\tpublic byte getByte() {\n\t\t\treturn (m_bytes.length > 0) ? m_bytes[0] : (byte)m_int;\n\t\t}\n\n\t\tpublic byte[] getBytes() {\n\t\t\treturn m_bytes;\n\t\t}\n\n\t\tpublic char getChar() {\n\t\t\treturn m_char;\n\t\t}\n\n\t\tpublic double getDouble() {\n\t\t\treturn m_double;\n\t\t}\n\n\t\tpublic float getFloat() {\n\t\t\treturn m_float;\n\t\t}\n\n\t\tpublic int getInt() {\n\t\t\treturn m_int;\n\t\t}\n\n\t\tpublic long getLong() {\n\t\t\treturn m_long;\n\t\t}\n\n\t\tpublic short getShort() {\n\t\t\treturn m_short;\n\t\t}\n\n\t\tpublic String getString() {\n\t\t\treturn m_string;\n\t\t}\n\n\t\tprivate boolean m_bool;\n\t\tprivate byte m_bytes[];\n\t\tprivate char m_char;\n\t\tprivate double m_double;\n\t\tprivate float m_float;\n\t\tprivate int m_int;\n\t\tprivate long m_long;\n\t\tprivate short m_short;\n\t\tprivate String m_string;\n\t}\n\n\tprivate static void testHashCode(HashCode hc) {\n\t\ttry {\n\t\t\thc.bits();\n\n\t\t\ttry {\n\t\t\t\tint i = hc.asInt();\n\t\t\t\tHashCode.fromInt(i);\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t/* documented, ignore */\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tlong l = hc.asLong();\n\t\t\t\tHashCode.fromLong(l);\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t/* documented, ignore */\n\t\t\t}\n\n\t\t\thc.padToLong();\n\t\t\tbyte[] bytes = hc.asBytes();\n\t\t\thc.writeBytesTo(bytes,0,bytes.length);\n\t\t\tHashCode.fromBytes(bytes);\n\n\t\t\tString s = hc.toString();\n\t\t\tHashCode.fromString(s);\n\n\t\t\thc.hashCode();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* ignore */\n\t\t} catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t}\n\n\tprivate static void testHash(HashFunction hash, HashInputData hashInputData) {\n\t\tHashCode hc = null;\n\t\ttry {\n\t\t\tHasher h = hash.newHasher();\n\t\t\th.putBoolean(hashInputData.getBoolean());\n\t\t\th.putByte(hashInputData.getByte());\n\t\t\th.putBytes(hashInputData.getBytes());\n\t\t\th.putChar(hashInputData.getChar());\n\t\t\th.putDouble(hashInputData.getDouble());\n\t\t\th.putFloat(hashInputData.getFloat());\n\t\t\th.putInt(hashInputData.getInt());\n\t\t\th.putLong(hashInputData.getLong());\n\t\t\th.putShort(hashInputData.getShort());\n\t\t\th.putUnencodedChars(hashInputData.getString());\n\t\t\thc = h.hash();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* ignore */\n\t\t} catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\n\t\tif (hc != null) {\n\t\t\ttestHashCode(hc);\n\t\t}\n\n\t\t/*\n\t\t * fromString documents it accepts only well-formated input,\n\t\t * but doesn't document what it does when ill-formated input\n\t\t * is provided. Feed it some fuzz data and find out.\n\t\t */\n\t\ttry {\n\t\t\tHashCode.fromString(hashInputData.getString());\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* ignore */\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace(System.out);\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\t// Choose realistic and valid minimumBits value; this is normally not controlled by the user\n\t\tint minimumBits = fuzzedDataProvider.consumeInt(1, 8192);\n\t\tint seed = fuzzedDataProvider.consumeInt();\n\t\tint k0 = fuzzedDataProvider.consumeInt();\n\t\tint k1 = fuzzedDataProvider.consumeInt();\n\n\t\tHashInputData hashInputData = new HashInputData(fuzzedDataProvider);\n\n\t\t/*\n\t\t * testHash handles exceptions itself, so this try-block\n\t\t * only catches exceptions thrown by Hashing's \"factory\"\n\t\t * functions, none of which is documented to throw\n\t\t * exceptions.\n\t\t */\n\t\ttry {\n\t\t\ttestHash(Hashing.adler32(), hashInputData);\n\t\t\ttestHash(Hashing.crc32(), hashInputData);\n\t\t\ttestHash(Hashing.crc32c(), hashInputData);\n\t\t\ttestHash(Hashing.farmHashFingerprint64(), hashInputData);\n\t\t\ttestHash(Hashing.goodFastHash(minimumBits), hashInputData);\n\t\t\ttestHash(Hashing.murmur3_128(), hashInputData);\n\t\t\ttestHash(Hashing.murmur3_128(seed), hashInputData);\n\t\t\ttestHash(Hashing.murmur3_32(), hashInputData);\n\t\t\ttestHash(Hashing.murmur3_32(seed), hashInputData);\n\t\t\ttestHash(Hashing.md5(), hashInputData);\n\t\t\ttestHash(Hashing.sha1(), hashInputData);\n\t\t\ttestHash(Hashing.sha256(), hashInputData);\n\t\t\ttestHash(Hashing.sha384(), hashInputData);\n\t\t\ttestHash(Hashing.sha512(), hashInputData);\n\t\t\ttestHash(Hashing.sipHash24(), hashInputData);\n\t\t\ttestHash(Hashing.sipHash24(k0, k1), hashInputData);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* ignore */\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.out);\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/guava/HostAndPortFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.google.common.net.HostAndPort;\nimport java.lang.IllegalArgumentException;\n\npublic class HostAndPortFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\ttry {\n\t\t\tHostAndPort hap = HostAndPort.fromString(data.consumeRemainingAsString());\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented to be thrown, ignore */\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.out);\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/guava/HostSpecifierFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.google.common.net.HostSpecifier;\nimport java.text.ParseException;\n\npublic class HostSpecifierFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\ttry {\n\t\t\tHostSpecifier hs = HostSpecifier.from(data.consumeRemainingAsString());\n\n\t\t\t/*\n\t\t\t * hs.toString() is a valid string, as otherwise the\n\t\t\t * HostSpecifier.from() invocation to initialize hs\n\t\t\t * would have thrown an exception.\n\t\t\t */\n\t\t\tif (! HostSpecifier.isValid(hs.toString())) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"toString() generated a poor host specifier\");\n\t\t\t}\n\t\t\ths.hashCode();\n\t\t} catch (ParseException e) {\n\t\t\t/* documented to be thrown, ignore */\n\t\t} catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/guava/InetAddressesFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.google.common.net.InetAddresses;\nimport java.lang.IllegalArgumentException;\nimport java.net.InetAddress;\nimport java.net.Inet4Address;\nimport java.net.Inet6Address;\nimport java.net.UnknownHostException;\n\npublic class InetAddressesFuzzer {\n\n\tprivate static void testInet6ApiSpecificMethods(InetAddress inaddr) {\n\t\tInet6Address inet6 = null;\n\t\tif ((inaddr != null) && (inaddr instanceof Inet6Address)) {\n\t\t\tinet6 = (Inet6Address)inaddr;\n\t\t}\n\t\t\t\n\t\tif (inet6 != null) {\n\t\t\ttry {\n\t\t\t\tInetAddresses.getEmbeddedIPv4ClientAddress(inet6);\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t/* documented, ignore */\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tInetAddresses.TeredoInfo teredoInfo = InetAddresses.getTeredoInfo(inet6);\n\t\t\t\tteredoInfo.getServer();\n\t\t\t\tteredoInfo.getClient();\n\t\t\t\tteredoInfo.getPort();\n\t\t\t\tteredoInfo.getFlags();\n\t\t\t} catch (IllegalArgumentException  e) {\n\t\t\t\t/* documented, ignore */\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tInetAddresses.getCoercedIPv4Address(inet6);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\t\n\t\tInetAddress in6 = null;\n\t\tInetAddress in4 = null;\n\t\ttry {\n\t\t\tin6 = InetAddresses.fromLittleEndianByteArray(data.consumeBytes(16));\n\t\t\tin4 = InetAddresses.fromLittleEndianByteArray(data.consumeBytes(4));\n\t\t} catch (UnknownHostException e) {\n\t\t\t/* documented, ignore */\n\t\t} catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\n\t\ttestInet6ApiSpecificMethods(in6);\n\n\t\tString value = data.consumeRemainingAsString();\n\t\tInetAddress addr = null, uriAddr = null;\n\n\t\ttry {\n\t\t\turiAddr = InetAddresses.forUriString(value);\n\t\t\taddr = InetAddresses.forString(value);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t} catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\n\t\t/*\n\t\t * These don't throw exceptions.\n\t\t */\n\t\ttry {\n\t\t\tInetAddresses.isInetAddress(value);\n\t\t\tInetAddresses.isUriInetAddress(value);\n\t\t\tInetAddresses.isMappedIPv4Address(value);\n\t\t\tInetAddresses.isMappedIPv4Address(value);\n\t\t} catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t\t\n\t\tif (addr != null) {\n\t\t\t/*\n\t\t\t * These don't throw exceptions, either, but need a valid\n\t\t\t * InetAddress instance.\n\t\t\t */\n\t\t\ttry {\n\t\t\t\tInetAddresses.toUriString(addr);\n\t\t\t\tInetAddresses.toAddrString(addr);\n\t\t\t\tInetAddresses.coerceToInteger(addr);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tInetAddresses.increment(addr);\n\t\t\t\tInetAddresses.decrement(addr);\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t/* documented, ignore */\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tInetAddresses.fromIPv6BigInteger(InetAddresses.toBigInteger(addr));\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t/* documented, ignore */\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tInetAddresses.fromIPv4BigInteger(InetAddresses.toBigInteger(addr));\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t/* documented, ignore */\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t\t}\n\t\t}\n\t} \n}"
  },
  {
    "path": "projects/guava/InternetDomainNameFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.google.common.net.InternetDomainName;\nimport java.lang.IllegalArgumentException;\nimport java.lang.IllegalStateException;\n\npublic class InternetDomainNameFuzzer {\n\tprivate static void testAccessorMethods(InternetDomainName idn) {\n\t\tidn.parts();\n\t\tidn.isPublicSuffix();\n\t\tidn.hasPublicSuffix();\n\t\tidn.publicSuffix();\n\t\tidn.isUnderPublicSuffix();\n\t\tidn.isTopPrivateDomain();\n\t\ttry {\n\t\t\tidn.topPrivateDomain();\n\t\t} catch(IllegalStateException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t\tidn.isRegistrySuffix();\n\t\tidn.hasRegistrySuffix();\n\t\tidn.registrySuffix();\n\t\tidn.isUnderRegistrySuffix();\n\t\tidn.isTopDomainUnderRegistrySuffix();\n\t\ttry {\n\t\t\tidn.topDomainUnderRegistrySuffix();\n\t\t} catch(IllegalStateException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t\tidn.hasParent();\n\t\ttry {\n\t\t\tidn.parent();\n\t\t} catch(IllegalStateException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t\tidn.hashCode();\n\t}\n\n\tpublic static void testChild(InternetDomainName idn, String leftParts) {\n\t\ttry {\n\t\t\tidn.child(leftParts);\n\t\t} catch(IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t} catch(NullPointerException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider dataProvider) {\n\t\t\n\t\ttry {\n\t\t\tInternetDomainName idn;\n\t\t\ttry {\n\t\t\t\tidn = InternetDomainName.from(dataProvider.consumeString(dataProvider.remainingBytes()));\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t/*\n\t\t\t\t * documented to be thrown, ignore\n\t\t\t\t */\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttestAccessorMethods(idn);\n\t\t\ttestChild(idn, dataProvider.consumeString(dataProvider.remainingBytes()));\n\n\t    } catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/guava/MediaTypeFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport com.google.common.net.MediaType;\nimport java.lang.IllegalArgumentException;\n\npublic class MediaTypeFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t    String value = data.consumeRemainingAsString();\n\n        try { \n            MediaType.create(value, value);\n            MediaType.parse(value).type();\n            MediaType.create(value, value).withParameter(value, value);\n        } catch (IllegalArgumentException e) { }\n\t} \n}"
  },
  {
    "path": "projects/guava/UrlEscapersFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.google.common.base.Charsets;\nimport com.google.common.escape.Escaper;\nimport com.google.common.net.PercentEscaper;\nimport com.google.common.net.UrlEscapers;\nimport java.lang.IllegalArgumentException;\nimport java.net.URLDecoder;\n\npublic class UrlEscapersFuzzer {\n\n\t/*\n\t * These constants are private members copy-pasted from\n\t * com.google.common.net.UrlEscapers.\n\t */\n\tstatic final String URL_FORM_PARAMETER_OTHER_SAFE_CHARS = \"-_.*\";\n\tstatic final String URL_PATH_OTHER_SAFE_CHARS_LACKING_PLUS =\n\t  \"-._~\" // Unreserved characters.\n\t+ \"!$'()*,;&=\" // The subdelim characters (excluding '+').\n\t+ \"@:\"; // The gendelim characters permitted in paths.\n\n\tprivate static boolean containsUnsafeCharacters(String string, String additionalSafeChars) {\n\t\tString safe = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\t\t\n\t\t/*\n\t\t * The percent character is always safe.\n\t\t */\n\t\tsafe += \"%\";\n\t\t\n\t\tsafe += additionalSafeChars;\n\n\t\tfor (int i = 0; i < string.length(); ++i) {\n\t\t\tif (safe.indexOf(string.charAt(i)) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic static void testUrlEscaper(Escaper escaper, String additionalSafeChars, String sample, boolean plusIsSpace) {\n\t\tString encoded = escaper.escape(sample);\n\n\t\tif (containsUnsafeCharacters(encoded, additionalSafeChars)) {\n\t\t\tthrow new FuzzerSecurityIssueMedium(\"unsafe character was not escaped\");\n\t\t}\n\n\t\tString percentEncoded = encoded.replace(\"+\", (plusIsSpace ? \"%20\" : \"%2B\"));\n\n\t\tString decoded = URLDecoder.decode(percentEncoded, Charsets.UTF_8);\n\n\t\tif (!decoded.equals(sample)) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"escaped sequence not being decoded as expected\");\n\t\t}\n\t}\n\n\tprivate static void testPercentEncoderConstructor(String safe, boolean plusIsSpace) {\n\t\ttry {\n\t\t\tnew PercentEscaper(safe, plusIsSpace);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t} \n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\ttry {\n\t\t\tboolean plusIsSpace = data.consumeBoolean();\n\t\t\tString  value = data.consumeRemainingAsString();\n\t\t\ttestPercentEncoderConstructor(value, plusIsSpace);\n\n\t\t\ttestUrlEscaper(new PercentEscaper(\"\", plusIsSpace),   (plusIsSpace ? \"+\" : \"\"),                       value, plusIsSpace);\n\t\t\ttestUrlEscaper(UrlEscapers.urlFormParameterEscaper(), URL_FORM_PARAMETER_OTHER_SAFE_CHARS + \"+\",      value, true);\n\t\t\ttestUrlEscaper(UrlEscapers.urlFragmentEscaper(),      URL_PATH_OTHER_SAFE_CHARS_LACKING_PLUS + \"+/?\", value, false);\n\t\t\ttestUrlEscaper(UrlEscapers.urlPathSegmentEscaper(),   URL_PATH_OTHER_SAFE_CHARS_LACKING_PLUS + \"+\",   value, false);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* ignore */\n\t\t} catch (Exception e) {\n\t\t\tthrow new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/guava/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN install $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"guava/target/guava-$CURRENT_VERSION.jar\" \"$OUT/guava.jar\"\n\nALL_JARS=\"guava.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/guava/project.yaml",
    "content": "homepage: \"https://github.com/google/guava\"\nlanguage: jvm\nmain_repo: \"https://github.com/google/guava.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"emcmanus@google.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/guetzli/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool libpng-dev pkg-config curl\n\nRUN mkdir afl-testcases\nRUN cd afl-testcases/ && curl https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz | tar -xz\nRUN zip guetzli_fuzzer_seed_corpus.zip afl-testcases/jpeg/full/images/* afl-testcases/jpeg_turbo/full/images/* $SRC/libjpeg-turbo/testimages/\n\nRUN git clone --depth=1 https://github.com/google/guetzli guetzli\nWORKDIR guetzli\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/guetzli/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake guetzli_static\n$CXX $CXXFLAGS -std=c++11 -I. fuzz_target.cc $LIB_FUZZING_ENGINE \\\n  -o $OUT/guetzli_fuzzer bin/Release/libguetzli_static.a\n\ncp $SRC/guetzli_fuzzer_seed_corpus.zip $OUT/\n"
  },
  {
    "path": "projects/guetzli/project.yaml",
    "content": "homepage: \"https://github.com/google/guetzli\"\nlanguage: c++\nprimary_contact: \"robryk@google.com\"\nauto_ccs:\n  - \"szabadka@google.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/google/guetzli'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/guice/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/guice\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/guice"
  },
  {
    "path": "projects/guice/InjectorFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.google.inject.*;\nimport com.google.inject.internal.Annotations;\nimport com.google.inject.internal.InternalFlags;\nimport com.google.inject.matcher.Matchers;\nimport com.google.inject.name.Named;\nimport com.google.inject.CreationException;\nimport com.google.inject.name.Names;\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\nimport static com.google.inject.name.Names.named;\nimport com.google.inject.ConfigurationException;\n\nimport java.lang.annotation.Retention;\nimport java.util.*;\n\npublic class InjectorFuzzer {\n\n    @Retention(RUNTIME)\n    @BindingAnnotation\n    @interface NumericValue {}\n    \n    @Retention(RUNTIME)\n    @BindingAnnotation\n    @interface EnumValue {}\n    \n    @Retention(RUNTIME)\n    @BindingAnnotation\n    @interface ClassName {}\n\n    public enum Bar {\n        TEE,\n        BAZ,\n        BOB\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String value =  data.consumeRemainingAsString();\n\n        try {\n            Injector injector =\n            Guice.createInjector(\n                new AbstractModule() {\n                    @Override\n                    protected void configure() {\n                        bindConstant().annotatedWith(NumericValue.class).to(value);\n                        bindConstant().annotatedWith(EnumValue.class).to(value);\n                        bindConstant().annotatedWith(ClassName.class).to(value);\n                    }\n                });\n\n            DummyClass foo = injector.getInstance(DummyClass.class);\n\n        } catch (CreationException | ConfigurationException e) { }\n    }\n\n    public static class DummyClass {\n        @Inject @EnumValue Bar enumField;\n        @Inject @ClassName Class<?> classField;\n        @Inject @NumericValue Byte byteField;\n    }\n}"
  },
  {
    "path": "projects/guice/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncat > patch.diff <<- EOM\n--- a/pom.xml\t2022-05-05 09:49:53.028735612 +0200\n+++ b/pom.xml\t2022-05-05 09:49:30.445695122 +0200\n@@ -120,7 +120,7 @@\n      | The last stable release version id, used for generating API diffs between released versions\n     -->\n     <guice.lastStableRelease>7.0.0</guice.lastStableRelease>\n-    <guice.skipTests>false</guice.skipTests>\n+    <guice.skipTests>true</guice.skipTests>\n     <gpg.skip>true</gpg.skip>\n   </properties>\n\nEOM\n\ngit apply patch.diff\n\ncd core\ncat > patch2.diff <<- EOM\n--- a/pom.xml\t2022-05-05 13:32:09.413975213 +0200\n+++ b/pom.xml\t2022-05-05 13:33:53.389402985 +0200\n@@ -68,6 +68,24 @@\n\n   <build>\n     <plugins>\n+      <plugin>\n+        <groupId>org.apache.maven.plugins</groupId>\n+        <artifactId>maven-assembly-plugin</artifactId>\n+        <executions>\n+          <execution>\n+            <phase>package</phase>\n+            <goals>\n+              <goal>single</goal>\n+            </goals>\n+            <configuration>\n+              <descriptorRefs>\n+                <descriptorRef>jar-with-dependencies</descriptorRef>\n+              </descriptorRefs>\n+            </configuration>\n+          </execution>\n+        </executions>\n+      </plugin>\n+\n       <!--\n        | Add standard LICENSE and NOTICE files\n       -->\n\nEOM\n\ngit apply patch2.diff\ncd ..\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"core/target/guice-$CURRENT_VERSION-jar-with-dependencies.jar\" \"$OUT/guice.jar\"\n\nALL_JARS=\"guice.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.ReflectiveCall\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/guice/project.yaml",
    "content": "homepage: \"https://github.com/google/guice\"\nlanguage: jvm\nmain_repo: \"https://github.com/google/guice.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/gunicorn/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/benoitc/gunicorn\nWORKDIR gunicorn\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/gunicorn/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/gunicorn/fuzz_util.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from gunicorn import util\n    from gunicorn.errors import AppImportError\n\ndef TestInput(data):\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    util.is_ipv6(fdp.ConsumeString(100))\n    util.warn(fdp.ConsumeString(100))\n    util.split_request_uri(fdp.ConsumeString(100))\n\n    try:\n        util.parse_address(fdp.ConsumeString(100))\n    except RuntimeError as e:\n        if \"is not a valid port number.\" not in str(e):\n            raise e\n\n    try:\n        util.http_date(fdp.ConsumeInt(50))\n    except OSError as e:\n        if \"Value too large for defined data type\" not in str(e):\n            raise e\n    except (OverflowError,ValueError) as e:\n        if \"out of range\" not in str(e):\n            raise e\n\n    try:\n        util.to_bytestring(fdp.ConsumeString(100))\n        util.to_bytestring(fdp.ConsumeString(100),'ascii')\n    except UnicodeEncodeError as e:\n        if \"codec can't encode character\" not in str(e):\n            raise e\n\n    try:\n        util.import_app(fdp.ConsumeString(100))\n    except (ValueError,ImportError,AppImportError) as e:\n        error_list = [\n             \"Empty module name\",\n             \"No module\",\n             \"Failed to parse\",\n             \"Function reference\",\n             \"literal values\",\n             \"attribute name\",\n             \"find attribute\",\n             \"takes\",\n             \"inner\",\n             \"find application object\",\n             \"callable\"\n        ]\n        expected_error = False\n        for error in error_list:\n            if error in str(e):\n                expected_error = True\n        if not expected_error:\n            raise e\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/gunicorn/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/benoitc/gunicorn\nlanguage: python\nmain_repo: https://github.com/benoitc/gunicorn\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/gwt/.gitignore",
    "content": "project-parent/gwt\nproject-parent/tools\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/.cifuzz-corpus\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/gwt/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/json.dict $SRC/JsonArrayFuzzer.dict && \\\n    cp fuzzing/dictionaries/json.dict $SRC/JsonObjectFuzzer.dict && \\\n    cp fuzzing/dictionaries/js.dict $SRC/JsParserFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/JsonArrayFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    zip -j $SRC/JsonObjectFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/gwt\nRUN rm -rf $SRC/project-parent/tools\nRUN apt update && apt install -y openjdk-11-jdk\nRUN git clone --depth 1 https://github.com/gwtproject/gwt/ $SRC/project-parent/gwt\nRUN git clone --depth 1 https://github.com/gwtproject/tools/ $SRC/project-parent/tools\n\nCOPY build.sh $SRC/\nCOPY pom.xml $SRC/project-parent/gwt\nWORKDIR $SRC/"
  },
  {
    "path": "projects/gwt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=gwt\nPROJECT_GROUP_ID=org.gwtproject\nPROJECT_ARTIFACT_ID=gwt-dev\nMAIN_REPOSITORY=https://github.com/gwtproject/gwt/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -Denforcer.skip=true -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n  # build tools for gwt\n  git -C tools pull || git clone https://github.com/gwtproject/tools/ tools\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  mvn -pl $PROJECT install -DskipTests\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-11\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --copy-links --exclude=blacklisted.certs --exclude=*.zip \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # dependency:build-classpath won't work for ant generated jars\n  cp $SRC/project-parent/gwt/build/lib/gwt-dev.jar $OUT/\n  cp $SRC/project-parent/gwt/build/lib/gwt-user.jar $OUT/\n\n  ALL_JARS=\"gwt-dev.jar gwt-user.jar\"\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes:$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\")\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/gwt/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>org.gwtproject</groupId>\n    <artifactId>gwt</artifactId>\n    <version>1</version>\n    <name>gwt</name>\n    <description>gwt</description>\n\n    <properties>\n        <java.version>1.8</java.version>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n    </properties>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-antrun-plugin</artifactId>\n                <version>3.1.0</version>\n                <executions>\n                    <execution>\n                        <id>generate-jars</id>\n                        <phase>install</phase>\n                        <goals>\n                            <goal>run</goal>\n                        </goals>\n                        <configuration>\n                            <target>\n                                <property name=\"compile_classpath\" refid=\"maven.compile.classpath\" />\n                                <property name=\"runtime_classpath\" refid=\"maven.runtime.classpath\" />\n                                <property name=\"test_classpath\" refid=\"maven.test.classpath\" />\n                                <property name=\"plugin_classpath\" refid=\"maven.plugin.classpath\" />\n                                <property name=\"outputDir\" value=\"${project.build.outputDirectory}\" />\n                                <property name=\"sourceDir\" value=\"${project.build.sourceDirectory}\" />\n                                \n                                <ant antfile=\"${basedir}/build.xml\">\n                                    <target name=\"clean\" />\n                                    <target name=\"dist-dev\" />\n                                </ant>\n                            </target>\n                        </configuration>\n                    </execution>\n                </executions>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/gwt/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>1.8</java.version>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.gwtproject</groupId>\n            <artifactId>gwt-user</artifactId>\n            <version>1.0</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../gwt/build/lib/gwt-user.jar</systemPath>\n        </dependency>\n\n        <dependency>\n            <groupId>org.gwtproject</groupId>\n            <artifactId>gwt-dev</artifactId>\n            <version>1.0</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../gwt/build/lib/gwt-dev.jar</systemPath>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/gwt/project-parent/fuzz-targets/src/test/java/com/example/JsParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.IOException;\nimport java.io.StringReader;\n\nimport com.google.gwt.dev.js.ast.JsBlock;\nimport com.google.gwt.dev.js.ast.JsProgram;\nimport com.google.gwt.dev.js.JsParser;\nimport com.google.gwt.dev.js.JsParserException;\nimport com.google.gwt.dev.js.ast.JsRootScope;\nimport com.google.gwt.dev.jjs.SourceInfo;\nimport com.google.gwt.dev.jjs.SourceOrigin;\n\n\nclass JsParserFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        StringReader sr = new StringReader(data.consumeRemainingAsString());\n        try {\n            JsProgram program = new JsProgram();\n            SourceInfo rootSourceInfo = program.createSourceInfo(1, data.consumeString(100));\n            JsBlock block = program.getGlobalBlock();\n            JsParser.parse(SourceOrigin.UNKNOWN, JsRootScope.INSTANCE, sr);\n            JsParser.parseInto(rootSourceInfo, program.getScope(), block, sr);\n        } catch (IOException | JsParserException e) {\n        } catch (RuntimeException e) {\n            // Need to catch this error in order to reach deeper states.\n        }\n    }\n}\n"
  },
  {
    "path": "projects/gwt/project-parent/fuzz-targets/src/test/java/com/example/JsonFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.IOException;\nimport java.io.StringReader;\n\nimport com.google.gwt.dev.json.JsonObject;\nimport com.google.gwt.dev.json.JsonArray;\nimport com.google.gwt.dev.json.JsonException;\n\n\nclass JsonFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        StringReader sr = new StringReader(data.consumeRemainingAsString());\n        try {\n            JsonObject.parse(sr);\n            JsonArray.parse(sr);\n        } catch (JsonException | IOException e) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/gwt/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>gwt</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n\n</project>"
  },
  {
    "path": "projects/gwt/project.yaml",
    "content": "homepage: \"https://www.gwtproject.org/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/gwtproject/gwt/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\nrun_tests: False"
  },
  {
    "path": "projects/h11/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/python-hyper/h11 h11\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/h11\n"
  },
  {
    "path": "projects/h11/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/h11/fuzz_h11.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport h11\n\n\ndef fuzz_headers(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_headers = [(fdp.ConsumeBytes(32), fdp.ConsumeBytes(1024)),\n                  (fdp.ConsumeBytes(32), fdp.ConsumeBytes(1024))]\n  try:\n    normalized_headers = h11._headers.normalize_and_validate(fuzz_headers)\n    get_comma_header(normalized_headers, b'connection')\n    set_comma_header(normalized_headers, fdp.ConsumeBytes(64))\n  except (h11._util.ProtocolError):\n    pass\n\n  try:\n    h11._headers.has_expect_100_continue(\n        h11._events.Request(method='GET',\n                            target='/',\n                            headers=fuzz_headers,\n                            http_version='1.0'))\n  except (h11._util.ProtocolError):\n    pass\n\n\ndef fuzz_receivebuffer(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  rec_buf = h11._receivebuffer.ReceiveBuffer()\n  for i in range(5):\n    rec_buf += fdp.ConsumeBytes(124)\n  rec_buf.maybe_extract_at_most(fdp.ConsumeIntInRange(1, 100))\n  rec_buf.maybe_extract_next_line()\n  rec_buf.maybe_extract_lines()\n\n\ndef fuzz_connection(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  conn = h11.Connection(our_role=h11.CLIENT)\n  event = h11.Request(\n      method=\"GET\",\n      target=\"/get\",\n      headers=[(\"Host\", \"127.0.0.1\"), (\"Connection\", \"close\")],\n  )\n\n  conn.send(event)\n  conn.send(h11.EndOfMessage())\n  conn.next_event()\n  conn.receive_data(fdp.ConsumeBytes(1024))\n\n  try:\n    event2 = h11.Request(\n        method=fdp.ConsumeUnicodeNoSurrogates(5),\n        target=fdp.ConsumeUnicodeNoSurrogates(124),\n        headers=[(fdp.ConsumeUnicodeNoSurrogates(5),\n                  fdp.ConsumeUnicodeNoSurrogates(124)),\n                 (fdp.ConsumeUnicodeNoSurrogates(124),\n                  fdp.ConsumeUnicodeNoSurrogates(124))],\n    )\n\n    conn.send(event2)\n    conn.send(h11.EndOfMessage())\n    conn.next_event()\n    conn.receive_data(fdp.ConsumeBytes(1024))\n  except (h11._util.ProtocolError):\n    pass\n\n\ndef TestOneInput(data):\n  fuzz_headers(data)\n  fuzz_receivebuffer(data)\n  fuzz_connection(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/h11/project.yaml",
    "content": "homepage: https://github.com/python-hyper/h11\nmain_repo: https://github.com/python-hyper/h11\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/h2database/CsvReadBackFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.sql.ResultSet;\nimport java.sql.ResultSetMetaData;\nimport java.sql.SQLException;\nimport java.sql.Types;\nimport org.h2.tools.Csv;\nimport org.h2.tools.SimpleResultSet;\n\npublic class CsvReadBackFuzzer {\n\n    static class TableContent\n    {\n        private static boolean contains(String haystack[], String needle, int n)\n        {\n            while (n-- > 0) {\n                if (haystack[n].equals(needle)) {\n                    return true;\n                }\n            }\n\n            return false;\n        }\n\n        public TableContent(FuzzedDataProvider fuzzedDataProvider) {\n            m_columnCount = fuzzedDataProvider.consumeInt(1,4);\n            m_rowCount    = fuzzedDataProvider.consumeInt(1,100);\n            m_headers     = new String[getColumnCount()];\n            m_content     = new String[getRowCount()][getColumnCount()];\n\n            for (int column = 0; column < getColumnCount(); ++column) {\n                m_headers[column] = \"C_\" + column;\n            }\n\n            for (int row = 0; row < getRowCount(); ++row) {\n                for (int column = 0; column < getColumnCount(); ++column) {\n                    if (row == 0) {\n                        m_content[row][column] = fuzzedDataProvider.consumeAsciiString(8);\n                    } else {\n                        m_content[row][column] = fuzzedDataProvider.consumeRemainingAsAsciiString();\n                    }\n                }\n            }\n        }\n\n        public SimpleResultSet simpleResultSet() {\n            SimpleResultSet rs = new SimpleResultSet();\n            for (int column = 0; column < getColumnCount(); ++column) {\n                /*\n                 * VARCHAR(255) might be insufficient\n                 */\n                rs.addColumn(columnHeader(column), Types.VARCHAR, 255, 0);\n            }\n\n            for (int row = 0; row < getRowCount(); ++row) {\n                rs.addRow(getRow(row));\n            }\n\n            return rs;\n        }\n\n        public String columnHeader(int column) {\n            return m_headers[column];\n        }\n\n        public int getColumnCount() {\n            return m_columnCount;\n        }\n\n        public int getRowCount() {\n            return m_rowCount;\n        }\n\n        public Object[] getRow(int row) {\n            return m_content[row];\n        }\n\n        public String getCell(int row, int column) {\n            return m_content[row][column];\n        }\n\n        int m_columnCount;\n        int m_rowCount;\n\n        String m_headers[];\n        String m_content[][];\n    };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n        TableContent data = new TableContent(fuzzedDataProvider);\n\n        ByteArrayOutputStream outStream = new ByteArrayOutputStream();\n        OutputStreamWriter writer = new OutputStreamWriter(outStream);\n        \n        try {\n            new Csv().write(writer, data.simpleResultSet());\n        } catch (SQLException ex) {\n            /* documented, ignore */\n            return;\n        }\n\n        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());\n        InputStreamReader reader = new InputStreamReader(inStream);\n        ResultSet resultSet = null;\n        \n        try {\n            resultSet = new Csv().read(reader, null);\n        } catch (IOException e) {\n            return;\n        }\n\n        try {\n            ResultSetMetaData meta = resultSet.getMetaData();\n            if (meta.getColumnCount() != data.getColumnCount()) {\n                throw new FuzzerSecurityIssueLow(\"Column Count Mismatch\");\n            }\n\n            for (int column = 0; column < meta.getColumnCount(); ++column) {\n                String have = meta.getColumnLabel(column + 1);\n                String want = data.columnHeader(column);\n                if ( ! have.equals(want) ) {\n                    System.out.println(\"\\'\" + have + \"\\'  !=  \\'\" + want + \"\\'\");\n                    throw new FuzzerSecurityIssueLow(\"Column Label Mismatch\");\n                }\n            }\n            int row = 0;\n            while (resultSet.next()) {\n                for (int column = 0; column < meta.getColumnCount(); ++column) {\n                    String have = resultSet.getString(column + 1);\n                    String want = data.getCell(row, column);\n                    if ( ! have.equals( want ) ) {\n                        System.out.println(\"\\'\" + have + \"\\'  !=  \\'\" + want + \"\\'\");\n                        throw new FuzzerSecurityIssueLow(\"Cell Value Mismatch\");\n                    }\n                }\n                ++row;\n            }\n            if (row != data.getRowCount()) {\n                throw new FuzzerSecurityIssueLow(\"Row Count Mismatch\");\n            }\n            resultSet.close();\n        } catch (SQLException ex) {\n            /* documented, but shouldn't happen on our well-known input */\n            ex.printStackTrace(System.out);\n            throw new FuzzerSecurityIssueLow(\"SQLException??\");\n        }\n    }\n}"
  },
  {
    "path": "projects/h2database/CsvReadFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.sql.ResultSet;\nimport java.sql.ResultSetMetaData;\nimport java.sql.SQLException;\nimport java.sql.Types;\nimport org.h2.tools.Csv;\n\npublic class CsvReadFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n        ByteArrayInputStream inStream = new ByteArrayInputStream(fuzzedDataProvider.consumeRemainingAsBytes());\n        InputStreamReader reader = new InputStreamReader(inStream);\n        \n        try {\n            new Csv().read(reader, null);\n        } catch (IOException e) {\n            /* ignore */\n        } catch (Exception e) {\n            throw new FuzzerSecurityIssueLow(\"Undocumented Exception\");\n        }\n    }\n}"
  },
  {
    "path": "projects/h2database/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/h2database/h2database.git\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/h2database"
  },
  {
    "path": "projects/h2database/ServerLoginFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.h2.tools.Server;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.PreparedStatement;\n\npublic class ServerLoginFuzzer extends TestServer {\n\n\tServerLoginFuzzer(String password, boolean verbose) throws SQLException {\n\t\tsuper(password, verbose);\n\t}\n\n\tpublic String getTestName() {\n\t\treturn getClass().getSimpleName();\n\t}\n\n\tstatic void testOneInput(String fuzzyString, boolean verbose) {\n\t\tServerLoginFuzzer server;\n\t\ttry {\n\t\t\tserver = new ServerLoginFuzzer(\"\", verbose);\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace(System.out);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tserver.getConnection(fuzzyString);\n\t\t} catch (SQLException ex) {\n\t\t\t/* ignore failed login attempts */\n\t\t\tserver.diagnostic(\"failed to get a connection\");\n\t\t}\n\n\t\tif ( ! server.isRunning() ) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"Login attempt caused Server to crash\");\n\t\t}\n\t\ttry {\n\t\t\tserver.stop();\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"Why can't we shutdown the server?\");\n\t\t}\n\t}\n\t\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\ttestOneInput(fuzzedDataProvider.consumeRemainingAsAsciiString(), false);\n\t}\n}"
  },
  {
    "path": "projects/h2database/ShellFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.h2.tools.Shell;\nimport java.io.ByteArrayOutputStream;\nimport java.io.PrintStream;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic class ShellFuzzer extends TestServer {\n\t\n\tShellFuzzer(boolean verbose) throws SQLException {\n\t\tsuper(\"myH2DBPassword\", verbose);\n\t}\n\n\tpublic String getTestName() {\n\t\treturn getClass().getSimpleName();\n\t}\n\n\tstatic void testOneInput(String fuzzyString, boolean verbose) {\n\t\tSqlStatementFuzzer server;\n\t\ttry {\n\t\t\tserver = new SqlStatementFuzzer(verbose);\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace(System.out);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tShell shell = new Shell();\n\t\t\tshell.setErr(new PrintStream(new ByteArrayOutputStream()));\n\t\t\tshell.setOut(new PrintStream(new ByteArrayOutputStream()));\n\t\t\tshell.runTool(new String[]{\"-url\", server.getConnectionURL(), \"-password\", server.getDatabasePassword(), \"-sql\", fuzzyString});\n\t\t} catch (SQLException ex) {\n\t\t\t/* ignore */\n\t\t} catch (Exception ex) {\n\t\t\tserver.diagnostic(\"unexpected exception on the client side...\");\n\t\t}\n\t\t\n\t\tif ( ! server.isRunning() ) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"Shell caused server crash\");\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tserver.stop();\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"Why can't we shutdown the server?\");\n\t\t}\n\t}\n\t\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\ttestOneInput(fuzzedDataProvider.consumeRemainingAsAsciiString(), false);\n\t}\n}"
  },
  {
    "path": "projects/h2database/SqlPreparedStatementFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.h2.tools.Server;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic class SqlPreparedStatementFuzzer extends TestServer {\n\t\n\tSqlPreparedStatementFuzzer(boolean verbose) throws SQLException {\n\t\tsuper(\"myH2DBPassword\", verbose);\n\t}\n\n\tpublic String getTestName() {\n\t\treturn getClass().getSimpleName();\n\t}\n\n\tstatic void testOneInput(String fuzzyString, boolean verbose) {\n\t\tSqlStatementFuzzer server;\n\t\ttry {\n\t\t\tserver = new SqlStatementFuzzer(verbose);\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace(System.out);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tConnection connection = server.getConnection();\n\t\t\tconnection.createStatement().executeUpdate(\"DROP TABLE IF EXISTS t; CREATE TABLE t (x VARCHAR(255));\");\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(\"INSERT INTO t(x) VALUES(?)\");\n\t\t\tpreparedStatement.setString(1, fuzzyString);\n\t\t\tpreparedStatement.executeUpdate();\n\t\t\tserver.diagnostic(\"insert performed\");\n\t\t} catch (SQLException ex) {\n\t\t\t/* ignore */\n\t\t\tserver.diagnostic(\"insert not executed\");\n\t\t\tserver.diagnostic(ex);\n\t\t}\n\t\t\n\t\tif ( ! server.isRunning() ) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"SQL Statement caused server crash\");\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tserver.stop();\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"Why can't we shutdown the server?\");\n\t\t}\n\t}\n\t\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\ttestOneInput(fuzzedDataProvider.consumeRemainingAsAsciiString(), false);\n\t}\n}"
  },
  {
    "path": "projects/h2database/SqlStatementFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.h2.tools.Server;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic class SqlStatementFuzzer extends TestServer {\n\t\n\tSqlStatementFuzzer(boolean verbose) throws SQLException {\n\t\tsuper(\"myH2DBPassword\", verbose);\n\t}\n\n\tpublic String getTestName() {\n\t\treturn getClass().getSimpleName();\n\t}\n\n\tstatic void testOneInput(String fuzzyString, boolean verbose) {\n\t\tSqlStatementFuzzer server;\n\t\ttry {\n\t\t\tserver = new SqlStatementFuzzer(verbose);\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace(System.out);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tConnection connection = server.getConnection();\n\t\t\tconnection.createStatement().executeUpdate(fuzzyString);\n\t\t\tserver.diagnostic(\"statement executed\");\n\t\t} catch (SQLException ex) {\n\t\t\t/* ignore */\n\t\t\tserver.diagnostic(\"statement not executed\");\n\t\t\tserver.diagnostic(ex);\n\t\t}\n\t\t\n\t\tif ( ! server.isRunning() ) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"SQL Statement caused server crash\");\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tserver.stop();\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new FuzzerSecurityIssueHigh(\"Why can't we shutdown the server?\");\n\t\t}\n\t}\n\t\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\ttestOneInput(fuzzedDataProvider.consumeRemainingAsAsciiString(), false);\n\t}\n}"
  },
  {
    "path": "projects/h2database/TestServer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.h2.tools.Server;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.PreparedStatement;\n\npublic class TestServer {\n\n\tprivate static String g_shutdownPassword = \"ServerShutdownPassword\"; // needs to be non-empty string\n\tprivate Server m_server = null;\n\tprivate boolean m_verbose;\n\tprivate String m_password;\n\n\tString getDatabasePassword() {\n\t\treturn m_password;\n\t}\n\n\tvoid diagnostic(String message) {\n\t\tif (m_verbose) {\n\t\t\tSystem.out.println(message);\n\t\t}\n\t}\n\n\tvoid diagnostic(Exception ex) {\n\t\tif (m_verbose) {\n\t\t\tex.printStackTrace(System.out);\n\t\t}\n\t}\n\n\tTestServer(String password, boolean verbose) throws SQLException {\n\t\tm_verbose = verbose;\n\t\tm_password = password;\n\n\t\tString args[] = new String[]{ \"-tcpPassword\", g_shutdownPassword, \"-ifNotExists\", \"-tcpDaemon\" };\n\t\tm_server = Server.createTcpServer(args).start();\n\t\tdiagnostic(\"Server started\");\n\n\t\ttry {\n\t\t\t// passwords default to empty string/null\n\t\t\tsetPassword(\"\", password);\n\t\t} catch (SQLException ex) {\n\t\t\tsetPassword(password, password);\n\t\t}\n\t}\n\n\tString getConnectionURL() {\n\t\treturn \"jdbc:h2:\" + m_server.getURL() + \"/~/\" + getTestName() + \";\";\n\t}\n\n\tConnection getConnection() throws SQLException {\n\t\treturn getConnection(\"PASSWORD=\" + getDatabasePassword() + \";\");\n\t}\n\n\tConnection getConnection(String options) throws SQLException {\n\t\tConnection connection = DriverManager.getConnection(getConnectionURL() + options, null, null);\n\t\t\n\t\tDatabaseMetaData metaData = connection.getMetaData();\n\t\tdiagnostic(\"Connected to \" + metaData.getDatabaseProductName() + \"-\" + metaData.getDatabaseProductVersion() + \" via \" + metaData.getURL());\n\n\t\treturn connection;\n\t}\n\n\tvoid setPassword(String oldPassword, String newPassword) throws SQLException {\n\t\tConnection connection = getConnection(\"PASSWORD=\" + oldPassword);\n\t\tPreparedStatement statement = connection.prepareStatement(\"SET PASSWORD ?\");\n\t\tstatement.setString(1, newPassword);\n\t\tstatement.executeUpdate();\n\t\tdiagnostic(\"Password reset.\");\n\t}\n\n\tboolean isRunning() {\n\t\treturn m_server.isRunning(true);\n\t}\n\n\tvoid stop() throws SQLException {\n\t\tm_server.shutdownTcpServer(m_server.getURL(), g_shutdownPassword, true, true);\n\t\tm_server.stop();\n\t\tdiagnostic(\"Server stopped\");\n\t}\n\n\tpublic String getTestName() {\n\t\treturn getClass().getSimpleName();\n\t}\n}\n"
  },
  {
    "path": "projects/h2database/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd h2\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/h2-$CURRENT_VERSION.jar\" \"$OUT/h2.jar\"\npopd\n\nALL_JARS=\"h2.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH $SRC/*.java\ncp $SRC/*.class $OUT/\n\n# generate jazzer start script\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  #javac -cp $SRC:$BUILD_CLASSPATH $fuzzer\n  #cp $SRC/$fuzzer_basename.class $OUT/\n  #for member_class in $(find $SRC -maxdepth 1 -name \"$fuzzer_basename\\$*.class\"); do\n  #  cp $member_class $OUT/\n  #done\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.SqlInjection\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/h2database/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://h2database.com/\"\nlanguage: jvm\nmain_repo: \"https://github.com/h2database/h2database.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/h2o/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev\nRUN git clone https://github.com/h2o/h2o\nWORKDIR h2o\nCOPY build.sh $SRC/\nCOPY *.options $SRC/\n"
  },
  {
    "path": "projects/h2o/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd $SRC/h2o\ncmake -DBUILD_FUZZER=ON -DOSS_FUZZ=ON -DOPENSSL_USE_STATIC_LIBS=TRUE .\nmake\ncp ./h2o-fuzzer-* $OUT/\n\nzip -jr $OUT/h2o-fuzzer-http1_seed_corpus.zip $SRC/h2o/fuzz/http1-corpus\nzip -jr $OUT/h2o-fuzzer-http2_seed_corpus.zip $SRC/h2o/fuzz/http2-corpus\nzip -jr $OUT/h2o-fuzzer-http3_seed_corpus.zip $SRC/h2o/fuzz/http3-corpus\nzip -jr $OUT/h2o-fuzzer-url_seed_corpus.zip $SRC/h2o/fuzz/url-corpus\n\ncp $SRC/*.options $SRC/h2o/fuzz/*.dict $OUT/\npopd\n"
  },
  {
    "path": "projects/h2o/h2o-fuzzer-http1.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\nmax_len = 16384\ndict = http.dict\n"
  },
  {
    "path": "projects/h2o/h2o-fuzzer-http2.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\nmax_len = 16384\ndict = http.dict\n"
  },
  {
    "path": "projects/h2o/h2o-fuzzer-http3.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\nmax_len = 16384\ndict = http.dict\n"
  },
  {
    "path": "projects/h2o/h2o-fuzzer-url.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\n"
  },
  {
    "path": "projects/h2o/project.yaml",
    "content": "homepage: \"https://github.com/h2o/h2o\"\nlanguage: c++\nprimary_contact: \"jonathan.foote@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nauto_ccs:\n  - \"frederik.deweerdt@gmail.com\"\n  - \"kazuhooku@gmail.com\"\n  - \"i.nagata110@gmail.com\"\n  - \"hfujita@fastly.com\"\n  - \"security@fastly.com\"\n  - \"mtakayama@fastly.com\"\n  - \"gfuji@fastly.com\"\n  - \"nalramli@fastly.com\"\n  - \"ethompson@fastly.com\"\n\nmain_repo: 'https://github.com/h2o/h2o'\n"
  },
  {
    "path": "projects/h3/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config\nRUN git clone --depth 1 https://github.com/uber/h3\nWORKDIR h3\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/h3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\ncmake -DBUILD_TESTING=ON ..\nmake -j$(nproc) all\n\nH3_BASE=/src/h3/\n\nfor fuzzer in $(find $H3_BASE/src/apps/fuzzers -name '*.c'); do\n  fuzzer_basename=$(basename -s .c $fuzzer)\n  # H3_USE_LIBFUZZER is needed so that H3 does not try to build its own\n  # implementation of `main`\n  $CC $CFLAGS -DH3_PREFIX=\"\" \\\n    -DH3_USE_LIBFUZZER=1 \\\n    -I$H3_BASE/src/apps/applib/include \\\n    -I$H3_BASE/src/h3lib/include \\\n    -I$H3_BASE/build/src/h3lib/include \\\n    -o $fuzzer_basename.o \\\n    -c $fuzzer\n\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE -rdynamic \\\n    $fuzzer_basename.o \\\n    -o $OUT/$fuzzer_basename \\\n    lib/libh3.a\ndone\n"
  },
  {
    "path": "projects/h3/project.yaml",
    "content": "homepage: \"https://github.com/uber/h3\"\nlanguage: c\nprimary_contact: \"isaacnf0x@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"h3-dev@googlegroups.com\"\n  - \"isv.damocles@gmail.com\"\n  - \"ajfriend@gmail.com\"\n  - \"nick.rabinowitz@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/uber/h3'\n"
  },
  {
    "path": "projects/h3/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd build\nmake test\n"
  },
  {
    "path": "projects/h5py/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y pkg-config libhdf5-dev\nRUN pip3 install --upgrade pip Cython numpy\nRUN git clone https://github.com/h5py/h5py h5py\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/h5py\n"
  },
  {
    "path": "projects/h5py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/h5py/fuzz_h5f.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport h5py\nfrom h5py import h5f, h5p\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  image = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n\n  fapl = h5p.create(h5py.h5p.FILE_ACCESS)\n  fapl.set_fapl_core()\n  try:\n    fapl.set_file_image(image)\n  except ValueError:\n    return\n  except TypeError:\n    return\n\n  fid = h5f.open(\"/tmp/tmpf.h5p\", h5py.h5f.ACC_RDONLY, fapl=fapl)\n  f = h5py.File(fid)\n \n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/h5py/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/h5py/h5py\nlanguage: python\nmain_repo: https://github.com/h5py/h5py\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/hadoop/.gitignore",
    "content": "project-parent/hadoop\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/hadoop/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/hadoop\nRUN git clone --depth 1 https://github.com/apache/hadoop/ $SRC/project-parent/hadoop\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/hadoop/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=hadoop\nPROJECT_GROUP_ID=org.apache.hadoop\nPROJECT_ARTIFACT_ID=hadoop\nMAIN_REPOSITORY=https://github.com/apache/hadoop/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  FUZZ_TARGET_DEPENDENCIES=\":hadoop-common\"\n  \n   for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/hadoop/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.hadoop</groupId>\n            <artifactId>hadoop-common</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/hadoop/project-parent/fuzz-targets/src/test/java/com/example/FileUtilFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.apache.hadoop.fs.*;\n\nimport java.io.*;\nimport java.util.concurrent.ExecutionException;\n\n\nclass FileUtilFuzzer {\n    static String currentDir = new File(\"\").getAbsolutePath();\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            boolean b = data.consumeBoolean();\n            byte[] b1 = data.consumeBytes(5000);\n            byte[] b2 = data.consumeRemainingAsBytes();\n\n            FileUtil.unZip(new ByteArrayInputStream(b1), new File(currentDir));\n            FileUtil.unTar(new ByteArrayInputStream(b2), new File(currentDir), b);\n        } catch (IOException | ExecutionException | InterruptedException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/hadoop/project-parent/fuzz-targets/src/test/java/com/example/JavaSerializationFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.apache.hadoop.io.serializer.*;\nimport org.apache.hadoop.io.DataInputBuffer;\nimport org.apache.hadoop.io.DataOutputBuffer;\n\nimport java.io.IOException;\n\n\nclass JavaSerializationFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        String s = data.consumeString(5000);\n        String d = data.consumeRemainingAsString();\n\n        Serialization ser = new JavaSerialization();\n        try {\n            Serializer<String> serializer = ser.getSerializer(String.class);\n            DataOutputBuffer dob = new DataOutputBuffer();\n            serializer.open(dob);\n            serializer.serialize(s);\n            serializer.close();\n\n            Deserializer<String> deserializer = ser.getDeserializer(String.class);\n            DataInputBuffer dib = new DataInputBuffer();\n            dib.reset(d.getBytes(), d.length());\n            deserializer.open(dib);\n            deserializer.deserialize(null);\n            deserializer.close();\n        } catch (IOException e) {\n        } catch (ClassCastException | ArrayIndexOutOfBoundsException | NegativeArraySizeException | NullPointerException e) {\n            // Need to catch in order to find more interesting findings.\n        }\n    }\n}"
  },
  {
    "path": "projects/hadoop/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>hadoop</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/hadoop/project.yaml",
    "content": "homepage: \"https://hadoop.apache.org/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/hadoop/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/halide/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y ninja-build lsb-core software-properties-common zlib1g-dev\nRUN pip3 install -U cmake\n\nRUN git clone --depth 1 --branch llvmorg-15.0.0 https://github.com/llvm/llvm-project.git $SRC/llvm-project\nRUN git clone --depth 1 https://github.com/halide/Halide.git halide\n\nWORKDIR halide\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/halide/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################ \nset euox pipefail\n\nexport LDFLAGS=\"-fuse-ld=lld\"\n\ndeclare -A LLVM_SANITIZER=( [\"address\"]=\"Address\" [\"undefined\"]=\"Undefined\" [\"memory\"]=\"Memory\" )\n\nif [[ -v LLVM_SANITIZER[$SANITIZER] ]]; then\n  LLVM_SANITIZER_FLAG=\"-DLLVM_USE_SANITIZER=${LLVM_SANITIZER[$SANITIZER]}\" \nelse\n  LLVM_SANITIZER_FLAG=\"\"\nfi\n\ncmake -DCMAKE_BUILD_TYPE=Release \\\n        -DLLVM_ENABLE_PROJECTS=\"clang\" \\\n        -DLLVM_TARGETS_TO_BUILD=\"X86\" \\\n        $LLVM_SANITIZER_FLAG \\\n        -DLLVM_ENABLE_TERMINFO=OFF \\\n        -DLLVM_ENABLE_ASSERTIONS=ON \\\n        -DLLVM_ENABLE_EH=OFF \\\n        -DLLVM_ENABLE_RTTI=OFF \\\n        -DLLVM_BUILD_32_BITS=OFF \\\n        -DLLVM_INCLUDE_BENCHMARKS=OFF \\\n        -DLLVM_INCLUDE_EXAMPLES=OFF \\\n        -DLLVM_INCLUDE_TESTS=OFF \\\n        -DCMAKE_INSTALL_MODE=ABS_SYMLINK \\\n        -S $SRC/llvm-project/llvm -B $WORK/llvm-build\ncmake --build $WORK/llvm-build -j$(nproc)\ncmake --install $WORK/llvm-build --prefix $WORK/llvm-install\n\n# Cleanup space so github runners don't run out of disk space.\nrm -rf $WORK/llvm-build $SRC/llvm-project\n\nexport LLVM_DIR=$WORK/llvm-install\n\ncmake -G Ninja  -S . -B build -DCMAKE_BUILD_TYPE=Release \\\n  -DTARGET_WEBASSEMBLY=OFF \\\n  -DWITH_TUTORIALS=OFF \\\n  -DWITH_UTILS=OFF \\\n  -DWITH_PYTHON_BINDINGS=OFF \\\n  -DWITH_TESTS=ON \\\n  -DWITH_TEST_AUTO_SCHEDULE=OFF \\\n  -DWITH_TEST_CORRECTNESS=OFF \\\n  -DWITH_TEST_ERROR=OFF \\\n  -DWITH_TEST_WARNING=OFF \\\n  -DWITH_TEST_PERFORMANCE=OFF \\\n  -DWITH_TEST_RUNTIME=OFF \\\n  -DWITH_TEST_GENERATOR=OFF \\\n  -DWITH_TEST_FUZZ=ON \\\n  -DBUILD_SHARED_LIBS=OFF\n\ncmake --build ./build --target build_fuzz -j$(nproc)\n\ncp ./build/test/fuzz/fuzz_* $OUT\n"
  },
  {
    "path": "projects/halide/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://halide-lang.org/\"\nlanguage: c++\nprimary_contact: \"srj@google.com\"\nmain_repo: \"https://github.com/halide/Halide\"\nfile_github_issue: false\nauto_ccs:\n  - alex.reinking@gmail.com\n  - nathaniel.brough@gmail.com\n\nfuzzing_engines:\n - honggfuzz\n - libfuzzer\n\nsanitizers:\n - address\n # LLVM isn't building with Undefined sanitizer\n # - undefined\n"
  },
  {
    "path": "projects/hamcrest/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone https://github.com/hamcrest/JavaHamcrest.git hamcrest\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/hamcrest\n"
  },
  {
    "path": "projects/hamcrest/HamcrestFuzzer.java",
    "content": "\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport java.util.*;\nimport java.util.regex.*;\nimport javax.xml.xpath.*;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\nimport javax.xml.transform.Transformer;\nimport javax.xml.transform.TransformerException;\nimport javax.xml.transform.TransformerFactory;\nimport javax.xml.transform.dom.DOMSource;\nimport org.w3c.dom.Attr;\nimport org.w3c.dom.DOMException;\nimport org.w3c.dom.Document;\nimport org.w3c.dom.Element;\nimport java.util.HashMap;\n\npublic class HamcrestFuzzer {\n\n  HashMap<String, String> hashMap = new HashMap<String, String>();\n  HashMap<String, String> hashMap2 = new HashMap<String, String>();\n\n  public HamcrestFuzzer(FuzzedDataProvider data) {\n  }\n\n  public void runTest(FuzzedDataProvider data) {\n\n    hashMap.put(data.consumeString(10), data.consumeString(10));\n    hashMap2.put(data.consumeString(10), data.consumeString(10));\n\n    try {\n      assertThat(data.consumeString(10), containsString(data.consumeString(10)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10),allOf(startsWith(data.consumeString(10)), containsString(data.consumeString(10))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(hashMap, is(hashMap2));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(hashMap2, is(aMapWithSize(2)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(hashMap2, is(anEmptyMap()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(Arrays.asList(data.consumeString(10), data.consumeString(10)), hasSize(equalTo(2)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(new ArrayList<String>() { { add(data.consumeString(10)); add(data.consumeString(10));}}, is(empty()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(new ArrayList<String>() {{ add(data.consumeString(10)); add(data.consumeString(10));}}, is(emptyCollectionOf(String.class)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(new ArrayList<String>() {{add(data.consumeString(10));add(data.consumeString(10));}}, is(emptyIterable()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(new ArrayList<String>() {{add(data.consumeString(10));add(data.consumeString(10));}}, is(emptyIterableOf(String.class)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(Arrays.asList(data.consumeString(10), data.consumeString(10)),contains(equalTo(data.consumeString(10)), equalTo(data.consumeString(10))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(Arrays.asList(data.consumeString(10), data.consumeString(10)),containsInAnyOrder(Arrays.asList(equalTo(data.consumeString(10)), equalTo(data.consumeString(10)))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(hashMap, hasEntry(equalTo(data.consumeString(10)), equalTo(data.consumeString(10))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(hashMap, hasKey(equalTo(data.consumeString(10))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(hashMap, hasValue(data.consumeString(10)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), is(in(Arrays.asList(data.consumeString(10), data.consumeString(10)))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), isOneOf(data.consumeString(10), data.consumeString(10)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), is(oneOf(data.consumeString(10), data.consumeString(10))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeDouble(), is(closeTo(data.consumeDouble(), data.consumeDouble())));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeDouble(), is(notANumber()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeInt(), comparesEqualTo(data.consumeInt()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeInt(), greaterThan(data.consumeInt()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeInt(), greaterThanOrEqualTo(data.consumeInt()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeInt(), lessThan(data.consumeInt()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeInt(), lessThanOrEqualTo(data.consumeInt()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), equalToIgnoringCase(data.consumeString(10)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), is(emptyString()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), is(blankString()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeInt(), lessThanOrEqualTo(data.consumeInt()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), equalToIgnoringCase(data.consumeString(10)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), is(emptyOrNullString()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), is(blankOrNullString()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), matchesPattern(data.consumeString(10)));\n    } catch (AssertionError | PatternSyntaxException e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10),stringContainsInOrder(Arrays.asList(data.consumeString(10), data.consumeString(10))));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeString(10), hasLength(data.consumeInt()));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(data.consumeBoolean(), hasToString(data.consumeString(10)));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      assertThat(Integer.class, typeCompatibleWith(Number.class));\n    } catch (AssertionError e) {\n      // documented ignore\n    }\n\n    try {\n      DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();\n      DocumentBuilder documentBuilder = documentFactory.newDocumentBuilder();\n      Document document = documentBuilder.newDocument();\n\n      Element root = document.createElement(data.consumeString(10));\n      document.appendChild(root);\n\n      Element employee = document.createElement(data.consumeString(10));\n      root.appendChild(employee);\n\n      assertThat(root, hasXPath(data.consumeString(10), equalTo(data.consumeString(10))));\n    } catch (AssertionError | DOMException | IllegalArgumentException | ParserConfigurationException e) {\n      // documented ignore\n    }\n\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    HamcrestFuzzer testClosure = new HamcrestFuzzer(data);\n    testClosure.runTest(data);\n  }\n\n}\n"
  },
  {
    "path": "projects/hamcrest/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nALL_JARS=\"\"\n\npushd \"${SRC}/hamcrest\"\n\t./gradlew jar\n  install -v ./hamcrest/build/libs/hamcrest-*-SNAPSHOT.jar \"$OUT/hamcrest.jar\"\n\tALL_JARS=\"${ALL_JARS} hamcrest.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/hamcrest/project.yaml",
    "content": "homepage: http://hamcrest.org/\nlanguage: jvm\nmain_repo: https://github.com/hamcrest/JavaHamcrest.git\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/haproxy/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libpcre2-dev zlib1g-dev\nRUN git clone https://github.com/haproxy/haproxy\nRUN git clone https://code.vinyl-cache.org/vtest/VTest2\n\nWORKDIR $SRC/haproxy\n\nCOPY build.sh run_tests.sh $SRC/\nCOPY fuzz* $SRC/\n"
  },
  {
    "path": "projects/haproxy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nexport ORIG_CFLAGS=${CFLAGS}\ncd $SRC/haproxy\n\n# Fix some things in the Makefile where there are no options available\nsed 's/COPTS += $(DEBUG) $(OPTIONS_CFLAGS) $(CFLAGS) $(ADDINC)/COPTS += $(DEBUG) $(OPTIONS_CFLAGS) $(CFLAGS) $(ADDINC) ${ORIG_CFLAGS}/g' -i Makefile\nsed 's/LDOPTS = $(TARGET_LDFLAGS) $(OPTIONS_LDFLAGS) $(ADDLIB)/LDOPTS = $(TARGET_LDFLAGS) $(OPTIONS_LDFLAGS) $(ADDLIB) ${CXXFLAGS}/g' -i Makefile\nmake TARGET=generic CC=${CC} LD=${CXX} \n\n# Make a copy of the main file since it has many global functions we need to declare\n# We dont want the main function but we need the rest of the stuff in haproxy.c\ncd /src/haproxy\nsed 's/int main(int argc/int main2(int argc/g' -i ./src/haproxy.c\nsed 's/dladdr(main,/dladdr(main2,/g' -i ./src/tools.c\nsed 's/(void*)main/(void*)main2/g' -i ./src/tools.c\n\n\nSETTINGS=\"-Iinclude -g -DUSE_POLL -DUSE_TPROXY -DCONFIG_HAPROXY_VERSION=\\\"\\\" -DCONFIG_HAPROXY_DATE=\\\"\\\"\"\n\n$CC $CFLAGS $SETTINGS -c -o ./src/haproxy.o ./src/haproxy.c\nar cr libhaproxy.a ./src/*.o\n\nfor fuzzer in hpack_decode cfg_parser; do\n  cp $SRC/fuzz_${fuzzer}.c .\n  $CC $CFLAGS $SETTINGS -c fuzz_${fuzzer}.c  -o fuzz_${fuzzer}.o\n  $CXX -g $CXXFLAGS $LIB_FUZZING_ENGINE  fuzz_${fuzzer}.o libhaproxy.a -o $OUT/fuzz_${fuzzer}\ndone\n\n# build vtest for run_tests.sh\ncd $SRC/VTest2\nmake vtest\n# vtest binary is in $SRC/VTest2/vtest\n"
  },
  {
    "path": "projects/haproxy/fuzz_cfg_parser.c",
    "content": "/*\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <haproxy/cfgparse.h>\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  struct cfgfile dummy_cfg = {\n      .filename = \"fuzzer\",\n      .content = (const char *)data,\n      .size = size,\n  };\n  if (size < 50)\n    return 0;\n\n  parse_cfg(&dummy_cfg);\n  return 0;\n}\n"
  },
  {
    "path": "projects/haproxy/fuzz_hpack_decode.c",
    "content": "/*\n * # Copyright 2020 Google Inc.\n * #\n * # Licensed under the Apache License, Version 2.0 (the \"License\");\n * # you may not use this file except in compliance with the License.\n * # You may obtain a copy of the License at\n * #\n * #      http://www.apache.org/licenses/LICENSE-2.0\n * #\n * # Unless required by applicable law or agreed to in writing, software\n * # distributed under the License is distributed on an \"AS IS\" BASIS,\n * # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * # See the License for the specific language governing permissions and\n * # limitations under the License.\n * #\n * ################################################################################\n * */\n#define HPACK_STANDALONE\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <ctype.h>\n#include <inttypes.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\n#include <haproxy/chunk.h>\n#include <haproxy/hpack-dec.h>\n\n#define MAX_RQ_SIZE 65536\n#define MAX_HDR_NUM 1000\n\nchar hex[MAX_RQ_SIZE*3+3]; // enough for \"[ XX]* <CR> <LF> \\0\"\nuint8_t buf[MAX_RQ_SIZE];\n\nchar trash_buf[MAX_RQ_SIZE];\nchar tmp_buf[MAX_RQ_SIZE];\n\nstruct buffer tmp   = { .area = tmp_buf,   .data = 0, .size = sizeof(tmp_buf)   };\n\n/* Empty function we dont need - we just need a callback */\nvoid debug_hexdump(FILE *out, const char *pfx, const char *buf,\n                   unsigned int baseaddr, int len)\n{ }\n\n// These must be included here\n#include \"../src/hpack-huff.c\"\n#include \"../src/hpack-tbl.c\"\n#include \"../src/hpack-dec.c\"\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n        char *new_str = (char *)malloc(size+1);\n        struct hpack_dht *dht;\n        struct pool_head pool;\n        int dht_size = 4096;\n        if (new_str == NULL){\n                return 0;\n        }\n        memcpy(new_str, data, size);\n        new_str[size] = '\\0';\n        struct http_hdr list[MAX_HDR_NUM];\n\n        pool.size = dht_size;\n        pool_head_hpack_tbl = &pool;\n        dht = hpack_dht_alloc();\n\n        if (dht != NULL)\n        {\n            hpack_decode_frame(dht, new_str, size, list,sizeof(list)/sizeof(list[0]), &tmp);\n            if (dht != NULL)\n            {\n                free(dht);\n            }\n        }\n        free(new_str);\n        return 0;\n}\n"
  },
  {
    "path": "projects/haproxy/project.yaml",
    "content": "homepage: \"https://github.com/haproxy/haproxy\"\nprimary_contact: \"adam@adalogics.com\"\nlanguage: c++\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"timwolla@googlemail.com\"\n  - \"willy@1wt.eu\"\n  - \"tribuslukas58@gmail.com\"\n  - \"christopher.faulet@gmail.com\"\n  - \"vkrasnobaeva@haproxy.com\"\n  - \"wlallemand@haproxy.com\"\nsanitizers:\n  - address\n\n# Bug reports are public by default:\nview_restrictions: none\nmain_repo: 'https://github.com/haproxy/haproxy'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/haproxy/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/haproxy\n\n# These tests fails so remove it. Store them in a temporary directory because\n# we need to keep same state as prior to running run_tests.sh.\nmkdir /tmp/saved_tests\nDISABLED_TEST_DIR=/tmp/saved_tests/\nmv reg-tests/http-rules/converters_ipmask_concat_strcmp_field_word.vtc ${DISABLED_TEST_DIR}\nmv reg-tests/http-messaging/http_wait_for_body.vtc ${DISABLED_TEST_DIR}\nmv reg-tests/stickiness/srvkey-addr.vtc ${DISABLED_TEST_DIR}\nmv reg-tests/server/cli_set_fqdn.vtc ${DISABLED_TEST_DIR}\n\nmake unit-tests\nHAPROXY_PROGRAM=$SRC/haproxy/haproxy VTEST_PROGRAM=$SRC/VTest2/vtest make reg-tests\n\n# Restore state\nmv ${DISABLED_TEST_DIR}/converters_ipmask_concat_strcmp_field_word.vtc reg-tests/http-rules/converters_ipmask_concat_strcmp_field_word.vtc\nmv ${DISABLED_TEST_DIR}/http_wait_for_body.vtc reg-tests/http-messaging/http_wait_for_body.vtc\nmv ${DISABLED_TEST_DIR}/srvkey-addr.vtc reg-tests/stickiness/srvkey-addr.vtc\nmv ${DISABLED_TEST_DIR}/cli_set_fqdn.vtc reg-tests/server/cli_set_fqdn.vtc\n"
  },
  {
    "path": "projects/harfbuzz/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip ragel pkg-config && \\\n    pip3 install meson==0.60.0 ninja\nRUN git clone --depth 1 https://github.com/harfbuzz/harfbuzz.git\nWORKDIR harfbuzz\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/harfbuzz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable:\n# 1. UBSan vptr since target built with -fno-rtti.\nexport CFLAGS=\"$CFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY\"\nexport CXXFLAGS=\"$CXXFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY\"\n\n# setup\nbuild=$WORK/build\n\n# cleanup\nrm -rf $build\nmkdir -p $build\n\n# Build the library.\nmeson --default-library=static --wrap-mode=nodownload \\\n      -Dexperimental_api=true \\\n      -Dfuzzer_ldflags=\"$(echo $LIB_FUZZING_ENGINE)\" \\\n      $build \\\n  || (cat build/meson-logs/meson-log.txt && false)\n\n# Build the fuzzers.\nninja -v -j$(nproc) -C $build test/fuzzing/hb-{shape,raster,vector,subset,repacker}-fuzzer\nmv $build/test/fuzzing/hb-{shape,raster,vector,subset,repacker}-fuzzer $OUT/\n\n# Archive and copy to $OUT seed corpus if the build succeeded.\nmkdir all-fonts\nfor d in \\\n\ttest/shape/data/in-house/fonts \\\n\ttest/shape/data/aots/fonts \\\n\ttest/shape/data/text-rendering-tests/fonts \\\n\ttest/api/fonts \\\n\ttest/fuzzing/fonts \\\n\tperf/fonts \\\n\t; do\n\tcp $d/* all-fonts/\ndone\n\nzip $OUT/hb-shape-fuzzer_seed_corpus.zip all-fonts/*\ncp $OUT/hb-shape-fuzzer_seed_corpus.zip $OUT/hb-raster-fuzzer_seed_corpus.zip\ncp $OUT/hb-shape-fuzzer_seed_corpus.zip $OUT/hb-vector-fuzzer_seed_corpus.zip\ncp $OUT/hb-shape-fuzzer_seed_corpus.zip $OUT/hb-subset-fuzzer_seed_corpus.zip\nzip $OUT/hb-repacker-fuzzer_seed_corpus.zip ./test/fuzzing/graphs/*\n\n"
  },
  {
    "path": "projects/harfbuzz/hb-raster-fuzzer.options",
    "content": "[libfuzzer]\ntimeout = 5\n"
  },
  {
    "path": "projects/harfbuzz/hb-repacker-fuzzer.options",
    "content": "[libfuzzer]\ntimeout = 5\n"
  },
  {
    "path": "projects/harfbuzz/hb-shape-fuzzer.options",
    "content": "[libfuzzer]\ntimeout = 5\n"
  },
  {
    "path": "projects/harfbuzz/hb-subset-fuzzer.options",
    "content": "[libfuzzer]\ntimeout = 5\n"
  },
  {
    "path": "projects/harfbuzz/hb-vector-fuzzer.options",
    "content": "[libfuzzer]\ntimeout = 5\n"
  },
  {
    "path": "projects/harfbuzz/project.yaml",
    "content": "homepage: \"https://github.com/harfbuzz/harfbuzz\"\nlanguage: c++\nprimary_contact: \"harfbuzz-admin@googlegroups.com\"\nauto_ccs:\n  - \"behdad.esfahbod@gmail.com\"\n  - \"ebrahim@gnu.org\"\n  - \"ebraminio@gmail.com\"\n  - \"grieger@google.com\"\n  - \"rsheeter@google.com\"\n  - \"dr.khaled.hosny@gmail.com\"\n  - \"jfkthame@gmail.com\"\n  - \"qxliu@google.com\"\n  - \"ckitagawa@google.com\"\n  - \"drott@chromium.org\"\n  - \"fwang@igalia.com\"\nvendor_ccs:\n  - \"jmuizelaar@mozilla.com\"\n  - \"lsalzman@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/harfbuzz/harfbuzz.git'\n"
  },
  {
    "path": "projects/hcl/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/hashicorp/hcl\nCOPY build.sh $SRC\nWORKDIR $SRC/hcl\n"
  },
  {
    "path": "projects/hcl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFUZZERS_PACKAGE=github.com/hashicorp/hcl/v2\n\ncompile_native_go_fuzzer_v2 $FUZZERS_PACKAGE/hclsyntax/fuzz FuzzParseTemplate FuzzParseTemplate\ncompile_native_go_fuzzer_v2 $FUZZERS_PACKAGE/hclsyntax/fuzz FuzzParseTraversalAbs FuzzParseTraversalAbs\ncompile_native_go_fuzzer_v2 $FUZZERS_PACKAGE/hclsyntax/fuzz FuzzParseExpression FuzzParseExpression\ncompile_native_go_fuzzer_v2 $FUZZERS_PACKAGE/hclsyntax/fuzz FuzzParseConfig FuzzHclSyntaxParseConfig\ncompile_native_go_fuzzer_v2 $FUZZERS_PACKAGE/json/fuzz FuzzParse FuzzParse\ncompile_native_go_fuzzer_v2 $FUZZERS_PACKAGE/hclwrite/fuzz FuzzParseConfig FuzzHclWriteParseConfig\n\nzip $OUT/FuzzParseTemplate_seed_corpus.zip $SRC/hcl/hclsyntax/fuzz/testdata/fuzz/FuzzParseTemplate/*\nzip $OUT/FuzzParseTraversalAbs_seed_corpus.zip $SRC/hcl/hclsyntax/fuzz/testdata/fuzz/FuzzParseTraversalAbs/*\nzip $OUT/FuzzParseTemplate_seed_corpus.zip $SRC/hcl/hclsyntax/fuzz/testdata/fuzz/FuzzParseTemplate/*\nzip $OUT/FuzzParseExpression_seed_corpus.zip $SRC/hcl/hclsyntax/fuzz/testdata/fuzz/FuzzParseExpression/*\nzip $OUT/FuzzParse_seed_corpus.zip $SRC/hcl/json/fuzz/testdata/fuzz/FuzzParse/*\nzip $OUT/FuzzHclWriteParseConfig_seed_corpus.zip $SRC/hcl/hclsyntax/fuzz/testdata/fuzz/FuzzParseConfig/*\n"
  },
  {
    "path": "projects/hcl/project.yaml",
    "content": "homepage: \"https://github.com/hashicorp/hcl\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"security@hashicorp.com\"\nauto_ccs:\n  - jfinnigan@hashicorp.com\n  - kent@hashicorp.com\nmain_repo: 'https://github.com/hashicorp/hcl'\n"
  },
  {
    "path": "projects/hdf5/Dockerfile",
    "content": "# Copyright 2023 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config cmake zlib1g-dev\nRUN git clone --depth 1 https://github.com/HDFGroup/hdf5\nWORKDIR hdf5\nCOPY build.sh run_tests.sh *.c $SRC/\n"
  },
  {
    "path": "projects/hdf5/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport LDFLAGS=\"${CFLAGS}\"\nexport CMAKE_C_FLAGS=\"${CC} ${CFLAGS}\"\nexport CMAKE_CXX_FLAGS=\"${CXX} ${CXXFLAGS}\"\n\nmkdir build-dir\ncd build-dir\ncmake -G \"Unix Makefiles\" \\\n    -DCMAKE_BUILD_TYPE:STRING=Release \\\n    -DBUILD_SHARED_LIBS:BOOL=OFF \\\n    -DBUILD_TESTING:BOOL=OFF \\\n    -DCMAKE_VERBOSE_MAKEFILES:BOOL=ON \\\n    -DHDF5_BUILD_EXAMPLES:BOOL=OFF \\\n    -DHDF5_BUILD_TOOLS:BOOL=OFF \\\n    -DHDF5_ENABLE_SANITIZERS:BOOL=ON \\\n    -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON \\\n    ..\n\n# Make the build verbose for easy logging inspection\ncmake --build . --verbose --config Release -j$(nproc)\ncd $SRC/hdf5\n\n$CC $CFLAGS  -std=c99 -c \\\n  -I/src/hdf5/src -I/src/hdf5/build-dir/src -I./src/H5FDsubfiling/ \\\n  $SRC/h5_read_fuzzer.c\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE h5_read_fuzzer.o ./build-dir/bin/libhdf5.a -lz -o $OUT/h5_read_fuzzer\n\n$CC $CFLAGS  -std=c99 -c \\\n  -I/src/hdf5/src -I/src/hdf5/build-dir/src -I./src/H5FDsubfiling/ \\\n  $SRC/h5_extended_fuzzer.c\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE h5_extended_fuzzer.o ./build-dir/bin/libhdf5.a -lz -o $OUT/h5_extended_fuzzer\n\nzip -j $OUT/h5_extended_fuzzer_seed_corpus.zip $SRC/hdf5/test/testfiles/*.h5\n\n# Build test\nmkdir $SRC/hdf5/build-test\ncd $SRC/hdf5/build-test\ncmake -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON ..\ncmake --build . --verbose --config Release -j$(nproc)\n"
  },
  {
    "path": "projects/hdf5/h5_extended_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"hdf5.h\"\n\n#include <unistd.h>\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    char filename[256];\n    sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n    FILE *fp = fopen(filename, \"wb\");\n    if (!fp) {\n        return 0;\n    }\n    fwrite(data, size, 1, fp);\n    fclose(fp);\n\n    hid_t fuzz_h5_id = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);\n    if (fuzz_h5_id != H5I_INVALID_HID) {\n      hid_t  dataset_id = H5Dopen2(fuzz_h5_id, \"dsetname\", H5P_DEFAULT);\n      if (dataset_id != H5I_INVALID_HID) {\n          hid_t attribute_id = H5Aopen_name(dataset_id, \"theattr\");\n          if (attribute_id != H5I_INVALID_HID) {\n            H5Aclose(attribute_id);\n          }\n          H5Dclose(dataset_id);\n      }\n      H5Fclose(fuzz_h5_id);\n    }\n    return 0;\n}\n"
  },
  {
    "path": "projects/hdf5/h5_read_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"hdf5.h\"\n\n#include <unistd.h>\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    // Some old logic with regards to skipping first byte. Leaving it here\n    // to avoid affecting the clusterfuzz-generated corpus.\n    if (size == 0) {\n        return 0;\n    }\n    uint8_t decider = data[0];\n    size -= 1;\n    data += 1;\n\n    char filename[256];\n    sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n    FILE *fp = fopen(filename, \"wb\");\n    if (!fp) {\n        return 0;\n    }\n    fwrite(data, size, 1, fp);\n    fclose(fp);\n\n    hid_t fuzz_h5_id = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);\n    if (fuzz_h5_id != H5I_INVALID_HID) {\n        H5Fclose(fuzz_h5_id);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/hdf5/project.yaml",
    "content": "homepage: \"https://www.hdfgroup.org/solutions/hdf5/\"\nmain_repo: \"https://github.com/HDFGroup/hdf5\"\nlanguage: c\nprimary_contact: \"derobins@hdfgroup.org\"\nvendor_ccs:\n  - \"Adam@adalogics.com\"\n  - \"David@adalogics.com\"\n  - \"jhenderson@hdfgroup.org\"\n  - \"nfortne2@hdfgroup.org\"\n  - \"hyoklee@hdfgroup.org\"  \nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n# - afl  # Temporarily disabled after a clang-18 bump, to avoid link errors \"undefined reference to [...]\"\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/hdf5/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build-test\n"
  },
  {
    "path": "projects/hdrhistogram/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/HdrHistogram/HdrHistogram.git\n\nCOPY build.sh $SRC/\nCOPY LogReaderWriterFuzzer.java $SRC/\nWORKDIR $SRC/HdrHistogram\n"
  },
  {
    "path": "projects/hdrhistogram/LogReaderWriterFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\nimport java.io.InputStream;\nimport java.io.ByteArrayInputStream;\nimport org.HdrHistogram.Histogram;\nimport org.HdrHistogram.EncodableHistogram;\nimport org.HdrHistogram.HistogramLogReader;\nimport java.util.NoSuchElementException;\n\npublic class LogReaderWriterFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int numberOfSignificantValueDigits = data.consumeInt(0, 5);\n        byte [] input = data.consumeRemainingAsBytes();\n        if (input.length == 0) {\n            return;\n        }\n        EncodableHistogram encodeableHistogram = null;\n        Histogram accumulatedHistogram = new Histogram(numberOfSignificantValueDigits);\n        InputStream readerStream = new ByteArrayInputStream(input);\n        HistogramLogReader reader = new HistogramLogReader(readerStream);\n        // Modification to handle exceptions\n        try {\n            while ((encodeableHistogram = reader.nextIntervalHistogram()) != null) {\n                Histogram histogram = (Histogram) encodeableHistogram;\n                histogram.getTotalCount();\n                accumulatedHistogram.add(histogram);\n            }\n        } catch (NoSuchElementException e) {\n            // Handle exception gracefully; maybe log it or simply ignore\n        }\n    }\n}\n"
  },
  {
    "path": "projects/hdrhistogram/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Skip the patch that was failing\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\ncp HdrHistogram.jar $OUT/HdrHistogram.jar\n\nALL_JARS=\"HdrHistogram.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/hdrhistogram/project.yaml",
    "content": "homepage: \"https://github.com/HdrHistogram/HdrHistogram.git\"\nlanguage: jvm\nprimary_contact: \"gil@azul.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/HdrHistogram/HdrHistogram.git\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/helm/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/helm/helm\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=november-backup \nCOPY build.sh $SRC/\nWORKDIR $SRC/helm\n"
  },
  {
    "path": "projects/helm/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/go-118-fuzz-build\n  go build .\n  mv go-118-fuzz-build /root/go/bin/\ncd $SRC\n\n$SRC/cncf-fuzzing/projects/helm/build.sh\n"
  },
  {
    "path": "projects/helm/project.yaml",
    "content": "homepage: \"https://helm.sh\"\nmain_repo: \"https://github.com/helm/helm\"\nprimary_contact: \"cncf-helm-core-maintainers@lists.cncf.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"scott@r6by.com\"\n  - \"matt.farina@gmail.com\"\n  - \"marc.khouzam@gmail.com\"\n  - \"martyintech@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/hermes/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -yqq make autoconf automake libtool wget \\\n    python3 zip libreadline-dev libatomic-ops-dev npm\n\n# Building ninja requires PEP 517.\nRUN pip3 install \"pip>=22.3.1\"\n\nRUN pip3 install meson ninja\nRUN ln -s /usr/local/bin/ninja /usr/bin/ninja\n\n# Install NPM to strip comments\nRUN npm install -g @prasadrajandran/strip-comments-cli\n\n# Add JS dictionaries\nRUN curl https://raw.githubusercontent.com/chromium/chromium/main/testing/libfuzzer/fuzzers/dicts/javascript_parser_proto.dict > $SRC/hermes.dict && \\\n    curl https://raw.githubusercontent.com/chromium/chromium/main/testing/libfuzzer/fuzzers/dicts/generated/javascript.dict >> $SRC/hermes.dict\n\nRUN wget https://github.com/unicode-org/icu/archive/refs/tags/cldr/2021-08-25.tar.gz && \\\n    tar xzvf ./2021-08-25.tar.gz && \\\n    mv ./icu-cldr-2021-08-25/icu4c $SRC/icu\n\nRUN git clone https://github.com/facebook/hermes.git && \\\n    git clone --depth 1 https://github.com/tc39/test262 && \\\n    git clone --depth 1 https://github.com/Zon8Research/v8-vulnerabilities && \\\n    git clone --depth 1 https://github.com/v8/v8\n\n# Strip comments from corpus.\nRUN find hermes/test -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+ && \\\n    find hermes/external/esprima/test_fixtures -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+ && \\\n    find hermes/external/flowtest/test/flow -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+ && \\\n    find test262/test -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+ && \\\n    find v8-vulnerabilities/pocs -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+ && \\\n    find v8/test/mjsunit -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+\n\n# Process corpora\nCOPY preprocess-corpus.py $SRC/\nRUN python preprocess-corpus.py\nRUN rm $SRC/preprocess-corpus.py\n\n# Add unit tests from project directory as seed corpus.\nRUN find hermes/test -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \\\n    # Add tests from test262 as seed corpus.\n    find test262/test -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \\\n    # Add V8 PoCs as seed corpus.\n    find v8-vulnerabilities/pocs -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \\\n    # Add tests from esprima as seed corpus.\n    find hermes/external/esprima/test_fixtures -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \\\n    # Add tests from flow as seed corpus.\n    find hermes/external/flowtest/test/flow -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \\\n    # Add tests from v8 as seed corpus.\n    find v8/test/mjsunit -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/hermes/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Copy seed corpora\nmv $SRC/hermes_seed_corpus.zip $OUT\n\n# Copy dictionary file\nmv $SRC/hermes.dict $OUT\n\n# build ICU for linking statically.\ncd $SRC/icu/source\n./configure --disable-shared --enable-static --disable-layoutex \\\n  --disable-tests --disable-samples --with-data-packaging=static\nmake install -j$(nproc)\n\n# Ugly ugly hack to get static linking to work for icu.\ncd lib\nls *.a | xargs -n1 ar x\nrm *.a\nar r libicu.a *.{ao,o}\nln -s $PWD/libicu.a /usr/lib/x86_64-linux-gnu/libicudata.a\nln -s $PWD/libicu.a /usr/lib/x86_64-linux-gnu/libicuuc.a\nln -s $PWD/libicu.a /usr/lib/x86_64-linux-gnu/libicui18n.a\n\nif [ \"${SANITIZER}\" = address ]\nthen\n    CONFIGURE_FLAGS=\"-DHERMES_ENABLE_ADDRESS_SANITIZER=ON\"\nelif [ \"${SANITIZER}\" = undefined ]\nthen\n    CONFIGURE_FLAGS=\"-DHERMES_ENABLE_UNDEFINED_BEHAVIOR_SANITIZER=ON\"\nelse\n    CONFIGURE_FLAGS=\"\"\nfi\n\ncmake -S \"${SRC}/hermes\" -B \"${OUT}/build\" ${CONFIGURE_FLAGS} -DHERMES_USE_STATIC_ICU=ON \\\n                 -DBUILD_SHARED_LIBS=OFF -DHERMES_BUILD_SHARED_JSI=OFF \\\n                 -DHERMES_FUZZING_FLAG=${LIB_FUZZING_ENGINE} -DHERMES_ENABLE_LIBFUZZER=ON\ncmake --build \"$OUT/build\" --target fuzzer-jsi-entry -j 4\ncp \"${OUT}/build/bin/fuzzer-jsi-entry\" \"${OUT}\"\n"
  },
  {
    "path": "projects/hermes/preprocess-corpus.py",
    "content": "#!/usr/bin/env python3\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfrom pathlib import Path, PosixPath\nimport re\nimport sys\nimport os\nimport fnmatch\nfrom typing import List, Set\nimport shutil\n\nexcluded_CVEs_or_CRBugs = [\"CR410030\", \"CR445267\", \"CR1150371\"]\n\nkeywords_to_exclude = {\n    \"WebAssembly\",\n    \"Worker\",\n}\n\n# v8 runtime functions regex - https://chromium.googlesource.com/v8/v8/+/refs/heads/main/src/runtime/runtime.h\nv8_runtime_function_pattern = r\"%\\w+\\(\"\n\n\ndef get_js_files(path: str) -> Set[PosixPath]:\n    path = Path(path)\n    js_files = {x for x in path.glob(\"**/*.js\") if path.is_dir()}\n    if not js_files:\n        print(f\"No JS files found in {path}\")\n    return js_files\n\n\nif __name__ == \"__main__\":\n    # Exclude tests marked by Hermes test suite to skip from corpus\n    test262_tests = get_js_files(\"./test262/test\")\n    esprima_tests = get_js_files(\"./hermes/external/esprima/test_fixtures\")\n    flow_tests = get_js_files(\"./hermes/external/flowtest/test/flow\")\n    mjsunit_tests = get_js_files(\"./v8/test/mjsunit\")\n\n    hermes_skiplist_path = Path(\"./hermes/utils/testsuite/testsuite_skiplist.py\")\n    if not hermes_skiplist_path.is_file():\n        for file in os.listdir(\"./hermes\"):\n            if fnmatch.fnmatch(file, \"testsuite_skiplist.py\"):\n                hermes_skiplist_path = Path(file)\n                break\n\n    shutil.copy(hermes_skiplist_path, \"./testsuite_skiplist.py\")\n    from testsuite_skiplist import (\n        SKIP_LIST,\n        PERMANENT_SKIP_LIST,\n        UNSUPPORTED_FEATURES,\n        PERMANENT_UNSUPPORTED_FEATURES,\n    )\n\n    # Exclude tests in mjsunit using v8 runtime functions\n    for test in mjsunit_tests.copy():\n        test_code = test.open().read()\n        if re.search(v8_runtime_function_pattern, test_code):\n            print(f\"Removed: {test}\")\n            test.unlink()\n            mjsunit_tests.discard(test)\n\n    # Exclude tests marked explicitly to skip in Hermes test suite\n    tests_to_remove = (\n        {test_name for test_name in test262_tests if str(test_name) in SKIP_LIST}\n        | {test_name for test_name in esprima_tests if str(test_name) in SKIP_LIST}\n        | {test_name for test_name in flow_tests if str(test_name) in SKIP_LIST}\n        | {\n            test_name\n            for test_name in mjsunit_tests\n            if str(test_name).lstrip(\"v8/test/\") in SKIP_LIST\n        }\n        | {\n            test_name\n            for test_name in test262_tests\n            if str(test_name) in PERMANENT_SKIP_LIST\n        }\n        | {\n            test_name\n            for test_name in esprima_tests\n            if str(test_name) in PERMANENT_SKIP_LIST\n        }\n        | {\n            test_name\n            for test_name in flow_tests\n            if str(test_name) in PERMANENT_SKIP_LIST\n        }\n        | {\n            test_name\n            for test_name in mjsunit_tests\n            if str(test_name).lstrip(\"v8/test/\") in PERMANENT_SKIP_LIST\n        }\n    )\n    for test in tests_to_remove:\n        print(f\"Removed: {test}\")\n        test.unlink()\n        test262_tests.discard(test)\n        esprima_tests.discard(test)\n        mjsunit_tests.discard(test)\n        flow_tests.discard(test)\n\n    # Exclude tests by keywords found in file contents\n    keywords_to_exclude.update(UNSUPPORTED_FEATURES, PERMANENT_UNSUPPORTED_FEATURES)\n    all_tests = test262_tests | esprima_tests | flow_tests | mjsunit_tests\n    for test in all_tests:\n        test_code = test.open().read()\n        for keyword in keywords_to_exclude:\n            if keyword in test_code or keyword in str(test):\n                print(f\"Removed: {test}\")\n                test.unlink()\n                break\n\n    # Filter v8 bugs before including in corpus\n    v8_pocs = get_js_files(\"./v8-vulnerabilities/pocs\")\n    for poc in v8_pocs:\n        try:\n            # Exclude specific CVEs or CR bugs\n            if any(f\"{id}.js\" in str(poc) for id in excluded_CVEs_or_CRBugs):\n                print(f\"Removed: {poc}\")\n                poc.unlink()\n                continue\n\n            poc_code = poc.open().read()\n\n            # Exclude JIT bugs and other bugs using v8 runtime functions\n            if re.search(v8_runtime_function_pattern, poc_code):\n                print(f\"Removed: {poc}\")\n                poc.unlink()\n                continue\n\n            # Exclude bugs with features Hermes does not support\n            for keyword in keywords_to_exclude:\n                if keyword in poc_code:\n                    print(f\"Removed: {poc}\")\n                    poc.unlink()\n                    break\n\n        except UnicodeDecodeError:\n            # The PoC was likely generated by a fuzzer mutating at the byte level which we can exclude from the corpus\n            pass\n"
  },
  {
    "path": "projects/hermes/project.yaml",
    "content": "homepage: \"https://github.com/facebook/hermes\"\nlanguage: c++\nprimary_contact: \"neildhar@meta.com\"\nauto_ccs:\n  - \"hmf@meta.com\"\n  - \"yaohway@meta.com\"\n  - \"axxu@meta.com\"\n  - \"avp@meta.com\"\n  - \"luigiconiglio@meta.com\"\n  - \"edq@meta.com\"\nvendor_ccs:\n  - \"oss-fuzz@meta.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/facebook/hermes.git'\n"
  },
  {
    "path": "projects/hibernate-orm/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/hibernate/hibernate-orm.git\n\n#\n# We'll use the hsqldb backend. \n#\nRUN curl -o hsqldb-2.7.0.jar \"http://www.hsqldb.org/download/hsqldb_270/hsqldb-2.7.0.jar\"\n\nCOPY add-shadow.diff $SRC/\nRUN cd ${SRC}/hibernate-orm && tr -d '\\015' < $SRC/add-shadow.diff | git apply\n\nCOPY build.sh ${SRC}/\nCOPY *.java *.xml ${SRC}/\nWORKDIR ${SRC}/hibernate-orm"
  },
  {
    "path": "projects/hibernate-orm/PersistentClass.java",
    "content": "import java.math.BigDecimal;\nimport java.util.Date;\nimport java.sql.Time;\nimport java.sql.Timestamp;\n\npublic class PersistentClass {\n\tprivate int m_id;\n\tprivate int m_integer;\n\tprivate String m_string;\n\tprivate BigDecimal m_bigDecimal;\n\tprivate long m_long;\n\tprivate short m_short;\n\tprivate byte m_byte;\n\tprivate boolean m_boolean;\n\tprivate Date m_date;\n\tprivate Time m_time;\n\tprivate Timestamp m_timestamp;\n\tprivate SerializableClass m_serializable;\n \n\tpublic PersistentClass() {\n\t}\n\n\tpublic int getId() {\n\t\treturn m_id;\n\t}\n\n\tpublic void setId(int id) {\n\t\tm_id = id;\n\t}\n \n\tpublic int getIntegerMember() {\n\t\treturn m_integer;\n\t}\n \n\tpublic void setIntegerMember(int value) {\n\t\tm_integer = value;\n\t}\n \n\tpublic String getStringMember() {\n\t\treturn m_string;\n\t}\n \n\tpublic void setStringMember(String value) {\n\t\tm_string = value;\n\t}\n\n\tpublic BigDecimal getBigDecimalMember() {\n\t\treturn m_bigDecimal;\n\t}\n\n\tpublic void setBigDecimalMember(BigDecimal bigDecimal) {\n\t\tm_bigDecimal = bigDecimal;\n\t}\n\t\n\tpublic long getLongMember() {\n\t\treturn m_long;\n\t}\n\n\tpublic void setLongMember(long value) {\n\t\tm_long = value;\n\t}\n\n\tpublic short getShortMember() {\n\t\treturn m_short;\n\t}\n\n\tpublic void setShortMember(short value) {\n\t\tm_short = value;\n\t}\n\n\tpublic boolean getBooleanMember() {\n\t\treturn m_boolean;\n\t}\n\n\tpublic void setBooleanMember(boolean value) {\n\t\tm_boolean = value;\n\t}\n\t\n\tpublic byte getByteMember() {\n\t\treturn m_byte;\n\t}\n\t\n\tpublic void setByteMember(byte value) {\n\t\tm_byte = value;\n\t}\n\n\tpublic Date getDateMember() {\n\t\treturn m_date;\n\t}\n\t\n\tpublic void setDateMember(Date value) {\n\t\tm_date = value;\n\t}\n\t\n\tpublic Time getTimeMember() {\n\t\treturn m_time;\n\t}\n\t\n\tpublic void setTimeMember(Time value) {\n\t\tm_time = value;\n\t}\n\n\tpublic Timestamp getTimestampMember() {\n\t\treturn m_timestamp;\n\t}\n\t\n\tpublic void setTimestampMember(Timestamp value) {\n\t\tm_timestamp = value;\n\t}\n\n\tpublic SerializableClass getSerializableClassMember() {\n\t\treturn m_serializable;\n\t}\n\n\tpublic void setSerializableClassMember(SerializableClass value) {\n\t\tm_serializable = value;\n\t}\n}"
  },
  {
    "path": "projects/hibernate-orm/PersistentClassFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\n\nimport org.hibernate.HibernateException;\nimport org.hibernate.SessionFactory;\nimport org.hibernate.Transaction;\nimport org.hibernate.Session;\nimport org.hibernate.Session;\n\nimport jakarta.persistence.criteria.CriteriaBuilder;\nimport jakarta.persistence.criteria.CriteriaQuery;\n\nimport java.math.BigDecimal;\nimport java.util.Date;\nimport java.util.List;\nimport java.sql.Time;\nimport java.sql.Timestamp;\nimport java.sql.SQLException;\n\n\npublic class PersistentClassFuzzer extends TestServer {\n\n\tfinal private String tableName = \"PersistentClassStore\";\n\tfinal private String className = \"PersistentClass\";\n\t\n\tPersistentClass m_persistentClass = null;\n\n\tPersistentClassFuzzer(FuzzedDataProvider fuzzedDataProvider, boolean verbose) {\n\t\tsuper(verbose);\n\n\t\ttry {\n\t\t\tdropTable(tableName);\n\t\t} catch(SQLException ex) {\n\t\t\tex.printStackTrace(System.out);\n\t\t\t/* cannot happen? */\n\t\t}\n\n\t\tm_persistentClass = new PersistentClass();\n\t\tm_persistentClass.setIntegerMember(fuzzedDataProvider.consumeInt());\n\t\tm_persistentClass.setBigDecimalMember(new BigDecimal(fuzzedDataProvider.consumeInt()));\n\t\tm_persistentClass.setShortMember(fuzzedDataProvider.consumeShort());\n\t\tm_persistentClass.setLongMember(fuzzedDataProvider.consumeLong());\n\t\tm_persistentClass.setBooleanMember(fuzzedDataProvider.consumeBoolean());\n\t\tm_persistentClass.setByteMember(fuzzedDataProvider.consumeByte());\n\t\tm_persistentClass.setDateMember(new Date(fuzzedDataProvider.consumeLong()));\n\t\tm_persistentClass.setTimeMember(new Time(fuzzedDataProvider.consumeLong()));\n\t\tm_persistentClass.setTimestampMember(new Timestamp(fuzzedDataProvider.consumeLong()));\n\t\tm_persistentClass.setSerializableClassMember(\n\t\t\tnew SerializableClass(\n\t\t\t\tfuzzedDataProvider.consumeInt(),\n\t\t\t\tfuzzedDataProvider.consumeString(8)\n\t\t\t)\n\t\t);\n\t\tm_persistentClass.setStringMember(fuzzedDataProvider.consumeRemainingAsAsciiString());\n\t}\n\n\tboolean persist() {\n\t\tboolean retval;\n\n\t\tTransaction tx = null;\n\t\tSession session = SessionFactoryBuilder.sessionFactory().openSession();\n\t\ttry {\n\t\t\ttx = session.beginTransaction();\n\t\t\tsession.save(m_persistentClass);\n\t\t\ttx.commit();\n\t\t\tretval = true;\n\t\t} catch (HibernateException e) {\n\t\t\tif (tx != null) {\n\t\t\t\ttx.rollback();\n\t\t\t}\n\t\t\tretval = false;\n\t\t} finally {\n\t\t\tsession.close(); \n\t\t}\n\n\t\treturn retval;\n\t}\n\n\tvoid restore()\n\t{\n\t\tSession session = SessionFactoryBuilder.sessionFactory().openSession();\n\t\tTransaction tx = null;\n\n\t\ttry {\n\t\t\ttx = session.beginTransaction();\n\n\t\t\tList allPersistentClasses = session.createQuery(\"FROM \" + className).list();\n\t\t\tList<PersistentClass> persistentClasses = (List<PersistentClass>)allPersistentClasses;\n\t\t\tfor(PersistentClass pc : persistentClasses) {\n\t\t\t\tif (pc.getIntegerMember() != m_persistentClass.getIntegerMember()) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <int>\");\n\t\t\t\t}\n\t\t\t\tif (!pc.getStringMember().equals(m_persistentClass.getStringMember())) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <string>\");\n\t\t\t\t}\n\t\t\t\tif (pc.getBigDecimalMember().compareTo(m_persistentClass.getBigDecimalMember()) != 0) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <BigDecimal>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (pc.getLongMember() != m_persistentClass.getLongMember()) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <long>\");\n\t\t\t\t}\n\t\t\t\tif (pc.getShortMember() != m_persistentClass.getShortMember()) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <short>\");\n\t\t\t\t}\n\t\t\t\tif (pc.getBooleanMember() != m_persistentClass.getBooleanMember()) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <boolean>\");\n\t\t\t\t}\n\t\t\t\tif (pc.getByteMember() != m_persistentClass.getByteMember()) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <byte>\");\n\t\t\t\t}\n\t\t\t\tif (!pc.getDateMember().equals(m_persistentClass.getDateMember())) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <Date>\");\n\t\t\t\t}\n\t\t\t\tif (!pc.getTimeMember().equals(m_persistentClass.getTimeMember())) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <Time>\");\n\t\t\t\t}\n\t\t\t\tif (!pc.getTimestampMember().equals(m_persistentClass.getTimestampMember())) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <Timestamp>\");\n\t\t\t\t}\n\t\t\t\tif (!pc.getSerializableClassMember().equals(m_persistentClass.getSerializableClassMember())) {\n\t\t\t\t\tthrow new FuzzerSecurityIssueHigh(\"Restore failed for <Serializable>\");\n\t\t\t\t}\n\t\t\t}\n\t\t\ttx.commit();\n\t\t} catch (HibernateException e) {\n\t\t\tif (tx != null) {\n\t\t\t\ttx.rollback();\n\t\t\t}\n\t\t} finally {\n\t\t\tsession.close(); \n\t\t}\n\t}\n\n\tvoid testOneInput() {\n\t\tif (persist()) {\n\t\t\trestore();\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\ttry (PersistentClassFuzzer testClosure = new PersistentClassFuzzer(fuzzedDataProvider, false)) {\n\t\t\ttestClosure.testOneInput();\n\t\t}\n\t}\n} "
  },
  {
    "path": "projects/hibernate-orm/SerializableClass.java",
    "content": "import java.io.Serializable;\n\npublic class SerializableClass implements Serializable {\n\tint m_intMember;\n\tString m_stringMember;\n\n\tpublic SerializableClass() {\n\t}\n\n\tpublic SerializableClass(int intMember, String stringMember) {\n\t\tm_intMember = intMember;\n\t\tm_stringMember = stringMember;\n\t}\n\n\tvoid setIntMember(int value) {\n\t\tm_intMember = value;\n\t}\n\n\tint getIntMember() {\n\t\treturn m_intMember;\n\t}\n\n\tvoid setStringMember(String value) {\n\t\tm_stringMember = value;\n\t}\n\n\tString getStringMember() {\n\t\treturn m_stringMember;\n\t}\n\n\tpublic boolean equals(Object other) {\n\t\tSerializableClass sc = null;\n\t\tif (other instanceof SerializableClass) {\n\t\t\tsc = (SerializableClass)other;\n\t\t}\n\n\t\tif (sc != null) {\n\t\t\treturn getIntMember() == sc.getIntMember() && getStringMember().equals(sc.getStringMember());\n\t\t}\n\t\treturn false;\n\t}\n} "
  },
  {
    "path": "projects/hibernate-orm/SessionFactoryBuilder.java",
    "content": "import org.hibernate.HibernateException;\nimport org.hibernate.SessionFactory;\nimport org.hibernate.cfg.Configuration;\n \npublic class SessionFactoryBuilder {\n    public static SessionFactory sessionFactory() {\n        SessionFactory sessionFactory = null;\n        try {\n            Configuration configuration = new Configuration(); \n            //Initialize the configuration object \n            //with the configuration file data\n        \tconfiguration.configure(\"hibernate.xml\");\n        \t// Get the SessionFactory object from configuration.\n        \tsessionFactory = configuration.buildSessionFactory();\n        } catch (Exception e) {\n             e.printStackTrace();\n        }\n        return sessionFactory;\n    }\n \n}"
  },
  {
    "path": "projects/hibernate-orm/TestServer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.hsqldb.server.Server;\nimport org.hsqldb.server.ServerConstants;\nimport java.io.PrintWriter;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic abstract class TestServer extends Server implements AutoCloseable {\n\n\tprivate PrintWriter m_stderr = null;\n\tprivate PrintWriter m_stdout = null;\n\n\tTestServer(boolean verbose) {\n\t\tsuper();\n\t\tsetVerbose(verbose);\n\n\t\tsetDatabaseName(0, getTestName());\n        setDatabasePath(0, \"mem:\" + getTestName());\n\n\t\tstart();\n\t}\n\n\tvoid dropTable(String table) throws SQLException {\n\t\ttry (Connection connection = getConnection()) {\n\t\t\tconnection.createStatement().execute(\"DROP TABLE \" + table + \" IF EXISTS\");\n\t\t}\n\t}\n\n\tpublic void close() throws Exception {\n\t\tstop();\n\t}\n\n\tprotected void setVerbose(boolean verbose) {\n\t\tif (verbose) {\n\t\t\tm_stderr = new PrintWriter(System.err);\n\t\t\tm_stdout = new PrintWriter(System.out);\n\t\t} else {\n\t\t\tm_stderr = null;\n\t\t\tm_stdout = null;\n\t\t}\n\t\tthis.setErrWriter(m_stderr);\n\t\tthis.setLogWriter(m_stdout);\n\t}\n\n\tpublic int stop() {\n\t\tint retval = super.stop();\n\t\t/*\n\t\t * polling [...]\n\t\t */\n\t\twhile (getState() == ServerConstants.SERVER_STATE_CLOSING) {\n\t\t\tThread.yield();\n\t\t}\n\n\t\treturn retval;\n\t}\n\n\tConnection getConnection(String options) throws SQLException {\n\t\treturn DriverManager.getConnection(\"jdbc:hsqldb:mem:\" + getTestName() + \";\" + options, \"sa\", \"\");\n\t}\n\n\tConnection getConnection() throws SQLException {\n\t\treturn getConnection(\"\");\n\t}\n\n\tString getTestName() {\n\t\treturn \"test\";\n\t}\n}"
  },
  {
    "path": "projects/hibernate-orm/add-shadow.diff",
    "content": "--- a/hibernate-core/hibernate-core.gradle\n+++ b/hibernate-core/hibernate-core.gradle\n@@ -7,6 +7,7 @@\n import org.apache.tools.ant.filters.ReplaceTokens\n \n plugins {\n+\t id 'com.github.johnrengelman.shadow' version '7.1.2'\n     id 'org.hibernate.build.xjc-jakarta'\n }\n \n@@ -270,4 +271,4 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 ) {\n     testClasses.dependsOn compileTestJava17Java\n     // And run this as part of the check task by default\n     check.dependsOn java17Test\n-}\n\\ No newline at end of file\n+}\n"
  },
  {
    "path": "projects/hibernate-orm/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nALL_JARS=\"\"\n\nHIBERNATE_ORM_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n\npushd \"${SRC}/hibernate-orm/hibernate-core\"\n\t# use bundled gradlew deployer\n\t../gradlew -Dorg.gradle.java.home=\"$(dirname $(dirname $(which javac)))\" shadowJar\n\n\tinstall -v target/libs/hibernate-core-$HIBERNATE_ORM_VERSION-all.jar $OUT/hibernate-core.jar\n\tALL_JARS=\"${ALL_JARS} hibernate-core.jar\"\npopd\n\n#\n# We use HSQLDB\n#\nALL_JARS=\"${ALL_JARS} hsqldb-2.7.0.jar\"\ninstall -v /src/hsqldb-2.7.0.jar ${OUT}/\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ninstall -v $SRC/*.class $OUT/\n\n# install the hibernate config files\ninstall -v $SRC/*.xml $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.SqlInjection\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/hibernate-orm/hibernate.xml",
    "content": "<?xml version='1.0' encoding='utf-8'?>\n<!DOCTYPE hibernate-configuration SYSTEM\n\"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd\">\n\n<hibernate-configuration>\n\t<session-factory>\n\t\t<property name=\"dialect\">\n\t\t\torg.hibernate.dialect.HSQLDialect\n\t\t</property>\n\t\t<property name=\"connection.url\">\n\t\t\tjdbc:hsqldb:mem:test\n\t\t</property>\n\t\t<property name=\"connection.username\">sa</property>\n\t\t<property name=\"connection.password\"></property>\n\t\t<property name=\"connection.driver_class\">\n\t\t\torg.hsqldb.jdbcDriver\n\t\t</property>\n\t\t<property name=\"hbm2ddl.auto\">\n\t\t\tupdate\n\t\t</property>\n\t\t<property name=\"show_sql\">\n\t\t\tfalse\n\t\t</property>\n\t\t<mapping resource=\"persistentClass.xml\"/>\n\t</session-factory>\n</hibernate-configuration>"
  },
  {
    "path": "projects/hibernate-orm/persistentClass.xml",
    "content": "<?xml version='1.0' encoding='utf-8'?>\n<!DOCTYPE hibernate-mapping SYSTEM\n    \"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd\">\n\n<hibernate-mapping>\n\n\t<class name=\"PersistentClass\" table=\"PersistentClassStore\">\n\t    <id name=\"id\" column=\"Id_Member\" type=\"int\" >\n\t\t\t<generator class=\"native\"></generator>\n\t\t</id>\n\t\t<property name=\"integerMember\" column=\"a\" type=\"int\"/>\n\t\t<property name=\"stringMember\" column=\"b\" type=\"string\"/>\n\t\t<property name=\"bigDecimalMember\" column=\"c\" type=\"big_decimal\"/>\n\t\t<property name=\"longMember\" column=\"e\" type=\"long\"/>\n\t\t<property name=\"shortMember\" column=\"f\" type=\"short\"/>\n\t\t<property name=\"byteMember\" column=\"g\" type=\"byte\"/>\n\t\t<property name=\"booleanMember\" column=\"h\" type=\"boolean\"/>\n\t\t<property name=\"dateMember\" column=\"i\" type=\"date\"/>\n\t\t<property name=\"timeMember\" column=\"j\" type=\"time\"/>\n\t\t<property name=\"timestampMember\" column=\"k\" type=\"timestamp\"/>\n\t\t<property name=\"serializableClassMember\" column=\"l\" type=\"serializable\"/>\n\t</class>\n</hibernate-mapping>"
  },
  {
    "path": "projects/hibernate-orm/project.yaml",
    "content": "homepage: \"https://hibernate.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/hibernate/hibernate-orm\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/hibernate-validator/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-17-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.5/bin/mvn\n\nRUN git clone --depth 1 https://github.com/hibernate/hibernate-validator.git hibernate-validator\nWORKDIR hibernate-validator\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/hibernate-validator/MappingParserFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.time.Duration;\nimport java.util.Collections;\nimport java.io.ByteArrayInputStream;\nimport static org.hibernate.validator.internal.util.CollectionHelper.newHashSet;\n\nimport jakarta.validation.ClockProvider;\n\nimport org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorInitializationContext;\nimport org.hibernate.validator.internal.engine.ConstraintCreationContext;\nimport org.hibernate.validator.internal.engine.DefaultClockProvider;\nimport org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorFactoryImpl;\nimport org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManagerImpl;\nimport org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory;\nimport org.hibernate.validator.internal.engine.valueextraction.ValueExtractorManager;\nimport org.hibernate.validator.internal.metadata.core.ConstraintHelper;\nimport org.hibernate.validator.internal.util.TypeResolutionHelper;\nimport org.hibernate.validator.spi.scripting.ScriptEvaluator;\nimport org.hibernate.validator.spi.scripting.ScriptEvaluatorFactory;\nimport java.io.InputStream;\nimport java.util.Set;\n\nimport jakarta.validation.ValidationException;\n\nimport org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider;\nimport org.hibernate.validator.internal.properties.DefaultGetterPropertySelectionStrategy;\nimport org.hibernate.validator.internal.properties.javabean.JavaBeanHelper;\nimport org.hibernate.validator.internal.xml.mapping.MappingXmlParser;\n\n\npublic class MappingParserFuzzer {\n    public static ConstraintCreationContext getDummyConstraintCreationContext() {\n\t\treturn new ConstraintCreationContext( ConstraintHelper.forAllBuiltinConstraints(),\n\t\t\t\tnew ConstraintValidatorManagerImpl( \n                    new ConstraintValidatorFactoryImpl(), \n                    getConstraintValidatorInitializationContext( \n                        new DefaultScriptEvaluatorFactory( null ), \n                        DefaultClockProvider.INSTANCE, \n                        Duration.ZERO \n                        ) \n                    ),\n\t\t\t\tnew TypeResolutionHelper(),\n\t\t\t\tnew ValueExtractorManager( Collections.emptySet() ) \n                );\n\t}\n\n\tpublic static HibernateConstraintValidatorInitializationContext getConstraintValidatorInitializationContext(\n\t\t\tScriptEvaluatorFactory scriptEvaluatorFactory, ClockProvider clockProvider, Duration duration\n\t) {\n\t\treturn new HibernateConstraintValidatorInitializationContext() {\n\n\t\t\t@Override\n\t\t\tpublic ScriptEvaluator getScriptEvaluatorForLanguage(String languageName) {\n\t\t\t\treturn scriptEvaluatorFactory.getScriptEvaluatorByLanguageName( languageName );\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic ClockProvider getClockProvider() {\n\t\t\t\treturn clockProvider;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Duration getTemporalValidationTolerance() {\n\t\t\t\treturn duration;\n\t\t\t}\n\t\t};\n\t}\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ConstraintCreationContext constraintCreationContext = getDummyConstraintCreationContext();\n        MappingXmlParser xmlMappingParser = new MappingXmlParser(\n                constraintCreationContext,\n                new JavaBeanHelper( new DefaultGetterPropertySelectionStrategy(), new DefaultPropertyNodeNameProvider() ), null\n        );\n\n        Set<InputStream> mappingStreams = newHashSet();\n        for(int i = 0; i < data.consumeInt(1,10); i++)\n\t\t    mappingStreams.add( new ByteArrayInputStream(data.consumeBytes(4096))) ;\n\n\n\t\ttry {\n\t\t\txmlMappingParser.parse( mappingStreams );\n\t\t}\n\t\tcatch (ValidationException e) {\n\t\t}\n    }\n}"
  },
  {
    "path": "projects/hibernate-validator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN clean package ${MAVEN_ARGS} org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./engine -name \"hibernate-validator-$CURRENT_VERSION.jar\" -exec mv {} $OUT/hibernate-validator.jar \\;\n\nALL_JARS=\"hibernate-validator.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"/usr/lib/jvm/java-17-openjdk-amd64/lib/server/\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/hibernate-validator/project.yaml",
    "content": "homepage: \"https://github.com/hibernate/hibernate-validator\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/hibernate/hibernate-validator.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/highwayhash/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/google/highwayhash highwayhash\nWORKDIR highwayhash\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/highwayhash/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\ncmake ../\nmake\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -I/src/highwayhash \\\n  CMakeFiles/nanobenchmark.dir/highwayhash/instruction_sets.cc.o \\\n  CMakeFiles/nanobenchmark.dir/highwayhash/os_specific.cc.o \\\n    ../highwayhash/highwayhash_fuzzer.cc \\\n    libhighwayhash.a -lpthread \\\n    -o $OUT/highwayhash_fuzzer\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -I/src/highwayhash \\\n    ../highwayhash/sip_hash_fuzzer.cc \\\n    libhighwayhash.a -lpthread \\\n    -o $OUT/sip_hash_fuzzer\n"
  },
  {
    "path": "projects/highwayhash/project.yaml",
    "content": "homepage: \"https://github.com/google/highwayhash\"\nlanguage: c++\nmain_repo: \"https://github.com/google/highwayhash\"\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/highwayhash/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run built unit test cases\n./build/highwayhash_test && ./build/sip_hash_test && ./build/vector_test\n"
  },
  {
    "path": "projects/hikaricp/ClockFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.zaxxer.hikari.util.ClockSource;\n\npublic class ClockFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    ClockSource msSource = new ClockSource.MillisecondClockSource();\n    long sTime = data.consumeLong();\n    long eTime = data.consumeLong();\n    String ds1 = msSource.elapsedDisplayString0(sTime, eTime);\n  }\n}"
  },
  {
    "path": "projects/hikaricp/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-17-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.6/bin/mvn\n\nRUN git clone --depth 1 https://github.com/brettwooldridge/HikariCP.git hikaricp\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/hikaricp\n"
  },
  {
    "path": "projects/hikaricp/DriverDataSourceFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.zaxxer.hikari.util.DriverDataSource;\nimport java.util.Properties;\n\npublic class DriverDataSourceFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n      try{\n        new DriverDataSource(data.consumeString(50), data.consumeString(20), new Properties(), data.consumeString(30), data.consumeString(50));\n      }\n      catch (java.lang.RuntimeException e) {}\n  }\n}"
  },
  {
    "path": "projects/hikaricp/PropertyElfFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.zaxxer.hikari.util.PropertyElf;\nimport java.util.Properties;\n\npublic class PropertyElfFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        Properties properties = new Properties();\n        properties.setProperty(\"string\", data.consumeString(15));\n        properties.setProperty(\"testObject\", data.consumeString(100));\n        properties.setProperty(\"shortRaw\", data.consumeString(5));\n        properties.setProperty(\"charArray\", data.consumeString(15));\n        TestObject testObject = new TestObject();\n        PropertyElf.setTargetFromProperties(testObject, properties);\n    }\n    catch (java.lang.RuntimeException e) {}\n  }\n}"
  },
  {
    "path": "projects/hikaricp/TestObject.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npublic class TestObject\n{\n   private TestObject testObject;\n   private String string;\n   private short shortRaw;\n   private char[] charArray;\n\n   public void setTestObject(TestObject testObject)\n   {\n      this.testObject = testObject;\n   }\n\n   public void setString(String string)\n   {\n      this.string = string;\n   }\n\n   public TestObject getTestObject()\n   {\n      return testObject;\n   }\n\n   public String getString()\n   {\n      return string;\n   }\n\n   public short getShortRaw() {\n      return shortRaw;\n   }\n\n   public void setShortRaw(short shortRaw) {\n      this.shortRaw = shortRaw;\n   }\n\n   public void setCharArray(char[] charArray)\n   {\n      this.charArray = charArray;\n   }\n\n   public char[] getCharArray()\n   {\n      return charArray;\n   }\n}\n"
  },
  {
    "path": "projects/hikaricp/UtilityElfFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.zaxxer.hikari.util.UtilityElf;\n\npublic class UtilityElfFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        UtilityElf.getTransactionIsolation(data.consumeString(50));\n    }\n    catch (java.lang.IllegalArgumentException e) {}\n  }\n}"
  },
  {
    "path": "projects/hikaricp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN clean package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./ -name \"HikariCP-$CURRENT_VERSION.jar\" -exec mv {} $OUT/hikaricp.jar \\;\n\nALL_JARS=\"hikaricp.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/hikaricp/project.yaml",
    "content": "homepage: \"https://github.com/brettwooldridge/HikariCP\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/brettwooldridge/HikariCP.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/hiredis/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://github.com/redis/hiredis\nWORKDIR hiredis\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/hiredis/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake USE_SSL=0 static\n\n$CC $CFLAGS -std=c99 -pedantic -c -O3 -fPIC -I./ \\\n\tfuzzing/format_command_fuzzer.c -o format_command_fuzzer.o\n\n$CXX $CXXFLAGS -O3 -fPIC $LIB_FUZZING_ENGINE format_command_fuzzer.o \\\n\t-o $OUT/format_command_fuzzer libhiredis.a\n"
  },
  {
    "path": "projects/hiredis/project.yaml",
    "content": "homepage: \"https://github.com/redis/hiredis\"\nprimary_contact: \"michael.grunder@gmail.com\"\nlanguage: c\nauto_ccs:\n  - \"Adam@adalogics.com\"\nmain_repo: \"https://github.com/redis/hiredis\"\n"
  },
  {
    "path": "projects/hiredis-py/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --recurse-submodules https://github.com/redis/hiredis-py hiredis-py\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/hiredis-py\n"
  },
  {
    "path": "projects/hiredis-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Compiles native code with sanitizers due to OSS-Fuzz flags\npython3 ./setup.py install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/hiredis-py/fuzz_reader.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport hiredis\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  reader = hiredis.Reader()\n  reader.feed(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  try:\n    reader.gets()\n  except hiredis.ProtocolError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/hiredis-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/redis/hiredis-py\nlanguage: python\nmain_repo: https://github.com/redis/hiredis-py\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/hive/.gitignore",
    "content": "project-parent/hive\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/hive/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nENV JAVA_HOME $JAVA_15_HOME\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $JAVA_HOME/bin:$PATH\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/hive\nRUN git clone --depth 1 https://github.com/apache/hive/ $SRC/project-parent/hive\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/hive/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=hive\nPROJECT_GROUP_ID=org.apache.hive\nPROJECT_ARTIFACT_ID=hive\nMAIN_REPOSITORY=https://github.com/apache/hive/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -Dmaven.javadoc.skip=true -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  FUZZ_TARGET_DEPENDENCIES=\":hive-common :hive-serde\"\n  \n  for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install -pl '!:metastore-tools-common,!:hive-metastore-benchmarks' $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/hive/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.hive</groupId>\n            <artifactId>hive-common</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.hive</groupId>\n            <artifactId>hive-serde</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/hive/project-parent/fuzz-targets/src/test/java/com/example/DeserializeFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.apache.hadoop.conf.Configuration;\nimport org.apache.hadoop.hive.serde.serdeConstants;\nimport org.apache.hadoop.hive.serde2.JsonSerDe;\nimport org.apache.hadoop.hive.serde2.OpenCSVSerde;\nimport org.apache.hadoop.hive.serde2.SerDeException;\nimport org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe;\nimport org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe;\nimport org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe;\nimport org.apache.hadoop.io.Text;\n\nimport java.util.Properties;\n\n\nclass DeserializeFuzzer {\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        JsonSerDe json = new JsonSerDe();\n        OpenCSVSerde csv = new OpenCSVSerde();\n        LazySimpleSerDe ls = new LazySimpleSerDe();\n        LazyBinarySerDe lb = new LazyBinarySerDe();\n        ColumnarSerDe col = null;\n        try {\n            col = new ColumnarSerDe();\n        } catch (SerDeException expected) {\n        }\n\n        Properties props = new Properties();\n        props.setProperty(serdeConstants.LIST_COLUMNS, data.consumeString(1000));\n        props.setProperty(serdeConstants.LIST_COLUMN_TYPES, data.consumeString(1000));\n        Text input = new Text(data.consumeRemainingAsString());\n\n        try {\n            json.initialize(new Configuration(), props, null, false);\n            json.deserialize(input);\n        } catch (SerDeException expected) {\n        } catch (RuntimeException ignored) {\n        }\n\n        try {\n            csv.initialize(new Configuration(), props, null);\n            csv.deserialize(input);\n        } catch (SerDeException expected) {\n        } catch (RuntimeException ignored) {\n        }\n\n        try {\n            ls.initialize(new Configuration(), props, null);\n            ls.deserialize(input);\n        } catch (SerDeException expected) {\n        } catch (RuntimeException ignored) {\n        }\n\n        try {\n            lb.initialize(new Configuration(), props, null);\n            lb.deserialize(input);\n        } catch (SerDeException expected) {\n        } catch (RuntimeException ignored) {\n        }\n\n        try {\n            col.initialize(new Configuration(), props, null);\n            col.deserialize(input);\n        } catch (SerDeException expected) {\n        } catch (RuntimeException ignored) {\n        }\n    }\n}"
  },
  {
    "path": "projects/hive/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>hive</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/hive/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://hive.apache.org/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/hive/tree/master/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/hoextdown/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool tidy\nRUN git clone --depth 1 https://github.com/kjdev/hoextdown.git hoextdown\nWORKDIR hoextdown\nCOPY run_tests.sh build.sh *.options *.dict $SRC/\n"
  },
  {
    "path": "projects/hoextdown/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# temporary hack to make the build honor CFLAGS. Needs proper fix upstream.\nsed -i 's/^CFLAGS.*//g' Makefile\n# build project\nmake -j$(nproc) libhoedown.a\n\n# build fuzzers\n$CC $CFLAGS -c -std=c99 -Isrc \\\n    \"$SRC/hoextdown/test/hoedown_fuzzer.c\" -o $WORK/hoedown_fuzzer.o\n$CXX $CXXFLAGS -std=c++11 -Isrc \\\n    $WORK/hoedown_fuzzer.o -o $OUT/hoedown_fuzzer \\\n    $LIB_FUZZING_ENGINE \"$SRC/hoextdown/libhoedown.a\"\n\ncp $SRC/*.options $OUT/\ncp $SRC/*.dict $OUT/\n\n# build corpus\nmkdir -p corpus\nfind $SRC/hoextdown/test -type f -name '*.text' | while read in_file\ndo\n  # Genreate unique name for each input...\n  out_file=$(sha1sum \"$in_file\" | cut -c 1-32)\n  cat \"$in_file\" >> \"corpus/$out_file\"\ndone\n\nzip -j $OUT/hoextdown_fuzzer_corpus.zip corpus/*\n"
  },
  {
    "path": "projects/hoextdown/hoextdown.dict",
    "content": "asterisk=\"*\"\nattr_generic=\" a=\\\"1\\\"\"\nattr_href=\" href=\\\"1\\\"\"\nattr_xml_lang=\" xml:lang=\\\"1\\\"\"\nattr_xmlns=\" xmlns=\\\"1\\\"\"\nbackslash=\"\\\\\"\nbacktick=\"`\"\ncolon=\":\"\ndashes=\"---\"\ndouble_quote=\"\\\"\"\nentity_builtin=\"&lt;\"\nentity_decimal=\"&#1;\"\nentity_external=\"&a;\"\nentity_hex=\"&#x1;\"\nequals=\"===\"\nexclamation=\"!\"\ngreater_than=\">\"\nhash=\"#\"\nhyphen=\"-\"\nindent=\"  \"\nleft_bracket=\"[\"\nleft_paren=\"(\"\nless_than=\"<\"\nplus=\"+\"\nright_bracket=\"]\"\nright_paren=\")\"\nsingle_quote=\"'\"\nstring_any=\"ANY\"\nstring_brackets=\"[]\"\nstring_cdata=\"CDATA\"\nstring_dashes=\"--\"\nstring_empty_dblquotes=\"\\\"\\\"\"\nstring_empty_quotes=\"''\"\nstring_idrefs=\"IDREFS\"\nstring_parentheses=\"()\"\nstring_pcdata=\"#PCDATA\"\ntag_cdata=\"<![CDATA[\"\ntag_close=\"</a>\"\ntag_doctype=\"<!DOCTYPE\"\ntag_element=\"<!ELEMENT\"\ntag_entity=\"<!ENTITY\"\ntag_notation=\"<!NOTATION\"\ntag_open=\"<a>\"\ntag_open_close=\"<a />\"\ntag_open_exclamation=\"<!\"\ntag_open_q=\"<?\"\ntag_sq2_close=\"]]>\"\ntag_xml_q=\"<?xml?>\"\nunderscore=\"_\"\n"
  },
  {
    "path": "projects/hoextdown/hoextdown_fuzzer.options",
    "content": "[libfuzzer]\ndict = hoextdown.dict\n"
  },
  {
    "path": "projects/hoextdown/project.yaml",
    "content": "homepage: \"https://github.com/kjdev/hoextdown\"\nlanguage: c++\nprimary_contact: \"kjclev@gmail.com\"\nmain_repo: 'https://github.com/kjdev/hoextdown.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/hoextdown/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Run unit test with fuzzer link flag\nLDFLAGS=\"-fsanitize=$SANITIZER\" make test -j$(nproc)\n"
  },
  {
    "path": "projects/hostap/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool g++ libssl-dev \\\n                       libssl-dev:i386\nRUN git clone --depth 1 https://w1.fi/hostap.git hostap\nWORKDIR hostap\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/hostap/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd 'tests'\n\nexport LDO=$CXX\nexport LDFLAGS=\"$CXXFLAGS $LIB_FUZZING_ENGINE\"\nexport CFLAGS=\"$CFLAGS -MMD\"\n\nif [[ \"$ARCHITECTURE\" == \"i386\" ]]; then\n\t# Force static link\n\trm -v /lib/i386-linux-gnu/libcrypto.so* || :\nfi\n\n# Specific to hostap's rules.include: set empty, as we directly set required\n# sanitizer flags in CFLAGS and LDFLAGS (above).\nexport FUZZ_FLAGS=\n\nfor target in fuzzing/*; do\n  [[ -d \"$target\" ]] || continue\n\n  (\n    cd \"$target\"\n    make clean\n\n    if [[ \"$target\" == \"fuzzing/tls-server\" ]]; then\n      export CFLAGS=\"$CFLAGS -DCERTDIR='\\\"hwsim/auth_serv/\\\"'\"\n    fi\n\n    make -j$(nproc) V=1 LIBFUZZER=y\n    mv -v \"${target##*/}\" \"${OUT}/\"\n\n    if [[ -d 'corpus' ]]; then\n      (cd 'corpus' && zip \"${OUT}/${target##*/}_seed_corpus.zip\" *)\n    fi\n  )\ndone\n\n# Copy required data.\ncp -a \"hwsim\" \"${OUT}/\"\n"
  },
  {
    "path": "projects/hostap/project.yaml",
    "content": "homepage: \"https://w1.fi/cvs.html\"\nlanguage: c++\nprimary_contact: \"j@w1.fi\"\nauto_ccs:\n   - \"elver@google.com\"\nfuzzing_engines:\n  - afl\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'git://w1.fi/srv/git/hostap.git'\n"
  },
  {
    "path": "projects/hpn-ssh/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \nRUN apt-get update && apt-get install -y libz-dev libssl1.1 libssl-dev libedit-dev zip \nRUN git clone https://github.com/rapier1/hpn-ssh\nRUN git clone --depth 1 https://github.com/djmdjm/openssh-fuzz-cases\nWORKDIR hpn-ssh\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/hpn-ssh/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit pull --all\ngit checkout dev_minor\n\n# Enable null cipher\nsed -i 's/#define CFLAG_INTERNAL.*/#define CFLAG_INTERNAL 0/' cipher.c\n\n# Turn off agent unlock password failure delays\nsed -i 's|\\(usleep.*\\)|// \\1|' ssh-agent.c\n\n# Build project\nautoreconf\nenv\nif ! env CFLAGS=\"\" ./configure \\\n    --without-hardening \\\n    --without-zlib-version-check \\\n    --with-cflags=\"-DWITH_XMSS=1\" \\\n    --with-cflags-after=\"$CFLAGS\" \\\n    --with-ldflags-after=\"-g $CFLAGS\" ; then\n\techo \"------ config.log:\" 1>&2\n\tcat config.log 1>&2\n\techo \"ERROR: configure failed\" 1>&2\n\texit 1\nfi\nmake -j$(nproc) all\n\n# Build fuzzers\nEXTRA_CFLAGS=\"-DCIPHER_NONE_AVAIL=1 -D_GNU_SOURCE -Iopenbsd-compat/include\"\nSTATIC_CRYPTO=\"-Wl,-Bstatic -lcrypto -Wl,-Bdynamic\"\n\nSK_NULL=ssh-sk-null.o\nSK_DUMMY=sk-dummy.o\nCOMMON_DEPS=\"ssh-pkcs11-client.o -lssh -lopenbsd-compat\"\n\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c \\\n\tregress/misc/fuzz-harness/ssh-sk-null.cc -o ssh-sk-null.o\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c \\\n\t-DSK_DUMMY_INTEGRATE=1 regress/misc/sk-dummy/sk-dummy.c -o sk-dummy.o\n\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/pubkey_fuzz.cc -o $OUT/pubkey_fuzz \\\n\t$COMMON_DEPS $SK_NULL $STATIC_CRYPTO $LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/privkey_fuzz.cc -o $OUT/privkey_fuzz \\\n\t$COMMON_DEPS $SK_NULL $STATIC_CRYPTO $LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/sig_fuzz.cc -o $OUT/sig_fuzz \\\n\t$COMMON_DEPS $SK_NULL $STATIC_CRYPTO $LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/authopt_fuzz.cc -o $OUT/authopt_fuzz \\\n\tauth-options.o $COMMON_DEPS $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/sshsig_fuzz.cc -o $OUT/sshsig_fuzz \\\n\tsshsig.o $COMMON_DEPS $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/sshsigopt_fuzz.cc -o $OUT/sshsigopt_fuzz \\\n\tsshsig.o $COMMON_DEPS $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/kex_fuzz.cc -o $OUT/kex_fuzz \\\n\t$COMMON_DEPS -lz $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c \\\n\tregress/misc/fuzz-harness/agent_fuzz_helper.c -o agent_fuzz_helper.o\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c -DENABLE_SK_INTERNAL=1 ssh-sk.c -o ssh-sk.o\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/agent_fuzz.cc -o $OUT/agent_fuzz \\\n\t$SK_DUMMY agent_fuzz_helper.o ssh-sk.o $COMMON_DEPS -lz \\\n\t$STATIC_CRYPTO $LIB_FUZZING_ENGINE\n\n# Prepare seed corpora\nCASES=\"$SRC/openssh-fuzz-cases\"\n(set -e ; cd ${CASES}/key ; zip -r $OUT/pubkey_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/privkey ; zip -r $OUT/privkey_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/sig ; zip -r $OUT/sig_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/authopt ; zip -r $OUT/authopt_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/sshsig ; zip -r $OUT/sshsig_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/sshsigopt ; zip -r $OUT/sshsigopt_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/kex ; zip -r $OUT/kex_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/agent ; zip -r $OUT/agent_fuzz_seed_corpus.zip .)\n"
  },
  {
    "path": "projects/hpn-ssh/project.yaml",
    "content": "homepage: \"https://www.psc.edu/home-hpn-ssh\"\nlanguage: c++\nprimary_contact: \"rapier1@gmail.com\"\nauto_ccs:\n  - \"rapier@psc.edu\"\n  - \"mwd@psc.edu\"\nmain_repo: 'https://github.com/rapier1/hpn-ssh.git'\nfuzzing_engines:\n  - afl\n  - libfuzzer\n  - honggfuzz\n  - centipede"
  },
  {
    "path": "projects/hsqldb/ConnectionOptionsFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic class ConnectionOptionsFuzzer extends TestServer {\n\n\tConnectionOptionsFuzzer(boolean verbose) {\n\t\tsuper(verbose);\n\t}\n\n\tvoid testOneInput(String fuzzyString) {\n\t\ttry {\n\t\t\tgetConnection(fuzzyString);\n\t\t} catch (SQLException ex) {\n\t\t\t/* ignore */\n\t\t} catch (IllegalArgumentException ex) {\n\t\t\t/* ??? */\n\t\t}\n\t}\n\t\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\ttry (TestServer fuzzer = new ConnectionOptionsFuzzer(false)) {\n\t\t\tfuzzer.testOneInput(fuzzedDataProvider.consumeRemainingAsAsciiString());\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/hsqldb/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.14-bin.zip -o ant.zip && \\\n    unzip ant.zip -d $SRC/ant && \\\n    rm -rf ant.zip\n\nENV ANT $SRC/ant/apache-ant-1.10.14/bin/ant\n\nRUN svn checkout https://svn.code.sf.net/p/hsqldb/svn/base/trunk hsqldb-svn\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/hsqldb\n"
  },
  {
    "path": "projects/hsqldb/SqlPreparedStatementFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic class SqlPreparedStatementFuzzer extends TestServer {\n\n\tSqlPreparedStatementFuzzer(boolean verbose) {\n\t\tsuper(verbose);\n\t}\n\n\tvoid testOneInput(String fuzzyString) {\n\t\ttry (Connection connection = getConnection()) {\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(\"UPDATE TestTable SET value=? WHERE key=1\");\n\t\t\tpreparedStatement.setString(1, fuzzyString);\n\t\t\tpreparedStatement.executeUpdate();\n\t\t} catch (SQLException ex) {\n\t\t\t/* ignore */\n\t\t}\n\t}\n\t\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\ttry (TestServer fuzzer = new SqlPreparedStatementFuzzer(false)) {\n\t\t\tfuzzer.testOneInput(fuzzedDataProvider.consumeRemainingAsAsciiString());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/hsqldb/SqlStatementFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic class SqlStatementFuzzer extends TestServer {\n\n\tSqlStatementFuzzer(boolean verbose) {\n\t\tsuper(verbose);\n\t}\n\n\tvoid testOneInput(String fuzzyString) {\n\t\ttry {\n\t\t\tgetConnection().createStatement().execute(fuzzyString);\n\t\t} catch (SQLException ex) {\n\t\t\t/* ignore */\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n\t\ttry (TestServer fuzzer = new SqlStatementFuzzer(false)) {\n\t\t\tfuzzer.testOneInput(fuzzedDataProvider.consumeRemainingAsAsciiString());\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/hsqldb/TestServer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.hsqldb.server.Server;\nimport org.hsqldb.server.ServerConstants;\nimport java.io.PrintWriter;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic abstract class TestServer extends Server implements AutoCloseable {\n\n\tprivate PrintWriter m_stderr = null;\n\tprivate PrintWriter m_stdout = null;\n\n\tTestServer(boolean verbose) {\n\t\tsuper();\n\t\tsetVerbose(verbose);\n\n\t\tsetDatabaseName(0, getTestName());\n        setDatabasePath(0, \"mem:\" + getTestName());\n\n\t\tstart();\n\t\ttry {\n\t\t\tcreateTestTable();\n\t\t} catch(SQLException ex) {\n\t\t\t/* cannot happen? */\n\t\t}\n\t}\n\n\tvoid createTestTable() throws SQLException {\n\t\ttry (Connection connection = getConnection()) {\n\t\t\tStatement statement = connection.createStatement();\n\t\t\tstatement.execute(\"DROP TABLE TestTable IF EXISTS\");\n\t\t\tstatement.execute(\"CREATE TABLE TestTable (key INTEGER, value VARCHAR(256))\");\n\t\t\tstatement.execute(\"INSERT INTO TestTable VALUES ((0, \\\"Hello\\\"),(1, \\\"World\\\"))\");\n\t\t}\n\t}\n\n\tpublic void close() throws Exception {\n\t\tstop();\n\t}\n\n\tprotected void setVerbose(boolean verbose) {\n\t\tif (verbose) {\n\t\t\tm_stderr = new PrintWriter(System.err);\n\t\t\tm_stdout = new PrintWriter(System.out);\n\t\t} else {\n\t\t\tm_stderr = null;\n\t\t\tm_stdout = null;\n\t\t}\n\t\tthis.setErrWriter(m_stderr);\n\t\tthis.setLogWriter(m_stdout);\n\t}\n\n\tpublic int stop() {\n\t\tint retval = super.stop();\n\n\t\t/*\n\t\t * polling [...]\n\t\t */\n        while (getState() == ServerConstants.SERVER_STATE_CLOSING) {\n            Thread.yield();\n        }\n\n\t\treturn retval;\n\t}\n\n\tConnection getConnection(String options) throws SQLException {\n\t\treturn DriverManager.getConnection(\"jdbc:hsqldb:mem:\" + getTestName() + \";\" + options, \"sa\", \"\");\n\t}\n\n\tConnection getConnection() throws SQLException {\n\t\treturn getConnection(\"\");\n\t}\n\n\tString getTestName() {\n\t\treturn getClass().getSimpleName();\n\t}\n\n\tabstract void testOneInput(String fuzzyString);\n}"
  },
  {
    "path": "projects/hsqldb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd ${SRC}/hsqldb-svn/build\n$ANT -Dbuild.debug=true hsqldb\ncp ../lib/hsqldb.jar $OUT/\npopd\n\nALL_JARS=\"hsqldb.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n\n# generate jazzer start script\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  #javac -cp $SRC:$BUILD_CLASSPATH $fuzzer\n  #cp $SRC/$fuzzer_basename.class $OUT/\n  #for member_class in $(find $SRC -maxdepth 1 -name \"$fuzzer_basename\\$*.class\"); do\n  #  cp $member_class $OUT/\n  #done\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.SqlInjection\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/hsqldb/project.yaml",
    "content": "homepage: \"www.hsqldb.org\"\nlanguage: jvm\nmain_repo: \"https://svn.code.sf.net/p/hsqldb/svn/\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"ft@cluedup.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/html2text/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/Alir3z4/html2text html2text\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/html2text\n"
  },
  {
    "path": "projects/html2text/build.sh",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/html2text/fuzz_html2text.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\nimport html2text\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  html_raw = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  html2text.html2text(html_raw)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/html2text/project.yaml",
    "content": "homepage: https://github.com/Alir3z4/html2text\nmain_repo: https://github.com/Alir3z4/html2text\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/html5lib-python/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/html5lib/html5lib-python html5lib-python\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/html5lib-python\n"
  },
  {
    "path": "projects/html5lib-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/html5lib-python/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport html5lib\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  html5lib.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/html5lib-python/project.yaml",
    "content": "homepage: https://github.com/html5lib/html5lib-python\nmain_repo: https://github.com/html5lib/html5lib-python\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/htmlunit/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\n#\n# clone repository\n#\nWORKDIR ${SRC}\nENV LIBRARY_NAME htmlunit\nRUN git clone https://github.com/HtmlUnit/htmlunit.git ${SRC}/${LIBRARY_NAME}\n\n# pgp now disabled by MVN_FLAGS in build.sh\n# ADD patch-disable-pgp.diff ${SRC}/\n# RUN cd ${SRC}/htmlunit && (for i in ${SRC}/patch-*.diff; do tr -d '\\015' < $i | git apply -v; done )\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}"
  },
  {
    "path": "projects/htmlunit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Added flag to skip dependency check for troubleshooting purposes\nMVN_FLAGS=\"-DskipTests -Dmaven.javadoc.skip -Denforcer.skip=true -Dgpg.skip -Ddependency-check.skip=true\"\n\nALL_JARS=\"\"\n#LIBRARY_NAME=\"htmlunit\" #set by Dockerfile\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} ${MVN_FLAGS} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}\"\n\t${MVN} ${MVN_FLAGS} install\n\tCURRENT_VERSION=$(${MVN} ${MVN_FLAGS} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} ${MVN_FLAGS} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\"\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/htmlunit/htmlunit-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>htmlunit-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>2.7.0</fuzzedLibaryVersion>\n\t\t<exec.mainClass>HtmlPageFuzzer</exec.mainClass>\n\t</properties>\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.htmlunit</groupId>\n\t\t\t<artifactId>htmlunit</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.4.1</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.htmlunit.html.HtmlPage;\nimport org.htmlunit.BrowserVersion;\nimport org.htmlunit.StringWebResponse; \nimport org.htmlunit.WebClient;\nimport org.htmlunit.WebResponse;\n\nimport java.io.IOException;\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\npublic class HtmlParserFuzzer {\n\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic HtmlParserFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\t}\n\n\tBrowserVersion getBrowserVersion() {\n\t\t/*\n\t\t * from src/test/java/org/htmlunit/WebTestCase.java\n\t\t */\n\t\treturn new BrowserVersion.BrowserVersionBuilder(BrowserVersion.BEST_SUPPORTED)\n\t\t\t\t\t.setApplicationName(\"FLAG_ALL_BROWSERS\")\n\t\t\t\t\t.build();\n\t}\n\n\tvoid test() {\n\t\tcom.code_intelligence.jazzer.api.BugDetectors.allowNetworkConnections();\n\n\t\ttry (WebClient webClient = new WebClient(getBrowserVersion())) {\n\t\t\t// org.htmlunit.corejs.javascript.EvaluatorException seems to be fatal\n\t\t\twebClient.getOptions().setThrowExceptionOnScriptError(false);\n\t\t\t// no exception if linked resources are not available\n\t\t\twebClient.getOptions().setThrowExceptionOnFailingStatusCode(false);\n\n\t\t\twebClient.loadHtmlCodeIntoCurrentWindow(fuzzedDataProvider.consumeRemainingAsString());\n\t\t} catch (IllegalArgumentException e) {\n\t\t} catch (IOException e) {\n\t\t}\n\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\tHtmlParserFuzzer testFixture = new HtmlParserFuzzer(fuzzedDataProvider);\n\t\ttestFixture.test();\n\t}\n}"
  },
  {
    "path": "projects/htmlunit/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>/path/to/local/repo/</localRepository>\n</settings>"
  },
  {
    "path": "projects/htmlunit/project.yaml",
    "content": "homepage: \"https://htmlunit.sourceforge.io\"\nlanguage: jvm\nmain_repo: \"https://github.com/HtmlUnit/htmlunit.git\"\nprimary_contact: \"ronaldbrill@googlemail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/htslib/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev\nRUN git clone --depth 1 --shallow-submodules --recurse-submodules https://github.com/samtools/htslib.git htslib\nWORKDIR htslib\nCOPY build.sh $SRC/\nCOPY run_tests.sh $SRC/\n\n"
  },
  {
    "path": "projects/htslib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nautoconf\nautoheader\nexport LDFLAGS=\"$CFLAGS\"\n./configure LIBS=\"-lz -lm -lbz2 -llzma -lcurl -lcrypto -lpthread\"\nmake -j$(nproc) libhts.a bgzip htsfile tabix annot-tsv test/fuzz/hts_open_fuzzer.o\n\n# Build tests\nmake -j$(nproc) test/hts_endian test/fieldarith test/hfile test/pileup test/pileup_mod \\\n    test/sam test/test_bgzf test/test_expr test/test_faidx test/test_kfunc \\\n    test/test_khash test/test_kstring test/test_mod test/test_nibbles test/test_realn \\\n    test/test-regidx test/test_str2int test/test_time_funcs test/test_view \\\n    test/test_index test/test-vcf-api test/test-vcf-sweep test/test-bcf-sr \\\n    test/test-bcf-translate test/test-parse-reg test/test_introspection \\\n    test/test-bcf_set_variant_type\n\n# build fuzzers\n$CXX $CXXFLAGS -o \"$OUT/hts_open_fuzzer\" test/fuzz/hts_open_fuzzer.o $LIB_FUZZING_ENGINE libhts.a -lz -lbz2 -llzma -lcurl -lcrypto -lpthread\n"
  },
  {
    "path": "projects/htslib/project.yaml",
    "content": "homepage: \"https://www.htslib.org/\"\nlanguage: c++\nprimary_contact: \"rmd@sanger.ac.uk\"\nauto_ccs:\n        - \"aw7@sanger.ac.uk\"\n        - \"jkb@sanger.ac.uk\"\n        - \"vo2@sanger.ac.uk\"\nmain_repo: 'https://github.com/samtools/htslib.git'\n"
  },
  {
    "path": "projects/htslib/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run tests\ntest/hts_endian\ntest/test_expr\ntest/test_kfunc\ntest/test_khash\ntest/test_kstring\ntest/test_nibbles -v\ntest/test_str2int\ntest/test_time_funcs\ntest/fieldarith test/fieldarith.sam\ntest/hfile\ntest/test_bgzf test/bgziptest.txt\ntest/test-parse-reg -t test/colons.bam\ntest/sam test/ce.fa test/faidx/faidx.fa test/faidx/fastqs.fq\ntest/test-regidx\n\n# Run script tests\n(cd test/faidx && ./test-faidx.sh faidx.tst)\n(cd test/sam_filter && ./filter.sh filter.tst)\n(cd test/tabix && ./test-tabix.sh tabix.tst)\n(cd test/mpileup && ./test-pileup.sh mpileup.tst)\n(cd test/fastq && ./test-fastq.sh)\n(cd test/base_mods && ./base-mods.sh base-mods.tst)\n(cd test/tlen && ./tlen.sh tlen.tst)\n\n# Run perl tests\n# We need to be in test directory for test.pl to work correctly with relative paths if it expects that,\n# but Makefile runs it from test directory.\n\n# Remove failing tests (likely due to ASan/Memory limits in OSS-Fuzz environment)\n#rm -f test/ce#large_seq.sam test/xx#large_aux.sam\nmv test/ce#large_seq.sam /tmp/\nmv test/xx#large_aux.sam  /tmp/\n\n(cd test && REF_PATH=: ./test.pl)\n\n# restore failing tests\nmv /tmp/ce#large_seq.sam test/\nmv /tmp/xx#large_aux.sam test/\n"
  },
  {
    "path": "projects/http-parser/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone https://github.com/nodejs/http-parser\n\nWORKDIR $SRC\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/http-parser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build http-parser and unit test\ncd http-parser\nmake http_parser.o test_g test_fast\n\n# Build fuzzers\n$CC $CFLAGS -I. -DHTTP_PARSER_STRICT=0  -Wall -Wextra -Werror -c fuzzers/fuzz_parser.c -o fuzz_parser.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -Wall -Wextra -Werror http_parser.o fuzz_parser.o -o $OUT/fuzz_parser\n\n$CC $CFLAGS -I. -DHTTP_PARSER_STRICT=0  -Wall -Wextra -Werror -c fuzzers/fuzz_url.c -o fuzz_url.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -Wall -Wextra -Werror http_parser.o fuzz_url.o -o $OUT/fuzz_url \n"
  },
  {
    "path": "projects/http-parser/project.yaml",
    "content": "homepage: \"https://github.com/nodejs/http-parser\"\nprimary_contact: \"info@bnoordhuis.nl\"\nlanguage: c++\nauto_ccs:\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/nodejs/http-parser'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/http-parser/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the unit testing\nhttp-parser/test_fast && http-parser/test_g\n"
  },
  {
    "path": "projects/http-pattern-matcher/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nMAINTAINER nareddyt@google.com\n\nRUN apt-get update && apt-get install python -y\nRUN git clone https://github.com/google/http_pattern_matcher.git\nWORKDIR $SRC/http_pattern_matcher/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/http-pattern-matcher/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This project uses bazel rules_fuzzing.\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/http-pattern-matcher/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/google/http_pattern_matcher\"\nmain_repo: \"https://github.com/google/http_pattern_matcher.git\"\nlanguage: c++\nprimary_contact: \"nareddyt@google.com\"\nauto_ccs:\n- \"yangshuo@google.com\"\n- \"taoxuy@google.com\"\n- \"qiwzhang@google.com\"\n- \"justinmp@google.com\"\nsanitizers:\n- address\n- undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\nfile_github_issue: True\n"
  },
  {
    "path": "projects/httparse/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone https://github.com/seanmonstar/httparse\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/httparse/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/httparse\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse_request $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse_headers $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse_chunk_size $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse_response $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse_request_multspaces $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse_response_multspaces $OUT/\n"
  },
  {
    "path": "projects/httparse/project.yaml",
    "content": "homepage: \"https://github.com/seanmonstar/httparse\"\nmain_repo: \"https://github.com/seanmonstar/httparse\"\nprimary_contact: \"seanmonstar@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/httpcomponents-client/ByteArrayBodyWriteToFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\n\nimport org.apache.hc.client5.http.entity.mime.ByteArrayBody;\nimport org.apache.hc.core5.http.ContentType;\n\npublic class ByteArrayBodyWriteToFuzzer {\n    private static final int FILENAME_MAX_LENGTH = 255;\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create objects from fuzzer input\n        final ContentType contentType = data.pickValue(contentTypes);\n        final String filename = data.consumeString(FILENAME_MAX_LENGTH);\n        final byte[] byteArray = data.consumeBytes(Integer.MAX_VALUE);\n\n        // Actual fuzzing begins here\n        try {\n            final ByteArrayBody byteArrayBody = new ByteArrayBody(byteArray, contentType, filename);\n            byteArrayBody.writeTo(new ByteArrayOutputStream());\n        } catch (IOException ignored) {\n            // ignore expected exceptions\n        }\n    }\n\n    private static final ContentType[] contentTypes = {ContentType.APPLICATION_ATOM_XML,\n        ContentType.APPLICATION_FORM_URLENCODED, ContentType.APPLICATION_JSON, ContentType.APPLICATION_NDJSON,\n        ContentType.APPLICATION_OCTET_STREAM, ContentType.APPLICATION_PDF, ContentType.APPLICATION_PROBLEM_JSON,\n        ContentType.APPLICATION_PROBLEM_XML, ContentType.APPLICATION_RSS_XML, ContentType.APPLICATION_SOAP_XML,\n        ContentType.APPLICATION_SVG_XML, ContentType.APPLICATION_XHTML_XML, ContentType.APPLICATION_XML,\n        ContentType.DEFAULT_BINARY, ContentType.DEFAULT_TEXT, ContentType.IMAGE_BMP, ContentType.IMAGE_GIF,\n        ContentType.IMAGE_JPEG, ContentType.IMAGE_PNG, ContentType.IMAGE_SVG, ContentType.IMAGE_TIFF,\n        ContentType.IMAGE_WEBP, ContentType.MULTIPART_FORM_DATA, ContentType.MULTIPART_MIXED,\n        ContentType.MULTIPART_RELATED, ContentType.TEXT_EVENT_STREAM, ContentType.TEXT_HTML, ContentType.TEXT_MARKDOWN,\n        ContentType.TEXT_PLAIN, ContentType.TEXT_XML, ContentType.WILDCARD};\n}\n"
  },
  {
    "path": "projects/httpcomponents-client/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nRUN git clone --depth 1 https://github.com/apache/httpcomponents-client\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nWORKDIR httpcomponents-client\nRUN git clone --depth 1 https://github.com/apache/httpcomponents-core\nRUN git clone --depth 1 https://github.com/qos-ch/slf4j\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\n"
  },
  {
    "path": "projects/httpcomponents-client/FileBodyWriteToFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\n\nimport org.apache.hc.client5.http.entity.mime.FileBody;\nimport org.apache.hc.core5.http.ContentType;\n\npublic class FileBodyWriteToFuzzer {\n    private static final int FILENAME_MAX_LENGTH = 255;\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create objects from fuzzer input\n        final ContentType contentType = data.pickValue(contentTypes);\n        final String filename = data.consumeString(FILENAME_MAX_LENGTH);\n        final String fileContent = data.consumeRemainingAsString();\n\n        // Create needed objects\n        final File tempFile;\n        try {\n            tempFile = File.createTempFile(\"FileBody\", \".bin\");\n        } catch (IOException ioe) {\n            return;\n        }\n\n        try {\n            final FileWriter fileWriter = new FileWriter(tempFile);\n            fileWriter.write(fileContent);\n            fileWriter.close();\n        } catch (IOException ioe) {\n            tempFile.delete();\n            return;\n        }\n\n        // Actual fuzzing begins here\n        try {\n            final FileBody fileBody = new FileBody(tempFile, contentType, filename);\n            fileBody.writeTo(new ByteArrayOutputStream());\n        } catch (IOException ignored) {\n            // ignore expected exceptions\n        } finally {\n            tempFile.delete();\n        }\n    }\n\n    private static final ContentType[] contentTypes = {ContentType.APPLICATION_ATOM_XML,\n        ContentType.APPLICATION_FORM_URLENCODED, ContentType.APPLICATION_JSON, ContentType.APPLICATION_NDJSON,\n        ContentType.APPLICATION_OCTET_STREAM, ContentType.APPLICATION_PDF, ContentType.APPLICATION_PROBLEM_JSON,\n        ContentType.APPLICATION_PROBLEM_XML, ContentType.APPLICATION_RSS_XML, ContentType.APPLICATION_SOAP_XML,\n        ContentType.APPLICATION_SVG_XML, ContentType.APPLICATION_XHTML_XML, ContentType.APPLICATION_XML,\n        ContentType.DEFAULT_BINARY, ContentType.DEFAULT_TEXT, ContentType.IMAGE_BMP, ContentType.IMAGE_GIF,\n        ContentType.IMAGE_JPEG, ContentType.IMAGE_PNG, ContentType.IMAGE_SVG, ContentType.IMAGE_TIFF,\n        ContentType.IMAGE_WEBP, ContentType.MULTIPART_FORM_DATA, ContentType.MULTIPART_MIXED,\n        ContentType.MULTIPART_RELATED, ContentType.TEXT_EVENT_STREAM, ContentType.TEXT_HTML, ContentType.TEXT_MARKDOWN,\n        ContentType.TEXT_PLAIN, ContentType.TEXT_XML, ContentType.WILDCARD};\n}\n"
  },
  {
    "path": "projects/httpcomponents-client/FormBodyPartBuilderBuildFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport org.apache.hc.client5.http.entity.mime.ByteArrayBody;\nimport org.apache.hc.client5.http.entity.mime.ContentBody;\nimport org.apache.hc.client5.http.entity.mime.FileBody;\nimport org.apache.hc.client5.http.entity.mime.FormBodyPartBuilder;\nimport org.apache.hc.client5.http.entity.mime.InputStreamBody;\nimport org.apache.hc.client5.http.entity.mime.StringBody;\nimport org.apache.hc.core5.http.ContentType;\n\npublic class FormBodyPartBuilderBuildFuzzer {\n    private static final int builderNameLength = 255;\n    private static final int fieldNameLength = 255;\n    private static final int fieldValueLength = 500;\n    private static final int bodyContentSize = 2 * fieldValueLength;\n\n    private enum BodyType { ByteArray, File, InputStream, String }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        final String builderName = data.consumeString(builderNameLength);\n        final ContentBody contentBody;\n        try {\n            contentBody = generateContentBody(data);\n        } catch (IOException ioe) {\n            // preparations failed ; exit early\n            return;\n        };\n\n        try {\n            final FormBodyPartBuilder builder = FormBodyPartBuilder.create(builderName, contentBody);\n\n            while (data.remainingBytes() > 0) {\n                builder.addField(data.consumeString(fieldNameLength), data.consumeString(fieldValueLength));\n            }\n\n            builder.build();\n        } catch (IllegalStateException ignored) {\n            // ignore expected exceptions\n        }\n    }\n\n    private static ContentBody generateContentBody(FuzzedDataProvider data) throws IOException {\n        final BodyType choice = data.pickValue(BodyType.values());\n        final ContentBody contentBody;\n        switch (choice) {\n            case ByteArray:\n                contentBody =\n                    new ByteArrayBody(data.consumeBytes(bodyContentSize), data.consumeString(fieldNameLength));\n                break;\n\n            case File:\n                final File tempFile = File.createTempFile(\"FileBody\", \".bin\");\n\n                try {\n                    final FileWriter fileWriter = new FileWriter(tempFile);\n                    fileWriter.write(data.consumeString(bodyContentSize));\n                    fileWriter.close();\n                } catch (IOException ioe) {\n                    tempFile.delete();\n                    throw ioe;\n                }\n\n                contentBody = new FileBody(tempFile);\n                tempFile.delete();\n                break;\n\n            case InputStream:\n                final InputStream inputStream = new ByteArrayInputStream(data.consumeBytes(bodyContentSize));\n                contentBody = new InputStreamBody(inputStream, data.consumeString(fieldNameLength));\n                break;\n\n            case String:\n                contentBody = new StringBody(data.consumeString(bodyContentSize), ContentType.DEFAULT_BINARY);\n                break;\n\n            default: // should never be reached\n                contentBody = null;\n                break;\n        }\n\n        return contentBody;\n    }\n}\n"
  },
  {
    "path": "projects/httpcomponents-client/HttpFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.net.URI;\nimport java.io.IOException;\n\nimport org.apache.hc.core5.http.io.support.ClassicRequestBuilder;\nimport org.apache.hc.client5.http.impl.classic.HttpClients;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.auth.CredentialsProviderBuilder;\nimport org.apache.hc.client5.http.auth.CredentialsProvider;\nimport org.apache.hc.client5.http.auth.AuthScope;\nimport org.apache.hc.client5.http.classic.methods.HttpPost;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.message.BasicNameValuePair;\nimport org.apache.hc.core5.http.NameValuePair;\nimport org.apache.hc.client5.http.entity.UrlEncodedFormEntity;\n\npublic class HttpFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tfinal CredentialsProvider credsProvider = CredentialsProviderBuilder.create()\n\t\t\t.add(new AuthScope(data.consumeRemainingAsString(), data.consumeInt()), data.consumeRemainingAsString(), data.consumeRemainingAsString().toCharArray())\n\t\t\t.build();\n\n\t\tfinal CloseableHttpClient httpClient = HttpClients.custom()\n\t\t\t.setDefaultCredentialsProvider(credsProvider)\n\t\t\t.build();\n\t\t\n\t\tHttpPost httpPost = new HttpPost(\"http://localhost\");\n\t\tList<NameValuePair> nvps = new ArrayList<>();\n\t\tnvps.add(new BasicNameValuePair(data.consumeRemainingAsString(), data.consumeRemainingAsString()));\n\n\t\thttpPost.setEntity(new UrlEncodedFormEntity(nvps));\n\n\t\ttry {\n\t\t\thttpClient.execute(httpPost);\n\t\t} catch (IOException e) { }\n\t}\n}"
  },
  {
    "path": "projects/httpcomponents-client/InputStreamBodyWriteToFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport org.apache.hc.client5.http.entity.mime.InputStreamBody;\nimport org.apache.hc.core5.http.ContentType;\n\npublic class InputStreamBodyWriteToFuzzer {\n    private static final int FILENAME_MAX_LENGTH = 255;\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create objects from fuzzer input\n        final ContentType contentType = data.pickValue(contentTypes);\n        final String filename = data.consumeString(FILENAME_MAX_LENGTH);\n        final long contentLength = data.consumeLong();\n        final InputStream inputStream = new ByteArrayInputStream(data.consumeBytes(Integer.MAX_VALUE));\n\n        try {\n            final InputStreamBody inputStreamBody =\n                new InputStreamBody(inputStream, contentType, filename, contentLength);\n            inputStreamBody.writeTo(new ByteArrayOutputStream());\n        } catch (IOException ignored) {\n            // ignore expected exceptions\n        }\n    }\n\n    private static final ContentType[] contentTypes = {ContentType.APPLICATION_ATOM_XML,\n        ContentType.APPLICATION_FORM_URLENCODED, ContentType.APPLICATION_JSON, ContentType.APPLICATION_NDJSON,\n        ContentType.APPLICATION_OCTET_STREAM, ContentType.APPLICATION_PDF, ContentType.APPLICATION_PROBLEM_JSON,\n        ContentType.APPLICATION_PROBLEM_XML, ContentType.APPLICATION_RSS_XML, ContentType.APPLICATION_SOAP_XML,\n        ContentType.APPLICATION_SVG_XML, ContentType.APPLICATION_XHTML_XML, ContentType.APPLICATION_XML,\n        ContentType.DEFAULT_BINARY, ContentType.DEFAULT_TEXT, ContentType.IMAGE_BMP, ContentType.IMAGE_GIF,\n        ContentType.IMAGE_JPEG, ContentType.IMAGE_PNG, ContentType.IMAGE_SVG, ContentType.IMAGE_TIFF,\n        ContentType.IMAGE_WEBP, ContentType.MULTIPART_FORM_DATA, ContentType.MULTIPART_MIXED,\n        ContentType.MULTIPART_RELATED, ContentType.TEXT_EVENT_STREAM, ContentType.TEXT_HTML, ContentType.TEXT_MARKDOWN,\n        ContentType.TEXT_PLAIN, ContentType.TEXT_XML, ContentType.WILDCARD};\n}\n"
  },
  {
    "path": "projects/httpcomponents-client/StringBodyWriteToFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\n\nimport org.apache.hc.client5.http.entity.mime.StringBody;\nimport org.apache.hc.core5.http.ContentType;\n\npublic class StringBodyWriteToFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // Create objects from fuzzer input\n        final ContentType contentType = data.pickValue(contentTypes);\n        final String stringData = data.consumeRemainingAsString();\n\n        // Actual fuzzing begins here\n        try {\n            final StringBody stringBody = new StringBody(stringData, contentType);\n            stringBody.writeTo(new ByteArrayOutputStream());\n        } catch (IOException ignored) {\n            // ignore expected exceptions\n        }\n    }\n\n    private static final ContentType[] contentTypes = {ContentType.APPLICATION_ATOM_XML,\n        ContentType.APPLICATION_FORM_URLENCODED, ContentType.APPLICATION_JSON, ContentType.APPLICATION_NDJSON,\n        ContentType.APPLICATION_OCTET_STREAM, ContentType.APPLICATION_PDF, ContentType.APPLICATION_PROBLEM_JSON,\n        ContentType.APPLICATION_PROBLEM_XML, ContentType.APPLICATION_RSS_XML, ContentType.APPLICATION_SOAP_XML,\n        ContentType.APPLICATION_SVG_XML, ContentType.APPLICATION_XHTML_XML, ContentType.APPLICATION_XML,\n        ContentType.DEFAULT_BINARY, ContentType.DEFAULT_TEXT, ContentType.IMAGE_BMP, ContentType.IMAGE_GIF,\n        ContentType.IMAGE_JPEG, ContentType.IMAGE_PNG, ContentType.IMAGE_SVG, ContentType.IMAGE_TIFF,\n        ContentType.IMAGE_WEBP, ContentType.MULTIPART_FORM_DATA, ContentType.MULTIPART_MIXED,\n        ContentType.MULTIPART_RELATED, ContentType.TEXT_EVENT_STREAM, ContentType.TEXT_HTML, ContentType.TEXT_MARKDOWN,\n        ContentType.TEXT_PLAIN, ContentType.TEXT_XML, ContentType.WILDCARD};\n}\n"
  },
  {
    "path": "projects/httpcomponents-client/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"httpclient5/target/httpclient5-$CURRENT_VERSION.jar\" \"$OUT/httpclient5.jar\"\n\n$MVN package $MAVEN_ARGS -f \"httpcomponents-core/pom.xml\"\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout -f httpcomponents-core/pom.xml)\ncp \"httpcomponents-core/httpcore5/target/httpcore5-$CURRENT_VERSION.jar\" \"$OUT/httpcore5.jar\"\ncp \"httpcomponents-core/httpcore5-h2/target/httpcore5-h2-$CURRENT_VERSION.jar\" \"$OUT/httpcore5-h2.jar\"\n\ncd slf4j\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"slf4j-api/target/slf4j-api-$CURRENT_VERSION.jar\" \"$OUT/slf4j.jar\"\ncd $SRC\n\nALL_JARS=\"httpclient5.jar httpcore5.jar slf4j.jar httpcore5-h2.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/httpcomponents-client/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/apache/httpcomponents-client\nlanguage: jvm\nmain_repo: https://github.com/apache/httpcomponents-client.git\nsanitizers:\n- address\nvendor_ccs:\n- patrice.salathe@code-intelligence.com\n- yakdan@code-intelligence.com\n- yoshi.weber@gmail.com"
  },
  {
    "path": "projects/httpcomponents-core/ClassicHttpRequestFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.hc.core5.http.Method;\nimport org.apache.hc.core5.http.message.BasicClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.*;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.http.impl.bootstrap.RequesterBootstrap;\nimport org.apache.hc.core5.http.protocol.HttpCoreContext;\nimport org.apache.hc.core5.http.HttpHost;\nimport org.apache.hc.core5.http.impl.bootstrap.HttpRequester;\nimport org.apache.hc.core5.util.Timeout;\nimport org.apache.hc.core5.http.HttpException;\nimport org.apache.hc.core5.http.HttpVersion;\nimport org.apache.hc.core5.http.message.BasicHeader;\nimport org.apache.hc.core5.net.URIAuthority;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.lang.IllegalArgumentException;\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\n\npublic class ClassicHttpRequestFuzzer {\n    final static ContentType[] contentTypes = {\n        ContentType.APPLICATION_ATOM_XML,\n        ContentType.APPLICATION_FORM_URLENCODED,\n        ContentType.APPLICATION_JSON,\n        ContentType.APPLICATION_SVG_XML,\n        ContentType.APPLICATION_XHTML_XML,\n        ContentType.APPLICATION_XML,\n        ContentType.IMAGE_BMP,\n        ContentType.IMAGE_GIF,\n        ContentType.IMAGE_JPEG,\n        ContentType.IMAGE_PNG,\n        ContentType.IMAGE_SVG,\n        ContentType.IMAGE_TIFF,\n        ContentType.IMAGE_WEBP,\n        ContentType.MULTIPART_FORM_DATA,\n        ContentType.TEXT_HTML,\n        ContentType.TEXT_PLAIN,\n        ContentType.TEXT_XML\n    };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int entityChoice = data.consumeInt(0, 3);\n        String name = data.consumeString(100);\n        String value = data.consumeRemainingAsString();\n        BasicClassicHttpRequest request;\n\n        try {\n            request = new BasicClassicHttpRequest(data.pickValue(Method.values()), value);\n        } catch (IllegalArgumentException e) {\n            return;\n        }\n\n        request.setVersion(data.pickValue(HttpVersion.ALL));\n        request.addHeader(value, new Object());\n        request.addHeader(new BasicHeader(name, value));\n        request.setScheme(value);\n        request.setAuthority(new URIAuthority(value, 8080));\n        setRequestEntity(request, value, entityChoice, data.pickValue(contentTypes));\n        \n        request.getRequestUri();\n        request.getPath();\n        request.toString();\n        request.getScheme();\n        request.getEntity();\n        request.getAuthority();\n        try {\n            request.getUri();\n        } catch (URISyntaxException e) { }\n\n        HttpRequester requester = RequesterBootstrap.bootstrap()\n            .setSslContext(null)\n            .setMaxTotal(2)\n            .setDefaultMaxPerRoute(2)\n            .create();\n\n        final HttpHost target = new HttpHost(value, \"localhost\", 80);\n        final HttpCoreContext context = HttpCoreContext.create();\n        try {\n            requester.execute(target, request, Timeout.ofSeconds(0), context);\n        } catch (HttpException | IOException e) { }\n    }\n\n    public static void setRequestEntity(BasicClassicHttpRequest request, String value, int entityChoice, ContentType contentType) {\n        ByteArrayInputStream stream = new ByteArrayInputStream(value.getBytes());\n        switch (entityChoice) {\n            case 0:\n                request.setEntity(new StringEntity(value, contentType));\n                break;\n            case 1:\n                request.setEntity(new InputStreamEntity(stream,contentType));\n                break;\n            case 2:\n                request.setEntity(new BasicHttpEntity(stream, contentType));\n                break;\n            case 3:\n                request.setEntity(new ByteArrayEntity(value.getBytes(), contentType));\n                break;\n        }\n    }\n}"
  },
  {
    "path": "projects/httpcomponents-core/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN git clone --depth 1 https://github.com/apache/httpcomponents-core -b 5.1.x\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR httpcomponents-core"
  },
  {
    "path": "projects/httpcomponents-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\n\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"httpcore5/target/httpcore5-$CURRENT_VERSION.jar\" \"$OUT/httpcore5.jar\"\n\nALL_JARS=\"httpcore5.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/httpcomponents-core/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/apache/httpcomponents-core\nlanguage: jvm\nmain_repo: https://github.com/apache/httpcomponents-core.git\nsanitizers:\n- address\nvendor_ccs:\n- patrice.salathe@code-intelligence.com\n- yakdan@code-intelligence.com\n"
  },
  {
    "path": "projects/httpcore/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/encode/httpcore httpcore\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/httpcore\n"
  },
  {
    "path": "projects/httpcore/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/httpcore/fuzz_http11.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport httpcore\nfrom httpcore._backends.mock import MockStream\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  stream = MockStream(fdp.ConsumeBytes(2048))\n  origin = httpcore.Origin(fdp.ConsumeBytes(24), fdp.ConsumeBytes(24), 443)\n  try:\n    with httpcore.HTTP11Connection(origin=origin,\n                                   stream=stream,\n                                   keepalive_expiry=5.0) as conn:\n      with conn.stream(\"GET\", \"http://127.0.0.1\") as response:\n        response.status\n  except RuntimeError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/httpcore/project.yaml",
    "content": "homepage: https://github.com/encode/httpcore\nmain_repo: https://github.com/encode/httpcore\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/httplib2/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y libffi-dev\nRUN git clone --depth 1 https://github.com/httplib2/httplib2\nRUN python3 -m pip install --upgrade pip pyparsing\nCOPY build.sh $SRC/\n\nWORKDIR $SRC/httplib2\n"
  },
  {
    "path": "projects/httplib2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install six pytest cryptography\npython3 setup.py install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find ./tests/ -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/httplib2/project.yaml",
    "content": "homepage: \"https://github.com/httplib2/httplib2\"\nlanguage: python\nprimary_contact: \"temotor@gmail.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: \"https://github.com/httplib2/httplib2\"\n"
  },
  {
    "path": "projects/httpretty/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip requests\nRUN git clone https://github.com/gabrielfalcao/httpretty httpretty\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/httpretty\n"
  },
  {
    "path": "projects/httpretty/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/httpretty/fuzz_httpretty_e2e.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nimport requests\nimport httpretty\n\n\ndef test_one(input_data):\n  fdp = atheris.FuzzedDataProvider(input_data)\n\n  # Enable httpretty\n  httpretty.enable(verbose=True, allow_net_connect=False)\n\n  # Create arguments\n  http_body = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  if fdp.ConsumeBool():\n    header_dict = {\n        fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24),\n        fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24),\n        fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24),\n        fdp.ConsumeUnicodeNoSurrogates(24): fdp.ConsumeUnicodeNoSurrogates(24)\n    }\n  else:\n    header_dict = None\n\n  # Pass random arguments to register_uri and ensure we can get it\n  try:\n    httpretty.register_uri(httpretty.GET,\n                           \"http://fuzzing.com/\",\n                           body=http_body,\n                           content_type=fdp.ConsumeUnicodeNoSurrogates(32),\n                           adding_headers=header_dict)\n    response = requests.get('http://fuzzing.com')\n  except httpretty.HTTPrettyError:\n    pass\n\n  httpretty.reset()\n\n\nif __name__ == \"__main__\":\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, test_one)\n  atheris.Fuzz()\n"
  },
  {
    "path": "projects/httpretty/project.yaml",
    "content": "homepage: https://github.com/gabrielfalcao/httpretty\nmain_repo: https://github.com/gabrielfalcao/httpretty\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/httpx/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d223a882810372830fd7968eb3e64533f3a2318c90be43ac753a46a15946faec\nRUN git clone https://github.com/encode/httpx httpx\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/httpx\n"
  },
  {
    "path": "projects/httpx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/httpx/fuzz_api.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport httpx\nimport time\nimport socket\nimport threading\n\n\nfuzzed_input = b\"\"\n\n# somehow ugly as fuzzing cannot be run in parallel\ndef SetFuzzedInput(input_bytes):\n  global fuzzed_input\n  fuzzed_input = input_bytes\n\nclass ServerThread(threading.Thread):\n  def __init__(self):\n    self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n    self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n    self.s.bind((\"127.0.0.1\", 8001))\n    self.s.listen(1)\n\n    threading.Thread.__init__(self)\n\n  def run(self):\n    global fuzzed_input\n    conn, addr = self.s.accept()\n    conn.recv(1024)\n    conn.send(fuzzed_input)\n    time.sleep(0.005)\n    conn.close()\n    self.s.shutdown(1)\n    self.s.close()\n    time.sleep(0.01)\n\n\ndef TestOneInput(data):\n  t1 = ServerThread()\n  # Launch threads\n  t1.start()\n  SetFuzzedInput(data)\n  try:\n    httpx.get('http://127.0.0.1:8001/')\n  except httpx.RemoteProtocolError:\n    pass\n  t1.join()\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/httpx/fuzz_decoders.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport httpx\nfrom httpx._decoders import ByteChunker, LineDecoder, TextChunker, TextDecoder\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  ByteChunker(chunk_size=fdp.ConsumeIntInRange(1, 100)).decode(\n    fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024))\n  )\n  LineDecoder().decode(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  TextChunker(chunk_size=fdp.ConsumeIntInRange(1, 100)).decode(\n    fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))\n  )\n  TextDecoder().decode(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/httpx/fuzz_url.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport httpx\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    httpx._urlparse.urlparse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except httpx._exceptions.InvalidURL:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/httpx/project.yaml",
    "content": "homepage: https://github.com/encode/httpx\nmain_repo: https://github.com/encode/httpx\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/hugo/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\n\nRUN git clone https://github.com/gohugoio/hugo\nCOPY build.sh fuzz_pageparser.go $SRC/\nWORKDIR $SRC/hugo\n"
  },
  {
    "path": "projects/hugo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/fuzz_pageparser.go $SRC/hugo/parser/pageparser/\n\ncompile_go_fuzzer github.com/gohugoio/hugo/parser/pageparser FuzzParseFrontMatterAndContent FuzzParseFrontMatterAndContent\n"
  },
  {
    "path": "projects/hugo/fuzz_pageparser.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage pageparser\n\nimport \"bytes\"\n\nfunc FuzzParseFrontMatterAndContent(data []byte) int {\n\tParseFrontMatterAndContent(bytes.NewReader(data))\n\treturn 1\n}\n"
  },
  {
    "path": "projects/hugo/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/gohugoio/hugo\"\nprimary_contact: \"bjorn.erik.pedersen@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/gohugoio/hugo'\n"
  },
  {
    "path": "projects/hunspell/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y autoconf automake autopoint libtool\nRUN git clone --depth 1 https://github.com/hunspell/hunspell.git hunspell\nWORKDIR hunspell\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/hunspell/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/hunspell/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/hunspell/project.yaml",
    "content": "homepage: \"https://hunspell.github.io/\"\nlanguage: c++\nprimary_contact: \"caolanm@gmail.com\"\nvendor_ccs:\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - i386\n  - x86_64\nmain_repo: 'https://github.com/hunspell/hunspell.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/hunspell/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Successful unit test cases\nTESTS=\"affixes.dic flag.dic allcaps3.dic dotless_i.dic sug.dic ph.dic condition_utf.dic flaglong.dic sugutf.dic wordpair.dic phone.dic flagnum.dic sug2.dic flagutf8.dic allcaps2.dic base.dic \nallcaps.dic i58202.dic slash.dic allcaps_utf.dic base_utf.dic keepcase.dic alias.dic ph2.dic needaffix4.dic forbiddenword.dic complexprefixes2.dic alias2.dic break.dic needaffix.dic alias3.dic \nutf8_bom.dic needaffix5.dic needaffix3.dic utf8_bom2.dic utf8.dic needaffix2.dic fogemorpheme.dic complexprefixes.dic complexprefixesutf.dic nosuggest.dic breakdefault.dic zeroaffix.dic \ncompoundaffix2.dic circumfix.dic compoundflag.dic onlyincompound.dic compoundrule3.dic compoundrule2.dic compoundrule.dic conditionalprefix.dic compoundrule6.dic compoundrule4.dic compoundrule7.dic \ncheckcompoundrep2.dic compoundrule8.dic compoundaffix3.dic compoundaffix.dic utf8_nonbmp.test checkcompounddup.dic compoundforbid.dic simplifiedtriple.dic checkcompoundtriple.dic ignore.dic \ncheckcompoundcaseutf.dic ignoreutf.dic compoundrule5.dic right_to_left_mark.dic checkcompoundpattern2.dic utfcompound.dic 1592880.dic checkcompoundpattern4.dic checkcompoundpattern3.dic \ncolons_in_words.dic i53643.dic germancompoundingold.dic germancompounding.dic reputf.dic maputf.dic i68568utf.dic i68568.dic 1748408-1.dic 1706659.dic 1748408-3.dic digits_in_words.dic 1748408-2.dic \n1748408-4.dic 1695964.dic checksharpsutf.dic fullstrip.dic 1463589_utf.dic i35725.dic iconv2.dic iconv.dic arabic.dic 1975530.dic IJ.dic morph.dic 2999225.dic warn.dic korean.dic 2970240.dic \n2970242.dic ngram_utf_fix.dic breakoff.dic opentaal_cpdpat.dic opentaal_cpdpat2.dic onlyincompound2.dic oconv.dic nepali.dic hu.dic oconv2.dic opentaal_forbiddenword2.dic opentaal_forbiddenword1.dic \nopentaal_keepcase.dic forceucase.dic limit-multiple-compounding.dic ignoresug.dic timelimit.dic\"\n\n# Failing unit test cases\nFAILED_TESTS=\"condition.dic rep.dic map.dic checkcompoundrep.dic checkcompoundcase2.dic checkcompoundpattern.dic checksharps.dic i54980.dic i54633.dic 1463589.dic encoding.dic\"\n\n# Run unit test while temporarily ignore failing unit test cases\nmake check -C tests -j$(nproc) TESTS=\"$TESTS\"\n"
  },
  {
    "path": "projects/hwloc/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y python-is-python3 build-essential \\\n    autoconf automake libtool zlib1g-dev pkg-config\n\nRUN git clone --recurse-submodules https://github.com/open-mpi/hwloc hwloc\nCOPY *.sh *_fuzzer.c *.options $SRC/\nWORKDIR $SRC/hwloc\n"
  },
  {
    "path": "projects/hwloc/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n./autogen.sh\n./configure --enable-static --disable-shared LDFLAGS=\"-static\" CFLAGS=\"${CFLAGS}\" LDFLAGS=\"${CFLAGS}\"\nmake LDFLAGS=-all-static\n\nfor f in $SRC/*_fuzzer.c; do\n  fuzzer=$(basename \"$f\" _fuzzer.c)\n  $CC $CFLAGS -I$SRC/hwloc/include -I$SRC/hwloc/private -c $SRC/${fuzzer}_fuzzer.c \\\n    -o $SRC/${fuzzer}_fuzzer.o\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/${fuzzer}_fuzzer.o \\\n    -o $OUT/${fuzzer}_fuzzer \\\n    -Wl,--start-group ./hwloc/.libs/libhwloc.a \\\n    ./utils/hwloc/.libs/libutils_common.a -Wl,--end-group\ndone\n\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/hwloc/hwloc_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"hwloc.h\"\n#include \"private/private.h\"\n#include <string.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Fuzz  base64 logic\n  char *source = (char *)(data);\n  char *target = (char *)malloc(100);\n\n  hwloc_encode_to_base64(source, size, target, 100);\n\n  char *new_str = (char *)malloc(size + 1);\n  if (new_str == NULL) {\n    return 0;\n  }\n  memcpy(new_str, data, size);\n  new_str[size] = '\\0';\n\n  hwloc_decode_from_base64(new_str, target, 100);\n  free(new_str);\n  free(target);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/hwloc/hwloc_fuzzer.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/hwloc/project.yaml",
    "content": "homepage: \"https://github.com/open-mpi/hwloc\"\nmain_repo: \"https://github.com/open-mpi/hwloc\"\nlanguage: c\nvendor_ccs:\n- david@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/hwloc/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake -C utils/hwloc check\n"
  },
  {
    "path": "projects/hyperium/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone https://github.com/hyperium/http\nRUN git clone https://github.com/hyperium/h2\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/hyperium/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/http\ncargo fuzz build -O\ncp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_http $OUT/\n\ncd $SRC/h2\ncargo fuzz build -O\ncp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_client $OUT/\ncp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_e2e $OUT/\ncp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_hpack $OUT/\n\nfor fuzz_name in fuzz_e2e fuzz_client; do\n\techo \"[libfuzzer]\" > $OUT/${fuzz_name}.options\n\techo \"detect_leaks=0\" >> $OUT/${fuzz_name}.options\ndone\n"
  },
  {
    "path": "projects/hyperium/project.yaml",
    "content": "homepage: \"https://github.com/hyperium/\"\nmain_repo: \"https://github.com/hyperium/\"\nprimary_contact: \"sean.monstar@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"ver@buoyant.io\"\n  - \"eliza@buoyant.io\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/ibmswtpm2/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nARG SIM_DL_URL=https://downloads.sourceforge.net/project/ibmswtpm2/ibmtpm1332.tar.gz\nRUN apt-get update && apt-get install -y make autoconf automake libtool libssl-dev curl tar g++\nRUN mkdir ibmswtpm2 && \\\n  cd ibmswtpm2 && \\\n  curl -sSL \"${SIM_DL_URL}\" | tar xvz\nWORKDIR ibmswtpm2/src\nCOPY build.sh $SRC/\nCOPY fuzzer.cc ./\nCOPY no_writes.patch $SRC/\nRUN patch -p1 < $SRC/no_writes.patch\n"
  },
  {
    "path": "projects/ibmswtpm2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmake -j$(nproc) fuzz_tpm_server\ncp fuzz_tpm_server $OUT/fuzz_tpm_server\n"
  },
  {
    "path": "projects/ibmswtpm2/fuzzer.cc",
    "content": "#include \"TpmBuildSwitches.h\"\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <ctype.h>\n#include <string.h>\n#ifdef TPM_WINDOWS\n#include <windows.h>\n#include <winsock.h>\n#endif\n\nextern \"C\" {\n#include \"Implementation.h\"\t/* kgold */\n#include \"TpmTcpProtocol.h\"\n#include \"Manufacture_fp.h\"\n#include \"Platform_fp.h\"\n#include \"Simulator_fp.h\"\n#ifdef TPM_WINDOWS\n#include \"TcpServer_fp.h\"\n#endif\n#ifdef TPM_POSIX\n#include \"TcpServerPosix_fp.h\"\n#endif\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  int pipefd[2];\n\n  if (Data == NULL || Size == 0) {\n    return 0;\n  }\n\n  if (pipe(pipefd) == -1) {\n    perror(\"creating pipe\");\n    exit(EXIT_FAILURE);\n  }\n\n  if (write(pipefd[1], Data, Size) != (ssize_t)Size) {\n    perror(\"write to pipe\");\n    exit(EXIT_FAILURE);\n  }\n\n  close(pipefd[1]);\n\n  _plat__NVEnable(NULL);\n  if (TPM_Manufacture(1) != 0) {\n    dprintf(STDERR_FILENO, \"[FAILED] manufacturing\\n\");\n    exit(1);\n  }\n  // Coverage test - repeated manufacturing attempt\n  if (TPM_Manufacture(0) != 1) {\n    dprintf(STDERR_FILENO, \"[FAILED] Coverage test - repeated manufacturing attempt\\n\");\n    exit(2);\n  }\n  // Coverage test - re-manufacturing\n  TPM_TearDown();\n  if (TPM_Manufacture(1) != 0) {\n    dprintf(STDERR_FILENO, \"[FAILED] Coverage test - re-manufacturing\\n\");\n    exit(3);\n  }\n  // Disable NV memory\n  _plat__NVDisable();\n  /* power on the TPM kgold MS simulator comes up powered off */\n  _rpc__Signal_PowerOn(FALSE);\n  _rpc__Signal_NvOn();\n\n  // From TSS2 MSSIM simulator_setup\n  // tcti_platform_command (tctiContext, MS_SIM_POWER_ON);\n  _rpc__Signal_PowerOn(FALSE);\n  // tcti_platform_command (tctiContext, MS_SIM_NV_ON);\n  _rpc__Signal_NvOn();\n\n  TpmServer(pipefd[0]);\n\n  close(pipefd[0]);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/ibmswtpm2/no_writes.patch",
    "content": "diff --git a/CompilerDependencies.h b/CompilerDependencies.h\nindex b6c0577..c89b125 100644\n--- a/CompilerDependencies.h\n+++ b/CompilerDependencies.h\n@@ -146,7 +146,7 @@\n #ifndef NOT_REFERENCED\n #   define  NOT_REFERENCED(x) (x = x)\n #endif\n-#ifdef _POSIX_\n+#ifdef IS_POSIX\n typedef int SOCKET;\n #endif\n // #ifdef TPM_POSIX\ndiff --git a/GpMacros.h b/GpMacros.h\nindex ff4251d..3494b55 100644\n--- a/GpMacros.h\n+++ b/GpMacros.h\n@@ -84,7 +84,7 @@\n #   define TEST_HASH(alg)\n #endif // SELF_TEST\n /* 5.11.3\tFor Failures */\n-#if defined _POSIX_\n+#if defined IS_POSIX\n #   define FUNCTION_NAME        0\n #else\n #   define FUNCTION_NAME        __FUNCTION__\ndiff --git a/TPMCmds.c b/TPMCmds.c\nindex 173dcf7..0805575 100644\n--- a/TPMCmds.c\n+++ b/TPMCmds.c\n@@ -110,7 +110,12 @@ Usage(\n /* This is the main entry point for the simulator. */\n /* It registers the interface and starts listening for clients */\n int\n-main(\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+main\n+#else\n+tpm_server_main\n+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */\n+(\n      int              argc,\n      char            *argv[]\n      )\ndiff --git a/TcpServerPosix.c b/TcpServerPosix.c\nindex be48607..8dfcbea 100644\n--- a/TcpServerPosix.c\n+++ b/TcpServerPosix.c\n@@ -721,9 +721,11 @@ TpmServer(\n \t\t\t    memcpy(&CommandResponseSizes.largestResponse,\n \t\t\t\t   &OutputBuffer[6], sizeof(UINT32));\n \t\t\t}\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n \t\t    ok = WriteVarBytes(s,\n \t\t\t\t       (char*) OutBuffer.Buffer,\n \t\t\t\t       OutBuffer.BufferSize);\n+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */\n \t\t    if(!ok)\n \t\t\treturn TRUE;\n \t\t    break;\n@@ -737,9 +739,11 @@ TpmServer(\n \t\t\t    printf(\"Unsupported client version (0).\\n\");\n \t\t\t    return TRUE;\n \t\t\t}\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n \t\t    ok &= WriteUINT32(s, ServerVersion);\n \t\t    ok &= WriteUINT32(s,\n \t\t\t\t      tpmInRawMode | tpmPlatformAvailable | tpmSupportsPP);\n+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */\n \t\t    break;\n \t\t    \n \t\t  case TPM_SET_ALTERNATIVE_RESULT:\n@@ -760,7 +764,9 @@ TpmServer(\n \t\t    printf(\"Unrecognized TPM interface command %08x\\n\", Command);\n \t\t    return TRUE;\n \t\t}\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n \t    ok = WriteUINT32(s,0);\n+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */\n \t    if(!ok)\n \t\treturn TRUE;\n \t}\ndiff --git a/makefile b/makefile\nindex cc3e410..c10ba5a 100644\n--- a/makefile\n+++ b/makefile\n@@ -40,16 +40,16 @@\n \n \n-CC = /usr/bin/gcc\n \n-CCFLAGS = -Wall  \t\t\t\\\n+CCFLAGS = $(CFLAGS) -Wall  \t\t\t\\\n \t-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \\\n-\t-Werror -Wsign-compare \\\n+\t-Wsign-compare \\\n \t -c -ggdb -O0 \t\t\t\\\n \t-DTPM_POSIX\t\t\t\\\n-\t-D_POSIX_\t\t\t\\\n+\t-DIS_POSIX\t\t\t\\\n \t-DTPM_NUVOTON\t\t\t\\\n \t-I../utils\t\t\t\\\n-\t-I.\n+\t-I. \\\n+\t-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n \n LNFLAGS = -ggdb \t\t\t\\\n \t-DTPM_POSIX\t\t\t\\\n@@ -57,7 +60,8 @@ LNFLAGS = -ggdb \t\t\t\\\n \t-lcrypto\t\t\t\\\n \t-lpthread\t\t\t\\\n \t-lrt\t\t\t\t\\\n-\t-I.\n+\t-I. \\\n+\t-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION $(LIB_FUZZING_ENGINE)\n \n all:\ttpm_server\n \n@@ -75,9 +79,14 @@ TcpServerPosix.o\t: $(HEADERS)\n tpm_server:\t$(OBJFILES)\n \t\t$(CC) $(OBJFILES) $(LNFLAGS) -o tpm_server\n \n+fuzz_tpm_server:\t$(OBJFILES) fuzzer.o\n+\t\t$(CXX) $(CXXFLAGS) fuzzer.o $(OBJFILES) $(LNFLAGS) -o fuzz_tpm_server\n+\n clean:\t\t\n-\t\trm -f *.o tpm_server *~\n+\t\trm -f *.o tpm_server fuzz_tpm_server *~\n \n %.o:\t\t%.c\n \t\t$(CC) $(CCFLAGS) $< -o $@\n \n+%.o:\t\t%.cc\n+\t\t$(CXX) $(CXXFLAGS) $(CCFLAGS) $(LIB_FUZZING_ENGINE) $< -o $@\n"
  },
  {
    "path": "projects/ibmswtpm2/project.yaml",
    "content": "homepage: https://sourceforge.net/projects/ibmswtpm2/\nlanguage: c++\nprimary_contact: kgoldman@us.ibm.com\nmain_repo: https://git.code.sf.net/p/ibmswtpm2/tpm2\nauto_ccs:\n  - \"john.s.andersen@intel.com\"\n  - \"william.c.roberts@intel.com\"\n  - \"david.wooten@ieee.org\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/ical4j/project.yaml",
    "content": "homepage: \"https://github.com/ical4j/ical4j\"\nlanguage: jvm\nprimary_contact: \"fortuna@micronode.com\"\nsanitizers:\n  - address\nmain_repo: 'https://github.com/ical4j/ical4j.git'\n"
  },
  {
    "path": "projects/icalendar/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone --depth 1 https://github.com/collective/icalendar.git icalendar \\\n        && cp icalendar/src/icalendar/fuzzing/build.sh $SRC/\nRUN mv icalendar/src/icalendar/fuzzing/corpus $SRC/corpus\nWORKDIR $SRC/icalendar\n\n"
  },
  {
    "path": "projects/icalendar/project.yaml",
    "content": "homepage: \"https://icalendar.readthedocs.io/en/latest/\"\nlanguage: python\nprimary_contact: \"johannes@raggam.co.at\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\n  - \"niccokunzmann@googlemail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/collective/icalendar.git\"\n"
  },
  {
    "path": "projects/icu/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\n\nRUN git clone --depth 1 https://github.com/unicode-org/icu.git icu\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/icu/build.sh",
    "content": "#!/bin/bash -eux\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# need \"-p\" as otherwise centipede fails\nmkdir -p $WORK/icu\ncd $WORK/icu\n\n# TODO: icu build failes without -DU_USE_STRTOD_L=0\nDEFINES=\"-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_USE_STRTOD_L=0\"\nCFLAGS=\"$CFLAGS $DEFINES\"\nCXXFLAGS=\"$CXXFLAGS $DEFINES\"\n\nCFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS CC=$CC CXX=$CXX \\\n  /bin/bash $SRC/icu/icu4c/source/runConfigureICU Linux \\\n   --with-library-bits=64 --with-data-packaging=static --enable-static --disable-shared\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nexport UBSAN_OPTIONS=\"detect_leaks=0,enum=0\"\n\nmake -j$(nproc)\n\n# Pick up additional flags (-std=...) added by runConfigureICU.\nCXXFLAGS=\"$CXXFLAGS $(config/icu-config --noverify --cxxflags)\"\n\n$CXX $CXXFLAGS -c $SRC/icu/icu4c/source/test/fuzzer/locale_util.cpp \\\n     -I$SRC/icu/icu4c/source/common \\\n     -I$SRC/icu4c/source/test/fuzzer\n\nFUZZER_PATH=$SRC/icu/icu4c/source/test/fuzzer\n# Assumes that all fuzzers files end with'_fuzzer.cpp'.\nFUZZERS=$FUZZER_PATH/*_fuzzer.cpp\n\nfor fuzzer in $FUZZERS; do\n  file=${fuzzer:${#FUZZER_PATH}+1}\n  $CXX $CXXFLAGS \\\n    $fuzzer -o $OUT/${file/.cpp/} locale_util.o \\\n    -I$SRC/icu/icu4c/source/common -I$SRC/icu/icu4c/source/i18n -L$WORK/icu/lib \\\n    $LIB_FUZZING_ENGINE -licui18n -licuuc -licutu -licudata\ndone\n\n# Assumes that all seed files end with '*_fuzzer_seed_corpus.txt'.\nCORPUS=$SRC/icu/icu4c/source/test/fuzzer/*_fuzzer_seed_corpus.txt\nfor corpus in $CORPUS; do\n    zipfile=${corpus:${#FUZZER_PATH}+1}\n    zip $OUT/${zipfile/.txt/.zip} $corpus\ndone\n\ncp $SRC/icu/icu4c/source/test/fuzzer/*.dict  $OUT/\n"
  },
  {
    "path": "projects/icu/project.yaml",
    "content": "homepage: \"https://icu.unicode.org\"\nlanguage: c++\nprimary_contact: \"ftang@google.com\"\nauto_ccs:\n - icu-security@unicode.org\n - andy.heninger@gmail.com\n - markus.icu@gmail.com\n - jefgen.msft@gmail.com\n - shane@unicode.org\n - srl295@gmail.com\n - ftang@google.com\n - roubert@google.com\n - elango@unicode.org\n - richard_gillam@apple.com\n - grhoten@gmail.com \nsanitizers:\n - address\n - undefined \n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\n  # - centipede disabled due to https://github.com/google/oss-fuzz/pull/12365 clang 18 update\n\nmain_repo: 'https://github.com/unicode-org/icu.git'\n"
  },
  {
    "path": "projects/icu/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $WORK/icu\nmake check\n"
  },
  {
    "path": "projects/idna/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/kjd/idna idna\nWORKDIR idna\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/idna/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/idna/fuzz_encode_decode.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nimport idna\n\n\ndef TestOneInput(data):\n    \"\"\"Fuzz encode and decode\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        idna.core.encode(fdp.ConsumeString(1024))\n    except idna.IDNAError:\n        pass\n    \n    try:\n        idna.core.decode(fdp.ConsumeString(1024))\n    except idna.IDNAError:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/idna/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/kjd/idna\nlanguage: python\nmain_repo: https://github.com/kjd/idna\nprimary_contact: kim@cynosure.com.au\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/igraph/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake bison flex\nRUN git clone --branch main  https://github.com/igraph/igraph\nWORKDIR igraph\nRUN cp $SRC/igraph/fuzzing/build.sh $SRC/build.sh\n"
  },
  {
    "path": "projects/igraph/project.yaml",
    "content": "homepage: \"https://github.com/igraph/igraph\"\nmain_repo: \"https://github.com/igraph/igraph\"\nlanguage: c\nprimary_contact: \"szhorvat@gmail.com\"\ncoverage_extra_args: -ignore-filename-regex=.*libxml2-2.*/.* -ignore-filename-regex=.*/vendor/.*\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"ntamas@gmail.com\"\n  - \"vtraag@gmail.com\"\n  - \"igraphossfuzz@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n  - i386\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n  - centipede\n"
  },
  {
    "path": "projects/ijson/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y libffi-dev ruby mercurial\nRUN pip3 install --upgrade pip cffi\nRUN git clone https://github.com/ICRAR/ijson ijson\nRUN git clone https://github.com/lloyd/yajl\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/ijson\n"
  },
  {
    "path": "projects/ijson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n    export CFLAGS=\"\"\n    export CXXFLAGS=\"\"\nfi\n\ncd $SRC/yajl/\n./configure\nmake install\n\ncd $SRC/ijson\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data /usr/local/lib/libyajl.so:. --add-data /usr/local/lib/libyajl.so.2:.\ndone\n"
  },
  {
    "path": "projects/ijson/fuzz_all.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport io\nimport sys\nimport json\nimport ijson\nimport atheris\n\n\ndef TestOneInput(data):\n  for parser_type in ['yajl2_c', 'yajl2_cffi', 'yajl2', 'yajl', 'python']:\n    try:\n      backend = ijson.get_backend(parser_type)\n    except:\n      # If we can't get the backend, just continue to the next.\n      continue\n    try:\n      parse_items = backend.parse(io.BytesIO(data))\n      for obj in ijson.items(parse_items, 'item'):\n        pass\n    except (\n      ijson.common.JSONError,\n      json.JSONDecodeError\n    ):\n      pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ijson/fuzz_native_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport io\nimport sys\nimport json\nimport ijson\nimport atheris\nfrom  ijson.backends import yajl2_c\n\n\ndef TestOneInput(data):\n  native_backend = ijson.get_backend(\"yajl2_c\")\n  try:\n    parse_items = native_backend.parse(io.BytesIO(data))\n    for obj in ijson.items(parse_items, 'item'):\n      pass\n  except (\n    ijson.common.JSONError,\n    json.JSONDecodeError\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ijson/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport io\nimport sys\nimport json\nimport ijson\nimport atheris\n\n\ndef TestOneInput(data):\n  try:\n    parse_items = ijson.parse(io.BytesIO(data))\n    for obj in ijson.items(parse_items, 'item'):\n      pass\n  except (\n    ijson.common.JSONError,\n    json.JSONDecodeError\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ijson/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/ICRAR/ijson\nlanguage: python\nmain_repo: https://github.com/ICRAR/ijson\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/image-png/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl cmake python llvm-dev libclang-dev clang\n\nRUN git clone https://github.com/image-rs/image-png\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/image-png/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC\ncd image-png\ncargo fuzz build -O\n\ncp fuzz/target/x86_64-unknown-linux-gnu/release/decode $OUT/\nfind . -type f -name \"*.png\" -exec zip -r -j \"$OUT/decode_seed_corpus.zip\" {} +\n\ncp fuzz/target/x86_64-unknown-linux-gnu/release/buf_independent $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/roundtrip $OUT/\n\n"
  },
  {
    "path": "projects/image-png/project.yaml",
    "content": "homepage: \"https://github.com/image-rs/image-png\"\nmain_repo: \"https://github.com/image-rs/image-png\"\nprimary_contact: \"andreas.molzer@gmx.de\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\nfile_github_issue: True\n"
  },
  {
    "path": "projects/image-rs/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone https://github.com/image-rs/image\nWORKDIR $SRC/image\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/image-rs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# ---- Build fuzz corpuses ---- #\nfunction zip_files() {\n   # Get the arguments\n   directory=$1\n   extension=$2\n   zipfile=$3\n\n   # Find all files with the given extension in the given directory and its subdirectories\n   # and add them to the zip file\n   find \"$directory\" -type f -name \"*.$extension\" -exec zip -r -j \"$zipfile\" {} +\n}\n\nFORMATS=(\"bmp\" \"exr\" \"gif\" \"hdr\" \"ico\" \"jpeg\" \"png\" \"pnm\" \"tga\" \"tiff\" \"webp\")\n\nfor FORMAT in \"${FORMATS[@]}\"\ndo\n     zip_files . $FORMAT \"$OUT/fuzzer_script_${FORMAT}_seed_corpus.zip\"\ndone\n\n# ---- Build fuzz harnesses ----\n\ncargo fuzz build -O\ncargo fuzz list | while read i; do\n    cp fuzz/target/x86_64-unknown-linux-gnu/release/$i $OUT/\ndone\n"
  },
  {
    "path": "projects/image-rs/project.yaml",
    "content": "homepage: \"https://docs.rs/image/0.23.14/image\"\nmain_repo: \"https://github.com/image-rs/image\"\nprimary_contact: \"andreas.molzer@gmx.de\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n"
  },
  {
    "path": "projects/imageio/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt update && apt-get install -y zlib1g-dev libjpeg8-dev\nRUN pip3 install cython numpy\n\nRUN git clone https://github.com/imageio/imageio\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/imageio\n"
  },
  {
    "path": "projects/imageio/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 setup.py build install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find . -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/imageio/project.yaml",
    "content": "homepage: \"https://imageio.github.io\"\nlanguage: python\nprimary_contact: \"almar.klein@gmail.com\"\nauto_ccs:\n  - \"sebastian@wallkoetter.net\"\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/imageio/imageio'\n"
  },
  {
    "path": "projects/imagemagick/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Install build tools\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake groff libtool pkg-config cmake nasm autopoint\n\n# Due to libtiff requirements, build requires autoconf 2.71 (or later)\n# Can probably be removed once base-builder switches to Ubuntu 22.04\nRUN curl -LO https://mirrors.edge.kernel.org/ubuntu/pool/main/a/autoconf/autoconf_2.72-3.1ubuntu1_all.deb && \\\n    apt install ./autoconf_2.72-3.1ubuntu1_all.deb\n\n# Clone dependencies\nRUN git clone --depth 1 https://github.com/imagemagick/imagemagick\nRUN git clone --depth 1 https://gitlab.com/libtiff/libtiff\nRUN git clone --depth 1 https://github.com/strukturag/libde265\nRUN git clone --depth 1 https://github.com/strukturag/libheif\nRUN git clone --depth 1 https://github.com/uclouvain/openjpeg\nRUN git clone --depth 1 https://github.com/webmproject/libwebp\nRUN git clone --depth 1 https://github.com/madler/zlib\nRUN git clone --depth 1 https://github.com/ebiggers/libdeflate\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo\nRUN git clone --depth 1 https://github.com/tukaani-project/xz\nRUN git clone --depth 1 https://github.com/libraw/libraw\nRUN git clone --depth 1 https://github.com/pnggroup/libpng\nRUN git clone --depth 1 https://github.com/mm2/Little-CMS\nRUN git clone --depth 1 https://github.com/freetype/freetype\nRUN git clone --depth 1 https://gitlab.com/federicomenaquintero/bzip2.git\nRUN git clone --depth 1 --recursive https://github.com/libjxl/libjxl\nRUN git clone https://www.cl.cam.ac.uk/~mgk25/git/jbigkit # does not support shallow\n\nADD https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz afl_testcases.tgz\n\nWORKDIR imagemagick\nCOPY build.sh run_tests.sh replay_build.sh $SRC/\n"
  },
  {
    "path": "projects/imagemagick/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.  #\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Temporarily Add -D_GNU_SOURCE to CFLAGS to fix freetype's dependence on GNU\n# extensions for dlsym to dynamically load harfbuzz. This feature\n# should potentially be disabled instead of fixing the compilation. But that is\n# not possible to do from the OSS-Fuzz repo :-)\n# See https://github.com/google/oss-fuzz/pull/13325 for more details.\nexport CFLAGS=\"$CFLAGS -D_GNU_SOURCE\"\n. oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/imagemagick/project.yaml",
    "content": "homepage: \"https://www.imagemagick.org\"\nlanguage: c++\nprimary_contact: \"dirk@lemstra.org\"\nauto_ccs:\n  - paul.l.kehrer@gmail.com\n  - alex.gaynor@gmail.com\n  - urban.warrior.fuzz@gmail.com\n  - jon.sneyers@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/imagemagick/imagemagick'\n"
  },
  {
    "path": "projects/imagemagick/replay_build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##############################################################################\n\n# Prepare wrappers to make recompilation faster.\nif [ ! -f /usr/bin/bash.real ]; then\n  # Only run this once.\n  python /usr/local/bin/make_build_replayable.py\nfi\n\n\nMAGICK_COMPILER=$CXX\nMAGICK_COMPILER_FLAGS=$CXXFLAGS\nMAGICK_INCLUDE=\"$WORK/include/ImageMagick-7\"\nMAGICK_SRC=\"$SRC/imagemagick/oss-fuzz\"\nMAGICK_LIBS_NO_FUZZ=\"$WORK/lib/libMagick++-7.Q16HDRI.a $WORK/lib/libMagickWand-7.Q16HDRI.a $WORK/lib/libMagickCore-7.Q16HDRI.a $WORK/lib/libpng.a $WORK/lib/libtiff.a $WORK/lib/libheif.a $WORK/lib/libde265.a $WORK/lib/libopenjp2.a $WORK/lib/libwebp.a $WORK/lib/libwebpmux.a $WORK/lib/libwebpdemux.a $WORK/lib/libsharpyuv.a $WORK/lib/libhwy.a $WORK/lib/libbrotlicommon.a $WORK/lib/libbrotlidec.a $WORK/lib/libbrotlienc.a $WORK/lib/libjxl_threads.a $WORK/lib/libjxl_cms.a $WORK/lib/libjxl.a $WORK/lib/libturbojpeg.a $WORK/lib/libjpeg.a $WORK/lib/libfreetype.a $WORK/lib/libraw.a $WORK/lib/liblzma.a $WORK/lib/liblcms2.a $WORK/lib/libdeflate.a $WORK/lib/libz.a\"\nMAGICK_LIBS=\"$LIB_FUZZING_ENGINE $MAGICK_LIBS_NO_FUZZ\"\nMAGICK_OUTPUT=$OUT\nMAGICK_FAST_BUILD=0\n\n. $MAGICK_SRC/build_dependencies.sh\n. $MAGICK_SRC/build_imagemagick.sh\n\n# Move on the building the fuzzers\nMAGICK_COMPILER_FLAGS=\"$MAGICK_COMPILER_FLAGS -fuse-ld=lld -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16\"\n\n$MAGICK_COMPILER $MAGICK_COMPILER_FLAGS -std=c++11 -I$MAGICK_INCLUDE \"$MAGICK_SRC/encoder_list.cc\" \\\n    -o \"$MAGICK_SRC/encoder_list\" $MAGICK_LIBS_NO_FUZZ\n\n\n# Control the target fuzzer from the command line. Hardcoded below commented\n# out is for testing purposes, and to illustrate the logic behind it.\n# TARGET_FUZZER=\"encoder_sgi_fuzzer\"\nTARGET_FUZZER=$1\n\nfor f in $MAGICK_SRC/*_fuzzer.cc; do\n    fuzzer=$(basename \"$f\" _fuzzer.cc)\n    out_fuzzname=$(basename \"$f\" .cc)\n    echo \"Real fuzz name: ${out_fuzzname}\"\n    # encoder_fuzzer is special\n    if [ \"$fuzzer\" == \"encoder\" ]; then\n        continue\n    fi\n    if [ \"$out_fuzzname\" != \"$TARGET_FUZZER\" ]; then\n        continue\n    fi\n    $MAGICK_COMPILER $MAGICK_COMPILER_FLAGS -std=c++11 -I$MAGICK_INCLUDE \\\n        \"$f\" -o \"$MAGICK_OUTPUT/${fuzzer}_fuzzer\" $MAGICK_LIBS &\n    echo -e \"[libfuzzer]\\nclose_fd_mask=3\" > \"$MAGICK_OUTPUT/${fuzzer}_fuzzer.options\"\ndone\n\nfor item in $(\"$MAGICK_SRC/encoder_list\"); do\n    info=${item:1}\n    encoder=${info%:*}\n    initializer=${info##*:}\n    encoder_flags=\"-DFUZZ_IMAGEMAGICK_ENCODER=$encoder\"\n    out_fuzzname=\"encoder_${encoder,,}_fuzzer\"\n    if [ \"$out_fuzzname\" != \"$TARGET_FUZZER\" ]; then\n        continue\n    fi\n\n    if [ \"$initializer\" != \"\" ]; then\n      encoder_flags=\"$encoder_flags -DFUZZ_IMAGEMAGICK_ENCODER_INITIALIZER=$initializer\"\n    fi\n\n    if [ \"${item:0:1}\" == \"+\" ]; then\n        encoder_flags=\"$encoder_flags -DFUZZ_IMAGEMAGICK_ENCODER_WRITE=1\"\n    fi\n\n    $MAGICK_COMPILER $MAGICK_COMPILER_FLAGS -std=c++11 -I$MAGICK_INCLUDE \\\n        \"$MAGICK_SRC/encoder_fuzzer.cc\" -o \"$MAGICK_OUTPUT/encoder_${encoder,,}_fuzzer\" \\\n         $encoder_flags $MAGICK_LIBS &\n\n    echo -e \"[libfuzzer]\\nclose_fd_mask=3\" > \"$MAGICK_OUTPUT/encoder_${encoder,,}_fuzzer.options\"\n\n    if [ -f \"$MAGICK_SRC/dictionaries/${encoder,,}.dict\" ]; then\n        cp \"$MAGICK_SRC/dictionaries/${encoder,,}.dict\" \"$MAGICK_OUTPUT/encoder_${encoder,,}_fuzzer.dict\"\n    fi\n\n    if [ $MAGICK_FAST_BUILD -eq 1 ]; then\n        break\n    fi\ndone\n\nwait\n"
  },
  {
    "path": "projects/imagemagick/run_tests.sh",
    "content": "#!/bin/sh -e\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nrgrep --files-with-matches '\\-lheif' . \\\n  | xargs -r sed -i 's/-lheif/-lheif -lc++/'\n\n# TODO: `make check` is preferred over `make check-TESTS`, as it is the public\n# interface for comprehensive testing of ImageMagick.\nmake -j\"$(nproc)\" check-TESTS\n\n# Undo patches.\nrgrep --files-with-matches -- '-lheif -lc++' . \\\n  | xargs -r sed -i 's/-lheif -lc++/-lheif/'\n"
  },
  {
    "path": "projects/immer/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n# ! This project was pinned after a clang bump. Please remove the pin, Try to fix any build warnings and errors, as well as runtime errors\nRUN apt-get update && apt-get install -y cmake libgc-dev pkg-config\nRUN git clone --depth 1 https://github.com/arximboldi/immer.git immer\nWORKDIR immer\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/immer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nmkdir build\ncd build\ncmake .. \\\n      -DBoehmGC_INCLUDE_DIR=/usr/include \\\n      -DBoehmGC_LIBRARIES=/usr/lib/x86_64-linux-gnu/libgc.a \\\n      -Dimmer_BUILD_TESTS=OFF\nmake -j$(nproc) fuzzers\n\nfor fuzzer in extra/fuzzer/*; do\n    if [[ -f $fuzzer && -x $fuzzer ]]; then\n        cp $fuzzer $OUT\n    fi\ndone\n"
  },
  {
    "path": "projects/immer/project.yaml",
    "content": "homepage: \"https://sinusoid.es/immer\"\nlanguage: c++\nprimary_contact: \"juanpe@sinusoid.al\"\nmain_repo: 'https://github.com/arximboldi/immer.git'\nsanitizers:\n  - address\n  - memory\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/importlib_metadata/Dockerfile",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/python/importlib_metadata importlib_metadata\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/importlib_metadata\n"
  },
  {
    "path": "projects/importlib_metadata/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/importlib_metadata/fuzz_importlib.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\nfrom importlib_metadata import (\n    Distribution,\n    EntryPoints,\n    PathDistribution,\n)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024))\n  list(Distribution._deps_from_requires_text(fuzz_str))\n  try:\n    list(EntryPoints._from_text(fuzz_str))\n  except TypeError:\n    pass\n  PathDistribution._name_from_stem(fuzz_str)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/importlib_metadata/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/python/importlib_metadata\nlanguage: python\nmain_repo: https://github.com/python/importlib_metadata\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/inchi/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget make unzip git\nRUN git clone --depth=1 https://github.com/IUPAC-InChI/InChI inchi\nWORKDIR inchi\nCOPY run_tests.sh build.sh *_fuzzer.c $SRC/\n"
  },
  {
    "path": "projects/inchi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd INCHI-1-SRC\n# Compile library sources (exclude ichimain.c which is the standalone program main)\n# Remove -ansi flag since upstream now uses C99 features (loop-scoped variables)\nSRC_FILES=$(ls INCHI_BASE/src/*.c INCHI_API/libinchi/src/*.c INCHI_API/libinchi/src/ixa/*.c | grep -v ichimain.c)\n$CC $CFLAGS -Wno-everything -DTARGET_API_LIB -c $SRC_FILES\n\nar rcs $WORK/libinchi.a *.o\n\nfor fuzzer in $SRC/*_fuzzer.c; do\n  fuzzer_basename=$(basename -s .c $fuzzer)\n\n  $CC $CFLAGS \\\n      -I INCHI_BASE/src/ \\\n      -I INCHI_API/libinchi/src/ \\\n      -I INCHI_API/libinchi/src/ixa/ \\\n      $fuzzer -c -o ${fuzzer_basename}.o\n\n  $CXX $CXXFLAGS \\\n      ${fuzzer_basename}.o -o $OUT/$fuzzer_basename \\\n      $LIB_FUZZING_ENGINE $WORK/libinchi.a\ndone\npopd\n\n# Build test\nINCHI-1-TEST/build_with_cmake.sh all\n"
  },
  {
    "path": "projects/inchi/inchi_input_fuzzer.c",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"inchi_api.h\"\n\n// Define the maximum value for size_t. We return if the fuzzing input is equal\n// to kSizeMax because appending the null-terminator to the InChI buffer would\n// cause wraparound, thereby initializing the buffer to size 0.\nstatic const size_t kSizeMax = (size_t)-1;\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  if (size == kSizeMax)\n    return 0;\n\n  char *szINCHISource = malloc(sizeof(char) * (size + 1));\n  memcpy(szINCHISource, data, size);\n  szINCHISource[size] = '\\0'; // InChI string must be null-terminated\n\n  // Buffer lengths taken from InChI API reference, located at\n  // https://www.inchi-trust.org/download/104/InChI_API_Reference.pdf, page 24\n  char szINCHIKey[28], szXtra1[65], szXtra2[65];\n  GetINCHIKeyFromINCHI(szINCHISource, 0, 0, szINCHIKey, szXtra1, szXtra2);\n\n  inchi_InputINCHI inpInChI;\n  inpInChI.szInChI = szINCHISource;\n  inpInChI.szOptions = NULL;\n\n  inchi_Output out;\n  GetINCHIfromINCHI(&inpInChI, &out);\n\n  inchi_OutputStruct outStruct;\n  GetStructFromINCHI(&inpInChI, &outStruct);\n\n  free(szINCHISource);\n  FreeINCHI(&out);\n  FreeStructFromINCHI(&outStruct);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/inchi/project.yaml",
    "content": "homepage: \"https://www.inchi-trust.org/\"\nmain_repo: \"https://github.com/IUPAC-InChI/InChI\"\nlanguage: c\nprimary_contact: \"member-info@inchi-trust.org\"\nsanitizers:\n  - address\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/inchi/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Excluding unit test case that failed\nctest --test-dir CMake_build/full_build -E \"test_inchi_dll_b|test_permutation_util\"\n"
  },
  {
    "path": "projects/influxdb/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nMAINTAINER william@influxdata.com\nRUN git clone https://github.com/influxdata/influxdb.git\nRUN git clone https://github.com/dgrijalva/jwt-go.git\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/influxdb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n\ncompile_go_fuzzer github.com/influxdata/influxdb/jsonweb FuzzJsonWeb fuzzjsonweb\n"
  },
  {
    "path": "projects/influxdb/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/influxdata/influxdb\"\nlanguage: go\nprimary_contact: \"william@influxdata.com\"\nauto_ccs:\n  - \"palbert@influxdata.com\"\n  - \"ryan@influxdata.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\ndisabled: true\nmain_repo: 'https://github.com/influxdata/influxdb'\n"
  },
  {
    "path": "projects/iniconfig/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/pytest-dev/iniconfig\nWORKDIR iniconfig\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/iniconfig/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/iniconfig/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport iniconfig\n\n\ndef TestOneInput(data):\n    \"\"\"Simple fuzzer that targets parse routine\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        ini = iniconfig.IniConfig(\n            \"\",\n            fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n        )\n    except iniconfig.ParseError:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n\n"
  },
  {
    "path": "projects/iniconfig/project.yaml",
    "content": "file_github_issue: true\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pytest-dev/iniconfig\nlanguage: python\nmain_repo: https://github.com/pytest-dev/iniconfig\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\nview_restrictions: none\n"
  },
  {
    "path": "projects/inih/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update\nRUN git clone https://github.com/benhoyt/inih.git\nCOPY inihfuzz.c $SRC/inih/inihfuzz.c\nCOPY build.sh $SRC/build.sh\nCOPY run_tests.sh $SRC/\nWORKDIR $SRC/inih/\n"
  },
  {
    "path": "projects/inih/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Compile the fuzzer binary for oss-fuzz infrastructure.\n$CC $CFLAGS -c ini.c\n$CC $CFLAGS -c inihfuzz.c\n$CXX $CFLAGS $LIB_FUZZING_ENGINE inihfuzz.o ini.o -o inihfuzz\n\n# Setup for oss-fuzz infrastructure.\ncp inihfuzz $OUT/\nzip -r inihfuzz_seed_corpus.zip tests/*.ini\nmv inihfuzz_seed_corpus.zip $OUT/\n"
  },
  {
    "path": "projects/inih/inihfuzz.c",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"ini.h\"\n\n#define kMinInputLength 8\n#define kMaxInputLength 512\n\nint User;\nchar Prev_section[50];\n\nint dumper(void* user, const char* section, const char* name,\n           const char* value)\n{\n    User = *((int*)user);\n    if (strcmp(section, Prev_section)) {\n        strncpy(Prev_section, section, sizeof(Prev_section));\n        Prev_section[sizeof(Prev_section) - 1] = '\\0';\n    }\n    return 1;\n}\n\nextern int\nLLVMFuzzerTestOneInput(const char *data, size_t size)\n{\n    char *data_in;\n    static int u = 100;\n\n    if (size < kMinInputLength || size > kMaxInputLength) {\n        return 0;\n    }\n\n    Prev_section[0] = '\\0';\n\n    data_in = calloc((size + 1), sizeof(char));\n    if (!data_in) return 0;\n\n    memcpy(data_in, data, size);\n\n    ini_parse_string(data_in, dumper, &u);\n\n    free(data_in);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/inih/project.yaml",
    "content": "homepage: \"https://github.com/benhoyt/inih\"\nlanguage: c\nprimary_contact: \"benhoyt@gmail.com\"\nauto_ccs:\n  - \"pkillarjun@protonmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/benhoyt/inih'\n"
  },
  {
    "path": "projects/inih/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd tests\n./unittest.sh\n"
  },
  {
    "path": "projects/ion-java/.gitignore",
    "content": "project-parent/ion-java\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/ion-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/ion-java\nRUN git clone --recursive https://github.com/amazon-ion/ion-java.git $SRC/project-parent/ion-java\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/ion-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=ion-java\nPROJECT_GROUP_ID=com.amazon.ion\nPROJECT_ARTIFACT_ID=ion-java\nMAIN_REPOSITORY=https://github.com/amazon-ion/ion-java/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  # set_project_version_in_fuzz_targets_dependency\n\n  pushd $PROJECT\n    export ION_JAVA_VERSION=$(cat ./project.version)\n  popd\n\n  #install - use shadowJar instead of publishToMavenLocal to avoid ProGuard issues\n  # The ProGuard minifyJar task fails because Gradle toolchain downloads a different JDK\n  # than the one running Gradle, causing library jars to be missing.\n  (cd $PROJECT && ./gradlew shadowJar --info --stacktrace -x javadoc)\n  \n  # Manually install the shadowJar to local Maven repository\n  # The shadowJar uses \"shaded\" classifier, so the file is named ion-java-VERSION-shaded.jar\n  $MVN install:install-file \\\n    -Dfile=$PROJECT/build/libs/ion-java-$ION_JAVA_VERSION-shaded.jar \\\n    -DgroupId=com.amazon.ion \\\n    -DartifactId=ion-java \\\n    -Dversion=$ION_JAVA_VERSION \\\n    -Dpackaging=jar \\\n    -Dmaven.repo.local=$OUT/m2\n\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi\n"
  },
  {
    "path": "projects/ion-java/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.amazon.ion</groupId>\n            <artifactId>ion-java</artifactId>\n            <version>${env.ION_JAVA_VERSION}</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/ion-java/project-parent/fuzz-targets/src/test/java/com/example/IonReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.amazon.ion.*;\nimport com.amazon.ion.system.IonReaderBuilder;\n\nimport java.io.IOException;\n\n\nclass IonReaderFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            IonReader reader = IonReaderBuilder\n                                .standard()\n                                .withIncrementalReadingEnabled(data.consumeBoolean())\n                                .build(data.consumeRemainingAsString());\n            read(reader);\n            reader.close();\n        } catch (IOException | IllegalStateException | IllegalArgumentException | IonException e) {\n            // Need to be caught to get more interesting findings.\n        }\n    }\n\n    void read(IonReader reader) {\n        reader.next();\n        reader.stepIn();\n        reader.next();\n        reader.getFieldName();\n        reader.stringValue();\n        reader.stepOut();\n    }\n}\n"
  },
  {
    "path": "projects/ion-java/project-parent/fuzz-targets/src/test/java/com/example/IonWriterFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.amazon.ion.*;\nimport com.amazon.ion.system.IonReaderBuilder;\nimport com.amazon.ion.system.IonTextWriterBuilder;\nimport com.amazon.ion.system.IonBinaryWriterBuilder;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.nio.charset.Charset;\n\nimport static com.amazon.ion.system.IonTextWriterBuilder.ASCII;\nimport static com.amazon.ion.system.IonTextWriterBuilder.UTF8;\n\n\nclass IonWriterFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        int cn = 15;\n        int dummyNum = data.consumeInt(0, 2^cn - 1);\n        IonTextWriterBuilder ionTextWriterBuilder = null;\n        IonBinaryWriterBuilder ionBinaryWriterBuilder = null;\n\n        try {\n            for (int bit = 0; bit < cn; ++bit) {\n                if (((dummyNum >> bit) & 1) == 1) {\n                    switch (bit) {\n                        case 0:\n                            ionTextWriterBuilder = ionTextWriterBuilder.json();\n                            break;\n                        case 1:\n                            ionTextWriterBuilder = ionTextWriterBuilder.minimal();\n                            break;\n                        case 2:\n                            ionTextWriterBuilder = ionTextWriterBuilder.pretty();\n                            break;\n                        case 3:\n                            ionTextWriterBuilder = ionTextWriterBuilder.standard();\n                            break;\n                        case 4:\n                            ionTextWriterBuilder = ionTextWriterBuilder.withCharset(data.pickValue(new Charset[] {ASCII, UTF8}));\n                            break;\n                        case 5:\n                            ionTextWriterBuilder = ionTextWriterBuilder.withJsonDowngrade();\n                            break;\n                        case 6:\n                            ionTextWriterBuilder = ionTextWriterBuilder.withMinimalSystemData();\n                            break;\n                        case 7:\n                            ionTextWriterBuilder = ionTextWriterBuilder.withPrettyPrinting();\n                            break;\n                        case 8:\n                            ionTextWriterBuilder = ionTextWriterBuilder.withWriteTopLevelValuesOnNewLines(data.consumeBoolean());\n                            break;\n                        case 9:\n                            ionBinaryWriterBuilder = ionBinaryWriterBuilder.standard();\n                            break;\n                        case 10:\n                            ionBinaryWriterBuilder = ionBinaryWriterBuilder.withFloatBinary32Disabled();\n                            break;\n                        case 11:\n                            ionBinaryWriterBuilder = ionBinaryWriterBuilder.withFloatBinary32Enabled();\n                            break;\n                        case 12:\n                            ionBinaryWriterBuilder = ionBinaryWriterBuilder.withLocalSymbolTableAppendDisabled();\n                            break;\n                        case 13:\n                            ionBinaryWriterBuilder = ionBinaryWriterBuilder.withLocalSymbolTableAppendEnabled();\n                            break;\n                        case 14:\n                            ionBinaryWriterBuilder = ionBinaryWriterBuilder.withStreamCopyOptimized(data.consumeBoolean());\n                            break;\n                    }\n                }\n            }\n\n            ByteArrayOutputStream out = new ByteArrayOutputStream();\n            String input = data.consumeRemainingAsString();\n\n            IonWriter ionWriter = ionTextWriterBuilder.build(out);\n            rewrite(input, ionWriter);\n            ionWriter.close();\n\n            ionWriter = ionBinaryWriterBuilder.build(out);\n            rewrite(input, ionWriter);\n            ionWriter.close();\n        } catch (IOException | NullPointerException | IllegalArgumentException | IonException | AssertionError e) {\n            // Need to be caught to get more interesting findings.\n        }\n    }\n\n    void rewrite(String textIon, IonWriter writer) throws IOException {\n        try (IonReader reader = IonReaderBuilder.standard().build(textIon)) {\n            writer.writeValues(reader);\n        }\n    }\n}"
  },
  {
    "path": "projects/ion-java/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n<!--    <module>ion-java</module>-->\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/ion-java/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/amazon-ion/ion-java/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/amazon-ion/ion-java/\"\nsanitizers:\n  - address\nauto_ccs:\n  - \"ion-team@amazon.com\"\n"
  },
  {
    "path": "projects/ipaddress/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/phihag/ipaddress ipaddress\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/ipaddress\n"
  },
  {
    "path": "projects/ipaddress/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ipaddress/fuzz_ip_address.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport ipaddress\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  val_1 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024))\n  try:\n    ipaddress.ip_address(val_1)\n  except (ValueError,ipaddress.AddressValueError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ipaddress/fuzz_ip_interface.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport ipaddress\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  val_1 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024))\n  try:\n    ipaddress.ip_interface(val_1)\n  except (ValueError,ipaddress.AddressValueError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ipaddress/fuzz_ip_network.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport ipaddress\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  val_1 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024))\n  try:\n    ipaddress.ip_network(val_1)\n  except (ValueError,ipaddress.AddressValueError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ipaddress/project.yaml",
    "content": "homepage: https://github.com/phihag/ipaddress\nmain_repo: https://github.com/phihag/ipaddress\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/iperf/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool libssl-dev\n\nRUN git clone --depth 1 https://github.com/esnet/iperf iperf\nWORKDIR iperf\nCOPY build.sh $SRC/\nCOPY *_fuzzer.c $SRC/\n"
  },
  {
    "path": "projects/iperf/auth_fuzzer.c",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <openssl/bio.h>\n#include <openssl/evp.h>\n\n// Declaration of the function from iperf_auth.c (it is not static)\nint Base64Decode(const char* b64message, unsigned char** buffer, size_t* length);\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Base64Decode expects a null-terminated string.\n    char *str = (char *)malloc(size + 1);\n    if (!str) {\n        return 0;\n    }\n    memcpy(str, data, size);\n    str[size] = '\\0';\n\n    unsigned char *buffer = NULL;\n    size_t length = 0;\n\n    // Call the target function\n    Base64Decode(str, &buffer, &length);\n\n    if (buffer) {\n        free(buffer);\n    }\n    free(str);\n    return 0;\n}\n"
  },
  {
    "path": "projects/iperf/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the project to ensure headers are generated if needed\n./configure --enable-static --disable-shared\nmake -j$(nproc)\n\n# Build the cJSON fuzzer\n# We link against src/cjson.c directly as it is a standalone file in the source\n$CC $CFLAGS -Isrc -c $SRC/cjson_fuzzer.c -o cjson_fuzzer.o\n$CC $CFLAGS -Isrc -c src/cjson.c -o cjson.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE cjson_fuzzer.o cjson.o -lm -o $OUT/cjson_fuzzer\n\n# Build the auth fuzzer\n$CC $CFLAGS -Isrc -DHAVE_SSL -c $SRC/auth_fuzzer.c -o auth_fuzzer.o\n$CC $CFLAGS -Isrc -DHAVE_SSL -c src/iperf_auth.c -o iperf_auth.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE auth_fuzzer.o iperf_auth.o -lssl -lcrypto -o $OUT/auth_fuzzer\n"
  },
  {
    "path": "projects/iperf/cjson_fuzzer.c",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"cjson.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // cJSON_Parse expects a null-terminated string.\n    char *str = (char *)malloc(size + 1);\n    if (!str) {\n        return 0;\n    }\n    memcpy(str, data, size);\n    str[size] = '\\0';\n\n    cJSON *json = cJSON_Parse(str);\n    if (json) {\n        cJSON_Delete(json);\n    }\n\n    free(str);\n    return 0;\n}\n"
  },
  {
    "path": "projects/iperf/project.yaml",
    "content": "homepage: \"https://github.com/esnet/iperf\"\nlanguage: c++\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: \"https://github.com/esnet/iperf\"\nprimary_contact: \"javanlacerda@google.com\"\nauto_ccs:\n- \"pedroysb@google.com\"\n- \"david@adalogics.com\"\n- \"cloud-ti-fuzzing+bugs@google.com\"\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/ipfs/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/ipfs/go-datastore\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/go-datastore\n"
  },
  {
    "path": "projects/ipfs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd fuzz\n\nfunction compile_ds_fuzzer {\n  fuzzer=$1\n\n  if [ $# == 2 ]; then\n    rm provider* || true\n    DS_PROVIDERS=\"$2\" go generate\n  fi\n\n  compile_go_fuzzer github.com/ipfs/go-datastore/fuzz Fuzz $fuzzer\n}\n\ncompile_ds_fuzzer ipfs_ds_flatfs\ncompile_ds_fuzzer ipfs_ds_pebble \"github.com/ipfs/go-ds-pebble\"\n"
  },
  {
    "path": "projects/ipfs/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/ipfs/go-datastore\"\nprimary_contact: \"will.scott@protocol.ai\"\nauto_ccs :\n- \"stebalien@protocol.ai\"\n- \"yolan@protocol.ai\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/ipfs/go-datastore'\n"
  },
  {
    "path": "projects/ipp-usb/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y \\\n    make \\\n    pkg-config \\\n    libusb-1.0-0-dev \\\n    libudev-dev \\\n    libudev1 \\\n    libavahi-client-dev \\\n    libavahi-common-dev \\\n    libavahi-client3 \\\n    libavahi-core7 \\\n    libavahi-common3 \\\n    linux-tools-generic \\\n    kmod \\\n && rm -rf /var/lib/apt/lists/*\n\nRUN git clone --depth 1 https://github.com/OpenPrinting/ipp-usb $SRC/ipp-usb\nRUN git clone --depth 1 https://github.com/OpenPrinting/go-mfp $SRC/go-mfp\nRUN git clone --depth 1 https://github.com/OpenPrinting/fuzzing $SRC/fuzzing\n\nWORKDIR $SRC/fuzzing\nCOPY build.sh $SRC/"
  },
  {
    "path": "projects/ipp-usb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nchmod +x $SRC/fuzzing/projects/ipp-usb/oss_fuzz_build.sh\n$SRC/fuzzing/projects/ipp-usb/oss_fuzz_build.sh"
  },
  {
    "path": "projects/ipp-usb/project.yaml",
    "content": "homepage: \"https://github.com/OpenPrinting/ipp-usb\"\nmain_repo: \"https://github.com/OpenPrinting/ipp-usb\"\nprimary_contact: \"mdimad005@gmail.com\"\nauto_ccs:\n  - \"till.kamppeter@gmail.com\"\n  - \"ossfuzz@iosifache.me\"\n  - \"jiongchiyu@gmail.com\"\n  - \"pzz@apevzner.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address"
  },
  {
    "path": "projects/ipykernel/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN pip3 install --upgrade pip ipyparallel\nRUN git clone https://github.com/ipython/ipykernel ipykernel\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/ipykernel\n"
  },
  {
    "path": "projects/ipykernel/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ipykernel/fuzz_serialization_roundtrip.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport ipykernel\nfrom ipykernel.serialize import deserialize_object, serialize_object\n\n\ndef ConsumeRandomLengthBufferList(fdp):\n  \"\"\"Creates a list of buffers of various lengths\"\"\"\n  buffers = []\n  max_range = fdp.ConsumeIntInRange(1, 50)\n  for _ in range(1, max_range):\n    buffers.append(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 200)))\n  return buffers\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    deserialized_obj = deserialize_object(ConsumeRandomLengthBufferList(fdp))\n  except Exception:\n    return\n\n  # Any deserizlied object should be serializable\n  serialize_object(deserialized_obj)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ipykernel/fuzz_unpack_roundtrip.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport ipykernel\nfrom ipykernel.serialize import unpack_apply_message, pack_apply_message\n\n\ndef ConsumeRandomLengthBufferList(fdp):\n  \"\"\"Creates a list of buffers of various lengths\"\"\"\n  buffers = []\n  max_range = fdp.ConsumeIntInRange(3, 50)\n  for _ in range(3, max_range):\n    buffers.append(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 200)))\n  return buffers\n\n\ndef TestOneInput(data):\n  if len(data) < 48:\n    return\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    buffers = ConsumeRandomLengthBufferList(fdp)\n    f, args, kwargs = unpack_apply_message(buffers)\n  except Exception:\n    return\n\n  # Anything unpackable, should be packable.\n  pack_apply_message(f, args, kwargs)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ipykernel/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/ipython/ipykernel\nmain_repo: https://github.com/ipython/ipykernel\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ipython/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y python3.12 python3.12-dev python3.12-venv && \\\n    rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED && \\\n    update-alternatives --install /usr/local/bin/python3 python3 /usr/bin/python3.12 1 && \\\n    curl -sS https://bootstrap.pypa.io/get-pip.py | python3 && \\\n    python3 -m pip install pyinstaller atheris\nRUN git clone --depth 1 https://github.com/ipython/ipython\nWORKDIR $SRC\nCOPY build.sh fuzz_* $SRC/\n"
  },
  {
    "path": "projects/ipython/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd ipython\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ipython/fuzz_inputsplitter.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from IPython.core.splitinput import split_user_input\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  user_input = fdp.ConsumeUnicode(sys.maxsize)\n  pre, esc, ifun, rest = split_user_input(user_input)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ipython/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: ipython.readthedocs.org\nlanguage: python\nmain_repo: https://github.com/ipython/ipython\nbase_os_version: ubuntu-24-04\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/iroha/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n  \nRUN set -e; \\\n    apt-get update && \\\n    apt-get -y --no-install-recommends install libicu-dev \\\n        apt-utils git curl wget unzip tar; \\\n    apt-get -y clean\n\nRUN git clone --depth 1 --single-branch --branch master https://github.com/hyperledger/iroha.git\n\nWORKDIR iroha\n\nRUN cp -R $SRC/iroha/vcpkg /tmp/vcpkg-vars\n\nRUN [\"bash\", \"/tmp/vcpkg-vars/oss/build_deps.sh\"]\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/iroha/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/iroha\n./clean.sh\nmkdir build\ncd build\n \ncmake -DCMAKE_TOOLCHAIN_FILE=/opt/dependencies/scripts/buildsystems/vcpkg.cmake -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" -DFUZZING=ON ..\nmake fuzzing\n  \ncp test_bin/* $OUT/"
  },
  {
    "path": "projects/iroha/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/hyperledger/iroha\"\nlanguage: c++\nprimary_contact: \"boldrev@soramitsu.co.jp\"\nauto_ccs:\n  - \"andrei@soramitsu.co.jp\"\n  - \"kovalev@soramitsu.co.jp\"\n  - \"igor@soramitsu.co.jp\"\n  - \"gorbachev@soramitsu.co.jp\"\nsanitizers:\n  - address\nmain_repo: 'https://github.com/hyperledger/iroha.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/irssi/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y pkg-config libncurses5-dev libssl-dev python3-pip\nRUN pip3 install -U meson ninja\nRUN git clone https://github.com/irssi/irssi\n\nWORKDIR irssi\nCOPY run_tests.sh build.sh *.options *.dict $SRC/\n"
  },
  {
    "path": "projects/irssi/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# setup\nBUILD=$WORK/Build\nfuzz_targets=(\n    src/fe-fuzz/irssi-fuzz\n    src/fe-fuzz/server-fuzz\n    src/fe-fuzz/irc/core/event-get-params-fuzz\n    src/fe-fuzz/fe-common/core/theme-load-fuzz\n)\n\nif [ \"$FUZZING_ENGINE\" = honggfuzz ]; then\n    export CC=\"$SRC\"/\"$FUZZING_ENGINE\"/hfuzz_cc/hfuzz-clang\n    export CXX=\"$SRC\"/\"$FUZZING_ENGINE\"/hfuzz_cc/hfuzz-clang++\n    # hfuzz compilers automatically link libhfuzz, so pass empty fuzzer-lib\n    # to avoid double-linking\n    FUZZER_LIB_FLAG=\"\"\nelse\n    FUZZER_LIB_FLAG=\"-Dwith-fuzzer-lib=$LIB_FUZZING_ENGINE\"\nfi\n\n# cleanup\nrm -rf \"$BUILD\"\nmkdir -p \"$BUILD\"\n\n# Configure the project.\nmeson \"$BUILD\" -Dstatic-dependency=yes -Dinstall-glib=force \\\n      -Dwith-fuzzer=yes $FUZZER_LIB_FLAG \\\n      -Dfuzzer-link-language=cpp \\\n    || ( cat \"$BUILD\"/meson-logs/meson-log.txt && false )\n\n# now build all fuzz targets\nninja -C \"$BUILD\" -v \"${fuzz_targets[@]}\"\n( cd \"$BUILD\" && mv \"${fuzz_targets[@]}\" \"$OUT\" )\n\ngit clone --depth 1 https://github.com/irssi-import/themes         theme-load-fuzz_corpus\ngit clone --depth 1 https://github.com/irssi/irssi-fuzzing-corpora\n\nfind theme-load-fuzz_corpus -mindepth 1 -maxdepth 1 \\( -type d -o \\! -name \\*.theme \\) -exec rm -fr {} +\n\nzip -q -j \"$OUT\"/theme-load-fuzz_seed_corpus.zip theme-load-fuzz_corpus/*\nzip -q -j \"$OUT\"/irssi-fuzz_seed_corpus.zip      irssi-fuzzing-corpora/irssi-fuzz-corpus/*\nzip -q -j \"$OUT\"/server-fuzz_seed_corpus.zip     irssi-fuzzing-corpora/server-fuzz-corpus/*\n\n# get tokens.txt dictionary from irssi/src/fe-fuzz/\ncp src/fe-fuzz/tokens.txt \"$OUT\"/server-fuzz.dict\n\ncp \"$SRC\"/*.options \"$SRC\"/*.dict \"$OUT\"/\n"
  },
  {
    "path": "projects/irssi/irssi-fuzz.options",
    "content": "[libfuzzer]\nmax_len = 2048\n"
  },
  {
    "path": "projects/irssi/project.yaml",
    "content": "homepage: \"https://github.com/irssi/irssi\"\nlanguage: c++\nprimary_contact: \"ahf@irssi.org\"\nauto_ccs:\n  - \"dx@dxzone.com.ar\"\n  - \"joseph.bisch@gmail.com\"\n  - \"ailin.nemui@gmail.com\"\n  - \"staff@irssi.org\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/irssi/irssi'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/irssi/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer and run unit test\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nmeson test -C $WORK/Build\n"
  },
  {
    "path": "projects/irssi/theme-load-fuzz.dict",
    "content": "\"{\"\n\"}\"\n\"\\\"\"\n\";\"\n\"=\"\n\"formats\"\n\"replaces\"\n\"abstracts\"\n\"timestamp\"\n"
  },
  {
    "path": "projects/isodate/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/gweis/isodate isodate\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/isodate\n"
  },
  {
    "path": "projects/isodate/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/isodate/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport isodate\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    isodate.isodates.parse_date(fdp.ConsumeUnicodeNoSurrogates(1024))\n  except (\n    # parse_date can legitimately raise two types of exceptions:\n    # https://github.com/gweis/isodate/blob/8856fdf0e46c7bca00229faa1aae6b7e8ad6e76c/src/isodate/isodates.py#L150-L151\n    isodate.ISO8601Error,\n    ValueError,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/isodate/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/gweis/isodate\nlanguage: python\nmain_repo: https://github.com/gweis/isodate\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/istio/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Setup the builder for Istio. The standard Go builder is sufficient.\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/istio/istio\nRUN git clone --depth 1 --branch oss-fuzz-build-ref https://github.com/AdamKorcz/istio $SRC/temp-istio\nRUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=v2_2\nCOPY build.sh $SRC/\nWORKDIR $SRC/istio\n"
  },
  {
    "path": "projects/istio/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/go-118-fuzz-build\ngo build\nmv go-118-fuzz-build $GOPATH/bin/go-118-fuzz-build_v2\n\npushd cmd/convertLibFuzzerTestcaseToStdLibGo\n  go build . && mv convertLibFuzzerTestcaseToStdLibGo $GOPATH/bin/\npopd\npushd cmd/addStdLibCorpusToFuzzer\n  go build . && mv addStdLibCorpusToFuzzer $GOPATH/bin/\npopd\n\ncd $SRC/istio\n\ncp $SRC/temp-istio/tests/fuzz/oss_fuzz_build.sh $SRC/istio/tests/fuzz/\n\n# Build fuzzers\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n\techo \"Skipping most fuzzers since the OSS-fuzz CI may fail from running out of disk space.\"\n\tcompile_go_fuzzer istio.io/istio/tests/fuzz FuzzCRDRoundtrip fuzz_crd_roundtrip\nelse\n\t$SRC/istio/tests/fuzz/oss_fuzz_build.sh\nfi\n\n"
  },
  {
    "path": "projects/istio/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/istio/istio\"\nprimary_contact: \"istio-security-vulnerability-reports@googlegroups.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"john.howard@solo.io\"\n  - \"kconner@redhat.com\"\n  - \"jdpettit@google.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/istio/istio'\n"
  },
  {
    "path": "projects/istio-ztunnel/Dockerfile",
    "content": "# Copyright 2023 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get --yes update \\\n   && apt-get install --no-install-recommends --yes \\\n   librust-clang-sys-dev \\\n   protobuf-compiler \\\n   libprotobuf-dev \\\n   && apt-get clean \\\n   && rm --recursive --force /var/lib/apt/lists/*\n\nRUN git clone --depth 1 https://github.com/istio/ztunnel\nCOPY build.sh $SRC/\nWORKDIR $SRC/ztunnel\n"
  },
  {
    "path": "projects/istio-ztunnel/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build --release --debug-assertions\nFUZZ_TARGET_OUTPUT_DIR=out/rust/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/istio-ztunnel/project.yaml",
    "content": "homepage: \"https://github.com/istio/ztunnel\"\nmain_repo: 'https://github.com/istio/ztunnel'\nprimary_contact: \"istio-security-vulnerability-reports@googlegroups.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"howardjohn@google.com\"\n  - \"gregory.hanson@solo.io\"\nlanguage: rust\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/itext7/.gitignore",
    "content": "project-parent/itext7\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/itext7/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\nRUN cp fuzzing/dictionaries/pdf.dict $SRC/PdfFuzzer.dict\n\nRUN git clone --depth 1 https://github.com/strongcourage/fuzzing-corpus.git && \\\n    zip -q -r -j $SRC/PdfFuzzer_seed_corpus.zip fuzzing-corpus/pdf/*\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/itext7\nRUN git clone --depth 1 https://github.com/itext/itext7 $SRC/project-parent/itext7\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/itext7/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=itext7\nPROJECT_GROUP_ID=com.itextpdf\nPROJECT_ARTIFACT_ID=kernel\nMAIN_REPOSITORY=https://github.com/itext/itext7\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  mvn -pl $PROJECT install -DskipTests\n  mvn -pl $PROJECT/kernel install -DskipTests #only build kernel subproject (root is useless)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  $MVN -pl $PROJECT install -DskipTests -Dmaven.repo.local=$OUT/m2\n  $MVN -pl $PROJECT/kernel install -DskipTests -Dmaven.repo.local=$OUT/m2\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  # RUNTIME_CLASSPATH=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/itext7/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.itextpdf</groupId>\n            <artifactId>kernel</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/itext7/project-parent/fuzz-targets/src/test/java/com/example/PdfFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\npackage com.example;\n\nimport java.io.*;\nimport java.nio.charset.StandardCharsets;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.itextpdf.kernel.pdf.PdfReader;\nimport com.itextpdf.kernel.pdf.PdfDocument;\nimport com.itextpdf.io.exceptions.*;\n\npublic class PdfFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            InputStream stream = new ByteArrayInputStream(data.consumeRemainingAsString().getBytes(StandardCharsets.UTF_8));\n            PdfReader reader = new PdfReader(stream);\n            PdfDocument pdfDoc = new PdfDocument(reader);\n        } \n        \n        /*  \n            Catching multiple exceptions and errors in order to allow fuzzing to continue to the most intresting findings.\n            As of this commit, libfuzzer is triggering com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow in local testing.\n            Once that issue is addressed, further testing can be performed by a removing some of these caught exceptions\n            and errors.  In particular, the java.lang.AssertionError may be a bug that should be addressed.\n        */\n        catch (java.io.IOException | com.itextpdf.io.exceptions.IOException | com.itextpdf.kernel.exceptions.PdfException\n            | java.lang.AssertionError | java.lang.ClassCastException | java.lang.StringIndexOutOfBoundsException e) { }\n    }\n}"
  },
  {
    "path": "projects/itext7/project-parent/fuzz-targets/src/test/resources/junit-platform.properties",
    "content": "jazzer.instrument=com.example.**,com.other.package.**,org.jsoup.**"
  },
  {
    "path": "projects/itext7/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>itext7</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/itext7/project.yaml",
    "content": "homepage: \"https://itextpdf.com/products/itext-7\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/itext/itext7\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"michael.nothhard@code-intelligence.com\""
  },
  {
    "path": "projects/itoa/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/dtolnay/itoa\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/itoa/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC\ncd itoa\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_itoa $OUT/\n"
  },
  {
    "path": "projects/itoa/project.yaml",
    "content": "homepage: \"https://github.com/dtolnay/itoa\"\nprimary_contact: \"dtolnay@gmail.com\"\nmain_repo: \"https://github.com/dtolnay/itoa\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"adetaylor@chromium.org\"\n"
  },
  {
    "path": "projects/itsdangerous/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/pallets/itsdangerous itsdangerous\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/itsdangerous\n"
  },
  {
    "path": "projects/itsdangerous/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/itsdangerous/fuzz_itsdangerous.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport json\nimport atheris\n\nfrom itsdangerous.serializer import Serializer\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  secret_key = fdp.ConsumeUnicodeNoSurrogates(124)\n  salt = fdp.ConsumeBytes(24)\n  try:\n    random_obj = json.loads(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except:\n    return\n\n  serializer = Serializer(secret_key = secret_key)\n  signed = serializer.dumps(random_obj, salt=salt)\n  assert serializer.loads(signed, salt=salt) == random_obj\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/itsdangerous/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pallets/itsdangerous\nlanguage: python\nmain_repo: https://github.com/pallets/itsdangerous\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/iverilog/project.yaml",
    "content": "homepage: \"https://steveicarus.github.io/iverilog\"\nlanguage: c++\nprimary_contact: \"steve@icarus.com\"\nauto_ccs:\n  - \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/steveicarus/iverilog\"\n"
  },
  {
    "path": "projects/ja3/project.yaml",
    "content": "homepage: \"https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967/\"\nlanguage: python\nprimary_contact: \"jalthouse@salesforce.com\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/salesforce/ja3.git\"\n"
  },
  {
    "path": "projects/jackson-core/DataInputFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.core.json.JsonFactory;\nimport tools.jackson.core.json.JsonFactoryBuilder;\nimport tools.jackson.core.Base64Variants;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.core.json.JsonReadFeature;\nimport tools.jackson.core.StreamReadFeature;\nimport tools.jackson.core.JacksonException;\n\nimport java.io.*;\n\npublic class DataInputFuzzer {\n  public static class MockFuzzDataInput implements DataInput\n  {\n    private final InputStream _input;\n\n    public MockFuzzDataInput(byte[] data) {\n        _input = new ByteArrayInputStream(data);\n    }\n\n    public MockFuzzDataInput(String utf8Data) throws IOException {\n        _input = new ByteArrayInputStream(utf8Data.getBytes(\"UTF-8\"));\n    }\n\n    public MockFuzzDataInput(InputStream in) {\n        _input = in;\n    }\n\n    @Override\n    public void readFully(byte[] b) throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void readFully(byte[] b, int off, int len) throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public int skipBytes(int n) throws IOException {\n        return (int) _input.skip(n);\n    }\n\n    @Override\n    public boolean readBoolean() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public byte readByte() throws IOException {\n        int ch = _input.read();\n        if (ch < 0) {\n            throw new EOFException(\"End-of-input for readByte()\");\n        }\n        return (byte) ch;\n    }\n\n    @Override\n    public int readUnsignedByte() throws IOException {\n        return readByte() & 0xFF;\n    }\n\n    @Override\n    public short readShort() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public int readUnsignedShort() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public char readChar() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public int readInt() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public long readLong() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public float readFloat() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public double readDouble() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public String readLine() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public String readUTF() throws IOException {\n        throw new UnsupportedOperationException();\n    }\n  }\n\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    JsonReadFeature[] readFeatures = new JsonReadFeature[]{\n        JsonReadFeature.ALLOW_JAVA_COMMENTS,\n        JsonReadFeature.ALLOW_YAML_COMMENTS,\n        JsonReadFeature.ALLOW_UNQUOTED_PROPERTY_NAMES,\n        JsonReadFeature.ALLOW_SINGLE_QUOTES,\n        JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS,\n        JsonReadFeature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER,\n        JsonReadFeature.ALLOW_LEADING_ZEROS_FOR_NUMBERS,\n        JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS,\n        JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS,\n        JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS,\n        JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS,\n        JsonReadFeature.ALLOW_MISSING_VALUES,\n        JsonReadFeature.ALLOW_TRAILING_COMMA,\n    };\n    StreamReadFeature[] streamFeatures = new StreamReadFeature[]{\n        StreamReadFeature.AUTO_CLOSE_SOURCE,\n        StreamReadFeature.STRICT_DUPLICATE_DETECTION,\n        StreamReadFeature.IGNORE_UNDEFINED,\n        StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION,\n        StreamReadFeature.USE_FAST_DOUBLE_PARSER,\n    };\n    \n    // Configure features using builder pattern\n    JsonFactoryBuilder builder = JsonFactory.builder();\n    for (int i = 0; i < readFeatures.length; i++) {\n        if (data.consumeBoolean()) {\n            builder.enable(readFeatures[i]);\n        } else {\n            builder.disable(readFeatures[i]);\n        }\n    }\n    for (int i = 0; i < streamFeatures.length; i++) {\n        if (data.consumeBoolean()) {\n            builder.enable(streamFeatures[i]);\n        } else {\n            builder.disable(streamFeatures[i]);\n        }\n    }\n    JsonFactory jf = builder.build();\n    \n    try {\n      int typeOfNext = data.consumeInt();\n      JsonParser jp = jf.createParser(data.consumeRemainingAsBytes());\n      switch (typeOfNext%8) {\n      case 0:\n        while (jp.nextToken() != null) {\n              ;\n        }\n        break;\n      case 1:\n        while (jp.nextValue() != null) {\n              ;\n        }\n        break;\n      case 2:\n        while (jp.nextName() != null) {\n              ;\n        }\n        break;\n      case 3:\n        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n        Base64Variants b64vs = new Base64Variants();\n        jp.readBinaryValue(b64vs.MIME, outputStream);\n        break;\n      case 4:\n        String outString = jp.getValueAsString();\n        break;\n      case 5:\n        int outInt = jp.getValueAsInt();\n        break;\n      case 6:\n        char[] textChars = jp.getTextCharacters();\n        break;\n      case 7:\n        int textLen = jp.getTextLength();\n        int textOffset = jp.getTextOffset();\n        break;\n      }      \n    } catch (JacksonException | IllegalArgumentException ignored) {\n    }\n  }\n}\n\n\n"
  },
  {
    "path": "projects/jackson-core/Dockerfile",
    "content": "\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\nRUN apt-get update && apt-get install -y maven\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\nRUN cat fuzzing/dictionaries/json.dict > $SRC/JsonFuzzer.dict\nRUN cat fuzzing/dictionaries/json.dict > $SRC/DataInputFuzzer.dict\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/JsonFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    zip -j $SRC/DataInputFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/*\n\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-core\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-databind\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-annotations\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/jackson-core/JsonFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.core.json.JsonReadFeature;\nimport tools.jackson.core.json.JsonFactory;\nimport tools.jackson.core.json.JsonFactoryBuilder;\n\nimport tools.jackson.core.JacksonException;\n\npublic class JsonFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    // Configure JsonFactory with features using builder pattern\n    JsonFactoryBuilder builder = JsonFactory.builder();\n    \n    if (data.consumeBoolean())\n      builder.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS);\n    if (data.consumeBoolean())\n      builder.enable(JsonReadFeature.ALLOW_SINGLE_QUOTES);\n    if (data.consumeBoolean())\n      builder.enable(JsonReadFeature.ALLOW_UNQUOTED_PROPERTY_NAMES);\n    if (data.consumeBoolean())\n      builder.enable(JsonReadFeature.ALLOW_YAML_COMMENTS);\n    if (data.consumeBoolean())\n      builder.enable(JsonReadFeature.ALLOW_TRAILING_COMMA);\n    if (data.consumeBoolean())\n      builder.enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS);\n    \n    JsonFactory factory = builder.build();\n    ObjectMapper mapper = new ObjectMapper(factory);\n    \n    try {\n      mapper.readTree(data.consumeRemainingAsBytes());\n    } catch (JacksonException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-core/ParseNextTokenFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.core.Base64Variant;\nimport tools.jackson.core.Base64Variants;\nimport tools.jackson.core.json.JsonFactory;\nimport tools.jackson.core.io.SerializedString;\n\nimport java.io.Writer;\nimport java.io.StringWriter;\nimport tools.jackson.core.JacksonException;\nimport java.io.ByteArrayOutputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic class ParseNextTokenFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    JsonFactory jf = new JsonFactory();\n    JsonParser jp;\n        \n    try {\n        jp = jf.createParser(data.consumeRemainingAsBytes());\n        for (int i = 0;i < data.consumeInt(3, 1000); i++) {\n          int execType = data.consumeInt(0, 17);\n          if (execType==0) {\n            InputStream myInputStream = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n            jp = jf.createParser(myInputStream);\n          } else if(execType==1) {\n            jp.nextToken();\n          } else if(execType==2) {\n            jp.nextStringValue();\n          } else if(execType==3) {\n            jp.nextBooleanValue();\n          } else if(execType==4) {\n            jp.nextName();\n          } else if(execType==5) {\n            jp.nextName(new SerializedString(data.consumeString(10000)));\n          } else if(execType==6) {\n            ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n            Base64Variant orig = Base64Variants.PEM;\n            jp.readBinaryValue(orig, bytes);\n          } else if(execType==7) {\n            String outString = jp.getValueAsString();\n          } else if(execType==8) {\n            int outInt = jp.getValueAsInt();\n          } else if(execType==9) {\n            String text = jp.getText();\n          } else if(execType==10) {\n            char[] textChars = jp.getTextCharacters();\n          } else if(execType==11) {\n            int textLen = jp.getTextLength();\n          } else if(execType==12) {\n            int textOffset = jp.getTextOffset();\n          } else if(execType==13) {\n            jp.getBinaryValue(Base64Variants.PEM);\n          } else if(execType==14) {\n            jp.nextIntValue(data.consumeInt());\n          } else if(execType==15) {\n            jp.nextLongValue(data.consumeLong());\n          } else if(execType==16) {\n            jp.finishToken();\n          }\n        }\n    } catch (JacksonException | IllegalArgumentException ignored) {\n  }\n}\n}\n"
  },
  {
    "path": "projects/jackson-core/UTF8GeneratorFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.StringReader;\nimport java.io.InputStream;\nimport java.math.BigDecimal;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.Base64Variant;\nimport tools.jackson.core.Base64Variants;\nimport tools.jackson.core.json.JsonFactory;\nimport tools.jackson.core.json.UTF8JsonGenerator;\nimport tools.jackson.core.JsonGenerator;\nimport tools.jackson.core.StreamWriteFeature;\nimport tools.jackson.core.SerializableString;\nimport tools.jackson.core.io.SerializedString;\n\nimport tools.jackson.core.JacksonException;\n\npublic class UTF8GeneratorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    JsonFactory jf = new JsonFactory();\n    ByteArrayOutputStream out = new ByteArrayOutputStream();\n    String fuzzString;\n    JsonGenerator g;\n    int offset;\n    byte[] b;\n    Base64Variant b64v;\n\n    StreamWriteFeature[] features = new StreamWriteFeature[]{\n        StreamWriteFeature.AUTO_CLOSE_TARGET,\n        StreamWriteFeature.AUTO_CLOSE_CONTENT,\n        StreamWriteFeature.FLUSH_PASSED_TO_STREAM,\n        StreamWriteFeature.WRITE_BIGDECIMAL_AS_PLAIN,\n        StreamWriteFeature.STRICT_DUPLICATE_DETECTION,\n        StreamWriteFeature.IGNORE_UNKNOWN,\n    };\n\n    try {\n      g = jf.createGenerator(out);\n      for (int i = 0; i < features.length; i++) {\n        if (data.consumeBoolean()) {\n          g.configure(features[i], true);\n        } else {\n          g.configure(features[i], false);\n        }\n      }\n    } catch (JacksonException ignored) {\n      return;\n    }\n\n    int numberOfOps = data.consumeInt();\n    for (int i = 0; i < numberOfOps%20; i++) {\n      try {      \n        int apiType = data.consumeInt();\n        switch(apiType%13) {\n        case 0:\n          fuzzString = data.consumeString(1000000);\n          StringReader targetReader = new StringReader(fuzzString);\n          g.writeStartArray();\n          g.writeString(targetReader, fuzzString.length());\n          g.writeEndArray();\n        case 1:\n          fuzzString = data.consumeString(1000000);\n          g.writeStartArray();\n          g.writeString(fuzzString);\n          g.writeEndArray();\n        case 2:\n          fuzzString = data.consumeString(1000000);\n          SerializableString ss = new SerializedString(fuzzString);\n          g.writeStartArray();\n          g.writeString(ss);\n          g.writeEndArray();\n        case 3:\n          fuzzString = data.consumeString(1000000);\n          g.writeStartArray();\n          g.writeRaw(fuzzString);\n          g.writeEndArray();\n        case 4:\n          fuzzString = data.consumeString(1000000);\n          offset = data.consumeInt();\n          g.writeStartArray();\n          g.writeRaw(fuzzString, offset, fuzzString.length());\n          g.writeEndArray();\n        case 5:\n          String key = data.consumeString(1000000);\n          String value = data.consumeString(1000000);\n          g.writeStartObject();\n          g.writeStringProperty(key, value);\n          g.writeEndObject();\n        case 6:\n          b64v = Base64Variants.getDefaultVariant();\n          b = data.consumeBytes(1000000);\n           offset = data.consumeInt();\n          g.writeStartArray();\n          g.writeBinary(b64v, b, offset, b.length);\n          g.writeEndArray();\n        case 7:\n          b = data.consumeBytes(1000000);\n          offset = data.consumeInt();\n          g.writeStartObject();\n          g.writeUTF8String(b, offset, b.length);\n          g.writeEndObject();\n        case 8:\n          b64v = Base64Variants.getDefaultVariant();\n          b = data.consumeBytes(1000000);\n          int l = data.consumeInt();\n          InputStream targetStream = new ByteArrayInputStream(b);\n          g.writeStartArray();\n          g.writeBinary(b64v, targetStream, l);\n          g.writeEndArray();\n        case 9:\n          String dcString = data.consumeString(10);\n          BigDecimal BD = new BigDecimal(dcString);\n          g.writeNumber(BD);\n        case 10:\n          int fuzzInt = data.consumeInt();\n          g.writeNumber(fuzzInt);\n        case 11:\n          float fuzzFloat = data.consumeFloat();\n          g.writeNumber(fuzzFloat);\n        case 12:\n          fuzzString = data.consumeString(100000);\n          g.writeNumber(fuzzString);\n        }\n      } catch (JacksonException | IllegalArgumentException ignored) {\n      }\n    }\n\n    try {\n      g.close();\n    } catch (JacksonException ignored) {\n    }\n    \n  }\n}\n"
  },
  {
    "path": "projects/jackson-core/WriterBasedJsonGeneratorFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport tools.jackson.core.json.*;\nimport tools.jackson.core.io.ContentReference;\nimport tools.jackson.core.io.IOContext;\nimport tools.jackson.core.util.BufferRecycler;\nimport tools.jackson.core.JsonGenerator;\nimport tools.jackson.core.json.JsonFactory;\n\nimport tools.jackson.core.JacksonException;\nimport java.io.*;\nimport tools.jackson.core.io.SerializedString;\nimport tools.jackson.core.SerializableString;\n\npublic class WriterBasedJsonGeneratorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    JsonFactory jf = new JsonFactory();\n    StringWriter w;\n    JsonGenerator jg;\n\n    try {\n      w = new StringWriter();\n      jg = jf.createGenerator(w);\n    } catch (JacksonException e) {\n      return;\n    }\n\n    try {\n      int numberOfOps = data.consumeInt();\n      for (int i=0;i<numberOfOps%20;i++) {\n        int opType = data.consumeInt();\n        switch (opType%5) {\n        case 0:\n          jg.writeStartObject();\n          jg.writeName(data.consumeString(100000));\n          jg.writeString(data.consumeString(100000));\n          jg.writeEndObject();\n        case 1:\n          jg.writeStartObject();\n          jg.writeStringProperty(data.consumeString(100000), data.consumeString(100000));\n          jg.writeEndObject();\n        case 2:\n          jg.writeStartObject();\n          SerializableString NAME = new SerializedString(data.consumeString(100000));\n          jg.writeName(NAME);\n          jg.writeString(data.consumeString(100000));\n          jg.writeEndObject();\n        case 3:\n          jg.writeStartArray();\n          jg.writeRaw(data.consumeString(100000));\n          jg.writeEndArray();\n        case 4:\n          jg.writeStartArray();\n          jg.writeRawValue(data.consumeString(100000));\n          jg.writeEndArray();\n        }\n      }      \n    } catch (JacksonException e) { }\n\n    try {\n      jg.close();\n    } catch (JacksonException e) { }\n    \n  }\n}\n"
  },
  {
    "path": "projects/jackson-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Copy seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-P!java14+ -Dmaven.test.skip=true -Djavac.src.version=17 -Djavac.target.version=17\"\n\nDEPENDENCIES=\"jackson-core jackson-databind jackson-annotations\"\nfor dependency in $DEPENDENCIES; do\n  cd $SRC/$dependency\n  mvn package $MAVEN_ARGS\n  current_version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\n  cp \"target/$dependency-$current_version.jar\" $OUT/$dependency.jar\ndone\n\nALL_JARS=$(echo $DEPENDENCIES | xargs printf -- \"%s.jar \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n  if [ \"$fuzzer_basename\" == \"DataInputFuzzer\" ]; then\n    cp $SRC/$fuzzer_basename\\$MockFuzzDataInput.class $OUT/\n  fi\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jackson-core/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/FasterXML/jackson-core\"\nlanguage: jvm\nprimary_contact: \"tatu@fasterxml.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/FasterXML/jackson-core\"\nsanitizers:\n  - address\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"David@adalogics.com\"\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jackson-databind/AdaLObjectReader3Fuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.*;\nimport java.util.regex.Pattern;\nimport java.io.Reader;\nimport java.io.StringReader;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.FileOutputStream;\nimport java.nio.charset.Charset;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.io.File;\nimport java.io.InputStream;\nimport java.io.DataInput;\nimport java.io.EOFException;\nimport java.lang.IllegalArgumentException;\nimport java.net.URI;\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.ObjectReader;\nimport tools.jackson.databind.DeserializationConfig;\nimport tools.jackson.databind.DeserializationFeature;\nimport tools.jackson.databind.MapperFeature;\nimport tools.jackson.databind.SerializationFeature;\nimport tools.jackson.databind.DefaultTyping;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.core.TreeNode;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.databind.node.ObjectNode;\nimport tools.jackson.databind.JsonNode;\nimport tools.jackson.core.json.JsonFactory;\nimport tools.jackson.core.JacksonException;\n\n// For NoCheckSubTypeValidator\nimport tools.jackson.databind.JavaType;\nimport tools.jackson.databind.cfg.MapperConfig;\nimport tools.jackson.databind.DatabindContext;\nimport tools.jackson.databind.jsontype.PolymorphicTypeValidator;\n\npublic class AdaLObjectReader3Fuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        boolean doThis;\n        byte[] fileData;\n        int fuzzInt1, fuzzInt2;\n        FileOutputStream out;\n        Object o;\n        Reader stringR;\n        ObjectReader r, r2, r3;\n        JsonParser jp;\n\n        MapperFeature[] mapperfeatures = new MapperFeature[]{\n            MapperFeature.USE_ANNOTATIONS,\n            MapperFeature.USE_GETTERS_AS_SETTERS,\n            MapperFeature.PROPAGATE_TRANSIENT_MARKER,\n            MapperFeature.REQUIRE_SETTERS_FOR_GETTERS,\n            MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS,\n            MapperFeature.INFER_PROPERTY_MUTATORS,\n            MapperFeature.INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES,\n            MapperFeature.ALLOW_VOID_VALUED_PROPERTIES,\n            MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS,\n            MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS,\n            MapperFeature.USE_STATIC_TYPING,\n            MapperFeature.USE_BASE_TYPE_AS_DEFAULT_IMPL,\n            MapperFeature.DEFAULT_VIEW_INCLUSION,\n            MapperFeature.SORT_PROPERTIES_ALPHABETICALLY,\n            MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,\n            MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS,\n            MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES,\n            MapperFeature.USE_WRAPPER_NAME_AS_PROPERTY_NAME,\n            MapperFeature.ALLOW_EXPLICIT_PROPERTY_RENAMING,\n            MapperFeature.ALLOW_COERCION_OF_SCALARS,\n            MapperFeature.IGNORE_MERGE_FOR_UNMERGEABLE,\n            MapperFeature.APPLY_DEFAULT_VALUES\n        };\n\n        SerializationFeature[] serializationfeatures = new SerializationFeature[]{\n            SerializationFeature.WRAP_ROOT_VALUE,\n            SerializationFeature.INDENT_OUTPUT,\n            SerializationFeature.FAIL_ON_EMPTY_BEANS,\n            SerializationFeature.FAIL_ON_SELF_REFERENCES,\n            SerializationFeature.WRAP_EXCEPTIONS,\n            SerializationFeature.CLOSE_CLOSEABLE,\n            SerializationFeature.FLUSH_AFTER_WRITE_VALUE,\n            SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS,\n            SerializationFeature.WRITE_EMPTY_JSON_ARRAYS,\n            SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED,\n            SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS,\n            SerializationFeature.EAGER_SERIALIZER_FETCH,\n            SerializationFeature.USE_EQUALITY_FOR_OBJECT_ID\n        };\n\n        DeserializationFeature[] deserializationfeatures = new DeserializationFeature[]{\n            DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS,\n            DeserializationFeature.USE_BIG_INTEGER_FOR_INTS,\n            DeserializationFeature.USE_LONG_FOR_INTS,\n            DeserializationFeature.USE_JAVA_ARRAY_FOR_JSON_ARRAY,\n            DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,\n            DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES,\n            DeserializationFeature.FAIL_ON_INVALID_SUBTYPE,\n            DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY,\n            DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES,\n            DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS,\n            DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES,\n            DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES,\n            DeserializationFeature.FAIL_ON_TRAILING_TOKENS,\n            DeserializationFeature.WRAP_EXCEPTIONS,\n            DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,\n            DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS,\n            DeserializationFeature.UNWRAP_ROOT_VALUE,\n            DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,\n            DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT,\n            DeserializationFeature.ACCEPT_FLOAT_AS_INT,\n            DeserializationFeature.EAGER_DESERIALIZER_FETCH\n        };\n\n        DefaultTyping[] typings = new DefaultTyping[]{\n            DefaultTyping.JAVA_LANG_OBJECT,\n            DefaultTyping.OBJECT_AND_NON_CONCRETE,\n            DefaultTyping.NON_CONCRETE_AND_ARRAYS,\n            DefaultTyping.NON_FINAL,\n            DefaultTyping.NON_FINAL_AND_ENUMS\n        };\n\n        ObjectMapper mapper;\n        \n        JsonMapper.Builder builder = JsonMapper.builder();\n\n        // Maybe create a mapper with different typing settings\n        if (data.consumeBoolean()) {\n            for (int i = 0; i < typings.length; i++) {\n                if (data.consumeBoolean()) {\n                    builder.activateDefaultTyping(NoCheckSubTypeValidator.instance, typings[i]);\n                }\n            }\n        }\n\n        // Set mapper features via builder\n        for (int i = 0; i < mapperfeatures.length; i++) {\n            if (data.consumeBoolean()) {\n                builder.enable(mapperfeatures[i]);\n            } else {\n                builder.disable(mapperfeatures[i]);\n            }\n        }\n\n        for (int i = 0; i < serializationfeatures.length; i++) {\n            if (data.consumeBoolean()) {\n                builder.enable(serializationfeatures[i]);\n            } else {\n                builder.disable(serializationfeatures[i]);\n            }\n        }\n\n        mapper = builder.build();\n\n        int idx = data.consumeInt(0, classes.length - 1);\n        r = mapper.readerFor(classes[idx]); // To initialize\n\n        switch (data.consumeInt(0, 4)) {\n        case 0:\n            r = mapper.readerFor(classes[idx]);\n        case 1:\n            r = mapper.readerForMapOf(classes[idx]);\n        case 2:\n            r = mapper.readerForListOf(classes[idx]);\n        case 3:\n            r = mapper.readerForArrayOf(classes[idx]);\n        case 4:\n            fuzzInt1 = data.consumeInt(0, classes.length - 1);\n            r = r.forType(mapper.constructType(classes[fuzzInt1]));\n        }\n\n        // set reader settings\n        for (int i = 0; i < deserializationfeatures.length; i++) {\n            if (data.consumeBoolean()) {\n                r = r.with(deserializationfeatures[i]);\n            } else {\n                r = r.without(deserializationfeatures[i]);\n            }\n        }\n\n        try {\n            // Select a method and call it\n            int callType = data.consumeInt();\n            switch (callType%7) {\n            case 0:\n                // readValue\n                switch (data.consumeInt(0, 14)){\n                case 0:\n                    r.readValue(data.consumeString(100000));\n                case 1:\n                    r.readValue(new MockFuzzDataInput(data.consumeString(100000)));\n                case 2:\n                    r.readValue(data.consumeBytes(100000));\n                case 3:\n                    jp = _createParser(data, mapper, r);\n                    o = r.readValue(jp);\n                    doThis = data.consumeBoolean();\n                    if (doThis) {\n                        r3 = r.withValueToUpdate(o);\n                        mapper.valueToTree(o);\n                    }\n                case 4:\n                    jp = _createParser(data, mapper, r);\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.readerFor(classes[fuzzInt1]).readValue(jp);\n                case 5:\n                    jp = _createParser(data, mapper, r);\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.readerFor(classes[fuzzInt1]).readValue(jp);\n                case 6:\n                    stringR = new StringReader(new String(data.consumeBytes(100000)));\n                    r.readValue(stringR);\n                case 7:\n                    fileData = data.consumeRemainingAsBytes();\n                    out = new FileOutputStream(\"fuzzFile\");\n                    out.write(fileData);\n                    out.close();\n                    r.readValue(new File(\"fuzzFile\"));\n                case 8:\n                    fuzzInt1 = data.consumeInt();\n                    fuzzInt2 = data.consumeInt();\n                    r.readValue(data.consumeBytes(100000), fuzzInt1, fuzzInt2);\n                case 9:\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.readValue(data.consumeBytes(100000), classes[fuzzInt1]);\n                case 10:\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.readValue(data.consumeString(100000), classes[fuzzInt1]);\n                case 11:\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.readValue(data.consumeBytes(1000000), data.consumeInt(), data.consumeInt(), classes[fuzzInt1]);\n                case 12:\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.readValue(data.consumeBytes(1000000), mapper.constructType(classes[fuzzInt1]));\n                case 13:\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.readValue(data.consumeString(1000000), mapper.constructType(classes[fuzzInt1]));\n                case 14:                    \n                    r.readValue(new ByteArrayInputStream(data.consumeBytes(100000)));\n                }\n            case 1:\n                // readTree\n                switch (data.consumeInt(0, 7)){\n                case 0:\n                    jp = _createParser(data, mapper, r);\n                    o = r.readTree(jp);\n                    if (data.consumeBoolean()) {\n                        r3 = r.withValueToUpdate(o);\n                        mapper.valueToTree(o);\n                        mapper.readerForUpdating(o);\n                    }\n                case 1:\n                    o = r.readTree(data.consumeString(100000));\n                    if (data.consumeBoolean()) {\n                        r3 = r.withValueToUpdate(o);\n                        mapper.valueToTree(o);\n                        mapper.readerForUpdating(o);\n                    }\n                case 2:\n                    o = r.readTree(data.consumeBytes(100000));\n                    if (data.consumeBoolean()) {\n                        r3 = r.withValueToUpdate(o);\n                        mapper.valueToTree(o);\n                        mapper.readerForUpdating(o);\n                    }\n                case 3:\n                    stringR = new StringReader(new String(data.consumeRemainingAsBytes()));\n                    r.readTree(stringR);\n                case 4:\n                    fuzzInt1 = data.consumeInt();\n                    fuzzInt2 = data.consumeInt();\n                    r.readTree(data.consumeRemainingAsBytes(), fuzzInt1, fuzzInt2);\n                case 5:\n                    mapper.readTree(data.consumeBytes(1000000));\n                case 6:\n                    mapper.readTree(data.consumeString(1000000));\n                case 7:\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    switch (data.consumeInt(0,1)) {\n                    case 0:\n                        mapper.readValue(data.consumeRemainingAsBytes(), classes[fuzzInt1]);\n                    case 1:\n                        mapper.readValue(data.consumeRemainingAsString(), classes[fuzzInt1]);\n                    }\n                }\n            case 2:\n                _readValues(data, mapper, r);                \n            case 3:\n                fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                fuzzInt2 = data.consumeInt(0, classes.length - 1);\n                // addMixIn not available on immutable mapper in Jackson 3.x - skip\n            case 4:\n                JsonNode tree = mapper.readTree(data.consumeString(1000000));\n                JsonNode node = tree.at(data.consumeString(1000000));\n                doThis = data.consumeBoolean();\n                if (doThis) {\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.treeToValue(node, classes[fuzzInt1]);\n                }\n                doThis = data.consumeBoolean();\n                if (doThis) {\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.treeToValue(node, mapper.constructType(classes[fuzzInt1]));\n                }\n                doThis = data.consumeBoolean();\n                if (doThis) {\n                    r.readValue(node);\n                }\n                doThis = data.consumeBoolean();\n                fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                if (doThis) {\n                    mapper.treeToValue(node, classes[fuzzInt1]);\n                }\n            case 5:\n                switch (data.consumeInt(0, 2)){\n                case 0:\n                    mapper.readTree(new ByteArrayInputStream(data.consumeBytes(100000)));\n                case 1:\n                    ObjectNode src = (ObjectNode) mapper.readTree(data.consumeString(100000));\n                    TreeNode tn = src;\n                    fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                    mapper.treeToValue(tn, classes[fuzzInt1]);\n                case 2:\n                    r.readTree(new MockFuzzDataInput(data.consumeString(100000)));\n                }\n            case 6:\n                fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                mapper.constructType(classes[fuzzInt1]);\n            }\n            \n            // target with();\n            if (data.consumeBoolean()) {\n                r2 = r.with(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);                \n            }\n        } catch (JacksonException | IOException | IllegalArgumentException | ClassCastException e) { }\n\n        try {\n            Files.delete(Paths.get(\"fuzzFile\"));\n        } catch (IOException e) { }\n    }\n\n    public static void _readValues(FuzzedDataProvider data, ObjectMapper mapper, ObjectReader r) throws IOException {\n        Object o;\n        ObjectReader r3;\n        int fuzzInt1, fuzzInt2;\n        JsonParser jp;\n        byte[] fileData;\n        FileOutputStream out;\n        Reader stringR;\n        \n        // readValues\n        switch (data.consumeInt(0, 8)){\n        case 0:\n            stringR = new StringReader(new String(data.consumeRemainingAsBytes()));\n            o = r.readValues(stringR);\n        case 1:\n            o = r.readValues(data.consumeRemainingAsString());\n        case 2:\n            jp = _createParser(data, mapper, r);\n            o = r.readValues(jp);\n        case 3:\n            fileData = data.consumeRemainingAsBytes();\n            out = new FileOutputStream(\"fuzzFile\");\n            out.write(fileData);\n            out.close();\n            o = r.readValues(new File(\"fuzzFile\"));\n        case 4:\n            fuzzInt1 = data.consumeInt();\n            fuzzInt2 = data.consumeInt();\n            o = r.readValues(data.consumeBytes(1000000), fuzzInt1, fuzzInt2);\n        case 5:\n            fuzzInt1 = data.consumeInt(0, classes.length - 1);\n            jp = _createParser(data, mapper, r);\n            o = mapper.readValues(jp, mapper.constructType(classes[fuzzInt1]));\n        case 6:\n            fuzzInt1 = data.consumeInt(0, classes.length - 1);\n            jp = _createParser(data, mapper, r);\n            o = mapper.readValues(jp, classes[fuzzInt1]);\n        case 7:\n            o = r.readValues(new MockFuzzDataInput(data.consumeString(1000000)));\n        case 8:\n            o = r.readValues(new ByteArrayInputStream(data.consumeBytes(100000)));\n        default:\n            o = r.readValues(data.consumeRemainingAsString()); // To avoid \"variable o might not have been initialized\"\n        }\n        if (data.consumeBoolean()) {\n            r3 = r.withValueToUpdate(o);\n            mapper.valueToTree(o);\n            mapper.readerForUpdating(o);\n        }\n    }\n\n    public static JsonParser _createParser(FuzzedDataProvider data, ObjectMapper mapper, ObjectReader r) throws IOException {\n        int fuzzInt1, fuzzInt2;\n        byte[] fileData;\n        switch (data.consumeInt(0, 6)) {\n        case 0:\n            return r.createParser(data.consumeBytes(100000));\n        case 1:\n            fileData = data.consumeBytes(100000);\n            FileOutputStream out = new FileOutputStream(\"fuzzFile\");\n            out.write(fileData);\n            out.close();\n            return r.createParser(new File(\"fuzzFile\"));\n        case 2:\n            fuzzInt1 = data.consumeInt();\n            fuzzInt2 = data.consumeInt();\n            return r.createParser(data.consumeBytes(100000), fuzzInt1, fuzzInt2);\n        case 3:\n            mapper.createParser(data.consumeBytes(100000));\n        case 4:\n            return mapper.createParser(data.consumeString(1000000));\n        case 5:            \n            fuzzInt1 = data.consumeInt();\n            fuzzInt2 = data.consumeInt();\n            return mapper.createParser(data.consumeBytes(100000), fuzzInt1, fuzzInt2);\n        case 6:\n            return r.createParser(new ByteArrayInputStream(data.consumeBytes(100000)));\n        }\n        return r.createParser(data.consumeBytes(100000));\n    }\n\n    public static Class[] classes = { DummyClass.class, Integer.class, String.class, Byte.class, List.class, Map.class,\n        TreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class, Long.class };\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n        public Long _long;\n        public Double _double;\n    }\n\n\n    // Test util classes\n    public static final class NoCheckSubTypeValidator\n        extends PolymorphicTypeValidator.Base\n    {\n        private static final long serialVersionUID = 1L;\n\n        protected final static Set<String> DEFAULT_NO_DESER_CLASS_NAMES;\n        static {\n            Set<String> s = new HashSet<String>();        \n            s.add(\"jaz.Zer\");\n            DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s);\n        }\n\n        protected Set<String> _cfgIllegalClassNames = DEFAULT_NO_DESER_CLASS_NAMES;\n\n        public static final NoCheckSubTypeValidator instance = new NoCheckSubTypeValidator(); \n\n        @Override\n        public Validity validateBaseType(DatabindContext ctxt, JavaType baseType) {\n            return Validity.INDETERMINATE;\n        }\n\n        @Override\n        public Validity validateSubClassName(DatabindContext ctxt,\n                JavaType baseType, String subClassName) {\n            if (_cfgIllegalClassNames.contains(subClassName)) {\n                return Validity.DENIED;\n            }\n            return Validity.ALLOWED;\n        }\n\n        @Override\n        public Validity validateSubType(DatabindContext ctxt, JavaType baseType,\n                JavaType subType) {\n            final Class<?> raw = baseType.getRawClass();\n            String full = raw.getName();\n            if (_cfgIllegalClassNames.contains(full)) {\n                return Validity.DENIED;\n            }\n            return Validity.ALLOWED;\n        }\n    }\n\n    public static class MockFuzzDataInput implements DataInput\n    {\n        private final InputStream _input;\n\n        public MockFuzzDataInput(byte[] data) {\n            _input = new ByteArrayInputStream(data);\n        }\n\n        public MockFuzzDataInput(String utf8Data) throws IOException {\n            _input = new ByteArrayInputStream(utf8Data.getBytes(\"UTF-8\"));\n        }\n\n        public MockFuzzDataInput(InputStream in) {\n            _input = in;\n        }\n\n        @Override\n        public void readFully(byte[] b) throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public void readFully(byte[] b, int off, int len) throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public int skipBytes(int n) throws IOException {\n            return (int) _input.skip(n);\n        }\n\n        @Override\n        public boolean readBoolean() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public byte readByte() throws IOException {\n            int ch = _input.read();\n            if (ch < 0) {\n                throw new EOFException(\"End-of-input for readByte()\");\n            }\n            return (byte) ch;\n        }\n\n        @Override\n        public int readUnsignedByte() throws IOException {\n            return readByte() & 0xFF;\n        }\n\n        @Override\n        public short readShort() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public int readUnsignedShort() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public char readChar() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public int readInt() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public long readLong() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public float readFloat() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public double readDouble() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public String readLine() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n\n        @Override\n        public String readUTF() throws IOException {\n            throw new UnsupportedOperationException();\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jackson-databind/AdaLObjectReader3Fuzzer.options",
    "content": "[libfuzzer]\nmax_len = 1500000\nlen_control = 0"
  },
  {
    "path": "projects/jackson-databind/ConvertValueFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.databind.JsonNode;\n\nimport java.util.*;\nimport java.lang.IllegalArgumentException;\nimport tools.jackson.databind.ObjectMapper;\n\npublic class ConvertValueFuzzer {\n    public static Class[] classes = { DummyClass.class, Integer.class, String.class, Byte.class, List.class, Map.class,\n        TreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ObjectMapper mapper = new ObjectMapper();\n\n        try {\n            int idx = data.consumeInt(0, classes.length - 1);\n            String input = data.consumeRemainingAsString();\n            if (input == null || input.isEmpty()) {\n                return;\n            }\n            mapper.convertValue(input, classes[idx]);\n        } catch (IllegalArgumentException | tools.jackson.core.JacksonException e) { }\n    }\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n    }\n}"
  },
  {
    "path": "projects/jackson-databind/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/json.dict $SRC/ObjectReaderFuzzer.dict && \\\n    cp fuzzing/dictionaries/json.dict $SRC/ObjectWriterFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/ObjectReaderFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    zip -q $SRC/ObjectWriterFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-databind\n\n# Seed files\nRUN git clone --depth 1 https://github.com/AdamKorcz/github-samples\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nWORKDIR jackson-databind\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-annotations\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-core\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\n"
  },
  {
    "path": "projects/jackson-databind/ObjectReader2Fuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.*;\nimport java.io.Reader;\nimport java.io.StringReader;\nimport java.io.IOException;\nimport java.io.FileOutputStream;\nimport java.nio.charset.Charset;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.io.File;\nimport java.lang.IllegalArgumentException;\nimport java.net.URI;\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.ObjectReader;\nimport tools.jackson.databind.DeserializationFeature;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.core.json.JsonFactory;\nimport tools.jackson.core.JacksonException;\n\npublic class ObjectReader2Fuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        boolean doThis;\n        byte[] fileData;\n        int fuzzInt1, fuzzInt2;\n        FileOutputStream out;\n        Object o;\n        Reader stringR;\n        ObjectReader r, r2, r3;\n        JsonParser jp;\n\n        DeserializationFeature[] deserializationfeatures = new DeserializationFeature[]{\n            DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS,\n            DeserializationFeature.USE_BIG_INTEGER_FOR_INTS,\n            DeserializationFeature.USE_LONG_FOR_INTS,\n            DeserializationFeature.USE_JAVA_ARRAY_FOR_JSON_ARRAY,\n            DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,\n            DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES,\n            DeserializationFeature.FAIL_ON_INVALID_SUBTYPE,\n            DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY,\n            DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES,\n            DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS,\n            DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES,\n            DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES,\n            DeserializationFeature.FAIL_ON_TRAILING_TOKENS,\n            DeserializationFeature.WRAP_EXCEPTIONS,\n            DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,\n            DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS,\n            DeserializationFeature.UNWRAP_ROOT_VALUE,\n            DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,\n            DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT,\n            DeserializationFeature.ACCEPT_FLOAT_AS_INT,\n            DeserializationFeature.EAGER_DESERIALIZER_FETCH\n        };\n\n        ObjectMapper mapper = new ObjectMapper();\n        int idx = data.consumeInt(0, classes.length - 1);\n        r = mapper.readerFor(classes[idx]); // To initialize\n        switch (data.consumeInt(0, 3)) {\n        case 0:\n            r = mapper.readerFor(classes[idx]);\n        case 1:\n            r = mapper.readerForMapOf(classes[idx]);\n        case 2:\n            r = mapper.readerForListOf(classes[idx]);\n        case 3:\n            r = mapper.readerForArrayOf(classes[idx]);\n\n        }\n\n        // set reader settings\n        for (int i = 0; i < deserializationfeatures.length; i++) {\n            if (data.consumeBoolean()) {\n                r = r.with(deserializationfeatures[i]);\n            } else {\n                r = r.without(deserializationfeatures[i]);\n            }\n        }\n\n        try {\n            // Select a method and call it\n            int callType = data.consumeInt();\n            switch (callType%23) {\n            case 0:\n                r.readValue(data.consumeRemainingAsString());\n            case 1:\n                r.readValue(data.consumeRemainingAsBytes());\n            case 2:\n                r.readTree(data.consumeRemainingAsString());\n            case 3:\n                r.readTree(data.consumeRemainingAsBytes());\n            case 4:\n                doThis = data.consumeBoolean();\n                jp = _createParser(data, mapper, r);\n                o = r.readValue(jp);\n                if (doThis) {\n                    r3 = r.withValueToUpdate(o);\n                }\n            case 5:\n                stringR = new StringReader(new String(data.consumeRemainingAsBytes()));\n                r.readValue(stringR);\n            case 6:\n                stringR = new StringReader(new String(data.consumeRemainingAsBytes()));\n                r.readValues(stringR);\n            case 7:\n                r.readValues(data.consumeRemainingAsString());\n            case 8:\n                r.readValue(data.consumeRemainingAsBytes());\n            case 9:\n                doThis = data.consumeBoolean();\n                jp = _createParser(data, mapper, r);\n                o = r.readValues(jp);\n                if (doThis) {\n                    r3 = r.withValueToUpdate(o);\n                }\n            case 10:\n                doThis = data.consumeBoolean();\n                jp = _createParser(data, mapper, r);\n                o = r.readTree(jp);\n                if (doThis) {\n                    r3 = r.withValueToUpdate(o);\n                }\n            case 11:\n                stringR = new StringReader(new String(data.consumeRemainingAsBytes()));\n                r.readTree(stringR);\n            case 12:\n                fileData = data.consumeRemainingAsBytes();\n                out = new FileOutputStream(\"fuzzFile\");\n                out.write(fileData);\n                out.close();\n                r.readValue(new File(\"fuzzFile\"));\n            case 13:\n                fileData = data.consumeRemainingAsBytes();\n                out = new FileOutputStream(\"fuzzFile\");\n                out.write(fileData);\n                out.close();\n                r.readValues(new File(\"fuzzFile\"));\n            case 14:\n                jp = _createParser(data, mapper, r);\n                o = r.readTree(jp);\n            case 15:\n                fuzzInt1 = data.consumeInt();\n                fuzzInt2 = data.consumeInt();\n                r.readValue(data.consumeRemainingAsBytes(), fuzzInt1, fuzzInt2);\n            case 16:\n                fuzzInt1 = data.consumeInt();\n                fuzzInt2 = data.consumeInt();\n                r.readValues(data.consumeRemainingAsBytes(), fuzzInt1, fuzzInt2);\n            case 17:\n                fuzzInt1 = data.consumeInt();\n                fuzzInt2 = data.consumeInt();\n                r.readTree(data.consumeRemainingAsBytes(), fuzzInt1, fuzzInt2);\n            case 18:\n                jp = _createParser(data, mapper, r);\n            case 19:\n                int idx2 = data.consumeInt(0, classes.length - 1);\n                switch (data.consumeInt()%4) {\n                case 0:\n                    mapper.readValue(data.consumeRemainingAsBytes(), classes[idx]);\n                case 1:\n                    mapper.readValue(data.consumeRemainingAsString(), classes[idx]);\n                }\n            case 20:\n                fuzzInt1 = data.consumeInt(0, classes.length - 1);\n                mapper.readValue(data.consumeBytes(1000000), data.consumeInt(), data.consumeInt(), classes[fuzzInt1]);\n            case 21:\n                int idx3 = data.consumeInt(0, classes.length - 1);\n                mapper.readValue(data.consumeBytes(1000000), mapper.constructType(classes[idx]));\n            case 22:\n                int idx4 = data.consumeInt(0, classes.length - 1);\n                mapper.readValue(data.consumeString(1000000), mapper.constructType(classes[idx]));\n            }\n            \n            // target with();\n            if (data.consumeBoolean()) {\n                r2 = r.with(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);                \n            }\n        } catch (JacksonException | IOException | IllegalArgumentException e) { }\n\n        try {\n            Files.delete(Paths.get(\"fuzzFile\"));\n        } catch (IOException e) { }\n    }\n\n    public static JsonParser _createParser(FuzzedDataProvider data, ObjectMapper mapper, ObjectReader r) throws IOException {\n        int fuzzInt1, fuzzInt2;\n        byte[] fileData;\n        switch (data.consumeInt(0, 5)) {\n        case 0:\n            return r.createParser(data.consumeBytes(100000));\n        case 1:\n            fileData = data.consumeBytes(100000);\n            FileOutputStream out = new FileOutputStream(\"fuzzFile\");\n            out.write(fileData);\n            out.close();\n            return r.createParser(new File(\"fuzzFile\"));\n        case 2:\n            fuzzInt1 = data.consumeInt();\n            fuzzInt2 = data.consumeInt();\n            return r.createParser(data.consumeBytes(100000), fuzzInt1, fuzzInt2);\n        case 3:\n            mapper.createParser(data.consumeBytes(100000));\n        case 4:\n            return mapper.createParser(data.consumeString(1000000));\n        case 5:            \n            fuzzInt1 = data.consumeInt();\n            fuzzInt2 = data.consumeInt();\n            return mapper.createParser(data.consumeBytes(100000), fuzzInt1, fuzzInt2);\n        }\n        return r.createParser(data.consumeBytes(100000));\n    }\n\n    public static Class[] classes = { DummyClass.class, Integer.class, String.class, Byte.class, List.class, Map.class,\n        TreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class, Long.class, File.class,\n        Charset.class, URI.class };\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n        public Long _long;\n        public Double _double;\n    }\n}\n"
  },
  {
    "path": "projects/jackson-databind/ObjectReaderFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.*;\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.core.JacksonException;\n\npublic class ObjectReaderFuzzer {\n    public static Class[] classes = { DummyClass.class, Integer.class, String.class, Byte.class, List.class, Map.class,\n        TreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ObjectMapper mapper = new ObjectMapper();\n        int idx = data.consumeInt(0, classes.length - 1);\n\n        try {\n            mapper.readValue(data.consumeRemainingAsString(), classes[idx]);\n        } catch (JacksonException e) { }\n    }\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n    }\n}\n"
  },
  {
    "path": "projects/jackson-databind/ObjectWriterFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.*;\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.MapperFeature;\nimport tools.jackson.databind.SerializationFeature;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.core.JacksonException;\n\npublic class ObjectWriterFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        MapperFeature[] mapperfeatures = new MapperFeature[]{\n            MapperFeature.USE_ANNOTATIONS,\n            MapperFeature.USE_GETTERS_AS_SETTERS,\n            MapperFeature.PROPAGATE_TRANSIENT_MARKER,\n            MapperFeature.REQUIRE_SETTERS_FOR_GETTERS,\n            MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS,\n            MapperFeature.INFER_PROPERTY_MUTATORS,\n            MapperFeature.INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES,\n            MapperFeature.ALLOW_VOID_VALUED_PROPERTIES,\n            MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS,\n            MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS,\n            MapperFeature.USE_STATIC_TYPING,\n            MapperFeature.USE_BASE_TYPE_AS_DEFAULT_IMPL,\n            MapperFeature.DEFAULT_VIEW_INCLUSION,\n            MapperFeature.SORT_PROPERTIES_ALPHABETICALLY,\n            MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,\n            MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS,\n            MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES,\n            MapperFeature.USE_WRAPPER_NAME_AS_PROPERTY_NAME,\n            MapperFeature.ALLOW_EXPLICIT_PROPERTY_RENAMING,\n            MapperFeature.ALLOW_COERCION_OF_SCALARS,\n            MapperFeature.IGNORE_MERGE_FOR_UNMERGEABLE,\n            MapperFeature.APPLY_DEFAULT_VALUES\n        };\n\n        SerializationFeature[] serializationfeatures = new SerializationFeature[]{\n            SerializationFeature.WRAP_ROOT_VALUE,\n            SerializationFeature.INDENT_OUTPUT,\n            SerializationFeature.FAIL_ON_EMPTY_BEANS,\n            SerializationFeature.FAIL_ON_SELF_REFERENCES,\n            SerializationFeature.WRAP_EXCEPTIONS,\n            SerializationFeature.FAIL_ON_UNWRAPPED_TYPE_IDENTIFIERS,\n            SerializationFeature.WRITE_SELF_REFERENCES_AS_NULL,\n            SerializationFeature.CLOSE_CLOSEABLE,\n            SerializationFeature.FLUSH_AFTER_WRITE_VALUE,\n            SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS,\n            SerializationFeature.WRITE_EMPTY_JSON_ARRAYS,\n            SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED,\n            SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS,\n            SerializationFeature.EAGER_SERIALIZER_FETCH,\n            SerializationFeature.USE_EQUALITY_FOR_OBJECT_ID\n        };\n\n        // Build mapper with features via builder (Jackson 3.x style)\n        JsonMapper.Builder builder = JsonMapper.builder();\n        \n        for (int i = 0; i < mapperfeatures.length; i++) {\n            if (data.consumeBoolean()) {\n                builder.enable(mapperfeatures[i]);\n            } else {\n                builder.disable(mapperfeatures[i]);\n            }\n        }\n\n        for (int i = 0; i < serializationfeatures.length; i++) {\n            if (data.consumeBoolean()) {\n                builder.enable(serializationfeatures[i]);\n            } else {\n                builder.disable(serializationfeatures[i]);\n            }\n        }\n\n        ObjectMapper mapper = builder.build();\n\n        try {\n            DummyClass dc = mapper.readValue(data.consumeRemainingAsString(), DummyClass.class);\n            byte[] jb = mapper.writeValueAsBytes(dc);\n        } catch (JacksonException e) { }\n    }\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n        public Long _long;\n        public Double _double;\n    }\n}\n"
  },
  {
    "path": "projects/jackson-databind/ReadTreeFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.databind.JsonNode;\nimport tools.jackson.databind.node.ObjectNode;\nimport tools.jackson.databind.node.ArrayNode;\nimport tools.jackson.databind.node.JsonNodeFactory;\n\nimport java.util.*;\nimport java.math.BigInteger;\nimport java.math.BigDecimal;\nimport java.lang.IllegalArgumentException;\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.core.JacksonException;\n\npublic class ReadTreeFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ObjectMapper mapper = new ObjectMapper();\n\n        try {\n            JsonNode root = mapper.readTree(data.consumeString(500000));\n            if (root == null) return;\n            \n            // Test various JsonNode operations\n            int numOperations = data.consumeInt(1, 20);\n            for (int i = 0; i < numOperations && data.remainingBytes() > 10; i++) {\n                int operation = data.consumeInt(0, 25);\n                switch(operation) {\n                    case 0:\n                        // get by field name\n                        String fieldName = data.consumeString(100);\n                        JsonNode child = root.get(fieldName);\n                        if (child != null) {\n                            child.asText();\n                            child.isNull();\n                            child.isValueNode();\n                        }\n                        break;\n                    case 1:\n                        // get by index\n                        int idx = data.consumeInt();\n                        root.get(idx);\n                        break;\n                    case 2:\n                        // path operations\n                        String path = data.consumeString(200);\n                        JsonNode pathNode = root.path(path);\n                        pathNode.isMissingNode();\n                        break;\n                    case 3:\n                        // at (JsonPointer)\n                        String pointer = data.consumeString(200);\n                        root.at(pointer);\n                        break;\n                    case 4:\n                        // type checks\n                        root.isArray();\n                        root.isObject();\n                        root.isTextual();\n                        root.isNumber();\n                        root.isBoolean();\n                        root.isBinary();\n                        root.isPojo();\n                        root.isIntegralNumber();\n                        root.isFloatingPointNumber();\n                        root.isBigDecimal();\n                        root.isBigInteger();\n                        break;\n                    case 5:\n                        // value extraction\n                        root.asText();\n                        root.asText(\"default\");\n                        break;\n                    case 6:\n                        root.asInt();\n                        root.asInt(0);\n                        break;\n                    case 7:\n                        root.asLong();\n                        root.asLong(0L);\n                        break;\n                    case 8:\n                        root.asDouble();\n                        root.asDouble(0.0);\n                        break;\n                    case 9:\n                        root.asBoolean();\n                        root.asBoolean(false);\n                        break;\n                    case 10:\n                        // tree traversal - Jackson 3.x uses values() and properties()\n                        root.values();\n                        root.properties();\n                        root.iterator();\n                        break;\n                    case 11:\n                        // has operations\n                        String checkField = data.consumeString(100);\n                        root.has(checkField);\n                        root.has(data.consumeInt());\n                        root.hasNonNull(checkField);\n                        break;\n                    case 12:\n                        // size\n                        root.size();\n                        root.isEmpty();\n                        break;\n                    case 13:\n                        // find operations\n                        String findField = data.consumeString(100);\n                        root.findValue(findField);\n                        root.findPath(findField);\n                        root.findValues(findField);\n                        root.findValuesAsString(findField);\n                        root.findParent(findField);\n                        root.findParents(findField);\n                        break;\n                    case 14:\n                        // withObject operations (for ObjectNode)\n                        if (root.isObject()) {\n                            try {\n                                String withField = data.consumeString(100);\n                                root.withObject(withField);\n                            } catch (UnsupportedOperationException e) {}\n                        }\n                        break;\n                    case 15:\n                        // withArray (for ObjectNode)\n                        if (root.isObject()) {\n                            try {\n                                String arrayField = data.consumeString(100);\n                                root.withArray(arrayField);\n                            } catch (UnsupportedOperationException e) {}\n                        }\n                        break;\n                    case 16:\n                        // equals\n                        String json2 = data.consumeString(10000);\n                        try {\n                            JsonNode other = mapper.readTree(json2);\n                            root.equals(other);\n                        } catch (JacksonException e) {}\n                        break;\n                    case 17:\n                        // treeToValue\n                        int classIdx = data.consumeInt(0, classes.length - 1);\n                        mapper.treeToValue(root, classes[classIdx]);\n                        break;\n                    case 18:\n                        // write operations\n                        mapper.writeValueAsString(root);\n                        break;\n                    case 19:\n                        mapper.writeValueAsBytes(root);\n                        break;\n                    case 20:\n                        // deepCopy\n                        root.deepCopy();\n                        break;\n                    case 21:\n                        // number operations if applicable\n                        if (root.isNumber()) {\n                            root.numberValue();\n                            root.canConvertToInt();\n                            root.canConvertToLong();\n                            root.canConvertToExactIntegral();\n                        }\n                        break;\n                    case 22:\n                        // binary operations if applicable\n                        if (root.isBinary()) {\n                            root.binaryValue();\n                        }\n                        break;\n                    case 23:\n                        // textValue\n                        root.textValue();\n                        break;\n                    case 24:\n                        // pretty print\n                        root.toPrettyString();\n                        break;\n                    case 25:\n                        // require operations\n                        try {\n                            root.require();\n                            root.requireNonNull();\n                        } catch (IllegalArgumentException e) {}\n                        break;\n                }\n            }\n        } catch (JacksonException | IllegalArgumentException e) { }\n    }\n    \n    public static Class[] classes = { DummyClass.class, Integer.class, String.class, Byte.class, List.class, Map.class,\n        TreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class };\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n    }\n}\n"
  },
  {
    "path": "projects/jackson-databind/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/jackson-databind\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\nmv $SRC/github-samples/jackson/*.zip $OUT/\n\n# jackson-annotations (must be built first - no dependencies)\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests\"\n$MVN package $MAVEN_ARGS -f \"jackson-annotations/pom.xml\"\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout -f \"jackson-annotations/pom.xml\")\ncp \"jackson-annotations/target/jackson-annotations-$CURRENT_VERSION.jar\" \"$OUT/jackson-annotations.jar\"\n\n# jackson-core (depends on jackson-annotations)\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests\"\n$MVN package $MAVEN_ARGS -f \"jackson-core/pom.xml\"\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout -f \"jackson-core/pom.xml\")\ncp \"jackson-core/target/jackson-core-$CURRENT_VERSION.jar\" \"$OUT/jackson-core.jar\"\n\n# jackson-databind (depends on both jackson-core and jackson-annotations)\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/jackson-databind-$CURRENT_VERSION.jar\" \"$OUT/jackson-databind.jar\"\n\nALL_JARS=\"jackson-databind.jar jackson-core.jar jackson-annotations.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  cp $SRC/$fuzzer_basename\\$DummyClass.class $OUT/ 2>/dev/null || true\n  if [ \"$fuzzer_basename\" == \"AdaLObjectReader3Fuzzer\" ]; then\n    cp $SRC/$fuzzer_basename\\$NoCheckSubTypeValidator.class $OUT/\n    cp $SRC/$fuzzer_basename\\$MockFuzzDataInput.class $OUT/\n  fi\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_excludes=tools.jackson.core.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jackson-databind/project.yaml",
    "content": "homepage: \"https://github.com/FasterXML/jackson-databind\"\nlanguage: jvm\nprimary_contact: \"tatu@fasterxml.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/FasterXML/jackson-databind.git\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"David@adalogics.com\"\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/XmlFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XmlFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 -b 3.x https://github.com/FasterXML/jackson-core\nRUN git clone --depth 1 -b 3.x https://github.com/FasterXML/jackson-databind\nRUN git clone --depth 1 -b 3.x https://github.com/FasterXML/jackson-dataformat-xml\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jackson-dataformat-xml\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/FromXmlParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.dataformat.xml.XmlFactory;\nimport tools.jackson.dataformat.xml.XmlMapper;\nimport tools.jackson.dataformat.xml.XmlReadFeature;\nimport tools.jackson.dataformat.xml.deser.FromXmlParser;\nimport java.util.EnumSet;\n\n/** This fuzzer targets the methods of the FromXmlParser object */\npublic class FromXmlParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer choice = data.consumeInt(1, 19);\n\n      // Retrieve set of XmlReadFeature\n      EnumSet<XmlReadFeature> featureSet = EnumSet.allOf(XmlReadFeature.class);\n\n      // Create and configure XmlMapper\n      XmlMapper mapper = null;\n      if (data.consumeBoolean()) {\n        mapper =\n            XmlMapper.builder(\n                XmlFactory.builder()\n                    .enable(data.pickValue(featureSet))\n                    .disable(data.pickValue(featureSet))\n                    .build())\n                .build();\n      } else {\n        mapper = XmlMapper.builder().build();\n      }\n\n      // Create and configure FromXmlParser\n      FromXmlParser parser =\n          (FromXmlParser) mapper.createParser(data.consumeRemainingAsString());\n\n      // Fuzz methods of FromXmlParser\n      switch (choice) {\n        case 1:\n          parser.currentName();\n          break;\n        case 2:\n          parser.currentTokenLocation();\n          break;\n        case 3:\n          parser.currentLocation();\n          break;\n        case 4:\n          parser.isExpectedStartArrayToken();\n          break;\n        case 5:\n          parser.isExpectedNumberIntToken();\n          break;\n        case 6:\n          parser.nextToken();\n          break;\n        case 7:\n          parser.nextToken();\n          parser.getText();\n          break;\n        case 8:\n          parser.getText();\n          break;\n        case 9:\n          parser.getTextCharacters();\n          break;\n        case 10:\n          parser.getTextLength();\n          break;\n        case 11:\n          parser.getTextOffset();\n          break;\n        case 12:\n          parser.getNumberType();\n          break;\n        case 13:\n          parser.getNumberValue();\n          break;\n        case 14:\n          parser.getIntValue();\n          break;\n        case 15:\n          parser.getLongValue();\n          break;\n        case 16:\n          parser.getBigIntegerValue();\n          break;\n        case 17:\n          parser.getFloatValue();\n          break;\n        case 18:\n          parser.getDoubleValue();\n          break;\n        case 19:\n          parser.getDecimalValue();\n          break;\n      }\n\n      parser.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/ToXmlGeneratorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.io.SerializedString;\nimport tools.jackson.dataformat.xml.XmlFactory;\nimport tools.jackson.dataformat.xml.XmlMapper;\nimport tools.jackson.dataformat.xml.XmlWriteFeature;\nimport tools.jackson.dataformat.xml.ser.ToXmlGenerator;\nimport java.io.ByteArrayOutputStream;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.EnumSet;\nimport javax.xml.namespace.QName;\n\n/** This fuzzer targets the methods of the ToXmlGenerator object */\npublic class ToXmlGeneratorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Retrieve set of XmlWriteFeature\n      EnumSet<XmlWriteFeature> featureSet = EnumSet.allOf(XmlWriteFeature.class);\n\n      // Create and configure XmlMapper\n      XmlMapper mapper = null;\n      if (data.consumeBoolean()) {\n        mapper =\n            XmlMapper.builder(\n                XmlFactory.builder()\n                    .enable(data.pickValue(featureSet))\n                    .disable(data.pickValue(featureSet))\n                    .build())\n                .build();\n      } else {\n        mapper = XmlMapper.builder().build();\n      }\n\n      // Create and configure ToXmlGenerator\n      ToXmlGenerator generator =\n          (ToXmlGenerator) mapper.createGenerator(new ByteArrayOutputStream());\n      generator.initGenerator();\n      generator.setNextName(new QName(\"OSS-Fuzz\"));\n      generator.writeStartObject();\n\n      // Fuzz methods of ToXmlGenerator\n      String value = null;\n      switch (data.consumeInt(1, 18)) {\n        case 1:\n          generator.writeName(data.consumeString(data.remainingBytes()));\n          generator.writeString(data.consumeRemainingAsString());\n          break;\n        case 2:\n          generator.writeName(new SerializedString(data.consumeRemainingAsString()));\n          break;\n        case 3:\n          value = data.consumeRemainingAsString();\n          generator.writeString(value.toCharArray(), 0, value.length());\n          break;\n        case 4:\n          generator.writeString(new SerializedString(data.consumeRemainingAsString()));\n          break;\n        case 5:\n          generator.writeRawValue(data.consumeRemainingAsString());\n          break;\n        case 6:\n          value = data.consumeRemainingAsString();\n          generator.writeRawValue(value, 0, value.length());\n          break;\n        case 7:\n          value = data.consumeRemainingAsString();\n          generator.writeRawValue(value.toCharArray(), 0, value.length());\n          break;\n        case 8:\n          value = data.consumeRemainingAsString();\n          generator.writeRaw(value, 0, value.length());\n          break;\n        case 9:\n          value = data.consumeRemainingAsString();\n          generator.writeRaw(value.toCharArray(), 0, value.length());\n          break;\n        case 10:\n          generator.writeBoolean(data.consumeBoolean());\n          break;\n        case 11:\n          generator.writeNull();\n          break;\n        case 12:\n          generator.writeNumber(data.consumeInt());\n          break;\n        case 13:\n          generator.writeNumber(data.consumeLong());\n          break;\n        case 14:\n          generator.writeNumber(data.consumeDouble());\n          break;\n        case 15:\n          generator.writeNumber(data.consumeFloat());\n          break;\n        case 16:\n          generator.writeNumber(new BigDecimal(data.consumeLong()));\n          break;\n        case 17:\n          generator.writeNumber(BigInteger.valueOf(data.consumeLong()));\n          break;\n        case 18:\n          generator.writeNumber(data.consumeRemainingAsString());\n          break;\n      }\n\n      generator.writeEndObject();\n      generator.flush();\n      generator.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/XmlDeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\nimport com.fasterxml.jackson.annotation.JsonRawValue;\nimport com.fasterxml.jackson.annotation.JsonRootName;\nimport tools.jackson.dataformat.xml.XmlMapper;\nimport tools.jackson.dataformat.xml.annotation.JacksonXmlProperty;\nimport java.io.ByteArrayOutputStream;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.stream.Stream;\n\n/** This fuzzer targets the deserialization methods of Xml objects */\npublic class XmlDeserializerFuzzer {\n  private static XmlMapper mapper;\n  private static List<Class> choice;\n\n  public static void fuzzerInitialize() {\n    // Register the XmlModule for the deserialization\n    mapper = XmlMapper.builder().build();\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the deserialize methods for different xml objects\n      Class type = data.pickValue(choice);\n      String value = data.consumeRemainingAsString();\n      mapper.readValue(value, type);\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeClassChoice() {\n    choice = new ArrayList<Class>();\n    choice.add(ByteArrayContainer.class);\n    choice.add(ByteArrayOutputStream.class);\n    choice.add(Byte[].class);\n    choice.add(ModelContainer.class);\n    choice.add(DelegateContainer.class);\n    choice.add(RawContainer.class);\n    choice.add(MapContainer.class);\n    choice.add(ListContainer.class);\n    choice.add(ArrayContainer.class);\n    choice.add(EnumFuzz.class);\n    choice.add(EnumContainer.class);\n    choice.add(Exception.class);\n    choice.add(Map.class);\n    choice.add(List.class);\n    choice.add(Set.class);\n    choice.add(Stream.class);\n    choice.add(String.class);\n    choice.add(Boolean.class);\n    choice.add(Character.class);\n    choice.add(Byte.class);\n    choice.add(Integer.class);\n    choice.add(Long.class);\n    choice.add(Short.class);\n    choice.add(Double.class);\n    choice.add(Float.class);\n    choice.add(BigInteger.class);\n    choice.add(BigDecimal.class);\n    choice.add(Number.class);\n  }\n\n  private static class ByteArrayContainer {\n    public byte[] value;\n\n    public ByteArrayContainer(byte[] value) {\n      this.value = value;\n    }\n  }\n\n  @JsonRootName(\"Model\")\n  private static class ModelContainer {\n    @JacksonXmlProperty(isAttribute = true, localName = \"string\")\n    public String string;\n\n    @JsonCreator\n    public ModelContainer(@JsonProperty(value = \"string\", required = true) String string) {\n      this.string = string;\n    }\n  }\n\n  private static class DelegateContainer {\n    public String string;\n\n    @JsonCreator(mode = JsonCreator.Mode.DELEGATING)\n    public DelegateContainer(String string) {\n      this.string = string;\n    }\n  }\n\n  @JsonPropertyOrder({\"id\", \"raw\"})\n  private static class RawContainer {\n    @JsonRawValue public String string;\n  }\n\n  private static class MapContainer {\n    public Map<Integer, String> map;\n\n    public void setMap(Map<Integer, String> map) {\n      this.map = map;\n    }\n  }\n\n  private static class ListContainer {\n    public List<String> list;\n\n    public void setList(List<String> list) {\n      this.list = list;\n    }\n  }\n\n  private static class ArrayContainer {\n    public String[] array;\n\n    public String[] getArray() {\n      return array;\n    }\n\n    public void setArray(String[] array) {\n      this.array = array;\n    }\n  }\n\n  private static enum EnumFuzz {\n    A,\n    B,\n    C,\n    D,\n    E;\n  }\n\n  private static class EnumContainer {\n    public EnumFuzz enumFuzz;\n\n    public EnumContainer(EnumFuzz enumFuzz) {\n      this.enumFuzz = enumFuzz;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/XmlFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.xml.XmlMapper;\n\npublic class XmlFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    ObjectMapper mapper = XmlMapper.builder().build();\n    try {\n      mapper.readTree(input);\n    } catch (RuntimeException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/XmlSerializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\nimport com.fasterxml.jackson.annotation.JsonRawValue;\nimport com.fasterxml.jackson.annotation.JsonRootName;\nimport tools.jackson.databind.ObjectWriter;\nimport tools.jackson.dataformat.xml.XmlMapper;\nimport tools.jackson.dataformat.xml.XmlWriteFeature;\nimport tools.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;\nimport tools.jackson.dataformat.xml.annotation.JacksonXmlProperty;\nimport tools.jackson.dataformat.xml.ser.ToXmlGenerator;\nimport java.io.ByteArrayInputStream;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.nio.ByteBuffer;\nimport java.util.ArrayList;\nimport java.util.EnumSet;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Stream;\n\n/** This fuzzer targets the serialization methods of Hppc objects */\npublic class XmlSerializerFuzzer {\n  private static ObjectWriter writer;\n\n  public static void fuzzerInitialize() {\n    // Register the XmlModule for the serialization\n    writer = XmlMapper.builder().build().writer();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Object object = null;\n\n      // Fuzz the serialize methods for different XML objects\n      if (data.consumeBoolean()) {\n        writer = writer.withDefaultPrettyPrinter();\n      }\n      writer = writer.with(data.pickValue(EnumSet.allOf(XmlWriteFeature.class)));\n      switch (data.consumeInt(1, 24)) {\n        case 1:\n          object = new ByteArrayContainer(data.consumeRemainingAsBytes());\n          break;\n        case 2:\n          List<String> list = new ArrayList<String>();\n          list.add(data.consumeRemainingAsString());\n          object = list;\n          break;\n        case 3:\n          List<String> listIter = new ArrayList<String>();\n          listIter.add(data.consumeRemainingAsString());\n          object = listIter.iterator();\n          break;\n        case 4:\n          object = Stream.of(data.consumeRemainingAsString()).iterator();\n          break;\n        case 5:\n          List<String> listIterCon = new ArrayList<String>();\n          listIterCon.add(data.consumeRemainingAsString());\n          object = new IteratorContainer(listIterCon.iterator());\n          break;\n        case 6:\n          object = new ItemContainer();\n          break;\n        case 7:\n          object = new ModelContainer(data.consumeRemainingAsString());\n          break;\n        case 8:\n          object = new RawContainer(data.consumeRemainingAsString());\n          break;\n        case 9:\n          object = new ByteBufferContainer(data.consumeRemainingAsBytes());\n          break;\n        case 10:\n          object = new MapContainer(data.consumeRemainingAsString());\n          break;\n        case 11:\n          object = new ListContainer(data.consumeRemainingAsString());\n          break;\n        case 12:\n          object = BigInteger.valueOf(data.consumeLong());\n          break;\n        case 13:\n          object = data.consumeRemainingAsString();\n          break;\n        case 14:\n          object = data.consumeRemainingAsBytes();\n          break;\n        case 15:\n          object = BigDecimal.valueOf(data.consumeDouble());\n          break;\n        case 16:\n          object = data.consumeBoolean();\n          break;\n        case 17:\n          object = data.consumeInt();\n          break;\n        case 18:\n          object = data.consumeLong();\n          break;\n        case 19:\n          object = data.consumeDouble();\n          break;\n        case 20:\n          object = data.consumeBoolean();\n          break;\n        case 21:\n          object = data.consumeByte();\n          break;\n        case 22:\n          object = data.consumeChar();\n          break;\n        case 23:\n          object = data.consumeBoolean();\n          break;\n        case 24:\n          object = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n          break;\n      }\n\n      writer.writeValueAsString(object);\n      writer.writeValueAsBytes(object);\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n\n  private static class ByteArrayContainer {\n    public byte[] value;\n\n    public ByteArrayContainer(byte[] value) {\n      this.value = value;\n    }\n  }\n\n  private static class IteratorContainer {\n    private Iterator<String> iterator;\n\n    @JacksonXmlElementWrapper(localName = \"elements\")\n    @JacksonXmlProperty(localName = \"element\")\n    public Iterator<String> getIterator() {\n      return iterator;\n    }\n\n    public IteratorContainer(Iterator<String> iterator) {\n      this.iterator = iterator;\n    }\n  }\n\n  private static class ItemContainer {\n    @JsonProperty(\"item\")\n    @JacksonXmlElementWrapper(localName = \"list\")\n    public Iterator<String> items() {\n      return new Iterator<String>() {\n        int item = 5;\n\n        @Override\n        public boolean hasNext() {\n          return item > 0;\n        }\n\n        @Override\n        public String next() {\n          return Integer.toString(--item);\n        }\n      };\n    }\n  }\n\n  @JsonRootName(\"Model\")\n  private static class ModelContainer {\n    @JacksonXmlProperty(isAttribute = true, localName = \"string\")\n    public String string;\n\n    public ModelContainer(String string) {\n      this.string = string;\n    }\n  }\n\n  @JsonPropertyOrder({\"id\", \"raw\"})\n  private static class RawContainer {\n    @JsonRawValue public String string;\n    @JsonRawValue public char[] charArray;\n\n    public RawContainer(String string) {\n      this.string = string;\n      this.charArray = string.toCharArray();\n    }\n  }\n\n  private static class ByteBufferContainer {\n    public ByteBuffer byteBuffer;\n\n    public ByteBufferContainer(byte[] byteArray) {\n      this.byteBuffer = ByteBuffer.allocateDirect(byteArray.length);\n      this.byteBuffer.put(byteArray);\n    }\n  }\n\n  private static class MapContainer {\n    public Map<Integer, String> map;\n\n    public MapContainer(String string) {\n      this.map = new HashMap<Integer, String>();\n      this.map.put(0, string);\n    }\n  }\n\n  private static class ListContainer {\n    public List<String> list;\n\n    public ListContainer(String string) {\n      this.list = new ArrayList<String>();\n      this.list.add(string);\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-P!java14+ -Dmaven.test.skip=true -Djavac.src.version=17 -Djavac.target.version=17\"\n\n# Build jackson-core first (required dependency)\ncd $SRC/jackson-core\n$MVN install $MAVEN_ARGS\n\n# Build jackson-databind (required dependency)\ncd $SRC/jackson-databind\n$MVN install $MAVEN_ARGS\n\n# Build jackson-dataformat-xml\ncd $SRC/jackson-dataformat-xml\n$MVN package dependency:copy-dependencies $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\nmkdir -p $OUT/dependency\ncp \"target/jackson-dataformat-xml-$CURRENT_VERSION.jar\" $OUT/jackson-dataformat-xml.jar\nfor jarfile in $(find $SRC/jackson-dataformat-xml/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\n\nALL_JARS=\"jackson-dataformat-xml.jar\"\nALL_DEPENDENCY=$(find $OUT/dependency -name *.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"$OUT/dependency/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"\\$this_dir/dependency/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jackson-dataformat-xml/project.yaml",
    "content": "homepage: \"https://github.com/FasterXML/jackson-dataformat-xml\"\nlanguage: jvm\nprimary_contact: \"tatu@fasterxml.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/FasterXML/jackson-dataformat-xml\"\nsanitizers:\n  - address\nauto_ccs:\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"norbert.schneider@code-intelligence.com\"\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/AvroGeneratorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.io.SerializedString;\nimport tools.jackson.dataformat.avro.AvroFactory;\nimport tools.jackson.dataformat.avro.AvroFactoryBuilder;\nimport tools.jackson.dataformat.avro.AvroGenerator;\nimport tools.jackson.dataformat.avro.AvroMapper;\nimport tools.jackson.dataformat.avro.AvroWriteFeature;\nimport tools.jackson.dataformat.avro.schema.AvroSchemaGenerator;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.EnumSet;\nimport java.util.List;\nimport java.util.HashMap;\n\n/** This fuzzer targets the methods of AvroGenerator */\npublic class AvroGeneratorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Retrieve set of AvroWriteFeature\n      EnumSet<AvroWriteFeature> featureSet = EnumSet.allOf(AvroWriteFeature.class);\n\n      // Create and configure AvroMapper\n      AvroFactoryBuilder avroFactoryBuilder;\n      if (data.consumeBoolean()) {\n        avroFactoryBuilder = AvroFactory.builderWithApacheDecoder();\n      } else {\n        avroFactoryBuilder = AvroFactory.builderWithNativeDecoder();\n      }\n      AvroMapper mapper =\n          new AvroMapper(\n              avroFactoryBuilder\n                  .enable(data.pickValue(featureSet))\n                  .disable(data.pickValue(featureSet))\n                  .build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Generate schema for RootType\n      AvroSchemaGenerator schemaGenerator = new AvroSchemaGenerator();\n      mapper.acceptJsonFormatVisitor(RootType.class, schemaGenerator);\n\n      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n      AvroGenerator generator =\n          (AvroGenerator) mapper.writer()\n              .with(schemaGenerator.getGeneratedSchema())\n              .createGenerator(outputStream);\n      generator.writeStartObject();\n\n      // Fuzz methods of CBORGenerator\n      String value = null;\n      byte[] byteArray = null;\n      switch (data.consumeInt(1, 18)) {\n        case 1:\n          generator.writeName(\"bo\");\n          generator.writeBoolean(data.consumeBoolean());\n          break;\n        case 2:\n          generator.writeName(\"obj\");\n          generator.writeNull();\n          break;\n        case 3:\n          generator.writeName(\"ia\");\n          int[] intArray = data.consumeInts(data.consumeInt(1, 5));\n          generator.writeArray(intArray, 0, intArray.length);\n          break;\n        case 4:\n          generator.writeName(\"la\");\n          long[] longArray = data.consumeLongs(data.consumeInt(1, 5));\n          generator.writeArray(longArray, 0, longArray.length);\n          break;\n        case 5:\n          generator.writeName(\"da\");\n          double[] doubleArray = new double[data.consumeInt(1, 5)];\n          for (int i = 0; i < doubleArray.length; i++) {\n            doubleArray[i] = data.consumeDouble();\n          }\n          generator.writeArray(doubleArray, 0, doubleArray.length);\n          break;\n        case 6:\n          generator.writeName(\"string\");\n          generator.writeString(data.consumeRemainingAsString());\n          break;\n        case 7:\n          generator.writeName(\"string\");\n          value = data.consumeRemainingAsString();\n          generator.writeString(value.toCharArray(), 0, value.length());\n          break;\n        case 8:\n          generator.writeName(\"string\");\n          generator.writeString(new SerializedString(data.consumeRemainingAsString()));\n          break;\n        case 9:\n          generator.writeName(\"string\");\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeRawUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 10:\n          generator.writeName(\"ba\");\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 11:\n          generator.writeName(\"ba\");\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeBinary(new ByteArrayInputStream(byteArray), byteArray.length);\n          break;\n        case 12:\n          generator.writeName(\"i\");\n          generator.writeNumber(data.consumeInt());\n          break;\n        case 13:\n          generator.writeName(\"l\");\n          generator.writeNumber(data.consumeLong());\n          break;\n        case 14:\n          generator.writeName(\"d\");\n          generator.writeNumber(data.consumeDouble());\n          break;\n        case 15:\n          generator.writeName(\"f\");\n          generator.writeNumber(data.consumeFloat());\n          break;\n        case 16:\n          generator.writeName(\"bd\");\n          generator.writeNumber(new BigDecimal(data.consumeLong()));\n          break;\n        case 17:\n          generator.writeName(\"bi\");\n          generator.writeNumber(BigInteger.valueOf(data.consumeLong()));\n          break;\n        case 18:\n          generator.writeName(\"obj\");\n          generator.writeNumber(data.consumeRemainingAsString());\n          break;\n      }\n\n      generator.flush();\n      generator.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n\n  private static class RootType {\n    public String string;\n    public int i;\n    public boolean bo;\n    public double d;\n    public float f;\n    public short s;\n    public long l;\n    public BigDecimal bd;\n    public BigInteger bi;\n    public byte[] ba;\n    public double[] da;\n    public long[] la;\n    public int[] ia;\n    public Object obj;\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/AvroParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonAlias;\nimport tools.jackson.dataformat.avro.AvroFactory;\nimport tools.jackson.dataformat.avro.AvroFactoryBuilder;\nimport tools.jackson.dataformat.avro.AvroMapper;\nimport tools.jackson.dataformat.avro.AvroParser;\nimport tools.jackson.dataformat.avro.AvroReadFeature;\nimport tools.jackson.dataformat.avro.schema.AvroSchemaGenerator;\n\nimport java.util.EnumSet;\nimport java.util.List;\n\n/** This fuzzer targets the methods of AvroParser */\npublic class AvroParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 100));\n\n      // Retrieve set of AvroReadFeature\n      EnumSet<AvroReadFeature> featureSet = EnumSet.allOf(AvroReadFeature.class);\n\n      // Create and configure AvroMapper\n      AvroFactoryBuilder avroFactoryBuilder;\n      if (data.consumeBoolean()) {\n        avroFactoryBuilder = AvroFactory.builderWithApacheDecoder();\n      } else {\n        avroFactoryBuilder = AvroFactory.builderWithNativeDecoder();\n      }\n      AvroMapper mapper =\n          new AvroMapper(\n              avroFactoryBuilder\n                  .enable(data.pickValue(featureSet))\n                  .disable(data.pickValue(featureSet))\n                  .build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Generate schema for RootType\n      AvroSchemaGenerator schemaGenerator = new AvroSchemaGenerator();\n      mapper.acceptJsonFormatVisitor(RootType.class, schemaGenerator);\n\n      byte[] inputBytes = data.consumeRemainingAsBytes();\n      AvroParser parser =\n          (AvroParser) mapper.reader()\n              .with(schemaGenerator.getGeneratedSchema())\n              .createParser(inputBytes);\n\n      // Fuzz methods of AvroParser\n      for (Integer choice : choices) {\n        switch (Math.abs(choice) % 19) {\n          case 1:\n            parser.currentName();\n            break;\n          case 2:\n            parser.currentTokenLocation();\n            break;\n          case 3:\n            parser.currentLocation();\n            break;\n          case 4:\n            parser.isExpectedStartArrayToken();\n            break;\n          case 5:\n            parser.isExpectedNumberIntToken();\n            break;\n          case 6:\n            parser.nextToken();\n            break;\n          case 7:\n            parser.nextStringValue();\n            break;\n          case 8:\n            parser.getText();\n            break;\n          case 9:\n            parser.getTextCharacters();\n            break;\n          case 10:\n            parser.getTextLength();\n            break;\n          case 11:\n            parser.getTextOffset();\n            break;\n          case 12:\n            parser.getNumberType();\n            break;\n          case 13:\n            parser.getNumberValue();\n            break;\n          case 14:\n            parser.getIntValue();\n            break;\n          case 15:\n            parser.getLongValue();\n            break;\n          case 16:\n            parser.getBigIntegerValue();\n            break;\n          case 17:\n            parser.getFloatValue();\n            break;\n          case 18:\n            parser.getDoubleValue();\n            break;\n          default:\n            parser.getDecimalValue();\n            break;\n        }\n      }\n\n      parser.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n\n  private static class RootType {\n    @JsonAlias({\"nm\", \"Name\"})\n    public String name;\n\n    public int value;\n\n    List<String> other;\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/CborFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.cbor.CBORMapper;\n\n\npublic class CborFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    ObjectMapper mapper = new CBORMapper();\n    try {\n      mapper.readTree(input);\n    } catch (RuntimeException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/CborGeneratorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.io.SerializedString;\nimport tools.jackson.dataformat.cbor.CBORFactory;\nimport tools.jackson.dataformat.cbor.CBORGenerator;\nimport tools.jackson.dataformat.cbor.CBORMapper;\nimport tools.jackson.dataformat.cbor.CBORWriteFeature;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\n\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.EnumSet;\n\n/** This fuzzer targets the methods of CBORGenerator */\npublic class CborGeneratorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Retrieve set of CBORWriteFeature\n      EnumSet<CBORWriteFeature> featureSet = EnumSet.allOf(CBORWriteFeature.class);\n\n      // Create and configure CBORMapper\n      CBORMapper mapper =\n          new CBORMapper(\n              CBORFactory.builder()\n                  .enable(data.pickValue(featureSet))\n                  .disable(data.pickValue(featureSet))\n                  .build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Create CBORGenerator\n      CBORGenerator generator =\n          (CBORGenerator) ((CBORMapper) mapper).tokenStreamFactory().createGenerator(new ByteArrayOutputStream());\n      generator.writeStartObject();\n\n      // Fuzz methods of CBORGenerator\n      String value = null;\n      byte[] byteArray = null;\n      generator.writeName(\"OSS-Fuzz\");\n      switch (data.consumeInt(1, 18)) {\n        case 1:\n          generator.writeBoolean(data.consumeBoolean());\n          break;\n        case 2:\n          generator.writeNull();\n          break;\n        case 3:\n          int[] intArray = data.consumeInts(data.consumeInt(1, 5));\n          generator.writeArray(intArray, 0, intArray.length);\n          break;\n        case 4:\n          long[] longArray = data.consumeLongs(data.consumeInt(1, 5));\n          generator.writeArray(longArray, 0, longArray.length);\n          break;\n        case 5:\n          double[] doubleArray = new double[data.consumeInt(1, 5)];\n          for (int i = 0; i < doubleArray.length; i++) {\n            doubleArray[i] = data.consumeDouble();\n          }\n          generator.writeArray(doubleArray, 0, doubleArray.length);\n          break;\n        case 6:\n          generator.writeString(data.consumeRemainingAsString());\n          break;\n        case 7:\n          value = data.consumeRemainingAsString();\n          generator.writeString(value.toCharArray(), 0, value.length());\n          break;\n        case 8:\n          generator.writeString(new SerializedString(data.consumeRemainingAsString()));\n          break;\n        case 9:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeRawUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 10:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 11:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeBinary(new ByteArrayInputStream(byteArray), byteArray.length);\n          break;\n        case 12:\n          generator.writeNumber(data.consumeInt());\n          break;\n        case 13:\n          generator.writeNumber(data.consumeLong());\n          break;\n        case 14:\n          generator.writeNumber(data.consumeDouble());\n          break;\n        case 15:\n          generator.writeNumber(data.consumeFloat());\n          break;\n        case 16:\n          generator.writeNumber(new BigDecimal(data.consumeLong()));\n          break;\n        case 17:\n          generator.writeNumber(BigInteger.valueOf(data.consumeLong()));\n          break;\n        case 18:\n          generator.writeNumber(data.consumeRemainingAsString());\n          break;\n      }\n\n      generator.writeEndObject();\n      generator.flush();\n      generator.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/CborParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.dataformat.cbor.CBORFactory;\nimport tools.jackson.dataformat.cbor.CBORParser;\nimport tools.jackson.dataformat.cbor.CBORMapper;\n\nimport java.util.EnumSet;\n\n/** This fuzzer targets the methods of CBORParser */\npublic class CborParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 100));\n\n      // Create and configure CBORParser\n      CBORMapper mapper =\n          new CBORMapper(CBORFactory.builder().build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Create and configure CBORParser\n      CBORParser parser =\n          (CBORParser) ((CBORMapper) mapper).tokenStreamFactory().createParser(data.consumeRemainingAsBytes());\n\n      // Fuzz methods of CBORParser\n      for (Integer choice : choices) {\n        switch (Math.abs(choice) % 19) {\n          case 1:\n            parser.currentName();\n            break;\n          case 2:\n            parser.currentTokenLocation();\n            break;\n          case 3:\n            parser.currentLocation();\n            break;\n          case 4:\n            parser.isExpectedStartArrayToken();\n            break;\n          case 5:\n            parser.isExpectedNumberIntToken();\n            break;\n          case 6:\n            parser.nextToken();\n            break;\n          case 7:\n            parser.nextStringValue();\n            break;\n          case 8:\n            parser.getText();\n            break;\n          case 9:\n            parser.getTextCharacters();\n            break;\n          case 10:\n            parser.getTextLength();\n            break;\n          case 11:\n            parser.getTextOffset();\n            break;\n          case 12:\n            parser.getNumberType();\n            break;\n          case 13:\n            parser.getNumberValue();\n            break;\n          case 14:\n            parser.getIntValue();\n            break;\n          case 15:\n            parser.getLongValue();\n            break;\n          case 16:\n            parser.getBigIntegerValue();\n            break;\n          case 17:\n            parser.getFloatValue();\n            break;\n          case 18:\n            parser.getDoubleValue();\n            break;\n          default:\n            parser.getDecimalValue();\n            break;\n        }\n      }\n\n      parser.close();\n    } catch (RuntimeException e) {\n      // Known exception - ignore internal errors\n      if (e.getMessage() != null && !e.getMessage().contains(\"Internal error\") && !e.getMessage().isEmpty()) {\n        // Only rethrow if not a known internal error\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/DeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\nimport com.fasterxml.jackson.annotation.JsonRawValue;\nimport com.fasterxml.jackson.annotation.JsonRootName;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.avro.AvroFactory;\nimport tools.jackson.dataformat.avro.AvroFactoryBuilder;\nimport tools.jackson.dataformat.avro.AvroMapper;\nimport tools.jackson.dataformat.avro.AvroReadFeature;\nimport tools.jackson.dataformat.cbor.CBORFactory;\nimport tools.jackson.dataformat.cbor.CBORWriteFeature;\nimport tools.jackson.dataformat.cbor.CBORMapper;\nimport tools.jackson.dataformat.ion.IonFactory;\nimport tools.jackson.dataformat.ion.IonFactoryBuilder;\nimport tools.jackson.dataformat.ion.IonObjectMapper;\nimport tools.jackson.dataformat.ion.IonReadFeature;\nimport tools.jackson.dataformat.protobuf.ProtobufFactory;\nimport tools.jackson.dataformat.protobuf.ProtobufMapper;\nimport tools.jackson.dataformat.smile.SmileFactory;\nimport tools.jackson.dataformat.smile.SmileReadFeature;\nimport tools.jackson.dataformat.smile.SmileMapper;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\n\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.ArrayList;\nimport java.util.Date;\nimport java.util.EnumSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.UUID;\nimport java.util.stream.Stream;\n\n/** This fuzzer targets the deserialization methods of Avro/Cbor/Ion/Protobuf/Smile objects */\npublic class DeserializerFuzzer {\n  private static ObjectMapper mapper;\n  private static List<Class> choice;\n\n  public static void fuzzerInitialize() {\n    mapper = null;\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    JsonParser parser = null;\n\n    try {\n      // Initialize ObjectMapper object\n      switch (data.consumeInt(1, 5)) {\n        case 1:\n          AvroFactoryBuilder avroFactoryBuilder;\n          if (data.consumeBoolean()) {\n            avroFactoryBuilder = AvroFactory.builderWithApacheDecoder();\n          } else {\n            avroFactoryBuilder = AvroFactory.builderWithNativeDecoder();\n          }\n\n          mapper =\n              AvroMapper.builder(\n                      avroFactoryBuilder\n                          .enable(data.pickValue(EnumSet.allOf(AvroReadFeature.class)))\n                          .build())\n                  .build();\n          break;\n        case 2:\n          mapper =\n              CBORMapper.builder(\n                      CBORFactory.builder()\n                          .enable(data.pickValue(EnumSet.allOf(CBORWriteFeature.class)))\n                          .build())\n                  .build();\n          break;\n        case 3:\n          IonFactoryBuilder ionFactoryBuilder;\n          if (data.consumeBoolean()) {\n            ionFactoryBuilder = IonFactory.builderForBinaryWriters();\n          } else {\n            ionFactoryBuilder = IonFactory.builderForTextualWriters();\n          }\n\n          mapper =\n              IonObjectMapper.builder(\n                      ionFactoryBuilder\n                          .enable(data.pickValue(EnumSet.allOf(IonReadFeature.class)))\n                          .build())\n                  .build();\n          break;\n        case 4:\n          mapper = ProtobufMapper.builder(ProtobufFactory.builder().build()).build();\n          break;\n        case 5:\n          mapper =\n              SmileMapper.builder(\n                      SmileFactory.builder()\n                          .enable(data.pickValue(EnumSet.allOf(SmileReadFeature.class)))\n                          .build())\n                  .build();\n          break;\n      }\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Fuzz the deserialize methods for different Avro/Cbor/Ion/Protobuf/Smile objects\n      if (data.consumeBoolean()) {\n        byte[] output = data.consumeRemainingAsBytes();\n        parser = mapper.tokenStreamFactory().createParser(new ByteArrayInputStream(output));\n        mapper.readTree(parser);\n      } else {\n        Class type = data.pickValue(choice);\n        String value = data.consumeRemainingAsString();\n        if ((value == null) || (value.isEmpty())) {\n          return;\n        }\n        mapper.readValue(value, type);\n        if (mapper instanceof AvroMapper) {\n          try {\n            mapper.readerFor(type).with(((AvroMapper) mapper).schemaFrom(value)).readValue(value);\n          } catch (java.io.IOException e) {\n            // Schema parsing can throw IOException\n          }\n        }\n      }\n    } catch (RuntimeException e) {\n      // Known exception\n    } finally {\n      try {\n        if (parser != null) {\n          parser.close();\n        }\n      } catch (RuntimeException e) {\n        // Ignore exceptions for closing JsonParser object\n      }\n    }\n  }\n\n  private static void initializeClassChoice() {\n    choice = new ArrayList<Class>();\n    choice.add(ByteArrayContainer.class);\n    choice.add(ByteArrayOutputStream.class);\n    choice.add(ModelContainer.class);\n    choice.add(DelegateContainer.class);\n    choice.add(RawContainer.class);\n    choice.add(MapContainer.class);\n    choice.add(ListContainer.class);\n    choice.add(ArrayContainer.class);\n    choice.add(UUIDContainer.class);\n    choice.add(EnumFuzz.class);\n    choice.add(EnumContainer.class);\n    choice.add(Exception.class);\n    choice.add(Error.class);\n    choice.add(Map.class);\n    choice.add(List.class);\n    choice.add(Set.class);\n    choice.add(Stream.class);\n    choice.add(String.class);\n    choice.add(Boolean.class);\n    choice.add(Character.class);\n    choice.add(Byte.class);\n    choice.add(Integer.class);\n    choice.add(Long.class);\n    choice.add(Short.class);\n    choice.add(Double.class);\n    choice.add(Float.class);\n    choice.add(BigInteger.class);\n    choice.add(BigDecimal.class);\n    choice.add(Number.class);\n    choice.add(String.class);\n    choice.add(Character[].class);\n    choice.add(Date.class);\n  }\n\n  private static class ByteArrayContainer {\n    public byte[] value;\n\n    public ByteArrayContainer(byte[] value) {\n      this.value = value;\n    }\n  }\n\n  @JsonRootName(\"Model\")\n  private static class ModelContainer {\n    public String string;\n\n    @JsonCreator\n    public ModelContainer(@JsonProperty(value = \"string\", required = true) String string) {\n      this.string = string;\n    }\n  }\n\n  private static class DelegateContainer {\n    public String string;\n\n    @JsonCreator(mode = JsonCreator.Mode.DELEGATING)\n    public DelegateContainer(String string) {\n      this.string = string;\n    }\n  }\n\n  @JsonPropertyOrder({\"id\", \"raw\"})\n  private static class RawContainer {\n    @JsonRawValue public String string;\n  }\n\n  private static class MapContainer {\n    public Map<Integer, String> map;\n\n    public void setMap(Map<Integer, String> map) {\n      this.map = map;\n    }\n  }\n\n  private static class ListContainer {\n    public List<String> list;\n\n    public void setList(List<String> list) {\n      this.list = list;\n    }\n  }\n\n  private static class ArrayContainer {\n    public String[] array;\n\n    public String[] getArray() {\n      return array;\n    }\n\n    public void setArray(String[] array) {\n      this.array = array;\n    }\n  }\n\n  private static class UUIDContainer {\n    public UUID uuid;\n\n    public UUIDContainer(UUID uuid) {\n      this.uuid = uuid;\n    }\n  }\n\n  private static enum EnumFuzz {\n    A,\n    B,\n    C,\n    D,\n    E;\n  }\n\n  private static class EnumContainer {\n    public EnumFuzz enumFuzz;\n\n    public EnumContainer(EnumFuzz enumFuzz) {\n      this.enumFuzz = enumFuzz;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y maven\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-dataformats-binary\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jackson-dataformats-binary\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/IonGeneratorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JsonGenerator;\nimport tools.jackson.core.io.SerializedString;\nimport tools.jackson.dataformat.ion.IonFactory;\nimport tools.jackson.dataformat.ion.IonFactoryBuilder;\nimport tools.jackson.dataformat.ion.IonGenerator;\nimport tools.jackson.dataformat.ion.IonObjectMapper;\nimport tools.jackson.dataformat.ion.IonWriteFeature;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\n\nimport java.io.OutputStreamWriter;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.EnumSet;\n\n/** This fuzzer targets the methods of IonGenerator */\npublic class IonGeneratorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Retrieve set of IonWriteFeature\n      EnumSet<IonWriteFeature> featureSet = EnumSet.allOf(IonWriteFeature.class);\n\n      // Create and configure IonObjectMapper\n      IonFactoryBuilder ionFactoryBuilder;\n      if (data.consumeBoolean()) {\n        ionFactoryBuilder = IonFactory.builderForBinaryWriters();\n      } else {\n        ionFactoryBuilder = IonFactory.builderForTextualWriters();\n      }\n\n      IonObjectMapper mapper =\n          new IonObjectMapper(\n              ionFactoryBuilder\n                  .enable(data.pickValue(featureSet))\n                  .disable(data.pickValue(featureSet))\n                  .build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Create and configure IonGenerator\n      JsonGenerator generator =\n          ((IonObjectMapper) mapper)\n              .tokenStreamFactory()\n              .createGenerator(new OutputStreamWriter(new ByteArrayOutputStream()));\n      generator.writeStartObject();\n\n      // Fuzz methods of ProtobufGenerator\n      String value = null;\n      byte[] byteArray = null;\n      generator.writeName(\"OSS-Fuzz\");\n      switch (data.consumeInt(1, 18)) {\n        case 1:\n          generator.writeBoolean(data.consumeBoolean());\n          break;\n        case 2:\n          generator.writeNull();\n          break;\n        case 3:\n          int[] intArray = data.consumeInts(data.consumeInt(1, 5));\n          generator.writeArray(intArray, 0, intArray.length);\n          break;\n        case 4:\n          long[] longArray = data.consumeLongs(data.consumeInt(1, 5));\n          generator.writeArray(longArray, 0, longArray.length);\n          break;\n        case 5:\n          double[] doubleArray = new double[data.consumeInt(1, 5)];\n          for (int i = 0; i < doubleArray.length; i++) {\n            doubleArray[i] = data.consumeDouble();\n          }\n          generator.writeArray(doubleArray, 0, doubleArray.length);\n          break;\n        case 6:\n          generator.writeString(data.consumeRemainingAsString());\n          break;\n        case 7:\n          value = data.consumeRemainingAsString();\n          generator.writeString(value.toCharArray(), 0, value.length());\n          break;\n        case 8:\n          generator.writeString(new SerializedString(data.consumeRemainingAsString()));\n          break;\n        case 9:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeRawUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 10:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 11:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeBinary(new ByteArrayInputStream(byteArray), byteArray.length);\n          break;\n        case 12:\n          generator.writeNumber(data.consumeInt());\n          break;\n        case 13:\n          generator.writeNumber(data.consumeLong());\n          break;\n        case 14:\n          generator.writeNumber(data.consumeDouble());\n          break;\n        case 15:\n          generator.writeNumber(data.consumeFloat());\n          break;\n        case 16:\n          generator.writeNumber(new BigDecimal(data.consumeLong()));\n          break;\n        case 17:\n          generator.writeNumber(BigInteger.valueOf(data.consumeLong()));\n          break;\n        case 18:\n          generator.writeNumber(data.consumeRemainingAsString());\n          break;\n      }\n\n      generator.writeEndObject();\n      generator.flush();\n      generator.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/IonParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.dataformat.ion.IonFactory;\nimport tools.jackson.dataformat.ion.IonFactoryBuilder;\nimport tools.jackson.dataformat.ion.IonObjectMapper;\nimport tools.jackson.dataformat.ion.IonReadFeature;\n\nimport java.util.EnumSet;\n\n/** This fuzzer targets the methods of IonParser */\npublic class IonParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 100));\n\n      // Retrieve set of IonReadFeature\n      EnumSet<IonReadFeature> featureSet = EnumSet.allOf(IonReadFeature.class);\n\n      // Create and configure IonObjectMapper\n      IonFactoryBuilder ionFactoryBuilder;\n      if (data.consumeBoolean()) {\n        ionFactoryBuilder = IonFactory.builderForBinaryWriters();\n      } else {\n        ionFactoryBuilder = IonFactory.builderForTextualWriters();\n      }\n      IonObjectMapper mapper =\n          new IonObjectMapper(\n              ionFactoryBuilder\n                  .enable(data.pickValue(featureSet))\n                  .disable(data.pickValue(featureSet))\n                  .build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Create and configure IonParser\n      byte[] byteArray = data.consumeRemainingAsBytes();\n      if ((byteArray == null) || (byteArray.length <= 0)) {\n        return;\n      }\n      JsonParser parser = ((IonObjectMapper) mapper).tokenStreamFactory().createParser(byteArray);\n\n      // Fuzz methods of IonParser\n      for (Integer choice : choices) {\n        switch (Math.abs(choice) % 19) {\n          case 1:\n            parser.currentName();\n            break;\n          case 2:\n            parser.currentTokenLocation();\n            break;\n          case 3:\n            parser.currentLocation();\n            break;\n          case 4:\n            parser.isExpectedStartArrayToken();\n            break;\n          case 5:\n            parser.isExpectedNumberIntToken();\n            break;\n          case 6:\n            parser.nextToken();\n            break;\n          case 7:\n            parser.nextStringValue();\n            break;\n          case 8:\n            parser.getText();\n            break;\n          case 9:\n            parser.getTextCharacters();\n            break;\n          case 10:\n            parser.getTextLength();\n            break;\n          case 11:\n            parser.getTextOffset();\n            break;\n          case 12:\n            parser.getNumberType();\n            break;\n          case 13:\n            parser.getNumberValue();\n            break;\n          case 14:\n            parser.getIntValue();\n            break;\n          case 15:\n            parser.getLongValue();\n            break;\n          case 16:\n            parser.getBigIntegerValue();\n            break;\n          case 17:\n            parser.getFloatValue();\n            break;\n          case 18:\n            parser.getDoubleValue();\n            break;\n          default:\n            parser.getDecimalValue();\n            break;\n        }\n      }\n\n      parser.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/ProtobufParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.dataformat.protobuf.ProtobufFactory;\nimport tools.jackson.dataformat.protobuf.ProtobufMapper;\nimport tools.jackson.dataformat.protobuf.ProtobufParser;\n\n/** This fuzzer targets the methods of ProtobufParser */\npublic class ProtobufParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 100));\n\n      ProtobufMapper mapper = ProtobufMapper.builder(ProtobufFactory.builder().build()).build();\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Create and configure ProtobufParser\n      ProtobufParser parser =\n          (ProtobufParser) ((ProtobufMapper) mapper).tokenStreamFactory().createParser(data.consumeRemainingAsBytes());\n\n      parser.setSchema(mapper.generateSchemaFor(ProtobufParserFuzzer.class));\n\n      // Fuzz methods of ProtobufParser\n      for (Integer choice : choices) {\n        switch (Math.abs(choice) % 18) {\n          case 1:\n            parser.currentName();\n            break;\n          case 2:\n            parser.currentTokenLocation();\n            break;\n          case 3:\n            parser.currentLocation();\n            break;\n          case 4:\n            parser.isExpectedStartArrayToken();\n            break;\n          case 5:\n            parser.isExpectedNumberIntToken();\n            break;\n          case 6:\n            parser.nextToken();\n            break;\n          case 7:\n            parser.getText();\n            break;\n          case 8:\n            parser.getTextCharacters();\n            break;\n          case 9:\n            parser.getTextLength();\n            break;\n          case 10:\n            parser.getTextOffset();\n            break;\n          case 11:\n            parser.getNumberType();\n            break;\n          case 12:\n            parser.getNumberValue();\n            break;\n          case 13:\n            parser.getIntValue();\n            break;\n          case 14:\n            parser.getLongValue();\n            break;\n          case 15:\n            parser.getBigIntegerValue();\n            break;\n          case 16:\n            parser.getFloatValue();\n            break;\n          case 17:\n            parser.getDoubleValue();\n            break;\n          default:\n            parser.getDecimalValue();\n            break;\n        }\n      }\n\n      parser.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/SerializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\nimport com.fasterxml.jackson.annotation.JsonRawValue;\nimport com.fasterxml.jackson.annotation.JsonRootName;\nimport tools.jackson.core.FormatFeature;\nimport tools.jackson.core.TokenStreamFactory;\nimport tools.jackson.core.JsonGenerator;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.ObjectWriter;\nimport tools.jackson.databind.node.ObjectNode;\nimport tools.jackson.dataformat.avro.AvroFactory;\nimport tools.jackson.dataformat.avro.AvroFactoryBuilder;\nimport tools.jackson.dataformat.avro.AvroMapper;\nimport tools.jackson.dataformat.avro.AvroReadFeature;\nimport tools.jackson.dataformat.cbor.CBORFactory;\nimport tools.jackson.dataformat.cbor.CBORWriteFeature;\nimport tools.jackson.dataformat.cbor.CBORMapper;\nimport tools.jackson.dataformat.ion.IonFactory;\nimport tools.jackson.dataformat.ion.IonFactoryBuilder;\nimport tools.jackson.dataformat.ion.IonObjectMapper;\nimport tools.jackson.dataformat.ion.IonReadFeature;\nimport tools.jackson.dataformat.protobuf.ProtobufFactory;\nimport tools.jackson.dataformat.protobuf.ProtobufMapper;\nimport tools.jackson.dataformat.smile.SmileFactory;\nimport tools.jackson.dataformat.smile.SmileReadFeature;\nimport tools.jackson.dataformat.smile.SmileMapper;\nimport java.io.ByteArrayInputStream;\n\nimport java.io.StringWriter;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.nio.ByteBuffer;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Date;\nimport java.util.EnumSet;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\n\n/** This fuzzer targets the serialization methods of Avro/Cbor/Ion/Protobuf/Smile objects */\npublic class SerializerFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    TokenStreamFactory factory = null;\n    JsonGenerator generator = null;\n    ObjectMapper mapper = null;\n    FormatFeature feature = null;\n\n    try {\n      switch (data.consumeInt(1, 5)) {\n        case 1:\n          // Initialize AvroFactoryBuilder object\n          AvroFactoryBuilder avroFactoryBuilder;\n          if (data.consumeBoolean()) {\n            avroFactoryBuilder = AvroFactory.builderWithApacheDecoder();\n          } else {\n            avroFactoryBuilder = AvroFactory.builderWithNativeDecoder();\n          }\n\n          // Initialize AvroFactory object\n          factory = avroFactoryBuilder.build();\n\n          // Initialize AvroMapper object\n          mapper = AvroMapper.builder((AvroFactory) factory).build();\n\n          // Initialize format options\n          feature = data.pickValue(EnumSet.allOf(AvroReadFeature.class));\n          break;\n        case 2:\n          // Initialize CBORFactory object\n          factory = CBORFactory.builder().build();\n\n          // Initialize CBORMapper object\n          mapper = CBORMapper.builder((CBORFactory) factory).build();\n\n          // Initialize format options\n          feature = data.pickValue(EnumSet.allOf(CBORWriteFeature.class));\n          break;\n        case 3:\n          // Initialize IonFactoryBuilder object\n          IonFactoryBuilder ionFactoryBuilder;\n          if (data.consumeBoolean()) {\n            ionFactoryBuilder = IonFactory.builderForBinaryWriters();\n          } else {\n            ionFactoryBuilder = IonFactory.builderForTextualWriters();\n          }\n\n          // Initialize IonFactory object\n          factory = ionFactoryBuilder.build();\n\n          // Initialize IonObjectMapper object\n          mapper = IonObjectMapper.builder((IonFactory) factory).build();\n\n          // Initialize format options\n          feature = data.pickValue(EnumSet.allOf(IonReadFeature.class));\n          break;\n        case 4:\n          // Initialize ProtobufFactory object\n          factory = ProtobufFactory.builder().build();\n\n          // Initialize ProtobufMapper object\n          mapper = ProtobufMapper.builder((ProtobufFactory) factory).build();\n          break;\n        case 5:\n          // Initialize SmileFactory object\n          factory = SmileFactory.builder().build();\n\n          // Initialize SmileMapper object\n          mapper = SmileMapper.builder((SmileFactory) factory).build();\n\n          // Initialize format options\n          feature = data.pickValue(EnumSet.allOf(SmileReadFeature.class));\n          break;\n      }\n\n      // Failsafe logic\n      if ((factory == null) || (mapper == null)) {\n        return;\n      }\n\n      // Initialize ObjectWriter object\n      ObjectWriter writer = mapper.writer();\n\n      // Initialize ObjectNode object\n      ObjectNode node = mapper.createObjectNode();\n\n      // Randomize writer options\n      if (data.consumeBoolean()) {\n        writer = writer.withDefaultPrettyPrinter();\n      }\n      if (feature != null) {\n        writer = writer.with(feature);\n      }\n\n      // Object to write\n      Object object = null;\n\n      // Fuzz the serialize methods for different XML objects\n      switch (data.consumeInt(1, 28)) {\n        case 1:\n          node.put(\"data\", data.consumeRemainingAsBytes());\n          object = node;\n          break;\n        case 2:\n          generator = factory.createGenerator(new StringWriter());\n          generator.writeStartObject();\n          generator.writeName(\"data\");\n          byte[] binaryData = data.consumeRemainingAsBytes();\n          generator.writeBinary(binaryData, 0, binaryData.length);\n          generator.writeEndObject();\n          break;\n        case 3:\n          generator = factory.createGenerator(new StringWriter());\n          generator.writeStartObject();\n          generator.writeString(data.consumeRemainingAsString());\n          generator.writeEndObject();\n          break;\n        case 4:\n          Map<String, String> innerMap =\n              Collections.singletonMap(\"inner_data\", data.consumeRemainingAsString());\n          Map<String, Map<String, String>> map = Collections.singletonMap(\"data\", innerMap);\n          object = map;\n          break;\n        case 5:\n          List<String> innerList = Collections.singletonList(data.consumeRemainingAsString());\n          List<List<String>> list = Collections.singletonList(innerList);\n          object = list;\n          break;\n        case 6:\n          object = BigInteger.valueOf(data.consumeLong());\n          break;\n        case 7:\n          object = data.consumeRemainingAsString();\n          break;\n        case 8:\n          object = data.consumeRemainingAsBytes();\n          break;\n        case 9:\n          object = BigDecimal.valueOf(data.consumeDouble());\n          break;\n        case 10:\n          object = data.consumeBoolean();\n          break;\n        case 11:\n          object = data.consumeInt();\n          break;\n        case 12:\n          object = data.consumeLong();\n          break;\n        case 13:\n          object = data.consumeDouble();\n          break;\n        case 14:\n          object = data.consumeBoolean();\n          break;\n        case 15:\n          object = data.consumeByte();\n          break;\n        case 16:\n          object = data.consumeChar();\n          break;\n        case 17:\n          object = data.consumeBoolean();\n          break;\n        case 18:\n          object = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n          break;\n        case 19:\n          object = new RawContainer(data.consumeRemainingAsString());\n          break;\n        case 20:\n          object = new ByteBufferContainer(data.consumeRemainingAsBytes());\n          break;\n        case 21:\n          object = new MapContainer(data.consumeRemainingAsString());\n          break;\n        case 22:\n          object = new ListContainer(data.consumeRemainingAsString());\n          break;\n        case 23:\n          object = new ByteArrayContainer(data.consumeRemainingAsBytes());\n          break;\n        case 24:\n          object = new UUID(data.consumeLong(), data.consumeLong());\n          break;\n        case 25:\n          object = new UUIDContainer(data.consumeLong(), data.consumeLong());\n          break;\n        case 26:\n          object = new ArrayContainer(data.consumeRemainingAsString());\n          break;\n        case 27:\n          object = new Date(data.consumeLong());\n          break;\n        case 28:\n          object = data.consumeRemainingAsString().toCharArray();\n          break;\n      }\n\n      writer.writeValueAsString(object);\n      writer.writeValueAsBytes(object);\n    } catch (RuntimeException e) {\n      // Known exception\n    } finally {\n      try {\n        if (generator != null) {\n          // Close JsonGenerator object\n          generator.flush();\n          generator.close();\n        }\n      } catch (RuntimeException e) {\n        // Ignore exceptions for generator closing\n      }\n    }\n  }\n\n  @JsonRootName(\"ByteArray\")\n  private static class ByteArrayContainer {\n    public byte[] value;\n\n    public ByteArrayContainer(byte[] value) {\n      this.value = value;\n    }\n  }\n\n  @JsonPropertyOrder({\"id\", \"raw\"})\n  private static class RawContainer {\n    @JsonRawValue public String string;\n    @JsonRawValue public char[] charArray;\n\n    public RawContainer(String string) {\n      this.string = string;\n      this.charArray = string.toCharArray();\n    }\n  }\n\n  private static class ByteBufferContainer {\n    public ByteBuffer byteBuffer;\n\n    public ByteBufferContainer(byte[] byteArray) {\n      this.byteBuffer = ByteBuffer.allocateDirect(byteArray.length);\n      this.byteBuffer.put(byteArray);\n    }\n  }\n\n  private static class MapContainer {\n    public Map<Integer, String> map;\n\n    public MapContainer(String string) {\n      this.map = new HashMap<Integer, String>();\n      this.map.put(0, string);\n    }\n  }\n\n  private static class ListContainer {\n    public List<String> list;\n\n    public ListContainer(String string) {\n      this.list = new ArrayList<String>();\n      this.list.add(string);\n    }\n  }\n\n  private static class ArrayContainer {\n    public char[] array;\n\n    public ArrayContainer(String string) {\n      this.array = string.toCharArray();\n    }\n\n    public void setArray(char[] array) {\n      this.array = array;\n    }\n  }\n\n  private static class UUIDContainer {\n    public UUID uuid;\n\n    public UUIDContainer(long a, long b) {\n      this.uuid = new UUID(a, b);\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/SmileFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.smile.SmileMapper;\n\n\npublic class SmileFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    ObjectMapper mapper = new SmileMapper();\n    try {\n      mapper.readTree(input);\n    } catch (RuntimeException ignored) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/SmileGeneratorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.io.SerializedString;\nimport tools.jackson.dataformat.smile.SmileFactory;\nimport tools.jackson.dataformat.smile.SmileGenerator;\nimport tools.jackson.dataformat.smile.SmileMapper;\nimport tools.jackson.dataformat.smile.SmileWriteFeature;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\n\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.EnumSet;\n\n/** This fuzzer targets the methods of SmileGenerator */\npublic class SmileGeneratorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Retrieve set of SmileWriteFeature\n      EnumSet<SmileWriteFeature> featureSet = EnumSet.allOf(SmileWriteFeature.class);\n\n      // Create and configure SmileMapper\n      SmileMapper mapper =\n          new SmileMapper(\n              SmileFactory.builder()\n                  .enable(data.pickValue(featureSet))\n                  .build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Create SmileGenerator\n      SmileGenerator generator =\n          (SmileGenerator) ((SmileMapper) mapper).tokenStreamFactory().createGenerator(new ByteArrayOutputStream());\n      generator.writeStartObject();\n\n      // Fuzz methods of SmileGenerator\n      String value = null;\n      byte[] byteArray = null;\n      generator.writeName(\"OSS-Fuzz\");\n      switch (data.consumeInt(1, 20)) {\n        case 1:\n          generator.writeRaw(data.consumeByte());\n          break;\n        case 2:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeBytes(byteArray, 0, byteArray.length);\n          break;\n        case 3:\n          int[] intArray = data.consumeInts(data.consumeInt(1, 5));\n          generator.writeArray(intArray, 0, intArray.length);\n          break;\n        case 4:\n          long[] longArray = data.consumeLongs(data.consumeInt(1, 5));\n          generator.writeArray(longArray, 0, longArray.length);\n          break;\n        case 5:\n          double[] doubleArray = new double[data.consumeInt(1, 5)];\n          for (int i = 0; i < doubleArray.length; i++) {\n            doubleArray[i] = data.consumeDouble();\n          }\n          generator.writeArray(doubleArray, 0, doubleArray.length);\n          break;\n        case 6:\n          generator.writeString(data.consumeRemainingAsString());\n          break;\n        case 7:\n          value = data.consumeRemainingAsString();\n          generator.writeString(value.toCharArray(), 0, value.length());\n          break;\n        case 8:\n          generator.writeString(new SerializedString(data.consumeRemainingAsString()));\n          break;\n        case 9:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeRawUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 10:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeUTF8String(byteArray, 0, byteArray.length);\n          break;\n        case 11:\n          byteArray = data.consumeRemainingAsBytes();\n          generator.writeBinary(new ByteArrayInputStream(byteArray), byteArray.length);\n          break;\n        case 12:\n          generator.writeBoolean(data.consumeBoolean());\n          break;\n        case 13:\n          generator.writeNull();\n          break;\n        case 14:\n          generator.writeNumber(data.consumeInt());\n          break;\n        case 15:\n          generator.writeNumber(data.consumeLong());\n          break;\n        case 16:\n          generator.writeNumber(data.consumeDouble());\n          break;\n        case 17:\n          generator.writeNumber(data.consumeFloat());\n          break;\n        case 18:\n          generator.writeNumber(new BigDecimal(data.consumeLong()));\n          break;\n        case 19:\n          generator.writeNumber(BigInteger.valueOf(data.consumeLong()));\n          break;\n        case 20:\n          generator.writeNumber(data.consumeRemainingAsString());\n          break;\n      }\n\n      generator.writeEndObject();\n      generator.flush();\n      generator.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/SmileParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.dataformat.smile.SmileFactory;\nimport tools.jackson.dataformat.smile.SmileParser;\nimport tools.jackson.dataformat.smile.SmileMapper;\nimport tools.jackson.dataformat.smile.SmileReadFeature;\n\nimport java.util.EnumSet;\n\n/** This fuzzer targets the methods of SmileParser */\npublic class SmileParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 100));\n\n      // Retrieve set of SmileReadFeature\n      EnumSet<SmileReadFeature> featureSet = EnumSet.allOf(SmileReadFeature.class);\n\n      // Create and configure SmileMapper\n      SmileMapper mapper =\n          new SmileMapper(\n              SmileFactory.builder()\n                  .enable(data.pickValue(featureSet))\n                  .disable(data.pickValue(featureSet))\n                  .build());\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Create and configure SmileParser\n      SmileParser parser =\n          (SmileParser) ((SmileMapper) mapper).tokenStreamFactory().createParser(data.consumeRemainingAsBytes());\n\n      // Fuzz methods of SmileParser\n      for (Integer choice : choices) {\n        switch (Math.abs(choice) % 19) {\n          case 1:\n            parser.currentName();\n            break;\n          case 2:\n            parser.currentTokenLocation();\n            break;\n          case 3:\n            parser.currentLocation();\n            break;\n          case 4:\n            parser.isExpectedStartArrayToken();\n            break;\n          case 5:\n            parser.isExpectedNumberIntToken();\n            break;\n          case 6:\n            parser.nextToken();\n            break;\n          case 7:\n            parser.nextStringValue();\n            break;\n          case 8:\n            parser.getText();\n            break;\n          case 9:\n            parser.getTextCharacters();\n            break;\n          case 10:\n            parser.getTextLength();\n            break;\n          case 11:\n            parser.getTextOffset();\n            break;\n          case 12:\n            parser.getNumberType();\n            break;\n          case 13:\n            parser.getNumberValue();\n            break;\n          case 14:\n            parser.getIntValue();\n            break;\n          case 15:\n            parser.getLongValue();\n            break;\n          case 16:\n            parser.getBigIntegerValue();\n            break;\n          case 17:\n            parser.getFloatValue();\n            break;\n          case 18:\n            parser.getDoubleValue();\n            break;\n          default:\n            parser.getDecimalValue();\n            break;\n        }\n      }\n\n      parser.close();\n    } catch (RuntimeException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true\"\n\nmvn package dependency:copy-dependencies $MAVEN_ARGS\nCURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nDATAFORMAT_PREFIX=jackson-dataformat\n\nmkdir -p $OUT/dependency\ncp \"avro/target/$DATAFORMAT_PREFIX-avro-$CURRENT_VERSION.jar\" $OUT/$DATAFORMAT_PREFIX-avro.jar\nfor jarfile in $(find avro/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"cbor/target/$DATAFORMAT_PREFIX-cbor-$CURRENT_VERSION.jar\" $OUT/$DATAFORMAT_PREFIX-cbor.jar\nfor jarfile in $(find cbor/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"ion/target/$DATAFORMAT_PREFIX-ion-$CURRENT_VERSION.jar\" $OUT/$DATAFORMAT_PREFIX-ion.jar\nfor jarfile in $(find ion/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"protobuf/target/$DATAFORMAT_PREFIX-protobuf-$CURRENT_VERSION.jar\" $OUT/$DATAFORMAT_PREFIX-protobuf.jar\nfor jarfile in $(find protobuf/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"smile/target/$DATAFORMAT_PREFIX-smile-$CURRENT_VERSION.jar\" $OUT/$DATAFORMAT_PREFIX-smile.jar\nfor jarfile in $(find smile/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\n\nALL_JARS=\"$DATAFORMAT_PREFIX-cbor.jar $DATAFORMAT_PREFIX-smile.jar $DATAFORMAT_PREFIX-avro.jar $DATAFORMAT_PREFIX-ion.jar $DATAFORMAT_PREFIX-protobuf.jar\"\nALL_DEPENDENCY=$(find $OUT/dependency -name *.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"$OUT/dependency/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"\\$this_dir/dependency/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jackson-dataformats-binary/project.yaml",
    "content": "homepage: \"https://github.com/FasterXML/jackson-dataformats-binary\"\nlanguage: jvm\nprimary_contact: \"tatu@fasterxml.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/FasterXML/jackson-dataformats-binary\"\nsanitizers:\n  - address\nauto_ccs:\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"norbert.schneider@code-intelligence.com\"\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n  - \"tyagregg@gmail.com\"\n"
  },
  {
    "path": "projects/jackson-dataformats-text/CSVFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.csv.CsvMapper;\n\npublic class CSVFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    ObjectMapper mapper = new CsvMapper();\n    try {\n      mapper.readTree(input);\n    } catch (JacksonException ignored) {\n    }\n  }\n}"
  },
  {
    "path": "projects/jackson-dataformats-text/DeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\nimport com.fasterxml.jackson.annotation.JsonRawValue;\nimport com.fasterxml.jackson.annotation.JsonRootName;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.csv.CsvFactory;\nimport tools.jackson.dataformat.csv.CsvMapper;\nimport tools.jackson.dataformat.javaprop.JavaPropsFactory;\nimport tools.jackson.dataformat.javaprop.JavaPropsMapper;\nimport tools.jackson.dataformat.toml.TomlFactory;\nimport tools.jackson.dataformat.toml.TomlMapper;\nimport tools.jackson.dataformat.toml.TomlReadFeature;\nimport tools.jackson.dataformat.yaml.YAMLFactory;\nimport tools.jackson.dataformat.yaml.YAMLMapper;\nimport java.io.ByteArrayOutputStream;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.time.DateTimeException;\nimport java.util.ArrayList;\nimport java.util.EnumSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.stream.Stream;\n\n/** This fuzzer targets the deserialization methods of YAML/TOML/JavaProps/CSV objects */\npublic class DeserializerFuzzer {\n  private static ObjectMapper mapper;\n  private static List<Class> choice;\n\n  public static void fuzzerInitialize() {\n    mapper = null;\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    JsonParser parser = null;\n\n    try {\n      // Initialize ObjectMapper object\n      switch (data.consumeInt(1, 4)) {\n        case 1:\n          mapper = CsvMapper.builder(CsvFactory.builder().build()).build();\n          break;\n        case 2:\n          mapper = JavaPropsMapper.builder(JavaPropsFactory.builder().build()).build();\n          break;\n        case 3:\n          mapper =\n              TomlMapper.builder(\n                      TomlFactory.builder()\n                          .enable(data.pickValue(EnumSet.allOf(TomlReadFeature.class)))\n                          .build())\n                  .build();\n          break;\n        case 4:\n          mapper = YAMLMapper.builder(YAMLFactory.builder().build()).build();\n          break;\n      }\n\n      // Failsafe logic\n      if (mapper == null) {\n        return;\n      }\n\n      // Fuzz the deserialize methods for different Yaml/Toml/JavaProps/Csv objects\n      if (data.consumeBoolean()) {\n        byte[] output = new byte[data.remainingBytes()];\n        parser = mapper.tokenStreamFactory().createParser(output);\n        mapper.readTree(parser);\n      } else {\n        Class type = data.pickValue(choice);\n        String value = data.consumeRemainingAsString();\n        if ((value == null) || (value.isEmpty())) {\n          return;\n        }\n        mapper.readValue(value, type);\n      }\n    } catch (JacksonException | IllegalArgumentException | DateTimeException | IllegalStateException e) {\n      // Known exception\n    } finally {\n      try {\n        if (parser != null) {\n          parser.close();\n        }\n      } catch (JacksonException e) {\n        // Ignore exceptions for closing JsonParser object\n      }\n    }\n  }\n\n  private static void initializeClassChoice() {\n    choice = new ArrayList<Class>();\n    choice.add(ByteArrayContainer.class);\n    choice.add(ByteArrayOutputStream.class);\n    choice.add(ModelContainer.class);\n    choice.add(DelegateContainer.class);\n    choice.add(RawContainer.class);\n    choice.add(MapContainer.class);\n    choice.add(ListContainer.class);\n    choice.add(ArrayContainer.class);\n    choice.add(EnumFuzz.class);\n    choice.add(EnumContainer.class);\n    choice.add(Exception.class);\n    choice.add(Map.class);\n    choice.add(List.class);\n    choice.add(Set.class);\n    choice.add(Stream.class);\n    choice.add(String.class);\n    choice.add(Boolean.class);\n    choice.add(Character.class);\n    choice.add(Byte.class);\n    choice.add(Integer.class);\n    choice.add(Long.class);\n    choice.add(Short.class);\n    choice.add(Double.class);\n    choice.add(Float.class);\n    choice.add(BigInteger.class);\n    choice.add(BigDecimal.class);\n    choice.add(Number.class);\n  }\n\n  private static class ByteArrayContainer {\n    public byte[] value;\n\n    @JsonCreator\n    public ByteArrayContainer(byte[] value) {\n      this.value = value;\n    }\n  }\n\n  @JsonRootName(\"Model\")\n  private static class ModelContainer {\n    public String string;\n\n    @JsonCreator\n    public ModelContainer(@JsonProperty(value = \"string\", required = true) String string) {\n      this.string = string;\n    }\n  }\n\n  private static class DelegateContainer {\n    public String string;\n\n    @JsonCreator(mode = JsonCreator.Mode.DELEGATING)\n    public DelegateContainer(String string) {\n      this.string = string;\n    }\n  }\n\n  @JsonPropertyOrder({\"id\", \"raw\"})\n  private static class RawContainer {\n    @JsonRawValue public String string;\n  }\n\n  private static class MapContainer {\n    public Map<Integer, String> map;\n\n    public void setMap(Map<Integer, String> map) {\n      this.map = map;\n    }\n  }\n\n  private static class ListContainer {\n    public List<String> list;\n\n    public void setList(List<String> list) {\n      this.list = list;\n    }\n  }\n\n  private static class ArrayContainer {\n    public String[] array;\n\n    public String[] getArray() {\n      return array;\n    }\n\n    public void setArray(String[] array) {\n      this.array = array;\n    }\n  }\n\n  private static enum EnumFuzz {\n    A,\n    B,\n    C,\n    D,\n    E;\n  }\n\n  private static class EnumContainer {\n    public EnumFuzz enumFuzz;\n\n    public EnumContainer(EnumFuzz enumFuzz) {\n      this.enumFuzz = enumFuzz;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-text/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/yaml.dict $SRC/YAMLFuzzer.dict && \\\n    mv fuzzing/dictionaries/toml.dict $SRC/TOMLFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-dataformats-text.git\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-core.git\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-databind.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java  $SRC/\nWORKDIR $SRC/jackson-dataformats-text\n"
  },
  {
    "path": "projects/jackson-dataformats-text/PropertiesFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.javaprop.JavaPropsMapper;\n\npublic class PropertiesFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    ObjectMapper mapper = new JavaPropsMapper();\n    try {\n      mapper.readTree(input);\n    } catch (JacksonException ignored) {\n    }\n  }\n}"
  },
  {
    "path": "projects/jackson-dataformats-text/SerializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\nimport com.fasterxml.jackson.annotation.JsonRawValue;\nimport com.fasterxml.jackson.annotation.JsonRootName;\nimport tools.jackson.core.FormatFeature;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.core.JsonGenerator;\nimport tools.jackson.core.TokenStreamFactory;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.ObjectWriter;\nimport tools.jackson.databind.node.ObjectNode;\nimport tools.jackson.dataformat.csv.CsvFactory;\nimport tools.jackson.dataformat.csv.CsvMapper;\nimport tools.jackson.dataformat.csv.CsvWriteFeature;\nimport tools.jackson.dataformat.javaprop.JavaPropsFactory;\nimport tools.jackson.dataformat.javaprop.JavaPropsMapper;\nimport tools.jackson.dataformat.toml.TomlFactory;\nimport tools.jackson.dataformat.toml.TomlMapper;\nimport tools.jackson.dataformat.toml.TomlWriteFeature;\nimport tools.jackson.dataformat.yaml.YAMLFactory;\nimport tools.jackson.dataformat.yaml.YAMLMapper;\nimport tools.jackson.dataformat.yaml.YAMLWriteFeature;\nimport java.io.ByteArrayInputStream;\nimport java.io.StringWriter;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.nio.ByteBuffer;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.EnumSet;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport org.snakeyaml.engine.v2.api.DumpSettings;\nimport org.snakeyaml.engine.v2.common.FlowStyle;\n\n/** This fuzzer targets the serialization methods of YAML/TOML/JavaProps/CSV objects */\npublic class SerializerFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    TokenStreamFactory factory = null;\n    JsonGenerator generator = null;\n    ObjectMapper mapper = null;\n    FormatFeature feature = null;\n\n    try {\n      switch (data.consumeInt(1, 4)) {\n        case 1:\n          // Initialize CsvFactory object\n          factory = CsvFactory.builder().build();\n\n          // Initialize CsvMapper object\n          mapper = CsvMapper.builder((CsvFactory) factory).build();\n\n          // Initialize format options\n          feature = data.pickValue(EnumSet.allOf(CsvWriteFeature.class));\n          break;\n        case 2:\n          // Initialize JavaPropsFactory object\n          factory = JavaPropsFactory.builder().build();\n\n          // Initialize JavaPropsMapper object\n          mapper = JavaPropsMapper.builder((JavaPropsFactory) factory).build();\n          break;\n        case 3:\n          // Initialize TomlFactory object\n          factory = TomlFactory.builder().build();\n\n          // Initialize TomlMapper object\n          mapper = TomlMapper.builder((TomlFactory) factory).build();\n\n          // Initialize format options\n          feature = data.pickValue(EnumSet.allOf(TomlWriteFeature.class));\n          break;\n        case 4:\n          // Initialize YAMLFactory object\n          DumpSettings dumpSettings = DumpSettings.builder()\n                  .setDefaultFlowStyle(data.pickValue(EnumSet.allOf(FlowStyle.class)))\n                  .build();\n          factory = YAMLFactory.builder().dumperOptions(dumpSettings).build();\n\n          // Initialize YAMLMapper object\n          mapper = YAMLMapper.builder((YAMLFactory) factory).build();\n\n          // Initialize format options\n          feature = data.pickValue(EnumSet.allOf(YAMLWriteFeature.class));\n          break;\n      }\n\n      // Failsafe logic\n      if ((factory == null) || (mapper == null)) {\n        return;\n      }\n\n      // Initialize ObjectWriter object\n      ObjectWriter writer = mapper.writer();\n\n      // Initialize ObjectNode object\n      ObjectNode node = mapper.createObjectNode();\n\n      // Initialize JsonGenerator object\n      generator = factory.createGenerator(new StringWriter());\n\n      // Randomize writer options\n      if (data.consumeBoolean()) {\n        writer = writer.withDefaultPrettyPrinter();\n      }\n      if (feature != null) {\n        writer = writer.with(feature);\n      }\n\n      // Failsafe logic\n      if (generator == null) {\n        return;\n      }\n\n      // Object to write\n      Object object = null;\n\n      // Fuzz the serialize methods for different XML objects\n      switch (data.consumeInt(1, 23)) {\n        case 1:\n          node.put(\"data\", data.consumeRemainingAsBytes());\n          object = node;\n          break;\n        case 2:\n          generator.writeStartObject();\n          generator.writeBinary(data.consumeRemainingAsBytes());\n          generator.writeEndObject();\n          break;\n        case 3:\n          generator.writeStartObject();\n          generator.writeString(data.consumeRemainingAsString());\n          generator.writeEndObject();\n          break;\n        case 4:\n          Map<String, String> innerMap =\n              Collections.singletonMap(\"inner_data\", data.consumeRemainingAsString());\n          Map<String, Map<String, String>> map = Collections.singletonMap(\"data\", innerMap);\n          object = map;\n          break;\n        case 5:\n          List<String> innerList = Collections.singletonList(data.consumeRemainingAsString());\n          List<List<String>> list = Collections.singletonList(innerList);\n          object = list;\n          break;\n        case 6:\n          object = BigInteger.valueOf(data.consumeLong());\n          break;\n        case 7:\n          object = data.consumeRemainingAsString();\n          break;\n        case 8:\n          object = data.consumeRemainingAsBytes();\n          break;\n        case 9:\n          object = BigDecimal.valueOf(data.consumeDouble());\n          break;\n        case 10:\n          object = data.consumeBoolean();\n          break;\n        case 11:\n          object = data.consumeInt();\n          break;\n        case 12:\n          object = data.consumeLong();\n          break;\n        case 13:\n          object = data.consumeDouble();\n          break;\n        case 14:\n          object = data.consumeBoolean();\n          break;\n        case 15:\n          object = data.consumeByte();\n          break;\n        case 16:\n          object = data.consumeChar();\n          break;\n        case 17:\n          object = data.consumeBoolean();\n          break;\n        case 18:\n          object = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n          break;\n        case 19:\n          object = new RawContainer(data.consumeRemainingAsString());\n          break;\n        case 20:\n          object = new ByteBufferContainer(data.consumeRemainingAsBytes());\n          break;\n        case 21:\n          object = new MapContainer(data.consumeRemainingAsString());\n          break;\n        case 22:\n          object = new ListContainer(data.consumeRemainingAsString());\n          break;\n        case 23:\n          object = new ByteArrayContainer(data.consumeRemainingAsBytes());\n          break;\n      }\n\n      writer.writeValueAsString(object);\n      writer.writeValueAsBytes(object);\n    } catch (JacksonException | IllegalArgumentException e) {\n      // Known exception\n    } finally {\n      try {\n        if (generator != null) {\n          // Close JsonGenerator object\n          generator.flush();\n          generator.close();\n        }\n      } catch (JacksonException e) {\n        // Ignore exceptions for generator closing\n      }\n    }\n  }\n\n  @JsonRootName(\"ByteArray\")\n  private static class ByteArrayContainer {\n    public byte[] value;\n\n    public ByteArrayContainer(byte[] value) {\n      this.value = value;\n    }\n  }\n\n  @JsonPropertyOrder({\"id\", \"raw\"})\n  private static class RawContainer {\n    @JsonRawValue public String string;\n    @JsonRawValue public char[] charArray;\n\n    public RawContainer(String string) {\n      this.string = string;\n      this.charArray = string.toCharArray();\n    }\n  }\n\n  private static class ByteBufferContainer {\n    public ByteBuffer byteBuffer;\n\n    public ByteBufferContainer(byte[] byteArray) {\n      this.byteBuffer = ByteBuffer.allocateDirect(byteArray.length);\n      this.byteBuffer.put(byteArray);\n    }\n  }\n\n  private static class MapContainer {\n    public Map<Integer, String> map;\n\n    public MapContainer(String string) {\n      this.map = new HashMap<Integer, String>();\n      this.map.put(0, string);\n    }\n  }\n\n  private static class ListContainer {\n    public List<String> list;\n\n    public ListContainer(String string) {\n      this.list = new ArrayList<String>();\n      this.list.add(string);\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-dataformats-text/TOMLFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.toml.TomlMapper;\n\npublic class TOMLFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    ObjectMapper mapper = new TomlMapper();\n    try {\n      mapper.readTree(input);\n    } catch (JacksonException ignored) {\n    }\n  }\n}"
  },
  {
    "path": "projects/jackson-dataformats-text/YAMLFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.dataformat.yaml.YAMLMapper;\n\npublic class YAMLFuzzer {\n  public static void fuzzerTestOneInput(byte[] input) {\n    ObjectMapper mapper = new YAMLMapper();\n    try {\n      mapper.readTree(input);\n    } catch (JacksonException ignored) {\n    }\n  }\n}"
  },
  {
    "path": "projects/jackson-dataformats-text/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/jackson-core\n$MVN install -Dmaven.test.skip=true -Djavac.src.version=17 -Djavac.target.version=17\n\ncd $SRC/jackson-databind\n$MVN install -Dmaven.test.skip=true -Djavac.src.version=17 -Djavac.target.version=17\n\ncd $SRC/jackson-dataformats-text\n\n# Move seed corpus and dictionary.\nmv $SRC/*.dict $OUT\n\nMAVEN_ARGS=\"-P!java14+ -Dmaven.test.skip=true -Djavac.src.version=17 -Djavac.target.version=17\"\n$MVN package dependency:copy-dependencies $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\nmkdir -p $OUT/dependency\ncp \"csv/target/jackson-dataformat-csv-$CURRENT_VERSION.jar\" $OUT/jackson-dataformat-csv.jar\nfor jarfile in $(find csv/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"yaml/target/jackson-dataformat-yaml-$CURRENT_VERSION.jar\" $OUT/jackson-dataformat-yaml.jar\nfor jarfile in $(find yaml/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"properties/target/jackson-dataformat-properties-$CURRENT_VERSION.jar\" $OUT/jackson-dataformat-properties.jar\nfor jarfile in $(find properties/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"toml/target/jackson-dataformat-toml-$CURRENT_VERSION.jar\" $OUT/jackson-dataformat-toml.jar\nfor jarfile in $(find toml/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\n\nALL_JARS=\"jackson-dataformat-csv.jar jackson-dataformat-yaml.jar jackson-dataformat-properties.jar jackson-dataformat-toml.jar\"\nALL_DEPENDENCY=$(find $OUT/dependency -name *.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"$OUT/dependency/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"\\$this_dir/dependency/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jackson-dataformats-text/project.yaml",
    "content": "homepage: \"https://github.com/FasterXML/jackson-dataformats-text\"\nlanguage: jvm\nprimary_contact: \"tatu@fasterxml.com\"\nmain_repo: \"https://github.com/FasterXML/jackson-dataformats-text\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/jackson-datatype-joda/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-datatype-joda $SRC/jackson-datatype-joda\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jackson-datatype-joda\n"
  },
  {
    "path": "projects/jackson-datatype-joda/JodaDeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonFormat;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport tools.jackson.core.type.TypeReference;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.annotation.JsonDeserialize;\nimport tools.jackson.databind.exc.MismatchedInputException;\nimport tools.jackson.datatype.joda.JodaModule;\nimport tools.jackson.datatype.joda.deser.DateTimeDeserializer;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport org.joda.time.DateTime;\nimport org.joda.time.DateTimeZone;\nimport org.joda.time.Duration;\nimport org.joda.time.Instant;\nimport org.joda.time.Interval;\nimport org.joda.time.LocalDate;\nimport org.joda.time.LocalDateTime;\nimport org.joda.time.LocalTime;\nimport org.joda.time.MonthDay;\nimport org.joda.time.Period;\nimport org.joda.time.ReadableDateTime;\nimport org.joda.time.ReadableInstant;\nimport org.joda.time.ReadablePeriod;\nimport org.joda.time.YearMonth;\n\n/** This fuzzer targets the deserialization methods of joda objects */\npublic class JodaDeserializerFuzzer {\n  private static ObjectMapper mapper;\n  private static ObjectMapper plainMapper;\n  private static List<Class> choice;\n  private static List<TypeReference> typeChoice;\n\n  public static void fuzzerInitialize() {\n    // Register the JodaModule for the deserialization\n    mapper = tools.jackson.databind.json.JsonMapper.builder()\n            .addModule(new JodaModule())\n            .build();\n    plainMapper = new ObjectMapper();\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the deserialize methods for different joda objects\n      Class classReference = data.pickValue(choice);\n      TypeReference typeReference = data.pickValue(typeChoice);\n      String value = data.consumeRemainingAsString();\n      mapper.readValue(value, classReference);\n      mapper.readValue(value, typeReference);\n      plainMapper.readValue(value, AnnotationClass.class);\n    } catch (IllegalArgumentException | ArithmeticException | UnsupportedOperationException | MismatchedInputException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeClassChoice() {\n    choice = new ArrayList<Class>();\n    typeChoice = new ArrayList<TypeReference>();\n\n    choice.add(DateTime.class);\n    choice.add(DateTimeContainer.class);\n    choice.add(DateTimeZone.class);\n    choice.add(DateTimeZoneContainer.class);\n    choice.add(Duration.class);\n    choice.add(Instant.class);\n    choice.add(Interval.class);\n    choice.add(LocalDate.class);\n    choice.add(LocalDateTime.class);\n    choice.add(LocalTime.class);\n    choice.add(MonthDay.class);\n    choice.add(Period.class);\n    choice.add(ReadableDateTime.class);\n    choice.add(ReadableDateTimeContainer.class);\n    choice.add(ReadableInstant.class);\n    choice.add(ReadablePeriod.class);\n    choice.add(YearMonth.class);\n\n    typeChoice.add(new TypeReference<Map<DateTime, String>>() {});\n    typeChoice.add(new TypeReference<Map<LocalDate, String>>() {});\n    typeChoice.add(new TypeReference<Map<LocalTime, String>>() {});\n    typeChoice.add(new TypeReference<Map<LocalDateTime, String>>() {});\n  }\n\n  private static class ReadableDateTimeContainer {\n    @JsonFormat(without = JsonFormat.Feature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)\n    public ReadableDateTime readableDateTime;\n  }\n\n  private static class DateTimeContainer {\n    @JsonFormat(pattern = \"yyyy-MM-dd HH:mm:ss\")\n    public DateTime dateTime;\n\n    public DateTime getDateTime() {\n      return dateTime;\n    }\n  }\n\n  private static class DateTimeZoneContainer {\n    @JsonTypeInfo(\n        use = JsonTypeInfo.Id.CLASS,\n        include = JsonTypeInfo.As.WRAPPER_ARRAY,\n        property = \"@class\")\n    public DateTimeZone dateTimeZone;\n\n    public DateTimeZoneContainer(DateTimeZone dateTimeZone) {\n      this.dateTimeZone = dateTimeZone;\n    }\n  }\n\n  private static class AnnotationClass {\n    @JsonDeserialize(using = DateTimeDeserializer.class)\n    private DateTime dateTime;\n\n    public void setDateTime(DateTime dateTime) {\n      this.dateTime = dateTime;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatype-joda/JodaMapperFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.databind.ObjectReader;\nimport tools.jackson.databind.cfg.DateTimeFeature;\nimport tools.jackson.databind.exc.MismatchedInputException;\nimport tools.jackson.datatype.joda.JodaModule;\nimport org.joda.time.*;\n\nimport java.io.IOException;\nimport java.util.*;\n\npublic class JodaMapperFuzzer {\n    public static DateTimeFeature[] dateTimeFeatures = new DateTimeFeature[]{\n            DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS,\n            DateTimeFeature.WRITE_DURATIONS_AS_TIMESTAMPS,\n            DateTimeFeature.WRITE_DATES_WITH_ZONE_ID,\n    };\n\n    public static Class[] classes = { DummyClass.class, DateTimeZone.class, Date.class, DateTime.class, org.joda.time.Duration.class,\n            org.joda.time.Instant.class, org.joda.time.LocalDateTime.class, org.joda.time.LocalDate.class, org.joda.time.LocalTime.class, org.joda.time.Period.class, ReadablePeriod.class,\n            ReadableDateTime.class, ReadableInstant.class, Interval.class, MonthDay.class, YearMonth.class };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        JsonMapper.Builder builder = JsonMapper.builder()\n                .addModule(new JodaModule());\n        \n        boolean writeDatesAsTimestamps = data.consumeBoolean();\n        builder.configure(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS, writeDatesAsTimestamps);\n\n        List<DateTimeFeature> pickedValues = data.pickValues(dateTimeFeatures,\n                data.consumeInt(0, dateTimeFeatures.length));\n        for (DateTimeFeature feature : pickedValues) {\n            builder.enable(feature);\n        }\n        \n        JsonMapper jodaMapper = builder.build();\n        ObjectReader reader = jodaMapper.readerFor(data.pickValue(classes));\n\n        try {\n            reader.readValue(data.consumeRemainingAsString());\n        } catch (IllegalArgumentException | ArithmeticException | MismatchedInputException e) {}\n    }\n\n    public static class DummyClass {\n        public Date date;\n        public TimeZone timeZone;\n        public Calendar calendar;\n        public Locale locale;\n        public org.joda.time.Duration duration;\n        public org.joda.time.LocalDateTime localDateTime;\n        public org.joda.time.LocalDate localDate;\n        public org.joda.time.LocalTime localTime;\n        public org.joda.time.Period period;\n        public ReadablePeriod readablePeriod;\n        public ReadableDateTime readableDateTime;\n        public ReadableInstant readableInstant;\n        public Interval instant;\n        public MonthDay monthDay;\n        public YearMonth yearMonth;\n        public DateTimeZone dateTimeZone;\n    }\n}\n"
  },
  {
    "path": "projects/jackson-datatype-joda/JodaSerializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.annotation.JsonSerialize;\nimport tools.jackson.datatype.joda.JodaModule;\nimport tools.jackson.datatype.joda.ser.DateTimeSerializer;\nimport tools.jackson.databind.cfg.DateTimeFeature;\nimport tools.jackson.databind.exc.MismatchedInputException;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.joda.time.DateTime;\nimport org.joda.time.Duration;\nimport org.joda.time.Interval;\nimport org.joda.time.Period;\n\n/** This fuzzer targets the serialization methods of joda objects */\npublic class JodaSerializerFuzzer {\n  private static ObjectMapper mapper;\n  private static ObjectMapper plainMapper;\n\n  public static void fuzzerInitialize() {\n    // Register the JodaModule for the serialization\n    plainMapper = new ObjectMapper();\n    mapper = tools.jackson.databind.json.JsonMapper.builder()\n            .addModule(new JodaModule())\n            .enable(tools.jackson.databind.cfg.DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)\n            .enable(tools.jackson.databind.cfg.DateTimeFeature.WRITE_DURATIONS_AS_TIMESTAMPS)\n            .build();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the serialize methods for different joda objects\n      mapper = tools.jackson.databind.json.JsonMapper.builder()\n              .addModule(new JodaModule())\n              .configure(tools.jackson.databind.cfg.DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS, data.consumeBoolean())\n              .build();\n      DateTime dateTime = new DateTime(data.consumeLong());\n      switch (data.consumeInt(1, 11)) {\n        case 1:\n          plainMapper.writeValueAsString(new AnnotationClass(dateTime));\n          break;\n        case 2:\n          mapper.writeValueAsString(dateTime);\n          break;\n        case 3:\n          mapper\n              .writer()\n              .without(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)\n              .writeValueAsString(dateTime);\n          break;\n        case 4:\n          Map<String, Object> map = new HashMap<String, Object>();\n          map.put(data.consumeRemainingAsString(), dateTime);\n          mapper.writeValueAsString(map);\n          break;\n        case 5:\n          mapper.writeValueAsString(dateTime.toInstant());\n          break;\n        case 6:\n          mapper.writeValueAsString(new Interval(dateTime.toInstant(), dateTime.toInstant()));\n          break;\n        case 7:\n          mapper.writeValueAsString(dateTime.toLocalDate());\n          break;\n        case 8:\n          mapper.writeValueAsString(dateTime.toLocalTime());\n          break;\n        case 9:\n          mapper.writeValueAsString(dateTime.toLocalDateTime());\n          break;\n        case 10:\n          mapper.writeValueAsString(new Duration(dateTime.toInstant(), dateTime.toInstant()));\n          break;\n        case 11:\n          mapper.writeValueAsString(new Period(dateTime.getMillis()));\n          break;\n      }\n    } catch (IllegalArgumentException | ArithmeticException | MismatchedInputException e) {\n      // Known exception\n    }\n  }\n\n  private static class AnnotationClass {\n    @JsonSerialize(using = DateTimeSerializer.class)\n    private DateTime dateTime;\n\n    public AnnotationClass(DateTime dateTime) {\n      this.dateTime = dateTime;\n    }\n\n    public DateTime getDateTime() {\n      return this.dateTime;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatype-joda/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n\n./mvnw package dependency:copy-dependencies -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true\n\nmkdir -p $OUT/dependency\ncp \"$SRC/jackson-datatype-joda/target/jackson-datatype-joda-$CURRENT_VERSION.jar\" $OUT/joda.jar\nfor jarfile in $(find $SRC/jackson-datatype-joda/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\n\nALL_JARS=\"joda.jar\"\nALL_DEPENDENCY=$(find $OUT/dependency -name *.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"$OUT/dependency/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"\\$this_dir/dependency/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone \n"
  },
  {
    "path": "projects/jackson-datatype-joda/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/FasterXML/jackson-datatype-joda\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/FasterXML/jackson-datatype-joda\"\nsanitizers:\n  - address\nprimary_contact: \"tatu@fasterxml.com\"\nauto_ccs:\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-datatypes-collections $SRC/jackson-datatypes-collections\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jackson-datatypes-collections\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/EclipseCollectionsDeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.datatype.eclipsecollections.EclipseCollectionsModule;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/** This fuzzer targets the deserialization methods of eclipse collections object */\npublic class EclipseCollectionsDeserializerFuzzer {\n  private static ObjectMapper mapper;\n  private static List<Class> choice;\n\n  public static void fuzzerInitialize() {\n    // Register the EclipseCollectionsModule for the deserialization\n    mapper = JsonMapper.builder()\n        .addModule(new EclipseCollectionsModule())\n        .build();\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the deserialize methods for different eclipse collections object\n      Class type = data.pickValue(choice);\n      String value = data.consumeRemainingAsString();\n      mapper.readValue(value, type);\n    } catch (JacksonException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeClassChoice() {\n    final String[] types = {\"Boolean\", \"Byte\", \"Char\", \"Double\", \"Float\", \"Int\", \"Long\", \"Short\"};\n\n    choice = new ArrayList<Class>();\n    for (String key : types) {\n      addClass(\"org.eclipse.collections.api.bag.primitive.\" + key + \"Bag\");\n      addClass(\"org.eclipse.collections.api.collection.primitive.\" + key + \"Collection\");\n      addClass(\"org.eclipse.collections.api.list.primitive.\" + key + \"List\");\n      addClass(\"org.eclipse.collections.api.set.primitive.\" + key + \"Set\");\n      for (String value : types) {\n        addClass(\"org.eclipse.collections.api.tuple.primitive.\" + key + value + \"Pair\");\n        if (!key.equals(\"Boolean\")) {\n          addClass(\"org.eclipse.collections.api.map.primitive.Mutable\" + key + value + \"Map\");\n          addClass(\"org.eclipse.collections.api.map.primitive.Immutable\" + key + value + \"Map\");\n          addClass(\"org.eclipse.collections.api.map.primitive.\" + key + value + \"Map\");\n        }\n      }\n    }\n  }\n\n  private static void addClass(String name) {\n    try {\n      choice.add(Class.forName(name));\n    } catch (ClassNotFoundException e) {\n      // Skip missing classes\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/EclipseCollectionsSerializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.SerializationFeature;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.datatype.eclipsecollections.EclipseCollectionsModule;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.factory.primitive.BooleanLists;\nimport org.eclipse.collections.impl.factory.primitive.ByteLists;\nimport org.eclipse.collections.impl.factory.primitive.CharLists;\nimport org.eclipse.collections.impl.factory.primitive.DoubleLists;\nimport org.eclipse.collections.impl.factory.primitive.FloatLists;\nimport org.eclipse.collections.impl.factory.primitive.IntLists;\nimport org.eclipse.collections.impl.factory.primitive.IntObjectMaps;\nimport org.eclipse.collections.impl.factory.primitive.LongLists;\nimport org.eclipse.collections.impl.factory.primitive.ShortLists;\n\n/** This fuzzer targets the serialization methods of eclipse collections object */\npublic class EclipseCollectionsSerializerFuzzer {\n  private static ObjectMapper mapper;\n\n  public static void fuzzerInitialize() {\n    // Register the EclipseCollectionsModule for the serialization\n    mapper = JsonMapper.builder()\n        .addModule(new EclipseCollectionsModule())\n        .build();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the serialize methods for different eclipse collections object\n      Integer listSize = data.consumeInt(1, 10);\n      switch (data.consumeInt(1, 22)) {\n        case 1:\n          boolean[] boolArray = data.consumeBooleans(listSize);\n          mapper.writeValueAsString(BooleanLists.immutable.of(boolArray));\n          mapper.writeValueAsString(\n              new PrimitiveIterativeObject(BooleanLists.immutable.of(boolArray)));\n          break;\n        case 2:\n          byte[] byteArray = data.consumeRemainingAsBytes();\n          mapper.writeValueAsString(ByteLists.immutable.of(byteArray));\n          mapper.writeValueAsString(\n              new PrimitiveIterativeObject(ByteLists.immutable.of(byteArray)));\n          break;\n        case 3:\n          char[] charArray = data.consumeRemainingAsString().toCharArray();\n          mapper.writeValueAsString(CharLists.immutable.of(charArray));\n          mapper.writeValueAsString(\n              new PrimitiveIterativeObject(CharLists.immutable.of(charArray)));\n          break;\n        case 4:\n          double[] doubleArray = new double[listSize];\n          for (int i = 0; i < doubleArray.length; i++) {\n            doubleArray[i] = data.consumeDouble();\n          }\n          mapper.writeValueAsString(DoubleLists.immutable.of(doubleArray));\n          mapper.writeValueAsString(\n              new PrimitiveIterativeObject(DoubleLists.immutable.of(doubleArray)));\n          break;\n        case 5:\n          float[] floatArray = new float[listSize];\n          for (int i = 0; i < floatArray.length; i++) {\n            floatArray[i] = data.consumeFloat();\n          }\n          mapper.writeValueAsString(FloatLists.immutable.of(floatArray));\n          mapper.writeValueAsString(\n              new PrimitiveIterativeObject(FloatLists.immutable.of(floatArray)));\n          break;\n        case 6:\n          int[] intArray = data.consumeInts(listSize);\n          mapper.writeValueAsString(IntLists.immutable.of(intArray));\n          mapper.writeValueAsString(new PrimitiveIterativeObject(IntLists.immutable.of(intArray)));\n          break;\n        case 7:\n          long[] longArray = data.consumeLongs(listSize);\n          mapper.writeValueAsString(LongLists.immutable.of(longArray));\n          mapper.writeValueAsString(\n              new PrimitiveIterativeObject(LongLists.immutable.of(longArray)));\n          break;\n        case 8:\n          short[] shortArray = data.consumeShorts(listSize);\n          mapper.writeValueAsString(ShortLists.immutable.of(shortArray));\n          mapper.writeValueAsString(\n              new PrimitiveIterativeObject(ShortLists.immutable.of(shortArray)));\n          break;\n        case 9:\n          mapper.writeValueAsString(Sets.immutable.of(data.consumeRemainingAsString()));\n          break;\n        case 10:\n          mapper.writeValueAsString(Sets.immutable.of(data.consumeRemainingAsBytes()));\n          break;\n        case 11:\n          mapper\n              .writerFor(MutableMap.class)\n              .writeValueAsString(Maps.mutable.of(0, data.consumeRemainingAsString()));\n          break;\n        case 12:\n          mapper\n              .writerFor(MutableMap.class)\n              .writeValueAsString(Maps.mutable.of(0, data.consumeRemainingAsBytes()));\n          break;\n        case 13:\n          mapper\n              .writerFor(ImmutableMap.class)\n              .writeValueAsString(Maps.immutable.of(0, data.consumeRemainingAsString()));\n          break;\n        case 14:\n          mapper\n              .writerFor(ImmutableMap.class)\n              .writeValueAsString(Maps.immutable.of(0, data.consumeRemainingAsBytes()));\n          break;\n        case 15:\n          mapper\n              .writerFor(MapIterable.class)\n              .writeValueAsString(Maps.immutable.of(0, data.consumeRemainingAsString()));\n          break;\n        case 16:\n          mapper\n              .writerFor(MapIterable.class)\n              .writeValueAsString(Maps.immutable.of(0, data.consumeRemainingAsBytes()));\n          break;\n        case 17:\n          mapper\n              .writerFor(MutableMapIterable.class)\n              .writeValueAsString(Maps.mutable.of(0, data.consumeRemainingAsString()));\n          break;\n        case 18:\n          mapper\n              .writerFor(MutableMapIterable.class)\n              .writeValueAsString(Maps.mutable.of(0, data.consumeRemainingAsBytes()));\n          break;\n        case 19:\n          mapper.writeValueAsString(Maps.immutable.of(0, data.consumeRemainingAsString()));\n          break;\n        case 20:\n          mapper.writeValueAsString(Maps.immutable.of(0, data.consumeRemainingAsBytes()));\n          break;\n        case 21:\n          mapper.writeValueAsString(IntObjectMaps.immutable.of(0, data.consumeRemainingAsString()));\n          break;\n        case 22:\n          mapper.writeValueAsString(IntObjectMaps.immutable.of(0, data.consumeRemainingAsBytes()));\n          break;\n      }\n    } catch (JacksonException e) {\n      // Known exception\n    }\n  }\n\n  private static class PrimitiveIterativeObject {\n    @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)\n    Object object;\n\n    public PrimitiveIterativeObject(Object object) {\n      this.object = object;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/GuavaDeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.core.type.TypeReference;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.datatype.guava.GuavaModule;\nimport com.google.common.cache.Cache;\nimport com.google.common.collect.ArrayListMultimap;\nimport com.google.common.collect.HashMultimap;\nimport com.google.common.collect.HashMultiset;\nimport com.google.common.collect.ImmutableBiMap;\nimport com.google.common.collect.ImmutableList;\nimport com.google.common.collect.ImmutableMap;\nimport com.google.common.collect.ImmutableMultimap;\nimport com.google.common.collect.ImmutableMultiset;\nimport com.google.common.collect.ImmutableSet;\nimport com.google.common.collect.ImmutableSortedMap;\nimport com.google.common.collect.ImmutableSortedMultiset;\nimport com.google.common.collect.ImmutableSortedSet;\nimport com.google.common.collect.LinkedHashMultiset;\nimport com.google.common.collect.Multimap;\nimport com.google.common.collect.Multiset;\nimport com.google.common.collect.Range;\nimport com.google.common.collect.RangeSet;\nimport com.google.common.collect.SortedMultiset;\nimport com.google.common.collect.TreeMultimap;\nimport com.google.common.collect.TreeMultiset;\nimport com.google.common.hash.HashCode;\nimport com.google.common.net.HostAndPort;\nimport com.google.common.net.InternetDomainName;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/** This fuzzer targets the deserialization methods of Guava object */\npublic class GuavaDeserializerFuzzer {\n  private static ObjectMapper mapper;\n  private static List<TypeReference> choice;\n\n  public static void fuzzerInitialize() {\n    // Register the GuavaModule for the deserialization\n    GuavaModule module = new GuavaModule();\n    module.configureAbsentsAsNulls(false);\n    mapper = JsonMapper.builder()\n        .addModule(module)\n        .build();\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the deserialization methods for different Guava objects\n      TypeReference type = data.pickValue(choice);\n      String value = data.consumeRemainingAsString();\n      mapper.readValue(value, type);\n    } catch (JacksonException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeClassChoice() {\n    choice = new ArrayList<TypeReference>();\n\n    choice.add(new TypeReference<Cache<String, String>>() {});\n    choice.add(new TypeReference<ImmutableListContainer>() {});\n    choice.add(new TypeReference<ImmutableMapContainer>() {});\n    choice.add(new TypeReference<HashCode>() {});\n    choice.add(new TypeReference<HostAndPort>() {});\n    choice.add(new TypeReference<ArrayListMultimapContainer>() {});\n    choice.add(new TypeReference<Range>() {});\n    choice.add(new TypeReference<InternetDomainName>() {});\n    choice.add(new TypeReference<ImmutableSet<Integer>>() {});\n    choice.add(new TypeReference<ImmutableSet<String>>() {});\n    choice.add(new TypeReference<ImmutableList<Integer>>() {});\n    choice.add(new TypeReference<ImmutableList<String>>() {});\n    choice.add(new TypeReference<ImmutableSortedSet<Integer>>() {});\n    choice.add(new TypeReference<ImmutableSortedSet<String>>() {});\n    choice.add(new TypeReference<ImmutableMap<String, String>>() {});\n    choice.add(new TypeReference<ImmutableSortedMap<String, String>>() {});\n    choice.add(new TypeReference<ImmutableBiMap<String, String>>() {});\n    choice.add(new TypeReference<ArrayListMultimap<String, String>>() {});\n    choice.add(new TypeReference<TreeMultimap<String, String>>() {});\n    choice.add(new TypeReference<Multimap<String, String>>() {});\n    choice.add(new TypeReference<HashMultimap<String, String>>() {});\n    choice.add(new TypeReference<ImmutableMultimap<String, String>>() {});\n    choice.add(new TypeReference<Multiset<String>>() {});\n    choice.add(new TypeReference<SortedMultiset<String>>() {});\n    choice.add(new TypeReference<LinkedHashMultiset<String>>() {});\n    choice.add(new TypeReference<HashMultiset<String>>() {});\n    choice.add(new TypeReference<TreeMultiset<String>>() {});\n    choice.add(new TypeReference<ImmutableMultiset<String>>() {});\n    choice.add(new TypeReference<ImmutableSortedMultiset<String>>() {});\n    choice.add(new TypeReference<RangeSet>() {});\n  }\n\n  public static class ImmutableListContainer {\n    public ImmutableList<ImmutableList<String>> lists = ImmutableList.of();\n  }\n\n  private static class ImmutableMapContainer {\n    public ImmutableMap<String, ImmutableMap<String, String>> maps = ImmutableMap.of();\n  }\n\n  private static class ArrayListMultimapContainer {\n    @JsonTypeInfo(include = JsonTypeInfo.As.PROPERTY, use = JsonTypeInfo.Id.CLASS)\n    public Object object;\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/GuavaSerializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.SerializationFeature;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.datatype.guava.GuavaModule;\nimport com.google.common.cache.Cache;\nimport com.google.common.cache.CacheBuilder;\nimport com.google.common.collect.ArrayListMultimap;\nimport com.google.common.collect.FluentIterable;\nimport com.google.common.collect.HashMultimap;\nimport com.google.common.collect.ImmutableRangeSet;\nimport com.google.common.collect.ImmutableTable;\nimport com.google.common.collect.LinkedHashMultiset;\nimport com.google.common.collect.Multimap;\nimport com.google.common.collect.Multiset;\nimport com.google.common.collect.Range;\nimport com.google.common.collect.RangeSet;\nimport com.google.common.collect.TreeRangeSet;\nimport com.google.common.hash.HashCode;\nimport com.google.common.net.HostAndPort;\nimport com.google.common.net.InternetDomainName;\nimport com.google.common.primitives.Bytes;\nimport java.io.IOException;\n\n/** This fuzzer targets the serialization methods of Guava objects */\npublic class GuavaSerializerFuzzer {\n  private static ObjectMapper mapper;\n\n  public static void fuzzerInitialize() {\n    // Register the GuavaModule for the serialization\n    GuavaModule module = new GuavaModule();\n    module.configureAbsentsAsNulls(false);\n    mapper = JsonMapper.builder()\n        .addModule(module)\n        .build();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the serialize methods for different Guava objects\n      Integer listSize = data.consumeInt(1, 10);\n      switch (data.consumeInt(1, 12)) {\n        case 1:\n          Cache<String, String> cache = CacheBuilder.newBuilder().build();\n          cache.put(data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          // Note: ObjectMapper is immutable in Jackson 3.x, cannot dynamically enable features\n          mapper.writeValueAsString(cache);\n          break;\n        case 2:\n          byte[] bytes = data.consumeRemainingAsBytes();\n          Byte[] byteArray = new Byte[bytes.length];\n          for (int i = 0; i < bytes.length; i++) {\n            byteArray[i] = bytes[i];\n          }\n          FluentIterable fluentIterable = FluentIterable.from(byteArray);\n          mapper.writeValueAsString(fluentIterable);\n          break;\n        case 3:\n          HashCode hashCode = HashCode.fromString(data.consumeRemainingAsString());\n          mapper.writeValueAsString(hashCode);\n          break;\n        case 4:\n          HostAndPort hostAndPort =\n              HostAndPort.fromParts(\n                  data.consumeString(data.remainingBytes()), data.consumeInt(1, 65536));\n          mapper.writeValueAsString(hostAndPort);\n          break;\n        case 5:\n          Multimap<String, byte[]> multimap = HashMultimap.create();\n          multimap.put(data.consumeString(data.remainingBytes()), data.consumeRemainingAsBytes());\n          mapper\n              .writer()\n              .without(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS)\n              .writeValueAsString(multimap);\n          break;\n        case 6:\n          InternetDomainName internetDomainName =\n              InternetDomainName.from(data.consumeRemainingAsString());\n          mapper.writeValueAsString(internetDomainName);\n          break;\n        case 7:\n          ImmutableTable.Builder<Integer, String, String> immutableTableBuilder =\n              ImmutableTable.builder();\n          immutableTableBuilder.put(\n              data.consumeInt(1, 10),\n              data.consumeString(data.remainingBytes()),\n              data.consumeRemainingAsString());\n          ImmutableTable<Integer, String, String> immutableTable = immutableTableBuilder.build();\n          mapper.writeValueAsString(immutableTable);\n          break;\n        case 8:\n          Multiset<String> multiSet = LinkedHashMultiset.create();\n          multiSet.add(data.consumeRemainingAsString());\n          mapper.writeValueAsString(multiSet);\n          break;\n        case 9:\n          RangeSet<Integer> rangeSet = TreeRangeSet.create();\n          rangeSet.add(Range.closedOpen(data.consumeInt(), data.consumeInt()));\n          rangeSet.add(Range.openClosed(data.consumeInt(), data.consumeInt()));\n          rangeSet.add(Range.all());\n          mapper.writeValueAsString(rangeSet);\n          break;\n        case 10:\n          ImmutableRangeSet<Integer> immutableRangeSet =\n              ImmutableRangeSet.<Integer>builder()\n                  .add(Range.closedOpen(data.consumeInt(), data.consumeInt()))\n                  .add(Range.openClosed(data.consumeInt(), data.consumeInt()))\n                  .add(Range.all())\n                  .build();\n          mapper.writeValueAsString(immutableRangeSet);\n        case 11:\n          mapper.writeValueAsString(Bytes.asList(data.consumeRemainingAsBytes()).iterator());\n        case 12:\n          ArrayListMultimap<String, Object> arrayListMultimap = ArrayListMultimap.create();\n          arrayListMultimap.put(\n              data.consumeString(data.remainingBytes()), data.consumeRemainingAsString());\n          ArrayListMultimapContainer container = new ArrayListMultimapContainer(arrayListMultimap);\n          mapper.writeValueAsString(container);\n      }\n    } catch (JacksonException e) {\n      // Known exception\n    }\n  }\n\n  private static class ArrayListMultimapContainer {\n    @JsonTypeInfo(include = JsonTypeInfo.As.PROPERTY, use = JsonTypeInfo.Id.CLASS)\n    public Object object;\n\n    public ArrayListMultimapContainer(Object object) {\n      this.object = object;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/HppcDeserializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.carrotsearch.hppc.IntArrayDeque;\nimport com.carrotsearch.hppc.IntArrayList;\nimport com.carrotsearch.hppc.IntDeque;\nimport com.carrotsearch.hppc.IntHashSet;\nimport com.carrotsearch.hppc.IntIndexedContainer;\nimport com.carrotsearch.hppc.IntSet;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.datatype.hppc.HppcModule;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/** This fuzzer targets the deserialization methods of hppc object */\npublic class HppcDeserializerFuzzer {\n  private static ObjectMapper mapper;\n  private static List<Class> choice;\n\n  public static void fuzzerInitialize() {\n    // Register the Hppc for the deserialization\n    mapper = JsonMapper.builder()\n        .addModule(new HppcModule())\n        .build();\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the deserialize methods for different eclipse collections object\n      Class type = data.pickValue(choice);\n      String value = data.consumeRemainingAsString();\n      mapper.readValue(value, type);\n    } catch (JacksonException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeClassChoice() {\n    choice = new ArrayList<Class>();\n    choice.add(IntArrayDeque.class);\n    choice.add(IntArrayList.class);\n    choice.add(IntDeque.class);\n    choice.add(IntHashSet.class);\n    choice.add(IntIndexedContainer.class);\n    choice.add(IntSet.class);\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/HppcSerializerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.carrotsearch.hppc.BitSet;\nimport com.carrotsearch.hppc.ByteArrayList;\nimport com.carrotsearch.hppc.CharArrayList;\nimport com.carrotsearch.hppc.CharHashSet;\nimport com.carrotsearch.hppc.DoubleArrayList;\nimport com.carrotsearch.hppc.FloatArrayList;\nimport com.carrotsearch.hppc.IntArrayList;\nimport com.carrotsearch.hppc.IntHashSet;\nimport com.carrotsearch.hppc.LongArrayList;\nimport com.carrotsearch.hppc.LongHashSet;\nimport com.carrotsearch.hppc.ShortArrayList;\nimport com.carrotsearch.hppc.ShortHashSet;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.datatype.hppc.HppcModule;\n\n/** This fuzzer targets the serialization methods of Hppc objects */\npublic class HppcSerializerFuzzer {\n  private static ObjectMapper mapper;\n\n  public static void fuzzerInitialize() {\n    // Register the HppcModule for the serialization\n    mapper = JsonMapper.builder()\n        .addModule(new HppcModule())\n        .build();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the serialize methods for different Hppc objects\n      Integer listSize = data.consumeInt(1, 10);\n      switch (data.consumeInt(1, 8)) {\n        case 1:\n          byte[] byteArray = data.consumeRemainingAsBytes();\n          ByteArrayList byteArrayList = new ByteArrayList();\n          byteArrayList.add(byteArray);\n          mapper.writeValueAsString(byteArray);\n          mapper.writeValueAsString(byteArrayList);\n          break;\n        case 2:\n          char[] charArray = data.consumeRemainingAsString().toCharArray();\n          CharArrayList charArrayList = new CharArrayList();\n          CharHashSet charHashSet = new CharHashSet();\n          charArrayList.add(charArray);\n          charHashSet.addAll(charArray);\n          mapper.writeValueAsString(charArrayList);\n          mapper.writeValueAsString(charHashSet);\n          break;\n        case 3:\n          double[] doubleArray = new double[listSize];\n          for (int i = 0; i < doubleArray.length; i++) {\n            doubleArray[i] = data.consumeDouble();\n          }\n          DoubleArrayList doubleArrayList = new DoubleArrayList();\n          doubleArrayList.add(doubleArray);\n          mapper.writeValueAsString(doubleArrayList);\n          break;\n        case 4:\n          float[] floatArray = new float[listSize];\n          for (int i = 0; i < floatArray.length; i++) {\n            floatArray[i] = data.consumeFloat();\n          }\n          FloatArrayList floatArrayList = new FloatArrayList();\n          floatArrayList.add(floatArray);\n          mapper.writeValueAsString(floatArrayList);\n          break;\n        case 5:\n          int[] intArray = data.consumeInts(listSize);\n          IntArrayList intArrayList = new IntArrayList();\n          IntHashSet intHashSet = new IntHashSet();\n          intArrayList.add(intArray);\n          intHashSet.addAll(intArray);\n          mapper.writeValueAsString(intArrayList);\n          mapper.writeValueAsString(intHashSet);\n          break;\n        case 6:\n          long[] longArray = data.consumeLongs(listSize);\n          LongArrayList longArrayList = new LongArrayList();\n          LongHashSet longHashSet = new LongHashSet();\n          longArrayList.add(longArray);\n          longHashSet.addAll(longArray);\n          mapper.writeValueAsString(longArrayList);\n          mapper.writeValueAsString(longHashSet);\n          break;\n        case 7:\n          short[] shortArray = data.consumeShorts(listSize);\n          ShortArrayList shortArrayList = new ShortArrayList();\n          ShortHashSet shortHashSet = new ShortHashSet();\n          shortArrayList.add(shortArray);\n          shortHashSet.addAll(shortArray);\n          mapper.writeValueAsString(shortArrayList);\n          mapper.writeValueAsString(shortHashSet);\n          break;\n        case 8:\n          BitSet bitSet = new BitSet();\n          for (int i = 0; i < 5; i++) {\n            bitSet.set(data.consumeInt(0, (int) bitSet.capacity()));\n          }\n          mapper.writeValueAsString(bitSet);\n          break;\n      }\n    } catch (JacksonException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/PCollectionsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport tools.jackson.core.JacksonException;\nimport tools.jackson.core.type.TypeReference;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.json.JsonMapper;\nimport tools.jackson.datatype.pcollections.PCollectionsModule;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.pcollections.ConsPStack;\nimport org.pcollections.HashPMap;\nimport org.pcollections.MapPBag;\nimport org.pcollections.MapPSet;\nimport org.pcollections.OrderedPSet;\nimport org.pcollections.PBag;\nimport org.pcollections.PCollection;\nimport org.pcollections.PMap;\nimport org.pcollections.PSequence;\nimport org.pcollections.PSet;\nimport org.pcollections.PStack;\nimport org.pcollections.PVector;\nimport org.pcollections.TreePVector;\n\n/** This fuzzer targets the methods of PCollections object */\npublic class PCollectionsFuzzer {\n  private static ObjectMapper mapper;\n  private static List<TypeReference> choice;\n\n  public static void fuzzerInitialize() {\n    // Register the PCollectionsModule for fuzzing\n    mapper = JsonMapper.builder()\n        .addModule(new PCollectionsModule())\n        .build();\n    initializeClassChoice();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Fuzz the methods for different PCollections objects\n      TypeReference type = data.pickValue(choice);\n      String value = data.consumeRemainingAsString();\n      mapper.readValue(value, type);\n    } catch (JacksonException e) {\n      // Known exception\n    }\n  }\n\n  private static void initializeClassChoice() {\n    choice = new ArrayList<TypeReference>();\n\n    choice.add(new TypeReference<ConsPStack<Integer>>() {});\n    choice.add(new TypeReference<HashPMap<String, Integer>>() {});\n    choice.add(new TypeReference<MapPBag<Integer>>() {});\n    choice.add(new TypeReference<MapPSet<Integer>>() {});\n    choice.add(new TypeReference<OrderedPSet<Integer>>() {});\n    choice.add(new TypeReference<PBag<Integer>>() {});\n    choice.add(new TypeReference<PCollection<Integer>>() {});\n    choice.add(new TypeReference<PMap<String, Integer>>() {});\n    choice.add(new TypeReference<PSequence<Integer>>() {});\n    choice.add(new TypeReference<PSet<Integer>>() {});\n    choice.add(new TypeReference<PStack<Integer>>() {});\n    choice.add(new TypeReference<PVector<Integer>>() {});\n    choice.add(new TypeReference<TreePVector<Integer>>() {});\n  }\n}\n"
  },
  {
    "path": "projects/jackson-datatypes-collections/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n\n./mvnw package dependency:copy-dependencies -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true\n\nmkdir -p $OUT/dependency\ncp \"$SRC/jackson-datatypes-collections/eclipse-collections/target/jackson-datatype-eclipse-collections-$CURRENT_VERSION.jar\" $OUT/collections.jar\nfor jarfile in $(find $SRC/jackson-datatypes-collections/eclipse-collections/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"$SRC/jackson-datatypes-collections/guava/target/jackson-datatype-guava-$CURRENT_VERSION.jar\" $OUT/guava.jar\nfor jarfile in $(find $SRC/jackson-datatypes-collections/guava/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"$SRC/jackson-datatypes-collections/hppc/target/jackson-datatype-hppc-$CURRENT_VERSION.jar\" $OUT/hppc.jar\nfor jarfile in $(find $SRC/jackson-datatypes-collections/hppc/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\ncp \"$SRC/jackson-datatypes-collections/pcollections/target/jackson-datatype-pcollections-$CURRENT_VERSION.jar\" $OUT/pcollections.jar\nfor jarfile in $(find $SRC/jackson-datatypes-collections/pcollections/target/dependency/ -name *.jar ! -name junit*.jar ! -name hamcrest*.jar)\ndo\n  cp $jarfile $OUT/dependency\ndone\n\nALL_JARS=\"collections.jar guava.jar hppc.jar pcollections.jar\"\nALL_DEPENDENCY=$(find $OUT/dependency -name *.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$JAZZER_API_PATH:$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\")$(echo $ALL_DEPENDENCY | xargs printf -- \"$OUT/dependency/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):$(echo $ALL_DEPENDENCY | xargs printf -- \"\\$this_dir/dependency/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone \n"
  },
  {
    "path": "projects/jackson-datatypes-collections/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/FasterXML/jackson-datatypes-collections\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/FasterXML/jackson-datatypes-collections\"\nsanitizers:\n  - address\nprimary_contact: \"tatu@fasterxml.com\"\nauto_ccs:\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/jackson-modules-java8/DatatypeFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;\nimport com.fasterxml.jackson.datatype.jdk8.Jdk8Module;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.ObjectReader;\nimport java.io.IOException;\nimport java.util.Optional;\nimport java.util.List;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.fasterxml.jackson.annotation.JsonMerge;\nimport java.util.OptionalDouble;\nimport java.util.OptionalInt;\nimport java.util.OptionalLong;\n\npublic class DatatypeFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String content = data.consumeString(100);\n        String merge = data.consumeRemainingAsString();\n\n        ObjectMapper mapper = new ObjectMapper();\n        mapper.registerModule(new JavaTimeModule());\n        mapper.registerModule(new Jdk8Module());\n\n        try {\n            Dummy dummy1 = mapper.readValue(content, Dummy.class);\n            Dummy dummy2 = mapper.readValue(mapper.writeValueAsString(dummy1), Dummy.class);\n            if (!dummy1.equals(dummy2)) {\n                throw new FuzzerSecurityIssueLow(\"Different values \" + dummy1.debug() + \" != \" + dummy2.debug());\n            }\n            mapper.readerForUpdating(merge);\n        } catch (IOException e) {\n        }\n    }\n\n    public static class Dummy {\n        public Optional<String> value = Optional.empty();\n        public Optional<Boolean> bool = Optional.empty();;\n\n        @JsonMerge\n        public Optional<List<String>> list = Optional.empty();\n\n        public OptionalInt optint = OptionalInt.empty();\n        public OptionalLong optlong = OptionalLong.empty();\n        public OptionalDouble optdouble = OptionalDouble.empty();\n\n        public String debug() { \n            return \"%s %s %s %s %s %s\".formatted(this.value, this.bool, this.list, this.optint, this.optlong, this.optdouble);\n        } \n    }\n}\n"
  },
  {
    "path": "projects/jackson-modules-java8/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/json.dict $SRC/YamlFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/FasterXML/jackson-modules-java8\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jackson-modules-java8"
  },
  {
    "path": "projects/jackson-modules-java8/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/*.dict $OUT\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"datetime/target/jackson-datatype-jsr310-$CURRENT_VERSION.jar\" \"$OUT/jackson-datetime.jar\"\ncp \"datatypes/target/jackson-datatype-jdk8-$CURRENT_VERSION.jar\" \"$OUT/jackson-datatype.jar\"\n\nALL_JARS=\"jackson-datatype.jar jackson-datetime.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n  cp $SRC/$fuzzer_basename\\$Dummy.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_includes=com.fasterxml.jackson.datatype.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jackson-modules-java8/project.yaml",
    "content": "homepage: \"https://github.com/FasterXML/jackson-modules-java8\"\nlanguage: jvm\nmain_repo: \"https://github.com/FasterXML/jackson-modules-java8.git\"\nprimary_contact: \"tatu@fasterxml.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"fanningpj@gmail.com\"\n  - \"me@yawk.at\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jakarta-mail-api/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.6/bin/mvn\n\nRUN git clone --depth 1 https://github.com/eclipse-ee4j/mail.git jakarta-mail\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jakarta-mail\n"
  },
  {
    "path": "projects/jakarta-mail-api/HeaderTokenizerFuzzer.java",
    "content": "\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport jakarta.mail.internet.HeaderTokenizer;\nimport jakarta.mail.internet.ParseException;\n\npublic class HeaderTokenizerFuzzer{\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    HeaderTokenizer ht = new HeaderTokenizer(data.consumeRemainingAsString());\n    HeaderTokenizer.Token tok;\n    try{\n  \t  while ((tok = ht.next()).getType() != HeaderTokenizer.Token.EOF){}\n    }\n    catch(ParseException e){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jakarta-mail-api/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd api\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/jakarta.mail-api-$CURRENT_VERSION.jar\" $OUT/jakarta-mail-api.jar\n\nALL_JARS=\"jakarta-mail-api.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jakarta-mail-api/project.yaml",
    "content": "homepage: \"https://eclipse-ee4j.github.io/mail\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/eclipse-ee4j/mail.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/janet/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone https://github.com/janet-lang/janet\n\nWORKDIR $SRC/janet\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/janet/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport CFLAGS=\"$CFLAGS -fPIC\"\nmake\n\n$CC -D_XOPEN_SOURCE=600 $CFLAGS -DJANET_BOOTSTRAP -Isrc/include -Isrc/conf -std=c99 -fPIC -o fuzz_dostring.o -c ./test/fuzzers/fuzz_dostring.c\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_dostring.o build/libjanet.a -o $OUT/fuzz_dostring\n"
  },
  {
    "path": "projects/janet/project.yaml",
    "content": "homepage: \"https://github.com/janet-lang/janet\"\nprimary_contact: \"calsrose@gmail.com\"\nlanguage: c++\nauto_ccs:\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/janet-lang/janet'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/janet/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nmake test\n"
  },
  {
    "path": "projects/janino/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/janino-compiler/janino.git janino\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/janino\n"
  },
  {
    "path": "projects/janino/ExpressionEvaluatorFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.StringReader;\nimport java.io.IOException;\nimport java.lang.AssertionError;\nimport org.codehaus.commons.compiler.CompileException;\nimport org.codehaus.janino.ExpressionEvaluator;\nimport org.codehaus.janino.Scanner;\nimport org.codehaus.janino.ScriptEvaluator;\n\npublic class ExpressionEvaluatorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      ExpressionEvaluator.guessParameterNames(new Scanner(null, new StringReader(data.consumeRemainingAsString())));\n    }\n    catch(IOException | CompileException | AssertionError e){\n      return;\n    }\n    \n  }\n}\n"
  },
  {
    "path": "projects/janino/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd janino-parent\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncd $SRC/janino\ncp \"janino/target/janino-$CURRENT_VERSION.jar\" $OUT/janino.jar\n\nALL_JARS=\"janino.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/janino/project.yaml",
    "content": "homepage: \"http://janino-compiler.github.io/janino/\"\nlanguage: jvm\nmain_repo: \"https://github.com/janino-compiler/janino.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jansi/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/fusesource/jansi jansi\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/jansi\n"
  },
  {
    "path": "projects/jansi/JansiFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.EnumSet;\nimport org.fusesource.jansi.Ansi;\nimport org.fusesource.jansi.AnsiConsole;\n\npublic class JansiFuzzer {\n  public static void fuzzerInitialize() {\n    AnsiConsole.systemInstall();\n  }\n\n  public static void fuzzerTearDown() {\n    AnsiConsole.systemUninstall();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Ansi ansi = Ansi.ansi();\n      int[] choices = data.consumeInts(data.consumeInt(1, 10));\n\n      for (Integer choice : choices) {\n        switch (choice % 27) {\n          case 0:\n            ansi = ansi.fg(data.pickValue(EnumSet.allOf(Ansi.Color.class)));\n            break;\n          case 2:\n            ansi = ansi.fg(data.consumeInt());\n            break;\n          case 3:\n            ansi = ansi.fgRgb(data.consumeInt());\n            break;\n          case 4:\n            ansi = ansi.fgRgb(data.consumeInt(), data.consumeInt(), data.consumeInt());\n            break;\n          case 5:\n            ansi = ansi.fgBright(data.pickValue(EnumSet.allOf(Ansi.Color.class)));\n            break;\n          case 6:\n            ansi = ansi.bg(data.pickValue(EnumSet.allOf(Ansi.Color.class)));\n            break;\n          case 7:\n            ansi = ansi.bg(data.consumeInt());\n            break;\n          case 8:\n            ansi = ansi.bgRgb(data.consumeInt());\n            break;\n          case 9:\n            ansi = ansi.bgRgb(data.consumeInt(), data.consumeInt(), data.consumeInt());\n            break;\n          case 10:\n            ansi = ansi.bgBright(data.pickValue(EnumSet.allOf(Ansi.Color.class)));\n            break;\n          case 11:\n            ansi = ansi.a(data.pickValue(EnumSet.allOf(Ansi.Attribute.class)));\n            break;\n          case 12:\n            ansi = ansi.cursor(data.consumeInt(), data.consumeInt());\n            break;\n          case 13:\n            ansi = ansi.cursorToColumn(data.consumeInt());\n            break;\n          case 14:\n            ansi = ansi.cursorUp(data.consumeInt());\n            break;\n          case 15:\n            ansi = ansi.cursorDown(data.consumeInt());\n            break;\n          case 16:\n            ansi = ansi.cursorRight(data.consumeInt());\n            break;\n          case 17:\n            ansi = ansi.cursorLeft(data.consumeInt());\n            break;\n          case 18:\n            ansi = ansi.cursorMove(data.consumeInt(), data.consumeInt());\n            break;\n          case 19:\n            ansi = ansi.cursorUpLine(data.consumeInt());\n            break;\n          case 20:\n            ansi = ansi.cursorDownLine(data.consumeInt());\n            break;\n          case 21:\n            ansi = ansi.eraseScreen(data.pickValue(EnumSet.allOf(Ansi.Erase.class)));\n            break;\n          case 22:\n            ansi = ansi.eraseLine(data.pickValue(EnumSet.allOf(Ansi.Erase.class)));\n            break;\n          case 23:\n            ansi = ansi.scrollUp(data.consumeInt());\n            break;\n          case 24:\n            ansi = ansi.scrollDown(data.consumeInt());\n            break;\n          case 25:\n            ansi = ansi.a(data.consumeRemainingAsString());\n            break;\n          case 26:\n            ansi = ansi.render(data.consumeRemainingAsString());\n            break;\n        }\n      }\n    } catch (IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jansi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/jansi-$CURRENT_VERSION.jar\" $OUT/jansi.jar\n\nALL_JARS=\"jansi.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jansi/project.yaml",
    "content": "homepage: https://github.com/fusesource/jansi\nmain_repo: https://github.com/fusesource/jansi\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/jansson/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/akheron/jansson.git /src/jansson\n\nWORKDIR $SRC/jansson\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/jansson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# --default-symver does not work with lto, which fuzz introspector uses.\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n  sed -i 's/--default-symver/-flto/g' ./configure.ac\nfi\n# Run the OSS-Fuzz script in the project.\n./test/ossfuzz/ossfuzz.sh\n"
  },
  {
    "path": "projects/jansson/project.yaml",
    "content": "homepage: \"https://github.com/akheron/jansson\"\nlanguage: c++\nprimary_contact: \"git@cfware.com\"\nauto_ccs:\n  - \"cmeister2@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/akheron/jansson.git'\n"
  },
  {
    "path": "projects/jansson/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check\n"
  },
  {
    "path": "projects/janus-gateway/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n\tautoconf autoconf-archive \\\n\tautomake \\\n\tgengetopt \\\n\tgtk-doc-tools \\\n\tlibconfig-dev \\\n\tlibglib2.0-dev \\\n\tlibgnutls28-dev \\\n\tlibini-config-dev \\\n\tlibjansson-dev \\\n\tlibnice-dev \\\n\tlibssl-dev \\\n\tlibtool \\\n\topenssl \\\n\tpkg-config\n\n# install libsrtp dep from source\nRUN git clone --single-branch --branch 2_2_x_throttle https://github.com/cisco/libsrtp.git libsrtp\nRUN cd libsrtp && ./configure --enable-openssl && make -j$(nproc) shared_library && make install\n\n# fetch Janus code\nRUN git clone --single-branch --branch master https://github.com/meetecho/janus-gateway.git janus-gateway\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/janus-gateway/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFUZZ_ENV=oss-fuzz $SRC/janus-gateway/fuzzers/build.sh\n"
  },
  {
    "path": "projects/janus-gateway/project.yaml",
    "content": "homepage: \"https://github.com/meetecho/janus-gateway\"\nlanguage: c++\nprimary_contact: \"lminiero@gmail.com\"\nauto_ccs:\n  - \"lorenzo@meetecho.com\"\n  - \"alex@meetecho.com\"\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\ncoverage_extra_args: -ignore-filename-regex=.*glib.* -ignore-filename-regex=.*log.c\nmain_repo: 'https://github.com/meetecho/janus-gateway.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/java-diff-utils/DiffUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.github.difflib.DiffUtils;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [com.github.difflib.DiffUtils] public static com.github.difflib.patch.Patch diffInline(java.lang.String,java.lang.String)\npublic class DiffUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      DiffUtils.diffInline(data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n    } catch (IllegalStateException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/java-diff-utils/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/java-diff-utils/java-diff-utils java-diff-utils\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/java-diff-utils\n"
  },
  {
    "path": "projects/java-diff-utils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./java-diff-utils/target/java-diff-utils-$CURRENT_VERSION.jar\" $OUT/java-diff-utils.jar\n\nALL_JARS='java-diff-utils.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/java-diff-utils/project.yaml",
    "content": "homepage: https://github.com/java-diff-utils/java-diff-utils.git\nmain_repo: https://github.com/java-diff-utils/java-diff-utils.git\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/java-example/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nCOPY build.sh $SRC/\n\nCOPY ExampleFuzzerNative.h ExampleFuzzerNative.cpp $SRC/\nCOPY ExampleFuzzer.java ExampleValueProfileFuzzer.java ExampleFuzzerNative.java default.options $SRC/\nCOPY ExampleFuzzTest.java MutatorFuzzTest.java $SRC/\n\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/java-example/ExampleFuzzTest.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\npublic class ExampleFuzzTest {\n  @FuzzTest\n  void exampleTest (FuzzedDataProvider data) {\n    String input = data.consumeRemainingAsString();\n    long random = 123123132;\n    if (input.startsWith(\"magicstring\" + random) && input.length() > 30\n        && input.charAt(25) == 'C') {\n      throw new IllegalStateException(\"Not reached\");\n    }\n  }\n}\n"
  },
  {
    "path": "projects/java-example/ExampleFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.security.SecureRandom;\n\npublic class ExampleFuzzer {\n  public static void fuzzerInitialize() {\n    // Optional initialization to be run before the first call to fuzzerTestOneInput.\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    String input = data.consumeRemainingAsString();\n    long random = 123123132;\n    if (input.startsWith(\"magicstring\" + random) && input.length() > 30\n        && input.charAt(25) == 'C') {\n      throw new IllegalStateException(\"Not reached\");\n    }\n  }\n}\n"
  },
  {
    "path": "projects/java-example/ExampleFuzzerNative.cpp",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"ExampleFuzzerNative.h\"\n\n#include <limits>\n#include <string>\n\n// simple function containing a crash that requires coverage and string compare\n// instrumentation for the fuzzer to find\n__attribute__((optnone)) void parseInternal(const std::string &input) {\n  constexpr int bar = std::numeric_limits<int>::max() - 5;\n  // Crashes with UBSan.\n  if (bar + input[0] == 300) {\n    return;\n  }\n  if (input[0] == 'a' && input[1] == 'b' && input[5] == 'c') {\n    if (input.find(\"secret_in_native_library\") != std::string::npos) {\n      // Crashes with ASan.\n      [[maybe_unused]] char foo = input[input.size() + 2];\n    }\n  }\n}\n\nJNIEXPORT jboolean JNICALL Java_ExampleFuzzerNative_parse(\n    JNIEnv *env, jobject o, jstring bytes) {\n  const char *input(env->GetStringUTFChars(bytes, nullptr));\n  parseInternal(input);\n  env->ReleaseStringUTFChars(bytes, input);\n  return false;\n}\n"
  },
  {
    "path": "projects/java-example/ExampleFuzzerNative.h",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n/* Header for class ExampleFuzzerNative */\n\n#ifndef _Included_ExampleFuzzerNative\n#define _Included_ExampleFuzzerNative\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * Class:     ExampleFuzzerNative\n * Method:    parse\n * Signature: (Ljava/lang/String;)Z\n */\nJNIEXPORT jboolean JNICALL\nJava_ExampleFuzzerNative_parse(JNIEnv *, jobject, jstring);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "projects/java-example/ExampleFuzzerNative.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic class ExampleFuzzerNative {\n  static {\n    System.loadLibrary(\"native\");\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    int val = data.consumeInt();\n    String stringData = data.consumeRemainingAsString();\n    if (val == 17759716 && stringData.length() > 10 && stringData.contains(\"jazzer\")) {\n      // call native function which contains a crash\n      parse(stringData);\n    }\n  }\n\n  private static native boolean parse(String bytes);\n}\n"
  },
  {
    "path": "projects/java-example/ExampleValueProfileFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.Base64;\n\npublic class ExampleValueProfileFuzzer {\n  private static String base64(byte[] input) {\n    return Base64.getEncoder().encodeToString(input);\n  }\n\n  private static long insecureEncrypt(long input) {\n    long key = 0xefe4eb93215cb6b0L;\n    return input ^ key;\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    // Without -use_value_profile=1, the fuzzer gets stuck here as there is no direct correspondence\n    // between the input bytes and the compared string. With value profile, the fuzzer can guess the\n    // expected input byte by byte, which takes linear rather than exponential time.\n    if (base64(data.consumeBytes(6)).equals(\"SmF6emVy\")) {\n      long[] plaintextBlocks = data.consumeLongs(2);\n      if (plaintextBlocks.length != 2)\n        return;\n      if (insecureEncrypt(plaintextBlocks[0]) == 0x9fc48ee64d3dc090L) {\n        // Without --fake_pcs (enabled by default with -use_value_profile=1), the fuzzer would get\n        // stuck here as the value profile information for long comparisons would not be able to\n        // distinguish between this comparison and the one above.\n        if (insecureEncrypt(plaintextBlocks[1]) == 0x888a82ff483ad9c2L) {\n          mustNeverBeCalled();\n        }\n      }\n    }\n  }\n\n  private static void mustNeverBeCalled() {\n    throw new IllegalStateException(\"mustNeverBeCalled has been called\");\n  }\n}\n"
  },
  {
    "path": "projects/java-example/MutatorFuzzTest.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.driver.FuzzTargetRunner;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport com.code_intelligence.jazzer.mutation.annotation.NotNull;\nimport java.util.List;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\n\nclass MutatorFuzzTest {\n  @FuzzTest\n  void mutatorFuzz(List<@NotNull String> list) {\n    // Check that the mutator is actually doing something.\n    if (list != null && list.size() > 3 && list.get(2).equals(\"mutator\")) {\n      throw new AssertionError(\"Found expected JUnit mutator test issue\");\n    }\n  }\n\n  @BeforeAll\n  static void beforeAll() {\n    System.err.println(\"Starting MutatorFuzzTest\");\n  }\n\n  @AfterAll\n  static void afterAll() {\n    System.err.println(\"Finished MutatorFuzzTest\");\n  }\n}\n"
  },
  {
    "path": "projects/java-example/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build native library.\nJVM_INCLUDES=\"-I$JAVA_HOME/include -I$JAVA_HOME/include/linux\"\nmkdir -p \"$OUT\"/native\n$CXX $CXXFLAGS $JVM_INCLUDES -fPIC -shared \\\n    ExampleFuzzerNative.cpp -o $OUT/native/libnative.so\n\nmkdir -p \"$OUT\"/libs\ncurl -o \"$OUT\"/libs/junit-jupiter-api-5.9.0.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.9.0/junit-jupiter-api-5.9.0.jar\ncurl -o \"$OUT\"/libs/junit-jupiter-engine-5.9.0.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.9.0/junit-jupiter-engine-5.9.0.jar\ncurl -o \"$OUT\"/libs/junit-jupiter-params-5.9.0.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-params/5.9.0/junit-jupiter-params-5.9.0.jar\ncurl -o \"$OUT\"/libs/junit-platform-commons-1.9.0.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/1.9.0/junit-platform-commons-1.9.0.jar\ncurl -o \"$OUT\"/libs/junit-platform-engine-1.9.0.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/1.9.0/junit-platform-engine-1.9.0.jar\ncurl -o \"$OUT\"/libs/junit-platform-launcher-1.9.0.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/1.9.0/junit-platform-launcher-1.9.0.jar\ncurl -o \"$OUT\"/libs/opentest4j-1.2.0.jar https://repo1.maven.org/maven2/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar\n\nBUILD_CLASSPATH=\"$JAZZER_API_PATH:$JAZZER_JUNIT_PATH:$OUT/libs/junit-jupiter-api-5.9.0.jar\"\n\n# All class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -or -name '*FuzzerNative.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  if [[ $fuzzer_basename == *FuzzerNative ]]; then\n    driver=jazzer_driver_with_sanitizer\n  else\n    driver=jazzer_driver\n  fi\n\n  cp default.options $OUT/\"$fuzzer_basename\".options\n  # Create execution wrapper.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir/native \\\nASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$this_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$this_dir/$driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n\nfor fuzzer in $(find $SRC -name '*FuzzTest.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp \"$BUILD_CLASSPATH:/usr/local/bin/jazzer_agent_deploy.jar\" $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create execution wrapper.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\n\njava -cp \\$this_dir:\\$this_dir/jazzer_agent_deploy.jar:\\$this_dir/jazzer_junit.jar:\\$this_dir/libs/* \\\ncom.code_intelligence.jazzer.Jazzer \\\n--target_class=$fuzzer_basename \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/java-example/default.options",
    "content": "[asan]\nhandle_segv=1\nallow_user_segv_handler=1\n\n[ubsan]\nhandle_segv=1\n"
  },
  {
    "path": "projects/java-example/project.yaml",
    "content": "base_os_version: ubuntu-24-04\ndisabled: true\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/CodeIntelligenceTesting/jazzer\nlanguage: jvm\nmain_repo: https://github.com/CodeIntelligenceTesting/jazzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- norbert.schneider@code-intelligence.com\n"
  },
  {
    "path": "projects/java-jwt/.gitignore",
    "content": "project-parent/java-jwt\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/java-jwt/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nENV JAVA_HOME=$JAVA_15_HOME\nENV JVM_LD_LIBRARY_PATH=$JAVA_HOME/lib/server\nENV PATH=$JAVA_HOME/bin:$PATH\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN=$SRC/maven/apache-maven-3.9.11/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/java-jwt\nRUN git clone --depth 1 https://github.com/auth0/java-jwt/ $SRC/project-parent/java-jwt\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/java-jwt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=java-jwt\nPROJECT_GROUP_ID=com.auth0\nPROJECT_ARTIFACT_ID=java-jwt\nMAIN_REPOSITORY=https://github.com/auth0/java-jwt/\nGRADLE_ARGS=\"-x javadoc -x test -x sign -PisSnapshot=false\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && ./gradlew build publishToMavenLocal exportVersion)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  # set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && ./gradlew build publishToMavenLocal $GRADLE_ARGS)\n  export JAVA_JWT_VERSION=$(cat $PROJECT/.version | head -1 | tr -d '[:space:]')\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi\n"
  },
  {
    "path": "projects/java-jwt/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>15</java.version>\n        <maven.compiler.source>15</maven.compiler.source>\n        <maven.compiler.target>15</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.auth0</groupId>\n            <artifactId>java-jwt</artifactId>\n            <version>${env.JAVA_JWT_VERSION}</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/java-jwt/project-parent/fuzz-targets/src/test/java/com/example/JWTFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport com.auth0.jwt.exceptions.AlgorithmMismatchException;\nimport com.auth0.jwt.exceptions.JWTDecodeException;\nimport com.auth0.jwt.interfaces.DecodedJWT;\n\nclass JWTFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        String secret = data.consumeString(500);\n        Algorithm [] algorithms = {Algorithm.HMAC256(secret), Algorithm.HMAC384(secret), Algorithm.HMAC512(secret)};\n\n        try {\n            String token = data.consumeRemainingAsString();\n            DecodedJWT decodedJWT = JWT.decode(token);\n            DecodedJWT jwt = JWT.require(data.pickValue(algorithms))\n                    .build()\n                    .verify(decodedJWT);\n        } catch (JWTDecodeException | AlgorithmMismatchException | NullPointerException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/java-jwt/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <!-- <module>java-jwt</module> -->\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/java-jwt/project.yaml",
    "content": "homepage: \"https://github.com/auth0/java-jwt/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/auth0/java-jwt/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/java-uuid-generator/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/cowtowncoder/java-uuid-generator java-uuid-generator\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/java-uuid-generator\n"
  },
  {
    "path": "projects/java-uuid-generator/GeneratorsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.uuid.EthernetAddress;\nimport com.fasterxml.uuid.Generators;\nimport com.fasterxml.uuid.impl.UUIDUtil;\nimport java.util.Random;\nimport java.util.UUID;\n\npublic class GeneratorsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      UUID uuid = null;\n      EthernetAddress addr = null;\n\n      Integer choice = data.consumeInt(1, 7);\n\n      switch (choice) {\n        case 1:\n          Generators.randomBasedGenerator(new Random(data.consumeLong())).generate();\n          break;\n        case 2:\n          Generators.timeBasedEpochGenerator(new Random(data.consumeLong())).generate();\n          break;\n        case 3:\n          Generators.nameBasedGenerator().generate(data.consumeRemainingAsString());\n          break;\n        case 4:\n          uuid = UUIDUtil.uuid(data.consumeString(data.remainingBytes() / 2));\n          Generators.nameBasedGenerator(uuid).generate(data.consumeRemainingAsString());\n          break;\n        case 5:\n          uuid = UUIDUtil.uuid(data.consumeString(data.remainingBytes() / 2));\n          Generators.nameBasedGenerator(uuid, null).generate(data.consumeRemainingAsString());\n          break;\n        case 6:\n          addr = new EthernetAddress(data.consumeRemainingAsString());\n          Generators.timeBasedGenerator(addr).generate();\n          break;\n        case 7:\n          addr = new EthernetAddress(data.consumeRemainingAsString());\n          Generators.timeBasedReorderedGenerator(addr).generate();\n          break;\n      }\n    } catch (NumberFormatException e1) {\n      // Known exceptions\n    }\n  }\n}\n"
  },
  {
    "path": "projects/java-uuid-generator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nfind ./ -name pom.xml -exec sed -i 's/source>1.6</source>1.8</g' {} \\;\nfind ./ -name pom.xml -exec sed -i 's/target>1.6</target>1.8</g' {} \\;\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/java-uuid-generator-$CURRENT_VERSION.jar\" $OUT/java-uuid-generator.jar\n\nALL_JARS=\"java-uuid-generator.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/java-uuid-generator/project.yaml",
    "content": "homepage: https://github.com/cowtowncoder/java-uuid-generator\nmain_repo: https://github.com/cowtowncoder/java-uuid-generator\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/java-xmlbuilder/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/google/AFL afl\nRUN git clone --depth 1 https://github.com/jmurty/java-xmlbuilder java-xmlbuilder\nCOPY build.sh *.java $SRC/\nWORKDIR $SRC/java-xmlbuilder\n"
  },
  {
    "path": "projects/java-xmlbuilder/XmlBuilderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.jamesmurty.utils.XMLBuilder;\nimport javax.xml.parsers.ParserConfigurationException;\nimport javax.xml.xpath.XPathExpressionException;\nimport org.w3c.dom.DOMException;\n\npublic class XmlBuilderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 10));\n      XMLBuilder builder = XMLBuilder.create(data.consumeString(data.remainingBytes() / 2));\n\n      for (Integer choice : choices) {\n        switch (choice % 13) {\n          case 0:\n            builder = builder.stripWhitespaceOnlyTextNodes();\n            break;\n          case 1:\n            builder = builder.up(data.consumeInt());\n            break;\n          case 2:\n            builder = builder.elem(data.consumeRemainingAsString());\n            break;\n          case 3:\n            builder = builder.elementBefore(data.consumeRemainingAsString());\n            break;\n          case 4:\n            builder = builder.attr(\n                data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n            break;\n          case 5:\n            builder = builder.text(data.consumeRemainingAsString());\n            break;\n          case 6:\n            builder = builder.data(data.consumeRemainingAsString());\n            break;\n          case 7:\n            builder = builder.data(data.consumeRemainingAsBytes());\n            break;\n          case 8:\n            builder = builder.cmnt(data.consumeRemainingAsString());\n            break;\n          case 9:\n            builder = builder.inst(\n                data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n            break;\n          case 10:\n            builder = builder.insertInstruction(\n                data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n            break;\n          case 11:\n            builder = builder.ref(data.consumeRemainingAsString());\n            break;\n          case 12:\n            builder = builder.ns(data.consumeRemainingAsString());\n            break;\n        }\n      }\n    } catch (ParserConfigurationException | XPathExpressionException | DOMException\n        | IllegalStateException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/java-xmlbuilder/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/java-xmlbuilder-$CURRENT_VERSION.jar\" $OUT/java-xmlbuilder.jar\n\nALL_JARS=\"java-xmlbuilder.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n\ncp $SRC/afl/dictionaries/xml.dict $OUT/XmlBuilderFuzzer.dict\n"
  },
  {
    "path": "projects/java-xmlbuilder/project.yaml",
    "content": "homepage: https://github.com/jmurty/java-xmlbuilder\nmain_repo: https://github.com/jmurty/java-xmlbuilder\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/javacpp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/bytedeco/javacpp javacpp\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/javacpp\n"
  },
  {
    "path": "projects/javacpp/JavacppFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.bytedeco.javacpp.tools.Info;\nimport org.bytedeco.javacpp.tools.InfoMap;\n\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.bytedeco.javacpp.tools.InfoMap] public org.bytedeco.javacpp.tools.Info getFirst(java.lang.String,boolean)\n// Target method: [org.bytedeco.javacpp.tools.InfoMap] public org.bytedeco.javacpp.tools.Info get(int,java.lang.String,boolean)\npublic class JavacppFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    InfoMap obj = new InfoMap();\n    Boolean bool = data.consumeBoolean();\n\n    if (data.consumeBoolean()) {\n      obj.getFirst(data.consumeRemainingAsString(), bool);\n    } else {\n      obj.get(data.consumeInt(), data.consumeRemainingAsString(), bool);\n    }\n  }\n}\n"
  },
  {
    "path": "projects/javacpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\ncp \"./target/javacpp.jar\" $OUT/javacpp.jar\n\nALL_JARS=\"javacpp.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/javacpp/project.yaml",
    "content": "homepage: https://github.com/bytedeco/javacpp\nmain_repo: https://github.com/bytedeco/javacpp\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/javaparser/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y maven\n\nRUN git clone --depth 1 https://github.com/javaparser/javaparser\nCOPY build.sh $SRC/\n\nCOPY *.java $SRC/\n\nWORKDIR $SRC/javaparser\n"
  },
  {
    "path": "projects/javaparser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the jar.\nCURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\nmvn package -Dmaven.test.skip=true\ncp \"javaparser-core/target/javaparser-core-$CURRENT_VERSION.jar\" $OUT/javaparser.jar\n\n# The jar files containing the project (separated by spaces).\nPROJECT_JARS=javaparser.jar\n\n# Build fuzzers in $OUT.\nBUILD_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All jars and class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create execution wrapper.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/javaparser/parseFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport static com.github.javaparser.ParseStart.COMPILATION_UNIT;\nimport com.github.javaparser.JavaParser;\nimport com.github.javaparser.ParseResult;\nimport com.github.javaparser.ast.CompilationUnit;\nimport com.github.javaparser.ParserConfiguration;\nimport static com.github.javaparser.Providers.provider;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic class parseFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    String datastring = data.consumeRemainingAsString();\n    InputStream datastream = new ByteArrayInputStream(datastring.getBytes());\n    try {\n        ParserConfiguration configuration = new ParserConfiguration();\n        final ParseResult<CompilationUnit> result = new JavaParser(configuration)\n        .parse(COMPILATION_UNIT, provider(datastream, configuration.getCharacterEncoding()));\n    } catch (Exception e) {\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/javaparser/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://javaparser.org\"\nlanguage: jvm\nprimary_contact: \"MysterAitch@users.noreply.github.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n  - \"jean-pierre.lerbscher@jperf.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/javaparser/javaparser\"\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/javapoet/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-8-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/square/javapoet.git javapoet\nWORKDIR javapoet\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/javapoet/TypeSpecFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.squareup.javapoet.*;\nimport javax.lang.model.element.Modifier;\n\npublic class TypeSpecFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        TypeSpec taco = TypeSpec.classBuilder(data.consumeString(10))\n            .addMethod(MethodSpec.methodBuilder(data.consumeString(20))\n                .addAnnotation(Override.class)\n                .addModifiers(Modifier.PUBLIC, Modifier.FINAL)\n                .returns(String.class)\n                .addCode(data.consumeRemainingAsString())\n                .build())\n            .build();\n        taco.hashCode();\n    }\n    // expected exceptions\n    catch (java.lang.IllegalArgumentException e) {}\n    catch (java.lang.IllegalStateException e) {}\n  }\n}"
  },
  {
    "path": "projects/javapoet/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-8\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-8-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./ -name \"javapoet-$CURRENT_VERSION.jar\" -exec mv {} $OUT/javapoet.jar \\;\n\nALL_JARS=\"javapoet.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-8/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-8/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/javapoet/project.yaml",
    "content": "homepage: \"https://github.com/square/javapoet\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/square/javapoet.git\"\nauto_ccs:\n  - \"himkhurana@google.com\"\n  - \"atulag@google.com\"\n  - \"rashmivirdy@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/javascript-example/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\n# For real projects, you would clone your repo in the next step.\nRUN mkdir -p $SRC/example\n\n# Ideally, you have already configured fuzz tests in your repo so that they\n# run (in Jazzer.js regression mode) as part of unit testing. Keeping the fuzz\n# tests in sync with the source code ensures that they are adjusted continue\n# to work after code changes. Here, we copy them into the example project directory.\nCOPY fuzz_string_compare.js fuzz_promise.js fuzz_value_profiling.js package.json $SRC/example/\n\nWORKDIR $SRC/example\n"
  },
  {
    "path": "projects/javascript-example/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\n\n# Install Jazzer.js\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer example fuzz_promise.js\ncompile_javascript_fuzzer example fuzz_string_compare.js --sync\ncompile_javascript_fuzzer example fuzz_value_profiling.js --sync\n"
  },
  {
    "path": "projects/javascript-example/fuzz_promise.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nlet lastInvocationCount = 0;\nlet invocationCount = lastInvocationCount + 1;\n\n/**\n * @param { Buffer } data\n */\nmodule.exports.fuzz = function (data) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (data.length < 3) {\n\t\t\tresolve(invocationCount++);\n\t\t\treturn;\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tlet one = data.readInt8(0);\n\t\t\tlet two = data.readInt8(1);\n\t\t\tlet three = data.readInt8(2);\n\t\t\tif (one + two + three === 42) {\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`${one} + ${two} + ${three} = 42 (invocation ${invocationCount})`\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tresolve(invocationCount++);\n\t\t\t}\n\t\t}, 10);\n\t}).then((value) => {\n\t\tif (value !== lastInvocationCount + 1) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid invocation order, received ${value} but last invocation was ${lastInvocationCount}.`\n\t\t\t);\n\t\t}\n\t\tlastInvocationCount = value;\n\t});\n};\n"
  },
  {
    "path": "projects/javascript-example/fuzz_string_compare.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * @param { Buffer } data\n */\nmodule.exports.fuzz = function (data) {\n\tconst s = data.toString();\n\tif (s.length !== 16) {\n\t\treturn;\n\t}\n\tif (\n\t\ts.slice(0, 8) === \"Awesome \" &&\n\t\ts.slice(8, 15) === \"Fuzzing\" &&\n\t\ts[15] === \"!\"\n\t) {\n\t\tthrow Error(\"Welcome to Awesome Fuzzing!\");\n\t}\n};\n"
  },
  {
    "path": "projects/javascript-example/fuzz_value_profiling.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * @param {number} n\n */\nfunction encrypt(n) {\n\treturn n ^ 0x11223344;\n}\n\n/**\n * @param { Buffer } data\n */\nmodule.exports.fuzz = function (data) {\n\tif (data.length < 16) {\n\t\treturn;\n\t}\n\tif (\n\t\tencrypt(data.readInt32BE(0)) === 0x50555637 &&\n\t\tencrypt(data.readInt32BE(4)) === 0x7e4f5664 &&\n\t\tencrypt(data.readInt32BE(8)) === 0x5757493e &&\n\t\tencrypt(data.readInt32BE(12)) === 0x784c5465\n\t) {\n\t\tthrow Error(\"XOR with a constant is not a secure encryption method ;-)\");\n\t}\n};\n"
  },
  {
    "path": "projects/javascript-example/package.json",
    "content": "{\n\t\"name\": \"jazzerjs-examples\",\n\t\"version\": \"1.0.0\",\n\t\"description\": \"Examples of fuzz tests for Jazzer.js\"\n}\n"
  },
  {
    "path": "projects/javascript-example/project.yaml",
    "content": "homepage: https://github.com/CodeIntelligenceTesting/jazzer.js\nlanguage: javascript\nmain_repo: https://github.com/CodeIntelligenceTesting/jazzer.js\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n- yakdan@code-intelligence.com\n- norbert.schneider@code-intelligence.com\n- peter.samarin@code-intelligence.com\n"
  },
  {
    "path": "projects/javassist/ClassFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.lang.RuntimeException;\n\nimport javassist.ClassPool;\nimport javassist.CtClass;\nimport javassist.CannotCompileException;\nimport javassist.NotFoundException;\nimport java.lang.NullPointerException;\n\n\npublic class ClassFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ClassPool pool = ClassPool.getDefault();\n        CtClass cc = null;\n        \n        try {\n            cc = pool.makeClass(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n        } catch (IOException | RuntimeException e) {\n        }\n\n        try {\n            cc.getSuperclass();\n            cc.getNestedClasses();\n            cc.getClassFile();\n            cc.getInterfaces();\n            cc.getDeclaringClass();\n            cc.getComponentType();\n        } catch (NotFoundException | NullPointerException e) {\n        }\n\n        try {\n            cc.toBytecode();\n        } catch (IOException | NullPointerException | CannotCompileException e) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/javassist/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone --depth 1 https://github.com/jboss-javassist/javassist.git\n\nCOPY build.sh $SRC/\nCOPY ClassFuzzer.java $SRC/\nCOPY pom.xml.diff $SRC/javassist\nWORKDIR $SRC/javassist\n"
  },
  {
    "path": "projects/javassist/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit apply pom.xml.diff\nmv ./src/main ./src/java\nmkdir ./src/main\nmv ./src/java ./src/main/java\nmv ./src/test ./src/java\nmkdir ./src/test\nmv ./src/java ./src/test/java\n\n$MVN clean package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade -DskipTests\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/javassist-$CURRENT_VERSION.jar\" $OUT/javassist.jar\n\nALL_JARS=\"javassist.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/javassist/pom.xml.diff",
    "content": "diff --git a/pom.xml b/pom.xml\nindex d13fee2..4157d4f 100644\n--- a/pom.xml\n+++ b/pom.xml\n@@ -155,11 +155,11 @@\n   </dependencies>\n \n   <build>\n-    <sourceDirectory>src/main/</sourceDirectory>\n-    <testSourceDirectory>src/test/</testSourceDirectory>\n+    <sourceDirectory>src/main/java</sourceDirectory>\n+    <testSourceDirectory>src/test/java</testSourceDirectory>\n     <testResources>\n       <testResource>\n-        <directory>src/test/resources</directory>\n+        <directory>src/test/java/resources</directory>\n       </testResource>\n     </testResources>\n     <plugins>\n@@ -200,7 +200,7 @@\n               <mainClass>javassist.CtClass</mainClass>\n               <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>\n             </manifest>\n-            <manifestFile>src/main/META-INF/MANIFEST.MF</manifestFile>\n+            <manifestFile>src/main/java/META-INF/MANIFEST.MF</manifestFile>\n           </archive>\n         </configuration>\n       </plugin>\n"
  },
  {
    "path": "projects/javassist/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: http://www.javassist.org/\nlanguage: jvm\nmain_repo: https://github.com/jboss-javassist/javassist\nsanitizers:\n- address\nvendor_ccs:\n- yakdan@code-intelligence.com\n"
  },
  {
    "path": "projects/javy/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update \\\n  && apt-get install -y curl pkg-config libssl-dev clang \\\n  && rustup target add wasm32-wasip1 \\\n  && git clone https://github.com/bytecodealliance/javy\nWORKDIR javy\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/javy/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Using `--sanitizer none` because other sanitizers seem to cause out of memory errors\n# Setting `-fno-sanitize=all` since I see undefined references to `__sancov_gen_` if I don't\nCFLAGS=\"$CFLAGS -fno-sanitize=all\" RUSTFLAGS=\"-C link-arg=-fno-sanitize=all\" cargo fuzz build --sanitizer none\ncp target/x86_64-unknown-linux-gnu/release/json-differential $OUT/json-differential\n"
  },
  {
    "path": "projects/javy/project.yaml",
    "content": "homepage: \"https://github.com/bytecodealliance/javy\"\nlanguage: rust\nmain_repo: \"https://github.com/bytecodealliance/javy.git\"\nprimary_contact: \"saule.cabrera@gmail.com\"\nauto_ccs:\n  - \"jeff.charles@shopify.com\"\nsanitizers:\n  - none\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/jaxb/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/eclipse-ee4j/jaxb-ri.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/jaxb-ri"
  },
  {
    "path": "projects/jaxb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-Dmaven.compiler.source=15 -Dmaven.compiler.target=15 -DskipTests\"\nALL_JARS=\"\"\n\n# install the build servers' jazzer-api into the maven repository\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/jaxb-ri/jaxb-ri\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -DjaxbVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/jaxb-fuzzer-${CURRENT_VERSION}.jar ${OUT}/jaxb-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} jaxb-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n  stripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n  # the .java was stripped by sed\n  if (echo ${stripped_path} | grep \".java$\"); then\n\tcontinue;\n  fi\n\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  fuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n  chmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/jaxb/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>jaxb-fuzzer</artifactId>\n\t<version>${jaxbVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<exec.mainClass>ossfuzz.DataTypeConverterFuzzer</exec.mainClass>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\ton the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\tto avoid mismatching driver/api versions\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>com.sun.xml.bind</groupId>\n\t\t\t<artifactId>jaxb-ri</artifactId>\n\t\t\t<version>${jaxbVersion}</version>\n\t\t\t<type>pom</type>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/jaxb/project.yaml",
    "content": "homepage: \"https://eclipse-ee4j.github.io/jaxb-ri/\"\nlanguage: jvm\nmain_repo: \"https://github.com/eclipse-ee4j/jaxb-ri.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\nrun_tests: False"
  },
  {
    "path": "projects/jaxb/src/main/java/ossfuzz/DataTypeConverterFuzzer.java",
    "content": "package ossfuzz;\n\nimport com.code_intelligence.jazzer.api.*;\n\nimport org.glassfish.jaxb.runtime.*;\n\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.*;\n\npublic class DataTypeConverterFuzzer {\n\n\tString m_string;\n\tint m_int;\n\n\tDataTypeConverterFuzzer(int integer, String string) {\n\t\tm_int = integer;\n\t\tm_string = string;\n\n\t}\n\n\tvoid test() {\n\n\t\tDatatypeConverterImpl.theInstance.printHexBinary(m_string.getBytes());\n\n\t\tCalendar calendar = null;\n\t\ttry {\n\t\t\tcalendar = DatatypeConverterImpl.theInstance.parseTime(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printTime(calendar);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tString base64 = DatatypeConverterImpl.theInstance.printBase64Binary(m_string.getBytes());\n\t\t\tDatatypeConverterImpl.theInstance.parseBase64Binary(base64);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tString type = DatatypeConverterImpl.theInstance.parseAnySimpleType(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printAnySimpleType(type);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tboolean bool = DatatypeConverterImpl.theInstance.parseBoolean(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printBoolean(bool);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tBigDecimal bigDecimal = DatatypeConverterImpl.theInstance.parseDecimal(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printDecimal(bigDecimal);\n\t\t} catch (NumberFormatException e) {\n\t\t\t/* documented, ignore */\n\t\t} catch (IllegalArgumentException e) {\n\n\t\t}\n\n\t\ttry {\n\t\t\tbyte m_byte = DatatypeConverterImpl.theInstance.parseByte(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printByte(m_byte);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tdouble dbl = DatatypeConverterImpl.theInstance.parseDouble(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printDouble(dbl);\n\t\t} catch (NumberFormatException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tCalendar dateTime = DatatypeConverterImpl.theInstance.parseDateTime(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printDateTime(dateTime);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tlong longV = DatatypeConverterImpl.theInstance.parseUnsignedInt(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printUnsignedInt(longV);\n\t\t} catch (NumberFormatException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tint shrt = DatatypeConverterImpl.theInstance.parseUnsignedShort(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printUnsignedShort(shrt);\n\t\t} catch (NumberFormatException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tCalendar time = DatatypeConverterImpl.theInstance.parseTime(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printTime(time);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tCalendar date = DatatypeConverterImpl.theInstance.parseDate(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printDate(date);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tString smplType = DatatypeConverterImpl.theInstance.parseAnySimpleType(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printAnySimpleType(smplType);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tString strg = DatatypeConverterImpl.theInstance.parseString(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printString(strg);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tBigInteger bigInteger = DatatypeConverterImpl.theInstance.parseInteger(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printInteger(bigInteger);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tint intgr = DatatypeConverterImpl.theInstance.parseInt(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printInt(intgr);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tlong lng = DatatypeConverterImpl.theInstance.parseLong(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printLong(lng);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tshort shrt = DatatypeConverterImpl.theInstance.parseShort(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printShort(shrt);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t\ttry {\n\t\t\tfloat flt = DatatypeConverterImpl.theInstance.parseFloat(m_string);\n\t\t\tDatatypeConverterImpl.theInstance.printFloat(flt);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* documented, ignore */\n\t\t}\n\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\tDataTypeConverterFuzzer testClosure = new DataTypeConverterFuzzer(\n\t\t\t\tfuzzedDataProvider.consumeInt(),\n\t\t\t\tfuzzedDataProvider.consumeRemainingAsString());\n\n\t\ttestClosure.test();\n\t}\n}"
  },
  {
    "path": "projects/jbig2dec/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libtool pkg-config vim libreadline-dev wget autoconf\nRUN git clone --recursive --depth 1 git://git.ghostscript.com/jbig2dec.git jbig2dec\nRUN mkdir tests\nRUN cp $SRC/jbig2dec/annex-h.jbig2 tests/annex-h.jb2\nRUN cd tests && (wget -O t89-halftone.zip http://cgit.ghostscript.com/cgi-bin/cgit.cgi/tests.git/plain/jbig2/t89-halftone.zip && unzip t89-halftone.zip) || true\nRUN cd tests && (wget -O jb2streams.zip http://cgit.ghostscript.com/cgi-bin/cgit.cgi/tests.git/plain/jbig2/jb2streams.zip && unzip jb2streams.zip) || true\nRUN cd tests && zip -q $SRC/jbig2_fuzzer_seed_corpus.zip *.jb2\nRUN rm -rf tests\nCOPY *.dict $SRC/\nWORKDIR jbig2dec\nCOPY *.cc $SRC/\nCOPY run_tests.sh build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/jbig2dec/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd ${SRC}/jbig2dec\n./autogen.sh\nmake distclean\n\nmkdir -p ${WORK}/jbig2dec\ncd ${WORK}/jbig2dec\n${SRC}/jbig2dec/configure\n\nLDFLAGS=\"$CXXFLAGS\" make -C ${WORK}/jbig2dec jbig2dec -j$(nproc)\nfuzz_target=jbig2_fuzzer\n\n$CXX $CXXFLAGS -std=c++11 -I$SRC/jbig2dec -fno-inline-functions \\\n    $SRC/jbig2_fuzzer.cc -o $OUT/$fuzz_target \\\n    $LIB_FUZZING_ENGINE ${WORK}/jbig2dec/.libs/libjbig2dec.a\n\nunzip -l ${SRC}/${fuzz_target}_seed_corpus.zip\n\nmv $SRC/{*.zip,*.dict,*.options} $OUT\n\nif [ ! -f \"${OUT}/${fuzz_target}_seed_corpus.zip\" ]; then\n  echo \"missing seed corpus\"\n  exit 1\nfi\n\nif [ ! -f \"${OUT}/${fuzz_target}.dict\" ]; then\n  echo \"missing dictionary\"\n  exit 1\nfi\n\nif [ ! -f \"${OUT}/${fuzz_target}.options\" ]; then\n  echo \"missing options\"\n  exit 1\nfi\n"
  },
  {
    "path": "projects/jbig2dec/jbig2_fuzzer.cc",
    "content": "/*\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <cstdint>\n#include <stdlib.h>\n#include <string.h>\n#include <stdio.h>\n\n#include \"jbig2.h\"\n\n#define ALIGNMENT ((size_t) 16)\n#define KBYTE ((size_t) 1024)\n#define MBYTE (1024 * KBYTE)\n#define GBYTE (1024 * MBYTE)\n#define MAX_ALLOCATION (32 * MBYTE)\n\nstatic size_t used;\n\nstatic void *jbig2_fuzzer_reached_limit(size_t oldsize, size_t size)\n{\n  if (oldsize == 0)\n    fprintf(stderr, \"limit: %zu Mbyte used: %zu Mbyte allocation: %zu: limit reached\\n\", MAX_ALLOCATION / MBYTE, used / MBYTE, size);\n  else\n    fprintf(stderr, \"limit: %zu Mbyte used: %zu Mbyte reallocation: %zu -> %zu: limit reached\\n\", MAX_ALLOCATION / MBYTE, used / MBYTE, oldsize, size);\n  fflush(0);\n  return NULL;\n}\n\nstatic void *jbig2_fuzzer_alloc(Jbig2Allocator *allocator, size_t size)\n{\n  char *ptr = NULL;\n\n  if (size == 0)\n    return NULL;\n  if (size > SIZE_MAX - ALIGNMENT)\n    return NULL;\n  if (size + ALIGNMENT > MAX_ALLOCATION - used)\n    return jbig2_fuzzer_reached_limit(0, size + ALIGNMENT);\n\n  ptr = (char *) malloc(size + ALIGNMENT);\n  if (ptr == NULL)\n    return NULL;\n\n  memcpy(ptr, &size, sizeof(size));\n  used += size + ALIGNMENT;\n\n  return ptr + ALIGNMENT;\n}\n\nstatic void jbig2_fuzzer_free(Jbig2Allocator *allocator, void *ptr)\n{\n  size_t size;\n\n  if (ptr == NULL)\n    return;\n  if (ptr < (void *) ALIGNMENT)\n    return;\n\n  ptr = (char *) ptr - ALIGNMENT;\n  memcpy(&size, ptr, sizeof(size));\n\n  used -= size + ALIGNMENT;\n  free(ptr);\n}\n\nstatic void *jbig2_fuzzer_realloc(Jbig2Allocator *allocator, void *old, size_t size)\n{\n  size_t oldsize;\n  char *ptr;\n\n  if (old == NULL)\n    return jbig2_fuzzer_alloc(allocator, size);\n  if (old < (void *) ALIGNMENT)\n    return NULL;\n\n  if (size == 0) {\n    jbig2_fuzzer_free(allocator, old);\n    return NULL;\n  }\n  if (size > SIZE_MAX - ALIGNMENT)\n    return NULL;\n\n  old = (char *) old - ALIGNMENT;\n  memcpy(&oldsize, old, sizeof(oldsize));\n\n  if (size + ALIGNMENT > MAX_ALLOCATION - used + oldsize + ALIGNMENT)\n    return jbig2_fuzzer_reached_limit(oldsize + ALIGNMENT, size + ALIGNMENT);\n\n  ptr = (char *) realloc(old, size + ALIGNMENT);\n  if (ptr == NULL)\n    return NULL;\n\n  used -= oldsize + ALIGNMENT;\n  memcpy(ptr, &size, sizeof(size));\n  used += size + ALIGNMENT;\n\n  return ptr + ALIGNMENT;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  Jbig2Allocator allocator;\n  Jbig2Ctx *ctx = NULL;\n\n  used = 0;\n\n  allocator.alloc = jbig2_fuzzer_alloc;\n  allocator.free = jbig2_fuzzer_free;\n  allocator.realloc = jbig2_fuzzer_realloc;\n\n  ctx = jbig2_ctx_new(&allocator, (Jbig2Options) 0, NULL, NULL, NULL);\n  if (jbig2_data_in(ctx, data, size) == 0)\n  {\n    if (jbig2_complete_page(ctx) == 0)\n    {\n      Jbig2Image *image = jbig2_page_out(ctx);\n      if (image != NULL)\n      {\n        int sum = 0;\n        for (int i = 0; i < image->height * image->stride; i++)\n          sum += image->data[i];\n        printf(\"sum of image data bytes: %d\\n\", sum);\n      }\n      jbig2_release_page(ctx, image);\n    }\n  }\n  jbig2_ctx_free(ctx);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/jbig2dec/jbig2_fuzzer.dict",
    "content": "# AFL dictionary for jbig2 images\n# by Sebastian Rasmussen <sebras@gmail.com>\n\nid_string=\"\\x97\\x4a\\x42\\x32\\x0d\\x0a\\x1a\\x0a\"\n\n# segments\n\nnoretain_allpages_symbol_dictionary=\"\\x00\"\nnoretain_allpages_intermediate_text_region=\"\\x04\"\nnoretain_allpages_immediate_text_region=\"\\x06\"\nnoretain_allpages_immediate_lossless_text_region=\"\\x07\"\nnoretain_allpages_pattern_dictionary=\"\\x10\"\nnoretain_allpages_intermediate_halftone_region=\"\\x14\"\nnoretain_allpages_immediate_halftone_region=\"\\x16\"\nnoretain_allpages_immediate_lossless_halftone_region=\"\\x17\"\nnoretain_allpages_intermediate_generic_region=\"\\x24\"\nnoretain_allpages_immediate_generic_region=\"\\x26\"\nnoretain_allpages_immediate_lossless_generic_region=\"\\x27\"\nnoretain_allpages_intermediate_generic_refinement_region=\"\\x28\"\nnoretain_allpages_immediate_generic_refinement_region=\"\\x2a\"\nnoretain_allpages_immediate_lossless_generic_refinement_region=\"\\x2b\"\nnoretain_allpages_page_information=\"\\x30\"\nnoretain_allpages_end_of_page=\"\\x31\"\nnoretain_allpages_end_of_stripe=\"\\x32\"\nnoretain_allpages_end_of_file=\"\\x33\"\nnoretain_allpages_profiles=\"\\x34\"\nnoretain_allpages_tables=\"\\x35\"\nnoretain_allpages_color_palette=\"\\x36\"\nnoretain_allpages_extension=\"\\x3e\"\n\nnoretain_specificpage_symbol_dictionary=\"\\x40\"\nnoretain_specificpage_intermediate_text_region=\"\\x44\"\nnoretain_specificpage_immediate_text_region=\"\\x46\"\nnoretain_specificpage_immediate_lossless_text_region=\"\\x47\"\nnoretain_specificpage_pattern_dictionary=\"\\x50\"\nnoretain_specificpage_intermediate_halftone_region=\"\\x54\"\nnoretain_specificpage_immediate_halftone_region=\"\\x56\"\nnoretain_specificpage_immediate_lossless_halftone_region=\"\\x57\"\nnoretain_specificpage_intermediate_generic_region=\"\\x64\"\nnoretain_specificpage_immediate_generic_region=\"\\x66\"\nnoretain_specificpage_immediate_lossless_generic_region=\"\\x67\"\nnoretain_specificpage_intermediate_generic_refinement_region=\"\\x68\"\nnoretain_specificpage_immediate_generic_refinement_region=\"\\x6a\"\nnoretain_specificpage_immediate_lossless_generic_refinement_regio6=\"\\x6b\"\nnoretain_specificpage_page_information=\"\\x70\"\nnoretain_specificpage_end_of_page=\"\\x71\"\nnoretain_specificpage_end_of_stripe=\"\\x72\"\nnoretain_specificpage_end_of_file=\"\\x73\"\nnoretain_specificpage_profiles=\"\\x74\"\nnoretain_specificpage_tables=\"\\x75\"\nnoretain_specificpage_color_palette=\"\\x76\"\nnoretain_specificpage_extension=\"\\x7e\"\n\nretain_allpages_symbol_dictionary=\"\\x80\"\nretain_allpages_intermediate_text_region=\"\\x84\"\nretain_allpages_immediate_text_region=\"\\x86\"\nretain_allpages_immediate_lossless_text_region=\"\\x87\"\nretain_allpages_pattern_dictionary=\"\\x90\"\nretain_allpages_intermediate_halftone_region=\"\\x94\"\nretain_allpages_immediate_halftone_region=\"\\x96\"\nretain_allpages_immediate_lossless_halftone_region=\"\\x97\"\nretain_allpages_intermediate_generic_region=\"\\xa4\"\nretain_allpages_immediate_generic_region=\"\\xa6\"\nretain_allpages_immediate_lossless_generic_region=\"\\xa7\"\nretain_allpages_intermediate_generic_refinement_region=\"\\xa8\"\nretain_allpages_immediate_generic_refinement_region=\"\\xaa\"\nretain_allpages_immediate_lossless_generic_refinement_regio6=\"\\xab\"\nretain_allpages_page_information=\"\\xb0\"\nretain_allpages_end_of_page=\"\\xb1\"\nretain_allpages_end_of_stripe=\"\\xb2\"\nretain_allpages_end_of_file=\"\\xb3\"\nretain_allpages_profiles=\"\\xb4\"\nretain_allpages_tables=\"\\xb5\"\nretain_allpages_color_palette=\"\\xb6\"\nretain_allpages_extension=\"\\xbe\"\n\nretain_specificpage_symbol_dictionary=\"\\xc0\"\nretain_specificpage_intermediate_text_region=\"\\xc4\"\nretain_specificpage_immediate_text_region=\"\\xc6\"\nretain_specificpage_immediate_lossless_text_region=\"\\xc7\"\nretain_specificpage_pattern_dictionary=\"\\xd0\"\nretain_specificpage_intermediate_halftone_region=\"\\xd4\"\nretain_specificpage_immediate_halftone_region=\"\\xd6\"\nretain_specificpage_immediate_lossless_halftone_region=\"\\xd7\"\nretain_specificpage_intermediate_generic_region=\"\\xe4\"\nretain_specificpage_immediate_generic_region=\"\\xe6\"\nretain_specificpage_immediate_lossless_generic_region=\"\\xe7\"\nretain_specificpage_intermediate_generic_refinement_region=\"\\xe8\"\nretain_specificpage_immediate_generic_refinement_region=\"\\xea\"\nretain_specificpage_immediate_lossless_generic_refinement_regio6=\"\\xeb\"\nretain_specificpage_page_information=\"\\xf0\"\nretain_specificpage_end_of_page=\"\\xf1\"\nretain_specificpage_end_of_stripe=\"\\xf2\"\nretain_specificpage_end_of_file=\"\\xf3\"\nretain_specificpage_profiles=\"\\xf4\"\nretain_specificpage_tables=\"\\xf5\"\nretain_specificpage_color_palette=\"\\xf6\"\nretain_specificpage_extension=\"\\xfe\"\n"
  },
  {
    "path": "projects/jbig2dec/jbig2_fuzzer.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\n"
  },
  {
    "path": "projects/jbig2dec/project.yaml",
    "content": "homepage: \"https://www.jbig2dec.com\"\nlanguage: c++\nprimary_contact: sebastian.rasmussen@artifex.com\nsanitizers:\n  - address\n  - memory\nmain_repo: 'git://git.ghostscript.com/jbig2dec.git'\n"
  },
  {
    "path": "projects/jbig2dec/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake check -C $WORK/jbig2dec\n"
  },
  {
    "path": "projects/jboss-logging/.gitignore",
    "content": "project-parent/jboss-logging\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/jboss-logging/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/jboss-logging\nRUN git clone --depth 1 https://github.com/jboss-logging/jboss-logging $SRC/project-parent/jboss-logging\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/jboss-logging/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=jboss-logging\nPROJECT_GROUP_ID=org.jboss.logging\nPROJECT_ARTIFACT_ID=jboss-logging\nMAIN_REPOSITORY=https://github.com/jboss-logging/jboss-logging\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  #PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  PROJECT_VERSION=3.6.3.Final-SNAPSHOT #workaround to make it consistent with pom.xml\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  mvn -pl $PROJECT install -DskipTests\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install -DskipTests -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi\n"
  },
  {
    "path": "projects/jboss-logging/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.jboss.logging</groupId>\n            <artifactId>jboss-logging</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>\n"
  },
  {
    "path": "projects/jboss-logging/project-parent/fuzz-targets/src/test/java/com/example/LoggingFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.jboss.logging.*;\nimport java.util.Properties;\n\n\nclass LoggingFuzzer {\n    private static final Logger LOGGER = Logger.getLogger(LoggingFuzzer.class);\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        String[] logManagers = { \"jboss\",\"jdk\",\"log4j2\",\"log4j\",\"slf4j\"};\n        String logManager = data.pickValue(logManagers);\n        Properties props = System.getProperties();\n        props.setProperty(\"org.jboss.logging.provider\", logManager);\n        int i1 = data.consumeInt();\n        int i2 = data.consumeInt();\n        String s2 = data.consumeString(10);\n        String s1 = data.consumeRemainingAsString();\n        LOGGER.debugf(s1,i1,i2,s2);\n        LOGGER.tracef(s1,i1,i2,s2);\n        LOGGER.errorf(s1,i1,i2,s2);\n        \n    }\n}\n"
  },
  {
    "path": "projects/jboss-logging/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>jboss-logging</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/jboss-logging/project.yaml",
    "content": "homepage: \"https://github.com/jboss-logging/jboss-logging\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/jboss-logging/jboss-logging\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jc/project.yaml",
    "content": "homepage: \"https://kellyjonbrazil.github.io/jc/docs/\"\nlanguage: python\nprimary_contact: \"kellyjonbrazil@gmail.com\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\nmain_repo: \"https://github.com/kellyjonbrazil/jc.git\"\n"
  },
  {
    "path": "projects/jdom/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.14-bin.tar.gz -o ant.tar.gz && \\\n    mkdir -p $SRC/ant && \\\n    tar -zxvf ant.tar.gz -C $SRC/ant --strip-components=1 && \\\n    rm -rf ant.tar.gz\n\nENV ANT_HOME=$SRC/ant\nENV ANT $SRC/ant/bin/ant\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/xml.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/SAXBuilderFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/hunterhacker/jdom.git jdom\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jdom\n"
  },
  {
    "path": "projects/jdom/SAXBuilderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.jdom2.input.SAXBuilder;\nimport org.jdom2.Document;\nimport java.io.StringReader;\nimport org.jdom2.JDOMException;\nimport java.io.IOException;\nimport org.jdom2.IllegalNameException;\nimport org.jdom2.IllegalTargetException;\n\npublic class SAXBuilderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    \n    SAXBuilder sax = new SAXBuilder();\n    sax.setValidation(data.consumeBoolean());\n    sax.setIgnoringElementContentWhitespace(data.consumeBoolean());\n    sax.setIgnoringBoundaryWhitespace(data.consumeBoolean());\n    StringReader xml_input = new StringReader(data.consumeRemainingAsString());\n    \n    try{    \n      Document doc = sax.build(xml_input);\n    }\n    catch (JDOMException | IOException | IllegalNameException | IllegalTargetException e){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jdom/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\n$ANT -Dcompile.target=15 -Dcompile.source=15\ncp build/package/jdom-2.x-*[0-9][0-9].jar $OUT/jdom.jar\n\nALL_JARS=\"jdom.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jdom/project.yaml",
    "content": "homepage: \"http://jdom.org/\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/hunterhacker/jdom.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"michael.nothhard@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jedi/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone --recurse-submodules https://github.com/davidhalter/jedi jedi\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/jedi\n"
  },
  {
    "path": "projects/jedi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 setup.py install\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/jedi/fuzz_script.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport jedi\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  jedi.Script(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/jedi/project.yaml",
    "content": "homepage: https://github.com/davidhalter/jedi\nmain_repo: https://github.com/davidhalter/jedi\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/jedis/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-11-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.5/bin/mvn\n\nRUN git clone --depth 1 https://github.com/redis/jedis.git jedis\nWORKDIR jedis\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/jedis/JedisURIFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport redis.clients.jedis.Jedis;\nimport java.net.URI;\nimport java.net.URISyntaxException;\n\npublic class JedisURIFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try{\n            Jedis jedis = new Jedis(new URI(data.consumeRemainingAsString()));\n        }\n        catch (URISyntaxException e) {}\n        catch (java.lang.NumberFormatException e) {}\n        catch (redis.clients.jedis.exceptions.InvalidURIException e) {}\n    }\n}"
  },
  {
    "path": "projects/jedis/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-11\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN clean package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./ -name \"jedis-$CURRENT_VERSION.jar\" -exec mv {} $OUT/jedis.jar \\;\n\nALL_JARS=\"jedis.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jedis/project.yaml",
    "content": "homepage: \"https://github.com/redis/jedis\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/redis/jedis.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/jerryscript/project.yaml",
    "content": "homepage: \"https://jerryscript.net\"\nlanguage: c\nprimary_contact: \"zherczeg7@gmail.com\"\nauto_ccs:\n  - \"reni@inf.u-szeged.hu\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: \"https://github.com/jerryscript-project/jerryscript\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n"
  },
  {
    "path": "projects/jersey/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\n\nRUN git clone --depth 1 https://github.com/eclipse-ee4j/jersey\n\nCOPY build.sh $SRC/\nCOPY HttpHeaderReaderFuzzer.java $SRC/\nWORKDIR $SRC/jersey"
  },
  {
    "path": "projects/jersey/HttpHeaderReaderFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.glassfish.jersey.message.internal.HttpHeaderReader;\nimport org.glassfish.jersey.message.internal.MatchingEntityTag;\nimport java.text.ParseException;\n\npublic class HttpHeaderReaderFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tString value = data.consumeRemainingAsString();\n\t\ttry {\n\t\t\tHttpHeaderReader.readMatchingEntityTag(value);\n\t\t\tHttpHeaderReader.readQualityFactor(value);\n\t\t\tHttpHeaderReader.readDate(value);\n\t\t\tHttpHeaderReader.readAcceptToken(value);\n\t\t\tHttpHeaderReader.readAcceptLanguage(value);\n\t\t\tHttpHeaderReader.readStringList(value);\n\t\t\tHttpHeaderReader.readCookie(value);\n\t\t\tHttpHeaderReader.readCookies(value);\n\t\t\tHttpHeaderReader.readNewCookie(value);\n\n\t\t} catch (ParseException e) { }\n\t} \n}"
  },
  {
    "path": "projects/jersey/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package org.apache.maven.plugins:maven-dependency-plugin:3.6.1:copy -Dartifact=org.osgi:org.osgi.core:6.0.0 -DoutputDirectory=. $MAVEN_ARGS -Pstaging\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"core-server/target/jersey-server-$CURRENT_VERSION.jar\" \"$OUT/jersey-server.jar\"\ncp \"core-common/target/jersey-common-$CURRENT_VERSION.jar\" \"$OUT/jersey-common.jar\"\ncp \"core-client/target/jersey-client-$CURRENT_VERSION.jar\" \"$OUT/jersey-client.jar\"\ncp \"org.osgi.core-6.0.0.jar\" \"$OUT/org.osgi.core.jar\"\n\n# Copy Jakarta WS RS API jar for compilation\nfind . -path \"*/jakarta.ws.rs-api*.jar\" -not -name \"*sources*\" | head -1 | xargs -I{} cp {} \"$OUT/jakarta.ws.rs-api.jar\"\n\nALL_JARS=\"jersey-server.jar jersey-common.jar jersey-client.jar org.osgi.core.jar jakarta.ws.rs-api.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH -d $OUT -encoding UTF-8 $fuzzer\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jersey/project.yaml",
    "content": "homepage: \"https://github.com/eclipse-ee4j/jersey\"\nlanguage: jvm\nmain_repo: \"https://github.com/eclipse-ee4j/jersey.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jettison/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/json.dict $SRC/JsonFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/JsonFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/jettison-json/jettison.git jettison\n\nCOPY build.sh $SRC/\nCOPY JsonFuzzer.java $SRC/\nWORKDIR $SRC/jettison\n"
  },
  {
    "path": "projects/jettison/JsonFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.codehaus.jettison.json.JSONObject;\nimport org.codehaus.jettison.json.JSONException;\n\npublic class JsonFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      JSONObject obj = new JSONObject(data.consumeRemainingAsString());\n    }\n    catch (JSONException e){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jettison/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/jettison-$CURRENT_VERSION.jar\" $OUT/jettison.jar\n\nALL_JARS=\"jettison.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jettison/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/jettison-json/jettison\nlanguage: jvm\nmain_repo: https://github.com/jettison-json/jettison.git\nsanitizers:\n- address\nvendor_ccs:\n- patrice.salathe@code-intelligence.com\n- yakdan@code-intelligence.com\n"
  },
  {
    "path": "projects/jetty/.gitignore",
    "content": "project-parent/jetty\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/jetty/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/http.dict $SRC/HTTP2CServerFuzzer.dict && \\\n    mv fuzzing/dictionaries/http.dict $SRC/HttpParserFuzzer.dict && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/XmlParserFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/HTTP2CServerFuzzer_seed_corpus.zip go-fuzz-corpus/http2/corpus/* && \\\n    zip -j $SRC/HttpParserFuzzer_seed_corpus.zip go-fuzz-corpus/httpreq/corpus/* && \\\n    zip -j $SRC/XmlParserFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/jetty\nRUN git clone --depth 1 https://github.com/eclipse/jetty.project $SRC/project-parent/jetty\n\n# required by jetty's asciidoctor-maven-plugin\nRUN apt-get update && apt-get -y install fontconfig\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/jetty/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=jetty\nPROJECT_GROUP_ID=org.eclipse.jetty\nPROJECT_ARTIFACT_ID=jetty-project\nMAIN_REPOSITORY=https://github.com/eclipse/jetty.project\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=11 -Djavac.target.version=11 -Denforcer.skip=true -DskipTests\"\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  FUZZ_TARGET_DEPENDENCIES=\":jetty-http :jetty-server :jetty-util :jetty-io :jetty-runner :jetty-client .http2:http2-common .http2:http2-server\"\n  \n  for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS) \n  $MVN -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n  \n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java' ! -name WebAppDefaultServletFuzzer.java); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\n  # disable NamingContextLookup sanitizer for WebAppDefaultServletFuzzer.java\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.WebAppDefaultServletFuzzer \\\n--disabled_hooks=com.code_intelligence.jazzer.sanitizers.NamingContextLookup \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/WebAppDefaultServletFuzzer\n  chmod u+x $OUT/WebAppDefaultServletFuzzer\n\n  # add keystore to location required by SslConnectionFuzzer\n  mkdir -p /out/src/test/resources\n  cp $SRC/project-parent/jetty/jetty-io/src/test/resources/keystore.p12 /out/src/test/resources/\n\nfi"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-http</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-server</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-util</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-io</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-runner</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n        <groupId>org.junit.platform</groupId>\n        <artifactId>junit-platform-launcher</artifactId>\n        <version>1.9.2</version>\n        </dependency>\n        <dependency>\n            <groupId>org.eclipse.jetty.toolchain</groupId>\n            <artifactId>jetty-test-helper</artifactId>\n            <version>6.0</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-client</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.eclipse.jetty.http2</groupId>\n            <artifactId>http2-common</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.eclipse.jetty.http2</groupId>\n            <artifactId>http2-server</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/AbstractHttpClientServerTest.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\npackage com.example;\n\nimport org.eclipse.jetty.client.HttpClient;\nimport org.eclipse.jetty.client.HttpClientTransport;\nimport org.eclipse.jetty.client.http.HttpClientTransportOverHTTP;\nimport org.eclipse.jetty.http.HttpScheme;\nimport org.eclipse.jetty.io.ClientConnector;\nimport org.eclipse.jetty.server.Handler;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.eclipse.jetty.util.SocketAddressResolver;\nimport org.eclipse.jetty.util.ssl.SslContextFactory;\nimport org.eclipse.jetty.util.thread.QueuedThreadPool;\nimport org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;\nimport org.eclipse.jetty.util.thread.Scheduler;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.extension.ExtensionContext;\nimport org.junit.jupiter.params.provider.Arguments;\nimport org.junit.jupiter.params.provider.ArgumentsProvider;\n\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport java.util.stream.Stream;\n\npublic abstract class AbstractHttpClientServerTest\n{\n    protected Server server;\n    protected HttpClient client;\n    protected ServerConnector connector;\n\n    public void start(Scenario scenario, Handler handler) throws Exception\n    {\n        startServer(scenario, handler);\n        startClient(scenario);\n    }\n\n    protected void startServer(Scenario scenario, Handler handler) throws Exception\n    {\n        if (server == null)\n        {\n            QueuedThreadPool serverThreads = new QueuedThreadPool();\n            serverThreads.setName(\"server\");\n            server = new Server(serverThreads);\n        }\n        connector = new ServerConnector(server, scenario.newServerSslContextFactory());\n        connector.setPort(0);\n        server.addConnector(connector);\n        server.setHandler(handler);\n        server.start();\n    }\n\n    protected void startClient(Scenario scenario) throws Exception\n    {\n        startClient(scenario, null);\n    }\n\n    protected void startClient(Scenario scenario, Consumer<HttpClient> config) throws Exception\n    {\n        startClient(scenario, HttpClientTransportOverHTTP::new, config);\n    }\n\n    protected void startClient(Scenario scenario, Function<ClientConnector, HttpClientTransportOverHTTP> transport, Consumer<HttpClient> config) throws Exception\n    {\n        ClientConnector clientConnector = new ClientConnector();\n        clientConnector.setSelectors(1);\n        clientConnector.setSslContextFactory(scenario.newClientSslContextFactory());\n        QueuedThreadPool executor = new QueuedThreadPool();\n        executor.setName(\"client\");\n        clientConnector.setExecutor(executor);\n        Scheduler scheduler = new ScheduledExecutorScheduler(\"client-scheduler\", false);\n        clientConnector.setScheduler(scheduler);\n        client = newHttpClient(transport.apply(clientConnector));\n        client.setSocketAddressResolver(new SocketAddressResolver.Sync());\n        if (config != null)\n            config.accept(client);\n        client.start();\n    }\n\n    public HttpClient newHttpClient(HttpClientTransport transport)\n    {\n        return new HttpClient(transport);\n    }\n\n    @AfterEach\n    public void disposeClient() throws Exception\n    {\n        if (client != null)\n        {\n            client.stop();\n            client = null;\n        }\n    }\n\n    @AfterEach\n    public void disposeServer() throws Exception\n    {\n        if (server != null)\n        {\n            server.stop();\n            server = null;\n        }\n    }\n\n    public static class ScenarioProvider implements ArgumentsProvider\n    {\n        @Override\n        public Stream<? extends Arguments> provideArguments(ExtensionContext context)\n        {\n            return Stream.of(\n                new NormalScenario()\n                // TODO: add more ssl / non-ssl scenarios here\n            ).map(Arguments::of);\n        }\n    }\n\n\n    public interface Scenario\n    {\n        SslContextFactory.Client newClientSslContextFactory();\n\n        SslContextFactory.Server newServerSslContextFactory();\n\n        String getScheme();\n    }\n\n    public static class NormalScenario implements Scenario\n    {\n        @Override\n        public SslContextFactory.Client newClientSslContextFactory()\n        {\n            return null;\n        }\n\n        @Override\n        public SslContextFactory.Server newServerSslContextFactory()\n        {\n            return null;\n        }\n\n        @Override\n        public String getScheme()\n        {\n            return HttpScheme.HTTP.asString();\n        }\n\n        @Override\n        public String toString()\n        {\n            return \"HTTP\";\n        }\n    }\n\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/AbstractServerTest.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\npackage com.example;\n\nimport org.eclipse.jetty.http.*;\nimport org.eclipse.jetty.http2.api.server.ServerSessionListener;\nimport org.eclipse.jetty.http2.generator.Generator;\nimport org.eclipse.jetty.http2.parser.Parser;\nimport org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;\nimport org.eclipse.jetty.http2.server.RawHTTP2ServerConnectionFactory;\nimport org.eclipse.jetty.io.ByteBufferPool;\nimport org.eclipse.jetty.io.MappedByteBufferPool;\nimport org.eclipse.jetty.server.ConnectionFactory;\nimport org.eclipse.jetty.server.HttpConfiguration;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.eclipse.jetty.servlet.ServletContextHandler;\nimport org.eclipse.jetty.servlet.ServletHolder;\nimport org.eclipse.jetty.util.thread.QueuedThreadPool;\nimport org.junit.jupiter.api.AfterEach;\n\nimport javax.servlet.http.HttpServlet;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.Socket;\nimport java.net.SocketTimeoutException;\nimport java.nio.ByteBuffer;\n\npublic abstract class AbstractServerTest\n{\n    protected ServerConnector connector;\n    protected ByteBufferPool byteBufferPool;\n    protected Generator generator;\n    protected Server server;\n    protected String path;\n\n    protected void startServer(HttpServlet servlet) throws Exception\n    {\n        prepareServer(new HTTP2ServerConnectionFactory(new HttpConfiguration()));\n        ServletContextHandler context = new ServletContextHandler(server, \"/\");\n        context.addServlet(new ServletHolder(servlet), path);\n        server.start();\n    }\n\n    protected void startServer(ServerSessionListener listener) throws Exception\n    {\n        prepareServer(new RawHTTP2ServerConnectionFactory(new HttpConfiguration(), listener));\n        server.start();\n    }\n\n    private void prepareServer(ConnectionFactory connectionFactory)\n    {\n        QueuedThreadPool serverExecutor = new QueuedThreadPool();\n        serverExecutor.setName(\"server\");\n        server = new Server(serverExecutor);\n        connector = new ServerConnector(server, connectionFactory);\n        server.addConnector(connector);\n        path = \"/test\";\n        byteBufferPool = new MappedByteBufferPool();\n        generator = new Generator(byteBufferPool);\n    }\n\n    protected MetaData.Request newRequest(String method, HttpFields fields)\n    {\n        String host = \"localhost\";\n        int port = connector.getLocalPort();\n        String authority = host + \":\" + port;\n        return new MetaData.Request(method, HttpScheme.HTTP.asString(), new HostPortHttpField(authority), path, HttpVersion.HTTP_2, fields, -1);\n    }\n\n    @AfterEach\n    public void dispose() throws Exception\n    {\n        if (server != null)\n            server.stop();\n    }\n\n    protected boolean parseResponse(Socket client, Parser parser) throws IOException\n    {\n        return parseResponse(client, parser, 1000);\n    }\n\n    protected boolean parseResponse(Socket client, Parser parser, long timeout) throws IOException\n    {\n        byte[] buffer = new byte[2048];\n        InputStream input = client.getInputStream();\n        client.setSoTimeout((int)timeout);\n        while (true)\n        {\n            try\n            {\n                int read = input.read(buffer);\n                if (read < 0)\n                    return true;\n                parser.parse(ByteBuffer.wrap(buffer, 0, read));\n                if (client.isClosed())\n                    return true;\n            }\n            catch (SocketTimeoutException x)\n            {\n                return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/HTTP2CServer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\npackage com.example;\n\nimport org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory;\nimport org.eclipse.jetty.server.*;\nimport org.eclipse.jetty.server.handler.AbstractHandler;\nimport org.eclipse.jetty.util.thread.QueuedThreadPool;\n\nimport javax.servlet.ServletException;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.Date;\n\npublic class HTTP2CServer extends Server\n{\n    public HTTP2CServer(int port)\n    {\n        HttpConfiguration config = new HttpConfiguration();\n        // HTTP + HTTP/2 connector\n\n        HttpConnectionFactory http1 = new HttpConnectionFactory(config);\n        HTTP2CServerConnectionFactory http2c = new HTTP2CServerConnectionFactory(config);\n        ServerConnector connector = new ServerConnector(this, http1, http2c);\n        connector.setPort(port);\n        addConnector(connector);\n\n        ((QueuedThreadPool)getThreadPool()).setName(\"server\");\n\n        setHandler(new SimpleHandler());\n    }\n\n    public static void main(String... args) throws Exception\n    {\n        HTTP2CServer server = new HTTP2CServer(8080);\n        server.start();\n    }\n\n    private static class SimpleHandler extends AbstractHandler\n    {\n        @Override\n        public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException\n        {\n            baseRequest.setHandled(true);\n            String code = request.getParameter(\"code\");\n            if (code != null)\n                response.setStatus(Integer.parseInt(code));\n\n            response.setHeader(\"Custom\", \"Value\");\n            response.setContentType(\"text/plain\");\n            String content = \"Hello from Jetty using \" + request.getProtocol() + \"\\n\";\n            content += \"uri=\" + request.getRequestURI() + \"\\n\";\n            content += \"date=\" + new Date() + \"\\n\";\n            response.setContentLength(content.length());\n            response.getOutputStream().print(content);\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/HTTP2CServerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\n\nimport java.net.Socket;\nimport java.nio.charset.StandardCharsets;\n\npublic class HTTP2CServerFuzzer extends AbstractServerTest\n{\n    @BeforeEach\n    public void before() throws Exception\n    {\n        server = new HTTP2CServer(0);\n        server.start();\n        connector = (ServerConnector)server.getConnectors()[0];\n    }\n\n    @AfterEach\n    public void after() throws Exception\n    {\n        server.stop();\n    }\n\n    @FuzzTest\n    public void fuzzHTTP(FuzzedDataProvider data) throws Exception\n    {\n        try (Socket client = new Socket(\"localhost\", connector.getLocalPort()))\n        {\n            client.getOutputStream().write(data.consumeRemainingAsString().getBytes(StandardCharsets.ISO_8859_1));\n            client.getOutputStream().flush();\n        }\n    }\n\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/HttpClientFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.client.api.ContentResponse;\nimport org.eclipse.jetty.client.util.BytesRequestContent;\nimport org.eclipse.jetty.server.handler.AbstractHandler;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.concurrent.TimeUnit;\n\n\npublic class HttpClientFuzzer extends AbstractHttpClientServerTest {\n\n    @FuzzTest\n    public void testPOSTWithParametersWithContent1(FuzzedDataProvider data) throws Exception {\n        Scenario scenario = new NormalScenario();\n        String name = data.consumeString(50);\n        String value = data.consumeString(50);\n        byte[] content = data.consumeRemainingAsBytes();\n        if (content.length > 0) {\n\n            String paramName = name;\n            String paramValue = value;\n            start(scenario, new AbstractHandler() {\n                @Override\n                public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException {\n                    baseRequest.setHandled(true);\n                    consume(request.getInputStream(), true);\n                    String value = request.getParameter(paramName);\n                    if (paramValue.equals(value)) {\n                        response.setCharacterEncoding(\"UTF-8\");\n                        response.setContentType(\"text/plain\");\n                        response.getOutputStream().write(content);\n                    }\n                }\n            });\n\n            ContentResponse response = client.POST(scenario.getScheme() + \"://localhost:\" + connector.getLocalPort() + \"/?b=1\")\n                    .param(paramName, paramValue)\n                    .body(new BytesRequestContent(content))\n                    .timeout(5, TimeUnit.SECONDS)\n                    .send();\n\n            response.getStatus();\n            response.getContent();\n\n            disposeServer();\n            disposeClient();\n        }\n\n    }\n\n    private void consume(InputStream input, boolean eof) throws IOException {\n        int crlfs = 0;\n        while (true) {\n            int read = input.read();\n            if (read == '\\r' || read == '\\n')\n                ++crlfs;\n            else\n                crlfs = 0;\n            if (!eof && crlfs == 4)\n                break;\n            if (read < 0)\n                break;\n        }\n    }\n\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/HttpParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.http.*;\nimport org.eclipse.jetty.http.HttpParser.State;\nimport org.eclipse.jetty.util.BufferUtil;\n\nimport java.nio.ByteBuffer;\nimport java.nio.charset.StandardCharsets;\nimport java.util.ArrayList;\nimport java.util.List;\n\nclass HttpParserFuzzer {\n    static void parseAll(HttpParser parser, ByteBuffer buffer) {\n        if (parser.isState(State.END))\n            parser.reset();\n        if (!parser.isState(State.START))\n            throw new IllegalStateException(\"!START\");\n\n        // continue parsing\n        int remaining = buffer.remaining();\n        while (!parser.isState(State.END) && remaining > 0) {\n            int wasRemaining = remaining;\n            parser.parseNext(buffer);\n            remaining = buffer.remaining();\n            if (remaining == wasRemaining)\n                break;\n        }\n    }\n\n    @FuzzTest\n    void testFuzzParser(FuzzedDataProvider data) {\n        ByteBuffer buffer = BufferUtil.toBuffer(data.consumeRemainingAsString());\n\n        HttpParser.RequestHandler handler = new Handler();\n        HttpParser parser = new HttpParser(handler, HttpCompliance.RFC7230_LEGACY);\n        parseAll(parser, buffer);\n    }\n\n    private String _host;\n    private int _port;\n    private String _bad;\n    private String _content;\n    private String _methodOrVersion;\n    private String _uriOrStatus;\n    private String _versionOrReason;\n    private final List<HttpField> _fields = new ArrayList<>();\n    private final List<HttpField> _trailers = new ArrayList<>();\n    private String[] _hdr;\n    private String[] _val;\n    private int _headers;\n    private boolean _early;\n    private boolean _headerCompleted;\n    private boolean _contentCompleted;\n    private boolean _messageCompleted;\n    private final List<ComplianceViolation> _complianceViolation = new ArrayList<>();\n\n    private class Handler implements HttpParser.RequestHandler, HttpParser.ResponseHandler, ComplianceViolation.Listener {\n        @Override\n        public boolean content(ByteBuffer ref) {\n            if (_content == null)\n                _content = \"\";\n            String c = BufferUtil.toString(ref, StandardCharsets.UTF_8);\n            _content = _content + c;\n            ref.position(ref.limit());\n            return false;\n        }\n\n        @Override\n        public void startRequest(String method, String uri, HttpVersion version) {\n            _fields.clear();\n            _trailers.clear();\n            _headers = -1;\n            _hdr = new String[10];\n            _val = new String[10];\n            _methodOrVersion = method;\n            _uriOrStatus = uri;\n            _versionOrReason = version == null ? null : version.asString();\n            _messageCompleted = false;\n            _headerCompleted = false;\n            _early = false;\n        }\n\n        @Override\n        public void parsedHeader(HttpField field) {\n            _fields.add(field);\n            _hdr[++_headers] = field.getName();\n            _val[_headers] = field.getValue();\n\n            if (field instanceof HostPortHttpField) {\n                HostPortHttpField hpfield = (HostPortHttpField) field;\n                _host = hpfield.getHost();\n                _port = hpfield.getPort();\n            }\n        }\n\n        @Override\n        public boolean headerComplete() {\n            _content = null;\n            _headerCompleted = true;\n            return false;\n        }\n\n        @Override\n        public void parsedTrailer(HttpField field) {\n            _trailers.add(field);\n        }\n\n        @Override\n        public boolean contentComplete() {\n            _contentCompleted = true;\n            return false;\n        }\n\n        @Override\n        public boolean messageComplete() {\n            _messageCompleted = true;\n            return true;\n        }\n\n        @Override\n        public void badMessage(BadMessageException failure) {\n            String reason = failure.getReason();\n            _bad = reason == null ? String.valueOf(failure.getCode()) : reason;\n        }\n\n        @Override\n        public void startResponse(HttpVersion version, int status, String reason) {\n            _fields.clear();\n            _trailers.clear();\n            _methodOrVersion = version.asString();\n            _uriOrStatus = Integer.toString(status);\n            _versionOrReason = reason;\n            _headers = -1;\n            _hdr = new String[10];\n            _val = new String[10];\n            _messageCompleted = false;\n            _headerCompleted = false;\n        }\n\n        @Override\n        public void earlyEOF() {\n            _early = true;\n        }\n\n        @Override\n        public void onComplianceViolation(ComplianceViolation.Mode mode, ComplianceViolation violation, String reason) {\n            _complianceViolation.add(violation);\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/ServerHandlersFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.io.NullByteBufferPool;\nimport org.eclipse.jetty.server.Handler;\nimport org.eclipse.jetty.server.HttpConnectionFactory;\nimport org.eclipse.jetty.server.LocalConnector;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.handler.*;\nimport org.junit.jupiter.api.BeforeAll;\n\nimport java.util.Collection;\n\n\nclass ServerHandlersFuzzer {\n    static Server _server;\n    static LocalConnector _connector;\n    static HandlerCollection handlers;\n    static String[] methods_arr = {\"GET\", \"POST\", \"PUT\", \"DELETE\", \"HEAD\", \"OPTIONS\", \"PATCH\"};\n    static Handler[] handler_arr = {new AsyncDelayHandler(), new BufferedResponseHandler(), new ContextHandler(), new DefaultHandler(), new ErrorHandler(), new FileBufferedResponseHandler(),\n            new HotSwapHandler(), new IdleTimeoutHandler(), new InetAccessHandler(), new MovedContextHandler(), new RequestLogHandler(), new ResourceHandler(), new SecuredRedirectHandler(),\n            new ThreadLimitHandler()};\n\n    @BeforeAll\n    static void setup() {\n        _server = new Server();\n        _server.addBean(new NullByteBufferPool());\n        _connector = new LocalConnector(_server, new HttpConnectionFactory(), null);\n        _connector.setIdleTimeout(3000);\n        _server.addConnector(_connector);\n    }\n\n    @FuzzTest\n    void getResponse(FuzzedDataProvider data) {\n        Collection<Handler> handlersCollection = data.pickValues(handler_arr, data.consumeInt(0, handler_arr.length));\n        String method = data.pickValue(methods_arr);\n        String str = data.consumeString(1000);\n        String str1 = data.consumeString(1000);\n        String str2 = data.consumeRemainingAsString();\n\n        handlers = new HandlerCollection();\n\n        for (Handler handler: handlersCollection) {\n            handlers.addHandler(handler);\n        }\n\n        _server.setHandler(handlers);\n\n        try {\n            _server.start();\n        } catch (Exception e) {\n            throw new RuntimeException(\"Server start error!\");\n        }\n\n        try {\n            _connector.getResponse(method + \" /\" + str + \" HTTP/1.0\\r\\n\" + str1 + \"\\r\\n\\r\\n\" + str2);\n        } catch (Exception e) {\n        }\n\n        try {\n            _server.stop();\n        } catch (Exception e) {\n            throw new RuntimeException(\"Server stop error!\");\n        }\n    }\n\n}"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/SslConnectionFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.io.*;\nimport org.eclipse.jetty.io.ssl.SslConnection;\nimport org.eclipse.jetty.toolchain.test.MavenTestingUtils;\nimport org.eclipse.jetty.util.BufferUtil;\nimport org.eclipse.jetty.util.FutureCallback;\nimport org.eclipse.jetty.util.ssl.SslContextFactory;\nimport org.eclipse.jetty.util.thread.QueuedThreadPool;\nimport org.eclipse.jetty.util.thread.Scheduler;\nimport org.eclipse.jetty.util.thread.TimerScheduler;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport javax.net.ssl.SSLEngine;\nimport javax.net.ssl.SSLSocket;\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\nimport java.nio.channels.SelectableChannel;\nimport java.nio.channels.SelectionKey;\nimport java.nio.channels.ServerSocketChannel;\nimport java.nio.channels.SocketChannel;\nimport java.nio.charset.StandardCharsets;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.concurrent.atomic.AtomicInteger;\n\npublic class SslConnectionFuzzer\n{\n    private static final Logger LOG = LoggerFactory.getLogger(SslConnectionFuzzer.class);\n\n    private static final int TIMEOUT = 1000000;\n    private static ByteBufferPool __byteBufferPool = new LeakTrackingByteBufferPool(new MappedByteBufferPool.Tagged());\n\n    private final SslContextFactory _sslCtxFactory = new SslContextFactory.Server();\n    protected volatile EndPoint _lastEndp;\n    private volatile boolean _testFill = true;\n    private volatile boolean _onXWriteThenShutdown = false;\n\n    private volatile FutureCallback _writeCallback;\n    protected ServerSocketChannel _connector;\n    final AtomicInteger _dispatches = new AtomicInteger();\n    protected QueuedThreadPool _threadPool = new QueuedThreadPool()\n    {\n        @Override\n        public void execute(Runnable job)\n        {\n            _dispatches.incrementAndGet();\n            super.execute(job);\n        }\n    };\n    protected Scheduler _scheduler = new TimerScheduler();\n    protected SelectorManager _manager = new SelectorManager(_threadPool, _scheduler)\n    {\n        @Override\n        public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment)\n        {\n            SSLEngine engine = _sslCtxFactory.newSSLEngine();\n            engine.setUseClientMode(false);\n            SslConnection sslConnection = new SslConnection(__byteBufferPool, getExecutor(), endpoint, engine);\n            sslConnection.setRenegotiationAllowed(_sslCtxFactory.isRenegotiationAllowed());\n            sslConnection.setRenegotiationLimit(_sslCtxFactory.getRenegotiationLimit());\n            Connection appConnection = new TestConnection(sslConnection.getDecryptedEndPoint());\n            sslConnection.getDecryptedEndPoint().setConnection(appConnection);\n            return sslConnection;\n        }\n\n        @Override\n        protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey)\n        {\n            SocketChannelEndPoint endp = new TestEP(channel, selector, selectionKey, getScheduler());\n            endp.setIdleTimeout(TIMEOUT);\n            _lastEndp = endp;\n            return endp;\n        }\n    };\n\n    static final AtomicInteger __startBlocking = new AtomicInteger();\n    static final AtomicInteger __blockFor = new AtomicInteger();\n    static final AtomicBoolean __onIncompleteFlush = new AtomicBoolean();\n\n    private static class TestEP extends SocketChannelEndPoint\n    {\n        public TestEP(SelectableChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler)\n        {\n            super((SocketChannel)channel, selector, key, scheduler);\n        }\n\n        @Override\n        protected void onIncompleteFlush()\n        {\n            __onIncompleteFlush.set(true);\n        }\n\n        @Override\n        public boolean flush(ByteBuffer... buffers) throws IOException\n        {\n            __onIncompleteFlush.set(false);\n            if (__startBlocking.get() == 0 || __startBlocking.decrementAndGet() == 0)\n            {\n                if (__blockFor.get() > 0 && __blockFor.getAndDecrement() > 0)\n                {\n                    return false;\n                }\n            }\n            return super.flush(buffers);\n        }\n    }\n\n    @BeforeEach\n    public void initSSL() throws Exception\n    {\n        File keystore = MavenTestingUtils.getTestResourceFile(\"keystore.p12\");\n        _sslCtxFactory.setKeyStorePath(keystore.getAbsolutePath());\n        _sslCtxFactory.setKeyStorePassword(\"storepwd\");\n        _sslCtxFactory.setRenegotiationAllowed(true);\n        _sslCtxFactory.setRenegotiationLimit(-1);\n        startManager();\n    }\n\n    public void startManager() throws Exception\n    {\n        _testFill = true;\n        _writeCallback = null;\n        _lastEndp = null;\n        _connector = ServerSocketChannel.open();\n        _connector.socket().bind(null);\n        _threadPool.start();\n        _scheduler.start();\n        _manager.start();\n    }\n\n    private void startSSL() throws Exception\n    {\n        _sslCtxFactory.start();\n    }\n\n    @AfterEach\n    public void stopSSL() throws Exception\n    {\n        stopManager();\n        _sslCtxFactory.stop();\n    }\n\n    private void stopManager() throws Exception\n    {\n        if (_lastEndp != null && _lastEndp.isOpen())\n            _lastEndp.close();\n        _manager.stop();\n        _scheduler.stop();\n        _threadPool.stop();\n        _connector.close();\n    }\n\n    public class TestConnection extends AbstractConnection\n    {\n        ByteBuffer _in = BufferUtil.allocate(8 * 1024);\n\n        public TestConnection(EndPoint endp)\n        {\n            super(endp, _threadPool);\n        }\n\n        @Override\n        public void onOpen()\n        {\n            super.onOpen();\n            if (_testFill)\n                fillInterested();\n            else\n            {\n                getExecutor().execute(() -> getEndPoint().write(_writeCallback, BufferUtil.toBuffer(\"Hello Client\")));\n            }\n        }\n\n        @Override\n        public void onClose(Throwable cause)\n        {\n            super.onClose(cause);\n        }\n\n        @Override\n        public void onFillable()\n        {\n            EndPoint endp = getEndPoint();\n            try\n            {\n                boolean progress = true;\n                while (progress)\n                {\n                    progress = false;\n\n                    // Fill the input buffer with everything available\n                    int filled = endp.fill(_in);\n                    while (filled > 0)\n                    {\n                        progress = true;\n                        filled = endp.fill(_in);\n                    }\n\n                    boolean shutdown = _onXWriteThenShutdown && BufferUtil.toString(_in).contains(\"X\");\n\n                    // Write everything\n                    int l = _in.remaining();\n                    if (l > 0)\n                    {\n                        FutureCallback blockingWrite = new FutureCallback();\n\n                        endp.write(blockingWrite, _in);\n                        blockingWrite.get();\n                        if (shutdown)\n                            endp.shutdownOutput();\n                    }\n\n                    // are we done?\n                    if (endp.isInputShutdown() || shutdown)\n                        endp.shutdownOutput();\n                }\n            }\n            catch (InterruptedException | EofException e)\n            {\n                LOG.trace(\"IGNORED\", e);\n            }\n            catch (Exception e)\n            {\n                LOG.warn(\"During onFillable\", e);\n            }\n            finally\n            {\n                if (endp.isOpen())\n                    fillInterested();\n            }\n        }\n    }\n\n    protected SSLSocket newClient() throws IOException\n    {\n        SSLSocket socket = _sslCtxFactory.newSslSocket();\n        socket.connect(_connector.socket().getLocalSocketAddress());\n        return socket;\n    }\n\n    @FuzzTest\n    public void fuzz(FuzzedDataProvider data) throws Exception\n    {\n        startSSL();\n        try (Socket client = newClient())\n        {\n            client.setSoTimeout(TIMEOUT);\n            try (SocketChannel server = _connector.accept())\n            {\n                server.configureBlocking(false);\n                _manager.accept(server);\n                client.getOutputStream().write(data.consumeString(10).getBytes(StandardCharsets.UTF_8));\n                client.getOutputStream().write(data.consumeRemainingAsString().getBytes(StandardCharsets.UTF_8));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/URIUtilDecodePathFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.util.URIUtil;\n\nclass URIUtilDecodePathFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n\n        try {\n            URIUtil.decodePath(data.consumeRemainingAsString());\n        }\n        catch(IllegalArgumentException e) {\n        }\n    }\n}\n\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/WebAppDefaultServletFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.http.UriCompliance;\nimport org.eclipse.jetty.server.HttpConnectionFactory;\nimport org.eclipse.jetty.server.LocalConnector;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.webapp.WebAppContext;\nimport org.junit.jupiter.api.BeforeAll;\n\nimport java.io.OutputStream;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\n\npublic class WebAppDefaultServletFuzzer\n{\n\n    static Server server;\n    static LocalConnector connector;\n\n    @BeforeAll\n    static void prepareServer() throws Exception\n    {\n        server = new Server();\n        connector = new LocalConnector(server);\n        connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setUriCompliance(UriCompliance.RFC3986);\n        server.addConnector(connector);\n\n        Path directoryPath = Files.createTempDirectory(\"test\");\n        Path welcomeResource = directoryPath.resolve(\"index.html\");\n        try (OutputStream output = Files.newOutputStream(welcomeResource))\n        {\n            output.write(\"<h1>welcome page</h1>\".getBytes(StandardCharsets.UTF_8));\n        }\n\n        WebAppContext context = new WebAppContext(server, directoryPath.toString(), \"/\");\n        server.setHandler(context);\n    }\n\n\n    @FuzzTest\n    public void testResourceService3(FuzzedDataProvider data) throws Exception\n    {\n        server.start();\n        String request =\n                \"GET \" + data.consumeRemainingAsString() + \" HTTP/1.1\\r\\n\" +\n                        \"Host: localhost\\r\\n\" +\n                        \"Connection: close\\r\\n\" +\n                        \"\\r\\n\";\n        connector.getResponse(request);\n        try {\n            server.stop();\n        } catch (Exception e) {\n            throw new RuntimeException(\"Server stop error!\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/fuzz-targets/src/test/java/com/example/XmlParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\nimport org.eclipse.jetty.xml.XmlParser;\n\nimport org.xml.sax.SAXParseException;\n\nimport java.io.ByteArrayInputStream;\n\n\nclass XmlParserFuzzer\n{\n    @FuzzTest\n    void testXmlParser(FuzzedDataProvider data) throws Exception\n    {\n        XmlParser parser = new XmlParser();\n        try {\n            parser.parse(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n        } catch (SAXParseException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/jetty/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>jetty</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/jetty/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"www.eclipse.org/jetty\"\nlanguage: jvm\nmain_repo: \"https://github.com/eclipse/jetty.project\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jflex/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/jflex-de/jflex jflex\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/jflex\n"
  },
  {
    "path": "projects/jflex/JflexFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.nio.file.Files;\nimport jflex.exceptions.GeneratorException;\nimport jflex.generator.LexGenerator;\nimport jflex.logging.Out;\n\npublic class JflexFuzzer {\n  private static File tempDirectory;\n  private static File tempFile;\n\n  public static void fuzzerInitialize() {\n    try {\n      tempDirectory = Files.createTempDirectory(\"oss-fuzz\").toFile().getAbsoluteFile();\n      tempFile = new File(tempDirectory + \"/\"\n          + \"oss-fuzz-temp.java\");\n    } catch (IOException e) {\n      // Known exception\n    }\n  }\n\n  public static void fuzzerTearDown() {\n    tempFile.delete();\n    tempDirectory.delete();\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Discard all log message\n      Out.setOutputStream(OutputStream.nullOutputStream());\n\n      PrintWriter printWriter = new PrintWriter(new FileWriter(tempFile));\n      printWriter.print(\"%%\" + data.consumeRemainingAsString());\n      printWriter.close();\n\n      LexGenerator generator = new LexGenerator(tempFile);\n      generator.generate();\n    } catch (GeneratorException | IOException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jflex/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"jflex/target/jflex-$CURRENT_VERSION.jar\" $OUT/jflex.jar\n\nALL_JARS=\"jflex.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jflex/project.yaml",
    "content": "homepage: https://github.com/jflex-de/jflex\nmain_repo: https://github.com/jflex-de/jflex\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/jfreechart/DefaultCategoryDatasetChartFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\nimport org.jfree.chart.JFreeChart;\nimport org.jfree.chart.ChartFactory;\nimport org.jfree.data.category.DefaultCategoryDataset;\nimport ossfuzz.TestUtils;\n\n\npublic class DefaultCategoryDatasetChartFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) throws Exception {\n        DefaultCategoryDataset<String, String> dataset = new DefaultCategoryDataset<>();\n\n        Integer numKeys = data.consumeInt(0, 1000);\n        Integer numColumns = data.consumeInt(0, 1000);\n        for (int i = 0; i < numKeys; i++) {\n            String series = data.consumeString(100);\n            for (int j = 0; j < numColumns; j++) {\n                String category = data.consumeString(100);\n                dataset.addValue(data.consumeDouble(), series, category);\n            }\n        }\n\n        JFreeChart c1 = ChartFactory.createBarChart(data.consumeString(100),\n                data.consumeString(100), data.consumeString(100), dataset);\n        JFreeChart c2 = TestUtils.serialised(c1);\n        if (!c1.equals(c2)) {\n            throw new Exception(\"Charts with Default Category Datasets should be equal\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jfreechart/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.0/bin/mvn\n\nRUN apt-get install -y libfreetype6\n\nRUN git clone --depth 1 https://github.com/jfree/jfreechart.git $SRC/jfreechart\n\nCOPY build.sh $SRC/\n\nCOPY *Fuzzer.java $SRC/\n\nCOPY src/ ${SRC}/jfreechart/src/\n\nWORKDIR $SRC/jfreechart\n"
  },
  {
    "path": "projects/jfreechart/PieDatasetChartFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\nimport org.jfree.chart.JFreeChart;\nimport org.jfree.chart.ChartFactory;\nimport org.jfree.data.general.DefaultPieDataset;\nimport ossfuzz.TestUtils;\n\n\npublic class PieDatasetChartFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) throws Exception {\n        DefaultPieDataset<String> dataSet = new DefaultPieDataset<>();\n        Integer numValues = data.consumeInt(0, 1000);\n        for (int i = 0 ; i < numValues; i++) {\n            dataSet.setValue(data.consumeString(100), data.consumeDouble());\n        }\n\n        JFreeChart c1 = ChartFactory.createPieChart(data.consumeString(100), dataSet);\n        JFreeChart c2 = TestUtils.serialised(c1);\n        if (!c1.equals(c2)) {\n            throw new Exception(\"Charts with Pie Datasets should be equal\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jfreechart/TimeSeriesChartFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\nimport org.jfree.chart.JFreeChart;\nimport org.jfree.chart.ChartFactory;\nimport org.jfree.data.time.*;\nimport ossfuzz.TestUtils;\n\npublic class TimeSeriesChartFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) throws Exception {\n        RegularTimePeriod t = new Day();\n        TimeSeries<String> series = new TimeSeries<>(data.consumeString(100));\n        Integer numItems = data.consumeInt(0, 1000);\n        for (int i = 0; i < numItems; i++) {\n            series.add(t, data.consumeInt());\n            if (i != numItems - 1) {\n                t = t.next();\n            }\n        }\n        TimeSeriesCollection<String> dataset = new TimeSeriesCollection<>();\n        dataset.addSeries(series);\n\n        JFreeChart c1 = ChartFactory.createTimeSeriesChart(\n                data.consumeString(100),\n                data.consumeString(100),\n                data.consumeString(100),\n                dataset);\n        JFreeChart c2 = TestUtils.serialised(c1);\n        if (!c1.equals(c2)) {\n            throw new Exception(\"Charts with Time Series should be equal\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jfreechart/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n\n$MVN package -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true\n\ncp \"$SRC/jfreechart/target/jfreechart-$CURRENT_VERSION.jar\" $OUT/\n\nALL_JARS=$(find $OUT/ -name *.jar ! -name jazzer*.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac $SRC/jfreechart/src/main/java/ossfuzz/TestUtils.java\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jfreechart/project.yaml",
    "content": "homepage: \"https://www.jfree.org/jfreechart/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/jfree/jfreechart.git\"\nsanitizers:\n  - address\nvendor_ccs:\n"
  },
  {
    "path": "projects/jfreechart/src/main/java/ossfuzz/TestUtils.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\npackage ossfuzz;\n\nimport java.io.*;\n\n/**\n * Some utility methods for use by the testing code.\n */\npublic class TestUtils {\n\n    /**\n     * Serialises an object, deserialises it and returns the deserialised \n     * version.\n     * \n     * @param original  the original object.\n     * \n     * @return A serialised and deserialised version of the original.\n     */\n    public static <K> K serialised(K original) {\n        K result = null;\n        ByteArrayOutputStream buffer = new ByteArrayOutputStream();\n        ObjectOutput out;\n        try {\n            out = new ObjectOutputStream(buffer);\n            out.writeObject(original);\n            out.close();\n            ObjectInput in = new ObjectInputStream(\n                    new ByteArrayInputStream(buffer.toByteArray()));\n            result = (K) in.readObject();\n            in.close();\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        } catch (ClassNotFoundException e) {\n            throw new RuntimeException(e);\n        }\n        return result;\n    }\n}\n"
  },
  {
    "path": "projects/jimfs/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/jimfs\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jimfs"
  },
  {
    "path": "projects/jimfs/FileSystemFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.google.common.collect.ImmutableList;\nimport com.google.common.jimfs.Configuration;\nimport com.google.common.jimfs.Jimfs;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.FileSystem;\nimport java.nio.file.Files;\nimport java.nio.file.InvalidPathException;\nimport java.nio.file.Path;\n\nimport static com.google.common.jimfs.PathNormalization.CASE_FOLD_UNICODE;\nimport static com.google.common.jimfs.PathNormalization.NFD;\n\npublic class FileSystemFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Configuration.Builder configBuilder;\n        if (data.consumeBoolean()) {\n            configBuilder = Configuration.unix().toBuilder();\n        } else {\n            configBuilder = Configuration.windows().toBuilder();\n        }\n\n        FileSystem fs;\n        try {\n            fs = Jimfs.newFileSystem(configBuilder\n                .setNameCanonicalNormalization(NFD, CASE_FOLD_UNICODE)\n                .setBlockSize(data.consumeInt(1, 1000))\n                .setMaxSize(data.consumeLong(1, 100000))\n                .setRoots(data.consumeString(50))\n                .setWorkingDirectory(\"/\" + data.consumeString(50))\n                .setMaxCacheSize(data.consumeLong(1, 100000))\n                .setPathEqualityUsesCanonicalForm(data.consumeBoolean())\n                .build()\n            );\n        } catch (java.lang.IllegalArgumentException e) {\n            return;\n        }\n\n        Path foo;\n        try {\n            foo = fs.getPath(data.consumeString(50));\n        } catch (InvalidPathException e) {\n            return;\n        }\n\n        String content = data.consumeRemainingAsString();\n        try {\n            Files.createDirectory(foo);\n            Path dummyFile = foo.resolve(\"dummy.txt\");\n            Files.write(dummyFile, ImmutableList.of(content), StandardCharsets.UTF_8);\n            String fileContent = Files.readString(dummyFile);\n            if (!fileContent.contains(content)) {\n                throw new FuzzerSecurityIssueLow(\"Content not entirely written to file\");\n            }\n        } catch (IOException ignored) {}\n    }\n}\n"
  },
  {
    "path": "projects/jimfs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"jimfs/target/jimfs-$CURRENT_VERSION.jar\" \"$OUT/jimfs.jar\"\n\nALL_JARS=\"jimfs.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jimfs/project.yaml",
    "content": "homepage: \"https://github.com/google/jimfs\"\nlanguage: jvm\nmain_repo: \"git@github.com:google/jimfs.git\"\nprimary_contact: \"cgdecker@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jimp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/jimp-dev/jimp\n\nCOPY fuzz.js $SRC/jimp\n\nWORKDIR $SRC/jimp\n"
  },
  {
    "path": "projects/jimp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nnpm install --global yarn\nyarn install\nyarn build\nyarn add -W -D @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer jimp fuzz.js -i jimp\n"
  },
  {
    "path": "projects/jimp/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst Jimp = require('jimp');\nconst { writeFileSync } = require('fs');\n\nmodule.exports.fuzz = async function(data) {\n  try {\n    const provider = new FuzzedDataProvider(data);\n    const content = provider.consumeBytes(provider.consumeIntegralInRange(1, 4096));\n    let jimpInput;\n    if (provider.consumeBoolean()) {\n      jimpInput = Buffer.from(content);\n    } else {\n      jimpInput = \"/tmp/fuzz.me\";\n      writeFileSync(jimpInput, Buffer.from(content));\n    }\n\n    Jimp.read(jimpInput, (err, image) => {\n      if (err) return;\n\n      const width = provider.consumeIntegralInRange(0, image.bitmap.width);\n      const height = provider.consumeIntegralInRange(0, image.bitmap.height);\n      const x = provider.consumeIntegralInRange(0, image.bitmap.width - width);\n      const y = provider.consumeIntegralInRange(0, image.bitmap.height - height);\n      const cropImage = image.crop(x, y, width, height);\n      const resizeWidth = provider.consumeIntegralInRange(0, image.bitmap.width);\n      const resizeHeight = provider.consumeIntegralInRange(0, image.bitmap.height);\n      const resizeImage = cropImage.resize(resizeWidth, resizeHeight);\n      const blurRadius = provider.consumeNumberinRange(0, 100);\n      const blurImage = resizeImage.blur(blurRadius);\n      const contrastValue = provider.consumeNumberinRange(-1, 1);\n      const contrastImage = blurImage.contrast(contrastValue);\n      const brightnessValue = provider.consumeNumberinRange(-1, 1);\n      const brightnessImage = contrastImage.brightness(brightnessValue);\n      const hueValue = provider.consumeNumberinRange(-1, 1);\n      const hueImage = brightnessImage.hue(hueValue);\n      const invertImage = hueImage.invert();\n      const greyscaleImage = invertImage.greyscale();\n      const sepiaImage = greyscaleImage.sepia();\n      const thresholdValue = provider.consumeNumberinRange(0, 1);\n      sepiaImage.threshold(thresholdValue);\n      const pixelColorX = provider.consumeIntegralInRange(0, image.bitmap.width);\n      const pixelColorY = provider.consumeIntegralInRange(0, image.bitmap.height);\n      image.getPixelColor(pixelColorX, pixelColorY);\n      const fontPath = pickRandom([\n        provider.consumeString(128),\n        Jimp.FONT_SANS_8_BLACK,\n        Jimp.FONT_SANS_10_BLACK,\n        Jimp.FONT_SANS_12_BLACK,\n        Jimp.FONT_SANS_14_BLACK,\n        Jimp.FONT_SANS_16_BLACK,\n        Jimp.FONT_SANS_32_BLACK,\n        Jimp.FONT_SANS_64_BLACK,\n        Jimp.FONT_SANS_128_BLACK,\n        Jimp.FONT_SANS_8_WHITE,\n        Jimp.FONT_SANS_16_WHITE,\n        Jimp.FONT_SANS_32_WHITE,\n        Jimp.FONT_SANS_64_WHITE,\n        Jimp.FONT_SANS_128_WHITE,\n      ]);\n      const fontColor = provider.consumeNumber();\n      const fontSize = provider.consumeIntegralInRange(0, 100);\n      const fontX = provider.consumeIntegralInRange(0, image.bitmap.width);\n      const fontY = provider.consumeIntegralInRange(0, image.bitmap.height);\n      const text = provider.consumeString(10);\n      Jimp.loadFont(fontPath).then((font) => {\n        image.print(font, fontX, fontY, text, fontSize, fontColor);\n      });\n\n      const color = Jimp.color([\n        provider.consumeIntegralInRange(0, 256),\n        provider.consumeIntegralInRange(0, 256),\n        provider.consumeIntegralInRange(0, 256),\n        provider.consumeIntegralInRange(0, 256),\n      ]);\n      image.color([\n        { apply: 'hue', params: [provider.consumeNumberinRange(-1, 1)] },\n        { apply: 'lighten', params: [provider.consumeNumberinRange(-1, 1)] },\n        { apply: 'saturate', params: [provider.consumeNumberinRange(-1, 1)] },\n        { apply: 'mix', params: [color, provider.consumeNumberinRange(0, 1)] },\n      ]);\n\n      const filterType = pickRandom([\n        Jimp.AUTO,\n        Jimp.BLUR,\n        Jimp.SHARPEN,\n        Jimp.EDGE_DETECT,\n        Jimp.EMBOSS,\n        Jimp.GAUSSIAN,\n      ]);\n      image.filter(filterType);\n\n      const kernel = [\n        [-1, -1, -1],\n        [-1, 9, -1],\n        [-1, -1, -1],\n      ];\n      image.convolution(kernel);\n\n      const bufferType = pickRandom([\n        Jimp.MIME_PNG,\n        Jimp.MIME_JPEG,\n        Jimp.MIME_BMP,\n        Jimp.MIME_TIFF,\n      ]);\n      image.getBuffer(bufferType);\n\n      const compositeImage = image.clone();\n      const compositeX = provider.consumeIntegralInRange(0, image.bitmap.width);\n      const compositeY = provider.consumeIntegralInRange(0, image.bitmap.height);\n      compositeImage.composite(image, compositeX, compositeY, {\n        mode: pickRandom([\n          Jimp.BLEND_SOURCE_OVER,\n          Jimp.BLEND_DESTINATION_OVER,\n          Jimp.BLEND_MULTIPLY,\n          Jimp.BLEND_ADD,\n          Jimp.BLEND_SCREEN,\n          Jimp.BLEND_OVERLAY,\n          Jimp.BLEND_DARKEN,\n          Jimp.BLEND_LIGHTEN,\n          Jimp.BLEND_HARDLIGHT,\n          Jimp.BLEND_DIFFERENCE,\n          Jimp.BLEND_EXCLUSION]),\n        opacitySource: provider.consumeNumberinRange(-1, 1),\n        opacityDest: provider.consumeNumberinRange(-1, 1),\n      });\n\n      const backgroundColor = Jimp.color([\n        provider.consumeIntegralInRange(0, 256),\n        provider.consumeIntegralInRange(0, 256),\n        provider.consumeIntegralInRange(0, 256),\n        provider.consumeIntegralInRange(0, 256),\n      ]);\n      const backgroundX = provider.consumeIntegralInRange(0, image.bitmap.width);\n      const backgroundY = provider.consumeIntegralInRange(0, image.bitmap.height);\n      const backgroundWidth = provider.consumeIntegralInRange(0, image.bitmap.width - backgroundX);\n      const backgroundHeight = provider.consumeIntegralInRange(0, image.bitmap.height - backgroundY);\n      image.background(backgroundColor, backgroundX, backgroundY, backgroundWidth, backgroundHeight);\n    });\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return Boolean(ignored.find((message) => error.message.indexOf(message) !== -1));\n}\n\nconst ignored = [];\n\nfunction pickRandom(array) {\n  return array[Math.floor(Math.random() * array.length)];\n}\n"
  },
  {
    "path": "projects/jimp/project.yaml",
    "content": "homepage: https://github.com/jimp-dev/jimp\nlanguage: javascript\nmain_repo: https://github.com/jimp-dev/jimp\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jinja2/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN python3 -m pip install --upgrade pip\nRUN python3 -m pip install --upgrade build\nRUN git clone https://github.com/pallets/jinja\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/jinja2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/jinja\npython3 -m build\npip3 install ./dist/jinja*.whl\n\n# Build jinja2 fuzzers\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/jinja2/fuzz_env_jinja_lexer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport traceback\n\nwith atheris.instrument_imports():\n    import jinja2\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    original = fdp.ConsumeString(sys.maxsize)\n\n    # Hit the parser\n    env = jinja2.Environment()\n    try:\n        v1 = env.from_string(original)\n        v1.render()\n    except (jinja2.TemplateSyntaxError, jinja2.UndefinedError, RecursionError, MemoryError) as e:\n        return\n    except Exception as e2:\n        # avoid raising anything that is raise by jinjas \"handle_exception\"\n        tb = traceback.format_exc()\n        if \"handle_exception\" in str(tb):\n            pass\n        else:\n            raise e2\n\n    # Hit tokernizer directly\n    env.lexer.tokenize(original)\n    return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/jinja2/fuzz_jinja_compile_expr.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    import jinja2\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    env = jinja2.Environment()\n    try:\n      v1 = env.compile_expression(fdp.ConsumeString(sys.maxsize))\n    except jinja2.TemplateSyntaxError:\n      return\n    except SyntaxError:\n      return\n    except RecursionError:\n      return\n    except MemoryError:\n      return\n    return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/jinja2/fuzz_jinja_compile_templates.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    from jinja2.environment import Environment\n    from jinja2.loaders import DictLoader\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    template_str = fdp.ConsumeString(sys.maxsize)\n\n    tmp_path = \"/tmp/mytemplates\"\n    temp_file = os.path.join(tmp_path, \"template.jinja2\")\n    if not os.path.isdir(tmp_path):\n        os.mkdir(tmp_path)\n    if os.path.isfile(temp_file):\n        os.remove(temp_file)\n    with open(temp_file, \"wb\") as fd:\n        fd.write(data)\n\n    env = Environment(loader=DictLoader({\"foo\": template_str}))\n    try:\n        env.compile_templates(tmp_path, zip=None)\n    except RecursionError:\n        return\n    return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/jinja2/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pallets/jinja\nlanguage: python\nmain_repo: https://github.com/pallets/jinja\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/jline3/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone --depth 1 https://github.com/jline/jline3 $SRC/jline3\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jline3\n"
  },
  {
    "path": "projects/jline3/LineReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.jline.builtins.ConfigurationPath;\nimport org.jline.builtins.SyntaxHighlighter;\nimport org.jline.console.impl.SystemHighlighter;\nimport org.jline.reader.*;\nimport org.jline.reader.impl.DefaultHighlighter;\nimport org.jline.reader.impl.DefaultParser;\nimport org.jline.terminal.Size;\nimport org.jline.terminal.Terminal;\nimport org.jline.terminal.TerminalBuilder;\n\nimport java.lang.IllegalArgumentException;\n\nimport java.io.*;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\npublic class LineReaderFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        InputStream in = new ByteArrayInputStream(data.consumeBytes(500));\n        OutputStream out = new ByteArrayOutputStream();\n        Path nanorc;\n        try {\n            nanorc = LineReaderFuzzer.generateNanorcFile(data);\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n        SyntaxHighlighter syntaxHighlighter = SyntaxHighlighter.build(nanorc,data.consumeString(50));\n        SyntaxHighlighter argsHighlighter = SyntaxHighlighter.build(nanorc,data.consumeString(50));\n        SyntaxHighlighter groovyHighlighter = SyntaxHighlighter.build(nanorc,data.consumeString(50));\n\n        SystemHighlighter highlighter = new SystemHighlighter(syntaxHighlighter, argsHighlighter, groovyHighlighter);\n        highlighter.addFileHighlight(data.consumeString(50), data.consumeString(50));\n\n        try {\n            Terminal terminal = TerminalBuilder.builder()\n                    .system(data.consumeBoolean())\n                    .streams(in, out)\n                    .name(data.consumeString(100))\n                    .jna(data.consumeBoolean())\n                    .build();\n            terminal.setSize(new Size(data.consumeInt(0, 1000), data.consumeInt(0, 1000)));\n\n            LineReader reader = LineReaderBuilder.builder()\n                    .terminal(terminal)\n                    .highlighter(highlighter)\n                    .parser(new DefaultParser())\n                    .variable(data.consumeString(50), data.consumeString(50))\n                    .build();\n\n            reader.readLine(data.consumeString(500), data.consumeChar());\n        } catch (IOException | EndOfFileException | IllegalArgumentException | UserInterruptException e) {}\n    }\n\n    public static Path generateNanorcFile(FuzzedDataProvider data) throws IOException {\n        Path nanorc = Files.createTempFile(\"nanorc\", \"\");\n        Files.write(nanorc, data.consumeBytes(500));\n        return nanorc;\n    }\n}\n"
  },
  {
    "path": "projects/jline3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n\n$MVN package -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true\n\ncp \"$SRC/jline3/jline/target/jline-$CURRENT_VERSION.jar\" $OUT/\n\nALL_JARS=$(find $OUT/ -name *.jar ! -name jazzer*.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone "
  },
  {
    "path": "projects/jline3/project.yaml",
    "content": "homepage: \"https://github.com/jline/jline3\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/jline/jline3\"\nsanitizers:\n  - address\nvendor_ccs:\n"
  },
  {
    "path": "projects/jmespathpy/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/jmespath/jmespath.py jmespath.py\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/jmespath.py\n"
  },
  {
    "path": "projects/jmespathpy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/jmespathpy/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom jmespath import parser\nfrom jmespath import exceptions\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  p = parser.Parser()\n  try:\n    p.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except exceptions.JMESPathError:\n    pass\n  except RecursionError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/jmespathpy/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/jmespath/jmespath.py\nlanguage: python\nmain_repo: https://github.com/jmespath/jmespath.py\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/jmh/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone https://github.com/openjdk/jmh\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/jmh"
  },
  {
    "path": "projects/jmh/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-Dmaven.compiler.source=15 -Dmaven.compiler.target=15 -DskipTests\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/jmh\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -DjmhVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/jmh-fuzzer-${CURRENT_VERSION}.jar ${OUT}/jmh-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} jmh-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\tstripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\n\techo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif echo \\\"\\$@\\\" | grep -qE '(^| )-runs=[0-9]+($| )'; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/jmh/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>jmh-fuzzer</artifactId>\n\t<version>${jmhVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.openjdk.jmh</groupId>\n\t\t\t<artifactId>jmh-core</artifactId>\n\t\t\t<version>${jmhVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/jmh/project.yaml",
    "content": "homepage: \"https://openjdk.org/projects/code-tools/jmh/\"\nlanguage: jvm\nmain_repo: \"https://github.com/openjdk/jmh\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jmh/src/main/java/ossfuzz/OptionsBuilderFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport java.util.Collection;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.TimeUnit;\n\nimport org.openjdk.jmh.annotations.Mode;\nimport org.openjdk.jmh.results.format.ResultFormatType;\nimport org.openjdk.jmh.runner.BenchmarkListEntry;\nimport org.openjdk.jmh.runner.options.Options;\nimport org.openjdk.jmh.runner.options.OptionsBuilder;\nimport org.openjdk.jmh.runner.options.TimeValue;\nimport org.openjdk.jmh.runner.options.VerboseMode;\nimport org.openjdk.jmh.runner.options.WarmupMode;\n\nimport org.openjdk.jmh.util.Optional;\n\npublic class OptionsBuilderFuzzer {\n\t\n\tFuzzedDataProvider m_fuzzedDataProvider;\n\n\tOptional<Integer> optionalInt() {\n\t\tif (m_fuzzedDataProvider.consumeBoolean()) {\n\t\t\treturn Optional.<Integer>of(m_fuzzedDataProvider.consumeInt(1, 1000));\n\t\t} else {\n\t\t\treturn Optional.<Integer>none();\n\t\t}\n\t}\n\n\tint[] intArray() {\n\t\tint retval[] = new int[m_fuzzedDataProvider.consumeInt(1,1000)];\n\t\tfor (int i=0; i<retval.length; ++i) {\n\t\t\tretval[i] = m_fuzzedDataProvider.consumeInt();\n\t\t}\n\t\treturn retval;\n\t}\n\n\tCollection<String> stringCollection() {\n\t\tArrayList<String> s = new ArrayList<String>();\n\t\tint n = m_fuzzedDataProvider.consumeInt(1,10);\n\t\tfor (int i = 0; i < n; ++i) {\n\t\t\ts.add(m_fuzzedDataProvider.consumeString(16));\n\t\t}\n\t\treturn s;\n\t}\n\n\tOptional<Collection<String>> optionalStringCollection() {\n\t\tif (m_fuzzedDataProvider.consumeBoolean()) {\n\t\t\treturn Optional.<Collection<String>>of(stringCollection());\n\t\t} else {\n\t\t\treturn Optional.<Collection<String>>none();\n\t\t}\n\t}\n\n\tTimeValue timeValue() {\n\t\treturn TimeValue.seconds(m_fuzzedDataProvider.consumeInt());\n\t}\n\n\tOptional<TimeValue> optionalTimeValue() {\n\t\tif (m_fuzzedDataProvider.consumeBoolean()) {\n\t\t\treturn Optional.<TimeValue>of(timeValue());\n\t\t} else {\n\t\t\treturn Optional.<TimeValue>none();\n\t\t}\n\t}\n\n\tVerboseMode verboseModeValue() {\n\t\tVerboseMode modes[] = VerboseMode.values();\n\t\treturn modes[m_fuzzedDataProvider.consumeInt(0, modes.length - 1)];\n\t}\n\n\tResultFormatType resultFormatValue() {\n\t\tswitch(m_fuzzedDataProvider.consumeInt(0,4)) {\n\t\t\tcase 0: return ResultFormatType.TEXT;\n\t\t\tcase 1: return ResultFormatType.CSV;\n\t\t\tcase 2: return ResultFormatType.SCSV;\n\t\t\tcase 3: return ResultFormatType.JSON;\n\t\t\tdefault: return ResultFormatType.LATEX;\n\t\t}\n\t}\n\n\tWarmupMode warmupModeValue() {\n\t\tWarmupMode warmupModes[] = WarmupMode.values();\n\t\treturn warmupModes[m_fuzzedDataProvider.consumeInt(0, warmupModes.length - 1)];\n\t}\n\n\tMode modeValue() {\n\t\tMode modes[] = Mode.values();\n\t\treturn modes[m_fuzzedDataProvider.consumeInt(0, modes.length - 1)];\n\t}\n\n\tTimeUnit timeUnitValue() {\n\t\tTimeUnit tu[] = TimeUnit.values();\n\t\treturn tu[m_fuzzedDataProvider.consumeInt(0, tu.length - 1)];\n\t}\n\t\n\tOptionsBuilderFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tm_fuzzedDataProvider = fuzzedDataProvider;\n\t}\n\n\tString stringValue() {\n\t\treturn m_fuzzedDataProvider.consumeString(16);\n\t}\n\n\tboolean boolValue() {\n\t\treturn m_fuzzedDataProvider.consumeBoolean();\n\t}\n\n\tint intValue() {\n\t\treturn m_fuzzedDataProvider.consumeInt();\n\t}\n\n\tvoid test() {\n\t\ttry {\n\t\t\tOptions options = new OptionsBuilder()\n\t\t\t\t.exclude(stringValue())\n\t\t\t\t.output(stringValue())\n\t\t\t\t.resultFormat(resultFormatValue())\n\t\t\t\t.result(stringValue())\n\t\t\t\t.shouldDoGC(boolValue())\n\t\t\t\t.verbosity(verboseModeValue())\n\t\t\t\t.shouldFailOnError(boolValue())\n\t\t\t\t.threads(intValue())\n\t\t\t\t.threadGroups(intArray())\n\t\t\t\t.syncIterations(boolValue())\n\t\t\t\t.warmupIterations(intValue())\n\t\t\t\t.warmupBatchSize(intValue())\n\t\t\t\t.warmupTime(timeValue())\n\t\t\t\t.warmupMode(warmupModeValue())\n\t\t\t\t.includeWarmup(stringValue())\n\t\t\t\t.measurementIterations(intValue())\n\t\t\t\t.measurementTime(timeValue())\n\t\t\t\t.measurementBatchSize(intValue())\n\t\t\t\t.mode(modeValue())\n\t\t\t\t.timeUnit(timeUnitValue())\n\t\t\t\t.operationsPerInvocation(intValue())\n\t\t\t\t.forks(intValue())\n\t\t\t\t.warmupForks(intValue())\n\t\t\t\t.jvm(stringValue())\n\t\t\t\t.jvmArgs(stringValue())\n\t\t\t\t.jvmArgsAppend(stringValue())\n\t\t\t\t.jvmArgsPrepend(stringValue())\n\t\t\t\t.timeout(timeValue())\n\t\t\t\t.build();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t/* ignore */\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\tOptionsBuilderFuzzer closure = new OptionsBuilderFuzzer(fuzzedDataProvider);\n\t\tclosure.test();\n\t}\n}"
  },
  {
    "path": "projects/joblib/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/joblib/joblib joblib\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/joblib\n"
  },
  {
    "path": "projects/joblib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/joblib/fuzz_serialization_roundtrip.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport joblib\nimport traceback\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_filename = '/tmp/file_to_load'\n  with open(fuzz_filename, 'wb') as fuzz_file:\n    fuzz_file.write(data)\n\n  try:\n    loaded_obj = joblib.load(fuzz_filename)\n  except Exception as e:\n    tb = ''.join(traceback.TracebackException.from_exception(e).format())\n    if \"pickle.py\" in tb:\n      # Ignore exceptions thrown from the pickle level.\n      return\n    raise e\n\n  # Anything loadable should be dumpable\n  joblib.dump(loaded_obj, '/tmp/file_to_dump')\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/joblib/project.yaml",
    "content": "homepage: https://github.com/joblib/joblib\nmain_repo: https://github.com/joblib/joblib\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/joda-convert/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:latest\nRUN apt-get update && apt-get install -y openjdk-21-jdk make autoconf automake libtool wget\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && unzip maven.zip -d $SRC/maven && rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/JodaOrg/joda-convert.git joda-convert\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/joda-convert"
  },
  {
    "path": "projects/joda-convert/FromStringFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.joda.convert.*;\nimport java.io.*;\nimport java.util.*;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\npublic class FromStringFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        StringConvert.INSTANCE.convertFromString(Integer.class, data.consumeRemainingAsString());\n    }\n    catch (java.lang.NumberFormatException e){}\n    catch (java.lang.IllegalArgumentException e){}\n  }\n}"
  },
  {
    "path": "projects/joda-convert/StringConvertFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.joda.convert.StringConvert;\nimport org.joda.convert.factory.ByteObjectArrayStringConverterFactory;\nimport java.util.Arrays;\n\npublic class StringConvertFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      StringConvert test = new StringConvert(data.consumeBoolean(), ByteObjectArrayStringConverterFactory.INSTANCE);\n      Byte[] array = test.convertFromString(Byte[].class, data.consumeRemainingAsString());\n      test.convertToString(array);\n      test.convertToString(Byte[].class, array);\n      test.convertFromString(Byte[].class, test.convertToString(array));\n    }\n    catch (java.lang.NumberFormatException e){}\n    catch (java.lang.IllegalArgumentException e){}\n  }\n}"
  },
  {
    "path": "projects/joda-convert/ToStringFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.joda.convert.*;\nimport java.io.*;\nimport java.util.*;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\npublic class ToStringFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    StringConvert.INSTANCE.convertToString(data.consumeRemainingAsBytes());\n  }\n}"
  },
  {
    "path": "projects/joda-convert/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-21\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-21-openjdk-amd64/\" \"$JAVA_HOME\"\n\n# Skip ProGuard because it is only needed for tests (which are skipped as well) and\n# because it would fail since `jmods` JDK folder is removed from this Docker image\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True -DbannedDependencies.includes.include=org.apache.maven:maven-embedder:jar:4.0.0-alpha-13-SNAPSHOT\"\n$MVN clean package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./ -name \"joda-convert-$CURRENT_VERSION.jar\" -exec mv {} $OUT/joda-convert.jar \\;\n\nALL_JARS=\"joda-convert.jar\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-21/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-21/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/joda-convert/project.yaml",
    "content": "homepage: \"https://github.com/JodaOrg/joda-convert\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/JodaOrg/joda-convert.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address"
  },
  {
    "path": "projects/joda-time/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone https://github.com/JodaOrg/joda-time.git --depth 1 \nWORKDIR joda-time\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/joda-time/TimeFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.joda.time.*;\n\npublic class TimeFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try {\n            DateTimeZone.forID(data.consumeRemainingAsString());\n        } catch (IllegalArgumentException e) {}\n\n        return;\n    }\n}\n\n"
  },
  {
    "path": "projects/joda-time/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed -i 's/1.5</1.7</g' pom.xml\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/joda-time-$CURRENT_VERSION.jar\" $OUT/joda-time.jar\n\nALL_JARS=\"joda-time.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\n\n\n"
  },
  {
    "path": "projects/joda-time/project.yaml",
    "content": "homepage: \"https://github.com/JodaOrg/joda-time\"\nlanguage: jvm\nprimary_contact: \"scolebourne@joda.org\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/JodaOrg/joda-time.git\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jolt/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/bazaarvoice/jolt/ jolt\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jolt\n"
  },
  {
    "path": "projects/jolt/JsonUtilsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.bazaarvoice.jolt.JsonUtils;\nimport com.bazaarvoice.jolt.exception.JsonUnmarshalException;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayInputStream;\nimport java.nio.charset.Charset;\n\n// jvm-autofuzz-heuristics-1\npublic class JsonUtilsFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    // Heuristic name: jvm-autofuzz-heuristics-1\n    Integer choice = data.consumeInt(1, 9);\n\n    try {\n      switch (choice) {\n        case 1:\n          JsonUtils.javason(data.consumeRemainingAsString());\n          break;\n        case 2:\n          JsonUtils.jsonToObject(\n              data.consumeRemainingAsString(), Charset.defaultCharset().toString());\n          break;\n        case 3:\n          JsonUtils.jsonToObject(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n          break;\n        case 4:\n          JsonUtils.jsonToMap(data.consumeRemainingAsString());\n          break;\n        case 5:\n          JsonUtils.jsonToMap(data.consumeRemainingAsString(), Charset.defaultCharset().toString());\n          break;\n        case 6:\n          JsonUtils.jsonToMap(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n          break;\n        case 7:\n          JsonUtils.jsonToList(data.consumeRemainingAsString());\n          break;\n        case 8:\n          JsonUtils.jsonToList(\n              data.consumeRemainingAsString(), Charset.defaultCharset().toString());\n          break;\n        case 9:\n          JsonUtils.jsonToList(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n          break;\n        default:\n          break;\n      }\n    } catch (JsonUnmarshalException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jolt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport TARGET_PACKAGE_PREFIX=\"com.bazaarvoice.jolt.\"\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15 --update-snapshots\"\n$MVN clean -pl \"!cli,!guice\" package $MAVEN_ARGS\n\nBUILD_CLASSPATH=\nRUNTIME_CLASSPATH=\n\nfor JARFILE in $(find ./ -name *.jar)\ndo\n  cp $JARFILE $OUT/\n  BUILD_CLASSPATH=$BUILD_CLASSPATH$OUT/$(basename $JARFILE):\n  RUNTIME_CLASSPATH=$RUNTIME_CLASSPATH\\$this_dir/$(basename $JARFILE):\ndone\n\n# Retrieve apache-common-lang3 library\n# This library provides method to translate primitive type arrays to\n# their respective class object arrays to avoid compilation error.\nwget -P $OUT/ https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar\nwget -P $OUT/ https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.2/jackson-databind-2.15.2.jar\nwget -P $OUT/ https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2.jar\nwget -P $OUT/ https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.2/jackson-annotations-2.15.2.jar\n\nBUILD_CLASSPATH=$BUILD_CLASSPATH:$JAZZER_API_PATH:$OUT/commons-lang3-3.12.0.jar:$OUT/jackson-databind-2.15.2.jar:$OUT/jackson-core-2.15.2.jar:$OUT/jackson-annotations-2.15.2.jar\nRUNTIME_CLASSPATH=$RUNTIME_CLASSPATH:\\$this_dir/commons-lang3-3.12.0.jar:\\$this_dir/jackson-databind-2.15.2.jar:\\$this_dir/jackson-core-2.15.2.jar:\\$this_dir/jackson-annotations-2.15.2.jar:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jolt/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/bazaarvoice/jolt\nlanguage: jvm\nmain_repo: https://github.com/bazaarvoice/jolt\nsanitizers:\n- address\nvendor_ccs:\n- arthur.chan@adalogics.com\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/joni/AddrListFixFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.joni.Regex;\nimport org.joni.Syntax;\nimport org.joni.UnsetAddrList;\nimport org.joni.exception.InternalException;\nimport org.joni.exception.SyntaxException;\nimport org.jcodings.exception.CharacterPropertyException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.joni.UnsetAddrList] public void fix(org.joni.Regex)\npublic class AddrListFixFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    UnsetAddrList obj = new UnsetAddrList(data.consumeInt(0, 1000));\n    try {\n      obj.fix(new Regex(data.consumeRemainingAsString()));\n    } catch (SyntaxException | CharacterPropertyException | InternalException | IllegalArgumentException e) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/joni/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/jruby/joni joni\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/joni\n"
  },
  {
    "path": "projects/joni/RegexMatcherFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.joni.Matcher;\nimport org.joni.Regex;\nimport org.joni.Syntax;\nimport org.joni.exception.InternalException;\nimport org.joni.exception.SyntaxException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.joni.Regex] public org.joni.Matcher matcher(byte[],int,int)\npublic class RegexMatcherFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      Integer int1 = data.consumeInt();\n      Integer int2 = data.consumeInt();\n      Regex obj = new Regex(data.consumeString(data.remainingBytes() / 2));\n      obj.matcher(data.consumeRemainingAsBytes(), int1, int2);\n    } catch (SyntaxException | InternalException | IllegalArgumentException e) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/joni/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false dependency:copy-dependencies\n\nJARFILE_LIST=\nfor JARFILE in $(find ./target  -name *.jar)\ndo\n  cp $JARFILE $OUT/\n  JARFILE_LIST=\"$JARFILE_LIST$(basename $JARFILE) \"\ndone\n\ncurr_dir=$PWD\nrm -rf $OUT/jar_temp\nmkdir $OUT/jar_temp\ncd $OUT/jar_temp\nfor JARFILE in $JARFILE_LIST\ndo\n  jar -xf $OUT/$JARFILE\ndone\ncd $curr_dir\n\nBUILD_CLASSPATH=$JAZZER_API_PATH:$OUT/jar_temp\nRUNTIME_CLASSPATH=\\$this_dir/jar_temp:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \"\\$0\")\nif [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\nthen\nmem_settings='-Xmx1900m:-Xss900k'\nelse\nmem_settings='-Xmx2048m:-Xss1024k'\nfi\n\nLD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir         \\\n  \\$this_dir/jazzer_driver                                \\\n  --agent_path=\\$this_dir/jazzer_agent_deploy.jar         \\\n  --cp=$RUNTIME_CLASSPATH                                 \\\n  --target_class=$fuzzer_basename                         \\\n  --jvm_args=\"\\$mem_settings\"                             \\\n  \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/joni/project.yaml",
    "content": "homepage: https://github.com/jruby/joni\nmain_repo: https://github.com/jruby/joni\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/jooq/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN curl -L https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_linux-x64_bin.tar.gz -o jdk.tar.gz && \\\n    tar zxf jdk.tar.gz && \\\n    rm -rf jdk.tar.gz\n\nRUN curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip -o protoc.zip && mkdir -p $SRC/protoc && unzip protoc.zip -d $SRC/protoc && rm -rf protoc.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.2/bin/mvn\nENV JAVA_HOME=\"$SRC/jdk-21.0.2\"\nENV PATH=\"$JAVA_HOME/bin:$SRC/protoc/bin:$PATH\"\nRUN git clone --depth 1 https://github.com/jOOQ/jOOQ.git jooq\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/jooq\n"
  },
  {
    "path": "projects/jooq/GenerationToolFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.jooq.codegen.GeneratorException;\nimport org.jooq.codegen.GenerationTool;\nimport org.jooq.exception.ConfigurationException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.jooq.codegen.GenerationTool] public static void generate(java.lang.String) throws java.lang.Exception\npublic class GenerationToolFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) throws Exception {\n    try {\n      GenerationTool.generate(data.consumeRemainingAsString());\n    } catch (ConfigurationException | GeneratorException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jooq/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nchmod +x $SRC/protoc/bin/protoc\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True -pl jOOQ -pl jOOQ-meta -pl jOOQ-codegen \\\n    dependency:copy-dependencies\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./jOOQ/target/jooq-$CURRENT_VERSION.jar\" $OUT/jooq.jar\ncp \"./jOOQ-meta/target/jooq-meta-$CURRENT_VERSION.jar\" $OUT/jooq-meta.jar\ncp \"./jOOQ-codegen/target/jooq-codegen-$CURRENT_VERSION.jar\" $OUT/jooq-codegen.jar\n\nJARFILE_LIST=\nfor JARFILE in $(find ./*/target/dependency  -name *.jar)\ndo\n   cp $JARFILE $OUT/\n   JARFILE_LIST=\"$JARFILE_LIST$(basename $JARFILE) \"\ndone\n\ncurr_dir=$(pwd)\nrm -rf $OUT/jar_temp\nmkdir $OUT/jar_temp\ncd $OUT/jar_temp\nfor JARFILE in $JARFILE_LIST\ndo\n  jar -xf $OUT/$JARFILE\ndone\n\ncd $curr_dir\n\nALL_JARS='jooq.jar jooq-meta.jar jooq-codegen.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH:$OUT/jar_temp\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir:\\$this_dir/jar_temp\n\ncp -r $JAVA_HOME $OUT/\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  $JAVA_HOME/bin/javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  export JAVA_HOME=\\$this_dir/$(basename $JAVA_HOME)\n  export LD_LIBRARY_PATH=\"\\$JAVA_HOME/lib/server\":\\$this_dir\n  export PATH=\\$JAVA_HOME/bin:\\$PATH\n\n  \\$this_dir/jazzer_driver                          \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jooq/project.yaml",
    "content": "homepage: https://github.com/jOOQ/jOOQ.git\nmain_repo: https://github.com/jOOQ/jOOQ.git\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/jopt-simple/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.6.3 && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven-3.6.3/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone \"https://github.com/jopt-simple/jopt-simple.git\"\n\n# Add pom.xml before copying\nADD pom.xml ${SRC}/jopt-simple/\n\nADD build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/jopt-simple\n"
  },
  {
    "path": "projects/jopt-simple/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-DskipTests\"\nALL_JARS=\"\"\nLIBRARY_NAME=\"jopt-simple\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}\"\n    # Compile and package the project\n\t${MVN} clean package ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  \t\t-Dexpression=project.version -q -DforceStdout)\n    \n    # Log contents of target directory for debug\n    echo \"Contents of target directory:\"\n    ls target/\n    \n    # Directly hard code the target jar name based on existing listing\n    TARGET_JAR=\"target/jopt-simple-fuzzer-${CURRENT_VERSION}.jar\"\n    if [[ ! -f \"$TARGET_JAR\" ]]; then\n        echo \"ERROR: Expected target jar not found!\"\n        exit 1\n    fi\n\n    # Log the found jar\n    echo \"Target jar found: $TARGET_JAR\"\n\n    # Install the jar\n\t${MVN} ${MVN_FLAGS} install:install-file -Dfile=${TARGET_JAR} \\\n\t\t-DgroupId=\"net.sf.jopt-simple\" \\\n\t\t-DartifactId=\"jopt-simple\" \\\n\t\t-Dversion=\"${CURRENT_VERSION}\" \\\n\t\t-Dpackaging=jar\n\n    # Execute second Maven command in correct directory\n    ${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n    install -v ${TARGET_JAR} ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n    ALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\n\n    # Ensure `OptionParserFuzzer` is included in classpath\n    FUZZER_CLASSPATH=\"$OUT/jopt-simple-fuzzer-${CURRENT_VERSION}.jar:$JAZZER_API_PATH\"\n\n    for fuzzer in $(find ${SRC}/src/main/java/ossfuzz -name '*.java'); do\n        # Compile fuzzer into jar if not present\n        javac -cp $FUZZER_CLASSPATH -d $OUT $fuzzer || echo \"Compilation of $fuzzer failed\"\n    done\n\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|');\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$@\\\"\" > $OUT/$(basename -s .java $fuzzer).sh\n\tchmod +x $OUT/$(basename -s .java $fuzzer).sh\ndone"
  },
  {
    "path": "projects/jopt-simple/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>jopt-simple-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>17</maven.compiler.source>\n\t\t<maven.compiler.target>17</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>6.0-alpha-3</fuzzedLibaryVersion>\n\t\t<exec.mainClass>ossfuzz.OptionParserFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>net.sf.jopt-simple</groupId>\n\t\t\t<artifactId>jopt-simple</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<!-- JUnit Jupiter for testing -->\n\t\t<dependency>\n\t\t\t<groupId>org.junit.jupiter</groupId>\n\t\t\t<artifactId>junit-jupiter-api</artifactId>\n\t\t\t<version>5.8.1</version>\n\t\t\t<scope>test</scope>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.junit.jupiter</groupId>\n\t\t\t<artifactId>junit-jupiter-engine</artifactId>\n\t\t\t<version>5.8.1</version>\n\t\t\t<scope>test</scope>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.junit.jupiter</groupId>\n\t\t\t<artifactId>junit-jupiter-params</artifactId>\n\t\t\t<version>5.8.1</version>\n\t\t\t<scope>test</scope>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/jopt-simple/project.yaml",
    "content": "homepage: \"http://jopt-simple.github.io/jopt-simple/\"\nlanguage: jvm\nmain_repo: \"https://github.com/jopt-simple/jopt-simple.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\ndisabled: true\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jopt-simple/src/main/java/ossfuzz/OptionParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport joptsimple.OptionParser;\nimport joptsimple.OptionSet;\nimport joptsimple.OptionException;\nimport java.util.Date;\nimport java.util.ArrayList;\n\npublic class OptionParserFuzzer {\n\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic OptionParserFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\n\t}\n\n\tvoid test() {\n\t\ttry {\n\t\t\tOptionParser parser = new OptionParser();\n\t\t\tvar list = new ArrayList();\n\t\t\tfor (int i = 0; i < fuzzedDataProvider.consumeInt(0, 10); i ++)\n\t\t\t{\n\t\t\t\tlist.add(fuzzedDataProvider.consumeString(100));\n\t\t\t}\n\n\t\t\tparser.accepts(fuzzedDataProvider.consumeString(100)).withOptionalArg().ofType(Integer.class);\n\t\t\tparser.accepts(fuzzedDataProvider.consumeString(100)).withOptionalArg().ofType(Boolean.class);\n\t\t\tparser.accepts(fuzzedDataProvider.consumeString(100)).withOptionalArg().ofType(String.class);\n\t\t\tparser.accepts(fuzzedDataProvider.consumeString(100)).withOptionalArg().ofType(Float.class);\n\t\t\tparser.accepts(fuzzedDataProvider.consumeString(100)).withOptionalArg().ofType(Date.class);\n\t\t\tparser.accepts(fuzzedDataProvider.consumeString(100));\n\t\t\tparser.acceptsAll(list);\n\t\t\tparser.parse(fuzzedDataProvider.consumeRemainingAsString());\n\t\t} catch (IllegalArgumentException e) {\n\n\t\t} catch (OptionException e) {\n\n\t\t}\n\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tOptionParserFuzzer fixture = new OptionParserFuzzer(fuzzedDataProvider);\n\t\tfixture.test();\n\t}\n}"
  },
  {
    "path": "projects/jose4j/.gitignore",
    "content": "project-parent/jose4j\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/jose4j/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/json.dict $SRC/JsonUtilFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/JsonUtilFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/jose4j\nRUN git clone --depth 1 https://bitbucket.org/b_c/jose4j/src/master/ $SRC/project-parent/jose4j\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/jose4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=jose4j\nPROJECT_GROUP_ID=org.bitbucket.b_c\nPROJECT_ARTIFACT_ID=jose4j\nMAIN_REPOSITORY=https://bitbucket.org/b_c/jose4j/src/master/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/jose4j/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.bitbucket.b_c</groupId>\n            <artifactId>jose4j</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/jose4j/project-parent/fuzz-targets/src/test/java/com/example/JsonUtilFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.jose4j.json.JsonUtil;\nimport org.jose4j.lang.JoseException;\n\nimport java.util.*;\nimport java.io.Serializable;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\n\n\npublic class JsonUtilFuzzer {\n    @FuzzTest\n    public void myFuzzTest(FuzzedDataProvider data) {\n        String json = data.consumeRemainingAsString();\n        try {\n            JsonUtil.parseJson(json);\n        } catch (JoseException e) {\n        }\n    }\n}\n\n"
  },
  {
    "path": "projects/jose4j/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>jose4j</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/jose4j/project.yaml",
    "content": "homepage: \"https://bitbucket.org/b_c/jose4j/wiki/Home\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://bitbucket.org/b_c/jose4j/src/master/\"\nsanitizers:\n  - address\nprimary_contact: \"brian.d.campbell@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jpeg-js/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/jpeg-js/jpeg-js\n\nCOPY fuzz_encode.js $SRC/jpeg-js\nCOPY fuzz_decode.js $SRC/jpeg-js\n\nWORKDIR $SRC/jpeg-js"
  },
  {
    "path": "projects/jpeg-js/build.sh",
    "content": "#!/bin/bash\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nnpm install --save-dev @jazzer.js/core \nnpm i\n\n# Build Fuzzers.\ncompile_javascript_fuzzer jpeg-js fuzz_encode.js -i jpeg-js --sync\ncompile_javascript_fuzzer jpeg-js fuzz_decode.js -i jpeg-js --sync"
  },
  {
    "path": "projects/jpeg-js/fuzz_decode.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst jpeg = require(\"./index\");\n\nmodule.exports.fuzz = function (data) {\n    const provider = new FuzzedDataProvider(data);\n\n    try {\n        jpeg.decode(provider.consumeBytes(provider.consumeIntegralInRange(0, 2**48-1)),\n            {useTArray: provider.consumeBoolean(),\n                colorTransform: provider.consumeBoolean(),\n                formatAsRGBA: provider.consumeBoolean(),\n                tolerantDecoding: provider.consumeBoolean()}\n        );\n    } catch (error) {\n        // Catch all errors to find more critical bugs.\n    }\n};\n"
  },
  {
    "path": "projects/jpeg-js/fuzz_encode.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst jpeg = require(\"./index\");\n\nmodule.exports.fuzz = function (data) {\n    const provider = new FuzzedDataProvider(data);\n\n    var width = provider.consumeIntegralInRange(0, 2**48-1),\n        height = provider.consumeIntegralInRange(0, 2**48-1),\n        quality = provider.consumeIntegralInRange(0, 2**48-1);\n    var frameData = provider.consumeRemainingAsBytes();\n    var rawImageData = {\n        data: frameData,\n        width: width,\n        height: height,\n    };\n\n    try {\n        var jpegImageData = jpeg.encode(rawImageData, quality);\n    } catch (error) {\n        // Catch all errors to find critical bugs.\n    }\n};"
  },
  {
    "path": "projects/jpeg-js/project.yaml",
    "content": "homepage: https://github.com/jpeg-js/jpeg-js\nlanguage: javascript\nmain_repo: https://github.com/jpeg-js/jpeg-js\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jpegoptim/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nENV DEBIAN_FRONTEND=noninteractive\nENV ASAN_OPTIONS=detect_leaks=0\nRUN apt update && apt install -y cmake make\nRUN git clone --depth 1 https://github.com/tjko/jpegoptim.git jpegoptim \\\n    && cp jpegoptim/fuzz/build.sh $SRC/\nRUN for script in jpegoptim/fuzz/libjpeg_builders/*.sh; do \\\n        bash \"$script\"; \\\n    done\nWORKDIR jpegoptim\n"
  },
  {
    "path": "projects/jpegoptim/project.yaml",
    "content": "homepage: \"https://www.kokkonen.net/tjko/projects.html\"\nlanguage: c\nprimary_contact: \"tjko@iki.com\"\nauto_ccs:\n  - \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/tjko/jpegoptim.git\"\nfuzzing_engines:\n    - libfuzzer\n    - afl\n    - honggfuzz\n"
  },
  {
    "path": "projects/jq/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n  make flex bison libtool automake autoconf\n\nRUN git clone --depth 1 https://github.com/jqlang/jq\nWORKDIR $SRC/jq\nCOPY run_tests.sh build.sh *.dict $SRC/\n"
  },
  {
    "path": "projects/jq/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit submodule init\ngit submodule update\nautoreconf -fi\n./configure --with-oniguruma=builtin\nmake -j$(nproc)\n\n$CC $CFLAGS -c tests/jq_fuzz_parse.c \\\n    -I./src -o ./jq_fuzz_parse.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./jq_fuzz_parse.o \\\n    ./.libs/libjq.a ./vendor/oniguruma/src/.libs/libonig.a \\\n    -o $OUT/jq_fuzz_parse -I./src\n\n$CC $CFLAGS -c tests/jq_fuzz_compile.c \\\n    -I./src -o ./jq_fuzz_compile.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./jq_fuzz_compile.o \\\n    ./.libs/libjq.a ./vendor/oniguruma/src/.libs/libonig.a \\\n    -o $OUT/jq_fuzz_compile -I./src\n\n$CC $CFLAGS -c tests/jq_fuzz_load_file.c \\\n    -I./src -o ./jq_fuzz_load_file.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./jq_fuzz_load_file.o \\\n    ./.libs/libjq.a ./vendor/oniguruma/src/.libs/libonig.a \\\n    -o $OUT/jq_fuzz_load_file -I./src\n\n$CC $CFLAGS -c tests/jq_fuzz_parse_extended.c \\\n    -I./src -o ./jq_fuzz_parse_extended.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./jq_fuzz_parse_extended.o \\\n    ./.libs/libjq.a ./vendor/oniguruma/src/.libs/libonig.a \\\n    -o $OUT/jq_fuzz_parse_extended -I./src\n\n$CC $CFLAGS -c tests/jq_fuzz_parse_stream.c \\\n    -I./src -o ./jq_fuzz_parse_stream.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./jq_fuzz_parse_stream.o \\\n    ./.libs/libjq.a ./vendor/oniguruma/src/.libs/libonig.a \\\n    -o $OUT/jq_fuzz_parse_stream -I./src\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./tests/jq_fuzz_execute.cpp \\\n    -I./src -I./vendor/oniguruma/src \\\n    ./.libs/libjq.a ./vendor/oniguruma/src/.libs/libonig.a\\\n    -o $OUT/jq_fuzz_execute -I./src\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./tests/jq_fuzz_fixed.cpp \\\n    -I./src \\\n    ./.libs/libjq.a ./vendor/oniguruma/src/.libs/libonig.a \\\n    -o $OUT/jq_fuzz_fixed -I./src\n\n\n# Build corpus\nmkdir $SRC/seeds\nfind . -name \"*.jq\" -exec cp {} $SRC/seeds/ \\;\nzip -rj $OUT/jq_fuzz_execute_seed_corpus.zip $SRC/seeds/\n\n# Copy dictionary\ncp $SRC/jq.dict $OUT/jq_fuzz_execute.dict\n"
  },
  {
    "path": "projects/jq/jq.dict",
    "content": "\"acos\"\n\"acosh\"\n\"add\"\n\"all\"\n\"any\"\n\"arrays\"\n\"ascii_downcase\"\n\"ascii_upcase\"\n\"asin\"\n\"asinh\"\n\"atan\"\n\"atan2\"\n\"atanh\"\n\"booleans\"\n\"bsearch\"\n\"builtins\"\n\"capture\"\n\"cbrt\"\n\"ceil\"\n\"combinations\"\n\"contains\"\n\"copysign\"\n\"cos\"\n\"cosh\"\n\"debug\"\n\"del\"\n\"delpaths\"\n\"drem\"\n\"empty\"\n\"endswith\"\n\"env\"\n\"erf\"\n\"erfc\"\n\"error\"\n\"error\"\n\"exp\"\n\"exp10\"\n\"exp2\"\n\"explode\"\n\"expm1\"\n\"fabs\"\n\"fdim\"\n\"finites\"\n\"first\"\n\"first\"\n\"flatten\"\n\"floor\"\n\"fma\"\n\"fmax\"\n\"fmin\"\n\"fmod\"\n\"format\"\n\"frexp\"\n\"fromdate\"\n\"fromdateiso8601\"\n\"from_entries\"\n\"fromjson\"\n\"fromstream\"\n\"gamma\"\n\"get_jq_origin\"\n\"getpath\"\n\"get_prog_origin\"\n\"get_search_list\"\n\"gmtime\"\n\"group_by\"\n\"gsub\"\n\"halt\"\n\"halt_error\"\n\"halt_error\"\n\"has\"\n\"hypot\"\n\"implode\"\n\"in\"\n\"IN\"\n\"index\"\n\"INDEX\"\n\"indices\"\n\"infinite\"\n\"input\"\n\"input_filename\"\n\"input_line_number\"\n\"inputs\"\n\"inside\"\n\"isempty\"\n\"isfinite\"\n\"isinfinite\"\n\"isnan\"\n\"isnormal\"\n\"iterables\"\n\"j0\"\n\"j1\"\n\"jn\"\n\"join\"\n\"JOIN\"\n\"keys\"\n\"keys_unsorted\"\n\"last\"\n\"last\"\n\"ldexp\"\n\"leaf_paths\"\n\"length\"\n\"lgamma\"\n\"lgamma_r\"\n\"limit\"\n\"localtime\"\n\"log\"\n\"log10\"\n\"log1p\"\n\"log2\"\n\"logb\"\n\"ltrimstr\"\n\"map\"\n\"map_values\"\n\"match\"\n\"max\"\n\"max_by\"\n\"min\"\n\"min_by\"\n\"mktime\"\n\"modf\"\n\"modulemeta\"\n\"nan\"\n\"nearbyint\"\n\"nextafter\"\n\"nexttoward\"\n\"normals\"\n\"not\"\n\"now\"\n\"nth\"\n\"nth\"\n\"nulls\"\n\"numbers\"\n\"objects\"\n\"path\"\n\"paths\"\n\"pow\"\n\"pow10\"\n\"range\"\n\"range\"\n\"range\"\n\"recurse\"\n\"recurse_down\"\n\"remainder\"\n\"repeat\"\n\"reverse\"\n\"rindex\"\n\"rint\"\n\"round\"\n\"rtrimstr\"\n\"scalars\"\n\"scalars_or_empty\"\n\"scalb\"\n\"scalbln\"\n\"scan\"\n\"select\"\n\"setpath\"\n\"significand\"\n\"sin\"\n\"sinh\"\n\"sort\"\n\"sort_by\"\n\"split\"\n\"split\"\n\"splits\"\n\"sqrt\"\n\"startswith\"\n\"stderr\"\n\"strflocaltime\"\n\"strftime\"\n\"strings\"\n\"strptime\"\n\"sub\"\n\"tan\"\n\"tanh\"\n\"test\"\n\"tgamma\"\n\"todate\"\n\"todateiso8601\"\n\"to_entries\"\n\"tojson\"\n\"tonumber\"\n\"tostream\"\n\"tostring\"\n\"transpose\"\n\"trunc\"\n\"truncate_stream\"\n\"type\"\n\"unique\"\n\"unique_by\"\n\"until\"\n\"utf8bytelength\"\n\"values\"\n\"walk\"\n\"while\"\n\"with_entries\"\n\"y0\"\n\"y1\"\n\"yn\"\n"
  },
  {
    "path": "projects/jq/project.yaml",
    "content": "homepage: \"https://jqlang.github.io/jq\"\nmain_repo: \"https://github.com/jqlang/jq\"\nlanguage: c\nprimary_contact: \"cryptonector@gmail.com\"\nauto_ccs :\n - \"torreemanuele6@gmail.com\"\n - \"pkoppstein@gmail.com\"\n - \"david@adalogics.com\"\n - \"mattias.wadman@gmail.com\"\n"
  },
  {
    "path": "projects/jq/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./tests/setup && ./tests/base64test && ./tests/jq-f-test.sh && \\\n./tests/jqtest && ./tests/manonigtest && ./tests/mantest && \\\n./tests/onigtest && ./tests/optionaltest && ./tests/uritest && \\\n./tests/utf8test\n"
  },
  {
    "path": "projects/js-yaml/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN  git clone --depth 1 https://github.com/nodeca/js-yaml\n\nCOPY fuzz.js $SRC/js-yaml\n\nWORKDIR $SRC/js-yaml\n"
  },
  {
    "path": "projects/js-yaml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer js-yaml fuzz.js -i js-yaml --sync\n"
  },
  {
    "path": "projects/js-yaml/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst yaml = require('./index');\n\nmodule.exports.fuzz = function(data) {\n  const provider = new FuzzedDataProvider(data);\n  const loadOptions = generateRandomLoadOptions(provider);\n  const dumpOptions = generateRandomDumpOptions(provider);\n  const yamlString = provider.consumeRemainingAsString();\n\n\n  try {\n    const parsedYaml = yaml.load(yamlString, loadOptions);\n    const _serializedYaml = yaml.dump(parsedYaml, dumpOptions);\n  } catch (e) {\n    if (!(e instanceof yaml.YAMLException)) {\n      throw e\n    }\n  }\n};\n\n\nfunction generateRandomLoadOptions(provider) {\n  const options = {};\n  options.schema = getSchema(provider.consumeIntegralInRange(0, 3));\n  options.json = provider.consumeBoolean();\n  return options;\n}\n\nfunction generateRandomDumpOptions(provider) {\n  const options = {};\n  options.indent = provider.consumeIntegralInRange(0, 4096);\n  options.skipInvalid = provider.consumeBoolean();\n  options.flowLevel = provider.consumeIntegralInRange(-1, 100);\n  options.schema = getSchema(provider.consumeIntegralInRange(0, 3));\n  options.sortKeys = provider.consumeBoolean();\n  options.lineWidth = provider.consumeIntegralInRange(0, 4096);\n  options.noRefs = provider.consumeBoolean();\n  options.noCompatMode = provider.consumeBoolean();\n  options.condenseFlow = provider.consumeBoolean();\n  options.forceQuotes = provider.consumeBoolean();\n  return options;\n}\n\n\nfunction getSchema(number) {\n  switch (number) {\n    case 0: return yaml.DEFAULT_SCHEMA\n    case 1: return yaml.FAILSAFE_SCHEMA\n    case 2: return yaml.JSON_SCHEMA\n    case 3: return yaml.CORE_SCHEMA\n  }\n}\n"
  },
  {
    "path": "projects/js-yaml/project.yaml",
    "content": "homepage: https://github.com/nodeca/js-yaml\nlanguage: javascript\nmain_repo: https://github.com/nodeca/js-yaml\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jsc/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool python ruby ninja-build bison flex gperf wget\n\nRUN git clone --depth 1 https://github.com/WebKit/WebKit.git\nRUN wget https://github.com/unicode-org/icu/releases/download/release-74-1/icu4c-74_1-src.tgz && tar xzvf icu4c-74_1-src.tgz\nWORKDIR WebKit\nCOPY build.sh $SRC\n"
  },
  {
    "path": "projects/jsc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport DEPS_PATH=/src/deps\nmkdir $DEPS_PATH\n\n# build ICU for linking statically.\ncd $SRC/icu/source\n./configure --disable-shared --enable-static --disable-layoutex \\\n  --disable-tests --disable-samples --with-data-packaging=static --prefix=$DEPS_PATH\nmake install -j$(nproc)\n\n# Ugly ugly hack to get static linking to work for icu.\ncd $DEPS_PATH/lib\nls *.a | xargs -n1 ar x\nrm *.a\nar r libicu.a *.{ao,o}\nln -s libicu.a libicudata.a\nln -s libicu.a libicuuc.a\nln -s libicu.a libicui18n.a\n\nexport CFLAGS=\"$CFLAGS -DU_STATIC_IMPLEMENTATION\"\nexport CXXFLAGS=\"$CXXFLAGS -DU_STATIC_IMPLEMENTATION\"\nexport ICU_ROOT=$DEPS_PATH\n\ncd $SRC/WebKit\nTools/Scripts/build-jsc \\\n  --debug \\\n  --jsc-only \\\n  --cmakeargs=\"-DENABLE_STATIC_JSC=ON -DUSE_THIN_ARCHIVES=OFF -DWEBKIT_LIBRARIES_DIR=$DEPS_PATH -DWEBKIT_LIBRARIES_INCLUDE_DIR=$DEPS_PATH/include -DWEBKIT_LIBRARIES_LINK_DIR=$DEPS_PATH/lib\" \\\n  --makeargs='-v'\n\ncp WebKitBuild/JSCOnly/Debug/bin/jsc $OUT\n"
  },
  {
    "path": "projects/jsc/project.yaml",
    "content": "homepage: https://webkit.org/\nlanguage: c++\nprimary_contact: \"ddkilzer@apple.com\"\nauto_ccs:\n  - \"mark.lam@apple.com\"\n  - \"ddkilzer@apple.com\"\n  - \"jfb@chromium.org\"\n  - \"product-security@apple.com\"\n  - \"sbarati@apple.com\"\n  - \"simon.lewis@apple.com\"\n  - \"ysuzuki@apple.com\"\n  - \"dkishore@apple.com\"\n  - \"phan@apple.com\"\n  - \"ebanniettis@apple.com\"\n  - \"jm.park@apple.com\"\n  - \"james_e_kim@apple.com\"\n  - \"rding23@apple.com\"\n  - \"albassam@apple.com\"\n  - \"zakr@apple.com\"\n  - \"roberto_rodriguez2@apple.com\"\n  - \"k_monsen@apple.com\"\n  - \"nnothstine@apple.com\"\nfuzzing_engines:\n  - none\nsanitizers:\n  - address\nblackbox: true\nmain_repo: 'https://github.com/WebKit/WebKit.git'\n"
  },
  {
    "path": "projects/jsch/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get update && apt-get install -y xmlstarlet curl unzip zip \\\n    && mkdir -p ~/.m2 \\\n    && xmlstarlet ed -u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \"${SRC}/maven-settings.xml\" > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip \\\n\t&& unzip maven.zip -d $SRC/maven-3.9.11 \\\n\t&& rm -rf maven.zip\nENV MVN=$SRC/maven-3.9.11/apache-maven-3.9.11/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip \\\n    && unzip gradle.zip -d $SRC/gradle \\\n    && rm -rf gradle.zip\nENV GRADLE=$SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME=jsch\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/mwiede/jsch ${LIBRARY_NAME}\n\n#\n# Install SDKMAN! and use it to install the required JDK version\n#\nRUN curl -s \"https://get.sdkman.io\" | bash && \\\n    /bin/bash -c \"source /root/.sdkman/bin/sdkman-init.sh && \\\n    sdk install java 24.0.1-open && \\\n    sdk use java 24.0.1-open\"\n\nENV JAVA_HOME=/root/.sdkman/candidates/java/current\nENV PATH=\"$JAVA_HOME/bin:$PATH\"\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}\n"
  },
  {
    "path": "projects/jsch/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_SUBDIR=\"\"\nMVN_FLAGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.14.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}/${SRC_SUBDIR}\"\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/jsch/jsch-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>jsch-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>0.2.7</fuzzedLibaryVersion>\n\t\t<exec.mainClass>com.sun.xml.rpc.processor.modeler.rmi.SOAPSimpleTypeCreatorFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.14.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.14.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>com.github.mwiede</groupId>\n\t\t\t<artifactId>jsch</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/jsch/jsch-fuzzer/src/main/java/com/jcraft/jsch/OpenSSHConfigFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.jcraft.jsch;\n\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.jcraft.jsch.OpenSSHConfig;\n\n\npublic class OpenSSHConfigFuzzer {\n\n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public OpenSSHConfigFuzzer(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        this.fuzzedDataProvider = fuzzedDataProvider;\n    }\n\n    void test() {\n        try {\n            OpenSSHConfig config = OpenSSHConfig.parse(fuzzedDataProvider.consumeRemainingAsString());\n        } catch (IOException exception) {\n            /* ignore */\n        } catch (IllegalArgumentException excepion) {\n            /* ignore */\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider)  throws Exception {\n\n        OpenSSHConfigFuzzer fixture = new OpenSSHConfigFuzzer(fuzzedDataProvider);\n        fixture.test();\n    }\n}"
  },
  {
    "path": "projects/jsch/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/jsch/project.yaml",
    "content": "homepage: \"https://github.com/mwiede/jsch\"\nlanguage: jvm\nmain_repo: \"https://github.com/mwiede/jsch\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jsemver/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/zafarkhaja/jsemver jsemver\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/jsemver\n"
  },
  {
    "path": "projects/jsemver/VersionFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.github.zafarkhaja.semver.Version;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [com.github.zafarkhaja.semver.Version] public static boolean isValid(java.lang.String)\npublic class VersionFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Version.isValid(data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/jsemver/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/java-semver-$CURRENT_VERSION.jar\" $OUT/jsemver.jar\n\nALL_JARS=\"jsemver.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir     \\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar     --cp=$RUNTIME_CLASSPATH     --target_class=$fuzzer_basename     --jvm_args=\"\\$mem_settings\"     \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jsemver/project.yaml",
    "content": "homepage: https://github.com/zafarkhaja/jsemver\nmain_repo: https://github.com/zafarkhaja/jsemver\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/jsign/AuthenticodeAppxSignerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.security.KeyStore;\n\nimport net.jsign.AuthenticodeSigner;\nimport net.jsign.appx.APPXFile;\n\npublic class AuthenticodeAppxSignerFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] data) throws Exception {\n        File file = File.createTempFile(\"jsign-fuzzer\", \"msix\");\n        file.deleteOnExit();\n        Files.write(file.toPath(), data);\n\n        KeyStore keystore = KeyStore.getInstance(\"JKS\");\n        keystore.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"keystore.jks\"), \"password\".toCharArray());\n\n        try {\n            AuthenticodeSigner signer = new AuthenticodeSigner(keystore, \"test\", \"password\").withTimestamping(false);\n            signer.sign(new APPXFile(file));\n        } catch (IOException e) {\n            // expected\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jsign/AuthenticodeCabSignerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.security.KeyStore;\n\nimport net.jsign.AuthenticodeSigner;\nimport net.jsign.mscab.MSCabinetFile;\n\npublic class AuthenticodeCabSignerFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] data) throws Exception {\n        File file = File.createTempFile(\"jsign-fuzzer\", \"cab\");\n        file.deleteOnExit();\n        Files.write(file.toPath(), data);\n\n        KeyStore keystore = KeyStore.getInstance(\"JKS\");\n        keystore.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"keystore.jks\"), \"password\".toCharArray());\n\n        try {\n            AuthenticodeSigner signer = new AuthenticodeSigner(keystore, \"test\", \"password\").withTimestamping(false);\n            signer.sign(new MSCabinetFile(file));\n        } catch (IOException e) {\n            // expected\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jsign/AuthenticodeExeSignerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.security.KeyStore;\n\nimport net.jsign.AuthenticodeSigner;\nimport net.jsign.pe.PEFile;\n\npublic class AuthenticodeExeSignerFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] data) throws Exception {\n        File file = File.createTempFile(\"jsign-fuzzer\", \"exe\");\n        file.deleteOnExit();\n        Files.write(file.toPath(), data);\n\n        KeyStore keystore = KeyStore.getInstance(\"JKS\");\n        keystore.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"keystore.jks\"), \"password\".toCharArray());\n\n        try {\n            AuthenticodeSigner signer = new AuthenticodeSigner(keystore, \"test\", \"password\").withTimestamping(false);\n            signer.sign(new PEFile(file));\n        } catch (IOException e) {\n            // expected\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jsign/AuthenticodeMsiSignerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.security.KeyStore;\n\nimport net.jsign.AuthenticodeSigner;\nimport net.jsign.msi.MSIFile;\n\npublic class AuthenticodeMsiSignerFuzzer {\n\n    public static void fuzzerTestOneInput(byte[] data) throws Exception {\n        File file = File.createTempFile(\"jsign-fuzzer\", \"msi\");\n        file.deleteOnExit();\n        Files.write(file.toPath(), data);\n\n        KeyStore keystore = KeyStore.getInstance(\"JKS\");\n        keystore.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"keystore.jks\"), \"password\".toCharArray());\n\n        try {\n            AuthenticodeSigner signer = new AuthenticodeSigner(keystore, \"test\", \"password\").withTimestamping(false);\n            signer.sign(new MSIFile(file));\n        } catch (IOException | net.jsign.poi.EmptyFileException e) {\n            // expected\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jsign/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/ebourg/jsign.git\n\nRUN zip -j $SRC/AuthenticodeExeSignerFuzzer_seed_corpus.zip  jsign/jsign-core/src/test/resources/*.exe && \\\n    zip -j $SRC/AuthenticodeMsiSignerFuzzer_seed_corpus.zip  jsign/jsign-core/src/test/resources/*.msi && \\\n    zip -j $SRC/AuthenticodeAppxSignerFuzzer_seed_corpus.zip jsign/jsign-core/src/test/resources/*.msix && \\\n    zip -j $SRC/AuthenticodeCabSignerFuzzer_seed_corpus.zip  jsign/jsign-core/src/test/resources/mscab/*.cab\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jsign\n"
  },
  {
    "path": "projects/jsign/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$MVN package --projects jsign-crypto,jsign-core,jsign-cli,jsign-ant,jsign \\\n    -DskipTests -Dmaven.javadoc.skip -Djacoco.skip -Dproguard.skip -Djapicmp.skip -Djdeb.skip -Dmaven.antrun.skip\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n\ncp \"jsign/target/jsign-$CURRENT_VERSION.jar\" $OUT/jsign.jar\n\ncp \"jsign-core/src/test/resources/keystores/keystore.jks\" $OUT/\n\ncp $SRC/*seed_corpus.zip $OUT/\n\nPROJECT_JARS=\"jsign.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the Jazzer API.\nBUILD_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $PROJECT_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:-Djava.awt.headless=true\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jsign/project.yaml",
    "content": "homepage: \"https://ebourg.github.io/jsign/\"\nlanguage: jvm\nprimary_contact: \"ebourg@apache.org\"\nauto_ccs:\n  - \"emmanuel.bourg@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/ebourg/jsign.git\"\n"
  },
  {
    "path": "projects/jsmin/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/tikitu/jsmin jsmin\nWORKDIR jsmin\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/jsmin/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/jsmin/fuzz_minimize.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nfrom jsmin import jsmin\n\n\ndef TestOneInput(data):\n    with open('myfile.js', \"wb\") as js_file:\n        js_file.write(data)\n\n    with open('myfile.js') as js_file:\n        try:\n            minified = jsmin(js_file.read())\n        except UnicodeDecodeError:\n            pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/jsmin/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/tikitu/jsmin\nlanguage: python\nmain_repo: https://github.com/tikitu/jsmin\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/json/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y binutils make\n\nRUN git clone --depth 1 -b develop https://github.com/nlohmann/json.git\nWORKDIR json/\nCOPY run_tests.sh build.sh *.options parse_afl_fuzzer.dict $SRC/\n"
  },
  {
    "path": "projects/json/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake FUZZER_ENGINE=\"$LIB_FUZZING_ENGINE\" fuzzers -Ctests\n\nFUZZER_FILES=$(find tests/ -maxdepth 1 -executable -type f)\nfor F in $FUZZER_FILES; do\n    cp $F $OUT/\n    FUZZER=$(basename $F .cpp)\n    cp $SRC/fuzzer-parse.options $OUT/$FUZZER.options\ndone\ncp $SRC/parse_afl_fuzzer.dict $OUT/\n\n# Build unit tests\nmkdir build-tests\npushd build-tests\ncmake ..\nmake -C tests\npopd\n\n# Pre-download test data\nctest --test-dir build-tests -R download_test_data\n"
  },
  {
    "path": "projects/json/fuzzer-parse.options",
    "content": "[libfuzzer]\nmax_len = 456\ntimeout = 10\n"
  },
  {
    "path": "projects/json/parse_afl_fuzzer.dict",
    "content": "#\n# AFL dictionary for JSON\n# -----------------------\n#\n# Just the very basics.\n#\n# Inspired by a dictionary by Jakub Wilk <jwilk@jwilk.net>\n#\n\n\"0\"\n\",0\"\n\":0\"\n\"0:\"\n\"-1.2e+3\"\n\n\"true\"\n\"false\"\n\"null\"\n\n\"\\\"\\\"\"\n\",\\\"\\\"\"\n\":\\\"\\\"\"\n\"\\\"\\\":\"\n\n\"{}\"\n\",{}\"\n\":{}\"\n\"{\\\"\\\":0}\"\n\"{{}}\"\n\n\"[]\"\n\",[]\"\n\":[]\"\n\"[0]\"\n\"[[]]\"\n\n\"''\"\n\"\\\\\"\n\"\\\\b\"\n\"\\\\f\"\n\"\\\\n\"\n\"\\\\r\"\n\"\\\\t\"\n\"\\\\u0000\"\n\"\\\\x00\"\n\"\\\\0\"\n\"\\\\uD800\\\\uDC00\"\n\"\\\\uDBFF\\\\uDFFF\"\n\n\"\\\"\\\":0\"\n\"//\"\n\"/**/\""
  },
  {
    "path": "projects/json/project.yaml",
    "content": "homepage: \"https://github.com/nlohmann/json\"\nlanguage: c++\nprimary_contact: \"niels.lohmann@gmail.com\"\nauto_ccs:\n  - \"tanujgarg@google.com\"\nsanitizers:\n - address\n - undefined\n - memory\nmain_repo: 'https://github.com/nlohmann/json.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/json/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Skip download of test data\n# Temporarily skip test-class_parser_cpp11 which throws exception\nctest --test-dir build-tests -E \"download_test_data|test-class_parser_cpp11\"\n"
  },
  {
    "path": "projects/json-c/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone --depth 1 https://github.com/json-c/json-c.git json-c\nWORKDIR json-c\nCOPY run_tests.sh build.sh *.cc *.dict $SRC/\n"
  },
  {
    "path": "projects/json-c/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmkdir json-c-build\ncd json-c-build\ncmake -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON ..\nmake -j$(nproc)\ncd ..\n\ncp $SRC/json-c/fuzz/*.dict $OUT/\n\nfor f in $SRC/json-c/fuzz/*_fuzzer.cc; do\n    fuzzer=$(basename \"$f\" _fuzzer.cc)\n    $CXX $CXXFLAGS -std=c++17 -I$SRC/json-c -I$SRC/json-c/json-c-build\\\n         $SRC/json-c/fuzz/${fuzzer}_fuzzer.cc -o $OUT/${fuzzer}_fuzzer \\\n         $LIB_FUZZING_ENGINE $SRC/json-c/json-c-build/libjson-c.a\ndone\n"
  },
  {
    "path": "projects/json-c/project.yaml",
    "content": "homepage: \"https://json-c.github.io/json-c/\"\nlanguage: c++\nprimary_contact: \"erh+git@nimenees.com\"\nauto_ccs:\n  - \"chriswwolfe@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/json-c/json-c.git'\n"
  },
  {
    "path": "projects/json-c/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd json-c-build\nmake test\n"
  },
  {
    "path": "projects/json-flattener/.gitignore",
    "content": "project-parent/json-flattener\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/json-flattener/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/json.dict $SRC/FlattenFuzzer.dict && \\\n    cp fuzzing/dictionaries/json.dict $SRC/UnflattenFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/FlattenFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    zip -j $SRC/UnflattenFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/json-flattener\nRUN git clone --depth 1 https://github.com/wnameless/json-flattener/ $SRC/project-parent/json-flattener\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/json-flattener/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=json-flattener\nPROJECT_GROUP_ID=com.github.wnameless.json\nPROJECT_ARTIFACT_ID=json-flattener\nMAIN_REPOSITORY=https://github.com/wnameless/json-flattener/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests -Dgpg.skip\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/json-flattener/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.github.wnameless.json</groupId>\n            <artifactId>json-flattener</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.code.gson</groupId>\n            <artifactId>gson</artifactId>\n            <version>2.10.1</version>\n        </dependency>\n\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/json-flattener/project-parent/fuzz-targets/src/test/java/com/example/FlattenFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.github.wnameless.json.flattener.*;\nimport com.github.wnameless.json.base.JsonCore;\nimport com.github.wnameless.json.base.GsonJsonCore;\n\nimport java.util.function.Consumer;\n\n\nclass FlattenFuzzer {\n    static PrintMode [] printModes = {PrintMode.PRETTY, PrintMode.MINIMAL};\n    static FlattenMode [] flattenModes = {FlattenMode.NORMAL, FlattenMode.MONGODB, FlattenMode.KEEP_ARRAYS, FlattenMode.KEEP_PRIMITIVE_ARRAYS};\n    static StringEscapePolicy [] stringEscapePolicies = {StringEscapePolicy.DEFAULT, StringEscapePolicy.ALL, StringEscapePolicy.ALL_BUT_SLASH, StringEscapePolicy.ALL_BUT_UNICODE, StringEscapePolicy.ALL_BUT_SLASH_AND_UNICODE};\n    static JsonCore [] jsonCores = {new GsonJsonCore()};\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n\n        try {\n            JsonFlattenerFactory jsonFlattenerFactory = jsonFlattenerFactory(data.pickValue(printModes), data.pickValue(flattenModes), data.pickValue(stringEscapePolicies), data.pickValue(jsonCores));\n            String json = data.consumeRemainingAsString();\n            JsonFlattener jf = jsonFlattenerFactory.build(json);\n\n            jf.flatten();\n            jf.flattenAsMap();\n        } catch (RuntimeException e) {\n            // Need to catch it to let fuzzer find interesting findings.\n        }\n    }\n\n    static JsonFlattenerFactory jsonFlattenerFactory(PrintMode pm, FlattenMode fm, StringEscapePolicy sep, JsonCore<?> jc) {\n        Consumer<JsonFlattener> configurer = jf -> jf.withPrintMode(pm).withFlattenMode(fm).withStringEscapePolicy(sep);\n\n        return new JsonFlattenerFactory(configurer, jc);\n    }\n}"
  },
  {
    "path": "projects/json-flattener/project-parent/fuzz-targets/src/test/java/com/example/UnflattenFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.github.wnameless.json.flattener.*;\nimport com.github.wnameless.json.base.JsonCore;\nimport com.github.wnameless.json.base.GsonJsonCore;\nimport com.github.wnameless.json.unflattener.JsonUnflattener;\nimport com.github.wnameless.json.unflattener.JsonUnflattenerFactory;\n\nimport java.util.function.Consumer;\n\n\nclass UnflattenFuzzer {\n    static PrintMode [] printModes = {PrintMode.PRETTY, PrintMode.MINIMAL};\n    static FlattenMode [] flattenModes = {FlattenMode.NORMAL, FlattenMode.MONGODB, FlattenMode.KEEP_ARRAYS, FlattenMode.KEEP_PRIMITIVE_ARRAYS};\n    static JsonCore [] jsonCores = {new GsonJsonCore()};\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            JsonUnflattenerFactory jsonUnflattenerFactory = jsonUnflattenerFactory(data.pickValue(printModes), data.pickValue(flattenModes), data.pickValue(jsonCores));\n            String json = data.consumeRemainingAsString();\n            JsonUnflattener ju = jsonUnflattenerFactory.build(json);\n\n            ju.unflatten();\n            ju.unflattenAsMap();\n        } catch (RuntimeException e) {\n            // Need to catch it to let fuzzer find initeresting findings.\n        }\n    }\n\n    static JsonUnflattenerFactory jsonUnflattenerFactory(PrintMode pm, FlattenMode fm, JsonCore<?> jc) {\n        Consumer<JsonUnflattener> configurer = ju -> ju.withPrintMode(pm).withFlattenMode(fm);\n\n        return new JsonUnflattenerFactory(configurer, jc);\n    }\n}"
  },
  {
    "path": "projects/json-flattener/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>json-flattener</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/json-flattener/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/wnameless/json-flattener/\"\nlanguage: jvm\nprimary_contact: \"wnameless@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/wnameless/json-flattener/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/json-java/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/stleary/JSON-java json-java\nWORKDIR json-java\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/json-java/JsonJavaFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.json.JSONObject;\nimport org.json.JSONException;\n\npublic class JsonJavaFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      JSONObject jo = new JSONObject(data.consumeRemainingAsString());\n    } catch(JSONException e) {}\n  }\n}\n"
  },
  {
    "path": "projects/json-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd src/main/java\n\njavac org/json/*.java\njar cf $OUT/json-java.jar org/json/*.class\n\nALL_JARS=\"json-java.jar\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\n# Let's try and build a simple fuzzer.\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/json-java/project.yaml",
    "content": "homepage: \"https://github.com/stleary/JSON-java\"\nlanguage: jvm\nprimary_contact: \"jsonjava060@gmail.com\"\nmain_repo: \"https://github.com/stleary/JSON-java\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/json-patch/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/evanphx/json-patch\nRUN wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.23.4.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.23.4.linux-amd64.tar.gz\nCOPY fuzz_*.go $SRC/json-patch/\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/json-patch\n"
  },
  {
    "path": "projects/json-patch/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/evanphx/json-patch FuzzCreateMerge fuzz_create_merge\ncompile_go_fuzzer github.com/evanphx/json-patch FuzzDecodeApply fuzz_decode_apply\n"
  },
  {
    "path": "projects/json-patch/fuzz_create_merge.go",
    "content": "package jsonpatch\n\nimport (\n\t\"bytes\"\n)\n\nfunc FuzzCreateMerge(data []byte) int {\n\ts := bytes.Split(data, []byte{0})\n\tif len(s) != 3 {\n\t\treturn 0\n\t}\n\toriginal := s[0]\n\ttarget := s[1]\n\talternative := s[2]\n\n\tpatch, err := CreateMergePatch(original, target)\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_, err = MergePatch(alternative, patch)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn 1\n}\n"
  },
  {
    "path": "projects/json-patch/fuzz_decode_apply.go",
    "content": "package jsonpatch\n\nimport (\n\t\"bytes\"\n)\n\nfunc FuzzDecodeApply(data []byte) int {\n\ts := bytes.Split(data, []byte{0})\n\tif len(s) != 2 {\n\t\treturn 0\n\t}\n\tpatchJSON := s[0]\n\toriginal := s[1]\n\n\tpatch, err := DecodePatch(patchJSON)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\t_, err = patch.Apply(original)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/json-patch/project.yaml",
    "content": "homepage: \"https://github.com/evanphx/json-patch\"\nprimary_contact: \"evan@phx.io\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/evanphx/json-patch'\n"
  },
  {
    "path": "projects/json-sanitizer/DenylistFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\nimport com.google.json.JsonSanitizer;\n\npublic class DenylistFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    String input = data.consumeRemainingAsString();\n    String output;\n    try {\n      output = JsonSanitizer.sanitize(input, 10);\n    } catch (ArrayIndexOutOfBoundsException e) {\n      // ArrayIndexOutOfBoundsException is expected if nesting depth is\n      // exceeded.\n      return;\n    }\n\n    // Check for forbidden substrings. As these would enable Cross-Site\n    // Scripting, treat every finding as a high severity vulnerability.\n    assert !output.contains(\"</script\")\n        : new FuzzerSecurityIssueHigh(\"Output contains </script\");\n    assert !output.contains(\"]]>\")\n        : new FuzzerSecurityIssueHigh(\"Output contains ]]>\");\n\n    // Check for more forbidden substrings. As these would not directly enable\n    // Cross-Site Scripting in general, but may impact script execution on the\n    // embedding page, treat each finding as a medium severity vulnerability.\n    assert !output.contains(\"<script\")\n        : new FuzzerSecurityIssueMedium(\"Output contains <script\");\n    assert !output.contains(\"<!--\")\n        : new FuzzerSecurityIssueMedium(\"Output contains <!--\");\n  }\n}\n"
  },
  {
    "path": "projects/json-sanitizer/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y maven\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\nRUN cat fuzzing/dictionaries/json.dict \\\n        fuzzing/dictionaries/html.dict \\\n        fuzzing/dictionaries/xml.dict \\\n      > $SRC/DenylistFuzzer.dict\nRUN cp fuzzing/dictionaries/json.dict $SRC/IdempotenceFuzzer.dict\nRUN cp fuzzing/dictionaries/json.dict $SRC/ValidJsonFuzzer.dict\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/DenylistFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    zip -q $SRC/IdempotenceFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    zip -q $SRC/ValidJsonFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/*\n\nRUN git clone --depth 1 https://github.com/OWASP/json-sanitizer\nCOPY build.sh $SRC/\n\nCOPY DenylistFuzzer.java IdempotenceFuzzer.java ValidJsonFuzzer.java $SRC/\n\nWORKDIR $SRC/json-sanitizer\n"
  },
  {
    "path": "projects/json-sanitizer/IdempotenceFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.google.json.JsonSanitizer;\n\npublic class IdempotenceFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    String input = data.consumeRemainingAsString();\n    String output;\n    try {\n      output = JsonSanitizer.sanitize(input, 10);\n    } catch (ArrayIndexOutOfBoundsException e) {\n      // ArrayIndexOutOfBoundsException is expected if nesting depth is\n      // exceeded.\n      return;\n    }\n\n    // Ensure that sanitizing twice does not give different output\n    // (idempotence). Since failure to be idempotent is not a security issue in\n    // itself, fail with a regular AssertionError.\n    assert JsonSanitizer.sanitize(output).equals(output) : \"Not idempotent\";\n  }\n}\n"
  },
  {
    "path": "projects/json-sanitizer/ValidJsonFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport com.google.gson.Gson;\nimport com.google.gson.JsonElement;\nimport com.google.json.JsonSanitizer;\n\npublic class ValidJsonFuzzer {\n  private static Gson gson = new Gson();\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    String input = data.consumeRemainingAsString();\n    String output;\n    try {\n      output = JsonSanitizer.sanitize(input, 10);\n    } catch (ArrayIndexOutOfBoundsException e) {\n      // ArrayIndexOutOfBoundsException is expected if nesting depth is\n      // exceeded.\n      return;\n    }\n\n    // Check that the output is valid JSON. Invalid JSON may crash other parts\n    // of the application that trust the output of the sanitizer.\n    try {\n      Gson gson = new Gson();\n      gson.fromJson(output, JsonElement.class);\n    } catch (Exception e) {\n      throw new FuzzerSecurityIssueLow(\"Output is invalid JSON\", e);\n    }\n  }\n}\n"
  },
  {
    "path": "projects/json-sanitizer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\n# Build the json-sanitizer jar.\nCURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\nmvn package\ncp \"target/json-sanitizer-$CURRENT_VERSION.jar\" $OUT/json-sanitizer.jar\n\n# The jar files containing the project (separated by spaces).\nPROJECT_JARS=json-sanitizer.jar\n\n# Get the fuzzer dependencies (gson).\nmvn dependency:copy -Dartifact=com.google.code.gson:gson:2.8.6 -DoutputDirectory=$OUT/\n\n# The jar files containing further dependencies of the fuzz targets (separated\n# by spaces).\nFUZZER_JARS=gson-2.8.6.jar\n\n# Build fuzzers in $OUT.\nALL_JARS=\"$PROJECT_JARS $FUZZER_JARS\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All jars and class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create execution wrapper.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/json-sanitizer/project.yaml",
    "content": "homepage: \"https://github.com/OWASP/json-sanitizer\"\nlanguage: jvm\nprimary_contact: \"mikesamuel@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/OWASP/json-sanitizer\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/json-simple/.gitignore",
    "content": "project-parent/json-simple\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/json-simple/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\nRUN cp fuzzing/dictionaries/json.dict $SRC/JsonParserFuzzer.dict\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/JsonParserFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/*\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/json-simple\nRUN git clone --depth 1 https://github.com/fangyidong/json-simple $SRC/project-parent/json-simple\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/json-simple/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=json-simple\nPROJECT_GROUP_ID=com.googlecode.json-simple\nPROJECT_ARTIFACT_ID=json-simple\nMAIN_REPOSITORY=https://github.com/fangyidong/json-simple\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  mvn -pl $PROJECT install -DskipTests\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  $MVN -pl $PROJECT install -DskipTests -Dmaven.repo.local=$OUT/m2\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:-Djava.awt.headless=true\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi\n"
  },
  {
    "path": "projects/json-simple/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n\t<dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.0</version>\n\t    <scope>test</scope>\n\t</dependency>\n\t<dependency>\n            <groupId>com.googlecode.json-simple</groupId>\n            <artifactId>json-simple</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>2.22.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>\n"
  },
  {
    "path": "projects/json-simple/project-parent/fuzz-targets/src/test/java/com/example/JsonEncodeDecodeFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.json.simple.JSONArray;\nimport org.json.simple.JSONObject;\nimport org.json.simple.parser.JSONParser;\nimport org.json.simple.parser.ParseException;\nimport java.io.*;\n\npublic class JsonEncodeDecodeFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try {\n            String fuzzingString = data.consumeRemainingAsString();\n            JSONObject srcObj = new JSONObject();\n            srcObj.put(\"item1\", fuzzingString);\n            \n            StringWriter out = new StringWriter();\n            srcObj.writeJSONString(out);\n            String jsonText = out.toString();\n\n            StringReader in = new StringReader(jsonText);\n            JSONParser parser = new JSONParser();\n            JSONObject destObj = (JSONObject)parser.parse(in);\n\n            if (!destObj.equals(srcObj)) {\n                throw new IllegalStateException(\"Decoded object: \"\n                 + destObj.toString() + \" doesn't match original object: \" + srcObj.toString());\n            }            \n        }\n        catch (IOException | ParseException e){\n\n        }\n    }\n}"
  },
  {
    "path": "projects/json-simple/project-parent/fuzz-targets/src/test/java/com/example/JsonParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.json.simple.JSONArray;\nimport org.json.simple.JSONObject;\nimport org.json.simple.parser.JSONParser;\nimport org.json.simple.parser.ParseException;\n\npublic class JsonParserFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        JSONParser parser = new JSONParser();\n        try {\n            JSONObject jsonObj = (JSONObject)parser.parse(data.consumeRemainingAsString());\n        }\n\n        // ParseExeception is expected when JSON is invalid\n        // ClassCastException occurs when parser returns primitive\n        // NumberFormatException occurs when input at root level exceeds long size\n        catch (ParseException | ClassCastException | NumberFormatException e) {\n\n        }\n    }\n}\n"
  },
  {
    "path": "projects/json-simple/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>json-simple</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/json-simple/project.yaml",
    "content": "homepage: \"https://github.com/fangyidong/json-simple\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/fangyidong/json-simple\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"michael.nothhard@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/json-smart-v2/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/json.dict $SRC/json.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/JSONParserFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/netplex/json-smart-v2.git json-smart\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/json-smart\n"
  },
  {
    "path": "projects/json-smart-v2/JSONParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport net.minidev.json.parser.JSONParser;\nimport net.minidev.json.parser.ParseException;\n\npublic class JSONParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    String input = data.consumeRemainingAsString();\n    JSONParser jp = new JSONParser(JSONParser.MODE_PERMISSIVE);\n    try {\n      jp.parse(input);\n    } catch (ParseException | NumberFormatException e) {\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/json-smart-v2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 \\\n-Dmaven.javadoc.skip=true -Dmaven.repo.local=$WORK/m2\"\n\n# first install accessors-smart in local $WORK/m2. json-smart depends on it\ncd accessors-smart\n$MVN install $MAVEN_ARGS\ncd ..\n\n# build the actual json-smart\ncd json-smart\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/json-smart-$CURRENT_VERSION.jar\" $OUT/json-smart.jar\n# do not include accessors-smart.jar in ALL_JARS as it is already included with\n# maven-shade-plugin:3.2.4:shade\nALL_JARS=\"json-smart.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/json-smart-v2/project.yaml",
    "content": "homepage: \"https://github.com/netplex/json-smart-v2\"\nlanguage: jvm\nprimary_contact: \"uchemouni@gmail.com\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/netplex/json-smart-v2.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/json2avro/ConverterFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.avro.Schema;\nimport tech.allegro.schema.json2avro.converter.AvroConversionException;\nimport tech.allegro.schema.json2avro.converter.JsonAvroConverter;\n\n// jvm-autofuzz-heuristics-2\npublic class ConverterFuzzer {\n  private static final String schemaStr = \"{\\\"type\\\" : \\\"record\\\",\" +\n                        \"\\\"name\\\" : \\\"name\\\",\" +\n                        \"\\\"fields\\\" : [\" +\n                        \"{\\\"name\\\" : \\\"name1\\\", \\\"type\\\" : [\\\"null\\\", \\\"string\\\"], \\\"default\\\": null},\" +\n                        \"{\\\"name\\\" : \\\"name2\\\", \\\"type\\\" : [\\\"null\\\", \\\"int\\\"], \\\"default\\\": null}\" +\n                        \"]}\";\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n  // Heuristic name: jvm-autofuzz-heuristics-2\n    Schema schema = new Schema.Parser().parse(schemaStr);\n    try {\n      new JsonAvroConverter().convertToGenericDataRecord(data.consumeRemainingAsBytes(), schema);\n    } catch (AvroConversionException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/json2avro/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone --depth 1 https://github.com/allegro/json-avro-converter/ json2avro\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nENV TARGET_PACKAGE_PREFIX tech.allegro.schema.json2avro.converter.*\nENV JAVA_HOME=/usr/lib/jvm/java-15-openjdk-amd64/\nWORKDIR $SRC/json2avro\n"
  },
  {
    "path": "projects/json2avro/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nchmod +x ./gradlew\n./gradlew clean build -x test\n\nBUILD_CLASSPATH=\nRUNTIME_CLASSPATH=\n\nfor JARFILE in $(find ./ -name *.jar)\ndo\n  cp $JARFILE $OUT/\n  BUILD_CLASSPATH=$BUILD_CLASSPATH$OUT/$(basename $JARFILE):\n  RUNTIME_CLASSPATH=$RUNTIME_CLASSPATH\\$this_dir/$(basename $JARFILE):\ndone\n\n# Retrieve apache-common-lang3 library\n# This library provides method to translate primitive type arrays to\n# their respective class object arrays to avoid compilation error.\nwget -P $OUT/ https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar\n\nBUILD_CLASSPATH=$BUILD_CLASSPATH:$JAZZER_API_PATH:$OUT/commons-lang3-3.12.0.jar\nRUNTIME_CLASSPATH=$RUNTIME_CLASSPATH:\\$this_dir/commons-lang3-3.12.0.jar:\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \"\\$0\")\nmem_settings='-Xmx2048m:-Xss1024k'\nif [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nfi\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\"\\$mem_settings\" \\\n\"\\$@\"\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/json2avro/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/allegro/json-avro-converter\nlanguage: jvm\nmain_repo: https://github.com/allegro/json-avro-converter\nsanitizers:\n- address\nvendor_ccs:\n- arthur.chan@adalogics.com\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/json5format/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/google/json5format\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/json5format/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/json5format\ncargo fuzz build -O\ncp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_parse $OUT/fuzz_parse\n"
  },
  {
    "path": "projects/json5format/project.yaml",
    "content": "homepage: \"https://crates.io/crates/json5format\"\nmain_repo: \"https://github.com/google/json5format\"\nprimary_contact: \"richkadel@google.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\nfile_github_issue: True\n"
  },
  {
    "path": "projects/jsoncons/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone https://github.com/danielaparker/jsoncons\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/jsoncons/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd jsoncons/fuzzers\n\n# Ensure script is executable\nchmod +x ./build_fuzzers.sh\n./build_fuzzers.sh\n"
  },
  {
    "path": "projects/jsoncons/project.yaml",
    "content": "homepage: \"https://github.com/danielaparker/jsoncons\"\nprimary_contact: \"danielaparker@gmail.com\"\nlanguage: c++\nauto_ccs :\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/danielaparker/jsoncons'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/jsoncpp/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update -y && apt-get install -y curl wget \\\n    binutils cmake ninja-build liblzma-dev libz-dev pkg-config autoconf libtool\nRUN git clone --depth 1 https://github.com/open-source-parsers/jsoncpp\nWORKDIR jsoncpp\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja)\nCOPY run_tests.sh build.sh *.proto *.h *.cc $SRC/\n"
  },
  {
    "path": "projects/jsoncpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed -i 's/set(CMAKE_CXX_STANDARD 11)/set(CMAKE_CXX_STANDARD 17)/' CMakeLists.txt\n\nmkdir -p build\ncd build\ncmake -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n      -DBUILD_SHARED_LIBS=OFF \\\n      -DJSONCPP_WITH_TESTS=ON \\\n      -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \\\n      -G \"Unix Makefiles\" ..\nmake\n\n# Compile fuzzer.\n$CXX $CXXFLAGS -I../include $LIB_FUZZING_ENGINE \\\n    ../src/test_lib_json/fuzz.cpp -o $OUT/jsoncpp_fuzzer \\\n    lib/libjsoncpp.a\n\n# Add dictionary.\ncp $SRC/jsoncpp/src/test_lib_json/fuzz.dict $OUT/jsoncpp_fuzzer.dict\n\nif [[ $CFLAGS != *sanitize=memory* ]]; then\n# Compile json proto.\nrm -rf genfiles && mkdir genfiles && ../LPM/external.protobuf/bin/protoc json.proto --cpp_out=genfiles --proto_path=$SRC\n\n# Compile LPM fuzzer.\n$CXX $CXXFLAGS -DNDEBUG -I genfiles -I .. -I ../libprotobuf-mutator/ -I ../LPM/external.protobuf/include -I ../include $LIB_FUZZING_ENGINE \\\n    $SRC/jsoncpp_fuzz_proto.cc genfiles/json.pb.cc $SRC/json_proto_converter.cc \\\n    ../LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n    ../LPM/src/libprotobuf-mutator.a \\\n    -Wl,--start-group ../LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n    -o  $OUT/jsoncpp_proto_fuzzer \\\n    lib/libjsoncpp.a\nfi\n"
  },
  {
    "path": "projects/jsoncpp/json.proto",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n// The proto definition for JSON format has been written based on\n// http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf\n\nsyntax = \"proto2\";\n\npackage json_proto;\n\nmessage JsonParseAPI {\n  required int32 settings = 1;\n  required JsonObject object_value = 2;\n}\n\nmessage JsonObject {\n  required int32 settings = 1;\n  required string name = 2;\n  required JsonValue value = 3;\n}\n\nmessage JsonValue {\n  oneof value {\n    // Json value types:\n\n    // null: null, will be used when 'oneof' contains nothing\n\n    // object: another json object of any type\n    JsonObject object_value = 1;\n\n    // array: an array of values\n    ArrayValue array_value = 2;\n\n    // number: can be an integer, a float, an exponent\n    NumberValue number_value = 3;\n\n    // string: unicode string\n    StringValue string_value = 4;\n\n    // boolean: true or talse\n    BooleanValue boolean_value = 5;\n  }\n}\n\nmessage ArrayValue {\n  repeated JsonValue value = 1;\n}\n\nmessage NumberInteger {\n  required int64 value = 1;\n}\n\nmessage NumberFloat {\n  required double value = 1;\n}\n\nmessage NumberExponent {\n  required int32 base = 1;\n  required int32 exponent = 2;\n  required bool use_uppercase = 3;\n}\n\nmessage NumberExponentFrac {\n  required float base = 1;\n  required int32 exponent = 2;\n  required bool use_uppercase = 3;\n}\n\nmessage NumberValue {\n  required NumberInteger integer_value = 1;\n\n  // integer_value is used when oneof field below has nothing.\n  oneof value {\n    NumberFloat float_value = 2;\n    NumberExponent exponent_value = 3;\n    NumberExponentFrac exponent_frac_value = 4;\n  }\n}\n\nmessage StringValue {\n  required string value = 1;\n}\n\nmessage BooleanValue {\n  required bool value = 1;\n}\n"
  },
  {
    "path": "projects/jsoncpp/json_proto_converter.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"json_proto_converter.h\"\n\nnamespace json_proto {\n\nvoid JsonProtoConverter::AppendArray(const ArrayValue& array_value) {\n  data_ << '[';\n  bool need_comma = false;\n  for (const auto& value : array_value.value()) {\n    // Trailing comma inside of an array makes JSON invalid, avoid adding that.\n    if (need_comma)\n      data_ << ',';\n    else\n      need_comma = true;\n\n    AppendValue(value);\n  }\n  data_ << ']';\n}\n\nvoid JsonProtoConverter::AppendNumber(const NumberValue& number_value) {\n  if (number_value.has_float_value()) {\n    data_ << number_value.float_value().value();\n  } else if (number_value.has_exponent_value()) {\n    auto value = number_value.exponent_value();\n    data_ << value.base();\n    data_ << (value.use_uppercase() ? 'E' : 'e');\n    data_ << value.exponent();\n  } else if (number_value.has_exponent_frac_value()) {\n    auto value = number_value.exponent_value();\n    data_ << value.base();\n    data_ << (value.use_uppercase() ? 'E' : 'e');\n    data_ << value.exponent();\n  } else {\n    data_ << number_value.integer_value().value();\n  }\n}\n\nvoid JsonProtoConverter::AppendObject(const JsonObject& json_object) {\n  data_ << '{' << '\"' << json_object.name() << '\"' << ':';\n  AppendValue(json_object.value());\n  data_ << '}';\n}\n\nvoid JsonProtoConverter::AppendValue(const JsonValue& json_value) {\n  if (json_value.has_object_value()) {\n    AppendObject(json_value.object_value());\n  } else if (json_value.has_array_value()) {\n    AppendArray(json_value.array_value());\n  } else if (json_value.has_number_value()) {\n    AppendNumber(json_value.number_value());\n  } else if (json_value.has_string_value()) {\n    data_ << '\"' << json_value.string_value().value() << '\"';\n  } else if (json_value.has_boolean_value()) {\n    data_ << (json_value.boolean_value().value() ? \"true\" : \"false\");\n  } else {\n    data_ << \"null\";\n  }\n}\n\nstd::string JsonProtoConverter::Convert(const JsonObject& json_object) {\n  AppendObject(json_object);\n  return data_.str();\n}\n\nstd::string JsonProtoConverter::Convert(\n    const json_proto::ArrayValue& json_array) {\n  AppendArray(json_array);\n  return data_.str();\n}\n\n}  // namespace json_proto\n"
  },
  {
    "path": "projects/jsoncpp/json_proto_converter.h",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef JSON_PROTO_CONVERTER_H_\n#define JSON_PROTO_CONVERTER_H_\n\n#include <sstream>\n#include <string>\n\n#include \"json.pb.h\"\n\nnamespace json_proto {\n\nclass JsonProtoConverter {\n public:\n  std::string Convert(const json_proto::JsonObject&);\n  std::string Convert(const json_proto::ArrayValue&);\n\n private:\n  std::stringstream data_;\n\n  void AppendArray(const json_proto::ArrayValue&);\n  void AppendNumber(const json_proto::NumberValue&);\n  void AppendObject(const json_proto::JsonObject&);\n  void AppendValue(const json_proto::JsonValue&);\n};\n\n}  // namespace json_proto\n\n#endif  // TESTING_LIBFUZZER_PROTO_JSON_PROTO_CONVERTER_H_\n"
  },
  {
    "path": "projects/jsoncpp/jsoncpp_fuzz_proto.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"json.pb.h\"\n#include \"json_proto_converter.h\"\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n\n#include <cstdint>\n#include <json/config.h>\n#include <json/json.h>\n#include <memory>\n#include <string>\n#include <iostream>\n#include <cstddef>\n#include <stdint.h>\n#include <cstring>\n#include <iostream>\n\nnamespace Json {\nclass Exception;\n}\n\nvoid FuzzJson(std::string data_str, int32_t hash_settings) {\n  Json::CharReaderBuilder builder;\n\n  builder.settings_[\"failIfExtra\"] = hash_settings & (1 << 0);\n  builder.settings_[\"allowComments_\"] = hash_settings & (1 << 1);\n  builder.settings_[\"strictRoot_\"] = hash_settings & (1 << 2);\n  builder.settings_[\"allowDroppedNullPlaceholders_\"] = hash_settings & (1 << 3);\n  builder.settings_[\"allowNumericKeys_\"] = hash_settings & (1 << 4);\n  builder.settings_[\"allowSingleQuotes_\"] = hash_settings & (1 << 5);\n  builder.settings_[\"failIfExtra_\"] = hash_settings & (1 << 6);\n  builder.settings_[\"rejectDupKeys_\"] = hash_settings & (1 << 7);\n  builder.settings_[\"allowSpecialFloats_\"] = hash_settings & (1 << 8);\n  builder.settings_[\"collectComments\"] = hash_settings & (1 << 9);\n  builder.settings_[\"allowTrailingCommas_\"] = hash_settings & (1 << 10);\n\n  std::unique_ptr<Json::CharReader> reader(builder.newCharReader());\n  \n  const char* begin = data_str.c_str();\n  const char* end = begin + data_str.length();\n\n  Json::Value root;\n  try {\n    reader->parse(begin, end, &root, nullptr);\n  } catch (Json::Exception const&) {\n  }\n}\n\nDEFINE_PROTO_FUZZER(const json_proto::JsonParseAPI &json_proto) {\n  json_proto::JsonProtoConverter converter;\n  std::string data_str = converter.Convert(json_proto.object_value());\n  int32_t hash_settings = json_proto.settings();\n  FuzzJson(data_str, hash_settings);\n}\n"
  },
  {
    "path": "projects/jsoncpp/project.yaml",
    "content": "homepage: \"https://github.com/open-source-parsers/jsoncpp/\"\nlanguage: c++\nprimary_contact: \"chenguopingdota@163.com\"\nauto_ccs:\n - \"jophba@chromium.org\"\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nmain_repo: 'https://github.com/open-source-parsers/jsoncpp'\ncoverage_extra_args: -ignore-filename-regex=.*/LPM/.*\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/jsoncpp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\ncd build\nmake test\n"
  },
  {
    "path": "projects/jsonnet/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y build-essential cmake\nRUN git clone --depth 1 https://github.com/google/jsonnet.git jsonnet\nWORKDIR $SRC/\n\nCOPY build.sh run_tests.sh $SRC/\nCOPY *.cc $SRC/\n"
  },
  {
    "path": "projects/jsonnet/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install google test to be compatible with LLVM 21\ngit clone --depth 1 https://github.com/google/googletest\ncd $SRC/googletest\nmkdir build\ncd build\ncmake ..\nmake -j$(nproc)\nmake install\n\n\ncd $SRC/\nmkdir jsonnet/build\npushd jsonnet/build\ncmake -DUSE_SYSTEM_GTEST=ON -DCMAKE_C_COMPILER=\"$CC\" -DCMAKE_CXX_COMPILER=\"$CXX\" \\\n  -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" -DBUILD_TESTS=ON ..\nmake -j$(nproc) all\npopd\n\nINSTALL_DIR=\"$SRC/jsonnet\"\n\nfor fuzzer in convert_jsonnet_fuzzer_regular \\\n convert_jsonnet_fuzzer_stream \\\n convert_jsonnet_fuzzer_multi; do\n  $CXX $CXXFLAGS -I${INSTALL_DIR}/include $LIB_FUZZING_ENGINE \\\n    $fuzzer.cc -o $OUT/$fuzzer \\\n    ${INSTALL_DIR}/build/libjsonnet.a\ndone\n"
  },
  {
    "path": "projects/jsonnet/convert_jsonnet_fuzzer_multi.cc",
    "content": "// Copyright 2022 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <cstddef>\n#include <cstdint>\n#include <cstring>\n#include <string>\n\nextern \"C\" {\n#include \"libjsonnet.h\"\n}\n\nint ImportCallback(void* ctx, const char* base, const char* rel,\n                     char** found_here, char **buf, size_t *buflen) {\n  // Don't load file and mark it as failure.\n  *buf = NULL;\n  *buflen = 0;\n  return 1;\n}\n\nstd::string ConvertJsonnetToJson(const std::string& jsonnet) {\n  JsonnetVm* jvm = jsonnet_make();\n  jsonnet_import_callback(jvm, ImportCallback, jvm);\n  int error = 0;\n  char* res =\n      jsonnet_evaluate_snippet_multi(jvm, /*filename=*/\"\", jsonnet.c_str(), &error);\n\n  std::string json;\n  if (error == 0 && res != nullptr) {\n    json = res;\n  }\n\n  if (res) {\n    jsonnet_realloc(jvm, res, 0);\n  }\n  jsonnet_destroy(jvm);\n  return json;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  std::string fuzz_jsonnet(reinterpret_cast<const char*>(data), size);\n  ConvertJsonnetToJson(fuzz_jsonnet);\n  return 0;\n}\n"
  },
  {
    "path": "projects/jsonnet/convert_jsonnet_fuzzer_regular.cc",
    "content": "// Copyright 2022 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <cstddef>\n#include <cstdint>\n#include <cstring>\n#include <string>\n\nextern \"C\" {\n#include \"libjsonnet.h\"\n}\n\nint ImportCallback(void* ctx, const char* base, const char* rel,\n                     char** found_here, char **buf, size_t *buflen) {\n  // Don't load file and mark it as failure.\n  *buf = NULL;\n  *buflen = 0;\n  return 1;\n}\n\nstd::string ConvertJsonnetToJson(const std::string& jsonnet) {\n  JsonnetVm* jvm = jsonnet_make();\n  jsonnet_import_callback(jvm, ImportCallback, jvm);\n  int error = 0;\n  char* res =\n      jsonnet_evaluate_snippet(jvm, /*filename=*/\"\", jsonnet.c_str(), &error);\n\n  std::string json;\n  if (error == 0 && res != nullptr) {\n    json = res;\n  }\n\n  if (res) {\n    jsonnet_realloc(jvm, res, 0);\n  }\n  jsonnet_destroy(jvm);\n  return json;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  std::string fuzz_jsonnet(reinterpret_cast<const char*>(data), size);\n  ConvertJsonnetToJson(fuzz_jsonnet);\n  return 0;\n}\n"
  },
  {
    "path": "projects/jsonnet/convert_jsonnet_fuzzer_stream.cc",
    "content": "// Copyright 2022 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <cstddef>\n#include <cstdint>\n#include <cstring>\n#include <string>\n\nextern \"C\" {\n#include \"libjsonnet.h\"\n}\n\nint ImportCallback(void* ctx, const char* base, const char* rel,\n                     char** found_here, char **buf, size_t *buflen) {\n  // Don't load file and mark it as failure.\n  *buf = NULL;\n  *buflen = 0;\n  return 1;\n}\n\nstd::string ConvertJsonnetToJson(const std::string& jsonnet) {\n  JsonnetVm* jvm = jsonnet_make();\n  jsonnet_import_callback(jvm, ImportCallback, jvm);\n  int error = 0;\n  char* res =\n      jsonnet_evaluate_snippet_stream(jvm, /*filename=*/\"\", jsonnet.c_str(), &error);\n\n  std::string json;\n  if (error == 0 && res != nullptr) {\n    json = res;\n  }\n\n  if (res) {\n    jsonnet_realloc(jvm, res, 0);\n  }\n  jsonnet_destroy(jvm);\n  return json;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  std::string fuzz_jsonnet(reinterpret_cast<const char*>(data), size);\n  ConvertJsonnetToJson(fuzz_jsonnet);\n  return 0;\n}\n"
  },
  {
    "path": "projects/jsonnet/project.yaml",
    "content": "homepage: \"https://github.com/google/jsonnet\"\nlanguage: c++\nprimary_contact: \"dcunnin@google.com\"\nauto_ccs:\n  - \"sparkprime@gmail.com\"\n  - \"jpa.bartholomew@gmail.com\"\n  - \"jpab@google.com\"\n\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\n  - undefined\n\nlabels:\n  convert_jsonnet_fuzzer:\n    - sundew\n\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/google/jsonnet.git'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/jsonnet/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/jsonnet/build\nmake test\n"
  },
  {
    "path": "projects/jsonp-api/CreateJsonFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport ee.jakarta.tck.jsonp.common.JSONP_Util;\nimport jakarta.json.*;\nimport jakarta.json.stream.JsonParsingException;\nimport java.io.PrintStream;\nimport java.io.OutputStream;\n\npublic class CreateJsonFuzzer {\n    private static final PrintStream noopStream = new PrintStream(new OutputStream() {\n        @Override\n        public void write(int b) {}\n    });\n\n    public static void fuzzerInitialize() {\n        System.setErr(noopStream);\n        System.setOut(noopStream);\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try {\n            testJsonCreators(data);\n            JsonValue.ValueType.valueOf(data.consumeString(100));\n        } catch (IllegalArgumentException | JsonParsingException e) {}\n    }\n\n    public static void testJsonCreators(FuzzedDataProvider data) {\n        JsonArray jsonArray = JSONP_Util.createJsonArrayFromString(data.consumeString(200));\n        JSONP_Util.toStringJsonArray(jsonArray);\n\n        JsonObject jsonObject = JSONP_Util.createJsonObjectFromString(data.consumeString(200));\n        JSONP_Util.toStringJsonObject(jsonObject);\n\n        String inStr = data.consumeAsciiString(200);\n        JsonString jsonString = JSONP_Util.createJsonString(inStr);\n        String outString = JSONP_Util.toStringJsonString(jsonString);\n        String intJsonStr = \"\\\"\" + inStr + \"\\\"\";\n        if (!intJsonStr.equals(outString)) {\n            throw new FuzzerSecurityIssueLow(\"JsonString: \" + intJsonStr + \" Expected. Got \" + outString);\n        }\n\n        int inNumber = data.consumeInt();\n        JsonNumber jsonNumber = JSONP_Util.createJsonNumber(inNumber);\n        String outNumber = JSONP_Util.toStringJsonNumber(jsonNumber);\n        if (!Integer.toString(inNumber).equals(outNumber)) {\n            throw new FuzzerSecurityIssueLow(\"JsonNumber: \" + inNumber + \" Expected. Got \" + outNumber);\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jsonp-api/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone --depth 1 https://github.com/jakartaee/jsonp-api $SRC/jsonp-api\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/jsonp-api\n"
  },
  {
    "path": "projects/jsonp-api/GeneratorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport ee.jakarta.tck.jsonp.common.JSONP_Util;\nimport jakarta.json.*;\nimport jakarta.json.stream.JsonGenerator;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.HashSet;\n\npublic class GeneratorFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ByteArrayOutputStream baos = new ByteArrayOutputStream();\n        JsonGenerator generator = Json.createGenerator(baos).writeStartObject();\n\n        try {\n            for (int i = 0; i < data.consumeInt(0, 10); i++) {\n                if (data.consumeBoolean()) {\n                    generator.writeStartObject(data.consumeString(20));\n                } else {\n                    generator.writeStartArray(data.consumeString(20));\n                }\n\n                for (int j = 0; j < data.consumeInt(0, 20); j++) {\n                    int writeChoice = data.consumeInt(0, 3);\n                    switch (writeChoice) {\n                        case 0:\n                            generator.write(data.consumeString(50), data.consumeInt());\n                            break;\n                        case 1:\n                            generator.write(data.consumeString(50), data.consumeString(50));\n                            break;\n                        case 2:\n                            generator.write(data.consumeString(50), data.consumeBoolean());\n                            break;\n                        case 3:\n                            generator.write(JSONP_Util.createJsonString(data.consumeString(50)));\n                            break;\n                    }\n                }\n                generator.writeEnd();\n            }\n\n            generator.writeEnd();\n            generator.close();\n            baos.close();\n\n            JSONP_Util.removeWhitespace(baos.toString(\"UTF-8\"));\n\n        } catch (JsonException | IOException | IllegalArgumentException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/jsonp-api/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\n\ncd tck\n$MVN -U -C clean package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true\ncp tck-common/target/jakarta*.jar $OUT/\ncp tck-tests/target/jakarta*.jar $OUT/\ncd ..\ncd api\n$MVN -U -C clean package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true\ncp target/jakarta*.jar $OUT/\ncd ..\n\n# parsson dependencies need to be downloaded manually\n$MVN dependency:get -Dartifact=org.eclipse.parsson:parsson:1.1.1\ncp ~/.m2/repository/org/eclipse/parsson/parsson/1.1.1/*.jar $OUT/\n\nALL_JARS=$(find $OUT/ -name *.jar ! -name jazzer*.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  mv $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone "
  },
  {
    "path": "projects/jsonp-api/project.yaml",
    "content": "homepage: \"https://github.com/jakartaee/jsonp-api\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/jakartaee/jsonp-api\"\nsanitizers:\n  - address\nvendor_ccs:\n"
  },
  {
    "path": "projects/jsonparser/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/buger/jsonparser\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/jsonparser\n"
  },
  {
    "path": "projects/jsonparser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/jsonparser/project.yaml",
    "content": "homepage: \"https://github.com/buger/jsonparser\"\nprimary_contact: \"leonsbox@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"leloucharcher@gmail.com\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/buger/jsonparser'\n"
  },
  {
    "path": "projects/jsonpath/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.6.3 && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven-3.6.3/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/json-path/JsonPath.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/JsonPath"
  },
  {
    "path": "projects/jsonpath/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"\"\nALL_JARS=\"\"\nLIBRARY_NAME=\"jsonpath\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\n\npushd \"${SRC}/JsonPath\"\n\t./gradlew publishToMavenLocal\n\tCURRENT_VERSION=$(./gradlew properties --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\npopd\n\npushd \"${SRC}\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/jsonpath/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>jsonpath-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>2.9.0</fuzzedLibaryVersion>\n\t\t<exec.mainClass>PathParserFuzzer</exec.mainClass>\n\t</properties>\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>com.jayway.jsonpath</groupId>\n\t\t\t<artifactId>json-path</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/jsonpath/project.yaml",
    "content": "homepage: \"https://goessner.net/articles/JsonPath/\"\nlanguage: jvm\nmain_repo: \"https://github.com/json-path/JsonPath.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jsonpath/src/main/java/ossfuzz/PathParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.jayway.jsonpath.Configuration;\nimport com.jayway.jsonpath.InvalidPathException;\nimport com.jayway.jsonpath.JsonPath;\nimport com.jayway.jsonpath.PathNotFoundException;\n\nimport java.io.*;\n\npublic class PathParserFuzzer {\n\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic PathParserFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\n\t}\n\n\tvoid test() throws IOException {\n\t\ttry {\n\t\t\tInputStream in = getClass().getResourceAsStream(\"/test.json\");\n\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\t\t\tStringBuilder result = new StringBuilder();\n\t\t\tString line;\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tresult.append(line);\n\t\t\t}\n\n\t\t\tObject document = Configuration.defaultConfiguration().jsonProvider().parse(result.toString());\n\t\t\tJsonPath.read(document, fuzzedDataProvider.consumeRemainingAsString());\n\t\t} catch (IllegalArgumentException e) {\n\n\t\t} catch (PathNotFoundException e) {\n\n\t\t} catch (InvalidPathException e) {\n\n\t\t}\n\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws IOException {\n\n\t\tPathParserFuzzer loggingInterceptorFuzzer = new PathParserFuzzer(fuzzedDataProvider);\n\t\tloggingInterceptorFuzzer.test();\n\t}\n}"
  },
  {
    "path": "projects/jsonpath/src/main/resources/test.json",
    "content": "{\n    \"store\": {\n        \"book\": [\n            {\n                \"category\": \"reference\",\n                \"author\": \"Nigel Rees\",\n                \"title\": \"Sayings of the Century\",\n                \"price\": 8.95\n            },\n            {\n                \"category\": \"fiction\",\n                \"author\": \"Evelyn Waugh\",\n                \"title\": \"Sword of Honour\",\n                \"price\": 12.99\n            },\n            {\n                \"category\": \"fiction\",\n                \"author\": \"Herman Melville\",\n                \"title\": \"Moby Dick\",\n                \"isbn\": \"0-553-21311-3\",\n                \"price\": 8.99\n            },\n            {\n                \"category\": \"fiction\",\n                \"author\": \"J. R. R. Tolkien\",\n                \"title\": \"The Lord of the Rings\",\n                \"isbn\": \"0-395-19395-8\",\n                \"price\": 22.99\n            }\n        ],\n        \"bicycle\": {\n            \"color\": \"red\",\n            \"price\": 19.95\n        }\n    },\n    \"expensive\": 10\n}"
  },
  {
    "path": "projects/jsonpickle/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth 1 https://github.com/jsonpickle/jsonpickle $SRC/jsonpickle\nRUN $SRC/jsonpickle/fuzzing/oss-fuzz-scripts/container-environment-bootstrap.sh\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/jsonpickle/\n"
  },
  {
    "path": "projects/jsonpickle/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n. \"$SRC/jsonpickle/fuzzing/oss-fuzz-scripts/build.sh\"\n"
  },
  {
    "path": "projects/jsonpickle/project.yaml",
    "content": "homepage: https://github.com/jsonpickle/jsonpickle\nmain_repo: https://github.com/jsonpickle/jsonpickle\nlanguage: python\nprimary_contact: \"davvid@gmail.com\"\nauto_ccs:\n  - \"theelgirl4@gmail.com\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/jsonschema/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN pip3 install --upgrade pip hypothesis rpds-py\n\nRUN git clone --depth=1 https://github.com/python-jsonschema/jsonschema.git\nRUN git clone --depth=1 https://github.com/python-jsonschema/jsonschema-specifications jsonschema_specifications\nWORKDIR $SRC/jsonschema\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/jsonschema/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data $SRC/jsonschema_specifications/jsonschema_specifications/schemas:jsonschema_specifications/schemas\ndone\n"
  },
  {
    "path": "projects/jsonschema/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/Julian/jsonschema\"\nlanguage: python\nprimary_contact: \"Julian+Security@GrayVines.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/Julian/jsonschema'\n"
  },
  {
    "path": "projects/jsoup/CssHtmlFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/// /////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.jsoup.Jsoup;\nimport org.jsoup.helper.ValidationException;\nimport org.jsoup.nodes.Document;\nimport org.jsoup.select.Evaluator;\nimport org.jsoup.select.Selector;\n\npublic class CssHtmlFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String css = data.consumeString(100);\n        Evaluator query;\n        try {\n            query = Selector.evaluatorOf(css);\n        } catch (ValidationException | Selector.SelectorParseException ignored) {\n            return;\n        }\n\n        String html = data.consumeRemainingAsString();\n        Document doc = Jsoup.parse(html, \"https://example.com\");\n        doc.select(query);\n    }\n}\n"
  },
  {
    "path": "projects/jsoup/CssHtmlFuzzer.options",
    "content": "[libfuzzer]\ndict = combo.dict\nmax_len = 1024\n"
  },
  {
    "path": "projects/jsoup/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nARG MAVEN_VERSION=3.9.11\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-$MAVEN_VERSION/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cat fuzzing/dictionaries/html.dict \\\n        fuzzing/dictionaries/svg.dict \\\n        fuzzing/dictionaries/mathml.dict \\\n        fuzzing/dictionaries/css.dict \\\n        fuzzing/dictionaries/xml.dict \\\n        fuzzing/dictionaries/xpath.dict \\\n    fuzzing/dictionaries/http.dict >> $SRC/combo.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XmlFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/jhy/jsoup/\n\n# re2j is an optional/test dependency, but we want it available on the fuzzed classpath\nRUN curl -L https://github.com/google/re2j/releases/download/re2j-1.8/re2j-1.8.jar -o $SRC/re2j.jar\n\nCOPY build.sh *.java *.options $SRC/\nWORKDIR $SRC/jsoup\n"
  },
  {
    "path": "projects/jsoup/FragmentHtmlFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/// /////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.jsoup.helper.ValidationException;\nimport org.jsoup.nodes.Element;\nimport org.jsoup.parser.Parser;\n\npublic class FragmentHtmlFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try {\n            String contextElName = data.consumeString(20);\n            Element contextEl = new Element(contextElName);\n            String html = data.consumeRemainingAsString();\n            Parser.htmlParser().parseFragmentInput(html, contextEl, \"https://example.com/\");\n        } catch (ValidationException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/jsoup/FragmentHtmlFuzzer.options",
    "content": "[libfuzzer]\ndict = combo.dict\nmax_len = 1024\n"
  },
  {
    "path": "projects/jsoup/HtmlFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.jsoup.Jsoup;\n\npublic class HtmlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Jsoup.parse(data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/jsoup/HtmlFuzzer.options",
    "content": "[libfuzzer]\ndict = combo.dict\nmax_len = 1024\n"
  },
  {
    "path": "projects/jsoup/XmlFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.jsoup.Jsoup;\nimport org.jsoup.parser.Parser;\n\npublic class XmlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Jsoup.parse(data.consumeRemainingAsString(), \"\", Parser.xmlParser());\n  }\n}\n"
  },
  {
    "path": "projects/jsoup/XmlFuzzer.options",
    "content": "[libfuzzer]\ndict = combo.dict\nmax_len = 1024\n"
  },
  {
    "path": "projects/jsoup/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict,*.options} $OUT\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=17 -Djavac.target.version=17\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.6.1:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/jsoup-$CURRENT_VERSION.jar\" $OUT/jsoup.jar\n\n# re2j into classpath\ncp \"$SRC/re2j.jar\" $OUT/re2j.jar\n\nALL_JARS=\"jsoup.jar re2j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jsoup/project.yaml",
    "content": "homepage: \"https://github.com/jhy/jsoup/\"\nlanguage: jvm\nprimary_contact: \"jonathan@hedley.net\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/jhy/jsoup/\"\nsanitizers:\n  - address\nauto_ccs:\n  - \"ffrr33aakk@gmail.com\"\nvendor_ccs:\n"
  },
  {
    "path": "projects/jsqlparser/.gitignore",
    "content": "project-parent/jsqlparser\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/jsqlparser/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/sql.dict $SRC/JSqlParserFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/JSqlParserFuzzer_seed_corpus.zip go-fuzz-corpus/sqlparser/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/jsqlparser\nRUN apt update && apt install -y openjdk-11-jdk\nRUN git clone --depth 1 https://github.com/JSQLParser/JSqlParser/ $SRC/project-parent/jsqlparser\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/jsqlparser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=jsqlparser\nPROJECT_GROUP_ID=com.github.jsqlparser\nPROJECT_ARTIFACT_ID=jsqlparser\nMAIN_REPOSITORY=https://github.com/JSQLParser/JSqlParser/\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-11\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**:net.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/jsqlparser/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.github.jsqlparser</groupId>\n            <artifactId>jsqlparser</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/jsqlparser/project-parent/fuzz-targets/src/test/java/com/example/JSqlParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport net.sf.jsqlparser.JSQLParserException;\nimport net.sf.jsqlparser.parser.CCJSqlParserUtil;\nimport net.sf.jsqlparser.parser.TokenMgrException;\n\nclass JSqlParserFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        String simpleSql = data.consumeString(1000);\n        String sqlScript = data.consumeString(1000);\n        String expression = data.consumeString(1000);\n        String ast = data.consumeString(1000);\n        String condExp = data.consumeString(1000);\n\n        try {\n            CCJSqlParserUtil.parse(\n                    simpleSql,\n                    parser -> parser\n                            .withSquareBracketQuotation(data.consumeBoolean())\n                            .withAllowComplexParsing(data.consumeBoolean())\n                            .withUnsupportedStatements(data.consumeBoolean())\n                            .withBackslashEscapeCharacter(data.consumeBoolean())\n            );\n        } catch (JSQLParserException e) {\n        }\n\n        try {\n            CCJSqlParserUtil.parseStatements(\n                    sqlScript,\n                    parser -> parser\n                            .withSquareBracketQuotation(data.consumeBoolean())\n                            .withAllowComplexParsing(data.consumeBoolean())\n                            .withUnsupportedStatements(data.consumeBoolean())\n                            .withBackslashEscapeCharacter(data.consumeBoolean())\n            );\n        } catch (JSQLParserException e) {\n        }\n\n        try {\n            CCJSqlParserUtil.parseAST(ast);\n        } catch (JSQLParserException e) {\n        }\n\n        try {\n            CCJSqlParserUtil.parseExpression(\n                    expression,\n                    data.consumeBoolean(),\n                    parser -> parser\n                            .withSquareBracketQuotation(data.consumeBoolean())\n                            .withAllowComplexParsing(data.consumeBoolean())\n                            .withUnsupportedStatements(data.consumeBoolean())\n                            .withBackslashEscapeCharacter(data.consumeBoolean())\n            );\n        } catch (JSQLParserException e) {\n        } catch (ArrayIndexOutOfBoundsException | TokenMgrException e) {\n            // Needed to catch to enable fuzzer to continue\n        }\n\n        try {\n            CCJSqlParserUtil.parseCondExpression(\n                    condExp,\n                    data.consumeBoolean(),\n                    parser -> parser\n                            .withSquareBracketQuotation(data.consumeBoolean())\n                            .withAllowComplexParsing(data.consumeBoolean())\n                            .withUnsupportedStatements(data.consumeBoolean())\n                            .withBackslashEscapeCharacter(data.consumeBoolean())\n            );\n        } catch (JSQLParserException e) {\n        } catch (ArrayIndexOutOfBoundsException | TokenMgrException e) {\n            // Needed to catch to enable fuzzer to continue\n        }\n    }\n}"
  },
  {
    "path": "projects/jsqlparser/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>jsqlparser</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/jsqlparser/project.yaml",
    "content": "homepage: \"https://jsqlparser.github.io/JSqlParser/index.html\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/JSQLParser/JSqlParser/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jstl-api/0001-support-new-jdk.patch",
    "content": "diff --git a/jaxrpc-ri/pom.xml b/jaxrpc-ri/pom.xml\n--- a/jaxrpc-ri/pom.xml\n+++ b/jaxrpc-ri/pom.xml\n@@ -49,6 +49,8 @@\n         <fastInfoset.version>1.2.16</fastInfoset.version>\n         <saaj.api.version>1.4.2</saaj.api.version>\n         <ant.version>1.9.13</ant.version>\n+\t\t<maven.compiler.target>1.8</maven.compiler.target>\n+\t\t<maven.compiler.source>1.8</maven.compiler.source>\n \n         <legal.doc.source>${maven.multiModuleProjectDirectory}/..</legal.doc.source>\n \n"
  },
  {
    "path": "projects/jstl-api/0002-avoid-ConcurrentModificationException.patch",
    "content": "diff --git a/jaxrpc-ri/pom.xml b/jaxrpc-ri/pom.xml\n--- a/jaxrpc-ri/pom.xml\n+++ b/jaxrpc-ri/pom.xml\n@@ -147,7 +149,7 @@\n                 <plugin>\n                     <groupId>org.apache.felix</groupId>\n                     <artifactId>maven-bundle-plugin</artifactId>\n-                    <version>4.2.1</version>\n+                    <version>5.1.8</version>\n                         <configuration>\n                             <instructions>\n                                 <_removeheaders>Bnd-LastModified,Build-Jdk,Built-By,Include-Resource</_removeheaders>\n"
  },
  {
    "path": "projects/jstl-api/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n# Install maven configuration, which is also used by gradles's publishToMavenLocal.\n\nADD maven-settings.xml ${SRC}/\nRUN apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n\n# install maven and gradle\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME jstl-api\nWORKDIR ${SRC}\nRUN git clone https://github.com/eclipse-ee4j/jstl-api.git ${LIBRARY_NAME}\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}"
  },
  {
    "path": "projects/jstl-api/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_SUBDIR=\"\"\nMVN_FLAGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.14.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}/${SRC_SUBDIR}\"\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\n#this package uses multiple versions [...]\npushd \"${SRC}/${LIBRARY_NAME}/api\"\n\tCURRENT_VERSION_API=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\npushd \"${SRC}/${LIBRARY_NAME}/impl\"\n\tCURRENT_VERSION_IMPL=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" \\\n\t\t-DapiVersion=\"${CURRENT_VERSION_API}\" \\\n\t\t-DimplVersion=\"${CURRENT_VERSION_IMPL}\" \\\n\t\t${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/jstl-api/jstl-api-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>jstl-api-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>3.0.0</fuzzedLibaryVersion>\n\t\t<exec.mainClass>com.sun.xml.rpc.processor.modeler.rmi.SOAPSimpleTypeCreatorFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.14.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.14.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>jakarta.servlet.jsp.jstl</groupId>\n\t\t\t<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>\n\t\t\t<version>${apiVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.glassfish.web</groupId>\n\t\t\t<artifactId>jakarta.servlet.jsp.jstl</artifactId>\n\t\t\t<version>${implVersion}</version>\n\t\t</dependency>\n\n\n\t\t<dependency>\n\t\t\t<groupId>jakarta.servlet</groupId>\n\t\t\t<artifactId>jakarta.servlet-api</artifactId>\n\t\t\t<version>6.0.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>jakarta.servlet.jsp</groupId>\n\t\t\t<artifactId>jakarta.servlet.jsp-api</artifactId>\n\t\t\t<version>3.1.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>jakarta.el</groupId>\n\t\t\t<artifactId>jakarta.el-api</artifactId>\n\t\t\t<version>5.0.0</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/jstl-api/jstl-api-fuzzer/src/main/java/jakarta/servlet/jsp/ParserFuzzer.java",
    "content": "package jakarta.servlet.jsp;\n\nimport org.apache.taglibs.standard.lang.jstl.Evaluator;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\npublic class ParserFuzzer {\n\n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public ParserFuzzer(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        this.fuzzedDataProvider = fuzzedDataProvider;\n    }\n\n    void test() {\n        try {\n            String result = Evaluator.parseAndRender(fuzzedDataProvider.consumeRemainingAsString());\n        } catch (JspException ex) {\n            /* documented, ignore */\n        } catch (IllegalArgumentException ex) {\n            /* general purpose, ignore */\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider)  throws Exception {\n\n        ParserFuzzer fixture = new ParserFuzzer(fuzzedDataProvider);\n        fixture.test();\n    }\n}"
  },
  {
    "path": "projects/jstl-api/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/jstl-api/project.yaml",
    "content": "homepage: \"https://github.com/eclipse-ee4j/jstl-api\"\nlanguage: jvm\nmain_repo: \"https://github.com/eclipse-ee4j/jstl-api.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/jts/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nRUN curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip \\\n      -o protoc.zip && \\\n      mkdir -p $SRC/protoc && \\\n      unzip protoc.zip -d $SRC/protoc && \\\n      rm -rf protoc.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nENV PATH=\"$SRC/protoc/bin:$PATH\"\nRUN git clone --depth 1 https://github.com/locationtech/jts jts\nCOPY build.sh *.java $SRC/\nWORKDIR $SRC/jts\n"
  },
  {
    "path": "projects/jts/JtsFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.locationtech.jts.geom.Geometry;\nimport org.locationtech.jts.geom.GeometryFactory;\nimport org.locationtech.jts.geom.PrecisionModel;\nimport org.locationtech.jts.geom.TopologyException;\nimport org.locationtech.jts.io.ParseException;\nimport org.locationtech.jts.io.WKTReader;\nimport org.locationtech.jts.util.AssertionFailedException;\n\npublic class JtsFuzzer {\n  private static PrecisionModel.Type[] types = {\n      PrecisionModel.FIXED, PrecisionModel.FLOATING, PrecisionModel.FLOATING_SINGLE};\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      int[] choices = data.consumeInts(data.consumeInt(1, 10));\n      GeometryFactory factory = new GeometryFactory(new PrecisionModel(data.pickValue(types)));\n      WKTReader reader = new WKTReader(factory);\n      Geometry g1 = reader.read(data.consumeString(data.remainingBytes() / 2));\n      Geometry g2 = reader.read(data.consumeRemainingAsString());\n\n      for (Integer choice : choices) {\n        switch (choice % 16) {\n          case 0:\n            g1.equalsNorm(g2);\n            break;\n          case 1:\n            g1.distance(g2);\n            break;\n          case 2:\n            g1.disjoint(g2);\n            break;\n          case 3:\n            g1.touches(g2);\n            break;\n          case 4:\n            g1.intersects(g2);\n            break;\n          case 5:\n            g1.crosses(g2);\n            break;\n          case 6:\n            g1.within(g2);\n            break;\n          case 7:\n            g1.contains(g2);\n            break;\n          case 8:\n            g1.overlaps(g2);\n            break;\n          case 9:\n            g1.covers(g2);\n            break;\n          case 10:\n            g1.coveredBy(g2);\n            break;\n          case 11:\n            g1.relate(g2);\n            break;\n          case 12:\n            g1.intersection(g2);\n            break;\n          case 13:\n            g1.union(g2);\n            break;\n          case 14:\n            g1.difference(g2);\n            break;\n          case 15:\n            g1.symDifference(g2);\n            break;\n        }\n      }\n    } catch (ParseException | TopologyException | AssertionFailedException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/jts/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nchmod +x $SRC/protoc/bin/protoc\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"modules/core/target/jts-core-$CURRENT_VERSION.jar\" $OUT/jts-core.jar\ncp \"modules/lab/target/jts-lab-$CURRENT_VERSION.jar\" $OUT/jts-lab.jar\ncp \"modules/io/common/target/jts-io-common-$CURRENT_VERSION.jar\" $OUT/jts-io-common.jar\ncp \"modules/app/target/jts-app-$CURRENT_VERSION.jar\" $OUT/jts-app.jar\n\nALL_JARS=\"jts-core.jar:jts-lab.jar:jts-io-common.jar:jts-app.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name 'JtsFuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jts/project.yaml",
    "content": "homepage: https://github.com/locationtech/jts\nmain_repo: https://github.com/locationtech/jts\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/juju/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/juju/juju\nRUN wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.23.4.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.23.4.linux-amd64.tar.gz\nCOPY build.sh devices_fuzzer.go $SRC/\nWORKDIR $SRC/juju\n"
  },
  {
    "path": "projects/juju/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo mod download\n# A fuzzer in this dependency is broken:\nfind /root/go/pkg/mod/github.com/aws/aws-sdk-go-v2 -name \"*fuzz.go\" -exec rm -rf {} \\;\n\n# Compile fuzzer:\nmv $SRC/devices_fuzzer.go $SRC/juju/core/devices/\ncompile_go_fuzzer github.com/juju/juju/core/devices Fuzz devices_fuzzer\n"
  },
  {
    "path": "projects/juju/devices_fuzzer.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage devices\n\nfunc Fuzz(data []byte) int {\n\t_, err := ParseConstraints(string(data))\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/juju/project.yaml",
    "content": "homepage: \"https://juju.is\"\nmain_repo: \"https://github.com/juju/juju\"\nprimary_contact: \"stickupkid@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/jul-to-slf4j/BridgeFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.slf4j.bridge.SLF4JBridgeHandler;\nimport java.util.logging.Logger;\n\npublic class BridgeFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    SLF4JBridgeHandler.install();\n    Logger julLogger = Logger.getLogger(\"fuzzLogger\");\n    julLogger.fine(data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/jul-to-slf4j/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/qos-ch/slf4j.git slf4j\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/slf4j\n"
  },
  {
    "path": "projects/jul-to-slf4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"jul-to-slf4j/target/jul-to-slf4j-$CURRENT_VERSION.jar\" $OUT/jul-to-slf4j.jar\n\nALL_JARS=\"jul-to-slf4j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/jul-to-slf4j/project.yaml",
    "content": "homepage: \"https://www.slf4j.org/\"\nlanguage: jvm\nprimary_contact: \"dev.qos.ch@gmail.com\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/qos-ch/slf4j.git\"\nauto_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/junrar/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.4.2-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE_HOME $SRC/gradle/gradle-7.4.2\nENV PATH $GRADLE_HOME/bin:$PATH\n\n# Dict\n# no existing rar.dict found on web, build rar dict manually later\n\n# Seeds\nRUN git clone --depth 1 https://github.com/strongcourage/fuzzing-corpus.git && \\\n    zip -j $SRC/JunrarFuzzer_seed_corpus.zip fuzzing-corpus/rar/* && \\\n    rm -rf fuzzing-corpus\n\nRUN git clone --depth 1 https://github.com/junrar/junrar.git junrar\n\nCOPY build.sh $SRC/\nCOPY JunrarFuzzer.java $SRC/\nWORKDIR $SRC/junrar\n"
  },
  {
    "path": "projects/junrar/JunrarFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.InputStream;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.io.ByteArrayInputStream;\n\nimport com.github.junrar.Archive;\nimport com.github.junrar.rarfile.FileHeader;\nimport com.github.junrar.exception.RarException;\nimport com.github.junrar.io.SeekableReadOnlyByteChannel;\nimport com.github.junrar.rarfile.MainHeader;\nimport com.github.junrar.volume.Volume;\n\npublic class JunrarFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n\t\ttry {\n\t\t\tInputStream inputStream = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n\t\t\tArchive v0 = null;\n\t\t\tFileHeader v1 = null;\n\t\t\tSeekableReadOnlyByteChannel v2 = null;\n\t\t\tMainHeader v3 = null;\n\t\t\tVolume v4 = null;\n\n\t\t\tv0 = new Archive(inputStream);\n\t\t\tv2 = v0.getChannel();\n\t\t\tif (v2 != null) {\n\t\t\t\tv2.getPosition();\n\t\t\t}\n\n\t\t\tv0.getFileHeaders();\n\t\t\tv0.getHeaders();\n\n\t\t\tv3 = v0.getMainHeader();\n\t\t\tif (v3 != null) {\n\t\t\t\tv3.getEncryptVersion();\n\t\t\t\tv3.isEncrypted();\n\t\t\t\t//v3.print();\n\t\t\t}\n\n\t\t\tv4 = v0.getVolume();\n\t\t\tif (v4 != null) {\n\t\t\t\tv4.getChannel();\n\t\t\t\tv4.getLength();\n\t\t\t}\n\n\t\t\tv0.isEncrypted();\n\n\t\t\twhile (true) {\n\t\t\t\tv1 = v0.nextFileHeader();\n\t\t\t\tif (v1 == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tv1.getCTime();\n\t\t\t\tv1.hasVolumeNumber();\n\t\t\t\tv1.isSubBlock();\n\n\t\t\t\tv0.extractFile(v1, OutputStream.nullOutputStream()); \n\t\t\t}\n\n\t\t} catch (IOException e1) {\n\t\t} catch (RarException e2) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/junrar/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/*.zip $OUT\n#mv $SRC/{*.zip,*.dict} $OUT\n\n./gradlew build\nCURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain -q | grep \"^version:\" | awk '{printf $2}')\ncp \"build/libs/junrar-$CURRENT_VERSION-sources.jar\" $OUT/junrar.jar\n\ncurl -L https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar -o $OUT/slf4j-api.jar\ncurl -L https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/1.7.36/slf4j-simple-1.7.36.jar -o $OUT/slf4j-simple.jar\n\nALL_JARS=\"junrar.jar slf4j-api.jar slf4j-simple.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/junrar/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/junrar/junrar\nlanguage: jvm\nmain_repo: https://github.com/junrar/junrar.git\nsanitizers:\n- address\nvendor_ccs:\n- all.u.ever.know@gmail.com\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/jupyter-nbconvert/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/jupyter/nbconvert nbconvert\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/nbconvert\n"
  },
  {
    "path": "projects/jupyter-nbconvert/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/jupyter-nbconvert/fuzz_markdown_converter.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport nbconvert\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  nbconvert.filters.markdown_mistune.markdown2html_mistune(\n    fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  )\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/jupyter-nbconvert/project.yaml",
    "content": "homepage: https://github.com/jupyter/nbconvert\nlanguage: python\nmain_repo: https://github.com/jupyter/nbconvert\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/jupyter_server/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt install -y nodejs\nRUN pip3 install --upgrade pip\nRUN curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh\nRUN git clone https://github.com/jupyter/jupyter_events $SRC/jupyter_events\nRUN bash nodesource_setup.sh\nRUN apt install -y nodejs\nRUN git clone https://github.com/jupyter-server/jupyter_server/\nCOPY build.sh *.py $SRC/\nWORKDIR jupyter_server\n"
  },
  {
    "path": "projects/jupyter_server/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install -e \".[test]\"\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data $SRC/jupyter_events/jupyter_events/schemas/:./jupyter_events/schemas/ --hidden-import=tornado.web\ndone\n"
  },
  {
    "path": "projects/jupyter_server/fuzz_serialization.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from jupyter_client.session import Session\n  from jupyter_server.base.zmqhandlers import (\n    deserialize_binary_message,\n    serialize_binary_message,\n  )\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  s1 = fdp.ConsumeString(50)\n  s2 = fdp.ConsumeString(50)\n  if len(s1) == 0 or len(s2) == 0:\n    return\n  s = Session()\n  msg = s.msg(\"data_pub\", content={s1: s2})\n  msg[\"buffers\"] = [\n    memoryview(fdp.ConsumeBytes(5)),\n    memoryview(fdp.ConsumeBytes(5)),\n    memoryview(fdp.ConsumeBytes(5))\n  ]\n  bmsg = serialize_binary_message(msg)\n  msg2 = deserialize_binary_message(bmsg)\n  assert msg2 == msg\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/jupyter_server/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/jupyter-server/jupyter_server\nlanguage: python\nmain_repo: https://github.com/jupyter-server/jupyter_server\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/jupytext/project.yaml",
    "content": "homepage: \"https://jupytext.readthedocs.io/en/latest/developing.html\"\nlanguage: python\nprimary_contact: \"marc.wouts@gmail.com\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/mwouts/jupytext.git\"\n"
  },
  {
    "path": "projects/jwt-verify-lib/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install python3 -y\nRUN git clone --depth 1 https://github.com/google/jwt_verify_lib.git\nWORKDIR $SRC/jwt_verify_lib/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/jwt-verify-lib/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/jwt-verify-lib/project.yaml",
    "content": "homepage: \"https://github.com/google/jwt_verify_lib\"\nlanguage: c++\nprimary_contact: \"qiwzhang@google.com\"\nauto_ccs:\n- \"nareddyt@google.com\"\n- \"yangshuo@google.com\"\n- \"taoxuy@google.com\"\nsanitizers:\n- address\n- undefined\n- memory\nmain_repo: 'https://github.com/google/jwt_verify_lib.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/jxls/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN rm -rf $SRC/project-parent/jxls\nRUN git clone --depth 1 https://github.com/jxlsteam/jxls $SRC/jxls\nRUN chmod +x $SRC/jxls/gradlew\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nCOPY *.patch $SRC/\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nCOPY *.dict $SRC/\nWORKDIR $SRC/jxls\n"
  },
  {
    "path": "projects/jxls/ProcessTemplateFuzzer.dict",
    "content": "\"${}\"\n\"jx:area()\"\n\"jx:each()\"\n\"jx:if()\"\n\"lastCell=\"\n\"items=\"\n\"var=\"\n\"varIndex=\"\n\"select=\"\n\"!A1:B1\""
  },
  {
    "path": "projects/jxls/ProcessTemplateFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.jxls.common.JxlsException;\nimport org.jxls.util.CannotOpenWorkbookException;\nimport org.jxls.transform.poi.JxlsPoiTemplateFillerBuilder;\nimport org.apache.poi.ss.usermodel.Workbook;\nimport org.apache.poi.ss.usermodel.Cell;\nimport org.apache.poi.ss.usermodel.Row;\nimport org.apache.poi.xssf.usermodel.XSSFSheet;\nimport org.apache.poi.xssf.usermodel.XSSFWorkbook;\nimport org.apache.poi.ss.usermodel.Comment;\nimport org.apache.poi.ss.usermodel.RichTextString;\nimport org.apache.poi.ss.usermodel.ClientAnchor;\nimport org.apache.poi.ss.usermodel.CreationHelper;\nimport org.apache.poi.ss.usermodel.Drawing;\n\nimport java.io.*;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.*;\n\npublic class ProcessTemplateFuzzer {\n    private static Path templatePath;\n\n    public static void fuzzerInitialize() throws IOException {\n        templatePath = new File(\"/out/template.xlsx\").toPath();\n        templatePath.toFile().createNewFile();\n    }\n\n    private static Map<String, Object> generateHashMap(FuzzedDataProvider data) {\n        Map<String, Object> model = new HashMap<String, Object>();\n        for (int i = 0; i <= data.consumeInt(0, 10); i++) {\n            model.put(data.consumeString(50), data.consumeBytes(200));\n        }\n\n        return model;\n    }\n\n    public static Comment generateComment(XSSFSheet sheet, CreationHelper factory, FuzzedDataProvider data) {\n        ClientAnchor anchor = factory.createClientAnchor();\n        Drawing drawing = sheet.createDrawingPatriarch();\n        Comment comment = drawing.createCellComment(anchor);\n        comment.setString(factory.createRichTextString(data.consumeString(200)));\n        comment.setAuthor(data.consumeString(100));\n        return comment;\n    }\n\n    public static Path createDocument(FuzzedDataProvider data) throws IOException {\n        XSSFWorkbook workbook = new XSSFWorkbook();\n        XSSFSheet sheet = workbook.createSheet(data.consumeString(50));\n        CreationHelper factory = workbook.getCreationHelper();\n\n        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n            Row row = sheet.createRow(i);\n            for (int j = 0; j < data.consumeInt(0, 50); j++) {\n                Cell cell = row.createCell(j);\n                cell.setCellValue(data.consumeString(200));\n\n                if (data.consumeBoolean()) {\n                    cell.setCellComment(ProcessTemplateFuzzer.generateComment(sheet, factory, data));\n                }\n            }\n        }\n\n        FileOutputStream out = new FileOutputStream(templatePath.toFile());\n        workbook.write(out);\n        out.close();\n\n        return templatePath;\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Path templatePath = null;\n        try {\n            templatePath = ProcessTemplateFuzzer.createDocument(data);\n        } catch (IOException | IllegalArgumentException e) {\n            return;\n        }\n\n        Map<String, Object> contextData = ProcessTemplateFuzzer.generateHashMap(data);\n        OutputStream os = new ByteArrayOutputStream();\n        InputStream in = null;\n        try {\n            in = Files.newInputStream(templatePath.toFile().toPath());\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n\n        try {\n            JxlsPoiTemplateFillerBuilder.newInstance()\n                .withTemplate(in)\n                .buildAndFill(contextData, () -> os);\n        } catch (JxlsException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/jxls/build.patch",
    "content": "diff --git a/build.gradle b/build.gradle\nindex 80c19ff..77377ba 100644\n--- a/build.gradle\n+++ b/build.gradle\n@@ -1,3 +1,7 @@\n+plugins {\n+    id 'com.github.johnrengelman.shadow' version '7.1.2'\n+}\n+\n allprojects {\n     apply plugin: 'jacoco'\n     apply plugin: 'org.owasp.dependencycheck'\n@@ -13,6 +17,7 @@ subprojects {\n     apply plugin: 'java-library'\n     apply plugin: 'eclipse'\n     apply plugin: 'maven-publish'\n+    apply plugin: 'com.github.johnrengelman.shadow'\n     \n     java {\n         toolchain {\n"
  },
  {
    "path": "projects/jxls/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nCURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\nmv $SRC/*.dict $OUT\n\ngit apply $SRC/build.patch --whitespace=fix --reject\n\n./gradlew clean shadowJar -x :jxls:javadoc -x :jxls-poi:test\n\ncp \"../jxls/jxls/build/libs/jxls-$CURRENT_VERSION-all.jar\" $OUT/jxls.jar\ncp \"../jxls/jxls-poi/build/libs/jxls-poi-$CURRENT_VERSION-all.jar\" $OUT/jxls-poi.jar\n\nALL_JARS=$(find $OUT/ -name *.jar ! -name jazzer*.jar -printf \"%f \")\n\necho $ALL_JARS\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  #cp $SRC/$fuzzer_basename.class $OUT/\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/jxls/project.yaml",
    "content": "homepage: \"https://github.com/jxlsteam/jxls\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/jxlsteam/jxls\"\nsanitizers:\n  - address\nvendor_ccs:\n"
  },
  {
    "path": "projects/kafka/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get update -y && apt-get install -y wget software-properties-common\nRUN wget -qO - https://packages.confluent.io/deb/7.0/archive.key | apt-key add -\nRUN add-apt-repository \"deb https://packages.confluent.io/clients/deb $(lsb_release -cs) main\"\nRUN apt-get update -y && apt-get install librdkafka-dev software-properties-common lsb-release gcc make python3-dev libsasl2-modules-gssapi-mit krb5-user -y\n\nRUN pip3 install --upgrade pip\n\nRUN git clone --depth=1 https://github.com/confluentinc/confluent-kafka-python kafka\nWORKDIR kafka\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/kafka/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/kafka/fuzz_consumer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nfrom confluent_kafka import Consumer, KafkaException, TopicPartition\n\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    def dummy_callback(err, partitions):\n        pass\n\n    try:\n        c = Consumer({\n            'group.id': fdp.ConsumeConsumeUnicodeNoSurrogates(10),\n            'socket.timeout.ms': fdp.ConsumeIntInRange(10,2000),\n            'session.timeout.ms': fdp.ConsumeIntInRange(10,2000),\n            'on_commit': dummy_callback})\n    except Exception as e:\n        # If the consumer fails, we just retry\n        return\n\n    try:\n        c.subscribe(\n            [fdp.ConsumeUnicodeNoSurrogates(10)],\n            on_assign=dummy_callback,\n            on_revoke=dummy_callback\n        )\n        c.unsubscribe()\n\n        msg = c.poll(timeout=0.001)\n        msglist = c.consume(\n            num_messages=fdp.ConsumeIntInRange(1,10),\n            timeout=0.001\n        )\n\n        partitions = list(\n            map(\n                lambda part: TopicPartition(fdp.ConsumeUnicodeNoSurrogates(10).replace('\\x00', ''), part),\n                range(0, 100, 3)\n            )\n        )\n        c.assign(partitions)\n        c.unassign()\n\n        c.commit(asynchronous=fdp.ConsumeBool())\n        c.committed(partitions, timeout=0.001)\n\n        c.list_topics(timeout=0.2)\n        c.list_topics(topic=fdp.ConsumeString(10), timeout=0.1)\n    except KafkaException as e:\n        pass\n\n    c.close()\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/kafka/fuzz_producer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from confluent_kafka import Producer, KafkaException\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    p = Producer({\n        'socket.timeout.ms': fdp.ConsumeIntInRange(10,2000),\n        'message.timeout.ms': fdp.ConsumeIntInRange(10,2000)\n    })\n\n    p.produce(fdp.ConsumeUnicodeNoSurrogates(20).replace('\\x00', ''))\n    p.produce(\n        fdp.ConsumeUnicodeNoSurrogates(20).replace('\\x00', ''),\n        value=fdp.ConsumeString(20),\n        key=fdp.ConsumeString(20)\n    )\n\n    def on_delivery(err, msg):\n        pass\n\n    p.produce(\n        topic=fdp.ConsumeUnicodeNoSurrogates(20),\n        value=fdp.ConsumeUnicodeNoSurrogates(20),\n        partition=fdp.ConsumeIntInRange(1,10),\n        callback=on_delivery\n    )\n\n    p.poll(0.001)\n    p.flush(0.002)\n    p.flush()\n\n    try:\n        p.list_topics(timeout=0.2)\n    except KafkaException as e:\n        pass\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/kafka/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/confluentinc/confluent-kafka-python\nlanguage: python\nmain_repo: https://github.com/confluentinc/confluent-kafka-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/kamailio/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y bison flex\nRUN git clone https://github.com/kamailio/kamailio\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/kamailio/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/kamailio\n\nexport CC_OPT=\"${CFLAGS}\"\nexport LD_EXTRA_OPTS=\"${CFLAGS}\"\n\nsed -i 's/int main(/int main2(/g' ./src/main.c\n\nexport MEMPKG=sys\nmake Q=verbose || true\ncd src\nmkdir objects && find . -name \"*.o\" -exec cp {} ./objects/ \\;\nar -r libkamilio.a ./objects/*.o\ncd ../\n$CC $CFLAGS -c ./misc/fuzz/fuzz_uri.c \\\n    -DFAST_LOCK -D__CPU_i386 ./src/libkamilio.a \\\n    -I./src/ -I./src/core/parser -ldl -lresolv -lm\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_uri.o -o $OUT/fuzz_uri \\\n    -DFAST_LOCK -D__CPU_i386 ./src/libkamilio.a \\\n    -I./src/ -I./src/core/parser -ldl -lresolv -lm\n\n$CC $CFLAGS  ./misc/fuzz/fuzz_parse_msg.c -c \\\n    -DFAST_LOCK -D__CPU_i386 ./src/libkamilio.a \\\n    -I./src/ -I./src/core/parser -ldl -lresolv -lm\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_parse_msg.o -o $OUT/fuzz_parse_msg \\\n    -DFAST_LOCK -D__CPU_i386 ./src/libkamilio.a \\\n    -I./src/ -I./src/core/parser -ldl -lresolv -lm\n\n"
  },
  {
    "path": "projects/kamailio/project.yaml",
    "content": "homepage: \"www.kamailio.org\"\nmain_repo: \"https://github.com/kamailio/kamailio\"\nprimary_contact: \"ossfuzz@kamailio.org\"\nlanguage: c\nauto_ccs:\n  - \"miconda@gmail.com\"\n  - \"david@adalogics.com\"\n  - \"mail@gilawa.com\"\n  - \"qxork.droid@gmail.com\"\n"
  },
  {
    "path": "projects/karchive/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 -b master https://invent.kde.org/frameworks/karchive.git\nRUN $SRC/karchive/autotests/ossfuzz/prepare_build.sh\nRUN cp $SRC/karchive/autotests/ossfuzz/build_fuzzers.sh $SRC/build.sh\n\nWORKDIR $SRC/karchive\n"
  },
  {
    "path": "projects/karchive/project.yaml",
    "content": "homepage: https://invent.kde.org/frameworks/karchive.git/\nlanguage: c++\nprimary_contact: tsdgeos@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://invent.kde.org/frameworks/karchive.git'\n"
  },
  {
    "path": "projects/kcodecs/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 -b master https://invent.kde.org/frameworks/kcodecs.git\nRUN $SRC/kcodecs/autotests/ossfuzz/prepare_build.sh\nRUN cp $SRC/kcodecs/autotests/ossfuzz/build_fuzzers.sh $SRC/build.sh\n\nWORKDIR $SRC/kcodecs\n"
  },
  {
    "path": "projects/kcodecs/project.yaml",
    "content": "homepage: https://invent.kde.org/frameworks/kcodecs.git/\nlanguage: c++\nprimary_contact: tsdgeos@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://invent.kde.org/frameworks/kcodecs.git'\n"
  },
  {
    "path": "projects/kde-thumbnailers/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://invent.kde.org/network/kio-extras.git\nRUN git clone --depth 1 https://invent.kde.org/graphics/kdegraphics-thumbnailers.git\nRUN git clone --depth 1 https://invent.kde.org/sdk/kdesdk-thumbnailers.git\nRUN git clone --depth 1 https://invent.kde.org/multimedia/ffmpegthumbs.git\n\nRUN $SRC/kio-extras/thumbnail/autotests/ossfuzz/prepare_build.sh\nRUN $SRC/kdegraphics-thumbnailers/autotests/ossfuzz/prepare_build.sh\nRUN $SRC/kdesdk-thumbnailers/autotests/ossfuzz/prepare_build.sh\nRUN $SRC/ffmpegthumbs/autotests/ossfuzz/prepare_build.sh\n\nCOPY build.sh $SRC\n\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/kde-thumbnailers/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/kio-extras/thumbnail/autotests/ossfuzz/build_fuzzers.sh\n$SRC/kdegraphics-thumbnailers/autotests/ossfuzz/build_fuzzers.sh\n$SRC/kdesdk-thumbnailers/autotests/ossfuzz/build_fuzzers.sh\n$SRC/ffmpegthumbs/autotests/ossfuzz/build_fuzzers.sh\n\n# Cleanup\nrm -rf $WORK/*\n"
  },
  {
    "path": "projects/kde-thumbnailers/project.yaml",
    "content": "homepage: \"https://invent.kde.org/network/kio-extras.git\"\nlanguage: c++\nprimary_contact: tsdgeos@gmail.com\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nmain_repo: \"https://invent.kde.org/network/kio-extras.git\"\n"
  },
  {
    "path": "projects/kea/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y meson ninja-build pkg-config \\\n      build-essential python3 libssl-dev libboost-dev libboost-system-dev \\\n      libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \\\n      libpq-dev libmariadb-dev libkrb5-dev\nRUN mkdir -p /opt/boost-headers && \\\n    wget https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.gz && \\\n    tar -xzf boost_1_83_0.tar.gz -C /opt/boost-headers --strip-components=1 && \\\n    rm -f boost_1_83_0.tar.gz && mkdir -p /usr/local/include && \\\n    ln -s /opt/boost-headers/boost /usr/local/include/boost\nRUN mkdir -p /src/log4cplus && \\\n    wget https://github.com/log4cplus/log4cplus/releases/download/REL_2_1_2/log4cplus-2.1.2.tar.gz && \\\n    tar -xzf log4cplus-2.1.2.tar.gz -C /src/log4cplus --strip-components=1 && \\\n    rm -f log4cplus-2.1.2.tar.gz\nRUN python3 -m pip install --no-cache-dir --upgrade \"meson>=1.1,<2\"\n\nRUN git clone https://gitlab.isc.org/isc-projects/kea kea\nRUN git clone https://github.com/AdaLogics/ada-fuzzers ada-fuzzers\nCOPY build.sh $SRC/\nWORKDIR kea\n"
  },
  {
    "path": "projects/kea/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Copy key fuzzers/dict/seeds\ncp -r $SRC/ada-fuzzers/projects/kea $SRC/kea-fuzzer\n\n# Run build script\n$SRC/kea-fuzzer/build.sh\n"
  },
  {
    "path": "projects/kea/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://gitlab.isc.org/isc-projects/kea\"\nlanguage: c++\nprimary_contact: \"david@adalogics.com\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n  - \"tomek@isc.org\"\n  - \"razvan@isc.org\"\n  - \"andrei@isc.org\"\n  - \"wlodek.wencel@gmail.com\"\nmain_repo: 'https://gitlab.isc.org/isc-projects/kea'\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/keras/Dockerfile",
    "content": "# Copyright 2023 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n        curl \\\n        rsync \\\n        && \\\n    apt-get clean && \\\n    rm -rf /var/lib/apt/lists/*\n\nRUN python3 -m pip install --upgrade pip chardet\n\n# We install Keras by way of Tensorflow. As such, this build instructions\n# follow the logic of tensorflow-py project.\n\n# Due to Bazel bug, need to symlink python3 to python\n# See https://github.com/bazelbuild/bazel/issues/8665\nRUN ln -s /usr/local/bin/python3 /usr/local/bin/python\n\n# Install Bazelisk to keep bazel in sync with the version required by TensorFlow\nRUN curl -Lo /usr/bin/bazel \\\n        https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64 \\\n        && \\\n    chmod +x /usr/bin/bazel\n\nRUN git clone --depth 1 https://github.com/tensorflow/tensorflow tensorflow\nRUN git clone --depth 1 https://github.com/DavidKorczynski/hdf5-files $SRC/hdf5-files\nWORKDIR $SRC/tensorflow\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/keras/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport ORIG_CFLAGS=\"$CFLAGS\"\nexport ORIG_CXXFLAGS=\"$CXXFLAGS\"\nexport CFLAGS=\"\"\nexport CXXFLAGS=\"\"\npython3 -m pip install numpy\nexport CFLAGS=$ORIG_CFLAGS\nexport CXXFLAGS=$ORIG_CXXFLAGS\npython3 -m pip install tf-nightly-cpu\n\n# Rename to avoid the following: https://github.com/tensorflow/tensorflow/issues/40182\nmv $SRC/tensorflow/tensorflow $SRC/tensorflow/tensorflow_src\n\ncompile_python_fuzzer $SRC/fuzz_serialization.py\ncompile_python_fuzzer $SRC/fuzz_model.py\n\nzip $OUT/fuzz_model_seed_corpus.zip $SRC/hdf5-files/basic-model.h5\n"
  },
  {
    "path": "projects/keras/fuzz_model.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport json\nimport h5py\nimport chardet\n\nwith atheris.instrument_imports():\n  import keras\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  with open(\"model.hdf5\", \"wb\") as mf:\n    mf.write(data)\n\n  try:\n    keras.models.load_model(\"model.hdf5\")\n  # Catch all sorts of exceptions. The goal right now is capturing more security\n  # relevant properties so focus on code coverage.\n  except OSError:\n    return\n  except KeyError:\n    return\n  except TypeError:\n    return\n  except ValueError:\n    return\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/keras/fuzz_serialization.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport json\n\nimport keras\nfrom keras.saving import serialization_lib\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    json_dict = json.loads(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except:\n    return\n  \n  if not isinstance(json_dict, dict):\n    return\n\n  serialization_lib.deserialize_keras_object(\n    json_dict,\n    custom_objects=None\n  )\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/keras/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://keras.io\"\nmain_repo: 'https://github.com/keras-team/keras'\nlanguage: python\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/keycloak/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install libxext6 libxrender1 libxtst6 -y\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.2/bin/mvn\nENV TARGET_PACKAGE_PREFIX org.keycloak.*\n\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing cncf-fuzzing\nRUN git clone --depth 1 https://github.com/keycloak/keycloak keycloak\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/keycloak\n"
  },
  {
    "path": "projects/keycloak/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncp $SRC/cncf-fuzzing/projects/keycloak/*.java $SRC/\n$SRC/cncf-fuzzing/projects/keycloak/build.sh\n"
  },
  {
    "path": "projects/keycloak/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: \"https://www.keycloak.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/keycloak/keycloak\"\nsanitizers:\n- address\nprimary_contact: \"abstractj@redhat.com\"\nauto_ccs:\n- \"keycloak-oss-fuzz@redhat.com\"\n- \"pigor.craveiro@gmail.com\"\nvendor_ccs:\n- \"adam@adalogics.com\"\n- \"david@adalogics.com\"\n- \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/keystone/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone --depth 1 https://github.com/keystone-engine/keystone.git\n# Prepare tests\nRUN export CFLAGS=\"-pthread\" && \\\n    export CXXFLAGS=\"-pthread\" && \\\n    cd keystone/bindings/python && \\\n    make install -j$(nproc) && \\\n    python3 -m pip install .\nWORKDIR $SRC\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/keystone/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"${CXXFLAGS} -pthread\"\nexport CFLAGS=\"${CFLAGS} -pthread\"\n\n#builds project\ncd keystone\nmkdir build\ncd build\ncmake ..\nmake -j$(nproc)\nmake install -j$(nproc)\nldconfig\n\n# build fuzz target\ncd ../suite/fuzz\nls fuzz_*.c | cut -d_ -f2-4 | cut -d. -f1 | while read target\ndo\n    $CC $CFLAGS -I../../include -c fuzz_$target.c -o fuzz_$target.o\n\n    $CXX $CXXFLAGS fuzz_$target.o -o $OUT/fuzz_$target ../../build/llvm/lib/libkeystone.a $LIB_FUZZING_ENGINE\n\n    #TODO corpuses\n    cp fuzz_asm.options $OUT/fuzz_$target.options\ndone\n"
  },
  {
    "path": "projects/keystone/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.keystone-engine.org\"\nlanguage: c++\nprimary_contact: \"keystone.engine@gmail.com\"\nauto_ccs :\n  - \"p.antoine@catenacyber.fr\"\n  - \"stalkr@stalkr.net\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: 'https://github.com/keystone-engine/keystone.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/keystone/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\ncd keystone/suite\n./test-all.sh\n\ncd regress\n\n# Some of the tests have syntax errors because they are written for Python2.\n# Other tests are failing and we're not sure why. Remove these tests for now.\nmkdir -p /tmp/saved_tests\nfor failing_testcase in x86_issue293.py x64_sym_resolver.py all_archs_branch_addr.py x64_RSP_index_reg.py x86_nasm_directives.py x86_ds_default.py x86_issue10.py x86_call0.py x86_lea_three.py arm_sym_resolver_thumb.py test_all_archs.py x86_call_ptr_sym.py arm_sym_resolver.py all_archs_value_directive.py; do\n  mv ${failing_testcase} /tmp/saved_tests/\ndone\n\npython3 ./regress.py\n\nmv /tmp/saved_tests/* .\n"
  },
  {
    "path": "projects/kie-soup/CronExpressionFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.kie.soup.commons.cron.CronExpression;\nimport java.text.ParseException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-11\n// Heuristic name: jvm-autofuzz-heuristics-11\n// Target method: [org.kie.soup.commons.cron.CronExpression] public  <init>(java.lang.String) throws java.text.ParseException\npublic class CronExpressionFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      new CronExpression(data.consumeRemainingAsString());\n    } catch (ParseException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/kie-soup/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/kiegroup/kie-soup kie-soup\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/kie-soup\n"
  },
  {
    "path": "projects/kie-soup/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./kie-soup-commons/target/kie-soup-commons-$CURRENT_VERSION.jar\" $OUT/kie-soup.jar\n\nALL_JARS='kie-soup.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/kie-soup/project.yaml",
    "content": "homepage: https://github.com/kiegroup/kie-soup\nmain_repo: https://github.com/kiegroup/kie-soup\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/kimageformats/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 -b master https://invent.kde.org/frameworks/kimageformats.git\nRUN $SRC/kimageformats/autotests/ossfuzz/prepare_build.sh\nRUN cp $SRC/kimageformats/autotests/ossfuzz/build_fuzzers.sh $SRC/build.sh\n\nWORKDIR $SRC/kimageformats\n"
  },
  {
    "path": "projects/kimageformats/project.yaml",
    "content": "homepage: https://invent.kde.org/frameworks/kimageformats.git/\nlanguage: c++\nprimary_contact: tsdgeos@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://invent.kde.org/frameworks/kimageformats.git'\nauto_ccs:\n  - dnovomesky@gmail.com\n  - mircomir@gmail.com\n"
  },
  {
    "path": "projects/kiwisolver/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/nucleic/kiwi kiwi\nWORKDIR kiwi\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/kiwisolver/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/kiwisolver/fuzz_solver.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom kiwisolver import (\n    Solver,\n    UnsatisfiableConstraint,\n    Variable,\n)\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    s = Solver()\n\n    # Create an arbitrary set of variables\n    variables = []\n    num_of_variables = fdp.ConsumeIntInRange(2, 10)\n    for v in range(num_of_variables):\n        variables.append(Variable(fdp.ConsumeUnicodeNoSurrogates(20)))\n        s.addEditVariable(variables[-1], \"weak\")\n\n    # Apply a random set of constraints on these variables\n    num_of_ops = fdp.ConsumeIntInRange(2, 10)\n    for i in range(num_of_ops):\n        op = fdp.ConsumeIntInRange(1,3)\n        var = variables[fdp.ConsumeIntInRange(0,len(variables)-1)]\n        c = 1 * var\n        for i2 in range(fdp.ConsumeIntInRange(2, 5)):\n            if op == 1:\n                c = c + fdp.ConsumeIntInRange(1, 100)\n            elif op == 2:\n                c = c - fdp.ConsumeIntInRange(1, 100)\n            elif op == 3:\n                c = c * fdp.ConsumeIntInRange(1, 100)\n\n        # Add constraint\n        constr = fdp.ConsumeIntInRange(0,2)\n        if constr == 0:\n            c = c >= 0\n        elif constr == 1:\n            c = c <= 0\n        else:\n            c = c == 0\n\n        try:\n            s.addConstraint(c)\n        except UnsatisfiableConstraint:\n            return\n\n    # Set a condition/update variables.\n    s.updateVariables()\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/kiwisolver/project.yaml",
    "content": "auto_ccs:\n- david@adalogics.com\n- adam@adalogics.com\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/nucleic/kiwi\nlanguage: python\nmain_repo: https://github.com/nucleic/kiwi\nprimary_contact: m.dartiailh@gmail.com\nsanitizers:\n- address\n- undefined\n"
  },
  {
    "path": "projects/kmime/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 -b master https://invent.kde.org/pim/kmime.git\nRUN $SRC/kmime/autotests/ossfuzz/prepare_build.sh\nRUN cp $SRC/kmime/autotests/ossfuzz/build_fuzzers.sh $SRC/build.sh\n\nWORKDIR $SRC/kmime\n"
  },
  {
    "path": "projects/kmime/project.yaml",
    "content": "homepage: https://invent.kde.org/pim/kmime.git/\nlanguage: c++\nprimary_contact: tsdgeos@gmail.com\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: \"https://invent.kde.org/pim/kmime.git\"\n"
  },
  {
    "path": "projects/knative/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN git clone --depth 1 https://github.com/knative/pkg\nRUN git clone --depth 1 https://github.com/knative/serving\nWORKDIR $SRC/pkg\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/knative/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/knative/build.sh\n"
  },
  {
    "path": "projects/knative/project.yaml",
    "content": "homepage: \"https://knative.dev/\"\nlanguage: go\nprimary_contact: \"security@knative.team\"\nmain_repo: \"https://github.com/knative\"\nvendor_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\nauto_ccs:\n  - \"evana@vmware.com\"\n  - \"evan.k.anderson@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/knot-dns/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y \\\n autoconf \\\n autogen \\\n automake \\\n autopoint \\\n bison \\\n gettext \\\n gperf \\\n gtk-doc-tools \\\n libev-dev \\\n libev4 \\\n libtasn1-bin \\\n libtool \\\n make \\\n pkg-config \\\n texinfo \\\n wget\n\nENV GNULIB_TOOL $SRC/gnulib/gnulib-tool\nRUN git clone git://git.savannah.gnu.org/gnulib.git\nRUN git clone --depth=1 --recursive https://git.savannah.gnu.org/git/libunistring.git\nRUN git clone --depth=1 --branch nettle_3.9.1_release_20230601 https://git.lysator.liu.se/nettle/nettle.git\nRUN git clone --depth=1 https://gitlab.com/gnutls/gnutls.git -b 3.8.3\nRUN git clone --depth=1 https://github.com/LMDB/lmdb.git\nRUN git clone --depth=1 https://gitlab.labs.nic.cz/knot/knot-dns\n\nWORKDIR knot-dns\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/knot-dns/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# Compile and install dependencies for static linking\n# Cribbed from projects/wget2, thanks rockdaboot@gmail.com\n\nexport DEPS_PATH=$SRC/knot_deps\nexport PKG_CONFIG_PATH=$DEPS_PATH/lib64/pkgconfig:$DEPS_PATH/lib/pkgconfig\nexport CPPFLAGS=\"-I$DEPS_PATH/include\"\nexport LDFLAGS=\"-L$DEPS_PATH/lib\"\nexport GNULIB_SRCDIR=$SRC/gnulib\n\ncd $SRC/libunistring\n./autogen.sh\n./configure --enable-static --disable-shared --prefix=$DEPS_PATH\nmake -j$(nproc)\nmake install\n\nGNUTLS_CONFIGURE_FLAGS=\"\"\nNETTLE_CONFIGURE_FLAGS=\"--disable-assembler\"  # Temporarily disalbe asm to work around error \"Libnettle 3.6 was not found.\"\nif [[ $CFLAGS = *sanitize=memory* ]]; then\n  GNUTLS_CONFIGURE_FLAGS=\"--disable-hardware-acceleration\"\n  NETTLE_CONFIGURE_FLAGS=\"--disable-assembler --disable-fat\"\nfi\n\ncd $SRC/nettle\nbash .bootstrap\n./configure --enable-mini-gmp --enable-static --disable-shared --disable-documentation --prefix=$DEPS_PATH $NETTLE_CONFIGURE_FLAGS\n( make -j$(nproc) || make -j$(nproc) ) && make install\n\ncd $SRC/gnutls\ntouch .submodule.stamp\n./bootstrap\nLIBS=\"-lunistring\" \\\n./configure --with-nettle-mini --disable-gcc-warnings --enable-static --disable-shared --with-included-libtasn1 \\\n    --with-included-unistring --without-p11-kit --disable-doc --disable-tests --disable-tools --disable-cxx \\\n    --disable-maintainer-mode --disable-libdane --disable-full-test-suite --prefix=$DEPS_PATH $GNUTLS_CONFIGURE_FLAGS\nmake -j$(nproc)\nmake install\n\ncd $SRC/lmdb/libraries/liblmdb\nmake -j$(nproc)\nmake install\n\n# Compile knot, install fuzzers to $OUT\n\ncd $SRC/knot-dns\nsed -i 's/-llmdb/-Wl,-Bstatic,-llmdb,-Bdynamic/' configure.ac\nautoreconf -if\n./configure --with-oss-fuzz=yes --disable-shared --enable-static --disable-daemon --disable-utilities --disable-documentation \\\n    --disable-fastparser --disable-modules\nmake -j$(nproc)\ncd $SRC/knot-dns/tests-fuzz\nmake check\n/bin/bash ../libtool   --mode=install /usr/bin/install -c fuzz_packet fuzz_zscanner fuzz_dname_to_str fuzz_dname_from_str \"$OUT\"\n\n# Set up fuzzing seeds\n\ngit submodule update --init -- ./fuzz_packet.in\ngit submodule update --init -- ./fuzz_zscanner.in\n# ./fuzz_dname_to_str.in/ and ./fuzz_dname_from_str.in/ are stored in the base repository\nfind ./fuzz_packet.in/         -type f -exec zip -u $OUT/fuzz_packet_seed_corpus.zip {} \\;\nfind ./fuzz_zscanner.in/       -type f -exec zip -u $OUT/fuzz_zscanner_seed_corpus.zip {} \\;\nfind ./fuzz_dname_to_str.in/   -type f -exec zip -u $OUT/fuzz_dname_to_str_seed_corpus.zip {} \\;\nfind ./fuzz_dname_from_str.in/ -type f -exec zip -u $OUT/fuzz_dname_from_str_seed_corpus.zip {} \\;\n"
  },
  {
    "path": "projects/knot-dns/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.knot-dns.cz/\"\nmain_repo: \"https://gitlab.nic.cz/knot/knot-dns.git\"\nlanguage: c++\nprimary_contact: \"knot.dns@gmail.com\"\nauto_ccs:\n  - \"jonathan.foote@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/krb5/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf bison\nRUN git clone --depth=1 https://github.com/krb5/krb5.git\nRUN cp $SRC/krb5/src/tests/fuzzing/oss-fuzz.sh $SRC/build.sh\nWORKDIR $SRC/krb5/\n"
  },
  {
    "path": "projects/krb5/project.yaml",
    "content": "homepage: \"https://web.mit.edu/kerberos/\"\nlanguage: c\nprimary_contact: \"krbcore-security@mit.edu\"\nauto_ccs:\n  - \"pkillarjun@protonmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/krb5/krb5'\n"
  },
  {
    "path": "projects/kryo/DeserializeCollectionsFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.esotericsoftware.kryo.Kryo;\nimport com.esotericsoftware.kryo.io.Input;\nimport com.esotericsoftware.kryo.KryoException;\nimport com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer;\n\nimport java.util.*;\n\npublic class DeserializeCollectionsFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Kryo kryo = new Kryo();\n        kryo.register(SomeClass.class);\n\n        kryo.setReferences(data.consumeBoolean());\n        if (data.consumeBoolean())\n            kryo.setDefaultSerializer(CompatibleFieldSerializer.class);\n\n        Input in = new Input(data.consumeRemainingAsBytes());\n        try {\n            kryo.readObject(in, SomeClass.class);\n        } catch (KryoException e) {\n        } finally {\n            in.close();\n        }\n    }\n\n    public static final class SomeClass {\n        List<String> _emptyList = Collections.emptyList();\n        Set<String> _emptySet = Collections.emptySet();\n        Map<String, String> _emptyMap = Collections.emptyMap();\n        List<String> _singletonList = Collections.singletonList(\"foo\");\n        Set<String> _singletonSet = Collections.emptySet();\n        Map<String, String> _singletonMap;\n        TreeSet<String> _treeSet;\n        TreeMap<String, Integer> _treeMap;\n        List<String> _arrayList;\n        Set<String> _hashSet;\n        Map<String, Integer> _hashMap;\n        List<Integer> _asList = Arrays.asList(1, 2, 3);\n        int[] _intArray;\n        long[] _longArray;\n        short[] _shortArray;\n        float[] _floatArray;\n        double[] _doubleArray;\n        byte[] _byteArray;\n        char[] _charArray;\n        String[] _stringArray;\n        Integer[] _integerArray;\n        BitSet _bitSet;\n    }\n\n}\n"
  },
  {
    "path": "projects/kryo/DeserializeNumbersFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.esotericsoftware.kryo.Kryo;\nimport com.esotericsoftware.kryo.io.Input;\nimport com.esotericsoftware.kryo.KryoException;\nimport com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer;\n\nimport java.util.*;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport java.util.concurrent.atomic.AtomicLong;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\n\npublic class DeserializeNumbersFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Kryo kryo = new Kryo();\n        kryo.register(SomeClass.class);\n\n        kryo.setReferences(data.consumeBoolean());\n        if (data.consumeBoolean())\n            kryo.setDefaultSerializer(CompatibleFieldSerializer.class);\n\n        Input in = new Input(data.consumeRemainingAsBytes());\n        try {\n            kryo.readObject(in, SomeClass.class);\n        } catch (KryoException e) {\n        } finally {\n            in.close();\n        }\n    }\n\n    public static final class SomeClass {\n        Date _date;\n        TimeZone _timeZone;\n        Calendar _calendar;\n        Locale _locale;\n        Integer[] _integerArray;\n        boolean _boolean;\n        char _char;\n        byte _byte;\n        short _short;\n        int _int1;\n        int _int2;\n        long _long;\n        float _float;\n        double _double;\n        Boolean _Boolean;\n        Character _Character;\n        Byte _Byte;\n        Short _Short;\n        Integer _Integer;\n        Long _Long;\n        Float _Float;\n        Double _Double;\n        BigInteger _bigInteger;\n        BigDecimal _bigDecimal;\n        AtomicInteger _atomicInteger;\n        AtomicLong _atomicLong;\n    }\n}\n"
  },
  {
    "path": "projects/kryo/DeserializeStringFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.esotericsoftware.kryo.Kryo;\nimport com.esotericsoftware.kryo.io.Input;\nimport com.esotericsoftware.kryo.KryoException;\nimport com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer;\n\npublic class DeserializeStringFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Kryo kryo = new Kryo();\n        kryo.register(SomeClass.class);\n\n        kryo.setReferences(data.consumeBoolean());\n        if (data.consumeBoolean())\n            kryo.setDefaultSerializer(CompatibleFieldSerializer.class);\n\n        Input in = new Input(data.consumeRemainingAsBytes());\n        try {\n            kryo.readObject(in, SomeClass.class);\n        } catch (KryoException e) {\n        } finally {\n            in.close();\n        }\n    }\n\n    public static final class SomeClass {\n        String value;\n    }\n}\n"
  },
  {
    "path": "projects/kryo/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone --depth 1 https://github.com/EsotericSoftware/kryo\n\nCOPY build.sh $SRC/\nCOPY DeserializeCollectionsFuzzer.java DeserializeNumbersFuzzer.java DeserializeStringFuzzer.java $SRC/\nWORKDIR $SRC/kryo\n"
  },
  {
    "path": "projects/kryo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\ncurrent_version=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n-Dexpression=project.version -q -DforceStdout)\ncp \"target/kryo-$current_version.jar\" $OUT/kryo.jar\n\nALL_JARS=\"kryo.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac --enable-preview --release 17 -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n  cp $SRC/${fuzzer_basename}\\$SomeClass.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:--enable-preview\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/kryo/project.yaml",
    "content": "homepage: \"http://esotericsoftware.com/\"\nlanguage: jvm\nprimary_contact: \"thomas@umschalt.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/EsotericSoftware/kryo\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/kubearmor/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-go\nENV FUZZING_LANGUAGE=go\nRUN git clone https://github.com/kubearmor/KubeArmor\nCOPY build.sh $SRC/\nWORKDIR $SRC/KubeArmor/KubeArmor\n"
  },
  {
    "path": "projects/kubearmor/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nchmod +x $SRC/KubeArmor/KubeArmor/fuzz/build.sh\n$SRC/KubeArmor/KubeArmor/fuzz/build.sh\n"
  },
  {
    "path": "projects/kubearmor/project.yaml",
    "content": "homepage: \"https://kubearmor.io/\"\nmain_repo: \"https://github.com/kubearmor/KubeArmor\"\nprimary_contact: \"kubearmor@accuknox.com\"\nauto_ccs :\n  - \"barun.acharya@accuknox.com\"\n  - \"rudraksh@accuknox.com\"\n  - \"ramakant@accuknox.com\"\n  - \"rickprimeranjan@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address"
  },
  {
    "path": "projects/kubeedge/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/kubeedge/kubeedge\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nCOPY build.sh $SRC/\nWORKDIR $SRC/kubeedge\n"
  },
  {
    "path": "projects/kubeedge/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nsed 's/go 1.16/go 1.19 /g' -i $SRC/kubeedge/go.mod\ncd $SRC/kubeedge && go mod tidy\n\n$SRC/cncf-fuzzing/projects/kubeedge/build.sh\n"
  },
  {
    "path": "projects/kubeedge/project.yaml",
    "content": "homepage: \"https://kubeedge.io/en/\"\nprimary_contact: \"linguohui1@huawei.com\"\nauto_ccs :\n  - \"xufei40@huawei.com\"\n  - \"wangzefeng@huawei.com\"\nvendor_ccs :\n  - \"Adam@adalogics.com\"\n  - \"David@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/kubeedge/kubeedge'\n"
  },
  {
    "path": "projects/kubeflow-katib/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/kubeflow/katib\nRUN wget https://go.dev/dl/go1.25.1.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.25.1.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\nWORKDIR katib\nCOPY build.sh *.go $SRC/\n"
  },
  {
    "path": "projects/kubeflow-katib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/generateNNImage_fuzzer.go $SRC/katib/pkg/ui/v1beta1/\ncompile_native_go_fuzzer_v2 github.com/kubeflow/katib/pkg/ui/v1beta1 FuzzGenerateNNImage FuzzGenerateNNImage\n"
  },
  {
    "path": "projects/kubeflow-katib/generateNNImage_fuzzer.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage v1beta1\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzGenerateNNImage(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, input1, input2 string) {\n\t\t// the target function is full of panics,\n\t\t// so we fuzz only for unrecoverable bugs.\n\t\tdefer func() {\n\t\t\tif r := recover(); r != nil {\n\t\t\t}\n\t\t}()\n\t\tgenerateNNImage(input1, input2)\n\t})\n}\n"
  },
  {
    "path": "projects/kubeflow-katib/project.yaml",
    "content": "homepage: \"https://github.com/kubeflow/katib\"\nlanguage: go\nprimary_contact: \"andrey.velichkevich@gmail.com\"\nmain_repo: \"https://github.com/kubeflow/katib\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"johnugeorge109@gmail.com\"\n  - \"antonin@stefanutti.fr\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/kubeflow-model-registry/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/kubeflow/model-registry\nWORKDIR model-registry\nCOPY build.sh *.go $SRC/\n"
  },
  {
    "path": "projects/kubeflow-model-registry/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/filter_fuzzer.go $SRC/model-registry/internal/db/filter/\ncompile_native_go_fuzzer_v2 github.com/kubeflow/model-registry/internal/db/filter FuzzFilterParse FuzzFilterParse\n"
  },
  {
    "path": "projects/kubeflow-model-registry/filter_fuzzer.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage filter\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzFilterParse(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data string) {\n\t\tParse(data)\n\t})\n}\n"
  },
  {
    "path": "projects/kubeflow-model-registry/project.yaml",
    "content": "homepage: \"https://github.com/kubeflow/model-registry\"\nlanguage: go\nprimary_contact: \"mmortari@redhat.com\"\nmain_repo: \"https://github.com/kubeflow/model-registry\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"ignatowicz@gmail.com\"\n  - \"seth.pro@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/kubeflow-pipelines/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/kubeflow/pipelines\nWORKDIR pipelines\nCOPY build.sh *.go $SRC/\n"
  },
  {
    "path": "projects/kubeflow-pipelines/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nrm $SRC/pipelines/backend/src/v2/expression/expression_test.go\nmv $SRC/expr_fuzzer.go $SRC/pipelines/backend/src/v2/expression/\ncompile_native_go_fuzzer_v2 github.com/kubeflow/pipelines/backend/src/v2/expression FuzzExprSelect FuzzExprSelect\n"
  },
  {
    "path": "projects/kubeflow-pipelines/expr_fuzzer.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage expression\n\nimport (\n\t\"testing\"\n\n\t\"google.golang.org/protobuf/types/known/structpb\"\n)\n\nfunc FuzzExprSelect(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, input1, input2, input3, input4 string, inputType uint8) {\n\t\tvar input *structpb.Value\n\t\tswitch int(inputType) % 2 {\n\t\tcase 0:\n\t\t\tinput = structpb.NewStringValue(input1)\n\t\tcase 1:\n\t\t\tm := map[string]interface{}{\n\t\t\t\tinput2: input3,\n\t\t\t}\n\t\t\ts, err := structpb.NewStruct(m)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tinput = structpb.NewStructValue(s)\n\n\t\t}\n\n\t\texpr, err := New()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\texpr.Select(input, input4)\n\t})\n}\n"
  },
  {
    "path": "projects/kubeflow-pipelines/project.yaml",
    "content": "homepage: \"https://github.com/kubeflow/pipelines\"\nlanguage: go\nprimary_contact: \"rmartine@redhat.com\"\nmain_repo: \"https://github.com/kubeflow/pipelines\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"humair88@hotmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/kubeflow-spark-operator/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/kubeflow/spark-operator\nWORKDIR spark-operator\nCOPY build.sh *.go $SRC/\n"
  },
  {
    "path": "projects/kubeflow-spark-operator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nrm $SRC/spark-operator/pkg/certificate/certificate_test.go\nrm $SRC/spark-operator/pkg/certificate/suite_test.go\nrm $SRC/spark-operator/pkg/certificate/util_test.go\nmv $SRC/parseSecret_fuzzer.go $SRC/spark-operator/pkg/certificate/\ncompile_native_go_fuzzer_v2 github.com/kubeflow/spark-operator/v2/pkg/certificate FuzzParseCertManagerSecret FuzzParseCertManagerSecret\ncompile_native_go_fuzzer_v2 github.com/kubeflow/spark-operator/v2/pkg/certificate FuzzParseInternalCertSecret FuzzParseInternalCertSecret\n"
  },
  {
    "path": "projects/kubeflow-spark-operator/parseSecret_fuzzer.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage certificate\n\nimport (\n\t\"testing\"\n\n\t\"github.com/kubeflow/spark-operator/v2/pkg/common\"\n\tcorev1 \"k8s.io/api/core/v1\"\n)\n\nfunc FuzzParseCertManagerSecret(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, input1, input2, input3 []byte) {\n\t\tcp := &Provider{}\n\t\tcp.parseCertManagerSecret(&corev1.Secret{\n\t\t\tData: map[string][]byte{\n\t\t\t\tcommon.CACert:  input1,\n\t\t\t\tcommon.TLSCert: input2,\n\t\t\t\tcommon.TLSKey:  input3,\n\t\t\t},\n\t\t})\n\t})\n}\n\nfunc FuzzParseInternalCertSecret(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, input1, input2, input3, input4 []byte) {\n\t\tcp := &Provider{}\n\t\tcp.parseInternalCertSecret(&corev1.Secret{\n\t\t\tData: map[string][]byte{\n\t\t\t\tcommon.CACertPem:     input1,\n\t\t\t\tcommon.CAKeyPem:      input2,\n\t\t\t\tcommon.ServerCertPem: input3,\n\t\t\t\tcommon.ServerKeyPem:  input4,\n\t\t\t},\n\t\t})\n\t})\n}\n"
  },
  {
    "path": "projects/kubeflow-spark-operator/project.yaml",
    "content": "homepage: \"https://github.com/kubeflow/spark-operator\"\nlanguage: go\nprimary_contact: \"github@chenyicn.net\"\nmain_repo: \"https://github.com/kubeflow/spark-operator\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"vara.bonthu@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/kubernetes/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth 1 https://github.com/kubernetes/kubernetes.git\nRUN git clone --depth 1 https://github.com/google/AFL\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus\nRUN git clone --depth 1 https://github.com/kubernetes/kops\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN git clone --depth 1 https://github.com/AdamKorcz/instrumentation\nRUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=november-backup\nRUN wget https://go.dev/dl/go1.24.5.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.5.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\nWORKDIR $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/kubernetes/build.sh",
    "content": "#!/bin/bash\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -o nounset\nset -o pipefail\nset -o errexit\nset -x\n\n# Compile kOps fuzzers\n(\ncd kops\n./tests/fuzz/build.sh\n)\n\n# Compile Kubernetes fuzzers\ncd $SRC/kubernetes\n\nfunction compile_fuzzer {\n  local pkg=$1\n  local function=$2\n  local fuzzer=\"${pkg}_${function}\"\n\n  compile_go_fuzzer \"k8s.io/kubernetes/test/fuzz/${pkg}\" $function $fuzzer\n}\n\n# Build fuzzers from cncf-fuzzing:\n$SRC/cncf-fuzzing/projects/kubernetes/build.sh\n\n\ncompile_fuzzer \"yaml\" \"FuzzDurationStrict\"\ncompile_fuzzer \"yaml\" \"FuzzMicroTimeStrict\"\ncompile_fuzzer \"yaml\" \"FuzzSigYaml\"\ncompile_fuzzer \"yaml\" \"FuzzTimeStrict\"\ncompile_fuzzer \"yaml\" \"FuzzYamlV2\"\ncompile_fuzzer \"json\" \"FuzzStrictDecode\"\ncompile_fuzzer \"json\" \"FuzzNonStrictDecode\"\n"
  },
  {
    "path": "projects/kubernetes/project.yaml",
    "content": "homepage: \"https://kubernetes.io\"\nprimary_contact: \"security@kubernetes.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"aojea@google.com\"\n  - \"david@adalogics.com\"\n  - \"mikedanese@google.com\"\n  - \"tabitha.c.sable@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nlanguage: go\nmain_repo: 'https://github.com/kubernetes/kubernetes.git'\n"
  },
  {
    "path": "projects/kubernetes-cluster-api/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/kubernetes-sigs/cluster-api\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nCOPY build.sh $SRC/\nWORKDIR $SRC/cluster-api\n"
  },
  {
    "path": "projects/kubernetes-cluster-api/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n$SRC/cncf-fuzzing/projects/cluster-api/build.sh\n"
  },
  {
    "path": "projects/kubernetes-cluster-api/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://cluster-api.sigs.k8s.io\"\nmain_repo: \"https://github.com/kubernetes-sigs/cluster-api\"\nprimary_contact: \"sishivani@vmware.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"jeewan@vmware.com\"\n  - \"naadir@randomvariable.co.uk\"\n  - \"buringerst@vmware.com\"\n  - \"swamyan@vmware.com\"\n  - \"kmuldoon@vmware.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/kubevirt/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt update && apt install -y qemu-kvm libvirt-daemon-system\nRUN git clone --depth 1 https://github.com/kubevirt/kubevirt\nRUN git clone --depth=1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=v2_2 $SRC/go-118-fuzz-build\nRUN git clone --depth=1 --branch=2025-work https://github.com/AdamKorcz/go-fuzz-headers-1 $SRC/go-fuzz-headers\nRUN git clone --depth=1 https://github.com/cncf/cncf-fuzzing\nCOPY build.sh  $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/kubevirt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/kubevirt/build.sh\n"
  },
  {
    "path": "projects/kubevirt/project.yaml",
    "content": "homepage: \"https://kubevirt.io\"\nprimary_contact: \"adam@adalogics.com\"\nauto_ccs :\n  - \"david@adalogics.com\"\n  - \"cncf-kubevirt-maintainers@lists.cncf.io\"\n  - \"vromanso@redhat.com\"\n  - \"rhallisey@nvidia.com\"\n  - \"bcarey@redhat.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/kubevirt/kubevirt'\n"
  },
  {
    "path": "projects/kyverno/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/kyverno/kyverno\nCOPY build.sh $SRC/\nWORKDIR $SRC/kyverno\n"
  },
  {
    "path": "projects/kyverno/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/kyverno/test/fuzz/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/kyverno/project.yaml",
    "content": "homepage: \"https://www.kyverno.io\"\nmain_repo: \"https://github.com/kyverno/kyverno\"\nprimary_contact: \"chipzoller@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/lame/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool subversion pkg-config wget\n\n# ubuntu apt has not recent enough mpg123\nRUN wget https://www.mpg123.de/snapshot\nRUN tar -xvf snapshot\nRUN mv mpg123* mpg123\n\nRUN git clone --depth 1 https://github.com/guidovranken/LAME-fuzzers\nRUN svn checkout https://svn.code.sf.net/p/lame/svn/trunk/lame $SRC/lame\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/lame/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd mpg123\nif [[ \"$ARCHITECTURE\" == \"i386\" ]]; then\n\t./configure --enable-static --with-cpu=$ARCHITECTURE\nelse\n\t./configure --enable-static\nfi\nmake -j$(nproc)\nmake install\npopd\n\ncd $SRC/lame\n./configure\nmake -j$(nproc)\n\ncd $SRC/LAME-fuzzers\nif [[ $CXXFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\n$CXX -std=c++17 -Wall -Wextra -Werror $CXXFLAGS -I fuzzing-headers/include/ -I $SRC/lame/include/ fuzzer-encoder.cpp $LIB_FUZZING_ENGINE $SRC/lame/libmp3lame/.libs/libmp3lame.a /usr/local/lib/libmpg123.a -lm -o $OUT/fuzzer-encoder\ncp fuzzer-encoder_seed_corpus.zip $OUT/\ncp fuzzer-encoder.dict $OUT/\n"
  },
  {
    "path": "projects/lame/project.yaml",
    "content": "homepage: \"https://sourceforge.net/projects/lame/\"\nmain_repo: \"https://svn.code.sf.net/p/lame/svn/trunk/lame\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nauto_ccs:\n    - \"bouvigne@gmail.com\"\nsanitizers:\n - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\narchitectures:\n - x86_64\n - i386\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/lark-parser/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/lark-parser/lark lark\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/lark\n"
  },
  {
    "path": "projects/lark-parser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/lark-parser/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1.1\n# Imports by the generated code\nimport lark\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  grammar = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1,4096))\n  text = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1,4096))\n\n  # Class target.\n  try:\n    c1 = lark.lark.Lark(grammar)\n    c1.parse(text)\n  except(lark.exceptions.LarkError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/lark-parser/project.yaml",
    "content": "homepage: https://github.com/lark-parser/lark\nmain_repo: https://github.com/lark-parser/lark\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/lcms/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/mm2/Little-CMS.git lcms\nRUN mkdir $SRC/seeds && \\\n    cd seeds && \\\n    cp $SRC/lcms/testbed/bad.icc . && \\\n    cp $SRC/lcms/testbed/toosmall.icc . && \\\n    cp $SRC/lcms/testbed/test1.icc . && \\\n    cp $SRC/lcms/testbed/crayons.icc . && \\\n    cp $SRC/lcms/testbed/ibm-t61.icc . && \\\n    #add more seeds from the testbed dir\n    cp $SRC/lcms/testbed/bad_mpe.icc . && \\\n    cp $SRC/lcms/testbed/new.icc . && \\\n    cp $SRC/lcms/testbed/test2.icc . && \\\n    cp $SRC/lcms/testbed/test3.icc . && \\\n    cp $SRC/lcms/testbed/test4.icc . && \\\n    cp $SRC/lcms/testbed/test5.icc . && \\\n    zip -rj $SRC/seed_corpus.zip $SRC/seeds/*\n\nWORKDIR lcms\nCOPY build.sh run_tests.sh *.c *.options *.dict $SRC/\n"
  },
  {
    "path": "projects/lcms/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build the target.\n./configure --enable-shared=no\nmake -j$(nproc) all\n\n# build your fuzzer(s)\nFUZZERS=\"cmsIT8_load_fuzzer            \\\n        cms_transform_fuzzer           \\\n        cms_overwrite_transform_fuzzer \\\n        cms_transform_all_fuzzer       \\\n        cms_profile_fuzzer             \\\n        cms_universal_transform_fuzzer \\\n        cms_transform_extended_fuzzer  \\\n        cms_md5_fuzzer                 \\\n        cms_dict_fuzzer                \\\n        cms_postscript_fuzzer          \\\n        cms_cie_cam02_fuzzer           \\\n        cms_gdb_fuzzer                 \\\n        cms_cgats_fuzzer               \\\n        cms_virtual_profile_fuzzer     \\\n        cms_devicelink_fuzzer\" \n\n\nfor F in $FUZZERS; do\n    $CC $CFLAGS -c -Iinclude \\\n        $SRC/$F.c -o $SRC/$F.o\n    $CXX $CXXFLAGS \\\n        $SRC/$F.o -o $OUT/$F \\\n        $LIB_FUZZING_ENGINE src/.libs/liblcms2.a\ndone\n\ncp $SRC/*.dict $SRC/*.options $OUT/\ncp $SRC/icc.dict $OUT/cms_transform_all_fuzzer.dict\ncp $SRC/icc.dict $OUT/cms_transform_extended_fuzzer.dict\ncp $SRC/icc.dict $OUT/cms_universal_transform_fuzzer.dict\ncp $SRC/icc.dict $OUT/cms_profile_fuzzer.dict\ncp $SRC/icc.dict $OUT/cms_postscript_fuzzer.dict\ncp $SRC/icc.dict $OUT/cms_virtual_profile_fuzzer.dict\ncp $SRC/icc.dict $OUT/cms_md5_fuzzer.dict\ncp $SRC/seed_corpus.zip $OUT/cms_postscript_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_profile_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_universal_transform_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_transform_all_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_transform_extended_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_transform_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_virtual_profile_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cmsIT8_load_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_md5_fuzzer_seed_corpus.zip\ncp $SRC/seed_corpus.zip $OUT/cms_overwrite_transform_fuzzer_seed_corpus.zip"
  },
  {
    "path": "projects/lcms/cmsIT8_load_fuzzer.c",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <stdint.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#include \"lcms2.h\"\n\n// The main sink\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size == 0)\n    return 0;\n\n  cmsHANDLE handle = cmsIT8LoadFromMem(0, (void *)data, size);\n  if (handle) {\n    char filename[256];\n    sprintf(filename, \"/tmp/fuzzer-it.%d.it8\", getpid());\n    cmsIT8SaveToFile(handle, filename);\n\n    cmsIT8Free(handle);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cmsIT8_load_fuzzer.options",
    "content": "[libfuzzer]\ndict = icc.dict\n"
  },
  {
    "path": "projects/lcms/cms_cgats_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n    if (size < 8){\n        return 0;\n    }\n\n    cmsContext context = cmsCreateContext(NULL, (void *)data);\n\n    uint32_t Row = *((uint32_t *)data);\n    uint32_t Col = *((uint32_t *)data+1);\n\n    /* Write */\n    cmsHANDLE  it8;\n    cmsInt32Number i;\n\n    it8 = cmsIT8Alloc(0);\n    if (it8 == NULL) return 0;\n\n    cmsIT8SetSheetType(it8, \"LCMS/TESTING\");\n    cmsIT8SetPropertyStr(it8, \"ORIGINATOR\",   \"1 2 3 4\");\n    cmsIT8SetPropertyUncooked(it8, \"DESCRIPTOR\",   \"1234\");\n    cmsIT8SetPropertyStr(it8, \"MANUFACTURER\", \"3\");\n    cmsIT8SetPropertyDbl(it8, \"CREATED\",     data[0] / 255.0);\n    cmsIT8SetPropertyDbl(it8, \"SERIAL\",      data[1] / 255.0);\n    cmsIT8SetPropertyHex(it8, \"MATERIAL\",     0x123);\n\n    cmsIT8SetPropertyDbl(it8, \"NUMBER_OF_SETS\", 10);\n    cmsIT8SetPropertyDbl(it8, \"NUMBER_OF_FIELDS\", Row);\n\n    cmsIT8SetDataFormat(it8, 0, \"SAMPLE_ID\");\n    cmsIT8SetDataFormat(it8, 1, \"RGB_R\");\n    cmsIT8SetDataFormat(it8, 2, \"RGB_G\");\n    cmsIT8SetDataFormat(it8, 3, \"RGB_B\");\n\n    for (i=0; i < 10; i++) {\n\n          char Patch[20];\n\n          sprintf(Patch, \"P%d\", i);\n\n          cmsIT8SetDataRowCol(it8, i, 0, Patch);\n          cmsIT8SetDataRowColDbl(it8, i, 1, i);\n          cmsIT8SetDataRowColDbl(it8, i, 2, i);\n          cmsIT8SetDataRowColDbl(it8, i, 3, i);\n    }\n\n    cmsIT8SaveToFile(it8, \"TEST.IT8\");\n    cmsIT8Free(it8);\n\n    it8 = cmsIT8LoadFromFile(0, \"TEST.IT8\");\n    if (it8 == NULL) return 0;\n\n    /* Read */\n    cmsIT8GetDataRowColDbl(it8,Row,Col);\n    cmsIT8GetPropertyDbl(it8, \"DESCRIPTOR\");\n    cmsIT8GetDataDbl(it8, \"P3\", \"RGB_G\");\n\n    cmsIT8Free(it8);\n    return 1;\n}\n"
  },
  {
    "path": "projects/lcms/cms_cie_cam02_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    \n    if (size < sizeof(cmsViewingConditions)) {\n        return 0;\n    }\n\n    // Define and initialize the viewing conditions structure\n    cmsViewingConditions viewingConditions;\n    viewingConditions.whitePoint.X = data[0]/ 255.0;\n    viewingConditions.whitePoint.Y = data[1]/ 255.0;\n    viewingConditions.whitePoint.Z = data[2]/ 255.0;\n    viewingConditions.Yb = data[3] / 255.0;\n    viewingConditions.La = data[4]/ 255.0;\n    viewingConditions.surround = data[5] % 4 + 1; //from 1 to 4\n    viewingConditions.D_value = data[6] / 255.0;\n\n    cmsContext context = cmsCreateContext(NULL, NULL);\n\n    cmsHANDLE hModel = cmsCIECAM02Init(context, &viewingConditions);\n\n    if (hModel) {\n        // Perform forward and reverse CAM02 transformations with appropriate input data\n        cmsCIEXYZ inputXYZ;\n        inputXYZ.X = data[0]/ 255.0;  // Random value between 0 and 1\n        inputXYZ.Y = data[1] / 255.0;\n        inputXYZ.Z = data[2] / 255.0;\n        cmsJCh outputJCh;\n        cmsCIEXYZ outputXYZ;\n        cmsCIECAM02Forward(hModel, &inputXYZ, &outputJCh);\n        cmsCIECAM02Reverse(hModel, &outputJCh, &outputXYZ);\n        cmsCIECAM02Done(hModel);\n    }\n    cmsDeleteContext(context);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_devicelink_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"lcms2.h\"\n#include <stdint.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  if (size < 4) {\n    return 0;\n  }\n\n  // cmsCreateInkLimitingDeviceLink\n  cmsFloat64Number limit = *((const uint32_t *)data) % 401;\n\n  cmsHPROFILE limitingDeviceLinkProfile =\n      cmsCreateInkLimitingDeviceLink(cmsSigCmykData, limit);\n  if (limitingDeviceLinkProfile) {\n    cmsCloseProfile(limitingDeviceLinkProfile);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_dict_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdlib.h>\n#include \"lcms2.h\"\n\nwchar_t* generateWideString(const char* characters, const uint8_t *data){\n    if (!characters){\n        return NULL;\n    }\n    \n    char stringToWide[10];\n    for (int i = 0; i < 9; i++){\n        stringToWide[i] = characters[data[i] % 95];\n    }\n    stringToWide[9] = '\\0';\n    \n    int requiredSize = mbstowcs(NULL, stringToWide, 0);\n    wchar_t* wideString = (wchar_t *)malloc((requiredSize + 1) * sizeof(wchar_t));\n    mbstowcs(wideString, stringToWide, requiredSize + 1);\n    return wideString;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size < 27){\n        return 0;\n    }\n\n    cmsContext context = cmsCreateContext(NULL, (void *)data);\n    if (!context) {\n        return 0;\n    }\n\n    // Create a Dictionary handle\n    cmsHANDLE hDict = cmsDictAlloc(context);\n    if (!hDict) {\n        return 0;\n    }\n    \n\n    cmsMLU *mlu = cmsMLUalloc(hDict, 0);\n    if (!mlu) {\n        return 0;\n    }\n    \n    char* characters = \" !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\";\n    wchar_t* wideString = generateWideString(characters, data);\n    cmsMLUsetWide(mlu, \"en\", \"US\", wideString);\n    free(wideString);\n    \n    \n    char ObtainedLanguage[3], ObtainedCountry[3];\n    ObtainedLanguage[0] = characters[*(data+1) % 95];\n    ObtainedLanguage[1] = characters[*(data+2) % 95];\n    ObtainedLanguage[2] = characters[*(data) % 95];\n\n    ObtainedCountry[0] = characters[*(data+2) % 95];\n    ObtainedCountry[1] = characters[*data % 95];\n    ObtainedCountry[2] = characters[*(data+1) % 95];\n    cmsMLUgetTranslation(mlu, \"en\", \"US\",ObtainedLanguage,ObtainedCountry);\n    cmsMLUtranslationsCount(mlu);\n    cmsMLUtranslationsCodes(mlu, *((uint32_t *)data), ObtainedLanguage, ObtainedCountry);\n\n    cmsMLU* displayName = mlu;\n    cmsMLU* displayValue = mlu;\n\n    //cmsDictAddEntry\n    wchar_t* name = generateWideString(characters, data + 9);\n    wchar_t* value = generateWideString(characters, data + 18);\n    cmsDictAddEntry(hDict, name, value, displayName, displayValue);\n    free(name);\n    free(value);\n\n    //cmsDictDup\n    cmsHANDLE ResultDictDup = cmsDictDup(hDict);\n    if (ResultDictDup) {\n        cmsDictFree(ResultDictDup);\n    }\n    // Iterate over the Dictionary entries\n    const cmsDICTentry* entry = cmsDictGetEntryList(hDict);\n    cmsDictNextEntry(entry);\n    cmsMLUfree(mlu);\n    cmsDictFree(hDict);\n    return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_gdb_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n    if (size < 16) {\n        return 0;\n    }\n    //cmsGBDAlloc\n    cmsHANDLE hGDB = cmsGBDAlloc(NULL);\n    if (!hGDB){\n        return 0;\n    }\n    //cmsGDBAddPoint\n    cmsCIELab Lab;\n    Lab.L = *((const uint32_t *)data);\n    Lab.a = *((const uint32_t *)data+1);\n    Lab.b = *((const uint32_t *)data+2);\n    cmsGDBAddPoint(hGDB, &Lab);\n    \n    //cmsGDBCheckPoint\n    cmsGDBCheckPoint(hGDB, &Lab);\n\n    //cmsGDBCompute\n    cmsGDBCompute(hGDB, *((const uint32_t *)data+3));\n\n    //cmsGBDFree\n    cmsGBDFree(hGDB);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_md5_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n    cmsHPROFILE hProfile = cmsOpenProfileFromMem(data, size);\n    if (!hProfile){\n        return 0;\n    }\n    //cmsMD5computeID\n    cmsMD5computeID(hProfile);\n    cmsCloseProfile(hProfile);\n    return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_overwrite_transform_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n if (size < 2) {\n   return 0;\n }\n\n size_t mid = size / 2;\n\n cmsHPROFILE hInProfile, hOutProfile;\n cmsHTRANSFORM hTransform;\n\n hInProfile = cmsOpenProfileFromMem(data, mid);\n hOutProfile = cmsOpenProfileFromMem(data + mid, size - mid);\n hTransform = cmsCreateTransform(hInProfile, TYPE_BGR_8, hOutProfile,\n                                 TYPE_BGR_8, INTENT_PERCEPTUAL, 0);\n cmsCloseProfile(hInProfile);\n cmsCloseProfile(hOutProfile);\n\n if (hTransform) {\n   cmsDeleteTransform(hTransform);\n }\n return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_overwrite_transform_fuzzer.options",
    "content": "[libfuzzer]\ndict = icc.dict\n"
  },
  {
    "path": "projects/lcms/cms_postscript_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n    if (size < 16) {\n        return 0;\n    }\n\n    cmsContext context = cmsCreateContext(NULL, (void *)data);\n    if (!context){\n        return 0;\n    }\n\n    cmsHPROFILE hProfile = cmsOpenProfileFromMem(data, size);\n    if (!hProfile){\n        return 0;\n    }\n\n    uint32_t flags         = *((const uint32_t *)data+2);\n    uint32_t intent        = *((const uint32_t *)data+3) % 16;\n    \n    /* cmsGetPostScriptCSA */\n    cmsUInt32Number result1 = cmsGetPostScriptCSA(context, hProfile, intent, flags, NULL, size);\n    /* cmsGetPostScriptCRD */\n    cmsUInt32Number result2 = cmsGetPostScriptCRD(context, hProfile, intent, flags,  NULL, size);\n\n    cmsCloseProfile(hProfile);\n    cmsDeleteContext(context);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_profile_fuzzer.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <unistd.h>\n\n#include \"lcms2.h\"\n\ncmsTagSignature tagsToRead[] = {\n  cmsSigGreenColorantTag,\n  cmsSigGreenMatrixColumnTag,\n  cmsSigGreenTRCTag,\n  cmsSigMeasurementTag,\n  cmsSigNamedColorTag,\n  cmsSigPreview1Tag,\n  cmsSigPs2CRD2Tag,\n  cmsSigPs2CRD3Tag,\n  cmsSigRedTRCTag,\n};\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size == 0)\n    return 0;\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d.icc\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  cmsHPROFILE hProfile = cmsOpenProfileFromFile(filename, \"r\");\n  // If we have a profile, perform a set of operations\n  if (hProfile) {\n    char tagBuffer[4];\n\n    // Perform multiple tag reads. Read tags twice as behavior matters\n    // if tags have been read before.\n    for (int j = 0; j < 2; j++) {\n      for (int i = 0; i < sizeof(tagsToRead)/sizeof(tagsToRead[0]); i++) {\n        cmsReadRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n        cmsReadRawTag(hProfile, tagsToRead[i], NULL, 0);\n        cmsReadRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n        cmsReadTag(hProfile, tagsToRead[i]);\n      }\n    }\n\n    // Read profile info\n    cmsInfoType info = data[0] % 4;\n    char outBuffer[100];\n\n    cmsGetProfileInfoASCII(hProfile, info, \"DEN\", \"DEN\", outBuffer, 100);\n    cmsGetTagCount(hProfile);\n    if (size > 2) {\n      cmsGetTagSignature(hProfile, (cmsUInt32Number)data[1]);\n    }\n    if (size > 40) {\n      cmsTagSignature tag = *((uint32_t *)(data+5));\n      cmsTagLinkedTo(hProfile, tag);\n    }\n\n    // Save to random file\n    cmsSaveProfileToFile(hProfile, \"random.icc\");\n    cmsCloseProfile(hProfile);\n  }\n\n  // Let's write the profile now.\n  hProfile = cmsOpenProfileFromFile(filename, \"w\");\n  if (hProfile) {\n    char tagBuffer[4] = {'a', 'a', 'a', 'a'};\n\n    // Perform multiple tag reads\n    for (int j = 0; j < 2; j++) {\n      for (int i = 0; i < sizeof(tagsToRead)/sizeof(tagsToRead[0]); i++) {\n        cmsReadRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n        cmsReadRawTag(hProfile, tagsToRead[i], NULL, 0);\n        cmsReadRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n        cmsReadTag(hProfile, tagsToRead[i]);\n      }\n    }\n\n    for (int i = 0; i < sizeof(tagsToRead)/sizeof(tagsToRead[0]); i++) {\n      cmsWriteRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n    }\n\n    for (int j = 0; j < 2; j++) {\n      for (int i = 0; i < sizeof(tagsToRead)/sizeof(tagsToRead[0]); i++) {\n        cmsReadRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n        cmsReadRawTag(hProfile, tagsToRead[i], NULL, 0);\n        cmsReadRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n        cmsReadTag(hProfile, tagsToRead[i]);\n      }\n    }\n\n    for (int i = 0; i < sizeof(tagsToRead)/sizeof(tagsToRead[0]); i++) {\n      cmsWriteRawTag(hProfile, tagsToRead[i], tagBuffer, 4);\n    }\n\n    // Save to random file\n    cmsSaveProfileToFile(hProfile, \"random.icc\");\n    cmsCloseProfile(hProfile);\n  }\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_transform_all_fuzzer.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\nvoid\nrun_test(const uint8_t *data,\n         size_t size,\n         uint32_t intent_id,\n         uint32_t input_format,\n         uint32_t output_format,\n         uint32_t flags) {\n if (size < 2) {\n   return;\n }\n\n size_t mid = size / 2;\n\n cmsHPROFILE hInProfile, hOutProfile;\n cmsHTRANSFORM hTransform;\n\n hInProfile = cmsOpenProfileFromMem(data, mid);\n hOutProfile = cmsOpenProfileFromMem(data + mid, size - mid);\n hTransform = cmsCreateTransform(hInProfile, input_format, hOutProfile,\n                                 output_format, intent_id, flags);\n cmsCloseProfile(hInProfile);\n cmsCloseProfile(hOutProfile);\n\n if (hTransform) {\n   cmsDeleteTransform(hTransform);\n }\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n if (size < 16) {\n  return 0;\n }\n\n // Generate a random set of args for cmsCreateTransform\n uint32_t input_format  = *((const uint32_t *)data);\n uint32_t output_format = *((const uint32_t *)data+1);\n uint32_t flags         = *((const uint32_t *)data+2);\n uint32_t intent        = *((const uint32_t *)data+3) % 16;\n data += 16;\n size -= 16;\n\n run_test(data, size, intent, input_format, output_format, flags);\n return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_transform_extended_fuzzer.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\n// An extended cmsDoTransform fuzzer. The idea is to include a range of\n// input/output source formats.\n\nvoid\nrun_test(const uint8_t *data,\n         size_t size,\n         uint32_t intent,\n         uint32_t flags, int dstVal) {\n  if (size < 2) {\n    return;\n  }\n\n  cmsHPROFILE srcProfile = cmsOpenProfileFromMem(data, size);\n  if (!srcProfile) return;\n\n  // Select dstProfile and dstFormat\n  cmsHPROFILE dstProfile;\n  uint32_t dstFormat;\n  if (dstVal == 1) {\n    dstProfile = cmsCreateLab4Profile(NULL);\n    dstFormat = TYPE_Lab_8;\n  }\n  else if (dstVal == 2) {\n    dstProfile = cmsCreateLab2Profile(NULL);\n    dstFormat = TYPE_LabV2_8;\n  }\n  else if (dstVal == 3) {\n    cmsToneCurve* gamma18;\n    gamma18 = cmsBuildGamma(0, 1.8);\n    dstProfile = cmsCreateGrayProfile(NULL, gamma18);\n    cmsFreeToneCurve(gamma18);\n    dstFormat = TYPE_GRAY_FLT | EXTRA_SH(1);\n  }\n  else if (dstVal == 4) {\n    dstProfile = cmsCreateXYZProfile();\n    dstFormat = TYPE_XYZ_16;\n  }\n  else if (dstVal == 5) {\n    dstProfile = cmsCreateXYZProfile();\n    dstFormat = TYPE_XYZ_DBL;\n  }\n  else if (dstVal == 6) {\n    dstProfile = cmsCreateLab4Profile(NULL);\n    dstFormat = TYPE_Lab_DBL;\n  }\n  else if (dstVal == 7) {\n    dstProfile = cmsCreateLab4Profile(NULL);\n    dstFormat = TYPE_Lab_DBL;\n  }\n  else if (dstVal == 8){\n    dstProfile = cmsCreate_OkLabProfile(NULL);\n    dstFormat = (FLOAT_SH(1)|COLORSPACE_SH(PT_MCH3)|CHANNELS_SH(3)|BYTES_SH(0));\n  }\n  else if (dstVal == 9){\n    dstProfile = cmsCreateNULLProfile();\n    dstFormat = 0;\n  }\n  else if (dstVal == 10){\n    dstProfile = cmsCreateBCHSWabstractProfile(17, 0, 1.2, 0, 3, 5000, 5000);\n    dstFormat = TYPE_Lab_DBL;\n  }\n  else {\n    dstProfile = cmsCreate_sRGBProfile();\n    dstFormat = TYPE_RGB_8;\n  }\n\n  if (!dstProfile) {\n    cmsCloseProfile(srcProfile);\n    return;\n  }\n\n  // Extract srcFormat from the random src profile\n  cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);\n  cmsUInt32Number nSrcComponents = cmsChannelsOf(srcCS);\n  cmsUInt32Number srcFormat;\n  if (srcCS == cmsSigLabData) {\n    if (dstVal != 7) {\n        srcFormat =\n            COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);\n    }\n    else {\n        srcFormat =\n            COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0) | FLOAT_SH(1);\n    }\n  } else {\n    srcFormat =\n        COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);\n  }\n\n  // Create the transform\n  cmsContext ctx = cmsCreateContext(NULL, NULL);\n  cmsHTRANSFORM hTransform = cmsCreateTransformTHR(\n    ctx,\n    srcProfile,\n    srcFormat,\n    dstProfile,\n    dstFormat,\n    intent,\n    flags);\n\n  cmsCloseProfile(srcProfile);\n  cmsCloseProfile(dstProfile);\n  if (!hTransform) return;\n\n\n  // Do transformation.\n  // The output buffer type depends on the dstFormat\n  // The input buffer type depends on the srcFormat.\n  if (T_BYTES(srcFormat) == 0) {  // 0 means double\n    // Ensure output is large enough\n    long long output[nSrcComponents*4];\n    double input[nSrcComponents];\n    for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 0.5f;\n    cmsDoTransform(hTransform, input, output, 1);\n  } \n  else {\n    uint8_t input[nSrcComponents];\n    for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 128;\n\n    if (dstFormat == TYPE_XYZ_16) {\n      cmsCIEXYZ output_XYZ = { 0, 0, 0 };\n      cmsDoTransform(hTransform, input, &output_XYZ, 1);\n    }\n    else if (dstFormat == TYPE_XYZ_DBL) {\n      cmsCIEXYZTRIPLE out[4];\n      cmsDoTransform(hTransform, input, out, 1);\n    }\n    else if (dstFormat == TYPE_Lab_DBL || dstFormat == (FLOAT_SH(1)|COLORSPACE_SH(PT_MCH3)|CHANNELS_SH(3)|BYTES_SH(0))) {\n      cmsCIELab Lab1;\n      cmsDoTransform(hTransform, input, &Lab1, 1);\n    }\n    else {\n      uint8_t output[4];\n      cmsDoTransform(hTransform, input, output, 1);\n    }\n  }\n  cmsDeleteTransform(hTransform);\n}\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 12) {\n    return 0;\n  }\n\n  uint32_t flags         = *((const uint32_t *)data+0);\n  uint32_t intent        = *((const uint32_t *)data+1) % 16;\n  int decider = *((int*)data+2) % 11;\n  data += 12;\n  size -= 12;\n\n  // Transform using various output formats.\n  run_test(data, size, intent, flags, decider);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_transform_fuzzer.c",
    "content": "// Copyright 2016 The PDFium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n#include <stdint.h>\n\n#include \"lcms2.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  cmsHPROFILE srcProfile = cmsOpenProfileFromMem(data, size);\n  if (!srcProfile) return 0;\n\n  cmsHPROFILE dstProfile = cmsCreate_sRGBProfile();\n  if (!dstProfile) {\n    cmsCloseProfile(srcProfile);\n    return 0;\n  }\n\n  cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);\n  cmsUInt32Number nSrcComponents = cmsChannelsOf(srcCS);\n  cmsUInt32Number srcFormat;\n  if (srcCS == cmsSigLabData) {\n    srcFormat =\n        COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);\n  } else {\n    srcFormat =\n        COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);\n  }\n\n  cmsUInt32Number intent = 0;\n  cmsUInt32Number flags = 0;\n  cmsHTRANSFORM hTransform = cmsCreateTransform(\n      srcProfile, srcFormat, dstProfile, TYPE_BGR_8, intent, flags);\n  cmsCloseProfile(srcProfile);\n  cmsCloseProfile(dstProfile);\n  if (!hTransform) return 0;\n\n  uint8_t output[4];\n  if (T_BYTES(srcFormat) == 0) {  // 0 means double\n    double input[nSrcComponents];\n    for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 0.5f;\n    cmsDoTransform(hTransform, input, output, 1);\n  } else {\n    uint8_t input[nSrcComponents];\n    for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = 128;\n    cmsDoTransform(hTransform, input, output, 1);\n  }\n  cmsDeleteTransform(hTransform);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_transform_fuzzer.options",
    "content": "[libfuzzer]\ndict = icc.dict\n"
  },
  {
    "path": "projects/lcms/cms_universal_transform_fuzzer.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include \"lcms2.h\"\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n if (size < 2) {\n   return 0;\n }\n\n size_t mid = size / 2;\n\n cmsHPROFILE hInProfile, hOutProfile;\n cmsHTRANSFORM hTransform;\n\n hInProfile = cmsOpenProfileFromMem(data, mid);\n hOutProfile = cmsOpenProfileFromMem(data + mid, size - mid);\n hTransform = cmsCreateTransform(hInProfile, TYPE_BGR_8, hOutProfile,\n                                 TYPE_BGR_8, INTENT_PERCEPTUAL, 0);\n cmsCloseProfile(hInProfile);\n cmsCloseProfile(hOutProfile);\n\n if (hTransform) {\n   cmsDeleteTransform(hTransform);\n }\n return 0;\n}\n"
  },
  {
    "path": "projects/lcms/cms_virtual_profile_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"lcms2.h\"\n#include <stdint.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  if (size < 16) {\n    return 0;\n  }\n\n  cmsHPROFILE hInProfile = cmsOpenProfileFromMem(data, size);\n  if (!hInProfile) {\n    return 0;\n  }\n\n  cmsHPROFILE hOutProfile = cmsCreate_sRGBProfile();\n  if (!hOutProfile) {\n    cmsCloseProfile(hInProfile);\n    return 0;\n  }\n  cmsColorSpaceSignature srcCS = cmsGetColorSpace(hInProfile);\n  cmsUInt32Number nSrcComponents = cmsChannelsOf(srcCS);\n  cmsUInt32Number srcFormat;\n  if (srcCS == cmsSigLabData) {\n    srcFormat =\n        COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);\n  } else {\n    srcFormat =\n        COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);\n  }\n  cmsHTRANSFORM hTransform = cmsCreateTransform(\n      hInProfile, srcFormat, hOutProfile, TYPE_BGR_8,\n      *((const uint32_t *)data + 3) % 16, *((const uint32_t *)data + 2));\n\n  cmsCloseProfile(hInProfile);\n  cmsCloseProfile(hOutProfile);\n  if (!hTransform) {\n    return 0;\n  }\n\n  cmsFloat64Number version;\n  if (*((const uint32_t *)data + 3) % 2 == 0) {\n    version = 3.4;\n  } else {\n    version = 4.4;\n  }\n\n  // cmsTransform2DeviceLink\n  cmsHPROFILE devicelinkProfile = cmsTransform2DeviceLink(\n      hTransform, version, *((const uint32_t *)data + 2));\n\n  // clean up\n  cmsDeleteTransform(hTransform);\n  if (devicelinkProfile) {\n    cmsCloseProfile(devicelinkProfile);\n  }\n\n  // cmsCreateLinearizationDeviceLink\n  cmsToneCurve *tone = cmsBuildGamma(NULL, *((const uint32_t *)data + 3));\n  if (!tone) {\n    return 0;\n  }\n  // 15 curves, so it can handle all color spaces\n  cmsToneCurve *rgb_curves[15] = {tone, tone, tone, tone, tone,\n                                  tone, tone, tone, tone, tone,\n                                  tone, tone, tone, tone, tone};\n  cmsHPROFILE linearizationDeviceLinkProfile =\n      cmsCreateLinearizationDeviceLink(srcCS, rgb_curves);\n\n  cmsFreeToneCurve(tone);\n\n  if (linearizationDeviceLinkProfile) {\n    cmsCloseProfile(linearizationDeviceLinkProfile);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/lcms/icc.dict",
    "content": "# Fuzzing dictionary for icc\n# Extracted from lcms2.h of Little-CMS project 2.8.\n\nmagic=\"acsp\"\nsig=\"lcms\"\n\n# Base ICC type definitions\n\"chrm\"\n\"clro\"\n\"clrt\"\n\"crdi\"\n\"curv\"\n\"data\"\n\"dict\"\n\"dtim\"\n\"devs\"\n\"mft2\"\n\"mft1\"\n\"mAB \"\n\"mBA \"\n\"meas\"\n\"mluc\"\n\"mpet\"\n\"ncol\"\n\"ncl2\"\n\"para\"\n\"pseq\"\n\"psid\"\n\"rcs2\"\n\"sf32\"\n\"scrn\"\n\"sig \"\n\"text\"\n\"desc\"\n\"uf32\"\n\"bfd \"\n\"ui16\"\n\"ui32\"\n\"ui64\"\n\"ui08\"\n\"vcgt\"\n\"view\"\n\"XYZ \"\n\n# Base ICC tag definitions\n\"A2B0\"\n\"A2B1\"\n\"A2B2\"\n\"bXYZ\"\n\"bXYZ\"\n\"bTRC\"\n\"B2A0\"\n\"B2A1\"\n\"B2A2\"\n\"calt\"\n\"targ\"\n\"chad\"\n\"chrm\"\n\"clro\"\n\"clrt\"\n\"clot\"\n\"ciis\"\n\"cprt\"\n\"crdi\"\n\"data\"\n\"dtim\"\n\"dmnd\"\n\"dmdd\"\n\"devs\"\n\"D2B0\"\n\"D2B1\"\n\"D2B2\"\n\"D2B3\"\n\"B2D0\"\n\"B2D1\"\n\"B2D2\"\n\"B2D3\"\n\"gamt\"\n\"kTRC\"\n\"gXYZ\"\n\"gXYZ\"\n\"gTRC\"\n\"lumi\"\n\"meas\"\n\"bkpt\"\n\"wtpt\"\n\"ncol\"\n\"ncl2\"\n\"resp\"\n\"rig0\"\n\"pre0\"\n\"pre1\"\n\"pre2\"\n\"desc\"\n\"dscm\"\n\"pseq\"\n\"psid\"\n\"psd0\"\n\"psd1\"\n\"psd2\"\n\"psd3\"\n\"ps2s\"\n\"ps2i\"\n\"rXYZ\"\n\"rXYZ\"\n\"rTRC\"\n\"rig2\"\n\"scrd\"\n\"scrn\"\n\"tech\"\n\"bfd \"\n\"vued\"\n\"view\"\n\"vcgt\"\n\"meta\"\n\"arts\"\n\n# ICC Technology tag\n\"dcam\"\n\"fscn\"\n\"rscn\"\n\"ijet\"\n\"twax\"\n\"epho\"\n\"esta\"\n\"dsub\"\n\"rpho\"\n\"fprn\"\n\"vidm\"\n\"vidc\"\n\"pjtv\"\n\"CRT \"\n\"PMD \"\n\"AMD \"\n\"KPCD\"\n\"imgs\"\n\"grav\"\n\"offs\"\n\"silk\"\n\"flex\"\n\"mpfs\"\n\"mpfr\"\n\"dmpc\"\n\"dcpj\"\n\n# ICC Color spaces\n\"XYZ \"\n\"Lab \"\n\"Luv \"\n\"YCbr\"\n\"Yxy \"\n\"RGB \"\n\"GRAY\"\n\"HSV \"\n\"HLS \"\n\"CMYK\"\n\"CMY \"\n\"MCH1\"\n\"MCH2\"\n\"MCH3\"\n\"MCH4\"\n\"MCH5\"\n\"MCH6\"\n\"MCH7\"\n\"MCH8\"\n\"MCH9\"\n\"MCHA\"\n\"MCHB\"\n\"MCHC\"\n\"MCHD\"\n\"MCHE\"\n\"MCHF\"\n\"nmcl\"\n\"1CLR\"\n\"2CLR\"\n\"3CLR\"\n\"4CLR\"\n\"5CLR\"\n\"6CLR\"\n\"7CLR\"\n\"8CLR\"\n\"9CLR\"\n\"ACLR\"\n\"BCLR\"\n\"CCLR\"\n\"DCLR\"\n\"ECLR\"\n\"FCLR\"\n\"LuvK\"\n\n# ICC Profile Class\n\"scnr\"\n\"mntr\"\n\"prtr\"\n\"link\"\n\"abst\"\n\"spac\"\n\"nmcl\"\n\n# ICC Platforms\n\"APPL\"\n\"MSFT\"\n\"SUNW\"\n\"SGI \"\n\"TGNT\"\n\"*nix\"\n\n# Reference gamut\n\"prmg\"\n\n# For cmsSigColorimetricIntentImageStateTag\n\"scoe\"\n\"sape\"\n\"fpce\"\n\"rhoc\"\n\"rpoc\"\n\n# Multi process elements types\n\"cvst\"\n\"matf\"\n\"clut\"\n\"bACS\"\n\"eACS\"\n\"l2x \"\n\"x2l \"\n\"ncl \"\n\"2 4 \"\n\"4 2 \"\n\"idn \"\n\"d2l \"\n\"l2d \"\n\"d2x \"\n\"x2d \"\n\"clp \"\n\n# Types of CurveElements\n\"parf\"\n\"samf\"\n\"curf\"\n\n# Used in ResponseCurveType\n\"StaA\"\n\"StaE\"\n\"StaI\"\n\"StaT\"\n\"StaM\"\n\"DN  \"\n\"DN P\"\n\"DNN \"\n\"DNNP\"\n\n"
  },
  {
    "path": "projects/lcms/project.yaml",
    "content": "main_repo: \"https://github.com/mm2/Little-CMS\"\nhomepage: \"http://www.littlecms.com/\"\nlanguage: c++\nprimary_contact: \"marti.maria.s@gmail.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n  - i386\n"
  },
  {
    "path": "projects/lcms/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake check\n"
  },
  {
    "path": "projects/leptonica/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make automake libtool \\\n  pkg-config cmake nasm\n# Install autoconf 2.71+ required by libtiff\nRUN curl -LO http://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz && \\\n    tar xzf autoconf-2.71.tar.gz && \\\n    cd autoconf-2.71 && \\\n    ./configure && \\\n    make && \\\n    make install && \\\n    cd .. && \\\n    rm -rf autoconf-2.71 autoconf-2.71.tar.gz\nRUN git clone --depth 1 https://github.com/DanBloomberg/leptonica.git leptonica\nRUN git clone --depth 1 https://github.com/madler/zlib.git zlib\nRUN git clone --depth 1 https://gitlab.com/libtiff/libtiff libtiff\nRUN git clone --depth 1 https://github.com/glennrp/libpng.git libpng\nRUN git clone --depth 1 https://chromium.googlesource.com/webm/libwebp libwebp\nRUN git clone https://www.cl.cam.ac.uk/~mgk25/git/jbigkit jbigkit\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo libjpeg-turbo\nRUN git clone --depth 1 https://github.com/facebook/zstd zstd\nWORKDIR leptonica\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/leptonica/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/leptonica/prog/fuzzing/oss-fuzz-build.sh\n\n"
  },
  {
    "path": "projects/leptonica/project.yaml",
    "content": "homepage: \"http://www.leptonica.com\"\nlanguage: c++\nprimary_contact: \"taking@google.com\"\nauto_ccs:\n  - \"kusano@google.com\"\n  - \"dbloomberg@google.com\"\n  - \"dan.bloomberg@gmail.com\"\n  - \"stjoweil@googlemail.com\"\n  - \"Adam@adalogics.com\"\n  - \"ballbach@google.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nlabels:\n  pix_rotate_shear_fuzzer:\n    - sundew\nmain_repo: 'https://github.com/DanBloomberg/leptonica.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/leveldb/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y build-essential cmake gettext make\nRUN git clone --recurse-submodules https://github.com/google/leveldb.git\n\nWORKDIR $SRC/\n\n# Copy in our files\nCOPY build.sh $SRC/\nCOPY *.cc $SRC/leveldb/\nCOPY *.options $SRC/\n"
  },
  {
    "path": "projects/leveldb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n# Copyright 2020 Luca Boccassi <bluca@debian.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Avoid: clang++: error: invalid argument '-fsanitize=vptr' not allowed with '-fno-rtti'\nCFLAGS=\"$CFLAGS     -fno-sanitize=vptr\"\nCXXFLAGS=\"$CXXFLAGS -fno-sanitize=vptr\"\n\n# Pick C++17 due to use of std::filesystem\nCXXFLAGS=\"$CXXFLAGS -std=c++17\"\n\ncd $SRC/leveldb\nmkdir -p build && cd build\ncmake -DCMAKE_BUILD_TYPE=Release -DLEVELDB_BUILD_TESTS=0 \\\n    -DLEVELDB_BUILD_BENCHMARKS=0 -DCMAKE_CXX_STANDARD=17 .. && cmake --build .\n\nfor fuzzer in fuzz_db; do\n    # Compile\n    $CXX $CXXFLAGS -c ../${fuzzer}.cc -o ${fuzzer}.o \\\n        -DLEVELDB_PLATFORM_POSIX=1 -Wall \\\n        -I$SRC/leveldb/build/include -I$SRC/leveldb/ -I$SRC/leveldb/include\n\n    # Link\n    $CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${fuzzer}.o -o $OUT/${fuzzer} $SRC/leveldb/build/libleveldb.a\ndone\n\n# Copy options to out\ncp $SRC/*options $OUT/\n"
  },
  {
    "path": "projects/leveldb/fuzz_db.cc",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n\n#include <cstdint>\n#include <cstddef>\n#include <filesystem>\n#include <memory>\n#include <string>\n\n#include \"leveldb/db.h\"\n#include \"leveldb/iterator.h\"\n#include \"leveldb/options.h\"\n#include \"leveldb/status.h\"\n\n#include <fuzzer/FuzzedDataProvider.h>\n\nnamespace {\n\n// Deletes the database directory when going out of scope.\nclass AutoDbDeleter {\n public:\n  static constexpr char kDbPath[] = \"/tmp/testdb\";\n\n  AutoDbDeleter() = default;\n\n  AutoDbDeleter(const AutoDbDeleter&) = delete;\n  AutoDbDeleter& operator=(const AutoDbDeleter&) = delete;\n\n  ~AutoDbDeleter() {\n    std::filesystem::remove_all(kDbPath);\n  }\n};\n\n// static\nconstexpr char AutoDbDeleter::kDbPath[];\n\n// Returns nullptr (a falsey unique_ptr) if opening fails.\nstd::unique_ptr<leveldb::DB> OpenDB() {\n  leveldb::Options options;\n  options.create_if_missing = true;\n\n  leveldb::DB* db_ptr;\n  leveldb::Status status =\n      leveldb::DB::Open(options, AutoDbDeleter::kDbPath, &db_ptr);\n  if (!status.ok())\n    return nullptr;\n\n  return std::unique_ptr<leveldb::DB>(db_ptr);\n}\n\nenum class FuzzOp {\n  kPut = 0,\n  kGet = 1,\n  kDelete = 2,\n  kGetProperty = 3,\n  kIterate = 4,\n  kGetReleaseSnapshot = 5,\n  kReopenDb = 6,\n  kCompactRange = 7,\n  // Add new values here.\n\n  // When adding new values, update to the last value above.\n  kMaxValue = kCompactRange,\n};\n\n}  // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Must occur before `db` so the deletion doesn't happen while the DB is open.\n  AutoDbDeleter db_deleter;\n\n  std::unique_ptr<leveldb::DB> db = OpenDB();\n  if (!db.get())\n    return 0;\n\n  // Perform a sequence of operations on the database.\n  FuzzedDataProvider fuzzed_data(data, size);\n  while (fuzzed_data.remaining_bytes() != 0) {\n    FuzzOp fuzz_op = fuzzed_data.ConsumeEnum<FuzzOp>();\n\n    switch (fuzz_op) {\n    case FuzzOp::kPut: {\n      std::string key = fuzzed_data.ConsumeRandomLengthString();\n      std::string value = fuzzed_data.ConsumeRandomLengthString();\n      db->Put(leveldb::WriteOptions(), key, value);\n      break;\n    }\n    case FuzzOp::kGet: {\n      std::string key = fuzzed_data.ConsumeRandomLengthString();\n      std::string value;\n      db->Get(leveldb::ReadOptions(), key, &value);\n      break;\n    }\n    case FuzzOp::kDelete: {\n      std::string key = fuzzed_data.ConsumeRandomLengthString();\n      db->Delete(leveldb::WriteOptions(), key);\n      break;\n    }\n    case FuzzOp::kGetProperty: {\n      std::string name = fuzzed_data.ConsumeRandomLengthString();\n      std::string value;\n      db->GetProperty(name, &value);\n      break;\n    }\n    case FuzzOp::kIterate: {\n      std::unique_ptr<leveldb::Iterator> it(\n          db->NewIterator(leveldb::ReadOptions()));\n      for (it->SeekToFirst(); it->Valid(); it->Next())\n        continue;\n    }\n    case FuzzOp::kGetReleaseSnapshot: {\n      leveldb::ReadOptions snapshot_options;\n      snapshot_options.snapshot = db->GetSnapshot();\n      std::unique_ptr<leveldb::Iterator> it(db->NewIterator(snapshot_options));\n      db->ReleaseSnapshot(snapshot_options.snapshot);\n    }\n    case FuzzOp::kReopenDb: {\n      // The database must be closed before attempting to reopen it. Otherwise,\n      // the open will fail due to exclusive locking.\n      db.reset();\n      db = OpenDB();\n      if (!db)\n        return 0;  // Reopening the database failed.\n      break;\n    }\n    case FuzzOp::kCompactRange: {\n      std::string begin_key = fuzzed_data.ConsumeRandomLengthString();\n      std::string end_key =  fuzzed_data.ConsumeRandomLengthString();\n      leveldb::Slice begin_slice(begin_key);\n      leveldb::Slice end_slice(end_key);\n      db->CompactRange(&begin_slice, &end_slice);\n      break;\n    }\n    }\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/leveldb/fuzz_db.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/leveldb/project.yaml",
    "content": "homepage: \"https://github.com/google/leveldb\"\nlanguage: c++\nprimary_contact: \"costan@google.com\"\nauto_ccs :\n  - \"cmumford@google.com\"\n  - \"david@adalogics.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nmain_repo: 'https://github.com/google/leveldb.git'\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libaom/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake yasm wget\nRUN git clone https://aomedia.googlesource.com/aom\nADD https://storage.googleapis.com/aom-test-data/fuzzer/dec_fuzzer_seed_corpus.zip $SRC/\nCOPY build.sh $SRC/\nWORKDIR aom\n"
  },
  {
    "path": "projects/libaom/README.md",
    "content": "# Submit a Patch to oss-fuzz repo\n\n## One-time Setup\n\n1.  Create github account if needed (with @google.com email address, preferably)\n    and log in.\n1.  To allow “git push” to work, you’ll have to add an SSH key:\n    https://help.github.com/articles/connecting-to-github-with-ssh/\n1.  Go to https://github.com/google/oss-fuzz and click on “Fork”.\n1.  Go to your own fork of the repo, which will be at\n    https://github.com/\\<git_username\\>/oss-fuzz\n1.  Click on “clone or download” and pick “Clone with SSH” method (I found that\n    easier to use for “git push”). Then copy that URL and run “git clone \\<URL\\>”\n    in terminal. Now you have a local repo, and **your fork** of the remote repo\n    will be called “**origin**” in your git config.\n1.  Configure a remote repo pointing to the **upstream repo**\n    (https://github.com/google/oss-fuzz) so that it’s called “**upstream**”:\n    *   cd \\<local_oss_fuzz_repo_directory\\>/oss-fuzz\n    *   git remote add upstream git@github.com:google/oss-fuzz.git\n    *   git remote -v\n\nNOTE: For trivial changes it's possible to edit the files in the web UI on the\nmain project and create a commit + pull request from that.\n\n## Workflow for a Pull Request (Patch)\n\n1.  Go to your repo:\n    *   cd \\<local_oss_fuzz_repo_directory\\>/oss-fuzz\n1.  Create a new branch:\n    *   git checkout master\n    *   git checkout -b new_feature_xyz\n1.  Make your changes and commit them locally with “git commit”\n1.  Push your changes to your fork on github\n    *   git push -u origin HEAD\n    *   (This will create a branch of the same name “new_feature_xyz” on your\n        fork “origin”).\n1.  Open your fork in browser and click on “Compare & pull request” and follow\n    the prompts.\n1.  If changes are requested to the patch:\n    *   make changes to the same local branch\n    *   commit them locally with “git commit” (but DO NOT amend!)\n    *   git push -u origin HEAD\n1.  Once pull request is closed:\n    *   Delete “new_feature_xyz” branch on your fork using the “Delete branch”\n        button on the pull request\n    *   Delete local “new_feature_xyz” branch locally with “git checkout master\n        && git branch -D new_feature_xyz”\n    *   Sync your local repo and your fork with upstream repo:\n        *   git checkout master\n        *   git fetch upstream\n        *   git merge upstream/master\n        *   git push origin master\n"
  },
  {
    "path": "projects/libaom/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build libaom\nbuild_dir=$WORK/build\nmkdir -p ${build_dir}\npushd ${build_dir}\n# Remove files generated by the previous build.\nrm -rf ./*\n\n# oss-fuzz has 2 GB total memory allocation limit. So, we limit per-allocation\n# limit in libaom to 1 GB to avoid OOM errors. A smaller per-allocation is\n# needed for MemorySanitizer (see bug oss-fuzz:9497 and bug oss-fuzz:9499).\nif [[ $CFLAGS = *sanitize=memory* ]]; then\n  extra_c_flags='-DAOM_MAX_ALLOCABLE_MEMORY=536870912'\nelse\n  extra_c_flags='-DAOM_MAX_ALLOCABLE_MEMORY=1073741824'\nfi\n# Also, enable DO_RANGE_CHECK_CLAMP to suppress the noise of integer overflows\n# in the transform functions.\nextra_c_flags+=' -DDO_RANGE_CHECK_CLAMP=1'\n\nextra_cmake_flags=\n# MemorySanitizer requires that all program code is instrumented. Therefore we\n# need to replace all inline assembly code that writes to memory with pure C\n# code. Disable all assembly code for MemorySanitizer.\nif [[ $CFLAGS = *sanitize=memory* ]]; then\n  extra_cmake_flags+=\"-DAOM_TARGET_CPU=generic\"\nfi\n\ncmake $SRC/aom -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE='-O3 -g' \\\n  -DCMAKE_CXX_FLAGS_RELEASE='-O3 -g' -DCONFIG_PIC=1 -DCONFIG_LOWBITDEPTH=1 \\\n  -DCONFIG_AV1_ENCODER=0 -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTS=0 \\\n  -DCONFIG_SIZE_LIMIT=1 -DDECODE_HEIGHT_LIMIT=12288 -DDECODE_WIDTH_LIMIT=12288 \\\n  -DAOM_EXTRA_C_FLAGS=\"${extra_c_flags}\" -DENABLE_TOOLS=0 \\\n  -DAOM_EXTRA_CXX_FLAGS=\"${extra_c_flags}\" ${extra_cmake_flags}\nmake -j$(nproc)\npopd\n\n# build fuzzers\nfuzzer_src_name=av1_dec_fuzzer\nfuzzer_name=${fuzzer_src_name}\n\n$CXX $CXXFLAGS -std=c++11 \\\n  -I$SRC/aom \\\n  -I${build_dir} \\\n  -Wl,--start-group \\\n  $LIB_FUZZING_ENGINE \\\n  $SRC/aom/examples/${fuzzer_src_name}.cc -o $OUT/${fuzzer_name} \\\n  ${build_dir}/libaom.a -Wl,--end-group\n\n# copy seed corpus.\ncp $SRC/dec_fuzzer_seed_corpus.zip $OUT/${fuzzer_name}_seed_corpus.zip\ncp $SRC/aom/examples/av1_dec_fuzzer.dict $OUT/${fuzzer_name}.dict\n\n"
  },
  {
    "path": "projects/libaom/project.yaml",
    "content": "homepage: \"https://aomedia.org/av1-features/get-started/\"\nlanguage: c++\nprimary_contact: \"wtc@google.com\"\nsanitizers:\n- address\n- memory\n- undefined\nauto_ccs:\n- jianj@google.com\n- jingning@google.com\n- jzern@google.com\n- wtc@google.com\n- yunqingwang@google.com\nvendor_ccs:\n- twsmith@mozilla.com\nmain_repo: 'https://aomedia.googlesource.com/aom'\n"
  },
  {
    "path": "projects/libarchive/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y make autoconf libtool pkg-config \\\n        libbz2-dev liblzo2-dev liblzma-dev liblz4-dev libz-dev \\\n        libssl-dev libacl1-dev libattr1-dev lrzip liblzo2-dev \\\n\t      liblz4-tool lzop zstd lcab genisoimage jlha-utils rar default-jdk sharutils\nRUN curl -LO http://mirrors.kernel.org/ubuntu/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\n    apt install ./automake_1.16.5-1.3_all.deb\nRUN git clone --depth 1 https://github.com/libarchive/libarchive.git\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git\n# compile libxml2 from source so we can statically link\nRUN mkdir /deps && \\\n  cd $SRC/libxml2 && \\\n  ./autogen.sh \\\n      --without-debug \\\n      --without-ftp \\\n      --without-http \\\n      --without-legacy \\\n      --without-python \\\n      --enable-static && \\\n  make -j$(nproc) && \\\n  make install && \\\n  cp .libs/libxml2.a /deps/\n\nCOPY run_tests.sh build.sh libarchive_fuzzer.cc $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/libarchive/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# For fuzz-introspector. This is to exclude all libxml2 code from the\n# fuzz-introspector reports.\nexport FUZZ_INTROSPECTOR_CONFIG=$SRC/fuzz_introspector_exclusion.config\ncat > $FUZZ_INTROSPECTOR_CONFIG <<EOF\nFILES_TO_AVOID\nlibxml2\nEOF\n\nDEPS=/deps\n\ncd $SRC/libarchive\n\nmkdir build2\ncd build2\ncmake -DDONT_FAIL_ON_CRC_ERROR=ON -DENABLE_WERROR=OFF ../\nmake -j$(nproc)\n\n# build seed\ncp $SRC/libarchive/contrib/oss-fuzz/corpus.zip\\\n        $OUT/libarchive_fuzzer_seed_corpus.zip\n\n# build fuzzer(s)\n$CXX $CXXFLAGS -I../libarchive \\\n    $SRC/libarchive_fuzzer.cc -o $OUT/libarchive_fuzzer \\\n    $LIB_FUZZING_ENGINE ./libarchive/libarchive.a \\\n    -Wl,-Bstatic -llzo2 -Wl,-Bdynamic -lcrypto -lacl -llzma -llz4 -lbz2 -lz ${DEPS}/libxml2.a\n\n# add the uuencoded test files\ncd $SRC\nmkdir ./uudecoded\nfind $SRC/libarchive/ -type f -name \"test_extract.*.uu\" -print0 | xargs -0 -I % cp -f % ./uudecoded/\ncd ./uudecoded\nfind ./ -name \"*.uu\" -exec uudecode {} \\;\ncd ../\nrm -f ./uudecoded/*.uu\nzip -jr $OUT/libarchive_fuzzer_seed_corpus.zip ./uudecoded/*\n\n# add weird archives\ngit clone --depth=1 https://github.com/corkami/pocs\nfind ./pocs/ -type f -print0 | xargs -0 -I % zip -jr $OUT/libarchive_fuzzer_seed_corpus.zip %\n"
  },
  {
    "path": "projects/libarchive/libarchive_fuzzer.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stddef.h>\n#include <stdint.h>\n#include <vector>\n\n#include \"archive.h\"\n#include \"archive_entry.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {\n  struct archive *a = archive_read_new();\n\n  archive_read_support_filter_all(a);\n  archive_read_support_format_all(a);\n  archive_read_support_format_empty(a);\n  archive_read_support_format_raw(a);\n  archive_read_support_format_gnutar(a);\n\n  if (ARCHIVE_OK != archive_read_set_options(a, \"zip:ignorecrc32,tar:read_concatenated_archives,tar:mac-ext\")) {\n    return 0;\n  }\n\n  archive_read_add_passphrase(a, \"secret\");\n\n  if (ARCHIVE_OK != archive_read_open_memory(a, buf, len)) {\n    archive_read_free(a);\n    return 0;\n  }\n\n  while(1) {\n    std::vector<uint8_t> data_buffer(getpagesize(), 0);\n    struct archive_entry *entry;\n    int ret = archive_read_next_header(a, &entry);\n    if (ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL)\n      break;\n    if (ret == ARCHIVE_RETRY)\n      continue;\n\n    (void)archive_entry_pathname(entry);\n    (void)archive_entry_pathname_utf8(entry);\n    (void)archive_entry_pathname_w(entry);\n\n    (void)archive_entry_atime(entry);\n    (void)archive_entry_birthtime(entry);\n    (void)archive_entry_ctime(entry);\n    (void)archive_entry_dev(entry);\n    (void)archive_entry_digest(entry, ARCHIVE_ENTRY_DIGEST_SHA1);\n    (void)archive_entry_filetype(entry);\n    (void)archive_entry_gid(entry);\n    (void)archive_entry_is_data_encrypted(entry);\n    (void)archive_entry_is_encrypted(entry);\n    (void)archive_entry_is_metadata_encrypted(entry);\n    (void)archive_entry_mode(entry);\n    (void)archive_entry_mtime(entry);\n    (void)archive_entry_size(entry);\n    (void)archive_entry_uid(entry);\n\n    ssize_t r;\n    while ((r = archive_read_data(a, data_buffer.data(),\n            data_buffer.size())) > 0)\n      ;\n    if (r == ARCHIVE_FATAL)\n      break;\n  }\n\n  archive_read_has_encrypted_entries(a);\n  archive_read_format_capabilities(a);\n  archive_file_count(a);\n  archive_seek_data(a, 0, SEEK_SET);\n\n  archive_read_free(a);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libarchive/project.yaml",
    "content": "homepage: \"https://github.com/libarchive/libarchive\"\nlanguage: c++\nprimary_contact: \"joerg.sonnenberger@googlemail.com\"\nauto_ccs:\n  - \"kientzle@gmail.com\"\n  - \"martin@matuska.org\"\nsanitizers:\n  - address\n  - memory:\n     experimental: True\n  - undefined\nmain_repo: 'https://github.com/libarchive/libarchive.git'\n"
  },
  {
    "path": "projects/libarchive/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Skip leak sanitizer and disable possible null return from allocator\nexport ASAN_OPTIONS=\"detect_leaks=0:allocator_may_return_null=1\"\n\n# Run unit test and disable those tests that are failing or not able to run without network connection\nctest --test-dir libarchive/build2 -j$(nproc) -E \\\n    \"libarchive_test_compat_zip_4|libarchive_test_read_format_cpio_bin*|libarchive_test_read_pax_truncated|bsdcpio_test_basic|bsdcpio_test_option_0|bsdcpio_test_option_L_upper|bsdcpio_test_option_d|bsdcpio_test_option_f|bsdcpio_test_option_m|bsdcpio_test_option_t\"\n"
  },
  {
    "path": "projects/libass/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config libfontconfig1-dev libfreetype-dev libfribidi-dev python3-pip && \\\n    pip3 install meson==0.60.0 ninja\n\nRUN git clone --depth 1 https://github.com/libass/libass.git\nRUN git clone --depth 1 https://github.com/harfbuzz/harfbuzz.git\n\nCOPY build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/libass/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/harfbuzz\n\n# setup\nbuild=$WORK/build\n\n# # cleanup\nrm -rf $build\nmkdir -p $build\n\n# disable sanitize=vptr for harfbuzz since it compiles without rtti\nCFLAGS=\"$CFLAGS -fno-sanitize=vptr\" \\\nCXXFLAGS=\"$CXXFLAGS -fno-sanitize=vptr\" \\\nmeson --default-library=static --wrap-mode=nodownload \\\n      -Dfuzzer_ldflags=\"$(echo $LIB_FUZZING_ENGINE)\" \\\n      -Dtests=disabled \\\n      --prefix=/work/ --libdir=lib $build \\\n  || (cat build/meson-logs/meson-log.txt && false)\nmeson install -C $build\n\ncd $SRC/libass\n\nexport PKG_CONFIG_PATH=/work/lib/pkgconfig\n./autogen.sh\n./configure \\\n  FUZZ_CPPFLAGS=\"-DASS_FUZZMODE=2 -DASSFUZZ_MAX_LEN=8192\" \\\n  --disable-asm --disable-shared --enable-fuzz\nmake -j \"$(nproc)\" fuzz/fuzz_ossfuzz\ncp fuzz/fuzz_ossfuzz $OUT/libass_fuzzer\ncp fuzz/ass.dict $OUT/ass.dict\n\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/libass/libass_fuzzer.options",
    "content": "[libfuzzer]\ndict = ass.dict\nmax_len = 8192\n"
  },
  {
    "path": "projects/libass/project.yaml",
    "content": "homepage: \"https://github.com/libass/libass\"\nlanguage: c++\nprimary_contact: \"chortos@inbox.lv\"\nauto_ccs:\n  - \"greg@kinoho.net\"\n  - \"rcombs@rcombs.me\"\n  - \"vabnick@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/libass/libass.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libavc/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget cmake\nRUN git clone https://github.com/ittiam-systems/libavc.git\nADD https://storage.googleapis.com/android_media/external/libavc/fuzzer/avc_dec_fuzzer_seed_corpus.zip $SRC/\nCOPY build.sh $SRC/\nWORKDIR libavc\n"
  },
  {
    "path": "projects/libavc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project.\n$SRC/libavc/fuzzer/ossfuzz.sh\n"
  },
  {
    "path": "projects/libavc/project.yaml",
    "content": "homepage: \"https://github.com/ittiam-systems/libavc\"\nlanguage: c++\nprimary_contact: \"harish.mahendrakar@ittiam.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nauto_ccs:\n  - aadithya.kamath@ittiam.com\n  - harish.mahendrakar@ittiam.com\n  - mallikarjun.kamble@ittiam.com  \n  - ram.mohan@ittiam.com\n  - saurabh.agrawal@ittiam.com\n  - umang.saini@ittiam.com\n  - vaibhav.valvaiker@ittiam.com\n  - vijayakumar.gr@ittiam.com\n  - essick@google.com\n  - lajos@google.com\nvendor_ccs:\n  - adambacchus@google.com\n  - ailport@google.com\n  - bcreasey@google.com\n  - cunefare@google.com\n  - ejorgensen@google.com\n  - faerber@google.com\n  - greendonald@google.com\n  - hamzeh@google.com\n  - jaredkidd@google.com\n  - kimtony@google.com\n  - lindsaywells@google.com\n  - maverickm@google.com\n  - swansonr@google.com\n  - warrenwright@google.com\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/ittiam-systems/libavc.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libavif/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y curl python3-pip python3-setuptools python3-wheel cmake git nasm && \\\n    pip3 install meson ninja\n\nRUN git clone --depth 1 https://github.com/AOMediaCodec/libavif.git libavif\nWORKDIR libavif\n\nCOPY build.sh avif_decode_seed_corpus.zip $SRC/\n"
  },
  {
    "path": "projects/libavif/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash tests/oss-fuzz/build.sh\n\n# show contents of $OUT/ for sanity checking\nfind $OUT/\n"
  },
  {
    "path": "projects/libavif/project.yaml",
    "content": "homepage: \"https://github.com/AOMediaCodec/libavif\"\nlanguage: c++\nprimary_contact: \"wtc@google.com\"\nfuzzing_engines:\n  - libfuzzer\nauto_ccs:\n  - \"fgalligan@google.com\"\n  - \"joedrago@gmail.com\"\n  - \"jzern@google.com\"\n  - \"yguyon@google.com\"\n  - \"maryla@google.com\"\n  - \"vrabaud@google.com\"\n  - \"david@adalogics.com\"\n  - \"vigneshv@google.com\"\nmain_repo: 'https://github.com/AOMediaCodec/libavif.git'\nsanitizers:\n  - address\n  - memory\n  - undefined\n"
  },
  {
    "path": "projects/libbpf/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN sed -i -e '/^#\\s*deb-src.*\\smain\\s\\+restricted/s/^#//' /etc/apt/sources.list && \\\n    apt-get update && \\\n    # libelf build dependencies \\\n    apt-get build-dep -y --no-install-recommends libelf-dev && \\\n    apt-get install -y --no-install-recommends pkg-config && \\\n    # libbpf build dependencies \\\n    apt-get install -y --no-install-recommends libz-dev libz-dev:i386\nRUN git clone --depth 1 https://github.com/libbpf/libbpf\nWORKDIR libbpf\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libbpf/build.sh",
    "content": "#!/bin/bash -e\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n./scripts/build-fuzzers.sh\n"
  },
  {
    "path": "projects/libbpf/project.yaml",
    "content": "homepage: \"https://github.com/libbpf/libbpf\"\nlanguage: c\nprimary_contact: \"andrii.nakryiko@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n  - i386\nauto_ccs:\n  - hengqi.chen@gmail.com\n  - yulia.kartseva@gmail.com\n  - evverx@gmail.com\n  - shunghsiyu@gmail.com\n  - eddyz87@gmail.com\nmain_repo: \"https://github.com/libbpf/libbpf\"\nbuilds_per_day: 4\nview_restrictions: none\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libcacard/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y pkg-config libglib2.0-dev gyp libsqlite3-dev mercurial python3-pip python\n# Because Ubuntu has really ancient meson out there\nRUN pip3 install meson ninja\n\nRUN git clone --depth 1 --single-branch --branch master https://gitlab.freedesktop.org/spice/libcacard.git libcacard\nRUN git clone --depth 1 https://github.com/nss-dev/nss.git nss\nRUN hg clone https://hg.mozilla.org/projects/nspr\n\nWORKDIR libcacard\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libcacard/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Compile NSS\nmkdir $SRC/nss-nspr\nmv $SRC/nss $SRC/nss-nspr/\nmv $SRC/nspr $SRC/nss-nspr/\ncd $SRC/nss-nspr/\n# We do not need NSS to be built with address sanitizer\nCFLAGS=\"\" CXXFLAGS=\"\" nss/build.sh --static --disable-tests\n\n# Create a package config for NSS\ncp dist/Debug/lib/pkgconfig/{nspr,nss}.pc\nsed -i \"s/Debug//g\" dist/Debug/lib/pkgconfig/nss.pc\nsed -i \"s/\\/lib/\\/lib\\/Debug/g\" dist/Debug/lib/pkgconfig/nss.pc\nsed -i \"s/include\\/nspr/public\\/nss/g\" dist/Debug/lib/pkgconfig/nss.pc\nsed -i \"s/NSPR/NSS/g\" dist/Debug/lib/pkgconfig/nss.pc\nLIBS=\"-lssl -lsmime -lnssdev -lnss_static -lpk11wrap_static -lcryptohi\"\nLIBS=\"$LIBS -lcerthi -lcertdb -lnssb -lnssutil -lnsspki -ldl -lm -lsqlite\"\nLIBS=\"$LIBS -lsoftokn_static -lsha-x86_c_lib -lfreebl_static\"\nLIBS=\"$LIBS -lgcm-aes-x86_c_lib -lhw-acc-crypto-avx -lhw-acc-crypto-avx2\"\nsed -i \"s/Libs:.*/Libs: -L\\${libdir} $LIBS/g\" dist/Debug/lib/pkgconfig/nss.pc\necho \"Requires: nspr\" >> dist/Debug/lib/pkgconfig/nss.pc\n\nexport NSS_NSPR_PATH=$(realpath $SRC/nss-nspr/)\nexport PKG_CONFIG_PATH=$NSS_NSPR_PATH/dist/Debug/lib/pkgconfig\nexport LD_LIBRARY_PATH=$NSS_NSPR_PATH/dist/Debug/lib\n\n# compile libcacard\nBUILD=$WORK/meson\nrm -rf $BUILD\nmkdir $BUILD\n\ncd $SRC/libcacard\n# Drop the tests as they are not needed and require too much dependencies\nmeson $BUILD -Ddefault_library=static -Ddisable_tests=true\nninja -C $BUILD\n\n# We need nss db to work\ncp -r tests/db $OUT/\n\necho \"XXXXXXXX\" > $WORK/testinput\n\nfuzzers=$(find $BUILD/fuzz/ -executable -type f)\nfor f in $fuzzers; do\n\tfuzzer=$(basename $f)\n\tcp $f $OUT/\n\t# Check if it runs at least in build image\n\t$OUT/$fuzzer $WORK/testinput\n\t#zip -j $OUT/${fuzzer}_seed_corpus.zip fuzz/corpora/${fuzzer}/*\ndone\n\nrm $WORK/testinput\n"
  },
  {
    "path": "projects/libcacard/project.yaml",
    "content": "homepage: \"https://gitlab.freedesktop.org/spice/libcacard\"\nlanguage: c\nprimary_contact: \"jjelen@redhat.com\"\nauto_ccs:\n - \"jakuje@gmail.com\"\nsanitizers:\n - address\n - undefined\nmain_repo: 'https://gitlab.freedesktop.org/spice/libcacard.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libcbor/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake libcmocka-dev\nRUN git clone --depth 1 https://github.com/PJK/libcbor\nWORKDIR libcbor\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libcbor/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./oss-fuzz/build.sh\n\n"
  },
  {
    "path": "projects/libcbor/project.yaml",
    "content": "homepage: \"https://github.com/PJK/libcbor\"\nlanguage: c++\nprimary_contact: \"me@pavelkalvoda.com\"\nauto_ccs:\n  - alex.gaynor@gmail.com\nfuzzing_engines:\n  - afl\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/PJK/libcbor'\n"
  },
  {
    "path": "projects/libcbor/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir oss_fuzz_build -j$(nproc)\n"
  },
  {
    "path": "projects/libcoap/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n    pkg-config libcunit1 libcunit1-doc libcunit1-dev\nRUN git clone --depth 1 https://github.com/obgm/libcoap.git libcoap\nWORKDIR libcoap\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/libcoap/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n  export WARNING_CFLAGS=\"${CFLAGS}\"\nfi\n\n./autogen.sh && ./configure --disable-doxygen --disable-manpages \\\n                            --with-openssl --enable-tests        \\\n                            --disable-thread-safe                \\\n    && make -j$(nproc)\n\n# build all fuzzer targets\nmake -C tests/oss-fuzz -f Makefile.oss-fuzz\n"
  },
  {
    "path": "projects/libcoap/project.yaml",
    "content": "homepage: \"https://libcoap.net/\"\nlanguage: c++\nprimary_contact: \"bergmann@tzi.org\"\nauto_ccs:\n    - \"libcoap@gmail.com\"\n    - \"supjps-libcoap@jpshallow.com\"\n    - \"arthur.chan@adalogics.com\"\n    - \"david@adalogics.com\"\n    - \"adam@adalogics.com\"\nmain_repo: 'https://github.com/obgm/libcoap.git'\n"
  },
  {
    "path": "projects/libcoap/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##############################################################################\n\n./tests/testdriver\n"
  },
  {
    "path": "projects/libconfig/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake make\n\nRUN git clone --depth 1 https://github.com/hyperrealm/libconfig.git libconfig \\\n        && cp libconfig/fuzz/build.sh $SRC/\nRUN sed -i 's/-DBUILD_TESTS=Off/-DBUILD_TESTS=On/g' $SRC/build.sh\nCOPY run_tests.sh $SRC\nWORKDIR libconfig\n"
  },
  {
    "path": "projects/libconfig/project.yaml",
    "content": "homepage: \"https://hyperrealm.github.io/libconfig/\"\nlanguage: c\nprimary_contact: \"hyperrealm@gmail.com\"\nauto_ccs:\n  - \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/hyperrealm/libconfig.git\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n"
  },
  {
    "path": "projects/libconfig/run_tests.sh",
    "content": "##!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nctest --test-dir build\n"
  },
  {
    "path": "projects/libcst/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/instagram/libcst libcst\nRUN apt-get install build-essential libssl-dev libffi-dev pkg-config python3-dev cargo -y\nRUN pip3 install --upgrade pip\nRUN curl https://sh.rustup.rs -sSf | sh -s -- -y\nENV PATH=\"/root/.cargo/bin:${PATH}\"\nRUN rustup install nightly\nRUN rustup default stable\n\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/libcst\n"
  },
  {
    "path": "projects/libcst/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport RUSTFLAGS=\"\"\npython3 -m pip install -U hatch\npython3 -m pip uninstall -y libcst\npython3 -m pip install .\n\n# Change directory to force pyinstaller to load in the package we build\ncd ../\nmkdir fuzzbuild\ncd fuzzbuild\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/libcst/fuzz_transformer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nimport libcst\nfrom libcst import parse_module\nfrom libcst import PartialParserConfig, ParserSyntaxError\nfrom libcst.codemod._context import CodemodContext\nfrom libcst.codemod._runner import SkipFile\nfrom libcst.codemod.commands.unnecessary_format_string import UnnecessaryFormatString\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  context = CodemodContext()\n  transform_instance = UnnecessaryFormatString(context)\n  inp = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  try:\n    input_tree = parse_module(\n      inp,\n      config=PartialParserConfig()\n    )\n    try:\n      output_tree = transform_instance.transform_module(input_tree)\n    except SkipFile:\n      pass\n  except ParserSyntaxError:\n    pass\n  except RecursionError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/libcst/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/instagram/libcst\nlanguage: python\nmain_repo: https://github.com/instagram/libcst\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/libcue/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool bison flex\n\nRUN git clone --depth 1 https://github.com/lipnitsk/libcue.git libcue\n\nWORKDIR libcue\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libcue/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/libcue/oss-fuzz/build.sh"
  },
  {
    "path": "projects/libcue/project.yaml",
    "content": "homepage: \"https://github.com/lipnitsk/libcue\"\nmain_repo: \"https://github.com/lipnitsk/libcue.git\"\nlanguage: c\nprimary_contact: \"ilya.lipnitskiy@gmail.com\"\nauto_ccs:\n  - \"aleksandrosansan@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\n  # - centipede disabled until https://github.com/lipnitsk/libcue/pull/31/\n"
  },
  {
    "path": "projects/libcue/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\ncd $WORK\nmake test\n"
  },
  {
    "path": "projects/libcups/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool build-essential libavahi-client-dev libgnutls28-dev libnss-mdns zlib1g-dev libsystemd-dev\nRUN git clone --depth 1 https://github.com/OpenPrinting/libcups.git\nRUN git clone --depth 1 https://github.com/OpenPrinting/fuzzing.git\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/libcups\n"
  },
  {
    "path": "projects/libcups/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/fuzzing/projects/libcups/oss_fuzz_build.sh"
  },
  {
    "path": "projects/libcups/project.yaml",
    "content": "homepage: \"https://github.com/OpenPrinting/libcups\"\nmain_repo: \"https://github.com/OpenPrinting/libcups.git\"\n# help_url:\nlanguage: c++\n\nprimary_contact: \"jiongchiyu@gmail.com\"\nauto_ccs:\n  - \"till.kamppeter@gmail.com\"\n  - \"ossfuzz@iosifache.me\"\n  - \"pushinliu@gmail.com\"\n  # - \"msweet@msweet.org\"\n  # - \"jsmeix@suse.de\"\n  # - \"debian@alteholz.de\"\n  # - \"zdohnal@redhat.com\"\n  # - \"basu.aveek@gmail.com\"\n# vendor_ccs:\n\narchitectures:\n  - x86_64\n  # - i386\n\nsanitizers:\n  - address\n  - memory\n  # - undefined\n\nfuzzing_engines:\n  - libfuzzer\n  # - honggfuzz\n  # - afl\n\n# builds_per_day: 2"
  },
  {
    "path": "projects/libdwarf/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get -qq update && apt-get install -qq -y cmake make zlib1g-dev\nRUN git clone --depth=1 https://github.com/davea42/libdwarf-code $SRC/libdwarf\nRUN git clone --depth=1 https://github.com/davea42/libdwarf-binary-samples $SRC/libdwarf-binary-samples\nWORKDIR libdwarf\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libdwarf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build corpus for fuzzing\nexport BINARY_SAMPLES_DIR=\"$SRC/libdwarf-binary-samples\"\nexport BINARY_SAMPLES_V1=\"$BINARY_SAMPLES_DIR/binary-samples\"\nexport BINARY_SAMPLES_V2=\"$BINARY_SAMPLES_DIR/binary-samples-v2\"\nexport FUZZER_DIR=\"$SRC/libdwarf/fuzz\"\n\nmkdir $SRC/corp\ncp $BINARY_SAMPLES_V1/elf* $SRC/corp\ncp $BINARY_SAMPLES_V1/Mach* $SRC/corp\ncp $BINARY_SAMPLES_V1/pe* $SRC/corp\ncp $BINARY_SAMPLES_V1/lib* $SRC/corp\nfor file in $BINARY_SAMPLES_V2/{linux,windows}/*_DWARF*/* $BINARY_SAMPLES_V2/macOS-arm/*/*; do \n export newfile=$(echo $file | sed 's/ /_/g')\n # e.g. cp \"...\" /out/windows_gcc11_DWARF2_cross-platform.exe\n cp \"$file\" $SRC/corp/$(echo \"$newfile\" | cut -d/ -f5,6 | sed 's/\\//_/g')_$(basename \"$newfile\")\ndone\n\nzip -r -j $OUT/fuzz_seed_corpus.zip $SRC/corp\nfor fuzzFile in $FUZZER_DIR/fuzz*.c; do\n  fuzzName=$(basename \"$fuzzFile\" '.c')\n  cp $OUT/fuzz_seed_corpus.zip $OUT/${fuzzName}_seed_corpus.zip\ndone\nrm $OUT/fuzz_seed_corpus.zip\n\n\n# Build fuzzers\nmkdir build\ncd build\ncmake ../ -DDO_TESTING=ON\nmake\n\nfor fuzzFile in $FUZZER_DIR/fuzz*.c; do\n  fuzzName=$(basename \"$fuzzFile\" '.c')\n  $CC $CFLAGS $LIB_FUZZING_ENGINE -I../src/lib/libdwarf/ \\\n    \"$FUZZER_DIR/${fuzzName}.c\" -o \"$OUT/${fuzzName}\" ./src/lib/libdwarf/libdwarf.a -lz\ndone\n"
  },
  {
    "path": "projects/libdwarf/project.yaml",
    "content": "homepage: \"https://www.prevanders.net/dwarf.html\"\nlanguage: c\nprimary_contact: \"davea42@gmail.com\"\nmain_repo: \"https://github.com/davea42/libdwarf-code\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n - afl\n - honggfuzz\n - libfuzzer\n\n"
  },
  {
    "path": "projects/libdwarf/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# The unit test of selftied is failing, thus excluded temporarily\nctest --test-dir build -C Release -E selftied -j$(nproc)\n"
  },
  {
    "path": "projects/libecc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! Project pinned after a clang update and an afl link error. Log: https://oss-fuzz-gcb-logs.storage.googleapis.com/log-bca72181-cfb2-4b2f-98f1-c2addee0aa4b.txt\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget python bison flex texinfo lzip bsdmainutils\nRUN git clone --depth 1 --branch cryptofuzz https://github.com/libecc/libecc.git\nRUN git clone --depth 1 https://github.com/randombit/botan.git\nRUN git clone https://github.com/wolfssl/wolfssl\nRUN git clone --depth 1 https://github.com/wolfssl/wolfsm\nRUN git clone --depth 1 https://github.com/MozillaSecurity/cryptofuzz\nRUN wget -q https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz\nRUN test \"$(sha256sum gmp-6.2.1.tar.lz)\" = \"2c7f4f0d370801b2849c48c9ef3f59553b5f1d3791d070cffb04599f9fc67b41  gmp-6.2.1.tar.lz\"\nRUN wget -q https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libecc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL\"\nexport LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\"\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_84_0.tar.bz2\ncd boost_1_84_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\ncp -R boost/ /usr/include/\n\n# Build libecc\ncd $SRC/libecc\npython3 scripts/expand_libecc.py --name=\"secp112r2\" --prime=0xdb7c2abf62e35e668076bead208b --order=0x36df0aafd8b8d7597ca10520d04b --a=0x6127c24c05f38a0aaaf65c0ef02c --b=0x51def1815db5ed74fcc34c85d709 --gx=0x4ba30ab5e892b4e1649dd0928643 --gy=0xadcd46f5882e3747def36e956e97 --cofactor=4\npython3 scripts/expand_libecc.py --name=\"secp128r2\" --prime=0xfffffffdffffffffffffffffffffffff --order=0x3fffffff7fffffffbe0024720613b5a3 --a=0xd6031998d1b3bbfebf59cc9bbff9aee1 --b=0x5eeefca380d02919dc2c6558bb6d8a5d --gx=0x7b6aa5d85e572983e6fb32a7cdebc140 --gy=0x27b6916a894d3aee7106fe805fc34b44 --cofactor=4\nexport CFLAGS=\"$CFLAGS -DUSE_CRYPTOFUZZ\"\nmake -j$(nproc) build/libsign.a\nexport LIBECC_PATH=$(realpath .)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_LIBECC\"\n\n# Build Botan\ncd $SRC/botan\nif [[ $CFLAGS != *-m32* ]]\nthen\n    if [[ $CFLAGS != *sanitize=memory* ]]\n    then\n        ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator,x509 --build-targets=static --without-documentation\n    else\n        ./configure.py --disable-asm --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator,x509 --build-targets=static --without-documentation\n    fi\nelse\n    ./configure.py --cpu=x86_32 --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator,x509 --build-targets=static --without-documentation\nfi\nmake -j$(nproc)\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BOTAN -DCRYPTOFUZZ_BOTAN_IS_ORACLE\"\nexport LIBBOTAN_A_PATH=\"$SRC/botan/libbotan-3.a\"\nexport BOTAN_INCLUDE_PATH=\"$SRC/botan/build/include\"\n\n# Compile libgmp\ncd $SRC/\ntar --lzip -xvf gmp-6.2.1.tar.lz\ncd $SRC/gmp-6.2.1/\nautoreconf -ivf\nif [[ $CFLAGS = *-m32* ]]\nthen\n    setarch i386 ./configure --enable-maintainer-mode --enable-assert\nelif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    ./configure --enable-maintainer-mode --enable-assert --disable-assembly\nelse\n    ./configure --enable-maintainer-mode --enable-assert\nfi\nmake -j$(nproc)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_LIBGMP\"\nexport LIBGMP_INCLUDE_PATH=$(realpath .)\nexport LIBGMP_A_PATH=$(realpath .libs/libgmp.a)\n\ncd $SRC/wolfssl/\n# Checkout at commit that's known to be bug-free\ngit checkout b7b20ededda4cea208fb7745629904fda64c7524\n\n# Install support for wolfCrypt SM algorithms\ncd $SRC/wolfsm/\n./install.sh\n\n# Compile wolfSSL\ncd $SRC/wolfssl/\n# Note (to self):\n# Compiling wolfCrypt with SP math instead of normal math due to symbol collisions (specifically fp_* functions) between libecc and wolfCrypt otherwise.\nexport CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP -DWOLFSSL_SP_INT_NEGATIVE\"\nautoreconf -ivf\nexport WOLFCRYPT_CONFIGURE_PARAMS=\"--enable-static --enable-md2 --enable-md4 --enable-ripemd --enable-blake2 --enable-blake2s --enable-pwdbased --enable-scrypt --enable-hkdf --enable-cmac --enable-arc4 --enable-camellia --enable-aesccm --enable-aesctr --enable-xts --enable-des3 --enable-x963kdf --enable-harden --enable-aescfb --enable-aesofb --enable-aeskeywrap --enable-aessiv --enable-keygen --enable-curve25519 --enable-curve448 --enable-shake256 --disable-crypttests --disable-examples --enable-compkey --enable-ed448 --enable-ed25519 --enable-ecccustcurves --enable-xchacha --enable-cryptocb --enable-eccencrypt --enable-smallstack --enable-ed25519-stream --enable-ed448-stream --enable-sp-math-all --enable-aesgcm-stream --enable-shake128 --enable-siphash --enable-sm2 --enable-sm3\"\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export WOLFCRYPT_CONFIGURE_PARAMS=\"$WOLFCRYPT_CONFIGURE_PARAMS -disable-asm\"\nfi\n./configure $WOLFCRYPT_CONFIGURE_PARAMS\nmake -j$(nproc)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_WOLFCRYPT\"\nexport WOLFCRYPT_LIBWOLFSSL_A_PATH=`realpath src/.libs/libwolfssl.a`\nexport WOLFCRYPT_INCLUDE_PATH=`realpath .`\n\n# Build Cryptofuzz\ncd $SRC/cryptofuzz\npython gen_repository.py\nrm extra_options.h\necho -n '\"' >>extra_options.h\necho -n '--force-module=libecc ' >>extra_options.h\necho -n '--operations=Digest,HMAC,ECC_PrivateToPublic,ECC_ValidatePubkey,ECDSA_Sign,ECDSA_Verify,ECGDSA_Sign,ECGDSA_Verify,ECRDSA_Sign,ECRDSA_Verify,ECDH_Derive,ECC_Point_Add,ECC_Point_Mul,ECC_Point_Dbl,ECC_Point_Neg,BignumCalc ' >>extra_options.h\necho -n '--curves=brainpool192r1,brainpool192t1,brainpool224r1,brainpool224t1,brainpool256r1,brainpool256t1,brainpool320r1,brainpool320t1,brainpool384r1,brainpool384t1,brainpool512r1,brainpool512t1,secp112r2,secp128r2,secp192r1,secp192k1,secp224r1,secp224k1,secp256r1,secp256k1,secp384r1,secp521r1,frp256v1,secp256k1,sm2p256v1,gost_256A,gost_512A,gostr3410_2001_cryptopro_a,gostr3410_2001_cryptopro_b,gostr3410_2001_cryptopro_c,gostr3410_2001_cryptopro_xcha,gostr3410_2001_cryptopro_xchb,gostr3410_2001_test,tc26_gost_3410_12_256_a,tc26_gost_3410_12_256_b,tc26_gost_3410_12_256_c,tc26_gost_3410_12_256_d,tc26_gost_3410_12_512_a,tc26_gost_3410_12_512_b,tc26_gost_3410_12_512_c,tc26_gost_3410_12_512_test ' >>extra_options.h\necho -n '--digests=NULL,SHA224,SHA256,SHA3-224,SHA3-256,SHA3-384,SHA3-512,SHA384,SHA512,SHA512-224,SHA512-256,SM3,SHAKE256_114,STREEBOG-256,STREEBOG-512,RIPEMD160,BASH224,BASH256,BASH384,BASH512 ' >>extra_options.h\necho -n '--calcops=Add,AddMod,And,Bit,Cmp,CondAdd,CondSub,Div,ExpMod,ExtGCD_X,ExtGCD_Y,GCD,InvMod,IsOdd,IsOne,IsZero,LRot,LShift1,Mod,Mul,MulMod,NegMod,NumBits,One,Or,RRot,RShift,RandMod,Sqr,Sub,SubMod,Xor,Zero ' >>extra_options.h\necho -n '\"' >>extra_options.h\ncd modules/libecc/\nmake -B -j$(nproc)\ncd ../botan/\nmake -B -j$(nproc)\ncd ../libgmp/\nmake -B -j$(nproc)\ncd ../wolfcrypt/\nmake -B -j$(nproc)\ncd ../../\nmake -B -j$(nproc)\n\ncp cryptofuzz $OUT/cryptofuzz-libecc\n"
  },
  {
    "path": "projects/libecc/project.yaml",
    "content": "homepage: \"https://github.com/ANSSI-FR/libecc\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://github.com/ANSSI-FR/libecc.git\"\nauto_ccs:\n    - \"dev.libecc@gmail.com\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n - x86_64\n - i386\n"
  },
  {
    "path": "projects/libevent/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake make\nRUN git clone --depth 1 https://github.com/libevent/libevent.git libevent\nRUN git clone --depth 1 https://github.com/google/fuzzing fuzzing\nWORKDIR libevent\nCOPY build.sh *.cc *.c $SRC/\n"
  },
  {
    "path": "projects/libevent/buffer_add_file_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" {\n#include \"libevent/include/event2/buffer.h\"\n#include \"libevent/include/event2/buffer_compat.h\"\n#include \"libevent/include/event2/event.h\"\n#include \"libevent/include/event2/util.h\"\n#include \"util-internal.h\"\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider data_provider(data, size);\n\n  std::string s1 = data_provider.ConsumeRandomLengthString();\n  uint32_t int1 = data_provider.ConsumeIntegral<uint32_t>();\n\n  char bufferFile[50];\n  struct stat st;\n\n  sprintf(bufferFile, \"/tmp/buffer.%d\", getpid());\n  FILE *fp = fopen(bufferFile, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(s1.c_str(), s1.size(), 1, fp);\n  fclose(fp);\n\n  fp = fopen(bufferFile, \"rb\");\n  if (!fp) {\n    return 0;\n  }\n\n  int fd = fileno(fp);\n  fstat(fd, &st);\n\n  struct evbuffer *buf = evbuffer_new();\n  evbuffer_set_flags(buf, int1);\n  evbuffer_add_file(buf, fd, 0, st.st_size);\n\n  fclose(fp);\n  close(fd);\n\n  unlink(bufferFile);\n  evbuffer_free(buf);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libevent/buffer_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n#include <sys/socket.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" {\n#include \"libevent/include/event2/event.h\"\n#include \"libevent/include/event2/buffer.h\"\n#include \"libevent/include/event2/buffer_compat.h\"\n#include \"libevent/include/event2/util.h\"\n#include \"util-internal.h\"\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider data_provider(data, size);\n\n  std::string s1 = data_provider.ConsumeRandomLengthString();\n  std::string s2 = data_provider.ConsumeRandomLengthString();\n  std::string s3 = data_provider.ConsumeRandomLengthString();\n  std::string s4 = data_provider.ConsumeRandomLengthString();\n\n  struct evbuffer *buf = evbuffer_new();\n  size_t sz;\n  evbuffer_add(buf, s1.c_str(), s1.size());\n  char *cp = NULL;\n  cp = evbuffer_readln(buf, &sz, EVBUFFER_EOL_ANY);\n  if (cp != NULL) {\n    free(cp);\n    cp = NULL;\n  }\n  struct evbuffer *buf2 = evbuffer_new();\n  struct evbuffer *buf3 = evbuffer_new();\n  struct evbuffer_iovec vec[1];\n\n  evbuffer_add(buf2, s1.c_str(), s1.size());\n  evbuffer_add_reference(buf2, s2.c_str(), s2.size(), NULL, NULL);\n  evbuffer_add_buffer(buf, buf2);\n  evbuffer_expand(buf, 2000);\n  evbuffer_pullup(buf, 2);\n  evbuffer_prepend(buf, s3.c_str(), s3.size());\n  evbuffer_prepend_buffer(buf, buf2);\n  evbuffer_find(buf2, (const unsigned char *)s4.c_str(), s4.size());\n  evbuffer_commit_space(buf, vec, 1);\n  evbuffer_add_buffer_reference(buf, buf2);\n  evbuffer_remove_buffer(buf, buf3, 10);\n\n  evbuffer_free(buf);\n  evbuffer_free(buf2);\n  evbuffer_free(buf3);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libevent/bufferevent_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <assert.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n#include <sys/socket.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" {\n#include \"libevent/include/event2/buffer.h\"\n#include \"libevent/include/event2/bufferevent.h\"\n#include \"libevent/include/event2/event.h\"\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  FuzzedDataProvider data_provider(data, size);\n\n  std::string s1 = data_provider.ConsumeRandomLengthString();\n  std::string s2 = data_provider.ConsumeRandomLengthString();\n  size_t int1 = data_provider.ConsumeIntegral<size_t>();\n  size_t int2 = data_provider.ConsumeIntegral<size_t>();\n  size_t int3 = data_provider.ConsumeIntegral<size_t>();\n  size_t int4 = data_provider.ConsumeIntegral<size_t>();\n\n  int use_pair = int1 % 2;\n  int read_write = int2 % 2;\n  int use_filter = int4 % 2;\n\n  int options1 = int2 % 16;\n  int options2 = int3 % 16;\n\n  struct bufferevent *bev1 = NULL, *bev2 = NULL, *bev3 = NULL, *bev4 = NULL,\n                     *pair[2];\n  struct event_base *base = NULL;\n  struct evbuffer *evbuf = NULL;\n  static struct ev_token_bucket_cfg *conn_bucket_cfg = NULL;\n  struct bufferevent_rate_limit_group *bev_rate_group = NULL;\n  char buf[128];\n\n  /*create a buffer event*/\n  base = event_base_new();\n  if (use_pair == 0) {\n    if (bufferevent_pair_new(base, options1, pair) == -1) {\n      event_base_free(base);\n      return 0;\n    }\n    bev1 = pair[0];\n    bev2 = pair[1];\n    assert(bufferevent_pair_get_partner(bev1) != NULL);\n  } else {\n    bev1 = bufferevent_socket_new(base, -1, options1);\n    bev2 = bufferevent_socket_new(base, -1, options2);\n  }\n\n  /*bufferevent_filter_new*/\n  if (use_filter == 0) {\n\n    /*we cannot use BEV_OPT_CLOSE_ON_FREE when freeing bufferevents*/\n    bev3 = bufferevent_filter_new(\n        bev1, NULL, NULL, options1 & (~BEV_OPT_CLOSE_ON_FREE), NULL, NULL);\n    bev4 = bufferevent_filter_new(\n        bev2, NULL, NULL, options2 & (~BEV_OPT_CLOSE_ON_FREE), NULL, NULL);\n\n    if (bev1) {\n      bufferevent_free(bev1);\n    }\n    if (bev2) {\n      bufferevent_free(bev2);\n    }\n  } else {\n    bev3 = bev1;\n    bev4 = bev2;\n  }\n\n  if (!bev3 || !bev4) {\n    goto cleanup;\n  }\n\n  if (bufferevent_priority_set(bev3, options2) == 0) {\n    assert(bufferevent_get_priority(bev3) == options2);\n  }\n\n  /*set rate limits*/\n  assert(bufferevent_set_rate_limit(bev3, NULL) != -1);\n  static struct timeval cfg_tick = {static_cast<__time_t>(int1),\n                                    static_cast<__suseconds_t>(int2)};\n  conn_bucket_cfg = ev_token_bucket_cfg_new(int1, int2, int3, int4, &cfg_tick);\n  if (!conn_bucket_cfg) {\n    goto cleanup;\n  }\n\n  bev_rate_group = bufferevent_rate_limit_group_new(base, conn_bucket_cfg);\n  assert(bufferevent_add_to_rate_limit_group(bev4, bev_rate_group) != -1);\n\n  /*write and read from buffer events*/\n  bufferevent_write(bev3, s1.c_str(), s1.size());\n  bufferevent_write(bev4, s2.c_str(), s2.size());\n  bufferevent_write_buffer(bev3, bufferevent_get_input(bev4));\n\n  evbuf = evbuffer_new();\n  bufferevent_read_buffer(bev3, evbuf);\n  evbuffer_free(evbuf);\n  bufferevent_read(bev3, buf, sizeof(buf) - 1);\n  bufferevent_remove_from_rate_limit_group(bev4);\n\n  /*watermarks*/\n  if (read_write == 0) {\n    bufferevent_setwatermark(bev4, EV_READ, int1, int2);\n    bufferevent_getwatermark(bev4, EV_READ, &int3, NULL);\n    bufferevent_getwatermark(bev4, EV_READ, NULL, &int4);\n  } else {\n    bufferevent_setwatermark(bev4, EV_WRITE, int1, int2);\n    bufferevent_getwatermark(bev4, EV_WRITE, &int3, NULL);\n    bufferevent_getwatermark(bev4, EV_WRITE, NULL, &int4);\n  }\n\n  assert(int1 == int3);\n  assert(int2 == int4);\n\n  /*clean up*/\ncleanup:\n  if (bev3) {\n    bufferevent_free(bev3);\n  }\n  if (bev4) {\n    bufferevent_free(bev4);\n  }\n  if (conn_bucket_cfg) {\n    ev_token_bucket_cfg_free(conn_bucket_cfg);\n    conn_bucket_cfg = NULL;\n  }\n\n  if (bev_rate_group) {\n    bufferevent_rate_limit_group_free(bev_rate_group);\n  }\n\n  event_base_free(base);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libevent/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir build\ncd build\ncmake -DEVENT__DISABLE_MBEDTLS=ON \\\n      -DEVENT__DISABLE_OPENSSL=ON \\\n      -DEVENT__LIBRARY_TYPE=STATIC \\\n      -DEVENT__DISABLE_TESTS=ON \\\n      -DEVENT__DISABLE_SAMPLES=ON \\\n      ../\nmake -j$(nproc)\nmake install\n\n# build fuzzer\nfor fuzzers in $(find $SRC -name '*_fuzzer.cc'); do\n  fuzz_basename=$(basename -s .cc $fuzzers)\n  $CXX $CXXFLAGS -std=c++17 -I../ -Iinclude \\\n      $fuzzers $LIB_FUZZING_ENGINE ./lib/libevent.a ./lib/libevent_core.a  \\\n      ./lib/libevent_pthreads.a ./lib/libevent_extra.a \\\n      -o $OUT/$fuzz_basename\ndone\n\nif [[ \"$FUZZING_ENGINE\" == \"honggfuzz\" ]]\nthen\n  fuzz_basename=$(basename -s .cc $fuzzers)\n  $CC $CFLAGS $LIB_HFND \"$HFND_CFLAGS\" -Iinclude \\\n      $SRC/fuzz_request_cb.c $LIB_FUZZING_ENGINE ./lib/libevent.a ./lib/libevent_core.a  \\\n      ./lib/libevent_pthreads.a ./lib/libevent_extra.a \\\n      -o $OUT/fuzz_request\nfi\n\n# The dictionary is not compatible with AFL\nif [ \"$FUZZING_ENGINE\" != 'afl' ]; then\n  cp $SRC/fuzzing/dictionaries/http.dict $OUT/http_fuzzer.dict\nfi\n"
  },
  {
    "path": "projects/libevent/dns_config_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <fcntl.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" {\n#include \"libevent/include/event2/buffer.h\"\n#include \"libevent/include/event2/bufferevent.h\"\n#include \"libevent/include/event2/dns.h\"\n#include \"libevent/include/event2/event.h\"\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  FuzzedDataProvider data_provider(data, size);\n\n  uint32_t flags = data_provider.ConsumeIntegral<uint32_t>();\n  std::string s1 = data_provider.ConsumeRandomLengthString();\n  std::string s2 = data_provider.ConsumeRandomLengthString();\n\n  struct event_base *base = NULL;\n  struct evdns_base *dns = NULL;\n\n  base = event_base_new();\n  dns = evdns_base_new(base, flags % 65537);\n\n  /* Create resolv.conf file*/\n  char resolvFilename[50];\n  sprintf(resolvFilename, \"/tmp/resolv.%d\", getpid());\n  FILE *fp = fopen(resolvFilename, \"wb\");\n  if (!fp) {\n    goto cleanup;\n  }\n  fwrite(s1.c_str(), s1.size(), 1, fp);\n  fclose(fp);\n\n  evdns_base_resolv_conf_parse(dns, flags % 17, resolvFilename);\n\n  /* Create /etc/hosts file*/\n  char hostsFilename[50];\n  sprintf(hostsFilename, \"/tmp/hosts.%d\", getpid());\n  fp = fopen(hostsFilename, \"wb\");\n  if (!fp) {\n    unlink(resolvFilename);\n    goto cleanup;\n  }\n  fwrite(s2.c_str(), s2.size(), 1, fp);\n  fclose(fp);\n\n  evdns_base_load_hosts(dns, hostsFilename);\n  evdns_base_search_ndots_set(dns, flags);\n\n  unlink(resolvFilename);\n  unlink(hostsFilename);\n  evdns_base_search_clear(dns);\n  evdns_base_clear_host_addresses(dns);\n\n  /*clean up*/\ncleanup:\n  evdns_base_free(dns, 0);\n  event_base_free(base);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libevent/fuzz_request_cb.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Uses the Honggfuzz netdriver logic:\n * - https://github.com/google/honggfuzz/tree/master/libhfnetdriver\n * This fuzzer can only be compiled with Honggfuzz (and not libFuzzer of AFL).\n */\n#include \"libevent/include/event2/buffer.h\"\n#include \"libevent/include/event2/event.h\"\n#include \"libevent/include/event2/http.h\"\n\nstatic void handle_request(struct evhttp_request *req, void *arg)\n{\n    const char *uri = evhttp_request_get_uri(req);\n    struct evbuffer *buf = evbuffer_new();\n    evbuffer_add_printf(buf, \"From fuzzer cb, %s!\", uri);\n    evhttp_send_reply(req, HTTP_OK, \"OK\", buf);\n    evbuffer_free(buf);\n}\n\nHFND_FUZZING_ENTRY_FUNCTION(int argc, char **argv) {\n    struct event_base *base = event_base_new();\n    struct evhttp *http = evhttp_new(base);\n    evhttp_bind_socket(http, \"0.0.0.0\", 8666);\n    evhttp_set_gencb(http, handle_request, NULL);\n    event_base_dispatch(base);\n    return 0;\n}\n"
  },
  {
    "path": "projects/libevent/http_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n#include <sys/socket.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" {\n#include \"libevent/include/event2/event.h\"\n#include \"libevent/include/event2/buffer.h\"\n#include \"libevent/include/event2/buffer_compat.h\"\n#include \"libevent/include/event2/util.h\"\n#include \"libevent/include/event2/event.h\"\n#include \"libevent/include/event2/http.h\"\n#include \"libevent/include/event2/http_struct.h\"\n#include \"libevent/include/event2/buffer.h\"\n#include \"libevent/include/event2/bufferevent.h\"\n#include \"libevent/http-internal.h\"\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 5) {\n    return 0;\n  }\n\n  // Decider to determine which request type to parse.\n  uint8_t decider = data[0];\n  data++;\n  size--;\n  int maxHeaderSize = *(int*)data;\n  data += 4;\n  size -= 4;\n  if (maxHeaderSize < 0) {\n    return 0;\n  }\n\n  // Prepare in case it's used.\n  struct evhttp_connection evcon;\n  evcon.ext_method_cmp = NULL;\n  evcon.max_headers_size = maxHeaderSize % 2048;\n\n  struct evhttp *http_val = NULL;\n  http_val = evhttp_new(NULL);\n  if (http_val == NULL) {\n    return 0;\n  }\n  evcon.http_server = http_val;\n\n  FuzzedDataProvider data_provider(data, size);\n  std::string s1 = data_provider.ConsumeRandomLengthString();\n\n  struct evbuffer *buf = evbuffer_new();\n  evbuffer_add(buf, s1.c_str(), s1.size());\n\n  struct evhttp_request *req = evhttp_request_new(NULL, NULL);\n\n  // Use either the defailt request type or EVHTTP_REQUEST\n  if (decider % 2 == 1) {\n    req->kind=EVHTTP_REQUEST;\n    req->evcon = &evcon;\n  }\n\n  enum message_read_status data_read;\n\n  data_read = evhttp_parse_firstline_(req, buf);\n  if (data_read != ALL_DATA_READ) {\n    data_read = evhttp_parse_headers_(req, buf);\n    if (data_read != ALL_DATA_READ) {\n      data_read = evhttp_parse_headers_(req, buf);\n      if (data_read != ALL_DATA_READ) {\n        evhttp_request_get_input_headers(req);\n      }\n    }\n  }\n  evhttp_request_get_host(req);\n\n  char *encoded = evhttp_encode_uri(s1.c_str());\n  if (encoded != NULL) {\n    free(encoded);\n  }\n\n  // Minor utils function\n  char *tmp_escaped = evhttp_htmlescape(s1.c_str());\n  if (tmp_escaped != NULL) {\n    free(tmp_escaped);\n  }\n\n  // URI utils\n  struct evhttp_uri *uri;\n  uri = evhttp_uri_parse(s1.c_str());\n  if (uri != NULL) {\n    char uri_buf[256];\n    evhttp_uri_join(uri, uri_buf, 256);\n    evhttp_uri_free(uri);\n  }\n\n  // Cleanup\n  evhttp_request_free(req);\n  evbuffer_free(buf);\n  evhttp_free(http_val);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libevent/parse_query_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n\n#include \"libevent/include/event2/http.h\"\n#include \"libevent/include/event2/keyvalq_struct.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  std::string fuzz_string(reinterpret_cast<const char *>(data), size);\n  struct evkeyvalq headers;\n  if (evhttp_parse_query(fuzz_string.c_str(), &headers) == 0) {\n    evhttp_clear_headers(&headers);\n  }\n\n  if (size > 4) {\n    uint32_t flags = *(uint32_t *)data;\n    data += 4;\n    size -= 4;\n    std::string fuzz_string2(reinterpret_cast<const char *>(data), size);\n\n    if (evhttp_parse_query_str_flags(fuzz_string2.c_str(), &headers, flags) == 0) {\n      evhttp_clear_headers(&headers);\n    }\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libevent/project.yaml",
    "content": "homepage: \"https://github.com/libevent/libevent\"\nlanguage: c++\nprimary_contact: \"a3at.mail@gmail.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/libevent/libevent.git'\nauto_ccs:\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libevent/utils_fuzzer.cc",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n#include <sys/socket.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"libevent/include/event2/event.h\"\n#include \"libevent/include/event2/util.h\"\n#include \"util-internal.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  int r;\n  int len;\n  char out_buf[128];\n  struct sockaddr_storage ss;\n  FuzzedDataProvider data_provider(data, size);\n  std::string fuzz_string = data_provider.ConsumeRandomLengthString();\n\n  len = sizeof(out_buf);\n  r = evutil_parse_sockaddr_port(\n        fuzz_string.c_str(), (struct sockaddr*)&ss, &len);\n  if (r == 0) {\n    evutil_format_sockaddr_port_((struct sockaddr*)&ss,\n                                 out_buf,\n                                 sizeof(out_buf));\n  }\n\n  struct evutil_addrinfo *addr_info = NULL;\n  std::string s1 = data_provider.ConsumeRandomLengthString();\n  evutil_getaddrinfo(s1.c_str(), NULL, NULL, &addr_info);\n  if (addr_info != NULL) {\n    evutil_freeaddrinfo(addr_info);\n  }\n\n  int portnum=-1;\n  struct evutil_addrinfo *res = NULL;\n  struct evutil_addrinfo hints;\n\n  memset(&hints, 0, sizeof(hints));\n  hints.ai_family = PF_UNSPEC;\n  evutil_getaddrinfo_common_(NULL, s1.c_str(), &hints, &res, &portnum);\n  if (res != NULL) {\n    evutil_freeaddrinfo(res);\n  }\n\n  res = NULL;\n  memset(&hints, 0, sizeof(hints));\n  hints.ai_family = PF_UNSPEC;\n  evutil_getaddrinfo_common_(s1.c_str(), NULL, &hints, &res, &portnum);\n  if (res != NULL) {\n    evutil_freeaddrinfo(res);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libexif/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool gettext autopoint\nRUN git clone --depth 1 https://github.com/libexif/libexif\nRUN git clone --depth 1 https://github.com/ianare/exif-samples\nWORKDIR libexif\nCOPY exif_loader_fuzzer.cc exif_from_data_fuzzer.cc run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libexif/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nautoreconf -fiv\n./configure --disable-docs --enable-shared=no --prefix=\"$WORK\"\nmake -j$(nproc)\nmake install\n\npushd $SRC\nmkdir -p exif_corpus\nfind exif-samples -type f -name '*.jpg' -exec mv -n {} exif_corpus/ \\; -o -name '*.tiff' -exec mv -n {} exif_corpus/ \\;\ncp libexif/test/testdata/*.jpg exif_corpus\nzip -r \"$WORK/exif_seed_corpus.zip\" exif_corpus/\npopd\n\nfor fuzzer in $(find $SRC/ -name '*_fuzzer.cc'); do\n  fuzzer_basename=$(basename -s .cc $fuzzer)\n  $CXX $CXXFLAGS \\\n      -std=c++11 \\\n      -I\"$WORK/include\" \\\n      $fuzzer \\\n      -o $OUT/$fuzzer_basename \\\n      $LIB_FUZZING_ENGINE \\\n      \"$WORK/lib/libexif.a\"\n  cp $WORK/exif_seed_corpus.zip \"${OUT}/${fuzzer_basename}_seed_corpus.zip\"\ndone\n"
  },
  {
    "path": "projects/libexif/exif_from_data_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <libexif/exif-data.h>\n#include <libexif/exif-loader.h>\n#include <stddef.h>\n#include <stdlib.h>\n\n/* Extract all MakerNote tags */\nstatic void mnote_dump(ExifData *data) {\n    ExifMnoteData *mn = exif_data_get_mnote_data(data);\n    if (mn) {\n        int num = exif_mnote_data_count(mn);\n\n        /* Loop through all MakerNote tags */\n        for (int i=0; i < num; ++i) {\n            char buf[1024];\n            exif_mnote_data_get_value(mn, i, buf, sizeof(buf));\n        }\n    }\n}\n\nstatic void dump_value(ExifEntry *entry, void *user_data) {\n  char buf[1024];\n  exif_entry_get_value(entry, buf, sizeof(buf));\n}\n\nstatic void data_func(ExifContent *content, void *user_data) {\n  exif_content_foreach_entry(content, dump_value, NULL);\n}\n\n/* This is like exif_data_dump but without writing to stdout */\nstatic void data_dump(ExifData *data) {\n  exif_data_foreach_content(data, data_func, NULL);\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  // Parse tags using (ultimately) exif_data_load_data()\n  auto image = exif_data_new_from_data(data, size);\n  if (image) {\n    // Exercise the EXIF tag manipulation code\n    exif_data_get_mnote_data(image);\n    data_dump(image);\n    mnote_dump(image);\n    unsigned char *buf;\n    unsigned int sz;\n    exif_data_save_data(image, &buf, &sz);\n    free(buf);\n    exif_data_fix(image);\n    exif_data_unref(image);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libexif/exif_loader_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdio.h>\n#include <stdint.h>\n#include <libexif/exif-loader.h>\n\n\nvoid content_func(ExifEntry *entry, void *user_data) {\n  char buf[10000];\n  exif_entry_get_value(entry, buf, sizeof(buf));\n}\n\nvoid data_func(ExifContent *content, void *user_data) {\n  exif_content_foreach_entry(content, content_func, NULL);\n}\n\nstatic void\ntest_exif_data (ExifData *d) {\n  unsigned int i, c;\n  char v[1024], *p;\n  ExifMnoteData *md;\n\n  md = exif_data_get_mnote_data (d);\n  if (!md) {\n    return;\n  }\n\n  exif_mnote_data_ref (md);\n  exif_mnote_data_unref (md);\n\n  c = exif_mnote_data_count (md);\n  for (i = 0; i < c; i++) {\n    const char *name = exif_mnote_data_get_name (md, i);\n    if (!name) {\n      break;\n    }\n    exif_mnote_data_get_title (md, i);\n    exif_mnote_data_get_description (md, i);\n    exif_mnote_data_get_value (md, i, v, sizeof (v));\n  }\n}\n\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  ExifLoader *loader = exif_loader_new();\n  ExifData *exif_data;\n  if (!loader) {\n    return 0;\n  }\n  exif_loader_write(loader, const_cast<unsigned char*>(data), size);\n  exif_data = exif_loader_get_data(loader);\n  if(!exif_data) {\n    exif_loader_unref(loader);\n    return 0;\n  }\n  exif_data_foreach_content(exif_data, data_func, NULL);\n  test_exif_data (exif_data);\n  exif_loader_unref(loader);\n  exif_data_unref(exif_data);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libexif/project.yaml",
    "content": "homepage: \"https://libexif.github.io\"\nlanguage: c++\nprimary_contact: \"dan@coneharvesters.com\"\nauto_ccs:\n  - paul.l.kehrer@gmail.com\n  - marcus@jet.franken.de\n  - marcusmeissner@googlemail.com\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\nmain_repo: 'https://github.com/libexif/libexif'\n"
  },
  {
    "path": "projects/libexif/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check\n"
  },
  {
    "path": "projects/libfdk-aac/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://android.googlesource.com/platform/external/aac/\nCOPY build.sh *.cpp $SRC/\n"
  },
  {
    "path": "projects/libfdk-aac/aacDecoder_ConfigRaw.cpp",
    "content": "// Copyright 2019 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"aacdecoder_lib.h\"\n#include <stdint.h>\n\n#define FILEREAD_MAX_LAYERS 1\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  HANDLE_AACDECODER aacDecoderInfo = NULL;\n\n  UCHAR *conf[FILEREAD_MAX_LAYERS];\n  UINT confSize[FILEREAD_MAX_LAYERS];\n\n  if (Size > 255) return 0;\n\n  aacDecoderInfo = aacDecoder_Open(TT_MP4_ADIF, FILEREAD_MAX_LAYERS);\n  FDK_ASSERT(aacDecoderInfo != NULL);\n\n  for (UINT layer = 0; layer < FILEREAD_MAX_LAYERS; layer++) {\n    conf[layer] = const_cast<UCHAR *>(Data);\n    confSize[layer] = Size;\n  }\n\n  aacDecoder_ConfigRaw(aacDecoderInfo, conf, confSize);\n  aacDecoder_Close(aacDecoderInfo);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libfdk-aac/aacDecoder_DecodeFrame.cpp",
    "content": "// Copyright 2019 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"aacdecoder_lib.h\"\n#include <stdint.h>\n\n#define FILEREAD_MAX_LAYERS 1\n#define OUT_BUF_SIZE (8 * 2048 * 4)\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  HANDLE_AACDECODER aacDecoderInfo = NULL;\n\n  INT_PCM TimeData[OUT_BUF_SIZE];\n  AAC_DECODER_ERROR err;\n  aacDecoderInfo = aacDecoder_Open(TT_MP4_LOAS, FILEREAD_MAX_LAYERS);\n  FDK_ASSERT(aacDecoderInfo != NULL);\n\n  const uint8_t *start = Data;\n  UINT valid, buffer_size;\n\n  do {\n    valid = buffer_size = Data + Size - start;\n    err = aacDecoder_Fill(aacDecoderInfo, const_cast<UCHAR **>(&start),\n                          &buffer_size, &valid);\n    start += buffer_size - valid;\n    if (err == AAC_DEC_OK) {\n      do {\n        err = aacDecoder_DecodeFrame(aacDecoderInfo, TimeData, OUT_BUF_SIZE, 0);\n        if (err != AAC_DEC_OK && err != AAC_DEC_NOT_ENOUGH_BITS) {\n          aacDecoder_Close(aacDecoderInfo);\n          aacDecoderInfo = NULL;\n          return 0;\n        }\n      } while (err != AAC_DEC_NOT_ENOUGH_BITS);\n    }\n  } while (valid > 0);\n  aacDecoder_Close(aacDecoderInfo);\n  aacDecoderInfo = NULL;\n  return 0;\n}\n"
  },
  {
    "path": "projects/libfdk-aac/aacDecoder_Open.cpp",
    "content": "// Copyright 2019 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"aacdecoder_lib.h\"\n#include <stdint.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  HANDLE_AACDECODER aacDecoderInfo = NULL;\n\n  TRANSPORT_TYPE transportType;\n  INT nrOfLayers;\n\n  if (Size != 8) return 0;\n\n  transportType = (TRANSPORT_TYPE)(Data[0] + (Data[1] << 8) + (Data[2] << 16) +\n                                   (Data[3] << 24));\n  nrOfLayers =\n      (UINT)(Data[4] + (Data[5] << 8) + (Data[6] << 16) + (Data[7] << 24));\n\n  aacDecoderInfo = aacDecoder_Open(transportType, nrOfLayers);\n  if (aacDecoderInfo != NULL) {\n    aacDecoder_Close(aacDecoderInfo);\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/libfdk-aac/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the lib.\nINCLUDES=$(for f in $(find aac -name include); do echo -I $f; done)\n# exclude -fno-sanitize=shift-base as there are shallow errors.\nEXTRA_FLAGS=-fno-sanitize=shift-base\nfor f in aac/*/src/*.cpp; do\n  $CXX $CXXFLAGS $INCLUDES $EXTRA_FLAGS -c $f &\ndone\nwait\n\n# Build the fuzz targets.\nfor target_cpp in *.cpp; do\n  target=$(basename $target_cpp .cpp)\n  $CXX $CXXFLAGS $EXTRA_FLAGS $target_cpp $INCLUDES *.o -lm  $LIB_FUZZING_ENGINE -o $OUT/$target\ndone\n"
  },
  {
    "path": "projects/libfdk-aac/project.yaml",
    "content": "homepage: https://android.googlesource.com/platform/external/aac/\nmain_repo: 'https://android.googlesource.com/platform/external/aac/'\nlanguage: c++\nprimary_contact: audio-fdk@iis.fraunhofer.de\nauto_ccs:\n  - jmtrivi@google.com\nvendor_ccs:\n  - adambacchus@google.com\n  - ailport@google.com\n  - bcreasey@google.com\n  - cunefare@google.com\n  - ejorgensen@google.com\n  - faerber@google.com\n  - greendonald@google.com\n  - hamzeh@google.com\n  - jaredkidd@google.com\n  - kimtony@google.com\n  - lindsaywells@google.com\n  - maverickm@google.com\n  - swansonr@google.com\n  - warrenwright@google.com\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n  - i386\n"
  },
  {
    "path": "projects/libfido2/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN apt-get install -y cmake libpcsclite-dev libudev-dev pkg-config chrpath\nRUN git clone --depth 1 --branch v0.11.0 https://github.com/PJK/libcbor\nRUN git clone --depth 1 --branch openssl-3.0 https://github.com/openssl/openssl\nRUN git clone --depth 1 --branch v1.3.1 https://github.com/madler/zlib\nRUN git clone --depth 1 https://github.com/Yubico/libfido2\n# CIFuzz will replace the libfido directory so put the corpus outside\nADD https://storage.googleapis.com/yubico-libfido2/corpus.tgz corpus.tgz\nWORKDIR libfido2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libfido2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build libcbor, taken from oss-fuzz/projects/libcbor/build.sh\n# Note SANITIZE=OFF since it gets taken care of by $CFLAGS set by oss-fuzz\ncd ${SRC}/libcbor\npatch -l -p0 < ${SRC}/libfido2/fuzz/README\nmkdir build && cd build\ncmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug \\\n      -DCMAKE_INSTALL_PREFIX=${WORK} -DSANITIZE=OFF ..\nmake -j$(nproc) VERBOSE=1\nmake install\n\n# Build OpenSSL, taken from oss-fuzz/projects/openssl/build.sh\ncd ${SRC}/openssl\nCONFIGURE_FLAGS=\"\"\nif [[ ${SANITIZER} = memory ]]\nthen\n  CONFIGURE_FLAGS=\"no-asm\"\nfi\n./config --debug no-tests ${CFLAGS} --prefix=${WORK} \\\n         --openssldir=${WORK}/openssl --libdir=lib ${CONFIGURE_FLAGS}\nmake -j$(nproc) LDCMD=\"${CXX} ${CXXFLAGS}\"\nmake install_sw\n\n# Build zlib, taken from oss-fuzz/projects/zlib.sh\ncd ${SRC}/zlib\n./configure --prefix=${WORK}\nmake -j$(nproc) all\nmake install\n\n# Building libfido2 with ${LIB_FUZZING_ENGINE} and chosen sanitizer\ncd ${SRC}/libfido2\nmkdir build && cd build\ncmake -DFUZZ=1 -DFUZZ_LDFLAGS=\"${LIB_FUZZING_ENGINE}\" \\\n      -DFUZZ_LINKER_LANGUAGE=CXX \\\n      -DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=1 \\\n      -DCMAKE_PREFIX_PATH=${WORK} \\\n      -DCMAKE_INSTALL_PREFIX=${WORK} \\\n      -DCMAKE_BUILD_TYPE=Debug ..\nmake -j$(nproc)\nmake install\n\n# Prepare ${OUT} with instrumented libs\nmkdir -p ${OUT}/lib\nfor lib in `ls ${WORK}/lib/lib*.so*`; do\n    cp ${lib} ${OUT}/lib;\ndone\n\n# Place libpcsclite in ${OUT}; needed by fuzz_pcsc\nif [ -x fuzz/fuzz_pcsc ]; then\n    for lib in `ldd fuzz/fuzz_pcsc | awk '/libpcsclite.so.*=>/ { print $3 }'`; do\n        cp ${lib} ${OUT}/lib;\n    done\nfi\n\n# Fixup rpath in the fuzzers so they use our libs\nfor f in `ls fuzz/fuzz_*`; do\n    cp ${f} ${OUT}/\n    fuzzer=$(basename $f)\n    chrpath -r '$ORIGIN/lib' ${OUT}/${fuzzer}\ndone\n\n # Prepare seed corpora\ntar xzf ${SRC}/corpus.tgz\n(set -e ; cd fuzz_assert/corpus    ; zip -r ${OUT}/fuzz_assert_seed_corpus.zip .)\n(set -e ; cd fuzz_attobj/corpus    ; zip -r ${OUT}/fuzz_attobj_seed_corpus.zip .)\n(set -e ; cd fuzz_bio/corpus       ; zip -r ${OUT}/fuzz_bio_seed_corpus.zip .)\n(set -e ; cd fuzz_cred/corpus      ; zip -r ${OUT}/fuzz_cred_seed_corpus.zip .)\n(set -e ; cd fuzz_credman/corpus   ; zip -r ${OUT}/fuzz_credman_seed_corpus.zip .)\n(set -e ; cd fuzz_hid/corpus       ; zip -r ${OUT}/fuzz_hid_seed_corpus.zip .)\n(set -e ; cd fuzz_largeblob/corpus ; zip -r ${OUT}/fuzz_largeblob_seed_corpus.zip .)\n(set -e ; cd fuzz_mgmt/corpus      ; zip -r ${OUT}/fuzz_mgmt_seed_corpus.zip .)\n(set -e ; cd fuzz_netlink/corpus   ; zip -r ${OUT}/fuzz_netlink_seed_corpus.zip .)\n(set -e ; cd fuzz_pcsc/corpus      ; zip -r ${OUT}/fuzz_pcsc_seed_corpus.zip .)\n"
  },
  {
    "path": "projects/libfido2/project.yaml",
    "content": "homepage: https://github.com/Yubico/libfido2\nlanguage: c++\nprimary_contact: \"kostas@yubico.com\"\nauto_ccs:\n    - \"pedro@ambientworks.net\"\n    - \"marissa.nishimoto@yubico.com\"\n    - \"pedro.ossfuzz@gmail.com\"\n    - \"ludvig.michaelsson@yubico.com\"\n    - \"alex.geana@yubico.com\"\nsanitizers:\n    - address\n    - undefined\n    - memory\nfuzzing_engines:\n    - libfuzzer\n    - honggfuzz\n    - afl\n    # - centipede disabled due to https://github.com/google/oss-fuzz/pull/10248#issuecomment-1579657163\nmain_repo: 'https://github.com/Yubico/libfido2'\n"
  },
  {
    "path": "projects/libfuse/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n  make autoconf automake libtool libudev-dev pkg-config \\\n  udev python3-pip && \\\n  python3 -m pip install meson==0.60.0 ninja\nRUN git clone --depth 1 https://github.com/AdaLogics/fuzz-headers fuzz-headers\nRUN git clone --depth 1 https://github.com/libfuse/libfuse libfuse\nWORKDIR libfuse\nCOPY build.sh *.c $SRC/\n"
  },
  {
    "path": "projects/libfuse/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\nmeson setup ..\nmeson configure -D default_library=static\nninja\n\n$CC $CFLAGS -c $SRC/fuzz_optparse.c -o fuzz_optparse.o \\\n  -I$SRC/libfuse/lib/ -I$SRC/libfuse/include -I./ \\\n  -I$SRC/fuzz-headers/lang/c \\\n  -Wincompatible-pointer-types-discards-qualifiers\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_optparse.o \\\n  -o $OUT/fuzz_optparse lib/libfuse3.a \n"
  },
  {
    "path": "projects/libfuse/fuzz_optparse.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#define FUSE_USE_VERSION 31\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include <fuse.h>\n#include <stddef.h>\n\n// To make some fuzz data operations easier.\n#include \"ada_fuzz_header.h\"\n\nstatic char *my_argv[10];\n\nstatic struct options {\n  const char *char_opt1;\n  const char *char_opt2;\n  int int_opt3;\n} options;\n\n#define OPTION(t, p)                                                           \\\n  { t, offsetof(struct options, p), 1 }\nstatic const struct fuse_opt option_spec[] = {\n    OPTION(\"--char_opt1=%s\", char_opt1), OPTION(\"--char_opt2=%s\", char_opt2),\n    OPTION(\"-i\", int_opt3), OPTION(\"--intopt3\", int_opt3), FUSE_OPT_END};\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  af_safe_gb_init(data, size);\n  char *opt1 = ada_safe_get_char_p();\n  char *opt2 = ada_safe_get_char_p();\n\n  for (int i = 0; i < 10; i++) {\n    my_argv[i] = ada_safe_get_char_p();\n  }\n  struct fuse_args args = {10, my_argv, 0};\n\n  options.char_opt1 = strdup(opt1);\n  options.char_opt2 = strdup(opt2);\n  options.int_opt3 = ada_safe_get_int();\n\n  if (fuse_opt_parse(&args, &options, option_spec, NULL) == -1) {\n    free(options.char_opt1);\n    free(options.char_opt2);\n    af_safe_gb_cleanup();\n    return 0;\n  }\n  free(options.char_opt1);\n  free(options.char_opt2);\n\n  fuse_opt_free_args(&args);\n\n  af_safe_gb_cleanup();\n  return 0;\n}\n"
  },
  {
    "path": "projects/libfuse/project.yaml",
    "content": "homepage: \"https://github.com/libfuse/libfuse\"\nmain_repo: \"https://github.com/libfuse/libfuse\"\nlanguage: c\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/libgd/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool pkg-config libz-dev\nRUN git clone --depth 1 https://github.com/libgd/libgd\nADD https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz $SRC/afl_testcases.tgz\nWORKDIR libgd\nCOPY run_tests.sh build.sh *.cc $SRC/\n"
  },
  {
    "path": "projects/libgd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed -i 's/-Werror//g' ./configure.ac\n./bootstrap.sh\n\n# Limit the size of buffer allocations to avoid bogus OOM issues\n# https://github.com/libgd/libgd/issues/422\nsed -i'' -e 's/INT_MAX/100000/' \"$SRC/libgd/src/gd_security.c\"\n\n./configure --prefix=\"$WORK\" --disable-shared\nmake -j$(nproc) install\n\nexport CXXFLAGS=\"${CXXFLAGS} -std=c++17\"\nfor target in Bmp Gd Gd2 Gif Jpeg Png Tga Tiff WBMP Webp; do\n    lowercase=$(echo $target | tr \"[:upper:]\" \"[:lower:]\")\n    $CXX $CXXFLAGS -I\"$WORK/include\" -L\"$WORK/lib\" \\\n      -DFUZZ_GD_FORMAT=$target \\\n      $SRC/parser_target.cc -o $OUT/${lowercase}_target \\\n      $LIB_FUZZING_ENGINE -lgd -Wl,-Bstatic -lz -Wl,-Bdynamic\ndone\n\nfor fuzzers in $(find $SRC -name '*_fuzzer.cc'); do\n      fuzz_basename=$(basename -s .cc $fuzzers)\n      $CXX $CXXFLAGS -I\"$WORK/include\" -L\"$WORK/lib\" \\\n      $fuzzers -o $OUT/$fuzz_basename \\\n      $LIB_FUZZING_ENGINE -lgd -Wl,-Bstatic -lz -Wl,-Bdynamic\ndone\n\nmkdir afl_testcases\n(cd afl_testcases; tar xvf \"$SRC/afl_testcases.tgz\")\nfor format in bmp gif png webp; do\n    mkdir $format\n    find afl_testcases -type f -name '*.'$format -exec mv -n {} $format/ \\;\n    zip -rj $format.zip $format/\n    cp $format.zip \"$OUT/${format}_target_seed_corpus.zip\"\ndone\n\n# Build unit testing by cmake\n# UBSan crashes with the unit testing build, thus unset the CXXFLAGS\n# when UBSan is used for the unit testing build.\nif [[ \"$SANITIZER\" == \"undefined\" ]]\nthen\n  unset CXXFLAGS\nfi\ncmake . -DBUILD_TEST=ON\nmake -C tests -j$(nproc)\n"
  },
  {
    "path": "projects/libgd/gd_image_string_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/////////////////////////////////////////////////////////////////////////////\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <cstddef>\n#include <cstdint>\n#include <cstdlib>\n#include <string>\n\n#include \"gd.h\"\n#include \"gdfontg.h\"\n#include \"gdfontl.h\"\n#include \"gdfontmb.h\"\n#include \"gdfonts.h\"\n#include \"gdfontt.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n    FuzzedDataProvider stream(data, size);\n    const uint8_t slate_width = stream.ConsumeIntegral<uint8_t>();\n    const uint8_t slate_height = stream.ConsumeIntegral<uint8_t>();\n    gdImagePtr slate_image = gdImageCreateTrueColor(slate_width, slate_height);\n    if (slate_image == nullptr) {\n      return 0;\n    }\n\n    const int x_position = stream.ConsumeIntegral<int>();\n    const int y_position = stream.ConsumeIntegral<int>();\n    const int text_color = stream.ConsumeIntegral<int>();\n    const gdFontPtr font_ptr = stream.PickValueInArray(\n        {gdFontGetGiant(), gdFontGetLarge(), gdFontGetMediumBold(),\n        gdFontGetSmall(), gdFontGetTiny()});\n    const std::string text = stream.ConsumeRemainingBytesAsString();\n\n    gdImageString(slate_image, font_ptr, x_position, y_position,\n                  reinterpret_cast<uint8_t*>(const_cast<char*>(text.c_str())),\n                  text_color);\n    gdImageDestroy(slate_image);\n    return 0;\n}\n"
  },
  {
    "path": "projects/libgd/parser_target.cc",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/////////////////////////////////////////////////////////////////////////////\n\n#include <stdint.h>\n#include \"gd.h\"\n\n#define PASTE(x) gdImageCreateFrom ## x ## Ptr\n#define CREATE_IMAGE(FORMAT) PASTE(FORMAT)\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    gdImagePtr im = CREATE_IMAGE(FUZZ_GD_FORMAT)(Size, (void*) Data);\n    if (im) gdImageDestroy(im);\n    return 0;\n}\n"
  },
  {
    "path": "projects/libgd/project.yaml",
    "content": "homepage: \"https://libgd.org\"\nlanguage: c++\nprimary_contact: \"security@libgd.org\"\nauto_ccs:\n  - vapier@gmail.com\n  - tim@tim-smith.us\n  - cmbecker69@gmx.de\nmain_repo: 'https://github.com/libgd/libgd'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libgd/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Skip segfault and failed cases and run the remaining unit testing\nctest --test-dir $SRC/libgd -j$(nproc) -E \\\n  \"test_gdimagecolormatch_cve_2019_6977|test_gdimagetruecolortopalette_php_bug_72512|test_gdinterpolatedscale_gdTrivialResize|test_gdimagecopyrotated_bug00320|test_gdinterpolatedscale_gdModesAndPalettes\"\n"
  },
  {
    "path": "projects/libgit2/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake make\nRUN git clone --depth 1 https://github.com/libgit2/libgit2 libgit2\nWORKDIR libgit2\n\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/libgit2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Some of the tests do not work in the OSS-Fuzz environment, patch these out\n# here:\nsed -i \"s/add_clar_test(libgit2_tests online /#add_clar_test(libgit2_tests online/g\" tests/libgit2/CMakeLists.txt\nsed -i \"s/add_clar_test(libgit2_tests prox/#add_clar_test(libgit2_tests prox/g\" tests/libgit2/CMakeLists.txt\nsed -i \"s/add_clar_test(libgit2_tests auth_clone/#add_clar_test(libgit2_tests auth_clone/g\" tests/libgit2/CMakeLists.txt\n\n\n# build project\nmkdir -p build\ncd build\ncmake .. -DCMAKE_INSTALL_PREFIX=\"$WORK\" \\\n      -DBUILD_SHARED_LIBS=OFF \\\n      -DBUILD_CLAR=OFF \\\n      -DUSE_HTTPS=OFF \\\n      -DUSE_AUTH_NTLM=OFF \\\n      -DUSE_SSH=OFF \\\n      -DUSE_BUNDLED_ZLIB=ON \\\n\nmake -j$(nproc)\nmake install\n\n# Compile the shared fuzzer_utils.c\n$CC $CFLAGS -c \\\n    -I./src -I./src/util -I./include/ -I./include/git2 \\\n    -I../src/libgit2 -I../src/util -I../include \\\n    -I../fuzzers \\\n    ../fuzzers/fuzzer_utils.c -o \"$WORK/fuzzer_utils.o\"\n\nfor fuzzer in ../fuzzers/*_fuzzer.c\ndo\n    fuzzer_name=$(basename \"${fuzzer%.c}\")\n\n    $CC $CFLAGS -c \\\n        -I./src -I./src/util -I./include/ -I./include/git2 \\\n        -I../src/libgit2 -I../src/util -I../include \\\n        -I../fuzzers \\\n        \"$fuzzer\" -o \"$WORK/$fuzzer_name.o\"\n\n    $CXX $CXXFLAGS -std=c++11 -o \"$OUT/$fuzzer_name\" \\\n        $LIB_FUZZING_ENGINE \"$WORK/$fuzzer_name.o\" \"$WORK/fuzzer_utils.o\" \"$WORK/lib/libgit2.a\"\n\n    zip -j \"$OUT/${fuzzer_name}_seed_corpus.zip\" \\\n        ../fuzzers/corpora/${fuzzer_name%_fuzzer}/*\ndone\n"
  },
  {
    "path": "projects/libgit2/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://libgit2.github.com/\"\nlanguage: c++\nprimary_contact: \"ps@pks.im\"\nauto_ccs:\n  - \"nelhage@nelhage.com\"\nmain_repo: 'https://github.com/libgit2/libgit2'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libgit2/run_tests.sh",
    "content": "\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\ncd build\nctest\n"
  },
  {
    "path": "projects/libheif/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone \\\n    --depth 1 \\\n    --branch master \\\n    https://github.com/strukturag/libheif.git \\\n    libheif\n\nWORKDIR libheif\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libheif/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Delegate actual building to the script provided by libheif.\n./scripts/build-oss-fuzz.sh\n"
  },
  {
    "path": "projects/libheif/project.yaml",
    "content": "homepage: \"https://github.com/strukturag/libheif\"\nlanguage: c++\nprimary_contact: \"dirk.farin@gmail.com\"\nauto_ccs:\n  - \"mail@joachim-bauch.de\"\narchitectures:\n  - i386\n  - x86_64\nmain_repo: 'https://github.com/strukturag/libheif.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libhevc/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget cmake\nRUN git clone https://github.com/ittiam-systems/libhevc.git\nADD https://storage.googleapis.com/android_media/external/libhevc/fuzzer/hevc_dec_fuzzer_seed_corpus.zip $SRC/\nCOPY build.sh $SRC/\nWORKDIR libhevc\n"
  },
  {
    "path": "projects/libhevc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project.\n$SRC/libhevc/fuzzer/ossfuzz.sh\n"
  },
  {
    "path": "projects/libhevc/project.yaml",
    "content": "homepage: \"https://github.com/ittiam-systems/libhevc\"\nlanguage: c++\nprimary_contact: \"harish.mahendrakar@ittiam.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nauto_ccs:\n  - aadithya.kamath@ittiam.com\n  - harish.mahendrakar@ittiam.com\n  - ram.mohan@ittiam.com\n  - umang.saini@ittiam.com\n  - essick@google.com\n  - lajos@google.com\nvendor_ccs:\n  - adambacchus@google.com\n  - ailport@google.com\n  - bcreasey@google.com\n  - cunefare@google.com\n  - ejorgensen@google.com\n  - faerber@google.com\n  - greendonald@google.com\n  - hamzeh@google.com\n  - jaredkidd@google.com\n  - kimtony@google.com\n  - lindsaywells@google.com\n  - maverickm@google.com\n  - swansonr@google.com\n  - warrenwright@google.com\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/ittiam-systems/libhevc.git'\n"
  },
  {
    "path": "projects/libhtp/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool zlib1g-dev liblzma-dev\nRUN git clone --depth 1 https://github.com/OISF/libhtp.git libhtp\nWORKDIR $SRC/libhtp\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libhtp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nsh autogen.sh\n./configure\nmake -j$(nproc)\n\n$CC $CFLAGS -I. -c test/fuzz/fuzz_htp.c -o fuzz_htp.o\n$CC $CFLAGS -I. -c test/test.c -o test.o\n$CXX $CXXFLAGS fuzz_htp.o test.o -o $OUT/fuzz_htp_c ./htp/.libs/libhtp.a $LIB_FUZZING_ENGINE -lz -llzma\n\n# builds corpus\nzip -r $OUT/fuzz_htp_seed_corpus.zip test/files/*.t\n"
  },
  {
    "path": "projects/libhtp/project.yaml",
    "content": "homepage: \"https://github.com/OISF/libhtp\"\nlanguage: c\nprimary_contact: \"vjulien@openinfosecfoundation.org\"\nauto_ccs :\n- \"p.antoine@catenacyber.fr\"\n- \"jish@openinfosecfoundation.org\"\n\nsanitizers:\n- address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/OISF/libhtp.git'\n"
  },
  {
    "path": "projects/libhtp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake check\n"
  },
  {
    "path": "projects/libical/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Install OpenJDK\nRUN apt-get update && \\\n    apt-get install -y openjdk-11-jdk && \\\n    rm -rf /var/lib/apt/lists/*\n\nRUN git clone --depth 1 https://github.com/libical/libical.git\nCOPY run_tests.sh build.sh $SRC/\nCOPY *.cc $SRC/\nWORKDIR libical\n"
  },
  {
    "path": "projects/libical/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncmake . -DSTATIC_ONLY=ON -DLIBICAL_GLIB=False -DLIBICAL_GLIB_BUILD_DOCS=False -DLIBICAL_GOBJECT_INTROSPECTION=False -DLIBICAL_JAVA_BINDINGS=False -DLIBICAL_BUILD_TESTING=True\nmake install -j$(nproc)\n\n\n$CXX $CXXFLAGS -std=c++11 $SRC/libical_fuzzer.cc $LIB_FUZZING_ENGINE /usr/local/lib/libical.a -o $OUT/libical_fuzzer\n$CXX $CXXFLAGS -std=c++11 $SRC/libical_extended_fuzzer.cc $LIB_FUZZING_ENGINE /usr/local/lib/libical.a -o $OUT/libical_extended_fuzzer\n$CXX $CXXFLAGS -std=c++11 $SRC/libicalvcard_fuzzer.cc $LIB_FUZZING_ENGINE /usr/local/lib/libicalvcard.a /usr/local/lib/libical.a -o $OUT/libicalvcard_fuzzer\n\nfind . -name *.ics -print | zip -q $OUT/libical_fuzzer_seed_corpus.zip -@\n"
  },
  {
    "path": "projects/libical/libical_extended_fuzzer.cc",
    "content": "/*\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n/*\n  Usage:\n    python infra/helper.py build_image libical\n    python infra/helper.py build_fuzzers --sanitizer undefined|address|memory libical\n    python infra/helper.py run_fuzzer libical libical_extended_fuzzer\n*/\n\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n\n#include <libical/ical.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    char *ical_string1 = (char*)malloc(size + 1);\n    memcpy(ical_string1, data, size);\n    ical_string1[size] = '\\0';\n\n    icalcomponent *ical1 = icalcomponent_new_from_string(ical_string1);\n    if (ical1 != NULL) {\n        icalcomponent_normalize(ical1);\n    }\n    icalcomponent_free(ical1);\n    free(ical_string1);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/libical/libical_fuzzer.cc",
    "content": "/*\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n/*\n  Usage:\n    python infra/helper.py build_image libical\n    python infra/helper.py build_fuzzers --sanitizer undefined|address|memory libical\n    python infra/helper.py run_fuzzer libical libical_fuzzer\n*/\n\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n\n#include <libical/ical.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    char *ical_string = (char*)malloc(size + 1);\n    memcpy(ical_string, data, size);\n    ical_string[size] = '\\0';\n\n    icalcomponent *component = icalparser_parse_string(ical_string);\n    icalcomponent_free(component);\n\n    free(ical_string);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/libical/libicalvcard_fuzzer.cc",
    "content": "/*\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n/*\n  Usage:\n    python infra/helper.py build_image libical\n    python infra/helper.py build_fuzzers --sanitizer undefined|address|memory libical\n    python infra/helper.py run_fuzzer libical libicalvcard_fuzzer\n*/\n\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n\n#include <libical/ical.h>\n#include <libical/vcard.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    char *vcard_string = (char*)malloc(size + 1);\n    memcpy(vcard_string, data, size);\n    vcard_string[size] = '\\0';\n\n    vcardcomponent *card = vcardparser_parse_string(vcard_string);\n    vcardcomponent_free(card);\n\n    free(vcard_string);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/libical/project.yaml",
    "content": "homepage: https://github.com/libical/libical\nlanguage: c++\nprimary_contact: tsdgeos@gmail.com\nauto_ccs:\n  - allen.d.winter@gmail.com\n  - kent.sutherland@gmail.com\n  - ksmurchison@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/libical/libical.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libical/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir $SRC/libical -j$(nproc)\n"
  },
  {
    "path": "projects/libidn/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n pkg-config \\\n autopoint \\\n autoconf \\\n autoconf-archive \\\n automake \\\n libtool \\\n gettext gengetopt curl gperf wget\n\nRUN git clone https://git.savannah.gnu.org/git/libidn.git\n\nWORKDIR libidn\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libidn/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# avoid iconv() memleak on Ubuntu 16.04 image (breaks test suite)\nexport ASAN_OPTIONS=detect_leaks=0\n\n./bootstrap --skip-po\n./configure --enable-static --disable-doc\nmake -j\nmake -j check\n\ncd fuzz\nmake oss-fuzz\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'\n\nfor fuzzer in *_fuzzer; do\n    cp -p \"${fuzzer}\" \"$OUT\"\n\n    if [ -f \"$SRC/${fuzzer}_seed_corpus.zip\" ]; then\n        cp \"$SRC/${fuzzer}_seed_corpus.zip\" \"$OUT/\"\n    fi\n\n    if [ -d \"${fuzzer}.in/\" ]; then\n        zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${fuzzer}.in/\"\n    fi\ndone\n"
  },
  {
    "path": "projects/libidn/project.yaml",
    "content": "homepage: \"https://www.gnu.org/software/libidn/\"\nlanguage: c++\nprimary_contact: \"rockdaboot@gmail.com\"\nauto_ccs:\n  - \"tim.ruehsen@gmx.de\"\n  - \"simon@josefsson.org\"\nmain_repo: 'https://git.savannah.gnu.org/git/libidn.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libidn2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake gettext libtool autopoint pkg-config gengetopt curl gperf rsync wget\n\nRUN git clone --recursive https://gitlab.com/libidn/libidn2.git\n\nWORKDIR libidn2\nCOPY build.sh replay_build.sh $SRC/\n"
  },
  {
    "path": "projects/libidn2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./bootstrap\n# switch off leak detection for ./configure run to detect iconv() correctly\nASAN_OPTIONS=detect_leaks=0 ./configure --enable-static --disable-shared --disable-doc --disable-gcc-warnings\nmake clean\nmake -j$(nproc) check VERBOSE=t\n\ncd fuzz\nmake oss-fuzz\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'\n\nfor dir in *_fuzzer.in; do\n  fuzzer=$(basename $dir .in)\n  zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n"
  },
  {
    "path": "projects/libidn2/project.yaml",
    "content": "homepage: \"https://gitlab.com/libidn/libidn2\"\nlanguage: c++\nprimary_contact: \"rockdaboot@gmail.com\"\nauto_ccs:\n  - \"simon@josefsson.org\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://gitlab.com/libidn/libidn2.git'\n"
  },
  {
    "path": "projects/libidn2/replay_build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script is useful for OSS-Fuzz infrastructure which is used to rebuild\n# code from cached images. This is to support various ongoing efforts in\n# OSS-Fuzz.\n\ncd $SRC/libidn2\nmake -j$(nproc)\n\ncd fuzz\nmake oss-fuzz\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'"
  },
  {
    "path": "projects/libiec61850/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone https://github.com/mz-automation/libiec61850\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fuzz_decode.options $SRC/fuzz_decode.options\n"
  },
  {
    "path": "projects/libiec61850/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd libiec61850\nmkdir build && cd build\ncmake ../\nmake\n\n$CC $CFLAGS $LIB_FUZZING_ENGINE ../fuzz/fuzz_mms_decode.c -c \\\n\t-I../src/iec61850/inc -I../src/mms/inc -I../src/common/inc \\\n\t-I../hal/inc -I../src/logging\n\n\n$CXX $CXXFLAGS -fuse-ld=lld $LIB_FUZZING_ENGINE fuzz_mms_decode.o -o $OUT/fuzz_mms_decode ./src/libiec61850.a ./hal/libhal.a\n\n# Copy over the options file\ncp $SRC/fuzz_decode.options $OUT/fuzz_decode.options\n"
  },
  {
    "path": "projects/libiec61850/fuzz_decode.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/libiec61850/project.yaml",
    "content": "homepage: \"https://github.com/mz-automation/libiec61850\"\nprimary_contact: \"support@mz-automation.de\"\nauto_ccs:\n  - \"david@adalogics.com\"\nlanguage: c\nmain_repo: 'https://github.com/mz-automation/libiec61850'\n"
  },
  {
    "path": "projects/libigl/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libgmp-dev libmpfr-dev\nRUN git clone --depth 1 https://github.com/libigl/libigl\nWORKDIR $SRC/libigl\nCOPY igl_fuzzer.cpp \\\n     run_tests.sh \\\n     build.sh \\\n     $SRC/\n\n"
  },
  {
    "path": "projects/libigl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build-dir && cd build-dir\ncmake -DLIBIGL_OPENGL=OFF \\\n      -DLIBIGL_GLFW=OFF \\\n      -DLIBIGL_IMGUI=OFF \\\n      -DLIBIGL_COMISO=OFF \\\n      -DLIBIGL_EMBREE=OFF \\\n      -DLIBIGL_PNG=OFF \\\n      -DLIBIGL_COPYLEFT_CORE=OFF \\\n      -DLIBIGL_COPYLEFT_CGAL=OFF \\\n      -DLIBIGL_COPYLEFT_TETGEN=OFF \\\n      -DLIBIGL_COPYLEFT_COMISO=OFF \\\n      -DLIBIGL_RESTRICTED_TRIANGLE=OFF \\\n      -DLIBIGL_PREDICATES=OFF \\\n      -DLIBIGL_XML=OFF \\\n      -DLIBIGL_RESTRICTED_MATLAB=OFF \\\n      -DLIBIGL_BUILD_TESTS=ON \\\n      ..\nmake -j$(nproc)\n\n$CXX $CXXFLAGS -DIGL_STATIC_LIBRARY \\\n     -I/src/libigl/include \\\n     -isystem /src/libigl/cmake/../include \\\n     -isystem /src/libigl/cmake/../external/eigen \\\n     -c $SRC/igl_fuzzer.cpp -o fuzzer.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzzer.o   \\\n     -o $OUT/igl_fuzzer $SRC/libigl/build-dir/lib/libigl.a\n"
  },
  {
    "path": "projects/libigl/igl_fuzzer.cpp",
    "content": "/*  Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <igl/MshLoader.h>\n#include <iostream>\n\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n    char *nullt_string = (char *)malloc(size+1);\n    if (nullt_string == NULL){\n            return 0;\n    }\n    memcpy(nullt_string, data, size);\n    nullt_string[size] = '\\0';\n    std::ofstream fuzz_file;\n    fuzz_file.open (\"fuzz_file.msh\");\n    fuzz_file << nullt_string;\n    fuzz_file.close();\n    try {\n    \tigl::MshLoader msh_loader(\"fuzz_file.msh\");\n    } catch (...) {}\n    free(nullt_string);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/libigl/project.yaml",
    "content": "homepage: \"https://libigl.github.io\"\nlanguage: c++\nprimary_contact: \"alecjacobson@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: \"https://github.com/libigl/libigl\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libigl/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd build-dir\n# TODO: Skipping some failing tests for now.\nctest \\\n  -j $(nproc) \\\n  -E \"(AABB: intersect|\\\nboundary_facets: single_tri|\\\nincrement_ulp: dense|\\\nsigned_distance: single_tet|\\\nsigned_distance: single_triangle|\\\nsigned_distance: dimension-templates)\"\n"
  },
  {
    "path": "projects/libjpeg-turbo/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n# Copyright 2022-2023 D. R. Commander\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make yasm cmake\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/fuzz && \\\n    cat fuzz/branches.txt | while read branch; do \\\n      git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo -b $branch libjpeg-turbo.$branch; \\\n    done\n\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/seed-corpora\nRUN cd seed-corpora && zip -r ../decompress_fuzzer_seed_corpus.zip afl-testcases/jpeg* bugs/decompress*\nRUN cat fuzz/branches.txt | while read branch; do \\\n      zip -r decompress_fuzzer_seed_corpus.zip libjpeg-turbo.$branch/testimages/*.jpg; \\\n    done\nRUN cd seed-corpora && zip -r ../compress_fuzzer_seed_corpus.zip afl-testcases/bmp afl-testcases/gif* afl-testcases/targa bugs/compress*\nRUN cat fuzz/branches.txt | while read branch; do \\\n      zip -r compress_fuzzer_seed_corpus.zip libjpeg-turbo.$branch/testimages/*.bmp libjpeg-turbo.$branch/testimages/*.ppm libjpeg-turbo.$branch/testimages/*.pgm; \\\n    done\nRUN rm -rf seed-corpora\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libjpeg-turbo/build.sh",
    "content": "# Copyright 2022-2023 D. R. Commander\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -e\nset -u\n\ncat fuzz/branches.txt | while read branch; do\n\tpushd libjpeg-turbo.$branch\n\tif [ \"$branch\" = \"main\" ]; then\n\t\tsh fuzz/build.sh\n\telse\n\t\tsh fuzz/build.sh _$branch\n\tfi\n\tpopd\ndone\n"
  },
  {
    "path": "projects/libjpeg-turbo/project.yaml",
    "content": "homepage: \"https://libjpeg-turbo.org\"\nlanguage: c\nprimary_contact: \"drc@virtualgl.org\"\nvendor_ccs:\n  - \"aosmond@mozilla.com\"\n  - \"tnikkel@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/libjpeg-turbo/libjpeg-turbo'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libjxl/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake ninja-build pkg-config \\\n  libjpeg-dev\nRUN git clone --depth 1 https://github.com/libjxl/libjxl.git\n# We only need these sub-projects for the fuzzers.\nRUN git -C libjxl submodule update --init --recommend-shallow \\\n  third_party/brotli \\\n  third_party/highway \\\n  third_party/libjpeg-turbo \\\n  third_party/skcms\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/seed-corpora\n\nWORKDIR libjxl\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libjxl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbuild_args=(\n  -G Ninja\n  -DBUILD_TESTING=OFF\n  -DBUILD_SHARED_LIBS=OFF\n  -DJPEGXL_ENABLE_BENCHMARK=OFF\n  -DJPEGXL_ENABLE_DEVTOOLS=ON\n  -DJPEGXL_ENABLE_EXAMPLES=OFF\n  -DJPEGXL_ENABLE_FUZZERS=ON\n  -DJPEGXL_ENABLE_MANPAGES=OFF\n  -DJPEGXL_ENABLE_SJPEG=OFF\n  -DJPEGXL_ENABLE_VIEWERS=OFF\n  -DCMAKE_BUILD_TYPE=Release\n  -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON\n)\n\n# Build and generate a fuzzer corpus in release mode without instrumentation.\n# This is done in a subshell since we change the environment.\n(\n  unset CFLAGS\n  unset CXXFLAGS\n  export AFL_NOOPT=1\n\n  rm -rf ${WORK}/libjxl-corpus\n  mkdir -p ${WORK}/libjxl-corpus\n  cd ${WORK}/libjxl-corpus\n  cmake \"${build_args[@]}\" \"${SRC}/libjxl\"\n  ninja clean\n  ninja djxl_fuzzer_corpus\n\n  # Generate fuzzer corpora.\n  fuzzers=(\n    djxl_fuzzer\n  )\n  for fuzzer in \"${fuzzers[@]}\"; do\n    mkdir -p \"${fuzzer}_corpus\"\n    \"tools/${fuzzer}_corpus\" -q -r \"${fuzzer}_corpus\"\n  done\n\n  for fuzzer in \"${fuzzers[@]}\"; do\n    zip -q -j \"${OUT}/${fuzzer}_seed_corpus.zip\" \"${fuzzer}_corpus\"/*\n  done\n)\n\n# Build the fuzzers in release mode but force the inclusion of JXL_DASSERT()\n# checks.\nexport CXXFLAGS=\"${CXXFLAGS} -DJXL_IS_DEBUG_BUILD=1\"\n\nif [ \"$SANITIZER\" == \"undefined\" ]; then\n  build_args[${#build_args[@]}]=\"-DCXX_NO_RTTI_SUPPORTED=OFF\"\nfi\n\nrm -rf ${WORK}/libjxl-fuzzer\nmkdir -p ${WORK}/libjxl-fuzzer\ncd ${WORK}/libjxl-fuzzer\ncmake \\\n  \"${build_args[@]}\" \\\n  -DJPEGXL_FUZZER_LINK_FLAGS=\"${LIB_FUZZING_ENGINE}\" \\\n  \"${SRC}/libjxl\"\n\nfuzzers=(\n  cjxl_fuzzer\n  color_encoding_fuzzer\n  decode_basic_info_fuzzer\n  djxl_fuzzer\n  fields_fuzzer\n  icc_codec_fuzzer\n  rans_fuzzer\n  set_from_bytes_fuzzer\n  streaming_fuzzer\n  transforms_fuzzer\n)\n\nninja clean\nninja \"${fuzzers[@]}\"\nfor fuzzer in \"${fuzzers[@]}\"; do\n  cp tools/${fuzzer} \"${OUT}/\"\ndone\n"
  },
  {
    "path": "projects/libjxl/project.yaml",
    "content": "homepage: \"https://github.com/libjxl/libjxl\"\nmain_repo: 'https://github.com/libjxl/libjxl.git'\nlanguage: c++\n\nprimary_contact: \"libjxl-security@google.com\"\nauto_ccs:\n  - \"eustas@google.com\"\n  - \"jyrki@google.com\"\n  - \"veluca@google.com\"\n\nsanitizers:\n  - address\n  - memory\n  - undefined\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\narchitectures:\n - x86_64\n - i386\n"
  },
  {
    "path": "projects/libldac/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y automake ffmpeg libtool\nRUN git clone --depth 1 -b master https://android.googlesource.com/platform/external/libldac\nRUN python3 -m pip install --upgrade pip && python3 -m pip install corpus-replicator\nRUN corpus-replicator -o corpora audio_pcm_wav_ffmpeg.yml audio\n\nWORKDIR libldac\n\nCOPY build.sh libldac_encode_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/libldac/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$CC $CFLAGS -Iinc -c $SRC/libldac_encode_fuzzer.cc -o libldac_encode_fuzzer.o\n$CC $CFLAGS -Iinc -c src/ldaclib.c -o src/ldaclib.o\n$CC $CFLAGS -Iinc -c src/ldacBT.c -o src/ldacBT.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n\tlibldac_encode_fuzzer.o \\\n\tsrc/ldaclib.o \\\n\tsrc/ldacBT.o \\\n\t-o $OUT/libldac_encode_fuzzer\n\nzip -q $OUT/libldac_encode_fuzzer_seed_corpus.zip $SRC/corpora/*\n"
  },
  {
    "path": "projects/libldac/libldac_encode_fuzzer.cc",
    "content": "// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include <stdint.h>\n#include <stddef.h>\n#include \"ldacBT.h\"\n\n#define TESTFUNC_TYPE extern \"C\" int\n\nTESTFUNC_TYPE\nLLVMFuzzerTestOneInput(const uint8_t *buf, size_t size)\n{\n    if (size == 0) {\n    \treturn 0;\n    }\n    HANDLE_LDAC_BT hLdacBt;\n    int pcm_used, stream_sz, frame_num;\n    unsigned char p_stream[1024];\n\n    hLdacBt = ldacBT_get_handle();\n\n    ldacBT_init_handle_encode(\n        hLdacBt,\n        679,\n        LDACBT_EQMID_SQ,\n        LDACBT_CHANNEL_MODE_DUAL_CHANNEL,\n        LDACBT_SMPL_FMT_S16,\n        48000);\n\n    ldacBT_encode(\n        hLdacBt,\n        (void *)(&buf + 44),\n        &pcm_used,\n        p_stream,\n        &stream_sz,\n        &frame_num);\n\n    ldacBT_get_sampling_freq(hLdacBt);\n    ldacBT_get_bitrate(hLdacBt);\n    ldacBT_get_version();\n\n    ldacBT_close_handle(hLdacBt);\n    ldacBT_free_handle(hLdacBt);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/libldac/project.yaml",
    "content": "homepage: \"https://android.googlesource.com/platform/external/libldac\"\nlanguage: c++\nprimary_contact: \"Chisato.Kenmochi@sony.com\"\nauto_ccs:\n  - twsmith@mozilla.com\nvendor_ccs:\n  - adambacchus@google.com\n  - ailport@google.com\n  - bcreasey@google.com\n  - cunefare@google.com\n  - ejorgensen@google.com\n  - faerber@google.com\n  - greendonald@google.com\n  - hamzeh@google.com\n  - jaredkidd@google.com\n  - kimtony@google.com\n  - lindsaywells@google.com\n  - maverickm@google.com\n  - swansonr@google.com\n  - warrenwright@google.com\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\nmain_repo: 'https://android.googlesource.com/platform/external/libldac'\n"
  },
  {
    "path": "projects/liblouis/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config zlib1g-dev libpci-dev\nRUN git clone --depth 1 https://github.com/liblouis/liblouis\nWORKDIR liblouis\nRUN sed -i 's/main/main2/g' tests/fuzzing/fuzz_backtranslate.c && \\\n    sed -i 's/main/main2/g' tests/fuzzing/fuzz_translate_generic.c && \\\n    sed -i 's/LLVMFuzzerRunDriver(&argc/\\/\\/LLVMFuzzerRunDriver(&argc/g' tests/fuzzing/fuzz_backtranslate.c && \\\n    sed -i 's/LLVMFuzzerRunDriver(&argc/\\/\\/LLVMFuzzerRunDriver(&argc/g' tests/fuzzing/fuzz_translate_generic.c\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/liblouis/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/liblouis/tests/fuzzing/build.sh\n"
  },
  {
    "path": "projects/liblouis/project.yaml",
    "content": "homepage: \"https://github.com/liblouis/liblouis\"\nmain_repo: \"https://github.com/liblouis/liblouis\"\nlanguage: c\nprimary_contact: \"christian.egli@sbs.ch\"\nauto_ccs:\n  - \"bertfrees@gmail.com\"\n  - \"david@adalogics.com\"\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/liblouis/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake check\n"
  },
  {
    "path": "projects/libmicrohttpd/project.yaml",
    "content": "homepage: \"https://www.gnu.org/s/libmicrohttpd/\"\nmain_repo: \"https://git.gnunet.org/libmicrohttpd.git\"\nprimary_contact: \"christian@grothoff.org\"\nauto_ccs:\n         - \"k2k@narod.ru\"\n"
  },
  {
    "path": "projects/libmicrohttpd2/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && \\\n    apt-get install -y autoconf automake libtool pkg-config texinfo \\\n        gnutls-dev gnutls-bin\nRUN git clone git://git.gnunet.org/libmicrohttpd2.git mhd2\nWORKDIR mhd2\nCOPY build.sh *.cpp *.h $SRC/\nCOPY *.options *.dict $SRC/\n"
  },
  {
    "path": "projects/libmicrohttpd2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBINARY=$SRC/mhd2/src/mhd2/.libs/libmicrohttpd2.a\n\n# Build libmicrohttpd\ngit pull\n./autogen.sh\n# Compile MHD with the SAME compiler used later.\nexport CC=$CXX\n# Enable most features, force specific TLS library, and disable symbol hiding\n./configure \\\n    --enable-dauth \\\n    --enable-md5=builtin \\\n    --enable-sha256=builtin \\\n    --enable-sha512-256=builtin \\\n    --enable-bauth \\\n    --enable-upgrade \\\n    --enable-https \\\n    --without-openssl \\\n    --enable-messages \\\n    --disable-examples \\\n    mhd_cv_cc_attr_visibility_default=\"no\" \\\n    mhd_cv_cc_attr_visibility_internal=\"no\" \\\n    mhd_cv_cc_attr_visibility_hidden=\"no\"\nASAN_OPTIONS=detect_leaks=0 make -j$(nproc)\nmake install\n\n# Compile fuzzer\nFUZZERS=\"fuzz_response fuzz_daemon fuzz_mhd2 fuzz_str fuzz_crypto_int fuzz_libinfo fuzz_connection fuzz_daemon_connection\"\n\nfor fuzzer in $FUZZERS; do\n  extra_src=\"\"\n  case \"$fuzzer\" in\n    fuzz_response|fuzz_daemon)\n      extra_src=\"$SRC/mhd_helper.cpp\"\n      ;;\n  esac\n  case \"$fuzzer\" in\n    fuzz_connection|fuzz_daemon_connection)\n      extra_src=\"$SRC/connection_helper.cpp\"\n      ;;\n  esac\n\n  $CXX $CXXFLAGS -DHAVE_CONFIG_H \"$SRC/$fuzzer.cpp\" $extra_src \\\n    -Wno-unused-parameter -Wno-unused-value -pthread \\\n    -I\"$SRC\" -I\"$SRC/mhd2/src/mhd2\" -I\"$SRC/mhd2/src/include\" \\\n    -I\"$SRC/mhd2/src/incl_priv\" -I\"$SRC/mhd2/src/incl_priv/config\" \\\n    $LIB_FUZZING_ENGINE \"$BINARY\" -lgnutls -o \"$OUT/$fuzzer\"\ndone\n\n# Rebuild the binary for external crypto with libgcrypt\n./autogen.sh\n./configure \\\n    --enable-md5=tlslib \\\n    --enable-sha256=tlslib \\\n    --enable-sha512-256=builtin \\\n    --without-openssl \\\n    --disable-examples \\\n    mhd_cv_cc_attr_visibility_default=\"no\" \\\n    mhd_cv_cc_attr_visibility_internal=\"no\" \\\n    mhd_cv_cc_attr_visibility_hidden=\"no\"\nmake clean\nmake -j$(nproc)\nmake install\n\n$CXX $CXXFLAGS $SRC/fuzz_crypto_ext.cpp -DHAVE_CONFIG_H \\\n  -Wno-unused-parameter -Wno-unused-value -I$SRC/mhd2/src/mhd2 \\\n  -I$SRC/mhd2/src/include -I$SRC/mhd2/src/incl_priv \\\n  -I$SRC/mhd2/src/incl_priv/config $LIB_FUZZING_ENGINE $BINARY \\\n  -lgnutls -o $OUT/fuzz_crypto_ext\n\ncp $SRC/default.options $OUT/fuzz_daemon.options\ncp $SRC/*.dict $OUT/\n"
  },
  {
    "path": "projects/libmicrohttpd2/connection_helper.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include \"connection_helper.h\"\n#include <cstring>\n#include <unordered_set>\n\n#include \"mhd_action.h\"\n#include \"http_post_enc.h\"\n#include \"mempool_funcs.h\"\n#include \"daemon_funcs.h\"\n#include \"post_parser_funcs.h\"\n#include \"response_funcs.h\"\n#include \"stream_process_request.h\"\n#include \"stream_funcs.h\"\n\n\n// MHD memory pool\nstruct mhd_MemoryPool *g_pool = nullptr;\nconst size_t g_pool_size = 14 * 1024;\nstd::string g_mpart_boundary;\n\n// Body status\nstatic std::unordered_set<const MHD_Connection*> g_post_parse_ready;\n\n// Helper to clear memory pool\nvoid destroy_global_pool() {\n  if (g_pool) { mhd_pool_destroy(g_pool); g_pool = nullptr; }\n}\n\n\n// Helper to set body parsing ready\nvoid mark_post_parse_ready(MHD_Connection& c) {\n  g_post_parse_ready.insert(&c);\n}\n\n// Helper to check parse body status\nbool is_post_parse_ready(const MHD_Connection& c) {\n  return g_post_parse_ready.find(&c) != g_post_parse_ready.end();\n}\n\n// Helper to clear parse body status\nvoid clear_post_parse_ready(const MHD_Connection& c) {\n  g_post_parse_ready.erase(&c);\n}\n\n// Helper to destroy error response\nstatic bool destroy_error_response(MHD_Connection c) {\n  if (c.stage == mhd_HTTP_STAGE_START_REPLY) {\n    MHD_response_destroy(c.rp.response);\n    c.rp.response = nullptr;\n    return true;\n  }\n\n  return false;\n}\n\n// Helper to randomly choose HTTP methods\nstatic std::string pick_method(FuzzedDataProvider& fdp) {\n  static const char* kMethods[] = {\n    \"GET\",\"POST\",\"PUT\",\"HEAD\",\"DELETE\",\"CONNECT\",\"OPTIONS\",\"TRACE\",\"*\"\n  };\n  return std::string(fdp.PickValueInArray(kMethods));\n}\n\n// Helper to randomly choose http versions\nstatic std::string pick_http_version(FuzzedDataProvider& fdp) {\n  // Common + a chance to be malformed to trigger version errors.\n  switch (fdp.ConsumeIntegralInRange<int>(0, 5)) {\n    case 0: return \"HTTP/1.1\";\n    case 1: return \"HTTP/1.0\";\n    case 2: return \"HTTP/2.0\";\n    case 3: return \"HTTP/0.9\";\n    case 4: return \"HTTX/1.1\";\n    default: {\n      std::string s = \"HTTP/\";\n      s.push_back(char('0' + fdp.ConsumeIntegralInRange<int>(0,9)));\n      s.push_back('.');\n      s.push_back(char('0' + fdp.ConsumeIntegralInRange<int>(0,9)));\n      return s;\n    }\n  }\n}\n\n// Helper to check and expand buffer capcaity\nbool ensure_lbuf_capacity(MHD_Connection& c, size_t min_needed) {\n  if (!c.daemon) {\n    return false;\n  }\n\n  if (c.rq.cntn.lbuf.data && c.rq.cntn.lbuf.size >= min_needed) {\n    return true;\n  }\n  size_t have = c.rq.cntn.lbuf.size;\n  size_t need = (min_needed > have) ? (min_needed - have) : 0;\n  if (need) {\n    mhd_daemon_extend_lbuf_up_to(c.daemon, need, &c.rq.cntn.lbuf);\n  }\n  return (c.rq.cntn.lbuf.data != nullptr) && (c.rq.cntn.lbuf.size >= min_needed);\n}\n\n// Dummy upload actions\nconst struct MHD_UploadAction kContinueAction = {\n  mhd_UPLOAD_ACTION_CONTINUE, { nullptr }\n};\nconst struct MHD_UploadAction kSuspend = {\n  mhd_UPLOAD_ACTION_SUSPEND, { nullptr }\n};\nconst struct MHD_UploadAction kAbort = {\n  mhd_UPLOAD_ACTION_ABORT, { nullptr }\n};\n\n// Dummy reader function\nconst struct MHD_UploadAction *\ndummy_reader(struct MHD_Request*, void*, const struct MHD_String*,\n             const struct MHD_StringNullable*, const struct MHD_StringNullable*,\n             const struct MHD_StringNullable*, size_t, const void*,\n             uint_fast64_t, enum MHD_Bool) {\n  return &kContinueAction;\n}\n\n// Dummy connection request ending function\nconst struct MHD_UploadAction *\ndummy_done(struct MHD_Request*, void*, enum MHD_PostParseResult) {\n  return &kContinueAction;\n}\n\n// Dummy request callback function\nstatic const struct MHD_Action*\ndummy_request_cb(void* cls,\n                 struct MHD_Request* request,\n                 const struct MHD_String* path,\n                 enum MHD_HTTP_Method method,\n                 uint_fast64_t upload_size) {\n  return nullptr;\n}\n\nvoid init_daemon_connection(FuzzedDataProvider& fdp,\n                                   MHD_Daemon& d, MHD_Connection& c) {\n  // Basic initialisation\n  d = {};\n  c = {};\n  c.daemon = &d;\n  c.pool = g_pool;\n\n  // Configure daemon memory pool\n  d.conns.cfg.mem_pool_size = g_pool_size;\n  d.conns.cfg.mem_pool_zeroing = MHD_MEMPOOL_ZEROING_ON_RESET;\n\n  // Confiugre daemon request\n  d.req_cfg.large_buf.space_left = fdp.ConsumeIntegralInRange<size_t>(256, 65536);\n  d.req_cfg.strictness = static_cast<enum MHD_ProtocolStrictLevel>(\n      fdp.ConsumeIntegralInRange<int>(0, 2));\n\n  // Safe guard for buffer space\n  if (fdp.ConsumeBool()) {\n    const size_t clamp = fdp.ConsumeIntegralInRange<size_t>(64, 512);\n    if (d.req_cfg.large_buf.space_left > clamp)\n      d.req_cfg.large_buf.space_left = clamp;\n  }\n\n  // Configure connection request and general settings\n  c.discard_request = false;\n  c.suspended = false;\n  c.timeout.milsec = fdp.ConsumeIntegralInRange<uint32_t>(0, 4096);\n  c.timeout.last_act = 0;\n\n  // Add dummy callback function\n  d.req_cfg.cb = dummy_request_cb;\n  d.req_cfg.cb_cls = nullptr;\n}\n\nvoid init_connection_buffer(FuzzedDataProvider& fdp, MHD_Connection& c) {\n  // Prepare connection buffer in memory pool\n  size_t required = 0;\n  const size_t capacity = fdp.ConsumeIntegralInRange<size_t>(512, 16384);\n  char* buf = static_cast<char*>(mhd_pool_try_alloc(c.pool, capacity, &required));\n  if (!buf) {\n    c.read_buffer = nullptr;\n    c.read_buffer_size = 0;\n    c.read_buffer_offset = 0;\n    return;\n  }\n\n  // Randomly choose configuration\n  std::string hdrs;\n  const std::string method = pick_method(fdp);\n  const std::string version = pick_http_version(fdp);\n  const std::string target  = (method == \"*\") ? \"*\" : (fdp.ConsumeBool() ? \"/upload\" : \"/x?y=z\");\n\n  // Randomly break line endings in request line\n  const bool bare_lf = fdp.ConsumeBool();\n  const bool bare_cr = (!bare_lf) && fdp.ConsumeBool();\n  auto EOL = [&](bool final=false) {\n    if (bare_lf) {\n      return std::string(\"\\n\");\n    }\n    if (bare_cr) {\n      return std::string(\"\\r\");\n    }\n\n    return std::string(\"\\r\\n\");\n  };\n  std::string req = method + \" \" + target + \" \" + version + EOL();\n\n  // Host headers\n  int host_count = 0;\n  if (version == \"HTTP/1.1\") {\n    host_count = fdp.ConsumeIntegralInRange<int>(0,2);\n   } else {\n    host_count = fdp.ConsumeIntegralInRange<int>(0,1);\n   }\n\n  for (int i = 0; i < host_count; ++i) {\n    if (fdp.ConsumeBool()) {\n      hdrs += \" Host: fuzz\" + std::to_string(i) + EOL();\n    } else if (fdp.ConsumeBool()) {\n      hdrs += \"Host : fuzz\" + std::to_string(i) + EOL();\n    } else {\n      hdrs += \"Host: fuzz\" + std::to_string(i) + EOL();\n    }\n  }\n\n  // Transfer-Encoding and Content-Length headers\n  const bool add_te = fdp.ConsumeBool();\n  const bool add_cl = fdp.ConsumeBool();\n  std::string te_val = fdp.PickValueInArray({\"chunked\",\"gzip\",\"br\",\"compress\"});\n  if (add_te) {\n    hdrs += \"Transfer-Encoding: \" + te_val + EOL();\n  }\n  if (add_cl) {\n    std::string cl;\n    switch (fdp.ConsumeIntegralInRange<int>(0,3)) {\n      case 0: cl = \"0\"; break;\n      case 1: cl = std::to_string(fdp.ConsumeIntegralInRange<uint32_t>(0, 1<<20));\n              break;\n      case 2: cl = \"18446744073709551616\"; break;\n      default: cl = \"xyz\"; break;\n    }\n    hdrs += \"Content-Length: \" + cl + EOL();\n  }\n\n  // Random minimum headers\n  if (fdp.ConsumeBool()) {\n    hdrs += (fdp.ConsumeBool() ? \"Expect: 100-continue\" : \"Expect: something-weird\") + EOL();\n  }\n\n  bool detect_mpart = false;\n  switch (c.rq.app_act.head_act.data.post_parse.enc) {\n    case MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA:\n      g_mpart_boundary = \"fuzz\" + std::to_string(fdp.ConsumeIntegral<uint32_t>());\n      hdrs += \"Content-Type: multipart/form-data; boundary=\" + g_mpart_boundary + EOL();\n      break;\n    case MHD_HTTP_POST_ENCODING_FORM_URLENCODED:\n      hdrs += \"Content-Type: application/x-www-form-urlencoded\" + EOL();\n      break;\n    case MHD_HTTP_POST_ENCODING_TEXT_PLAIN:\n      hdrs += \"Content-Type: text/plain\" + EOL();\n      break;\n    default: case MHD_HTTP_POST_ENCODING_OTHER:\n      detect_mpart = fdp.ConsumeBool();\n      if (detect_mpart) {\n        g_mpart_boundary = \"fuzz\" + std::to_string(fdp.ConsumeIntegral<uint32_t>());\n        hdrs += \"Content-Type: multipart/form-data; boundary=\" + g_mpart_boundary + EOL();\n      } else {\n        hdrs += std::string(\"Content-Type: \")\n             + (fdp.ConsumeBool() ? \"application/x-www-form-urlencoded\" : \"text/plain\") + EOL();\n      }\n      break;\n  }\n\n  // Randomly add some chunked headers\n  const bool add_te_chunked = fdp.ConsumeBool();\n  if (add_te_chunked) {\n    hdrs += \"Transfer-Encoding: chunked\" + EOL();\n  }\n  if (fdp.ConsumeBool()) {\n    const uint32_t cl = fdp.ConsumeIntegralInRange<uint32_t>(0, 256);\n    hdrs += \"Content-Length: \" + std::to_string(cl) + EOL();\n  }\n  if (add_te_chunked && fdp.ConsumeBool()) {\n    if (fdp.ConsumeBool())\n      hdrs += \"Trailer: X-Fuzz-Trace\" + EOL();\n    else\n      hdrs += \"Trailer: X-One, X-Two\" + EOL();\n  }\n  if (fdp.ConsumeBool()) {\n    hdrs += (fdp.ConsumeBool() ? \"Expect: 100-continue\" : \"Expect: something-weird\") + EOL();\n  }\n\n  // Connection ending line\n  hdrs += \"Connection: close\" + EOL();\n  std::string end = EOL() + EOL();\n\n  // Write into the read buffer\n  std::string full = req + hdrs + end;\n  const size_t n = (full.size() <= capacity) ? full.size() : capacity;\n  memcpy(buf, full.data(), n);\n\n  c.read_buffer = buf;\n  c.read_buffer_size = capacity;\n  c.read_buffer_offset = n;\n}\n\nvoid init_parsing_configuration(FuzzedDataProvider& fdp, MHD_Connection& c) {\n  MHD_HTTP_PostEncoding enc;\n\n  // Configure connection encoding abd methods\n  if (fdp.ConsumeBool()) {\n    c.rq.app_act.head_act.act = mhd_ACTION_POST_PARSE;\n  } else {\n    c.rq.app_act.head_act.act = mhd_ACTION_NO_ACTION;\n  }\n  if (fdp.ConsumeBool()) {\n    enc = MHD_HTTP_POST_ENCODING_TEXT_PLAIN;\n  } else if (fdp.ConsumeBool()) {\n    enc = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;\n  } else if (fdp.ConsumeBool()) {\n    enc = MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA;\n  } else {\n    enc = MHD_HTTP_POST_ENCODING_OTHER;\n  }\n\n  c.rq.app_act.head_act.data.post_parse.buffer_size =\n    fdp.ConsumeIntegralInRange<size_t>(1, 4096);\n  c.rq.app_act.head_act.data.post_parse.max_nonstream_size =\n    fdp.ConsumeIntegralInRange<size_t>(1, 4096);\n\n  // Confiugre head action for connection post parsing process\n  c.rq.app_act.head_act.data.post_parse.enc = enc;\n  c.rq.app_act.head_act.data.post_parse.stream_reader = dummy_reader;\n  c.rq.app_act.head_act.data.post_parse.reader_cls = nullptr;\n  c.rq.app_act.head_act.data.post_parse.done_cb = dummy_done;\n  c.rq.app_act.head_act.data.post_parse.done_cb_cls = nullptr;\n}\n\nvoid prepare_headers_and_parse(MHD_Connection& connection, size_t size) {\n  // Manually add a parameter for parsing\n  auto add_hdr = [&](const char* name_c, const std::string& val_s) {\n    const size_t nlen = strlen(name_c);\n    const size_t vlen = val_s.size();\n    char* nbuf = static_cast<char*>(mhd_stream_alloc_memory(&connection, nlen + 1));\n    char* vbuf = static_cast<char*>(mhd_stream_alloc_memory(&connection, vlen + 1));\n    if (!nbuf || !vbuf) {\n      return;\n    }\n    memcpy(nbuf, name_c, nlen); nbuf[nlen] = '\\0';\n    memcpy(vbuf, val_s.data(), vlen); vbuf[vlen] = '\\0';\n    struct MHD_String name;\n    name.len  = nlen;\n    name.cstr = nbuf;\n    struct MHD_String value;\n    value.len  = vlen;\n    value.cstr = vbuf;\n    mhd_stream_add_field(&connection.h1_stream, MHD_VK_HEADER, &name, &value);\n  };\n  add_hdr(\"Host\", \"fuzz\");\n  if ((size & 3u) == 0u) {\n    add_hdr(\"Transfer-Encoding\", \"chunked\");\n  }\n  if ((size & 7u) == 0u) {\n    add_hdr(\"Content-Length\", \"0\");\n  }\n\n  bool force_mpart = (connection.rq.app_act.head_act.data.post_parse.enc\n                        == MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA);\n  if (!force_mpart) {\n    force_mpart = ((size & 0x3Fu) == 0u);\n  }\n  if (force_mpart) {\n    if (g_mpart_boundary.empty()) {\n      g_mpart_boundary = \"fuzz\" + std::to_string(size ^ 0x9e3779b97f4a7c15ULL);\n    }\n    std::string ct = \"multipart/form-data; boundary=\" + g_mpart_boundary;\n    add_hdr(\"Content-Type\", ct);\n  }\n\n  // If we wrote a real HTTP header for multipart, parse it so Content-Type is visible\n  connection.stage = mhd_HTTP_STAGE_INIT;\n  bool got_line = mhd_stream_get_request_line(&connection);\n  if (destroy_error_response(connection)) {\n    return;\n  }\n  if (got_line && connection.stage == mhd_HTTP_STAGE_REQ_LINE_RECEIVED) {\n    mhd_stream_switch_to_rq_headers_proc(&connection);\n  }\n  mhd_stream_parse_request_headers(&connection);\n\n  // Only proceed to post-parse if header parsing did not bail out\n  destroy_error_response(connection);\n}\n\nvoid prepare_body_and_process(MHD_Connection& connection, std::string& body, size_t body_size, bool use_stream_body) {\n  // Use streaming if boundary is not empty\n  if (!g_mpart_boundary.empty()) {\n    std::string wrapped;\n    wrapped.reserve(body.size() + g_mpart_boundary.size() * 2 + 128);\n    wrapped += \"\\r\\n--\"; wrapped += g_mpart_boundary; wrapped += \"\\r\\n\";\n    wrapped += \"Content-Disposition: form-data; name=\\\"x\\\"; filename=\\\"f\\\"\\r\\n\";\n    wrapped += \"Content-Type: application/octet-stream\\r\\n\\r\\n\";\n    wrapped += body; wrapped += \"\\r\\n\";\n    wrapped += \"--\"; wrapped += g_mpart_boundary; wrapped += \"--\\r\\n\";\n    body.swap(wrapped);\n    body_size = body.size();\n  }\n\n  if (!use_stream_body) {\n    // Fuzz mhd_stream_prepare_for_post_parse once and mhd_stream_post_parse\n    mhd_stream_prepare_for_post_parse(&connection);\n    mhd_stream_post_parse(&connection, &body_size, &body[0]);\n    mark_post_parse_ready(connection);\n  } else {\n    // Try prepare the body by streaming connection buffer\n    const bool want_chunked = (connection.rq.have_chunked_upload == MHD_YES);\n\n    std::string to_feed;\n    if (want_chunked) {\n      auto append_chunk = [&](const char* data, size_t len) {\n        char hex[32];\n        const int n = snprintf(hex, sizeof(hex), \"%zx\", len);\n        to_feed.append(hex, (size_t)n);\n        if ((len & 3u) == 0u) {\n          to_feed += \";ext=1\";\n        }\n        to_feed += \"\\r\\n\";\n        to_feed.append(data, len);\n        to_feed += \"\\r\\n\";\n      };\n      if (body_size <= 32) {\n        append_chunk(body.data(), body_size);\n      } else {\n        const size_t mid = body_size / 2;\n        append_chunk(body.data(), mid);\n        append_chunk(body.data() + mid, body_size - mid);\n      }\n      to_feed += \"0\\r\\n\";\n      if (body_size & 1) {\n        to_feed += \"X-Fuzz-Trace: 1\\r\\n\\r\\n\";\n      } else {\n        to_feed += \"\\r\\n\";\n      }\n    } else {\n      // Non-chunked body is handled as is\n      to_feed.assign(body.data(), body_size);\n    }\n\n    // Stage into the connection read buffer (allocate if needed).\n    size_t feed_sz = to_feed.size();\n    bool staged = false;\n    if (connection.read_buffer && connection.read_buffer_size >= feed_sz) {\n      memcpy(connection.read_buffer, to_feed.data(), feed_sz);\n      connection.read_buffer_offset = feed_sz;\n      staged = true;\n    } else {\n      size_t need = 0;\n      char *nb = (char*) mhd_pool_try_alloc(connection.pool, feed_sz, &need);\n      if (nb) {\n        memcpy(nb, to_feed.data(), feed_sz);\n        connection.read_buffer = nb;\n        connection.read_buffer_size = feed_sz;\n        connection.read_buffer_offset = feed_sz;\n        staged = true;\n      }\n    }\n\n    if (staged) {\n      // Use stream body approach if success\n      const size_t min_needed = body_size + 1;\n      if (ensure_lbuf_capacity(connection, min_needed)) {\n        // Only post parse the request if buffer is enough\n        connection.stage = mhd_HTTP_STAGE_BODY_RECEIVING;\n        connection.rq.have_chunked_upload = MHD_NO;\n        connection.rq.cntn.cntn_size = (uint64_t) body_size;\n        mhd_stream_prepare_for_post_parse(&connection);\n        mhd_stream_process_request_body(&connection);\n        mark_post_parse_ready(connection);\n      } else {\n        // Fall back if not enough buffer\n        size_t tmp = body_size;\n        mhd_stream_prepare_for_post_parse(&connection);\n        mhd_stream_post_parse(&connection, &tmp, body.data());\n        mark_post_parse_ready(connection);\n      }\n    } else {\n      // Use post prase approach if stream body failed\n      mhd_stream_prepare_for_post_parse(&connection);\n      mhd_stream_post_parse(&connection, &body_size, &body[0]);\n      mark_post_parse_ready(connection);\n    }\n  }\n}\n\nvoid final_cleanup(MHD_Connection& connection, MHD_Daemon& daemon) {\n  // Post process response\n  mhd_stream_switch_from_recv_to_send(&connection);\n  mhd_stream_process_req_recv_finished(&connection);\n  mhd_stream_release_write_buffer(&connection);\n\n  // Release buffers in daemon to avoid memory leakage\n  if (connection.rq.cntn.lbuf.data != nullptr || connection.rq.cntn.lbuf.size != 0) {\n    mhd_daemon_free_lbuf(&daemon, &connection.rq.cntn.lbuf);\n  }\n\n  // Clean post parse body status\n  clear_post_parse_ready(connection);\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/connection_helper.h",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n\n#include \"mhd_sys_options.h\"\n#include \"microhttpd2.h\"\n#include \"mhd_connection.h\"\n#include \"mhd_daemon.h\"\n#include \"mhd_post_parser.h\"\n#include \"request_funcs.h\"\n\n\nextern struct mhd_MemoryPool *g_pool;\nextern const size_t g_pool_size;\nextern std::string g_mpart_boundary;\n\nvoid destroy_global_pool();\nextern const struct MHD_UploadAction kContinueAction;\nextern const struct MHD_UploadAction kSuspend;\nextern const struct MHD_UploadAction kAbort;\n\nconst struct MHD_UploadAction * dummy_reader(struct MHD_Request*, void*, const struct MHD_String*,\n             const struct MHD_StringNullable*, const struct MHD_StringNullable*,\n             const struct MHD_StringNullable*, size_t, const void*,\n             uint_fast64_t, enum MHD_Bool);\nconst struct MHD_UploadAction * dummy_done(struct MHD_Request*, void*, enum MHD_PostParseResult);\n\nvoid init_daemon_connection(FuzzedDataProvider& fdp, MHD_Daemon& d, MHD_Connection& c);\nvoid init_connection_buffer(FuzzedDataProvider& fdp, MHD_Connection& c);\nvoid init_parsing_configuration(FuzzedDataProvider& fdp, MHD_Connection& c);\nvoid prepare_headers_and_parse(MHD_Connection& connection, size_t size);\nvoid prepare_body_and_process(MHD_Connection& connection, std::string& body, size_t body_size, bool use_stream_body);\nvoid final_cleanup(MHD_Connection& connection, MHD_Daemon& daemon);\n\nvoid mark_post_parse_ready(MHD_Connection& connection);\nbool is_post_parse_ready(const MHD_Connection& connection);\nvoid clear_post_parse_ready(const MHD_Connection& connection);\n"
  },
  {
    "path": "projects/libmicrohttpd2/default.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_connection.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stdint.h>\n#include <stddef.h>\n#include <string>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"connection_helper.h\"\n#include \"conn_timeout.h\"\n\n#include \"daemon_funcs.h\"\n#include \"mempool_funcs.h\"\n#include \"post_parser_funcs.h\"\n#include \"stream_funcs.h\"\n#include \"stream_process_request.h\"\n\n\n// Helper to fuzz mhd_stream_process_post_finish\nstatic void fuzz_mhd_stream_process_post_finish(MHD_Connection& connection, MHD_Daemon& daemon, const std::string& body) {\n  struct mhd_PostParserData *p = &connection.rq.u_proc.post;\n  size_t pos  = p->next_parse_pos;\n  size_t need = ((p->lbuf_used > pos) ? p->lbuf_used : pos) + 1; // +1 for NUL\n  if (connection.rq.cntn.lbuf.size < need) {\n    size_t delta = need - connection.rq.cntn.lbuf.size;\n    if (delta != 0)\n      mhd_daemon_extend_lbuf_up_to(&daemon, delta, &connection.rq.cntn.lbuf);\n  }\n\n  if (connection.rq.cntn.lbuf.data == nullptr && !body.empty()) {\n    size_t to_copy = (body.size() < (size_t)p->lbuf_limit) ? body.size() : (size_t)p->lbuf_limit;\n    size_t min_needed = to_copy + 1; // 1 byte for \\0 terminator\n    if (connection.rq.cntn.lbuf.size < min_needed) {\n      size_t delta = min_needed - connection.rq.cntn.lbuf.size;\n      if (delta != 0)\n        mhd_daemon_extend_lbuf_up_to(&daemon, delta, &connection.rq.cntn.lbuf);\n    }\n    if (connection.rq.cntn.lbuf.data != nullptr) {\n      memcpy(connection.rq.cntn.lbuf.data, body.data(), to_copy);\n      p->lbuf_used = to_copy;\n    }\n  }\n\n  // Fail back to Text encoding\n  if (p->enc == MHD_HTTP_POST_ENCODING_OTHER) {\n    p->enc = MHD_HTTP_POST_ENCODING_TEXT_PLAIN;\n  }\n  mhd_stream_prepare_for_post_parse(&connection);\n  mhd_stream_process_post_finish(&connection);\n\n  bool can_finish = (connection.rq.cntn.lbuf.data != nullptr);\n  if (can_finish && connection.rq.u_proc.post.enc == MHD_HTTP_POST_ENCODING_FORM_URLENCODED) {\n    size_t pos = connection.rq.u_proc.post.next_parse_pos;\n    if (pos >= connection.rq.cntn.lbuf.size) {\n      mhd_daemon_extend_lbuf_up_to(&daemon, 1, &connection.rq.cntn.lbuf);\n      if (pos >= connection.rq.cntn.lbuf.size)\n        can_finish = false;\n    }\n  }\n\n  if (can_finish) {\n    if (connection.rq.u_proc.post.enc == MHD_HTTP_POST_ENCODING_OTHER) {\n      if (connection.rq.app_act.head_act.data.post_parse.enc == MHD_HTTP_POST_ENCODING_OTHER)\n        connection.rq.app_act.head_act.data.post_parse.enc = MHD_HTTP_POST_ENCODING_TEXT_PLAIN;\n      mhd_stream_prepare_for_post_parse(&connection);\n    }\n    mhd_stream_process_post_finish(&connection);\n  }\n}\n\n\n// Initialising the memory pool\nextern \"C\" int LLVMFuzzerInitialize() {\n  g_pool = mhd_pool_create(g_pool_size, MHD_MEMPOOL_ZEROING_ON_RESET);\n  atexit(destroy_global_pool);\n  return 0;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size == 0 || g_pool == nullptr) {\n    return 0;\n  }\n\n  FuzzedDataProvider fdp(data, size);\n\n  // Reseting the memory pool for each iteartion\n  mhd_pool_destroy(g_pool);\n  g_pool = mhd_pool_create(g_pool_size, MHD_MEMPOOL_ZEROING_ON_RESET);\n\n  // Initialising the daemon, connection and other MHD components\n  MHD_Daemon daemon;\n  MHD_Connection connection;\n  init_daemon_connection(fdp, daemon, connection);\n  init_parsing_configuration(fdp, connection);\n  init_connection_buffer(fdp, connection);\n  prepare_headers_and_parse(connection, size);\n\n  // Randomly choose how many targets to fuzz\n  std::vector<int> selectors;\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<int>(1, 8); i++) {\n    selectors.push_back(fdp.ConsumeIntegralInRange<int>(0, 9));\n  }\n\n  // Generate random body and stream it in the connection\n  bool use_stream_body = fdp.ConsumeBool();\n\n  // Use remaining bytes to generate random body for fuzzing\n  std::string body = fdp.ConsumeRemainingBytesAsString();\n  size_t body_size = body.size();\n  if (body_size == 0) {\n    return 0;\n  }\n  prepare_body_and_process(connection, body, body_size, use_stream_body);\n\n  // Fuzz random round of target functions\n  for (int selector : selectors) {\n    switch (selector) {\n      case 0: {\n        mhd_conn_is_timeout_expired(&connection);\n        break;\n      }\n      case 1: {\n        mhd_stream_switch_to_rq_headers_proc(&connection);\n        break;\n      }\n      case 2: {\n        const struct MHD_UploadAction* act = &kContinueAction;\n        mhd_stream_process_upload_action(&connection, &kContinueAction, false);\n        mhd_stream_process_upload_action(&connection, &kSuspend, false);\n        mhd_stream_process_upload_action(&connection, &kAbort, true);\n        break;\n      }\n      case 3: {\n        connection.stage = mhd_HTTP_STAGE_REQ_RECV_FINISHED;\n        mhd_stream_process_req_recv_finished(&connection);\n        break;\n      }\n      case 4: {\n        mhd_stream_reset_rq_hdr_proc_state(&connection);\n        break;\n      }\n      case 5: {\n        mhd_stream_alloc_memory(&connection, 1024);\n        break;\n      }\n      case 6: {\n        // Safe guard for out of buffer space\n        if (connection.write_buffer_send_offset > connection.write_buffer_append_offset) {\n          connection.write_buffer_send_offset = connection.write_buffer_append_offset;\n        }\n        mhd_stream_maximize_write_buffer(&connection);\n        break;\n      }\n      case 7: {\n        // Safe guard for out of buffer space\n        connection.write_buffer_send_offset = connection.write_buffer_append_offset;\n        mhd_stream_release_write_buffer(&connection);\n        break;\n      }\n      case 8: {\n        // Safe guard for out of buffer read\n        if (connection.read_buffer_offset > connection.read_buffer_size) {\n          connection.read_buffer_offset = connection.read_buffer_size;\n        }\n        mhd_stream_shrink_read_buffer(&connection);\n        break;\n      }\n      case 9: {\n        mhd_stream_switch_from_recv_to_send(&connection);\n        break;\n      }\n    }\n  }\n\n  // Fuzz mhd_stream_process_post_finish\n  fuzz_mhd_stream_process_post_finish(connection, daemon, body);\n\n  // Final cleanup to avoid memory leak\n  final_cleanup(connection, daemon);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_crypto_ext.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <vector>\n#include <algorithm>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"md5_ext.h\"\n#include \"sha256_ext.h\"\n\n\n// Fuzzing target function pointer types for the enternal hash APIs\ntemplate <typename HashType> using InitOnceFn = void (*)(HashType*);\ntemplate <typename HashType> using UpdateFn   = void (*)(HashType*, size_t, const uint8_t*);\ntemplate <typename HashType> using FinishFn   = void (*)(HashType*, uint8_t*);\ntemplate <typename HashType> using DeinitFn   = void (*)(HashType*);\n\n// Generic hashing flow that fuzz same hashing procedure for different algorithm\ntemplate <typename HashType>\nstatic void fuzz_hash_ext_multi(FuzzedDataProvider &fdp,\n                                size_t block_size,\n                                InitOnceFn<HashType> init_once,\n                                UpdateFn<HashType> update_fn,\n                                FinishFn<HashType> finish_fn,\n                                DeinitFn<HashType> deinit_fn,\n                                size_t digest_size) {\n  if (!fdp.remaining_bytes()) {\n    return;\n  }\n\n  // Pull a random slice of data for fuzzing\n  size_t take_len = fdp.ConsumeIntegralInRange<size_t>(0, fdp.remaining_bytes());\n  std::vector<uint8_t> input_bytes = fdp.ConsumeBytes<uint8_t>(take_len);\n\n  // Create 1 to 4 independent hashing contexts with it own digest buffer\n  const unsigned num_contexts = fdp.ConsumeIntegralInRange<unsigned>(1, 4);\n  std::vector<HashType> contexts(num_contexts);\n  std::vector<std::vector<uint8_t>> digests(num_contexts, std::vector<uint8_t>(digest_size));\n  for (unsigned i = 0; i < num_contexts; i++) {\n    init_once(&contexts[i]);\n  }\n\n  // Intentionally misalign the data pointer to stress alignment sensitive paths\n  const size_t misalign_pad = fdp.ConsumeIntegralInRange<size_t>(0, 64);\n  std::vector<uint8_t> scratch_buf(misalign_pad + input_bytes.size());\n  if (!input_bytes.empty()) {\n    memcpy(scratch_buf.data() + misalign_pad, input_bytes.data(), input_bytes.size());\n  }\n\n  // Define cursor and remaining bytes counter to keep track of the multiple hash update iterations\n  const uint8_t *cursor = scratch_buf.data() + misalign_pad;\n  size_t remaining = input_bytes.size();\n\n  // Perform multiple hash update iterations on the raw data\n  unsigned num_iterations = fdp.ConsumeIntegralInRange<unsigned>(1, 4);\n  while (num_iterations-- && remaining > 0) {\n    // Pick which context to feed this iteration\n    const unsigned ctx_index = (num_contexts == 1) ? 0 : fdp.ConsumeIntegralInRange<unsigned>(0, num_contexts - 1);\n\n    // Choose a chunking pattern relative to block size.\n    enum Pattern { LESS1, EQ, PLUS1, SMALL, RANDOM, TAIL, HALT };\n    Pattern pattern = fdp.PickValueInArray<Pattern>({LESS1, EQ, PLUS1, SMALL, RANDOM, TAIL, HALT});\n\n    size_t chunk_len = 0;\n    switch (pattern) {\n      case LESS1: {\n        // Consume 1 byte less from block size from the raw data for this iteration\n        if (block_size > 1) {\n          chunk_len = std::min(remaining, block_size - 1);\n        }\n        break;\n      }\n      case EQ: {\n        // Consume block size bytes from the raw data for this iteration\n        chunk_len = std::min(remaining, block_size);\n        break;\n      }\n      case PLUS1: {\n        // Consume 1 byte more from block size from the raw data for this iteration\n        chunk_len = std::min(remaining, block_size + 1);\n        break;\n      }\n      case SMALL: {\n        // Consume 1~32 bytes from the raw data for this iteration\n        size_t small_len = (size_t)fdp.ConsumeIntegralInRange<int>(1, 32);\n        chunk_len = std::min(remaining, small_len);\n        break;\n      }\n      case RANDOM: {\n        // Consume random bytes from the raw data for this iteration\n        chunk_len = (remaining >= 1) ? (size_t)fdp.ConsumeIntegralInRange<size_t>(1, remaining) : 0;\n        break;\n      }\n      case TAIL: {\n        // Consume all remaining bytes from the raw data for this iteration\n        chunk_len = remaining;\n        break;\n      }\n      case HALT: {\n        // Consume small chunk and consider reinitialisation or early halt of the hash iteration\n        size_t step  = std::max<size_t>(1, fdp.ConsumeIntegralInRange<size_t>(1, block_size));\n        size_t loops = fdp.ConsumeIntegralInRange<size_t>(1, 4);\n        for (size_t j = 0; j < loops && remaining > 0; j++) {\n          size_t w = std::min(remaining, step);\n          update_fn(&contexts[ctx_index], w, cursor);\n          cursor += w;\n          remaining -= w;\n        }\n\n        // Randomly reinitialise the hash stream\n        if (fdp.ConsumeBool()) {\n          finish_fn(&contexts[ctx_index], digests[ctx_index].data());\n        }\n        continue;\n      }\n    }\n\n    if (chunk_len == 0 || chunk_len > remaining) {\n      continue;\n    }\n\n    // Fuzz the update function\n    update_fn(&contexts[ctx_index], chunk_len, cursor);\n    cursor += chunk_len;\n    remaining -= chunk_len;\n  }\n\n  // Finalize all active contexts (finish_reset).\n  for (unsigned i = 0; i < num_contexts; i++) {\n    finish_fn(&contexts[i], digests[i].data());\n  }\n\n  // Additional fuzzing on special context chaining approach.\n  if (num_contexts >= 2 && digest_size && fdp.ConsumeBool()) {\n    unsigned src_idx = fdp.ConsumeIntegralInRange<unsigned>(0, num_contexts - 1);\n    unsigned dst_idx = fdp.ConsumeIntegralInRange<unsigned>(0, num_contexts - 1);\n    if (src_idx != dst_idx) {\n      size_t offset = fdp.ConsumeIntegralInRange<size_t>(0, digest_size - 1);\n      size_t max_avail = digest_size - offset; // >= 1\n      size_t feed_len = fdp.ConsumeIntegralInRange<size_t>(1, max_avail);\n      update_fn(&contexts[dst_idx], feed_len, digests[src_idx].data() + offset);\n      finish_fn(&contexts[dst_idx], digests[dst_idx].data());\n    }\n  }\n\n  // Deinitialise all contexts after this iteration\n  for (unsigned i = 0; i < num_contexts; i++) {\n    deinit_fn(&contexts[i]);\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  for (unsigned i = 0; i < fdp.ConsumeIntegralInRange<unsigned>(1, 4); i++) {\n    if (fdp.ConsumeBool()) {\n      fuzz_hash_ext_multi<struct mhd_Md5CtxExt>(\n        fdp, 64,\n        mhd_MD5_init_one_time, mhd_MD5_update, mhd_MD5_finish_reset, mhd_MD5_deinit,\n        mhd_MD5_DIGEST_SIZE);\n    } else {\n      fuzz_hash_ext_multi<struct mhd_Sha256CtxExt>(\n        fdp, 64,\n        mhd_SHA256_init_one_time, mhd_SHA256_update, mhd_SHA256_finish_reset, mhd_SHA256_deinit,\n        mhd_SHA256_DIGEST_SIZE);\n    }\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_crypto_int.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <vector>\n#include <algorithm>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"md5_int.h\"\n#include \"sha256_int.h\"\n#include \"sha512_256_int.h\"\n\n\n// Fuzzing target function pointer types for the internal hash APIs\ntemplate <typename HashType> using InitFn   = void (*)(HashType*);\ntemplate <typename HashType> using UpdateFn = void (*)(HashType*, size_t, const uint8_t*);\ntemplate <typename HashType> using FinishFn = void (*)(HashType*, uint8_t*);\n\n// Generic hashing flow that fuzz same hashing procedure for different algorithm\ntemplate <typename HashType>\nstatic void fuzz_hash_int_multi(FuzzedDataProvider &fdp,\n                                size_t block_size,\n                                InitFn<HashType> init_fn,\n                                UpdateFn<HashType> update_fn,\n                                FinishFn<HashType> finish_fn,\n                                size_t digest_size) {\n  if (!fdp.remaining_bytes()) {\n    return;\n  }\n\n  // Pull a random slice of data for fuzzing\n  size_t take_len = fdp.ConsumeIntegralInRange<size_t>(0, fdp.remaining_bytes());\n  std::vector<uint8_t> input_bytes = fdp.ConsumeBytes<uint8_t>(take_len);\n\n  // Create 1 to 4 independent hashing contexts with it own digest buffer\n  const unsigned num_contexts = fdp.ConsumeIntegralInRange<unsigned>(1, 4);\n  std::vector<HashType> contexts(num_contexts);\n  std::vector<std::vector<uint8_t>> digests(num_contexts, std::vector<uint8_t>(digest_size));\n  for (unsigned i = 0; i < num_contexts; i++) {\n    init_fn(&contexts[i]);\n  }\n\n  // Intentionally misalign the data pointer to stress alignment sensitive paths\n  const size_t misalign_pad = fdp.ConsumeIntegralInRange<size_t>(0, 64);\n  std::vector<uint8_t> scratch_buf(misalign_pad + input_bytes.size());\n  if (!input_bytes.empty()) {\n    memcpy(scratch_buf.data() + misalign_pad, input_bytes.data(), input_bytes.size());\n  }\n\n  // Define cursor and remaining bytes counter to keep track of the multiple hash update iterations\n  const uint8_t *cursor = scratch_buf.data() + misalign_pad;\n  size_t remaining = input_bytes.size();\n\n  // Perform multiple hash update iterations on the raw data\n  unsigned num_iterations = fdp.ConsumeIntegralInRange<unsigned>(1, 4);\n  while (num_iterations-- && remaining > 0) {\n    // Pick which context to feed this iteration\n    const unsigned ctx_index = (num_contexts == 1) ? 0 : fdp.ConsumeIntegralInRange<unsigned>(0, num_contexts - 1);\n\n    // Choose a chunking pattern for this iteration\n    enum Pattern { LESS1, EQ, PLUS1, SMALL, RANDOM, TAIL, HALT };\n    Pattern pattern = fdp.PickValueInArray<Pattern>({LESS1, EQ, PLUS1, SMALL, RANDOM, TAIL, HALT});\n\n    size_t chunk_len = 0;\n    switch (pattern) {\n      case LESS1: {\n        // Consume 1 byte less from block size from the raw data for this iteration\n        if (block_size > 1) {\n          chunk_len = std::min(remaining, block_size - 1);\n        }\n        break;\n      }\n      case EQ: {\n        // Consume block size bytes from the raw data for this iteration\n        chunk_len = std::min(remaining, block_size);\n        break;\n      }\n      case PLUS1: {\n        // Consume 1 byte more from block size from the raw data for this iteration\n        chunk_len = std::min(remaining, block_size + 1);\n        break;\n      }\n      case SMALL: {\n        // Consume 1 to 32 bytes from the raw data for this iteration\n        size_t small_len = (size_t)fdp.ConsumeIntegralInRange<int>(1, 32);\n        chunk_len = std::min(remaining, small_len);\n        break;\n      }\n      case RANDOM: {\n        // Consume random bytes from the raw data for this iteration\n        chunk_len = (remaining >= 1) ? (size_t)fdp.ConsumeIntegralInRange<size_t>(1, remaining) : 0;\n        break;\n      }\n      case TAIL: {\n        // Consume all remaining bytes from the raw data for this iteration\n        chunk_len = remaining;\n        break;\n      }\n      case HALT: {\n        // Consume small chunk and consider reinitialisation or early halt of the hash iteration\n        size_t step  = std::max<size_t>(1, fdp.ConsumeIntegralInRange<size_t>(1, block_size));\n        size_t loops = fdp.ConsumeIntegralInRange<size_t>(1, 4);\n        for (size_t j = 0; j < loops && remaining > 0; j++) {\n          size_t w = std::min(remaining, step);\n          update_fn(&contexts[ctx_index], w, cursor);\n          cursor += w;\n          remaining -= w;\n        }\n\n        // Randomly reinitialise the hash stream\n        if (fdp.ConsumeBool()) {\n          finish_fn(&contexts[ctx_index], digests[ctx_index].data());\n          init_fn(&contexts[ctx_index]);\n        }\n        continue;\n      }\n    }\n    if (chunk_len == 0 || chunk_len > remaining) {\n      continue;\n    }\n\n    // Occasionally reinitialise a context between update iterations\n    if (fdp.ConsumeBool()) {\n      init_fn(&contexts[ctx_index]);\n    }\n\n    // Fuzz the update function\n    update_fn(&contexts[ctx_index], chunk_len, cursor);\n    cursor += chunk_len;\n    remaining -= chunk_len;\n\n    // Randomly halt and reinitialise the stream\n    if (fdp.ConsumeBool()) {\n      finish_fn(&contexts[ctx_index], digests[ctx_index].data());\n      init_fn(&contexts[ctx_index]);\n    }\n  }\n\n  // Fuzz the finish function for all contexts\n  for (unsigned i = 0; i < num_contexts; i++) {\n    finish_fn(&contexts[i], digests[i].data());\n  }\n\n  // Additional fuzzing on special context chaining approach\n  if (num_contexts >= 2 && digest_size && fdp.ConsumeBool()) {\n    unsigned src_idx = fdp.ConsumeIntegralInRange<unsigned>(0, num_contexts - 1);\n    unsigned dst_idx = fdp.ConsumeIntegralInRange<unsigned>(0, num_contexts - 1);\n    if (src_idx != dst_idx) {\n      init_fn(&contexts[dst_idx]);\n      size_t offset = fdp.ConsumeIntegralInRange<size_t>(0, digest_size - 1);\n      size_t feed_len = std::min(digest_size - offset,\n                                 (size_t)fdp.ConsumeIntegralInRange<size_t>(1, digest_size));\n      update_fn(&contexts[dst_idx], feed_len, digests[src_idx].data() + offset);\n      finish_fn(&contexts[dst_idx], digests[dst_idx].data());\n    }\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<unsigned>(1, 4); i++) {\n    switch (fdp.ConsumeIntegralInRange<int>(0, 2)) {\n      case 0:\n        fuzz_hash_int_multi<struct mhd_Md5CtxInt>(\n          fdp, mhd_MD5_BLOCK_SIZE,\n          mhd_MD5_init, mhd_MD5_update, mhd_MD5_finish, mhd_MD5_DIGEST_SIZE);\n        break;\n      case 1:\n        fuzz_hash_int_multi<struct mhd_Sha256CtxInt>(\n          fdp, mhd_SHA256_BLOCK_SIZE,\n          mhd_SHA256_init, mhd_SHA256_update, mhd_SHA256_finish, mhd_SHA256_DIGEST_SIZE);\n        break;\n      case 2:\n      default:\n        fuzz_hash_int_multi<struct mhd_Sha512_256CtxInt>(\n          fdp, mhd_SHA512_256_BLOCK_SIZE,\n          mhd_SHA512_256_init, mhd_SHA512_256_update, mhd_SHA512_256_finish, mhd_SHA512_256_DIGEST_SIZE);\n        break;\n    }\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_daemon.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include \"mhd_helper.h\"\n\nstatic constexpr uint16_t kPort = 54321;\nstatic uint16_t g_listen_port = kPort;\n\nstatic struct MHD_Daemon* g_daemon = nullptr;\nstatic std::once_flag g_start_once;\n\nstatic void start_daemon_once() {\n  if (g_daemon) {\n    return;\n  }\n\n  // Add deterministic entropy\n  unsigned char entropy[32];\n  for (size_t i = 0; i < sizeof(entropy); ++i) {\n    entropy[i] = (unsigned char)(0xA5 ^ (i * 17));\n  }\n\n  // Try start the daemon and map to a designated port\n  // Retry to next port if mapping to port fails\n  bool started = false;\n  for (int i = 0; i < 8 && !started; ++i) {\n    const uint16_t try_port = static_cast<uint16_t>(kPort + i);\n\n    if (g_fdp->ConsumeBool()) {\n      g_daemon = MHD_daemon_create(&req_cb, NULL);\n    } else if (g_fdp->ConsumeBool()) {\n      g_daemon = MHD_daemon_create(&req_cb_stream, NULL);\n    } else {\n      g_daemon = MHD_daemon_create(&req_cb_process, NULL);\n    }\n    if (!g_daemon) {\n      continue;\n    }\n\n    // Configure daemon starting options\n    auto sc = MHD_DAEMON_SET_OPTIONS(\n                g_daemon,\n                MHD_D_OPTION_BIND_PORT(MHD_AF_INET4, try_port),\n                MHD_D_OPTION_RANDOM_ENTROPY(sizeof(entropy), entropy)\n              );\n\n    // Safeguard if daemon starting or mapping to port fails and try on next port\n    if (sc != MHD_SC_OK) {\n      MHD_daemon_destroy(g_daemon);\n      g_daemon = nullptr;\n      continue;\n    }\n    if (MHD_daemon_start(g_daemon) != MHD_SC_OK) {\n      MHD_daemon_destroy(g_daemon);\n      g_daemon = nullptr;\n      continue;\n    }\n\n    // Store the final port used\n    g_listen_port = try_port;\n    started = true;\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  size_t reqs = 0;\n\n  // Put FuzzedDataProvider to global\n  {\n    std::lock_guard<std::mutex> lk(g_fdp_mu);\n    g_fdp = std::make_unique<FuzzedDataProvider>(data, size);\n  }\n\n  // Start daemon\n  std::call_once(g_start_once, start_daemon_once);\n  if (!g_daemon) {\n    return 0;\n  }\n\n  // Generate random number to determine number of random request to be sent\n  {\n    std::lock_guard<std::mutex> lk(g_fdp_mu);\n    if (g_fdp) {\n      reqs = 1 + g_fdp->ConsumeIntegralInRange<size_t>(0, 7);\n    }\n  }\n\n  // Send multiple random requests to daemon\n  for (size_t i = 0; i < reqs; ++i) {\n    std::string method = \"GET\", path, user, pass, body;\n    bool garble_auth = false;\n\n    // Prepare HTTP request in locked session with random data\n    {\n      std::lock_guard<std::mutex> lk(g_fdp_mu);\n      if (g_fdp) {\n        static const char* kCommon[] = {\"GET\",\"POST\",\"PUT\",\"DELETE\",\"HEAD\",\"PATCH\",\"OPTIONS\"};\n        if (g_fdp->ConsumeBool()) {\n          method = g_fdp->PickValueInArray(kCommon);\n        } else {\n          method = g_fdp->ConsumeRandomLengthString(8);\n          if (method.empty()) {\n            method = \"GET\";\n          }\n        }\n\n        path = g_fdp->ConsumeRandomLengthString(\n                 g_fdp->ConsumeIntegralInRange<size_t>(0, 64));\n        for (char &c : path) {\n          if (c == ' ') {\n            c = '_';\n          }\n        }\n\n        user = g_fdp->ConsumeRandomLengthString(16);\n        pass = g_fdp->ConsumeRandomLengthString(16);\n        garble_auth = g_fdp->ConsumeBool();\n\n        if (method == \"POST\" || g_fdp->ConsumeBool()) {\n          body = g_fdp->ConsumeRandomLengthString(2048);\n        }\n      }\n    }\n\n    // Send request\n    send_http_request_blocking(g_listen_port, method, path, user, pass, body, garble_auth);\n\n    // Early exit if failed to load more random data\n    {\n      std::lock_guard<std::mutex> lk(g_fdp_mu);\n      if (!g_fdp || g_fdp->remaining_bytes() < 8) {\n        break;\n      }\n    }\n  }\n\n  // Free FDP\n  {\n    std::lock_guard<std::mutex> lk(g_fdp_mu);\n    g_fdp.reset();\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_daemon.dict",
    "content": "\"GET\"\n\"POST\"\n\"HEAD\"\n\"Authorization:\"\n\"Basic\"\n\"Host:\"\n\"Content-Length:\"\n\"Connection:\"\n\"HTTP/1.1\"\n\"/\"\nmethod_delete=\"DELETE\"\nmethod_get=\"GET\"\nmethod_head=\"HEAD\"\nmethod_post=\"POST\"\nmethod_put=\"PUT\"\nmethod_connect=\"CONNECT\"\nmethod_options=\"OPTIONS\"\nmethod_trace=\"TRACE\"\nmethod_copy=\"COPY\"\nmethod_lock=\"LOCK\"\nmethod_mkcol=\"MKCOL\"\nmethod_move=\"MOVE\"\nmethod_propfind=\"PROPFIND\"\nmethod_proppatch=\"PROPPATCH\"\nmethod_search=\"SEARCH\"\nmethod_unlock=\"UNLOCK\"\nmethod_bind=\"BIND\"\nmethod_rebind=\"REBIND\"\nmethod_unbind=\"UNBIND\"\nmethod_acl=\"ACL\"\nmethod_report=\"REPORT\"\nmethod_mkactivity=\"MKACTIVITY\"\nmethod_checkout=\"CHECKOUT\"\nmethod_merge=\"MERGE\"\nmethod_m_search=\"M-SEARCH\"\nmethod_notify=\"NOTIFY\"\nmethod_subscribe=\"SUBSCRIBE\"\nmethod_unsubscribe=\"UNSUBSCRIBE\"\nmethod_patch=\"PATCH\"\nmethod_purge=\"PURGE\"\nmethod_mkcalendar=\"MKCALENDAR\"\nmethod_link=\"LINK\"\nmethod_unlink=\"UNLINK\"\n\nheader_req_standard_accept=\"Accept\"\nheader_req_standard_accept_charset=\"Accept-Charset\"\nheader_req_standard_accept_encoding=\"Accept-Encoding\"\nheader_req_standard_accept_language=\"Accept-Language\"\nheader_req_standard_accept_datetime=\"Accept-Datetime\"\nheader_req_standard_authorization=\"Authorization\"\nheader_req_standard_cache_control=\"Cache-Control\"\nheader_req_standard_connection=\"Connection\"\nheader_req_standard_cookie=\"Cookie\"\nheader_req_standard_content_length=\"Content-Length\"\nheader_req_standard_content_md5=\"Content-MD5\"\nheader_req_standard_content_type=\"Content-Type\"\nheader_req_standard_date=\"Date\"\nheader_req_standard_expect=\"Expect\"\nheader_req_standard_forwarded=\"Forwarded\"\nheader_req_standard_from=\"From\"\nheader_req_standard_host=\"Host\"\nheader_req_standard_if_match=\"If-Match\"\nheader_req_standard_if_modified_since=\"If-Modified-Since\"\nheader_req_standard_if_none_match=\"If-None-Match\"\nheader_req_standard_if_range=\"If-Range\"\nheader_req_standard_if_unmodified_since=\"If-Unmodified-Since\"\nheader_req_standard_max_forwards=\"Max-Forwards\"\nheader_req_standard_origin=\"Origin\"\nheader_req_standard_pragma=\"Pragma\"\nheader_req_standard_proxy_authorization=\"Proxy-Authorization\"\nheader_req_standard_range=\"Range\"\nheader_req_standard_referer=\"Referer\"\nheader_req_standard_te=\"TE\"\nheader_req_standard_user_agent=\"User-Agent\"\nheader_req_standard_upgrade=\"Upgrade\"\nheader_req_standard_via=\"Via\"\nheader_req_standard_warning=\"Warning\"\n\nheader_req_nonstandard_x_requested_with=\"X-Requested-With\"\nheader_req_nonstandard_dnt=\"DNT\"\nheader_req_nonstandard_x_forwarded_for=\"X-Forwarded-For\"\nheader_req_nonstandard_x_forwarded_host=\"X-Forwarded-Host\"\nheader_req_nonstandard_x_forwarded_proto=\"X-Forwarded-Proto\"\nheader_req_nonstandard_front_end_https=\"Front-End-Https\"\nheader_req_nonstandard_x_http_method_override =\"X-Http-Method-Override\"\nheader_req_nonstandard_x_att_deviceid=\"X-ATT-DeviceId\"\nheader_req_nonstandard_x_wap_profile=\"X-Wap-Profile\"\nheader_req_nonstandard_proxy_connection=\"Proxy-Connection\"\nheader_req_nonstandard_x_uidh=\"X-UIDH\"\nheader_req_nonstandard_x_csrf_token=\"X-Csrf-Token\"\nheader_req_nonstandard_x_request_id=\"X-Request-ID\"\nheader_req_nonstandard_x_correlation_id=\"X-Correlation-ID\"\n\nheader_res_standard_access_control_allow_origin=\"Access-Control-Allow-Origin\"\nheader_res_standard_accept_patch=\"Accept-Patch\"\nheader_res_standard_accept_ranges=\"Accept-Ranges\"\nheader_res_standard_age=\"Age\"\nheader_res_standard_allow=\"Allow\"\nheader_res_standard_alt_svc=\"Alt-Svc\"\nheader_res_standard_cache_control=\"Cache-Control\"\nheader_res_standard_connection=\"Connection\"\nheader_res_standard_content_disposition=\"Content-Disposition\"\nheader_res_standard_content_encoding=\"Content-Encoding\"\nheader_res_standard_content_language=\"Content-Language\"\nheader_res_standard_content_length=\"Content-Length\"\nheader_res_standard_content_location=\"Content-Location\"\nheader_res_standard_content_md5=\"Content-MD5\"\nheader_res_standard_content_range=\"Content-Range\"\nheader_res_standard_content_type=\"Content-Type\"\nheader_res_standard_date=\"Date\"\nheader_res_standard_etag=\"ETag\"\nheader_res_standard_expires=\"Expires\"\nheader_res_standard_last_modified=\"Last-Modified\"\nheader_res_standard_link=\"Link\"\nheader_res_standard_location=\"Location\"\nheader_res_standard_p3p=\"P3P\"\nheader_res_standard_pragma=\"Pragma\"\nheader_res_standard_proxy_authenticate=\"Proxy-Authenticate\"\nheader_res_standard_public_key_pins=\"Public-Key-Pins\"\nheader_res_standard_refresh=\"Refresh\"\nheader_res_standard_retry_after=\"Retry-After\"\nheader_res_standard_server=\"Server\"\nheader_res_standard_set_cookie=\"Set-Cookie\"\nheader_res_standard_strict_transport_security=\"Strict-Transport-Security\"\nheader_res_standard_trailer=\"Trailer\"\nheader_res_standard_transfer_encoding=\"Transfer-Encoding\"\nheader_res_standard_tk=\"Tk\"\nheader_res_standard_upgrade=\"Upgrade\"\nheader_res_standard_vary=\"Vary\"\nheader_res_standard_via=\"Via\"\nheader_res_standard_warning=\"Warning\"\nheader_res_standard_www_authenticate=\"WWW-Authenticate\"\nheader_res_standard_x_frame_options=\"X-Frame-Options\"\n\nheader_res_nonstandard_status=\"Status\"\nheader_res_nonstandard_x_xss_protection=\"X-XSS-Protection\"\nheader_res_nonstandard_content_security_policy=\"Content-Security-Policy\"\nheader_res_nonstandard_x_content_security_policy=\"X-Content-Security-Policy\"\nheader_res_nonstandard_x_webkit_csp=\"X-WebKit-CSP\"\nheader_res_nonstandard_x_content_type_options=\"X-Content-Type-Options\"\nheader_res_nonstandard_x_powered_by=\"X-Powered-By\"\nheader_res_nonstandard_x_ua_compatible=\"X-UA-Compatible\"\nheader_res_nonstandard_x_content_duration=\"X-Content-Duration\"\nheader_res_nonstandard_upgrade_insecure_requests=\"Upgrade-Insecure-Requests\"\nheader_res_nonstandard_x_request_id=\"X-Request-ID\"\nheader_res_nonstandard_x_correlation_id=\"X-Correlation-ID\"\n\ncontent_encoding_compress=\"compress\"\ncontent_encoding_deflate=\"deflate\"\ncontent_encoding_exi=\"exi\"\ncontent_encoding_gzip=\"gzip\"\ncontent_encoding_pack200_gzip=\"pack200-gzip\"\ncontent_encoding_br=\"br\"\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_daemon_connection.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stdint.h>\n#include <stddef.h>\n#include <string>\n#include <vector>\n#include <cstring>\n\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"connection_helper.h\"\n\n#include \"conn_tls_check.h\"\n#include \"mempool_funcs.h\"\n#include \"mhd_send.h\"\n#include \"stream_process_request.h\"\n#include \"stream_process_states.h\"\n\n\n// Initialising the memory pool\nextern \"C\" int LLVMFuzzerInitialize() {\n  g_pool = mhd_pool_create(g_pool_size, MHD_MEMPOOL_ZEROING_ON_RESET);\n  atexit(destroy_global_pool);\n  return 0;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size == 0 || g_pool == nullptr) {\n    return 0;\n  }\n\n  FuzzedDataProvider fdp(data, size);\n\n  // Reseting the memory pool for each iteartion\n  mhd_pool_destroy(g_pool);\n  g_pool = mhd_pool_create(g_pool_size, MHD_MEMPOOL_ZEROING_ON_RESET);\n\n  // Initialising the daemon, connection and other MHD components\n  MHD_Daemon daemon;\n  MHD_Connection connection;\n  init_daemon_connection(fdp, daemon, connection);\n  init_parsing_configuration(fdp, connection);\n  init_connection_buffer(fdp, connection);\n  prepare_headers_and_parse(connection, size);\n\n  // Randomly choose how many targets to fuzz\n  std::vector<int> selectors;\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<int>(1, 8); i++) {\n    selectors.push_back(fdp.ConsumeIntegralInRange<int>(0, 5));\n  }\n\n  // Generate random flags\n  bool use_stream_body = fdp.ConsumeBool();\n  bool is_nodelay = fdp.ConsumeBool();\n  bool is_cork = fdp.ConsumeBool();\n\n  // Use remaining bytes to generate random body for fuzzing\n  std::string body = fdp.ConsumeRemainingBytesAsString();\n  size_t body_size = body.size();\n  if (body_size == 0) {\n    return 0;\n  }\n  prepare_body_and_process(connection, body, body_size, use_stream_body);\n\n  for (int selector : selectors) {\n    switch (selector) {\n      case 0: {\n        mhd_conn_event_loop_state_update(&connection);\n        break;\n      }\n      case 1: {\n        if (connection.rq.app_act.head_act.act == mhd_ACTION_NO_ACTION &&\n            connection.daemon && connection.daemon->req_cfg.cb) {\n          mhd_stream_call_app_request_cb(&connection);\n        }\n        break;\n      }\n      case 2: {\n        if (connection.rq.app_act.head_act.act == mhd_ACTION_POST_PARSE &&\n            connection.rq.app_act.head_act.data.post_parse.done_cb != nullptr &&\n            is_post_parse_ready(connection)) {\n          mhd_stream_process_req_recv_finished(&connection);\n        }\n        break;\n      }\n      default: case 3: {\n        mhd_conn_tls_check(&connection);\n        break;\n      }\n    }\n  }\n\n  final_cleanup(connection, daemon);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_libinfo.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stdint.h>\n#include <stddef.h>\n#include <vector>\n#include <cstdlib>\n#include <algorithm>\n\n#include \"microhttpd2.h\"\n#include \"fuzzer/FuzzedDataProvider.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  // Generate random ids\n  int fixed_id   = fdp.ConsumeIntegral<int>();\n  int dynamic_id = fdp.ConsumeIntegral<int>();\n\n  // Generate random raw data\n  std::vector<uint8_t> raw_data = fdp.ConsumeRemainingBytes<uint8_t>();\n\n  // Fuzz MHD_lib_get_info_fixed_sz\n  MHD_lib_get_info_fixed_sz(\n      static_cast<MHD_LibInfoFixed>(fixed_id),\n      raw_data.size() > 0 ? reinterpret_cast<MHD_LibInfoFixedData*>(raw_data.data()) : nullptr,\n      raw_data.size());\n\n  // Fuzz MHD_lib_get_info_dynamic_sz\n  MHD_lib_get_info_dynamic_sz(\n      static_cast<MHD_LibInfoDynamic>(dynamic_id),\n      raw_data.size() > 0 ? reinterpret_cast<MHD_LibInfoDynamicData*>(raw_data.data()) : nullptr,\n      raw_data.size());\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_mhd2.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stdint.h>\n#include <stddef.h>\n#include <string>\n#include <vector>\n#include <algorithm>\n#include <cstdarg>\n#include <unistd.h>\n#include <fcntl.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n\n#include \"microhttpd2.h\"\n#include \"fuzzer/FuzzedDataProvider.h\"\n\nstatic inline enum MHD_Bool ToMhdBool(bool b) {\n  return b ? MHD_YES : MHD_NO;\n}\n\nstatic void dummy_log(void*, enum MHD_StatusCode, const char*, va_list) {\n  // Do nothing\n}\n\nstatic MHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_NONNULL_(3)\nconst struct MHD_Action* req_cb(void* cls,\n                                struct MHD_Request* request,\n                                const struct MHD_String* path,\n                                enum MHD_HTTP_Method method,\n                                uint_fast64_t upload_size) {\n\n  const std::string* body = static_cast<const std::string*>(cls);\n  struct MHD_Response* r = MHD_response_from_buffer(\n      MHD_HTTP_STATUS_OK, body->size(), body->c_str(),\n      nullptr, nullptr);\n  if (!r) {\n    return nullptr;\n  }\n  return MHD_action_from_response(request, r);\n}\n\nvoid fuzz_digest_auth_calc(FuzzedDataProvider& fdp) {\n  std::string realm  = fdp.ConsumeRandomLengthString(40);\n  std::string user   = fdp.ConsumeRandomLengthString(24);\n  std::string pass   = fdp.ConsumeRandomLengthString(24);\n\n  enum MHD_DigestAuthAlgo alg =\n      fdp.PickValueInArray<enum MHD_DigestAuthAlgo>({\n        MHD_DIGEST_AUTH_ALGO_MD5,\n        MHD_DIGEST_AUTH_ALGO_SHA256,\n        MHD_DIGEST_AUTH_ALGO_SHA512_256\n      });\n  size_t hsz = MHD_digest_get_hash_size(alg);\n  if (hsz > 0 && hsz <= 128) {\n    std::vector<uint8_t> bin(hsz);\n    std::vector<uint8_t> ud(hsz);\n    std::vector<char>    hex(hsz * 2 + 1);\n    (void) MHD_digest_auth_calc_userhash(alg, user.c_str(), realm.c_str(), bin.size(), bin.data());\n    (void) MHD_digest_auth_calc_userhash_hex(alg, user.c_str(), realm.c_str(), hex.size(), hex.data());\n    (void) MHD_digest_auth_calc_userdigest(alg, user.c_str(), realm.c_str(), pass.c_str(), ud.size(), ud.data());\n  }\n}\n\nstruct MHD_Response* fuzz_response_creation(FuzzedDataProvider& fdp) {\n  // Create random body string for response\n  const size_t body_len = fdp.ConsumeIntegralInRange<size_t>(0, std::min<size_t>(fdp.remaining_bytes(), 2048));\n  std::string body = fdp.ConsumeBytesAsString(body_len);\n\n  struct MHD_Response* r = nullptr;\n  enum MHD_HTTP_StatusCode sc =\n      fdp.PickValueInArray<enum MHD_HTTP_StatusCode>({\n        MHD_HTTP_STATUS_OK, MHD_HTTP_STATUS_CREATED, MHD_HTTP_STATUS_NO_CONTENT,\n        MHD_HTTP_STATUS_PARTIAL_CONTENT, MHD_HTTP_STATUS_BAD_REQUEST,\n        MHD_HTTP_STATUS_UNAUTHORIZED, MHD_HTTP_STATUS_FORBIDDEN,\n        MHD_HTTP_STATUS_NOT_FOUND, MHD_HTTP_STATUS_INTERNAL_SERVER_ERROR\n      });\n\n  if (fdp.ConsumeBool()) {\n    r = MHD_response_from_buffer(sc, body.size(), body.data(), nullptr, nullptr);\n  } else if (fdp.ConsumeBool()) {\n    r = MHD_response_from_buffer_static(sc, body.size(), body.c_str());\n  } else {\n    r = MHD_response_from_empty(sc);\n  }\n\n  return r;\n}\n\nvoid fuzz_response_config(FuzzedDataProvider& fdp, struct MHD_Response* r) {\n  std::string header1 = fdp.ConsumeRandomLengthString(24); if (header1.empty()) header1 = \"H1\";\n  std::string header2 = fdp.ConsumeRandomLengthString(24); if (header2.empty()) header2 = \"H2\";\n  std::string header3 = fdp.ConsumeRandomLengthString(24); if (header3.empty()) header3 = \"H3\";\n  std::string val1 = fdp.ConsumeRandomLengthString(64); if (val1.empty()) val1 = \"V1\";\n  std::string val2 = fdp.ConsumeRandomLengthString(64); if (val2.empty()) val2 = \"V2\";\n  std::string val3 = fdp.ConsumeRandomLengthString(64); if (val3.empty()) val3 = \"V3\";\n\n  // Set random headers\n  MHD_response_add_header(r, \"Content-Type\", fdp.ConsumeBool() ? \"text/plain\" : \"application/octet-stream\");\n  MHD_response_add_header(r, header1.c_str(), val1.c_str());\n  MHD_response_add_header(r, header2.c_str(), val2.c_str());\n  MHD_response_add_header(r, header3.c_str(), val3.c_str());\n\n  // Set predefined headers\n  MHD_response_add_predef_header(\n    r, fdp.PickValueInArray<enum MHD_PredefinedHeader>({MHD_PREDEF_ACCEPT_CHARSET, MHD_PREDEF_ACCEPT_LANGUAGE}),\n    fdp.ConsumeRandomLengthString(32).c_str()\n  );\n\n  // Set boolean configurations\n  { auto opt = MHD_R_OPTION_REUSABLE( ToMhdBool(fdp.ConsumeBool())); (void) MHD_response_set_option(r, &opt); }\n  { auto opt = MHD_R_OPTION_HEAD_ONLY_RESPONSE( ToMhdBool(fdp.ConsumeBool())); (void) MHD_response_set_option(r, &opt); }\n  { auto opt = MHD_R_OPTION_CHUNKED_ENC( ToMhdBool(fdp.ConsumeBool())); (void) MHD_response_set_option(r, &opt); }\n  { auto opt = MHD_R_OPTION_CONN_CLOSE( ToMhdBool(fdp.ConsumeBool())); (void) MHD_response_set_option(r, &opt); }\n\n  // Create random data for response generation\n  char tmpl[] = \"/tmp/mhd2_fuzz_XXXXXX\";\n  int fd = mkstemp(tmpl);\n  if (fd >= 0) {\n    std::string bytes = fdp.ConsumeRandomLengthString(512);\n    if (!bytes.empty()) {\n      write(fd, bytes.data(), bytes.size());\n    }\n\n    off_t sz = lseek(fd, 0, SEEK_END);\n    if (sz > 0) {\n      uint_fast64_t off = fdp.ConsumeIntegralInRange<uint_fast64_t>(0, (uint_fast64_t)sz);\n      uint_fast64_t len = fdp.ConsumeIntegralInRange<uint_fast64_t>(0, (uint_fast64_t)(sz - off));\n      struct MHD_Response* rf = MHD_response_from_fd(\n          fdp.PickValueInArray<enum MHD_HTTP_StatusCode>({\n            MHD_HTTP_STATUS_OK, MHD_HTTP_STATUS_PARTIAL_CONTENT, MHD_HTTP_STATUS_NO_CONTENT\n          }),\n          fd, off, len);\n      if (rf) MHD_response_destroy(rf); else close(fd);\n    } else {\n      close(fd);\n    }\n    unlink(tmpl);\n  }\n\n  // Pipe random response\n  int pfd[2];\n  if (0 == pipe(pfd)) {\n    std::string pbytes = fdp.ConsumeRandomLengthString(256);\n    if (!pbytes.empty()) (void)!write(pfd[1], pbytes.data(), pbytes.size());\n    close(pfd[1]);\n    struct MHD_Response* rp = MHD_response_from_pipe(\n        fdp.PickValueInArray<enum MHD_HTTP_StatusCode>({\n          MHD_HTTP_STATUS_OK, MHD_HTTP_STATUS_NO_CONTENT\n        }),\n        pfd[0]);\n    if (rp) {\n      MHD_response_destroy(rp);\n    } else {\n      close(pfd[0]);\n    }\n  }\n}\n\nvoid daemon_configuration(FuzzedDataProvider& fdp, MHD_Daemon* d) {\n  using PollEnum = decltype(MHD_SPS_AUTO);\n  static constexpr PollEnum kPollChoices[] = {\n      MHD_SPS_AUTO, MHD_SPS_SELECT, MHD_SPS_POLL, MHD_SPS_EPOLL,\n  };\n  PollEnum ps = fdp.PickValueInArray(kPollChoices);\n  auto opt1 = MHD_D_OPTION_POLL_SYSCALL(ps);\n  MHD_daemon_set_option(d, &opt1);\n\n  using AddrEnum = decltype(MHD_AF_NONE);\n  static constexpr AddrEnum kAddrChoices[] = {\n      MHD_AF_NONE, MHD_AF_AUTO, MHD_AF_INET4, MHD_AF_INET6,\n  };\n  uint_least16_t port = fdp.ConsumeIntegralInRange<uint_least16_t>(0, 65535);\n  AddrEnum af = fdp.PickValueInArray(kAddrChoices);\n  auto opt2 = MHD_D_OPTION_BIND_PORT(af, port);\n  (void) MHD_daemon_set_option(d, &opt2);\n\n  auto opt3 = MHD_D_OPTION_DEFAULT_TIMEOUT_MILSEC(fdp.ConsumeIntegralInRange<unsigned>(0, 10000));\n  MHD_daemon_set_option(d, &opt3);\n\n  auto opt4 = MHD_D_OPTION_CONN_MEMORY_LIMIT(fdp.ConsumeIntegralInRange<size_t>(0, 1<<16));\n  MHD_daemon_set_option(d, &opt4);\n\n  auto opt5 = MHD_D_OPTION_LOG_CALLBACK(&dummy_log, nullptr);\n  MHD_daemon_set_option(d, &opt5);\n\n  std::vector<uint8_t> ent = fdp.ConsumeBytes<uint8_t>(fdp.ConsumeIntegralInRange<size_t>(0, 32));\n  auto opt6 = MHD_D_OPTION_RANDOM_ENTROPY(ent.size(),\n      const_cast<void*>(static_cast<const void*>(ent.data()))\n  );\n  MHD_daemon_set_option(d, &opt6);\n\n  auto opt7 = MHD_D_OPTION_REREGISTER_ALL(ToMhdBool(fdp.ConsumeBool()));\n  MHD_daemon_set_option(d, &opt7);\n}\n\nvoid fuzz_daemon_lifecycle(FuzzedDataProvider& fdp) {\n  // Create random body string for response\n  const size_t body_len = fdp.ConsumeIntegralInRange<size_t>(0, std::min<size_t>(fdp.remaining_bytes(), 2048));\n  std::string body = fdp.ConsumeBytesAsString(body_len);\n\n  struct MHD_Daemon* d = MHD_daemon_create(&req_cb, &body);\n  if (!d) {\n    return;\n  }\n\n  // Fuzz with random fixed queries\n  union MHD_DaemonInfoFixedData dfix{};\n  const int n = fdp.ConsumeIntegralInRange<int>(1, 6);\n  using FixedEnum = decltype(MHD_DAEMON_INFO_FIXED_POLL_SYSCALL);\n  static constexpr FixedEnum kFixedChoices[] = {\n      MHD_DAEMON_INFO_FIXED_POLL_SYSCALL,\n      MHD_DAEMON_INFO_FIXED_AGGREAGATE_FD,\n      MHD_DAEMON_INFO_FIXED_NUM_WORK_THREADS,\n      MHD_DAEMON_INFO_FIXED_BIND_PORT,\n      MHD_DAEMON_INFO_FIXED_LISTEN_SOCKET,\n      MHD_DAEMON_INFO_FIXED_TLS_BACKEND,\n      MHD_DAEMON_INFO_FIXED_DEFAULT_TIMEOUT_MILSEC,\n      MHD_DAEMON_INFO_FIXED_GLOBAL_CONNECTION_LIMIT,\n      MHD_DAEMON_INFO_FIXED_PER_IP_LIMIT,\n      MHD_DAEMON_INFO_FIXED_SUPPRESS_DATE_HEADER,\n      MHD_DAEMON_INFO_FIXED_CONN_MEMORY_LIMIT,\n      MHD_DAEMON_INFO_FIXED_FD_NUMBER_LIMIT,\n  };\n  for (int i = 0; i < n; ++i) {\n    daemon_configuration(fdp, d);\n    FixedEnum which = fdp.PickValueInArray(kFixedChoices);\n    MHD_daemon_get_info_fixed(d, which, &dfix);\n  }\n\n  // Fuzz with random dynamic queries\n  union MHD_DaemonInfoDynamicData ddyn{};\n  const int m = fdp.ConsumeIntegralInRange<int>(1, 6);\n  using DynEnum = decltype(MHD_DAEMON_INFO_DYNAMIC_MAX_TIME_TO_WAIT);\n  static constexpr DynEnum kDynChoices[] = {\n      MHD_DAEMON_INFO_DYNAMIC_MAX_TIME_TO_WAIT,\n      MHD_DAEMON_INFO_DYNAMIC_HAS_CONNECTIONS,\n  };\n  for (int i = 0; i < m; ++i) {\n    daemon_configuration(fdp, d);\n    DynEnum which = fdp.PickValueInArray(kDynChoices);\n    MHD_daemon_get_info_dynamic(d, which, &ddyn);\n  }\n\n  MHD_daemon_destroy(d);\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  if (size <= 0) {\n    return 0;\n  }\n  FuzzedDataProvider fdp(data, size);\n\n  // Fuzz digest_auth_calc targets\n  fuzz_digest_auth_calc(fdp);\n\n  // Create responses with random choices\n  struct MHD_Response* r = fuzz_response_creation(fdp);\n\n  // Fuzz response configurations\n  if (r) {\n    fuzz_response_config(fdp, r);\n    MHD_response_destroy(r);\n  }\n\n  // Fuzz daemon lifecycle\n  fuzz_daemon_lifecycle(fdp);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_response.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <stdint.h>\n#include <stddef.h>\n#include <unistd.h>\n#include <sys/types.h>\n\n#include <vector>\n#include <algorithm>\n\n#include \"mhd_helper.h\"\n\nstatic void request_ended_cb(void *cls,\n                             const struct MHD_RequestEndedData *data,\n                             void *request_app_context) {\n  // Do nothing\n}\n\nstatic enum MHD_HTTP_StatusCode pick_status_code(FuzzedDataProvider &fdp) {\n  // Randomly pick a valid or invalid HTTP response status code\n  return fdp.ConsumeBool()\n      ? fdp.PickValueInArray({\n          MHD_HTTP_STATUS_OK, MHD_HTTP_STATUS_CREATED, MHD_HTTP_STATUS_NO_CONTENT,\n          MHD_HTTP_STATUS_PARTIAL_CONTENT, MHD_HTTP_STATUS_BAD_REQUEST,\n          MHD_HTTP_STATUS_UNAUTHORIZED, MHD_HTTP_STATUS_FORBIDDEN,\n          MHD_HTTP_STATUS_NOT_FOUND, MHD_HTTP_STATUS_INTERNAL_SERVER_ERROR })\n      : (enum MHD_HTTP_StatusCode)(fdp.ConsumeIntegralInRange<int>(0, 999));\n}\n\nstatic MHD_Response* create_response(FuzzedDataProvider &fdp,\n                                     enum MHD_HTTP_StatusCode sc) {\n  struct MHD_Response* r = nullptr;\n\n  // Generate random response body\n  const size_t body_len = fdp.ConsumeIntegralInRange<size_t>(\n      0, std::min<size_t>(fdp.remaining_bytes(), 8192));\n  std::string body = fdp.ConsumeBytesAsString(body_len);\n\n\n  // Randomly select which constructing function to use for respone object creation\n  enum CtorKind {\n    EMPTY, BUF_STATIC, BUF_COPY, IOVEC, FROM_FD, FROM_PIPE\n  };\n  CtorKind ctor = fdp.PickValueInArray<CtorKind>(\n      {EMPTY, BUF_STATIC, BUF_COPY, IOVEC, FROM_FD, FROM_PIPE});\n\n  switch (ctor) {\n    default:\n    case EMPTY: {\n      // Create empty response\n      r = MHD_response_from_empty(sc);\n      break;\n    }\n    case BUF_STATIC: {\n      // Create response with random body and static buffer status\n      r = MHD_response_from_buffer_static(sc, body.size(), body.c_str());\n      break;\n    }\n    case BUF_COPY: {\n      // Create response with random body and copy buffer in\n      r = MHD_response_from_buffer_copy(sc, body.size(), body.data());\n      break;\n    }\n    case IOVEC: {\n      // Create response from random IO vector\n      unsigned cnt = fdp.ConsumeIntegralInRange<unsigned>(0, 6);\n      std::vector<MHD_IoVec> iov(cnt);\n      std::vector<std::string> chunks; chunks.reserve(cnt);\n      for (unsigned i=0;i<cnt;i++) {\n        chunks.push_back(fdp.ConsumeBytesAsString(\n                           fdp.ConsumeIntegralInRange<size_t>(0, 1024)));\n        iov[i].iov_base = chunks.back().data();\n        iov[i].iov_len  = chunks.back().size();\n      }\n      r = MHD_response_from_iovec(sc, cnt ? cnt : 0, cnt ? iov.data() : nullptr, nullptr, nullptr);\n      break;\n    }\n    case FROM_FD: {\n      // Create response from file with random data\n      char path[] = \"/tmp/mhdrespXXXXXX\";\n      int fd = mkstemp(path);\n      if (fd >= 0) {\n        unlink(path);\n        if (!body.empty()) (void) ::write(fd, body.data(), body.size());\n        uint64_t sz = (uint64_t)body.size();\n        uint64_t off = 0;\n        if (fdp.ConsumeBool()) {\n          off = std::min<uint64_t>(sz, fdp.ConsumeIntegral<uint64_t>() % (sz + 1));\n        }\n        uint64_t len = (sz > off) ? (fdp.ConsumeIntegral<uint64_t>() % (sz - off + 1)) : 0;\n        r = MHD_response_from_fd(sc, fd, off, len);\n        if (!r) {\n          close(fd);\n        }\n      }\n      break;\n    }\n    case FROM_PIPE: {\n      // Create response by piping in random data\n      int pfd[2];\n      if (0 == pipe(pfd)) {\n        std::string pbytes = fdp.ConsumeBytesAsString(\n                               fdp.ConsumeIntegralInRange<size_t>(0, 2048));\n        if (!pbytes.empty()) {\n          ::write(pfd[1], pbytes.data(), pbytes.size());\n        }\n        close(pfd[1]);\n        r = MHD_response_from_pipe(sc, pfd[0]);\n        if (!r) {\n          close(pfd[0]);\n        }\n      }\n      break;\n    }\n  }\n\n  return r;\n}\n\nstatic void add_headers(FuzzedDataProvider &fdp, MHD_Response *r) {\n  const char* ct = fdp.ConsumeBool() ? \"text/plain\" : \"application/octet-stream\";\n  MHD_response_add_header(r, \"Content-Type\", ct);\n\n  // Add random standard headers\n  size_t num_headers = fdp.ConsumeIntegralInRange<size_t>(0, 10);\n  for (size_t i = 0; i < num_headers; i++) {\n    std::string name = safe_ascii(fdp.ConsumeRandomLengthString(20), false);\n    std::string val  = safe_ascii(fdp.ConsumeRandomLengthString(60), true);\n    MHD_response_add_header(r, name.c_str(), val.c_str());\n  }\n\n  // Add random predefined header\n  enum MHD_PredefinedHeader which =\n    fdp.PickValueInArray<enum MHD_PredefinedHeader>(\n      { MHD_PREDEF_ACCEPT_CHARSET, MHD_PREDEF_ACCEPT_LANGUAGE });\n  std::string value = safe_ascii(fdp.ConsumeRandomLengthString(32));\n  MHD_response_add_predef_header(r, which, value.c_str());\n}\n\nstatic void randomise_response_options(FuzzedDataProvider &fdp, MHD_Response *r) {\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_REUSABLE(ToMhdBool(fdp.ConsumeBool()));\n    MHD_response_set_option(r, &o);\n  }\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_HEAD_ONLY_RESPONSE(ToMhdBool(fdp.ConsumeBool()));\n    MHD_response_set_option(r, &o);\n  }\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_CHUNKED_ENC(ToMhdBool(fdp.ConsumeBool()));\n    MHD_response_set_option(r, &o);\n  }\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_CONN_CLOSE(ToMhdBool(fdp.ConsumeBool()));\n    MHD_response_set_option(r, &o);\n  }\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_HTTP_1_0_SERVER(ToMhdBool(fdp.ConsumeBool()));\n    MHD_response_set_option(r, &o);\n  }\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRICT(ToMhdBool(fdp.ConsumeBool()));\n    MHD_response_set_option(r, &o);\n  }\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_INSANITY_HEADER_CONTENT_LENGTH(ToMhdBool(fdp.ConsumeBool()));\n    MHD_response_set_option(r, &o);\n  }\n  if (fdp.ConsumeBool()) {\n    auto o = MHD_R_OPTION_TERMINATION_CALLBACK(&request_ended_cb, nullptr);\n    MHD_response_set_option(r, &o);\n  }\n}\n\nstatic void add_auth(FuzzedDataProvider &fdp, MHD_Response *r,\n                     enum MHD_HTTP_StatusCode sc) {\n  if (sc == MHD_HTTP_STATUS_UNAUTHORIZED) {\n    // Randomly add different challenge under 401 status code\n    if (fdp.ConsumeBool()) {\n      // Use digest challenge\n      std::string realm = safe_ascii(fdp.ConsumeRandomLengthString(24));\n      MHD_response_add_auth_basic_challenge(r, realm.c_str(), ToMhdBool(fdp.ConsumeBool()));\n      if (fdp.ConsumeBool()) {\n        std::string drealm = safe_ascii(fdp.ConsumeRandomLengthString(24));\n        const char* opaque = fdp.ConsumeBool() ? \"opaque\" : nullptr;\n        const char* domain = fdp.ConsumeBool() ? \"/a /b\"  : nullptr;\n        enum MHD_DigestAuthMultiQOP mqop =\n          fdp.ConsumeBool()? MHD_DIGEST_AUTH_MULT_QOP_AUTH : MHD_DIGEST_AUTH_MULT_QOP_AUTH_INT;\n        enum MHD_DigestAuthMultiAlgo malgo =\n          fdp.ConsumeBool()? MHD_DIGEST_AUTH_MULT_ALGO_ANY : MHD_DIGEST_AUTH_MULT_ALGO_MD5;\n        MHD_response_add_auth_digest_challenge(\n            r, drealm.c_str(), opaque, domain, ToMhdBool(fdp.ConsumeBool()),\n            mqop, malgo, ToMhdBool(fdp.ConsumeBool()), ToMhdBool(fdp.ConsumeBool()));\n      }\n    } else {\n      // Use basic challenge\n      std::string realm = safe_ascii(fdp.ConsumeRandomLengthString(24));\n      const char* opaque = fdp.ConsumeBool() ? \"opaque\" : nullptr;\n      const char* domain = fdp.ConsumeBool() ? \"/a /b\"  : nullptr;\n      enum MHD_DigestAuthMultiQOP mqop =\n        fdp.ConsumeBool()? MHD_DIGEST_AUTH_MULT_QOP_AUTH : MHD_DIGEST_AUTH_MULT_QOP_AUTH_INT;\n      enum MHD_DigestAuthMultiAlgo malgo =\n        fdp.ConsumeBool()? MHD_DIGEST_AUTH_MULT_ALGO_ANY : MHD_DIGEST_AUTH_MULT_ALGO_MD5;\n      MHD_response_add_auth_digest_challenge(\n          r, realm.c_str(), opaque, domain, ToMhdBool(fdp.ConsumeBool()),\n          mqop, malgo, ToMhdBool(fdp.ConsumeBool()),\n          ToMhdBool(fdp.ConsumeBool()));\n      if (fdp.ConsumeBool()) {\n        std::string brealm = safe_ascii(fdp.ConsumeRandomLengthString(24));\n        MHD_response_add_auth_basic_challenge(r, brealm.c_str(), ToMhdBool(fdp.ConsumeBool()));\n      }\n    }\n  } else {\n    // For all other status code, randomly determine if challenges are added\n\n    // Randomly choose if basic challenge is used or not\n    if (fdp.ConsumeBool()) {\n      std::string realm = safe_ascii(fdp.ConsumeRandomLengthString(24));\n      MHD_response_add_auth_basic_challenge(r, realm.c_str(), ToMhdBool(fdp.ConsumeBool()));\n    }\n\n    // Randomly choose if disgest challenge is used or not\n    if (fdp.ConsumeBool()) {\n      std::string realm = safe_ascii(fdp.ConsumeRandomLengthString(24));\n      const char* opaque = fdp.ConsumeBool() ? \"opaque\" : nullptr;\n      const char* domain = fdp.ConsumeBool() ? \"/a /b\"  : nullptr;\n      enum MHD_DigestAuthMultiQOP mqop =\n        fdp.ConsumeBool()? MHD_DIGEST_AUTH_MULT_QOP_AUTH : MHD_DIGEST_AUTH_MULT_QOP_AUTH_INT;\n      enum MHD_DigestAuthMultiAlgo malgo =\n        fdp.ConsumeBool()? MHD_DIGEST_AUTH_MULT_ALGO_ANY : MHD_DIGEST_AUTH_MULT_ALGO_MD5;\n      MHD_response_add_auth_digest_challenge(\n          r, realm.c_str(), opaque, domain, ToMhdBool(fdp.ConsumeBool()),\n          mqop, malgo, ToMhdBool(fdp.ConsumeBool()), ToMhdBool(fdp.ConsumeBool()));\n    }\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size == 0) {\n    return 0;\n  }\n  FuzzedDataProvider fdp(data, size);\n\n  // Pick a random response status code\n  enum MHD_HTTP_StatusCode sc = pick_status_code(fdp);\n\n  // Create a random response object\n  struct MHD_Response* r = create_response(fdp, sc);\n  if (!r) {\n    return 0;\n  }\n\n  // Add random headers into the response object\n  add_headers(fdp, r);\n\n  // Set random options for the response object\n  randomise_response_options(fdp, r);\n\n  // Add authentication challenges to response\n  add_auth(fdp, r, sc);\n\n  // Fuzz additional targets on response status\n  MHD_HTTP_status_code_to_string(sc);\n  MHD_status_code_to_string((enum MHD_StatusCode)sc);\n\n  // Destory the response object\n  MHD_response_destroy(r);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/fuzz_str.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <cstring>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <algorithm>\n#include <vector>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"mhd_str.h\"\n#include \"microhttpd2.h\"\n\n\nstatic void fuzz_tokens(FuzzedDataProvider& fdp) {\n  // Prepare random string for string comparison\n  std::string payload1 = fdp.ConsumeRandomLengthString(1024);\n  std::string payload2 = fdp.ConsumeRandomLengthString(1024);\n  std::string payload3 = fdp.ConsumeRandomLengthString(1024);\n  const char *payload_str1 = payload1.c_str();\n  const char *payload_str2 = payload2.c_str();\n  const char *payload_str3 = payload3.c_str();\n  size_t payload_size1 = payload1.size();\n  size_t payload_size2 = payload2.size();\n  size_t payload_size3 = payload3.size();\n\n  // Fuzz mhd_str_equal_caseless\n  mhd_str_equal_caseless(payload_str1, payload_str2);\n\n  // Fuzz mhd_str_equal_caseless_n\n  mhd_str_equal_caseless_n(payload_str1, payload_str2, fdp.ConsumeIntegral<size_t>());\n\n  // Fuzz mhd_str_equal_caseless_bin_n\n  const size_t min_len = std::min(payload_size1, payload_size2);\n  if (min_len) {\n    mhd_str_equal_caseless_bin_n(payload_str1, payload_str2, min_len);\n  }\n\n  // Fuzz mhd_str_has_token_caseless\n  mhd_str_has_token_caseless(payload_str1, payload_str2, payload_size1);\n  mhd_str_has_token_caseless(payload_str1, payload_str2, payload_size2);\n\n  // Fuzz mhd_str_remove_token_caseless\n  ssize_t out_sz = (ssize_t)fdp.ConsumeIntegralInRange<int>(1, 1024);\n  char *out_buf = (char*) malloc((size_t)out_sz);\n  mhd_str_remove_token_caseless(payload_str1, payload_size1, payload_str2, payload_size2,\n                                out_buf, &out_sz);\n  free(out_buf);\n\n  // Fuzz mhd_str_starts_with_token_opt_param\n  struct MHD_String mhd_str1 {\n    payload_size1, payload_str1\n  };\n  struct MHD_String mhd_str2 {\n    payload_size2, payload_str2\n  };\n  mhd_str_starts_with_token_opt_param(&mhd_str1, &mhd_str2);\n\n  // Fuzz mhd_str_starts_with_token_req_param\n  bool needs_uni = fdp.ConsumeBool();\n  struct MHD_String mhd_str3 {\n    payload_size3, payload_str3\n  };\n  struct mhd_BufferConst str3_buf { 0, nullptr };\n  mhd_str_starts_with_token_req_param(&mhd_str1, &mhd_str2, &mhd_str3, &str3_buf, &needs_uni);\n}\n\nstatic void fuzz_conversion(FuzzedDataProvider& fdp) {\n  // Prepare random string for string/int conversion\n  std::string payload = fdp.ConsumeRandomLengthString(1024);\n  const char *payload_str = payload.c_str();\n  size_t payload_size = payload.size();\n\n  uint_fast32_t u32 = 0;\n  uint_fast64_t u64 = 0;\n  char small[4], big[128];\n  size_t max_len = fdp.ConsumeIntegralInRange<size_t>(0, payload_size);\n\n  // Fuzz conversion between string and uint64 with random payload\n  mhd_str_to_uint64(payload_str, &u64);\n  mhd_str_to_uint64_n(payload_str, max_len, &u64);\n  mhd_strx_to_uint64(payload_str, &u64);\n  mhd_strx_to_uint64_n(payload_str, max_len, &u64);\n  mhd_uint64_to_str((uint_fast64_t)fdp.ConsumeIntegral<uint64_t>(), small, sizeof(small));\n  mhd_uint64_to_str((uint_fast64_t)fdp.ConsumeIntegral<uint64_t>(), big, sizeof(big));\n\n  // Fuzz string to uint32 conversion with random payload string\n  mhd_strx_to_uint32(payload_str, &u32);\n  mhd_strx_to_uint32_n(payload_str, max_len, &u32);\n  mhd_uint32_to_strx((uint_fast32_t)fdp.ConsumeIntegral<uint32_t>(), small, sizeof(small));\n  mhd_uint32_to_strx((uint_fast32_t)fdp.ConsumeIntegral<uint32_t>(), big, sizeof(big));\n\n  // Fuzz uint16 to string conversion with random payload\n  mhd_uint16_to_str((uint_least16_t)fdp.ConsumeIntegralInRange<unsigned>(0, 65535), small, sizeof(small));\n  mhd_uint16_to_str((uint_least16_t)fdp.ConsumeIntegralInRange<unsigned>(0, 65535), big, sizeof(big));\n\n  // Fuzz uint8 to string conversion with random payload\n  uint8_t min_digits = fdp.ConsumeIntegralInRange<uint8_t>(0, 5);\n  mhd_uint8_to_str_pad((uint8_t)fdp.ConsumeIntegral<uint8_t>(), min_digits, small, sizeof(small));\n  mhd_uint8_to_str_pad((uint8_t)fdp.ConsumeIntegral<uint8_t>(), min_digits, big, sizeof(big));\n}\n\nstatic void fuzz_decode(FuzzedDataProvider& fdp) {\n  // Prepare random data for string decode\n  bool ignored = false;\n  std::string payload = fdp.ConsumeRandomLengthString(1024);\n  char *payload_str = payload.data();\n  size_t payload_size = payload.size();\n\n  // Fuzz decode functions with random payload\n  char *out1 = (char*) malloc(payload_size);\n  char *out2 = (char*) malloc(payload_size);\n  if (out1) {\n    mhd_str_pct_decode_strict_n(payload_str, payload_size, out1, payload_size);\n  }\n  if (out2) {\n    mhd_str_pct_decode_lenient_n(payload_str, payload_size, out2, payload_size, &ignored);\n  }\n\n  // Fuzz decode in place functions with random payload\n  mhd_str_pct_decode_in_place_strict(payload_str);\n  mhd_str_pct_decode_in_place_lenient(payload_str, &ignored);\n\n  free(out1);\n  free(out2);\n}\n\nstatic void fuzz_quoted(FuzzedDataProvider& fdp) {\n  // Prepare random data for quote and equality check\n  std::string payload1 = fdp.ConsumeRandomLengthString(1024);\n  std::string payload2 = fdp.ConsumeRandomLengthString(1024);\n  const char *payload_str1 = payload1.c_str();\n  const char *payload_str2 = payload2.c_str();\n  size_t payload_size1 = payload1.size();\n  size_t payload_size2 = payload2.size();\n\n  // Fuzz mhd_str_equal_quoted_bin_n with random string payload as binary\n  mhd_str_equal_quoted_bin_n(payload_str1, payload_size1, payload_str2, payload_size2);\n\n  // Fuzz mhd_str_equal_caseless_quoted_bin_n with random string payload as binary\n  mhd_str_equal_caseless_quoted_bin_n(payload_str1, payload_size1, payload_str2, payload_size2);\n\n  // Fuzz mhd_str_quote and mhd_str_unquote with random string payload\n  size_t max_out = payload_size1 * 2;\n  char *out = (char*) malloc(max_out);\n  if (out) {\n    mhd_str_quote(payload_str1, payload_size1, out, max_out);\n    mhd_str_unquote(payload_str1, payload_size1, out);\n  }\n  free(out);\n\n  max_out = payload_size2 * 2;\n  out = (char*) malloc(max_out);\n  if (out) {\n    mhd_str_quote(payload_str2, payload_size2, out, max_out);\n    mhd_str_unquote(payload_str2, payload_size2, out);\n  }\n  free(out);\n}\n\nstatic void fuzz_base64(FuzzedDataProvider& fdp) {\n  // Prepare random data for base64 conversion\n  std::string payload = fdp.ConsumeRandomLengthString(1024);\n  char *payload_str = payload.data();\n  size_t payload_size = payload.size();\n\n  // Prepare a valid base64 string from random payload\n  static const char valid_chars[] =\n    \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n  for (size_t i = 0; i < payload_size; i++) {\n    payload_str[i] = valid_chars[((uint8_t)i) % 64];\n  }\n\n  // Fuzz mhd_base64_to_bin_n with the random base64 string\n  size_t max_out = (payload.size() / 4) * 4;\n  uint8_t* out = (uint8_t*) malloc(payload_size);\n  if (out) {\n    mhd_base64_to_bin_n(payload_str, payload_size, out, max_out);\n    free(out);\n  }\n}\n\nstatic void fuzz_transformation(FuzzedDataProvider& fdp) {\n  // Fuzz targets in multiple rounds\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<unsigned>(1, 8); i++) {\n    // Generate random integer\n    int value = fdp.ConsumeIntegral<int>();\n\n    // Fuzz conversion functions\n    MHD_http_method_to_string(static_cast<MHD_HTTP_Method>(value));\n    MHD_protocol_version_to_string(static_cast<MHD_HTTP_ProtocolVersion>(value));\n  }\n}\n\nstatic void fuzz_hex_conversion(FuzzedDataProvider& fdp) {\n  // Prepare random data for hex conversion\n  std::string payload = fdp.ConsumeRandomLengthString(1024);\n  char *payload_str = payload.data();\n  size_t payload_size = payload.size();\n\n  // Fuzz mhd_hex_to_bin with random payload\n  uint8_t *bin_out = (uint8_t*) malloc(payload_size);\n  if (bin_out) {\n    mhd_hex_to_bin(payload_str, payload_size, bin_out);\n    free(bin_out);\n  }\n\n  // Fuzz mhd_bin_to_hex with random payload\n  char *hex_out = (char *) malloc(payload_size * 2);\n  if (hex_out) {\n    if (!payload.empty()) {\n      mhd_bin_to_hex(payload_str, payload_size, hex_out);\n    }\n    free(hex_out);\n  }\n\n  char *hexz_out = (char *) malloc(payload_size * 2 + 1);\n  if (hexz_out) {\n    if (!payload.empty()) {\n      mhd_bin_to_hex_z(payload_str, payload_size, hexz_out);\n    }\n    free(hexz_out);\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  for (int i = 0; i < fdp.ConsumeIntegralInRange<unsigned>(1, 6); i++) {\n    switch (fdp.ConsumeIntegralInRange<int>(0, 7)) {\n      case 0: fuzz_tokens(fdp); break;\n      case 1: fuzz_conversion(fdp); break;\n      case 2: fuzz_decode(fdp); break;\n      case 3: fuzz_quoted(fdp); break;\n      case 4: fuzz_base64(fdp); break;\n      case 5: fuzz_transformation(fdp); break;\n      case 6: fuzz_hex_conversion(fdp); break;\n    }\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/mhd_helper.cpp",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include \"mhd_helper.h\"\n\n#include <arpa/inet.h>\n#include <netinet/in.h>\n#include <sys/socket.h>\n#include <unistd.h>\n\n#include <algorithm>\n#include <cstring>\n#include <fcntl.h>\n#include <errno.h>\n#include <poll.h>\n\nstd::unique_ptr<FuzzedDataProvider> g_fdp;\nstd::mutex g_fdp_mu;\n\nstd::string b64encode(const std::string &in) {\n  static const char* tbl =\n      \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n  std::string out;\n  size_t i = 0;\n  while (i + 2 < in.size()) {\n    unsigned v = (unsigned((unsigned char)in[i]) << 16) |\n                 (unsigned((unsigned char)in[i+1]) << 8) |\n                 (unsigned((unsigned char)in[i+2]));\n    out.push_back(tbl[(v >> 18) & 63]);\n    out.push_back(tbl[(v >> 12) & 63]);\n    out.push_back(tbl[(v >> 6) & 63]);\n    out.push_back(tbl[(v) & 63]);\n    i += 3;\n  }\n  if (i + 1 == in.size()) {\n    unsigned v = (unsigned((unsigned char)in[i]) << 16);\n    out.push_back(tbl[(v >> 18) & 63]);\n    out.push_back(tbl[(v >> 12) & 63]);\n    out.push_back('=');\n    out.push_back('=');\n  } else if (i + 2 == in.size()) {\n    unsigned v = (unsigned((unsigned char)in[i]) << 16) |\n                 (unsigned((unsigned char)in[i+1]) << 8);\n    out.push_back(tbl[(v >> 18) & 63]);\n    out.push_back(tbl[(v >> 12) & 63]);\n    out.push_back(tbl[(v >> 6) & 63]);\n    out.push_back('=');\n  }\n  return out;\n}\n\nenum MHD_Bool ToMhdBool(bool b) {\n  return b ? MHD_YES : MHD_NO;\n}\n\nstd::string safe_ascii(const std::string& in, bool allow_space) {\n  std::string out; out.reserve(in.size());\n  for (unsigned char c : in) {\n    if (!c || c=='\\r' || c=='\\n' || c<32 || c>=127 || (!allow_space && c==' ')) {\n      continue;\n    }\n    out.push_back((char)c);\n  }\n  if (out.empty()) {\n    out = \"x\";\n  }\n\n  return out;\n}\n\n// Dummy functions\nstatic enum MHD_Bool kv_cb(void*, enum MHD_ValueKind, const struct MHD_NameAndValue*) {\n  return MHD_YES;\n}\nstatic enum MHD_Bool post_cb(void*, const struct MHD_PostField* pf) {\n  return MHD_YES;\n}\n\n/* Start of internal helpers for sending http message to daemon through localhost socket */\nstatic int create_socket(uint16_t port) {\n  int fd = socket(AF_INET, SOCK_STREAM, 0);\n  if (fd < 0) {\n    return -1;\n  }\n\n  // Use flag to avoid blocking on socket\n  int flags = fcntl(fd, F_GETFL, 0);\n  if (flags >= 0) {\n    fcntl(fd, F_SETFL, flags | O_NONBLOCK);\n  }\n  struct linger lg{1, 0};\n  setsockopt(fd, SOL_SOCKET, SO_LINGER, &lg, sizeof(lg));\n\n  // configure the socket to target the daemon\n  sockaddr_in addr{};\n  addr.sin_family = AF_INET;\n  addr.sin_port = htons(port);\n  addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n\n  // Try connect to the daemon on the binded port in localhost\n  int rc = connect(fd, (sockaddr*)&addr, sizeof(addr));\n  if (rc == 0) {\n    return fd;\n  }\n\n  // Early exit for invalid connection\n  if (errno != EINPROGRESS) {\n    close(fd);\n    return -1;\n  }\n  pollfd p{fd, POLLOUT, 0};\n  if (poll(&p, 1, 5) <= 0) {\n    close(fd);\n    return -1;\n  }\n  int err = 0;\n  socklen_t elen = sizeof(err);\n  if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &elen) != 0 || err != 0) {\n    close(fd);\n    return -1;\n  }\n\n  // Return the created socket\n  return fd;\n}\n\nstatic void generate_daemon_options(const std::string& method, DaemonOpts& opts) {\n  std::lock_guard<std::mutex> lk(g_fdp_mu);\n  if (!g_fdp) {\n    return;\n  }\n\n  // Generate general daemon options\n  opts.omit_host = g_fdp->ConsumeBool();\n  opts.bad_cl = g_fdp->ConsumeBool() && g_fdp->ConsumeBool();\n  opts.keep_alive = g_fdp->ConsumeBool();\n  opts.extra_headers = g_fdp->ConsumeBool();\n  opts.use_digest = g_fdp->ConsumeBool();\n  opts.send_malformed_digest = g_fdp->ConsumeBool();\n  if (g_fdp->ConsumeBool()) {\n    opts.realm_hint = g_fdp->ConsumeRandomLengthString(16);\n    if (opts.realm_hint.empty()) opts.realm_hint = \"hint\";\n  }\n\n  // Generate specific daemon options with specific method\n  if (!method.empty() && (method == \"POST\" || g_fdp->ConsumeBool())) {\n    opts.te_chunked = g_fdp->ConsumeBool();\n    opts.as_multipart = g_fdp->ConsumeBool();\n    if (g_fdp->ConsumeBool()) {\n      opts.boundary = safe_ascii(g_fdp->ConsumeRandomLengthString(24), false);\n      if (opts.boundary.empty()) opts.boundary = \"b\";\n    }\n  }\n}\n\nstatic std::string generate_auth_header(const DaemonOpts& opts,\n                                        const std::string& method,\n                                        const std::string& path,\n                                        const std::string& auth_user,\n                                        const std::string& auth_pass,\n                                        bool garble_auth) {\n  // For basic auth only request\n  if (!opts.use_digest) {\n    if (!garble_auth) {\n      std::string up = auth_user + \":\" + auth_pass;\n      return \"Authorization: Basic \" + b64encode(up) + \"\\r\\n\";\n    }\n    static const char* kBad[] = {\n      \"Authorization: Basic\\r\\n\",\n      \"Authorization: Basic =\\r\\n\",\n      \"Authorization: Bearer ???\\r\\n\",\n      \"Authorization:\\r\\n\"\n    };\n    unsigned idx = (auth_user.empty() ? 0u : (unsigned char)auth_user[0]) %\n                   (unsigned)(sizeof(kBad)/sizeof(kBad[0]));\n    return std::string(kBad[idx]);\n  }\n\n  // For digest auth with malformed headers\n  if (!opts.send_malformed_digest) {\n    std::string u = auth_user.empty() ? \"user\" : auth_user;\n    std::string r = opts.realm_hint;\n    std::string uri = (path.empty() || path[0] != '/') ? (\"/\" + path) : path;\n    if (uri.empty()) uri = \"/\";\n    std::string h = \"Authorization: Digest \";\n    h += \"username=\\\"\" + u + \"\\\", \";\n    h += \"realm=\\\"\"    + r + \"\\\", \";\n    h += \"nonce=\\\"deadbeef\\\", \";\n    h += \"uri=\\\"\"      + uri + \"\\\", \";\n    h += \"response=\\\"00000000000000000000000000000000\\\", \";\n    h += \"opaque=\\\"cafebabe\\\", \";\n    h += \"qop=auth, \";\n    h += \"nc=00000001, cnonce=\\\"0123456789abcdef\\\"\\r\\n\";\n    return h;\n  }\n\n  // For digest auth with correctly formatted headers with random data\n  static const char* kBadDigest[] = {\n    \"Authorization: Digest\\r\\n\",\n    \"Authorization: Digest username=\\r\\n\",\n    \"Authorization: Digest realm=\\\"\\\", uri=/, response=\\r\\n\",\n    \"Authorization: Digest nonce=,opaque=\\r\\n\"\n  };\n  unsigned idx = (unsigned char)(auth_user.empty()?0:auth_user[0]) %\n                 (unsigned)(sizeof(kBadDigest)/sizeof(kBadDigest[0]));\n\n  return std::string(kBadDigest[idx]);\n}\n\nstatic void append_headers(std::string& req,\n                           const DaemonOpts& opts,\n                           const std::string& auth_header) {\n  // Set host\n  if (!opts.omit_host) {\n    req += \"Host: 127.0.0.1\\r\\n\";\n  }\n\n  // Append auth headers\n  req += auth_header;\n\n  // Append general headers\n  if (opts.extra_headers) {\n    req += \"User-Agent: fuzz\\r\\n\";\n    req += \"Accept: */*\\r\\n\";\n    req += \"X-Fuzz: 1\\r\\n\";\n    req += \"X-Dup: a\\r\\nX-Dup: b\\r\\n\";\n  }\n}\n\nstatic std::string make_multipart(const DaemonOpts& opts,\n                                  const std::string& body,\n                                  std::string& content_type_line_out) {\n  // Do nothing for non-multipart iteration\n  if (!opts.as_multipart) {\n    content_type_line_out.clear();\n    return body;\n  }\n\n  // Configure the request body to be multipart format\n  std::string b = opts.boundary.empty() ? \"b\" : opts.boundary;\n  std::string mp;\n  mp += \"--\" + b + \"\\r\\n\";\n  mp += \"Content-Disposition: form-data; name=\\\"f\\\"; filename=\\\"x\\\"\\r\\n\";\n  if (!body.empty()) mp += \"Content-Type: application/octet-stream\\r\\n\";\n  mp += \"\\r\\n\";\n  mp += body;\n  mp += \"\\r\\n--\" + b + \"--\\r\\n\";\n  content_type_line_out = \"Content-Type: multipart/form-data; boundary=\" + b + \"\\r\\n\";\n\n  return mp;\n}\n\n\nstatic void append_request_headers(std::string& req,\n                                   const DaemonOpts& opts,\n                                   size_t payload_size,\n                                   const std::string& content_type_line) {\n  // Append content type header\n  if (!content_type_line.empty()) {\n    req += content_type_line;\n  }\n  if (payload_size == 0) {\n    return;\n  }\n\n  // Append encoding and payload size headers\n  if (opts.te_chunked) {\n    req += \"Transfer-Encoding: chunked\\r\\n\";\n  } else {\n    if (!opts.bad_cl) {\n      req += \"Content-Length: \" + std::to_string(payload_size) + \"\\r\\n\";\n    } else {\n      req += \"Content-Length: \" + std::to_string(payload_size + 5) + \"\\r\\n\";\n    }\n  }\n\n  // Append connection lifeline header\n  req += opts.keep_alive ? \"Connection: keep-alive\\r\\n\" : \"Connection: close\\r\\n\";\n}\n\nstatic void append_chunked_payload(std::string& req, const std::string& payload) {\n  // End the request body gracefully for empty payload\n  if (payload.empty()) {\n    req += \"0\\r\\n\\r\\n\";\n    return;\n  }\n\n  // Continue to write all the body data chunk by chunk to the request\n  size_t off = 0;\n  while (off < payload.size()) {\n    char szbuf[32];\n\n    size_t remain = payload.size() - off;\n    size_t chunk = std::min(remain > 1 ? remain / 2 : 1, size_t(4096));\n\n    int n = snprintf(szbuf, sizeof(szbuf), \"%zx\\r\\n\", chunk);\n    if (n > 0) {\n      req.append(szbuf, (size_t)n);\n    }\n    req.append(payload.data() + off, chunk);\n    req += \"\\r\\n\";\n    off += chunk;\n  }\n  req += \"0\\r\\n\\r\\n\";\n}\n\n\nstatic void send_request(int fd, const std::string& req) {\n  // Configure sent parameters and max timeout\n  size_t off = 0;\n  const int kSendStepMs = 2;\n  const int kSendMaxMs = 8;\n  int waited = 0;\n\n  // Continue to send data though the socket until all data is sent or timeout is reached\n  while (off < req.size()) {\n    ssize_t s = send(fd, req.data() + off, req.size() - off, 0);\n    if (s > 0) {\n      off += (size_t)s;\n      continue;\n    }\n\n    if (s < 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) {\n      pollfd p{fd, POLLOUT, 0};\n      if (poll(&p, 1, kSendStepMs) <= 0) {\n        waited += kSendStepMs;\n        if (waited >= kSendMaxMs) {\n          break;\n        }\n      }\n      continue;\n    }\n    break;\n  }\n\n  shutdown(fd, SHUT_WR);\n}\n\nstatic void wait_for_response(int fd) {\n  // Configure response waiting parameters and timeout\n  static const int kStepMs = 2;\n  static const int kMaxMs = 8;\n  static const size_t kMaxRead = 64 * 1024;\n  int waited = 0;\n  size_t total = 0;\n\n  // Continue to receive data from daemon throug the socket until max data threshold or timeout is reached\n  while (true) {\n    pollfd p{fd, POLLIN, 0};\n    int pr = poll(&p, 1, kStepMs);\n    if (pr <= 0) {\n      waited += kStepMs;\n      if (waited >= kMaxMs) {\n        break;\n      }\n\n      continue;\n    }\n\n    char buf[1024];\n    ssize_t r = recv(fd, buf, sizeof(buf), 0);\n    if (r > 0) {\n      total += (size_t)r;\n      if (total >= kMaxRead) break;\n      continue;\n    }\n    if (r == 0) {\n      break;\n    }\n    if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {\n      continue;\n    }\n\n    break;\n  }\n}\n/* End of internal helpers for sending http message to daemon through localhost socket */\n\nvoid send_http_request_blocking(uint16_t port,\n                                const std::string& method,\n                                const std::string& path,\n                                const std::string& auth_user,\n                                const std::string& auth_pass,\n                                const std::string& body,\n                                bool garble_auth) {\n  // Create and connect to the daemon with HTTP localhost socket\n  int fd = create_socket(port);\n  if (fd < 0) {\n    return;\n  }\n\n  // Generate options for the daemon connection and request\n  DaemonOpts opts;\n  generate_daemon_options(method, opts);\n\n  // Build the request body for the random request\n  std::string req;\n  req.reserve(512 + body.size());\n  const std::string& m = method.empty() ? std::string(\"GET\") : method;\n  req += m;\n  req += \" \";\n  std::string full_path = (path.empty() || path[0] != '/') ? (\"/\" + path) : path;\n  if (full_path.empty()) full_path = \"/\";\n  req += full_path;\n  req += \" HTTP/1.1\\r\\n\";\n\n  // Generate auth headers\n  std::string auth_header = generate_auth_header(opts, m, path, auth_user, auth_pass, garble_auth);\n\n  // Append headers into the daemon request\n  append_headers(req, opts, auth_header);\n\n  // Randomly make the request with multipart data\n  std::string content_type_line;\n  std::string payload = make_multipart(opts, body, content_type_line);\n\n  // Append additional request specific headers\n  append_request_headers(req, opts, payload.size(), content_type_line);\n  req += \"\\r\\n\";\n\n  // Add random body content to the request object depends on the content type chosen\n  if (opts.te_chunked) {\n    append_chunked_payload(req, payload);\n  } else {\n    req += payload;\n  }\n\n  // Sending the request to the daemon through the localhost socket\n  send_request(fd, req);\n\n  // Wait for a while for daemon response\n  wait_for_response(fd);\n\n  // Close the socket\n  close(fd);\n}\n\n/* Start of internal helpers for daemon request handling */\nstatic void generate_daemon_req_opts(DaemonReqOpts& o,\n                                     enum MHD_HTTP_Method method) {\n  std::lock_guard<std::mutex> lk(g_fdp_mu);\n  if (!g_fdp) {\n    o.realm = \"realm\";\n    return;\n  }\n\n  // Generate basic daemon request options\n  o.realm = g_fdp->ConsumeRandomLengthString(16);\n  if (o.realm.empty()) {\n    o.realm = \"realm\";\n  }\n  o.allowed_user = g_fdp->ConsumeRandomLengthString(12);\n  o.allowed_pass = g_fdp->ConsumeRandomLengthString(12);\n  o.force_challenge = g_fdp->ConsumeBool();\n  o.force_bad = g_fdp->ConsumeBool();\n  o.flip_ok_to_forbidden = g_fdp->ConsumeBool();\n  o.prefer_utf8 = ToMhdBool(g_fdp->ConsumeBool());\n  o.use_digest = g_fdp->ConsumeBool();\n\n  o.qop  = g_fdp->ConsumeBool() ? MHD_DIGEST_AUTH_MULT_QOP_AUTH\n                                : MHD_DIGEST_AUTH_MULT_QOP_AUTH_INT;\n  o.algo = g_fdp->ConsumeBool() ? MHD_DIGEST_AUTH_MULT_ALGO_ANY\n                                : MHD_DIGEST_AUTH_MULT_ALGO_MD5;\n\n  o.send_stale = g_fdp->ConsumeBool() ? MHD_YES : MHD_NO;\n  o.allow_userhash = g_fdp->ConsumeBool() ? MHD_YES : MHD_NO;\n  o.use_opaque = g_fdp->ConsumeBool();\n\n  // Generate daemon request options for form encoded request\n  o.buf_sz = 64 + g_fdp->ConsumeIntegralInRange<size_t>(0, 8192);\n  o.max_nonstream = g_fdp->ConsumeIntegralInRange<size_t>(0, 64 * 1024);\n  o.enc = g_fdp->PickValueInArray<enum MHD_HTTP_PostEncoding>({\n    MHD_HTTP_POST_ENCODING_FORM_URLENCODED,\n    MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA,\n    MHD_HTTP_POST_ENCODING_TEXT_PLAIN,\n    MHD_HTTP_POST_ENCODING_OTHER\n  });\n  o.do_parse_post = g_fdp->ConsumeBool() || (method == MHD_HTTP_METHOD_POST);\n  o.do_process_upload = g_fdp->ConsumeBool();\n}\n\nstatic const struct MHD_UploadAction*\npost_done_cb(struct MHD_Request *req, void *cls, enum MHD_PostParseResult pr) {\n  return MHD_upload_action_continue(req);\n}\n\nstatic const struct MHD_UploadAction*\npost_reader(struct MHD_Request *req,\n            void *cls,\n            const struct MHD_String *name,\n            const struct MHD_StringNullable *filename,\n            const struct MHD_StringNullable *content_type,\n            const struct MHD_StringNullable *encoding,\n            size_t size,\n            const void *data,\n            uint_fast64_t off,\n            enum MHD_Bool final_data) {\n  return MHD_upload_action_continue(req);\n}\n\nstatic const struct MHD_UploadAction*\nupload_cb(void *upload_cls,\n          struct MHD_Request *request,\n          size_t content_data_size,\n          void *content_data) {\n  enum MHD_HTTP_StatusCode sc = content_data_size ? MHD_HTTP_STATUS_OK : MHD_HTTP_STATUS_NO_CONTENT;\n  struct MHD_Response *r = MHD_response_from_empty(sc);\n  if (!r) {\n    return NULL;\n  }\n\n  return MHD_upload_action_from_response(request, r);\n}\n\nstatic const struct MHD_Action* request_parsing(struct MHD_Request* request, const DaemonReqOpts& o) {\n  // Handle parsing of post request with form data or general parameters\n  if (o.do_parse_post) {\n    const struct MHD_Action *a =\n      MHD_action_parse_post(request,\n                            o.buf_sz,\n                            o.max_nonstream,\n                            o.enc,\n                            &post_reader, nullptr,\n                            &post_done_cb, nullptr);\n    if (a) {\n      MHD_request_get_post_data_cb(\n        request,\n        [](void *cls, const struct MHD_PostField *pf)->enum MHD_Bool {\n          std::lock_guard<std::mutex> lk(g_fdp_mu);\n          if (!g_fdp) {\n            return MHD_YES;\n          }\n          return ToMhdBool(g_fdp->ConsumeBool());\n        },\n        nullptr);\n      return a;\n    }\n  }\n\n  // Handle parsing of upload request\n  if (o.do_process_upload) {\n    const struct MHD_Action *a =\n      MHD_action_process_upload(request,\n                                o.buf_sz,\n                                &upload_cb, nullptr,\n                                &upload_cb,  nullptr);\n    if (a) {\n      return a;\n    }\n  }\n\n  return nullptr;\n}\n\nstatic const struct MHD_Action*\nhandle_basic_auth(struct MHD_Request* request,\n                  const DaemonReqOpts& o) {\n  union MHD_RequestInfoDynamicData req_data;\n  enum MHD_StatusCode res = MHD_request_get_info_dynamic(\n      request, MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS, &req_data);\n\n  // Send bad header response\n  if (o.force_bad || (MHD_SC_REQ_AUTH_DATA_BROKEN == res)) {\n    return MHD_action_from_response(\n      request,\n      MHD_response_from_buffer_static(\n        MHD_HTTP_STATUS_BAD_REQUEST, 10, \"bad_header\"));\n  }\n\n  // Send unauthorized response\n  if (o.force_challenge || (MHD_SC_AUTH_ABSENT == res)) {\n    const char* realm_cstr = o.realm.c_str();\n    return MHD_action_basic_auth_challenge_a(\n      request,\n      realm_cstr,\n      o.prefer_utf8,\n      MHD_response_from_buffer_static(\n        MHD_HTTP_STATUS_UNAUTHORIZED, 4, \"auth\"));\n  }\n\n  // Fail safe to abort request if unknown request status is provided\n  if (MHD_SC_OK != res) {\n    return MHD_action_abort_request(request);\n  }\n\n  // Prepeare and perform basic auth check\n  const struct MHD_AuthBasicCreds *creds = req_data.v_auth_basic_creds;\n  bool user_ok = (creds->username.len == o.allowed_user.size()) &&\n                 (0 == memcmp(o.allowed_user.data(),\n                              creds->username.cstr,\n                              creds->username.len));\n  bool pass_ok = (creds->password.len == o.allowed_pass.size()) &&\n                 (0 == memcmp(o.allowed_pass.data(),\n                              creds->password.cstr,\n                              creds->password.len));\n  bool ok = user_ok && pass_ok;\n\n  // Try randomly flip the result\n  if (o.flip_ok_to_forbidden) {\n    ok = false;\n  }\n\n  // Return result with status in response\n  if (ok) {\n    return MHD_action_from_response(\n      request,\n      MHD_response_from_buffer_static(\n        MHD_HTTP_STATUS_OK, 2, \"OK\"));\n  }\n\n  return MHD_action_from_response(\n    request,\n    MHD_response_from_buffer_static(\n      MHD_HTTP_STATUS_FORBIDDEN, 9, \"FORBIDDEN\"));\n}\n\nstatic const struct MHD_Action*\nhandle_digest_auth(struct MHD_Request* request,\n                   const DaemonReqOpts& o) {\n  union MHD_RequestInfoDynamicData req_data;\n  enum MHD_StatusCode res = MHD_request_get_info_dynamic(\n      request, MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO, &req_data);\n\n  const char* opaque_opt = o.use_opaque ? \"opaque-token\" : nullptr;\n\n  // Early exit for missing auth in request\n  if (MHD_SC_AUTH_ABSENT == res || o.force_challenge) {\n    return MHD_action_digest_auth_challenge_a(\n      request,\n      o.realm.c_str(),\n      \"0\",\n      opaque_opt,\n      o.send_stale,\n      o.qop,\n      o.algo,\n      o.allow_userhash,\n      MHD_YES,\n      MHD_response_from_buffer_static(\n        MHD_HTTP_STATUS_UNAUTHORIZED, 4, \"auth\"));\n  }\n\n  // Early exit for invalid or malformed request headers\n  if (MHD_SC_REQ_AUTH_DATA_BROKEN == res || o.force_bad) {\n    return MHD_action_from_response(\n      request,\n      MHD_response_from_buffer_static(\n        MHD_HTTP_STATUS_BAD_REQUEST, 15, \"Header Invalid.\"));\n  }\n\n  // Fail safe to abort request if unknown response status is provided\n  if (MHD_SC_OK != res) {\n    return MHD_action_abort_request(request);\n  }\n\n  // Prepeare and perform digest auth check\n  const struct MHD_AuthDigestInfo *di = req_data.v_auth_digest_info;\n  bool user_ok = (di->username.len == o.allowed_user.size()) &&\n                 (0 == memcmp(o.allowed_user.data(),\n                              di->username.cstr,\n                              di->username.len));\n\n  if (user_ok) {\n    enum MHD_DigestAuthResult auth_res =\n      MHD_digest_auth_check(request,\n                            o.realm.c_str(),\n                            o.allowed_user.c_str(),\n                            o.allowed_pass.c_str(),\n                            0,\n                            o.qop,\n                            o.algo);\n\n    // Return auth result or randomly flip the result\n    if (MHD_DAUTH_OK == auth_res) {\n      if (!o.flip_ok_to_forbidden) {\n        return MHD_action_from_response(\n          request,\n          MHD_response_from_buffer_static(\n            MHD_HTTP_STATUS_OK, 2, \"OK\"));\n      }\n      return MHD_action_from_response(\n        request,\n        MHD_response_from_buffer_static(\n          MHD_HTTP_STATUS_FORBIDDEN, 9, \"FORBIDDEN\"));\n    }\n\n    if (MHD_DAUTH_NONCE_STALE == auth_res) {\n      return MHD_action_digest_auth_challenge_a(\n        request,\n        o.realm.c_str(),\n        \"0\",\n        opaque_opt,\n        MHD_YES,\n        o.qop,\n        o.algo,\n        o.allow_userhash,\n        MHD_YES,\n        MHD_response_from_buffer_static(\n          MHD_HTTP_STATUS_UNAUTHORIZED, 4, \"auth\"));\n    }\n\n    return MHD_action_from_response(\n      request,\n      MHD_response_from_buffer_static(\n        MHD_HTTP_STATUS_FORBIDDEN, 9, \"FORBIDDEN\"));\n  }\n\n  return MHD_action_from_response(\n    request,\n    MHD_response_from_buffer_static(\n      MHD_HTTP_STATUS_FORBIDDEN, 9, \"FORBIDDEN\"));\n}\n/* End of internal helpers for daemon request handling */\n\nMHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_NONNULL_(3)\nconst struct MHD_Action*\nreq_cb(void* cls,\n       struct MHD_Request* MHD_RESTRICT request,\n       const struct MHD_String* MHD_RESTRICT path,\n       enum MHD_HTTP_Method method,\n       uint_fast64_t upload_size) {\n  DaemonReqOpts opts;\n  generate_daemon_req_opts(opts, method);\n\n  // Try parinsg or streaming request\n  if (const struct MHD_Action* a = request_parsing(request, opts)) {\n    return a;\n  }\n\n  // Perform basic or digest auth on the request\n  if (!opts.use_digest) {\n    return handle_basic_auth(request, opts);\n  }\n  return handle_digest_auth(request, opts);\n}\n\nMHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_NONNULL_(3)\nconst struct MHD_Action*\nreq_cb_stream(void*,\n              struct MHD_Request* MHD_RESTRICT request,\n              const struct MHD_String* MHD_RESTRICT path,\n              enum MHD_HTTP_Method method,\n              uint_fast64_t upload_size) {\n  struct MHD_StringNullable out;\n\n  // Fuzz MHD_request_get_value for different parameters on random request\n  MHD_request_get_value(request, MHD_VK_HEADER, \"host\", &out);\n  MHD_request_get_value(request, MHD_VK_HEADER, \"content-type\", &out);\n  MHD_request_get_value(request, MHD_VK_COOKIE, \"cookie\", &out);\n  MHD_request_get_value(request, MHD_VK_URI_QUERY_PARAM, \"q\", &out);\n  MHD_request_get_values_cb(request, MHD_VK_HEADER, kv_cb, nullptr);\n  MHD_request_get_values_cb(request, MHD_VK_COOKIE, kv_cb, nullptr);\n  MHD_request_get_values_cb(request, MHD_VK_URI_QUERY_PARAM, kv_cb, nullptr);\n\n  // Fuzz MHD_request_get_post_data_cb on random request\n  MHD_request_get_post_data_cb(request, post_cb, nullptr);\n\n\n  // Fuzz MHD_request_get_info_fixed for different parameters on random request\n  union MHD_RequestInfoFixedData fix;\n  MHD_request_get_info_fixed(request, MHD_REQUEST_INFO_FIXED_HTTP_VER, &fix);\n  MHD_request_get_info_fixed(request, MHD_REQUEST_INFO_FIXED_HTTP_METHOD, &fix);\n  MHD_request_get_info_fixed(request, MHD_REQUEST_INFO_FIXED_DAEMON, &fix);\n  MHD_request_get_info_fixed(request, MHD_REQUEST_INFO_FIXED_CONNECTION, &fix);\n  MHD_request_get_info_fixed(request, MHD_REQUEST_INFO_FIXED_STREAM, &fix);\n  MHD_request_get_info_fixed(request, MHD_REQUEST_INFO_FIXED_APP_CONTEXT, &fix);\n\n  // Fuzz MHD_request_get_info_dynamic for different parameters on random request\n  union MHD_RequestInfoDynamicData dyn;\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STRING, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_URI, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_NUMBER_URI_PARAMS, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_NUMBER_COOKIES, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_HEADER_SIZE, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_NUMBER_POST_PARAMS, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_UPLOAD_PRESENT, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_UPLOAD_CHUNKED, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_TOTAL, &dyn);\n  MHD_request_get_info_dynamic(request, MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_RECIEVED, &dyn);\n\n  // Fuzz response creation from random request processing\n  struct MHD_Response* resp = MHD_response_from_empty(MHD_HTTP_STATUS_NO_CONTENT);\n  if (!resp) {\n    return MHD_action_abort_request(request);\n  }\n\n  // Fuzz response and request abortion\n  MHD_response_add_header(resp, \"x-fuzz\", \"values\");\n  const struct MHD_Action* act = MHD_action_from_response(request, resp);\n  MHD_response_destroy(resp);\n  return act ? act : MHD_action_abort_request(request);\n}\n\nMHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_NONNULL_(3)\nconst struct MHD_Action*\nreq_cb_process(void*,\n               struct MHD_Request* MHD_RESTRICT request,\n               const struct MHD_String* MHD_RESTRICT path,\n               enum MHD_HTTP_Method method,\n               uint_fast64_t upload_size) {\n  // Create info unions\n  union MHD_RequestInfoFixedData f;\n  union MHD_RequestInfoDynamicData d;\n\n  // Fuzz MHD_request_get_info_fixed_sz for different parameters on random request\n  MHD_request_get_info_fixed_sz(request, MHD_REQUEST_INFO_FIXED_HTTP_VER, &f, sizeof(f));\n  MHD_request_get_info_fixed_sz(request, MHD_REQUEST_INFO_FIXED_HTTP_METHOD, &f, sizeof(f));\n  MHD_request_get_info_fixed_sz(request, MHD_REQUEST_INFO_FIXED_DAEMON, &f, sizeof(f));\n  MHD_request_get_info_fixed_sz(request, MHD_REQUEST_INFO_FIXED_CONNECTION, &f, sizeof(f));\n  MHD_request_get_info_fixed_sz(request, MHD_REQUEST_INFO_FIXED_STREAM, &f, sizeof(f));\n  MHD_request_get_info_fixed_sz(request, MHD_REQUEST_INFO_FIXED_APP_CONTEXT, &f, sizeof(f));\n\n  // Fuzz MHD_request_get_info_dynamic_sz for different parameters on random request\n  MHD_request_get_info_dynamic_sz(request, MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STRING, &d, sizeof(d));\n  MHD_request_get_info_dynamic_sz(request, MHD_REQUEST_INFO_DYNAMIC_URI, &d, sizeof(d));\n  MHD_request_get_info_dynamic_sz(request, MHD_REQUEST_INFO_DYNAMIC_NUMBER_URI_PARAMS, &d, sizeof(d));\n  MHD_request_get_info_dynamic_sz(request, MHD_REQUEST_INFO_DYNAMIC_NUMBER_COOKIES, &d, sizeof(d));\n  MHD_request_get_info_dynamic_sz(request, MHD_REQUEST_INFO_DYNAMIC_HEADER_SIZE, &d, sizeof(d));\n  MHD_request_get_info_dynamic_sz(request, MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO, &d, sizeof(d));\n  MHD_request_get_info_dynamic_sz(request, MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS, &d, sizeof(d));\n\n  {\n    static const char realm[] = \"fuzz-realm\";\n    static const char user[]  = \"u\";\n    static const char pass[]  = \"p\";\n\n    enum MHD_DigestAuthAlgo algos[] = {\n      MHD_DIGEST_AUTH_ALGO_MD5,\n      MHD_DIGEST_AUTH_ALGO_SHA256,\n      MHD_DIGEST_AUTH_ALGO_SHA512_256\n    };\n\n    for (unsigned i = 0; i < (unsigned)(sizeof(algos)/sizeof(algos[0])); ++i) {\n      size_t sz = MHD_digest_get_hash_size(algos[i]);\n      if (sz == 0 || sz > 64) {\n        continue;\n      }\n      unsigned char ha1[64];\n      if (MHD_SC_OK == MHD_digest_auth_calc_userdigest(algos[i], user, realm, pass, sz, ha1)) {\n        MHD_digest_auth_check_digest(\n            request, realm, user, sz, ha1,\n            0, MHD_DIGEST_AUTH_MULT_QOP_AUTH_ANY,\n            MHD_DIGEST_AUTH_MULT_ALGO_ANY_NON_SESSION);\n      }\n    }\n  }\n\n  // Force OK response\n  struct MHD_Response* r = MHD_response_from_empty(MHD_HTTP_STATUS_OK);\n  return MHD_action_from_response(request, r);\n}\n"
  },
  {
    "path": "projects/libmicrohttpd2/mhd_helper.h",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#pragma once\n\n#include <cstdint>\n#include <memory>\n#include <mutex>\n#include <string>\n\n#include \"microhttpd2.h\"\n#include <fuzzer/FuzzedDataProvider.h>\n\n// Forward declaration\nextern std::unique_ptr<FuzzedDataProvider> g_fdp;\nextern std::mutex g_fdp_mu;\n\n// Daemon options\nstruct DaemonOpts {\n  bool omit_host = false;\n  bool bad_cl = false;\n  bool keep_alive = false;\n  bool extra_headers = false;\n  bool use_digest = false;\n  bool send_malformed_digest = false;\n  bool te_chunked = false;\n  bool as_multipart = false;\n  std::string realm_hint = \"hint\";\n  std::string boundary = \"----fuzz----\";\n};\n\n// Daemon request handling options\nstruct DaemonReqOpts {\n  std::string realm;\n  std::string allowed_user;\n  std::string allowed_pass;\n  bool force_challenge = false;\n  bool force_bad = false;\n  bool flip_ok_to_forbidden = false;\n  enum MHD_Bool prefer_utf8 = MHD_NO;\n\n  bool use_digest = false;\n  MHD_DigestAuthMultiQOP  qop  = MHD_DIGEST_AUTH_MULT_QOP_AUTH;\n  MHD_DigestAuthMultiAlgo algo = MHD_DIGEST_AUTH_MULT_ALGO_ANY;\n\n  enum MHD_Bool send_stale = MHD_NO;\n  enum MHD_Bool allow_userhash = MHD_NO;\n  bool use_opaque = false;\n\n  size_t buf_sz = 4096;\n  size_t max_nonstream = 16384;\n  enum MHD_HTTP_PostEncoding enc = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;\n  bool do_parse_post = false;\n  bool do_process_upload = false;\n};\n\n// Helper for sending request to daemon\nvoid send_http_request_blocking(uint16_t port,\n                                const std::string& method,\n                                const std::string& path,\n                                const std::string& auth_user,\n                                const std::string& auth_pass,\n                                const std::string& body,\n                                bool garble_auth);\n\n// Request handling and processing functions for the daemon\nMHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_NONNULL_(3)\nconst struct MHD_Action* req_cb(void* cls,\n                                struct MHD_Request* MHD_RESTRICT request,\n                                const struct MHD_String* MHD_RESTRICT path,\n                                enum MHD_HTTP_Method method,\n                                uint_fast64_t upload_size);\nMHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_NONNULL_(3)\nconst struct MHD_Action* req_cb_stream(void* cls,\n                                       struct MHD_Request* MHD_RESTRICT request,\n                                       const struct MHD_String* MHD_RESTRICT path,\n                                       enum MHD_HTTP_Method method,\n                                       uint_fast64_t upload_size);\n\nMHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_NONNULL_(3)\nconst struct MHD_Action* req_cb_process(void* cls,\n                                        struct MHD_Request* MHD_RESTRICT request,\n                                        const struct MHD_String* MHD_RESTRICT path,\n                                        enum MHD_HTTP_Method method,\n                                        uint_fast64_t upload_size);\n\n// Provide base64 encoding for the response/request\nstd::string b64encode(const std::string &in);\n\n// Helper to transform bool to MHD_Bool\nenum MHD_Bool ToMhdBool(bool b);\n\n// Helper to convert random string to safe ascii characters only\nstd::string safe_ascii(const std::string& in, bool allow_space = true);\n"
  },
  {
    "path": "projects/libmicrohttpd2/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.gnu.org/s/libmicrohttpd/\"\nmain_repo: \"git://git.gnunet.org/libmicrohttpd2.git\"\nprimary_contact: \"grothoff@gmail.com\"\nlanguage: c\nvendor_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\narchitectures:\n  - x86_64\nbuilds_per_day: 1\n"
  },
  {
    "path": "projects/libmodbus/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool libtool-bin\nRUN git clone https://github.com/stephane/libmodbus.git\nRUN git clone https://github.com/pkillarjun/oss-fuzz-bloat.git\nCOPY build.sh $SRC/\nCOPY fuzz/ $SRC/libmodbus/fuzz/\nWORKDIR $SRC/libmodbus/\n"
  },
  {
    "path": "projects/libmodbus/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd fuzz\nmake all\n\ncp FuzzClient $OUT/FuzzClient\ncp FuzzServer $OUT/FuzzServer\n\npushd $SRC/oss-fuzz-bloat/libmodbus/\ncp FuzzClient_seed_corpus.zip $OUT/FuzzClient_seed_corpus.zip\ncp FuzzServer_seed_corpus.zip $OUT/FuzzServer_seed_corpus.zip\npopd\n"
  },
  {
    "path": "projects/libmodbus/fuzz/FuzzClient.c",
    "content": "\n/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdint.h>\n#include <unistd.h>\n#include <string.h>\n#include <errno.h>\n#include <pthread.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n\n#include <modbus.h>\n#include \"unit-test.h\"\n\n#define PORT 8080\n#define kMinInputLength 9\n#define kMaxInputLength MODBUS_RTU_MAX_ADU_LENGTH\n\nstruct Fuzzer{\n    uint16_t    port;    \n    char*       file;\n\n    FILE*       inFile;\n    uint64_t    size;\n    uint8_t*    buffer;\n\n    pthread_t   thread;\n    int         socket;\n};\ntypedef struct Fuzzer Fuzzer;\n\nint client(Fuzzer *fuzzer);\n\nvoid fuzzinit(Fuzzer *fuzzer){\n    struct sockaddr_in server_addr;\n    fuzzer->socket = socket(AF_INET, SOCK_STREAM, 0);\n\n    server_addr.sin_family = AF_INET;\n    server_addr.sin_port = htons(fuzzer->port);\n    server_addr.sin_addr.s_addr = inet_addr(\"127.0.0.1\");\n\n    setsockopt(fuzzer->socket, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int));\n\n    bind(fuzzer->socket, (struct sockaddr*)&server_addr, sizeof(server_addr));\n    listen(fuzzer->socket,1);\n}\n\nvoid *Server(void *args){\n\n    Fuzzer *fuzzer = (Fuzzer*)args;\n    {\n        int client;\n        char clientData[10240];\n        struct sockaddr_in clientAddr;\n        uint32_t clientSZ = sizeof(clientAddr);\n\n        client = accept(fuzzer->socket, (struct sockaddr*)&clientAddr, &clientSZ);\n\n        send(client, fuzzer->buffer, fuzzer->size, 0);\n        recv(client, clientData, sizeof(clientData), 0);\n\n        send(client, fuzzer->buffer, fuzzer->size, 0);\n        recv(client, clientData, sizeof(clientData), 0);\n\n        shutdown(client,SHUT_RDWR);\n        close(client);\n    }\n    pthread_exit(NULL);\n}\n\nvoid clean(Fuzzer *fuzzer){\n    {//Server\n        shutdown(fuzzer->socket,SHUT_RDWR);\n        close(fuzzer->socket);\n    }\n    free(fuzzer);\n}\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n    if (size < kMinInputLength || size > kMaxInputLength){\n        return 0;\n    }\n\n    Fuzzer *fuzzer = (Fuzzer*)malloc(sizeof(Fuzzer));\n    fuzzer->port = PORT;\n    fuzzer->size = size;\n    fuzzer->buffer = data;\n\n    fuzzinit(fuzzer);\n\n    pthread_create(&fuzzer->thread, NULL,Server,fuzzer);\n    client(fuzzer);\n    pthread_join(fuzzer->thread, NULL);/* To Avoid UAF*/\n\n    clean(fuzzer);\n    return 0;\n}\n\nint client(Fuzzer *fuzzer){\n\n    uint8_t *tab_rp_bits = NULL;\n    uint16_t *tab_rp_registers = NULL;\n    modbus_t *ctx = NULL;\n    int nb_points;\n    int rc;\n\n    ctx = modbus_new_tcp(\"127.0.0.1\", fuzzer->port);\n\n    if (ctx == NULL) {\n        fprintf(stderr, \"Unable to allocate libmodbus context\\n\");\n        return -1;\n    }\n\n    if (modbus_connect(ctx) == -1) {\n        fprintf(stderr, \"Connection failed: %s\\n\", modbus_strerror(errno));\n        modbus_free(ctx);\n        return -1;\n    }\n\n    /* Allocate and initialize the memory to store the bits */\n    nb_points = (UT_BITS_NB > UT_INPUT_BITS_NB) ? UT_BITS_NB : UT_INPUT_BITS_NB;\n    tab_rp_bits = (uint8_t *) malloc(nb_points * sizeof(uint8_t));\n    memset(tab_rp_bits, 0, nb_points * sizeof(uint8_t));\n\n    /* Allocate and initialize the memory to store the registers */\n    nb_points = (UT_REGISTERS_NB > UT_INPUT_REGISTERS_NB) ?\n        UT_REGISTERS_NB : UT_INPUT_REGISTERS_NB;\n    tab_rp_registers = (uint16_t *) malloc(nb_points * sizeof(uint16_t));\n    memset(tab_rp_registers, 0, nb_points * sizeof(uint16_t));\n\n//Read\n    rc = modbus_read_bits(ctx, UT_BITS_ADDRESS, UT_BITS_NB, tab_rp_bits);\n\n    rc = modbus_read_registers(ctx, UT_REGISTERS_ADDRESS,\n                               UT_REGISTERS_NB, tab_rp_registers);\n\n    /* Free the memory */\n    free(tab_rp_bits);\n    free(tab_rp_registers);\n\n    /* Close the connection */\n    modbus_close(ctx);\n    modbus_free(ctx);\n\n    return rc;\n}\n"
  },
  {
    "path": "projects/libmodbus/fuzz/FuzzServer.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stdio.h>\n#include <errno.h>\n#include <stdlib.h>\n#include <stdint.h>\n#include <unistd.h>\n#include <string.h>\n#include <stddef.h>\n#include <pthread.h>\n#include <arpa/inet.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>\n\n#include <modbus.h>\n#include \"unit-test.h\"\n\n#define PORT 8080\n#define kMinInputLength 9\n#define kMaxInputLength MODBUS_RTU_MAX_ADU_LENGTH\n\nstruct Fuzzer{\n    uint16_t    port;    \n    char*       file;\n\n    FILE*       inFile;\n    uint64_t    size;\n    uint8_t*    buffer;\n\n    pthread_t   thread;\n    int         socket;\n};\ntypedef struct Fuzzer Fuzzer;\n\nint server(Fuzzer *fuzzer);\n\nvoid *client(void *args){ \n\n    Fuzzer *fuzzer = (Fuzzer*)args;\n    int sockfd;\n    struct sockaddr_in serv_addr;\n\n    sockfd = socket(AF_INET, SOCK_STREAM, 0);\n    serv_addr.sin_family = AF_INET;\n    serv_addr.sin_port = htons(fuzzer->port);\n    serv_addr.sin_addr.s_addr = inet_addr(\"127.0.0.1\");\n\n    while(1){/* Try until connect*/\n        if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0){\n            continue;\n        }else{\n            break;\n        }\n    }\n\n    send(sockfd,fuzzer->buffer,fuzzer->size,0);\n\n    close(sockfd);\n    pthread_exit(NULL);\n}\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n    if (size < kMinInputLength || size > kMaxInputLength){\n        return 0;\n    }\n\n    Fuzzer *fuzzer = (Fuzzer*)malloc(sizeof(Fuzzer));\n    fuzzer->port = PORT;\n\n    fuzzer->size = size;\n    fuzzer->buffer = data;\n\n    pthread_create(&fuzzer->thread, NULL,client,fuzzer);\n    server(fuzzer);\n    pthread_join(fuzzer->thread, NULL); /* Avoid UAF*/\n\n    free(fuzzer);\n    return 0;\n}\n\nint server(Fuzzer *fuzzer)\n{\n    int s = -1;\n    modbus_t *ctx;\n    modbus_mapping_t *mb_mapping;\n    int rc;\n    int i;\n    uint8_t *query;\n\n    ctx = modbus_new_tcp(\"127.0.0.1\", fuzzer->port);\n    query = malloc(MODBUS_TCP_MAX_ADU_LENGTH);\n\n    mb_mapping = modbus_mapping_new_start_address(\n        UT_BITS_ADDRESS, UT_BITS_NB,\n        UT_INPUT_BITS_ADDRESS, UT_INPUT_BITS_NB,\n        UT_REGISTERS_ADDRESS, UT_REGISTERS_NB_MAX,\n        UT_INPUT_REGISTERS_ADDRESS, UT_INPUT_REGISTERS_NB);\n    if (mb_mapping == NULL) {\n        fprintf(stderr, \"Failed to allocate the mapping: %s\\n\",\n                modbus_strerror(errno));\n        modbus_free(ctx);\n        return -1;\n    }\n\n    /* Initialize input values that's can be only done server side. */\n    modbus_set_bits_from_bytes(mb_mapping->tab_input_bits, 0, UT_INPUT_BITS_NB,\n                               UT_INPUT_BITS_TAB);\n\n    /* Initialize values of INPUT REGISTERS */\n    for (i=0; i < UT_INPUT_REGISTERS_NB; i++) {\n        mb_mapping->tab_input_registers[i] = UT_INPUT_REGISTERS_TAB[i];\n    }\n\n    s = modbus_tcp_listen(ctx, 1);\n    modbus_tcp_accept(ctx, &s);\n\n    rc = modbus_receive(ctx, query);\n\n    if (s != -1) {\n        close(s);\n    }\n\n    modbus_mapping_free(mb_mapping);\n    free(query);\n    /* For RTU */\n    modbus_close(ctx);\n    modbus_free(ctx);\n\n    return rc;\n}\n"
  },
  {
    "path": "projects/libmodbus/fuzz/Makefile",
    "content": "TARGET=Fuzzer\n\n#File\nCLIENTEXE=FuzzClient\nSERVEREXE=FuzzServer\n\n#Compiler Flags\nSET=cd ../ &&\nINC=-I../src/\nLIB=../src/libmodbus.la\nEXTCFLAGS= -Wall -Wextra\nLIBTOOL=libtool --mode=link --tag=CXX\n\nall: $(TARGET)\n\n#SETUP\nINIT:\n\t$(SET) ./autogen.sh\n\nCONF:\n\t$(SET) ./configure --disable-shared CC=$(CC) CFLAGS=\"$(CFLAGS)\" LDFLAGS=\"$(LDFLAGS)\"\n\nMAKEALL:\n\t$(SET) make -j$(nproc)\n\nCPFILE:\n\tcp ../tests/unit-test.h .\n\n$(TARGET): INIT CONF MAKEALL CPFILE\n\t$(CC) $(EXTCFLAGS) $(CFLAGS) $(INC) -c $(CLIENTEXE).c\n\t$(LIBTOOL) $(CXX) $(LDFLAGS) $(CFLAGS) $(LIB) $(LIB_FUZZING_ENGINE) $(CLIENTEXE).o -o $(CLIENTEXE)\n\n\t$(CC) $(EXTCFLAGS) $(CFLAGS) $(INC) -c $(SERVEREXE).c\n\t$(LIBTOOL) $(CXX) $(LDFLAGS) $(CFLAGS) $(LIB) $(LIB_FUZZING_ENGINE) $(SERVEREXE).o -o $(SERVEREXE)\n\nclean:\n\trm $(CLIENTEXE) $(SERVEREXE) *.o\n\n.PHONY: all clean\n"
  },
  {
    "path": "projects/libmodbus/project.yaml",
    "content": "homepage: \"https://libmodbus.org\"\nlanguage: c\nprimary_contact: \"stephane.raimbault@gmail.com\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nvendor_ccs:\n  - \"libmodbus@googlegroups.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/stephane/libmodbus'\n\n"
  },
  {
    "path": "projects/libmpeg2/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget cmake\nRUN git clone https://github.com/ittiam-systems/libmpeg2.git\nADD https://storage.googleapis.com/android_media/external/libmpeg2/fuzzer/mpeg2_dec_fuzzer_seed_corpus.zip $SRC/\nCOPY build.sh $SRC/\nWORKDIR libmpeg2\n"
  },
  {
    "path": "projects/libmpeg2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project.\n$SRC/libmpeg2/fuzzer/ossfuzz.sh\n"
  },
  {
    "path": "projects/libmpeg2/project.yaml",
    "content": "homepage: \"https://github.com/ittiam-systems/libmpeg2\"\nlanguage: c++\nprimary_contact: \"harish.mahendrakar@ittiam.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nauto_ccs:\n  - aadithya.kamath@ittiam.com\n  - harish.mahendrakar@ittiam.com\n  - ram.mohan@ittiam.com\n  - umang.saini@ittiam.com\n  - essick@google.com\n  - lajos@google.com\nvendor_ccs:\n  - adambacchus@google.com\n  - ailport@google.com\n  - bcreasey@google.com\n  - cunefare@google.com\n  - ejorgensen@google.com\n  - faerber@google.com\n  - greendonald@google.com\n  - hamzeh@google.com\n  - jaredkidd@google.com\n  - kimtony@google.com\n  - lindsaywells@google.com\n  - maverickm@google.com\n  - swansonr@google.com\n  - warrenwright@google.com\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/ittiam-systems/libmpeg2.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/liboqs/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake ninja-build openssl\nRUN git clone --depth 1 https://github.com/open-quantum-safe/liboqs.git liboqs\nWORKDIR liboqs\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/liboqs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\ncmake -GNinja ..  -DOQS_BUILD_FUZZ_TESTS=ON\nninja -j$(nproc)\ncp tests/fuzz_* $OUT/\n"
  },
  {
    "path": "projects/liboqs/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://openquantumsafe.org/\"\nlanguage: c\nprimary_contact: \"security@openquantumsafe.org\"\nauto_ccs:\n  - nathaniel.brough@gmail.com\nmain_repo: \"https://github.com/open-quantum-safe/liboqs.git\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n"
  },
  {
    "path": "projects/libpcap/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake flex bison\nRUN git clone --depth 1 https://github.com/the-tcpdump-group/libpcap.git libpcap\n# for corpus as wireshark\nRUN git clone --depth=1 https://github.com/the-tcpdump-group/tcpdump.git tcpdump\nWORKDIR $SRC\nCOPY build.sh $SRC/\n\n"
  },
  {
    "path": "projects/libpcap/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd libpcap\n# build project\nmkdir build\ncd build\ncmake ..\nmake\n\n\n# build fuzz targets\nfor target in pcap filter both\ndo\n    $CC $CFLAGS -I.. -c ../testprogs/fuzz/fuzz_$target.c -o fuzz_$target.o\n    $CXX $CXXFLAGS fuzz_$target.o -o $OUT/fuzz_$target libpcap.a $LIB_FUZZING_ENGINE\ndone\n\n# export other associated stuff\ncd ..\ncp testprogs/fuzz/fuzz_*.options $OUT/\n# builds corpus\ncd $SRC/tcpdump/\nzip -r fuzz_pcap_seed_corpus.zip tests/\ncp fuzz_pcap_seed_corpus.zip $OUT/\ncd $SRC/libpcap/testprogs/BPF\nmkdir corpus\nls *.txt | while read i; do tail -1 $i > corpus/$i; done\nzip -r fuzz_filter_seed_corpus.zip corpus/\ncp fuzz_filter_seed_corpus.zip $OUT/\n"
  },
  {
    "path": "projects/libpcap/project.yaml",
    "content": "homepage: \"https://www.tcpdump.org\"\nlanguage: c++\nprimary_contact: \"security@tcpdump.org\"\nauto_ccs :\n  - \"p.antoine@catenacyber.fr\"\n  - \"infra.station@gmail.com\"\n  - \"gharris@sonic.net\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/the-tcpdump-group/libpcap.git'\n"
  },
  {
    "path": "projects/libpg_query/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://github.com/pganalyze/libpg_query libpg_query\nWORKDIR libpg_query\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libpg_query/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake build\n$CC $CFLAGS -c ./test/fuzz/fuzz_parser.c ./libpg_query.a -I./\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_parser.o ./libpg_query.a -I./ -o $OUT/fuzz_parser\n"
  },
  {
    "path": "projects/libpg_query/project.yaml",
    "content": "homepage: \"https://pganalyze.com/\"\nlanguage: c\nprimary_contact: \"team@pganalyze.com\"\nmain_repo: \"https://github.com/pganalyze/pg_query\"\nauto_ccs:\n  - \"marko@pganalyze.com\"\n  - \"lukas@pganalyze.com\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/libpg_query/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/libpg_query\nmake clean test\n"
  },
  {
    "path": "projects/libphonenumber/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y autoconf automake \\\n      cmake cmake-curses-gui libre2-dev \\\n      libicu-dev libboost-dev libboost-thread-dev libboost-system-dev \\\n      libgflags-dev libgoogle-glog-dev libssl-dev \\\n      protobuf-compiler libtool wget default-jre icu-devtools\n\nRUN git clone --depth 1 https://github.com/google/googletest && \\\n   cd $SRC/googletest && \\\n   mkdir build && \\\n   cd build && \\\n   cmake .. && \\\n   make -j$(nproc) && \\\n   make install\nRUN wget https://github.com/unicode-org/icu/releases/download/release-66-rc/icu4c-66rc-src.tgz && \\\n    tar xzvf icu4c-66rc-src.tgz\nRUN git clone https://github.com/google/protobuf.git && \\\n    cd protobuf && \\\n    git checkout tags/v3.14.0\nRUN git clone https://github.com/google/libphonenumber\nRUN git clone https://github.com/abseil/abseil-cpp && \\\n    cd abseil-cpp && \\\n    git checkout 273292d\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libphonenumber/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CXXFLAGS -std=c++17\"\n\n# For coverage build we need to remove some flags when building protobuf and icu\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n    export OCX=$CXXFLAGS\n    export OC=$CFLAGS\n    CF1=${CFLAGS//-fprofile-instr-generate/}\n    export CFLAGS=${CF1//-fcoverage-mapping/}\n    CXF1=${CXXFLAGS//-fprofile-instr-generate/}\n    export CXXFLAGS=${CXF1//-fcoverage-mapping/}\nfi\n\ncd $SRC/abseil-cpp\nmkdir build && cd build\ncmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON ../  && make -j$(nproc) && make install\nldconfig\n\n# Build Protobuf\nmkdir $SRC/protobuf-install\ncd $SRC/protobuf-install\ncmake $SRC/protobuf/cmake -Dprotobuf_BUILD_TESTS=OFF -DABSL_ROOT_DIR=$SRC/abseil-cpp\nmake -j$(nproc)\nmake install\ncp $SRC/protobuf/src/google/protobuf/*.inc /usr/local/include/google/protobuf/\n\n# Build icu\nexport DEPS_PATH=/src/deps/\nmkdir $DEPS_PATH\n\n# build ICU for linking statically.\ncd $SRC/icu/source\n./configure --disable-shared --enable-static --disable-layoutex \\\n  --disable-tests --disable-samples --with-data-packaging=static --prefix=$DEPS_PATH\nmake install -j$(nproc)\n\n# Ugly ugly hack to get static linking to work for icu.\ncd $DEPS_PATH/lib\nls *.a | xargs -n1 ar x\nrm *.a\nar r libicu.a *.{ao,o}\nln -s libicu.a libicudata.a\nln -s libicu.a libicuuc.a\nln -s libicu.a libicui18n.a\n\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n    export CFLAGS=$OC\n    export CXXFLAGS=$OCX\nfi\n\n# Build libphonenumber\ncd $SRC/libphonenumber/cpp\nsed -i 's/set (BUILD_SHARED_LIB true)/set (BUILD_SHARED_LIB false)/g' CMakeLists.txt\nsed -i 's/set(CMAKE_CXX_STANDARD 11/set(CMAKE_CXX_STANDARD 17/g' CMakeLists.txt\nsed -i 's/list (APPEND CMAKE_C_FLAGS \"-pthread\")/string (APPEND CMAKE_C_FLAGS \" -pthread\")/g' CMakeLists.txt\nsed -i 's/# Safeguarding/find_package(absl REQUIRED) # Safeguarding/g' CMakeLists.txt\n\nmkdir build\ncd build\ncmake -DUSE_BOOST=OFF -DBUILD_GEOCODER=OFF \\\n      -DBUILD_STATIC_LIB=ON -DBUILD_SHARED_LIBS=OFF \\\n      -DPROTOBUF_LIB=\"/src/protobuf-install/libprotobuf.a\" \\\n      -DBUILD_TESTING=OFF \\\n      -DICU_UC_INCLUDE_DIR=$SRC/icu/source/comon \\\n      -DICU_UC_LIB=$DEPS_PATH/lib/libicuuc.a \\\n      -DICU_I18N_INCLUDE_DIR=$SRC/icu/source/i18n/ \\\n      -DICU_I18N_LIB=$DEPS_PATH/lib/libicui18n.a  \\\n      -DREGENERATE_METADATA=OFF \\\n      ../\nmake -j$(nproc)\n\n# list of fuzz targets\nFUZZ_TARGETS=(\n    \"fuzz_phone\" \n    \"fuzz_shortnumberinfo\"\n    \"fuzz_asyoutypeformatter\"\n    \"fuzz_matcher\"\n)\n\n# libraries for building the fuzzers\nLIBS=(\n    \"./libphonenumber.a\"\n    \"$SRC/protobuf-install/libprotobuf.a\"\n    \"/usr/local/lib/libabsl_cord.a\"\n    \"/usr/local/lib/libabsl_cordz_info.a\"\n    \"/usr/local/lib/libabsl_cord_internal.a\"\n    \"/usr/local/lib/libabsl_cordz_functions.a\"\n    \"/usr/local/lib/libabsl_cordz_handle.a\"\n    \"/usr/local/lib/libabsl_hash.a\"\n    \"/usr/local/lib/libabsl_city.a\"\n    \"/usr/local/lib/libabsl_bad_variant_access.a\"\n    \"/usr/local/lib/libabsl_low_level_hash.a\"\n    \"/usr/local/lib/libabsl_raw_hash_set.a\"\n    \"/usr/local/lib/libabsl_bad_optional_access.a\"\n    \"/usr/local/lib/libabsl_hashtablez_sampler.a\"\n    \"/usr/local/lib/libabsl_exponential_biased.a\"\n    \"/usr/local/lib/libabsl_synchronization.a\"\n    \"/usr/local/lib/libabsl_graphcycles_internal.a\"\n    \"/usr/local/lib/libabsl_stacktrace.a\"\n    \"/usr/local/lib/libabsl_symbolize.a\"\n    \"/usr/local/lib/libabsl_malloc_internal.a\"\n    \"/usr/local/lib/libabsl_debugging_internal.a\"\n    \"/usr/local/lib/libabsl_demangle_internal.a\"\n    \"/usr/local/lib/libabsl_time.a\"\n    \"/usr/local/lib/libabsl_strings.a\"\n    \"/usr/local/lib/libabsl_strings_internal.a\"\n    \"/usr/local/lib/libabsl_throw_delegate.a\"\n    \"/usr/local/lib/libabsl_int128.a\"\n    \"/usr/local/lib/libabsl_civil_time.a\"\n    \"/usr/local/lib/libabsl_time_zone.a\"\n    \"/usr/local/lib/libabsl_base.a\"\n    \"/usr/local/lib/libabsl_raw_logging_internal.a\"\n    \"/usr/local/lib/libabsl_log_severity.a\"\n    \"/usr/local/lib/libabsl_spinlock_wait.a\"\n    \"$DEPS_PATH/lib/libicu.a\"\n)\n\n# build fuzzers\nfor target in \"${FUZZ_TARGETS[@]}\"; do\n    $CXX -I$SRC/libphonenumber/cpp/src $CXXFLAGS -o ${target}.o -c ../test/phonenumbers/${target}.cc\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE ${target}.o -o $OUT/${target} \\\n        ${LIBS[@]} \\\n        -lrt -lpthread\ndone\n"
  },
  {
    "path": "projects/libphonenumber/project.yaml",
    "content": "homepage: \"https://github.com/google/libphonenumber/\"\nprimary_contact: \"penmetsaa@google.com\"\nlanguage: c++\nauto_ccs:\n  - \"david@adalogics.com\"\nsanitizers:\n  - address\nmain_repo: 'https://github.com/google/libphonenumber'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/libplist/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config\n\nRUN git clone --depth 1 https://github.com/libimobiledevice/libplist\nWORKDIR libplist\n\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libplist/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [[ \"$SANITIZER\" != \"coverage\" && \"$SANITIZER\" != \"introspector\" ]]\nthen\n  ./autogen.sh --without-cython --enable-debug\nelse\n  ./autogen.sh --without-cython --enable-debug --without-tests\nfi\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\nfor fuzzer in bplist_fuzzer xplist_fuzzer jplist_fuzzer oplist_fuzzer; do\n  $CXX $CXXFLAGS -std=c++11 -Iinclude/ \\\n      fuzz/$fuzzer.cc -o $OUT/$fuzzer \\\n      $LIB_FUZZING_ENGINE src/.libs/libplist-2.0.a\ndone\n\nzip -j $OUT/bplist_fuzzer_seed_corpus.zip test/data/*.bplist\nzip -j $OUT/xplist_fuzzer_seed_corpus.zip test/data/*.plist\nzip -j $OUT/jplist_fuzzer_seed_corpus.zip test/data/*.json\nzip -j $OUT/oplist_fuzzer_seed_corpus.zip test/data/*.ostep\n\ncp fuzz/*.dict fuzz/*.options $OUT/\n"
  },
  {
    "path": "projects/libplist/project.yaml",
    "content": "homepage: \"https://github.com/libimobiledevice/libplist\"\nlanguage: c++\nprimary_contact: \"nikias.bassen@gmail.com\"\nauto_ccs:\n  - \"nikias@gmx.li\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/libimobiledevice/libplist'\n"
  },
  {
    "path": "projects/libplist/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Skip json3.test that is failing and run unit testing\nmake check -C test -j$(nproc) TESTS=\"$(cd test && ls *.test | grep -v 'json3.test')\"\n"
  },
  {
    "path": "projects/libpng/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool zlib1g-dev\n\nRUN git clone --depth 1 https://github.com/madler/zlib.git\nRUN git clone -b master --depth 1 https://github.com/pnggroup/libpng.git\nRUN cp libpng/contrib/oss-fuzz/build.sh $SRC\nWORKDIR libpng\n"
  },
  {
    "path": "projects/libpng/project.yaml",
    "content": "homepage: \"http://www.libpng.org/pub/png/libpng.html\"\nlanguage: c++\nprimary_contact: \"ctruta@gmail.com\"\nauto_ccs:\n  - \"barbaro.alberto@gmail.com\"\n  - \"oss-fuzz@jbowler.com\"\nvendor_ccs:\n  - \"aosmond@mozilla.com\"\n  - \"tnikkel@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/pnggroup/libpng.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libpng-proto/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update -y && \\\n    apt-get install -y make autoconf automake libtool zlib1g-dev \\\n    binutils cmake ninja-build liblzma-dev libz-dev pkg-config\nRUN git clone --depth 1 https://github.com/glennrp/libpng.git\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN git clone --depth 1 https://github.com/google/fuzzer-test-suite\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja)\nCOPY build.sh png_fuzz_proto.proto png_proto_fuzzer_example.cc libpng_transforms_fuzzer.cc png_proto_mutator.cc $SRC/\n"
  },
  {
    "path": "projects/libpng-proto/build.sh",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#!/bin/bash\n\n# build libpng using the upstream-provided build.sh.\n# it will also build the vanilla (non-proto) fuzz target,\n# but we discard it.\n(cd libpng/ && contrib/oss-fuzz/build.sh && rm -rf $OUT/*)\n\n# Compile png_fuzz_proto.proto; should produce two files in genfiles/:\n# png_fuzz_proto.pb.cc  png_fuzz_proto.pb.h\nrm -rf genfiles && mkdir genfiles && LPM/external.protobuf/bin/protoc png_fuzz_proto.proto --cpp_out=genfiles\n\n# compile the upstream-provided vanilla fuzz target\n# but replace LLVMFuzzerTestOneInput with FuzzPNG so that\n# png_proto_fuzzer_example.cc can call FuzzPNG from its own\n# LLVMFuzzerTestOneInput.\n$CXX $CXXFLAGS -c -DLLVMFuzzerTestOneInput=FuzzPNG libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc -I libpng\n\n# compile & link the rest\n$CXX $CXXFLAGS -DNDEBUG png_proto_fuzzer_example.cc libpng_read_fuzzer.o genfiles/png_fuzz_proto.pb.cc \\\n  -I genfiles -I.  -I libprotobuf-mutator/  -I LPM/external.protobuf/include \\\n  -fuse-ld=lld -lz \\\n  LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n  LPM/src/libprotobuf-mutator.a \\\n  LPM/external.protobuf/lib/lib*.a \\\n  libpng/.libs/libpng16.a \\\n  $LIB_FUZZING_ENGINE \\\n  -o $OUT/png_proto_fuzzer_example\n\n# custom png proto mutator\n$CXX $CXXFLAGS -DNDEBUG png_proto_fuzzer_example.cc png_proto_mutator.cc libpng_read_fuzzer.o genfiles/png_fuzz_proto.pb.cc \\\n  -I genfiles -I.  -I libprotobuf-mutator/  -I LPM/external.protobuf/include \\\n  -fuse-ld=lld -lz \\\n  LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n  LPM/src/libprotobuf-mutator.a \\\n  LPM/external.protobuf/lib/lib*.a \\\n  libpng/.libs/libpng16.a \\\n  $LIB_FUZZING_ENGINE \\\n  -o $OUT/png_proto_fuzzer_example_custom_mutator\n\necho > dummy.cc\n\n# A target, w/o protos but with a specialized custom mutator.\n$CXX $CXXFLAGS -c libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc -I libpng\n$CXX $CXXFLAGS dummy.cc \\\n   -include fuzzer-test-suite/libpng-1.2.56/png_mutator.h \\\n   -D PNG_MUTATOR_DEFINE_LIBFUZZER_CUSTOM_MUTATOR \\\n   libpng_read_fuzzer.o \\\n  -lz \\\n  libpng/.libs/libpng16.a \\\n  $LIB_FUZZING_ENGINE \\\n  -o $OUT/png_custom_mutator_fuzzer_example\n\n# An experimental out-of-tree target, with a specialized custom mutator.\n$CXX $CXXFLAGS libpng_transforms_fuzzer.cc \\\n   -include fuzzer-test-suite/libpng-1.2.56/png_mutator.h \\\n   -D PNG_MUTATOR_DEFINE_LIBFUZZER_CUSTOM_MUTATOR \\\n   -I libpng \\\n  -lz \\\n  libpng/.libs/libpng16.a \\\n  $LIB_FUZZING_ENGINE \\\n  -o $OUT/png_transforms_fuzzer\n"
  },
  {
    "path": "projects/libpng-proto/libpng_transforms_fuzzer.cc",
    "content": "#include <algorithm>\n#include <cassert>\n#include <cstring>\n#include <string>\n#include <vector>\n\n#include \"png.h\"\n\nnamespace {\n\nstruct PngReader {\n  png_structp png_ptr = nullptr;\n  png_infop info_ptr = nullptr;\n  png_infop end_info = nullptr;\n};\n\nstruct PngArrayStream {\n  const uint8_t *data;\n  size_t size;\n  size_t pos;\n};\n\nvoid PngArrayStreamCallback(png_structp png_ptr, png_bytep data,\n                            png_size_t size) {\n  PngArrayStream *stream =\n      static_cast<PngArrayStream *>(png_get_io_ptr(png_ptr));\n  if (stream->pos + size > stream->size) {\n    memset(data, 0, size);\n    stream->pos = size;\n  } else {\n    memcpy(data, &stream->data[stream->pos], size);\n    stream->pos += size;\n  }\n}\n\nstatic bool PngVerboseWarnings = getenv(\"PNG_VERBOSE_WARNINGS\") != nullptr;\n\nvoid PngErrorHandler(png_structp png_ptr, png_const_charp error_message) {\n  if (PngVerboseWarnings) fprintf(stderr, \"%s\\n\", error_message);\n  longjmp(png_jmpbuf(png_ptr), 1);\n}\n\nvoid PngWarningHandler(png_structp png_ptr, png_const_charp warning_message) {\n  if (PngVerboseWarnings) fprintf(stderr, \"%s\\n\", warning_message);\n  longjmp(png_jmpbuf(png_ptr), 1);\n}\n\n}  // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  const size_t kPngSignatureSize = 8;\n  const size_t kIHDRSize = 4 + 4 + 13 + 4;\n  const size_t kMaxImageSize = 1 << 20;\n  const size_t kMaxHeight = 1 << 10;\n\n  auto Read32 = [&](const uint8_t *p) {\n    uint32_t res;\n    assert(p >= data);\n    assert(p + sizeof(res) < data + size);\n    memcpy(&res, p, sizeof(res));\n    return res;\n  };\n\n  if (size < kPngSignatureSize + kIHDRSize) return 0;\n  if (png_sig_cmp(data, 0, kPngSignatureSize)) return 0;\n  uint32_t width = __builtin_bswap32(Read32(data + kPngSignatureSize + 8));\n  uint32_t height = __builtin_bswap32(Read32(data + kPngSignatureSize + 12));\n  // Reject too large images because they will OOM.\n  // Also reject images with a too large height, because large height\n  // will cause too many mallocs.\n  // These two heuristics are far from optimal and may cause us to lose some\n  // coverage. But w/o them fuzzing is way too slow.\n  if ((uint64_t)width * height > kMaxImageSize) return 0;\n  if (height > kMaxHeight) return 0;\n\n  // Find the fUZz chunk and it's contents.\n  const size_t fUZz_chunk_size = 16;\n  const uint8_t fUZz_signature[8] = {0,   0,   0,   fUZz_chunk_size,\n                                     'f', 'U', 'Z', 'z'};\n  const uint8_t *fUZz_beg =\n      std::search(data, data + size, fUZz_signature,\n                  fUZz_signature + sizeof(fUZz_signature));\n  if (fUZz_beg + sizeof(fUZz_signature) + fUZz_chunk_size < data + size)\n    fUZz_beg += sizeof(fUZz_signature);\n  else\n    fUZz_beg = nullptr;\n\n  PngReader reader;\n  reader.png_ptr =\n      png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);\n  assert(reader.png_ptr);\n  reader.info_ptr = png_create_info_struct(reader.png_ptr);\n  assert(reader.info_ptr);\n  reader.end_info = png_create_info_struct(reader.png_ptr);\n  assert(reader.end_info);\n\n  png_set_error_fn(reader.png_ptr, png_get_error_ptr(reader.png_ptr),\n                   PngErrorHandler, PngWarningHandler);\n\n  PngArrayStream stream{data, size, 0};\n\n  if (setjmp(png_jmpbuf(reader.png_ptr)) == 0) {\n    png_set_read_fn(reader.png_ptr, &stream, PngArrayStreamCallback);\n\n    // Take transforms from the fUZz chunk. By default, enable all.\n    int transforms = fUZz_beg ? Read32(fUZz_beg) : ~0;\n    png_read_png(reader.png_ptr, reader.info_ptr, transforms, nullptr);\n  }\n  png_destroy_read_struct(&reader.png_ptr, &reader.info_ptr, &reader.end_info);\n\n  // Run the same image through another libpng API.\n  // There is probably some redundancy here (I don't know what I am doing!)\n  png_image image;\n  memset(&image, 0, sizeof(image));\n  image.version = PNG_IMAGE_VERSION;\n  if (png_image_begin_read_from_memory(&image, data, size)) {\n    const size_t kMaxBufferSize = 64 << 20;\n    image.format = fUZz_beg ? Read32(fUZz_beg + 4) : PNG_FORMAT_RGBA;\n    size_t image_size = PNG_IMAGE_SIZE(image);\n    if (image_size <= kMaxBufferSize) {\n      png_bytep buffer = new png_byte[image_size];\n      const size_t kColorMapSize = 256 * 4;\n      // Do we need to take color & colormap from the fuzzed input?\n      png_color color = {1, 2, 3};\n      png_uint_16 colormap[256*4] = {0};\n      for (size_t i = 0; i < kColorMapSize; i++)\n        colormap[i] = i;\n      png_image_finish_read(&image, &color, buffer, 0, colormap);\n      delete[] buffer;\n    }\n  }\n  png_image_free(&image);\n  return 0;\n}\n\nextern \"C\" const char *__asan_default_options() {\t\n  // TODO: remove this once\t\n  // https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12716\t\n  // is fixed.\t\n  return \"detect_leaks=0\";\t\n}\n"
  },
  {
    "path": "projects/libpng-proto/png_fuzz_proto.proto",
    "content": "syntax = \"proto2\";\n// Very simple proto description of the PNG format,\n// described at https://en.wikipedia.org/wiki/Portable_Network_Graphics\n\nmessage IHDR {\n  required uint32 width = 1;\n  required uint32 height = 2;\n  required uint32 other1 = 3;\n  required uint32 other2 = 4;  // Only 1 byte used.\n}\n\nmessage PLTE {\n  required bytes data = 1;\n}\n\nmessage IDAT {\n  required bytes data = 1;\n}\n\nmessage iCCP  {\n  required bytes data = 2;\n}\n\nmessage OtherChunk {\n  oneof type {\n    uint32 known_type = 1;\n    uint32 unknown_type = 2;\n  }\n  required bytes data = 3;\n}\n\nmessage PngChunk {\n  oneof chunk {\n    PLTE plte = 1;\n    IDAT idat = 2;\n    iCCP iccp = 3;\n    OtherChunk other_chunk = 10000;\n  }\n}\n\nmessage PngProto {\n  required IHDR ihdr = 1;\n  repeated PngChunk chunks = 2;\n}\n\n// package fuzzer_examples;\n"
  },
  {
    "path": "projects/libpng-proto/png_proto_fuzzer_example.cc",
    "content": "// Example fuzzer for PNG using protos.\n#include <string>\n#include <sstream>\n#include <fstream>\n#include <zlib.h>  // for crc32\n\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n#include \"png_fuzz_proto.pb.h\"\n\nstatic void WriteInt(std::stringstream &out, uint32_t x) {\n  x = __builtin_bswap32(x);\n  out.write((char *)&x, sizeof(x));\n}\n\nstatic void WriteByte(std::stringstream &out, uint8_t x) {\n  out.write((char *)&x, sizeof(x));\n}\n\nstatic std::string Compress(const std::string &s) {\n  std::string out(s.size() + 100, '\\0');\n  size_t out_len = out.size();\n  compress((uint8_t *)&out[0], &out_len, (uint8_t *)s.data(), s.size());\n  out.resize(out_len);\n  return out;\n}\n\n// Chunk is written as:\n//  * 4-byte length\n//  * 4-byte type\n//  * the data itself\n//  * 4-byte crc (of type and data)\nstatic void WriteChunk(std::stringstream &out, const char *type,\n                       const std::string &chunk, bool compress = false) {\n  std::string compressed;\n  const std::string *s = &chunk;\n  if (compress) {\n    compressed = Compress(chunk);\n    s = &compressed;\n  }\n  uint32_t len = s->size();\n  uint32_t crc = crc32(crc32(0, (const unsigned char *)type, 4),\n                       (const unsigned char *)s->data(), s->size());\n  WriteInt(out, len);\n  out.write(type, 4);\n  out.write(s->data(), s->size());\n  WriteInt(out, crc);\n}\n\nstd::string ProtoToPng(const PngProto &png_proto) {\n  std::stringstream all;\n  const unsigned char header[] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};\n  all.write((const char*)header, sizeof(header));\n  std::stringstream ihdr_str;\n  auto &ihdr = png_proto.ihdr();\n  // Avoid large images.\n  // They may have interesting bugs, but OOMs are going to kill fuzzing.\n  uint32_t w = std::min(ihdr.width(), 4096U);\n  uint32_t h = std::min(ihdr.height(), 4096U);\n  WriteInt(ihdr_str, w);\n  WriteInt(ihdr_str, h);\n  WriteInt(ihdr_str, ihdr.other1());\n  WriteByte(ihdr_str, ihdr.other2());\n  WriteChunk(all, \"IHDR\", ihdr_str.str());\n\n  for (size_t i = 0, n = png_proto.chunks_size(); i < n; i++) {\n    auto &chunk = png_proto.chunks(i);\n    if (chunk.has_plte()) {\n      WriteChunk(all, \"PLTE\", chunk.plte().data());\n    } else if (chunk.has_idat()) {\n      WriteChunk(all, \"IDAT\", chunk.idat().data(), true);\n    } else if (chunk.has_iccp()) {\n      std::stringstream iccp_str;\n      iccp_str << \"xyz\";  // don't fuzz iCCP name field.\n      WriteByte(iccp_str, 0);\n      WriteByte(iccp_str, 0);\n      auto compressed_data = Compress(chunk.iccp().data());\n      iccp_str.write(compressed_data.data(), compressed_data.size());\n      WriteChunk(all, \"iCCP\", iccp_str.str());\n    } else if (chunk.has_other_chunk()) {\n      auto &other_chunk = chunk.other_chunk();\n      char type[5] = {0};\n      if (other_chunk.has_known_type()) {\n        static const char * known_chunks[] = {\n            \"bKGD\", \"cHRM\", \"dSIG\", \"eXIf\", \"gAMA\", \"hIST\", \"iCCP\",\n            \"iTXt\", \"pHYs\", \"sBIT\", \"sPLT\", \"sRGB\", \"sTER\", \"tEXt\",\n            \"tIME\", \"tRNS\", \"zTXt\", \"sCAL\", \"pCAL\", \"oFFs\",\n        };\n        size_t known_chunks_size =\n            sizeof(known_chunks) / sizeof(known_chunks[0]);\n        size_t chunk_idx = other_chunk.known_type() % known_chunks_size;\n        memcpy(type, known_chunks[chunk_idx], 4);\n      } else if (other_chunk.has_unknown_type()) {\n        uint32_t unknown_type_int = other_chunk.unknown_type();\n        memcpy(type, &unknown_type_int, 4);\n      } else {\n        continue;\n      }\n      type[4] = 0;\n      WriteChunk(all, type, other_chunk.data());\n    }\n  }\n  WriteChunk(all, \"IEND\", \"\");\n\n  std::string res = all.str();\n  if (const char *dump_path = getenv(\"PROTO_FUZZER_DUMP_PATH\")) {\n    // With libFuzzer binary run this to generate a PNG file x.png:\n    // PROTO_FUZZER_DUMP_PATH=x.png ./a.out proto-input\n    std::ofstream of(dump_path);\n    of.write(res.data(), res.size());\n  }\n  return res;\n}\n\n// The actual fuzz target that consumes the PNG data.\nextern \"C\" int FuzzPNG(const uint8_t* data, size_t size);\n\nDEFINE_PROTO_FUZZER(const PngProto &png_proto) {\n  auto s = ProtoToPng(png_proto);\n  FuzzPNG((const uint8_t*)s.data(), s.size());\n}\n"
  },
  {
    "path": "projects/libpng-proto/png_proto_mutator.cc",
    "content": "/*\n * Copyright 2020 Google Inc.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n#include \"png_fuzz_proto.pb.h\"\n\ntemplate <typename Proto>\nusing FuzzMutatorCallback = std::function<void(Proto*, unsigned int)>;\n\ntemplate <typename Proto>\nstruct PngProtoCBRegistration\n{\n\tPngProtoCBRegistration(FuzzMutatorCallback<Proto> const& _callback)\n\t{\n\t\tstatic protobuf_mutator::libfuzzer::PostProcessorRegistration<Proto> reg = {_callback};\n\t}\n};\n\n/// Custom mutation: Otherchunk unknown_type -> known_type\nstatic PngProtoCBRegistration<OtherChunk> addCustomChunk = {\n\t[](OtherChunk* message, unsigned int seed)\n\t{\n\t\t// Mutate with a probability of roughly 1/47\n\t\t// 47 has been chosen ad-hoc\n\t\tif (seed % 47 == 0)\n\t\t{\n\t\t\t// If otherChunk is unknown type, mutate\n\t\t\t// it to known type\n\t\t\tif (message->has_unknown_type())\n\t\t\t{\n\t\t\t\t// This is our custom mutation\n\t\t\t\t// We assume (k * 47 mod N) distribute\n\t\t\t\t// uniformly, where\n\t\t\t\t//  - N is total number of known\n\t\t\t\t// chunks defined by png proto converter\n\t\t\t\t//  - k is a factor of seed\n\t\t\t\tmessage->set_known_type(seed);\n\t\t\t}\n\t\t}\n\t}\n};\n"
  },
  {
    "path": "projects/libpng-proto/project.yaml",
    "content": "homepage: \"http://www.libpng.org/pub/png/libpng.html\"\nmain_repo: \"https://git.code.sf.net/p/libpng/code libpng-code\"\nlanguage: c++\nprimary_contact: \"kcc@google.com\"\nsanitizers:\n  - undefined\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/libprotobuf-mutator/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config cmake \\\n    ninja-build liblzma-dev libz-dev docbook2x\n\nRUN git clone --depth 1  https://github.com/google/libprotobuf-mutator.git\nWORKDIR libprotobuf-mutator\n\nCOPY build.sh  *.dict *.options $SRC/\n"
  },
  {
    "path": "projects/libprotobuf-mutator/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp -f $SRC/*.dict $SRC/*.options $OUT/\n\nmkdir -p build\npushd build\nrm -rf *\ncmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \\\n    -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON \\\n    -DLIB_PROTO_MUTATOR_EXAMPLES_USE_LATEST=ON \\\n    -DLIB_PROTO_MUTATOR_FUZZER_LIBRARIES=FuzzingEngine\nninja libxml2_example expat_example\ncp -f examples/libxml2/libxml2_example $OUT/\ncp -f examples/expat/expat_example $OUT/\npopd\n"
  },
  {
    "path": "projects/libprotobuf-mutator/expat_example.options",
    "content": "[libfuzzer]\ndict = xml.dict\nmax_len=1024\n"
  },
  {
    "path": "projects/libprotobuf-mutator/libxml2_example.options",
    "content": "[libfuzzer]\ndict = xml.dict\nmax_len=1000\ndetect_leaks=0\n"
  },
  {
    "path": "projects/libprotobuf-mutator/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/google/libprotobuf-mutator\"\nlanguage: c++\nprimary_contact: \"vitalybuka@chromium.org\"\nmain_repo: 'https://github.com/google/libprotobuf-mutator.git'\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libprotobuf-mutator/xml.dict",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\"&#1;\"\n\"&#x1;\"\n\"&a;\"\n\"&lt;\"\n\"1.0\"\n\"ANY\"\n\"ATTLIST\"\n\"CDATA\"\n\"DOCTYPE\"\n\"EBCDIC\"\n\"ELEMENT\"\n\"EMPTY\"\n\"ENTITIES\"\n\"ENTITY\"\n\"FIXED\"\n\"ID\"\n\"IDREF\"\n\"IDREFS\"\n\"IGNORE\"\n\"IMPLIED\"\n\"INCLUDE\"\n\"ISO-8859-1\"\n\"NDATA\"\n\"NMTOKENS\"\n\"NOTATION\"\n\"PCDATA\"\n\"PUBLIC\"\n\"REQUIRED\"\n\"SYSTEM\"\n\"UCS-4\"\n\"US-ASCII\"\n\"UTF-16\"\n\"UTF-16BE\"\n\"UTF-16LE\"\n\"UTF-8\"\n\"\\\"http://www.w3.org/1999/xhtml\\\"\"\n\"\\\"http://www.w3.org/2000/xmlns\\\"\"\n\"\\\"http://www.w3.org/XML/1998/namespace\\\"\"\n\"fallback\"\n\"http://\"\n\"https://\"\n\"include\"\n\"schema\"\n\"xml\"\n\"xml:lang\"\n\"xml:space\"\n\"xmlns\"\n\"xmlns:\"\n"
  },
  {
    "path": "projects/libproxy/project.yaml",
    "content": "homepage: https://libproxy.github.io/libproxy/\nmain_repo: https://github.com/libproxy/libproxy\nlanguage: c\nvendor_ccs: []\nprimary_contact: \"jan.brummer@tabos.org\"\nauto_ccs:\n  - \"dimstar@opensuse.org\"\n  - \"herrvorragend81@gmail.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n  "
  },
  {
    "path": "projects/libpsl/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n make \\\n pkg-config \\\n autogen \\\n autopoint \\\n autoconf \\\n autoconf-archive \\\n automake \\\n libtool \\\n texinfo \\\n bison \\\n gettext \\\n gengetopt \\\n curl \\\n gperf \\\n wget \\\n python\n\nRUN git clone git://git.savannah.gnu.org/gnulib.git\nRUN git clone --depth=1 https://git.savannah.gnu.org/git/libunistring.git\nRUN git clone --depth=1 https://gitlab.com/libidn/libidn2.git\nRUN git clone --depth=1 https://git.savannah.gnu.org/git/libidn.git\nRUN wget https://github.com/unicode-org/icu/releases/download/release-59-2/icu4c-59_2-src.tgz && tar xvfz icu4c-59_2-src.tgz\n\nRUN git clone --depth=1 --recursive https://github.com/rockdaboot/libpsl.git\n\nWORKDIR libpsl\nCOPY build.sh config.site md5sum run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libpsl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport DEPS_PATH=$SRC/deps\nexport PKG_CONFIG_PATH=$DEPS_PATH/lib/pkgconfig\nexport CPPFLAGS=\"-I$DEPS_PATH/include\"\nexport LDFLAGS=\"-L$DEPS_PATH/lib\"\nexport CONFIG_SITE=$SRC/config.site\nexport GNULIB_SRCDIR=$SRC/gnulib\nexport GNULIB_TOOL=$GNULIB_SRCDIR/gnulib-tool\n\n\ncd $SRC/icu/source\nUBSAN_OPTIONS=detect_leaks=0 \\\nCFLAGS=\"$CFLAGS -fno-sanitize=vptr\" \\\nCXXFLAGS=\"$CXXFLAGS -fno-sanitize=vptr\" \\\nCPPFLAGS=\"$CPPFLAGS -fno-sanitize=vptr\" \\\n./configure --disable-shared --enable-static --disable-extras --disable-icuio --disable-layoutex \\\n  --disable-tests --disable-samples --with-data-packaging=static --prefix=$DEPS_PATH\n# ugly hack to avoid build error\necho '#include <locale.h>' >>i18n/digitlst.h\n\n# Hack so that upgrade to Ubuntu 20.04 works.\nln -s /usr/include/locale.h /usr/include/xlocale.h\n\nmake -j\nmake install\n\ncd $SRC/libunistring\n./autogen.sh\nASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=detect_leaks=0 \\\n  ./configure --enable-static --disable-shared --prefix=$DEPS_PATH\nmake -j\nmake install\n\ncd $SRC/libidn\n./bootstrap\nASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=detect_leaks=0 \\\n  ./configure --enable-static --disable-shared --disable-doc --prefix=$DEPS_PATH\nmake -j\nmake install\n\ncd $SRC/libidn2\n./bootstrap\nASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=detect_leaks=0 \\\n  ./configure --enable-static --disable-shared --disable-doc --disable-gcc-warnings --prefix=$DEPS_PATH\nmake -j\nmake install\n\n\ncd $SRC/libpsl\n./autogen.sh\nexport CXXFLAGS=\"$CXXFLAGS -L$DEPS_PATH/lib/\"\nif test $SANITIZER = \"undefined\"; then\n  # libicu doesn't work with -fsanitizer=undefined, see projects/icu/project.yaml\n  builds=\"libidn2 libidn none\"\nelse\n  builds=\"libicu libidn2 libidn none\"\nfi\nfor build in $builds; do\n  unset LIBS\n  if test $build = \"none\"; then\n    BUILD_FLAGS=\"--disable-runtime --disable-builtin\"\n    # convert PSL to NFC\n    cp -p list/public_suffix_list.dat list/public_suffix_list.dat.org\n    LC_ALL=C.UTF-8 python3 -c $'import unicodedata\\nimport sys\\nfor line in sys.stdin:\\n  sys.stdout.write(unicodedata.normalize(\"NFC\", line))' <list/public_suffix_list.dat.org >list/public_suffix_list.dat\n  else\n    BUILD_FLAGS=\"--enable-runtime=$build --enable-builtin=$build\"\n    if test $build = \"libicu\"; then\n      export LIBS=\"-lstdc++\"\n    fi\n  fi\n  # older m4 iconv detection has memleaks, so switch leak detection off\n  ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=detect_leaks=0 \\\n    ./configure --enable-fuzzing --enable-static --disable-shared --disable-gtk-doc $BUILD_FLAGS --prefix=$DEPS_PATH\n  make clean\n  make -j\n  make -j check\n  make -C fuzz oss-fuzz\n  find fuzz -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\ndone\n\ncd fuzz\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'\n\nfor dir in *_fuzzer.in; do\n    fuzzer=$(basename $dir .in)\n    zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n"
  },
  {
    "path": "projects/libpsl/config.site",
    "content": "if test \"$cache_file\" = /dev/null; then\n  hash=`echo $LIBS $CPPFLAGS CXXFLAGS $CFLAGS $LDFLAGS $build_alias $host_alias $target_alias \\\n    | $SRC/md5sum`\n  cache_file=$SRC/config.cache.$CC.$hash\nfi\n"
  },
  {
    "path": "projects/libpsl/md5sum",
    "content": "#!/usr/local/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport hashlib\n\nBUFSIZE = 4096\n\nif __name__ == \"__main__\":\n    sys.stdin  = sys.stdin.detach()\n    m = hashlib.md5()\n    while True:\n        data = sys.stdin.read(BUFSIZE)\n        if not data:\n            break\n        m.update(data)\n\n    print(m.hexdigest())\n"
  },
  {
    "path": "projects/libpsl/project.yaml",
    "content": "homepage: \"https://github.com/rockdaboot/libpsl\"\nlanguage: c++\nprimary_contact: \"rockdaboot@gmail.com\"\nauto_ccs:\n  - \"tim.ruehsen@gmx.de\"\nmain_repo: 'https://github.com/rockdaboot/libpsl.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/libpsl/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/libra/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# google oss-fuzz stuff\nFROM gcr.io/oss-fuzz-base/base-builder-rust:ubuntu-24-04\n\n# install other tools we might need\nRUN apt-get update && apt-get install -y cmake curl\n\n# get libra\nRUN git clone --depth 1 https://github.com/libra/libra $SRC/libra\nWORKDIR $SRC/libra\n\n# building script for fuzzers\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libra/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Note: This project creates Rust fuzz targets exclusively\n\n# recipe:\n# -------\n# 1. we list all the fuzzers and save to a file fuzzer_list\n# 2. we build the corpus for each fuzzer\n# 3. we build all the fuzzers\n\n# reset flags of OSS-Fuzz\nexport CFLAGS=\"-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\"\nexport CXXFLAGS_EXTRA=\"-stdlib=libc++\"\nexport CXXFLAGS=\"$CFLAGS $CXXFLAGS_EXTRA\"\n\n# correct workdir\ncd $SRC/libra/testsuite/libra-fuzzer\n\n# fetch all dependencies (needed for patching rocksdb)\ncargo fetch\n\n# patch rocksdb to not link libc++ statically\nsed -i \"s/link_cpp(&mut build)/build.cpp_link_stdlib(None)/\" \\\n    /rust/git/checkouts/rust-rocksdb-a9a28e74c6ead8ef/72e45c3/librocksdb_sys/build.rs\n# so now we need to link libc++ at the end\nexport RUSTFLAGS=\"-C link-arg=-L/usr/local/lib -C link-arg=-lc++\"\n\n# 1. list fuzzers\ncargo run --bin libra-fuzzer list --no-desc > fuzzer_list\n\n# 2. build corpus and move to $OUT\ncat fuzzer_list | while read -r line\ndo\n    cargo run --bin libra-fuzzer generate -n 128 $line\n    zip -r $OUT/\"$line\"_seed_corpus.zip fuzz/corpus/$line\n    rm -r fuzz/corpus/$line\ndone\n\n# rust libfuzzer flags (https://github.com/rust-fuzz/libfuzzer/blob/master/build.rs#L12)\nexport CUSTOM_LIBFUZZER_PATH=\"$LIB_FUZZING_ENGINE_DEPRECATED\"\nexport CUSTOM_LIBFUZZER_STD_CXX=c++\n# export CUSTOM_LIBFUZZER_STD_CXX=none \n\n# export fuzzing flags\nRUSTFLAGS=\"$RUSTFLAGS --cfg fuzzing\"          # used to change code logic\nRUSTFLAGS=\"$RUSTFLAGS -Cdebug-assertions\"     # to get debug_assert in rust\nRUSTFLAGS=\"$RUSTFLAGS -Zsanitizer=address\"    # address sanitizer (ASAN)\n\nRUSTFLAGS=\"$RUSTFLAGS -Cdebuginfo=1\"         \nRUSTFLAGS=\"$RUSTFLAGS -Cforce-frame-pointers\"\n\nRUSTFLAGS=\"$RUSTFLAGS -Cpasses=sancov\"\nRUSTFLAGS=\"$RUSTFLAGS -Cllvm-args=-sanitizer-coverage-level=4\"\nRUSTFLAGS=\"$RUSTFLAGS -Cllvm-args=-sanitizer-coverage-trace-compares\"\nRUSTFLAGS=\"$RUSTFLAGS -Cllvm-args=-sanitizer-coverage-inline-8bit-counters\"\nRUSTFLAGS=\"$RUSTFLAGS -Cllvm-args=-sanitizer-coverage-trace-geps\"\nRUSTFLAGS=\"$RUSTFLAGS -Cllvm-args=-sanitizer-coverage-prune-blocks=0\"\nRUSTFLAGS=\"$RUSTFLAGS -Cllvm-args=-sanitizer-coverage-pc-table\"\nRUSTFLAGS=\"$RUSTFLAGS -Clink-dead-code\"\nRUSTFLAGS=\"$RUSTFLAGS -Cllvm-args=-sanitizer-coverage-stack-depth\"\nRUSTFLAGS=\"$RUSTFLAGS -Ccodegen-units=1\"\n\nexport RUSTFLAGS\n\n# 3. build all the fuzzers!\ncat fuzzer_list | while read -r line\ndo\n    # build\n    export SINGLE_FUZZ_TARGET=\"$line\"\n    cargo build --manifest-path fuzz/Cargo.toml --bin fuzzer_builder --release --target x86_64-unknown-linux-gnu\n    # move fuzzer to $OUT\n    mv $SRC/libra/target/x86_64-unknown-linux-gnu/release/fuzzer_builder $OUT/$SINGLE_FUZZ_TARGET\ndone\n"
  },
  {
    "path": "projects/libra/project.yaml",
    "content": "base_os_version: ubuntu-24-04\ndisabled: true\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/libra/libra\nlanguage: rust\nmain_repo: https://github.com/libra/libra\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/libraw/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config zlib1g-dev\nRUN git clone --depth 1 https://github.com/libraw/libraw\nWORKDIR libraw\n\nADD http://oss-fuzz-corpus.storage.googleapis.com/libraw/libraw_cr2_fuzzer_seed_corpus.zip $SRC/\nADD http://oss-fuzz-corpus.storage.googleapis.com/libraw/libraw_nef_fuzzer_seed_corpus.zip $SRC/\nADD http://oss-fuzz-corpus.storage.googleapis.com/libraw/libraw_raf_fuzzer_seed_corpus.zip $SRC/\n\nCOPY build.sh libraw_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/libraw/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# copy corpuses\ncp $SRC/libraw_cr2_fuzzer_seed_corpus.zip \\\n    $SRC/libraw_nef_fuzzer_seed_corpus.zip \\\n    $SRC/libraw_raf_fuzzer_seed_corpus.zip \\\n    $OUT/\n\n# build project\nautoreconf --install\n./configure --disable-examples\nmake\n\n# build fuzzers\nexport CXXFLAGS=\"${CXXFLAGS} -std=c++17\"\n$CXX $CXXFLAGS -Ilibraw \\\n    $SRC/libraw_fuzzer.cc -o $OUT/libraw_fuzzer \\\n    $LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a\n\n$CXX $CXXFLAGS -Ilibraw \\\n    $SRC/libraw_fuzzer.cc -o $OUT/libraw_cr2_fuzzer \\\n    $LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a\n\n$CXX $CXXFLAGS -Ilibraw \\\n    $SRC/libraw_fuzzer.cc -o $OUT/libraw_nef_fuzzer \\\n    $LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a\n\n$CXX $CXXFLAGS -Ilibraw \\\n    $SRC/libraw_fuzzer.cc -o $OUT/libraw_raf_fuzzer \\\n    $LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a\n"
  },
  {
    "path": "projects/libraw/libraw_fuzzer.cc",
    "content": "/*  Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <libraw.h>\n\nenum InterpolationOptions {\n  Linear = 0,\n  Vng = 1, \n  Ppg = 2,\n  Ahd = 3,\n  Dcb = 4,\n  Dht = 11,\n  AhdModified = 12\n};\nstatic const InterpolationOptions options[] = {Linear, Vng, Ppg, Ahd, Dcb, Dht, AhdModified};\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  // Input less than 15mb\n  if (size > 15000000) {\n    return 0;\n  }\n\n  FuzzedDataProvider fdp(data, size);\n  LibRaw lib_raw;\n\n  for(int i =0; i < 4; i++)\n    lib_raw.output_params_ptr()->aber[i] = fdp.ConsumeFloatingPoint<double>();\n  for(int i =0; i < 4; i++)\n    lib_raw.output_params_ptr()->user_mul[i] = fdp.ConsumeFloatingPoint<float>();\n  for(int i =0; i < 2; i++)\n    lib_raw.output_params_ptr()->gamm[i] = fdp.ConsumeFloatingPoint<double>();\n  lib_raw.output_params_ptr()->bright = fdp.ConsumeFloatingPoint<float>();\n  lib_raw.output_params_ptr()->threshold = fdp.ConsumeFloatingPoint<float>();\n  lib_raw.output_params_ptr()->use_auto_wb = fdp.ConsumeIntegral<int>();\n  lib_raw.output_params_ptr()->output_color = fdp.ConsumeIntegralInRange<int>(0, 6);\n  lib_raw.output_params_ptr()->user_flip = fdp.ConsumeIntegralInRange<int>(0, 7);\n  lib_raw.output_params_ptr()->user_black = fdp.ConsumeIntegral<int>();\n  lib_raw.output_params_ptr()->user_sat = fdp.ConsumeIntegral<int>();\n  lib_raw.output_params_ptr()->auto_bright_thr = fdp.ConsumeFloatingPoint<float>();\n  lib_raw.output_params_ptr()->adjust_maximum_thr = fdp.ConsumeFloatingPointInRange<float>(0.f, 1.f);\n  lib_raw.output_params_ptr()->fbdd_noiserd = fdp.ConsumeIntegralInRange<int>(0, 5);\n\n  std::vector<char> payload = fdp.ConsumeRemainingBytes<char>();\n  int result = lib_raw.open_buffer(payload.data(), payload.size());\n  if (result != LIBRAW_SUCCESS) {\n    return 0;\n  }\n\n  result = lib_raw.unpack();\n  if (result != LIBRAW_SUCCESS) {\n    return 0;\n  }\n\n  result = lib_raw.unpack_thumb();\n  if (result != LIBRAW_SUCCESS) {\n    return 0;\n  }\n\n  result = lib_raw.raw2image();\n  if (result != LIBRAW_SUCCESS) {\n    return 0;\n  }\n  lib_raw.free_image();\n\n  for (int i = 0; i < sizeof(options)/sizeof(*options); i++) {\n    lib_raw.output_params_ptr()->user_qual = static_cast<int>(options[i]);\n\n    result = lib_raw.dcraw_process();\n    if (result != LIBRAW_SUCCESS) {\n      return 0;\n    }\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libraw/project.yaml",
    "content": "homepage: \"https://www.libraw.org/\"\nlanguage: c++\nprimary_contact: \"jesteele@google.com\"\nauto_ccs:\n    - \"nchusid@google.com\"\n    - \"pinheirojamie@google.com\"\n    - \"info@libraw.org\"\nsanitizers:\n    - address\n    - memory\n    - undefined\nmain_repo: 'https://github.com/libraw/libraw'\nfile_github_issue: true\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/librawspeed/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget && \\\n    wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - && \\\n    apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' && \\\n    apt-get update && apt-get install -y cmake make\nRUN git clone --depth 1 https://github.com/darktable-org/rawspeed.git librawspeed\nWORKDIR librawspeed\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/librawspeed/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"$CFLAGS -Wno-error=nan-infinity-disabled\"\nexport CXXFLAGS=\"$CXXFLAGS -Wno-error=nan-infinity-disabled\"\n$SRC/librawspeed/.ci/oss-fuzz.sh\n"
  },
  {
    "path": "projects/librawspeed/project.yaml",
    "content": "homepage: \"https://github.com/darktable-org/rawspeed\"\nlanguage: c++\nprimary_contact: \"lebedev.ri@gmail.com\"\nsanitizers:\n- address\n- undefined\n- memory\nmain_repo: 'https://github.com/darktable-org/rawspeed.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/librdkafka/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake flex bison zlib1g-dev \\\n  libcurlpp-dev libcurl4-openssl-dev\nRUN git clone https://github.com/edenhill/librdkafka\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/librdkafka/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd librdkafka\nmkdir build\ncd build\ncmake -DRDKAFKA_BUILD_STATIC=ON -DRDKAFKA_BUILD_EXAMPLES=OFF -DHAVE_REGEX=OFF ../\nmake\n\n$CC -g -fPIC $CFLAGS -I$SRC/librdkafka/src -Igenerated/dummy \\\n    -c $SRC/librdkafka/tests/fuzzers/fuzz_regex.c -o fuzz_regex.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -rdynamic fuzz_regex.o -o fuzzer \\\n    ./src-cpp/librdkafka++.a ./src/librdkafka.a -lm -lssl -lcrypto \\\n    -lcrypto -lz -ldl -lpthread -lrt\ncp fuzzer $OUT/fuzz_regex\n"
  },
  {
    "path": "projects/librdkafka/project.yaml",
    "content": "homepage: \"https://github.com/edenhill/librdkafka\"\nprimary_contact: \"magnus@edenhill.se\"\nlanguage: c++\nauto_ccs:\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/edenhill/librdkafka'\n"
  },
  {
    "path": "projects/libredwg/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf libtool texinfo\nRUN git clone https://github.com/LibreDWG/libredwg\n\nWORKDIR $SRC/libredwg\nCOPY run_tests.sh build.sh $SRC/\nCOPY llvmfuzz.options $SRC/\n"
  },
  {
    "path": "projects/libredwg/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Harden build in introspector mode\nif [[ \"$SANITIZER\" == introspector ]]; then\n  export CFLAGS=\"${CFLAGS} -Wno-error\"\n  export CXXFLAGS=\"${CXXFLAGS} -Wno-error\"\nelse\n  export CFLAGS=\"${CFLAGS} -Wno-default-const-init-field-unsafe -Wno-uninitialized-const-pointer\"\n  export CXXFLAGS=\"${CXXFLAGS} -Wno-default-const-init-field-unsafe -Wno-uninitialized-const-pointer\"\nfi\n\nsh ./autogen.sh\n# enable-release to skip unstable preR13. bindings are not fuzzed.\n./configure --disable-shared --disable-bindings --enable-release\nmake\n\n$CC $CFLAGS src/.libs/libredwg.a -I./include -I./src -c examples/llvmfuzz.c\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE llvmfuzz.o src/.libs/libredwg.a \\\n  -o $OUT/llvmfuzz\n\ncp $SRC/llvmfuzz.options $OUT/llvmfuzz.options\n\n# Build unit test\nmake check-prep -C test/unit-testing/ -j$(nproc)\n"
  },
  {
    "path": "projects/libredwg/llvmfuzz.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/libredwg/project.yaml",
    "content": "homepage: \"https://github.com/LibreDWG/libredwg\"\nprimary_contact: \"reini.urban@gmail.com\"\nlanguage: c\nauto_ccs :\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nmain_repo: 'https://github.com/LibreDWG/libredwg'\n"
  },
  {
    "path": "projects/libredwg/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./unit_testing_all.sh\n"
  },
  {
    "path": "projects/libreoffice/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n# enable source repos\nRUN sed -i -e '/^#\\s*deb-src.*\\smain\\s\\+restricted/s/^#//' /etc/apt/sources.list\n#build requirements\nRUN apt-get update && apt-get build-dep -y libreoffice && \\\n    apt-get install -y lockfile-progs wget yasm locales && \\\n    locale-gen en_US.UTF-8\n#until base image contains a sufficiently new meson > = 0.55.0\nRUN apt-get update && apt-get install -y python3-pip && \\\n    pip3 install meson ninja\n#clone source\nRUN git clone --depth 1 https://git.libreoffice.org/core libreoffice\nWORKDIR libreoffice\nRUN ./bin/oss-fuzz-setup.sh\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libreoffice/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/libreoffice/bin/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/libreoffice/project.yaml",
    "content": "homepage: \"https://www.libreoffice.org/\"\nlanguage: c++\nprimary_contact: \"caolanm@gmail.com\"\nsanitizers:\n  - address\n  - memory:\n     experimental: True\n  - undefined\nfuzzing_engines:\n  # see https://github.com/google/oss-fuzz/issues/6233 for missing afl\n  - libfuzzer\n  - honggfuzz\nbuilds_per_day: 2\nauto_ccs:\n  - \"damjan.jov@gmail.com\"\n  - \"noelgrandin@gmail.com\"\n  - \"sbergman@redhat.com\"\nmain_repo: 'https://git.libreoffice.org/core'\n"
  },
  {
    "path": "projects/libressl/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! Project pinned after a clang update and an afl link error. Log: https://oss-fuzz-gcb-logs.storage.googleapis.com/log-db180642-1ff0-4223-91e6-3bf060adb174.txt\n\nRUN apt-get update && apt-get install -y make cmake wget autoconf automake libtool bison flex texinfo lzip\nRUN git clone --depth 1 https://github.com/libressl/portable.git libressl\nRUN git clone --depth 1 https://github.com/libressl/fuzz.git libressl.fuzzers\nRUN wget https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\nWORKDIR libressl\nRUN ./update.sh\nCOPY build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/libressl/bignum.options",
    "content": "[libfuzzer]\nmax_len = 2048\n"
  },
  {
    "path": "projects/libressl/build.sh",
    "content": "#!/bin/bash -eux\n#\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_84_0.tar.bz2\ncd boost_1_84_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\ncp -R boost/ /usr/include/\n\nmkdir -p $WORK/libressl\ncd $WORK/libressl\n\nCMAKE_DEFINES=\"\"\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n  CMAKE_DEFINES+=\" -DOPENSSL_NO_ASM=1\"\nfi\n\ncmake -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \\\n      -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n      $CMAKE_DEFINES $SRC/libressl/\nmake -j$(nproc)\n\nLIBRESSL_FUZZERS=$SRC/libressl.fuzzers\nfuzzerFiles=$(find $LIBRESSL_FUZZERS -name \"*.c\" | egrep -v 'driver.c|test-corpus.c')\n\nfind . -name \"*.a\"\n\n$CC -c $CFLAGS \\\n    -o $WORK/driver.o \\\n    $LIBRESSL_FUZZERS/driver.c \\\n    -I $SRC/libressl/include -I $SRC/libressl\n\nfor F in $fuzzerFiles; do\n  fuzzerName=$(basename $F .c)\n  echo \"Building fuzzer $fuzzerName\"\n  $CC -c $CFLAGS \\\n      -o $WORK/${fuzzerName}.o \\\n      $F -I $SRC/libressl/include -I $SRC/libressl\n\n  $CXX $CXXFLAGS \\\n      -o $OUT/${fuzzerName} -fsanitize-recover=address \\\n      $WORK/driver.o $WORK/${fuzzerName}.o ./ssl/libssl.a ./crypto/libcrypto.a ./tls/libtls.a $LIB_FUZZING_ENGINE\n\n  if [ -d \"$LIBRESSL_FUZZERS/corpora/${fuzzerName}/\" ]; then\n    zip -j $OUT/${fuzzerName}_seed_corpus.zip $LIBRESSL_FUZZERS/corpora/${fuzzerName}/*\n  fi\ndone\n\ncp $SRC/*.options $OUT/\ncp $LIBRESSL_FUZZERS/oids.txt $OUT/asn1.dict\ncp $LIBRESSL_FUZZERS/oids.txt $OUT/x509.dict\n\n"
  },
  {
    "path": "projects/libressl/project.yaml",
    "content": "homepage: \"https://www.libressl.org/\"\nlanguage: c++\nprimary_contact: \"busterb@gmail.com\"\nauto_ccs:\n - \"beck@obtuse.com\"\n - \"theorbuehler@gmail.com\"\n - \"joel.sing@gmail.com\"\n - \"kinichiro.inoguchi@gmail.com\"\n - \"ted.unangst@gmail.com\"\n - \"miwaxe@gmail.com\"\n - \"guidovranken@gmail.com\"\nsanitizers:\n - address\n - undefined\nmain_repo: 'https://github.com/libressl/portable.git'\n"
  },
  {
    "path": "projects/librosa/project.yaml",
    "content": "homepage: \"https://librosa.org/doc/latest/index.html\"\nlanguage: python\nprimary_contact: \"brian.mcfee@nyu.edu\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/librosa/librosa.git\"\n"
  },
  {
    "path": "projects/librsvg/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nENV RUSTUP_TOOLCHAIN=nightly-2025-09-15\n\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install --no-install-recommends -y \\\n        gperf \\\n        pkg-config && \\\n    apt-get clean && \\\n    rm -rf /var/lib/apt/lists/*\nRUN pip3 install --disable-pip-version-check --no-cache-dir \\\n        pip==25.1.1\nRUN pip3 install --disable-pip-version-check --no-cache-dir \\\n        meson==1.8.2 \\\n        ninja==1.11.1.4 \\\n        packaging==25.0\n\n# We have to compile various dependencies because the distro does not have recent enough\n# versions of packages like Pango. Manual compilation also makes it easier to use static linking:\n# https://google.github.io/oss-fuzz/further-reading/fuzzer-environment/\n\nRUN git clone --depth=1 --no-tags https://gitlab.gnome.org/GNOME/librsvg.git\nRUN git clone --depth=1 --branch=2.85.2 https://gitlab.gnome.org/GNOME/glib.git\nRUN git clone --depth=1 --branch=VER-2-13-3 https://gitlab.freedesktop.org/freetype/freetype.git\nRUN git clone --depth=1 --branch=v2.14.5 https://gitlab.gnome.org/GNOME/libxml2.git\nRUN git clone --depth=1 --branch=2.17.1 https://gitlab.freedesktop.org/fontconfig/fontconfig.git\nRUN git clone --depth=1 --branch=1.18.4 https://gitlab.freedesktop.org/cairo/cairo.git\nRUN git clone --depth=1 --branch=11.3.2 https://github.com/harfbuzz/harfbuzz.git\nRUN git clone --depth=1 --branch=1.56.4 https://gitlab.gnome.org/GNOME/pango.git\n\nRUN git clone --depth=1 --no-tags https://github.com/google/fuzzing.git\n\nCOPY build.sh *.options \"$SRC/\"\n\nWORKDIR \"$SRC/librsvg\"\n"
  },
  {
    "path": "projects/librsvg/build.sh",
    "content": "#!/bin/bash\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -o errexit\nset -o pipefail\nset -o nounset\n\nPREFIX=\"/usr\"\n\n# The OSS-Fuzz 'compile' script automatically adds instrumentation flags to the CFLAGS and CXXFLAGS\n# environment variables. These flags cause build errors with some of the third-party dependencies,\n# so we save them for restoration later.\nCFLAGS_SAVE=\"$CFLAGS\"\nCXXFLAGS_SAVE=\"$CXXFLAGS\"\n\n# Set the non-instrumentation flags manually. -O1 is particularly important for avoiding spurious\n# timeouts caused by unoptimized dependencies.\nexport CFLAGS=\"-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\"\nexport CXXFLAGS=\"$CFLAGS $CXXFLAGS_EXTRA\"\n\n# Compile and install GLib\ncd \"$SRC/glib\"\nmeson setup --prefix=\"$PREFIX\" --buildtype=plain --default-library=static builddir -Dman-pages=disabled -Dtests=false -Dsysprof=disabled\nninja -C builddir\nninja -C builddir install\n\n# Compile and install FreeType\ncd \"$SRC/freetype\"\nmeson setup --prefix=\"$PREFIX\" --buildtype=plain --default-library=static builddir\nninja -C builddir\nninja -C builddir install\n\n# Compile and install libxml2\ncd \"$SRC/libxml2\"\nmeson setup --prefix=\"$PREFIX\" --buildtype=plain --default-library=static builddir\nninja -C builddir\nninja -C builddir install\n\n# Compile and install Fontconfig\ncd \"$SRC/fontconfig\"\nmeson setup --prefix=\"$PREFIX\" --buildtype=plain --default-library=static builddir -Dtests=disabled -Dtools=disabled\nninja -C builddir\nninja -C builddir install\n\n# Compile and install Cairo\ncd \"$SRC/cairo\"\nmeson setup --prefix=\"$PREFIX\" --buildtype=plain --default-library=static builddir -Dpixman:tests=disabled -Dtests=disabled\nninja -C builddir\nninja -C builddir install\n\n# Compile and install HarfBuzz\ncd \"$SRC/harfbuzz\"\nmeson setup --prefix=\"$PREFIX\" --buildtype=plain --default-library=static builddir -Ddocs=disabled -Dtests=disabled\nninja -C builddir\nninja -C builddir install\n\n# Compile and install Pango\ncd \"$SRC/pango\"\nmeson setup --prefix=\"$PREFIX\" --buildtype=plain --default-library=static builddir -Dbuild-examples=false -Dbuild-testsuite=false\nninja -C builddir\nninja -C builddir install\n\n# Restore the compiler flag environment variables\nexport CFLAGS=\"${CFLAGS_SAVE}\"\nexport CXXFLAGS=\"${CXXFLAGS_SAVE}\"\n\n# Compile and copy the fuzz target(s)\ncd \"$SRC/librsvg\"\n\ncargo fuzz build -O\ncp target/x86_64-unknown-linux-gnu/release/render_document \"$OUT/\"\n\n# Copy options files for fuzz targets\ncp \"$SRC\"/*.options \"$OUT/\"\n\n# Create dictionary files for fuzz targets\ncat \"$SRC/fuzzing/dictionaries/\"{css,svg,xml}.dict > \"$OUT/render_document.dict\"\n\n# Build a seed corpus consisting of all the SVGs from the librsvg repo\nCORPUS_DIR=\"$WORK/corpus\"\nmkdir -p \"$CORPUS_DIR\"\n\nFILES=$(find \"$SRC/librsvg\" -type f -iname \"*.svg\")\nfor file in $FILES; do\n  cp \"$file\" \"$CORPUS_DIR/$(md5sum \"$file\" | cut -f 1 -d ' ').svg\"\ndone\n\nzip -r \"$OUT/render_document_seed_corpus.zip\" \"$CORPUS_DIR\"/*\n"
  },
  {
    "path": "projects/librsvg/project.yaml",
    "content": "homepage: \"https://gitlab.gnome.org/GNOME/librsvg/\"\nlanguage: rust\nprimary_contact: \"federico.mena@gmail.com\"\nauto_ccs:\n  - \"correctmost@gmail.com\"\nmain_repo: \"https://gitlab.gnome.org/GNOME/librsvg.git\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\ncoverage_extra_args: >\n  -ignore-filename-regex=rust/.*\n  -ignore-filename-regex=rustc/.*\n"
  },
  {
    "path": "projects/librsvg/render_document.options",
    "content": "# Suppress spurious leak reports:\n# https://gnome.pages.gitlab.gnome.org/librsvg/devel-docs/memory_leaks.html\n\n[asan]\ndetect_leaks = 0\n\n[libfuzzer]\ndetect_leaks = 0\n"
  },
  {
    "path": "projects/libsass/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/sass/libsass.git libsass\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY data_context_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/libsass/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd libsass\nexport BUILD='static'\nmake -j$(nproc)\npopd\n\nINSTALL_DIR=\"$SRC/libsass\"\n\n$CXX $CXXFLAGS -I${INSTALL_DIR}/include data_context_fuzzer.cc \\\n  $LIB_FUZZING_ENGINE -o $OUT/data_context_fuzzer ${INSTALL_DIR}/lib/libsass.a\n"
  },
  {
    "path": "projects/libsass/data_context_fuzzer.cc",
    "content": "#include \"sass.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char* sass_data = (char*) malloc(sizeof(char) * size + 1);\n  if (sass_data == NULL) return 0;\n\n  memcpy(sass_data, data, size);\n  sass_data[size] = '\\0';\n\n  struct Sass_Data_Context* ctx = sass_make_data_context(sass_data);\n  if (ctx == NULL) {\n    free(sass_data);\n    return 0;\n  }\n\n  struct Sass_Options* options = sass_make_options();\n  if (options == NULL) {\n    sass_delete_data_context(ctx);\n    return 0;\n  }\n\n  sass_option_set_output_style(options, SASS_STYLE_NESTED);\n  sass_option_set_precision(options, 5);\n\n  sass_data_context_set_options(ctx, options);\n  sass_compile_data_context(ctx);\n\n  sass_delete_data_context(ctx);\n  sass_delete_options(options);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libsass/project.yaml",
    "content": "homepage: \"http://libsass.org/\"\nlanguage: c++\nprimary_contact: \"xzyfer@gmail.com\"\n\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\n\nlabels:\n  data_context_fuzzer:\n    - sundew\nmain_repo: 'https://github.com/sass/libsass.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libsndfile/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/libsndfile/libsndfile.git /src/libsndfile\n\nWORKDIR $SRC/libsndfile\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libsndfile/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the OSS-Fuzz script in the project.\napt-get update\n./ossfuzz/ossfuzz.sh\n\n# To make CIFuzz fast, see here for details: https://github.com/libsndfile/libsndfile/pull/796\nfor fuzzer in sndfile_alt_fuzzer sndfile_fuzzer; do\n  echo \"[libfuzzer]\" > ${OUT}/${fuzzer}.options\n  echo \"close_fd_mask = 3\" >> ${OUT}/${fuzzer}.options\ndone\n"
  },
  {
    "path": "projects/libsndfile/project.yaml",
    "content": "homepage: \"https://github.com/libsndfile/libsndfile\"\nprimary_contact: \"evpobr@gmail.com\"\nlanguage: c\nauto_ccs:\n  - \"cmeister2@gmail.com\"\n  - \"erikd@mega-nerd.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\ncoverage_extra_args: -ignore-filename-regex=/usr/lib/jvm/.*\nmain_repo: 'https://github.com/libsndfile/libsndfile.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libsodium/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/jedisct1/libsodium.git --branch stable libsodium\nWORKDIR libsodium\nCOPY run_tests.sh build.sh *.cc *.h $SRC/\n"
  },
  {
    "path": "projects/libsodium/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\n./configure --enable-static LDFLAGS=\"$CXXFLAGS\"\nmake -j$(nproc) all\n\n# build fuzzers\nfor f in $SRC/*_fuzzer.cc; do\n    fuzzer=$(basename \"$f\" _fuzzer.cc)\n    $CXX $CXXFLAGS -std=c++11 -I\"$SRC/libsodium/src/libsodium/include\" \\\n         \"$f\" -o \"$OUT/${fuzzer}_fuzzer\" \\\n         \"$SRC/libsodium/src/libsodium/.libs/libsodium.a\" $LIB_FUZZING_ENGINE\ndone\n"
  },
  {
    "path": "projects/libsodium/fake_random.h",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef FAKE_RANDOM_H_\n#define FAKE_RANDOM_H_\n\n#include <sodium.h>\n#include <assert.h>\n#include <stdint.h>\n#include <string.h>\n#include <algorithm>\n\nstatic const unsigned char * SEED_DATA;\nstatic size_t SEED_SIZE;\n\nstatic const char *\nfake_implementation_name(void) {\n  return \"fake_random\";\n}\n\nstatic void\nfake_random_buffer(void * const buf, const size_t size) {\n  static unsigned char seed[randombytes_SEEDBYTES];\n  memset(seed, '0', randombytes_SEEDBYTES);\n\n  size_t boundary = std::min((size_t) randombytes_SEEDBYTES, SEED_SIZE);\n  memcpy(&seed, SEED_DATA, boundary);\n\n  randombytes_buf_deterministic(buf, size, seed);\n}\n\nstruct randombytes_implementation fake_random = {\n  .implementation_name = fake_implementation_name,\n  .random = NULL,\n  .stir = NULL,\n  .uniform = NULL,\n  .buf = fake_random_buffer,\n  .close = NULL\n};\n\nvoid\nsetup_fake_random(const unsigned char * seed, const size_t seed_size) {\n  SEED_DATA = seed;\n  SEED_SIZE = seed_size;\n\n  int fake_random_set = randombytes_set_implementation(&fake_random);\n  assert(fake_random_set == 0);\n\n  assert(strcmp(randombytes_implementation_name(), \"fake_random\") == 0);\n  int initialized = sodium_init();\n  assert(initialized >= 0);\n}\n\n#endif // FAKE_RANDOM_H_\n"
  },
  {
    "path": "projects/libsodium/project.yaml",
    "content": "homepage: \"https://libsodium.org\"\nlanguage: c++\nprimary_contact: \"ossfuzzz@gmail.com\"\nauto_ccs:\n - \"chriswwolfe@gmail.com\"\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/jedisct1/libsodium.git'\n"
  },
  {
    "path": "projects/libsodium/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd $SRC/libsodium\nASAN_OPTIONS=detect_leaks=0 make check\n"
  },
  {
    "path": "projects/libsodium/secret_key_auth_fuzzer.cc",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <assert.h>\n#include <stdlib.h>\n#include <sodium.h>\n\n#include \"fake_random.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size) {\n  int initialized = sodium_init();\n  assert(initialized >= 0);\n\n  setup_fake_random(data, size);\n\n  unsigned char key[crypto_auth_KEYBYTES];\n  unsigned char mac[crypto_auth_BYTES];\n\n  // this uses a deterministic generator\n  crypto_auth_keygen(key);\n\n  crypto_auth(mac, data, size, key);\n  int err = crypto_auth_verify(mac, data, size, key);\n  assert(err == 0);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libsodium/secretbox_easy_fuzzer.cc",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <assert.h>\n#include <stdlib.h>\n#include <sodium.h>\n\n#include \"fake_random.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size) {\n  int initialized = sodium_init();\n  assert(initialized >= 0);\n\n  setup_fake_random(data, size);\n\n  unsigned char key[crypto_secretbox_KEYBYTES];\n  unsigned char nonce[crypto_secretbox_NONCEBYTES];\n\n  // these use a deterministic generator\n  crypto_secretbox_keygen(key);\n  randombytes_buf(nonce, sizeof nonce);\n\n  size_t ciphertext_len = crypto_secretbox_MACBYTES + size;\n  unsigned char *ciphertext = (unsigned char *) malloc(ciphertext_len);\n\n  crypto_secretbox_easy(ciphertext, data, size, nonce, key);\n\n  unsigned char *decrypted = (unsigned char *) malloc(size);\n  int err = crypto_secretbox_open_easy(decrypted, ciphertext, ciphertext_len, nonce, key);\n  assert(err == 0);\n\n  free((void *) ciphertext);\n  free((void *) decrypted);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libsoup/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y python3-pip ninja-build libbrotli-dev libkrb5-dev libnghttp2-dev libpsl-dev libidn2-dev libsqlite3-dev\nRUN pip3 install --root-user-action=ignore --break-system-packages meson\n\n# version in 20.04 is too old.\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/glib.git --branch=glib-2-82 && \\\n  meson setup _build glib --prefix=/usr -Ddefault_library=static -Dtests=false && \\\n  meson install -C _build && \\\n  rm -rf glib _build\n\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libsoup.git && sed -i -e \"s/version : glib_required_version/version : glib_required_version, static: true/\" -e \"s/subdir('examples')//\" libsoup/meson.build\nWORKDIR libsoup\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libsoup/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMESON_SANITIZER_ARG=\n\nif [ \"$SANITIZER\" = \"address\" ] || [ \"$SANITIZER\" = \"undefined\" ]; then\n    MESON_SANITIZER_ARG=\"-Db_sanitize=$SANITIZER\"\nfi\n\nmeson setup \"$WORK\" --wipe --buildtype=debug -Db_lundef=false -Dtls_check=false -Dsysprof=disabled -Dfuzzing=enabled -Dprefer_static=true -Ddefault_library=static -Dintrospection=disabled -Ddocs=disabled -Dtests=false $MESON_SANITIZER_ARG\nmeson compile -C \"$WORK\"\n\nfind \"$WORK/fuzzing\" -perm /a+x -type f -exec cp {} \"$OUT\" \\;\nfind \"$SRC/libsoup/fuzzing\" -name '*.dict' -exec cp {} \"$OUT\" \\;\n"
  },
  {
    "path": "projects/libsoup/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://libsoup.gnome.org\"\nlanguage: c++\nprimary_contact: \"tngpng@gmail.com\"\nauto_ccs:\n  - \"pgriffis@igalia.com\"\n  - \"mcatanzaro@redhat.com\"\n  - \"philip.withnall@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n  - afl\n# FIXME: honggfuzz fails and centipede hangs\nmain_repo: 'https://gitlab.gnome.org/GNOME/libsoup.git'"
  },
  {
    "path": "projects/libspdm/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n#ENV http_proxy 'http://proxy.example.com:80/'\n#ENV https_proxy 'https://proxy.example.com:80/'\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n#RUN git config --global http.proxy http://proxy.example.com:80/\n#RUN git config --global https.proxy https://proxy.example.com:80/\nRUN git clone --depth 1 https://github.com/DMTF/libspdm.git libspdm && cd libspdm && git submodule update --init    # or use other version control\nCOPY run_tests.sh build.sh $SRC/\nWORKDIR $SRC/libspdm\n"
  },
  {
    "path": "projects/libspdm/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir build\npushd build\ncmake -DARCH=x64 -DTOOLCHAIN=LIBFUZZER -DTARGET=Release -DCRYPTO=mbedtls -DGCOV=ON ..\nmake copy_sample_key -j$(nproc)\nmake -j$(nproc)\ncp -r ./bin/* $OUT\npopd\n\n# build unit testing that requires different TOOLCHAIN\n# Unset CFLAGS that incompatible with unit testing build\nunset CFLAGS\nmkdir build-test\npushd build-test\ncmake -DARCH=x64 -DTOOLCHAIN=\"CLANG\" -DTARGET=Release -DCRYPTO=mbedtls ..\nmake -j$(nproc)\npopd\n\n# Prepare sample key and unit testing binary\nmkdir $SRC/unit_testing\ncp -r $SRC/libspdm/unit_test/sample_key/* $SRC/unit_testing/\ncp $SRC/libspdm/build-test/bin/* $SRC/unit_testing/\n"
  },
  {
    "path": "projects/libspdm/project.yaml",
    "content": "homepage: \"https://github.com/DMTF/libspdm\"\nlanguage: c\nprimary_contact: \"zhiqiang.zhao@intel.com\"\nauto_ccs:\n  - \"jiewen.yao@intel.com\"\n  - \"wenxing.hou@intel.com\"\n  - \"hanx.xiao@intel.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/DMTF/libspdm.git\""
  },
  {
    "path": "projects/libspdm/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/unit_testing\n\n# Run all unit testing (excluding failing one\n./test_crypt && ./test_spdm_common && ./test_spdm_crypt && \\\n./test_spdm_requester && ./test_spdm_responder && ./test_spdm_secured_message\n\n# Failing unit testing for reference\n# ./test_spdm_fips && ./test_spdm_sample\n\n"
  },
  {
    "path": "projects/libspectre/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n\nRUN apt-get update && \\\n    apt-get install -y pkg-config make automake libtool wget\n\nRUN git clone --depth 1 https://gitlab.freedesktop.org/libspectre/libspectre.git\n\nRUN wget -O $SRC/libspectre/ghostscript-9.53.3.tar.gz https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/ghostscript-9.53.3.tar.gz\nRUN tar xvzf $SRC/libspectre/ghostscript-9.53.3.tar.gz --directory $SRC/libspectre/\nRUN mv $SRC/libspectre/ghostscript-9.53.3 $SRC/libspectre/ghostscript\n\nWORKDIR $SRC/libspectre/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libspectre/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project\n$SRC/libspectre/test/ossfuzz.sh\n"
  },
  {
    "path": "projects/libspectre/project.yaml",
    "content": "homepage: \"https://www.freedesktop.org/wiki/Software/libspectre/\"\nlanguage: c++\nprimary_contact: \"tsdgeos@gmail.com\"\nauto_ccs:\n  - \"randy440088@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://gitlab.freedesktop.org/libspectre/libspectre.git'\n"
  },
  {
    "path": "projects/libspng/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n\nRUN apt-get update && \\\n    apt-get install -y wget tar cmake\n\nRUN git clone --depth 1 https://github.com/randy408/libspng.git\nRUN git clone --depth 1 https://github.com/google/fuzzer-test-suite\nRUN git clone https://github.com/madler/zlib $SRC/zlib\n\nWORKDIR libspng\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libspng/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project\n$SRC/libspng/tests/ossfuzz.sh\n"
  },
  {
    "path": "projects/libspng/project.yaml",
    "content": "homepage: \"https://libspng.org\"\nlanguage: c++\nprimary_contact: \"randy408@protonmail.com\"\nauto_ccs:\n  - \"randy440088@gmail.com\"\narchitectures:\n  - x86_64\n  - i386\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/randy408/libspng.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libsrtp/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y sudo autoconf build-essential libssl-dev pkg-config\n\nRUN git clone --depth 1 https://github.com/cisco/libsrtp\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libsrtp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/libsrtp\nautoreconf -ivf\n./configure --with-crypto-library=internal\nLIBFUZZER=\"$LIB_FUZZING_ENGINE\" make srtp-fuzzer\nmake test\nzip -r srtp-fuzzer_seed_corpus.zip fuzzer/corpus\ncp $SRC/libsrtp/fuzzer/srtp-fuzzer $OUT\ncp srtp-fuzzer_seed_corpus.zip $OUT\n"
  },
  {
    "path": "projects/libsrtp/project.yaml",
    "content": "homepage: \"https://github.com/cisco/libsrtp\"\nlanguage: c++\nprimary_contact: \"richbarn@cisco.com\"\nauto_ccs:\n - \"guidovranken@gmail.com\"\nsanitizers:\n - address\n - memory\narchitectures:\n - x86_64\n - i386\nmain_repo: 'https://github.com/cisco/libsrtp'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libsrtp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd $SRC/libsrtp\n  make runtest\npopd\n"
  },
  {
    "path": "projects/libssh/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake zlib1g-dev libssl-dev libcmocka0 libcmocka-dev\n\nRUN git clone --depth=1 https://git.libssh.org/projects/libssh.git\n\nWORKDIR libssh\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libssh/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBUILD=$WORK/build\nmkdir -p $BUILD\n\n# Fix deadlock in ssh_scp_fuzzer: the server thread blocks in\n# ssh_handle_key_exchange and pthread_join waits forever because the\n# sockets are only closed after the join. Shut them down first.\nSCP_FUZZER=\"$SRC/libssh/tests/fuzz/ssh_scp_fuzzer.c\"\nif [ -f \"$SCP_FUZZER\" ]; then\n    sed -i 's/^cleanup_thread:/cleanup_thread:\\n    shutdown(socket_fds[0], SHUT_RDWR);\\n    shutdown(socket_fds[1], SHUT_RDWR);/' \"$SCP_FUZZER\"\nfi\n\npushd $BUILD\nCFLAGS=\"$CFLAGS -Wno-error=declaration-after-statement\"\ncmake -DCMAKE_C_COMPILER=\"$CC\" -DCMAKE_CXX_COMPILER=\"$CXX\" \\\n    -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n    -DBUILD_SHARED_LIBS=OFF -DWITH_INSECURE_NONE=ON -DWITH_EXEC=OFF \\\n    -DUNIT_TESTING=ON -DWITH_EXAMPLES=OFF $SRC/libssh\nmake \"-j$(nproc)\"\n\n# Build the shared mock server object (needed by ssh_scp_fuzzer)\nMOCK_SRC=\"$SRC/libssh/tests/fuzz/ssh_server_mock.c\"\nif [ -f \"$MOCK_SRC\" ]; then\n    $CC $CFLAGS -I$SRC/libssh/include/ -I$SRC/libssh/src/ -I$BUILD/ -I$BUILD/include/ \\\n        -c \"$MOCK_SRC\" -O0 -g\nfi\n\nfuzzers=$(find $SRC/libssh/tests/fuzz/ -name \"*_fuzzer.c\")\nfor f in $fuzzers; do\n    fuzzerName=$(basename $f .c)\n    echo \"Building fuzzer $fuzzerName\"\n    $CC $CFLAGS -I$SRC/libssh/include/ -I$SRC/libssh/src/ -I$BUILD/ -I$BUILD/include/ \\\n        -c \"$f\" -O0 -g\n\n    # Check if this fuzzer needs ssh_server_mock\n    if [ \"$fuzzerName\" = \"ssh_scp_fuzzer\" ] || [ \"$fuzzerName\" = \"ssh_sftp_fuzzer\" ]; then\n        echo \"Linking $fuzzerName with ssh_server_mock\"\n        $CXX $CXXFLAGS $fuzzerName.o ssh_server_mock.o \\\n            -o \"$OUT/$fuzzerName\" -O0 -g \\\n            $LIB_FUZZING_ENGINE ./src/libssh.a -Wl,-Bstatic -lcrypto -lz -Wl,-Bdynamic -lpthread\n    else\n        $CXX $CXXFLAGS $fuzzerName.o \\\n            -o \"$OUT/$fuzzerName\" -O0 -g \\\n            $LIB_FUZZING_ENGINE ./src/libssh.a -Wl,-Bstatic -lcrypto -lz -Wl,-Bdynamic\n    fi\n\n    if [ -d \"$SRC/libssh/tests/fuzz/${fuzzerName}_corpus\" ]; then\n        zip -j $OUT/${fuzzerName}_seed_corpus.zip $SRC/libssh/tests/fuzz/${fuzzerName}_corpus/*\n        cp $OUT/${fuzzerName}_seed_corpus.zip $OUT/${fuzzerName}_nalloc_seed_corpus.zip\n    fi\n\n    cp $OUT/${fuzzerName} $OUT/${fuzzerName}_nalloc\ndone\n\npopd\n"
  },
  {
    "path": "projects/libssh/project.yaml",
    "content": "homepage: \"https://libssh.org/\"\nlanguage: c\nprimary_contact: \"asn@cryptomilk.org\"\nauto_ccs:\n - \"cryptomilk@gmail.com\"\n - \"jakuje@gmail.com\"\n - \"norbertpocs0@gmail.com\"\n - \"arthur.chan@adalogics.com\"\n - \"david@adalogics.com\"\n - \"adam@adalogics.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: 'https://git.libssh.org/projects/libssh.git'\n"
  },
  {
    "path": "projects/libssh/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd /work/build\nmake test\n"
  },
  {
    "path": "projects/libssh2/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/libssh2/libssh2.git /src/libssh2\n\nWORKDIR $SRC/libssh2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libssh2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\napt-get update\n# Run the OSS-Fuzz script in the project.\n./tests/ossfuzz/ossfuzz.sh\n"
  },
  {
    "path": "projects/libssh2/project.yaml",
    "content": "homepage: \"https://github.com/libssh2/libssh2\"\nlanguage: c++\nprimary_contact: \"will.cosgrove@gmail.com\"\nauto_ccs:\n  - \"cmeister2@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/libssh2/libssh2.git'\n"
  },
  {
    "path": "projects/libstdcpp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN sed -i -e 's/^# deb-src/deb-src/g' /etc/apt/sources.list\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN apt build-dep -y g++-10\nRUN git clone --depth 1 git://gcc.gnu.org/git/gcc.git libstdcpp\nWORKDIR libstdcpp\nCOPY build.sh $SRC/\nADD https://raw.githubusercontent.com/pauldreik/stdfuzz/main/format/one-arg.cpp $SRC/\n"
  },
  {
    "path": "projects/libstdcpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nSRCDIR=$SRC/libstdcpp\nBUILDDIR=$OUT/build.d\nINSTALLDIR=$OUT/install.d\nmkdir -p $BUILDDIR $INSTALLDIR\n\n(\n    cd $BUILDDIR\n    CXX= CC= CXXFLAGS= CFLAGS= $SRCDIR/configure \\\n       --disable-bootstrap \\\n       --prefix=$INSTALLDIR \\\n       --enable-languages=c++\n    make -j$(nproc)\n    make -j$(nproc) install-target-libstdc++-v3\n)\n\nfor fuzzsrcfile in /src/*.cpp; do\n    targetfile=$(basename $fuzzsrcfile .cpp)\n    $CXX \\\n\t$CXXFLAGS \\\n\t-std=c++20 \\\n\t-nostdinc++ \\\n\t-cxx-isystem $( echo $INSTALLDIR/include/c++/*/ ) \\\n\t-cxx-isystem $( echo $INSTALLDIR/include/c++/*/x86_64-pc-linux-gnu ) \\\n\t$fuzzsrcfile \\\n\t-o $OUT/$targetfile \\\n\t$LIB_FUZZING_ENGINE \\\n\t$INSTALLDIR/lib64/libstdc++.a\ndone\n\n"
  },
  {
    "path": "projects/libstdcpp/project.yaml",
    "content": "homepage: \"https://gcc.gnu.org/\"\nlanguage: c++\nprimary_contact: \"pauldreikossfuzz@gmail.com\"\nauto_ccs:\n - \"jwakely.gcc@gmail.com\"\nmain_repo: \"git://gcc.gnu.org/git/gcc.git\"\nfile_github_issue: false\narchitectures:\n - x86_64\nsanitizers:\n - address\n - undefined\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n# - centipede\n"
  },
  {
    "path": "projects/libtasn1/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool bison\n\nRUN git clone git://git.savannah.gnu.org/gnulib.git\nENV GNULIB_TOOL=$SRC/gnulib/gnulib-tool\nENV GNULIB_SRCDIR=$SRC/gnulib\n\nRUN git clone https://gitlab.com/gnutls/libtasn1.git\n\nWORKDIR libtasn1\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libtasn1/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./bootstrap\n# switch off leak detection for ./configure run to detect iconv() correctly\nASAN_OPTIONS=detect_leaks=0 ./configure --enable-static --disable-shared --disable-doc --disable-gcc-warnings --enable-fuzzing\nmake clean\nmake -j$(nproc) -C lib\nmake -j$(nproc) -C src\nmake -j$(nproc) -C tests check\n\ncd fuzz\nmake oss-fuzz\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'\n\nfor dir in *_fuzzer.in; do\n  fuzzer=$(basename $dir .in)\n  zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n"
  },
  {
    "path": "projects/libtasn1/project.yaml",
    "content": "homepage: \"https://gitlab.com/gnutls/libtasn1\"\nlanguage: c++\nprimary_contact: \"rockdaboot@gmail.com\"\nauto_ccs:\n  - \"dbaryshkov@gmail.com\"\n  - \"ueno@gnu.org\"\n  - \"simon@josefsson.org\"\nfuzzing_engines:\n  - afl\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://gitlab.com/gnutls/libtasn1.git'\n"
  },
  {
    "path": "projects/libtasn1/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check -C tests -j$(nproc)\n"
  },
  {
    "path": "projects/libteken/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y pmake\nRUN svn co https://svn.freebsd.org/base/head/sys/teken libteken\nWORKDIR libteken\nCOPY build.sh libteken_fuzzer.c $SRC/\n"
  },
  {
    "path": "projects/libteken/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build the library.\npmake -C libteken teken_state.h\n\nexport CFLAGS=\"$CFLAGS -D__unused=\"\n$CC $CFLAGS -c teken.c -o teken.o -I./libteken\nar -q libteken.a ./teken.o\nranlib libteken.a\n\n$CC $CFLAGS -c $SRC/libteken_fuzzer.c -o $SRC/libteken_fuzzer.o -I.\n$CXX $CXXFLAGS $SRC/libteken_fuzzer.o \\\n    -o $OUT/libteken_fuzzer \\\n    $LIB_FUZZING_ENGINE libteken.a\n"
  },
  {
    "path": "projects/libteken/libteken_fuzzer.c",
    "content": "#include <stdint.h>\n#include <stdio.h>\n\n#include <teken.h>\n\nstatic void dummy_bell(void *s) {}\nstatic void dummy_cursor(void *s, const teken_pos_t *p) {}\nstatic void dummy_putchar(void *s, const teken_pos_t *p, teken_char_t c,\n                          const teken_attr_t *a) {}\nstatic void dummy_fill(void *s, const teken_rect_t *r, teken_char_t c,\n                       const teken_attr_t *a) {}\nstatic void dummy_copy(void *s, const teken_rect_t *r, const teken_pos_t *p) {}\nstatic void dummy_param(void *s, int cmd, unsigned int value) {}\nstatic void dummy_respond(void *s, const void *buf, size_t len) {}\n\nstatic teken_funcs_t tf = {\n    .tf_bell = dummy_bell,\n    .tf_cursor = dummy_cursor,\n    .tf_putchar = dummy_putchar,\n    .tf_fill = dummy_fill,\n    .tf_copy = dummy_copy,\n    .tf_param = dummy_param,\n    .tf_respond = dummy_respond,\n};\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  teken_t t = { 0 };\n  teken_init(&t, &tf, NULL);\n  teken_input(&t, data, size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libteken/project.yaml",
    "content": "homepage: \"http://svn.freebsd.org/base/head/sys/teken/\"\nlanguage: c++\nprimary_contact: \"ed@nuxi.nl\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'http://svn.freebsd.org/base/head/sys/teken/'\n"
  },
  {
    "path": "projects/libtheora/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/ogg.git\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/theora.git libtheora\nRUN git clone --depth 1 https://github.com/tmatth/oss-fuzz-fuzzers.git\nRUN git clone --depth 1 https://github.com/fuzzamos/fuzzing-headers.git\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libtheora/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [[ $CFLAGS = *sanitize=address* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DASAN\"\nfi\n\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\nmkdir $SRC/libogg-install/\ncd $SRC/ogg\n./autogen.sh\n./configure --prefix=\"$SRC/libogg-install\" --enable-static --disable-shared --disable-crc\nmake -j$(nproc)\nmake install\n\ncd $SRC/fuzzing-headers/\nrm -rf /usr/include/fuzzing\ncp -R include/fuzzing/ /usr/include/\n\ncd $SRC/libtheora/\n# patch configure since the baseimage is using an older autoconf\nsed -i 's/AC_PREREQ(\\[[^]]*\\])/AC_PREREQ([2.60])/' configure.ac\n./autogen.sh\n\nif [[ $CFLAGS = *sanitize=memory* || $CFLAGS = *-m32* ]]\nthen\n    LD_LIBRARY_PATH=\"$SRC/libogg-install/lib\" ./configure --with-ogg=\"$SRC/libogg-install\" --disable-encode --disable-examples --disable-asm --enable-static --disable-shared\nelse\n    LD_LIBRARY_PATH=\"$SRC/libogg-install/lib\" ./configure --with-ogg=\"$SRC/libogg-install\" --disable-encode --disable-examples --enable-static --disable-shared\nfi\n\nmake -j$(nproc)\n\ncd $SRC/oss-fuzz-fuzzers/libtheora/\n\n$CXX $CXXFLAGS -I $SRC/libtheora/include/ -I $SRC/libogg-install/include fuzzer.cpp $SRC/libtheora/lib/.libs/libtheora.a $LIB_FUZZING_ENGINE -o $OUT/fuzzer-decoder\n"
  },
  {
    "path": "projects/libtheora/project.yaml",
    "content": "homepage: \"https://www.theora.org/\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://git.xiph.org/theora.git\"\nauto_ccs:\n  - \"le.businessman@gmail.com\"\nvendor_ccs:\n - \"daede003@umn.edu\"\n - \"twsmith@mozilla.com\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n - x86_64\n - i386\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libtiff/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool cmake nasm\nRUN git clone --depth 1 https://gitlab.com/libtiff/libtiff\nRUN git clone --depth 1 https://github.com/madler/zlib\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo\nRUN git clone https://www.cl.cam.ac.uk/~mgk25/git/jbigkit\nADD https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz afl_testcases.tgz\nADD https://raw.githubusercontent.com/google/AFL/debe27037b9444bbf090a0ffbd5d24889bb887ae/dictionaries/tiff.dict tiff.dict\nWORKDIR libtiff\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libtiff/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n. contrib/oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/libtiff/project.yaml",
    "content": "homepage: \"http://www.libtiff.org\"\nlanguage: c++\nprimary_contact: \"even.rouault@gmail.com\"\nauto_ccs:\n  - paul.l.kehrer@gmail.com\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://gitlab.com/libtiff/libtiff'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libtiff/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake test\n"
  },
  {
    "path": "projects/libtorrent/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget libssl-dev libboost-tools-dev libboost-dev libboost-system-dev\n\nRUN git clone --depth 1 --single-branch --branch RC_2_0 --recurse-submodules https://github.com/arvidn/libtorrent.git\nWORKDIR libtorrent\nCOPY build.sh $SRC/\n\n"
  },
  {
    "path": "projects/libtorrent/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"CXX=$CXX\"\necho \"CXXFLAGS=$CXXFLAGS\"\n\necho \"using clang : ossfuzz : $CXX : <compileflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"$CXXFLAGS\\\" <linkflags>\\\"${LIB_FUZZING_ENGINE}\\\" ;\" >project-config.jam\ncat project-config.jam\ncd fuzzers\n# we don't want sanitizers enabled on b2 itself\nASAN_OPTIONS=detect_leaks=0 b2 clang-ossfuzz -j$(nproc) crypto=openssl fuzz=external sanitize=off stage-large logging=off\ncp fuzzers/* $OUT\n\nwget --no-verbose https://github.com/arvidn/libtorrent/releases/download/2.0/corpus.zip\nunzip -q corpus.zip\ncd corpus\nfor f in *; do\nzip -q -r ${OUT}/fuzzer_${f}_seed_corpus.zip ${f}\ndone\n"
  },
  {
    "path": "projects/libtorrent/project.yaml",
    "content": "homepage: \"https://github.com/arvidn/libtorrent.git\"\nlanguage: c++\nprimary_contact: \"pauldreikossfuzz@gmail.com\"\nauto_ccs:\n - \"oss-fuzz-libtorrent@pauldreik.se\"\n - \"arvid.norberg@gmail.com\"\nmain_repo: 'https://github.com/arvidn/libtorrent.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/libtpms/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN \\\n        apt-get update && \\\n        apt-get install -y \\\n        make autoconf automake libtool \\\n        libstdc++-9-dev \\\n        libseccomp-dev pkg-config && \\\n        apt-get remove -y libssl-dev || true\n\n# Build OpenSSL 3.x from source (libtpms requires OpenSSL 3.0+ APIs)\n# Use no-shared to build static libraries only for proper fuzzer linking\nRUN git clone --depth 1 --branch openssl-3.0 https://github.com/openssl/openssl.git /tmp/openssl && \\\n    cd /tmp/openssl && \\\n    ./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib/x86_64-linux-gnu no-shared && \\\n    make -j$(nproc) && \\\n    make install_sw install_ssldirs && \\\n    rm -rf /tmp/openssl\n\nRUN git clone --depth 1 https://github.com/stefanberger/libtpms libtpms\nWORKDIR libtpms\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libtpms/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Fix include path for generated headers (tpm_library.h is generated in builddir)\n# Also add libtpms subdir for relative includes within the headers\nsed -i 's|AM_CFLAGS = -I$(top_srcdir)/include|AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/include/libtpms|' tests/Makefile.am\n\ntests/oss-fuzz.sh\n"
  },
  {
    "path": "projects/libtpms/project.yaml",
    "content": "homepage: \"https://github.com/stefanberger/libtpms\"\nlanguage: c++\nprimary_contact: \"stefanb@us.ibm.com\"\nauto_ccs:\n  - \"mlureau@redhat.com\"\nmain_repo: 'https://github.com/stefanberger/libtpms'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libtsm/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config\n\nRUN git clone --depth 1 git://people.freedesktop.org/~dvdhrm/libtsm\nWORKDIR libtsm\nCOPY build.sh libtsm_fuzzer.c $SRC/\n"
  },
  {
    "path": "projects/libtsm/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build the library.\n./autogen.sh\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n# build your fuzzer(s)\n$CC $CFLAGS -c $SRC/libtsm_fuzzer.c -Isrc/tsm -o $SRC/libtsm_fuzzer.o\n$CXX $CXXFLAGS \\\n    -o $OUT/libtsm_fuzzer \\\n    $SRC/libtsm_fuzzer.o \\\n    .libs/libtsm.a \\\n    $LIB_FUZZING_ENGINE\n"
  },
  {
    "path": "projects/libtsm/libtsm_fuzzer.c",
    "content": "// Copyright 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"libtsm.h\"\n\n#define WIDTH 80\n#define HEIGHT 24\n\nstatic void terminal_write_fn(struct tsm_vte *vte,\n\t\t\t      const char *u8,\n\t\t\t      size_t len,\n\t\t\t      void *data)\n{\n  // try to access the written data\n  static char out[4096];\n  while (len--)\n    out[len % sizeof(out)] = u8[len];\n}\n\nstatic int term_draw_cell(struct tsm_screen *screen, uint32_t id,\n                          const uint32_t *ch, size_t len,\n                          unsigned int cwidth, unsigned int posx,\n                          unsigned int posy,\n                          const struct tsm_screen_attr *attr,\n                          tsm_age_t age, void *data)\n{\n  if (posx >= WIDTH || posy >= HEIGHT)\n    abort();\n  return 0;\n}\n\n// Entry point for LibFuzzer.\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  struct tsm_screen *screen;\n  struct tsm_vte *vte;\n  const int scrollback_size = 200;  // frecon use 200\n\n  tsm_screen_new(&screen, NULL, NULL);\n  tsm_screen_set_max_sb(screen, scrollback_size);\n  tsm_vte_new(&vte, screen, terminal_write_fn, NULL, NULL, NULL);\n  tsm_screen_resize(screen, WIDTH, HEIGHT);\n\n  tsm_vte_input(vte, (const char*) data, size);\n  tsm_screen_draw(screen, term_draw_cell, NULL);\n\n  tsm_vte_unref(vte);\n  tsm_screen_unref(screen);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libtsm/project.yaml",
    "content": "homepage: \"https://www.freedesktop.org/wiki/Software/kmscon/libtsm/\"\nlanguage: c++\nprimary_contact: \"dh.herrmann@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'git://people.freedesktop.org/~dvdhrm/libtsm'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libucl/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake pkg-config libtool automake texinfo\nRUN cd /tmp && wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz && \\\n    tar xzf autoconf-2.71.tar.gz && cd autoconf-2.71 && \\\n    ./configure && make && make install && cd / && rm -rf /tmp/autoconf-2.71*\nRUN git clone https://github.com/vstakhov/libucl\n\nWORKDIR $SRC/libucl\n\nCOPY build.sh run_tests.sh $SRC/\nCOPY ucl_add_string_fuzzer.options $SRC/ucl_add_string_fuzzer.options\n"
  },
  {
    "path": "projects/libucl/build.sh",
    "content": "#!/bin/bash -eux\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/ucl_add_string_fuzzer.options $OUT/\n\n./autogen.sh --force && ./configure\nmake\n\n$CC $CFLAGS -c tests/fuzzers/ucl_add_string_fuzzer.c \\\n  -DHAVE_CONFIG_H -I./src -I./include src/.libs/libucl.a -I./ \\\n  -o $OUT/ucl_add_string_fuzzer.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $OUT/ucl_add_string_fuzzer.o -DHAVE_CONFIG_H -I./src -I./include src/.libs/libucl.a -I. -o $OUT/ucl_add_string_fuzzer\n"
  },
  {
    "path": "projects/libucl/project.yaml",
    "content": "homepage: \"https://github.com/vstakhov/libucl\"\nprimary_contact: \"vsevolod@highsecure.ru\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nlanguage: c\nmain_repo: 'https://github.com/vstakhov/libucl'\n"
  },
  {
    "path": "projects/libucl/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nmake check -C tests -j$(nproc)\n"
  },
  {
    "path": "projects/libucl/ucl_add_string_fuzzer.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/libultrahdr/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget cmake\nRUN git clone https://github.com/google/libultrahdr.git\nCOPY build.sh $SRC/\nWORKDIR libultrahdr\n"
  },
  {
    "path": "projects/libultrahdr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project.\n$SRC/libultrahdr/fuzzer/ossfuzz.sh\n"
  },
  {
    "path": "projects/libultrahdr/project.yaml",
    "content": "homepage: \"https://github.com/google/libultrahdr\"\nlanguage: c++\nprimary_contact: \"dichenzhang@google.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined:\n     experimental: True\nauto_ccs:\n  - arifdikici@google.com\n  - dichenzhang@google.com\n  - harish.mahendrakar@ittiam.com\n  - ram.mohan@ittiam.com\n  - umang.saini@ittiam.com\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/google/libultrahdr.git'\n"
  },
  {
    "path": "projects/libunwind/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/libunwind/libunwind libunwind\nWORKDIR libunwind\nCOPY run_tests.sh build.sh *.c $SRC/\n"
  },
  {
    "path": "projects/libunwind/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nautoreconf -i\n./configure --enable-shared=no --enable-static=yes\nmake\n$CC $CFLAGS $LIB_FUZZING_ENGINE -I./include -c $SRC/fuzz_libunwind.c \\\n    -o fuzz_libunwind.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_libunwind.o \\\n    ./src/.libs/libunwind-x86_64.a ./src/.libs/libunwind.a \\\n    -o $OUT/fuzz_libunwind\n"
  },
  {
    "path": "projects/libunwind/fuzz_libunwind.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * The main idea behind this fuzzer is the generate arbitrary stack traces\n * by way of recursive funcitons, and then using various calls to libunwind\n * apis arbitrarily.\n */\n#define UNW_LOCAL_ONLY\n#include <libunwind.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\nvoid get_random_reg(int);\nvoid get_proc_name();\nvoid dispatch(const uint8_t *data, size_t size);\nvoid check_is_signal();\nvoid get_save_loc(int reg);\nvoid recurse1(const uint8_t *data, size_t size);\nvoid recurse2(const uint8_t *data, size_t size);\nvoid recurse3(const uint8_t *data, size_t size);\nvoid recurse4(const uint8_t *data, size_t size);\n\nvoid get_save_loc(int regnum) {\n  unw_cursor_t cursor;\n  unw_context_t uc;\n  unw_word_t reference_reg;\n\n  unw_getcontext(&uc);\n  unw_init_local(&cursor, &uc);\n  unw_save_loc_t loc;\n  while (unw_step(&cursor) > 0) {\n    unw_get_save_loc(&cursor, regnum, &loc);\n  }\n}\n\nvoid get_random_reg(int regnum) {\n  unw_cursor_t cursor;\n  unw_context_t uc;\n  unw_word_t reference_reg;\n\n  unw_getcontext(&uc);\n  unw_init_local(&cursor, &uc);\n  while (unw_step(&cursor) > 0) {\n    unw_get_reg(&cursor, regnum, &reference_reg);\n  }\n}\n\nvoid check_is_signal() {\n  unw_cursor_t cursor;\n  unw_context_t uc;\n  unw_word_t reference_reg;\n\n  unw_getcontext(&uc);\n  unw_init_local(&cursor, &uc);\n  while (unw_step(&cursor) > 0) {\n    if (unw_is_signal_frame(&cursor)) {\n      return;\n    }\n  }\n}\n\nvoid get_proc_name() {\n  unw_cursor_t cursor;\n  unw_context_t uc;\n\n  unw_getcontext(&uc);\n  unw_init_local(&cursor, &uc);\n  while (unw_step(&cursor) > 0) {\n    unw_word_t offset;\n    char buf[512];\n    unw_get_proc_name(&cursor, buf, sizeof(buf), &offset);\n  }\n}\n\nvoid dispatch(const uint8_t *data, size_t size) {\n  if (size < 8) {\n    return;\n  }\n  uint8_t decider = data[0] % 4;\n  data += 2;\n  size -= 2;\n  if (decider == 0) {\n    recurse1(data, size);\n  } else if (decider == 1) {\n    recurse2(data, size);\n  } else if (decider == 2) {\n    recurse3(data, size);\n  } else {\n    recurse4(data, size);\n  }\n}\n\nvoid recurse1(const uint8_t *data, size_t size) {\n  if (data[0] == 0x01) {\n    get_proc_name();\n  }\n  data += 2;\n  size -= 2;\n\n  dispatch(data, size);\n  return;\n}\n\nvoid recurse2(const uint8_t *data, size_t size) {\n  if (data[0] == 0x01) {\n    get_random_reg((int)data[1]);\n  }\n  data += 2;\n  size -= 2;\n\n  dispatch(data, size);\n  return;\n}\n\nvoid recurse3(const uint8_t *data, size_t size) {\n  if (data[0] == 0x01) {\n    check_is_signal((int)data[1]);\n  }\n  data += 2;\n  size -= 2;\n\n  dispatch(data, size);\n  return;\n}\n\nvoid recurse4(const uint8_t *data, size_t size) {\n  if (data[0] == 0x01) {\n    get_save_loc((int)data[1]);\n  }\n  data += 2;\n  size -= 2;\n\n  dispatch(data, size);\n  return;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Ensure we have a bit of data but not too much to cause stackoverflows.\n  if (size < 12 || size > 512) {\n    return 0;\n  }\n\n  dispatch(data, size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libunwind/project.yaml",
    "content": "homepage: \"https://www.nongnu.org/libunwind/\"\nlanguage: c\nmain_repo: \"https://github.com/libunwind/libunwind\"\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/libunwind/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Only include tests that are not failing\nTESTS=\"test-strerror\ntest-proc-info\ntest-static-link\ntest-flush-cache\nGtest-bt\nLtest-init\nLtest-varargs\nLtest-sig-context\ntest-init-remote\nLtest-bt\nLtest-init-local-signal\nGtest-init\nGtest-resume-sig\nLtest-resume-sig-rt\ntest-reg-state\nLx64-test-dwarf-expressions\nGtest-sig-context\nLtest-exc\ntest-setjmp\nGx64-test-dwarf-expressions\nGtest-exc\nx64-unwind-badjmp-signal-frame\nGtest-resume-sig-rt\nLtest-resume-sig\nGtest-concurrent\nLtest-concurrent\nLrs-race\ntest-ptrace\ntest-async-sig\"\n\n# Temporarily disabled failing unit test cases\nDISABLED_TESTS=\"Ltest-nomalloc\nGtest-trace\ntest-mem\nLtest-trace\nLtest-nocalloc\nSKIP: run-coredump-unwind\ncheck-namespace.sh\nrun-ptrace-mapper\nrun-ptrace-misc\"\n\n# Run unit testing that are success\nmake check -j$(nproc) TESTS=\"$TESTS\"\n"
  },
  {
    "path": "projects/libusb/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool libudev-dev libumockdev-dev\nRUN git clone --depth 1 https://github.com/libusb/libusb libusb\nWORKDIR libusb\nCOPY build.sh *.cc $SRC/\n"
  },
  {
    "path": "projects/libusb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\n./autogen.sh\n./configure\nmake -j$(nproc) all\n\n# build fuzzer\nfor fuzzer in $(find $SRC -name '*_fuzzer.cc'); do\n    fuzzer_basename=$(basename -s .cc $fuzzer)\n    $CXX $CXXFLAGS -std=c++17 -I. \\\n    $fuzzer $LIB_FUZZING_ENGINE ./libusb/.libs/libusb-1.0.a \\\n    -lpthread -ludev \\\n    -o $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/libusb/libusb_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <algorithm>\n#include <cstddef>\n#include <cstdint>\n\n#include \"libusb/libusb.h\"\n#include \"libusb/libusbi.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  struct libusb_transfer *transfer = NULL;\n  FuzzedDataProvider stream(data, size);\n  uint8_t bmRequestType = stream.ConsumeIntegral<uint8_t>();\n  uint8_t bRequest = stream.ConsumeIntegral<uint8_t>();\n  uint16_t wValue = stream.ConsumeIntegral<uint16_t>();\n  uint16_t wIndex = stream.ConsumeIntegral<uint16_t>();\n  uint16_t wLength = stream.ConsumeIntegral<uint16_t>();\n  std::string input = stream.ConsumeRandomLengthString();\n  const char *d = input.c_str();\n\n  transfer = libusb_alloc_transfer(0);\n  if (!transfer) {\n    return LIBUSB_ERROR_NO_MEM;\n  }\n\n  libusb_fill_control_setup((unsigned char *)d, bmRequestType, bRequest, wValue, wIndex, wLength);\n\n  // Cleanup. \n  // We cannot call libusb_free_transfer as no callbacks has occurred. Calling\n  // libusb_free_transfer without this will trigger false positive errors.\n  struct usbi_transfer *itransfer = LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n  usbi_mutex_destroy(&itransfer->lock);\n  size_t priv_size = PTR_ALIGN(usbi_backend.transfer_priv_size);\n  unsigned char *ptr = (unsigned char *)itransfer - priv_size;\n  free(ptr);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libusb/project.yaml",
    "content": "homepage: \"http://libusb.info/\"\nlanguage: c++\nprimary_contact: \"christopher.a.dickens@gmail.com\"\nauto_ccs:\n  - \"hjelmn@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/libusb/libusb'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libvips/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y \\\n  automake \\\n  autopoint \\\n  cmake \\\n  curl \\\n  gettext \\\n  glib2.0-dev \\\n  libbrotli-dev \\\n  libexpat1-dev \\\n  libfftw3-dev \\\n  libtool \\\n  nasm \\\n  python3-pip\nRUN pip3 install meson ninja\nRUN mkdir afl-testcases\nRUN curl https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz | tar xzC afl-testcases\nRUN mkdir pdfium-latest\nRUN curl -L https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-linux-x64.tgz | tar xzC pdfium-latest\nRUN git clone --depth 1 https://github.com/libvips/libvips.git\nRUN git clone --depth 1 https://github.com/madler/zlib.git\nRUN git clone --depth 1 https://github.com/libexif/libexif.git\nRUN git clone --depth 1 https://github.com/mm2/Little-CMS.git lcms\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git\nRUN git clone --depth 1 https://github.com/pnggroup/libpng.git\nRUN git clone --depth 1 https://chromium.googlesource.com/webm/libwebp\nRUN git clone --depth 1 https://gitlab.com/libtiff/libtiff.git\nRUN git clone --depth 1 https://aomedia.googlesource.com/aom\nRUN git clone --depth 1 https://github.com/strukturag/libheif.git\nRUN git clone --depth 1 https://github.com/libjxl/libjxl.git\nRUN git clone --depth 1 https://github.com/lovell/libimagequant.git\nRUN git clone --depth 1 https://github.com/dloebl/cgif.git\nRUN git clone --depth 1 https://github.com/google/highway.git\nRUN git clone --depth 1 https://github.com/google/libultrahdr.git\n\nWORKDIR libvips\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libvips/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./fuzz/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/libvips/project.yaml",
    "content": "homepage: \"https://github.com/libvips/libvips\"\nlanguage: c++\nbase_os_version: ubuntu-24-04\nprimary_contact: \"jcupitt@gmail.com\"\nauto_ccs:\n  - \"kleisauke@gmail.com\"\n  - \"lovell.fuller@gmail.com\"\n  - \"dloebl.2000@gmail.com\"\nmain_repo: 'https://github.com/libvips/libvips'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\ncoverage_extra_args: -sources src/libvips\n"
  },
  {
    "path": "projects/libvnc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake zlib1g-dev\nRUN git clone --depth 1 https://github.com/LibVNC/libvncserver.git\nWORKDIR $SRC/libvncserver\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libvnc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir build\ncd build\ncmake -DWITH_TESTS=ON -DBUILD_SHARED_LIBS=OFF ..\ncmake --build .\ncp fuzz* $OUT/\n\n# Adds simple corpus and dictionary\necho \"RFB 003.008\" > rfb_corpus\nzip -r $OUT/fuzz_server_seed_corpus.zip rfb_corpus\necho \"\\\"RFB \\\"\" > $OUT/fuzz_server.dict\n"
  },
  {
    "path": "projects/libvnc/project.yaml",
    "content": "homepage: \"https://libvnc.github.io/\"\nlanguage: c++\nprimary_contact: \"dontmind@sdf.org\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n  - \"info@christianbeier.net\"\n  - \"christian.cb.beier@gmail.com\"\nmain_repo: 'https://github.com/LibVNC/libvncserver.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/libvpx/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y yasm wget gcc\nRUN git clone https://chromium.googlesource.com/webm/libvpx\nADD https://storage.googleapis.com/downloads.webmproject.org/test_data/fuzzer/vpx_fuzzer_seed_corpus.zip $SRC/\nCOPY build.sh vpx_dec_fuzzer.dict $SRC/\nWORKDIR libvpx\n"
  },
  {
    "path": "projects/libvpx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build libvpx\nbuild_dir=$WORK/build\nrm -rf ${build_dir}\nmkdir -p ${build_dir}\npushd ${build_dir}\n\n# oss-fuzz has 2 GB total memory allocation limit. So, we limit per-allocation\n# limit in libvpx to 1 GB to avoid OOM errors. A smaller per-allocation is\n# needed for MemorySanitizer (see bug oss-fuzz:9497 and bug oss-fuzz:9499).\nif [[ $CFLAGS = *sanitize=memory* ]]; then\n  extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=536870912'\n  # MemorySanitizer requires that all program code is instrumented.\n  # Disable all assembly code, leaving the optimizations implemented with\n  # compiler intrinsics, to improve sanitizer performance and coverage.\n  extra_configure_flags=(--disable-x86-asm)\nelse\n  extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=1073741824'\n  extra_configure_flags=()\nfi\n\nLDFLAGS=\"$CXXFLAGS\" LD=$CXX $SRC/libvpx/configure \\\n    --enable-vp9-highbitdepth \\\n    --disable-unit-tests \\\n    --disable-examples \\\n    --size-limit=12288x12288 \\\n    --extra-cflags=\"${extra_c_flags}\" \\\n    --disable-webm-io \\\n    --enable-debug \\\n    --enable-vp8-encoder \\\n    --enable-vp9-encoder \\\n    \"${extra_configure_flags[@]}\"\nmake -j$(nproc) all\npopd\n\n# build fuzzers\nfuzzer_src_name=vpx_dec_fuzzer\nfuzzer_decoders=( 'vp9' 'vp8' )\nfor decoder in \"${fuzzer_decoders[@]}\"; do\n  fuzzer_name=${fuzzer_src_name}\"_\"${decoder}\n\n  $CXX $CXXFLAGS -std=c++11 \\\n    -DDECODER=${decoder} \\\n    -I$SRC/libvpx \\\n    -I${build_dir} \\\n    -Wl,--start-group \\\n    $LIB_FUZZING_ENGINE \\\n    $SRC/libvpx/examples/${fuzzer_src_name}.cc -o $OUT/${fuzzer_name} \\\n    ${build_dir}/libvpx.a \\\n    -Wl,--end-group\n  cp $SRC/vpx_fuzzer_seed_corpus.zip $OUT/${fuzzer_name}_seed_corpus.zip\n  cp $SRC/vpx_dec_fuzzer.dict $OUT/${fuzzer_name}.dict\n  cp $OUT/${fuzzer_name} $OUT/${fuzzer_name}_nalloc\ndone\n\nfuzzer_src_name=vpx_enc_fuzzer\nfuzzer_encoders=( 'vp9' 'vp8' )\nfor encoder in \"${fuzzer_encoders[@]}\"; do\n  fuzzer_name=${fuzzer_src_name}\"_\"${encoder}\n\n  $CXX $CXXFLAGS -std=c++11 \\\n    -DENCODER=${encoder} \\\n    -I$SRC/libvpx \\\n    -I${build_dir} \\\n    -Wl,--start-group \\\n    $LIB_FUZZING_ENGINE \\\n    $SRC/libvpx/examples/${fuzzer_src_name}.cc -o $OUT/${fuzzer_name} \\\n    ${build_dir}/libvpx.a \\\n    -Wl,--end-group\n  cp $OUT/${fuzzer_name} $OUT/${fuzzer_name}_nalloc\ndone\n"
  },
  {
    "path": "projects/libvpx/project.yaml",
    "content": "homepage: \"https://www.webmproject.org\"\nlanguage: c++\nprimary_contact: \"jzern@google.com\"\nsanitizers:\n- address\n- memory\n- undefined\nauto_ccs:\n- jianj@google.com\n- jingning@google.com\n- jzern@google.com\n- wtc@google.com\nvendor_ccs:\n- \"media-alerts@mozilla.com\"\n- \"twsmith@mozilla.com\"\n- \"product-security@apple.com\"\n- \"dkishore@apple.com\"\n- \"phan@apple.com\"\n- \"ebanniettis@apple.com\"\n- \"jm.park@apple.com\"\n- \"james_e_kim@apple.com\"\n- \"rding23@apple.com\"\n- \"albassam@apple.com\"\n- \"youenn@apple.com\"\n- \"ddkilzer@apple.com\"\n- \"zakr@apple.com\"\n- \"roberto_rodriguez2@apple.com\"\n- \"k_monsen@apple.com\"\n- \"nnothstine@apple.com\"\nmain_repo: 'https://chromium.googlesource.com/webm/libvpx'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/libvpx/vpx_dec_fuzzer.dict",
    "content": "# IVF Signature + version (bytes 0-5)\nkw1=\"DKIF\\x00\\x00\"\n\n# VP9 codec fourCC (bytes 8-11)\nkw2=\"VP90\"\n\n# VP8 codec fourCC (bytes 8-11)\nkw3=\"VP80\"\n"
  },
  {
    "path": "projects/libwebp/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf make libgif-dev libjpeg-dev libpng-dev libtool zip\nRUN git clone https://chromium.googlesource.com/webm/libwebp\nRUN git clone https://chromium.googlesource.com/webm/libwebp-test-data\nADD https://storage.googleapis.com/downloads.webmproject.org/webp/testdata/fuzzer/fuzz_seed_corpus.zip $SRC/\nRUN unzip fuzz_seed_corpus.zip -d libwebp-test-data/\nRUN rm fuzz_seed_corpus.zip\nCOPY build.sh $SRC/\nWORKDIR libwebp\n"
  },
  {
    "path": "projects/libwebp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash tests/fuzzer/oss-fuzz/build.sh\n\n# show content of $OUT/ for sanity checking\nfind $OUT/\n"
  },
  {
    "path": "projects/libwebp/project.yaml",
    "content": "homepage: \"https://developers.google.com/speed/webp/\"\nlanguage: c++\nprimary_contact: \"jzern@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n  - memory\nauto_ccs:\n  - pascal.massimino@gmail.com\n  - vrabaud@google.com\n  - yguyon@google.com\nvendor_ccs:\n  - aosmond@mozilla.com\n  - tnikkel@mozilla.com\n  - twsmith@mozilla.com\nmain_repo: 'https://chromium.googlesource.com/webm/libwebp'\n"
  },
  {
    "path": "projects/libwebsockets/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y libssl-dev\n\nRUN git clone --depth 1 https://github.com/warmcat/libwebsockets.git\nCOPY run_tests.sh build.sh $SRC/\nCOPY lws_upng_inflate_fuzzer.cpp $SRC/libwebsockets/\nWORKDIR $SRC/libwebsockets\n"
  },
  {
    "path": "projects/libwebsockets/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nDIR=$SRC/libwebsockets/\n\ncd $DIR\nsed -i 's/-Werror//g' ./CMakeLists.txt\nmkdir build && cd build\ncmake -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n      -DCMAKE_EXE_LINKER_FLAGS=\"$CFLAGS\" -DCMAKE_SHARED_LINKER_FLAGS=\"$CFLAGS\" ..\nmake -j8\n\ncd $DIR\n$CXX $CFLAGS $LIB_FUZZING_ENGINE -I$DIR/build/include \\\n\t-o $OUT/lws_upng_inflate_fuzzer lws_upng_inflate_fuzzer.cpp \\\n\t-L$DIR/build/lib -l:libwebsockets.a \\\n\t-L/usr/lib/x86_64-linux-gnu/ -l:libssl.so -l:libcrypto.so\n"
  },
  {
    "path": "projects/libwebsockets/lws_upng_inflate_fuzzer.cpp",
    "content": "// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/*\n * This fuzzer is generated by UTopia project based on TEST(Test_Tensorflow,\n * read_inception). (UTopia Project: https://github.com/Samsung/UTopia)\n */\n#include \"libwebsockets.h\"\n#include <fuzzer/FuzzedDataProvider.h>\n\nstatic void lws_api_test_gunzip(FuzzedDataProvider &provider) {\n  int result = 0;\n  struct inflator_ctx *gunz = nullptr;\n  const uint8_t *outring;\n  size_t outringlen, *opl, *cl = 0;\n  auto input1 = provider.ConsumeRandomLengthString();\n\n  gunz = lws_upng_inflator_create(&outring, &outringlen, &opl, &cl);\n  if (!gunz)\n    goto bail;\n\n  lws_upng_inflate_data(gunz, input1.c_str(), input1.size());\n\nbail:\n  if (gunz)\n    lws_upng_inflator_destroy(&gunz);\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, uint32_t size) {\n  FuzzedDataProvider provider(data, size);\n  auto select = provider.ConsumeIntegralInRange<unsigned char>(0, 1);\n  switch (select) {\n  case 0:\n    lws_api_test_gunzip(provider);\n    break;\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libwebsockets/project.yaml",
    "content": "homepage: \"https://libwebsockets.org\"\nlanguage: c\nprimary_contact: \"andy.warmcat.com@googlemail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n- libfuzzer\nmain_repo: 'https://libwebsockets.org/repo/libwebsockets'\n"
  },
  {
    "path": "projects/libwebsockets/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# The ss-tf unit test is failing from the latest build thus excluded\n# The other unit tests are excluded because they require network connection which are not possible in run_tests.sh environment\nctest --test-dir $SRC/libwebsockets/build -E \"warmcat|ss-smd|ss-tf|mss-lws-minimal-ss-hello_world|api-test-secure-streams\"\n"
  },
  {
    "path": "projects/libxaac/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget cmake\nRUN git clone https://github.com/ittiam-systems/libxaac.git\nADD https://storage.googleapis.com/android_media/external/libxaac/fuzzer/xaac_dec_fuzzer_seed_corpus.zip $SRC/\nCOPY build.sh $SRC/\nWORKDIR libxaac\n"
  },
  {
    "path": "projects/libxaac/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project.\n$SRC/libxaac/fuzzer/ossfuzz.sh\n"
  },
  {
    "path": "projects/libxaac/project.yaml",
    "content": "homepage: \"https://github.com/ittiam-systems/libxaac\"\nlanguage: c++\nprimary_contact: \"harish.mahendrakar@ittiam.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nauto_ccs:\n  - akshay.ragir@ittiam.com\n  - divya.bm@ittiam.com\n  - harish.mahendrakar@ittiam.com\n  - reshma.rai@ittiam.com\n  - saketh.sathuvalli@ittiam.com\n  - sandesh.venkatesh@ittiam.com\n  - shashank.pathmudi@ittiam.com\n  - shreyas.talwekar@ittiam.com\n  - tripti.tiwari@ittiam.com\n  - yash.patil@ittiam.com\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/ittiam-systems/libxaac.git'\n"
  },
  {
    "path": "projects/libxls/Dockerfile",
    "content": "# Copyright 2019 Evan Miller\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf autoconf-archive automake gettext libtool\n\nRUN git clone --depth 1 https://github.com/libxls/libxls libxls\nWORKDIR libxls\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libxls/build.sh",
    "content": "# Copyright 2019 Evan Miller\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#!/bin/bash -eu\n\nif [ -f ./autogen.sh ]; then\n  ./autogen.sh\nelse\n  ./bootstrap\nfi\n./configure --enable-static\nmake clean\n\nmake\n\nzip $OUT/fuzz_xls_seed_corpus.zip test/files/*.xls fuzz/corpus/*.xls\n\nmake fuzz_xls\ncp fuzz_xls $OUT/fuzz_xls\n"
  },
  {
    "path": "projects/libxls/project.yaml",
    "content": "homepage: \"https://github.com/libxls/libxls\"\nlanguage: c++\nprimary_contact: \"emmiller@gmail.com\"\nmain_repo: 'https://github.com/libxls/libxls'\n"
  },
  {
    "path": "projects/libxls/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nASAN_OPTIONS=detect_leaks=0 make check\n"
  },
  {
    "path": "projects/libxlsxwriter/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake make zlib1g-dev\nRUN python3 -m pip install pytest\n\nRUN git clone --depth 1 https://github.com/jmcnamara/libxlsxwriter.git libxlsxwriter\nWORKDIR libxlsxwriter\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libxlsxwriter/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run upstream build script for fuzzers and unit test\nsh ./dev/fuzzing/build.sh\n"
  },
  {
    "path": "projects/libxlsxwriter/project.yaml",
    "content": "homepage: \"http://libxlsxwriter.github.io\"\nlanguage: c\nprimary_contact: \"jmcnamara@cpan.org\"\nauto_ccs:\n  - \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/jmcnamara/libxlsxwriter.git\"\n"
  },
  {
    "path": "projects/libxlsxwriter/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nctest --test-dir build -j$(nproc)\n"
  },
  {
    "path": "projects/libxml2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nARG TARGETPLATFORM\n\nRUN apt-get update && \\\n    case \"$TARGETPLATFORM\" in \\\n        'linux/arm64') EXTRA_PACKAGES='' ;; \\\n        *)             EXTRA_PACKAGES='zlib1g-dev:i386 liblzma-dev:i386' ;; \\\n    esac && \\\n    apt-get install -y --no-install-recommends \\\n        make autoconf libtool pkg-config \\\n        zlib1g-dev liblzma-dev \\\n        $EXTRA_PACKAGES\n# Build requires automake 1.16.3\nRUN curl -LO http://mirrors.kernel.org/ubuntu/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\n    apt install ./automake_1.16.5-1.3_all.deb\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git\nWORKDIR libxml2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libxml2/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/libxml2/project.yaml",
    "content": "homepage: \"https://gitlab.gnome.org/GNOME/libxml2\"\nlanguage: c++\nvendor_ccs:\n  - \"ddkilzer@apple.com\"\n  - \"benl@google.com\"\n  - \"product-security@apple.com\"\n  - \"dkishore@apple.com\"\n  - \"phan@apple.com\"\n  - \"ebanniettis@apple.com\"\n  - \"jm.park@apple.com\"\n  - \"james_e_kim@apple.com\"\n  - \"rding23@apple.com\"\n  - \"albassam@apple.com\"\n  - \"zakr@apple.com\"\n  - \"roberto_rodriguez2@apple.com\"\n  - \"k_monsen@apple.com\"\n  - \"nnothstine@apple.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\nmain_repo: 'https://gitlab.gnome.org/GNOME/libxml2.git'\n"
  },
  {
    "path": "projects/libxslt/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Note that we don't use the system libxml2 but a custom instrumented build.\n# libgcrypt is required for the crypto extensions of libexslt.\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    make autoconf libtool pkg-config \\\n    libgcrypt-dev\n# Build requires automake 1.16.3\nRUN curl -LO http://mirrors.kernel.org/ubuntu/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\n    apt install ./automake_1.16.5-1.3_all.deb\n# TODO: Update this when new releases are issued\n# to keep run_tests.sh working. The reason for this\n# is https://gitlab.gnome.org/GNOME/libxslt/-/issues/126#note_2273444\nENV LATEST_LIBXML2_RELEASE_TAG=v2.14.4\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git --branch=$LATEST_LIBXML2_RELEASE_TAG\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxslt.git\nWORKDIR libxslt\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libxslt/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" = undefined ]; then\n    export CFLAGS=\"$CFLAGS -fsanitize=integer -fno-sanitize-recover=integer\"\n    export CXXFLAGS=\"$CXXFLAGS -fsanitize=integer -fno-sanitize-recover=integer\"\nfi\n\nif [ \"$SANITIZER\" = memory ]; then\n    # This would require an instrumented libgcrypt build.\n    CRYPTO_CONF=--without-crypto\n    CRYPTO_LIBS=\nelse\n    CRYPTO_CONF=--with-crypto\n    CRYPTO_LIBS=-lgcrypt\nfi\n\ncd ../libxml2\n./autogen.sh \\\n    --disable-shared \\\n    --without-c14n \\\n    --without-push \\\n    --without-python \\\n    --without-reader \\\n    --without-regexps \\\n    --without-sax1 \\\n    --without-schemas \\\n    --without-schematron \\\n    --without-valid \\\n    --without-writer \\\n    --without-zlib \\\n    --without-lzma\nmake -j$(nproc) V=1\n\ncd ../libxslt\n./autogen.sh \\\n    --with-libxml-src=../libxml2 \\\n    --disable-shared \\\n    --without-python \\\n    $CRYPTO_CONF \\\n    --without-debug \\\n    --without-debugger \\\n    --without-profiler\nmake -j$(nproc) V=1\n\ncd tests/fuzz\nrm -rf seed\nmake fuzz.o\n\nfor fuzzer in xpath xslt; do\n    make $fuzzer.o\n    # Link with $CXX\n    $CXX $CXXFLAGS \\\n        $fuzzer.o fuzz.o \\\n        -o $OUT/$fuzzer \\\n        $LIB_FUZZING_ENGINE \\\n        ../../libexslt/.libs/libexslt.a ../../libxslt/.libs/libxslt.a \\\n        ../../../libxml2/.libs/libxml2.a \\\n        $CRYPTO_LIBS\n\n    [ -e seed/$fuzzer ] || make seed/$fuzzer.stamp\n    zip -j $OUT/${fuzzer}_seed_corpus.zip seed/$fuzzer/*\ndone\n\ncp *.dict $OUT/\n"
  },
  {
    "path": "projects/libxslt/project.yaml",
    "content": "homepage: \"http://www.xmlsoft.org/libxslt/\"\nlanguage: c++\nvendor_ccs:\n  - \"ddkilzer@apple.com\"\n  - \"product-security@apple.com\"\n  - \"schenney@chromium.org\"\n  - \"dkishore@apple.com\"\n  - \"phan@apple.com\"\n  - \"ebanniettis@apple.com\"\n  - \"jm.park@apple.com\"\n  - \"james_e_kim@apple.com\"\n  - \"rding23@apple.com\"\n  - \"albassam@apple.com\"\n  - \"zakr@apple.com\"\n  - \"roberto_rodriguez2@apple.com\"\n  - \"k_monsen@apple.com\"\n  - \"nnothstine@apple.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://gitlab.gnome.org/GNOME/libxslt.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libxslt/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/libxslt\nmake check\n"
  },
  {
    "path": "projects/libyal/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y make autoconf automake autopoint libtool pkg-config flex byacc\n\nRUN git clone --depth 1 https://github.com/libyal/libcaes.git libcaes\nRUN git clone --depth 1 https://github.com/libyal/libfcrypto.git libfcrypto\nRUN git clone --depth 1 https://github.com/libyal/libfmapi.git libfmapi\nRUN git clone --depth 1 https://github.com/libyal/libfmos.git libfmos\nRUN git clone --depth 1 https://github.com/libyal/libfplist.git libfplist\nRUN git clone --depth 1 https://github.com/libyal/libftxf.git libftxf\nRUN git clone --depth 1 https://github.com/libyal/libfusn.git libfusn\nRUN git clone --depth 1 https://github.com/libyal/libfwevt.git libfwevt\nRUN git clone --depth 1 https://github.com/libyal/libfwnt.git libfwnt\nRUN git clone --depth 1 https://github.com/libyal/libfwps.git libfwps\nRUN git clone --depth 1 https://github.com/libyal/libfwsi.git libfwsi\nRUN git clone --depth 1 https://github.com/libyal/libhmac.git libhmac\n\nRUN git clone --depth 1 https://github.com/libyal/libagdb.git libagdb\nRUN git clone --depth 1 https://github.com/libyal/libcreg.git libcreg\nRUN git clone --depth 1 https://github.com/libyal/libesedb.git libesedb\nRUN git clone --depth 1 https://github.com/libyal/libevt.git libevt\nRUN git clone --depth 1 https://github.com/libyal/libevtx.git libevtx\nRUN git clone --depth 1 https://github.com/libyal/libexe.git libexe\nRUN git clone --depth 1 https://github.com/libyal/liblnk.git liblnk\nRUN git clone --depth 1 https://github.com/libyal/libmdmp.git libmdmp\nRUN git clone --depth 1 https://github.com/libyal/libmsiecf.git libmsiecf\nRUN git clone --depth 1 https://github.com/libyal/libnk2.git libnk2\nRUN git clone --depth 1 https://github.com/libyal/libolecf.git libolecf\nRUN git clone --depth 1 https://github.com/libyal/libpff.git libpff\nRUN git clone --depth 1 https://github.com/libyal/libregf.git libregf\nRUN git clone --depth 1 https://github.com/libyal/libscca.git libscca\n\nRUN git clone --depth 1 https://github.com/libyal/libwrc.git libwrc\n\nRUN git clone --depth 1 https://github.com/libyal/libfsapfs.git libfsapfs\nRUN git clone --depth 1 https://github.com/libyal/libfsext.git libfsext\nRUN git clone --depth 1 https://github.com/libyal/libfsfat.git libfsfat\nRUN git clone --depth 1 https://github.com/libyal/libfshfs.git libfshfs\nRUN git clone --depth 1 https://github.com/libyal/libfsntfs.git libfsntfs\nRUN git clone --depth 1 https://github.com/libyal/libfsxfs.git libfsxfs\n\nRUN git clone --depth 1 https://github.com/libyal/libbde.git libbde\nRUN git clone --depth 1 https://github.com/libyal/libfvde.git libfvde\nRUN git clone --depth 1 https://github.com/libyal/libluksde.git libluksde\nRUN git clone --depth 1 https://github.com/libyal/libvsapm.git libvsapm\nRUN git clone --depth 1 https://github.com/libyal/libvsbsdl.git libvsbsdl\nRUN git clone --depth 1 https://github.com/libyal/libvsgpt.git libvsgpt\nRUN git clone --depth 1 https://github.com/libyal/libvshadow.git libvshadow\nRUN git clone --depth 1 https://github.com/libyal/libvslvm.git libvslvm\nRUN git clone --depth 1 https://github.com/libyal/libvsmbr.git libvsmbr\n\nRUN git clone --depth 1 https://github.com/libyal/libewf.git libewf\nRUN git clone --depth 1 https://github.com/libyal/libmodi.git libmodi\nRUN git clone --depth 1 https://github.com/libyal/libodraw.git libodraw\nRUN git clone --depth 1 https://github.com/libyal/libphdi.git libphdi\nRUN git clone --depth 1 https://github.com/libyal/libqcow.git libqcow\nRUN git clone --depth 1 https://github.com/libyal/libsmraw.git libsmraw\nRUN git clone --depth 1 https://github.com/libyal/libvhdi.git libvhdi\nRUN git clone --depth 1 https://github.com/libyal/libvmdk.git libvmdk\n\nWORKDIR libyal\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libyal/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfor PROJECT in ${SRC}/*;\ndo\n  PROJECT=$(basename ${PROJECT})\n\n  # A libyal project should have an ossfuzz directory and a synclibs.sh script.\n  if ! test -d ${SRC}/${PROJECT}/ossfuzz || ! test -x ${SRC}/${PROJECT}/synclibs.sh;\n  then\n    continue\n  fi\n  cd ${SRC}/${PROJECT}\n\n  # OSSFuzz base-image currently uses Ubuntu 20.04 which ships older versions\n  # of autoconf and gettext. The libyal projects are compatible with these\n  # older versions, but should not ship with them. The following edits will\n  # allow ./autogen.sh to generate the correct version for OSSFuzz.\n  sed 's/^AC_PREREQ.*$/AC_PREREQ([2.69])/' -i configure.ac\n  sed 's/^AM_GNU_GETTEXT_VERSION.*$/AM_GNU_GETTEXT_VERSION([0.19])/' -i configure.ac\n\n  # Prepare the project source for build.\n  ./synclibs.sh\n  ./autogen.sh\n  # OSSFuzz cross-compiles certain architectures which can lead to a partial\n  # installed dependencies.\n  ./configure --enable-shared=no --with-openssl=no --with-zlib=no\n\n  # Build the project and fuzzer binaries.\n  make -j$(nproc) LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE}\n\n  # Download the test data if supported.\n  if test -x ./synctestdata.sh;\n  then\n    ./synctestdata.sh\n  fi\n\n  # Copy the fuzzer binaries and test data to the output directory.\n  for FUZZ_TARGET in $(cd ossfuzz && find . -executable -type f);\n  do\n    FUZZ_TARGET=$(basename ${FUZZ_TARGET})\n\n    # Prefix the fuzzer binaries with the project name.\n    cp ossfuzz/${FUZZ_TARGET} ${OUT}/${PROJECT}_${FUZZ_TARGET}\n\n    # Download the test data if supported.\n    LIBYAL_TYPE_NAME=${FUZZ_TARGET/_fuzzer/};\n\n    if test -f tests/data/${LIBYAL_TYPE_NAME/}.1;\n    then\n      (cd tests/data && zip ${OUT}/${PROJECT}_${FUZZ_TARGET}_seed_corpus.zip ${LIBYAL_TYPE_NAME}.*)\n\n    elif test -d tests/input/public;\n    then\n      (cd tests/input/public && zip ${OUT}/${PROJECT}_${FUZZ_TARGET}_seed_corpus.zip *)\n\n    else\n      echo \"Missing test data for seed corpus.\"\n      exit 1\n    fi\n  done\ndone\n"
  },
  {
    "path": "projects/libyal/project.yaml",
    "content": "homepage: \"https://github.com/libyal\"\nlanguage: c\nprimary_contact: \"joachim.metz@gmail.com\"\nsanitizers:\n- address\n- memory\n- undefined\narchitectures:\n- x86_64\n- i386\nmain_repo: 'https://github.com/libyal/libfplist.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libyaml/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\nRUN git clone --depth=1 https://github.com/yaml/libyaml\nRUN zip $SRC/libyaml_seed_corpus.zip libyaml/examples/*\n\nWORKDIR libyaml\nCOPY run_tests.sh build.sh *.h *_fuzzer.c libyaml_fuzzer.options yaml.dict $SRC/\n"
  },
  {
    "path": "projects/libyaml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n./bootstrap\n./configure\nmake \"-j$(nproc)\"\n\nfor fuzzer in $SRC/*_fuzzer.c; do\n  fuzzer_basename=$(basename -s .c $fuzzer)\n\n  $CC $CFLAGS \\\n      -I $SRC -Iinclude \\\n      -c $fuzzer -o $fuzzer_basename.o\n\n  $CXX $CXXFLAGS \\\n      -std=c++11 \\\n      $fuzzer_basename.o \\\n      -o $OUT/$fuzzer_basename \\\n      $LIB_FUZZING_ENGINE \\\n      src/.libs/libyaml.a\n\n  cp $SRC/libyaml_seed_corpus.zip \"${OUT}/${fuzzer_basename}_seed_corpus.zip\"\n  cp $SRC/libyaml_fuzzer.options \"${OUT}/${fuzzer_basename}.options\"\ndone\n\ncp $SRC/yaml.dict $OUT/\n"
  },
  {
    "path": "projects/libyaml/libyaml_deconstructor_alt_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include \"yaml_write_handler.h\"\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 2)\n    return 0;\n\n  bool done = false;\n  bool is_canonical = data[0] & 1;\n  bool is_unicode = data[1] & 1;\n  data += 2;\n  size -= 2;\n\n  yaml_parser_t parser;\n  yaml_emitter_t emitter;\n  yaml_event_t input_event;\n  yaml_document_t output_document;\n\n  int root;\n\n  /* Initialize the parser and emitter objects. */\n\n  if (!yaml_parser_initialize(&parser)) {\n    return 1;\n  }\n\n  if (!yaml_emitter_initialize(&emitter)) {\n    yaml_parser_delete(&parser);\n    return 1;\n  }\n\n  /* Set the parser parameters. */\n\n  yaml_parser_set_input_string(&parser, data, size);\n\n  /* Set the emitter parameters. */\n  yaml_output_buffer_t out = {/*buf=*/NULL, /*size=*/0, /*capacity=*/1000};\n  yaml_emitter_set_output(&emitter, yaml_write_handler, &out);\n\n  yaml_emitter_set_canonical(&emitter, is_canonical);\n  yaml_emitter_set_unicode(&emitter, is_unicode);\n\n  /* Create and emit the STREAM-START event. */\n\n  if (!yaml_emitter_open(&emitter))\n    goto error;\n\n  /* Create a output_document object. */\n\n  if (!yaml_document_initialize(&output_document, NULL, NULL, NULL, 0, 0))\n    goto error;\n\n  /* Create the root sequence. */\n\n  root = yaml_document_add_sequence(&output_document, NULL,\n                                    YAML_BLOCK_SEQUENCE_STYLE);\n  if (!root)\n    goto error;\n\n  /* Loop through the input events. */\n\n  while (!done) {\n    int properties, key, value, map, seq;\n\n    /* Get the next event. */\n\n    if (!yaml_parser_parse(&parser, &input_event))\n      goto error;\n\n    /* Check if this is the stream end. */\n\n    done = (input_event.type == YAML_STREAM_END_EVENT);\n\n    /* Create a mapping node and attach it to the root sequence. */\n\n    properties = yaml_document_add_mapping(&output_document, NULL,\n                                           YAML_BLOCK_MAPPING_STYLE);\n    if (!properties)\n      goto error;\n    if (!yaml_document_append_sequence_item(&output_document, root, properties))\n      goto error;\n\n    /* Analyze the event. */\n\n    switch (input_event.type) {\n    case YAML_STREAM_START_EVENT:\n\n      /* Add 'type': 'STREAM-START'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"STREAM-START\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Add 'encoding': <encoding>. */\n\n      if (input_event.data.stream_start.encoding) {\n        yaml_encoding_t encoding = input_event.data.stream_start.encoding;\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"encoding\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(\n            &output_document, NULL,\n            (encoding == YAML_UTF8_ENCODING\n                 ? (yaml_char_t *)\"utf-8\"\n                 : encoding == YAML_UTF16LE_ENCODING\n                       ? (yaml_char_t *)\"utf-16-le\"\n                       : encoding == YAML_UTF16BE_ENCODING\n                             ? (yaml_char_t *)\"utf-16-be\"\n                             : (yaml_char_t *)\"unknown\"),\n            -1, YAML_PLAIN_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      break;\n\n    case YAML_STREAM_END_EVENT:\n\n      /* Add 'type': 'STREAM-END'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"STREAM-END\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      break;\n\n    case YAML_DOCUMENT_START_EVENT:\n\n      /* Add 'type': 'DOCUMENT-START'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"DOCUMENT-START\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Display the output_document version numbers. */\n\n      if (input_event.data.document_start.version_directive) {\n        yaml_version_directive_t *version =\n            input_event.data.document_start.version_directive;\n        char number[64];\n\n        /* Add 'version': {}. */\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"version\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        map = yaml_document_add_mapping(&output_document, NULL,\n                                        YAML_FLOW_MAPPING_STYLE);\n        if (!map)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, map))\n          goto error;\n\n        /* Add 'major': <number>. */\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"major\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        sprintf(number, \"%d\", version->major);\n        value = yaml_document_add_scalar(\n            &output_document, (yaml_char_t *)YAML_INT_TAG,\n            (yaml_char_t *)number, -1, YAML_PLAIN_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, map, key,\n                                               value))\n          goto error;\n\n        /* Add 'minor': <number>. */\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"minor\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        sprintf(number, \"%d\", version->minor);\n        value = yaml_document_add_scalar(\n            &output_document, (yaml_char_t *)YAML_INT_TAG,\n            (yaml_char_t *)number, -1, YAML_PLAIN_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, map, key,\n                                               value))\n          goto error;\n      }\n\n      /* Display the output_document tag directives. */\n\n      if (input_event.data.document_start.tag_directives.start !=\n          input_event.data.document_start.tag_directives.end) {\n        yaml_tag_directive_t *tag;\n\n        /* Add 'tags': []. */\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"tags\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        seq = yaml_document_add_sequence(&output_document, NULL,\n                                         YAML_BLOCK_SEQUENCE_STYLE);\n        if (!seq)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, seq))\n          goto error;\n\n        for (tag = input_event.data.document_start.tag_directives.start;\n             tag != input_event.data.document_start.tag_directives.end; tag++) {\n          /* Add {}. */\n\n          map = yaml_document_add_mapping(&output_document, NULL,\n                                          YAML_FLOW_MAPPING_STYLE);\n          if (!map)\n            goto error;\n          if (!yaml_document_append_sequence_item(&output_document, seq, map))\n            goto error;\n\n          /* Add 'handle': <handle>. */\n\n          key = yaml_document_add_scalar(&output_document, NULL,\n                                         (yaml_char_t *)\"handle\", -1,\n                                         YAML_PLAIN_SCALAR_STYLE);\n          if (!key)\n            goto error;\n          value = yaml_document_add_scalar(&output_document, NULL, tag->handle,\n                                           -1, YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n          if (!value)\n            goto error;\n          if (!yaml_document_append_mapping_pair(&output_document, map, key,\n                                                 value))\n            goto error;\n\n          /* Add 'prefix': <prefix>. */\n\n          key = yaml_document_add_scalar(&output_document, NULL,\n                                         (yaml_char_t *)\"prefix\", -1,\n                                         YAML_PLAIN_SCALAR_STYLE);\n          if (!key)\n            goto error;\n          value = yaml_document_add_scalar(&output_document, NULL, tag->prefix,\n                                           -1, YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n          if (!value)\n            goto error;\n          if (!yaml_document_append_mapping_pair(&output_document, map, key,\n                                                 value))\n            goto error;\n        }\n      }\n\n      /* Add 'implicit': <flag>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"implicit\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(\n          &output_document, (yaml_char_t *)YAML_BOOL_TAG,\n          (input_event.data.document_start.implicit ? (yaml_char_t *)\"true\"\n                                                    : (yaml_char_t *)\"false\"),\n          -1, YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      break;\n\n    case YAML_DOCUMENT_END_EVENT:\n\n      /* Add 'type': 'DOCUMENT-END'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"DOCUMENT-END\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Add 'implicit': <flag>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"implicit\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(\n          &output_document, (yaml_char_t *)YAML_BOOL_TAG,\n          (input_event.data.document_end.implicit ? (yaml_char_t *)\"true\"\n                                                  : (yaml_char_t *)\"false\"),\n          -1, YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      break;\n\n    case YAML_ALIAS_EVENT:\n\n      /* Add 'type': 'ALIAS'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"ALIAS\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Add 'anchor': <anchor>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"anchor\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       input_event.data.alias.anchor, -1,\n                                       YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      break;\n\n    case YAML_SCALAR_EVENT:\n\n      /* Add 'type': 'SCALAR'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"SCALAR\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Add 'anchor': <anchor>. */\n\n      if (input_event.data.scalar.anchor) {\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"anchor\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(&output_document, NULL,\n                                         input_event.data.scalar.anchor, -1,\n                                         YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      /* Add 'tag': <tag>. */\n\n      if (input_event.data.scalar.tag) {\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"tag\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(&output_document, NULL,\n                                         input_event.data.scalar.tag, -1,\n                                         YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      /* Add 'value': <value>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"value\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(\n          &output_document, NULL, input_event.data.scalar.value,\n          input_event.data.scalar.length, YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Display if the scalar tag is implicit. */\n\n      /* Add 'implicit': {} */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"version\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      map = yaml_document_add_mapping(&output_document, NULL,\n                                      YAML_FLOW_MAPPING_STYLE);\n      if (!map)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             map))\n        goto error;\n\n      /* Add 'plain': <flag>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"plain\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(\n          &output_document, (yaml_char_t *)YAML_BOOL_TAG,\n          (input_event.data.scalar.plain_implicit ? (yaml_char_t *)\"true\"\n                                                  : (yaml_char_t *)\"false\"),\n          -1, YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, map, key, value))\n        goto error;\n\n      /* Add 'quoted': <flag>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"quoted\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(\n          &output_document, (yaml_char_t *)YAML_BOOL_TAG,\n          (input_event.data.scalar.quoted_implicit ? (yaml_char_t *)\"true\"\n                                                   : (yaml_char_t *)\"false\"),\n          -1, YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, map, key, value))\n        goto error;\n\n      /* Display the style information. */\n\n      if (input_event.data.scalar.style) {\n        yaml_scalar_style_t style = input_event.data.scalar.style;\n\n        /* Add 'style': <style>. */\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"style\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(\n            &output_document, NULL,\n            (yaml_char_t\n                 *)(style == YAML_PLAIN_SCALAR_STYLE\n                        ? \"plain\"\n                        : style == YAML_SINGLE_QUOTED_SCALAR_STYLE\n                              ? \"single-quoted\"\n                              : style == YAML_DOUBLE_QUOTED_SCALAR_STYLE\n                                    ? \"double-quoted\"\n                                    : style == YAML_LITERAL_SCALAR_STYLE\n                                          ? \"literal\"\n                                          : style == YAML_FOLDED_SCALAR_STYLE\n                                                ? \"folded\"\n                                                : \"unknown\"),\n            -1, YAML_PLAIN_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      break;\n\n    case YAML_SEQUENCE_START_EVENT:\n\n      /* Add 'type': 'SEQUENCE-START'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"SEQUENCE-START\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Add 'anchor': <anchor>. */\n\n      if (input_event.data.sequence_start.anchor) {\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"anchor\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(&output_document, NULL,\n                                         input_event.data.sequence_start.anchor,\n                                         -1, YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      /* Add 'tag': <tag>. */\n\n      if (input_event.data.sequence_start.tag) {\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"tag\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(&output_document, NULL,\n                                         input_event.data.sequence_start.tag,\n                                         -1, YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      /* Add 'implicit': <flag>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"implicit\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(\n          &output_document, (yaml_char_t *)YAML_BOOL_TAG,\n          (input_event.data.sequence_start.implicit ? (yaml_char_t *)\"true\"\n                                                    : (yaml_char_t *)\"false\"),\n          -1, YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Display the style information. */\n\n      if (input_event.data.sequence_start.style) {\n        yaml_sequence_style_t style = input_event.data.sequence_start.style;\n\n        /* Add 'style': <style>. */\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"style\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(\n            &output_document, NULL,\n            (yaml_char_t *)(style == YAML_BLOCK_SEQUENCE_STYLE\n                                ? \"block\"\n                                : style == YAML_FLOW_SEQUENCE_STYLE\n                                      ? \"flow\"\n                                      : \"unknown\"),\n            -1, YAML_PLAIN_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      break;\n\n    case YAML_SEQUENCE_END_EVENT:\n\n      /* Add 'type': 'SEQUENCE-END'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"SEQUENCE-END\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      break;\n\n    case YAML_MAPPING_START_EVENT:\n\n      /* Add 'type': 'MAPPING-START'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"MAPPING-START\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Add 'anchor': <anchor>. */\n\n      if (input_event.data.mapping_start.anchor) {\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"anchor\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(&output_document, NULL,\n                                         input_event.data.mapping_start.anchor,\n                                         -1, YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      /* Add 'tag': <tag>. */\n\n      if (input_event.data.mapping_start.tag) {\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"tag\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(&output_document, NULL,\n                                         input_event.data.mapping_start.tag, -1,\n                                         YAML_DOUBLE_QUOTED_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      /* Add 'implicit': <flag>. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"implicit\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(\n          &output_document, (yaml_char_t *)YAML_BOOL_TAG,\n          (yaml_char_t *)(input_event.data.mapping_start.implicit ? \"true\"\n                                                                  : \"false\"),\n          -1, YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      /* Display the style information. */\n\n      if (input_event.data.sequence_start.style) {\n        yaml_sequence_style_t style = input_event.data.sequence_start.style;\n\n        /* Add 'style': <style>. */\n\n        key = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"style\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n        if (!key)\n          goto error;\n        value = yaml_document_add_scalar(\n            &output_document, NULL,\n            (yaml_char_t *)(style == YAML_BLOCK_MAPPING_STYLE\n                                ? \"block\"\n                                : style == YAML_FLOW_MAPPING_STYLE ? \"flow\"\n                                                                   : \"unknown\"),\n            -1, YAML_PLAIN_SCALAR_STYLE);\n        if (!value)\n          goto error;\n        if (!yaml_document_append_mapping_pair(&output_document, properties,\n                                               key, value))\n          goto error;\n      }\n\n      break;\n\n    case YAML_MAPPING_END_EVENT:\n\n      /* Add 'type': 'MAPPING-END'. */\n\n      key = yaml_document_add_scalar(&output_document, NULL,\n                                     (yaml_char_t *)\"type\", -1,\n                                     YAML_PLAIN_SCALAR_STYLE);\n      if (!key)\n        goto error;\n      value = yaml_document_add_scalar(&output_document, NULL,\n                                       (yaml_char_t *)\"MAPPING-END\", -1,\n                                       YAML_PLAIN_SCALAR_STYLE);\n      if (!value)\n        goto error;\n      if (!yaml_document_append_mapping_pair(&output_document, properties, key,\n                                             value))\n        goto error;\n\n      break;\n\n    default:\n      /* It couldn't really happen. */\n      break;\n    }\n\n    /* Delete the event object. */\n\n    yaml_event_delete(&input_event);\n  }\n\n  if (!yaml_emitter_dump(&emitter, &output_document))\n    goto error;\n\n  yaml_emitter_close(&emitter);\n\nerror:\n\n  free(out.buf);\n\n  yaml_event_delete(&input_event);\n  yaml_document_delete(&output_document);\n  yaml_parser_delete(&parser);\n  yaml_emitter_delete(&emitter);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_deconstructor_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include \"yaml_write_handler.h\"\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 2)\n    return 0;\n\n  bool done = false;\n  bool is_canonical = data[0] & 1;\n  bool is_unicode = data[1] & 1;\n  data += 2;\n  size -= 2;\n\n  yaml_parser_t parser;\n  yaml_emitter_t emitter;\n  yaml_event_t input_event;\n  yaml_event_t output_event;\n\n  /* Initialize the parser and emitter objects. */\n\n  if (!yaml_parser_initialize(&parser)) {\n    return 1;\n  }\n\n  if (!yaml_emitter_initialize(&emitter)) {\n    yaml_parser_delete(&parser);\n    return 1;\n  }\n\n  /* Set the parser parameters. */\n\n  yaml_parser_set_input_string(&parser, data, size);\n\n  /* Set the emitter parameters. */\n  yaml_output_buffer_t out = {/*buf=*/NULL, /*size=*/0, /*capacity=*/1000};\n  yaml_emitter_set_output(&emitter, yaml_write_handler, &out);\n\n  yaml_emitter_set_canonical(&emitter, is_canonical);\n  yaml_emitter_set_unicode(&emitter, is_unicode);\n\n  /* Create and emit the STREAM-START event. */\n\n  if (!yaml_stream_start_event_initialize(&output_event, YAML_UTF8_ENCODING))\n    goto error;\n  if (!yaml_emitter_emit(&emitter, &output_event))\n    goto error;\n\n  /* Create and emit the DOCUMENT-START event. */\n\n  if (!yaml_document_start_event_initialize(&output_event, NULL, NULL, NULL, 0))\n    goto error;\n  if (!yaml_emitter_emit(&emitter, &output_event))\n    goto error;\n\n  /* Create and emit the SEQUENCE-START event. */\n\n  if (!yaml_sequence_start_event_initialize(\n          &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:seq\", 1,\n          YAML_BLOCK_SEQUENCE_STYLE))\n    goto error;\n  if (!yaml_emitter_emit(&emitter, &output_event))\n    goto error;\n\n  /* Loop through the input events. */\n\n  while (!done) {\n    /* Get the next event. */\n\n    if (!yaml_parser_parse(&parser, &input_event))\n      goto error;\n\n    /* Check if this is the stream end. */\n\n    done = (input_event.type == YAML_STREAM_END_EVENT);\n\n    /* Create and emit a MAPPING-START event. */\n\n    if (!yaml_mapping_start_event_initialize(\n            &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:map\", 1,\n            YAML_BLOCK_MAPPING_STYLE))\n      goto error;\n    if (!yaml_emitter_emit(&emitter, &output_event))\n      goto error;\n\n    /* Analyze the event. */\n\n    switch (input_event.type) {\n    case YAML_STREAM_START_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'STREAM-START'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"STREAM-START\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display encoding information. */\n\n      if (input_event.data.stream_start.encoding) {\n        yaml_encoding_t encoding = input_event.data.stream_start.encoding;\n\n        /* Write 'encoding'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"encoding\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the stream encoding. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)(encoding == YAML_UTF8_ENCODING\n                                    ? \"utf-8\"\n                                    : encoding == YAML_UTF16LE_ENCODING\n                                          ? \"utf-16-le\"\n                                          : encoding == YAML_UTF16BE_ENCODING\n                                                ? \"utf-16-be\"\n                                                : \"unknown\"),\n                -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      break;\n\n    case YAML_STREAM_END_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'STREAM-END'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"STREAM-END\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      break;\n\n    case YAML_DOCUMENT_START_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'DOCUMENT-START'. */\n\n      if (!yaml_scalar_event_initialize(&output_event, NULL,\n                                        (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                                        (yaml_char_t *)\"DOCUMENT-START\", -1, 1,\n                                        1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display the document version numbers. */\n\n      if (input_event.data.document_start.version_directive) {\n        yaml_version_directive_t *version =\n            input_event.data.document_start.version_directive;\n        char number[64];\n\n        /* Write 'version'. */\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"version\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write '{'. */\n\n        if (!yaml_mapping_start_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:map\", 1,\n                YAML_FLOW_MAPPING_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write 'major'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"major\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write a number. */\n\n        sprintf(number, \"%d\", version->major);\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:int\",\n                (yaml_char_t *)number, -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write 'minor'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"minor\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write a number. */\n\n        sprintf(number, \"%d\", version->minor);\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:int\",\n                (yaml_char_t *)number, -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write '}'. */\n\n        if (!yaml_mapping_end_event_initialize(&output_event))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Display the document tag directives. */\n\n      if (input_event.data.document_start.tag_directives.start !=\n          input_event.data.document_start.tag_directives.end) {\n        yaml_tag_directive_t *tag;\n\n        /* Write 'tags'. */\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"tags\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Start a block sequence. */\n\n        if (!yaml_sequence_start_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:seq\", 1,\n                YAML_BLOCK_SEQUENCE_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        for (tag = input_event.data.document_start.tag_directives.start;\n             tag != input_event.data.document_start.tag_directives.end; tag++) {\n          /* Write '{'. */\n\n          if (!yaml_mapping_start_event_initialize(\n                  &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:map\",\n                  1, YAML_FLOW_MAPPING_STYLE))\n            goto error;\n          if (!yaml_emitter_emit(&emitter, &output_event))\n            goto error;\n\n          /* Write 'handle'. */\n\n          if (!yaml_scalar_event_initialize(\n                  &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                  (yaml_char_t *)\"handle\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n            goto error;\n          if (!yaml_emitter_emit(&emitter, &output_event))\n            goto error;\n\n          /* Write the tag directive handle. */\n\n          if (!yaml_scalar_event_initialize(\n                  &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                  (yaml_char_t *)tag->handle, -1, 0, 1,\n                  YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n            goto error;\n          if (!yaml_emitter_emit(&emitter, &output_event))\n            goto error;\n\n          /* Write 'prefix'. */\n\n          if (!yaml_scalar_event_initialize(\n                  &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                  (yaml_char_t *)\"prefix\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n            goto error;\n          if (!yaml_emitter_emit(&emitter, &output_event))\n            goto error;\n\n          /* Write the tag directive prefix. */\n\n          if (!yaml_scalar_event_initialize(\n                  &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                  (yaml_char_t *)tag->prefix, -1, 0, 1,\n                  YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n            goto error;\n          if (!yaml_emitter_emit(&emitter, &output_event))\n            goto error;\n\n          /* Write '}'. */\n\n          if (!yaml_mapping_end_event_initialize(&output_event))\n            goto error;\n          if (!yaml_emitter_emit(&emitter, &output_event))\n            goto error;\n        }\n\n        /* End a block sequence. */\n\n        if (!yaml_sequence_end_event_initialize(&output_event))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Write 'implicit'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"implicit\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write if the document is implicit. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:bool\",\n              (yaml_char_t *)(input_event.data.document_start.implicit\n                                  ? \"true\"\n                                  : \"false\"),\n              -1, 1, 0, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      break;\n\n    case YAML_DOCUMENT_END_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'DOCUMENT-END'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"DOCUMENT-END\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'implicit'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"implicit\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write if the document is implicit. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:bool\",\n              (yaml_char_t *)(input_event.data.document_end.implicit ? \"true\"\n                                                                     : \"false\"),\n              -1, 1, 0, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      break;\n\n    case YAML_ALIAS_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'ALIAS'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"ALIAS\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'anchor'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"anchor\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write the alias anchor. */\n\n      if (!yaml_scalar_event_initialize(&output_event, NULL,\n                                        (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                                        input_event.data.alias.anchor, -1, 0, 1,\n                                        YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      break;\n\n    case YAML_SCALAR_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'SCALAR'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"SCALAR\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display the scalar anchor. */\n\n      if (input_event.data.scalar.anchor) {\n        /* Write 'anchor'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"anchor\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the scalar anchor. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                input_event.data.scalar.anchor, -1, 0, 1,\n                YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Display the scalar tag. */\n\n      if (input_event.data.scalar.tag) {\n        /* Write 'tag'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"tag\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the scalar tag. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                input_event.data.scalar.tag, -1, 0, 1,\n                YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Display the scalar value. */\n\n      /* Write 'value'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"value\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write the scalar value. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              input_event.data.scalar.value, input_event.data.scalar.length, 0,\n              1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display if the scalar tag is implicit. */\n\n      /* Write 'implicit'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"implicit\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write '{'. */\n\n      if (!yaml_mapping_start_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:map\", 1,\n              YAML_FLOW_MAPPING_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'plain'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"plain\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write if the scalar is implicit in the plain style. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:bool\",\n              (yaml_char_t *)(input_event.data.scalar.plain_implicit ? \"true\"\n                                                                     : \"false\"),\n              -1, 1, 0, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'quoted'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"non-plain\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write if the scalar is implicit in a non-plain style. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:bool\",\n              (yaml_char_t *)(input_event.data.scalar.quoted_implicit\n                                  ? \"true\"\n                                  : \"false\"),\n              -1, 1, 0, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write '}'. */\n\n      if (!yaml_mapping_end_event_initialize(&output_event))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display the style information. */\n\n      if (input_event.data.scalar.style) {\n        yaml_scalar_style_t style = input_event.data.scalar.style;\n\n        /* Write 'style'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"style\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the scalar style. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t\n                     *)(style == YAML_PLAIN_SCALAR_STYLE\n                            ? \"plain\"\n                            : style == YAML_SINGLE_QUOTED_SCALAR_STYLE\n                                  ? \"single-quoted\"\n                                  : style == YAML_DOUBLE_QUOTED_SCALAR_STYLE\n                                        ? \"double-quoted\"\n                                        : style == YAML_LITERAL_SCALAR_STYLE\n                                              ? \"literal\"\n                                              : style ==\n                                                        YAML_FOLDED_SCALAR_STYLE\n                                                    ? \"folded\"\n                                                    : \"unknown\"),\n                -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      break;\n\n    case YAML_SEQUENCE_START_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'SEQUENCE-START'. */\n\n      if (!yaml_scalar_event_initialize(&output_event, NULL,\n                                        (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                                        (yaml_char_t *)\"SEQUENCE-START\", -1, 1,\n                                        1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display the sequence anchor. */\n\n      if (input_event.data.sequence_start.anchor) {\n        /* Write 'anchor'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"anchor\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the sequence anchor. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                input_event.data.sequence_start.anchor, -1, 0, 1,\n                YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Display the sequence tag. */\n\n      if (input_event.data.sequence_start.tag) {\n        /* Write 'tag'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"tag\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the sequence tag. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                input_event.data.sequence_start.tag, -1, 0, 1,\n                YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Write 'implicit'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"implicit\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write if the sequence tag is implicit. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:bool\",\n              (yaml_char_t *)(input_event.data.sequence_start.implicit\n                                  ? \"true\"\n                                  : \"false\"),\n              -1, 1, 0, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display the style information. */\n\n      if (input_event.data.sequence_start.style) {\n        yaml_sequence_style_t style = input_event.data.sequence_start.style;\n\n        /* Write 'style'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"style\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the scalar style. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)(style == YAML_BLOCK_SEQUENCE_STYLE\n                                    ? \"block\"\n                                    : style == YAML_FLOW_SEQUENCE_STYLE\n                                          ? \"flow\"\n                                          : \"unknown\"),\n                -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      break;\n\n    case YAML_SEQUENCE_END_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'SEQUENCE-END'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"SEQUENCE-END\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      break;\n\n    case YAML_MAPPING_START_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'MAPPING-START'. */\n\n      if (!yaml_scalar_event_initialize(&output_event, NULL,\n                                        (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                                        (yaml_char_t *)\"MAPPING-START\", -1, 1,\n                                        1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display the mapping anchor. */\n\n      if (input_event.data.mapping_start.anchor) {\n        /* Write 'anchor'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"anchor\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the mapping anchor. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                input_event.data.mapping_start.anchor, -1, 0, 1,\n                YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Display the mapping tag. */\n\n      if (input_event.data.mapping_start.tag) {\n        /* Write 'tag'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"tag\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the mapping tag. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                input_event.data.mapping_start.tag, -1, 0, 1,\n                YAML_DOUBLE_QUOTED_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      /* Write 'implicit'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"implicit\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write if the mapping tag is implicit. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:bool\",\n              (yaml_char_t *)(input_event.data.mapping_start.implicit\n                                  ? \"true\"\n                                  : \"false\"),\n              -1, 1, 0, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Display the style information. */\n\n      if (input_event.data.mapping_start.style) {\n        yaml_mapping_style_t style = input_event.data.mapping_start.style;\n\n        /* Write 'style'. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)\"style\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n\n        /* Write the scalar style. */\n\n        if (!yaml_scalar_event_initialize(\n                &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n                (yaml_char_t *)(style == YAML_BLOCK_MAPPING_STYLE\n                                    ? \"block\"\n                                    : style == YAML_FLOW_MAPPING_STYLE\n                                          ? \"flow\"\n                                          : \"unknown\"),\n                -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n          goto error;\n        if (!yaml_emitter_emit(&emitter, &output_event))\n          goto error;\n      }\n\n      break;\n\n    case YAML_MAPPING_END_EVENT:\n\n      /* Write 'type'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"type\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      /* Write 'MAPPING-END'. */\n\n      if (!yaml_scalar_event_initialize(\n              &output_event, NULL, (yaml_char_t *)\"tag:yaml.org,2002:str\",\n              (yaml_char_t *)\"MAPPING-END\", -1, 1, 1, YAML_PLAIN_SCALAR_STYLE))\n        goto error;\n      if (!yaml_emitter_emit(&emitter, &output_event))\n        goto error;\n\n      break;\n\n    default:\n      /* It couldn't really happen. */\n      break;\n    }\n\n    /* Delete the event object. */\n\n    yaml_event_delete(&input_event);\n\n    /* Create and emit a MAPPING-END event. */\n\n    if (!yaml_mapping_end_event_initialize(&output_event))\n      goto error;\n    if (!yaml_emitter_emit(&emitter, &output_event))\n      goto error;\n  }\n\n  /* Create and emit the SEQUENCE-END event. */\n\n  if (!yaml_sequence_end_event_initialize(&output_event))\n    goto error;\n  if (!yaml_emitter_emit(&emitter, &output_event))\n    goto error;\n\n  /* Create and emit the DOCUMENT-END event. */\n\n  if (!yaml_document_end_event_initialize(&output_event, 0))\n    goto error;\n  if (!yaml_emitter_emit(&emitter, &output_event))\n    goto error;\n\n  /* Create and emit the STREAM-END event. */\n\n  if (!yaml_stream_end_event_initialize(&output_event))\n    goto error;\n  yaml_emitter_emit(&emitter, &output_event);\n\nerror:\n\n  free(out.buf);\n\n  yaml_event_delete(&input_event);\n  yaml_parser_delete(&parser);\n  yaml_emitter_delete(&emitter);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_dumper_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include \"yaml_write_handler.h\"\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\n#define MAX_DOCUMENTS 16\n\nbool nodes_equal(yaml_document_t *document1, int index1,\n                 yaml_document_t *document2, int index2, int level) {\n  const bool equal = true;\n\n  if (level++ > 1000)\n    return !equal;\n  yaml_node_t *node1 = yaml_document_get_node(document1, index1);\n\n  if (!node1)\n    return !equal;\n\n  yaml_node_t *node2 = yaml_document_get_node(document2, index2);\n\n  if (!node2)\n    return !equal;\n\n  if (node1->type != node2->type)\n    return !equal;\n\n  if (strcmp((char *)node1->tag, (char *)node2->tag) != 0)\n    return !equal;\n\n  switch (node1->type) {\n  case YAML_SCALAR_NODE:\n    if (node1->data.scalar.length != node2->data.scalar.length)\n      return !equal;\n    if (strncmp((char *)node1->data.scalar.value,\n                (char *)node2->data.scalar.value,\n                node1->data.scalar.length) != 0)\n      return !equal;\n    break;\n  case YAML_SEQUENCE_NODE:\n    if ((node1->data.sequence.items.top - node1->data.sequence.items.start) !=\n        (node2->data.sequence.items.top - node2->data.sequence.items.start))\n      return !equal;\n    for (int k = 0; k < (node1->data.sequence.items.top -\n                         node1->data.sequence.items.start);\n         k++) {\n      if (!nodes_equal(document1, node1->data.sequence.items.start[k],\n                       document2, node2->data.sequence.items.start[k], level))\n        return !equal;\n    }\n    break;\n  case YAML_MAPPING_NODE:\n    if ((node1->data.mapping.pairs.top - node1->data.mapping.pairs.start) !=\n        (node2->data.mapping.pairs.top - node2->data.mapping.pairs.start))\n      return !equal;\n    for (int k = 0;\n         k < (node1->data.mapping.pairs.top - node1->data.mapping.pairs.start);\n         k++) {\n      if (!nodes_equal(document1, node1->data.mapping.pairs.start[k].key,\n                       document2, node2->data.mapping.pairs.start[k].key,\n                       level))\n        return !equal;\n      if (!nodes_equal(document1, node1->data.mapping.pairs.start[k].value,\n                       document2, node2->data.mapping.pairs.start[k].value,\n                       level))\n        return !equal;\n    }\n    break;\n  default:\n    return !equal;\n  }\n  return equal;\n}\n\nbool documents_equal(yaml_document_t *document1, yaml_document_t *document2) {\n\n  const bool equal = true;\n\n  if ((document1->version_directive && !document2->version_directive) ||\n      (!document1->version_directive && document2->version_directive) ||\n      (document1->version_directive && document2->version_directive &&\n       (document1->version_directive->major !=\n            document2->version_directive->major ||\n        document1->version_directive->minor !=\n            document2->version_directive->minor)))\n    return !equal;\n\n  if ((document1->tag_directives.end - document1->tag_directives.start) !=\n      (document2->tag_directives.end - document2->tag_directives.start))\n    return !equal;\n  for (int k = 0;\n       k < (document1->tag_directives.end - document1->tag_directives.start);\n       k++) {\n    if ((strcmp((char *)document1->tag_directives.start[k].handle,\n                (char *)document2->tag_directives.start[k].handle) != 0) ||\n        (strcmp((char *)document1->tag_directives.start[k].prefix,\n                (char *)document2->tag_directives.start[k].prefix) != 0))\n      return !equal;\n  }\n\n  if ((document1->nodes.top - document1->nodes.start) !=\n      (document2->nodes.top - document2->nodes.start))\n    return !equal;\n\n  if (document1->nodes.top != document1->nodes.start) {\n    if (!nodes_equal(document1, 1, document2, 1, 0))\n      return !equal;\n  }\n\n  return equal;\n}\n\nbool copy_document(yaml_document_t *document_to,\n                   yaml_document_t *document_from) {\n  bool error = true;\n\n  yaml_node_t *node;\n  yaml_node_item_t *item;\n  yaml_node_pair_t *pair;\n\n  if (!yaml_document_initialize(document_to, document_from->version_directive,\n                                document_from->tag_directives.start,\n                                document_from->tag_directives.end,\n                                document_from->start_implicit,\n                                document_from->end_implicit))\n    return !error;\n\n  for (node = document_from->nodes.start; node < document_from->nodes.top;\n       node++) {\n    switch (node->type) {\n    case YAML_SCALAR_NODE:\n      if (!yaml_document_add_scalar(\n              document_to, node->tag, node->data.scalar.value,\n              node->data.scalar.length, node->data.scalar.style))\n        goto out;\n      break;\n    case YAML_SEQUENCE_NODE:\n      if (!yaml_document_add_sequence(document_to, node->tag,\n                                      node->data.sequence.style))\n        goto out;\n      break;\n    case YAML_MAPPING_NODE:\n      if (!yaml_document_add_mapping(document_to, node->tag,\n                                     node->data.mapping.style))\n        goto out;\n      break;\n    default:\n      goto out;\n    }\n  }\n\n  for (node = document_from->nodes.start; node < document_from->nodes.top;\n       node++) {\n    switch (node->type) {\n    case YAML_SEQUENCE_NODE:\n      for (item = node->data.sequence.items.start;\n           item < node->data.sequence.items.top; item++) {\n        if (!yaml_document_append_sequence_item(\n                document_to, node - document_from->nodes.start + 1, *item))\n          goto out;\n      }\n      break;\n    case YAML_MAPPING_NODE:\n      for (pair = node->data.mapping.pairs.start;\n           pair < node->data.mapping.pairs.top; pair++) {\n        if (!yaml_document_append_mapping_pair(\n                document_to, node - document_from->nodes.start + 1, pair->key,\n                pair->value))\n          goto out;\n      }\n      break;\n    default:\n      break;\n    }\n  }\n  return error;\n\nout:\n  yaml_document_delete(document_to);\n  return !error;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 2)\n    return 0;\n\n  yaml_parser_t parser;\n  yaml_emitter_t emitter;\n\n  yaml_document_t document;\n  yaml_document_t documents[MAX_DOCUMENTS];\n  size_t document_number = 0;\n  int count = 0;\n  bool done = false;\n  bool equal = false;\n  bool is_canonical = data[0] & 1;\n  bool is_unicode = data[1] & 1;\n  data += 2;\n  size -= 2;\n\n  if (!yaml_parser_initialize(&parser))\n    return 0;\n\n  yaml_parser_set_input_string(&parser, data, size);\n  if (!yaml_emitter_initialize(&emitter))\n    return 0;\n\n  yaml_emitter_set_canonical(&emitter, is_canonical);\n  yaml_emitter_set_unicode(&emitter, is_unicode);\n\n  yaml_output_buffer_t out = {/*buf=*/NULL, /*size=*/0, /*capacity=*/1000};\n  yaml_emitter_set_output(&emitter, yaml_write_handler, &out);\n  yaml_emitter_open(&emitter);\n\n  while (!done) {\n    if (!yaml_parser_load(&parser, &document)) {\n      equal = 1;\n      break;\n    }\n\n    done = (!yaml_document_get_root_node(&document));\n    if (!done) {\n      if (document_number >= MAX_DOCUMENTS) {\n        yaml_document_delete(&document);\n        equal = true;\n        break;\n      }\n\n      if (!copy_document(&documents[document_number++], &document)) {\n        yaml_document_delete(&document);\n        equal = true;\n        break;\n      }\n      if (!(yaml_emitter_dump(&emitter, &document) ||\n            (yaml_emitter_flush(&emitter) && 0))) {\n        equal = true;\n        break;\n      }\n\n      count++;\n    } else {\n      yaml_document_delete(&document);\n    }\n  }\n\n  yaml_parser_delete(&parser);\n  yaml_emitter_close(&emitter);\n  yaml_emitter_delete(&emitter);\n\n  if (!equal) {\n    count = 0;\n    done = false;\n    if (!yaml_parser_initialize(&parser))\n      goto error;\n\n    if (!out.buf) {\n      yaml_parser_delete(&parser);\n      goto error;\n    }\n\n    yaml_parser_set_input_string(&parser, out.buf, out.size);\n\n    while (!done) {\n      if (!yaml_parser_load(&parser, &document)) {\n        yaml_parser_delete(&parser);\n        goto error;\n      }\n\n      done = (!yaml_document_get_root_node(&document));\n      if (!done) {\n        if (!documents_equal(documents + count, &document)) {\n          yaml_parser_delete(&parser);\n          yaml_document_delete(&document);\n          goto error;\n        }\n        count++;\n      }\n      yaml_document_delete(&document);\n    }\n    yaml_parser_delete(&parser);\n  }\n\n\nerror:\n\n  for (int k = 0; k < document_number; k++) {\n    yaml_document_delete(documents + k);\n  }\n  free(out.buf);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_emitter_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include \"yaml_write_handler.h\"\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\n#define MAX_EVENTS 1024\n\nbool events_equal(yaml_event_t *event1, yaml_event_t *event2) {\n  \n  const bool equal = true;\n\n  if (event1->type != event2->type)\n    return equal;\n\n  switch (event1->type) {\n  case YAML_STREAM_START_EVENT:\n    return !equal;\n\n  case YAML_DOCUMENT_START_EVENT:\n    if ((event1->data.document_start.version_directive &&\n         !event2->data.document_start.version_directive) ||\n        (!event1->data.document_start.version_directive &&\n         event2->data.document_start.version_directive) ||\n        (event1->data.document_start.version_directive &&\n         event2->data.document_start.version_directive &&\n         (event1->data.document_start.version_directive->major !=\n              event2->data.document_start.version_directive->major ||\n          event1->data.document_start.version_directive->minor !=\n              event2->data.document_start.version_directive->minor)))\n      return equal;\n    if ((event1->data.document_start.tag_directives.end -\n         event1->data.document_start.tag_directives.start) !=\n        (event2->data.document_start.tag_directives.end -\n         event2->data.document_start.tag_directives.start))\n      return equal;\n    for (int k = 0; k < (event1->data.document_start.tag_directives.end -\n                         event1->data.document_start.tag_directives.start);\n         k++) {\n      if ((strcmp((char *)event1->data.document_start.tag_directives.start[k]\n                      .handle,\n                  (char *)event2->data.document_start.tag_directives.start[k]\n                      .handle) != 0) ||\n          (strcmp((char *)event1->data.document_start.tag_directives.start[k]\n                      .prefix,\n                  (char *)event2->data.document_start.tag_directives.start[k]\n                      .prefix) != 0))\n        return equal;\n    }\n    return !equal;\n\n  case YAML_DOCUMENT_END_EVENT:\n    return !equal;\n\n  case YAML_ALIAS_EVENT:\n    return (strcmp((char *)event1->data.alias.anchor,\n                   (char *)event2->data.alias.anchor) == 0);\n\n  case YAML_SCALAR_EVENT:\n    if ((event1->data.scalar.anchor && !event2->data.scalar.anchor) ||\n        (!event1->data.scalar.anchor && event2->data.scalar.anchor) ||\n        (event1->data.scalar.anchor && event2->data.scalar.anchor &&\n         strcmp((char *)event1->data.scalar.anchor,\n                (char *)event2->data.scalar.anchor) != 0))\n      return equal;\n    if ((event1->data.scalar.tag && !event2->data.scalar.tag &&\n         strcmp((char *)event1->data.scalar.tag, \"!\") != 0) ||\n        (!event1->data.scalar.tag && event2->data.scalar.tag &&\n         strcmp((char *)event2->data.scalar.tag, \"!\") != 0) ||\n        (event1->data.scalar.tag && event2->data.scalar.tag &&\n         strcmp((char *)event1->data.scalar.tag,\n                (char *)event2->data.scalar.tag) != 0))\n      return equal;\n    if ((event1->data.scalar.length != event2->data.scalar.length) ||\n        memcmp(event1->data.scalar.value, event2->data.scalar.value,\n               event1->data.scalar.length) != 0)\n      return equal;\n    if ((event1->data.scalar.plain_implicit !=\n         event2->data.scalar.plain_implicit) ||\n        (event1->data.scalar.quoted_implicit !=\n         event2->data.scalar.quoted_implicit))\n      return equal;\n    return !equal;\n\n  case YAML_SEQUENCE_START_EVENT:\n    if ((event1->data.sequence_start.anchor &&\n         !event2->data.sequence_start.anchor) ||\n        (!event1->data.sequence_start.anchor &&\n         event2->data.sequence_start.anchor) ||\n        (event1->data.sequence_start.anchor &&\n         event2->data.sequence_start.anchor &&\n         strcmp((char *)event1->data.sequence_start.anchor,\n                (char *)event2->data.sequence_start.anchor) != 0))\n      return equal;\n    if ((event1->data.sequence_start.tag && !event2->data.sequence_start.tag) ||\n        (!event1->data.sequence_start.tag && event2->data.sequence_start.tag) ||\n        (event1->data.sequence_start.tag && event2->data.sequence_start.tag &&\n         strcmp((char *)event1->data.sequence_start.tag,\n                (char *)event2->data.sequence_start.tag) != 0))\n      return equal;\n    if ((event1->data.sequence_start.implicit !=\n         event2->data.sequence_start.implicit))\n      return equal;\n    return !equal;\n\n  case YAML_MAPPING_START_EVENT:\n    if ((event1->data.mapping_start.anchor &&\n         !event2->data.mapping_start.anchor) ||\n        (!event1->data.mapping_start.anchor &&\n         event2->data.mapping_start.anchor) ||\n        (event1->data.mapping_start.anchor &&\n         event2->data.mapping_start.anchor &&\n         strcmp((char *)event1->data.mapping_start.anchor,\n                (char *)event2->data.mapping_start.anchor) != 0))\n      return equal;\n    if ((event1->data.mapping_start.tag && !event2->data.mapping_start.tag) ||\n        (!event1->data.mapping_start.tag && event2->data.mapping_start.tag) ||\n        (event1->data.mapping_start.tag && event2->data.mapping_start.tag &&\n         strcmp((char *)event1->data.mapping_start.tag,\n                (char *)event2->data.mapping_start.tag) != 0))\n      return equal;\n    if ((event1->data.mapping_start.implicit !=\n         event2->data.mapping_start.implicit))\n      return equal;\n    return !equal;\n\n  default:\n    return !equal;\n  }\n}\n\nbool copy_event(yaml_event_t *event_to, yaml_event_t *event_from) {\n\n  switch (event_from->type) {\n  case YAML_STREAM_START_EVENT:\n    return yaml_stream_start_event_initialize(\n        event_to, event_from->data.stream_start.encoding);\n\n  case YAML_STREAM_END_EVENT:\n    return yaml_stream_end_event_initialize(event_to);\n\n  case YAML_DOCUMENT_START_EVENT:\n    return yaml_document_start_event_initialize(\n        event_to, event_from->data.document_start.version_directive,\n        event_from->data.document_start.tag_directives.start,\n        event_from->data.document_start.tag_directives.end,\n        event_from->data.document_start.implicit);\n\n  case YAML_DOCUMENT_END_EVENT:\n    return yaml_document_end_event_initialize(\n        event_to, event_from->data.document_end.implicit);\n\n  case YAML_ALIAS_EVENT:\n    return yaml_alias_event_initialize(event_to, event_from->data.alias.anchor);\n\n  case YAML_SCALAR_EVENT:\n    return yaml_scalar_event_initialize(\n        event_to, event_from->data.scalar.anchor, event_from->data.scalar.tag,\n        event_from->data.scalar.value, event_from->data.scalar.length,\n        event_from->data.scalar.plain_implicit,\n        event_from->data.scalar.quoted_implicit, event_from->data.scalar.style);\n\n  case YAML_SEQUENCE_START_EVENT:\n    return yaml_sequence_start_event_initialize(\n        event_to, event_from->data.sequence_start.anchor,\n        event_from->data.sequence_start.tag,\n        event_from->data.sequence_start.implicit,\n        event_from->data.sequence_start.style);\n\n  case YAML_SEQUENCE_END_EVENT:\n    return yaml_sequence_end_event_initialize(event_to);\n\n  case YAML_MAPPING_START_EVENT:\n    return yaml_mapping_start_event_initialize(\n        event_to, event_from->data.mapping_start.anchor,\n        event_from->data.mapping_start.tag,\n        event_from->data.mapping_start.implicit,\n        event_from->data.mapping_start.style);\n\n  case YAML_MAPPING_END_EVENT:\n    return yaml_mapping_end_event_initialize(event_to);\n  }\n\n  return false;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 2)\n    return 0;\n\n  yaml_parser_t parser;\n  yaml_emitter_t emitter;\n  yaml_event_t event;\n  yaml_event_t events[MAX_EVENTS];\n  size_t event_number = 0;\n  bool done = false;\n  int count = 0;\n  bool is_canonical = data[0] & 1;\n  bool is_unicode = data[1] & 1;\n  data += 2;\n  size -= 2;\n\n  if (!yaml_parser_initialize(&parser))\n    return 0;\n\n  yaml_parser_set_input_string(&parser, data, size);\n  if (!yaml_emitter_initialize(&emitter)) {\n    yaml_parser_delete(&parser);\n    return 0;\n  }\n\n  yaml_emitter_set_canonical(&emitter, is_canonical);\n  yaml_emitter_set_unicode(&emitter, is_unicode);\n\n  yaml_output_buffer_t out = {/*buf=*/NULL, /*size=*/0, /*capacity=*/1000};\n  yaml_emitter_set_output(&emitter, yaml_write_handler, &out);\n\n  while (!done) {\n    if (!yaml_parser_parse(&parser, &event)) {\n      goto delete_parser;\n    }\n\n    done = (event.type == YAML_STREAM_END_EVENT);\n    if (event_number >= MAX_EVENTS) {\n      yaml_event_delete(&event);\n      goto delete_parser;\n    }\n\n    if (!copy_event(&events[event_number], &event)) {\n      yaml_event_delete(&event);\n      goto delete_parser;\n    }\n    event_number++;\n\n    if (!yaml_emitter_emit(&emitter, &event)) {\n      goto delete_parser;\n    }\n\n  }\n\n  yaml_parser_delete(&parser);\n\n  if (!out.buf || out.size == 0)\n    goto error;\n\n  done = false;\n  if (!yaml_parser_initialize(&parser))\n    goto error;\n\n  yaml_parser_set_input_string(&parser, out.buf, out.size);\n\n  while (!done) {\n    if (!yaml_parser_parse(&parser, &event))\n      break;\n\n    done = (event.type == YAML_STREAM_END_EVENT);\n    if (events_equal(events + count, &event)) {\n      yaml_event_delete(&event);\n      break;\n    }\n\n    yaml_event_delete(&event);\n    count++;\n  }\n\ndelete_parser:\n\n  yaml_parser_delete(&parser);\n\nerror:\n\n  yaml_emitter_delete(&emitter);\n\n  for (int k = 0; k < event_number; k++) {\n    yaml_event_delete(events + k);\n  }\n\n  free(out.buf);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_fuzzer.options",
    "content": "[libfuzzer]\ndict = yaml.dict\n"
  },
  {
    "path": "projects/libyaml/libyaml_loader_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include <assert.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdint.h>\n#include <stdbool.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  yaml_parser_t parser;\n  yaml_document_t document;\n  bool done = false;\n\n  if(!yaml_parser_initialize(&parser))\n    return 0;\n\n  yaml_parser_set_input_string(&parser, data, size);\n\n  while (!done)\n  {\n      if (!yaml_parser_load(&parser, &document)) {\n          break;\n      }\n\n      done = (!yaml_document_get_root_node(&document));\n\n      yaml_document_delete(&document);\n  }\n\n  yaml_parser_delete(&parser);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_parser_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include <assert.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdint.h>\n#include <stdbool.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  yaml_parser_t parser;\n  yaml_event_t event;\n  bool done = false;\n\n  if(!yaml_parser_initialize(&parser))\n    return 0;\n\n  yaml_parser_set_input_string(&parser, data, size);\n\n  while (!done)\n  {\n      if (!yaml_parser_parse(&parser, &event)) break;\n\n      done = (event.type == YAML_STREAM_END_EVENT);\n\n      yaml_event_delete(&event);\n  }\n\n  yaml_parser_delete(&parser);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_reformatter_alt_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include \"yaml_write_handler.h\"\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 2)\n    return 0;\n\n  bool done = false;\n  bool is_canonical = data[0] & 1;\n  bool is_unicode = data[1] & 1;\n  data += 2;\n  size -= 2;\n\n  yaml_parser_t parser;\n  yaml_emitter_t emitter;\n  yaml_document_t document;\n\n  /* Initialize the parser and emitter objects. */\n\n  if (!yaml_parser_initialize(&parser))\n    return 0;\n\n  if (!yaml_emitter_initialize(&emitter))\n    goto cleanup_parser;\n\n  /* Set the parser parameters. */\n\n  yaml_parser_set_input_string(&parser, data, size);\n\n  /* Set the emitter parameters. */\n  yaml_output_buffer_t out = {/*buf=*/NULL, /*size=*/0, /*capacity=*/1000};\n  yaml_emitter_set_output(&emitter, yaml_write_handler, &out);\n\n  yaml_emitter_set_canonical(&emitter, is_canonical);\n  yaml_emitter_set_unicode(&emitter, is_unicode);\n\n  /* The main loop. */\n\n  while (!done) {\n    /* Get the next event. */\n\n    if (!yaml_parser_load(&parser, &document))\n      break;\n\n    /* Check if this is the stream end. */\n\n    done = (!yaml_document_get_root_node(&document));\n\n    /* Emit the event. */\n\n    if (!yaml_emitter_dump(&emitter, &document))\n      break;\n  }\n\n  free(out.buf);\n  yaml_emitter_delete(&emitter);\n\ncleanup_parser:\n\n  yaml_parser_delete(&parser);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_reformatter_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include \"yaml_write_handler.h\"\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 2)\n    return 0;\n\n  bool done = false;\n  bool is_canonical = data[0] & 1;\n  bool is_unicode = data[1] & 1;\n  data += 2;\n  size -= 2;\n\n  yaml_parser_t parser;\n  yaml_emitter_t emitter;\n  yaml_event_t event;\n\n  /* Initialize the parser and emitter objects. */\n\n  if (!yaml_parser_initialize(&parser))\n    return 0;\n\n  if (!yaml_emitter_initialize(&emitter))\n    goto cleanup_parser;\n\n  /* Set the parser parameters. */\n\n  yaml_parser_set_input_string(&parser, data, size);\n\n  /* Set the emitter parameters. */\n  yaml_output_buffer_t out = {/*buf=*/NULL, /*size=*/0, /*capacity=*/1000};\n  yaml_emitter_set_output(&emitter, yaml_write_handler, &out);\n\n  yaml_emitter_set_canonical(&emitter, is_canonical);\n  yaml_emitter_set_unicode(&emitter, is_unicode);\n\n  /* The main loop. */\n\n  while (!done) {\n    /* Get the next event. */\n\n    if (!yaml_parser_parse(&parser, &event))\n      break;\n\n    /* Check if this is the stream end. */\n\n    done = (event.type == YAML_STREAM_END_EVENT);\n\n    /* Emit the event. */\n\n    if (!yaml_emitter_emit(&emitter, &event))\n      break;\n  }\n\n  free(out.buf);\n  yaml_emitter_delete(&emitter);\n\ncleanup_parser:\n\n  yaml_parser_delete(&parser);\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/libyaml_scanner_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"yaml.h\"\n#include <assert.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdint.h>\n#include <stdbool.h>\n\n#ifdef NDEBUG\n#undef NDEBUG\n#endif\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  yaml_parser_t parser;\n  yaml_token_t token;\n  bool done = false;\n\n  if(!yaml_parser_initialize(&parser))\n    return 0;\n\n  yaml_parser_set_input_string(&parser, data, size);\n\n  while (!done)\n  {\n      if (!yaml_parser_scan(&parser, &token)) {\n          break;\n      }\n\n      done = (token.type == YAML_STREAM_END_TOKEN);\n\n      yaml_token_delete(&token);\n  }\n\n  yaml_parser_delete(&parser);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/libyaml/project.yaml",
    "content": "homepage: https://github.com/yaml/libyaml\nlanguage: c++\nprimary_contact: ingy@ingy.net\nauto_ccs:\n- perlpunks@googlemail.com\nfuzzing_engines:\n- libfuzzer\n- afl\n- honggfuzz\nsanitizers:\n- address\n- memory\n- undefined\narchitectures:\n- x86_64\n- i386\nmain_repo: https://github.com/yaml/libyaml\n"
  },
  {
    "path": "projects/libyaml/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer and run unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nmake check -C tests -j$(nproc)\n"
  },
  {
    "path": "projects/libyaml/yaml.dict",
    "content": "\"[\"\n\"]\"\n\"{\"\n\"}\"\n\"-\"\n\",\"\n\"&\"\n\"<<\"\n\":\"\n\"|\"\n\"!!\"\n\">\"\n\"\\\"\"\n\"'\"\n\ninteger=\"123\"\nfloat=\"12.5\"\nmantissa=\"1.3e+9\"\n"
  },
  {
    "path": "projects/libyaml/yaml_write_handler.h",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef YAML_WRITE_HANDLER_H_\n#define YAML_WRITE_HANDLER_H_\n\ntypedef struct yaml_output_buffer {\n  unsigned char *buf;\n  size_t size;\n  size_t capacity;\n} yaml_output_buffer_t;\n\nstatic int yaml_write_handler(void *data, unsigned char *buffer, size_t size) {\n  size_t newsize;\n  yaml_output_buffer_t *out = (yaml_output_buffer_t *)data;\n\n  /* Double buffer size whenever necessary */\n  if (out->size + size >= out->capacity) {\n    newsize = out->capacity << 1;\n    if (newsize < out->size + size) {\n      newsize = out->size + size;\n    }\n    out->buf = (unsigned char *)realloc(out->buf, newsize);\n    out->capacity = newsize;\n  }\n  if (!out->buf) {\n    out->size = 0;\n    return 0;\n  }\n\n  memcpy(out->buf + out->size, buffer, size);\n  out->size += size;\n  return 1;\n}\n\n#endif // YAML_WRITE_HANDLER_H_\n"
  },
  {
    "path": "projects/libyang/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake libtool libcmocka-dev\nRUN git clone https://github.com/CESNET/libyang\n\nRUN git clone https://github.com/PCRE2Project/pcre2 pcre2 && \\\n    cd pcre2 && \\\n    ./autogen.sh && \\\n    ./configure && \\\n    make && \\\n    make install\n\nWORKDIR $SRC/libyang\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/libyang/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit checkout devel\n\nmkdir build && cd build\ncmake -DBUILD_SHARED_LIBS=OFF -DENABLE_TOOLS=OFF ..\nmake\n\nstatic_pcre=($(find /src/pcre2 -name \"libpcre2-8.a\"))\n\nfor fuzzer in lyd_parse_mem_json lyd_parse_mem_xml lys_parse_mem; do\n  $CC $CFLAGS -c ../tests/fuzz/${fuzzer}.c -I./libyang -I./compat\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE ${fuzzer}.o -o $OUT/${fuzzer} \\\n    ./libyang.a ${static_pcre}\ndone\n\n# Build test\nmkdir $SRC/libyang/build-test\ncd $SRC/libyang/build-test\ncmake -DCMAKE_BUILD_TYPE=Debug ..\nmake\n"
  },
  {
    "path": "projects/libyang/project.yaml",
    "content": "homepage: \"https://github.com/CESNET/libyang\"\nmain_repo: 'https://github.com/CESNET/libyang'\nprimary_contact: \"mvasko@cesnet.cz\"\nlanguage: c\nauto_ccs:\n  - \"mv6606@gmail.com\"\n  - \"david@adalogics.com\"\n  - \"warband.times@gmail.com\"\n  - \"juraj.vijtiuk@sartura.hr\"\nsanitizers:\n  - address\n  - memory\n"
  },
  {
    "path": "projects/libyang/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build-test\n"
  },
  {
    "path": "projects/libyuv/project.yaml",
    "content": "homepage: \"https://chromium.googlesource.com/libyuv/libyuv/\"\nmain_repo: \"https://chromium.googlesource.com/libyuv/libyuv\"\nlanguage: c++\nprimary_contact: \"mikhal@webrtc.org\"\nauto_ccs:\n    - \"fbarchard@google.com\"\n    - \"frkoenig@google.com\"\nvendor_ccs:\n    - \"ansgoel@microsoft.com\"\n    - \"jonorman@microsoft.com\"\nfuzzing_engines:\n    - libfuzzer\n    - afl\nsanitizers:\n    - address\n    - memory\n    - undefined\n"
  },
  {
    "path": "projects/libzip/Dockerfile",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n\nRUN apt-get update && apt-get install -y cmake pkg-config zlib1g-dev libbz2-dev liblzma-dev libzstd-dev\n\nRUN git clone --depth 1 https://github.com/nih-at/libzip.git\n\nWORKDIR libzip\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/libzip/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project\n$SRC/libzip/ossfuzz/ossfuzz.sh\n"
  },
  {
    "path": "projects/libzip/project.yaml",
    "content": "homepage: \"https://libzip.org/\"\nlanguage: c++\nprimary_contact: \"libzip@nih.at\"\nauto_ccs:\n  - \"randy440088@gmail.com\"\n  - \"tk@giga.or.at\"\nsanitizers:\n  - address\n  - undefined\n# Disable MSAN because it does not support using other libraries (openssl, zlib) correctly\n#  - memory\nmain_repo: 'https://github.com/nih-at/libzip.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libzmq/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool gettext pkg-config build-essential\nRUN git clone --depth 1 https://github.com/zeromq/libzmq.git\nRUN git clone --depth 1 https://github.com/zeromq/libzmq-fuzz-corpora.git\nRUN git clone --depth 1 -b stable https://github.com/jedisct1/libsodium.git\nWORKDIR libzmq\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/libzmq/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n# Copyright 2020 Luca Boccassi <bluca@debian.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n${SRC}/libzmq/builds/fuzz/ci_build.sh\n"
  },
  {
    "path": "projects/libzmq/project.yaml",
    "content": "homepage: \"https://github.com/zeromq/libzmq\"\nlanguage: c++\nprimary_contact: \"bluca@debian.org\"\nauto_ccs:\n  - \"luca.boccassi@gmail.com\"\n  - \"somdoron@gmail.com\"\n  - \"simon.giesecke@gmail.com\"\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/zeromq/libzmq.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/libzmq/run_tests.sh",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake check\n"
  },
  {
    "path": "projects/lighttpd/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y libz-dev libpcre2-dev libtool pkg-config autoconf\nRUN git clone https://github.com/lighttpd/lighttpd1.4\n\nWORKDIR $SRC/lighttpd1.4\nCOPY *.sh $SRC/\nCOPY fuzz_* $SRC/\n"
  },
  {
    "path": "projects/lighttpd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\n./configure --without-pcre --enable-static\nmake\ncd src\n$CC $CFLAGS -c $SRC/fuzz_burl.c -I. -I../include\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_burl.o lighttpd-burl.o lighttpd-buffer.o lighttpd-base64.o lighttpd-ck.o -o $OUT/fuzz_burl\n"
  },
  {
    "path": "projects/lighttpd/fuzz_burl.c",
    "content": "/* Copyright 2021 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n\n#include \"burl.h\"\n#include \"buffer.h\"\n\nvoid run_burl_normalize (buffer *psrc, buffer *ptmp, \n\t\t\t\t\t\tint flags, int line, const char *in, \n\t\t\t\t\t\tsize_t in_len) {\n    int qs;\n    buffer_copy_string_len(psrc, in, in_len);\n    qs = burl_normalize(psrc, ptmp, flags);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size <= 4) {\n        return 0;\n    }\n    int flags = ((int*)data)[0];\n    data += 4;\n    size -= 4;\n    char *new_str = (char *)malloc(size+1);\n    if (new_str == NULL){\n        return 0;\n    }\n    memcpy(new_str, data, size);\n    new_str[size] = '\\0';\n\n    /* main fuzzer entrypoint for library */\n    buffer *psrc = buffer_init();\n    buffer *ptmp = buffer_init();\n    run_burl_normalize(psrc, ptmp, flags, __LINE__, new_str, size);\n    buffer_urldecode_path(psrc);\n\n    buffer_free(psrc);\n    buffer_free(ptmp);\n    free(new_str);\n    return 0;     \n}\n"
  },
  {
    "path": "projects/lighttpd/project.yaml",
    "content": "homepage: \"https://www.lighttpd.net/\"\nprimary_contact: \"lighttpd.fuzz@gmail.com\"\nlanguage: c\nauto_ccs :\n  - \"david@adalogics.com\"\nmain_repo: \"https://github.com/lighttpd/lighttpd1.4\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/lighttpd/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/lima/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/lima-vm/lima\nWORKDIR lima\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/lima/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./hack/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/lima/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://lima-vm.io/\"\nlanguage: go\nprimary_contact: \"jdubois@suse.com\"\nmain_repo: \"https://github.com/lima-vm/lima\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/linkerd2/Dockerfile",
    "content": "# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/linkerd/linkerd2\nCOPY build.sh $SRC/\nWORKDIR $SRC/linkerd2\n"
  },
  {
    "path": "projects/linkerd2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport FUZZER_DIR=$SRC/linkerd2/test/fuzzing\n\ncompile_go_fuzzer github.com/linkerd/linkerd2/pkg/profiles FuzzProfilesValidate FuzzProfilesValidate\ncompile_go_fuzzer github.com/linkerd/linkerd2/pkg/profiles FuzzRenderProto FuzzRenderProto\ncompile_go_fuzzer github.com/linkerd/linkerd2/controller/api/destination FuzzAdd FuzzAdd\ncompile_go_fuzzer github.com/linkerd/linkerd2/controller/api/destination FuzzGet FuzzGet\ncompile_go_fuzzer github.com/linkerd/linkerd2/controller/api/destination FuzzGetProfile FuzzGetProfile\ncompile_go_fuzzer github.com/linkerd/linkerd2/controller/api/destination FuzzProfileTranslatorUpdate FuzzProfileTranslatorUpdate\ncompile_go_fuzzer github.com/linkerd/linkerd2/pkg/healthcheck FuzzFetchCurrentConfiguration FuzzFetchCurrentConfiguration\ncompile_go_fuzzer github.com/linkerd/linkerd2/pkg/inject FuzzInject FuzzInject\ncompile_go_fuzzer github.com/linkerd/linkerd2/pkg/identity FuzzServiceCertify FuzzServiceCertify\ncompile_go_fuzzer github.com/linkerd/linkerd2/test/fuzzing FuzzParseContainerOpaquePorts FuzzParseContainerOpaquePorts\ncompile_go_fuzzer github.com/linkerd/linkerd2/test/fuzzing FuzzParsePorts FuzzParsePorts\ncompile_go_fuzzer github.com/linkerd/linkerd2/test/fuzzing FuzzHealthCheck FuzzHealthCheck\n"
  },
  {
    "path": "projects/linkerd2/project.yaml",
    "content": "homepage: \"https://linkerd.io/\"\nmain_repo: \"https://github.com/linkerd/linkerd2\"\nprimary_contact: \"ver@buoyant.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"eliza@buoyant.io\"\n  - \"kevinl@buoyant.io\"\n  - \"david@buoyant.io\"\n  - \"alex@buoyant.io\"\n  - \"matei@buoyant.io\"\n  - \"alpeb@buoyant.io\"\n  - \"zahari@buoyant.io\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/linkerd2-proxy/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get --yes update \\\n   && apt-get install --no-install-recommends --yes \\\n   libssl-dev \\\n   pkg-config \\\n   python \\\n   && apt-get clean \\\n   && rm --recursive --force /var/lib/apt/lists/*\n\nRUN git clone --depth 1 https://github.com/linkerd/linkerd2-proxy\n\nCOPY build.sh $SRC/\nWORKDIR $SRC\n\nCOPY rustc.py $SRC/\n"
  },
  {
    "path": "projects/linkerd2-proxy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  export RUSTFLAGS=\"$RUSTFLAGS -C debug-assertions=no\"\n  chmod +x $SRC/rustc.py\n  export RUSTC=\"$SRC/rustc.py\"\n  export CFLAGS=\"\"\nfi\n\nBUILD_FUZZER=\"cargo fuzz build \"\nTARGET_PATH=\"./fuzz/target/x86_64-unknown-linux-gnu/release\"\nBASE=\"$SRC/linkerd2-proxy/linkerd\"\n\ncd ${BASE}/app/inbound\n${BUILD_FUZZER}\ncp ${TARGET_PATH}/fuzz_target_1 $OUT/fuzz_inbound\n\ncd ${BASE}/addr/\n${BUILD_FUZZER}\ncp ${TARGET_PATH}/fuzz_target_1 $OUT/fuzz_addr\n\ncd ${BASE}/dns\n${BUILD_FUZZER}\ncp ${TARGET_PATH}/fuzz_target_1 $OUT/fuzz_dns\n\ncd ${BASE}/proxy/http\n${BUILD_FUZZER}\ncp ${TARGET_PATH}/fuzz_target_1 $OUT/fuzz_http\n\ncd ${BASE}/tls\n${BUILD_FUZZER}\ncp ${TARGET_PATH}/fuzz_target_1 $OUT/fuzz_tls\n\ncd ${BASE}/transport-header\n${BUILD_FUZZER}\ncp ${TARGET_PATH}/fuzz_target_raw $OUT/fuzz_transport_raw\ncp ${TARGET_PATH}/fuzz_target_structured $OUT/fuzz_transport_structured\n\necho \"[libfuzzer]\" > $OUT/fuzz_transport_raw.options\necho \"detect_leaks=0\" >> $OUT/fuzz_transport_raw.options\n"
  },
  {
    "path": "projects/linkerd2-proxy/project.yaml",
    "content": "homepage: \"https://linkerd.io/\"\nmain_repo: \"https://github.com/linkerd/linkerd2-proxy\"\nprimary_contact: \"ver@buoyant.io\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"eliza@buoyant.io\"\n  - \"kevinl@buoyant.io\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/linkerd2-proxy/rustc.py",
    "content": "#!/usr/bin/env python\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport subprocess\n\n#Disable coverage for troubling crates.\nsys.argv[0] = \"rustc\"\nif \"tokio_util\" in sys.argv or \"hyper\" in sys.argv:\n    try:\n        sys.argv.remove(\"-Zinstrument-coverage\")\n    except:\n        pass\n    print(sys.argv)\nsubprocess.call(sys.argv)\n"
  },
  {
    "path": "projects/lit/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/lit/lit\n\nCOPY fuzz.js $SRC/lit\nCOPY babel.config.json $SRC/lit\n\nWORKDIR $SRC/lit\n"
  },
  {
    "path": "projects/lit/babel.config.json",
    "content": "{\n  \"presets\": [\"@babel/preset-typescript\"],\n  \"plugins\": [\n    \"@babel/plugin-transform-modules-commonjs\",\n    \"@babel/plugin-transform-typescript\"\n  ],\n  \"ignore\": [\"**/@jazzer.js\", \"**/@babel\", \"**/istanbul-reports\"]\n}\n"
  },
  {
    "path": "projects/lit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfunction change_type_to_commonjs() {\n\t# Find all package.json files inside the node_modules directory\n\tfind \"$1\" -name \"package.json\" -type f | while read -r package_file; do\n\t\t# Check if the file contains the \"type\" field\n\t\tif grep -q '\"type\": \"module\"' \"$package_file\"; then\n\t\t\t# Replace \"type\": \"module\" with \"type\": \"commonjs\"\n\t\t\tsed -i 's/\"type\": \"module\"/\"type\": \"commonjs\"/' \"$package_file\"\n\t\t\techo \"Updated $package_file\"\n\t\tfi\n\tdone\n}\n\n# Install dependencies.\nnpm install -g @babel/cli\nnpm install --save-dev @babel/core \\\n\t@babel/plugin-transform-modules-commonjs \\\n\t@babel/preset-typescript \\\n\t@jazzer.js/core\n\n# Build Lit\nnpm install\nnpm run build\n\nchange_type_to_commonjs \"$SRC/lit\"\n\n# Build Fuzzers\n# The last bits are necessary to make the fuzzer run in the OSS-Fuzz execution\n# environment.\ncompile_javascript_fuzzer lit fuzz.js -i lit --sync &&\n\tpushd \"$OUT\" &&\n\tcp -r lit/babel.config.json lit/node_modules \"$(pwd)\" &&\n\tpopd\n"
  },
  {
    "path": "projects/lit/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst { LitElement, html } = require('./packages/lit/index');\n\nmodule.exports.fuzz = function(data) {\n  try {\n    const provider = new FuzzedDataProvider(data);\n    const element = new LitElement();\n    const properties = {};\n    const numProperties = provider.consumeIntegralInRange(0, 32);\n    const template = provider.consumeString(\n      provider.consumeIntegralInRange(0, 4096)\n    );\n\n    for (let i = 0; i < numProperties; i++) {\n      const key = provider.consumeString(32);\n      let value;\n      switch (provider.consumeIntegralInRange(0, 7)) {\n        case 0:\n          value = provider.consumeBoolean();\n          break;\n        case 1:\n          value = provider.consumeIntegralInRange(0, 2 ** 48 - 1);\n          break;\n        case 2:\n          value = provider.consumeIntegralInRange(-(2 ** 48 - 1), 0);\n          break;\n        case 3:\n          value = provider.consumeString(\n            provider.consumeIntegralInRange(0, 256)\n          );\n          break;\n        case 4:\n          value = provider.consumeFloat();\n          break;\n        case 5:\n          value = provider.consumeDouble();\n          break;\n        case 6:\n          const isSigned = provider.consumeBoolean();\n          value = provider.consumeBigIntegral(8, isSigned);\n          break;\n        default:\n          value = null;\n      }\n      properties[key] = value;\n    }\n\n    element.render(html`${template}`);\n    element.update(properties);\n\n    const attributeName = provider.consumeString(\n      provider.consumeIntegralInRange(0, 128)\n    );\n    const attributeValue = provider.consumeString(\n      provider.consumeIntegralInRange(0, 128)\n    );\n    element.attributeChangedCallback(attributeName, null, attributeValue);\n    element.connectedCallback();\n    element.disconnectedCallback();\n    element.shouldUpdate(properties);\n\n    const propKey = provider.consumeString(\n      provider.consumeIntegralInRange(0, 256)\n    );\n    const attrKey = provider.consumeString(\n      provider.consumeIntegralInRange(0, 256)\n    );\n    const propValue = provider.consumeString(\n      provider.consumeIntegralInRange(0, 256)\n    );\n    const attrValue = provider.consumeString(\n      provider.consumeIntegralInRange(0, 256)\n    );\n\n    Object.defineProperty(element, propKey, {\n      get() {\n        return propValue;\n      },\n      set(value) {\n        propValue = value;\n      },\n    });\n\n    element.setAttribute(attrKey, attrValue);\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = ['Cannot read properties'];\n\n"
  },
  {
    "path": "projects/lit/project.yaml",
    "content": "homepage: https://lit.dev/\nlanguage: javascript\nmain_repo: https://github.com/lit/lit\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/litmuschaos/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/litmuschaos/litmus.git\nRUN git clone https://github.com/litmuschaos/chaos-exporter.git\nRUN git clone https://github.com/litmuschaos/litmus-go.git\nRUN git clone https://github.com/litmuschaos/litmusctl.git\nRUN git clone https://github.com/litmuschaos/chaos-runner.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/litmus\n"
  },
  {
    "path": "projects/litmuschaos/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/litmus/chaoscenter/fuzz_build.sh"
  },
  {
    "path": "projects/litmuschaos/project.yaml",
    "content": "homepage: \"https://litmuschaos.io/\"\nmain_repo: \"https://github.com/litmuschaos/litmus.git\"\nprimary_contact: \"saranya.jena@harness.io\"\nauto_ccs :\n  - \"karthik.s@harness.io\"\n  - \"rajbabu.das@harness.io\"\n  - \"vedant.shrotria@harness.io\"\n  - \"sarthak.jain@harness.io\"\n  - \"shubham.chaudhary@harness.io\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/llamacpp/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake xxd\nRUN git clone https://github.com/ggerganov/llama.cpp\nWORKDIR $SRC/llama.cpp\nCOPY build.sh $SRC/\nCOPY fuzzers $SRC/llama.cpp/fuzzers\n"
  },
  {
    "path": "projects/llamacpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport GGML_NO_OPENMP=1\n\n# Avoid function that forks + starts instance of gdb.\nsed -i 's/ggml_print_backtrace();//g' ./ggml/src/ggml.c\n\n# Remove statefulness during fuzzing.\nsed -i 's/static bool is_first_call/bool is_first_call/g' ./ggml/src/ggml.c\n\n# Patch callocs to avoid allocating large chunks.\nsed -i 's/ggml_calloc(size_t num, size_t size) {/ggml_calloc(size_t num, size_t size) {\\nif ((num * size) > 9000000) {GGML_ABORT(\"calloc err\");}\\n/g' -i ./ggml/src/ggml.c\n\n# Patch a potentially unbounded loop that causes timeouts\nsed -i 's/ok = ok \\&\\& (info->n_dims <= GGML_MAX_DIMS);/ok = ok \\&\\& (info->n_dims <= GGML_MAX_DIMS);\\nif (!ok) {fclose(file); gguf_free(ctx); return NULL;}/g' ./ggml/src/ggml.c\n\n# Build with CMake\nmkdir build\ncd build\ncmake .. -DBUILD_SHARED_LIBS=OFF -DGGML_NO_OPENMP=1 -DLLAMA_BUILD_SERVER=ON -DLLAMA_BUILD_EXAMPLES=ON -DLLAMA_BUILD_TOOLS=ON -DLLAMA_CURL=OFF\ncmake --build . --config Release -j$(nproc) --target llama-gguf llama-server\ncd ..\n\n# Convert models into header files so we can use them for fuzzing.\nxxd -i models/ggml-vocab-bert-bge.gguf > model_header_bge.h\nxxd -i models/ggml-vocab-llama-bpe.gguf > model_header_bpe.h\nxxd -i models/ggml-vocab-llama-spm.gguf > model_header_spm.h\nxxd -i models/ggml-vocab-qwen2.gguf > model_header_qwen2.h\nxxd -i models/ggml-vocab-command-r.gguf > model_header_command_r.h\nxxd -i models/ggml-vocab-aquila.gguf > model_header_aquila.h\nxxd -i models/ggml-vocab-gpt-2.gguf > model_header_gpt_2.h\nxxd -i models/ggml-vocab-baichuan.gguf > model_header_baichuan.h\nxxd -i models/ggml-vocab-deepseek-coder.gguf > model_header_deepseek_coder.h\nxxd -i models/ggml-vocab-falcon.gguf > model_header_falcon.h\n\n# Configure flags and libraries\n# Note: -lcommon must come before -lllama, and -lllama before -lggml\nLIBS=\"-Lbuild/common -lcommon -Lbuild/src -lllama -Lbuild/ggml/src -lggml -lggml-cpu -lggml-base -Lbuild/vendor/cpp-httplib -lcpp-httplib\"\nFLAGS=\"-std=c++17 -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon -Ivendor -I./ -DNDEBUG -DGGML_USE_LLAMAFILE\"\n\n$CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} fuzzers/fuzz_json_to_grammar.cpp -o $OUT/fuzz_json_to_grammar $LIBS\n$CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} fuzzers/fuzz_apply_template.cpp -o $OUT/fuzz_apply_template $LIBS\n$CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} fuzzers/fuzz_grammar.cpp -o $OUT/fuzz_grammar $LIBS\n\n$CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} \\\n    -Wl,--wrap,abort fuzzers/fuzz_load_model.cpp -o $OUT/fuzz_load_model $LIBS\n\n$CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} \\\n    -Wl,--wrap,abort fuzzers/fuzz_inference.cpp -o $OUT/fuzz_inference $LIBS\n\n$CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} \\\n    -Wl,--wrap,abort fuzzers/fuzz_structured.cpp -o $OUT/fuzz_structured $LIBS\n\n#$CXX $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} \\\n#    -Wl,--wrap,abort fuzzers/fuzz_structurally_created.cpp -o $OUT/fuzz_structurally_created $LIBS\n\n# Prepare some dicts and seeds\nbuild/bin/llama-gguf dummy.gguf w\nmkdir $SRC/load-model-corpus\nmv dummy.gguf $SRC/load-model-corpus/\nzip -j $OUT/fuzz_load_model_seed_corpus.zip $SRC/load-model-corpus/*\ncp $OUT/fuzz_load_model_seed_corpus.zip $OUT/fuzz_inference_seed_corpus.zip\n\necho \"[libfuzzer]\" > $OUT/fuzz_load_model.options\necho \"detect_leaks=0\" >> $OUT/fuzz_load_model.options\n\ncp $OUT/fuzz_load_model.options $OUT/fuzz_inference.options\ncp $OUT/fuzz_load_model.options $OUT/fuzz_structured.options\ncp $OUT/fuzz_load_model.options $OUT/fuzz_structurally_created.options\ncp fuzzers/llama.dict $OUT/fuzz_load_model.dict\ncp fuzzers/llama.dict $OUT/fuzz_inference.dict\ncp fuzzers/llama.dict $OUT/fuzz_grammar.dict\ncp fuzzers/llama.dict $OUT/fuzz_structured.dict\ncp fuzzers/llama.dict $OUT/fuzz_json_to_grammar.dict\n\n\n# Below harnesses are disabled because there seems to be an insta FP in them.\n#if [ \"$FUZZING_ENGINE\" != \"afl\" ]\n#then\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_BGE fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_bge $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_BPE  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_bpe $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_SPM  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_spm $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_COMMAND_R  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_command_r $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_AQUILA  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_aquila $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_QWEN2  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_qwen2 $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_GPT_2  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_gpt_2 $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_BAICHUAN  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_baichuan $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_DEEPSEEK_CODER  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_deepseek_coder $LIBS\n#    $CXX -Wl,--wrap,abort $LIB_FUZZING_ENGINE $CXXFLAGS ${FLAGS} -DFUZZ_FALCON  fuzzers/fuzz_tokenizer.cpp -o $OUT/fuzz_tokenizer_falcon $LIBS\n#fi\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_apply_template.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"llama.h\"\n#include <fuzzer/FuzzedDataProvider.h>\n\nchar buf[4096];\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fuzzed_data(data, size);\n\n  std::string p1 = fuzzed_data.ConsumeRandomLengthString();\n  std::string p2 = fuzzed_data.ConsumeRandomLengthString();\n  std::string p3 = fuzzed_data.ConsumeRandomLengthString();\n  std::string p4 = fuzzed_data.ConsumeRandomLengthString();\n  std::string p5 = fuzzed_data.ConsumeRandomLengthString();\n  std::string p6 = fuzzed_data.ConsumeRandomLengthString();\n  std::string p7 = fuzzed_data.ConsumeRandomLengthString();\n\n  llama_chat_message conversation[] = {\n      {\"system\", p2.c_str()},    {\"user\", p3.c_str()},\n      {\"assistant\", p4.c_str()}, {\"user\", p5.c_str()},\n      {\"assistant\", p6.c_str()}, {\"user\", p7.c_str()},\n  };\n  size_t message_count = 6;\n\n  llama_chat_apply_template(p1.c_str(), conversation, message_count,\n                            true, buf, 4096);\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_grammar.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <string>\n#include \"llama.h\"\n#include \"llama-grammar.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  std::string payload(reinterpret_cast<const char *>(data), size);\n\n  llama_grammar_parser parsed_grammar;\n  parsed_grammar.parse(payload.c_str());\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_inference.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"common.h\"\n#include \"llama.h\"\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <iostream>\n#include <setjmp.h>\n#include <unistd.h>\n#include <vector>\n\njmp_buf fuzzing_jmp_buf;\n\nextern \"C\" void __wrap_abort(void) { longjmp(fuzzing_jmp_buf, 1); }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  FuzzedDataProvider fdp(data, size);\n\n  std::string model_payload = fdp.ConsumeRandomLengthString();\n  if (model_payload.size() < 10) {\n    return 0;\n  }\n  model_payload[0] = 'G';\n  model_payload[1] = 'G';\n  model_payload[2] = 'U';\n  model_payload[3] = 'F';\n\n  std::string prompt = fdp.ConsumeRandomLengthString();\n\n  llama_backend_init();\n\n  common_params params;\n  params.prompt = prompt.c_str();\n  params.n_predict = 4;\n\n  // Create and load the model\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(model_payload.c_str(), model_payload.size(), 1, fp);\n  fclose(fp);\n\n  llama_model_params model_params = common_model_params_to_llama(params);\n  model_params.use_mmap = false;\n\n  const int n_predict = params.n_predict;\n  if (setjmp(fuzzing_jmp_buf) == 0) {\n    auto *model = llama_load_model_from_file(filename, model_params);\n    if (model != nullptr) {\n\n      // Now time to do inference.\n      llama_context_params ctx_params =\n          common_context_params_to_llama(params);\n      llama_context *ctx = llama_new_context_with_model(model, ctx_params);\n      if (ctx != NULL) {\n          /*\n        std::vector<llama_token> tokens_list;\n        tokens_list = ::llama_tokenize(ctx, params.prompt, true);\n\n        const int n_ctx = llama_n_ctx(ctx);\n        const int n_kv_req =\n            tokens_list.size() + (n_predict - tokens_list.size());\n\n        if (n_kv_req <= n_ctx) {\n          llama_batch batch = llama_batch_init(512, 0, 1);\n\n          for (size_t i = 0; i < tokens_list.size(); i++) {\n            llama_batch_add(batch, tokens_list[i], i, {0}, false);\n          }\n\n          // set to only output logits for last token\n          batch.logits[batch.n_tokens - 1] = true;\n          if (llama_decode(ctx, batch) == 0) {\n            int n_cur = batch.n_tokens;\n            while (n_cur <= n_predict) {\n              {\n                auto n_vocab = llama_n_vocab(model);\n                auto *logits = llama_get_logits_ith(ctx, batch.n_tokens - 1);\n\n                std::vector<llama_token_data> candidates;\n                candidates.reserve(n_vocab);\n\n                for (llama_token token_id = 0; token_id < n_vocab; token_id++) {\n                  candidates.emplace_back(\n                      llama_token_data{token_id, logits[token_id], 0.0f});\n                }\n\n                llama_token_data_array candidates_p = {\n                    candidates.data(), candidates.size(), false};\n\n                // sample the most likely token\n                const llama_token new_token_id =\n                    llama_sample_token_greedy(ctx, &candidates_p);\n\n                // exit if end of generation\n                if (llama_token_is_eog(model, new_token_id) ||\n                    n_cur == n_predict) {\n                  break;\n                }\n\n                // Prepare for next iteration\n                llama_batch_clear(batch);\n                llama_batch_add(batch, new_token_id, n_cur, {0}, true);\n              }\n\n              n_cur += 1;\n\n              if (llama_decode(ctx, batch)) {\n                break;\n              }\n            }\n          }\n          llama_batch_free(batch);\n        }\n        */\n        llama_free(ctx);\n      }\n\n      llama_free_model(model);\n    }\n  }\n  llama_backend_free();\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_json_to_grammar.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"llama.h\"\n#include \"llama-grammar.h\"\n#include \"json-schema-to-grammar.h\"\n#include <nlohmann/json.hpp>\n\nusing json = nlohmann::json;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  try {\n    json_schema_to_grammar(json::parse(data, data + size));\n  } catch (...) {\n    return 0;\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_load_model.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"llama.h\"\n#include <iostream>\n#include <setjmp.h>\n#include <unistd.h>\n\nconst char *model_arch = \"llama\";\nconst char *gen_arch = \"general.architecture\";\njmp_buf fuzzing_jmp_buf;\n\nstruct llama_model_kv_override fuzz_kv_overrides[2];\n\nextern \"C\" void __wrap_abort(void) { longjmp(fuzzing_jmp_buf, 1); }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  llama_backend_init();\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  auto params = llama_model_params{};\n  memset(&params, 0x0, sizeof(struct llama_model_params));\n  params.use_mmap = false;\n  params.progress_callback = [](float progress, void *ctx) {\n    (void)ctx;\n    return progress > 0.50;\n  };\n\n  fuzz_kv_overrides[0].tag = LLAMA_KV_OVERRIDE_TYPE_STR;\n  strcpy(fuzz_kv_overrides[0].val_str, model_arch);\n  std::strcpy(fuzz_kv_overrides[0].key, gen_arch);\n\n  params.kv_overrides =\n      (const struct llama_model_kv_override *)fuzz_kv_overrides;\n\n  if (setjmp(fuzzing_jmp_buf) == 0) {\n    auto *model = llama_load_model_from_file(filename, params);\n    if (model != nullptr) {\n      llama_free_model(model);\n    }\n  }\n  llama_backend_free();\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_structurally_created.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"llama.h\"\n#include \"gguf.h\"\n#include <fstream>\n#include <iostream>\n#include <map>\n#include <sstream>\n#include <string>\n#include <vector>\n\n#include <setjmp.h>\n#include <unistd.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <string.h>\n\njmp_buf fuzzing_jmp_buf;\n\nenum FUZZ_LLAMA_VALUE_TYPES {\n  FUZZ_STR,\n  FUZZ_BOOL,\n  FUZZ_INT16,\n  FUZZ_UINT16,\n  FUZZ_INT32,\n  FUZZ_UINT32,\n  FUZZ_FLOAT,\n};\n\nllama_model_kv_override_type arrayed_enums[4] = {\n    LLAMA_KV_OVERRIDE_TYPE_INT, LLAMA_KV_OVERRIDE_TYPE_FLOAT,\n    LLAMA_KV_OVERRIDE_TYPE_BOOL, LLAMA_KV_OVERRIDE_TYPE_STR};\n\nstd::map<std::string, FUZZ_LLAMA_VALUE_TYPES> general_map_overrides = {\n    {\"general.name\", FUZZ_STR},\n    {\"split.no\", FUZZ_UINT16},\n    {\"split.count\", FUZZ_UINT16},\n    {\"tokenizer.ggml.model\", FUZZ_STR},\n    {\"tokenizer.ggml.pre\", FUZZ_STR}};\n\nstd::map<std::string, FUZZ_LLAMA_VALUE_TYPES> prefix_map_overrides = {\n    {\".vocab_size\", FUZZ_UINT32},\n    {\".expert_count\", FUZZ_UINT32},\n    {\".feed_forward_length\", FUZZ_UINT32},\n    {\".expert_used_count\", FUZZ_UINT32},\n    {\".context_length\", FUZZ_UINT32},\n    {\".block_count\", FUZZ_UINT32},\n    {\".embedding_length\", FUZZ_UINT32},\n    {\".logit_scale\", FUZZ_UINT32},\n    {\".attention.head_count\", FUZZ_UINT32},\n    {\".leading_dense_block_count\", FUZZ_UINT32},\n    {\".expert_feed_forward_length\", FUZZ_UINT32},\n    {\".expert_shared_feed_forward_length\", FUZZ_UINT32},\n    {\".use_parallel_residual\", FUZZ_BOOL},\n    {\".expert_shared_count\", FUZZ_UINT32},\n    {\".expert_weights_scale\", FUZZ_FLOAT},\n    {\".decoder_start_token_id\", FUZZ_UINT32},\n    {\".attention.layer_norm_epsilon\", FUZZ_FLOAT},\n    {\".attention.layer_norm_rms_epsilon\", FUZZ_FLOAT},\n    {\".attention.key_length\", FUZZ_UINT32},\n    {\".attention.value_length\", FUZZ_UINT32},\n    {\".attention.clamp_kqv\", FUZZ_FLOAT},\n    {\".attention.causal\", FUZZ_BOOL},\n    {\".attention.q_lora_rank\", FUZZ_UINT32},\n    {\".attention.kv_lora_rank\", FUZZ_UINT32},\n    {\".attention.relative_buckets_count\", FUZZ_UINT32},\n    {\".rope.dimension_count\", FUZZ_UINT32},\n    {\".attention.sliding_window\", FUZZ_UINT32},\n    {\".rope.freq_base\", FUZZ_FLOAT},\n    {\".rope.scale_linear\", FUZZ_FLOAT},\n    {\".rope.scaling.type\", FUZZ_STR},\n    {\".rope.scaling.factor\", FUZZ_FLOAT},\n    {\".rope.scaling.attn_factor\", FUZZ_FLOAT},\n    {\".rope.scaling.original_context_length\", FUZZ_UINT32},\n    {\".rope.scaling.finetuned\", FUZZ_BOOL},\n    {\".rope.scaling.yarn_log_multiplier\", FUZZ_FLOAT},\n    {\".ssm.conv_kernel\", FUZZ_UINT32},\n    {\".ssm.inner_size\", FUZZ_UINT32},\n    {\".ssm.state_size\", FUZZ_UINT32},\n    {\".ssm.time_step_rank\", FUZZ_UINT32},\n    {\".ssm.dt_b_c_rms\", FUZZ_BOOL},\n    {\".wkv.head_size\", FUZZ_UINT32},\n    {\".pooling_type\", FUZZ_UINT32},\n    {\".attn_logit_softcapping\", FUZZ_FLOAT},\n    {\".final_logit_softcapping\", FUZZ_FLOAT},\n    {\".rescale_every_n_layers\", FUZZ_UINT32},\n    {\".time_mix_extra_dim\", FUZZ_UINT32},\n    {\".time_decay_extra_dim\", FUZZ_UINT32},\n\n};\n\nstd::vector<std::string> possible_keys = {\n    \"general.type\",\n    \"general.quantization_version\",\n    \"general.alignment\",\n    \"general.author\",\n    \"general.version\",\n    \"general.url\",\n    \"general.description\",\n    \"general.license\",\n    \"general.source.url\",\n    \"general.source.huggingface.repository\",\n    \"split.tensors.count\",\n\n    \"tokenizer.ggml.tokens\",\n    \"tokenizer.ggml.token_type\",\n    \"tokenizer.ggml.token_type_count\",\n    \"tokenizer.ggml.scores\",\n    \"tokenizer.ggml.merges\",\n    \"tokenizer.ggml.bos_token_id\",\n    \"tokenizer.ggml.eos_token_id\",\n    \"tokenizer.ggml.unknown_token_id\",\n    \"tokenizer.ggml.seperator_token_id\",\n    \"tokenizer.ggml.padding_token_id\",\n    \"tokenizer.ggml.cls_token_id\",\n    \"tokenizer.ggml.mask_token_id\",\n    \"tokenizer.ggml.add_bos_token\",\n    \"tokenizer.ggml.add_eos_token\",\n    \"tokenizer.ggml.add_space_prefix\",\n    \"tokenizer.ggml.remove_extra_whitespaces\",\n    \"tokenizer.ggml.precompiled_charsmap\",\n    \"tokenizer.huggingface.json\",\n    \"tokenizer.rwkv.world\",\n    \"tokenizer.ggml.prefix_token_id\",\n    \"tokenizer.ggml.suffix_token_id\",\n    \"tokenizer.ggml.middle_token_id\",\n    \"tokenizer.ggml.eot_token_id\",\n    \"tokenizer.ggml.eom_token_id\",\n    \"adapter.type\",\n    \"adapter.lora.alpha\",\n};\n\nstd::vector<std::string> possible_architectures = {\n    \"llama\",        \"falcon\",   \"grok\",      \"gpt2\",   \"gptj\",  \"gptneox\",\n    \"mpt\",          \"baichuan\", \"starcoder\", \"refact\", \"bert\",  \"nomic-bert\",\n    \"jina-bert-v2\", \"bloom\",    \"stablelm\",  \"qwen\",   \"qwen2\",\n};\n\nextern \"C\" void __wrap_abort(void) { longjmp(fuzzing_jmp_buf, 1); }\n\nstatic bool create_fuzzed_gguf_file(const std::string &fname,\n                                    const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  struct gguf_context *ctx = gguf_init_empty();\n\n  std::string arch_key = \"general.architecture\";\n  uint8_t arch_index =\n      fdp.ConsumeIntegralInRange<uint8_t>(0, possible_architectures.size() - 1);\n\n  std::string arch_val = std::string(possible_architectures[arch_index]);\n\n  gguf_set_val_str(ctx, \"general.architecture\", arch_val.c_str());\n\n  for (auto keyval : general_map_overrides) {\n    if (keyval.second == FUZZ_STR) {\n      uint32_t val_to_set = 0;\n      if (keyval.first.find(\"tokenizer.ggml.model\") != std::string::npos) {\n\n        val_to_set = fdp.ConsumeIntegralInRange<uint32_t>(0, 5);\n        switch (val_to_set) {\n        case 0: {\n          gguf_set_val_str(ctx, keyval.first.c_str(), \"llama\");\n          break;\n        }\n        case 1: {\n          gguf_set_val_str(ctx, keyval.first.c_str(), \"bert\");\n          break;\n        }\n        case 2: {\n          gguf_set_val_str(ctx, keyval.first.c_str(), \"gpt2\");\n          break;\n        }\n        case 3: {\n          gguf_set_val_str(ctx, keyval.first.c_str(), \"t5\");\n          break;\n        }\n        case 4: {\n          gguf_set_val_str(ctx, keyval.first.c_str(), \"rwkv\");\n          break;\n        }\n        case 5: {\n          gguf_set_val_str(ctx, keyval.first.c_str(), \"no_vocab\");\n          break;\n        }\n        default:\n          break;\n        }\n      } else {\n        gguf_set_val_str(ctx, keyval.first.c_str(),\n                         fdp.ConsumeRandomLengthString(32).c_str());\n      }\n    } else if (keyval.second == FUZZ_UINT16) {\n      gguf_set_val_u16(ctx, keyval.first.c_str(),\n                       fdp.ConsumeIntegral<uint16_t>());\n    } else if (keyval.second == FUZZ_INT32) {\n      gguf_set_val_i32(ctx, keyval.first.c_str(),\n                       fdp.ConsumeIntegral<int32_t>());\n    } else if (keyval.second == FUZZ_FLOAT) {\n      gguf_set_val_f32(ctx, keyval.first.c_str(),\n                       fdp.ConsumeFloatingPoint<float>());\n    } else if (keyval.second == FUZZ_BOOL) {\n      gguf_set_val_bool(ctx, keyval.first.c_str(), fdp.ConsumeBool());\n    }\n  }\n\n  for (auto keyval : prefix_map_overrides) {\n    std::string prefix_key = arch_val + keyval.first;\n\n    if (keyval.second == FUZZ_STR) {\n      gguf_set_val_str(ctx, prefix_key.c_str(),\n                       fdp.ConsumeRandomLengthString(32).c_str());\n    } else if (keyval.second == FUZZ_UINT16) {\n      gguf_set_val_u16(ctx, prefix_key.c_str(),\n                       fdp.ConsumeIntegral<uint16_t>());\n    } else if (keyval.second == FUZZ_INT32) {\n      gguf_set_val_i32(ctx, prefix_key.c_str(), fdp.ConsumeIntegral<int32_t>());\n    } else if (keyval.second == FUZZ_UINT32) {\n      uint32_t val_to_set = 0;\n      if (prefix_key.find(\"expert_count\") != std::string::npos) {\n        val_to_set = fdp.ConsumeIntegralInRange<uint32_t>(0, 167);\n      } else if (prefix_key.find(\"expert_used_count\") != std::string::npos) {\n        val_to_set = fdp.ConsumeIntegralInRange<uint32_t>(0, 3);\n      } else if (prefix_key.find(\"block_count\") != std::string::npos) {\n        val_to_set = fdp.ConsumeIntegralInRange<uint32_t>(0, 128);\n      } else {\n        val_to_set = fdp.ConsumeIntegral<uint32_t>();\n      }\n      gguf_set_val_u32(ctx, prefix_key.c_str(), val_to_set);\n    } else if (keyval.second == FUZZ_FLOAT) {\n      gguf_set_val_f32(ctx, prefix_key.c_str(),\n                       fdp.ConsumeFloatingPoint<float>());\n    } else if (keyval.second == FUZZ_BOOL) {\n      gguf_set_val_bool(ctx, prefix_key.c_str(), fdp.ConsumeBool());\n    }\n  }\n\n  struct ggml_init_params params = {\n      /*.mem_size   =*/128ull * 1024ull * 1024ull,\n      /*.mem_buffer =*/NULL,\n      /*.no_alloc   =*/false,\n  };\n\n  struct ggml_context *ctx_data = ggml_init(params);\n\n  const int n_tensors = 10;\n\n  // tensor infos\n  for (int i = 0; i < n_tensors; ++i) {\n    const std::string name = \"tensor_\" + std::to_string(i);\n\n    int64_t ne[GGML_MAX_DIMS] = {1};\n    int32_t n_dims = fdp.ConsumeIntegralInRange<int32_t>(1, GGML_MAX_DIMS);\n\n    for (int j = 0; j < n_dims; ++j) {\n      ne[j] = fdp.ConsumeIntegralInRange<int64_t>(1, 99999);\n    }\n\n    struct ggml_tensor *cur =\n        ggml_new_tensor(ctx_data, GGML_TYPE_F32, n_dims, ne);\n    ggml_set_name(cur, name.c_str());\n\n    {\n      float *data = (float *)cur->data;\n      for (int j = 0; j < ggml_nelements(cur); ++j) {\n        data[j] = 100 + i;\n      }\n    }\n\n    gguf_add_tensor(ctx, cur);\n  }\n\n  gguf_write_to_file(ctx, fname.c_str(), false);\n\n  printf(\"%s: wrote file '%s;\\n\", __func__, fname.c_str());\n\n  ggml_free(ctx_data);\n  gguf_free(ctx);\n\n  return true;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 256) {\n    return 0;\n  }\n  llama_backend_init();\n\n  auto params = llama_model_params{};\n  memset(&params, 0x0, sizeof(struct llama_model_params));\n  params.use_mmap = false;\n  params.progress_callback = [](float progress, void *ctx) {\n    (void)ctx;\n    return progress > 0.50;\n  };\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  create_fuzzed_gguf_file(filename, data, size);\n\n  if (setjmp(fuzzing_jmp_buf) == 0) {\n    auto *model = llama_load_model_from_file(filename, params);\n    if (model != nullptr) {\n      llama_free_model(model);\n    }\n  }\n  llama_backend_free();\n\n  // close any open descriptors.\n  for (int i = 3; i < 1024; i++) {\n    close(i);\n  }\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_structured.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"llama.h\"\n#include <iostream>\n#include <string>\n#include <vector>\n\n#include <setjmp.h>\n#include <unistd.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <string.h>\n\njmp_buf fuzzing_jmp_buf;\n\n#define NUM_OVERRIDES 75\nstruct llama_model_kv_override fuzz_kv_overrides[NUM_OVERRIDES + 1];\n\nllama_model_kv_override_type arrayed_enums[4] = {\n    LLAMA_KV_OVERRIDE_TYPE_INT, LLAMA_KV_OVERRIDE_TYPE_FLOAT,\n    LLAMA_KV_OVERRIDE_TYPE_BOOL, LLAMA_KV_OVERRIDE_TYPE_STR};\n\nstd::vector<std::string> possible_keys = {\n    \"general.type\",\n    \"general.quantization_version\",\n    \"general.alignment\",\n    \"general.name\",\n    \"general.author\",\n    \"general.version\",\n    \"general.url\",\n    \"general.description\",\n    \"general.license\",\n    \"general.source.url\",\n    \"general.source.huggingface.repository\",\n    \"split.no\",\n    \"split.count\",\n    \"split.tensors.count\",\n    \"tokenizer.ggml.model\",\n    \"tokenizer.ggml.pre\",\n    \"tokenizer.ggml.tokens\",\n    \"tokenizer.ggml.token_type\",\n    \"tokenizer.ggml.token_type_count\",\n    \"tokenizer.ggml.scores\",\n    \"tokenizer.ggml.merges\",\n    \"tokenizer.ggml.bos_token_id\",\n    \"tokenizer.ggml.eos_token_id\",\n    \"tokenizer.ggml.unknown_token_id\",\n    \"tokenizer.ggml.seperator_token_id\",\n    \"tokenizer.ggml.padding_token_id\",\n    \"tokenizer.ggml.cls_token_id\",\n    \"tokenizer.ggml.mask_token_id\",\n    \"tokenizer.ggml.add_bos_token\",\n    \"tokenizer.ggml.add_eos_token\",\n    \"tokenizer.ggml.add_space_prefix\",\n    \"tokenizer.ggml.remove_extra_whitespaces\",\n    \"tokenizer.ggml.precompiled_charsmap\",\n    \"tokenizer.huggingface.json\",\n    \"tokenizer.rwkv.world\",\n    \"tokenizer.ggml.prefix_token_id\",\n    \"tokenizer.ggml.suffix_token_id\",\n    \"tokenizer.ggml.middle_token_id\",\n    \"tokenizer.ggml.eot_token_id\",\n    \"tokenizer.ggml.eom_token_id\",\n    \"adapter.type\",\n    \"adapter.lora.alpha\",\n\n};\n\nstd::vector<std::string> possible_architectures = {\n    \"llama\",        \"falcon\",   \"grok\",      \"gpt2\",   \"gptj\",  \"gptneox\",\n    \"mpt\",          \"baichuan\", \"starcoder\", \"refact\", \"bert\",  \"nomic-bert\",\n    \"jina-bert-v2\", \"bloom\",    \"stablelm\",  \"qwen\",   \"qwen2\",\n};\n\nstd::vector<std::string> possible_prefix_keys = {\n    \".vocab_size\",\n    \".context_length\",\n    \".embedding_length\",\n    \".block_count\",\n    \".leading_dense_block_count\",\n    \".feed_forward_length\",\n    \".expert_feed_forward_length\",\n    \".expert_shared_feed_forward_length\",\n    \".use_parallel_residual\",\n    \".tensor_data_layout\",\n    \".expert_count\",\n    \".expert_used_count\",\n    \".expert_shared_count\",\n    \".expert_weights_scale\",\n    \".pooling_type\",\n    \".logit_scale\",\n    \".decoder_start_token_id\",\n    \".attn_logit_softcapping\",\n    \".final_logit_softcapping\",\n    \".rescale_every_n_layers\",\n    \".time_mix_extra_dim\",\n    \".time_decay_extra_dim\",\n    \".attention.head_count\",\n    \".attention.head_count_kv\",\n    \".attention.max_alibi_bias\",\n    \".attention.clamp_kqv\",\n    \".attention.key_length\",\n    \".attention.value_length\",\n    \".attention.layer_norm_epsilon\",\n    \".attention.layer_norm_rms_epsilon\",\n    \".attention.causal\",\n    \".attention.q_lora_rank\",\n    \".attention.kv_lora_rank\",\n    \".attention.relative_buckets_count\",\n    \".attention.sliding_window\",\n    \".rope.dimension_count\",\n    \".rope.freq_base\",\n    \".rope.scale_linear\",\n    \".rope.scaling.type\",\n    \".rope.scaling.factor\",\n    \".rope.scaling.attn_factor\",\n    \".rope.scaling.original_context_length\",\n    \".rope.scaling.finetuned\",\n    \".rope.scaling.yarn_log_multiplier\",\n    \".ssm.conv_kernel\",\n    \".ssm.inner_size\",\n    \".ssm.state_size\",\n    \".ssm.time_step_rank\",\n    \".ssm.dt_b_c_rms\",\n    \".wkv.head_size\",\n};\n\nextern \"C\" void __wrap_abort(void) { longjmp(fuzzing_jmp_buf, 1); }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 256) {\n    return 0;\n  }\n  llama_backend_init();\n  FuzzedDataProvider fdp(data, size);\n\n  auto params = llama_model_params{};\n  memset(&params, 0x0, sizeof(struct llama_model_params));\n  params.use_mmap = false;\n  params.progress_callback = [](float progress, void *ctx) {\n    (void)ctx;\n    return progress > 0.50;\n  };\n\n  int overwrite_idx = 0;\n\n  // set the architecture\n  std::string arch_key = \"general.architecture\";\n  uint8_t arch_index =\n      fdp.ConsumeIntegralInRange<uint8_t>(0, possible_architectures.size() - 1);\n\n  std::string arch_val = std::string(possible_architectures[arch_index]);\n  fuzz_kv_overrides[overwrite_idx].tag = LLAMA_KV_OVERRIDE_TYPE_STR;\n  strcpy(fuzz_kv_overrides[overwrite_idx].key, arch_key.c_str());\n  strcpy(fuzz_kv_overrides[overwrite_idx].val_str, arch_val.c_str());\n  overwrite_idx++;\n\n  for (int i = 0; i < possible_prefix_keys.size(); i++) {\n    std::string key;\n    std::string val;\n\n    // Get the key\n    key = arch_val + possible_prefix_keys[i];\n    val = fdp.ConsumeRandomLengthString(32);\n\n    // Copy the data into the overrides array\n    fuzz_kv_overrides[overwrite_idx].tag = fdp.PickValueInArray(arrayed_enums);\n    strcpy(fuzz_kv_overrides[overwrite_idx].key, key.c_str());\n    strcpy(fuzz_kv_overrides[overwrite_idx].val_str, val.c_str());\n    overwrite_idx++;\n  }\n\n  // Create the model\n  std::string model_payload = fdp.ConsumeRandomLengthString();\n  if (model_payload.size() < 10) {\n    return 0;\n  }\n  model_payload[0] = 'G';\n  model_payload[1] = 'G';\n  model_payload[2] = 'U';\n  model_payload[3] = 'F';\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(model_payload.data(), model_payload.size(), 1, fp);\n  fclose(fp);\n\n  // Override an arbitrary set of arguments\n  for (int i = overwrite_idx; i < NUM_OVERRIDES; i++) {\n    std::string key;\n    std::string val;\n\n    // Get the key\n    if (fdp.ConsumeProbability<float>() > 0.90) {\n      key = fdp.ConsumeRandomLengthString(20);\n    } else {\n      int i = fdp.ConsumeIntegralInRange<int>(0, possible_keys.size() - 1);\n      key = possible_keys[i];\n    }\n    val = fdp.ConsumeRandomLengthString(30);\n\n    // Copy the data into the overrides array\n    fuzz_kv_overrides[i].tag = fdp.PickValueInArray(arrayed_enums);\n    strcpy(fuzz_kv_overrides[i].key, key.c_str());\n    strcpy(fuzz_kv_overrides[i].val_str, val.c_str());\n  }\n\n  // For debugging\n  // std::cout << \"--- overwrote ---\\n\";\n  // for (int m = 0; m < NUM_OVERRIDES-1; m++) {\n  //  std::cout << \"===  \" << fuzz_kv_overrides[m].key << \"\\n\";\n  //}\n  // std::cout << \"#############\\n\";\n\n  params.kv_overrides =\n      (const struct llama_model_kv_override *)fuzz_kv_overrides;\n\n  if (setjmp(fuzzing_jmp_buf) == 0) {\n    auto *model = llama_load_model_from_file(filename, params);\n    if (model != nullptr) {\n      llama_free_model(model);\n    }\n  }\n  llama_backend_free();\n\n  // close any open descriptors.\n  for (int i = 3; i < 1024; i++) {\n    close(i);\n  }\n\n  unlink(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/fuzz_tokenizer.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <unistd.h>\n\n#include \"common.h\"\n#include \"llama.h\"\n\n#include <string>\n#include <vector>\n\n/*\n * Header files with model as byte arrays. These are generated using xxd.\n */\n#include \"model_header_aquila.h\"\n#include \"model_header_bge.h\"\n#include \"model_header_bpe.h\"\n#include \"model_header_command_r.h\"\n#include \"model_header_qwen2.h\"\n#include \"model_header_spm.h\"\n\n#include \"model_header_baichuan.h\"\n#include \"model_header_deepseek_coder.h\"\n#include \"model_header_falcon.h\"\n#include \"model_header_gpt_2.h\"\n\n#include <setjmp.h>\n#include <unistd.h>\n\nllama_model *model;\nllama_context *ctx;\n\n\njmp_buf fuzzing_jmp_buf;\nextern \"C\" void __wrap_abort(void) { longjmp(fuzzing_jmp_buf, 1); }\n\nvoid init() {\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d.guff\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return;\n  }\n#if defined(FUZZ_BGE)\n  fwrite(models_ggml_vocab_bert_bge_gguf, models_ggml_vocab_bert_bge_gguf_len,\n         1, fp);\n#elif defined(FUZZ_SPM)\n  fwrite(models_ggml_vocab_llama_spm_gguf, models_ggml_vocab_llama_spm_gguf_len,\n         1, fp);\n#elif defined(FUZZ_COMMAND_R)\n  fwrite(models_ggml_vocab_command_r_gguf, models_ggml_vocab_command_r_gguf_len,\n         1, fp);\n#elif defined(FUZZ_QWEN2)\n  fwrite(models_ggml_vocab_qwen2_gguf, models_ggml_vocab_qwen2_gguf_len, 1, fp);\n#elif defined(FUZZ_AQUILA)\n  fwrite(models_ggml_vocab_aquila_gguf, models_ggml_vocab_aquila_gguf_len, 1,\n         fp);\n#elif defined(FUZZ_GPT_2)\n  fwrite(models_ggml_vocab_gpt_2_gguf, models_ggml_vocab_gpt_2_gguf_len, 1, fp);\n#elif defined(FUZZ_BAICHUAN)\n  fwrite(models_ggml_vocab_baichuan_gguf, models_ggml_vocab_baichuan_gguf_len,\n         1, fp);\n#elif defined(FUZZ_DEEPSEEK_CODER)\n  fwrite(models_ggml_vocab_deepseek_coder_gguf,\n         models_ggml_vocab_deepseek_coder_gguf_len, 1, fp);\n#elif defined(FUZZ_FALCON)\n  fwrite(models_ggml_vocab_falcon_gguf, models_ggml_vocab_falcon_gguf_len, 1,\n         fp);\n#else\n  fwrite(models_ggml_vocab_llama_bpe_gguf, models_ggml_vocab_llama_bpe_gguf_len,\n         1, fp);\n#endif\n  fclose(fp);\n\n  llama_backend_init();\n\n  auto mparams = llama_model_default_params();\n  mparams.vocab_only = true;\n  model = llama_load_model_from_file(filename, mparams);\n\n  if (model == NULL) {\n    printf(\"Failed to load vocab\\n\");\n    exit(1);\n  }\n\n  auto cparams = llama_context_default_params();\n  ctx = llama_new_context_with_model(model, cparams);\n  if (ctx == NULL) {\n    llama_free_model(model);\n    exit(1);\n  }\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 2 || size > 4096) {\n    return 0;\n  }\n  bool add_special = data[0] & 0x01;\n  bool parse_special = data[0] & 0x01;\n  uint8_t v2 = data[1];\n  data += 2;\n  size -= 2;\n\n  static int initialize = 0;\n  if (initialize == 0) {\n    init();\n    initialize = 1;\n  }\n\n  std::string payload(reinterpret_cast<const char *>(data), size);\n\n  try {\n    std::vector<llama_token> tokens =\n        common_tokenize(ctx, payload.c_str(), add_special, parse_special);\n    common_detokenize(ctx, tokens);\n\n    if (setjmp(fuzzing_jmp_buf) == 0) {\n      auto batch = llama_batch_get_one(tokens.data(), tokens.size());\n      if (batch.n_tokens > 0) {\n        llama_decode(ctx, batch);\n      }\n    }\n  } catch (...) {\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/llamacpp/fuzzers/llama.dict",
    "content": "\"GGUF\"\n\"general.type\"\n\"general.architecture\"\n\"general.quantization_version\"\n\"general.alignment\"\n\"general.name\"\n\"general.author\"\n\"general.version\"\n\"general.url\"\n\"general.description\"\n\"general.license\"\n\"general.source.url\"\n\"general.source.huggingface.repository\"\n\"vocab_size\"\n\"context_length\"\n\"embedding_length\"\n\"block_count\"\n\"leading_dense_block_count\"\n\"feed_forward_length\"\n\"expert_feed_forward_length\"\n\"expert_shared_feed_forward_length\"\n\"use_parallel_residual\"\n\"tensor_data_layout\"\n\"expert_count\"\n\"expert_used_count\"\n\"expert_shared_count\"\n\"expert_weights_scale\"\n\"pooling_type\"\n\"logit_scale\"\n\"decoder_start_token_id\"\n\"attn_logit_softcapping\"\n\"final_logit_softcapping\"\n\"attention.head_count\"\n\"attention.head_count_kv\"\n\"attention.max_alibi_bias\"\n\"attention.clamp_kqv\"\n\"attention.key_length\"\n\"attention.value_length\"\n\"attention.layer_norm_epsilon\"\n\"attention.layer_norm_rms_epsilon\"\n\"attention.causal\"\n\"attention.q_lora_rank\"\n\"attention.kv_lora_rank\"\n\"attention.relative_buckets_count\"\n\"attention.sliding_window\"\n\"rope.dimension_count\"\n\"rope.freq_base\"\n\"rope.scale_linear\"\n\"rope.scaling.type\"\n\"rope.scaling.factor\"\n\"rope.scaling.attn_factor\"\n\"rope.scaling.original_context_length\"\n\"rope.scaling.finetuned\"\n\"rope.scaling.yarn_log_multiplier\"\n\"split.no\"\n\"split.count\"\n\"split.tensors.count\"\n\"ssm.conv_kernel\"\n\"ssm.inner_size\"\n\"ssm.state_size\"\n\"ssm.time_step_rank\"\n\"ssm.dt_b_c_rms\"\n\"tokenizer.ggml.model\"\n\"tokenizer.ggml.pre\"\n\"tokenizer.ggml.tokens\"\n\"tokenizer.ggml.token_type\"\n\"tokenizer.ggml.token_type_count\"\n\"tokenizer.ggml.scores\"\n\"tokenizer.ggml.merges\"\n\"tokenizer.ggml.bos_token_id\"\n\"tokenizer.ggml.eos_token_id\"\n\"tokenizer.ggml.unknown_token_id\"\n\"tokenizer.ggml.seperator_token_id\"\n\"tokenizer.ggml.padding_token_id\"\n\"tokenizer.ggml.cls_token_id\"\n\"tokenizer.ggml.mask_token_id\"\n\"tokenizer.ggml.add_bos_token\"\n\"tokenizer.ggml.add_eos_token\"\n\"tokenizer.ggml.add_space_prefix\"\n\"tokenizer.ggml.remove_extra_whitespaces\"\n\"tokenizer.ggml.precompiled_charsmap\"\n\"tokenizer.huggingface.json\"\n\"tokenizer.rwkv.world\"\n\"tokenizer.ggml.prefix_token_id\"\n\"tokenizer.ggml.suffix_token_id\"\n\"tokenizer.ggml.middle_token_id\"\n\"tokenizer.ggml.eot_token_id\"\n\"tokenizer.ggml.eom_token_id\"\n\"adapter.type\"\n\"adapter.lora.alpha\"\n\"adapter.type\"\n\"adapter.lora.alpha\"\n\"llama\"\n\"falcon\"\n\"grok\"\n\"gpt2\"\n\"gptj\"\n\"gptneox\"\n\"mpt\"\n\"baichuan\"\n\"starcoder\"\n\"refact\"\n\"bert\"\n\"nomic-bert\"\n\"jina-bert-v2\"\n\"bloom\"\n\"stablelm\"\n\"qwen\"\n\"qwen2\"\n\"qwen2moe\"\n\"phi2\"\n\"phi3\"\n\"plamo\"\n\"codeshell\"\n\"orion\"\n\"internlm2\"\n\"minicpm\"\n\"gemma\"\n\"gemma2\"\n\"starcoder2\"\n\"mamba\"\n\"xverse\"\n\"command-r\"\n\"dbrx\"\n\"olmo\"\n\"openelm\"\n\"arctic\"\n\"deepseek2\"\n\"chatglm\"\n\"bitnet\"\n\"t5\"\n\"t5encoder\"\n\"jais\"\n\"nemotron\"\n\"exaone\"\n\"pattern\"\n\"minLength\"\n\"maxLength\"\n\"root\"\n\"maximum\"\n\"minimum\"\n\"exclusiveMaximum\"\n\"maxItems\"\n\"minItems\"\n\"{\"\n\"}\"\n\"items\"\n\"type\"\n\"enum\"\n\"root\"\n"
  },
  {
    "path": "projects/llamacpp/project.yaml",
    "content": "homepage: \"https://github.com/ggerganov/llama.cpp\"\nlanguage: c++\nprimary_contact: \"ggerganov@gmail.com\"\nauto_ccs:\n  - \"slarengh@gmail.com\"\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/ggerganov/llama.cpp'\n"
  },
  {
    "path": "projects/lldb-eval/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update \\\n    && apt-get install -y wget git patchelf zlib1g-dev python libtinfo-dev --no-install-recommends\n\nRUN git clone --depth 1 https://github.com/google/lldb-eval\n\nCOPY build.sh $SRC/\nCOPY lldb_vs_lldb_eval_libfuzzer_test.options $SRC/\n\nWORKDIR $SRC/lldb-eval\n"
  },
  {
    "path": "projects/lldb-eval/build.sh",
    "content": "#!/bin/bash\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n(\ncd $SRC/\nGITHUB_RELEASE=\"https://github.com/google/lldb-eval/releases/download/oss-fuzz-ubuntu-20.04\"\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  LLVM_ARCHIVE=\"llvm-12.0.1-x86_64-linux-release-address.tar.gz\"\nelif [ \"$SANITIZER\" = \"memory\" ]\nthen\n  LLVM_ARCHIVE=\"llvm-12.0.1-x86_64-linux-release-memory.tar.gz\"\nelif [ \"$SANITIZER\" = \"undefined\" ]\nthen\n  LLVM_ARCHIVE=\"llvm-12.0.1-x86_64-linux-release.tar.gz\"\nelif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  # For coverage we also need the original source code.\n  wget --quiet $GITHUB_RELEASE/llvm-12.0.1-source.tar.gz\n  tar -xzf llvm-12.0.1-source.tar.gz\n  wget --quiet $GITHUB_RELEASE/llvm-12.0.1-x86_64-linux-release-genfiles.tar.gz\n  tar -xzf llvm-12.0.1-x86_64-linux-release-genfiles.tar.gz\n\n  LLVM_ARCHIVE=\"llvm-12.0.1-x86_64-linux-release.tar.gz\"\nelse\n  echo \"Unknown sanitizer: $SANITIZER\"\n  exit 1\nfi\n\nwget --quiet $GITHUB_RELEASE/$LLVM_ARCHIVE\nmkdir -p llvm && tar -xzf $LLVM_ARCHIVE --strip-components 1 -C llvm\n)\nexport LLVM_INSTALL_PATH=$SRC/llvm\n\nif [ \"$SANITIZER\" = \"undefined\" ]\nthen\n  # Disable vptr because it's not allowed with '-fno-rtti'\n  CFLAGS=\"$CFLAGS -fno-sanitize=function,vptr\"\n  CXXFLAGS=\"$CXXFLAGS -fno-sanitize=function,vptr\"\nfi\n\n# Undefine NDEBUG to enable asserts.\nexport BAZEL_EXTRA_BUILD_FLAGS=\"--copt=-UNDEBUG\"\n\n# Run the build!\nbazel_build_fuzz_tests\n\n# OSS-Fuzz rule doesn't build data dependencies\nbazel build //testdata:fuzzer_binary_gen\n\n# OSS-Fuzz rule doesn't handle dynamic dependencies\n# Copy liblldb.so\nmkdir -p $OUT/lib\ncp $SRC/llvm/lib/liblldb.so* $OUT/lib\n\n# List of targets to fuzz.\nTARGETS=(\n  lldb_eval_libfuzzer_test\n  lldb_vs_lldb_eval_libfuzzer_test\n)\n\n# Preparation of each target.\nfor target in ${TARGETS[@]}; do\n  # OSS-Fuzz rule doesn't package runfiles yet:\n  # https://github.com/bazelbuild/rules_fuzzing/issues/100\n  mkdir -p $OUT/$target.runfiles\n  # fuzzer_binary\n  mkdir -p $OUT/$target.runfiles/lldb_eval/testdata\n  cp $SRC/lldb-eval/bazel-bin/testdata/fuzzer_binary $OUT/$target.runfiles/lldb_eval/testdata/\n  cp $SRC/lldb-eval/testdata/fuzzer_binary.cc $OUT/$target.runfiles/lldb_eval/testdata/\n  # lldb-server\n  mkdir -p $OUT/$target.runfiles/llvm_project/bin\n  cp $SRC/llvm/bin/lldb-server $OUT/$target.runfiles/llvm_project/bin/lldb-server\n  # Patch RPATH of the fuzz target\n  patchelf --set-rpath '$ORIGIN/lib' $OUT/$target\ndone\n\ncp $SRC/lldb_vs_lldb_eval_libfuzzer_test.options $OUT/\n"
  },
  {
    "path": "projects/lldb-eval/lldb_vs_lldb_eval_libfuzzer_test.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/lldb-eval/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/google/lldb-eval\"\nmain_repo: \"https://github.com/google/lldb-eval\"\nlanguage: c++\nprimary_contact: \"werat@google.com\"\nauto_ccs:\n  - \"tsabolcec@google.com\"\nsanitizers:\n  - address\n  - undefined\nfile_github_issue: True\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/lldpd/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf libtool-bin pkg-config check\nRUN git clone --recursive https://github.com/lldpd/lldpd.git\nCOPY build.sh run_tests.sh $SRC/\nWORKDIR $SRC/lldpd/\n"
  },
  {
    "path": "projects/lldpd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\n\nexport check_LIBS=\"-l:libcheck.a -l:libsubunit.a -lrt -lm -lpthread\"\n\n./configure --disable-shared --enable-pie --enable-fuzzer=$LIB_FUZZING_ENGINE\nmake\n\ncp tests/fuzz_cdp $OUT/\ncp tests/fuzz_edp $OUT/\ncp tests/fuzz_lldp $OUT/\ncp tests/fuzz_sonmp $OUT/\n\nzip -r $OUT/fuzz_cdp_seed_corpus.zip    tests/fuzzing_seed_corpus/fuzz_cdp_seed_corpus\nzip -r $OUT/fuzz_edp_seed_corpus.zip    tests/fuzzing_seed_corpus/fuzz_edp_seed_corpus\nzip -r $OUT/fuzz_lldp_seed_corpus.zip   tests/fuzzing_seed_corpus/fuzz_lldp_seed_corpus\nzip -r $OUT/fuzz_sonmp_seed_corpus.zip  tests/fuzzing_seed_corpus/fuzz_sonmp_seed_corpus\n"
  },
  {
    "path": "projects/lldpd/project.yaml",
    "content": "homepage: \"https://lldpd.github.io\"\nlanguage: c\nprimary_contact: \"vincent@bernat.ch\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/lldpd/lldpd'\n"
  },
  {
    "path": "projects/lldpd/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake check -j$(nproc)\n"
  },
  {
    "path": "projects/llhttp/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update \\\n    && apt-get install -y make autoconf automake libtool\nRUN install_javascript.sh\nRUN git clone --depth 1 https://github.com/nodejs/llhttp $SRC/llhttp\nCOPY build.sh $SRC/\nWORKDIR $SRC/llhttp\n"
  },
  {
    "path": "projects/llhttp/build.sh",
    "content": "#!/bin/bash -euo\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nrm -rf \"${WORK:?}/\"*\nmake clean\n\nnpm ci\nyes | make build/libllhttp.a\n\n$CC $CFLAGS -c ./test/fuzzers/fuzz_parser.c -I./build/ ./build/libllhttp.a -o $WORK/fuzz_parser.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -fuse-ld=lld -I./build/ ./build/libllhttp.a $WORK/fuzz_parser.o -o $OUT/fuzz_parser\n"
  },
  {
    "path": "projects/llhttp/project.yaml",
    "content": "homepage: \"https://llhttp.org/\"\nmain_repo: \"https://github.com/nodejs/llhttp\"\nlanguage: c\nprimary_contact: \"fedor@indutny.com\"\nauto_ccs:\n - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/llvm/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update -y && \\\n    apt-get install -y autoconf automake libtool curl make g++ unzip wget git \\\n    binutils liblzma-dev libz-dev python-all cmake ninja-build subversion \\\n    pkg-config\n\nRUN git clone --depth 1 https://github.com/llvm/llvm-project.git\n\nRUN git clone --depth 1 https://github.com/AdaLogics/ada-fuzzers && \\\n    $SRC/ada-fuzzers/projects/llvm/copy-over.sh\n\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/llvm/build.sh",
    "content": "#!/bin/bash -eux\n#\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n  readonly FUZZERS=(\\\n    llvm-dwarfdump-fuzzer \\\n  )\nelse\n  # For coverage we skip \"clangd-fuzzer\" because it eats too much memory\n  # and the process gets killed.\n  if [[ \"$SANITIZER\" = coverage ]]; then\n    readonly FUZZERS=( \\\n      llvm-microsoft-demangle-fuzzer \\\n      llvm-dwarfdump-fuzzer \\\n      llvm-itanium-demangle-fuzzer \\\n      llvm-yaml-numeric-parser-fuzzer \\\n      llvm-yaml-parser-fuzzer \\\n      llvm-dlang-demangle-fuzzer \\\n      vfabi-demangler-fuzzer \\\n      llvm-rust-demangle-fuzzer \\\n      llvm-dis-fuzzer \\\n      llvm-opt-fuzzer \\\n      llvm-isel-fuzzer \\\n      llvm-special-case-list-fuzzer \\\n      clang-objc-fuzzer \\\n      clang-format-fuzzer \\\n      clang-fuzzer \\\n      llvm-parse-assembly-fuzzer \\\n      llvm-symbol-reader-fuzzer \\\n      llvm-object-yaml-fuzzer \\\n    )\n  else\n    readonly FUZZERS=( \\\n      llvm-microsoft-demangle-fuzzer \\\n      llvm-dwarfdump-fuzzer \\\n      llvm-itanium-demangle-fuzzer \\\n      llvm-yaml-numeric-parser-fuzzer \\\n      llvm-yaml-parser-fuzzer \\\n      llvm-dlang-demangle-fuzzer \\\n      vfabi-demangler-fuzzer \\\n      llvm-rust-demangle-fuzzer \\\n      llvm-dis-fuzzer \\\n      llvm-opt-fuzzer \\\n      llvm-isel-fuzzer \\\n      llvm-special-case-list-fuzzer \\\n      clang-objc-fuzzer \\\n      clang-format-fuzzer \\\n      clang-fuzzer \\\n      clangd-fuzzer \\\n      llvm-parse-assembly-fuzzer \\\n      llvm-symbol-reader-fuzzer \\\n      llvm-object-yaml-fuzzer \\\n    )\n  fi\nfi\n# Fuzzers whose inputs are C-family source can use clang-fuzzer-dictionary.\nreadonly CLANG_DICT_FUZZERS=( \\\n  clang-fuzzer \\\n  clang-format-fuzzer \\\n  clang-objc-fuzzer \\\n)\n\ncase $SANITIZER in\n  address) LLVM_SANITIZER=\"Address\" ;;\n  undefined) LLVM_SANITIZER=\"Undefined\" ;;\n  memory) LLVM_SANITIZER=\"MemoryWithOrigins\" ;;\n  *) LLVM_SANITIZER=\"\" ;;\nesac\ncase \"${LIB_FUZZING_ENGINE}\" in\n  -fsanitize=fuzzer) CMAKE_FUZZING_CONFIG=\"-DLLVM_USE_SANITIZE_COVERAGE=ON\" ;;\n  *) CMAKE_FUZZING_CONFIG=\"-DLLVM_LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE}\" ;;\nesac\n\nLLVM=llvm-project/llvm\n\nmkdir build\ncd build\n\ncmake -GNinja -DCMAKE_BUILD_TYPE=Release ../$LLVM \\\n    -DLLVM_ENABLE_PROJECTS=\"clang;lld;clang-tools-extra\" \\\n    -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi;compiler-rt\" \\\n    -DLLVM_ENABLE_ASSERTIONS=ON \\\n    -DLLVM_USE_LINKER=lld \\\n    -DCMAKE_C_COMPILER=\"${CC}\" \\\n    -DCMAKE_CXX_COMPILER=\"${CXX}\" \\\n    -DCMAKE_C_FLAGS=\"${CFLAGS}\" \\\n    -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\" \\\n    \"${CMAKE_FUZZING_CONFIG}\" \\\n    -DLLVM_NO_DEAD_STRIP=ON \\\n    -DLLVM_USE_SANITIZER=\"${LLVM_SANITIZER}\" \\\n    -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly \\\n    -DCOMPILER_RT_INCLUDE_TESTS=OFF \\\n    -DLLVM_ENABLE_PCH=OFF \\\n    -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON\n\n# Patch certain build rules in code coverage mode, as otherwise the process is killed.\n# Verify we can build some of the troublesome rules by building them.\nif [[ \"$SANITIZER\" = coverage ]]; then\n  mv build.ninja ../\n  python3 $SRC/coverage_patcher.py ../build.ninja build.ninja\n  ninja lib/Target/AMDGPU/Utils/CMakeFiles/LLVMAMDGPUUtils.dir/AMDGPUBaseInfo.cpp.o -j $(( $(nproc) / 2))\n  ninja lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/AMDGPUMCCodeEmitter.cpp.o -j $(( $(nproc) / 2))\nfi\n\nfor fuzzer in \"${FUZZERS[@]}\"; do\n  # Limit workload in CI\n  if [ -n \"${OSS_FUZZ_CI-}\" ]; then\n    ninja $fuzzer -j 3\n  else\n    # Do not exhaust memory limitations on the cloud machine, coverage\n    # takes more resources which causes processes to crash.\n    if [[ \"$SANITIZER\" = coverage ]]; then\n      ninja $fuzzer -j $(( $(nproc) / 4)) || ninja $fuzzer -j 2 || ninja $fuzzer -j 1\n    else\n      ninja $fuzzer -j $(( $(nproc) / 4)) || ninja $fuzzer -j 2 || ninja $fuzzer -j 1\n    fi\n  fi\n  cp bin/$fuzzer $OUT\ndone\n\n\n# Exit early in the CI as the llvm-isel-fuzzer and opt fuzzer won't be there.\nif [ -n \"${OSS_FUZZ_CI-}\" ]; then\n  exit 0\nfi\n\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--hexagon-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--riscv64-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--mips64-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--arm-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--ppc64-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--aarch64-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--x86_64-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--wasm32-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--nvptx-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--ve-O2\ncp $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--bpf-O2\nmv $OUT/llvm-isel-fuzzer $OUT/llvm-isel-fuzzer--aarch64-gisel\n\n# Same for llvm-opt-fuzzer\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-earlycse\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-simplifycfg\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-gvn\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-sccp\n\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-loop_predication\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-guard_widening\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-loop_vectorize\n\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-loop_unswitch\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-licm\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-indvars\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-strength_reduce\n\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-irce\n\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-dse\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-loop_idiom\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-reassociate\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-lower_matrix_intrinsics\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-memcpyopt\ncp $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-sroa\n\nmv $OUT/llvm-opt-fuzzer $OUT/llvm-opt-fuzzer--x86_64-instcombine\n\n\nninja clang-fuzzer-dictionary\nfor fuzzer in \"${CLANG_DICT_FUZZERS[@]}\"; do\n  bin/clang-fuzzer-dictionary > $OUT/$fuzzer.dict\ndone\n\nzip -j \"${OUT}/clang-objc-fuzzer_seed_corpus.zip\"  $SRC/$LLVM/../clang/tools/clang-fuzzer/corpus_examples/objc/*\nzip -j \"${OUT}/clangd-fuzzer_seed_corpus.zip\"  $SRC/$LLVM/../clang-tools-extra/clangd/test/*\nzip -j \"${OUT}/clang-fuzzer_seed_corpus.zip\" $SRC/llvm-project/clang/test/Parser/*.cpp\n"
  },
  {
    "path": "projects/llvm/coverage_patcher.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module for patching out coverage instrumentation for specific files.\"\"\"\n\nimport os\nimport sys\n\nwith open(sys.argv[1], \"r\") as f:\n  content = f.read()\n\npatch_flag = False\nnew_content = \"\"\nfor line in content.split(\"\\n\"):\n  if patch_flag:\n    if \"FLAGS =\" in line:\n      print(\"Patching\")\n      line = line.replace(\"-fprofile-instr-generate -fcoverage-mapping\", \"\")\n      patch_flag = False\n\n  # Find the AMDGPUBaseInfo.cpp.o build\n  if \"build\" in line and (\"AMDGPUBaseInfo.cpp.o\" in line or \"AMDGPUMCCodeEmitter.cpp.o\" in line):\n    # Find the next flag\n    patch_flag = True\n  new_content += line + \"\\n\"\n\nwith open(sys.argv[2], \"w\") as f:\n  f.write(new_content)\n"
  },
  {
    "path": "projects/llvm/project.yaml",
    "content": "homepage: \"http://llvm.org/\"\nlanguage: c++\nprimary_contact: \"rnk@google.com\"\nauto_ccs:\n  - \"jonas@devlieghere.com\"\n  - \"vsk@apple.com\"\n  - \"akilsrin@apple.com\"\n  - \"igmyrj@gmail.com\"\n  - \"xpl0re@gmail.com\"\n  - \"jfb@chromium.org\"\n  - \"eneyman@google.com\"\n  - \"bigcheesegs@gmail.com\"\n  - \"davg@google.com\"\n  - \"sammccall@google.com\"\n  - \"david@adalogics.com\"\n\nsanitizers:\n  - address\n  - memory\n\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n\n# Bug reports are public by default:\nview_restrictions: none\nmain_repo: 'https://github.com/llvm/llvm-project.git'\n"
  },
  {
    "path": "projects/llvm_libcxx/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/llvm/llvm-project.git\nWORKDIR llvm-project\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/llvm_libcxx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the oss-fuzz script in the repository\n./libcxx/utils/ci/oss-fuzz.sh\n"
  },
  {
    "path": "projects/llvm_libcxx/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://libcxx.llvm.org/\"\nlanguage: c++\nprimary_contact: \"mclow.lists@gmail.com\"\nmain_repo: https://github.com/llvm/llvm-project.git\nauto_ccs:\n  - \"timshen91@gmail.com\"\n  - \"jfb@chromium.org\"\n  - \"bigcheesegs@gmail.com\"\n  - \"eric@efcs.ca\"\n  - \"ldionne.2@gmail.com\"\n  - \"koraq@xs4all.nl\"\n  - \"nikolasklauser@berlin.de\"\n  \nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/llvm_libcxxabi/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/llvm/llvm-project.git\nWORKDIR llvm-project/libcxxabi\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/llvm_libcxxabi/build.sh",
    "content": "#!/bin/bash -eux\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n$CXX $CXXFLAGS -std=c++11 -g src/cxa_demangle.cpp src/abort_message.cpp \\\n  -Iinclude fuzz/cxa_demangle_fuzzer.cpp -o $OUT/cxa_demangle_fuzzer \\\n  $LIB_FUZZING_ENGINE\n"
  },
  {
    "path": "projects/llvm_libcxxabi/project.yaml",
    "content": "homepage: \"https://libcxxabi.llvm.org/\"\nlanguage: c++\nprimary_contact: \"kcc@google.com\"\nmain_repo: https://github.com/llvm/llvm-project\nauto_ccs:\n  - \"Erik.Pilkington@gmail.com\"\n  - \"akilsrin@apple.com\"\n  - \"bigcheesegs@gmail.com\"\n  - \"eric@efcs.ca\"\n  - \"nikolasklauser@berlin.de\"\n  - \"koraq@xs4all.nl\"\nsanitizers:\n  - address\n  - memory\n  - undefined\n"
  },
  {
    "path": "projects/lodash/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN  git clone --depth 1 https://github.com/lodash/lodash.git\n\nCOPY fuzz.js $SRC/lodash\n\nWORKDIR $SRC/lodash\n"
  },
  {
    "path": "projects/lodash/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer lodash fuzz.js -i lodash\n"
  },
  {
    "path": "projects/lodash/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core')\nconst lodash = require('lodash')\n\nvar abort = 0;\n\nmodule.exports.fuzz = async function(data) {\n  lodash.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g\n  lodash.templateSettings.evaluate = /{%([\\s\\S]+?)%}/g\n  lodash.templateSettings.escape = /{{-([\\s\\S]+?)}}/g\n  const provider = new FuzzedDataProvider(data)\n  const randomCase = provider.consumeIntegralInRange(1, 28);\n\n  try {\n    switch (randomCase) {\n      case 1:\n        const input = provider.consumeIntegrals(10, 1, true)\n        const chunkSize = provider.consumeIntegralInRange(1, input.length)\n        lodash.chunk(input, chunkSize)\n        break;\n      case 2:\n        const array = provider.consumeBooleans(10)\n        lodash.compact(array)\n        break;\n      case 3:\n        const array1 = provider.consumeIntegrals(5, 1, true)\n        const array2 = provider.consumeIntegrals(5, 1, true)\n        lodash.concat(array1, array2)\n        break;\n      case 4:\n        const array3 = provider.consumeIntegrals(10, 1, true)\n        const n = provider.consumeIntegralInRange(1, array3.length)\n        lodash.drop(array3, n)\n        break;\n      case 5:\n        const array4 = provider.consumeIntegrals(10, 1, true)\n        const predicate = (value) => value % 2 === 0\n        lodash.filter(array4, predicate)\n        break;\n      case 6:\n        const array5 = provider.consumeIntegrals(5, 1, true)\n        const array6 = provider.consumeIntegrals(5, 1, true)\n        const array7 = provider.consumeIntegrals(5, 1, true)\n        const array8 = [array5, array6, array7]\n        lodash.flatten(array8)\n        break;\n      case 7:\n        const array9 = provider.consumeIntegrals(10, 1, true)\n        const iteratee = (value) => value * 2\n        lodash.map(array9, iteratee)\n        break;\n      case 8:\n        const array10 = provider.consumeIntegrals(10, 1, true)\n        lodash.reverse(array10)\n        break;\n      case 9:\n        const array11 = provider.consumeIntegrals(10, 1, true)\n        const start = provider.consumeIntegralInRange(0, array11.length - 1)\n        const end = provider.consumeIntegralInRange(start, array11.length - 1)\n        lodash.slice(array11, start, end)\n        break;\n      case 10:\n        const array13 = provider.consumeIntegrals(10, 1, true)\n        lodash.uniq(array13)\n        break;\n      case 11:\n        const templateString = provider.consumeString(provider.consumeIntegralInRange(1, 4096))\n        const dataObject = generateDataObject(provider)\n        lodash.template(templateString)(dataObject)\n        break;\n      case 12:\n        const object1 = generateDataObject(provider)\n        const object2 = generateDataObject(provider)\n        lodash.assign(object1, object2)\n        break;\n      case 13:\n        const object3 = generateDataObject(provider)\n        lodash.cloneDeep(object3)\n        break;\n      case 14:\n        const object4 = generateDataObject(provider)\n        const defaults = generateDataObject(provider)\n        lodash.defaults(object4, defaults)\n        break;\n      case 15:\n        const array14 = provider.consumeIntegrals(10, 1, true)\n        const predicate2 = (value) => value % 2 === 0\n        lodash.find(array14, predicate2)\n        break;\n      case 16:\n        const array15 = provider.consumeIntegrals(10, 1, true)\n        const iteratee2 = (_value) => {\n        }\n        lodash.forEach(array15, iteratee2)\n        break;\n      case 17:\n        const array16 = provider.consumeIntegrals(10, 1, true)\n        const iteratee3 = (value) => value % 2 === 0\n        lodash.groupBy(array16, iteratee3)\n        break;\n      case 18:\n        const object5 = generateDataObject(provider)\n        const object6 = generateDataObject(provider)\n        lodash.isEqual(object5, object6)\n        break;\n      case 19:\n        const object7 = generateDataObject(provider)\n        const source = generateDataObject(provider)\n        lodash.merge(object7, source)\n        break;\n      case 20:\n        const object8 = generateDataObject(provider)\n        var numStrings = provider.consumeIntegralInRange(1, 5)\n        var strings = []\n        for (let i = 0; i < numStrings; i++) {\n          strings.push(provider.consumeString(10))\n        }\n        lodash.omit(object8, strings)\n        break;\n      case 21:\n        const object9 = generateDataObject(provider)\n        strings = []\n        numStrings = provider.consumeIntegralInRange(1, 5)\n        for (let i = 0; i < numStrings; i++) {\n          strings.push(provider.consumeString(10))\n        }\n        lodash.pick(object9, strings)\n        break;\n      case 22:\n        const array17 = provider.consumeIntegrals(10, 1, true)\n        const iteratee4 = (accumulator, value) => accumulator + value\n        lodash.reduce(array17, iteratee4)\n        break;\n      case 23:\n        const array18 = provider.consumeIntegrals(10, 1, true)\n        lodash.sortBy(array18)\n        break;\n      case 24:\n        const func = () => {\n        }\n        const throttled = lodash.throttle(func, 1000)\n        throttled()\n        break;\n      case 25:\n        const num = provider.consumeIntegralInRange(1, 10)\n        const iteratee5 = (_n) => {\n        }\n        lodash.times(num, iteratee5)\n        break;\n      case 26:\n        const object10 = generateDataObject(provider)\n        const iteratee6 = (accumulator, value, key) => {\n          accumulator[key] = value\n          return accumulator\n        }\n        lodash.transform(object10, iteratee6)\n        break;\n      case 27:\n        const array19 = provider.consumeIntegrals(10, 1, true)\n        const iteratee7 = (value) => value % 2 === 0\n        lodash.uniqBy(array19, iteratee7)\n        break;\n      case 28:\n        const array20 = provider.consumeIntegrals(5, 1, true)\n        const array21 = provider.consumeIntegrals(5, 1, true)\n        const array22 = [array20, array21]\n        lodash.zip(array22)\n        break;\n    }\n\n  } catch (error) {\n    if (!ignoredError(error)) {\n      throw error\n    }\n  }\n}\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1)\n}\n\nconst ignored = [\n  'min must be less than or equal to max',\n  'Unexpected token',\n  'is not defined',\n  'Invalid or Unexpected'\n]\n\nfunction generateDataObject(provider) {\n  const dataObject = {}\n\n  const numProperties = provider.consumeIntegralInRange(1, 10)\n  for (let i = 0; i < numProperties; i++) {\n    const propertyName = provider.consumeString(10)\n    const propertyValue = generatePropertyValue(provider)\n\n    dataObject[propertyName] = propertyValue\n  }\n\n  return dataObject\n}\n\nfunction generatePropertyValue(provider) {\n  const valueType = provider.consumeIntegralInRange(0, 3)\n  abort += 1\n  if (abort > 4096) {\n    return\n  }\n\n  switch (valueType) {\n    case 0:\n      return provider.consumeString(20)\n    case 1:\n      return provider.consumeNumber()\n    case 2:\n      return generateDataObject(provider)\n    case 3:\n      const numValues = provider.consumeIntegralInRange(1, 5)\n      const values = []\n      for (let i = 0; i < numValues; i++) {\n        values.push(generatePropertyValue(provider))\n      }\n      return values\n  }\n}\n"
  },
  {
    "path": "projects/lodash/project.yaml",
    "content": "homepage: https://lodash.com/\nlanguage: javascript\nmain_repo: https://github.com/lodash/lodash\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/lodepng/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/lvandeve/lodepng.git lodepng     # or use other version control\nWORKDIR lodepng\nADD http://oss-fuzz-corpus.storage.googleapis.com/lodepng/lodepng_fuzzer_seed_corpus.zip $SRC/\nADD https://raw.githubusercontent.com/google/AFL/master/dictionaries/png.dict $SRC/lodepng_fuzzer.dict\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/lodepng/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# LODEPNG_MAX_ALLOC flag lets the decoder gracefully return error when trying to\n# allocate more than 100MB memory, which prevents OOM with the 2GB limit.\n$CXX $CXXFLAGS -DLODEPNG_MAX_ALLOC=100000000 lodepng.cpp lodepng_fuzzer.cpp -o\\\n $OUT/lodepng_fuzzer $LIB_FUZZING_ENGINE\n\n# copy seed corpus\ncp $SRC/lodepng_fuzzer_seed_corpus.zip $OUT/\n\n# copy dictionary file\ncp $SRC/*.dict $OUT/\n"
  },
  {
    "path": "projects/lodepng/project.yaml",
    "content": "homepage: \"https://github.com/lvandeve/lodepng\"\nlanguage: c++\nprimary_contact: \"lvandeve@gmail.com\"\nauto_ccs:\n  - \"singharshdeep@google.com\"\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/lvandeve/lodepng.git'\n"
  },
  {
    "path": "projects/lodepng/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$CXX $CXXFLAGS -DLODEPNG_MAX_ALLOC=100000000 lodepng.cpp lodepng_util.cpp lodepng_unittest.cpp -pthread -o\\\n lodepng_unittest $LIB_FUZZING_ENGINE\n./lodepng_unittest\n"
  },
  {
    "path": "projects/log4j2/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n# Install Java 17 using Azul Zulu distribution, because\n#\n# 1. Log4j build requires Java 17, `base-builder-jvm` provides Java 15 (as of 2024-07-10)\n# 2. Apache Logging Services uses Zulu[1] as the OpenJDK distribution in CI\n#\n# [1] https://github.com/apache/logging-parent/blob/main/.github/workflows/build-reusable.yaml#L54\n\n# Add the Zulu APT repository\nRUN apt-get update && \\\n    apt-get install -y gnupg ca-certificates && \\\n    wget -q -O - https://repos.azul.com/azul-repo.key | \\\n    gpg --dearmor -o /usr/share/keyrings/azul.gpg && \\\n    echo \"deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main\" | \\\n    tee /etc/apt/sources.list.d/zulu.list\n\n\n# Install Zulu 17\nRUN apt-get update && \\\n    apt-get install -y zulu17-jdk\n\n# Update Java-related environment variables\nENV JAVA_HOME /usr/lib/jvm/zulu17\nENV JVM_LD_LIBRARY_PATH /usr/lib/jvm/zulu17/lib/server\nENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/out:/usr/lib/jvm/zulu17/bin\n\nCOPY build.sh $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/log4j2/README.adoc",
    "content": "////\nCopyright 2024 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n////\n\nLog4j fuzz tests are distributed as a part of https://github.com/apache/logging-log4j2[the official project sources].\nHere we only store the `Dockerfile` to build the container image to build and run fuzz tests.\nLikewise, `build.sh` simply delegates to a build script distributed with the Log4j source code.\n"
  },
  {
    "path": "projects/log4j2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit clone --depth 1 --branch 2.x --single-branch https://github.com/apache/logging-log4j2\n./logging-log4j2/oss-fuzz-build.sh \"$OUT\"\n"
  },
  {
    "path": "projects/log4j2/project.yaml",
    "content": "homepage: \"https://logging.apache.org/log4j/2.x\"\nmain_repo: \"https://github.com/apache/logging-log4j2\"\nlanguage: jvm\n\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\n# Apache Logging Services PMC members[1] that contribute the fuzz tests.\n# We cannot share `security@logging.apache.org` here, since it must be associated with a Google account[2].\n#\n# [1] https://logging.apache.org/team-list.html\n# [2] https://google.github.io/oss-fuzz/getting-started/new-project-guide/#primary\nprimary_contact: volkan@yazi.ci\nauto_ccs:\n  - piotr.karwasz@gmail.com\n"
  },
  {
    "path": "projects/logback/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/JoranFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/JoranFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/qos-ch/logback\n\nCOPY build.sh $SRC/\nCOPY JoranFuzzer.java $SRC/\nCOPY logback.xml $SRC/\nWORKDIR $SRC/logback\nRUN git clone --depth 1 https://github.com/qos-ch/slf4j"
  },
  {
    "path": "projects/logback/JoranFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport ch.qos.logback.classic.LoggerContext;\n\nimport ch.qos.logback.classic.LoggerContext;\nimport ch.qos.logback.classic.joran.JoranConfigurator;\nimport ch.qos.logback.core.joran.spi.JoranException;\n\nimport java.io.InputStream;\nimport java.io.ByteArrayInputStream;\n\npublic class JoranFuzzer {\n\tprivate final static Logger logger = LoggerFactory.getLogger(JoranFuzzer.class);\n    private final static JoranConfigurator configurator = new JoranConfigurator();\n\n    public static void fuzzerInitialize() {\n        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n        configurator.setContext(lc);\n        lc.reset();\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String content = data.consumeString(1000);\n\n        // https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47102\n        if (content.contains(\"class=\\\"\")) {\n            return;\n        }\n\n        InputStream xmlcontent = new ByteArrayInputStream(content.getBytes());\n        try {\n            configurator.doConfigure(xmlcontent);\n            logger.debug(data.consumeRemainingAsString());\n        } catch (JoranException e) { }\n\t} \n}\n"
  },
  {
    "path": "projects/logback/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"logback-core/target/logback-core-$CURRENT_VERSION.jar\" \"$OUT/logback-core.jar\"\ncp \"logback-classic/target/logback-classic-$CURRENT_VERSION.jar\" \"$OUT/logback-classic.jar\"\n\ncd slf4j\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"slf4j-api/target/slf4j-api-$CURRENT_VERSION.jar\" \"$OUT/slf4j.jar\"\ncd $SRC\n\nALL_JARS=\"logback-core.jar logback-classic.jar slf4j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/logback/logback.xml",
    "content": "<configuration>\n  <appender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\">\n    <encoder>\n      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>\n    </encoder>\n  </appender>\n\n  <root level=\"debug\">\n    <appender-ref ref=\"STDOUT\" />\n  </root>\n</configuration>"
  },
  {
    "path": "projects/logback/project.yaml",
    "content": "homepage: \"https://github.com/qos-ch/logback\"\nlanguage: jvm\nprimary_contact: \"dev.qos.ch@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/qos-ch/logback.git\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/loki/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/grafana/loki/\nCOPY build.sh $SRC/\nWORKDIR $SRC/loki\n"
  },
  {
    "path": "projects/loki/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/grafana/loki/v3/pkg/logql/syntax FuzzParseExpr fuzz_parse_expr\n"
  },
  {
    "path": "projects/loki/project.yaml",
    "content": "homepage: \"https://github.com/grafana/loki\"\nprimary_contact: \"cyril.tovena@grafana.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"edward.welch@grafana.com\"\n  - \"michel.hollands@grafana.com\"\n  - \"loki@grafana.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/grafana/loki'\n"
  },
  {
    "path": "projects/looker-sdk/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip && pip3 install mock\nRUN git clone --depth 1 https://github.com/looker-open-source/sdk-codegen\nWORKDIR sdk-codegen\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/looker-sdk/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd python\npip3 install .\n\n# Build fuzzers and put them in $OUT/\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/looker-sdk/fuzz_looker.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targetting the looker-sdk\"\"\"\n\nimport os\nimport sys\nimport json\nimport mock\nimport atheris\nimport looker_sdk\nimport requests\nfrom looker_sdk import models40 as models\n\n\n# Sample configuration. We use mock to handle network communication so\n# these fields are not important.\nconf = \"\"\"[Looker]\napi_versions=3.1,4.0\nbase_url=https://localhost:19999\nclient_id=your_API3_client_id\nclient_secret=your_API3_client_secret\nverify_ssl=true\ntimeout=2\"\"\"\nreturn_dict = None\ndef transport_requests_mock(\n  method,\n  path,\n  query_params=None,\n  body=None,\n  authenticator=None,\n  transport_options=None\n):\n  \"\"\"Returns an arbitrary dictionary string\"\"\"\n  global return_dict\n  r1 = looker_sdk.rtl.transport.Response(True, return_dict, 3, \"utf-8\")\n  return r1\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  global return_dict\n  fdp = atheris.FuzzedDataProvider(data)\n  s1 = fdp.ConsumeString(fdp.ConsumeIntInRange(0, 1024))\n  try:\n    fuzzed_dict = json.loads(s1)\n  except:\n    return\n  if type(fuzzed_dict) is not dict:\n    return\n\n  return_dict = str.encode(s1)\n\n  with open(\"looker.ini\", \"w\") as f:\n      f.write(conf)\n  sdk = looker_sdk.init40(\"looker.ini\")\n  m1 = fdp.ConsumeUnicodeNoSurrogates(20)\n  v1 = fdp.ConsumeUnicodeNoSurrogates(20)\n  l1 = [fdp.ConsumeUnicodeNoSurrogates(20)]\n\n  patch = mock.patch(\n    \"looker_sdk.rtl.requests_transport.RequestsTransport.request\",\n    wraps=transport_requests_mock\n  )\n  # Perform a set of operations\n  op_count = fdp.ConsumeIntInRange(1, 10)\n  with patch:\n    for i in range(op_count):\n      op = fdp.ConsumeIntInRange(1,3)\n      if op == 1:\n        try:\n          query = sdk.create_query(\n            body=models.WriteQuery(model=m1, view=v1, fields=l1)\n          )\n        except looker_sdk.rtl.serialize.DeserializeError:\n          pass\n      elif op == 2:\n        try:\n          query = sdk.create_query_task(\n            body = models.WriteCreateQueryTask(\n              query_id=fdp.ConsumeUnicodeNoSurrogates(10),\n              source=fdp.ConsumeUnicodeNoSurrogates(10),\n              results_format=looker_sdk.sdk.api40.ResultFormat.csv\n            )\n          )\n        except looker_sdk.rtl.serialize.DeserializeError:\n          pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/looker-sdk/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/looker-open-source/sdk-codegen\nlanguage: python\nmain_repo: https://github.com/looker-open-source/sdk-codegen\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/lotus/Dockerfile",
    "content": "# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN apt-get update && apt-get install -y mesa-opencl-icd ocl-icd-opencl-dev gcc \\\n    git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev\nRUN git clone --depth 1 https://github.com/filecoin-project/lotus\nRUN git clone --depth 1 https://github.com/filecoin-project/fuzzing-lotus\nCOPY build.sh $SRC/\nWORKDIR $SRC/lotus\n"
  },
  {
    "path": "projects/lotus/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit submodule init\ngit submodule update\ncompile_go_fuzzer github.com/filecoin-project/lotus/chain/types FuzzMessage fuzz_message gofuzz\n\n# Fuzzers from fuzzing-lotus\ncd ../fuzzing-lotus/fuzz\nrm -Rf libfuzzer\ngo mod init github.com/filecoin-project/fuzzing-lotus/fuzz\ngo mod tidy\n\ncompile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzBlockMsg fuzz_block_msg\ncompile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzBlockMsgStructural fuzz_block_msg_structural\ncompile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzBlockHeader fuzz_block_header\ncompile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzNodesForHeight fuzz_nodes_for_height\n"
  },
  {
    "path": "projects/lotus/project.yaml",
    "content": "homepage: \"https://github.com/filecoin-project/lotus\"\nmain_repo: \"https://github.com/filecoin-project/lotus\"\nprimary_contact: \"security@filecoin.org\"\nauto_ccs :\n  - \"Adam@adalogics.com\"\n  - \"kubuxu@protocol.ai\"\n  - \"yolan@protocol.ai\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/lua/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone https://github.com/ligurio/lunapark testdir\nWORKDIR testdir\nRUN git clone --depth 1 --jobs $(nproc) https://github.com/ligurio/lunapark-corpus corpus_dir\nCOPY build.sh $SRC/testdir/\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fuzz_lua.c $SRC/\n"
  },
  {
    "path": "projects/lua/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# For some reason the linker will complain if address sanitizer is not used\n# in introspector builds.\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n  export CFLAGS=\"${CFLAGS} -fsanitize=address\"\n  export CXXFLAGS=\"${CXXFLAGS} -fsanitize=address\"\nfi\n\nPACKAGES=\"build-essential ninja-build cmake make\"\nif [ \"$ARCHITECTURE\" = \"i386\" ]; then\n    PACKAGES=\"$PACKAGES zlib1g-dev:i386 libreadline-dev:i386 libunwind-dev:i386\"\nelif [ \"$ARCHITECTURE\" = \"aarch64\" ]; then\n    PACKAGES=\"$PACKAGES zlib1g-dev:arm64 libreadline-dev:arm64 libunwind-dev:arm64\"\nelse\n    PACKAGES=\"$PACKAGES zlib1g-dev libreadline-dev libunwind-dev\"\nfi\napt-get update\napt-get install -y $PACKAGES\n\n# For fuzz-introspector, exclude all functions in the tests directory,\n# libprotobuf-mutator and protobuf source code.\n# See https://github.com/ossf/fuzz-introspector/blob/main/doc/Config.md#code-exclusion-from-the-report\nexport FUZZ_INTROSPECTOR_CONFIG=$SRC/fuzz_introspector_exclusion.config\ncat > $FUZZ_INTROSPECTOR_CONFIG <<EOF\nFILES_TO_AVOID\ntestdir/build/tests/capi/external.protobuf_mutator\ntestdir/build/tests/capi/luaL_loadbuffer_proto/\nEOF\n\ncd $SRC/testdir\n\n# Avoid compilation issue due to some undefined references. They are defined in\n# libc++ and used by Centipede so -lc++ needs to come after centipede's lib.\nif [[ $FUZZING_ENGINE == centipede ]]\nthen\n    sed -i \\\n        '/$ENV{LIB_FUZZING_ENGINE}/a \\ \\ \\ \\ \\ \\ \\ \\ -lc++' \\\n        tests/capi/CMakeLists.txt\nfi\n\n# Clean up potentially persistent build directory.\n[[ -e $SRC/testdir/build ]] && rm -rf $SRC/testdir/build\n\ncase $SANITIZER in\n  address) SANITIZERS_ARGS=\"-DENABLE_ASAN=ON\" ;;\n  undefined) SANITIZERS_ARGS=\"-DENABLE_UBSAN=ON\" ;;\n  *) SANITIZERS_ARGS=\"\" ;;\nesac\n\nexport LSAN_OPTIONS=\"verbosity=1:log_threads=1\"\n\n# Workaround for a LeakSanitizer crashes,\n# see https://github.com/google/oss-fuzz/issues/11798.\nif [ \"$ARCHITECTURE\" = \"aarch64\" ]; then\n    export ASAN_OPTIONS=detect_leaks=0\nfi\n\n: ${LD:=\"${CXX}\"}\n: ${LDFLAGS:=\"${CXXFLAGS}\"}  # to make sure we link with sanitizer runtime\n\ncmake_args=(\n    -DUSE_LUA=ON\n    -DOSS_FUZZ=ON\n    $SANITIZERS_ARGS\n\n    # C compiler\n    -DCMAKE_C_COMPILER=\"${CC}\"\n    -DCMAKE_C_FLAGS=\"${CFLAGS}\"\n\n    # C++ compiler\n    -DCMAKE_CXX_COMPILER=\"${CXX}\"\n    -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\"\n\n    # Linker\n    -DCMAKE_LINKER=\"${LD}\"\n    -DCMAKE_EXE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_MODULE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_SHARED_LINKER_FLAGS=\"${LDFLAGS}\"\n)\n\n# To deal with a host filesystem from inside of container.\ngit config --global --add safe.directory '*'\n\n# Build the project and fuzzers.\n[[ -e build ]] && rm -rf build\ncmake \"${cmake_args[@]}\" -S . -B build -G Ninja\ncmake --build build --parallel --verbose\n\nLUALIB_PATH=\"$SRC/testdir/build/lua-master/source/\"\n$CC $CFLAGS -I$LUALIB_PATH -c $SRC/fuzz_lua.c -o fuzz_lua.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_lua.o -o $OUT/fuzz_lua $LUALIB_PATH/liblua.a\n\n# If the dict filename is the same as your target binary name\n# (i.e. `%fuzz_target%.dict`), it will be automatically used.\n# If the name is different (e.g. because it is shared by several\n# targets), specify this in .options file.\ncp corpus_dir/*.dict corpus_dir/*.options $OUT/\n\n# Archive and copy to $OUT seed corpus if the build succeeded.\nfor f in $(find build/tests/ -name '*_test' -type f);\ndo\n  name=$(basename $f);\n  module=$(echo $name | sed 's/_test//')\n  corpus_dir=\"corpus_dir/$module\"\n  echo \"Copying for $module\";\n  cp $f $OUT/\n  [[ -e $corpus_dir ]] && find \"$corpus_dir\" -mindepth 1 -maxdepth 1 | zip -@ -j $OUT/\"$name\"_seed_corpus.zip\ndone\n"
  },
  {
    "path": "projects/lua/fuzz_lua.c",
    "content": "/* Copyright 2020 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n\n#define lua_c\n\n#include \"lprefix.h\"\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdint.h>\n\n#include <signal.h>\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n#if !defined(LUA_PROGNAME)\n#define LUA_PROGNAME            \"lua\"\n#endif\n\n#if !defined(LUA_INIT_VAR)\n#define LUA_INIT_VAR            \"LUA_INIT\"\n#endif\n\n#define LUA_INITVARVERSION      LUA_INIT_VAR LUA_VERSUFFIX\n\n\nstatic lua_State *globalL = NULL;\n\nstatic const char *progname = LUA_PROGNAME;\n\n\n/*\n** Hook set by signal function to stop the interpreter.\n*/\nstatic void lstop (lua_State *L, lua_Debug *ar) {\n  (void)ar;  /* unused arg. */\n  lua_sethook(L, NULL, 0, 0);  /* reset hook */\n  luaL_error(L, \"interrupted!\");\n}\n\n\n/*\n** Function to be called at a C signal. Because a C signal cannot\n** just change a Lua state (as there is no proper synchronization),\n** this function only sets a hook that, when called, will stop the\n** interpreter.\n*/\nstatic void laction (int i) {\n  int flag = LUA_MASKCALL | LUA_MASKRET | LUA_MASKLINE | LUA_MASKCOUNT;\n  signal(i, SIG_DFL); /* if another SIGINT happens, terminate process */\n  lua_sethook(globalL, lstop, flag, 1);\n}\n\n/*\n** Prints an error message, adding the program name in front of it\n** (if present)\n*/\nstatic void l_message (const char *pname, const char *msg) {\n  if (pname) fprintf(stderr, \"%s: \", pname);\n  fprintf(stderr, \"%s\\n\", msg);\n}\n\n\n/*\n** Check whether 'status' is not OK and, if so, prints the error\n** message on the top of the stack. It assumes that the error object\n** is a string, as it was either generated by Lua or by 'msghandler'.\n*/\nstatic int report (lua_State *L, int status) {\n  if (status != LUA_OK) {\n    const char *msg = lua_tostring(L, -1);\n    l_message(progname, msg);\n    lua_pop(L, 1);  /* remove message */\n  }\n  return status;\n}\n\n/*\n** Message handler used to run all chunks\n*/\nstatic int msghandler (lua_State *L) {\n  const char *msg = lua_tostring(L, 1);\n  if (msg == NULL) {  /* is error object not a string? */\n    if (luaL_callmeta(L, 1, \"__tostring\") &&  /* does it have a metamethod */\n        lua_type(L, -1) == LUA_TSTRING)  /* that produces a string? */\n      return 1;  /* that is the message */\n    else\n      msg = lua_pushfstring(L, \"(error object is a %s value)\",\n                               luaL_typename(L, 1));\n  }\n  luaL_traceback(L, L, msg, 1);  /* append a standard traceback */\n  return 1;  /* return the traceback */\n}\n\n\n/*\n** Interface to 'lua_pcall', which sets appropriate message function\n** and C-signal handler. Used to run all chunks.\n*/\nstatic int docall (lua_State *L, int narg, int nres) {\n  int status;\n  int base = lua_gettop(L) - narg;  /* function index */\n  lua_pushcfunction(L, msghandler);  /* push message handler */\n  lua_insert(L, base);  /* put it under function and args */\n  globalL = L;  /* to be available to 'laction' */\n  signal(SIGINT, laction);  /* set C-signal handler */\n  status = lua_pcall(L, narg, nres, base);\n  signal(SIGINT, SIG_DFL); /* reset C-signal handler */\n  lua_remove(L, base);  /* remove message handler from the stack */\n  return status;\n}\n\n\nstatic int dochunk (lua_State *L, int status) {\n  if (status == LUA_OK) status = docall(L, 0, 0);\n  return report(L, status);\n}\n\n\n/* mark in error messages for incomplete statements */\n#define EOFMARK         \"<eof>\"\n#define marklen         (sizeof(EOFMARK)/sizeof(char) - 1)\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    lua_State *L = luaL_newstate();\n    if (L == NULL) {\n        return 0;\n    }\n    dochunk(L, luaL_loadbufferx(L, (const char *)data, size, \"test\", \"t\"));\n\n\n    lua_close(L);\n    return 0;\n}\n"
  },
  {
    "path": "projects/lua/project.yaml",
    "content": "homepage: \"https://www.lua.org/\"\nlanguage: c\nprimary_contact: \"roberto@inf.puc-rio.br\"\nauto_ccs:\n  - \"fuzz@lua.org\"\n  - \"david@adalogics.com\"\n  - \"estetus@gmail.com\"\nmain_repo: 'https://github.com/lua/lua'\narchitectures:\n  - i386\n  - x86_64\n"
  },
  {
    "path": "projects/lua-example/Dockerfile",
    "content": "# Copyright 2023-2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y build-essential make\n\nCOPY build.sh $SRC/\nCOPY compile_lua_fuzzer $SRC/\n\n# For real projects, you would clone your repo in the next step.\nRUN mkdir -p $SRC/example\n\n# Ideally, you have already configured fuzz tests in your repo so\n# that they run (in luzer regression mode) as part of unit testing.\n# Keeping the fuzz tests in sync with the source code ensures that\n# they are adjusted continue to work after code changes. Here,\n# we copy them into the example project directory.\nCOPY example_basic.lua $SRC/example/fuzz_basic.lua\n\nWORKDIR $SRC/example\n"
  },
  {
    "path": "projects/lua-example/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Finish execution if libFuzzer is not used, because luzer\n# is libFuzzer-based.\nif [[ \"$FUZZING_ENGINE\" != libfuzzer ]]; then\n  return\nfi\n\n# Install dependencies:\n# 1. The libraries required for building luzer module.\n# 2. PUC Rio Lua executable, required for running tests itself.\n# 3. The Lua package manager.\napt install -y cmake liblua5.1-0 liblua5.1-0-dev lua5.1 luarocks\n\nexport OSS_FUZZ=1\n# Install Lua libraries.\nluarocks install --lua-version 5.1 --server=https://luarocks.org/dev --tree=lua_modules luzer\n\nLUA_RUNTIME_NAME=lua\n\n# Build fuzzers.\n$SRC/compile_lua_fuzzer $LUA_RUNTIME_NAME fuzz_basic.lua\n\ncp fuzz_basic.lua \"$OUT/\"\ncp /usr/bin/lua5.1 \"$OUT/$LUA_RUNTIME_NAME\"\ncp -R lua_modules \"$OUT/\"\n"
  },
  {
    "path": "projects/lua-example/compile_lua_fuzzer",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# The Lua runtime name.\nlua_runtime=$1\n# Path to the fuzz target source file relative to the project's root.\nfuzz_target=$2\n\nfuzzer_basename=$(basename -s .lua \"$fuzz_target\")\n\n# Create an execution wrapper that executes luzer with the correct\n# arguments.\necho \"#!/bin/bash\n\n# LLVMFuzzerTestOneInput so that the wrapper script is recognized\n# as a fuzz target for 'check_build'.\nproject_dir=\\$(dirname \\\"\\$0\\\")\neval \\$(luarocks --tree lua_modules path)\nLD_PRELOAD=\\$project_dir/lua_modules/lib/lua/5.1/libfuzzer_with_asan.so \\\nASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$project_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$project_dir/$lua_runtime \\$project_dir/$fuzz_target \\$@\" > \"$OUT/$fuzzer_basename\"\n\nchmod +x \"$OUT/$fuzzer_basename\"\n"
  },
  {
    "path": "projects/lua-example/example_basic.lua",
    "content": "-- Copyright 2026 Google LLC\n\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may not use this file except in compliance with the\n-- License.\n-- You may obtain a copy of the License at\n--\n--      http://www.apache.org/licenses/LICENSE-2.0\n--\n-- Unless required by applicable law or agreed to in writing,\n-- software distributed under the License is distributed on an\n-- \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n-- either express or implied.\n-- See the License for the specific language governing permissions\n-- and limitations under the License.\n\nlocal luzer = require(\"luzer\")\n\nlocal function TestOneInput(buf)\n    local fdp = luzer.FuzzedDataProvider(buf)\n    local str = fdp:consume_string(4)\n\n    local b = {}\n    str:gsub(\".\", function(c) table.insert(b, c) end)\n    local count = 0\n    if b[1] == \"o\" then count = count + 1 end\n    if b[2] == \"o\" then count = count + 1 end\n    if b[3] == \"p\" then count = count + 1 end\n    if b[4] == \"s\" then count = count + 1 end\n\n    if count == 4 then assert(nil) end\nend\n\nlocal args = {\n    only_ascii = 1,\n    print_pcs = 1,\n}\n\nluzer.Fuzz(TestOneInput, nil, args)\n"
  },
  {
    "path": "projects/lua-example/project.yaml",
    "content": "homepage: https://github.com/ligurio/luzer\nlanguage: c\nmain_repo: https://github.com/ligurio/luzer\nfuzzing_engines:\n  # luzer is libFuzzer-based, other engines are not supported.\n  - libfuzzer\nvendor_ccs:\n  - estetus@gmail.com\n"
  },
  {
    "path": "projects/lucene/CustomAnalyzerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.BufferedReader;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.Reader;\nimport java.io.StringReader;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Map;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.lang.IllegalArgumentException;\nimport java.lang.IllegalStateException;\nimport java.lang.IllegalArgumentException;\nimport org.apache.lucene.analysis.standard.StandardAnalyzer;\nimport org.apache.lucene.analysis.TokenStream;\nimport org.apache.lucene.analysis.tokenattributes.CharTermAttribute;\nimport org.apache.lucene.analysis.Analyzer;\nimport org.apache.lucene.analysis.Tokenizer;\nimport org.apache.lucene.index.IndexWriter;\nimport org.apache.lucene.analysis.custom.CustomAnalyzer;\n\npublic class CustomAnalyzerFuzzer {\n    static String [] tokenizerArray = {\n        \"standard\",\n        \"simplePattern\",\n        \"classic\",\n        \"whitespace\",\n        \"uax29UrlEmail\",\n        \"pathHierarchy\",\n        \"wikipedia\",\n        \"nGram\",\n        \"edgeNGram\",\n        \"thai\",\n        \"pattern\",\n        \"simplePatternSplit\",\n        \"letter\",\n        \"keyword\"\n    };\n\n    static String [] charFilterArray = {\n        \"htmlStrip\",\n        \"cjkWidth\",\n        \"mapping\",\n        \"patternReplace\",\n        \"persian\"\n    };\n\n    static String [] tokenFilterArray = {\n        \"apostrophe\",\n        \"arabicNormalization\",\n        \"arabicStem\",\n        \"asciiFolding\",\n        \"bengaliNormalization\",\n        \"bengaliStem\",\n        \"brazilianStem\",\n        \"bulgarianStem\",\n        \"capitalization\",\n        \"cjkBigram\",\n        \"cjkWidth\",\n        \"classic\",\n        \"codepointCount\",\n        \"commonGrams\",\n        \"commonGramsQuery\",\n        \"concatenateGraph\",\n        \"czechStem\",\n        \"dateRecognizer\",\n        \"decimalDigit\",\n        \"delimitedPayload\",\n        \"delimitedTermFrequency\",\n        \"dictionaryCompoundWord\",\n        \"edgeNGram\",\n        \"elision\",\n        \"englishMinimalStem\",\n        \"englishPossessive\",\n        \"fingerprint\",\n        \"finnishLightStem\",\n        \"fixBrokenOffsets\",\n        \"fixedShingle\",\n        \"flattenGraph\", \n        \"frenchLightStem\", \n        \"frenchMinimalStem\", \n        \"galicianMinimalStem\", \n        \"galicianStem\", \n        \"germanLightStem\", \n        \"germanMinimalStem\", \n        \"germanNormalization\", \n        \"germanStem\", \n        \"greekLowercase\", \n        \"greekStem\", \n        \"hindiNormalization\", \n        \"hindiStem\", \n        \"hungarianLightStem\", \n        \"hunspellStem\",\n        \"hyphenatedWords\", \n        \"hyphenationCompoundWord\",\n        \"indicNormalization\", \n        \"indonesianStem\", \n        \"irishLowercase\", \n        \"italianLightStem\", \n        \"kStem\", \n        \"keepWord\", \n        \"keywordMarker\", \n        \"keywordRepeat\", \n        \"latvianStem\", \n        \"length\",\n        \"limitTokenCount\",\n        \"limitTokenOffset\",\n        \"limitTokenPosition\",\n        \"lowercase\", \n        \"minHash\", \n        \"nGram\",\n        \"norwegianLightStem\", \n        \"norwegianMinimalStem\", \n        \"numericPayload\",\n        \"patternCaptureGroup\",\n        \"patternReplace\",\n        \"persianNormalization\", \n        \"porterStem\", \n        \"portugueseLightStem\", \n        \"portugueseMinimalStem\", \n        \"portugueseStem\", \n        \"protectedTerm\",\n        \"removeDuplicates\", \n        \"reverseString\", \n        \"russianLightStem\", \n        \"scandinavianFolding\", \n        \"scandinavianNormalization\", \n        \"serbianNormalization\", \n        \"shingle\", \n        \"snowballPorter\", \n        \"soraniNormalization\", \n        \"soraniStem\", \n        \"spanishLightStem\", \n        \"spanishMinimalStem\", \n        \"stemmerOverride\", \n        \"stop\", \n        \"swedishLightStem\", \n        \"synonym\",\n        \"synonymGraph\",\n        \"tokenOffsetPayload\", \n        \"trim\", \n        \"truncate\", \n        \"turkishLowercase\", \n        \"type\",\n        \"typeAsPayload\", \n        \"typeAsSynonym\", \n        \"uppercase\", \n        \"wordDelimiter\", \n        \"wordDelimiterGraph\"\n    };\n\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        List<String> selectedTokenizers = data.pickValues(tokenizerArray, data.consumeInt(0, tokenizerArray.length));\n        List<String> selectedCharFilters = data.pickValues(charFilterArray, data.consumeInt(0, charFilterArray.length));\n        List<String> selectedTokenFilters = data.pickValues(tokenFilterArray, data.consumeInt(0, tokenFilterArray.length));\n        String str0 = data.consumeString(100);\n        String str1 = data.consumeRemainingAsString();\n        CustomAnalyzer.Builder cb = CustomAnalyzer.builder();\n        \n        try {\n            cb.withTokenizer(data.pickValue(tokenizerArray));\n\n            for (String cf : selectedCharFilters) {\n                cb.addCharFilter(cf);\n            }\n\n            for (String tf : selectedTokenFilters) {\n                cb.addTokenFilter(tf);\n            }\n\n            Analyzer analyzer = cb.build();\n            List<String> result = analyze(str0, str1, analyzer);\n        } catch (IOException e) {\n            // IOException must be caught or declared to be thrown according to docs.\n        } catch (IllegalStateException e) {\n            // IllegalStateException is caught because with specific crashing input it will trigger line 185 in GraphTokenFilter.java\n            // https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/analysis/GraphTokenFilter.java#L185\n        } catch (IllegalArgumentException e) {\n            // IllegalArgumentException is not documented but will be thrown with specific crashing input.\n        } \n        \n\n    }\n\n    public static List<String> analyze(String field, String text, Analyzer analyzer) throws IOException {\n        List<String> result = new ArrayList<String>();\n        TokenStream tokenStream = analyzer.tokenStream(field, text);\n        CharTermAttribute attr = tokenStream.addAttribute(CharTermAttribute.class);\n        tokenStream.reset();\n        while(tokenStream.incrementToken()) {\n           result.add(attr.toString());\n        }       \n        return result;\n    }\n}"
  },
  {
    "path": "projects/lucene/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/apache/lucene.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nCOPY build.patch $SRC/lucene\nWORKDIR $SRC/lucene"
  },
  {
    "path": "projects/lucene/IndexSearchFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.nio.file.Path;\nimport java.nio.file.Files;\nimport java.io.IOException;\nimport org.apache.lucene.analysis.Analyzer;\nimport org.apache.lucene.analysis.standard.StandardAnalyzer;\nimport org.apache.lucene.store.Directory;\nimport org.apache.lucene.store.FSDirectory;\nimport org.apache.lucene.index.IndexWriter;\nimport org.apache.lucene.index.StoredFields;\nimport org.apache.lucene.index.DirectoryReader;\nimport org.apache.lucene.index.IndexWriterConfig;\nimport org.apache.lucene.document.Field;\nimport org.apache.lucene.document.Document;\nimport org.apache.lucene.document.TextField;\nimport org.apache.lucene.search.Query;\nimport org.apache.lucene.search.ScoreDoc;\nimport org.apache.lucene.search.IndexSearcher;\nimport org.apache.lucene.queryparser.classic.QueryParser;\nimport org.apache.lucene.queryparser.classic.ParseException;\nimport org.apache.lucene.util.IOUtils;\nimport org.apache.lucene.util.automaton.TooComplexToDeterminizeException;\n\n\npublic class IndexSearchFuzzer {\n    static Analyzer analyzer = null;\n    static Path indexPath = null;\n    static Directory directory = null;\n    static IndexWriterConfig config = null;\n    static IndexWriter iwriter = null;\n    static Document doc = null;\n    static DirectoryReader ireader = null;\n    static IndexSearcher isearcher = null;\n\n    public static void fuzzerInitialize() {\n        try {\n            analyzer = new StandardAnalyzer();\n            indexPath = Files.createTempDirectory(\"tempIndex\");\n            directory = FSDirectory.open(indexPath);\n            config = new IndexWriterConfig(analyzer);\n            iwriter = new IndexWriter(directory, config);\n            doc = new Document();\n            ireader = DirectoryReader.open(directory);\n            isearcher = new IndexSearcher(ireader);\n        } catch (IOException e) {\n            // IOException must be caught or declared to be thrown according to docs.\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        boolean commit = data.consumeBoolean();\n        int n = data.consumeInt();\n        String text = data.consumeString(500);\n        String field = data.consumeString(500); \n        String queryStr = data.consumeRemainingAsString();\n        \n        try {\n            doc.add(new Field(field, text, TextField.TYPE_STORED));\n            iwriter.addDocument(doc);\n            iwriter.commit();\n            \n            QueryParser parser = new QueryParser(field, analyzer);\n            Query query = parser.parse(queryStr);\n            ScoreDoc[] hits = isearcher.search(query, n).scoreDocs;\n        } catch (IOException | ParseException e) {\n            // IOException must be caught or declared to be thrown according to docs.\n            // ParseException must be caught or declared to be thrown for QueryParser.parse\n        } catch (NullPointerException | IllegalArgumentException | TooComplexToDeterminizeException e) {\n            // These exceptions are not documented but will be thrown with specific crashing input.\n        }\n    }\n}\n"
  },
  {
    "path": "projects/lucene/QueryParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.List;\n\nimport javax.imageio.IIOException;\n\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.ByteArrayInputStream;\nimport java.nio.file.Path;\nimport java.nio.file.Files;\nimport org.apache.lucene.analysis.Analyzer;\nimport org.apache.lucene.analysis.custom.CustomAnalyzer;\nimport org.apache.lucene.analysis.synonym.SolrSynonymParser;\nimport org.apache.lucene.analysis.synonym.WordnetSynonymParser;\nimport org.apache.lucene.search.IndexSearcher;\nimport org.apache.lucene.geo.SimpleWKTShapeParser;\nimport org.apache.lucene.queryparser.xml.CoreParser;\nimport org.apache.lucene.queryparser.xml.ParserException;\nimport org.apache.lucene.queryparser.classic.QueryParser;\nimport org.apache.lucene.queryparser.classic.ParseException;\nimport org.apache.lucene.queryparser.simple.SimpleQueryParser;\nimport org.apache.lucene.queryparser.xml.CorePlusQueriesParser;\nimport org.apache.lucene.queryparser.classic.MultiFieldQueryParser;\nimport org.apache.lucene.queryparser.flexible.core.QueryNodeException;\nimport org.apache.lucene.queryparser.flexible.standard.StandardQueryParser;\nimport org.apache.lucene.queryparser.complexPhrase.ComplexPhraseQueryParser;\nimport org.apache.lucene.queryparser.flexible.precedence.PrecedenceQueryParser;\n\npublic class QueryParserFuzzer {\n    static String [] tokenizerArray = {\n        \"standard\",\n        \"simplePattern\",\n        \"classic\",\n        \"whitespace\",\n        \"uax29UrlEmail\",\n        \"pathHierarchy\",\n        \"wikipedia\",\n        \"nGram\",\n        \"edgeNGram\",\n        \"thai\",\n        \"pattern\",\n        \"simplePatternSplit\",\n        \"letter\",\n        \"keyword\"\n    };\n\n    static String [] charFilterArray = {\n        \"htmlStrip\",\n        \"cjkWidth\",\n        \"mapping\",\n        \"patternReplace\",\n        \"persian\"\n    };\n\n    static String [] tokenFilterArray = {\n        \"apostrophe\",\n        \"arabicNormalization\",\n        \"arabicStem\",\n        \"asciiFolding\",\n        \"bengaliNormalization\",\n        \"bengaliStem\",\n        \"brazilianStem\",\n        \"bulgarianStem\",\n        \"capitalization\",\n        \"cjkBigram\",\n        \"cjkWidth\",\n        \"classic\",\n        \"codepointCount\",\n        \"commonGrams\",\n        \"commonGramsQuery\",\n        \"concatenateGraph\",\n        \"czechStem\",\n        \"dateRecognizer\",\n        \"decimalDigit\",\n        \"delimitedPayload\",\n        \"delimitedTermFrequency\",\n        \"dictionaryCompoundWord\",\n        \"edgeNGram\",\n        \"elision\",\n        \"englishMinimalStem\",\n        \"englishPossessive\",\n        \"fingerprint\",\n        \"finnishLightStem\",\n        \"fixBrokenOffsets\",\n        \"fixedShingle\",\n        \"flattenGraph\", \n        \"frenchLightStem\", \n        \"frenchMinimalStem\", \n        \"galicianMinimalStem\", \n        \"galicianStem\", \n        \"germanLightStem\", \n        \"germanMinimalStem\", \n        \"germanNormalization\", \n        \"germanStem\", \n        \"greekLowercase\", \n        \"greekStem\", \n        \"hindiNormalization\", \n        \"hindiStem\", \n        \"hungarianLightStem\", \n        \"hunspellStem\",\n        \"hyphenatedWords\", \n        \"hyphenationCompoundWord\",\n        \"indicNormalization\", \n        \"indonesianStem\", \n        \"irishLowercase\", \n        \"italianLightStem\", \n        \"kStem\", \n        \"keepWord\", \n        \"keywordMarker\", \n        \"keywordRepeat\", \n        \"latvianStem\", \n        \"length\",\n        \"limitTokenCount\",\n        \"limitTokenOffset\",\n        \"limitTokenPosition\",\n        \"lowercase\", \n        \"minHash\", \n        \"nGram\",\n        \"norwegianLightStem\", \n        \"norwegianMinimalStem\", \n        \"numericPayload\",\n        \"patternCaptureGroup\",\n        \"patternReplace\",\n        \"persianNormalization\", \n        \"porterStem\", \n        \"portugueseLightStem\", \n        \"portugueseMinimalStem\", \n        \"portugueseStem\", \n        \"protectedTerm\",\n        \"removeDuplicates\", \n        \"reverseString\", \n        \"russianLightStem\", \n        \"scandinavianFolding\", \n        \"scandinavianNormalization\", \n        \"serbianNormalization\", \n        \"shingle\", \n        \"snowballPorter\", \n        \"soraniNormalization\", \n        \"soraniStem\", \n        \"spanishLightStem\", \n        \"spanishMinimalStem\", \n        \"stemmerOverride\", \n        \"stop\", \n        \"swedishLightStem\", \n        \"synonym\",\n        \"synonymGraph\",\n        \"tokenOffsetPayload\", \n        \"trim\", \n        \"truncate\", \n        \"turkishLowercase\", \n        \"type\",\n        \"typeAsPayload\", \n        \"typeAsSynonym\", \n        \"uppercase\", \n        \"wordDelimiter\", \n        \"wordDelimiterGraph\"\n    };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String field = data.consumeString(500);\n        String field2 = data.consumeString(500);\n        String field3 = data.consumeString(500);\n        String [] fields = {field, field2, field3};\n        String query = data.consumeString(500);\n        String query2 = data.consumeString(500);\n        String query3 = data.consumeString(500);\n        String [] queries = {query, query2, query3};\n        Boolean dedup = data.consumeBoolean();\n        Boolean expand = data.consumeBoolean();\n        List<String> selectedTokenizers = data.pickValues(tokenizerArray, data.consumeInt(0, tokenizerArray.length));\n        List<String> selectedCharFilters = data.pickValues(charFilterArray, data.consumeInt(0, charFilterArray.length));\n        List<String> selectedTokenFilters = data.pickValues(tokenFilterArray, data.consumeInt(0, tokenFilterArray.length));\n        CustomAnalyzer.Builder cb = CustomAnalyzer.builder();        \n\n        try {\n            cb.withTokenizer(data.pickValue(tokenizerArray));\n\n            for (String cf : selectedCharFilters) {\n                cb.addCharFilter(cf);\n            }\n\n            for (String tf : selectedTokenFilters) {\n                cb.addTokenFilter(tf);\n            }\n\n            Analyzer analyzer = cb.build();\n\n            QueryParser queryParser = new QueryParser(field, analyzer);\n            queryParser.parse(query);\n\n            StandardQueryParser standardQueryParser = new StandardQueryParser(analyzer);\n            standardQueryParser.parse(query, field);\n\n            SimpleQueryParser simpleQueryParser = new SimpleQueryParser(analyzer, field);\n            simpleQueryParser.parse(query);\n            \n            ComplexPhraseQueryParser complexPhraseQueryParser = new ComplexPhraseQueryParser(field, analyzer);\n            complexPhraseQueryParser.parse(query); \n            \n            MultiFieldQueryParser multiFieldQueryParser = new MultiFieldQueryParser(fields, analyzer);\n            multiFieldQueryParser.parse(queries, fields, analyzer); \n            \n            PrecedenceQueryParser precedenceQueryParser = new PrecedenceQueryParser(analyzer);\n            precedenceQueryParser.parse(query, field);\n            \n            CoreParser coreParser = new CoreParser(field, analyzer);\n            coreParser.parse(new ByteArrayInputStream(query.getBytes()));\n            \n            CorePlusQueriesParser corePlusQueriesParser = new CorePlusQueriesParser(field, analyzer);\n            corePlusQueriesParser.parse(new ByteArrayInputStream(query.getBytes()));\n            \n            SolrSynonymParser solrqSynonymParser = new SolrSynonymParser(dedup, expand, analyzer);\n            solrqSynonymParser.parse(new InputStreamReader(new ByteArrayInputStream(query.getBytes())));\n            \n            WordnetSynonymParser wordnetSynonymParser = new WordnetSynonymParser(dedup, expand, analyzer);\n            wordnetSynonymParser.parse(new InputStreamReader(new ByteArrayInputStream(query.getBytes())));\n            \n            SimpleWKTShapeParser.parse(query);\n        } catch (IOException | QueryNodeException | ParseException | ParserException | java.text.ParseException e) {\n            // IOException must be caught or declared to be thrown according to docs.\n            // QueryNodeException must be caught or declared to be thrown according to docs.\n            // ParseException must be caught or declared to be thrown according to docs.\n            // ParserException must be caught or declared to be thrown according to docs.\n            // java.text.ParseException must be caught or declared to be thrown according to docs.\n        } catch (RuntimeException e) {\n            // Undocumented RuntimeException is thrown at https://github.com/apache/lucene/blob/main/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java#L147\n        } \n\n    }\n}\n"
  },
  {
    "path": "projects/lucene/build.patch",
    "content": "diff --git a/build.gradle b/build.gradle\nindex 6032f3a72cc..c85d3534544 100644\n--- a/build.gradle\n+++ b/build.gradle\n@@ -27,6 +27,7 @@ plugins {\n   id \"net.ltgt.errorprone\" version \"3.0.1\" apply false\n   id 'com.diffplug.spotless' version \"6.5.2\" apply false\n   id 'org.barfuin.gradle.jacocolog' version \"3.0.0-RC2\" apply false\n+  id 'com.github.johnrengelman.shadow' version '7.1.2'\n }\n \n apply from: file('gradle/globals.gradle')\n@@ -52,6 +53,7 @@ description = 'Grandparent project for Apache Lucene Core'\n // Propagate version and derived properties across projects.\n allprojects {\n   version = rootProject.version\n+  apply plugin: 'com.github.johnrengelman.shadow'\n }\n \n ext {\n"
  },
  {
    "path": "projects/lucene/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nGRADLE_ARGS=\"-x test -x javadoc\"\npatch build.gradle build.patch\n./gradlew shadowJar $GRADLE_ARGS\nLUCENE_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n\ncp $SRC/lucene/lucene/analysis/common/build/libs/lucene-analysis-common-$LUCENE_VERSION-all.jar $OUT/lucene-analysis-common.jar\ncp $SRC/lucene/lucene/core/build/libs/lucene-core-$LUCENE_VERSION-all.jar $OUT/lucene-core.jar\ncp $SRC/lucene/lucene/queryparser/build/libs/lucene-queryparser-$LUCENE_VERSION-all.jar $OUT/lucene-queryparser.jar\n\nALL_JARS=\"lucene-analysis-common.jar lucene-core.jar lucene-queryparser.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/[$fuzzer_basename]*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/lucene/project.yaml",
    "content": "homepage: \"https://lucene.apache.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/lucene\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"david.w.smiley@gmail.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/lwan/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update\nRUN apt-get install -y build-essential cmake git ninja-build zlib1g-dev\n\nRUN git clone --depth 1 https://github.com/lpereira/lwan.git\nWORKDIR lwan\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/lwan/build.sh",
    "content": "#!/bin/bash -euv\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nmkdir -p $WORK/lwan\ncd $WORK/lwan\n\ncmake -GNinja \\\n\t-DCMAKE_BUILD_TYPE=Debug \\\n\t-DCMAKE_C_COMPILER=\"${CC}\" \\\n\t-DCMAKE_C_FLAGS=\"${CFLAGS}\" \\\n\t$SRC/lwan/\n\nninja -v liblwan.a\n\ncp $SRC/lwan/fuzz/*.dict $OUT/\n\nfor fuzzer in $SRC/lwan/src/bin/fuzz/*_fuzzer.cc; do\n\texecutable=$(basename $fuzzer .cc)\n\tcorpus_base=$(basename $fuzzer _fuzzer.cc)\n\n\tzip -jr $OUT/${executable}_seed_corpus.zip $SRC/lwan/fuzz/corpus/corpus-${corpus_base}-*\n\t\n\t$CXX $CXXFLAGS -std=c++11 \\\n\t\t-Wl,-whole-archive $WORK/lwan/src/lib/liblwan.a -Wl,-no-whole-archive \\\n\t\t-I$SRC/lwan/src/lib $fuzzer \\\n\t\t$LIB_FUZZING_ENGINE -lpthread -lz \\\n\t\t-o $OUT/$executable\ndone\n"
  },
  {
    "path": "projects/lwan/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/lpereira/lwan\"\nlanguage: c++\nprimary_contact: \"leandro.pereira@gmail.com\"\nsanitizers:\n  - address\nmain_repo: 'https://github.com/lpereira/lwan.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/lxc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://github.com/lxc/lxc\nWORKDIR lxc\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/lxc/build.sh",
    "content": "#!/bin/bash -e\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"${CFLAGS} -Wno-error=backend-plugin\"\nsrc/tests/oss-fuzz.sh\n"
  },
  {
    "path": "projects/lxc/project.yaml",
    "content": "homepage: \"https://github.com/lxc/lxc\"\nlanguage: c\nprimary_contact: \"christian@brauner.io\"\nbuilds_per_day: 4\nsanitizers:\n  - address\n  - undefined\n  - memory\nauto_ccs:\n  - stgraber@stgraber.org\n  - evverx@gmail.com\nmain_repo: \"https://github.com/lxc/lxc\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n  # - centipede\n  # Don't use centipede because it can't handle fuzz targets with \"config\" in\n  # the name.\n"
  },
  {
    "path": "projects/lxml/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth 1 https://github.com/lxml/lxml $SRC/lxml\nRUN apt-get update && apt-get install -y zlib1g-dev make autoconf automake libtool pkg-config rsync\nRUN python3 -m pip install --upgrade pip \\\n    && python3 -m pip install 'setuptools~=69.0' 'pyinstaller~=6.0' -r $SRC/lxml/requirements.txt\n\nRUN git clone --depth 1 https://github.com/DaveLak/oss-fuzz-inputs.git oss-fuzz-inputs \\\n    && rsync -avc oss-fuzz-inputs/lxml/ $SRC/seed_data/ \\\n    && rm -rf oss-fuzz-inputs;\nRUN git clone --depth 1 https://github.com/google/fuzzing fuzzing \\\n    && cat fuzzing/dictionaries/html.dict \\\n        fuzzing/dictionaries/css.dict \\\n        fuzzing/dictionaries/svg.dict \\\n        fuzzing/dictionaries/xml.dict \\\n        fuzzing/dictionaries/rss.dict \\\n        fuzzing/dictionaries/xslt.dict \\\n        fuzzing/dictionaries/xpath.dict \\\n        fuzzing/dictionaries/regexp.dict \\\n      >> $SRC/seed_data/__base.dict \\\n    && rm -rf fuzzing;\n\nCOPY build.sh *.py $SRC/\n\nWORKDIR $SRC/lxml\n"
  },
  {
    "path": "projects/lxml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Flags to link sanitizers at runtime.\n# Anything not forwarded is required by lxml.\nexport CFLAGS=\"$CFLAGS -fPIC\"\nexport CXXFLAGS=\"$CXXFLAGS -fPIC\"\n## Use LD values if already set, (Fuzz Introspector may set them) otherwise use the OSS-Fuzz suggested linker and flags.\n: \"${LD:=${CXX}}\"\n: \"${LDFLAGS:=${CXXFLAGS}}\"\n\nif [[ \"$SANITIZER\" = 'undefined' ]]; then\n  # libiconv-1.17 (a dependency of libxml2) triggers several UBSAN errors similar to:\n  # `utf32le.h:30:59: runtime error: left shift of 225 by 24 places cannot be represented in type 'int'`\n  # Disabling the UBSAN shift check, while not ideal, appears to be the simplest way to avoid hindering the fuzzer\n  # with false positives for now and libxml2 is already being fuzzed independently so there is little value in\n  # checking it here as well.\n  export CFLAGS+=\" -fno-sanitize=shift\"\n  export CXXFLAGS+=\" -fno-sanitize=shift\"\nfi\n# lxml build Settings\nif [[ $SANITIZER = *coverage* ]] || [[ $SANITIZER = 'introspector' ]]; then\n  export COVERAGE=1\n  export OPTION_WITH_COVERAGE=1\nfi\nexport STATICBUILD=1\n\nmake require-cython\nmake clean\nmake SETUPFLAGS='--with-clines --with-unicode-strings' build PYTHON_WITH_CYTHON='--with-cython' -j\"$(nproc)\"\npython3 -m pip install .\n\n# Directory to look in for dictionaries, options files, and seed corpa:\nSEED_DATA_DIR=\"$SRC/seed_data\"\n\nfind $SEED_DATA_DIR \\( -name '*_seed_corpus.zip' -o -name '*.options' -o -name '*.dict' \\) \\\n  ! \\( -name '__base.*' \\) -exec printf 'Copying: %s\\n' {} \\; \\\n  -exec chmod a-x {} \\; \\\n  -exec cp {} \"$OUT\" \\;\n\nfind \"$SRC\" -maxdepth 1 -name 'fuzz_*.py' -print0 | while IFS= read -r -d $'\\0' fuzz_harness; do\n  LD_PRELOAD=$OUT/sanitizer_with_fuzzer.so ASAN_OPTIONS=detect_leaks=0 compile_python_fuzzer \"$fuzz_harness\" \\\n    --collect-all=\"lxml\"\n\n  common_base_dictionary_filename=\"$SEED_DATA_DIR/__base.dict\"\n  if [[ -r \"$common_base_dictionary_filename\" ]]; then\n    # Strip the `.py` extension from the filename and replace it with `.dict`.\n    fuzz_harness_dictionary_filename=\"$(basename \"$fuzz_harness\" .py).dict\"\n    output_file=\"$OUT/$fuzz_harness_dictionary_filename\"\n\n    printf 'Appending %s to %s\\n' \"$common_base_dictionary_filename\" \"$output_file\"\n    # Ensure a newline is added at the end of the file before appending,\n    # but only if the file already exists and is not empty.\n    if [[ -s \"$output_file\" ]]; then\n      echo >> \"$output_file\"\n    fi\n    cat \"$common_base_dictionary_filename\" >> \"$output_file\"\n  fi\ndone\n"
  },
  {
    "path": "projects/lxml/fuzz_html_parse.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nfrom test_utils import is_expected_error\n\nwith atheris.instrument_imports():\n  from lxml import etree\n\n\ndef TestOneInput(data):\n  try:\n    root = etree.HTML(data)\n    etree.tostring(root)\n  except (etree.LxmlError, TypeError, ValueError) as e:\n    expected_error_message_content = [\n        \"C14N\",\n        \"serialisation\",\n        \"cannot be serialized\",\n        \"unicode must not\",\n    ]\n    if isinstance(e, etree.LxmlError) or (\n        isinstance(e, (TypeError, ValueError)) and\n        is_expected_error(expected_error_message_content, e)):\n      # Known exception raised by the source code are not interesting.\n      return -1  # Reject so the input will not be added to the corpus.\n    else:\n      # Unexpected exceptions might be a bug in the source or in our test.\n      raise e  # Alert a human to take a closer look at what caused this.\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/lxml/fuzz_sax.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport io\nfrom test_utils import is_expected_error\n\nwith atheris.instrument_imports():\n  from lxml import sax, etree\n\n\ndef TestOneInput(data):\n  try:\n    f = io.BytesIO(data)\n    parsed = etree.parse(f)\n\n    handler = sax.ElementTreeContentHandler()\n    sax.ElementTreeProducer(parsed, handler).saxify()\n  except (etree.LxmlError, etree.LxmlSyntaxError):\n    return -1  # Reject so the input will not be added to the corpus.\n  except (ValueError, IndexError, AttributeError) as e:\n    if \"lxml.sax.ElementTreeContentHandler.processingInstruction\" in str(e):\n      # This possibility is a bug and tracked here: https://bugs.launchpad.net/lxml/+bug/2011542\n      return 0  # Accept the input in the corpus to enable regression testing when fixed.\n    elif is_expected_error([\"Invalid\", \"has no attribute\"], e):\n      return -1\n    else:\n      raise e\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/lxml/fuzz_schematron.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport io\nfrom test_utils import is_expected_error\n\nwith atheris.instrument_imports():\n  from lxml import etree\n  from lxml.isoschematron import Schematron\n\n\ndef TestOneInput(data):\n  \"\"\"Targets Schematron. Currently validates, but we should add more APIs\"\"\"\n  try:\n    schema_raw = etree.parse(io.BytesIO(data))\n    valid_tree = etree.parse(io.BytesIO(b\"<AAA><BBB/><CCC/></AAA>\"))\n\n    schematron = Schematron(schema_raw)\n    schematron.validate(valid_tree)\n  except etree.LxmlError:\n    return -1  # Reject so the input will not be added to the corpus.\n  except (ValueError, TypeError) as e:\n    if is_expected_error([\"Empty tree\", \"None not allowed as a stylesheet parameter\"], e):\n      return -1\n    else:\n      raise e\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/lxml/fuzz_xml_parse.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from lxml import etree\n\n\ndef TestOneInput(data):\n  tree = None\n  success = False\n  try:\n    root = etree.XML(data)\n    if root != None:\n      etree.indent(root)\n\n      tree = etree.ElementTree(root)\n      success = True\n  except etree.XMLSyntaxError:\n    return -1  # Reject so the input will not be added to the corpus.\n\n  if success:\n    try:\n      a = etree.Element(\"a\")\n      tree.getelementpath(a)\n    except ValueError:\n      return -1  # Reject so the input will not be added to the corpus.\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/lxml/fuzz_xmlschema.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport io\nfrom test_utils import is_expected_error\n\nwith atheris.instrument_imports():\n  from lxml import etree\n\n\ndef TestOneInput(data):\n  \"\"\"Targets XML schema validation. More APIs should be added\"\"\"\n  try:\n    schema_raw = etree.parse(io.BytesIO(data))\n    valid_tree = etree.parse(io.BytesIO(b\"<a><b></b></a>\"))\n\n    schema = etree.XMLSchema(schema_raw)\n    schema.validate(valid_tree)\n  except etree.LxmlError:\n    return -1  # Reject so the input will not be added to the corpus.\n  except (ValueError, TypeError) as e:\n    expected_exceptions = [\n        \"Input object has no document\",\n        \"Invalid input object\",\n    ]\n    if is_expected_error(expected_exceptions, e):\n      return -1\n    else:\n      raise e\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/lxml/fuzz_xslt.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport io\n\nwith atheris.instrument_imports():\n  from lxml import etree\n\n\ndef TestOneInput(data):\n  \"\"\"Targets XSLT. More APIs on the st object should be added\"\"\"\n  try:\n    style = etree.parse(io.BytesIO(data))\n    valid_tree = etree.parse(io.BytesIO(b\"<a><b>B</b><c>C</c></a>\"))\n\n    st = etree.XSLT(style)\n    st(valid_tree)\n  except etree.LxmlError:\n    return -1  # Reject so the input will not be added to the corpus.\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/lxml/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://lxml.de/\nlanguage: python\nmain_repo: https://github.com/lxml/lxml/\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/lxml/test_utils.py",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import List  # pragma: no cover\nimport atheris  # pragma: no cover\n\n\n@atheris.instrument_func\ndef is_expected_error(error_message_list: List[str],\n                      exception: Exception):  # pragma: no cover\n  \"\"\"Checks if the message of a given exception matches any of the expected error messages.\"\"\"\n  for error in error_message_list:\n    if error in str(exception):\n      return True\n  return False\n"
  },
  {
    "path": "projects/lz4/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/lz4/lz4.git /src/lz4\n\nWORKDIR $SRC/lz4\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/lz4/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the OSS-Fuzz script in the project.\n./ossfuzz/ossfuzz.sh\n"
  },
  {
    "path": "projects/lz4/project.yaml",
    "content": "homepage: \"https://github.com/lz4/lz4\"\nlanguage: c++\nprimary_contact: \"Yann.collet.73@gmail.com\"\nauto_ccs:\n  - \"NickRTerrell@gmail.com\"\n  - \"cyan@fb.com\"\n  - \"terrelln@fb.com\"\n  - \"felixh@fb.com\"\n  - \"hmf@fb.com\"\n  - \"yaohway@fb.com\"\n  - \"axxu@fb.com\"\n  - \"embg@fb.com\"\n  - \"yoniko@fb.com\"\n  - \"sangelov@fb.com\"\nvendor_ccs:\n  - \"oss-fuzz@fb.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/lz4/lz4.git'\n"
  },
  {
    "path": "projects/lz4/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nASAN_OPTIONS=detect_leaks=0 make test\n"
  },
  {
    "path": "projects/lz4_flex/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/PSeitz/lz4_flex lz4_flex\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/lz4_flex/build.sh",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Note: This project creates Rust fuzz targets exclusively\ncd $SRC/lz4_flex\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_decomp_corrupt_block $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_decomp_corrupt_frame $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_roundtrip $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_roundtrip_cpp_compress $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_roundtrip_cpp_decompress $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_roundtrip_frame $OUT/\n"
  },
  {
    "path": "projects/lz4_flex/project.yaml",
    "content": "homepage: \"https://github.com/PSeitz/lz4_flex\"\nmain_repo: \"https://github.com/PSeitz/lz4_flex.git\"\nlanguage: rust\nprimary_contact: \"pascal.seitz@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/lzma/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n\nRUN apt-get update && apt-get install -y \\\n\tautoconf \\\n\tautomake \\\n\tlibtool \\\n\tmake\n\nRUN git clone \\\n\t--depth 1 \\\n\t--branch master \\\n\thttps://github.com/fancycode/lzma-fuzz.git \\\n\tlzma-fuzz\n\nWORKDIR lzma-fuzz\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/lzma/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build and install fuzzers\nmake clean\nmake -j$(nproc)\nmake install DEST=$OUT\n"
  },
  {
    "path": "projects/lzma/project.yaml",
    "content": "homepage: \"https://www.7-zip.org/sdk.html\"\nmain_repo: 'https://github.com/fancycode/lzma-fuzz.git'\nlanguage: c++\nprimary_contact: \"ipavlov@users.sourceforge.net\"\nauto_ccs:\n  - \"mail@joachim-bauch.de\"\nsanitizers:\n  - address\n  - memory\n  - undefined\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/lzo/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget\nRUN wget -O lzo.tar.gz \\\n    http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz\nCOPY *.c *.cc *.options build.sh $SRC/\nCOPY lzo_decompress_target_seeds $SRC/lzo_decompress_target_seeds\n"
  },
  {
    "path": "projects/lzo/all_lzo_compress.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <cstdint>\n#include <cstdio>\n#include <cstdlib>\n#include <memory>\n#include <vector>\n\n#include \"lzo1.h\"\n#include \"lzo1a.h\"\n#include \"lzo1b.h\"\n#include \"lzo1c.h\"\n#include \"lzo1f.h\"\n#include \"lzo1x.h\"\n#include \"lzo1y.h\"\n#include \"lzo1z.h\"\n#include \"lzo2a.h\"\n#include \"lzoconf.h\"\n\nnamespace {\n\nstruct LzoAlgorithm {\n  enum class Category { LZO1, LZO2 };\n  enum class Type {\n    LZO1,\n    LZO1A,\n    LZO1B,\n    LZO1C,\n    LZO1F,\n    LZO1X,\n    LZO1Y,\n    LZO1Z,\n    LZO2A\n  };\n\n  constexpr LzoAlgorithm(Category category, Type type, int compression_level,\n                         int memory_level, lzo_compress_t compress_fn,\n                         lzo_decompress_t decompress_fn,\n                         size_t working_memory_size)\n      : category(category),\n        type(type),\n        compression_level(compression_level),\n        memory_level(memory_level),\n        compress_fn(compress_fn),\n        decompress_fn(decompress_fn),\n        working_memory_size(working_memory_size) {}\n\n  size_t GetMaxCompressedSize(size_t size) const {\n    // Formula taken from the LZO FAQ.\n    switch (category) {\n      case Category::LZO1:\n        return size + (size / 16) + 64 + 3;\n      case Category::LZO2:\n        return size + (size / 8) + 128 + 3;\n    }\n  }\n\n  Category category;\n  Type type;\n  int compression_level;\n  int memory_level;\n\n  lzo_compress_t compress_fn;\n  lzo_decompress_t decompress_fn;\n  size_t working_memory_size;\n};\n\nstatic const std::vector<std::vector<LzoAlgorithm>>& GetLzoAlgorithms() {\n  static auto* algorithms = new std::vector<std::vector<LzoAlgorithm>>{\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1,\n                       0, 0, lzo1_compress, lzo1_decompress, LZO1_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1,\n                       99, 0, lzo1_99_compress, lzo1_decompress,\n                       LZO1_99_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1A,\n                       0, 0, lzo1a_compress, lzo1a_decompress,\n                       LZO1A_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1A,\n                       99, 0, lzo1a_99_compress, lzo1a_decompress,\n                       LZO1A_99_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       1, 0, lzo1b_1_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       2, 0, lzo1b_2_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       3, 0, lzo1b_3_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       4, 0, lzo1b_4_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       5, 0, lzo1b_5_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       6, 0, lzo1b_6_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       7, 0, lzo1b_7_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       8, 0, lzo1b_8_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       9, 0, lzo1b_9_compress, lzo1b_decompress,\n                       LZO1B_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       99, 0, lzo1b_99_compress, lzo1b_decompress,\n                       LZO1B_99_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1B,\n                       999, 0, lzo1b_999_compress, lzo1b_decompress,\n                       LZO1B_999_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1C,\n                       1, 0, lzo1c_1_compress, lzo1c_decompress,\n                       LZO1C_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1C,\n                       5, 0, lzo1c_5_compress, lzo1c_decompress,\n                       LZO1C_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1C,\n                       9, 0, lzo1c_9_compress, lzo1c_decompress,\n                       LZO1C_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1C,\n                       99, 0, lzo1c_99_compress, lzo1c_decompress,\n                       LZO1C_99_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1C,\n                       999, 0, lzo1c_999_compress, lzo1c_decompress,\n                       LZO1C_999_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1F,\n                       1, 0, lzo1f_1_compress, lzo1f_decompress,\n                       LZO1F_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1F,\n                       999, 0, lzo1f_999_compress, lzo1f_decompress,\n                       LZO1F_999_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1X,\n                       1, 0, lzo1x_1_compress, lzo1x_decompress,\n                       LZO1X_1_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1X,\n                       1, 11, lzo1x_1_11_compress, lzo1x_decompress,\n                       LZO1X_1_11_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1X,\n                       1, 12, lzo1x_1_12_compress, lzo1x_decompress,\n                       LZO1X_1_12_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1X,\n                       1, 15, lzo1x_1_15_compress, lzo1x_decompress,\n                       LZO1X_1_15_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1X,\n                       999, 0, lzo1x_999_compress, lzo1x_decompress,\n                       LZO1X_999_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1Y,\n                       1, 0, lzo1y_1_compress, lzo1y_decompress,\n                       LZO1Y_MEM_COMPRESS),\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1Y,\n                       999, 0, lzo1y_999_compress, lzo1y_decompress,\n                       LZO1Y_999_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO1, LzoAlgorithm::Type::LZO1Z,\n                       999, 0, lzo1z_999_compress, lzo1z_decompress,\n                       LZO1Z_999_MEM_COMPRESS),\n      },\n      {\n          LzoAlgorithm(LzoAlgorithm::Category::LZO2, LzoAlgorithm::Type::LZO2A,\n                       999, 0, lzo2a_999_compress, lzo2a_decompress,\n                       LZO2A_999_MEM_COMPRESS),\n      },\n  };\n  return *algorithms;\n}\n\nvoid FuzzLzoAlgorithm(const LzoAlgorithm& algorithm,\n                      const std::vector<uint8_t>& input_buffer) {\n  std::unique_ptr<uint8_t[]> working_buffer(\n      new uint8_t[algorithm.working_memory_size]);\n  std::unique_ptr<uint8_t[]> compressed_buffer(\n      new uint8_t[algorithm.GetMaxCompressedSize(input_buffer.size())]);\n\n#if MEMORY_SANITIZER\n  __msan_unpoison(working_buffer.get(), algorithm.working_memory_size);\n#endif\n\n  lzo_uint compressed_size;\n  if (algorithm.compress_fn(input_buffer.data(), input_buffer.size(),\n                            compressed_buffer.get(), &compressed_size,\n                            working_buffer.get()) != LZO_E_OK) {\n    abort();\n  }\n\n  std::unique_ptr<uint8_t[]> decompressed_buffer(\n      new uint8_t[input_buffer.size()]);\n  lzo_uint decompressed_size;\n  if (algorithm.decompress_fn(compressed_buffer.get(), compressed_size,\n                              decompressed_buffer.get(), &decompressed_size,\n                              nullptr) != LZO_E_OK) {\n    abort();\n  }\n\n  if (decompressed_size != input_buffer.size()) {\n    fprintf(stderr, \"Decompressed size %zu does not match original size %zu.\\n\",\n            decompressed_size, input_buffer.size());\n    abort();\n  } else if (memcmp(input_buffer.data(), decompressed_buffer.get(),\n                    input_buffer.size()) != 0) {\n    fprintf(stderr,\n            \"Decompressed buffer does not match original buffer of size %zu.\\n\",\n            input_buffer.size());\n    abort();\n  }\n}\n\n}  // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static bool initialized __attribute__((unused)) = []() {\n    if (lzo_init() != LZO_E_OK) {\n      abort();\n    }\n    return true;\n  }();\n\n  FuzzedDataProvider data_provider(data, size);\n  const auto& algorithms = GetLzoAlgorithms();\n  const auto first_level_index =\n      data_provider.ConsumeIntegralInRange<size_t>(0, algorithms.size() - 1);\n  const auto& algorithm_group = algorithms[first_level_index];\n  const auto second_level_index = data_provider.ConsumeIntegralInRange<size_t>(\n      0, algorithm_group.size() - 1);\n  const std::vector<uint8_t> input_buffer =\n      data_provider.ConsumeRemainingBytes<uint8_t>();\n  FuzzLzoAlgorithm(algorithm_group[second_level_index], input_buffer);\n  return 0;\n}\n"
  },
  {
    "path": "projects/lzo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\ncd $SRC\ntar xzf lzo.tar.gz\ncd lzo-*\n./configure && make -j$(nproc)\n\n# build fuzzers\nfor file in $SRC/*.c;\ndo\n    name=$(basename $file .c)\n    $CC $CFLAGS -c -I include -I minilzo -I include/lzo ${file} -o ${name}.o\n    $CXX $CXXFLAGS -std=c++17 -I include -I minilzo -I include/lzo ${name}.o \\\n        -o $OUT/${name} $LIB_FUZZING_ENGINE src/.libs/liblzo2.a\ndone\n\n$CXX $CXXFLAGS -std=c++17 -I include -I minilzo -I include/lzo \\\n    $SRC/all_lzo_compress.cc \\\n    -o $OUT/all_lzo_compress $LIB_FUZZING_ENGINE src/.libs/liblzo2.a\n\n# copy fuzzer options\ncp $SRC/*.options $OUT/\nzip -j $OUT/lzo_decompress_target_seed_corpus.zip $SRC/lzo_decompress_target_seeds/*\n"
  },
  {
    "path": "projects/lzo/lzo_compress_target.c",
    "content": "/*\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"lzo1x.h\"\n#include \"lzoconf.h\"\n\n/* Work-memory needed for compression. Allocate memory in units\n * of 'lzo_align_t' (instead of 'char') to make sure it is properly aligned.\n */\n#define HEAP_ALLOC(var, size) \\\n  lzo_align_t __LZO_MMODEL    \\\n      var[((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t)]\n\nstatic HEAP_ALLOC(wrkmem, LZO1X_1_MEM_COMPRESS);\n\nextern int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  int r;\n  lzo_uint compressed_len;\n  lzo_uint decompressed_len;\n\n  /* Since we allocate in/out on the stack,\n   * we can't handle too large size.\n   */\n  if (size > (1 << 20)) {\n    size = 1 << 20;\n  }\n\n  /* We want to compress the data block at 'in' with length 'IN_LEN' to\n   * the block at 'out'. Because the input block may be incompressible,\n   * we must provide a little more output space in case that compression\n   * is not possible.\n   */\n  unsigned char* __LZO_MMODEL decompressed = malloc(size + 1);\n  if (!decompressed) {\n    return 0;\n  }\n  unsigned char* __LZO_MMODEL compressed = malloc(size + size / 16 + 64 + 3);\n  if (!compressed) {\n    free(decompressed);\n    return 0;\n  }\n\n  static bool isInit = false;\n  if (!isInit) {\n    if (lzo_init() != LZO_E_OK) {\n#ifdef __DEBUG__\n      printf(\"internal error - lzo_init() failed !!!\\n\");\n#endif\n      free(compressed);\n      free(decompressed);\n      return 0;\n    }\n    isInit = true;\n  }\n\n  /* Compress with LZO1X-1. */\n  r = lzo1x_1_compress(data, size, compressed, &compressed_len, wrkmem);\n  assert(r == LZO_E_OK);\n#ifdef __DEBUG__\n  printf(\"compressed %lu bytes into %lu bytes\\n\", (unsigned long)size,\n         (unsigned long)out_len);\n#endif\n\n  /* check for an incompressible block */\n  if (compressed_len >= size) {\n#ifdef __DEBUG__\n    printf(\"This block contains incompressible data.\\n\");\n#endif\n    free(compressed);\n    free(decompressed);\n    return 0;\n  }\n\n  // Decompress; allow 1 extra byte of output to make sure decoder does not\n  // produce unexpected output.\n  decompressed_len = size + 1;\n  r = lzo1x_decompress(compressed, compressed_len, decompressed,\n                       &decompressed_len, /*wrkmem=*/NULL);\n  assert(r == LZO_E_OK && decompressed_len == size);\n#ifdef __DEBUG__\n  printf(\"decompressed %lu bytes back into %lu bytes\\n\", (unsigned long)out_len,\n         (unsigned long)size);\n#endif\n  free(compressed);\n  free(decompressed);\n  return 0;\n}\n"
  },
  {
    "path": "projects/lzo/lzo_compress_target.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\n"
  },
  {
    "path": "projects/lzo/lzo_decompress_target.c",
    "content": "/*\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"lzo1b.h\"\n#include \"lzo1c.h\"\n#include \"lzo1f.h\"\n#include \"lzo1x.h\"\n#include \"lzo1y.h\"\n#include \"lzo1z.h\"\n#include \"lzo2a.h\"\n#include \"lzoconf.h\"\n\ntypedef int (*decompress_function)(const lzo_bytep, lzo_uint, lzo_bytep,\n                                   lzo_uintp, lzo_voidp);\n\n#define NUM_DECOMP 7\n\nstatic decompress_function funcArr[NUM_DECOMP] = {\n    &lzo1b_decompress_safe, &lzo1c_decompress_safe, &lzo1f_decompress_safe,\n    &lzo1x_decompress_safe, &lzo1y_decompress_safe, &lzo1z_decompress_safe,\n    &lzo2a_decompress_safe};\n\n/* lzo (de)compresses data in blocks. Block size is the\n * size of one such block. This size has a default value of 256KB.\n */\nstatic const size_t kBufSize = 256 * 1024L;\n\nextern int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  int r;\n  lzo_uint new_len;\n  if (size < 1) {\n    return 0;\n  }\n  /* Buffer into which compressed data provided by the fuzzer\n   * is going to be decompressed. The buffer size is chosen\n   * to be equal to the default block size (256KB) for\n   * (de)compression.\n   */\n  unsigned char* __LZO_MMODEL buf = malloc(kBufSize);\n  if (!buf) {\n    // OOM here is out of scope.\n    return 0;\n  }\n\n  static bool isInit = false;\n  if (!isInit) {\n    if (lzo_init() != LZO_E_OK) {\n#ifdef __DEBUG__\n      printf(\"internal error - lzo_init() failed !!!\\n\");\n#endif\n      free(buf);\n      return 0;\n    }\n    isInit = true;\n  }\n\n  // Decompress.\n  int idx = size % NUM_DECOMP;\n  new_len = kBufSize;\n  // Work memory not necessary for decompression\n  r = (*funcArr[idx])(data, size, buf, &new_len, /*wrkmem=*/NULL);\n#ifdef __DEBUG__\n  if (r != LZO_E_OK) {\n    printf(\"error thrown by lzo1x_decompress_safe: %d\\n\", r);\n  }\n  printf(\"decompressed %lu bytes back into %lu bytes\\n\", (unsigned long)size,\n         (unsigned long)new_len);\n#endif\n  free(buf);\n  return 0;\n}\n"
  },
  {
    "path": "projects/lzo/lzo_decompress_target.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\n"
  },
  {
    "path": "projects/lzo/project.yaml",
    "content": "homepage: \"http://www.oberhumer.com\"\nlanguage: c++\nprimary_contact: \"info@oberhumer.com\"\nauto_ccs:\n  - \"bshas3@gmail.com\"\nsanitizers:\n  - address\n  - memory\narchitectures:\n  - x86_64\n  - i386\n"
  },
  {
    "path": "projects/magic-enum/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y ninja-build pkg-config\nRUN python3 -m pip install meson\nRUN git clone https://github.com/Neargye/magic_enum\nCOPY run_tests.sh build.sh *_fuzzer.cc $SRC/\nWORKDIR $SRC/magic_enum\n"
  },
  {
    "path": "projects/magic-enum/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$CXX $CXXFLAGS -std=c++17 -I$SRC/magic_enum/include/magic_enum  \\\n    $SRC/magic_enum_fuzzer.cc -o $OUT/magic_enum_fuzzer \\\n    $LIB_FUZZING_ENGINE -lpthread\n\n# Setup meson build\nmeson setup build-tests\n"
  },
  {
    "path": "projects/magic-enum/magic_enum_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <fuzzer/FuzzedDataProvider.h>\n#include <iostream>\n#include <magic_enum.hpp>\n#include <magic_enum_containers.hpp>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  const char *fuzz_enum_key1 = fdp.ConsumeRandomLengthString().c_str();\n  const char *fuzz_enum_key2 = fdp.ConsumeRandomLengthString().c_str();\n  const char *fuzz_enum_key3 = fdp.ConsumeRandomLengthString().c_str();\n  const char *fuzz_enum_key4 = fdp.ConsumeRandomLengthString().c_str();\n  const char *fuzz_enum_key5 = fdp.ConsumeRandomLengthString().c_str();\n  const char *fuzz_enum_key6 = fdp.ConsumeRandomLengthString().c_str();\n  const char *fuzz_enum_key7 = fdp.ConsumeRandomLengthString().c_str();\n  enum class FuzzEnum : int {\n    fuzz_enum_key1 = -5,\n    fuzz_enum_key2 = 0,\n    fuzz_enum_key3 = 10,\n    fuzz_enum_key4 = 11,\n    fuzz_enum_key5 = 12,\n    fuzz_enum_key6 = 13,\n    fuzz_enum_key7 = 14,\n  };\n  constexpr auto &s7 = magic_enum::enum_values<const FuzzEnum>();\n\n  auto c1 = magic_enum::enum_cast<FuzzEnum>(fdp.ConsumeIntegral<int>());\n  auto c2 = magic_enum::enum_cast<FuzzEnum>(fdp.ConsumeRandomLengthString());\n  auto c3 = magic_enum::enum_entries<FuzzEnum>();\n  auto c4 = magic_enum::enum_values<FuzzEnum>();\n  auto c5 = magic_enum::enum_contains<FuzzEnum>(fdp.ConsumeIntegral<int>());\n  auto c6 = magic_enum::enum_contains<FuzzEnum>(fdp.ConsumeIntegral<int>());\n  auto c7 = magic_enum::enum_names<FuzzEnum>();\n  auto c8 = magic_enum::is_unscoped_enum<FuzzEnum>::value;\n  auto c9 = magic_enum::is_scoped_enum<FuzzEnum>::value;\n  auto c10 =\n      magic_enum::enum_cast<FuzzEnum>(fdp.ConsumeRandomLengthString().c_str());\n  auto c11 = magic_enum::enum_cast<FuzzEnum>(fdp.ConsumeRandomLengthString());\n\n  auto e_count = magic_enum::enum_count<FuzzEnum>();\n\n  magic_enum::containers::set e_set{FuzzEnum::fuzz_enum_key1, FuzzEnum::fuzz_enum_key2};\n  auto s1 = e_set.empty();\n  auto s2 = e_set.size();\n  e_set.insert(FuzzEnum::fuzz_enum_key3);\n  e_set.clear();\n\n  auto e_bitset = magic_enum::containers::bitset<FuzzEnum>();\n  e_bitset.set(FuzzEnum::fuzz_enum_key3);\n  auto b0 = e_bitset.size();\n  auto b1 = e_bitset.all();\n  auto b2 = e_bitset.any();\n  auto b3 = e_bitset.none();\n  auto b4 = e_bitset.count();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/magic-enum/project.yaml",
    "content": "homepage: \"https://github.com/Neargye/magic_enum\"\nlanguage: c++\nmain_repo: \"https://github.com/Neargye/magic_enum.git\"\nvendor_ccs:\n- david@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/magic-enum/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmeson test -C $SRC/magic_enum/build-tests -j$(nproc)\n"
  },
  {
    "path": "projects/magic-modules/project.yaml",
    "content": "homepage: https://github.com/GoogleCloudPlatform/magic-modules\nmain_repo: https://github.com/GoogleCloudPlatform/magic-modules\nlanguage: go\nprimary_contact: \"stephenrlewis@google.com\"\n"
  },
  {
    "path": "projects/mako/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/sqlalchemy/mako\nWORKDIR mako\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/mako/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/mako/fuzz_lexer.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom mako import exceptions\nfrom mako.lexer import Lexer\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        Lexer(fdp.ConsumeUnicodeNoSurrogates(1024)).parse()\n    except exceptions.MakoException:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/mako/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/sqlalchemy/mako\nlanguage: python\nmain_repo: https://github.com/sqlalchemy/mako\nprimary_contact: mike_mp@zzzcomputing.com\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/mandelbulber/project.yaml",
    "content": "homepage: \"https://github.com/buddhi1980/mandelbulber2/\"\nmain_repo: \"https://github.com/buddhi1980/mandelbulber2/\"\nprimary_contact: \"robertpancoast77@gmail.com\"\nauto_ccs:\n - \"buddhi1980@gmail.com\"\n - \"sebastian.jennen@gmx.de\"\nsanitizers:\n- address\n- undefined\n- memory\n"
  },
  {
    "path": "projects/mapserver/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake zlib1g-dev libpng-dev libjpeg-dev libfreetype-dev libproj-dev libxml2-dev\nRUN git clone --depth 1 https://github.com/OSGeo/gdal\nRUN git clone --depth 1 https://github.com/MapServer/MapServer\nRUN cp MapServer/fuzzers/build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/mapserver/project.yaml",
    "content": "homepage: \"https://mapserver.org\"\nlanguage: c++\nprimary_contact: \"mapserver-security@osgeo.org\"\nvendor_ccs:\n  - \"geographika@gmail.com\"\n  - \"jmckenna@gatewaygeomatics.com\"\n  - \"even.rouault@gmail.com\"\n  - \"sdlime@gmail.com\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nmain_repo: 'https://github.com/MapServer/MapServer'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/mariadb/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get install -y build-essential libncurses5-dev gnutls-dev bison zlib1g-dev ccache\nRUN git clone --depth=1 https://github.com/MariaDB/server\nWORKDIR server\nCOPY build.sh *.c $SRC/\n"
  },
  {
    "path": "projects/mariadb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmkdir build\ncd build\ncmake ../ -DDISABLE_SHARED=ON -LH\nmake clean\n\n# Ensure we do static linking\nsed -i 's/libmariadb SHARED/libmariadb STATIC/g' ../libmariadb/libmariadb/CMakeLists.txt\nmake\nrm CMakeCache.txt\n\n# Build fuzzers\nINCLUDE_DIRS=\"-I/src/server/wsrep-lib/include -I/src/server/wsrep-lib/wsrep-API/v26 -I/src/server/build/include -I/src/server/include/providers -I/src/server/include -I/src/server/sql -I/src/server/regex -I/src/server/unittest/mytap\"\n$CC $CFLAGS $INCLUDE_DIRS -c $SRC/fuzz_json.c -o ./fuzz_json.o\n\n# Link with CXX to support centipede\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_json.o -o $OUT/fuzz_json \\\n\t-Wl,--start-group ./unittest/mytap/libmytap.a ./strings/libstrings.a \\\n\t./dbug/libdbug.a ./mysys/libmysys.a -Wl,--end-group -lz -ldl -lpthread\n"
  },
  {
    "path": "projects/mariadb/fuzz_json.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include <tap.h>\n#include <my_sys.h>\n#include <json_lib.h>\n\n#define FUZZ_KEY_SIZE 32\n\nvoid fuzz_get_object_get(const uint8_t *data, size_t size) {\n  if (size < FUZZ_KEY_SIZE) {\n    return;\n  }\n  char *fuzz_key = malloc(FUZZ_KEY_SIZE + 1);\n  memcpy(fuzz_key, data, FUZZ_KEY_SIZE);\n  fuzz_key[FUZZ_KEY_SIZE] = '\\0';\n\n  data += FUZZ_KEY_SIZE;\n  size -= FUZZ_KEY_SIZE;\n\n  char *fuzz_str = malloc(size + 1);\n  memcpy(fuzz_str, data, size);\n  fuzz_str[size] = '\\0';\n\n  const char *value_start;\n  int value_len;\n\n  json_get_object_key(fuzz_str, fuzz_str + size, fuzz_key, &value_start,\n                      &value_len);\n\n  free(fuzz_str);\n  free(fuzz_key);\n}\n\nvoid fuzz_json_locate_key(const uint8_t *data, size_t size) {\n  if (size < FUZZ_KEY_SIZE) {\n    return;\n  }\n  char *fuzz_key = malloc(FUZZ_KEY_SIZE + 1);\n  memcpy(fuzz_key, data, FUZZ_KEY_SIZE);\n  fuzz_key[FUZZ_KEY_SIZE] = '\\0';\n\n  data += FUZZ_KEY_SIZE;\n  size -= FUZZ_KEY_SIZE;\n\n  char *fuzz_str = malloc(size + 1);\n  memcpy(fuzz_str, data, size);\n  fuzz_str[size] = '\\0';\n\n  const char *key_start;\n  const char *key_end;\n  int comma_pos;\n\n  json_locate_key(fuzz_str, fuzz_str + size, fuzz_key, &key_start, &key_end,\n                  &comma_pos);\n\n  free(fuzz_str);\n  free(fuzz_key);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fuzz_get_object_get(data, size);\n  fuzz_json_locate_key(data, size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/mariadb/project.yaml",
    "content": "homepage: \"https://mariadb.org/\"\nmain_repo: 'https://github.com/MariaDB/server'\nlanguage: c++\nvendor_ccs:\n- \"david@adalogics.com\"\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/mariadb-connector-j/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/mariadb-corporation/mariadb-connector-j mariadb-connector-j\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/mariadb-connector-j\n"
  },
  {
    "path": "projects/mariadb-connector-j/MariaDbPoolDataSourceFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.sql.SQLException;\nimport org.mariadb.jdbc.MariaDbPoolDataSource;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-11\n// Heuristic name: jvm-autofuzz-heuristics-11\n// Target method: [org.mariadb.jdbc.MariaDbPoolDataSource] public  <init>(java.lang.String) throws java.sql.SQLException\n// Target method: [org.mariadb.jdbc.MariaDbPoolDataSource] public getConnection(java.lang.String,java.lang.String) throws java.sql.SQLException\n// Target method: [org.mariadb.jdbc.MariaDbPoolDataSource] public getXAConnection(java.lang.String,java.lang.String) throws java.sql.SQLException\n// Target method: [org.mariadb.jdbc.MariaDbPoolDataSource] public getPooledConnection(java.lang.String,java.lang.String) throws java.sql.SQLException\npublic class MariaDbPoolDataSourceFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      String p1 = data.consumeString(100);\n      String p2 = data.consumeString(100);\n      Integer choice = data.consumeInt(1, 3);\n      MariaDbPoolDataSource obj = new MariaDbPoolDataSource(data.consumeRemainingAsString());\n\n      switch (choice) {\n        case 1:\n          obj.getConnection(p1, p2);\n          break;\n        case 2:\n          obj.getXAConnection(p1, p2);\n          break;\n        case 3:\n          obj.getPooledConnection(p1, p2);\n          break;\n      }\n    } catch (SQLException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/mariadb-connector-j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./target/mariadb-java-client-$CURRENT_VERSION.jar\" $OUT/mariadb.jar\n\nALL_JARS='mariadb.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/mariadb-connector-j/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/mariadb-corporation/mariadb-connector-j\nmain_repo: https://github.com/mariadb-corporation/mariadb-connector-j\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/markdown-it-py/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/executablebooks/markdown-it-py markdown-it-py\nCOPY *.sh $SRC/\nWORKDIR $SRC/markdown-it-py\n"
  },
  {
    "path": "projects/markdown-it-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/markdown-it-py/project.yaml",
    "content": "homepage: https://github.com/executablebooks/markdown-it-py\nmain_repo: https://github.com/executablebooks/markdown-it-py\nprimary_contact: \"sewelljohnchris@gmail.com\"\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nauto_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/markupsafe/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/pallets/markupsafe markupsafe\nRUN python3 -m pip install --upgrade pip\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/markupsafe\n"
  },
  {
    "path": "projects/markupsafe/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/markupsafe/fuzz_encoding.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport markupsafe\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  markupsafe.escape(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 2048)))\n  s1 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 2048))\n  M1 = markupsafe.Markup(s1)\n  M1.unescape()\n  M1.striptags()\n  try:\n    M1.format(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 100)))\n  except (ValueError, KeyError, AttributeError, TypeError, IndexError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/markupsafe/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pallets/markupsafe\nlanguage: python\nmain_repo: https://github.com/pallets/markupsafe\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/matio/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool-bin cmake\nRUN git clone --depth 1 https://github.com/madler/zlib.git zlib\n\nRUN git clone --depth 1 https://github.com/tbeu/matio.git matio\nRUN git clone --depth 1 --branch hdf5_2_0_0 https://github.com/HDFGroup/hdf5.git hdf5\nWORKDIR matio\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/matio/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./ossfuzz/build.sh\n"
  },
  {
    "path": "projects/matio/project.yaml",
    "content": "homepage: \"https://github.com/tbeu/matio\"\nlanguage: c++\nprimary_contact: \"t-beu@users.sourceforge.net\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/tbeu/matio'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/matplotlib/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n# Ensure we work from right python version\nRUN apt-get install -y python3.9 python3.9-dev && \\\n    ln --force -s /usr/bin/python3.9 /usr/local/bin/python3 && \\\n    apt-get install -y python3-pip && \\\n    python3 -m pip install cython \"atheris>=2.1.1\" \"pyinstaller==5.0.1\" \"coverage==6.3.2\"\nRUN python3 -m pip install --upgrade pip setuptools\nRUN python3 -m pip install meson ninja numpy pybind11 cython pythran setuptools setuptools_scm\nRUN git clone --depth 1 https://github.com/matplotlib/matplotlib matplotlib\nWORKDIR matplotlib\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/matplotlib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build without lto\nexport CFLAGS=\"${CFLAGS} -fno-lto\"\nexport CXXFLAGS=\"${CXXFLAGS} -fno-lto\"\nexport CPPFLAGS=\"${CXXFLAGS} -fno-lto\"\npython3 -m pip install -e .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  LD_PRELOAD=$OUT/sanitizer_with_fuzzer.so ASAN_OPTIONS=detect_leaks=0  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/matplotlib/fuzz_plt.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets pyplot. Both native and python code\"\"\"\n\nimport os\nimport sys\nimport atheris\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    \n    data = list()\n    for i in range(16):\n        data.append((fdp.ConsumeIntInRange(0,4000), fdp.ConsumeIntInRange(0,4000)))\n\n    dim = len(data[0])\n    w = 0.75\n    dimw = w / dim\n\n    fig, ax = plt.subplots()\n    x = np.arange(len(data))\n    for i in range(len(data[0])):\n        y = [d[i] for d in data]\n        b = ax.bar(x + i * dimw, y, dimw, bottom=0.001)\n\n    ax.set_xticks(x + dimw / 2, labels=map(str, x))\n    ax.set_yscale('log')\n    ax.set_xlabel(fdp.ConsumeUnicodeNoSurrogates(64))\n    ax.set_ylabel(fdp.ConsumeUnicodeNoSurrogates(64))\n    plt.savefig(\"fuzz_fig.png\")\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/matplotlib/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/matplotlib/matplotlib\nlanguage: python\nmain_repo: https://github.com/matplotlib/matplotlib\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/maven/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.9.11 && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven-3.9.11/apache-maven-3.9.11/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/apache/maven.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/maven\n"
  },
  {
    "path": "projects/maven/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-DskipTests -Drat.ignoreErrors=true\"\nALL_JARS=\"\"\n\n# install the build servers' jazzer-api into the maven repository\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/maven\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -DmavenVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/maven-fuzzer-${CURRENT_VERSION}.jar ${OUT}/maven-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} maven-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n  stripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n  # the .java was stripped by sed\n  if (echo ${stripped_path} | grep \".java$\"); then\n\tcontinue;\n  fi\n\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  fuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n  chmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/maven/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>maven-fuzzer</artifactId>\n\t<version>${mavenVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<exec.mainClass>ossfuzz.MavenPluginFuzzer</exec.mainClass>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\ton the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\tto avoid mismatching driver/api versions\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.maven</groupId>\n\t\t\t<artifactId>maven-core</artifactId>\n\t\t\t<version>${mavenVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.apache.maven</groupId>\n\t\t\t<artifactId>maven-plugin-api</artifactId>\n\t\t\t<version>${mavenVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/maven/project.yaml",
    "content": "homepage: \"https://maven.apache.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/maven.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/maven/src/main/java/ossfuzz/MojoDescriptorFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.maven.plugin.descriptor.MojoDescriptor;\nimport org.apache.maven.plugin.descriptor.Parameter;\nimport org.apache.maven.plugin.descriptor.PluginDescriptor;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.maven.plugin.descriptor.DuplicateParameterException;\n\npublic class MojoDescriptorFuzzer {\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tMojoDescriptor mojoDescriptor = new MojoDescriptor();\n\t\tList<Parameter> listParameters = new ArrayList<Parameter>();\n\t\tint n = fuzzedDataProvider.consumeInt(1, 100);\n\t\tfor (int i = 0; i <= n; i++) {\n\t\t\tParameter param1 = new Parameter();\n\t\t\tparam1.setName(fuzzedDataProvider.consumeString(10));\n\t\t\tparam1.setDefaultValue(fuzzedDataProvider.consumeString(10));\n\t\t\tlistParameters.add(param1);\n\t\t}\n\t\ttry {\n\t\t\tmojoDescriptor.setParameters(listParameters);\n\t\t} catch (DuplicateParameterException e) {\n\t\t}\n\n\t\tmojoDescriptor.setPluginDescriptor(new PluginDescriptor());\n\t\tmojoDescriptor.getComponentType();\n\t\tmojoDescriptor.getLanguage();\n\t\tmojoDescriptor.setLanguage(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getDeprecated();\n\t\tmojoDescriptor.setDeprecated(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.setDependencyCollectionRequired(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getDependencyCollectionRequired();\n\t\tmojoDescriptor.setProjectRequired(fuzzedDataProvider.consumeBoolean());\n\t\tmojoDescriptor.isProjectRequired();\n\t\tmojoDescriptor.setOnlineRequired(fuzzedDataProvider.consumeBoolean());\n\t\tmojoDescriptor.isOnlineRequired();\n\t\tmojoDescriptor.requiresOnline();\n\t\tmojoDescriptor.setPhase(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getPhase();\n\t\tmojoDescriptor.setSince(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getSince();\n\t\tmojoDescriptor.setGoal(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getGoal();\n\t\tmojoDescriptor.setExecutePhase(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getExecutePhase();\n\t\tmojoDescriptor.alwaysExecute();\n\t\tmojoDescriptor.setExecutionStrategy(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getExecutionStrategy();\n\t\tmojoDescriptor.getRole();\n\t\tmojoDescriptor.getRoleHint();\n\t\tmojoDescriptor.getId();\n\t\tmojoDescriptor.getFullGoalName();\n\t\tmojoDescriptor.getComponentType();\n\t\tmojoDescriptor.getPluginDescriptor();\n\t\tmojoDescriptor.setInheritedByDefault(fuzzedDataProvider.consumeBoolean());\n\t\tmojoDescriptor.isInheritedByDefault();\n\t\tmojoDescriptor.hashCode();\n\t\tmojoDescriptor.setExecuteLifecycle(fuzzedDataProvider.consumeString(10));\n\t\tmojoDescriptor.getExecuteLifecycle();\n\t\tmojoDescriptor.setAggregator(fuzzedDataProvider.consumeBoolean());\n\t\tmojoDescriptor.isAggregator();\n\t\tmojoDescriptor.setDirectInvocationOnly(fuzzedDataProvider.consumeBoolean());\n\t\tmojoDescriptor.isDirectInvocationOnly();\n\t\tmojoDescriptor.setRequiresReports(fuzzedDataProvider.consumeBoolean());\n\t\tmojoDescriptor.isRequiresReports();\n\t\tmojoDescriptor.setExecuteGoal(fuzzedDataProvider.consumeRemainingAsString());\n\t\tmojoDescriptor.getExecuteGoal();\n\t\tmojoDescriptor.setThreadSafe(fuzzedDataProvider.consumeBoolean());\n\t\tmojoDescriptor.isThreadSafe();\n\t\tmojoDescriptor.isForking();\n\t\tmojoDescriptor.getParameters();\n\t}\n}"
  },
  {
    "path": "projects/maven/src/main/java/ossfuzz/ProjectArtifactMetadataFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n// Commented out as it seems absent in the latest repository\n// import org.apache.maven.project.artifact.ProjectArtifactMetadata;\nimport org.apache.maven.artifact.Artifact;\nimport org.apache.maven.artifact.DefaultArtifact;\nimport org.apache.maven.artifact.InvalidArtifactRTException;\nimport org.apache.maven.artifact.handler.DefaultArtifactHandler;\n\nimport java.util.ArrayList;\n\npublic class ProjectArtifactMetadataFuzzer {\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tArtifact a;\n\t\ttry {\n\t\t\ta = new DefaultArtifact(\n\t\t\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\t\t\tnew DefaultArtifactHandler(fuzzedDataProvider.consumeString(10)));\n\t\t} catch (IllegalArgumentException e) {\n\t\t\treturn;\n\t\t} catch (InvalidArtifactRTException e) {\n\t\t\treturn;\n\t\t}\n\n\t\t// ProjectArtifactMetadata projectArtifactMetadata = new ProjectArtifactMetadata(a);\n\n\t\ta.getVersion();\n\t\ttry {\n\t\t\ta.setVersion(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ta.getScope();\n\t\ta.getType();\n\t\ta.getClassifier();\n\t\ta.hasClassifier();\n\t\ttry {\n\t\t\ta.setBaseVersion(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ta.getDependencyConflictId();\n\t\ta.getMetadataList();\n\t\ta.getRepository();\n\t\ta.getDownloadUrl();\n\t\ttry {\n\t\t\ta.setDownloadUrl(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ta.getDependencyFilter();\n\t\ta.getArtifactHandler();\n\t\ttry {\n\t\t\ta.setDependencyTrail(new ArrayList<String>() {\n\n\t\t\t\t{\n\t\t\t\t\tadd(fuzzedDataProvider.consumeString(10));\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\ta.setScope(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ta.getVersionRange();\n\t\ttry {\n\t\t\ta.selectVersion(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\ta.setGroupId(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ttry {\n\t\t\ta.setArtifactId(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ta.isSnapshot();\n\t\n   // properly closing off the class\n   }\n}"
  },
  {
    "path": "projects/maven-model/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.5/bin/mvn\n\nRUN git clone --depth 1 https://github.com/apache/maven maven-model\nWORKDIR maven-model\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/maven-model/Xpp3ReaderFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.ByteArrayInputStream;\nimport org.apache.maven.model.io.xpp3.MavenXpp3Reader;\nimport org.apache.maven.model.Model;\n\npublic class Xpp3ReaderFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try{\n            ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n            Model model = new MavenXpp3Reader().read(bais);\n        }\n        catch (java.io.IOException e) {}\n        catch (org.codehaus.plexus.util.xml.pull.XmlPullParserException e) {}\n    }\n}"
  },
  {
    "path": "projects/maven-model/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Denforcer.skip=true -Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True -DbannedDependencies.includes.include=org.apache.maven:maven-embedder:jar:4.0.0-alpha-13-SNAPSHOT\"\n$MVN clean package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind . -name \"maven-model-$CURRENT_VERSION.jar\" -exec mv {} $OUT/maven-model.jar \\;\n\nALL_JARS=\"maven-model.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/maven-model/project.yaml",
    "content": "homepage: \"https://github.com/apache/maven\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/apache/maven.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/mbedtls/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN apt-get update && apt-get install -y \\\n    python-all-dev \\\n    python3-all-dev \\\n    python3-pip\n# mbedtls needs jsonschema which needs rpds-py which needs pip>=20\n# or a Rust toolchain.\nRUN pip3 install 'pip>=20'\n\nRUN git clone --recursive --depth 1 -b mbedtls-3.6 https://github.com/Mbed-TLS/mbedtls.git mbedtls\nRUN pip3 install -r $SRC/mbedtls/scripts/basic.requirements.txt\n\nRUN git clone --depth 1 https://github.com/google/boringssl.git boringssl\nRUN git clone --depth 1 https://github.com/openssl/openssl.git openssl && \\\n    cd openssl && \\\n    git submodule update --init fuzz/corpora\nWORKDIR mbedtls\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/mbedtls/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project (default configuration + experimental features)\nscripts/config.py full\n# Allow repeatability of time-based calculations.\nscripts/config.py set MBEDTLS_PLATFORM_TIME_ALT\n# MBEDTLS_USE_PSA_CRYPTO significantly changes how X.509 and TLS work.\n# In this build, use the default setting.\nscripts/config.py unset MBEDTLS_USE_PSA_CRYPTO\nmkdir build\ncd build\ncmake -DENABLE_TESTING=ON ..\n# build including fuzzers\nmake -j$(nproc) all\ncp programs/fuzz/fuzz_* $OUT/\ncd ..\n\n# build corpuses\ncd programs\ncp -r ../../openssl/fuzz/corpora/crl fuzz/corpuses/\ncp -r ../../openssl/fuzz/corpora/x509 fuzz/corpuses/\ncp -r ../../boringssl/fuzz/privkey_corpus fuzz/corpuses/\ncp ../../boringssl/fuzz/cert_corpus/* fuzz/corpuses/x509/\nzip -r fuzz/fuzz_x509crl_seed_corpus.zip ../framework/data_files/crl* fuzz/corpuses/crl\nzip -r fuzz/fuzz_x509crt_seed_corpus.zip ../framework/data_files/*.crt ../framework/data_files/dir*/*.crt  fuzz/corpuses/x509/\nzip -r fuzz/fuzz_x509csr_seed_corpus.zip ../framework/data_files/*.csr ../framework/data_files/*.req.*\nzip -r fuzz/fuzz_privkey_seed_corpus.zip ../framework/data_files/*.key ../framework/data_files/*.pem fuzz/corpuses/privkey_corpus\nzip -r fuzz/fuzz_pubkey_seed_corpus.zip ../framework/data_files/*.pub ../framework/data_files/*.pubkey\nzip -r fuzz/fuzz_dtlsclient_seed_corpus.zip fuzz/corpuses/dtlsclient\nzip -r fuzz/fuzz_dtlsserver_seed_corpus.zip fuzz/corpuses/dtlsserver\nzip -r fuzz/fuzz_client_seed_corpus.zip fuzz/corpuses/client\nzip -r fuzz/fuzz_server_seed_corpus.zip fuzz/corpuses/server\ncd fuzz\n# export other associated stuff\ncp *.options $OUT/\ncp fuzz_*_seed_corpus.zip $OUT/\ncd ../..\n\n# build project (some non-default compile-time settings)\nscripts/config.py full\n# Allow repeatability of time-based calculations.\nscripts/config.py set MBEDTLS_PLATFORM_TIME_ALT\n# Toggle some options that affect how some parts of the library work.\nscripts/config.py set MBEDTLS_USE_PSA_CRYPTO\nscripts/config.py set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED\nscripts/config.py set MBEDTLS_RSA_NO_CRT\nmkdir build-usepsa\ncd build-usepsa\ncmake -DENABLE_TESTING=OFF ..\n# just build the fuzzers\nmake -j$(nproc) -C programs/fuzz\ncd programs/fuzz\nfor x in fuzz_*; do\n  cp $x $OUT/usepsa-$x\n  # use the same ancilliary data as the default-build executables\n  if [ -e $OUT/${x}_seed_corpus.zip ]; then\n    ln -s ${x}_seed_corpus.zip $OUT/usepsa-${x}_seed_corpus.zip\n  fi\n  if [ -e $OUT/${x}.options ]; then\n    ln -s ${x}.options $OUT/usepsa-${x}.options\n  fi\ndone\ncd ../..\ncd ..\n"
  },
  {
    "path": "projects/mbedtls/project.yaml",
    "content": "homepage: \"https://developer.trustedfirmware.org/w/mbed-tls/\"\nlanguage: c++\nprimary_contact: \"mbed-tls-security@lists.trustedfirmware.org\"\nauto_ccs :\n  - \"p.antoine@catenacyber.fr\"\nmain_repo: 'https://github.com/Mbed-TLS/mbedtls.git'\n"
  },
  {
    "path": "projects/mbedtls/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npushd $SRC/mbedtls\n  make check\npopd\n"
  },
  {
    "path": "projects/mccabe/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/pycqa/mccabe mccabe\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/mccabe\n"
  },
  {
    "path": "projects/mccabe/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/mccabe/fuzz_get_code_complexity.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-2\n# Imports by the generated code\nfrom mccabe import get_code_complexity as fuzz_target\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  code = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  fuzz_target(code)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/mccabe/project.yaml",
    "content": "homepage: https://github.com/pycqa/mccabe\nmain_repo: https://github.com/pycqa/mccabe\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/md4c/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone https://github.com/mity/md4c\n\n# Dictionaries:\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/markdown.dict $SRC/fuzz-mdhtml.dict && \\\n    rm -rf fuzzing\n\n# Seed corpus:\nRUN zip -j $SRC/fuzz-mdhtml_seed_corpus.zip $SRC/md4c/test/fuzzers/seed-corpus/*\n\nWORKDIR $SRC/md4c\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/md4c/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\nmkdir build && cd build\ncmake ../ -DBUILD_SHARED_LIBS=OFF\nmake\n$CC $CFLAGS -c ../test/fuzzers/fuzz-mdhtml.c -I../src\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz-mdhtml.o -o $OUT/fuzz-mdhtml \\\n    ./src/libmd4c-html.a ./src/libmd4c.a\n"
  },
  {
    "path": "projects/md4c/project.yaml",
    "content": "homepage: \"https://github.com/mity/md4c\"\nmain_repo: \"https://github.com/mity/md4c\"\nprimary_contact: \"mity.ossfuzz@gmail.com\"\nlanguage: c\nfile_github_issue: true\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/md4c/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfor SPEC in `ls test/spec*`\ndo\n  python3 test/run-testsuite.py -p build/md2html/md2html -s $SPEC\ndone\n"
  },
  {
    "path": "projects/mdbook-i18n-helpers/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/google/mdbook-i18n-helpers.git\n\n# See https://github.com/serde-rs/serde/issues/2770#issuecomment-2212162225\nENV RUSTUP_TOOLCHAIN nightly-2024-07-07\nWORKDIR mdbook-i18n-helpers\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mdbook-i18n-helpers/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/mdbook-i18n-helpers\n\nfuzzer_list=$(cargo fuzz list)\n\n# Validate fuzzers exist in the project\nif [[ -z \"$fuzzer_list\" ]]; then\n    echo \"No fuzzers found\"\n    exit 1\nfi\n\n# Build fuzzers\ncargo fuzz build -O --debug-assertions\n\nFUZZ_TARGET_OUTPUT_DIR=target/x86_64-unknown-linux-gnu/release\nwhile IFS= read -r fuzzer; do\n  cp \"$FUZZ_TARGET_OUTPUT_DIR/$fuzzer\" $OUT/\ndone <<< \"$fuzzer_list\"\n"
  },
  {
    "path": "projects/mdbook-i18n-helpers/project.yaml",
    "content": "homepage: \"https://github.com/google/mdbook-i18n-helpers\"\nmain_repo: \"https://github.com/google/mdbook-i18n-helpers.git\"\nlanguage: rust\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nprimary_contact: \"mgeisler@google.com\"\nauto_ccs:\n  - \"comprehensive-rust@google.com\"\n  - \"darkhanu@gmail.com\"\n"
  },
  {
    "path": "projects/mdbtools/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf autoconf-archive automake gettext libtool pkg-config\n\nRUN git clone --depth 1 --branch master https://github.com/mdbtools/mdbtools mdbtools\nRUN git clone --depth 1 https://github.com/mdbtools/mdbtestdata mdbtestdata\nWORKDIR mdbtools\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mdbtools/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nautoreconf -f -i\n./configure --enable-static --disable-man --disable-glib --disable-silent-rules\nmake clean\n\nmake\n\nzip -j $OUT/fuzz_mdb_seed_corpus.zip ../mdbtestdata/data/*.mdb ../mdbtestdata/data/*.accdb\n\ncd src/fuzz\nmake fuzz_mdb\ncp fuzz_mdb $OUT/fuzz_mdb\n"
  },
  {
    "path": "projects/mdbtools/project.yaml",
    "content": "homepage: \"https://github.com/mdbtools/mdbtools\"\nlanguage: c\nprimary_contact: \"emmiller@gmail.com\"\nmain_repo: \"https://github.com/mdbtools/mdbtools\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/mdit-py-plugins/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/executablebooks/mdit-py-plugins mdit-py-plugins\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/mdit-py-plugins\n"
  },
  {
    "path": "projects/mdit-py-plugins/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/mdit-py-plugins/fuzz_containers.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Parse markdown using one of the mdit-py-plugins plugins.\"\"\"\nimport sys\nimport atheris\n\nimport markdown_it\nimport mdit_py_plugins\nfrom mdit_py_plugins.container import container_plugin\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  md = markdown_it.MarkdownIt().use(container_plugin, \"fuzz\")\n  md.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/mdit-py-plugins/fuzz_plugins_individually.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Parse markdown using one of the mdit-py-plugins plugins.\"\"\"\nimport sys\nimport atheris\n\nimport markdown_it\nimport mdit_py_plugins\nfrom mdit_py_plugins.attrs import attrs_plugin\nfrom mdit_py_plugins.admon import admon_plugin\nfrom mdit_py_plugins.anchors import anchors_plugin\nfrom mdit_py_plugins.amsmath import amsmath_plugin\nfrom mdit_py_plugins.colon_fence import colon_fence_plugin\nfrom mdit_py_plugins.deflist import deflist_plugin\nfrom mdit_py_plugins.dollarmath import dollarmath_plugin\nfrom mdit_py_plugins.field_list import fieldlist_plugin\nfrom mdit_py_plugins.footnote import footnote_plugin\nfrom mdit_py_plugins.front_matter import front_matter_plugin\nfrom mdit_py_plugins.myst_blocks import myst_block_plugin\nfrom mdit_py_plugins.myst_role import myst_role_plugin\nfrom mdit_py_plugins.substitution import substitution_plugin\nfrom mdit_py_plugins.tasklists import tasklists_plugin\nfrom mdit_py_plugins.texmath import texmath_plugin\nfrom mdit_py_plugins.wordcount import wordcount_plugin\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  plugins = [\n      attrs_plugin,\n      admon_plugin,\n      anchors_plugin,\n      amsmath_plugin,\n      colon_fence_plugin,\n      deflist_plugin,\n      dollarmath_plugin,\n      fieldlist_plugin,\n      footnote_plugin,\n      front_matter_plugin,\n      myst_block_plugin,\n      myst_role_plugin,\n      substitution_plugin,\n      tasklists_plugin,\n      texmath_plugin,\n      wordcount_plugin\n  ]\n  plugin_to_use = fdp.PickValueInList(plugins)\n  md = markdown_it.MarkdownIt().use(plugin_to_use)\n  md.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/mdit-py-plugins/project.yaml",
    "content": "homepage: https://github.com/executablebooks/mdit-py-plugins\nmain_repo: https://github.com/executablebooks/mdit-py-plugins\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/mdurl/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/executablebooks/mdurl mdurl\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/mdurl\n"
  },
  {
    "path": "projects/mdurl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/mdurl/fuzz_mdurl.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport mdurl\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    mdurl.parse(fdp.ConsumeUnicodeNoSurrogates(512))\n    mdurl.decode(fdp.ConsumeUnicodeNoSurrogates(512))\n    mdurl.encode(fdp.ConsumeUnicodeNoSurrogates(512))\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/mdurl/project.yaml",
    "content": "homepage: https://github.com/executablebooks/mdurl\nmain_repo: https://github.com/executablebooks/mdurl\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/memcached/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkgconf libevent-dev\n\nRUN git clone https://github.com/libevent/libevent.git && \\\n    cd libevent && \\\n    mkdir build && \\\n    cd build && \\\n    cmake -DEVENT__DISABLE_MBEDTLS=ON -DEVENT__DISABLE_OPENSSL=ON -DEVENT__LIBRARY_TYPE=STATIC -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_SAMPLES=ON ../ && \\\n    make && make install\n\nRUN git clone --depth 1 https://github.com/memcached/memcached memcached\nWORKDIR memcached\nCOPY build.sh generate_corpus.py *.c *.diff *.options $SRC/\n"
  },
  {
    "path": "projects/memcached/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd vendor && ./fetch.sh && cd ../\ngit apply $SRC/patch.diff\n./autogen.sh\n./configure --enable-proxy\nmake\n\nmv $SRC/fuzzer_proxy.c $SRC/memcached/\ncd $SRC/memcached\n\n$CC $CFLAGS $LIB_FUZZING_ENGINE -Ivendor/liburing/src/include \\\n    -Ivendor/lua/src \\\n    -L /usr/local/lib \\\n    -DHAVE_CONFIG_H -L ./vendor/lua/src \\\n    -g -O2 -pthread -levent -lm -ldl fuzzer_proxy.c \\\n    memcached-memcached.o memcached-hash.o memcached-jenkins_hash.o \\\n    memcached-murmur3_hash.o memcached-slabs.o memcached-items.o \\\n    memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats_prefix.o \\\n    memcached-util.o memcached-cache.o memcached-bipbuffer.o memcached-base64.o \\\n    memcached-logger.o memcached-crawler.o memcached-itoa_ljust.o memcached-slab_automove.o \\\n    memcached-slabs_mover.o memcached-authfile.o memcached-restart.o memcached-proto_text.o \\\n    memcached-proto_bin.o memcached-proto_parser.o memcached-proto_proxy.o memcached-mcmc.o memcached-proxy_xxhash.o \\\n    memcached-proxy_ustats.o memcached-proxy_ratelim.o memcached-proxy_jump_hash.o \\\n    memcached-proxy_request.o memcached-proxy_result.o memcached-proxy_inspector.o \\\n    memcached-proxy_mutator.o memcached-proxy_network.o memcached-proxy_lua.o \\\n    memcached-proxy_luafgen.o memcached-proxy_config.o memcached-proxy_ring_hash.o \\\n    memcached-proxy_internal.o memcached-proxy_tls.o memcached-md5.o \\\n    memcached-extstore.o memcached-crc32c.o memcached-storage.o memcached-slab_automove_extstore.o \\\n    vendor/lua/src/liblua.a /usr/local/lib/libevent.a -o fuzzer_proxy\n\npython3 $SRC/generate_corpus.py\n\ncp $SRC/memcached/fuzzer_proxy $OUT/\ncp $SRC/*.options $OUT/\ncp *seed_corpus.zip $OUT/\n"
  },
  {
    "path": "projects/memcached/fuzzer_proxy.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"memcached.h\"\n#include \"proto_proxy.h\"\n#include \"cache.h\"\n#include <sys/eventfd.h>\n\nstatic struct event_base *main_base;\nstatic conn *fconn;\n\n#define PROXY 1\n#define READ_BUFFER_SIZE 16384 // memcached.h\n\nextern int LLVMFuzzerInitialize(int *argc, char **argv)\n{\n    // allocate cons\n    conns = calloc(10, sizeof(conn *));\n\n    // init eventfd\n    int dfd = eventfd(0, EFD_NONBLOCK);\n    struct event_config *ev_config;\n    ev_config = event_config_new();\n    event_config_set_flag(ev_config, EVENT_BASE_FLAG_NOLOCK);\n    main_base = event_base_new_with_config(ev_config);\n\n    memcached_thread_init(1, NULL);\n    // get the first, and only, worker thread, and manually attach to the conn\n    LIBEVENT_THREAD *mthread = get_worker_thread(0); \n\n    // init proxy config\n    settings.proxy_ctx = proxy_init(false, false);\n    settings.proxy_enabled = true;\n    settings.binding_protocol = proxy_prot;\n\n    // generate connection\n    fconn = conn_new(dfd, conn_parse_cmd,\n                EV_READ|EV_PERSIST,\n                4096, local_transport,\n                main_base, NULL, 0,\n                settings.binding_protocol);\n\n    // assign worker thread\n    fconn->thread = mthread;\n\n    // initialize proxy thread\n    proxy_thread_init(settings.proxy_ctx, fconn->thread);\n    \n    // setup hashing\n    assoc_init(HASHPOWER_DEFAULT);\n    hash_init(MURMUR3_HASH);\n\n    return 0;\n}\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)\n{\n    if(len < 4) return -1;\n    if(len > READ_BUFFER_SIZE) return -1;\n\n    int rval = 0;\n\n    fconn->rbuf = do_cache_alloc(fconn->thread->rbuf_cache);\n    fconn->rcurr = fconn->rbuf;\n    fconn->rsize = READ_BUFFER_SIZE;\n\n    fconn->rbytes = len;\n    memcpy(fconn->rbuf, buf, len);\n\n    rval = try_read_command_proxy(fconn);\n    do_cache_free(fconn->thread->rbuf_cache, fconn->rbuf);\n    fconn->rbuf = NULL;\n    fconn->rcurr = NULL;\n    \n    return rval;\n}\n"
  },
  {
    "path": "projects/memcached/fuzzer_proxy.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/memcached/generate_corpus.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\nimport zipfile\nfrom hashlib import md5\n\n\"\"\"\nsimple, temporary script to dynamically generate a text protocol corpus\nfor fuzzing memcached text protocol\n\"\"\"\n\ncommands = [\"ms $PATH$ $PAYLEN$ $FLAG$ $PAYLOAD$\", \n            \"mg $PATH$ $FLAG$\", \n            \"md $PATH$ $FLAG$\",\n            \"ma $PATH$ $FLAG$\", \n            \"mn \", \n            \"set $PATH$ 2 0 2 $PAYLOAD$\", \n            \"get $PATH$\", \n            \"add $PATH$ 2 0 2 $PAYLOAD$\", \n            \"replace $PATH$ 2 0 2 $PAYLOAD$\", \n            \"append $PATH$ $PAYLEN$ $PAYLOAD$\", \n            \"prepend $PATH$ $PAYLEN$ $PAYLOAD$\", \n            \"gets $PATH$\", \n            \"delete $PATH$\", \n            \"incr $PATH$ 1\",\n            \"decr $PATH$ 1\", \n            \"touch $PATH$ 0\", \n            \"gat 0 $PATH$\", \n            \"gats 0 $PATH$\", \n            \"watch\", \n            \"version\", \n            \"stats\"]\n\n# hardcode these for now\nPATH=\"/foo/test\"\nPAYLOAD=\"hi\"\nPAYLEN=\"2\"\nFLAG=\"c k\"\n\n# generate fuzzer_proxy corpus\nfproxy_corpus = \"fuzzer_proxy_seed_corpus.zip\"\nwith zipfile.ZipFile(fproxy_corpus, \"w\") as zfile:\n    for command in commands:\n        data = (command.replace\n            (\"$PATH$\", PATH)\n            .replace\n            (\"$FLAG$\", FLAG)\n            .replace\n            (\"$PAYLEN$\", PAYLEN)\n            .replace\n            (\"$PAYLOAD$\", \"\\r\\n{0}\".format(PAYLOAD))) \n        \n        zfile.writestr(md5(data.encode(\"utf-8\")).hexdigest(), data)\n"
  },
  {
    "path": "projects/memcached/patch.diff",
    "content": "diff --git a/Makefile.am b/Makefile.am\nindex 4208331..11c3e1b 100644\n--- a/Makefile.am\n+++ b/Makefile.am\n@@ -1,6 +1,7 @@\n bin_PROGRAMS = memcached\n pkginclude_HEADERS = protocol_binary.h xxhash.h\n-noinst_PROGRAMS = memcached-debug sizes testapp timedrun\n+#noinst_PROGRAMS = memcached-debug sizes testapp timedrun\n+memcached_LINK = true\n \n BUILT_SOURCES=\n \ndiff --git a/memcached.c b/memcached.c\nindex 306a952..4520bdb 100644\n--- a/memcached.c\n+++ b/memcached.c\n@@ -4730,7 +4730,7 @@ static int _mc_meta_load_cb(const char *tag, void *ctx, void *data) {\n     return reuse_mmap;\n }\n \n-int main (int argc, char **argv) {\n+int main2 (int argc, char **argv) {\n     int c;\n     bool lock_memory = false;\n     bool do_daemonize = false;\n"
  },
  {
    "path": "projects/memcached/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.memcached.org/\"\nlanguage: c\nmain_repo: \"https://github.com/memcached/memcached\"\nprimary_contact: \"alan@cacheforge.com\"\nauto_ccs:\n  - \"bxa@stripe.com\"\n  - \"shodivine@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/mercurial/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n  autoconf \\\n  automake \\\n  build-essential \\\n  curl \\\n  libbz2-dev \\\n  libncurses5-dev \\\n  libncursesw5-dev \\\n  libreadline-dev \\\n  libsqlite3-dev \\\n  libssl-dev \\\n  libtool \\\n  llvm \\\n  lzma-dev \\\n  make \\\n  python3-dev \\\n  tk-dev \\\n  wget \\\n  xz-utils \\\n  zlib1g-dev \\\n  mercurial\nRUN cd $SRC && curl https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz | tar xzf -\nRUN hg clone https://www.mercurial-scm.org/repo/hg mercurial\nWORKDIR mercurial\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mercurial/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ignore memory leaks from python scripts invoked in the build\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nexport MSAN_OPTIONS=\"halt_on_error=0:exitcode=0:report_umrs=0\"\n\n# Remove -pthread from CFLAGS, this trips up ./configure\n# which thinks pthreads are available without any CLI flags\nCFLAGS=${CFLAGS//\"-pthread\"/}\n\nFLAGS=()\ncase $SANITIZER in\n  address)\n    FLAGS+=(\"--with-address-sanitizer\")\n    ;;\n  memory)\n    FLAGS+=(\"--with-memory-sanitizer\")\n    # installing ensurepip takes a while with MSAN instrumentation, so\n    # we disable it here\n    FLAGS+=(\"--without-ensurepip\")\n    ;;\n  undefined)\n    FLAGS+=(\"--with-undefined-behavior-sanitizer\")\n    ;;\nesac\n\npushd $SRC/Python-3.8.3/\nif [ -e $OUT/sanpy/cflags -a \"$(cat $OUT/sanpy/cflags)\" = \"${CFLAGS}\" ] ; then\n    echo 'Python cflags unchanged, no need to rebuild'\nelse\n    rm -rf $OUT/sanpy\n    ./configure \"${FLAGS[@]:-}\" \\\n                --prefix=$OUT/sanpy CFLAGS=\"${CFLAGS}\" LINKCC=\"${CXX}\" \\\n                LDFLAGS=\"${CXXFLAGS}\"\n    grep -v HAVE_GETC_UNLOCKED < pyconfig.h > tmp && mv tmp pyconfig.h\n    make && make install\n    echo \"${CFLAGS}\" > $OUT/sanpy/cflags\nfi\npopd\n\ncd contrib/fuzz\nmake clean oss-fuzz PYTHON_CONFIG=$OUT/sanpy/bin/python3.8-config PYTHON_CONFIG_FLAGS=\"--ldflags --embed\"\n"
  },
  {
    "path": "projects/mercurial/project.yaml",
    "content": "homepage: \"https://www.mercurial-scm.org/\"\nlanguage: c++\nprimary_contact: \"durin42@gmail.com\"\nauto_ccs:\n  - \"gregory.szorc@gmail.com\"\n  - \"kbullock@ringworld.org\"\n  - \"security@mercurial-scm.org\"\n  - \"martinvonz@google.com\"\n  - \"raphael.gomes@octobus.net\"\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\ncoverage_extra_args: -ignore-filename-regex=.*/sanpy/.*\nmain_repo: \"https://www.mercurial-scm.org/repo/hg\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/meshoptimizer/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config cmake libcurlpp-dev libcurl4-openssl-dev\nRUN git clone https://github.com/zeux/meshoptimizer\nWORKDIR meshoptimizer\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/meshoptimizer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build && cd build\ncmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ..\nmake -j$(nproc)\n\ncd ..\nfind . -name \"*.o\" -exec ar rcs fuzz_lib.a {} \\;\n$CXX $CXXFLAGS tools/codecfuzz.cpp -o $OUT/codecfuzzer $LIB_FUZZING_ENGINE fuzz_lib.a\n"
  },
  {
    "path": "projects/meshoptimizer/project.yaml",
    "content": "homepage: \"https://github.com/zeux/meshoptimizer\"\nmain_repo: \"https://github.com/zeux/meshoptimizer\"\nlanguage: c++\nprimary_contact: \"arseny.kapoulkine@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/metadata-extractor/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    find . -not -path \"*jpeg/corpus/*\" -name \"da39a3ee5e6b4b0d3255bfef95601890afd80709*\" -exec rm {} \\; && \\\n    zip -j $SRC/ImageMetadataReaderFuzzer_seed_corpus.zip \\\n      go-fuzz-corpus/bmp/corpus/* \\\n      go-fuzz-corpus/gif/corpus/* \\\n      go-fuzz-corpus/jpeg/corpus/* \\\n      go-fuzz-corpus/png/corpus/* \\\n      go-fuzz-corpus/tiff/corpus/* \\\n      go-fuzz-corpus/webp/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/drewnoakes/metadata-extractor.git metadata-extractor\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/metadata-extractor\n"
  },
  {
    "path": "projects/metadata-extractor/ImageMetadataReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.drew.metadata.Metadata;\nimport com.drew.imaging.ImageMetadataReader;\nimport com.drew.imaging.ImageProcessingException;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\n\npublic class ImageMetadataReaderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    ByteArrayInputStream input = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n\n    try {\n      Metadata metadata = ImageMetadataReader.readMetadata(input);\n    }\n    catch (IOException | ImageProcessingException e) {\n      return;\n    }\n    \n  }\n}\n"
  },
  {
    "path": "projects/metadata-extractor/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/*.zip $OUT/\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true -Dmaven.repo.local=$WORK/.m2\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"Output/maven/metadata-extractor-$CURRENT_VERSION.jar\" $OUT/metadata-extractor.jar\n\nALL_JARS=\"metadata-extractor.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/metadata-extractor/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/drewnoakes/metadata-extractor\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/drewnoakes/metadata-extractor.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/metallb/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/metallb/metallb.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/metallb\n"
  },
  {
    "path": "projects/metallb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\ncompile_native_go_fuzzer    $(pwd)/internal/bgp/community   FuzzNew                 fuzz_New\ncompile_native_go_fuzzer    $(pwd)/internal/bgp/native      FuzzReadOpen            fuzz_ReadOpen\ncompile_native_go_fuzzer    $(pwd)/internal/config          FuzzParseCIDR           fuzz_ParseCIDR\n"
  },
  {
    "path": "projects/metallb/project.yaml",
    "content": "homepage: \"https://metallb.universe.tf\"\nlanguage: go\nprimary_contact: \"fpaoline@redhat.com\"\nauto_ccs:\n  - \"obraunsh@redhat.com\"\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/metallb/metallb.git\"\n"
  },
  {
    "path": "projects/mfcmapi/project.yaml",
    "content": "homepage: \"https://github.com/microsoft/mfcmapi\"\nlanguage: c++\nprimary_contact: \"mfcmapi@gmail.com\"\nauto_ccs:\n  - \"sgriffin@microsoft.com\"\nmain_repo: 'https://github.com/microsoft/mfcmapi.git'\n"
  },
  {
    "path": "projects/micronaut/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y locales\nRUN locale-gen en_US.UTF-8\nENV LC_ALL=en_US.UTF-8\nRUN git clone --depth=1 https://github.com/micronaut-projects/micronaut-fuzzing.git\nRUN micronaut-fuzzing/oss-fuzz/checkout.sh\nRUN ln -s micronaut-fuzzing/oss-fuzz/build.sh .\n"
  },
  {
    "path": "projects/micronaut/project.yaml",
    "content": "homepage: \"https://micronaut.io/\"\nmain_repo: \"https://github.com/micronaut-projects/micronaut-core\"\nlanguage: jvm\nprimary_contact: \"jonas.konrad@oracle.com\"\nauto_ccs:\n  - \"me@yawk.at\"\n  - \"sergiodelamocaballero@gmail.com\"\n  - \"graeme.rocher@oracle.com\"\n  - \"denis.s.stepanov@oracle.com\"\n  - \"asmaa.knidar@oracle.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/migtd/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n# Install packages we need to build dependencies\nRUN apt-get update && \\\n    apt-get install -y \\\n    nasm \\\n    llvm \\\n    clang\nRUN git clone --depth 1 https://github.com/intel/MigTD.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/MigTD\n"
  },
  {
    "path": "projects/migtd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nset -eox pipefail\ncd $SRC/MigTD\n\nFUZZ_CRATE_DIRS=$(find . -type d -name fuzz -exec dirname $(readlink -f {}) \\;)\n\ngit submodule update --init --recursive\nbash sh_script/preparation.sh\n\nfor CRATE_DIR in ${FUZZ_CRATE_DIRS[@]};\ndo\n  if [[ $CRATE_DIR =~ \"deps\" ]]; then\n    continue\n  else    \n    echo \"Building crate: $CRATE_DIR\"\n    cd $CRATE_DIR\n    cargo fuzz build -O\n    FUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\n    fuzz_tcs=$(cargo fuzz list)\n    for tcs in ${fuzz_tcs[@]}; do\n      if [[ $tcs =~ \"afl\" ]]; then\n        continue\n      else\n        FUZZ_TARGET_NAME=$tcs\n        CRATE_NAME=$(basename $CRATE_DIR)\n       cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/$CRATE_NAME-$FUZZ_TARGET_NAME\n      fi\n    done\n  fi\ndone"
  },
  {
    "path": "projects/migtd/project.yaml",
    "content": "homepage: \"https://github.com/intel/MigTD\"\nlanguage: rust\nprimary_contact: \"wei3.liu@intel.com\"\nauto_ccs:\n  - \"jiewen.yao@intel.com\"\n  - \"jiaqi.gao@intel.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/intel/MigTD.git'"
  },
  {
    "path": "projects/minify/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/tdewolff/minify\nRUN git clone --depth 1 https://github.com/tdewolff/parse\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/minify/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n./minify/tests/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/minify/project.yaml",
    "content": "homepage: \"https://github.com/tdewolff/minify\"\nprimary_contact: \"tacodewolff@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/tdewolff/minify'\n"
  },
  {
    "path": "projects/miniz/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y cmake\n\nRUN git clone --depth 1 https://github.com/richgel999/miniz.git\n\nWORKDIR miniz\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/miniz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run the OSS-Fuzz script in the project\n$SRC/miniz/tests/ossfuzz.sh\n\n# Build test\nmkdir build-test\ncd build-test\ncmake -DBUILD_TESTS=ON ..\nmake\n"
  },
  {
    "path": "projects/miniz/project.yaml",
    "content": "homepage: \"https://github.com/richgel999/miniz\"\nlanguage: c\nprimary_contact: \"martin@urbackup.org\"\nauto_ccs:\n  - \"randy440088@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/richgel999/miniz.git'\n"
  },
  {
    "path": "projects/miniz/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build-test\n"
  },
  {
    "path": "projects/miniz_oxide/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/Frommi/miniz_oxide miniz_oxide\nWORKDIR miniz_oxide\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/miniz_oxide/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./build_orig_miniz.sh\nRUSTFLAGS=\"$RUSTFLAGS -L./bin/\" cargo fuzz build -O\nfuzz_release=fuzz/target/x86_64-unknown-linux-gnu/release\ncp $fuzz_release/inflate_nonwrapping $OUT/\n"
  },
  {
    "path": "projects/miniz_oxide/project.yaml",
    "content": "homepage: \"https://github.com/Frommi/miniz_oxide\"\nlanguage: rust\nmain_repo: \"https://github.com/Frommi/miniz_oxide\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/minizip/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake pkg-config libz-dev \\\n    libssl-dev:i386 zlib1g-dev:i386 libbz2-dev:i386 liblzma-dev:i386 libzstd-dev:i386\n\nRUN git clone -b develop https://github.com/zlib-ng/minizip-ng\nWORKDIR minizip-ng\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/minizip/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Force static linking in i386 by removing dynamically linked libraries.\nif [ \"$ARCHITECTURE\" = 'i386' ]; then\n  rm /usr/lib/i386-linux-gnu/libssl.so*\n  rm /usr/lib/i386-linux-gnu/libcrypto.so*\n  rm /usr/lib/i386-linux-gnu/libz.so*\n  rm /usr/lib/i386-linux-gnu/libbz2.so*\n  rm /usr/lib/i386-linux-gnu/liblzma.so*\nfi\n\n# Build project\ncmake . -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" -DMZ_BUILD_FUZZ_TESTS=ON -DMZ_BUILD_TESTS=ON -DMZ_BUILD_UNIT_TESTS=ON -DMZ_FETCH_LIBS=OFF -DXZ_SANDBOX=no\nmake clean\nmake -j$(nproc)\n\n# Package seed corpus\nzip -j $OUT/unzip_fuzzer_seed_corpus.zip test/fuzz/unzip_fuzzer_seed_corpus/*\n\n# Copy the fuzzer executables, zip-ed corpora, and dictionary files to $OUT\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer_seed_corpus.zip' -exec cp -v '{}' $OUT ';'\n"
  },
  {
    "path": "projects/minizip/project.yaml",
    "content": "homepage: \"https://github.com/zlib-ng/minizip-ng\"\nlanguage: c++\nprimary_contact: \"nathan.moinvaziri@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/zlib-ng/minizip-ng'\n"
  },
  {
    "path": "projects/minizip/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer and run unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nctest --test-dir . -j$(nproc)\n"
  },
  {
    "path": "projects/moby/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y clang libbtrfs-dev pkg-config libdevmapper-dev\nRUN git clone --depth 1 https://github.com/moby/moby\nRUN git clone --depth 1 https://github.com/moby/go-archive\nRUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=v2_2\nCOPY build.sh $SRC/\nCOPY *_fuzzer.go $SRC/\n\nCOPY *.options $SRC/\n\nRUN wget https://sourceware.org/ftp/lvm2/LVM2.2.03.15.tgz \\\n    && tar -xvzf ./LVM2.2.03.15.tgz \\\n    && cd LVM2.2.03.15 \\\n    && ./configure --disable-selinux --enable-static_link \\\n    && make device-mapper\n\nWORKDIR $SRC/moby\n"
  },
  {
    "path": "projects/moby/FuzzAdd.options",
    "content": "[libfuzzer]\nmax_len = 1800000\nlen_control = 0"
  },
  {
    "path": "projects/moby/backend_build_fuzzer.go",
    "content": "// Copyright 2022 Google LLC. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage build\n\nimport (\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc FuzzsanitizeRepoAndTags(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tnames := make([]string, 0)\n\terr := f.CreateSlice(&names)\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_, _ = sanitizeRepoAndTags(names)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/moby/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Temporarily disable coverage build in OSS-Fuzz's CI\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n\tif [ \"${SANITIZER}\" = 'coverage' ]\n\tthen\n\t\texit 0\n\tfi\n\t\nfi\n\ncd $SRC\nwget https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.5.tar.bz2\ntar -xvjf libmnl-1.0.5.tar.bz2\ncd libmnl-1.0.5\n./configure --enable-static\nmake\nmake install\n\ncd $SRC\nwget https://www.netfilter.org/projects/libnftnl/files/libnftnl-1.3.0.tar.xz\ntar xf libnftnl-1.3.0.tar.xz\ncd libnftnl-1.3.0\n./configure --enable-static\nmake\nmake install\n\ncd $SRC\nwget https://www.netfilter.org/projects/nftables/files/nftables-1.1.5.tar.xz\ntar xf nftables-1.1.5.tar.xz\ncd nftables-1.1.5\n./configure  --with-mini-gmp --without-cli --enable-static\nmake\nmake install\n\ncd $SRC\nwget https://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-1.0.2.tar.bz2\ntar -xvjf libnfnetlink-1.0.2.tar.bz2\ncd libnfnetlink-1.0.2\n./configure  --with-mini-gmp --without-cli --enable-static\nmake\nmake install\n\ncp $SRC/jsonmessage_fuzzer.go $SRC/moby/client/pkg/jsonmessage/\ncp $SRC/backend_build_fuzzer.go $SRC/moby/daemon/builder/backend/\ncp $SRC/remotecontext_fuzzer.go $SRC/moby/daemon/builder/remotecontext/\ncp $SRC/daemon_fuzzer.go $SRC/moby/daemon/\n\nrm $SRC/moby/daemon/logger/plugin_unsupported.go\n\ncd $SRC/moby\ngo mod tidy\n\nmv $SRC/moby/daemon/volume/mounts/parser_test.go $SRC/moby/daemon/volume/mounts/parser_test_fuzz.go\nmv $SRC/moby/daemon/volume/mounts/validate_unix_test.go $SRC/moby/daemon/volume/mounts/validate_unix_test_fuzz.go\n\nif [ \"$SANITIZER\" != \"coverage\" ] ; then\n\tgo-fuzz -func FuzzDaemonSimple -o FuzzDaemonSimple.a github.com/moby/moby/v2/daemon\n\n\t$CXX $CXXFLAGS $LIB_FUZZING_ENGINE FuzzDaemonSimple.a \\\n        /src/LVM2.2.03.15/libdm/ioctl/libdevmapper.a \\\n\t/src/nftables-1.1.5/src/.libs/libnftables.a \\\n\t/src/nftables-1.1.5/src/.libs/libminigmp.a \\\n\t/src/nftables-1.1.5/src/.libs/libparser.a \\\n\t/src/libnfnetlink-1.0.2/src/.libs/libnfnetlink.a \\\n\t/src/libnftnl-1.3.0/src/.libs/libnftnl.a \\\n\t/src/libmnl-1.0.5/src/.libs/libmnl.a \\\n        -o $OUT/FuzzDaemonSimple\nfi\n\nrm daemon/volume/mounts/validate_windows_test.go\ncompile_native_go_fuzzer_v2 github.com/moby/moby/v2/daemon/volume/mounts FuzzParseLinux FuzzParseLinux\n#compile_go_fuzzer github.com/moby/moby/client/pkg/jsonmessage FuzzDisplayJSONMessagesStream FuzzDisplayJSONMessagesStream\ncompile_go_fuzzer github.com/moby/moby/v2/daemon/builder/backend FuzzsanitizeRepoAndTags FuzzsanitizeRepoAndTags\ncompile_go_fuzzer github.com/moby/moby/v2/daemon/builder/remotecontext FuzzreadAndParseDockerfile FuzzreadAndParseDockerfile\ncompile_native_go_fuzzer_v2 github.com/moby/moby/v2/pkg/tailfile FuzzTailfile FuzzTailfile\ncompile_native_go_fuzzer_v2 github.com/moby/moby/v2/daemon/logger/jsonfilelog FuzzLoggerDecode FuzzLoggerDecode\ncompile_native_go_fuzzer_v2 github.com/moby/moby/v2/daemon/libnetwork/etchosts FuzzAdd FuzzAdd\ncompile_native_go_fuzzer_v2 github.com/moby/moby/v2/daemon/pkg/oci FuzzAppendDevicePermissionsFromCgroupRules FuzzAppendDevicePermissionsFromCgroupRules\ncompile_native_go_fuzzer_v2 github.com/moby/moby/v2/daemon/logger/jsonfilelog/jsonlog FuzzJSONLogsMarshalJSONBuf FuzzJSONLogsMarshalJSONBuf\n\ncp $SRC/*.options $OUT/\n\ncd $SRC/go-archive\ngo mod tidy\ncompile_native_go_fuzzer_v2 github.com/moby/go-archive/compression FuzzDecompressStream FuzzDecompressStream\ncompile_native_go_fuzzer_v2 github.com/moby/go-archive FuzzApplyLayer FuzzApplyLayer\ncompile_native_go_fuzzer_v2 github.com/moby/go-archive FuzzUntar FuzzUntar\n"
  },
  {
    "path": "projects/moby/containerstream_fuzzer.go",
    "content": "// Copyright 2022 Google LLC. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage stream\n\nimport (\n\t\"bytes\"\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n\t\"io\"\n)\n\nfunc FuzzcopyEscapable(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tsrcBytes, err := f.GetBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tsrc := io.NopCloser(bytes.NewReader(srcBytes))\n\tkeys, err := f.GetBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tvar dst bytes.Buffer\n\t_, _ = copyEscapable(&dst, src, keys)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/moby/daemon_fuzzer.go",
    "content": "// Copyright 2022 Google LLC. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage daemon\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/moby/sys/mount\"\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/moby/moby/v2/daemon/server/backend\"\n\t\"github.com/moby/moby/v2/daemon/server/imagebackend\"\n\t\"github.com/moby/moby/v2/daemon/container\"\n\t\"github.com/moby/moby/v2/daemon/config\"\n\t\"github.com/moby/moby/v2/daemon/images\"\n\t\"github.com/moby/moby/v2/daemon/internal/image\"\n\tdockerreference \"github.com/moby/moby/v2/daemon/internal/refstore\"\n\t\"github.com/opencontainers/go-digest\"\n\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc init() {\n\tlogrus.SetLevel(logrus.ErrorLevel)\n}\n\nfunc IsJSON(input []byte) bool {\n\tvar js json.RawMessage\n\treturn json.Unmarshal(input, &js) == nil\n}\n\nfunc FuzzDaemonSimple(data []byte) int {\n\tif os.Getuid() != 0 {\n\t\treturn -1\n\t}\n\n\tf := fuzz.NewConsumer(data)\n\n\t// reference store\n\treferenceStoreJson, err := f.GetBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tif !IsJSON(referenceStoreJson) {\n\t\treturn 0\n\t}\n\t// referenceStore\n\trsDir, err := os.MkdirTemp(\"\", \"referenceStore\")\n\tif err != nil {\n\t\treturn 0\n\t}\n\tdefer os.RemoveAll(rsDir)\n\tjsonFile := filepath.Join(rsDir, \"repositories.json\")\n\terr = os.WriteFile(jsonFile, referenceStoreJson, 0o666)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\trStore, err := dockerreference.NewReferenceStore(jsonFile)\n\tif err != nil {\n\t\treturn 0\n\t}\n\t// end reference store\n\n\ttestRoot, err := os.MkdirTemp(\"\", \"test-dir\")\n\tif err != nil {\n\t\treturn 0\n\t}\n\tdefer os.RemoveAll(testRoot)\n\tcfg := &config.Config{}\n\n\terr = mount.MakePrivate(testRoot)\n\tif err != nil {\n\t\treturn 0\n\t}\n\tdefer mount.Unmount(testRoot)\n\n\tcfg.ExecRoot = filepath.Join(testRoot, \"exec\")\n\tcfg.Root = filepath.Join(testRoot, \"daemon\")\n\n\terr = os.Mkdir(cfg.ExecRoot, 0755)\n\tif err != nil {\n\t\treturn 0\n\t}\n\terr = os.Mkdir(cfg.Root, 0755)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\timgStoreDir, err := os.MkdirTemp(\"\", \"images-fs-store\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfsBackend, err := image.NewFSStoreBackend(imgStoreDir)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer os.RemoveAll(imgStoreDir)\n\n\tis, err := image.NewImageStore(fsBackend, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\td := &Daemon{\n\t\troot:         cfg.Root,\n\t\timageService: images.NewImageService(context.Background(), images.ImageServiceConfig{ReferenceStore: rStore, ImageStore: is}),\n\t\tcontainers:   container.NewMemoryStore(),\n\t}\n\n\tconfigStore := &configStore{Config: *cfg}\n\td.configStore.Store(configStore)\n\n\tcontainersReplica, err := container.NewViewDB()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\td.containersReplica = containersReplica\n\n\tvar noOfCalls int\n\tnoOfCalls, err = f.GetInt()\n\tif err != nil {\n\t\treturn 0\n\t}\n\tif noOfCalls < 2 {\n\t\tnoOfCalls = 2\n\t}\n\tfor i := 0; i < noOfCalls%10; i++ {\n\t\ttypeOfCall, err := f.GetInt()\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\t//fmt.Println(\"calling \", typeOfCall%8)\n\t\tswitch typeOfCall % 11 {\n\t\tcase 0:\n\t\t\trefOrID, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn -1\n\t\t\t}\n\t\t\tif refOrID == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\toptions := imagebackend.GetImageOpts{}\n\t\t\tf.GenerateStruct(&options)\n\t\t\t_, _ = d.imageService.GetImage(context.Background(), refOrID, options)\n\t\tcase 1:\n\n\t\t\tgetContainer, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\t_, _ = d.GetContainer(getContainer)\n\t\tcase 2:\n\t\t\tc := &container.Container{}\n\t\t\tf.GenerateStruct(c)\n\t\t\tif c.ID == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc.ExecCommands = container.NewExecStore()\n\t\t\td.containers.Add(c.ID, c)\n\t\tcase 3:\n\t\t\trefOrID, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn -1\n\t\t\t}\n\t\t\td.containers.Delete(refOrID)\n\t\tcase 4:\n\t\t\td.containers.List()\n\t\tcase 5:\n\t\t\td.containers.Size()\n\t\tcase 6:\n\t\t\tprefixOrName, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn -1\n\t\t\t}\n\t\t\tc := &backend.ContainerAttachConfig{}\n\t\t\tf.GenerateStruct(c)\n\t\t\td.ContainerAttach(prefixOrName, c)\n\t\tcase 7:\n\t\t\timageConfig, err := f.GetBytes()\n\t\t\tif err != nil {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tparent, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tdig := digest.FromBytes([]byte(\"fuzz\"))\n\t\t\t_, _ = d.imageService.CreateImage(context.Background(), imageConfig, parent, dig)\n\t\tcase 8:\n\t\t\tparams := &backend.ContainerCreateConfig{}\n\t\t\tf.GenerateStruct(params)\n\t\t\t_, _ = d.ContainerCreate(context.Background(), *params)\n\t\tcase 9:\n\t\t\tname, err := f.GetString()\n\t\t\tif err != nil {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\t_, _ = d.ContainerChanges(context.Background(), name)\n\t\t}\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/moby/jsonmessage_fuzzer.go",
    "content": "// Copyright 2022 Google LLC. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage jsonmessage\n\nimport (\n\t\"bytes\"\n)\n\nfunc FuzzDisplayJSONMessagesStream(data []byte) int {\n\tout := bytes.NewBuffer(nil)\n\tin := bytes.NewBuffer(data)\n\tDisplayJSONMessagesStream(in, out, 0, false, nil)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/moby/project.yaml",
    "content": "homepage: \"https://github.com/moby/moby\"\nlanguage: go\nprimary_contact: \"\"\nmain_repo: \"https://github.com/moby/moby\"\nvendor_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/moby/remotecontext_fuzzer.go",
    "content": "// Copyright 2022 Google LLC. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage remotecontext\n\nimport (\n\t\"bytes\"\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc FuzzreadAndParseDockerfile(data []byte) int {\n\tf := fuzz.NewConsumer(data)\n\tname, err := f.GetString()\n\tif err != nil {\n\t\treturn 0\n\t}\n\trcBytes, err := f.GetBytes()\n\tif err != nil {\n\t\treturn 0\n\t}\n\trc := bytes.NewReader(rcBytes)\n\t_, _ = readAndParseDockerfile(name, rc)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/model-transparency/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/sigstore/model-transparency\nWORKDIR model-transparency\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/model-transparency/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\nfor fuzzer in $(find $SRC/model-transparency/tests/fuzzing -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\ncp $SRC/model-transparency/tests/fuzzing/dicts/* $OUT/\n"
  },
  {
    "path": "projects/model-transparency/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/sigstore/model-transparency\nlanguage: python\nmain_repo: https://github.com/sigstore/model-transparency\nsanitizers:\n- address\nprimary_contact: mihaimaruseac@google.com \nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/monero/Dockerfile",
    "content": "# Copyright 2020 The Monero Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Multistage docker build, requires docker 17.05\n\n# builder stage\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN set -ex && \\\n    apt-get update && \\\n    apt-get --no-install-recommends --yes install \\\n        ca-certificates \\\n        cmake \\\n        g++ \\\n        make \\\n        pkg-config \\\n        graphviz \\\n        doxygen \\\n        git \\\n        curl \\\n        libtool \\\n        libtool-bin \\\n        flex \\\n        bison \\\n        autoconf \\\n        automake \\\n        bzip2 \\\n        xsltproc \\\n        gperf \\\n        unzip \\\n        cmake \\\n        ccache \\\n        libsodium-dev \\\n        libreadline-dev \\\n        libudev-dev \\\n        libprotobuf-dev \\\n        protobuf-compiler \\\n        libexpat-dev\n\nWORKDIR monero\n\nENV CFLAGS=\"${CFLAGS} -fPIC -pthread\"\nENV CXXFLAGS=\"${CXXFLAGS} -fPIC -pthread\"\n\n## Workaround for boost build issue\nRUN cp /usr/local/include/x86_64-unknown-linux-gnu/c++/v1/__config_site /usr/local/include/c++/v1/\n\n## Boost\nARG BOOST_VERSION=1_84_0\nARG BOOST_VERSION_DOT=1.84.0\nARG BOOST_HASH=a5800f405508f5df8114558ca9855d2640a2de8f0445f051fa1c7c3383045724\nRUN set -ex \\\n    && curl -s -L -o  boost_${BOOST_VERSION}.tar.gz https://archives.boost.io/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.gz \\\n    && echo \"${BOOST_HASH}  boost_${BOOST_VERSION}.tar.gz\" | sha256sum -c \\\n    && tar -xf boost_${BOOST_VERSION}.tar.gz \\\n    && cd boost_${BOOST_VERSION} \\\n    && ./bootstrap.sh --with-toolset=clang \\\n    && ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale threading=multi threadapi=pthread cflags=\"$CFLAGS\" cxxflags=\"$CXXFLAGS\" install\nENV BOOST_ROOT /usr/local/boost_${BOOST_VERSION}\n\n# OpenSSL\nARG OPENSSL_VERSION=1.1.1g\nARG OPENSSL_HASH=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46\nRUN set -ex \\\n    && curl -s -O -L https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \\\n    && echo \"${OPENSSL_HASH}  openssl-${OPENSSL_VERSION}.tar.gz\" | sha256sum -c \\\n    && tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \\\n    && cd openssl-${OPENSSL_VERSION} \\\n    && ./Configure linux-x86_64 no-shared --static \"$CFLAGS\" \\\n    && make build_generated \\\n    && make -j$(nproc) libcrypto.a \\\n    && make install\nENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}\n\n# ZMQ\nARG ZMQ_VERSION=v4.3.2\nARG ZMQ_HASH=a84ffa12b2eb3569ced199660bac5ad128bff1f0\nRUN set -ex \\\n    && git clone --depth=1 https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} \\\n    && cd libzmq \\\n    && test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1 \\\n    && sed -i -e 's/::~generic_mtrie_t /::~generic_mtrie_t<T> /' src/generic_mtrie_impl.hpp \\\n    && ./autogen.sh \\\n    && ./configure --enable-static --disable-shared --with-libsodium \\\n    && make -j$(nproc) \\\n    && make install \\\n    && ldconfig\n\n# Libusb\nARG USB_VERSION=v1.0.22\nARG USB_HASH=0034b2afdcdb1614e78edaa2a9e22d5936aeae5d\nRUN set -ex \\\n    && git clone --depth=1 https://github.com/libusb/libusb.git -b ${USB_VERSION} \\\n    && cd libusb \\\n    && test `git rev-parse HEAD` = ${USB_HASH} || exit 1 \\\n    && ./autogen.sh \\\n    && ./configure --disable-shared \\\n    && make -j$(nproc) \\\n    && make install\n\n# Hidapi\nARG HIDAPI_VERSION=hidapi-0.8.0-rc1\nARG HIDAPI_HASH=40cf516139b5b61e30d9403a48db23d8f915f52c\nRUN set -ex \\\n    && git clone --depth=1 https://github.com/signal11/hidapi -b ${HIDAPI_VERSION} \\\n    && cd hidapi \\\n    && test `git rev-parse HEAD` = ${HIDAPI_HASH} || exit 1 \\\n    && ./bootstrap \\\n    && ./configure --enable-static --disable-shared \\\n    && make -j$(nproc) \\\n    && make install\n\nRUN git clone https://github.com/NLnetLabs/unbound && \\\n    cd unbound && ./configure && make && make install\n\nRUN git clone --depth 1 https://github.com/monero-project/monero.git monero\nCOPY build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/monero/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 The Monero Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport BOOST_ROOT=/src/monero/boost_1_70_0\nexport OPENSSL_ROOT_DIR=/src/monero/openssl-1.1.1g\n\ncd monero\nsed -i -e 's/include(FindCcache)/# include(FindCcache)/' CMakeLists.txt\ngit submodule init\ngit submodule update\nmkdir -p build\ncd build\nexport CXXFLAGS=\"${CXXFLAGS} -fPIC -DBOOST_NO_INCLASS_MEMBER_INITIALIZATION\"\ncmake -D OSSFUZZ=ON -D STATIC=ON -D BUILD_TESTS=ON -D USE_LTO=OFF -D ARCH=\"default\" ..\n\nTESTS=\"\\\n  base58_fuzz_tests \\\n  block_fuzz_tests \\\n  transaction_fuzz_tests \\\n  load-from-binary_fuzz_tests \\\n  load-from-json_fuzz_tests \\\n  parse-url_fuzz_tests \\\n  http-client_fuzz_tests \\\n  levin_fuzz_tests \\\n  bulletproof_fuzz_tests \\\n  tx-extra_fuzz_tests \\\n  fuzz_rpc \\\n  fuzz_rpc_full \\\n  fuzz_rpc_full_no_exceptions \\\n  fuzz_zmq \\\n\"\n\n# only libfuzzer can run the slow to start ones\nif test \"x$FUZZING_ENGINE\" == 'xlibfuzzer'\nthen\n  TESTS=\"$TESTS \\\n    signature_fuzz_tests \\\n    cold-outputs_fuzz_tests \\\n    cold-transaction_fuzz_tests \\\n  \"\nfi\n\nmake -j$(nproc) -C tests/fuzz $TESTS\n\ncd /src/monero/monero/build/tests/fuzz\nfor fuzzer in *fuzz*\ndo\n  cp \"$fuzzer\" \"$OUT\"\n  base=$(echo $fuzzer | sed -e s/_fuzz_tests//)\n  basedir=\"/src/monero/monero/tests/data/fuzz/$base\"\n  if [ -d \"$basedir\" ]; then\n    pushd \"/src/monero/monero/tests/data/fuzz/$base\"\n    rm -f \"${OUT}/${fuzzer}_seed_corpus.zip\"\n    for f in *\n    do\n      h=$(sha1sum \"$f\" | awk '{print $1}')\n      cp \"$f\" \"$h\"\n      zip \"${OUT}/${fuzzer}_seed_corpus.zip\" \"$h\"\n      rm -f \"$h\"\n    done\n    popd\n  fi\ndone\n\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/monero/fuzz_rpc.options",
    "content": "[libfuzzer]\ndetect_leaks = 0\n"
  },
  {
    "path": "projects/monero/fuzz_rpc_full.options",
    "content": "[libfuzzer]\ndetect_leaks = 0\n"
  },
  {
    "path": "projects/monero/fuzz_rpc_full_no_exceptions.options",
    "content": "[libfuzzer]\ndetect_leaks = 0\n"
  },
  {
    "path": "projects/monero/fuzz_zmq.options",
    "content": "[libfuzzer]\ndetect_leaks = 0\n"
  },
  {
    "path": "projects/monero/project.yaml",
    "content": "homepage: \"https://getmonero.org/\"\nlanguage: c++\nprimary_contact: \"binaryfate01@gmail.com\"\nauto_ccs:\n  - luigi1111w@gmail.com\n  - jeffro256@volunteer.magicgrants.org\n  - justinberman95@gmail.com\n  - xmrfuzz@mm.st\n  - moneromooo@protonmail.com\n  - arthur.chan@adalogics.com\n  - david@adalogics.com\n  - adam@adalogics.com\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/monero-project/monero.git'\n"
  },
  {
    "path": "projects/mongo-go-driver/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\nRUN git clone --depth 1 https://github.com/mongodb/mongo-go-driver mongo-go-driver\n\nWORKDIR mongo-go-driver\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mongo-go-driver/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ngo run internal/cmd/build-oss-fuzz-corpus/main.go $OUT/fuzz_decode_seed_corpus.zip\n\nmv bson/fuzz_test.go bson/fuzz.go\nmv bson/bson_corpus_spec_test.go bson/bson_corpus_spec.go\n\nsed -i '/seedBSONCorpus/d' bson/fuzz.go\n\ncompile_native_go_fuzzer go.mongodb.org/mongo-driver/v2/bson FuzzDecode fuzz_decode\n"
  },
  {
    "path": "projects/mongo-go-driver/project.yaml",
    "content": "homepage: \"https://github.com/mongodb/mongo-go-driver\"\nlanguage: go\nmain_repo: \"https://github.com/mongodb/mongo-go-driver\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"dbx-go@mongodb.com\"\nauto_ccs:\n  - qingyang.hu@mongodb.com\n  - matt.dale@mongodb.com\n  - preston.vasquez@mongodb.com\n  - steve.silvester@mongodb.com\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/mongoose/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update \nRUN git clone https://github.com/cesanta/mongoose\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fuzz_netdriver_http.c $SRC/mongoose/fuzz_netdriver_http.c\n"
  },
  {
    "path": "projects/mongoose/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncd $SRC/mongoose\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -I. test/fuzz.c -o $OUT/fuzz\n\n# Fuzzer using honggfuzz netdriver.\nif [[ \"$FUZZING_ENGINE\" == \"honggfuzz\" ]]\nthen\n $CC $LIB_FUZZING_ENGINE $CFLAGS -DMG_ENABLE_LINES=1 \\\n   -DMG_DISABLE_DAV_AUTH -DMG_ENABLE_FAKE_DAVLOCK \\\n   $LIB_HFND \"$HFND_CFLAGS\" \\\n   fuzz_netdriver_http.c mongoose.c -I. -o $OUT/fuzz_netdriver_http  \\\n   -pthread\nfi\n"
  },
  {
    "path": "projects/mongoose/fuzz_netdriver_http.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"mongoose.h\"\n\nstatic void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {\n  struct mg_http_serve_opts opts = {.root_dir = \".\"};\n  if (ev == MG_EV_HTTP_MSG) {\n    // Only serve static files\n    mg_http_serve_dir(c, ev_data, &opts);\n  }\n}\n\nHFND_FUZZING_ENTRY_FUNCTION(int argc, char **argv) {\n  struct mg_mgr mgr;\n  mg_mgr_init(&mgr);\n  mg_http_listen(&mgr, \"http://0.0.0.0:8666\", fn, &mgr);\n  for (;;) mg_mgr_poll(&mgr, 1000);\n  mg_mgr_free(&mgr);\n  return 0;\n}\n"
  },
  {
    "path": "projects/mongoose/project.yaml",
    "content": "homepage: \"https://github.com/cesanta/mongoose\"\nlanguage: c++\nprimary_contact: \"info@cesanta.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/cesanta/mongoose'\n"
  },
  {
    "path": "projects/more-itertools/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/more-itertools/more-itertools more-itertools\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/more-itertools\n"
  },
  {
    "path": "projects/more-itertools/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/more-itertools/fuzz_mi.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Calls the APIs of more_itertools with random settings\"\"\"\nimport sys\nimport atheris\nimport more_itertools\n\n\ndef get_random_list(fdp, min_len=5, max_len=100):\n  return fdp.ConsumeIntList(fdp.ConsumeIntInRange(min_len, max_len), 4)\n\n\ndef check_sliced(fdp):\n  seq2 = [x for x in fdp.ConsumeUnicodeNoSurrogates(1024)]\n  try:\n    l1 = list(more_itertools.sliced(seq2, 3, strict=fdp.ConsumeBool()))\n  except ValueError:\n    pass\n\n\ndef check_windowed(fdp):\n  idxs = get_random_list(fdp)\n  try:\n    l2 = list(more_itertools.windowed(idxs, fdp.ConsumeIntInRange(1, 100)))\n    l2 = list(more_itertools.windowed(idxs, fdp.ConsumeIntInRange(-10, 100)))\n  except ValueError:\n    pass\n\n\ndef check_distinct_combinations(fdp):\n  idxs = get_random_list(fdp)\n  try:\n    l3 = list(more_itertools.distinct_combinations(\n        idxs, fdp.ConsumeIntInRange(5, 10)))\n    l3 = list(more_itertools.distinct_combinations(\n        idxs, fdp.ConsumeIntInRange(-10, 10)))\n  except ValueError:\n    pass\n\n\ndef check_substrings(fdp):\n  c3 = [''.join(s) for s in more_itertools.substrings(fdp.ConsumeUnicodeNoSurrogates(24))]\n\n\ndef check_substrings_indexes(fdp):\n  l1 = get_random_list(fdp)\n  try:\n    list(more_itertools.substrings_indexes(l1))\n  except ValueError:\n    pass\n\n\ndef check_locate(fdp):\n  l1 = get_random_list(fdp)\n  try:\n    list(more_itertools.locate(l1))\n  except ValueError:\n    pass\n\n\ndef check_islice_extended(fdp):\n  l1 = get_random_list(fdp)\n  try:\n    list(more_itertools.islice_extended(l1, 3, 10))\n  except ValueError:\n    pass\n\n\ndef check_interleave_evenly(fdp):\n  l1 = get_random_list(fdp)\n  l2 = get_random_list(fdp)\n  try:\n    list(more_itertools.interleave_evenly([l1, l2]))\n  except ValueError:\n    pass\n\n\ndef check_collapse(fdp):\n  l1 = get_random_list(fdp)\n  try:\n    list(more_itertools.collapse(l1))\n  except ValueError:\n    pass\n  \n\ndef check_chunked(fdp):\n  l1 = get_random_list(fdp)\n  try:\n    list(more_itertools.chunked(l1, n=fdp.ConsumeIntInRange(-10, 100)))\n  except ValueError:\n    pass\n\n\ndef check_intersperse(fdp):\n  l1 = get_random_list(fdp)\n  try:\n    list(more_itertools.intersperse('a', l1))\n  except ValueError:\n    pass\n  \n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  targets = [\n    check_sliced,\n    check_windowed,\n    check_distinct_combinations,\n    check_substrings,\n    check_interleave_evenly,\n    check_chunked,\n    check_intersperse,\n    check_substrings_indexes,\n    check_locate,\n    check_islice_extended,\n  ]\n\n  target = fdp.PickValueInList(targets)\n  target(fdp)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/more-itertools/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/more-itertools/more-itertools\nlanguage: python\nmain_repo: https://github.com/more-itertools/more-itertools\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/mosh/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake protobuf-compiler \\\n    libprotobuf-dev pkg-config zlib1g-dev libncurses5-dev libssl-dev clang lcov\nRUN git clone --depth 1 https://github.com/mobile-shell/mosh.git\nWORKDIR mosh\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/mosh/build.sh",
    "content": "#!/bin/sh\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -eu\n\n./autogen.sh\n\n# Sniff $CXXFLAGS to figure out what to pass to ./configure.\nconfigure_flags=\ncase $CXXFLAGS in\n  *-fsanitize=address*)\n    configure_flags=\"$configure_flags --enable-asan\"\n    ;;\nesac\ncase $CXXFLAGS in\n  *-fcoverage*)\n    configure_flags=\"$configure_flags --enable-code-coverage\"\n    ;;\nesac\n\n# Use libstdc++, not libc++, since the base image's prebuild libraries require\n# libstdc++.\nexport CXXFLAGS=\"$CXXFLAGS -stdlib=libstdc++\"\n\n# Clear CFLAGS and CXXFLAGS during configure tests so configure won't try to\n# link with -fsanitize=fuzz.\nCFLAGS= CXXFLAGS= ./configure --disable-silent-rules --enable-fuzzing --enable-static-libraries $configure_flags\n\nn=$(nproc)\nmake -j$n CFLAGS+=\"$CFLAGS\" CXXFLAGS+=\"$CXXFLAGS\"\n\ncd src/fuzz\n\nmake -j$n CFLAGS+=\"$CFLAGS\" CXXFLAGS+=\"$CXXFLAGS\"\n\nfor fuzzer in *_fuzzer; do\n  cp $fuzzer $OUT\n\n  corpus=${fuzzer%_fuzzer}_corpus\n  if [ -d $corpus ]; then\n    zip -j $OUT/${fuzzer}_seed_corpus.zip $corpus/*\n  fi\ndone\n"
  },
  {
    "path": "projects/mosh/project.yaml",
    "content": "homepage: \"https://mosh.org\"\nprimary_contact: \"keithw@cs.stanford.edu\"\nauto_ccs:\n  - \"cgull@glup.org\"\n  - \"andersk@mit.edu\"\n  - \"alex@achernya.com\"\n  - \"bbarenblat@gmail.com\"\n  - \"mosh-security@mit.edu\"\nlanguage: c++\nmain_repo: \"https://github.com/mobile-shell/mosh.git\"\nfile_github_issue: true\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/mosh/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/mosquitto/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Main repo\nRUN git clone --depth 1 -b develop https://github.com/eclipse-mosquitto/mosquitto ${SRC}/mosquitto\n\n# Build LPM separately to other deps to allow better caching\nRUN apt-get update && apt-get install -y \\\n\tautoconf \\\n\tbinutils \\\n\tcmake \\\n\tliblzma-dev \\\n\tlibtool \\\n\tlibz-dev \\\n\tmake  \\\n\tninja-build \\\n\tpkg-config\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON \\\n    -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja)\n\n# Get dependencies\nRUN $SRC/mosquitto/fuzzing/scripts/oss-fuzz-dependencies.sh\n\nWORKDIR $SRC/mosquitto\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mosquitto/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run build script from the mosquitto repo\n./fuzzing/scripts/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/mosquitto/project.yaml",
    "content": "homepage: \"https://mosquitto.org/\"\nlanguage: c\nprimary_contact: \"roger@atchoo.org\"\nauto_ccs:\n - \"security@eclipse.org\"\n - \"rogerlight@gmail.com\"\nsanitizers:\n - address\n - memory:\n    experimental: True\n - undefined\nmain_repo: 'https://github.com/eclipse-mosquitto/mosquitto'\n"
  },
  {
    "path": "projects/mp4parse-rust/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl cmake python llvm-dev libclang-dev clang\n\nRUN git clone --depth 1 --recursive https://github.com/mozilla/mp4parse-rust mp4parse-rust\nWORKDIR mp4parse-rust\n\nCOPY build.sh default.options $SRC/\n"
  },
  {
    "path": "projects/mp4parse-rust/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Note: This project creates Rust fuzz targets exclusively\nPROJECT_DIR=$SRC/mp4parse-rust\ncd $PROJECT_DIR/mp4parse_capi/fuzz && cargo fuzz build -O --debug-assertions\n\n# collect avif files\nmkdir $PROJECT_DIR/avif_corpus\nfind $PROJECT_DIR/mp4parse -type f -name '*.avif' -exec cp '{}' $PROJECT_DIR/avif_corpus \\;\n\n# collect mp4 files\nmkdir $PROJECT_DIR/mp4_corpus\nfind $PROJECT_DIR/mp4parse/tests -type f -name '*.mp4' -exec cp '{}' $PROJECT_DIR/mp4_corpus \\;\nfind $PROJECT_DIR/mp4parse_capi/tests/ -type f -name '*.mp4' -exec cp '{}' $PROJECT_DIR/mp4_corpus \\;\n\nFUZZ_TARGET_OUTPUT_DIR=$PROJECT_DIR/mp4parse_capi/fuzz/target/x86_64-unknown-linux-gnu/release\nfor f in $SRC/mp4parse-rust/mp4parse_capi/fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\n    cp $PROJECT_DIR/mp4parse_capi/fuzz/mp4.dict $OUT/$FUZZ_TARGET_NAME.dict\n    cp $SRC/default.options $OUT/$FUZZ_TARGET_NAME.options\n    zip -jr $OUT/${FUZZ_TARGET_NAME}_seed_corpus.zip $PROJECT_DIR/${FUZZ_TARGET_NAME}_corpus/\ndone\n"
  },
  {
    "path": "projects/mp4parse-rust/default.options",
    "content": "[asan]\nmax_allocation_size_mb=512\n"
  },
  {
    "path": "projects/mp4parse-rust/project.yaml",
    "content": "homepage: \"https://github.com/mozilla/mp4parse-rust\"\nprimary_contact: \"mgregan@mozilla.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nvendor_ccs:\n- \"media-alerts@mozilla.com\"\n- \"twsmith@mozilla.com\"\nmain_repo: 'https://github.com/mozilla/mp4parse-rust'\n"
  },
  {
    "path": "projects/mp4san/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/signalapp/mp4san mp4san\nWORKDIR mp4san\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mp4san/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nPROJECT_DIR=$SRC/mp4san\n\nfor crate_dir in mp4san webpsan; do\n    FUZZ_DIR=$PROJECT_DIR/$crate_dir/fuzz\n    cd $FUZZ_DIR && cargo fuzz build -O --debug-assertions\n\n    FUZZ_INPUT_DIR=$FUZZ_DIR/input\n\n    FUZZ_TARGET_OUTPUT_DIR=$FUZZ_DIR/target/x86_64-unknown-linux-gnu/release/\n    for fuzz_target in $FUZZ_DIR/fuzz_targets/*.rs\n    do\n        FUZZ_TARGET_NAME=$(basename ${fuzz_target%.*})\n        OUT_FUZZ_TARGET_NAME=$crate_dir-$FUZZ_TARGET_NAME\n        cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/$OUT_FUZZ_TARGET_NAME\n        cat $FUZZ_DIR/*.dict > $OUT/$OUT_FUZZ_TARGET_NAME.dict\n        zip -jr $OUT/${OUT_FUZZ_TARGET_NAME}_seed_corpus.zip $FUZZ_INPUT_DIR/\n    done\ndone\n"
  },
  {
    "path": "projects/mp4san/project.yaml",
    "content": "homepage: \"https://github.com/signalapp/mp4san\"\nlanguage: rust\nprimary_contact: \"usual.beach5937@jessacake.com\"\nmain_repo: \"https://github.com/signalapp/mp4san\"\nauto_ccs:\n  - \"jrose@signal.org\"\n  - \"ehren@signal.org\"\nvendor_ccs:\n  - \"security@signal.org\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/mpg123/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget \\\n  bzip2\nRUN wget https://www.mpg123.de/snapshot\nRUN tar -xvf snapshot\nRUN mv mpg123* mpg123\nWORKDIR $SRC\nCOPY read_fuzzer.c decode_fuzzer.cc build.sh $SRC/\n"
  },
  {
    "path": "projects/mpg123/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd mpg123\n./configure --prefix=$WORK --enable-static\nmake -j$(nproc)\nmake install\npopd\n\n$CC $CXXFLAGS read_fuzzer.c -I$WORK/include $WORK/lib/libmpg123.a \\\n  $LIB_FUZZING_ENGINE -lc++ -o $OUT/read_fuzzer\n\n$CXX $CXXFLAGS decode_fuzzer.cc -I$WORK/include $WORK/lib/libmpg123.a \\\n  $LIB_FUZZING_ENGINE -o $OUT/decode_fuzzer\n"
  },
  {
    "path": "projects/mpg123/decode_fuzzer.cc",
    "content": "#include <fuzzer/FuzzedDataProvider.h>\n\n#include <cstddef>\n#include <cstdint>\n#include <cstdio>\n#include <cstdlib>\n#include <vector>\n\n#include \"mpg123.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static bool initialized = false;\n  if (!initialized) {\n    mpg123_init();\n    initialized = true;\n  }\n  int ret;\n  mpg123_handle* handle = mpg123_new(nullptr, &ret);\n  if (handle == nullptr) {\n    return 0;\n  }\n\n  ret = mpg123_param(handle, MPG123_ADD_FLAGS, MPG123_QUIET, 0.);\n  if(ret == MPG123_OK)\n    ret = mpg123_open_feed(handle);\n  if (ret != MPG123_OK) {\n    mpg123_delete(handle);\n    return 0;\n  }\n\n  std::vector<uint8_t> output_buffer(mpg123_outblock(handle));\n\n  size_t output_written = 0;\n  // Initially, start by feeding the decoder more data.\n  int decode_ret = MPG123_NEED_MORE;\n  FuzzedDataProvider provider(data, size);\n  while ((decode_ret != MPG123_ERR)) {\n    if (decode_ret == MPG123_NEED_MORE) {\n      if (provider.remaining_bytes() == 0\n          || mpg123_tellframe(handle) > 10000\n          || mpg123_tell_stream(handle) > 1<<20) {\n        break;\n      }\n      const size_t next_size = provider.ConsumeIntegralInRange<size_t>(\n          0,\n          provider.remaining_bytes());\n      auto next_input = provider.ConsumeBytes<unsigned char>(next_size);\n      decode_ret = mpg123_decode(handle, next_input.data(), next_input.size(),\n                                 output_buffer.data(), output_buffer.size(),\n                                 &output_written);\n    } else if (decode_ret != MPG123_ERR && decode_ret != MPG123_NEED_MORE) {\n      decode_ret = mpg123_decode(handle, nullptr, 0, output_buffer.data(),\n                                 output_buffer.size(), &output_written);\n    } else {\n      // Unhandled mpg123_decode return value.\n      abort();\n    }\n  }\n\n  mpg123_delete(handle);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/mpg123/project.yaml",
    "content": "homepage: \"https://www.mpg123.de\"\nlanguage: c++\nprimary_contact: \"maintainer@mpg123.org\"\nmain_repo: \"https://github.com/dreamerc/mpg123\"\nsanitizers:\n  - address\n  - undefined\n  - memory\n\nlabels:\n  read_fuzzer:\n    - sundew\n  decode_fuzzer:\n    - sundew\n"
  },
  {
    "path": "projects/mpg123/read_fuzzer.c",
    "content": "#include <stddef.h>\n#include <unistd.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>\n#include <string.h>\n\n#include \"mpg123.h\"\n\nstatic char* fuzzer_get_tmpfile(const uint8_t* data, size_t size) {\n  char* filename_buffer = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n  if (!filename_buffer) {\n    perror(\"Failed to allocate file name buffer.\");\n    abort();\n  }\n  const int file_descriptor = mkstemp(filename_buffer);\n  if (file_descriptor < 0) {\n    perror(\"Failed to make temporary file.\");\n    abort();\n  }\n  FILE* file = fdopen(file_descriptor, \"wb\");\n  if (!file) {\n    perror(\"Failed to open file descriptor.\");\n    close(file_descriptor);\n    abort();\n  }\n  const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);\n  if (bytes_written < size) {\n    close(file_descriptor);\n    fprintf(stderr, \"Failed to write all bytes to file (%zu out of %zu)\",\n            bytes_written, size);\n    abort();\n  }\n  fclose(file);\n  return filename_buffer;\n}\n\nstatic void fuzzer_release_tmpfile(char* filename) {\n  if (unlink(filename) != 0) {\n    perror(\"WARNING: Failed to delete temporary file.\");\n  }\n  free(filename);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static bool initialized = false;\n  if (!initialized) {\n    mpg123_init();\n    initialized = true;\n  }\n  char* filename = fuzzer_get_tmpfile(data, size);\n  if (filename == NULL) {\n    return 0;\n  }\n\n  size_t outmemorysize = size * 2;  // Guess based on the size of data.\n  unsigned char* outmemory = (unsigned char*)malloc(outmemorysize);\n  if (outmemory == NULL) {\n    fuzzer_release_tmpfile(filename);\n    return 0;\n  }\n\n  int error;\n  mpg123_handle* handle = mpg123_new(NULL, &error);\n  if (handle == NULL || mpg123_param(handle,\n      MPG123_ADD_FLAGS, MPG123_QUIET, 0.) != MPG123_OK) {\n    free(outmemory);\n    fuzzer_release_tmpfile(filename);\n    return 0;\n  }\n\n  if (mpg123_open(handle, filename) == MPG123_OK) {\n    int read_error;\n    do {\n      size_t decoded_size;\n      read_error = mpg123_read(handle, outmemory, outmemorysize, &decoded_size);\n    } while (read_error == MPG123_OK && mpg123_tellframe(handle) <= 10000\n          && mpg123_tell_stream(handle) <= 1<<20);\n  }\n\n  mpg123_close(handle);\n  mpg123_delete(handle);\n  free(outmemory);\n  fuzzer_release_tmpfile(filename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/mpv/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y nasm pkgconf gperf zip rsync && \\\n    apt-get clean -y\n\nENV PYTHONDONTWRITEBYTECODE=1\nENV VIRTUAL_ENV=$SRC/venv\nENV PATH=\"$VIRTUAL_ENV/bin:$PATH\"\n\n# Meson is pinned to get around https://github.com/mesonbuild/meson/issues/14524\nRUN python -m venv $VIRTUAL_ENV && \\\n    python -m pip --no-cache-dir install meson==1.7.2 ninja\n\nRUN git clone --depth 1 https://github.com/mpv-player/mpv mpv\nRUN git clone --depth 1 https://github.com/FFmpeg/FFmpeg ffmpeg\nRUN git clone --depth 1 --recursive https://github.com/haasn/libplacebo mpv/subprojects/libplacebo\nRUN git clone --depth 1 https://github.com/libass/libass mpv/subprojects/libass\nRUN mkdir mpv/subprojects -p && cd mpv && \\\n    meson wrap install expat && \\\n    meson wrap install fontconfig && \\\n    meson wrap install freetype2 && \\\n    meson wrap install fribidi && \\\n    meson wrap install harfbuzz && \\\n    meson wrap install lcms2 && \\\n    meson wrap install uchardet && \\\n    meson wrap install xxhash && \\\n    meson subprojects download\n\nWORKDIR $SRC/mpv\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mpv/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nif [[ \"$ARCHITECTURE\" == i386 ]]; then\n  export PKG_CONFIG_PATH=/usr/local/lib/i386-linux-gnu/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig\n  LIBDIR='lib/i386-linux-gnu'\n  FFMPEG_BUILD_ARGS='--arch=\"i386\" --cpu=\"i386\" --disable-inline-asm'\n  RUST_TARGET='i686-unknown-linux-gnu'\n  rustup target add $RUST_TARGET\nelse\n  LIBDIR='lib/x86_64-linux-gnu'\n  FFMPEG_BUILD_ARGS=''\n  RUST_TARGET='x86_64-unknown-linux-gnu'\n  rustup target add $RUST_TARGET\nfi\n\nexport RUSTC=\"rustc --target=$RUST_TARGET\"\n\nexport FUZZ_INTROSPECTOR_CONFIG=$SRC/fuzz_introspector_exclusion.config\ncat > $FUZZ_INTROSPECTOR_CONFIG <<EOF\nFILES_TO_AVOID\nffmpeg\nmpv/subprojects\nmpv/build/subprojects\nEOF\n\npushd $SRC/ffmpeg\n./configure --cc=$CC --cxx=$CXX --ld=\"$CXX $CXXFLAGS\" \\\n            --enable-{gpl,nonfree} \\\n            --disable-{asm,bsfs,doc,encoders,filters,muxers,network,programs,shared} \\\n            --enable-filter={sine,yuvtestsrc} \\\n            --pkg-config-flags=\"--static\" \\\n            --disable-{debug,optimizations} \\\n            --optflags=-O1 \\\n            $FFMPEG_BUILD_ARGS\nmake -j`nproc`\nmake install\npopd\n\n# The option `-fuse-ld=gold` can't be passed via `CFLAGS` or `CXXFLAGS` because\n# Meson injects `-Werror=ignored-optimization-argument` during compile tests.\n# Remove the `-fuse-ld=` and let Meson handle it.\n# https://github.com/mesonbuild/meson/issues/6377#issuecomment-575977919\nif [[ \"$CFLAGS\" == *\"-fuse-ld=gold\"* ]]; then\n    export CFLAGS=\"${CFLAGS//-fuse-ld=gold/}\"\n    export CC_LD=gold\nfi\nif [[ \"$CXXFLAGS\" == *\"-fuse-ld=gold\"* ]]; then\n    export CXXFLAGS=\"${CXXFLAGS//-fuse-ld=gold/}\"\n    export CXX_LD=gold\nfi\n\n# Use `src_root` which should be extracted even with selective_unpack == true\n# https://github.com/google/clusterfuzz/blob/e2e2b9697dd990c4784b7226ff244e099a118a61/src/clusterfuzz/_internal/build_management/build_archive.py#L51\n# https://github.com/google/clusterfuzz/blob/e2e2b9697dd990c4784b7226ff244e099a118a61/src/clusterfuzz/_internal/build_management/build_archive.py#L164-L173\nFC_SYSROOT=\"src_root/fc_sysroot\"\n\npushd $SRC/mpv\nsed -i -e \"/^\\s*flags += \\['-fsanitize=address,undefined,fuzzer', '-fno-omit-frame-pointer'\\]/d; \\\n          s|^\\s*link_flags += \\['-fsanitize=address,undefined,fuzzer', '-fno-omit-frame-pointer'\\]| \\\n          link_flags += \\['$LIB_FUZZING_ENGINE'\\]|\" meson.build\n\nmeson setup build --wrap-mode=nodownload -Dbuildtype=plain -Dbackend_max_links=4 -Ddefault_library=static -Dprefer_static=true \\\n                  -Dfuzzers=true -Dlibmpv=true -Dcplayer=false -Dgpl=true \\\n                  -Duchardet=enabled -Dlcms2=enabled -Dtests=false \\\n                  -Dfreetype2:harfbuzz=disabled -Dfreetype2:zlib=disabled -Dfreetype2:png=disabled \\\n                  -Dharfbuzz:tests=disabled -Dharfbuzz:introspection=disabled -Dharfbuzz:docs=disabled \\\n                  -Dharfbuzz:utilities=disabled -Dfontconfig:doc=disabled -Dfontconfig:nls=disabled -Dfontconfig:xml-backend=expat \\\n                  -Dfontconfig:tests=disabled -Dfontconfig:tools=disabled -Dfontconfig:cache-build=disabled \\\n                  -Dfribidi:deprecated=false -Dfribidi:docs=false -Dfribidi:bin=false -Dfribidi:tests=false \\\n                  -Dlibplacebo:lcms=enabled -Dlibplacebo:xxhash=enabled -Dlibplacebo:demos=false \\\n                  -Dlcms2:jpeg=disabled -Dlcms2:tiff=disabled \\\n                  -Dlibass:fontconfig=enabled -Dlibass:asm=disabled \\\n                  -Dc_args=\"$CFLAGS\" -Dcpp_args=\"$CXXFLAGS -DMPV_FONTCONFIG_SYSROOT=./$FC_SYSROOT\" \\\n                  -Dc_link_args=\"$CFLAGS\" -Dcpp_link_args=\"$CXXFLAGS\" \\\n                  --libdir $LIBDIR\nmeson compile -C build fuzzers\n\nfind ./build/fuzzers -maxdepth 1 -type f -name 'fuzzer_*' -exec mv {} \"$OUT\" \\; -exec echo \"{} -> $OUT\" \\;\n\nDESTDIR=\"$OUT/$FC_SYSROOT\" meson install -C build --tags runtime\nmkdir -p $OUT/$FC_SYSROOT/usr/local/share/fonts\ncurl -L https://github.com/libass/libass-tests/raw/613d615deaa48863ce6bd731762696a186c6fd17/regression/.fonts/FansubBlock-CFF.otf -o \"$OUT/$FC_SYSROOT/usr/local/share/fonts/FansubBlock-CFF.otf\"\n\nrsync --no-compress -av rsync://samples.ffmpeg.org/samples/Matroska $SRC/matroska\nzip -0 -r $OUT/fuzzer_loadfile_mkv_seed_corpus.zip $SRC/matroska -i '*.mkv' '*.mka'\n"
  },
  {
    "path": "projects/mpv/project.yaml",
    "content": "homepage: \"https://github.com/mpv-player/mpv\"\nmain_repo: \"https://github.com/mpv-player/mpv\"\nlanguage: c\nprimary_contact: \"kasper93@gmail.com\"\nauto_ccs:\n  - \"jeebjp@gmail.com\"\narchitectures:\n  - x86_64\n  - i386\nsanitizers:\n  - address\n  - memory\n  - undefined\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nselective_unpack: true\ncoverage_extra_args: >\n  -ignore-filename-regex=mpv/subprojects/.*\n  -ignore-filename-regex=mpv/build/subprojects/.*\n  -ignore-filename-regex=ffmpeg/.*\n"
  },
  {
    "path": "projects/mrab-regex/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/mrabarnett/mrab-regex mrab-regex\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/mrab-regex\n"
  },
  {
    "path": "projects/mrab-regex/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Compile native lib with sanitizers\npython3 -m pip install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/mrab-regex/fuzz_match.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport regex\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    x = regex.match(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n    )\n  except regex._regex_core.error:\n    pass\n  except ValueError:\n    # Compile throws several ValueErrors\n    pass\n  except RecursionError:\n    # uninteresting\n    pass\n\n  try:\n    x = regex.fullmatch(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n    )\n  except regex._regex_core.error:\n    pass\n  except ValueError:\n    # Compile throws several ValueErrors\n    pass\n  except RecursionError:\n    # uninteresting\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/mrab-regex/fuzz_regex.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport regex\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  # Random compilation\n  try:\n    x = regex.compile(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except regex._regex_core.error:\n    pass\n  except ValueError:\n    # Compile throws several ValueErrors\n    pass\n  except RecursionError:\n    # uninteresting\n    pass\n\n  # Target regex.sub\n  try:\n    s1 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))\n    s2 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))\n    s3 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))\n    regex.sub(s1, s2, s3)\n  except regex._regex_core.error:\n    pass\n  except ValueError:\n    # Compile throws several ValueErrors\n    pass\n  except RecursionError:\n    # uninteresting\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/mrab-regex/fuzz_search.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport regex\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    x = regex.search(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n    )\n  except regex._regex_core.error:\n    pass\n  except ValueError:\n    # Compile throws several ValueErrors\n    pass\n  except RecursionError:\n    # uninteresting\n    pass\n\n  try:\n    x = regex.findall(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n    )\n  except regex._regex_core.error:\n    pass\n  except ValueError:\n    # Compile throws several ValueErrors\n    pass\n  except RecursionError:\n    # uninteresting\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/mrab-regex/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/mrabarnett/mrab-regex\nlanguage: python\nmain_repo: https://github.com/mrabarnett/mrab-regex\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/mruby/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y build-essential ruby bison ninja-build \\\n    cmake zlib1g-dev libbz2-dev liblzma-dev\nRUN git clone --depth 1 https://github.com/mruby/mruby mruby\nRUN git clone --depth 1 https://github.com/bshastry/mruby_seeds.git mruby_seeds\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN mkdir LPM; \\\n  cd LPM; \\\n  cmake $SRC/libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release; \\\n  ninja;\n\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/mruby/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Instrument mruby\n(\ncd $SRC/mruby\nexport LD=$CC\nexport LDFLAGS=\"$CFLAGS\"\nrake all\n\n# This should be allowed to fail. So long as it does not fail in `run_tests.sh`\nrake test || true\n\n# build fuzzers\nFUZZ_TARGET=$SRC/mruby/oss-fuzz/mruby_fuzzer.c\nname=$(basename $FUZZ_TARGET .c)\n$CC -c $CFLAGS -Iinclude -Ibuild/host/include \\\n     ${FUZZ_TARGET} -o $OUT/${name}.o\n$CXX $CXXFLAGS $OUT/${name}.o $LIB_FUZZING_ENGINE -lm \\\n    $SRC/mruby/build/host/lib/libmruby.a -o $OUT/${name}\nrm -f $OUT/${name}.o\n)\n\n# Construct options files\ncat > $SRC/mruby/oss-fuzz/config/mruby_fuzzer.options <<EOF\n[libfuzzer]\ndict = mruby.dict\nonly_ascii = 1\nEOF\ncp $SRC/mruby/oss-fuzz/config/mruby_fuzzer.options $SRC/mruby/oss-fuzz/config/mruby_proto_fuzzer.options\n\n# Build proto fuzzer: ASan and UBSan\nif [[ $CFLAGS != *sanitize=memory* ]]; then\n    PROTO_FUZZ_TARGET=$SRC/mruby/oss-fuzz/mruby_proto_fuzzer.cpp\n    PROTO_CONVERTER=$SRC/mruby/oss-fuzz/proto_to_ruby.cpp\n    rm -rf $SRC/mruby/genfiles\n    mkdir $SRC/mruby/genfiles\n    $SRC/LPM/external.protobuf/bin/protoc --proto_path=$SRC/mruby/oss-fuzz ruby.proto --cpp_out=$SRC/mruby/genfiles\n    $CXX -c $CXXFLAGS $SRC/mruby/genfiles/ruby.pb.cc -DNDEBUG -o $SRC/mruby/genfiles/ruby.pb.o -I $SRC/LPM/external.protobuf/include\n    $CXX -I $SRC/mruby/include -I $SRC/mruby/build/host/include -I $SRC/LPM/external.protobuf/include $CXXFLAGS $PROTO_FUZZ_TARGET $SRC/mruby/genfiles/ruby.pb.o $PROTO_CONVERTER \\\n      -I $SRC/mruby/genfiles \\\n      -I $SRC/libprotobuf-mutator \\\n      -lz -lm \\\n      $SRC/LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n      $SRC/LPM/src/libprotobuf-mutator.a \\\n      -Wl,--start-group $SRC/LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n      $SRC/mruby/build/host/lib/libmruby.a \\\n      $LIB_FUZZING_ENGINE \\\n      -o $OUT/mruby_proto_fuzzer\n\n    # Copy config\n    cp $SRC/mruby/oss-fuzz/config/mruby_proto_fuzzer.options $OUT\nfi\n\n# dict and config\ncp $SRC/mruby/oss-fuzz/config/mruby.dict $OUT\ncp $SRC/mruby/oss-fuzz/config/mruby_fuzzer.options $OUT\n\n# seeds\nzip -rq $OUT/mruby_fuzzer_seed_corpus $SRC/mruby_seeds\n"
  },
  {
    "path": "projects/mruby/project.yaml",
    "content": "homepage: https://www.mruby.org/\nlanguage: c++\nprimary_contact: \"yukihiro@gmail.com\"\nauto_ccs:\n  - \"bshas3@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/mruby/mruby'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/mruby/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n(\nexport LD=$CC\nexport LDFLAGS=\"$CFLAGS\"\ncd $SRC/mruby\nrake test > /tmp/test.out 2>&1\n)\n\n# There are two test runs, each of which executes many tests. Neither of these\n# must have crashing tests and that they have successful tests as well.\n# For the first batch We expect 165x tests to succeed and some tests skipped,\n# and 100 for the second batch.\n# I suspect the skipping causes\n# rake to return an error code. However, in normal circumastances we see\n# 9 tests skipped.\ngrep \"OK: 165\" /tmp/test.out\ngrep \"OK: 100\" /tmp/test.out\n\nif [[ `grep \"Crash: 0\" /tmp/test.out | wc -l` != '2' ]]; then\n    exit 1\nfi\nif [[ `grep \"KO: 0\" /tmp/test.out | wc -l` != '2' ]]; then\n    exit 1\nfi\n"
  },
  {
    "path": "projects/ms-tpm-20-ref/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y autoconf-archive libssl-dev pkg-config\nRUN git clone --depth=1 https://github.com/microsoft/ms-tpm-20-ref\nRUN git clone --depth=1 https://github.com/tklengyel/tpm2-command-corpus\nCOPY build.sh $SRC/\nCOPY libfuzzer.patch $SRC/\nCOPY tpm_cmd.options $SRC/\nRUN cd ms-tpm-20-ref && git apply $SRC/libfuzzer.patch\n"
  },
  {
    "path": "projects/ms-tpm-20-ref/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\ncd ms-tpm-20-ref/TPMCmd\n./bootstrap\n./configure --enable-libfuzzer\nmake\ncp fuzzer/tpm_cmd $OUT\ncp $SRC/tpm_cmd.options $OUT\ncp $SRC/tpm2-command-corpus/tpm_cmd_seed_corpus.zip $OUT\n"
  },
  {
    "path": "projects/ms-tpm-20-ref/libfuzzer.patch",
    "content": "From 8ef6bed7380397195d952573b206fb2f83d28a84 Mon Sep 17 00:00:00 2001\nMessage-Id: <8ef6bed7380397195d952573b206fb2f83d28a84.1717588949.git.tamas.lengyel@intel.com>\nFrom: Tamas K Lengyel <tamas.lengyel@intel.com>\nDate: Thu, 15 Jun 2023 15:28:24 +0000\nSubject: [PATCH] Fuzzing harness for the TPM2 CMD interface\n\nThis is a crude attempt at structure aware fuzzing of TPM2 commands. We fix up\ncommand header to have correct session tag, size and valid command code if the\nfuzzer didn't manage to generate a valid one. The fuzzer will exercises the\nrest of the command body as it chooses.\n\nThe real trick to get deep into the TPM2 is to issue startups & shutdowns.\nSending commands to a TPM that's not started will have limited reach\n(but can still find bugs).\n\nSigned-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>\n---\n TPMCmd/Makefile.am      |  24 ++-\n TPMCmd/configure.ac     |  18 ++\n TPMCmd/fuzzer/tpm_cmd.c | 442 ++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 483 insertions(+), 1 deletion(-)\n create mode 100644 TPMCmd/fuzzer/tpm_cmd.c\n\ndiff --git a/TPMCmd/Makefile.am b/TPMCmd/Makefile.am\nindex 1df7a5e..0cf316f 100644\n--- a/TPMCmd/Makefile.am\n+++ b/TPMCmd/Makefile.am\n@@ -43,12 +43,32 @@ libplatform = Platform/src/libplatform.a\n libtpm = tpm/src/libtpm.a\n tpm2_simulator = Simulator/src/tpm2-simulator\n \n-bin_PROGRAMS = $(tpm2_simulator)\n+bin_PROGRAMS =\n noinst_LIBRARIES = $(libplatform) $(libtpm)\n \n Platform_src_libplatform_a_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) $(TPM_INC)\n Platform_src_libplatform_a_SOURCES = $(PLATFORM_C) $(PLATFORM_H)\n \n+if LIBFUZZER\n+bin_PROGRAMS += fuzzer/tpm_cmd\n+fuzzer_tpm_cmd_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) \\\n+    $(TPM_INC) $(LIBCRYPTO_CFLAGS) $(PTHREAD_CFLAGS) \\\n+    -DLIBFUZZER\n+fuzzer_tpm_cmd_LDADD = $(libplatform) $(libtpm) \\\n+    $(libplatform) $(LIBCRYPTO_LIBS) $(PTHREAD_LIBS) @ADDITIONAL_LIBS@\n+fuzzer_tpm_cmd_LDFLAGS = -fsanitize=fuzzer\n+fuzzer_tpm_cmd_SOURCES = fuzzer/tpm_cmd.c\n+else\n+if COVERAGE\n+bin_PROGRAMS += fuzzer/tpm_cmd\n+fuzzer_tpm_cmd_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) \\\n+    $(TPM_INC) $(LIBCRYPTO_CFLAGS) $(PTHREAD_CFLAGS) \\\n+    -DCOVERAGE\n+fuzzer_tpm_cmd_LDADD = $(libplatform) $(libtpm) \\\n+    $(libplatform) $(LIBCRYPTO_LIBS) $(PTHREAD_LIBS) @ADDITIONAL_LIBS@\n+fuzzer_tpm_cmd_SOURCES = fuzzer/tpm_cmd.c\n+else\n+bin_PROGRAMS += $(tpm2_simulator)\n Simulator_src_tpm2_simulator_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) \\\n     $(TPM_INC) $(SIMULATOR_INC) $(LIBCRYPTO_CFLAGS) $(PTHREAD_CFLAGS)\n # the weird / duplicate static library is necessary for dealing with the\n@@ -56,6 +76,8 @@ Simulator_src_tpm2_simulator_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) \\\n Simulator_src_tpm2_simulator_LDADD = $(libplatform) $(libtpm) \\\n     $(libplatform) $(LIBCRYPTO_LIBS) $(PTHREAD_LIBS) @ADDITIONAL_LIBS@\n Simulator_src_tpm2_simulator_SOURCES = $(SIMULATOR_C) $(SIMULATOR_H)\n+endif\n+endif\n \n tpm_src_libtpm_a_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) $(TPM_INC) \\\n     $(LIBCRYPTO_CFLAGS)\ndiff --git a/TPMCmd/configure.ac b/TPMCmd/configure.ac\nindex 58a74b4..fb3ea57 100644\n--- a/TPMCmd/configure.ac\n+++ b/TPMCmd/configure.ac\n@@ -75,6 +75,24 @@ ADD_COMPILER_FLAG([-Wno-error=pointer-to-int-cast])\n ADD_COMPILER_FLAG([-Wno-error=missing-braces])\n ADD_COMPILER_FLAG([-Wno-error=unused-result])\n \n+AC_ARG_ENABLE(libfuzzer,\n+    AS_HELP_STRING([--enable-libfuzzer],\n+    [Build libfuzzer driver with ASAN/UBSAN/LEAKSAN]))\n+AM_CONDITIONAL([LIBFUZZER], [test x$enable_libfuzzer = xyes])\n+\n+AS_IF([test \"x$enable_libfuzzer\" = \"xyes\"], [\n+    ADD_COMPILER_FLAG([-DNDEBUG])\n+])\n+\n+AC_ARG_ENABLE(coverage,\n+    AS_HELP_STRING([--enable-coverage],\n+    [Build tpm_cmd with coverage]))\n+AM_CONDITIONAL([COVERAGE], [test x$enable_coverage = xyes])\n+\n+AS_IF([test \"x$enable_coverage\" = \"xyes\"], [\n+    ADD_COMPILER_FLAG([-DNDEBUG])\n+])\n+\n AS_IF([test \"x$enable_usedeviceid\" = \"xyes\"], [\n     ADD_COMPILER_FLAG([-DNDEBUG])\n     ADD_COMPILER_FLAG([-g])\ndiff --git a/TPMCmd/fuzzer/tpm_cmd.c b/TPMCmd/fuzzer/tpm_cmd.c\nnew file mode 100644\nindex 0000000..1fe6f8f\n--- /dev/null\n+++ b/TPMCmd/fuzzer/tpm_cmd.c\n@@ -0,0 +1,442 @@\n+// Copyright 2024 Google LLC\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//      http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+#include \"TpmBuildSwitches.h\"\n+#include <stdlib.h>\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <stdbool.h>\n+#include <ctype.h>\n+#include <string.h>\n+#include <sys/types.h>\n+#include <unistd.h>\n+\n+#include \"Manufacture_fp.h\"\n+#include \"Platform_fp.h\"\n+\n+#define TPM_ST_NO_SESSIONS 0x8001\n+#define TPM_ST_SESSIONS 0x8002\n+\n+enum tpm_cc {\n+    TPM_CC_NV_UndefineSpaceSpecial,\n+    TPM_CC_EvictControl,\n+    TPM_CC_HierarchyControl,\n+    TPM_CC_NV_UndefineSpace,\n+    TPM_CC_ChangeEPS,\n+    TPM_CC_ChangePPS,\n+    TPM_CC_Clear,\n+    TPM_CC_ClearControl,\n+    TPM_CC_ClockSet,\n+    TPM_CC_HierarchyChangeAuth,\n+    TPM_CC_NV_DefineSpace,\n+    TPM_CC_PCR_Allocate,\n+    TPM_CC_PCR_SetAuthPolicy,\n+    TPM_CC_PP_Commands,\n+    TPM_CC_SetPrimaryPolicy,\n+    TPM_CC_FieldUpgradeStart,\n+    TPM_CC_ClockRateAdjust,\n+    TPM_CC_CreatePrimary,\n+    TPM_CC_NV_GlobalWriteLock,\n+    TPM_CC_GetCommandAuditDigest,\n+    TPM_CC_NV_Increment,\n+    TPM_CC_NV_SetBits,\n+    TPM_CC_NV_Extend,\n+    TPM_CC_NV_Write,\n+    TPM_CC_NV_WriteLock,\n+    TPM_CC_DictionaryAttackLockReset,\n+    TPM_CC_DictionaryAttackParameters,\n+    TPM_CC_NV_ChangeAuth,\n+    TPM_CC_PCR_Event,\n+    TPM_CC_PCR_Reset,\n+    TPM_CC_SequenceComplete,\n+    TPM_CC_SetAlgorithmSet,\n+    TPM_CC_SetCommandCodeAuditStatus,\n+    TPM_CC_FieldUpgradeData,\n+    TPM_CC_IncrementalSelfTest,\n+    TPM_CC_SelfTest,\n+    TPM_CC_Startup,\n+    TPM_CC_Shutdown,\n+    TPM_CC_StirRandom,\n+    TPM_CC_ActivateCredential,\n+    TPM_CC_Certify,\n+    TPM_CC_PolicyNV,\n+    TPM_CC_CertifyCreation,\n+    TPM_CC_Duplicate,\n+    TPM_CC_GetTime,\n+    TPM_CC_GetSessionAuditDigest,\n+    TPM_CC_NV_Read,\n+    TPM_CC_NV_ReadLock,\n+    TPM_CC_ObjectChangeAuth,\n+    TPM_CC_PolicySecret,\n+    TPM_CC_Rewrap,\n+    TPM_CC_Create,\n+    TPM_CC_ECDH_ZGen,\n+    TPM_CC_HMAC,\n+    TPM_CC_MAC,\n+    TPM_CC_Import,\n+    TPM_CC_Load,\n+    TPM_CC_Quote,\n+    TPM_CC_RSA_Decrypt,\n+    TPM_CC_HMAC_Start,\n+    TPM_CC_MAC_Start,\n+    TPM_CC_SequenceUpdate,\n+    TPM_CC_Sign,\n+    TPM_CC_Unseal,\n+    TPM_CC_PolicySigned,\n+    TPM_CC_ContextLoad,\n+    TPM_CC_ContextSave,\n+    TPM_CC_ECDH_KeyGen,\n+    TPM_CC_EncryptDecrypt,\n+    TPM_CC_FlushContext,\n+    TPM_CC_LoadExternal,\n+    TPM_CC_MakeCredential,\n+    TPM_CC_NV_ReadPublic,\n+    TPM_CC_PolicyAuthorize,\n+    TPM_CC_PolicyAuthValue,\n+    TPM_CC_PolicyCommandCode,\n+    TPM_CC_PolicyCounterTimer,\n+    TPM_CC_PolicyCpHash,\n+    TPM_CC_PolicyLocality,\n+    TPM_CC_PolicyNameHash,\n+    TPM_CC_PolicyOR,\n+    TPM_CC_PolicyTicket,\n+    TPM_CC_ReadPublic,\n+    TPM_CC_RSA_Encrypt,\n+    TPM_CC_StartAuthSession,\n+    TPM_CC_VerifySignature,\n+    TPM_CC_ECC_Parameters,\n+    TPM_CC_FirmwareRead,\n+    TPM_CC_GetCapability,\n+    TPM_CC_GetRandom,\n+    TPM_CC_GetTestResult,\n+    TPM_CC_Hash,\n+    TPM_CC_PCR_Read,\n+    TPM_CC_PolicyPCR,\n+    TPM_CC_PolicyRestart,\n+    TPM_CC_ReadClock,\n+    TPM_CC_PCR_Extend,\n+    TPM_CC_PCR_SetAuthValue,\n+    TPM_CC_NV_Certify,\n+    TPM_CC_EventSequenceComplete,\n+    TPM_CC_HashSequenceStart,\n+    TPM_CC_PolicyPhysicalPresence,\n+    TPM_CC_PolicyDuplicationSelect,\n+    TPM_CC_PolicyGetDigest,\n+    TPM_CC_TestParms,\n+    TPM_CC_Commit,\n+    TPM_CC_PolicyPassword,\n+    TPM_CC_ZGen_2Phase,\n+    TPM_CC_EC_Ephemeral,\n+    TPM_CC_PolicyNvWritten,\n+    TPM_CC_PolicyTemplate,\n+    TPM_CC_CreateLoaded,\n+    TPM_CC_PolicyAuthorizeNV,\n+    TPM_CC_EncryptDecrypt2,\n+    TPM_CC_AC_GetCapability,\n+    TPM_CC_AC_Send,\n+    TPM_CC_Policy_AC_SendSelect,\n+    TPM_CC_CertifyX509,\n+    TPM_CC_ACT_SetTimeout,\n+    TPM_CC_ECC_Encrypt,\n+    TPM_CC_ECC_Decrypt,\n+\n+    __TPM_CC_MAX\n+};\n+\n+uint32_t tpm_cc_lookup[__TPM_CC_MAX] = {\n+    [TPM_CC_NV_UndefineSpaceSpecial   ] = 0x0000011F,\n+    [TPM_CC_EvictControl              ] = 0x00000120,\n+    [TPM_CC_HierarchyControl          ] = 0x00000121,\n+    [TPM_CC_NV_UndefineSpace          ] = 0x00000122,\n+    [TPM_CC_ChangeEPS                 ] = 0x00000124,\n+    [TPM_CC_ChangePPS                 ] = 0x00000125,\n+    [TPM_CC_Clear                     ] = 0x00000126,\n+    [TPM_CC_ClearControl              ] = 0x00000127,\n+    [TPM_CC_ClockSet                  ] = 0x00000128,\n+    [TPM_CC_HierarchyChangeAuth       ] = 0x00000129,\n+    [TPM_CC_NV_DefineSpace            ] = 0x0000012A,\n+    [TPM_CC_PCR_Allocate              ] = 0x0000012B,\n+    [TPM_CC_PCR_SetAuthPolicy         ] = 0x0000012C,\n+    [TPM_CC_PP_Commands               ] = 0x0000012D,\n+    [TPM_CC_SetPrimaryPolicy          ] = 0x0000012E,\n+    [TPM_CC_FieldUpgradeStart         ] = 0x0000012F,\n+    [TPM_CC_ClockRateAdjust           ] = 0x00000130,\n+    [TPM_CC_CreatePrimary             ] = 0x00000131,\n+    [TPM_CC_NV_GlobalWriteLock        ] = 0x00000132,\n+    [TPM_CC_GetCommandAuditDigest     ] = 0x00000133,\n+    [TPM_CC_NV_Increment              ] = 0x00000134,\n+    [TPM_CC_NV_SetBits                ] = 0x00000135,\n+    [TPM_CC_NV_Extend                 ] = 0x00000136,\n+    [TPM_CC_NV_Write                  ] = 0x00000137,\n+    [TPM_CC_NV_WriteLock              ] = 0x00000138,\n+    [TPM_CC_DictionaryAttackLockReset ] = 0x00000139,\n+    [TPM_CC_DictionaryAttackParameters] = 0x0000013A,\n+    [TPM_CC_NV_ChangeAuth             ] = 0x0000013B,\n+    [TPM_CC_PCR_Event                 ] = 0x0000013C,\n+    [TPM_CC_PCR_Reset                 ] = 0x0000013D,\n+    [TPM_CC_SequenceComplete          ] = 0x0000013E,\n+    [TPM_CC_SetAlgorithmSet           ] = 0x0000013F,\n+    [TPM_CC_SetCommandCodeAuditStatus ] = 0x00000140,\n+    [TPM_CC_FieldUpgradeData          ] = 0x00000141,\n+    [TPM_CC_IncrementalSelfTest       ] = 0x00000142,\n+    [TPM_CC_SelfTest                  ] = 0x00000143,\n+    [TPM_CC_Startup                   ] = 0x00000144,\n+    [TPM_CC_Shutdown                  ] = 0x00000145,\n+    [TPM_CC_StirRandom                ] = 0x00000146,\n+    [TPM_CC_ActivateCredential        ] = 0x00000147,\n+    [TPM_CC_Certify                   ] = 0x00000148,\n+    [TPM_CC_PolicyNV                  ] = 0x00000149,\n+    [TPM_CC_CertifyCreation           ] = 0x0000014A,\n+    [TPM_CC_Duplicate                 ] = 0x0000014B,\n+    [TPM_CC_GetTime                   ] = 0x0000014C,\n+    [TPM_CC_GetSessionAuditDigest     ] = 0x0000014D,\n+    [TPM_CC_NV_Read                   ] = 0x0000014E,\n+    [TPM_CC_NV_ReadLock               ] = 0x0000014F,\n+    [TPM_CC_ObjectChangeAuth          ] = 0x00000150,\n+    [TPM_CC_PolicySecret              ] = 0x00000151,\n+    [TPM_CC_Rewrap                    ] = 0x00000152,\n+    [TPM_CC_Create                    ] = 0x00000153,\n+    [TPM_CC_ECDH_ZGen                 ] = 0x00000154,\n+    [TPM_CC_HMAC                      ] = 0x00000155,\n+    [TPM_CC_MAC                       ] = 0x00000155,\n+    [TPM_CC_Import                    ] = 0x00000156,\n+    [TPM_CC_Load                      ] = 0x00000157,\n+    [TPM_CC_Quote                     ] = 0x00000158,\n+    [TPM_CC_RSA_Decrypt               ] = 0x00000159,\n+    [TPM_CC_HMAC_Start                ] = 0x0000015B,\n+    [TPM_CC_MAC_Start                 ] = 0x0000015B,\n+    [TPM_CC_SequenceUpdate            ] = 0x0000015C,\n+    [TPM_CC_Sign                      ] = 0x0000015D,\n+    [TPM_CC_Unseal                    ] = 0x0000015E,\n+    [TPM_CC_PolicySigned              ] = 0x00000160,\n+    [TPM_CC_ContextLoad               ] = 0x00000161,\n+    [TPM_CC_ContextSave               ] = 0x00000162,\n+    [TPM_CC_ECDH_KeyGen               ] = 0x00000163,\n+    [TPM_CC_EncryptDecrypt            ] = 0x00000164,\n+    [TPM_CC_FlushContext              ] = 0x00000165,\n+    [TPM_CC_LoadExternal              ] = 0x00000167,\n+    [TPM_CC_MakeCredential            ] = 0x00000168,\n+    [TPM_CC_NV_ReadPublic             ] = 0x00000169,\n+    [TPM_CC_PolicyAuthorize           ] = 0x0000016A,\n+    [TPM_CC_PolicyAuthValue           ] = 0x0000016B,\n+    [TPM_CC_PolicyCommandCode         ] = 0x0000016C,\n+    [TPM_CC_PolicyCounterTimer        ] = 0x0000016D,\n+    [TPM_CC_PolicyCpHash              ] = 0x0000016E,\n+    [TPM_CC_PolicyLocality            ] = 0x0000016F,\n+    [TPM_CC_PolicyNameHash            ] = 0x00000170,\n+    [TPM_CC_PolicyOR                  ] = 0x00000171,\n+    [TPM_CC_PolicyTicket              ] = 0x00000172,\n+    [TPM_CC_ReadPublic                ] = 0x00000173,\n+    [TPM_CC_RSA_Encrypt               ] = 0x00000174,\n+    [TPM_CC_StartAuthSession          ] = 0x00000176,\n+    [TPM_CC_VerifySignature           ] = 0x00000177,\n+    [TPM_CC_ECC_Parameters            ] = 0x00000178,\n+    [TPM_CC_FirmwareRead              ] = 0x00000179,\n+    [TPM_CC_GetCapability             ] = 0x0000017A,\n+    [TPM_CC_GetRandom                 ] = 0x0000017B,\n+    [TPM_CC_GetTestResult             ] = 0x0000017C,\n+    [TPM_CC_Hash                      ] = 0x0000017D,\n+    [TPM_CC_PCR_Read                  ] = 0x0000017E,\n+    [TPM_CC_PolicyPCR                 ] = 0x0000017F,\n+    [TPM_CC_PolicyRestart             ] = 0x00000180,\n+    [TPM_CC_ReadClock                 ] = 0x00000181,\n+    [TPM_CC_PCR_Extend                ] = 0x00000182,\n+    [TPM_CC_PCR_SetAuthValue          ] = 0x00000183,\n+    [TPM_CC_NV_Certify                ] = 0x00000184,\n+    [TPM_CC_EventSequenceComplete     ] = 0x00000185,\n+    [TPM_CC_HashSequenceStart         ] = 0x00000186,\n+    [TPM_CC_PolicyPhysicalPresence    ] = 0x00000187,\n+    [TPM_CC_PolicyDuplicationSelect   ] = 0x00000188,\n+    [TPM_CC_PolicyGetDigest           ] = 0x00000189,\n+    [TPM_CC_TestParms                 ] = 0x0000018A,\n+    [TPM_CC_Commit                    ] = 0x0000018B,\n+    [TPM_CC_PolicyPassword            ] = 0x0000018C,\n+    [TPM_CC_ZGen_2Phase               ] = 0x0000018D,\n+    [TPM_CC_EC_Ephemeral              ] = 0x0000018E,\n+    [TPM_CC_PolicyNvWritten           ] = 0x0000018F,\n+    [TPM_CC_PolicyTemplate            ] = 0x00000190,\n+    [TPM_CC_CreateLoaded              ] = 0x00000191,\n+    [TPM_CC_PolicyAuthorizeNV         ] = 0x00000192,\n+    [TPM_CC_EncryptDecrypt2           ] = 0x00000193,\n+    [TPM_CC_AC_GetCapability          ] = 0x00000194,\n+    [TPM_CC_AC_Send                   ] = 0x00000195,\n+    [TPM_CC_Policy_AC_SendSelect      ] = 0x00000196,\n+    [TPM_CC_CertifyX509               ] = 0x00000197,\n+    [TPM_CC_ACT_SetTimeout            ] = 0x00000198,\n+    [TPM_CC_ECC_Encrypt               ] = 0x00000199,\n+    [TPM_CC_ECC_Decrypt               ] = 0x0000019A,\n+};\n+\n+struct __attribute__((__packed__)) tpm2_cmd {\n+  uint16_t tag;\n+  uint32_t size; // sizeof(struct tpm2_cmd) + sizeof(buf)\n+  uint32_t command_code; // tpm_cc\n+  uint32_t buf[];\n+};\n+\n+static inline uint16_t reverse2(uint16_t _in) {\n+    uint8_t *in = (uint8_t*)&_in;\n+    return (in[0] << 8) | in[1];\n+}\n+\n+static inline uint32_t reverse4(uint32_t _in) {\n+    uint8_t *in = (uint8_t*)&_in;\n+    return ((uint32_t)in[0] << 24) | (in[1] << 16) | (in[2] << 8) | in[3];\n+}\n+\n+// tpm2_startup -c\n+unsigned char tpm2_startup[] = {\n+    0x80, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x44, 0x00, 0x01\n+};\n+unsigned char tpm2_startup_c[] = {\n+    0x80, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00\n+};\n+unsigned char tpm2_shutdown[] = {\n+    0x80, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x45, 0x00, 0x01\n+};\n+unsigned char tpm2_shutdown_c[] = {\n+    0x80, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00\n+};\n+\n+uint32_t responseSize = 4096;\n+unsigned char response[4096];\n+unsigned char cmd_buffer[4096];\n+unsigned char cmd2_buffer[4096];\n+\n+int LLVMFuzzerInitialize(int *argc, char ***argv)\n+{\n+    _plat__NVEnable(NULL);\n+    TPM_Manufacture(1);\n+    _plat__Signal_PowerOn();\n+    _plat__LocalitySet(3);\n+    fprintf(stderr, \"TPM initialized, let the fuzzing COMMENCE!\\n\");\n+    return 0;\n+}\n+\n+static inline void fixup_tag(struct tpm2_cmd *cmd)\n+{\n+    if ( reverse2(cmd->tag) % 2 )\n+        cmd->tag = reverse2(TPM_ST_NO_SESSIONS);\n+    else\n+        cmd->tag = reverse2(TPM_ST_SESSIONS);\n+}\n+\n+static inline void fixup_size(struct tpm2_cmd *cmd, uint32_t size)\n+{\n+    cmd->size = reverse4(size);\n+}\n+\n+static inline void fixup_cc(struct tpm2_cmd *cmd)\n+{\n+    uint32_t cc = reverse4(cmd->command_code);\n+    if ( cc < tpm_cc_lookup[0] || cc >= tpm_cc_lookup[__TPM_CC_MAX-1] )\n+    {\n+        uint8_t selector = cc % __TPM_CC_MAX;\n+        cc = tpm_cc_lookup[selector];\n+        cmd->command_code = reverse4(cc);\n+    }\n+}\n+\n+int LLVMFuzzerTestOneInput(const uint8_t *const Data, size_t Size) {\n+    if (Data == NULL || Size < sizeof(struct tpm2_cmd)) {\n+        return 0;\n+    }\n+\n+    unsigned char *r = &response[0];\n+    unsigned char **_response = &r;\n+\n+    struct tpm2_cmd *cmd = NULL;\n+    struct tpm2_cmd *cmd2 = NULL;\n+\n+    if ( Size > 4096 )\n+    {\n+        if ( Size > 4096 + sizeof(struct tpm2_cmd) )\n+        {\n+            size_t size2 = Size - 4096;\n+            if ( size2 > 4096 )\n+                size2 = 4096;\n+\n+            memcpy(&cmd2_buffer, Data + 4096, size2);\n+\n+            cmd2 = (struct tpm2_cmd *)&cmd2_buffer;\n+            fixup_tag(cmd2);\n+            fixup_size(cmd2, size2);\n+            fixup_cc(cmd2);\n+        }\n+\n+        Size = 4096;\n+    }\n+\n+    memcpy(&cmd_buffer, Data, Size);\n+    cmd = (struct tpm2_cmd *)&cmd_buffer;\n+\n+    // Fixups\n+    fixup_tag(cmd);\n+    fixup_size(cmd, Size);\n+    fixup_cc(cmd);\n+\n+    _plat__Signal_Reset();\n+    _plat__SetNvAvail();\n+\n+    // Start the TPM\n+    _plat__RunCommand(12, (unsigned char*)&tpm2_startup_c, &responseSize, _response);\n+\n+    // Run the command(s)\n+    _plat__RunCommand(reverse4(cmd->size), (unsigned char*)cmd, &responseSize, _response);\n+    if ( cmd2 )\n+        _plat__RunCommand(reverse4(cmd2->size), (unsigned char*)cmd2, &responseSize, _response);\n+\n+    // Restart the TPM with state saved */\n+    _plat__RunCommand(12, (unsigned char*)&tpm2_shutdown, &responseSize, _response);\n+    _plat__RunCommand(12, (unsigned char*)&tpm2_startup, &responseSize, _response);\n+\n+    // Re-run the commands\n+    _plat__RunCommand(reverse4(cmd->size), (unsigned char*)cmd, &responseSize, _response);\n+    if ( cmd2 )\n+        _plat__RunCommand(reverse4(cmd2->size), (unsigned char*)cmd2, &responseSize, _response);\n+\n+    // Shut down the TPM\n+    _plat__RunCommand(12, (unsigned char*)&tpm2_shutdown_c, &responseSize, _response);\n+\n+    // Try running the commands on the shutdown TPM\n+    _plat__RunCommand(reverse4(cmd->size), (unsigned char*)cmd, &responseSize, _response);\n+    if ( cmd2 )\n+        _plat__RunCommand(reverse4(cmd2->size), (unsigned char*)cmd2, &responseSize, _response);\n+\n+    _plat__ClearNvAvail();\n+\n+    return 0;\n+}\n+\n+#ifdef COVERAGE\n+int main(int argc, char **argv)\n+{\n+    if ( argc != 2 )\n+        return 0;\n+\n+    FILE *f = fopen(argv[1], \"rb\");\n+    fseek(f, 0, SEEK_END);\n+    long fsize = ftell(f);\n+    fseek(f, 0, SEEK_SET);\n+\n+    char *buf = malloc(fsize);\n+    fread(buf, fsize, 1, f);\n+    fclose(f);\n+\n+    LLVMFuzzerInitialize(0,NULL);\n+    LLVMFuzzerTestOneInput((uint8_t*)buf, fsize);\n+\n+    free(buf);\n+}\n+#endif\n-- \n2.34.1\n\n"
  },
  {
    "path": "projects/ms-tpm-20-ref/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/microsoft/ms-tpm-20-ref\nlanguage: c\nmain_repo: https://github.com/microsoft/ms-tpm-20-ref\nauto_ccs:\n  - \"tamas.k.lengyel@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/ms-tpm-20-ref/tpm_cmd.options",
    "content": "[libfuzzer]\nmax_len = 8192\nlen_control = 0\n"
  },
  {
    "path": "projects/msal/Dockerfile",
    "content": "# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d223a882810372830fd7968eb3e64533f3a2318c90be43ac753a46a15946faec\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/AzureAD/microsoft-authentication-library-for-python msal\nWORKDIR msal\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/msal/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install -r ./requirements.txt\npip3 install .\n\n# Build fuzzers in $OUT.\ncd $SRC\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/msal/fuzz_auth.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport atheris\nimport sys\nimport requests\nwith atheris.instrument_imports():\n    from msal import PublicClientApplication\n    from msal.application import extract_certs\n    from msal.authority import AuthorityBuilder\n\n\n# FuzzHttpClient inspired by MinimalHttpClient from msal unit tests\nclass FuzzHttpClient:\n    \"\"\"HTTP client returning data seeded by the fuzzer and no real connections\"\"\"\n    def __init__(self, fdp, verify=True, proxies=None, timeout=None):\n        # We keep these variables from the unit test implementation\n        # in case some of the MSAL code uses it.\n        self.session = requests.Session()\n        self.session.verify = verify\n        self.session.proxies = proxies\n        self.timeout = timeout\n        self.fdp = fdp\n\n    def post(self, url, params=None, data=None, headers=None, **kwargs):\n        return FuzzResponse(fdp = self.fdp)\n\n    def get(self, url, params=None, headers=None, **kwargs):\n        return FuzzResponse(fdp = self.fdp)\n\n    def close(self):\n        self.session.close()\n\n\nclass FuzzResponse(object):\n    def __init__(self, fdp, requests_resp=None, status_code=None, text=None):\n        # Over-approximate responses by creating a random Response object\n        self._raw_resp = requests.Response()\n        self.fdp = fdp\n        self._raw_resp.status_code = self.fdp.ConsumeIntInRange(100, 599)\n        self.text = self.fdp.ConsumeString(500)\n        self.status_code = self._raw_resp.status_code\n\n    def raise_for_status(self):\n        if self._raw_resp is not None:\n            self._raw_resp.raise_for_status()\n\ndef is_expected(error_list,error_msg):\n    for error in error_list:\n        if error in error_msg:\n            return True\n    return False\n\ndef TestInput(input_bytes):\n    if len(input_bytes)<32:\n        return \n    fdp = atheris.FuzzedDataProvider(input_bytes)\n    authority = AuthorityBuilder(fdp.ConsumeString(50),fdp.ConsumeString(50))\n    try:\n        app = PublicClientApplication(\n            client_id=fdp.ConsumeString(32),\n            authority=authority,\n            http_client=FuzzHttpClient(fdp) # Use fake Fuzz HTTP client\n        )\n        app.get_accounts()\n    except (ValueError,KeyError) as e:\n        error_list = [\n            \"tenant_discovery_endpoint\",\n            \"Invalid IPv6 URL\",\n            \"should consist of an https url with a minimum of one segment in a path\",\n            \"netloc\"\n        ]\n        if not is_expected(error_list,str(e)):\n            raise e\n\n    cert = \"-----BEGIN CERTIFICATE-----%s-----END CERTIFICATE-----\"%fdp.ConsumeString(200)\n    extract_certs(cert)\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/msal/fuzz_tokencache.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport base64\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from msal.token_cache import *\n\n#Create dummy token\ndef build_token(issuer=\"issuer\",subject=\"subject\",id=\"id\",**claims): \n    return \"header.%s.signature\" % base64.b64encode(json.dumps(dict({\n        \"iss\": issuer, \"sub\": subject, \"aud\": id,\n        \"exp\": (time.time() + 100), \"iat\": time.time()\n        }, **claims)).encode()).decode('utf-8')\n\n#Create dummy response\ndef build_response(uid,utid,access_token,expires_in,token_type,**kwargs):\n    response = {}\n    if uid and utid:\n        response[\"client_info\"] = base64.b64encode(json.dumps({\n            \"uid\": uid, \"utid\": utid,\n        }).encode()).decode('utf-8')\n    if access_token:\n        response.update({\n            \"access_token\": access_token,\n            \"expires_in\": expires_in,\n            \"token_type\": token_type,\n        })\n    response.update(kwargs)  # Pass-through key-value pairs as top-level fields\n    return response\n\ndef is_expected(error_list,error_msg):\n    for error in error_list:\n        if error in error_msg:\n            return True\n    return False\n\ndef TestInput(input_bytes):\n    if len(input_bytes)<32:\n        return \n\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n    cache = TokenCache()\n    client_id = fdp.ConsumeString(32)\n    try:\n        token = build_token(\n          oid=fdp.ConsumeString(10), \n          preferred_username=fdp.ConsumeString(10), \n          id=client_id\n        )\n        cache.add({\n          \"client_id\": client_id,\n          \"scope\": [\"s2\", \"s1\", \"s3\"],\n          \"token_endpoint\": \"https://%s\"%fdp.ConsumeString(20),\n          \"response\": build_response(\n              token_type=fdp.ConsumeString(5),\n              uid=fdp.ConsumeString(5),\n              utid=fdp.ConsumeString(5),\n              expires_in=3600,\n              access_token=fdp.ConsumeString(10),\n              id_token=token,\n              refresh_token=fdp.ConsumeString(10)\n          ),\n        }, now=1000)\n    except ValueError as e:\n        error_list = [\n           \"netloc\",\n           \"Invalid IPv6 URL\",\n           \"should consist of an https url with a minimum of one segment in a path\"\n        ]\n        if not is_expected(error_list,str(e)):\n            raise e\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/msal/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/AzureAD/microsoft-authentication-library-for-python\nlanguage: python\nmain_repo: https://github.com/AzureAD/microsoft-authentication-library-for-python\nprimary_contact: rayluo@microsoft.com\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/msgpack-c/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake wget bzip2\nRUN git clone --depth 1 --single-branch --branch cpp_master https://github.com/msgpack/msgpack-c.git msgpack-c\n\nRUN wget https://archives.boost.io/release/1.70.0/source/boost_1_70_0.tar.bz2 && \\\n    tar xf boost_1_70_0.tar.bz2 && \\\n    cd boost_1_70_0 && \\\n    ./bootstrap.sh --with-toolset=clang --prefix=/usr && \\\n    ./b2 -j$(nproc) toolset=clang --with-chrono --with-context --with-filesystem --with-system --with-timer address-model=64 cflags=\"$CFLAGS\" cxxflags=\"$CXXFLAGS\"  link=static variant=release runtime-link=static threading=multi install\n\nWORKDIR msgpack-c\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/msgpack-c/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfor f in $SRC/msgpack-c/fuzz/*_fuzzer.cpp; do\n    # NOTE(derwolfe): the naming scheme for fuzzers and seed corpora is\n    # fuzzer = something_something_fuzzer.cpp\n    # seed corpus = something_something_fuzzer_seed_corpus\n    fuzzer=$(basename \"$f\" .cpp)\n    $CXX $CXXFLAGS -std=c++11 -Iinclude -I\"$SRC/msgpack-c/include\" \\\n         \"$f\" -o \"$OUT/${fuzzer}\" \\\n         $LIB_FUZZING_ENGINE\n\n    if [ -d \"$SRC/msgpack-c/fuzz/${fuzzer}_seed_corpus\" ]; then\n        zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"$SRC/msgpack-c/fuzz/${fuzzer}_seed_corpus/\"\n    fi\ndone\n"
  },
  {
    "path": "projects/msgpack-c/project.yaml",
    "content": "homepage: \"https://msgpack.org/\"\nlanguage: c++\nprimary_contact: \"redboltz@gmail.com\"\nauto_ccs:\n  - nobu.k.jp@gmail.com\n  - chriswwolfe@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/msgpack/msgpack-c.git'\n"
  },
  {
    "path": "projects/msgpack-python/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth 1 https://github.com/msgpack/msgpack-python msgpack-python\nRUN python3 -m pip install --upgrade pip \\\n    && python3 -m pip install -r $SRC/msgpack-python/requirements.txt\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/msgpack-python\n"
  },
  {
    "path": "projects/msgpack-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake cython\npython3 -m pip install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/msgpack-python/fuzz_unpack.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nimport io\nimport msgpack\n\n\ndef TestOneInput(data):\n  b = io.BytesIO(data)\n  r = None\n  try:\n    r = msgpack.unpack(b)\n  except (\n    # Catch exceptions as indicated:\n    # https://github.com/msgpack/msgpack-python/blob/main/msgpack/fallback.py#L110-L121\n    ValueError,\n    msgpack.exceptions.FormatError,\n    msgpack.exceptions.StackError,\n    msgpack.exceptions.ExtraData\n  ) as e:\n    pass\n\n  if r is not None:\n    del r\n  del b\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/msgpack-python/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/msgpack/msgpack-python\nlanguage: python\nmain_repo: https://github.com/msgpack/msgpack-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/msquic/Dockerfile",
    "content": "# Copyright 2022 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nADD https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb packages-microsoft-prod.deb\nRUN apt-get update && \\\n    apt-get install -y software-properties-common && \\\n    dpkg -i packages-microsoft-prod.deb && \\\n    add-apt-repository universe && \\\n    apt-get update -y && \\\n    apt-get install -y powershell && \\\n    rm -rf /var/lib/apt/lists/*\n\nRUN git clone https://github.com/microsoft/msquic && \\\n    cd msquic && \\\n    git submodule update --init\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/msquic\n"
  },
  {
    "path": "projects/msquic/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Temporary workaround for clang-18\nexport CFLAGS=\"$CFLAGS     -Wno-error=invalid-unevaluated-string\"\nexport CXXFLAGS=\"$CXXFLAGS -Wno-error=invalid-unevaluated-string\"\n\npwsh ./scripts/build.ps1 -Static -DisableTest -DisablePerf -DisableLogs -Parallel 1\n\nBUILDFILENAME=$(find . -name 'msquic-config.cmake')\nBUILDDIR=$(dirname $BUILDFILENAME)\nLIBMSQUICDIR=$(cmake -LAH $BUILDDIR/CMakeCache.txt | grep QUIC_OUTPUT_DIR | cut -d'=' -f 2)\nQUICTLSLIB=$(cmake -LAH $BUILDDIR/CMakeCache.txt | grep  QUIC_TLS_LIB | cut -d'=' -f 2)\n\ncd $SRC/msquic/src/fuzzing\n\n$CXX $CXXFLAGS -DCX_PLATFORM_LINUX -DQUIC_TEST_APIS \\\n    -I/src/msquic/src/test \\\n    -I/src/msquic/src/inc \\\n    -I/src/msquic/src/generated/common \\\n    -I/src/msquic/src/generated/linux \\\n    -I/src/msquic/build/linux/x64_$QUICTLSLIB/_deps/opensslquic-build/$QUICTLSLIB/include \\\n    -isystem /src/msquic/submodules/googletest/googletest/include \\\n    -isystem /src/msquic/submodules/googletest/googletest \\\n    -c fuzz.cc -o fuzz.o\n\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz.o -o $OUT/fuzz \\\n    $LIBMSQUICDIR/libmsquic.a\n\ncd $SRC\n\n$CXX $CXXFLAGS -DCX_PLATFORM_LINUX -DQUIC_TEST_APIS -DFUZZING -DQUIC_BUILD_STATIC \\\n    -I/src/msquic/src/test \\\n    -I/src/msquic/src/inc \\\n    -I/src/msquic/src/generated/common \\\n    -I/src/msquic/src/generated/linux \\\n    -I/src/msquic/build/linux/x64_$QUICTLSLIB/_deps/opensslquic-build/$QUICTLSLIB/include \\\n    -isystem /src/msquic/submodules/googletest/googletest/include \\\n    -isystem /src/msquic/submodules/googletest/googletest \\\n    -c ./msquic/src/tools/spin/spinquic.cpp -o spinquic.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE spinquic.o -o $OUT/spinquic \\\n    $LIBMSQUICDIR/libmsquic.a\n"
  },
  {
    "path": "projects/msquic/project.yaml",
    "content": "homepage: \"https://github.com/microsoft/msquic\"\r\nlanguage: c\r\nprimary_contact: \"msquicinfra@microsoft.com\"\r\nauto_ccs:\r\n  - \"daikiaminaka@microsoft.com\"\r\n  - \"anrossi@microsoft.com\"\r\n  - \"maolson@microsoft.com\"\r\n  - \"huanyi@microsoft.com\"\r\n  - \"nibanks@microsoft.com\"\r\nfuzzing_engines:\r\n  - libfuzzer\r\nsanitizers:\r\n  - address\r\n  - undefined\r\nmain_repo: 'https://github.com/microsoft/msquic.git'\r\n"
  },
  {
    "path": "projects/mtail/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/google/mtail $GOPATH/src/github.com/google/mtail\nWORKDIR $GOPATH/src/github.com/google/mtail\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/mtail/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/google/mtail/internal/runtime Fuzz vm-fuzzer\n# Make the dictionary and seed corpus.\nmake --debug $OUT/vm-fuzzer.dict $OUT/vm-fuzzer_seed_corpus.zip\n"
  },
  {
    "path": "projects/mtail/project.yaml",
    "content": "homepage: https://github.com/google/mtail\nprimary_contact: jaq@spacepants.org\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nlanguage: go\nmain_repo: 'https://github.com/google/mtail'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/muduo/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libboost-dev\nRUN git clone --depth 1 https://github.com/chenshuo/muduo\nWORKDIR muduo\nCOPY build.sh muduo_http_fuzzer.cpp $SRC/\n"
  },
  {
    "path": "projects/muduo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed -i '34 a $ENV{CXXFLAGS}' CMakeLists.txt\nmkdir -p build-dir && cd build-dir\ncmake -DCMAKE_BUILD_TYPE=\"release\" -DMUDUO_BUILD_EXAMPLES=OFF \\\n      ..\nmake -j$(nproc)\n\n$CXX $CXXFLAGS -I/src/muduo \\\n\t-o muduo_http_fuzzer.o \\\n    -c $SRC/muduo_http_fuzzer.cpp\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n\tmuduo_http_fuzzer.o \\\n    -o $OUT/muduo_http_fuzzer \\\n\t./lib/libmuduo_http.a \\\n\t./lib/libmuduo_net.a \\\n\t./lib/libmuduo_base.a \n"
  },
  {
    "path": "projects/muduo/muduo_http_fuzzer.cpp",
    "content": "/*  Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n\n#include \"muduo/net/http/HttpContext.h\"\n#include \"muduo/net/Buffer.h\"\n#include \"muduo/base/Timestamp.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n\tchar *new_str = (char *)malloc(size+1);\n\tif (new_str == NULL){\n\t\treturn 0;\n\t}\n\tmemcpy(new_str, data, size);\n\tnew_str[size] = '\\0';\n\t\n\tmuduo::net::HttpContext context;\n\tmuduo::net::Buffer input;\n\tinput.append(new_str);\n\tcontext.parseRequest(&input, muduo::Timestamp::now());\n\tfree(new_str);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/muduo/project.yaml",
    "content": "homepage: \"https://github.com/chenshuo/muduo\"\nlanguage: c++\nprimary_contact: \"chenshuo@chenshuo.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: \"https://github.com/chenshuo/muduo\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/multidict/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/aio-libs/multidict multidict\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/multidict\n"
  },
  {
    "path": "projects/multidict/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Compile native modules using sanitizers\npython3 ./setup.py install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/multidict/fuzz_md.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport json\nimport pickle\nimport multidict\n\n\ndef run_operation(md, fdp, operation):\n  if operation == 1:\n    try:\n      md.popall(fdp.ConsumeUnicodeNoSurrogates(24))\n    except KeyError:\n      pass\n  elif operation == 2:\n    try:\n      md.popitem()\n    except KeyError:\n      pass\n  elif operation == 3:\n    try:\n      md.copy()\n    except KeyError:\n      pass\n  elif operation == 4:\n    try:\n      md.__delitem__(fdp.ConsumeUnicodeNoSurrogates(24))\n    except KeyError:\n      pass\n  elif operation == 5:\n    md[fdp.ConsumeUnicodeNoSurrogates(24)] = fdp.ConsumeUnicodeNoSurrogates(\n        24)\n    MP = multidict._multidict_py.MultiDictProxy(md)\n    MP.copy()\n  elif operation == 6:\n    try:\n      copymd = md.copy()\n      is_eq = copymd == md\n      copymd['a'] = 2\n      is_eq = copymd == md\n    except KeyError:\n      pass\n  elif operation == 7:\n    try:\n      md.popone(fdp.ConsumeUnicodeNoSurrogates(24))\n    except KeyError:\n      pass\n  elif operation == 8:\n    try:\n      copymd = md.copy()\n      copymd['b'] = 'c'\n      md.update(copymd)\n    except KeyError:\n      pass\n  elif operation == 9:\n    c2 = multidict._multidict_py.CIMultiDict(md.copy())\n  elif operation == 10:\n    try:\n      md.getall(fdp.ConsumeUnicodeNoSurrogates(24))\n    except KeyError:\n      pass\n  elif operation == 11:\n    try:\n      md.getone(fdp.ConsumeUnicodeNoSurrogates(24))\n    except KeyError:\n      pass\n  elif operation == 12:\n    for elem in md:\n      pass\n  elif operation == 13:\n    len(md)\n  elif operation == 14:\n    value_view = md.values()\n  elif operation == 15:\n    representation = str(md)\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    random_dict = json.loads(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except:\n    return\n  if not isinstance(random_dict, dict):\n    return\n\n  md = multidict._multidict_py.MultiDict(random_dict)\n  r = pickle.loads(pickle.dumps(md))\n\n  md = multidict._multidict_py.MultiDict(random_dict)\n  # Run one of all operations\n  run_operation(md, fdp, 1)\n  run_operation(md, fdp, 2)\n  run_operation(md, fdp, 3)\n  run_operation(md, fdp, 4)\n  run_operation(md, fdp, 5)\n  run_operation(md, fdp, 6)\n  run_operation(md, fdp, 7)\n  run_operation(md, fdp, 8)\n  run_operation(md, fdp, 9)\n  run_operation(md, fdp, 10)\n  run_operation(md, fdp, 11)\n  run_operation(md, fdp, 12)\n  run_operation(md, fdp, 13)\n  run_operation(md, fdp, 14)\n  run_operation(md, fdp, 15)\n\n  # Run a random sequence of operations\n  for idx in range(30):\n    operation = fdp.ConsumeIntInRange(1, 15)\n    run_operation(md, fdp, operation)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/multidict/project.yaml",
    "content": "homepage: https://github.com/aio-libs/multidict\nmain_repo: https://github.com/aio-libs/multidict\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/multierr/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/uber-go/multierr\nWORKDIR $SRC/multierr\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/multierr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\nprintf \"package multierr\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer go.uber.org/multierr FuzzCombine FuzzCombine\n"
  },
  {
    "path": "projects/multierr/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage multierr\n\nimport (\n\t\"errors\"\n\t\"testing\"\n)\n\nfunc FuzzCombine(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, err1, err2 string) {\n\t\te1 := errors.New(err1)\n\t\te2 := errors.New(err2)\n\t\tCombine(e1, e2)\n\t})\n}\n\n"
  },
  {
    "path": "projects/multierr/project.yaml",
    "content": "homepage: \"https://github.com/uber-go/multierr\"\nlanguage: go\nmain_repo: \"https://github.com/uber-go/multierr\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/muparser/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN apt-get update && apt-get install -y build-essential cmake pkg-config\nRUN git clone --depth 1 https://github.com/beltoforion/muparser.git muparser\nWORKDIR muparser\nCOPY run_tests.sh build.sh set_eval_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/muparser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCFLAGS=\"${CFLAGS} -fno-sanitize=integer-divide-by-zero,float-divide-by-zero\"\nCXXFLAGS=\"${CXXFLAGS} -fno-sanitize=integer-divide-by-zero,float-divide-by-zero\"\n\n# build project\ncmake . -DBUILD_SHARED_LIBS=OFF  -DENABLE_OPENMP=OFF\nmake -j$(nproc)\n\n# install\nmake install\nldconfig\n\n# build fuzzers\nMU_CXXFLAGS=$(pkg-config muparser --cflags)\nMU_LIBS=$(pkg-config muparser --libs)\n\n$CXX -std=c++11 $CXXFLAGS -I. \\\n     $MU_CXXFLAGS $MU_LIBS \\\n     $SRC/set_eval_fuzzer.cc -o $OUT/set_eval_fuzzer \\\n     $LIB_FUZZING_ENGINE libmuparser.a\n"
  },
  {
    "path": "projects/muparser/project.yaml",
    "content": "homepage: \"https://beltoforion.de/article.php?a=muparser\"\nlanguage: c++\nprimary_contact: \"equinox.ib@googlemail.com\"\nauto_ccs:\n    - \"zhichengcai@google.com\"\nsanitizers:\n    - address\n    - undefined\nmain_repo: 'https://github.com/beltoforion/muparser.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/muparser/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake test\n"
  },
  {
    "path": "projects/muparser/set_eval_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stdio.h>\n#include <iostream>\n#include <string>\n\n#include \"muParser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  std::string line_string((char *)data, size);\n  try {\n    mu::Parser parser;\n    parser.SetExpr(line_string);\n    parser.Eval();\n  } catch (mu::Parser::exception_type &e) {\n  } catch (mu::ParserError &e) {\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/mupdf/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libtool pkg-config\nRUN git clone --recursive --depth 1 https://github.com/ArtifexSoftware/mupdf.git mupdf\nRUN git clone --depth 1 https://github.com/mozilla/pdf.js pdf.js && \\\n    zip -q $SRC/pdf_fuzzer_seed_corpus.zip pdf.js/test/pdfs/*.pdf && \\\n    rm -rf pdf.js\nADD https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/pdf.dict $SRC/pdf_fuzzer.dict\nWORKDIR mupdf\nCOPY *.cc $SRC/\nCOPY build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/mupdf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# supp_size is unused in harfbuzz so we will avoid it being unused.\nsed -i 's/supp_size;/supp_size;(void)(supp_size);/g' ./thirdparty/harfbuzz/src/hb-subset-cff1.cc\n\nLDFLAGS=\"$CXXFLAGS\" make -j$(nproc) HAVE_GLUT=no build=debug OUT=$WORK \\\n    $WORK/libmupdf-third.a $WORK/libmupdf.a\nfuzz_target=pdf_fuzzer\n\n$CXX $CXXFLAGS -std=c++11 -Iinclude \\\n    $SRC/pdf_fuzzer.cc -o $OUT/$fuzz_target \\\n    $LIB_FUZZING_ENGINE $WORK/libmupdf.a $WORK/libmupdf-third.a\n\ncp $SRC/{*.zip,*.dict,*.options} $OUT\n\nif [ ! -f \"${OUT}/${fuzz_target}_seed_corpus.zip\" ]; then\n  echo \"missing seed corpus\"\n  exit 1\nfi\n\nif [ ! -f \"${OUT}/${fuzz_target}.dict\" ]; then\n  echo \"missing dictionary\"\n  exit 1\nfi\n\nif [ ! -f \"${OUT}/${fuzz_target}.options\" ]; then\n  echo \"missing options\"\n  exit 1\nfi\n"
  },
  {
    "path": "projects/mupdf/pdf_fuzzer.cc",
    "content": "/*\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <cstdint>\n#include <stdlib.h>\n#include <string.h>\n#include <inttypes.h>\n\n#include <mupdf/fitz.h>\n\n#define ALIGNMENT ((size_t) 16)\n#define KBYTE ((size_t) 1024)\n#define MBYTE (1024 * KBYTE)\n#define GBYTE (1024 * MBYTE)\n#define MAX_ALLOCATION (1 * GBYTE)\n\nstatic size_t used;\n\nstatic void *fz_limit_reached_ossfuzz(size_t oldsize, size_t size)\n{\n  if (oldsize == 0)\n    fprintf(stderr, \"limit: %zu Mbyte used: %zu Mbyte allocation: %zu: limit reached\\n\", MAX_ALLOCATION / MBYTE, used / MBYTE, size);\n  else\n    fprintf(stderr, \"limit: %zu Mbyte used: %zu Mbyte reallocation: %zu -> %zu: limit reached\\n\", MAX_ALLOCATION / MBYTE, used / MBYTE, oldsize, size);\n  fflush(0);\n  return NULL;\n}\n\nstatic void *fz_malloc_ossfuzz(void *opaque, size_t size)\n{\n  char *ptr = NULL;\n\n  if (size == 0)\n    return NULL;\n  if (size > SIZE_MAX - ALIGNMENT)\n    return NULL;\n  if (size + ALIGNMENT > MAX_ALLOCATION - used)\n    return fz_limit_reached_ossfuzz(0, size + ALIGNMENT);\n\n  ptr = (char *) malloc(size + ALIGNMENT);\n  if (ptr == NULL)\n    return NULL;\n\n  memcpy(ptr, &size, sizeof(size));\n  used += size + ALIGNMENT;\n\n  return ptr + ALIGNMENT;\n}\n\nstatic void fz_free_ossfuzz(void *opaque, void *ptr)\n{\n  size_t size;\n\n  if (ptr == NULL)\n    return;\n  if (ptr < (void *) ALIGNMENT)\n    return;\n\n  ptr = (char *) ptr - ALIGNMENT;\n  memcpy(&size, ptr, sizeof(size));\n\n  used -= size + ALIGNMENT;\n  free(ptr);\n}\n\nstatic void *fz_realloc_ossfuzz(void *opaque, void *old, size_t size)\n{\n  size_t oldsize;\n  char *ptr;\n\n  if (old == NULL)\n    return fz_malloc_ossfuzz(opaque, size);\n  if (old < (void *) ALIGNMENT)\n    return NULL;\n\n  if (size == 0) {\n    fz_free_ossfuzz(opaque, old);\n    return NULL;\n  }\n  if (size > SIZE_MAX - ALIGNMENT)\n    return NULL;\n\n  old = (char *) old - ALIGNMENT;\n  memcpy(&oldsize, old, sizeof(oldsize));\n\n  if (size + ALIGNMENT > MAX_ALLOCATION - used + oldsize + ALIGNMENT)\n    return fz_limit_reached_ossfuzz(oldsize + ALIGNMENT, size + ALIGNMENT);\n\n  ptr = (char *) realloc(old, size + ALIGNMENT);\n  if (ptr == NULL)\n    return NULL;\n\n  used -= oldsize + ALIGNMENT;\n  memcpy(ptr, &size, sizeof(size));\n  used += size + ALIGNMENT;\n\n  return ptr + ALIGNMENT;\n}\n\nstatic fz_alloc_context fz_alloc_ossfuzz =\n{\n  NULL,\n  fz_malloc_ossfuzz,\n  fz_realloc_ossfuzz,\n  fz_free_ossfuzz\n};\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fz_context *ctx;\n  fz_stream *stream;\n  fz_document *doc;\n  fz_pixmap *pix;\n\n  used = 0;\n\n  ctx = fz_new_context(&fz_alloc_ossfuzz, nullptr, FZ_STORE_DEFAULT);\n  stream = NULL;\n  doc = NULL;\n  pix = NULL;\n\n  fz_var(stream);\n  fz_var(doc);\n  fz_var(pix);\n\n  fz_try(ctx) {\n    fz_register_document_handlers(ctx);\n    stream = fz_open_memory(ctx, data, size);\n    doc = fz_open_document_with_stream(ctx, \"pdf\", stream);\n\n    for (int i = 0; i < fz_count_pages(ctx, doc); i++) {\n      pix = fz_new_pixmap_from_page_number(ctx, doc, i, fz_identity, fz_device_rgb(ctx), 0);\n      fz_drop_pixmap(ctx, pix);\n      pix = NULL;\n    }\n  }\n  fz_always(ctx) {\n    fz_drop_pixmap(ctx, pix);\n    fz_drop_document(ctx, doc);\n    fz_drop_stream(ctx, stream);\n  }\n  fz_catch(ctx) {\n    fz_report_error(ctx);\n    fz_log_error(ctx, \"error rendering pages\");\n  }\n\n  fz_flush_warnings(ctx);\n  fz_drop_context(ctx);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/mupdf/pdf_fuzzer.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\n"
  },
  {
    "path": "projects/mupdf/project.yaml",
    "content": "main_repo: git://git.ghostscript.com/mupdf.git\nhomepage: \"https://www.mupdf.com\"\nlanguage: c++\nprimary_contact: tor.andersson@artifex.com\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\nauto_ccs:\n  - jonathan@titanous.com\n  - sebastian.rasmussen@artifex.com\n  - julians.artifex@gmail.com\n  - ken.sharp@artifex.com\n  - robin.watts@artifex.com\n"
  },
  {
    "path": "projects/mutagen/Dockerfile",
    "content": "# Copyright 2023 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone \\\n\t--depth 1 \\\n\thttps://github.com/quodlibet/mutagen\n\nWORKDIR mutagen\n\nCOPY build.sh fuzz_parser.py $SRC/\n"
  },
  {
    "path": "projects/mutagen/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\nzip -j $OUT/fuzz_parser_seed_corpus.zip tests/data/*\n"
  },
  {
    "path": "projects/mutagen/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\n\nimport sys\nimport io\nimport mutagen\n\ndef TestOneInput(data: bytes) -> int:\n  try:\n      f = mutagen.File(io.BytesIO(data))\n      if f is None:\n          return 0\n\n      if f.tags:\n        f.tags.pprint()\n      if f.info:\n        f.info.pprint()\n\n      out = io.BytesIO()\n      f.delete(out)\n      f.save(out)\n      mutagen.File(out)\n  except mutagen.MutagenError:\n    return 0\n  return 0\n\n\natheris.instrument_all()\natheris.Setup(sys.argv, TestOneInput)\natheris.Fuzz()\n"
  },
  {
    "path": "projects/mutagen/project.yaml",
    "content": "homepage: \"https://mutagen.readthedocs.io\"\nmain_repo: \"https://github.com/quodlibet/mutagen\"\nlanguage: python\nprimary_contact: \"reiter.christoph@gmail.com\"\nauto_ccs:\n  - \"julien.voisin@dustri.org\"\n  - \"phw@uploadedlobster.com\"\n  - \"ph.wolfer@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/mvel/.gitignore",
    "content": "project-parent/mvel\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/mvel/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/mvel\nRUN git clone --depth 1 https://github.com/mvel/mvel/ $SRC/project-parent/mvel\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/mvel/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=mvel\nPROJECT_GROUP_ID=org.mvel\nPROJECT_ARTIFACT_ID=mvel2\nMAIN_REPOSITORY=https://github.com/mvel/mvel/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -Denforcer.skip=true -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n--disabled_hooks=com.code_intelligence.jazzer.sanitizers.ExpressionLanguageInjection:com.code_intelligence.jazzer.sanitizers.RegexInjection \\\n  \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/mvel/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.mvel</groupId>\n            <artifactId>mvel2</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/mvel/project-parent/fuzz-targets/src/test/java/com/example/MvelFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.mvel2.MVEL;\nimport org.mvel2.CompileException;\nimport org.mvel2.ScriptRuntimeException;\nimport org.mvel2.UnresolveablePropertyException;\n\nclass MvelFuzzer {\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        String input = data.consumeRemainingAsString();\n        try {\n            MVEL.eval(input);\n            MVEL.compileExpression(input);\n        } catch (UnresolveablePropertyException | CompileException | ArithmeticException | ScriptRuntimeException e) {\n            // Documented Exceptions\n        } catch (java.lang.AssertionError | RuntimeException e) {\n            // Not expected to be thrown but we catch to reach deeper program states.\n        }\n    }\n}"
  },
  {
    "path": "projects/mvel/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>mvel</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/mvel/project.yaml",
    "content": "homepage: \"https://github.com/mvel/mvel/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/mvel/mvel/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/mxj/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/clbanning/mxj mxj\nRUN wget https://go.dev/dl/go1.24.6.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.6.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.24.6.linux-amd64.tar.gz\nCOPY build.sh $SRC/\nCOPY fuzz.go $SRC/mxj\nWORKDIR $SRC/mxj\n"
  },
  {
    "path": "projects/mxj/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif ! [[ -f go.mod ]]; then\n  go mod init mxj\nfi\n\nrm example_test.go\ncompile_go_fuzzer . FuzzMapXml  fuzz_map_xml gofuzz\n"
  },
  {
    "path": "projects/mxj/fuzz.go",
    "content": "package mxj\n\nfunc FuzzMapXml(data []byte) int {\n\tm, err := NewMapXml(data)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\t_, err = m.Xml()\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn 1\n}\n"
  },
  {
    "path": "projects/mxj/project.yaml",
    "content": "homepage: \"https://github.com/clbanning/mxj\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/clbanning/mxj\"\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/myanmar-tools/Dockerfile",
    "content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get -y install \\\n    build-essential \\\n    cmake \\\n    libunwind-dev\nRUN git clone https://github.com/google/myanmar-tools.git\nWORKDIR $SRC/myanmar-tools\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/myanmar-tools/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/myanmar-tools/clients/cpp\nmkdir build\ncd build\ncmake -DCMAKE_C_COMPILER=\"$CC\" -DCMAKE_CXX_COMPILER=\"$CXX\" \\\n    -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ..\nmake all\n\n# Note: don't use the myanmartools_fuzz CMake target directly because we want\n# to link with LIB_FUZZING_ENGINE instead of the default fuzzer.\n$CXX $CXXFLAGS -std=c++11 -I../public -L. \\\n    ../zawgyi_detector_fuzz_target.cpp \\\n    -Wl,-Bstatic -lmyanmartools_static -lglog -lunwind -llzma -Wl,-Bdynamic \\\n    -o $OUT/zawgyi_detector_fuzz_target \\\n    $LIB_FUZZING_ENGINE\n"
  },
  {
    "path": "projects/myanmar-tools/project.yaml",
    "content": "homepage: \"https://github.com/googlei18n/myanmar-tools/\"\nlanguage: c++\nprimary_contact: \"sffc@google.com\"\nauto_ccs:\n  - \"ccornelius@google.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\ncoverage_extra_args: -ignore-filename-regex=.*/\\.hunter/.*\nmain_repo: 'https://github.com/google/myanmar-tools.git'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/mybatis-3/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.11/bin/mvn\nENV PATH=\"$JAVA_HOME/bin:$PATH\"\nRUN git clone --depth 1 https://github.com/mybatis/mybatis-3 mybatis-3\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/mybatis-3\n"
  },
  {
    "path": "projects/mybatis-3/PooledDataSourceFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.ibatis.datasource.pooled.PooledDataSource;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-11\n// Heuristic name: jvm-autofuzz-heuristics-11\n// Target method: [org.apache.ibatis.datasource.pooled.PooledDataSource] public <init>(java.lang.String,java.lang.String,java.lang.String,java.lang.String)\npublic class PooledDataSourceFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    new PooledDataSource(data.consumeString(data.remainingBytes() / 2),\n        data.consumeString(data.remainingBytes() / 2),\n        data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/mybatis-3/ResolverUtilFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.ibatis.io.ResolverUtil;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-10\n// Heuristic name: jvm-autofuzz-heuristics-10\n// Target method: [org.apache.ibatis.io.ResolverUtil] public org.apache.ibatis.io.ResolverUtil findAnnotated(java.lang.Class,java.lang.String[])\n// Target method: [org.apache.ibatis.io.ResolverUtil] public org.apache.ibatis.io.ResolverUtil findImplementations(java.lang.Class,java.lang.String[])\npublic class ResolverUtilFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    ResolverUtil obj = new ResolverUtil();\n\n    if (data.consumeBoolean()) {\n      obj.findAnnotated(\n          ResolverUtilFuzzer.class, new java.lang.String[] {data.consumeRemainingAsString()});\n    } else {\n      obj.findImplementations(\n          ResolverUtilFuzzer.class, new java.lang.String[] {data.consumeRemainingAsString()});\n    }\n  }\n}\n"
  },
  {
    "path": "projects/mybatis-3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./target/mybatis-$CURRENT_VERSION.jar\" $OUT/mybatis.jar\n\nALL_JARS='mybatis.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\ncp -r $JAVA_HOME $OUT/\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  $JAVA_HOME/bin/javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  export JAVA_HOME=\\$this_dir/$(basename $JAVA_HOME)\n  export LD_LIBRARY_PATH=\"\\$JAVA_HOME/lib/server\":\\$this_dir\n  export PATH=\\$JAVA_HOME/bin:\\$PATH\n\n  \\$this_dir/jazzer_driver                          \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/mybatis-3/project.yaml",
    "content": "homepage: https://github.com/mybatis/mybatis-3\nmain_repo: https://github.com/mybatis/mybatis-3\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/mysql-connector-j/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.12-bin.zip -o ant.zip && \\\n    unzip ant.zip -d $SRC/ant && \\\n    rm -rf ant.zip\n\nENV ANT $SRC/ant/apache-ant-1.10.12/bin/ant\n\n#\n# deploy mysql-server\n#\nRUN apt-get install -y mysql-server\n\n#\n# Source build instructions on\n#   https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-installing-source.html\n#\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone --branch release/8.0 https://github.com/mysql/mysql-connector-j.git\n\n#\n# download and provision dependencies\n#\nRUN mkdir mysql-connector-j/lib\n\nRUN curl -o mysql-connector-j/lib/junit-jupiter-api-5.8.2.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.8.2/junit-jupiter-api-5.8.2.jar\nRUN curl -o mysql-connector-j/lib/junit-jupiter-engine-5.8.2.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.8.2/junit-jupiter-engine-5.8.2.jar\nRUN curl -o mysql-connector-j/lib/junit-platform-commons-1.8.2.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/1.8.2/junit-platform-commons-1.8.2.jar\nRUN curl -o mysql-connector-j/lib/junit-platform-engine-1.8.2.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/1.8.2/junit-platform-engine-1.8.2.jar\nRUN curl -o mysql-connector-j/lib/junit-platform-launcher-1.8.2.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/1.8.2/junit-platform-launcher-1.8.2.jar                        \nRUN curl -o mysql-connector-j/lib/apiguardian-api-1.1.2.jar https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar\nRUN curl -o mysql-connector-j/lib/opentest4j-1.2.0.jar https://repo1.maven.org/maven2/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar\nRUN curl -o mysql-connector-j/lib/javassist-3.28.0-GA.jar https://repo1.maven.org/maven2/org/javassist/javassist/3.28.0-GA/javassist-3.28.0-GA.jar\nRUN curl -o mysql-connector-j/lib/protobuf-java-3.19.4.jar https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.19.4/protobuf-java-3.19.4.jar\nRUN curl -o mysql-connector-j/lib/slf4j-api-1.7.35.jar https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.35/slf4j-api-1.7.35.jar\nRUN curl -o mysql-connector-j/lib/hamcrest-2.2.jar https://repo1.maven.org/maven2/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar\nRUN curl -o mysql-connector-j/lib/oci-java-sdk-common-2.14.1.jar https://repo1.maven.org/maven2/com/oracle/oci/sdk/oci-java-sdk-common/2.14.1/oci-java-sdk-common-2.14.1.jar\n\n#\n# get rid of 'java version \"1.8' version test that fails on 'java version \"15'\n#\nRUN cp mysql-connector-j/build.xml mysql-connector-j/build.xml.orig\nRUN cat mysql-connector-j/build.xml.orig | sed '/version \\&quot;1.8/d' > mysql-connector-j/build.xml\n\nCOPY entrypoint.sh $SRC/entrypoint.sh\nRUN  chmod +x $SRC/entrypoint.sh\n\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/mysql-connector-j"
  },
  {
    "path": "projects/mysql-connector-j/ServerLoginFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSet;\nimport java.sql.ResultSetMetaData;\nimport java.sql.SQLException;\nimport java.sql.Statement;\n\npublic class ServerLoginFuzzer extends TestServer {\n\n\tServerLoginFuzzer() {\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataPovider) throws Exception {\n\t\tServerLoginFuzzer closure = new ServerLoginFuzzer();\n\t\ttry {\n\t\t\tclosure.getConnection(fuzzedDataPovider.consumeRemainingAsString());\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace(System.out);\n\t\t\t/* documented, ignore */\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/mysql-connector-j/SqlPreparedStatementFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSet;\nimport java.sql.ResultSetMetaData;\nimport java.sql.SQLException;\nimport java.sql.Statement;\n\npublic class SqlPreparedStatementFuzzer extends TestServer {\n\n\tSqlPreparedStatementFuzzer() {\n\t}\n\n\tvoid updateRow(FuzzedDataProvider fuzzedDataPovider) throws SQLException {\n\t\ttry(Connection connection = getConnection()) {\n\t\t\tPreparedStatement statement = connection.prepareStatement(\"UPDATE TestTable SET v=? WHERE k=?\");\n\t\t\tstatement.setInt(2, fuzzedDataPovider.consumeInt());\n\t\t\tstatement.setString(1, fuzzedDataPovider.consumeRemainingAsString());\n\t\t\tstatement.executeUpdate();\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataPovider) {\n\t\tSqlPreparedStatementFuzzer closure = new SqlPreparedStatementFuzzer();\n\t\ttry {\n\t\t\tclosure.createTestTable();\n\t\t\tclosure.updateRow(fuzzedDataPovider);\n\t\t} catch (SQLException ex) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/mysql-connector-j/SqlStatementFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSet;\nimport java.sql.ResultSetMetaData;\nimport java.sql.SQLException;\nimport java.sql.Statement;\n\npublic class SqlStatementFuzzer extends TestServer {\n\n\tSqlStatementFuzzer() {\n\t}\n\n\tvoid updateRow(FuzzedDataProvider fuzzedDataPovider) throws SQLException {\n\t\ttry(Connection connection = getConnection()) {\n\t\t\tStatement statement = connection.createStatement();\n\t\t\tstatement.execute(fuzzedDataPovider.consumeRemainingAsString());\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataPovider) {\n\t\tSqlStatementFuzzer closure = new SqlStatementFuzzer();\n\t\ttry {\n\t\t\tclosure.createTestTable();\n\t\t\tclosure.updateRow(fuzzedDataPovider);\n\t\t} catch (SQLException ex) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/mysql-connector-j/TestServer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.sql.Statement;\n\npublic class TestServer {\n\n\tTestServer() {\n\t\t\n\t}\n\n\tstatic boolean m_dummy = initializeMysqlConnectorJ();\n\n\t/*\n\t * https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-usagenotes-connect-drivermanager.html\n\t */\n\tstatic boolean initializeMysqlConnectorJ() {\n\t\ttry {\n            // The newInstance() call is a work around for some\n            // broken Java implementations\n\n            Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n        } catch (Exception ex) {\n            // handle the error\n\t\t\tSystem.err.println(\"Can't load mysql-connector-j'\");\n        }\n\t\treturn true;\n\t}\n\n\tvoid createTestTable() throws SQLException {\n\t\ttry (Connection connection = getConnection()) {\n\t\t\tStatement statement = connection.createStatement();\n\t\t\n\t\t\tstatement.execute(\"DROP TABLE IF EXISTS TestTable\");\n\t\t\tstatement.execute(\"CREATE TABLE TestTable (k INTEGER, v VARCHAR(256))\");\n\t\t\tstatement.execute(\"INSERT INTO TestTable VALUES (0, \\\"Hello\\\"),(1, \\\"World\\\")\");\n\t\t}\n\t}\n\n\tString getUserName() {\n\t\treturn \"test\";\n\t}\n\n\tString getPassword() {\n\t\treturn \"test\";\n\t}\n\n\tConnection getConnection(String connectionOptions) throws SQLException {\n\t\treturn DriverManager.getConnection(\"jdbc:mysql://localhost/test?\" + connectionOptions, getUserName(), getPassword());\n\t}\n\n\tConnection getConnection() throws SQLException {\n\t\treturn getConnection(\"\");\n\t}\n}"
  },
  {
    "path": "projects/mysql-connector-j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nANT_ARGS=\"-Dcom.mysql.cj.build.jdk=$(realpath $(dirname $(which javac))/..)\"\n\nALL_JARS=\"\"\n\npushd \"${SRC}/mysql-connector-j\"\n\t$ANT ${ANT_ARGS} dist\n\n\t#\n\t# build directory contains only the emited jar and the lib/ population,\n\t# all of which we depend on.\n\t#\n\tfind -name '*.jar' -exec cp {} ${OUT} \\;\n\tALL_JARS=\"${ALL_JARS} $(find . -name '*.jar' -exec basename {} \\;)\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n# copy the mysqld launcher to $OUT\ncp $SRC/entrypoint.sh $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# start mysql and setup it\n\\$(dirname \\\"\\$0\\\")/entrypoint.sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.SqlInjection\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/mysql-connector-j/entrypoint.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n_is_sourced() {\n\t# https://unix.stackexchange.com/a/215279\n\t[ \"${#FUNCNAME[@]}\" -ge 2 ] \\\n\t\t&& [ \"${FUNCNAME[0]}\" = '_is_sourced' ] \\\n\t\t&& [ \"${FUNCNAME[1]}\" = 'source' ]\n}\n\n_main() {\n\t/etc/init.d/mysql start\n\t(echo \"CREATE USER 'test' IDENTIFIED BY 'test' ;\" | mysql) || true\n\t(echo \"GRANT ALL PRIVILEGES ON *.* TO 'test';\" | mysql) || true\n\t(echo \"DROP DATABASE test\" | mysql --user=test --password=test) || true\n\t(echo \"CREATE DATABASE test\" | mysql --user=test --password=test) || true\n\texec \"$@\"\n}\n\nif ! _is_sourced; then\n\t_main \"$@\"\nfi"
  },
  {
    "path": "projects/mysql-connector-j/project.yaml",
    "content": "homepage: \"https://dev.mysql.com/doc/connector-j/8.0/en/\"\nlanguage: jvm\nmain_repo: \"https://github.com/mysql/mysql-connector-j\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/mysql-server/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y build-essential libssl-dev libncurses5-dev libncursesw5-dev make cmake perl bison pkg-config chrpath libtirpc-dev\nRUN git clone --depth 1 https://github.com/mysql/mysql-server\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fix.diff $SRC/\n#TODO merge custom targets upstream\n#COPY targets $SRC/mysql-server/fuzz\n#RUN cd mysql-server && git apply ../fix.diff\n"
  },
  {
    "path": "projects/mysql-server/build.sh",
    "content": "\n#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd mysql-server\nmkdir build\ncd build\n# maybe we need to add WITH_LSAN\nexport MY_SANITIZER=\"-DWITH_ASAN=ON\"\nif [[ $SANITIZER = *undefined* ]]; then\n    export MY_SANITIZER=\"-DWITH_UBSAN=ON\"\nfi\n# not handling yet WITH_MSAN nor WITH_TSAN\ncmake .. -DBUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -DWITH_SSL=system -DCMAKE_INSTALL_PREFIX=$OUT/mysql -DWITH_LD=lld $MY_SANITIZER -DCMAKE_VERBOSE_MAKEFILE=ON\nmake -j$(nproc)\nmkdir -p $OUT/lib/\ncp library_output_directory/libmysql*.so.* $OUT/lib/\n(\ncd runtime_output_directory/\nls *fuzz* | while read i; do\n    cp $i $OUT/\n    chrpath -r '$ORIGIN/lib' $OUT/$i\ndone\n)\n\n#TODO merge custom targets upstream\n#cp ../fuzz/fuzz*.options $OUT/\n#cp ../fuzz/fuzz*.dict $OUT/\n#cp ../fuzz/init*.sql $OUT/\n\n#rm -Rf $OUT/mysql/data\n#$OUT/mysql/bin/mysqld --user=root --initialize-insecure --log-error-verbosity=5 --skip-ssl --datadir=$OUT/mysql/data --basedir=$OUT/mysql/\n"
  },
  {
    "path": "projects/mysql-server/fix.diff",
    "content": "diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex 7387743852f..f51487c0442 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -858,6 +858,7 @@ IF(WITH_JEMALLOC AND (WITH_TCMALLOC OR WITH_TCMALLOC_DEBUG))\n   MESSAGE(FATAL_ERROR \"Specify only *one* of WITH_TCMALLOC and WITH_JEMALLOC\")\n ENDIF()\n \n+OPTION(FUZZING \"Fuzzing\" OFF)\n OPTION(ENABLED_PROFILING \"Enable profiling\" ON)\n OPTION(WITHOUT_SERVER OFF)\n \n@@ -2246,6 +2247,10 @@ IF(NOT WITHOUT_SERVER AND WITH_UNIT_TESTS)\n   ENDIF()\n ENDIF()\n \n+IF (FUZZING)\n+  ADD_SUBDIRECTORY(fuzz)\n+ENDIF()\n+\n # scripts/mysql_config depends on client and server targets loaded above.\n # It is referenced by some of the directories below, so we insert it here.\n ADD_SUBDIRECTORY(scripts)\ndiff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake\nindex 1255b11d75e..6000a0d6a83 100644\n--- a/cmake/os/Linux.cmake\n+++ b/cmake/os/Linux.cmake\n@@ -92,7 +92,8 @@ IF(NOT WITH_ASAN AND\n    NOT WITH_LSAN AND\n    NOT WITH_MSAN AND\n    NOT WITH_TSAN AND\n-   NOT WITH_UBSAN)\n+   NOT WITH_UBSAN AND\n+   NOT FUZZING)\n   SET(LINK_FLAG_NO_UNDEFINED \"-Wl,--no-undefined\")\n   SET(LINK_FLAG_Z_DEFS \"-z,defs\")\n ENDIF()\ndiff --git a/include/mysql.h b/include/mysql.h\nindex c995f324d77..41e0a05041c 100644\n--- a/include/mysql.h\n+++ b/include/mysql.h\n@@ -264,7 +264,8 @@ enum mysql_protocol_type {\n   MYSQL_PROTOCOL_TCP,\n   MYSQL_PROTOCOL_SOCKET,\n   MYSQL_PROTOCOL_PIPE,\n-  MYSQL_PROTOCOL_MEMORY\n+  MYSQL_PROTOCOL_MEMORY,\n+  MYSQL_PROTOCOL_FUZZ\n };\n \n enum mysql_ssl_mode {\ndiff --git a/include/mysql.h.pp b/include/mysql.h.pp\nindex 9456b05f943..d965662bf4a 100644\n--- a/include/mysql.h.pp\n+++ b/include/mysql.h.pp\n@@ -492,7 +492,8 @@ enum mysql_protocol_type {\n   MYSQL_PROTOCOL_TCP,\n   MYSQL_PROTOCOL_SOCKET,\n   MYSQL_PROTOCOL_PIPE,\n-  MYSQL_PROTOCOL_MEMORY\n+  MYSQL_PROTOCOL_MEMORY,\n+  MYSQL_PROTOCOL_FUZZ\n };\n enum mysql_ssl_mode {\n   SSL_MODE_DISABLED = 1,\ndiff --git a/include/violite.h b/include/violite.h\nindex f290d8714e6..70ccf2c99e0 100644\n--- a/include/violite.h\n+++ b/include/violite.h\n@@ -109,12 +109,14 @@ enum enum_vio_type : int {\n   */\n   VIO_TYPE_PLUGIN = 7,\n \n+  VIO_TYPE_FUZZ = 8,\n+\n   FIRST_VIO_TYPE = VIO_TYPE_TCPIP,\n   /*\n     If a new type is added, please update LAST_VIO_TYPE. In addition, please\n     change get_vio_type_name() in vio/vio.c to return correct name for it.\n   */\n-  LAST_VIO_TYPE = VIO_TYPE_PLUGIN\n+  LAST_VIO_TYPE = VIO_TYPE_FUZZ\n };\n \n /**\n@@ -450,4 +452,19 @@ struct Vio {\n \n #define SSL_handle SSL *\n \n+//Vio fuzzing\n+bool vio_connect_fuzz(MYSQL_VIO vio, struct sockaddr *addr, socklen_t len,\n+                        int timeout);\n+int vio_socket_timeout_fuzz(Vio *vio, uint which, bool b);\n+void sock_initfuzz(const uint8_t *Data, size_t Size);\n+size_t vio_read_buff_fuzz(Vio *vio, uchar *buf, size_t size);\n+size_t vio_write_buff_fuzz(Vio *vio, const uchar *buf, size_t size);\n+bool vio_is_connected_fuzz(Vio *vio);\n+bool vio_was_timeout_fuzz(Vio *vio);\n+int vio_shutdown_fuzz(Vio *vio);\n+int vio_keepalive_fuzz(Vio *vio, bool set_keep_alive);\n+int vio_io_wait_fuzz(Vio *vio, enum enum_vio_io_event event, int timeout);\n+int vio_fastsend_fuzz(Vio *vio);\n+bool vio_should_retry_fuzz(Vio *vio);\n+\n #endif /* vio_violite_h_ */\ndiff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt\nindex f829e96c736..5016873e445 100644\n--- a/libmysql/CMakeLists.txt\n+++ b/libmysql/CMakeLists.txt\n@@ -363,11 +363,11 @@ IF(LINUX_STANDALONE AND KERBEROS_CUSTOM_LIBRARY)\n ENDIF()\n \n IF(UNIX)\n-  IF(LINK_FLAG_Z_DEFS)\n+  IF(LINK_FLAG_Z_DEFS AND NOT FUZZING)\n     MY_TARGET_LINK_OPTIONS(libmysql \"LINKER:${LINK_FLAG_Z_DEFS}\")\n   ENDIF()\n \n-  IF(LINUX)\n+  IF(LINUX AND NOT FUZZING)\n     CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)\n     MY_TARGET_LINK_OPTIONS(libmysql\n       \"LINKER:--version-script=${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver\")\ndiff --git a/mysys/my_rnd.cc b/mysys/my_rnd.cc\nindex 593a78e0384..62e49c207c6 100644\n--- a/mysys/my_rnd.cc\n+++ b/mysys/my_rnd.cc\n@@ -48,6 +48,9 @@\n */\n \n double my_rnd(struct rand_struct *rand_st) {\n+  #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+    return 65.43;\n+  #endif\n   rand_st->seed1 = (rand_st->seed1 * 3 + rand_st->seed2) % rand_st->max_value;\n   rand_st->seed2 = (rand_st->seed1 + rand_st->seed2 + 33) % rand_st->max_value;\n   return (((double)rand_st->seed1) / rand_st->max_value_dbl);\n@@ -64,6 +67,13 @@ Fill a buffer with random bytes using the SSL library routines\n */\n int my_rand_buffer(unsigned char *buffer, size_t buffer_size) {\n   int rc;\n+\n+  #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+    for (size_t i = 0; i < buffer_size; i++)\n+      buffer[i] = i;\n+    return 0;\n+  #endif\n+\n   rc = RAND_bytes(buffer, (int)buffer_size);\n \n   if (!rc) {\n@@ -84,6 +94,10 @@ int my_rand_buffer(unsigned char *buffer, size_t buffer_size) {\n \n double my_rnd_ssl(bool *failed) {\n   unsigned int res;\n+\n+  #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+    return 34.56;\n+  #endif\n \n   if (my_rand_buffer((unsigned char *)&res, sizeof(res))) {\n     *failed = true;\ndiff --git a/sql-common/client.cc b/sql-common/client.cc\nindex f66ffd1baa9..5b76362c045 100644\n--- a/sql-common/client.cc\n+++ b/sql-common/client.cc\n@@ -6368,6 +6368,12 @@ static mysql_state_machine_status csm_begin_connect(mysql_async_connect *ctx) {\n     }\n   }\n #endif /* _WIN32 */\n+if (!net->vio &&\n+      (mysql->options.protocol == MYSQL_PROTOCOL_FUZZ)) {\n+    net->vio =\n+        vio_new(0, VIO_TYPE_FUZZ, 0);\n+    ctx->host_info = (char *)ER_CLIENT(CR_LOCALHOST_CONNECTION);\n+}\n #if defined(HAVE_SYS_UN_H)\n   if (!net->vio &&\n       (!mysql->options.protocol ||\ndiff --git a/sql/mysqld.cc b/sql/mysqld.cc\nindex 90c2050ef66..5cc4d55b556 100644\n--- a/sql/mysqld.cc\n+++ b/sql/mysqld.cc\n@@ -7636,7 +7636,10 @@ int mysqld_main(int argc, char **argv)\n \n   keyring_lockable_init();\n \n-  my_init_signals();\n+  #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+    my_init_signals();\n+  #endif\n+\n   /*\n     Install server's my_abort routine to assure my_aborts prints signal info\n     sequentially without sudden termination.\n@@ -8119,8 +8122,10 @@ int mysqld_main(int argc, char **argv)\n     unireg_abort(MYSQLD_ABORT_EXIT);\n \n #ifndef _WIN32\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n   //  Start signal handler thread.\n   start_signal_handler();\n+#endif\n #endif\n   if (opt_authentication_policy &&\n       validate_authentication_policy(opt_authentication_policy)) {\n@@ -8163,8 +8168,9 @@ int mysqld_main(int argc, char **argv)\n   }\n \n   start_handle_manager();\n-\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n   create_compress_gtid_table_thread();\n+#endif\n \n   LogEvent()\n       .type(LOG_TYPE_ERROR)\n@@ -8210,6 +8216,10 @@ int mysqld_main(int argc, char **argv)\n                \"\\n\");\n \n   (void)RUN_HOOK(server_state, before_handle_connection, (nullptr));\n+\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+  return 0;\n+#endif\n \n #if defined(_WIN32)\n   if (mysqld_socket_acceptor != nullptr)\n@@ -11090,6 +11100,10 @@ static int get_options(int *argc_ptr, char ***argv_ptr) {\n \n   if (opt_short_log_format) opt_specialflag |= SPECIAL_SHORT_LOG_FORMAT;\n \n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+  Connection_handler_manager::thread_handling = Connection_handler_manager::SCHEDULER_NO_THREADS;\n+#endif\n+\n   if (Connection_handler_manager::init()) {\n     LogErr(ERROR_LEVEL, ER_CONNECTION_HANDLING_OOM);\n     return 1;\ndiff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc\nindex b3e498f7f51..fbc4d5d5514 100644\n--- a/storage/innobase/buf/buf0buf.cc\n+++ b/storage/innobase/buf/buf0buf.cc\n@@ -1489,18 +1489,14 @@ dberr_t buf_pool_init(ulint total_size, ulint n_instances) {\n       n = n_instances;\n     }\n \n-    std::vector<std::thread> threads;\n-\n     std::mutex m;\n \n     for (ulint id = i; id < n; ++id) {\n-      threads.emplace_back(std::thread(buf_pool_create, &buf_pool_ptr[id], size,\n-                                       id, &m, std::ref(errs[id])));\n+       buf_pool_create(&buf_pool_ptr[id], size,\n+                                       id, &m, std::ref(errs[id]));\n     }\n \n     for (ulint id = i; id < n; ++id) {\n-      threads[id - i].join();\n-\n       if (errs[id] != DB_SUCCESS) {\n         err = errs[id];\n       }\ndiff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt\nindex 474e307ea7f..17cb012807a 100644\n--- a/vio/CMakeLists.txt\n+++ b/vio/CMakeLists.txt\n@@ -27,6 +27,7 @@ SET(VIO_SOURCES\n   viosocket.cc\n   viossl.cc\n   viosslfactories.cc\n+  viofuzz.cc\n )\n \n IF(WIN32)\ndiff --git a/vio/vio.cc b/vio/vio.cc\nindex 97e450aa017..d2da7c9163b 100644\n--- a/vio/vio.cc\n+++ b/vio/vio.cc\n@@ -283,6 +283,25 @@ static bool vio_init(Vio *vio, enum enum_vio_type type, my_socket sd,\n       vio->set_blocking_flag = vio_set_blocking_flag;\n       vio->is_blocking_flag = true;\n       break;\n+    case VIO_TYPE_FUZZ:\n+      vio->viodelete = vio_delete;\n+      vio->vioerrno = vio_errno;\n+      vio->read = vio_read_buff_fuzz;\n+      vio->write = vio_write_buff_fuzz;\n+      vio->fastsend = vio_fastsend_fuzz;\n+      vio->viokeepalive = vio_keepalive_fuzz;\n+      vio->should_retry = vio_should_retry_fuzz;\n+      vio->was_timeout = vio_was_timeout_fuzz;\n+      vio->vioshutdown = vio_shutdown_fuzz;\n+      vio->peer_addr = vio_peer_addr;\n+      vio->timeout = vio_socket_timeout_fuzz;\n+      vio->io_wait = vio_io_wait_fuzz;\n+      vio->is_connected = vio_is_connected_fuzz;\n+      vio->has_data = vio->read_buffer ? vio_buff_has_data : has_no_data;\n+      vio->is_blocking = vio_is_blocking;\n+      vio->set_blocking = vio_set_blocking;\n+      vio->set_blocking_flag = vio_set_blocking_flag;\n+      vio->is_blocking_flag = false;\n \n     default:\n       vio->viodelete = vio_delete;\n@@ -574,7 +593,8 @@ static const vio_string vio_type_names[] = {{\"\", 0},\n                                             {STRING_WITH_LEN(\"SSL/TLS\")},\n                                             {STRING_WITH_LEN(\"Shared Memory\")},\n                                             {STRING_WITH_LEN(\"Internal\")},\n-                                            {STRING_WITH_LEN(\"Plugin\")}};\n+                                            {STRING_WITH_LEN(\"Plugin\")},\n+                                            {STRING_WITH_LEN(\"Fuzz\")}};\n \n void get_vio_type_name(enum enum_vio_type vio_type, const char **str,\n                        int *len) {\ndiff --git a/vio/viofuzz.cc b/vio/viofuzz.cc\nnew file mode 100644\nindex 00000000000..06df0e53529\n--- /dev/null\n+++ b/vio/viofuzz.cc\n@@ -0,0 +1,123 @@\n+#include \"my_config.h\"\n+\n+#include <errno.h>\n+#include <fcntl.h>\n+#include <sys/types.h>\n+#include <time.h>\n+#ifndef _WIN32\n+#include <netdb.h>\n+#endif\n+#include <stdio.h>\n+#include <stdlib.h>\n+\n+#include \"my_compiler.h\"\n+#include \"my_dbug.h\"\n+#include \"my_inttypes.h\"\n+#include \"my_io.h\"\n+#include \"my_macros.h\"\n+#include \"vio/vio_priv.h\"\n+\n+#ifdef FIONREAD_IN_SYS_FILIO\n+#include <sys/filio.h>\n+#endif\n+#ifndef _WIN32\n+#include <netinet/tcp.h>\n+#endif\n+#ifdef HAVE_POLL_H\n+#include <poll.h>\n+#endif\n+#ifdef HAVE_SYS_IOCTL_H\n+#include <sys/ioctl.h>\n+#endif\n+\n+static const uint8_t *fuzzBuffer;\n+static size_t fuzzSize;\n+static size_t fuzzPos;\n+\n+\n+void sock_initfuzz(const uint8_t *Data, size_t Size) {\n+    fuzzPos = 0;\n+    fuzzSize = Size;\n+    fuzzBuffer = Data;\n+}\n+\n+bool vio_connect_fuzz(Vio *vio, struct sockaddr *addr, socklen_t len,\n+                        int timeout) {\n+  DBUG_ENTER(\"vio_socket_connect\");\n+\n+  /* Only for socket-based transport types. */\n+  //DBUG_ASSERT(vio->type == VIO_TYPE_SOCKET || vio->type == VIO_TYPE_TCPIP);\n+\n+  /* Initiate the connection. */\n+  return 0;\n+}\n+\n+\n+int vio_socket_timeout_fuzz(Vio *vio, uint which, bool b) {\n+    DBUG_ENTER(\"vio_socket_timeout_fuzz\\n\");\n+    return 0;\n+}\n+\n+\n+size_t vio_read_buff_fuzz(Vio *vio, uchar *bufp, size_t size) {\n+    DBUG_ENTER(\"vio_read_buff_fuzz.\\n\");\n+    if (size > fuzzSize - fuzzPos) {\n+        size = fuzzSize - fuzzPos;\n+    }\n+    if (fuzzPos < fuzzSize) {\n+        memcpy(bufp, fuzzBuffer + fuzzPos, size);\n+    }\n+    fuzzPos += size;\n+#ifdef FUZZ_DEBUG\n+    printf(\"net cli %zu \", size);\n+    for (size_t i=0; i<size; i++)\n+        printf(\"%02x \", bufp[i]);\n+    printf(\"\\n\");\n+#endif //FUZZ_DEBUG\n+    return size;\n+}\n+\n+size_t vio_write_buff_fuzz(Vio *vio, const uchar *bufp, size_t size) {\n+    DBUG_ENTER(\"vio_write_buff_fuzz\\n\");\n+#ifdef FUZZ_DEBUG\n+    printf(\"net srv %zu \", size);\n+    for (size_t i=0; i<size; i++)\n+        printf(\"%02x \", bufp[i]);\n+    printf(\"\\n\");\n+#endif //FUZZ_DEBUG\n+    return size;\n+}\n+\n+bool vio_is_connected_fuzz(Vio *vio) {\n+    DBUG_ENTER(\"vio_is_connected_fuzz\\n\");\n+    return (fuzzPos < fuzzSize);\n+}\n+\n+bool vio_was_timeout_fuzz(Vio *vio) {\n+    DBUG_ENTER(\"vio_was_timeout_fuzz\\n\");\n+    return false;\n+}\n+\n+int vio_shutdown_fuzz(Vio *vio) {\n+    DBUG_ENTER(\"vio_shutdown_fuzz\");\n+    return 0;\n+}\n+\n+int vio_keepalive_fuzz(Vio *vio, bool set_keep_alive) {\n+    DBUG_ENTER(\"vio_keepalive_fuzz\\n\");\n+    return 0;\n+}\n+int vio_io_wait_fuzz(Vio *vio, enum enum_vio_io_event event, int timeout) {\n+    DBUG_ENTER(\"vio_io_wait_fuzz\");\n+    return 1;\n+}\n+\n+int vio_fastsend_fuzz(Vio *vio) {\n+    DBUG_ENTER(\"vio_fastsend_fuzz\\n\");\n+    return 0;\n+}\n+\n+bool vio_should_retry_fuzz(Vio *vio) {\n+    DBUG_ENTER(\"vio_should_retry_fuzz\\n\");\n+    return (fuzzPos < fuzzSize);\n+}\n"
  },
  {
    "path": "projects/mysql-server/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.mysql.com\"\nlanguage: c++\nprimary_contact: \"secalert_us@oracle.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n  - \"christopher.alves@telecomnancy.net\"\n  - \"zouhair.janati-idrissi@telecomnancy.net\"\n  - \"julien.zhan@telecomnancy.net\"\n\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/mysql/mysql-server'\n"
  },
  {
    "path": "projects/mysql-server/targets/CMakeLists.txt",
    "content": "if(NOT DEFINED ENV{LIB_FUZZING_ENGINE})\n  MYSQL_ADD_EXECUTABLE(fuzz_real_query fuzz_real_query.cc onefile.cc)\n  TARGET_LINK_LIBRARIES(fuzz_real_query mysqlclient)\n\n  MYSQL_ADD_EXECUTABLE(fuzz_stmt_fetch fuzz_stmt_fetch.cc onefile.cc)\n  TARGET_LINK_LIBRARIES(fuzz_stmt_fetch mysqlclient)\n\n  MYSQL_ADD_EXECUTABLE(fuzz_mysqld fuzz_mysqld.cc util_fuzz.cc onefile.cc)\n  TARGET_LINK_LIBRARIES(fuzz_mysqld sql_main sql_gis binlog rpl sql_dd mysys minchassis binlogevents_static ${ICU_LIBRARIES})\n\n  MYSQL_ADD_EXECUTABLE(fuzz_initfile fuzz_initfile.cc util_fuzz.cc onefile.cc)\n  TARGET_LINK_LIBRARIES(fuzz_initfile sql_main sql_gis binlog rpl sql_dd mysys minchassis binlogevents_static ${ICU_LIBRARIES})\nelse()\n  MYSQL_ADD_EXECUTABLE(fuzz_real_query fuzz_real_query.cc)\n  TARGET_LINK_LIBRARIES(fuzz_real_query mysqlclient)\n  TARGET_LINK_LIBRARIES(fuzz_real_query $ENV{LIB_FUZZING_ENGINE})\n\n  MYSQL_ADD_EXECUTABLE(fuzz_stmt_fetch fuzz_stmt_fetch.cc)\n  TARGET_LINK_LIBRARIES(fuzz_stmt_fetch mysqlclient)\n  TARGET_LINK_LIBRARIES(fuzz_stmt_fetch $ENV{LIB_FUZZING_ENGINE})\n\n  MYSQL_ADD_EXECUTABLE(fuzz_mysqld fuzz_mysqld.cc util_fuzz.cc)\n  TARGET_LINK_LIBRARIES(fuzz_mysqld sql_main sql_gis binlog rpl sql_dd mysys minchassis binlogevents_static ${ICU_LIBRARIES})\n  TARGET_LINK_LIBRARIES(fuzz_mysqld $ENV{LIB_FUZZING_ENGINE})\n\n  MYSQL_ADD_EXECUTABLE(fuzz_initfile fuzz_initfile.cc util_fuzz.cc)\n  TARGET_LINK_LIBRARIES(fuzz_initfile sql_main sql_gis binlog rpl sql_dd mysys minchassis binlogevents_static ${ICU_LIBRARIES})\n  TARGET_LINK_LIBRARIES(fuzz_initfile $ENV{LIB_FUZZING_ENGINE})\nendif()\n"
  },
  {
    "path": "projects/mysql-server/targets/README",
    "content": "This is the directory used for fuzzing, intended to be used with oss-fuzz. \n\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_docommand.cc",
    "content": "/* Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n//#include <stdint.h>\n//#include <stdlib.h>\n//#include <stdio.h>\n//#include <string>\n//#include <iostream>\n//#include <mysql.h>\n//#include <mysql/client_plugin.h>\n//#include <mysqld_error.h>\n#include \"sql/sql_class.h\"\n#include \"sql/protocol_classic.h\"\n#include \"sql/conn_handler/channel_info.h\"\n#include \"sql/conn_handler/connection_handler.h\"\n#include \"sql/conn_handler/connection_handler_manager.h\"\n#include \"sql/conn_handler/init_net_server_extension.h\"\n#include \"sql/conn_handler/connection_handler_impl.h\"\n#include \"sql/mysqld.h\"\n#include \"sql/set_var.h\"\n#include \"sql/rpl_handler.h\"\n#include \"sql/log.h\"\n#include \"sql/opt_costconstantcache.h\"\n#include \"sql/sql_plugin.h\"\n#include \"sql/sql_thd_internal_api.h\"\n#include \"sql/mysqld_thd_manager.h\"\n#include \"sql/sql_parse.h\"\n#include \"mysql/psi/mysql_socket.h\"\n#include \"violite.h\"\n#include \"util_fuzz.h\"\n#include <stdlib.h>\n#include <libgen.h>\n\nusing namespace std;\nFILE *logfile = NULL;\nConnection_handler_manager * chm;\nextern int mysqld_main(int argc, char **argv);\nchar *filepath = NULL;\n\nextern \"C\" int LLVMFuzzerInitialize(const int* argc, char*** argv) {\n    filepath = dirname(strdup((*argv)[0]));\n    return 0;\n}\n\n\n// FIXME: Fix this buffer with succesful authenticated connection for mysql 8.21.\nconst uint8_t startConn[] =\n\"\\xa6\\x00\\x00\\x01\\x85\\xa6\\xff\\x01\\x00\\x00\\x00\\x01\\x2d\\x00\\x00\\x00\" \\\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\" \\\n\"\\x00\\x00\\x00\\x00\\x72\\x6f\\x6f\\x74\\x00\\x01\\x00\\x6d\\x79\\x73\\x71\\x6c\" \\\n\"\\x5f\\x63\\x6c\\x65\\x61\\x72\\x5f\\x70\\x61\\x73\\x73\\x77\\x6f\\x72\\x64\\x00\" \\\n\"\\x69\\x04\\x5f\\x70\\x69\\x64\\x05\\x35\\x34\\x30\\x30\\x31\\x03\\x5f\\x6f\\x73\" \\\n\"\\x08\\x6f\\x73\\x78\\x31\\x30\\x2e\\x31\\x33\\x09\\x5f\\x70\\x6c\\x61\\x74\\x66\" \\\n\"\\x6f\\x72\\x6d\\x06\\x78\\x38\\x36\\x5f\\x36\\x34\\x0f\\x5f\\x63\\x6c\\x69\\x65\" \\\n\"\\x6e\\x74\\x5f\\x76\\x65\\x72\\x73\\x69\\x6f\\x6e\\x06\\x38\\x2e\\x30\\x2e\\x31\" \\\n\"\\x36\\x0c\\x5f\\x63\\x6c\\x69\\x65\\x6e\\x74\\x5f\\x6e\\x61\\x6d\\x65\\x08\\x6c\" \\\n\"\\x69\\x62\\x6d\\x79\\x73\\x71\\x6c\\x0c\\x70\\x72\\x6f\\x67\\x72\\x61\\x6d\\x5f\" \\\n\"\\x6e\\x61\\x6d\\x65\\x05\\x6d\\x79\\x73\\x71\\x6c\"\n\"\\x00\\x00\\x00\\x03\"\n;\n\n\nclass Channel_info_fuzz : public Channel_info {\n    bool m_is_admin_conn;\n\n    protected:\n    virtual Vio *create_and_init_vio() const {\n        Vio *vio = vio_new(0, VIO_TYPE_FUZZ, VIO_LOCALHOST);\n        return vio;\n    }\n\n    public:\n    Channel_info_fuzz(bool is_admin_conn) : m_is_admin_conn(is_admin_conn) {}\n\n    virtual THD *create_thd() {\n        Vio *vio_tmp = create_and_init_vio();\n        if (vio_tmp == NULL) return NULL;\n\n        THD *thd = new (std::nothrow) THD();\n        if (thd == NULL) {\n            vio_delete(vio_tmp);\n            return NULL;\n        }\n        thd->get_protocol_classic()->init_net(vio_tmp);\n        thd->set_admin_connection(m_is_admin_conn);\n        init_net_server_extension(thd);\n        return thd;\n    }\n\n    virtual bool is_admin_connection() const { return m_is_admin_conn; }\n};\n\n#define MAX_SIZE 256\n\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    if (Size < 1) {\n        return 0;\n    }\n    if (logfile == NULL) {\n        my_progname = \"fuzz_docommand\";\n        /* first init was run with\n         * mysqld --user=root --initialize-insecure --log-error-verbosity=5 --datadir=/out/mysql/data/ --basedir=/out/mysql/\n         */\n        utilfuzz_rmrf(\"/tmp/mysql_docommand\");\n        char command[MAX_SIZE];\n        char argbase[MAX_SIZE];\n        char arginitfile[MAX_SIZE];\n        snprintf(command, MAX_SIZE-1, \"%s/mysql/data\", filepath);\n        utilfuzz_cpr(command, \"/tmp/mysql_docommand\");\n\n        snprintf(argbase, MAX_SIZE-1, \"--basedir=%s/mysql/\", filepath);\n        snprintf(arginitfile, MAX_SIZE-1, \"--init-file=%s/initnopw.sql\", filepath);\n\n        char *fakeargv[] = {const_cast<char *>(\"fuzz_docommand\"),\n            const_cast<char *>(\"--user=root\"),\n            const_cast<char *>(\"--secure-file-priv=NULL\"),\n            const_cast<char *>(\"--log-error-verbosity=5\"),\n            const_cast<char *>(\"--explicit_defaults_for_timestamp\"),\n            //we should adapt vio_fuzz to give a socket to openssl in order to support ssl\n            const_cast<char *>(\"--skip-ssl\"),\n            const_cast<char *>(\"--mysqlx=0\"),\n            const_cast<char *>(\"--event-scheduler=DISABLED\"),\n            const_cast<char *>(\"--performance_schema=OFF\"),\n            const_cast<char *>(\"--thread_stack=1048576\"),\n            const_cast<char *>(\"--datadir=/tmp/mysql_docommand/\"),\n            const_cast<char *>(\"--port=3301\"),\n            const_cast<char *>(\"--socket=/tmp/docommand.sock\"),\n            const_cast<char *>(argbase),\n            const_cast<char *>(arginitfile),\n            0};\n        int fakeargc = 15;\n        mysqld_main(fakeargc, fakeargv);\n\n        chm = Connection_handler_manager::get_instance();\n        logfile = fopen(\"/dev/null\", \"w\");\n    }\n    Channel_info_fuzz * channel_info = new (std::nothrow) Channel_info_fuzz(true);\n    sock_initfuzz(startConn,sizeof(startConn));\n    if (my_thread_init()) {\n        channel_info->send_error_and_close_channel(ER_OUT_OF_RESOURCES, 0, false);\n        abort();\n    }\n\n    THD *thd_fuzz = channel_info->create_thd();\n    if (thd_fuzz == NULL) {\n        channel_info->send_error_and_close_channel(ER_OUT_OF_RESOURCES, 0, false);\n        abort();\n    }\n\n    thd_fuzz->set_new_thread_id();\n    thd_set_thread_stack(thd_fuzz, (char *)&thd_fuzz);\n    thd_fuzz->store_globals();\n    mysql_thread_set_psi_id(thd_fuzz->thread_id());\n    mysql_socket_set_thread_owner(\n                                  thd_fuzz->get_protocol_classic()->get_vio()->mysql_socket);\n    Global_THD_manager *thd_manager = Global_THD_manager::get_instance();\n    thd_manager->add_thd(thd_fuzz);\n    if (thd_prepare_connection(thd_fuzz)) {\n        abort();\n    }\n    delete channel_info;\n\n    // The fuzzing takes place on network data received from client\n    sock_initfuzz(Data,Size);\n\n    while (thd_connection_alive(thd_fuzz)) {\n        if (do_command(thd_fuzz)) break;\n    }\n    end_connection(thd_fuzz);\n    close_connection(thd_fuzz, 0, false, false);\n    thd_fuzz->release_resources();\n    thd_manager->remove_thd(thd_fuzz);\n    delete thd_fuzz;\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_docommand.dict",
    "content": "#SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS;\nACCESSIBLE=\"ACCESSIBLE\"\nACCOUNT=\"ACCOUNT\"\nACTION=\"ACTION\"\nACTIVE=\"ACTIVE\"\nADD=\"ADD\"\nADMIN=\"ADMIN\"\nAFTER=\"AFTER\"\nAGAINST=\"AGAINST\"\nAGGREGATE=\"AGGREGATE\"\nALGORITHM=\"ALGORITHM\"\nALL=\"ALL\"\nALTER=\"ALTER\"\nALWAYS=\"ALWAYS\"\nANALYZE=\"ANALYZE\"\nAND=\"AND\"\nANY=\"ANY\"\nAS=\"AS\"\nASC=\"ASC\"\nASCII=\"ASCII\"\nASENSITIVE=\"ASENSITIVE\"\nAT=\"AT\"\nAUTOEXTEND_SIZE=\"AUTOEXTEND_SIZE\"\nAUTO_INCREMENT=\"AUTO_INCREMENT\"\nAVG=\"AVG\"\nAVG_ROW_LENGTH=\"AVG_ROW_LENGTH\"\nBACKUP=\"BACKUP\"\nBEFORE=\"BEFORE\"\nBEGIN=\"BEGIN\"\nBETWEEN=\"BETWEEN\"\nBIGINT=\"BIGINT\"\nBINARY=\"BINARY\"\nBINLOG=\"BINLOG\"\nBIT=\"BIT\"\nBLOB=\"BLOB\"\nBLOCK=\"BLOCK\"\nBOOL=\"BOOL\"\nBOOLEAN=\"BOOLEAN\"\nBOTH=\"BOTH\"\nBTREE=\"BTREE\"\nBUCKETS=\"BUCKETS\"\nBY=\"BY\"\nBYTE=\"BYTE\"\nCACHE=\"CACHE\"\nCALL=\"CALL\"\nCASCADE=\"CASCADE\"\nCASCADED=\"CASCADED\"\nCASE=\"CASE\"\nCATALOG_NAME=\"CATALOG_NAME\"\nCHAIN=\"CHAIN\"\nCHANGE=\"CHANGE\"\nCHANGED=\"CHANGED\"\nCHANNEL=\"CHANNEL\"\nCHAR=\"CHAR\"\nCHARACTER=\"CHARACTER\"\nCHARSET=\"CHARSET\"\nCHECK=\"CHECK\"\nCHECKSUM=\"CHECKSUM\"\nCIPHER=\"CIPHER\"\nCLASS_ORIGIN=\"CLASS_ORIGIN\"\nCLIENT=\"CLIENT\"\nCLONE=\"CLONE\"\nCLOSE=\"CLOSE\"\nCOALESCE=\"COALESCE\"\nCODE=\"CODE\"\nCOLLATE=\"COLLATE\"\nCOLLATION=\"COLLATION\"\nCOLUMN=\"COLUMN\"\nCOLUMNS=\"COLUMNS\"\nCOLUMN_FORMAT=\"COLUMN_FORMAT\"\nCOLUMN_NAME=\"COLUMN_NAME\"\nCOMMENT=\"COMMENT\"\nCOMMIT=\"COMMIT\"\nCOMMITTED=\"COMMITTED\"\nCOMPACT=\"COMPACT\"\nCOMPLETION=\"COMPLETION\"\nCOMPONENT=\"COMPONENT\"\nCOMPRESSED=\"COMPRESSED\"\nCOMPRESSION=\"COMPRESSION\"\nCONCURRENT=\"CONCURRENT\"\nCONDITION=\"CONDITION\"\nCONNECTION=\"CONNECTION\"\nCONSISTENT=\"CONSISTENT\"\nCONSTRAINT=\"CONSTRAINT\"\nCONSTRAINT_CATALOG=\"CONSTRAINT_CATALOG\"\nCONSTRAINT_NAME=\"CONSTRAINT_NAME\"\nCONSTRAINT_SCHEMA=\"CONSTRAINT_SCHEMA\"\nCONTAINS=\"CONTAINS\"\nCONTEXT=\"CONTEXT\"\nCONTINUE=\"CONTINUE\"\nCONVERT=\"CONVERT\"\nCPU=\"CPU\"\nCREATE=\"CREATE\"\nCROSS=\"CROSS\"\nCUBE=\"CUBE\"\nCUME_DIST=\"CUME_DIST\"\nCURRENT=\"CURRENT\"\nCURRENT_DATE=\"CURRENT_DATE\"\nCURRENT_TIME=\"CURRENT_TIME\"\nCURRENT_TIMESTAMP=\"CURRENT_TIMESTAMP\"\nCURRENT_USER=\"CURRENT_USER\"\nCURSOR=\"CURSOR\"\nCURSOR_NAME=\"CURSOR_NAME\"\nDATA=\"DATA\"\nDATABASE=\"DATABASE\"\nDATABASES=\"DATABASES\"\nDATAFILE=\"DATAFILE\"\nDATE=\"DATE\"\nDATETIME=\"DATETIME\"\nDAY=\"DAY\"\nDAY_HOUR=\"DAY_HOUR\"\nDAY_MICROSECOND=\"DAY_MICROSECOND\"\nDAY_MINUTE=\"DAY_MINUTE\"\nDAY_SECOND=\"DAY_SECOND\"\nDEALLOCATE=\"DEALLOCATE\"\nDEC=\"DEC\"\nDECIMAL=\"DECIMAL\"\nDECLARE=\"DECLARE\"\nDEFAULT=\"DEFAULT\"\nDEFAULT_AUTH=\"DEFAULT_AUTH\"\nDEFINER=\"DEFINER\"\nDEFINITION=\"DEFINITION\"\nDELAYED=\"DELAYED\"\nDELAY_KEY_WRITE=\"DELAY_KEY_WRITE\"\nDELETE=\"DELETE\"\nDENSE_RANK=\"DENSE_RANK\"\nDESC=\"DESC\"\nDESCRIBE=\"DESCRIBE\"\nDESCRIPTION=\"DESCRIPTION\"\nDETERMINISTIC=\"DETERMINISTIC\"\nDIAGNOSTICS=\"DIAGNOSTICS\"\nDIRECTORY=\"DIRECTORY\"\nDISABLE=\"DISABLE\"\nDISCARD=\"DISCARD\"\nDISK=\"DISK\"\nDISTINCT=\"DISTINCT\"\nDISTINCTROW=\"DISTINCTROW\"\nDIV=\"DIV\"\nDO=\"DO\"\nDOUBLE=\"DOUBLE\"\nDROP=\"DROP\"\nDUAL=\"DUAL\"\nDUMPFILE=\"DUMPFILE\"\nDUPLICATE=\"DUPLICATE\"\nDYNAMIC=\"DYNAMIC\"\nEACH=\"EACH\"\nELSE=\"ELSE\"\nELSEIF=\"ELSEIF\"\nEMPTY=\"EMPTY\"\nENABLE=\"ENABLE\"\nENCLOSED=\"ENCLOSED\"\nENCRYPTION=\"ENCRYPTION\"\nEND=\"END\"\nENDS=\"ENDS\"\nENFORCED=\"ENFORCED\"\nENGINE=\"ENGINE\"\nENGINES=\"ENGINES\"\nENUM=\"ENUM\"\nERROR=\"ERROR\"\nERRORS=\"ERRORS\"\nESCAPE=\"ESCAPE\"\nESCAPED=\"ESCAPED\"\nEVENT=\"EVENT\"\nEVENTS=\"EVENTS\"\nEVERY=\"EVERY\"\nEXCEPT=\"EXCEPT\"\nEXCHANGE=\"EXCHANGE\"\nEXCLUDE=\"EXCLUDE\"\nEXECUTE=\"EXECUTE\"\nEXISTS=\"EXISTS\"\nEXIT=\"EXIT\"\nEXPANSION=\"EXPANSION\"\nEXPIRE=\"EXPIRE\"\nEXPLAIN=\"EXPLAIN\"\nEXPORT=\"EXPORT\"\nEXTENDED=\"EXTENDED\"\nEXTENT_SIZE=\"EXTENT_SIZE\"\nFALSE=\"FALSE\"\nFAST=\"FAST\"\nFAULTS=\"FAULTS\"\nFETCH=\"FETCH\"\nFIELDS=\"FIELDS\"\nFILE=\"FILE\"\nFILE_BLOCK_SIZE=\"FILE_BLOCK_SIZE\"\nFILTER=\"FILTER\"\nFIRST=\"FIRST\"\nFIRST_VALUE=\"FIRST_VALUE\"\nFIXED=\"FIXED\"\nFLOAT=\"FLOAT\"\nFLOAT4=\"FLOAT4\"\nFLOAT8=\"FLOAT8\"\nFLUSH=\"FLUSH\"\nFOLLOWING=\"FOLLOWING\"\nFOLLOWS=\"FOLLOWS\"\nFOR=\"FOR\"\nFORCE=\"FORCE\"\nFOREIGN=\"FOREIGN\"\nFORMAT=\"FORMAT\"\nFOUND=\"FOUND\"\nFROM=\"FROM\"\nFULL=\"FULL\"\nFULLTEXT=\"FULLTEXT\"\nFUNCTION=\"FUNCTION\"\nGENERAL=\"GENERAL\"\nGENERATED=\"GENERATED\"\nGEOMCOLLECTION=\"GEOMCOLLECTION\"\nGEOMETRY=\"GEOMETRY\"\nGEOMETRYCOLLECTION=\"GEOMETRYCOLLECTION\"\nGET=\"GET\"\nGET_FORMAT=\"GET_FORMAT\"\nGET_MASTER_PUBLIC_KEY=\"GET_MASTER_PUBLIC_KEY\"\nGLOBAL=\"GLOBAL\"\nGRANT=\"GRANT\"\nGRANTS=\"GRANTS\"\nGROUP=\"GROUP\"\nGROUPING=\"GROUPING\"\nGROUPS=\"GROUPS\"\nGROUP_REPLICATION=\"GROUP_REPLICATION\"\nHANDLER=\"HANDLER\"\nHASH=\"HASH\"\nHAVING=\"HAVING\"\nHELP=\"HELP\"\nHIGH_PRIORITY=\"HIGH_PRIORITY\"\nHISTOGRAM=\"HISTOGRAM\"\nHISTORY=\"HISTORY\"\nHOST=\"HOST\"\nHOSTS=\"HOSTS\"\nHOUR=\"HOUR\"\nHOUR_MICROSECOND=\"HOUR_MICROSECOND\"\nHOUR_MINUTE=\"HOUR_MINUTE\"\nHOUR_SECOND=\"HOUR_SECOND\"\nIDENTIFIED=\"IDENTIFIED\"\nIF=\"IF\"\nIGNORE=\"IGNORE\"\nIGNORE_SERVER_IDS=\"IGNORE_SERVER_IDS\"\nIMPORT=\"IMPORT\"\nIN=\"IN\"\nINACTIVE=\"INACTIVE\"\nINDEX=\"INDEX\"\nINDEXES=\"INDEXES\"\nINFILE=\"INFILE\"\nINITIAL_SIZE=\"INITIAL_SIZE\"\nINNER=\"INNER\"\nINOUT=\"INOUT\"\nINSENSITIVE=\"INSENSITIVE\"\nINSERT=\"INSERT\"\nINSERT_METHOD=\"INSERT_METHOD\"\nINSTALL=\"INSTALL\"\nINSTANCE=\"INSTANCE\"\nINT=\"INT\"\nINT1=\"INT1\"\nINT2=\"INT2\"\nINT3=\"INT3\"\nINT4=\"INT4\"\nINT8=\"INT8\"\nINTEGER=\"INTEGER\"\nINTERVAL=\"INTERVAL\"\nINTO=\"INTO\"\nINVISIBLE=\"INVISIBLE\"\nINVOKER=\"INVOKER\"\nIO=\"IO\"\nIO_AFTER_GTIDS=\"IO_AFTER_GTIDS\"\nIO_BEFORE_GTIDS=\"IO_BEFORE_GTIDS\"\nIO_THREAD=\"IO_THREAD\"\nIPC=\"IPC\"\nIS=\"IS\"\nISOLATION=\"ISOLATION\"\nISSUER=\"ISSUER\"\nITERATE=\"ITERATE\"\nJOIN=\"JOIN\"\nJSON=\"JSON\"\nJSON_TABLE=\"JSON_TABLE\"\nKEY=\"KEY\"\nKEYS=\"KEYS\"\nKEY_BLOCK_SIZE=\"KEY_BLOCK_SIZE\"\nKILL=\"KILL\"\nLAG=\"LAG\"\nLANGUAGE=\"LANGUAGE\"\nLAST=\"LAST\"\nLAST_VALUE=\"LAST_VALUE\"\nLATERAL=\"LATERAL\"\nLEAD=\"LEAD\"\nLEADING=\"LEADING\"\nLEAVE=\"LEAVE\"\nLEAVES=\"LEAVES\"\nLEFT=\"LEFT\"\nLESS=\"LESS\"\nLEVEL=\"LEVEL\"\nLIKE=\"LIKE\"\nLIMIT=\"LIMIT\"\nLINEAR=\"LINEAR\"\nLINES=\"LINES\"\nLINESTRING=\"LINESTRING\"\nLIST=\"LIST\"\nLOAD=\"LOAD\"\nLOCAL=\"LOCAL\"\nLOCALTIME=\"LOCALTIME\"\nLOCALTIMESTAMP=\"LOCALTIMESTAMP\"\nLOCK=\"LOCK\"\nLOCKED=\"LOCKED\"\nLOCKS=\"LOCKS\"\nLOGFILE=\"LOGFILE\"\nLOGS=\"LOGS\"\nLONG=\"LONG\"\nLONGBLOB=\"LONGBLOB\"\nLONGTEXT=\"LONGTEXT\"\nLOOP=\"LOOP\"\nLOW_PRIORITY=\"LOW_PRIORITY\"\nMASTER=\"MASTER\"\nMASTER_AUTO_POSITION=\"MASTER_AUTO_POSITION\"\nMASTER_BIND=\"MASTER_BIND\"\nMASTER_CONNECT_RETRY=\"MASTER_CONNECT_RETRY\"\nMASTER_DELAY=\"MASTER_DELAY\"\nMASTER_HEARTBEAT_PERIOD=\"MASTER_HEARTBEAT_PERIOD\"\nMASTER_HOST=\"MASTER_HOST\"\nMASTER_LOG_FILE=\"MASTER_LOG_FILE\"\nMASTER_LOG_POS=\"MASTER_LOG_POS\"\nMASTER_PASSWORD=\"MASTER_PASSWORD\"\nMASTER_PORT=\"MASTER_PORT\"\nMASTER_PUBLIC_KEY_PATH=\"MASTER_PUBLIC_KEY_PATH\"\nMASTER_RETRY_COUNT=\"MASTER_RETRY_COUNT\"\nMASTER_SERVER_ID=\"MASTER_SERVER_ID\"\nMASTER_SSL=\"MASTER_SSL\"\nMASTER_SSL_CA=\"MASTER_SSL_CA\"\nMASTER_SSL_CAPATH=\"MASTER_SSL_CAPATH\"\nMASTER_SSL_CERT=\"MASTER_SSL_CERT\"\nMASTER_SSL_CIPHER=\"MASTER_SSL_CIPHER\"\nMASTER_SSL_CRL=\"MASTER_SSL_CRL\"\nMASTER_SSL_CRLPATH=\"MASTER_SSL_CRLPATH\"\nMASTER_SSL_KEY=\"MASTER_SSL_KEY\"\nMASTER_SSL_VERIFY_SERVER_CERT=\"MASTER_SSL_VERIFY_SERVER_CERT\"\nMASTER_TLS_VERSION=\"MASTER_TLS_VERSION\"\nMASTER_USER=\"MASTER_USER\"\nMATCH=\"MATCH\"\nMAXVALUE=\"MAXVALUE\"\nMAX_CONNECTIONS_PER_HOUR=\"MAX_CONNECTIONS_PER_HOUR\"\nMAX_QUERIES_PER_HOUR=\"MAX_QUERIES_PER_HOUR\"\nMAX_ROWS=\"MAX_ROWS\"\nMAX_SIZE=\"MAX_SIZE\"\nMAX_UPDATES_PER_HOUR=\"MAX_UPDATES_PER_HOUR\"\nMAX_USER_CONNECTIONS=\"MAX_USER_CONNECTIONS\"\nMEDIUM=\"MEDIUM\"\nMEDIUMBLOB=\"MEDIUMBLOB\"\nMEDIUMINT=\"MEDIUMINT\"\nMEDIUMTEXT=\"MEDIUMTEXT\"\nMEMORY=\"MEMORY\"\nMERGE=\"MERGE\"\nMESSAGE_TEXT=\"MESSAGE_TEXT\"\nMICROSECOND=\"MICROSECOND\"\nMIDDLEINT=\"MIDDLEINT\"\nMIGRATE=\"MIGRATE\"\nMINUTE=\"MINUTE\"\nMINUTE_MICROSECOND=\"MINUTE_MICROSECOND\"\nMINUTE_SECOND=\"MINUTE_SECOND\"\nMIN_ROWS=\"MIN_ROWS\"\nMOD=\"MOD\"\nMODE=\"MODE\"\nMODIFIES=\"MODIFIES\"\nMODIFY=\"MODIFY\"\nMONTH=\"MONTH\"\nMULTILINESTRING=\"MULTILINESTRING\"\nMULTIPOINT=\"MULTIPOINT\"\nMULTIPOLYGON=\"MULTIPOLYGON\"\nMUTEX=\"MUTEX\"\nMYSQL_ERRNO=\"MYSQL_ERRNO\"\nNAME=\"NAME\"\nNAMES=\"NAMES\"\nNATIONAL=\"NATIONAL\"\nNATURAL=\"NATURAL\"\nNCHAR=\"NCHAR\"\nNDB=\"NDB\"\nNDBCLUSTER=\"NDBCLUSTER\"\nNESTED=\"NESTED\"\nNETWORK_NAMESPACE=\"NETWORK_NAMESPACE\"\nNEVER=\"NEVER\"\nNEW=\"NEW\"\nNEXT=\"NEXT\"\nNO=\"NO\"\nNODEGROUP=\"NODEGROUP\"\nNONE=\"NONE\"\nNOT=\"NOT\"\nNOWAIT=\"NOWAIT\"\nNO_WAIT=\"NO_WAIT\"\nNO_WRITE_TO_BINLOG=\"NO_WRITE_TO_BINLOG\"\nNTH_VALUE=\"NTH_VALUE\"\nNTILE=\"NTILE\"\nNULL=\"NULL\"\nNULLS=\"NULLS\"\nNUMBER=\"NUMBER\"\nNUMERIC=\"NUMERIC\"\nNVARCHAR=\"NVARCHAR\"\nOF=\"OF\"\nOFFSET=\"OFFSET\"\nOJ=\"OJ\"\nOLD=\"OLD\"\nON=\"ON\"\nONE=\"ONE\"\nONLY=\"ONLY\"\nOPEN=\"OPEN\"\nOPTIMIZE=\"OPTIMIZE\"\nOPTIMIZER_COSTS=\"OPTIMIZER_COSTS\"\nOPTION=\"OPTION\"\nOPTIONAL=\"OPTIONAL\"\nOPTIONALLY=\"OPTIONALLY\"\nOPTIONS=\"OPTIONS\"\nOR=\"OR\"\nORDER=\"ORDER\"\nORDINALITY=\"ORDINALITY\"\nORGANIZATION=\"ORGANIZATION\"\nOTHERS=\"OTHERS\"\nOUT=\"OUT\"\nOUTER=\"OUTER\"\nOUTFILE=\"OUTFILE\"\nOVER=\"OVER\"\nOWNER=\"OWNER\"\nPACK_KEYS=\"PACK_KEYS\"\nPAGE=\"PAGE\"\nPARSER=\"PARSER\"\nPARTIAL=\"PARTIAL\"\nPARTITION=\"PARTITION\"\nPARTITIONING=\"PARTITIONING\"\nPARTITIONS=\"PARTITIONS\"\nPASSWORD=\"PASSWORD\"\nPATH=\"PATH\"\nPERCENT_RANK=\"PERCENT_RANK\"\nPERSIST=\"PERSIST\"\nPERSIST_ONLY=\"PERSIST_ONLY\"\nPHASE=\"PHASE\"\nPLUGIN=\"PLUGIN\"\nPLUGINS=\"PLUGINS\"\nPLUGIN_DIR=\"PLUGIN_DIR\"\nPOINT=\"POINT\"\nPOLYGON=\"POLYGON\"\nPORT=\"PORT\"\nPRECEDES=\"PRECEDES\"\nPRECEDING=\"PRECEDING\"\nPRECISION=\"PRECISION\"\nPREPARE=\"PREPARE\"\nPRESERVE=\"PRESERVE\"\nPREV=\"PREV\"\nPRIMARY=\"PRIMARY\"\nPRIVILEGES=\"PRIVILEGES\"\nPROCEDURE=\"PROCEDURE\"\nPROCESS=\"PROCESS\"\nPROCESSLIST=\"PROCESSLIST\"\nPROFILE=\"PROFILE\"\nPROFILES=\"PROFILES\"\nPROXY=\"PROXY\"\nPURGE=\"PURGE\"\nQUARTER=\"QUARTER\"\nQUERY=\"QUERY\"\nQUICK=\"QUICK\"\nRANGE=\"RANGE\"\nRANK=\"RANK\"\nREAD=\"READ\"\nREADS=\"READS\"\nREAD_ONLY=\"READ_ONLY\"\nREAD_WRITE=\"READ_WRITE\"\nREAL=\"REAL\"\nREBUILD=\"REBUILD\"\nRECOVER=\"RECOVER\"\nRECURSIVE=\"RECURSIVE\"\nREDO_BUFFER_SIZE=\"REDO_BUFFER_SIZE\"\nREDUNDANT=\"REDUNDANT\"\nREFERENCE=\"REFERENCE\"\nREFERENCES=\"REFERENCES\"\nREGEXP=\"REGEXP\"\nRELAY=\"RELAY\"\nRELAYLOG=\"RELAYLOG\"\nRELAY_LOG_FILE=\"RELAY_LOG_FILE\"\nRELAY_LOG_POS=\"RELAY_LOG_POS\"\nRELAY_THREAD=\"RELAY_THREAD\"\nRELEASE=\"RELEASE\"\nRELOAD=\"RELOAD\"\nREMOVE=\"REMOVE\"\nRENAME=\"RENAME\"\nREORGANIZE=\"REORGANIZE\"\nREPAIR=\"REPAIR\"\nREPEAT=\"REPEAT\"\nREPEATABLE=\"REPEATABLE\"\nREPLACE=\"REPLACE\"\nREPLICATE_DO_DB=\"REPLICATE_DO_DB\"\nREPLICATE_DO_TABLE=\"REPLICATE_DO_TABLE\"\nREPLICATE_IGNORE_DB=\"REPLICATE_IGNORE_DB\"\nREPLICATE_IGNORE_TABLE=\"REPLICATE_IGNORE_TABLE\"\nREPLICATE_REWRITE_DB=\"REPLICATE_REWRITE_DB\"\nREPLICATE_WILD_DO_TABLE=\"REPLICATE_WILD_DO_TABLE\"\nREPLICATE_WILD_IGNORE_TABLE=\"REPLICATE_WILD_IGNORE_TABLE\"\nREPLICATION=\"REPLICATION\"\nREQUIRE=\"REQUIRE\"\nRESET=\"RESET\"\nRESIGNAL=\"RESIGNAL\"\nRESOURCE=\"RESOURCE\"\nRESPECT=\"RESPECT\"\nRESTART=\"RESTART\"\nRESTORE=\"RESTORE\"\nRESTRICT=\"RESTRICT\"\nRESUME=\"RESUME\"\nRETAIN=\"RETAIN\"\nRETURN=\"RETURN\"\nRETURNED_SQLSTATE=\"RETURNED_SQLSTATE\"\nRETURNS=\"RETURNS\"\nREUSE=\"REUSE\"\nREVERSE=\"REVERSE\"\nREVOKE=\"REVOKE\"\nRIGHT=\"RIGHT\"\nRLIKE=\"RLIKE\"\nROLE=\"ROLE\"\nROLLBACK=\"ROLLBACK\"\nROLLUP=\"ROLLUP\"\nROTATE=\"ROTATE\"\nROUTINE=\"ROUTINE\"\nROW=\"ROW\"\nROWS=\"ROWS\"\nROW_COUNT=\"ROW_COUNT\"\nROW_FORMAT=\"ROW_FORMAT\"\nROW_NUMBER=\"ROW_NUMBER\"\nRTREE=\"RTREE\"\nSAVEPOINT=\"SAVEPOINT\"\nSCHEDULE=\"SCHEDULE\"\nSCHEMA=\"SCHEMA\"\nSCHEMAS=\"SCHEMAS\"\nSCHEMA_NAME=\"SCHEMA_NAME\"\nSECOND=\"SECOND\"\nSECONDARY=\"SECONDARY\"\nSECONDARY_ENGINE=\"SECONDARY_ENGINE\"\nSECONDARY_LOAD=\"SECONDARY_LOAD\"\nSECONDARY_UNLOAD=\"SECONDARY_UNLOAD\"\nSECOND_MICROSECOND=\"SECOND_MICROSECOND\"\nSECURITY=\"SECURITY\"\nSELECT=\"SELECT\"\nSENSITIVE=\"SENSITIVE\"\nSEPARATOR=\"SEPARATOR\"\nSERIAL=\"SERIAL\"\nSERIALIZABLE=\"SERIALIZABLE\"\nSERVER=\"SERVER\"\nSESSION=\"SESSION\"\nSET=\"SET\"\nSHARE=\"SHARE\"\nSHOW=\"SHOW\"\nSHUTDOWN=\"SHUTDOWN\"\nSIGNAL=\"SIGNAL\"\nSIGNED=\"SIGNED\"\nSIMPLE=\"SIMPLE\"\nSKIP=\"SKIP\"\nSLAVE=\"SLAVE\"\nSLOW=\"SLOW\"\nSMALLINT=\"SMALLINT\"\nSNAPSHOT=\"SNAPSHOT\"\nSOCKET=\"SOCKET\"\nSOME=\"SOME\"\nSONAME=\"SONAME\"\nSOUNDS=\"SOUNDS\"\nSOURCE=\"SOURCE\"\nSPATIAL=\"SPATIAL\"\nSPECIFIC=\"SPECIFIC\"\nSQL=\"SQL\"\nSQLEXCEPTION=\"SQLEXCEPTION\"\nSQLSTATE=\"SQLSTATE\"\nSQLWARNING=\"SQLWARNING\"\nSQL_AFTER_GTIDS=\"SQL_AFTER_GTIDS\"\nSQL_AFTER_MTS_GAPS=\"SQL_AFTER_MTS_GAPS\"\nSQL_BEFORE_GTIDS=\"SQL_BEFORE_GTIDS\"\nSQL_BIG_RESULT=\"SQL_BIG_RESULT\"\nSQL_BUFFER_RESULT=\"SQL_BUFFER_RESULT\"\nSQL_CALC_FOUND_ROWS=\"SQL_CALC_FOUND_ROWS\"\nSQL_NO_CACHE=\"SQL_NO_CACHE\"\nSQL_SMALL_RESULT=\"SQL_SMALL_RESULT\"\nSQL_THREAD=\"SQL_THREAD\"\nSQL_TSI_DAY=\"SQL_TSI_DAY\"\nSQL_TSI_HOUR=\"SQL_TSI_HOUR\"\nSQL_TSI_MINUTE=\"SQL_TSI_MINUTE\"\nSQL_TSI_MONTH=\"SQL_TSI_MONTH\"\nSQL_TSI_QUARTER=\"SQL_TSI_QUARTER\"\nSQL_TSI_SECOND=\"SQL_TSI_SECOND\"\nSQL_TSI_WEEK=\"SQL_TSI_WEEK\"\nSQL_TSI_YEAR=\"SQL_TSI_YEAR\"\nSRID=\"SRID\"\nSSL=\"SSL\"\nSTACKED=\"STACKED\"\nSTART=\"START\"\nSTARTING=\"STARTING\"\nSTARTS=\"STARTS\"\nSTATS_AUTO_RECALC=\"STATS_AUTO_RECALC\"\nSTATS_PERSISTENT=\"STATS_PERSISTENT\"\nSTATS_SAMPLE_PAGES=\"STATS_SAMPLE_PAGES\"\nSTATUS=\"STATUS\"\nSTOP=\"STOP\"\nSTORAGE=\"STORAGE\"\nSTORED=\"STORED\"\nSTRAIGHT_JOIN=\"STRAIGHT_JOIN\"\nSTRING=\"STRING\"\nSUBCLASS_ORIGIN=\"SUBCLASS_ORIGIN\"\nSUBJECT=\"SUBJECT\"\nSUBPARTITION=\"SUBPARTITION\"\nSUBPARTITIONS=\"SUBPARTITIONS\"\nSUPER=\"SUPER\"\nSUSPEND=\"SUSPEND\"\nSWAPS=\"SWAPS\"\nSWITCHES=\"SWITCHES\"\nSYSTEM=\"SYSTEM\"\nTABLE=\"TABLE\"\nTABLES=\"TABLES\"\nTABLESPACE=\"TABLESPACE\"\nTABLE_CHECKSUM=\"TABLE_CHECKSUM\"\nTABLE_NAME=\"TABLE_NAME\"\nTEMPORARY=\"TEMPORARY\"\nTEMPTABLE=\"TEMPTABLE\"\nTERMINATED=\"TERMINATED\"\nTEXT=\"TEXT\"\nTHAN=\"THAN\"\nTHEN=\"THEN\"\nTHREAD_PRIORITY=\"THREAD_PRIORITY\"\nTIES=\"TIES\"\nTIME=\"TIME\"\nTIMESTAMP=\"TIMESTAMP\"\nTIMESTAMPADD=\"TIMESTAMPADD\"\nTIMESTAMPDIFF=\"TIMESTAMPDIFF\"\nTINYBLOB=\"TINYBLOB\"\nTINYINT=\"TINYINT\"\nTINYTEXT=\"TINYTEXT\"\nTO=\"TO\"\nTRAILING=\"TRAILING\"\nTRANSACTION=\"TRANSACTION\"\nTRIGGER=\"TRIGGER\"\nTRIGGERS=\"TRIGGERS\"\nTRUE=\"TRUE\"\nTRUNCATE=\"TRUNCATE\"\nTYPE=\"TYPE\"\nTYPES=\"TYPES\"\nUNBOUNDED=\"UNBOUNDED\"\nUNCOMMITTED=\"UNCOMMITTED\"\nUNDEFINED=\"UNDEFINED\"\nUNDO=\"UNDO\"\nUNDOFILE=\"UNDOFILE\"\nUNDO_BUFFER_SIZE=\"UNDO_BUFFER_SIZE\"\nUNICODE=\"UNICODE\"\nUNINSTALL=\"UNINSTALL\"\nUNION=\"UNION\"\nUNIQUE=\"UNIQUE\"\nUNKNOWN=\"UNKNOWN\"\nUNLOCK=\"UNLOCK\"\nUNSIGNED=\"UNSIGNED\"\nUNTIL=\"UNTIL\"\nUPDATE=\"UPDATE\"\nUPGRADE=\"UPGRADE\"\nUSAGE=\"USAGE\"\nUSE=\"USE\"\nUSER=\"USER\"\nUSER_RESOURCES=\"USER_RESOURCES\"\nUSE_FRM=\"USE_FRM\"\nUSING=\"USING\"\nUTC_DATE=\"UTC_DATE\"\nUTC_TIME=\"UTC_TIME\"\nUTC_TIMESTAMP=\"UTC_TIMESTAMP\"\nVALIDATION=\"VALIDATION\"\nVALUE=\"VALUE\"\nVALUES=\"VALUES\"\nVARBINARY=\"VARBINARY\"\nVARCHAR=\"VARCHAR\"\nVARCHARACTER=\"VARCHARACTER\"\nVARIABLES=\"VARIABLES\"\nVARYING=\"VARYING\"\nVCPU=\"VCPU\"\nVIEW=\"VIEW\"\nVIRTUAL=\"VIRTUAL\"\nVISIBLE=\"VISIBLE\"\nWAIT=\"WAIT\"\nWARNINGS=\"WARNINGS\"\nWEEK=\"WEEK\"\nWEIGHT_STRING=\"WEIGHT_STRING\"\nWHEN=\"WHEN\"\nWHERE=\"WHERE\"\nWHILE=\"WHILE\"\nWINDOW=\"WINDOW\"\nWITH=\"WITH\"\nWITHOUT=\"WITHOUT\"\nWORK=\"WORK\"\nWRAPPER=\"WRAPPER\"\nWRITE=\"WRITE\"\nX509=\"X509\"\nXA=\"XA\"\nXID=\"XID\"\nXML=\"XML\"\nXOR=\"XOR\"\nYEAR=\"YEAR\"\nYEAR_MONTH=\"YEAR_MONTH\"\nZEROFILL=\"ZEROFILL\"\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_docommand.options",
    "content": "[libfuzzer]\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_initfile.cc",
    "content": "//#include <stdint.h>\n//#include <stdlib.h>\n//#include <stdio.h>\n//#include <string>\n//#include <iostream>\n//#include <mysql.h>\n//#include <mysql/client_plugin.h>\n//#include <mysqld_error.h>\n#include \"sql/sql_class.h\"\n#include \"sql/conn_handler/channel_info.h\"\n#include \"sql/conn_handler/connection_handler.h\"\n#include \"sql/conn_handler/connection_handler_manager.h\"\n#include \"sql/conn_handler/init_net_server_extension.h\"\n#include \"sql/conn_handler/connection_handler_impl.h\"\n#include \"sql/mysqld.h\"\n#include \"sql/set_var.h\"\n#include \"sql/rpl_handler.h\"\n#include \"sql/log.h\"\n#include \"sql/opt_costconstantcache.h\"\n#include \"sql/sql_plugin.h\"\n#include \"sql/sql_thd_internal_api.h\"\n#include \"sql/mysqld_thd_manager.h\"\n#include \"sql/bootstrap.h\"\n#include \"mysql/psi/mysql_socket.h\"\n#include \"mysql/psi/mysql_file.h\"\n#include \"violite.h\"\n#include \"util_fuzz.h\"\n#include <stdlib.h>\n#include <libgen.h>\n\nusing namespace std;\nFILE *logfile = NULL;\nextern int mysqld_main(int argc, char **argv);\nchar *filepath = NULL;\n\nextern \"C\" int LLVMFuzzerInitialize(const int* argc, char*** argv) {\n    filepath = dirname(strdup((*argv)[0]));\n    return 0;\n}\n\nstatic int bufferToFile(const char * name, const uint8_t *Data, size_t Size) {\n    FILE * fd;\n    if (remove(name) != 0) {\n        if (errno != ENOENT) {\n            printf(\"failed remove, errno=%d\\n\", errno);\n            return -1;\n        }\n    }\n    fd = fopen(name, \"wb\");\n    if (fd == NULL) {\n        printf(\"failed open, errno=%d\\n\", errno);\n        return -2;\n    }\n    if (fwrite (Data, 1, Size, fd) != Size) {\n        fclose(fd);\n        return -3;\n    }\n    fclose(fd);\n    return 0;\n}\n\n#define MAX_SIZE 256\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    if (Size < 1) {\n        return 0;\n    }\n    if (logfile == NULL) {\n        my_progname = \"fuzz_initfile\";\n        /* first init was run with\n         * mysqld --user=root --initialize-insecure --log-error-verbosity=5 --datadir=/out/mysql/data/ --basedir=/out/mysql/\n         */\n        utilfuzz_rmrf(\"/tmp/mysql_initfile\");\n        char command[MAX_SIZE];\n        char argbase[MAX_SIZE];\n        char arginitfile[MAX_SIZE];\n\n        snprintf(command, MAX_SIZE-1, \"%s/mysql/data\", filepath);\n        utilfuzz_cpr(command, \"/tmp/mysql_initfile\");\n\n        snprintf(argbase, MAX_SIZE-1, \"--basedir=%s/mysql/\", filepath);\n        snprintf(arginitfile, MAX_SIZE-1, \"--init-file=%s/initnopw.sql\", filepath);\n\n        char *fakeargv[] = {const_cast<char *>(\"fuzz_initfile\"),\n            const_cast<char *>(\"--user=root\"),\n            const_cast<char *>(\"--secure-file-priv=NULL\"),\n            const_cast<char *>(\"--log-error-verbosity=5\"),\n            const_cast<char *>(\"--explicit_defaults_for_timestamp\"),\n            //we should adapt vio_fuzz to give a socket to openssl in order to support ssl\n            const_cast<char *>(\"--skip-ssl\"),\n            const_cast<char *>(\"--mysqlx=0\"),\n            const_cast<char *>(\"--event-scheduler=DISABLED\"),\n            const_cast<char *>(\"--performance_schema=OFF\"),\n            const_cast<char *>(\"--thread_stack=1048576\"),\n            const_cast<char *>(\"--datadir=/tmp/mysql_initfile/\"),\n            const_cast<char *>(\"--port=3302\"),\n            const_cast<char *>(\"--socket=/tmp/initfile.sock\"),\n            const_cast<char *>(argbase),\n            const_cast<char *>(arginitfile),\n            0};\n        int fakeargc = 15;\n        mysqld_main(fakeargc, fakeargv);\n        //terminate_compress_gtid_table_thread();\n\n        logfile = fopen(\"/dev/null\", \"w\");\n    }\n\n    bufferToFile(\"/tmp/initfuzz.sql\", Data, Size);\n    MYSQL_FILE *file;\n    if (!(file =\n          mysql_file_fopen(key_file_init, \"/tmp/initfuzz.sql\", O_RDONLY, MYF(MY_WME)))) {\n        abort();\n    }\n    (void)bootstrap::run_bootstrap_thread(\"/tmp/initfuzz.sql\", file, NULL, SYSTEM_THREAD_INIT_FILE);\n    mysql_file_fclose(file, MYF(MY_WME));\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_initfile.dict",
    "content": "#SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS;\nACCESSIBLE=\"ACCESSIBLE\"\nACCOUNT=\"ACCOUNT\"\nACTION=\"ACTION\"\nACTIVE=\"ACTIVE\"\nADD=\"ADD\"\nADMIN=\"ADMIN\"\nAFTER=\"AFTER\"\nAGAINST=\"AGAINST\"\nAGGREGATE=\"AGGREGATE\"\nALGORITHM=\"ALGORITHM\"\nALL=\"ALL\"\nALTER=\"ALTER\"\nALWAYS=\"ALWAYS\"\nANALYZE=\"ANALYZE\"\nAND=\"AND\"\nANY=\"ANY\"\nAS=\"AS\"\nASC=\"ASC\"\nASCII=\"ASCII\"\nASENSITIVE=\"ASENSITIVE\"\nAT=\"AT\"\nAUTOEXTEND_SIZE=\"AUTOEXTEND_SIZE\"\nAUTO_INCREMENT=\"AUTO_INCREMENT\"\nAVG=\"AVG\"\nAVG_ROW_LENGTH=\"AVG_ROW_LENGTH\"\nBACKUP=\"BACKUP\"\nBEFORE=\"BEFORE\"\nBEGIN=\"BEGIN\"\nBETWEEN=\"BETWEEN\"\nBIGINT=\"BIGINT\"\nBINARY=\"BINARY\"\nBINLOG=\"BINLOG\"\nBIT=\"BIT\"\nBLOB=\"BLOB\"\nBLOCK=\"BLOCK\"\nBOOL=\"BOOL\"\nBOOLEAN=\"BOOLEAN\"\nBOTH=\"BOTH\"\nBTREE=\"BTREE\"\nBUCKETS=\"BUCKETS\"\nBY=\"BY\"\nBYTE=\"BYTE\"\nCACHE=\"CACHE\"\nCALL=\"CALL\"\nCASCADE=\"CASCADE\"\nCASCADED=\"CASCADED\"\nCASE=\"CASE\"\nCATALOG_NAME=\"CATALOG_NAME\"\nCHAIN=\"CHAIN\"\nCHANGE=\"CHANGE\"\nCHANGED=\"CHANGED\"\nCHANNEL=\"CHANNEL\"\nCHAR=\"CHAR\"\nCHARACTER=\"CHARACTER\"\nCHARSET=\"CHARSET\"\nCHECK=\"CHECK\"\nCHECKSUM=\"CHECKSUM\"\nCIPHER=\"CIPHER\"\nCLASS_ORIGIN=\"CLASS_ORIGIN\"\nCLIENT=\"CLIENT\"\nCLONE=\"CLONE\"\nCLOSE=\"CLOSE\"\nCOALESCE=\"COALESCE\"\nCODE=\"CODE\"\nCOLLATE=\"COLLATE\"\nCOLLATION=\"COLLATION\"\nCOLUMN=\"COLUMN\"\nCOLUMNS=\"COLUMNS\"\nCOLUMN_FORMAT=\"COLUMN_FORMAT\"\nCOLUMN_NAME=\"COLUMN_NAME\"\nCOMMENT=\"COMMENT\"\nCOMMIT=\"COMMIT\"\nCOMMITTED=\"COMMITTED\"\nCOMPACT=\"COMPACT\"\nCOMPLETION=\"COMPLETION\"\nCOMPONENT=\"COMPONENT\"\nCOMPRESSED=\"COMPRESSED\"\nCOMPRESSION=\"COMPRESSION\"\nCONCURRENT=\"CONCURRENT\"\nCONDITION=\"CONDITION\"\nCONNECTION=\"CONNECTION\"\nCONSISTENT=\"CONSISTENT\"\nCONSTRAINT=\"CONSTRAINT\"\nCONSTRAINT_CATALOG=\"CONSTRAINT_CATALOG\"\nCONSTRAINT_NAME=\"CONSTRAINT_NAME\"\nCONSTRAINT_SCHEMA=\"CONSTRAINT_SCHEMA\"\nCONTAINS=\"CONTAINS\"\nCONTEXT=\"CONTEXT\"\nCONTINUE=\"CONTINUE\"\nCONVERT=\"CONVERT\"\nCPU=\"CPU\"\nCREATE=\"CREATE\"\nCROSS=\"CROSS\"\nCUBE=\"CUBE\"\nCUME_DIST=\"CUME_DIST\"\nCURRENT=\"CURRENT\"\nCURRENT_DATE=\"CURRENT_DATE\"\nCURRENT_TIME=\"CURRENT_TIME\"\nCURRENT_TIMESTAMP=\"CURRENT_TIMESTAMP\"\nCURRENT_USER=\"CURRENT_USER\"\nCURSOR=\"CURSOR\"\nCURSOR_NAME=\"CURSOR_NAME\"\nDATA=\"DATA\"\nDATABASE=\"DATABASE\"\nDATABASES=\"DATABASES\"\nDATAFILE=\"DATAFILE\"\nDATE=\"DATE\"\nDATETIME=\"DATETIME\"\nDAY=\"DAY\"\nDAY_HOUR=\"DAY_HOUR\"\nDAY_MICROSECOND=\"DAY_MICROSECOND\"\nDAY_MINUTE=\"DAY_MINUTE\"\nDAY_SECOND=\"DAY_SECOND\"\nDEALLOCATE=\"DEALLOCATE\"\nDEC=\"DEC\"\nDECIMAL=\"DECIMAL\"\nDECLARE=\"DECLARE\"\nDEFAULT=\"DEFAULT\"\nDEFAULT_AUTH=\"DEFAULT_AUTH\"\nDEFINER=\"DEFINER\"\nDEFINITION=\"DEFINITION\"\nDELAYED=\"DELAYED\"\nDELAY_KEY_WRITE=\"DELAY_KEY_WRITE\"\nDELETE=\"DELETE\"\nDENSE_RANK=\"DENSE_RANK\"\nDESC=\"DESC\"\nDESCRIBE=\"DESCRIBE\"\nDESCRIPTION=\"DESCRIPTION\"\nDETERMINISTIC=\"DETERMINISTIC\"\nDIAGNOSTICS=\"DIAGNOSTICS\"\nDIRECTORY=\"DIRECTORY\"\nDISABLE=\"DISABLE\"\nDISCARD=\"DISCARD\"\nDISK=\"DISK\"\nDISTINCT=\"DISTINCT\"\nDISTINCTROW=\"DISTINCTROW\"\nDIV=\"DIV\"\nDO=\"DO\"\nDOUBLE=\"DOUBLE\"\nDROP=\"DROP\"\nDUAL=\"DUAL\"\nDUMPFILE=\"DUMPFILE\"\nDUPLICATE=\"DUPLICATE\"\nDYNAMIC=\"DYNAMIC\"\nEACH=\"EACH\"\nELSE=\"ELSE\"\nELSEIF=\"ELSEIF\"\nEMPTY=\"EMPTY\"\nENABLE=\"ENABLE\"\nENCLOSED=\"ENCLOSED\"\nENCRYPTION=\"ENCRYPTION\"\nEND=\"END\"\nENDS=\"ENDS\"\nENFORCED=\"ENFORCED\"\nENGINE=\"ENGINE\"\nENGINES=\"ENGINES\"\nENUM=\"ENUM\"\nERROR=\"ERROR\"\nERRORS=\"ERRORS\"\nESCAPE=\"ESCAPE\"\nESCAPED=\"ESCAPED\"\nEVENT=\"EVENT\"\nEVENTS=\"EVENTS\"\nEVERY=\"EVERY\"\nEXCEPT=\"EXCEPT\"\nEXCHANGE=\"EXCHANGE\"\nEXCLUDE=\"EXCLUDE\"\nEXECUTE=\"EXECUTE\"\nEXISTS=\"EXISTS\"\nEXIT=\"EXIT\"\nEXPANSION=\"EXPANSION\"\nEXPIRE=\"EXPIRE\"\nEXPLAIN=\"EXPLAIN\"\nEXPORT=\"EXPORT\"\nEXTENDED=\"EXTENDED\"\nEXTENT_SIZE=\"EXTENT_SIZE\"\nFALSE=\"FALSE\"\nFAST=\"FAST\"\nFAULTS=\"FAULTS\"\nFETCH=\"FETCH\"\nFIELDS=\"FIELDS\"\nFILE=\"FILE\"\nFILE_BLOCK_SIZE=\"FILE_BLOCK_SIZE\"\nFILTER=\"FILTER\"\nFIRST=\"FIRST\"\nFIRST_VALUE=\"FIRST_VALUE\"\nFIXED=\"FIXED\"\nFLOAT=\"FLOAT\"\nFLOAT4=\"FLOAT4\"\nFLOAT8=\"FLOAT8\"\nFLUSH=\"FLUSH\"\nFOLLOWING=\"FOLLOWING\"\nFOLLOWS=\"FOLLOWS\"\nFOR=\"FOR\"\nFORCE=\"FORCE\"\nFOREIGN=\"FOREIGN\"\nFORMAT=\"FORMAT\"\nFOUND=\"FOUND\"\nFROM=\"FROM\"\nFULL=\"FULL\"\nFULLTEXT=\"FULLTEXT\"\nFUNCTION=\"FUNCTION\"\nGENERAL=\"GENERAL\"\nGENERATED=\"GENERATED\"\nGEOMCOLLECTION=\"GEOMCOLLECTION\"\nGEOMETRY=\"GEOMETRY\"\nGEOMETRYCOLLECTION=\"GEOMETRYCOLLECTION\"\nGET=\"GET\"\nGET_FORMAT=\"GET_FORMAT\"\nGET_MASTER_PUBLIC_KEY=\"GET_MASTER_PUBLIC_KEY\"\nGLOBAL=\"GLOBAL\"\nGRANT=\"GRANT\"\nGRANTS=\"GRANTS\"\nGROUP=\"GROUP\"\nGROUPING=\"GROUPING\"\nGROUPS=\"GROUPS\"\nGROUP_REPLICATION=\"GROUP_REPLICATION\"\nHANDLER=\"HANDLER\"\nHASH=\"HASH\"\nHAVING=\"HAVING\"\nHELP=\"HELP\"\nHIGH_PRIORITY=\"HIGH_PRIORITY\"\nHISTOGRAM=\"HISTOGRAM\"\nHISTORY=\"HISTORY\"\nHOST=\"HOST\"\nHOSTS=\"HOSTS\"\nHOUR=\"HOUR\"\nHOUR_MICROSECOND=\"HOUR_MICROSECOND\"\nHOUR_MINUTE=\"HOUR_MINUTE\"\nHOUR_SECOND=\"HOUR_SECOND\"\nIDENTIFIED=\"IDENTIFIED\"\nIF=\"IF\"\nIGNORE=\"IGNORE\"\nIGNORE_SERVER_IDS=\"IGNORE_SERVER_IDS\"\nIMPORT=\"IMPORT\"\nIN=\"IN\"\nINACTIVE=\"INACTIVE\"\nINDEX=\"INDEX\"\nINDEXES=\"INDEXES\"\nINFILE=\"INFILE\"\nINITIAL_SIZE=\"INITIAL_SIZE\"\nINNER=\"INNER\"\nINOUT=\"INOUT\"\nINSENSITIVE=\"INSENSITIVE\"\nINSERT=\"INSERT\"\nINSERT_METHOD=\"INSERT_METHOD\"\nINSTALL=\"INSTALL\"\nINSTANCE=\"INSTANCE\"\nINT=\"INT\"\nINT1=\"INT1\"\nINT2=\"INT2\"\nINT3=\"INT3\"\nINT4=\"INT4\"\nINT8=\"INT8\"\nINTEGER=\"INTEGER\"\nINTERVAL=\"INTERVAL\"\nINTO=\"INTO\"\nINVISIBLE=\"INVISIBLE\"\nINVOKER=\"INVOKER\"\nIO=\"IO\"\nIO_AFTER_GTIDS=\"IO_AFTER_GTIDS\"\nIO_BEFORE_GTIDS=\"IO_BEFORE_GTIDS\"\nIO_THREAD=\"IO_THREAD\"\nIPC=\"IPC\"\nIS=\"IS\"\nISOLATION=\"ISOLATION\"\nISSUER=\"ISSUER\"\nITERATE=\"ITERATE\"\nJOIN=\"JOIN\"\nJSON=\"JSON\"\nJSON_TABLE=\"JSON_TABLE\"\nKEY=\"KEY\"\nKEYS=\"KEYS\"\nKEY_BLOCK_SIZE=\"KEY_BLOCK_SIZE\"\nKILL=\"KILL\"\nLAG=\"LAG\"\nLANGUAGE=\"LANGUAGE\"\nLAST=\"LAST\"\nLAST_VALUE=\"LAST_VALUE\"\nLATERAL=\"LATERAL\"\nLEAD=\"LEAD\"\nLEADING=\"LEADING\"\nLEAVE=\"LEAVE\"\nLEAVES=\"LEAVES\"\nLEFT=\"LEFT\"\nLESS=\"LESS\"\nLEVEL=\"LEVEL\"\nLIKE=\"LIKE\"\nLIMIT=\"LIMIT\"\nLINEAR=\"LINEAR\"\nLINES=\"LINES\"\nLINESTRING=\"LINESTRING\"\nLIST=\"LIST\"\nLOAD=\"LOAD\"\nLOCAL=\"LOCAL\"\nLOCALTIME=\"LOCALTIME\"\nLOCALTIMESTAMP=\"LOCALTIMESTAMP\"\nLOCK=\"LOCK\"\nLOCKED=\"LOCKED\"\nLOCKS=\"LOCKS\"\nLOGFILE=\"LOGFILE\"\nLOGS=\"LOGS\"\nLONG=\"LONG\"\nLONGBLOB=\"LONGBLOB\"\nLONGTEXT=\"LONGTEXT\"\nLOOP=\"LOOP\"\nLOW_PRIORITY=\"LOW_PRIORITY\"\nMASTER=\"MASTER\"\nMASTER_AUTO_POSITION=\"MASTER_AUTO_POSITION\"\nMASTER_BIND=\"MASTER_BIND\"\nMASTER_CONNECT_RETRY=\"MASTER_CONNECT_RETRY\"\nMASTER_DELAY=\"MASTER_DELAY\"\nMASTER_HEARTBEAT_PERIOD=\"MASTER_HEARTBEAT_PERIOD\"\nMASTER_HOST=\"MASTER_HOST\"\nMASTER_LOG_FILE=\"MASTER_LOG_FILE\"\nMASTER_LOG_POS=\"MASTER_LOG_POS\"\nMASTER_PASSWORD=\"MASTER_PASSWORD\"\nMASTER_PORT=\"MASTER_PORT\"\nMASTER_PUBLIC_KEY_PATH=\"MASTER_PUBLIC_KEY_PATH\"\nMASTER_RETRY_COUNT=\"MASTER_RETRY_COUNT\"\nMASTER_SERVER_ID=\"MASTER_SERVER_ID\"\nMASTER_SSL=\"MASTER_SSL\"\nMASTER_SSL_CA=\"MASTER_SSL_CA\"\nMASTER_SSL_CAPATH=\"MASTER_SSL_CAPATH\"\nMASTER_SSL_CERT=\"MASTER_SSL_CERT\"\nMASTER_SSL_CIPHER=\"MASTER_SSL_CIPHER\"\nMASTER_SSL_CRL=\"MASTER_SSL_CRL\"\nMASTER_SSL_CRLPATH=\"MASTER_SSL_CRLPATH\"\nMASTER_SSL_KEY=\"MASTER_SSL_KEY\"\nMASTER_SSL_VERIFY_SERVER_CERT=\"MASTER_SSL_VERIFY_SERVER_CERT\"\nMASTER_TLS_VERSION=\"MASTER_TLS_VERSION\"\nMASTER_USER=\"MASTER_USER\"\nMATCH=\"MATCH\"\nMAXVALUE=\"MAXVALUE\"\nMAX_CONNECTIONS_PER_HOUR=\"MAX_CONNECTIONS_PER_HOUR\"\nMAX_QUERIES_PER_HOUR=\"MAX_QUERIES_PER_HOUR\"\nMAX_ROWS=\"MAX_ROWS\"\nMAX_SIZE=\"MAX_SIZE\"\nMAX_UPDATES_PER_HOUR=\"MAX_UPDATES_PER_HOUR\"\nMAX_USER_CONNECTIONS=\"MAX_USER_CONNECTIONS\"\nMEDIUM=\"MEDIUM\"\nMEDIUMBLOB=\"MEDIUMBLOB\"\nMEDIUMINT=\"MEDIUMINT\"\nMEDIUMTEXT=\"MEDIUMTEXT\"\nMEMORY=\"MEMORY\"\nMERGE=\"MERGE\"\nMESSAGE_TEXT=\"MESSAGE_TEXT\"\nMICROSECOND=\"MICROSECOND\"\nMIDDLEINT=\"MIDDLEINT\"\nMIGRATE=\"MIGRATE\"\nMINUTE=\"MINUTE\"\nMINUTE_MICROSECOND=\"MINUTE_MICROSECOND\"\nMINUTE_SECOND=\"MINUTE_SECOND\"\nMIN_ROWS=\"MIN_ROWS\"\nMOD=\"MOD\"\nMODE=\"MODE\"\nMODIFIES=\"MODIFIES\"\nMODIFY=\"MODIFY\"\nMONTH=\"MONTH\"\nMULTILINESTRING=\"MULTILINESTRING\"\nMULTIPOINT=\"MULTIPOINT\"\nMULTIPOLYGON=\"MULTIPOLYGON\"\nMUTEX=\"MUTEX\"\nMYSQL_ERRNO=\"MYSQL_ERRNO\"\nNAME=\"NAME\"\nNAMES=\"NAMES\"\nNATIONAL=\"NATIONAL\"\nNATURAL=\"NATURAL\"\nNCHAR=\"NCHAR\"\nNDB=\"NDB\"\nNDBCLUSTER=\"NDBCLUSTER\"\nNESTED=\"NESTED\"\nNETWORK_NAMESPACE=\"NETWORK_NAMESPACE\"\nNEVER=\"NEVER\"\nNEW=\"NEW\"\nNEXT=\"NEXT\"\nNO=\"NO\"\nNODEGROUP=\"NODEGROUP\"\nNONE=\"NONE\"\nNOT=\"NOT\"\nNOWAIT=\"NOWAIT\"\nNO_WAIT=\"NO_WAIT\"\nNO_WRITE_TO_BINLOG=\"NO_WRITE_TO_BINLOG\"\nNTH_VALUE=\"NTH_VALUE\"\nNTILE=\"NTILE\"\nNULL=\"NULL\"\nNULLS=\"NULLS\"\nNUMBER=\"NUMBER\"\nNUMERIC=\"NUMERIC\"\nNVARCHAR=\"NVARCHAR\"\nOF=\"OF\"\nOFFSET=\"OFFSET\"\nOJ=\"OJ\"\nOLD=\"OLD\"\nON=\"ON\"\nONE=\"ONE\"\nONLY=\"ONLY\"\nOPEN=\"OPEN\"\nOPTIMIZE=\"OPTIMIZE\"\nOPTIMIZER_COSTS=\"OPTIMIZER_COSTS\"\nOPTION=\"OPTION\"\nOPTIONAL=\"OPTIONAL\"\nOPTIONALLY=\"OPTIONALLY\"\nOPTIONS=\"OPTIONS\"\nOR=\"OR\"\nORDER=\"ORDER\"\nORDINALITY=\"ORDINALITY\"\nORGANIZATION=\"ORGANIZATION\"\nOTHERS=\"OTHERS\"\nOUT=\"OUT\"\nOUTER=\"OUTER\"\nOUTFILE=\"OUTFILE\"\nOVER=\"OVER\"\nOWNER=\"OWNER\"\nPACK_KEYS=\"PACK_KEYS\"\nPAGE=\"PAGE\"\nPARSER=\"PARSER\"\nPARTIAL=\"PARTIAL\"\nPARTITION=\"PARTITION\"\nPARTITIONING=\"PARTITIONING\"\nPARTITIONS=\"PARTITIONS\"\nPASSWORD=\"PASSWORD\"\nPATH=\"PATH\"\nPERCENT_RANK=\"PERCENT_RANK\"\nPERSIST=\"PERSIST\"\nPERSIST_ONLY=\"PERSIST_ONLY\"\nPHASE=\"PHASE\"\nPLUGIN=\"PLUGIN\"\nPLUGINS=\"PLUGINS\"\nPLUGIN_DIR=\"PLUGIN_DIR\"\nPOINT=\"POINT\"\nPOLYGON=\"POLYGON\"\nPORT=\"PORT\"\nPRECEDES=\"PRECEDES\"\nPRECEDING=\"PRECEDING\"\nPRECISION=\"PRECISION\"\nPREPARE=\"PREPARE\"\nPRESERVE=\"PRESERVE\"\nPREV=\"PREV\"\nPRIMARY=\"PRIMARY\"\nPRIVILEGES=\"PRIVILEGES\"\nPROCEDURE=\"PROCEDURE\"\nPROCESS=\"PROCESS\"\nPROCESSLIST=\"PROCESSLIST\"\nPROFILE=\"PROFILE\"\nPROFILES=\"PROFILES\"\nPROXY=\"PROXY\"\nPURGE=\"PURGE\"\nQUARTER=\"QUARTER\"\nQUERY=\"QUERY\"\nQUICK=\"QUICK\"\nRANGE=\"RANGE\"\nRANK=\"RANK\"\nREAD=\"READ\"\nREADS=\"READS\"\nREAD_ONLY=\"READ_ONLY\"\nREAD_WRITE=\"READ_WRITE\"\nREAL=\"REAL\"\nREBUILD=\"REBUILD\"\nRECOVER=\"RECOVER\"\nRECURSIVE=\"RECURSIVE\"\nREDO_BUFFER_SIZE=\"REDO_BUFFER_SIZE\"\nREDUNDANT=\"REDUNDANT\"\nREFERENCE=\"REFERENCE\"\nREFERENCES=\"REFERENCES\"\nREGEXP=\"REGEXP\"\nRELAY=\"RELAY\"\nRELAYLOG=\"RELAYLOG\"\nRELAY_LOG_FILE=\"RELAY_LOG_FILE\"\nRELAY_LOG_POS=\"RELAY_LOG_POS\"\nRELAY_THREAD=\"RELAY_THREAD\"\nRELEASE=\"RELEASE\"\nRELOAD=\"RELOAD\"\nREMOVE=\"REMOVE\"\nRENAME=\"RENAME\"\nREORGANIZE=\"REORGANIZE\"\nREPAIR=\"REPAIR\"\nREPEAT=\"REPEAT\"\nREPEATABLE=\"REPEATABLE\"\nREPLACE=\"REPLACE\"\nREPLICATE_DO_DB=\"REPLICATE_DO_DB\"\nREPLICATE_DO_TABLE=\"REPLICATE_DO_TABLE\"\nREPLICATE_IGNORE_DB=\"REPLICATE_IGNORE_DB\"\nREPLICATE_IGNORE_TABLE=\"REPLICATE_IGNORE_TABLE\"\nREPLICATE_REWRITE_DB=\"REPLICATE_REWRITE_DB\"\nREPLICATE_WILD_DO_TABLE=\"REPLICATE_WILD_DO_TABLE\"\nREPLICATE_WILD_IGNORE_TABLE=\"REPLICATE_WILD_IGNORE_TABLE\"\nREPLICATION=\"REPLICATION\"\nREQUIRE=\"REQUIRE\"\nRESET=\"RESET\"\nRESIGNAL=\"RESIGNAL\"\nRESOURCE=\"RESOURCE\"\nRESPECT=\"RESPECT\"\nRESTART=\"RESTART\"\nRESTORE=\"RESTORE\"\nRESTRICT=\"RESTRICT\"\nRESUME=\"RESUME\"\nRETAIN=\"RETAIN\"\nRETURN=\"RETURN\"\nRETURNED_SQLSTATE=\"RETURNED_SQLSTATE\"\nRETURNS=\"RETURNS\"\nREUSE=\"REUSE\"\nREVERSE=\"REVERSE\"\nREVOKE=\"REVOKE\"\nRIGHT=\"RIGHT\"\nRLIKE=\"RLIKE\"\nROLE=\"ROLE\"\nROLLBACK=\"ROLLBACK\"\nROLLUP=\"ROLLUP\"\nROTATE=\"ROTATE\"\nROUTINE=\"ROUTINE\"\nROW=\"ROW\"\nROWS=\"ROWS\"\nROW_COUNT=\"ROW_COUNT\"\nROW_FORMAT=\"ROW_FORMAT\"\nROW_NUMBER=\"ROW_NUMBER\"\nRTREE=\"RTREE\"\nSAVEPOINT=\"SAVEPOINT\"\nSCHEDULE=\"SCHEDULE\"\nSCHEMA=\"SCHEMA\"\nSCHEMAS=\"SCHEMAS\"\nSCHEMA_NAME=\"SCHEMA_NAME\"\nSECOND=\"SECOND\"\nSECONDARY=\"SECONDARY\"\nSECONDARY_ENGINE=\"SECONDARY_ENGINE\"\nSECONDARY_LOAD=\"SECONDARY_LOAD\"\nSECONDARY_UNLOAD=\"SECONDARY_UNLOAD\"\nSECOND_MICROSECOND=\"SECOND_MICROSECOND\"\nSECURITY=\"SECURITY\"\nSELECT=\"SELECT\"\nSENSITIVE=\"SENSITIVE\"\nSEPARATOR=\"SEPARATOR\"\nSERIAL=\"SERIAL\"\nSERIALIZABLE=\"SERIALIZABLE\"\nSERVER=\"SERVER\"\nSESSION=\"SESSION\"\nSET=\"SET\"\nSHARE=\"SHARE\"\nSHOW=\"SHOW\"\nSHUTDOWN=\"SHUTDOWN\"\nSIGNAL=\"SIGNAL\"\nSIGNED=\"SIGNED\"\nSIMPLE=\"SIMPLE\"\nSKIP=\"SKIP\"\nSLAVE=\"SLAVE\"\nSLOW=\"SLOW\"\nSMALLINT=\"SMALLINT\"\nSNAPSHOT=\"SNAPSHOT\"\nSOCKET=\"SOCKET\"\nSOME=\"SOME\"\nSONAME=\"SONAME\"\nSOUNDS=\"SOUNDS\"\nSOURCE=\"SOURCE\"\nSPATIAL=\"SPATIAL\"\nSPECIFIC=\"SPECIFIC\"\nSQL=\"SQL\"\nSQLEXCEPTION=\"SQLEXCEPTION\"\nSQLSTATE=\"SQLSTATE\"\nSQLWARNING=\"SQLWARNING\"\nSQL_AFTER_GTIDS=\"SQL_AFTER_GTIDS\"\nSQL_AFTER_MTS_GAPS=\"SQL_AFTER_MTS_GAPS\"\nSQL_BEFORE_GTIDS=\"SQL_BEFORE_GTIDS\"\nSQL_BIG_RESULT=\"SQL_BIG_RESULT\"\nSQL_BUFFER_RESULT=\"SQL_BUFFER_RESULT\"\nSQL_CALC_FOUND_ROWS=\"SQL_CALC_FOUND_ROWS\"\nSQL_NO_CACHE=\"SQL_NO_CACHE\"\nSQL_SMALL_RESULT=\"SQL_SMALL_RESULT\"\nSQL_THREAD=\"SQL_THREAD\"\nSQL_TSI_DAY=\"SQL_TSI_DAY\"\nSQL_TSI_HOUR=\"SQL_TSI_HOUR\"\nSQL_TSI_MINUTE=\"SQL_TSI_MINUTE\"\nSQL_TSI_MONTH=\"SQL_TSI_MONTH\"\nSQL_TSI_QUARTER=\"SQL_TSI_QUARTER\"\nSQL_TSI_SECOND=\"SQL_TSI_SECOND\"\nSQL_TSI_WEEK=\"SQL_TSI_WEEK\"\nSQL_TSI_YEAR=\"SQL_TSI_YEAR\"\nSRID=\"SRID\"\nSSL=\"SSL\"\nSTACKED=\"STACKED\"\nSTART=\"START\"\nSTARTING=\"STARTING\"\nSTARTS=\"STARTS\"\nSTATS_AUTO_RECALC=\"STATS_AUTO_RECALC\"\nSTATS_PERSISTENT=\"STATS_PERSISTENT\"\nSTATS_SAMPLE_PAGES=\"STATS_SAMPLE_PAGES\"\nSTATUS=\"STATUS\"\nSTOP=\"STOP\"\nSTORAGE=\"STORAGE\"\nSTORED=\"STORED\"\nSTRAIGHT_JOIN=\"STRAIGHT_JOIN\"\nSTRING=\"STRING\"\nSUBCLASS_ORIGIN=\"SUBCLASS_ORIGIN\"\nSUBJECT=\"SUBJECT\"\nSUBPARTITION=\"SUBPARTITION\"\nSUBPARTITIONS=\"SUBPARTITIONS\"\nSUPER=\"SUPER\"\nSUSPEND=\"SUSPEND\"\nSWAPS=\"SWAPS\"\nSWITCHES=\"SWITCHES\"\nSYSTEM=\"SYSTEM\"\nTABLE=\"TABLE\"\nTABLES=\"TABLES\"\nTABLESPACE=\"TABLESPACE\"\nTABLE_CHECKSUM=\"TABLE_CHECKSUM\"\nTABLE_NAME=\"TABLE_NAME\"\nTEMPORARY=\"TEMPORARY\"\nTEMPTABLE=\"TEMPTABLE\"\nTERMINATED=\"TERMINATED\"\nTEXT=\"TEXT\"\nTHAN=\"THAN\"\nTHEN=\"THEN\"\nTHREAD_PRIORITY=\"THREAD_PRIORITY\"\nTIES=\"TIES\"\nTIME=\"TIME\"\nTIMESTAMP=\"TIMESTAMP\"\nTIMESTAMPADD=\"TIMESTAMPADD\"\nTIMESTAMPDIFF=\"TIMESTAMPDIFF\"\nTINYBLOB=\"TINYBLOB\"\nTINYINT=\"TINYINT\"\nTINYTEXT=\"TINYTEXT\"\nTO=\"TO\"\nTRAILING=\"TRAILING\"\nTRANSACTION=\"TRANSACTION\"\nTRIGGER=\"TRIGGER\"\nTRIGGERS=\"TRIGGERS\"\nTRUE=\"TRUE\"\nTRUNCATE=\"TRUNCATE\"\nTYPE=\"TYPE\"\nTYPES=\"TYPES\"\nUNBOUNDED=\"UNBOUNDED\"\nUNCOMMITTED=\"UNCOMMITTED\"\nUNDEFINED=\"UNDEFINED\"\nUNDO=\"UNDO\"\nUNDOFILE=\"UNDOFILE\"\nUNDO_BUFFER_SIZE=\"UNDO_BUFFER_SIZE\"\nUNICODE=\"UNICODE\"\nUNINSTALL=\"UNINSTALL\"\nUNION=\"UNION\"\nUNIQUE=\"UNIQUE\"\nUNKNOWN=\"UNKNOWN\"\nUNLOCK=\"UNLOCK\"\nUNSIGNED=\"UNSIGNED\"\nUNTIL=\"UNTIL\"\nUPDATE=\"UPDATE\"\nUPGRADE=\"UPGRADE\"\nUSAGE=\"USAGE\"\nUSE=\"USE\"\nUSER=\"USER\"\nUSER_RESOURCES=\"USER_RESOURCES\"\nUSE_FRM=\"USE_FRM\"\nUSING=\"USING\"\nUTC_DATE=\"UTC_DATE\"\nUTC_TIME=\"UTC_TIME\"\nUTC_TIMESTAMP=\"UTC_TIMESTAMP\"\nVALIDATION=\"VALIDATION\"\nVALUE=\"VALUE\"\nVALUES=\"VALUES\"\nVARBINARY=\"VARBINARY\"\nVARCHAR=\"VARCHAR\"\nVARCHARACTER=\"VARCHARACTER\"\nVARIABLES=\"VARIABLES\"\nVARYING=\"VARYING\"\nVCPU=\"VCPU\"\nVIEW=\"VIEW\"\nVIRTUAL=\"VIRTUAL\"\nVISIBLE=\"VISIBLE\"\nWAIT=\"WAIT\"\nWARNINGS=\"WARNINGS\"\nWEEK=\"WEEK\"\nWEIGHT_STRING=\"WEIGHT_STRING\"\nWHEN=\"WHEN\"\nWHERE=\"WHERE\"\nWHILE=\"WHILE\"\nWINDOW=\"WINDOW\"\nWITH=\"WITH\"\nWITHOUT=\"WITHOUT\"\nWORK=\"WORK\"\nWRAPPER=\"WRAPPER\"\nWRITE=\"WRITE\"\nX509=\"X509\"\nXA=\"XA\"\nXID=\"XID\"\nXML=\"XML\"\nXOR=\"XOR\"\nYEAR=\"YEAR\"\nYEAR_MONTH=\"YEAR_MONTH\"\nZEROFILL=\"ZEROFILL\"\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_initfile.options",
    "content": "[libfuzzer]\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_mysqld.cc",
    "content": "//#include <stdint.h>\n//#include <stdlib.h>\n//#include <stdio.h>\n//#include <string>\n//#include <iostream>\n//#include <mysql.h>\n//#include <mysql/client_plugin.h>\n//#include <mysqld_error.h>\n#include \"sql/sql_class.h\"\n#include \"sql/protocol_classic.h\"\n#include \"sql/conn_handler/channel_info.h\"\n#include \"sql/conn_handler/connection_handler.h\"\n#include \"sql/conn_handler/connection_handler_manager.h\"\n#include \"sql/conn_handler/init_net_server_extension.h\"\n#include \"sql/conn_handler/connection_handler_impl.h\"\n#include \"sql/mysqld.h\"\n#include \"sql/set_var.h\"\n#include \"sql/rpl_handler.h\"\n#include \"sql/log.h\"\n#include \"sql/opt_costconstantcache.h\"\n#include \"sql/sql_plugin.h\"\n#include \"sql/sql_thd_internal_api.h\"\n#include \"sql/mysqld_thd_manager.h\"\n#include \"mysql/psi/mysql_socket.h\"\n#include \"violite.h\"\n#include \"util_fuzz.h\"\n#include <stdlib.h>\n#include <libgen.h>\n\nusing namespace std;\nFILE *logfile = NULL;\nextern int mysqld_main(int argc, char **argv);\nchar *filepath = NULL;\n\nextern \"C\" int LLVMFuzzerInitialize(const int* argc, char*** argv) {\n    filepath = dirname(strdup((*argv)[0]));\n    return 0;\n}\n\nclass Channel_info_fuzz : public Channel_info {\n    bool m_is_admin_conn;\n\n    protected:\n    virtual Vio *create_and_init_vio() const {\n        Vio *vio = vio_new(0, VIO_TYPE_FUZZ, VIO_LOCALHOST);\n        return vio;\n    }\n\n    public:\n    Channel_info_fuzz(bool is_admin_conn) : m_is_admin_conn(is_admin_conn) {}\n\n    virtual THD *create_thd() {\n        Vio *vio_tmp = create_and_init_vio();\n        if (vio_tmp == NULL) return NULL;\n\n        THD *thd = new (std::nothrow) THD();\n        if (thd == NULL) {\n            vio_delete(vio_tmp);\n            return NULL;\n        }\n        thd->get_protocol_classic()->init_net(vio_tmp);\n        thd->set_admin_connection(m_is_admin_conn);\n        init_net_server_extension(thd);\n        return thd;\n    }\n\n    virtual bool is_admin_connection() const { return m_is_admin_conn; }\n};\n\nstatic void try_connection(Channel_info *channel_info) {\n    if (my_thread_init()) {\n        channel_info->send_error_and_close_channel(ER_OUT_OF_RESOURCES, 0, false);\n        return;\n    }\n\n    THD *thd = channel_info->create_thd();\n    if (thd == NULL) {\n        channel_info->send_error_and_close_channel(ER_OUT_OF_RESOURCES, 0, false);\n        return;\n    }\n\n    thd->set_new_thread_id();\n\n    /*\n     handle_one_connection() is normally the only way a thread would\n     start and would always be on the very high end of the stack ,\n     therefore, the thread stack always starts at the address of the\n     first local variable of handle_one_connection, which is thd. We\n     need to know the start of the stack so that we could check for\n     stack overruns.\n     */\n    thd_set_thread_stack(thd, (char *)&thd);\n    thd->store_globals();\n\n    mysql_thread_set_psi_id(thd->thread_id());\n    mysql_socket_set_thread_owner(\n                                  thd->get_protocol_classic()->get_vio()->mysql_socket);\n\n    Global_THD_manager *thd_manager = Global_THD_manager::get_instance();\n    thd_manager->add_thd(thd);\n\n    if (!thd_prepare_connection(thd)) {\n        //authentication bypass\n        abort();\n    }\n    delete channel_info;\n    close_connection(thd, 0, false, false);\n    thd->release_resources();\n    thd_manager->remove_thd(thd);\n    delete thd;\n}\n\n\n#define MAX_SIZE 256\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    if (Size < 1) {\n        return 0;\n    }\n    if (logfile == NULL) {\n        my_progname = \"fuzz_mysqld\";\n        /* first init was run with\n         * mysqld --user=root --initialize-insecure --log-error-verbosity=5 --datadir=/out/mysql/data/ --basedir=/out/mysql/\n         */\n        utilfuzz_rmrf(\"/tmp/mysqld\");\n        char command[MAX_SIZE];\n        char argbase[MAX_SIZE];\n        char arginitfile[MAX_SIZE];\n        snprintf(command, MAX_SIZE-1, \"%s/mysql/data\", filepath);\n        utilfuzz_cpr(command, \"/tmp/mysqld\");\n\n        snprintf(argbase, MAX_SIZE-1, \"--basedir=%s/mysql/\", filepath);\n        snprintf(arginitfile, MAX_SIZE-1, \"--init-file=%s/init.sql\", filepath);\n        char *fakeargv[] = {const_cast<char *>(\"fuzz_mysqld\"),\n            const_cast<char *>(\"--user=root\"),\n            const_cast<char *>(\"--secure-file-priv=NULL\"),\n            const_cast<char *>(\"--log-error-verbosity=5\"),\n            const_cast<char *>(\"--explicit_defaults_for_timestamp\"),\n            //we should adapt vio_fuzz to give a socket to openssl in order to support ssl\n            const_cast<char *>(\"--skip-ssl\"),\n            const_cast<char *>(\"--mysqlx=0\"),\n            const_cast<char *>(\"--event-scheduler=DISABLED\"),\n            const_cast<char *>(\"--performance_schema=OFF\"),\n            const_cast<char *>(\"--thread_stack=1048576\"),\n            const_cast<char *>(\"--datadir=/tmp/mysqld/\"),\n            const_cast<char *>(\"--port=3303\"),\n            const_cast<char *>(\"--socket=/tmp/mysqld.sock\"),\n            const_cast<char *>(argbase),\n            const_cast<char *>(arginitfile),\n            0};\n        int fakeargc = 15;\n        mysqld_main(fakeargc, fakeargv);\n        //terminate_compress_gtid_table_thread();\n\n        logfile = fopen(\"/dev/null\", \"w\");\n    }\n    // The fuzzing takes place on network data received from client\n    sock_initfuzz(Data,Size-1);\n\n    Channel_info_fuzz *channel_info = new (std::nothrow) Channel_info_fuzz(Data[Size-1] & 0x80);\n    try_connection(channel_info);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_mysqld.dict",
    "content": "user=\"root\"\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_mysqld.options",
    "content": "[libfuzzer]\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_real_query.cc",
    "content": "#include <stdint.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string>\n#include <iostream>\n#include <mysql.h>\n#include <mysql/client_plugin.h>\n#include <mysqld_error.h>\n#include \"violite.h\"\n\nusing namespace std;\nFILE *logfile = NULL;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    MYSQL mysql;\n    long flags;\n    bool opt_cleartext = true;\n    unsigned int opt_ssl = SSL_MODE_DISABLED;\n    MYSQL_RES *result;\n\n    if (Size < sizeof(unsigned long)) {\n        return 0;\n    }\n    if (logfile == NULL) {\n        logfile = fopen(\"/dev/null\", \"w\");\n    }\n    memcpy(&flags, Data + Size - sizeof(unsigned long), sizeof(unsigned long));\n    mysql_init(&mysql);\n    mysql_options(&mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN, &opt_cleartext);\n    mysql_options(&mysql, MYSQL_OPT_SSL_MODE, &opt_ssl);\n    mysql.options.protocol = MYSQL_PROTOCOL_FUZZ;\n    // The fuzzing takes place on network data received from server\n    sock_initfuzz(Data,Size - sizeof(unsigned long));\n    if (!mysql_real_connect(&mysql, \"localhost\", \"root\", \"root\", \"dbname\", 0, NULL, flags)) {\n        goto out;\n    } else {\n        fprintf(logfile, \"The last inserted row id is: %llu\\n\", mysql_insert_id(&mysql));\n        fprintf(logfile, \"%llu affected rows\\n\", mysql_affected_rows(&mysql));\n        mysql_info(&mysql);\n    }\n\n    mysql_query(&mysql, \"CREATE DATABASE fuzzbase\");\n    if (mysql_query(&mysql, \"SELECT * FROM CARS\")) {\n        goto out;\n    }\n    result = mysql_store_result(&mysql);\n    if (result != NULL) {\n        int num_fields = mysql_num_fields(result);\n        MYSQL_FIELD *field;\n        while((field = mysql_fetch_field(result))) {\n            fprintf(logfile, \"%s\\n\", field->name);\n        }\n        MYSQL_ROW row = mysql_fetch_row(result);\n        unsigned long * lengths = mysql_fetch_lengths(result);\n        while (row ) {\n            for(int i = 0; i < num_fields; i++) {\n                fprintf(logfile, \"length %lu, %s\\n\", lengths[i], row[i] ? row[i] : \"NULL\");\n            }\n            row = mysql_fetch_row(result);\n        }\n        mysql_free_result(result);\n    }\n    result = mysql_list_dbs(&mysql, NULL);\n    if (result) {\n        mysql_free_result(result);\n    }\n    result = mysql_list_tables(&mysql, NULL);\n    if (result) {\n        mysql_free_result(result);\n    }\n    result = mysql_list_fields(&mysql, \"sometable\", NULL);\n    if (result) {\n        mysql_free_result(result);\n    }\n    result = mysql_list_processes(&mysql);\n    if (result) {\n        mysql_free_result(result);\n    }\n    mysql_ping(&mysql);\n\n    if (mysql_change_user(&mysql, \"user\", \"password\", \"new_database\")) {\n        goto out;\n    }\n    if (mysql_query(&mysql, \"INSERT INTO Fuzzers(Name) VALUES('myfuzzer')\") == 0) {\n        fprintf(logfile, \"The last inserted row id is: %llu\\n\", mysql_insert_id(&mysql));\n        fprintf(logfile, \"%llu affected rows\\n\", mysql_affected_rows(&mysql));\n        mysql_info(&mysql);\n    }\n    mysql_get_host_info(&mysql);\n    mysql_get_proto_info(&mysql);\n    mysql_get_server_info(&mysql);\n    mysql_get_server_version(&mysql);\n    mysql_dump_debug_info(&mysql);\n    mysql_sqlstate(&mysql);\n    mysql_stat(&mysql);\n\nout:\n    mysql_close(&mysql);\n    return 0;\n}\n"
  },
  {
    "path": "projects/mysql-server/targets/fuzz_stmt_fetch.cc",
    "content": "#include <stdint.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string>\n#include <iostream>\n#include <mysql.h>\n#include <mysql/client_plugin.h>\n#include <mysqld_error.h>\n#include \"violite.h\"\n\nusing namespace std;\n\n#define STRING_SIZE 50\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    MYSQL mysql;\n    MYSQL_BIND    bind[4];\n    MYSQL_RES     *prepare_meta_result;\n    MYSQL_TIME    ts;\n    unsigned long length[4];\n    int           column_count;\n    short         small_data;\n    int           int_data;\n    char          str_data[STRING_SIZE];\n    bool          is_null[4];\n    bool          error[4];\n    bool opt_cleartext = true;\n    unsigned int opt_ssl = SSL_MODE_DISABLED;\n\n    mysql_init(&mysql);\n    mysql_options(&mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN, &opt_cleartext);\n    mysql_options(&mysql, MYSQL_OPT_SSL_MODE, &opt_ssl);\n    mysql.options.protocol = MYSQL_PROTOCOL_FUZZ;\n    // The fuzzing takes place on network data received from server\n    sock_initfuzz(Data,Size);\n    if (!mysql_real_connect(&mysql,\"localhost\",\"root\",\"root\",\"\",0,NULL,0))\n    {\n        return 0;\n    }\n\n    MYSQL_STMT *stmt = mysql_stmt_init(&mysql);\n    if (!stmt)\n    {\n        mysql_stmt_close(stmt);\n        mysql_close(&mysql);\n        return 0;\n    }\n    if (mysql_stmt_prepare(stmt, \"SELECT col1, col2, col3, col4 FROM Cars\",(ulong)strlen(\"SELECT col1, col2, col3, col4 FROM Cars\")))\n    {\n        mysql_stmt_close(stmt);\n        mysql_close(&mysql);\n        return 0;\n    }\n    prepare_meta_result = mysql_stmt_result_metadata(stmt);\n    if (!prepare_meta_result)\n    {\n        mysql_stmt_close(stmt);\n        mysql_close(&mysql);\n        return 0;\n    }\n\n    if (mysql_stmt_execute(stmt))\n    {\n        mysql_stmt_close(stmt);\n        mysql_close(&mysql);\n        return 0;\n    }\n    column_count= mysql_num_fields(prepare_meta_result);\n    memset(bind, 0, sizeof(bind));\n    /* INTEGER COLUMN */\n    bind[0].buffer_type= MYSQL_TYPE_LONG;\n    bind[0].buffer= (char *)&int_data;\n    bind[0].is_null= &is_null[0];\n    bind[0].length= &length[0];\n    bind[0].error= &error[0];\n\n    /* STRING COLUMN */\n    bind[1].buffer_type= MYSQL_TYPE_STRING;\n    bind[1].buffer= (char *)str_data;\n    bind[1].buffer_length= STRING_SIZE;\n    bind[1].is_null= &is_null[1];\n    bind[1].length= &length[1];\n    bind[1].error= &error[1];\n\n    /* SMALLINT COLUMN */\n    bind[2].buffer_type= MYSQL_TYPE_SHORT;\n    bind[2].buffer= (char *)&small_data;\n    bind[2].is_null= &is_null[2];\n    bind[2].length= &length[2];\n    bind[2].error= &error[2];\n\n    /* TIMESTAMP COLUMN */\n    bind[3].buffer_type= MYSQL_TYPE_TIMESTAMP;\n    bind[3].buffer= (char *)&ts;\n    bind[3].is_null= &is_null[3];\n    bind[3].length= &length[3];\n    bind[3].error= &error[3];\n\n    if (mysql_stmt_bind_result(stmt, bind))\n    {\n        mysql_free_result(prepare_meta_result);\n        mysql_stmt_close(stmt);\n        mysql_close(&mysql);\n        return 0;\n    }\n    if (mysql_stmt_store_result(stmt))\n    {\n        mysql_free_result(prepare_meta_result);\n        mysql_stmt_close(stmt);\n        mysql_close(&mysql);\n        return 0;\n    }\n    while (1) {\n        int status = mysql_stmt_fetch(stmt);\n        if (status == 1 || status == MYSQL_NO_DATA)\n            break;\n    }\n\n    mysql_free_result(prepare_meta_result);\n    mysql_stmt_close(stmt);\n    mysql_close(&mysql);\n    return 0;\n}\n"
  },
  {
    "path": "projects/mysql-server/targets/init.sql",
    "content": "CREATE USER 'fuzzuser'@'localhost' IDENTIFIED BY 'fuzzpass';\nALTER USER 'root'@'localhost' IDENTIFIED BY 'mainpass';\n"
  },
  {
    "path": "projects/mysql-server/targets/initnopw.sql",
    "content": "CREATE USER 'fuzzuser'@'localhost' IDENTIFIED BY 'fuzzpass';\n"
  },
  {
    "path": "projects/mysql-server/targets/onefile.cc",
    "content": "#include <stdint.h>\n#include <stdlib.h>\n#include <stdio.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\n\nint main(int argc, char** argv)\n{\n    FILE * fp;\n    uint8_t *Data;\n    size_t Size;\n\n    if (argc != 2) {\n        return 1;\n    }\n    //opens the file, get its size, and reads it into a buffer\n    fp = fopen(argv[1], \"rb\");\n    if (fp == NULL) {\n        return 2;\n    }\n    if (fseek(fp, 0L, SEEK_END) != 0) {\n        fclose(fp);\n        return 2;\n    }\n    Size = ftell(fp);\n    if (Size == (size_t) -1) {\n        fclose(fp);\n        return 2;\n    }\n    if (fseek(fp, 0L, SEEK_SET) != 0) {\n        fclose(fp);\n        return 2;\n    }\n    Data = (uint8_t*)malloc(Size*sizeof(uint8_t));\n    if (Data == NULL) {\n        fclose(fp);\n        return 2;\n    }\n    if (fread(Data, Size, 1, fp) != 1) {\n        fclose(fp);\n        free(Data);\n        return 2;\n    }\n\n    //lauch fuzzer\n    LLVMFuzzerTestOneInput(Data, Size);\n    free(Data);\n    fclose(fp);\n    return 0;\n}\n"
  },
  {
    "path": "projects/mysql-server/targets/util_fuzz.cc",
    "content": "#include <stdio.h>\n#include <ftw.h>\n#include <unistd.h>\n#include <string.h>\n#include <fcntl.h>\n\n\nstatic int remove_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) {\n    int rv = 2;\n    if (S_ISDIR(sb->st_mode)) {\n        rv = rmdir(fpath);\n    } else {\n        rv = remove(fpath);\n    }\n    printf(\"lol %s\\n\", fpath);\n    return rv;\n}\n\nint utilfuzz_rmrf(char *path) {\n    return nftw(path, remove_cb, 64, FTW_DEPTH | FTW_PHYS);\n}\n\nchar *globalto;\nsize_t globallen = 0;\n\n#define CP_NAME_MAX_SIZE 512\n#define CP_BUF_SIZE 4096\nstatic int cp_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) {\n    char newname[CP_NAME_MAX_SIZE];\n    char buf[CP_BUF_SIZE];\n    int rv = 2;\n    snprintf(newname, CP_NAME_MAX_SIZE-1, \"%s%s\", globalto, fpath+globallen);\n    if (FTW_D == typeflag) {\n        rv = mkdir(newname, sb->st_mode);\n    } else {\n        int fdin = open(fpath, O_RDONLY);\n        int fdout = open(newname, O_WRONLY|O_CREAT, sb->st_mode);\n        int nb = read(fdin, buf, CP_BUF_SIZE);\n        while (nb > 0) {\n            write(fdout, buf, nb);\n            nb = read(fdin, buf, CP_BUF_SIZE);\n        }\n        rv = 0;\n    }\n    return rv;\n}\n\nint utilfuzz_cpr(char *pathfrom, char *pathto) {\n    globalto = pathto;\n    globallen = strlen(pathfrom);\n    return nftw(pathfrom, cp_cb, 64, FTW_PHYS);\n}\n\n"
  },
  {
    "path": "projects/mysql-server/targets/util_fuzz.h",
    "content": "#include <stdio.h>\n\nint utilfuzz_rmrf(char *path);\nint utilfuzz_cpr(char *pathfrom, char *pathto);\n"
  },
  {
    "path": "projects/naga/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/gfx-rs/wgpu wgpu\nWORKDIR wgpu/naga\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/naga/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build -O\nfuzz_release=$SRC/wgpu/target/x86_64-unknown-linux-gnu/release\ncp $fuzz_release/spv_parser $OUT/\ncp $fuzz_release/wgsl_parser $OUT/\n"
  },
  {
    "path": "projects/naga/project.yaml",
    "content": "homepage: \"https://github.com/gfx-rs/naga\"\nlanguage: rust\nmain_repo: \"https://github.com/gfx-rs/naga\"\nprimary_contact: \"jblandy@mozilla.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n  - maxnair.dev@gmail.com\n  - jkratzer@mozilla.com\n  - twsmith@mozilla.com\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/rustc/.*\n"
  },
  {
    "path": "projects/nanopb/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip git wget\nRUN python3 -m pip install --upgrade pip\nRUN pip3 install protobuf grpcio-tools scons\nRUN update-alternatives --install /usr/bin/python python $(which python3) 100\nRUN git clone --depth 1 https://github.com/nanopb/nanopb $SRC/nanopb\nCOPY build.sh $SRC/\n\n"
  },
  {
    "path": "projects/nanopb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build script is integrated to nanopb repository.\nsource $SRC/nanopb/tests/fuzztest/ossfuzz.sh\n\n"
  },
  {
    "path": "projects/nanopb/project.yaml",
    "content": "homepage: \"https://jpa.kapsi.fi/nanopb/\"\nlanguage: c++\nprimary_contact: \"jpa@npb.mail.kapsi.fi\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/nanopb/nanopb'\n"
  },
  {
    "path": "projects/nats/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/nats-io/nats-server\nCOPY build.sh $SRC/\nWORKDIR $SRC/nats-server\n"
  },
  {
    "path": "projects/nats/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/nats-io/nats-server/v2/conf Fuzz fuzz_conf\ncompile_go_fuzzer github.com/nats-io/nats-server/v2/server FuzzClient fuzz_client\n"
  },
  {
    "path": "projects/nats/project.yaml",
    "content": "homepage: \"https://github.com/nats-io/nats-server\"\nprimary_contact: \"security@nats.io\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"wally@synadia.com\"\n  - \"derek@synadia.com\"\n  - \"tomasz@synadia.com\"\n  - \"neil@synadia.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/nats-io/nats-server'\n"
  },
  {
    "path": "projects/nbclassic/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y npm libffi-dev\nRUN python3 -m pip install --upgrade pip\nRUN curl https://sh.rustup.rs -sSf | sh -s -- -y\nENV PATH=\"/root/.cargo/bin:${PATH}\"\nRUN rustup install nightly\nRUN rustup default nightly\nRUN python3 -m pip install --upgrade pip cython notebook\nRUN git clone --depth=1 https://github.com/python-jsonschema/jsonschema-specifications jsonschema_specifications\nRUN git clone https://github.com/jupyter/nbclassic nbclassic\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/nbclassic\n"
  },
  {
    "path": "projects/nbclassic/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data $SRC/jsonschema_specifications/jsonschema_specifications/schemas:jsonschema_specifications/schemas --add-data /usr/local/lib/python3.10/site-packages/jupyter_events/schemas:jupyter_events/schemas\ndone\n"
  },
  {
    "path": "projects/nbclassic/fuzz_cell.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom nbclassic.bundler.tools import get_cell_reference_patterns\nfrom nbformat.v4 import new_markdown_cell\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  new_cell = new_markdown_cell(fdp.ConsumeUnicodeNoSurrogates(4096))\n  if new_cell != None:\n    get_cell_reference_patterns(new_cell)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/nbclassic/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/jupyter/nbclassic\nmain_repo: https://github.com/jupyter/nbclassic\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/nbformat/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && pip3 install cython\nRUN git clone https://github.com/jupyter/nbformat nbformat\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/nbformat\n"
  },
  {
    "path": "projects/nbformat/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/nbformat/fuzz_read.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport io\nimport atheris\nimport nbformat\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  notebook_in_mem = io.StringIO(fdp.ConsumeUnicodeNoSurrogates(32768))\n  for version in range(1, 5):\n    try:\n      nbformat.read(notebook_in_mem, as_version=version)\n    except nbformat.reader.NotJSONError:\n      pass\n    except nbformat.NBFormatError:\n      pass\n    except nbformat.validator.ValidationError:\n      pass\n    except AttributeError:\n      pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/nbformat/project.yaml",
    "content": "homepage: https://github.com/jupyter/nbformat\nmain_repo: https://github.com/jupyter/nbformat\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/nccl/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\n# Install CUDA\nRUN mkdir $SRC/cuda-install && \\\n    cd $SRC/cuda-install && \\\n    wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \\\n    mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \\\n    wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb && \\\n    dpkg -i cuda-keyring_1.1-1_all.deb && \\\n    apt-get update && \\\n    apt-get -y install cuda-toolkit-12-9\n\nRUN git clone --depth 1 https://github.com/NVIDIA/nccl nccl\nWORKDIR nccl\nCOPY build.sh *.cpp $SRC/\n"
  },
  {
    "path": "projects/nccl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# CUDA does not support clang versions above 10.0. This should not affect the\n# target of the fuzzers, however, during build we still need to allow it to\n# compile with the OSS-Fuzz clang version.\nsed -i 's/--expt-extended-lambda/-allow-unsupported-compiler --expt-extended-lambda/g' ./makefiles/common.mk\nsed -i 's/--expt-extended-lambda/-allow-unsupported-compiler --expt-extended-lambda/g' ./src/device/Makefile\nexport CXXFLAGS=\"$CXXFLAGS -stdlib=libstdc++\"\nmake clean\n# Watch out for exhausting memory\nmake -j3 src.build\n\n$CXX $LIB_FUZZING_ENGINE $CXXFLAGS $SRC/fuzz_xml.cpp -o $OUT/fuzz_xml \\\n    -DNCCL_OS_LINUX \\\n    -I./src/graph/ -I./src/include -I./src/include/plugin -I./build/include/ \\\n    -I/usr/local/cuda-12.9/targets/x86_64-linux/include/ \\\n    ./build/lib/libnccl_static.a \\\n    /usr/local/cuda-12.9/targets/x86_64-linux/lib/libcudart.so \\\n    -latomic\n\ncp /usr/local/cuda-12.9/targets/x86_64-linux/lib/libcudart.so.12 $OUT/libcudart.so.12\ncp /usr/local/cuda-12.9/targets/x86_64-linux/lib/libcudart.so $OUT/libcudart.so\npatchelf --set-rpath '$ORIGIN/' $OUT/fuzz_xml\n"
  },
  {
    "path": "projects/nccl/fuzz_xml.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"core.h\"\n#include \"graph.h\"\n#include \"xml.h\"\n#include <fcntl.h>\n#include <sys/stat.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  struct ncclXml *xml;\n  ncclCalloc(&xml, 1);\n  ncclTopoGetXmlFromFile(filename, xml, 1);\n  free(xml);\n\n  unlink(filename);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/nccl/project.yaml",
    "content": "homepage: \"https://github.com/NVIDIA/nccl\"\nlanguage: c++\nmain_repo: \"https://github.com/NVIDIA/nccl\"\nvendor_ccs:\n- david@adalogics.com\nfuzzing_engines:\n- libfuzzer\n- honggfuzz\n"
  },
  {
    "path": "projects/ndpi/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake autogen pkg-config libtool flex bison cmake libnuma-dev libpcre2-dev libjson-c-dev\nRUN git clone --depth 1 https://github.com/ntop/nDPI.git ndpi\nADD https://www.tcpdump.org/release/libpcap-1.9.1.tar.gz libpcap-1.9.1.tar.gz\nADD https://github.com/json-c/json-c/archive/refs/tags/json-c-0.17-20230812.tar.gz json-c-0.17-20230812.tar.gz\nRUN tar -xvzf json-c-0.17-20230812.tar.gz\nCOPY build.sh run_tests.sh $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/ndpi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd $SRC/json-c-json-c-0.17-20230812\n  mkdir build\n  cd build\n  cmake -DBUILD_SHARED_LIBS=OFF ..\n  make -j$(nproc)\n  make install\npopd\n\nbash -x ./ndpi/tests/ossfuzz.sh\npushd $SRC/ndpi/tests/unit\n    make unit\npopd\n"
  },
  {
    "path": "projects/ndpi/project.yaml",
    "content": "homepage: \"https://www.ntop.org/products/deep-packet-inspection/ndpi/\"\nlanguage: c++\nprimary_contact: \"luca.deri@gmail.com\"\nauto_ccs :\n  - \"p.antoine@catenacyber.fr\"\n  - \"nardi.ivan@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/ntop/nDPI.git'\nbase_os_version: ubuntu-24-04\n\n#As a general rule, we want coverage for all the third party code that we have\n#in our repository. Two exceptions:\n# 1) Coverage report doesn't analyze custom mutator code\n#    (see https://github.com/google/oss-fuzz/issues/12143) --> exclude it\n# 2) croaring is HUGE (its size is comparable to the entire nDPI codebase!)\n#    and we are using only a tiny part of it.\n#    Note that we do fuzz that part (also) via the specific fuzz_ds_bitmap fuzzer\ncoverage_extra_args: >\n  -ignore-filename-regex=src/lib/third_party/src/fuzz/.*\n  -ignore-filename-regex=src/lib/third_party/src/roaring.c\n  -ignore-filename-regex=src/lib/third_party/include/roaring.h\n"
  },
  {
    "path": "projects/ndpi/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd $SRC/ndpi/tests/unit\n    ./unit\npopd\n"
  },
  {
    "path": "projects/neomutt/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN\tapt-get update && \\\n\tapt-get install -y libncurses-dev libtinfo6 libtool make pkgconf libidn2-0-dev libsqlite3-dev\n\nRUN git clone --depth 1 https://github.com/neomutt/neomutt\nRUN git clone --depth 1 https://github.com/neomutt/corpus-address\n\nWORKDIR neomutt\nCOPY build.sh $SRC/\n\n"
  },
  {
    "path": "projects/neomutt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./configure --fuzzing --disable-doc --disable-nls\nmake fuzz -j$(nproc)\ncp fuzz/address-fuzz $OUT/\n\ncd $SRC/corpus-address\ncp address-fuzz.options $OUT/\ncp address-fuzz.dict $OUT/\n\ncd corpus\nzip -q -r $OUT/address-fuzz_seed_corpus.zip .\n\n"
  },
  {
    "path": "projects/neomutt/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://neomutt.org\"\nlanguage: c++\nprimary_contact: \"joseph.bisch@gmail.com\"\nauto_ccs:\n  - \"richard.russon@gmail.com\"\n  - \"pietro.cerutti@gmail.com\"\nmain_repo: 'https://github.com/neomutt/neomutt'\nsanitizers:\n - address\n - undefined\nfuzzing_engines:\n - afl\n - libfuzzer\n"
  },
  {
    "path": "projects/neqo/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n        libclang-dev gyp ninja-build python-is-python3 zlib1g-dev mercurial \\\n        && apt-get autoremove -y && apt-get clean -y \\\n        && rm -rf /var/lib/apt/lists/*\n\n# We unfortunately need to build NSS from source, because the Debian package\n# in the base distribution is too old.\nRUN hg clone https://hg.mozilla.org/projects/nspr $SRC/nspr\nRUN git clone --depth 1 https://github.com/nss-dev/nss $SRC/nss\nRUN git clone --depth 1 https://github.com/mozilla/neqo $SRC/neqo\nENV NSS_DIR=$SRC/nss NSS_PREBUILT=1\n\n# FIXME: Optimized NSS build fails with assembler errors.\n# Maybe not critical since the fuzzer uses AeadNull.\nRUN CXX=\"$CXX -stdlib=libc++\" $NSS_DIR/build.sh --static -Ddisable_tests=1 -Ddisable_dbm=1 -Ddisable_libpkix=1 -Ddisable_ckbi=1 -Ddisable_fips=1\n\n# neqo expects a Release build of NSS, but (see above) that is failing. Work around this.\nRUN ln -s $SRC/dist/Debug $SRC/dist/Release\n\nRUN rustup default nightly\nRUN rustup component add --toolchain nightly rust-src\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/neqo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd \"$SRC/neqo\"\n\ncp -av test-fixture/db/* \"$OUT\"\nexport NSS_DB_PATH='$ARGV0'\n\n# FIXME: https://github.com/rust-fuzz/cargo-fuzz/issues/384 for why no LTO.\nCARGO_PROFILE_RELEASE_LTO=false cargo +nightly fuzz build --release --debug-assertions\n\nFUZZ_TARGET_OUTPUT_DIR=target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs; do\n        FUZZ_TARGET_NAME=$(basename \"${f%.*}\")\n        cp \"$FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME\" \"$OUT/\"\n        if [ -d \"fuzz/corpus/$FUZZ_TARGET_NAME\" ]; then\n                zip -j \"$OUT/${FUZZ_TARGET_NAME}_seed_corpus.zip\" \"fuzz/corpus/$FUZZ_TARGET_NAME\"/*\n        fi\ndone\n"
  },
  {
    "path": "projects/neqo/project.yaml",
    "content": "homepage: \"https://github.com/mozilla/neqo\"\nlanguage: rust\nprimary_contact: \"necko@mozilla.com\"\nauto_ccs:\n  - \"leggert@mozilla.com\"\n  - \"minden@mozilla.com\"\n  - \"kershaw@mozilla.com\"\n  - \"mdauer@mozilla.com\"\n  - \"jkratzer@mozilla.com\"\nvendor_ccs:\n  - \"oss-fuzz@mozilla-fuzzing.iam.gserviceaccount.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/mozilla/neqo.git'\nfile_github_issue: true\n"
  },
  {
    "path": "projects/nestegg/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt update && apt install -y autoconf automake libtool pkg-config\nRUN git clone --depth 1 https://github.com/kinetiknz/nestegg.git\n\n# clone libwebm for corpus data\nRUN git clone --depth 1 https://github.com/webmproject/libwebm.git\n\nWORKDIR nestegg\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/nestegg/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$CC $CFLAGS -c -I./include src/nestegg.c\n$CXX $CXXFLAGS -o $OUT/fuzz -I./include nestegg.o test/fuzz.cc $LIB_FUZZING_ENGINE\n\n\nmkdir corpus/\n# copy libwebm test data\ncp -R ../libwebm/testing/testdata/*.webm corpus/\n# copy nestegg test data\ncp test/media/*.webm corpus/\nzip -rj0 $OUT/fuzz_seed_corpus.zip corpus/*.webm\n\n# Build unit test\nautoreconf --install\n./configure\nmake\n"
  },
  {
    "path": "projects/nestegg/project.yaml",
    "content": "homepage: \"https://github.com/kinetiknz/nestegg\"\nlanguage: c++\nprimary_contact: \"mgregan@mozilla.com\"\nfuzzing_engines:\n  - afl\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nvendor_ccs:\n  - \"media-alerts@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nmain_repo: 'https://github.com/kinetiknz/nestegg.git'\n"
  },
  {
    "path": "projects/nestegg/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check -j$(nproc)\n"
  },
  {
    "path": "projects/net-snmp/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone -q --depth 1 https://github.com/net-snmp/net-snmp net-snmp\nRUN net-snmp/ci/install.sh\nWORKDIR net-snmp\nCOPY build.sh $SRC/\nCOPY *.dict $SRC/\n"
  },
  {
    "path": "projects/net-snmp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Globally disable leaks to let fuzzers continue.\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nexport CFLAGS=\"${CFLAGS} -Wno-error=declaration-after-statement\"\n\n# Configure and build Net-SNMP and the fuzzers.\nexport CC CXX CFLAGS CXXFLAGS SRC WORK OUT LIB_FUZZING_ENGINE\nMODE=regular ci/build.sh\n\n# Create dictionary and seeds\ncp $SRC/mib.dict $OUT/snmp_mib_fuzzer.dict\nzip $OUT/snmp_mib_fuzzer_seed_corpus.zip $SRC/net-snmp/mibs/*.txt\n"
  },
  {
    "path": "projects/net-snmp/mib.dict",
    "content": "\"obsolete\"\n\"Opaque\"\n\"optional\"\n\"LAST-UPDATED\"\n\"ORGANIZATION\"\n\"CONTACT-INFO\"\n\"MODULE-IDENTITY\"\n\"MODULE-COMPLIANCE\"\n\"DEFINITIONS\"\n\"END\"\n\"AUGMENTS\"\n\"not-accessible\"\n\"write-only\"\n\"NsapAddress\"\n\"UNITS\"\n\"REFERENCE\"\n\"NUM-ENTRIES\"\n\"BITSTRING\"\n\"BIT\"\n\"BITS\"\n\"Counter64\"\n\"TimeTicks\"\n\"NOTIFICATION-TYPE\"\n\"OBJECT-GROUP\"\n\"OBJECT-IDENTITY\"\n\"IDENTIFIER\"\n\"OBJECT\"\n\"NetworkAddress\"\n\"Gauge\"\n\"Gauge32\"\n\"Unsigned32\"\n\"read-write\"\n\"read-create\"\n\"OCTETSTRING\"\n\"OCTET\"\n\"OF\"\n\"SEQUENCE\"\n\"NULL\"\n\"IpAddress\"\n\"UInteger32\"\n\"INTEGER\"\n\"Integer32\"\n\"Counter\"\n\"Counter32\"\n\"read-only\"\n\"DESCRIPTION\"\n\"INDEX\"\n\"DEFVAL\"\n\"deprecated\"\n\"SIZE\"\n\"MAX-ACCESS\"\n\"ACCESS\"\n\"mandatory\"\n\"current\"\n\"STATUS\"\n\"SYNTAX\"\n\"OBJECT-TYPE\"\n\"TRAP-TYPE\"\n\"ENTERPRISE\"\n\"BEGIN\"\n\"IMPORTS\"\n\"EXPORTS\"\n\"accessible-for-notify\"\n\"TEXTUAL-CONVENTION\"\n\"NOTIFICATION-GROUP\"\n\"DISPLAY-HINT\"\n\"FROM\"\n\"AGENT-CAPABILITIES\"\n\"MACRO\"\n\"IMPLIED\"\n\"SUPPORTS\"\n\"INCLUDES\"\n\"VARIATION\"\n\"REVISION\"\n\"not-implemented\"\n\"OBJECTS\"\n\"NOTIFICATIONS\"\n\"MODULE\"\n\"MIN-ACCESS\"\n\"PRODUCT-RELEASE\"\n\"WRITE-SYNTAX\"\n\"CREATION-REQUIRES\"\n\"MANDATORY-GROUPS\"\n\"GROUP\"\n\"CHOICE\"\n\"IMPLICIT\"\n\"ObjectSyntax\"\n\"SimpleSyntax\"\n\"ApplicationSyntax\"\n\"ObjectName\"\n\"NotificationName\"\n\"VARIABLES\"\n\"RFC1065-SMI\"\n\"RFC1066-MIB\"\n\"RFC1156-MIB\"\n\"RFC1158-MIB\"\n\"RFC1155-SMI\"\n\"RFC1213-MIB\"\n\"RFC1271-MIB\"\n\"RFC1286-MIB\"\n\"RFC1316-MIB\"\n\"RFC1406-MIB\"\n\"RFC-1213\"\n"
  },
  {
    "path": "projects/net-snmp/project.yaml",
    "content": "homepage: \"http://www.net-snmp.org/\"\nlanguage: c++\nprimary_contact: \"hardaker@users.sourceforge.net\"\nauto_ccs:\n   - \"rstory@freesnmp.com\"\n   - \"fenner@gmail.com\"\n   - \"bvanassche@acm.org\"\n   - \"magfr@lysator.liu.se\"\n   - \"david@adalogics.com\"\nmain_repo: 'git://git.code.sf.net/p/net-snmp/code'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/netaddr-py/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/netaddr/netaddr\nCOPY build.sh *.py $SRC/\nWORKDIR netaddr\n"
  },
  {
    "path": "projects/netaddr-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/netaddr-py/fuzz_parsing.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    from netaddr import IPAddress, IPNetwork, IPRange, AddrFormatError\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    s1 = fdp.ConsumeString(fdp.ConsumeIntInRange(0, 1024))\n    s2 = fdp.ConsumeString(fdp.ConsumeIntInRange(0, 1024))\n    try:\n        IPAddress(s1)\n        IPNetwork(s1)\n        IPRange(s1,s2)\n    except AddrFormatError as e:\n        None\n    except ValueError as e:\n        msgs = [\n            \"is an invalid IP version\",\n            \"netmasks or subnet\"\n        ]\n        found = False\n        for msg in msgs:\n            if msg in str(e):\n                found = True\n        if not found:\n            raise e\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/netaddr-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/netaddr/netaddr\nlanguage: python\nmain_repo: https://github.com/netaddr/netaddr\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/netcdf/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake m4 zlib1g-dev libcurlpp-dev libcurl4-openssl-dev\nRUN git clone --depth 1 https://github.com/Unidata/netcdf-c\nCOPY run_tests.sh build.sh $SRC/\nWORKDIR $SRC/netcdf-c\n"
  },
  {
    "path": "projects/netcdf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"$CFLAGS -fPIC\"\nexport CXXFLAGS=\"$CXXFLAGS -fPIC\"\n\n# build project\nmkdir build\ncd build\ncmake -DBUILD_SHARED_LIBS=OFF -DENABLE_HDF5=OFF -DENABLE_DAP=OFF ..\nmake -j$(nproc)\ncp fuzz/fuzz* $OUT/\n"
  },
  {
    "path": "projects/netcdf/project.yaml",
    "content": "homepage: \"https://www.unidata.ucar.edu/software/netcdf/docs/index.html\"\nlanguage: c++\nprimary_contact: \"wfisher@ucar.edu\"\nauto_ccs:\n- \"p.antoine@catenacyber.fr\"\n- \"dmh@ucar.edu\"\n\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/Unidata/netcdf-c'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/netcdf/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir $SRC/netcdf-c/build -j$(nproc)\n"
  },
  {
    "path": "projects/netdata/project.yaml",
    "content": "homepage: \"https://my-netdata.io\"\nmain_repo: \"https://github.com/netdata/netdata\"\nprimary_contact: \"costa@tsaousis.gr\"\n"
  },
  {
    "path": "projects/nettle/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! Project pinned after a clang update and an afl link error. Log: https://oss-fuzz-gcb-logs.storage.googleapis.com/log-e701b6fa-f3a0-414e-ad6e-0223e6d42ebd.txt\nRUN apt-get update && apt-get install -y software-properties-common make autoconf build-essential wget lzip libtool\nRUN git clone --depth 1 https://git.lysator.liu.se/nettle/nettle\nCOPY fuzz_*.c $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/nettle/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build Nettle with mini-gmp (no external gmp dependency)\ncd $SRC/nettle\nbash .bootstrap\n\nif [[ $CFLAGS != *sanitize=memory* ]]\nthen\n    ./configure --enable-mini-gmp --disable-documentation --disable-openssl --prefix=$SRC/nettle-install\nelse\n    ./configure --enable-mini-gmp --disable-documentation --disable-openssl --disable-assembler --prefix=$SRC/nettle-install\nfi\n\nmake -j$(nproc)\nmake install\n\n# Build all fuzzers\nFUZZERS=\"\nfuzz_dsa_sha1_keypair_from_sexp\nfuzz_dsa_sha256_keypair_from_sexp\nfuzz_dsa_signature_from_sexp\nfuzz_dsa_openssl_private_key_from_der\nfuzz_rsa_keypair_from_sexp\nfuzz_rsa_keypair_from_der\nfuzz_rsa_public_key_from_der\n\"\n\nfor fuzzer in $FUZZERS; do\n    $CC $CFLAGS -I$SRC/nettle-install/include -c $SRC/${fuzzer}.c -o $SRC/${fuzzer}.o\n    $CXX $CXXFLAGS $SRC/${fuzzer}.o -o $OUT/${fuzzer} \\\n        $LIB_FUZZING_ENGINE \\\n        $SRC/nettle-install/lib/libhogweed.a \\\n        $SRC/nettle-install/lib/libnettle.a\ndone\n\n"
  },
  {
    "path": "projects/nettle/fuzz_dsa_openssl_private_key_from_der.c",
    "content": "// Copyright 2025 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <nettle/dsa.h>\n#include <nettle/bignum.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    struct dsa_params params;\n    mpz_t pub, priv;\n\n    dsa_params_init(&params);\n    mpz_init(pub);\n    mpz_init(priv);\n\n    dsa_openssl_private_key_from_der(&params, pub, priv, 0, size, data);\n\n    mpz_clear(priv);\n    mpz_clear(pub);\n    dsa_params_clear(&params);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/nettle/fuzz_dsa_sha1_keypair_from_sexp.c",
    "content": "// Copyright 2025 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <nettle/dsa.h>\n#include <nettle/bignum.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    struct dsa_params params;\n    mpz_t pub, priv;\n\n    dsa_params_init(&params);\n    mpz_init(pub);\n    mpz_init(priv);\n\n    dsa_sha1_keypair_from_sexp(&params, pub, priv, 0, size, data);\n\n    mpz_clear(priv);\n    mpz_clear(pub);\n    dsa_params_clear(&params);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/nettle/fuzz_dsa_sha256_keypair_from_sexp.c",
    "content": "// Copyright 2025 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <nettle/dsa.h>\n#include <nettle/bignum.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    struct dsa_params params;\n    mpz_t pub, priv;\n\n    dsa_params_init(&params);\n    mpz_init(pub);\n    mpz_init(priv);\n\n    dsa_sha256_keypair_from_sexp(&params, pub, priv, 0, size, data);\n\n    mpz_clear(priv);\n    mpz_clear(pub);\n    dsa_params_clear(&params);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/nettle/fuzz_dsa_signature_from_sexp.c",
    "content": "// Copyright 2025 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <nettle/dsa.h>\n#include <nettle/sexp.h>\n#include <nettle/bignum.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    struct dsa_signature sig;\n    struct sexp_iterator iter;\n\n    dsa_signature_init(&sig);\n\n    if (sexp_iterator_first(&iter, size, data)) {\n        dsa_signature_from_sexp(&sig, &iter, 256);\n    }\n\n    dsa_signature_clear(&sig);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/nettle/fuzz_rsa_keypair_from_der.c",
    "content": "// Copyright 2025 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <nettle/rsa.h>\n#include <nettle/bignum.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    struct rsa_public_key pub;\n    struct rsa_private_key priv;\n\n    rsa_public_key_init(&pub);\n    rsa_private_key_init(&priv);\n\n    rsa_keypair_from_der(&pub, &priv, 0, size, data);\n\n    rsa_private_key_clear(&priv);\n    rsa_public_key_clear(&pub);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/nettle/fuzz_rsa_keypair_from_sexp.c",
    "content": "// Copyright 2025 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <nettle/rsa.h>\n#include <nettle/bignum.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    struct rsa_public_key pub;\n    struct rsa_private_key priv;\n\n    rsa_public_key_init(&pub);\n    rsa_private_key_init(&priv);\n\n    rsa_keypair_from_sexp(&pub, &priv, 0, size, data);\n\n    rsa_private_key_clear(&priv);\n    rsa_public_key_clear(&pub);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/nettle/fuzz_rsa_public_key_from_der.c",
    "content": "// Copyright 2025 Google LLC.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <nettle/rsa.h>\n#include <nettle/asn1.h>\n#include <nettle/bignum.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    struct rsa_public_key pub;\n    struct asn1_der_iterator iter;\n\n    rsa_public_key_init(&pub);\n\n    if (asn1_der_iterator_first(&iter, size, data) == ASN1_ITERATOR_CONSTRUCTED) {\n        rsa_public_key_from_der_iterator(&pub, 0, &iter);\n    }\n\n    rsa_public_key_clear(&pub);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/nettle/project.yaml",
    "content": "homepage: \"https://www.lysator.liu.se/~nisse/nettle/\"\nlanguage: c++\nprimary_contact: guidovranken@gmail.com\nauto_ccs:\n    - \"nisse@lysator.liu.se\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n - x86_64\n - i386\nmain_repo: 'https://git.lysator.liu.se/nettle/nettle'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/netty/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.6.3 && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven-3.6.3/apache-maven-3.6.3/bin/mvn\n\n#\n# additional build dependencies as documented in\n#   https://netty.io/wiki/setting-up-development-environment.html\n#\nRUN apt-get install -y autoconf automake libtool make tar \\\n                  libaio-dev libssl-dev libapr1-dev \\\n                  lksctp-tools\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/netty/netty.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/netty"
  },
  {
    "path": "projects/netty/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-DskipTests\"\nALL_JARS=\"\"\nLIBRARY_NAME=\"netty\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \".\"\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/netty/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>netty-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>4.1.115.Final</fuzzedLibaryVersion>\n\t\t<exec.mainClass>io.netty.handler.codec.http.cookie.ServerCookieDecoderFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.22.1</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>io.netty</groupId>\n\t\t\t<artifactId>netty-all</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/netty/project.yaml",
    "content": "homepage: \"https://netty.io/\"\nlanguage: jvm\nmain_repo: \"https://github.com/netty/netty.git\"\nprimary_contact: \"mr.chrisvest@gmail.com\"\nauto_ccs:\n  - \"norman_maurer@apple.com\"\n  - \"t@motd.kr\"\n  - \"me@yawk.at\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/netty/src/main/java/io/netty/buffer/ByteBufUtilFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n\npackage io.netty.buffer;\n\nimport java.nio.charset.Charset;\nimport java.nio.CharBuffer;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic class ByteBufUtilFuzzer {\n\t\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\t\n\tpublic ByteBufUtilFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\t}\n\n\tbyte[] getByteArray() {\n\t\tint length = fuzzedDataProvider.consumeInt(0, fuzzedDataProvider.remainingBytes());\n\t\treturn fuzzedDataProvider.consumeBytes(length);\n\t}\n\n\tCharBuffer getCharBuffer() {\n\t\tCharSequence charSequence = getCharSequence();\n\t\tCharBuffer charBuffer = CharBuffer.allocate(charSequence.length());\n\t\tcharBuffer.put(charSequence.toString());\n\t\treturn charBuffer;\n\t}\n\n\tCharSequence getCharSequence() {\n\t\tint length = fuzzedDataProvider.consumeInt(0, fuzzedDataProvider.remainingBytes());\n\t\treturn fuzzedDataProvider.consumeString(length);\n\t}\n\n\tint validIndex(ByteBuf buffer) {\n\t\tint max = buffer.capacity();\n\t\tif (max != 0) {\n\t\t\tmax -= 1; // zero index is first element\n\t\t}\n\t\treturn fuzzedDataProvider.consumeInt(0, max);\n\t}\n\n\tint validLength(ByteBuf buffer, int start) {\n\t\tint length = validIndex(buffer);\n\t\tif (start + length > buffer.capacity()) {\n\t\t\tlength = buffer.capacity() - start;\n\t\t\tlength -= 1; // zero index is first element\n\t\t}\n\t\treturn length;\n\t}\n\n\tvoid test() {\n\t\ttry {\n\t\t\tint fromIndex = fuzzedDataProvider.consumeInt();\n\t\t\tint toIndex = fuzzedDataProvider.consumeInt();\n\t\t\tbyte value = fuzzedDataProvider.consumeByte();\n\t\t\tByteBuf buffer = Unpooled.copiedBuffer(getByteArray());\n\t\t\tByteBuf secondBuffer = Unpooled.copiedBuffer(getByteArray());\n\t\t\tif (buffer.capacity() != 0) {\n\t\t\t\t// fromIndex and toIndex need to be valid indices, or indexOf\n\t\t\t\t// will throw an out of bounds exception, which is not\n\t\t\t\t// documented\n\t\t\t\tByteBufUtil.indexOf(buffer, Math.abs(fromIndex % buffer.capacity()), Math.abs(toIndex % buffer.capacity()), value);\n\t\t\t}\n\t\t\tByteBufUtil.indexOf(secondBuffer, buffer);\n\t\t\tByteBufUtil.hexDump(buffer);\n\t\t\tByteBufUtil.hashCode(buffer);\n\n\t\t\tCharSequence charSequence = getCharSequence();\n\t\t\tif (buffer.capacity() >= buffer.writerIndex() + charSequence.length()) {\n\t\t\t\tByteBufUtil.writeUtf8(buffer, charSequence);\n\t\t\t}\n\t\t\tByteBufUtil.writeUtf8(buffer.alloc(), charSequence);\n\t\t\tByteBufUtil.encodeString(buffer.alloc(), getCharBuffer(), Charset.forName(\"UTF-8\"));\n\t\t\tif(buffer.capacity() != 0) {\n\t\t\t\t// again, out of bounds exceptions if the input array is empty\n\t\t\t\tint index = validIndex(buffer);\n\t\t\t\tint length = validLength(buffer, index);\n\t\t\t\tByteBufUtil.decodeString(buffer, index, length, Charset.forName(\"US-ASCII\"));\n\t\t\t\tCompositeByteBuf compositeByteBuf = Unpooled.compositeBuffer().addComponent(buffer);\n\t\t\t\tByteBufUtil.firstIndexOf(compositeByteBuf, index, length, value);\n\t\t\t}\n\n\t\t\tByteBufUtil.equals(buffer, secondBuffer);\n\t\t\tByteBufUtil.compare(buffer, secondBuffer);\n\t\t\tByteBufUtil.appendPrettyHexDump(new StringBuilder(charSequence), secondBuffer);\n\t\t\tint index = validIndex(buffer);\n\t\t\tint length = validLength(buffer, index);\n\t\t\tByteBufUtil.isText(buffer, Charset.forName(\"UTF-8\"));\n\t\t\tByteBufUtil.isText(buffer,index, length, Charset.forName(\"UTF-8\"));\n\t\t\tByteBufUtil.prettyHexDump(buffer);\n\t\t\tByteBufUtil.swapInt(fuzzedDataProvider.consumeInt());\n\t\t\tByteBufUtil.swapLong(fuzzedDataProvider.consumeLong());\n\t\t\tByteBufUtil.swapMedium(fuzzedDataProvider.consumeInt());\n\t\t\tByteBufUtil.swapShort(fuzzedDataProvider.consumeShort());\n\t\t} catch (IllegalArgumentException e) {\n\n\t\t} catch (IllegalStateException e) {\n\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\tByteBufUtilFuzzer fixture = new ByteBufUtilFuzzer(fuzzedDataProvider);\n\t\tfixture.test();\n\t}\n}"
  },
  {
    "path": "projects/netty/src/main/java/io/netty/buffer/LongLongHashMapFuzzer.java",
    "content": "package io.netty.buffer;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Map;\nimport java.util.Set;\n\n\npublic class LongLongHashMapFuzzer {\n    \n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public LongLongHashMapFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n        this.fuzzedDataProvider = fuzzedDataProvider;\n    }\n\n    void test() {\n        Map<Long, Long> expected = new HashMap<Long, Long>();\n        LongLongHashMap actual = new LongLongHashMap(-1);\n        while (fuzzedDataProvider.remainingBytes() >= 9 /* sizeof(long) + sizeof(byte) */) {\n            long value = fuzzedDataProvider.consumeLong();\n            if (expected.containsKey(value)) {\n                if (fuzzedDataProvider.consumeBoolean()) {\n                    actual.remove(value);\n                    expected.remove(value);\n                } else {\n                    long v = expected.get(value);\n                    actual.put(value, -v);\n                    expected.put(value, -v);\n                }\n            } else {\n                actual.put(value, value);\n                expected.put(value, value);\n            }\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n        LongLongHashMapFuzzer fixture = new LongLongHashMapFuzzer(fuzzedDataProvider);\n        fixture.test();\n    }\n}"
  },
  {
    "path": "projects/netty/src/main/java/io/netty/handler/HandlerFuzzerBase.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage io.netty.handler;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport io.netty.buffer.Unpooled;\nimport io.netty.channel.embedded.EmbeddedChannel;\n\n/**\n * Base class for fuzzing the input of an inbound handler. Will report exceptions thrown by the handler.\n */\npublic abstract class HandlerFuzzerBase {\n    protected final EmbeddedChannel channel = new EmbeddedChannel();\n\n    public void test(FuzzedDataProvider provider) {\n        byte[] bytes = provider.consumeRemainingAsBytes();\n        channel.writeInbound(Unpooled.wrappedBuffer(bytes));\n        channel.finishAndReleaseAll();\n        channel.checkException();\n    }\n}\n"
  },
  {
    "path": "projects/netty/src/main/java/io/netty/handler/codec/http/HttpRequestDecoderFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage io.netty.handler.codec.http;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport io.netty.handler.HandlerFuzzerBase;\n\npublic class HttpRequestDecoderFuzzer extends HandlerFuzzerBase {\n    {\n        channel.pipeline().addLast(new HttpRequestDecoder());\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n        new HttpRequestDecoderFuzzer().test(fuzzedDataProvider);\n    }\n}\n"
  },
  {
    "path": "projects/netty/src/main/java/io/netty/handler/codec/http/cookie/ServerCookieDecoderFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage io.netty.handler.codec.http.cookie;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic class ServerCookieDecoderFuzzer {\n\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic ServerCookieDecoderFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\n\t}\n\n\tvoid test() {\n\t\tString s = fuzzedDataProvider.consumeRemainingAsString();\n\t\ttry {\n\t\t\tServerCookieDecoder.STRICT.decodeAll(s);\n\t\t\tServerCookieDecoder.LAX.decodeAll(s);\n\t\t} catch (IllegalArgumentException e) {\n\n\t\t}\n\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tServerCookieDecoderFuzzer fixture = new ServerCookieDecoderFuzzer(fuzzedDataProvider);\n\t\tfixture.test();\n\t}\n}"
  },
  {
    "path": "projects/netty-tcnative/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN apt install autoconf automake libtool build-essential xutils-dev libapr1-dev libapr1 ninja-build golang pkg-config -y\n\nRUN git clone https://github.com/netty/netty-tcnative netty-tcnative\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java *.diff $SRC/\nWORKDIR $SRC/netty-tcnative\n"
  },
  {
    "path": "projects/netty-tcnative/NettyTcnativeFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport io.netty.internal.tcnative.Buffer;\nimport io.netty.internal.tcnative.CertificateVerifier;\nimport io.netty.internal.tcnative.SSL;\nimport io.netty.internal.tcnative.SSLContext;\n\nimport java.io.File;\nimport java.nio.ByteBuffer;\n\npublic class NettyTcnativeFuzzer {\n  private static final int[] protocols = {\n    SSL.SSL_PROTOCOL_SSLV2,\n    SSL.SSL_PROTOCOL_SSLV3,\n    SSL.SSL_PROTOCOL_TLSV1,\n    SSL.SSL_PROTOCOL_TLSV1_1,\n    SSL.SSL_PROTOCOL_TLSV1_2,\n    SSL.SSL_PROTOCOL_ALL\n  };\n\n  private static final int[] modes = {\n    SSL.SSL_MODE_CLIENT,\n    SSL.SSL_MODE_SERVER,\n    SSL.SSL_MODE_COMBINED\n  };\n\n  static {\n    System.load(new File(System.getenv(\"this_dir\") + \"/libnetty_tcnative_linux_x86_64.so\").getAbsolutePath());\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Integer choice = data.consumeInt();\n    Long sslContextId;\n\n    try {\n      sslContextId = NettyTcnativeFuzzer.createSSLContext(data);\n    } catch (Exception e) {\n      return;\n    }\n\n    switch (choice % 20) {\n      case 0:\n        CertificateVerifier.isValid(data.consumeInt());\n        break;\n      case 1:\n        Buffer.address(ByteBuffer.wrap(data.consumeRemainingAsBytes()));\n        break;\n      case 2:\n        Buffer.size(ByteBuffer.wrap(data.consumeRemainingAsBytes()));\n        break;\n      case 3:\n        SSLContext.clearOptions(sslContextId, data.consumeInt());\n        break;\n      case 4:\n        SSLContext.disableOcsp(sslContextId);\n        break;\n      case 5:\n        SSLContext.enableOcsp(sslContextId, data.consumeBoolean());\n        break;\n      case 6:\n        SSLContext.free(sslContextId);\n        break;\n      case 7:\n        SSLContext.getMode(sslContextId);\n        break;\n      case 8:\n        SSLContext.getOptions(sslContextId);\n        break;\n      case 9:\n        SSLContext.getSessionCacheMode(sslContextId);\n        break;\n      case 10:\n        SSLContext.getSessionCacheSize(sslContextId);\n        break;\n      case 11:\n        SSLContext.getSessionCacheTimeout(sslContextId);\n        break;\n      case 12:\n        SSLContext.getSslCtx(sslContextId);\n        break;\n      case 13:\n        SSLContext.sessionAccept(sslContextId);\n        break;\n      case 14:\n        SSLContext.sessionAcceptGood(sslContextId);\n        break;\n      case 15:\n        SSLContext.sessionAcceptRenegotiate(sslContextId);\n        break;\n      case 16:\n        SSLContext.sessionCacheFull(sslContextId);\n        break;\n      case 17:\n        SSLContext.sessionCbHits(sslContextId);\n        break;\n      case 18:\n        SSLContext.sessionConnect(sslContextId);\n        break;\n      case 19:\n        SSLContext.sessionConnectGood(sslContextId);\n        break;\n    }\n  }\n\n  private static Long createSSLContext(FuzzedDataProvider data) throws Exception {\n    Integer protocol_choice = data.pickValue(protocols);\n    Integer mode_choice = data.pickValue(modes);\n    return SSLContext.make(protocol_choice, mode_choice);\n  }\n}\n"
  },
  {
    "path": "projects/netty-tcnative/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit apply $SRC/netty-patch.diff\n\nCFLAGS=\nCXXFLAGS=\n\nexport CXXFLAGS=\"$CXXFLAGS -std=c++14\"\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15 --update-snapshots\"\n$MVN clean package $MAVEN_ARGS\n\ncp openssl-dynamic/target/native-jar-work/META-INF/native/libnetty_tcnative_linux_x86_64.so $OUT\n\nBUILD_CLASSPATH=\nRUNTIME_CLASSPATH=\n\nfor JARFILE in $(find ./ -name *.jar)\ndo\n  cp $JARFILE $OUT/\n  BUILD_CLASSPATH=$BUILD_CLASSPATH$OUT/$(basename $JARFILE):\n  RUNTIME_CLASSPATH=$RUNTIME_CLASSPATH\\$this_dir/$(basename $JARFILE):\ndone\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH:$JAZZER_API_PATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  export this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n    \\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH \\\n    --target_class=$fuzzer_basename \\\n    --jvm_args=\\\"\\$mem_settings:-Djava.library.path=\\$this_dir\\\" \\\n    \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/netty-tcnative/netty-patch.diff",
    "content": "diff --git a/boringssl-static/pom.xml b/boringssl-static/pom.xml\nindex 6471b6f..55581d2 100644\n--- a/boringssl-static/pom.xml\n+++ b/boringssl-static/pom.xml\n@@ -58,7 +58,7 @@\n     <msvcSslIncludeDirs>${boringsslSourceDir}/include</msvcSslIncludeDirs>\n     <msvcSslLibDirs>${boringsslHome}/ssl;${boringsslHome}/crypto</msvcSslLibDirs>\n     <msvcSslLibs>ssl.lib;crypto.lib</msvcSslLibs>\n-    <cflags>-Werror -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3</cflags>\n+    <cflags> -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3</cflags>\n     <cppflags>-DHAVE_OPENSSL -I${boringsslSourceDir}/include</cppflags>\n     <ldflags>-L${boringsslHome}/ssl -L${boringsslHome}/crypto -lssl -lcrypto</ldflags>\n     <skipJapicmp>true</skipJapicmp>\n@@ -202,7 +202,7 @@\n                               <!-- Use -DOPENSSL_C11_ATOMIC so we replace most of the locking code with atomics-->\n                               <property name=\"cmakeCFlags\" value=\"-O3 -fno-omit-frame-pointer -DOPENSSL_C11_ATOMIC\" />\n                               <!-- We need to define __STDC_CONSTANT_MACROS and __STDC_FORMAT_MACROS when building boringssl on centos 6 -->\n-                              <property name=\"cmakeCxxFlags\" value=\"-O3 -fno-omit-frame-pointer -Wno-error=maybe-uninitialized -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS\" />\n+                              <property name=\"cmakeCxxFlags\" value=\"-O3 -fno-omit-frame-pointer -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS\" />\n                             </then>\n                           </elseif>\n                           <else>\n@@ -543,7 +543,7 @@\n                               <!-- Use -DOPENSSL_C11_ATOMIC so we replace most of the locking code with atomics-->\n                               <property name=\"cmakeCFlags\" value=\"-O3 -fno-omit-frame-pointer -DOPENSSL_C11_ATOMIC\" />\n                               <!-- We need to define __STDC_CONSTANT_MACROS and __STDC_FORMAT_MACROS when building boringssl on centos 6 -->\n-                              <property name=\"cmakeCxxFlags\" value=\"-O3 -fno-omit-frame-pointer -Wno-error=maybe-uninitialized -Wno-error=shadow -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS\" />\n+                              <property name=\"cmakeCxxFlags\" value=\"-O3 -fno-omit-frame-pointer -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS\" />\n                             </then>\n                           </elseif>\n                           <else>\n@@ -673,7 +673,7 @@\n                     <configureArg>--with-ssl=no</configureArg>\n                     <configureArg>--with-static-libs</configureArg>\n                     <configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>\n-                    <configureArg>CFLAGS=-O3 -Werror -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value</configureArg>\n+                    <configureArg>CFLAGS=-O3  -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value</configureArg>\n                     <configureArg>CPPFLAGS=-DHAVE_OPENSSL -I${boringsslSourceDir}/include</configureArg>\n                     <configureArg>LDFLAGS=-L${boringsslHome}/ssl -L${boringsslHome}/crypto -lssl -lcrypto</configureArg>\n                     <configureArg>--host=aarch64-linux-gnu</configureArg>\n@@ -874,7 +874,7 @@\n         <!-- Use -DOPENSSL_C11_ATOMIC so we replace most of the locking code with atomics-->\n         <cmakeCFlags>-O3 -fno-omit-frame-pointer -target ${target} -DOPENSSL_C11_ATOMIC</cmakeCFlags>\n         <cmakeCxxFlags>-O3 -fno-omit-frame-pointer -target ${target} -Wno-error=range-loop-analysis</cmakeCxxFlags>\n-        <cflags>-target ${target} -Werror -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3</cflags>\n+        <cflags>-target ${target}  -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3</cflags>\n         <cppflags>-target ${target} -DHAVE_OPENSSL -I${boringsslSourceDir}/include</cppflags>\n         <ldflags>-arch arm64 -L${boringsslHome}/ssl -L${boringsslHome}/crypto -lssl -lcrypto</ldflags>\n         <!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->\n@@ -1120,7 +1120,7 @@\n         <!-- Use -DOPENSSL_C11_ATOMIC so we replace most of the locking code with atomics-->\n         <cmakeCFlags>-O3 -fno-omit-frame-pointer -target ${target} -DOPENSSL_C11_ATOMIC</cmakeCFlags>\n         <cmakeCxxFlags>-O3 -fno-omit-frame-pointer -target ${target} -Wno-error=range-loop-analysis</cmakeCxxFlags>\n-        <cflags>-target ${target} -Werror -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3</cflags>\n+        <cflags>-target ${target}  -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3</cflags>\n         <cppflags>-target ${target} -DHAVE_OPENSSL -I${boringsslSourceDir}/include</cppflags>\n         <ldflags>-arch x86_64 -L${boringsslHome}/ssl -L${boringsslHome}/crypto -lssl -lcrypto</ldflags>\n         <!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->\n@@ -1354,7 +1354,7 @@\n       <id>boringssl-static-asan</id>\n       <properties>\n         <!-- We do not use an -O flag to ensure we have all functions in the stack when a leak is reported later on -->\n-        <cflags>-Werror -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -fsanitize=address</cflags>\n+        <cflags> -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -fsanitize=address</cflags>\n         <cppflags>-DHAVE_OPENSSL -I${boringsslSourceDir}/include -fsanitize=address</cppflags>\n         <ldflags>-L${boringsslHome}/ssl -L${boringsslHome}/crypto -lssl -lcrypto -fsanitize=address</ldflags>\n       </properties>\ndiff --git a/openssl-dynamic/src/main/native-package/m4/tcnative.m4 b/openssl-dynamic/src/main/native-package/m4/tcnative.m4\nindex 136cbb3..97bcda7 100644\n--- a/openssl-dynamic/src/main/native-package/m4/tcnative.m4\n+++ b/openssl-dynamic/src/main/native-package/m4/tcnative.m4\n@@ -276,7 +276,7 @@ AC_DEFUN([TCN_CHECK_STATIC],[\n           ;;\n       *linux*)\n           dnl On linux we also statically link libstdc++ etc to make it as backward / forward compatible as possible.\n-          LD_FLAGS_STATIC=\"-static-libstdc++ -static-libgcc -l:libgcc.a -l:libstdc++.a -Wl,--exclude-libs,ALL\"\n+          LD_FLAGS_STATIC=\"\"\n \n           dnl Cleanup libtool postdeps so it will not link against libtdc++ dynamically.\n           AC_MSG_NOTICE([Cleanup libtool C++ postdeps: $postdeps_CXX])\n"
  },
  {
    "path": "projects/netty-tcnative/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://netty.io/wiki/forked-tomcat-native.html\"\nmain_repo: \"https://github.com/netty/netty-tcnative.git\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"david@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/networkmanager/project.yaml",
    "content": "homepage: \"https://networkmanager.dev/\"\nmain_repo: \"https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git\"\nlanguage: c\nprimary_contact: \"jvaclav@redhat.com\"\n"
  },
  {
    "path": "projects/networkx/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\n# Install necessary packages\nRUN apt-get update && \\\n    apt-get install -y wget build-essential checkinstall && \\\n    apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev \\\n                       libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev\n\n# Download and install Python 3.11\nRUN cd /usr/src && \\\n    wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz && \\\n    tar xzf Python-3.11.0.tgz && \\\n    cd Python-3.11.0 && \\\n    ./configure --enable-optimizations && \\\n    make install && \\\n    ln --force -s /usr/local/bin/python3.11 /usr/local/bin/python3\n\n# Install pip and Python dependencies\nRUN python3 -m ensurepip && \\\n    python3 -m pip install --upgrade pip && \\\n    python3 -m pip install cython \"atheris>=2.1.1\" \"pyinstaller==6.15.0\" \"coverage==6.3.2\"\n\nRUN git clone https://github.com/networkx/networkx networkx\nRUN git clone --depth=1 https://github.com/prefuse/Prefuse prefuse\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/networkx\n"
  },
  {
    "path": "projects/networkx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\nzip -jr $OUT/fuzz_graphml_seed_corpus.zip $SRC/prefuse/data/*.xml\n"
  },
  {
    "path": "projects/networkx/fuzz_graph6.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport networkx\n\n\ndef TestOneInput(data):\n  if len(data) < 5:\n    return\n  try:\n    networkx.from_graph6_bytes(data)\n  except networkx.NetworkXError:\n    pass\n  except ValueError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/networkx/fuzz_graphml.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport networkx\nimport io\nimport xml\n\ndef TestOneInput(data):\n  try:\n    networkx.read_graphml(io.BytesIO(data))\n  except xml.etree.ElementTree.ParseError:\n    pass\n  except networkx.NetworkXError:\n    pass\n  except LookupError:\n    pass\n  except ValueError:\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/networkx/fuzz_sparse6.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport networkx\n\n\ndef TestOneInput(data):\n  if len(data) < 5:\n    return\n\n  try:\n    networkx.from_sparse6_bytes(data)\n  except networkx.NetworkXError:\n    pass\n  except ValueError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/networkx/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/networkx/networkx\nlanguage: python\nmain_repo: https://github.com/networkx/networkx\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/nfstream/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update\nRUN apt-get install -y python3-dev autoconf automake libtool pkg-config flex bison gettext libjson-c-dev libpcap-dev\nRUN apt-get install -y libusb-1.0-0-dev libdbus-glib-1-dev libbluetooth-dev libnl-genl-3-dev libffi-dev python-dev\nRUN python3 -m pip install --upgrade pip\nRUN git clone --recurse-submodules https://github.com/nfstream/nfstream.git\nWORKDIR nfstream\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/nfstream/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\npython3 -m pip install -U -r dev_requirements.txt\npython3 -m pip install -U  .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer --hidden-import=_cffi_backend\ndone\n\nzip -j $OUT/pcap_fuzzer_seed_corpus.zip tests/pcaps/*\n"
  },
  {
    "path": "projects/nfstream/pcap_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    import io\n    from nfstream import NFStreamer\n\n\ndef TestOneInput(input_bytes):\n    with open('fuzz_one_input.pcap', 'wb') as w:\n        # Save it as binary file with .pcap extension\n        w.write(io.BytesIO(input_bytes).read())\n    try:\n        for _ in NFStreamer(source=\"fuzz_one_input.pcap\"):\n            pass\n    except (ValueError, TypeError):\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/nfstream/project.yaml",
    "content": "homepage: \"https://www.nfstream.org/\"\nlanguage: python\nprimary_contact: \"aouinizied@gmail.com\"\nauto_ccs:\n  - \"aouinizied@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/nfstream/nfstream'\n"
  },
  {
    "path": "projects/nghttp2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n  make \\\n  autoconf \\\n  automake \\\n  libtool \\\n  pkg-config\n\nRUN git clone --recursive --shallow-submodules --depth 1 https://github.com/nghttp2/nghttp2.git\nWORKDIR nghttp2\nCOPY run_tests.sh build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/nghttp2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\ncmake -DENABLE_LIB_ONLY=ON -DBUILD_STATIC_LIBS=ON ../\nmake\nmake check\n\nexport CXXFLAGS=\"${CXXFLAGS} -std=c++17\"\n$CXX $CXXFLAGS -I../lib/includes -Ilib/includes -I../lib/ -I../tests/ \\\n    ../fuzz/fuzz_frames.cc -o $OUT/nghttp2_fuzzer_frames \\\n    tests/CMakeFiles/main.dir/nghttp2_test_helper.c.o \\\n    $LIB_FUZZING_ENGINE lib/libnghttp2.a\n\n$CXX $CXXFLAGS -I../lib/includes -Ilib/includes -I../lib/ \\\n    ../fuzz/fuzz_target.cc -o $OUT/nghttp2_fuzzer \\\n    $LIB_FUZZING_ENGINE lib/libnghttp2.a\n\n$CXX $CXXFLAGS -I../lib/includes -Ilib/includes -I../lib/ \\\n    ../fuzz/fuzz_target_fdp.cc -o $OUT/nghttp2_fuzzer_fdp \\\n    $LIB_FUZZING_ENGINE lib/libnghttp2.a\n\ncp $SRC/*.options $OUT\n\nzip -j $OUT/nghttp2_fuzzer_seed_corpus.zip ../fuzz/corpus/*/*\n"
  },
  {
    "path": "projects/nghttp2/nghttp2_fuzzer.options",
    "content": "[libfuzzer]\nmax_len = 1024\n"
  },
  {
    "path": "projects/nghttp2/project.yaml",
    "content": "homepage: \"https://nghttp2.org/\"\nlanguage: c++\nprimary_contact: \"tatsuhiro.t@gmail.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/nghttp2/nghttp2.git'\n"
  },
  {
    "path": "projects/nghttp2/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd $SRC/nghttp2/build\nmake check\n"
  },
  {
    "path": "projects/nginx/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y libpcre3-dev zlib1g-dev ninja-build cmake liblzma-dev libz-dev binutils libtool\nRUN git clone --depth 1 https://github.com/nginx/nginx.git\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN git clone --depth 1 https://github.com/google/fuzzer-test-suite\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja)\n\nWORKDIR nginx\nCOPY fuzz $SRC/fuzz\nCOPY build.sh add_fuzzers.diff make_fuzzers  $SRC/\n"
  },
  {
    "path": "projects/nginx/add_fuzzers.diff",
    "content": "diff --git a/auto/configure b/auto/configure\nindex 7e6e33a7..bb368cfb 100755\n--- a/auto/configure\n+++ b/auto/configure\n@@ -100,6 +100,7 @@ have=NGX_HTTP_SCGI_TEMP_PATH value=\"\\\"$NGX_HTTP_SCGI_TEMP_PATH\\\"\"\n . auto/define\n \n . auto/make\n+. auto/make_fuzzers\n . auto/lib/make\n . auto/install\n \n"
  },
  {
    "path": "projects/nginx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ngit apply $SRC/add_fuzzers.diff || patch -p1 < $SRC/add_fuzzers.diff\n\ncp -r $SRC/fuzz src/\ncp $SRC/make_fuzzers auto/make_fuzzers\n\ncd src/fuzz\nrm -rf genfiles && mkdir genfiles && $SRC/LPM/external.protobuf/bin/protoc http_request_proto.proto --cpp_out=genfiles\ncd ../..\n\nauto/configure \\\n    --with-ld-opt=\"-Wl,--wrap=listen -Wl,--wrap=setsockopt -Wl,--wrap=bind -Wl,--wrap=shutdown -Wl,--wrap=connect -Wl,--wrap=getpwnam -Wl,--wrap=getgrnam -Wl,--wrap=chmod -Wl,--wrap=chown\" \\\n    --with-cc-opt='-DNGX_DEBUG_PALLOC=1' \\\n    --with-http_v2_module \nmake -f objs/Makefile fuzzers\n\ncp objs/*_fuzzer $OUT/\ncp $SRC/fuzz/*.dict $OUT/\n"
  },
  {
    "path": "projects/nginx/fuzz/http_request_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nextern \"C\" {\n#include <ngx_config.h>\n#include <ngx_core.h>\n#include <ngx_event.h>\n#include <ngx_http.h>\n}\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n#include <time.h>\n#include <unistd.h>\n\n#include \"http_request_proto.pb.h\"\n#include \"libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h\"\n\nstatic char configuration[] =\n\"error_log stderr emerg;\\n\"\n\"worker_rlimit_nofile 8192;\\n\"\n\"events {\\n\"\n\"    use epoll;\\n\"\n\"    worker_connections 2;\\n\"\n\"    multi_accept off;\\n\"\n\"    accept_mutex off;\\n\"\n\"}\\n\"\n\"http {\\n\"\n\"    server_tokens off;\\n\"\n\"    default_type application/octet-stream;\\n\"\n\"    map $http_upgrade $connection_upgrade {\\n\"\n\"      default upgrade;\\n\"\n\"      '' close;\\n\"\n\"    }\\n\"\n\"    error_log stderr emerg;\\n\"\n\"    access_log off;\\n\"\n\"    map $subdomain $nss {\\n\"\n\"      default local_upstream;\\n\"\n\"    }\\n\"\n\"    upstream local_upstream {\\n\"\n\"      server 127.0.0.1:1010 max_fails=0;\\n\"\n\"      server 127.0.0.1:1011 max_fails=0;\\n\"\n\"      server 127.0.0.1:1012 max_fails=0;\\n\"\n\"      server 127.0.0.1:1013 max_fails=0;\\n\"\n\"      server 127.0.0.1:1014 max_fails=0;\\n\"\n\"      server 127.0.0.1:1015 max_fails=0;\\n\"\n\"      server 127.0.0.1:1016 max_fails=0;\\n\"\n\"      server 127.0.0.1:1017 max_fails=0;\\n\"\n\"      server 127.0.0.1:1018 max_fails=0;\\n\"\n\"      server 127.0.0.1:1019 max_fails=0;\\n\"\n\"    }\\n\"\n\"    client_max_body_size 256M;\\n\"\n\"    client_body_temp_path /tmp/;\\n\"\n\"    proxy_temp_path /tmp/;\\n\"\n\"    proxy_buffer_size 24K;\\n\"\n\"    proxy_max_temp_file_size 0;\\n\"\n\"    proxy_buffers 8 4K;\\n\"\n\"    proxy_busy_buffers_size 28K;\\n\"\n\"    proxy_buffering off;\\n\"\n\"    server {\\n\"\n\"      listen unix:nginx.sock;\\n\"\n\"      server_name ~^(?<subdomain>.+)\\\\.url.com$;\\n\"\n\"      proxy_next_upstream off;\\n\"\n\"      proxy_read_timeout 5m;\\n\"\n\"      proxy_http_version 1.1;\\n\"\n\"      proxy_set_header Host $http_host;\\n\"\n\"      proxy_set_header X-Real-IP $remote_addr;\\n\"\n\"      proxy_set_header X-Real-Port $remote_port;\\n\"\n\"      location / {\\n\"\n\"        proxy_pass http://$nss;\\n\"\n\"        proxy_set_header Host $http_host;\\n\"\n\"        proxy_set_header X-Real-IP $remote_addr;\\n\"\n\"        proxy_set_header X-Real-Port $remote_port;\\n\"\n\"        proxy_set_header Connection '';\\n\"\n\"        chunked_transfer_encoding off;\\n\"\n\"        proxy_buffering off;\\n\"\n\"        proxy_cache off;\\n\"\n\"      }\\n\"\n\"    }\\n\"\n\"}\\n\"\n\"\\n\";\n\n\nstatic ngx_cycle_t *cycle;\nstatic ngx_log_t ngx_log;\nstatic ngx_open_file_t ngx_log_file;\nstatic char *my_argv[2];\nstatic char arg1[] = {0, 0xA, 0};\n\nextern char **environ;\n\nstatic const char *config_file = \"/tmp/http_config.conf\";\n\nstruct fuzzing_data {\n  const uint8_t *data;\n  size_t data_len;\n};\n\nstatic struct fuzzing_data request;\nstatic struct fuzzing_data reply;\n\nstatic ngx_http_upstream_t *upstream;\nstatic ngx_http_request_t *req_reply;\nstatic ngx_http_cleanup_t cln_new = {};\nstatic int cln_added;\n\n// Called when finalizing the request to upstream\n// Do not need to clean the request pool\nstatic void cleanup_reply(void *data) { req_reply = NULL; }\n\n// Called by the http parser to read the buffer\nstatic ssize_t request_recv_handler(ngx_connection_t *c, u_char *buf,\n                                    size_t size) {\n  if (request.data_len < size)\n    size = request.data_len;\n  memcpy(buf, request.data, size);\n  request.data += size;\n  request.data_len -= size;\n  return size;\n}\n\n// Feed fuzzing input for the reply from upstream\nstatic ssize_t reply_recv_handler(ngx_connection_t *c, u_char *buf,\n                                  size_t size) {\n  req_reply = (ngx_http_request_t *)(c->data);\n  if (!cln_added) { // add cleanup so that we know whether everything is cleanup\n                    // correctly\n    cln_added = 1;\n    cln_new.handler = cleanup_reply;\n    cln_new.next = req_reply->cleanup;\n    cln_new.data = NULL;\n    req_reply->cleanup = &cln_new;\n  }\n  upstream = req_reply->upstream;\n\n  if (reply.data_len < size)\n    size = reply.data_len;\n  memcpy(buf, reply.data, size);\n  reply.data += size;\n  reply.data_len -= size;\n  if (size == 0)\n    c->read->ready = 0;\n  return size;\n}\n\nstatic ngx_int_t add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags) {\n  return NGX_OK;\n}\n\nstatic ngx_int_t init_event(ngx_cycle_t *cycle, ngx_msec_t timer) {\n  return NGX_OK;\n}\n\n// Used when sending data, do nothing\nstatic ngx_chain_t *send_chain(ngx_connection_t *c, ngx_chain_t *in,\n                               off_t limit) {\n  c->read->ready = 1;\n  c->recv = reply_recv_handler;\n  return in->next;\n}\n\n// Create a base state for Nginx without starting the server\nextern \"C\" int InitializeNginx(void) {\n  ngx_log_t *log;\n  ngx_cycle_t init_cycle;\n\n  if (access(\"nginx.sock\", F_OK) != -1) {\n    remove(\"nginx.sock\");\n  }\n\n  ngx_debug_init();\n  ngx_strerror_init();\n  ngx_time_init();\n  ngx_regex_init();\n\n  // Just output logs to stderr\n  ngx_log.file = &ngx_log_file;\n  ngx_log.log_level = NGX_LOG_EMERG;\n  ngx_log_file.fd = ngx_stderr;\n  log = &ngx_log;\n\n  ngx_memzero(&init_cycle, sizeof(ngx_cycle_t));\n  init_cycle.log = log;\n  ngx_cycle = &init_cycle;\n\n  init_cycle.pool = ngx_create_pool(1024, log);\n\n  // Set custom argv/argc\n  my_argv[0] = arg1;\n  my_argv[1] = NULL;\n  ngx_argv = ngx_os_argv = my_argv;\n  ngx_argc = 0;\n\n  // Weird trick to free a leaking buffer always caught by ASAN\n  // We basically let ngx overwrite the environment variable, free the leak and\n  // restore the environment as before.\n  char *env_before = environ[0];\n  environ[0] = my_argv[0] + 1;\n  ngx_os_init(log);\n  free(environ[0]);\n  environ[0] = env_before;\n\n  ngx_crc32_table_init();\n  ngx_preinit_modules();\n\n  FILE *fptr = fopen(config_file, \"w\");\n  fprintf(fptr, \"%s\", configuration);\n  fclose(fptr);\n  init_cycle.conf_file.len = strlen(config_file);\n  init_cycle.conf_file.data = (unsigned char *) config_file;\n\n  cycle = ngx_init_cycle(&init_cycle);\n\n  ngx_os_status(cycle->log);\n  ngx_cycle = cycle;\n\n  ngx_event_actions.add = add_event;\n  ngx_event_actions.init = init_event;\n  ngx_io.send_chain = send_chain;\n  ngx_event_flags = 1;\n  ngx_queue_init(&ngx_posted_accept_events);\n  ngx_queue_init(&ngx_posted_next_events);\n  ngx_queue_init(&ngx_posted_events);\n  ngx_event_timer_init(cycle->log);\n  return 0;\n}\n\nextern \"C\" long int invalid_call(ngx_connection_s *a, ngx_chain_s *b,\n                                 long int c) {\n  return 0;\n}\n\nDEFINE_PROTO_FUZZER(const HttpProto &input) {\n  static int init = InitializeNginx();\n  assert(init == 0);\n\n  // have two free connections, one for client, one for upstream\n  ngx_event_t read_event1 = {};\n  ngx_event_t write_event1 = {};\n  ngx_connection_t local1 = {};\n  ngx_event_t read_event2 = {};\n  ngx_event_t write_event2 = {};\n  ngx_connection_t local2 = {};\n  ngx_connection_t *c;\n  ngx_listening_t *ls;\n\n  req_reply = NULL;\n  upstream = NULL;\n  cln_added = 0;\n\n  const char *req_string = input.request().c_str();\n  size_t req_len = input.request().size();\n  const char *rep_string = input.reply().c_str();\n  size_t rep_len = input.reply().size();\n  request.data = (const uint8_t *)req_string;\n  request.data_len = req_len;\n  reply.data = (const uint8_t *)rep_string;\n  reply.data_len = rep_len;\n\n  // Use listening entry created from configuration\n  ls = (ngx_listening_t *)ngx_cycle->listening.elts;\n\n  // Fake event ready for dispatch on read\n  local1.read = &read_event1;\n  local1.write = &write_event1;\n  local2.read = &read_event2;\n  local2.write = &write_event2;\n  local2.send_chain = send_chain;\n\n  // Create fake free connection to feed the http handler\n  ngx_cycle->free_connections = &local1;\n  local1.data = &local2;\n  ngx_cycle->free_connection_n = 2;\n\n  // Initialize connection\n  c = ngx_get_connection(\n      255, &ngx_log); // 255 - (hopefully unused) socket descriptor\n\n  c->shared = 1;\n  c->destroyed = 0;\n  c->type = SOCK_STREAM;\n  c->pool = ngx_create_pool(256, ngx_cycle->log);\n  c->sockaddr = ls->sockaddr;\n  c->listening = ls;\n  c->recv = request_recv_handler; // Where the input will be read\n  c->send_chain = send_chain;\n  c->send = (ngx_send_pt)invalid_call;\n  c->recv_chain = (ngx_recv_chain_pt)invalid_call;\n  c->log = &ngx_log;\n  c->pool->log = &ngx_log;\n  c->read->log = &ngx_log;\n  c->write->log = &ngx_log;\n  c->socklen = ls->socklen;\n  c->local_sockaddr = ls->sockaddr;\n  c->local_socklen = ls->socklen;\n  c->data = NULL;\n\n  read_event1.ready = 1;\n  write_event1.ready = write_event1.delayed = 1;\n\n  // Will redirect to http parser\n  ngx_http_init_connection(c);\n\n  // We do not provide working timers or events, and thus we have to manually\n  // clean up the requests we created. We do this here.\n  // Cross-referencing: https://trac.nginx.org/nginx/ticket/2080#no1).I\n  // This is a fix that should be bettered in the future, by creating proper\n  // timers and events.\n  if (c->destroyed != 1) {\n    if (c->read->data != NULL) {\n      ngx_connection_t *c2 = (ngx_connection_t*)c->read->data;\n        ngx_http_request_t *req_tmp = (ngx_http_request_t*)c2->data;\n        req_tmp->cleanup = NULL;\n        ngx_http_finalize_request(req_tmp, NGX_DONE);\n    }\n    ngx_close_connection(c);\n  }\n}\n"
  },
  {
    "path": "projects/nginx/fuzz/http_request_fuzzer.dict",
    "content": "# Sources: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields\n\n# misc\n\"HTTP/1.1\"\n\n# verbs\n\"CONNECT\"\n\"DELETE\"\n\"GET\"\n\"HEAD\"\n\"OPTIONS\"\n\"PATCH\"\n\"POST\"\n\"PUT\"\n\"TRACE\"\n\n\n# Webdav/caldav verbs\n\"ACL\"\n\"BASELINE-CONTROL\"\n\"BIND\"\n\"CHECKIN\"\n\"CHECKOUT\"\n\"COPY\"\n\"LABEL\"\n\"LINK\"\n\"LOCK\"\n\"MERGE\"\n\"MKACTIVITY\"\n\"MKCALENDAR\"\n\"MKCOL\"\n\"MKREDIRECTREF\"\n\"MKWORKSPACE\"\n\"MOVE\"\n\"ORDERPATCH\"\n\"PRI\"\n\"PROPFIND\"\n\"PROPPATCH\"\n\"REBIND\"\n\"REPORT\"\n\"SEARCH\"\n\"UNBIND\"\n\"UNCHECKOUT\"\n\"UNLINK\"\n\"UNLOCK\"\n\"UPDATE\"\n\"UPDATEREDIRECTREF\"\n\"VERSION-CONTROL\"\n\n\n# Fields\n\"A-IM\"\n\"Accept\"\n\"Accept-Charset\"\n\"Accept-Datetime\"\n\"Accept-Encoding\"\n\"Accept-Language\"\n\"Accept-Patch\"\n\"Accept-Ranges\"\n\"Access-Control-Allow-Credentials\"\n\"Access-Control-Allow-Headers\"\n\"Access-Control-Allow-Methods\"\n\"Access-Control-Allow-Origin\"\n\"Access-Control-Expose-Headers\"\n\"Access-Control-Max-Age\"\n\"Access-Control-Request-Headers\"\n\"Access-Control-Request-Method\"\n\"Age\"\n\"Allow\"\n\"Alt-Svc\"\n\"Authorization\"\n\"Cache-Control\"\n\"Connection\"\n\"Connection:\"\n\"Content-Disposition\"\n\"Content-Encoding\"\n\"Content-Language\"\n\"Content-Length\"\n\"Content-Location\"\n\"Content-MD5\"\n\"Content-Range\"\n\"Content-Security-Policy\"\n\"Content-Type\"\n\"Cookie\"\n\"DNT\"\n\"Date\"\n\"Delta-Base\"\n\"ETag\"\n\"Expect\"\n\"Expires\"\n\"Forwarded\"\n\"From\"\n\"Front-End-Https\"\n\"HTTP2-Settings\"\n\"Host\"\n\"IM\"\n\"If-Match\"\n\"If-Modified-Since\"\n\"If-None-Match\"\n\"If-Range\"\n\"If-Unmodified-Since\"\n\"Last-Modified\"\n\"Link\"\n\"Location\"\n\"Max-Forwards\"\n\"Origin\"\n\"P3P\"\n\"Pragma\"\n\"Proxy-Authenticate\"\n\"Proxy-Authorization\"\n\"Proxy-Connection\"\n\"Public-Key-Pins\"\n\"Range\"\n\"Referer\"\n\"Refresh\"\n\"Retry-After\"\n\"Save-Data\"\n\"Server\"\n\"Set-Cookie\"\n\"Status\"\n\"Strict-Transport-Security\"\n\"TE\"\n\"Timing-Allow-Origin\"\n\"Tk\"\n\"Trailer\"\n\"Transfer-Encoding\"\n\"Upgrade\"\n\"Upgrade-Insecure-Requests\"\n\"User-Agent\"\n\"Vary\"\n\"Via\"\n\"WWW-Authenticate\"\n\"Warning\"\n\"X-ATT-DeviceId\"\n\"X-Content-Duration\"\n\"X-Content-Security-Policy\"\n\"X-Content-Type-Options\"\n\"X-Correlation-ID\"\n\"X-Csrf-Token\"\n\"X-Forwarded-For\"\n\"X-Forwarded-Host\"\n\"X-Forwarded-Proto\"\n\"X-Frame-Options\"\n\"X-Http-Method-Override\"\n\"X-Powered-By\"\n\"X-Request-ID\"\n\"X-Requested-With\"\n\"X-UA-Compatible\"\n\"X-UIDH\"\n\"X-Wap-Profile\"\n\"X-WebKit-CSP\"\n\"X-XSS-Protection\"\n"
  },
  {
    "path": "projects/nginx/fuzz/http_request_proto.proto",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nsyntax = \"proto2\";\n// Proto description of the http request fuzzer input format\n\nmessage HttpProto{\n\trequired string request = 1;\n\trequired string reply = 2;\n}\n"
  },
  {
    "path": "projects/nginx/fuzz/wrappers.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <grp.h>\n#include <pwd.h>\n\nint __wrap_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {\n  return 0;\n}\n\nint __wrap_bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {\n  return 0;\n}\n\nint __wrap_shutdown(int socket, int how) { return 0; }\n\nssize_t __wrap_listen(int fd, void *buf, size_t bytes) { return 0; }\n\nint __wrap_setsockopt(int fd, int level, int optname, const void *optval,\n                      socklen_t optlen) {\n  return 0;\n}\n\nint __wrap_chmod(const char *pathname, mode_t mode){\n  return 0;\n}\n\nint __wrap_chown(const char *pathname, uid_t owner, gid_t group){\n  return 0;\n}\n\nstruct passwd pwd;\nstruct group grp;\n\nstruct passwd *__wrap_getpwnam(const char *name){\n  pwd.pw_uid = 1;\n  return &pwd;\n}\n\nstruct group *__wrap_getgrnam(const char *name){\n  grp.gr_gid = 1;\n  return &grp;\n}\n"
  },
  {
    "path": "projects/nginx/make_fuzzers",
    "content": "sed -i 's/main(/fuzz_without_main(/g' src/core/nginx.c\n\nmkdir -p $NGX_OBJS/src/fuzz\n\nngx_all_objs_fuzz=`echo src/fuzz/wrappers.c $ngx_all_srcs \\\n    | sed -e \"s#\\([^ ]*\\.\\)cc#$NGX_OBJS\\/\\1$ngx_objext#g\" \\\n          -e \"s#\\([^ ]*\\.\\)c#$NGX_OBJS\\/\\1$ngx_objext#g\"`\n\nngx_deps_fuzz=`echo $ngx_all_objs_fuzz $ngx_modules_obj $ngx_res $LINK_DEPS \\\n    | sed -e \"s/  *\\([^ ][^ ]*\\)/$ngx_regex_cont\\1/g\" \\\n          -e \"s/\\//$ngx_regex_dirsep/g\"`\n\nngx_objs=`echo objs/src/fuzz/wrappers.o $ngx_all_objs $ngx_modules_obj \\\n    | sed -e \"s/  *\\([^ ][^ ]*\\)/$ngx_long_regex_cont\\1/g\" \\\n          -e \"s/\\//$ngx_regex_dirsep/g\"`\n\ncat << END                                                    >> $NGX_MAKEFILE\n\nfuzzers: objs/http_request_fuzzer\n\nobjs/src/fuzz/wrappers.o:\n\t\\$(CC) $ngx_compile_opt \\$(CFLAGS) -o objs/src/fuzz/wrappers.o src/fuzz/wrappers.c\n\nobjs/http_request_fuzzer: $ngx_deps_fuzz\n\t \\$(CXX) \\$(CXXFLAGS) -DNDEBUG src/fuzz/http_request_fuzzer.cc \\\n\t src/fuzz/genfiles/http_request_proto.pb.cc \\\n\t -o objs/http_request_fuzzer \\\n\t \\$(CORE_INCS) \\$(HTTP_INCS) \\\n\t -I src/fuzz/genfiles/ -I \\$(SRC)/ \\\n\t -I \\$(SRC)/libprotobuf-mutator/ \\\n\t -I \\$(SRC)/LPM/external.protobuf/include \\\n\t \\$(SRC)/LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n  \t \\$(SRC)/LPM/src/libprotobuf-mutator.a \\\n  \t -Wl,--start-group \\$(SRC)/LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n\t $ngx_binexit$ngx_long_cont$ngx_objs \\\n   \t \\$(LIB_FUZZING_ENGINE) $ngx_libs$ngx_link$ngx_main_link -lcrypt\n$ngx_long_end\t\t\t\t\t    \n\nEND\n"
  },
  {
    "path": "projects/nginx/project.yaml",
    "content": "homepage: \"http://nginx.org\"\nmain_repo: \"https://github.com/nginx/nginx\"\nlanguage: c\nprimary_contact: \"xim.andrew@gmail.com\"\nauto_ccs:\n  - pluknet@gmail.com\n  - david@adalogics.com\nsanitizers:\n  - address\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/ngolo-fuzzing/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev binutils cmake \\\n   ninja-build liblzma-dev libz-dev pkg-config autoconf libtool\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN mkdir LPM; \\\n  cd LPM; \\\n  cmake $SRC/libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release; \\\n  ninja;\n\nRUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n\nRUN git clone --depth 1 https://go.googlesource.com/go goroot\nRUN git clone --depth 1 https://github.com/catenacyber/ngolo-fuzzing.git\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/ngolo-fuzzing\n"
  },
  {
    "path": "projects/ngolo-fuzzing/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# compile latest go from git\n(\ncd $SRC/goroot/src\n./make.bash\n)\nrm -Rf /root/.go/\nexport PATH=$PATH:$SRC/goroot/bin/\ngo install golang.org/x/tools/cmd/goimports@latest\n\ncompile_package () {\n    pkg=$1\n    pkg_flat=`echo $pkg | sed 's/\\//_/g' | sed 's/\\./x/'`\n    args=`cat $SRC/ngolo-fuzzing/std/args.txt | grep \"^$pkg_flat \" | cut -d\" \" -f2-`\n    $SRC/ngolo-fuzzing/ngolo-fuzzing $args $pkg fuzz_ng_$pkg_flat\n    # applies special python patcher if any\n    ls $SRC/ngolo-fuzzing/std/$pkg_flat.py && (\n        python3 $SRC/ngolo-fuzzing/std/$pkg_flat.py fuzz_ng_$pkg_flat/fuzz_ng.go > fuzz_ng_$pkg_flat/fuzz_ngp.go\n        mv fuzz_ng_$pkg_flat/fuzz_ngp.go fuzz_ng_$pkg_flat/fuzz_ng.go\n    )\n    (\n        cd fuzz_ng_$pkg_flat\n        $SRC/LPM/external.protobuf/bin/protoc --go_out=./ ngolofuzz.proto\n        mkdir cpp\n        $SRC/LPM/external.protobuf/bin/protoc --cpp_out=./cpp ngolofuzz.proto\n        $CXX -DNDEBUG -stdlib=libc++ -c -I . -I $SRC/LPM/external.protobuf/include cpp/ngolofuzz.pb.cc\n        $CXX $CXXFLAGS -c -Icpp -I $SRC/libprotobuf-mutator/ -I $SRC/LPM/external.protobuf/include $SRC/ngolo-fuzzing/lpm/ngolofuzz.cc\n    )\n    if [ \"$SANITIZER\" = \"coverage\" ]\n    then\n        (\n        if [[ `echo $pkg | grep runtime | wc -l` == '1' ]]; then\n            continue\n        fi\n        cd fuzz_ng_$pkg_flat\n        GO_COV_ADD_PKG=\"$pkg\" compile_go_fuzzer . FuzzNG_unsure fuzz_ngo_$pkg_flat\n        )\n    else\n        (\n        cd fuzz_ng_$pkg_flat\n        compile_go_fuzzer . FuzzNG_unsure fuzz_ngo_$pkg_flat\n        rm fuzz_ngo_$pkg_flat.a\n        )\n        $SRC/ngolo-fuzzing/go114-fuzz-build/go114-fuzz-build -func FuzzNG_valid -o fuzz_ng_$pkg_flat.a ./fuzz_ng_$pkg_flat\n\n        $CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_ng_$pkg_flat/ngolofuzz.pb.o fuzz_ng_$pkg_flat//ngolofuzz.o \\\n            fuzz_ng_$pkg_flat.a \\\n            $SRC/LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n            $SRC/LPM/src/libprotobuf-mutator.a \\\n            -Wl,--start-group $SRC/LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n            -o $OUT/fuzz_ng_$pkg_flat\n        rm fuzz_ng_$pkg_flat.a\n    fi\n    (\n        # corpus\n        mkdir $SRC/goroot/src/fuzz_ng_$pkg_flat\n        cp $SRC/ngolo-fuzzing/corpus/ngolo_helper.go $SRC/goroot/src/fuzz_ng_$pkg_flat/\n        goimports -w fuzz_ng_$pkg_flat/copy/*.go\n        cp fuzz_ng_$pkg_flat/copy/*.go $SRC/goroot/src/fuzz_ng_$pkg_flat/\n        cp fuzz_ng_$pkg_flat/*.go $SRC/goroot/src/fuzz_ng_$pkg_flat/\n        cp $SRC/goroot/src/$pkg/*_test.go $SRC/goroot/src/fuzz_ng_$pkg_flat/\n        cp -r $SRC/goroot/src/$pkg/testdata $SRC/goroot/src/fuzz_ng_$pkg_flat/ || true\n        sed -i -e 's/^package .*/package 'fuzz_ng_$pkg_flat'/' $SRC/goroot/src/fuzz_ng_$pkg_flat/*.go\n        export FUZZ_NG_CORPUS_DIR=`pwd`/fuzz_ng_$pkg_flat/corpus/\n        pushd $SRC/goroot/src/fuzz_ng_$pkg_flat/\n        go mod tidy\n        go test -mod=readonly\n        popd\n        rm -rf $SRC/goroot/src/fuzz_ng_$pkg_flat/\n        cd fuzz_ng_$pkg_flat\n        zip -r $OUT/fuzz_ngo_\"$pkg_flat\"_seed_corpus.zip corpus || true\n    )\n}\n\n# in $SRC/ngolo-fuzzing\ngo build\n\n(\ncd go114-fuzz-build\ngo build\n)\n\ntouch $SRC/ok.txt $SRC/ko.txt\nfind $SRC/goroot/src/ -type d | cut -d/ -f5- | while read pkg; do\n    if [[ `ls $SRC/goroot/src/$pkg/*.go | wc -l` == '0' ]]; then\n        continue\n    fi\n    if [[ `echo $pkg | grep internal | wc -l` == '1' ]]; then\n        continue\n    fi\n    if [[ `echo $pkg | grep vendor | wc -l` == '1' ]]; then\n        continue\n    fi\n    if [[ `echo $pkg | grep testdata | wc -l` == '1' ]]; then\n        continue\n    fi\n    if compile_package $pkg; then\n        echo $pkg >> $SRC/ok.txt\n    else\n        echo \"Failed for $pkg\"\n        # hard fail if the package is meant to be supported\n        grep ^$pkg$ $SRC/ngolo-fuzzing/std/supported.txt && exit 1\n        echo $pkg >> $SRC/ko.txt\n    fi\n\ndone\n\necho \"Failed packages:\"\ncat $SRC/ko.txt\n\necho \"Succesful packages:\"\ncat $SRC/ok.txt\n"
  },
  {
    "path": "projects/ngolo-fuzzing/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"'https://github.com/catenacyber/ngolo-fuzzing\"\nprimary_contact: \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/catenacyber/ngolo-fuzzing'\nselective_unpack: true\nfile_github_issue: True\n"
  },
  {
    "path": "projects/ngolo-fuzzing-x/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev binutils cmake \\\n   ninja-build liblzma-dev libz-dev pkg-config autoconf libtool\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN mkdir LPM; \\\n  cd LPM; \\\n  cmake $SRC/libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release; \\\n  ninja;\n\nRUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n\nRUN git clone --depth 1 https://go.googlesource.com/go goroot\nRUN git clone --depth 1 https://github.com/catenacyber/ngolo-fuzzing.git\n\nRUN mkdir $SRC/x\nRUN git clone --depth 1 https://github.com/golang/net x/net\nRUN git clone --depth 1 https://github.com/golang/image x/image\nRUN git clone --depth 1 https://github.com/golang/crypto x/crypto\nRUN git clone --depth 1 https://github.com/golang/text x/text\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/ngolo-fuzzing\n"
  },
  {
    "path": "projects/ngolo-fuzzing-x/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# compile latest go from git\n(\ncd $SRC/goroot/src\n./make.bash\n)\nrm -Rf /root/.go/\nexport PATH=$PATH:$SRC/goroot/bin/\ngo install golang.org/x/tools/cmd/goimports@latest\n\ncompile_package () {\n    pkg=$1\n    pkg_flat=`echo $pkg | sed 's/\\//_/g' | sed 's/\\./x'_$repo'/'`\n    args=`cat $SRC/ngolo-fuzzing/x/args.txt | grep \"^$pkg_flat \" | cut -d\" \" -f2-`\n    $SRC/ngolo-fuzzing/ngolo-fuzzing $args $pkg fuzz_ng_$pkg_flat\n    # applies special python patcher if any\n    ls $SRC/ngolo-fuzzing/x/$pkg_flat.py && (\n        python3 $SRC/ngolo-fuzzing/x/$pkg_flat.py fuzz_ng_$pkg_flat/fuzz_ng.go > fuzz_ng_$pkg_flat/fuzz_ngp.go\n        mv fuzz_ng_$pkg_flat/fuzz_ngp.go fuzz_ng_$pkg_flat/fuzz_ng.go\n    )\n    (\n        cd fuzz_ng_$pkg_flat\n        $SRC/LPM/external.protobuf/bin/protoc --go_out=./ ngolofuzz.proto\n        mkdir cpp\n        $SRC/LPM/external.protobuf/bin/protoc --cpp_out=./cpp ngolofuzz.proto\n        $CXX -DNDEBUG -stdlib=libc++ -c -I . -I $SRC/LPM/external.protobuf/include cpp/ngolofuzz.pb.cc\n        $CXX $CXXFLAGS -c -Icpp -I $SRC/libprotobuf-mutator/ -I $SRC/LPM/external.protobuf/include $SRC/ngolo-fuzzing/lpm/ngolofuzz.cc\n    )\n    if [ \"$SANITIZER\" = \"coverage\" ]\n    then\n        (\n        cd fuzz_ng_$pkg_flat\n        compile_go_fuzzer . FuzzNG_unsure fuzz_ngo_$pkg_flat\n        )\n    else\n        (\n        cd fuzz_ng_$pkg_flat\n        compile_go_fuzzer . FuzzNG_unsure fuzz_ngo_$pkg_flat\n        rm fuzz_ngo_$pkg_flat.a\n        )\n        $SRC/ngolo-fuzzing/go114-fuzz-build/go114-fuzz-build -func FuzzNG_valid -o fuzz_ng_$pkg_flat.a ./fuzz_ng_$pkg_flat\n\n        $CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_ng_$pkg_flat/ngolofuzz.pb.o fuzz_ng_$pkg_flat//ngolofuzz.o \\\n        fuzz_ng_$pkg_flat.a \\\n        $SRC/LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n        $SRC/LPM/src/libprotobuf-mutator.a \\\n        -Wl,--start-group $SRC/LPM/external.protobuf/lib/lib*.a -Wl,--end-group \\\n        -o $OUT/fuzz_ng_$pkg_flat\n        rm fuzz_ng_$pkg_flat.a\n    fi\n    (\n        # corpus\n        cp $SRC/ngolo-fuzzing/corpus/ngolo_helper.go fuzz_ng_$pkg_flat/\n        goimports -w fuzz_ng_$pkg_flat/copy/*.go\n        cp fuzz_ng_$pkg_flat/copy/*.go fuzz_ng_$pkg_flat/\n        cp $pkg/*_test.go fuzz_ng_$pkg_flat/\n        sed -i -e 's/^package .*/package 'fuzz_ng_$pkg_flat'/' fuzz_ng_$pkg_flat/*.go\n        export FUZZ_NG_CORPUS_DIR=`pwd`/fuzz_ng_$pkg_flat/corpus/\n        pushd fuzz_ng_$pkg_flat\n        go mod tidy\n        go test -mod=readonly\n        zip -r $OUT/fuzz_ngo_\"$pkg_flat\"_seed_corpus.zip corpus\n        popd\n    )\n}\n\n# in $SRC/ngolo-fuzzing\ngo build\n\n(\ncd go114-fuzz-build\ngo build\n)\n\ntouch $SRC/ko.txt\n# compile x packages\ncd $SRC/x\nls | while read repo; do\ncd $repo\nfind . -type d | while read pkg; do\n    if [[ `ls $pkg/*.go | wc -l` == '0' ]]; then\n        continue\n    fi\n    if [[ `echo $pkg | grep internal | wc -l` == '1' ]]; then\n        continue\n    fi\n    if [[ `echo $pkg | grep vendor | wc -l` == '1' ]]; then\n        continue\n    fi\n    if [[ `echo $pkg | grep testdata | wc -l` == '1' ]]; then\n        continue\n    fi\n    if compile_package $pkg $repo; then\n        echo $repo/$pkg >> $SRC/ok.txt\n    else\n        echo \"Failed for $pkg\"\n        echo $repo/$pkg >> $SRC/ko.txt\n    fi\n\ndone\ncd -\ndone\n\necho \"Failed packages:\"\ncat $SRC/ko.txt\n\necho \"Succesful packages:\"\ncat $SRC/ok.txt\n"
  },
  {
    "path": "projects/ngolo-fuzzing-x/project.yaml",
    "content": "homepage: \"'https://github.com/catenacyber/ngolo-fuzzing\"\nprimary_contact: \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/catenacyber/ngolo-fuzzing'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/nimbus-jwt/0001-disable-jar-signing.patch",
    "content": "diff --git a/pom.xml b/pom.xml\nindex 4b188bdc..8d0e4c04 100644\n--- a/pom.xml\n+++ b/pom.xml\n@@ -263,23 +263,6 @@\n                     <goals>deploy</goals>\n                 </configuration>\n             </plugin>\n-            <plugin>\n-                <groupId>org.apache.maven.plugins</groupId>\n-                <artifactId>maven-gpg-plugin</artifactId>\n-                <version>1.6</version>\n-                <!-- Pass password with\n-                    mvn release:prepare|perform -Darguments=-Dgpg.passphrase=thephrase\n-                -->\n-                <executions>\n-                    <execution>\n-                        <id>sign-artifacts</id>\n-                        <phase>verify</phase>\n-                        <goals>\n-                            <goal>sign</goal>\n-                        </goals>\n-                    </execution>\n-                </executions>\n-            </plugin>\n             <plugin>\n                 <groupId>org.codehaus.mojo</groupId>\n                 <artifactId>buildnumber-maven-plugin</artifactId>\n"
  },
  {
    "path": "projects/nimbus-jwt/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME nimbus-jwt\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://bitbucket.org/connect2id/nimbus-jose-jwt.git ${LIBRARY_NAME}\n\n#\n# apply fixes\n#\nADD *.patch ${SRC}/\nRUN cd ${SRC}/${LIBRARY_NAME} && (for i in ${SRC}/*.patch; do tr -d '\\015' < $i | git apply -v; done )\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}\n"
  },
  {
    "path": "projects/nimbus-jwt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_SUBDIR=\"\"\nMVN_FLAGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests -Dmaven.javadoc.skip=true\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.14.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}/${SRC_SUBDIR}\"\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/nimbus-jwt/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/nimbus-jwt/nimbus-jwt-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>nimbus-jwt-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>9.30.1</fuzzedLibaryVersion>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.14.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.14.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>com.nimbusds</groupId>\n\t\t\t<artifactId>nimbus-jose-jwt</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/nimbus-jwt/nimbus-jwt-fuzzer/src/main/java/com/nimbusds/jwt/JWTParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.nimbusds.jwt;\n\nimport java.text.ParseException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\npublic class JWTParserFuzzer {\n\n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public JWTParserFuzzer(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        this.fuzzedDataProvider = fuzzedDataProvider;\n    }\n\n    void test() {\n        try {\n            JWT jwt = JWTParser.parse(fuzzedDataProvider.consumeRemainingAsString());\n        } catch (ParseException exception) {\n            /* ignore */\n        } catch (IllegalArgumentException exception) {\n            /* ignore */\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider)  throws Exception {\n\n        JWTParserFuzzer fixture = new JWTParserFuzzer(fuzzedDataProvider);\n        fixture.test();\n    }\n}"
  },
  {
    "path": "projects/nimbus-jwt/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://connect2id.com/products/nimbus-jose-jwt\"\nlanguage: jvm\nmain_repo: \"https://bitbucket.org/connect2id/nimbus-jose-jwt.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/ninja/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake\n\nRUN git clone --depth 1 https://github.com/ninja-build/ninja\nWORKDIR ninja\nRUN mv $SRC/ninja/misc/oss-fuzz/build.sh $SRC/\nRUN mv $SRC/ninja/misc/oss-fuzz/sample_ninja_build $SRC/\nCOPY run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/ninja/project.yaml",
    "content": "homepage: \"https://github.com/ninja-build/ninja\"\nlanguage: c++\nprimary_contact: \"jhasse@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: \"https://github.com/ninja-build/ninja\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/ninja/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\nexport ASAN_OPTIONS=detect_leaks=0\n./build-cmake/ninja_test\n"
  },
  {
    "path": "projects/njs/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n    git libpcre2-dev\nRUN git clone https://github.com/nginx/njs\nRUN git clone --branch pcre2-10.39 https://github.com/PhilipHazel/pcre2 pcre2\n\nWORKDIR njs\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/njs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build pcre dependency to be linked statically.\npushd $SRC/pcre2\n./autogen.sh\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n  # Disable sanitizers for introspector for pcre. We only care about njs and it's blocking the build.\n  CFLAGS=\"\" CXXFLAGS=\"\" LIB_FUZZING_ENGINE=\"\" ./configure\nelse\n  CFLAGS=\"$CFLAGS -fno-use-cxa-atexit\" CXXFLAGS=\"$CXXFLAGS -fno-use-cxa-atexit\" ./configure\nfi\nmake -j$(nproc) clean\nmake -j$(nproc) all\nmake install\nsed -i \"s/\\$libS\\$libR \\(-lpcre2-8$\\)/\\$libS\\$libR -Wl,-Bstatic \\1 -Wl,-Bdynamic/\" /usr/local/bin/pcre2-config\npopd\n\n# build project\n./configure\nmake njs_fuzzer\n\ncp ./build/njs_process_script_fuzzer $OUT/\n\nSEED_CORPUS_PATH=$OUT/njs_process_script_fuzzer_seed_corpus\nmkdir -p $SEED_CORPUS_PATH\n\nset +x\ncat src/test/njs_unit_test.c \\\n    | egrep -o '\".*\"' | awk '{print substr($0,2,length($0)-2)}' | sort | uniq \\\n    | while IFS= read -r line; do\n      echo $line > $SEED_CORPUS_PATH/$(echo $line | sha1sum | awk '{ print $1 }');\n    done\n\nfind test/ -name *.t.js \\\n    | while IFS= read -r testname; do\n        cp $testname $SEED_CORPUS_PATH/$(echo $testname | sha1sum | awk '{ print $1 }');\n      done\nset -x\n\nzip -q $SEED_CORPUS_PATH.zip $SEED_CORPUS_PATH\nrm -rf $SEED_CORPUS_PATH\n"
  },
  {
    "path": "projects/njs/project.yaml",
    "content": "homepage: \"https://nginx.org/en/docs/njs/\"\nlanguage: c++\nprimary_contact: \"xeioexception@gmail.com\"\nauto_ccs:\n - \"devrep@nginx.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\ncoverage_extra_args: -ignore-filename-regex=.*/pcre2/.*\nmain_repo: 'https://github.com/nginx/njs.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/njs/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake unit_test\n\n"
  },
  {
    "path": "projects/node-xml2js/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/Leonidas-from-XIV/node-xml2js\n\nCOPY fuzz_parseString.js $SRC/node-xml2js\n\nWORKDIR $SRC/node-xml2js"
  },
  {
    "path": "projects/node-xml2js/build.sh",
    "content": "#!/bin/bash\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install --save-dev @jazzer.js/core \nnpm i\n\n# Build Fuzzers.\ncompile_javascript_fuzzer node-xml2js fuzz_parseString.js -i node-xml2js"
  },
  {
    "path": "projects/node-xml2js/fuzz_parseString.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst xml2js = require(\"./lib/xml2js\");\n\n\nmodule.exports.fuzz = async function (data) { // async? --sync will have oom\n    const provider = new FuzzedDataProvider(data);\n    let xml = provider.consumeString(provider.consumeIntegralInRange(0, 2**48-1));\n\n    var options = {\n        attrkey: provider.consumeString(provider.consumeIntegralInRange(0, 2**48-1)),\n        charkey: provider.consumeString(provider.consumeIntegralInRange(0, 2**48-1)),\n        explicitCharkey: provider.consumeBoolean(),\n        trim: provider.consumeBoolean(),\n        normalizeTags: provider.consumeBoolean(),\n        normalize: provider.consumeBoolean(),\n        explicitRoot: provider.consumeNumber(),\n        emptyTag: provider.consumeString(provider.consumeIntegralInRange(0, 2**48-1)),\n        explicitArray: provider.consumeBoolean(),\n        ignoreAttrs: provider.consumeBoolean(),\n        mergeAttrs: provider.consumeBoolean(),\n        xmlns: provider.consumeBoolean(),\n        explicitChildren: provider.consumeBoolean(),\n        childkey: provider.consumeString(provider.consumeIntegralInRange(0, 2**48-1)),\n        preserveChildrenOrder: provider.consumeBoolean(),\n        charsAsChildren: provider.consumeBoolean(),\n        includeWhiteChars: provider.consumeBoolean(),\n        async: provider.consumeBoolean(),\n        strict: provider.consumeBoolean(),\n    };\n\n    var parser = new xml2js.Parser(options);\n    try {\n        parser.parseString(xml);\n        parser.parseStringPromise(xml).then(function () {}).catch(function () {});\n    } catch (error) {\n        // Catch expected errors to find more interesting bugs.\n    }\n};\n"
  },
  {
    "path": "projects/node-xml2js/project.yaml",
    "content": "homepage: https://github.com/Leonidas-from-XIV/node-xml2js\nlanguage: javascript\nmain_repo: https://github.com/Leonidas-from-XIV/node-xml2js\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/nodejs/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make flex bison build-essential\nRUN git clone --recursive --depth 1 https://github.com/nodejs/node\nRUN wget https://go.dev/dl/go1.24.5.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && mkdir mkdir /root/.go/ \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.5.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\nENV PATH=$PATH:/root/.go/bin:$GOPATH/bin\nWORKDIR $SRC/node\nADD fuzz_sources $SRC/fuzz_sources\nCOPY *.sh *.cc *.h *add_fuzzers_to_node_gyp.go $SRC/\n"
  },
  {
    "path": "projects/nodejs/add_fuzzers_to_node_gyp.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\ttemplate1 = `\n\t\t{\n\t\t  'target_name': '____TARGETNAME____',\n\t\t  'type': 'executable',\n\t\t  'dependencies': [\n\t\t    '<(node_lib_target_name)',\n\t\t    'deps/googletest/googletest.gyp:gtest_prod',\n\t\t    'deps/histogram/histogram.gyp:histogram',\n\t\t    'deps/uvwasi/uvwasi.gyp:uvwasi',\n\t\t    'deps/ncrypto/ncrypto.gyp:ncrypto',\n\t\t    'deps/nbytes/nbytes.gyp:nbytes',\n\t\t    'tools/v8_gypfiles/abseil.gyp:abseil',\n\t\t  ],\n\t\t  'includes': [\n\t\t    'node.gypi'\n\t\t  ],\n\t\t  'include_dirs': [\n\t\t    'src',\n\t\t    'tools/msvs/genfiles',\n\t\t    'deps/v8/include',\n\t\t    'deps/cares/include',\n\t\t    'deps/uv/include',\n\t\t    'deps/uvwasi/include',\n\t\t    'test/cctest',\n\t\t    'test/fuzzers',\n\t\t  ],\n\t\t  'defines': [\n\t\t    'NODE_ARCH=\"<(target_arch)\"',\n\t\t    'NODE_PLATFORM=\"<(OS)\"',\n\t\t    'NODE_WANT_INTERNALS=1',\n\t\t    'HAVE_OPENSSL=1',\n\t\t    'NAPI_VERSION=10',\n\t\t  ],\n\t\t  'sources': [\n\t\t    'src/node_snapshot_stub.cc',\n\t\t    'test/fuzzers/fuzz_common.cc',\n\t\t    'test/fuzzers/____TARGETNAME____.cc',\n\t\t  ],\n\t\t  'conditions': [\n\t\t    ['OS==\"linux\"', {\n\t\t      'ldflags': [ '-fsanitize=fuzzer' ]\n\t\t    }],\n\t\t    # Ensure that ossfuzz flag has been set and that we are on Linux\n\t\t    [ 'OS!=\"linux\" or ossfuzz!=\"true\"', {\n\t\t      'type': 'none',\n\t\t    }],\n\t\t    # Avoid excessive LTO\n\t\t    ['enable_lto==\"true\"', {\n\t\t      'ldflags': [ '-fno-lto' ],\n\t\t    }],\n\t\t  ],\n\t\t},`\n\tfuzzers = []string{\n\t\t\"fuzz_ClientHelloParser\",\n\t\t\"fuzz_blob\",\n\t\t\"fuzz_buffer_compare\",\n\t\t\"fuzz_buffer_equals\",\n\t\t\"fuzz_buffer_includes\",\n\t\t\"fuzz_cipheriv\",\n\t\t\"fuzz_createPrivateKeyDER\",\n\t\t\"fuzz_createPrivateKeyJWK\",\n\t\t\"fuzz_createPrivateKeyPEM\",\n\t\t\"fuzz_diffieHellmanDER\",\n\t\t\"fuzz_diffieHellmanJWK\",\n\t\t\"fuzz_diffieHellmanPEM\",\n\t\t\"fuzz_fs_write_open_read\",\n\t\t\"fuzz_fs_write_read_append\",\n\t\t\"fuzz_httpparser1\",\n\t\t\"fuzz_path_basename\",\n\t\t\"fuzz_path_dirname\",\n\t\t\"fuzz_path_extname\",\n\t\t\"fuzz_path_format\",\n\t\t\"fuzz_path_isAbsolute\",\n\t\t\"fuzz_path_join\",\n\t\t\"fuzz_path_normalize\",\n\t\t\"fuzz_path_parse\",\n\t\t\"fuzz_path_relative\",\n\t\t\"fuzz_path_resolve\",\n\t\t\"fuzz_path_toNamespacedPath\",\n\t\t\"fuzz_querystring_parse\",\n\t\t\"fuzz_quic_token\",\n\t\t\"fuzz_sign_verify\",\n\t\t\"fuzz_stream1\",\n\t\t\"fuzz_string_decoder\",\n\t\t\"fuzz_strings\",\n\t\t\"fuzz_tls_socket_request\",\n\t\t\"fuzz_v8_deserialize\",\n\t\t\"fuzz_x509\",\n\t\t\"fuzz_zlib_brotliCompress\",\n\t\t\"fuzz_zlib_brotliDecompress\",\n\t\t\"fuzz_zlib_createBrotliDecompress\",\n\t\t\"fuzz_zlib_gzip_createUnzip\",\n\t}\n)\n\nfunc createGypTargetEntry(fuzzerName string) string {\n\ttempl := template1\n\ttemplWithTargetName := strings.ReplaceAll(templ, \"____TARGETNAME____\", fuzzerName)\n\treturn templWithTargetName\n}\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"Usage: go run main.go <inputfile> <outputfile>\")\n\t\treturn\n\t}\n\n\tinputFile := os.Args[1]\n\toutputFile := os.Args[2]\n\n\tin, err := os.Open(inputFile)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to open input file: %v\", err)\n\t}\n\tdefer in.Close()\n\n\tout, err := os.Create(outputFile)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create output file: %v\", err)\n\t}\n\tdefer out.Close()\n\n\tscanner := bufio.NewScanner(in)\n\twriter := bufio.NewWriter(out)\n\n\tvar ignore bool\n\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\t// Remove existing fuzzers in the original node.gyp\n\t\tif !ignore && line == \"    { # fuzz_env\" {\n\t\t\tignore = true\n\t\t\tcontinue\n\t\t} else if ignore && line == \"    }, # fuzz_env\" {\n\t\t\tignore = false\n\t\t\tcontinue\n\t\t} else if !ignore && line == \"    { # fuzz_ClientHelloParser.cc\" {\n\t\t\tignore = true\n\t\t\tcontinue\n\t\t} else if ignore && line == \"    }, # fuzz_ClientHelloParser.cc\" {\n\t\t\tignore = false\n\t\t\tcontinue\n\t\t} else if !ignore && line == \"    { # fuzz_url\" {\n\t\t\tignore = true\n\t\t\tcontinue\n\t\t} else if ignore && line == \"    }, # fuzz_url\" {\n\t\t\tignore = false\n\t\t\tcontinue\n\t\t} else if !ignore && line == \"    { # fuzz_strings\" {\n\t\t\tignore = true\n\t\t\tcontinue\n\t\t} else if ignore && line == \"    }, # fuzz_strings\" {\n\t\t\tignore = false\n\t\t\tcontinue\n\t\t}\n\t\tif ignore {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar stringToAppend string\n\t\tappendTargetsNow := line == \"  'targets': [\"\n\t\t// add new line unless we are adding the fuzzers\n\t\t// since the fuzzer template already has new line\n\t\tif appendTargetsNow {\n\t\t\tstringToAppend = line\n\t\t} else {\n\t\t\tstringToAppend = line + \"\\n\"\n\t\t}\n\t\t_, err := writer.WriteString(stringToAppend)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to write line: %v\", err)\n\t\t}\n\n\t\t// Check for the special line\n\t\tif appendTargetsNow {\n\t\t\tfor _, fuzzer := range fuzzers {\n\t\t\t\tfmt.Println(\"appending \", fuzzer)\n\t\t\t\t_, err := writer.WriteString(createGypTargetEntry(fuzzer))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"Failed to write injected line: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\tlog.Fatalf(\"Error reading input file: %v\", err)\n\t}\n\n\tif err := writer.Flush(); err != nil {\n\t\tlog.Fatalf(\"Error flushing output: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "projects/nodejs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nrm $SRC/node/test/fuzzers/*\ncp $SRC/fuzz_sources/* $SRC/node/test/fuzzers/\n\n# Add the fuzzers to node.gyp\nmkdir $SRC/modify-node-gyp\ncd $SRC/modify-node-gyp\ngo mod init modify-node-gyp\nmv $SRC/add_fuzzers_to_node_gyp.go ./main.go\ngo run main.go $SRC/node/node.gyp /tmp/updated-node.gyp\nmv /tmp/updated-node.gyp $SRC/node/node.gyp\n\ncd $SRC/node\n\n# Coverage build takes very long and time outs in the CI which blocks changes. Ignore Coverage build in OSS-Fuzz CI for now:\nif [[ -n \"${OSS_FUZZ_CI-}\" && \"$SANITIZER\" = coverage ]]; then\n\texit 0\nfi\n\nif [[ \"$SANITIZER\" = coverage ]]; then\n  export CFLAGS=\"${CFLAGS/\"-fcoverage-mapping\"/\" \"}\"\n  export CFLAGS=\"${CFLAGS/\"-fprofile-instr-generate\"/\" \"}\"\n  export CXXFLAGS=\"${CXXFLAGS/\"-fcoverage-mapping\"/\" \"}\"\n  export CXXFLAGS=\"${CXXFLAGS/\"-fprofile-instr-generate\"/\" \"}\"\n  echo \"CFLAGS: ${CFLAGS}\"\n  echo \"CXXFLAGS: ${CXXFLAGS}\"\nfi\n\n# Build node\nexport CXXFLAGS=\"$CXXFLAGS -std=c++20 -stdlib=libc++\"\nexport GN_ARGS='use_custom_libcxx=true'\nexport LDFLAGS=\"$CXXFLAGS\"\nexport LDFLAGS=\"$LDFLAGS -stdlib=libc++\"\nexport LD=\"$CXX\"\n./configure --with-ossfuzz\n\n# Ensure we build with few processors if memory gets exhausted\nif [[ \"$SANITIZER\" = coverage ]]; then\n    for mrkpath in \\\n        fuzz_buffer_includes.target.mk \\\n        fuzz_buffer_equals.target.mk \\\n        fuzz_buffer_compare.target.mk \\\n        fuzz_blob.target.mk \\\n        fuzz_zlib_gzip_createUnzip.target.mk \\\n        fuzz_zlib_createBrotliDecompress.target.mk \\\n        fuzz_zlib_brotliDecompress.target.mk \\\n        fuzz_zlib_brotliCompress.target.mk \\\n        fuzz_string_decoder.target.mk \\\n        fuzz_querystring_parse.target.mk \\\n        fuzz_path_join.target.mk \\\n        fuzz_stream1.target.mk \\\n        fuzz_strings.target.mk \\\n        fuzz_diffieHellmanPEM.target.mk \\\n        fuzz_createPrivateKeyPEM.target.mk \\\n        fuzz_createPrivateKeyDER.target.mk \\\n        fuzz_path_extname.target.mk \\\n        fuzz_path_normalize.target.mk \\\n        fuzz_path_relative.target.mk \\\n        fuzz_createPrivateKeyJWK.target.mk \\\n        fuzz_path_format.target.mk \\\n        fuzz_ClientHelloParser.target.mk \\\n        fuzz_diffieHellmanJWK.target.mk \\\n        fuzz_path_basename.target.mk \\\n        fuzz_path_isAbsolute.target.mk \\\n        fuzz_tls_socket_request.target.mk \\\n        fuzz_diffieHellmanDER.target.mk \\\n        fuzz_path_toNamespacedPath.target.mk \\\n        fuzz_path_parse.target.mk \\\n        fuzz_httpparser1.target.mk \\\n        fuzz_path_dirname.target.mk \\\n        fuzz_x509.target.mk \\\n        fuzz_fs_write_read_append.target.mk \\\n        fuzz_sign_verify.target.mk \\\n        fuzz_path_resolve.target.mk \\\n        fuzz_fs_write_open_read.target.mk \\\n        libnode.target.mk\n    do\n        echo \"sed'ing ${mrkpath}\"\n        sed -i 's/BUILDTYPE))/BUILDTYPE)) -fprofile-instr-generate -fcoverage-mapping/g' \"$SRC/node/out/${mrkpath}\"\n    done\n    make -j3 || make -j1\nelse\n        make -j$(nproc) || make -j1\nfi\n\n# Move all fuzzers to OUT folder \nmv out/Release/fuzz_* ${OUT}/\n\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_ClientHelloParser.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdlib.h>\n#include \"crypto/crypto_clienthello-inl.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  node::crypto::ClientHelloParser parser;\n  bool end_cb_called = false;\n  parser.Start([](void* arg, auto hello) { },\n               [](void* arg) { },\n               &end_cb_called);\n  parser.Parse(data, size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_blob.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n\n#include \"fuzz_js_format.h\"\n#include \"fuzz_common.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(ab){\n    const { Blob } = require('node:buffer');\n    return new Blob([Buffer.from(ab)]).text(); // Promise\n  })\n)JS\";\n} // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_buffer_compare.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include <cstring>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string s1 = fdp.ConsumeRandomLengthString(len0);\n  const std::string s2 = fdp.ConsumeRemainingBytesAsString();\n\n  static constexpr std::string_view kTemplate = R\"(\nconst buffer1 = Buffer.from({0});\nconst buffer2 = Buffer.from({1});\nconst _ = buffer1.compare(buffer2);\n)\";\n\n  const std::string js =\n      FormatJs(kTemplate, ToSingleQuotedJsLiteral(s1), ToSingleQuotedJsLiteral(s2));\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_buffer_equals.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string s1 = fdp.ConsumeRandomLengthString(len0);\n  const std::string s2 = fdp.ConsumeRemainingBytesAsString();\n\n  static constexpr std::string_view kTemplate = R\"(\nconst buffer1 = Buffer.from({0});\nconst buffer2 = Buffer.from({1});\nconst _ = buffer1.equals(buffer2);\n)\";\n\n  const std::string js =\n      FormatJs(kTemplate, ToSingleQuotedJsLiteral(s1), ToSingleQuotedJsLiteral(s2));\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_buffer_includes.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string s1 = fdp.ConsumeRandomLengthString(len0);\n  const std::string s2 = fdp.ConsumeRemainingBytesAsString();\n\n  static constexpr std::string_view kTemplate = R\"(\nconst buffer1 = Buffer.from({0});\nconst checkStr = {1};\nconst _ = buffer1.includes(checkStr);\n)\";\n\n  const std::string js =\n      FormatJs(kTemplate, ToSingleQuotedJsLiteral(s1), ToSingleQuotedJsLiteral(s2));\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_cipheriv.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include <vector>\n#include \"fuzzer/FuzzedDataProvider.h\"\n\n#include \"fuzz_js_format.h\"\n#include \"fuzz_common.h\"\n\nstatic const char* kCiphers[] = {\n  \"aes-128-cbc\",\"aes-128-cbc-hmac-sha1\",\"aes-128-cbc-hmac-sha256\",\"aes-128-ccm\",\"aes-128-cfb\",\n  \"aes-128-cfb1\",\"aes-128-cfb8\",\"aes-128-ctr\",\"aes-128-ecb\",\"aes-128-gcm\",\"aes-128-ocb\",\"aes-128-ofb\",\n  \"aes-128-xts\",\"aes-192-cbc\",\"aes-192-ccm\",\"aes-192-cfb\",\"aes-192-cfb1\",\"aes-192-cfb8\",\"aes-192-ctr\",\n  \"aes-192-ecb\",\"aes-192-gcm\",\"aes-192-ocb\",\"aes-192-ofb\",\"aes-256-cbc\",\"aes-256-cbc-hmac-sha1\",\n  \"aes-256-cbc-hmac-sha256\",\"aes-256-ccm\",\"aes-256-cfb\",\"aes-256-cfb1\",\"aes-256-cfb8\",\"aes-256-ctr\",\n  \"aes-256-ecb\",\"aes-256-gcm\",\"aes-256-ocb\",\"aes-256-ofb\",\"aes-256-xts\",\"aes128\",\"aes128-wrap\",\"aes192\",\n  \"aes192-wrap\",\"aes256\",\"aes256-wrap\",\"aria-128-cbc\",\"aria-128-ccm\",\"aria-128-cfb\",\"aria-128-cfb1\",\n  \"aria-128-cfb8\",\"aria-128-ctr\",\"aria-128-ecb\",\"aria-128-gcm\",\"aria-128-ofb\",\"aria-192-cbc\",\n  \"aria-192-ccm\",\"aria-192-cfb\",\"aria-192-cfb1\",\"aria-192-cfb8\",\"aria-192-ctr\",\"aria-192-ecb\",\n  \"aria-192-gcm\",\"aria-192-ofb\",\"aria-256-cbc\",\"aria-256-ccm\",\"aria-256-cfb\",\"aria-256-cfb1\",\n  \"aria-256-cfb8\",\"aria-256-ctr\",\"aria-256-ecb\",\"aria-256-gcm\",\"aria-256-ofb\",\"aria128\",\"aria192\",\n  \"aria256\",\"camellia-128-cbc\",\"camellia-128-cfb\",\"camellia-128-cfb1\",\"camellia-128-cfb8\",\n  \"camellia-128-ctr\",\"camellia-128-ecb\",\"camellia-128-ofb\",\"camellia-192-cbc\",\"camellia-192-cfb\",\n  \"camellia-192-cfb1\",\"camellia-192-cfb8\",\"camellia-192-ctr\",\"camellia-192-ecb\",\"camellia-192-ofb\",\n  \"camellia-256-cbc\",\"camellia-256-cfb\",\"camellia-256-cfb1\",\"camellia-256-cfb8\",\"camellia-256-ctr\",\n  \"camellia-256-ecb\",\"camellia-256-ofb\",\"camellia128\",\"camellia192\",\"camellia256\",\"chacha20\",\n  \"chacha20-poly1305\",\"des-ede\",\"des-ede-cbc\",\"des-ede-cfb\",\"des-ede-ecb\",\"des-ede-ofb\",\"des-ede3\",\n  \"des-ede3-cbc\",\"des-ede3-cfb\",\"des-ede3-cfb1\",\"des-ede3-cfb8\",\"des-ede3-ecb\",\"des-ede3-ofb\",\n  \"des3\",\"des3-wrap\",\"id-aes128-CCM\",\"id-aes128-GCM\",\"id-aes128-wrap\",\"id-aes128-wrap-pad\",\n  \"id-aes192-CCM\",\"id-aes192-GCM\",\"id-aes192-wrap\",\"id-aes192-wrap-pad\",\"id-aes256-CCM\",\"id-aes256-GCM\",\n  \"id-aes256-wrap\",\"id-aes256-wrap-pad\",\"id-smime-alg-CMS3DESwrap\",\"sm4\",\"sm4-cbc\",\"sm4-cfb\",\"sm4-ctr\",\n  \"sm4-ecb\",\"sm4-ofb\"\n};\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(alg, keyAB, ivAB, plain){\n    const crypto = require('crypto');\n    const key = Buffer.from(keyAB);\n    const iv  = Buffer.from(ivAB);\n    try {\n      const c = crypto.createCipheriv(alg, key, iv);\n      let enc = c.update(plain, 'utf8', 'hex'); enc += c.final('hex');\n      const d = crypto.createDecipheriv(alg, key, iv);\n      let out = d.update(enc, 'hex', 'utf8'); out += d.final('utf8');\n      return out;\n    } catch (e) {}\n  })\n)JS\";\n} // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a0 = fdp.ConsumeRandomLengthString(len0);\n  const size_t len1 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a1 = fdp.ConsumeRandomLengthString(len1);\n  const size_t len2 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a2 = fdp.ConsumeRandomLengthString(len2);\n  const std::string a3 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1},{2},{3},{4}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0),\n      ToSingleQuotedJsLiteral(a1),\n      ToSingleQuotedJsLiteral(a2),\n      ToSingleQuotedJsLiteral(a3));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_common.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"fuzz_common.h\"\n\n#include <cstdlib>\n#include <string>\n#include <vector>\n\n#include \"uv.h\"\n#include \"v8.h\"\n\n#include \"node.h\"\n#include \"node_platform.h\"\n#include \"env-inl.h\"\n#include \"util-inl.h\"\n\n// cppgc platform init/shutdown like cctest does\n#include \"cppgc/platform.h\"\n\n#if defined(__GLIBC__)\n#include <malloc.h>  // malloc_trim\n#endif\n\nnamespace fuzz {\nnamespace {\n\n// -------- Process-wide, persistent Node/V8 state (single Environment) --------\nstd::unique_ptr<node::NodePlatform> g_platform;\nuv_loop_t                            g_persist_loop;\n\nusing ABAUnique =\n    std::unique_ptr<node::ArrayBufferAllocator, decltype(&node::FreeArrayBufferAllocator)>;\n\nABAUnique                            g_persist_allocator{ nullptr, &node::FreeArrayBufferAllocator };\n\nv8::Isolate*                         g_iso = nullptr;\nv8::Global<v8::Context>              g_ctx;\nnode::IsolateData*                   g_iso_data = nullptr;\nnode::Environment*                   g_env = nullptr;\n\n// Pre-compiled JS function: (a:ArrayBuffer, b:ArrayBuffer) => Buffer.compare(...)\nv8::Global<v8::Function>             g_bufcmp_fn;\n\n// Helper: run platform tasks + libuv + microtasks once.\n// Returns true if any progress was made.\n// NOTE: Callers must have entered the isolate (Isolate::Scope) before calling.\nstatic inline bool OnePump(v8::Isolate* isolate,\n                           node::NodePlatform* platform,\n                           uv_loop_t* loop) {\n  bool progressed = false;\n  platform->DrainTasks(isolate);\n  progressed |= (uv_run(loop, UV_RUN_NOWAIT) != 0);\n  isolate->PerformMicrotaskCheckpoint();\n  return progressed;\n}\n\n// Drain up to max_spins or until the loop is idle.\n// Enters the isolate to satisfy V8 invariants while touching microtasks/heap.\nstatic inline void DrainUntilIdle(v8::Isolate* isolate,\n                                  node::NodePlatform* platform,\n                                  uv_loop_t* loop,\n                                  int max_spins = 256) {\n  v8::Isolate::Scope iso_scope(isolate);\n  v8::HandleScope hs(isolate);\n  for (int i = 0; i < max_spins; ++i) {\n    const bool progressed = OnePump(isolate, platform, loop);\n    if (!progressed && !uv_loop_alive(loop)) break;\n  }\n}\n\n// Build (once) a comparator that DOES NOT copy: Buffer.from(ArrayBuffer) shares memory.\nstatic void BuildBufCmpOnce() {\n  if (!g_bufcmp_fn.IsEmpty()) return;\n\n  v8::Isolate::Scope iso_scope(g_iso);\n  v8::HandleScope hs(g_iso);\n  v8::Local<v8::Context> ctx = g_ctx.Get(g_iso);\n  v8::Context::Scope cs(ctx);\n\n  // Share the underlying ArrayBuffer; avoid Uint8Array -> Buffer copy.\n  // Docs: Buffer.from(arrayBuffer[, byteOffset[, length]]) shares memory.\n  constexpr const char* kSrc = R\"JS(\n    (function(a, b) {\n      const bufa = Buffer.from(a);\n      const bufb = Buffer.from(b);\n      return Buffer.compare(bufa, bufb);\n    })\n  )JS\";\n\n  v8::Local<v8::String> src;\n  if (!v8::String::NewFromUtf8(g_iso, kSrc, v8::NewStringType::kNormal).ToLocal(&src)) return;\n  v8::Local<v8::Script> script;\n  if (!v8::Script::Compile(ctx, src).ToLocal(&script)) return;\n  v8::Local<v8::Value> fn_val;\n  if (!script->Run(ctx).ToLocal(&fn_val)) return;\n  g_bufcmp_fn.Reset(g_iso, fn_val.As<v8::Function>());\n}\n\nvoid GlobalShutdown() {\n  if (g_env != nullptr) {\n    v8::Isolate::Scope iso_scope(g_iso);\n    v8::HandleScope hs(g_iso);\n    v8::Local<v8::Context> ctx = g_ctx.Get(g_iso);\n    v8::Context::Scope cs(ctx);\n\n    node::RunAtExit(g_env);\n    node::Stop(g_env);\n    DrainUntilIdle(g_iso, g_platform.get(), &g_persist_loop);\n\n    node::FreeEnvironment(g_env);\n    g_env = nullptr;\n  }\n\n  if (g_iso_data != nullptr) {\n    node::FreeIsolateData(g_iso_data);\n    g_iso_data = nullptr;\n  }\n\n  g_bufcmp_fn.Reset();\n  g_ctx.Reset();\n\n  if (g_iso != nullptr) {\n    // Dispose the isolate via the platform so its per-isolate queues are freed.\n    g_platform->DisposeIsolate(g_iso);\n    g_iso = nullptr;\n  }\n\n  // Close the persistent libuv loop.\n  uv_loop_close(&g_persist_loop);\n\n  // Bring down cppgc + V8 + platform (order matters).\n  g_platform->Shutdown();\n  cppgc::ShutdownProcess();\n  v8::V8::Dispose();\n  v8::V8::DisposePlatform();\n\n  g_platform.reset();\n  g_persist_allocator.reset();\n}\n\n// Set up the persistent Environment once.\nstatic void InitializePersistentEnvOnce() {\n  if (g_env != nullptr) return;  // already initialized\n\n  uv_os_unsetenv(\"NODE_OPTIONS\");\n\n  // Small, fast platform with no tracing.\n  static constexpr int kV8ThreadPoolSize = 1;\n  g_platform = std::make_unique<node::NodePlatform>(kV8ThreadPoolSize, /*tracing_controller=*/nullptr);\n  v8::V8::InitializePlatform(g_platform.get());\n\n  // Parse Node/V8 flags BEFORE V8::Initialize() to avoid \"IsFrozen()\" asserts.\n  std::vector<std::string> node_argv{ \"fuzz_env\" };\n  (void) node::InitializeOncePerProcess(\n      node_argv,\n      node::ProcessInitializationFlags::kLegacyInitializeNodeWithArgsBehavior);\n\n  // Initialize cppgc + V8\n  cppgc::InitializeProcess(g_platform->GetPageAllocator());\n  v8::V8::Initialize();\n\n  // Persistent libuv loop for this Environment.\n  (void)uv_loop_init(&g_persist_loop);\n\n  // Process-wide allocator for this persistent isolate.\n  g_persist_allocator.reset(node::CreateArrayBufferAllocator());\n\n  // Create isolate, context, and Node Environment.\n  g_iso = node::NewIsolate(g_persist_allocator.get(), &g_persist_loop, g_platform.get());\n  {\n    v8::Isolate::Scope iso_scope(g_iso);\n    v8::HandleScope hs(g_iso);\n\n    v8::Local<v8::Context> ctx = node::NewContext(g_iso);\n    g_ctx.Reset(g_iso, ctx);\n    v8::Context::Scope cs(ctx);\n\n    g_iso_data = node::CreateIsolateData(g_iso, &g_persist_loop, g_platform.get());\n\n    std::vector<std::string> args{ \"node\" };\n    std::vector<std::string> exec_args;\n    node::EnvironmentFlags::Flags flags = node::EnvironmentFlags::kDefaultFlags;\n\n    g_env = node::CreateEnvironment(g_iso_data, ctx, args, exec_args, flags);\n\n    // Bootstrap Node (no entry script).\n    node::LoadEnvironment(g_env, const_cast<char*>(\"\"));\n\n    // Build and cache the comparator function.\n    BuildBufCmpOnce();\n  }\n\n  // Ensure we tear everything down at process exit.\n  std::atexit(&GlobalShutdown);\n}\n\n}  // namespace\n\n// ------------------------ IsolateScope (lightweight façade) --------------------\n\nIsolateScope::IsolateScope() {\n  // Ensure persistent env/isolate exist, then \"enter\" the isolate so code that\n  // expects an entered isolate continues to work. This does NOT own the isolate.\n  InitializePersistentEnvOnce();\n  isolate_ = g_iso;\n  if (isolate_) isolate_->Enter();\n}\n\nIsolateScope::~IsolateScope() {\n  if (!isolate_) return;\n  // Leave the isolate; do NOT dispose it (persistent env owns it).\n  isolate_->Exit();\n  isolate_ = nullptr;\n\n#if defined(__GLIBC__)\n  // Keep RSS in check during long runs.\n  malloc_trim(0);\n#endif\n}\n\n// ----------------------- Public helpers (persistent env) -----------------------\n\nvoid RunEnvString(v8::Isolate* /*unused*/,\n                  const char* env_js,\n                  const EnvRunOptions& /*opts*/) {\n  InitializePersistentEnvOnce();\n\n  v8::Isolate::Scope iso_scope(g_iso);\n  v8::HandleScope hs(g_iso);\n  v8::Local<v8::Context> ctx = g_ctx.Get(g_iso);\n  v8::Context::Scope cs(ctx);\n\n  if (!env_js) env_js = \"\";\n\n  v8::TryCatch tc(g_iso);\n  v8::Local<v8::String> src;\n  if (v8::String::NewFromUtf8(g_iso, env_js, v8::NewStringType::kNormal).ToLocal(&src)) {\n    v8::Local<v8::Script> script;\n    if (v8::Script::Compile(ctx, src).ToLocal(&script)) {\n      (void)script->Run(ctx);\n    }\n  }\n\n  // Keep the job stateless: drain until idle; do not Stop()/FreeEnvironment().\n  DrainUntilIdle(g_iso, g_platform.get(), &g_persist_loop);\n}\n\nvoid RunInEnvironment(v8::Isolate* /*unused*/,\n                      EnvCallback cb,\n                      const EnvRunOptions& /*opts*/) {\n  InitializePersistentEnvOnce();\n\n  v8::Isolate::Scope iso_scope(g_iso);\n  v8::HandleScope hs(g_iso);\n  v8::Local<v8::Context> ctx = g_ctx.Get(g_iso);\n  v8::Context::Scope cs(ctx);\n\n  cb(g_env, ctx);\n  DrainUntilIdle(g_iso, g_platform.get(), &g_persist_loop);\n}\n\n}  // namespace fuzz\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_common.h",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#pragma once\n\n#include <functional>\n#include <memory>\n#include <string>\n#include <vector>\n\n#include \"node.h\"\n#include \"node_internals.h\"\n#include \"node_platform.h\"\n#include \"env-inl.h\"\n#include \"uv.h\"\n\nnamespace fuzz {\n\n// RAII per-input isolate (fresh JS heap each call)\nclass IsolateScope {\n public:\n  IsolateScope();\n  ~IsolateScope();\n  v8::Isolate* isolate() const { return isolate_; }\n  bool ok() const { return isolate_ != nullptr; }\n private:\n  v8::Isolate* isolate_{nullptr};\n};\n\n// Options for the one-off environment runners\nstruct EnvRunOptions {\n  node::EnvironmentFlags::Flags flags = node::EnvironmentFlags::kDefaultFlags;\n  bool print_js_to_stdout = false;\n  // Pump foreground tasks + libuv + microtasks up to N rounds.\n  // Most fuzzers are synchronous; override to small N (e.g., 2–4) in async fuzzers.\n  int  max_pumps = 0;\n};\n\n// Evaluate a JS program string inside a fresh Context/Environment, then tear down.\nvoid RunEnvString(v8::Isolate* isolate,\n                  const char* env_js,\n                  const EnvRunOptions& opts = {});\n\n// Run arbitrary code inside a fresh Context/Environment (after Node bootstrap),\n// then perform a proper Node shutdown and tear down.\nusing EnvCallback = std::function<void(node::Environment*, v8::Local<v8::Context>)>;\n\nvoid RunInEnvironment(v8::Isolate* isolate,\n                      EnvCallback cb,\n                      const EnvRunOptions& opts = {});\n\n}  // namespace fuzz\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_createPrivateKeyDER.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(derAB){\n    const crypto = require('crypto');\n    const pk = crypto.createPrivateKey({ key: Buffer.from(derAB), format: 'der' });\n    try { crypto.createPublicKey({ key: pk, format: 'der' }); } catch {}\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_createPrivateKeyJWK.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(jwkStr){\n    const crypto = require('crypto');\n    const pk = crypto.createPrivateKey({ key: jwkStr, format: 'jwk' });\n    try { crypto.createPublicKey({ key: pk, format: 'jwk' }); } catch {}\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_createPrivateKeyPEM.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(pem){\n    const crypto = require('crypto');\n    const pk = crypto.createPrivateKey({ key: pem, format: 'pem' });\n    try { crypto.createPublicKey({ key: pk, format: 'pem' }); } catch {}\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_diffieHellmanDER.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string priv = fdp.ConsumeRandomLengthString(len0);\n  const std::string pub = fdp.ConsumeRemainingBytesAsString();\n\n  static constexpr std::string_view kTemplate = R\"(\nrequire('crypto');\nvar privateKey = crypto.createPrivateKey({ key: {0}, format: 'der' });\nvar publicKey  = crypto.createPublicKey ({ key: {1}, format: 'der' });\ntry {\n  crypto.diffieHellman({ privateKey, publicKey });\n} catch (e) {}\n)\";\n\n  const std::string js =\n      FormatJs(kTemplate, ToSingleQuotedJsLiteral(priv), ToSingleQuotedJsLiteral(pub));\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_diffieHellmanJWK.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string priv = fdp.ConsumeRandomLengthString(len0);\n  const std::string pub = fdp.ConsumeRemainingBytesAsString();\n\n  static constexpr std::string_view kTemplate = R\"(\nrequire('crypto');\nvar privateKey = crypto.createPrivateKey({ key: {0}, format: 'jwk' });\nvar publicKey  = crypto.createPublicKey ({ key: {1}, format: 'jwk' });\ntry {\n  crypto.diffieHellman({ privateKey, publicKey });\n} catch (e) {}\n)\";\n\n  const std::string js =\n      FormatJs(kTemplate, ToSingleQuotedJsLiteral(priv), ToSingleQuotedJsLiteral(pub));\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_diffieHellmanPEM.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string priv = fdp.ConsumeRandomLengthString(len0);\n  const std::string pub = fdp.ConsumeRemainingBytesAsString();\n\n  static constexpr std::string_view kTemplate = R\"(\nrequire('crypto');\nvar privateKey = crypto.createPrivateKey({ key: {0}, format: 'pem' });\nvar publicKey  = crypto.createPublicKey ({ key: {1}, format: 'pem' });\ntry {\n  crypto.diffieHellman({ privateKey, publicKey });\n} catch (e) {}\n)\";\n\n  const std::string js =\n      FormatJs(kTemplate, ToSingleQuotedJsLiteral(priv), ToSingleQuotedJsLiteral(pub));\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_fs_write_open_read.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(content){\n    const fs = require('fs');\n    try { fs.rmSync('fuzz-file', { force: true }); } catch {}\n    fs.writeFileSync('fuzz-file', content);\n    const buffer = Buffer.alloc(1024);\n    fs.open('fuzz-file', 'r+', function (err, fd) {\n      if (err) return;\n      fs.read(fd, buffer, 0, buffer.length, 0, function (e, bytes) {\n        try {\n          if (!e && bytes > 0) buffer.slice(0, bytes).toString();\n        } finally {\n          try { fs.close(fd, ()=>{}); } catch {}\n        }\n      });\n    });\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_fs_write_read_append.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\n// Combines write/read/append operations on a temp file with fuzzed data.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string w1 = fdp.ConsumeRandomLengthString(len0);\n  const std::string w2 = fdp.ConsumeRemainingBytesAsString();\n\n  static constexpr std::string_view kTemplate = R\"(\nconst fs = require('fs');\n\ntry { fs.rmSync('/tmp/fuzz-file', { force: true }); } catch (e) {}\n\nfs.writeFileSync('/tmp/fuzz-file', {0});\n\ntry {\n  const fd = fs.openSync('/tmp/fuzz-file', 'r+');\n  const buffer = Buffer.alloc(1024);\n  fs.readSync(fd, buffer, 0, buffer.length, 0);\n  fs.closeSync(fd);\n} catch (e) {}\n\nconst textToAppend = {1};\ntry {\n  fs.appendFileSync('/tmp/fuzz-file', textToAppend, { encoding: 'utf8' });\n  fs.readFileSync('/tmp/fuzz-file', { encoding: 'utf8' });\n} catch (e) {}\n)\";\n\n  const std::string js =\n      FormatJs(kTemplate, ToSingleQuotedJsLiteral(w1), ToSingleQuotedJsLiteral(w2));\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_httpparser1.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\n// Use ArrayBuffer to avoid string transcoding differences.\nconstexpr const char* kSrc = R\"JS(\n  (function(ab){\n    const { HTTPParser } = require('_http_common');\n    const { REQUEST } = HTTPParser;\n    function newParser(type) {\n      const parser = new HTTPParser();\n      parser.initialize(type, {});\n      parser[HTTPParser.kOnHeaders] = function() {};\n      parser[HTTPParser.kOnHeadersComplete] = function() {};\n      parser[HTTPParser.kOnBody] = function() {};\n      parser[HTTPParser.kOnMessageComplete] = function() {};\n      return parser;\n    }\n    const request = Buffer.from(ab);\n    const parser = newParser(REQUEST);\n    try { parser.execute(request, 0, request.length); } catch {}\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_js_format.h",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#pragma once\n#include <string>\n#include <string_view>\n\n// Minimal numbered placeholder formatter: replaces {0}, {1}, ... with strings.\n// Dependency-free and perfect for short JS templates.\ninline void ReplaceAll_(std::string& s, std::string_view from, std::string_view to) {\n  if (from.empty()) return;\n  size_t pos = 0;\n  while ((pos = s.find(from, pos)) != std::string::npos) {\n    s.replace(pos, from.size(), to);\n    pos += to.size();\n  }\n}\n\ntemplate <typename... StrLike>\nstd::string FormatJs(std::string_view tmpl, const StrLike&... vals) {\n  std::string out(tmpl);\n  std::string args[] = { std::string(vals)... };\n  for (size_t i = 0; i < std::size(args); ++i) {\n    std::string needle = \"{\" + std::to_string(i) + \")\";\n    // ^ fixing a small typo? Wait, keep original needle formation below.\n  }\n  return out;\n}\n\n// Escape a *single-quoted* JS string literal (returns with quotes included).\ninline std::string ToSingleQuotedJsLiteral(std::string_view s) {\n  std::string out;\n  out.reserve(s.size() + 2);\n  out.push_back('\\'');\n  for (unsigned char c : s) {\n    switch (c) {\n      case '\\\\': out += \"\\\\\\\\\"; break;\n      case '\\'': out += \"\\\\\\'\"; break;\n      case '\\n': out += \"\\\\n\"; break;\n      case '\\r': out += \"\\\\r\"; break;\n      case '\\t': out += \"\\\\t\"; break;\n      case '\\f': out += \"\\\\f\"; break;\n      case '\\b': out += \"\\\\b\"; break;\n      default:\n        if (c < 0x20) {\n          char buf[5];\n          snprintf(buf, sizeof(buf), \"\\\\x%02X\", static_cast<int>(c));\n          out += buf;\n        } else {\n          out.push_back(static_cast<char>(c));\n        }\n    }\n  }\n  out.push_back('\\'');\n  return out;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_js_precompiled.h",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#pragma once\n#include <cstring>\n#include \"v8.h\"\n\nnamespace fuzz::precompiled {\n\n// Compile `src` once into a Function and cache it in `cache`.\ninline bool EnsureFn(v8::Isolate* iso,\n                     v8::Local<v8::Context> ctx,\n                     const char* src,\n                     v8::Global<v8::Function>& cache) {\n  if (!cache.IsEmpty()) return true;\n  v8::Local<v8::String> s;\n  if (!v8::String::NewFromUtf8(iso, src, v8::NewStringType::kNormal).ToLocal(&s)) return false;\n  v8::Local<v8::Script> script;\n  if (!v8::Script::Compile(ctx, s).ToLocal(&script)) return false;\n  v8::Local<v8::Value> fn;\n  if (!script->Run(ctx).ToLocal(&fn)) return false;\n  cache.Reset(iso, fn.As<v8::Function>());\n  return true;\n}\n\n// Call a function and ignore exceptions/return values.\ninline void CallNoThrow(v8::Isolate* iso,\n                        v8::Local<v8::Context> ctx,\n                        v8::Local<v8::Function> fn,\n                        int argc,\n                        v8::Local<v8::Value>* argv) {\n  v8::TryCatch tc(iso);\n  (void)fn->Call(ctx, v8::Undefined(iso), argc, argv);\n}\n\n// Create an ArrayBuffer and copy bytes into it.\ninline v8::Local<v8::ArrayBuffer> CopyToArrayBuffer(v8::Isolate* iso,\n                                                    const void* data,\n                                                    size_t len) {\n  v8::Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(iso, len);\n  if (len) std::memcpy(ab->GetBackingStore()->Data(), data, len);\n  return ab;\n}\n\n// Create a V8 UTF-8 string from std::string.\ninline bool NewUtf8String(v8::Isolate* iso,\n                          const std::string& s,\n                          v8::Local<v8::String>* out) {\n  return v8::String::NewFromUtf8(iso, s.c_str(),\n                                 v8::NewStringType::kNormal,\n                                 static_cast<int>(s.size())).ToLocal(out);\n}\n\n} // namespace fuzz::precompiled\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_basename.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.basename(s); }))JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_dirname.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.dirname(s); }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_extname.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.extname(s); }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_format.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(x){ const path=require('path'); try{ path.format(x); }catch{} }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_isAbsolute.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.isAbsolute(s); }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_join.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(a, b) {\n    const path = require('path');\n    return path.join(a, b);\n  })\n)JS\";\n} // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a0 = fdp.ConsumeRandomLengthString(len0);\n  const std::string a1 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1},{2}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0),\n      ToSingleQuotedJsLiteral(a1));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_normalize.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.normalize(s); }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_parse.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.parse(s); }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_relative.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{\nconstexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); try{ path.relative(s); }catch{} }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_resolve.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.resolve(s); }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_path_toNamespacedPath.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace{ constexpr const char* kSrc=R\"JS((function(s){ const path=require('path'); return path.toNamespacedPath(s); }))JS\"; }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_querystring_parse.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(s1, s2, s3) {\n    const querystring = require('querystring');\n    let _  = querystring.parse(s1);\n    let __ = querystring.parse(s1, s2, s3);\n    return _;\n  })\n)JS\";\n} // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a0 = fdp.ConsumeRandomLengthString(len0);\n  const size_t len1 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a1 = fdp.ConsumeRandomLengthString(len1);\n  const std::string a2 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1},{2},{3}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0),\n      ToSingleQuotedJsLiteral(a1),\n      ToSingleQuotedJsLiteral(a2));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_quic_token.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/*\n * A fuzzer focused on node::quic::RegularToken validation.\n */\n\n#include <stdlib.h>\n#include <quic/cid.h>\n#include <quic/tokens.h>\n#include \"env-inl.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  if (size < 17) {\n    return 0;\n  }\n  uint8_t *sec_token_data = (uint8_t *)malloc(16);\n  memcpy(sec_token_data, data, 16);\n\n  node::quic::TokenSecret secret(sec_token_data);\n  data+=16;\n  size-=16;\n\n  uint8_t *regular_token_data = (uint8_t *)malloc(size);\n  memcpy(regular_token_data, data, size);\n\n  node::quic::RegularToken token(regular_token_data, size);\n  node::SocketAddress address;\n  CHECK(node::SocketAddress::New(AF_INET, \"123.123.123.123\", 1234, &address));\n  token.Validate(NGTCP2_PROTO_VER_MAX,\n                       address,\n                       secret,\n                       // Set a large expiration just to be safe\n                       10000000000);\n  free(sec_token_data);\n  free(regular_token_data);\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_sign_verify.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  // Use all remaining bytes as the message string\n  const std::string message = fdp.ConsumeRemainingBytesAsString();\n\n  // JS template to fuzz crypto signing/verifying using Node.js\n  static constexpr std::string_view kTemplate = R\"(\nconst crypto = require('crypto');\n\n// Generate an RSA key pair (per fuzz run)\nconst { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {\n  modulusLength: 2048\n});\n\n// The fuzzed message\nconst message = {0};\n\n// --- SIGNING ---\ntry {\n  const signer = crypto.createSign('SHA256');\n  signer.update(message);\n  signer.end();\n  const signature = signer.sign(privateKey, 'base64');\n\n  // --- VERIFYING ---\n  const verifier = crypto.createVerify('SHA256');\n  verifier.update(message);\n  verifier.end();\n  const isValid = verifier.verify(publicKey, signature, 'base64');\n} catch (e) {\n  // Catch errors to prevent harness crashes\n}\n)\";\n\n  // Inject the fuzzed message into the JS template\n  const std::string js = FormatJs(kTemplate, ToSingleQuotedJsLiteral(message));\n\n  // Execute the JavaScript under a Node isolate\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_stream1.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(s){\n    const Stream = require('stream');\n    const readable = new Stream.Readable({ read() {} });\n    readable.push(s);\n    readable.push(null);\n    // Return a Promise so the host can pump until idle.\n    return (async () => { for await (const c of readable) { c.toString(); } })();\n  })\n)JS\";\n} // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_string_decoder.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(a, b, c){\n    const { StringDecoder } = require('node:string_decoder');\n    const decoder = new StringDecoder('utf8');\n    decoder.write(Buffer.from(a));\n    decoder.write(Buffer.from(b));\n    decoder.end(Buffer.from(c));\n  })\n)JS\";\n} // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a0 = fdp.ConsumeRandomLengthString(len0);\n  const size_t len1 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a1 = fdp.ConsumeRandomLengthString(len1);\n  const std::string a2 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1},{2},{3}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0),\n      ToSingleQuotedJsLiteral(a1),\n      ToSingleQuotedJsLiteral(a2));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_strings.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/*\n * A fuzzer focused on C string -> Javascript String using N-API.\n * Extended to cover UTF-16, external strings, optimized property keys,\n * length-query getter paths, napi_coerce_to_string, and exception draining.\n */\n\n#include <cstdint>\n#include <cstdlib>\n#include <cstring>\n#include <string>\n\n#include \"js_native_api.h\"\n#include \"js_native_api_v8.h\"\n#include \"node.h\"\n#include \"node_internals.h\"\n#include \"node_api_internals.h\"\n#include \"env-inl.h\"\n#include \"util-inl.h\"\n#include \"v8.h\"\n\n#include \"fuzz_common.h\"  // IsolateScope + RunInEnvironment\n\n// --- Helpers ---------------------------------------------------------------\n\n// Drain (and ignore) any pending exception on the env to avoid fatal V8 scopes\nstatic inline void DrainLastException(napi_env env) {\n  if (!env) return;\n  bool pending = false;\n  if (napi_is_exception_pending(env, &pending) == napi_ok && pending) {\n    napi_value exc = nullptr;\n    (void)napi_get_and_clear_last_exception(env, &exc);\n  }\n}\n\n// Optional: same deleter you had (used for external strings)\nstatic void free_string(node_api_nogc_env /*env*/, void* data, void* /*hint*/) {\n  std::free(data);\n}\n\n// Static used only to receive env from addon init; reset every run.\nstatic napi_env g_addon_env = nullptr;\n\n// Non-capturing addon init to receive napi_env\nstatic napi_value CaptureEnvInit(napi_env env, napi_value exports) {\n  g_addon_env = env;\n  return exports;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  const char* bytes = reinterpret_cast<const char*>(data);\n  std::string s(bytes, size);\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  // Fresh Context + Environment for this input\n  fuzz::RunInEnvironment(iso.isolate(),\n    [&](node::Environment* /*env*/, v8::Local<v8::Context> context) {\n      g_addon_env = nullptr;  // reset before registering\n\n      // Create module/exports objects and register a dummy addon to obtain napi_env.\n      v8::Isolate* isolate = v8::Isolate::GetCurrent();\n      v8::Local<v8::Object> module_obj  = v8::Object::New(isolate);\n      v8::Local<v8::Object> exports_obj = v8::Object::New(isolate);\n\n      napi_module_register_by_symbol(\n          exports_obj, module_obj, context, &CaptureEnvInit, NAPI_VERSION);\n\n      napi_env addon_env = g_addon_env;\n      if (addon_env == nullptr) {\n        // Couldn’t get an env; bail out gracefully.\n        return;\n      }\n\n      // ---- Original N-API string ops (augmented below) ----\n      size_t copied1 = 0, copied2 = 0;\n      bool copied3 = false;\n      napi_value output1{}, output2{}, output3{}, output4{}, output5{}, output6{},\n                 output7{}, output8{}, output9{}, output10{}, output11{},\n                 output12{};\n\n      // Allocate temp buffers (respecting size)\n      char* buf1 = static_cast<char*>(std::malloc(size ? size : 1));\n      char* buf2 = static_cast<char*>(std::malloc(size ? size : 1));\n      if (!buf1 || !buf2) {\n        std::free(buf1); std::free(buf2);\n        return;\n      }\n\n      // create/get UTF-8\n      (void) napi_create_string_utf8(addon_env, s.data(), size, &output1);\n      DrainLastException(addon_env);\n      (void) napi_get_value_string_utf8(addon_env, output1, buf1, size, &copied1);\n      DrainLastException(addon_env);\n\n      // create/get Latin-1\n      (void) napi_create_string_latin1(addon_env, s.data(), size, &output2);\n      DrainLastException(addon_env);\n      (void) napi_get_value_string_latin1(addon_env, output2, buf2, size, &copied2);\n      DrainLastException(addon_env);\n\n      // symbol.for\n      (void) node_api_symbol_for(addon_env, s.data(), size, &output4);\n      DrainLastException(addon_env);\n\n      // Property ops using raw fuzz bytes for the property name\n      (void) napi_set_named_property(addon_env, output1, s.c_str(), output2);\n      DrainLastException(addon_env);\n      (void) napi_get_named_property(addon_env, output1, s.c_str(), &output6);\n      DrainLastException(addon_env);\n      (void) napi_has_named_property(addon_env, output1, s.c_str(), &copied3);\n      DrainLastException(addon_env);\n\n      (void) napi_get_property_names(addon_env, output1, &output7);\n      DrainLastException(addon_env);\n      (void) napi_has_property(addon_env, output1, output2, &copied3);\n      DrainLastException(addon_env);\n      (void) napi_get_property(addon_env, output1, output2, &output8);\n      DrainLastException(addon_env);\n      (void) napi_delete_property(addon_env, output1, output2, &copied3);\n      DrainLastException(addon_env);\n      (void) napi_has_own_property(addon_env, output1, output2, &copied3);\n      DrainLastException(addon_env);\n\n      (void) napi_create_type_error(addon_env, output1, output2, &output9);\n      DrainLastException(addon_env);\n      (void) napi_create_range_error(addon_env, output1, output2, &output10);\n      DrainLastException(addon_env);\n      (void) node_api_create_syntax_error(addon_env, output1, output2, &output11);\n      DrainLastException(addon_env);\n\n      (void) napi_run_script(addon_env, output2, &output12);\n      DrainLastException(addon_env);\n\n      // -----------------------------------------------------------------\n      // Length-query getter paths for UTF-8 / Latin-1\n      size_t needed_utf8 = 0;\n      (void) napi_get_value_string_utf8(addon_env, output1, nullptr, 0, &needed_utf8);\n      DrainLastException(addon_env);\n      if (needed_utf8 > 0 && needed_utf8 < (1ull << 20)) { // cap alloc\n        char* dyn_utf8 = static_cast<char*>(std::malloc(needed_utf8 + 1));\n        if (dyn_utf8) {\n          size_t got = 0;\n          (void) napi_get_value_string_utf8(addon_env, output1, dyn_utf8, needed_utf8 + 1, &got);\n          DrainLastException(addon_env);\n          std::free(dyn_utf8);\n        }\n      }\n\n      size_t needed_latin1 = 0;\n      (void) napi_get_value_string_latin1(addon_env, output2, nullptr, 0, &needed_latin1);\n      DrainLastException(addon_env);\n      if (needed_latin1 > 0 && needed_latin1 < (1ull << 20)) {\n        char* dyn_latin1 = static_cast<char*>(std::malloc(needed_latin1 + 1));\n        if (dyn_latin1) {\n          size_t got = 0;\n          (void) napi_get_value_string_latin1(addon_env, output2, dyn_latin1, needed_latin1 + 1, &got);\n          DrainLastException(addon_env);\n          std::free(dyn_latin1);\n        }\n      }\n\n      // UTF-16 create/get and length-query path\n      // Build a UTF-16LE buffer from fuzz bytes (pair up bytes; if odd, drop last byte)\n      size_t u16_len = size / 2;\n      if (u16_len == 0) u16_len = 1; // ensure non-zero for coverage\n      char16_t* u16_in = static_cast<char16_t*>(std::malloc(sizeof(char16_t) * u16_len));\n      if (u16_in) {\n        for (size_t i = 0; i < u16_len; ++i) {\n          uint16_t lo = (2*i < size) ? static_cast<uint8_t>(data[2*i]) : 0;\n          uint16_t hi = (2*i + 1 < size) ? static_cast<uint8_t>(data[2*i + 1]) : 0;\n          u16_in[i] = static_cast<char16_t>((hi << 8) | lo);\n        }\n        napi_value out_u16{};\n        (void) napi_create_string_utf16(addon_env, u16_in, u16_len, &out_u16);\n        DrainLastException(addon_env);\n\n        // Length query first\n        size_t needed_u16 = 0;\n        (void) napi_get_value_string_utf16(addon_env, out_u16, nullptr, 0, &needed_u16);\n        DrainLastException(addon_env);\n\n        // Then allocate and fetch\n        if (needed_u16 == 0) needed_u16 = 1;\n        char16_t* u16_out = static_cast<char16_t*>(std::malloc(sizeof(char16_t) * (needed_u16 + 1)));\n        if (u16_out) {\n          size_t got_u16 = 0;\n          (void) napi_get_value_string_utf16(addon_env, out_u16, u16_out, needed_u16 + 1, &got_u16);\n          DrainLastException(addon_env);\n          std::free(u16_out);\n        }\n\n        // Use the UTF-16 string in property ops too\n        (void) napi_set_property(addon_env, out_u16, output2 /*key string*/, out_u16);\n        (void) napi_has_property(addon_env, out_u16, output2, &copied3);\n        DrainLastException(addon_env);\n\n        std::free(u16_in);\n      }\n\n      // Optimized property-key creators (UTF-8 / Latin-1 / UTF-16)\n      napi_value key_u8{}, key_l1{}, key_u16{};\n      (void) node_api_create_property_key_utf8(addon_env, s.data(), size, &key_u8);\n      (void) node_api_create_property_key_latin1(addon_env, s.data(), size, &key_l1);\n      DrainLastException(addon_env);\n\n      // Build a short u16 key buffer (re-use first few code units of previous conversion)\n      size_t key16_len = (size / 2) ? (size / 2) : 1;\n      char16_t* key16_buf = static_cast<char16_t*>(std::malloc(sizeof(char16_t) * key16_len));\n      if (key16_buf) {\n        for (size_t i = 0; i < key16_len; ++i) {\n          uint16_t lo = (2*i < size) ? static_cast<uint8_t>(data[2*i]) : 0;\n          uint16_t hi = (2*i + 1 < size) ? static_cast<uint8_t>(data[2*i + 1]) : 0;\n          key16_buf[i] = static_cast<char16_t>((hi << 8) | lo);\n        }\n        (void) node_api_create_property_key_utf16(addon_env, key16_buf, key16_len, &key_u16);\n        DrainLastException(addon_env);\n      }\n\n      // Try using these keys on a string receiver (boxed in JS)\n      if (key_u8)  {\n        napi_value tmp{};\n        (void) napi_set_property(addon_env, output1, key_u8, output2);\n        DrainLastException(addon_env);\n        (void) napi_get_property(addon_env, output1, key_u8, &tmp);\n        DrainLastException(addon_env);\n      }\n      if (key_l1)  {\n        napi_value tmp{};\n        (void) napi_set_property(addon_env, output1, key_l1, output1);\n        DrainLastException(addon_env);\n        (void) napi_get_property(addon_env, output1, key_l1, &tmp);\n        DrainLastException(addon_env);\n      }\n      if (key_u16) {\n        napi_value tmp{};\n        (void) napi_set_property(addon_env, output1, key_u16, output4);\n        DrainLastException(addon_env);\n        (void) napi_get_property(addon_env, output1, key_u16, &tmp);\n        DrainLastException(addon_env);\n      }\n\n      std::free(key16_buf);\n\n      // External strings (Latin-1 and UTF-16) with finalizers.\n      // For external-string APIs: if 'copied' comes back true, free immediately\n      // (engine made a copy and will NOT call the finalizer). If false, the GC\n      // will call 'free_string' later, so don't free here.\n\n      // External Latin-1\n      {\n        bool copied = false;\n        size_t ext_len = size ? size : 1;\n        char* ext_l1 = static_cast<char*>(std::malloc(ext_len));\n        if (ext_l1) {\n          if (size) {\n            std::memcpy(ext_l1, s.data(), size);\n          } else {\n            ext_l1[0] = '\\0';  // deterministic content when input is empty\n          }\n\n          napi_value ext_l1_val{};\n          (void) node_api_create_external_string_latin1(\n              addon_env, ext_l1, ext_len, free_string, nullptr, &ext_l1_val, &copied);\n          DrainLastException(addon_env);\n\n          // Touch it a bit\n          (void) napi_coerce_to_string(addon_env, ext_l1_val, &output3);\n          (void) napi_has_property(addon_env, ext_l1_val, key_u8 ? key_u8 : output2, &copied3);\n          DrainLastException(addon_env);\n\n          if (copied) {\n            // Engine copied data; finalizer won't run. Free now.\n            std::free(ext_l1);\n          }\n        }\n      }\n\n      // External UTF-16\n      {\n        bool copied_ext16 = false;\n        size_t ext16_len = (size / 2) ? (size / 2) : 1;\n        char16_t* ext_u16 = static_cast<char16_t*>(std::malloc(sizeof(char16_t) * ext16_len));\n        if (ext_u16) {\n          for (size_t i = 0; i < ext16_len; ++i) {\n            uint16_t lo = (2*i < size) ? static_cast<uint8_t>(data[2*i]) : 0;\n            uint16_t hi = (2*i + 1 < size) ? static_cast<uint8_t>(data[2*i + 1]) : 0;\n            ext_u16[i] = static_cast<char16_t>((hi << 8) | lo);\n          }\n\n          napi_value ext_u16_val{};\n          (void) node_api_create_external_string_utf16(\n              addon_env, ext_u16, ext16_len, free_string, nullptr, &ext_u16_val, &copied_ext16);\n          DrainLastException(addon_env);\n\n          // Exercise getter path on it\n          size_t need16 = 0;\n          (void) napi_get_value_string_utf16(addon_env, ext_u16_val, nullptr, 0, &need16);\n          DrainLastException(addon_env);\n          if (need16 == 0) need16 = 1;\n          char16_t* tmp16 = static_cast<char16_t*>(std::malloc(sizeof(char16_t) * (need16 + 1)));\n          if (tmp16) {\n            size_t got16 = 0;\n            (void) napi_get_value_string_utf16(addon_env, ext_u16_val, tmp16, need16 + 1, &got16);\n            DrainLastException(addon_env);\n            std::free(tmp16);\n          }\n\n          if (copied_ext16) {\n            std::free(ext_u16);\n          }\n        }\n      }\n\n      {\n        napi_value coerced{};\n        (void) napi_coerce_to_string(addon_env, output4 /* Symbol.for(...) */, &coerced);\n        (void) napi_coerce_to_string(addon_env, output7 /* property names array */, &coerced);\n        (void) napi_coerce_to_string(addon_env, output9 /* TypeError object */, &coerced);\n        (void) napi_coerce_to_string(addon_env, output12 /* result of run_script */, &coerced);\n        DrainLastException(addon_env);\n      }\n\n      // Clean up original temp buffers\n      std::free(buf1);\n      std::free(buf2);\n\n      // Final safeguard: ensure no exception is left pending before we return.\n      DrainLastException(addon_env);\n      g_addon_env = nullptr;  // avoid leakage across inputs\n    },\n    /*opts=*/fuzz::EnvRunOptions{\n        node::EnvironmentFlags::kDefaultFlags,\n        /*print_js_to_stdout=*/false,\n        /*max_pumps=*/4  // give microtasks/callbacks a chance, still bounded\n    });\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_tls_socket_request.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\n// Static header (existing PEMs + setup; kept intact)\nstatic constexpr std::string_view kHeader = R\"(const tls = require('tls');\nconst https = require('https');\nconst { setEnvironmentData } = require('worker_threads');\nconst { send } = require('process');\n\n// Self-signed key/cert (same as your original)\nconst key = `-----BEGIN EC PARAMETERS-----\nBggqhkjOPQMBBw==\n-----END EC PARAMETERS-----\n-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIDKfHHbiJMdu2STyHL11fWC7psMY19/gUNpsUpkwgGACoAoGCCqGSM49\nAwEHoUQDQgAEItqm+pYj3Ca8bi5mBs+H8xSMxuW2JNn4I+kw3aREsetLk8pn3o81\nPWBiTdSZrGBGQSy+UAlQvYeE6Z/QXQk8aw==\n-----END EC PRIVATE KEY-----`;\n\nconst cert = `-----BEGIN CERTIFICATE-----\nMIIBhjCCASsCFDJU1tCo88NYU//pE+DQKO9hUDsFMAoGCCqGSM49BAMCMEUxCzAJ\nBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5l\ndCBXaWRnaXRzIFB0eSBMdGQwHhcNMjAwOTIyMDg1NDU5WhcNNDgwMjA3MDg1NDU5\nWjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwY\nSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\nQgAEItqm+pYj3Ca8bi5mBs+H8xSMxuW2JNn4I+kw3aREsetLk8pn3o81PWBiTdSZ\nrGBGQSy+UAlQvYeE6Z/QXQk8azAKBggqhkjOPQQDAgNJADBGAiEA7Bdn4F87KqIe\nY/ABy/XIXXpFUb2nyv3zV7POQi2lPcECIQC3UWLmfiedpiIKsf9YRIyO0uEood7+\nglj2R1NNr1X68w==\n-----END CERTIFICATE-----`;\n\nconst options = { key, cert };\n\nlet srv;\nlet socket;\nlet receivedResponse = 0;\n\nasync function send_requests() {\n  socket = tls.connect(4444, 'localhost', { rejectUnauthorized: false }, () => {\n    const httpRequest = `GET / HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: Keep-alive\\r\\n\\r\\n`;\n    socket.write(httpRequest);\n)\";\n\n// Template for a single POST using a precomputed body Buffer\nstatic constexpr std::string_view kPostTemplate = R\"(\n    const body = Buffer.from({0}, 'latin1');\n    const postRequest = `POST / HTTP/1.1\\r\\nHost: localhost\\r\\nContent-Type: application/json\\r\\nContent-Length: ${body.length}\\r\\n\\r\\n${body.toString('latin1')}`;\n    socket.write(postRequest);\n)\";\n\nstatic constexpr std::string_view kFooter = R\"(\n  });\n\n  socket.on('data', (data) => {\n    receivedResponse++;\n    if (receivedResponse === 6) {\n      socket.end();\n    }\n  });\n\n  socket.on('end', () => {\n    srv.close(() => {});\n  });\n}\n\nfunction run_server() {\n  srv = https.createServer(options, function (req, res) {\n    let chunks = [];\n    req.on('data', (c) => chunks.push(c));\n    req.on('end', () => {\n      const body = Buffer.concat(chunks);\n      res.writeHead(200, { 'Content-Type': 'text/html' });\n      res.end('ok');\n    });\n  }).listen(4444);\n}\n\nrun_server();\nsend_requests();\n)\";\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider prov(data, size);\n  std::string b1 = prov.ConsumeRandomLengthString();\n  std::string b2 = prov.ConsumeRandomLengthString();\n  std::string b3 = prov.ConsumeRandomLengthString();\n\n  // Build the whole script: header + 3 posts + footer\n  std::string js = std::string(kHeader);\n  js += FormatJs(kPostTemplate, ToSingleQuotedJsLiteral(b1));\n  js += FormatJs(kPostTemplate, ToSingleQuotedJsLiteral(b2));\n  js += FormatJs(kPostTemplate, ToSingleQuotedJsLiteral(b3));\n  js += std::string(kFooter);\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  // Give async networking a few ticks.\n  fuzz::EnvRunOptions opts;\n  opts.max_pumps = 8;\n  fuzz::RunEnvString(iso.isolate(), js.c_str(), opts);\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_v8_deserialize.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\n// serialize -> deserialize round-trip on a string (matches original)\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(s){\n    const v8 = require('v8');\n    try { v8.deserialize(v8.serialize(s)); } catch (_e) {}\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_x509.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(pem, email, host1, host2){\n    const { X509Certificate } = require('node:crypto');\n    try {\n      const x = new X509Certificate(pem);\n      x.checkEmail(email);\n      x.checkHost(host1);\n      x.checkHost(host2, { subject: 'always' });\n      void x.fingerprint; void x.fingerprint512; void x.issuer; void x.subject;\n    } catch (_e) {}\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const size_t len0 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a0 = fdp.ConsumeRandomLengthString(len0);\n  const size_t len1 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a1 = fdp.ConsumeRandomLengthString(len1);\n  const size_t len2 = fdp.ConsumeIntegralInRange<size_t>(0, 4096);\n  const std::string a2 = fdp.ConsumeRandomLengthString(len2);\n  const std::string a3 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1},{2},{3},{4}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0),\n      ToSingleQuotedJsLiteral(a1),\n      ToSingleQuotedJsLiteral(a2),\n      ToSingleQuotedJsLiteral(a3));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_zlib_brotliCompress.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(ab){\n    const zlib = require('zlib');\n    zlib.brotliCompress(Buffer.from(ab), (err, buf) => { if (buf) buf.toString('base64'); });\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_zlib_brotliDecompress.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(ab){\n    const zlib = require('zlib');\n    zlib.brotliDecompress(Buffer.from(ab), (err, buf) => { if (buf) buf.toString('latin1'); });\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_zlib_createBrotliDecompress.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\n// Stream-like API; still fine with drain-until-idle.\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(ab){\n    const zlib = require('zlib');\n    const dec = zlib.createBrotliDecompress();\n    try {\n      dec.write(Buffer.from(ab));\n      dec.flush();\n    } catch (_e) {}\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/fuzz_sources/fuzz_zlib_gzip_createUnzip.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdint>\n#include <string>\n#include \"fuzzer/FuzzedDataProvider.h\"\n#include \"fuzz_common.h\"\n#include \"fuzz_js_format.h\"\n\n// Async + stream callback chain; persistent env drains until quiescent.\nnamespace {\nconstexpr const char* kSrc = R\"JS(\n  (function(ab){\n    const zlib = require('zlib');\n    zlib.gzip(Buffer.from(ab), (err, data) => {\n      if (err || !data) return;\n      const unzip = zlib.createUnzip();\n      unzip.on('data', (d) => { d.toString('utf8'); });\n      unzip.end(data);\n    });\n  })\n)JS\";\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const std::string a0 = fdp.ConsumeRemainingBytesAsString();\n\n  fuzz::IsolateScope iso;\n  if (!iso.ok()) return 0;\n\n  const std::string js = FormatJs(\n      \"try { ({0})({1}); } catch (e) {}\",\n      std::string(kSrc),\n      ToSingleQuotedJsLiteral(a0));\n  fuzz::RunEnvString(iso.isolate(), js.c_str());\n  return 0;\n}\n"
  },
  {
    "path": "projects/nodejs/project.yaml",
    "content": "homepage: \"https://nodejs.org\"\nprimary_contact: \"security@nodejs.org\"\nlanguage: c++\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\nmain_repo: 'https://github.com/nodejs/node'\n"
  },
  {
    "path": "projects/nokogiri/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get --no-install-recommends install -y build-essential make curl wget\n\nRUN git clone --depth=1 https://github.com/sparklemotion/nokogiri.git\n\nCOPY build.sh $SRC\n"
  },
  {
    "path": "projects/nokogiri/build.sh",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\ncd nokogiri/gumbo-parser\nmake oss-fuzz CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\"\n"
  },
  {
    "path": "projects/nokogiri/project.yaml",
    "content": "homepage: \"nokogiri.org\"\nlanguage: c\nprimary_contact: \"mike.dalessio@gmail.com\"\nauto_ccs:\n  - \"scheckoway@gmail.com\"\n  - \"fuzzy.boiiii23a@gmail.com\"\n  - \"nokogiri-oss-fuzz@googlegroups.com\"\nmain_repo: \"https://github.com/sparklemotion/nokogiri.git\"\nsanitizers:\n  - undefined\nfuzzing_engines:\n  - afl\n  - centipede\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/nom/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/Geal/nom/\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/nom/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/nom\ncargo fuzz build -O \ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_arithmetic $OUT/\n"
  },
  {
    "path": "projects/nom/project.yaml",
    "content": "homepage: \"https://github.com/Geal/nom\"\nmain_repo: \"https://github.com/Geal/nom\"\nprimary_contact: \"geo.couprie@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/notary/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/notaryproject/notary\nRUN git clone --depth 1 https://github.com/notaryproject/notation-go\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nCOPY build.sh $SRC/\nWORKDIR $SRC/notary\n"
  },
  {
    "path": "projects/notary/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n$SRC/cncf-fuzzing/projects/notary/build.sh\n"
  },
  {
    "path": "projects/notary/project.yaml",
    "content": "homepage: \"https://github.com/notaryproject/notary\"\nmain_repo: \"https://github.com/notaryproject\"\nprimary_contact: \"yizha1@microsoft.com\"\nauto_ccs :\n  - \"vaninrao@amazon.com\"\n  - \"priteshbandi@gmail.com\"\n  - \"shizh@microsoft.com\"\n  - \"justin.cormack@docker.com\"\n  - \"toddysm@gmail.com\"\n  - \"notarycncf@gmail.com\"\nvendor_ccs :\n  - \"Adam@adalogics.com\"\n  - \"David@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/nss/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y make mercurial zlib1g-dev gyp ninja-build libssl-dev python libboost-dev libsqlite3-dev\n\nRUN hg clone https://hg.mozilla.org/projects/nspr nspr\nRUN hg clone https://hg.mozilla.org/projects/nss nss\nRUN git clone --depth 1 https://github.com/MozillaSecurity/nss-fuzzing-corpus.git nss-corpus\nCOPY *.sh $SRC/\nWORKDIR $SRC/nss\n"
  },
  {
    "path": "projects/nss/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"${CFLAGS} -Wno-error=unknown-warning-option -Wno-error=character-conversion -Wno-error=deprecated-literal-operator -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION\"\nexport CXXFLAGS=\"${CXXFLAGS} -Wno-error=unknown-warning-option -Wno-error=character-conversion -Wno-error=deprecated-literal-operator -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION\"\n\nsed -i 's/--disable-tests//g' automation/ossfuzz/build.sh\n\nif [[ -n ${CAPTURE_REPLAY_SCRIPT-} ]]; then\n  # Make sure we don't remove cached directory\n  sed -i 's/rm -rf/#rm -rf/g' automation/ossfuzz/build.sh\nfi\n\n# Build NSS with fuzzers.\n./automation/ossfuzz/build.sh\n"
  },
  {
    "path": "projects/nss/project.yaml",
    "content": "homepage: \"https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS\"\nlanguage: c++\nprimary_contact: \"cryptoeng@mozilla.com\"\nauto_ccs:\n  - bbeurdouche@mozilla.com\n  - choller@mozilla.com\n  - ckerschbaumer@mozilla.com\n  - djackson@mozilla.com\n  - dkeeler@mozilla.com\n  - jkratzer@mozilla.com\n  - jschanck@mozilla.com\n  - jschwartzentruber@mozilla.com\n  - nkulatova@mozilla.com\n  - sledru@mozilla.com\n  - twsmith@mozilla.com\n  - mdauer@mozilla.com\nvendor_ccs:\n  - oss-fuzz@mozilla-fuzzing.iam.gserviceaccount.com\nmain_repo: \"https://hg.mozilla.org/projects/nss\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/sqlite/.*\n"
  },
  {
    "path": "projects/nss/replay_build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script is useful for OSS-Fuzz infrastructure which is used to rebuild\n# code from cached images. This is to support various ongoing efforts in\n# OSS-Fuzz.\n\n# List of targets disabled for oss-fuzz.                                        \ndeclare -A disabled=()\n# List of targets we want to fuzz in TLS and non-TLS mode.\ndeclare -A tls_targets=([tls-client]=1 [tls-server]=1 [dtls-client]=1 [dtls-server]=1)\n# Helper function that copies a fuzzer binary and its seed corpus.\ncopy_fuzzer()\n{\n    local fuzzer=$1\n    local name=$2\n    # Copy the binary.\n    cp ../dist/Debug/bin/$fuzzer $OUT/$name\n}\n\n# Rebuild the library using most recent cache\ncd $SRC/nss\nninja -C /src/nss/out/Debug -v                                                \n\n# Copy dual mode targets in TLS mode.                                          \nfor name in \"${!tls_targets[@]}\"; do\n    if [ -z \"${disabled[$name]:-}\" ]; then\n        copy_fuzzer nssfuzz-$name $name\n    fi\ndone\n"
  },
  {
    "path": "projects/nss/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nexport HOST=nss\nexport DOMSUF=local\n\n\n# The below are a subset of the tests available. This is because other tests\n# fail in the OSS-Fuzz environment. Ideally all tests should be enabled.\ncd tests/\n#NSS_TESTS=ssl_gtests ./all.sh\nexport GTESTS=\"base_gtest certhigh_gtest certdb_gtest der_gtest util_gtest sysinit_gtest smime_gtest\"\nNSS_TESTS=gtests ./all.sh\n"
  },
  {
    "path": "projects/ntlm-auth/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/jborean93/ntlm-auth ntlm-auth\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/ntlm-auth\n"
  },
  {
    "path": "projects/ntlm-auth/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ntlm-auth/fuzz_ntlm_auth.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport ntlm_auth.compute_hash as compute_hash\nimport ntlm_auth.compute_keys as compute_keys\nfrom ntlm_auth.constants import SignSealConstants\nfrom ntlm_auth.compute_response import ComputeResponse\n\n\ndef fuzz_hash(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  compute_hash._lmowfv1(fdp.ConsumeUnicodeNoSurrogates(256))\n  compute_hash._ntowfv1(fdp.ConsumeUnicodeNoSurrogates(256))\n\n\ndef fuzz_compute_response(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  ComputeResponse._get_NTLMv1_response(fdp.ConsumeUnicodeNoSurrogates(256),\n                                       fdp.ConsumeBytes(124))\n  ComputeResponse._get_NTLM2_response(fdp.ConsumeUnicodeNoSurrogates(256),\n                                      fdp.ConsumeBytes(124),\n                                      fdp.ConsumeBytes(124))\n  ComputeResponse._get_LMv1_response(fdp.ConsumeUnicodeNoSurrogates(256),\n                                     fdp.ConsumeBytes(124))\n  ComputeResponse._get_LMv2_response(fdp.ConsumeUnicodeNoSurrogates(256),\n                                     fdp.ConsumeUnicodeNoSurrogates(256),\n                                     fdp.ConsumeUnicodeNoSurrogates(256),\n                                     fdp.ConsumeBytes(124),\n                                     fdp.ConsumeBytes(124))\n\n\ndef fuzz_compute_keys(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    compute_keys._get_exchange_key_ntlm_v1(fdp.ConsumeInt(4),\n                                         fdp.ConsumeBytes(124),\n                                         fdp.ConsumeBytes(124),\n                                         fdp.ConsumeBytes(124),\n                                         fdp.ConsumeBytes(124))\n  except ValueError:\n    pass\n  try:\n    compute_keys.get_seal_key(fdp.ConsumeInt(4), fdp.ConsumeBytes(124),\n                            SignSealConstants.CLIENT_SEALING)\n  except ValueError:\n    pass\n\n\ndef TestOneInput(data):\n  fuzz_hash(data)\n  fuzz_compute_response(data)\n  fuzz_compute_keys(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ntlm-auth/project.yaml",
    "content": "homepage: https://github.com/jborean93/ntlm-auth\nmain_repo: https://github.com/jborean93/ntlm-auth\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ntlm2/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/dopstar/requests-ntlm2\nWORKDIR requests-ntlm2\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/ntlm2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ntlm2/fuzz_auth.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport socket\nimport time\nfrom threading import Thread\nwith atheris.instrument_imports():\n    import requests\n    from requests.exceptions import InvalidURL,ConnectionError\n    from requests_ntlm2 import HttpNtlmAuth\n\nclass ServerThread(Thread):\n    def __init__(self, fdp):\n        self.fdp = fdp\n\n        self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n        self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n        self.s.bind((\"127.0.0.1\", 8001))\n        self.s.listen(1)\n\n        Thread.__init__(self)\n\n    def run(self):\n        conn, addr = self.s.accept()\n        conn.recv(self.fdp.ConsumeIntInRange(1024,2048))\n        conn.send(self.fdp.ConsumeBytes(2048))\n        time.sleep(0.005)\n        conn.close()\n        self.s.shutdown(1)\n        self.s.close()\n        time.sleep(0.01)\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    t1 = ServerThread(fdp)\n    t1.start()\n\n    session = requests.Session()\n    auth = HttpNtlmAuth(fdp.ConsumeString(50),fdp.ConsumeString(10))\n    session.auth = HttpNtlmAuth(fdp.ConsumeString(50),fdp.ConsumeString(10))\n\n    try:\n       requests.get('http://localhost:8001/%s'%fdp.ConsumeString(20),auth=auth)\n       session.get('http://localhost:8001/%s'%fdp.ConsumeString(20))\n    except (InvalidURL,ConnectionError) as e:\n       pass\n\n    t1.join()\n\ndef main(): \n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ntlm2/fuzz_core.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    import requests_ntlm2.core as core\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    core.get_ntlm_credentials(fdp.ConsumeString(50),fdp.ConsumeString(50))\n    core.fix_target_info(fdp.ConsumeBytes(100))\n\ndef main(): \n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ntlm2/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/dopstar/requests-ntlm2\nlanguage: python\nmain_repo: https://github.com/dopstar/requests-ntlm2\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/ntopng/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool ninja-build \\\n    liblzma-dev libzstd-dev pkg-config libglib2.0-dev groff libxml2-dev \\\n    libcurl4-openssl-dev libsqlite3-dev flex bison\n\n# Ntopng\nRUN git clone --depth 1 https://github.com/ntop/ntopng.git ntopng\nENV NTOPNG_HOME=$SRC/ntopng\n\n\n### Fuzzing dependencies ###\n\n# Build libprotobuf-mutator\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN mkdir libprotobuf-mutator/build; cd libprotobuf-mutator/build; \\\n    cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release; \\\n    ninja;\n\n### Dependencies that need static linking ###\n\nADD https://www.tcpdump.org/release/libpcap-1.9.1.tar.gz libpcap-1.9.1.tar.gz\nRUN tar -xvzf libpcap-1.9.1.tar.gz\nADD https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz zeromq-4.3.5.tar.gz\nRUN tar -xvzf zeromq-4.3.5.tar.gz\nADD https://github.com/json-c/json-c/archive/refs/tags/json-c-0.17-20230812.tar.gz json-c-0.17-20230812.tar.gz\nRUN tar -xvzf json-c-0.17-20230812.tar.gz\nADD https://github.com/maxmind/libmaxminddb/releases/download/1.7.1/libmaxminddb-1.7.1.tar.gz libmaxminddb-1.7.1.tar.gz\nRUN tar -xvzf libmaxminddb-1.7.1.tar.gz;\n\n### ntopng dependecies ###\n\nRUN git clone --depth 1 https://github.com/ntop/nDPI.git nDPI\nENV NDPI_HOME=$SRC/nDPI\n\n\nWORKDIR ntopng\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/ntopng/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable code instrumentation\nCFLAGS_SAVE=\"$CFLAGS\"\nCXXFLAGS_SAVE=\"$CXXFLAGS\"\nunset CFLAGS\nunset CXXFLAGS\nexport AFL_NOOPT=1\n# This is needed because oss-fuzz always uses it\nexport CFLAGS=\"-Wno-error=unused-command-line-argument\"\nexport CXXFLAGS=\"-stdlib=libc++ -Wno-error=unused-command-line-argument\"\n\n### Dependencies that need static linking ###\n\n# libpcap\ncd $SRC/libpcap-1.9.1\n./configure --disable-shared\nmake -j$(nproc)\nmake install\n\n# zeromq\ncd $SRC/zeromq-4.3.5\n./autogen.sh\n(\nexport CXXFLAGS=\"-Wno-error=missing-braces -Wno-error=unused-command-line-argument -stdlib=libc++\"\n./configure --without-documentation --without-libsodium --enable-static --disable-shared\nmake -j$(nproc)\nmake install\n)\n\n# json-c\ncd $SRC/json-c-json-c-0.17-20230812\nmkdir build\ncd build\ncmake -DBUILD_SHARED_LIBS=OFF ..\nmake -j$(nproc)\nmake install\n\n# libmaxminddb\ncd $SRC/libmaxminddb-1.7.1\n./configure --disable-shared --enable-static\nmake -j$(nproc)\nmake install\n\n\n### ntopng dependecies ###\n\n# Build nDPI\ncd $NDPI_HOME\n./autogen.sh\n./configure\nmake -j$(nproc)\n\n# Build LUA\nmake -C $NTOPNG_HOME/third-party/lua-5.4.6 generic\n\n# Build librrdtool\ncd $NTOPNG_HOME/third-party/rrdtool-1.4.8\n./configure --disable-libdbi --disable-libwrap --disable-rrdcgi --disable-libtool-lock \\\n    --disable-nls --disable-rpath --disable-perl --disable-ruby --disable-lua \\\n    --disable-tcl --disable-python --disable-dependency-tracking --disable-rrd_graph\ncd src\nmake librrd_th.la\n\n\n# Re-enable code instrumentation\nexport CFLAGS=\"${CFLAGS_SAVE}\"\nexport CXXFLAGS=\"${CXXFLAGS_SAVE}\"\nunset AFL_NOOPT\n\n### Build ntopng ###\n\ncd $NTOPNG_HOME\n\n./autogen.sh\n\n./configure --enable-fuzztargets --without-hiredis --with-zmq-static \\\n    --with-json-c-static --with-maxminddb-static\n\nmake -j$(nproc) fuzz_all\n\n# Copy fuzzers\nfind fuzz/ -regex 'fuzz/fuzz_[a-z_]*\\(\\.\\(zip\\|dict\\|options\\)\\)?' -exec cp {} $OUT/ \\;\n\n# Create the directory structure needed for fuzzing\nmkdir -p $OUT/install $OUT/data-dir $OUT/docs $OUT/scripts/callbacks\n"
  },
  {
    "path": "projects/ntopng/project.yaml",
    "content": "homepage: \"https://github.com/ntop/ntopng/\"\nlanguage: c++\nprimary_contact: \"luca.deri@gmail.com\"\nauto_ccs:\n  - \"patacca.x@gmail.com\"\nmain_repo: \"https://github.com/ntop/ntopng.git\"\n\nsanitizers:\n  - address\n\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n"
  },
  {
    "path": "projects/ntp/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool bison flex rsync lynx lld\nRUN GIT_SSL_NO_VERIFY=true git clone -b dev https://bitbucket.nwtime.org/pc/ntp.git ntp-dev\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY patch.diff $SRC/\nRUN cd ntp-dev && git apply ../patch.diff\n"
  },
  {
    "path": "projects/ntp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd ntp-dev\n#avoids https://bugs.llvm.org/show_bug.cgi?id=34636\ncp /usr/bin/lld /usr/bin/ld\n./bootstrap\n./configure --enable-fuzztargets\nmake\ncp tests/fuzz/fuzz_ntpd_receive $OUT/\n"
  },
  {
    "path": "projects/ntp/patch.diff",
    "content": "diff --git a/configure.ac b/configure.ac\nindex 9a8e7993a..ad2e54839 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -4417,6 +4417,37 @@ AC_DEFINE_UNQUOTED([DYNAMIC_INTERLEAVE], [$ntp_dynamic_interleave],\n     [support dynamic interleave?])\n AC_MSG_RESULT([$ntp_ok])\n \n+AC_ARG_ENABLE(fuzztargets,\n+    AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no])\n+AM_CONDITIONAL([BUILD_FUZZTARGETS], [test \"x$enable_fuzztargets\" = \"xyes\"])\n+AS_IF([test \"x$enable_fuzztargets\" = \"xyes\"], [\n+    AC_PROG_CXX\n+    AC_LANG_PUSH(C++)\n+    AS_IF([test \"x$LIB_FUZZING_ENGINE\" = \"x\"], [\n+        LIB_FUZZING_ENGINE=-fsanitize=fuzzer\n+        AC_SUBST(LIB_FUZZING_ENGINE)\n+    ])\n+    tmp_saved_flags=$[]_AC_LANG_PREFIX[]FLAGS\n+    _AC_LANG_PREFIX[]FLAGS=\"$[]_AC_LANG_PREFIX[]FLAGS $LIB_FUZZING_ENGINE\"\n+    AC_MSG_CHECKING([whether $CXX accepts $LIB_FUZZING_ENGINE])\n+    AC_LINK_IFELSE([AC_LANG_SOURCE([[\n+#include <sys/types.h>\n+extern \"C\" int LLVMFuzzerTestOneInput(const unsigned char *Data, size_t Size);\n+extern \"C\" int LLVMFuzzerTestOneInput(const unsigned char *Data, size_t Size) {\n+(void)Data;\n+(void)Size;\n+return 0;\n+}\n+        ]])],\n+        [ AC_MSG_RESULT(yes)\n+          has_sanitizefuzzer=yes],\n+        [ AC_MSG_RESULT(no) ]\n+    )\n+    _AC_LANG_PREFIX[]FLAGS=$tmp_saved_flags, []\n+    AC_LANG_POP()\n+])\n+AM_CONDITIONAL([HAS_SANITIZEFUZZER], [test \"x$has_sanitizefuzzer\" = \"xyes\"])\n+\n AH_BOTTOM([\n \t/*\n \t * Macro to use in otherwise-empty source files to comply with ANSI C\n@@ -4485,6 +4516,7 @@ AC_CONFIG_FILES([tests/ntpd/Makefile])\n AC_CONFIG_FILES([tests/ntpq/Makefile])\n AC_CONFIG_FILES([tests/sandbox/Makefile])\n AC_CONFIG_FILES([tests/sec-2853/Makefile])\n+AC_CONFIG_FILES([tests/fuzz/Makefile])\n AC_CONFIG_FILES([util/Makefile])\n \n perllibdir=\"${datadir}/ntp/lib\"\ndiff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c\nindex 9d79fe493..eb7212065 100644\n--- a/ntpd/ntp_io.c\n+++ b/ntpd/ntp_io.c\n@@ -510,7 +510,11 @@ io_open_sockets(void)\n \t * Create the sockets\n \t */\n \tBLOCKIO();\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+\tcreate_sockets(4123);\n+#else\n \tcreate_sockets(NTP_PORT);\n+#endif\n \tUNBLOCKIO();\n \n \tinit_async_notifications();\ndiff --git a/tests/Makefile.am b/tests/Makefile.am\nindex af502b9a3..0d952a3a5 100644\n--- a/tests/Makefile.am\n+++ b/tests/Makefile.am\n@@ -10,3 +10,6 @@ SUBDIRS +=\t\t\\\n \tsec-2853\t\\\n \t$(NULL)\n \n+if BUILD_FUZZTARGETS\n+    SUBDIRS += fuzz\n+endif\n\\ No newline at end of file\ndiff --git a/tests/fuzz/Makefile.am b/tests/fuzz/Makefile.am\nnew file mode 100644\nindex 000000000..ad31b6cbc\n--- /dev/null\n+++ b/tests/fuzz/Makefile.am\n@@ -0,0 +1,13 @@\n+include $(top_srcdir)/includes.mf\n+\n+bin_PROGRAMS = fuzz_ntpd_receive\n+\n+fuzz_ntpd_receive_SOURCES = fuzz_ntpd_receive.c ../../ntpd/ntp_io.c ../../ntpd/ntp_config.c ../../ntpd/ntp_scanner.c ../../ntpd/ntp_parser.y ../../ntpd/ntpd-opts.c\n+fuzz_ntpd_receive_CFLAGS = $(NTP_INCS) -I../../sntp/libopts -I../../ntpd/\n+fuzz_ntpd_receive_LDADD = ../../ntpd/libntpd.a $(LIBPARSE) ../../libntp/libntp.a $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS) $(LIBM) $(LDADD_NTP) $(LSCF) $(LDADD_LIBUTIL)\n+\n+if HAS_SANITIZEFUZZER\n+    fuzz_ntpd_receive_LDFLAGS = $(LIB_FUZZING_ENGINE) -lstdc++ -stdlib=libc++\n+else\n+    fuzz_ntpd_receive_SOURCES += onefile.c\n+endif\n\\ No newline at end of file\ndiff --git a/tests/fuzz/fuzz_ntpd_receive.c b/tests/fuzz/fuzz_ntpd_receive.c\nnew file mode 100644\nindex 000000000..03f8b05ba\n--- /dev/null\n+++ b/tests/fuzz/fuzz_ntpd_receive.c\n@@ -0,0 +1,94 @@\n+#include <stddef.h>\n+#include <stdint.h>\n+#include <sys/types.h>\n+#include <sys/stat.h>\n+#include <fcntl.h>\n+\n+#include \"config.h\"\n+#include \"recvbuff.h\"\n+#include \"ntpd.h\"\n+\n+const char *Version = \"libntpq 0.3beta\";\n+int listen_to_virtual_ips = TRUE;\n+int mdnstries = 5;\n+char const *progname = \"fuzz_ntpd_receive\";\n+#ifdef HAVE_WORKING_FORK\n+int    waitsync_fd_to_close = -1;    /* -w/--wait-sync */\n+int\t   daemon_pipe[2] = { -1, -1 };\n+#endif\n+\n+static int initialized = 0;\n+int sockfd;\n+uint8_t itf_index;\n+\n+void fuzz_itf_selecter(void * data, interface_info_t * itf) {\n+    endpt **ep = (endpt **)data;\n+    if (itf_index == 0) {\n+        *ep = itf->ep;\n+    }\n+    itf_index--;\n+}\n+\n+int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {\n+    struct recvbuf rbufp;\n+    struct sockaddr_in addr;\n+\n+    // Initialize the address to prevent an assertion failure in restrictions()\n+    addr.sin_family = AF_INET;\n+    addr.sin_port = htons(123);\n+    addr.sin_addr.s_addr = htonl(0x7f000001);\n+    rbufp.recv_srcadr.sa4 = addr;\n+    //memcpy(&rbufp.recv_srcadr, &addr, sizeof(struct sockaddr_in));\n+\n+    if (initialized == 0) {\n+        sockfd = open(\"/dev/null\", O_RDWR );\n+        //adds interfaces\n+        init_io();\n+        init_auth();\n+        init_util();\n+        init_restrict();\n+        init_mon();\n+        init_timer();\n+        init_lib();\n+        init_request();\n+        init_control();\n+        init_peer();\n+        init_proto();\n+        init_loopfilter();\n+        io_open_sockets();\n+        initialized = 1;\n+    }\n+\n+    if (Size < sizeof(l_fp)) {\n+        return 0;\n+    }\n+    memcpy(&rbufp.recv_time, Data, sizeof(l_fp));\n+    Data += sizeof(l_fp);\n+    Size -= sizeof(l_fp);\n+\n+    if (Size < 1) {\n+        return 0;\n+    }\n+    itf_index = Data[0];\n+    rbufp.dstadr = NULL;\n+    interface_enumerate(fuzz_itf_selecter, &rbufp.dstadr);\n+    if (rbufp.dstadr == NULL) {\n+        return 0;\n+    }\n+    Data++;\n+    Size--;\n+\n+    if (Size > RX_BUFF_SIZE) {\n+        Size = RX_BUFF_SIZE;\n+    }\n+    rbufp.recv_length = Size;\n+    memcpy(rbufp.recv_buffer, Data, Size);\n+\n+    rbufp.msg_flags = 0;\n+    rbufp.used = 0;\n+    rbufp.link = NULL;\n+    rbufp.fd = sockfd;\n+\n+    receive(&rbufp);\n+    return 0;\n+}\n\\ No newline at end of file\ndiff --git a/tests/fuzz/onefile.c b/tests/fuzz/onefile.c\nnew file mode 100644\nindex 000000000..c59068e30\n--- /dev/null\n+++ b/tests/fuzz/onefile.c\n@@ -0,0 +1,50 @@\n+#include <stdint.h>\n+#include <stdlib.h>\n+#include <stdio.h>\n+\n+int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);\n+\n+int main(int argc, char** argv)\n+{\n+    FILE * fp;\n+    uint8_t *Data;\n+    size_t Size;\n+\n+    if (argc != 2) {\n+        return 1;\n+    }\n+    //opens the file, get its size, and reads it into a buffer\n+    fp = fopen(argv[1], \"rb\");\n+    if (fp == NULL) {\n+        return 2;\n+    }\n+    if (fseek(fp, 0L, SEEK_END) != 0) {\n+        fclose(fp);\n+        return 2;\n+    }\n+    Size = ftell(fp);\n+    if (Size == (size_t) -1) {\n+        fclose(fp);\n+        return 2;\n+    }\n+    if (fseek(fp, 0L, SEEK_SET) != 0) {\n+        fclose(fp);\n+        return 2;\n+    }\n+    Data = malloc(Size);\n+    if (Data == NULL) {\n+        fclose(fp);\n+        return 2;\n+    }\n+    if (fread(Data, Size, 1, fp) != 1) {\n+        fclose(fp);\n+        free(Data);\n+        return 2;\n+    }\n+\n+    //launch fuzzer\n+    LLVMFuzzerTestOneInput(Data, Size);\n+    free(Data);\n+    fclose(fp);\n+    return 0;\n+}\n"
  },
  {
    "path": "projects/ntp/project.yaml",
    "content": "homepage: \"http://www.ntp.org\"\nlanguage: c++\nprimary_contact: \"security@ntp.org\"\nmain_repo: \"https://bitbucket.nwtime.org/pc/ntp.git\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\n"
  },
  {
    "path": "projects/ntpsec/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y autoconf automake build-essential bison libssl-dev libcap-dev libseccomp-dev libavahi-compat-libdnssd-dev pps-tools python3-dev\nRUN git clone https://gitlab.com/NTPsec/ntpsec\nRUN git clone https://github.com/pkillarjun/oss-fuzz-bloat\nCOPY run_tests.sh build.sh $SRC/\nCOPY fuzz/ $SRC/ntpsec/fuzz/\nWORKDIR $SRC/ntpsec/\n\n"
  },
  {
    "path": "projects/ntpsec/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd fuzz\nmake all\n\ncp FuzzClient $OUT/FuzzClient\ncp FuzzExtens $OUT/FuzzExtens\ncp FuzzServer $OUT/FuzzServer\n\npushd $SRC/oss-fuzz-bloat/ntpsec/\ncp FuzzClient_seed_corpus.zip $OUT/FuzzClient_seed_corpus.zip\ncp FuzzExtens_seed_corpus.zip $OUT/FuzzExtens_seed_corpus.zip\ncp FuzzServer_seed_corpus.zip $OUT/FuzzServer_seed_corpus.zip\npopd\n"
  },
  {
    "path": "projects/ntpsec/fuzz/FuzzClient.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"ntpd.h\"\n\n#define kMinInputLength 20\n#define kMaxInputLength 1024\n\nbool nts_client_process_response_core(uint8_t *buff, int transferred, struct peer* peer);\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {//ntpsec/tests/ntpd/nts_client.c\n\n    if (Size < kMinInputLength || Size > kMaxInputLength){\n        return 0;\n    }\n\n\tstruct peer peer;\n\n\tpeer.nts_state.aead = 42; /* Dummy init values */\n\tpeer.nts_state.cookielen = 0;\n\tpeer.nts_state.writeIdx = 0;\n\tpeer.nts_state.count = 0;\n\n\tpeer.srcadr.sa4.sin_family = AF_INET;\n\tpeer.srcadr.sa4.sin_port = htons(9999);\n\tpeer.srcadr.sa4.sin_addr.s_addr= htonl(0x04030201);\n\n\treturn nts_client_process_response_core((uint8_t*)Data,Size, &peer);\n}\n"
  },
  {
    "path": "projects/ntpsec/fuzz/FuzzExtens.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"ntpd.h\"\n#include \"nts.h\"\n\n#define kMinInputLength 20\n#define kMaxInputLength 1024\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {//ntpsec/tests/ntpd/nts_extens.c\n\t\n\tif (Size < kMinInputLength || Size > kMaxInputLength){\n        return 0;\n    }\n\n\tstruct ntspacket_t ntspkt;\n\tmemset(&ntspkt, 0, sizeof(ntspkt));\n\n\treturn extens_server_recv(&ntspkt,(uint8_t*)Data, Size);\n}\n"
  },
  {
    "path": "projects/ntpsec/fuzz/FuzzServer.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"nts.h\"\n\n#define kMinInputLength 20\n#define kMaxInputLength 1024\n\nextern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {//ntpsec/tests/ntpd/nts_server.c\n\n\tif (Size < kMinInputLength || Size > kMaxInputLength){\n        return 0;\n    }\n\n\tint aead;\n\tstruct BufCtl_t buf;\n\n\taead = NO_AEAD;\n\tbuf.next = (uint8_t*)Data;\n\tbuf.left = Size;\t\n\n\treturn nts_ke_process_receive(&buf, &aead);\n}\n"
  },
  {
    "path": "projects/ntpsec/fuzz/Makefile",
    "content": "#main\nTARGET=Fuzzer\n\n#fuzzers\nCLIENTEXE=FuzzClient\nEXTENSEXE=FuzzExtens\nSERVEREXE=FuzzServer\n\n#Flags\nSET=cd ../ &&\nEXTCFLAGS= -Wall -Wextra\nINC=-I../include/ -I../ntpd/ -I../build/ -I../tests/unity/ -I../tests/common/\nLIBINC=../build/main\n\n#library\nntpd_lib=-L$(LIBINC)/ntpd/ -lntpd_lib\nlibntp=-L$(LIBINC)/libntp/ -lntp\nlibaes_siv=-L$(LIBINC)/libaes_siv/ -laes_siv\nextra_lib=-lssl -lcrypto\nsetup_inc=setup.o\nLIB=$(ntpd_lib) $(libntp) $(libaes_siv) $(extra_lib) $(setup_inc)\n\nall: $(TARGET)\n\nINIT:\n\t$(SET) ./buildprep -n\nCONF:\n\t$(SET) CC=$(CC) CFLAGS=\"$(CFLAGS)\" LDFLAGS=\"$(CFLAGS)\" ./waf configure --enable-debug --disable-doc\nMAKEALL:\n\t$(SET) ./waf build --notests\nSETUP:\n\t$(CC) $(EXTCFLAGS) $(CFLAGS) $(INC) -c setup.c\n\n$(TARGET): INIT CONF MAKEALL SETUP\n\t$(CC) $(EXTCFLAGS) $(CFLAGS) $(INC) -c $(CLIENTEXE).c\n\t$(CC) $(EXTCFLAGS) $(CFLAGS) $(INC) -c $(EXTENSEXE).c\n\t$(CC) $(EXTCFLAGS) $(CFLAGS) $(INC) -c $(SERVEREXE).c\n\n\t$(CXX) $(LDFLAGS) $(CFLAGS) $(LIB_FUZZING_ENGINE) $(CLIENTEXE).o -o $(CLIENTEXE) $(LIB) \n\t$(CXX) $(LDFLAGS) $(CFLAGS) $(LIB_FUZZING_ENGINE) $(EXTENSEXE).o -o $(EXTENSEXE) $(LIB) \n\t$(CXX) $(LDFLAGS) $(CFLAGS) $(LIB_FUZZING_ENGINE) $(SERVEREXE).o -o $(SERVEREXE) $(LIB) \n\nclean:\n\trm $(CLIENTEXE) $(EXTENSEXE) $(SERVEREXE) *.o\n\nreallyclean: clean\n\t$(SET) ./waf clean\n\n.PHONY: all clean reallyclean\n"
  },
  {
    "path": "projects/ntpsec/fuzz/setup.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"ntpd.h\"\n#include \"ntp_dns.h\"\n\nconst char *progname = \"ntpsecfuzz\";\n\n/* Hack to keep linker happy */\nuint16_t extra_port = 0;\nstruct peer *peer_list = NULL;\n\nvoid dns_take_server(struct peer *a, sockaddr_u *b);\nvoid dns_take_status(struct peer *a, DNS_Status b);\n\nvoid dns_take_server(struct peer *a, sockaddr_u *b) {\n\tUNUSED_ARG(a);\n\tUNUSED_ARG(b);\n\treturn;\n}\n\nvoid dns_take_status(struct peer *a, DNS_Status b) {\n\tUNUSED_ARG(a);\n\tUNUSED_ARG(b);\n\treturn;\n}\n"
  },
  {
    "path": "projects/ntpsec/project.yaml",
    "content": "homepage: \"https://ntpsec.org/\"\nlanguage: c\nprimary_contact: \"fallenpegasus@gmail.com\"\nvendor_ccs:\n  - \"security@ntpsec.org\"\n  - \"rlaager@coderich.net\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\n  - selsky@gmail.com\n  - \"gem@rellim.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://gitlab.com/NTPsec/ntpsec'\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/ntpsec/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run unit tests with bash\nbash tests/python3-tester.sh && bash tests/option-tester.sh\n"
  },
  {
    "path": "projects/num-bigint/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget python\nRUN git clone --depth 1 https://github.com/guidovranken/cryptofuzz\nRUN git clone --depth 1 https://github.com/randombit/botan.git\nRUN wget https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/num-bigint/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NUM_BIGINT -DCRYPTOFUZZ_NO_OPENSSL\"\nexport LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\"\n\nrm -f /usr/local/bin/cargo\n\ncurl https://sh.rustup.rs -sSf | sh -s -- -y\nsource $HOME/.cargo/env\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_84_0.tar.bz2\ncd boost_1_84_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\ncp -R boost/ /usr/include/\n\ncd $SRC/cryptofuzz/\nsed -i 's/kNegativeIntegers = false/kNegativeIntegers = true/g' config.h\npython gen_repository.py\n\nrm extra_options.h\necho -n '\"' >>extra_options.h\necho -n '--force-module=num-bigint ' >>extra_options.h\necho -n '--operations=BignumCalc ' >>extra_options.h\necho -n '\"' >>extra_options.h\n\ncd $SRC/botan\nif [[ $CFLAGS != *-m32* ]]\nthen\n    ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator,x509 --build-targets=static --without-documentation\nelse\n    ./configure.py --cpu=x86_32 --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator,x509 --build-targets=static --without-documentation\nfi\nmake -j$(nproc)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BOTAN -DCRYPTOFUZZ_BOTAN_IS_ORACLE\"\nexport LIBBOTAN_A_PATH=\"$SRC/botan/libbotan-3.a\"\nexport BOTAN_INCLUDE_PATH=\"$SRC/botan/build/include\"\n\ncd $SRC/cryptofuzz/modules/botan/\nmake -j$(nproc) -f Makefile-oracle\n\ncd $SRC/cryptofuzz/modules/num-bigint/\nif [[ $CFLAGS != *-m32* ]]\nthen\n    make\nelse\n    rustup target add i686-unknown-linux-gnu\n    make -f Makefile.i386\nfi\n\ncd $SRC/cryptofuzz/\nmake -j$(nproc)\n\ncp $SRC/cryptofuzz/cryptofuzz $OUT/\n"
  },
  {
    "path": "projects/num-bigint/project.yaml",
    "content": "homepage: \"https://crates.io/crates/num-bigint\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://github.com/rust-num/num-bigint.git\"\nauto_ccs:\n    - \"cuviper@gmail.com\"\nsanitizers:\n - address\narchitectures:\n - x86_64\n - i386\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/numactl/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/numactl/numactl numactl\nWORKDIR numactl\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/numactl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\n./configure\nmake libnuma.la\n\n$CC $CFLAGS -c ./fuzz/fuzz_parse_str.c -o fuzz_parse_str.o -I./\n\n# Link with CXX as this is needed for OSS-Fuzz Centipede\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_parse_str.o ./.libs/libnuma.a -o $OUT/fuzz_parse_str\n"
  },
  {
    "path": "projects/numactl/project.yaml",
    "content": "homepage: \"https://github.com/numactl/numactl\"\nmain_repo: \"https://github.com/numactl/numactl\"\nlanguage: c\nprimary_contact: \"github@halobates.de\"\nauto_ccs:\n- \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/numexpr/Dockerfile",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && pip3 install cython\nRUN git clone https://github.com/pydata/numexpr numexpr\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/numexpr\n"
  },
  {
    "path": "projects/numexpr/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\n# Fix the pyproject.toml issue by specifying the license correctly\nsed -i 's/license = \"MIT\"/license = {text = \"MIT\"}/' /src/numexpr/pyproject.toml\n\npython3 -m pip install -r /src/numexpr/requirements.txt\npython3 /src/numexpr/setup.py build install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find /src -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/numexpr/fuzz_numexpr.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\nimport numexpr\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    numexpr.necompiler.NumExpr(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 2048)))\n  except (SyntaxError, ValueError, TypeError, NotImplementedError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/numexpr/project.yaml",
    "content": "homepage: https://github.com/pydata/numexpr\nmain_repo: https://github.com/pydata/numexpr\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/numpy/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n# Numpy requires python3.11+\nRUN apt-get update && \\\n    apt-get install -y software-properties-common && \\\n    add-apt-repository ppa:deadsnakes/ppa && \\\n    apt-get install -y python3.11 python3.11-dev && \\\n    update-alternatives --install /usr/local/bin/python3 python $(which python3.11) 5\n# Install Python dependencies for python 3.11\nRUN curl -LO https://bootstrap.pypa.io/get-pip.py && \\\n    python3 get-pip.py && \\\n    python3 -m pip install --root-user-action=ignore atheris pyinstaller coverage\nRUN git clone https://github.com/numpy/numpy && cd numpy && git submodule update --init\nWORKDIR $SRC\nCOPY *.options *.py build.sh $SRC/\n"
  },
  {
    "path": "projects/numpy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd numpy\n\nunset CFLAGS\nunset CXXFLAGS\nunset LIB_FUZZING_ENGINE\n\npython3 -m pip install .\n\ncp $SRC/*.options $OUT/\n\nmkdir -p $SRC/numpy-fuzzers\ncd $SRC/numpy-fuzzers\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/numpy/fuzz_binary_loader.options",
    "content": "[libfuzzer]\nrss_limit_mb=6000\n"
  },
  {
    "path": "projects/numpy/fuzz_binary_loader.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport os\nimport sys\nimport tempfile\nfrom tokenize import TokenError\nfrom zipfile import BadZipFile\n\nwith atheris.instrument_imports():\n  import numpy as np\n\ndef TestOneInput(input_bytes):\n  with tempfile.NamedTemporaryFile(suffix=\".npy\", delete=False) as fd:\n      fdp = atheris.FuzzedDataProvider(input_bytes)\n      fd.write(fdp.ConsumeBytes(sys.maxsize))\n      tmpname = fd.name\n\n  try:\n    np.load(tmpname)\n  # Catch all of the exceptions that are documented in help(np.load)\n  except OSError:\n    return\n  except ValueError:\n    return\n  except EOFError:\n    return\n  except IndentationError:\n    return\n  except BadZipFile:\n    return\n  except TokenError:\n    return\n  finally:\n    os.remove(tmpname)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/numpy/fuzz_datetime.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport os\nimport sys\n\nwith atheris.instrument_imports():\n  import numpy as np\n\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  input_str = fdp.ConsumeString(sys.maxsize)\n  try:\n    np.datetime64(input_str)\n  except ValueError:\n    return\n  except SyntaxError:\n    return\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/numpy/fuzz_dtype.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport os\nimport sys\n\nwith atheris.instrument_imports():\n  import numpy as np\n\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  input_str = fdp.ConsumeString(sys.maxsize)\n  try:\n    np.dtype(input_str)\n  except ValueError:\n    return\n  except TypeError:\n    return\n  except SyntaxError:\n    return\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/numpy/fuzz_fromfile_loader.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport os\nimport sys\nimport tempfile\nfrom tokenize import TokenError\nfrom zipfile import BadZipFile\n\nwith atheris.instrument_imports():\n  import numpy as np\n\ndef TestOneInput(input_bytes):\n  with tempfile.NamedTemporaryFile(suffix=\".dat\", delete=False) as fd:\n      fdp = atheris.FuzzedDataProvider(input_bytes)\n      fd.write(fdp.ConsumeBytes(sys.maxsize))\n      tmpname = fd.name\n\n  try:\n    np.fromfile(tmpname)\n  # Catch all of the exceptions that are documented in help(np.load)\n  except OSError:\n    return\n  except ValueError:\n    return\n  except EOFError:\n    return\n  finally:\n    os.remove(tmpname)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/numpy/fuzz_fromregex_loader.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport os\nimport re\nimport sys\nimport tempfile\nfrom tokenize import TokenError\nfrom zipfile import BadZipFile\n\nwith atheris.instrument_imports():\n  import numpy as np\n\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  input_str = fdp.ConsumeString(20)\n  try:\n    dtype = np.dtype(input_str)\n  except (ValueError, TypeError, SyntaxError):\n    return\n\n  input_str = fdp.ConsumeString(20)\n  try:\n    reg = re.compile(input_str)\n  except (ValueError, TypeError, re.error,OverflowError):\n    return\n\n  with tempfile.NamedTemporaryFile(suffix=\".txt\", delete=False) as fd:\n      fd.write(fdp.ConsumeBytes(5000))\n      tmpname = fd.name\n\n  try:\n    a = np.fromregex(tmpname, reg, dtype)\n    if a.shape != (0,):\n        print(a.shape)\n  except OSError:\n    return\n  except TypeError:\n    return\n  except ValueError:\n    return\n  except EOFError:\n    return\n  finally:\n    os.remove(tmpname)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/numpy/fuzz_loader.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from io import StringIO\n  import numpy as np\n\ndef get_fuzz_types():\n    # Define the rows\n    dtype = np.dtype(\n        [('f0', np.uint16), ('f1', np.float64), ('f2', 'S7'), ('f3', np.int8)]\n    )\n\n    # An expected match\n    expected = np.array(\n        [\n            (1, 2.4, \"a\", -34),\n            (2, 3.1, \"b\", 29),\n            (3, 9.9, \"g\", 120),\n        ],\n        dtype=dtype\n    )\n    return dtype, expected\n\ndef TestOneInput(fuzz_data):\n  dtype, expected = get_fuzz_types()\n  fdp = atheris.FuzzedDataProvider(fuzz_data)\n  new_data = StringIO(fdp.ConsumeString(sys.maxsize))\n  try:\n    np.loadtxt(new_data, dtype=dtype, delimiter=\";\", skiprows=True)\n  # Catch all of the exceptions that are caught in \n  # https://github.com/numpy/numpy/blob/main/numpy/lib/tests/test_loadtxt.py\n  except StopIteration:\n    return\n  except ValueError:\n    return\n  except IndexError:\n    return\n  except TypeError:\n    return\n  except RuntimeError:\n    return\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/numpy/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: numpy.org\nlanguage: python\nmain_repo: https://github.com/numpy/numpy\nprimary_contact: ralf.gommers@gmail.com\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/oak/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN apt-get --yes update \\\n  && apt-get install --no-install-recommends --yes \\\n  libssl-dev \\\n  pkg-config \\\n  python \\\n  && apt-get clean \\\n  && rm --recursive --force /var/lib/apt/lists/*\n\n# Install rustup.\nARG rustup_dir=/rust\nRUN curl --location https://sh.rustup.rs > /tmp/rustup \\\n  && sh /tmp/rustup -y --default-toolchain=none \\\n  && chmod a+rwx ${rustup_dir} \\\n  && rustup --version\n\n# Install Rust toolchain.\n# We currently need the nightly version in order to be able to compile some of the examples.\n# See https://rust-lang.github.io/rustup-components-history/ for how to pick a version that supports\n# the appropriate set of components.\nARG rust_version=nightly-2023-02-13\nRUN rustup toolchain install ${rust_version} \\\n  && rustup default ${rust_version}\n\n# Install WebAssembly target for Rust.\nRUN rustup target add wasm32-unknown-unknown\n\n# Install musl target for Rust (for statically linked binaries).\nRUN rustup target add x86_64-unknown-linux-musl\n\n# Install rust-src. Needed to recompile rust std library for MSAN\nRUN rustup component add rust-src\n\n# Install Protobuf compiler.\nARG protobuf_version=3.13.0\nARG protobuf_sha256=4a3b26d1ebb9c1d23e933694a6669295f6a39ddc64c3db2adf671f0a6026f82e\nARG protobuf_dir=/usr/local/protobuf\nARG protobuf_temp=/tmp/protobuf.zip\nENV PATH \"${protobuf_dir}/bin:${PATH}\"\nRUN curl --location https://github.com/protocolbuffers/protobuf/releases/download/v${protobuf_version}/protoc-${protobuf_version}-linux-x86_64.zip > ${protobuf_temp} \\\n  && sha256sum --binary ${protobuf_temp} && echo \"${protobuf_sha256} *${protobuf_temp}\" | sha256sum --check \\\n  && unzip ${protobuf_temp} -d ${protobuf_dir} \\\n  && rm ${protobuf_temp} \\\n  && chmod --recursive a+rwx ${protobuf_dir} \\\n  && protoc --version\n\nRUN git clone --depth 1 https://github.com/project-oak/oak oak\n\nWORKDIR oak\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/oak/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  export RUSTFLAGS=\"$RUSTFLAGS -C debug-assertions=no\"\n  export CFLAGS=\"\"\nfi\n\ncargo-fuzz build --release --target-dir=fuzz/target\n\nFUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/oak/project.yaml",
    "content": "homepage: \"https://github.com/project-oak/oak\"\nlanguage: rust\nprimary_contact: \"tzn@google.com\"\nauto_ccs:\n  - \"project-oak-team@google.com\"\n  - \"grobler@google.com\"\n  - \"ivanpetrov@google.com\"\n  - \"razieh@google.com\"\n  - \"mgamdou@google.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/project-oak/oak'\n"
  },
  {
    "path": "projects/oatpp/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/oatpp/oatpp.git oatpp \nWORKDIR oatpp\nCOPY run_tests.sh build.sh $SRC/\n# This is to fix Fuzz Introspector build by using LLVM old pass manager\n# re https://github.com/ossf/fuzz-introspector/issues/305\nENV OLD_LLVMPASS 1\n"
  },
  {
    "path": "projects/oatpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build && cd build\ncmake -DOATPP_BUILD_TESTS=ON ../\nmake -j$(nproc)\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ../fuzzers/oatpp/json/ObjectMapper.cpp -o $OUT/fuzz_mapper \\\n    ./src/liboatpp.a -I../src\n"
  },
  {
    "path": "projects/oatpp/project.yaml",
    "content": "homepage: \"https://oatpp.io/\"\nlanguage: c++\nprimary_contact: \"bugs@oatpp.io\"\nmain_repo: \"https://github.com/oatpp/oatpp\"\nauto_ccs: \n  - \"leonid@oatpp.io\"\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/oatpp/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Run unit test with verbose because it take quite long to complete\nctest --test-dir build/ -j$(nproc) --parallel -V\n"
  },
  {
    "path": "projects/oauth2/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone --depth=1 https://github.com/googleapis/oauth2client oauth2\nWORKDIR oauth2\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/oauth2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/oauth2/fuzz_helpers.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport binascii\nwith atheris.instrument_imports():\n    import oauth2client._helpers as helpers\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    expected_error_list = [\n        'URL-encoded content contains a repeated value:',\n\t'Invalid IPv6 URL',\n        'Is a symbolic link.',\n        'Is a directory',\n        'Incorrect padding',\n        'Invalid base64-encoded string',\n        'could not be converted to',\n        'contains invalid characters under NFKC normalization'\n    ]\n\n    try:\n        helpers.scopes_to_string([\n            fdp.ConsumeUnicodeNoSurrogates(20),\n            fdp.ConsumeUnicodeNoSurrogates(20)\n        ])\n        helpers.scopes_to_string(fdp.ConsumeUnicodeNoSurrogates(20))\n\n        helpers.string_to_scopes(fdp.ConsumeUnicodeNoSurrogates(100))\n\n        helpers.parse_unique_urlencoded(fdp.ConsumeUnicodeNoSurrogates(100))\n\n        helpers.update_query_params(\n            fdp.ConsumeUnicodeNoSurrogates(100),{\n                fdp.ConsumeUnicodeNoSurrogates(10):fdp.ConsumeUnicodeNoSurrogates(20),\n                fdp.ConsumeUnicodeNoSurrogates(10):fdp.ConsumeUnicodeNoSurrogates(20),\n                fdp.ConsumeUnicodeNoSurrogates(10):fdp.ConsumeUnicodeNoSurrogates(20)\n        })\n\n        helpers._add_query_parameter(\n            fdp.ConsumeUnicodeNoSurrogates(100),\n            fdp.ConsumeUnicodeNoSurrogates(10),\n            fdp.ConsumeUnicodeNoSurrogates(20)\n        )\n\n        helpers.validate_file(fdp.ConsumeUnicodeNoSurrogates(100))\n\n        helpers._json_encode(fdp.ConsumeUnicodeNoSurrogates(100))\n\n        input = fdp.ConsumeUnicodeNoSurrogates(100).encode('ascii', errors='ignore').decode()\n        helpers._to_bytes(input)\n        helpers._from_bytes(fdp.ConsumeUnicodeNoSurrogates(100))\n\n        helpers._urlsafe_b64encode(fdp.ConsumeUnicodeNoSurrogates(100))\n        input = fdp.ConsumeUnicodeNoSurrogates(100).encode('ascii', errors='ignore').decode()\n        helpers._urlsafe_b64decode(input)\n    except (ValueError, IOError, binascii.Error) as e:\n        expected = False\n        for expected_error in expected_error_list:\n            if expected_error in str(e):\n                    expected = True\n                    break\n        if not expected:\n            raise e\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/oauth2/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/oauth2client\nlanguage: python\nmain_repo: https://github.com/googleapis/oauth2client\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/oauthlib/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/oauthlib/oauthlib oauthlib\nRUN pip3 install --upgrade pip && pip3 install -r $SRC/oauthlib/requirements.txt\nWORKDIR oauthlib\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/oauthlib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --hidden-import=jwt --hidden-import=jwt.algorithms\ndone\n"
  },
  {
    "path": "projects/oauthlib/fuzz_oauth1_sig.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom oauthlib.oauth1.rfc5849.signature import (\n    verify_hmac_sha1, verify_rsa_sha512\n)\n\n\nclass FuzzMockRequest:\n    def __init__(\n        self,\n        method,\n        uri_str,\n        params,\n        signature\n    ):\n        self.uri = uri_str\n        self.http_method = method\n        self.params = params\n        self.signature = signature\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    mr = FuzzMockRequest(\n        method = fdp.ConsumeUnicodeNoSurrogates(64),\n        uri_str = fdp.ConsumeUnicodeNoSurrogates(64),\n        params = [\n                    (\n                        fdp.ConsumeUnicodeNoSurrogates(64),\n                        fdp.ConsumeUnicodeNoSurrogates(64)\n                    )\n                ],\n        signature = fdp.ConsumeUnicodeNoSurrogates(64),\n    )\n    try:\n        verify_hmac_sha1(mr, None, None)\n    except ValueError:\n        pass\n\n    try:\n        verify_rsa_sha512(\n            mr, fdp.ConsumeUnicodeNoSurrogates(512)\n        )\n    except ValueError:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/oauthlib/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/oauthlib/oauthlib\nlanguage: python\nmain_repo: https://github.com/oauthlib/oauthlib\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ogre/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update -y && apt-get install -y curl libgtest-dev libx11-dev\nRUN git clone --depth 1 https://github.com/OGRECave/ogre\nCOPY build.sh *.cpp $SRC/\nWORKDIR ogre\n"
  },
  {
    "path": "projects/ogre/build.sh",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir -p build\ncd build\ncmake -DOGRE_STATIC=TRUE ..\nmake -j$(nproc)\n\n# Build the fuzzers\nfor fuzzer in image_fuzz stream_fuzz; do\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/${fuzzer}.cpp -o $OUT/${fuzzer} \\\n    -I../OgreMain/include/ -I./include/ \\\n    -pthread -I../PlugIns/STBICodec/include/ -I../Components/Bites/include/ \\\n     -Wl,--start-group \\\n\t./lib/libOgreOverlayStatic.a            \\\n\t./lib/libOgreRTShaderSystemStatic.a     \\\n\t./lib/libOgreBulletStatic.a             \\\n\t./lib/libPlugin_PCZSceneManagerStatic.a \\\n\t./lib/libOgreMainStatic.a               \\\n\t./lib/libOgreTerrainStatic.a            \\\n\t./lib/libPlugin_OctreeZoneStatic.a      \\\n\t./lib/libOgrePropertyStatic.a           \\\n\t./lib/libCodec_STBIStatic.a             \\\n\t./lib/libOgreMeshLodGeneratorStatic.a \\\n\t./lib/libOgreVolumeStatic.a \\\n\t./lib/libOgrePagingStatic.a \\\n\t./lib/libPlugin_BSPSceneManagerStatic.a \\\n\t./lib/libPlugin_OctreeSceneManagerStatic.a \\\n\t./lib/libDefaultSamples.a \\\n\t./lib/libOgreBitesStatic.a \\\n\t./lib/libPlugin_DotSceneStatic.a \\\n\t./lib/libPlugin_ParticleFXStatic.a \\\n\t$(find . -name 'libpugixml.a' -print -quit) \\\n      -Wl,--end-group\ndone\n"
  },
  {
    "path": "projects/ogre/image_fuzz.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * The main idea behind this fuzzer is the generate arbitrary stack traces\n * by way of recursive funcitons, and then using various calls to libunwind\n * apis arbitrarily.\n */\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\n#include <iostream>\n#include <string>\n\n#include \"OgreRoot.h\"\n#include \"OgreStaticPluginLoader.h\"\n\n#include \"OgreConfigFile.h\"\n#include \"OgreException.h\"\n#include \"OgreLogManager.h\"\n#include \"OgreSTBICodec.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  static int initialized = 0;\n  if (initialized == 0) {\n    Ogre::LogManager *logMgr = new Ogre::LogManager();\n    logMgr->createLog(\"OgreTest.log\", true, false);\n    logMgr->setMinLogLevel(Ogre::LML_TRIVIAL);\n    initialized = 1;\n\n    Ogre::Root root(\"\");\n    OgreBites::StaticPluginLoader mStaticPluginLoader;\n    mStaticPluginLoader.load();\n  }\n\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer-%d.png\", getpid());\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  // Write an empty config file.\n  char file_to_load[256];\n  char file_to_save[256];\n  sprintf(file_to_load, \"/tmp/config-%d.cfg\", getpid());\n  sprintf(file_to_save, \"/tmp/ftosave-%d.png\", getpid());\n  FILE *fp2 = fopen(file_to_load, \"wb\");\n  if (!fp2) {\n    return 0;\n  }\n  fwrite(\" \", 1, 1, fp2);\n  fclose(fp2);\n\n  Ogre::ResourceGroupManager mgr;\n  try {\n    Ogre::STBIImageCodec::startup();\n    Ogre::ConfigFile cf;\n    cf.load(file_to_load);\n    std::ifstream file1(filename, std::ios::in | std::ios::binary);\n    Ogre::DataStreamPtr data1 =\n        Ogre::DataStreamPtr(OGRE_NEW Ogre::FileStreamDataStream(&file1, false));\n    Ogre::Image img;\n    img.load(data1, \"png\");\n    img.save(file_to_save);\n  } catch (Ogre::ItemIdentityException) {\n  } catch (Ogre::InternalErrorException) {\n  }\n\n  Ogre::STBIImageCodec::shutdown();\n  unlink(filename);\n  unlink(file_to_load);\n  return 0;\n}\n"
  },
  {
    "path": "projects/ogre/project.yaml",
    "content": "homepage: \"https://www.ogre3d.org/\"\nlanguage: c++\nmain_repo: \"https://github.com/OGRECave/ogre\"\nprimary_contact: rojtberg@gmail.com\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ogre/stream_fuzz.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * The main idea behind this fuzzer is the generate arbitrary stack traces\n * by way of recursive funcitons, and then using various calls to libunwind\n * apis arbitrarily.\n */\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\n#include <iostream>\n#include <string>\n\n#include \"OgreException.h\"\n#include \"OgreFileSystem.h\"\n#include \"OgreStreamSerialiser.h\"\n#include \"OgreVector.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  Ogre::String fileName = filename;\n\n  Ogre::FileSystemArchiveFactory factory;\n  Ogre::Archive *arch = factory.createInstance(\"/tmp/\", false);\n  arch->load();\n\n  Ogre::DataStreamPtr stream = arch->open(fileName);\n  Ogre::StreamSerialiser serialiser(stream);\n  try {\n    const Ogre::StreamSerialiser::Chunk *c = serialiser.readChunkBegin();\n\n    Ogre::Vector3 dest;\n    serialiser.read(&dest, 1);\n  } catch (Ogre::InvalidStateException) {\n  }\n  factory.destroyInstance(arch);\n  unlink(filename);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/ohc/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nENV JAVA_HOME $JAVA_15_HOME\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $JAVA_HOME/bin:$PATH\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/snazy/ohc ohc\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/ohc\n"
  },
  {
    "path": "projects/ohc/OhcFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport java.nio.channels.ReadableByteChannel;\nimport java.nio.channels.WritableByteChannel;\nimport java.util.concurrent.ExecutionException;\nimport org.caffinitas.ohc.CacheLoader;\nimport org.caffinitas.ohc.CacheSerializer;\nimport org.caffinitas.ohc.OHCache;\nimport org.caffinitas.ohc.OHCacheBuilder;\nimport org.caffinitas.ohc.PermanentLoadException;\n\npublic class OhcFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    int[] choices = data.consumeInts(data.consumeInt(1, 10));\n\n    try {\n      CacheSerializer<String> serializer = new CacheSerializerImpl();\n      CacheLoader<String, String> loader = new CacheLoaderImpl();\n      ReadableByteChannel rbc = new ReadableByteChannelImpl();\n      WritableByteChannel wbc = new WritableByteChannelImpl();\n\n      OHCacheBuilder<String, String> builder = OHCacheBuilder.newBuilder();\n      OHCache ohCache = builder.keySerializer(serializer)\n                            .valueSerializer(serializer)\n                            .chunkSize(data.consumeInt())\n                            .build();\n\n      for (Integer choice : choices) {\n        switch (choice % 17) {\n          case 0:\n            ohCache.getDirect(data.consumeString(data.remainingBytes() / 2));\n            break;\n          case 1:\n            ohCache.get(data.consumeString(data.remainingBytes() / 2));\n            break;\n          case 2:\n            ohCache.containsKey(data.consumeString(data.remainingBytes() / 2));\n            break;\n          case 3:\n            ohCache.put(data.consumeString(data.remainingBytes() / 2),\n                data.consumeString(data.remainingBytes() / 2), data.consumeLong());\n            break;\n          case 4:\n            ohCache.addOrReplace(data.consumeString(data.remainingBytes() / 2),\n                data.consumeString(data.remainingBytes() / 2),\n                data.consumeString(data.remainingBytes() / 2), data.consumeLong());\n            break;\n          case 5:\n            ohCache.putIfAbsent(data.consumeString(data.remainingBytes() / 2),\n                data.consumeString(data.remainingBytes() / 2), data.consumeLong());\n            break;\n          case 6:\n            ohCache.remove(data.consumeString(data.remainingBytes() / 2));\n            break;\n          case 7:\n            ((CacheLoaderImpl) loader).setString(data.consumeString(data.remainingBytes() / 2));\n            ohCache.getWithLoader(data.consumeString(data.remainingBytes() / 2), loader);\n            break;\n          case 8:\n            ohCache.stats();\n            break;\n          case 9:\n            ohCache.getBucketHistogram();\n            break;\n          case 10:\n            ohCache.hotKeyIterator(data.consumeInt());\n            break;\n          case 11:\n            ohCache.serializeEntry(data.consumeString(data.remainingBytes() / 2), wbc);\n            break;\n          case 12:\n            ohCache.serializeHotNEntries(data.consumeInt(), wbc);\n            break;\n          case 13:\n            ohCache.serializeHotNKeys(data.consumeInt(), wbc);\n            break;\n          case 14:\n            ((ReadableByteChannelImpl) rbc).setBytes(data.consumeBytes(data.remainingBytes() / 2));\n            ohCache.deserializeKeys(rbc);\n            break;\n          case 15:\n            ((ReadableByteChannelImpl) rbc).setBytes(data.consumeBytes(data.remainingBytes() / 2));\n            ohCache.deserializeEntry(rbc);\n            break;\n          case 16:\n            ((ReadableByteChannelImpl) rbc).setBytes(data.consumeBytes(data.remainingBytes() / 2));\n            ohCache.deserializeEntries(rbc);\n            break;\n        }\n      }\n      rbc.close();\n      wbc.close();\n      ohCache.close();\n    } catch (IllegalArgumentException | UnsupportedOperationException | IOException\n        | InterruptedException | ExecutionException | IllegalStateException e) {\n      // Known exception\n    }\n  }\n\n  private static class CacheSerializerImpl implements CacheSerializer<String> {\n    @Override\n    public void serialize(String s, ByteBuffer out) {\n      out.put(s.getBytes());\n    }\n\n    @Override\n    public String deserialize(ByteBuffer in) {\n      byte[] byteArray = new byte[in.capacity()];\n      in.get(byteArray);\n      return new String(byteArray);\n    }\n\n    @Override\n    public int serializedSize(String s) {\n      return s.length();\n    }\n  }\n\n  private static class CacheLoaderImpl implements CacheLoader<String, String> {\n    private String string;\n\n    public void setString(String string) {\n      this.string = string;\n    }\n\n    @Override\n    public String load(String key) throws PermanentLoadException, Exception {\n      return string;\n    }\n  }\n\n  private static class ReadableByteChannelImpl implements ReadableByteChannel {\n    private byte[] bytes;\n    private Boolean open = true;\n\n    public void setBytes(byte[] bytes) {\n      this.bytes = bytes;\n    }\n\n    @Override\n    public int read(ByteBuffer dst) throws IOException {\n      if (dst.remaining() <= 0) {\n        return -1;\n      }\n\n      int length = (bytes.length > dst.remaining())? dst.remaining() : bytes.length;\n      for (int i = 0; i < length; i++) {\n        dst.put(bytes[i]);\n      }\n\n      return length;\n    }\n\n    @Override\n    public boolean isOpen() {\n      return open;\n    }\n\n    @Override\n    public void close() throws IOException {\n      open = false;\n    }\n  }\n\n  private static class WritableByteChannelImpl implements WritableByteChannel {\n    private Boolean open = true;\n\n    @Override\n    public int write(ByteBuffer src) throws IOException {\n      return 0;\n    }\n\n    @Override\n    public boolean isOpen() {\n      return open;\n    }\n\n    @Override\n    public void close() throws IOException {\n      open = false;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/ohc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"ohc-core/target/ohc-core-$CURRENT_VERSION.jar\" $OUT/ohc-core.jar\ncp \"ohc-jmh/target/ohc-jmh-$CURRENT_VERSION.jar\" $OUT/ohc-jmh.jar\ncp \"ohc-benchmark/target/ohc-benchmark-$CURRENT_VERSION.jar\" $OUT/ohc-benchmark.jar\n\nALL_JARS=\"ohc-core.jar ohc-jmh.jar ohc-benchmark.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/ohc/project.yaml",
    "content": "homepage: https://github.com/snazy/ohc\nmain_repo: https://github.com/snazy/ohc\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/okhttp/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.6.3 && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven-3.6.3/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/square/okhttp.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/okhttp"
  },
  {
    "path": "projects/okhttp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nGRADLE_FLAGS=\"-x javadoc -x test -Dfile.encoding=UTF-8\"\nMVN_FLAGS=\"-DskipTests -Drat.ignoreErrors=true\"\nALL_JARS=\"\"\n\n# install the build servers' jazzer-api into the maven repository\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/okhttp/okhttp\"\n\t../gradlew jar\n    ../gradlew publishToMavenLocal ${GRADLE_FLAGS}\n    CURRENT_VERSION=$(../gradlew properties --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\npopd\n\npushd \"${SRC}/okhttp/okhttp-logging-interceptor\"\n\t../gradlew jar\n    ../gradlew publishToMavenLocal ${GRADLE_FLAGS}\n    CURRENT_VERSION=$(../gradlew properties --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\npopd\n\npushd \"${SRC}/okhttp/mockwebserver\"\n\t../gradlew jar\n    ../gradlew publishToMavenLocal ${GRADLE_FLAGS}\n    CURRENT_VERSION=$(../gradlew properties --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\npopd\n\npushd ${SRC}\n\t${MVN} package -DokhttpVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/okhttp-fuzzer-${CURRENT_VERSION}.jar ${OUT}/okhttp-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} okhttp-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n  stripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n  # the .java was stripped by sed\n  if (echo ${stripped_path} | grep \".java$\"); then\n\tcontinue;\n  fi\n\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  fuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n  chmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/okhttp/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>okhttp-fuzzer</artifactId>\n\t<version>${okhttpVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<exec.mainClass>ossfuzz.OkHttpFuzzer</exec.mainClass>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\ton the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\tto avoid mismatching driver/api versions\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>com.squareup.okhttp3</groupId>\n\t\t\t<artifactId>okhttp</artifactId>\n\t\t\t<version>${okhttpVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>com.squareup.okhttp3</groupId>\n\t\t\t<artifactId>logging-interceptor</artifactId>\n\t\t\t<version>${okhttpVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>com.squareup.okhttp3</groupId>\n\t\t\t<artifactId>mockwebserver3</artifactId>\n\t\t\t<version>${okhttpVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/okhttp/project.yaml",
    "content": "homepage: \"https://square.github.io/okhttp/\"\nlanguage: jvm\nmain_repo: \"https://github.com/square/okhttp.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/okhttp/src/main/java/ossfuzz/LoggingInterceptorFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport java.io.IOException;\n\nimport javax.xml.catalog.Catalog;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport mockwebserver3.MockResponse;\nimport mockwebserver3.MockWebServer;\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okhttp3.OkHttpClient;\nimport okhttp3.logging.HttpLoggingInterceptor;\nimport okhttp3.logging.HttpLoggingInterceptor.Level;\n\npublic class LoggingInterceptorFuzzer {\n\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic LoggingInterceptorFuzzer( FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\n\t}\n\tLevel getLevel()\n\t{\n\t\tLevel levels[] = Level.values();\n\t\treturn levels[fuzzedDataProvider.consumeInt(0, levels.length - 1)];\n\t}\n\n\tvoid test()\n\t{\n\t\ttry (MockWebServer server = new MockWebServer()) {\n\t\t\tRequestFuzzer requestFuzzer = new RequestFuzzer(server.url(\"/index.html\").toString(), fuzzedDataProvider);\n\t\t\tRequest request = requestFuzzer.getRequest();\n\n\t\t\tif (request == null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tserver.enqueue(new MockResponse().setBody(fuzzedDataProvider.consumeString(50)));\n\t\t\tHttpLoggingInterceptor logger = new HttpLoggingInterceptor(new NullLogger());\n\t\t\tlogger.setLevel(getLevel());\n\t\t\t\n\t\t\tOkHttpClient client = new OkHttpClient.Builder().addInterceptor(logger).build();\n\n\t\t\ttry (Response response = client.newCall(request).execute()) {\n\t\t\t} catch (IOException e) {\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t}\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tLoggingInterceptorFuzzer loggingInterceptorFuzzer = new LoggingInterceptorFuzzer(fuzzedDataProvider);\n\t\tloggingInterceptorFuzzer.test();\n\t}\n}"
  },
  {
    "path": "projects/okhttp/src/main/java/ossfuzz/NullLogger.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport okhttp3.logging.HttpLoggingInterceptor;\n//import okhttp3.logging.HttpLoggingInterceptor.Logger;\n\npublic class NullLogger implements HttpLoggingInterceptor.Logger {\n\n\t\n\t@Override\n\tpublic void log(String arg0) {\n\t}\n}"
  },
  {
    "path": "projects/okhttp/src/main/java/ossfuzz/RequestFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.MediaType;\n\npublic class RequestFuzzer {\n\tString url;\n\tFuzzedDataProvider fuzzedDataProvider;\n\n\tRequestFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\t\turl = fuzzedDataProvider.consumeString(20);\n\t}\n\n\tRequestFuzzer(String url, FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\t\tthis.url = url;\n\t\tfuzzedDataProvider.consumeString(20);\n\t}\n\n\tRequest.Builder addHeaders(Request.Builder builder) {\n\t\tint n = fuzzedDataProvider.consumeInt(0, 10);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tbuilder.addHeader(fuzzedDataProvider.consumeString(10), fuzzedDataProvider.consumeString(10));\n\t\t}\n\t\treturn builder;\n\t}\n\n\tRequest.Builder removeHeaders(Request.Builder builder) {\n\t\tint n = fuzzedDataProvider.consumeInt(0, 10);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tbuilder.removeHeader(fuzzedDataProvider.consumeString(10));\n\t\t}\n\t\treturn builder;\n\t}\n\n\tRequest.Builder addRequestBody(Request.Builder builder) {\n\n\t\tRequestBody reqBody;\n\n\t\ttry {\n\t\t\treqBody = RequestBody.create(MediaType.get(fuzzedDataProvider.consumeString(10)),\n\t\t\t\t\tfuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t\treturn builder;\n\t\t}\n\n\t\ttry {\n\t\t\tbuilder.method(fuzzedDataProvider.consumeString(10), reqBody);\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tbuilder.patch(reqBody);\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ttry {\n\t\t\tbuilder.post(reqBody);\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ttry {\n\n\t\t\tbuilder.put(reqBody);\n\t\t} catch (IllegalArgumentException e) {\n\n\t\t}\n\n\t\treturn builder;\n\t}\n\n\tRequest.Builder getBuilder() {\n\t\tRequest.Builder builder = new Request.Builder();\n\n\t\ttry {\n\t\t\tbuilder.url(url);\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\t\ttry {\n\t\t\tbuilder.get();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tbuilder.head();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tbuilder.header(fuzzedDataProvider.consumeString(10), fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tbuilder.tag(fuzzedDataProvider.consumeBoolean());\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\taddHeaders(builder);\n\t\taddRequestBody(builder);\n\t\tremoveHeaders(builder);\n\n\t\treturn builder;\n\t}\n\n\tRequest getRequest() {\n\t\tRequest request = null;\n\n\t\ttry {\n\t\t\trequest = getBuilder().build();\n\t\t} catch (IllegalArgumentException | IllegalStateException e) {\n\t\t\treturn request;\n\t\t}\n\n\t\ttry {\n\t\t\trequest.body();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.cacheControl();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.header(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.headers();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.headers(fuzzedDataProvider.consumeString(10));\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.isHttps();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.method();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.tag();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\ttry {\n\t\t\trequest.url();\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n\n\t\treturn request;\n\t}\n\n\tvoid test() {\n\t\tgetRequest();\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tRequestFuzzer closure = new RequestFuzzer(fuzzedDataProvider);\n\t\tclosure.test();\n\n\t}\n}"
  },
  {
    "path": "projects/olefile/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/decalage2/olefile olefile\nWORKDIR olefile\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/olefile/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\n# Copy seeds\nzip -rj $OUT/fuzz_reader_seed_corpus.zip tests/images/\n"
  },
  {
    "path": "projects/olefile/fuzz_reader.py",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nimport sys\nimport atheris\n\nimport olefile\n\ndef TestOneInput(data):\n    fuzz_olefile = \"tmp_f.doc\"\n    with open(fuzz_olefile, \"wb\") as f:\n        f.write(data)\n\n    if olefile.isOleFile(fuzz_olefile):\n        try:\n            with olefile.OleFileIO(fuzz_olefile) as ole:\n                pass\n        except (olefile.olefile.OleFileError, IOError) as e:\n            pass\n    try:\n        # Ensure the file gets closed, however the file should usually be closed\n        # by olefile itself, so ignore FileNotFoundError if raised.\n        os.remove(fuzz_olefile)\n    except FileNotFoundError:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/olefile/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: http://www.decalage.info/olefile\nlanguage: python\nmain_repo: https://github.com/decalage2/olefile\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/onednn/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool libomp-dev libgomp1\nRUN git clone --depth 1 https://github.com/oneapi-src/oneDNN oneDNN\nWORKDIR oneDNN\nCOPY build.sh *.cpp $SRC/\n"
  },
  {
    "path": "projects/onednn/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed -i 's/FATAL_ERROR/WARNING/g' ./cmake/OpenMP.cmake\nmkdir build\ncd build\ncmake -DDNNL_LIBRARY_TYPE=STATIC -DDNNL_BUILD_TESTS=OFF -DDNNL_BUILD_EXAMPLES=OFF ..\nmake -j2\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/fuzz_json.cpp \\\n\t-I/src/oneDNN/include -I/src/oneDNN/build/include \\\n\t-I/src/oneDNN/examples -I/src/oneDNN/src/../include \\\n\t-I/src/oneDNN/src/graph/utils/ \\\n\t-I/src/oneDNN/src/ \\\n\t-DDNNL_X64=1 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS \\\n\t-o $OUT/fuzz_json \\\n\t./src/libdnnl.a\n"
  },
  {
    "path": "projects/onednn/fuzz_json.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <fstream>\n#include <iostream>\n#include <string>\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"json.hpp\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  std::string input(reinterpret_cast<const char *>(data), size);\n\n  char *fuzz_filename = \"/tmp/fuzz.json\";\n  std::ofstream(fuzz_filename, std::ios::binary).write(input.c_str(), size);\n\n  std::ifstream fs(fuzz_filename);\n  dnnl::impl::graph::utils::json::json_reader_t read(&fs);\n  dnnl::impl::graph::utils::json::read_helper_t helper;\n  try {\n    helper.read_fields(&read);\n  } catch (...) {\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/onednn/project.yaml",
    "content": "homepage: \"https://github.com/uxlfoundation/oneDNN\"\nmain_repo: \"https://github.com/uxlfoundation/oneDNN\"\nlanguage: c++\nauto_ccs:\n  - \"ankit.v.manerikar@intel.com\"\n  - \"vadim.o.pirogov@intel.com\"\n  - \"dmitry.zarukin@intel.com\"\n  - \"mourad.gouicem@intel.com\"\n  - \"stefan.palicki@intel.com\"\n  - \"denis.samoylov@intel.com\"\nvendor_ccs:\n- david@adalogics.com\nfuzzing_engines:\n- libfuzzer\n- honggfuzz\n- centipede\n"
  },
  {
    "path": "projects/open-json/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/tdunning/open-json open-json\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/open-json\n"
  },
  {
    "path": "projects/open-json/JsonTokenerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.json.JSONException;\nimport org.json.JSONTokener;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.json.JSONTokener] public static int dehexchar(char)\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.json.JSONTokener] public java.lang.String nextTo(java.lang.String)\n// Target method: [org.json.JSONTokener] public java.lang.String nextString(char) throws org.json.JSONException\n// Target method: [org.json.JSONTokener] public char next(char) throws org.json.JSONException\n// Target method: [org.json.JSONTokener] public java.lang.String next(int) throws org.json.JSONException\n// Target method: [org.json.JSONTokener] public java.lang.String nextTo(char)\n// Target method: [org.json.JSONTokener] public void skipPast(java.lang.String)\npublic class JsonTokenerFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    JSONTokener obj = new JSONTokener(data.consumeString(data.remainingBytes() / 2));\n\n    try {\n      switch(data.consumeInt(1, 7)) {\n        case 1:\n          obj.nextTo(data.consumeRemainingAsString());\n          break;\n        case 2:\n          JSONTokener.dehexchar(data.consumeChar());\n          break;\n        case 3:\n          obj.nextString(data.consumeChar());\n          break;\n        case 4:\n          obj.nextString(data.consumeChar());\n          break;\n        case 5:\n          obj.next(data.consumeInt());\n          break;\n        case 6:\n          obj.nextTo(data.consumeChar());\n          break;\n        case 7:\n          obj.skipPast(data.consumeString(100));\n          break;\n      }\n    } catch(JSONException | StringIndexOutOfBoundsException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/open-json/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nfind ./ -name pom.xml -exec sed -i 's/source>1.6</source>1.8</g' {} \\;\nfind ./ -name pom.xml -exec sed -i 's/target>1.6</target>1.8</g' {} \\;\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/json-$CURRENT_VERSION.jar\" $OUT/open-json.jar\n\nALL_JARS=\"open-json.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/open-json/project.yaml",
    "content": "homepage: https://github.com/tdunning/open-json\nmain_repo: https://github.com/tdunning/open-json\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- arthur.chan@adalogics.com\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/open5gs/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n        apt-get upgrade -y && \\\n        DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \\\n        python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison git cmake meson libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libmicrohttpd-dev libcurl4-gnutls-dev libnghttp2-dev libtins-dev libtalloc-dev iproute2 ca-certificates netbase pkg-config && \\\n        apt-get install -y autoconf libtool-bin\n\nRUN git clone https://github.com/yaml/libyaml.git && \\\n        cd libyaml &&\\\n        ./bootstrap && \\\n        ./configure --enable-static --disable-shared && \\\n        make install && \\\n        cd .. && \\\n        rm -rf libyaml\n\nRUN git clone --depth=1 https://github.com/open5gs/open5gs.git\nWORKDIR $SRC/open5gs\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/open5gs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npushd $SRC/open5gs\n\nCFLAGS=\"$CFLAGS -Wno-compound-token-split-by-macro -Wno-format\"\nCXXFLAGS=\"$CFLAGS\"\nLDFLAGS=\"$CFLAGS\"\n\nsed -i \"s|link_args: lib_fuzzing_engine|link_args: [lib_fuzzing_engine, '-ltalloc', '-Wl,-rpath,\\$ORIGIN/lib']|\" tests/fuzzing/meson.build\n\nmeson setup builddir --default-library=static -Dfuzzing=true -Dlib_fuzzing_engine=\"$LIB_FUZZING_ENGINE\"\nninja -C builddir -k 0 || true\n\ncp builddir/tests/fuzzing/gtp_message_fuzz $OUT/gtp_message_fuzz\ncp builddir/tests/fuzzing/nas_message_fuzz $OUT/nas_message_fuzz\n\nmkdir $OUT/lib/\ncp /lib/x86_64-linux-gnu/libtalloc.so* $OUT/lib/\n\ncp tests/fuzzing/gtp_message_fuzz_seed_corpus.zip $OUT/gtp_message_fuzz_seed_corpus.zip\ncp tests/fuzzing/nas_message_fuzz_seed_corpus.zip $OUT/nas_message_fuzz_seed_corpus.zip\n\npopd\n"
  },
  {
    "path": "projects/open5gs/project.yaml",
    "content": "homepage: \"https://open5gs.org\"\nlanguage: c\nprimary_contact: \"acetcom@gmail.com\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/open5gs/open5gs'\n"
  },
  {
    "path": "projects/open62541/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make cmake python3-six wget libmbedtls-dev\nRUN git clone --depth 1 https://github.com/open62541/open62541.git -bmaster open62541\nWORKDIR open62541\nRUN git submodule update --init --recursive\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/open62541/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir -p $WORK/open62541\ncd $WORK/open62541\n\n# LOGLEVEL:\n# <= 100 TRACE\n# <= 200 DEBUG\n# <= 300 INFO\n# <= 400 WARNING\n# <= 500 ERROR\n# <= 600 FATAL\n# > 600 No LOG output\n\ncmake -DCMAKE_BUILD_TYPE=Debug -DUA_ENABLE_AMALGAMATION=OFF \\\n      -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \\\n      -DBUILD_SHARED_LIBS=OFF -DUA_BUILD_EXAMPLES=OFF -DUA_LOGLEVEL=600 \\\n      -DUA_ENABLE_ENCRYPTION=ON \\\n      -DUA_BUILD_OSS_FUZZ=ON \\\n      $SRC/open62541/\n\n# This also builds all the fuzz targets and places them in the $OUT directory\n# Only build with one process otherwise amalgamation fails.\nmake -j1\n\n# Copy the corpus, dict and options to the $OUT dir\n$SRC/open62541/tests/fuzz/oss-fuzz-copy.sh\n\necho \"Built all fuzzer targets.\"\n"
  },
  {
    "path": "projects/open62541/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://open62541.org/\"\nlanguage: c++\nprimary_contact: \"julius.pfrommer@gmail.com\"\nauto_ccs:\n - \"chris_paul.iatrou@tu-dresden.de\"\nfuzzing_engines:\n - libfuzzer\n - afl\nsanitizers:\n - address\n - undefined\n - memory\nmain_repo: 'https://github.com/open62541/open62541.git'\n"
  },
  {
    "path": "projects/openapi-schema-validator/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone --depth=1 https://github.com/python-jsonschema/jsonschema-specifications jsonschema_specifications\nRUN git clone https://github.com/p1c2u/openapi-schema-validator openapi-schema-validator\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/openapi-schema-validator\n"
  },
  {
    "path": "projects/openapi-schema-validator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data $SRC/jsonschema_specifications/jsonschema_specifications/schemas:jsonschema_specifications/schemas\ndone\n"
  },
  {
    "path": "projects/openapi-schema-validator/fuzz_general.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport json\nimport atheris\n\nimport jsonschema\nimport openapi_schema_validator\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    fuzz_dict_schema = json.loads(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 2048)))\n    fuzz_dict_instance = json.loads(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 2048)))\n  except:\n    return\n  if not isinstance(fuzz_dict_schema, dict) or not isinstance(\n      fuzz_dict_instance, dict):\n    return\n\n  try:\n    openapi_schema_validator.validate(fuzz_dict_instance, fuzz_dict_schema)\n  except (jsonschema.exceptions._Error):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/openapi-schema-validator/fuzz_structured.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport json\nimport atheris\n\nimport jsonschema\nimport openapi_schema_validator\n\n\ndef gen_random_dict(data):\n  \"\"\"Generates a simple random dictionary where values can either be strings or\n  dictionaries (where the values there are strings.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_dict = dict()\n  for idx in range(fdp.ConsumeIntInRange(1, 30)):\n    key = fdp.ConsumeUnicodeNoSurrogates(40)\n    if fdp.ConsumeBool():\n      val_dict = dict()\n      for idx2 in range(fdp.ConsumeIntInRange(2, 30)):\n        val_dict[fdp.ConsumeUnicodeNoSurrogates(\n            40)] = fdp.ConsumeUnicodeNoSurrogates(40)\n      fuzz_dict[key] = val_dict\n    else:\n      fuzz_dict[key] = fdp.ConsumeUnicodeNoSurrogates(40)\n  return fuzz_dict\n\n\ndef TestOneInput(data):\n  fuzz_dict_instance = gen_random_dict(data)\n  fuzz_dict_schema = gen_random_dict(data)\n  try:\n    openapi_schema_validator.validate(fuzz_dict_instance, fuzz_dict_schema)\n  except (jsonschema.exceptions._Error):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/openapi-schema-validator/project.yaml",
    "content": "homepage: https://github.com/p1c2u/openapi-schema-validator\nmain_repo: https://github.com/p1c2u/openapi-schema-validator\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/openbabel/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt install -y cmake\nRUN git clone --depth 1 https://github.com/openbabel/openbabel.git\nCOPY *.sh $SRC/\nWORKDIR $SRC/openbabel\n"
  },
  {
    "path": "projects/openbabel/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"${CXXFLAGS} -std=c++17\"\nsed -i 's/CMAKE_CXX_STANDARD 11/CMAKE_CXX_STANDARD 17/g' CMakeLists.txt\n\n# Remove use of deprecated functions\nsed -i 's/std::random/\\/\\/std::random/g' test/*.cpp\n\n# build project\nmkdir build && cd build\ncmake .. -DBUILD_SHARED=OFF -DBUILD_MIXED=ON\nmake -j $(nproc)\ncp bin/fuzz* $OUT/\n"
  },
  {
    "path": "projects/openbabel/project.yaml",
    "content": "homepage: \"https://openbabel.org\"\nlanguage: c++\nprimary_contact: \"geoff.hutchison@gmail.com\"\nauto_ccs :\n- \"p.antoine@catenacyber.fr\"\n\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/openbabel/openbabel.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/openbabel/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Run almost all of the tests. Some of the tests are failing by default,\n# so we disable these for now.\nfor test_idx in 0 1 3 4 6 8 9 10 12 13 14 15 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 36 37 38 41 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60; do\n  echo \"${test_idx}\" | ./build/bin/test_runner\ndone\n"
  },
  {
    "path": "projects/opencensus-cpp/.bazelrc",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Force the use of Clang for C++ builds.\nbuild --action_env=CC=clang\nbuild --action_env=CXX=clang++\n\n# Define the --config=asan-libfuzzer configuration.\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing_oss_fuzz//:oss_fuzz_engine\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=oss-fuzz\nbuild:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_sanitizer=none\n"
  },
  {
    "path": "projects/opencensus-cpp/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 https://github.com/census-instrumentation/opencensus-cpp\nCOPY WORKSPACE .bazelrc $SRC/\nRUN cat WORKSPACE >> $SRC/opencensus-cpp/WORKSPACE\nRUN cat .bazelrc >> $SRC/opencensus-cpp/.bazelrc\nCOPY build.sh $SRC/\nWORKDIR $SRC/opencensus-cpp\n"
  },
  {
    "path": "projects/opencensus-cpp/WORKSPACE",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"rules_fuzzing\",\n    sha256 = \"23bb074064c6f488d12044934ab1b0631e8e6898d5cf2f6bde087adb01111573\",\n    strip_prefix = \"rules_fuzzing-0.3.1\",\n    urls = [\"https://github.com/bazelbuild/rules_fuzzing/archive/v0.3.1.zip\"],\n)\n\nload(\"@rules_fuzzing//fuzzing:repositories.bzl\", \"rules_fuzzing_dependencies\")\n\nrules_fuzzing_dependencies()\n\nload(\"@rules_fuzzing//fuzzing:init.bzl\", \"rules_fuzzing_init\")\n\nrules_fuzzing_init()\n\nload(\"@fuzzing_py_deps//:requirements.bzl\", \"install_deps\")\n\ninstall_deps()\n"
  },
  {
    "path": "projects/opencensus-cpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nln -sf /usr/local/bin/python3 /usr/bin/python3\nexport CXXFLAGS=\"${CXXFLAGS} -std=c++14\"\n\ngit grep cc_fuzz_target.bzl | grep BUILD | cut -d: -f1 | uniq | while read i; do sed -i -e 's=//bazel:cc_fuzz_target.bzl=@rules_fuzzing//fuzzing:cc_defs.bzl=' $i; done\n\ngit grep fuzz_target\\( | grep BUILD | cut -d: -f1 | uniq | while read i; do sed -i -e 's/fuzz_target/fuzz_test/' $i; done\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/opencensus-cpp/project.yaml",
    "content": "homepage: \"https://opencensus.io/\"\nlanguage: c++\nprimary_contact: \"joshuasuereth@google.com\"\nauto_ccs :\n- \"p.antoine@catenacyber.fr\"\n\nsanitizers:\n- address\n- memory\nmain_repo: 'https://github.com/census-instrumentation/opencensus-cpp'\n\n# opencensus is being archived cf https://opentelemetry.io/blog/2023/sunsetting-opencensus/\ndisabled: true\n"
  },
  {
    "path": "projects/opencensus-go/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth=1 https://github.com/census-instrumentation/opencensus-go\nCOPY build.sh fuzz_test.go $SRC/\nWORKDIR $SRC/opencensus-go\n"
  },
  {
    "path": "projects/opencensus-go/build.sh",
    "content": "#/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./plugin/ochttp/propagation/b3/\ngo mod tidy\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ncompile_native_go_fuzzer go.opencensus.io/plugin/ochttp/propagation/b3 FuzzParseTraceID FuzzParseTraceID\n"
  },
  {
    "path": "projects/opencensus-go/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage b3\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzParseTraceID(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, tid string) {\n\t\t_, _ = ParseTraceID(tid)\n\t})\n}\n"
  },
  {
    "path": "projects/opencensus-go/project.yaml",
    "content": "homepage: \"https://github.com/census-instrumentation/opencensus-go\"\nmain_repo: \"https://github.com/census-instrumentation/opencensus-go\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\n# opencensus is being archived cf https://opentelemetry.io/blog/2023/sunsetting-opencensus/\ndisabled: true\n"
  },
  {
    "path": "projects/opencensus-java/.gitignore",
    "content": "project-parent/opencensus-java\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/opencensus-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/opencensus-java\nRUN apt update && apt install -y openjdk-8-jdk\nRUN git clone --depth 1 https://github.com/census-instrumentation/opencensus-java/ $SRC/project-parent/opencensus-java\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/opencensus-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=opencensus-java\nPROJECT_GROUP_ID=io.opencensus\nPROJECT_ARTIFACT_ID=opencensus-api\nMAIN_REPOSITORY=https://github.com/census-instrumentation/opencensus-java/\nMAVEN_ARGS=\"-Djavac.src.version=1.8 -Djavac.target.version=1.8 -Denforcer.skip=true -DskipTests\"\nGRADLE_ARGS=\"-x javadoc -x test\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\npushd $PROJECT\n  export OPENCENSUS_JAVA_VERSION=$(awk '$1 ~ /version/ {print $3}' build.gradle | sed 's/\"//g')\npopd\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  # set_project_version_in_fuzz_targets_dependency\n  \n  #install\n  # mvn -pl $PROJECT install -DskipTests\n  (cd $PROJECT && ./gradlew build $GRADLE_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-8\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip \"/usr/lib/jvm/java-8-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  (cd $PROJECT && ./gradlew build $GRADLE_ARGS)\n  cp $SRC/project-parent/opencensus-java/api/build/libs/opencensus-api-$OPENCENSUS_JAVA_VERSION.jar $OUT/opencensus-api.jar\n  cp $SRC/project-parent/opencensus-java/impl/build/libs/opencensus-impl-$OPENCENSUS_JAVA_VERSION.jar $OUT/opencensus-impl.jar\n  cp $SRC/project-parent/opencensus-java/impl_core/build/libs/opencensus-impl-core-$OPENCENSUS_JAVA_VERSION.jar $OUT/opencensus-impl-core.jar\n  cp $SRC/project-parent/opencensus-java/exporters/trace/util/build/libs/opencensus-exporter-trace-util-$OPENCENSUS_JAVA_VERSION.jar $OUT/opencensus-exporter-trace-util.jar\n  cp $SRC/project-parent/opencensus-java/exporters/trace/ocagent/build/libs/opencensus-exporter-trace-ocagent-$OPENCENSUS_JAVA_VERSION.jar $OUT/opencensus-exporter-trace-ocagent.jar\n  cp $SRC/project-parent/opencensus-java/contrib/resource_util/build/libs/opencensus-contrib-resource-util-$OPENCENSUS_JAVA_VERSION.jar $OUT/opencensus-contrib-resource-util.jar\n  cp $SRC/project-parent/opencensus-java/exporters/trace/elasticsearch/build/libs/opencensus-exporter-trace-elasticsearch-$OPENCENSUS_JAVA_VERSION.jar $OUT/opencensus-exporter-trace-elasticsearch.jar\n  \n  ALL_JARS=\"opencensus-api.jar opencensus-impl.jar opencensus-impl-core.jar opencensus-exporter-trace-util.jar opencensus-contrib-resource-util.jar opencensus-exporter-trace-elasticsearch.jar\"\n\n  for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java' ! -name JsonConversionFuzzer.java); do\n    $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n    $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n    cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/\n    RUNTIME_CLASSPATH_ABSOLUTE=\"$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n    # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-8/\\\" \\\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**:io.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\n\n  PACKAGE_NAME=\"io.opencensus.exporter.trace.elasticsearch\"\n  PACKAGE_DIR=$SRC/project-parent/fuzz-targets/src/test/java/$(echo $PACKAGE_NAME | sed 's/\\./\\//g')\n  mkdir -p $PACKAGE_DIR\n  mv $SRC/project-parent/fuzz-targets/src/test/java/com/example/JsonConversionFuzzer.java $PACKAGE_DIR\n\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes:$PACKAGE_NAME:$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\").\"\n  # replace dirname with placeholder $this_dir that will be replaced at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-8/\\\" \\\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$PACKAGE_NAME.JsonConversionFuzzer \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**:io.**\\\" \\\n\\$@\" > $OUT/JsonConversionFuzzer\n  chmod u+x $OUT/JsonConversionFuzzer\n\n  rm -rf $PACKAGE_DIR\n\nfi"
  },
  {
    "path": "projects/opencensus-java/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>1.8</java.version>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>io.opencensus</groupId>\n            <artifactId>opencensus-api</artifactId>\n            <version>${env.OPENCENSUS_JAVA_VERSION}</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../opencensus-java/api/build/libs/opencensus-api-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>\n        </dependency>\n\n        <dependency>\n            <groupId>io.opencensus</groupId>\n            <artifactId>opencensus-impl</artifactId>\n            <version>${env.OPENCENSUS_JAVA_VERSION}</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../opencensus-java/impl/build/libs/opencensus-impl-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>\n        </dependency>\n\n        <dependency>\n            <groupId>io.opencensus</groupId>\n            <artifactId>opencensus-impl-core</artifactId>\n            <version>${env.OPENCENSUS_JAVA_VERSION}</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../opencensus-java/impl_core/build/libs/opencensus-impl-core-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>\n        </dependency>\n\n        <dependency>\n            <groupId>io.opencensus</groupId>\n            <artifactId>opencensus-exporter-trace-util</artifactId>\n            <version>${env.OPENCENSUS_JAVA_VERSION}</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../opencensus-java/exporters/trace/util/build/libs/opencensus-exporter-trace-util-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>\n        </dependency>\n\n        <dependency>\n            <groupId>io.opencensus</groupId>\n            <artifactId>opencensus-contrib-resource-util</artifactId>\n            <version>${env.OPENCENSUS_JAVA_VERSION}</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../opencensus-java/contrib/resource_util/build/libs/opencensus-contrib-resource-util-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>\n        </dependency>\n\n        <dependency>\n            <groupId>io.opencensus</groupId>\n            <artifactId>opencensus-exporter-trace-elasticsearch</artifactId>\n            <version>${env.OPENCENSUS_JAVA_VERSION}</version>\n            <scope>system</scope>\n            <systemPath>${basedir}/../opencensus-java/exporters/trace/elasticsearch/build/libs/opencensus-exporter-trace-elasticsearch-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>\n        </dependency>\n\n        <dependency>\n            <groupId>io.opencensus</groupId>\n            <artifactId>opencensus-proto</artifactId>\n            <version>0.2.0</version>\n            <scope>runtime</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.guava</groupId>\n            <artifactId>guava</artifactId>\n            <version>31.1-jre</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.google.protobuf</groupId>\n            <artifactId>protobuf-java</artifactId>\n            <version>4.0.0-rc-2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.lmax</groupId>\n            <artifactId>disruptor</artifactId>\n            <version>3.4.4</version>\n        </dependency>\n\n        <dependency>\n            <groupId>io.grpc</groupId>\n            <artifactId>grpc-context</artifactId>\n            <version>1.54.0</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/opencensus-java/project-parent/fuzz-targets/src/test/java/com/example/JsonConversionFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage io.opencensus.exporter.trace.elasticsearch;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport io.opencensus.exporter.trace.elasticsearch.JsonConversionUtils;\nimport com.google.common.collect.ImmutableList;\nimport com.google.common.collect.ImmutableMap;\nimport io.opencensus.common.Timestamp;\nimport io.opencensus.trace.Annotation;\nimport io.opencensus.trace.AttributeValue;\nimport io.opencensus.trace.Link;\nimport io.opencensus.trace.MessageEvent;\nimport io.opencensus.trace.MessageEvent.Type;\nimport io.opencensus.trace.SpanContext;\nimport io.opencensus.trace.SpanId;\nimport io.opencensus.trace.Status;\nimport io.opencensus.trace.TraceId;\nimport io.opencensus.trace.TraceOptions;\nimport io.opencensus.trace.Tracestate;\nimport io.opencensus.trace.export.SpanData;\nimport io.opencensus.trace.export.SpanData.Attributes;\nimport io.opencensus.trace.export.SpanData.Links;\nimport io.opencensus.trace.export.SpanData.TimedEvent;\nimport io.opencensus.trace.export.SpanData.TimedEvents;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\n\npublic class JsonConversionFuzzer {\n    static List<SpanData> spanDataList;\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        spanDataList = new ArrayList<SpanData>();\n\n        String name = data.consumeString(200);\n        String traceId = data.consumeString(200);\n        String spanId = data.consumeString(200);\n        String parentSpanId = data.consumeString(200);\n        String spanName = data.consumeString(200);\n\t\tString key = data.consumeString(200);\n\t\tString value = data.consumeString(200);\n        boolean isSampled = data.consumeBoolean();\n        boolean hasRemoteParent = data.consumeBoolean();\n\n\t\ttry {\n\t\t\tList<TimedEvent<MessageEvent>> messageEvents =\n            ImmutableList.of(\n                TimedEvent.create(\n                    Timestamp.create(data.consumeInt(), data.consumeInt()),\n                    MessageEvent.builder(Type.RECEIVED, 0).setCompressedMessageSize(data.consumeInt()).build()),\n                TimedEvent.create(\n                    Timestamp.create(data.consumeInt(), data.consumeInt()),\n                    MessageEvent.builder(Type.SENT, 0).setCompressedMessageSize(data.consumeInt()).build()));\n\n\t\t\tSpanData spanData =\n                SpanData.create(\n                    SpanContext.create(\n                        TraceId.fromLowerBase16(traceId),\n                        SpanId.fromLowerBase16(spanId),\n                        TraceOptions.builder().setIsSampled(isSampled).build(),\n                        Tracestate.builder().build()),\n                    SpanId.fromLowerBase16(parentSpanId),\n                    hasRemoteParent,\n                    spanName,\n                    null,\n                    Timestamp.create(data.consumeInt(), data.consumeInt()),\n                    Attributes.create(ImmutableMap.of(key, AttributeValue.stringAttributeValue(value)), 0),\n                    TimedEvents.create(Collections.emptyList(), 0),\n                    TimedEvents.create(messageEvents, 0),\n                    Links.create(Collections.<Link>emptyList(), 0),\n                    null,\n                    Status.OK,\n                    Timestamp.create(data.consumeInt(), data.consumeInt()));\n\n\t\t\tspanDataList.add(spanData);\n        \tList<String> json = JsonConversionUtils.convertToJson(name, spanDataList);\n\t\t} catch (IllegalArgumentException e) {\n\t\t}\n    }\n}\n"
  },
  {
    "path": "projects/opencensus-java/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <!-- <module>opencensus-java</module> -->\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/opencensus-java/project.yaml",
    "content": "homepage: \"https://opencensus.io/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/census-instrumentation/opencensus-java/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n\n# opencensus is being archived cf https://opentelemetry.io/blog/2023/sunsetting-opencensus/\ndisabled: true\n"
  },
  {
    "path": "projects/opencensus-python/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN git clone https://github.com/census-instrumentation/opencensus-python\nCOPY build.sh fuzz_* $SRC/\n\nWORKDIR $SRC/opencensus-python\n"
  },
  {
    "path": "projects/opencensus-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Build and install opencensus-python library\npython3 -m pip install .\n\n# Build fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/opencensus-python/fuzz_trace.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport datetime\nimport logging\nlogging.getLogger().setLevel(logging.CRITICAL)\n\nfrom opencensus.trace import span\nfrom opencensus.trace import span_context\nfrom opencensus.trace import time_event\n\n\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n\n  span_context_item = span_context.SpanContext(\n      span_id=fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 512)))\n  annotation_time = datetime.date.fromtimestamp(fdp.ConsumeInt(4))\n  annotation = time_event.Annotation(\n      annotation_time,\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 512)))\n\n  name = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 512))\n  span_item = span.Span(\n      name=name,\n      attributes={\n          fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 512)):\n              fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 512))\n      },\n      start_time=str(fdp.ConsumeInt(4)),\n      end_time=str(fdp.ConsumeInt(4)),\n      span_id=fdp.ConsumeInt(4),\n      annotations=[annotation])\n  span.format_span_json(span_item)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/opencensus-python/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://opencensus.io/\"\nmain_repo: \"https://github.com/census-instrumentation/opencensus-python.git\"\nlanguage: python\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n- david@adalogics.com\n- arthur.chan@adalogics.com\n\n# opencensus is being archived cf https://opentelemetry.io/blog/2023/sunsetting-opencensus/\ndisabled: true\n"
  },
  {
    "path": "projects/opencsv/.gitignore",
    "content": "project-parent/opencsv\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/opencsv/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/csv.dict $SRC/CSVReaderFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/CSVReaderFuzzer_seed_corpus.zip go-fuzz-corpus/csv/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/opencsv\nRUN git clone --depth 1 https://git.code.sf.net/p/opencsv/source/ $SRC/project-parent/opencsv\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/opencsv/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=opencsv\nPROJECT_GROUP_ID=com.opencsv\nPROJECT_ARTIFACT_ID=opencsv\nMAIN_REPOSITORY=https://git.code.sf.net/p/opencsv/source/\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -Denforcer.skip=true -DskipTests -Dgpg.skip\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n  \n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/opencsv/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.opencsv</groupId>\n            <artifactId>opencsv</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/opencsv/project-parent/fuzz-targets/src/test/java/com/example/CSVReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.opencsv.*;\nimport com.opencsv.enums.CSVReaderNullFieldIndicator;\nimport com.opencsv.exceptions.CsvException;\nimport com.opencsv.exceptions.CsvMultilineLimitBrokenException;\nimport com.opencsv.exceptions.CsvValidationException;\nimport org.apache.commons.lang3.StringUtils;\nimport org.junit.jupiter.api.*;\n\nimport java.io.FileReader;\nimport java.io.IOException;\nimport java.io.StringReader;\nimport java.util.Locale;\nimport java.util.regex.PatternSyntaxException;\n\nclass CSVReaderFuzzer {\n    static CSVParser csvParser;\n    static Locale systemLocale;\n\n    @BeforeAll\n    static void storeSystemLocale() {\n        systemLocale = Locale.getDefault();\n    }\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            Locale.setDefault(data.pickValue(Locale.getAvailableLocales()));\n            csvParser = new CSVParser();\n            ICSVParser parser = new CSVParserBuilder()\n                    .withEscapeChar(data.consumeChar())\n                    .withFieldAsNull(data.pickValue(CSVReaderNullFieldIndicator.values()))\n                    .withIgnoreLeadingWhiteSpace(data.consumeBoolean())\n                    .withIgnoreQuotations(data.consumeBoolean())\n                    .withQuoteChar(data.consumeChar())\n                    .withSeparator(data.consumeChar())\n                    .withStrictQuotes(data.consumeBoolean())\n                    .build();\n\n            RFC4180Parser rfc4180Parser = new RFC4180ParserBuilder()\n                    .withFieldAsNull(data.pickValue(CSVReaderNullFieldIndicator.values()))\n                    .withQuoteChar(data.consumeChar())\n                    .withSeparator(data.consumeChar())\n                    .build();\n\n            ICSVParser [] icsvParsers = {csvParser, parser, rfc4180Parser};\n            CSVReader csvReader = new CSVReaderBuilder(new StringReader(data.consumeString(500)))\n                    .withCSVParser(data.pickValue(icsvParsers))\n                    .withFieldAsNull(data.pickValue(CSVReaderNullFieldIndicator.values()))\n                    .withKeepCarriageReturn(data.consumeBoolean())\n                    .build();\n            csvReader.readAll();\n\n            Locale.setDefault(systemLocale);\n        } catch (CsvException | IOException e) {\n            // Documented exceptions.\n        } catch (UnsupportedOperationException | PatternSyntaxException e) {\n            // Need to catch them to continue fuzzing.\n        }\n\n    }\n}"
  },
  {
    "path": "projects/opencsv/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>opencsv</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/opencsv/project.yaml",
    "content": "homepage: \"https://sourceforge.net/projects/opencsv/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://git.code.sf.net/p/opencsv/source/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/opencv/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y build-essential cmake pkg-config\nRUN git clone --depth 1 https://github.com/opencv/opencv.git opencv\nWORKDIR opencv/\n\nCOPY build.sh $SRC/\nCOPY *.cc *.h $SRC/\n# Runner have memory limit 2048Mb, set imread pixel limit 712Mpix ~ 2037Mb (BGR)\nENV OPENCV_IO_MAX_IMAGE_PIXELS=712000000\n"
  },
  {
    "path": "projects/opencv/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbuild_dir=$WORK/build-$SANITIZER\ninstall_dir=$WORK/install-$SANITIZER\n\nmkdir -p $build_dir\npushd $build_dir\ncmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=$install_dir \\\n  -DBUILD_SHARED_LIBS=OFF -DOPENCV_GENERATE_PKGCONFIG=ON \\\n  -DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_FORCE_3RDPARTY_BUILD=ON \\\n  -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_apps=OFF \\\n  -DWITH_IMGCODEC_GIF=ON -DWITH_IPP=OFF $SRC/opencv\nmake -j$(nproc)\nmake install\npopd\n\npushd $SRC\nfor fuzzer in core_fuzzer filestorage_read_file_fuzzer \\\n   filestorage_read_filename_fuzzer filestorage_read_string_fuzzer \\\n   generateusergallerycollage_fuzzer imdecode_fuzzer imencode_fuzzer \\\n   imread_fuzzer readnetfromtensorflow_fuzzer; do\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.cc -std=c++17 \\\n-I$install_dir/include/opencv4 -L$install_dir/lib \\\n-L$install_dir/lib/opencv4/3rdparty \\\n-lopencv_dnn -lopencv_objdetect -lopencv_photo -lopencv_ml -lopencv_gapi \\\n-lopencv_stitching -lopencv_video -lopencv_calib3d -lopencv_features2d \\\n-lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_imgproc \\\n-lopencv_flann -lopencv_core -llibjpeg-turbo -llibwebp -llibpng -llibtiff \\\n-llibopenjp2 -lIlmImf -llibprotobuf -lzlib -littnotify \\\n-lade -ldl -lm -lpthread -lrt \\\n-o $OUT/$fuzzer\ndone\npopd\n"
  },
  {
    "path": "projects/opencv/core_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <opencv2/opencv.hpp>\n#include <fuzzer/FuzzedDataProvider.h>\n\nnamespace {\n\nbool GetCVImage(const std::string& image_string, const int max_pixels,\n                cv::Mat* original_image) {\n  if (image_string.empty()) return false;\n  std::vector<uchar> raw_data(image_string.size());\n  const char* ptr = image_string.data();\n  std::copy(ptr, ptr + image_string.size(), raw_data.data());\n  try {\n    *original_image = cv::imdecode(raw_data, cv::IMREAD_UNCHANGED);\n  } catch (cv::Exception e) {}\n  return !original_image->empty();\n}\n\nvoid TestExternalMethods(const cv::Mat& mat) {\n  try{\n    cv::sum(mat);\n  } catch (cv::Exception e) {}\n  try {\n    cv::mean(mat);\n  } catch (cv::Exception e) {}\n  try {\n    cv::trace(mat);\n  } catch (cv::Exception e) {}\n}\n\nvoid TestInternalMethods(const cv::Mat& mat) {\n  try {\n    mat.t();\n  } catch (cv::Exception e) {}\n  try {\n    mat.inv();\n  } catch (cv::Exception e) {}\n  try {\n    mat.diag();\n  } catch (cv::Exception e) {}\n}\n\nvoid TestSplitAndMerge(const cv::Mat& image) {\n  std::vector<cv::Mat> split_image(image.channels());\n  cv::split(image, split_image);\n  if (!split_image.empty()) {\n    cv::Mat new_image;\n    cv::merge(split_image, new_image);\n  }\n}\n\n}  // namespace\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  // Prepares a backup image we will use if we cannot successfully get an image\n  // by decoding the string.\n  std::vector<uint8_t> image_data = {data, data + size};\n  cv::Mat backup_image =\n      cv::Mat(1, image_data.size(), CV_8UC1, image_data.data());\n\n  FuzzedDataProvider fuzzed_data_provider(data, size);\n  const int max_pixels = fuzzed_data_provider.ConsumeIntegral<int>();\n  const std::string image_string =\n      fuzzed_data_provider.ConsumeRemainingBytesAsString();\n  cv::Mat original_image;\n  // Tests the clone method.\n  cv::Mat cloned_image = GetCVImage(image_string, max_pixels, &original_image)\n                             ? original_image.clone()\n                             : backup_image.clone();\n\n  // TODO: enabling the following crashes right away.\n  // TestExternalMethods(cloned_image);\n  TestInternalMethods(cloned_image);\n  TestSplitAndMerge(cloned_image);\n  return 0;\n}\n"
  },
  {
    "path": "projects/opencv/filestorage_read_file_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n#include <string>\n\n#include <opencv2/opencv.hpp>\n#include \"fuzzer_temp_file.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  const FuzzerTemporaryFile temp_file(data, size);\n\n  try {\n    cv::FileStorage storage;\n    if (!storage.open(temp_file.filename(), cv::FileStorage::READ)) {\n      return 0;\n    }\n\n    cv::FileNode root = storage.root();\n    for (cv::FileNodeIterator it = root.begin(); it != root.end(); ++it) {\n      cv::FileNode node = *it;\n      const std::string node_name = node.name();\n      const int node_type = node.type();\n\n      switch (node_type) {\n        case cv::FileNode::INT:\n          (void)static_cast<int>(node);\n          break;\n        case cv::FileNode::REAL:\n          (void)static_cast<double>(node);\n          break;\n        case cv::FileNode::STRING:\n          (void)static_cast<std::string>(node);\n          break;\n        case cv::FileNode::SEQ:\n        case cv::FileNode::MAP: {\n          for (cv::FileNodeIterator child_it = node.begin();\n               child_it != node.end(); ++child_it) {\n            cv::FileNode child = *child_it;\n            (void)child.name();\n            (void)child.type();\n          }\n          break;\n        }\n        default:\n          break;\n      }\n    }\n\n    storage.release();\n  } catch (const cv::Exception&) {\n  } catch (...) {\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/opencv/filestorage_read_filename_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <opencv2/opencv.hpp>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  // Tests filename parsing when opening cv::FileStorage for reading. The file\n  // doesn't actually exist, so any logic prediated on successfully opening the\n  // file will not be tested.\n  //\n  // Note that this may actually generate filenames that do exist. If so, this\n  // could result in some bugs being difficult to reproduce. If a case doesn't\n  // reproduce and looks like a real filename, this may be the cause.\n  cv::FileStorage storage;\n  try {\n    storage.open(std::string(reinterpret_cast<const char*>(data), size),\n                 cv::FileStorage::READ);\n  } catch (cv::Exception e) {\n    // Do nothing.\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/opencv/filestorage_read_string_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <opencv2/opencv.hpp>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  // Tests reading from a string (instead of a file) using cv::FileStorage,\n  // which attempts to parse JSON, XML, and YAML, using the first few bytes of a\n  // string to determine which type to parse it as.\n  cv::FileStorage storage;\n  try {\n    storage.open(std::string(reinterpret_cast<const char*>(data), size),\n                 cv::FileStorage::READ);\n  } catch (cv::Exception e) {\n    // Do nothing.\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/opencv/fuzzer_temp_file.h",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that\n// require a file instead of an input buffer.\n\n#ifndef FUZZER_TEMP_FILE_H_\n#define FUZZER_TEMP_FILE_H_\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n// Pure-C interface for creating and cleaning up temporary files.\n\nstatic char* fuzzer_get_tmpfile(const uint8_t* data, size_t size) {\n  char* filename_buffer = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n  if (!filename_buffer) {\n    perror(\"Failed to allocate file name buffer.\");\n    abort();\n  }\n  const int file_descriptor = mkstemp(filename_buffer);\n  if (file_descriptor < 0) {\n    perror(\"Failed to make temporary file.\");\n    abort();\n  }\n  FILE* file = fdopen(file_descriptor, \"wb\");\n  if (!file) {\n    perror(\"Failed to open file descriptor.\");\n    close(file_descriptor);\n    abort();\n  }\n  const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);\n  if (bytes_written < size) {\n    close(file_descriptor);\n    fprintf(stderr, \"Failed to write all bytes to file (%zu out of %zu)\",\n            bytes_written, size);\n    abort();\n  }\n  fclose(file);\n  return filename_buffer;\n}\n\nstatic void fuzzer_release_tmpfile(char* filename) {\n  if (unlink(filename) != 0) {\n    perror(\"WARNING: Failed to delete temporary file.\");\n  }\n  free(filename);\n}\n\n// C++ RAII object for creating temporary files.\n\n#ifdef __cplusplus\nclass FuzzerTemporaryFile {\n public:\n  FuzzerTemporaryFile(const uint8_t* data, size_t size)\n      : filename_(fuzzer_get_tmpfile(data, size)) {}\n\n  ~FuzzerTemporaryFile() { fuzzer_release_tmpfile(filename_); }\n\n  const char* filename() const { return filename_; }\n\n private:\n  char* filename_;\n};\n#endif\n\n#endif  // FUZZER_TEMP_FILE_H_\n"
  },
  {
    "path": "projects/opencv/generateusergallerycollage_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n#include <iosfwd>\n\n#include <opencv2/opencv.hpp>\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  const int kMaxXResolution = 6000;\n  const int kMaxYResolution = 6000;\n  const int kMaxLineThickness = 10;\n  const double kMaxFontScale = 10.0;\n\n  FuzzedDataProvider fuzz_provider(data, size);\n\n  int fuzz_font_face = fuzz_provider.PickValueInArray(\n      {cv::FONT_HERSHEY_SIMPLEX, cv::FONT_HERSHEY_PLAIN,\n       cv::FONT_HERSHEY_DUPLEX, cv::FONT_HERSHEY_COMPLEX,\n       cv::FONT_HERSHEY_TRIPLEX, cv::FONT_HERSHEY_COMPLEX_SMALL,\n       cv::FONT_HERSHEY_SCRIPT_SIMPLEX, cv::FONT_HERSHEY_SCRIPT_COMPLEX});\n\n  int fuzz_linetype = fuzz_provider.PickValueInArray({\n      cv::LINE_8,     // 8-connected line\n      cv::LINE_4,     // 4-connected line\n      cv::LINE_AA     // anti-aliased line\n  });\n\n  double fuzz_font_scale =\n      fuzz_provider.ConsumeFloatingPointInRange(0.0, kMaxFontScale);\n  int fuzz_width =\n      fuzz_provider.ConsumeIntegralInRange<int>(0, kMaxXResolution);\n  int fuzz_height =\n      fuzz_provider.ConsumeIntegralInRange<int>(0, kMaxYResolution);\n  int fuzz_x_pos =\n      fuzz_provider.ConsumeIntegralInRange<int>(0, kMaxXResolution);\n  int fuzz_y_pos =\n      fuzz_provider.ConsumeIntegralInRange<int>(0, kMaxYResolution);\n  int fuzz_thickness =\n      fuzz_provider.ConsumeIntegralInRange<int>(0, kMaxLineThickness);\n\n  std::vector<uint8_t> color_scalar_vals;\n  std::vector<uint8_t> canvas_fill_scalar_vals;\n\n  // Ensure that all 3D vectors are fully populated,\n  // even if fuzz_provider is exhausted.\n  for (int i = 0; i < 3; i++) {\n    color_scalar_vals.insert(color_scalar_vals.begin(),\n                             fuzz_provider.ConsumeIntegralInRange(0, 255));\n    canvas_fill_scalar_vals.insert(\n        canvas_fill_scalar_vals.begin(),\n        fuzz_provider.ConsumeIntegralInRange(0, 255));\n  }\n\n  cv::Scalar fuzz_color(color_scalar_vals[0], color_scalar_vals[1],\n                        color_scalar_vals[2]);\n  cv::Scalar fuzz_canvas_fill(canvas_fill_scalar_vals[0],\n                              canvas_fill_scalar_vals[1],\n                              canvas_fill_scalar_vals[2]);\n\n  cv::Point fuzz_text_pos(fuzz_x_pos, fuzz_y_pos);\n  cv::Mat fuzz_canvas(fuzz_height, fuzz_width, CV_8UC3, fuzz_canvas_fill);\n\n  std::basic_string<char> fuzz_annotation =\n      fuzz_provider.ConsumeRemainingBytesAsString();\n\n  cv::putText(fuzz_canvas, fuzz_annotation, fuzz_text_pos, fuzz_font_face,\n              fuzz_font_scale, fuzz_color, fuzz_thickness, fuzz_linetype);\n  return 0;\n}\n"
  },
  {
    "path": "projects/opencv/imdecode_fuzzer.cc",
    "content": "#include <opencv2/opencv.hpp>\n#include <opencv2/imgcodecs/legacy/constants_c.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  std::vector<uint8_t> image_data = {data, data + size};\n  // TODO: Try other image types than CV_8UC1.\n  cv::Mat data_matrix =\n      cv::Mat(1, image_data.size(), CV_8UC1, image_data.data());\n  try {\n    cv::Mat decoded_matrix = cv::imdecode(data_matrix, CV_LOAD_IMAGE_UNCHANGED);\n  } catch (cv::Exception e) {\n    // Do nothing.\n  }\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/opencv/imencode_fuzzer.cc",
    "content": "// Copyright 2020 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <opencv2/opencv.hpp>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  std::vector<uint8_t> image_data = {data, data + size};\n  cv::Mat data_matrix =\n      cv::Mat(1, image_data.size(), CV_8UC1, image_data.data());\n  try {\n    std::vector<uchar> buffer;\n    cv::imencode(\".tiff\", data_matrix, buffer);\n  } catch (cv::Exception e) {\n    // Do nothing.\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/opencv/imread_fuzzer.cc",
    "content": "#include <cstddef>\n#include <cstdint>\n#include <unistd.h>\n\n#include <opencv2/opencv.hpp>\n#include \"fuzzer_temp_file.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  const FuzzerTemporaryFile file(data, size);\n  try {\n    cv::Mat matrix = cv::imread(file.filename());\n  } catch (cv::Exception e) {\n    // Do nothing.\n  }\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/opencv/project.yaml",
    "content": "homepage: \"https://opencv.org/\"\nlanguage: c++\nprimary_contact: \"garybradski@gmail.com\"\n\nauto_ccs:\n  - \"alexander.a.alekhin@gmail.com\"\n  - \"garybradski@gmail.com\"\n  - \"vrabaud@google.com\"\n  - \"kusano@google.com\"\n  - \"maksim.shabunin@gmail.com\"\n  - \"vadim.pisarevsky@gmail.com\"\n  - \"smorkalov.a.m@gmail.com\"\n  - \"shiqi.yu@gmail.com\"\n\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n\nlabels:\n  imdecode_fuzzer:\n    - sundew\n  imread_fuzzer:\n    - sundew\nmain_repo: 'https://github.com/opencv/opencv.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/opencv/readnetfromtensorflow_fuzzer.cc",
    "content": "// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/*\n * This fuzzer is generated by UTopia project based on TEST(Test_Tensorflow, read_inception).\n * (UTopia Project: https://github.com/Samsung/UTopia)\n */\n#include <opencv2/dnn/dnn.hpp>\n\nusing namespace cv;\nusing namespace dnn;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  try {\n    readNetFromTensorflow((const char*)data, size);\n  } catch (std::exception &e) {}\n  return 0;\n}\n"
  },
  {
    "path": "projects/opendal/.fs.env",
    "content": "OPENDAL_TEST=fs\nOPENDAL_FS_ROOT=/tmp"
  },
  {
    "path": "projects/opendal/.memory.env",
    "content": "OPENDAL_TEST=memory"
  },
  {
    "path": "projects/opendal/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/apache/incubator-opendal.git opendal\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\nCOPY .fs.env $SRC/\nCOPY .memory.env $SRC/"
  },
  {
    "path": "projects/opendal/build.sh",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\n# build fuzz targets\ncd $SRC/opendal/core\ncargo fuzz build -O --debug-assertions\n\n# copy fuzz targets to $OUT\ntargets=(\n  fuzz_reader\n  fuzz_writer\n)\n\ncp $SRC/.fs.env $OUT/.fs.env\ncp $SRC/opendal/core/target/x86_64-unknown-linux-gnu/release/fuzz_reader $OUT/fuzz_reader_fs\ncp $SRC/opendal/core/target/x86_64-unknown-linux-gnu/release/fuzz_reader $OUT/fuzz_writer_fs\n\ncp $SRC/.memory.env $OUT/.memory.env\ncp $SRC/opendal/core/target/x86_64-unknown-linux-gnu/release/fuzz_reader $OUT/fuzz_reader_memory\ncp $SRC/opendal/core/target/x86_64-unknown-linux-gnu/release/fuzz_reader $OUT/fuzz_writer_memory\n\n"
  },
  {
    "path": "projects/opendal/project.yaml",
    "content": "homepage: \"https://opendal.apache.org/\"\nmain_repo: \"https://github.com/apache/incubator-opendal.git\"\nlanguage: rust\nprimary_contact: \"xuanwo.cn@gmail.com\"\nauto_ccs:\n    - \"dqhl76@gmail.com\"\n    - \"ouyangjun1999@gmail.com\"\n    - \"suyanhanx@gmail.com\"\n    - \"yinmingzhuo@gmail.com\"\nvendor_ccs:\n    - \"commits@opendal.apache.org\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nfile_github_issue: True\n"
  },
  {
    "path": "projects/opendds/project.yaml",
    "content": "homepage: \"https://opendds.org/\"\nlanguage: c\nauto_ccs:\n  - \"federico.maggi@gmail.com\"\nprimary_contact: \"mitza@objectcomputing.com\"\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/objectcomputing/OpenDDS.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/opendnp3/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make wget tshark\n\nRUN git clone --recursive -b release --depth 1 https://github.com/dnp3/opendnp3.git opendnp3\nWORKDIR opendnp3\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/opendnp3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\ncmake -DDNP3_FUZZING=ON -DDNP3_STATIC_LIBS=ON .\nmake all\n\ncd cpp/tests/fuzz\n\nTARGETS=\"fuzzdecoder \\\n  fuzzoutstation \\\n  fuzzmaster\"\n\necho \"detect_leaks=0\" >> fuzzdnp3.options\nfor target in $TARGETS; do\n  # build corpus\n  zip -r ${target}_seed_corpus.zip corpus/*.dnp\n  cp ${target}_seed_corpus.zip $OUT/\n\n  # export other associated stuff\n  cp fuzzdnp3.options $OUT/${target}.options\n\n  # build fuzz target\n  $CXX $CXXFLAGS -I. -I ../../lib/include/ -I ../../tests/lib/src/ \\\n    -I ../../lib/src/ -I ../../../_deps/exe4cpp-src/src/ -I ../dnp3mocks/include/ \\\n    -I ../../../_deps/ser4cpp-src/src/ -I ../../../_deps/asio-src/asio/include \\\n    -c ${target}.cpp -o ${target}.o\n  $CXX $CXXFLAGS -std=c++14 ${target}.o -o $OUT/${target} ../dnp3mocks/libdnp3mocks.a ../../lib/libopendnp3.a $LIB_FUZZING_ENGINE\ndone\n"
  },
  {
    "path": "projects/opendnp3/project.yaml",
    "content": "homepage: \"http://www.automatak.com/opendnp3/\"\nlanguage: c++\nprimary_contact: \"jadamcrain@gmail.com\"\nauto_ccs :\n  - \"p.antoine@catenacyber.fr\"\n  - \"jadamcrain@gmail.com\"\n\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: 'https://github.com/dnp3/opendnp3.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/openexr/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool zlib1g-dev\nRUN git clone --depth 1 https://github.com/AcademySoftwareFoundation/openexr openexr\nWORKDIR openexr\nCOPY *.sh $SRC/\n\n# The below test is failing in the OSS-Fuzz environment. Patch it out for now.\nRUN sed -i \"s/TEST (testAttrBytes/\\/\\/TEST (testAttrBytes/g\" $SRC/openexr/src/test/OpenEXRCoreTest/main.cpp\n"
  },
  {
    "path": "projects/openexr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#\n# Build the OpenEXR fuzzers, via the \"oss_fuzz\" CMake target.\n#\n# The \"oss_fuzz\" target is specially constructed to operate in this\n# env. It queries the environment for the values of\n# LIB_FUZZING_ENGINE, OUT, and CC/CC_FLAGS, and CXX/CXX_FLAGS. The\n# installed fuzzers go in the OUT directory.\n#\n\nset -x\n\nexport BUILD_DIR=$WORK/_build.oss-fuzz\n\n./src/test/oss-fuzz/oss-fuzz_build.sh\n\n# Build tests to support replay_tests.sh\ncd $BUILD_DIR\ncmake --build $BUILD_DIR --target OpenEXRTest OpenEXRCoreTest IexTest OpenEXRUtilTest -j$(nproc)\n"
  },
  {
    "path": "projects/openexr/project.yaml",
    "content": "homepage: \"https://openexr.com\"\nlanguage: c++\nprimary_contact: \"twodeecoda@gmail.com\"\nauto_ccs:\n  - \"cary@ilm.com\"\n  - \"twodeecoda@gmail.com\"\n  - \"kdt3rd@gmail.com\"\nmain_repo: 'https://github.com/AcademySoftwareFoundation/openexr'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/openexr/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBUILD_DIR=$WORK/_build.oss-fuzz\ncd $BUILD_DIR\nCTEST_PARALLEL_LEVEL=$(nproc) make test\n"
  },
  {
    "path": "projects/openfga/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/openfga/openfga\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nRUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=v2_2\nCOPY build.sh $SRC/\nWORKDIR $SRC/openfga\n"
  },
  {
    "path": "projects/openfga/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/openfga/build.sh\n\n"
  },
  {
    "path": "projects/openfga/project.yaml",
    "content": "homepage: \"https://openfga.dev\"\nlanguage: go\nprimary_contact: \"adam@adalogics.com\"\nauto_ccs:\n- \"adrian.tam@okta.com\"\nmain_repo: \"https://github.com/openfga/openfga\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/openh264/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y ffmpeg libstdc++-9-dev libstdc++-9-dev:i386 nasm subversion\nRUN git clone --depth 1 https://github.com/cisco/openh264.git openh264\nRUN python3 -m pip install --upgrade pip && python3 -m pip install corpus-replicator\nRUN corpus-replicator -o corpus video_h264_264_libx264.yml video\nRUN mv openh264/res/*.264 corpus/\nRUN zip -j0r decoder_fuzzer_seed_corpus.zip corpus/\nWORKDIR openh264\nCOPY build.sh decoder_fuzzer.cpp $SRC/\n"
  },
  {
    "path": "projects/openh264/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build\nif [[ $CXXFLAGS = *sanitize=memory* ]]; then\n  ASM_BUILD=No\nelse\n  ASM_BUILD=Yes\nfi\nmake -j$(nproc) ARCH=$ARCHITECTURE USE_ASM=$ASM_BUILD BUILDTYPE=Debug libopenh264.a\n$CXX $CXXFLAGS -o $OUT/decoder_fuzzer -I./codec/api/wels -I./codec/console/common/inc -I./codec/common/inc -L. $LIB_FUZZING_ENGINE $SRC/decoder_fuzzer.cpp libopenh264.a\n"
  },
  {
    "path": "projects/openh264/decoder_fuzzer.cpp",
    "content": "/*\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n// TODO: This should be moved to the openh264 repo.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include <memory>\n\n#include \"codec_def.h\"\n#include \"codec_app_def.h\"\n#include \"codec_api.h\"\n#include \"read_config.h\"\n#include \"typedefs.h\"\n#include \"measure_time.h\"\n\n/*\n * To build locally:\n * CC=clang CXX=clang++ CFLAGS=\"-fsanitize=address,fuzzer-no-link -g\" CXXFLAGS=\"-fsanitize=address,fuzzer-no-link -g\" LDFLAGS=\"-fsanitize=address,fuzzer-no-link\" make -j$(nproc) USE_ASM=No BUILDTYPE=Debug libraries\n * clang++ -o decoder_fuzzer -fsanitize=address -g -O1 -I./codec/api/wels -I./codec/console/common/inc -I./codec/common/inc -L. -lFuzzer -lstdc++ decoder_fuzzer.cpp libopenh264.a\n */\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  int32_t i;\n  int32_t iBufPos = 0;\n  int32_t iEndOfStreamFlag;\n  int iLevelSetting = (int) WELS_LOG_QUIET; // disable logging while fuzzing\n  int32_t iSliceSize;\n  ISVCDecoder *pDecoder;\n  SDecodingParam sDecParam = {0};\n  SBufferInfo sDstBufInfo;\n  std::unique_ptr<uint8_t[]> pBuf(new uint8_t[size + 4]);\n  uint8_t* pData[3] = {NULL};\n  uint8_t uiStartCode[4] = {0, 0, 0, 1};\n\n  memcpy(pBuf.get(), data, size);\n  memcpy(pBuf.get() + size, &uiStartCode[0], 4);\n  memset(&sDstBufInfo, 0, sizeof(SBufferInfo));\n\n  // TODO: is this the best/fastest ERROR_CON to use?\n  sDecParam.eEcActiveIdc = ERROR_CON_SLICE_COPY;\n  // TODO: should we also fuzz VIDEO_BITSTREAM_SVC?\n  sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;\n  \n  WelsCreateDecoder (&pDecoder);\n  pDecoder->Initialize (&sDecParam);\n  pDecoder->SetOption (DECODER_OPTION_TRACE_LEVEL, &iLevelSetting);\n\n  while (1) {\n    if (iBufPos >= size) {\n      iEndOfStreamFlag = 1;\n      if (iEndOfStreamFlag)\n        pDecoder->SetOption (DECODER_OPTION_END_OF_STREAM, (void*)&iEndOfStreamFlag);\n      break;\n    }\n\n    for (i = 0; i < size; i++) {\n      if ((pBuf[iBufPos + i] == 0 && pBuf[iBufPos + i + 1] == 0 && pBuf[iBufPos + i + 2] == 0 && pBuf[iBufPos + i + 3] == 1\n          && i > 0) || (pBuf[iBufPos + i] == 0 && pBuf[iBufPos + i + 1] == 0 && pBuf[iBufPos + i + 2] == 1 && i > 0)) {\n        break;\n      }\n    }\n    iSliceSize = i;\n    if (iSliceSize < 4) {\n      if (iSliceSize == 0) {\n        // I don't think this should happen but let's just avoid the hang\n        goto label_cleanup;\n      }\n      iBufPos += iSliceSize;\n      continue;\n    }\n\n    pDecoder->DecodeFrameNoDelay (pBuf.get() + iBufPos, iSliceSize, pData, &sDstBufInfo);\n    iBufPos += iSliceSize;\n  }\n\nlabel_cleanup:\n  pDecoder->Uninitialize ();\n  WelsDestroyDecoder (pDecoder);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openh264/project.yaml",
    "content": "homepage: \"https://www.openh264.org\"\nlanguage: c++\nprimary_contact: \"huili2@cisco.com\"\nauto_ccs:\n  - \"guangwwa@cisco.com\"\n  - \"openh264-review@cisco.com\"\n  - \"sijchen@cisco.com\"\n  - \"yanqian@cisco.com\"\n  - \"xiaotianshimail@gmail.com\"\nvendor_ccs:\n  - \"jmuizelaar@mozilla.com\"\n  - \"media-alerts@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n - i386\n - x86_64\nmain_repo: 'https://github.com/cisco/openh264.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/openjpeg/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake g++ libtiff-dev\nRUN git clone --depth 1 https://github.com/uclouvain/openjpeg openjpeg\n# openjpeg-data is used to create a seed corpus\nWORKDIR openjpeg\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/openjpeg/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Get data. We do this here to resolve CIFuzz issues\n# CC https://github.com/uclouvain/openjpeg/pull/1386\ngit clone --depth 1 https://github.com/uclouvain/openjpeg-data data\nexport OPJ_DATA_ROOT=$PWD/data\n\nmkdir build\ncd build\n\ncmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release ..\nmake clean -s\nmake -j$(nproc) -s\n\ncd ..\n\n./tests/fuzzers/build_google_oss_fuzzers.sh\n./tests/fuzzers/build_seed_corpus.sh\n"
  },
  {
    "path": "projects/openjpeg/project.yaml",
    "content": "homepage: \"http://www.openjpeg.org/\"\nlanguage: c++\nprimary_contact: \"antonin@gmail.com\"\nauto_ccs:\n  - \"even.rouault@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\nmain_repo: 'https://github.com/uclouvain/openjpeg'\n"
  },
  {
    "path": "projects/openjpeg/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nexport OPJ_DATA_ROOT=$PWD/data\n\ncd build\n\n# TODO(David) Enable the tests we disable in this loop. We disable because\n# they fail in the OSS-Fuzz environment, and it's unclear why.\nfor test_name in ETS-JP2-file5.jp2-decode ETS-JP2-file5.jp2-compare2ref NR-JP2-file5.jp2-compare2base ETS-JP2-file7.jp2-decode ETS-JP2-file7.jp2-compare2ref NR-JP2-file7.jp2-compare2base ETS-JP2-file8.jp2-compare2ref NR-JP2-file8.jp2-compare2base; do\n  echo $PWD\n  sed -i \"s/add_test($test_name/#${test_name}/g\" ./tests/conformance/CTestTestfile.cmake\n  sed -i \"s/set_tests_properties(${test_name}/#set_tests_properties(${test_name}/g\" ./tests/conformance/CTestTestfile.cmake\ndone\nsed -i \"s/subdirs(\\\"nonregression\\\")/#subdirs(\\\"nonregression\\\")/g\" tests/CTestTestfile.cmake\n\nmake test\n"
  },
  {
    "path": "projects/openjph/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# install dependencies\nRUN apt-get update && apt-get install -y cmake libtiff-dev zip\n\n# clone the library\nRUN git clone https://github.com/aous72/OpenJPH.git\n\n# clone the seed corpus\nRUN git clone --depth 1 https://github.com/aous72/jp2k_test_codestreams.git\n\n# import the build script\nCOPY build.sh .\n\n"
  },
  {
    "path": "projects/openjph/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the fuzz targets\ncd $SRC\nmkdir build/\ncd build/\ncmake $SRC/OpenJPH -DBUILD_SHARED_LIBS=OFF -DOJPH_BUILD_FUZZER=ON -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" -DCMAKE_C_FLAGS=\"$CFLAGS\"\nmake -j$(nproc)\ncp fuzzing/ojph_expand_fuzz_target $OUT\n\n# Build the seed corpus\ncd $SRC\nrm -f $OUT/ojph_expand_fuzz_target_seed_corpus.zip\nzip -j $OUT/ojph_expand_fuzz_target_seed_corpus.zip jp2k_test_codestreams/openjph/*.j2c\n"
  },
  {
    "path": "projects/openjph/project.yaml",
    "content": "homepage: \"https://github.com/aous72/OpenJPH\"\nlanguage: c++\nprimary_contact: \"aous72@gmail.com\"\nauto_ccs:\n  - \"pal@sandflow.com\"\n  - \"miksmith@gmail.com\"\n  - \"aous@unsw.edu.au\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\nmain_repo: \"https://github.com/aous72/OpenJPH\"\n"
  },
  {
    "path": "projects/openkruise/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/openkruise/kruise\nCOPY build.sh $SRC/\nWORKDIR $SRC/kruise\n"
  },
  {
    "path": "projects/openkruise/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n$SRC/kruise/test/fuzz/oss_fuzz_build.sh"
  },
  {
    "path": "projects/openkruise/project.yaml",
    "content": "homepage: \"https://github.com/openkruise/kruise\"\nmain_repo: \"https://github.com/openkruise/kruise\"\nprimary_contact: \"furykerry@gmail.com\"\nauto_ccs:\n  - \"berg.zms@gmail.com\"\n  - \"yc649518322@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address"
  },
  {
    "path": "projects/opennavsurf-bag/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y pkg-config libtool cmake make autoconf automake ninja-build\n\n# Build a newer version of HDF5 than what Ubuntu 20.04 has (which is version 1.10.x)\nWORKDIR /tmp\nRUN wget https://github.com/HDFGroup/hdf5/releases/download/hdf5-1_14_3/hdf5-1_14_3.tar.gz\nRUN echo \"126b800e9b87f65e7e7ffa58ee006607bab03a8e11e5209ea3d5c0c331321d43  hdf5-1_14_3.tar.gz\" > hdf5.sum\nRUN shasum -a 256 -c hdf5.sum\nRUN tar xf hdf5-1_14_3.tar.gz\nRUN mkdir -p hdfsrc/build\nWORKDIR /tmp/hdfsrc/build\nRUN cmake -G \"Unix Makefiles\" \\\n    -DCMAKE_INSTALL_PREFIX:PATH=/opt \\\n    -DBUILD_SHARED_LIBS:BOOL=OFF \\\n    -DBUILD_TESTING:BOOL=OFF \\\n    -DCMAKE_VERBOSE_MAKEFILES:BOOL=ON \\\n    -DHDF5_BUILD_EXAMPLES:BOOL=OFF \\\n    -DHDF5_BUILD_TOOLS:BOOL=OFF \\\n    -DHDF5_ENABLE_SANITIZERS:BOOL=ON \\\n    -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON \\\n    -DHDF5_BUILD_CPP_LIB=ON \\\n    -DHDF5_BUILD_HL_LIB:BOOL=ON \\\n    -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \\\n    .. && \\\n    cmake --build . --verbose --config Release -j$(nproc) && \\\n    make install\n\n# Build libxml2 statically (use version 2.10.1 as newer versions require Automake 1.16.3, but Ubuntu 20.04 only supplies 1.16.1)\nWORKDIR /tmp\nRUN wget https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.10.1/libxml2-v2.10.1.tar.gz\nRUN echo \"c89e5d4eb873f209bace159fc1c76e40ce89f4dc94ac382a6c17032624e2840c  libxml2-v2.10.1.tar.gz\" > libxml2.sum\nRUN shasum -a 256 -c libxml2.sum\nRUN tar xf libxml2-v2.10.1.tar.gz\nWORKDIR /tmp/libxml2-v2.10.1\nRUN ./autogen.sh \\\n    --prefix=/opt \\\n    --disable-shared \\\n    --without-debug \\\n    --without-http \\\n    --without-lzma \\\n    --without-zlib \\\n    --without-python && \\\n    make -j$(nproc) && \\\n    make install\n\nWORKDIR /tmp\nRUN git clone https://github.com/catchorg/Catch2.git && cd Catch2 && git checkout v3.12.0\nRUN cd Catch2 && cmake -B build -S . && cmake --build build --target install\n\nWORKDIR $SRC\n\nRUN git clone --depth 1 https://github.com/OpenNavigationSurface/BAG bag\nRUN pip install -r bag/requirements.txt\n\nRUN cp $SRC/bag/fuzzers/build.sh $SRC/\nCOPY replay_build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/opennavsurf-bag/project.yaml",
    "content": "homepage: \"https://github.com/OpenNavigationSurface/BAG\"\nlanguage: c++\nprimary_contact: \"selimnairb@gmail.com\"\nauto_ccs:\n  - \"bmiles@ccom.unh.edu\"\n  - \"brc@ccom.unh.edu\"\n  - \"glen.rice@noaa.gov\"\n  - \"dongpengxu.unh@gmail.com\"\n  - \"akshitamavurapu@gmail.com\"\n  - \"giuseppemasetti@gmail.com\"\n  - \"apapetti@outlook.com\"\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/OpenNavigationSurface/BAG'\nsanitizers:\n  - address\n  - undefined\n  - memory\n"
  },
  {
    "path": "projects/opennavsurf-bag/replay_build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n. $SRC/build.sh\n"
  },
  {
    "path": "projects/opennavsurf-bag/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd bag\n# Disable ASan since tests don't work with it on.\nunset CFLAGS\nexport CXXFLAGS='-stdlib=libc++ -ldl'\n\ncmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B test_build -S . \\\n  -DCMAKE_INSTALL_PREFIX:PATH=/opt \\\n  -DCMAKE_PREFIX_PATH='/opt;/opt/local;/opt/local/HDF_Group/HDF5/1.14.3/' \\\n  -DBAG_BUILD_SHARED_LIBS:BOOL=OFF \\\n  -DBAG_BUILD_TESTS:BOOL=ON -DBAG_CODE_COVERAGE:BOOL=OFF \\\n  -DBAG_BUILD_PYTHON:BOOL=OFF -DBAG_BUILD_EXAMPLES:BOOL=OFF\n\ncmake --build test_build --config Release --target install\n\n# There are some exclusions due to failing tests.\nBAG_SAMPLES_PATH=./examples/sample-data ./test_build/tests/bag_tests '~test VR BAG reading GDAL' '~test simple layer read' '~test interleaved legacy layer read' '~test VR BAG reading NBS'\n"
  },
  {
    "path": "projects/openpyxl/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get install mercurial -y\nRUN pip3 install --upgrade pip\n\nRUN hg clone https://foss.heptapod.net/openpyxl/openpyxl\nWORKDIR openpyxl\n\nCOPY build.sh fuzz_*.py $SRC/\n\n"
  },
  {
    "path": "projects/openpyxl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/openpyxl/fuzz_basic.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    import openpyxl\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    wb = openpyxl.Workbook()\n    ws = wb.active\n\n    ws['A%d'%fdp.ConsumeIntInRange(1,fdp.ConsumeIntInRange(2, 64))] = fdp.ConsumeInt(10)\n    ws.append(fdp.ConsumeIntList(3,5))\n\n    ws['B%d'%fdp.ConsumeIntInRange(1,fdp.ConsumeIntInRange(2, 64))] = fdp.ConsumeUnicode(10)\n    ws['C%d'%fdp.ConsumeIntInRange(1,fdp.ConsumeIntInRange(2, 64))] = fdp.ConsumeBytes(10)\n    ws['D%d'%fdp.ConsumeIntInRange(1,fdp.ConsumeIntInRange(2, 64))] = fdp.ConsumeString(10)\n    ws['E%d'%fdp.ConsumeIntInRange(1,fdp.ConsumeIntInRange(2, 64))] = fdp.ConsumeFloat()\n    ws['F%d'%fdp.ConsumeIntInRange(1,fdp.ConsumeIntInRange(2, 64))] = fdp.ConsumeBool()\n\n    wb.save('%s.xlsx'%fdp.ConsumeString(10))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/fuzz_cellutil.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    import openpyxl.utils.cell as cell\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        cell.absolute_coordinate(fdp.ConsumeString(20))\n        cell.cols_from_range(fdp.ConsumeString(20))\n        cell.column_index_from_string(fdp.ConsumeString(20))\n        cell.coordinate_from_string(fdp.ConsumeString(20))\n        cell.coordinate_to_tuple(fdp.ConsumeString(20))\n        cell.get_column_interval(fdp.ConsumeInt(10),fdp.ConsumeInt(10))\n        cell.get_column_letter(fdp.ConsumeInt(10))\n        cell.quote_sheetname(fdp.ConsumeString(20))\n        cell.range_boundaries(fdp.ConsumeString(20))\n        cell.range_to_tuple(fdp.ConsumeString(20))\n        cell.rows_from_range(fdp.ConsumeString(20))\n    except ValueError as e:\n       error_list = [\n           \"is not a valid coordinate range\",\n           \"Invalid column index\",\n           \"is not a valid column name\",\n           \"is not a valid coordinate or range\",\n           \"Value must be of the form sheetname!A1:E4\"\n       ]\n       expected_error = False\n       for error in error_list:\n           if error in str(e):\n               expected_error = True\n       if not expected_error:\n           raise e\n    except CellCoordinatesException:\n        pass\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/fuzz_chart.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from openpyxl import Workbook\n    from openpyxl.chart import (\n        AreaChart,\n        AreaChart3D,\n        BarChart,\n        BarChart3D,\n        LineChart,\n        LineChart3D,\n        Reference,\n        Series\n    )\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    wb = Workbook()\n    ws = wb.active\n    cs = wb.create_chartsheet()\n    \n    choice = fdp.ConsumeIntInRange(1,6)\n    chart = AreaChart()\n\n    if choice == 2:\n        chart = AreaChart3D()\n    if choice == 3:\n        chart = BarChart()\n        chart.type = \"bar\" if fdp.ConsumeBool() else \"col\"\n        chart.shape = 4\n    if choice == 4:\n        chart = BarChart3D()\n        chart.type = \"bar\" if fdp.ConsumeBool() else \"col\"\n        chart.shape = 4\n    if choice == 5:\n        chart = LineChart()\n        chart.legend = None\n    if choice == 6:\n        chart = LineChart3D()\n        chart.legend = None\n    \n    #Chart basic settings    \n    chart.title = fdp.ConsumeString(10)\n    chart.style = 13\n    chart.x_axis.title = fdp.ConsumeString(10)\n    chart.y_axis.title = fdp.ConsumeString(10)\n\n    #Chart data\n    ws.append(['Col1', 'Col2', 'Col3'])\n    for i in range(2,8):\n        ws.append([i,fdp.ConsumeIntInRange(1,100),fdp.ConsumeIntInRange(1,100)])\n\n    chart.add_data(Reference(ws, min_col=2, min_row=1, max_col=3, max_row=7), titles_from_data=True)\n    chart.set_categories(Reference(ws, min_col=1, min_row=1, max_row=7))\n\n    #Random add chart to worksheet or chartsheet\n    ws.add_chart(chart, \"A10\") if fdp.ConsumeBool() else cs.add_chart(chart)\n    wb.save('%s.xlsx'%fdp.ConsumeString(10))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/fuzz_comment.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from openpyxl import Workbook\n    from openpyxl.comments import Comment\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    wb = Workbook()\n    ws = wb.active\n\n    #Set Comment\n    c1 = ws['A1'].comment\n    c1 = Comment(fdp.ConsumeUnicodeNoSurrogates(10),\n        fdp.ConsumeUnicodeNoSurrogates(10))\n    c1.width = 300\n    c1.height = 50\n    ws['A1'].comment = c1\n\n    #Double assign comment\n    c2 = Comment(fdp.ConsumeUnicodeNoSurrogates(10),\n        fdp.ConsumeUnicodeNoSurrogates(10))\n    ws['B1'].comment = c2\n    ws['C1'].comment = c2\n\n    try:\n        wb.save('%s.xlsx'%fdp.ConsumeUnicodeNoSurrogates(10))\n    except ValueError as e:\n        if \"embedded null byte\" not in str(e):\n            raise e\n    except FileNotFoundError:\n       # Expected for corrupted file name\n       pass\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/fuzz_formulae.py",
    "content": "\n#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from openpyxl.formula.tokenizer import *\n    from openpyxl.formula.translate import *\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        #Initial tokenizer for random string and process it\n        Tokenizer(fdp.ConsumeString(200))\n\n        #Translate random string formulae\n        Translator(fdp.ConsumeString(200), origin=\"A1\").translate_formula(\"B2\")\n    except IndexError as e:\n        if 'empty list' not in str(e):\n            raise e\n    except (TokenizerError, TranslatorError):\n        # Internal error handling is expected\n        pass\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/fuzz_load.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    import zipfile\n    import openpyxl\n\ndef TestInput(data):\n    temp_file = \"test.xlsx\"\n    with open(temp_file, \"wb\") as fd:\n        fd.write(data)\n\n    try:\n        wb2 = openpyxl.load_workbook(temp_file)\n    except (zipfile.BadZipFile ,OSError) as e:\n        pass\n    except KeyError as e:\n        if \"There is no item named '[Content_Types].xml' in the archive\" in str(e):\n            #Not related to this fuzzing - possibly caused by known issue of wrong exception type as below\n            #https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1061\n            pass\n        else:\n            raise(e)\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/fuzz_sheet.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport datetime\nwith atheris.instrument_imports():\n    from openpyxl import Workbook\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    wb = Workbook()\n    ws = wb.active\n    \n    #Row/Col management\n    ws.insert_rows(fdp.ConsumeInt(100))\n    ws.insert_cols(fdp.ConsumeInt(100))\n    ws.delete_rows(fdp.ConsumeInt(100),fdp.ConsumeInt(100))\n    ws.delete_cols(fdp.ConsumeInt(100),fdp.ConsumeInt(100))\n    ws.column_dimensions.group(\n        chr(fdp.ConsumeIntInRange(65,90)),\n        chr(fdp.ConsumeIntInRange(65,90)),\n        hidden=True\n    )\n    ws.row_dimensions.group(\n        fdp.ConsumeInt(100),\n        fdp.ConsumeInt(100),\n        hidden=True\n    )\n   \n    #Cell management\n    ws['A1'] = datetime.datetime(2022, 1, 1)\n    format = ws['A1'].number_format\n\n    ws.move_range(\n        \"G4:H10\", \n        rows=fdp.ConsumeInt(100), \n        cols=fdp.ConsumeInt(100), \n        translate=fdp.ConsumeBool()\n    )\n\n    try:\n        sr = fdp.ConsumeInt(100)\n        sc = fdp.ConsumeInt(100)\n        er = fdp.ConsumeInt(100)\n        ec = fdp.ConsumeInt(100)\n        ws.merge_cells(start_row=sr, start_column=sc, end_row=er, end_column=ec)\n        ws.unmerge_cells(start_row=sr, start_column=sc, end_row=er, end_column=ec) \n    except ValueError as e:\n        if \"Min value is 1\" not in str(e):\n           raise e\n    \n\n    wb.save('%s.xlsx'%fdp.ConsumeString(10))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/fuzz_sort.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from openpyxl import Workbook\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    wb = Workbook()\n    ws = wb.active\n    \n    ws.append(['Col1', 'Col2'])\n    for i in range(2,20):\n        ws.append([fdp.ConsumeIntInRange(1,100),fdp.ConsumeIntInRange(1,100)])\n\n    ws.auto_filter.ref = \"A%d:B%d\"%(fdp.ConsumeInt(10),fdp.ConsumeInt(10))\n    ws.auto_filter.add_filter_column(0, [fdp.ConsumeInt(10),fdp.ConsumeInt(10)])\n    ws.auto_filter.add_sort_condition(\"B%d:B%d\"%(fdp.ConsumeInt(10),fdp.ConsumeInt(10)))\n\n    wb.save('%s.xlsx'%fdp.ConsumeString(10))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/openpyxl/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://foss.heptapod.net/openpyxl/openpyxl\nlanguage: python\nmain_repo: https://foss.heptapod.net/openpyxl/openpyxl\nprimary_contact: charlie.clark@clark-consulting.eu\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/opensc/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y pcscd libccid libpcsclite-dev libssl-dev libreadline-dev autoconf automake build-essential docbook-xsl xsltproc libtool pkg-config zlib1g-dev help2man gengetopt\nRUN git clone --depth 1 --single-branch --branch master https://github.com/OpenSC/OpenSC opensc\nWORKDIR opensc\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/opensc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build OpenPACE\ngit clone https://github.com/frankmorgner/openpace.git\npushd openpace\nautoreconf --verbose --install\n./configure --enable-static --disable-shared --prefix=/usr\nmake\nmake install\npopd\n\n# enable internal and old drivers\nsed -i '/^#ifdef OPENSC_CONFIG_STRING/i #define OPENSC_CONFIG_STRING \"app default { card_drivers = old, internal; }\"' src/libopensc/ctx.c\n\n./bootstrap\n# FIXME FUZZING_LIBS=\"$LIB_FUZZING_ENGINE\" fails with some missing C++ library, I don't know how to fix this\n./configure --disable-optimization --enable-static --disable-shared --disable-pcsc --enable-ctapi --enable-openpace --enable-fuzzing FUZZING_LIBS=\"$LIB_FUZZING_ENGINE\"\nmake -j4\n\nfuzzerFiles=$(find $SRC/opensc/src/tests/fuzzing/ -name \"fuzz_*.c\")\n\nfor F in $fuzzerFiles; do\n    fuzzerName=$(basename $F .c)\n    cp \"$SRC/opensc/src/tests/fuzzing/$fuzzerName\" $OUT\n    if [ -d \"$SRC/opensc/src/tests/fuzzing/corpus/${fuzzerName}\" ]; then\n        zip -j $OUT/${fuzzerName}_seed_corpus.zip $SRC/opensc/src/tests/fuzzing/corpus/${fuzzerName}/*\n    fi\ndone\n"
  },
  {
    "path": "projects/opensc/project.yaml",
    "content": "homepage: \"https://github.com/OpenSC/OpenSC/\"\nlanguage: c++\nprimary_contact: \"frankmorgner@gmail.com\"\nauto_ccs:\n  - \"martin.paljak@gmail.com\"\n  - \"viktor.tarasov@gmail.com\"\n  - \"ludovic.rousseau@gmail.com\"\n  - \"andreas.schwier@cardcontact.de\"\n  - \"deengert@gmail.com\"\n  - \"jakuje@gmail.com\"\n  - \"xhanulik@gmail.com\"\n  - \"popovec.peter@gmail.com\"\nmain_repo: 'https://github.com/OpenSC/OpenSC'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/opensc/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmake check\n"
  },
  {
    "path": "projects/opensips/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y bison flex libssl-dev pkg-config\nRUN git clone https://github.com/OpenSIPS/opensips\n\nCOPY build.sh $SRC/\n\nWORKDIR opensips\n"
  },
  {
    "path": "projects/opensips/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash -x ./test/fuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/opensips/project.yaml",
    "content": "homepage: \"https://opensips.org/\"\nmain_repo: \"https://github.com/OpenSIPS/opensips\"\nprimary_contact: \"liviu@opensips.org\"\nlanguage: c\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"liviu.chircu@gmail.com\"\n  - \"bogdan.andrei.iancu@gmail.com\"\n  - \"rvlad.patrascu@gmail.com\"\n  - \"razvan.crainea@gmail.com\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/opensk/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl \\\n    cmake python llvm-dev libclang-dev clang uuid-runtime pkg-config libssl-dev\n\nRUN git clone --depth=1 --branch=develop https://github.com/google/OpenSK  && \\\n    cd OpenSK && \\\n    ./setup.sh && \\\n    ./fuzzing_setup.sh\n\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/opensk/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\n\nbuild_and_copy() {\n  pushd \"$1\"\n  cargo fuzz build --release --debug-assertions\n  for f in fuzz/fuzz_targets/*.rs\n  do\n    cp ${FUZZ_TARGET_OUTPUT_DIR}/$(basename ${f%.*}) $OUT/\n  done\n  popd\n}\n\ncd OpenSK\n\n# CTAP library fuzzing targets\nbuild_and_copy libraries/opensk\n\n# CBOR crate\nbuild_and_copy libraries/cbor\n\n"
  },
  {
    "path": "projects/opensk/project.yaml",
    "content": "homepage: \"https://github.com/google/OpenSK\"\nmain_repo: \"https://github.com/google/OpenSK\"\nprimary_contact: \"opensk@google.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"jmichel@google.com\"\n  - \"kaczmarczyck@google.com\"\n  - \"cretin@google.com\"\n  - \"david@adalogics.com\"\n  - \"hcyang@google.com\"\nfile_github_issue: True\n"
  },
  {
    "path": "projects/openslide/project.yaml",
    "content": "homepage: https://openslide.org/\nlanguage: c\nmain_repo: https://github.com/openslide/openslide\nprimary_contact: bgilbert@andrew.cmu.edu\n"
  },
  {
    "path": "projects/openssh/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN apt-get install -y libz-dev libssl1.1 libssl-dev libedit-dev zip\nRUN git clone --depth 1 https://github.com/openssh/openssh-portable openssh\nRUN git clone --depth 1 https://github.com/djmdjm/openssh-fuzz-cases\nWORKDIR openssh\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/openssh/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Enable null cipher\nsed -i 's/#define CFLAG_INTERNAL.*/#define CFLAG_INTERNAL 0/' cipher.c\n\n# Turn off agent unlock password failure delays\nsed -i 's|\\(usleep.*\\)|// \\1|' ssh-agent.c\n\n# Build project\nautoreconf\nenv\nif ! env CFLAGS=\"\" ./configure \\\n    --without-hardening \\\n    --without-zlib-version-check \\\n    --with-cflags=\"-DWITH_XMSS=1\" \\\n    --with-cflags-after=\"$CFLAGS\" \\\n    --with-ldflags-after=\"-g $CFLAGS\" ; then\n\techo \"------ config.log:\" 1>&2\n\tcat config.log 1>&2\n\techo \"ERROR: configure failed\" 1>&2\n\texit 1\nfi\nmake -j$(nproc) all\n\n# Build fuzzers\nEXTRA_CFLAGS=\"-DCIPHER_NONE_AVAIL=1 -D_GNU_SOURCE -Iopenbsd-compat/include\"\nSTATIC_CRYPTO=\"-Wl,-Bstatic -lcrypto -Wl,-Bdynamic\"\n\nSK_NULL=ssh-sk-null.o\nSK_DUMMY=sk-dummy.o\nCOMMON_DEPS=\"ssh-pkcs11-client.o -lssh -lopenbsd-compat\"\n\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c \\\n\tregress/misc/fuzz-harness/ssh-sk-null.cc -o ssh-sk-null.o\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c \\\n\t-DSK_DUMMY_INTEGRATE=1 regress/misc/sk-dummy/sk-dummy.c -o sk-dummy.o\n\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/pubkey_fuzz.cc -o $OUT/pubkey_fuzz \\\n\t$COMMON_DEPS $SK_NULL $STATIC_CRYPTO $LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/privkey_fuzz.cc -o $OUT/privkey_fuzz \\\n\t$COMMON_DEPS $SK_NULL $STATIC_CRYPTO $LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/sig_fuzz.cc -o $OUT/sig_fuzz \\\n\t$COMMON_DEPS $SK_NULL $STATIC_CRYPTO $LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/authopt_fuzz.cc -o $OUT/authopt_fuzz \\\n\tauth-options.o $COMMON_DEPS $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/sshsig_fuzz.cc -o $OUT/sshsig_fuzz \\\n\tsshsig.o $COMMON_DEPS $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/sshsigopt_fuzz.cc -o $OUT/sshsigopt_fuzz \\\n\tsshsig.o $COMMON_DEPS $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/kex_fuzz.cc -o $OUT/kex_fuzz \\\n\t$COMMON_DEPS -lz $SK_NULL $STATIC_CRYPTO \\\n\t$LIB_FUZZING_ENGINE\n\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c \\\n\tregress/misc/fuzz-harness/agent_fuzz_helper.c -o agent_fuzz_helper.o\n$CC $CFLAGS $EXTRA_CFLAGS -I. -g -c -DENABLE_SK_INTERNAL=1 ssh-sk.c -o ssh-sk.o\n$CXX $CXXFLAGS -std=c++11 $EXTRA_CFLAGS -I. -L. -Lopenbsd-compat -g \\\n\tregress/misc/fuzz-harness/agent_fuzz.cc -o $OUT/agent_fuzz \\\n\t$SK_DUMMY agent_fuzz_helper.o ssh-sk.o $COMMON_DEPS -lz \\\n\t$STATIC_CRYPTO $LIB_FUZZING_ENGINE\n\n# Prepare seed corpora\nCASES=\"$SRC/openssh-fuzz-cases\"\n(set -e ; cd ${CASES}/key ; zip -r $OUT/pubkey_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/privkey ; zip -r $OUT/privkey_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/sig ; zip -r $OUT/sig_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/authopt ; zip -r $OUT/authopt_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/sshsig ; zip -r $OUT/sshsig_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/sshsigopt ; zip -r $OUT/sshsigopt_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/kex ; zip -r $OUT/kex_fuzz_seed_corpus.zip .)\n(set -e ; cd ${CASES}/agent ; zip -r $OUT/agent_fuzz_seed_corpus.zip .)\n"
  },
  {
    "path": "projects/openssh/project.yaml",
    "content": "homepage: https://www.openssh.com/\nlanguage: c++\nprimary_contact: \"djm@mindrot.org\"\nauto_ccs:\n        - \"dtucker@dtucker.net\"\n        - \"djm@google.com\"\n        - \"arthur.chan@adalogics.com\"\n        - \"david@adalogics.com\"\n        - \"adam@adalogics.com\"\nmain_repo: 'https://github.com/openssh/openssh-portable'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/openssl/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/openssl/openssl.git\nRUN cd $SRC/openssl/ && git submodule update --init fuzz/corpora\nRUN git clone --depth 1 --branch openssl-3.0 https://github.com/openssl/openssl.git openssl30\nRUN git clone --depth 1 --branch openssl-3.3 https://github.com/openssl/openssl.git openssl33\nRUN git clone --depth 1 --branch openssl-3.4 https://github.com/openssl/openssl.git openssl34\nRUN git clone --depth 1 --branch openssl-3.5 https://github.com/openssl/openssl.git openssl35\nRUN git clone --depth 1 --branch openssl-3.6 https://github.com/openssl/openssl.git openssl36\nRUN cd $SRC/openssl30/ && git submodule update --init fuzz/corpora\nRUN cd $SRC/openssl33/ && git submodule update --init fuzz/corpora\nRUN cd $SRC/openssl34/ && git submodule update --init fuzz/corpora\nRUN cd $SRC/openssl35/ && git submodule update --init fuzz/corpora\nRUN cd $SRC/openssl36/ && git submodule update --init fuzz/corpora\nWORKDIR openssl\nCOPY build.sh *.options replay_build.sh run_tests.sh $SRC/\nENV AFL_SKIP_OSSFUZZ=1\nENV AFL_LLVM_MODE_WORKAROUND=0\n"
  },
  {
    "path": "projects/openssl/bignum.options",
    "content": "[libfuzzer]\nmax_len = 2048\n"
  },
  {
    "path": "projects/openssl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport FUZZ_INTROSPECTOR_CONFIG=$SRC/openssl/fuzz/fuzz_introspector_exclusion.config\n\nCONFIGURE_FLAGS=\"--debug enable-fuzz-libfuzzer -DPEDANTIC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION no-shared enable-tls1_3 enable-rc5 enable-md2 enable-nextprotoneg enable-weak-ssl-ciphers --with-fuzzer-lib=/usr/lib/libFuzzingEngine $CFLAGS -fno-sanitize=alignment enable-unit-test no-tests\"\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n  CONFIGURE_FLAGS=\"$CONFIGURE_FLAGS no-asm\"\nfi\nif [[ $CFLAGS != *-m32* ]]\nthen\n  CONFIGURE_FLAGS=\"$CONFIGURE_FLAGS enable-ec_nistp_64_gcc_128\"\nfi\nif [[ $CFLAGS = *-m32* ]]\nthen\n  # Prevent error:\n  #\n  # error while loading shared libraries:\n  # libatomic.so.1: cannot open shared object file:\n  # No such file or directory\n  CONFIGURE_FLAGS=\"$CONFIGURE_FLAGS no-threads\"\nfi\n\nfunction build_fuzzers() {\n    SUFFIX=$1\n    local EXTRA_CONFIGURE_FLAGS=\"$2\"\n    local EXTRA_SOURCES=\"$3\"\n\n    if [[ $CFLAGS = *-m32* ]]\n    then\n        setarch i386 ./config $CONFIGURE_FLAGS $EXTRA_CONFIGURE_FLAGS\n    else\n        ./config $CONFIGURE_FLAGS $EXTRA_CONFIGURE_FLAGS\n    fi\n\n    df -h\n\n    make -j$(nproc) LDCMD=\"$CXX $CXXFLAGS\"\n\n    fuzzers=$(find fuzz -executable -type f '!' -name \\*.py '!' -name \\*-test '!' -name \\*.pl '!' -name \\*.sh)\n    for f in $fuzzers; do\n        fuzzer=$(basename $f)\n        cp $f $OUT/${fuzzer}${SUFFIX}\n        zip -j $OUT/${fuzzer}${SUFFIX}_seed_corpus.zip fuzz/corpora/${fuzzer}/*\n    done\n\n    options=$(find $SRC/ -maxdepth 1 -name '*.options')\n    for o in $options; do\n        o_base=$(basename $o)\n        fuzzer=${o_base%\".options\"}\n        cp $o $OUT/${fuzzer}${SUFFIX}.options\n    done\n    cp fuzz/oids.txt $OUT/asn1${SUFFIX}.dict\n    cp fuzz/oids.txt $OUT/x509${SUFFIX}.dict\n    if [ \"$SANITIZER\" == coverage ]; then\n      DESTDIR=$OUT/src/openssl${SUFFIX#_}\n      SOURCES=\"include crypto ssl providers fuzz $EXTRA_SOURCES\"\n      mkdir -p $DESTDIR\n      if [ -f e_os.h ]; then\n        cp e_os.h $DESTDIR/\n      fi\n      find $SOURCES -type f -a \\( -name '*.[ch]' -o -name '*.inc' \\) -exec cp --parents '{}' $DESTDIR/ \\;\n    fi\n\n    df -h\n    if [[ -z \"${CAPTURE_REPLAY_SCRIPT:-}\" ]]; then\n      git clean -dfx\n    fi\n    df -h\n}\n\ncd $SRC/openssl/\nbuild_fuzzers \"\" \"no-apps no-docs\" \"\"\n\n# In introspector, indexer builds and when capturing replay builds, only build\n# the master branch\nif [[ \"$SANITIZER\" == introspector || -n \"${INDEXER_BUILD:-}\" || -n \"${CAPTURE_REPLAY_SCRIPT:-}\" ]]; then\n  exit 0\nfi\n\ncd $SRC/openssl30/\nbuild_fuzzers \"_30\" \"\" \"engines\"\ncd $SRC/openssl33/\nbuild_fuzzers \"_33\" \"no-apps no-docs\" \"engines\"\ncd $SRC/openssl34/\nbuild_fuzzers \"_34\" \"no-apps no-docs\" \"engines\"\ncd $SRC/openssl35/\nbuild_fuzzers \"_35\" \"no-apps no-docs\" \"engines\"\ncd $SRC/openssl36/\nbuild_fuzzers \"_36\" \"no-apps no-docs\" \"engines\"\n"
  },
  {
    "path": "projects/openssl/project.yaml",
    "content": "homepage: \"https://www.openssl.org/\"\nlanguage: c++\nprimary_contact: \"kurt@roeckx.be\"\nauto_ccs:\n - \"openssl-security@openssl.org\"\n - \"matt@openssl.org\"\n - \"richard@levitte.org\"\n - \"tomas@openssl.org\"\n - \"paulidale@openssl.org\"\n - \"nhorman@openssl.org\"\n - \"tjh@openssl.org\"\n - \"tjh@cryptsoft.com\"\n - \"sashan@openssl.org\"\n - \"viktor@openssl.org\"\n - \"andrewd@openssl.org\"\n - \"nikolap@openssl.org\"\n - \"milanb@openssl.org\"\n - \"eugenes@openssl.org\"\n - \"norbertp@openssl.org\"\nsanitizers:\n - address\n - memory:\n    experimental: True\n - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/openssl/openssl.git'\nfuzzing_engines:\n - afl\n - honggfuzz\n - libfuzzer\n"
  },
  {
    "path": "projects/openssl/quic-srtm.options",
    "content": "[libfuzzer]\ntimeout = 120\n"
  },
  {
    "path": "projects/openssl/replay_build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# This script is useful for OSS-Fuzz infrastructure which is used to rebuild\n# code from cached images. This is to support various ongoing efforts in\n# OSS-Fuzz.\n\nexport FUZZ_INTROSPECTOR_CONFIG=$SRC/openssl/fuzz/fuzz_introspector_exclusion.config\n\nfunction build_fuzzers() {\n    SUFFIX=$1\n    make -j$(nproc) LDCMD=\"$CXX $CXXFLAGS\"\n\n    fuzzers=$(find fuzz -executable -type f '!' -name \\*.py '!' -name \\*-test '!' -name \\*.pl '!' -name \\*.sh)\n    for f in $fuzzers; do\n        fuzzer=$(basename $f)\n        cp $f $OUT/${fuzzer}${SUFFIX}\n    done\n}\n\ncd $SRC/openssl/\nbuild_fuzzers \"\"\n\n# We only build in head, and not various versions in replay mode. Leaving the\n# below commented out to make this explicit.\n# cd $SRC/openssl30/\n# build_fuzzers \"_30\"\n# cd $SRC/openssl31/\n# build_fuzzers \"_31\"\n# cd $SRC/openssl32/\n# build_fuzzers \"_32\"\n"
  },
  {
    "path": "projects/openssl/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/openssl\nmake test\n"
  },
  {
    "path": "projects/opentelemetry/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/open-telemetry/opentelemetry-collector\nRUN git clone --depth=1 https://github.com/dvyukov/go-fuzz-corpus\nRUN git clone --depth 1 https://github.com/AdamKorcz/opentelemetry-collector-contrib --branch=fuzz\nWORKDIR opentelemetry-collector\nCOPY build.sh dict $SRC/\n"
  },
  {
    "path": "projects/opentelemetry/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/opentelemetry-collector-contrib\ncd processor/groupbyattrsprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzProcessTraces FuzzProcessTraces_groupbyattrsprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzProcessLogs FuzzProcessLogs_groupbyattrsprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzProcessMetrics FuzzProcessMetrics_groupbyattrsprocessor\n\ncd ../logdedupprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzConsumeLogs FuzzConsumeLogs_logdedupprocessor\n\ncd ../probabilisticsamplerprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzConsumeTraces FuzzConsumeTraces_probabilisticsamplerprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzConsumeLogs FuzzConsumeLogs__probabilisticsamplerprocessor\n\ncd ../sumologicprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzProcessTraces FuzzProcessTraces_sumologicprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzProcessLogs FuzzProcessLogs_sumologicprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzProcessMetrics FuzzProcessMetrics_sumologicprocessor\n\ncd ../tailsamplingprocessor\ncompile_native_go_fuzzer_v2 $(go list) FuzzConsumeTraces FuzzConsumeTraces_tailsamplingprocessor\n\ncd ../../receiver/lokireceiver/internal\ncompile_native_go_fuzzer_v2 $(go list) FuzzParseRequest FuzzParseRequest_loki\n\ncd ../../mongodbatlasreceiver\ncompile_native_go_fuzzer_v2 $(go list) FuzzHandleReq FuzzHandleReq_mongodbatlasreceiver\n\ncd ../sapmreceiver\ncompile_native_go_fuzzer_v2 $(go list) FuzzParseTraceV2Request FuzzParseTraceV2Request_sapmreceiver\n\ncd ../signalfxreceiver\ncompile_native_go_fuzzer_v2 $(go list) FuzzHandleDatapointReq FuzzHandleDatapointReq_signalfxreceiver\n\ncd ../splunkhecreceiver\ncompile_native_go_fuzzer_v2 $(go list) FuzzHandleRawReq FuzzHandleRawReq_splunkhecreceiver\n\ncd ../cloudflarereceiver\ncompile_native_go_fuzzer_v2 $(go list) FuzzHandleReq FuzzHandleReq_cloudflarereceiver\n\ncd ../webhookeventreceiver\ncompile_native_go_fuzzer_v2 $(go list) FuzzHandleReq FuzzHandleReq_webhookeventreceiver\n\ncd $SRC/opentelemetry-collector\ncd receiver/otlpreceiver\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/receiver/otlpreceiver FuzzReceiverHandlers FuzzReceiverHandlers\ncd -\n\ncd pdata\nrm plog/doc_test.go\nrm pmetric/doc_test.go\nrm ptrace/doc_test.go\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/plog FuzzUnmarshalJsonLogs FuzzUnmarshalJsonLogs_plogs\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/plog FuzzUnmarshalPBLogs FuzzUnmarshalPBLogs_plogs\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/plog/plogotlp FuzzRequestUnmarshalJSON FuzzRequestUnmarshalJSON_plogotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/plog/plogotlp FuzzResponseUnmarshalJSON FuzzResponseUnmarshalJSON_plogotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/plog/plogotlp FuzzRequestUnmarshalProto FuzzRequestUnmarshalProto_plogotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/plog/plogotlp FuzzResponseUnmarshalProto FuzzResponseUnmarshalProto_plogotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pmetric FuzzUnmarshalMetrics FuzzUnmarshalMetrics_pmetric\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp FuzzRequestUnmarshalJSON FuzzRequestUnmarshalJSON_pmetricotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp FuzzResponseUnmarshalJSON FuzzResponseUnmarshalJSON_pmetricotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp FuzzRequestUnmarshalProto FuzzRequestUnmarshalProto_pmetricotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp FuzzResponseUnmarshalProto FuzzResponseUnmarshalProto_pmetricotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/ptrace FuzzUnmarshalPBTraces FuzzUnmarshalPBTraces_ptrace\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/ptrace FuzzUnmarshalJSONTraces FuzzUnmarshalJSONTraces_ptrace\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp FuzzRequestUnmarshalJSON FuzzRequestUnmarshalJSON_ptraceotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp FuzzResponseUnmarshalJSON FuzzResponseUnmarshalJSON_ptraceotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp FuzzRequestUnmarshalProto FuzzRequestUnmarshalProto_ptraceotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp FuzzResponseUnmarshalProto FuzzResponseUnmarshalProto_ptraceotlp\n\ncd $SRC/opentelemetry-collector/pdata/pprofile\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp FuzzRequestUnmarshalJSON FuzzRequestUnmarshalJSON_pprofileotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp FuzzResponseUnmarshalJSON FuzzResponseUnmarshalJSON_pprofileotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp FuzzRequestUnmarshalProto FuzzRequestUnmarshalProto_pprofileotlp\ncompile_native_go_fuzzer_v2 go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp FuzzResponseUnmarshalProto FuzzResponseUnmarshalProto_pprofileotlp\n\ncp $SRC/dict $OUT/FuzzUnmarshalJsonLogs_plogs.dict\ncp $SRC/dict $OUT/FuzzRequestUnmarshalJSON_pprofileotlp.dict\ncp $SRC/dict $OUT/FuzzResponseUnmarshalJSON_pprofileotlp.dict\ncp $SRC/dict $OUT/FuzzRequestUnmarshalJSON_plogotlp.dict\ncp $SRC/dict $OUT/FuzzResponseUnmarshalJSON_plogotlp.dict\ncp $SRC/dict $OUT/FuzzUnmarshalMetrics_pmetric.dict\ncp $SRC/dict $OUT/FuzzRequestUnmarshalJSON_pmetricotlp.dict\ncp $SRC/dict $OUT/FuzzResponseUnmarshalJSON_pmetricotlp.dict\ncp $SRC/dict $OUT/FuzzUnmarshalJSONTraces_ptrace.dict\ncp $SRC/dict $OUT/FuzzRequestUnmarshalJSON_ptraceotlp.dict\ncp $SRC/dict $OUT/FuzzResponseUnmarshalJSON_ptraceotlp.dict\n\nzip -j $OUT/FuzzUnmarshalJsonLogs_plogs_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzRequestUnmarshalJSON_pprofileotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzResponseUnmarshalJSON_pprofileotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzRequestUnmarshalJSON_plogotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzResponseUnmarshalJSON_plogotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzUnmarshalMetrics_pmetric_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzRequestUnmarshalJSON_pmetricotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzResponseUnmarshalJSON_pmetricotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzUnmarshalJSONTraces_ptrace_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzRequestUnmarshalJSON_ptraceotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\nzip -j $OUT/FuzzResponseUnmarshalJSON_ptraceotlp_seed_corpus.zip $SRC/go-fuzz-corpus/json/corpus/*\n\n"
  },
  {
    "path": "projects/opentelemetry/dict",
    "content": "\"resource_spans\"\n\"deprecated_scope_spans\"\n\"resource\"\n\"scope_spans\"\n\"schema_url\"\n\"scope\"\n\"spans\"\n\"trace_id\"\n\"span_id\"\n\"trace_state\"\n\"parent_span_id\"\n\"flags\"\n\"name\"\n\"kind\"\n\"start_time_unix_nano\"\n\"end_time_unix_nano\"\n\"attributes\"\n\"dropped_attributes_count\"\n\"events\"\n\"dropped_events_count\"\n\"links\"\n\"dropped_links_count\"\n\"status\"\n\"time_unix_nano\"\n\"message\"\n\"code\"\n\"resource_metrics\"\n\"deprecated_scope_metrics\"\n\"scope_metrics\"\n\"metrics\"\n\"description\"\n\"unit\"\n\"metadata\"\n\"gauge\"\n\"sum\"\n\"histogram\"\n\"exponential_histogram\"\n\"summary\"\n\"data_points\"\n\"aggregation_temporality\"\n\"is_monotonic\"\n\"exemplars\"\n\"as_double\"\n\"as_int\"\n\"count\"\n\"bucket_counts\"\n\"explicit_bounds\"\n\"min\"\n\"max\"\n\"scale\"\n\"zero_count\"\n\"positive\"\n\"negative\"\n\"zero_threshold\"\n\"offset\"\n\"quantile_values\"\n\"quantile\"\n\"value\"\n\"filtered_attributes\"\n\"resource_logs\"\n\"deprecated_scope_logs\"\n\"scope_logs\"\n\"log_records\"\n\"observed_time_unix_nano\"\n\"severity_number\"\n\"severity_text\"\n\"body\"\n\"string_value\"\n\"bool_value\"\n\"int_value\"\n\"double_value\"\n\"array_value\"\n\"kvlist_value\"\n\"bytes_value\"\n\"values\"\n\"key\"\n\"version\"\n\"partial_success\"\n\"rejected_spans\"\n\"error_message\"\n\"rejected_data_points\"\n\"rejected_log_records\"\n\"resource_profiles\"\n\"rejected_profiles\"\n\"sample_type\"\n\"sample\"\n\"mapping\"\n\"location\"\n\"location_indices\"\n\"function\"\n\"attribute_table\"\n\"attribute_units\"\n\"link_table\"\n\"string_table\"\n\"drop_frames\"\n\"keep_frames\"\n\"time_nanos\"\n\"duration_nanos\"\n\"period_type\"\n\"period\"\n\"comment\"\n\"default_sample_type\"\n\"attribute_key\"\n\"type\"\n\"location_index\"\n\"locations_start_index\"\n\"locations_length\"\n\"stacktrace_id_index\"\n\"label\"\n\"link\"\n\"timestamps_unix_nano\"\n\"str\"\n\"num\"\n\"num_unit\"\n\"id\"\n\"memory_start\"\n\"memory_limit\"\n\"file_offset\"\n\"filename\"\n\"build_id\"\n\"build_id_kind\"\n\"has_functions\"\n\"has_filenames\"\n\"has_line_numbers\"\n\"has_inline_frames\"\n\"mapping_index\"\n\"address\"\n\"line\"\n\"is_folded\"\n\"type_index\"\n\"function_index\"\n\"column\"\n\"system_name\"\n\"start_line\"\n\"scope_profiles\"\n\"profiles\"\n\"profile_id\"\n\"original_payload_format\"\n\"original_payload\"\n\"profile\"\n"
  },
  {
    "path": "projects/opentelemetry/project.yaml",
    "content": "homepage: \"https://opentelemetry.io/\"\nlanguage: go\nprimary_contact: \"cncf-opentelemetry-tc@lists.cncf.io\"\nmain_repo: \"https://github.com/open-telemetry/community\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/opentelemetry-go/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth=1 https://github.com/open-telemetry/opentelemetry-go\nWORKDIR $SRC/opentelemetry-go\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/opentelemetry-go/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nREPO=$PWD\n\ncd $REPO/attribute\n# Mitigate the error: found packages attribute_test and attribute in /src/opentelemetry-go/attribute.\n# Remove all Go files with *_test package before building the fuzzer.\n# Tracking issue: https://github.com/google/oss-fuzz/issues/7923.\ngrep -rl --include=\"*.go\" '^package .*_test' . | xargs rm -f \ncompile_native_go_fuzzer_v2 $(go list) FuzzHashKVs sdk_attribute_FuzzHashKVs\n\ncd $REPO/sdk/metric/internal/aggregate\ncompile_native_go_fuzzer_v2 $(go list) FuzzGetBin sdk_metric_internal_aggregate_FuzzGetBin\n\ncd $REPO/trace\ncompile_native_go_fuzzer_v2 $(go list) FuzzTraceIDFromHex trace_FuzzTraceIDFromHex\ncompile_native_go_fuzzer_v2 $(go list) FuzzSpanIDFromHex trace_FuzzSpanIDFromHex\n"
  },
  {
    "path": "projects/opentelemetry-go/project.yaml",
    "content": "homepage: \"https://opentelemetry.io/\"\nlanguage: go\nprimary_contact: \"cncf-opentelemetry-tc@lists.cncf.io\"\nmain_repo: \"https://github.com/open-telemetry/opentelemetry-go/\"\nauto_ccs:\n  - \"pellared@gmail.com\"\n  - \"dashpole@google.com\"\n  - \"damien@famillemathi.eu\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/opentelemetry-go-contrib/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/open-telemetry/opentelemetry-go-contrib\nWORKDIR $SRC/opentelemetry-go-contrib\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/opentelemetry-go-contrib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nREPO=$PWD\n\ncd $REPO/otelconf/v0.3.0\ncompile_native_go_fuzzer_v2 $(go list) FuzzJSON otelconf_v0.3.0_FuzzJSON\ncompile_native_go_fuzzer_v2 $(go list) FuzzYAML otelconf_v0.3.0_FuzzYAML\ncompile_native_go_fuzzer_v2 $(go list) FuzzYAMLWithEnvVars otelconf_v0.3.0_FuzzYAMLWithEnvVars\n"
  },
  {
    "path": "projects/opentelemetry-go-contrib/project.yaml",
    "content": "homepage: \"https://opentelemetry.io/\"\nlanguage: go\nprimary_contact: \"cncf-opentelemetry-tc@lists.cncf.io\"\nmain_repo: \"https://github.com/open-telemetry/opentelemetry-go-contrib/\"\nauto_ccs:\n  - \"pellared@gmail.com\"\n  - \"dashpole@google.com\"\n  - \"damien@famillemathi.eu\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/openthread/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y cmake ninja-build\nRUN git clone --depth 1 https://github.com/openthread/openthread\n\nWORKDIR openthread\nCOPY run_tests.sh build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/openthread/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash tests/fuzz/oss-fuzz-build\n"
  },
  {
    "path": "projects/openthread/project.yaml",
    "content": "homepage: \"https://github.com/openthread/openthread\"\nlanguage: c++\nprimary_contact: \"jonhui@google.com\"\nauto_ccs:\n  - \"abtink@google.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/openthread/openthread'\n"
  },
  {
    "path": "projects/openthread/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Skip Nexus unit test which requires network connection\nctest --test-dir build -E \"nexus*\"\n"
  },
  {
    "path": "projects/openvpn/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y pkg-config make autoconf automake libtool libssl-dev liblzo2-dev libpam-dev libnl-3-dev libnl-genl-3-dev libcap-ng-dev\n\nRUN git clone --depth 1 https://github.com/google/boringssl.git boringssl\nRUN git clone --depth 1 https://github.com/OpenVPN/openvpn openvpn\nWORKDIR openvpn\nCOPY build.sh $SRC/\nCOPY fuzz*.cpp $SRC/\nCOPY fuzz*.c $SRC/\nCOPY fuzz*.h $SRC/openvpn/src/openvpn/\n\nCOPY crypto_patch.txt $SRC/crypto_patch.txt\n"
  },
  {
    "path": "projects/openvpn/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBASE=${SRC}/openvpn/src/openvpn\n\napply_sed_changes() {\n  sed -i 's/read(/fuzz_read(/g' ${BASE}/console_systemd.c\n  sed -i 's/fgets(/fuzz_fgets(/g' ${BASE}/console_builtin.c\n  sed -i 's/fgets(/fuzz_fgets(/g' ${BASE}/misc.c\n  sed -i 's/#include \"forward.h\"/#include \"fuzz_header.h\"\\n#include \"forward.h\"/g' ${BASE}/proxy.c\n  sed -i 's/openvpn_select(/fuzz_select(/g' ${BASE}/proxy.c\n  sed -i 's/openvpn_send(/fuzz_send(/g' ${BASE}/proxy.c\n  sed -i 's/recv(/fuzz_recv(/g' ${BASE}/proxy.c\n  sed -i 's/isatty/fuzz_isatty/g' ${BASE}/console_builtin.c\n\n  sed -i 's/fopen/fuzz_fopen/g' ${BASE}/console_builtin.c\n  sed -i 's/fclose/fuzz_fclose/g' ${BASE}/console_builtin.c\n\n  sed -i 's/sendto/fuzz_sendto/g' ${BASE}/socket.h\n  sed -i 's/#include \"misc.h\"/#include \"misc.h\"\\nextern size_t fuzz_sendto(int sockfd, void *buf, size_t len, int flags, struct sockaddr *dest_addr, socklen_t addrlen);/g' ${BASE}/socket.h\n\n  sed -i 's/fp = (flags/fp = stdout;\\n\\/\\//g' ${BASE}/error.c\n\n  sed -i 's/crypto_msg(M_FATAL/crypto_msg(M_WARN/g' ${BASE}/crypto_openssl.c\n  sed -i 's/msg(M_FATAL, \\\"Cipher/return;msg(M_FATAL, \\\"Cipher/g' ${BASE}/crypto.c\n  sed -i 's/msg(M_FATAL/msg(M_WARN/g' ${BASE}/crypto.c\n\n  sed -i 's/= write/= fuzz_write/g' ${BASE}/packet_id.c\n}\n\n# Changes in the code so we can fuzz it.\n#git apply $SRC/crypto_patch.txt\n\necho \"\" >> ${BASE}/openvpn.c\necho \"#include \\\"fake_fuzz_header.h\\\"\" >> ${BASE}/openvpn.c\necho \"ssize_t fuzz_get_random_data(void *buf, size_t len) { return 0; }\" >> ${BASE}/fake_fuzz_header.h\necho \"int fuzz_success;\" >> ${BASE}/fake_fuzz_header.h\n\n# Apply hooking changes\napply_sed_changes\n\n# Copy corpuses out\nzip -r $OUT/fuzz_verify_cert_seed_corpus.zip $SRC/boringssl/fuzz/cert_corpus\n\n# Build openvpn\nautoreconf -ivf\n./configure --disable-lz4 --with-crypto-library=openssl OPENSSL_LIBS=\"-L/usr/local/ssl/ -lssl -lcrypto\" OPENSSL_CFLAGS=\"-I/usr/local/ssl/include/\"\nmake -j$(nproc)\n\n# Make openvpn object files into a library we can link fuzzers to\ncd src/openvpn\nrm openvpn.o\nar r libopenvpn.a *.o\n\n# Compile our fuzz helper\n$CXX $CXXFLAGS -g -c $SRC/fuzz_randomizer.cpp -o $SRC/fuzz_randomizer.o\n\n# Compile the fuzzers\nfor fuzzname in dhcp misc base64 proxy buffer route packet_id mroute list verify_cert; do\n    $CC -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src/compat -I/usr/include/libnl3/ \\\n      -DPLUGIN_LIBDIR=\\\"/usr/local/lib/openvpn/plugins\\\" -std=c99 $CFLAGS \\\n      -c $SRC/fuzz_${fuzzname}.c -o $SRC/fuzz_${fuzzname}.o\n\n    # Link with CXX\n    $CXX ${CXXFLAGS} ${LIB_FUZZING_ENGINE} $SRC/fuzz_${fuzzname}.o -o $OUT/fuzz_${fuzzname} $SRC/fuzz_randomizer.o \\\n        libopenvpn.a ../../src/compat/.libs/libcompat.a /usr/lib/x86_64-linux-gnu/libnsl.a \\\n        /usr/lib/x86_64-linux-gnu/libresolv.a /usr/lib/x86_64-linux-gnu/liblzo2.a \\\n        -lssl -lcrypto -ldl -l:libnl-3.a -l:libnl-genl-3.a -lcap-ng\ndone\n"
  },
  {
    "path": "projects/openvpn/crypto_patch.txt",
    "content": "diff --git a/src/openvpn/crypto.c b/src/openvpn/crypto.c\nindex b5ae17e..e9d8f5e 100644\n--- a/src/openvpn/crypto.c\n+++ b/src/openvpn/crypto.c\n@@ -131,7 +131,10 @@ openvpn_encrypt_aead(struct buffer *buf, struct buffer work,\n     ASSERT(buf_inc_len(&work, outlen));\n \n     /* Flush the encryption buffer */\n-    ASSERT(cipher_ctx_final(ctx->cipher, BEND(&work), &outlen));\n+    //ASSERT(cipher_ctx_final(ctx->cipher, BEND(&work), &outlen));\n+    if (!(cipher_ctx_final(ctx->cipher, BEND(&work), &outlen))) {\n+        goto err;\n+    }\n     ASSERT(buf_inc_len(&work, outlen));\n \n     /* Write authentication tag */\n@@ -738,6 +741,7 @@ warn_insecure_key_type(const char *ciphername)\n     }\n }\n \n+extern int fuzz_success;\n /*\n  * Build a struct key_type.\n  */\n@@ -756,6 +760,7 @@ init_key_type(struct key_type *kt, const char *ciphername,\n     {\n         if (!cipher_valid(ciphername))\n         {\n+\t    fuzz_success = 0;\n             msg(M_FATAL, \"Cipher %s not supported\", ciphername);\n         }\n \n@@ -768,15 +773,18 @@ init_key_type(struct key_type *kt, const char *ciphername,\n #endif\n               ))\n         {\n+\t    fuzz_success = 0;\n             msg(M_FATAL, \"Cipher '%s' mode not supported\", ciphername);\n         }\n \n         if (OPENVPN_MAX_CIPHER_BLOCK_SIZE < cipher_kt_block_size(kt->cipher))\n         {\n+\t    fuzz_success = 0;\n             msg(M_FATAL, \"Cipher '%s' not allowed: block size too big.\", ciphername);\n         }\n         if (warn)\n         {\n+\t    fuzz_success = 0;\n             warn_insecure_key_type(ciphername);\n         }\n     }\n@@ -784,6 +792,7 @@ init_key_type(struct key_type *kt, const char *ciphername,\n     {\n         if (warn)\n         {\n+\t    fuzz_success = 0;\n             msg(M_WARN, \"******* WARNING *******: '--cipher none' was specified. \"\n                 \"This means NO encryption will be performed and tunnelled \"\n                 \"data WILL be transmitted in clear text over the network! \"\n@@ -803,6 +812,7 @@ init_key_type(struct key_type *kt, const char *ciphername,\n \n             if (OPENVPN_MAX_HMAC_SIZE < hmac_length)\n             {\n+\t        fuzz_success = 0;\n                 msg(M_FATAL, \"HMAC '%s' not allowed: digest size too big.\", authname);\n             }\n         }\n@@ -811,6 +821,7 @@ init_key_type(struct key_type *kt, const char *ciphername,\n     {\n         if (warn)\n         {\n+\t    fuzz_success = 0;\n             msg(M_WARN, \"******* WARNING *******: '--auth none' was specified. \"\n                 \"This means no authentication will be performed on received \"\n                 \"packets, meaning you CANNOT trust that the data received by \"\n@@ -818,6 +829,7 @@ init_key_type(struct key_type *kt, const char *ciphername,\n                 \"PLEASE DO RECONSIDER THIS SETTING!\");\n         }\n     }\n+    fuzz_success = 1;\n }\n \n /* given a key and key_type, build a key_ctx */\n@@ -994,6 +1006,7 @@ generate_key_random(struct key *key, const struct key_type *kt)\n     } while (kt && !check_key(key, kt));\n \n     gc_free(&gc);\n+    fuzz_success = 1;\n }\n \n static void\n@@ -1222,6 +1235,7 @@ read_key_file(struct key2 *key2, const char *file, const unsigned int flags)\n         if (!buf_valid(&in))\n         {\n             msg(M_FATAL, \"Read error on key file ('%s')\", file);\n+    \t\tfuzz_success = 0;\n         }\n \n         size = in.len;\n@@ -1314,6 +1328,7 @@ read_key_file(struct key2 *key2, const char *file, const unsigned int flags)\n                         c, line_num,\n                         print_key_filename(file, flags & RKF_INLINE), count,\n                         onekeylen, keylen);\n+    \t\t    fuzz_success = 0;\n                 }\n             }\n             ++line_index;\n@@ -1336,6 +1351,7 @@ read_key_file(struct key2 *key2, const char *file, const unsigned int flags)\n             msg(M_FATAL, \"Insufficient key material or header text not found in file '%s' (%d/%d/%d bytes found/min/max)\",\n                 print_key_filename(file, flags & RKF_INLINE), count, onekeylen,\n                 keylen);\n+    \t\tfuzz_success = 0;\n         }\n \n         if (state != PARSE_FINISHED)\n@@ -1343,8 +1359,12 @@ read_key_file(struct key2 *key2, const char *file, const unsigned int flags)\n             msg(M_FATAL, \"Footer text not found in file '%s' (%d/%d/%d bytes found/min/max)\",\n                 print_key_filename(file, flags & RKF_INLINE), count, onekeylen,\n                 keylen);\n+    \t\tfuzz_success = 0;\n         }\n     }\n+    else {\n+    \t\tfuzz_success = 1;\n+    }\n \n     /* zero file read buffer if not an inline file */\n     if (!(flags & RKF_INLINE))\n"
  },
  {
    "path": "projects/openvpn/fuzz.h",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n// Returns a NULL-terminated C string that should be freed by the caller.\nchar *get_modifiable_string(FuzzedDataProvider &provider) {\n  std::string s1 = provider.ConsumeRandomLengthString();\n  char *tmp = (char *)malloc(s1.size() + 1);\n  memcpy(tmp, s1.c_str(), s1.size());\n  tmp[s1.size()] = '\\0';\n  return tmp;\n}\n\nFuzzedDataProvider *prov = NULL;\n\n\nextern \"C\" ssize_t fuzz_get_random_data(void *buf, size_t len) {\n  size_t ret_val;\n  char *cbuf = (char*)buf;\n\n  if (prov->remaining_bytes() == 0) {\n    return -1;\n  }\n\n  double prob = prov->ConsumeProbability<double>();\n  if (prob < 0.05) {\n    return 0;\n  }\n\n  if (len == 1) {\n    ret_val = prov->ConsumeData(buf, 1);\n    return ret_val;\n  }\n  ret_val = prov->ConsumeData(buf, len);\n  return ret_val;\n}\n\n"
  },
  {
    "path": "projects/openvpn/fuzz_base64.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"base64.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size > 500) {\n    return 0;\n  }\n\n  char *new_str = (char *)malloc(size + 1);\n  if (new_str == NULL) {\n    return 0;\n  }\n  memcpy(new_str, data, size);\n  new_str[size] = '\\0';\n\n  char *str = NULL;\n  openvpn_base64_encode(data, size, &str);\n  if(str != NULL) {\n    free(str);\n  }\n\n  uint16_t outsize = 10000;\n  char *output_buf = (char *)malloc(outsize);\n  openvpn_base64_decode(new_str, output_buf, outsize);\n  free(output_buf);\n\n  free(new_str);\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_buffer.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n\n#include \"config.h\"\n#include \"syshead.h\"\n#include \"misc.h\"\n#include \"buffer.h\"\n\n#include \"fuzz_randomizer.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fuzz_random_init(data,size);\n\n  struct gc_arena gc;\n  struct buffer *bufp;\n  struct buffer buf, buf2;\n  struct buffer_list *buflistp = NULL;\n  ssize_t generic_ssizet, _size;\n  char *tmp;\n  char *tmp2;\n  char match;\n\n  gc = gc_new();\n  bufp = NULL;\n\n  int total_to_fuzz = fuzz_randomizer_get_int(1, 20);\n  for (int i = 0; i < total_to_fuzz; i++) {\n    if (bufp == NULL) {\n      generic_ssizet = fuzz_randomizer_get_int(0, 1);\n      if (generic_ssizet == 0) {\n        _size = fuzz_randomizer_get_int(0, 100);\n        buf = alloc_buf_gc(_size, &gc);\n        bufp = &buf;\n      } else {\n        tmp = get_random_string();\n        buf = string_alloc_buf(tmp, &gc);\n        bufp = &buf;\n        free(tmp);\n        tmp = NULL;\n      }\n    } else {\n#define NUM_TARGETS 31\n      generic_ssizet = fuzz_randomizer_get_int(0, NUM_TARGETS);\n      switch (generic_ssizet) {\n      case 0:\n        buf_clear(bufp);\n        break;\n      case 1:\n        buf2 = clone_buf(bufp);\n        free_buf(&buf2);\n        break;\n      case 2:\n        buf_defined(bufp);\n        break;\n      case 3:\n        buf_valid(bufp);\n        break;\n      case 4:\n        buf_bptr(bufp);\n        break;\n      case 5:\n        buf_len(bufp);\n        break;\n      case 6:\n        buf_bend(bufp);\n        break;\n      case 7:\n        buf_blast(bufp);\n        break;\n      case 8:\n        buf_str(bufp);\n        break;\n      case 9:\n        generic_ssizet = fuzz_randomizer_get_int(0, 255);\n        buf_rmtail(bufp, (uint8_t)generic_ssizet);\n        break;\n      case 10:\n        buf_chomp(bufp);\n        break;\n      case 11:\n        tmp = get_random_string();\n        skip_leading_whitespace(tmp);\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 12:\n        tmp = get_random_string();\n        chomp(tmp);\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 13:\n        tmp = get_random_string();\n        tmp2 = get_random_string();\n        rm_trailing_chars(tmp, tmp2);\n        free(tmp);\n        free(tmp2);\n        tmp = NULL;\n        tmp2 = NULL;\n        break;\n      case 14:\n        tmp = get_random_string();\n        string_clear(tmp);\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 15:\n        tmp = get_random_string();\n        buf_string_match_head_str(bufp, tmp);\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 16:\n        tmp = get_random_string();\n        buf_string_compare_advance(bufp, tmp);\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 17:\n        generic_ssizet = fuzz_randomizer_get_int(0, 255);\n\n        tmp = get_random_string();\n        if (strlen(tmp) > 0) {\n          buf_parse(bufp, (int)generic_ssizet, tmp, strlen(tmp));\n        }\n\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 18:\n        tmp = get_random_string();\n        string_mod(tmp, fuzz_randomizer_get_int(0, 12312),\n                   fuzz_randomizer_get_int(0, 23141234),\n                   (char)fuzz_randomizer_get_int(0, 255));\n\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 19:\n        tmp = get_random_string();\n        match = (char)fuzz_randomizer_get_int(0, 255);\n        if (match != 0) {\n          string_replace_leading(tmp, match, (char)fuzz_randomizer_get_int(0, 255));\n        }\n\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 20:\n        tmp = get_random_string();\n        buf_write(bufp, tmp, strlen(tmp));\n\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 21:\n        tmp = get_random_string();\n\n        buf_write_prepend(bufp, tmp, strlen(tmp));\n\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 22:\n        buf_write_u8(bufp, fuzz_randomizer_get_int(0, 255));\n        break;\n      case 23:\n        buf_write_u16(bufp, fuzz_randomizer_get_int(0, 1024));\n        break;\n      case 24:\n        buf_write_u32(bufp, fuzz_randomizer_get_int(0, 12312));\n        break;\n      case 25:\n        tmp = get_random_string();\n        buf_catrunc(bufp, tmp);\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 26:\n        tmp = get_random_string();\n        buf_puts(bufp, tmp);\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 27:\n        buf_advance(bufp, fuzz_randomizer_get_int(0, 25523));\n        break;\n      case 28:\n        buf_prepend(bufp, fuzz_randomizer_get_int(0, 251235));\n        break;\n      case 29:\n        buf_reverse_capacity(bufp);\n        break;\n      case 30:\n        buf_forward_capacity_total(bufp);\n        break;\n      case 31:\n        buf_forward_capacity(bufp);\n        break;\n      }\n    }\n\n    if (buflistp == NULL) {\n      buflistp = buffer_list_new();\n    } else {\n#define NUM_LIST_TARGETS 6\n      generic_ssizet = fuzz_randomizer_get_int(0, NUM_LIST_TARGETS);\n      switch (generic_ssizet) {\n      case 0:\n        buffer_list_free(buflistp);\n        buflistp = NULL;\n        break;\n      case 1:\n        buffer_list_defined(buflistp);\n        break;\n      case 2:\n        tmp = get_random_string();\n        if (strlen(tmp) < BUF_SIZE_MAX) {\n          buffer_list_push(buflistp, tmp);\n        }\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 3:\n        buffer_list_peek(buflistp);\n        break;\n      case 4:\n        buffer_list_pop(buflistp);\n        break;\n      case 5:\n        tmp = get_random_string();\n        buffer_list_aggregate_separator(\n            buflistp, fuzz_randomizer_get_int(0, 1024), tmp);\n\n        free(tmp);\n        tmp = NULL;\n        break;\n      case 6:\n        buffer_list_aggregate(buflistp,\n                              fuzz_randomizer_get_int(0, 1024));\n        break;\n      }\n    }\n  }\n\n  // Cleanup\n  buffer_list_free(buflistp);\n  gc_free(&gc);\n\n  fuzz_random_destroy();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_crypto.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n\n#include \"config.h\"\n#include \"syshead.h\"\n\n#include <openssl/x509.h>\n#include <openssl/x509v3.h>\n#include <openssl/ssl.h>\n#include <openssl/err.h>\n\n#include \"fuzz_verify_cert.h\"\n#include \"misc.h\"\n#include \"manage.h\"\n#include \"otime.h\"\n#include \"base64.h\"\n#include \"ssl_verify.h\"\n#include \"ssl_verify_backend.h\"\n\n#include \"fuzz_randomizer.h\"\n\nstatic void key_ctx_update_implicit_iv(struct key_ctx *ctx, uint8_t *key,\n                                       size_t key_len) {\n  //const cipher_kt_t *cipher_kt = cipher_ctx_get_cipher_kt(ctx->cipher);\n\n  cipher_ctx_t *cipher_kt = ctx->cipher;\n  /* Only use implicit IV in AEAD cipher mode, where HMAC key is not used */\n  if (cipher_ctx_mode_aead(cipher_kt)) {\n    size_t impl_iv_len = 0;\n    ASSERT(cipher_kt_iv_size(cipher_kt) >= OPENVPN_AEAD_MIN_IV_LEN);\n    impl_iv_len = cipher_kt_iv_size(cipher_kt) - sizeof(packet_id_type);\n    ASSERT(impl_iv_len <= OPENVPN_MAX_IV_LENGTH);\n    ASSERT(impl_iv_len <= key_len);\n    memcpy(ctx->implicit_iv, key, impl_iv_len);\n    ctx->implicit_iv_len = impl_iv_len;\n  }\n}\n\nstatic int init_frame(struct frame *frame) {\n  frame->link_mtu = fuzz_randomizer_get_int(100, 1000);\n  frame->extra_buffer = fuzz_randomizer_get_int(100, 1000);\n  frame->link_mtu_dynamic = fuzz_randomizer_get_int(100, 1000);\n  frame->extra_frame = fuzz_randomizer_get_int(100, 1000);\n  frame->extra_tun = fuzz_randomizer_get_int(100, 1000);\n  frame->extra_link = fuzz_randomizer_get_int(100, 1000);\n  frame->align_flags = 0;\n  frame->align_adjust = 0;\n  if (TUN_MTU_SIZE(frame) <= 0) {\n    return -1;\n  }\n  return 0;\n}\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n  OPENSSL_malloc_init();\n  SSL_library_init();\n  ERR_load_crypto_strings();\n\n  OpenSSL_add_all_algorithms();\n  OpenSSL_add_ssl_algorithms();\n\n  SSL_load_error_strings();\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fuzz_random_init(data, size);\n  fuzz_success = 1;\n  bool key_ctx_dec_initialized = false;\n  bool key_ctx_enc_initialized = false;\n  struct key_ctx key_ctx_dec;\n  memset(&key_ctx_dec, 0, sizeof(struct key_ctx));\n  struct key_ctx key_ctx_enc;\n  memset(&key_ctx_enc, 0, sizeof(struct key_ctx));\n\n  struct gc_arena gc;\n  struct tls_session *session = NULL;\n  X509 *x509 = NULL;\n  gc = gc_new();\n\n  gb_init();\n\n  // Read key file\n  struct key2 key2;\n  char *keydata = gb_get_random_string();\n  read_key_file(&key2, keydata, RKF_INLINE);\n\n  // init key type\n  struct key_type kt;\n  memset(&kt, 0, sizeof(struct key_type));\n\n  char *ciphername = gb_get_random_string();\n  char *authname = gb_get_random_string();\n  bool key_type_initialized = false;\n\n  if (strcmp(ciphername, \"AES-256-GCM\") == 0 ||\n      strcmp(ciphername, \"AES-128-GCM\") == 0 ||\n      strcmp(ciphername, \"AES-192-GCM\") == 0 ||\n      strcmp(ciphername, \"CAMELLIA-128-CFB128\") == 0) {\n\n    int v = fuzz_randomizer_get_int(0, 1);\n    if (v == 0) {\n      init_key_type(&kt, ciphername, authname, true, 0);\n    } else {\n      init_key_type(&kt, ciphername, authname, false, 0);\n    }\n    key_type_initialized = true;\n  }\n\n  if (fuzz_success == 0) {\n    goto cleanup;\n  }\n\n  // Generate key.\n  // Identify which one we should do, read or generate a random key.\n  int c = fuzz_randomizer_get_int(0, 1);\n  const uint8_t d[1024];\n  int key_read = 0;\n  struct key key;\n  if (c == 0) {\n    if (fuzz_get_random_data(d, 1024) != 1024) {\n      struct buffer buf = alloc_buf(1024);\n      buf_write(&buf, d, 1024);\n      if (read_key(&key, &kt, &buf) == 1) {\n        key_read = 1;\n      }\n      free_buf(&buf);\n    }\n  }\n  else {\n    if (key_type_initialized == true) {\n      generate_key_random(&key, &kt);\n    }\n  }\n\n  if (fuzz_success == 0) {\n    goto cleanup;\n  }\n  key_read = 1;\n\n  // init decryption context\n  if (key_type_initialized && key_read) {\n    init_key_ctx(&key_ctx_dec, &key, &kt, OPENVPN_OP_DECRYPT, \"x\");\n    key_ctx_update_implicit_iv(&key_ctx_dec, &(key.hmac), MAX_HMAC_KEY_LENGTH);\n    key_ctx_dec_initialized = true;\n  }\n\n  // init encryption context\n  if (key_type_initialized && key_read) {\n    init_key_ctx(&key_ctx_enc, &key, &kt, OPENVPN_OP_DECRYPT, \"x\");\n    key_ctx_update_implicit_iv(&key_ctx_enc, &(key.hmac), MAX_HMAC_KEY_LENGTH);\n    key_ctx_enc_initialized = true;\n  }\n\n  // perform encryption\n  struct frame frame;\n  memset(&frame, 0, sizeof(struct frame));\n  if (key_ctx_enc_initialized == true && key_ctx_dec_initialized == true &&\n      init_frame(&frame) == 0) {\n    struct crypto_options opt;\n    memset(&opt, 0, sizeof(opt));\n    opt.pid_persist = NULL;\n    opt.key_ctx_bi.encrypt = key_ctx_enc;\n    opt.key_ctx_bi.decrypt = key_ctx_dec;\n    opt.key_ctx_bi.initialized = true;\n    opt.packet_id.rec.initialized = true;\n    opt.packet_id.rec.seq_list = NULL;\n    opt.packet_id.rec.name = NULL;\n\n    void *buf_p;\n\n    struct buffer encrypt_workspace = alloc_buf_gc(BUF_SIZE(&(frame)), &gc);\n    struct buffer work = alloc_buf_gc(BUF_SIZE(&(frame)), &gc);\n    struct buffer src = alloc_buf_gc(TUN_MTU_SIZE(&(frame)), &gc);\n    struct buffer buf = clear_buf();\n\n    int x = fuzz_randomizer_get_int(1, TUN_MTU_SIZE(&frame));\n\n    ASSERT(buf_init(&work, FRAME_HEADROOM(&(frame))));\n    ASSERT(buf_init(&src, 0));\n    src.len = x;\n    ASSERT(rand_bytes(BPTR(&src), BLEN(&src)));\n\n    buf = work;\n    buf_p = buf_write_alloc(&buf, BLEN(&src));\n    ASSERT(buf_p);\n    memcpy(buf_p, BPTR(&src), BLEN(&src));\n\n    ASSERT(buf_init(&encrypt_workspace, FRAME_HEADROOM(&(frame))));\n\n    openvpn_encrypt(&buf, encrypt_workspace, &opt);\n  }\n\n  // perform decryption\n  memset(&frame, 0, sizeof(struct frame));\n  if (key_ctx_dec_initialized == true && key_ctx_enc_initialized == true &&\n      init_frame(&frame) == 0) {\n    struct crypto_options opt;\n    memset(&opt, 0, sizeof(opt));\n    opt.pid_persist = NULL;\n    opt.key_ctx_bi.encrypt = key_ctx_enc;\n    opt.key_ctx_bi.decrypt = key_ctx_dec;\n    opt.key_ctx_bi.initialized = true;\n    opt.packet_id.rec.initialized = true;\n    opt.packet_id.rec.seq_list = NULL;\n    opt.packet_id.rec.name = NULL;\n\n    void *buf_p;\n\n    struct buffer decrypt_workspace = alloc_buf_gc(BUF_SIZE(&(frame)), &gc);\n    struct buffer work = alloc_buf_gc(BUF_SIZE(&(frame)), &gc);\n    struct buffer src = alloc_buf_gc(TUN_MTU_SIZE(&(frame)), &gc);\n    struct buffer buf = clear_buf();\n\n    int x = fuzz_randomizer_get_int(1, TUN_MTU_SIZE(&frame));\n\n    ASSERT(buf_init(&work, FRAME_HEADROOM(&(frame))));\n    ASSERT(buf_init(&src, 0));\n    src.len = x;\n    ASSERT(rand_bytes(BPTR(&src), BLEN(&src)));\n\n    buf = work;\n    buf_p = buf_write_alloc(&buf, BLEN(&src));\n    ASSERT(buf_p);\n    memcpy(buf_p, BPTR(&src), BLEN(&src));\n\n    ASSERT(buf_init(&decrypt_workspace, FRAME_HEADROOM(&(frame))));\n    \n    openvpn_decrypt(&buf, decrypt_workspace, &opt, &frame, BPTR(&buf));\n  }\n\ncleanup:\n  // cleanup\n  gc_free(&gc);\n\n  if (key_ctx_dec_initialized == true) {\n    free_key_ctx(&key_ctx_dec);\n  }\n\n  if (key_ctx_enc_initialized == true) {\n    free_key_ctx(&key_ctx_enc);\n  }\n  fuzz_random_destroy();\n\n  gb_cleanup();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_dhcp.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include \"syshead.h\"\n#include \"dhcp.h\"\n#include \"buffer.h\"\n\n#include \"fuzz_randomizer.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  struct buffer ipbuf;\n  in_addr_t ret;\n\n  fuzz_random_init(data, size);\n  char *ran_val = get_random_string();\n\n  ipbuf = alloc_buf(strlen(ran_val));\n  if (buf_write(&ipbuf, ran_val, strlen(ran_val)) != false) {\n    ret = dhcp_extract_router_msg(&ipbuf);\n  }\n  free_buf(&ipbuf);\n\n  fuzz_random_destroy();\n  free(ran_val);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_forward.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include <sys/time.h>\n#include \"syshead.h\"\n#include \"interval.h\"\n#include \"init.h\"\n#include \"buffer.h\"\n#include \"forward.h\"\n\n#include \"fuzz_randomizer.h\"\n\n\nstatic int init_c2_outgoing_link(struct context_2 *c2, struct gc_arena *gc) {\n  struct link_socket_actual *to_link_addr = NULL;\n  struct link_socket *link_socket = NULL;\n  struct socks_proxy_info *socks_proxy = NULL;\n  struct buffer buf;\n\n  c2->tun_write_bytes = 0;\n  ALLOC_ARRAY_GC(link_socket, struct link_socket, 1, gc);\n  memset(link_socket, 0, sizeof(*link_socket));\n\n  c2->link_socket = link_socket;\n\n  if (fuzz_randomizer_get_int(0, 2) != 0) {\n    c2->link_socket->info.proto = PROTO_UDP;\n  } else {\n    c2->link_socket->info.proto = PROTO_TCP_SERVER;\n  }\n\n  ALLOC_ARRAY_GC(socks_proxy, struct socks_proxy_info, 1, gc);\n  memset(socks_proxy, 0, sizeof(*socks_proxy));\n  c2->link_socket->socks_proxy = socks_proxy;\n\n  c2->frame.link_mtu_dynamic = fuzz_randomizer_get_int(0, 0xfffffff);\n  c2->frame.extra_frame = fuzz_randomizer_get_int(0, 0xfffffff);\n  c2->frame.extra_tun = fuzz_randomizer_get_int(0, 0xfffffff);\n  c2->frame.link_mtu = fuzz_randomizer_get_int(0, 0xfffffff);\n\n  ALLOC_ARRAY_GC(to_link_addr, struct link_socket_actual, 1, gc);\n  memset(to_link_addr, 0, sizeof(*to_link_addr));\n  c2->to_link_addr = to_link_addr;\n\n  c2->to_link_addr->dest.addr.sa.sa_family = AF_INET;\n  c2->to_link_addr->dest.addr.in4.sin_addr.s_addr = 1;\n\n  char *tmp = get_random_string();\n  buf = alloc_buf_gc(strlen(tmp), gc);\n  buf_write(&buf, tmp, strlen(tmp));\n  int val = fuzz_randomizer_get_int(0, strlen(tmp));\n  buf.offset = val;\n  free(tmp);\n\n  c2->link_socket->stream_buf.maxlen = BLEN(&buf);\n  c2->to_link = buf;\n\n  if (buf.offset < 10) {\n    return -1;\n  }\n  return 0;\n}\n\nvoid fuzz_process_outgoing_link(const uint8_t *data, size_t size) {\n  struct context ctx;\n  struct gc_arena gc = gc_new();\n  memset(&ctx, 0, sizeof(ctx));\n\n  if (init_c2_outgoing_link(&ctx.c2, &gc) == 0) {\n    process_outgoing_link(&ctx);\n  }\n\n  gc_free(&gc);\n}\n\nstatic int _init_options(struct options *options, struct client_nat_entry **cne,\n                         struct gc_arena *gc) {\n  options->passtos = false;\n  options->mode = MODE_POINT_TO_POINT;\n  options->allow_recursive_routing = true;\n  options->client_nat = new_client_nat_list(gc);\n\n  struct client_nat_entry *_cne;\n  ALLOC_ARRAY_GC(cne[0], struct client_nat_entry, 1, gc);\n  _cne = cne[0];\n  memset(_cne, 0, sizeof(struct client_nat_entry));\n\n  struct client_nat_option_list clist;\n  clist.n = 1;\n  clist.entries[0] = *_cne;\n  copy_client_nat_option_list(options->client_nat, &clist);\n  options->route_gateway_via_dhcp = false;\n\n  return 0;\n}\n\nstatic int init_c2_incoming_tun(struct context_2 *c2, struct gc_arena *gc) {\n  struct buffer buf;\n  memset(&buf, 0, sizeof(buf));\n\n  struct link_socket *link_socket = NULL;\n  ALLOC_ARRAY_GC(link_socket, struct link_socket, 1, gc);\n  c2->link_socket = link_socket;\n\n  ALLOC_OBJ_GC(c2->link_socket_info, struct link_socket_info, gc);\n  ALLOC_OBJ_GC(c2->link_socket_info->lsa, struct link_socket_addr, gc);\n  c2->link_socket_info->lsa->bind_local = NULL;\n  c2->link_socket_info->lsa->remote_list = NULL;\n  c2->link_socket_info->lsa->current_remote = NULL;\n  c2->link_socket_info->lsa->remote_list = NULL;\n  c2->es = env_set_create(gc);\n\n  c2->frame.link_mtu_dynamic = 0;\n  c2->frame.extra_frame = 0;\n  c2->frame.extra_tun = 0;\n  c2->to_link_addr = NULL;\n\n  char *tmp = get_random_string();\n  buf = alloc_buf(strlen(tmp));\n  buf_write(&buf, tmp, strlen(tmp));\n\n  int retval;\n  if (strlen(tmp) > 5) {\n    retval = 0;\n  } else {\n    retval = 1;\n  }\n\n  free(tmp);\n\n  c2->buf = buf;\n  c2->buffers = init_context_buffers(&c2->frame);\n  c2->log_rw = false;\n\n  return retval;\n}\n\nint run_process_incoming_tun(const uint8_t *data, size_t size) {\n  struct gc_arena gc;\n  struct context ctx;\n  struct client_nat_entry *cne[MAX_CLIENT_NAT];\n  struct route_list route_list;\n\n  memset(&ctx, 0, sizeof(ctx));\n  memset(cne, 0, sizeof(cne));\n\n  gc = gc_new();\n\n  _init_options(&ctx.options, cne, &gc);\n\n  // Init tuntap\n  struct tuntap tuntap;\n  tuntap.type = DEV_TYPE_TAP;\n\n  ctx.c1.tuntap = &tuntap;\n\n  int retval = init_c2_incoming_tun(&ctx.c2, &gc);\n  ctx.c1.route_list = &route_list;\n  if (retval == 0) {\n    process_incoming_tun(&ctx);\n  }\n\n  free(ctx.c2.buf.data);\n  free_context_buffers(ctx.c2.buffers);\n  gc_free(&gc);\n}\n\nstatic int init_c2_outgoing_tun(struct context_2 *c2, struct gc_arena *gc) {\n  struct buffer buf;\n\n  c2->tun_write_bytes = 0;\n  c2->frame.link_mtu_dynamic = fuzz_randomizer_get_int(0, 0xfffffff);\n  c2->frame.extra_frame = fuzz_randomizer_get_int(0, 0xfffffff);\n  c2->frame.extra_tun = fuzz_randomizer_get_int(0, 0xfffffff);\n\n  char *tmp = get_random_string();\n  buf = alloc_buf_gc(strlen(tmp), gc);\n  buf_write(&buf, tmp, strlen(tmp));\n  free(tmp);\n\n  c2->to_tun = buf;\n  return 0;\n}\n\nvoid run_process_outgoing_tun(uint8_t *data, size_t size) {\n  struct gc_arena gc;\n  struct context ctx;\n  struct tuntap tuntap;\n\n  memset(&ctx, 0, sizeof(ctx));\n  gc = gc_new();\n\n  tuntap.type = DEV_TYPE_TAP;\n  ctx.c1.tuntap = &tuntap;\n\n  init_c2_outgoing_tun(&ctx.c2, &gc);\n  process_outgoing_tun(&ctx);\n\n  gc_free(&gc);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fuzz_random_init(data, size);\n\n  int dec = fuzz_randomizer_get_int(0, 2);\n  if (dec == 0) {\n    run_process_incoming_tun(data, size);\n  }\n\telse if (dec == 1) {\n\t\trun_process_outgoing_tun(data, size);\n\t}\n  else {\n    fuzz_process_outgoing_link(data, size);\n  }\n\n  fuzz_random_destroy();\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_header.h",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#ifndef FUZZ_H\n#define FUZZ_H\n\n#include <sys/types.h>\n#include <sys/socket.h>\n\n// Forward declared because we want to use FuzzedDataProvider,\n// which requires CPP.\nextern ssize_t fuzz_get_random_data(void *buf, size_t len);\n\nssize_t fuzz_recv(int sockfd, void *buf, size_t len, int flags){\n\treturn fuzz_get_random_data(buf, len);\n}\n\nssize_t fuzz_read(int sockfd, void *buf, size_t len){\n\treturn fuzz_get_random_data(buf, len);\n}\n\nssize_t fuzz_write(int fd, const void *buf, size_t count) {\n  return count;\n}\n\nint fuzz_isatty(int fd) {\n  return 1;\n}\n\nchar *fuzz_fgets(char *s, int size, FILE *stream) {\n  ssize_t v = fuzz_get_random_data(s, size-1);\n  // We use fgets to get trusted input. As such, assume we have\n  // an ascii printable char at the beginning.\n  printf(\"Calling into fgets\\n\");\n  if (s[0] <= 0x21 || s[0] >= 0x7f) {\n    s[0] = 'A';\n  }\n  s[size-1] = '\\0';\n  return s;\n}\n\nint fuzz_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *timeout) {\n  char val;\n  ssize_t c = fuzz_get_random_data(&val, 1);\n  return c;\n}\n\nssize_t fuzz_send(int sockfd, const void *buf, size_t len, int flags) {\n  return len;\n}\n\nFILE *fp_p = NULL;\nFILE *fuzz_fopen(const char *pathname, const char *mode) {\n   if (mode == NULL) return fp_p;\n   return fp_p;\n}\n\nint fuzz_fclose(FILE *stream) {\n   if (stream == NULL) return 1;\n   return 2;\n}\n\nsize_t fuzz_sendto(int sockfd, void *buf, size_t len, int flags, struct sockaddr *dest_addr, socklen_t addrlen) {\n  if (buf == NULL) {\n    return len;\n  }\n  return len;\n}\n\n#endif\n"
  },
  {
    "path": "projects/openvpn/fuzz_list.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include \"syshead.h\"\n#include \"list.h\"\n\n#include \"fuzz_randomizer.h\"\n\n#define KEY_SIZE 23\n\n/* Required for hash_init() */\nstatic uint32_t word_hash_function(const void *key, uint32_t iv) {\n  return hash_func(key, KEY_SIZE, iv);\n}\n\n/* Required for hash_init() */\nstatic bool word_compare_function(const void *key1, const void *key2) {\n  return ((size_t)key1 & 0xFFF) == ((size_t)key1 & 0xFFF);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  struct gc_arena gc;\n  struct hash *hash = NULL;\n  ssize_t generic_ssizet, generic_ssizet2, num_loops;\n\n  fuzz_random_init(data, size);\n\n  gc = gc_new();\n\n  int total_to_fuzz = fuzz_randomizer_get_int(1, 20);\n  for (int i = 0; i < total_to_fuzz; i++) {\n    generic_ssizet = fuzz_randomizer_get_int(0, 8);\n\n    switch (generic_ssizet) {\n    case 0:\n      if (hash == NULL) {\n        int n_buckets = fuzz_randomizer_get_int(1, 1000);\n        uint32_t iv;\n\n        hash =\n            hash_init(n_buckets, iv, word_hash_function, word_compare_function);\n      }\n      break;\n    case 1:\n      if (hash) {\n        hash_free(hash);\n        hash = NULL;\n      }\n      break;\n    case 2:\n      if (hash) {\n        struct hash_iterator hi;\n        struct hash_element *he;\n        hash_iterator_init(hash, &hi);\n        while ((he = hash_iterator_next(&hi))) {\n          void *w = he->value;\n        }\n        hash_iterator_free(&hi);\n      }\n      break;\n    case 3:\n      if (hash) {\n        void *key;\n        void *value;\n        char arr[KEY_SIZE];\n        memset(arr, 0, KEY_SIZE);\n        fuzz_get_random_data(arr, KEY_SIZE);\n        key = (void *)arr;\n        if (!hash_lookup(hash, key)) {\n          generic_ssizet = fuzz_randomizer_get_int(0, 0xfffffff);\n          value = (void *)generic_ssizet;\n          hash_add(hash, key, value, false);\n        }\n      }\n      break;\n    case 4:\n      if (hash) {\n        hash_n_elements(hash);\n      }\n      break;\n    case 5:\n      if (hash) {\n        hash_n_buckets(hash);\n      }\n      break;\n    case 6:\n      if (hash) {\n        uint32_t hv;\n        generic_ssizet = fuzz_randomizer_get_int(0, 0xfffffff);\n        hv = generic_ssizet;\n        hash_bucket(hash, hv);\n      }\n      break;\n    case 7:\n      if (hash) {\n        void *key;\n        char arr[KEY_SIZE];\n        memset(arr, 0, KEY_SIZE);\n        fuzz_get_random_data(arr, KEY_SIZE);\n        key = (void *)arr;\n        hash_remove(hash, key);\n      }\n      break;\n    case 8:\n      if (hash) {\n        void *value;\n        generic_ssizet = fuzz_randomizer_get_int(0, 0xfffffff);\n        value = (void *)generic_ssizet;\n        hash_remove_by_value(hash, value);\n      }\n    default:\n      break;\n    }\n  }\n\n  if (hash) {\n    hash_free(hash);\n  }\n\n  gc_free(&gc);\n\n  fuzz_random_destroy();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_misc.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n\n#include \"config.h\"\n#include \"syshead.h\"\n#include \"misc.h\"\n#include \"buffer.h\"\n\n#include \"fuzz_randomizer.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fuzz_random_init(data, size);\n\n  struct gc_arena gc;\n  struct env_set *es;\n  gc = gc_new();\n  es = env_set_create(&gc);\n\n  int total_to_fuzz = fuzz_randomizer_get_int(1, 9);\n  for (int i = 0; i <total_to_fuzz; i++) {\n    int type = fuzz_randomizer_get_int(0, 3);\n    char *tmp1 = get_random_string();\n    char *tmp2 = get_random_string();\n\n    switch (type) {\n    case 0:\n      env_set_del(es, tmp1);\n      break;\n    case 1:\n      env_set_add(es, tmp1);\n      break;\n    case 2:\n      env_set_get(es, tmp1);\n      break;\n    case 3:\n      if (strlen(tmp1) > 1 && strlen(tmp2) > 1) {\n        setenv_str(es, tmp2, tmp1);\n      }\n      break;\n    default:\n      sanitize_control_message(tmp1, &gc);\n    }\n    free(tmp1);\n    free(tmp2);\n  }\n\n  env_set_destroy(es);\n  gc_free(&gc);\n\n  fuzz_random_destroy();\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_mroute.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include \"syshead.h\"\n#include \"init.h\"\n#include \"mroute.h\"\n\n#include \"fuzz_randomizer.h\"\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  fuzz_random_init(data, size);\n  struct buffer buf;\n  struct gc_arena gc;\n\n  gc = gc_new();\n\n  char *tmp = get_random_string();\n  buf = string_alloc_buf(tmp, &gc);\n  free(tmp);\n\n  struct mroute_addr src_addr;\n  struct mroute_addr dst_addr;\n  mroute_addr_init(&src_addr);\n  mroute_addr_init(&dst_addr);\n  unsigned int ret = mroute_extract_addr_ip(&src_addr, &dst_addr, &buf);\n\n  if (ret & MROUTE_EXTRACT_SUCCEEDED) {\n    mroute_addr_mask_host_bits(&src_addr);\n    mroute_addr_print(&src_addr, &gc);\n    mroute_learnable_address(&src_addr, &gc);\n  }\n\n  uint16_t vid;\n  struct mroute_addr a1, a2;\n  mroute_addr_init(&a1);\n  mroute_addr_init(&a2);\n  mroute_extract_addr_ether(&a1, &a2, vid, &buf);\n\n  if (size > sizeof(struct openvpn_sockaddr)) {\n    struct openvpn_sockaddr local_sock;\n    memcpy(&local_sock, data, sizeof(struct openvpn_sockaddr));\n    mroute_extract_openvpn_sockaddr(&a1, &local_sock, true);\n    mroute_extract_openvpn_sockaddr(&a1, &local_sock, false);\n  }\n\n  struct mroute_helper *mhelper = NULL;\n  mhelper = mroute_helper_init(fuzz_randomizer_get_int(0, 0xfffffff));\n  if (mhelper != NULL) {\n    mroute_helper_add_iroute46(mhelper, fuzz_randomizer_get_int(0, MR_HELPER_NET_LEN-1));\n    mroute_helper_free(mhelper);\n  }\n\n  gc_free(&gc);\n\n  fuzz_random_destroy();\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/openvpn/fuzz_packet_id.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include \"syshead.h\"\n#include \"init.h\"\n#include \"packet_id.h\"\n\n#include \"fuzz_randomizer.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fuzz_random_init(data, size);\n\n  struct packet_id pid;\n  struct packet_id_net pin;\n  const int seq_backtrack = 10;\n  const int time_backtrack = 10;\n\n  packet_id_init(&pid, seq_backtrack, time_backtrack, \"name\", 0);\n\n  int total_sends = fuzz_randomizer_get_int(0, 10);\n  for (int i = 0; i < total_sends; i++) {\n    update_time();\n    pin.time = fuzz_randomizer_get_int(0, 0xfffffff);\n    pin.id = fuzz_randomizer_get_int(0, 0xfffffff);\n\n    packet_id_reap_test(&pid.rec);\n    bool test = packet_id_test(&pid.rec, &pin);\n    if (test) {\n      packet_id_add(&pid.rec, &pin);\n    }\n  }\n  packet_id_free(&pid);\n\n  // packet id send\n  char *tmp2 = get_random_string();\n  if (strlen(tmp2) > sizeof(struct packet_id_send)) {\n    struct packet_id_send pidsend;\n    memcpy(&pidsend, tmp2, sizeof(struct packet_id_send));\n\n    time_t tv_sec = (time_t)pidsend.time;\n    if (localtime(&tv_sec) != NULL) {\n      struct buffer iv_buffer;\n      buf_set_write(&iv_buffer, tmp2, strlen(tmp2));\n      packet_id_write(&pidsend, &iv_buffer, false, false);\n      packet_id_write(&pidsend, &iv_buffer, false, true);\n      packet_id_write(&pidsend, &iv_buffer, true, true);\n      packet_id_write(&pidsend, &iv_buffer, true, false);\n    }\n  }\n  free(tmp2);\n\n  struct gc_arena gc;\n  gc = gc_new();\n  struct buffer buf;\n  char *tmp = get_random_string();\n  buf = string_alloc_buf(tmp, &gc);\n  free(tmp);\n  packet_id_read(&pid, &buf, false);\n  packet_id_read(&pid, &buf, true);\n  gc_free(&gc);\n\n\tchar filename[256];\n\tsprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n\tFILE *fp = fopen(filename, \"wb\");\n\tif (!fp) {\n    return 0;\n\t}\n\tfwrite(data, size, 1, fp);\n\tfclose(fp);\n \n  struct packet_id_persist p;\n  memset(&p, 0, sizeof(struct packet_id_persist));\n  packet_id_persist_init(&p);\n  packet_id_persist_load(&p, filename);\n  time_t p_time = (time_t)p.time;\n  if (localtime(&p_time) != NULL) {\n    gc = gc_new();\n    p.id_last_written = fuzz_randomizer_get_int(0, 0xfffffff);\n    //packet_id_persist_print(&p, &gc);\n    packet_id_persist_save(&p);\n    gc_free(&gc);\n  }\n\n  packet_id_persist_close(&p);\n  unlink(filename);\n\n  fuzz_random_destroy();\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_proxy.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include <sys/time.h>\n#include \"syshead.h\"\n#include \"interval.h\"\n#include \"proxy.h\"\n#include <openssl/err.h>\n#include <openssl/ssl.h>\n#include \"sig.h\"\n\n#include \"fuzz_randomizer.h\"\n\nint LLVMFuzzerInitialize(int *argc, char ***argv)\n{\n    OPENSSL_malloc_init();\n    SSL_library_init();\n    ERR_load_crypto_strings();\n\n    OpenSSL_add_all_algorithms();\n    OpenSSL_add_ssl_algorithms();\n    OpenSSL_add_all_digests();\n\n    SSL_load_error_strings();\n    return 1;\n}\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n\tchar *tmp = NULL;\n  char *tmp2 = NULL;\n\n  if (size < 500) {\n    return 0;\n  }\n  fuzz_random_init(data, size);\n\n  struct gc_arena gc = gc_new();\n  struct http_proxy_info pi;\n  ssize_t generic_ssizet;\n  struct signal_info signal_received = {0};\n  // TODO: This coul be randomized\n  register_signal(&signal_received, SIGUSR1, \"remote-exit\");\n  struct buffer lookahead = alloc_buf(1024);\n  struct event_timeout evt;\n\n  memset(&evt, 0, sizeof(struct event_timeout));\n  memset(&pi, 0, sizeof(struct http_proxy_info));\n  memset(&pi, 0, sizeof(pi));\n\n  generic_ssizet = 0;\n  char *fuzz_usrnm = fuzz_random_get_string_max_length(USER_PASS_LEN);\n  strcpy(pi.up.username, fuzz_usrnm);\n  if (strlen(pi.up.username) == 0) {\n    gc_free(&gc);\n    free_buf(&lookahead);\n    free(fuzz_usrnm);\n    fuzz_random_destroy();\n    return 0;\n  }\n\n  char *pswd = fuzz_random_get_string_max_length(USER_PASS_LEN);\n  strcpy(pi.up.password, pswd);\n  if (strlen(pi.up.password) == 0) {\n    gc_free(&gc);\n    free_buf(&lookahead);\n\n    free(pswd);\n    free(fuzz_usrnm);\n    fuzz_random_destroy();\n    return 0;\n  }\n\n  generic_ssizet = fuzz_randomizer_get_int(0, 2);\n  switch (generic_ssizet) {\n  case 0:\n    pi.auth_method = HTTP_AUTH_NONE;\n    break;\n  case 1:\n     pi.auth_method = HTTP_AUTH_BASIC;\n    break;\n  case 2:\n    pi.auth_method = HTTP_AUTH_DIGEST;\n    break;\n  }\n  pi.options.http_version = \"1.1\";\n\n  generic_ssizet = fuzz_randomizer_get_int(0, 2);\n  switch (generic_ssizet) {\n  case 0:\n    pi.options.auth_retry = PAR_NO;\n    break;\n  case 1:\n    pi.options.auth_retry = PAR_ALL;\n    break;\n  case 2:\n    pi.options.auth_retry = PAR_NCT;\n    break;\n  }\n\n  char *tmp_authenticate = get_random_string();\n  pi.proxy_authenticate = tmp_authenticate;\n\n  //if (provider.ConsumeProbability<double>() < 0.5) {\n    //tmp = get_modifiable_string(provider);\n    tmp = get_random_string();\n    pi.options.custom_headers[0].name = tmp;\n    //if (provider.ConsumeProbability<double>() < 0.5) {\n      //tmp2 = get_modifiable_string(provider);\n      tmp2 = get_random_string();\n      pi.options.custom_headers[0].content = tmp2;\n    //}\n  //}\n\n  establish_http_proxy_passthru(&pi, 0, \"1.2.3.4\", \"777\", &evt, &lookahead,\n                                &signal_received);\n  free(pi.proxy_authenticate);\n  gc_free(&gc);\n  free_buf(&lookahead);\n\n  if (tmp != NULL)  free(tmp);\n  if (tmp2 != NULL) free(tmp2);\n\n    free(pswd);\n    free(fuzz_usrnm);\n  fuzz_random_destroy();\n\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_randomizer.cpp",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <assert.h>\n\nFuzzedDataProvider *prov = NULL;\n\nextern \"C\" void fuzz_random_init(const uint8_t *data, size_t size) {\n   assert(prov == NULL);\n   prov = new FuzzedDataProvider(data, size);\n}\n\nextern \"C\" void fuzz_random_destroy() {\n   assert(prov != NULL);\n  delete prov;\n  prov = NULL;\n}\n\nextern \"C\" char *get_random_string() {\n   assert(prov != NULL);\n\n   std::string s1 = prov->ConsumeRandomLengthString();\n   char *tmp = (char *)malloc(s1.size() + 1);\n   memcpy(tmp, s1.c_str(), s1.size());\n   tmp[s1.size()] = '\\0';\n   return tmp;\n}\n\nextern \"C\" int fuzz_randomizer_get_int(int min, int max) {\n   assert(prov != NULL);\n   return prov->ConsumeIntegralInRange<int>(min, max);\n} \n\nextern \"C\" char *fuzz_random_get_string_max_length(int max_len) {\n  assert(prov != NULL);\n\n  std::string s1 = prov->ConsumeBytesAsString(\n                           prov->ConsumeIntegralInRange<uint32_t>(1, max_len));\n  char *tmp123 = (char*)malloc(s1.size()+1);\n  memcpy(tmp123, s1.c_str(), s1.size());\n  tmp123[s1.size()] = '\\0';\n\n  return tmp123;\n}\n\nextern \"C\" size_t fuzz_get_random_data(void *buf, size_t len) {\n  assert(prov != NULL);\n  size_t ret_val;\n  char *cbuf = (char*)buf;\n\n  if (prov->remaining_bytes() == 0) {\n    return -1;\n  }\n\n  double prob = prov->ConsumeProbability<double>();\n  if (prob < 0.05) {\n    return 0;\n  }\n\n  //if (len == 1) {\n  //  ret_val = prov->ConsumeData(buf, 1);\n  //  return ret_val;\n  //}\n  ret_val = prov->ConsumeData(buf, len);\n  return ret_val;\n}\n \n\n// Simple garbage collector\n#define GB_SIZE 100\nvoid *pointer_arr[GB_SIZE];\nstatic int pointer_idx = 0;\n\n// If the garbage collector is used then this must be called as first thing\n// during a fuzz run.\nextern \"C\" void gb_init() {\n  pointer_idx = 0;\n\n   for (int i = 0; i < GB_SIZE; i++) {\n     pointer_arr[i] = NULL;\n   }\n}\n\nextern \"C\" void gb_cleanup() {\n  for(int i = 0; i < GB_SIZE; i++) {\n    if (pointer_arr[i] != NULL) {\n      free(pointer_arr[i]);\n    }\n  }\n}\n\nextern \"C\" char *gb_get_random_string() {\n  char *tmp = get_random_string();\n  pointer_arr[pointer_idx++] = (void*)tmp;\n  return tmp;\n}\n\n"
  },
  {
    "path": "projects/openvpn/fuzz_randomizer.h",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stdint.h>\n\nvoid fuzz_random_init(const uint8_t *data, size_t size);\nvoid fuzz_random_destroy();\nchar *get_random_string();\nint fuzz_randomizer_get_int(int min, int max);\nsize_t fuzz_get_random_data(void *buf, size_t len);\nchar *fuzz_random_get_string_max_length(int max_len);\n\nvoid gb_init();\nvoid gb_cleanup();\nchar *gb_get_random_string();\n\nint fuzz_success;\n"
  },
  {
    "path": "projects/openvpn/fuzz_route.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include \"syshead.h\"\n#include \"init.h\"\n#include \"proxy.h\"\n#include \"interval.h\"\n#include \"route.h\"\n#include \"buffer.h\"\n\n#include \"fuzz_randomizer.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  fuzz_random_init(data, size);\n\n  gb_init();\n\n  struct route_option_list *opt;\n  struct route_list rl;\n\n  int route_list_inited = 0;\n  int route_list_ipv6_inited = 0;\n\n  struct context c;\n  memset(&c, 0, sizeof(struct context));\n  gc_init(&c.gc);\n  c.es = env_set_create(&c.gc);\n  init_options(&c.options);\n  net_ctx_init(&c, &c.net_ctx);\n  init_verb_mute(&c, IVM_LEVEL_1);\n\n  init_options_dev(&c.options);\n\n  // options_postprocess(&c.options);\n  pre_setup(&c.options);\n\n  setenv_settings(c.es, &c.options);\n\n  ALLOC_OBJ_CLEAR_GC(c.options.ce.local_list, struct local_list, &c.options.gc);\n  ALLOC_OBJ_CLEAR_GC(c.options.connection_list, struct connection_list,\n                     &c.options.gc);\n  context_init_1(&c);\n\n  in_addr_t remote_host;\n  ssize_t default_metric;\n\n  struct route_ipv6_list rl6;\n  struct route_ipv6_option_list *opt6;\n\n  memset(&rl, 0, sizeof(rl));\n  memset(&rl6, 0, sizeof(rl6));\n  memset(&opt, 0, sizeof(opt));\n  memset(&opt6, 0, sizeof(opt6));\n\n  opt6 = new_route_ipv6_option_list(&c.gc);\n  opt = new_route_option_list(&c.gc);\n\n  int total_to_fuzz = fuzz_randomizer_get_int(1, 20);\n  for (int i = 0; i < total_to_fuzz; i++) {\n    int selector = fuzz_randomizer_get_int(0, 13);\n    switch (selector) {\n    case 0:\n      if (route_list_inited == 0) {\n        const char *remote_endpoint = gb_get_random_string();\n        memset(&rl, 0, sizeof(struct route_list));\n        rl.flags = fuzz_randomizer_get_int(0, 0xffffff);\n\n        init_route_list(&rl, opt, remote_endpoint, default_metric, remote_host,\n                        c.es, &c);\n        route_list_inited = 1;\n      }\n      break;\n    case 1:\n      if (route_list_inited) {\n        in_addr_t addr;\n        route_list_add_vpn_gateway(&rl, c.es, addr);\n      }\n      break;\n    case 2:\n      if (route_list_inited && route_list_ipv6_inited) {\n        struct tuntap tt;\n        memset(&tt, 0, sizeof(tt));\n        add_routes(&rl, &rl6, &tt, 0, c.es, &c);\n      }\n      break;\n    case 3:\n      if (route_list_inited) {\n        setenv_routes(c.es, &rl);\n      }\n      break;\n    case 4:\n      if (route_list_inited) {\n        struct route_ipv4 r;\n        struct route_option ro;\n        ro.network = gb_get_random_string();\n        ro.netmask = gb_get_random_string();\n        ro.gateway = gb_get_random_string();\n        ro.metric = gb_get_random_string();\n        ro.next = NULL;\n\n        memset(&r, 0, sizeof(struct route_ipv4));\n        r.option = &ro;\n        r.flags = RT_DEFINED;\n        add_route(&r, NULL, 0, NULL, c.es, &c);\n      }\n      break;\n    case 5:\n      if (route_list_inited) {\n        char *s1 = get_random_string();\n        is_special_addr(s1);\n        free(s1);\n      }\n      break;\n    case 6:\n      if (route_list_ipv6_inited == 0) {\n        const char *remote_endpoint = gb_get_random_string();\n        memset(&rl, 0, sizeof(struct route_list));\n        struct in6_addr remote_host;\n\n        rl6.rgi6.flags = fuzz_randomizer_get_int(0, 0xffffff);\n        fuzz_get_random_data(&rl6.rgi6.hwaddr, 6);\n\n        char *t1 = gb_get_random_string();\n        if (strlen(t1) > 16) {\n          memcpy(rl6.rgi6.iface, t1, 16);\n        } else {\n          memcpy(rl6.rgi6.iface, t1, strlen(t1));\n        }\n\n        init_route_ipv6_list(&rl6, opt6, remote_endpoint, 0, &remote_host, c.es,\n                             &c);\n        route_list_ipv6_inited = 1;\n      }\n      break;\n    case 7: {\n      unsigned int flags;\n      struct route_ipv6 r6;\n      struct tuntap tt;\n      memset(&tt, 0, sizeof(tt));\n      tt.actual_name = gb_get_random_string();\n      r6.iface = gb_get_random_string();\n      r6.flags = fuzz_randomizer_get_int(0, 0xfffff);\n      r6.netbits = fuzz_randomizer_get_int(0, 0xfffff);\n      r6.metric = fuzz_randomizer_get_int(0, 0xfffff);\n\n      r6.next = NULL;\n\n      add_route_ipv6(&r6, &tt, 0, c.es, &c);\n    } break;\n    case 8:\n      if (route_list_ipv6_inited && route_list_inited) {\n        delete_routes(&rl, &rl6, NULL, 0, c.es, &c);\n        route_list_ipv6_inited = 0;\n        route_list_inited = 0;\n      }\n      break;\n    case 9:\n      if (route_list_ipv6_inited) {\n        setenv_routes_ipv6(c.es, &rl6);\n      }\n      break;\n    case 10: {\n      add_route_ipv6_to_option_list(opt6,\n\t\t                    gb_get_random_string(),\n                                    gb_get_random_string(),\n                                    gb_get_random_string(),\n\t\t\t\t    fuzz_randomizer_get_int(0, 100));\n    } break;\n    case 11: {\n      print_route_options(opt, M_NONFATAL);\n    } break;\n    case 12: {\n      add_route_to_option_list(opt,\n\t\t               gb_get_random_string(),\n                               gb_get_random_string(),\n\t\t\t       gb_get_random_string(),\n                               gb_get_random_string(),\n\t\t\t       fuzz_randomizer_get_int(0, 100));\n    } break;\n    default:\n      break;\n    }\n  }\n\n  if (route_list_inited) {\n    gc_free(&rl.gc);\n  }\n  env_set_destroy(c.es);\n  context_gc_free(&c);\n\n  fuzz_random_destroy();\n\n  gb_cleanup();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_verify_cert.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include \"syshead.h\"\n\n#include <openssl/x509.h>\n#include <openssl/x509v3.h>\n#include <openssl/ssl.h>\n#include <openssl/err.h>\n\n#include \"fuzz_verify_cert.h\"\n#include \"misc.h\"\n#include \"manage.h\"\n#include \"otime.h\"\n#include \"base64.h\"\n#include \"ssl_verify.h\"\n#include \"ssl_verify_backend.h\"\n\n#include \"fuzz_randomizer.h\"\n\n\nstatic int parse_x509(const uint8_t *data, size_t size, X509 **out) {\n  *out = d2i_X509(NULL, (const unsigned char **)&data, size);\n  if (*out == NULL) {\n    return -1;\n  }\n\n  return 0;\n}\n\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n  OPENSSL_malloc_init();\n  SSL_library_init();\n  ERR_load_crypto_strings();\n\n  OpenSSL_add_all_algorithms();\n  OpenSSL_add_ssl_algorithms();\n\n  SSL_load_error_strings();\n  return 1;\n}\n\n\nstatic int init_session_opt(struct tls_options **_opt, struct gc_arena *gc) {\n  ssize_t nid;\n  ssize_t generic_ssizet;\n  struct tls_options *opt;\n  int r;\n\n  ALLOC_OBJ_GC(*_opt, struct tls_options, gc);\n  if (*_opt == NULL) {\n\t\treturn -1;\n  }\n\n  opt = *_opt;\n\n  memset(opt, 0, sizeof(struct tls_options));\n\n  opt->es = env_set_create(gc);\n  opt->x509_username_field[0] = NULL;\n  opt->remote_cert_eku = NULL;\n\n  /* Prevents failure if x509 sha1 hashes do not match */\n  opt->verify_hash = NULL;\n\n  /* Prevent attempt to run --tls-verify script */\n  opt->verify_command = NULL;\n\n  /* Do not verify against CRL file */\n  opt->crl_file = NULL;\n\n  /* Do not run --tls-verify plugins */\n  opt->plugins = NULL;\n\n  r = fuzz_randomizer_get_int(0, 1);\n  if (r == 0) {\n    opt->x509_username_field[0] = nidstrs[fuzz_randomizer_get_int(0, (sizeof(nidstrs)/sizeof(nidstrs[0])) - 1)];\n  } \n  else {\n    opt->x509_username_field[0] = \"ext:subjectAltName\";\n  }\n  opt->x509_username_field[1] = NULL;\n\n  r = fuzz_randomizer_get_int(0, 2);\n  if (r == 0)\n    opt->ns_cert_type = NS_CERT_CHECK_CLIENT;\n  else if (r == 1)\n    opt->ns_cert_type = NS_CERT_CHECK_SERVER;\n  else\n    opt->ns_cert_type = NS_CERT_CHECK_NONE;\n\n  opt->x509_track = NULL;\n\n  r = fuzz_randomizer_get_int(0, 1);\n  if (r == 0)\n    opt->remote_cert_eku = NULL;\n  else\n    opt->remote_cert_eku = get_random_string();\n\n  return 0;\n}\n\n\nstatic int init_session(struct tls_session **_session, struct gc_arena *gc) {\n  struct tls_session *session;\n\n  ALLOC_OBJ_GC(*_session, struct tls_session, gc);\n  if (*_session == NULL) {\n\t\treturn -1;\n  }\n\n  session = *_session;\n  memset(session, 0, sizeof(struct tls_session));\n\n  /* Accessed in set_common_name() */\n  session->common_name = get_random_string();;\n\n  /* Initialize the session->opt structure */\n  if (init_session_opt(&(session->opt), gc) == -1) {\n    free(session->common_name);\n\t\treturn -1;\n  }\n\n  /* Accessed in server_untrusted() */\n  session->untrusted_addr.dest.addr.sa.sa_family = AF_UNSPEC;\n\n  return 0;\n}\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  fuzz_random_init(data, size);\n\n  struct gc_arena gc;\n  struct tls_session *session = NULL;\n  X509 *x509 = NULL;\n  gc = gc_new();\n\n  if (parse_x509(data, size, &x509) == 0) {\n    if (init_session(&session, &gc) == 0) {\n      verify_cert(session, x509, 100);\n      if (session->opt->remote_cert_eku != NULL) {\n        free(session->opt->remote_cert_eku);\n      }\n      free(session->common_name);\n    }\n    \n  }\n\n  X509_free(x509);\n  gc_free(&gc);\n\n  fuzz_random_destroy();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/openvpn/fuzz_verify_cert.h",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nstatic char* nidstrs[] = {\n\"AD_DVCS\",\n\"AES-128-CBC\",\n\"AES-128-CBC-HMAC-SHA1\",\n\"AES-128-CBC-HMAC-SHA256\",\n\"AES-128-CFB\",\n\"AES-128-CFB1\",\n\"AES-128-CFB8\",\n\"AES-128-CTR\",\n\"AES-128-ECB\",\n\"AES-128-OCB\",\n\"AES-128-OFB\",\n\"AES-128-XTS\",\n\"AES-192-CBC\",\n\"AES-192-CBC-HMAC-SHA1\",\n\"AES-192-CBC-HMAC-SHA256\",\n\"AES-192-CFB\",\n\"AES-192-CFB1\",\n\"AES-192-CFB8\",\n\"AES-192-CTR\",\n\"AES-192-ECB\",\n\"AES-192-OCB\",\n\"AES-192-OFB\",\n\"AES-256-CBC\",\n\"AES-256-CBC-HMAC-SHA1\",\n\"AES-256-CBC-HMAC-SHA256\",\n\"AES-256-CFB\",\n\"AES-256-CFB1\",\n\"AES-256-CFB8\",\n\"AES-256-CTR\",\n\"AES-256-ECB\",\n\"AES-256-OCB\",\n\"AES-256-OFB\",\n\"AES-256-XTS\",\n\"AuthDSS\",\n\"AuthECDSA\",\n\"AuthGOST01\",\n\"AuthGOST12\",\n\"AuthNULL\",\n\"AuthPSK\",\n\"AuthRSA\",\n\"AuthSRP\",\n\"BF-CBC\",\n\"BF-CFB\",\n\"BF-ECB\",\n\"BF-OFB\",\n\"BLAKE2b512\",\n\"BLAKE2s256\",\n\"C\",\n\"CAMELLIA-128-CBC\",\n\"CAMELLIA-128-CCM\",\n\"CAMELLIA-128-CFB\",\n\"CAMELLIA-128-CFB1\",\n\"CAMELLIA-128-CFB8\",\n\"CAMELLIA-128-CMAC\",\n\"CAMELLIA-128-CTR\",\n\"CAMELLIA-128-ECB\",\n\"CAMELLIA-128-GCM\",\n\"CAMELLIA-128-OFB\",\n\"CAMELLIA-192-CBC\",\n\"CAMELLIA-192-CCM\",\n\"CAMELLIA-192-CFB\",\n\"CAMELLIA-192-CFB1\",\n\"CAMELLIA-192-CFB8\",\n\"CAMELLIA-192-CMAC\",\n\"CAMELLIA-192-CTR\",\n\"CAMELLIA-192-ECB\",\n\"CAMELLIA-192-GCM\",\n\"CAMELLIA-192-OFB\",\n\"CAMELLIA-256-CBC\",\n\"CAMELLIA-256-CCM\",\n\"CAMELLIA-256-CFB\",\n\"CAMELLIA-256-CFB1\",\n\"CAMELLIA-256-CFB8\",\n\"CAMELLIA-256-CMAC\",\n\"CAMELLIA-256-CTR\",\n\"CAMELLIA-256-ECB\",\n\"CAMELLIA-256-GCM\",\n\"CAMELLIA-256-OFB\",\n\"CAST5-CBC\",\n\"CAST5-CFB\",\n\"CAST5-ECB\",\n\"CAST5-OFB\",\n\"CMAC\",\n\"CN\",\n\"CRLReason\",\n\"CSPName\",\n\"ChaCha20\",\n\"ChaCha20-Poly1305\",\n\"CrlID\",\n\"DC\",\n\"DES-CBC\",\n\"DES-CDMF\",\n\"DES-CFB\",\n\"DES-CFB1\",\n\"DES-CFB8\",\n\"DES-ECB\",\n\"DES-EDE\",\n\"DES-EDE-CBC\",\n\"DES-EDE-CFB\",\n\"DES-EDE-OFB\",\n\"DES-EDE3\",\n\"DES-EDE3-CBC\",\n\"DES-EDE3-CFB\",\n\"DES-EDE3-CFB1\",\n\"DES-EDE3-CFB8\",\n\"DES-EDE3-OFB\",\n\"DES-OFB\",\n\"DESX-CBC\",\n\"DOD\",\n\"DSA\",\n\"DSA-SHA\",\n\"DSA-SHA1\",\n\"DSA-SHA1-old\",\n\"DSA-old\",\n\"DVCS\",\n\"GN\",\n\"HKDF\",\n\"HMAC\",\n\"HMAC-MD5\",\n\"HMAC-SHA1\",\n\"IANA\",\n\"IDEA-CBC\",\n\"IDEA-CFB\",\n\"IDEA-ECB\",\n\"IDEA-OFB\",\n\"INN\",\n\"ISO\",\n\"ISO-US\",\n\"ITU-T\",\n\"JOINT-ISO-ITU-T\",\n\"KISA\",\n\"KxDHE\",\n\"KxDHE-PSK\",\n\"KxECDHE\",\n\"KxECDHE-PSK\",\n\"KxGOST\",\n\"KxPSK\",\n\"KxRSA\",\n\"KxRSA_PSK\",\n\"KxSRP\",\n\"L\",\n\"LocalKeySet\",\n\"MD2\",\n\"MD4\",\n\"MD5\",\n\"MD5-SHA1\",\n\"MDC2\",\n\"MGF1\",\n\"Mail\",\n\"NULL\",\n\"Netscape\",\n\"Nonce\",\n\"O\",\n\"OCSP\",\n\"OCSPSigning\",\n\"OGRN\",\n\"ORG\",\n\"OU\",\n\"Oakley-EC2N-3\",\n\"Oakley-EC2N-4\",\n\"PBE-MD2-DES\",\n\"PBE-MD2-RC2-64\",\n\"PBE-MD5-DES\",\n\"PBE-MD5-RC2-64\",\n\"PBE-SHA1-2DES\",\n\"PBE-SHA1-3DES\",\n\"PBE-SHA1-DES\",\n\"PBE-SHA1-RC2-128\",\n\"PBE-SHA1-RC2-40\",\n\"PBE-SHA1-RC2-64\",\n\"PBE-SHA1-RC4-128\",\n\"PBE-SHA1-RC4-40\",\n\"PBES2\",\n\"PBKDF2\",\n\"PBMAC1\",\n\"PKIX\",\n\"PSPECIFIED\",\n\"RC2-40-CBC\",\n\"RC2-64-CBC\",\n\"RC2-CBC\",\n\"RC2-CFB\",\n\"RC2-ECB\",\n\"RC2-OFB\",\n\"RC4\",\n\"RC4-40\",\n\"RC4-HMAC-MD5\",\n\"RC5-CBC\",\n\"RC5-CFB\",\n\"RC5-ECB\",\n\"RC5-OFB\",\n\"RIPEMD160\",\n\"RSA\",\n\"RSA-MD2\",\n\"RSA-MD4\",\n\"RSA-MD5\",\n\"RSA-MDC2\",\n\"RSA-NP-MD5\",\n\"RSA-RIPEMD160\",\n\"RSA-SHA\",\n\"RSA-SHA1\",\n\"RSA-SHA1-2\",\n\"RSA-SHA224\",\n\"RSA-SHA256\",\n\"RSA-SHA384\",\n\"RSA-SHA512\",\n\"RSAES-OAEP\",\n\"RSASSA-PSS\",\n\"SEED-CBC\",\n\"SEED-CFB\",\n\"SEED-ECB\",\n\"SEED-OFB\",\n\"SHA\",\n\"SHA1\",\n\"SHA224\",\n\"SHA256\",\n\"SHA384\",\n\"SHA512\",\n\"SMIME\",\n\"SMIME-CAPS\",\n\"SN\",\n\"SNILS\",\n\"ST\",\n\"SXNetID\",\n\"TLS1-PRF\",\n\"UID\",\n\"UNDEF\",\n\"X25519\",\n\"X448\",\n\"X500\",\n\"X500algorithms\",\n\"X509\",\n\"X9-57\",\n\"X9cm\",\n\"ZLIB\",\n\"aRecord\",\n\"aaControls\",\n\"ac-auditEntity\",\n\"ac-proxying\",\n\"ac-targeting\",\n\"acceptableResponses\",\n\"account\",\n\"ad_timestamping\",\n\"algorithm\",\n\"ansi-X9-62\",\n\"anyExtendedKeyUsage\",\n\"anyPolicy\",\n\"archiveCutoff\",\n\"associatedDomain\",\n\"associatedName\",\n\"audio\",\n\"authorityInfoAccess\",\n\"authorityKeyIdentifier\",\n\"authorityRevocationList\",\n\"basicConstraints\",\n\"basicOCSPResponse\",\n\"biometricInfo\",\n\"brainpoolP160r1\",\n\"brainpoolP160t1\",\n\"brainpoolP192r1\",\n\"brainpoolP192t1\",\n\"brainpoolP224r1\",\n\"brainpoolP224t1\",\n\"brainpoolP256r1\",\n\"brainpoolP256t1\",\n\"brainpoolP320r1\",\n\"brainpoolP320t1\",\n\"brainpoolP384r1\",\n\"brainpoolP384t1\",\n\"brainpoolP512r1\",\n\"brainpoolP512t1\",\n\"buildingName\",\n\"businessCategory\",\n\"c2onb191v4\",\n\"c2onb191v5\",\n\"c2onb239v4\",\n\"c2onb239v5\",\n\"c2pnb163v1\",\n\"c2pnb163v2\",\n\"c2pnb163v3\",\n\"c2pnb176v1\",\n\"c2pnb208w1\",\n\"c2pnb272w1\",\n\"c2pnb304w1\",\n\"c2pnb368w1\",\n\"c2tnb191v1\",\n\"c2tnb191v2\",\n\"c2tnb191v3\",\n\"c2tnb239v1\",\n\"c2tnb239v2\",\n\"c2tnb239v3\",\n\"c2tnb359v1\",\n\"c2tnb431r1\",\n\"cACertificate\",\n\"cNAMERecord\",\n\"caIssuers\",\n\"caRepository\",\n\"capwapAC\",\n\"capwapWTP\",\n\"caseIgnoreIA5StringSyntax\",\n\"certBag\",\n\"certicom-arc\",\n\"certificateIssuer\",\n\"certificatePolicies\",\n\"certificateRevocationList\",\n\"challengePassword\",\n\"characteristic-two-field\",\n\"clearance\",\n\"clientAuth\",\n\"codeSigning\",\n\"contentType\",\n\"countersignature\",\n\"crlBag\",\n\"crlDistributionPoints\",\n\"crlNumber\",\n\"crossCertificatePair\",\n\"cryptocom\",\n\"cryptopro\",\n\"ct_cert_scts\",\n\"ct_precert_poison\",\n\"ct_precert_scts\",\n\"ct_precert_signer\",\n\"dITRedirect\",\n\"dNSDomain\",\n\"dSAQuality\",\n\"data\",\n\"dcobject\",\n\"deltaCRL\",\n\"deltaRevocationList\",\n\"description\",\n\"destinationIndicator\",\n\"dh-cofactor-kdf\",\n\"dh-std-kdf\",\n\"dhKeyAgreement\",\n\"dhSinglePass-cofactorDH-sha1kdf-scheme\",\n\"dhSinglePass-cofactorDH-sha224kdf-scheme\",\n\"dhSinglePass-cofactorDH-sha256kdf-scheme\",\n\"dhSinglePass-cofactorDH-sha384kdf-scheme\",\n\"dhSinglePass-cofactorDH-sha512kdf-scheme\",\n\"dhSinglePass-stdDH-sha1kdf-scheme\",\n\"dhSinglePass-stdDH-sha224kdf-scheme\",\n\"dhSinglePass-stdDH-sha256kdf-scheme\",\n\"dhSinglePass-stdDH-sha384kdf-scheme\",\n\"dhSinglePass-stdDH-sha512kdf-scheme\",\n\"dhpublicnumber\",\n\"directory\",\n\"distinguishedName\",\n\"dmdName\",\n\"dnQualifier\",\n\"document\",\n\"documentAuthor\",\n\"documentIdentifier\",\n\"documentLocation\",\n\"documentPublisher\",\n\"documentSeries\",\n\"documentTitle\",\n\"documentVersion\",\n\"domain\",\n\"domainRelatedObject\",\n\"dsa_with_SHA224\",\n\"dsa_with_SHA256\",\n\"ecdsa-with-Recommended\",\n\"ecdsa-with-SHA1\",\n\"ecdsa-with-SHA224\",\n\"ecdsa-with-SHA256\",\n\"ecdsa-with-SHA384\",\n\"ecdsa-with-SHA512\",\n\"ecdsa-with-Specified\",\n\"emailAddress\",\n\"emailProtection\",\n\"enhancedSearchGuide\",\n\"enterprises\",\n\"experimental\",\n\"extReq\",\n\"extendedCertificateAttributes\",\n\"extendedKeyUsage\",\n\"extendedStatus\",\n\"facsimileTelephoneNumber\",\n\"favouriteDrink\",\n\"freshestCRL\",\n\"friendlyCountry\",\n\"friendlyCountryName\",\n\"friendlyName\",\n\"generationQualifier\",\n\"gost-mac\",\n\"gost-mac-12\",\n\"gost2001\",\n\"gost2001cc\",\n\"gost2012_256\",\n\"gost2012_512\",\n\"gost89\",\n\"gost89-cbc\",\n\"gost89-cnt\",\n\"gost89-cnt-12\",\n\"gost89-ctr\",\n\"gost89-ecb\",\n\"gost94\",\n\"gost94cc\",\n\"grasshopper-cbc\",\n\"grasshopper-cfb\",\n\"grasshopper-ctr\",\n\"grasshopper-ecb\",\n\"grasshopper-mac\",\n\"grasshopper-ofb\",\n\"hmacWithMD5\",\n\"hmacWithSHA1\",\n\"hmacWithSHA224\",\n\"hmacWithSHA256\",\n\"hmacWithSHA384\",\n\"hmacWithSHA512\",\n\"holdInstructionCallIssuer\",\n\"holdInstructionCode\",\n\"holdInstructionNone\",\n\"holdInstructionReject\",\n\"homePostalAddress\",\n\"homeTelephoneNumber\",\n\"host\",\n\"houseIdentifier\",\n\"iA5StringSyntax\",\n\"id-DHBasedMac\",\n\"id-Gost28147-89-CryptoPro-A-ParamSet\",\n\"id-Gost28147-89-CryptoPro-B-ParamSet\",\n\"id-Gost28147-89-CryptoPro-C-ParamSet\",\n\"id-Gost28147-89-CryptoPro-D-ParamSet\",\n\"id-Gost28147-89-CryptoPro-KeyMeshing\",\n\"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet\",\n\"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet\",\n\"id-Gost28147-89-CryptoPro-RIC-1-ParamSet\",\n\"id-Gost28147-89-None-KeyMeshing\",\n\"id-Gost28147-89-TestParamSet\",\n\"id-Gost28147-89-cc\",\n\"id-GostR3410-2001-CryptoPro-A-ParamSet\",\n\"id-GostR3410-2001-CryptoPro-B-ParamSet\",\n\"id-GostR3410-2001-CryptoPro-C-ParamSet\",\n\"id-GostR3410-2001-CryptoPro-XchA-ParamSet\",\n\"id-GostR3410-2001-CryptoPro-XchB-ParamSet\",\n\"id-GostR3410-2001-ParamSet-cc\",\n\"id-GostR3410-2001-TestParamSet\",\n\"id-GostR3410-2001DH\",\n\"id-GostR3410-94-CryptoPro-A-ParamSet\",\n\"id-GostR3410-94-CryptoPro-B-ParamSet\",\n\"id-GostR3410-94-CryptoPro-C-ParamSet\",\n\"id-GostR3410-94-CryptoPro-D-ParamSet\",\n\"id-GostR3410-94-CryptoPro-XchA-ParamSet\",\n\"id-GostR3410-94-CryptoPro-XchB-ParamSet\",\n\"id-GostR3410-94-CryptoPro-XchC-ParamSet\",\n\"id-GostR3410-94-TestParamSet\",\n\"id-GostR3410-94-a\",\n\"id-GostR3410-94-aBis\",\n\"id-GostR3410-94-b\",\n\"id-GostR3410-94-bBis\",\n\"id-GostR3410-94DH\",\n\"id-GostR3411-94-CryptoProParamSet\",\n\"id-GostR3411-94-TestParamSet\",\n\"id-GostR3411-94-with-GostR3410-2001\",\n\"id-GostR3411-94-with-GostR3410-2001-cc\",\n\"id-GostR3411-94-with-GostR3410-94\",\n\"id-GostR3411-94-with-GostR3410-94-cc\",\n\"id-HMACGostR3411-94\",\n\"id-PasswordBasedMAC\",\n\"id-aca\",\n\"id-aca-accessIdentity\",\n\"id-aca-authenticationInfo\",\n\"id-aca-chargingIdentity\",\n\"id-aca-encAttrs\",\n\"id-aca-group\",\n\"id-aca-role\",\n\"id-ad\",\n\"id-aes128-CCM\",\n\"id-aes128-GCM\",\n\"id-aes128-wrap\",\n\"id-aes128-wrap-pad\",\n\"id-aes192-CCM\",\n\"id-aes192-GCM\",\n\"id-aes192-wrap\",\n\"id-aes192-wrap-pad\",\n\"id-aes256-CCM\",\n\"id-aes256-GCM\",\n\"id-aes256-wrap\",\n\"id-aes256-wrap-pad\",\n\"id-alg\",\n\"id-alg-PWRI-KEK\",\n\"id-alg-des40\",\n\"id-alg-dh-pop\",\n\"id-alg-dh-sig-hmac-sha1\",\n\"id-alg-noSignature\",\n\"id-camellia128-wrap\",\n\"id-camellia192-wrap\",\n\"id-camellia256-wrap\",\n\"id-cct\",\n\"id-cct-PKIData\",\n\"id-cct-PKIResponse\",\n\"id-cct-crs\",\n\"id-ce\",\n\"id-characteristic-two-basis\",\n\"id-cmc\",\n\"id-cmc-addExtensions\",\n\"id-cmc-confirmCertAcceptance\",\n\"id-cmc-dataReturn\",\n\"id-cmc-decryptedPOP\",\n\"id-cmc-encryptedPOP\",\n\"id-cmc-getCRL\",\n\"id-cmc-getCert\",\n\"id-cmc-identification\",\n\"id-cmc-identityProof\",\n\"id-cmc-lraPOPWitness\",\n\"id-cmc-popLinkRandom\",\n\"id-cmc-popLinkWitness\",\n\"id-cmc-queryPending\",\n\"id-cmc-recipientNonce\",\n\"id-cmc-regInfo\",\n\"id-cmc-responseInfo\",\n\"id-cmc-revokeRequest\",\n\"id-cmc-senderNonce\",\n\"id-cmc-statusInfo\",\n\"id-cmc-transactionId\",\n\"id-ct-asciiTextWithCRLF\",\n\"id-ct-xml\",\n\"id-ecPublicKey\",\n\"id-hex-multipart-message\",\n\"id-hex-partial-message\",\n\"id-it\",\n\"id-it-caKeyUpdateInfo\",\n\"id-it-caProtEncCert\",\n\"id-it-confirmWaitTime\",\n\"id-it-currentCRL\",\n\"id-it-encKeyPairTypes\",\n\"id-it-implicitConfirm\",\n\"id-it-keyPairParamRep\",\n\"id-it-keyPairParamReq\",\n\"id-it-origPKIMessage\",\n\"id-it-preferredSymmAlg\",\n\"id-it-revPassphrase\",\n\"id-it-signKeyPairTypes\",\n\"id-it-subscriptionRequest\",\n\"id-it-subscriptionResponse\",\n\"id-it-suppLangTags\",\n\"id-it-unsupportedOIDs\",\n\"id-kp\",\n\"id-mod-attribute-cert\",\n\"id-mod-cmc\",\n\"id-mod-cmp\",\n\"id-mod-cmp2000\",\n\"id-mod-crmf\",\n\"id-mod-dvcs\",\n\"id-mod-kea-profile-88\",\n\"id-mod-kea-profile-93\",\n\"id-mod-ocsp\",\n\"id-mod-qualified-cert-88\",\n\"id-mod-qualified-cert-93\",\n\"id-mod-timestamp-protocol\",\n\"id-on\",\n\"id-on-permanentIdentifier\",\n\"id-on-personalData\",\n\"id-pda\",\n\"id-pda-countryOfCitizenship\",\n\"id-pda-countryOfResidence\",\n\"id-pda-dateOfBirth\",\n\"id-pda-gender\",\n\"id-pda-placeOfBirth\",\n\"id-pe\",\n\"id-pkinit\",\n\"id-pkip\",\n\"id-pkix-mod\",\n\"id-pkix1-explicit-88\",\n\"id-pkix1-explicit-93\",\n\"id-pkix1-implicit-88\",\n\"id-pkix1-implicit-93\",\n\"id-ppl\",\n\"id-ppl-anyLanguage\",\n\"id-ppl-independent\",\n\"id-ppl-inheritAll\",\n\"id-qcs\",\n\"id-qcs-pkixQCSyntax-v1\",\n\"id-qt\",\n\"id-qt-cps\",\n\"id-qt-unotice\",\n\"id-regCtrl\",\n\"id-regCtrl-authenticator\",\n\"id-regCtrl-oldCertID\",\n\"id-regCtrl-pkiArchiveOptions\",\n\"id-regCtrl-pkiPublicationInfo\",\n\"id-regCtrl-protocolEncrKey\",\n\"id-regCtrl-regToken\",\n\"id-regInfo\",\n\"id-regInfo-certReq\",\n\"id-regInfo-utf8Pairs\",\n\"id-scrypt\",\n\"id-set\",\n\"id-smime-aa\",\n\"id-smime-aa-contentHint\",\n\"id-smime-aa-contentIdentifier\",\n\"id-smime-aa-contentReference\",\n\"id-smime-aa-dvcs-dvc\",\n\"id-smime-aa-encapContentType\",\n\"id-smime-aa-encrypKeyPref\",\n\"id-smime-aa-equivalentLabels\",\n\"id-smime-aa-ets-CertificateRefs\",\n\"id-smime-aa-ets-RevocationRefs\",\n\"id-smime-aa-ets-archiveTimeStamp\",\n\"id-smime-aa-ets-certCRLTimestamp\",\n\"id-smime-aa-ets-certValues\",\n\"id-smime-aa-ets-commitmentType\",\n\"id-smime-aa-ets-contentTimestamp\",\n\"id-smime-aa-ets-escTimeStamp\",\n\"id-smime-aa-ets-otherSigCert\",\n\"id-smime-aa-ets-revocationValues\",\n\"id-smime-aa-ets-sigPolicyId\",\n\"id-smime-aa-ets-signerAttr\",\n\"id-smime-aa-ets-signerLocation\",\n\"id-smime-aa-macValue\",\n\"id-smime-aa-mlExpandHistory\",\n\"id-smime-aa-msgSigDigest\",\n\"id-smime-aa-receiptRequest\",\n\"id-smime-aa-securityLabel\",\n\"id-smime-aa-signatureType\",\n\"id-smime-aa-signingCertificate\",\n\"id-smime-aa-smimeEncryptCerts\",\n\"id-smime-aa-timeStampToken\",\n\"id-smime-alg\",\n\"id-smime-alg-3DESwrap\",\n\"id-smime-alg-CMS3DESwrap\",\n\"id-smime-alg-CMSRC2wrap\",\n\"id-smime-alg-ESDH\",\n\"id-smime-alg-ESDHwith3DES\",\n\"id-smime-alg-ESDHwithRC2\",\n\"id-smime-alg-RC2wrap\",\n\"id-smime-cd\",\n\"id-smime-cd-ldap\",\n\"id-smime-ct\",\n\"id-smime-ct-DVCSRequestData\",\n\"id-smime-ct-DVCSResponseData\",\n\"id-smime-ct-TDTInfo\",\n\"id-smime-ct-TSTInfo\",\n\"id-smime-ct-authData\",\n\"id-smime-ct-authEnvelopedData\",\n\"id-smime-ct-compressedData\",\n\"id-smime-ct-contentCollection\",\n\"id-smime-ct-contentInfo\",\n\"id-smime-ct-publishCert\",\n\"id-smime-ct-receipt\",\n\"id-smime-cti\",\n\"id-smime-cti-ets-proofOfApproval\",\n\"id-smime-cti-ets-proofOfCreation\",\n\"id-smime-cti-ets-proofOfDelivery\",\n\"id-smime-cti-ets-proofOfOrigin\",\n\"id-smime-cti-ets-proofOfReceipt\",\n\"id-smime-cti-ets-proofOfSender\",\n\"id-smime-mod\",\n\"id-smime-mod-cms\",\n\"id-smime-mod-ess\",\n\"id-smime-mod-ets-eSigPolicy-88\",\n\"id-smime-mod-ets-eSigPolicy-97\",\n\"id-smime-mod-ets-eSignature-88\",\n\"id-smime-mod-ets-eSignature-97\",\n\"id-smime-mod-msg-v3\",\n\"id-smime-mod-oid\",\n\"id-smime-spq\",\n\"id-smime-spq-ets-sqt-unotice\",\n\"id-smime-spq-ets-sqt-uri\",\n\"id-tc26\",\n\"id-tc26-agreement\",\n\"id-tc26-agreement-gost-3410-2012-256\",\n\"id-tc26-agreement-gost-3410-2012-512\",\n\"id-tc26-algorithms\",\n\"id-tc26-cipher\",\n\"id-tc26-cipher-constants\",\n\"id-tc26-constants\",\n\"id-tc26-digest\",\n\"id-tc26-digest-constants\",\n\"id-tc26-gost-28147-constants\",\n\"id-tc26-gost-28147-param-Z\",\n\"id-tc26-gost-3410-2012-512-constants\",\n\"id-tc26-gost-3410-2012-512-paramSetA\",\n\"id-tc26-gost-3410-2012-512-paramSetB\",\n\"id-tc26-gost-3410-2012-512-paramSetTest\",\n\"id-tc26-hmac-gost-3411-2012-256\",\n\"id-tc26-hmac-gost-3411-2012-512\",\n\"id-tc26-mac\",\n\"id-tc26-sign\",\n\"id-tc26-sign-constants\",\n\"id-tc26-signwithdigest\",\n\"id-tc26-signwithdigest-gost3410-2012-256\",\n\"id-tc26-signwithdigest-gost3410-2012-512\",\n\"identified-organization\",\n\"info\",\n\"inhibitAnyPolicy\",\n\"initials\",\n\"international-organizations\",\n\"internationaliSDNNumber\",\n\"invalidityDate\",\n\"ipsecEndSystem\",\n\"ipsecIKE\",\n\"ipsecTunnel\",\n\"ipsecUser\",\n\"issuerAltName\",\n\"issuerSignTool\",\n\"issuingDistributionPoint\",\n\"janetMailbox\",\n\"jurisdictionC\",\n\"jurisdictionL\",\n\"jurisdictionST\",\n\"keyBag\",\n\"keyUsage\",\n\"lastModifiedBy\",\n\"lastModifiedTime\",\n\"localKeyID\",\n\"mXRecord\",\n\"mail\",\n\"mailPreferenceOption\",\n\"manager\",\n\"md_gost12_256\",\n\"md_gost12_512\",\n\"md_gost94\",\n\"member\",\n\"member-body\",\n\"messageDigest\",\n\"mgmt\",\n\"mime-mhs\",\n\"mime-mhs-bodies\",\n\"mime-mhs-headings\",\n\"mobileTelephoneNumber\",\n\"msCTLSign\",\n\"msCodeCom\",\n\"msCodeInd\",\n\"msEFS\",\n\"msExtReq\",\n\"msSGC\",\n\"msSmartcardLogin\",\n\"msUPN\",\n\"nSRecord\",\n\"name\",\n\"nameConstraints\",\n\"noCheck\",\n\"noRevAvail\",\n\"nsBaseUrl\",\n\"nsCaPolicyUrl\",\n\"nsCaRevocationUrl\",\n\"nsCertExt\",\n\"nsCertSequence\",\n\"nsCertType\",\n\"nsComment\",\n\"nsDataType\",\n\"nsRenewalUrl\",\n\"nsRevocationUrl\",\n\"nsSGC\",\n\"nsSslServerName\",\n\"onBasis\",\n\"organizationalStatus\",\n\"otherMailbox\",\n\"owner\",\n\"pagerTelephoneNumber\",\n\"path\",\n\"pbeWithMD5AndCast5CBC\",\n\"personalSignature\",\n\"personalTitle\",\n\"photo\",\n\"physicalDeliveryOfficeName\",\n\"pilot\",\n\"pilotAttributeSyntax\",\n\"pilotAttributeType\",\n\"pilotAttributeType27\",\n\"pilotDSA\",\n\"pilotGroups\",\n\"pilotObject\",\n\"pilotObjectClass\",\n\"pilotOrganization\",\n\"pilotPerson\",\n\"pkInitClientAuth\",\n\"pkInitKDC\",\n\"pkcs\",\n\"pkcs1\",\n\"pkcs3\",\n\"pkcs5\",\n\"pkcs7\",\n\"pkcs7-data\",\n\"pkcs7-digestData\",\n\"pkcs7-encryptedData\",\n\"pkcs7-envelopedData\",\n\"pkcs7-signedAndEnvelopedData\",\n\"pkcs7-signedData\",\n\"pkcs8ShroudedKeyBag\",\n\"pkcs9\",\n\"policyConstraints\",\n\"policyMappings\",\n\"postOfficeBox\",\n\"postalAddress\",\n\"postalCode\",\n\"ppBasis\",\n\"preferredDeliveryMethod\",\n\"presentationAddress\",\n\"prf-gostr3411-94\",\n\"prime-field\",\n\"prime192v1\",\n\"prime192v2\",\n\"prime192v3\",\n\"prime239v1\",\n\"prime239v2\",\n\"prime239v3\",\n\"prime256v1\",\n\"private\",\n\"privateKeyUsagePeriod\",\n\"protocolInformation\",\n\"proxyCertInfo\",\n\"pseudonym\",\n\"pss\",\n\"qcStatements\",\n\"qualityLabelledData\",\n\"rFC822localPart\",\n\"registeredAddress\",\n\"role\",\n\"roleOccupant\",\n\"room\",\n\"roomNumber\",\n\"rsaEncryption\",\n\"rsaOAEPEncryptionSET\",\n\"rsaSignature\",\n\"rsadsi\",\n\"sOARecord\",\n\"safeContentsBag\",\n\"sbgp-autonomousSysNum\",\n\"sbgp-ipAddrBlock\",\n\"sbgp-routerIdentifier\",\n\"sdsiCertificate\",\n\"searchGuide\",\n\"secp112r1\",\n\"secp112r2\",\n\"secp128r1\",\n\"secp128r2\",\n\"secp160k1\",\n\"secp160r1\",\n\"secp160r2\",\n\"secp192k1\",\n\"secp224k1\",\n\"secp224r1\",\n\"secp256k1\",\n\"secp384r1\",\n\"secp521r1\",\n\"secretBag\",\n\"secretary\",\n\"sect113r1\",\n\"sect113r2\",\n\"sect131r1\",\n\"sect131r2\",\n\"sect163k1\",\n\"sect163r1\",\n\"sect163r2\",\n\"sect193r1\",\n\"sect193r2\",\n\"sect233k1\",\n\"sect233r1\",\n\"sect239k1\",\n\"sect283k1\",\n\"sect283r1\",\n\"sect409k1\",\n\"sect409r1\",\n\"sect571k1\",\n\"sect571r1\",\n\"secureShellClient\",\n\"secureShellServer\",\n\"security\",\n\"seeAlso\",\n\"selected-attribute-types\",\n\"sendOwner\",\n\"sendProxiedOwner\",\n\"sendProxiedRouter\",\n\"sendRouter\",\n\"serialNumber\",\n\"serverAuth\",\n\"serviceLocator\",\n\"set-addPolicy\",\n\"set-attr\",\n\"set-brand\",\n\"set-brand-AmericanExpress\",\n\"set-brand-Diners\",\n\"set-brand-IATA-ATA\",\n\"set-brand-JCB\",\n\"set-brand-MasterCard\",\n\"set-brand-Novus\",\n\"set-brand-Visa\",\n\"set-certExt\",\n\"set-ctype\",\n\"set-msgExt\",\n\"set-policy\",\n\"set-policy-root\",\n\"set-rootKeyThumb\",\n\"setAttr-Cert\",\n\"setAttr-GenCryptgrm\",\n\"setAttr-IssCap\",\n\"setAttr-IssCap-CVM\",\n\"setAttr-IssCap-Sig\",\n\"setAttr-IssCap-T2\",\n\"setAttr-PGWYcap\",\n\"setAttr-SecDevSig\",\n\"setAttr-T2Enc\",\n\"setAttr-T2cleartxt\",\n\"setAttr-TokICCsig\",\n\"setAttr-Token-B0Prime\",\n\"setAttr-Token-EMV\",\n\"setAttr-TokenType\",\n\"setCext-IssuerCapabilities\",\n\"setCext-PGWYcapabilities\",\n\"setCext-TokenIdentifier\",\n\"setCext-TokenType\",\n\"setCext-Track2Data\",\n\"setCext-cCertRequired\",\n\"setCext-certType\",\n\"setCext-hashedRoot\",\n\"setCext-merchData\",\n\"setCext-setExt\",\n\"setCext-setQualf\",\n\"setCext-tunneling\",\n\"setct-AcqCardCodeMsg\",\n\"setct-AcqCardCodeMsgTBE\",\n\"setct-AuthReqTBE\",\n\"setct-AuthReqTBS\",\n\"setct-AuthResBaggage\",\n\"setct-AuthResTBE\",\n\"setct-AuthResTBEX\",\n\"setct-AuthResTBS\",\n\"setct-AuthResTBSX\",\n\"setct-AuthRevReqBaggage\",\n\"setct-AuthRevReqTBE\",\n\"setct-AuthRevReqTBS\",\n\"setct-AuthRevResBaggage\",\n\"setct-AuthRevResData\",\n\"setct-AuthRevResTBE\",\n\"setct-AuthRevResTBEB\",\n\"setct-AuthRevResTBS\",\n\"setct-AuthTokenTBE\",\n\"setct-AuthTokenTBS\",\n\"setct-BCIDistributionTBS\",\n\"setct-BatchAdminReqData\",\n\"setct-BatchAdminReqTBE\",\n\"setct-BatchAdminResData\",\n\"setct-BatchAdminResTBE\",\n\"setct-CRLNotificationResTBS\",\n\"setct-CRLNotificationTBS\",\n\"setct-CapReqTBE\",\n\"setct-CapReqTBEX\",\n\"setct-CapReqTBS\",\n\"setct-CapReqTBSX\",\n\"setct-CapResData\",\n\"setct-CapResTBE\",\n\"setct-CapRevReqTBE\",\n\"setct-CapRevReqTBEX\",\n\"setct-CapRevReqTBS\",\n\"setct-CapRevReqTBSX\",\n\"setct-CapRevResData\",\n\"setct-CapRevResTBE\",\n\"setct-CapTokenData\",\n\"setct-CapTokenSeq\",\n\"setct-CapTokenTBE\",\n\"setct-CapTokenTBEX\",\n\"setct-CapTokenTBS\",\n\"setct-CardCInitResTBS\",\n\"setct-CertInqReqTBS\",\n\"setct-CertReqData\",\n\"setct-CertReqTBE\",\n\"setct-CertReqTBEX\",\n\"setct-CertReqTBS\",\n\"setct-CertResData\",\n\"setct-CertResTBE\",\n\"setct-CredReqTBE\",\n\"setct-CredReqTBEX\",\n\"setct-CredReqTBS\",\n\"setct-CredReqTBSX\",\n\"setct-CredResData\",\n\"setct-CredResTBE\",\n\"setct-CredRevReqTBE\",\n\"setct-CredRevReqTBEX\",\n\"setct-CredRevReqTBS\",\n\"setct-CredRevReqTBSX\",\n\"setct-CredRevResData\",\n\"setct-CredRevResTBE\",\n\"setct-ErrorTBS\",\n\"setct-HODInput\",\n\"setct-MeAqCInitResTBS\",\n\"setct-OIData\",\n\"setct-PANData\",\n\"setct-PANOnly\",\n\"setct-PANToken\",\n\"setct-PCertReqData\",\n\"setct-PCertResTBS\",\n\"setct-PI\",\n\"setct-PI-TBS\",\n\"setct-PIData\",\n\"setct-PIDataUnsigned\",\n\"setct-PIDualSignedTBE\",\n\"setct-PIUnsignedTBE\",\n\"setct-PInitResData\",\n\"setct-PResData\",\n\"setct-RegFormReqTBE\",\n\"setct-RegFormResTBS\",\n\"setext-cv\",\n\"setext-genCrypt\",\n\"setext-miAuth\",\n\"setext-pinAny\",\n\"setext-pinSecure\",\n\"setext-track2\",\n\"signingTime\",\n\"simpleSecurityObject\",\n\"singleLevelQuality\",\n\"snmpv2\",\n\"street\",\n\"subjectAltName\",\n\"subjectDirectoryAttributes\",\n\"subjectInfoAccess\",\n\"subjectKeyIdentifier\",\n\"subjectSignTool\",\n\"subtreeMaximumQuality\",\n\"subtreeMinimumQuality\",\n\"supportedAlgorithms\",\n\"supportedApplicationContext\",\n\"targetInformation\",\n\"telephoneNumber\",\n\"teletexTerminalIdentifier\",\n\"telexNumber\",\n\"textEncodedORAddress\",\n\"textNotice\",\n\"timeStamping\",\n\"title\",\n\"tlsfeature\",\n\"tpBasis\",\n\"trustRoot\",\n\"ucl\",\n\"uid\",\n\"uniqueMember\",\n\"unstructuredAddress\",\n\"unstructuredName\",\n\"userCertificate\",\n\"userClass\",\n\"userPassword\",\n\"valid\",\n\"wap\",\n\"wap-wsg\",\n\"wap-wsg-idm-ecid-wtls1\",\n\"wap-wsg-idm-ecid-wtls10\",\n\"wap-wsg-idm-ecid-wtls11\",\n\"wap-wsg-idm-ecid-wtls12\",\n\"wap-wsg-idm-ecid-wtls3\",\n\"wap-wsg-idm-ecid-wtls4\",\n\"wap-wsg-idm-ecid-wtls5\",\n\"wap-wsg-idm-ecid-wtls6\",\n\"wap-wsg-idm-ecid-wtls7\",\n\"wap-wsg-idm-ecid-wtls8\",\n\"wap-wsg-idm-ecid-wtls9\",\n\"whirlpool\",\n\"x121Address\",\n\"x500UniqueIdentifier\",\n\"x509Certificate\",\n\"x509Crl\",\n};\n"
  },
  {
    "path": "projects/openvpn/project.yaml",
    "content": "homepage: \"http://community.openvpn.net\"\nlanguage: c\nprimary_contact: \"arne@rfc2549.org\"\nmain_repo: \"https://github.com/OpenVPN/openvpn\"\nauto_ccs:\n - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/openvswitch/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake \\\n    libtool python3 python3-pip \\\n    libz-dev libssl-dev wget\nRUN pip3 install six\nRUN git clone --depth 1 https://github.com/openvswitch/ovs.git openvswitch\nRUN git clone --depth 1 https://github.com/openvswitch/ovs-fuzzing-corpus.git \\\n    ovs-fuzzing-corpus\nWORKDIR openvswitch\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/openvswitch/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./boot.sh && HAVE_UNWIND=no ./configure --enable-ndebug && make -j$(nproc) && make oss-fuzz-targets\n\ncp $SRC/openvswitch/tests/oss-fuzz/config/*.options $OUT/\ncp $SRC/openvswitch/tests/oss-fuzz/config/*.dict $OUT/\nwget -O $OUT/json.dict https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/json.dict\n\nfor file in $SRC/openvswitch/tests/oss-fuzz/*_target;\ndo\n       cp $file $OUT/\n       name=$(basename $file)\n       corp_name=$(basename $file _target)\n       corp_dir=$SRC/ovs-fuzzing-corpus/${corp_name}_seed_corpus\n       if [ -d ${corp_dir} ]; then\n           zip -rq $OUT/${name}_seed_corpus ${corp_dir}\n       fi\ndone\n"
  },
  {
    "path": "projects/openvswitch/project.yaml",
    "content": "homepage: \"http://www.openvswitch.org\"\nlanguage: c++\nprimary_contact: \"blp@ovn.org\"\nauto_ccs:\n  - \"jpettit@ovn.org\"\n  - \"pfaffben@gmail.com\" \n  - \"pkusunyifeng@gmail.com\"\n  - \"bshas3@gmail.com\"\n  - \"cpp.code.lv@gmail.com\"\n  - \"u9012063@gmail.com\"\n  - \"ilya.maximets@gmail.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: 'https://github.com/openvswitch/ovs.git'\n"
  },
  {
    "path": "projects/openvswitch/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check -j$(nproc)\n"
  },
  {
    "path": "projects/openweave/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip python-setuptools bridge-utils \\\n  libglib2.0-dev libdbus-1-dev libudev-dev \\\n  libical-dev libreadline-dev udev \\\n  libtool autoconf automake systemd\nRUN pip3 install --user google-cloud googleapis-common-protos grpcio protobuf pycryptodomex\nRUN cpan -i Text::Template\nRUN git clone --depth 1 https://github.com/openweave/openweave-core\nWORKDIR $SRC/openweave-core\nCOPY build.sh $SRC/\nCOPY patch.diff $SRC/\n"
  },
  {
    "path": "projects/openweave/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit apply  --ignore-space-change --ignore-whitespace $SRC/patch.diff\n\nfunction copy_lib\n    {\n    local fuzzer_path=$1\n    local lib=$2\n    cp $(ldd ${fuzzer_path} | grep \"${lib}\" | awk '{ print $3 }') ${OUT}/lib\n    }\n\nmkdir -p $OUT/lib\n\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n    # so that we do not get openssl\n    export CXXFLAGS=\"$CXXFLAGS -fsanitize=fuzzer-no-link,address\"\n    export CFLAGS=\"$CFLAGS -fsanitize=fuzzer-no-link,address\"\nfi\n\n# build project\n./bootstrap\n# java fails with Source option 6 is no longer supported. Use 7 or later.\n./configure --disable-java --enable-fuzzing --disable-shared\n\n# patch bluez\nsed -i 's/sys\\/socket.h>/sys\\/socket.h>\\n#include <linux\\/sockios.h>/g' ./third_party/bluez/repo/tools/l2test.c\nsed -i 's/sys\\/stat.h>/sys\\/stat.h>\\n#include <linux\\/sockios.h>/g' ./third_party/bluez/repo/tools/rctest.c\n\n# OpenSSL now declares RAND_bytes so we must patch\nfind ./src/test-apps/fuzz/ -name \"FuzzP*.cpp\" -exec sed -i 's/RAND_bytes/RAND_bytes2/g' {} \\;\n\n# Don't use all cores to avoid OOM.\n# See https://github.com/google/oss-fuzz/pull/12174\nmake -j$(expr $(nproc) / 2)\n\nfind src/test-apps/fuzz/ -type f -executable -name \"Fuzz*\" | while read i; do\n    patchelf --set-rpath '$ORIGIN/lib' ${i}\n    copy_lib ${i} libglib\n    copy_lib ${i} libdbus\n    cp ${i} $OUT/\ndone\n\n# build corpus\nls $SRC/openweave-core/src/test-apps/fuzz/corpus/ | while read f; do\n    zip -j $OUT/${f}_seed_corpus.zip $SRC/openweave-core/src/test-apps/fuzz/corpus/${f}/*;\ndone\n\ncd $OUT/\nls *_seed_corpus.zip | grep PASE | while read c; do\n    cp $c Fuzz$c;\ndone\n\n"
  },
  {
    "path": "projects/openweave/patch.diff",
    "content": "diff --git a/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp b/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp\nindex 7a6cb42..c05caae 100644\n--- a/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp\n+++ b/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp\n@@ -53,8 +53,9 @@ WEAVE_ERROR InitSecureRandomDataSource(nl::Weave::Crypto::EntropyFunct entropyFu\n \n WEAVE_ERROR GetSecureRandomData(uint8_t *buf, uint16_t len)\n {\n-    if (RAND_bytes((unsigned char *)buf, (int)len) != 1)\n-        return WEAVE_ERROR_RANDOM_DATA_UNAVAILABLE;\n+    //if (RAND_bytes((unsigned char *)buf, (int)len) != 1)\n+    //    return WEAVE_ERROR_RANDOM_DATA_UNAVAILABLE;\n+    memset((unsigned char *)buf, 'A', (int)len);\n \n     return WEAVE_NO_ERROR;\n }\ndiff --git a/src/tools/weave/CertUtils.cpp b/src/tools/weave/CertUtils.cpp\nindex 2bd8097..a1dce36 100644\n--- a/src/tools/weave/CertUtils.cpp\n+++ b/src/tools/weave/CertUtils.cpp\n@@ -695,8 +695,9 @@ bool SetCertSerialNumber(X509 *cert)\n     ASN1_INTEGER *snInt = X509_get_serialNumber(cert);\n \n     // Generate a random value to be used as the serial number.\n-    if (!RAND_bytes(reinterpret_cast<uint8_t *>(&rnd), sizeof(rnd)))\n-        ReportOpenSSLErrorAndExit(\"RAND_bytes\", res = false);\n+    //if (!RAND_bytes(reinterpret_cast<uint8_t *>(&rnd), sizeof(rnd)))\n+    //    ReportOpenSSLErrorAndExit(\"RAND_bytes\", res = false);\n+    memset(reinterpret_cast<uint8_t *>(&rnd), 'A', sizeof(rnd));\n \n     // Avoid negative numbers.\n     rnd &= 0x7FFFFFFFFFFFFFFF;\ndiff --git a/src/tools/weave/Cmd_GenProvisioningData.cpp b/src/tools/weave/Cmd_GenProvisioningData.cpp\nindex 85ca2e2..bd5c18b 100644\n--- a/src/tools/weave/Cmd_GenProvisioningData.cpp\n+++ b/src/tools/weave/Cmd_GenProvisioningData.cpp\n@@ -543,8 +543,9 @@ char *GeneratePairingCode(uint32_t pairingCodeLen)\n     }\n \n     // Generate random data for the pairing code, excluding the check digit at the end.\n-    if (!RAND_bytes((uint8_t *)pairingCode, pairingCodeLen - 1))\n-        ReportOpenSSLErrorAndExit(\"Failed to get random data\", pairingCode = NULL);\n+    //if (!RAND_bytes((uint8_t *)pairingCode, pairingCodeLen - 1))\n+    //    ReportOpenSSLErrorAndExit(\"Failed to get random data\", pairingCode = NULL);\n+    memset((uint8_t *)pairingCode, 'A', pairingCodeLen - 1);\n \n     // Convert the random data to characters in the range 0-9, A-H, J-N, P, R-Y (base-32 alphanumeric, excluding I, O, Q and Z).\n     for (uint32_t i = 0; i < pairingCodeLen - 1; i++)\n"
  },
  {
    "path": "projects/openweave/project.yaml",
    "content": "homepage: \"https://openweave.io\"\nlanguage: c++\nprimary_contact: \"szewczyk@google.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/openweave/openweave-core'\n"
  },
  {
    "path": "projects/openyurt/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nENV PROJECT_ROOT=\"${GOPATH:-/root/go}/src/github.com/openyurtio\"\n\nRUN mkdir -p \"${PROJECT_ROOT}\"\n\nARG REPOSITORY_OWNER=\"openyurtio\"\nARG REPOSITORIES=\"openyurt\"\n\nRUN for repo in ${REPOSITORIES}; do git clone --depth 1 \"https://github.com/${REPOSITORY_OWNER}/${repo}\" \"${PROJECT_ROOT}/${repo}\"; done\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\n\nCOPY build.sh $SRC/\nRUN chmod +x $SRC/build.sh\n\nRUN echo \"PROJECT_ROOT: $PROJECT_ROOT\"\nRUN echo \"WORKDIR: $SRC\"\n\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/openyurt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/openyurt/build.sh"
  },
  {
    "path": "projects/openyurt/project.yaml",
    "content": "homepage: \"https://openyurt.io/\"\nmain_repo: \"https://github.com/openyurtio/openyurt\"\nprimary_contact: \"rambohe.ch@gmail.com\"\nauto_ccs :\n  - \"rambohe.ch@gmail.com\"\n  - \"huiwq1990@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/opt_einsum/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip Cython numpy\nRUN git clone https://github.com/dgasmith/opt_einsum opt_einsum\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/opt_einsum\n"
  },
  {
    "path": "projects/opt_einsum/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/opt_einsum/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport numpy as np\nfrom opt_einsum.parser import parse_einsum_input\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  # Create a numpy array with fuzzer-seeded entries.\n  ops = np.array(\n    [fdp.ConsumeFloat(), fdp.ConsumeFloat(), fdp.ConsumeFloat, fdp.ConsumeFloat()],\n  )\n  try:\n    parse_einsum_input(\n        [fdp.ConsumeUnicodeNoSurrogates(sys.maxsize), *ops],\n        shapes=fdp.ConsumeBool()\n    )\n  except ValueError:\n    # Raised by einsum parsing\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/opt_einsum/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/dgasmith/opt_einsum\nlanguage: python\nmain_repo: https://github.com/dgasmith/opt_einsum\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/opus/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget\n\nRUN git clone --single-branch --branch ossfuzz https://gitlab.xiph.org/xiph/opus.git\nRUN wget https://opus-codec.org/static/testvectors/opus_testvectors.tar.gz\nWORKDIR opus\nCOPY run_tests.sh build.sh $SRC/\nCOPY *.cc tests/\nCOPY *.h tests/\n"
  },
  {
    "path": "projects/opus/build.sh",
    "content": "#!/bin/bash\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##############################################################################\nset -eu\n\nFUZZERS=\"opus_encode_fuzzer opus_multistream_decode_fuzzer opus_multistream_encode_fuzzer opus_projection_decoder_fuzzer opus_projection_encoder_fuzzer opus_repacketizer_fuzzer\"\nBUILDS=(floating fixed floating_qext fixed_qext)\n\ntar xvf $SRC/opus_testvectors.tar.gz\nzip -r $SRC/zipped-corpus.zip opus_testvectors/\n\nif [[ $CFLAGS = *sanitize=memory* ]]; then\n  CFLAGS+=\" -D_FORTIFY_SOURCE=0\"\nfi\n\n./autogen.sh\n\nfor build in \"${BUILDS[@]}\"; do\n  case \"$build\" in\n    floating)\n      extra_args=\"\"\n      ;;\n    floating_qext)\n      extra_args=\" --enable-qext\"\n      CXXFLAGS+=\" -DENABLE_QEXT\"\n      ;;\n    fixed)\n      extra_args=\" --enable-fixed-point --enable-check-asm\"\n      ;;\n    fixed_qext)\n      extra_args=\" --enable-fixed-point --enable-check-asm --enable-fixed-res24 --enable-qext\"\n      CXXFLAGS+=\" -DENABLE_QEXT\"\n      ;;\n  esac\n\n  ./configure $extra_args --enable-static --disable-shared --disable-doc \\\n    --enable-assertions\n  make -j$(nproc)\n\n  # Build all fuzzers\n  for fuzzer in $FUZZERS; do\n    $CXX $CXXFLAGS -c -Iinclude \\\n      tests/$fuzzer.cc \\\n      -o $fuzzer.o\n\n    $CXX $CXXFLAGS \\\n      $fuzzer.o \\\n      -o $OUT/${fuzzer}_${build} \\\n      $LIB_FUZZING_ENGINE .libs/libopus.a\n\n    # Setup the .options and test corpus zip files using the corresponding\n    # fuzzer's name\n    [ -f tests/$fuzzer.options ] \\\n        && cp tests/$fuzzer.options $OUT/${fuzzer}_${build}.options\n    cp $SRC/zipped-corpus.zip $OUT/${fuzzer}_${build}_seed_corpus.zip &\n  done\ndone\n\nwait\n"
  },
  {
    "path": "projects/opus/opus_encode_fuzzer.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"opus.h\"\n#include \"opus_types.h\"\n#include \"opus_defines.h\"\n\n#include \"opus_ossfuzz_utils.h\"\n\n#define MAX_PACKET (1500)\n#if defined(ENABLE_QEXT)\n#define SAMPLES (96000 * 10)\n#else\n#define SAMPLES (48000 * 10)\n#endif\n#define MAX_FRAME_SAMP (5760)\n\nstatic const int sampling_rates[] = {8000, 12000, 16000, 24000, 48000\n                                     ARG_QEXT(96000)};\nstatic const int channels[] = {1, 2};\nstatic const int applications[] = {OPUS_APPLICATION_AUDIO,\n                                   OPUS_APPLICATION_VOIP,\n                                   OPUS_APPLICATION_RESTRICTED_LOWDELAY};\nstatic const int frame_sizes_ms_x2[] = {5, 10, 20, 40, 80, 120, 160, 200, 240};\n\nstatic opus_int16 inbuf[sizeof(opus_int16) * SAMPLES] = {0};\nstatic unsigned char packet[MAX_PACKET + 257];\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  int err = OPUS_OK;\n  int num_channels = fdp.PickValueInArray(channels);\n  int frame_size = fdp.PickValueInArray(frame_sizes_ms_x2);\n  int sampling_rate = fdp.PickValueInArray(sampling_rates);\n  int application = fdp.PickValueInArray(applications);\n\n\n  OpusEncoder *enc =\n      opus_encoder_create(sampling_rate, num_channels, application, &err);\n  if (err != OPUS_OK || enc == NULL) {\n    opus_encoder_destroy(enc);\n    return 0;\n  }\n\n  opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(fdp.ConsumeIntegralInRange(0, 10)));\n  opus_encoder_ctl(enc, OPUS_SET_VBR(fdp.ConsumeBool()));\n  opus_encoder_ctl(enc, OPUS_SET_VBR_CONSTRAINT(fdp.ConsumeBool()));\n  opus_encoder_ctl(\n      enc, OPUS_SET_FORCE_CHANNELS(fdp.PickValueInArray({OPUS_AUTO, 1, 2})));\n  opus_encoder_ctl(enc,\n                   OPUS_SET_MAX_BANDWIDTH(fdp.PickValueInArray(\n                       {OPUS_BANDWIDTH_NARROWBAND, OPUS_BANDWIDTH_MEDIUMBAND,\n                        OPUS_BANDWIDTH_WIDEBAND, OPUS_BANDWIDTH_SUPERWIDEBAND,\n                        OPUS_BANDWIDTH_FULLBAND})));\n  opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(fdp.ConsumeBool()));\n  opus_encoder_ctl(\n      enc, OPUS_SET_PACKET_LOSS_PERC(fdp.ConsumeIntegralInRange(0, 100)));\n  opus_encoder_ctl(enc, OPUS_SET_DTX(fdp.ConsumeBool()));\n  opus_encoder_ctl(enc, OPUS_SET_LSB_DEPTH(fdp.ConsumeIntegralInRange(8, 24)));\n  opus_encoder_ctl(enc, OPUS_SET_PREDICTION_DISABLED((fdp.ConsumeBool())));\n  opus_encoder_ctl(enc,\n                   OPUS_SET_SIGNAL(fdp.PickValueInArray(\n                       {OPUS_AUTO, OPUS_SIGNAL_VOICE, OPUS_SIGNAL_MUSIC})));\n  opus_encoder_ctl(enc,\n                   OPUS_SET_PHASE_INVERSION_DISABLED(((fdp.ConsumeBool()))));\n#ifdef ENABLE_QEXT\n  opus_encoder_ctl(enc, OPUS_SET_QEXT(fdp.PickValueInArray({0, 1})));\n#endif\n\n  fdp.ConsumeData(inbuf, sizeof(inbuf));\n\n  size_t samp_count = 0;\n  do {\n    const int frame_size_samples = frame_size * sampling_rate / 2000;\n\n    const int len = opus_encode(enc, &inbuf[samp_count * num_channels],\n                                frame_size_samples, packet, MAX_PACKET);\n    if (len < 0 || len > MAX_PACKET) {\n      break;\n    }\n    samp_count += frame_size;\n  } while (samp_count < ((SAMPLES / 2) - MAX_FRAME_SAMP));\n\n  opus_encoder_destroy(enc);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/opus/opus_multistream_decode_fuzzer.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <stddef.h>\n\n#include <algorithm>\n#include <memory>\n#include <random>\n\n#include \"../celt/mathops.h\"\n#include \"../celt/os_support.h\"\n#include \"opus.h\"\n#include \"opus_defines.h\"\n#include \"opus_multistream.h\"\n#include \"opus_projection.h\"\n#include \"opus_types.h\"\n\n#include \"opus_ossfuzz_utils.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const int frame_size_ms_x2 =\n      fdp.PickValueInArray({5, 10, 20, 40, 80, 120, 160, 200, 240});\n  const opus_int32 frequency = fdp.PickValueInArray({8, 12, 16, 24, 48\n                                                     ARG_QEXT(96)}) * 1000;\n  const int frame_size = frame_size_ms_x2 * frequency / 2000;\n  const opus_int32 nb_channels = fdp.ConsumeIntegralInRange(0, 255);\n  const int streams = fdp.ConsumeIntegralInRange(0, 255);\n  const int coupled_streams = fdp.ConsumeIntegralInRange(0, 255);\n  const bool use_fec = fdp.ConsumeBool();\n  const bool use_float = fdp.ConsumeBool();\n\n  unsigned char *mapping = (unsigned char *)malloc(nb_channels);\n  if (!mapping) {\n    return 0;\n  }\n  for (unsigned char x = 0; x < nb_channels; ++x) {\n    mapping[x] = fdp.ConsumeIntegralInRange(0, 255);\n  }\n\n  int err = OPUS_OK;\n  OpusMSDecoder *const decoder = opus_multistream_decoder_create(\n      frequency, nb_channels, streams, coupled_streams, mapping, &err);\n  free(mapping);\n\n  if (decoder == nullptr || err != OPUS_OK) {\n    return 0;\n  }\n  auto payload = fdp.ConsumeRemainingBytes<unsigned char>();\n  const opus_int16 payload_size =\n      std::min((const unsigned long)SHRT_MAX, payload.size());\n\n  if (use_float) {\n    float *pcm = (float *)opus_alloc(sizeof(float) * frame_size * nb_channels);\n    if (pcm == NULL) {\n      goto end;\n    }\n    const int foo = opus_multistream_decode_float(\n        decoder, payload.data(), payload_size, pcm, frame_size, use_fec);\n    (void)foo;\n\n    opus_free(pcm);\n  } else {\n    opus_int16 *pcm =\n        (opus_int16 *)opus_alloc(sizeof(opus_int16) * frame_size * nb_channels);\n    if (pcm == NULL) {\n      goto end;\n    }\n    const int foo = opus_multistream_decode(\n        decoder, payload.data(), payload_size, pcm, frame_size, use_fec);\n    (void)foo;\n\n    opus_free(pcm);\n  }\nend:\n  opus_multistream_decoder_destroy(decoder);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/opus/opus_multistream_encode_fuzzer.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <math.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"opus.h\"\n#include \"opus_defines.h\"\n#include \"opus_multistream.h\"\n#include \"opus_types.h\"\n#include \"../celt/os_support.h\"\n\n#include \"opus_ossfuzz_utils.h\"\n\n#define MAX_PACKET (1500)\nstatic unsigned char out[MAX_PACKET];\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  opus_int32 nb_channels = fdp.ConsumeIntegralInRange(0, 255);\n  const opus_int32 frequency = fdp.PickValueInArray({8, 12, 16, 24, 48\n                                                     ARG_QEXT(96)}) * 1000;\n  int streams = fdp.ConsumeIntegralInRange(0, 255);\n  int coupled_streams = fdp.ConsumeIntegralInRange(0, 255);\n  int frame_size_ms_x2 =\n      fdp.PickValueInArray({5, 10, 20, 40, 80, 120, 160, 200, 240});\n  int frame_size = frame_size_ms_x2 * frequency / 2000;\n  int application =\n      fdp.PickValueInArray({OPUS_APPLICATION_AUDIO, OPUS_APPLICATION_VOIP,\n                            OPUS_APPLICATION_RESTRICTED_LOWDELAY});\n\n  unsigned char *mapping = (unsigned char *)malloc(nb_channels);\n  if (!mapping) {\n    return 0;\n  }\n  for (unsigned char x = 0; x < nb_channels; ++x) {\n    mapping[x] = fdp.ConsumeIntegralInRange(0, 255);\n  }\n\n  int err = OPUS_OK;\n  OpusMSEncoder *enc = NULL;\n  if (fdp.ConsumeBool()) {\n    int mapping_family = fdp.PickValueInArray({0, 1, 2, 3, 255});\n    enc = opus_multistream_surround_encoder_create(\n        frequency, nb_channels, mapping_family, &streams, &coupled_streams,\n        mapping, application, &err);\n  } else {\n    enc = opus_multistream_encoder_create(frequency, nb_channels, streams,\n                                          coupled_streams, mapping, application,\n                                          &err);\n  }\n  free(mapping);\n  if (err != OPUS_OK || enc == NULL) {\n    opus_multistream_encoder_destroy(enc);\n    return 0;\n  }\n\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_COMPLEXITY(fdp.ConsumeIntegralInRange(0, 10)));\n  opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(fdp.ConsumeBool()));\n  opus_multistream_encoder_ctl(enc, OPUS_SET_VBR_CONSTRAINT(fdp.ConsumeBool()));\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_FORCE_CHANNELS(fdp.PickValueInArray({OPUS_AUTO, 1, 2})));\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_MAX_BANDWIDTH(fdp.PickValueInArray(\n               {OPUS_BANDWIDTH_NARROWBAND, OPUS_BANDWIDTH_MEDIUMBAND,\n                OPUS_BANDWIDTH_WIDEBAND, OPUS_BANDWIDTH_SUPERWIDEBAND,\n                OPUS_BANDWIDTH_FULLBAND})));\n  opus_multistream_encoder_ctl(enc, OPUS_SET_INBAND_FEC(fdp.ConsumeBool()));\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_PACKET_LOSS_PERC(fdp.ConsumeIntegralInRange(0, 100)));\n  opus_multistream_encoder_ctl(enc, OPUS_SET_DTX(fdp.ConsumeBool()));\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_LSB_DEPTH(fdp.ConsumeIntegralInRange(8, 24)));\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_PREDICTION_DISABLED((fdp.ConsumeBool())));\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_SIGNAL(fdp.PickValueInArray(\n               {OPUS_AUTO, OPUS_SIGNAL_VOICE, OPUS_SIGNAL_MUSIC})));\n  opus_multistream_encoder_ctl(\n      enc, OPUS_SET_PHASE_INVERSION_DISABLED(((fdp.ConsumeBool()))));\n\n  const int pcm_size = sizeof(opus_int16) * frame_size * nb_channels;\n  opus_int16 *pcm = (opus_int16 *)opus_alloc(pcm_size);\n  if (pcm == NULL) {\n    opus_multistream_encoder_destroy(enc);\n    return 0;\n  }\n  memset(pcm, 0, pcm_size);\n\n  if (pcm_size == fdp.ConsumeData(pcm, pcm_size)) {\n    const int len =\n        opus_multistream_encode(enc, pcm, frame_size, out, MAX_PACKET);\n    (void)len;\n  }\n\n  opus_free(pcm);\n  opus_multistream_encoder_destroy(enc);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/opus/opus_ossfuzz_utils.h",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef OPUS_UTILS_H\n#define OPUS_UTILS_H\n\n#if defined(ENABLE_QEXT)\n#define ARG_QEXT(arg) , arg\n#else\n#define ARG_QEXT(arg)\n#endif\n\n#endif  // OPUS_UTILS_H"
  },
  {
    "path": "projects/opus/opus_projection_decoder_fuzzer.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <limits.h>\n#include <stddef.h>\n\n#include <array>\n#include <cmath>\n#include <memory>\n\n#include \"../celt/mathops.h\"\n#include \"../celt/os_support.h\"\n#include \"opus.h\"\n#include \"opus_defines.h\"\n#include \"opus_projection.h\"\n#include \"opus_types.h\"\n\n#include \"opus_ossfuzz_utils.h\"\n\n// Having a huge-size vastly reduces the fuzzer's speed\n#define MAX_MATRIX_SIZE 4096\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  const int frame_size_ms_x2 =\n      fdp.PickValueInArray({5, 10, 20, 40, 80, 120, 160, 200, 240});\n  const opus_int32 frequency = fdp.PickValueInArray({8, 12, 16, 24, 48\n                                                     ARG_QEXT(96)}) * 1000;\n  const int frame_size = frame_size_ms_x2 * frequency / 2000;\n\n  // The allowed number of channels is either n^2 or n^2 + 2\n  opus_int32 nb_channels = pow(fdp.ConsumeIntegralInRange(0, 15), 2);\n  if (fdp.ConsumeBool()) {\n    nb_channels += 2;\n  }\n  const int streams = fdp.ConsumeIntegralInRange(0, 255);\n  const int coupled_streams = fdp.ConsumeIntegralInRange(0, streams);\n\n  const opus_int32 matrix_size = fdp.ConsumeIntegralInRange(1, MAX_MATRIX_SIZE);\n  unsigned char *matrix = (unsigned char *)opus_alloc(matrix_size);\n  if (matrix == NULL) {\n    return 0;\n  }\n\n  fdp.ConsumeData(matrix, matrix_size);\n\n  int err = OPUS_OK;\n  OpusProjectionDecoder *const decoder = opus_projection_decoder_create(\n      frequency, nb_channels, streams, coupled_streams, matrix, matrix_size,\n      &err);\n  opus_free(matrix);\n  if (decoder == nullptr || err != OPUS_OK) {\n    return 0;\n  }\n  bool use_float = fdp.ConsumeBool();\n  bool use_fec = fdp.ConsumeBool();\n  auto payload = fdp.ConsumeRemainingBytes<unsigned char>();\n  const opus_int16 payload_size =\n      std::min((unsigned long)SHRT_MAX, payload.size());\n\n  if (use_float) {\n    float *pcm =\n        (float *)opus_alloc(sizeof(float) * frame_size * nb_channels);\n    if (pcm == NULL) {\n      goto end;\n    }\n\n    const int foo = opus_projection_decode_float(\n        decoder, payload.data(), payload_size, pcm, frame_size, use_fec);\n    (void)foo;\n    opus_free(pcm);\n  } else {\n    opus_int16 *pcm =\n        (opus_int16 *)opus_alloc(sizeof(opus_int16) * frame_size * nb_channels);\n    if (pcm == NULL) {\n      goto end;\n    }\n\n    const int foo = opus_projection_decode(\n        decoder, payload.data(), payload_size, pcm, frame_size, use_fec);\n    (void)foo;\n    opus_free(pcm);\n  }\nend:\n  opus_projection_decoder_destroy(decoder);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/opus/opus_projection_encoder_fuzzer.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <math.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"opus.h\"\n#include \"opus_defines.h\"\n#include \"opus_projection.h\"\n#include \"opus_types.h\"\n#include \"../celt/os_support.h\"\n\n#include \"opus_ossfuzz_utils.h\"\n\n#define MAX_PACKET (1500)\nstatic unsigned char out[MAX_PACKET];\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  opus_int32 nb_channels = fdp.ConsumeIntegralInRange(0, 255);\n  const opus_int32 frequency = fdp.PickValueInArray({8, 12, 16, 24, 48\n                                                     ARG_QEXT(96)}) * 1000;\n  int streams = fdp.ConsumeIntegralInRange(0, 255);\n  int coupled_streams = fdp.ConsumeIntegralInRange(0, 255);\n  int frame_size_ms_x2 =\n      fdp.PickValueInArray({5, 10, 20, 40, 80, 120, 160, 200, 240});\n  int frame_size = frame_size_ms_x2 * frequency / 2000;\n  int application =\n      fdp.PickValueInArray({OPUS_APPLICATION_AUDIO, OPUS_APPLICATION_VOIP,\n                            OPUS_APPLICATION_RESTRICTED_LOWDELAY});\n\n\n  int err = OPUS_OK;\n    int mapping_family = fdp.PickValueInArray({0, 1, 2, 3, 255});\n  OpusProjectionEncoder *enc = opus_projection_ambisonics_encoder_create(\n        frequency, nb_channels, mapping_family, &streams, &coupled_streams,\n        application, &err);\n\n  if (err != OPUS_OK || enc == NULL) {\n    opus_projection_encoder_destroy(enc);\n    return 0;\n  }\n\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_COMPLEXITY(fdp.ConsumeIntegralInRange(0, 10)));\n  opus_projection_encoder_ctl(enc, OPUS_SET_VBR(fdp.ConsumeBool()));\n  opus_projection_encoder_ctl(enc, OPUS_SET_VBR_CONSTRAINT(fdp.ConsumeBool()));\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_FORCE_CHANNELS(fdp.PickValueInArray({OPUS_AUTO, 1, 2})));\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_MAX_BANDWIDTH(fdp.PickValueInArray(\n               {OPUS_BANDWIDTH_NARROWBAND, OPUS_BANDWIDTH_MEDIUMBAND,\n                OPUS_BANDWIDTH_WIDEBAND, OPUS_BANDWIDTH_SUPERWIDEBAND,\n                OPUS_BANDWIDTH_FULLBAND})));\n  opus_projection_encoder_ctl(enc, OPUS_SET_INBAND_FEC(fdp.ConsumeBool()));\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_PACKET_LOSS_PERC(fdp.ConsumeIntegralInRange(0, 100)));\n  opus_projection_encoder_ctl(enc, OPUS_SET_DTX(fdp.ConsumeBool()));\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_LSB_DEPTH(fdp.ConsumeIntegralInRange(8, 24)));\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_PREDICTION_DISABLED((fdp.ConsumeBool())));\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_SIGNAL(fdp.PickValueInArray(\n               {OPUS_AUTO, OPUS_SIGNAL_VOICE, OPUS_SIGNAL_MUSIC})));\n  opus_projection_encoder_ctl(\n      enc, OPUS_SET_PHASE_INVERSION_DISABLED(((fdp.ConsumeBool()))));\n\n  const int pcm_size = sizeof(opus_int16) * frame_size * nb_channels;\n  opus_int16 *pcm = (opus_int16 *)opus_alloc(pcm_size);\n  if (pcm == NULL) {\n    opus_projection_encoder_destroy(enc);\n    return 0;\n  }\n  memset(pcm, 0, pcm_size);\n\n  if (pcm_size == fdp.ConsumeData(pcm, pcm_size)) {\n    const int len =\n        opus_projection_encode(enc, pcm, frame_size, out, MAX_PACKET);\n    (void)len;\n  }\n\n  opus_free(pcm);\n  opus_projection_encoder_destroy(enc);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/opus/opus_repacketizer_fuzzer.cc",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"opus.h\"\n#include \"opus_types.h\"\n\n#define MAX_PACKETOUT 32000\n\nstatic opus_uint32 char_to_int(const unsigned char ch[4]) {\n  return ((opus_uint32)ch[0] << 24) | ((opus_uint32)ch[1] << 16) |\n         ((opus_uint32)ch[2] << 8) | (opus_uint32)ch[3];\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  unsigned char output_packet[MAX_PACKETOUT];\n  OpusRepacketizer *rp = opus_repacketizer_create();\n  opus_repacketizer_init(rp);\n  const size_t nb_packets_to_add = fdp.ConsumeIntegralInRange(1, 48);\n  const auto packets = fdp.ConsumeRemainingBytes<unsigned char>();\n\n  size_t start = 0;\n  for (size_t i = 0; i < nb_packets_to_add; i++) {\n    if (packets.size() - start < 4) {\n      break;\n    }\n    const size_t packet_length = char_to_int(packets.data() + start);\n    start += 4;\n\n    if (packets.size() - start < packet_length || packet_length > 1500) {\n      break;\n    }\n\n    opus_repacketizer_cat(rp, packets.data() + start, packet_length);\n    start += packet_length;\n  }\n  int foo = opus_repacketizer_out(rp, output_packet, MAX_PACKETOUT);\n  (void)foo;\n\n  opus_repacketizer_destroy(rp);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/opus/project.yaml",
    "content": "homepage: \"https://opus-codec.org/\"\nlanguage: c++\nprimary_contact: \"jmvalin@jmvalin.ca\"\nauto_ccs:\n  - \"flim@google.com\"\n  - \"jeanmarcv@google.com\"\n  - \"yunho@google.com\"\n  - \"le.businessman@gmail.com\"\nvendor_ccs:\n  - \"media-alerts@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://gitlab.xiph.org/xiph/opus.git'\n"
  },
  {
    "path": "projects/opus/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n make check -j$(nproc)\n"
  },
  {
    "path": "projects/opusfile/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake git libogg0 libogg-dev libopus0 libopus-dev libssl-dev libtool make pkg-config\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/opusfile\nWORKDIR opusfile\nCOPY build.sh *.c $SRC/\n"
  },
  {
    "path": "projects/opusfile/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\n./configure --enable-static --disable-shared --disable-doc --enable-assertions\nmake -j$(nproc)\nldconfig\n\nfor fuzzer in $SRC/*_fuzzer.c; do\n  fuzzer_basename=$(basename -s .c $fuzzer)\n\n  $CC $CFLAGS -c \\\n      -I $SRC -I /usr/include/opus -I /usr/include/ogg \\\n      $fuzzer -o ${fuzzer_basename}.o\n\n  $CXX $CXXFLAGS \\\n      ${fuzzer_basename}.o \\\n      -o $OUT/${fuzzer_basename} $LIB_FUZZING_ENGINE \\\n      $SRC/opusfile/.libs/libopusfile.a -l:libopus.a -l:libogg.a\ndone\n"
  },
  {
    "path": "projects/opusfile/opusfile_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <errno.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"opusfile/config.h\"\n#include \"opusfile/include/opusfile.h\"\n\n// Opusfile fuzzing wrapper to help with automated fuzz testing. It's based on\n// https://github.com/xiph/opusfile/blob/master/examples/opusfile_example.c\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  int ret, tmp;\n  OggOpusFile *of = op_open_memory(data, size, &ret);\n  if (!of)\n    return 0;\n\n  op_link_count(of);\n\n  int link_index = -1;\n  op_pcm_total(of, link_index);\n  op_raw_total(of, link_index);\n  op_pcm_tell(of);\n  op_raw_tell(of);\n\n  ogg_int64_t total_sample_count = 0;\n  const int pcm_size = 120 * 48 * 2; // 120ms/ch@48kHz is recommended\n  opus_int16 pcm[pcm_size];\n  for (;;) {\n    ret = op_read_stereo(of, pcm, pcm_size);\n    if (ret < 0) {\n      break;\n    }\n\n    if (op_current_link(of) != link_index) {\n      link_index = op_current_link(of);\n      op_pcm_total(of, link_index);\n      op_raw_total(of, link_index);\n      op_pcm_tell(of);\n      op_raw_tell(of);\n      op_bitrate_instant(of);\n      tmp = op_head(of, link_index)->version;\n\n      const OpusTags *tags = op_tags(of, link_index);\n      for (int i = 0; i < tags->comments; ++i) {\n        // Note: The compare also touches memory allocated for user_comments[i].\n        // This is a desired side effect and should be kept even if this\n        // comparison is removed.\n        if (opus_tagncompare(\"METADATA_BLOCK_PICTURE\", 22,\n                             tags->user_comments[i]) == 0) {\n          OpusPictureTag pic;\n          if (opus_picture_tag_parse(&pic, tags->user_comments[i]) >= 0) {\n            opus_picture_tag_clear(&pic);\n          }\n        }\n      }\n\n      if (tags->vendor) {\n        tmp = tags->vendor[0];\n      }\n\n      int binary_suffix_len;\n      opus_tags_get_binary_suffix(tags, &binary_suffix_len);\n    }\n\n    if (ret == 0) {\n      break;\n    }\n\n    total_sample_count += ret;\n  }\n\n  if (total_sample_count > 0) {\n    // Try random-access PCM reads. The number of tests is arbitrary and the\n    // offset is designed to be pseudo-random, but deterministic - this is\n    // implemented using Lehmer RNG with a minor hack that probably breaks some\n    // properties of the RNG (but that is acceptable).\n    ogg_int64_t rng_seed = 1307832949LL;\n    for (int i = 0; i < 32; ++i) {\n      // Derive the next deterministic offset to test and iterate the RNG.\n      rng_seed = (rng_seed * 279470273LL);\n      const ogg_int64_t offset = rng_seed % total_sample_count;\n      rng_seed = rng_seed % 4294967291LL;\n\n      if (op_pcm_seek(of, offset) == 0) {\n        tmp = op_read_stereo(of, pcm, pcm_size);\n      }\n    }\n  }\n\n  op_free(of);\n  return 0;\n}\n"
  },
  {
    "path": "projects/opusfile/project.yaml",
    "content": "homepage: \"https://opus-codec.org/\"\nmain_repo: \"https://gitlab.xiph.org/xiph/opusfile.git\"\nlanguage: c\nprimary_contact: \"jmvalin@jmvalin.ca\"\nauto_ccs:\n  - \"le.businessman@gmail.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/oracle-py-cx/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN mkdir -p /opt/oracle\nRUN cd /opt/oracle && \\\n    wget https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-basic-linux.x64-21.6.0.0.0dbru.zip && \\\n    unzip instantclient-basic-linux.x64-21.6.0.0.0dbru.zip && \\\n    rm instantclient-basic-linux.x64-21.6.0.0.0dbru.zip && \\\n    echo /opt/oracle/instantclient_21_6 > /etc/ld.so.conf.d/oracle-instantclient.conf && \\\n    ldconfig\n\nENV LD_LIBRARY_PATH=/opt/oracle/instantclient_21_6\nRUN apt-get install libaio1 libaio-dev\nRUN pip3 install --upgrade pip && pip install requests\n\nRUN git clone https://github.com/oracle/python-cx_Oracle oracle-py-cx && \\\n    cd oracle-py-cx && \\\n    git submodule init && \\\n    git submodule update\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/oracle-py-cx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/oracle-py-cx\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n   compile_python_fuzzer $fuzzer --add-binary /opt/oracle/instantclient_21_6:./ --add-binary /usr/lib/x86_64-linux-gnu/:./\ndone\n"
  },
  {
    "path": "projects/oracle-py-cx/fuzz_basic.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport time\nimport socket\nimport threading\nimport cx_Oracle\n\nfuzzed_input = b\"\"\n\n\ndef SetFuzzedInput(input_bytes):\n    global fuzzed_input\n    fuzzed_input = input_bytes\n\n\nclass ServerThread(threading.Thread):\n    def __init__(self, port):\n        self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n        self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n        self.s.bind((\"127.0.0.1\", port))\n        self.s.settimeout(0.4)\n        self.s.listen(1)\n\n        threading.Thread.__init__(self)\n\n    def run(self):\n        global fuzzed_input\n        try:\n            conn, addr = self.s.accept()\n        except socket.timeout:\n            return\n        conn.recv(1024)\n        conn.send(fuzzed_input)\n        time.sleep(0.005)\n        conn.close()\n        self.s.shutdown(1)\n        self.s.close()\n        time.sleep(0.01)\n\n\n@atheris.instrument_func\ndef TestInput(data):\n    port = None\n    for i in range(8009, 8100):\n        try:\n            t1 = ServerThread(i)\n        except OSError:\n            # If the address is already in use by another\n            continue\n        port = i\n        break\n\n    if port == None:\n        return\n\n    t1.start()\n\n    fdp = atheris.FuzzedDataProvider(data)\n    args = dict()\n    args['user'] = fdp.ConsumeUnicodeNoSurrogates(64)\n    args['password'] = fdp.ConsumeUnicodeNoSurrogates(64)\n    args['dsn'] = f\"127.0.0.1:{port}\"\n    if fdp.ConsumeBool():\n        args['newpassword'] = fdp.ConsumeUnicodeNoSurrogates(64)\n    if fdp.ConsumeBool():\n        args['nencoding'] = fdp.ConsumeUnicodeNoSurrogates(64)\n\n    SetFuzzedInput(fdp.ConsumeBytes(400))\n    try:\n        connection = cx_Oracle.connect(**args)\n    except cx_Oracle.DatabaseError:\n        connection = None\n        pass\n\n    if connection is None:\n        t1.join()\n        return\n\n    cursor = connection.cursor()\n    cursor.execute(fdp.ConsumeUnicodeNoSurrogates(1024))\n    t1.join()\n\n\ndef main(): \n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/oracle-py-cx/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/oracle/python-cx_Oracle\nlanguage: python\nmain_repo: https://github.com/oracle/python-cx_Oracle\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/orjson/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\nRUN python3 -m pip install --upgrade pip\n\nRUN rm -rf /usr/local/bin/cargo\n\nARG rust_version=nightly\nRUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${rust_version} --profile minimal -y\n\nENV PATH=\"/root/.cargo/bin:${PATH}\"\n\nRUN git clone --depth 1 https://github.com/ijl/orjson orjson\n\nWORKDIR orjson\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/orjson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport RUSTFLAGS=\"\"\npython3 -m pip install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py');do\n    compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/orjson/fuzz_orjson.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nimport orjson\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    original = fdp.ConsumeUnicode(sys.maxsize)\n\n    try:\n        orjson_data = orjson.loads(original)\n    except ValueError:\n        return\n\n    try:\n        encoded = orjson.dumps(orjson_data)\n        del encoded\n    except TypeError:\n        return\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/orjson/project.yaml",
    "content": "homepage: \"https://github.com/ijl/orjson\"\nlanguage: python\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: \"https://github.com/ijl/orjson\"\nvendor_ccs:\n - maxnair.dev@gmail.com\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/oscrypto/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth=1 https://github.com/wbond/oscrypto oscrypto\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/oscrypto\n"
  },
  {
    "path": "projects/oscrypto/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/oscrypto/fuzz_asymmetric_load.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom oscrypto import asymmetric, errors, backend\n\n\ndef TestOneInput(data):\n  randfile = \"/tmp/random.cert\"\n  with open(randfile, \"wb\") as f:\n    f.write(data)\n\n  if not os.path.isfile(randfile):\n    return\n\n  try:\n    asymmetric.load_certificate(randfile)\n  except ValueError:\n    pass\n  except OSError:\n    pass\n\n  try:\n    asymmetric.load_private_key(randfile)\n  except ValueError:\n    pass\n  except OSError:\n    pass\n  \n  try:\n    asymmetric.load_public_key(randfile)\n  except ValueError:\n    pass\n  except OSError:\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/oscrypto/fuzz_keys.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom oscrypto import keys\n\n\ndef TestOneInput(data):\n  try:\n    keys.parse_pkcs12(data, b'123')\n  except ValueError:\n    pass\n  except OSError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/oscrypto/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/wbond/oscrypto\nlanguage: python\nmain_repo: https://github.com/wbond/oscrypto\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/osgi/CoreFilterFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.osgi.framework.Filter;\nimport org.osgi.framework.FrameworkUtil;\nimport org.osgi.framework.InvalidSyntaxException;\n\nimport java.util.Dictionary;\nimport java.util.Hashtable;\n\npublic class CoreFilterFuzzer {\n\n\tDictionary<String, String> m_dictionary;\n\tString m_filter;\n\n\tCoreFilterFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tm_filter = fuzzedDataProvider.consumeString(10);\n\t\tm_dictionary = new Hashtable<String, String>();\n\n\t\t/*\n\t\t * build datasets\n\t\t */\n\t\twhile(fuzzedDataProvider.remainingBytes() > 0) {\n\t\t\tint blocksize = fuzzedDataProvider.consumeInt(1,10);\n\t\t\tString key = fuzzedDataProvider.consumeString(blocksize);\n\t\t\tm_dictionary.put(key, key);\n\t\t}\n\t}\n\n\tvoid test() {\n\t\tFilter filter;\n\t\ttry {\n\t\t\tfilter = FrameworkUtil.createFilter(m_filter);\n\t\t} catch(InvalidSyntaxException ex) {\n\t\t\t/* ignore */\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tfilter.match(m_dictionary);\n\t\t} catch(IllegalArgumentException ex) {\n\t\t\t/* ignore */\n\t\t}\n\n\t\tfilter.toString();\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tCoreFilterFuzzer testClosure = new CoreFilterFuzzer(fuzzedDataProvider);\n\t\ttestClosure.test();\n\t}\n}"
  },
  {
    "path": "projects/osgi/CoreVersionFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.osgi.framework.Version;\n\npublic class CoreVersionFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\tVersion v = null;\n\t\ttry {\n\t\t\tv = new Version(fuzzedDataProvider.consumeRemainingAsString());\n\t\t} catch(IllegalArgumentException ex) {\n\t\t\t/* documented, ignore */\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * these don't throw exceptions\n\t\t */\n\t\tv.getMajor();\n\t\tv.getMinor();\n\t\tv.getMicro();\n\t\tv.getQualifier();\n\t\tv.toString();\n\t}\n}"
  },
  {
    "path": "projects/osgi/CoreVersionRangeFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.osgi.framework.Version;\nimport org.osgi.framework.VersionRange;\n\npublic class CoreVersionRangeFuzzer {\n\n    int    m_major, m_minor, m_micro;\n\tString m_range1, m_range2;\n\tString m_filter;\n\n\tCoreVersionRangeFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tm_major = fuzzedDataProvider.consumeInt(0, Integer.MAX_VALUE);\n\t\tm_minor = fuzzedDataProvider.consumeInt(0, Integer.MAX_VALUE);\n\t\tm_micro = fuzzedDataProvider.consumeInt(0, Integer.MAX_VALUE);\n\t\t\n\t\tm_filter = fuzzedDataProvider.consumeString(5);\n\t\tm_range1 = fuzzedDataProvider.consumeString(fuzzedDataProvider.remainingBytes() / 2);\n\t\tm_range2 = fuzzedDataProvider.consumeRemainingAsString();\n\t}\n\n\tvoid test() {\n\t\tVersionRange r1 = null, r2 = null;\n\t\tVersion v;\n\t\ttry {\n\t\t\tv  = new Version(m_major, m_minor, m_micro);\n\t\t\tr1 = VersionRange.valueOf(m_range1);\n\t\t\tr2 = VersionRange.valueOf(m_range2);\n\t\t} catch(IllegalArgumentException ex) {\n\t\t\t/* documented, ignore */\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tr1.toFilterString(m_filter);\n\t\t} catch(IllegalArgumentException ex) {\n\t\t\t/* documented, ignore */\n\t\t}\n\t\t\n\t\t/*\n\t\t * these don't throw exceptions\n\t\t */\n\t\tr1.getLeft();\n\t\tr1.getRight();\n\t\tr1.includes(v);\n\t\tr1.intersection(r2);\n\t\tr1.isEmpty();\n\t\tr1.isExact();\n\t\tr1.toString();\n\t\tr1.hashCode();\n\t\tr1.equals(r2);\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\tCoreVersionRangeFuzzer testClosure = new CoreVersionRangeFuzzer(fuzzedDataProvider);\n\t\ttestClosure.test();\n\t}\n}"
  },
  {
    "path": "projects/osgi/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/osgi/osgi.git\n\nCOPY build.sh ${SRC}/\nCOPY *.java ${SRC}/\nWORKDIR ${SRC}/osgi"
  },
  {
    "path": "projects/osgi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nALL_JARS=\"\"\n\npushd \"${SRC}/osgi\"\n\t# use bundled gradlew deployer\n\t./gradlew -Dorg.gradle.java.home=\"$(dirname $(dirname $(which javac)))\"\n\n\tfind -name '*.jar' -exec cp {} ${OUT} \\;\n\tALL_JARS=\"${ALL_JARS} $(find . -name '*.jar' -exec basename {} \\;)\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\n# compile all java files and copy them to $OUT\njavac -cp $SRC:$BUILD_CLASSPATH -g $SRC/*.java\ncp $SRC/*.class $OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/osgi/project.yaml",
    "content": "homepage: \"https://docs.osgi.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/osgi/osgi\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/osquery/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:d34b94e3cf868e49d2928c76ddba41fd4154907a1a381b3a263fafffb7c3dce0\nRUN apt-get update && apt-get install -y --no-install-recommends python python3 bison flex make wget xz-utils libunwind-dev lsb-release build-essential libssl-dev\n\n# osquery now needs at least version 3.21.4.\nENV cmakeVer 3.21.4\nRUN wget https://github.com/Kitware/CMake/releases/download/v${cmakeVer}/cmake-${cmakeVer}-Linux-x86_64.tar.gz \\\n\t&& tar xvf cmake-${cmakeVer}-Linux-x86_64.tar.gz -C /usr/local --strip 1 \\\n\t&& rm cmake-${cmakeVer}-Linux-x86_64.tar.gz\n\nRUN git clone --depth 1 https://github.com/osquery/osquery osquery\n\nWORKDIR osquery\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/osquery/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=osquery\n\n# Ensure xlocale.h is found.\nln -s /usr/include/locale.h /usr/include/xlocale.h\n\n# Move the project content into the current overlay.\n# CMake builtin 'rename' will attempt a hardlink.\n( cd / &&\\\n  mv \"${SRC}/${PROJECT}\" \"${SRC}/${PROJECT}-dev\" &&\\\n  mv \"${SRC}/${PROJECT}-dev\" \"${SRC}/${PROJECT}\" )\n\npushd \"${SRC}/${PROJECT}\"\n\nmkdir build && pushd build\n\ncmake \\\n  -DOSQUERY_VERSION:string=0.0.0-fuzz \\\n  -DOSQUERY_ENABLE_ADDRESS_SANITIZER:BOOL=ON \\\n  -DOSQUERY_BUILD_FUZZERS:BOOL=ON \\\n  -DOSQUERY_BUILD_AWS:BOOL=OFF \\\n  -DOSQUERY_BUILD_EXPERIMENTS:BOOL=OFF \\\n  ..\n\ncmake \\\n  \"-DCMAKE_EXE_LINKER_FLAGS=${LIB_FUZZING_ENGINE} -Wl,-rpath,'\\$ORIGIN/lib'\" \\\n  ..\n\n# Fix circular definitions\n# See: https://github.com/osquery/osquery/issues/6551\nsed -i 's/AUDIT_FILTER_EXCLUDE/AUDIT_FILTER_EXCLUDE1/g' /src/osquery/libraries/cmake/source/libaudit/src/lib/libaudit.h\n\n# Build harnesses\ncmake --build . -j$(nproc) --target osqueryfuzz-config\ncmake --build . -j$(nproc) --target osqueryfuzz-sqlquery\n\n# Cleanup\nfind . -type f -name '*.o' -delete\nrm -rf \"${SRC}/${PROJECT}/libraries/cmake/source/libudev/src/test\"\nrm -rf libs/src/patched-source/libudev/src/test\n\n# Move libunwind to output path\nmkdir -p \"${OUT}/lib\"\ncp /usr/lib/x86_64-linux-gnu/libunwind.so.8 \"${OUT}/lib\"\n\n# Move harnesses to output path\ncp osquery/main/harnesses/osqueryfuzz-config \"${OUT}/osqueryfuzz-config\"\ncp osquery/main/harnesses/osqueryfuzz-sqlquery \"${OUT}/osqueryfuzz-sqlquery\"\n\n# Build supporting files\npopd\ntools/harnesses/osqueryfuzz_config_corpus.sh \"${OUT}/osqueryfuzz-config_seed_corpus.zip\"\ntools/harnesses/osqueryfuzz_config_dict.sh \"${OUT}/osqueryfuzz-config.dict\"\ntools/harnesses/osqueryfuzz_sqlquery_corpus.sh \"${OUT}/osqueryfuzz-sqlquery_seed_corpus.zip\"\ncp tools/harnesses/osqueryfuzz_sqlquery.dict \"${OUT}/osqueryfuzz-sqlquery.dict\"\n"
  },
  {
    "path": "projects/osquery/project.yaml",
    "content": "homepage: \"https://osquery.io\"\nlanguage: c++\nprimary_contact: \"osquery@osquery.io\"\nauto_ccs:\n  - \"theopolis@osquery.io\"\n  - \"seph@kolide.co\"\n  - \"seph@directionless.org\"\n  - \"alessandro.gario@gmail.com\"\n  - \"sharvil@sharvilshah.com\"\n  - \"gellerbedoya@gmail.com\"\n  - \"stefano.bonicatti@gmail.com\"\nsanitizers:\n - address\nfuzzing_engines:\n - libfuzzer\n - afl\nmain_repo: 'https://github.com/osquery/osquery'\ncoverage_extra_args: -ignore-filename-regex=.*/libraries/.* -ignore-filename-regex=.*/build/libs/.* -ignore-filename-regex=.*/build/openssl/.* -ignore-filename-regex=.*/build/installed_formulas/.*\n"
  },
  {
    "path": "projects/oss-fuzz-example/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n# Install the packages needed for building the project\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\n# Clone the relevant project\nRUN git clone --depth 1 https://github.com/AdaLogics/oss-fuzz-example oss-fuzz-example\nWORKDIR oss-fuzz-example\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/oss-fuzz-example/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build project using the OSS-Fuzz enviroonment flags.\n$CC $CFLAGS -c char_lib.c -o char_lib.o\n\n# Build the fuzzers. We must ensure we link with $CXX to support Centipede.\n# Fuzzers must be placed in $OUT/\n$CC $CFLAGS -c fuzz_char_lib.c -o fuzz_char_lib.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_char_lib.o char_lib.o -o $OUT/fuzz_char_lib\n\n$CC $CFLAGS -c fuzz_complex_parser.c -o fuzz_complex_parser.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_complex_parser.o char_lib.o -o $OUT/fuzz_complex_parser\n"
  },
  {
    "path": "projects/oss-fuzz-example/project.yaml",
    "content": "homepage: \"https://github.com/AdaLogics/oss-fuzz-example\"\nlanguage: c\nprimary_contact: \"david@adalogics.com\"\nmain_repo: \"https://github.com/AdaLogics/oss-fuzz-example\"\nfile_github_issue: true\n# Add email here for any contacts that should receive emails with bugs found.\nauto_ccs:\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/ossf-scorecard/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/ossf/scorecard\nCOPY build.sh yaml_fuzzer.go probes_fuzzer.go $SRC/\nWORKDIR $SRC/scorecard\n"
  },
  {
    "path": "projects/ossf-scorecard/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n\n############################\n# Here we write the the def.yml files to a variable in each probe.\n# When the probes fuzzer runs, it writes the yaml to disk so Scorecard\n# can read it from there. This is because Scorecard embeds the .yml\n# files which is not supported when fuzzing.\nfind ./probes -type f -name 'def.yml' -exec bash -c '\n    for file do\n        dirPath=$(dirname $file)\n        packageName=$(basename $dirPath)\n        yaml_contents=$(cat $dirPath/def.yml)\n        yaml_file_contents=\"package ${packageName}\\n\\nvar YmlFile=\\`${yaml_contents//\\`/}\\`\"\n        echo -e \"${yaml_file_contents}\" >> \"${dirPath}/def.go\"\n        gofmt -w \"${dirPath}/def.go\"\n    done\n' _ {} +\n\n# Here we rewrite the path from which we read the def.yml file.\nsed -i '19i \"os\"' finding/probe.go\nsed -i 's|content, err := loc.ReadFile(\"def.yml\")|content, err := os.ReadFile(fmt.Sprintf(\"/tmp/probedefinitions/%s/def.yml\", probeID))|' finding/probe.go\ngofmt -w finding/probe.go\n\n# End of doing the workaround of the def.yml files.\n#############################\n\nmv $SRC/probes_fuzzer.go $SRC/scorecard/probes/\n#printf \"package probes \\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > ./probes/fuzz-register.go\ngo mod tidy\ncompile_native_go_fuzzer_v2 github.com/ossf/scorecard/v5/probes FuzzProbes FuzzProbes gofuzz\n\nmv $SRC/yaml_fuzzer.go $SRC/scorecard/policy/\ncompile_go_fuzzer github.com/ossf/scorecard/v5/policy FuzzParseFromYAML fuzz_parse_from_yaml gofuzz\n"
  },
  {
    "path": "projects/ossf-scorecard/probes_fuzzer.go",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage probes\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/ossf/scorecard/v5/checker\"\n\t\"github.com/ossf/scorecard/v5/clients\"\n\n\tgfh \"github.com/AdaLogics/go-fuzz-headers\"\n\n\t\"github.com/ossf/scorecard/v5/probes/archived\"\n\t\"github.com/ossf/scorecard/v5/probes/blocksDeleteOnBranches\"\n\t\"github.com/ossf/scorecard/v5/probes/blocksForcePushOnBranches\"\n\t\"github.com/ossf/scorecard/v5/probes/branchProtectionAppliesToAdmins\"\n\t\"github.com/ossf/scorecard/v5/probes/branchesAreProtected\"\n\t\"github.com/ossf/scorecard/v5/probes/codeApproved\"\n\t\"github.com/ossf/scorecard/v5/probes/codeReviewOneReviewers\"\n\t\"github.com/ossf/scorecard/v5/probes/contributorsFromOrgOrCompany\"\n\t\"github.com/ossf/scorecard/v5/probes/createdRecently\"\n\t\"github.com/ossf/scorecard/v5/probes/dependencyUpdateToolConfigured\"\n\t\"github.com/ossf/scorecard/v5/probes/dismissesStaleReviews\"\n\t\"github.com/ossf/scorecard/v5/probes/fuzzed\"\n\t\"github.com/ossf/scorecard/v5/probes/hasBinaryArtifacts\"\n\t\"github.com/ossf/scorecard/v5/probes/hasDangerousWorkflowScriptInjection\"\n\t\"github.com/ossf/scorecard/v5/probes/hasDangerousWorkflowUntrustedCheckout\"\n\t\"github.com/ossf/scorecard/v5/probes/hasFSFOrOSIApprovedLicense\"\n\t\"github.com/ossf/scorecard/v5/probes/hasLicenseFile\"\n\t\"github.com/ossf/scorecard/v5/probes/hasNoGitHubWorkflowPermissionUnknown\"\n\t\"github.com/ossf/scorecard/v5/probes/hasOSVVulnerabilities\"\n\t\"github.com/ossf/scorecard/v5/probes/hasOpenSSFBadge\"\n\t\"github.com/ossf/scorecard/v5/probes/hasPermissiveLicense\"\n\t\"github.com/ossf/scorecard/v5/probes/hasRecentCommits\"\n\t\"github.com/ossf/scorecard/v5/probes/hasReleaseSBOM\"\n\t\"github.com/ossf/scorecard/v5/probes/hasSBOM\"\n\t\"github.com/ossf/scorecard/v5/probes/hasUnverifiedBinaryArtifacts\"\n\t\"github.com/ossf/scorecard/v5/probes/issueActivityByProjectMember\"\n\t\"github.com/ossf/scorecard/v5/probes/jobLevelPermissions\"\n\t\"github.com/ossf/scorecard/v5/probes/packagedWithAutomatedWorkflow\"\n\t\"github.com/ossf/scorecard/v5/probes/pinsDependencies\"\n\t\"github.com/ossf/scorecard/v5/probes/releasesAreSigned\"\n\t\"github.com/ossf/scorecard/v5/probes/releasesHaveProvenance\"\n\t\"github.com/ossf/scorecard/v5/probes/releasesHaveVerifiedProvenance\"\n\t\"github.com/ossf/scorecard/v5/probes/requiresApproversForPullRequests\"\n\t\"github.com/ossf/scorecard/v5/probes/requiresCodeOwnersReview\"\n\t\"github.com/ossf/scorecard/v5/probes/requiresLastPushApproval\"\n\t\"github.com/ossf/scorecard/v5/probes/requiresPRsToChangeCode\"\n\t\"github.com/ossf/scorecard/v5/probes/requiresUpToDateBranches\"\n\t\"github.com/ossf/scorecard/v5/probes/runsStatusChecksBeforeMerging\"\n\t\"github.com/ossf/scorecard/v5/probes/sastToolConfigured\"\n\t\"github.com/ossf/scorecard/v5/probes/sastToolRunsOnAllCommits\"\n\t\"github.com/ossf/scorecard/v5/probes/securityPolicyContainsLinks\"\n\t\"github.com/ossf/scorecard/v5/probes/securityPolicyContainsText\"\n\t\"github.com/ossf/scorecard/v5/probes/securityPolicyContainsVulnerabilityDisclosure\"\n\t\"github.com/ossf/scorecard/v5/probes/securityPolicyPresent\"\n\t\"github.com/ossf/scorecard/v5/probes/testsRunInCI\"\n\t\"github.com/ossf/scorecard/v5/probes/topLevelPermissions\"\n\t\"github.com/ossf/scorecard/v5/probes/unsafeblock\"\n\t\"github.com/ossf/scorecard/v5/probes/webhooksUseSecrets\"\n)\n\nvar (\n\tprobeDefinitionPath = \"/tmp/probedefinitions\"\n\temptyName           = \"\"\n)\n\nfunc writeProbeFile(probeId, yamlContents string) error {\n\terr := os.MkdirAll(filepath.Join(probeDefinitionPath, probeId), 0750)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = os.WriteFile(filepath.Join(probeDefinitionPath, probeId, \"def.yml\"),\n\t\t[]byte(yamlContents),\n\t\t0660)\n\treturn err\n}\n\n// Scorecard reads from the filesystem, so we write the def.yml files to disk\nfunc init() {\n\terr := os.MkdirAll(probeDefinitionPath, 0750)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents := archived.YmlFile\n\tif err = writeProbeFile(\"archived\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = blocksDeleteOnBranches.YmlFile\n\tif err = writeProbeFile(\"blocksDeleteOnBranches\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = blocksForcePushOnBranches.YmlFile\n\tif err = writeProbeFile(\"blocksForcePushOnBranches\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = branchProtectionAppliesToAdmins.YmlFile\n\tif err = writeProbeFile(\"branchProtectionAppliesToAdmins\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = branchesAreProtected.YmlFile\n\tif err = writeProbeFile(\"branchesAreProtected\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = codeApproved.YmlFile\n\tif err = writeProbeFile(\"codeApproved\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = codeReviewOneReviewers.YmlFile\n\tif err = writeProbeFile(\"codeReviewOneReviewers\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = contributorsFromOrgOrCompany.YmlFile\n\tif err = writeProbeFile(\"contributorsFromOrgOrCompany\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = createdRecently.YmlFile\n\tif err = writeProbeFile(\"createdRecently\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = dependencyUpdateToolConfigured.YmlFile\n\tif err = writeProbeFile(\"dependencyUpdateToolConfigured\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = dismissesStaleReviews.YmlFile\n\tif err = writeProbeFile(\"dismissesStaleReviews\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = fuzzed.YmlFile\n\tif err = writeProbeFile(\"fuzzed\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasBinaryArtifacts.YmlFile\n\tif err = writeProbeFile(\"hasBinaryArtifacts\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasDangerousWorkflowScriptInjection.YmlFile\n\tif err = writeProbeFile(\"hasDangerousWorkflowScriptInjection\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasDangerousWorkflowUntrustedCheckout.YmlFile\n\tif err = writeProbeFile(\"hasDangerousWorkflowUntrustedCheckout\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasFSFOrOSIApprovedLicense.YmlFile\n\tif err = writeProbeFile(\"hasFSFOrOSIApprovedLicense\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasLicenseFile.YmlFile\n\tif err = writeProbeFile(\"hasLicenseFile\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasNoGitHubWorkflowPermissionUnknown.YmlFile\n\tif err = writeProbeFile(\"hasNoGitHubWorkflowPermissionUnknown\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasOSVVulnerabilities.YmlFile\n\tif err = writeProbeFile(\"hasOSVVulnerabilities\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasOpenSSFBadge.YmlFile\n\tif err = writeProbeFile(\"hasOpenSSFBadge\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasPermissiveLicense.YmlFile\n\tif err = writeProbeFile(\"hasPermissiveLicense\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasRecentCommits.YmlFile\n\tif err = writeProbeFile(\"hasRecentCommits\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasReleaseSBOM.YmlFile\n\tif err = writeProbeFile(\"hasReleaseSBOM\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasSBOM.YmlFile\n\tif err = writeProbeFile(\"hasSBOM\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = hasUnverifiedBinaryArtifacts.YmlFile\n\tif err = writeProbeFile(\"hasUnverifiedBinaryArtifacts\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = issueActivityByProjectMember.YmlFile\n\tif err = writeProbeFile(\"issueActivityByProjectMember\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = jobLevelPermissions.YmlFile\n\tif err = writeProbeFile(\"jobLevelPermissions\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = packagedWithAutomatedWorkflow.YmlFile\n\tif err = writeProbeFile(\"packagedWithAutomatedWorkflow\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = pinsDependencies.YmlFile\n\tif err = writeProbeFile(\"pinsDependencies\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = releasesAreSigned.YmlFile\n\tif err = writeProbeFile(\"releasesAreSigned\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = releasesHaveProvenance.YmlFile\n\tif err = writeProbeFile(\"releasesHaveProvenance\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = releasesHaveVerifiedProvenance.YmlFile\n\tif err = writeProbeFile(\"releasesHaveVerifiedProvenance\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = requiresApproversForPullRequests.YmlFile\n\tif err = writeProbeFile(\"requiresApproversForPullRequests\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = requiresCodeOwnersReview.YmlFile\n\tif err = writeProbeFile(\"requiresCodeOwnersReview\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = requiresLastPushApproval.YmlFile\n\tif err = writeProbeFile(\"requiresLastPushApproval\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = requiresPRsToChangeCode.YmlFile\n\tif err = writeProbeFile(\"requiresPRsToChangeCode\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = requiresUpToDateBranches.YmlFile\n\tif err = writeProbeFile(\"requiresUpToDateBranches\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = runsStatusChecksBeforeMerging.YmlFile\n\tif err = writeProbeFile(\"runsStatusChecksBeforeMerging\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = sastToolConfigured.YmlFile\n\tif err = writeProbeFile(\"sastToolConfigured\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = sastToolRunsOnAllCommits.YmlFile\n\tif err = writeProbeFile(\"sastToolRunsOnAllCommits\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = securityPolicyContainsLinks.YmlFile\n\tif err = writeProbeFile(\"securityPolicyContainsLinks\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = securityPolicyContainsText.YmlFile\n\tif err = writeProbeFile(\"securityPolicyContainsText\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = securityPolicyContainsVulnerabilityDisclosure.YmlFile\n\tif err = writeProbeFile(\"securityPolicyContainsVulnerabilityDisclosure\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = securityPolicyPresent.YmlFile\n\tif err = writeProbeFile(\"securityPolicyPresent\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = testsRunInCI.YmlFile\n\tif err = writeProbeFile(\"testsRunInCI\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = topLevelPermissions.YmlFile\n\tif err = writeProbeFile(\"topLevelPermissions\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = unsafeblock.YmlFile\n\tif err = writeProbeFile(\"unsafeblock\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n\tyamlContents = webhooksUseSecrets.YmlFile\n\tif err = writeProbeFile(\"webhooksUseSecrets\", yamlContents); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc FuzzProbes(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, callType int, data []byte) {\n\t\tfdp := gfh.NewConsumer(data)\n\n\t\tswitch callType % 31 {\n\t\tcase 0:\n\t\t\tfuzzers := make([]checker.Tool, 0)\n\t\t\tfdp.GenerateStruct(&fuzzers)\n\t\t\tif len(fuzzers) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tFuzzingResults: checker.FuzzingData{\n\t\t\t\t\tFuzzers: fuzzers,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, err := fuzzed.Run(r)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\tcase 1:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = blocksDeleteOnBranches.Run(r)\n\t\tcase 2:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = branchProtectionAppliesToAdmins.Run(r)\n\t\tcase 3:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = branchesAreProtected.Run(r)\n\t\tcase 4:\n\t\t\tdefaultBranchChangesets := make([]checker.Changeset, 0)\n\t\t\tfdp.GenerateStruct(&defaultBranchChangesets)\n\t\t\tif len(defaultBranchChangesets) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tCodeReviewResults: checker.CodeReviewData{\n\t\t\t\t\tDefaultBranchChangesets: defaultBranchChangesets,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = codeApproved.Run(r)\n\t\tcase 5:\n\t\t\tdefaultBranchChangesets := make([]checker.Changeset, 0)\n\t\t\tfdp.GenerateStruct(&defaultBranchChangesets)\n\t\t\tif len(defaultBranchChangesets) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tCodeReviewResults: checker.CodeReviewData{\n\t\t\t\t\tDefaultBranchChangesets: defaultBranchChangesets,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = codeReviewOneReviewers.Run(r)\n\t\tcase 6:\n\t\t\tusers := make([]clients.User, 0)\n\t\t\tfdp.GenerateStruct(&users)\n\t\t\tif len(users) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tContributorsResults: checker.ContributorsData{\n\t\t\t\t\tUsers: users,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = contributorsFromOrgOrCompany.Run(r)\n\t\tcase 7:\n\t\t\ttools := make([]checker.Tool, 0)\n\t\t\tfdp.GenerateStruct(&tools)\n\t\t\tr := &checker.RawResults{\n\t\t\t\tDependencyUpdateToolResults: checker.DependencyUpdateToolData{\n\t\t\t\t\tTools: tools,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = dependencyUpdateToolConfigured.Run(r)\n\t\tcase 8:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = dismissesStaleReviews.Run(r)\n\t\tcase 9:\n\t\t\tfiles := make([]checker.File, 0)\n\t\t\tfdp.GenerateStruct(&files)\n\t\t\tif len(files) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tBinaryArtifactResults: checker.BinaryArtifactData{\n\t\t\t\t\tFiles: files,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = hasBinaryArtifacts.Run(r)\n\t\tcase 10:\n\t\t\tfiles := make([]checker.File, 0)\n\t\t\tfdp.GenerateStruct(&files)\n\t\t\tif len(files) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tBinaryArtifactResults: checker.BinaryArtifactData{\n\t\t\t\t\tFiles: files,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = hasUnverifiedBinaryArtifacts.Run(r)\n\t\tcase 11:\n\t\t\tworkflows := make([]checker.DangerousWorkflow, 0)\n\t\t\tfdp.GenerateStruct(&workflows)\n\t\t\tif len(workflows) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Create temp file\n\t\t\tfileContents, err := fdp.GetBytes()\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttmpDir := t.TempDir()\n\t\t\terr = os.WriteFile(filepath.Join(tmpDir, \"workflowPath.yml\"), fileContents, 0755)\n\t\t\tif err != nil {\n\t\t\t\t// Panic as this should not happen and it may block the fuzzer\n\t\t\t\t// if it fails here.\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tDangerousWorkflowResults: checker.DangerousWorkflowData{\n\t\t\t\t\tNumWorkflows: len(workflows),\n\t\t\t\t\tWorkflows:    workflows,\n\t\t\t\t},\n\t\t\t\tMetadata: checker.MetadataData{\n\t\t\t\t\tMetadata: map[string]string{\n\t\t\t\t\t\t\"localPath\": filepath.Join(tmpDir, \"workflowPath.yml\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = hasDangerousWorkflowScriptInjection.Run(r)\n\t\tcase 12:\n\t\t\tworkflows := make([]checker.DangerousWorkflow, 0)\n\t\t\tfdp.GenerateStruct(&workflows)\n\t\t\tif len(workflows) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Create temp file\n\t\t\tfileContents, err := fdp.GetBytes()\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttmpDir := t.TempDir()\n\t\t\terr = os.WriteFile(filepath.Join(tmpDir, \"workflowPath.yml\"), fileContents, 0755)\n\t\t\tif err != nil {\n\t\t\t\t// Panic as this should not happen and it may block the fuzzer\n\t\t\t\t// if it fails here.\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tDangerousWorkflowResults: checker.DangerousWorkflowData{\n\t\t\t\t\tNumWorkflows: len(workflows),\n\t\t\t\t\tWorkflows:    workflows,\n\t\t\t\t},\n\t\t\t\tMetadata: checker.MetadataData{\n\t\t\t\t\tMetadata: map[string]string{\n\t\t\t\t\t\t\"localPath\": filepath.Join(tmpDir, \"workflowPath.yml\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = hasDangerousWorkflowUntrustedCheckout.Run(r)\n\t\tcase 13:\n\t\t\tlicenseFiles := make([]checker.LicenseFile, 0)\n\t\t\tfdp.GenerateStruct(&licenseFiles)\n\t\t\tif len(licenseFiles) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tLicenseResults: checker.LicenseData{\n\t\t\t\t\tLicenseFiles: licenseFiles,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = hasPermissiveLicense.Run(r)\n\t\tcase 14:\n\t\t\tsbomFiles := make([]checker.SBOM, 0)\n\t\t\tfdp.GenerateStruct(&sbomFiles)\n\t\t\tif len(sbomFiles) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tSBOMResults: checker.SBOMData{\n\t\t\t\t\tSBOMFiles: sbomFiles,\n\t\t\t\t},\n\t\t\t}\n\t\t\thasReleaseSBOM.Run(r)\n\t\tcase 15:\n\t\t\tsbomFiles := make([]checker.SBOM, 0)\n\t\t\tfdp.GenerateStruct(&sbomFiles)\n\t\t\tif len(sbomFiles) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tSBOMResults: checker.SBOMData{\n\t\t\t\t\tSBOMFiles: sbomFiles,\n\t\t\t\t},\n\t\t\t}\n\t\t\thasSBOM.Run(r)\n\t\tcase 16:\n\t\t\tissues := make([]clients.Issue, 0)\n\t\t\tfdp.GenerateStruct(&issues)\n\t\t\tif len(issues) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcommits := make([]clients.Commit, 0)\n\t\t\tfdp.GenerateStruct(&commits)\n\t\t\tif len(commits) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tMaintainedResults: checker.MaintainedData{\n\t\t\t\t\tCreatedAt:            time.Now(),\n\t\t\t\t\tIssues:               issues,\n\t\t\t\t\tDefaultBranchCommits: commits,\n\t\t\t\t\tArchivedStatus: checker.ArchivedStatus{\n\t\t\t\t\t\tStatus: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tissueActivityByProjectMember.Run(r)\n\t\tcase 17:\n\t\t\tpermissions := make([]checker.TokenPermission, 0)\n\t\t\tfdp.GenerateStruct(&permissions)\n\t\t\tif len(permissions) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tr := &checker.RawResults{\n\t\t\t\tTokenPermissionsResults: checker.TokenPermissionsData{\n\t\t\t\t\tTokenPermissions: permissions,\n\t\t\t\t\tNumTokens:        len(permissions),\n\t\t\t\t},\n\t\t\t}\n\t\t\tjobLevelPermissions.Run(r)\n\t\tcase 18:\n\t\t\tpackages := make([]checker.Package, 0)\n\t\t\tfdp.GenerateStruct(&packages)\n\t\t\tif len(packages) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tr := &checker.RawResults{\n\t\t\t\tPackagingResults: checker.PackagingData{\n\t\t\t\t\tPackages: packages,\n\t\t\t\t},\n\t\t\t}\n\t\t\tpackagedWithAutomatedWorkflow.Run(r)\n\t\tcase 19:\n\t\t\tdependencies := make([]checker.Dependency, 0)\n\t\t\tfdp.GenerateStruct(&dependencies)\n\t\t\tif len(dependencies) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tprocessingErrors := make([]checker.ElementError, 0)\n\t\t\tfdp.GenerateStruct(&processingErrors)\n\t\t\tif len(processingErrors) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tr := &checker.RawResults{\n\t\t\t\tPinningDependenciesResults: checker.PinningDependenciesData{\n\t\t\t\t\tDependencies:     dependencies,\n\t\t\t\t\tProcessingErrors: processingErrors,\n\t\t\t\t},\n\t\t\t}\n\t\t\tpinsDependencies.Run(r)\n\t\tcase 20:\n\t\t\treleases := make([]clients.Release, 0)\n\t\t\tfdp.GenerateStruct(&releases)\n\t\t\tif len(releases) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tr := &checker.RawResults{\n\t\t\t\tSignedReleasesResults: checker.SignedReleasesData{\n\t\t\t\t\tReleases: releases,\n\t\t\t\t},\n\t\t\t}\n\t\t\treleasesAreSigned.Run(r)\n\t\tcase 21:\n\t\t\treleases := make([]clients.Release, 0)\n\t\t\tfdp.GenerateStruct(&releases)\n\t\t\tif len(releases) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tr := &checker.RawResults{\n\t\t\t\tSignedReleasesResults: checker.SignedReleasesData{\n\t\t\t\t\tReleases: releases,\n\t\t\t\t},\n\t\t\t}\n\t\t\treleasesHaveProvenance.Run(r)\n\t\tcase 22:\n\t\t\tpackages := make([]checker.ProjectPackage, 0)\n\t\t\tfdp.GenerateStruct(&packages)\n\t\t\tif len(packages) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tr := &checker.RawResults{\n\t\t\t\tSignedReleasesResults: checker.SignedReleasesData{\n\t\t\t\t\tPackages: packages,\n\t\t\t\t},\n\t\t\t}\n\t\t\treleasesHaveVerifiedProvenance.Run(r)\n\t\tcase 23:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = requiresApproversForPullRequests.Run(r)\n\t\tcase 24:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = requiresCodeOwnersReview.Run(r)\n\t\tcase 25:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = requiresLastPushApproval.Run(r)\n\t\tcase 26:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = requiresPRsToChangeCode.Run(r)\n\t\tcase 27:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = requiresUpToDateBranches.Run(r)\n\t\tcase 28:\n\t\t\tr, err := createRawBranchProtectionsData(fdp)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, _, _ = runsStatusChecksBeforeMerging.Run(r)\n\t\tcase 29:\n\t\t\tworkflows := make([]checker.SASTWorkflow, 0)\n\t\t\tfdp.GenerateStruct(&workflows)\n\t\t\tif len(workflows) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcommits := make([]checker.SASTCommit, 0)\n\t\t\tfdp.GenerateStruct(&commits)\n\t\t\tif len(commits) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tSASTResults: checker.SASTData{\n\t\t\t\t\tWorkflows:    workflows,\n\t\t\t\t\tCommits:      commits,\n\t\t\t\t\tNumWorkflows: len(workflows),\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = sastToolConfigured.Run(r)\n\t\t\t_, _, _ = sastToolRunsOnAllCommits.Run(r)\n\t\tcase 30:\n\t\t\tciInfo := make([]checker.RevisionCIInfo, 0)\n\t\t\tfdp.GenerateStruct(&ciInfo)\n\t\t\tif len(ciInfo) == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr := &checker.RawResults{\n\t\t\t\tCITestResults: checker.CITestData{\n\t\t\t\t\tCIInfo: ciInfo,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, _, _ = testsRunInCI.Run(r)\n\t\t}\n\t})\n}\n\nfunc createRawBranchProtectionsData(fdp *gfh.ConsumeFuzzer) (*checker.RawResults, error) {\n\tbranches := make([]clients.BranchRef, 0)\n\tfdp.GenerateStruct(&branches)\n\tif len(branches) == 0 {\n\t\treturn nil, fmt.Errorf(\"created no branches\")\n\t}\n\tfor _, branch := range branches {\n\t\tif branch.Name == nil {\n\t\t\treturn nil, fmt.Errorf(\"created branch with nil name\")\n\t\t}\n\t}\n\tbpd := checker.BranchProtectionsData{\n\t\tBranches: branches,\n\t}\n\tr := &checker.RawResults{\n\t\tBranchProtectionResults: bpd,\n\t}\n\treturn r, nil\n}\n"
  },
  {
    "path": "projects/ossf-scorecard/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://openssf.org/\"\nmain_repo: \"https://github.com/ossf/scorecard\"\nprimary_contact: \"hey@auggie.dev\" # <-- IAM / commits: foo@auggie.dev\nauto_ccs:\n  - azeemshaikh38@gmail.com\n  - naveensrinivasan@protonmail.com\n  - adam@adalogics.com\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/ossf-scorecard/yaml_fuzzer.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage policy\n\nfunc FuzzParseFromYAML(data []byte) int {\n\t_, _ = parseFromYAML(data)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/ostree/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nARG glib_tag=2.78.4\nRUN apt-get update && apt-get install -y \\\n    make \\\n    autoconf \\\n    pkg-config \\\n    automake \\\n    software-properties-common \\\n    wget \\\n    liblzma-dev \\\n    libffi-dev \\\n    libext2fs-dev \\\n    libgpgme-dev libfuse-dev \\\n    python3-pip \\\n    libtool \\\n    bison\nRUN unset CFLAGS CXXFLAGS && pip3 install -U meson ninja\nRUN git clone --depth 1 --branch $glib_tag https://gitlab.gnome.org/GNOME/glib\nRUN git clone https://github.com/ostreedev/ostree && \\\n    cd ostree && \\\n    git submodule update --init\nCOPY build.sh $SRC/\nCOPY fuzz*.c $SRC/\n"
  },
  {
    "path": "projects/ostree/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build glib with sanitizer support\ncd glib\nmkdir build\ncd build\nmeson --prefix=/usr --buildtype=release -Db_lundef=false -Ddefault_library=static -Dlibmount=disabled\nninja\nninja install\n\n# Build libostree\ncd $SRC/ostree\nenv NOCONFIGURE=1 ./autogen.sh\n./configure --enable-static --without-selinux\nmake V=1\n\n# This needs to be able to fail in case some tests are breaking.\nmake check V=1 || true\n\n# Build fuzzers\ncp $SRC/fuzz*.c ./tests/\n\nFUZZ_LIBS=\"./.libs/libbsdiff.a \\\n           ./.libs/libglnx.a \\\n           ./.libs/libotutil.a \\\n           -L/usr/lib/x86_64-linux-gnu \\\n           ./.libs/libostree-1.a \\\n           ./.libs/libostreetest.a \\\n           ./.libs/libostree-1.a \\\n           -l:libgpgme.a \\\n           -l:libassuan.a \\\n           /usr/lib/x86_64-linux-gnu/libgpg-error.so \\\n           -l:liblzma.a \\\n           -l:libgio-2.0.a \\\n           -lresolv \\\n           -l:libgobject-2.0.a \\\n           -l:libffi.a \\\n           -l:libgmodule-2.0.a \\\n           -l:libglib-2.0.a \\\n           -lm \\\n           -l:libz.a \\\n           -l:libselinux.a \\\n           -pthread \\\n           -l:libpcre2-8.a\"\n\nFUZZ_INCLUDES=\"-I./src/libotutil \\\n               -I./src/libostree \\\n               -I./src/libostree \\\n               -I./src/ostree \\\n               -I./libglnx \\\n               -I/usr/include/gio-unix-2.0 \\\n               -I/usr/include/glib-2.0 \\\n               -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \\\n               -DPKGLIBEXECDIR=\\\"/usr/local/libexec/libostree\\\"\"\n\nFUZZ_DEFINES=\"-DHAVE_CONFIG_H \\\n              -I. \\\n              -DDATADIR=\\\"/usr/local/share\\\" \\\n              -DLIBEXECDIR=\\\"/usr/local/libexec\\\" \\\n              -DLOCALEDIR=\\\"/usr/local/share/locale\\\" \\\n              -DSYSCONFDIR=\\\"/usr/local/etc\\\" \\\n              -DTARGET_PREFIX=\\\"/usr/local\\\" \\\n              -DOSTREE_COMPILATION \\\n              -DG_LOG_DOMAIN=\\\"OSTree\\\" \\\n              -DOSTREE_GITREV=\\\"v2022.2-41-gf21944da1cf24cc2bbf1d4dfbd3aaa698d4f0a70\\\" \\\n              -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_66 \\\n              -DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_40\"\n\nFUZZ_WERROR=\"\"\n\nfor fuzz in repo bsdiff; do\n  $CC $CFLAGS $FUZZ_DEFINES $FUZZ_INCLUDES -o tests/fuzz-$fuzz.o -c tests/fuzz-$fuzz.c\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $FUZZ_INCLUDES -o $OUT/fuzz-$fuzz  tests/fuzz-$fuzz.o $FUZZ_LIBS\ndone\n"
  },
  {
    "path": "projects/ostree/fuzz-bsdiff.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n\n#include \"libglnx.h\"\n#include \"bsdiff/bsdiff.h\"\n#include \"bsdiff/bspatch.h\"\n#include <glib.h>\n#include <stdlib.h>\n#include <gio/gio.h>\n#include <string.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n\nstatic int\nbzdiff_write (struct bsdiff_stream* stream, const void* buffer, int size)\n{\n  GOutputStream *out = stream->opaque;\n  if (! g_output_stream_write (out,\n                               buffer,\n                               size,\n                               NULL,\n                               NULL)) {\n    return -1;\n  }\n\n  return 0;\n}\n\n\nint\nLLVMFuzzerTestOneInput (const uint8_t *data,\n                        size_t         size)\n{\n#define NEW_SIZE (512+24)\n\n  struct bsdiff_stream bsdiff_stream;\n  struct bspatch_stream bspatch_stream;\n  int i;\n  g_autofree guint8 *old = g_new (guint8, size);\n  g_autofree guint8 *new = g_new (guint8, NEW_SIZE);\n  g_autofree guint8 *new_generated = g_new0 (guint8, NEW_SIZE);\n  g_autoptr(GOutputStream) out = g_memory_output_stream_new_resizable ();\n  g_autoptr(GInputStream) in = NULL;\n\n  new[0] = 'A';\n  for (i = 0; i < size; i++) {\n    old[i] = data[i];\n  }\n  for (i = 0; i < NEW_SIZE; i++) {\n    new[i] = i;\n  }\n\n  bsdiff_stream.malloc = malloc;\n  bsdiff_stream.free = free;\n  bsdiff_stream.write = bzdiff_write;\n  bsdiff_stream.opaque = out;\n  bsdiff (old, size, new, NEW_SIZE, &bsdiff_stream);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/ostree/fuzz-repo.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include \"config.h\"\n\n#include \"libglnx.h\"\n#include \"bsdiff/bsdiff.h\"\n#include \"bsdiff/bspatch.h\"\n#include <glib.h>\n#include <stdlib.h>\n#include <gio/gio.h>\n#include <glib-object.h>\n#include <libglnx.h>\n#include <locale.h>\n\n#include \"ostree-autocleanups.h\"\n#include \"ostree-types.h\"\n\n#include <string.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n\ntypedef struct\n{\n  GLnxTmpDir tmpdir;\n} Fixture;\n\n\nint\nsetup (Fixture       *fixture,\n       gconstpointer  test_data)\n{\n  g_autoptr(GError) error = NULL;\n  if (! glnx_mkdtemp (\"test-repo-XXXXXX\", 0700, &fixture->tmpdir, &error)) {\n    return 1;\n  }\n  return 0;\n}\n\nvoid\nteardown (Fixture       *fixture,\n          gconstpointer  test_data)\n{\n \n  (void) glnx_tmpdir_delete (&fixture->tmpdir, NULL, NULL);\n}\n\nvoid\npayload (Fixture         *fixture,\n         const uint8_t   *data,\n         size_t           size)\n{\n  g_autoptr (GKeyFile) config = NULL;\n  g_autoptr(GError) error = NULL;\n  guint64 bytes = 0;\n\n  g_autoptr(OstreeRepo) repo = ostree_repo_create_at (fixture->tmpdir.fd,\n                                                      \".\",\n                                                      OSTREE_REPO_MODE_ARCHIVE,\n                                                      NULL,\n                                                      NULL,\n                                                      &error);\n\n  config = ostree_repo_copy_config (repo);\n\n  g_key_file_remove_key (config, \"core\", \"min-free-space-size\", NULL);\n  \n  char *m1 = malloc(size+1);\n  memcpy(m1, data, size);\n  m1[size] = '\\0';\n\n  g_key_file_set_string (config, m1, m1, m1);\n\n  ostree_repo_write_config (repo, config, &error);\n  ostree_repo_reload_config (repo, NULL, &error);\n  ostree_repo_get_min_free_space_bytes (repo, &bytes, &error);\n\n  free(m1);\n}\n\nint\nLLVMFuzzerTestOneInput (const uint8_t *data,\n                       size_t          size)\n{\n  Fixture ft;\n  g_auto(GLnxTmpDir) ret_tmpdir = { 0, };\n  ft.tmpdir = ret_tmpdir;\n  if (setup(&ft, NULL) == 1) {\n    return 0;\n  }\n\n  payload(&ft, data, size);\n  teardown(&ft, NULL);\n  return 0;\n}\n"
  },
  {
    "path": "projects/ostree/project.yaml",
    "content": "homepage: \"https://github.com/ostreedev/ostree\"\nmain_repo: 'https://github.com/ostreedev/ostree'\nlanguage: c\nprimary_contact: \"walters@verbum.org\"\nauto_ccs:\n  - \"dbn@endlessos.org\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/ots/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip && \\\n    pip3 install meson==0.55.2 ninja\nRUN git clone --depth 1 https://github.com/khaledhosny/ots.git\nWORKDIR ots\nCOPY run_tests.sh build.sh ots-fuzzer.* $SRC/\n"
  },
  {
    "path": "projects/ots/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# setup\nbuild=$WORK/build\n\n# cleanup\nrm -rf $build\nmkdir -p $build\n\n# Configure the project.\nmeson -Dfuzzer_ldflags=\"$(echo $LIB_FUZZING_ENGINE)\" \\\n      --wrap-mode=forcefallback \\\n      $build \\\n   || (cat build/meson-logs/meson-log.txt && false)\n\n# Build the fuzzer.\nninja -v -j$(nproc) -C $build ots-fuzzer\nmv $build/ots-fuzzer $OUT/\n\ncp $SRC/ots-fuzzer.options $OUT/\nzip -j -r $OUT/ots-fuzzer_seed_corpus.zip $SRC/ots/tests/fonts\n"
  },
  {
    "path": "projects/ots/ots-fuzzer.options",
    "content": "[libfuzzer]\nmax_len = 1000000\n"
  },
  {
    "path": "projects/ots/project.yaml",
    "content": "homepage: \"https://github.com/khaledhosny/ots\"\nlanguage: c++\nprimary_contact: \"dr.khaled.hosny@gmail.com\"\nauto_ccs:\n  - \"kevin899@gmail.com\"\n  - \"jfkthame@gmail.com\"\nvendor_ccs:\n  - \"jmuizelaar@mozilla.com\"\n  - \"lsalzman@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/khaledhosny/ots.git'\n"
  },
  {
    "path": "projects/ots/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer/deallocation mismatch check and run unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0:alloc_dealloc_mismatch=0\"\nmeson test -C $WORK/build\n"
  },
  {
    "path": "projects/ox-ruby/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-ruby\n\nRUN git clone --depth 1 --single-branch https://github.com/ohler55/ox.git $SRC/ox-ruby\n\nENV CFLAGS=\"$CFLAGS -fsanitize=fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\"\nENV CXXFLAGS=\"$CXXFLAGS -fsanitize=fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g\"\n\nCOPY build.sh $SRC/build.sh\nCOPY fuzz_*.rb $SRC/harnesses/\n\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/ox-ruby/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport GEM_HOME=$OUT/fuzz_parse-gem\n\n# setup\nBUILD=$WORK/Build\n\ncd $SRC/ox-ruby\ngem build\nRUZZY_DEBUG=1 gem install --development --verbose *.gem\n\n# Sync gems folder with ruzzy\nrsync -avu /install/ruzzy/* $OUT/fuzz_parse-gem\n\n#for fuzz_target_path in $SRC/harnesses/fuzz_*.rb; do\n#\truzzy-build \"$fuzz_target_path\"\n#done\n\ncp $SRC/harnesses/fuzz_parse.rb $OUT/\nexport GEM_PATH=$OUT/fuzz_parse-gem\n\necho \"\"\"#!/usr/bin/env bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\n\necho \"GEM_HOME FIRST: \\$GEM_HOME\"\n\nexport GEM_HOME=\\$this_dir/fuzz_parse-gem\nexport GEM_PATH=\\$this_dir/fuzz_parse-gem\necho \"GEM_PATH: \\$GEM_PATH\"\necho \"GEM_HOME: \\$GEM_HOME\"\necho \"Showing gem home:\"\nls -la \\$GEM_HOME\n\necho \"Showing this dir:\"\nls -la \\$this_dir\n\nASAN_OPTIONS=\"allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0\" LD_PRELOAD=\\$(ruby -e 'require \\\"ruzzy\\\"; print Ruzzy::ASAN_PATH') ruby \\$this_dir/fuzz_parse.rb \\$@\"\"\" > $OUT/fuzz_parse\n\nchmod +x $OUT/fuzz_parse\n\n#mv $OUT/fuzz-gem $OUT/fuzz_parse-gem\n"
  },
  {
    "path": "projects/ox-ruby/fuzz_parse.rb",
    "content": "# frozen_string_literal: true\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nrequire 'ruzzy'\nrequire 'ox'\n\ntest_one_input = lambda do |data|\n  if data.length < 100\n    return 0\n  end\n  begin\n    Ox.parse(data)\n  rescue Ox::ParseError, Ox::SyntaxError, EncodingError\n    # pass\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n"
  },
  {
    "path": "projects/ox-ruby/fuzz_sax_parse.rb",
    "content": "# frozen_string_literal: true\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nrequire 'ruzzy'\nrequire 'ox'\n\nclass MyHandler < Ox::Sax\n  # Called for the opening of an element\n  def start_element(name)\n  end\n\n  # Called for the text content of an element\n  def text(value)\n  end\n\n  # Called for the closing of an element\n  def end_element(name)\n  end\nend\n\ntest_one_input = lambda do |data|\n  if data.length < 100\n    return 0\n  end\n  begin\n    handler = MyHandler.new\n    Ox.sax_parse(handler, StringIO.new(data))\n  rescue Ox::ParseError, EncodingError\n    # pass\n  end\n  return 0\nend\n\nRuzzy.fuzz(test_one_input)\n"
  },
  {
    "path": "projects/ox-ruby/project.yaml",
    "content": "homepage: \"https://github.com/ohler55/ox\"\nlanguage: ruby\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/ohler55/ox'\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n  - david@adalogics.com\n"
  },
  {
    "path": "projects/oxia/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/oxia-db/oxia\nRUN git clone --depth 1 https://github.com/AdamKorcz/cncf-fuzzing\nRUN git clone --depth 1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=v2_2\nCOPY build.sh $SRC/\nWORKDIR $SRC/oxia\n"
  },
  {
    "path": "projects/oxia/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/cncf-fuzzing/projects/oxia/build.sh\n\n"
  },
  {
    "path": "projects/oxia/project.yaml",
    "content": "homepage: \"https://oxia-db.github.io\"\nlanguage: go\nprimary_contact: \"mmerli@apache.org\"\nauto_ccs:\n- \"adam@adalogics.com\"\nmain_repo: \"https://github.com/oxia-db/oxia\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n"
  },
  {
    "path": "projects/p11-kit/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config libtasn1-6-dev libffi-dev gettext autopoint python3 ninja-build\nRUN python3 -m pip install meson\nRUN git clone --depth 1 --recurse-submodules https://github.com/p11-glue/p11-kit.git p11-kit\nWORKDIR p11-kit\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/p11-kit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\nmake -j$(nproc) oss-fuzz\n\ncd fuzz\nfor dir in *.in; do\n    fuzzer=$(basename $dir .in)_fuzzer\n    zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n\n# The build above only builds the fuzzers using autotools.\n# Unit test definitions are located in meson.build.\n# Build the unit test suite with meson for run_tests.sh.\n# CXXFLAGS must be unset because it contains -stdlib=libc++ which is C++ specific\n# and causes linker errors when building this primarily C project with meson. The\n# sanitizer flags combined with C++ flags also create linking conflicts between C\n# and C++ runtime libraries in the meson build system.\ncd $SRC/p11-kit\nCFLAGS= CXXFLAGS= meson setup build\nninja -C build\n"
  },
  {
    "path": "projects/p11-kit/project.yaml",
    "content": "homepage: https://p11-glue.github.io/p11-glue/p11-kit.html\nmain_repo: https://github.com/p11-glue/p11-kit\nlanguage: c\nprimary_contact: \"daiki.ueno@gmail.com\"\nauto_ccs:\n  - \"zfridric@redhat.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/p11-kit/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run unit test with meson\nmeson test -C $SRC/p11-kit/build\n"
  },
  {
    "path": "projects/p9/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nMAINTAINER s@sevki.org\n\nRUN git clone --depth 1 https://github.com/hugelgupf/p9\n\nWORKDIR $SRC/p9\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/p9/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncompile_go_fuzzer github.com/hugelgupf/p9/p9 Fuzz p9_fuzzer\n"
  },
  {
    "path": "projects/p9/project.yaml",
    "content": "homepage: \"https://github.com/hugelgupf/p9\"\nlanguage: go\nprimary_contact: \"harvey@googlegroups.com\"\nauto_ccs:\n  - \"s@sevki.org\"\n  - \"c@chrisko.ch\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/hugelgupf/p9'\n"
  },
  {
    "path": "projects/pacemaker/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config cmake nasm autopoint gettext python3 libqb-dev libbz2-dev \\\n  libglib2.0-dev corosync libgnutls28-dev libcfg-dev libcpg-dev libcmap-dev \\\n  libquorum-dev libpython3-dev libdbus-1-dev\n\nRUN wget https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz && tar xzvf icu4c-66_1-src.tgz\nRUN cd $SRC/icu/source && \\\n   ./configure --disable-shared --enable-static --disable-layoutex \\\n  --disable-tests --disable-samples --with-data-packaging=static && \\\n  make install -j4\n\n# Build requires automake 1.16.3\nRUN curl -LO http://mirrors.kernel.org/ubuntu/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\n    apt install ./automake_1.16.5-1.3_all.deb\n\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxslt.git\n\n\nRUN cd $SRC/libxml2 && \\\n  ./autogen.sh \\\n    --without-legacy \\\n    --without-push \\\n    --without-python \\\n    --without-zlib \\\n    --without-lzma \\\n    --enable-static && \\\n  make -j$(nproc) all && \\\n  make install\n\nRUN cd $SRC/libxslt && \\\n  cd $SRC/libxslt && \\\n  ./autogen.sh \\\n    --with-libxml-src=../libxml2 \\\n    --without-python \\\n    --without-debug \\\n    --without-debugger \\\n    --without-profiler \\\n    --enable-static && \\\n  make -j$(nproc) && \\\n  make install \n\nRUN git clone https://github.com/ClusterLabs/libqb && cd libqb && \\\n    ./autogen.sh && ./configure && make && make install\n\n# Uncomment before merging\nRUN git clone --depth 1 https://github.com/ClusterLabs/pacemaker\n\nWORKDIR pacemaker\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/pacemaker/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"$CFLAGS -Wno-deprecated-declarations\"\nexport CXXFLAGS=\"$CXXFLAGS -Wno-deprecated-declarations\"\n# Run autogen first\ncd $SRC/pacemaker\ntest -e configure && test -e libltdl || ./autogen.sh\n\n# Patch configure to skip the strerror AC_RUN_IFELSE check that fails with sanitizers\n# This check tries to run a test program which doesn't work with ASAN\nif [ -f configure ]; then\n  sed -i 's/as_fn_error $? \"strerror() is not C99-compliant\" \"$LINENO\" 5/echo \"Assuming strerror is C99-compliant for fuzzing build\"/g' configure\nfi\n\n# Now run configure if needed, then build\ntest -e Makefile || ./configure\n\nmake -j$(nproc) core\n\nfor FUZZER_SOURCE in lib/*/fuzzers/*.c; do\n  FUZZER=\"$(basename \"$FUZZER_SOURCE\" .c)\"\n\n  $CC $CFLAGS $LIB_FUZZING_ENGINE -c \"$FUZZER_SOURCE\"                      \\\n   -o \"${OUT}/${FUZZER}.o\"                                                 \\\n   -I./include -I/usr/local/include/libxml2 -I/usr/include/glib-2.0        \\\n   -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/\n\n  # Link with CXX for Centipede\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE                                       \\\n   \"$OUT/${FUZZER}.o\" -o \"$OUT/${FUZZER}\"                                  \\\n   ./lib/cib/.libs/libcib.a ./lib/pengine/.libs/libpe_rules.a              \\\n   ./lib/common/.libs/libcrmcommon.a -l:libqb.a                            \\\n   -l:libxslt.a -l:libxml2.a -l:libglib-2.0.a -l:libuuid.a -l:libicuuc.a   \\\n   -l:libz.a -lgnutls -lbz2 -lpcre -lrt -ldl -lc\ndone\n"
  },
  {
    "path": "projects/pacemaker/project.yaml",
    "content": "homepage: \"https://www.clusterlabs.org/pacemaker/\"\nlanguage: c\nprimary_contact: \"clumens@redhat.com\"\nauto_ccs:\n- \"nwahl@redhat.com\"\n- \"david@adalogics.com\"\n- \"adam@adalogics.com\"\nmain_repo: \"https://github.com/ClusterLabs/pacemaker\"\n"
  },
  {
    "path": "projects/packaging/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d223a882810372830fd7968eb3e64533f3a2318c90be43ac753a46a15946faec\nRUN git clone https://github.com/pypa/packaging packaging\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/packaging\n"
  },
  {
    "path": "projects/packaging/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/packaging/fuzz_packaging.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Target several modules in the packaging project.\"\"\"\n\nimport sys\nimport atheris\nfrom packaging.utils import (canonicalize_version, parse_wheel_filename,\n                             parse_sdist_filename, InvalidSdistFilename,\n                             InvalidWheelFilename)\n\nfrom packaging.specifiers import InvalidSpecifier, Specifier\nfrom packaging.version import InvalidVersion\n\n\ndef fuzz_utils(data):\n  \"\"\"Logic to hit routines in src/packaging/utils.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  canonicalize_version(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  try:\n    parse_sdist_filename(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except InvalidSdistFilename:\n    pass\n\n  try:\n    parse_wheel_filename(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except InvalidWheelFilename:\n    pass\n\n\ndef fuzz_specifier(data):\n  \"\"\"Logic to hit routines in src/packaging/specifiers.\"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    spec1 = Specifier(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n    spec2 = Specifier(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except InvalidSpecifier:\n    return\n\n  b1 = spec1 == spec2\n  b2 = spec1 != spec2\n  try:\n    b7 = spec1.contains(fdp.ConsumeUnicodeNoSurrogates(24))\n  except InvalidVersion:\n    pass\n\n\ndef TestOneInput(data):\n  \"\"\"Fuzzer entrypoint, wrapper around fuzz_* routines.\"\"\"\n  fuzz_utils(data)\n  fuzz_specifier(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/packaging/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pypa/packaging\nlanguage: python\nmain_repo: https://github.com/pypa/packaging\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pako/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN  git clone --depth 1 https://github.com/nodeca/pako.git\n\nCOPY fuzz.js $SRC/pako\n\nWORKDIR $SRC/pako\n"
  },
  {
    "path": "projects/pako/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer pako fuzz.js --sync\n"
  },
  {
    "path": "projects/pako/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst pako = require('pako');\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\n\nmodule.exports.fuzz = function(data) {\n  const fdp = new FuzzedDataProvider(data);\n  const choice = fdp.consumeBoolean();\n\n  try {\n    if (choice === true) {\n      const comprLevel = fdp.consumeIntegral(1);\n      const windowBits = fdp.consumeIntegral(1);\n      const memLevel = fdp.consumeIntegral(1);\n      const strategy = fdp.consumeIntegral(1);\n      const raw = fdp.consumeBoolean();\n      const input = fdp.consumeRemainingAsBytes();\n      const options = {\n        level: comprLevel,\n        windowBits: windowBits,\n        memLevel: memLevel,\n        strategy: strategy,\n        raw: raw\n      };\n      const defl = pako.deflate(input, options);\n      pako.inflate(defl, options);\n      const deflRaw = pako.deflateRaw(input, options);\n      pako.inflateRaw(deflRaw, options);\n    } else {\n      const gzipOptions = {\n        level: fdp.consumeIntegral(1),\n        raw: fdp.consumeBoolean(),\n        to: fdp.consumeBoolean(),\n        windowBits: fdp.consumeIntegral(1),\n        memLevel: fdp.consumeIntegral(1),\n        strategy: fdp.consumeIntegral(1)\n      };\n      const input = fdp.consumeRemainingAsBytes();\n      const gzip = pako.gzip(input, gzipOptions);\n      pako.ungzip(gzip, gzipOptions);\n      pako.inflate(gzip);\n      pako.inflateRaw(gzip);\n    }\n  } catch (error) {\n    if (error.message && !ignoredError(error)) {\n      throw error;\n    }\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [\n  'stream error',\n  'invalid window size',\n  'incorrect header check'\n];\n"
  },
  {
    "path": "projects/pako/project.yaml",
    "content": "homepage: https://nodeca.github.io/pako/\nlanguage: javascript\nmain_repo: https://github.com/nodeca/pako\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/pandas/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool libffi-dev\n# Ensure we work from right python version\nRUN apt-get install -y python3.9 python3.9-dev && \\\n    ln --force -s /usr/bin/python3.9 /usr/local/bin/python3 && \\\n    apt-get install -y python3-pip && \\\n    python3 -m pip install cython \"atheris>=2.1.1\" \"pyinstaller==5.0.1\" \"coverage==6.3.2\"\nRUN python3 -m pip install --upgrade pip Cython numpy versioneer\nRUN git clone --depth 1 https://github.com/pandas-dev/pandas pandas && \\\n    cd pandas && \\\n    python3 -m pip install -r requirements-dev.txt\nWORKDIR pandas\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/pandas/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nif [ $SANITIZER == \"coverage\" ]; then\n    export CFLAGS=\"\"\n    export CXXFLAGS=\"\"\nfi\nif [ $SANITIZER == \"introspector\" ]; then\n    export CFLAGS=\"\"\n    export CXXFLAGS=\"\"\n    # Adjust for python3.9\n    sed -i 's/apt-get/#apt-get/g' /usr/local/bin/compile_python_fuzzer\n    sed -i 's/python3\\.9/#python3/g' /usr/local/bin/compile_python_fuzzer\n    sed -i 's/pip3/python3 -m pip/g' /usr/local/bin/compile_python_fuzzer\n    sed -i 's/\\. \\.venv/#/g' /usr/local/bin/compile_python_fuzzer\n    sed -i 's/python \\/fuzz/python3 \\/fuzz/g' /usr/local/bin/compile_python_fuzzer\n    sed -i 's/site-packages/dist-packages/g' /fuzz-introspector/frontends/python/prepare_fuzz_imports.py\nfi\n\nPYTHON_CONFIG_STR=$(python3.9-config --cflags --ldflags)\nexport LDSHARED=\"${CC} ${PYTHON_CONFIG_STR} -nostartfiles -shared\"\n\npython3 setup.py install\n\n#python3 -m pip install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  LD_PRELOAD=$OUT/sanitizer_with_fuzzer.so ASAN_OPTIONS=detect_leaks=0 compile_python_fuzzer $fuzzer --hidden-import cmath\ndone\n"
  },
  {
    "path": "projects/pandas/fuzz_crosstab.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets pandas crosstab function with fuzzing data to explore edge cases.\"\"\"\n\nimport atheris\nimport sys\nimport pandas as pd\nimport numpy as np\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        num_elements = fdp.ConsumeIntInRange(1, 100)\n        a = np.array(\n            [fdp.ConsumeUnicode(fdp.ConsumeIntInRange(1, 100)) for _ in range(num_elements)],\n            dtype=object\n        )\n\n        b = np.array(\n            [fdp.ConsumeUnicode(fdp.ConsumeIntInRange(1, 100)) for _ in range(num_elements)],\n            dtype=object\n        )\n\n        pd.crosstab(\n            a,\n            b,\n            rownames=[fdp.ConsumeUnicode(fdp.ConsumeIntInRange(1, 100))],\n            colnames=[fdp.ConsumeUnicode(fdp.ConsumeIntInRange(1, 100))]\n        )\n\n    except (\n            ValueError  # If there is a mismatch in dimensions or inappropriate values are provided.\n    ):\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_interpolate.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzes the pandas interpolate function, generating and manipulating DataFrames with various data types to uncover\npotential edge cases.\"\"\"\n\nimport sys\nimport atheris\nimport pandas as pd\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        rows = fdp.ConsumeIntInRange(1, 15)\n        num_rows = fdp.ConsumeIntInRange(3, 20)\n        num_columns = fdp.ConsumeIntInRange(3, 20)\n        col_names = [fdp.ConsumeString(fdp.ConsumeIntInRange(1, 15)) for _ in range(num_columns)]\n\n        df_content = {}\n        for col_name in col_names:\n            if fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeInt(10) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeString(10) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeIntInRange(0, 2100) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeFloat() for _ in range(num_rows)]\n            else:\n                df_content[col_name] = [fdp.ConsumeBool() for _ in range(num_rows)]\n\n        df = pd.DataFrame(df_content)\n\n        # Fuzz interpolate options\n        method = fdp.PickValueInList(\n            ['linear', 'time', 'index', 'values', 'nearest', 'zero', 'slinear', 'quadratic',\n             'cubic', 'barycentric', 'krogh', 'polynomial', 'spline', 'bessel', 'holistic', 'akima',\n             fdp.ConsumeString(15)])\n        axis = fdp.PickValueInList([0, 1, 'index', 'columns'])\n        limit = fdp.ConsumeIntInRange(1, rows) if fdp.ConsumeBool() else None\n        inplace = fdp.ConsumeBool()\n        limit_direction = fdp.PickValueInList(['forward', 'backward', 'both', None])\n        limit_area = fdp.PickValueInList([None, 'inside', 'outside'])\n        order = fdp.ConsumeIntInRange(1, 5) if method == 'polynomial' else None\n        s = fdp.ConsumeFloatInRange(0, 1) if method == 'spline' else None\n        robust = fdp.ConsumeBool()\n\n        df.interpolate(\n            method=method,\n            axis=axis,\n            limit=limit,\n            inplace=inplace,\n            limit_direction=limit_direction,\n            limit_area=limit_area,\n            order=order,\n            s=s,\n            robust=robust\n        )\n\n    except (\n            ValueError  # If method argument is invalid\n    ):\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_json_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"This fuzzer script specifically targets the pandas json parser.\"\"\"\n\nimport sys\nimport atheris\nimport pandas as pd\nimport io\n\nfrom pandas.errors import (\n    EmptyDataError,\n    ParserError,\n)\n\n\ndef TestReadJson(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        fuzzed_json = fdp.ConsumeUnicode(sys.maxsize)\n        pd.read_json(io.StringIO(fuzzed_json), orient='index')\n    except (\n            ParserError,  # If the data is not valid JSON\n            EmptyDataError,  # If the data is emtpy or contains only whitespaces\n            ValueError  # If the data is not line-delimited JSON format\n    ):\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestReadJson)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_melt_map.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"This fuzzer script targets the pandas melt and map functions, creating a variety of DataFrames with mixed data\ntypes and then transforming them using melting and mapping operations.\"\"\"\n\nimport sys\nimport atheris\nimport pandas as pd\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        groups = {\n            fdp.ConsumeString(10): fdp.ConsumeUnicodeNoSurrogates(10),\n            fdp.ConsumeString(10): fdp.ConsumeUnicodeNoSurrogates(10)\n        }\n\n        num_rows = fdp.ConsumeIntInRange(3, 30)\n        num_columns = fdp.ConsumeIntInRange(3, 30)\n        col_names = [fdp.ConsumeString(fdp.ConsumeIntInRange(1, 15)) for _ in range(num_columns)]\n\n        df_content = {}\n        for col_name in col_names:\n            if fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeInt(10) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeString(10) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeIntInRange(0, 2100) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeFloat() for _ in range(num_rows)]\n            else:\n                df_content[col_name] = [fdp.ConsumeBool() for _ in range(num_rows)]\n\n        id_vars_data = [\n            col_names[fdp.ConsumeIntInRange(0, len(col_names) - 1)],\n            col_names[fdp.ConsumeIntInRange(0, len(col_names) - 1)],\n            col_names[fdp.ConsumeIntInRange(0, len(col_names) - 1)]\n        ]\n        if fdp.ConsumeBool():\n            id_vars_data.append(fdp.ConsumeString(fdp.ConsumeIntInRange(1, 15)))\n\n        df = pd.DataFrame(df_content)\n        name = fdp.ConsumeString(20)\n        df = pd.melt(\n            df,\n            id_vars=id_vars_data,\n            value_vars=[\n                col_names[fdp.ConsumeIntInRange(0, len(col_names) - 1)],\n                col_names[fdp.ConsumeIntInRange(0, len(col_names) - 1)]\n            ],\n            var_name='gf', value_name=fdp.ConsumeString(10)\n        )\n\n        local_var_name = 'gf' if fdp.ConsumeBool() else fdp.ConsumeString(10)\n        df[name] = df[local_var_name].map(groups)\n    except (\n            KeyError,  # if `id_vars` are not in the frame.\n            ValueError # if initial data from seed is empty and fdp produces empty data.\n    ):\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_python_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets pandas parsers. Both native and python code.\"\"\"\n\nimport os\nimport sys\nimport atheris\nimport io\n\nfrom pandas.errors import (\n    EmptyDataError,\n    ParserError,\n)\nimport pandas\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        pandas.io.parsers.read_csv(io.StringIO(\n            fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)),\n            engine=\"python\")\n    except (EmptyDataError, ParserError, ValueError):\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_replace.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"This fuzzer script targets the pandas replace function with variety of inputs and edge cases.\"\"\"\n\nimport sys\nimport atheris\nimport pandas as pd\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        num_rows = fdp.ConsumeIntInRange(3, 30)\n        num_columns = fdp.ConsumeIntInRange(3, 30)\n        col_names = [fdp.ConsumeString(fdp.ConsumeIntInRange(1, 20)) for _ in range(num_columns)]\n\n        df_content = {}\n        for col_name in col_names:\n            if fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeInt(10) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeString(10) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeIntInRange(0, 2100) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                df_content[col_name] = [fdp.ConsumeFloat() for _ in range(num_rows)]\n            else:\n                df_content[col_name] = [fdp.ConsumeBool() for _ in range(num_rows)]\n        df = pd.DataFrame(df_content)\n\n        to_replace = fdp.ConsumeIntInRange(1, 100) if fdp.ConsumeBool else [fdp.ConsumeIntInRange(1, 100),\n                                                                            fdp.ConsumeIntInRange(1, 100)]\n        value = fdp.ConsumeIntInRange(101, 200)\n        inplace = fdp.ConsumeBool()\n        limit = fdp.ConsumeIntInRange(1, num_rows - 1) if fdp.ConsumeBool() else None\n        regex = fdp.ConsumeBool()\n        method = fdp.PickValueInList(['pad', 'ffill', 'bfill', 'backfill', fdp.ConsumeString(20), None])\n\n        df.replace(\n            to_replace=to_replace,\n            value=value,\n            inplace=inplace,\n            limit=limit,\n            regex=regex,\n            method=method\n        )\n\n    except (\n            TypeError,  # If to_replace and value have different length\n            ValueError  # If method is not in ['pad', 'ffill', 'bfill', 'backfill']\n    ):\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_textreader_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets pandas parsers. Both native and python code.\"\"\"\n\nimport os\nimport sys\nimport atheris\nimport io\n\nfrom pandas.errors import (\n    EmptyDataError,\n    ParserError,\n)\n\nfrom pandas.io.parsers import read_csv\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        read_csv(io.StringIO(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)))\n    except (\n        EmptyDataError,\n        ParserError,\n        ValueError\n    ):\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_to_datetime.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets the pandas to_datetime function.\"\"\"\n\nimport sys\nimport atheris\nimport pandas as pd\n\nfrom pandas.errors import (\n    ParserError,\n    OutOfBoundsDatetime\n)\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        input_str = fdp.ConsumeUnicodeNoSurrogates(100)\n        errors = fdp.PickValueInList(['raise', 'coerce', 'ignore', fdp.ConsumeUnicodeNoSurrogates(20)])\n        unit = fdp.PickValueInList([None, 'ns', 'us', 'ms', 's', 'D', 'M', 'Y', fdp.ConsumeUnicodeNoSurrogates(20)])\n        origin = fdp.PickValueInList(['unix', 'julian', 'epoch', fdp.ConsumeUnicodeNoSurrogates(20)])\n        dayfirst = fdp.ConsumeBool()\n        yearfirst = fdp.ConsumeBool()\n        exact = fdp.ConsumeBool()\n        cache = fdp.ConsumeBool()\n\n        pd.to_datetime(\n            arg=input_str,\n            errors=errors,\n            unit=unit,\n            origin=origin,\n            dayfirst=dayfirst,\n            yearfirst=yearfirst,\n            exact=exact,\n            cache=cache\n        )\n\n    except (\n            ParserError,  # When parsing a date from string fails.\n            ValueError,  # When another datetime conversion error happens.\n            OutOfBoundsDatetime  # catching attempts to create a DatetimeIndex, which may raise from cast()\n    ):\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/fuzz_to_latex.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets the to_latex function.\"\"\"\n\nimport sys\nimport atheris\nimport pandas as pd\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        num_rows = fdp.ConsumeIntInRange(3, 100)\n        num_columns = fdp.ConsumeIntInRange(3, 100)\n        col_names = [fdp.ConsumeString(fdp.ConsumeIntInRange(1, 100)) for _ in range(num_columns)]\n\n        data = {}\n        for col_name in col_names:\n            if fdp.ConsumeBool():\n                data[col_name] = [fdp.ConsumeInt(10) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                data[col_name] = [fdp.ConsumeString(100) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                data[col_name] = [fdp.ConsumeIntInRange(0, 2100) for _ in range(num_rows)]\n            elif fdp.ConsumeBool():\n                data[col_name] = [fdp.ConsumeFloat() for _ in range(num_rows)]\n            else:\n                data[col_name] = [fdp.ConsumeBool() for _ in range(num_rows)]\n\n        df = pd.DataFrame(data)\n        columns = None if fdp.ConsumeBool() else list(df.columns)\n        header = fdp.ConsumeBool()\n        index = fdp.ConsumeBool()\n        na_rep = fdp.ConsumeUnicodeNoSurrogates(5)\n        float_format = \"fixed\" if fdp.ConsumeBool() else None\n        sparsify = fdp.ConsumeBool()\n        index_names = fdp.ConsumeBool()\n        bold_rows = fdp.ConsumeBool()\n        columns_format = None if fdp.ConsumeBool() else fdp.ConsumeUnicodeNoSurrogates(5)\n        longtable = fdp.ConsumeBool()\n\n        df.to_latex(\n            columns=columns,\n            header=header,\n            index=index,\n            na_rep=na_rep,\n            formatters=None,\n            float_format=float_format,\n            sparsify=sparsify,\n            index_names=index_names,\n            bold_rows=bold_rows,\n            column_format=columns_format,\n            longtable=longtable\n        )\n\n\n\n    except(\n            ValueError,  # If column_format is not a valid string\n            ImportError # If Jinja2 is imported for latex\n    ):\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pandas/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pandas-dev/pandas\nlanguage: python\nmain_repo: https://github.com/pandas-dev/pandas\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- joe.lucas.0311@gmail.com\n"
  },
  {
    "path": "projects/paramiko/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip\nRUN git clone --depth 1 https://github.com/paramiko/paramiko\nWORKDIR paramiko\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/paramiko/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\ncd tests\ncp -rf $SRC/fuzz_*.py .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\nfor fuzzer in $(find . -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data _loop.py:.\ndone\n"
  },
  {
    "path": "projects/paramiko/fuzz_packetizer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer for Packetizer\"\"\"\n\nimport os\nimport sys\nimport atheris\n\nfrom hashlib import sha1\n\nfrom cryptography.hazmat.backends import default_backend\nfrom cryptography.hazmat.primitives.ciphers import algorithms, Cipher, modes\n\nfrom paramiko import Message, Packetizer\nfrom paramiko.common import byte_chr, zero_byte\n\n# Extract path of fuzzer so we can include loop.py\nif getattr(sys, 'frozen', False):\n    app_path = os.path.dirname(sys.executable)\nelif __file__:\n    app_path = os.path.dirname(__file__)\nelse:\n    raise Exception(\"Could not extract path needed to import loop.py\")\nsys.path.append(app_path)\nfrom _loop import LoopSocket\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    rsock = LoopSocket()\n    wsock = LoopSocket()\n    rsock.link(wsock)\n    p = Packetizer(wsock)\n    encryptor = Cipher(\n        algorithms.AES(zero_byte * 16),\n        modes.CBC(byte_chr(fdp.ConsumeIntInRange(0, 255)) * 16),\n        backend=default_backend(),\n    ).encryptor()\n    p.set_outbound_cipher(\n        encryptor,\n        16,\n        sha1,\n        12,\n        byte_chr(fdp.ConsumeIntInRange(0, 255)) * 20\n    )\n\n    m = Message()\n    # Messages need to be at least 16 bytes long, so we'll include\n    # at least 16 items.\n    for i in range(fdp.ConsumeIntInRange(16, 32)):\n        op = fdp.ConsumeIntInRange(0,5)\n        if op == 0:\n            m.add(fdp.ConsumeUnicodeNoSurrogates(20))\n        elif op == 1:\n            m.add(fdp.ConsumeIntInRange(0, 4294967295))\n        elif op == 2:\n            m.add(fdp.ConsumeBool())\n        elif op == 3:\n            l1 = list()\n            for i in range(1, 10):\n                l1.append(fdp.ConsumeUnicodeNoSurrogates(20))\n            m.add(l1)\n        elif op == 4:\n            m.add_bytes(fdp.ConsumeBytes(20))\n        elif op == 5:\n            m.add_byte(byte_chr(fdp.ConsumeIntInRange(0,255)))\n    p.send_message(m)\n    rsock.recv(sys.maxsize)\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/paramiko/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/paramiko/paramiko\nlanguage: python\nmain_repo: https://github.com/paramiko/paramiko\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/parse/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/r1chardj0n3s/parse parse\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/parse\n"
  },
  {
    "path": "projects/parse/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/parse/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1.1\n# Imports by the generated code\nimport parse\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  format_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  text = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  try:\n    parser = parse.Parser(format_str)\n    parser.parse(text)\n  except (ValueError, NotImplementedError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/parse/project.yaml",
    "content": "homepage: https://github.com/r1chardj0n3s/parse\nmain_repo: https://github.com/r1chardj0n3s/parse\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/parsimonious/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/erikrose/parsimonious parsimonious\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/parsimonious\n"
  },
  {
    "path": "projects/parsimonious/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/parsimonious/fuzz_grammar_match.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1.1\n# Imports by the generated code\nimport parsimonious\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  grammar_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  match_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  try:\n    grammar = parsimonious.grammar.Grammar(grammar_str)\n    grammar.match(match_str)\n  except (\n      parsimonious.exceptions.ParsimoniousError,\n      RuntimeError,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/parsimonious/project.yaml",
    "content": "homepage: https://github.com/erikrose/parsimonious\nmain_repo: https://github.com/erikrose/parsimonious\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/parso/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/davidhalter/parso parso\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/parso\n"
  },
  {
    "path": "projects/parso/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzz.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/parso/parso_diff_fuzz.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport parso\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  grammar = parso.load_grammar()\n  try:\n    module = parso.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    if module != None:\n      diff_parser = parso.python.diff.DiffParser(grammar._pgen_grammar,\n                                                 grammar._tokenizer, module)\n      diff_parser.update([\"line1\"], [\"newline1\"])\n  except RecursionError:\n    # Not interesting\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/parso/parso_extended_fuzz.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport parso\n\n\ndef fuzz_dump(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    module = parso.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    if module is not None:\n        module.dump()\n  except RecursionError:\n    # Not interesting\n    pass\n\n\ndef fuzz_errors(data, version):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    grammar = parso.load_grammar(version = version)\n    module = grammar.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    grammar.iter_errors(module)\n  except RecursionError:\n    # Not interesting\n    pass\n\n\ndef TestOneInput(data):\n  fuzz_dump(data)\n  fuzz_errors(data, '3.6')\n  fuzz_errors(data, '3.7')\n  fuzz_errors(data, '3.8')\n  fuzz_errors(data, '3.9')\n  fuzz_errors(data, '3.10')\n  fuzz_errors(data, '3.11')\n  fuzz_errors(data, '3.12')\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/parso/parso_fuzz.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport parso\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    parso.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except RecursionError:\n    # Not interesting\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/parso/parso_pep8_fuzz.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport parso\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    grammar = parso.load_grammar()\n    module = parso.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    if module != None:\n        grammar._get_normalizer_issues(module)\n  except RecursionError:\n    # Not interesting\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/parso/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/davidhalter/parso\nlanguage: python\nmain_repo: https://github.com/davidhalter/parso\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pasta/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/google/pasta pasta\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pasta\n"
  },
  {
    "path": "projects/pasta/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pasta/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport pasta\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    pasta.parse(fdp.ConsumeUnicodeNoSurrogates(8096))\n  except (\n    SyntaxError, # thrown by ast fast\n    ValueError,  # thrown by ast fast\n    pasta.base.annotate.AnnotationError, # pasta-thrown error\n    MemoryError, # For stack overflows\n    RecursionError # Not interesting\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pasta/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/google/pasta\nlanguage: python\nmain_repo: https://github.com/google/pasta\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pathlib2/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/jazzband/pathlib2 pathlib2\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pathlib2\n"
  },
  {
    "path": "projects/pathlib2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pathlib2/fuzz_match.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1.1\n# Imports by the generated code\nimport pathlib2\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  path = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  matcher = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  try:\n    ppath = pathlib2.PurePath(path)\n    ppath.match(matcher)\n  except(ValueError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pathlib2/fuzz_posix_compile.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport pathlib2\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  path = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  posix_path = pathlib2._PosixFlavour()\n  posix_path.compile_pattern(path)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pathlib2/fuzz_windows_compile.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport pathlib2\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  path = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  windows_path = pathlib2._WindowsFlavour()\n  windows_path.compile_pattern(path)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pathlib2/project.yaml",
    "content": "homepage: https://github.com/jazzband/pathlib2\nmain_repo: https://github.com/jazzband/pathlib2\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pborman-uuid/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/pborman/uuid\nWORKDIR $SRC/uuid\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/pborman-uuid/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/fuzz_test.go ./\ngo mod tidy\nprintf \"package uuid\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/pborman/uuid FuzzParseBytes FuzzParseBytes\n"
  },
  {
    "path": "projects/pborman-uuid/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage uuid\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzParseBytes(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data []byte) {\n\t\t_, _ = ParseBytes(data)\n\t})\n}\n"
  },
  {
    "path": "projects/pborman-uuid/project.yaml",
    "content": "homepage: \"https://github.com/pborman/uuid\"\nlanguage: go\nmain_repo: \"https://github.com/pborman/uuid\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/pcapplusplus/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y cmake autoconf flex bison\nRUN git clone --depth=1 https://github.com/seladb/PcapPlusPlus PcapPlusPlus\n\n# Get tcpdump's test pcaps as seed corpus\nRUN git clone --depth=1 https://github.com/the-tcpdump-group/tcpdump.git tcpdump\nRUN git clone --depth=1 https://github.com/the-tcpdump-group/libpcap.git libpcap\n\nWORKDIR PcapPlusPlus\n\nCOPY *.sh pcapplusplus_enable_tests.diff $SRC/\n"
  },
  {
    "path": "projects/pcapplusplus/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# TODO: Right now, we apply patch only if sanitizer is not 'memory'.\n# TODO: Upstream the patch to PcapPlusPlus repo.\ngit -C \"$SRC/PcapPlusPlus\" apply \"$SRC/pcapplusplus_enable_tests.diff\"\n$SRC/PcapPlusPlus/Tests/Fuzzers/ossfuzz.sh\n"
  },
  {
    "path": "projects/pcapplusplus/pcapplusplus_enable_tests.diff",
    "content": "diff --git a/Tests/Fuzzers/ossfuzz.sh b/Tests/Fuzzers/ossfuzz.sh\nindex 6d461ff6..ec272b5b 100755\n--- a/Tests/Fuzzers/ossfuzz.sh\n+++ b/Tests/Fuzzers/ossfuzz.sh\n@@ -12,7 +12,13 @@ make -j$(nproc)\n # Build PcapPlusPlus linking statically against the built libpcap\n cd $SRC/PcapPlusPlus\n LIBPCAP_PATH=$SRC/libpcap/\n-cmake -DPCAPPP_BUILD_FUZZERS=ON -DPCAPPP_BUILD_TESTS=OFF -DPCAPPP_BUILD_EXAMPLES=OFF -DPCAP_INCLUDE_DIR=\"${LIBPCAP_PATH}/\" -DPCAP_LIBRARY=\"${LIBPCAP_PATH}/libpcap.a\" -S . -B $TARGETS_DIR\n+\n+PCAPPP_BUILD_TESTS_VALUE=\"ON\"\n+if [ \"${SANITIZER:-}\" = \"memory\" ]; then\n+    PCAPPP_BUILD_TESTS_VALUE=\"OFF\"\n+fi\n+\n+cmake -DCMAKE_CXX_STANDARD=20 -DPCAPPP_BUILD_FUZZERS=ON -DPCAPPP_BUILD_TESTS=$PCAPPP_BUILD_TESTS_VALUE -DPCAPPP_BUILD_EXAMPLES=OFF -DPCAP_INCLUDE_DIR=\"${LIBPCAP_PATH}/\" -DPCAP_LIBRARY=\"${LIBPCAP_PATH}/libpcap.a\" -S . -B $TARGETS_DIR\n cmake --build $TARGETS_DIR -j\n \n # Copy target and options\n"
  },
  {
    "path": "projects/pcapplusplus/project.yaml",
    "content": "homepage: \"https://github.com/seladb/PcapPlusPlus\"\nlanguage: c++\nprimary_contact: \"pcapplusplus@gmail.com\"\nauto_ccs:\n  - \"zlowram@gmail.com\"\n  - \"aleksandrosansan@gmail.com\"\n  - \"peron.clem@gmail.com\"\n  - \"egecetin97@gmail.com\"\nfuzzing_engines:\n  - afl\n  - libfuzzer\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/seladb/PcapPlusPlus'\ncoverage_extra_args: -ignore-filename-regex=/libpcap/ -ignore-filename-regex=/PcapPlusPlus/3rdParty/\n"
  },
  {
    "path": "projects/pcapplusplus/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_stack_use_after_return=0:detect_leaks=0:abort_on_error=0:halt_on_error=0:exitcode=0\nROOT=\"$SRC/PcapPlusPlus\"\n\necho \"=== Packet++Test ===\"\ncd \"$ROOT/Tests/Packet++Test\"\n# TODO: Skipping failing tests.\n./Bin/Packet++Test -x \"VrrpCreateAndEditTest;TestMacAddress;TestTcpReassemblyRetran\"\n\necho \"=== Pcap++Test (no networking) ===\"\ncd \"$ROOT/Tests/Pcap++Test\"\n# TODO: Skipping failing tests. TestPcapLiveDeviceList and\n# TestPcapLiveDeviceNoNetworking fail because of network so we should keep\n# them disabled.\n./Bin/Pcap++Test \\\n    -n -x \\\n    \"TestMacAddress;TestTcpReassemblyRetran;TestTcpReassemblyMissingData;TestPcapLiveDeviceList;TestPcapLiveDeviceNoNetworking\"\n"
  },
  {
    "path": "projects/pcl/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! This project was pinned after a clang bump. Please remove the pin, Try to fix any build warnings and errors, as well as runtime errors\nRUN apt-get update && apt-get install -y make cmake autoconf \\\n    automake libtool gettext pkg-config build-essential \\\n    mercurial wget libeigen3-dev libflann-dev python python-dev \n    \n# VTK deps\nRUN apt-get update && apt-get install -y \\\n    libavcodec-dev libavformat-dev libavutil-dev libboost-dev \\\n    libdouble-conversion-dev libeigen3-dev libexpat1-dev \\\n    libfontconfig-dev libfreetype6-dev libgdal-dev libglew-dev \\\n    libhdf5-dev libjpeg-dev libjsoncpp-dev liblz4-dev liblzma-dev \\\n    libnetcdf-dev libnetcdf-cxx-legacy-dev libogg-dev libpng-dev \\\n    libpython3-dev libqt5opengl5-dev libqt5x11extras5-dev libsqlite3-dev \\\n    libswscale-dev libtheora-dev libtiff-dev libxml2-dev libxt-dev \\\n    qtbase5-dev qttools5-dev zlib1g-dev\n\n# Install and build boost from source so we can have it use libc++\nRUN wget https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.gz && \\\n    tar xzf boost_1_85_0.tar.gz && \\\n    cd boost_1_85_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang cxxflags=\"-stdlib=libc++\" linkflags=\"-stdlib=libc++\" -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_85_0\n\nRUN git clone --depth 1 https://github.com/PointCloudLibrary/pcl\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/pcl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nchmod +x $SRC/pcl/test/fuzz/build.sh\n$SRC/pcl/test/fuzz/build.sh\n"
  },
  {
    "path": "projects/pcl/project.yaml",
    "content": "main_repo: \"https://github.com/pointcloudlibrary/pcl\"\nhomepage: \"http://pointclouds.org\"\nlanguage: c++\nprimary_contact: \"kunal.tyagi.3.1994@gmail.com\"\nauto_ccs:\n  - \"tyagi.kunal@live.com\"\n  - \"larshg@gmail.com\"\n  - \"markus95.vieth@gmail.com\"\n  - \"k.koide.aist@gmail.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/pcre2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool subversion\n\nRUN git clone --recursive https://github.com/PCRE2Project/pcre2 pcre2\nWORKDIR pcre2\nCOPY build.sh run_tests.sh replay_build.sh $SRC/\n"
  },
  {
    "path": "projects/pcre2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\n./autogen.sh\n./configure --enable-fuzz-support \\\n    --enable-never-backslash-C --with-match-limit=1000000 --with-match-limit-depth=1000000 \\\n    --enable-jit \\\n    --enable-pcre2-16 --enable-pcre2-32\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n# build fuzzers\n$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer \\\n    $LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a\n$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_16 \\\n    $LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-16.a .libs/libpcre2-16.a\n$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_32 \\\n    $LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-32.a .libs/libpcre2-32.a\n\n# test different link sizes\nfor i in $(seq 3 4); do\n    ./configure --enable-fuzz-support \\\n        --enable-never-backslash-C --with-match-limit=1000000 --with-match-limit-depth=1000000 \\\n        --enable-jit \\\n        --enable-pcre2-16 --enable-pcre2-32 --with-link-size=${i}\n    make -j$(nproc) clean\n    make -j$(nproc) all\n\n    # build fuzzers\n    $CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_${i}l \\\n        $LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a\n    $CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_16_${i}l \\\n        $LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-16.a .libs/libpcre2-16.a\n    $CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_32_${i}l \\\n        $LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-32.a .libs/libpcre2-32.a\ndone\n\n# set up dictionary and options to use it\nfor bits in \"\" \"_16\" \"_32\"; do\n  cp \"testdata/fuzzing/pcre2_fuzzer${bits}.dict\" \"${OUT}/pcre2_fuzzer${bits}.dict\"\n  for linksize in \"\" \"_3l\" \"_4l\"; do\n    cp \"testdata/fuzzing/pcre2_fuzzer${bits}.options\" \"${OUT}/pcre2_fuzzer${bits}${linksize}.options\"\n  done\ndone\n"
  },
  {
    "path": "projects/pcre2/project.yaml",
    "content": "homepage: \"http://www.pcre.org/\"\nlanguage: c++\nprimary_contact: \"nicholas@nickcwilson.co.uk\"\nmain_repo: \"https://github.com/PCRE2Project/pcre2\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nauto_ccs:\n  - \"carenas@gmail.com\"\n  - \"me@addisoncrump.info\"\n  - \"philip.hazel@gmail.com\"\n"
  },
  {
    "path": "projects/pcre2/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nulimit -s 65536\nmake check\n"
  },
  {
    "path": "projects/pdf-js/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/mozilla/pdf.js pdf-js\nWORKDIR pdf-js\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/pdf-js/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nnpm install --save-dev @jazzer.js/core \nnpm install -g gulp-cli\n\ngulp image_decoders\n\ncompile_javascript_fuzzer pdf-js test/fuzz/jpeg_image.fuzz --sync\ncompile_javascript_fuzzer pdf-js test/fuzz/jbig2_image.fuzz --sync\ncompile_javascript_fuzzer pdf-js test/fuzz/jpx_image.fuzz --sync\n"
  },
  {
    "path": "projects/pdf-js/project.yaml",
    "content": "homepage: \"https://github.com/mozilla/pdf.js\"\nlanguage: javascript\nprimary_contact: \"mcastelluccio@mozilla.com\"\nmain_repo: \"https://github.com/mozilla/pdf.js\"\nvendor_ccs:\n  - maxnair.dev@gmail.com\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - none\n"
  },
  {
    "path": "projects/pdfbox/.gitignore",
    "content": "project-parent/pdfbox\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/pdfbox/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#We need a modern version of mupdf-tools.\n#In the version of mutools that is brought in with oss-fuzz base as of 28 Aug 2025,\n#only some font types have \"font-\" prepended as their name. This breaks\n#globbing, and, separately, we don't want to use such an old version.\n\n#So, we can either build it or simply use an OS that comes with a more recent version\n#I'm choosing the latter.\nFROM ubuntu:questing-20250806 AS base\n\nRUN set -eux \\\n    && apt-get update \\\n    && apt-get install --yes --no-install-recommends \\\n    mupdf-tools curl ca-certificates unzip zip && \\\n    apt-get clean\n\n#pull an arbitrary zip of 1k pdfs\nRUN mkdir /work && \\\n     curl -L https://digitalcorpora.s3.amazonaws.com/corpora/files/CC-MAIN-2021-31-PDF-UNTRUNCATED/zipfiles/5000-5999/5136.zip \\\n    --output /work/PDFExtractTextFuzzer_seed_corpus.zip\nCOPY extract-fonts.sh /work/extract-fonts.sh\nRUN cd /work && /bin/bash extract-fonts.sh && rm extract-fonts.sh\n\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nCOPY --from=base /work/*_seed_corpus.zip $SRC\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/pdf.dict $SRC/PDFStreamParserFuzzer.dict && \\\n    cp fuzzing/dictionaries/pdf.dict $SRC/PDFWriteReadFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\n# if not set python infra helper cannot be used for local testing\nENV MVN=$SRC/maven/apache-maven-3.9.11/bin/mvn\n\nCOPY project-parent $SRC/project-parent/\nRUN rm -rf $SRC/project-parent/pdfbox\nRUN git clone --depth 1 https://github.com/apache/pdfbox/ $SRC/project-parent/pdfbox\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/project-parent/pdfbox"
  },
  {
    "path": "projects/pdfbox/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=pdfbox\nPROJECT_GROUP_ID=org.apache.pdfbox\nPROJECT_ARTIFACT_ID=pdfbox\nMAIN_REPOSITORY=https://github.com/apache/pdfbox/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nsed -i 's/<proc>full<\\/proc>/<!-- asd -->/g' $SRC/project-parent/pdfbox/debugger/pom.xml\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd $SRC/project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move dictionaries and seed corpora.\n  mv $SRC/*.dict $OUT\n  mv $SRC/*.zip $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi\n"
  },
  {
    "path": "projects/pdfbox/extract-fonts.sh",
    "content": "#!/bin/bash\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir tmp\nmkdir fonts\nunzip PDFExtractTextFuzzer_seed_corpus.zip -d pdfs\n\n#start with a zip of pdfs\n#use mutool to extract the fonts and images\n#keep the fonts. get rid of the images\n#If there's a more efficient way to extract just the fonts, we should implement that\n\nfor file in pdfs/*.pdf; do\n    echo \"$(basename $file)\"\n    cp \"$file\" tmp\n    cd tmp\n    mutool extract \"$(basename $file)\"\n    FONTS=($(find . -name \"font-*\" -printf '%P\\n' 2>/dev/null))\n    for fnt in \"${FONTS[@]}\"; do\n        if [ ! -d \"../fonts/${fnt##*.}\" ]; then\n            mkdir \"../fonts/${fnt##*.}\"\n        fi\n        cp \"$fnt\" \"../fonts/${fnt##*.}/$(basename $file)-$fnt\"\n    done\n    cd ..\n    rm -rf tmp/*\ndone\n\nif [ -d \"fonts/cff\" ]; then\n    cd fonts/cff\n    zip CFFParserFuzzer_seed_corpus.zip *.cff\n    mv CFFParserFuzzer_seed_corpus.zip ../..\n    cd ../..\nfi\n\nif [ -d \"fonts/otf\" ]; then\n    cd fonts/otf\n    zip OTFParserFuzzer_seed_corpus.zip *.otf\n    mv OTFParserFuzzer_seed_corpus.zip ../.. \n    cd ../.. \nfi\n\nif [ -d \"fonts/ttf\" ]; then\n    cd fonts/ttf\n    zip TTFParserFuzzer_seed_corpus.zip *.ttf\n    mv TTFParserFuzzer_seed_corpus.zip ../.. \n    cd ../.. \nfi\n\nif [ -d \"fonts/cid\" ]; then\n    cd fonts/cid\n    zip CMapParserFuzzer_seed_corpus.zip *.cid\n    mv CMapParserFuzzer_seed_corpus.zip ../..\n    cd ../.. \nfi\n\nif [ -d \"fonts/pfa\" ]; then\n    cd fonts/pfa\n    zip PFAParserFuzzer_seed_corpus.zip *.pfa\n    mv PFAParserFuzzer_seed_corpus.zip ../..\n    cd ../.. \nfi\n\nrm -rf fonts pdfs tmp\n"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.pdfbox</groupId>\n            <artifactId>pdfbox</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.apache.logging.log4j</groupId>\n            <artifactId>log4j-core</artifactId>\n            <version>2.24.3</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/CFFParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.fontbox.cff.CFFParser;\nimport org.apache.pdfbox.io.RandomAccessRead;\nimport org.apache.pdfbox.io.RandomAccessReadBuffer;\n\nclass CFFParserFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        byte [] bytes = data.consumeRemainingAsBytes();\n        CFFParser parser = new CFFParser();\n        try (RandomAccessRead buffer = new RandomAccessReadBuffer(bytes)) {\n            parser.parse(buffer);\n        } catch (IOException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/CMapParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/// /////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.fontbox.cmap.CMapParser;\nimport org.apache.pdfbox.io.RandomAccessRead;\nimport org.apache.pdfbox.io.RandomAccessReadBuffer;\n/**\n * the .cid files extracted my mutool aren't pure character maps\n * On a random selection, it looks like the CMapParser can parse ~30%\n * without an exception. We should figure out why the other cid files\n * aren't parsing, but they are a close enough fit for seeds for now.\n */\npublic class CMapParserFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        byte[] bytes = data.consumeRemainingAsBytes();\n        try (RandomAccessRead buffer = new RandomAccessReadBuffer(bytes)) {\n            new CMapParser().parse(buffer);\n        } catch (IOException e) {\n        }\n\n    }\n}"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/OTFParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.fontbox.ttf.OTFParser;\nimport org.apache.pdfbox.io.RandomAccessRead;\nimport org.apache.pdfbox.io.RandomAccessReadBuffer;\n\nclass OTFParserFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        byte [] bytes = data.consumeRemainingAsBytes();\n        OTFParser parser = new OTFParser();\n        try (RandomAccessRead buffer = new RandomAccessReadBuffer(bytes)) {\n            parser.parse(buffer);\n        } catch (IOException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/PDFExtractTextFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.pdfbox.Loader;\nimport org.apache.pdfbox.io.RandomAccessRead;\nimport org.apache.pdfbox.io.RandomAccessReadBuffer;\nimport org.apache.pdfbox.pdmodel.PDDocument;\nimport org.apache.pdfbox.text.PDFTextStripper;\n\nclass PDFExtractTextFuzzer {\n\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        byte [] bytes = data.consumeRemainingAsBytes();\n\n        try (RandomAccessRead buffer = new RandomAccessReadBuffer(bytes)) {\n            PDDocument pdDocument = Loader.loadPDF(buffer);\n            String txt = new PDFTextStripper().getText(pdDocument);\n        } catch (IOException | IllegalArgumentException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/PDFStreamParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.IOException;\nimport java.util.logging.LogManager;\n\nimport org.apache.pdfbox.pdfparser.PDFStreamParser;\nimport org.junit.jupiter.api.BeforeAll;\n\n\nclass PDFStreamParserFuzzer {\n\n    @BeforeAll\n    static void setUp() {\n        LogManager.getLogManager().reset();\n    }\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        byte [] bytes = data.consumeRemainingAsBytes();\n\n        try {\n            PDFStreamParser pdfStreamParser = new PDFStreamParser(bytes);\n            pdfStreamParser.parse();\n        } catch (IOException e) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/PDFWriteReadFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.logging.LogManager;\n\nimport org.apache.pdfbox.Loader;\nimport org.apache.pdfbox.pdmodel.PDPage;\nimport org.apache.pdfbox.pdmodel.PDDocument;\nimport org.apache.pdfbox.pdmodel.font.PDType1Font;\nimport org.apache.pdfbox.pdmodel.PDPageContentStream;\nimport org.apache.pdfbox.text.PDFTextStripper;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\n\nimport static org.apache.pdfbox.pdmodel.font.Standard14Fonts.FontName;\n\n\nclass PDFWriteReadFuzzer {\n    static String fileName = \"fuzz.pdf\";\n    static File myFile = new File(fileName);\n\n    @BeforeAll\n    static void setUp() {\n        LogManager.getLogManager().reset();\n    }\n\n    @AfterAll\n    static void cleanUp() {\n        myFile.delete();\n    }\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            PDDocument doc = new PDDocument();\n\n            for (int i = 0; i < data.consumeInt(0, 50); ++i) {\n                PDPage myPage = new PDPage();\n                doc.addPage(myPage);\n                try (PDPageContentStream cont = new PDPageContentStream(doc, myPage)) {\n                    cont.beginText();\n\n                    cont.setFont(new PDType1Font(data.pickValue(FontName.values())), data.consumeInt());\n                    cont.setLeading(data.consumeFloat());\n                    cont.newLineAtOffset(data.consumeInt(), data.consumeInt());\n                    String line = data.consumeString(10000);\n                    cont.showText(line);\n                    cont.newLine();\n\n                    cont.endText();\n                }\n            }\n            doc.save(fileName);\n\n            doc = Loader.loadPDF(myFile);\n            PDFTextStripper stripper = new PDFTextStripper();\n            String text = stripper.getText(doc);\n        } catch (IOException | IllegalArgumentException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/PFAParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/// /////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.fontbox.type1.Type1Font;\n\n/**\n * This attempts to parse type1 fonts that are extracted as *.pfa by mutool.\n * In the PDF, there are entries for where to split the font file.\n * We're just grepping for eexec and splitting there.\n */\npublic class PFAParserFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        byte[] bytes = data.consumeRemainingAsBytes();\n        int split = findSplit(bytes);\n        if (split < 0) {\n            //split in the middle if there are sufficient bytes\n            if (bytes.length < 10) {\n                return;\n            }\n            split = bytes.length / 2;\n        }\n        byte[] seg1 = new byte[split];\n        byte[] seg2 = new byte[bytes.length - split];\n        System.arraycopy(bytes, 0, seg1, 0, split);\n        System.arraycopy(bytes, split, seg2, 0, bytes.length - split);\n        try {\n            Type1Font.createWithSegments(seg1, seg2);\n        } catch (IOException e) {\n        }\n\n    }\n\n    private static int findSplit(byte[] bytes) {\n        for (int i = 0; i < bytes.length - 6; i++) {\n            if ('e' == (char) bytes[i] &&\n                    'e' == (char) bytes[i + 1] &&\n                    'x' == (char) bytes[i + 2] &&\n                    'e' == (char) bytes[i + 3] &&\n                    'c' == (char) bytes[i + 4]\n                //TODO -- check for new lines?\n            ) {\n                return i + 6;\n            }\n        }\n        return -1;\n    }\n}"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/java/com/example/TTFParserFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport java.io.IOException;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.fontbox.ttf.TTFParser;\nimport org.apache.pdfbox.io.RandomAccessRead;\nimport org.apache.pdfbox.io.RandomAccessReadBuffer;\n\npublic class TTFParserFuzzer {\n\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        byte [] bytes = data.consumeRemainingAsBytes();\n        TTFParser parser = new TTFParser();\n        try (RandomAccessRead buffer = new RandomAccessReadBuffer(bytes)) {\n            parser.parse(new RandomAccessReadBuffer(bytes));\n        } catch (IOException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/pdfbox/project-parent/fuzz-targets/src/test/resources/log4j2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Configuration status=\"INFO\">\n  <Appenders>\n    <Console name=\"Console\" target=\"SYSTEM_OUT\">\n      <PatternLayout pattern=\"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n\"/>\n    </Console>\n  </Appenders>\n  <Loggers>\n    <Root level=\"INFO\">\n      <AppenderRef ref=\"Console\"/>\n    </Root>\n    <Logger name=\"org.apache.pdfbox\" level=\"OFF\" additivity=\"false\">\n      <AppenderRef ref=\"Console\"/>\n    </Logger>\n    <Logger name=\"org.apache.fontbox\" level=\"OFF\" additivity=\"false\">\n      <AppenderRef ref=\"Console\"/>\n    </Logger>\n  </Loggers>\n</Configuration>"
  },
  {
    "path": "projects/pdfbox/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>pdfbox</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/pdfbox/project.yaml",
    "content": "homepage: \"https://pdfbox.apache.org/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/apache/pdfbox/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/pdfminersix/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN mkdir $SRC/corpus\nRUN git clone --depth 1 https://github.com/pdfminer/pdfminer.six.git pdfminer.six \\\n        && cp pdfminer.six/fuzzing/build.sh $SRC/ \\\n\t&& mkdir -p $SRC/corpus \\\n\t&& find \"pdfminer.six/samples/\" -type f -exec cp {} \"$SRC/corpus\" \\;\nWORKDIR $SRC/pdfminer.six\n\n"
  },
  {
    "path": "projects/pdfminersix/project.yaml",
    "content": "homepage: \"https://pdfminersix.readthedocs.io/en/latest/\"\nlanguage: python\nprimary_contact: \"pietermarsman@gmail.com\"\nauto_ccs:\n  - \"capuanobailey@gmail.com\"\n  - \"dhdaines@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/pdfminer/pdfminer.six\"\nfile_github_issue: True\n"
  },
  {
    "path": "projects/pdfplumber/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN mkdir $SRC/corpus\n\n# Upstream wants fuzzers hosted elsewhere, so pull them from fork (https://github.com/jsvine/pdfplumber/pull/1245#issuecomment-2581682100)\nRUN git clone --depth 1 https://github.com/ennamarie19/pdfplumber.git pdfplumber_fuzzer\n\nRUN git clone --depth 1 --branch develop https://github.com/jsvine/pdfplumber.git pdfplumber \\\n        && rm -rf pdfplumber/fuzz  # Remove the directory, if it exists\nRUN cp -r pdfplumber_fuzzer/fuzz pdfplumber \\\n        && cp pdfplumber/fuzz/build.sh $SRC/\nWORKDIR $SRC/pdfplumber\n\n"
  },
  {
    "path": "projects/pdfplumber/project.yaml",
    "content": "homepage: \"https://github.com/jsvine/pdfplumber\"\nlanguage: python\nprimary_contact: \"jsvine@gmail.com\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/jsvine/pdfplumber.git\"\n"
  },
  {
    "path": "projects/pdoc/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/pdoc3/pdoc pdoc\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pdoc\n"
  },
  {
    "path": "projects/pdoc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pdoc/fuzz_html_helpers.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-2\n# Imports by the generated code\nfrom pdoc.html_helpers import extract_toc\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_text = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n  extract_toc(fuzz_text)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pdoc/project.yaml",
    "content": "homepage: https://github.com/pdoc3/pdoc\nmain_repo: https://github.com/pdoc3/pdoc\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pem/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN python3 -m pip install --upgrade pip \\\n    && python3 -m pip install 'pyinstaller==6.10.0' 'setuptools==72.1.0' twisted\nRUN git clone --depth 1 https://github.com/hynek/pem\nRUN urls=\"\\\nhttps://raw.githubusercontent.com/google/fuzzing/master/dictionaries/pem.dict \\\nhttps://raw.githubusercontent.com/google/fuzzing/master/dictionaries/utf8.dict\" \\\n  && target_file=\"$SRC/__base.dict\" \\\n  && echo $urls | xargs -n 1 wget -qO- >> $target_file\nWORKDIR pem\nCOPY build.sh *.py *.pem $SRC/\n"
  },
  {
    "path": "projects/pem/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\n\nmake_dictionary_for_fuzz_harness() {\n  local fuzz_harness=\"$1\"\n  local base_dictionary=\"$SRC/__base.dict\"\n  local output_dict=\"$OUT/${fuzz_harness##*/}\"\n  output_dict=\"${output_dict%.py}.dict\"\n\n  [[ -r \"$base_dictionary\" ]] && {\n    [[ -s \"$output_dict\" ]] && echo >>\"$output_dict\"\n    cat \"$base_dictionary\" >>\"$output_dict\"\n  }\n}\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\n  make_dictionary_for_fuzz_harness \"$fuzzer\"\ndone\n\nzip -rj $OUT/fuzz_pem_seed_corpus.zip $SRC/data.pem\n"
  },
  {
    "path": "projects/pem/data.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIBfDCCATagAwIBAgIJAK94OSlzVBsWMA0GCSqGSIb3DQEBBQUAMBYxFDASBgNV\nBAMTC3BlbS5pbnZhbGlkMB4XDTEzMDcxNzE0NDAyMFoXDTIzMDcxNTE0NDAyMFow\nFjEUMBIGA1UEAxMLcGVtLmludmFsaWQwTDANBgkqhkiG9w0BAQEFAAM7ADA4AjEA\nvtIM2QADJDHcqxZugx7MULbenrNUFrmoMDfEaedYveWY3wBxOw642L4nFWxN/fwL\nAgMBAAGjdzB1MB0GA1UdDgQWBBQ4O0ZSUfTA6C+Y+QZ3MpeMhysxYjBGBgNVHSME\nPzA9gBQ4O0ZSUfTA6C+Y+QZ3MpeMhysxYqEapBgwFjEUMBIGA1UEAxMLcGVtLmlu\ndmFsaWSCCQCveDkpc1QbFjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAAzEA\nXwKIF+Kf4OhcqbdQp253HG2KBt/WZwvNLo/bBlkrGYwfacbGuWT8nKJG70ujdKKf\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "projects/pem/fuzz_pem.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    import pem\n\ndef TestOneInput(data):\n    certs = pem.parse(data)\n    if len(certs) == 0:\n        return\n    # Access properties\n    s1 = certs[0].sha1_hexdigest\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pem/project.yaml",
    "content": "homepage: \"https://github.com/hynek/pem\"\nlanguage: python\nmain_repo: \"https://github.com/hynek/pem\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/pendulum/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip tzdata\nRUN git clone https://github.com/sdispater/pendulum pendulum\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pendulum\n"
  },
  {
    "path": "projects/pendulum/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --hidden-import=tzdata\ndone\n"
  },
  {
    "path": "projects/pendulum/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport pendulum\n\n\ndef TestOneInput(data):\n  if len(data) == 0:\n    return\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    pendulum.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except pendulum.parsing.exceptions.ParserError:\n    pass\n  except ValueError:\n    # Runs into this quickly\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pendulum/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/sdispater/pendulum\nlanguage: python\nmain_repo: https://github.com/sdispater/pendulum\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/perfetto/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update\nRUN apt-get -y install python curl\n\nRUN git clone --depth=1 https://android.googlesource.com/platform/external/perfetto/ $SRC/perfetto\n\nRUN $SRC/perfetto/infra/oss-fuzz/init_container\n\nWORKDIR $SRC/perfetto\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/perfetto/build.sh",
    "content": "#!/bin/bash\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"$CFLAGS -Wno-extra-semi-stmt\"\nexport CXXFLAGS=\"$CXXFLAGS -Wno-extra-semi-stmt\"\n\n$SRC/perfetto/infra/oss-fuzz/build_fuzzers\n"
  },
  {
    "path": "projects/perfetto/project.yaml",
    "content": "homepage: \"https://perfetto.dev\"\nlanguage: c++\nprimary_contact: \"hjd@google.com\"\nauto_ccs:\n  - \"hjd@google.com\"\n  - \"lalitm@google.com\"\n  - \"octaviant@google.com\"\n  - \"perfetto-oss-fuzz@google.com\"\n  - \"primiano@google.com\"\n  - \"rsavitski@google.com\"\n  - \"eseckler@google.com\"\n  - \"altimin@google.com\"\n  - \"ddiproietto@google.com\"\nvendor_ccs:\n  - adambacchus@google.com\n  - ailport@google.com\n  - bcreasey@google.com\n  - cunefare@google.com\n  - ejorgensen@google.com\n  - faerber@google.com\n  - greendonald@google.com\n  - hamzeh@google.com\n  - jaredkidd@google.com\n  - kimtony@google.com\n  - lindsaywells@google.com\n  - maverickm@google.com\n  - swansonr@google.com\n  - warrenwright@google.com\nfuzzing_engines:\n- libfuzzer\n- honggfuzz\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://android.googlesource.com/platform/external/perfetto/'\n"
  },
  {
    "path": "projects/pest/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust as builder\n\n## Install build dependencies.\nRUN apt-get update\nRUN git clone --depth 1 https://github.com/pest-parser/pest.git\n# needed for MSAN and coverage build\nRUN rustup component add rust-src\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/pest/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/pest/meta\nRUSTFLAGS=\"\" cargo bootstrap\ncargo fuzz build\ncd $SRC/pest/grammars\ncargo fuzz build\ncp $SRC/pest/meta/fuzz/target/x86_64-unknown-linux-gnu/release/parser $OUT/\ncp $SRC/pest/grammars/fuzz/target/x86_64-unknown-linux-gnu/release/toml $OUT/\ncp $SRC/pest/grammars/fuzz/target/x86_64-unknown-linux-gnu/release/json $OUT/\ncp $SRC/pest/grammars/fuzz/target/x86_64-unknown-linux-gnu/release/http $OUT/\n"
  },
  {
    "path": "projects/pest/project.yaml",
    "content": "homepage: \"https://github.com/pest-parser/pest\"\nlanguage: rust\nprimary_contact: \"jstnlefebvre@gmail.com\"\nauto_ccs:\n  - \"therealcad97@gmail.com\"\n  - \"flying-sheep@web.de\"\n  - \"nbtheduke@gmail.com\"\n  - \"me@tomtau.be\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/pest-parser/pest'\n"
  },
  {
    "path": "projects/pffft/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y mercurial\nRUN python -m pip install numpy\nRUN git clone https://bitbucket.org/jpommier/pffft $SRC/pffft\nWORKDIR pffft\nCOPY run_tests.sh build.sh $SRC/\n# TODO(alessiob): Move the fuzzing source code to pffft upstream.\nCOPY generate_seed_corpus.py $SRC/pffft\nCOPY pffft_fuzzer.cc $SRC/pffft\n"
  },
  {
    "path": "projects/pffft/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_DIR=$SRC/pffft\ncd $WORK\n\n# Deploy the seed corpus.\nSEED_CORPUS_ZIP_PATH=$OUT/pffft_fuzzers_seed_corpus.zip\nif [ -d seed_corpus_tmp ]; then \n  rm -fr seed_corpus_tmp\nfi\nmkdir seed_corpus_tmp\npython $SRC_DIR/generate_seed_corpus.py seed_corpus_tmp\ncd seed_corpus_tmp\nzip -q $SEED_CORPUS_ZIP_PATH ./*\ncd ..\nrm -fr seed_corpus_tmp\n\nbuild_fuzzer() {\n  # Aliases for the arguments.\n  fft_transform=$1\n\n  # Fuzzer name.\n  fuzz_target_name=pffft_${fft_transform,,}_fuzzer\n\n  # Add a symbolic link for the seed corpus (same corpus for all the\n  # generated fuzzers).\n  ls -la $OUT/*.zip\n  FUZZER_SEED_CORPUS_PATH=$OUT/${fuzz_target_name}_seed_corpus.zip\n  if [ -e $FUZZER_SEED_CORPUS_PATH ]; then\n    rm $FUZZER_SEED_CORPUS_PATH\n  fi\n  ln -s $SEED_CORPUS_ZIP_PATH $FUZZER_SEED_CORPUS_PATH\n\n  # Compile fuzzer.\n  $CXX $CXXFLAGS -std=c++11 -msse2 \\\n       -DTRANSFORM_${fft_transform} \\\n       $SRC/pffft/pffft.c $SRC/pffft/pffft_fuzzer.cc \\\n       -o $OUT/${fuzz_target_name} \\\n       $LIB_FUZZING_ENGINE\n}\n\n# Build fuzzers.\nbuild_fuzzer REAL\nbuild_fuzzer COMPLEX\n\n# Build unit test\n$CXX $CXXFLAGS -x c -o $SRC/test_pffft_real -DTRANSFORM_REAL -msse2 \\\n  $SRC/pffft/pffft.c $SRC/pffft/test_pffft.c $SRC/pffft/fftpack.c\n$CXX $CXXFLAGS -x c -o $SRC/test_pffft_complex -DTRANSFORM_COMPLEX -msse2 \\\n  $SRC/pffft/pffft.c $SRC/pffft/test_pffft.c $SRC/pffft/fftpack.c\n"
  },
  {
    "path": "projects/pffft/generate_seed_corpus.py",
    "content": "from __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport sys\n\nimport numpy as np\n\nMAX_INPUT_SIZE = int(1e6)\nMAX_FLOAT32 = np.finfo(np.float32).max\n\ndef IsValidSize(n):\n  if n == 0:\n    return False\n  # PFFFT only supports transforms for inputs of length N of the form\n  # N = (2^a)*(3^b)*(5^c) where a >= 5, b >=0, c >= 0.\n  FACTORS = [2, 3, 5]\n  factorization = [0, 0, 0]\n  for i, factor in enumerate(FACTORS):\n    while n % factor == 0:\n      n = n // factor\n      factorization[i] += 1\n  return factorization[0] >= 5 and n == 1\n\n\ndef main():\n  if len(sys.argv) < 2:\n    print('Usage: %s <path to output directory>' % sys.argv[0])\n    sys.exit(1)\n\n  output_path = sys.argv[1]\n  if not os.path.exists(output_path):\n    print('The output path does not exists.')\n    sys.exit(2)\n\n  # List of valid input sizes.\n  N = [n for n in range(MAX_INPUT_SIZE) if IsValidSize(n)]\n\n  # Set the seed to always generate the same random data.\n  np.random.seed(0)\n\n  # Generate different types of input arrays for each target length.\n  for n in N:\n    # Zeros.\n    z = np.zeros(n, np.float32)\n    z.tofile(os.path.join(output_path, 'zeros_%d' % n))\n    # Max float 32.\n    m = np.ones(n, np.float32) * MAX_FLOAT32\n    m.tofile(os.path.join(output_path, 'max_%d' % n))\n    # Random values in the s16 range.\n    rnd_s16 = 32768.0 * 2.0 * (np.random.rand(n) - 1.0)\n    rnd_s16 = rnd_s16.astype(np.float32)\n    rnd_s16.tofile(os.path.join(output_path, 'rnd_s16_%d' % n))\n  \n  sys.exit(0)\n\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "projects/pffft/pffft_fuzzer.cc",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\n#include <algorithm>\n#include <array>\n#include <cassert>\n#include <cstring>\n\n#include \"pffft.h\"\n\nnamespace {\n\n#if defined(TRANSFORM_REAL)\n// Real FFT.\nconstexpr pffft_transform_t kTransform = PFFFT_REAL;\nconstexpr size_t kSizeOfOneSample = sizeof(float);\n#elif defined(TRANSFORM_COMPLEX)\n// Complex FFT.\nconstexpr pffft_transform_t kTransform = PFFFT_COMPLEX;\nconstexpr size_t kSizeOfOneSample = 2 * sizeof(float);  // Real plus imaginary.\n#else\n#error FFT transform type not defined.\n#endif\n\nbool IsValidSize(size_t n) {\n  if (n == 0) { return false; }\n  // PFFFT only supports transforms for inputs of length N of the form\n  // N = (2^a)*(3^b)*(5^c) where a >= 5, b >=0, c >= 0.\n  constexpr std::array<int, 3> kFactors = {2, 3, 5};\n  std::array<int, kFactors.size()> factorization{};\n  for (size_t i = 0; i < kFactors.size(); ++i) {\n    const int factor = kFactors[i];\n    while (n % factor == 0) {\n      n /= factor;\n      factorization[i]++;\n    }\n  }\n  return factorization[0] >= 5 && n == 1;\n}\n\nfloat* AllocatePffftBuffer(size_t number_of_bytes) {\n  return static_cast<float*>(pffft_aligned_malloc(number_of_bytes));\n}\n\n}  // namespace\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  // Set the number of FFT points to use |data| as input vector.\n  // The latter is truncated if the number of bytes is not an integer\n  // multiple of the size of one sample (which is either a real or a complex\n  // floating point number).\n  const size_t fft_size = size / kSizeOfOneSample;\n  if (!IsValidSize(fft_size)) {\n    return 0;\n  }\n\n  const size_t number_of_bytes = fft_size * kSizeOfOneSample;\n  assert(number_of_bytes <= size);\n\n  // Allocate input and output buffers.\n  float* in = AllocatePffftBuffer(number_of_bytes);\n  float* out = AllocatePffftBuffer(number_of_bytes);\n\n  // Copy input data.\n  std::memcpy(in, reinterpret_cast<const float*>(data), number_of_bytes);\n\n  // Setup FFT.\n  PFFFT_Setup* pffft_setup = pffft_new_setup(fft_size, kTransform);\n\n  // Call different PFFFT functions to maximize the coverage.\n  pffft_transform(pffft_setup, in, out, nullptr, PFFFT_FORWARD);\n  pffft_zconvolve_accumulate(pffft_setup, out, out, out, 1.f);\n  pffft_transform_ordered(pffft_setup, in, out, nullptr, PFFFT_BACKWARD);\n\n  // Release memory.\n  pffft_aligned_free(in);\n  pffft_aligned_free(out);\n  pffft_destroy_setup(pffft_setup);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/pffft/project.yaml",
    "content": "homepage: \"https://bitbucket.org/jpommier/pffft\"\nmain_repo: \"https://bitbucket.org/jpommier/pffft.git\"\nlanguage: c++\nprimary_contact: \"pommier@modartt.com\"\nauto_ccs:\n  - \"alessiob@webrtc.org\"\n  - \"mbonadei@webrtc.org\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/pffft/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n$SRC/test_pffft_real && $SRC/test_pffft_complex\n"
  },
  {
    "path": "projects/phmap/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone https://github.com/greg7mdp/parallel-hashmap\n\nWORKDIR $SRC/parallel-hashmap\nCOPY build.sh run_tests.sh $SRC/\nCOPY phashmap_fuzz.cc $SRC/\n"
  },
  {
    "path": "projects/phmap/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncmake -DPHMAP_MASTER_PROJECT=ON -DPHMAP_BUILD_TESTS=ON -B build\ncmake --build build\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/phashmap_fuzz.cc -I./ -o $OUT/phashmap_fuzz\n"
  },
  {
    "path": "projects/phmap/phashmap_fuzz.cc",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <iostream>\n#include <bitset>\n#include <cinttypes>\n#include <unistd.h>\n#include \"parallel_hashmap/phmap_dump.h\"\n#include <fuzzer/FuzzedDataProvider.h>\n\nusing phmap::flat_hash_map;\nusing namespace std;\n\nvoid serialise_test(const uint8_t *data, size_t size) {\n    phmap::flat_hash_map<unsigned int, int> table;\n    FuzzedDataProvider fuzzed_data(data, size);\n    const int num_items = fuzzed_data.ConsumeIntegral<int16_t>();\n\n    for (int i=0; i < num_items; ++i)  {\n        table.insert(typename phmap::flat_hash_map<unsigned int, int>::value_type(\n                    fuzzed_data.ConsumeIntegral<uint32_t>(), \n                    fuzzed_data.ConsumeIntegral<int32_t>()));\n    }\n\n    phmap::BinaryOutputArchive ar_out(\"/dump.data\");\n    table.phmap_dump(ar_out);\n\n    //MapType table_in;\n    phmap::flat_hash_map<unsigned int, int> table_in;\n    phmap::BinaryInputArchive ar_in(\"/dump.data\");\n    table_in.phmap_load(ar_in);\n\n    if(table == table_in) {\n        unlink(\"/dump.data\");\n        return;\n    }\n    unlink(\"/dump.data\");\n}\n\nvoid\ntest_assignments(const uint8_t *data, size_t size) {\n    phmap::flat_hash_map<std::string, std::string> email;\n    FuzzedDataProvider fuzzed_data(data, size);\n    const int num_items = fuzzed_data.ConsumeIntegral<int16_t>();\n    for (int i=0; i < num_items; ++i) {\n            phmap::flat_hash_map<std::string, std::string>::value_type(\n                    fuzzed_data.ConsumeRandomLengthString(), \n                    fuzzed_data.ConsumeRandomLengthString());\n    }\n    // Iterate through all of the items.\n    for (const auto& n: email) {}\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    serialise_test(data, size);\n    test_assignments(data, size);\n    return 0;\n}\n"
  },
  {
    "path": "projects/phmap/project.yaml",
    "content": "homepage: \"https://github.com/greg7mdp/parallel-hashmap\"\nmain_repo: 'https://github.com/greg7mdp/parallel-hashmap'\nprimary_contact: \"greg7mdp@gmail.com\"\nlanguage: c++\nauto_ccs :\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/phmap/run_tests.sh",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nctest --test-dir build\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && apt-get install --reinstall -y \\\n    ninja-build meson cmake pkg-config \\\n    libsystemd-dev libpam0g-dev libboost-all-dev libssl-dev \\\n    python3-pip && \\\n    pip3 install inflection pyyaml mako jsonschema --break-system-packages\nRUN git clone https://github.com/openbmc/phosphor-host-ipmid $SRC/phosphor-host-ipmid\nCOPY *.cpp *.sh *.diff $SRC/\nWORKDIR $SRC/phosphor-host-ipmid\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/phosphor-host-ipmid\n\n# Apply fuzz patch (adds fuzz_engine option to meson.options)\ngit apply --ignore-space-change --ignore-whitespace $SRC/fuzz-patch.diff\n\n# Disable transport/serialbridge build (needs systemd pkg-config we don't have)\nsed -i \"s|subdir('transport/serialbridge')|# subdir('transport/serialbridge')|\" meson.build\n\n# Copy fuzzer source files and logging stub into the test directory\ncp $SRC/fuzz_*.cpp $SRC/lg2_stub.cpp test/\n\n# Append fuzz target definitions to test/meson.build\ncat >> test/meson.build << 'MESON_EOF'\n\n# Header-only versions of deps for fuzz targets.\n# Using partial_dependency() strips link libraries so we do NOT link against\n# phosphor-dbus-interfaces (whose static constructors crash at startup with\n# std::bad_array_new_length due to static-init-order fiasco under libc++).\n# lg2_stub.cpp provides a no-op lg2::details::do_log() to satisfy the linker.\nphosphor_logging_headers = phosphor_logging_dep.partial_dependency(\n    compile_args: true, includes: true)\nsdbusplus_headers = sdbusplus_dep.partial_dependency(\n    compile_args: true, includes: true)\n\n# Fuzz targets\nexecutable(\n    'fuzz_payload_unpack',\n    ['fuzz_payload_unpack.cpp', 'lg2_stub.cpp'],\n    include_directories: root_inc,\n    implicit_include_directories: false,\n    dependencies: [\n        boost,\n        crypto,\n        phosphor_logging_headers,\n        sdbusplus_headers,\n        libsystemd_dep,\n    ],\n    link_args: get_option('fuzz_engine').split(),\n    install: true,\n)\n\nexecutable(\n    'fuzz_fru_area',\n    ['fuzz_fru_area.cpp', '../ipmi_fru_info_area.cpp', 'lg2_stub.cpp'],\n    include_directories: root_inc,\n    implicit_include_directories: false,\n    dependencies: [phosphor_logging_headers],\n    link_args: get_option('fuzz_engine').split(),\n    install: true,\n)\n\n# Compile sensorutils.cpp directly (instead of using sensorutils_dep which\n# transitively links phosphor-dbus-interfaces via phosphor_logging_dep).\nexecutable(\n    'fuzz_sensor_utils',\n    ['fuzz_sensor_utils.cpp', '../dbus-sdr/sensorutils.cpp', 'lg2_stub.cpp'],\n    include_directories: root_inc,\n    implicit_include_directories: false,\n    dependencies: [phosphor_logging_headers],\n    link_args: get_option('fuzz_engine').split(),\n    install: true,\n)\nMESON_EOF\n\n# Remove boost wrap — we use system boost (libboost-all-dev), not the cmake subproject.\n# meson subprojects download fails on boost.wrap since it has no meson.build.\nrm -f subprojects/boost.wrap\nrm -rf subprojects/boost-*\n\n# Download meson subprojects (sdbusplus, phosphor-logging, etc.)\nmeson subprojects download\n\n# stdplus is not in the wrap files but is a required dependency.\n# Clone it and create a proper wrap file so meson can resolve it for all subprojects.\ngit clone --depth 1 https://github.com/openbmc/stdplus subprojects/stdplus\ncat > subprojects/stdplus.wrap << 'WRAPEOF'\n[wrap-git]\nurl = https://github.com/openbmc/stdplus.git\nrevision = HEAD\n\n[provide]\nstdplus = stdplus_dep\nWRAPEOF\n\n# Remove system gtest/gmock to force using the subproject (built with libc++)\napt-get remove -y libgtest-dev libgmock-dev googletest google-mock || true\nrm -rf /usr/src/googletest /usr/src/gtest /usr/src/gmock\n\n# Clone googletest as a subproject (remove any partial download from stdplus first)\nrm -rf subprojects/googletest\ngit clone https://github.com/google/googletest.git --branch v1.15.2 subprojects/googletest\n\n# Force googletest to build statically\nfind subprojects/googletest -name CMakeLists.txt -exec sed -i '1i set(BUILD_SHARED_LIBS OFF CACHE BOOL \"Force static\" FORCE)' {} +\n\n# Configure meson\nrm -rf build\nmeson setup build \\\n    -Dtests=enabled \\\n    -Dsoftoff=disabled \\\n    -Dipmi-whitelist=disabled \\\n    -Dlibuserlayer=disabled \\\n    -Ddefault_library=static \\\n    -Dfuzz_engine=\"$LIB_FUZZING_ENGINE\" \\\n    -Dcpp_args=\"-stdlib=libc++ -Wno-error $CXXFLAGS\" \\\n    -Dc_args=\"$CFLAGS\" \\\n    -Dcpp_link_args=\"${LDFLAGS:-$CXXFLAGS}\"\n\n# ============================================================\n# libc++ compatibility patches for subproject headers\n# ============================================================\n\n# stdplus patches (same fixes as bios-bmc-smm-error-logger)\nif [ -f subprojects/stdplus/include/stdplus/function_view.hpp ]; then\n    sed -i '1i#include <cstddef>\\n#include <concepts>\\n#include <type_traits>\\n#include <memory>' \\\n        subprojects/stdplus/include/stdplus/function_view.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/debug/lifetime.hpp ]; then\n    sed -i '1i#include <cstddef>' \\\n        subprojects/stdplus/include/stdplus/debug/lifetime.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/hash.hpp ]; then\n    sed -i '1i#include <functional>' subprojects/stdplus/include/stdplus/hash.hpp\n    sed -i '/^namespace std$/,/}/ { /template <class Key>/d; /struct hash;/d; }' \\\n        subprojects/stdplus/include/stdplus/hash.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/net/addr/ip.hpp ]; then\n    sed -i '1i#include <format>' subprojects/stdplus/include/stdplus/net/addr/ip.hpp\n    sed -i '/template <typename T, typename CharT>/d' subprojects/stdplus/include/stdplus/net/addr/ip.hpp\n    sed -i '/struct formatter;/d' subprojects/stdplus/include/stdplus/net/addr/ip.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/net/addr/subnet.hpp ]; then\n    sed -i '1i#include <format>' subprojects/stdplus/include/stdplus/net/addr/subnet.hpp\n    sed -i '/template <typename T, typename CharT>/d' subprojects/stdplus/include/stdplus/net/addr/subnet.hpp\n    sed -i '/struct formatter;/d' subprojects/stdplus/include/stdplus/net/addr/subnet.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/str/cat.hpp ]; then\n    sed -i '1i#include <algorithm>' subprojects/stdplus/include/stdplus/str/cat.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/net/addr/ether.hpp ]; then\n    sed -i '1i#include <format>' subprojects/stdplus/include/stdplus/net/addr/ether.hpp\n    sed -i '/template <typename T, typename CharT>/d' subprojects/stdplus/include/stdplus/net/addr/ether.hpp\n    sed -i '/struct formatter;/d' subprojects/stdplus/include/stdplus/net/addr/ether.hpp\nfi\nif [ -f subprojects/stdplus/include/stdplus/numeric/endian.hpp ]; then\n    sed -i '1i#include <format>' subprojects/stdplus/include/stdplus/numeric/endian.hpp\n    sed -i '/template <typename T, typename CharT>/d' subprojects/stdplus/include/stdplus/numeric/endian.hpp\n    sed -i '/struct formatter;/d' subprojects/stdplus/include/stdplus/numeric/endian.hpp\nfi\n\n# sdbusplus patch: std::move_only_function not available in older libc++\nif [ -f subprojects/sdbusplus/include/sdbusplus/asio/connection.hpp ]; then\n    sed -i 's/std::move_only_function/std::function/g' \\\n        subprojects/sdbusplus/include/sdbusplus/asio/connection.hpp\nfi\n\n# sdbusplus patch: close() needs unistd.h with some libc++ versions\nif [ -f subprojects/sdbusplus/include/sdbusplus/event.hpp ]; then\n    grep -q '#include <unistd.h>' subprojects/sdbusplus/include/sdbusplus/event.hpp || \\\n        sed -i '1i#include <unistd.h>' subprojects/sdbusplus/include/sdbusplus/event.hpp\nfi\n\n# stdexec patch: std::launder needs <new> with libc++\nif [ -d subprojects/stdexec ]; then\n    find subprojects/stdexec -name '__utility.hpp' -exec \\\n        sed -i '1i#include <new>' {} +\nfi\n\n# boost container_hash: std::unary_function removed in C++17 with libc++\nfind /usr/include/boost -name hash.hpp -path '*/container_hash/*' -exec \\\n    sed -i 's/struct hash_base : std::unary_function<T, std::size_t>/struct hash_base/' {} + 2>/dev/null || true\n\n# Build everything\nninja -C build -v -j$(($(nproc) / 4))\n\n# Copy fuzzers and seed corpora to $OUT\ncp build/test/fuzz_payload_unpack $OUT/\ncp build/test/fuzz_fru_area $OUT/\ncp build/test/fuzz_sensor_utils $OUT/\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/fuzz-patch.diff",
    "content": "diff --git a/meson.options b/meson.options\n--- a/meson.options\n+++ b/meson.options\n@@ -282,3 +282,5 @@ option(\n     value: ['all'],\n     description: 'Build selected OEM IPMI provider libraries',\n )\n+\n+option('fuzz_engine', type: 'string', value: '', description: 'Fuzzing engine flags')\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/fuzz_fru_area.cpp",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"ipmi_fru_info_area.hpp\"\n\n#include <cstdint>\n#include <cstring>\n#include <string>\n\n// Helper: extract a length-prefixed string from fuzz data\nstatic bool extractString(const uint8_t*& data, size_t& remaining,\n                          std::string& out)\n{\n    if (remaining < 1)\n    {\n        return false;\n    }\n    uint8_t len = data[0] % 64; // Cap at 63 to keep things reasonable\n    data++;\n    remaining--;\n\n    if (remaining < len)\n    {\n        len = static_cast<uint8_t>(remaining);\n    }\n\n    out.assign(reinterpret_cast<const char*>(data), len);\n    data += len;\n    remaining -= len;\n    return true;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    if (size < 3)\n    {\n        return 0;\n    }\n\n    // Use first byte to decide which sections to populate\n    uint8_t sectionMask = data[0];\n    data++;\n    size--;\n\n    ipmi::fru::FruInventoryData inventory;\n\n    // Property keys used by the FRU builder\n    const char* keys[] = {\"Type\",        \"Model Number\", \"Serial Number\",\n                          \"Manufacturer\", \"Mfg Date\",    \"Name\",\n                          \"Part Number\",  \"Version\"};\n\n    // Chassis section\n    if (sectionMask & 0x01)\n    {\n        ipmi::fru::PropertyMap props;\n        for (const auto& key : keys)\n        {\n            std::string val;\n            if (!extractString(data, size, val))\n            {\n                break;\n            }\n            if (!val.empty())\n            {\n                props[key] = val;\n            }\n        }\n        if (!props.empty())\n        {\n            inventory[\"Chassis\"] = props;\n        }\n    }\n\n    // Board section\n    if (sectionMask & 0x02)\n    {\n        ipmi::fru::PropertyMap props;\n        for (const auto& key : keys)\n        {\n            std::string val;\n            if (!extractString(data, size, val))\n            {\n                break;\n            }\n            if (!val.empty())\n            {\n                props[key] = val;\n            }\n        }\n        if (!props.empty())\n        {\n            inventory[\"Board\"] = props;\n        }\n    }\n\n    // Product section\n    if (sectionMask & 0x04)\n    {\n        ipmi::fru::PropertyMap props;\n        for (const auto& key : keys)\n        {\n            std::string val;\n            if (!extractString(data, size, val))\n            {\n                break;\n            }\n            if (!val.empty())\n            {\n                props[key] = val;\n            }\n        }\n        if (!props.empty())\n        {\n            inventory[\"Product\"] = props;\n        }\n    }\n\n    if (!inventory.empty())\n    {\n        ipmi::fru::buildFruAreaData(inventory);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/fuzz_payload_unpack.cpp",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <ipmid/message.hpp>\n\n#include <array>\n#include <bitset>\n#include <cstdint>\n#include <cstring>\n#include <optional>\n#include <span>\n#include <string>\n#include <string_view>\n#include <tuple>\n#include <vector>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    // Need at least selector byte + 1 byte of payload\n    if (size < 2)\n    {\n        return 0;\n    }\n\n    // Use first byte to select which path to exercise\n    uint8_t selector = data[0];\n    data++;\n    size--;\n\n    // Create a SecureBuffer from the fuzz input\n    ipmi::SecureBuffer buf(data, data + size);\n\n    switch (selector % 16)\n    {\n        // ========== UNPACK CASES ==========\n\n        case 0:\n        {\n            // Unpack fundamental types: uint8, uint16, uint32\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            uint8_t u8 = 0;\n            uint16_t u16 = 0;\n            uint32_t u32 = 0;\n            p.unpack(u8, u16, u32);\n            break;\n        }\n        case 1:\n        {\n            // Unpack fixed-width bit types\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            uint3_t bits3{};\n            uint4_t bits4{};\n            uint5_t bits5{};\n            bool flag = false;\n            uint7_t bits7{};\n            p.unpack(bits3, bits4, flag, bits5, bits7);\n            break;\n        }\n        case 2:\n        {\n            // Unpack string (UCSD-Pascal style: length-prefixed)\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            std::string str;\n            p.unpack(str);\n            break;\n        }\n        case 3:\n        {\n            // Unpack vector<uint8_t> (consumes remainder)\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            std::vector<uint8_t> vec;\n            p.unpack(vec);\n            break;\n        }\n        case 4:\n        {\n            // Unpack optional types\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            uint8_t u8 = 0;\n            std::optional<uint16_t> optU16;\n            std::optional<uint32_t> optU32;\n            p.unpack(u8, optU16, optU32);\n            break;\n        }\n        case 5:\n        {\n            // Unpack array<uint8_t, N>\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            std::array<uint8_t, 4> arr{};\n            uint16_t u16 = 0;\n            p.unpack(arr, u16);\n            break;\n        }\n        case 6:\n        {\n            // Unpack bitset\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            std::bitset<8> bs;\n            uint8_t u8 = 0;\n            p.unpack(bs, u8);\n            break;\n        }\n        case 7:\n        {\n            // Mixed: bit fields + fundamental (exercises unaligned unpack)\n            // Unpacking bit-fields leaves bitCount > 0, then a uint16_t\n            // triggers UnpackBytesUnaligned\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            uint3_t tri{};\n            uint16_t u16 = 0;\n            uint4_t nib{};\n            uint32_t u32 = 0;\n            p.unpack(tri, u16, nib, u32);\n            break;\n        }\n        case 8:\n        {\n            // Unpack into SecureBuffer (remainder drain)\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            uint8_t u8 = 0;\n            ipmi::SecureBuffer sb;\n            p.unpack(u8, sb);\n            break;\n        }\n        case 9:\n        {\n            // Unpack into std::span<const uint8_t> (zero-copy remainder)\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            uint8_t u8 = 0;\n            std::span<const uint8_t> sp;\n            p.unpack(u8, sp);\n            break;\n        }\n        case 10:\n        {\n            // Unpack into a Payload (variable-length handler pattern)\n            ipmi::message::Payload p(std::move(buf));\n            uint8_t u8 = 0;\n            ipmi::message::Payload inner;\n            p.unpack(u8, inner);\n            // inner is now a copy of the remaining payload\n            // Exercise inner unpacking too\n            inner.trailingOk = true;\n            uint16_t u16 = 0;\n            inner.unpack(u16);\n            break;\n        }\n        case 11:\n        {\n            // Exercise fullyUnpacked(), reset(), re-unpack\n            ipmi::message::Payload p(std::move(buf));\n            p.trailingOk = true;\n            uint8_t u8 = 0;\n            p.unpack(u8);\n            p.fullyUnpacked();\n\n            // Reset and unpack again from the beginning\n            p.reset();\n            uint16_t u16 = 0;\n            p.unpack(u16);\n            p.fullyUnpacked();\n            break;\n        }\n\n        // ========== PACK CASES ==========\n\n        case 12:\n        {\n            // Pack bit-fields + integers (exercises appendBits, drain,\n            // PackBytesUnaligned)\n            ipmi::message::Payload p;\n            bool b = (data[0] & 1);\n            uint3_t tri = data[0] >> 1;\n            uint4_t nib = data[0] >> 4;\n            p.pack(b, tri, nib);\n\n            // Now pack a uint16_t while bitCount > 0 (unaligned path)\n            uint16_t u16 = 0;\n            if (size >= 3)\n            {\n                std::memcpy(&u16, data + 1, sizeof(u16));\n            }\n            p.pack(u16);\n            p.drain();\n\n            // Pack a string\n            size_t strLen = (size > 3) ? std::min<size_t>(data[0] % 64, size - 3)\n                                       : 0;\n            if (strLen > 0)\n            {\n                std::string str(reinterpret_cast<const char*>(data + 3), strLen);\n                p.pack(str);\n            }\n\n            // Pack a vector<uint8_t>\n            std::vector<uint8_t> vec(data, data + size);\n            p.pack(vec);\n\n            // Verify we can read it back\n            p.drain();\n            (void)p.size();\n            (void)p.data();\n            break;\n        }\n        case 13:\n        {\n            // Pack bitset, fixed_uint_t, bool combinations\n            ipmi::message::Payload p;\n            std::bitset<8> bs(data[0]);\n            p.pack(bs);\n\n            uint7_t u7 = data[0] & 0x7F;\n            bool flag = data[0] >> 7;\n            p.pack(u7, flag);\n\n            // Pack a SecureBuffer\n            ipmi::SecureBuffer sb(data, data + size);\n            p.drain();\n            p.pack(sb);\n\n            // Pack a string_view\n            std::string_view sv(reinterpret_cast<const char*>(data), size);\n            ipmi::message::Payload p2;\n            p2.pack(sv);\n            break;\n        }\n        case 14:\n        {\n            // Pack + unpack round trip with bit fields (mixed alignment)\n            ipmi::message::Payload packer;\n            bool b1 = data[0] & 1;\n            uint3_t tri = (data[0] >> 1) & 0x7;\n            uint4_t nib = (data[0] >> 4) & 0xF;\n            uint8_t byte = (size > 1) ? data[1] : 0;\n            packer.pack(b1, tri, nib, byte);\n            packer.drain();\n\n            // Unpack what we just packed\n            ipmi::message::Payload unpacker(std::move(packer.raw));\n            unpacker.trailingOk = true;\n            bool ob1 = false;\n            uint3_t otri{};\n            uint4_t onib{};\n            uint8_t obyte = 0;\n            unpacker.unpack(ob1, otri, onib, obyte);\n            unpacker.fullyUnpacked();\n            break;\n        }\n        case 15:\n        {\n            // Prepend and Payload-into-Payload packing\n            ipmi::message::Payload p1;\n            ipmi::message::Payload p2;\n\n            uint8_t v1 = data[0];\n            uint16_t v2 = 0;\n            if (size >= 3)\n            {\n                std::memcpy(&v2, data + 1, sizeof(v2));\n            }\n\n            p1.pack(v1);\n            p1.drain();\n            p2.pack(v2);\n            p2.drain();\n\n            // Prepend p1 into p2\n            p2.prepend(p1);\n\n            // Pack one payload into another\n            ipmi::message::Payload p3;\n            p3.pack(v1);\n            p3.drain();\n            ipmi::message::Payload p4;\n            p4.pack(p3);\n\n            // Resize accessor\n            p4.resize(p4.size() + 1);\n\n            // Exercise destructor warning path: no trailingOk, no fullyUnpacked\n            {\n                ipmi::message::Payload pWarn(\n                    ipmi::SecureBuffer(data, data + size));\n                pWarn.unpackCheck = true; // prevent the lg2 warning\n            }\n            break;\n        }\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/fuzz_sensor_utils.cpp",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"dbus-sdr/sensorutils.hpp\"\n\n#include <cstdint>\n#include <cstring>\n#include <stdexcept>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n    // We need 3 doubles (24 bytes) minimum\n    if (size < 24)\n    {\n        return 0;\n    }\n\n    double max, min, value;\n    std::memcpy(&max, data, sizeof(double));\n    std::memcpy(&min, data + 8, sizeof(double));\n    std::memcpy(&value, data + 16, sizeof(double));\n\n    // Test getSensorAttributes\n    int16_t mValue = 0;\n    int8_t rExp = 0;\n    int16_t bValue = 0;\n    int8_t bExp = 0;\n    bool bSigned = false;\n\n    bool result =\n        ipmi::getSensorAttributes(max, min, mValue, rExp, bValue, bExp, bSigned);\n\n    // If getSensorAttributes succeeded, also test scaleIPMIValueFromDouble\n    if (result && mValue != 0)\n    {\n        try\n        {\n            ipmi::scaleIPMIValueFromDouble(value, mValue, rExp, bValue, bExp,\n                                           bSigned);\n        }\n        catch (const std::out_of_range&)\n        {\n            // Expected for mValue == 0, but we check above\n        }\n    }\n\n    // Test getScaledIPMIValue directly\n    try\n    {\n        ipmi::getScaledIPMIValue(value, max, min);\n    }\n    catch (const std::runtime_error&)\n    {\n        // Expected for invalid sensor attributes\n    }\n    catch (const std::out_of_range&)\n    {\n        // Expected for mValue == 0 conditions\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/lg2_stub.cpp",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Stub implementation of phosphor-logging lg2::details::do_log for fuzzing.\n// This avoids linking against libphosphor_logging.a (and transitively\n// libphosphor_dbus.a) whose static constructors crash at startup under\n// libc++ due to a static-initialization-order fiasco.\n\n#include <phosphor-logging/lg2/level.hpp>\n#include <source_location>\n\nnamespace lg2::details\n{\nvoid do_log(level, const std::source_location&, const char*, ...)\n{\n    // No-op: suppress all logging during fuzzing.\n}\n} // namespace lg2::details\n"
  },
  {
    "path": "projects/phosphor-host-ipmid/project.yaml",
    "content": "homepage: \"https://github.com/openbmc/phosphor-host-ipmid\"\nlanguage: c++\nmain_repo: \"https://github.com/openbmc/phosphor-host-ipmid\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nbase_os_version: ubuntu-24-04\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/php/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y autoconf automake libtool bison re2c pkg-config\nRUN git clone --depth 1 --branch master https://github.com/php/php-src.git php-src\nWORKDIR php-src\nCOPY replay_build.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/php/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# PHP's zend_function union is incompatible with the object-size sanitizer\nexport CFLAGS=\"$CFLAGS -fno-sanitize=object-size\"\nexport CXXFLAGS=\"$CXXFLAGS -fno-sanitize=object-size\"\n\n# Disable JIT profitability checks.\nexport CFLAGS=\"$CFLAGS -DPROFITABILITY_CHECKS=0\"\n\n# Make sure the right assembly files are picked\nBUILD_FLAG=\"\"\nif [ \"$ARCHITECTURE\" = \"i386\" ]; then\n    BUILD_FLAG=\"--build=i686-pc-linux-gnu\"\nfi\n\n# build project\n./buildconf\n./configure $BUILD_FLAG \\\n    --disable-all \\\n    --enable-debug-assertions \\\n    --enable-option-checking=fatal \\\n    --enable-fuzzer \\\n    --enable-exif \\\n    --without-pcre-jit \\\n    --disable-phpdbg \\\n    --disable-cgi \\\n    --enable-pic\nmake -j$(nproc)\n\n# Generate corpuses and dictionaries.\nsapi/cli/php sapi/fuzzer/generate_all.php\n\n# Copy dictionaries to expected locations.\ncp sapi/fuzzer/dict/unserialize $OUT/php-fuzz-unserialize.dict\ncp sapi/fuzzer/dict/parser $OUT/php-fuzz-parser.dict\ncp sapi/fuzzer/json.dict $OUT/php-fuzz-json.dict\n\nFUZZERS=\"php-fuzz-json\nphp-fuzz-exif\nphp-fuzz-unserialize\nphp-fuzz-unserializehash\nphp-fuzz-parser\nphp-fuzz-execute\"\nfor fuzzerName in $FUZZERS; do\n\tcp sapi/fuzzer/$fuzzerName $OUT/\ndone\n\n# The JIT fuzzer is fundamentally incompatible with memory sanitizer,\n# as that would require the JIT to emit msan instrumentation itself.\n# In practice it is currently also incompatible with ubsan.\nif [ \"$SANITIZER\" != \"memory\" ] && [ \"$SANITIZER\" != \"undefined\" ]; then\n    cp sapi/fuzzer/php-fuzz-function-jit $OUT/\n    cp sapi/fuzzer/php-fuzz-tracing-jit $OUT/\nfi\n\n# copy corpora from source\nfor fuzzerName in `ls sapi/fuzzer/corpus`; do\n\tzip -j $OUT/php-fuzz-${fuzzerName}_seed_corpus.zip sapi/fuzzer/corpus/${fuzzerName}/*\ndone\n\n"
  },
  {
    "path": "projects/php/project.yaml",
    "content": "homepage: \"http://php.net/\"\nlanguage: c++\nprimary_contact: \"stas@php.net\"\nauto_ccs:\n - \"smalyshev@gmail.com\"\n - \"nikita.ppv@gmail.com\"\n - \"dmitrystogov@gmail.com\"\n - \"tovilo.ilija@gmail.com\"\n - \"github@derickrethans.nl\"\nfuzzing_engines:\n  - \"afl\"\n  - \"honggfuzz\"\n  - \"libfuzzer\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n - x86_64\n - i386\nview_restrictions: none\nmain_repo: 'https://github.com/php/php-src.git'\n"
  },
  {
    "path": "projects/php/replay_build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# This script is useful for OSS-Fuzz infrastructure which is used to rebuild\n# code from cached images. This is to support various ongoing efforts in\n# OSS-Fuzz.\n# The key benefit of this particular rreplay script is to avoid building all\n# corpuses etc. and also any configuration steps have been removed.\n# performance:\n# php: Compile times: Vanilla=62; Replay=2;  \n\nmake -j$(nproc)\n\n# Copy fuzzers out.\nFUZZERS=\"php-fuzz-json\nphp-fuzz-exif\nphp-fuzz-unserialize\nphp-fuzz-unserializehash\nphp-fuzz-parser\nphp-fuzz-execute\"\nfor fuzzerName in $FUZZERS; do\n\tcp sapi/fuzzer/$fuzzerName $OUT/\ndone\n\n# The JIT fuzzer is fundamentally incompatible with memory sanitizer,\n# as that would require the JIT to emit msan instrumentation itself.\n# In practice it is currently also incompatible with ubsan.\nif [ \"$SANITIZER\" != \"memory\" ] && [ \"$SANITIZER\" != \"undefined\" ]; then\n    cp sapi/fuzzer/php-fuzz-function-jit $OUT/\n    cp sapi/fuzzer/php-fuzz-tracing-jit $OUT/\nfi\n"
  },
  {
    "path": "projects/picotls/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool cmake pkg-config libssl-dev\nRUN git clone https://github.com/h2o/picotls\nWORKDIR picotls\nRUN git submodule init\nRUN git submodule update\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/picotls/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd $SRC/picotls\ncmake -DBUILD_FUZZER=ON -DOSS_FUZZ=ON .\nmake\ncp ./fuzz-client-hello $OUT/\ncp ./fuzz-server-hello $OUT/\n\nzip -jr $OUT/fuzz-client-hello_seed_corpus.zip $SRC/picotls/fuzz/fuzz-client-hello-corpus\nzip -jr $OUT/fuzz-server-hello_seed_corpus.zip $SRC/picotls/fuzz/fuzz-server-hello-corpus\npopd\n"
  },
  {
    "path": "projects/picotls/project.yaml",
    "content": "homepage: \"https://github.com/h2o/picotls\"\nlanguage: c++\nprimary_contact: \"jonathan.foote@gmail.com\"\nauto_ccs:\n  - \"frederik.deweerdt@gmail.com\"\n  - \"kazuhooku@gmail.com\"\n  - \"i.nagata110@gmail.com\"\n  - \"tmaesaka@gmail.com\"\n  - \"security@fastly.com\"\nmain_repo: 'https://github.com/h2o/picotls'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/pidgin/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y --no-install-recommends \\\n        make autoconf automake libtool texinfo libltdl-dev pkg-config \\\n        zlib1g-dev zlib1g-dev:i386 liblzma-dev liblzma-dev:i386 \\\n        wget intltool  sasl2-bin python3-pip libpcre2-dev\nRUN pip3 install -U meson ninja\n\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/glib\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git\nRUN wget https://sourceforge.net/projects/pidgin/files/Pidgin/2.14.10/pidgin-2.14.10.tar.bz2\nRUN git clone --depth=1 https://github.com/libffi/libffi\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus\nRUN git clone --depth 1 https://github.com/google/fuzzing\n\nWORKDIR $SRC\n\nCOPY build.sh \\\t\n     pidgin_xml_fuzzer.c \\\n     pidgin_utils_fuzzer.c \\\n     $SRC/\n"
  },
  {
    "path": "projects/pidgin/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Place to keep dependencies for static linking\nDEPS=/deps\nmkdir ${DEPS}\n\n\n# Build libffi\ncd $SRC\ncd libffi\n./autogen.sh\n./configure --disable-shared\nmake -j$(nproc)\nexport LIBFFI_LIBS=\"-L/src/libffi libraries/ -lffi\"\ncp ./x86_64-pc-linux-gnu/.libs/libffi.a ${DEPS}/\n\ncurl -LO http://mirrors.kernel.org/ubuntu/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\napt install ./automake_1.16.5-1.3_all.deb\n\n# Build libxml2\ncd $SRC/libxml2\n./autogen.sh \\\n    --disable-shared \\\n    --without-debug \\\n    --without-ftp \\\n    --without-http \\\n    --without-legacy \\\n    --without-python\nmake -j$(nproc)\nmake install\ncp .libs/libxml2.a ${DEPS}/\n\n\n# Build glib\ncd $SRC/glib\nGLIB_BUILD=$WORK/meson\nrm -rf $GLIB_BUILD\nmkdir $GLIB_BUILD\nmeson $GLIB_BUILD \\\n  -Db_lundef=false \\\n  -Ddefault_library=static \\\n  -Dlibmount=disabled\nninja -C $GLIB_BUILD\nninja -C $GLIB_BUILD install\n\ncp ${GLIB_BUILD}/gobject/libgobject-2.0.a ${DEPS}/\ncp ${GLIB_BUILD}/gmodule/libgmodule-2.0.a ${DEPS}/\ncp ${GLIB_BUILD}/glib/libglib-2.0.a ${DEPS}/\n\n\n# Build Pidgin\ncd $SRC \ntar -xf pidgin-2.14.10.tar.bz2\nmv pidgin-2.14.10 pidgin\ncd pidgin\n./configure --disable-consoleui \\\n            --disable-shared \\\n            --disable-screensaver \\\n            --disable-sm \\\n            --disable-gtkspell \\\n            --disable-gevolution \\\n            --enable-gnutls=no \\\n            --disable-gstreamer \\\n            --disable-vv \\\n            --disable-idn \\\n            --disable-meanwhile \\\n            --disable-avahi \\\n            --disable-dbus \\\n            --disable-perl \\\n            --disable-tcl \\\n            --disable-cyrus-sasl \\\n            --disable-gtkui \\\n            --enable-nss=no\nmake -j$(nproc)\n\n\n# Build fuzzers\nreadonly FUZZERS=( \\\n  pidgin_xml_fuzzer\n  pidgin_utils_fuzzer\n)\n\ncd libpurple\ncp $SRC/*fuzzer.c .\n\nfor fuzzer in \"${FUZZERS[@]}\"; do\n  $CC $CFLAGS -DHAVE_CONFIG_H \\\n    -I. \\\n    -I.. \\\n    -I${SRC}/glib \\\n    -I${SRC}/glib/glib \\\n    -I${SRC}/glib/gmodule \\\n    -I${GLIB_BUILD} \\\n    -I${GLIB_BUILD}/glib \\\n    -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \\\n    -I/usr/local/include/libxml2  \\\n    -I/src/pidgin/libpurple/protocols/jabber \\\n    -c $fuzzer.c \\\n    -o $fuzzer.o\n\n  $CC $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.o \\\n    -o $OUT/$fuzzer \\\n    /src/pidgin/libpurple/protocols/jabber/.libs/libjabber.a \\\n    ./.libs/libpurple.a \\\n    ${DEPS}/libgobject-2.0.a \\\n    ${DEPS}/libgmodule-2.0.a \\\n    ${DEPS}/libglib-2.0.a \\\n    ${DEPS}/libxml2.a \\\n    ${DEPS}/libffi.a \\\n    -lresolv -lz -llzma -l:libpcre2-8.a\ndone\n\nzip $OUT/pidgin_xml_fuzzer_seed_corpus.zip $SRC/go-fuzz-corpus/xml/corpus/*\ncp $SRC/fuzzing/dictionaries/xml.dict $OUT/pidgin_xml_fuzzer.dict\n"
  },
  {
    "path": "projects/pidgin/pidgin_utils_fuzzer.c",
    "content": "/*\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"util.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char *nstr = (char *)malloc(size + 1);\n  if (nstr == NULL) {\n    return 0;\n  }\n  memcpy(nstr, data, size);\n  nstr[size] = '\\0';\n\n  guchar *tmp = NULL;\n  gsize retlen;\n\n  if (size % 2 == 0 && strlen(nstr) > 0) {\n    tmp = purple_base16_decode(nstr, &retlen);\n    if (tmp != NULL) {\n      g_free(tmp);\n    }\n  }\n\n  tmp = NULL;\n  tmp = purple_quotedp_decode(nstr, &retlen);\n  if (tmp != NULL) {\n    g_free(tmp);\n  }\n\n  char *tmp2 = NULL;\n  tmp2 = purple_mime_decode_field(nstr);\n  if (tmp2 != NULL) {\n    free(tmp2);\n  }\n\n  purple_str_to_time(nstr, TRUE, NULL, NULL, NULL);\n\n  gchar *xhtml = NULL;\n  gchar *plaintext = NULL;\n  purple_markup_html_to_xhtml(nstr, &xhtml, &plaintext);\n\n  if (xhtml != NULL) {\n    g_free(xhtml);\n  }\n\n  if (plaintext != NULL) {\n    g_free(plaintext);\n  }\n\n  char *tmp3 = purple_markup_strip_html(nstr);\n  if (tmp3 != NULL) {\n    free(tmp3);\n  }\n\n  purple_markup_is_rtl(nstr);\n\n  free(nstr);\n  return 0;\n}\n"
  },
  {
    "path": "projects/pidgin/pidgin_xml_fuzzer.c",
    "content": "/*\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"xmlnode.h\"\n#include \"caps.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char *malicious_xml = (char *)malloc(size + 1);\n  if (malicious_xml == NULL) {\n    return 0;\n  }\n  memcpy(malicious_xml, data, size);\n  malicious_xml[size] = '\\0';\n\n  xmlnode *isc = xmlnode_from_str(malicious_xml, size+1);\n  if (isc != NULL) {    \n    xmlnode_set_attrib(isc, \"name\", \"query\");\n    \n    // Parse Jabber caps\n    JabberCapsClientInfo *info = jabber_caps_parse_client_info(isc);\n    gchar *got_hash = jabber_caps_calculate_hash(info, (\"sha1\"));\n\n    // Insert a child\n    xmlnode *child = xmlnode_new_child(isc, \"query\");\n    xmlnode_insert_child(isc, child);\n\n    // Get data\n    char *retrieved_data = xmlnode_get_data(isc);\n    char *retrieved_data_unescaped = xmlnode_get_data_unescaped(isc);\n\n    xmlnode_free(isc);\n  }\n\n  free(malicious_xml);\n  return 0;\n}"
  },
  {
    "path": "projects/pidgin/project.yaml",
    "content": "homepage: \"https://www.pidgin.im/\"\nprimary_contact: \"gary.kramlich@gmail.com\"\nlanguage: c\nauto_ccs:\n  - \"quantum.analyst@gmail.com\"\n  - \"rekkanoryo.guifications@gmail.com\"\nmain_repo: 'https://sourceforge.net/projects/pidgin/files/Pidgin/2.14.4/pidgin-2.14.4.tar.bz2'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/piex/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://android.googlesource.com/platform/external/piex\n# Recover seed corpora from an older build.\nADD https://storage.googleapis.com/clusterfuzz-builds/piex/piex-address-202411210638.zip /tmp/piex.zip\nRUN mkdir $SRC/old-build \\\n && unzip /tmp/piex.zip -d $SRC/old-build \\\n && rm /tmp/piex.zip\n\nWORKDIR piex\nCOPY build.sh $SRC/\nCOPY piex_fuzzer.cc $SRC/piex/src\n"
  },
  {
    "path": "projects/piex/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n$CXX $CXXFLAGS $CFLAGS  -I. \\\n    -c $SRC/piex/src/binary_parse/cached_paged_byte_array.cc \\\n       -o cached_paged_byte_array.o &\n$CXX $CXXFLAGS $CFLAGS  -I. \\\n    -c $SRC/piex/src/binary_parse/range_checked_byte_ptr.cc \\\n       -o range_checked_byte_ptr.o &\n\nwait\n\nar rcs libbinary_parse.a \\\n    cached_paged_byte_array.o range_checked_byte_ptr.o\n\n$CXX $CXXFLAGS $CFLAGS  -I. \\\n    -c $SRC/piex/src/image_type_recognition/image_type_recognition_lite.cc \\\n       -o image_type_recognition_lite.o\nar rcs libimage_type_recognition.a image_type_recognition_lite.o\n\n$CXX $CXXFLAGS $CFLAGS  -I. \\\n    -c $SRC/piex/src/tiff_directory/tiff_directory.cc \\\n       -o tiff_directory.o\nar rcs libtiff_directory.a tiff_directory.o\n\n\n$CXX $CXXFLAGS $CFLAGS  -I. \\\n    -c $SRC/piex/src/piex.cc -o piex.o &\n$CXX $CXXFLAGS $CFLAGS  -I. \\\n    -c $SRC/piex/src/piex_cr3.cc -o piex_cr3.o &\n$CXX $CXXFLAGS $CFLAGS  -I. \\\n    -c $SRC/piex/src/tiff_parser.cc -o tiff_parser.o &\nwait\nar rcs libpiex.a piex.o piex_cr3.o tiff_parser.o\n\n$CXX $CXXFLAGS $CFLAGS -I. $SRC/piex/src/piex_fuzzer.cc libpiex.a libtiff_directory.a \\\n    libimage_type_recognition.a libbinary_parse.a $LIB_FUZZING_ENGINE -o $OUT/fuzzer-piex\ncp $SRC/old-build/*_seed_corpus.zip $OUT\n"
  },
  {
    "path": "projects/piex/piex_fuzzer.cc",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stddef.h>\n#include <string.h>\n\n#include \"src/piex.h\"\n#include \"src/piex_types.h\"\n\n\nclass MemoryStream : public piex::StreamInterface {\npublic:\n    MemoryStream(const uint8_t* data, size_t size)\n      : data_(data), size_(size) {}\n\n    piex::Error GetData(const size_t offset,\n                  const size_t length,\n                  uint8_t* data) override {\n        if (offset + length > size_) {\n            return piex::Error::kFail;\n        }\n        memcpy(data, data_ + offset, length);\n        return piex::Error::kOk;\n    }\n\nprivate:\n    const uint8_t* data_;\n    size_t         size_;\n};\n\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    MemoryStream stream(data, size);\n\n    piex::PreviewImageData preview_image_data;\n    piex::GetPreviewImageData(&stream, &preview_image_data);\n\n    return 0;\n}"
  },
  {
    "path": "projects/piex/project.yaml",
    "content": "homepage: \"https://github.com/google/piex\"\nlanguage: c++\nprimary_contact: \"nchusid@google.com\"\nsanitizers:\n - address\n - undefined\n - memory\nmain_repo: 'https://github.com/guidovranken/piex.git'\n"
  },
  {
    "path": "projects/pigweed/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y git build-essential python-is-python3 python3\nRUN git clone 'https://pigweed.googlesource.com/pigweed/pigweed'  --depth 1\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/pigweed/build.sh",
    "content": "#!/bin/bash\n\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/pigweed\n\necho \"Building project using Bazel wrapper.\"\n\nexport BAZEL_FUZZ_TEST_QUERY=\"\nlet all_fuzz_tests = attr(tags, \\\"fuzz-test\\\", \\\"//...\\\") in\nlet lang_fuzz_tests = attr(generator_function, \\\"pw_cc_fuzz_test\\\", \\$all_fuzz_tests) in\n\\$lang_fuzz_tests - attr(tags, \\\"no-oss-fuzz\\\", \\$lang_fuzz_tests)\n\"\n\nexport BAZEL_EXTRA_BUILD_FLAGS=\"\n--config non_hermetic\n--cxxopt=-std=c++17\n--config=googletest\n\"\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/pigweed/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://pigweed.dev/\"\nlanguage: c++\nprimary_contact: \"keir@google.com\"\nauto_ccs:\n  - \"aarongreen@google.com\"\n  - \"alizhang@google.com\"\n  - \"amituttam@google.com\"\n  - \"amontanez@google.com\"\n  - \"asadmemon@google.com\"\n  - \"benlawson@google.com\"\n  - \"cachinchilla@google.com\"\n  - \"chadnorvell@google.com\"\n  - \"davidroth@google.com\"\n  - \"drees@google.com\"\n  - \"erahm@google.com\"\n  - \"ewout@google.com\"\n  - \"frolv@google.com\"\n  - \"fsareshwala@google.com\"\n  - \"hayala@google.com\"\n  - \"hepler@google.com\"\n  - \"jamuraa@google.com\"\n  - \"jgraff@google.com\"\n  - \"joshconner@google.com\"\n  - \"kayce@google.com\"\n  - \"keir@google.com\"\n  - \"konkers@google.com\"\n  - \"phosek@google.com\"\n  - \"prabhukr@google.com\"\n  - \"mohrr@google.com\"\n  - \"saeedali@google.com\"\n  - \"tonymd@google.com\"\n  - \"tpudlik@google.com\"\n  - \"vaas@google.com\"\n  - \"zyecheng@google.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://pigweed.googlesource.com/pigweed/pigweed'\nfuzzing_engines:\n  - afl\n  - centipede\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/pikepdf/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nENV DEBIAN_FRONTEND=noninteractive\nRUN apt-get update && apt-get install -y --no-install-recommends\\\n        cmake \\\n        make \\\n        pkg-config \\\n        clang \\\n        libjpeg-dev \\\n        zlib1g-dev \\\n    && rm -rf /var/lib/apt/lists/*\nRUN apt-get purge -y gcc && apt-get autoremove -y && apt-get clean\n\nRUN pip3 install --upgrade pip\nRUN git clone --depth 1 https://github.com/pikepdf/pikepdf.git pikepdf \\\n        && cp pikepdf/fuzzing/build.sh $SRC/\nRUN git clone --depth 1 https://github.com/qpdf/qpdf.git qpdf\n\nWORKDIR pikepdf\n\n"
  },
  {
    "path": "projects/pikepdf/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://pikepdf.readthedocs.io/en/latest/index.html\"\nlanguage: python\nprimary_contact: \"james@purplerock.ca\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/pikepdf/pikepdf.git\"\n"
  },
  {
    "path": "projects/pillow/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\n# library build dependencies\nRUN apt-get update && \\\n    apt-get install -y \\\n      libxau-dev \\\n      pkg-config \\\n      rsync\n\nRUN git clone --depth 1 https://github.com/python-pillow/Pillow\n\nRUN $SRC/Pillow/Tests/oss-fuzz/build_dictionaries.sh\n\nCOPY build_depends.sh $SRC\n\nRUN cd $SRC/Pillow \\\n    && git submodule update --init wheels/multibuild \\\n    && bash $SRC/build_depends.sh\n\n# install extra test images for a better starting corpus\nRUN cd Pillow/depends && ./install_extra_test_images.sh\n\nRUN python3 -m pip install --upgrade pip\n\nCOPY build.sh $SRC/\n\n# pillow optional runtime dependencies\nRUN apt-get update && \\\n    apt-get install -y \\\n     python3-tk \\\n     tcl8.6-dev \\\n     tk8.6-dev\n\nWORKDIR $SRC/Pillow\n"
  },
  {
    "path": "projects/pillow/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./Tests/oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/pillow/build_depends.sh",
    "content": "#!/bin/bash\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n. wheels/multibuild/common_utils.sh\n\nexport CONFIGURE_BUILD_SOURCED=1\nBUILD_PREFIX=\"${BUILD_PREFIX:-/usr/local}\"\nexport CPPFLAGS=\"-I$BUILD_PREFIX/include $CPPFLAGS\"\nexport LIBRARY_PATH=\"$BUILD_PREFIX/lib:$LIBRARY_PATH\"\nexport PKG_CONFIG_PATH=\"$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH\"\n\n. .github/workflows/wheels-dependencies.sh\n"
  },
  {
    "path": "projects/pillow/project.yaml",
    "content": "homepage: \"https://github.com/python-pillow/Pillow\"\nlanguage: python\nprimary_contact: \"security@tidelift.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"esoroos@gmail.com\"\n  - \"radarhere@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/python-pillow/Pillow'\n"
  },
  {
    "path": "projects/pip/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/pypa/pip/\nWORKDIR $SRC/pip\nCOPY build.sh $SRC/\nCOPY fuzz_* $SRC/\nCOPY requirement_seeds $SRC/requirement_seeds\n"
  },
  {
    "path": "projects/pip/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/pip\npip3 install .\n\ncd $SRC/pip/src\n\n# Build fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\n# Create seeds\nzip -r $OUT/fuzz_requirements_seed_corpus.zip $SRC/requirement_seeds/*\n"
  },
  {
    "path": "projects/pip/fuzz_requirements.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nimport pip._internal.req.req_file as pipreq\nfrom pip._internal.exceptions import RequirementsFileParseError\nfrom pip._internal.network.session import PipSession\n\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  with open(\"temp.req\", \"wb\") as fd:\n      fd.write(input_bytes)\n  try:\n    [_ for _ in pipreq.parse_requirements(\n      \"temp.req\",\n      PipSession(),\n      finder=None,\n      options=None,\n      constraint=None\n    )]\n  except UnicodeDecodeError:\n    # Catch this because I think it's a user issue if Unicode exceptions happen\n    None\n  except RequirementsFileParseError:\n    # Exception thrown by the requirements reader\n    None\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pip/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pypa/pip\nlanguage: python\nmain_repo: https://github.com/pypa/pip\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/pip/requirement_seeds/seed1",
    "content": "beautifulsoup4==4.10.0\ncxxfilt==0.3.0\nlxml==4.6.3\nmatplotlib==3.3.4\nPyYAML==5.4.1\nsoupsieve==2.2.1\nflake8\npep8\nmypy\n"
  },
  {
    "path": "projects/pistache/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install meson==0.53.0 ninja\nRUN git clone --depth 1 https://github.com/pistacheio/pistache pistache\nWORKDIR pistache\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/pistache/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build && cd build\ncmake -DBUILD_SHARED_LIBS=OFF -DPISTACHE_BUILD_TESTS=OFF ..\nmake pistache_static\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -o $OUT/fuzz_parsers \\\n    -std=c++17 -I../include/ ../tests/fuzzers/fuzz_parser.cpp ./src/libpistache.a\n\nzip -q -r -j $OUT/fuzz_parsers_seed_corpus.zip ../tests/fuzzers/corpus\n"
  },
  {
    "path": "projects/pistache/project.yaml",
    "content": "homepage: \"http://pistache.io\"\nlanguage: c++\nprimary_contact: \"kip@thevertigo.com\"\nmain_repo: \"https://github.com/pistacheio/pistache\"\nauto_ccs:\n - \"dennis.jenkins.75@gmail.com\"\n - \"andrea@pappacoda.it\"\n - \"hyperxor@protonmail.com\"\n - \"auquetal@gmail.com\"\n - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/pjsip/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf libtool-bin pkg-config libssl-dev zlib1g-dev\nRUN git clone https://github.com/pjsip/pjproject pjsip\nCOPY build.sh $SRC/\nWORKDIR $SRC/pjsip/\n"
  },
  {
    "path": "projects/pjsip/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport CFLAGS=\"$CFLAGS -DPJMEDIA_HAS_VIDEO=1\"\nexport CXXFLAGS=\"$CFLAGS\"\nexport LDFLAGS=\"$CFLAGS\"\n\n./configure \\\n--disable-ffmpeg --disable-ssl \\\n--disable-speex-aec --disable-g7221-codec \\\n--disable-resample --disable-libwebrtc --disable-libyuv\n\nmake dep\nmake -j$(nproc) --ignore-errors\nmake fuzz\n\npushd tests/fuzz/\nFuzzBins=$(find . -name \"*.c\")\n\nfor File in $FuzzBins; do\n    FuzzBin=$(basename $File .c)\n    cp $FuzzBin $OUT/$FuzzBin\n    echo -e \"[libfuzzer]\\nmax_len=16384\" > $OUT/${FuzzBin}.options\ndone\npopd\n\n# Copy all seed corpus and dictionaries to $OUT\ncp tests/fuzz/seed/* $OUT/\n"
  },
  {
    "path": "projects/pjsip/project.yaml",
    "content": "homepage: \"www.pjsip.org\"\nlanguage: c\nprimary_contact: \"security@pjsip.org\"\nauto_ccs:\n  - \"nanang@teluu.com\"\n  - \"ming@teluu.com\"\n  - \"riza@teluu.com\"\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/pjsip/pjproject'\n"
  },
  {
    "path": "projects/plan9port/Dockerfile",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake\nRUN git clone --depth 1 https://github.com/9fans/plan9port plan9port\nWORKDIR plan9port\nCOPY build.sh *.c *.diff *.options $SRC/\n"
  },
  {
    "path": "projects/plan9port/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Apply fuzzing patches\ngit apply  --ignore-space-change --ignore-whitespace $SRC/fuzz_patch.diff\n\nexport CC9=$CC\nexport CC9FLAGS=\"$CFLAGS\"\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n./INSTALL\n\nplan9_libs=\"-Wl,--start-group ./lib/libframe.a ./lib/libbio.a ./lib/libdisk.a ./lib/lib9.a ./lib/libcomplete.a ./lib/libString.a ./lib/libauth.a ./lib/libmemlayer.a ./lib/libventi.a ./lib/libmux.a ./lib/lib9p.a ./lib/libregexp9.a ./lib/libip.a ./lib/libgeometry.a ./lib/libhtml.a ./lib/libmp.a ./lib/libplumb.a ./lib/libsec.a ./lib/libflate.a ./lib/libhttpd.a ./lib/libndb.a ./lib/libdraw.a ./lib/libmach.a ./lib/libavl.a ./lib/libthread.a ./lib/libauthsrv.a ./lib/libdiskfs.a ./lib/lib9pclient.a ./lib/libsunrpc.a ./lib/libmemdraw.a ./lib/libacme.a ./lib/libbin.a -Wl,--end-group\"\n\n$CC $CFLAGS $LIB_FUZZING_ENGINE -c $SRC/fuzz_libsec.c \\\n    -o fuzz_libsec.o -I./include\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_libsec.o \\\n    -o $OUT/fuzz_libsec -I./include $plan9_libs\n\ncp $SRC/fuzz_libsec.options $OUT/fuzz_libsec.options\n"
  },
  {
    "path": "projects/plan9port/fuzz_libsec.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n\n#include <u.h>\n#include <libc.h>\n#include <auth.h>\n#include <mp.h>\n#include <libsec.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n\tchar *fuzz_der = (char *)malloc(size+1);\n\tif (fuzz_der == NULL){\n\t\treturn 0;\n\t}\n\tmemcpy(fuzz_der, data, size);\n\tfuzz_der[size] = '\\0';\n\tasn1dump(fuzz_der, size);\n\t\n\tfree(fuzz_der);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/plan9port/fuzz_libsec.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/plan9port/fuzz_patch.diff",
    "content": "diff --git a/src/libsec/port/x509.c b/src/libsec/port/x509.c\nindex 4790025..77dfaed 100644\n--- a/src/libsec/port/x509.c\n+++ b/src/libsec/port/x509.c\n@@ -2551,8 +2551,9 @@ asn1dump(uchar *der, int len)\n \tElem e;\n \n \tif(decode(der, len, &e) != ASN_OK){\n-\t\tprint(\"didn't parse\\n\");\n-\t\texits(\"didn't parse\");\n+\t\t//print(\"didn't parse\\n\");\n+\t\t//exits(\"didn't parse\");\n+\t\treturn;\n \t}\n \tedump(e);\n }\n"
  },
  {
    "path": "projects/plan9port/project.yaml",
    "content": "homepage: \"https://github.com/9fans/plan9port\"\nlanguage: c\nmain_repo: 'https://github.com/9fans/plan9port'\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/plexus-utils/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/xml.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XmlStreamReaderFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    cp $SRC/XmlStreamReaderFuzzer_seed_corpus.zip $SRC/MXParserFuzzer_seed_corpus.zip && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/codehaus-plexus/plexus-utils.git plexus-utils\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/plexus-utils\n"
  },
  {
    "path": "projects/plexus-utils/MXParserFuzzer.java",
    "content": "\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport org.codehaus.plexus.util.xml.pull.MXParser;\nimport org.codehaus.plexus.util.xml.pull.XmlPullParserException;\n\npublic class MXParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    MXParser parser = new MXParser();\n    try{\n      parser.setInput(new ByteArrayInputStream(data.consumeRemainingAsBytes()), null);\n      while( parser.nextToken() != MXParser.END_TAG ){\n        //empty body\n      }\n    }\n    catch(XmlPullParserException | IOException e){\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/plexus-utils/MXParserFuzzer.options",
    "content": "[libfuzzer]\ndict = xml.dict\n"
  },
  {
    "path": "projects/plexus-utils/XmlStreamReaderFuzzer.java",
    "content": "\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport org.codehaus.plexus.util.xml.XmlStreamReader;\n\npublic class XmlStreamReaderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      XmlStreamReader xr = new XmlStreamReader(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n    }\n    catch( IOException e){\n      return;\n    }\n  \n  }\n}\n"
  },
  {
    "path": "projects/plexus-utils/XmlStreamReaderFuzzer.options",
    "content": "[libfuzzer]\ndict = xml.dict\n"
  },
  {
    "path": "projects/plexus-utils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/plexus-utils-$CURRENT_VERSION.jar\" $OUT/plexus-utils.jar\n\nALL_JARS=\"plexus-utils.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/plexus-utils/project.yaml",
    "content": "homepage: \"https://github.com/codehaus-plexus/plexus-utils\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/codehaus-plexus/plexus-utils.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/ply/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth=1 https://github.com/dabeaz/ply ply\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/ply\n"
  },
  {
    "path": "projects/ply/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC/ -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ply/fuzz_lex_yacc.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer that creates a simple grammar and parsing routines,\nand then uses that to parse the fuzzer data. The grammer and\nparsing routines can be extended based on coverage analysis.\"\"\"\n\nimport sys\nimport atheris\nimport ply.lex as lex\nimport ply.yacc as yacc\n\n\n# A simple lexer\ntokens = [\n    \"PLUS\",\n    \"MINUS\",\n    \"TIMES\",\n    \"NUMBER\",\n    ]\n\nt_PLUS = r'\\+'\nt_MINUS = r'-'\nt_TIMES = \"\\*\"\nt_ignore = ' \\t'\n\ndef t_NUMBER(t):\n    r'\\d+'\n    t.value = int(t.value)\n    return t\n\ndef t_ignore_newline(t):\n    r'\\n+'\n    t.lexer.lineno += t.value.count('\\n')\n\ndef t_error(t):\n    pass\n\n\n# Some simple parser rules. Note that grammar rules are written as docstrings\n# in each function.\ndef p_expression(p):\n    '''\n    expression : term PLUS term\n               | term MINUS term\n    '''\n    p[0] = ('binop', p[2], p[1], p[3])\n\n\ndef p_expression_term(p):\n    '''\n    expression : term\n    '''\n    p[0] = p[1]\n\ndef p_term(p):\n    '''\n    term : factor TIMES factor\n    '''\n    p[0] = ('binop', p[2], p[1], p[3])\n\ndef p_term_factor(p):\n    '''\n    term : factor\n    '''\n    p[0] = p[1]\n\ndef p_factor_number(p):\n    '''\n    factor : NUMBER\n    '''\n    p[0] = ('number', p[1])\n\ndef p_error(p):\n    pass\n# end of parser functions\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    lex.lex()\n    parser = yacc.yacc()\n    try:\n        parser.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    except lex.LexError:\n        pass\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/ply/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/dabeaz/ply\nlanguage: python\nmain_repo: https://github.com/dabeaz/ply\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pngquant/Dockerfile",
    "content": "# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make libpng-dev autoconf libtool\nRUN git clone --depth 1 https://github.com/kornelski/pngquant\nRUN git clone --depth 1 https://github.com/glennrp/libpng.git $SRC/pngquant/libpng\nWORKDIR $SRC/\nRUN mv $SRC/pngquant/test/oss_fuzz_build.sh $SRC/build.sh\n"
  },
  {
    "path": "projects/pngquant/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://pngquant.org\"\nmain_repo: \"https://github.com/kornelski/pngquant\"\nlanguage: c\nprimary_contact: \"ossfuzz@pngquant.org\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n"
  },
  {
    "path": "projects/poco/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y openssl libssl-dev git make cmake libssl-dev \nRUN git clone --depth 1 https://github.com/pocoproject/poco\nRUN cp $SRC/poco/build/script/oss-fuzz-build.sh $SRC/build.sh\nWORKDIR $SRC/poco\nCOPY run_tests.sh $SRC\n"
  },
  {
    "path": "projects/poco/project.yaml",
    "content": "homepage: \"https://github.com/pocoproject/poco\"\nmain_repo: \"https://github.com/pocoproject/poco\"\nlanguage: c++\nprimary_contact: \"guenter@pocoproject.org\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"alex@pocoproject.org\"\nsanitizers:\n  - address\n  - undefined\n  - memory\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/poco/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Skip failing and network-required test cases and run the remaining unit testing\nctest --test-dir $SRC/poco/cmake-build/ -j$(nproc) -E \"Foundation|NetSSL|Net\"\n"
  },
  {
    "path": "projects/poppler/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone --depth 1 --single-branch https://gitlab.freedesktop.org/poppler/poppler.git\nRUN $SRC/poppler/test/ossfuzz/prepare_build.sh\nRUN cp $SRC/poppler/test/ossfuzz/build_fuzzers.sh $SRC/build.sh\n"
  },
  {
    "path": "projects/poppler/project.yaml",
    "content": "homepage: https://poppler.freedesktop.org/\nlanguage: c++\nprimary_contact: tsdgeos@gmail.com\nsanitizers:\n  - address\n  - memory\n  - undefined\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nauto_ccs:\n  - jonathan@titanous.com\n  - adam.reichold@t-online.de\nmain_repo: 'https://anongit.freedesktop.org/git/poppler/poppler.git'\nfuzzing_engines:\n - afl\n - honggfuzz\n - libfuzzer\n"
  },
  {
    "path": "projects/postfix/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool libdb-dev\nRUN git clone --depth=1 https://github.com/vdukhovni/postfix postfix\nWORKDIR postfix\nCOPY build.sh $SRC/\nCOPY *.c $SRC/\n"
  },
  {
    "path": "projects/postfix/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd postfix\nmake makefiles CCARGS=\"${CFLAGS} -DNO_NIS -DNO_NISPLUS\"\nmake\nBASE=$PWD\n\n# Compile fuzzers\ncd ${BASE}/src/global\n$CC $CFLAGS -DHAS_DEV_URANDOM -DSNAPSHOT -UUSE_DYNAMIC_LIBS -DDEF_SHLIB_DIR=\\\"no\\\" \\\n               -UUSE_DYNAMIC_MAPS -I. -I../../include -DNO_EAI -DDEF_SMTPUTF8_ENABLE=\\\"no\\\" \\\n                -g -O -DLINUX4 -Wformat -Wno-comment -fno-common -c $SRC/fuzz_tok822.c\n$CC $CFLAGS -DHAS_DEV_URANDOM -DSNAPSHOT -UUSE_DYNAMIC_LIBS -DDEF_SHLIB_DIR=\\\"no\\\" \\\n               -UUSE_DYNAMIC_MAPS -I. -I../../include -DNO_EAI -DDEF_SMTPUTF8_ENABLE=\\\"no\\\" \\\n                -g -O -DLINUX4 -Wformat -Wno-comment -fno-common -c $SRC/fuzz_mime.c\n\n# Link fuzzers\ncd ${BASE}\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./src/global/fuzz_tok822.o \\\n  -o $OUT/fuzz_tok822 ./lib/libglobal.a ./lib/libutil.a\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./src/global/fuzz_mime.o -o $OUT/fuzz_mime \\\n  ./lib/libglobal.a ./lib/libutil.a -ldb\n"
  },
  {
    "path": "projects/postfix/fuzz_mime.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <sys_defs.h>\n#include <stdarg.h>\n#include <ctype.h>\n#include <string.h>\n\n#include <mymalloc.h>\n#include <msg.h>\n#include <vstring.h>\n\n#include <rec_type.h>\n#include <is_header.h>\n#include <header_opts.h>\n#include <mail_params.h>\n#include <header_token.h>\n#include <lex_822.h>\n#include <mime_state.h>\n\n#include <stdlib.h>\n#include <stdint.h>\n#include <stringops.h>\n#include <vstream.h>\n#include <msg_vstream.h>\n#include <rec_streamlf.h>\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n\n// Define empty callback functions\nstatic void head_out(void *context, int class, const HEADER_OPTS *unused_info,\n                     VSTRING *buf, off_t offset) {}\nstatic void head_end(void *context) {}\nstatic void body_end(void *context) {}\nstatic void err_print(void *unused_context, int err_flag, const char *text,\n                      ssize_t len) {}\nstatic void body_out(void *context, int rec_type, const char *buf, ssize_t len,\n                     off_t offset) {}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char *new_str = (char *)malloc(size + 1);\n  if (new_str == NULL) {\n    return 0;\n  }\n  memcpy(new_str, data, size);\n  new_str[size] = '\\0';\n\n#define MIME_OPTIONS                                                           \\\n  (MIME_OPT_REPORT_8BIT_IN_7BIT_BODY | MIME_OPT_REPORT_8BIT_IN_HEADER |        \\\n   MIME_OPT_REPORT_ENCODING_DOMAIN | MIME_OPT_REPORT_TRUNC_HEADER |            \\\n   MIME_OPT_REPORT_NESTING | MIME_OPT_DOWNGRADE)\n\n  int rec_type = REC_TYPE_NORM;\n  int err;\n\n  // Simple single call of mime_state_update for now.\n  MIME_STATE *state;\n  msg_vstream_init(\"fuzz_mime\", VSTREAM_OUT);\n  state = mime_state_alloc(MIME_OPTIONS, head_out, head_end, body_out, body_end,\n                           err_print, (void *)VSTREAM_OUT);\n  mime_state_update(state, rec_type, new_str, size);\n  mime_state_free(state);\n\n  free(new_str);\n  return 0;\n}\n"
  },
  {
    "path": "projects/postfix/fuzz_tok822.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <sys_defs.h>\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n\n#include <vstring.h>\n\n#include \"lex_822.h\"\n#include \"quote_822_local.h\"\n#include \"tok822.h\"\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    char *new_str = (char *)malloc(size+1);\n    if (new_str == NULL){\n        return 0;\n    }\n    memcpy(new_str, data, size);\n    new_str[size] = '\\0';\n\n    VSTRING *vp = vstring_alloc(100);\n    TOK822 *list = NULL;\n    list = tok822_parse_limit(new_str, 10);\n    tok822_internalize(vp, list, TOK822_STR_DEFL);\n    tok822_externalize(vp, list,TOK822_STR_DEFL | TOK822_STR_TRNC);\n    tok822_externalize(vp, list,TOK822_STR_DEFL | TOK822_STR_LINE | TOK822_STR_TRNC);\n    tok822_free_tree(list);\n    vstring_free(vp);\n\n    free(new_str);\n    return 0;\n}\n"
  },
  {
    "path": "projects/postfix/project.yaml",
    "content": "homepage: \"http://www.postfix.org/\"\nlanguage: c\nprimary_contact: \"wietse@gmail.com\"\nmain_repo: \"https://github.com/vdukhovni/postfix\"\nauto_ccs:\n  - \"david@adalogics.com\"\nsanitizers:\n  - address\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/postgis/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN git clone --depth 1 https://git.osgeo.org/gitea/postgis/postgis.git postgis\nWORKDIR postgis\nRUN bash ./fuzzers/install_oss_fuzz_build_deps.sh\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/postgis/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# OSS-Fuzz invokes $SRC/build.sh inside the builder image.\n# Keep this file as a thin wrapper into the PostGIS-owned build script.\ncd \"$SRC/postgis\"\nexec bash ./fuzzers/build_oss_fuzz.sh\n"
  },
  {
    "path": "projects/postgis/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"http://postgis.net/\"\nlanguage: c++\nprimary_contact: \"lr@pcorp.us\"\nauto_ccs:\n  - \"even.rouault@gmail.com\"\n  - \"pramsey@cleverelephant.ca\"\n  - \"komzpa@gmail.com\"\nmain_repo: 'https://git.osgeo.org/gitea/postgis/postgis.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/postgresql/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y make libreadline-dev zlib1g-dev bison\\\n    flex pkg-config libicu-dev\n\nRUN git clone https://github.com/postgres/postgres\nRUN zip postgresql_fuzzer_seed_corpus.zip postgres/src/test/regress/sql/*\n\nWORKDIR postgres\nRUN mkdir bld\n\nCOPY fuzzer $SRC/fuzzer\nCOPY build.sh add_fuzzers.diff main.diff $SRC/\n"
  },
  {
    "path": "projects/postgresql/add_fuzzers.diff",
    "content": "diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c\nindex 2f8c3d5f918..d9774758413 100644\n--- a/src/backend/tcop/postgres.c\n+++ b/src/backend/tcop/postgres.c\n@@ -104,6 +104,11 @@ int\t\t\tclient_connection_check_interval = 0;\n /* flags for non-system relation kinds to restrict use */\n int\t\t\trestrict_nonsystem_relation_kind;\n \n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+bool        fuzzer_first_run = true;\n+#endif\n+\n+\n /* ----------------\n  *\t\tprivate typedefs etc\n  * ----------------\n@@ -480,11 +485,14 @@ static int\n ReadCommand(StringInfo inBuf)\n {\n \tint\t\t\tresult;\n-\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+\tresult = SocketBackend(inBuf);\n+#else\n \tif (whereToSendOutput == DestRemote)\n \t\tresult = SocketBackend(inBuf);\n \telse\n \t\tresult = InteractiveBackend(inBuf);\n+#endif\n \treturn result;\n }\n \n@@ -4190,6 +4198,11 @@ PostgresMain(const char *dbname, const char *username)\n \tvolatile bool idle_in_transaction_timeout_enabled = false;\n \tvolatile bool idle_session_timeout_enabled = false;\n \n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+       if(fuzzer_first_run)\n+       {\n+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */\n+\n \tAssert(dbname != NULL);\n \tAssert(username != NULL);\n \n@@ -4509,6 +4522,11 @@ PostgresMain(const char *dbname, const char *username)\n \tif (!ignore_till_sync)\n \t\tsend_ready_for_query = true;\t/* initially, or after error */\n \n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+        fuzzer_first_run=false;\n+            }\n+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */\n+\n \t/*\n \t * Non-error queries loop here.\n \t */\ndiff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c\nindex 47af743990f..476e336d418 100644\n--- a/src/backend/utils/error/elog.c\n+++ b/src/backend/utils/error/elog.c\n@@ -540,7 +540,7 @@ errfinish(const char *filename, int lineno, const char *funcname)\n \t}\n \n \t/* Emit the message to the right places */\n-\tEmitErrorReport();\n+ \t//EmitErrorReport();\n \n \t/* Now free up subsidiary data attached to stack entry, and release it */\n \tFreeErrorDataContents(edata);\n"
  },
  {
    "path": "projects/postgresql/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Apply diff for fuzzers\ncp -r $SRC/fuzzer src/backend/\ngit apply --ignore-space-change --ignore-whitespace  ../add_fuzzers.diff\n\n# Change permission for fuzzers\nuseradd fuzzuser\nchown -R fuzzuser .\n\ncd bld\n\n# Build icu 66 for postgres\nwget https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz\ntar -xzf icu4c-66_1-src.tgz\npushd icu/source\n./configure --prefix=/opt/icu66  --enable-renaming CC=clang CXX=clang++ CFLAGS=\"\" CXXFLAGS=\"\"\nmake -j$(nproc)\nmake install\npopd\n\n# Add environment flags for icu 66\nexport PKG_CONFIG_PATH=/opt/icu66/lib/pkgconfig\nexport LD_LIBRARY_PATH=/opt/icu66/lib\nexport ICU_CFLAGS=\"-I/opt/icu66/include\"\nexport ICU_LIBS=\"-L/opt/icu66/lib -licui18n -licuuc -licudata\"\n\nCC=\"\" CXX=\"\" CFLAGS=\"\" CXXFLAGS=\"\" su fuzzuser -c ../configure\ncd src/backend/fuzzer\nsu fuzzuser -c \"make -j10 createdb\"\nchown -R root .\nmv temp/data .\ncp -r data $OUT/\ncd ../../..\ncp -r tmp_install $OUT/\nmake clean\n\n../configure\nmake -j$(nproc)\n\n# Manually remove main function from main.c and recompile it\ncd ../\ngit apply --ignore-space-change --ignore-whitespace  $SRC/main.diff\ncd bld\n$CC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -I./src/include -I./src/include/port -I../src/include -fPIC -c ../src/backend/main/main.c -o ./src/backend/main/main.o\n\n# Package static library\ncd src/backend\nar rcs libpostgres.a $(find . -name '*.o' | grep -v '^./fuzzer/')\n\ncd fuzzer\nmake -j$(nproc) fuzzer\n#if [ \"$FUZZING_ENGINE\" = \"afl\" ]\n#then\nrm protocol_fuzzer\n#fi\ncp *_fuzzer $OUT/\ncp $SRC/postgresql_fuzzer_seed_corpus.zip $OUT/\n"
  },
  {
    "path": "projects/postgresql/fuzzer/Makefile",
    "content": "#-------------------------------------------------------------------------\n#\n# Makefile for the fuzzer module\n#\n# src/backend/fuzzer/Makefile\n#\n#-------------------------------------------------------------------------\nsubdir = src/backend/fuzzer\ntop_builddir = ../../..\ninclude $(top_builddir)/src/Makefile.global\n\nsubsysfilename = objfiles.txt\n\nSUBDIROBJS = $(SUBDIRS:%=%/$(subsysfilename))\n\n# make function to expand objfiles.txt contents\nexpand_subsys = $(foreach file,$(1),$(if $(filter %/objfiles.txt,$(file)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file)))),$(file)))\n\nobjfiles.txt: Makefile $(SUBDIROBJS) $(OBJS_FUZZERS)\n# Don't rebuild the list if only the OBJS have changed.\n\t $(if $(filter-out $(OBJS_FUZZERS),$?),( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS_FUZZERS)) ) >$@,touch $@)\n\nSUBDIRS = ../access ../bootstrap ../catalog ../parser ../commands ../executor ../foreign ../lib ../libpq \\\n\t../main ../nodes ../optimizer ../partitioning ../port ../postmaster \\\n\t../regex ../replication ../rewrite ../backup \\\n\t../statistics ../storage ../tcop ../tsearch ../utils $(top_builddir)/src/timezone \\\n\t../jit\n\nOBJS = \\\n\t$(LOCALOBJS) \\\n\t$(SUBDIROBJS) \\\n\t$(top_builddir)/src/common/libpgcommon_srv.a \\\n\t$(top_builddir)/src/port/libpgport_srv.a \\\n        $(top_builddir)/src/backend/libpostgres.a \\\n\nOBJS_FUZZERS = $(filter-out ../main/objfiles.txt, $(OBJS))\n\ncreatedb: dbfuzz\n\nfuzzer: simple_query_fuzzer \\\n\tjson_parser_fuzzer \\\n\tprotocol_fuzzer\n\nsimple_query_fuzzer json_parser_fuzzer: %: %.o fuzzer_initialize.o $(OBJS_FUZZERS)\n\t$(CXX) $(CFLAGS) $(call expand_subsys,$^) -o $@ -l:libicui18n.a -l:libicuuc.a -l:libicudata.a $(LIB_FUZZING_ENGINE) -lz -lpthread -ldl -lrt\n\nsimple_query_fuzzer.o json_parser_fuzzer.o protocol_fuzzer.o fuzzer_initialize.o: %.o: %.c\n\t$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $^\n\nprotocol_fuzzer: %: %.o $(OBJS_FUZZERS)\n\t$(CXX) $(CFLAGS) $(call expand_subsys,$^) -o $@ -l:libicui18n.a -l:libicuuc.a -l:libicudata.a $(LIB_FUZZING_ENGINE) -Wl,--wrap=exit -Wl,--wrap=pq_getbyte -lz -lpthread -ldl -lrt\n\ndbfuzz: dbfuzz.o | submake-libpgport temp-install\n\t$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@ \\\n\t&& PATH=\"$(abs_top_builddir)/tmp_install$(bindir):$$PATH\" LD_LIBRARY_PATH=\"$(abs_top_builddir)/tmp_install/usr/local/pgsql/lib\" ./dbfuzz\n\ndbfuzz.o: dbfuzz.c $(top_builddir)/src/port/pg_config_paths.h\ndbfuzz.o: override CPPFLAGS := $(CPPFLAGS) -I$(top_builddir)/src/port -I$(top_builddir)/../src/test/regress '-DSHELLPROG=\"$(SHELL)\"'\n\n$(top_builddir)/src/port/pg_config_paths.h: | submake-libpgport\n\t$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h\n"
  },
  {
    "path": "projects/postgresql/fuzzer/dbfuzz.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\n/*-------------------------------------------------------------------------\n *\n * \n * This code is released under the terms of the PostgreSQL License.\n *\n * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group\n * Portions Copyright (c) 1994, Regents of the University of California\n *\n *-------------------------------------------------------------------------\n */\n#include \"postgres_fe.h\"\n\n#include <sys/stat.h>\n#include <sys/wait.h>\n\n#include \"common/logging.h\"\n#include \"common/restricted_token.h\"\n#include \"libpq/pqcomm.h\"\n#include \"pg_config_paths.h\"\n#include \"pg_regress.h\"\n\nconst char *progname = \"progname\";\nstatic char *shellprog = SHELLPROG;\nchar *outputdir = \".\";\nstatic char *temp_instance = NULL;\nstatic int port = -1;\nstatic const char *sockdir;\nstatic PID_TYPE postmaster_pid = INVALID_PID;\n\nstatic void psql_command(const char *database, const char *query, ...) {\n  char query_formatted[1024];\n  char query_escaped[2048];\n  char psql_cmd[MAXPGPATH + 2048];\n  va_list args;\n  char *s;\n  char *d;\n\n  va_start(args, query);\n  vsnprintf(query_formatted, sizeof(query_formatted), query, args);\n  va_end(args);\n\n  d = query_escaped;\n  for (s = query_formatted; *s; s++) {\n    if (strchr(\"\\\\\\\"$`\", *s))\n      *d++ = '\\\\';\n    *d++ = *s;\n  }\n  *d = '\\0';\n\n  snprintf(psql_cmd, sizeof(psql_cmd), \"\\\"%s%spsql\\\" -X -c \\\"%s\\\" \\\"%s\\\"\",\n           \"\", \"\", query_escaped, database);\n\n  system(psql_cmd);\n}\n\nPID_TYPE\nspawn_process(const char *cmdline) {\n  pid_t pid;\n  pid = fork();\n  if (pid == 0) {\n    char *cmdline2;\n    cmdline2 = psprintf(\"exec %s\", cmdline);\n    execl(shellprog, shellprog, \"-c\", cmdline2, (char *)NULL);\n    fprintf(stderr, _(\"%s: could not exec \\\"%s\\\": %s\\n\"), progname, shellprog,\n            strerror(errno));\n    _exit(1);\n  }\n\n  return pid;\n}\n\nint main() {\n  int i;\n  char buf[MAXPGPATH * 4];\n  char buf2[MAXPGPATH * 4];\n  char *db_name = \"./dbfuzz\";\n  int wait_seconds = 60;\n\n  pg_logging_init(db_name);\n  progname = get_progname(db_name);\n  set_pglocale_pgservice(db_name, PG_TEXTDOMAIN(\"pg_dbfuzz\"));\n  get_restricted_token();\n\n  temp_instance = make_absolute_path(\"./temp\");\n  port = 0xC000 | (PG_VERSION_NUM & 0x3FFF);\n  outputdir = make_absolute_path(outputdir);\n  sockdir = mkdtemp(psprintf(\"/tmp/pg_dbfuzz-XXXXXX\"));\n  putenv(psprintf(\"PGHOST=%s\", sockdir));\n\n  mkdir(temp_instance, S_IRWXU | S_IRWXG | S_IRWXO);\n\n  snprintf(buf, sizeof(buf), \"%s/log\", outputdir);\n  mkdir(buf, S_IRWXU | S_IRWXG | S_IRWXO);\n\n  snprintf(buf, sizeof(buf),\n           \"\\\"%s%sinitdb\\\" -D \\\"%s/data\\\" --no-clean --no-sync > \"\n           \"\\\"%s/log/initdb.log\\\" 2>&1\",\n           \"\", \"\", temp_instance, outputdir);\n  system(buf);\n\n  snprintf(buf, sizeof(buf), \"%s/data/postgresql.conf\", temp_instance);\n\n  snprintf(buf2, sizeof(buf2), \"\\\"%s%spsql\\\" -X postgres <%s 2>%s\", \"\", \"\",\n           DEVNULL, DEVNULL);\n\n  snprintf(buf, sizeof(buf),\n           \"\\\"%s%spostgres\\\" -D \\\"%s/data\\\" -F%s \"\n           \"-c \\\"listen_addresses=%s\\\" -k \\\"%s\\\" \"\n           \"> \\\"%s/log/postmaster.log\\\" 2>&1\",\n           \"\", \"\", temp_instance, \"\", \"\", sockdir, outputdir);\n\n  postmaster_pid = spawn_process(buf);\n\n  for (i = 0; i < wait_seconds; i++) {\n    if (system(buf2) == 0)\n      break;\n    waitpid(postmaster_pid, NULL, WNOHANG);\n    pg_usleep(1000000L);\n  }\n\n  psql_command(\"postgres\", \"CREATE DATABASE \\\"%s\\\" TEMPLATE=template0%s\",\n               \"dbfuzz\", \"\");\n\n  snprintf(buf, sizeof(buf), \"\\\"%s%spg_ctl\\\" stop -D \\\"%s/data\\\" -s\", \"\",\n           \"\", temp_instance);\n  system(buf);\n\n  rmdir(sockdir);\n  return 0;\n}\n"
  },
  {
    "path": "projects/postgresql/fuzzer/fuzzer_initialize.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////////\n\n#include \"postgres.h\"\n\n#include \"access/xlog.h\"\n#include \"access/xact.h\"\n#include \"common/username.h\"\n#include \"executor/spi.h\"\n#include \"jit/jit.h\"\n#include \"libpq/libpq.h\"\n#include \"libpq/pqsignal.h\"\n#include \"miscadmin.h\"\n#include \"optimizer/optimizer.h\"\n#include \"parser/analyze.h\"\n#include \"parser/parser.h\"\n#include \"storage/proc.h\"\n#include \"tcop/tcopprot.h\"\n#include \"utils/datetime.h\"\n#include \"utils/memutils.h\"\n#include \"utils/portal.h\"\n#include \"utils/snapmgr.h\"\n#include \"utils/timeout.h\"\n\n#include <libgen.h>\n\nextern const char *progname;\nstatic MemoryContext row_description_context = NULL;\nstatic StringInfoData row_description_buf;\nstatic const char *username = \"username\";\n\nint FuzzerInitialize(char *dbname, char ***argv){\n  char *av[5];\n  char arg_path[50];\n  char path_to_db[50];\n  char untar[100];\n  char *exe_path = (*argv)[0];\n  //dirname() can modify its argument\n  char *exe_path_copy = strdup(exe_path);\n  char *dir = dirname(exe_path_copy);\n  chdir(dir);\n  free(exe_path_copy);\n\n  snprintf(arg_path, sizeof(arg_path), \"/tmp/%s/data\", dbname);\n  snprintf(path_to_db, sizeof(path_to_db), \"-D\\\"/tmp/%s/data\\\"\", dbname);\n  snprintf(untar, sizeof(untar), \"rm -rf /tmp/%s; mkdir /tmp/%s; cp -r data /tmp/%s\", dbname, dbname, dbname);\n\n  av[0] = \"tmp_install/usr/local/pgsql/bin/postgres\";\n  av[1] = path_to_db;\n  av[2] = \"-F\";\n  av[3] = \"-k\\\"/tmp\\\"\";\n  av[4] = NULL;\n\n  system(untar);\n\n  progname = get_progname(av[0]);\n  MemoryContextInit();\n\n  InitStandaloneProcess(av[0]);\n  SetProcessingMode(InitProcessing);\n  InitializeGUCOptions();\n  process_postgres_switches(4, av, PGC_POSTMASTER, NULL);\n\n  SelectConfigFiles(arg_path, progname);\n\n  checkDataDir();\n  ChangeToDataDir();\n  CreateDataDirLockFile(false);\n  LocalProcessControlFile(false);\n  InitializeMaxBackends();\n\n  // CreateSharedMemoryAndSemaphores();\n  InitProcess();\n  BaseInit();\n  sigprocmask(SIG_SETMASK, &UnBlockSig, NULL);\n  InitPostgres(\"dbfuzz\", InvalidOid, username, InvalidOid, false, false);\n\n  SetProcessingMode(NormalProcessing);\n\n  BeginReportingGUCOptions();\n  process_session_preload_libraries();\n\n  MessageContext = AllocSetContextCreate(TopMemoryContext,\n\t\t\t\t\t \"MessageContext\",\n\t\t\t\t\t ALLOCSET_DEFAULT_SIZES);\n  row_description_context = AllocSetContextCreate(TopMemoryContext,\n\t\t\t\t\t\t  \"RowDescriptionContext\",\n\t\t\t\t\t\t  ALLOCSET_DEFAULT_SIZES);\n  MemoryContextSwitchTo(row_description_context);\n  initStringInfo(&row_description_buf);\n  MemoryContextSwitchTo(TopMemoryContext);\n\n  PgStartTime = GetCurrentTimestamp();\n  whereToSendOutput = DestNone;\n  Log_destination = 0;\n  return 0;\n}\n"
  },
  {
    "path": "projects/postgresql/fuzzer/json_parser_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////////\n\n#include \"postgres.h\"\n\n#include \"common/jsonapi.h\"\n#include \"mb/pg_wchar.h\"\n#include \"utils/memutils.h\"\n#include \"utils/memdebug.h\"\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n\t//FuzzerInitialize(\"json_db\", argv);\n\treturn 0;\n}\n\n/*\n** Main entry point.  The fuzzer invokes this function with each\n** fuzzed input.\n*/\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n\tsigjmp_buf local_sigjmp_buf;\n\tchar *buffer;\n\tJsonSemAction sem;\n\tJsonLexContext *lex;\n\n\tbuffer = (char *) calloc(size+1, sizeof(char));\n\tmemcpy(buffer, data, size);\n\n\tMemoryContextInit();\n\tset_stack_base();\n\tsem = nullSemAction;\n\tlex = makeJsonLexContextCstringLen(NULL, buffer, size+1, PG_UTF8, true);\n\n\tif(!sigsetjmp(local_sigjmp_buf,0)){\n\t\terror_context_stack = NULL;\n\t\tPG_exception_stack = &local_sigjmp_buf;\n\t\tpg_parse_json(lex, &sem);\n\t}\n\tfree(buffer);\n\tFlushErrorState();\n\tMemoryContextReset(TopMemoryContext);\n\tTopMemoryContext->ident = NULL;\n\tTopMemoryContext->methods->delete_context(TopMemoryContext);\n\tVALGRIND_DESTROY_MEMPOOL(TopMemoryContext);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/postgresql/fuzzer/protocol_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////////\n\n#include \"postgres.h\"\n\n#include \"access/xlog.h\"\n#include \"access/xact.h\"\n#include \"common/ip.h\"\n#include \"common/username.h\"\n#include \"executor/spi.h\"\n#include \"jit/jit.h\"\n#include \"libpq/auth.h\"\n#include \"libpq/libpq.h\"\n#include \"libpq/pqsignal.h\"\n#include \"miscadmin.h\"\n#include \"optimizer/optimizer.h\"\n#include \"parser/analyze.h\"\n#include \"parser/parser.h\"\n#include \"storage/proc.h\"\n#include \"tcop/tcopprot.h\"\n#include \"utils/datetime.h\"\n#include \"utils/memutils.h\"\n#include \"utils/memdebug.h\"\n#include \"utils/pidfile.h\"\n#include \"utils/portal.h\"\n#include \"utils/snapmgr.h\"\n#include \"utils/ps_status.h\"\n#include \"utils/timeout.h\"\n\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <libgen.h>\n\nstatic sigjmp_buf postgre_exit;\nstatic bool postgre_started;\nstatic char *buffer;\nstatic size_t buffersize;\nstatic char *bufferpointer;\nstatic char *av[6];\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n\tchar *exe_path = (*argv)[0];\n\t//dirname() can modify its argument\n\tchar *exe_path_copy = strdup(exe_path);\n\tchar *dir = dirname(exe_path_copy);\n\tchdir(dir);\n\tfree(exe_path_copy);\n\t\n\tav[0] = \"tmp_install/usr/local/pgsql/bin/postgres\";\n\tav[1] = \"--single\";\n\tav[2] = \"-D/tmp/protocol_db/data\";\n\tav[3] = \"-F\";\n\tav[4] = \"-k\\\"/tmp\\\"\";\n\tav[5] = NULL;\n\n\tsystem(\"rm -rf /tmp/protocol_db; mkdir /tmp/protocol_db; cp -r data /tmp/protocol_db\");\n\tsystem(\"cp -r tmp_install /tmp/\");\n\n\tMemoryContextInit();\n\tif(!sigsetjmp(postgre_exit, 0)){\n\t\tpostgre_started = true;\n\t\tPostgresSingleUserMain(5, av, \"fuzzuser\");\n\t}\n\tpq_endmsgread();\n\treturn 0;\n}\n\nvoid __wrap_exit(int status){\n\tif(postgre_started)\n\t\tsiglongjmp(postgre_exit, 1);\n\telse\n\t\t__real_exit(status);\n}\n\nint __wrap_pq_getbyte(void){\n\tif(!buffersize) return EOF;\n\tunsigned char cur = buffer[0];\n\tbufferpointer++; buffersize--;\n\treturn cur;\n}\n\n/*\n** Main entry point.  The fuzzer invokes this function with each\n** fuzzed input.\n*/\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n\tbuffersize = size;\n\tbuffer = (char *) calloc(size, sizeof(char));\n\tbufferpointer = buffer;\n\tmemcpy(buffer, data, size);\n\n\tif(!sigsetjmp(postgre_exit, 0)){\n\t\tpostgre_started = true;\n\t\tPostgresSingleUserMain(5, av, \"fuzzuser\");\n\t}\n\tpq_endmsgread();\n\tpostgre_started = false;\n\tfree(buffer);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/postgresql/fuzzer/simple_query_fuzzer.c",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////////\n\n#include \"postgres.h\"\n\n#include \"access/xlog.h\"\n#include \"access/xact.h\"\n#include \"common/username.h\"\n#include \"executor/spi.h\"\n#include \"jit/jit.h\"\n#include \"libpq/libpq.h\"\n#include \"libpq/pqsignal.h\"\n#include \"miscadmin.h\"\n#include \"optimizer/optimizer.h\"\n#include \"parser/analyze.h\"\n#include \"parser/parser.h\"\n#include \"storage/proc.h\"\n#include \"tcop/tcopprot.h\"\n#include \"utils/datetime.h\"\n#include \"utils/memutils.h\"\n#include \"utils/portal.h\"\n#include \"utils/snapmgr.h\"\n#include \"utils/timeout.h\"\n\nstatic void exec_simple_query(const char *query_string) {\n  MemoryContext oldcontext;\n  List *parsetree_list;\n  ListCell *parsetree_item;\n\n  oldcontext = MemoryContextSwitchTo(MessageContext);\n  parsetree_list = raw_parser(query_string, RAW_PARSE_TYPE_NAME);\n  MemoryContextSwitchTo(oldcontext);\n\n  foreach (parsetree_item, parsetree_list) {\n    RawStmt *parsetree = lfirst_node(RawStmt, parsetree_item);\n    MemoryContext per_parsetree_context = NULL;\n    List *querytree_list;\n\n    if (lnext(parsetree_list, parsetree_item) != NULL) {\n      per_parsetree_context =\n          AllocSetContextCreate(MessageContext, \"per-parsetree message context\", ALLOCSET_DEFAULT_SIZES);\n      oldcontext = MemoryContextSwitchTo(per_parsetree_context);\n    } else {\n      oldcontext = MemoryContextSwitchTo(MessageContext);\n    }\n\n    querytree_list = pg_analyze_and_rewrite_fixedparams(parsetree, query_string, NULL, 0, NULL);\n    pg_plan_queries(querytree_list, query_string, CURSOR_OPT_PARALLEL_OK, NULL);\n\n    if (per_parsetree_context) {\n      MemoryContextDelete(per_parsetree_context);\n    } else {\n      MemoryContextSwitchTo(oldcontext);\n    }\n  }\n}\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n  MemoryContextInit();\n  InitializeGUCOptions();\n  InitializeMaxBackends();\n\n  MessageContext = AllocSetContextCreate(TopMemoryContext,\n                                         \"MessageContext\",\n                                         ALLOCSET_DEFAULT_SIZES);\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size == 0)\n    return 0;\n\n  sigjmp_buf local_sigjmp_buf;\n  char *query_string = (char *) calloc(size + 1, sizeof(char));\n  memcpy(query_string, data, size);\n\n  if (!sigsetjmp(local_sigjmp_buf, 0)) {\n    PG_exception_stack = &local_sigjmp_buf;\n    error_context_stack = NULL;\n    set_stack_base();\n\n    disable_all_timeouts(false);\n    QueryCancelPending = false;\n    pq_comm_reset();\n    EmitErrorReport();\n    jit_reset_after_error();\n\n    MemoryContextSwitchTo(TopMemoryContext);\n    FlushErrorState();\n    MemoryContextSwitchTo(MessageContext);\n    MemoryContextReset(MessageContext);\n    SetCurrentStatementStartTimestamp();\n\n    exec_simple_query(query_string);\n  }\n\n  free(query_string);\n  return 0;\n}\n"
  },
  {
    "path": "projects/postgresql/main.diff",
    "content": "diff --git a/src/backend/main/main.c b/src/backend/main/main.c\nindex 7d63cf94a6b..d10f721dadc 100644\n--- a/src/backend/main/main.c\n+++ b/src/backend/main/main.c\n@@ -64,6 +64,7 @@ static void help(const char *progname);\n static void check_root(const char *progname);\n\n\n+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n /*\n  * Any Postgres server process begins execution here.\n  */\n@@ -231,6 +232,7 @@ main(int argc, char *argv[])\n        /* the functions above should not return */\n        abort();\n }\n+#endif\n\n /*\n  * Returns the matching DispatchOption value for the given option name.  If no\n"
  },
  {
    "path": "projects/postgresql/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://postgresql.org\"\nmain_repo: \"https://git.postgresql.org/git/postgresql\"\nprimary_contact: \"sfrost@snowman.net\"\nlanguage: c\nauto_ccs:\n  - \"ouyangyunshu@google.com\"\n  - \"frost.stephen.p@gmail.com\"\n  - \"aseering@google.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/powerdns/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# base image with clang toolchain\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# install required packages to build your project\nRUN apt-get update && apt-get install -y autoconf automake bison dh-autoreconf flex libluajit-5.1-dev libedit-dev libprotobuf-dev libssl-dev libtool make pkg-config protobuf-compiler ragel\nRUN wget https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2  # Temporarily use manual installation over the outdated libboost-dev package\n\n# checkout all sources needed to build your project\nRUN git clone https://github.com/PowerDNS/pdns.git pdns\n\n# current directory for build script\nWORKDIR pdns\n\n# copy build script and other fuzzer files in src dir\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/powerdns/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# remove dependencies on boost's program_options, we don't need it\n# and it won't link because oss-fuzz adds -stdlib=libc++ to the flags,\n# which would require rebuilding boost\nsed -i 's/BOOST_PROGRAM_OPTIONS(\\[mt\\])//' configure.ac\nsed -i 's/AC_MSG_ERROR(\\[Boost Program Options library not found\\])/AC_MSG_NOTICE(\\[Boost Program Options library not found\\])/' configure.ac\n# we also need to disable building as PIE because libFuzzingEngine.a\n# does not appear to be compiled as PIC\nsed -i 's/AC_CC_PIE//' configure.ac\n\n# Install Boost headers\n(\n cd $SRC/\n tar jxf boost_1_84_0.tar.bz2\n cd boost_1_84_0/\n CFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\n CFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\n cp -R boost/ /usr/include/\n)\n\n# build fuzzing targets\nautoreconf -vi\n./configure \\\n    --without-dynmodules \\\n    --with-modules='' \\\n    --disable-lua-records \\\n    --disable-ixfrdist \\\n    --enable-fuzz-targets \\\n    --disable-dependency-tracking \\\n    --disable-silent-rules || /bin/bash\n\nif [ -d ext/arc4random/ ]; then\n    make -j$(nproc) -C ext/arc4random/\nfi\nmake -j$(nproc) -C ext/yahttp/\ncd pdns\nmake -j$(nproc) fuzz_targets\n\n# copy the fuzzing target binaries\ncp fuzz_target_* \"${OUT}/\"\n\n# build the dnsdist fuzzing target, if any\nif [ -f dnsdistdist/fuzz_dnsdistcache.cc ]; then\n    cd dnsdistdist\n    sed -i 's/AC_CC_PIE//' configure.ac\n    autoreconf -vi\n    ./configure \\\n        --enable-fuzz-targets \\\n        --disable-dependency-tracking \\\n        --disable-silent-rules || /bin/bash\n    if [ -d ext/arc4random/ ]; then\n        make -j$(nproc) -C ext/arc4random/\n    fi\n    make -j$(nproc) fuzz_targets\n\n    # copy the fuzzing target binaries\n    cp fuzz_target_* \"${OUT}/\"\n\n    # back to the pdns/ directory\n    cd ..\nfi\n\n# back to the checkout directory\ncd ..\n\n# copy the zones used in the regression tests to the \"zones\" corpus\ncp regression-tests/zones/* fuzzing/corpus/zones/\n\n# generate the corpus files\nif [ -d fuzzing/corpus/raw-dns-packets/ ]; then\n    zip -j \"${OUT}/fuzz_target_dnsdistcache_seed_corpus.zip\" fuzzing/corpus/raw-dns-packets/*\nfi\nif [ -d fuzzing/corpus/txt-records/ ]; then\n    zip -j \"${OUT}/fuzz_target_dnslabeltext_parseRFC1035CharString_seed_corpus.zip\" fuzzing/corpus/txt-records/*\nfi\nif [ -d fuzzing/corpus/raw-dns-packets/ ]; then\n    zip -j \"${OUT}/fuzz_target_moadnsparser_seed_corpus.zip\" fuzzing/corpus/raw-dns-packets/*\nfi\nif [ -d fuzzing/corpus/raw-dns-packets/ ]; then\n    zip -j \"${OUT}/fuzz_target_packetcache_seed_corpus.zip\" fuzzing/corpus/raw-dns-packets/*\nfi\nif [ -d fuzzing/corpus/proxy-protocol-raw-packets/ ]; then\n    zip -j \"${OUT}/fuzz_target_proxyprotocol_seed_corpus.zip\" fuzzing/corpus/proxy-protocol-raw-packets/*\nfi\nif [ -d fuzzing/corpus/zones/ ]; then\n    zip -j \"${OUT}/fuzz_target_zoneparsertng_seed_corpus.zip\" fuzzing/corpus/zones/*\nfi\nif [ -d fuzzing/corpus/http-raw-payloads/ ]; then\n    zip -j \"${OUT}/fuzz_target_yahttp_seed_corpus.zip\" fuzzing/corpus/http-raw-payloads/*\nfi\n"
  },
  {
    "path": "projects/powerdns/project.yaml",
    "content": "homepage: \"https://www.powerdns.com/\"\nlanguage: c++\nprimary_contact: \"remi.gacogne@powerdns.com\"\nauto_ccs:\n  - \"powerdnsossfuzz@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/PowerDNS/pdns.git'\n"
  },
  {
    "path": "projects/powsybl-java/DeserializeFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// You may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.core.JsonFactory;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationConfig;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.deser.DefaultDeserializationContext;\nimport com.fasterxml.jackson.databind.deser.std.StdDeserializer;\nimport com.powsybl.action.json.ActionListDeserializer;\nimport com.powsybl.action.json.DanglingLineActionBuilderBuilderDeserializer;\nimport com.powsybl.action.json.GeneratorActionBuilderDeserializer;\nimport com.powsybl.action.json.HvdcActionBuilderDeserializer;\nimport com.powsybl.action.json.LoadActionBuilderBuilderDeserializer;\nimport com.powsybl.action.json.MultipleActionsActionBuilderDeserializer;\nimport com.powsybl.action.json.PercentChangeLoadActionBuilderDeserializer;\nimport com.powsybl.action.json.PhaseTapChangerRegulationActionBuilderBuilderDeserializer;\nimport com.powsybl.action.json.PhaseTapChangerTapPositionActionBuilderDeserializer;\nimport com.powsybl.action.json.RatioTapChangerRegulationActionBuilderBuilderDeserializer;\nimport com.powsybl.action.json.RatioTapChangerTapPositionActionBuilderDeserializer;\nimport com.powsybl.action.json.ShuntCompensatorPositionActionBuilderDeserializer;\nimport com.powsybl.action.json.StaticVarCompensatorActionBuilderDeserializer;\nimport com.powsybl.action.json.SwitchActionBuilderDeserializer;\nimport com.powsybl.action.json.TerminalsConnectionActionBuilderDeserializer;\nimport com.powsybl.commons.PowsyblException;\nimport com.powsybl.contingency.contingency.list.IdentifierContingencyListDeserializer;\nimport com.powsybl.contingency.json.ContingencyDeserializer;\nimport com.powsybl.contingency.json.ContingencyElementDeserializer;\nimport com.powsybl.contingency.json.ContingencyListDeserializer;\nimport com.powsybl.contingency.json.DefaultContingencyListDeserializer;\nimport com.powsybl.contingency.json.HvdcLineCriterionContingencyListDeserializer;\nimport com.powsybl.contingency.json.InjectionCriterionContingencyListDeserializer;\nimport com.powsybl.contingency.json.LineCriterionContingencyListDeserializer;\nimport com.powsybl.contingency.json.ListOfContingencyListsDeserializer;\nimport com.powsybl.contingency.json.ThreeWindingsTransformerCriterionContingencyListDeserializer;\nimport com.powsybl.contingency.json.TieLineCriterionContingencyListDeserializer;\nimport com.powsybl.contingency.json.TwoWindingsTransformerCriterionContingencyListDeserializer;\nimport com.powsybl.iidm.criteria.json.CriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.DanglingLineCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.IdentifiableCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.LineCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.NetworkElementIdListCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.ThreeWindingsTransformerCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.TieLineCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.TwoWindingsTransformerCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.VoltageIntervalDeserializer;\nimport com.powsybl.iidm.criteria.json.duration.AllTemporaryDurationCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.duration.EqualityTemporaryDurationCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.duration.IntervalTemporaryDurationCriterionDeserializer;\nimport com.powsybl.iidm.criteria.json.duration.PermanentDurationCriterionDeserializer;\nimport com.powsybl.iidm.geodata.utils.GeoShapeDeserializer;\nimport com.powsybl.iidm.network.identifiers.json.IdentifierDeserializer;\nimport com.powsybl.sensitivity.json.SensitivityContingencyStatusJsonDeserializer;\nimport com.powsybl.sensitivity.json.SensitivityFactorJsonDeserializer;\nimport com.powsybl.sensitivity.json.SensitivityValueJsonDeserializer;\nimport com.powsybl.sensitivity.json.SensitivityVariableSetJsonDeserializer;\nimport com.powsybl.shortcircuit.json.ShortCircuitParametersDeserializer;\nimport com.powsybl.shortcircuit.json.VoltageRangeDeserializer;\nimport com.powsybl.timeseries.json.DataChunkJsonDeserializer;\nimport com.powsybl.timeseries.json.DoubleDataChunkJsonDeserializer;\nimport com.powsybl.timeseries.json.DoubleTimeSeriesJsonDeserializer;\nimport com.powsybl.timeseries.json.NodeCalcJsonDeserializer;\nimport com.powsybl.timeseries.json.StringDataChunkJsonDeserializer;\nimport com.powsybl.timeseries.json.StringTimeSeriesJsonDeserializer;\nimport com.powsybl.timeseries.json.TimeSeriesJsonDeserializer;\nimport com.powsybl.timeseries.json.TimeSeriesMetadataJsonDeserializer;\nimport java.io.IOException;\nimport java.io.UncheckedIOException;\n\npublic class DeserializeFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      StdDeserializer<? extends Object> deserializer = null;\n\n      byte[] bytes = data.consumeBytes(50000);\n      Integer choice = data.consumeInt(1, 56);\n\n      switch (choice) {\n        case 1:\n          deserializer = new ActionListDeserializer();\n          break;\n        case 2:\n          deserializer = new DanglingLineActionBuilderBuilderDeserializer();\n          break;\n        case 3:\n          deserializer = new GeneratorActionBuilderDeserializer();\n          break;\n        case 4:\n          deserializer = new HvdcActionBuilderDeserializer();\n          break;\n        case 5:\n          deserializer = new LoadActionBuilderBuilderDeserializer();\n          break;\n        case 6:\n          deserializer = new MultipleActionsActionBuilderDeserializer();\n          break;\n        case 7:\n          deserializer = new PercentChangeLoadActionBuilderDeserializer();\n          break;\n        case 8:\n          deserializer = new PhaseTapChangerRegulationActionBuilderBuilderDeserializer();\n          break;\n        case 9:\n          deserializer = new PhaseTapChangerTapPositionActionBuilderDeserializer();\n          break;\n        case 10:\n          deserializer = new RatioTapChangerRegulationActionBuilderBuilderDeserializer();\n          break;\n        case 11:\n          deserializer = new RatioTapChangerTapPositionActionBuilderDeserializer();\n          break;\n        case 12:\n          deserializer = new ShuntCompensatorPositionActionBuilderDeserializer();\n          break;\n        case 13:\n          deserializer = new StaticVarCompensatorActionBuilderDeserializer();\n          break;\n        case 14:\n          deserializer = new SwitchActionBuilderDeserializer();\n          break;\n        case 15:\n          deserializer = new TerminalsConnectionActionBuilderDeserializer();\n          break;\n        case 16:\n          deserializer = new DanglingLineCriterionDeserializer();\n          break;\n        case 17:\n          deserializer = new IdentifiableCriterionDeserializer();\n          break;\n        case 18:\n          deserializer = new CriterionDeserializer();\n          break;\n        case 19:\n          deserializer = new TieLineCriterionDeserializer();\n          break;\n        case 20:\n          deserializer = new LineCriterionDeserializer();\n          break;\n        case 21:\n          deserializer = new ThreeWindingsTransformerCriterionDeserializer();\n          break;\n        case 22:\n          deserializer = new NetworkElementIdListCriterionDeserializer();\n          break;\n        case 23:\n          deserializer = new VoltageIntervalDeserializer();\n          break;\n        case 24:\n          deserializer = new PermanentDurationCriterionDeserializer();\n          break;\n        case 25:\n          deserializer = new IntervalTemporaryDurationCriterionDeserializer();\n          break;\n        case 26:\n          deserializer = new EqualityTemporaryDurationCriterionDeserializer();\n          break;\n        case 27:\n          deserializer = new AllTemporaryDurationCriterionDeserializer();\n          break;\n        case 28:\n          deserializer = new TwoWindingsTransformerCriterionDeserializer();\n          break;\n        case 29:\n          deserializer = new IdentifierDeserializer();\n          break;\n        case 30:\n          deserializer = new GeoShapeDeserializer();\n          break;\n        case 31:\n          deserializer = new SensitivityContingencyStatusJsonDeserializer();\n          break;\n        case 32:\n          deserializer = new SensitivityFactorJsonDeserializer();\n          break;\n        case 33:\n          deserializer = new SensitivityValueJsonDeserializer();\n          break;\n        case 34:\n          deserializer = new SensitivityVariableSetJsonDeserializer();\n          break;\n        case 35:\n          deserializer = new ShortCircuitParametersDeserializer();\n          break;\n        case 36:\n          deserializer = new VoltageRangeDeserializer();\n          break;\n        case 37:\n          deserializer = new DataChunkJsonDeserializer();\n          break;\n        case 38:\n          deserializer = new DoubleDataChunkJsonDeserializer();\n          break;\n        case 39:\n          deserializer = new DoubleTimeSeriesJsonDeserializer();\n          break;\n        case 40:\n          deserializer = new NodeCalcJsonDeserializer();\n          break;\n        case 41:\n          deserializer = new StringDataChunkJsonDeserializer();\n          break;\n        case 42:\n          deserializer = new StringTimeSeriesJsonDeserializer();\n          break;\n        case 43:\n          deserializer = new TimeSeriesJsonDeserializer();\n          break;\n        case 44:\n          deserializer = new TimeSeriesMetadataJsonDeserializer();\n          break;\n        case 45:\n          deserializer = new IdentifierContingencyListDeserializer();\n          break;\n        case 46:\n          deserializer = new ContingencyDeserializer();\n          break;\n        case 47:\n          deserializer = new ContingencyListDeserializer();\n          break;\n        case 48:\n          deserializer = new ContingencyElementDeserializer();\n          break;\n        case 49:\n          deserializer = new DefaultContingencyListDeserializer();\n          break;\n        case 50:\n          deserializer = new HvdcLineCriterionContingencyListDeserializer();\n          break;\n        case 51:\n          deserializer = new InjectionCriterionContingencyListDeserializer();\n          break;\n        case 52:\n          deserializer = new LineCriterionContingencyListDeserializer();\n          break;\n        case 53:\n          deserializer = new ListOfContingencyListsDeserializer();\n          break;\n        case 54:\n          deserializer = new ThreeWindingsTransformerCriterionContingencyListDeserializer();\n          break;\n        case 55:\n          deserializer = new TieLineCriterionContingencyListDeserializer();\n          break;\n        case 56:\n          deserializer = new TwoWindingsTransformerCriterionContingencyListDeserializer();\n          break;\n      }\n\n      if (deserializer != null) {\n        ObjectMapper mapper = new ObjectMapper();\n        JsonFactory factory = mapper.getFactory();\n        JsonParser parser = factory.createParser(bytes);\n\n        DeserializationConfig config = mapper.getDeserializationConfig();\n        DefaultDeserializationContext defaultContext =\n            (DefaultDeserializationContext) mapper.getDeserializationContext();\n        DeserializationContext context =\n            defaultContext.createInstance(config, parser, mapper.getInjectableValues());\n\n        deserializer.deserialize(parser, context);\n      }\n    } catch (PowsyblException\n        | IOException\n        | IllegalArgumentException\n        | IllegalStateException\n        | UncheckedIOException e) {\n      // Fuzzer: silently ignore\n    } catch (NullPointerException e) {\n      // Capture known NPE from malformed JSON\n      if (!isExpected(e)) {\n        throw e;\n      }\n    }\n  }\n\n  private static boolean isExpected(Throwable e) {\n    String[] expectedString = {\n      \"java.util.Objects.requireNonNull\",\n      \"Cannot invoke \\\"String.hashCode()\\\"\",\n      \"Name is null\",\n      \"Cannot invoke \\\"com.fasterxml.jackson.databind.JsonNode.get(String)\\\"\"\n    };\n\n    for (String expected : expectedString) {\n      if (e.toString().contains(expected)) {\n        return true;\n      }\n      for (StackTraceElement ste : e.getStackTrace()) {\n        if (ste.toString().contains(expected)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "projects/powsybl-java/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone --depth 1 https://github.com/powsybl/powsybl-core \nRUN git clone --depth 1 https://github.com/powsybl/powsybl-diagram\nRUN git clone --depth 1 https://github.com/powsybl/powsybl-metrix\nRUN git clone --depth 1 https://github.com/powsybl/powsybl-open-rao\nRUN git clone --depth 1 https://github.com/powsybl/powsybl-dynawo\nRUN git clone --depth 1 https://github.com/powsybl/powsybl-entsoe\nRUN git clone --depth 1 https://github.com/powsybl/powsybl-open-loadflow\n\n# For corpus\nRUN git clone --depth 1 https://github.com/arthurscchan/powsybl-seed-corpus\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/powsybl-java/LoadFlowFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// You may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.powsybl.cgmes.conversion.*;\nimport com.powsybl.commons.*;\nimport com.powsybl.commons.datasource.*;\nimport com.powsybl.commons.report.*;\nimport com.powsybl.computation.local.*;\nimport com.powsybl.contingency.*;\nimport com.powsybl.ieeecdf.converter.*;\nimport com.powsybl.iidm.network.*;\nimport com.powsybl.loadflow.*;\nimport com.powsybl.loadflow.LoadFlowParameters.*;\nimport com.powsybl.matpower.converter.*;\nimport com.powsybl.nad.*;\nimport com.powsybl.openloadflow.*;\nimport com.powsybl.powerfactory.converter.*;\nimport com.powsybl.powerfactory.model.*;\nimport com.powsybl.psse.converter.*;\nimport com.powsybl.security.*;\nimport com.powsybl.sensitivity.*;\nimport com.powsybl.shortcircuit.*;\nimport com.powsybl.sld.*;\nimport com.powsybl.ucte.converter.*;\nimport com.univocity.parsers.common.*;\nimport java.io.*;\nimport java.nio.file.*;\nimport java.util.*;\n\npublic class LoadFlowFuzzer {\n  private static Path tempFile;\n\n  public static void fuzzerInitialize() {\n    try {\n      tempFile = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      tempFile.toFile().deleteOnExit();\n    } catch (Throwable ignored) {\n      tempFile = null;\n    }\n  }\n\n  private static Contingency getContingency(FuzzedDataProvider data) {\n    List<ContingencyElement> allElements = new ArrayList<>();\n    allElements.add(new BatteryContingency(\"fuzz\"));\n    allElements.add(new BranchContingency(\"fuzz\"));\n    allElements.add(new BusbarSectionContingency(\"fuzz\"));\n    allElements.add(new BusContingency(\"fuzz\"));\n    allElements.add(new DanglingLineContingency(\"fuzz\"));\n    allElements.add(new GeneratorContingency(\"fuzz\"));\n    allElements.add(new HvdcLineContingency(\"fuzz\"));\n    allElements.add(new LineContingency(\"fuzz\"));\n    allElements.add(new LoadContingency(\"fuzz\"));\n    allElements.add(new ShuntCompensatorContingency(\"fuzz\"));\n    allElements.add(new StaticVarCompensatorContingency(\"fuzz\"));\n    allElements.add(new SwitchContingency(\"fuzz\"));\n    allElements.add(new ThreeWindingsTransformerContingency(\"fuzz\"));\n    allElements.add(new TieLineContingency(\"fuzz\"));\n    allElements.add(new TwoWindingsTransformerContingency(\"fuzz\"));\n\n    // Build random contingency with repetition\n    Contingency contingency = new Contingency(\"Fuzz\");\n    for (Integer i = 0; i < 10; i++) {\n      ContingencyElement elem = allElements.get(data.consumeInt(0, allElements.size() - 1));\n      contingency.addElement(elem);\n    }\n    return contingency;\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    // 14 Doubles + 11 Integers + 15 Booleans + 7 pick values + bytes for network\n    Integer requiredBytes = (14 * 8) + (11 * 4) + (15 * 1) + (7 * 4) + 1;\n    if ((data.remainingBytes() < requiredBytes) || (tempFile == null)) {\n      return;\n    }\n\n    // Make the fuzzer consume this first. Do not call\n    // any data.consume*() methods before this\n    byte[] loadBytes = data.consumeBytes(10000);\n\n    try {\n      Importer importer = null;\n      int choice = data.consumeInt(1, 6);\n      double[] randomDouble = new double[12];\n      for (int i = 0; i < randomDouble.length; i++) {\n        randomDouble[i] = data.consumeDouble();\n      }\n\n      Contingency contingency = getContingency(data);\n\n      LoadFlowParameters loadFlowParameters = new LoadFlowParameters();\n      loadFlowParameters.setBalanceType(data.pickValue(EnumSet.allOf(BalanceType.class)));\n      loadFlowParameters.setVoltageInitMode(data.pickValue(EnumSet.allOf(VoltageInitMode.class)));\n      loadFlowParameters.setConnectedComponentMode(\n          data.pickValue(EnumSet.allOf(ConnectedComponentMode.class)));\n      loadFlowParameters.setDc(data.consumeBoolean());\n      loadFlowParameters.setDcPowerFactor(data.consumeProbabilityDouble());\n      loadFlowParameters.setDcUseTransformerRatio(data.consumeBoolean());\n      loadFlowParameters.setDistributedSlack(data.consumeBoolean());\n      loadFlowParameters.setHvdcAcEmulation(data.consumeBoolean());\n      loadFlowParameters.setNoGeneratorReactiveLimits(data.consumeBoolean());\n      loadFlowParameters.setPhaseShifterRegulationOn(data.consumeBoolean());\n      loadFlowParameters.setReadSlackBus(data.consumeBoolean());\n      loadFlowParameters.setShuntCompensatorVoltageControlOn(data.consumeBoolean());\n      loadFlowParameters.setSimulShunt(data.consumeBoolean());\n      loadFlowParameters.setTransformerVoltageControlOn(data.consumeBoolean());\n      loadFlowParameters.setTwtSplitShuntAdmittance(data.consumeBoolean());\n      loadFlowParameters.setUseReactiveLimits(data.consumeBoolean());\n\n      ContingencyContext context =\n          new ContingencyContext(\"ID\", data.pickValue(EnumSet.allOf(ContingencyContextType.class)));\n      SensitivityFactor factor =\n          new SensitivityFactor(\n              data.pickValue(EnumSet.allOf(SensitivityFunctionType.class)),\n              \"ID\",\n              data.pickValue(EnumSet.allOf(SensitivityVariableType.class)),\n              \"ID\",\n              data.consumeBoolean(),\n              context);\n\n      Properties properties = new Properties();\n      properties.setProperty(\"solver\", data.pickValue(new String[] {\"DEFAULT\", \"NEWTON\", \"GAUSS\"}));\n      properties.setProperty(\"convergence\", String.valueOf(data.consumeDouble()));\n\n      ReadOnlyMemDataSource ds = new ReadOnlyMemDataSource();\n      switch (choice) {\n        case 1:\n          ds.putData(\"fuzz\", loadBytes);\n          importer = new CgmesImport();\n          break;\n        case 2:\n          ds.putData(\".txt\", loadBytes);\n          importer = new IeeeCdfImporter();\n          break;\n        case 3:\n          ds.putData(\".mat\", loadBytes);\n          importer = new MatpowerImporter();\n          break;\n        case 4:\n          ds.putData(\".dgs\", loadBytes);\n          byte[] loadBytes2 = data.consumeBytes(10000);\n          ds.putData(\".json\", loadBytes2);\n          importer = new PowerFactoryImporter();\n          break;\n        case 5:\n          ds.putData(\".raw\", loadBytes);\n          importer = new PsseImporter();\n          break;\n        case 6:\n          ds.putData(\".uct\", loadBytes);\n          importer = new UcteImporter();\n          break;\n        default:\n          return;\n      }\n\n      if (importer != null) {\n        Network network = null;\n        try {\n          network = importer.importData(ds, NetworkFactory.findDefault(), properties);\n        } catch (NullPointerException e) {\n          if (importer instanceof PowerFactoryImporter) {\n            // Wrong format handling\n            return;\n          } else {\n            throw e;\n          }\n        }\n        if (network.getBusView().getBuses().spliterator().getExactSizeIfKnown() > 0\n            && network.getGeneratorCount() > 0) {\n\n          for (Bus bus : network.getBusView().getBuses()) {\n            bus.setV(Math.abs(randomDouble[0]));\n            bus.setAngle(randomDouble[1]);\n          }\n          for (Generator generator : network.getGenerators()) {\n            generator.setMaxP(Math.abs(randomDouble[2]));\n            generator.setMinP(Math.max(0, randomDouble[3]));\n            generator.setTargetV(randomDouble[4]);\n            generator.setTargetP(randomDouble[5]);\n            generator.setTargetQ(randomDouble[6]);\n            generator.setRatedS(Math.max(1.0, randomDouble[7]));\n          }\n          for (Load load : network.getLoads()) {\n            load.setP0(randomDouble[8]);\n            load.setQ0(randomDouble[9]);\n          }\n          for (Line line : network.getLines()) {\n            line.setR(randomDouble[10]);\n            line.setX(randomDouble[11]);\n          }\n\n          LoadFlow.run(network, loadFlowParameters);\n          new OpenLoadFlowProvider()\n              .run(\n                  network,\n                  LocalComputationManager.getDefault(),\n                  \"Fuzz\",\n                  loadFlowParameters,\n                  ReportNode.NO_OP);\n\n          List<Fault> faults = new ArrayList<>();\n          faults.add(new BranchFault(\"id\", \"elemId\", randomDouble[12]));\n          faults.add(new BusFault(\"id\", \"elemId\"));\n          ShortCircuitAnalysis.run(network, faults);\n\n          List<Contingency> contingencies = new ArrayList<>();\n          contingencies.add(contingency);\n          SecurityAnalysis.run(network, contingencies);\n\n          List<SensitivityFactor> factors = new ArrayList<>();\n          factors.add(factor);\n          SensitivityAnalysis.run(network, factors);\n\n          if (tempFile != null) {\n            NetworkAreaDiagram.draw(network, tempFile);\n            SingleLineDiagram.draw(network, \"fuzz\", tempFile);\n          }\n        }\n      }\n    } catch (PowsyblException\n        | UncheckedIOException\n        | PowerFactoryException\n        | IllegalArgumentException\n        | TextParsingException e) {\n      // Fuzzer: silently ignore\n    } catch (NullPointerException e) {\n      // Capture known NPE from malformed JSON\n      if (!isExpected(e)) {\n        throw e;\n      }\n    }\n  }\n\n  private static boolean isExpected(Throwable e) {\n    String[] expectedString = {\n      \"java.util.Objects.requireNonNull\",\n      \"Cannot invoke \\\"String.hashCode()\\\"\",\n      \"Name is null\",\n      \"Cannot invoke \\\"com.fasterxml.jackson.databind.JsonNode.get(String)\\\"\"\n    };\n\n    for (String expected : expectedString) {\n      if (e.toString().contains(expected)) {\n        return true;\n      }\n      for (StackTraceElement ste : e.getStackTrace()) {\n        if (ste.toString().contains(expected)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "projects/powsybl-java/MatrixFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// You may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.powsybl.commons.exceptions.UncheckedClassNotFoundException;\nimport com.powsybl.math.matrix.DenseMatrix;\nimport com.powsybl.math.matrix.Matrix;\nimport com.powsybl.math.matrix.MatrixException;\nimport com.powsybl.math.matrix.SparseMatrix;\nimport java.io.ByteArrayInputStream;\nimport java.io.UncheckedIOException;\n\npublic class MatrixFuzzer {\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      // Prepare matrix with constructor\n      Matrix matrix = null;\n      if (data.consumeBoolean()) {\n        matrix = new SparseMatrix(10, 10, new int[11], new int[11], new double[11]);\n      } else {\n        matrix = new DenseMatrix(10, 10, new double[100]);\n      }\n      matrix.reset();\n\n      if (matrix == null) {\n        return;\n      }\n\n      for (int j = 0; j < 10; j++) {\n        for (int i = 0; i < 10; i++) {\n          matrix.set(i, j, data.consumeDouble());\n        }\n      }\n\n      // Fuzz operational methods\n      matrix.decomposeLU();\n      matrix.transpose().decomposeLU();\n      matrix.toDense();\n      matrix.toSparse();\n\n      // Fuzz deserailisation\n      Integer remaining = data.remainingBytes();\n      byte[] eof = new byte[] {(byte) 0x04};\n      byte[] random = new byte[remaining + eof.length];\n      System.arraycopy(data.consumeRemainingAsBytes(), 0, random, 0, remaining);\n      System.arraycopy(eof, 0, random, remaining, eof.length);\n      ByteArrayInputStream input = new ByteArrayInputStream(random);\n      Matrix other = SparseMatrix.read(input);\n      matrix.times(other);\n      matrix.add(other, 1, 1);\n      matrix.equals(other);\n    } catch (MatrixException\n        | UncheckedIOException\n        | IllegalArgumentException\n        | UncheckedClassNotFoundException\n        | ClassCastException e) {\n      // Known exceptions\n    } catch (NullPointerException e) {\n      // Capture known NPE from malformed JSON\n      if (!isExpected(e)) {\n        throw e;\n      }\n    }\n  }\n\n  private static boolean isExpected(Throwable e) {\n    String[] expectedString = {\n      \"java.util.Objects.requireNonNull\",\n      \"Cannot invoke \\\"String.hashCode()\\\"\"\n    };\n\n    for (String expected : expectedString) {\n      if (e.toString().contains(expected)) {\n        return true;\n      }\n      for (StackTraceElement ste : e.getStackTrace()) {\n        if (ste.toString().contains(expected)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "projects/powsybl-java/MetrixFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// You may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.google.common.collect.Range;\nimport com.powsybl.commons.PowsyblException;\nimport com.powsybl.commons.datasource.DataSource;\nimport com.powsybl.commons.datasource.DataSourceUtil;\nimport com.powsybl.computation.ComputationManager;\nimport com.powsybl.computation.local.LocalComputationManager;\nimport com.powsybl.contingency.ContingenciesProvider;\nimport com.powsybl.contingency.dsl.GroovyDslContingenciesProvider;\nimport com.powsybl.iidm.network.Network;\nimport com.powsybl.iidm.serde.NetworkSerDe;\nimport com.powsybl.metrix.integration.DefaultNetworkSourceImpl;\nimport com.powsybl.metrix.integration.Metrix;\nimport com.powsybl.metrix.integration.MetrixAppLogger;\nimport com.powsybl.metrix.integration.MetrixRunParameters;\nimport com.powsybl.metrix.integration.NetworkSource;\nimport com.powsybl.metrix.integration.io.ResultListener;\nimport com.powsybl.metrix.integration.metrix.MetrixAnalysis;\nimport com.powsybl.metrix.integration.metrix.MetrixAnalysisResult;\nimport com.powsybl.metrix.mapping.ComputationRange;\nimport com.powsybl.metrix.mapping.DataTableStore;\nimport com.powsybl.metrix.mapping.EquipmentGroupTimeSeriesWriterObserver;\nimport com.powsybl.metrix.mapping.EquipmentTimeSeriesWriterObserver;\nimport com.powsybl.metrix.mapping.MappingParameters;\nimport com.powsybl.metrix.mapping.NetworkPointWriter;\nimport com.powsybl.metrix.mapping.TimeSeriesDslLoader;\nimport com.powsybl.metrix.mapping.TimeSeriesMapper;\nimport com.powsybl.metrix.mapping.TimeSeriesMapperObserver;\nimport com.powsybl.metrix.mapping.TimeSeriesMapperParameters;\nimport com.powsybl.metrix.mapping.TimeSeriesMappingConfig;\nimport com.powsybl.metrix.mapping.TimeSeriesMappingConfigCsvWriter;\nimport com.powsybl.metrix.mapping.TimeSeriesMappingConfigTableLoader;\nimport com.powsybl.metrix.mapping.TimeSeriesMappingLogger;\nimport com.powsybl.metrix.mapping.timeseries.FileSystemTimeSeriesStore;\nimport com.powsybl.metrix.mapping.timeseries.InMemoryTimeSeriesStore;\nimport com.powsybl.timeseries.TimeSeries;\nimport com.powsybl.timeseries.TimeSeriesIndex;\nimport com.powsybl.tools.ToolRunningContext;\nimport java.io.FileOutputStream;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.PrintStream;\nimport java.io.Reader;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.FileSystems;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Instant;\nimport java.time.ZoneOffset;\nimport java.time.ZonedDateTime;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.NavigableSet;\nimport java.util.TreeSet;\nimport java.util.zip.ZipOutputStream;\n\npublic class MetrixFuzzer {\n  private static Path timeFilePath;\n  private static Path mappingFilePath;\n  private static Path networkFilePath;\n  private static Path contingencyFilePath;\n  private static Path configFilePath;\n  private static Path actionFilePath;\n  private static Path outputFilePath;\n  private static Path tempDirPath;\n\n  public static void fuzzerInitialize() {\n    try {\n      timeFilePath = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      timeFilePath.toFile().deleteOnExit();\n      mappingFilePath = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      mappingFilePath.toFile().deleteOnExit();\n      networkFilePath = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      networkFilePath.toFile().deleteOnExit();\n      contingencyFilePath = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      contingencyFilePath.toFile().deleteOnExit();\n      configFilePath = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      configFilePath.toFile().deleteOnExit();\n      actionFilePath = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      actionFilePath.toFile().deleteOnExit();\n      outputFilePath = Files.createTempFile(\"fuzz-\", \"-fuzz\");\n      outputFilePath.toFile().deleteOnExit();\n      tempDirPath = Files.createTempDirectory(\"fuzz-\");\n      tempDirPath.toFile().deleteOnExit();\n    } catch (Throwable ignored) {\n      timeFilePath = null;\n      mappingFilePath = null;\n      networkFilePath = null;\n      outputFilePath = null;\n      tempDirPath = null;\n    }\n  }\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) throws IOException {\n    if (tempDirPath == null) {\n      return;\n    }\n\n    try {\n      // Get random values\n      int firstVariant = data.consumeInt();\n      int maxVariantCount = data.consumeInt();\n      int variantCount = data.consumeInt();\n      int chunkSize = data.consumeInt();\n\n      // Get random versions in TreeSet\n      TreeSet<Integer> versions = new TreeSet<Integer>();\n      versions.add(data.consumeInt());\n\n      // Randomise file content\n      FileWriter fw = new FileWriter(timeFilePath.toFile());\n      fw.write(\"Time;Version;ts1;ts2\\n\");\n      Long minTs = ZonedDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC).toEpochSecond();\n      for (Integer i = 1; i <= data.consumeInt(2, 5); i++) {\n        // Safe range for instance epoch second\n        Long ts = data.consumeLong(minTs, 32503680000L);\n        ZonedDateTime zdt = Instant.ofEpochSecond(ts + i).atZone(ZoneOffset.UTC);\n        fw.write(zdt.toString() + \";1;\" + ((double) i) + \";\" + (i + 0.1) + \"\\n\");\n      }\n      fw.close();\n      fw = new FileWriter(mappingFilePath.toFile());\n      fw.write(data.consumeString(data.remainingBytes() / 5));\n      fw.close();\n      fw = new FileWriter(configFilePath.toFile());\n      fw.write(data.consumeString(data.remainingBytes() / 4));\n      fw.close();\n      fw = new FileWriter(actionFilePath.toFile());\n      fw.write(data.consumeString(data.remainingBytes() / 3));\n      fw.close();\n      fw = new FileWriter(contingencyFilePath.toFile());\n      fw.write(data.consumeString(data.remainingBytes() / 2));\n      fw.close();\n      fw = new FileWriter(networkFilePath.toFile());\n      fw.write(data.consumeRemainingAsString());\n      fw.close();\n\n      // Prepare different objects from random files\n      ZipOutputStream logArchive =\n          new ZipOutputStream(new FileOutputStream(outputFilePath.toFile()));\n      PrintStream outputStream = new PrintStream(outputFilePath.toFile());\n      ComputationManager computationManager = LocalComputationManager.getDefault();\n      ToolRunningContext context =\n          new ToolRunningContext(\n              outputStream,\n              outputStream,\n              FileSystems.getDefault(),\n              computationManager,\n              computationManager);\n\n      InMemoryTimeSeriesStore store = new InMemoryTimeSeriesStore();\n      store.importTimeSeries(Collections.singletonList(timeFilePath));\n\n      Network network =\n          NetworkSerDe.read(\n              Object.class.getResourceAsStream(networkFilePath.getFileName().toString()));\n      NetworkSource networkSource =\n          new DefaultNetworkSourceImpl(networkFilePath, computationManager);\n\n      ContingenciesProvider contingenciesProvider =\n          new GroovyDslContingenciesProvider(contingencyFilePath);\n\n      Reader metrixDslReader = Files.newBufferedReader(configFilePath, StandardCharsets.UTF_8);\n      Reader remedialActionsReader =\n          Files.newBufferedReader(actionFilePath, StandardCharsets.UTF_8);\n\n      MappingParameters mappingParameters = MappingParameters.load();\n      ComputationRange computationRange =\n          new ComputationRange(store.getTimeSeriesDataVersions(), firstVariant, maxVariantCount);\n\n      TimeSeriesMappingConfig config = null;\n      TimeSeriesDslLoader dslLoader = null;\n      try (Reader reader = Files.newBufferedReader(mappingFilePath, StandardCharsets.UTF_8)) {\n        dslLoader = new TimeSeriesDslLoader(reader, mappingFilePath.getFileName().toString());\n        config =\n            dslLoader.load(\n                network, mappingParameters, store, new DataTableStore(), computationRange);\n      }\n\n      TimeSeriesMappingConfigCsvWriter csvWriter =\n          new TimeSeriesMappingConfigCsvWriter(\n              config, network, store, computationRange, mappingParameters.getWithTimeSeriesStats());\n      csvWriter.writeMappingCsv(outputFilePath);\n\n      TimeSeriesMappingLogger logger = new TimeSeriesMappingLogger();\n      List<TimeSeriesMapperObserver> observers = new ArrayList<>();\n\n      FileSystemTimeSeriesStore resultStore = new FileSystemTimeSeriesStore(tempDirPath);\n      DataSource dataSource = DataSourceUtil.createDataSource(tempDirPath, null);\n      observers.add(new NetworkPointWriter(network, dataSource));\n\n      TimeSeriesIndex index =\n          new TimeSeriesMappingConfigTableLoader(config, store).checkIndexUnicity();\n      int lastPoint = Math.min(firstVariant + maxVariantCount, index.getPointCount()) - 1;\n      Range<Integer> range = Range.closed(firstVariant, lastPoint);\n      observers.add(\n          new EquipmentTimeSeriesWriterObserver(\n              network, config, maxVariantCount, range, tempDirPath));\n      observers.add(\n          new EquipmentGroupTimeSeriesWriterObserver(\n              network, config, maxVariantCount, range, tempDirPath));\n\n      TimeSeriesMapperParameters parameters =\n          new TimeSeriesMapperParameters(\n              (NavigableSet<Integer>) store.getTimeSeriesDataVersions(),\n              range,\n              true,\n              true,\n              false,\n              mappingParameters.getToleranceThreshold());\n\n      ResultListener listener =\n          new ResultListener() {\n            @Override\n            public void onChunkResult(\n                int version, int chunk, List<TimeSeries> timeSeriesList, Network networkPoint) {\n              resultStore.importTimeSeries(timeSeriesList, version);\n            }\n\n            @Override\n            public void onEnd() {\n              // Do nothing\n            }\n          };\n\n      MetrixAppLogger metrixLogger =\n          new MetrixAppLogger() {\n            @Override\n            public void log(String message, Object... args) {\n              // Do nothing\n            }\n\n            @Override\n            public MetrixAppLogger tagged(String tag) {\n              return this;\n            }\n          };\n\n      MetrixAnalysis metrixAnalysis =\n          new MetrixAnalysis(\n              networkSource,\n              dslLoader,\n              metrixDslReader,\n              remedialActionsReader,\n              contingenciesProvider,\n              store,\n              new DataTableStore(),\n              metrixLogger,\n              computationRange);\n      MetrixAnalysisResult analysisResult = metrixAnalysis.runAnalysis(\"extern tool\");\n\n      // Fuzz mapper\n      TimeSeriesMapper mapper = new TimeSeriesMapper(config, parameters, network, logger);\n      mapper.mapToNetwork(store, observers);\n\n      // Fuzz Metrix\n      Metrix metrix =\n          new Metrix(\n              remedialActionsReader,\n              store,\n              resultStore,\n              logArchive,\n              context,\n              metrixLogger,\n              analysisResult);\n      MetrixRunParameters runParams =\n          new MetrixRunParameters(computationRange, chunkSize, true, true, false, false, false);\n      metrix.run(runParams, listener, \"Fuzz\");\n    } catch (PowsyblException | IllegalArgumentException | IllegalStateException | IOException e) {\n      // Ignore known exceptions\n    } catch (NullPointerException e) {\n      // Capture known NPE from malformed JSON\n      if (!isExpected(e)) {\n        throw e;\n      }\n    }\n  }\n\n  private static boolean isExpected(Throwable e) {\n    String[] expectedString = {\n      \"java.util.Objects.requireNonNull\",\n      \"Cannot invoke \\\"String.hashCode()\\\"\",\n      \"Name is null\",\n      \"Cannot invoke \\\"com.fasterxml.jackson.databind.JsonNode.get(String)\\\"\"\n    };\n\n    for (String expected : expectedString) {\n      if (e.toString().contains(expected)) {\n        return true;\n      }\n      for (StackTraceElement ste : e.getStackTrace()) {\n        if (ste.toString().contains(expected)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "projects/powsybl-java/OpenRaoFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// You may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.powsybl.commons.PowsyblException;\nimport com.powsybl.contingency.ContingencyElementType;\nimport com.powsybl.iidm.network.Network;\nimport com.powsybl.iidm.network.NetworkFactory;\nimport com.powsybl.iidm.network.TwoSides;\nimport com.powsybl.loadflow.LoadFlowParameters;\nimport com.powsybl.openrao.commons.OpenRaoException;\nimport com.powsybl.openrao.commons.Unit;\nimport com.powsybl.openrao.data.crac.api.Crac;\nimport com.powsybl.openrao.data.crac.api.CracFactory;\nimport com.powsybl.openrao.data.crac.api.InstantKind;\nimport com.powsybl.openrao.data.crac.api.networkaction.ActionType;\nimport com.powsybl.openrao.data.crac.api.range.RangeType;\nimport com.powsybl.openrao.data.crac.api.usagerule.UsageMethod;\nimport com.powsybl.openrao.data.crac.io.commons.iidm.IidmPstHelper;\nimport com.powsybl.openrao.raoapi.Rao;\nimport com.powsybl.openrao.raoapi.RaoInput;\nimport com.powsybl.openrao.raoapi.parameters.RaoParameters;\nimport com.powsybl.sensitivity.SensitivityAnalysisParameters;\nimport java.util.EnumSet;\nimport java.util.Properties;\n\npublic class OpenRaoFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    // String length + 3 Doubles + 2 Integers + 1 Booleans + 8 pick values + bytes for network\n    Integer requiredBytes = 10 + (3 * 8) + (2 * 4) + (1 * 1) + (8 * 4) + 1;\n    if (data.remainingBytes() < requiredBytes) {\n      return;\n    }\n\n    try {\n      // Randomise variables\n      String newString = data.consumeString(10);\n      ContingencyElementType newType = data.pickValue(EnumSet.allOf(ContingencyElementType.class));\n      InstantKind newInstant = data.pickValue(EnumSet.allOf(InstantKind.class));\n      Unit newUnit = data.pickValue(EnumSet.allOf(Unit.class));\n      RangeType newRange = data.pickValue(EnumSet.allOf(RangeType.class));\n      UsageMethod newUsage = data.pickValue(EnumSet.allOf(UsageMethod.class));\n      ActionType newAction = data.pickValue(EnumSet.allOf(ActionType.class));\n      TwoSides newSide = data.pickValue(EnumSet.allOf(TwoSides.class));\n      double newMin = data.consumeDouble();\n      double newMax = data.consumeDouble();\n      int minTap = data.consumeInt();\n      int maxTap = data.consumeInt();\n      boolean isDc = data.consumeBoolean();\n\n      // Initialise properties\n      Properties properties = new Properties();\n      properties.setProperty(\"solver\", data.pickValue(new String[] {\"DEFAULT\", \"NEWTON\", \"GAUSS\"}));\n      properties.setProperty(\"convergence\", String.valueOf(data.consumeDouble()));\n\n      // Initialise objects\n      Network network = NetworkFactory.findDefault().createNetwork(\"Fuzz\", \"Fuzz\");\n      Crac crac = CracFactory.findDefault().create(\"Fuz-Crac\");\n      IidmPstHelper iidmPstHelper = new IidmPstHelper(newString, network);\n\n      // Randomise Crac object\n      crac.newContingency().withId(\"contingency\").withContingencyElement(newString, newType).add();\n      crac.newInstant(\"fuzz-instant\", newInstant);\n\n      crac.newFlowCnec()\n          .withId(\"fuzz-flow\")\n          .withInstant(\"fuzz-instant\")\n          .withOptimized()\n          .withNetworkElement(newString)\n          .newThreshold()\n          .withMin(newMin)\n          .withMax(newMax)\n          .withUnit(newUnit)\n          .withSide(newSide)\n          .add()\n          .add();\n\n      crac.newPstRangeAction()\n          .withId(\"fuzz-action\")\n          .withNetworkElement(newString)\n          .withInitialTap(iidmPstHelper.getInitialTap())\n          .withTapToAngleConversionMap(iidmPstHelper.getTapToAngleConversionMap())\n          .newTapRange()\n          .withMinTap(minTap)\n          .withMaxTap(maxTap)\n          .withRangeType(newRange)\n          .add()\n          .newOnInstantUsageRule()\n          .withInstant(\"fuzz-instant\")\n          .withUsageMethod(newUsage)\n          .add()\n          .add();\n\n      crac.newNetworkAction()\n          .withId(\"fuzz-network-action\")\n          .newTerminalsConnectionAction()\n          .withNetworkElement(newString)\n          .withActionType(newAction)\n          .add()\n          .add();\n\n      // Set parameters\n      RaoParameters raoParameters = new RaoParameters();\n      LoadFlowParameters loadFlowParameters = new LoadFlowParameters();\n      loadFlowParameters.setDc(isDc);\n      SensitivityAnalysisParameters sensitivityAnalysisParameters =\n          new SensitivityAnalysisParameters();\n      sensitivityAnalysisParameters.setLoadFlowParameters(loadFlowParameters);\n\n      RaoInput.RaoInputBuilder raoInputBuilder = RaoInput.build(network, crac);\n      Rao.find().run(raoInputBuilder.build(), raoParameters);\n    } catch (PowsyblException\n        | OpenRaoException\n        | IllegalArgumentException\n        | IllegalStateException e) {\n      // Ignore known exceptions\n    } catch (NullPointerException e) {\n      // Capture known NPE from malformed JSON\n      if (!isExpected(e)) {\n        throw e;\n      }\n    }\n  }\n\n  private static boolean isExpected(Throwable e) {\n    String[] expectedString = {\n      \"java.util.Objects.requireNonNull\",\n      \"Cannot invoke \\\"String.hashCode()\\\"\",\n      \"Name is null\",\n      \"Cannot invoke \\\"com.fasterxml.jackson.databind.JsonNode.get(String)\\\"\"\n    };\n\n    for (String expected : expectedString) {\n      if (e.toString().contains(expected)) {\n        return true;\n      }\n      for (StackTraceElement ste : e.getStackTrace()) {\n        if (ste.toString().contains(expected)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "projects/powsybl-java/ParseFuzzer.java",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// You may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.fasterxml.jackson.core.JsonFactory;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.powsybl.cgmes.model.FullModel;\nimport com.powsybl.commons.PowsyblException;\nimport com.powsybl.commons.exceptions.UncheckedXmlStreamException;\nimport com.powsybl.computation.Partition;\nimport com.powsybl.dynawo.commons.dynawologs.CsvLogParser;\nimport com.powsybl.dynawo.commons.timeline.CsvTimeLineParser;\nimport com.powsybl.entsoe.util.BoundaryPointXlsParser;\nimport com.powsybl.entsoe.util.EntsoeFileName;\nimport com.powsybl.powerfactory.model.PowerFactoryException;\nimport com.powsybl.powerfactory.model.Project;\nimport com.powsybl.powerfactory.model.StudyCase;\nimport com.powsybl.psse.model.io.Context;\nimport com.powsybl.sensitivity.SensitivityAnalysisResult.SensitivityContingencyStatus;\nimport com.powsybl.sensitivity.SensitivityFactor;\nimport com.powsybl.sensitivity.SensitivityValue;\nimport com.powsybl.sensitivity.SensitivityVariableSet;\nimport com.powsybl.sensitivity.WeightedSensitivityVariable;\nimport com.powsybl.timeseries.InfiniteTimeSeriesIndex;\nimport com.powsybl.timeseries.IrregularTimeSeriesIndex;\nimport com.powsybl.timeseries.RegularTimeSeriesIndex;\nimport com.powsybl.timeseries.TimeSeries;\nimport com.powsybl.timeseries.ast.NodeCalc;\nimport com.univocity.parsers.common.TextParsingException;\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.UncheckedIOException;\nimport java.nio.charset.StandardCharsets;\nimport java.time.format.DateTimeParseException;\n\npublic class ParseFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    if (data.remainingBytes() < 5) {\n      return;\n    }\n\n    try {\n      JsonParser parser;\n      String str;\n      ByteArrayInputStream bais;\n      InputStreamReader reader;\n\n      byte[] bytes = data.consumeBytes(Math.min(data.remainingBytes() - 4, 50000));\n      Integer choice = data.consumeInt(1, 19);\n      switch (choice) {\n        case 1:\n          bais = new ByteArrayInputStream(bytes);\n          reader = new InputStreamReader(bais);\n          FullModel.parse(reader);\n          break;\n        case 2:\n          str = new String(bytes, StandardCharsets.UTF_8);\n          Partition.parse(str);\n          break;\n        case 3:\n          bais = new ByteArrayInputStream(bytes);\n          new BoundaryPointXlsParser().parse(bais);\n          break;\n        case 4:\n          str = new String(bytes, StandardCharsets.UTF_8);\n          EntsoeFileName.parse(str);\n          break;\n        case 5:\n          parser = new JsonFactory().createParser(bytes);\n          SensitivityFactor.parseJson(parser);\n          break;\n        case 6:\n          parser = new JsonFactory().createParser(bytes);\n          SensitivityValue.parseJson(parser);\n          break;\n        case 7:\n          parser = new JsonFactory().createParser(bytes);\n          SensitivityVariableSet.parseJson(parser);\n          break;\n        case 8:\n          parser = new JsonFactory().createParser(bytes);\n          WeightedSensitivityVariable.parseJson(parser);\n          break;\n        case 9:\n          parser = new JsonFactory().createParser(bytes);\n          SensitivityContingencyStatus.parseJson(parser);\n          break;\n        case 10:\n          parser = new JsonFactory().createParser(bytes);\n          InfiniteTimeSeriesIndex.parseJson(parser);\n          break;\n        case 11:\n          parser = new JsonFactory().createParser(bytes);\n          IrregularTimeSeriesIndex.parseJson(parser);\n          break;\n        case 12:\n          parser = new JsonFactory().createParser(bytes);\n          RegularTimeSeriesIndex.parseJson(parser);\n          break;\n        case 13:\n          bais = new ByteArrayInputStream(bytes);\n          reader = new InputStreamReader(bais);\n          Project.parseJson(reader);\n          break;\n        case 14:\n          bais = new ByteArrayInputStream(bytes);\n          reader = new InputStreamReader(bais);\n          StudyCase.parseJson(reader);\n          break;\n        case 15:\n          parser = new JsonFactory().createParser(bytes);\n          NodeCalc.parseJson(parser);\n          break;\n        case 16:\n          str = new String(bytes, StandardCharsets.UTF_8);\n          TimeSeries.parseCsv(str);\n          break;\n        case 17:\n          File logFile = File.createTempFile(\"fuzz-\", \"-fuzz\");\n          logFile.deleteOnExit();\n          try (FileOutputStream fos = new FileOutputStream(logFile)) {\n            fos.write(bytes);\n            new CsvLogParser().parse(logFile.toPath());\n          }\n          break;\n        case 18:\n          File timeFile = File.createTempFile(\"fuzz-\", \"-fuzz\");\n          timeFile.deleteOnExit();\n          try (FileOutputStream fos = new FileOutputStream(timeFile)) {\n            fos.write(bytes);\n          }\n          new CsvTimeLineParser().parse(timeFile.toPath());\n          break;\n        case 19:\n          new Context().detectDelimiter(new String(bytes, StandardCharsets.UTF_8));\n          break;\n      }\n    } catch (PowsyblException\n        | IOException\n        | UncheckedIOException\n        | UncheckedXmlStreamException\n        | IllegalArgumentException\n        | IllegalStateException\n        | PowerFactoryException\n        | TextParsingException\n        | DateTimeParseException e) {\n      // Fuzzer: silently ignore\n    } catch (NullPointerException e) {\n      // Capture known NPE from malformed JSON\n      if (!isExpected(e)) {\n        throw e;\n      }\n    }\n  }\n\n  private static boolean isExpected(Throwable e) {\n    String[] expectedString = {\n      \"java.util.Objects.requireNonNull\",\n      \"Cannot invoke \\\"String.hashCode()\\\"\",\n      \"Name is null\",\n      \"Cannot invoke \\\"com.fasterxml.jackson.databind.JsonNode.get(String)\\\"\"\n    };\n\n    for (String expected : expectedString) {\n      if (e.toString().contains(expected)) {\n        return true;\n      }\n      for (StackTraceElement ste : e.getStackTrace()) {\n        if (ste.toString().contains(expected)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "projects/powsybl-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build powsybl-core\npushd powsybl-core\n$MVN clean package -DskipTests=true -Dmaven.javadoc.skip=true\npopd\n\n# Build powsybl-diagram\npushd powsybl-diagram\n$MVN clean package -DskipTests=true -Dmaven.javadoc.skip=true\npopd\n\n# Build powsybl-metrix\npushd powsybl-metrix\n$MVN clean package -DskipTests=true -Dmaven.javadoc.skip=true\npopd\n\n# Build powsybl-open-rao\npushd powsybl-open-rao\n$MVN clean package -DskipTests=true -Dmaven.javadoc.skip=true\npopd\n\n# Build powsybl-dynawo\npushd powsybl-dynawo\n$MVN clean package -DskipTests=true -Dmaven.javadoc.skip=true\npopd\n\n# Build powsybl-open-loadflow\npushd powsybl-open-loadflow\n$MVN clean package -DskipTests=true -Dmaven.javadoc.skip=true\npopd\n\n# Build powsybl-entsoe\npushd powsybl-entsoe\n$MVN clean package -DskipTests=true -Dmaven.javadoc.skip=true\npopd\n\n# Disable logging\necho \"<configuration><root level=\\\"OFF\\\" /></configuration>\" > $OUT/logback.xml\n\nALL_JARS=\nALL_DEP_JARS=\nmkdir -p $OUT/dependencies\nfor jar in $(find ./powsybl* -type f -name \"*.jar\")\ndo\n  if [[ \"$jar\" != *\"target/powsybl/share\"* ]]\n  then\n    if [[ \"$jar\" != *\"powsybl\"* ]]\n    then\n      ALL_DEP_JARS=$ALL_DEP_JARS\"$(basename $jar) \"\n      cp \"$jar\" $OUT/dependencies\n    elif [[ \"$jar\" != *\"test\"* ]]\n    then\n      ALL_JARS=$ALL_JARS\"$(basename $jar) \"\n      cp \"$jar\" $OUT\n    fi\n  else\n    ALL_DEP_JARS=$ALL_DEP_JARS\"$(basename $jar) \"\n    cp \"$jar\" $OUT/dependencies\n  fi\ndone\n\n# Download extra needed dependencies jar\nwget https://repo1.maven.org/maven2/com/google/jimfs/jimfs/1.3.0/jimfs-1.3.0.jar\nALL_DEP_JARS=$ALL_DEP_JARS\"jimfs-1.3.0.jar\"\ncp jimfs-1.3.0.jar $OUT/dependencies\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):$(echo $ALL_DEP_JARS | xargs printf -- \"\\$this_dir/dependencies/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\n\nmkdir -p $SRC/LoadFlowFuzzer-seeds\nfind $SRC -name '*.uct' -exec cp \"{}\" $SRC/LoadFlowFuzzer-seeds/  \\;\nfind $SRC -name '*.dgs' -exec cp \"{}\" $SRC/LoadFlowFuzzer-seeds/  \\;\nfind $SRC -name '*.json' -exec cp \"{}\" $SRC/LoadFlowFuzzer-seeds/  \\;\nfind $SRC -name '*.raw' -exec cp \"{}\" $SRC/LoadFlowFuzzer-seeds/  \\;\n\nmkdir -p $SRC/DeserializeFuzzer-seeds\nfind $SRC -name '*.json' -exec cp \"{}\" $SRC/DeserializeFuzzer-seeds/  \\;\n\nmkdir -p $SRC/ParseFuzzer-seeds\nfind $SRC -name '*.json' -exec cp \"{}\" $SRC/ParseFuzzer-seeds/  \\;\n\npushd $SRC/LoadFlowFuzzer-seeds\nzip $OUT/LoadFlowFuzzer_seed_corpus.zip ./*\npopd\n\npushd $SRC/DeserializeFuzzer-seeds\nzip $OUT/DeserializeFuzzer_seed_corpus.zip ./*\npopd\n\npushd $SRC/ParseFuzzer-seeds\nzip $OUT/ParseFuzzer_seed_corpus.zip ./*\npopd\n\npushd $SRC/powsybl-seed-corpus/MatrixFuzzer_seed_corpus\nzip $OUT/MatrixFuzzer_seed_corpus.zip ./*\npopd\n\nwget -O $SRC/json.dict https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/json.dict\ncp $SRC/json.dict $OUT/LoadFlowFuzzer.dict\ncp $SRC/json.dict $OUT/DeserializeFuzzer.dict\ncp $SRC/json.dict $OUT/ParseFuzzer.dict\n"
  },
  {
    "path": "projects/powsybl-java/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://www.powsybl.org/\nlanguage: jvm\nmain_repo: https://github.com/powsybl/powsybl-core\nsanitizers:\n  - address\nauto_ccs:\n  - \"sophie.frasnedo@rte-france.com\"\n  - \"olivier.perrin@rte-france.com\"\n  - \"nicolas.rol@rte-france.com\"\nvendor_ccs:\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/presidio/project.yaml",
    "content": "homepage: \"https://microsoft.github.io/presidio\"\nlanguage: python\nprimary_contact: \"avishay.balter@gmail.com\"\nauto_ccs: \n  - presidio@microsoft.com\nsanitizers:\n  - address\nmain_repo: 'https://github.com/microsoft/presidio'  "
  },
  {
    "path": "projects/presto/.gitignore",
    "content": "project-parent/presto\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/presto/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/sql.dict $SRC/SqlParserFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/SqlParserFuzzer_seed_corpus.zip go-fuzz-corpus/sqlparser/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/presto\nRUN apt update && apt install -y openjdk-8-jdk\nRUN git clone --depth 1 https://github.com/prestodb/presto/ $SRC/project-parent/presto\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/presto/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=presto\nPROJECT_GROUP_ID=com.facebook.presto\nPROJECT_ARTIFACT_ID=presto\nMAIN_REPOSITORY=https://github.com/prestodb/presto/\n\nMAVEN_ARGS=\"-Djavac.src.version=1.8 -Djavac.target.version=1.8 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  FUZZ_TARGET_DEPENDENCIES=\":presto-parser :presto-testng-services\"\n  \n  for dependency in $FUZZ_TARGET_DEPENDENCIES; do\n    # set dependency project version in fuzz-targets\n    (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n  done\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN -pl presto-jdbc -pl presto-parser install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-8\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip \"/usr/lib/jvm/java-8-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-8/\\\" \\\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/presto/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>1.8</java.version>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n       <dependency>\n           <groupId>org.junit.platform</groupId>\n           <artifactId>junit-platform-launcher</artifactId>\n           <version>1.9.2</version>\n       </dependency>\n\n        <dependency>\n            <groupId>com.facebook.presto</groupId>\n            <artifactId>presto-parser</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.facebook.presto</groupId>\n            <artifactId>presto-testng-services</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n            <scope>test</scope>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/presto/project-parent/fuzz-targets/src/test/java/com/example/SqlParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.util.logging.LogManager;\nimport java.lang.ClassCastException;\nimport com.facebook.presto.sql.parser.*;\nimport com.facebook.presto.sql.parser.ParsingOptions;\nimport com.facebook.presto.sql.tree.Query;\nimport com.facebook.presto.sql.parser.ParsingException;\nimport org.junit.jupiter.api.BeforeAll;\n\nimport static com.facebook.presto.sql.parser.ParsingOptions.DecimalLiteralTreatment.AS_DOUBLE;\nimport static com.facebook.presto.sql.parser.ParsingOptions.DecimalLiteralTreatment.AS_DECIMAL;\nimport static com.facebook.presto.sql.parser.ParsingOptions.DecimalLiteralTreatment.REJECT;\n\n\nclass SqlParserFuzzer {\n    static ParsingOptions.DecimalLiteralTreatment [] decimalLiteralTreatment = {\n        AS_DOUBLE,\n        AS_DECIMAL,\n        REJECT\n    };\n\n    @BeforeAll\n    static void setUp() {\n        LogManager.getLogManager().reset();\n    }\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        SqlParser parser = new SqlParser();\n        ParsingOptions parsingOptions = ParsingOptions.builder().setDecimalLiteralTreatment(data.pickValue(decimalLiteralTreatment)).build();\n        String sql = data.consumeRemainingAsString();\n\n        try {\n            parser.createStatement(sql, parsingOptions);\n            parser.createExpression(sql, parsingOptions);\n        } catch (ParsingException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/presto/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>presto</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/presto/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://prestodb.io/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/prestodb/presto/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/proftpd/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config cmake check\nRUN git clone --depth 1 https://github.com/proftpd/proftpd\nWORKDIR proftpd\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/proftpd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp tests/fuzzing/json_fuzzer.c $SRC/fuzzer.c\ntests/fuzzing/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/proftpd/project.yaml",
    "content": "homepage: \"http://www.proftpd.org/\"\nmain_repo: \"https://github.com/proftpd/proftpd\"\nlanguage: c\nprimary_contact: \"castaglian@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - \"afl\"\n  - \"honggfuzz\"\n  - \"libfuzzer\"\n"
  },
  {
    "path": "projects/proj4/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool g++ sqlite3 pkg-config wget\n\nRUN git clone --depth 1 https://github.com/OSGeo/PROJ PROJ\n\n# Pin to 8.17.0 as later versions require openssl 3.0 that Ubuntu 20.04 doesn't provide\nRUN git clone --depth 1 --branch curl-8_17_0 https://github.com/curl/curl.git PROJ/curl\n\n# Pin to v4.7.1 as latest libtiff master requires autoconf 2.71\nRUN git clone --depth 1 --branch v4.7.1 https://gitlab.com/libtiff/libtiff.git PROJ/libtiff\n\nWORKDIR PROJ\n\nRUN cp test/fuzzers/build.sh $SRC/\n"
  },
  {
    "path": "projects/proj4/project.yaml",
    "content": "homepage: \"https://proj.org/\"\nlanguage: c++\nmain_repo: \"https://github.com/OSGeo/PROJ\"\nprimary_contact: \"even.rouault@gmail.com\"\nauto_ccs:\n  - \"hobu.inc@gmail.com\"\n  - \"kristianevers@gmail.com\"\n  - \"knudsen.thomas@gmail.com\"\narchitectures:\n  - x86_64\n  - i386\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/prometheus/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nENV GO111MODULE=on\nRUN git clone https://github.com/prometheus/prometheus $GOPATH/src/github.com/prometheus/prometheus\nRUN wget https://go.dev/dl/go1.24.6.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.24.6.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/ \\\n    && rm -rf temp-go go1.24.6.linux-amd64.tar.gz\nCOPY build.sh $SRC/\n# Required to avoid 'working directory is not part of a module' error.\nWORKDIR $GOPATH/src/github.com/prometheus/prometheus\n"
  },
  {
    "path": "projects/prometheus/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# go-118-fuzz-build_v2 overlays $GOROOT/src/testing/fuzz.go. When Go\n# downloads a newer toolchain to satisfy a go.work/go.mod requirement,\n# GOROOT falls under GOMODCACHE whose files Go refuses to overlay. To\n# work around this, copy the downloaded toolchain to a writable temp\n# dir, prepend it to PATH, and pin GOTOOLCHAIN=local so the copied\n# go binary (which IS the required version) is used directly.\ngoroot=$(go env GOROOT)\ngomodcache=$(go env GOMODCACHE)\nif [[ \"$goroot\" == \"$gomodcache\"* ]]; then\n  tmp_go=$(mktemp -d)\n  cp -r \"$goroot/.\" \"$tmp_go\"\n  export GOROOT=\"$tmp_go\"\n  export PATH=\"$tmp_go/bin:$PATH\"\n  export GOTOOLCHAIN=local\nfi\n\ncompile_native_go_fuzzer_v2 github.com/prometheus/prometheus/util/fuzzing FuzzParseMetricText fuzzParseMetricText\ncompile_native_go_fuzzer_v2 github.com/prometheus/prometheus/util/fuzzing FuzzParseOpenMetric fuzzParseOpenMetric\ncompile_native_go_fuzzer_v2 github.com/prometheus/prometheus/util/fuzzing FuzzParseMetricSelector fuzzParseMetricSelector\ncompile_native_go_fuzzer_v2 github.com/prometheus/prometheus/util/fuzzing FuzzParseExpr fuzzParseExpr\n\ngo generate -tags fuzzing ./util/fuzzing/corpus_gen\nmv util/fuzzing/fuzzParseExpr_seed_corpus.zip $OUT/\nmv util/fuzzing/fuzzParseMetricSelector_seed_corpus.zip $OUT/\nmv util/fuzzing/fuzzParseMetricText_seed_corpus.zip $OUT/\nmv util/fuzzing/fuzzParseOpenMetric_seed_corpus.zip $OUT/\n"
  },
  {
    "path": "projects/prometheus/project.yaml",
    "content": "homepage: \"https://github.com/prometheus/prometheus\"\nprimary_contact: \"prometheus-team@googlegroups.com\"\nauto_ccs :\n  - \"julius.volz@gmail.com\"\n  - \"beorn@grafana.com\"\n  - \"roidelapluie@prometheus.io\"\n  - \"richih@richih.org\"\n  - \"bjboreham@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/prometheus/prometheus'\n"
  },
  {
    "path": "projects/promise-polyfill/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/taylorhakes/promise-polyfill.git\n\nCOPY fuzz.js $SRC/promise-polyfill\nCOPY babel.config.json $SRC/promise-polyfill\n\nWORKDIR $SRC/promise-polyfill\n"
  },
  {
    "path": "projects/promise-polyfill/babel.config.json",
    "content": "{\n    \"plugins\": [\"@babel/plugin-transform-modules-commonjs\"],\n    \"ignore\": [\"**/@jazzer.js\", \"**/@babel\", \"**/istanbul-reports\"]\n}\n"
  },
  {
    "path": "projects/promise-polyfill/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfunction change_type_to_commonjs() {\n\t# Find all package.json files inside the node_modules directory\n\tfind \"$1\" -name \"package.json\" -type f | while read -r package_file; do\n\t\t# Check if the file contains the \"type\" field\n\t\tif grep -q '\"type\": \"module\"' \"$package_file\"; then\n\t\t\t# Replace \"type\": \"module\" with \"type\": \"commonjs\"\n\t\t\tsed -i 's/\"type\": \"module\"/\"type\": \"commonjs\"/' \"$package_file\"\n\t\t\techo \"Updated $package_file\"\n\t\tfi\n\tdone\n}\n\nfunction transform_dir_into_commonjs() {\n\tbabel \"$1\" --keep-file-extension -D -d \"$1\"_commonjs\n\trm -r \"$1\"\n\tmv \"$1\"_commonjs \"$1\"\n}\n\nfunction remove_dev_dependencies() {\n\tpackage_json=$(cat package.json)\n\n\t# Remove the \"devDependencies\" item from package.json\n\tnew_package_json=$(echo \"$package_json\" | jq 'del(.devDependencies)')\n\n\t# Overwrite the package.json file with the updated content\n\techo \"$new_package_json\" >package.json\n\n}\n\n# Install dependencies.\nremove_dev_dependencies\n\nnpm install -g @babel/cli\nnpm install --save-dev @babel/core @babel/plugin-transform-modules-commonjs\n\ntransform_dir_into_commonjs \"$SRC/promise-polyfill/src\"\ntransform_dir_into_commonjs \"$SRC/promise-polyfill/node_modules\"\n\nnpm install --save-dev @jazzer.js/core\n\nchange_type_to_commonjs \"$SRC/promise-polyfill\"\n\n# Build Fuzzers.\ncompile_javascript_fuzzer promise-polyfill fuzz -i promise-polyfill\n"
  },
  {
    "path": "projects/promise-polyfill/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst Promise = require('./src/index.js').default;\n\nmodule.exports.fuzz = async function(data) {\n  try {\n    const promise = new Promise((resolve, reject) => {\n      if (data.toString() === 'reject') {\n        reject(new Error('rejected'));\n      } else {\n        resolve(data.toString());\n      }\n    });\n\n    promise.then((result) => {\n      Promise.resolve('');\n      result.toUpperCase();\n    }, (_error) => {\n    })\n      .catch((_error) => {\n      })\n      .finally(() => {\n      });\n\n    Promise.resolve(data.toString())\n      .then((result) => {\n        result.toUpperCase();\n      }, (_error) => {\n      })\n      .catch((_error) => {\n      })\n      .finally(() => {\n      });\n\n    Promise.reject(new Error('rejected'))\n      .catch((_error) => {\n      })\n      .finally(() => {\n      });\n\n    const promises = [\n      Promise.resolve(data.toString()),\n      Promise.reject(new Error('rejected')),\n      Promise.resolve(data.toString())\n    ];\n    Promise.all(promises)\n      .then((_results) => {\n        Promise.resolve('');\n      }, (_error) => {\n      })\n      .catch((_error) => {\n      })\n      .finally(() => {\n      });\n\n    Promise.race(promises)\n      .then((_result) => {\n        Promise.resolve('');\n      }, (_error) => {\n      })\n      .catch((_error) => {\n      })\n      .finally(() => {\n      });\n\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [];\n"
  },
  {
    "path": "projects/promise-polyfill/project.yaml",
    "content": "homepage: https://github.com/taylorhakes/promise-polyfill\nlanguage: javascript\nmain_repo: https://github.com/taylorhakes/promise-polyfill\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/prost/Dockerfile",
    "content": "# Copyright 2021 Google LL\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y pkg-config libssl-dev curl libcurl4-openssl-dev ninja-build\nRUN git clone --depth 1 https://github.com/danburkert/prost\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/prost/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/prost\ncargo fuzz build -O \ncp fuzz/target/x86_64-unknown-linux-gnu/release/proto2 $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/proto3 $OUT/\n"
  },
  {
    "path": "projects/prost/project.yaml",
    "content": "homepage: \"https://crates.io/crates/prost\"\nmain_repo: \"https://github.com/tokio-rs/prost\"\nprimary_contact: \"luciofranco14@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"casper@meijn.net\""
  },
  {
    "path": "projects/proto-plus-python/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/googleapis/proto-plus-python proto-plus-python\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/proto-plus-python\n"
  },
  {
    "path": "projects/proto-plus-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/proto-plus-python/fuzz_json_serialization.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport proto\nfrom google.protobuf.json_format import ParseError\n\n\nclass FuzzMsg(proto.Message):\n  val1 = proto.Field(proto.FLOAT, number=1)\n  val2 = proto.Field(proto.INT32, number=2)\n  val3 = proto.Field(proto.BOOL, number=3)\n  val4 = proto.Field(proto.STRING, number=4)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    s = FuzzMsg.from_json(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n    FuzzMsg.to_json(s)\n  except (ParseError, TypeError, RecursionError):\n    return\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/proto-plus-python/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/googleapis/proto-plus-python\nlanguage: python\nmain_repo: https://github.com/googleapis/proto-plus-python\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/protobuf-c/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nMAINTAINER guidovranken@gmail.com\nRUN apt-get update && apt-get install -y \\\n  make \\\n  autoconf \\\n  automake \\\n  libtool \\\n  pkg-config \\\n  protobuf-compiler \\\n  libprotobuf-dev \\\n  libprotoc-dev\n\nRUN git clone --depth 1 https://github.com/protobuf-c/protobuf-c.git -b next\nCOPY build.sh unpack_fuzzer.c $SRC/\n"
  },
  {
    "path": "projects/protobuf-c/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=alloc_dealloc_mismatch=0\n\nif [[ $CFLAGS = *sanitize=address* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DASAN\"\nfi\n\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\nif [[ $SANITIZER = coverage ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -fno-use-cxa-atexit\"\nfi\n\n# Avoid forcing -stdlib=libc++ during compilation to avoid clutter with\n# protobuf. We enable -stdlib=libc++ again once we link the fuzzer (to\n# staticaly compiled libs).\nOLD_CXXFLAGS=\"${CXXFLAGS}\"\nexport CXXFLAGS=`echo $CXXFLAGS | sed -e \"s/-stdlib=libc++//g\"`\ncd $SRC/protobuf-c/\n./autogen.sh\n./configure --enable-static=yes --enable-shared=false\n\nmake -j$(nproc)\nmake install\n\n# Generate C code from proto file\ncd $SRC/protobuf-c/\nprotoc --c_out=. -I. -I/usr/local/include t/test-full.proto\n\n# Build the unpack fuzzer\n$CC $CFLAGS -I. -I/usr/local/include -c t/test-full.pb-c.c -o test-full.pb-c.o\n$CC $CFLAGS -I. -I/usr/local/include $SRC/unpack_fuzzer.c test-full.pb-c.o \\\n    protobuf-c/.libs/libprotobuf-c.a $LIB_FUZZING_ENGINE -o $OUT/unpack_fuzzer\n"
  },
  {
    "path": "projects/protobuf-c/project.yaml",
    "content": "homepage: \"https://github.com/protobuf-c/protobuf-c\"\nlanguage: c\nprimary_contact: \"guidovranken@gmail.com\"\nauto_ccs:\n  - \"ilya.lipnitskiy@gmail.com\"\nsanitizers:\n - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\narchitectures:\n - x86_64\nmain_repo: 'https://github.com/protobuf-c/protobuf-c.git'\ncoverage_extra_args: -ignore-filename-regex=.*/protobuf-install/.*\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/protobuf-c/unpack_fuzzer.c",
    "content": "/*\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdint.h>\n#include <stddef.h>\n\n#include <protobuf-c/protobuf-c.h>\n#include \"t/test-full.pb-c.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    /*\n     * Test the core protobuf-c parsing by unpacking as TestMess.\n     * This message type contains repeated fields of all types including\n     * nested messages, which exercises all parsing code paths in\n     * protobuf_c_message_unpack().\n     */\n    ProtobufCMessage *msg = protobuf_c_message_unpack(\n        &foo__test_mess__descriptor, NULL, size, data);\n    if (msg != NULL) {\n        protobuf_c_message_free_unpacked(msg, NULL);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/protobuf-java/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.12.0/bazelisk-linux-amd64 -o /usr/bin/bazel && chmod +x /usr/bin/bazel\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN curl -L -O https://raw.githubusercontent.com/protobuf-c/protobuf-c/39cd58f5ff06048574ed5ce17ee602dc84006162/t/test-full.proto\n\nCOPY build.sh $SRC\nCOPY ProtobufFuzzer.java $SRC\n\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/protobuf-java/ProtobufFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.google.protobuf.InvalidProtocolBufferException;\n\nimport foo.TestFull;\n\npublic class ProtobufFuzzer {\n    public static void fuzzerTestOneInput(byte[] input) {\n        try {\n            TestFull.TestMessSubMess.parseFrom(input);\n        } catch (InvalidProtocolBufferException ignored) { }\n        try {\n            TestFull.TestFieldFlags.parseFrom(input);\n        } catch (InvalidProtocolBufferException ignored) { }\n        try {\n            TestFull.TestMessageCheck.parseFrom(input);\n        } catch (InvalidProtocolBufferException ignored) { }\n    }\n}\n"
  },
  {
    "path": "projects/protobuf-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Get the latest stable protobuf-java version from Maven Central\nunset CFLAGS CXXFLAGS\nJAVA_VERSION=$(curl --silent \"https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/maven-metadata.xml\" \\\n  | grep '<version>4\\.' | grep -v RC | grep -v alpha | grep -v beta | tail -1 | sed 's/.*<version>//;s/<.*//' | tr -d '[:space:]')\n# Derive the protoc version from the Java version (strip the leading \"4.\")\nVERSION=${JAVA_VERSION#4.}\n\nmkdir -p $SRC/protobuf\nPROTOC_ZIP=\"protoc-$VERSION-linux-x86_64.zip\"\ncurl --silent --fail -L -o \"$SRC/$PROTOC_ZIP\" \"https://github.com/protocolbuffers/protobuf/releases/download/v$VERSION/$PROTOC_ZIP\"\nunzip -o $PROTOC_ZIP -d $SRC/protobuf\nexport PROTOC=$SRC/protobuf/bin/protoc\n\n# Download matching protobuf-java jar\nJAR_FILE=\"protobuf-java-$JAVA_VERSION.jar\"\ncurl --silent --fail -L -o \"$SRC/$JAR_FILE\" \"https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/$JAVA_VERSION/$JAR_FILE\"\ncp \"$SRC/$JAR_FILE\" $OUT/protobuf-java.jar\n\n# Compile test protos with protoc.\ncd $SRC/\n$PROTOC --java_out=. --proto_path=. test-full.proto\njar --create --file $OUT/test-full.jar foo/*\n\nALL_JARS=\"protobuf-java.jar test-full.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\" \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/protobuf-java/project.yaml",
    "content": "auto_ccs:\n- protobuf-oss-fuzz@google.com\n- gberg@google.com\n- acozzette@google.com\n- deannagarcia@google.com\n- esrauch@google.com\n- haberman@google.com\n- hongshin@google.com\n- jatl@google.com\n- jieluo@google.com\n- mkruskal@google.com\n- salo@google.com\n- sandyzhang@google.com\n- sbenza@google.com\n- shaod@google.com\n- copybara-watcher-pod-watcher-git@system.gserviceaccount.com\n- copybara-worker@system.gserviceaccount.com\nfuzzing_engines:\n- libfuzzer\nhomepage: https://developers.google.com/protocol-buffers/\nlanguage: jvm\nmain_repo: https://github.com/protocolbuffers/protobuf\nprimary_contact: gberg@google.com\nsanitizers:\n- address\nlabels:\n  \"*\":\n    - protobuf-ossfuzz-bugz-1260285\nvendor_ccs:\n- norbert.schneider@code-intelligence.com\n"
  },
  {
    "path": "projects/protobuf-js/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/protobufjs/protobuf.js\n\nCOPY fuzz.js $SRC/protobuf.js\n\nWORKDIR $SRC/protobuf.js\n\n"
  },
  {
    "path": "projects/protobuf-js/build.sh",
    "content": "#!/bin/bash\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the project.\nnpm install --save-dev @jazzer.js/core\nnpm install\nnpm run build\n\n# Build Fuzzers.\ncompile_javascript_fuzzer protobuf.js fuzz.js -i protobuf.js --sync\n"
  },
  {
    "path": "projects/protobuf-js/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst ProtoBuf = require('./src/index');\nconst fs = require('fs');\n\nmodule.exports.fuzz = function(data) {\n  try {\n    const provider = new FuzzedDataProvider(data);\n    if (provider._remainingBytes < 512) { return; }\n    const root = new ProtoBuf.Root();\n    const filePath = \"fuzz.proto\";\n    fs.writeFileSync(filePath, Buffer.from(provider.consumeBytes(provider.consumeIntegralInRange(1, 512))));\n\n    // Load the protobuf schema from the temporary file\n    root.loadSync(filePath);\n\n    fuzzLoadSync(root, provider);\n    fuzzDefine(root, provider);\n    fuzzLookupType(root, provider);\n    fuzzEncode(root, provider);\n    fuzzDecode(root, provider);\n\n    fs.unlinkSync(filePath);\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [\n  \"illegal\",\n  \"Unexpected\",\n  \"The value of\",\n  \"must be\",\n  \"duplicate\"\n];\n\n// Fuzz the Root#loadSync method\nfunction fuzzLoadSync(root, provider) {\n  const filePath = provider.consumeString(provider.consumeIntegralInRange(1, 64));\n  root.loadSync(filePath);\n}\n\n// Fuzz the Root#define method\nfunction fuzzDefine(root, provider) {\n  const length = provider.consumeIntegralInRange(1, 64);\n  const typeName = provider.consumeString(length);\n  const definition = provider.consumeString(provider.consumeIntegralInRange(1, 64));\n  root.define(typeName, definition);\n}\n\n// Fuzz the Root#lookupType method\nfunction fuzzLookupType(root, provider) {\n  const typeName = provider.consumeString(provider.consumeIntegralInRange(1, 64));\n  root.lookupType(typeName);\n}\n\n// Fuzz the Message#encode method\nfunction fuzzEncode(root, provider) {\n  const typeName = provider.consumeString(provider.consumeIntegralInRange(1, 64));\n  const message = root.create(typeName);\n\n  // Construct the input for the message instance manually\n  const input = constructInputForEncode(message.$type, provider);\n  message.set(input);\n\n  message.encode();\n}\n\n// Construct the input for the message instance manually\nfunction constructInputForEncode(type, provider) {\n  const input = {};\n\n  for (const field of type.fieldsArray) {\n    const fieldName = field.name;\n    const fieldType = field.resolvedType;\n\n    if (fieldType && fieldType instanceof ProtoBuf.Type && !field.repeated) {\n      // Recursively construct input for nested message types\n      const nestedInput = constructInputForEncode(fieldType, provider);\n      input[fieldName] = nestedInput;\n    } else {\n      // Consume a value from the provider for non-nested fields\n      const value = consumeValueForField(field, provider);\n      input[fieldName] = value;\n    }\n  }\n\n  return input;\n}\n\n// Consume a value from the provider for non-nested fields\nfunction consumeValueForField(field, provider) {\n  switch (field.type) {\n    case \"double\":\n    case \"float\":\n      return provider.consumeFloat();\n    case \"int32\":\n    case \"uint32\":\n    case \"sint32\":\n    case \"fixed32\":\n    case \"sfixed32\":\n      return provider.consumeIntegral(provider.consumeIntegralInRange(0, 4), provider.consumeBool());\n    case \"int64\":\n    case \"uint64\":\n    case \"sint64\":\n    case \"fixed64\":\n    case \"sfixed64\":\n      return provider.consumeBigIntegral(provider.consumeIntegralInRange(0, 4), provider.consumeBool());\n    case \"bool\":\n      return provider.consumeBool();\n    case \"string\":\n      return provider.consumeString(provider.consumeIntegralInRange(0, 64));\n    case \"bytes\":\n      return provider.consumeBytes(provider.consumeIntegralInRange(0, 64));\n    default:\n      return null;\n  }\n}\n\n// Fuzz the Message#decode method\nfunction fuzzDecode(root, provider) {\n  const typeName = provider.consumeString(provider.consumeIntegralInRange(0, 64));\n  const buffer = provider.consumeRemainingAsBytes();\n  root.lookupType(typeName).decode(buffer);\n}\n\n"
  },
  {
    "path": "projects/protobuf-js/project.yaml",
    "content": "homepage: https://github.com/protobufjs/protobuf.js\nlanguage: javascript\nmain_repo: https://github.com/protobufjs/protobuf.js\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/protobuf-python/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN curl -L -O https://raw.githubusercontent.com/protobuf-c/protobuf-c/39cd58f5ff06048574ed5ce17ee602dc84006162/t/test-full.proto\nRUN git clone https://github.com/protocolbuffers/protobuf.git\nRUN cd protobuf && bazel build --nobuild //:protoc //python/dist:binary_wheel --noenable_bzlmod\nCOPY build.sh fuzz_* $SRC/\n"
  },
  {
    "path": "projects/protobuf-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBAZEL_FLAGS=\"-c dbg\"\nif [[ $CFLAGS = *sanitize=address* ]]\nthen\n    BAZEL_FLAGS=\"$BAZEL_FLAGS --config=asan\"\nfi\n\n# Build protoc with default options.\nunset CFLAGS CXXFLAGS\ncd $SRC/protobuf\n(\n  # Needed for bazel, see https://github.com/google/oss-fuzz/pull/8930\n  ln --symbolic /usr/local/bin/python3 /usr/bin/\n  type -a python3\n  /usr/bin/python3 --version\n)\nbazel build $BAZEL_FLAGS //:protoc //python/dist:binary_wheel --noenable_bzlmod\nPROTOC=$(realpath bazel-bin/protoc)\n\n# Install the protobuf python runtime.\nmkdir $SRC/wheels\nfind -L bazel-out -name 'protobuf*.whl' -exec mv '{}' $SRC/wheels ';'\npip3 install -vvv --no-index --find-links $SRC/wheels protobuf\n\n# Compile test protos with protoc.\ncd $SRC/\n$PROTOC --python_out=. --proto_path=. test-full.proto\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/protobuf-python/fuzz_protobuf.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n  import test_full_pb2\n  from google.protobuf.message import DecodeError, EncodeError\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  \"\"\"Test ParseFromString with bytes string\"\"\"\n  pbmsg = test_full_pb2.TestMessSubMess()\n  try:\n    pbmsg.ParseFromString(input_bytes)\n  except DecodeError:\n    None\n\n  try:\n    pbmsg.SerializeToString()\n  except EncodeError:\n    None\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/protobuf-python/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://developers.google.com/protocol-buffers/\nlanguage: python\nmain_repo: https://github.com/protocolbuffers/protobuf\nsanitizers:\n- address\nauto_ccs:\n- protobuf-oss-fuzz@google.com\n- gberg@google.com\n- acozzette@google.com\n- deannagarcia@google.com\n- esrauch@google.com\n- haberman@google.com\n- hongshin@google.com\n- jatl@google.com\n- jieluo@google.com\n- mkruskal@google.com\n- salo@google.com\n- sandyzhang@google.com\n- sbenza@google.com\n- shaod@google.com\n- copybara-watcher-pod-watcher-git@system.gserviceaccount.com\n- copybara-worker@system.gserviceaccount.com\nprimary_contact: gberg@google.com\nvendor_ccs:\n- david@adalogics.com\nlabels:\n  \"*\":\n    - protobuf-ossfuzz-bugz-1260285\n"
  },
  {
    "path": "projects/protoc-gen-validate/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y protobuf-compiler\nRUN git clone --depth 1 https://github.com/bufbuild/protoc-gen-validate\nWORKDIR $SRC/protoc-gen-validate\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/protoc-gen-validate/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake build\n\ncp $SRC/fuzz_test.go ./validate\ngo mod tidy\nprintf \"package validate\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > ./validate/register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/envoyproxy/protoc-gen-validate/validate FuzzTest FuzzTest\n"
  },
  {
    "path": "projects/protoc-gen-validate/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage validate\n\nimport (\n\t\"testing\"\n\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc FuzzTest(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data []byte) {\n\t\tff := fuzz.NewConsumer(data)\n\t\tx := &FloatRules{}\n\t\tff.GenerateStruct(x)\n\t\tx.String()\n\t\tx.ProtoReflect()\n\t\tx.Descriptor()\n\t\tx.GetConst()\n\t\tx.GetLt()\n\t\tx.GetLte()\n\t\tx.GetGt()\n\t\tx.GetGte()\n\t\tx.GetIn()\n\t\tx.GetNotIn()\n\t\tx.GetIgnoreEmpty()\n\t\tx.Reset()\n\t})\n}\n"
  },
  {
    "path": "projects/protoc-gen-validate/project.yaml",
    "content": "homepage: \"https://github.com/bufbuild/protoc-gen-validate\"\nlanguage: go\nmain_repo: \"https://github.com/bufbuild/protoc-gen-validate\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/protocompile/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/bufbuild/protocompile\n\nCOPY fuzz_protocompile.go $SRC/protocompile\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/protocompile\n"
  },
  {
    "path": "projects/protocompile/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/bufbuild/protocompile FuzzProtoCompile fuzz_protocompile\n\n"
  },
  {
    "path": "projects/protocompile/fuzz_protocompile.go",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage protocompile\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io\"\n)\n\nfunc FuzzProtoCompile(data []byte) int {\n\tcompiler := &Compiler{\n\t\tResolver: &SourceResolver{\n\t\t\tAccessor: func(_ string) (closer io.ReadCloser, e error) {\n\t\t\t\treturn io.NopCloser(bytes.NewReader(data)), nil\n\t\t\t},\n\t\t},\n\t}\n\n\t_, err := compiler.Compile(context.Background(), \"test.proto\")\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/protocompile/project.yaml",
    "content": "homepage: \"https://github.com/bufbuild/protocompile\"\nprimary_contact: \"jhumphries@buf.build\"\nauto_ccs:\n  - \"oss-fuzz-reports@buf.build\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/bufbuild/protocompile'\n"
  },
  {
    "path": "projects/proton-bridge/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\n# Update and install Go using the package manager\nRUN apt-get update && \\\n    apt-get install -y software-properties-common && \\\n    add-apt-repository ppa:longsleep/golang-backports -y && \\\n    apt-get install -y golang-go\n\nRUN git clone --depth 1 https://github.com/ProtonMail/proton-bridge.git\nRUN git clone --depth=1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=include-all-test-files\nCOPY build.sh $SRC/\nWORKDIR $SRC/proton-bridge\n"
  },
  {
    "path": "projects/proton-bridge/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd \"$SRC\"\ncd go-118-fuzz-build\ngo build .\nmv go-118-fuzz-build /root/go/bin/\ncd \"$SRC\"/proton-bridge\n\nmkdir pkg/fuzzing\nprintf \"package fuzzing\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > pkg/fuzzing/register.go\ngo mod edit -replace github.com/AdamKorcz/go-118-fuzz-build=\"$SRC\"/go-118-fuzz-build\ngo mod tidy\n\nexport PROJ=\"github.com/ProtonMail/proton-bridge/v3\"\ncompile_native_go_fuzzer   $PROJ/internal/legacy/credentials     FuzzUnmarshal               fuzz_unmarshal   \ncompile_native_go_fuzzer   $PROJ/pkg/message/parser              FuzzNewParser               fuzz_new_parser\ncompile_native_go_fuzzer   $PROJ/pkg/message                     FuzzReadHeaderBody          fuzz_read_header_body\ncompile_native_go_fuzzer   $PROJ/pkg/mime                        FuzzDecodeHeader            fuzz_decode_header\ncompile_native_go_fuzzer   $PROJ/pkg/mime                        FuzzDecodeCharset           fuzz_decode_charset\n"
  },
  {
    "path": "projects/proton-bridge/project.yaml",
    "content": "homepage: \"https://proton.me\"\nlanguage: go\nprimary_contact: \"security@proton.me\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/ProtonMail/proton-bridge\"\n"
  },
  {
    "path": "projects/proxygen/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\n# Install packages we need to build dependencies\nRUN apt-get update && \\\n    apt-get install -y \\\n    make \\\n    autoconf \\\n    automake \\\n    libtool \\\n    sudo \\\n    wget \\\n    gcc \\\n    g++ \\\n    python \\\n    python-dev \\\n    cmake \\\n    ninja-build\n\n# Install and build boost from source so we can have it use libc++\nRUN wget https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.gz && \\\n    tar xzf boost_1_70_0.tar.gz && \\\n    cd boost_1_70_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang cxxflags=\"-stdlib=libc++\" linkflags=\"-stdlib=libc++\" -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_70_0\n\n# Build gflags/glog/gtest from source so we use libc++ and avoid incompatibilities with the std::string ABI breaking changes\nRUN sudo apt-get purge libgflags-dev\n\nRUN wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz && \\\n    tar xzf v2.2.2.tar.gz && \\\n    cd gflags-2.2.2 && \\\n    mkdir build && \\\n    cd build && \\\n    export CC=clang && \\\n    export CXX=clang++ && \\\n    export CXXFLAGS=\"-stdlib=libc++\" && \\\n    cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. && \\\n    make -j$(nproc) && \\\n    sudo make install && \\\n    cd ../../ && \\\n    rm -rf gflags-2.2.2\n\nRUN wget https://github.com/google/glog/archive/v0.4.0.tar.gz && \\\n    tar xzf v0.4.0.tar.gz && \\\n    cd glog-0.4.0 && \\\n    export CC=clang && \\\n    export CXX=clang++ && \\\n    export CXXFLAGS=\"-stdlib=libc++\" && \\\n    mkdir build && \\\n    cd build && \\\n    cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON .. && \\\n    make -j$(nproc) && \\\n    sudo make install && \\\n    cd ../.. && \\\n    rm -rf glog-0.4.0\n\nRUN wget https://github.com/google/googletest/archive/release-1.8.1.tar.gz && \\\n    tar xzf release-1.8.1.tar.gz && \\\n    cd googletest-release-1.8.1 && \\\n    export CC=clang && \\\n    export CXX=clang++ && \\\n    export CXXFLAGS=\"-stdlib=libc++\" && \\\n    mkdir build && \\\n    cd build && \\\n    cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON .. && \\\n    make -j$(nproc) && \\\n    sudo make install && \\\n    cd ../.. && \\\n    rm -rf googletest-release-1.8.1\n\n# Build and install zstd from source so we have it available for proxygen\nRUN wget https://github.com/facebook/zstd/releases/download/v1.4.2/zstd-1.4.2.tar.gz && \\\n    tar xzf zstd-1.4.2.tar.gz && \\\n    cd zstd-1.4.2 && \\\n    export CC=clang && \\\n    export CXX=clang++ && \\\n    export CXXFLAGS=\"-stdlib=libc++\" && \\\n    sudo make -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf zstd-1.4.2\n\n# Get double conversion\nRUN git clone --single-branch https://github.com/google/double-conversion.git double-conversion && \\\n    cd double-conversion/double-conversion && \\\n    cmake -GNinja ../ && \\\n    ninja && \\\n    ninja install\n\n# Build and install `fmt` needed by folly\nRUN wget https://github.com/fmtlib/fmt/archive/6.0.0.tar.gz && \\\n    tar xzf 6.0.0.tar.gz && \\\n    cd fmt-6.0.0 && \\\n    export CC=clang && \\\n    export CXX=clang++ && \\\n    export CXXFLAGS=\"-stdlib=libc++\" && \\\n    mkdir build && \\\n    cd build && \\\n    cmake .. && \\\n    make -j$(nproc) && \\\n    sudo make install && \\\n    cd ../.. && \\\n    rm -rf fmt-6.0.0\n    \n# Build and install `gperf` (>= 3.1)\nRUN wget http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz && \\\n    rm -rf gperf-3.1 | true && \\\n    tar xzvf gperf-3.1.tar.gz && \\\n    cd gperf-3.1 && \\\n    export CC=gcc && \\\n    export CXX=g++ && \\\n    export CXXFLAGS=\"\" && \\\n    export CFLAGS_TMP=\"$CFLAGS\" && \\\n    unset CFLAGS && \\\n    ./configure && \\\n    make -j1 V=s && \\\n    sudo make install && \\\n    export CFLAGS=\"$CFLAGS_TMP\" && \\\n    unset CFLAGS_TMP && \\\n    cd .. && \\\n    rm -rf gperf-3.1\n\n# Replicate `install-dependencies` from the proxygen `build.sh` script\nRUN apt-get install -y \\\n    git \\\n    flex \\\n    bison \\\n    libkrb5-dev \\\n    libsasl2-dev \\\n    libnuma-dev \\\n    pkg-config \\\n    libssl-dev \\\n    libcap-dev \\\n    libevent-dev \\\n    libtool \\\n    libjemalloc-dev \\\n    unzip \\\n    libiberty-dev \\\n    liblzma-dev \\\n    zlib1g-dev \\\n    binutils-dev \\\n    libsodium-dev \\\n    libunwind8-dev\n\n# Install patchelf so we can fix path to libunwind\nRUN apt-get install patchelf\n\n# Fetch source and copy over files\nRUN git clone --depth 1 https://github.com/facebook/proxygen.git proxygen\nWORKDIR proxygen\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/proxygen/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Dont build tests we do not care about\necho \"\" > ./proxygen/httpclient/samples/CMakeLists.txt\necho \"\" > ./proxygen/httpserver/tests/CMakeLists.txt\necho \"\" > ./proxygen/lib/http/structuredheaders/test/CMakeLists.txt\necho \"\" > ./proxygen/httpserver/filters/tests/CMakeLists.txt\necho \"\" > ./proxygen/lib/http/session/test/CMakeLists.txt\necho \"\" > ./proxygen/lib/http/codec/compress/test/CMakeLists.txt\necho \"\" > ./proxygen/lib/services/test/CMakeLists.txt\n\ncd proxygen\n\n# Link to, and copy over, libunwind\n# We need to link to libunwind to ensure exception handling works\n# See https://clang.llvm.org/docs/Toolchain.html#unwind-library\nexport LDFLAGS=\"-lunwind\"\nmkdir -p $OUT/lib\ncp /usr/lib/x86_64-linux-gnu/libunwind.so.8 $OUT/lib/\n\n# Build everything\n./build.sh -m --no-install-dependencies --build-for-fuzzing\n\n# Patch rpath so fuzzers can find libunwind\nfind ./_build/proxygen/fuzzers -type f -executable -exec patchelf --set-rpath '$ORIGIN/lib' {} \\;\n\n# Copy fuzzers over to the destination\nfind ./_build/proxygen/fuzzers -type f -executable -exec cp {} $OUT/ \\;\n"
  },
  {
    "path": "projects/proxygen/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/facebook/proxygen\"\nlanguage: c++\nprimary_contact: \"axxu@fb.com\"\nauto_ccs:\n  - \"hmf@fb.com\"\n  - \"yaohway@fb.com\"\n  - \"axxu@fb.com\"\n  - \"lniccolini@fb.com\"\n  - \"afrind@fb.com\"\n  - \"subodh@fb.com\"\n  - \"yangchi@fb.com\"\n  - \"mjoras@fb.com\"\n  - \"amsharma@fb.com\"\n  - \"bshlinker@fb.com\"\n  - \"ranjeeth@fb.com\"\n  - \"udippant@fb.com\"\nvendor_ccs:\n  - \"oss-fuzz@fb.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/facebook/proxygen.git'\n"
  },
  {
    "path": "projects/psqlparse/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y flex bison python3-setuptools\nRUN pip3 install Cython\nRUN pip3 install --upgrade Cython\nRUN git clone https://github.com/alculquicondor/psqlparse && \\\n    cd psqlparse && \\\n    git submodule update --init\nCOPY build.sh *.py $SRC/\nWORKDIR psqlparse\n"
  },
  {
    "path": "projects/psqlparse/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nUSE_CYTHON=1 python3 setup.py build_ext --inplace\npython3 setup.py install\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/psqlparse/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\n# We import json here although it's not used in this file. This is becaused\n# it is needed for the library and pyinstaller forgets it if we don't import\n# it here. This is also needed for psqlparse.nodes below\nimport json\nimport sys\n\nwith atheris.instrument_imports():\n  from psqlparse import parse\n  from psqlparse.exceptions import PSqlParseError\n  import psqlparse.nodes\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  s = fdp.ConsumeString(sys.maxsize)\n  try:\n    parse(s)\n  except PSqlParseError as e:\n    None\n  except UnicodeEncodeError as e:\n    None\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/psqlparse/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/alculquicondor/psqlparse\nlanguage: python\nmain_repo: https://github.com/alculquicondor/psqlparse\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/psutil/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/giampaolo/psutil psutil\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/psutil\n"
  },
  {
    "path": "projects/psutil/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\n# Build the native code with sanitizers from OSS-Fuzz\npython3 ./setup.py install\n\n# Package the fuzzers and place in $OUT/\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/psutil/fuzz_native.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\"\"\"Fuzzer directly targetting the native extensions.\"\"\"\nimport sys\nimport atheris\n\nimport psutil\nfrom psutil import _psutil_linux as cext_linux\nfrom psutil import _psutil_posix as cext_posix\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    cext_linux.proc_cpu_affinity_get(fdp.ConsumeIntInRange(1, sys.maxsize))\n  except psutil._compat.ProcessLookupError:\n    pass\n  try:\n    cext_linux.net_if_duplex_speed(\n        fdp.ConsumeString(fdp.ConsumeIntInRange(1, 2048)))\n  except (OSError, ValueError):\n    pass\n\n  try:\n    cext_posix.net_if_mtu(fdp.ConsumeString(fdp.ConsumeIntInRange(1, 4096)))\n  except (OSError, ValueError):\n    pass\n  try:\n    cext_posix.net_if_flags(fdp.ConsumeString(fdp.ConsumeIntInRange(1, 4096)))\n  except (OSError, ValueError):\n    pass\n  try:\n    cext_posix.getpriority(fdp.ConsumeIntInRange(1, sys.maxsize))\n  except (OSError, ValueError):\n    pass\n\n  try:\n    list(\n        psutil.process_iter([\n            fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096)),\n            fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n        ]))\n  except ValueError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/psutil/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/giampaolo/psutil\nlanguage: python\nmain_repo: https://github.com/giampaolo/psutil\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/psycopg2/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get install libpq-dev postgresql -y\n\nRUN git clone https://github.com/psycopg/psycopg2\nWORKDIR psycopg2\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/psycopg2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n    compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/psycopg2/fuzz_sql.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nfrom psycopg2 import sql \n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        # Create an SQL statement and perform a set of operations on it.\n        query = sql.SQL(fdp.ConsumeString(100))\n        i1 = sql.Identifier(fdp.ConsumeString(25))\n        i2 = sql.Identifier(fdp.ConsumeString(25))\n        i3 = sql.Identifier(fdp.ConsumeString(25))\n        i4 = sql.Identifier(fdp.ConsumeString(25))\n        i5 = sql.Identifier(fdp.ConsumeString(25))\n        q1 = sql.SQL(fdp.ConsumeString(100))\n        q1.join([i1, i2])\n        query.format(q1, i3,  i4)\n        comp = sql.Composed([query, i5])\n    except (\n        AttributeError,\n        TypeError,\n        ValueError,\n        KeyError,\n        IndexError\n    ) as e:\n        pass\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/psycopg2/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/psycopg/psycopg2\nlanguage: python\nmain_repo: https://github.com/psycopg/psycopg2\nprimary_contact: daniele.varrazzo@gmail.com\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/publicsuffix-list/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/publicsuffix/list\nWORKDIR $SRC/list\nCOPY build.sh fuzz_test.go $SRC/\n"
  },
  {
    "path": "projects/publicsuffix-list/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed 's/package main/package tools/g' -i ./tools/newgtlds.go\nrm ./tools/newgtlds_test.go\ncp $SRC/fuzz_test.go ./tools/\ngo mod init github.com/publicsuffix/list\ngo mod tidy\nprintf \"package tools\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > ./tools/register.go\ngo mod tidy\ncompile_native_go_fuzzer github.com/publicsuffix/list/tools FuzzTest FuzzTest\n"
  },
  {
    "path": "projects/publicsuffix-list/fuzz_test.go",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage tools\n\nimport (\n\t\"testing\"\n)\n\nfunc FuzzTest(f *testing.F) {\n\tf.Fuzz(func(t *testing.T, data string) {\n\t\t_, _ = readDatFileContent(data)\n\t})\n}\n"
  },
  {
    "path": "projects/publicsuffix-list/project.yaml",
    "content": "homepage: \"https://github.com/publicsuffix/list\"\nlanguage: go\nmain_repo: \"https://github.com/publicsuffix/list\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/pugixml/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth=1 https://github.com/zeux/pugixml\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/pugixml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd pugixml\n\n# Fix float-divide-by-zero false positives during XPath evaluation\n# This is disabled by default in clang but oss-fuzz reenables it, so we need to disable it again; see https://github.com/google/oss-fuzz/issues/10564\nCXXFLAGS=\"${CXXFLAGS} -fno-sanitize=float-divide-by-zero\"\n\n$CXX $CXXFLAGS -c src/pugixml.cpp -o src/pugixml.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE tests/fuzz_parse.cpp src/pugixml.o -o ${OUT}/fuzz_parse\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE tests/fuzz_xpath.cpp src/pugixml.o -o ${OUT}/fuzz_xpath\n\nzip -r ${OUT}/fuzz_parse_seed_corpus.zip tests/data_fuzz_parse\nzip -r ${OUT}/fuzz_xpath_seed_corpus.zip tests/data_fuzz_xpath tests/data_fuzz_parse\n\ncp tests/fuzz_parse.dict ${OUT}/fuzz_parse.dict\ncp tests/fuzz_xpath.dict ${OUT}/fuzz_xpath.dict\ncat ${OUT}/fuzz_parse.dict >> ${OUT}/fuzz_xpath.dict\n"
  },
  {
    "path": "projects/pugixml/project.yaml",
    "content": "homepage: \"https://github.com/zeux/pugixml\"\nprimary_contact: \"arseny.kapoulkine@gmail.com\"\nlanguage: c++\nauto_ccs:\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/zeux/pugixml'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/pulldown-cmark/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/pulldown-cmark/pulldown-cmark pulldown-cmark\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/pulldown-cmark/build.sh",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Note: This project creates Rust fuzz targets exclusively\ncd $SRC/pulldown-cmark\nCARGO_PROFILE_RELEASE_LTO=thin cargo fuzz build -O\ncp target/x86_64-unknown-linux-gnu/release/commonmark_js $OUT/\ncp target/x86_64-unknown-linux-gnu/release/parse $OUT/\n"
  },
  {
    "path": "projects/pulldown-cmark/project.yaml",
    "content": "homepage: \"https://github.com/pulldown-cmark/pulldown-cmark\"\nmain_repo: \"https://github.com/pulldown-cmark/pulldown-cmark.git\"\nlanguage: rust\nprimary_contact: \"pulldowncmark@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/pulumi/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/pulumi/pulumi\nCOPY build.sh \\\n\t config_fuzzer.go \\\n\t schema_fuzzer.go \\\n\t $SRC/\nWORKDIR $SRC/pulumi\n"
  },
  {
    "path": "projects/pulumi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd pkg\ncp $SRC/schema_fuzzer.go $SRC/pulumi/pkg/codegen/schema/ \ncp $SRC/config_fuzzer.go $SRC/pulumi/sdk/go/common/resource/config/\ngo mod tidy\n\ncompile_go_fuzzer github.com/pulumi/pulumi/pkg/v3/codegen/schema SchemaFuzzer schema_fuzzer\ncompile_go_fuzzer github.com/pulumi/pulumi/sdk/v3/go/common/resource/config FuzzConfig fuzz\ncompile_go_fuzzer github.com/pulumi/pulumi/sdk/v3/go/common/resource/config FuzzParseKey fuzz_parse_key\n"
  },
  {
    "path": "projects/pulumi/config_fuzzer.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage config\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n)\n\nfunc FuzzConfig(data []byte) int {\n\tif len(data) != 32 {\n\t\treturn -1\n\t}\n\tcrypter := NewSymmetricCrypter(make([]byte, 32))\n\t_, _ = crypter.EncryptValue(context.Background(), string(data))\n\t_, _ = crypter.DecryptValue(context.Background(), string(data))\n\treturn 1\n}\n\nfunc fuuzRoundtripKey(m Key, marshal func(v interface{}) ([]byte, error),\n\tunmarshal func([]byte, interface{}) error) (Key, error) {\n\tb, err := marshal(m)\n\tif err != nil {\n\t\treturn Key{}, err\n\t}\n\n\tvar newM Key\n\terr = unmarshal(b, &newM)\n\treturn newM, err\n}\n\nfunc FuzzParseKey(data []byte) int {\n\tk, err := ParseKey(string(data))\n\tif err != nil {\n\t\treturn 0\n\t}\n\tfuuzRoundtripKey(k, json.Marshal, json.Unmarshal)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/pulumi/project.yaml",
    "content": "homepage: \"https://www.pulumi.com/\"\nmain_repo: \"https://github.com/pulumi/pulumi\"\nprimary_contact: \"anton@pulumi.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/pulumi/schema_fuzzer.go",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage schema\n\nimport (\n\tfuzz \"github.com/AdaLogics/go-fuzz-headers\"\n)\n\nfunc SchemaFuzzer(data []byte) int {\n\tpkgSpec := PackageSpec{}\n\tf := fuzz.NewConsumer(data)\n\terr := f.GenerateStruct(&pkgSpec)\n\tif err != nil {\n\t\treturn 0\n\t}\n\t_, _ = ImportSpec(pkgSpec, nil, ValidationOptions{\n\t\tAllowDanglingReferences: true,\n\t})\n\treturn 1\n}\n"
  },
  {
    "path": "projects/pupnp/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake\nRUN git clone https://github.com/pupnp/pupnp\nRUN git clone https://github.com/pkillarjun/oss-fuzz-bloat\nCOPY run_tests.sh build.sh $SRC/\nWORKDIR $SRC/pupnp/\n"
  },
  {
    "path": "projects/pupnp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CFLAGS\"\n\nmkdir build\ncd build\ncmake -DFUZZER=ON -DLIB_FUZZING_ENGINE=\"$LIB_FUZZING_ENGINE\" ../\nmake -j$(nproc)\n\ncp fuzzer/FuzzIxml $OUT/FuzzIxml\n\npushd $SRC/oss-fuzz-bloat/pupnp/\ncp FuzzIxml_seed_corpus.zip $OUT/FuzzIxml_seed_corpus.zip\npopd\n"
  },
  {
    "path": "projects/pupnp/project.yaml",
    "content": "homepage: \"https://pupnp.github.io/pupnp/\"\nlanguage: c\nprimary_contact: \"mroberto@users.sourceforge.net\"\nvendor_ccs:\n  - \"virtual_worlds@gmx.de\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/pupnp/pupnp'\n"
  },
  {
    "path": "projects/pupnp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Those two skipped requires network connection which are not possible in run_tests.sh\nctest --test-dir build -E \"test-upnp-init|test-upnp-url\"\n"
  },
  {
    "path": "projects/py-serde/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/rossmacarthur/serde\nWORKDIR serde\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/py-serde/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/py-serde/fuzz_model.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport json\n\nfrom serde import Model, fields\nfrom serde.exceptions import ValidationError\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    # Create an arbitrary Model structure\n    class NE(Model):\n        a = fields.Int()\n\n    class E1(Model):\n        a = fields.Int()\n        b = fields.Str()\n        c = fields.Nested(NE)\n        d = fields.Optional(fields.Int, default=42)\n        e = fields.Float()\n        f = fields.DateTime()\n\n    # Create random dictionary\n    try:\n        fuzzed_dict = json.loads(fdp.ConsumeString(sys.maxsize))\n    except json.JSONDecodeError:\n        return\n    if type(fuzzed_dict) is not dict:\n        return    \n\n    try:\n        E1.from_dict(fuzzed_dict)\n    except ValidationError:\n        pass\n        \n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/py-serde/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/rossmacarthur/serde\nlanguage: python\nmain_repo: https://github.com/rossmacarthur/serde\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/pyasn1/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/etingof/pyasn1 pyasn1\nWORKDIR pyasn1\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/pyasn1/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pyasn1/fuzz_decode.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport io\nfrom pyasn1.codec.ber import decoder\nfrom pyasn1 import error\n\n\ndef TestOneInput(data):\n    stream = io.BytesIO(data)\n    try:\n        for value in decoder.StreamingDecoder(stream):\n            s = str(value)\n    except error.PyAsn1Error:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pyasn1/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/etingof/pyasn1\nlanguage: python\nmain_repo: https://github.com/etingof/pyasn1\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/pyasn1-modules/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/pyasn1/pyasn1-modules pyasn1-modules\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pyasn1-modules\n"
  },
  {
    "path": "projects/pyasn1-modules/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pyasn1-modules/fuzz_decode.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nimport pyasn1\nfrom pyasn1.codec.der import decoder as der_decoder\n\nfrom pyasn1_modules import pem\nfrom pyasn1_modules import rfc5280\nfrom pyasn1_modules import rfc3161\n\npyasn1_module_list = [\n  rfc5280.AlgorithmIdentifier(),\n  rfc3161.TimeStampReq()\n]\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  \n  try:\n    substrate = pem.readBase64fromText(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except:\n    return # readBase64 is just a wrapper around base64 so we avoid issues\n\n  identifier = fdp.PickValueInList(pyasn1_module_list)\n  try:\n    der_decoder.decode(substrate, asnSpec=identifier)\n  except pyasn1.error.PyAsn1Error:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyasn1-modules/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pyasn1/pyasn1-modules\nlanguage: python\nmain_repo: https://github.com/pyasn1/pyasn1-modules\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pybind11/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN apt-get update && \\\n    apt-get install -y build-essential\n\nRUN git clone https://github.com/pybind/pybind11\nCOPY build.sh *_fuzzer.cc $SRC/\n\nWORKDIR $SRC/pybind11"
  },
  {
    "path": "projects/pybind11/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install -r tests/requirements.txt\ncmake -S . -B build -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON\ncmake --build build -j4\npython3 -m pip install .\n\nPYTHON_VERSION=$(python3 -c 'import sys; print(f\"{sys.version_info.major}.{sys.version_info.minor}\")')\ncp /usr/local/lib/libpython${PYTHON_VERSION}.so.1.0 $OUT/\nfor f in $SRC/*_fuzzer.cc; do\n  fuzzer=$(basename \"$f\" _fuzzer.cc)\n  $CXX $CXXFLAGS \\\n    -I$SRC/pybind11/include -isystem /usr/local/include/python${PYTHON_VERSION} \\\n    $SRC/${fuzzer}_fuzzer.cc -o $OUT/${fuzzer}_fuzzer \\\n    /usr/local/lib/libpython${PYTHON_VERSION}.so.1.0 \\\n    $LIB_FUZZING_ENGINE -lpthread\n  patchelf --set-rpath '$ORIGIN/'  $OUT/${fuzzer}_fuzzer\ndone\n"
  },
  {
    "path": "projects/pybind11/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://pybind11.readthedocs.io/en/stable/\"\nmain_repo: \"https://github.com/pybind/pybind11.git\"\nlanguage: c++\nvendor_ccs:\n - \"david@adalogics.com\"\n - \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/pybind11/pybind_fuzzer.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <fuzzer/FuzzedDataProvider.h>\n#include <iostream>\n#include <string>\n#include \"pybind11/embed.h\"\n#include \"pybind11/pybind11.h\"\n\nnamespace py = pybind11;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  static py::scoped_interpreter guard{};\n  try {\n    auto locals = py::dict();\n    py::exec(fdp.ConsumeRandomLengthString().c_str(), py::globals(), locals);\n  } catch (pybind11::error_already_set &e) {\n  }\n\n  try {\n    py::object os = py::module_::import(\"os\");\n    py::object makedirs = os.attr(fdp.ConsumeRandomLengthString().c_str());\n  } catch (py::error_already_set &e) {\n  }\n\n  try {\n    py::tuple args =\n        py::make_tuple(fdp.ConsumeRandomLengthString().c_str(), py::none());\n    py::object Decimal = py::module_::import(\"decimal\").attr(\"Decimal\");\n    py::object pi = Decimal(fdp.ConsumeRandomLengthString().c_str());\n    py::object exp_pi = pi.attr(fdp.ConsumeRandomLengthString().c_str())();\n  } catch (py::error_already_set &e) {\n  }\n\n  try {\n    py::object obj = py::str(fdp.ConsumeRandomLengthString().c_str());\n  } catch (py::error_already_set &e) {\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/pycparser/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/eliben/pycparser pycparser\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pycparser\n"
  },
  {
    "path": "projects/pycparser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\nzip $OUT/fuzz_c_parser_seed_corpus.zip ./tests/c_files/*.c\n"
  },
  {
    "path": "projects/pycparser/fuzz_c_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport pycparser\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  lex_optimize = fdp.ConsumeBool()\n  yacc_debug = fdp.ConsumeBool()\n  yacc_optimize = fdp.ConsumeBool()\n\n  c_source = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  _c_parser = pycparser.c_parser.CParser(\n                lex_optimize=lex_optimize,\n                yacc_debug=yacc_debug,\n                yacc_optimize=yacc_optimize)\n  try:\n    _c_parser.parse(\n        c_source,\n        ''\n    )\n  except pycparser.c_parser.ParseError:\n    pass\n  except AssertionError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pycparser/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/eliben/pycparser\nlanguage: python\nmain_repo: https://github.com/eliben/pycparser\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pycrypto/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Held back because of github.com/google/oss-fuzz/pull/12027\n# Please fix failure and upgrade if possible.\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d8fe5e2a6a96723f393de413c48d9455a5124995b2349a2e4d6b9abecf99d6d5\nRUN git clone https://github.com/pycrypto/pycrypto\nCOPY build.sh *.py $SRC/\nWORKDIR pycrypto\n"
  },
  {
    "path": "projects/pycrypto/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n    export CFLAGS=\"\"\n    export CXXFLAGS=\"\"\nfi\n# time.clock has been removed in OSS-Fuzz's Python version. Update pycrypto's source\n# code. Pycrypto is deprecated so we can't expect Pycrypto to be updated.\nsed -i 's/clock(/perf_counter(/g' lib/Crypto/Random/_UserFriendlyRNG.py\n\npython3 setup.py build\npython3 setup.py install\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pycrypto/fuzz_aes.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from Crypto.Cipher import AES\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  if len(data) < 40:\n    return\n  fdp = atheris.FuzzedDataProvider(data)\n  key = fdp.ConsumeBytes(16)\n  IV = fdp.ConsumeBytes(16)\n  enc_data = fdp.ConsumeBytes(atheris.ALL_REMAINING)\n\n  # All modes: https://github.com/pycrypto/pycrypto/blob/7acba5f3a6ff10f1424c309d0d34d2b713233019/lib/Crypto/Cipher/AES.py#L183\n  # minus CTR, ECB, PGP (not supported)\n  modes = [\n    AES.MODE_CBC,\n    AES.MODE_CFB,\n    AES.MODE_OFB,\n    AES.MODE_OPENPGP,\n    AES.MODE_CCM,\n    AES.MODE_EAX,\n    AES.MODE_SIV,\n    AES.MODE_GCM\n  ]\n  for mode in modes:\n    try:\n      obj = AES.new(key, mode, IV)\n    except ValueError as e:\n      if not (\n        \"Key cannot be the null string\" in str(e) or\n        \"Length of parameter\" in str(e)\n      ):\n        raise e\n      return\n\n    try:\n      ciphertext = obj.encrypt(enc_data)\n    except ValueError as e:\n      if not \"Input strings must be a multiple of 16 in length\" in str(e):\n        raise e\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pycrypto/fuzz_all_or_nothing.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from Crypto.Protocol import AllOrNothing\n  from Crypto.Cipher import AES\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  if len(data) < 10:\n    return\n  for i in range(50):\n    a1 = AllOrNothing.AllOrNothing(AES)\n    msgblocks = a1.digest(data)\n    a2 = AllOrNothing.AllOrNothing(AES)\n    round_tripped = a2.undigest(msgblocks)\n    assert data == round_tripped\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pycrypto/fuzz_hash.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from Crypto.Hash import (\n    CMAC,\n    HMAC,\n    SHA224,\n    SHA256,\n    SHA384,\n    SHA512,\n    MD2,\n    MD4,\n    MD5,\n    RIPEMD160\n  )\n  from Crypto.Cipher import AES\n\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  hashes = [\n    SHA224,\n    SHA256,\n    SHA384,\n    SHA512,\n    MD2,\n    MD4,\n    MD5,\n    RIPEMD160\n  ]\n  for f in hashes:\n    h = f.new()\n    h.update(data)\n    h.digest\n\n  h = HMAC.new(fdp.ConsumeBytes(9))\n  h.update(data)\n  h.digest\n\n  try:\n    cobj = CMAC.new(fdp.ConsumeBytes(16), ciphermod=AES)\n    cobj.update(data)\n  except ValueError as e:\n    if \"Key cannot be the null string\" not in str(e):\n      raise e\n\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pycrypto/fuzz_number.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  from Crypto.Util import number\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  if len(data) < 30:\n    return\n\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    x = number.getStrongPrime(\n      N=fdp.ConsumeIntInRange(0, 9999),\n      e=fdp.ConsumeIntInRange(0, 99999999999),\n      false_positive_prob=fdp.ConsumeFloat(),\n    )\n  except ValueError as e:\n    pass\n\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pycrypto/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pycrypto/pycrypto\nlanguage: python\nmain_repo: https://github.com/pycrypto/pycrypto\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/pycryptodome/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/Legrandin/pycryptodome.git\nWORKDIR pycryptodome/src\nCOPY build.sh *_fuzzer.cc $SRC/\nCOPY block_common.patch $SRC/pycryptodome/src\n"
  },
  {
    "path": "projects/pycryptodome/block_common.patch",
    "content": "diff --git a/src/block_common.c b/src/block_common.c\nindex 169200a6..c6da1f85 100644\n--- a/src/block_common.c\n+++ b/src/block_common.c\n@@ -106,7 +106,7 @@ EXPORT_SYM int CIPHER_START_OPERATION(const uint8_t key[], size_t key_len, CIPHE\n     if ((key == NULL) || (pResult == NULL))\n         return ERR_NULL;\n\n-    *pResult = calloc(1, sizeof(CIPHER_STATE_TYPE));\n+    *pResult = (CIPHER_STATE_TYPE *) calloc(1, sizeof(CIPHER_STATE_TYPE));\n     if (NULL == *pResult)\n         return ERR_MEMORY;\n"
  },
  {
    "path": "projects/pycryptodome/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npatch block_common.c block_common.patch\n\nPCD_INTERNALS=(./*.c ./libtom/*.c)\nPCD_FLAGS=(\n  \"-I $SRC/pycryptodome/src\"\n  \"-I $SRC/pycryptodome/src/libtom\"\n  \"-D HAVE_STDINT_H\"\n  \"-D HAVE_MEMALIGN\"\n  \"-D HAVE_INTRIN_H\"\n  \"-D SYS_BITS=$(getconf LONG_BIT)\"\n  \"-maes -msse2 -mpclmul\"\n)\n\n$CC $CFLAGS \\\n    ${PCD_FLAGS[@]} \\\n    -c \"${PCD_INTERNALS//'blake2.c'/}\"\nar -qc $WORK/libpycryptodome.a *.o\n\nPCD_HASH_OPTIONS=(\n  \"-D HASHTYPE=md2 -D FNAME=MD2.c -D DIGEST_SIZE=16 -o $OUT/md2_fuzzer\"\n  \"-D HASHTYPE=md4 -D FNAME=MD4.c -D DIGEST_SIZE=16 -o $OUT/md4_fuzzer\"\n  \"-D HASHTYPE=MD5 -D FNAME=MD5.c -o $OUT/md5_fuzzer\"\n  \"-D HASHTYPE=ripemd160 -D FNAME=RIPEMD160.c -D DIGEST_SIZE=RIPEMD160_DIGEST_SIZE -o $OUT/ripemd160_fuzzer\"\n  \"-D HASHTYPE=SHA224 -D FNAME=SHA224.c -D DIGEST_THIRD_PARAM -o $OUT/sha224_fuzzer\"\n  \"-D HASHTYPE=SHA256 -D FNAME=SHA256.c -D DIGEST_THIRD_PARAM -o $OUT/sha256_fuzzer\"\n  \"-D HASHTYPE=SHA384 -D FNAME=SHA384.c -D DIGEST_THIRD_PARAM -o $OUT/sha384_fuzzer\"\n)\n\nfor ((i = 0; i < ${#PCD_HASH_OPTIONS[@]}; i++)); do\n  $CXX $CXXFLAGS ${PCD_FLAGS[@]} \\\n      $SRC/pcd_hash_fuzzer.cc ${PCD_HASH_OPTIONS[i]} \\\n      $LIB_FUZZING_ENGINE $WORK/libpycryptodome.a\ndone\n\n$CXX $CXXFLAGS ${PCD_FLAGS[@]} \\\n    $SRC/pcd_aes_fuzzer.cc -o $OUT/aes_fuzzer \\\n    $LIB_FUZZING_ENGINE $WORK/libpycryptodome.a\n"
  },
  {
    "path": "projects/pycryptodome/pcd_aes_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"AES.c\"\n#include \"common.h\"\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  if (!size)\n    return 0;\n\n  enum KeySize { AES128 = 16, AES192 = 24, AES256 = 32, kMaxValue = AES256 };\n\n  FuzzedDataProvider stream(data, size);\n  const KeySize keySize = stream.ConsumeEnum<KeySize>();\n  if (stream.remaining_bytes() < keySize)\n    return 0;\n\n  std::vector<uint8_t> keyBuf = stream.ConsumeBytes<uint8_t>(keySize);\n  const uint8_t *key = keyBuf.data();\n\n  BlockBase *state;\n  if (AES_start_operation(key, keySize, reinterpret_cast<AES_State **>(&state)))\n    return 0;\n\n  uint8_t outEnc[size];\n  uint8_t outDec[size];\n\n  AES_encrypt(reinterpret_cast<BlockBase *>(state), data, outEnc, size);\n  AES_decrypt(reinterpret_cast<BlockBase *>(state), data, outDec, size);\n\n  AES_stop_operation(reinterpret_cast<BlockBase *>(state));\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/pycryptodome/pcd_hash_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"common.h\"\n#include <fuzzer/FuzzedDataProvider.h>\n\n#ifndef HASHTYPE\n#error Macro HASHTYPE must be defined.\n#endif\n\n#ifndef FNAME\n#error Macro FNAME must be defined.\n#endif\n\n#define CONCAT_TYPE(x) _PASTE2(HASHTYPE, x)\n\n#define init CONCAT_TYPE(_init)\n#define update CONCAT_TYPE(_update)\n#define digest CONCAT_TYPE(_digest)\n#define destroy CONCAT_TYPE(_destroy)\n\n#define STR(x) #x\n#define INCLUDE(x) STR(x)\n\n#include INCLUDE(FNAME)\n\n#ifndef DIGEST_SIZE\n#error Macro DIGEST_SIZE must be defined.\n#endif\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  if (!size)\n    return 0;\n\n  FuzzedDataProvider stream(data, size);\n  hash_state *hs;\n  if (init(&hs))\n    return 0;\n\n  while (stream.remaining_bytes()) {\n    size_t num_bytes = stream.ConsumeIntegral<size_t>();\n    std::vector<uint8_t> buffer = stream.ConsumeBytes<uint8_t>(num_bytes);\n\n    if (update(hs, buffer.data(), buffer.size()))\n      goto error;\n  }\n\n  uint8_t result[DIGEST_SIZE];\n\n#ifndef DIGEST_THIRD_PARAM\n  digest(hs, result);\n#else\n  digest(hs, result, DIGEST_SIZE);\n#endif\n\nerror:\n  destroy(hs);\n  return 0;\n}\n"
  },
  {
    "path": "projects/pycryptodome/project.yaml",
    "content": "homepage: https://www.pycryptodome.org/\nlanguage: c\nmain_repo: https://github.com/Legrandin/pycryptodome.git\nprimary_contact: helderijs@gmail.com\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/pycups/Dockerfile",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get update && apt-get install -y \\\n    libcups2-dev \\\n    libcupsimage2-dev \\\n    pkg-config \\\n    && rm -rf /var/lib/apt/lists/*\n\nRUN git clone --depth 1 https://github.com/OpenPrinting/pycups.git $SRC/pycups\nRUN git clone --depth 1 https://github.com/OpenPrinting/fuzzing.git $SRC/fuzzing\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/pycups"
  },
  {
    "path": "projects/pycups/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nchmod +x $SRC/fuzzing/projects/pycups/oss_fuzz_build.sh\n$SRC/fuzzing/projects/pycups/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/pycups/project.yaml",
    "content": "homepage: \"https://github.com/OpenPrinting/pycups\"\nmain_repo: \"https://github.com/OpenPrinting/pycups\"\nprimary_contact: \"mdimad005@gmail.com\"\nauto_ccs:\n  - \"till.kamppeter@gmail.com\"\n  - \"ossfuzz@iosifache.me\"\n  - \"jiongchiyu@gmail.com\"\n\nlanguage: python\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined"
  },
  {
    "path": "projects/pydantic/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN pip3 install --upgrade pip\nRUN git clone --depth=1 https://github.com/pydantic/pydantic pydantic\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pydantic\n"
  },
  {
    "path": "projects/pydantic/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nln -s /usr/local/bin/python3 /usr/local/bin/python\nsed -i \"s/__version__/compiled=\\\"hack\\\"\\n__version__/g\" pydantic/__init__.py\nmake install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pydantic/fuzz_date.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport pydantic\nfrom datetime import date\nfrom pydantic import BaseModel, FutureDate, PastDate\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  class Model(BaseModel):\n    d: date\n    df: FutureDate\n    pd: PastDate\n    \n  try:\n    Model(ip=fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except ValueError:\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pydantic/fuzz_network.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport pydantic\nfrom pydantic import BaseModel, IPvAnyAddress, IPvAnyInterface, IPvAnyNetwork\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  class Model(BaseModel):\n    ip: IPvAnyAddress\n    interface: IPvAnyInterface\n    network: IPvAnyNetwork\n    \n  try:\n    Model(ip=fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except ValueError:\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pydantic/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pydantic/pydantic\nlanguage: python\nmain_repo: https://github.com/pydantic/pydantic\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pydateutil/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install hypothesis\nRUN git clone --depth 1 https://github.com/dateutil/dateutil\nWORKDIR $SRC\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/pydateutil/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\ncd dateutil\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pydateutil/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\n\nwith atheris.instrument_imports():\n  import dateutil.parser\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  data = fdp.ConsumeUnicode(atheris.ALL_REMAINING)\n  try:\n    dateutil.parser.parse(data)\n  except (dateutil.parser.ParserError, OverflowError):\n    pass\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pydateutil/fuzz_prop_isoparse.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\n\nfrom hypothesis import given, assume\nfrom hypothesis import strategies as st\n\nwith atheris.instrument_imports():\n  from dateutil import tz\n  from dateutil.parser import isoparse\n\n\n# Strategies\nTIME_ZONE_STRATEGY = st.sampled_from([None, tz.UTC] +\n    [tz.gettz(zname) for zname in ('America/New_York', 'America/Los_Angeles',\n                                   'Australia/Sydney', 'Europe/London')])\nASCII_STRATEGY = st.characters(max_codepoint=127)\n\n\n@given(dt=st.datetimes(timezones=TIME_ZONE_STRATEGY), sep=ASCII_STRATEGY)\ndef test_timespec_auto(dt, sep):\n    if dt.tzinfo is not None:\n        # Assume offset has no sub-second components\n        assume(dt.utcoffset().total_seconds() % 60 == 0)\n\n    sep = str(sep)          # Python 2.7 requires bytes\n    dtstr = dt.isoformat(sep=sep)\n    dt_rt = isoparse(dtstr)\n\n    assert dt_rt == dt\n\nif __name__ == \"__main__\":\n     # If that passed, we use Atheris to provide the inputs to our test:\n     atheris.Setup(sys.argv, atheris.instrument_func(test_timespec_auto.hypothesis.fuzz_one_input))\n     atheris.Fuzz()\n\n"
  },
  {
    "path": "projects/pydateutil/fuzz_tzstr.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\n\nwith atheris.instrument_imports():\n  import dateutil.tz\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  data = fdp.ConsumeUnicode(atheris.ALL_REMAINING)\n  try:\n    dateutil.tz.tzstr(data)\n  except (dateutil.tz.DeprecatedTZFormatWarning, ValueError):\n    pass\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pydateutil/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://dateutil.readthedocs.io/en/stable/\nlanguage: python\nmain_repo: https://github.com/dateutil/dateutil\nsanitizers:\n- address\nvendor_ccs:\n- p.antoine@catenacyber.fr\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pygments/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone \\\n\t--depth 1 \\\n\t--branch master \\\n\thttps://github.com/pygments/pygments.git\n\nRUN python3 -m pip install --upgrade pip\n\nWORKDIR pygments\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\n\nCOPY build.sh fuzz_guesser.py fuzz_lexers.py $SRC/\n"
  },
  {
    "path": "projects/pygments/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\n# Create shared seed corpus\nfind tests/examplefiles/ -type f | zip -@ -q $OUT/fuzz_lexers_seed_corpus.zip\ncp $OUT/fuzz_lexers_seed_corpus.zip $OUT/fuzz_guesser_seed_corpus.zip\n\n# Create shared dictionary\ncat fuzzing/dictionaries/aff.dict \\\n    fuzzing/dictionaries/bash.dict \\\n    fuzzing/dictionaries/creole.dict \\\n    fuzzing/dictionaries/css.dict \\\n    fuzzing/dictionaries/graphviz.dict \\\n    fuzzing/dictionaries/fbs.dict \\\n    fuzzing/dictionaries/html.dict \\\n    fuzzing/dictionaries/jinja2.dict \\\n    fuzzing/dictionaries/js.dict \\\n    fuzzing/dictionaries/json.dict \\\n    fuzzing/dictionaries/lua.dict \\\n    fuzzing/dictionaries/markdown.dict \\\n    fuzzing/dictionaries/mathml.dict \\\n    fuzzing/dictionaries/pdf.dict \\\n    fuzzing/dictionaries/protobuf.dict \\\n    fuzzing/dictionaries/ps.dict \\\n    fuzzing/dictionaries/regexp.dict \\\n    fuzzing/dictionaries/rst.dict \\\n    fuzzing/dictionaries/sql.dict \\\n    fuzzing/dictionaries/svg.dict \\\n    fuzzing/dictionaries/tex.dict \\\n    fuzzing/dictionaries/toml.dict \\\n    fuzzing/dictionaries/utf8.dict \\\n    fuzzing/dictionaries/vcf.dict \\\n    fuzzing/dictionaries/wkt.dict \\\n    fuzzing/dictionaries/x86.dict \\\n    fuzzing/dictionaries/xml.dict \\\n    fuzzing/dictionaries/xpath.dict \\\n    fuzzing/dictionaries/xslt.dict \\\n    fuzzing/dictionaries/yaml.dict \\\n    fuzzing/dictionaries/yara.dict \\\n> \"$OUT/fuzz_lexers.dict\"\n\ncp \"$OUT/fuzz_lexers.dict\" \"$OUT/fuzz_guesser.dict\"\n"
  },
  {
    "path": "projects/pygments/fuzz_guesser.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\n\nimport sys\nimport pygments\nimport pygments.lexers\nimport pygments.util\n\ndef TestOneInput(data: bytes) -> int:\n  if len(data) > (2 << 18):\n    return\n\n  try:\n    lexer = pygments.lexers.guess_lexer(str(data))\n  except pygments.util.ClassNotFound:\n    return 0\n  return 0\n\n\natheris.instrument_all()\natheris.Setup(sys.argv, TestOneInput)\natheris.Fuzz()\n"
  },
  {
    "path": "projects/pygments/fuzz_lexers.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\n\nimport sys\nimport pygments\nfrom pygments.formatters import *\nimport pygments.lexers\nimport pygments.filters\n\n# pygments.LEXERS.values() is a list of tuples like this, with some of then empty:\n# (textual class name, longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes)\nLEXERS = [l[2][0] for l in pygments.lexers.LEXERS.values() if l[2]]\nFORMATTERS = [BBCodeFormatter(), GroffFormatter(), HtmlFormatter(),\n              IRCFormatter(), LatexFormatter(), NullFormatter(),\n              PangoMarkupFormatter(), RawTokenFormatter(), RtfFormatter(),\n              SvgFormatter(), Terminal256Formatter(), TerminalFormatter(),\n              TerminalTrueColorFormatter()]\n\ndef TestOneInput(data: bytes) -> int:\n  if len(data) > (2 << 18):\n    return\n  fdp = atheris.FuzzedDataProvider(data)\n  random_lexer = pygments.lexers.get_lexer_by_name(fdp.PickValueInList(LEXERS))\n  random_lexer.add_filter(fdp.PickValueInList(list(pygments.filters.FILTERS.keys())))\n  formatter = fdp.PickValueInList(FORMATTERS)\n  str_data = fdp.ConsumeUnicode(atheris.ALL_REMAINING)\n\n  pygments.highlight(str_data, random_lexer, formatter)\n  return 0\n\n\natheris.instrument_all()\natheris.Setup(sys.argv, TestOneInput)\natheris.Fuzz()\n"
  },
  {
    "path": "projects/pygments/project.yaml",
    "content": "homepage: \"https://pygments.org/\"\nmain_repo: \"https://github.com/pygments/pygments\"\nlanguage: python\nprimary_contact: \"georg.brandl@gmail.com\"\nauto_ccs:\n  - \"julien.voisin@dustri.org\"\n  - \"ipudney@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/pyjson5/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/dpranke/pyjson5 pyjson5\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pyjson5\n"
  },
  {
    "path": "projects/pyjson5/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pyjson5/fuzz_json.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport json5\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    json5.loads(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (ValueError, TypeError, RecursionError) as e:\n    # ValueError and TypeError are raised by the function\n    # RecursionError is not interesting.\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyjson5/project.yaml",
    "content": "homepage: https://github.com/dpranke/pyjson5\nmain_repo: https://github.com/dpranke/pyjson5\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pyjwt/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/jpadilla/pyjwt\nWORKDIR pyjwt\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/pyjwt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pyjwt/fuzz_jwt.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nimport jwt\nimport json\nfrom collections.abc import Mapping\n\n\ndef test_decoding(data):\n    \"\"\"Checks jwt decoding does not fail\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    s1 = fdp.ConsumeUnicodeNoSurrogates(1024)\n    try:\n        _ = jwt.decode(s1, algorithms=[\"HS256\"])\n    except jwt.exceptions.PyJWTError:\n        pass\n\n\ndef test_roundtrip(data):\n    \"\"\"Check payload == decoded(encoded(payload))\"\"\"\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        payload = json.loads(fdp.ConsumeUnicodeNoSurrogates(1024))\n    except:\n        return\n    # Only continue if correct type was created as payload.\n    if not isinstance(payload, Mapping): \n        return\n\n    key = \"fuzzing\"\n    try:\n        jwt_message = jwt.encode(payload, key, algorithm=\"HS256\")\n        decoded_payload = jwt.decode(jwt_message, key, algorithms=[\"HS256\"])\n    except jwt.exceptions.PyJWTError:\n        return\n    assert decoded_payload == payload \n\n\ndef TestOneInput(data):\n    test_decoding(data)\n    test_roundtrip(data)\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pyjwt/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/jpadilla/pyjwt\nlanguage: python\nmain_repo: https://github.com/jpadilla/pyjwt\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/pymysql/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip mock setuptools\nRUN git clone https://github.com/PyMySQL/PyMySQL pymysql\nCOPY *.sh *py *.diff $SRC/\nWORKDIR $SRC/pymysql\n"
  },
  {
    "path": "projects/pymysql/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pymysql/fuzz_connection.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nimport threading\nimport socket\nimport time\n\nimport configparser\nimport pymysql\nfrom pymysql import connections, constants\n\n\nfuzzed_input = b\"\"\n\n# somehow ugly as fuzzing cannot be run in parallel\ndef SetFuzzedInput(input_bytes):\n global fuzzed_input\n fuzzed_input = input_bytes\n\nclass ServerThread(threading.Thread):\n  def __init__(self):\n    self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n    self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n    self.s.bind((\"127.0.0.1\", 8001))\n    self.s.listen(1)\n\n    threading.Thread.__init__(self)\n\n  def run(self):\n    global fuzzed_input\n    conn, addr = self.s.accept()\n    conn.settimeout(0.3)\n    try:\n      conn.recv(1024)\n    except:\n      pass\n    conn.send(fuzzed_input)\n    time.sleep(0.005)\n    conn.close()\n    self.s.shutdown(1)\n    self.s.close()\n    time.sleep(0.01)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  local_config_file = \"/tmp/my.cnf\"\n  with open(local_config_file, \"w\") as cfg:\n    cfg.write(fdp.ConsumeUnicodeNoSurrogates(1024))\n\n  # Catch config parser errors\n  try:\n    c = connections.Connection(\n      db=None,\n      read_default_file=local_config_file,\n      ssl_disabled=True,\n      defer_connect=True\n    )\n  except configparser.Error:\n    return\n  c.port = 8001\n  c.host = \"127.0.0.1\"\n\n  SetFuzzedInput(fdp.ConsumeBytes(512))\n  t1 = ServerThread()\n  t1.start()\n\n  try:\n    c.connect(sock=None)\n  except pymysql.err.MySQLError:\n    pass\n  t1.join()\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pymysql/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/PyMySQL/PyMySQL\nlanguage: python\nmain_repo: https://github.com/PyMySQL/PyMySQL\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pynacl/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get install -y libffi-dev mercurial\nRUN pip3 install --upgrade pip cffi\nRUN git clone https://github.com/pyca/pynacl pynacl\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pynacl\n"
  },
  {
    "path": "projects/pynacl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 ./setup.py install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --hidden-import=cffi\ndone\n"
  },
  {
    "path": "projects/pynacl/fuzz_hash.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport nacl.hash\nimport nacl.pwhash\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  nacl.hash.sha256(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 512)))\n  nacl.hash.sha512(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 512)))\n  nacl.hash.generichash(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 512)), key=fdp.ConsumeBytes(32))\n\n  try:\n    nacl.pwhash.kdf_scryptsalsa208sha256(\n      32,\n      fdp.ConsumeBytes(fdp.ConsumeIntInRange(10, 1000)),\n      fdp.ConsumeBytes(32),\n      2000,\n      (2**20)*100\n    )\n  except ValueError:\n    pass\n\n  nacl.pwhash.scryptsalsa208sha256_str(fdp.ConsumeBytes(1024))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pynacl/fuzz_signing.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport nacl.hash\nimport nacl.pwhash\n\nfrom nacl.bindings import crypto_sign_PUBLICKEYBYTES\nfrom nacl.signing import SigningKey, VerifyKey\n\n\ndef TestOneInput(data):\n  skey = SigningKey.generate()\n  signature = skey.sign(data)\n  try:\n    VerifyKey(data)\n  except ValueError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pynacl/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pyca/pynacl\nlanguage: python\nmain_repo: https://github.com/pyca/pynacl\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com"
  },
  {
    "path": "projects/pyodbc/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d223a882810372830fd7968eb3e64533f3a2318c90be43ac753a46a15946faec\nRUN apt-get update && apt-get install -y make autoconf automake libtool unixodbc-dev\nRUN git clone --depth 1 https://github.com/mkleehammer/pyodbc\nWORKDIR pyodbc\nCOPY build.sh *.py *.c $SRC/\n"
  },
  {
    "path": "projects/pyodbc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Compile the fake odbc driver\nclang -Wno-unused-result -Wsign-compare -Wunreachable-code \\\n      -fwrapv  -Wno-write-strings -fPIC \\\n      -shared -I/usr/local/include/python3.8 -I$PWD/src  \\\n      -o $OUT/fuzzodbc.so $SRC/fake_odbc_driver.c\n\npython3 setup.py install\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  LD_PRELOAD=$OUT/sanitizer_with_fuzzer.so ASAN_OPTIONS=detect_leaks=0 compile_python_fuzzer $fuzzer --add-data $OUT/fuzzodbc.so:.\ndone\n"
  },
  {
    "path": "projects/pyodbc/fake_odbc_driver.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n/* Fake odbc driver that simply returns 0 on every call and has no side effects */\n\n#include <sql.h>\n#include <sqlext.h>\n\nSQLRETURN SQLAllocHandle(SQLSMALLINT a1, SQLHANDLE a2, SQLHANDLE *a3) {\n  return 0;\n}\n\nSQLRETURN\nSQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle,\n                 SQLCHAR *InConnectionString, SQLSMALLINT StringLength1,\n                 SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength,\n                 SQLSMALLINT *StringLength2Ptr, SQLUSMALLINT DriverCompletion) {\n  return 0;\n}\n\nSQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute,\n                            SQLPOINTER ValuePtr, SQLINTEGER StringLength) {\n  return 0;\n}\n\nSQLRETURN SQL_API SQLExecDirectW(SQLHSTMT hstmt, SQLWCHAR *szSqlStr,\n                                 SQLINTEGER cbSqlStr) {\n  return 0;\n}\n\nSQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) {\n  return 0;\n}\n\nSQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle,\n                                   SQLSMALLINT *ColumnCount) {\n  return 0;\n}\n"
  },
  {
    "path": "projects/pyodbc/fuzz_curs_exec.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Fuzzer that targets native code of pyodbc with a fake odbc driver\"\"\"\nimport os\nimport sys\nimport atheris\nimport pyodbc\n\n@atheris.instrument_func\ndef fuzz_exec(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    connstr = \"DRIVER=FUZZ;\"\n    s1 = fdp.ConsumeUnicodeNoSurrogates(50)\n    if \"DRIVER\" in s1:\n        return\n    cstr = connstr + s1\n    connection_obj = pyodbc.connect(cstr)\n    csr = connection_obj.cursor()\n    try:\n        csr.execute(fdp.ConsumeUnicodeNoSurrogates(20))\n    except Exception as e:\n        if \"Invalid string or buffer length\" in str(e):\n            pass\n        else:\n            raise e\n    return 0\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    try:\n        return fuzz_exec(data)\n    except SystemError:\n        return 0\n\n\ndef main():\n    # Write the odbcinst.ini file\n    dir_path = os.path.dirname(os.path.realpath(__file__))\n    with open(\"/tmp/odbcinst.ini\", \"w\") as f:\n        f.write(\"[FUZZ]\\n\")\n        f.write(\"Driver=%s/fuzzodbc.so\\n\"%(dir_path))\n    os.environ['ODBCSYSINI'] = '/tmp/'\n    \n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pyodbc/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/mkleehammer/pyodbc\nlanguage: python\nmain_repo: https://github.com/mkleehammer/pyodbc\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/pyparsing/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/pyparsing/pyparsing pyparsing\nWORKDIR pyparsing\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/pyparsing/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pyparsing/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom pyparsing import (\n    Literal,\n    Word,\n    ZeroOrMore,\n    Group,\n    Dict,\n    Suppress,\n    ParseException,\n)\n\ndef dict_parse_generator(fdp):\n    \"\"\"Generate random parser\"\"\"\n    curr = Literal(\"f\")\n    special_chars=\"[]{}/|\\<>:;-=\"\n    op_count = fdp.ConsumeIntInRange(2, 15)\n    for i in range(op_count):\n        operation = fdp.ConsumeIntInRange(0,4)\n        if operation == 0:\n            l1 = Literal(fdp.PickValueInList(list(special_chars)))\n            l2 = Literal(fdp.PickValueInList(list(special_chars)))\n            word = Word(fdp.ConsumeUnicodeNoSurrogates(10))\n            curr = Group(Dict(ZeroOrMore(word)) + curr)\n        elif operation == 1:\n            word1 = Word(fdp.ConsumeUnicodeNoSurrogates(10))\n            word2 = Word(fdp.ConsumeUnicodeNoSurrogates(10))\n            curr = Group(Dict(OneOrMore(word1, word2)) + curr)\n        elif operation == 2:\n            curr = curr + Word(fdp.ConsumeUnicodeNoSurrogates(10))\n        elif operation == 3:\n            curr = curr + Suppress(fdp.ConsumeUnicodeNoSurrogates(2))\n        else:\n            word1 = Word(fdp.ConsumeUnicodeNoSurrogates(10))\n            word2 = Word(fdp.ConsumeUnicodeNoSurrogates(10))\n            curr = Group(Dict(OneOrMore(word1, word2)) + curr)\n    return Dict(curr)\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        bnf = dict_parse_generator(fdp)\n    except:\n        return\n    \n    try:\n        tokens = bnf.parseString(fdp.ConsumeUnicodeNoSurrogates(1024))\n    except ParseException:\n        pass\n    except TypeError as e:\n        # Catch the TypeError exception from here:\n        # https://github.com/pyparsing/pyparsing/blob/d93930308f7fe79f2290812074f62a472c83db59/pyparsing/core.py#L5674\n        if \"could not extract dict values from parsed results\" in str(e): \n            pass\n        else:\n            raise e\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pyparsing/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pyparsing/pyparsing\nlanguage: python\nmain_repo: https://github.com/pyparsing/pyparsing\nprimary_contact: \"ptmcg@austin.rr.com\"\nsanitizers:\n- address\n- undefined\nauto_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/pyrsistent/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/tobgu/pyrsistent pyrsistent\nWORKDIR pyrsistent\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/pyrsistent/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pyrsistent/fuzz_vector.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom pyrsistent._pvector import python_pvector\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    \n    p = python_pvector([])\n    e = None\n\n    # Perform a sequence of arbitrary operations on the vector.\n    ops_num = fdp.ConsumeIntInRange(5, 500)\n    for i in range(ops_num):\n        op = fdp.ConsumeIntInRange(1, 6)\n        if op == 1:\n            p = p.append(fdp.ConsumeIntInRange(1,2000))\n        elif op == 2:\n            p.count(fdp.ConsumeIntInRange(1, 200))\n        elif op == 3:\n            try:\n                p = p.set(fdp.ConsumeIntInRange(1, 100), fdp.ConsumeIntInRange(1, 100))\n            except IndexError:\n                pass\n        elif op == 4:\n            try:\n                p = p.remove(fdp.ConsumeIntInRange(1,20))\n            except ValueError as exc:\n                if \"not in list\" not in str(exc):\n                    raise exc\n        elif op == 5:\n            e = p.evolver()\n        elif op == 6 and e != None:\n            _ = len(e)\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pyrsistent/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/tobgu/pyrsistent\nlanguage: python\nmain_repo: https://github.com/tobgu/pyrsistent\nsanitizers:\n- address\n- undefined\nprimary_contact: \"tobias.l.gustafsson@gmail.com\"\nauto_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pytables/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get install -y pkg-config libblosc-dev libbz2-dev liblzo2-dev \\\n                       liblzma-dev liblz4-dev libz-dev\nRUN pip3 install --upgrade pip && pip3 install cython packaging python-lzo blosc2\nRUN git clone https://github.com/pytables/pytables pytables\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pytables\n"
  },
  {
    "path": "projects/pytables/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\nif [ $SANITIZER == \"coverage\" ]; then\n  unset CFLAGS\n  unset CXXFLAGS\nfi\n\n# Build supported version of HDF5 with relevant sanitizers.\ncd $SRC/\nwget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.gz\ntar -xf hdf5-1.10.5.tar.gz\ncd hdf5-1.10.5/                                                  \n./configure --prefix=/usr/\nmake -j4                                                  \nmake install\n\ncd $SRC/pytables\n\npython3 ./setup.py install\npython3 -m pip install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data \"/usr/local/lib64/libblosc2.so.2.8.0:.\" --add-data \"/usr/local/lib64/libblosc2.so.2:.\" --add-data \"/usr/local/lib64/libblosc2.so:.\"\ndone\n\n# Create corpus\nmkdir $SRC/corpus\nfind ./tables/tests -name \"*.h5\" -exec cp {} $SRC/corpus/ \\;\nzip -rj $OUT/fuzz_1_seed_corpus.zip $SRC/corpus/*\n"
  },
  {
    "path": "projects/pytables/fuzz_file.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\"\"\"Module for fuzzing arbitrary file load and then performing various operations\non it. All fuzzer data is used for the file in this fuzzer to make corpus\nusage efficient.\"\"\"\nimport sys\nimport atheris\nimport tables\n\n\ndef TestOneInput(data):\n  fname = '/tmp/fuzzfile.h5'\n  with open(fname, 'wb') as f:\n    f.write(data)\n  try:\n    table_file = tables.open_file(fname)\n  except tables.exceptions.HDF5ExtError:\n    return\n\n  try:\n    table_file.create_group(\"/some/where\", \"name\")\n  except tables.exceptions.NodeError:\n    pass\n\n  table_file.create_path(\"/just/random/path\")\n  table_file.create_tabe(\"/just/random/path/p1\", \"table_name\")\n  table_file.create_array(\"/just/random/path/p2\", \"array_name\")\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pytables/fuzz_file_extended.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\"\"\"Fuzzing arbitrary file loading and arbitrary file operations on the\nloaded file, in the event of a successful load.\"\"\"\nimport sys\nimport atheris\nimport tables\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fname = '/tmp/fuzzfile.h5'\n  with open(fname, 'wb') as f:\n    f.write(fdp.ConsumeBytes(fdp.ConsumeIntInRange(1, 16384)))\n  try:\n    table_file = tables.open_file(fname)\n  except tables.exceptions.HDF5ExtError:\n    return\n\n  try:\n    table_file.create_group(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(2, 24)),\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(2, 24)))\n  except tables.exceptions.NodeError:\n    return\n\n  table_file.create_path(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(2, 24)))\n  table_file.create_tabe(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(2, 24)),\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(2, 24)))\n  table_file.create_array(\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(2, 24)),\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(2, 24)))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pytables/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pytables/pytables\nlanguage: python\nmain_repo: https://github.com/pytables/pytables\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pytest-py/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/pytest-dev/py py\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/py\n"
  },
  {
    "path": "projects/pytest-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 setup.py develop\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --hidden-import=py._builtin\ndone\n"
  },
  {
    "path": "projects/pytest-py/fuzz_source.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport py\nfrom py._code.source import Source\n\n\ndef TestOneInput(data):\n  if len(data) < 3:\n    return\n  fdp = atheris.FuzzedDataProvider(data)\n\n  source = Source(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  source.isparseable()\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pytest-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pytest-dev/py\nlanguage: python\nmain_repo: https://github.com/pytest-dev/py\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-ecdsa/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/tlsfuzzer/python-ecdsa python-ecdsa\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-ecdsa\n"
  },
  {
    "path": "projects/python-ecdsa/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-ecdsa/fuzz_ecdsa.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport hashlib\nimport binascii\nimport ecdsa\n\n\ndef target1(fdp):\n  d = fdp.ConsumeIntInRange(\n      1, 9999999999999999999999999999999999999999999999999999999999)\n  k = fdp.ConsumeIntInRange(\n      1, 9999999999999999999999999999999999999999999999999999999999)\n  msg = fdp.ConsumeIntInRange(\n      1, 9999999999999999999999999999999999999999999999999999999999)\n\n  Q = d * ecdsa.ecdsa.generator_192\n  R = k * ecdsa.ecdsa.generator_192\n\n  pubk = ecdsa.ecdsa.Public_key(ecdsa.ecdsa.generator_192,\n                                ecdsa.ecdsa.generator_192 * d)\n  privk = ecdsa.ecdsa.Private_key(pubk, d)\n  sig = privk.sign(msg, k)\n  pubk.verifies(msg, sig)\n  pubk.verifies(msg - 1, sig)\n\n\ndef target2(fdp):\n  ecdsa._sha3.shake_256(fdp.ConsumeBytes(sys.maxsize),\n                        fdp.ConsumeIntInRange(1, 64))\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  targets = [\n      target1,\n      target2,\n  ]\n  target = fdp.PickValueInList(targets)\n  target(fdp)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-ecdsa/fuzz_eddsa.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport hashlib\nimport binascii\n\nimport ecdsa\n\n\ndef target1(fdp):\n  a = ecdsa.ellipticcurve.PointEdwards(ecdsa.eddsa.curve_ed25519,\n                                       fdp.ConsumeIntInRange(0, 10),\n                                       fdp.ConsumeIntInRange(0, 10),\n                                       fdp.ConsumeIntInRange(0, 10),\n                                       fdp.ConsumeIntInRange(0, 10))\n  z = a.double()\n\n\ndef target2(fdp):\n  try:\n    key = ecdsa.eddsa.PublicKey(ecdsa.eddsa.generator_ed25519,\n                                fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 512)))\n    key.verify(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 512)), fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 512)))\n  except ValueError:\n    pass\n  except ecdsa.errors.MalformedPointError:\n    pass\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  targets = [\n      target1,\n      target2,\n  ]\n  target = fdp.PickValueInList(targets)\n  target(fdp)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-ecdsa/fuzz_keys.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport hashlib\nimport binascii\n\nimport ecdsa\nfrom ecdsa.keys import VerifyingKey\nfrom ecdsa import SigningKey\n\n\ndef target1(fdp):\n  try:\n    VerifyingKey.from_der(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)))\n  except ecdsa.der.UnexpectedDER:\n    pass\n\n\ndef target2(fdp):\n  try:\n    VerifyingKey.from_pem(fdp.ConsumeBytes(\n      fdp.ConsumeIntInRange(0, 1024)), hashlib.sha256)\n  except ecdsa.der.UnexpectedDER:\n    pass\n  except binascii.Error:\n    pass\n\n\ndef target3(fdp):\n  try:\n    VerifyingKey.from_public_key_recovery_with_digest(\n      fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)),\n      fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)),\n      ecdsa.curves.Ed25519)\n  except ecdsa.der.UnexpectedDER:\n    pass\n  except ValueError:\n    pass\n\n\ndef target4(fdp):\n  try:\n    VerifyingKey.from_string(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)),\n      ecdsa.curves.Ed25519)\n  except ecdsa.keys.MalformedPointError:\n    pass\n  except ecdsa.der.UnexpectedDER:\n    pass\n  except ValueError:\n    pass\n\n\ndef target5(fdp):\n  vk_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024))\n  sig = fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024))\n  data = fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024))\n  try:\n    vk = VerifyingKey.from_pem(vk_str)\n    vk.verify(sig, data)\n  except ecdsa.keys.MalformedPointError:\n    pass\n  except ecdsa.der.UnexpectedDER:\n    pass\n  except ValueError:\n    pass\n\n\ndef target6(fdp):\n  sk = SigningKey.generate()\n  vk = sk.verifying_key\n  message = fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024))\n  signature = sk.sign(message)\n  assert vk.verify(signature, message)\n\n\ndef target7(fdp):\n  try:\n    SigningKey.from_string(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)),\n                           curve=ecdsa.curves.NIST384p)\n  except ecdsa.keys.MalformedPointError:\n    pass\n\n\ndef target8(fdp):\n  try:\n    SigningKey.from_pem(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)))\n  except ecdsa.der.UnexpectedDER:\n    pass\n  except ValueError:\n    pass\n\n\ndef target9(fdp):\n  try:\n    SigningKey.from_der(fdp.ConsumeBytes(fdp.ConsumeIntInRange(0, 1024)))\n  except ecdsa.der.UnexpectedDER:\n    pass\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  targets = [\n    target1,\n    target2,\n    target3,\n    target4,\n    target5,\n    target6,\n    target7,\n    target8,\n    target9\n  ]\n\n  target = fdp.PickValueInList(targets)\n  target(fdp)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-ecdsa/project.yaml",
    "content": "homepage: https://github.com/tlsfuzzer/python-ecdsa\nmain_repo: https://github.com/tlsfuzzer/python-ecdsa\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-email-validator/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN python3 -m pip install --upgrade pip\nRUN git clone --depth 1 https://github.com/JoshData/python-email-validator python-email-validator\nRUN git clone --depth 1 https://github.com/manunio/fuzz-corpus fuzz-corpus\nWORKDIR python-email-validator\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/python-email-validator/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nzip -r $OUT/fuzz_validator_seed_corpus.zip $SRC/fuzz-corpus/python-email-validator\n\npython3 -m pip install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py');do\n    compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-email-validator/fuzz_validator.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nfrom email_validator import EmailSyntaxError, \\\n    EmailUndeliverableError, \\\n    validate_email\n\n\ndef TestOneInput(data):\n    try:\n        validate_email(data, check_deliverability=False)\n    except (EmailSyntaxError, EmailUndeliverableError):\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/python-email-validator/project.yaml",
    "content": "homepage: \"https://github.com/JoshData/python-email-validator\"\nlanguage: python\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: \"https://github.com/JoshData/python-email-validator\"\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/python-fastjsonschema/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN git clone https://github.com/horejsek/python-fastjsonschema python-fastjsonschema\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-fastjsonschema\n"
  },
  {
    "path": "projects/python-fastjsonschema/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-fastjsonschema/fuzz_compile.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport fastjsonschema\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  # Create a random dictionary\n  try:\n    json_dict = json.loads(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except:\n    return\n  if not isinstance(json_dict, dict):\n    return\n\n  # Ensure we can compile it\n  fastjsonschema.compile(json_dict)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-fastjsonschema/project.yaml",
    "content": "homepage: https://github.com/horejsek/python-fastjsonschema\nmain_repo: https://github.com/horejsek/python-fastjsonschema\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/python-future/Dockerfile",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/PythonCharmers/python-future python-future\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-future\n"
  },
  {
    "path": "projects/python-future/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npython3 -m pip install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-future/fuzz_future_email.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport json\nimport atheris\n\nfrom future.backports.email.mime.multipart import MIMEMultipart\nfrom future.backports.email.mime.text import MIMEText\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  MIMEMultipart(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))\n  MIMEText(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-future/fuzz_future_htmlparser.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport json\nimport atheris\n\nfrom future.backports.html import parser as future_html_parser\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fhtml_parser = future_html_parser.HTMLParser()\n  try:\n    fhtml_parser.feed(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))\n  except future_html_parser.HTMLParseError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-future/fuzz_future_urllib.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport json\nimport atheris\n\nimport future.backports.urllib.request as urllib_request\nfrom future.backports.urllib import parse as urllib_parse\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  str_list = []\n  for i in range(5):\n    str_list.append(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))\n  urllib_request.parse_http_list(str_list)\n\n  # urllib_parse\n  try:\n    urllib_parse.quote(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)),\n        encoding=fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 16)),\n        safe=fdp.ConsumeUnicodeNoSurrogates(2))\n  except (LookupError, TypeError, ValueError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-future/fuzz_past.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport json\nimport atheris\n\nfrom past.builtins import dict as past_dict\nfrom past.builtins import str as past_str\nfrom past.types.oldstr import unescape as past_unescape\n\n\ndef fuzz_dict(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    json_dict = json.loads(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))\n  except:\n    return\n\n  if not isinstance(json_dict, dict):\n    return\n  pdict = past_dict(json_dict)\n\n  for val in json_dict:\n    assert pdfict.has_key(val)\n\n\ndef fuzz_str(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  pstr = past_str(fdp.ConsumeBytes(fdp.ConsumeIntInRange(1, 1024)))\n  past_unescape(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))\n\n\ndef TestOneInput(data):\n  fuzz_dict(data)\n  fuzz_str(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-future/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/PythonCharmers/python-future\nlanguage: python\nmain_repo: https://github.com/PythonCharmers/python-future\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-graphviz/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/xflr6/graphviz graphviz\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/graphviz\n"
  },
  {
    "path": "projects/python-graphviz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-graphviz/fuzz_graph.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Create a random graph and pass it through the whole rendering process.\"\"\"\nimport sys\nimport atheris\nimport graphviz\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  g = graphviz.Graph('G', filename='/tmp/process.gv', engine='sfdp')\n  for i in range(fdp.ConsumeIntInRange(1, 8196)):\n    g.edge(fdp.ConsumeUnicodeNoSurrogates(24),\n           fdp.ConsumeUnicodeNoSurrogates(24))\n  try:\n    g.view()\n  except (\n      NotImplementedError,\n      graphviz.backend.execute.CalledProcessError,\n      graphviz.backend.execute.ExecutableNotFound,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-graphviz/project.yaml",
    "content": "homepage: https://github.com/xflr6/graphviz\nmain_repo: https://github.com/xflr6/graphviz\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-hyperlink/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/python-hyper/hyperlink hyperlink\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/hyperlink\n"
  },
  {
    "path": "projects/python-hyperlink/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-hyperlink/fuzz_host.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport hyperlink\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  host = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n  hyperlink._url._decode_host(host)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-hyperlink/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport hyperlink\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_url = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n\n  try:\n    hyperlink._url.parse(fuzz_url)\n  except (hyperlink._url.URLParseError,ValueError,TypeError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-hyperlink/project.yaml",
    "content": "homepage: https://github.com/python-hyper/hyperlink\nmain_repo: https://github.com/python-hyper/hyperlink\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-jose/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/mpdavis/python-jose python-jose\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-jose\n"
  },
  {
    "path": "projects/python-jose/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-jose/fuzz_jwe.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-2\n# Imports by the generated code\nfrom jose.jwe import get_unverified_header\nimport jose\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_header = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  try:\n    get_unverified_header(fuzz_header)\n  except (jose.exceptions.JOSEError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-jose/fuzz_jws.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-2\n# Imports by the generated code\nfrom jose.jws import get_unverified_headers\nimport jose\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  unverified_headers = fdp.ConsumeUnicodeNoSurrogates(\n      fdp.ConsumeIntInRange(0, 4096))\n  try:\n    get_unverified_headers(unverified_headers)\n  except (jose.exceptions.JOSEError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-jose/project.yaml",
    "content": "homepage: https://github.com/mpdavis/python-jose\nmain_repo: https://github.com/mpdavis/python-jose\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-lz4/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth 1 https://github.com/python-lz4/python-lz4\n\nCOPY build.sh $SRC/\nCOPY fuzz_* $SRC/\n\nWORKDIR $SRC/python-lz4\n\n"
  },
  {
    "path": "projects/python-lz4/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 setup.py install\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-lz4/fuzz_lz4.py",
    "content": "#!/usr/bin/python3\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n  import lz4.frame\n\ndef TestOneInput(data):\n    c =lz4.frame.compress(data)\n    d = lz4.frame.decompress(c)\n    assert(data == d)\n    return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/python-lz4/project.yaml",
    "content": "homepage: \"https://github.com/lz4/lz4\"\nlanguage: python\nprimary_contact: \"jonathan.underwood@gmail.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/lz4/lz4'\n"
  },
  {
    "path": "projects/python-markdown/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/python-markdown/markdown markdown\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/markdown\n"
  },
  {
    "path": "projects/python-markdown/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-markdown/fuzz_convert.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport markdown\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  md = markdown.core.Markdown()\n  try:\n    md.convert(fdp.ConsumeUnicodeNoSurrogates(1024))\n  except NotImplementedError:\n    pass\n  except RecursionError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-markdown/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/python-markdown/markdown\nlanguage: python\nmain_repo: https://github.com/python-markdown/markdown\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-markdownify/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone http://github.com/matthewwithanm/python-markdownify python-markdownify\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-markdownify\n"
  },
  {
    "path": "projects/python-markdownify/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-markdownify/fuzz_convert.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport markdownify\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  raw_markdown = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n\n  # Class target.\n  converter = markdownify.MarkdownConverter()\n  converter.convert(raw_markdown)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-markdownify/project.yaml",
    "content": "homepage: http://github.com/matthewwithanm/python-markdownify\nmain_repo: http://github.com/matthewwithanm/python-markdownify\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-multipart/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/Kludex/python-multipart python-multipart\nRUN python3 -m pip install --upgrade pip\nWORKDIR python-multipart\nCOPY *.patch $SRC/python-multipart/\nCOPY build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/python-multipart/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit apply $SRC/python-multipart/*.patch\npython3 -m pip install '.[dev]'\nfor fuzzer in $(find $SRC -name \"fuzz_*.py\"); do\n    compile_python_fuzzer $fuzzer\ndone\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/python-multipart/fuzz_form.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/python-multipart/fuzz_form.patch",
    "content": "diff --git a/fuzz/fuzz_form.py b/fuzz/fuzz_form.py\nindex 9a3d854..fbc6ad9 100644\n--- a/fuzz/fuzz_form.py\n+++ b/fuzz/fuzz_form.py\n@@ -29,7 +29,7 @@ def parse_form_urlencoded(fdp: EnhancedDataProvider) -> None:\n\n\n def parse_multipart_form_data(fdp: EnhancedDataProvider) -> None:\n-    boundary = \"boundary\"\n+    boundary = fdp.ConsumeRandomStringOfSize(16) or \"boundary\"\n     header = {\"Content-Type\": f\"multipart/form-data; boundary={boundary}\"}\n     body = (\n         f\"--{boundary}\\r\\n\"\n"
  },
  {
    "path": "projects/python-multipart/helpers.patch",
    "content": "diff --git a/fuzz/helpers.py b/fuzz/helpers.py\nindex 7fcd45c..d107cc1 100644\n--- a/fuzz/helpers.py\n+++ b/fuzz/helpers.py\n@@ -1,9 +1,11 @@\n import atheris\n\n-\n class EnhancedDataProvider(atheris.FuzzedDataProvider):\n     def ConsumeRandomBytes(self) -> bytes:\n         return self.ConsumeBytes(self.ConsumeIntInRange(0, self.remaining_bytes()))\n\n     def ConsumeRandomString(self) -> str:\n         return self.ConsumeUnicodeNoSurrogates(self.ConsumeIntInRange(0, self.remaining_bytes()))\n+\n+    def ConsumeRandomStringOfSize(self, val: int) -> str:\n+        return self.ConsumeUnicodeNoSurrogates(self.ConsumeIntInRange(0, val))\n"
  },
  {
    "path": "projects/python-multipart/project.yaml",
    "content": "homepage: \"https://github.com/Kludex/python-multipart\"\nlanguage: python\nprimary_contact: \"marcelotryle@gmail.com\"\nmain_repo: \"https://github.com/Kludex/python-multipart\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nvendor_ccs:\n - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/python-nameparser/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/derek73/python-nameparser python-nameparser\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-nameparser\n"
  },
  {
    "path": "projects/python-nameparser/build.sh",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-nameparser/fuzz_fullname.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.2\n# Imports by the generated code\nimport nameparser\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  fuzz_human_name = fdp.ConsumeUnicodeNoSurrogates(\n      fdp.ConsumeIntInRange(0, 4096))\n\n  # Heuristic name: py-autofuzz-heuristics-4.2.1\n  try:\n    hn = nameparser.parser.HumanName(fuzz_human_name)\n    hn.full_name()\n  except (TypeError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-nameparser/project.yaml",
    "content": "main_repo: https://github.com/derek73/python-nameparser\nhomepage: https://github.com/derek73/python-nameparser\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-nvd3/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/areski/python-nvd3 python-nvd3\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-nvd3\n"
  },
  {
    "path": "projects/python-nvd3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --collect-data nvd3\ndone\n"
  },
  {
    "path": "projects/python-nvd3/fuzz_linechart.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport nvd3\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  # Chart with two series\n  chart = nvd3.lineChart(name=fdp.ConsumeUnicodeNoSurrogates(24),\n                         x_is_date=fdp.ConsumeBool(),\n                         x_axis_format=fdp.ConsumeUnicodeNoSurrogates(12))\n  xdata = list(range(0, 256))\n  ydata = fdp.ConsumeIntList(256, 4)\n  ydata2 = fdp.ConsumeIntList(256, 4)\n\n  # Create random args for each serie\n  kwargs1 = dict()\n  for i in range(fdp.ConsumeIntInRange(5, 10)):\n    kwargs1[fdp.ConsumeUnicodeNoSurrogates(\n        24)] = fdp.ConsumeUnicodeNoSurrogates(24)\n\n  kwargs2 = dict()\n  for i in range(fdp.ConsumeIntInRange(5, 10)):\n    kwargs2[fdp.ConsumeUnicodeNoSurrogates(\n        24)] = fdp.ConsumeUnicodeNoSurrogates(24)\n\n  # Add thw two series\n  extra_serie = {\n      fdp.ConsumeUnicodeNoSurrogates(24): {\n          fdp.ConsumeUnicodeNoSurrogates(24):\n              fdp.ConsumeUnicodeNoSurrogates(24),\n          fdp.ConsumeUnicodeNoSurrogates(24):\n              fdp.ConsumeUnicodeNoSurrogates(24)\n      }\n  }\n  chart.add_serie(y=ydata,\n                  x=xdata,\n                  name=fdp.ConsumeUnicodeNoSurrogates(24),\n                  extra=extra_serie,\n                  **kwargs1)\n  extra_serie = {\n      fdp.ConsumeUnicodeNoSurrogates(24): {\n          fdp.ConsumeUnicodeNoSurrogates(24):\n              fdp.ConsumeUnicodeNoSurrogates(24),\n          fdp.ConsumeUnicodeNoSurrogates(24):\n              fdp.ConsumeUnicodeNoSurrogates(24)\n      }\n  }\n  chart.add_serie(y=ydata2,\n                  x=xdata,\n                  name=fdp.ConsumeUnicodeNoSurrogates(24),\n                  extra=extra_serie,\n                  **kwargs2)\n\n  # Construct the HTML\n  chart.buildhtml()\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-nvd3/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/areski/python-nvd3\nmain_repo: https://github.com/areski/python-nvd3\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-pathspec/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/cpburnz/python-pathspec python-pathspec\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-pathspec\n"
  },
  {
    "path": "projects/python-pathspec/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-pathspec/fuzz_pathspec.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport pathspec \n\n\ndef test_raw(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  lines = []\n\n  for idx in range(fdp.ConsumeIntInRange(2, 10)):\n    lines.append(fdp.ConsumeUnicodeNoSurrogates(512))\n  try:\n    spec = pathspec.PathSpec.from_lines(lines)\n  except TypeError:\n    return\n  spec.match_files([fdp.ConsumeUnicodeNoSurrogates(512)])\n\n\ndef test_git(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  lines = []\n  for idx in range(fdp.ConsumeIntInRange(2, 10)):\n    lines.append(fdp.ConsumeUnicodeNoSurrogates(512))\n\n  try:\n    spec = pathspec.PathSpec.from_lines('gitwildmatch',lines)\n  except pathspec.patterns.gitwildmatch.GitWildMatchPatternError:\n    return\n  except TypeError:\n    return\n  spec.match_files([fdp.ConsumeUnicodeNoSurrogates(512)])\n\n\ndef TestOneInput(data):\n  test_raw(data)\n  test_git(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-pathspec/project.yaml",
    "content": "homepage: https://github.com/cpburnz/python-pathspec\nmain_repo: https://github.com/cpburnz/python-pathspec\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-phonenumbers/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/daviddrysdale/python-phonenumbers.git python-phonenumbers\nRUN git clone --depth 1 https://github.com/rikfie/python-phonenumbers-fuzzer.git ppf && \\\n    mv ppf/*_fuzzer.py $SRC/ && \\\n    rm -rf ppf\n\nWORKDIR python-phonenumbers/python\n\nCOPY build.sh $SRC/"
  },
  {
    "path": "projects/python-phonenumbers/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install --upgrade pip\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-phonenumbers/project.yaml",
    "content": "homepage: \"https://github.com/daviddrysdale/python-phonenumbers\"\nlanguage: python\nprimary_contact: \"rik@purpleguy.nl\"\nauto_ccs:\n    - \"drysdale@google.com\"\nmain_repo: \"https://github.com/daviddrysdale/python-phonenumbers.git\"\nfuzzing_engines:\n    - libfuzzer\nsanitizers:\n    - address\n    - undefined\n"
  },
  {
    "path": "projects/python-prompt-toolkit/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/prompt-toolkit/python-prompt-toolkit python-prompt-toolkit\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-prompt-toolkit\n"
  },
  {
    "path": "projects/python-prompt-toolkit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-prompt-toolkit/fuzz_contrib.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport traceback\nfrom prompt_toolkit.contrib.regular_languages import compile as fuzz_target\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    fuzz_target(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except AssertionError:\n    pass\n  except Exception as e:\n    tb = ''.join(traceback.TracebackException.from_exception(e).format())\n    if \"parse_regex\" in tb:\n      # The parse_regex function throws a set of exceptions of Exception type,\n      # we do not care about these.\n      pass\n    else:\n      raise e\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-prompt-toolkit/fuzz_formatted_text.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport xml\nimport prompt_toolkit\n\n\ndef fuzz_html(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    html = prompt_toolkit.formatted_text.HTML(\n        fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except xml.parsers.expat.ExpatError:\n    return\n  prompt_toolkit.formatted_text.to_formatted_text(html)\n\n\ndef fuzz_ansi(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  ansi = prompt_toolkit.formatted_text.ANSI(\n      fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  prompt_toolkit.formatted_text.to_formatted_text(ansi)\n\n\ndef TestOneInput(data):\n  fuzz_html(data)\n  fuzz_ansi(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-prompt-toolkit/project.yaml",
    "content": "homepage: https://github.com/prompt-toolkit/python-prompt-toolkit\nmain_repo: https://github.com/prompt-toolkit/python-prompt-toolkit\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-pypdf/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install pycryptodome\nRUN git clone https://github.com/py-pdf/pypdf.git pypdf\nWORKDIR $SRC/\nCOPY *.sh *.py $SRC/\n\n"
  },
  {
    "path": "projects/python-pypdf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd pypdf\npip3 install --upgrade pip\npip3 install .\n\n# Build fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-pypdf/fuzz_encryption.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nfrom io import BytesIO\n\nwith atheris.instrument_imports():\n    from pypdf import PdfWriter, PdfReader\n\n\n@atheris.instrument_func\ndef TestInputOne(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    try:\n        dummy = BytesIO()\n        writer = PdfWriter()\n\n        # Construct PDF\n        writer.add_metadata({\n            f\"/X{fdp.ConsumeUnicodeNoSurrogates(100)}\": fdp.ConsumeUnicodeNoSurrogates(100)\n        })\n        rect = (10, 20, 30, 40)\n        # Encrypt\n        key = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n        writer.encrypt(key, algorithm=\"AES-256\")\n        writer.write(dummy)\n\n        # Read Dummy PDF\n        reader = PdfReader(dummy)\n\n        if not reader.is_encrypted:\n            raise Exception(\"Encryption error. Failed to encrypt stream\")\n\n        # Decrypt\n        reader.decrypt(key)\n\n        if reader.stream == dummy:\n            raise Exception(\"Decryption error. Original stream != Decrypted stream\")\n\n    except Exception:\n        return\n\n\nif __name__ == '__main__':\n    atheris.Setup(sys.argv, TestInputOne)\n    atheris.Fuzz()\n"
  },
  {
    "path": "projects/python-pypdf/project.yaml",
    "content": "homepage: https://github.com/py-pdf/pypdf\nmain_repo: https://github.com/py-pdf/pypdf.git\nlanguage: python\nprimary_contact: info@martin-thoma.de\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/python-rison/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/betodealmeida/python-rison python-rison\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python-rison\n"
  },
  {
    "path": "projects/python-rison/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-rison/fuzz_decode.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport json\nimport atheris\n\nimport prison\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  val_to_use = fdp.ConsumeUnicodeNoSurrogates(32768)\n\n  # Ensure it's valid json.\n  try:\n    json.loads(val_to_use)\n  except:\n    return\n\n  try:\n    loaded = prison.loads(val_to_use)\n  except prison.decoder.ParserException:\n    pass\n\n  return\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-rison/fuzz_roundtrip.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport json\nimport atheris\n\nimport prison\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  val_to_use = fdp.ConsumeUnicodeNoSurrogates(32768)\n\n  # Ensure it's valid json.\n  try:\n    json_val = json.loads(val_to_use)\n  except:\n    return\n\n  try:\n    loaded = prison.loads(prison.dumps(json_val))\n  except prison.decoder.ParserException:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-rison/project.yaml",
    "content": "homepage: https://github.com/betodealmeida/python-rison\nmain_repo: https://github.com/betodealmeida/python-rison\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-rsa/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/sybrenstuvel/python-rsa\nWORKDIR $SRC\nCOPY build.sh fuzz_* $SRC/\n"
  },
  {
    "path": "projects/python-rsa/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd python-rsa\npip3 install .\n\n# Build fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-rsa/fuzz_roundtrip.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n  import rsa\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  key = fdp.ConsumeIntInRange(16, 9999)\n  message = fdp.ConsumeBytes(atheris.ALL_REMAINING)\n\n  try:\n    pub, priv = rsa.newkeys(key)\n  except ValueError:\n    return\n\n  try:\n    encrypted = rsa.encrypt(message, pub)\n  except OverflowError:\n    return\n\n  decrypted = rsa.decrypt(encrypted, priv)\n  assert(decrypted == message)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python-rsa/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://stuvel.eu/software/rsa/\nlanguage: python\nmain_repo: https://github.com/sybrenstuvel/python-rsa\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/python-tabulate/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/astanin/python-tabulate\nWORKDIR python-tabulate\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/python-tabulate/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python-tabulate/fuzz_tabulate.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nimport sys\nimport json\nimport atheris\nimport tabulate\n\n\ndef ConsumeListofLists(fdp):\n    list = []\n    num_lists = fdp.ConsumeIntInRange(1, 100)\n    for _ in range(num_lists):\n        list.append(fdp.ConsumeFloatListInRange(num_lists, 1, 1000))\n    return list\n\n\ndef ConsumeDictionary(fdp):\n    dictionary = {}\n    dict_size = fdp.ConsumeIntInRange(1, 100)\n    for _ in range(dict_size):\n        dictionary[fdp.ConsumeUnicodeNoSurrogates(\n            fdp.ConsumeIntInRange(0, 100))] = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 100))\n    return dictionary\n\n\ndef ConsumeNestedDictionary(fdp):\n    dictionary = {}\n    dict_size = fdp.ConsumeIntInRange(1, 100)\n    for _ in range(dict_size):\n        t_or_f = fdp.ConsumeBool()\n        if t_or_f is True:\n            dictionary[fdp.ConsumeUnicodeNoSurrogates(\n                fdp.ConsumeIntInRange(0, 100))] = ConsumeDictionary(fdp)\n        else:\n            dictionary[fdp.ConsumeUnicodeNoSurrogates(\n                fdp.ConsumeIntInRange(0, 100))] = fdp.ConsumeUnicodeNoSurrogates(\n                fdp.ConsumeIntInRange(0, 100))\n    return dictionary\n\n\ndef ConsumeDictionaryWithList(fdp):\n    dictionary = {}\n    dict_size = fdp.ConsumeIntInRange(1, 100)\n    for _ in range(dict_size):\n        dictionary[fdp.ConsumeUnicodeNoSurrogates(\n            fdp.ConsumeIntInRange(1, 100))] = fdp.ConsumeIntListInRange(\n            fdp.ConsumeIntInRange(1, 100), 1, 100)\n    return dictionary\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    table_format = fdp.PickValueInList(tabulate.tabulate_formats)\n    col_align_num = fdp.PickValueInList(\n        [\"right\", \"center\", \"left\", \"decimal\", None])\n    col_align_str = fdp.PickValueInList(\n        [\"right\", \"center\", \"left\", None])\n\n    # Create random dictionary\n    try:\n        fuzzed_dict = json.loads(\n            fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 100)))\n    except:\n        return\n    if type(fuzzed_dict) is not dict:\n        return\n\n    # Test tabulate with various inputs\n    t1 = tabulate.tabulate(\n        fuzzed_dict,\n        tablefmt=table_format\n    )\n    t2 = tabulate.tabulate(\n        ConsumeDictionary(fdp),\n        tablefmt=table_format,\n        headers=\"keys\"\n    )\n    t3 = tabulate.tabulate(\n        ConsumeListofLists(fdp),\n        tablefmt=table_format,\n        headers=\"firstrow\"\n    )\n    t4 = tabulate.tabulate(\n        ConsumeNestedDictionary(fdp),\n        tablefmt=table_format\n    )\n    t5 = tabulate.tabulate(\n        ConsumeDictionaryWithList(fdp),\n        tablefmt=table_format\n    )\n    almost_all_args = tabulate.tabulate(\n        ConsumeListofLists(fdp),\n        tablefmt=table_format,\n        headers=\"firstrow\",\n        showindex=\"always\",\n        numalign=col_align_num,\n        stralign=col_align_str,\n        floatfmt=\".4f\"\n    )\n\n    # make and implement custom table formator\n    custom_separator = tabulate.simple_separated_format(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 100)))\n    tabulate.tabulate(ConsumeDictionary(fdp), tablefmt=custom_separator)\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/python-tabulate/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/astanin/python-tabulate\nlanguage: python\nmain_repo: https://github.com/astanin/python-tabulate\nsanitizers:\n- address\n- undefined\nprimary_contact: \"s.astanin@gmail.com\"\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/python3-libraries/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y build-essential libncursesw5-dev libreadline-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev libbz2-dev zlib1g-dev libffi-dev liblzma-dev libzstd-dev\nRUN git clone --depth 1 --branch main https://github.com/python/cpython.git cpython\nRUN git clone --depth 1 --branch main https://github.com/python/library-fuzzers.git\nCOPY run_tests.sh build.sh $SRC/\n\n"
  },
  {
    "path": "projects/python3-libraries/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ignore memory leaks from python scripts invoked in the build\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nexport MSAN_OPTIONS=\"halt_on_error=0:exitcode=0:report_umrs=0\"\n\n# Remove -pthread from CFLAGS, this trips up ./configure\n# which thinks pthreads are available without any CLI flags\nCFLAGS=${CFLAGS//\"-pthread\"/}\n\nFLAGS=()\ncase $SANITIZER in\n  address)\n    FLAGS+=(\"--with-address-sanitizer\")\n    ;;\n  memory)\n    FLAGS+=(\"--with-memory-sanitizer\")\n    # -msan-keep-going is needed to allow MSAN's halt_on_error to function\n    FLAGS+=(\"CFLAGS=-mllvm -msan-keep-going=1\")\n    ;;\n  undefined)\n    FLAGS+=(\"--with-undefined-behavior-sanitizer\")\n    ;;\nesac\n\nexport CPYTHON_INSTALL_PATH=$SRC/cpython-install\nrm -rf $CPYTHON_INSTALL_PATH\nmkdir $CPYTHON_INSTALL_PATH\n\ncd $SRC/cpython\ncp $SRC/library-fuzzers/python_coverage.h Python/\n\n# Patch the interpreter to record code coverage\nsed -i '1 s/^.*$/#include \"python_coverage.h\"/g' Python/ceval.c\nsed -i 's/case TARGET\\(.*\\): {/\\0\\nfuzzer_record_code_coverage(f->f_code, f->f_lasti);/g' Python/ceval.c\n\n./configure \"${FLAGS[@]:-}\" --prefix=$CPYTHON_INSTALL_PATH\nmake -j$(nproc)\nmake install\n\ncp -R $CPYTHON_INSTALL_PATH $OUT/\n$OUT/cpython-install/bin/python3 -m pip install hypothesis\n\ncd $SRC/library-fuzzers\nmake\n\ncp $SRC/library-fuzzers/fuzzer-html $OUT/\ncp $SRC/library-fuzzers/html.py $OUT/\nzip -j $OUT/fuzzer-html_seed_corpus.zip corp-html/*\n\ncp $SRC/library-fuzzers/fuzzer-xml $OUT/\ncp $SRC/library-fuzzers/xml.py $OUT/\nzip -j $OUT/fuzzer-xml_seed_corpus.zip corp-xml/*\n\ncp $SRC/library-fuzzers/fuzzer-email $OUT/\ncp $SRC/library-fuzzers/email.py $OUT/\nzip -j $OUT/fuzzer-email_seed_corpus.zip corp-email/*\n\ncp $SRC/library-fuzzers/fuzzer-httpclient $OUT/\ncp $SRC/library-fuzzers/httpclient.py $OUT/\nzip -j $OUT/fuzzer-httpclient_seed_corpus.zip corp-httpclient/*\n\ncp $SRC/library-fuzzers/fuzzer-json $OUT/\ncp $SRC/library-fuzzers/json.py $OUT/\nzip -j $OUT/fuzzer-json_seed_corpus.zip corp-json/*\n\ncp $SRC/library-fuzzers/fuzzer-difflib $OUT/\ncp $SRC/library-fuzzers/difflib.py $OUT/\nzip -j $OUT/fuzzer-difflib_seed_corpus.zip corp-difflib/*\n\ncp $SRC/library-fuzzers/fuzzer-csv $OUT/\ncp $SRC/library-fuzzers/csv.py $OUT/\nzip -j $OUT/fuzzer-csv_seed_corpus.zip corp-csv/*\n\ncp $SRC/library-fuzzers/fuzzer-decode $OUT/\ncp $SRC/library-fuzzers/decode.py $OUT/\nzip -j $OUT/fuzzer-decode_seed_corpus.zip corp-decode/*\ncp $SRC/library-fuzzers/fuzzer-decode.dict $OUT/\n\ncp $SRC/library-fuzzers/fuzzer-ast $OUT/\ncp $SRC/library-fuzzers/ast.py $OUT/\ncp $SRC/cpython/Modules/_xxtestfuzz/dictionaries/fuzz_pycompile.dict $OUT/fuzzer-ast.dict\n# Use CPython source code as seed corpus\nmkdir corp-ast/\nfind $SRC/cpython -type f -name '*.py' -size -4097c -exec cp {} corp-ast/ \\;\nzip -j $OUT/fuzzer-ast_seed_corpus.zip corp-ast/*\n\ncp $SRC/library-fuzzers/fuzzer-re $OUT/\ncp $SRC/library-fuzzers/re.py $OUT/\n\ncp $SRC/library-fuzzers/fuzzer-zipfile $OUT/\ncp $SRC/library-fuzzers/zipfile.py $OUT/\nzip -j $OUT/fuzzer-zipfile_seed_corpus.zip corp-zipfile/*\n\ncp $SRC/library-fuzzers/fuzzer-zipfile-hypothesis $OUT/\ncp $SRC/library-fuzzers/zipfile_hypothesis.py $OUT/\n\ncp $SRC/library-fuzzers/fuzzer-tarfile $OUT/\ncp $SRC/library-fuzzers/tarfile.py $OUT/\nzip -j $OUT/fuzzer-tarfile_seed_corpus.zip corp-tarfile/*\n\ncp $SRC/library-fuzzers/fuzzer-tarfile-hypothesis $OUT/\ncp $SRC/library-fuzzers/tarfile_hypothesis.py $OUT/\n\ncp $SRC/library-fuzzers/fuzzer-configparser $OUT/\ncp $SRC/library-fuzzers/configparser.py $OUT/\nzip -j $OUT/fuzzer-configparser_seed_corpus.zip corp-configparser/*\n\ncp $SRC/library-fuzzers/fuzzer-tomllib $OUT/\ncp $SRC/library-fuzzers/tomllib.py $OUT/\nzip -j $OUT/fuzzer-tomllib_seed_corpus.zip corp-tomllib/*\n\ncp $SRC/library-fuzzers/fuzzer-plistlib $OUT/\ncp $SRC/library-fuzzers/plist.py $OUT/\n\ncp $SRC/library-fuzzers/fuzzer-zoneinfo $OUT/\ncp $SRC/library-fuzzers/zoneinfo.py $OUT/\nzip -j $OUT/fuzzer-zoneinfo_seed_corpus.zip corp-zoneinfo/*\n\n"
  },
  {
    "path": "projects/python3-libraries/project.yaml",
    "content": "homepage: \"https://www.python.org/\"\nmain_repo: \"https://github.com/python/cpython\"\nlanguage: c\nprimary_contact: \"seth@python.org\"\nauto_ccs:\n - \"greg@krypto.org\"\n - \"alex.gaynor@gmail.com\"\n - \"ammar@ammaraskar.com\"\n - \"pablogsal@python.org\"\n - \"stanulbrych@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n - address\n - memory:\n    experimental: True\n - undefined:\n    experimental: True\n"
  },
  {
    "path": "projects/python3-libraries/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Skip network related unit test case\nmake test TESTOPTS=\"-u all,-network,-urlfetch\"\n"
  },
  {
    "path": "projects/python3-openid/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/necaris/python3-openid python3-openid\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/python3-openid\n"
  },
  {
    "path": "projects/python3-openid/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/python3-openid/fuzz_html_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom openid.yadis.parsehtml import YadisHTMLParser, ParseDone\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  p = YadisHTMLParser()\n  try:\n    p.feed(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except (ParseDone, NotImplementedError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/python3-openid/project.yaml",
    "content": "homepage: https://github.com/necaris/python3-openid\nmain_repo: https://github.com/necaris/python3-openid\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pytz/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y python3-distutils libpq-dev python3-wheel\nRUN git clone https://github.com/stub42/pytz\nRUN pip3 install wheel\nCOPY build.sh *.py $SRC/\nWORKDIR pytz\n"
  },
  {
    "path": "projects/pytz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ensure usage of OSS-Fuzz python\nsed -i \"s/\\/usr\\/bin\\/python/\\/usr\\/local\\/bin\\/python/g\" Makefile\n\n#pip3 install wheel\nmake\ncd build/dist\npython3 setup.py install\n\n# Build flask fuzzers\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pytz/fuzz_pytz.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  import pytz\n  from datetime import datetime\n  from pytz.exceptions import Error\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    d1 = datetime(\n      fdp.ConsumeInt(4),\n      fdp.ConsumeInt(4),\n      fdp.ConsumeInt(4),\n      fdp.ConsumeInt(4),\n      fdp.ConsumeInt(4),\n      fdp.ConsumeInt(4)\n    )\n  except: # Catch everything\n    return\n\n  s1 = fdp.ConsumeString(sys.maxsize)\n  try:\n    east2 = pytz.timezone(s1)\n    east2.localize(d1)\n  except Error as e:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pytz/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/stub42/pytz\nlanguage: python\nmain_repo: https://github.com/stub42/pytz\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- athur.chan@adalogics.com\n"
  },
  {
    "path": "projects/pyvex/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && \\\n        apt-get install -y python3-dev && \\\n        python3 -m pip install --break-system-packages cython \"atheris>=2.1.1\" \"pyinstaller>=5.0.1\" \"coverage>=6.3.2\" && \\\n        rm -rf /var/lib/apt/lists/*\nRUN git clone --recursive https://github.com/angr/archinfo.git archinfo\nRUN git clone --recursive https://github.com/angr/pyvex.git pyvex\nRUN cp pyvex/fuzzing/build.sh $SRC/\nWORKDIR $SRC/pyvex\n"
  },
  {
    "path": "projects/pyvex/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://api.angr.io/projects/pyvex/en/latest/api.html\"\nlanguage: python\nprimary_contact: \"angr-dev@asu.edu\"\nauto_ccs:\n  - \"fishw@asu.edu\"\n  - \"capuanobailey@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/angr/pyvex.git'\n"
  },
  {
    "path": "projects/pyxdg/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get install -y libxml2-dev libxslt-dev zlib1g-dev\nRUN python3 -m pip install --upgrade pip && python3 -m pip install Cython\nRUN git clone --depth 1 https://github.com/lxml/lxml\nRUN git clone https://github.com/takluyver/pyxdg\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fuzz_* *.dict $SRC/\nCOPY seeds $SRC/seeds\n"
  },
  {
    "path": "projects/pyxdg/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/*.dict $OUT/\n\ncd $SRC/lxml/\npython3 ./setup.py install\n\ncd $SRC/pyxdg\npip3 install .\n\n# Build fuzzers in $OUT.\n# Remove fuzzers in lxml\nfind $SRC/lxml -name fuzz*.py -exec rm {} \\;\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\ncorpus_name=\"fuzz_menu_seed_corpus.zip\"\nzip -r $OUT/$corpus_name $SRC/seeds/*\n"
  },
  {
    "path": "projects/pyxdg/fuzz_desktop_entry.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nwith atheris.instrument_imports(enable_loader_override=False):\n  from xdg.DesktopEntry import DesktopEntry\n  from xdg.Exceptions import ParsingError\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  # We need to make the file an absolute path\n  testfile_path = os.path.join(os.getcwd(), \"testfile.desktop\")\n  with open(testfile_path, \"wb\") as f:\n    f.write(input_bytes)\n\n  # Test DesktopEntry implementation\n  de = DesktopEntry()\n  try:\n    de.parse(testfile_path)\n  except ParsingError as e:\n    os.remove(testfile_path)\n    return\n  de.checkKey(fdp.ConsumeString(20), \"value\", \"core\")\n  os.remove(testfile_path)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyxdg/fuzz_icon.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport shutil\nimport atheris\n\nwith atheris.instrument_imports(enable_loader_override=False):\n  from xdg.IconTheme import IconTheme, getIconPath, getIconData \n  from xdg.Exceptions import ParsingError\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  # We need to make the file an absolute path\n  testfile_path = os.path.join(os.getcwd(), \"testfile.theme\")\n  with open(testfile_path, \"wb\") as f:\n    f.write(input_bytes)\n\n  th = IconTheme()\n  try:\n    th.parse(testfile_path)\n    th.validate()\n    dst_file = os.path.join(os.getcwd(), \"testicon.icon\")\n    shutil.move(testfile_path, dst_file)\n    getIconData(dst_file)\n  except ParsingError:\n    pass\n  os.remove(testfile_path)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyxdg/fuzz_menu.dict",
    "content": "\"AppDir\"\n\"Menu\"\n\"DefaultAppDirs\"\n\"DirectoryDir\"\n\"DefaultDirectoryDirs\"\n\"Name\"\n\"Directory\"\n\"OnlyUnallocated\"\n\"NotOnlyUnallocated\"\n\"Deleted\"\n\"NotDeleted\"\n\"Include\"\n\"Exclude\"\n\"MergeFile\"\n\"MergeDir\"\n\"DefaultMergeDirs\"\n\"Move\"\n\"Layout\"\n\"DefaultLayout\"\n\"LegacyDir\"\n\"KDELegacyDirs\"\n"
  },
  {
    "path": "projects/pyxdg/fuzz_menu.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nwith atheris.instrument_imports(enable_loader_override=False):\n  from lxml import etree as et\n  import xml.etree.ElementTree as etree\n\n  #import etree\n  import xdg.Menu\n  from xdg.Exceptions import ParsingError\n\n@atheris.instrument_func\ndef verify_xml(data):\n  try:\n    root = et.XML(data)\n    if root != None:\n      et.indent(root)\n      et.ElementTree(root)\n      return True\n  except et.XMLSyntaxError:\n    return False\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  # This is a slight hack to verify xml with code\n  # that gets instrumented. For some reason I was\n  # unable to instrument xml itself.\n  if not verify_xml(input_bytes):\n    return\n\n  # We need to make the file an absolute path\n  testfile_path = os.path.join(os.getcwd(), \"test.menu\")\n  with open(testfile_path, \"wb\") as f:\n    f.write(input_bytes)\n\n  try:\n    xdg.Menu.parse(filename = testfile_path)\n  except ParsingError:\n    None\n  except RecursionError: # Just catch it because it's not that interesting.\n    None\n  os.remove(testfile_path)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyxdg/fuzz_mime.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nwith atheris.instrument_imports(enable_loader_override=False):\n  from xdg import Mime\n  from xdg.Exceptions import ParsingError\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  # We need to make the file an absolute path\n  testfile_path = os.path.join(os.getcwd(), \"testfile.tmp\")\n  with open(testfile_path, \"wb\") as f:\n    f.write(input_bytes)\n\n  # Test basic Mime API\n  Mime.get_type2(testfile_path)\n  Mime.get_type_by_contents(testfile_path)\n  Mime.get_type_by_data(input_bytes)\n\n  # Test GlobDB\n  globs = Mime.GlobDB()\n  try:\n    globs.merge_file(testfile_path)\n    globs.merge_file(testfile_path)\n  except UnicodeError as e:\n    pass\n  except ValueError as e:\n    if (\n        \"not enough values to unpack\" in str(e) or\n        \"invalid literal for int\" in str(e)\n    ):\n      pass\n    else:\n      raise e\n\n  # Test MagicDB\n  magic = Mime.MagicDB()\n  try:\n    magic.merge_file(testfile_path)\n    magic.finalise()\n  except UnicodeDecodeError:\n    pass\n  except (OSError, ValueError) as e:\n    msg = str(e)\n    if (\n      \"Not a MIME magic file\" in msg or\n      \"Malformed section heading\" in msg\n    ):\n      pass\n    else:\n      raise e\n\n  # Cleanup\n  os.remove(testfile_path)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyxdg/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://freedesktop.org/wiki/Software/pyxdg/\nlanguage: python\nmain_repo: https://github.com/takluyver/pyxdg\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/pyxdg/seeds/menu.xdg",
    "content": "<!DOCTYPE Menu PUBLIC \"-//freedesktop//DTD Menu 1.0//EN\" \"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd\">\n<Menu>\n  <Name>Apps</Name>\n  <Directory>Apps.dir</Directory>\n  <DefaultDirectoryDirs/>\n  <MergeDir>apps-merged</MergeDir>\n  <DefaultAppDirs/>\n</Menu>\n"
  },
  {
    "path": "projects/pyyaml/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/yaml/pyyaml\nRUN python3 -m pip install --upgrade pip\nWORKDIR $SRC\nCOPY build.sh $SRC/\nCOPY fuzz_* $SRC/\n"
  },
  {
    "path": "projects/pyyaml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd pyyaml\necho 'Cython < 3.0' > /tmp/constraint.txt\nPIP_CONSTRAINT=/tmp/constraint.txt pip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/pyyaml/fuzz_emitter.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets primarily code in lib/yaml/emitter.py. \"\"\"\nimport sys\nimport atheris\n\nimport io\nimport yaml\n\ndef TestOneInput(data):\n  try:\n    events = list(yaml.parse(io.BytesIO(data)))\n  except yaml.YAMLError:\n    return\n  except RecursionError:\n    return\n  try:\n    output = yaml.emit(events)\n  except yaml.emitter.EmitterError:\n    return\n  except RecursionError:\n    return\n\n  # At this point the output should be good to parse cleanly.\n  yaml.parse(output)\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyyaml/fuzz_loader.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\n\nimport atheris\n\nwith atheris.instrument_imports():\n  import yaml\n\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  try:\n    context = yaml.load(input_bytes, Loader=yaml.FullLoader)\n  except yaml.YAMLError:\n    return\n  except RecursionError:\n    return\n  # Anything that is loadable should be emitable.\n  try:\n    listed_context = list(context)\n  except:\n    return\n\n  try:\n    yaml.emit(listed_context)\n  except yaml.emitter.EmitterError:\n    return\n  except RecursionError:\n    return\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyyaml/fuzz_reader.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nwith atheris.instrument_imports():\n  import yaml\n\n@atheris.instrument_func\ndef TestOneInput(data):\n    if len(data) < 1:\n        return \n    try:\n        stream = yaml.reader.Reader(data)\n        while stream.peek() != u'\\0':\n            stream.forward()\n    except yaml.reader.ReaderError:\n        None\n    except RecursionError:\n        pass\n\n    return \n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/pyyaml/project.yaml",
    "content": "homepage: \"https://github.com/yaml/pyyaml\"\nlanguage: python\nprimary_contact: \"pyyaml@yaml.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"p.antoine@catenacyber.fr\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/yaml/pyyaml\"\n"
  },
  {
    "path": "projects/pyzmq/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y libzmq3-dev\nRUN python -m pip install cython\nRUN git clone --depth 1 --branch main https://github.com/zeromq/pyzmq pyzmq\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/pyzmq\n"
  },
  {
    "path": "projects/pyzmq/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython -m pip install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n    compile_python_fuzzer $fuzzer --collect-all=\"pyzmq\"\ndone\n"
  },
  {
    "path": "projects/pyzmq/fuzz_frame.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport zmq\nimport zmq.backend.cython\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  m = zmq.Frame(fdp.ConsumeBytes(1096),\n                track=fdp.ConsumeBool(),\n                copy=fdp.ConsumeBool())\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/pyzmq/project.yaml",
    "content": "homepage: https://github.com/zeromq/pyzmq\nmain_repo: https://github.com/zeromq/pyzmq\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/qcms/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y mercurial\nRUN hg clone --uncompressed https://hg.mozilla.org/mozilla-central/\nCOPY build.sh $SRC/\nWORKDIR mozilla-central/gfx/qcms\n"
  },
  {
    "path": "projects/qcms/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build -O\n\nfind fuzz -iname \"*.icc\" \\\n  -type f -exec zip -qju $OUT/fuzz_seed_corpus.zip \"{}\" \\;\ncp fuzz/qcms_fuzzer.dict $OUT/fuzz.dict\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_qcms $OUT/fuzz\n"
  },
  {
    "path": "projects/qcms/project.yaml",
    "content": "homepage: \"https://hg.mozilla.org/mozilla-central/file/tip/gfx/qcms/\"\nlanguage: rust\nprimary_contact: \"twsmith@mozilla.com\"\nauto_ccs:\n  - \"aosmond@mozilla.com\"\n  - \"jmuizelaar@mozilla.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/qdox/.gitignore",
    "content": "project-parent/qdox\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/qdox/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.6/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/qdox\nRUN apt update && apt install -y openjdk-11-jdk\nRUN git clone --depth 1 https://github.com/paul-hammant/qdox/ $SRC/project-parent/qdox\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/\n"
  },
  {
    "path": "projects/qdox/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=qdox\nPROJECT_GROUP_ID=com.thoughtworks.qdox\nPROJECT_ARTIFACT_ID=qdox\nMAIN_REPOSITORY=https://github.com/paul-hammant/qdox/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests -Dinvoker.skip=true\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-11\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-11/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi\n"
  },
  {
    "path": "projects/qdox/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.thoughtworks.qdox</groupId>\n            <artifactId>qdox</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/qdox/project-parent/fuzz-targets/src/test/java/com/example/JavaProjectBuilderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.thoughtworks.qdox.JavaProjectBuilder;\nimport com.thoughtworks.qdox.model.JavaSource;\nimport com.thoughtworks.qdox.parser.ParseException;\n\nimport java.io.StringReader;\nimport java.util.EmptyStackException;\n\nclass JavaProjectBuilderFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        try {\n            JavaProjectBuilder builder = new JavaProjectBuilder();\n            JavaSource src = builder.addSource(new StringReader(data.consumeRemainingAsString()));\n\n            src.getPackage();\n            src.getImports();\n            src.getClasses();\n        } catch (ParseException | ArrayIndexOutOfBoundsException | NullPointerException | EmptyStackException | Error e) {\n            // Need to catch in order to find more interesting bugs.\n        }\n    }\n}"
  },
  {
    "path": "projects/qdox/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>qdox</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/qdox/project.yaml",
    "content": "homepage: \"https://github.com/paul-hammant/qdox/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/paul-hammant/qdox/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/qemu/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nARG glib_tag=2.78.4\nRUN apt-get update && apt-get install -y make autoconf automake libtool ninja-build  \\\n    libfdt-dev libpixman-1-dev zlib1g-dev libslirp-dev patchelf wget \\\n    libattr1 libattr1-dev libcap-ng-dev pkg-config\n\nRun python3 -m pip install distlib meson tomli\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/glib.git --branch=$glib_tag && \\\n  meson setup _build glib --prefix=/usr -Ddefault_library=shared -Dtests=false && \\\n  meson install -C _build && \\\n  rm -rf glib _build\n\nRUN git clone --depth 1 https://git.qemu.org/git/qemu.git qemu\nWORKDIR qemu\nCOPY run_tests.sh build.sh replay_build.sh $SRC/\n"
  },
  {
    "path": "projects/qemu/build.sh",
    "content": "#!/bin/sh -e\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/qemu/\n$SRC/qemu/scripts/oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/qemu/default.options",
    "content": "[libfuzzer]\nclose_fd_mask=3\ndetect_leaks=0\nmax_len=8192\n"
  },
  {
    "path": "projects/qemu/project.yaml",
    "content": "homepage: \"https://www.qemu.org/\"\nlanguage: c\nprimary_contact: \"alxndr@bu.edu\"\nauto_ccs:\n  - \"pbonzini@redhat.com\"\n  - \"stefanha@redhat.com\"\n  - \"darren.kenny@oracle.com\"\n  - \"lichenca2020@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\narchitectures:\n  - x86_64\nselective_unpack: true\nmain_repo: 'https://git.qemu.org/git/qemu.git'\n"
  },
  {
    "path": "projects/qemu/replay_build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nOSS_FUZZ_BUILD_DIR=\"./build-oss-fuzz/\"\ncd $OSS_FUZZ_BUILD_DIR\n\n# Prepare third party libraries directory\nDEST_DIR=$OUT\nmkdir -p \"$DEST_DIR/lib/\"\n\n# Build fuzzing harnesses and libs\nmake \"-j$(nproc)\" qemu-fuzz-i386 V=1\n\n# Install data files\nmake install DESTDIR=$DEST_DIR/qemu-bundle\nrm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/bin\nrm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/libexec\n\n\n# Copy over the librarise needed by the fuzzer.\n# These are the libraries copied from https://github.com/qemu/qemu/blob/88b1716a407459c8189473e4667653cb8e4c3df7/scripts/oss-fuzz/build.sh#L78\n# We do it this way, to avoid calling `configure`, which is called twice in the\n# build.sh.\n# Configure poses problems because it relies on network activity and also\n# performance is a lot better without configure.\ncp /lib/x86_64-linux-gnu/libstdc++.so.6 /out/lib/\ncp /lib/x86_64-linux-gnu/libpixman-1.so.0 /out/lib/\ncp /lib/x86_64-linux-gnu/libz.so.1 /out/lib/\ncp /lib/x86_64-linux-gnu/libfdt.so.1 /out/lib/\ncp /lib/x86_64-linux-gnu/libgio-2.0.so.0 /out/lib/\ncp /lib/x86_64-linux-gnu/libgobject-2.0.so.0 /out/lib/\ncp /lib/x86_64-linux-gnu/libglib-2.0.so.0 /out/lib/\ncp /lib/x86_64-linux-gnu/libslirp.so.0 /out/lib/\ncp /lib/x86_64-linux-gnu/libutil.so.1 /out/lib/\ncp /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 /out/lib/\ncp /lib/x86_64-linux-gnu/libm.so.6 /out/lib/\ncp /lib/x86_64-linux-gnu/libpthread.so.0 /out/lib/\ncp /lib/x86_64-linux-gnu/librt.so.1 /out/lib/\ncp /lib/x86_64-linux-gnu/libdl.so.2 /out/lib/\ncp /lib/x86_64-linux-gnu/libresolv.so.2 /out/lib/\ncp /lib/x86_64-linux-gnu/libgcc_s.so.1 /out/lib/\ncp /lib/x86_64-linux-gnu/libc.so.6 /out/lib/\ncp /lib/x86_64-linux-gnu/libffi.so.7 /out/lib/\n\nexport ASAN_OPTIONS=detect_leaks=0\ntargets=$(./qemu-fuzz-i386 | grep generic-fuzz | awk '$1 ~ /\\*/  {print $2}')\nbase_copy=\"$DEST_DIR/qemu-fuzz-i386-target-$(echo \"$targets\" | head -n 1)\"\n\ncp \"./qemu-fuzz-i386\" \"$base_copy\"\n\n# Generate the actual fuzzing harnesses\nfor target in $(echo \"$targets\" | tail -n +2);\ndo\n    # Skip generic harness.\n    if [[ $target == \"generic-fuzz-\"* ]]; then\n        ln  $base_copy \\\n            \"$DEST_DIR/qemu-fuzz-i386-target-$target\"\n    fi\ndone\n"
  },
  {
    "path": "projects/qemu/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd $SRC/qemu/build-oss-fuzz\n# TODO: These tests are a subset of `make check` because there are larger\n# comparability issues with running them all.\nmake -j\"$(nproc)\" check-unit\n"
  },
  {
    "path": "projects/qpdf/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool cmake nasm\nRUN git clone --depth 1 https://github.com/qpdf/qpdf.git qpdf\nRUN git clone --depth 1 https://github.com/madler/zlib.git zlib\nRUN git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo libjpeg-turbo\nWORKDIR qpdf\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/qpdf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# libz\npushd $SRC/zlib\n./configure --static --prefix=\"$WORK\"\nmake -j$(nproc) all\nmake install\npopd\n\n# libjpeg-turbo\npushd $SRC/libjpeg-turbo\ncmake . -DCMAKE_INSTALL_PREFIX=\"$WORK\" -DENABLE_STATIC=1 -DENABLE_SHARED=0 -DCMAKE_POSITION_INDEPENDENT_CODE=1\nmake -j$(nproc)\nmake install\npopd\n\n# qpdf\n./fuzz/oss-fuzz-build\n"
  },
  {
    "path": "projects/qpdf/project.yaml",
    "content": "homepage: \"http://qpdf.sourceforge.net/\"\nlanguage: c++\nprimary_contact: \"qberkenbilt@gmail.com\"\nauto_ccs :\n  - \"mholger119@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nmain_repo: 'https://github.com/qpdf/qpdf.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/qpid-proton/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y \\\n        cmake\n\n# Ensure we work from right python version\nRUN apt-get install -y python3.9 python3.9-dev && \\\n    ln --force -s /usr/bin/python3.9 /usr/local/bin/python3 && \\\n    apt-get install -y python3-pip\n\nRUN git clone https://github.com/apache/qpid-proton.git\n\nWORKDIR qpid-proton\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/qpid-proton/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nenv\n# workaround https://github.com/google/oss-fuzz/issues/9857\nln -s /usr/local/bin/llvm-ar /src/aflplusplus/afl-llvm-ar\nln -s /usr/local/bin/llvm-ranlib /src/aflplusplus/afl-llvm-ranlib\n\nmkdir build\npushd build\n  cmake .. \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    -DENABLE_LINKTIME_OPTIMIZATION=OFF \\\n    -DBUILD_STATIC_LIBS=ON \\\n    -DENABLE_FUZZ_TESTING=ON \\\n    -DFUZZ_REGRESSION_TESTS=OFF\n  pushd c/tests/fuzz/\n    VERBOSE=1 make -j $(nproc)\n  popd\n  cp c/tests/fuzz/{fuzz-connection-driver,fuzz-message-decode} $OUT/\npopd\n\nzip -j $OUT/fuzz-connection-driver_seed_corpus.zip c/tests/fuzz/fuzz-connection-driver/corpus/* c/tests/fuzz/fuzz-connection-driver/crash/*\nzip -j $OUT/fuzz-message-decode_seed_corpus.zip c/tests/fuzz/fuzz-message-decode/corpus/* c/tests/fuzz/fuzz-message-decode/crash/*\n"
  },
  {
    "path": "projects/qpid-proton/project.yaml",
    "content": "homepage: \"https://qpid.apache.org/proton/\"\nlanguage: c++\nprimary_contact: \"jross@apache.org\"\nauto_ccs:\n - \"security@apache.org\"\n - \"astitcher@apache.org\"\n - \"jdanek@redhat.com\"\nsanitizers:\n - address\n - memory\n - undefined\nmain_repo: 'https://github.com/apache/qpid-proton.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/qs/project.yaml",
    "content": "homepage: \"https://github.com/ljharb/qs\"\nlanguage: c++\nprimary_contact: \"ljharb@gmail.com\"\nmain_repo: 'https://github.com/ljharb/qs.git'\n"
  },
  {
    "path": "projects/qt/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y libssl-dev ninja-build libc6-dev:i386\n\nRUN git clone --depth 1 https://github.com/AFLplusplus/AFLplusplus.git myaflplusplus && \\\n    cp -r myaflplusplus/dictionaries afldictionaries && \\\n    cp -r myaflplusplus/testcases afltestcases && \\\n    rm -rf myaflplusplus\n\n# Simulate a classic Qt folder structure\nRUN mkdir qt\nWORKDIR $SRC/qt\n\nRUN git clone --branch dev --depth 1 git://code.qt.io/qt/qt5.git && \\\n    cp -r qt5/cmake . && \\\n    rm -rf qt5\nRUN git clone --branch dev --depth 5000 git://code.qt.io/qt/qtbase.git\nRUN git clone --branch dev --depth 1 git://code.qt.io/qt/qtimageformats.git\nRUN git clone --branch dev --depth 1 git://code.qt.io/qt/qtsvg.git\nRUN cmake -DSYNC_TO_MODULE=qtsvg -DSYNC_TO_BRANCH=dev -P cmake/QtSynchronizeRepo.cmake\nRUN git clone --branch dev --depth 1 git://code.qt.io/qt/qtqa.git\nRUN cp qtqa/fuzzing/oss-fuzz/build.sh $SRC/\n"
  },
  {
    "path": "projects/qt/project.yaml",
    "content": "homepage: \"http://qt-project.org\"\nlanguage: c++\nprimary_contact: \"rlohningqt@gmail.com\"\nauto_ccs:\n - \"jimis@gmx.net\"\n - \"haelkharashy@gmail.com\"\n - \"morten242@gmail.com\"\n - \"sgaist.qt@gmail.com\"\n - \"shawn.t.rutledge@gmail.com\"\nmain_repo: 'git://code.qt.io/qt/qt5.git'\narchitectures:\n - x86_64\n - i386\nhelp_url: \"https://code.qt.io/cgit/qt/qtbase.git/plain/tests/libfuzzer/README\"\n\nfuzzing_engines:\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/quantlib/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake ninja-build\n\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2\nRUN git clone --depth 1 https://github.com/lballabio/QuantLib.git quantlib\nWORKDIR quantlib\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/quantlib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_87_0.tar.bz2\ncd boost_1_87_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\n./b2 --with-math install\n\ncd $SRC/quantlib\n\nmkdir build\ncd build\nexport LDFLAGS=\"-Wl,-rpath,'\\$ORIGIN/lib'\"\ncmake .. -GNinja\\\n -DBOOST_ROOT=/usr\\\n -DCMAKE_BUILD_TYPE=Release\\\n -DQL_COMPILE_WARNING_AS_ERROR=ON\\\n -DQL_BUILD_FUZZ_TEST_SUITE=ON\\\n -DQL_BUILD_TEST_SUITE=OFF\\\n -DQL_BUILD_BENCHMARK=OFF\\\n -DQL_BUILD_EXAMPLES=OFF\\\n -DCMAKE_CXX_STANDARD=20\\\n -L\ncmake --build . --verbose -j$(nproc)\nmkdir $OUT/lib -p\ncp ql/libQuantLib.so* $OUT/lib/\nfind fuzz-test-suite -executable -type f -exec cp {} $OUT \\;\n"
  },
  {
    "path": "projects/quantlib/project.yaml",
    "content": "homepage: \"https://www.quantlib.org/\"\nlanguage: c++\nprimary_contact: \"luigi.ballabio@gmail.com\"\nmain_repo: \"https://github.com/lballabio/QuantLib.git\"\nauto_ccs:\n  - nathaniel.brough@gmail.com\nsanitizers:\n - address\n - memory\nfuzzing_engines:\n - libfuzzer\n - honggfuzz\n"
  },
  {
    "path": "projects/quartz/CronScheduleBuilderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.quartz.CronScheduleBuilder;\nimport java.text.ParseException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.quartz.CronScheduleBuilder] public static org.quartz.CronScheduleBuilder cronScheduleNonvalidatedExpression(java.lang.String) throws java.text.ParseException\npublic class CronScheduleBuilderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      CronScheduleBuilder.cronScheduleNonvalidatedExpression(data.consumeRemainingAsString());\n    } catch (ParseException e1) {\n      // Known Exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/quartz/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://download.java.net/openjdk/jdk11.0.0.1/ri/openjdk-11.0.0.1_linux-x64_bin.tar.gz -o jdk.tar.gz && \\\n    tar zxf jdk.tar.gz && \\\n    rm -rf jdk.tar.gz\n\nENV JAVA_HOME=\"$SRC/jdk-11.0.0.1\"\nENV PATH=\"$JAVA_HOME/bin:$PATH\"\nRUN git clone --depth 1 https://github.com/quartz-scheduler/quartz quartz\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/quartz\n"
  },
  {
    "path": "projects/quartz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n./gradlew clean build -x test -x javadoc -x sources\n\nCURRENT_VERSION=$(./gradlew properties | grep ^version: | cut -d\" \" -f2)\n\ncp \"./quartz-stubs/build/libs/quartz-stubs-$CURRENT_VERSION.jar\" $OUT/stubs.jar\ncp \"./quartz/build/libs/quartz-$CURRENT_VERSION.jar\" $OUT/quartz.jar\ncp \"./quartz-jobs/build/libs/quartz-jobs-$CURRENT_VERSION.jar\" $OUT/jobs.jar\n\nALL_JARS='stubs.jar quartz.jar jobs.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\ncp -r $JAVA_HOME $OUT/\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  $JAVA_HOME/bin/javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  export JAVA_HOME=\\$this_dir/$(basename $JAVA_HOME)\n  export LD_LIBRARY_PATH=\"\\$JAVA_HOME/lib/server\":\\$this_dir\n  export PATH=\\$JAVA_HOME/bin:\\$PATH\n\n  \\$this_dir/jazzer_driver                          \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/quartz/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/quartz-scheduler/quartz\nmain_repo: https://github.com/quartz-scheduler/quartz\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/qubes-os/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get -y install build-essential automake libtool git python libsystemd-dev\n\nWORKDIR qubes-os\n\nRUN git clone --single-branch https://github.com/QubesOS/qubes-app-linux-input-proxy $SRC/qubes-os/app-linux-input-proxy\n\nRUN git clone --single-branch https://github.com/QubesOS/qubes-core-qubesdb $SRC/qubes-os/qubes-core-qubesdb\n\nRUN git clone --single-branch https://github.com/QubesOS/qubes-core-qrexec $SRC/qubes-os/qubes-core-qrexec\n\nCOPY build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/qubes-os/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" != 'undefined' ]; then\n\tcd $SRC/qubes-os/app-linux-input-proxy\n\n\tmake -C fuzz\n\tcp fuzz/*_fuzzer $OUT/\n\tcp fuzz/*_seed_corpus.zip $OUT/\n\tcp fuzz/*.options $OUT/\nfi\n\ncd $SRC/qubes-os/qubes-core-qubesdb\n\nmake -C fuzz\ncp fuzz/*_fuzzer $OUT/\ncp fuzz/*_seed_corpus.zip $OUT/\ncp fuzz/*.options $OUT/\n\ncd $SRC/qubes-os/qubes-core-qrexec\n\nmake -C fuzz\ncp fuzz/*_fuzzer $OUT/\ncp fuzz/*_seed_corpus.zip $OUT/\ncp fuzz/*.options $OUT/\n"
  },
  {
    "path": "projects/qubes-os/project.yaml",
    "content": "homepage: \"https://www.qubes-os.org/\"\nmain_repo: \"https://github.com/QubesOS\"\nlanguage: c++\nprimary_contact: \"jpo@vt.edu\"\nauto_ccs:\n - \"marmarek@invisiblethingslab.com\"\n - \"pawel@invisiblethingslab.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - x86_64\n  - i386\n"
  },
  {
    "path": "projects/quic-go/.gitignore",
    "content": "oss-fuzz.sh\n"
  },
  {
    "path": "projects/quic-go/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN go install github.com/AdamKorcz/go-118-fuzz-build@latest\n\nRUN git clone --depth 1 https://github.com/quic-go/qpack/ $GOPATH/src/github.com/quic-go/qpack\nRUN git clone --depth 1 https://github.com/quic-go/quic-go/ $GOPATH/src/github.com/quic-go/quic-go\n\nRUN cp $GOPATH/src/github.com/quic-go/quic-go/oss-fuzz.sh $SRC/build.sh\n# Local testing:\n# 1. copy oss-fuzz.sh from quic-go repo to projects/quic-go\n# 2. uncomment this line\n# 3. run infra/helper.py build_image quic-go\n# COPY oss-fuzz.sh $SRC/build.sh\n\nRUN chmod +x $SRC/build.sh\n"
  },
  {
    "path": "projects/quic-go/project.yaml",
    "content": "homepage: \"https://github.com/quic-go/quic-go\"\nprimary_contact: \"martenseemann@gmail.com\"\nlanguage: go\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/quic-go/quic-go'\n"
  },
  {
    "path": "projects/quiche/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y zlib1g-dev libicu-dev\nRUN git clone --depth 1 https://github.com/google/quiche\nCOPY build.sh  *.diff $SRC/\nWORKDIR $SRC/quiche\n"
  },
  {
    "path": "projects/quiche/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsynchronize_coverage_directories() {\n  # For coverage, we need to remap source files to correspond to the Bazel build\n  # paths. We also need to resolve all symlinks that Bazel creates.\n  if [ \"$SANITIZER\" = \"coverage\" ]\n  then\n    declare -r RSYNC_CMD=\"rsync -aLkR\"\n    declare -r REMAP_PATH=${OUT}/proc/self/cwd/\n    mkdir -p ${REMAP_PATH}\n\n    # Synchronize the folder bazel-BAZEL_OUT_PROJECT.\n    declare -r RSYNC_FILTER_ARGS=(\"--include\" \"*.h\" \"--include\" \"*.cc\" \"--include\" \\\n      \"*.hpp\" \"--include\" \"*.cpp\" \"--include\" \"*.c\" \"--include\" \"*/\" \"--include\" \"*.inc\" \\\n      \"--exclude\" \"*\")\n\n    # Sync existing code.\n    ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" quiche/ ${REMAP_PATH}\n\n    # Sync generated proto files.\n    if [ -d \"./bazel-out/k8-fastbuild/bin/\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-fastbuild/bin/quiche/ ${REMAP_PATH}\n    fi\n    if [ -d \"./bazel-out/k8-fastbuild/bin/external/\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-fastbuild/bin/external/ ${REMAP_PATH}\n    fi\n\n    # Sync external dependencies. We don't need to include `bazel-tensorflow`.\n    # Also, remove `external/org_tensorflow` which is a copy of the entire source\n    # code that Bazel creates. Not removing this would cause `rsync` to expand a\n    # symlink that ends up pointing to itself!\n    pushd bazel-quiche\n    [[ -e external/org_quiche ]] && unlink external/org_quiche\n    ${RSYNC_CMD} external/ ${REMAP_PATH}\n    popd\n  fi\n}\n\n# Force a static link by removing all dymaic libicu's\nfind / -name \"libicu*.so\" -exec rm {} \\;\nfind / -name \"libicu*.so.66\" -exec rm {} \\;\nfind / -name \"libicu*.so.66.1\" -exec rm {} \\;\n\n# Use Bazel 8 for compatibility with quiche's MODULE.bazel setup\nexport USE_BAZEL_VERSION=8.2.1\n\ngit apply $SRC/quiche-patch.diff\nexport CXXFLAGS=\"${CXXFLAGS} -DNDEBUG=1\"\nexport CFLAGS=\"${CFLAGS} -DNDEBUG=1\"\nbazel run @fuzztest//bazel:setup_configs >> /etc/bazel.bazelrc\n# Remove the fuzzer_no_main linkopt from bazelrc (link order issue) and re-add\n# it with --whole-archive to ensure LLVMFuzzerRunDriver is resolved.\nFUZZER_NO_MAIN=$(find /usr/local/lib -name 'libclang_rt.fuzzer_no_main*' | grep x86_64 | head -1)\nsed -i \"\\|--linkopt=.*fuzzer_no_main|d\" /etc/bazel.bazelrc\nbazel build --config=oss-fuzz --subcommands --spawn_strategy=sandboxed \\\n  --linkopt=-Wl,--whole-archive --linkopt=\"${FUZZER_NO_MAIN}\" --linkopt=-Wl,--no-whole-archive \\\n  //quiche:http_frame_fuzzer\n\ncp bazel-bin/quiche/http_frame_fuzzer $OUT/\n\nTARGET_FUZZER=\"http_frame_fuzzer@Http2FrameDecoderFuzzTest.fuzz_frame_decoder\"\n\necho \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nchmod +x \\$this_dir/http_frame_fuzzer\n\\$this_dir/http_frame_fuzzer --fuzz=Http2FrameDecoderFuzzTest.fuzz_frame_decode  -- -- \\$@\" > $OUT/${TARGET_FUZZER}\nchmod +x $OUT/${TARGET_FUZZER}\npatchelf --set-rpath '$ORIGIN/'  $OUT/http_frame_fuzzer\n\nsynchronize_coverage_directories\n"
  },
  {
    "path": "projects/quiche/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/google/quiche\"\nmain_repo: 'https://github.com/google/quiche'\nlanguage: c++\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/quiche/quiche-patch.diff",
    "content": "diff --git a/quiche/BUILD.bazel b/quiche/BUILD.bazel\nindex c5b2064..5d0bb17 100644\n--- a/quiche/BUILD.bazel\n+++ b/quiche/BUILD.bazel\n@@ -305,6 +305,30 @@ cc_library(\n     ],\n )\n \n+cc_test(\n+    name = \"http_frame_fuzzer\",\n+    srcs = [\"http2/decoder/http2_frame_decoder_test.cc\"],\n+    deps = [\n+        \":binary_http\",\n+        \":quiche_core\",\n+        \":quiche_protobufs_testonly_cc_proto\",\n+        \":quiche_tool_support\",\n+        \":quiche_test_support\",\n+        \"@boringssl//:crypto\",\n+        \"@boringssl//:ssl\",\n+        \"@com_google_absl//absl/base:core_headers\",\n+        \"@com_google_absl//absl/container:flat_hash_map\",\n+        \"@com_google_absl//absl/container:flat_hash_set\",\n+        \"@com_google_absl//absl/memory\",\n+        \"@com_google_absl//absl/strings\",\n+        \"@com_google_absl//absl/strings:str_format\",\n+        \"@com_google_absl//absl/types:optional\",\n+        \"@fuzztest//fuzztest\",\n+        \"@fuzztest//fuzztest:fuzztest_gtest_main\",\n+        \"@com_google_googleurl//url\",\n+    ],\n+)\n+\n test_suite_from_source_list(\n     name = \"quiche_tests\",\n     srcs = quiche_tests_srcs,\ndiff --git a/quiche/http2/decoder/http2_frame_decoder_test.cc b/quiche/http2/decoder/http2_frame_decoder_test.cc\nindex a6dbf1a..0e279b8 100644\n--- a/quiche/http2/decoder/http2_frame_decoder_test.cc\n+++ b/quiche/http2/decoder/http2_frame_decoder_test.cc\n@@ -18,6 +18,7 @@\n #include \"quiche/http2/test_tools/random_decoder_test_base.h\"\n #include \"quiche/http2/test_tools/verify_macros.h\"\n #include \"quiche/common/platform/api/quiche_logging.h\"\n+#include \"fuzztest/fuzztest.h\"\n \n using ::testing::AssertionSuccess;\n \n@@ -915,6 +916,15 @@ TEST_F(Http2FrameDecoderTest, WindowUpdateTooLong) {\n   EXPECT_TRUE(DecodePayloadExpectingFrameSizeError(kFrameData, header));\n }\n \n+void fuzz_frame_decoder(const std::string &s1) {\n+  http2::Http2FrameDecoderNoOpListener listener;\n+  http2::Http2FrameDecoder decoder(&listener);\n+  http2::DecodeBuffer db(reinterpret_cast<const char *>(s1.c_str()), s1.size());\n+  decoder.DecodeFrame(&db);\n+}\n+\n+FUZZ_TEST(Http2FrameDecoderFuzzTest, fuzz_frame_decoder);\n+\n }  // namespace\n }  // namespace test\n }  // namespace http2\n"
  },
  {
    "path": "projects/quiche-cloudflare/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --recursive --depth 1 https://github.com/cloudflare/quiche quiche\nCOPY build.sh $SRC/\nWORKDIR $SRC/quiche\n"
  },
  {
    "path": "projects/quiche-cloudflare/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build\ncargo fuzz list | while read i; do\n    cp fuzz/target/x86_64-unknown-linux-gnu/release/$i $OUT/\n    zip -rj $OUT/${i}_seed_corpus.zip fuzz/corpus/${i}/\ndone\n\nmkdir $OUT/fuzz\ncp fuzz/cert* $OUT/fuzz\n"
  },
  {
    "path": "projects/quiche-cloudflare/project.yaml",
    "content": "homepage: \"https://docs.quic.tech/quiche/\"\nprimary_contact: \"alessandro@cloudflare.com\"\nmain_repo: \"https://github.com/cloudflare/quiche\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"lucas@cloudflare.com\"\n"
  },
  {
    "path": "projects/quick-xml/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/tafia/quick-xml\n\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/quick-xml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/quick-xml\ncargo fuzz build -O \n\nFUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/quick-xml/project.yaml",
    "content": "homepage: \"https://github.com/tafia/quick-xml\"\nmain_repo: \"https://github.com/tafia/quick-xml\"\nprimary_contact: \"tafia973@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/quickjs/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/bellard/quickjs quickjs\nRUN git clone --depth 1 https://github.com/renatahodovan/quickjs-corpus\nWORKDIR $SRC/quickjs\nCOPY build.sh run_tests.sh run_tests_patch.diff $SRC/\n\n# At the time of writing, `tests/test_worker.js`\n# fails from latest master, so we remove it.\n# This is being tracked in https://github.com/bellard/quickjs/issues/390.\n# A TODO is to track when it has been patched\n# upstream and enable all tests.\nRUN git apply $SRC/run_tests_patch.diff\n\n"
  },
  {
    "path": "projects/quickjs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build quickjs\n# Makefile should not override CFLAGS\nsed -i -e 's/CFLAGS=/CFLAGS+=/' Makefile\nsed -i -e 's/#define USE_WORKER/\\/\\/#define USE_WORKER/' quickjs-libc.c\nCONFIG_CLANG=y make libquickjs.fuzz.a .obj/fuzz_common.o .obj/libregexp.fuzz.o .obj/cutils.fuzz.o .obj/libunicode.fuzz.o\nzip -r $OUT/fuzz_eval_seed_corpus.zip $SRC/quickjs-corpus/js/*.js\nzip -r $OUT/fuzz_compile_seed_corpus.zip $SRC/quickjs-corpus/js/*.js\n\nbuild_fuzz_target () {\n    local target=$1\n    shift\n    $CC $CFLAGS -I. -c fuzz/$target.c -o $target.o\n    $CXX $CXXFLAGS $target.o -o $OUT/$target $@ $LIB_FUZZING_ENGINE\n}\n\nbuild_fuzz_target fuzz_eval .obj/fuzz_common.o libquickjs.fuzz.a\nbuild_fuzz_target fuzz_compile .obj/fuzz_common.o libquickjs.fuzz.a\nbuild_fuzz_target fuzz_regexp .obj/libregexp.fuzz.o .obj/cutils.fuzz.o .obj/libunicode.fuzz.o\n\ncp fuzz/fuzz.dict $OUT/fuzz_eval.dict\ncp fuzz/fuzz.dict $OUT/fuzz_compile.dict\n"
  },
  {
    "path": "projects/quickjs/project.yaml",
    "content": "homepage: \"https://bellard.org/quickjs/\"\nlanguage: c\nprimary_contact: \"fabrice.bellard@gmail.com\"\nauto_ccs :\n- \"p.antoine@catenacyber.fr\"\n\nsanitizers:\n- address\n- memory\n\nmain_repo: 'https://github.com/bellard/quickjs'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/quickjs/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCONFIG_CLANG=y make test\n"
  },
  {
    "path": "projects/quickjs/run_tests_patch.diff",
    "content": "diff --git a/Makefile b/Makefile\nindex 3b1c745..e0a1b97 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -449,7 +449,6 @@ test: qjs$(EXE)\n \t$(WINE) ./qjs$(EXE) tests/test_loop.js\n \t$(WINE) ./qjs$(EXE) tests/test_bigint.js\n \t$(WINE) ./qjs$(EXE) tests/test_cyclic_import.js\n-\t$(WINE) ./qjs$(EXE) tests/test_worker.js\n ifndef CONFIG_WIN32\n \t$(WINE) ./qjs$(EXE) tests/test_std.js\n endif\n"
  },
  {
    "path": "projects/rabbitmq-c/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake\nRUN git clone https://github.com/alanxz/rabbitmq-c librabbitmq/\nCOPY run_tests.sh build.sh $SRC/\nWORKDIR $SRC/librabbitmq/\n"
  },
  {
    "path": "projects/rabbitmq-c/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmkdir build \n\npushd build/\n\ncmake \\\n    -DCMAKE_BUILD_TYPE=Debug -DBUILD_OSSFUZZ=ON \\\n    -DCMAKE_C_COMPILER=\"$CC\" -DCMAKE_CXX_COMPILER=\"$CXX\" \\\n    -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_EXE_LINKER_FLAGS=\"$CFLAGS\" \\\n    -DLIB_FUZZING_ENGINE=\"$LIB_FUZZING_ENGINE\" ../.\n\nmake -j$(nproc)\n\nif [ \"$SANITIZER\" != \"undefined\" ]; then\n    cp fuzz/fuzz_url $OUT/fuzz_url\nfi\ncp fuzz/fuzz_table $OUT/fuzz_table\ncp fuzz/fuzz_server $OUT/fuzz_server\npopd\n\nzip -j ${OUT}/fuzz_url_seed_corpus.zip fuzz/input/fuzz_url.raw\nzip -j ${OUT}/fuzz_table_seed_corpus.zip fuzz/input/fuzz_table.raw\nzip -j ${OUT}/fuzz_server_seed_corpus.zip fuzz/input/fuzz_server.raw\n"
  },
  {
    "path": "projects/rabbitmq-c/project.yaml",
    "content": "homepage: \"https://github.com/alanxz/rabbitmq-c\"\nlanguage: c\nprimary_contact: \"alan.antonuk@gmail.com\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/alanxz/rabbitmq-c'\n"
  },
  {
    "path": "projects/rabbitmq-c/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build\n"
  },
  {
    "path": "projects/racket/project.yaml",
    "content": "homepage: \"https://racket-lang.org\"\nprimary_contact: \"pocmatos@gmail.com\"\nmain_repo: \"https://github.com/racket/racket/\"\nauto_ccs:\n  - samth@racket-lang.org\nsanitizers:\n - undefined\n - memory\n - address\narchitectures:\n - x86_64\n - i386\n"
  },
  {
    "path": "projects/radare2/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update\nRUN apt-get install -y pkg-config wget\nRUN git clone https://github.com/radareorg/radare2 radare2\nRUN git clone https://github.com/radareorg/radare2-fuzz radare2-fuzz\nWORKDIR radare2\nCOPY build.sh $SRC/\nCOPY *.options $SRC/\n"
  },
  {
    "path": "projects/radare2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport USERCC=$CC\nexport HOST_CC=$CC\nexport NOLTO=1\n\nsed 's/gcc-ar/llvm-ar/g' -i sys/static.sh\nsys/static.sh || true\ncp -r r2-static $OUT/\n\ncp -r ../radare2-fuzz/targets .\nexport RADARE2_STATIC_BUILD=$OUT/r2-static\n\nexport CXXFLAGS=\"${CXXFLAGS} -I ${RADARE2_STATIC_BUILD}/usr/include/libr/sdb\"\n\ncd targets \nmake\n\nfor target in $(ls *.cc); do\n\tfuzzer=$(echo $target | cut -d'.' -f1)\n\tcp $fuzzer $OUT\n\tcp $SRC/default.options $OUT/$fuzzer.options\ndone\n\nfor seed in $(ls corpora); do\n\tzip -j corpora/$seed.zip corpora/$seed/*\n\tcp corpora/$seed.zip $OUT\ndone\n"
  },
  {
    "path": "projects/radare2/default.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/radare2/project.yaml",
    "content": "homepage: \"https://github.com/radareorg/radare2\"\nlanguage: c++\nprimary_contact: \"pancake@nopcode.org\"\nauto_ccs:\n  - \"zlowram@gmail.com\"\nsanitizers:\n  - address\nrun_tests: False\nmain_repo: 'https://github.com/radareorg/radare2'\n"
  },
  {
    "path": "projects/radon/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/radondb/radon\nCOPY build.sh $SRC/\nWORKDIR $SRC/radon\n"
  },
  {
    "path": "projects/radon/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncd ./src/fuzz/sqlparser\ngo mod init github.com/radondb/radon/src/fuzz/sqlparser\ncompile_go_fuzzer . Fuzz fuzz\n"
  },
  {
    "path": "projects/radon/project.yaml",
    "content": "homepage: \"https://github.com/radondb/radon\"\nprimary_contact: \"overred.shuttler@gmail.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/radondb/radon'\n"
  },
  {
    "path": "projects/radvd/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool bison flex pkg-config libbsd-dev\nRUN git clone --depth 1 https://github.com/radvd-project/radvd radvd\nWORKDIR radvd\nCOPY build.sh *.c $SRC/\n"
  },
  {
    "path": "projects/radvd/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\n./configure\nmake -j$(nproc)\n\n# Compile harnesses\n$CC $CFLAGS -I. -c $SRC/fuzz_config.c -o fuzz_config.o\n$CC $CFLAGS -I. -c $SRC/fuzz_process.c -o fuzz_process.o\n\n# Objects to link against\n# We exclude radvd.o (main), radvdump.o (main), log.o (mocked)\nOBJS=\"util.o interface.o device-common.o device-linux.o privsep-linux.o recv.o socket.o send.o timer.o\"\n\n# fuzz_config\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_config.o libradvd-parser.a $OBJS -l:libbsd.a -o $OUT/fuzz_config\n\n# fuzz_process\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_process.o process.o $OBJS /usr/lib/x86_64-linux-gnu/libbsd.a -o $OUT/fuzz_process\n"
  },
  {
    "path": "projects/radvd/fuzz_config.c",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#define _GNU_SOURCE\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/ip6.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include \"radvd.h\"\n\n// Mock functions needed for linking\nint sock = -1;\n\n// radvd.h declares these, but we might need to define them if we don't link radvd.o\n// However, we will link against objects that might need them.\n\nint LL_DEBUG_LOG = 0;\nint log_method = L_STDERR;\nchar *conf_file = NULL;\nchar *pname = \"fuzz_config\";\n\n// We need to mock logging functions to avoid cluttering output\nvoid dlog(int level, int flevel, char const *fmt, ...) {}\nvoid flog(int level, char const *fmt, ...) {}\nvoid set_debuglevel(int level) {}\nint get_debuglevel(void) { return 0; }\n\n// We need readin_config\nstruct Interface *readin_config(char const *path);\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    char filename[] = \"/tmp/fuzz-config-XXXXXX\";\n    int fd = mkstemp(filename);\n    if (fd < 0) {\n        return 0;\n    }\n    write(fd, data, size);\n    close(fd);\n\n    struct Interface *ifaces = readin_config(filename);\n    \n    if (ifaces) {\n        free_ifaces(ifaces);\n    }\n    \n    unlink(filename);\n    return 0;\n}\n"
  },
  {
    "path": "projects/radvd/fuzz_process.c",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#define _GNU_SOURCE\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <netinet/in.h>\n#include <netinet/ip6.h>\n#include <net/if.h>\n#include \"radvd.h\"\n\n// Mock functions\nint sock = -1;\nint LL_DEBUG_LOG = 0;\nint log_method = L_STDERR;\nchar *conf_file = NULL;\nchar *pname = \"fuzz_process\";\n\nvoid dlog(int level, int flevel, char const *fmt, ...) {}\nvoid flog(int level, char const *fmt, ...) {}\nint get_debuglevel(void) { return 0; }\n\nvoid set_debuglevel(int level) {}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (size < sizeof(struct icmp6_hdr)) return 0;\n\n    struct Interface iface;\n    memset(&iface, 0, sizeof(iface));\n    strcpy(iface.props.name, \"lo\");\n    iface.props.if_index = 1;\n    iface.state_info.ready = 1;\n    iface.AdvSendAdvert = 1;\n    iface.UnicastOnly = 0;\n    \n    // We need to set if_addrs\n    struct in6_addr addr_ll;\n    memset(&addr_ll, 0, sizeof(addr_ll));\n    addr_ll.s6_addr[0] = 0xfe;\n    addr_ll.s6_addr[1] = 0x80;\n    iface.props.if_addr = addr_ll;\n    \n    struct sockaddr_in6 addr;\n    memset(&addr, 0, sizeof(addr));\n    addr.sin6_family = AF_INET6;\n    // Set link local address\n    addr.sin6_addr.s6_addr[0] = 0xfe;\n    addr.sin6_addr.s6_addr[1] = 0x80;\n\n    struct in6_pktinfo pkt_info;\n    memset(&pkt_info, 0, sizeof(pkt_info));\n    pkt_info.ipi6_ifindex = 1;\n\n    int hoplimit = 255;\n\n    unsigned char *msg = (unsigned char *)malloc(size);\n    memcpy(msg, data, size);\n\n    process(sock, &iface, msg, size, &addr, &pkt_info, hoplimit);\n\n    free(msg);\n    return 0;\n}\n"
  },
  {
    "path": "projects/radvd/project.yaml",
    "content": "homepage: \"http://www.litech.org/radvd\"\nlanguage: c\nsanitizers:\n  - address\n  - undefined\n  - memory\nprimary_contact: \"javanlacerda@google.com\"\nauto_ccs:\n- \"pedroysb@google.com\"\n- \"david@adalogics.com\"\n- \"cloud-ti-fuzzing+bugs@google.com\"\n\nmain_repo: \"http://www.litech.org/radvd\"\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/rapidjson/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y make autoconf automake libtool cmake libgtest-dev\nRUN git clone --depth 1 https://github.com/Tencent/rapidjson.git rapidjson\nWORKDIR rapidjson\nCOPY *.sh fuzzer.cpp $SRC/\n"
  },
  {
    "path": "projects/rapidjson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"${CXXFLAGS} -pthread\"\n\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DMSAN\"\nfi\n\nif [[ $CFLAGS = *sanitize=address* ]]\nthen\n    export CXXFLAGS=\"$CXXFLAGS -DASAN\"\nfi\n\n# Build fuzz harness.\n$CXX $CXXFLAGS -D_GLIBCXX_DEBUG -I $SRC/rapidjson/include $SRC/fuzzer.cpp $LIB_FUZZING_ENGINE -o $OUT/fuzzer\n\n# Build unit test and perf test only\nmkdir build\ncd build\nNO_ERROR=\"-Wno-error=character-conversion\"\nNO_ERROR=\"$NO_ERROR -Wno-error=deprecated-declarations\"\nNO_ERROR=\"$NO_ERROR -Wno-error=uninitialized-const-pointer\"\nexport LDFLAGS=\"-pthread\"\ncmake -DRAPIDJSON_BUILD_CXX17=ON \\\n  -DRAPIDJSON_BUILD_CXX11=OFF \\\n  -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF \\\n  -DCMAKE_CXX_FLAGS=\"$NO_ERROR\" \\\n  ..\nmake -j$(nproc) unittest perftest\n"
  },
  {
    "path": "projects/rapidjson/fuzzer.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <cstdint>\n#include <cstddef>\n#include <string>\n#include <rapidjson/document.h>\n#include <rapidjson/prettywriter.h>\n\n#ifdef MSAN\nextern \"C\" {\n    void __msan_check_mem_is_initialized(const volatile void *x, size_t size);\n}\n#endif\n\ntemplate<unsigned parseFlags>\nvoid fuzzWithFlags(const std::string &s)\n{\n    /* Parse input to rapidjson::Document */\n    rapidjson::Document document;\n    rapidjson::ParseResult pr = document.Parse<parseFlags>(s.c_str());\n    if ( !pr ) {\n        return;\n    }\n\n    /* Convert from rapidjson::Document to string */\n    rapidjson::StringBuffer sb;\n    rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(sb);\n    document.Accept(writer);\n    std::string str = sb.GetString();\n#ifdef MSAN\n    if ( str.size() ) {\n        __msan_check_mem_is_initialized(str.data(), str.size());\n    }\n#endif\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    const std::string s(data, data + size);\n\n    fuzzWithFlags<rapidjson::kParseDefaultFlags>(s);\n    fuzzWithFlags<rapidjson::kParseFullPrecisionFlag>(s);\n    fuzzWithFlags<rapidjson::kParseNumbersAsStringsFlag>(s);\n    fuzzWithFlags<rapidjson::kParseCommentsFlag>(s);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/rapidjson/project.yaml",
    "content": "homepage: \"https://github.com/tencent/rapidjson\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nsanitizers:\n - address\n - undefined\n - memory:\n    experimental: True\narchitectures:\n - x86_64\n - i386\nmain_repo: 'https://github.com/Tencent/rapidjson.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/rapidjson/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\n$SRC/rapidjson/build/bin/unittest && $SRC/rapidjson/build/bin/perftest\n"
  },
  {
    "path": "projects/rauc/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip\nRUN unset CFLAGS CXXFLAGS && pip3 install -U meson ninja\nRUN git clone --depth 1 https://github.com/rauc/rauc.git rauc\nWORKDIR rauc\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/rauc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBUILD=$WORK/build\n\nrm -rf $BUILD\n\n# build project\n\nmeson setup $BUILD \\\n  -Ddefault_library=static \\\n  -Db_lundef=false \\\n  -Dfuzzing=true \\\n  -Dglib:libmount=disabled \\\n  -Dglib:selinux=disabled \\\n  -Dgpt=disabled \\\n  -Djson=disabled \\\n  -Dnetwork=false \\\n  -Dservice=false \\\n  -Dstreaming=false \\\n  --wrap-mode=forcefallback\n\nninja -C $BUILD\n\n# collect fuzzers and data\n\nfind $BUILD/fuzz -maxdepth 1 -executable -type f -exec cp \"{}\" $OUT \\;\n\nfind fuzz -type f -name \"*.dict\" -exec cp \"{}\" $OUT \\;\n\nfor CORPUS in $(find fuzz -type f -name \"*.corpus\"); do\n  BASENAME=${CORPUS##*/}\n  zip $OUT/${BASENAME%%.*}_seed_corpus.zip . -ws -r -i@$CORPUS\ndone\n"
  },
  {
    "path": "projects/rauc/project.yaml",
    "content": "homepage: \"https://rauc.io/\"\nlanguage: c\nprimary_contact: \"jlu@pengutronix.de\"\nauto_ccs:\n- jluebbe@lasnet.de\n- ejoerns89@gmail.com\nmain_repo: \"https://github.com/rauc/rauc.git\"\n"
  },
  {
    "path": "projects/rauc/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Run unit testing, skipping some that requires hardware or network configuration\nmeson test -C $WORK/build --suite rauc -j$(nproc) artifacts bootchooser checksum config_file context event_log hash_index manifest progress slot stats status_file utils\n\n# Test skipped that requires hardware or network configuration\n# meson test -C $WORK/build --suite rauc -j$(nproc) boot_raw_fallback bundle dm install service signature update_handler\n"
  },
  {
    "path": "projects/rdf4j/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/eclipse/rdf4j rdf4j\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/rdf4j\n"
  },
  {
    "path": "projects/rdf4j/ParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.eclipse.rdf4j.query.MalformedQueryException;\nimport org.eclipse.rdf4j.query.parser.ParsedQuery;\nimport org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;\n\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.eclipse.rdf4j.query.parser.sparql.SPARQLParser] public org.eclipse.rdf4j.query.parser.ParsedQuery parseQuery(java.lang.String,java.lang.String) throws org.eclipse.rdf4j.query.MalformedQueryException\npublic class ParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      SPARQLParser obj = new SPARQLParser();\n      obj.parseQuery(\n          data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString());\n    } catch (MalformedQueryException | IllegalArgumentException e1) {\n    }\n  }\n}\n"
  },
  {
    "path": "projects/rdf4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false dependency:copy-dependencies\n\n# Collect relevant jar files\nJARFILE_LIST=\nfor JARFILE in $(find ./  -name *.jar)\ndo\n  if [[ \"$JARFILE\" == *\"target/\"* ]]\n  then\n    if [[ \"$JARFILE\" != *sources.jar ]] && [[ \"$JARFILE\" != *javadoc.jar ]] && [[ \"$JARFILE\" != *tests.jar ]]\n    then\n      cp $JARFILE $OUT/\n      JARFILE_LIST=\"$JARFILE_LIST$(basename $JARFILE) \"\n    fi\n  fi\ndone\n\ncurr_dir=$(pwd)\nrm -rf $OUT/jar_temp\nmkdir $OUT/jar_temp\ncd $OUT/jar_temp\nfor JARFILE in $JARFILE_LIST\ndo\n  jar -xf $OUT/$JARFILE\ndone\ncd $curr_dir\n\nBUILD_CLASSPATH=$JAZZER_API_PATH:$OUT/jar_temp\nRUNTIME_CLASSPATH=\\$this_dir/jar_temp:\\$this_dir\nfor fuzzer in $(find $SRC -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \"\\$0\")\nif [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\nthen\nmem_settings='-Xmx1900m:-Xss900k'\nelse\nmem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir         \\\n  \\$this_dir/jazzer_driver                                \\\n  --agent_path=\\$this_dir/jazzer_agent_deploy.jar         \\\n  --cp=$RUNTIME_CLASSPATH                                 \\\n  --target_class=$fuzzer_basename                         \\\n  --jvm_args=\"\\$mem_settings\"                             \\\n  \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/rdf4j/project.yaml",
    "content": "homepage: https://github.com/eclipse/rdf4j\nmain_repo: https://github.com/eclipse/rdf4j\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/rdkit/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget\n\nRUN git clone https://gitlab.com/libeigen/eigen && \\\n    mkdir eigen_build && \\\n    cd eigen_build && \\\n    cmake ../eigen && \\\n    make install\n\nRUN git clone --depth 1 https://github.com/rdkit/rdkit.git $SRC/rdkit\nWORKDIR $SRC/rdkit\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rdkit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build zlib\ngit clone --depth 1 -b master https://github.com/madler/zlib.git $SRC/zlib\ncd $SRC/zlib\nOLD_CFLAGS=\"$CFLAGS\"\nexport LDFLAGS=\"-fPIC $CFLAGS\"\nexport CFLAGS=\"-fPIC $CFLAGS\"\n# Only build static libraries, so we don't accidentally link to zlib dynamically.\n./configure --static\nmake -j$(nproc) clean\nmake -j$(nproc) all install\nunset LDFLAGS\nexport CFLAGS=\"$OLD_CFLAGS\"\n\n# We're building `rdkit` using clang, but the boost package is built using gcc.\n# For whatever reason, linking would fail.\n# (Mismatch between libstdc++ and libc++ maybe?)\n# It works if we build `rdkit` using gcc or build boost using clang instead.\n# We've opted for building boost using clang.\ncd $SRC && \\\nwget --quiet https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2 && \\\ntar xjf boost_1_84_0.tar.bz2 && \\\ncd $SRC/boost_1_84_0 && \\\n./bootstrap.sh --with-toolset=clang --with-libraries=serialization,system,iostreams,regex,program_options && \\\n# b2's clang toolset adds --target=x86_64-pc-linux (missing -gnu suffix),\n# which breaks libc++ header search. Use a wrapper to fix the target triple.\ncat > /tmp/clang_wrapper.sh << 'WRAPPER'\n#!/bin/bash\nargs=()\nfor arg in \"$@\"; do\n    if [[ \"$arg\" == \"--target=\"* ]]; then\n        args+=(\"--target=x86_64-unknown-linux-gnu\")\n    else\n        args+=(\"$arg\")\n    fi\ndone\nexec /usr/local/bin/clang++ \"${args[@]}\"\nWRAPPER\nchmod +x /tmp/clang_wrapper.sh && \\\necho \"using clang : : /tmp/clang_wrapper.sh ;\" > ~/user-config.jam && \\\n./b2 -q -j$(nproc) toolset=clang linkflags=\"-fPIC $CXXFLAGS $CXXFLAGS_EXTRA\" cxxflags=\"-fPIC $CXXFLAGS $CXXFLAGS_EXTRA\" link=static install\n\ncd $SRC/rdkit\n\nmkdir -p build && cd build\ncmake -DRDK_BUILD_PYTHON_WRAPPERS=OFF -DRDK_BUILD_FREETYPE_SUPPORT=OFF -DLIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE} -DRDK_BUILD_FUZZ_TARGETS=ON -DRDK_INSTALL_STATIC_LIBS=ON -DBoost_USE_STATIC_LIBS=ON ..\n# Use -k to keep going past shared library link failures (coverage sanitizer\n# causes __llvm_prf section errors in .so files). Fuzzers only need static libs.\nmake -j$(nproc) -k || true\nmake install -k || true\n\n# Leave build directory\ncd ..\n\n# Copy the fuzzer executables, zip-ed corpora, options and dictionary files to $OUT\nfind . -type f -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -type f -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\n#find . -type f -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'\ncorpora=$(find . -type d -name \"*_fuzzer\")\nfor corpus in $corpora; do\n\tcorpus_basename=$(basename $corpus)\n\tzip -j $OUT/${corpus_basename}_seed_corpus.zip ${corpus}/*\ndone\n"
  },
  {
    "path": "projects/rdkit/project.yaml",
    "content": "homepage: \"https://github.com/rdkit/rdkit\"\nlanguage: c++\nprimary_contact: \"greg.landrum@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/rdkit/rdkit.git'\n"
  },
  {
    "path": "projects/re2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update -y && apt-get install -y cmake make pkg-config\n\n# https://github.com/abseil/abseil-cpp/issues/1524#issuecomment-1739364093\n# explains why Abseil must be built for fuzzing, not depended on normally.\nRUN git clone --depth=1 https://github.com/abseil/abseil-cpp\nRUN git clone --depth 1 https://github.com/google/re2\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/re2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCXXFLAGS=\"$CXXFLAGS -O2\"\n\n# First, build and install Abseil.\n# https://github.com/abseil/abseil-cpp/issues/1524#issuecomment-1739364093\n# explains why Abseil must be built for fuzzing, not depended on normally.\n# N.B., this is pasted almost verbatim from what libphonenumber does here.\ncd $SRC/abseil-cpp\nmkdir build && cd build\ncmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. && make -j$(nproc) && make install\nldconfig\n\n# Second, build and install RE2.\n# N.B., we don't follow the standard incantation for building RE2\n# (i.e., `make && make test && make install && make testinstall`),\n# because some of the targets doesn't use $CXXFLAGS properly, which\n# causes compilation to fail. The obj/libre2.a target is all we\n# really need for our fuzzer, so that's all we build. Hopefully\n# this won't cause the fuzzer to fail erroneously due to not running\n# upstream's tests first to be sure things compiled correctly.\n# However, we do want the \"common\" files installed so that we can\n# interrogate pkg-config about the Abseil dependencies instead of\n# maintaining yet another enumeration of them here.\ncd $SRC/re2\nmake -j$(nproc) obj/libre2.a && make common-install\n\n# Third, build the fuzzer (distributed with RE2).\n$CXX $CXXFLAGS -I. \\\n\tre2/fuzzing/re2_fuzzer.cc -o $OUT/re2_fuzzer \\\n\t$LIB_FUZZING_ENGINE obj/libre2.a \\\n\t$(pkg-config re2 --libs | sed -e 's/-lre2//')\n\n"
  },
  {
    "path": "projects/re2/project.yaml",
    "content": "homepage: \"https://github.com/google/re2\"\nmain_repo: \"https://github.com/google/re2\"\nprimary_contact: \"junyer@google.com\"\nlanguage: c++\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/readstat/Dockerfile",
    "content": "# Copyright 2019 Evan Miller\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake gettext libtool zip zlib1g-dev\n\nRUN git clone --depth 1 https://github.com/WizardMac/ReadStat readstat\nWORKDIR readstat\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/readstat/build.sh",
    "content": "# Copyright 2019 Evan Miller\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#!/bin/bash -eu\n\n./autogen.sh\n./configure --enable-static\nmake clean\n\nmake\nmake generate_corpus\n./generate_corpus\n\nzip $OUT/fuzz_format_dta_seed_corpus.zip ./fuzz/corpus/dta*/test-case-*\nzip $OUT/fuzz_format_por_seed_corpus.zip ./fuzz/corpus/por/test-case-*\nzip $OUT/fuzz_format_sav_seed_corpus.zip ./fuzz/corpus/sav*/test-case-* ./fuzz/corpus/zsav/test-case-*\nzip $OUT/fuzz_format_sas7bcat_seed_corpus.zip ./fuzz/corpus/sas7bcat/test-case-*\nzip $OUT/fuzz_format_sas7bdat_seed_corpus.zip ./fuzz/corpus/sas7bdat*/test-case-*\nzip $OUT/fuzz_format_xport_seed_corpus.zip ./fuzz/corpus/xpt*/test-case-*\n\ncp ./fuzz/dict/fuzz_format_spss_commands.dict $OUT/fuzz_format_spss_commands.dict\ncp ./fuzz/dict/fuzz_format_stata_commands.dict $OUT/fuzz_format_stata_commands.dict\ncp ./fuzz/dict/fuzz_format_sas_commands.dict $OUT/fuzz_format_sas_commands.dict\n\nREADSTAT_FUZZERS=\"\n    fuzz_compression_sav \\\n    fuzz_grammar_spss_format \\\n    fuzz_format_sas_commands \\\n    fuzz_format_spss_commands \\\n    fuzz_format_stata_dictionary \\\n    fuzz_format_dta \\\n    fuzz_format_por \\\n    fuzz_format_sav \\\n    fuzz_format_sas7bcat \\\n    fuzz_format_sas7bdat \\\n    fuzz_format_xport\"\n\nfor fuzzer in $READSTAT_FUZZERS; do\n    make ${fuzzer}\n    cp ${fuzzer} $OUT/${fuzzer}\ndone\n"
  },
  {
    "path": "projects/readstat/fuzz_format_sas_commands.dict",
    "content": "\" \"\n\"#\"\n\"$\"\n\"$CHAR\"\n\"%LET\"\n\"(\"\n\")\"\n\"*/\"\n\"/*\"\n\";\"\n\"@\"\n\"ATTRIB\"\n\"CLEAR\"\n\"CONTENTS\"\n\"DATA\"\n\"DATE\"\n\"FILENAME\"\n\"FOOTNOTE\"\n\"FORMAT\"\n\"IF\"\n\"INFILE\"\n\"INPUT\"\n\"INVALUE\"\n\"LABEL\"\n\"LENGTH\"\n\"LIBNAME\"\n\"LIST\"\n\"MISSING\"\n\"OPTIONS\"\n\"OTHER\"\n\"PRINT\"\n\"PROC\"\n\"RUN\"\n\"VALUE\"\n\"_ALL_\"\n\"dlm\"\n\"firstobs\"\n"
  },
  {
    "path": "projects/readstat/fuzz_format_spss_commands.dict",
    "content": "\"(\"\n\"(NOMINAL)\"\n\"(ORDINAL)\"\n\"(SCALE)\"\n\")\"\n\".\"\n\"/\"\n\"/VARIABLES\"\n\"=\"\n\" \"\n\"A\"\n\"ADATE\"\n\"COMMENT\"\n\"DATA\"\n\"DATASET\"\n\"DATE\"\n\"DELIMITERS\"\n\"DICTIONARY\"\n\"DISPLAY\"\n\"END\"\n\"EXECUTE\"\n\"F\"\n\"FILE\"\n\"FIRSTCASE\"\n\"FIXED\"\n\"FORMATS\"\n\"HANDLE\"\n\"IF\"\n\"INPUT\"\n\"LABEL\"\n\"LABELS\"\n\"LEVEL\"\n\"LIST\"\n\"NAME\"\n\"OUTFILE\"\n\"PROGRAM\"\n\"RECODE\"\n\"RECORD\"\n\"SAVE\"\n\"SELECT\"\n\"SET\"\n\"SYSMIS\"\n\"TABLE\"\n\"VALUE\"\n\"VARIABLE\"\n\"WINDOW\"\n"
  },
  {
    "path": "projects/readstat/fuzz_format_stata_commands.dict",
    "content": "\" \"\n\")\"\n\"*/\"\n\"/*\"\n\"_column(\"\n\"_firstlineoffile(\"\n\"_line(\"\n\"_lines(\"\n\"_lrecl(\"\n\"_newline\"\n\"_skip(\"\n\"byte\"\n\"dictionary\"\n\"double\"\n\"float\"\n\"infile\"\n\"int\"\n\"long\"\n\"str\"\n\"using\"\n\"{\"\n\"}\"\n"
  },
  {
    "path": "projects/readstat/project.yaml",
    "content": "homepage: \"https://github.com/WizardMac/ReadStat\"\nlanguage: c++\nprimary_contact: \"emmiller@gmail.com\"\nmain_repo: 'https://github.com/WizardMac/ReadStat'\n"
  },
  {
    "path": "projects/readstat/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/realm-core/project.yaml",
    "content": "homepage: \"https://github.com/realm/realm-core\"\nmain_repo: \"https://github.com/realm/realm-core\"\nprimary_contact: \"ez@realm.io\"\n"
  },
  {
    "path": "projects/redis-py/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/redis/redis-py redis\nWORKDIR redis\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/redis-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/redis-py/fuzz_backoff.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from redis.backoff import *\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    cb = ConstantBackoff(fdp.ConsumeInt(8))\n    cb.compute(fdp.ConsumeInt(8))\n    cb.reset()\n\n    nb = NoBackoff()\n    nb.compute(fdp.ConsumeInt(8))\n    nb.reset()\n\n    eb = ExponentialBackoff(fdp.ConsumeInt(8),fdp.ConsumeInt(8))\n    eb.compute(fdp.ConsumeInt(8))\n    eb.reset()\n\n    fjb = FullJitterBackoff(fdp.ConsumeInt(8),fdp.ConsumeInt(8))\n    fjb.compute(fdp.ConsumeInt(8))\n    fjb.reset()\n\n    ejb = EqualJitterBackoff(fdp.ConsumeInt(8),fdp.ConsumeInt(8))\n    ejb.compute(fdp.ConsumeInt(8))\n    ejb.reset()\n\n    djb = DecorrelatedJitterBackoff(fdp.ConsumeInt(8),fdp.ConsumeInt(8))\n    djb.compute(fdp.ConsumeInt(8))\n    djb.reset()\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/redis-py/fuzz_encoder.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from redis.connection import *\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    encoder = Encoder(\"utf-8\",\"ignore\",True if fdp.ConsumeBool() else False)\n    encoder.encode(fdp.ConsumeString(100))\n    encoder.encode(fdp.ConsumeUnicode(100))\n    encoder.encode(fdp.ConsumeBytes(100))\n    encoder.encode(fdp.ConsumeInt(8))\n    encoder.decode(fdp.ConsumeString(100))\n    encoder.decode(fdp.ConsumeUnicode(100))\n    encoder.decode(fdp.ConsumeBytes(100))\n    encoder.decode(fdp.ConsumeInt(8))\n\n    BaseParser().parse_error(fdp.ConsumeString(100))\n    BaseParser().parse_error(fdp.ConsumeUnicode(100))\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/redis-py/fuzz_func.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from redis.client import *\n\ndef dummy_callback(obj):\n    pass\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    timestamp_to_datetime(fdp.ConsumeString(20))\n    timestamp_to_datetime(fdp.ConsumeInt(8))\n    timestamp_to_datetime(fdp.ConsumeFloat())\n\n    string_keys_to_dict(\"('%s','%s','%s')\"%(fdp.ConsumeString(20),fdp.ConsumeString(20),fdp.ConsumeString(20)),dummy_callback)\n    string_keys_to_dict(fdp.ConsumeString(60),dummy_callback)\n\n    parse_debug_object(fdp.ConsumeString(20))\n    parse_debug_object(fdp.ConsumeUnicode(20))\n    parse_debug_object(fdp.ConsumeBytes(20))\n\n    parse_object(fdp.ConsumeString(20),fdp.ConsumeString(20))\n    parse_object(fdp.ConsumeUnicode(20),fdp.ConsumeUnicode(20))\n    parse_object(fdp.ConsumeBytes(20),fdp.ConsumeBytes(20))\n    parse_object(fdp.ConsumeInt(8),fdp.ConsumeBytes(20))\n    parse_object(fdp.ConsumeInt(8),\"idletime\")\n    parse_object(fdp.ConsumeFloat(),\"idletime\")\n    try:\n        parse_object(fdp.ConsumeString(20),\"idletime\")\n    except ValueError as e:\n        if \"invalid literal for int() with base 10\" not in str(e):\n            raise e\n    parse_object(fdp.ConsumeBool(),\"idletime\")\n\n    response_str = \"\"\"\n        %s:%s\n        %s:%s\n        %s:%s\n        %s:%d\n        %s:%f\n        %s:%d\n    \"\"\"%(\n        fdp.ConsumeString(20),fdp.ConsumeString(20),\n        fdp.ConsumeString(20),fdp.ConsumeUnicode(20),\n        fdp.ConsumeString(20),fdp.ConsumeBytes(20),\n        fdp.ConsumeString(20),fdp.ConsumeInt(8),\n        fdp.ConsumeString(20),fdp.ConsumeFloat(),\n        fdp.ConsumeString(20),fdp.ConsumeBool(),\n    )\n\n    parse_info(fdp.ConsumeString(20))\n    parse_info(fdp.ConsumeUnicode(20))\n    parse_info(fdp.ConsumeBytes(20))\n    parse_info(response_str)\n\n    cid = CaseInsensitiveDict({\n        fdp.ConsumeString(10):fdp.ConsumeUnicode(10),\n        fdp.ConsumeString(10):fdp.ConsumeBytes(10),\n        fdp.ConsumeString(10):fdp.ConsumeInt(8),\n        fdp.ConsumeString(10):fdp.ConsumeFloat(),\n        fdp.ConsumeString(10):fdp.ConsumeBool()\n    })\n    fdp.ConsumeString(10) in cid\n    cid.popitem()\n    cid.get(fdp.ConsumeString(10))\n    cid[fdp.ConsumeString(10)] = fdp.ConsumeString(5)\n    cid.update({\n        fdp.ConsumeString(10):fdp.ConsumeUnicode(10),\n        fdp.ConsumeString(10):fdp.ConsumeBytes(10),\n        fdp.ConsumeString(10):fdp.ConsumeInt(8),\n        fdp.ConsumeString(10):fdp.ConsumeFloat(),\n        fdp.ConsumeString(10):fdp.ConsumeBool() \n    })\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/redis-py/fuzz_helper.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from redis.commands.helpers import *\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    temp_list = [\n        fdp.ConsumeString(10),\n        fdp.ConsumeUnicode(10),\n        fdp.ConsumeBytes(10)\n    ]\n\n    temp_dict_list = [\n        [fdp.ConsumeString(10),fdp.ConsumeUnicode(10)],\n        [fdp.ConsumeString(10),fdp.ConsumeBytes(10)],\n        [\n            fdp.ConsumeString(10),\n            [\n                fdp.ConsumeString(10),\n                fdp.ConsumeUnicode(10),\n                fdp.ConsumeString(10),\n                fdp.ConsumeBytes(10),\n                fdp.ConsumeString(10),\n                [\n                     fdp.ConsumeString(10),fdp.ConsumeInt(8),\n                     fdp.ConsumeString(10),fdp.ConsumeFloat()\n                ],\n                [fdp.ConsumeString(10),fdp.ConsumeBool()]\n            ]\n        ]\n    ]\n\n    temp_list = list_or_args(fdp.ConsumeString(10),temp_list)\n    temp_list = list_or_args(fdp.ConsumeUnicode(10),temp_list)\n    temp_list = list_or_args(fdp.ConsumeBytes(10),temp_list)\n    temp_list = list_or_args([fdp.ConsumeString(10)],temp_list)\n    temp_list = list_or_args([fdp.ConsumeUnicode(10)],temp_list)\n    temp_list = list_or_args([fdp.ConsumeBytes(10)],temp_list)\n\n    delist(temp_list)\n    parse_to_list(temp_list)\n\n    temp_dict = parse_to_dict(temp_dict_list)\n    decode_dict_keys(temp_dict)\n\n    nativestr(fdp.ConsumeString(10))\n    nativestr(fdp.ConsumeUnicode(10))\n    nativestr(fdp.ConsumeBytes(10))\n    random_string(fdp.ConsumeInt(8))\n    quote_string(fdp.ConsumeString(20))\n    stringify_param_value(fdp.ConsumeString(10))\n    stringify_param_value(fdp.ConsumeUnicode(10))\n    stringify_param_value(fdp.ConsumeBytes(10))\n    stringify_param_value(temp_list)\n    stringify_param_value(temp_dict)\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/redis-py/fuzz_util.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from redis.utils import *\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    safe_str(fdp.ConsumeString(50))\n    safe_str(fdp.ConsumeUnicode(50))\n    safe_str(fdp.ConsumeBytes(50))\n    safe_str(fdp.ConsumeInt(8))\n    safe_str(fdp.ConsumeFloat())\n    safe_str(fdp.ConsumeBool())\n\n    dict1={\n        fdp.ConsumeString(10):fdp.ConsumeUnicode(10),\n        fdp.ConsumeString(10):fdp.ConsumeBytes(10),\n        fdp.ConsumeString(10):fdp.ConsumeString(10),\n    }\n\n    merge_result(fdp.ConsumeString(50),dict1)\n    merge_result(fdp.ConsumeString(50),dict())\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/redis-py/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/redis/redis-py\nlanguage: python\nmain_repo: https://github.com/redis/redis-py\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/redis-rs/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust as builder\n\nRUN git clone --depth 1 https://github.com/redis-rs/redis-rs.git\nCOPY build.sh $SRC/\nCOPY /fuzz $SRC/redis-rs/fuzz"
  },
  {
    "path": "projects/redis-rs/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\ncd $SRC/redis-rs/fuzz\ncargo fuzz build\ncp $SRC/redis-rs/fuzz/target/x86_64-unknown-linux-gnu/release/parser $OUT/"
  },
  {
    "path": "projects/redis-rs/fuzz/Cargo.toml",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n[package]\nname = \"redis-fuzz\"\nversion = \"0.0.0\"\nauthors = [\"Automatically generated\"]\npublish = false\nedition = \"2018\"\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies]\nlibfuzzer-sys = \"0.4\"\n\n[dependencies.redis]\npath = \"../redis\"\n\n# Prevent this from interfering with workspaces\n[workspace]\nmembers = [\".\"]\n\n[[bin]]\nname = \"parser\"\npath = \"fuzz_targets/parser.rs\"\ntest = false\ndoc = false\n"
  },
  {
    "path": "projects/redis-rs/fuzz/fuzz_targets/parser.rs",
    "content": "/*\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n*/\n#![no_main]\nuse libfuzzer_sys::fuzz_target;\n\nuse redis::parse_redis_value;\n\nfuzz_target!(|data: &[u8]| {\n    let _ = parse_redis_value(data);\n});\n"
  },
  {
    "path": "projects/redis-rs/project.yaml",
    "content": "homepage: \"https://github.com/redis-rs/redis-rs\"\nlanguage: rust\nprimary_contact: \"armin.ronacher@active-4.com\"\nauto_ccs:\n  - \"armin.ronacher@active-4.com\"\n  - \"g@leirbag.net\"\n  - \"djc.ochtman@gmail.com\"\n  - \"mail@bargen.dev\"\n  - \"bonet@hey.com\"\n  - \"XWraithanX@gmail.com\"\n  - \"jamesmlucas@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/redis-rs/redis-rs'\n"
  },
  {
    "path": "projects/redux/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\nRUN  git clone --depth 1 https://github.com/reduxjs/redux.git\n\nCOPY fuzz.js $SRC/redux\n\nWORKDIR $SRC/redux\n"
  },
  {
    "path": "projects/redux/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm run build\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer redux fuzz.js -i redux --sync\n"
  },
  {
    "path": "projects/redux/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core')\nconst {\n  bindActionCreators,\n  createStore,\n  applyMiddleware,\n  combineReducers,\n  compose\n} = require('redux')\n\nmodule.exports.fuzz = function(data) {\n  try {\n    const provider = new FuzzedDataProvider(data)\n\n    const reducer1 = (state = { count: 0 }, action) => {\n      switch (action.type) {\n        case 'INCREMENT':\n          return { ...state, count: (state.count || 0) + 1 }\n        case 'DECREMENT':\n          return { ...state, count: (state.count || 0) - 1 }\n        case 'SET_COUNT':\n          return { ...state, count: action.payload }\n        default:\n          return state\n      }\n    }\n\n    const reducer2 = (state = { count: 0 }, action) => {\n      switch (action.type) {\n        case 'ADD':\n          return { ...state, total: (state.total || 0) + action.payload }\n        case 'SUBTRACT':\n          return { ...state, total: (state.total || 0) - action.payload }\n        case 'SET_TOTAL':\n          return { ...state, total: action.payload }\n        default:\n          return state\n      }\n    }\n\n    const actionCreator = () => ({\n      type: 'ADD_TODO',\n      payload: {\n        id: provider.consumeIntegral(4, true),\n        text: provider.consumeString(10),\n        completed: provider.consumeBoolean()\n      }\n    })\n\n    const dispatch = () => { }\n\n    bindActionCreators(actionCreator, dispatch)\n\n    const preloadedState = {}\n    preloadedState.reducer1 = provider.consumeBoolean()\n      ? { count: provider.consumeIntegral(4, true) }\n      : undefined\n    preloadedState.reducer2 = provider.consumeBoolean()\n      ? { count: provider.consumeIntegral(4, true) }\n      : undefined\n\n    const middleware = _store => next => action => {\n      if (provider.consumeBoolean()) {\n        return next(action)\n      } else {\n        return loggerMiddleware\n      }\n    }\n\n    const enhancer = provider.consumeBoolean()\n      ? applyMiddleware(middleware)\n      : undefined\n\n    const store = createStore(\n      combineReducers({ reducer1, reducer2 }),\n      preloadedState,\n      enhancer\n    )\n\n    const actionTypes = [\n      'INCREMENT',\n      'DECREMENT',\n      'SET_COUNT',\n      'ADD',\n      'SUBTRACT',\n      'SET_TOTAL'\n    ]\n    const actionType =\n      actionTypes[Math.floor(Math.random() * actionTypes.length)]\n\n    const actionPayload = provider.consumeBoolean()\n      ? { payload: provider.consumeIntegral(4, true) }\n      : undefined\n\n    const action = { type: actionType, ...actionPayload }\n\n    store.dispatch(action)\n\n    const callback = () => { }\n\n    store.subscribe(callback)\n\n    const reducer3 = (state = { count: 0 }, action) => {\n      switch (action.type) {\n        case 'MULTIPLY':\n          return { ...state, total: (state.total || 0) * action.payload }\n        case 'DIVIDE':\n          return { ...state, total: (state.total || 0) / action.payload }\n        default:\n          return state\n      }\n    }\n\n    combineReducers({ reducer1, reducer2, reducer3 })\n\n    const func1 = () => { }\n    const func2 = () => { }\n    const func3 = () => { }\n\n    const funcs = [func1, func2, func3]\n\n    compose(...funcs)\n  } catch (error) {\n    if (!ignoredError(error)) throw error\n  }\n}\n\nfunction ignoredError(error) {\n  return !!ignored.find(message => error.message.indexOf(message) !== -1)\n}\n\nconst ignored = []\n\nfunction loggerMiddleware(_store) {\n  return function(next) {\n    return function(action) {\n      const result = next(action)\n      return result\n    }\n  }\n}\n\n"
  },
  {
    "path": "projects/redux/project.yaml",
    "content": "homepage: https://redux.js.org/\nlanguage: javascript\nmain_repo: https://github.com/reduxjs/redux\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/reflections/ConfigurationBuilderFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.reflections.util.ConfigurationBuilder;\nimport org.reflections.scanners.Scanners;\nimport org.reflections.util.ClasspathHelper;\nimport org.reflections.util.FilterBuilder;\n\npublic class ConfigurationBuilderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        ConfigurationBuilder config = ConfigurationBuilder.build(data.consumeString(20));\n        ClasspathHelper.forPackage(data.consumeString(20));\n        new FilterBuilder().includePackage(data.consumeRemainingAsString());\n        config.getUrls();\n        config.getInputsFilter();\n        config.getScanners();\n    }\n    catch (org.reflections.ReflectionsException e) {}\n  }\n}\n"
  },
  {
    "path": "projects/reflections/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-17-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/ronmamo/reflections.git reflections\nWORKDIR reflections\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/reflections/FilterBuilderFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.reflections.util.FilterBuilder;\n\npublic class FilterBuilderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        FilterBuilder.parsePackages(data.consumeRemainingAsString());\n    }\n    catch (java.lang.StringIndexOutOfBoundsException e) {}\n    catch (org.reflections.ReflectionsException e) {}\n  }\n}"
  },
  {
    "path": "projects/reflections/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./ -name \"reflections-$CURRENT_VERSION.jar\" -exec mv {} $OUT/reflections.jar \\;\nALL_JARS=\"reflections.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/reflections/project.yaml",
    "content": "homepage: \"https://github.com/ronmamo/reflections\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/ronmamo/reflections.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/rekor/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/sigstore/rekor\nRUN git clone --depth=1 https://github.com/AdamKorcz/instrumentation\nRUN git clone --depth=1 https://github.com/sassoftware/relic\nCOPY build.sh $SRC\nWORKDIR $SRC/rekor/pkg\n"
  },
  {
    "path": "projects/rekor/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXX=\"${CXX} -lresolv\"\n\n$SRC/rekor/tests/oss_fuzz.sh\n"
  },
  {
    "path": "projects/rekor/project.yaml",
    "content": "homepage: \"https://sigstore.dev\"\nmain_repo: \"https://github.com/sigstore/rekor\"\nprimary_contact: \"bcallaway@sigstore.dev\"\nauto_ccs:\n  - lhinds@sigstore.dev\n  - hblauzvern@sigstore.dev\n  - codysoyland@sigstore.dev\n  - adam@adalogics.com\n  - david@adalogics.com\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/relic/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget python\nRUN git clone --depth 1 https://github.com/relic-toolkit/relic.git\nRUN git clone --depth 1 --branch 3.8.1 https://github.com/randombit/botan.git\nRUN git clone --depth 1 https://github.com/MozillaSecurity/cryptofuzz\nRUN wget https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2\nCOPY run_tests.sh build.sh $SRC/\n# This is to fix Fuzz Introspector build by using LLVM old pass manager\n# re https://github.com/ossf/fuzz-introspector/issues/305\nENV OLD_LLVMPASS 1\n"
  },
  {
    "path": "projects/relic/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -Wno-deprecated-literal-operator\"\nexport LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\"\n\n# Install Boost headers\ncd $SRC/\ntar jxf boost_1_84_0.tar.bz2\ncd boost_1_84_0/\nCFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\nCFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\ncp -R boost/ /usr/include/\n\n# Build Relic\ncd $SRC/relic/\nmkdir build/\ncd build/\nif [[ $CFLAGS = *-m32* ]]\nthen\n    export RELIC_ARCH=\"X86\"\nelse\n    export RELIC_ARCH=\"X64\"\nfi\ncmake .. -DCOMP=\"$CFLAGS\" -DQUIET=on -DRAND=CALL -DSHLIB=off -DSTBIN=off -DTESTS=1 -DBENCH=0 -DALLOC=DYNAMIC -DARCH=$RELIC_ARCH\nmake -j$(nproc)\ncd ../..\nexport RELIC_PATH=$(realpath relic)\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_RELIC\"\n\n# Build Botan\ncd $SRC/botan\nif [[ $CFLAGS != *-m32* ]]\nthen\n    ./configure.py --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\nelse\n    ./configure.py --cpu=x86_32 --cc-bin=$CXX --cc-abi-flags=\"$CXXFLAGS\" --disable-shared --disable-modules=locking_allocator --build-targets=static --without-documentation\nfi\nmake -j$(nproc)\n\nexport CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_BOTAN -DCRYPTOFUZZ_BOTAN_IS_ORACLE\"\nexport LIBBOTAN_A_PATH=\"$SRC/botan/libbotan-3.a\"\nexport BOTAN_INCLUDE_PATH=\"$SRC/botan/build/include\"\n\n# Build Cryptofuzz\ncd $SRC/cryptofuzz\n# Fix Botan exception types removed in Botan 3.7.0+\nsed -i 's/::Botan::Invalid_Argument&\\?/std::exception/g' modules/botan/bn_ops.cpp\nsed -i 's/::Botan::Invalid_State&\\?/std::exception/g' modules/botan/bn_ops.cpp\nsed -i 's/::Botan::Encoding_Error&\\?/std::exception/g' modules/botan/bn_ops.cpp\n\npython gen_repository.py\nrm extra_options.h\necho -n '\"' >>extra_options.h\necho -n '--force-module=relic ' >>extra_options.h\necho -n '--operations=BignumCalc,ECC_PrivateToPublic,ECC_ValidatePubkey,ECDSA_Sign,ECDSA_Verify,Digest,HMAC,KDF_X963,SymmetricEncrypt,SymmetricDecrypt,ECC_Point_Add,ECC_Point_Mul,ECC_Point_Dbl,ECC_Point_Neg ' >>extra_options.h\necho -n '--curves=secp256k1,secp256r1 ' >>extra_options.h\necho -n '--digests=NULL,SHA224,SHA256,SHA384,SHA512,BLAKE2S160,BLAKE2S256 ' >>extra_options.h\necho -n '--ciphers=AES_128_CBC,AES_192_CBC,AES_256_CBC ' >>extra_options.h\necho -n '--calcops=Abs,Add,Bit,ClearBit,Cmp,CmpAbs,Div,ExpMod,GCD,InvMod,IsEven,IsOdd,IsZero,Jacobi,LCM,LShift1,Mod,Mul,Neg,NumBits,RShift,SetBit,Sqr,Sqrt,Sub ' >>extra_options.h\necho -n '\"' >>extra_options.h\ncd modules/relic/\nmake -B -j$(nproc)\ncd ../botan/\nmake -B -j$(nproc)\ncd ../../\nmake -B -j$(nproc)\n\ncp cryptofuzz $OUT/cryptofuzz-relic\n"
  },
  {
    "path": "projects/relic/project.yaml",
    "content": "homepage: \"https://github.com/relic-toolkit/relic\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://github.com/relic-toolkit/relic\"\nauto_ccs:\n    - \"dfaranha@gmail.com\"\nsanitizers:\n - address\n - undefined\narchitectures:\n - x86_64\n - i386\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/relic/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer and run unit test\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nctest --test-dir $SRC/relic/build/ -j$(nproc)\n"
  },
  {
    "path": "projects/reload4j/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/qos-ch/reload4j\nCOPY remove-jdk8-cap.diff $SRC/\nRUN  cd reload4j && (for i in ${SRC}/remove-jdk8-cap.diff; do tr -d '\\015' < $i | git apply; done )\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/reload4j"
  },
  {
    "path": "projects/reload4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMVN_FLAGS=\"-Dmaven.compiler.source=15 -Dmaven.compiler.target=15 -DskipTests -Djdk.version=15\"\nALL_JARS=\"\"\n\n# install the build servers' jazzer-api into the maven repository\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/reload4j\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd ${SRC}\n\t${MVN} package -Dreload4jVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/reload4j-fuzzer-${CURRENT_VERSION}.jar ${OUT}/reload4j-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} reload4j-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n  stripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n  # the .java was stripped by sed\n  if (echo ${stripped_path} | grep \".java$\"); then\n\tcontinue;\n  fi\n\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  fuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n  chmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/reload4j/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>reload4j-fuzzer</artifactId>\n\t<version>${reload4jVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<exec.mainClass>ossfuzz.ASTFuzzer</exec.mainClass>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\ton the CI, install the jazzer file with\n\t\t\n\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t-Dpackaging=jar\n\t\t\n\t\tto avoid mismatching driver/api versions\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>ch.qos.reload4j</groupId>\n\t\t\t<artifactId>reload4j</artifactId>\n\t\t\t<version>${reload4jVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/reload4j/project.yaml",
    "content": "homepage: \"https://reload4j.qos.ch\"\nlanguage: jvm\nmain_repo: \"https://github.com/qos-ch/reload4j.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/reload4j/remove-jdk8-cap.diff",
    "content": "--- a/pom.xml\n+++ b/pom.xml\n@@ -470,26 +470,6 @@\n             </plugin>\n           </plugins>\n         </pluginManagement>\n-        <plugins>\n-          <plugin>\n-            <groupId>org.apache.maven.plugins</groupId>\n-            <artifactId>maven-toolchains-plugin</artifactId>\n-            <executions>\n-              <execution>\n-                <goals>\n-                  <goal>toolchain</goal>\n-                </goals>\n-              </execution>\n-            </executions>\n-            <configuration>\n-              <toolchains>\n-                <jdk>\n-                  <version>[1.5, 8]</version>\n-                </jdk>\n-              </toolchains>\n-            </configuration>\n-          </plugin>\n-        </plugins>\n       </build>\n     </profile>\n   </profiles>\n"
  },
  {
    "path": "projects/reload4j/src/main/java/ossfuzz/LoggerFuzzer.java",
    "content": "package ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.log4j.*;\n\npublic class LoggerFuzzer {\n\tprotected String m_fqcn;\n\tprotected Level m_level;\n\tprotected String m_diagnostic;\n\tprotected Exception m_throwable;\n\tprotected String m_key;\n\tprotected Object[] m_params;\n\n\tLoggerFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tint n = fuzzedDataProvider.consumeInt(0, 10);\n\t\tm_params = new Object[n];\n\t\tfor(int i=0; i<n; ++i) {\n\t\t\tswitch(fuzzedDataProvider.consumeInt(0,3)) {\n\t\t\t\tcase 0:\n\t\t\t\t\tm_params[i] = new Integer(fuzzedDataProvider.consumeInt());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tm_params[i] = new Double(fuzzedDataProvider.consumeDouble());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tm_params[i] = new String(fuzzedDataProvider.consumeString(16));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tm_fqcn = fuzzedDataProvider.consumeString(16);\n\t\tm_key  = fuzzedDataProvider.consumeString(16);\n\t\tm_level = Level.toLevel(fuzzedDataProvider.consumeInt());\n\t\tm_diagnostic = fuzzedDataProvider.consumeRemainingAsString();\n\t\tm_throwable = new NullPointerException();\n\t}\n\n\tvoid test() {\n\t\tLogger logger = Logger.getLogger(LoggerFuzzer.class);\n\n\t\tlogger.addAppender(new MyAppender());\n\t\t\n\t\t/*\n\t\t * the popular ones\n\t\t */\n\t\tlogger.debug(m_diagnostic);\n\t\tlogger.error(m_diagnostic);\n\t\tlogger.fatal(m_diagnostic);\n\t\tlogger.info(m_diagnostic);\n\t\tlogger.trace(m_diagnostic);\n\n\t\t/*\n         * not so popular\n\t\t */\n\t\t logger.log(m_level, m_diagnostic);\n\t\t logger.log(m_fqcn, m_level, m_diagnostic, m_throwable);\n\t\t logger.l7dlog(m_level, m_key, m_throwable);\n\t\t logger.l7dlog(m_level, m_key, m_params, m_throwable);\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\t\tLoggerFuzzer testClosure = new LoggerFuzzer(fuzzedDataProvider);\n\t\ttestClosure.test();\n\t\t\n\t\t\n\t}\n}"
  },
  {
    "path": "projects/reload4j/src/main/java/ossfuzz/MyAppender.java",
    "content": "package ossfuzz;\n\nimport org.apache.log4j.AppenderSkeleton;\nimport org.apache.log4j.spi.LoggingEvent;\n\npublic class MyAppender extends AppenderSkeleton {\n\tpublic MyAppender() {\n\t}\n\n\t@Override\n\tpublic void append(LoggingEvent event) {\n\t\t//System.out.println(event.getRenderedMessage());\n\t}\n\t@Override\n\tpublic synchronized void close() {\n\t\tif (this.closed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.closed = true;\n\t}\n\t\n\t@Override\n    public boolean requiresLayout() {\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "projects/requests/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone --depth 1 --branch main https://github.com/psf/requests.git requests \\\n    && python3 -m pip install --upgrade pip \\\n    && python3 -m pip install 'setuptools~=69.0' 'pyinstaller~=6.0' 'requests-mock~=1.0';\n\nRUN mkdir -p $SRC/seed_data \\\n    && git clone --depth 1 https://github.com/DaveLak/oss-fuzz-inputs.git oss-fuzz-inputs \\\n    && rsync -avc oss-fuzz-inputs/requests/ $SRC/seed_data/ \\\n    && rm -rf oss-fuzz-inputs;\n\nRUN git clone --depth 1 https://github.com/google/fuzzing fuzzing \\\n    && cat fuzzing/dictionaries/http.dict \\\n        fuzzing/dictionaries/url.dict \\\n      >> $SRC/seed_data/__base.dict \\\n    && rm -rf fuzzing;\n\nCOPY build.sh *.py $SRC/\nWORKDIR $SRC/requests\n"
  },
  {
    "path": "projects/requests/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Directory to look in for dictionaries, options files, and seed corpa:\nSEED_DATA_DIR=\"$SRC/seed_data\"\n\n# Help Fuzz Introspector find the package entrypoint.\n# See https://github.com/ossf/fuzz-introspector/issues/1010\nexport PYFUZZPACKAGE=\"$SRC/requests/src/requests\"\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npython3 -m pip install .\n\nfind $SEED_DATA_DIR \\( -name '*_seed_corpus.zip' -o -name '*.options' -o -name '*.dict' \\) \\\n  ! \\( -name '__base.*' \\) -exec printf 'Copying: %s\\n' {} \\; \\\n  -exec chmod a-x {} \\; \\\n  -exec cp {} \"$OUT\" \\;\n\nfind \"$SRC\" -maxdepth 1 -name 'fuzz_*.py' -print0 | while IFS= read -r -d $'\\0' fuzz_harness; do\n  compile_python_fuzzer \"$fuzz_harness\"\n\n  common_base_dictionary_filename=\"$SEED_DATA_DIR/__base.dict\"\n  if [[ -r \"$common_base_dictionary_filename\" ]]; then\n    # Strip the `.py` extension from the filename and replace it with `.dict`.\n    fuzz_harness_dictionary_filename=\"$(basename \"$fuzz_harness\" .py).dict\"\n\n    printf 'Appending %s to %s\\n' \"$common_base_dictionary_filename\" \"$OUT/$fuzz_harness_dictionary_filename\"\n    cat \"$common_base_dictionary_filename\" >> \"$OUT/$fuzz_harness_dictionary_filename\"\n  fi\ndone\n"
  },
  {
    "path": "projects/requests/fuzz_requests.py",
    "content": "#!/usr/bin/python3\n#\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nimport atheris\nimport sys\n\n# urllib3 slows down the initial startup and analysis phases of fuzz target runs\n# because of how it is imported in requests.compat so it is excluded here.\nwith atheris.instrument_imports(\n    exclude=['urllib3', 'urllib3.util', 'urllib.parse', 'urllib.request']):\n  import requests_mock\n  import requests\n  from requests.auth import HTTPDigestAuth\n  from requests.cookies import cookiejar_from_dict, CookieConflictError\n  from requests.exceptions import RequestException\n\n\ndef is_expected_error(error_content_list, error_msg):\n  for error in error_content_list:\n    if error in error_msg:\n      return True\n  return False\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  http_methods = ['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'PATCH']\n\n  try:\n    cookie_jar = cookiejar_from_dict({\n        fdp.ConsumeString(10): fdp.ConsumeString(20)\n        for _ in range(fdp.ConsumeIntInRange(1, 3))\n    })\n  except CookieConflictError:\n    return -1\n\n  try:\n    with requests_mock.Mocker() as global_mock:\n      global_mock.request(method=requests_mock.ANY,\n                          url=requests_mock.ANY,\n                          status_code=fdp.ConsumeIntInRange(0, 599),\n                          reason=fdp.ConsumeString(fdp.ConsumeIntInRange(\n                              0, 100)),\n                          text=fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100)),\n                          headers={\n                              fdp.ConsumeString(10): fdp.ConsumeString(20)\n                              for _ in range(fdp.ConsumeIntInRange(1, 3))\n                          },\n                          cookies={\n                              fdp.ConsumeString(10): fdp.ConsumeString(20)\n                              for _ in range(fdp.ConsumeIntInRange(1, 3))\n                          })\n\n      r1 = requests.request(\n          fdp.PickValueInList(http_methods),\n          url=fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100)),\n          allow_redirects=fdp.ConsumeBool(),\n          auth=HTTPDigestAuth(fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100)),\n                              fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100))),\n          params=fdp.ConsumeBytes(fdp.ConsumeIntInRange(1, 512)),\n          timeout=fdp.ConsumeFloatInRange(0.1, 5.0),\n          headers={\n              fdp.ConsumeString(10): fdp.ConsumeString(20)\n              for _ in range(fdp.ConsumeIntInRange(1, 3))\n          },\n          cookies=cookie_jar)\n      _ = r1.status_code\n      _ = r1.reason\n      _ = r1.headers\n      _ = r1.cookies\n      _ = r1.encoding\n      _ = r1.text\n      r1.close()\n\n      s = requests.Session()\n      s.auth = (fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100)),\n                fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100)))\n      s.headers.update({\n          fdp.ConsumeString(10): fdp.ConsumeString(20)\n          for _ in range(fdp.ConsumeIntInRange(1, 5))\n      })\n\n      proxies = {\n          'http': fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100)),\n          'https': fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100)),\n      }\n      s.proxies.update(proxies)\n\n      custom_method = fdp.ConsumeString(fdp.ConsumeIntInRange(0, 20))\n      url_with_port = f\"'https://'{fdp.ConsumeString(fdp.ConsumeIntInRange(0, 100))}:{fdp.ConsumeIntInRange(0, 10000)}/\"\n      req = requests.Request(custom_method,\n                             url=url_with_port,\n                             data=fdp.ConsumeBytes(\n                                 fdp.ConsumeIntInRange(1, 1024)))\n      prepped_request = req.prepare()\n\n      with requests_mock.Mocker(session=s) as session_mock:\n        session_mock.request(method=requests_mock.ANY,\n                             url=requests_mock.ANY,\n                             status_code=fdp.ConsumeIntInRange(0, 599),\n                             content=fdp.ConsumeBytes(\n                                 fdp.ConsumeIntInRange(0, sys.maxsize)))\n        r2 = s.send(prepped_request)\n        _ = r2.content\n        r2.close()\n  except (RequestException, ValueError) as e:\n    expected_error_message_content = [\"Invalid IPV4 URL\", \"Invalid IPV6 URL\"]\n    if (isinstance(e, RequestException) or (isinstance(e, ValueError)) and\n        is_expected_error(expected_error_message_content, str(e))):\n      return -1\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/requests/project.yaml",
    "content": "auto_ccs:\n- david@adalogics.com\nfuzzing_engines:\n- libfuzzer\nhomepage: https://requests.readthedocs.io/en/master/\nlanguage: python\nmain_repo: https://github.com/psf/requests.git\nprimary_contact: p.antoine@catenacyber.fr\nsanitizers:\n- address\n- undefined\n"
  },
  {
    "path": "projects/resiprocate/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake ninja-build pkg-config libfmt-dev\nRUN git clone --depth 1 --single-branch --branch master https://github.com/resiprocate/resiprocate.git resiprocate\nWORKDIR resiprocate\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/resiprocate/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbuild/oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/resiprocate/project.yaml",
    "content": "homepage: \"https://www.resiprocate.org/\"\nlanguage: c++\nprimary_contact: \"gjasny@googlemail.com\"\nmain_repo: 'https://github.com/resiprocate/resiprocate.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/retrofit/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN apt update && apt install -y default-jdk\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\nRUN cat fuzzing/dictionaries/http.dict \\\n      > $SRC/RequestFuzzer.dict\n\nRUN cat fuzzing/dictionaries/url.dict \\\n      > $SRC/PathTraversalFuzzer.dict\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/RequestFuzzer_seed_corpus.zip go-fuzz-corpus/httpreq/corpus/* && \\\n    zip -q $SRC/PathTraversalFuzzer_seed_corpus.zip go-fuzz-corpus/url/corpus/*\n\nRUN git clone --depth 1 https://github.com/square/retrofit.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nCOPY build.patch $SRC/retrofit\nWORKDIR $SRC/retrofit"
  },
  {
    "path": "projects/retrofit/PathTraversalFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage retrofit2;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport static retrofit2.TestingUtils.buildRequest;\n\nimport okhttp3.Request;\nimport okhttp3.Response;\nimport okhttp3.RequestBody;\nimport okhttp3.ResponseBody;\nimport retrofit2.http.GET;\nimport retrofit2.http.Path;\n\n\npublic class PathTraversalFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String str = data.consumeRemainingAsString();\n\n            class Example {\n                @GET(\"/foo/bar/{ping}/\")\n                Call<ResponseBody> method(@Path(\"ping\") String ping) {\n                    return null;\n                }\n            }\n\n        try {\n            Request request = buildRequest(Example.class, str);\n            assert request.method().equals(\"GET\") : new FuzzerSecurityIssueLow(\"Method is not GET\");\n            assert request.headers().size() == 0 : new FuzzerSecurityIssueLow(\"Headers are not zero\");\n\n            if (!request.url().toString().contains(\"bar\")) {\n                throw new FuzzerSecurityIssueLow(\"Path Traversal!\");\n            }\n        } catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {\n        }\n\n    }    \n}\n"
  },
  {
    "path": "projects/retrofit/RequestFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\npackage retrofit2;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.IOException;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Interceptor;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport okhttp3.ResponseBody;\nimport okhttp3.MediaType;\nimport retrofit2.Retrofit;\nimport retrofit2.Call;\nimport retrofit2.converter.gson.GsonConverterFactory;\nimport retrofit2.http.Body;\nimport retrofit2.http.POST;\n\npublic class RequestFuzzer {\n    interface CallMethod {\n        @POST(\"/\")\n        Call<ResponseBody> postRequestBody(@Body RequestBody body);\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String str = data.consumeString(500);\n        String str1 = data.consumeString(500);\n        String str2 = data.consumeString(500);\n        String str3 = data.consumeString(500);\n        String str4 = data.consumeString(500);\n        String str5 = data.consumeString(500);\n        String str6 = data.consumeRemainingAsString();\n\n        OkHttpClient httpClient = new OkHttpClient.Builder()\n                .addInterceptor(\n                        new Interceptor() {\n                            @Override\n                            public Response intercept(Chain chain) throws IOException {\n                                Request original = chain.request();\n                                RequestBody body = RequestBody.create(MediaType.parse(str), str1);\n                                Request request = original.newBuilder()\n                                        .header(str2, str3)\n                                        .header(str4, str5)\n                                        .method(original.method(), body)\n                                        .build();\n                                return chain.proceed(request);\n                            }\n                        })\n                .build();\n\n        Retrofit retrofit = null;\n        CallMethod service = null;\n\n        try {\n            retrofit = new Retrofit.Builder().baseUrl(\"http://localhost\").addConverterFactory(GsonConverterFactory.create()).client(httpClient).build();\n        } catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {\n        }\n\n        try {\n            service = retrofit.create(CallMethod.class);\n        } catch (NullPointerException e) {\n        }\n\n        try {\n            service.postRequestBody(RequestBody.create(MediaType.parse(str), str6)).execute();\n        } catch (IOException | RuntimeException e) {\n        }\n    }    \n}"
  },
  {
    "path": "projects/retrofit/build.patch",
    "content": "@@ -22,6 +22,7 @@\n   alias(libs.plugins.protobuf) apply false\n   alias(libs.plugins.animalsniffer) apply false\n   alias(libs.plugins.googleJavaFormat) apply false\n+  id 'com.github.johnrengelman.shadow' version '7.1.2'\n }\n \n subprojects {\n@@ -47,6 +48,7 @@\n   }\n \n   apply plugin: 'net.ltgt.errorprone'\n+  apply plugin: 'com.github.johnrengelman.shadow'\n \n   dependencies {\n     errorproneJavac libs.errorproneJavac\n"
  },
  {
    "path": "projects/retrofit/build.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nexport JAVA_HOME=\"$OUT/open-jdk-11\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\npatch build.gradle build.patch\n\n./gradlew shadowJar\n\ncp $SRC/retrofit/retrofit/build/libs/retrofit-2.10.0-SNAPSHOT-all.jar $OUT/retrofit.jar\ncp $SRC/retrofit/samples/build/libs/samples-all.jar $OUT/samples-all.jar\ncp $SRC/retrofit/retrofit/test-helpers/build/libs/test-helpers-all.jar $OUT/test-helpers-all.jar\n\nmkdir $OUT/retrofit2\n\nALL_JARS=\"retrofit.jar test-helpers-all.jar samples-all.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir:\"retrofit2\"\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 11\n  mv $SRC/[$fuzzer_basename]*.class $OUT/retrofit2\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-11/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=retrofit2.$fuzzer_basename \\\n-rss_limit_mb=0 \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/retrofit/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://square.github.io/retrofit/\"\nlanguage: jvm\nmain_repo: \"https://github.com/square/retrofit\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/retry/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/invl/retry\nWORKDIR retry\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/retry/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/retry/fuzz_retry.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n     from retry import *\n\nIS_ERROR = True\nERROR_MSG = \"TestingError\"\n\nclass TestingError(Exception):\n    def __init__(self, message):\n        super().__init__(message)\n\ndef error_method():\n    global IS_ERROR\n    IS_ERROR = not IS_ERROR\n\n    global ERROR_MSG\n\n    if IS_ERROR:\n        raise TestingError(ERROR_MSG)\n    else:\n       return\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    global IS_ERROR\n    IS_ERROR = fdp.ConsumeBool()\n\n    global ERROR_MSG\n    ERROR_MSG = fdp.ConsumeString(20)\n\n    try:\n        retry_call(error_method,logger=None)\n        retry_call(\n            error_method,\n            exceptions=TestingError,\n            tries=fdp.ConsumeIntInRange(-1,100),\n            delay=fdp.ConsumeIntInRange(1,10),\n            logger=None\n        )\n    except (TestingError, ValueError):\n        # Expected when retry limit is reached\n        pass\n\n    @retry(logger=None)\n    def wrapper_one():\n        error_method()\n\n    @retry(\n        ValueError,\n        tries=fdp.ConsumeIntInRange(-1,100),\n        delay=fdp.ConsumeIntInRange(1,10),\n        logger=None\n    )\n    def wrapper_two():\n        error_method()\n\n    try:\n        wrapper_one()\n        wrapper_two()\n    except (TestingError, ValueError):\n        # Expected when retry limit it reached\n        pass\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/retry/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/invl/retry\nlanguage: python\nmain_repo: https://github.com/invl/retry\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/rfc3967/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/python-hyper/rfc3986 rfc3986\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/rfc3986\n"
  },
  {
    "path": "projects/rfc3967/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/rfc3967/fuzz_rfc3986.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport rfc3986\n\n\ndef fuzz_parseresult(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    rfc3986.parseresult.ParseResult.from_string(\n        fdp.ConsumeUnicodeNoSurrogates(256))\n  except (rfc3986.exceptions.RFC3986Exception):\n    pass\n  try:\n    rfc3986.parseresult.ParseResultBytes.from_string(\n        fdp.ConsumeUnicodeNoSurrogates(256))\n  except (rfc3986.exceptions.RFC3986Exception):\n    pass\n\n\ndef fuzz_normalizers(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  rfc3986.normalizers.normalize_host(fdp.ConsumeUnicodeNoSurrogates(256))\n  rfc3986.normalizers.normalize_percent_characters(\n      fdp.ConsumeUnicodeNoSurrogates(256))\n  rfc3986.normalizers.normalize_scheme(fdp.ConsumeUnicodeNoSurrogates(256))\n\n\ndef fuzz_uri(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  uri = rfc3986.uri.URIReference.from_string(\n      fdp.ConsumeUnicodeNoSurrogates(256))\n  uri.is_valid()\n  uri.is_absolute()\n\n\ndef fuzz_iri(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  iri_ref = rfc3986.IRIReference.from_string(\n      fdp.ConsumeUnicodeNoSurrogates(256))\n\n\ndef fuzz_api(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  rfc3986.api.uri_reference(fdp.ConsumeUnicodeNoSurrogates(256))\n  rfc3986.api.iri_reference(fdp.ConsumeUnicodeNoSurrogates(256))\n  rfc3986.api.is_valid_uri(fdp.ConsumeUnicodeNoSurrogates(256))\n  rfc3986.api.normalize_uri(fdp.ConsumeUnicodeNoSurrogates(256))\n  rfc3986.api.urlparse(fdp.ConsumeUnicodeNoSurrogates(256))\n\n\ndef fuzz_validators(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  uri = rfc3986.uri.URIReference.from_string(\n      fdp.ConsumeUnicodeNoSurrogates(256))\n  if uri.is_valid():\n    validator = rfc3986.validators.Validator().forbid_use_of_password()\n    try:\n      validator.validate(uri)\n    except rfc3986.eceptions.RFC3986Exception:\n      pass\n\n    validator2 = rfc3986.validators.Validator()\n    try:\n      validator2.validate(uri)\n    except rfc3986.eceptions.RFC3986Exception:\n      pass\n\n    validator3 = rfc3986.validators.Validator()\n    validator3.allow_schemes(fdp.ConsumeUnicodeNoSurrogates(24))\n    validator3.allow_hosts(fdp.ConsumeUnicodeNoSurrogates(24))\n    validator3.allow_ports(str(fdp.ConsumeIntInRange(1, 65000)))\n    try:\n      validator3.require_presence_of(fdp.ConsumeUnicodeNoSurrogates(8))\n    except ValueError:\n      pass\n    try:\n      validator3.check_validity_of(fdp.ConsumeUnicodeNoSurrogates(24))\n    except ValueError:\n      pass\n    try:\n      validator3.validate(uri)\n    except rfc3986.exceptions.RFC3986Exception:\n      pass\n\n\ndef TestOneInput(data):\n  fuzz_parseresult(data)\n  fuzz_normalizers(data)\n  fuzz_uri(data)\n  fuzz_iri(data)\n  fuzz_api(data)\n  fuzz_validators(data)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/rfc3967/project.yaml",
    "content": "homepage: https://github.com/python-hyper/rfc3986\nmain_repo: https://github.com/python-hyper/rfc3986\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/rhai/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth 1 https://github.com/rhaiscript/rhai.git rhai\nRUN rustup update nightly\nWORKDIR rhai\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rhai/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncargo +nightly fuzz build -O --debug-assertions\n\nFUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n\nfind . -name '*.rhai' -exec zip $OUT/scripting_seed_corpus.zip {} \\;\ncp $OUT/scripting_seed_corpus.zip $OUT/ast_seed_corpus.zip\n"
  },
  {
    "path": "projects/rhai/project.yaml",
    "content": "homepage: \"rhai.rs\"\nlanguage: rust\nprimary_contact: \"rhaiscript@gmail.com\"\nmain_repo: \"https://github.com/rhaiscript/rhai.git\"\nauto_ccs:\n  - nathaniel.brough@gmail.com\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/rhino/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.6.3 && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven-3.6.3/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/mozilla/rhino.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/rhino"
  },
  {
    "path": "projects/rhino/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nGRADLE_FLAGS=\"-x javadoc -x test -Dfile.encoding=UTF-8\"\nMVN_FLAGS=\"\"\nALL_JARS=\"\"\nLIBRARY_NAME=\"rhino\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\n\npushd \"${SRC}/rhino\"\n\t./gradlew publishToMavenLocal ${GRADLE_FLAGS}\n\tCURRENT_VERSION=$(./gradlew properties --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\npopd\n\npushd \"${SRC}\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/rhino/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>rhino-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>2.7.0</fuzzedLibaryVersion>\n\t\t<exec.mainClass>ParserFuzzer</exec.mainClass>\n\t</properties>\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.mozilla</groupId>\n\t\t\t<artifactId>rhino</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/rhino/project.yaml",
    "content": "homepage: \"https://github.com/mozilla/rhino\"\nlanguage: jvm\nmain_repo: \"https://github.com/mozilla/rhino.git\"\nprimary_contact: \"ronaldbrill@googlemail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/rhino/src/main/java/ossfuzz/ParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.mozilla.javascript.Parser;\nimport java.io.*;\n\npublic class ParserFuzzer {\n\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic ParserFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\n\t}\n\n\tvoid test() throws IOException {\n\t\ttry {\n\t\t\tvar parser = new Parser();\n\t\t\tparser.parse(fuzzedDataProvider.consumeRemainingAsString(),\"\", 1);\n\n\t\t} catch (IllegalArgumentException e) {\n\n\t\t} catch (RuntimeException e ) {\n\n\t\t}\n\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) throws IOException {\n\n\t\tParserFuzzer loggingInterceptorFuzzer = new ParserFuzzer(fuzzedDataProvider);\n\t\tloggingInterceptorFuzzer.test();\n\t}\n}"
  },
  {
    "path": "projects/rich/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/Textualize/rich rich\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/rich\n"
  },
  {
    "path": "projects/rich/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/rich/fuzz_markdown.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport io\nimport sys\nimport atheris\n\nfrom rich.console import Console\nfrom rich.markdown import Markdown\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  markdown = Markdown(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  if markdown.parsed:\n    console = Console(width=80, file=io.StringIO(), color_system=\"truecolor\")\n    console.print(markdown)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/rich/project.yaml",
    "content": "homepage: https://github.com/Textualize/rich\nmain_repo: https://github.com/Textualize/rich\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ring/project.yaml",
    "content": "homepage: \"https://github.com/briansmith/ring\"\nprimary_contact: \"brian@briansmith.org\"\nmain_repo: \"https://github.com/briansmith/ring\"\nsanitizers:\n- address\n- memory\n- undefined\n"
  },
  {
    "path": "projects/rnp/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n    make \\\n    autoconf \\\n    automake \\\n    libtool \\\n    cmake \\\n    patchelf \\\n    libbz2-dev \\\n    zlib1g-dev \\\n    libjson-c-dev \\\n    build-essential \\\n    python \\\n    wget\n\nRUN git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/rnpgp/rnp.git rnp\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rnp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd \"$SRC\"\n\nwget -qO- https://botan.randombit.net/releases/Botan-3.4.0.tar.xz | tar xJ\ncd Botan-3.4.0\n# Botan 3.5.0 has compilation issue with deprecated Curve25519, so we should update to 3.6.0 once it is released.\n# That would require to add the following below:  | sed 's/curve25519/x25519/g'\nBOTAN_MODULES=$(<\"$SRC/rnp/ci/botan3-pqc-modules\" tr '\\n' ',')\n./configure.py --prefix=/usr --cc-bin=\"$CXX\" --cc-abi-flags=\"$CXXFLAGS\" \\\n               --unsafe-fuzzer-mode \\\n               --with-fuzzer-lib='FuzzingEngine' \\\n               --minimized-build \\\n               --disable-modules=locking_allocator \\\n               --enable-modules=\"$BOTAN_MODULES\"\nmake \"-j$(nproc)\"\nmake install\n\ncd \"$SRC\"\nmkdir fuzzing_corpus\n\ncd \"$SRC/rnp/src/tests/data\"\nfind . -type f -print0 | xargs -0 -I bob -- cp bob \"$SRC/fuzzing_corpus/\"\n\n# -DENABLE_SANITIZERS=0 because oss-fuzz will add the sanitizer flags in CFLAGS\n# See https://github.com/google/oss-fuzz/pull/4189 to explain CMAKE_C_LINK_EXECUTABLE\n\ncd \"$SRC\"\nmkdir rnp-build\ncd rnp-build\ncmake \\\n    -DENABLE_SANITIZERS=0 \\\n    -DENABLE_FUZZERS=1 \\\n    -DCMAKE_C_COMPILER=\"$CC\" \\\n    -DCMAKE_CXX_COMPILER=\"$CXX\" \\\n    -DCMAKE_C_LINK_EXECUTABLE=\"$CXX <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>\" \\\n    -DCMAKE_INSTALL_PREFIX=/usr \\\n    -DBUILD_SHARED_LIBS=on \\\n    -DBUILD_TESTING=off \\\n    -DENABLE_PQC=on \\\n    -DENABLE_CRYPTO_REFRESH=on \\\n    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\n    \"$SRC/rnp\"\nmake \"-j$(nproc)\"\n\nFUZZERS=$(find src/fuzzing -maxdepth 1 -type f -name \"fuzz_*\" -exec basename {} \\;)\nprintf \"Detected fuzzers: \\n%s\\n\" \"$FUZZERS\"\nfor f in $FUZZERS; do\n    cp \"src/fuzzing/$f\" \"${OUT}/\"\n    patchelf --set-rpath \"\\$ORIGIN/lib\" \"${OUT}/$f\" || echo \"patchelf failed with $?, ignoring.\"\n    zip -j -r \"${OUT}/${f}_seed_corpus.zip\" \"$SRC/fuzzing_corpus/\"\ndone\n\nmkdir -p \"${OUT}/lib\"\ncp src/lib/librnp.so.0 \"${OUT}/lib/\"\ncp /usr/lib/libbotan-3.so.* \"${OUT}/lib/\"\ncp /lib/x86_64-linux-gnu/libjson-c.so.* \"${OUT}/lib/\"\n"
  },
  {
    "path": "projects/rnp/project.yaml",
    "content": "homepage: \"https://www.rnpgp.com/\"\nlanguage: c++\nprimary_contact: \"tse@ribose.com\"\nauto_ccs:\n  - \"o.nickolay@gmail.com\"\n  - \"daniel.wyatt@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\n  - centipede\nmain_repo: 'https://github.com/rnpgp/rnp.git'\n"
  },
  {
    "path": "projects/roaring-bitmap/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/RoaringBitmap/RoaringBitmap RoaringBitmap\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/RoaringBitmap\n"
  },
  {
    "path": "projects/roaring-bitmap/RoaringBitmapFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.roaringbitmap.longlong.Roaring64Bitmap;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.roaringbitmap.longlong.Roaring64Bitmap] public static org.roaringbitmap.longlong.Roaring64Bitmap bitmapOf(long[])\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.roaringbitmap.longlong.Roaring64Bitmap] public void and(org.roaringbitmap.longlong.Roaring64Bitmap)\n// Target method: [org.roaringbitmap.longlong.Roaring64Bitmap] public void or(org.roaringbitmap.longlong.Roaring64Bitmap)\n// Target method: [org.roaringbitmap.longlong.Roaring64Bitmap] public void xor(org.roaringbitmap.longlong.Roaring64Bitmap)\npublic class RoaringBitmapFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Roaring64Bitmap bitmap1 = Roaring64Bitmap.bitmapOf(data.consumeLongs(data.consumeInt(1, 10)));\n    Roaring64Bitmap bitmap2 = Roaring64Bitmap.bitmapOf(data.consumeLongs(data.consumeInt(1, 10)));\n\n    switch (data.consumeInt(1, 3)) {\n      case 1:\n        bitmap1.and(bitmap2);\n        break;\n      case 2:\n        bitmap1.or(bitmap2);\n        break;\n      case 3:\n        bitmap1.xor(bitmap2);\n        break;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/roaring-bitmap/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n./gradlew clean :roaringbitmap:build -x test -x javadoc -x sources --no-daemon\n\nCURRENT_VERSION=$(./gradlew properties | grep ^version: | cut -d\" \" -f2)\n\ncp \"./roaringbitmap/build/libs/roaringbitmap-$CURRENT_VERSION.jar\" $OUT/roaring-bitmap.jar\n\nALL_JARS=\"roaring-bitmap.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/roaring-bitmap/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/RoaringBitmap/RoaringBitmap\nmain_repo: https://github.com/RoaringBitmap/RoaringBitmap\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nprimary_contact: \"daniel@lemire.me\"\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/rocksdb/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool gettext pkg-config build-essential zlib1g-dev libbz2-dev cmake ninja-build liblzma-dev libtool autoconf\nRUN git clone --depth 1 https://github.com/facebook/rocksdb\n\nWORKDIR $SRC/\n\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja && ninja install)\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rocksdb/build.sh",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"${CFLAGS} -DNDEBUG\"\nexport CXXFLAGS=\"${CXXFLAGS} -DNDEBUG -std=c++17\"\n\ncd $SRC/LPM\nexport PKG_CONFIG_PATH=$PWD:$PWD/external.protobuf/lib/pkgconfig/\nexport PATH=$PWD/external.protobuf/bin:$PATH\n\ncd $SRC/rocksdb\nexport FUZZ_ENV=ossfuzz\nexport CC=$CXX\nexport DISABLE_WARNING_AS_ERROR=1\nmake static_lib\n\ncd fuzz\nmake db_fuzzer\nmake db_map_fuzzer\n\ncp *_fuzzer $OUT/\n"
  },
  {
    "path": "projects/rocksdb/project.yaml",
    "content": "homepage: \"https://github.com/facebook/rocksdb\"\nprimary_contact: \"rocksdb.dev@gmail.com\"\nlanguage: c++\nvendor_ccs:\n  - \"oss-fuzz@fb.com\"\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"hmf@fb.com\"\n  - \"yaohway@fb.com\"\n  - \"axxu@fb.com\"\nsanitizers:\n  - \"address\"\nmain_repo: 'https://github.com/facebook/rocksdb'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/rome/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/xml.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XmlReaderFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/rometools/rome.git rome\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/rome\n"
  },
  {
    "path": "projects/rome/XmlReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport com.rometools.rome.io.XmlReader;\nimport com.rometools.rome.io.FeedException;\nimport com.rometools.rome.io.SyndFeedInput;\nimport com.rometools.rome.feed.synd.SyndFeed;\nimport java.lang.IllegalArgumentException;\n\npublic class XmlReaderFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    ByteArrayInputStream bais = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n    try{\n      SyndFeed feed = new SyndFeedInput().build(new XmlReader(bais));\n    }\n    catch( IOException | FeedException | IllegalArgumentException e){\n      return;\n    }\n  \n  }\n}\n"
  },
  {
    "path": "projects/rome/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true\n\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"rome/target/rome-$CURRENT_VERSION.jar\" $OUT/rome.jar\n\nALL_JARS=\"rome.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/rome/project.yaml",
    "content": "homepage: \"https://github.com/rometools/rome\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/rometools/rome.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/ron/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/ron-rs/ron ron\nWORKDIR ron\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/ron/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncargo fuzz build -O\nFUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/ron/project.yaml",
    "content": "homepage: \"https://github.com/ron-rs/ron\"\nlanguage: rust\nmain_repo: \"https://github.com/ron-rs/ron\"\nprimary_contact: \"juniper.tyree@gmail.com\"\nauto_ccs:\n - torkleyy@gmail.com\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/roughtime/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/cloudflare/roughtime.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/roughtime\n"
  },
  {
    "path": "projects/roughtime/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\n\ncompile_native_go_fuzzer   ./protocol  FuzzParseRequest     fuzz_parse_request\ncompile_native_go_fuzzer   ./protocol  FuzzVerifyReply      fuzz_verify_reply\n"
  },
  {
    "path": "projects/roughtime/project.yaml",
    "content": "homepage: \"https://developers.cloudflare.com/time-services/roughtime\"\nlanguage: go\nprimary_contact: \"armfazh@cloudflare.com\"\nauto_ccs:\n  - \"pkillarjun@protonmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/cloudflare/roughtime.git\"\n"
  },
  {
    "path": "projects/rtpproxy/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone https://github.com/sippy/rtpproxy\nRUN git -C rtpproxy submodule update --init --recursive\n\nCOPY build.sh $SRC/\n\nWORKDIR rtpproxy\n"
  },
  {
    "path": "projects/rtpproxy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# TODO(David): move this patch upstream\nif [ -f /usr/local/bin/clang-22 ]; then\n  echo \"Adjusting clang version\"\n  sed -i 's/CLANG_VER=18/CLANG_VER=22/g' ./scripts/fuzz/oss-fuzz-build.sh\nfi\nbash -x ./scripts/fuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/rtpproxy/project.yaml",
    "content": "homepage: \"https://rtpproxy.org/\"\nmain_repo: \"https://github.com/sippy/rtpproxy\"\nprimary_contact: \"sobomax@sippysoft.com\"\nlanguage: c\nauto_ccs:\n  - \"sobomax@gmail.com\"\nvendor_ccs:\n  - \"razvan@opensips.org\"\n  - \"liviu@opensips.org\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nfile_github_issue: True\n"
  },
  {
    "path": "projects/ruby/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n    libssl-dev \\\n    libyaml-dev \\\n    zlib1g-dev \\\n    ruby \\\n    ruby-dev \\\n    autoconf \\\n    automake \\\n    libtool \\\n    bison \\\n    wget\nRUN git clone --depth=1 --single-branch https://github.com/ruby/ruby $SRC/ruby\nCOPY *.sh *.cpp *.c *.options $SRC/\n"
  },
  {
    "path": "projects/ruby/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build Ruby from source with static linking\n# Strategy: Download latest stable Ruby, install it, then use as baseruby to build target Ruby\n\n# Step 1: Download and install latest stable Ruby release as baseruby\n# =====================================================================\necho \"Step 1: Installing latest Ruby release as baseruby...\"\n\nRUBY_VERSION=\"3.3.6\"  # Update this to latest stable version\nRUBY_DOWNLOAD_URL=\"https://cache.ruby-lang.org/pub/ruby/3.3/ruby-${RUBY_VERSION}.tar.gz\"\nBASERUBY_PREFIX=\"$WORK/baseruby\"\n\ncd \"$WORK\"\nif [ ! -f \"ruby-${RUBY_VERSION}.tar.gz\" ]; then\n    echo \"Downloading Ruby ${RUBY_VERSION}...\"\n    wget -q \"$RUBY_DOWNLOAD_URL\" -O \"ruby-${RUBY_VERSION}.tar.gz\"\n    tar xzf \"ruby-${RUBY_VERSION}.tar.gz\"\nfi\n\ncd \"ruby-${RUBY_VERSION}\"\n\n# Configure and build baseruby (without sanitizers for speed)\nif [ ! -f \"$BASERUBY_PREFIX/bin/ruby\" ]; then\n    echo \"Building baseruby ${RUBY_VERSION}...\"\n    ./configure \\\n        --prefix=\"$BASERUBY_PREFIX\" \\\n        --disable-install-doc \\\n        --disable-install-rdoc \\\n        --disable-jit-support \\\n        CFLAGS=\"-O2\" \\\n        CXXFLAGS=\"-O2\"\n    \n    make -j$(nproc)\n    make install\n    echo \"Baseruby installed to $BASERUBY_PREFIX\"\nfi\n\nexport BASERUBY=\"$BASERUBY_PREFIX/bin/ruby\"\nexport PATH=\"$BASERUBY_PREFIX/bin:$PATH\"\n$BASERUBY --version\n\n# Step 2: Build target Ruby from source with static linking\n# ===========================================================\necho \"\"\necho \"Step 2: Building target Ruby with static linking...\"\n\ncd \"$SRC/ruby\"\n\n# Clean any previous build\nmake distclean 2>/dev/null || true\n\n# Generate configure script using Ruby's autogen.sh\nif [ ! -f configure ]; then\n    echo \"Generating configure script...\"\n    ./autogen.sh\n    \n    # Copy config helpers from automake if they're missing\n    if [ ! -f tool/config.sub ]; then\n        echo \"Copying config.sub and config.guess...\"\n        cp -f /usr/share/misc/config.sub tool/config.sub || \\\n        cp -f /usr/share/automake-*/config.sub tool/config.sub || true\n        \n        cp -f /usr/share/misc/config.guess tool/config.guess || \\\n        cp -f /usr/share/automake-*/config.guess tool/config.guess || true\n        \n        chmod +x tool/config.sub tool/config.guess\n    fi\nfi\n\n# Configure target Ruby with static linking and sanitizers\necho \"Configuring target Ruby with static linking...\"\n\n# Use the OSS-Fuzz provided CFLAGS and CXXFLAGS which already contain\n# all necessary sanitizer flags from the build environment\n\n./configure \\\n    --prefix=\"$WORK/ruby-install\" \\\n    --disable-shared \\\n    --enable-static \\\n    --disable-install-doc \\\n    --disable-install-rdoc \\\n    --disable-install-capi \\\n    --with-static-linked-ext \\\n    --without-gmp \\\n    --disable-dtrace \\\n    --disable-jit-support \\\n    --with-baseruby=\"$BASERUBY\" \\\n    ac_cv_func_backtrace=no\n\n# Build Ruby static library\necho \"Building Ruby static library...\"\nmake -j$(nproc) V=1\n\n# Verify libruby-static.a exists\nif [ ! -f libruby-static.a ]; then\n    echo \"ERROR: libruby-static.a not found after build\"\n    ls -la\n    exit 1\nfi\n\necho \"libruby-static.a created successfully\"\n\n# Step 3: Set up paths for fuzzer builds\n# ========================================\nRUBY_BUILD_DIR=\"$SRC/ruby\"\nINC_RUBY=\"-I${RUBY_BUILD_DIR}/include -I${RUBY_BUILD_DIR}/.ext/include/x86_64-linux -I${RUBY_BUILD_DIR}\"\nLIBS_RUBY=\"${RUBY_BUILD_DIR}/libruby-static.a\"\n\necho \"\"\necho \"Ruby build complete!\"\necho \"Ruby include flags: $INC_RUBY\"\necho \"Ruby static library: $LIBS_RUBY\"\necho \"\"\n\n\n# Standard C++ fuzzers with common build pattern\nSTANDARD_FUZZERS=\"fuzz_regex\n                  fuzz_string\n                  fuzz_hash\n                  fuzz_bignum\n                  fuzz_array\n                  fuzz_iseq\n                  fuzz_pack\n                  fuzz_ruby_parser\n                  fuzz_prism\"\n\nfor fuzzer in $STANDARD_FUZZERS; do\n    echo \"Building ${fuzzer}...\"\n    \n    # Add Prism include path for fuzz_prism\n    EXTRA_INCLUDES=\"\"\n    if [ \"$fuzzer\" = \"fuzz_prism\" ]; then\n        EXTRA_INCLUDES=\"-I$RUBY_BUILD_DIR/prism\"\n    fi\n    \n    $CXX $CXXFLAGS $INC_RUBY $EXTRA_INCLUDES -c \"$SRC/${fuzzer}.cpp\" -o \"$WORK/${fuzzer}.o\"\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \"$WORK/${fuzzer}.o\" \\\n        $LIBS_RUBY -lm -lpthread -ldl -lcrypt -lz -o \"$OUT/${fuzzer}\"\ndone\n\n# Build json fuzzer seperately because it needs additional steps\necho \"Building fuzz_json...\"\nJSON_DIR=\"$RUBY_BUILD_DIR/ext/json\"\n\n# Compile JSON vendor code (fpconv for float conversion)\n$CC $CFLAGS $INC_RUBY -I\"$JSON_DIR\" \\\n    -c \"$JSON_DIR/vendor/fpconv.c\" -o \"$WORK/json_fpconv.o\"\n\n# Compile the self-contained JSON fuzzer (includes parser.c directly) as C\n$CC $CFLAGS $INC_RUBY -I\"$JSON_DIR\" -I\"$JSON_DIR/vendor\" -I\"$JSON_DIR/simd\" \\\n    -DHAVE_RB_ENC_INTERNED_STR -DHAVE_RB_HASH_BULK_INSERT -DHAVE_RB_HASH_NEW_CAPA \\\n    -DHAVE_RB_STR_TO_INTERNED_STR -DHAVE_STRNLEN \\\n    -c \"$SRC/fuzz_json.c\" -o \"$WORK/fuzz_json.o\"\n\n# Link json assets together\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \"$WORK/fuzz_json.o\" \"$WORK/json_fpconv.o\" \\\n    $LIBS_RUBY -lm -lpthread -ldl -lcrypt -lz -o \"$OUT/fuzz_json\"\n\n# create seeds\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n\techo \"skipping copora in CI\"\nelse\n\t# skip seeds in CI\n    find \"$SRC/ruby\" -type f -name '*.rb' | head -n 1000 | zip -@ \"$OUT/fuzz_ruby_parser_seed_corpus.zip\"\n    find \"$SRC/ruby\" -type f -name '*.rb' | head -n 1000 | zip -@ \"$OUT/fuzz_prism_seed_corpus.zip\"\n\tfind \"$SRC/ruby\" -type f -name '*.json' | head -n 100 | zip -@ \"$OUT/fuzz_json_seed_corpus.zip\"\nfi\n\n# Copy ruby.options to each fuzzer\nALL_FUZZERS=\"fuzz_regex fuzz_string fuzz_hash fuzz_bignum fuzz_array fuzz_iseq fuzz_pack fuzz_ruby_parser fuzz_prism fuzz_json\"\nfor fuzzer in $ALL_FUZZERS; do\n    cp \"$SRC/ruby.options\" \"$OUT/${fuzzer}.options\"\ndone\n"
  },
  {
    "path": "projects/ruby/fuzz_array.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's Array implementation (array.c)\n * \n * Purpose: Test array operations including creation, manipulation, sorting,\n * and iteration. Tests edge cases in memory management, element access,\n * and array-specific algorithms.\n * \n * Coverage:\n * - Element operations: push, pop, shift, unshift, insert, delete\n * - Access operations: [], []=, first, last, at, fetch\n * - Transformation: map, select, compact, flatten, reverse, sort\n * - Combining: concat, +, -, &, |\n * - Iteration: each, each_index, reverse_each\n * - Memory: Array growth/shrinkage, shared arrays\n */\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n\nstatic int ruby_initialized = 0;\n\nextern \"C\" VALUE ruby_verbose;\n\n// Wrapper functions for rb_protect - necessary to catch exceptions\n// Array operations can raise exceptions (e.g., index errors, frozen arrays)\nstatic VALUE call_array_aref(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_ary_entry(ptr[0], FIX2INT(ptr[1]));  // Array element access - ary[index]\n}\n\nstatic VALUE call_array_aset(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    rb_ary_store(ptr[0], FIX2INT(ptr[1]), ptr[2]);  // Array element assignment - ary[index] = value\n    return ptr[2];  // Return the value that was set\n}\n\nstatic VALUE call_array_concat(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_ary_concat(ptr[0], ptr[1]);  // Concatenate arrays\n}\n\nstatic VALUE call_array_plus(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"+\"), 1, ptr[1]);  // Array addition\n}\n\nstatic VALUE call_array_minus(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"-\"), 1, ptr[1]);  // Array subtraction\n}\n\nstatic VALUE call_array_and(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"&\"), 1, ptr[1]);  // Array intersection\n}\n\nstatic VALUE call_array_or(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"|\"), 1, ptr[1]);  // Array union\n}\n\nstatic VALUE call_array_flatten(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"flatten\"), 1, ptr[1]);  // Flatten nested arrays\n}\n\nstatic VALUE call_array_compact(VALUE ary) {\n    return rb_funcall(ary, rb_intern(\"compact\"), 0);  // Remove nil elements\n}\n\nstatic VALUE call_array_uniq(VALUE ary) {\n    return rb_funcall(ary, rb_intern(\"uniq\"), 0);  // Remove duplicates\n}\n\nstatic VALUE call_array_rotate(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"rotate\"), 1, ptr[1]);  // Rotate array\n}\n\nstatic VALUE call_array_sample(VALUE ary) {\n    return rb_funcall(ary, rb_intern(\"sample\"), 0);  // Get random element\n}\n\nstatic VALUE call_array_fetch(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"fetch\"), 1, ptr[1]);  // Fetch with bounds checking\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Initialize Ruby once on first call\n    // Sets up VM, object system, and Array class\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size < 2) return 0;\n    \n    // Use FuzzedDataProvider for structured data consumption\n    FuzzedDataProvider fdp(data, size);\n    \n    int state = 0;\n    VALUE ary = rb_ary_new();\n    VALUE args[3];\n    \n    // Populate array with strings only\n    // Testing string arrays exercises array operations with object references\n    size_t num_elements = fdp.ConsumeIntegralInRange<size_t>(0, 30);\n    for (size_t i = 0; i < num_elements && fdp.remaining_bytes() > 0; i++) {\n        size_t str_len = fdp.ConsumeIntegralInRange<size_t>(0, 5000);\n        std::string str = fdp.ConsumeBytesAsString(str_len);\n        rb_ary_push(ary, rb_str_new(str.data(), str.size()));\n    }\n    \n    // Select and perform a single array operation based on fuzzer input\n    // Each operation tests different aspects of array.c\n    uint8_t op = fdp.ConsumeIntegralInRange<uint8_t>(0, 24);\n    \n    switch (op) {\n            case 0: // Array element access - tests indexing logic\n                if (RARRAY_LEN(ary) > 0) {\n                    long idx = fdp.ConsumeIntegralInRange<long>(-10, 10);\n                    args[0] = ary;\n                    args[1] = LONG2FIX(idx);\n                    rb_protect(call_array_aref, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 1: // Array element assignment - tests storage and bounds\n                {\n                    long idx = fdp.ConsumeIntegralInRange<long>(-5, 15);\n                    std::string val_data = fdp.ConsumeBytesAsString(\n                        fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                    );\n                    VALUE val = rb_str_new(val_data.data(), val_data.size());\n                    args[0] = ary;\n                    args[1] = LONG2FIX(idx);\n                    args[2] = val;\n                    rb_protect(call_array_aset, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 2: // Array push - tests growth\n                {\n                    std::string data_str = fdp.ConsumeBytesAsString(\n                        fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                    );\n                    rb_ary_push(ary, rb_str_new(data_str.data(), data_str.size()));\n                }\n                break;\n                \n            case 3: // Array pop - tests shrinkage\n                if (RARRAY_LEN(ary) > 0) {\n                    rb_ary_pop(ary);\n                }\n                break;\n                \n            case 4: // Array shift - tests FIFO removal\n                if (RARRAY_LEN(ary) > 0) {\n                    rb_ary_shift(ary);\n                }\n                break;\n                \n            case 5: // Array unshift - tests prepending\n                {\n                    std::string str = fdp.ConsumeBytesAsString(\n                        fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                    );\n                    rb_ary_unshift(ary, rb_str_new(str.data(), str.size()));\n                }\n                break;\n                \n            case 6: // Array reverse - tests element reordering\n                rb_ary_reverse(ary);\n                break;\n                \n            case 7: // Array sort - tests comparison and ordering\n                rb_protect((VALUE (*)(VALUE))rb_ary_sort, ary, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 8: // Array dup - tests shallow copy\n                rb_ary_dup(ary);\n                break;\n                \n            case 9: // Array clear - tests bulk removal\n                rb_ary_clear(ary);\n                break;\n                \n            case 10: // Array concat - tests array merging\n                {\n                    VALUE other = rb_ary_new();\n                    size_t n = fdp.ConsumeIntegralInRange<size_t>(0, 5);\n                    for (size_t i = 0; i < n && fdp.remaining_bytes() > 0; i++) {\n                        std::string str = fdp.ConsumeBytesAsString(\n                            fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                        );\n                        rb_ary_push(other, rb_str_new(str.data(), str.size()));\n                    }\n                    args[0] = ary;\n                    args[1] = other;\n                    rb_protect(call_array_concat, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 11: // Array join - tests string conversion\n                {\n                    std::string sep = fdp.ConsumeBytesAsString(\n                        fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                    );\n                    rb_ary_join(ary, rb_str_new(sep.data(), sep.size()));\n                }\n                break;\n                \n            case 12: // Array slice - tests subarray extraction\n                if (RARRAY_LEN(ary) > 0) {\n                    long start = fdp.ConsumeIntegralInRange<long>(0, RARRAY_LEN(ary));\n                    long len = fdp.ConsumeIntegralInRange<long>(0, 5000);\n                    rb_ary_subseq(ary, start, len);\n                }\n                break;\n                \n            case 13: // Array first - tests head access\n                {\n                    long n = fdp.ConsumeIntegralInRange<long>(0, 2000);\n                    rb_funcall(ary, rb_intern(\"first\"), 1, LONG2FIX(n));\n                }\n                break;\n                \n            case 14: // Array last - tests tail access\n                {\n                    long n = fdp.ConsumeIntegralInRange<long>(0, 2000);\n                    rb_funcall(ary, rb_intern(\"last\"), 1, LONG2FIX(n));\n                }\n                break;\n                \n            case 15: // Array + (addition) - tests combining\n                {\n                    VALUE other = rb_ary_new();\n                    std::string str = fdp.ConsumeBytesAsString(\n                        fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                    );\n                    rb_ary_push(other, rb_str_new(str.data(), str.size()));\n                    args[0] = ary;\n                    args[1] = other;\n                    rb_protect(call_array_plus, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 16: // Array - (subtraction) - tests difference\n                {\n                    VALUE other = rb_ary_new();\n                    if (RARRAY_LEN(ary) > 0) {\n                        rb_ary_push(other, rb_ary_entry(ary, 0));\n                    }\n                    args[0] = ary;\n                    args[1] = other;\n                    rb_protect(call_array_minus, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 17: // Array & (intersection) - tests set operations\n                {\n                    VALUE other = rb_ary_new();\n                    std::string str = fdp.ConsumeBytesAsString(\n                        fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                    );\n                    rb_ary_push(other, rb_str_new(str.data(), str.size()));\n                    args[0] = ary;\n                    args[1] = other;\n                    rb_protect(call_array_and, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 18: // Array | (union) - tests set operations\n                {\n                    VALUE other = rb_ary_new();\n                    std::string str = fdp.ConsumeBytesAsString(\n                        fdp.ConsumeIntegralInRange<size_t>(0, 5000)\n                    );\n                    rb_ary_push(other, rb_str_new(str.data(), str.size()));\n                    args[0] = ary;\n                    args[1] = other;\n                    rb_protect(call_array_or, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 19: // Array flatten - tests nested array handling\n                {\n                    args[0] = ary;\n                    args[1] = INT2FIX(fdp.ConsumeIntegralInRange<int>(0, 3));\n                    rb_protect(call_array_flatten, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 20: // Array compact - tests nil removal\n                rb_protect(call_array_compact, ary, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 21: // Array uniq - tests duplicate removal\n                rb_protect(call_array_uniq, ary, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 22: // Array rotate - tests circular shift\n                {\n                    args[0] = ary;\n                    args[1] = INT2FIX(fdp.ConsumeIntegralInRange<int>(-5, 5));\n                    rb_protect(call_array_rotate, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n                \n            case 23: // Array sample - tests random access\n                rb_protect(call_array_sample, ary, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 24: // Array fetch - tests bounds-checked access\n                if (RARRAY_LEN(ary) > 0) {\n                    long idx = fdp.ConsumeIntegralInRange<long>(-10, 10);\n                    args[0] = ary;\n                    args[1] = LONG2FIX(idx);\n                    rb_protect(call_array_fetch, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n        }\n    \n    // Clean up - force GC to release memory\n    // Ensures array memory is properly freed across iterations\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_bignum.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's Bignum/Integer implementation (bignum.c, numeric.c)\n * \n * Purpose: Test arbitrary-precision integer operations including arithmetic,\n * bitwise operations, conversions, and comparison. Tests edge cases in\n * overflow handling, sign handling, and numeric precision.\n * \n * Coverage:\n * - Arithmetic: +, -, *, /, %, **\n * - Bitwise: &, |, ^, <<, >>\n * - Comparison: ==, <=>, <, >, <=, >=\n * - Conversion: to_s, to_f, abs, negation\n * - Edge cases: Division by zero, large exponents, overflow\n */\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n\nstatic int ruby_initialized = 0;\n\nextern \"C\" VALUE ruby_verbose;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size < 2) return 0;\n    \n    // Use FuzzedDataProvider for structured data consumption\n    FuzzedDataProvider fdp(data, size);\n    \n    int state = 0;\n    VALUE num1 = Qnil, num2 = Qnil, result = Qnil;\n    \n    // Create first number from fuzzer data\n    size_t str1_len = fdp.ConsumeIntegralInRange<size_t>(0, 10000);\n    std::string str1 = fdp.ConsumeBytesAsString(str1_len);\n    num1 = rb_protect((VALUE (*)(VALUE))rb_Integer, rb_str_new(str1.data(), str1.size()), &state);\n    if (state) {\n        rb_set_errinfo(Qnil);\n        state = 0;\n        num1 = INT2FIX(fdp.ConsumeIntegral<int32_t>());\n    }\n    \n    // Create second number from remaining fuzzer data\n    size_t str2_len = fdp.ConsumeIntegralInRange<size_t>(0, 10000);\n    std::string str2 = fdp.ConsumeBytesAsString(str2_len);\n    if (!str2.empty()) {\n        num2 = rb_protect((VALUE (*)(VALUE))rb_Integer, rb_str_new(str2.data(), str2.size()), &state);\n        if (state) {\n            rb_set_errinfo(Qnil);\n            state = 0;\n            num2 = INT2FIX(fdp.ConsumeIntegral<int32_t>());\n        }\n    } else {\n        num2 = INT2FIX(1);\n    }\n    \n    // Select a single operation to test\n    uint8_t op = fdp.ConsumeIntegralInRange<uint8_t>(0, 19);\n    \n    switch (op) {\n        case 0: // Addition\n            result = rb_funcall(num1, rb_intern(\"+\"), 1, num2);\n            break;\n        case 1: // Subtraction\n            result = rb_funcall(num1, rb_intern(\"-\"), 1, num2);\n            break;\n        case 2: // Multiplication\n            result = rb_funcall(num1, rb_intern(\"*\"), 1, num2);\n            break;\n        case 3: // Division (skip if num2 is zero)\n            if (!FIXNUM_P(num2) || FIX2LONG(num2) != 0) {\n                result = rb_funcall(num1, rb_intern(\"/\"), 1, num2);\n            }\n            break;\n        case 4: // Modulo (skip if num2 is zero)\n            if (!FIXNUM_P(num2) || FIX2LONG(num2) != 0) {\n                result = rb_funcall(num1, rb_intern(\"%\"), 1, num2);\n            }\n            break;\n        case 5: // Power (limit exponent to avoid hang)\n            if (FIXNUM_P(num2)) {\n                long exp_val = FIX2LONG(num2);\n                if (exp_val >= 0 && exp_val < 100) {\n                    result = rb_funcall(num1, rb_intern(\"**\"), 1, num2);\n                }\n            }\n            break;\n        case 6: // Bitwise AND\n            result = rb_funcall(num1, rb_intern(\"&\"), 1, num2);\n            break;\n        case 7: // Bitwise OR\n            result = rb_funcall(num1, rb_intern(\"|\"), 1, num2);\n            break;\n        case 8: // Bitwise XOR\n            result = rb_funcall(num1, rb_intern(\"^\"), 1, num2);\n            break;\n        case 9: // Left shift (limit shift amount)\n            if (FIXNUM_P(num2)) {\n                long shift = FIX2LONG(num2);\n                if (shift >= 0 && shift < 256) {\n                    result = rb_funcall(num1, rb_intern(\"<<\"), 1, num2);\n                }\n            }\n            break;\n        case 10: // Right shift (limit shift amount)\n            if (FIXNUM_P(num2)) {\n                long shift = FIX2LONG(num2);\n                if (shift >= 0 && shift < 256) {\n                    result = rb_funcall(num1, rb_intern(\">>\"), 1, num2);\n                }\n            }\n            break;\n        case 11: // Equality\n            result = rb_funcall(num1, rb_intern(\"==\"), 1, num2);\n            break;\n        case 12: // Spaceship operator (comparison)\n            result = rb_funcall(num1, rb_intern(\"<=>\"), 1, num2);\n            break;\n        case 13: // Greater than\n            result = rb_funcall(num1, rb_intern(\">\"), 1, num2);\n            break;\n        case 14: // Less than\n            result = rb_funcall(num1, rb_intern(\"<\"), 1, num2);\n            break;\n        case 15: // To string conversion\n            result = rb_funcall(num1, rb_intern(\"to_s\"), 0);\n            break;\n        case 16: // To float conversion\n            result = rb_funcall(num1, rb_intern(\"to_f\"), 0);\n            break;\n        case 17: // Absolute value\n            result = rb_funcall(num1, rb_intern(\"abs\"), 0);\n            break;\n        case 18: // Negation\n            result = rb_funcall(num1, rb_intern(\"-@\"), 0);\n            break;\n        case 19: // Bitwise NOT\n            result = rb_funcall(num1, rb_intern(\"~\"), 0);\n            break;\n    }\n    \n    // Force GC\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_hash.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's Hash implementation (hash.c)\n * \n * Purpose: Test hash operations including storage, retrieval, deletion,\n * and complex operations like merging, inverting, and rehashing. Tests\n * edge cases in hash collision handling, memory management, and key equality.\n * \n * Coverage:\n * - Basic operations: [], []=, delete, clear, keys, values\n * - Advanced operations: merge, update, invert, flatten, shift\n * - Edge cases: rehashing, compare_by_identity, nested hashes\n * - Memory: Hash growth/shrinkage, collision handling\n */\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n\nstatic int ruby_initialized = 0;\n\nextern \"C\" VALUE ruby_verbose;\n\n// Wrapper functions for rb_protect - necessary to catch exceptions\n// Hash operations can raise exceptions (e.g., frozen hash, recursive comparison)\nstatic VALUE call_hash_aref(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_hash_aref(ptr[0], ptr[1]);  // Hash lookup - hash[key]\n}\n\nstatic VALUE call_hash_aset(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_hash_aset(ptr[0], ptr[1], ptr[2]);  // Hash assignment - hash[key] = value\n}\n\nstatic VALUE call_hash_delete(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_hash_delete(ptr[0], ptr[1]);  // Key deletion\n}\n\nstatic VALUE call_hash_rehash(VALUE hash) {\n    return rb_funcall(hash, rb_intern(\"rehash\"), 0);  // Rebuild hash after key mutation\n}\n\nstatic VALUE call_hash_clear(VALUE hash) {\n    return rb_hash_clear(hash);  // Remove all entries\n}\n\nstatic VALUE call_hash_merge(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"merge\"), 1, ptr[1]);  // Non-destructive merge\n}\n\nstatic VALUE call_hash_update(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"merge!\"), 1, ptr[1]);  // Destructive merge\n}\n\nstatic VALUE call_hash_invert(VALUE hash) {\n    return rb_funcall(hash, rb_intern(\"invert\"), 0);  // Swap keys/values\n}\n\nstatic VALUE call_hash_to_a(VALUE hash) {\n    return rb_funcall(hash, rb_intern(\"to_a\"), 0);  // Convert to array of [k,v] pairs\n}\n\nstatic VALUE call_hash_shift(VALUE hash) {\n    return rb_funcall(hash, rb_intern(\"shift\"), 0);  // Remove and return first pair\n}\n\nstatic VALUE call_hash_compare_by_id(VALUE hash) {\n    return rb_funcall(hash, rb_intern(\"compare_by_identity\"), 0);  // Use object_id for key equality\n}\n\nstatic VALUE call_hash_flatten(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"flatten\"), 1, ptr[1]);  // Flatten nested arrays\n}\n\nstatic VALUE call_hash_fetch(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_hash_fetch(ptr[0], ptr[1]);  // Fetch with exception if key not found\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Initialize Ruby once on first call\n    // Sets up VM, object system, and Hash class\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size < 2) return 0;\n    \n    // Use FuzzedDataProvider for structured data consumption\n    FuzzedDataProvider fdp(data, size);\n    \n    int state = 0;\n    VALUE hash = rb_hash_new();\n    VALUE args[3];\n    \n    // Populate hash deterministically from fuzzer input\n    size_t num_entries = fdp.ConsumeIntegralInRange<size_t>(0, 20);\n    for (size_t i = 0; i < num_entries && fdp.remaining_bytes() > 1; i++) {\n        size_t key_len = fdp.ConsumeIntegralInRange<size_t>(1, 10000);\n        std::string key_data = fdp.ConsumeBytesAsString(key_len);\n        size_t val_len = fdp.ConsumeIntegralInRange<size_t>(0, 10000);\n        std::string val_data = fdp.ConsumeBytesAsString(val_len);\n        \n        VALUE key = rb_str_new(key_data.data(), key_data.size());\n        VALUE val = rb_str_new(val_data.data(), val_data.size());\n        rb_hash_aset(hash, key, val);\n    }\n    \n    // Select a single hash operation to test\n    uint8_t op = fdp.ConsumeIntegralInRange<uint8_t>(0, 17);\n    \n    // Create key and value for the operation from remaining data\n    size_t key_len = fdp.ConsumeIntegralInRange<size_t>(1, 10000);\n    std::string key_data = fdp.ConsumeBytesAsString(key_len);\n    size_t val_len = fdp.ConsumeIntegralInRange<size_t>(0, 10000);\n    std::string val_data = fdp.ConsumeBytesAsString(val_len);\n    \n    VALUE key = rb_str_new(key_data.data(), key_data.size());\n    VALUE val = val_data.empty() ? Qnil : rb_str_new(val_data.data(), val_data.size());\n    \n    switch (op) {\n            case 0: // Hash insert/update - tests storage and collision handling\n                args[0] = hash;\n                args[1] = key;\n                args[2] = val;\n                rb_protect(call_hash_aset, (VALUE)args, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 1: // Hash lookup - tests retrieval and key equality\n                args[0] = hash;\n                args[1] = key;\n                rb_protect(call_hash_aref, (VALUE)args, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 2: // Hash delete - tests key removal and table shrinkage\n                args[0] = hash;\n                args[1] = key;\n                rb_protect(call_hash_delete, (VALUE)args, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 3: // Hash rehash - tests hash table reconstruction after key mutation\n                rb_protect(call_hash_rehash, hash, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 4: // Hash clear - tests bulk removal\n                rb_protect(call_hash_clear, hash, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n                \n            case 5: // Hash size - tests entry counting\n                rb_hash_size(hash);\n                break;\n                \n            case 6: // Hash keys - tests key array generation\n                rb_funcall(hash, rb_intern(\"keys\"), 0);\n                break;\n                \n            case 7: // Hash values - tests value array generation\n                rb_funcall(hash, rb_intern(\"values\"), 0);\n                break;\n                \n            case 8: // Hash has_key? - tests membership checking\n                rb_funcall(hash, rb_intern(\"has_key?\"), 1, key);\n                break;\n                \n            case 9: // Hash dup - tests shallow copy operations\n                rb_hash_dup(hash);\n                break;\n            \n            case 10: // Hash merge - tests non-destructive combining of hashes\n                {\n                    VALUE other = rb_hash_new();\n                    rb_hash_aset(other, key, val);\n                    args[0] = hash;\n                    args[1] = other;\n                    rb_protect(call_hash_merge, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n            \n            case 11: // Hash update/merge! - tests destructive merging\n                {\n                    VALUE other = rb_hash_new();\n                    rb_hash_aset(other, key, val);\n                    args[0] = hash;\n                    args[1] = other;\n                    rb_protect(call_hash_update, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n            \n            case 12: // Hash invert - tests key/value swapping and collision handling\n                rb_protect(call_hash_invert, hash, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n            \n            case 13: // Hash to_a - tests conversion to array of pairs\n                rb_protect(call_hash_to_a, hash, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n            \n            case 14: // Hash shift - tests FIFO removal (first entry)\n                rb_protect(call_hash_shift, hash, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n            \n            case 15: // Hash compare_by_identity - tests object_id-based key comparison\n                rb_protect(call_hash_compare_by_id, hash, &state);\n                if (state) { rb_set_errinfo(Qnil); state = 0; }\n                break;\n            \n            case 16: // Hash flatten - tests nested array flattening in values\n                {\n                    args[0] = hash;\n                    args[1] = INT2FIX(1);  // Flatten depth\n                    rb_protect(call_hash_flatten, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n            \n            case 17: // Hash fetch with default - tests key lookup with fallback\n                {\n                    args[0] = hash;\n                    args[1] = key;\n                    rb_protect(call_hash_fetch, (VALUE)args, &state);\n                    if (state) { rb_set_errinfo(Qnil); state = 0; }\n                }\n                break;\n        }\n    \n    // Clean up - force GC to release memory\n    // Ensures hash memory is properly freed across iterations\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_iseq.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n\nstatic int ruby_initialized = 0;\n\nextern \"C\" VALUE ruby_verbose;\nstatic VALUE cInstructionSequence = Qnil;\nstatic ID id_load_from_binary = 0;\n\n// Wrapper for rb_protect to load ISEQ from binary\nstatic VALUE call_iseq_load_from_binary(VALUE arg) {\n    VALUE str = (VALUE)arg;\n    \n    // Call RubyVM::InstructionSequence.load_from_binary(binary_string)\n    // This exercises the complete ISEQ binary deserialization path\n    VALUE iseq = rb_funcall(cInstructionSequence, id_load_from_binary, 1, str);\n    \n    if (!NIL_P(iseq)) {\n        // Try to access various ISEQ methods to ensure it was properly loaded\n        rb_funcall(iseq, rb_intern(\"path\"), 0);\n        rb_funcall(iseq, rb_intern(\"label\"), 0);\n        rb_funcall(iseq, rb_intern(\"first_lineno\"), 0);\n        rb_funcall(iseq, rb_intern(\"to_a\"), 0);\n        \n        // Try to inspect it\n        rb_funcall(iseq, rb_intern(\"inspect\"), 0);\n    }\n    \n    return Qnil;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Initialize Ruby once on first call\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Get RubyVM::InstructionSequence class\n        VALUE mRubyVM = rb_const_get(rb_cObject, rb_intern(\"RubyVM\"));\n        cInstructionSequence = rb_const_get(mRubyVM, rb_intern(\"InstructionSequence\"));\n        \n        // Get the load_from_binary method ID\n        id_load_from_binary = rb_intern(\"load_from_binary\");\n    }\n    \n    // Limit input size to avoid excessive processing\n    // ISEQ binary format can be moderately large\n    if (size == 0 || size > 16384) {\n        return 0;\n    }\n    \n    // Use FuzzedDataProvider for structured data consumption\n    FuzzedDataProvider fdp(data, size);\n    \n    // Create a Ruby string from the fuzzer input\n    // This will be passed to load_from_binary\n    std::string binary_data = fdp.ConsumeRemainingBytesAsString();\n    VALUE binary_str = rb_str_new(binary_data.data(), binary_data.size());\n    \n    // Call with rb_protect to catch any exceptions/errors\n    int state = 0;\n    rb_protect(call_iseq_load_from_binary, binary_str, &state);\n    \n    // Clear any exception that occurred\n    if (state) {\n        rb_set_errinfo(Qnil);\n    }\n    \n    // Force GC to release memory and detect any memory issues\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_json.c",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's JSON parser (ext/json)\n * Tests JSON parsing with malformed/corrupted input\n */\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include \"ruby.h\"\n#include \"../ruby/ext/json/json.h\"\n#include \"../ruby/ext/json/vendor/ryu.h\"\n#include \"../ruby/ext/json/parser/parser.c\"\n\nstatic int ruby_initialized = 0;\n\n// External declaration for ruby_verbose\nextern VALUE ruby_verbose;\n\n// JSON parser wrapper - parses JSON string with default config\nstatic VALUE json_fuzzer_parse(VALUE json_str) {\n    JSON_ParserConfig config = {\n        .on_load_proc = Qfalse,\n        .decimal_class = Qfalse,\n        .decimal_method_id = 0,\n        .on_duplicate_key = JSON_RAISE,\n        .max_nesting = 100,\n        .allow_nan = 0,\n        .allow_trailing_comma = 0,\n        .symbolize_names = 0,\n        .freeze = 0\n    };\n    \n    return cParser_parse(&config, json_str);\n}\n\n// Test JSON parsing with fuzzer input\nstatic VALUE call_json_parse(VALUE arg) {\n    VALUE json_str = (VALUE)arg;\n    VALUE result = json_fuzzer_parse(json_str);\n    \n    // Access the result to ensure it was properly parsed\n    if (!NIL_P(result)) {\n        rb_funcall(result, rb_intern(\"class\"), 0);\n        \n        if (RB_TYPE_P(result, T_HASH)) {\n            rb_funcall(result, rb_intern(\"keys\"), 0);\n        } else if (RB_TYPE_P(result, T_ARRAY)) {\n            rb_funcall(result, rb_intern(\"size\"), 0);\n        }\n    }\n    \n    return result;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size == 0) {\n        return 0;\n    }\n    \n    VALUE json_str = rb_str_new((const char *)data, size);\n    \n    int state = 0;\n    rb_protect(call_json_parse, json_str, &state);\n    \n    if (state) {\n        rb_set_errinfo(Qnil);\n    }\n    \n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_pack.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's Array#pack and String#unpack (pack.c)\n * \n * Purpose: Test binary packing/unpacking with various template directives\n * to find bugs in template parsing, data conversion, and boundary handling.\n * \n * Coverage:\n * - Template parsing: All pack directives (C, S, L, Q, c, s, l, q, A, a, Z, etc.)\n * - Array#pack: Convert Ruby objects to binary string\n * - String#unpack: Parse binary data according to template\n * - Round-trip: pack → unpack consistency\n * - Edge cases: Invalid templates, buffer overflows, encoding issues\n */\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n\nstatic int ruby_initialized = 0;\n\nextern \"C\" VALUE ruby_verbose;\n\n// Test Array#pack with fuzzer-provided template\nstatic VALUE call_array_pack(VALUE arg) {\n    VALUE *args = (VALUE *)arg;\n    VALUE ary = args[0];\n    VALUE template_str = args[1];\n    \n    // Call Array#pack with the template\n    // This exercises the pack template parser and binary packing logic\n    VALUE result = rb_funcall(ary, rb_intern(\"pack\"), 1, template_str);\n    \n    // Try to use the result to ensure it's valid\n    if (!NIL_P(result)) {\n        rb_funcall(result, rb_intern(\"length\"), 0);\n        rb_funcall(result, rb_intern(\"encoding\"), 0);\n    }\n    \n    return result;\n}\n\n// Test String#unpack with fuzzer-provided template and data\nstatic VALUE call_string_unpack(VALUE arg) {\n    VALUE *args = (VALUE *)arg;\n    VALUE str = args[0];\n    VALUE template_str = args[1];\n    \n    // Call String#unpack with the template\n    // This exercises the unpack template parser and binary unpacking logic\n    VALUE result = rb_funcall(str, rb_intern(\"unpack\"), 1, template_str);\n    \n    // Try to iterate the result to ensure it's valid\n    if (!NIL_P(result) && RB_TYPE_P(result, T_ARRAY)) {\n        long len = RARRAY_LEN(result);\n        for (long i = 0; i < len && i < 10; i++) {\n            (void)rb_ary_entry(result, i);  // Suppress unused warning\n        }\n    }\n    \n    return result;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Initialize Ruby once on first call\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size < 2) {\n        return 0;\n    }\n    \n    // Use FuzzedDataProvider for structured data consumption\n    FuzzedDataProvider fdp(data, size);\n    \n    // Split input: template and binary data\n    size_t template_len = fdp.ConsumeIntegralInRange<size_t>(1, 10000);\n    std::string template_data = fdp.ConsumeBytesAsString(template_len);\n    size_t binary_data_len = fdp.ConsumeIntegralInRange<size_t>(1, 10000);\n    std::string binary_data = fdp.ConsumeBytesAsString(binary_data_len);\n    \n    VALUE template_str = rb_str_new(template_data.data(), template_data.size());\n    VALUE binary_str = rb_str_new(binary_data.data(), binary_data.size());\n    \n    int state = 0;\n    \n    // Test String#unpack with fuzzer data\n    VALUE unpack_args[] = {binary_str, template_str};\n    rb_protect(call_string_unpack, (VALUE)unpack_args, &state);\n    if (state) {\n        rb_set_errinfo(Qnil);\n        state = 0;\n    }\n    \n    // Test Array#pack with fuzzer template and randomized array data\n    VALUE test_array = rb_ary_new();\n    \n    // Add various Ruby objects with random data from fuzzer\n    rb_ary_push(test_array, INT2FIX(fdp.ConsumeIntegral<int16_t>()));\n    rb_ary_push(test_array, INT2FIX(fdp.ConsumeIntegral<int16_t>()));\n    rb_ary_push(test_array, LONG2NUM(fdp.ConsumeIntegral<int32_t>()));\n    rb_ary_push(test_array, rb_float_new(fdp.ConsumeFloatingPoint<double>()));\n    \n    size_t str1_len = fdp.ConsumeIntegralInRange<size_t>(0, 10000);\n    std::string str1 = fdp.ConsumeBytesAsString(str1_len);\n    rb_ary_push(test_array, rb_str_new(str1.data(), str1.size()));\n    \n    size_t str2_len = fdp.ConsumeIntegralInRange<size_t>(0, 10000);\n    std::string str2 = fdp.ConsumeBytesAsString(str2_len);\n    rb_ary_push(test_array, rb_str_new(str2.data(), str2.size()));\n    \n    if (fdp.remaining_bytes() >= 8) {\n        rb_ary_push(test_array, UINT2NUM(fdp.ConsumeIntegral<uint32_t>()));\n        rb_ary_push(test_array, UINT2NUM(fdp.ConsumeIntegral<uint32_t>()));\n    }\n    \n    VALUE pack_args[] = {test_array, template_str};\n    rb_protect(call_array_pack, (VALUE)pack_args, &state);\n    if (state) {\n        rb_set_errinfo(Qnil);\n    }\n    \n    // Test round-trip: pack then unpack\n    VALUE packed = Qnil;\n    state = 0;\n    packed = rb_protect(call_array_pack, (VALUE)pack_args, &state);\n    \n    if (state == 0 && !NIL_P(packed)) {\n        VALUE roundtrip_args[] = {packed, template_str};\n        state = 0;\n        rb_protect(call_string_unpack, (VALUE)roundtrip_args, &state);\n        if (state) {\n            rb_set_errinfo(Qnil);\n        }\n    } else if (state) {\n        rb_set_errinfo(Qnil);\n    }\n    \n    // Force GC\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_prism.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's Prism compiler (prism_compile.c)\n * Tests parsing of Ruby source code using the Prism parser API directly\n * to find bugs in Ruby's cutting-edge parser implementation.\n */\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n\nextern \"C\" {\n#include \"prism.h\"\n}\n\nextern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    if (size == 0) {\n        return 0;\n    }\n    \n    // Initialize parser with default options\n    pm_options_t options = {0};\n    pm_options_frozen_string_literal_set(&options, false);\n    \n    pm_parser_t parser;\n    pm_parser_init(&parser, data, size, &options);\n    \n    // Parse the input\n    pm_node_t *node = pm_parse(&parser);\n    \n    // Clean up\n    if (node) {\n        pm_node_destroy(&parser, node);\n    }\n    pm_parser_free(&parser);\n    pm_options_free(&options);\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_regex.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's Regex implementation (re.c, regcomp.c, regexec.c, regparse.c)\n * \n * Purpose: Test regex compilation from potentially malformed patterns and matching\n * against various strings. Tests parser edge cases, compilation bugs, and matching\n * correctness with complex patterns.\n * \n * Coverage:\n * - Regex compilation: Pattern parsing, syntax validation, optimization\n * - Regex matching: match, =~, scan, gsub operations\n * - Edge cases: Invalid patterns, backtracking, captures, Unicode, lookahead/lookbehind\n * - Memory: Backtracking stack overflow, catastrophic backtracking\n */\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n#include <fcntl.h>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n#include \"ruby/encoding.h\"\n#include \"ruby/re.h\"\n\nstatic int ruby_initialized = 0;\n\nextern \"C\" VALUE ruby_verbose;\n\n// Wrapper functions for rb_protect - necessary to catch exceptions\n// Regex operations can raise (e.g., syntax errors, invalid patterns)\nstatic VALUE call_regex_match(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"match\"), 1, ptr[1]);  // Regexp#match - full match info\n}\n\n// Wrapper for regex =~ operator\nstatic VALUE call_regex_match_op(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[0], rb_intern(\"=~\"), 1, ptr[1]);  // Regexp#=~ - match position\n}\n\n// Wrapper for regex scan\nstatic VALUE call_regex_scan(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[1], rb_intern(\"scan\"), 1, ptr[0]);  // String#scan - find all matches\n}\n\n// Wrapper for regex gsub\nstatic VALUE call_regex_gsub(VALUE args) {\n    VALUE *ptr = (VALUE *)args;\n    return rb_funcall(ptr[1], rb_intern(\"gsub\"), 2, ptr[0], ptr[2]);  // String#gsub - replace all\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Initialize Ruby once on first call\n    // Sets up VM, object system, and Regexp class\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size < 2) return 0;\n    \n    // Use FuzzedDataProvider to split input into pattern and test string\n    FuzzedDataProvider fdp(data, size);\n    \n    // Consume pattern string with limited length to avoid pathological patterns\n    size_t pattern_len = fdp.ConsumeIntegralInRange<size_t>(1, 1000);  // Reduced from 10000\n    std::string pattern = fdp.ConsumeBytesAsString(pattern_len);\n    \n    // Consume test string from remaining data with size limit\n    std::string test = fdp.ConsumeRemainingBytesAsString();\n    if (test.size() > 10000) {\n        test.resize(10000);  // Limit test string size to prevent memory issues\n    }\n    \n    // Create Ruby strings - these can fail if data is invalid\n    VALUE pattern_str = rb_str_new(pattern.data(), pattern.size());\n    VALUE test_str = rb_str_new(test.data(), test.size());\n    \n    int state = 0;\n    VALUE args[3];\n    \n    // Temporarily redirect stderr file descriptor to suppress regex compilation warnings\n    // Duplicate stderr, redirect to /dev/null, then restore after compilation\n    int saved_stderr = dup(STDERR_FILENO);\n    int dev_null = open(\"/dev/null\", O_WRONLY);\n    if (dev_null >= 0) {\n        dup2(dev_null, STDERR_FILENO);\n        close(dev_null);\n    }\n    \n    // Compile the regex with default options (0)\n    // This exercises the regex parser (regparse.c)\n    // Tests pattern syntax validation, AST building, and optimization\n    VALUE regexp = rb_protect((VALUE (*)(VALUE))rb_reg_regcomp, pattern_str, &state);\n    \n    // Restore stderr file descriptor\n    if (saved_stderr >= 0) {\n        dup2(saved_stderr, STDERR_FILENO);\n        close(saved_stderr);\n    }\n    \n    if (state) {\n        // Pattern compilation failed (syntax error, invalid escape, etc.)\n        rb_set_errinfo(Qnil);\n        rb_gc_start();\n        return 0;\n    }\n    \n    if (NIL_P(regexp)) {\n        rb_gc_start();\n        return 0;\n    }\n    \n    // Test 1: Regexp#match - exercises regex matching engine (regexec.c)\n    // Returns MatchData object with capture groups\n    args[0] = regexp;\n    args[1] = test_str;\n    rb_protect(call_regex_match, (VALUE)args, &state);\n    if (state) {\n        rb_set_errinfo(Qnil);\n        state = 0;\n    }\n    \n    // Test 2: Regexp#=~ - exercises match position finding\n    // Returns integer position or nil\n    rb_protect(call_regex_match_op, (VALUE)args, &state);\n    if (state) {\n        rb_set_errinfo(Qnil);\n        state = 0;\n    }\n    \n    // Test 3: String#scan - find all matches\n    // Tests repeated matching and capture handling\n    // Skip scan if test string is too large to avoid memory issues\n    if (test.size() <= 5000) {\n        rb_protect(call_regex_scan, (VALUE)args, &state);\n        if (state) {\n            rb_set_errinfo(Qnil);\n            state = 0;\n        }\n    }\n    \n    // Test 4: String#gsub - replace matches\n    // Tests matching combined with string building\n    VALUE replacement = rb_str_new(\"X\", 1);\n    args[0] = regexp;\n    args[1] = test_str;\n    args[2] = replacement;\n    rb_protect(call_regex_gsub, (VALUE)args, &state);\n    if (state) {\n        rb_set_errinfo(Qnil);\n        state = 0;\n    }\n    \n    // Clean up - force GC to release memory\n    // Necessary to prevent memory growth from regex compilation artifacts\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_ruby_parser.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * Fuzzer for Ruby's parser (ruby_parser.c)\n * Tests parsing of Ruby source code with malformed/random input\n * to find bugs in the Ruby parser implementation.\n */\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n#include \"ruby/ruby.h\"\n#include \"ruby/encoding.h\"\n\n/* Forward declarations for parser functions */\nextern \"C\" {\nextern VALUE rb_parser_new(void);\nextern VALUE rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line);\nextern VALUE ruby_verbose;\n}\n\n/* Silence stderr output during fuzzing */\nstatic VALUE\nsilenced_parse(VALUE parser_str_pair)\n{\n    VALUE *args = (VALUE *)parser_str_pair;\n    VALUE parser = args[0];\n    VALUE code_str = args[1];\n    \n    /* Compile the string - this will parse it */\n    return rb_parser_compile_string(parser, \"(fuzz)\", code_str, 1);\n}\n\nextern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    static int initialized = 0;\n    int state;\n    \n    if (!initialized) {\n        ruby_init();\n        ruby_init_loadpath();\n        initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size == 0) {\n        return 0;\n    }\n    \n    // Limit input size to avoid pathologically slow parsing\n    // Ruby parser can be exponentially slow with deeply nested\n    // structures resulting in timeouts.\n    if (size > 50000) {\n        return 0;\n    }\n    // Use FuzzedDataProvider for structured data consumption\n    FuzzedDataProvider fdp(data, size);\n    \n    /* Create a Ruby string from the fuzz input */\n    std::string code_data = fdp.ConsumeRemainingBytesAsString();\n    VALUE code_str = rb_str_new(code_data.data(), code_data.size());\n    \n    /* Create a new parser instance */\n    VALUE parser = rb_parser_new();\n    if (NIL_P(parser)) {\n        return 0;\n    }\n    \n    /* Prepare arguments for protected call */\n    VALUE args[2];\n    args[0] = parser;\n    args[1] = code_str;\n    \n    /* Parse the code with exception protection */\n    rb_protect(silenced_parse, (VALUE)args, &state);\n    \n    /* If an exception occurred, clear it and continue */\n    if (state) {\n        rb_set_errinfo(Qnil);\n    }\n    \n    /* Force GC to clean up */\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/fuzz_string.cpp",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <string>\n#include <fuzzer/FuzzedDataProvider.h>\n#include \"ruby.h\"\n#include \"ruby/encoding.h\"\n\nstatic int ruby_initialized = 0;\n\n// Wrapper functions for rb_protect since it needs VALUE (*)(VALUE) signature\nstatic VALUE call_str_dump(VALUE str) { return rb_str_dump(str); }\nstatic VALUE call_str_inspect(VALUE str) { return rb_str_inspect(str); }\nstatic VALUE call_str_length(VALUE str) { return rb_str_length(str); }\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    // Initialize Ruby once on first call\n    if (!ruby_initialized) {\n        ruby_init();\n        ruby_initialized = 1;\n        \n        // Suppress Ruby warnings to avoid log noise\n        ruby_verbose = Qfalse;\n    }\n    \n    if (size == 0) return 0;\n    \n    // Use FuzzedDataProvider for structured data consumption\n    FuzzedDataProvider fdp(data, size);\n    \n    int state = 0;\n    \n    // Create string from fuzzer data\n    std::string str_data = fdp.ConsumeRemainingBytesAsString();\n    VALUE str1 = rb_str_new(str_data.data(), str_data.size());\n    \n    // Test various string operations that might have security implications\n    rb_protect(call_str_dump, str1, &state);\n    if (state) { rb_set_errinfo(Qnil); state = 0; }\n    \n    rb_protect(call_str_inspect, str1, &state);\n    if (state) { rb_set_errinfo(Qnil); state = 0; }\n    \n    rb_protect(call_str_length, str1, &state);\n    if (state) { rb_set_errinfo(Qnil); state = 0; }\n    \n    // Test substring operations\n    if (str_data.size() > 1) {\n        VALUE substr = rb_str_substr(str1, 0, str_data.size() / 2);\n        (void)substr; // Suppress unused warning\n    }\n    \n    // Test encoding operations\n    rb_enc_associate(str1, rb_utf8_encoding());\n    rb_enc_associate(str1, rb_ascii8bit_encoding());\n    \n    // Clean up - force GC to release memory\n    rb_gc_start();\n    \n    return 0;\n}\n"
  },
  {
    "path": "projects/ruby/project.yaml",
    "content": "homepage: \"https://www.ruby-lang.org/en/\"\nlanguage: c++\nprimary_contact: \"kateinoigakukun@gmail.com\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"david@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/ruby/ruby'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/ruby/ruby.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/runc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/opencontainers/runc\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nCOPY build.sh $SRC/\nWORKDIR $SRC/runc\n"
  },
  {
    "path": "projects/runc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/runc/tests/fuzzing/oss_fuzz_build.sh\n$SRC/cncf-fuzzing/projects/runc/build.sh\n"
  },
  {
    "path": "projects/runc/project.yaml",
    "content": "homepage: \"https://github.com/opencontainers/runc\"\nmain_repo: \"https://github.com/opencontainers/runc\"\nprimary_contact: \"cyphar@cyphar.com\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"michael@docker.com\"\n  - \"mpatel@redhat.com\"\n  - \"dqminh89@gmail.com\"\n  - \"h.huangqiang@huawei.com\"\n  - \"akihiro.suda.cz@hco.ntt.co.jp\"\n  - \"kolyshkin@gmail.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/rust-brotli/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust as builder\n\n## Install build dependencies.\nRUN apt-get update\nRUN git clone --depth 1 https://github.com/dropbox/rust-brotli\nCOPY build.sh $SRC/\nCOPY /fuzz $SRC/rust-brotli/fuzz"
  },
  {
    "path": "projects/rust-brotli/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# checks for integer overflows\nexport RUSTFLAGS=\"$RUSTFLAGS -Cdebug-assertions=yes\"\n\ncd $SRC/rust-brotli/fuzz\ncargo fuzz build\ncp $SRC/rust-brotli/fuzz/target/x86_64-unknown-linux-gnu/release/decompress $OUT/\ncp $SRC/rust-brotli/fuzz/target/x86_64-unknown-linux-gnu/release/roundtrip $OUT/\n"
  },
  {
    "path": "projects/rust-brotli/fuzz/Cargo.toml",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n[package]\nname = \"brotli-fuzz\"\nversion = \"0.0.0\"\nauthors = [\"Automatically generated\"]\npublish = false\nedition = \"2018\"\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies]\nlibfuzzer-sys = \"0.4\"\n\n[dependencies.brotli]\npath = \"..\"\n\n# Prevent this from interfering with workspaces\n[workspace]\nmembers = [\".\"]\n\n[[bin]]\nname = \"roundtrip\"\npath = \"fuzz_targets/roundtrip.rs\"\ntest = false\ndoc = false\n\n[[bin]]\nname = \"decompress\"\npath = \"fuzz_targets/decompress.rs\"\ntest = false\ndoc = false\n"
  },
  {
    "path": "projects/rust-brotli/fuzz/fuzz_targets/decompress.rs",
    "content": "/*\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#![no_main]\nuse libfuzzer_sys::fuzz_target;\nuse std::io::{Read, Write};\n\nfuzz_target!(|data: (u16, &[u8])| {\n  let sink = std::io::sink();\n  let mut decompressor = brotli::DecompressorWriter::new(sink, data.0.into());\n  let _ = decompressor.write_all(data.1);\n});\n"
  },
  {
    "path": "projects/rust-brotli/fuzz/fuzz_targets/roundtrip.rs",
    "content": "/*\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#![no_main]\nuse libfuzzer_sys::fuzz_target;\nuse std::io::{Read, Write};\n\nfuzz_target!(|data: (u16, u32, u32, &[u8], u16)| {\n  let mut compressed = Vec::new();\n  let mut writer = brotli::CompressorWriter::new(&mut compressed, data.0.into(), data.1, data.2);\n  writer.write_all(data.3).unwrap();\n  drop(writer);\n  let mut reader = brotli::Decompressor::new(compressed.as_slice(), data.4.into());\n  let mut decompressed = Vec::with_capacity(data.3.len());\n  let _ = reader.read_to_end(&mut decompressed);\n  assert_eq!(data.3, decompressed, \"roundtrip failed\");\n});\n"
  },
  {
    "path": "projects/rust-brotli/project.yaml",
    "content": "homepage: \"https://github.com/dropbox/rust-brotli\"\nlanguage: rust\nprimary_contact: \"danielrh@users.sourceforge.net\"\nauto_ccs:\n  - \"github@nemo157.com\"\n  - \"vmaturi@asu.edu\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/dropbox/rust-brotli'"
  },
  {
    "path": "projects/rust-coreutils/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/uutils/coreutils rust-coreutils\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rust-coreutils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/rust-coreutils\ncargo fuzz build -O\nPROG=$( grep \"name =\" fuzz/Cargo.toml | cut -d\\\" -f2 | grep -v uucore-fuzz )\nfor p in $PROG; do\n\tcp fuzz/target/x86_64-unknown-linux-gnu/release/$p $OUT/$p\ndone\n"
  },
  {
    "path": "projects/rust-coreutils/project.yaml",
    "content": "homepage: \"https://crates.io/crates/coreutils\"\nmain_repo: \"https://github.com/uutils/coreutils\"\nprimary_contact: \"sylvestre@debian.org\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nfile_github_issue: True\nvendor_ccs:\n  - \"sylvestre.ledru@gmail.com\"\n  - \"dhofstet@gmail.com\"\n# Bug reports are public by default:\nview_restrictions: none\nmain_repo: 'https://github.com/uutils/coreutils'\n"
  },
  {
    "path": "projects/rust-lexical/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth 1 https://github.com/Alexhuszagh/rust-lexical\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rust-lexical/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/rust-lexical/fuzz\ncargo fuzz build -O\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i8 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i16 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i32 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i64 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i128 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-isize $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u8 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u16 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u32 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u64 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u128 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-usize $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-float-f32 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-float-f64 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-float-f32 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-float-f64 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i8 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i16 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i32 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i64 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i128 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-isize $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u8 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u16 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u32 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u64 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u128 $OUT/\ncp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-usize $OUT/"
  },
  {
    "path": "projects/rust-lexical/project.yaml",
    "content": "homepage: \"https://github.com/Alexhuszagh/rust-lexical\"\nlanguage: rust\nprimary_contact: \"ahuszagh@gmail.com\"\nauto_ccs:\n  - \"self@myrrlyn.dev\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/Alexhuszagh/rust-lexical'"
  },
  {
    "path": "projects/rust-regex/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/rust-lang/regex regex\nWORKDIR $SRC\n\nRUN cp regex/fuzz/oss-fuzz-build.sh $SRC/build.sh\n"
  },
  {
    "path": "projects/rust-regex/project.yaml",
    "content": "homepage: \"https://github.com/rust-lang/regex\"\nprimary_contact: \"jamslam@gmail.com\"\nmain_repo: \"https://github.com/rust-lang/regex\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"me@addisoncrump.info\"\n"
  },
  {
    "path": "projects/rust-semver-parser/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone https://github.com/steveklabnik/semver-parser\nWORKDIR $SRC/semver-parser\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rust-semver-parser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build\n\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse $OUT/\n\n"
  },
  {
    "path": "projects/rust-semver-parser/project.yaml",
    "content": "homepage: \"https://github.com/steveklabnik/semver-parser\"\nmain_repo: \"https://github.com/steveklabnik/semver-parser.git\"\nprimary_contact: \"steve@steveklabnik.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"fuzzing@fuchsia.dev\"\n"
  },
  {
    "path": "projects/rustls/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl cmake python llvm-dev libclang-dev clang\nRUN apt-get --yes update \\\n   && apt-get install --no-install-recommends --yes \\\n   libssl-dev \\\n   pkg-config \\\n   python \\\n   && apt-get clean \\\n   && rm --recursive --force /var/lib/apt/lists/*\n\nRUN git clone https://github.com/ctz/rustls\nRUN git clone --depth 1 https://github.com/rustls/rustls-fuzzing-corpora\n\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/rustls/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" = \"coverage\" ]\nthen\n  export RUSTFLAGS=\"$RUSTFLAGS -C debug-assertions=no\"\n  export CFLAGS=\"\"\nfi\n\ncd $SRC/rustls\ncargo fuzz build -O\nfor f in $SRC/rustls/fuzz/fuzzers/*.rs\ndo\n  FUZZ_TARGET=$(basename ${f%.*})\n  cp fuzz/target/x86_64-unknown-linux-gnu/release/${FUZZ_TARGET} $OUT/\n  if [[ -d $SRC/rustls-fuzzing-corpora/$FUZZ_TARGET/ ]]; then\n      zip -jr \\\n          $OUT/${FUZZ_TARGET}_seed_corpus.zip \\\n          $SRC/rustls-fuzzing-corpora/$FUZZ_TARGET/\n  fi\ndone\n\nif [ \"$SANITIZER\" == \"coverage\" ]\nthen\n    rm $OUT/server\n    rm $OUT/persist\nfi\n"
  },
  {
    "path": "projects/rustls/project.yaml",
    "content": "homepage: \"https://github.com/ctz/rustls\"\nmain_repo: \"https://github.com/ctz/rustls\"\nprimary_contact: \"jpixton@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"dirkjan@ochtman.nl\"\n  - \"brian@briansmith.org\"\n  - \"daniel@binaryparadox.net\"\n"
  },
  {
    "path": "projects/rxjava/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone https://github.com/ReactiveX/RxJava.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/RxJava"
  },
  {
    "path": "projects/rxjava/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nGRADLE_FLAGS=\"-x javadoc -x test -Dfile.encoding=UTF-8\"\nMVN_FLAGS=\"\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/RxJava\"\n\t./gradlew jar ${GRADLE_FLAGS}\n    ./gradlew publishToMavenLocal ${GRADLE_FLAGS}\n    CURRENT_VERSION=$(./gradlew properties --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n    echo ${CURRENT_VERSION}\npopd\n\npushd ${SRC}\n\t${MVN} package -DrxjavaVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/rxjava-${CURRENT_VERSION}.jar ${OUT}/rxjava-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} rxjava-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\tstripped_path=$(echo ${fuzzer} | sed 's|^.*src/main/java/\\(.*\\).java$|\\1|');\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\techo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/rxjava/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>rxjava</artifactId>\n\t<version>${rxjavaVersion}</version>\n\t<packaging>jar</packaging>\n\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>io.reactivex.rxjava3</groupId>\n\t\t\t<artifactId>rxjava</artifactId>\n\t\t\t<version>${rxjavaVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/rxjava/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://reactivex.io/\"\nlanguage: jvm\nmain_repo: \"https://github.com/ReactiveX/RxJava.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/rxjava/src/main/java/ossfuzz/IntegerObserver.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n \n package ossfuzz;\n\nimport java.util.ArrayList;\n\nimport io.reactivex.rxjava3.core.Observer;\nimport io.reactivex.rxjava3.disposables.Disposable;\n\npublic class IntegerObserver implements io.reactivex.rxjava3.core.Observer<Integer> {\n    ArrayList<Integer> m_ArrayList;\n\n    public IntegerObserver() {\n        m_ArrayList = new ArrayList<Integer>();\n    }\n\n    public void onComplete() {\n    }\n\n    public void onError(Throwable e) {\n    }\n\n    public void onNext(Integer t) {\n        m_ArrayList.add(t);\n    }\n\n    public void onSubscribe(Disposable d) {\n    }\n\n    public ArrayList<Integer> getArrayList() {\n        return m_ArrayList;\n    }\n}\n"
  },
  {
    "path": "projects/rxjava/src/main/java/ossfuzz/ObservableFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n \n package ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport io.reactivex.rxjava3.core.*;\nimport java.util.ArrayList;\n\npublic class ObservableFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        \n        ArrayList<Integer> arrayList = new ArrayList();\n        int n = data.consumeInt(1, 100);\n        for (int i = 0; i <= n; i++) {\n            arrayList.add(data.consumeInt());\n        }\n\n        Observable<Integer> items = Observable.fromIterable(arrayList);\n        IntegerObserver observer = new IntegerObserver();\n\n        items.subscribe(observer);\n        if (!observer.getArrayList().equals(arrayList)) {\n            throw new FuzzerSecurityIssueLow(\"Data Loss\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/ryu/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/dtolnay/ryu\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/ryu/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC\ncd ryu\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_ryu $OUT/\n"
  },
  {
    "path": "projects/ryu/project.yaml",
    "content": "homepage: \"https://github.com/dtolnay/ryu\"\nmain_repo: \"https://github.com/dtolnay/ryu\"\nprimary_contact: \"dtolnay@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"adetaylor@chromium.org\"\n"
  },
  {
    "path": "projects/s2geometry/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get -y install \\\n    libgflags-dev \\\n    libgoogle-glog-dev \\\n    libgtest-dev libssl-dev \\\n    make libgtest-dev \\\n    curl pkg-config \n\n# OpenSSL\nARG OPENSSL_VERSION=1.1.1g\nARG OPENSSL_HASH=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46\nRUN set -ex \\\n    && curl -s -O -L https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \\\n    && echo \"${OPENSSL_HASH}  openssl-${OPENSSL_VERSION}.tar.gz\" | sha256sum -c \\\n    && tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \\\n    && cd openssl-${OPENSSL_VERSION} \\\n    && ./Configure linux-x86_64 no-shared --static \"$CFLAGS\" \\\n    && make build_generated \\\n    && make libcrypto.a \\\n    && make install\n\nRUN git clone https://github.com/google/s2geometry\nWORKDIR $SRC/s2geometry\nCOPY run_tests.sh \\\n     build.sh \\\n     s2_fuzzer.cc \\\n     $SRC/\nCOPY project.patch $SRC/\n"
  },
  {
    "path": "projects/s2geometry/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp $SRC/s2_fuzzer.cc $SRC/s2geometry/src/\n\ncd $SRC/\ngit clone --depth=1 https://github.com/abseil/abseil-cpp\ncd abseil-cpp\nmkdir build && cd build\ncmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON ../  && make && make install\n\ncd $SRC/s2geometry\ngit apply  --ignore-space-change --ignore-whitespace $SRC/project.patch\nmkdir build && cd build\n\ncmake -DBUILD_SHARED_LIBS=OFF \\\n      -DABSL_MIN_LOG_LEVEL=4 \\\n      -DGOOGLETEST_ROOT=/usr/src/googletest \\\n      -DCMAKE_EXE_LINKER_FLAGS=\"-lssl -lcrypto\" \\\n      -DBUILD_TESTS=ON ..\nmake -j$(nproc)\nfind . -name \"s2fuzzer\" -exec cp {} $OUT/s2_fuzzer \\;\n"
  },
  {
    "path": "projects/s2geometry/project.patch",
    "content": "diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex 5d951b0..9c6358d 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -228,7 +228,11 @@ if (GOOGLETEST_ROOT)\n               src/s2/thread_testing.cc)\n endif()\n \n+add_executable(s2fuzzer src/s2_fuzzer.cc)\n+set_target_properties(s2fuzzer PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})\n+\n target_link_libraries(\n+    s2fuzzer\n     s2\n     ${OPENSSL_LIBRARIES}\n     absl::absl_vlog_is_on\n"
  },
  {
    "path": "projects/s2geometry/project.yaml",
    "content": "homepage: \"https://github.com/google/s2geometry\"\nlanguage: c++\nprimary_contact: \"jmr@google.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: \"https://github.com/google/s2geometry\"\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/s2geometry/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build -j$(nproc)\n"
  },
  {
    "path": "projects/s2geometry/s2_fuzzer.cc",
    "content": "/*\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"absl/strings/str_split.h\"\n#include \"absl/strings/string_view.h\"\n\n#include \"s2/s2shape_index.h\"\n#include \"s2/s2text_format.h\"\n\n// A string-splitter used to help validate the string\n// passed to s2\nstatic std::vector<absl::string_view> SplitString(absl::string_view str,\n                                                  char separator) {\n  std::vector<absl::string_view> result =\n      absl::StrSplit(str, separator, absl::SkipWhitespace());\n  for (auto &e : result) {\n    e = absl::StripAsciiWhitespace(e);\n  }\n  return result;\n}\n\n// Null-terminates the fuzzers input test case\nchar *null_terminated(const uint8_t *data, size_t size) {\n  char *new_str = (char *)malloc(size + 1);\n  if (new_str == NULL) {\n    return 0;\n  }\n  memcpy(new_str, data, size);\n  new_str[size] = '\\0';\n  return new_str;\n}\n\n// Do a bit of validation that is also done by s2\n// We do them here since s2 would terminate if they\n// would return false inside s2.\nbool isValidFormat(char *nt_string, size_t size) {\n  int hash_count = 0;\n  for (int i = 0; i < size; i++) {\n    if (nt_string[i] == 35) {\n      hash_count++;\n    }\n  }\n  if (hash_count != 2) {\n    return false;\n  }\n\n  std::vector<absl::string_view> strs = SplitString(nt_string, '#');\n  size_t strs_size = strs.size();\n  if (strs.size() != 3) {\n    return false;\n  }\n\n  auto index1 = absl::make_unique<MutableS2ShapeIndex>();\n  if (s2textformat::MakeIndex(nt_string, &index1) == false) {\n    return false;\n  }\n  return true;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n  if (size < 5) {\n    return 0;\n  }\n\n  char *nt_string = null_terminated(data, size);\n  if (nt_string == NULL) {\n    return 0;\n  }\n  if (isValidFormat(nt_string, size)) {\n    auto index = absl::make_unique<MutableS2ShapeIndex>();\n    s2textformat::MakeIndex(nt_string, &index);\n  }\n  free(nt_string);\n  return 0;\n}\n"
  },
  {
    "path": "projects/s2opc/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake git curl\n\n# Sources and dependencies\nRUN git clone --depth 1 https://gitlab.com/systerel/S2OPC\nRUN git clone --depth 1 https://gitlab.com/systerel/S2OPC-fuzzing-data\nRUN curl -L https://github.com/Mbed-TLS/mbedtls/releases/download/v2.28.8/mbedtls-2.28.8.tar.bz2 -o $SRC/mbedtls.tbz2\nRUN curl -L https://github.com/libcheck/check/releases/download/0.14.0/check-0.14.0.tar.gz -o $SRC/check.tgz\nRUN curl -L https://github.com/libexpat/libexpat/releases/download/R_2_4_3/expat-2.4.3.tar.gz -o $SRC/expat.tgz\n\nWORKDIR S2OPC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/s2opc/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ -f /usr/local/bin/clang-22 ]; then\n  export CFLAGS=\"${CFLAGS} -Wno-error=unterminated-string-initialization\"\nfi\n\nMBEDTLS_BUILD=$WORK/mbedtls\nEXPAT_BUILD=$WORK/expat\nS2OPC_BUILD=$WORK/s2opc\nSAMPLES=$SRC/S2OPC-fuzzing-data\n\n# Build the dependencies\n## Configure mbedtls to disable support of the AES-NI instructions, known to cause error with some sanitizers\ntar xjf $SRC/mbedtls.tbz2 -C $WORK\nsed 's,#define MBEDTLS_AESNI_C,//#define MBEDTLS_AESNI_C,' -i $WORK/mbedtls-2.*/include/mbedtls/config.h\n\nmkdir -p $MBEDTLS_BUILD\ncd $MBEDTLS_BUILD\ncmake -DPYTHON_EXECUTABLE=\"/usr/bin/python3\" \\\n      -DCMAKE_BUILD_TYPE=Release \\\n      -DCMAKE_POSITION_INDEPENDENT_CODE=ON \\\n      $WORK/mbedtls-2.*\nmake -j$(nproc)\nmake -j$(nproc) install\n\n## libcheck\ntar xzf $SRC/check.tgz -C $WORK\ncd $WORK/check-0.*\ncmake -DCMAKE_BUILD_TYPE=Release \\\n      -DCMAKE_POSITION_INDEPENDENT_CODE=1 \\\n      $WORK/check-0.*\nmake -j$(nproc)\nmake -j$(nproc) install\n\n## expat\ntar xzf $SRC/expat.tgz -C $WORK\nmkdir -p $EXPAT_BUILD\ncd $EXPAT_BUILD\ncmake -DCMAKE_BUILD_TYPE=Release \\\n      -DCMAKE_POSITION_INDEPENDENT_CODE=ON \\\n      -DEXPAT_SHARED_LIBS=OFF \\\n      $WORK/expat-2.*\nmake -j$(nproc)\nmake -j$(nproc) install\n\n# Build S2OPC and the fuzzers\nmkdir -p $S2OPC_BUILD\ncd $S2OPC_BUILD\ncmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n      -DCMAKE_C_COMPILER=\"$CC\" -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_EXE_LINKER_FLAGS=\"$CXXFLAGS\" \\\n      -DCMAKE_C_LINK_EXECUTABLE=\"$CXX <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>\" \\\n      -DWITH_OSS_FUZZ=ON -DENABLE_FUZZING=ON \\\n      $SRC/S2OPC\ncmake --build . --target fuzzers\ncp bin/* $OUT\n\n# Build the corpora\ncd $SAMPLES\nfor dir in $(find -maxdepth 1 -type d -not -name \".*\"); do\n    find $dir -exec zip -j $OUT/$(basename $dir)_fuzzer_seed_corpus.zip {} +\ndone\n"
  },
  {
    "path": "projects/s2opc/project.yaml",
    "content": "homepage: \"https://s2opc.com/\"\nlanguage: c++\nprimary_contact: \"ero.systerel@gmail.com\"\nauto_ccs:\n  - \"mcl.systerel@gmail.com\"\n  - \"vla.systerel@gmail.com\"\n  - \"vmo.systerel@gmail.com\"\n  - \"gra.systerel@gmail.com\"\nmain_repo: \"https://gitlab.com/systerel/S2OPC\"\nsanitizers:\n - address\n - memory\n - undefined\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/sacremoses/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/alvations/sacremoses sacremoses\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/sacremoses\n"
  },
  {
    "path": "projects/sacremoses/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/sacremoses/fuzz_detokenize.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport sacremoses\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  text= fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  tk = sacremoses.tokenize.MosesDetokenizer()\n  tk.detokenize(text)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sacremoses/fuzz_normalizer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1.1\n# Imports by the generated code\nimport sacremoses\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  lang = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4))\n  text = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  tk = sacremoses.normalize.MosesPunctNormalizer(lang)\n  tk.normalize(text)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sacremoses/fuzz_split_xml.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-1\n# Imports by the generated code\nimport sacremoses\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  text = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  try:\n    sacremoses.truecase.MosesTruecaser.split_xml(text)\n  except (Exception,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sacremoses/fuzz_tokenizer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1.1\n# Imports by the generated code\nimport sacremoses\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  lang= fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4))\n  text = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n\n  # Class target.\n  tk = sacremoses.tokenize.MosesTokenizer(lang)\n  tk.penn_tokenize(text)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sacremoses/project.yaml",
    "content": "homepage: https://github.com/alvations/sacremoses\nmain_repo: https://github.com/alvations/sacremoses\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/samba/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN git clone https://gitlab.com/samba-team/samba samba\nRUN samba/lib/fuzzing/oss-fuzz/build_image.sh\n\nWORKDIR samba\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/samba/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"$CFLAGS -Wno-error=strict-prototypes -Wno-error=format-truncation\"\n\nif [ -f /usr/local/bin/clang-22 ]; then\n  export CFLAGS=\"${CFLAGS} -Wno-error=uninitialized-const-pointer -Wno-error=sometimes-uninitialized\"\nfi\n# The real script is maintained in the Samba repo\nexec lib/fuzzing/oss-fuzz/build_samba.sh\n"
  },
  {
    "path": "projects/samba/project.yaml",
    "content": "homepage: \"https://samba.org\"\nmain_repo: \"https://git.samba.org/samba.git\"\nlanguage: c\nprimary_contact: \"douglas.bagnall@catalyst.net.nz\"\nauto_ccs:\n  - \"abartlet@samba.org\"\n  - \"cryptomilk@gmail.com\"\n  - \"lockyergw@gmail.com\"\n  - \"jra@google.com\"\n  - \"sloowfranklin@gmail.com\"\n  - \"gdeschner@gmail.com\"\n  - \"volker.lendecke@gmail.com\"\n  - \"davidmmulder@gmail.com\"\n  - \"jennifersutton128@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\nhelp_url: \"https://wiki.samba.org/index.php/Fuzzing\"\n"
  },
  {
    "path": "projects/scapy/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone \\\n\t--depth 1 \\\n\t--branch master \\\n\thttps://github.com/secdev/scapy.git\n\nWORKDIR scapy\n\nCOPY build.sh pcap_fuzzer.py $SRC/\n"
  },
  {
    "path": "projects/scapy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\nzip -j $OUT/pcap_fuzzer_seed_corpus.zip test/pcaps/*\n"
  },
  {
    "path": "projects/scapy/pcap_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n    import io\n    import scapy\n    import scapy.error\n    import scapy.layers.all\n    import scapy.utils\n\n\ndef TestOneInput(input_bytes):\n    try:\n        for p in scapy.utils.rdpcap(io.BytesIO(input_bytes)):\n            p.summary()\n    except scapy.error.Scapy_Exception:\n        pass\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/scapy/project.yaml",
    "content": "homepage: \"https://scapy.net\"\nmain_repo: \"https://github.com/secdev/scapy\"\nlanguage: python\nprimary_contact: \"guedou@gmail.com\"\nauto_ccs:\n  - \"julien.voisin@dustri.org\"\n  - \"ipudney@google.com\"\n  - \"evverx@gmail.com\"\nbuilds_per_day: 4\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/scikit-learn/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool libomp-dev\nRUN pip3 install --upgrade pip setuptools\nRUN pip3 install \\\n            meson \\\n            ninja \\\n            numpy \\\n            pybind11 \\\n            cython \\\n            pythran \\\n            setuptools \\\n            setuptools_scm \\\n            scipy \\\n            joblib \\\n            threadpoolctl\nRUN git clone --depth 1 https://github.com/scikit-learn/scikit-learn scikit-learn\nWORKDIR scikit-learn\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/scikit-learn/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Avoid build check as it does not work with sanitizers\nsed -i 's/def basic_check_build/def basic_check_build():\\n    return\\ndef basic_check_build2/g' ./sklearn/_build_utils/pre_build_helpers.py\n\n# Include openmp header dirs\nexport CFLAGS=\"${CFLAGS} -I/usr/lib/llvm-10/include/openmp/\"\nexport CXXFLAGS=\"${CXXFLAGS} /usr/lib/llvm-10/include/openmp/\"\n\npython3 setup.py install\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  # Add some hidden imports\n  compile_python_fuzzer $fuzzer --hidden-import=joblib --hidden-import=threadpoolctl\ndone\n"
  },
  {
    "path": "projects/scikit-learn/fuzz_preprocessing_encoders.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets sklearn.preprocessing\"\"\"\nimport os\nimport sys\nimport atheris\n\nimport numpy as np\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.preprocessing import OrdinalEncoder\n\ndef get_random_arr(fdp):\n    l1 = list()\n    for i in range(fdp.ConsumeIntInRange(1, 1000)):\n        l1.append(\n            [\n                fdp.ConsumeIntInRange(1, 1000),\n                fdp.ConsumeIntInRange(1, 1000),\n                fdp.ConsumeIntInRange(1, 1000)\n            ]\n        )\n    return l1\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    oh_x1 = np.array(get_random_arr(fdp))\n    oh_x2 = np.array(get_random_arr(fdp))\n\n    # Test that one hot encoder raises error for unknown features\n    # present during transform.\n    oh = OneHotEncoder(handle_unknown=\"error\")\n    oh.fit(oh_x1)\n    try:\n        oh.transform(oh_x2)\n    except ValueError:\n        pass\n\n    \n    oe_x1 = np.array(get_random_arr(fdp))\n    oe_x2 = np.array(get_random_arr(fdp))\n\n    oe = OrdinalEncoder(handle_unknown=\"use_encoded_value\", unknown_value=-1)\n    oe.fit(oe_x1)\n    try:\n        oe.transform(oe_x2)\n    except ValueError:\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/scikit-learn/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/scikit-learn/scikit-learn\nlanguage: python\nmain_repo: https://github.com/scikit-learn/scikit-learn\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/scipy/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN apt-get update && apt-get install -y \\\n  gfortran libopenblas-dev liblapack-dev pkg-config\n# Ensure we work from right python version\nRUN apt-get install -y python3.9 python3.9-dev && \\\n    ln --force -s /usr/bin/python3.9 /usr/local/bin/python3 && \\\n    apt-get install -y python3-pip && \\\n    python3 -m pip install cython \"atheris>=2.1.1\" \"pyinstaller==5.0.1\" \"coverage==6.3.2\"\nRUN python3 -m pip install --upgrade pip setuptools meson ninja numpy pybind11 cython pythran setuptools_scm\n\nRUN git clone https://github.com/scipy/scipy scipy\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/scipy\n"
  },
  {
    "path": "projects/scipy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\n# Avoid native LTO compilation for the dependencies under Fuzz Introspector\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n    export CFLAGS=\"\"\n    export CXXFLAGS=\"\"\nfi\n\ngit submodule update --init\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/scipy/fuzz_io_mio5.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom io import BytesIO\nfrom scipy.io.matlab._mio5 import MatFile5Reader\n\n\ndef TestOneInput(data):\n  if len(data) < 20:\n    return\n  try:\n    stream = io.BytesIO(data)\n    mat5_file_reader = MatFile5Reader(stream)\n    mat5_file_reader.get_variables()\n  except TypeError:\n    # Runs into this fast. Not interesting.\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/scipy/fuzz_io_wavfile.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom scipy.io import wavfile\n\n\ndef TestOneInput(data):\n  # Give enough bytes to pass initial checks\n  if len(data) < 20:\n    return\n  wav_filepath = \"/tmp/temp.wav\"\n  with open(wav_filepath, \"wb\") as f:\n    f.write(data)\n  try:\n    wavfile.read(wav_filepath)\n  except ValueError:\n    # Not interesting.\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/scipy/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/scipy/scipy\nlanguage: python\nmain_repo: https://github.com/scipy/scipy\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/scorecard-web/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/ossf/scorecard-webapp\n\nCOPY build.sh $SRC\nWORKDIR $SRC/scorecard-webapp/app/server\n"
  },
  {
    "path": "projects/scorecard-web/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_native_go_fuzzer_v2 github.com/ossf/scorecard-webapp/app/server FuzzVerifyWorkflow FuzzVerifyWorkflow\ncompile_native_go_fuzzer_v2 github.com/ossf/scorecard-webapp/app/server FuzzExtractCertInfo FuzzLoadCertificates\n"
  },
  {
    "path": "projects/scorecard-web/project.yaml",
    "content": "homepage: \"https://github.com/ossf/scorecard-webapp\"\nmain_repo: \"https://github.com/ossf/scorecard-webapp\"\nprimary_contact: \"naveensrinivasan@protonmail.com\"\nauto_ccs:\n  - azeems@google.com\n  - laurentsimon@google.com\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/scrypt/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust:ubuntu-24-04\n\nRUN git clone https://github.com/RustCrypto/password-hashes\nWORKDIR $SRC/password-hashes\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/scrypt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the fuzzers and project source code\ncargo fuzz build\n\n# Copy built fuzzer binaries to $OUT\nfind $SRC/password-hashes/fuzz/target/x86_64-unknown-linux-gnu/release -maxdepth 1 -name scrypt* \\\n    -type f -perm -u=x -exec cp {} $OUT \\;\n"
  },
  {
    "path": "projects/scrypt/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://docs.rs/scrypt\"\nmain_repo: \"https://github.com/RustCrypto/password-hashes\"\nprimary_contact: \"newpavlov@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"bascule@gmail.com\"\n"
  },
  {
    "path": "projects/selinux/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y --no-install-recommends bison \\\n\tflex \\\n\tgawk \\\n\tgettext \\\n\tmake \\\n\tlibaudit-dev \\\n\tlibbz2-dev \\\n\tlibcap-dev \\\n\tlibcap-ng-dev \\\n\tlibglib2.0-dev \\\n\tlibpcre2-dev\nRUN git clone --depth 1 https://github.com/SELinuxProject/selinux\nWORKDIR selinux\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/selinux/build.sh",
    "content": "#!/bin/bash -e\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n./scripts/oss-fuzz.sh\n"
  },
  {
    "path": "projects/selinux/project.yaml",
    "content": "homepage: \"https://github.com/SELinuxProject/selinux\"\nlanguage: c\nprimary_contact: \"nicolas.iooss_ossfuzzselinux@m4x.org\"\nbuilds_per_day: 4\nsanitizers:\n  - address\n  - undefined\n  - memory\nauto_ccs:\n  - evverx@gmail.com\n  - nicolas.iooss.ossfuzz@gmail.com\n  - omosnacek@gmail.com\n  - jwcart2@gmail.com\n  - cgzones@googlemail.com\nmain_repo: 'https://github.com/SELinuxProject/selinux'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/sentencepiece/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool cmake build-essential pkg-config libgoogle-perftools-dev\nRUN git clone --depth 1 https://github.com/google/sentencepiece.git sentencepiece\nWORKDIR sentencepiece\nCOPY run_tests.sh build.sh *.cc $SRC/\n"
  },
  {
    "path": "projects/sentencepiece/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -x\n\n# build project\nmkdir build\ncd build\ncmake ../ -B ./ -DSPM_ENABLE_SHARED=ON -DCMAKE_INSTALL_PREFIX=./root -DSPM_BUILD_TEST=ON\ncmake --build ./ --config Release --target install --parallel $(nproc)\n\n# build fuzzers\nfuzzers=$(find $SRC -name '*_fuzzer.cc' | grep -v 'third_party')\necho \"Found fuzzers: ${fuzzers[@]}\"\nfor fuzzer in \"${fuzzers[@]}\"; do\n  fuzz_basename=$(basename -s .cc $fuzzer)\n  $CXX $CXXFLAGS -std=c++17 \\\n      -I. -I./root/include \\\n      $fuzzer $LIB_FUZZING_ENGINE \\\n      ./root/lib/*.a \\\n      -o $OUT/$fuzz_basename\ndone\n"
  },
  {
    "path": "projects/sentencepiece/project.yaml",
    "content": "homepage: \"https://github.com/google/sentencepiece\"\nlanguage: c++\nprimary_contact: \"taku@google.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: 'https://github.com/google/sentencepiece.git'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/sentencepiece/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build -j$(nproc)\n"
  },
  {
    "path": "projects/sentencepiece/sample_encode_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <cstddef>\n#include <cstdint>\n#include <string>\n#include <vector>\n\n#include \"sentencepiece_processor.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  sentencepiece::SentencePieceProcessor fuzz_sp_processor;\n  FuzzedDataProvider data_provider(data, size);\n  const int nbest_size = data_provider.ConsumeIntegral<int>();\n  const float alpha = data_provider.ConsumeFloatingPoint<float>();\n  const std::string in_string = data_provider.ConsumeRemainingBytesAsString();\n\n  fuzz_sp_processor.SampleEncodeAsSerializedProto(in_string, nbest_size, alpha);\n  return 0;\n}\n"
  },
  {
    "path": "projects/serde-yaml/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/dtolnay/serde-yaml serde-yaml\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/serde-yaml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/serde-yaml\ncargo fuzz build -O \ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_from_slice $OUT/\n"
  },
  {
    "path": "projects/serde-yaml/project.yaml",
    "content": "homepage: \"https://github.com/dtolnay/serde-yaml\"\nprimary_contact: \"dtolnay@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/dtolnay/serde-yaml'\n"
  },
  {
    "path": "projects/serde_json/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl cmake python llvm-dev libclang-dev clang\n\nRUN git clone --depth 1 https://github.com/serde-rs/json json\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/serde_json/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Note: This project creates Rust fuzz targets exclusively\ncd $SRC/json\ncargo fuzz build -O \ncp fuzz/target/x86_64-unknown-linux-gnu/release/from_slice $OUT/\n"
  },
  {
    "path": "projects/serde_json/project.yaml",
    "content": "homepage: \"https://github.com/serde-rs/json\"\nprimary_contact: \"dtolnay@gmail.com\"\nmain_repo: \"https://github.com/serde-rs/json\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/serde_urlencoded/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust as builder\n\n## Install build dependencies.\nRUN apt-get update\nRUN git clone --depth 1 https://github.com/nox/serde_urlencoded\nCOPY build.sh $SRC/\nCOPY /fuzz $SRC/serde_urlencoded/fuzz"
  },
  {
    "path": "projects/serde_urlencoded/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/serde_urlencoded\ncargo fuzz build -O\n\nFUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/serde_urlencoded/fuzz/Cargo.toml",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n[package]\nname = \"serde_urlencoded-fuzz\"\nversion = \"0.0.0\"\npublish = false\nedition = \"2018\"\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies]\narbitrary = { version = \"1.2.3\", features = [\"derive\"] }\nlibfuzzer-sys = \"0.4\"\nserde = { version = \"1.0.100\", features = [\"derive\"] }\n\n[dependencies.serde_urlencoded]\npath = \"..\"\n\n# Prevent this from interfering with workspaces\n[workspace]\nmembers = [\".\"]\n\n[features]\ndebug = []\n\n[[bin]]\nname = \"roundtrip\"\npath = \"fuzz_targets/roundtrip.rs\"\ntest = false\ndoc = false\n\n[profile.release]\ndebug = true\n\n[[bin]]\nname = \"reverse_roundtrip\"\npath = \"fuzz_targets/reverse_roundtrip.rs\"\ntest = false\ndoc = false\n"
  },
  {
    "path": "projects/serde_urlencoded/fuzz/fuzz_targets/reverse_roundtrip.rs",
    "content": "/*\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#![no_main]\n\nuse arbitrary::Arbitrary;\nuse libfuzzer_sys::fuzz_target;\nuse serde::{Deserialize, Serialize};\nuse serde_urlencoded;\nuse std::collections::HashMap;\nuse std::fmt::Debug;\n\n#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Arbitrary)]\nenum PlainEnum {\n    A,\n    B,\n    C,\n    D,\n}\n\n#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Arbitrary)]\nenum Enum {\n    A(u8),\n    B(()),\n    C(Vec<PlainEnum>),\n    D(i128),\n    E { a: u8 },\n    F(u8, u8),\n}\n\n#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Arbitrary)]\nstruct UnitStruct;\n\n#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Arbitrary)]\nstruct BasicStruct {\n    a: i8,\n}\n\ntype PairKey = u64;\n\n#[derive(Debug, Clone, PartialEq, Arbitrary, Serialize, Deserialize)]\nstruct Data {\n    _bool: bool,\n    _i8: i8,\n    _i16: i16,\n    _i32: i32,\n    _i64: i64,\n    _i128: i128,\n    _u8: u8,\n    _u16: u16,\n    _u32: u32,\n    _u64: u64,\n    _u128: u128,\n    _char: char,\n    _string: String,\n    _unit: (),\n    _tuple: (u8, u16, String),\n    _enum: Enum,\n    _plain_enum: PlainEnum,\n    _vec_enum: Vec<Enum>,\n    _vec_plain_enum: Vec<PlainEnum>,\n    _vec_bool: Vec<bool>,\n    _vec_char: Vec<char>,\n    _vec_u8: Vec<u8>,\n    _vec_u16: Vec<u16>,\n    _vec_u32: Vec<u32>,\n    _vec_u64: Vec<u64>,\n    _vec_i8: Vec<i8>,\n    _vec_i16: Vec<i16>,\n    _vec_i32: Vec<i32>,\n    _vec_i64: Vec<i64>,\n    _vec_f32: Vec<f32>,\n    _vec_f64: Vec<f64>,\n    _vec_pair: Vec<(String, String)>,\n    _vec_pair_option: Vec<(PairKey, Option<()>)>,\n    _vec_pair_vec_u8: Vec<(PairKey, Vec<u8>)>,\n    _vec_pair_bool: Vec<(PairKey, bool)>,\n    _vec_pair_char: Vec<(PairKey, u64)>,\n    _vec_pair_i8: Vec<(PairKey, i8)>,\n    _vec_pair_i16: Vec<(PairKey, i8)>,\n    _vec_pair_i32: Vec<(PairKey, i8)>,\n    _vec_pair_i64: Vec<(PairKey, i8)>,\n    _vec_pair_u8: Vec<(PairKey, u8)>,\n    _vec_pair_u16: Vec<(PairKey, u16)>,\n    _vec_pair_u32: Vec<(PairKey, u32)>,\n    _vec_pair_u64: Vec<(PairKey, u64)>,\n    _vec_pair_f32: Vec<(PairKey, f32)>,\n    _vec_pair_f64: Vec<(PairKey, f64)>,\n    _vec_pair_variant: Vec<(PairKey, Enum)>,\n    _vec_pair_basic_struct: Vec<(PairKey, BasicStruct)>,\n    _vec_tuple: Vec<(String, String, String)>,\n    _hashmap: HashMap<PairKey, String>,\n}\n\nfn round_trip<T>(val: T, check_equality: bool)\nwhere\n    T: PartialEq + Serialize + for<'a> Deserialize<'a> + Debug + Clone,\n{\n    use std::io::Cursor;\n    match serde_urlencoded::to_string(&val) {\n        Ok(encoded_url) => {\n            let reader = Cursor::new(&encoded_url);\n            _ = serde_urlencoded::from_reader::<T, std::io::Cursor<&std::string::String>>(reader);\n            let decoded: T = serde_urlencoded::from_str::<T>(&encoded_url).unwrap();\n            if check_equality {\n                assert_eq!(decoded, val);\n            }\n        }\n        Err(err) => {\n            _ = format!(\"{err:#?}\");\n            _ = format!(\"{err:?}\");\n        }\n    }\n}\n\nfuzz_target!(|data: Data| {\n    round_trip(data._bool.clone(), true);\n    round_trip(data._i8.clone(), true);\n    round_trip(data._i16.clone(), true);\n    round_trip(data._i32.clone(), true);\n    round_trip(data._i64.clone(), true);\n    round_trip(data._i128.clone(), true);\n    round_trip(data._u8.clone(), true);\n    round_trip(data._u16.clone(), true);\n    round_trip(data._u32.clone(), true);\n    round_trip(data._u64.clone(), true);\n    round_trip(data._u128.clone(), true);\n    round_trip(data._char.clone(), true);\n    round_trip(data._string.clone(), true);\n    round_trip(data._unit.clone(), true);\n    round_trip(data._tuple.clone(), true);\n    round_trip(data._enum.clone(), true);\n    round_trip(data._plain_enum.clone(), true);\n    round_trip(data._vec_enum.clone(), true);\n    round_trip(data._vec_plain_enum.clone(), true);\n    round_trip(data._vec_char.clone(), true);\n    round_trip(data._vec_bool.clone(), true);\n    round_trip(data._vec_u8.clone(), true);\n    round_trip(data._vec_u16.clone(), true);\n    round_trip(data._vec_u32.clone(), true);\n    round_trip(data._vec_u64.clone(), true);\n    round_trip(data._vec_i8.clone(), true);\n    round_trip(data._vec_i16.clone(), true);\n    round_trip(data._vec_i32.clone(), true);\n    round_trip(data._vec_i64.clone(), true);\n    round_trip(data._vec_f32.clone(), true);\n    round_trip(data._vec_f64.clone(), true);\n    round_trip(data._vec_pair.clone(), true);\n    round_trip(data._vec_pair_option.clone(), false);\n    round_trip(data._vec_pair_bool.clone(), true);\n    round_trip(data._vec_pair_char.clone(), true);\n    round_trip(data._vec_pair_i8.clone(), true);\n    round_trip(data._vec_pair_i16.clone(), true);\n    round_trip(data._vec_pair_i32.clone(), true);\n    round_trip(data._vec_pair_i64.clone(), true);\n    round_trip(data._vec_pair_u8.clone(), true);\n    round_trip(data._vec_pair_u16.clone(), true);\n    round_trip(data._vec_pair_u32.clone(), true);\n    round_trip(data._vec_pair_u64.clone(), true);\n    round_trip(data._vec_pair_variant.clone(), true);\n    round_trip(data._vec_pair_vec_u8.clone(), true);\n    round_trip(data._vec_tuple.clone(), true);\n    round_trip(data._hashmap.clone(), true);\n});\n"
  },
  {
    "path": "projects/serde_urlencoded/fuzz/fuzz_targets/roundtrip.rs",
    "content": "/*\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#![no_main]\nuse libfuzzer_sys::fuzz_target;\n\nuse serde::{Deserialize, Serialize};\n\n#[derive(Debug, Serialize, Deserialize, PartialEq)]\nenum PlainEnum {\n    A,\n    B,\n    C,\n    D,\n}\n\n#[derive(Debug, Serialize, Deserialize, PartialEq)]\nenum Enum {\n    A(u8),\n    B(()),\n    C(Vec<PlainEnum>),\n    D(i128),\n    E { x: i8, y: String },\n    F(u8, u8),\n}\n\n#[derive(Debug, Serialize, Deserialize, PartialEq)]\nenum FloatEnum {\n    A(Enum),\n    E(Option<f32>),\n}\n\n#[derive(Debug, Serialize, Deserialize, PartialEq)]\nstruct TupleStruct(i32, String, i64);\n\n#[derive(Debug, Serialize, Deserialize, PartialEq)]\nstruct Struct {\n    _a: (),\n    _b: u8,\n    _c: Vec<Enum>,\n    _d: (u128, i8, (), PlainEnum, String),\n}\n\n#[derive(Debug, Serialize, Deserialize, PartialEq)]\nstruct FloatStruct {\n    _a: Struct,\n    _b: f64,\n}\n\nmacro_rules! round_trip {\n    ($ty:ty, $data:ident, $equality:expr) => {{\n        #[cfg(feature = \"debug\")]\n        println!(\"roundtripping {}\", stringify!($ty));\n\n        match ::serde_urlencoded::from_bytes::<$ty>($data) {\n            Ok(inner) => {\n                #[cfg(feature = \"debug\")]\n                dbg!(&inner);\n\n                let ser = ::serde_urlencoded::to_string(&inner)\n                    .expect(\"a deserialized type should serialize\");\n                #[cfg(feature = \"debug\")]\n                dbg!(&ser);\n\n                let des: $ty = ::serde_urlencoded::from_bytes(ser.as_bytes())\n                    .expect(\"a serialized type should deserialize\");\n                #[cfg(feature = \"debug\")]\n                dbg!(&des);\n\n                if $equality {\n                    assert_eq!(inner, des, \"roundtripped object changed\");\n                }\n            }\n            Err(e) => {\n                _ = format!(\"{e:?}\");\n                _ = format!(\"{e:#?}\");\n            }\n        }\n    }};\n}\n\nmacro_rules! from_bytes {\n    ($ty:ty, $data_iter:ident, $equality:expr) => {{\n        let data = $data_iter.next().unwrap_or(&[]);\n        round_trip!($ty, data, $equality);\n        let data = $data_iter.next().unwrap_or(&[]);\n        round_trip!(Vec<$ty>, data, $equality);\n        let data = $data_iter.next().unwrap_or(&[]);\n        round_trip!(Option<$ty>, data, $equality);\n        let data = $data_iter.next().unwrap_or(&[]);\n        round_trip!(std::collections::HashMap<i32,$ty>, data, $equality);\n    }};\n}\n\nfuzz_target!(|data: Vec<&[u8]>| {\n    let mut data_iter = data.iter().copied();\n    from_bytes!(bool, data_iter, true);\n    from_bytes!(i8, data_iter, true);\n    from_bytes!(i16, data_iter, true);\n    from_bytes!(i32, data_iter, true);\n    from_bytes!(i64, data_iter, true);\n    from_bytes!(i128, data_iter, true);\n    from_bytes!(u8, data_iter, true);\n    from_bytes!(u16, data_iter, true);\n    from_bytes!(u32, data_iter, true);\n    from_bytes!(u64, data_iter, true);\n    from_bytes!(u128, data_iter, true);\n    from_bytes!(f32, data_iter, false);\n    from_bytes!(f64, data_iter, false);\n    from_bytes!(char, data_iter, true);\n    from_bytes!(&str, data_iter, true);\n    from_bytes!((String, i8), data_iter, true);\n    from_bytes!((String, String), data_iter, true);\n    from_bytes!((String, Option<String>), data_iter, false);\n    from_bytes!((String, Option<i32>), data_iter, false);\n    from_bytes!(TupleStruct, data_iter, true);\n    from_bytes!((), data_iter, true);\n    from_bytes!(PlainEnum, data_iter, true);\n    from_bytes!(Enum, data_iter, true);\n    from_bytes!(FloatEnum, data_iter, false);\n    from_bytes!(Struct, data_iter, true);\n    from_bytes!(FloatStruct, data_iter, false);\n});\n"
  },
  {
    "path": "projects/serde_urlencoded/project.yaml",
    "content": "homepage: \"https://github.com/nox/serde_urlencoded\"\nlanguage: rust\nprimary_contact: \"github@borowski.pw\"\nauto_ccs:\n  - \"paolo@paolo565.org\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/nox/serde_urlencoded'"
  },
  {
    "path": "projects/serenity/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y build-essential cmake curl ninja-build\nRUN git clone https://github.com/SerenityOS/serenity\nCOPY build.sh $SRC/\nWORKDIR $SRC/serenity/Meta/Lagom\n"
  },
  {
    "path": "projects/serenity/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Now build the content\n./BuildFuzzers.sh --oss-fuzz\n\n"
  },
  {
    "path": "projects/serenity/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/SerenityOS/serenity\"\nlanguage: c++\nprimary_contact: \"jelle@gmta.nl\"\nauto_ccs:\n  - \"david@adalogics.com\"\n  - \"mail@linusgroh.de\"\n  - \"ali.mpfard@gmail.com\"\n  - \"luke.wilde@live.co.uk\"\n  - \"bugaevc@serenityos.org\"\n  - \"b.gianfo@gmail.com\"\n  - \"idan.horowitz@gmail.com\"\n  - \"timledbetter@gmail.com\"\n  - \"thakis@chromium.org\"\n  - \"lucas.chollet@serenityos.org\"\n\n# Bug reports are public by default:\nview_restrictions: none\nmain_repo: 'https://github.com/SerenityOS/serenity'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/servo/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/servo/html5ever\nRUN git clone --depth 1 https://github.com/servo/rust-cssparser\nRUN git clone --depth 1 https://github.com/servo/rust-url\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/servo/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/html5ever/html5ever/fuzz\ncargo update -p serde --precise 1.0.200\ncd ..\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_document_parse $OUT/\n\ncd $SRC/html5ever/xml5ever/fuzz\ncargo update -p serde --precise 1.0.200\ncd ..\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_document_parse $OUT/\n\ncd $SRC/rust-cssparser\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/cssparser $OUT/fuzz-cssparser\n\ncd $SRC/rust-url/url\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz-url $OUT/fuzz-url\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse $OUT/fuzz-url-parse\n"
  },
  {
    "path": "projects/servo/project.yaml",
    "content": "homepage: \"https://github.com/servo\"\nprimary_contact: \"oss-fuzz@servo.org\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"mrlachatte@gmail.com\"\n  - \"vgosu@mozilla.com\"\n  - \"david@adalogics.com\"\n  - \"ealvarez@mozilla.com\"\n  - \"fuzzing@fuchsia.dev\"\nmain_repo: 'https://github.com/servo/servo'\n"
  },
  {
    "path": "projects/servo-core/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/Netflix/servo\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nCOPY pom-core.xml $SRC/servo/servo-core/pom.xml\nWORKDIR $SRC/servo"
  },
  {
    "path": "projects/servo-core/MonitorConfigFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.netflix.servo.monitor.*;\nimport com.netflix.servo.tag.BasicTagList;\nimport com.netflix.servo.tag.SortedTagList;\nimport com.netflix.servo.tag.TagList;\n\npublic class MonitorConfigFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String key = data.consumeString(500);\n        String value = data.consumeString(500);\n        String name = data.consumeRemainingAsString();\n        if (key.isEmpty() || value.isEmpty()) {\n            return;\n        }\n\n        TagList tags1 = new BasicTagList(SortedTagList.builder()\n            .withTag(key, value)\n            .build());\n        \n        MonitorConfig m = new MonitorConfig.Builder(name).withTags(tags1).build();\n        m.getName();\n        m.getTags();\n        m.hashCode();\n        m.getPublishingPolicy();\n\n        new BasicCounter(m);\n\t}\n}"
  },
  {
    "path": "projects/servo-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd servo-core\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/servo-core-$CURRENT_VERSION-jar-with-dependencies.jar\" \"$OUT/servo-core.jar\"\n\nALL_JARS=\"servo-core.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/servo-core/pom-core.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n    <name>archaius-core</name> \n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.netflix.servo</groupId>\n    <artifactId>servo-core</artifactId>\n    <version>0.13.2</version>\n    <packaging>jar</packaging>\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-assembly-plugin</artifactId>\n                <executions>\n                    <execution>\n                        <phase>package</phase>\n                        <goals>\n                            <goal>single</goal>\n                        </goals>\n                        <configuration>\n                            <descriptorRefs>\n                                <descriptorRef>jar-with-dependencies</descriptorRef>\n                            </descriptorRefs>\n                        </configuration>\n                    </execution>\n                </executions>\n            </plugin>\n        </plugins>\n      </build>\n    <properties>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n    </properties>\n    <dependencies>\n        <dependency>\n            <groupId>javax.annotation</groupId>\n            <artifactId>javax.annotation-api</artifactId>\n            <version>1.3.2</version>\n        </dependency>\n        <dependency>\n            <groupId>org.slf4j</groupId>\n            <artifactId>slf4j-api</artifactId>\n            <version>1.7.36</version>\n        </dependency>\n        <dependency>\n            <groupId>org.slf4j</groupId>\n            <artifactId>slf4j-nop</artifactId>\n            <version>1.7.5</version>\n        </dependency>\n        <dependency>\n            <groupId>com.google.guava</groupId>\n            <artifactId>guava</artifactId>\n            <version>16.0</version>\n        </dependency>\n        <dependency>\n            <groupId>com.netflix.spectator</groupId>\n            <artifactId>spectator-api</artifactId>\n            <version>1.3.1</version>\n        </dependency>\n        <dependency>\n            <groupId>org.testng</groupId>\n            <artifactId>testng</artifactId>\n            <version>6.1.1</version>\n        </dependency>\n    </dependencies>\n    <description>archaius-core</description>\n    <url>https://github.com/Netflix/archaius</url>\n</project>\n"
  },
  {
    "path": "projects/servo-core/project.yaml",
    "content": "homepage: \"https://github.com/Netflix/servo\"\nlanguage: jvm\nmain_repo: \"https://github.com/Netflix/servo.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/setuptools/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d223a882810372830fd7968eb3e64533f3a2318c90be43ac753a46a15946faec\nRUN git clone --depth 1 --single-branch https://github.com/pypa/setuptools setuptools\nRUN git clone --depth 1 --single-branch https://github.com/pypa/distutils distutils\nRUN python3 -m pip install --upgrade pip \\\n    && python3 -m pip install 'pyinstaller==6.10.0' tomli tomli-w railroad-diagrams pyparsing jinja2\nRUN urls=\"\\\nhttps://raw.githubusercontent.com/google/fuzzing/master/dictionaries/utf8.dict \\\nhttps://raw.githubusercontent.com/google/fuzzing/master/dictionaries/toml.dict\" \\\n  && target_file=\"$SRC/__base.dict\" \\\n  && echo $urls | xargs -n 1 wget -qO- >> $target_file\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/setuptools\n"
  },
  {
    "path": "projects/setuptools/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake_dictionary_for_fuzz_harness() {\n  local fuzz_harness=\"$1\"\n  local base_dictionary=\"$SRC/__base.dict\"\n  local output_dict=\"$OUT/${fuzz_harness##*/}\"\n  output_dict=\"${output_dict%.py}.dict\"\n\n  [[ -r \"$base_dictionary\" ]] && {\n    [[ -s \"$output_dict\" ]] && echo >>\"$output_dict\"\n    cat \"$base_dictionary\" >>\"$output_dict\"\n  }\n}\n\n\n# We need this because pyinstaller used in OSS-Fuzz will affect\n# the path, which causes this assert check to fail.\nsed -i 's/def do_override():/def do_override():\\n    return True\\n\\ndef do_override2():/g' _distutils_hack/__init__.py\n\npushd \"$SRC/distutils\"\npip3 install .\npopd\n\npip3 install .\n\ncd ../\nmkdir forbuilding\ncd forbuilding\n# Build fuzzers in $OUT.\nfor fuzzer in $(find \"$SRC\" -name 'fuzz_*.py'); do\n  compile_python_fuzzer \"$fuzzer\"\n  make_dictionary_for_fuzz_harness \"$fuzzer\"\ndone\n\n\nwget https://raw.githubusercontent.com/pypa/setuptools/main/pyproject.toml\nzip $OUT/fuzz_config_pyprojecttoml_seed_corpus.zip ./pyproject.toml\n"
  },
  {
    "path": "projects/setuptools/fuzz_config_pyprojecttoml.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport os\nimport tempfile\nimport atheris\n\nwith atheris.instrument_imports():\n    import tomli\n    from setuptools.config.pyprojecttoml import (read_configuration)\n    from setuptools.errors import FileError\n\n\ndef TestOneInput(data):\n  \"\"\"Fuzzer read_configuration assuming any valid toml file should not\n  cause exceptions to happen.\n  \"\"\"\n  fdp = atheris.FuzzedDataProvider(data)\n  with tempfile.TemporaryDirectory() as temp_dir:\n    config_path = os.path.join(temp_dir, \"pyproject.taml\")\n    with open(config_path, \"w\") as cf:\n      cf.write(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096)))\n\n  try:\n    config = read_configuration(config_path)\n  except (tomli.TOMLDecodeError, FileError):\n    return -1\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/setuptools/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pypa/setuptools\nlanguage: python\nmain_repo: https://github.com/pypa/setuptools\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/shaderc/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y build-essential make cmake ninja-build\n\n\nRUN git clone https://github.com/KhronosGroup/glslang && \\\n    mkdir -p $SRC/glsl_seed && \\\n    cp $SRC/glslang/Test/*.frag $SRC/glsl_seed\nRUN git clone https://github.com/google/shaderc shaderc\nWORKDIR $SRC/shaderc\n\nCOPY *.cc *.sh *.diff $SRC/\n"
  },
  {
    "path": "projects/shaderc/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Sync dependencies\n./utils/git-sync-deps\n\n# Build the project binaries with ninja and cmake\nmkdir -p build\npushd build\ncmake -GNinja -DCMAKE_BUILD_TYPE=Release \\\n      -DCMAKE_CXX_FLAGS=\"$CXXFLAGS -pthread -stdlib=libc++\" \\\n      -DSHADERC_SKIP_TESTS=True \\\n      -DSHADERC_ENABLE_TESTS=ON \\\n      -DSHADERC_SKIP_COPYRIGHT_CHECK=True \\\n      -DSHADERC_SKIP_EXAMPLES=True \\\n      -DSHADERC_ENABLE_EXAMPLES=OFF \\\n      ..\nninja -v -j$(nproc)\npopd\n\nTARGET_FUZZER=${1:-}\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*_fuzzer.cc'); do\n  fuzz_basename=$(basename -s .cc $fuzzer)\n  if [[ -n \"$TARGET_FUZZER\" && \"$TARGET_FUZZER\" != \"$fuzz_basename\" ]]; then\n    continue\n  fi\n  $CXX $CXXFLAGS -I$SRC/shaderc/libshaderc/include \\\n      -I$SRC/shaderc/libshaderc_util/include \\\n      -I$SRC/shaderc/glslc/src -I$SRC/shaderc/third_party/glslang \\\n      -c ${fuzzer} -o ${fuzz_basename}.o\n\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n      ${fuzz_basename}.o -o $OUT/${fuzz_basename} \\\n      -Wl,--start-group \\\n      $SRC/shaderc/build/libshaderc/*.a \\\n      $SRC/shaderc/build/libshaderc_util/libshaderc_util.a \\\n      $SRC/shaderc/build/glslc/libglslc.a \\\n      -Wl,--end-group\n  zip -q $OUT/${fuzz_basename}_seed_corpus.zip $SRC/glsl_seed/*\ndone\n\n"
  },
  {
    "path": "projects/shaderc/glslc_fuzzer.cc",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstdlib>\n#include <filesystem>\n#include <fstream>\n#include <string>\n\n#include \"file_compiler.h\"\n#include <shaderc/shaderc.hpp>\n\nnamespace fs = std::filesystem;\n\nstd::string CreateTemporaryGLSLFile(const std::string &shader_content) {\n  std::string temp_dir = fs::temp_directory_path().string();\n  std::string temp_file =\n      temp_dir + \"/temp_shader_\" + std::to_string(rand()) + \".glsl\";\n  std::ofstream ofs(temp_file);\n  ofs << shader_content;\n  ofs.close();\n  return temp_file;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Create temporary glsl file with valid structure and fuzzed data\n  // std::string shader_content = GenerateShaderContent(data, size);\n  std::string payload(reinterpret_cast<const char *>(data), size);\n  std::string temp_shader_file = CreateTemporaryGLSLFile(payload);\n\n  // Initialize FileCompiler and options\n  glslc::FileCompiler file_compiler;\n  file_compiler.options().SetSuppressWarnings();\n  file_compiler.AddIncludeDirectory(fs::temp_directory_path().string());\n  file_compiler.SetOutputFileName(\"-\");\n\n  file_compiler.SetSpirvBinaryOutputFormat(\n      glslc::FileCompiler::SpirvBinaryEmissionFormat::WGSL);\n\n  glslc::InputFileSpec input_spec = {temp_shader_file,\n                                     shaderc_glsl_fragment_shader,\n                                     shaderc_source_language_glsl, \"main\"};\n\n  // Fuzz common CompileShaderFile\n  file_compiler.CompileShaderFile(input_spec);\n\n  // Fuzz Preprocessing\n  file_compiler.SetPreprocessingOnlyFlag();\n  file_compiler.ValidateOptions(1);\n  file_compiler.CompileShaderFile(input_spec);\n\n  // Fuzz CompileShaderFile with DisassemblyFlag\n  file_compiler.SetDisassemblyFlag();\n  file_compiler.CompileShaderFile(input_spec);\n\n  // Cleanup the temporary file\n  fs::remove(temp_shader_file);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/shaderc/project.yaml",
    "content": "homepage: \"https://github.com/google/shaderc\"\nmain_repo: \"https://github.com/google/shaderc.git\"\nprimary_contact: \"david@adalogics.com\"\nlanguage: c++\nsanitizers:\n- address\nauto_ccs:\n- \"adam@adalogics.com\"\n- \"arthur.chan@adalogics.com\"\n- \"dneto@google.com\"\n- \"dsinclair@google.com\"\n- \"fuzzing@fuchsia.dev\"\n- \"nathangauer@google.com\"\n- \"stevenperron@google.com\"\n"
  },
  {
    "path": "projects/shaderc/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Patch out failling test\ngit apply $SRC/run_tests_patch.diff\n\nexport CTEST_PARALLEL_LEVEL=$(nproc)\ncd build\nninja test\ncd ../\n\n# Restore set up\ngit apply -R $SRC/run_tests_patch.diff\n"
  },
  {
    "path": "projects/shaderc/run_tests_patch.diff",
    "content": "diff --git a/glslc/test/option_fmax_id_bound.py b/glslc/test/option_fmax_id_bound.py\nindex b5548bc..7510550 100644\n--- a/glslc/test/option_fmax_id_bound.py\n+++ b/glslc/test/option_fmax_id_bound.py\n@@ -33,13 +33,13 @@ void main() {\n }\n \"\"\"\n \n-@inside_glslc_testsuite('OptionFMaxIdBound')\n-class TestFMaxIdBoundLow(expect.ErrorMessageSubstr):\n-    \"\"\"Tests that compilation fails with a low -fmax-id-bound.\"\"\"\n-\n-    shader = FileShader(COMPUTE_SHADER, \".comp\")\n-    glslc_args = ['-c', shader, '-fmax-id-bound=300', '-O']\n-    expected_error_substr = [\" ID overflow. Try running compact-ids\"]\n+#@inside_glslc_testsuite('OptionFMaxIdBound')\n+#class TestFMaxIdBoundLow(expect.ErrorMessageSubstr):\n+#    \"\"\"Tests that compilation fails with a low -fmax-id-bound.\"\"\"\n+#\n+#    shader = FileShader(COMPUTE_SHADER, \".comp\")\n+#    glslc_args = ['-c', shader, '-fmax-id-bound=300', '-O']\n+#    expected_error_substr = [\" ID overflow. Try running compact-ids\"]\n \n \n @inside_glslc_testsuite('OptionFMaxIdBound')\n"
  },
  {
    "path": "projects/shaderc/shaderc_fdp_fuzzer.cc",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstring>\n#include <iostream>\n#include <string>\n#include <vector>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <shaderc/shaderc.h>\n#include <shaderc/shaderc.hpp>\n\nconst std::array<shaderc_optimization_level, 3> OptArray = {\n    shaderc_optimization_level_zero,\n    shaderc_optimization_level_size,\n    shaderc_optimization_level_performance,\n};\n\nconst std::array<shaderc_shader_kind, 44> KindArray = {\n    shaderc_vertex_shader,\n    shaderc_fragment_shader,\n    shaderc_compute_shader,\n    shaderc_geometry_shader,\n    shaderc_tess_control_shader,\n    shaderc_tess_evaluation_shader,\n\n    shaderc_glsl_vertex_shader,\n    shaderc_glsl_fragment_shader,\n    shaderc_glsl_compute_shader,\n    shaderc_glsl_geometry_shader,\n    shaderc_glsl_tess_control_shader,\n    shaderc_glsl_tess_evaluation_shader,\n\n    shaderc_glsl_infer_from_source,\n    shaderc_glsl_default_vertex_shader,\n    shaderc_glsl_default_fragment_shader,\n    shaderc_glsl_default_compute_shader,\n    shaderc_glsl_default_geometry_shader,\n    shaderc_glsl_default_tess_control_shader,\n    shaderc_glsl_default_tess_evaluation_shader,\n    shaderc_spirv_assembly,\n    shaderc_raygen_shader,\n    shaderc_anyhit_shader,\n    shaderc_closesthit_shader,\n    shaderc_miss_shader,\n    shaderc_intersection_shader,\n    shaderc_callable_shader,\n\n    shaderc_glsl_raygen_shader,\n    shaderc_glsl_anyhit_shader,\n    shaderc_glsl_closesthit_shader,\n    shaderc_glsl_miss_shader,\n\n    shaderc_glsl_intersection_shader,\n    shaderc_glsl_callable_shader,\n    shaderc_glsl_default_raygen_shader,\n    shaderc_glsl_default_anyhit_shader,\n    shaderc_glsl_default_closesthit_shader,\n    shaderc_glsl_default_miss_shader,\n    shaderc_glsl_default_intersection_shader,\n    shaderc_glsl_default_callable_shader,\n    shaderc_task_shader,\n    shaderc_mesh_shader,\n    shaderc_glsl_task_shader,\n    shaderc_glsl_mesh_shader,\n    shaderc_glsl_default_task_shader,\n    shaderc_glsl_default_mesh_shader,\n};\n\nconst std::array<shaderc_source_language, 2> LangArray = {\n    shaderc_source_language_glsl,\n    shaderc_source_language_hlsl,\n};\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider fdp(data, size);\n\n  // Prepare GLSL shader content with valid version\n  shaderc_shader_kind kind = fdp.PickValueInArray(KindArray);\n\n  // Prepare Compiler and options\n  shaderc::Compiler compiler;\n  shaderc::CompileOptions options;\n  options.SetOptimizationLevel(fdp.PickValueInArray(OptArray));\n\n  options.SetHlslFunctionality1(fdp.ConsumeBool());\n  options.SetHlsl16BitTypes(fdp.ConsumeBool());\n  options.SetInvertY(fdp.ConsumeBool());\n  options.SetNanClamp(fdp.ConsumeBool());\n  options.SetPreserveBindings(fdp.ConsumeBool());\n  options.SetAutoMapLocations(fdp.ConsumeBool());\n  options.SetHlslOffsets(fdp.ConsumeBool());\n  options.SetAutoBindUniforms(fdp.ConsumeBool());\n  options.SetSourceLanguage(fdp.PickValueInArray(LangArray));\n\n  // Get the actual content\n  std::string shader_content = fdp.ConsumeRandomLengthString();\n\n  // Preprocessing\n  shaderc::PreprocessedSourceCompilationResult preprocess_result =\n      compiler.PreprocessGlsl(shader_content, kind, \"input.glsl\", options);\n  if (preprocess_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::string preprocessed_code(preprocess_result.cbegin(),\n                                  preprocess_result.cend());\n  } else {\n    return 0;\n  }\n\n  // Compile to SPIR-V binary\n  shaderc::SpvCompilationResult binary_result =\n      compiler.CompileGlslToSpv(shader_content, kind, \"input.glsl\", options);\n  if (binary_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::vector<uint32_t> spirv_binary(binary_result.cbegin(),\n                                       binary_result.cend());\n  }\n\n  // Compile to SPIR-V assembly\n  shaderc::AssemblyCompilationResult assembly_result =\n      compiler.CompileGlslToSpvAssembly(shader_content, kind, \"input.glsl\",\n                                        options);\n  if (assembly_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::string spirv_assembly(assembly_result.cbegin(),\n                               assembly_result.cend());\n  }\n\n  // Compile with C API\n  shaderc_compiler_t c_compiler = shaderc_compiler_initialize();\n  shaderc_compilation_result_t c_result = shaderc_compile_into_spv(\n      c_compiler, shader_content.c_str(), shader_content.size(), kind,\n      \"main.vert\", \"main\", nullptr);\n\n  if (shaderc_result_get_compilation_status(c_result) ==\n      shaderc_compilation_status_success) {\n    std::vector<uint32_t> spirv_c_binary(shaderc_result_get_length(c_result) /\n                                         sizeof(uint32_t));\n    std::memcpy(spirv_c_binary.data(), shaderc_result_get_bytes(c_result),\n                shaderc_result_get_length(c_result));\n  }\n  shaderc_result_release(c_result);\n  shaderc_compiler_release(c_compiler);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/shaderc/shaderc_fuzzer.cc",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstring>\n#include <iostream>\n#include <string>\n#include <vector>\n\n#include <shaderc/shaderc.h>\n#include <shaderc/shaderc.hpp>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Skip iteration if data not enough\n  if (size == 0) {\n    return 0;\n  }\n\n  // Prepare GLSL shader content with valid version\n  std::string shader_content(reinterpret_cast<const char *>(data), size);\n\n  // Prepare Compiler and options\n  shaderc::Compiler compiler;\n  shaderc::CompileOptions options;\n  options.SetOptimizationLevel(shaderc_optimization_level_performance);\n\n  // Preprocessing\n  shaderc::PreprocessedSourceCompilationResult preprocess_result =\n      compiler.PreprocessGlsl(shader_content, shaderc_glsl_vertex_shader,\n                              \"input.glsl\", options);\n  if (preprocess_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::string preprocessed_code(preprocess_result.cbegin(),\n                                  preprocess_result.cend());\n  } else {\n    return 0;\n  }\n\n  // Compile to SPIR-V binary\n  shaderc::SpvCompilationResult binary_result = compiler.CompileGlslToSpv(\n      shader_content, shaderc_glsl_vertex_shader, \"input.glsl\", options);\n  if (binary_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::vector<uint32_t> spirv_binary(binary_result.cbegin(),\n                                       binary_result.cend());\n  }\n\n  // Compile to SPIR-V assembly\n  shaderc::AssemblyCompilationResult assembly_result =\n      compiler.CompileGlslToSpvAssembly(\n          shader_content, shaderc_glsl_vertex_shader, \"input.glsl\", options);\n  if (assembly_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::string spirv_assembly(assembly_result.cbegin(),\n                               assembly_result.cend());\n  }\n\n  // Compile with C API\n  shaderc_compiler_t c_compiler = shaderc_compiler_initialize();\n  shaderc_compilation_result_t c_result = shaderc_compile_into_spv(\n      c_compiler, shader_content.c_str(), shader_content.size(),\n      shaderc_glsl_vertex_shader, \"main.vert\", \"main\", nullptr);\n\n  if (shaderc_result_get_compilation_status(c_result) ==\n      shaderc_compilation_status_success) {\n    std::vector<uint32_t> spirv_c_binary(shaderc_result_get_length(c_result) /\n                                         sizeof(uint32_t));\n    std::memcpy(spirv_c_binary.data(), shaderc_result_get_bytes(c_result),\n                shaderc_result_get_length(c_result));\n  }\n  shaderc_result_release(c_result);\n  shaderc_compiler_release(c_compiler);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/shaderc/shaderc_general_fuzzer.cc",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstring>\n#include <iostream>\n#include <string>\n#include <vector>\n\n#include <shaderc/shaderc.h>\n#include <shaderc/shaderc.hpp>\n\nstatic void execute_shaderc_routines(const uint8_t *data, size_t size,\n                                     shaderc::CompileOptions &options) {\n  std::string shader_content(reinterpret_cast<const char *>(data), size);\n\n  shaderc::Compiler compiler;\n\n  // Preprocessing\n  shaderc::PreprocessedSourceCompilationResult preprocess_result =\n      compiler.PreprocessGlsl(shader_content, shaderc_glsl_vertex_shader,\n                              \"input.glsl\", options);\n  if (preprocess_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::string preprocessed_code(preprocess_result.cbegin(),\n                                  preprocess_result.cend());\n  } else {\n    return;\n  }\n\n  // Compile to SPIR-V binary\n  shaderc::SpvCompilationResult binary_result = compiler.CompileGlslToSpv(\n      shader_content, shaderc_glsl_vertex_shader, \"input.glsl\", options);\n  if (binary_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::vector<uint32_t> spirv_binary(binary_result.cbegin(),\n                                       binary_result.cend());\n  }\n\n  // Compile to SPIR-V assembly\n  shaderc::AssemblyCompilationResult assembly_result =\n      compiler.CompileGlslToSpvAssembly(\n          shader_content, shaderc_glsl_vertex_shader, \"input.glsl\", options);\n  if (assembly_result.GetCompilationStatus() ==\n      shaderc_compilation_status_success) {\n    std::string spirv_assembly(assembly_result.cbegin(),\n                               assembly_result.cend());\n  }\n\n  // Compile with C API\n  shaderc_compiler_t c_compiler = shaderc_compiler_initialize();\n  shaderc_compilation_result_t c_result = shaderc_compile_into_spv(\n      c_compiler, shader_content.c_str(), shader_content.size(),\n      shaderc_glsl_vertex_shader, \"main.vert\", \"main\", nullptr);\n\n  if (shaderc_result_get_compilation_status(c_result) ==\n      shaderc_compilation_status_success) {\n    std::vector<uint32_t> spirv_c_binary(shaderc_result_get_length(c_result) /\n                                         sizeof(uint32_t));\n    std::memcpy(spirv_c_binary.data(), shaderc_result_get_bytes(c_result),\n                shaderc_result_get_length(c_result));\n  }\n  shaderc_result_release(c_result);\n  shaderc_compiler_release(c_compiler);\n  return;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Skip iteration if data not enough\n  if (size == 0) {\n    return 0;\n  }\n\n  // Prepare GLSL shader content with valid version\n\n  // Prepare Compiler and options\n  shaderc::CompileOptions options;\n  options.SetOptimizationLevel(shaderc_optimization_level_performance);\n  execute_shaderc_routines(data, size, options);\n\n  options.SetOptimizationLevel(shaderc_optimization_level_size);\n  execute_shaderc_routines(data, size, options);\n\n  options.SetOptimizationLevel(shaderc_optimization_level_zero);\n  options.SetHlslFunctionality1(true);\n  options.SetHlsl16BitTypes(true);\n  options.SetInvertY(true);\n  options.SetNanClamp(true);\n  options.SetPreserveBindings(true);\n  options.SetAutoMapLocations(true);\n  options.SetHlslOffsets(true);\n  options.SetAutoBindUniforms(true);\n  execute_shaderc_routines(data, size, options);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/sharp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nRUN mkdir afl-testcases\nRUN curl https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz | tar xzC afl-testcases\nRUN git clone --depth 1 https://github.com/lovell/sharp.git\n\nCOPY build.sh $SRC/\nCOPY fuzz.js $SRC/sharp\n\nWORKDIR $SRC/sharp\n"
  },
  {
    "path": "projects/sharp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install --ignore-scripts --no-save emnapi\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer sharp fuzz.js -i sharp\n\n# Merge the seed corpus in a single directory, exclude files larger than 4k\nmkdir -p fuzz/corpus\nfind \\\n  $SRC/afl-testcases/{gif*,jpeg*,png,tiff,webp}/full/images \\\n  test/fixtures \\\n  -type f -size -4k \\\n  -exec bash -c 'hash=($(sha1sum {})); mv {} fuzz/corpus/$hash' \\;\nzip -jrq $OUT/fuzz_seed_corpus.zip fuzz/corpus\n"
  },
  {
    "path": "projects/sharp/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst sharp = require('./lib/index');\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\n\nmodule.exports.fuzz = async function(data) {\n  const provider = new FuzzedDataProvider(data);\n\n  try {\n    const options = {\n      failOn: pickFromArray([\"none\", \"truncated\", \"error\", \"warning\", provider.consumeString(provider.consumeIntegralInRange(0, 64))]),\n      limitInputPixels: provider.consumeIntegralInRange(1, 2 ** 28),\n      unlimited: provider.consumeBoolean(),\n      sequentialRead: provider.consumeBoolean(),\n      density: provider.consumeIntegralInRange(1, 100001),\n      ignoreicc: provider.consumeBoolean(),\n      pages: provider.consumeIntegrals(provider.consumeIntegralInRange(1, 10), provider.consumeIntegralInRange(1, 2), provider.consumeBoolean()).push(-1),\n      page: provider.consumeIntegralInRange(1, 1000),\n      subifd: provider.consumeIntegralInRange(-1, 1000),\n      level: provider.consumeIntegralInRange(0, 1000),\n      animated: provider.consumeBoolean(),\n    };\n    const width = provider.consumeIntegralInRange(1, 10000);\n    const height = provider.consumeIntegralInRange(1, 10000);\n    const gravity = provider.consumeString(provider.consumeIntegralInRange(0, 1000));\n    const top = provider.consumeIntegralInRange(1, 1000);\n    const bottom = provider.consumeIntegralInRange(1, 1000);\n    const left = provider.consumeIntegralInRange(1, 1000);\n    const right = provider.consumeIntegralInRange(1, 1000);\n    const background = provider.consumeString(provider.consumeIntegralInRange(0, 1000));\n    const withMeta = provider.consumeBoolean();\n    const degrees = provider.consumeIntegralInRange(0, 361);\n    const gamma = provider.consumeFloatInRange(0.0, 4.0);\n    var input = \"\";\n    if (provider.consumeBoolean() == true) {\n      input = Buffer.from(provider.consumeBytes(provider.consumeIntegralInRange(1, 100000)));\n    } else {\n      input = Buffer.from(provider.consumeRemainingAsBytes());\n    }\n    if (input.length == 0) {\n      return;\n    }\n\n\n    switch (provider.consumeIntegralInRange(0, 20)) {\n      case 0:\n        sharp(input)\n          .rotate(degrees)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 1:\n        sharp(input)\n          .flip()\n          .toBuffer((_err, _out) => { });\n        break;\n      case 2:\n        sharp(input)\n          .flop()\n          .toBuffer((_err, _out) => { });\n        break;\n      case 3:\n        sharp(input)\n          .grayscale()\n          .toBuffer((_err, _out) => { });\n        break;\n      case 4:\n        sharp(input, options)\n          .composite([{ input: input, gravity: gravity }], options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 5:\n        sharp(input, options)\n          .extend({ top: top, bottom: bottom, left: left, right: right, background: background }, options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 6:\n        sharp(input, options)\n          .trim(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 7:\n        sharp(input, options)\n          .median(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 8:\n        sharp(input, options)\n          .unflatten(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 9:\n        sharp(input, options)\n          .flatten(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 10:\n        sharp(input, options)\n          .gamma(gamma)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 11:\n        sharp(input, options)\n          .gif(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 12:\n        sharp(input, options)\n          .clahe(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 13:\n        //console.log(`case 13`);\n        sharp(input, options)\n          .withMetadata(withMeta)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 14:\n        sharp(input, options)\n          .jpeg(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 15:\n        sharp(input, options)\n          .png(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 16:\n        sharp(input, options)\n          .webp(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 17:\n        sharp(input, options)\n          .tiff(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 18:\n        sharp(input, options)\n          .avif(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 19:\n        sharp(input, options)\n          .negate(options)\n          .toBuffer((_err, _out) => { });\n        break;\n      case 20:\n        sharp(input)\n          .resize(width, height)\n          .toBuffer((_err, _out) => { });\n        break;\n\n    }\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [\n  \"Input Buffer is empty\",\n  \"Expected valid gravity\",\n  \"Expected one of:\",\n  \"Expected integer\",\n  \"Expected number\",\n  \"Expected object or string\",\n  \"Unable to parse\",\n];\n\n\nfunction pickFromArray(array) {\n  return array[Math.floor(Math.random() * array.length)];\n}\n"
  },
  {
    "path": "projects/sharp/project.yaml",
    "content": "homepage: https://sharp.pixelplumbing.com/\nlanguage: javascript\nmain_repo: https://github.com/lovell/sharp\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nprimary_contact: \"lovell.fuller@gmail.com\"\n"
  },
  {
    "path": "projects/sigstore/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/sigstore/sigstore\n\nCOPY build.sh $SRC\nWORKDIR $SRC/sigstore/test/fuzz\n"
  },
  {
    "path": "projects/sigstore/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nzip \"${OUT}/FuzzLoadCertificates_seed_corpus.zip\" corpus/pem/*\nzip \"${OUT}/FuzzUnmarshalCertificatesFromPEM_seed_corpus.zip\" corpus/pem/*\nzip \"${OUT}/FuzzUnmarshalPEMToPublicKey_seed_corpus.zip\" corpus/pem/*\nzip \"${OUT}/FuzzED25529SignerVerfier_seed_corpus.zip\" corpus/ed25519/*\n\nrm go.mod\nrm go.sum\ncd $SRC/sigstore\ngo get github.com/AdaLogics/go-fuzz-headers\n\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz FuzzGetPassword FuzzGetPassword\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzLoadCertificates FuzzLoadCertificates\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzUnmarshalCertificatesFromPEM FuzzUnmarshalCertificatesFromPEM\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzUnmarshalPEMToPublicKey FuzzUnmarshalPEMToPublicKey\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzCertificate FuzzCertificate\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzPrivateKey FuzzPrivateKey\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzPublicKey FuzzPublicKey\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzUnmarshalOtherNameSAN FuzzUnmarshalOtherNameSAN\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/pem FuzzMarshalUnmarshalOtherNameSAN FuzzMarshalUnmarshalOtherNameSAN\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/signature FuzzECDSASigner FuzzECDSASigner\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/signature FuzzComputeDigest FuzzComputeDigest\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/signature FuzzComputeVerifying FuzzComputeVerifying\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/signature FuzzED25529SignerVerfier FuzzED25529SignerVerfier\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/signature FuzzRSAPKCS1v15SignerVerfier FuzzRSAPKCS1v15SignerVerfier\ncompile_native_go_fuzzer_v2 github.com/sigstore/sigstore/test/fuzz/signature FuzzRSAPSSSignerVerfier FuzzRSAPSSSignerVerfier\n"
  },
  {
    "path": "projects/sigstore/project.yaml",
    "content": "homepage: \"https://sigstore.dev\"\nmain_repo: \"https://github.com/sigstore/sigstore\"\nprimary_contact: \"security@sigstore.dev\"\nauto_ccs:\n  - lhinds@sigstore.dev\n  - hblauzvern@sigstore.dev\n  - bcallaway@sigstore.dev\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/sigstore-go/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/sigstore/sigstore-go\nCOPY build.sh $SRC/\nWORKDIR $SRC/sigstore-go\n"
  },
  {
    "path": "projects/sigstore-go/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./test/fuzz/oss_fuzz_build.sh\n\n"
  },
  {
    "path": "projects/sigstore-go/project.yaml",
    "content": "homepage: \"https://sigstore.dev\"\nmain_repo: \"https://github.com/sigstore/sigstore\"\nprimary_contact: \"security@sigstore.dev\"\nauto_ccs:\n  - lhinds@sigstore.dev\n  - hblauzvern@sigstore.dev\n  - bcallaway@sigstore.dev\n  - adam@adalogics.com\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/sigstore-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN git clone --depth 1 https://github.com/sigstore/sigstore-java\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/sigstore-java\n"
  },
  {
    "path": "projects/sigstore-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Specifying the target package prefix for java frontend\nexport TARGET_PACKAGE_PREFIX=dev.sigstore.*\n\n# Call build script provided by sigsotre-java/fuzzing\n$SRC/sigstore-java/fuzzing/oss_fuzz_build.sh\n"
  },
  {
    "path": "projects/sigstore-java/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nfuzzing_engines:\n  - libfuzzer\nhomepage: https://www.sigstore.dev/\nlanguage: jvm\nmain_repo: https://github.com/sigstore/sigstore-java.git\nsanitizers:\n  - address\nprimary_contact: \"security@sigstore.dev\"\nauto_ccs:\n  - \"adam@adalogics.com\"\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"appu@google.com\"\n"
  },
  {
    "path": "projects/sigstore-python/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/sigstore/sigstore-python\nCOPY *.sh *py *.dict $SRC/\nWORKDIR $SRC/sigstore-python\n"
  },
  {
    "path": "projects/sigstore-python/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npython3 -m pip install --upgrade pip\npython3 -m pip install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n\nzip -j $OUT/fuzz_verify_artifact_seed_corpus.zip test/assets/bundle_*.sigstore\nmv $SRC/*.dict $OUT/\n"
  },
  {
    "path": "projects/sigstore-python/fuzz_verify_artifact.dict",
    "content": "\"\\\"mediaType\\\": \\\"application/vnd.dev.sigstore.bundle+json;version=0.3\\\",\"\n\"\\\"verificationMaterial\\\": {\"\n\\\"certificate\\\": {\"\n\"\\\"tlogEntries\\\": [\"\n\\\"logIndex\\\":\"\n\"\\\"logId\\\": {\"\n\"\\\"keyId\\\":\"\n\"\\\"kindVersion\\\": {\"\n\"\\\"kind\\\":\"\n\"\\\"version\\\": \\\"0.0.1\\\"\"\n\"\\\"integratedTime\\\"\"\n\"\\\"inclusionPromise\\\": {\"\n\"\\\"signedEntryTimestamp\\\":\"\n\"\\\"inclusionProof\\\": {\"\n\"\\\"rootHash\\\":\"\n\"\\\"treeSize\\\":\"\n\"\\\"hashes\\\":\"\n\"\\\"checkpoint\\\": {\"\n\"\\\"envelope\\\":\"\n\"\\\"canonicalizedBody\\\":\"\n\"\\\"messageSignature\\\": {\"\n\"\\\"messageDigest\\\": {\"\n\"\\\"algorithm\\\": \\\"SHA2_256\\\",\"\n\"\\\"digest\\\":\"\n\"\\\"signature\\\":\""
  },
  {
    "path": "projects/sigstore-python/fuzz_verify_artifact.py",
    "content": "#!/usr/bin/python3\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nfrom sigstore.models import Bundle\n\nclass NullPolicy:\n  def verify(self, cert):\n      return\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    bundle = Bundle.from_json(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(50, 10000)))  \n  except Exception as e:\n    return\n\n  try:\n   verify_artifact(fdp.ConsumeBytes(fdp.ConsumeIntInRange(50, 10000)), bundle, NullPolicy())\n  except InvalidBundle:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sigstore-python/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://sigstore.dev\nlanguage: python\nmain_repo: https://github.com/sigstore/sigstore-python\nsanitizers:\n- address\n- undefined\nprimary_contact: \"security@sigstore.dev\"\nauto_ccs:\n  - lhinds@sigstore.dev\n  - hblauzvern@sigstore.dev\n  - bcallaway@sigstore.dev\n  - adam@adalogics.com\n  - david@adalogics.com\n"
  },
  {
    "path": "projects/simd/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/ermig1979/Simd\nWORKDIR Simd\nCOPY build.sh simd_load_fuzzer.cpp $SRC/\n"
  },
  {
    "path": "projects/simd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nmkdir build && cd build\ncmake ../prj/cmake \\\n\t-DCMAKE_BUILD_TYPE=\"Release\"\n\n# Force simd to only use a single core, as otherwise memory will be exhausted\nmake -j1\n\n$CXX $CXXFLAGS -I/src/Simd/src -O3 -DNDEBUG -fPIC \\\n        -c $SRC/simd_load_fuzzer.cpp -o simd_load_fuzzer.o \\\n        -std=c++11 -ferror-limit=5 -m64  -mtune=native\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE simd_load_fuzzer.o \\\n        -o $OUT/simd_load_fuzzer \\\n        $(find $SRC -name \"libSimd.a\")\n"
  },
  {
    "path": "projects/simd/project.yaml",
    "content": "homepage: \"http://ermig1979.github.io/Simd\"\nlanguage: c++\nprimary_contact: \"ermig@tut.by\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/ermig1979/Simd'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/simd/simd_load_fuzzer.cpp",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include \"Test/TestUtils.h\"\n\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n  if (size<5) {\n    return 0;\n  }\n  Test::View::Format formats[4] = {Test::View::Gray8,\n                                   Test::View::Bgr24,\n                                   Test::View::Bgra32,\n                                   Test::View::Rgb24};\n  for(int i=0; i<4; i++) {\n    Test::View dst1;\n    dst1.Load(data, size, formats[i]);\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/simdjson/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y ninja-build wget\n\nRUN git clone --depth 1 https://github.com/simdjson/simdjson.git simdjson\nWORKDIR simdjson\nCOPY run_tests.sh build.sh $SRC/\n\n"
  },
  {
    "path": "projects/simdjson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfuzz/ossfuzz.sh\n"
  },
  {
    "path": "projects/simdjson/project.yaml",
    "content": "homepage: \"https://simdjson.org/\"\nlanguage: c++\nprimary_contact: \"pauldreikossfuzz@gmail.com\"\nauto_ccs:\n - \"lemire@gmail.com\"\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/simdjson/simdjson.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/simdjson/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Exclude failing unit test cases and run the remaining unit testing\nctest --test-dir $SRC/simdjson/build -j$(nproc) -E \\\n  \"minify_tests|prettify_tests|ondemand_tostring_tests|ondemand_cacheline|builder_string_builder_tests\"\n"
  },
  {
    "path": "projects/simdutf/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone --depth 1 https://github.com/simdutf/simdutf simdutf\nWORKDIR simdutf\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/simdutf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfuzz/build.sh\n"
  },
  {
    "path": "projects/simdutf/project.yaml",
    "content": "homepage: \"https://simdutf.github.io/simdutf\"\nlanguage: c++\nprimary_contact: \"lemire@gmail.com\"\nmain_repo: \"https://github.com/simdutf/simdutf\"\nauto_ccs:\n  - \"nathaniel.brough@gmail.com\"\n  - \"pauldreikossfuzz@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n  - centipede\narchitectures:\n  - x86_64\n"
  },
  {
    "path": "projects/simdutf/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build -j$(nproc)\n"
  },
  {
    "path": "projects/simplejson/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN git clone https://github.com/simplejson/simplejson simplejson\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/simplejson\n"
  },
  {
    "path": "projects/simplejson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 setup.py install\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/simplejson/fuzz_decode.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nimport simplejson\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  original = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  try:\n    simplejson.loads(original)\n  except simplejson.JSONDecodeError:\n    pass\n  except RecursionError:\n    pass\n  return\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/simplejson/fuzz_encode.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nimport simplejson\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  original = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  encoder = simplejson.JSONEncoder()\n  try:\n    # Anything that can be decoded shold be able to be encoded\n    encoder.encode(simplejson.loads(original))\n  except simplejson.JSONDecodeError:\n    pass\n  except RecursionError:\n    pass\n  return\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/simplejson/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/simplejson/simplejson\nlanguage: python\nmain_repo: https://github.com/simplejson/simplejson\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/six/Dockerfile",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip HTMLParser\nRUN git clone https://github.com/benjaminp/six six\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/six\n"
  },
  {
    "path": "projects/six/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --hidden-import=html.parser\ndone\n"
  },
  {
    "path": "projects/six/fuzz_six.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n\nimport six\nimport json\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  val_1 = fdp.ConsumeUnicodeNoSurrogates(24)\n\n  try:\n    six.remove_move(val_1)\n    six.u(fdp.ConsumeString(fdp.ConsumeIntInRange(1, 24)))\n    six.ensure_text(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1,\n                                                                         24)))\n  except (AttributeError,):\n    pass\n  try:\n    json_val = json.loads(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsueIntInRange(1, 1024)))\n  except:\n    json_val = None\n\n  if json_val != None:\n    try:\n      six.ensure_str(json_val)\n      six.ensure_binary(json_val)\n      six.ensure_text(json_val)\n    except TypeError:\n      pass\n\n  try:\n    six.ensure_str(data)\n    six.ensure_binary(data)\n    six.ensure_text(data)\n  except (TypeError, UnicodeDecodeError):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/six/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/benjaminp/six\nlanguage: python\nmain_repo: https://github.com/benjaminp/six\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/skcms/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# checkout all sources needed to build your project\nRUN git clone --depth 1 https://skia.googlesource.com/skcms.git\n\n# Disable the below to fix build. The URL is not accessible. Leaving it\n# commented out if the URL becomes available again.\n# RUN wget -O $SRC/skcms/iccprofile_seed_corpus.zip https://storage.googleapis.com/skia-fuzzer/oss-fuzz/iccprofile_seed_corpus.zip\n\n# current directory for build script\nWORKDIR skcms\n\n\n\nCOPY build.sh $SRC/\n\nCOPY iccprofile.options iccprofile.dict $SRC/skcms/\n"
  },
  {
    "path": "projects/skcms/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$CXX -c $CXXFLAGS skcms.cc src/skcms_TransformBaseline.cc -DIS_FUZZING_WITH_LIBFUZZER -DSKCMS_DISABLE_HSW -DSKCMS_DISABLE_SKX\n$CC -c $CFLAGS fuzz/fuzz_iccprofile_info.c fuzz/fuzz_iccprofile_atf.c fuzz/fuzz_iccprofile_transform.c -DIS_FUZZING_WITH_LIBFUZZER -DSKCMS_DISABLE_HSW -DSKCMS_DISABLE_SKX\n$CXX $CXXFLAGS skcms.o skcms_TransformBaseline.o fuzz_iccprofile_info.o $LIB_FUZZING_ENGINE -o $OUT/iccprofile_info\n$CXX $CXXFLAGS skcms.o skcms_TransformBaseline.o fuzz_iccprofile_atf.o $LIB_FUZZING_ENGINE -o $OUT/iccprofile_atf\n$CXX $CXXFLAGS skcms.o skcms_TransformBaseline.o fuzz_iccprofile_transform.o $LIB_FUZZING_ENGINE -o $OUT/iccprofile_transform\n\n# They share the same options\ncp iccprofile.options $OUT/iccprofile_info.options\ncp iccprofile.options $OUT/iccprofile_atf.options\ncp iccprofile.options $OUT/fuzz_iccprofile_transform.options\n# They all share the same seed corpus of icc profiles\n#cp iccprofile_seed_corpus.zip $OUT/iccprofile_info_seed_corpus.zip\n#cp iccprofile_seed_corpus.zip $OUT/iccprofile_atf_seed_corpus.zip\n#cp iccprofile_seed_corpus.zip $OUT/iccprofile_transform_seed_corpus.zip\n# They all use the same dictionary file.\ncp iccprofile.dict $OUT/iccprofile.dict\n"
  },
  {
    "path": "projects/skcms/iccprofile.dict",
    "content": "# Dict for ICC profiles parsed by skcms.\n\n\"mft1\"\n\"mft2\"\n\"mAB \"\n\"rXYZ\"\n\"gXYZ\"\n\"bXYZ\"\n\"rTRC\"\n\"gTRC\"\n\"bTRC\"\n\"kTRC\"\n\"A2B0\"\n\"curv\"\n\"para\"\n\"mluc\"\n\"XYZ \"\n\"Lab \"\n\"RGB \"\n\"CMYK\"\n\"GRAY\"\n\"mntr\"\n\"scnr\"\n\"prtr\"\n\"spac\"\n"
  },
  {
    "path": "projects/skcms/iccprofile.options",
    "content": "[libfuzzer]\nmax_len = 200000\ntimeout = 10\ndict = iccprofile.dict\n"
  },
  {
    "path": "projects/skcms/project.yaml",
    "content": "homepage: \"https://skia.googlesource.com/skcms/+/master\"\nlanguage: c++\nprimary_contact: \"kjlubick@chromium.org\"\nauto_ccs:\n  - \"brianosman@google.com\"\n  - \"johnstiles@google.com\"\nsanitizers:\n - address\n - memory\n - undefined\narchitectures:\n#  - aarch64  # Experimental, not generally available.\n  - x86_64\n  - i386\nmain_repo: 'https://skia.googlesource.com/skcms.git'\n"
  },
  {
    "path": "projects/sketches-core/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN curl -L https://repo1.maven.org/maven2/org/apache/datasketches/datasketches-memory/4.1.0/datasketches-memory-4.1.0.jar -o $OUT/datasketches-memory.jar\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/DataSketches/sketches-core sketches-core\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/sketches-core\n"
  },
  {
    "path": "projects/sketches-core/FdtSketchFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.datasketches.fdt.FdtSketch;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.apache.datasketches.fdt.FdtSketch] public void update(java.lang.String[])\npublic class FdtSketchFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    FdtSketch obj = new FdtSketch(data.consumeInt());\n    obj.update(new String[]{data.consumeRemainingAsString()});\n  }\n}\n"
  },
  {
    "path": "projects/sketches-core/MurmurHash3AdaptorFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.datasketches.hash.MurmurHash3Adaptor;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.apache.datasketches.hash.MurmurHash3Adaptor] public static byte[] hashToBytes(java.lang.String,long)\n// Target method: [org.apache.datasketches.hash.MurmurHash3Adaptor] public static long[] hashToLongs(int[],long)\npublic class MurmurHash3AdaptorFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    Long longValue = data.consumeLong();\n\n    if (data.consumeBoolean()) {\n      MurmurHash3Adaptor.hashToBytes(data.consumeRemainingAsString(), longValue);\n    } else {\n      MurmurHash3Adaptor.hashToLongs(data.consumeInts(data.remainingBytes() / 4), longValue);\n    }\n  }\n}\n"
  },
  {
    "path": "projects/sketches-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n# Configure toolchain\nmkdir -p ~/.m2\necho \"<toolchains>\" > ~/.m2/toolchains.xml\necho \"<toolchain><type>jdk</type><provides><version>17</version></provides>\" >> ~/.m2/toolchains.xml\necho \"<configuration><jdkHome>\\${env.JAVA_HOME}</jdkHome></configuration></toolchain>\" >> ~/.m2/toolchains.xml\necho \"</toolchains>\" >> ~/.m2/toolchains.xml\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./target/datasketches-java-$CURRENT_VERSION.jar\" $OUT/sketches-core.jar\n\nALL_JARS='sketches-core.jar datasketches-memory.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\ncp -r $JAVA_HOME $OUT/\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  $JAVA_HOME/bin/javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  settings=\\$mem_settings:--add-modules=jdk.incubator.foreign\n  export JAVA_HOME=\\$this_dir/$(basename $JAVA_HOME)\n  export LD_LIBRARY_PATH=\"\\$JAVA_HOME/lib/server\":\\$this_dir\n  export PATH=\\$JAVA_HOME/bin:\\$PATH\n\n  \\$this_dir/jazzer_driver                          \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\\$settings                           \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/sketches-core/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/DataSketches/sketches-core\nmain_repo: https://github.com/DataSketches/sketches-core\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/skia/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Mesa,libz/zlib, and xcb needed to build swiftshader\nRUN apt-get update && apt-get install -y python3 wget libglu1-mesa-dev cmake zlib1g-dev libxext-dev libxcb-shm0-dev\n\nRUN git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' --depth 1\nENV PATH=\"${SRC}/depot_tools:${PATH}\"\n\nRUN git clone https://skia.googlesource.com/skia.git --depth 1\n\n# current directory for build script\nWORKDIR skia\n\nENV GIT_SYNC_DEPS_SKIP_EMSDK=1\nENV GIT_SYNC_DEPS_SHALLOW_CLONE=1\nENV GIT_SYNC_DEPS_QUIET=0\nRUN python3 tools/git-sync-deps\nRUN python3 bin/fetch-gn\nRUN python3 bin/fetch-ninja\n\n# Make a directory for fuzzing artifacts that won't be clobbered by CIFuzz.\nRUN mkdir $SRC/skia_data\n\nRUN wget -O $SRC/skia_data/image_filter_deserialize_seed_corpus.zip https://cdn.skia.org/oss-fuzz/image_filter_deserialize_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/region_set_path_seed_corpus.zip https://cdn.skia.org/oss-fuzz/region_set_path_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/textblob_deserialize_seed_corpus.zip https://cdn.skia.org/oss-fuzz/textblob_deserialize_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/path_deserialize_seed_corpus.zip https://cdn.skia.org/oss-fuzz/path_deserialize_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/image_decode_seed_corpus.zip https://cdn.skia.org/oss-fuzz/image_decode_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/animated_image_decode_seed_corpus.zip https://cdn.skia.org/oss-fuzz/animated_image_decode_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/api_draw_functions_seed_corpus.zip https://cdn.skia.org/oss-fuzz/api_draw_functions_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/api_gradients_seed_corpus.zip https://cdn.skia.org/oss-fuzz/api_gradients_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/api_image_filter_seed_corpus.zip https://cdn.skia.org/oss-fuzz/api_image_filter_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/api_path_measure_seed_corpus.zip https://cdn.skia.org/oss-fuzz/api_path_measure_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/api_pathop_seed_corpus.zip https://cdn.skia.org/oss-fuzz/api_pathop_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/canvas_seed_corpus.zip https://cdn.skia.org/oss-fuzz/canvas_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/encoder_seed_corpus.zip https://cdn.skia.org/oss-fuzz/encoder_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/skottie_json_seed_corpus.zip https://cdn.skia.org/oss-fuzz/skottie_json_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/skjson_seed_corpus.zip https://cdn.skia.org/oss-fuzz/skjson_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/api_polyutils_seed_corpus.zip https://cdn.skia.org/oss-fuzz/api_polyutils_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/sksl_seed_corpus.zip https://cdn.skia.org/oss-fuzz/sksl_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/skmeshspecification_seed_corpus.zip https://cdn.skia.org/oss-fuzz/skmeshspecification_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/svg_dom_seed_corpus.zip https://cdn.skia.org/oss-fuzz/svg_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/skp_seed_corpus.zip https://cdn.skia.org/oss-fuzz/skp_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/skdescriptor_deserialize_seed_corpus.zip https://cdn.skia.org/oss-fuzz/skdescriptor_deserialize_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/colrv1_seed_corpus.zip https://cdn.skia.org/oss-fuzz/colrv1_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/skcolorspace_seed_corpus.zip https://cdn.skia.org/oss-fuzz/skcolorspace_seed_corpus.zip\n\nRUN wget -O $SRC/skia_data/parse_path_seed_corpus.zip https://cdn.skia.org/oss-fuzz/parse_path_corpus.zip\n\nCOPY image_filter_deserialize_width.options $SRC/skia_data/image_filter_deserialize_width.options\n\nCOPY json.dict $SRC/skia_data/json.dict\n\nCOPY sksl.dict $SRC/skia_data/sksl.dict\n\nWORKDIR $SRC/skia\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/skia/README.md",
    "content": "When bench testing image_filter_deserialize, it may be useful to have\nmalloc_limit_mb = 500, and timeout = 10 to find actionable OOM culprits sooner.\n\nWhen reproducing, add -malloc_limit_mb=100 -rss_limit_mb=0 after the\nrepro_test to locate where big memory allocations are happening.\n\n    python infra/helper.py reproduce skia image_decode ~/Downloads/foo -malloc_limit_mb=100 -rss_limit_mb=0\n"
  },
  {
    "path": "projects/skia/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build SwiftShader so we can compile in our GPU code and test it in an\n# an environment that does not have a real GPU.\npushd third_party/externals/swiftshader/\nexport SWIFTSHADER_INCLUDE_PATH=$PWD/include\n# SwiftShader already has a build/ directory, use something else\nrm -rf build_swiftshader\nmkdir build_swiftshader\n\ncd build_swiftshader\nif [ $SANITIZER == \"address\" ]; then\n  CMAKE_SANITIZER=\"SWIFTSHADER_ASAN\"\nelif [ $SANITIZER == \"memory\" ]; then\n  CMAKE_SANITIZER=\"SWIFTSHADER_MSAN\"\n  # oss-fuzz will patch the rpath for this after compilation and linking,\n  # so we only need to set this to appease the Swiftshader build rules check.\n  export SWIFTSHADER_MSAN_INSTRUMENTED_LIBCXX_PATH=\"/does/not/matter\"\nelif [ $SANITIZER == \"undefined\" ]; then\n  # The current SwiftShader build needs -fno-sanitize=vptr, but it cannot be\n  # specified here since -fsanitize=undefined will always come after any\n  # user specified flags passed to cmake. SwiftShader does not need to be\n  # built with the undefined sanitizer in order to fuzz Skia, so don't.\n  CMAKE_SANITIZER=\"SWIFTSHADER_UBSAN_DISABLED\"\nelif [ $SANITIZER == \"coverage\" ]; then\n  CMAKE_SANITIZER=\"SWIFTSHADER_EMIT_COVERAGE\"\nelif [ $SANITIZER == \"thread\" ]; then\n  CMAKE_SANITIZER=\"SWIFTSHADER_UBSAN_DISABLED\"\nelif [ $SANITIZER == \"none\" ]; then\n  CMAKE_SANITIZER=\"SWIFTSHADER_UBSAN_DISABLED\"\nelse\n  exit 1\nfi\n# These deprecated warnings get quite noisy and mask other issues.\nCFLAGS= CXXFLAGS=\"-stdlib=libc++ -Wno-deprecated-declarations\" cmake .. -GNinja \\\n  -DCMAKE_MAKE_PROGRAM=\"$SRC/skia/third_party/ninja/ninja\" -D$CMAKE_SANITIZER=1 -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE\n\n# Swiftshader only supports Vulkan, so we will build our fuzzers with Vulkan too.\n$SRC/skia/third_party/ninja/ninja libvk_swiftshader.so\nmv libvk_swiftshader.so $OUT\nexport SWIFTSHADER_LIB_PATH=$OUT\n\npopd\n# These are any clang warnings we need to silence.\nDISABLE=\"-Wno-zero-as-null-pointer-constant -Wno-unused-template\n         -Wno-cast-qual\"\n# Disable UBSan vptr since target built with -fno-rtti.\nexport CFLAGS=\"$CFLAGS $DISABLE -I$SWIFTSHADER_INCLUDE_PATH \\\n -DSK_GPU_TOOLS_VK_LIBRARY_NAME=libvk_swiftshader.so \\\n -fno-sanitize=vptr -DSK_BUILD_FOR_LIBFUZZER -DSK_BUILD_FOR_FUZZER\"\nexport CXXFLAGS=\"$CXXFLAGS $DISABLE -I$SWIFTSHADER_INCLUDE_PATH \\\n -fno-sanitize=vptr -DSK_BUILD_FOR_LIBFUZZER -D SK_BUILD_FOR_FUZZER\"\nexport LDFLAGS=\"$LIB_FUZZING_ENGINE $CXXFLAGS -L$SWIFTSHADER_LIB_PATH -fuse-ld=lld\"\n\n# This splits a space separated list into a quoted, comma separated list for gn.\nexport CFLAGS_ARR=`echo $CFLAGS | sed -e \"s/\\s/\\\",\\\"/g\"`\nexport CXXFLAGS_ARR=`echo $CXXFLAGS | sed -e \"s/\\s/\\\",\\\"/g\"`\nexport LDFLAGS_ARR=`echo $LDFLAGS | sed -e \"s/\\s/\\\",\\\"/g\"`\n\n# Avoid OOMs on the CI due to lower memory constraints\nLIMITED_LINK_POOL=\"link_pool_depth=1\"\n\nSKIA_ARGS=\"skia_build_fuzzers=true\n           skia_enable_fontmgr_custom_directory=false\n           skia_enable_fontmgr_custom_embedded=false\n           skia_enable_fontmgr_custom_empty=true\n           skia_enable_ganesh=true\n           skia_enable_graphite=true\n           skia_enable_skottie=true\n           skia_enable_precompile=true\n           skia_use_vulkan=true\n           skia_use_egl=false\n           skia_use_gl=false\n           skia_use_fontconfig=false\n           skia_use_freetype=true\n           skia_use_system_freetype2=false\n           skia_use_wuffs=true\n           skia_provide_default_fuzz_engine=false\"\n\n# Even though GPU is \"enabled\" for all these builds, none really\n# uses the gpu except for api_mock_gpu_canvas.\n$SRC/skia/bin/gn gen out/Fuzz\\\n    --args='cc=\"'$CC'\"\n      cxx=\"'$CXX'\"\n      '\"$LIMITED_LINK_POOL\"'\n      '\"${SKIA_ARGS[*]}\"'\n      is_debug=false\n      extra_cflags_c=[\"'\"$CFLAGS_ARR\"'\"]\n      extra_cflags_cc=[\"'\"$CXXFLAGS_ARR\"'\"]\n      extra_ldflags=[\"'\"$LDFLAGS_ARR\"'\"]'\n\n# Some fuzz targets benefit from assertions so we enable SK_DEBUG to allow SkASSERT\n# and SkDEBUGCODE to run. We still enable optimization (via is_debug=false) because\n# faster code means more fuzz tests and deeper coverage.\n$SRC/skia/bin/gn gen out/FuzzDebug\\\n    --args='cc=\"'$CC'\"\n      cxx=\"'$CXX'\"\n      '\"$LIMITED_LINK_POOL\"'\n      '\"${SKIA_ARGS[*]}\"'\n      is_debug=false\n      extra_cflags_c=[\"-DSK_DEBUG\",\"'\"$CFLAGS_ARR\"'\"]\n      extra_cflags_cc=[\"-DSK_DEBUG\",\"'\"$CXXFLAGS_ARR\"'\"]\n      extra_ldflags=[\"'\"$LDFLAGS_ARR\"'\"]'\n\n$SRC/skia/third_party/ninja/ninja -C out/Fuzz \\\n  animated_image_decode \\\n  api_create_ddl \\\n  api_ddl_threading \\\n  api_draw_functions \\\n  api_gradients \\\n  api_image_filter \\\n  api_mock_gpu_canvas \\\n  api_null_canvas \\\n  api_path_measure \\\n  api_pathop \\\n  api_polyutils \\\n  api_precompile \\\n  api_raster_n32_canvas \\\n  api_regionop \\\n  api_skparagraph \\\n  api_svg_canvas \\\n  api_triangulation \\\n  colrv1 \\\n  image_decode \\\n  image_decode_incremental \\\n  image_filter_deserialize \\\n  jpeg_encoder \\\n  path_deserialize \\\n  png_encoder \\\n  region_deserialize \\\n  region_set_path \\\n  skdescriptor_deserialize \\\n  skjson \\\n  skottie_json \\\n  skp \\\n  svg_dom \\\n  textblob_deserialize \\\n  webp_encoder\n\n$SRC/skia/third_party/ninja/ninja -C out/FuzzDebug \\\n  cubic_roots \\\n  parse_path \\\n  quad_roots \\\n  skmeshspecification \\\n  skruntimeblender \\\n  skruntimecolorfilter \\\n  skruntimeeffect \\\n  sksl2glsl \\\n  sksl2metal \\\n  sksl2pipeline \\\n  sksl2spirv \\\n  sksl2wgsl \\\n  skcolorspace\n\nrm -rf $OUT/data\nmkdir $OUT/data\n\nmv out/Fuzz/region_deserialize $OUT/region_deserialize\n\nmv out/Fuzz/region_set_path $OUT/region_set_path\nmv ../skia_data/region_set_path_seed_corpus.zip $OUT/region_set_path_seed_corpus.zip\n\nmv out/Fuzz/textblob_deserialize $OUT/textblob_deserialize\nmv ../skia_data/textblob_deserialize_seed_corpus.zip $OUT/textblob_deserialize_seed_corpus.zip\n\nmv out/Fuzz/path_deserialize $OUT/path_deserialize\nmv ../skia_data/path_deserialize_seed_corpus.zip $OUT/path_deserialize_seed_corpus.zip\n\nmv out/Fuzz/animated_image_decode $OUT/animated_image_decode\nmv ../skia_data/animated_image_decode_seed_corpus.zip $OUT/animated_image_decode_seed_corpus.zip\n\n# Only create the width version of image_filter_deserialize if building with\n# libfuzzer, since it depends on a libfuzzer specific flag.\nif [ \"$FUZZING_ENGINE\" == \"libfuzzer\" ]\nthen\n  # Use the same binary as image_filter_deserialize.\n  cp out/Fuzz/image_filter_deserialize $OUT/image_filter_deserialize_width\n  mv ../skia_data/image_filter_deserialize_width.options $OUT/image_filter_deserialize_width.options\n  # Use the same seed corpus as image_filter_deserialize.\n  cp ../skia_data/image_filter_deserialize_seed_corpus.zip $OUT/image_filter_deserialize_width_seed_corpus.zip\nfi\n\nmv out/Fuzz/image_filter_deserialize $OUT/image_filter_deserialize\nmv ../skia_data/image_filter_deserialize_seed_corpus.zip $OUT/image_filter_deserialize_seed_corpus.zip\n\nmv out/Fuzz/api_draw_functions $OUT/api_draw_functions\nmv ../skia_data/api_draw_functions_seed_corpus.zip $OUT/api_draw_functions_seed_corpus.zip\n\nmv out/Fuzz/api_gradients $OUT/api_gradients\nmv ../skia_data/api_gradients_seed_corpus.zip $OUT/api_gradients_seed_corpus.zip\n\nmv out/Fuzz/api_path_measure $OUT/api_path_measure\nmv ../skia_data/api_path_measure_seed_corpus.zip $OUT/api_path_measure_seed_corpus.zip\n\nmv out/Fuzz/api_pathop $OUT/api_pathop\nmv ../skia_data/api_pathop_seed_corpus.zip $OUT/api_pathop_seed_corpus.zip\n\n# These 3 use the same corpus.\nmv out/Fuzz/png_encoder $OUT/png_encoder\ncp ../skia_data/encoder_seed_corpus.zip $OUT/png_encoder_seed_corpus.zip\n\nmv out/Fuzz/jpeg_encoder $OUT/jpeg_encoder\ncp ../skia_data/encoder_seed_corpus.zip $OUT/jpeg_encoder_seed_corpus.zip\n\nmv out/Fuzz/webp_encoder $OUT/webp_encoder\nmv ../skia_data/encoder_seed_corpus.zip $OUT/webp_encoder_seed_corpus.zip\n\nmv out/Fuzz/skottie_json $OUT/skottie_json\nmv ../skia_data/skottie_json_seed_corpus.zip $OUT/skottie_json_seed_corpus.zip\n\nmv out/Fuzz/skjson $OUT/skjson\nmv ../skia_data/json.dict $OUT/skjson.dict\nmv ../skia_data/skjson_seed_corpus.zip $OUT/skjson_seed_corpus.zip\n\n# These 4 use the same canvas_seed_corpus.\nmv out/Fuzz/api_mock_gpu_canvas $OUT/api_mock_gpu_canvas\ncp ../skia_data/canvas_seed_corpus.zip $OUT/api_mock_gpu_canvas_seed_corpus.zip\n\nmv out/Fuzz/api_raster_n32_canvas $OUT/api_raster_n32_canvas\ncp ../skia_data/canvas_seed_corpus.zip $OUT/api_raster_n32_canvas_seed_corpus.zip\n\nmv out/Fuzz/api_svg_canvas $OUT/api_svg_canvas\ncp ../skia_data/canvas_seed_corpus.zip $OUT/api_svg_canvas_seed_corpus.zip\n\nmv out/Fuzz/api_null_canvas $OUT/api_null_canvas\nmv ../skia_data/canvas_seed_corpus.zip $OUT/api_null_canvas_seed_corpus.zip\n\nmv out/Fuzz/api_image_filter $OUT/api_image_filter\nmv ../skia_data/api_image_filter_seed_corpus.zip $OUT/api_image_filter_seed_corpus.zip\n\nmv out/Fuzz/api_polyutils $OUT/api_polyutils\nmv ../skia_data/api_polyutils_seed_corpus.zip $OUT/api_polyutils_seed_corpus.zip\n\n# These 2 use the same corpus.\nmv out/Fuzz/image_decode $OUT/image_decode\ncp ../skia_data/image_decode_seed_corpus.zip $OUT/image_decode_seed_corpus.zip\n\nmv out/Fuzz/image_decode_incremental $OUT/image_decode_incremental\nmv ../skia_data/image_decode_seed_corpus.zip $OUT/image_decode_incremental_seed_corpus.zip\n\n# skmeshspecification uses the SkSL dictionary but has its own corpus.\nmv out/FuzzDebug/skmeshspecification $OUT/skmeshspecification\ncp ../skia_data/sksl.dict $OUT/skmeshspecification.dict\nmv ../skia_data/skmeshspecification_seed_corpus.zip $OUT/skmeshspecification_seed_corpus.zip\n\n# All eight SkSL tests share the same sksl_seed_corpus and dictionary.\nmv out/FuzzDebug/sksl2glsl $OUT/sksl2glsl\ncp ../skia_data/sksl.dict $OUT/sksl2glsl.dict\ncp ../skia_data/sksl_seed_corpus.zip $OUT/sksl2glsl_seed_corpus.zip\n\nmv out/FuzzDebug/sksl2metal $OUT/sksl2metal\ncp ../skia_data/sksl.dict $OUT/sksl2metal.dict\ncp ../skia_data/sksl_seed_corpus.zip $OUT/sksl2metal_seed_corpus.zip\n\nmv out/FuzzDebug/sksl2pipeline $OUT/sksl2pipeline\ncp ../skia_data/sksl.dict $OUT/sksl2pipeline.dict\ncp ../skia_data/sksl_seed_corpus.zip $OUT/sksl2pipeline_seed_corpus.zip\n\nmv out/FuzzDebug/sksl2spirv $OUT/sksl2spirv\ncp ../skia_data/sksl.dict $OUT/sksl2spirv.dict\ncp ../skia_data/sksl_seed_corpus.zip $OUT/sksl2spirv_seed_corpus.zip\n\nmv out/FuzzDebug/sksl2wgsl $OUT/sksl2wgsl\ncp ../skia_data/sksl.dict $OUT/sksl2wgsl.dict\ncp ../skia_data/sksl_seed_corpus.zip $OUT/sksl2wgsl_seed_corpus.zip\n\nmv out/FuzzDebug/skruntimeblender $OUT/skruntimeblender\ncp ../skia_data/sksl.dict $OUT/skruntimeblender.dict\ncp ../skia_data/sksl_seed_corpus.zip $OUT/skruntimeblender_seed_corpus.zip\n\nmv out/FuzzDebug/skruntimecolorfilter $OUT/skruntimecolorfilter\ncp ../skia_data/sksl.dict $OUT/skruntimecolorfilter.dict\ncp ../skia_data/sksl_seed_corpus.zip $OUT/skruntimecolorfilter_seed_corpus.zip\n\nmv out/FuzzDebug/skruntimeeffect $OUT/skruntimeeffect\nmv ../skia_data/sksl.dict $OUT/skruntimeeffect.dict\nmv ../skia_data/sksl_seed_corpus.zip $OUT/skruntimeeffect_seed_corpus.zip\n\n#\nmv out/Fuzz/skdescriptor_deserialize $OUT/skdescriptor_deserialize\nmv ../skia_data/skdescriptor_deserialize_seed_corpus.zip $OUT/skdescriptor_deserialize_seed_corpus.zip\n\nmv out/Fuzz/svg_dom $OUT/svg_dom\nmv ../skia_data/svg_dom_seed_corpus.zip $OUT/svg_dom_seed_corpus.zip\n\nmv out/Fuzz/api_create_ddl $OUT/api_create_ddl\n\nmv out/Fuzz/api_ddl_threading $OUT/api_ddl_threading\n\nmv out/Fuzz/skp $OUT/skp\nmv ../skia_data/skp_seed_corpus.zip $OUT/skp_seed_corpus.zip\n\nmv out/Fuzz/api_skparagraph $OUT/api_skparagraph\n\nmv out/Fuzz/api_precompile $OUT/api_precompile\n\nmv out/Fuzz/api_regionop $OUT/api_regionop\n\nmv out/Fuzz/api_triangulation $OUT/api_triangulation\n\nmv out/Fuzz/colrv1 $OUT/colrv1\nmv ../skia_data/colrv1_seed_corpus.zip $OUT/colrv1_seed_corpus.zip\n\nmv out/FuzzDebug/skcolorspace $OUT/skcolorspace\nmv ../skia_data/skcolorspace_seed_corpus.zip $OUT/skcolorspace_seed_corpus.zip\n\nmv out/FuzzDebug/parse_path $OUT/parse_path\nmv ../skia_data/parse_path_seed_corpus.zip $OUT/parse_path_seed_corpus.zip\n\n# These only take a few floats - no seed corpus necessary\nmv out/FuzzDebug/quad_roots $OUT/quad_roots\nmv out/FuzzDebug/cubic_roots $OUT/cubic_roots\n"
  },
  {
    "path": "projects/skia/image_filter_deserialize_width.options",
    "content": "[libfuzzer]\nmax_len = 10024\ntimeout = 10\nuse_counters = 0"
  },
  {
    "path": "projects/skia/json.dict",
    "content": "#\n# AFL dictionary for JSON\n# -----------------------\n#\n# Just the very basics.\n#\n# Inspired by a dictionary by Jakub Wilk <jwilk@jwilk.net>\n#\n\n\"0\"\n\",0\"\n\":0\"\n\"0:\"\n\"-1.2e+3\"\n\n\"true\"\n\"false\"\n\"null\"\n\n\"\\\"\\\"\"\n\",\\\"\\\"\"\n\":\\\"\\\"\"\n\"\\\"\\\":\"\n\n\"{}\"\n\",{}\"\n\":{}\"\n\"{\\\"\\\":0}\"\n\"{{}}\"\n\n\"[]\"\n\",[]\"\n\":[]\"\n\"[0]\"\n\"[[]]\"\n\n\"''\"\n\"\\\\\"\n\"\\\\b\"\n\"\\\\f\"\n\"\\\\n\"\n\"\\\\r\"\n\"\\\\t\"\n\"\\\\u0000\"\n\"\\\\x00\"\n\"\\\\0\"\n\"\\\\uD800\\\\uDC00\"\n\"\\\\uDBFF\\\\uDFFF\"\n\n\"\\\"\\\":0\"\n\"//\"\n\"/**/\""
  },
  {
    "path": "projects/skia/project.yaml",
    "content": "homepage: \"https://github.com/google/skia\"\nlanguage: c++\nprimary_contact: \"kjlubick@chromium.org\"\nauto_ccs:\n  - \"hcm@google.com\"\n  - \"michaelludwig@google.com\"\n  - \"robertphillips@google.com\"\n  - \"egdaniel@google.com\"\n  - \"skia-gpu-wrangler@google.com\"\n  - \"skia-bugs-central@skia-public.iam.gserviceaccount.com\"\n  - \"fuzz@skia.org\"\n  - \"drott@chromium.org\"\n  - \"fmalita@chromium.org\"\nvendor_ccs:\n  - \"lsalzman@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n - address\n - undefined\n - memory\nhelp_url: \"https://skia.org/docs/dev/testing/fuzz/\"\nbuilds_per_day: 4\nmain_repo: 'https://skia.googlesource.com/skia.git'\n"
  },
  {
    "path": "projects/skia/sksl.dict",
    "content": "# Adapted from sksl.lex, SkSLBuiltinTypes.cpp, SkSLIntrinsicList.h, and sksl module files\n\n# positive float literals\n\" 0.1\"\n\" 1.2\"\n\" 2.3\"\n\n# negative float literals\n\" -3.4\"\n\" -4.5\"\n\" -5.6\"\n\n# exponential float literals\n\" 1e2\"\n\" 2e3\"\n\" -3e4\"\n\" -4e5\"\n\n# positive int literals\n\" 0\"\n\" 1\"\n\" 2\"\n\n# unsigned int literals\n\" 3u\"\n\" 4u\"\n\n# negative int literals\n\" -5\"\n\" -6\"\n\n# hexadecimal prefix\n\" 0x\"\n\n# bad octal\n\" 08\"\n\n# unsigned bad octal\n\" 09u\"\n\n# keywords\n\" true\"\n\" false\"\n\" if (\"\n\" @if (\"\n\" else\"\n\" for (\"\n\" while (\"\n\" do {\"\n\" switch (\"\n\" @switch (\"\n\" case\"\n\" default:\"\n\" break;\"\n\" continue;\"\n\" discard;\"\n\" return\"\n\" in\"\n\" out\"\n\" inout\"\n\" uniform\"\n\" const\"\n\" flat\"\n\" noperspective\"\n\" inline\"\n\" noinline\"\n\" sk_has_side_effects\"\n\" struct\"\n\" layout (\"\n\" location=\"\n\" offset=\"\n\" binding=\"\n\" index=\"\n\" set=\"\n\" builtin\"\n\" input_attachment_index\"\n\" origin_upper_left\"\n\" blend_support_all_equations\"\n\" push_constant\"\n\" color\"\n\" highp\"\n\" mediump\"\n\" lowp\"\n\" $es3\"\n\" main(\"\n\" #extension\"\n\" : disable\"\n\" : require\"\n\" : enable\"\n\" : warn\"\n\n# reserved words are all treated the same, and always invalidate the whole\n# program, so we only include a handful of them in the dictionary\n\" attribute\"\n\" varying\"\n\" precision\"\n#\"invariant \"\n#\"asm \"\n#\"class \"\n#\"union \"\n#\"enum \"\n#\"typedef \"\n#\"template \"\n#\"this \"\n#\"packed \"\n#\"goto \"\n#\"volatile \"\n#\"public \"\n#\"static \"\n#\"extern \"\n#\"external \"\n#\"interface \"\n#\"long \"\n#\"double \"\n#\"fixed \"\n#\"unsigned \"\n#\"superp \"\n#\"input \"\n#\"output \"\n#\"sizeof \"\n#\"cast \"\n#\"namespace \"\n#\"using \"\n#\"gl_reservedWord \"\n\n# a selection of swizzles\n\".x \"\n\".xx \"\n\".xxx \"\n\".xxxx \"\n\".y \"\n\".yy \"\n\".yyy \"\n\".yyyy \"\n\".x0 \"\n\".x00 \"\n\".x000 \"\n\".1y \"\n\".11y \"\n\".111y \"\n\".r \"\n\".rg \"\n\".rgb \"\n\".rgba \"\n\".abgr \"\n\".ga \"\n\".xy01 \"\n\".1xw0 \"\n\n# array indexing\n\"[0]\"\n\"[1]\"\n\"[2]\"\n\"[3]\"\n\"[4]\"\n\"[-1]\"\n\"[12345]\"\n\"[-12345]\"\n\n# symbol tokens\n\"(\"\n\")\"\n\"{\"\n\"}\"\n\"[\"\n\"]\"\n\".\"\n\",\"\n\"++\"\n\"--\"\n\"+\"\n\"-\"\n\"*\"\n\"/\"\n\"%\"\n\"<<\"\n\">>\"\n\"|\"\n\"^\"\n\"&\"\n\"~\"\n\"||\"\n\"^^\"\n\"&&\"\n\"!\"\n\"?\"\n\":\"\n\"=\"\n\"==\"\n\"!=\"\n\">\"\n\"<\"\n\">=\"\n\"<=\"\n\"+=\"\n\"-=\"\n\"*=\"\n\"/=\"\n\"%=\"\n\"<<=\"\n\">>=\"\n\"|=\"\n\"^=\"\n\"&=\"\n\";\"\n\"//\"\n\"/*\"\n\"*/\"\n\n# types\n\" void\"\n\" float\"\n\" float2\"\n\" float3\"\n\" float4\"\n\" vec2\"\n\" vec3\"\n\" vec4\"\n\" half\"\n\" half2\"\n\" half3\"\n\" half4\"\n\" int\"\n\" int2\"\n\" int3\"\n\" int4\"\n\" uint\"\n\" uint2\"\n\" uint3\"\n\" uint4\"\n\" short\"\n\" short2\"\n\" short3\"\n\" short4\"\n\" ushort\"\n\" ushort2\"\n\" ushort3\"\n\" ushort4\"\n\" bool\"\n\" bool2\"\n\" bool3\"\n\" bool4\"\n\" $floatLiteral\"\n\" $intLiteral\"\n\" float2x2\"\n\" float3x2\"\n\" float4x2\"\n\" float2x3\"\n\" float3x3\"\n\" float4x3\"\n\" float2x4\"\n\" float3x4\"\n\" float4x4\"\n\" half2x2\"\n\" half3x2\"\n\" half4x2\"\n\" half2x3\"\n\" half3x3\"\n\" half4x3\"\n\" half2x4\"\n\" half3x4\"\n\" half4x4\"\n\" mat2\"\n\" mat3\"\n\" mat4\"\n\" mat2x2\"\n\" mat3x2\"\n\" mat4x2\"\n\" mat2x3\"\n\" mat3x3\"\n\" mat4x3\"\n\" mat2x4\"\n\" mat3x4\"\n\" mat4x4\"\n\" colorFilter\"\n\" shader\"\n\" blender\"\n\n# types that aren't accepted in a runtime effect; skip most of them\n\" texture2D\"\n\" sampler2D\"\n\" sampler\"\n#\" texture1D\"\n#\" texture3D\"\n#\" textureExternalOES\"\n#\" texture2DRect\"\n#\" itexture2D\"\n#\" sampler1D\"\n#\" sampler3D\"\n#\" samplerExternalOES\"\n#\" sampler2DRect\"\n#\" isampler2D\"\n#\" subpassInput\"\n#\" subpassInputMS\"\n#\" subpassInputMS\"\n\n# generic types shouldn't be accepted; skip most of them\n\" $genType\"\n\" $sk_Caps\"\n#\" $genHType\"\n#\" $genIType\"\n#\" $genUType\"\n#\" $genBType\"\n#\" $mat\"\n#\" $hmat\"\n#\" $squareMat\"\n#\" $squareHMat\"\n#\" $vec\"\n#\" $hvec\"\n#\" $ivec\"\n#\" $uvec\"\n#\" $svec\"\n#\" $usvec\"\n#\" $bvec\"\n\n# sksl_frag\n\" sk_FragCoord\"\n\" sk_Clockwise\"\n\" sk_FragColor\"\n\" sk_LastFragColor\"\n\" sk_SecondaryFragColor\"\n\n# sksl_gpu\n\" blend_clear(\"\n\" blend_src(\"\n\" blend_dst(\"\n\" blend_src_over(\"\n\" blend_dst_over(\"\n\" blend_src_in(\"\n\" blend_dst_in(\"\n\" blend_src_out(\"\n\" blend_dst_out(\"\n\" blend_src_atop(\"\n\" blend_dst_atop(\"\n\" blend_xor(\"\n\" blend_plus(\"\n\" blend_modulate(\"\n\" blend_screen(\"\n\" blend_overlay(\"\n\" blend_darken(\"\n\" blend_lighten(\"\n\" blend_color_dodge(\"\n\" blend_color_burn(\"\n\" blend_hard_light(\"\n\" blend_soft_light(\"\n\" blend_difference(\"\n\" blend_exclusion(\"\n\" blend_multiply(\"\n\" blend_hue(\"\n\" blend_saturation(\"\n\" blend_color(\"\n\" blend_luminosity(\"\n\" unpremul(\"\n\" proj(\"\n\" cross_length_2d(\"\n\n# sksl_public\n\".eval(\"\n\n# sksl_vert\n\" sk_PerVertex\"\n\" sk_VertexID\"\n\" sk_InstanceID\"\n\n# SkSLIntrinsicList\n\" abs(\"\n\" acosh(\"\n\" acos(\"\n\" all(\"\n\" any(\"\n\" asinh(\"\n\" asin(\"\n\" atanh(\"\n\" atan(\"\n\" bitCount(\"\n\" ceil(\"\n\" clamp(\"\n\" cosh(\"\n\" cos(\"\n\" cross(\"\n\" degrees(\"\n\" determinant(\"\n\" dFdx(\"\n\" dFdy(\"\n\" distance(\"\n\" dot(\"\n\" equal(\"\n\" eval(\"\n\" exp2(\"\n\" exp(\"\n\" faceforward(\"\n\" findLSB(\"\n\" findMSB(\"\n\" floatBitsToInt(\"\n\" floatBitsToUint(\"\n\" floor(\"\n\" fma(\"\n\" fract(\"\n\" frexp(\"\n\" fwidth(\"\n\" greaterThanEqual(\"\n\" greaterThan(\"\n\" intBitsToFloat(\"\n\" inversesqrt(\"\n\" inverse(\"\n\" isinf(\"\n\" isnan(\"\n\" ldexp(\"\n\" length(\"\n\" lessThanEqual(\"\n\" lessThan(\"\n\" log2(\"\n\" log(\"\n\" makeSampler2D(\"\n\" matrixCompMult(\"\n\" matrixInverse(\"\n\" max(\"\n\" min(\"\n\" mix(\"\n\" modf(\"\n\" mod(\"\n\" normalize(\"\n\" notEqual(\"\n\" not (\"\n\" outerProduct(\"\n\" packDouble2x32(\"\n\" packHalf2x16(\"\n\" packSnorm2x16(\"\n\" packSnorm4x8(\"\n\" packUnorm2x16(\"\n\" packUnorm4x8(\"\n\" pow(\"\n\" radians(\"\n\" reflect(\"\n\" refract(\"\n\" roundEven(\"\n\" round(\"\n\" sample(\"\n\" saturate(\"\n\" sign(\"\n\" sinh(\"\n\" sin(\"\n\" smoothstep(\"\n\" sqrt(\"\n\" step(\"\n\" subpassLoad(\"\n\" tanh(\"\n\" tan(\"\n\" transpose(\"\n\" trunc(\"\n\" uintBitsToFloat(\"\n\" unpackDouble2x32(\"\n\" unpackHalf2x16(\"\n\" unpackSnorm2x16(\"\n\" unpackSnorm4x8(\"\n\" unpackUnorm2x16(\"\n\" unpackUnorm4x8(\"\n\" toLinearSrgb(\"\n\" fromLinearSrgb(\"\n"
  },
  {
    "path": "projects/skipper/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth=1 https://github.com/zalando/skipper.git\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/skipper\n"
  },
  {
    "path": "projects/skipper/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfor target in $(find $SRC/skipper/fuzz/fuzz_targets -name 'Fuzz*.go'); do\n        target_basename=$(basename -s .go $target)\n\n        compile_go_fuzzer github.com/zalando/skipper/fuzz/fuzz_targets $target_basename $target_basename gofuzz\ndone\n\nmv $SRC/skipper/fuzz/dictionaries/*.dict $OUT/\n"
  },
  {
    "path": "projects/skipper/project.yaml",
    "content": "homepage: \"https://opensource.zalando.com/skipper/\"\nprimary_contact: \"sandor.szuecs@zalando.de\"\nauto_ccs:\n  - \"team-gwproxy+oss-fuzz@zalando.de\"\n  - \"alexander.yastrebov@zalando.de\"\n  - \"sepehrdad.shanbedi@zalando.de\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/zalando/skipper\"\n"
  },
  {
    "path": "projects/sleuthkit/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool libz-dev\nRUN git clone --depth 1 https://github.com/sleuthkit/sleuthkit sleuthkit\nWORKDIR sleuthkit\nCOPY run_tests.sh build.sh replay_build.sh $SRC/\n"
  },
  {
    "path": "projects/sleuthkit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CFLAGS=\"$CFLAGS -Wno-error=non-c-typedef-for-linkage\"\nexport CXXFLAGS=\"$CXXFLAGS -Wno-error=non-c-typedef-for-linkage\"\n\n# Work around convolution around building static library versus static binaries\n# Also see: https://github.com/sleuthkit/sleuthkit/issues/3020\nsed -i 's/-all-static//g' configure.ac\n\n# Work around hardcoded -Werror flags\n# Also see: https://github.com/sleuthkit/sleuthkit/issues/3012\nsed -i 's/-Werror//g' Makefile.am\n\n# Don't fail if some of the seed downloads fail.\n./ossfuzz/buildcorpus.sh || true\n\n./bootstrap\n./configure --enable-static --enable-shared=no --disable-java --without-afflib --without-libcrypto --without-libewf --without-libvhdi --without-libvmdk\nmake -j$(nproc)\n\n# Copy the fuzzer binaries to the output directory.\ncp *_fuzzer ${OUT}\n"
  },
  {
    "path": "projects/sleuthkit/project.yaml",
    "content": "homepage: \"https://sleuthkit.org\"\nlanguage: c++\nprimary_contact: \"carrier@sleuthkit.org\"\nauto_ccs:\n - \"simsong@gmail.com\"\nmain_repo: 'https://github.com/sleuthkit/sleuthkit'\nfile_github_issue: true\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/sleuthkit/replay_build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script is useful for OSS-Fuzz infrastructure which is used to rebuild\n# code from cached images. This is to support various ongoing efforts in\n# OSS-Fuzz.\n\nmake -j$(nproc)\n\n# Copy the fuzzer binaries to the output directory.\ncp *_fuzzer ${OUT}\n"
  },
  {
    "path": "projects/sleuthkit/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check -j$(nproc)\n"
  },
  {
    "path": "projects/slf4j-api/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/qos-ch/slf4j.git slf4j\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/slf4j\n"
  },
  {
    "path": "projects/slf4j-api/LoggingFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class LoggingFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    final Logger logger = LoggerFactory.getLogger(LoggingFuzzer.class);\n    logger.info(data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/slf4j-api/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"slf4j-api/target/slf4j-api-$CURRENT_VERSION.jar\" $OUT/slf4j-api.jar\ncp \"slf4j-nop/target/slf4j-nop-$CURRENT_VERSION.jar\" $OUT/slf4j-nop.jar\n\nALL_JARS=\"slf4j-api.jar slf4j-nop.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/slf4j-api/project.yaml",
    "content": "homepage: \"https://www.slf4j.org/\"\nlanguage: jvm\nprimary_contact: \"dev.qos.ch@gmail.com\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/qos-ch/slf4j.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/smart_open/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/RaRe-Technologies/smart_open\nWORKDIR smart_open\n\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/smart_open/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/smart_open/fuzz_bytebuffer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport os\nwith atheris.instrument_imports():\n    from smart_open.bytebuffer import ByteBuffer\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    chunk_size = fdp.ConsumeIntInRange(1,100)\n    message_byte = []\n    for i in range(1,fdp.ConsumeIntInRange(1,10)):\n        message_byte.append(fdp.ConsumeBytes(chunk_size))\n\n    buffer = ByteBuffer(chunk_size = fdp.ConsumeIntInRange(1,100))\n\n    buffer.empty()\n    buffer.fill(iter(message_byte))\n    buffer.peek()\n    buffer.read(fdp.ConsumeIntInRange(1,chunk_size))\n    buffer.readline(fdp.ConsumeBytes(1))\n    buffer.empty()\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/smart_open/fuzz_func.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport os\nwith atheris.instrument_imports():\n    from smart_open import parse_uri\n    from smart_open import register_compressor\n\ndef _handle_file(file_obj, mode):\n    return open(file_obj,mode)\n\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n   \n    parse_uri(fdp.ConsumeString(200))\n    register_compressor(\".%s\"%fdp.ConsumeString(3),_handle_file)\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/smart_open/fuzz_util.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nwith atheris.instrument_imports():\n    from smart_open.utils import *\n\ndef TestInput(data):\n    if len(data) < 10:\n       return\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    #Fuzz clamp\n    clamp(\n        fdp.ConsumeInt(10),\n        fdp.ConsumeInt(10),\n        None if fdp.ConsumeBool() else fdp.ConsumeInt(10)\n    )\n\n    #Fuzz check_kwargs\n    kwargs = {}\n    for i in range(1,fdp.ConsumeIntInRange(1,10)):\n        kwargs[fdp.ConsumeString(5)]=fdp.ConsumeString(10)\n    try:\n        check_kwargs(fdp.ConsumeString(10),kwargs)\n    except TypeError as e:\n        if \"is not a callable object\" not in str(e):\n            raise e\n\n    #Fuzz make_range_string\n    try:\n        make_range_string(\n            None if fdp.ConsumeBool() else fdp.ConsumeInt(10),\n            None if fdp.ConsumeBool() else fdp.ConsumeInt(10)\n        )\n    except ValueError as e:\n        if \"make_range_string requires either a stop or start value\" not in str(e):\n            raise e\n\t\n    #Fuzz content_range\n    content_range = \"%s %d-%d/%d\"%(\n        fdp.ConsumeString(10),\n        fdp.ConsumeInt(10),\n        fdp.ConsumeInt(10),\n        fdp.ConsumeInt(10)\n    )\n    try:\n       parse_content_range(content_range)\n    except ValueError as e:\n        error_list = [\n            \"invalid literal for int() with base 10\",\n            \"not enough values to unpack\"\n        ]\n        expected_error = False\n        for error in error_list:\n            if error in str(e):\n                expected_error = True\n        if not expected_error:\n            raise e\n\n    #Fuzz safe_urlsplit\n    try:\n        safe_urlsplit(fdp.ConsumeString(100))\n    except ValueError as e:\n        if \"Invalid IPv6 URL\" not in str(e):\n             raise e\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/smart_open/fuzz_zip.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\nimport os\nwith atheris.instrument_imports():\n    from smart_open import open\n    import zipfile\n    import tempfile\n\ndef TestInput(data):\n    if len(data) < 10:\n      return\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    tmp = tempfile.NamedTemporaryFile(prefix=fdp.ConsumeString(10), suffix=fdp.ConsumeString(4), delete=False)\n    filestr = fdp.ConsumeString(100)\n\n    with open(tmp.name, 'wb') as f:\n        with zipfile.ZipFile(f, 'w') as zip:\n            zip.writestr(fdp.ConsumeString(10), filestr)\n            zip.writestr(fdp.ConsumeString(10), filestr)\n\n    with open(tmp.name, 'rb') as f:\n        with zipfile.ZipFile(f) as zip:\n            for info in zip.infolist():\n                file_bytes = zip.read(info.filename)\n                assert filestr == file_bytes.decode('utf-8')\n    os.unlink(tmp.name)\n\ndef main():\n    atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n    atheris.instrument_all()\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/smart_open/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/RaRe-Technologies/smart_open\nlanguage: python\nmain_repo: https://github.com/RaRe-Technologies/smart_open\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/smt/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/celestiaorg/smt\n\nCOPY build.sh $SRC\nWORKDIR $SRC/smt\n"
  },
  {
    "path": "projects/smt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash -x ./oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/smt/project.yaml",
    "content": "homepage: \"https://github.com/celestiaorg/smt\"\nprimary_contact: \"ismail@celestia.org\"\nauto_ccs:\n  - fuzzing@orijtech.com\n  - emmanuel@orijtech.com\n  - cuong@orijtech.com\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/celestiaorg/smt\"\n"
  },
  {
    "path": "projects/snakeyaml/DefaultYamlFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.yaml.snakeyaml.LoaderOptions;\nimport org.yaml.snakeyaml.Yaml;\nimport org.yaml.snakeyaml.constructor.SafeConstructor;\nimport org.yaml.snakeyaml.error.YAMLException;\n\npublic class DefaultYamlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n      Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));\n      yaml.load(data.consumeRemainingAsString());\n    }\n    catch (YAMLException | IllegalArgumentException e){\n      return;\n    }\n  }\n}"
  },
  {
    "path": "projects/snakeyaml/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/yaml.dict $SRC/YamlFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://bitbucket.org/snakeyaml/snakeyaml.git snakeyaml\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/snakeyaml\n"
  },
  {
    "path": "projects/snakeyaml/SecureYamlFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.yaml.snakeyaml.LoaderOptions;\nimport org.yaml.snakeyaml.Yaml;\nimport org.yaml.snakeyaml.constructor.SafeConstructor;\nimport org.yaml.snakeyaml.error.YAMLException;\n\npublic class SecureYamlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      LoaderOptions options = new LoaderOptions();\n      options.setAllowDuplicateKeys(false);\n      options.setMaxAliasesForCollections(5);\n      options.setAllowRecursiveKeys(false);\n      options.setNestingDepthLimit(3);\n      // since the input is often in UTF-8 for OSS Fuzz, code points are bytes\n      options.setCodePointLimit(5*1024);\n      Yaml yaml = new Yaml(new SafeConstructor(options));\n      yaml.load(data.consumeRemainingAsString());\n    } catch (YAMLException | IllegalArgumentException e) {\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/snakeyaml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/*.dict $OUT\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/snakeyaml-$CURRENT_VERSION.jar\" $OUT/snakeyaml.jar\n\nALL_JARS=\"snakeyaml.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/snakeyaml/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://bitbucket.org/snakeyaml/snakeyaml/src/master/\nlanguage: jvm\nmain_repo: https://bitbucket.org/snakeyaml/snakeyaml.git\nsanitizers:\n- address\nvendor_ccs:\n- patrice.salathe@code-intelligence.com\n- yakdan@code-intelligence.com\n"
  },
  {
    "path": "projects/snappy/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool gettext pkg-config build-essential\nRUN git clone --recurse-submodules https://github.com/google/snappy\n# Update googletest for https://github.com/google/oss-fuzz/pull/13915\nRUN rm -rf $SRC/snappy/third_party/googletest && \\\n    git clone --depth 1 https://github.com/google/googletest $SRC/snappy/third_party/googletest\n\nWORKDIR $SRC/\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/snappy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/snappy\nmkdir -p build && cd build\ncmake -DSNAPPY_FUZZING_BUILD=ON -DSNAPPY_BUILD_TESTS=1 \\\n    -DSNAPPY_BUILD_BENCHMARKS=0 ../ && cmake --build .\n\ncp *_fuzzer $OUT/\n"
  },
  {
    "path": "projects/snappy/project.yaml",
    "content": "homepage: \"https://github.com/google/snappy\"\nlanguage: c++\nprimary_contact: \"costan@google.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\nsanitizers:\n  - address\nmain_repo: 'https://github.com/google/snappy'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/snappy/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/snappy/build\nctest --output-on-failure\n"
  },
  {
    "path": "projects/snappy-java/BitShuffleFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.xerial.snappy.Snappy;\nimport org.xerial.snappy.BitShuffle;\nimport java.io.IOException;\nimport java.util.Arrays;\n\n\npublic class BitShuffleFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    int SIZE = 4096;\n    fuzz_bitshuffle_ints(data.consumeInts(SIZE));\n    fuzz_bitshuffle_longs(data.consumeLongs(SIZE));\n    fuzz_bitshuffle_shorts(data.consumeShorts(SIZE));\n  }\n\n  static void fuzz_bitshuffle_ints(int[] original){\n    int[] result;\n\n    try{   \n      byte[] shuffledByteArray = BitShuffle.shuffle(original);\n      byte[] compressed = Snappy.compress(shuffledByteArray);\n      byte[] uncompressed = Snappy.uncompress(compressed);\n      result = BitShuffle.unshuffleIntArray(uncompressed);\n    }\n    catch( IOException e ){\n      return;\n    }\n    \n    if(Arrays.equals(original,result) == false)\n    {\n      throw new IllegalStateException(\"Original and uncompressed data are different\");\n    }\n\n  }//fuzz_bitshuffle_ints\n\n  static void fuzz_bitshuffle_longs(long[] original){\n    long[] result;\n\n    try{   \n      byte[] shuffledByteArray = BitShuffle.shuffle(original);\n      byte[] compressed = Snappy.compress(shuffledByteArray);\n      byte[] uncompressed = Snappy.uncompress(compressed);\n      result = BitShuffle.unshuffleLongArray(uncompressed);\n    }\n    catch( IOException e ){\n      return;\n    }\n    \n    if(Arrays.equals(original,result) == false)\n    {\n      throw new IllegalStateException(\"Original and uncompressed data are different\");\n    }\n\n  }//fuzz_bitshuffle_longs\n\n  static void fuzz_bitshuffle_shorts(short[] original){\n    short[] result;\n\n    try{   \n      byte[] shuffledByteArray = BitShuffle.shuffle(original);\n      byte[] compressed = Snappy.compress(shuffledByteArray);\n      byte[] uncompressed = Snappy.uncompress(compressed);\n      result = BitShuffle.unshuffleShortArray(uncompressed);\n    }\n    catch( IOException e ){\n      return;\n    }\n    \n    if(Arrays.equals(original,result) == false)\n    {\n      throw new IllegalStateException(\"Original and uncompressed data are different\");\n    }\n\n  }//fuzz_bitshuffle_shorts  \n\n}\n\n"
  },
  {
    "path": "projects/snappy-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/xerial/snappy-java.git snappy-java\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/snappy-java\n"
  },
  {
    "path": "projects/snappy-java/SnappyStreamFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.xerial.snappy.Snappy;\nimport org.xerial.snappy.SnappyInputStream;\nimport org.xerial.snappy.SnappyOutputStream;\nimport org.xerial.snappy.SnappyCodec;\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.BufferedInputStream;\nimport java.util.Arrays;\n\npublic class SnappyStreamFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {    \n\n    byte[] original = data.consumeRemainingAsBytes();\n    byte[] uncompressed;\n    \n    try {\n      ByteArrayOutputStream compressedBuf = new ByteArrayOutputStream();\n      SnappyOutputStream snappyOut = new SnappyOutputStream(compressedBuf);\n      snappyOut.write(original);\n      snappyOut.close();\n      byte[] compressed = compressedBuf.toByteArray();\n      SnappyInputStream snappyIn = new SnappyInputStream(new ByteArrayInputStream(compressed));\n      ByteArrayOutputStream out = new ByteArrayOutputStream();\n      byte[] buf = new byte[4096];\n      for (int readBytes = 0; (readBytes = snappyIn.read(buf)) != -1; ) {\n          out.write(buf, 0, readBytes);\n      }\n      out.flush();\n      uncompressed = out.toByteArray();\n    }\n    catch (IOException e)\n    {\n      return;\n    }\n    \n    if(Arrays.equals(original,uncompressed) == false)\n    {\n      throw new IllegalStateException(\"Original and uncompressed data are different\");\n    }    \n  }\n}\n"
  },
  {
    "path": "projects/snappy-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake\ncp target/snappy-java-*.jar $OUT/snappy-java.jar\n\nALL_JARS=\"snappy-java.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/snappy-java/project.yaml",
    "content": "homepage: \"https://github.com/xerial/snappy-java/\"\nlanguage: jvm\nprimary_contact: \"\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/xerial/snappy-java.git\"\nvendor_ccs:\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"yakdan@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"michael.nothhard@code-intelligence.com\"\n"
  },
  {
    "path": "projects/snort3/project.yaml",
    "content": "homepage: \"https://www.snort.org/snort3\"\nlanguage: c++\nprimary_contact: \"rucombs@cisco.com\"\nauto_ccs:\n  - \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/snort3/snort3.git\"\n"
  },
  {
    "path": "projects/solidity/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! This project was pinned after a clang bump. Please remove the pin, Try to fix any build warnings and errors, as well as runtime errors\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n    build-essential libbz2-dev ninja-build zlib1g-dev wget python python-dev \\\n    liblzma-dev uuid-dev pkg-config openjdk-8-jdk unzip mlton bison texinfo\n\nRUN git clone --recursive -b develop https://github.com/ethereum/solidity.git solidity\nRUN git clone --depth 1 https://github.com/ethereum/solidity-fuzzing-corpus.git\nRUN git clone https://github.com/google/libprotobuf-mutator.git\nRUN git clone --branch=\"v0.11.0\" --recurse-submodules \\\n    https://github.com/ethereum/evmone.git\n\n# Install statically built dependencies in \"/usr\" directory\n# Install boost\nRUN cd $SRC && \\\n    wget -q 'https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2' -O boost.tar.bz2 && \\\n    test \"$(sha256sum boost.tar.bz2)\" = \"6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e  boost.tar.bz2\" && \\\n    tar -xf boost.tar.bz2 && \\\n    rm boost.tar.bz2 && \\\n    cd boost_1_83_0 && \\\n    CXXFLAGS=\"-stdlib=libc++ -pthread\" LDFLAGS=\"-stdlib=libc++\" ./bootstrap.sh --with-toolset=clang --prefix=/usr && \\\n    ./b2 toolset=clang cxxflags=\"-stdlib=libc++ -pthread\" linkflags=\"-stdlib=libc++ -pthread\" headers && \\\n    ./b2 toolset=clang cxxflags=\"-stdlib=libc++ -pthread\" linkflags=\"-stdlib=libc++ -pthread\" \\\n        link=static variant=release runtime-link=static \\\n        system filesystem unit_test_framework program_options \\\n        install -j $(($(nproc)/2)) && \\\n    rm -rf $SRC/boost_1_83_0\n\n# Install libprotobuf-mutator\n# Use commit prior to libprotobuf upgrade that broke solidity build\n# See https://github.com/google/oss-fuzz/issues/10237\nRUN cd $SRC/libprotobuf-mutator; \\\n    git reset --hard 212a7be1eb08e7f9c79732d2aab9b2097085d936; \\\n    mkdir $SRC/LPM; \\\n    cd $SRC/LPM; \\\n    cmake $SRC/libprotobuf-mutator -GNinja \\\n    -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF \\\n    -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"/usr\"; \\\n    ninja; \\\n    ninja install; \\\n    cd external.protobuf; \\\n    cp -Rf bin lib include /usr;\n\n# Install evmone\nRUN cd $SRC/evmone; \\\n    mkdir -p build; \\\n    cd build; \\\n    cmake .. -G Ninja -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=\"/usr\"; \\\n    ninja; \\\n    ninja install/strip;\n\n# gmp\nRUN cd $SRC; \\\n    # Replace system installed libgmp static library\n    # with sanitized version\n    git clone --depth 1 --branch gmp-6.2.1 https://github.com/gmp-mirror/gmp-6.2 gmp/; \\\n    rm -r gmp/.git/; \\\n    test \\\n        \"$(tar --create gmp/ --sort=name --mtime=1970-01-01Z --owner=0 --group=0 --numeric-owner | sha256sum)\" = \\\n        \"d606ff6a4ce98692f9920031e85ea8fcf4a65ce1426f6f0048b8794aefed174b  -\"; \\\n    # NOTE: This removes also libgmp.so, which git depends on\n    rm -f /usr/lib/x86_64-linux-gnu/libgmp.*; \\\n    rm -f /usr/include/x86_64-linux-gnu/gmp.h; \\\n    cd gmp; \\\n    autoreconf -i; \\\n    ./configure --prefix=/usr --enable-static=yes --enable-maintainer-mode; \\\n    make -j; \\\n    make check; \\\n    make install; \\\n    rm -rf $SRC/gmp;\n\n# libabicoder\nRUN set -ex; \\\n    cd /usr/src; \\\n    git clone https://github.com/ekpyron/Yul-Isabelle; \\\n    cd Yul-Isabelle; \\\n    cd libabicoder; \\\n    CXX=clang++ CXXFLAGS=\"-stdlib=libc++ -pthread\" make; \\\n    cp libabicoder.a /usr/lib; \\\n    cp abicoder.hpp /usr/include; \\\n    rm -rf /usr/src/Yul-Isabelle\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/solidity/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#!/usr/bin/env bash\nset -ex\n\nROOTDIR=\"${SRC}/solidity\"\nBUILDDIR=\"${ROOTDIR}/build\"\nmkdir -p \"${BUILDDIR}\"\n\ngenerate_protobuf_bindings()\n{\n  cd \"${ROOTDIR}\"/test/tools/ossfuzz\n  # Generate protobuf C++ bindings\n  for protoName in yul abiV2 sol;\n  do\n    protoc \"${protoName}\"Proto.proto --cpp_out .\n  done\n}\n\nbuild_fuzzers()\n{\n  cd \"${BUILDDIR}\"\n  CXXFLAGS=\"${CXXFLAGS} -I/usr/local/include/c++/v1\"\n  cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/ossfuzz.cmake \\\n        -DCMAKE_BUILD_TYPE=Release \\\n        \"${ROOTDIR}\"\n  make ossfuzz ossfuzz_proto ossfuzz_abiv2 -j $(nproc)\n}\n\ncopy_fuzzers_and_config()\n{\n  cp \"${BUILDDIR}\"/test/tools/ossfuzz/*_ossfuzz \"${OUT}\"\n  cp \"${ROOTDIR}\"/test/tools/ossfuzz/config/*.options \"${OUT}\"\n  cp \"${ROOTDIR}\"/test/tools/ossfuzz/config/*.dict \"${OUT}\"\n}\n\nupdate_corpus()\n{\n  rm -f \"${OUT}\"/*.zip\n  cd \"${SRC}\"/solidity-fuzzing-corpus\n  git pull origin master\n  for dir in \"${SRC}\"/solidity-fuzzing-corpus/*;\n  do\n    name=$(basename $dir)\n    zip -rq \"${OUT}\"/$name $dir\n  done\n}\n\ngenerate_protobuf_bindings\nbuild_fuzzers\ncopy_fuzzers_and_config\nupdate_corpus\n"
  },
  {
    "path": "projects/solidity/project.yaml",
    "content": "homepage: \"https://solidity.readthedocs.io\"\nlanguage: c++\nprimary_contact: \"solidity@argot.org\"\nauto_ccs:\n  - \"axic@ethereum.org\"\n  - \"christian@ethereum.org\"\n  - \"martin.swende@ethereum.org\"\n  - \"bhargava.shastry@ethereum.org\"\nmain_repo: 'https://github.com/ethereum/solidity.git'\n"
  },
  {
    "path": "projects/sonic/project.yaml",
    "content": "homepage: \"https://github.com/bytedance/sonic\"\nmain_repo: \"https://github.com/bytedance/sonic.git\"\nlanguage: go\nprimary_contact: \"dysghappy@163.com\"\nauto_ccs:\n  - \"byone.heng@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - memory\n"
  },
  {
    "path": "projects/sound-open-firmware/Dockerfile",
    "content": "# Copyright 2020 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n#\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n# Base packages\nRUN apt-get -y update && apt-get -y install \\\n      gettext git libc6-dev-i386 libglib2.0-dev libncurses5-dev \\\n      libtool ninja-build software-properties-common python3 python3-pip\n\nRUN python3 -m ensurepip --upgrade\nRUN python3 -m pip install --upgrade pip\nRUN pip3 install west\n\n# Zephyr SDK:\nCOPY fetch-sdk.sh /root\nWORKDIR /root/\nRUN ./fetch-sdk.sh\n\n# SOF itself (also pulls in Zephyr + modules via west)\nRUN west init -m https://github.com/thesofproject/sof $SRC/sof_workspace\nWORKDIR $SRC/sof_workspace\nRUN west update\n\n# Sort of a kludge: oss-fuzz has a \"srcmap\" tool to generate\n# origin/commit info for .git directories automatically.  But it\n# assumes that the remote is named \"origin\", which is not true for\n# west (by design!).  Fix up a fake \"origin\"\nRUN cd $SRC/sof_workspace; sh -c \"$(west list -f '(cd {path}; git remote add origin {url});' | sed 1d)\"\n\n# Zephyr has its own python requirements\nRUN pip3 install -r $SRC/sof_workspace/zephyr/scripts/requirements-base.txt\n\n# Hacks: the oss-fuzz-base/base-clang image (and its derivatives) lack\n# some of the binutils-compatible LLVM tools that a SOF/Zephyr build\n# relies on (when set to build with clang instead of gcc, obviously).\n# Rather than figure out how to install them or why they're missing,\n# just symlink to the GNU tools already installed.\nRUN ln -s /usr/bin/objdump /usr/local/bin/llvm-objdump\nRUN ln -s /usr/bin/strip /usr/local/bin/llvm-strip\n\n# This is the worst.  SOF builds with C++ support even though it won't\n# call it (there are eternal components that use C++, but nothing\n# in-tree that can be fuzzed here).  For obscure compatibility\n# reasons, when using clang Zephyr will still do the final link using\n# binutils, which will pull in libstdc++ and not libc++.  Also, SOF is\n# a 32 bit fuzz binary (it's firmware for a 32 bit DSP, and no one has\n# done the work to make the source base 64 bit clean).  The oss-fuzz\n# runner image does not have a i386 libstdc++.so.6!  But, well, we\n# don't actually need any symbols from it, so...\nRUN cd $SRC; touch empty.c; gcc -m32 -c empty.c; ar rs /usr/lib32/libstdc++.a empty.o\n\n# If a user is mounting their local source directory for debugging\n# then we need to tell git to chill out and just take the repo. If we\n# don't west fails with bogus error messages.\nRUN git config --global --add safe.directory $SRC/sof_workspace/zephyr\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/sound-open-firmware/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2020 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n#\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Environment: Zephyr has its own toolchain selection mechanism, and\n# the oss-fuzz environment generates warnings and confuses things when\n# building some of the (un-fuzzed) build-time tools that aren't quite\n# clang-compatible.\nexport ZEPHYR_TOOLCHAIN_VARIANT=llvm\nunset CC\nunset CCC\nunset CXX\nunset CFLAGS\nunset CXXFLAGS\n\ncd $SRC/sof_workspace\n\n# Force .o object file extension so the OSS-Fuzz indexer clang wrapper correctly\n# recognizes compile outputs (it only checks for .o, not .obj).\nOBJ_EXT_FLAGS=\"-DCMAKE_C_OUTPUT_EXTENSION=.o -DCMAKE_CXX_OUTPUT_EXTENSION=.o -DCMAKE_ASM_OUTPUT_EXTENSION=.o\"\n\nsof/scripts/fuzz.sh -b -s $SANITIZER -a $ARCHITECTURE -- -DEXTRA_CONF_FILE=stub_build_all_ipc3.conf -DEXTRA_CFLAGS=\"-fno-sanitize-recover=all\" $OBJ_EXT_FLAGS\ncp build-fuzz/zephyr/zephyr.exe $OUT/sof-ipc3\nzip $OUT/sof-ipc3.zip sof/tools/corpus/sof-ipc3/*\n\nsof/scripts/fuzz.sh -b -s $SANITIZER -a $ARCHITECTURE -- -DEXTRA_CONF_FILE=stub_build_all_ipc4.conf -DEXTRA_CFLAGS=\"-fno-sanitize-recover=all\" $OBJ_EXT_FLAGS\ncp build-fuzz/zephyr/zephyr.exe $OUT/sof-ipc4\nzip $OUT/sof-ipc4.zip sof/tools/corpus/sof-ipc4/*\n"
  },
  {
    "path": "projects/sound-open-firmware/fetch-sdk.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# use the github API to fetch the latest stable SDK with assets\n\nRELEASES=$(curl -L  -H \"Accept: application/vnd.github+json\"  -H \"X-GitHub-Api-Version: 2022-11-28\"  https://api.github.com/repos/zephyrproject-rtos/sdk-ng/releases)\nSDK=$(jq '[.[] | select(.prerelease == false) | {tag: .tag_name, assets: .assets[] | select(.name | contains(\"linux-x86_64_minimal.tar.xz\"))}] | .[0]' <<< $RELEASES)\n\ncurl -L -o sdk.tar.xz $(jq -r '.assets.browser_download_url' <<< $SDK)\ntar xf sdk.tar.xz\nrm sdk.tar.xz\n\nzephyr-sdk-$(jq -r \".tag\" <<< $SDK | tr -d 'v')/setup.sh -h\n"
  },
  {
    "path": "projects/sound-open-firmware/project.yaml",
    "content": "homepage: \"https://thesofproject.github.io\"\nprimary_contact: \"johnylin@google.com\"\nlanguage: c\nauto_ccs:\n  - \"andyross@google.com\"\n  - \"ranjani.sridharan@intel.corp-partner.google.com\"\n  - \"lgirdwood@gmail.com\"\n  - \"sathyanarayana.nujella@intel.corp-partner.google.com\"\n  - \"adrian.bonislawski@intel.com\"\n  - \"jyri.sarha@intel.com\"\n  - \"rander.wang@intel.com\"\n  - \"flavio.ceolin@intel.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - i386\nmain_repo: \"https://github.com/thesofproject/sof\"\n"
  },
  {
    "path": "projects/soupsieve/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/facelessuser/soupsieve soupsieve\nRUN python3 -m pip install --upgrade pip && pip install beautifulsoup4 lxml\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/soupsieve\n"
  },
  {
    "path": "projects/soupsieve/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/soupsieve/fuzz_closest.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom bs4 import BeautifulSoup\nimport unittest\nimport soupsieve as sv\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  html_str = fdp.ConsumeUnicodeNoSurrogates(1024)\n  soupsieve_str = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n  try:\n    the_soup = BeautifulSoup(html_str, 'html.parser')\n  except:\n    # We do not want to deal with any errors in BeautifulSoup\n    return\n\n  try:\n    elems = list(sv.select(soupsieve_str, the_soup))\n    for elem in elems:\n      sv.closest('div', elem)\n  except sv.SelectorSyntaxError:\n    pass\n  except RecursionError:\n    # Not interesting\n    # Fixes, e.g. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54288\n    pass\n  except NotImplementedError:\n    # Not implemented\n    # Catches e.g. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54276\n    pass\n\n  sv.purge()\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/soupsieve/fuzz_filter.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom bs4 import BeautifulSoup\nimport unittest\nimport soupsieve as sv\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  html_str = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n  try:\n    the_soup = BeautifulSoup(html_str, 'html.parser')\n  except:\n    # We do not want to deal with any errors in BeautifulSoup\n    return\n\n  try:\n    sv.filter(fdp.ConsumeUnicodeNoSurrogates(24), the_soup)\n  except sv.util.SelectorSyntaxError:\n    pass\n  sv.purge()\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/soupsieve/fuzz_match.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom bs4 import BeautifulSoup\nimport unittest\nimport soupsieve as sv\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  html_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 512))\n  soupsieve_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 256))\n  matcher_str = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 124))\n\n  try:\n    the_soup = BeautifulSoup(html_str, 'html.parser')\n  except:\n    # We do not want to deal with any errors in BeautifulSoup\n    return\n\n  try:\n    elems = list(sv.select(soupsieve_str, the_soup))\n    for elem in elems:\n      sv.match(elem, matcher_str)\n  except sv.SelectorSyntaxError:\n    pass\n  except RecursionError:\n    # Not interesting\n    # Fixes, e.g. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54288\n    pass\n  except NotImplementedError:\n    # Not implemented\n    # Catches e.g. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54276\n    pass\n\n  sv.purge()\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/soupsieve/fuzz_select.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nfrom bs4 import BeautifulSoup\nimport unittest\nimport soupsieve as sv\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  html_str      = fdp.ConsumeUnicodeNoSurrogates(1024)\n  soupsieve_str = fdp.ConsumeUnicodeNoSurrogates(1024)\n\n  try:\n    the_soup = BeautifulSoup(html_str, 'html.parser')\n  except:\n    # We do not want to deal with any errors in BeautifulSoup\n    return\n\n  try:\n    list(sv.select(soupsieve_str, the_soup))\n  except sv.SelectorSyntaxError:\n    pass\n  except RecursionError:\n    # Not interesting\n    # Fixes, e.g. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54288\n    pass\n  except NotImplementedError:\n    # Not implemented\n    # Catches e.g. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54276\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/soupsieve/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/facelessuser/soupsieve\nlanguage: python\nmain_repo: https://github.com/facelessuser/soupsieve\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/spatial4j/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/locationtech/spatial4j spatial4j\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/spatial4j\n"
  },
  {
    "path": "projects/spatial4j/SpatialContextFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.locationtech.spatial4j.context.SpatialContext;\nimport org.locationtech.spatial4j.context.SpatialContextFactory;\nimport org.locationtech.spatial4j.exception.InvalidShapeException;\nimport org.locationtech.spatial4j.shape.Shape;\nimport java.text.ParseException;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.locationtech.spatial4j.context.SpatialContext] public org.locationtech.spatial4j.shape.Shape readShapeFromWkt(java.lang.String) throws org.locationtech.spatial4j.exception.InvalidShapeException,java.text.ParseException\npublic class SpatialContextFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      SpatialContext obj = new SpatialContext(new SpatialContextFactory());\n      obj.readShapeFromWkt(data.consumeRemainingAsString());\n    } catch (InvalidShapeException | ParseException | AssertionError e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/spatial4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./target/spatial4j-$CURRENT_VERSION.jar\" $OUT/spatial4j.jar\n\nALL_JARS=\"spatial4j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spatial4j/project.yaml",
    "content": "homepage: https://github.com/locationtech/spatial4j\nmain_repo: https://github.com/locationtech/spatial4j\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/spdk/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make curl yasm autoconf libtool nasm ninja-build\nRUN pip3 install --upgrade pip meson jinja2 tabulate\nRUN git clone --depth 1 https://github.com/spdk/spdk && \\\n    cd spdk && \\\n    git submodule update --init\nWORKDIR $SRC/spdk\nCOPY build.sh parse_json_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/spdk/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build spdk\nexport LDFLAGS=\"${CFLAGS}\"\n./scripts/pkgdep.sh\n./configure --without-shared --disable-tests --disable-unit-tests\nmake -j$(nproc)\n\n# Build fuzzers\n$CXX $CXXFLAGS -I/src/spdk -I/src/spdk/include \\\n        -fPIC -c $SRC/parse_json_fuzzer.cc \\\n        -o parse_json_fuzzer.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n        parse_json_fuzzer.o -o $OUT/parse_json_fuzzer \\\n        /src/spdk/build/lib/libspdk_env_dpdk.a \\\n        /src/spdk/build/lib/libspdk_json.a\n"
  },
  {
    "path": "projects/spdk/parse_json_fuzzer.cc",
    "content": "/*\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <stdlib.h>\n#include \"spdk/json.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n\tchar *buf = (char *)malloc(size);\n\tif (buf == NULL) {\n\t\treturn 0;\n\t}\n\tmemcpy(buf, data, size);\n\tssize_t rc = spdk_json_parse(buf, size, NULL, 0, NULL, 0);\n\n\tfree(buf);\n\treturn 0;\n}\n\n"
  },
  {
    "path": "projects/spdk/project.yaml",
    "content": "homepage: \"https://github.com/spdk/spdk\"\nmain_repo: \"https://github.com/spdk/spdk\"\nlanguage: c\nprimary_contact: \"james.r.harris@intel.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"tomasz.zawadzki@intel.com\"\n  - \"konrad.sztyber@intel.com\"\n  - \"michal.berger@intel.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/spdlog/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install --yes cmake\nRUN git clone --depth 1 https://github.com/gabime/spdlog.git\nRUN zip spdlog_fuzzer_seed_corpus.zip spdlog/example/*\nWORKDIR spdlog\nCOPY build.sh run_tests.sh spdlog_fuzzer.dict $SRC/\nCOPY fuzz/* $SRC/\n"
  },
  {
    "path": "projects/spdlog/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\ncmake -DSPDLOG_BUILD_TESTS=ON . && make -j$(nproc)\n\n# build fuzzers\nfor f in $(find $SRC -name '*_fuzzer.cc'); do\n    b=$(basename -s .cc $f)\n    $CXX $CXXFLAGS -std=c++17 -Iinclude \\\n    $f $LIB_FUZZING_ENGINE ./libspdlog.a \\\n    -o $OUT/$b\ndone\n\ncp $SRC/spdlog_fuzzer_seed_corpus.zip $OUT/\ncp $SRC/*.dict $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/spdlog/fuzz/backtrace_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"spdlog/spdlog.h\"\n#include \"spdlog/sinks/basic_file_sink.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static std::shared_ptr<spdlog::logger> my_logger;\n  if (!my_logger.get()) {\n    my_logger = spdlog::basic_logger_mt(\"basic_logger\", \"/dev/null\");\n    spdlog::set_default_logger(my_logger);\n  }\n\n  if (size == 0) {\n    return 0;\n  }\n\n  FuzzedDataProvider stream(data, size);\n\n  const uint16_t size_arg = stream.ConsumeIntegral<uint16_t>();\n\n  spdlog::enable_backtrace(size_arg);\n  for(int i=0; i<size_arg; i++){\n    spdlog::debug(stream.ConsumeRandomLengthString(size));\n  }\n  spdlog::dump_backtrace();\n  return 0;\n}\n"
  },
  {
    "path": "projects/spdlog/fuzz/format_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"spdlog/spdlog.h\"\n#include \"spdlog/sinks/basic_file_sink.h\"\n#include \"spdlog/pattern_formatter.h\"\n\n\nstd::string my_formatter_txt = \"custom-flag\";\n\nclass my_formatter_flag : public spdlog::custom_flag_formatter\n{\n  \npublic:\n    void format(const spdlog::details::log_msg &, const std::tm &, spdlog::memory_buf_t &dest) override\n    {\n        dest.append(my_formatter_txt.data(), my_formatter_txt.data() + my_formatter_txt.size());\n    }\n\n    std::unique_ptr<custom_flag_formatter> clone() const override\n    {\n        return spdlog::details::make_unique<my_formatter_flag>();\n    }\n};\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  if (size == 0) {\n    return 0;\n  }\n\n  static std::shared_ptr<spdlog::logger> my_logger;\n  if (!my_logger.get()) {\n    my_logger = spdlog::basic_logger_mt(\"basic_logger\", \"/dev/null\");\n    spdlog::set_default_logger(my_logger);\n  }\n\n  FuzzedDataProvider stream(data, size);\n\n  const unsigned long size_arg = stream.ConsumeIntegral<unsigned long>();\n  const unsigned long  int_arg = stream.ConsumeIntegral<unsigned long>();\n  const char flag = (char)(stream.ConsumeIntegral<char>());\n  const std::string pattern = stream.ConsumeRandomLengthString();\n  my_formatter_txt = stream.ConsumeRandomLengthString();\n  const std::string string_arg = stream.ConsumeRandomLengthString();\n  const std::string format_string = stream.ConsumeRemainingBytesAsString();\n\n  using spdlog::details::make_unique;\n  auto formatter = make_unique<spdlog::pattern_formatter>();\n  formatter->add_flag<my_formatter_flag>(flag).set_pattern(pattern);\n  spdlog::set_formatter(std::move(formatter));\n  \n  spdlog::info(format_string.c_str(), size_arg, int_arg, string_arg);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/spdlog/fuzz/format_fuzzer.options",
    "content": "[libfuzzer]\ndict = spdlog_fuzzer.dict"
  },
  {
    "path": "projects/spdlog/fuzz/levels_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"spdlog/spdlog.h\"\n#include \"spdlog/sinks/basic_file_sink.h\"\n#include \"spdlog/cfg/argv.h\"\n#include \"spdlog/cfg/env.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  if (size == 0) {\n    return 0;\n  }\n\n  static std::shared_ptr<spdlog::logger> my_logger;\n  if (!my_logger.get()) {\n    my_logger = spdlog::basic_logger_mt(\"basic_logger\", \"/dev/null\");\n    spdlog::set_default_logger(my_logger);\n  }\n\n  FuzzedDataProvider stream(data, size);\n  \n  std::vector<std::string> strings;\n  const unsigned char strsize = stream.ConsumeIntegral<unsigned char>();\n  for(unsigned char i=0; i<strsize; i++){\n    strings.push_back(stream.ConsumeRandomLengthString());\n  }\n  std::vector<char*> argvv; argvv.reserve(strsize);\n  for(unsigned char i=0; i< strsize; ++i){\n    argvv.push_back(const_cast<char*>(strings[i].c_str()));\n  }\n  \n  if(strsize==0) return 0;\n  \n  const char** argv = (const char**) &argvv[0];\n  spdlog::cfg::load_env_levels();\n  spdlog::cfg::load_argv_levels(strsize, argv);\n  spdlog::info(stream.ConsumeRemainingBytesAsString());\n  \n  return 0;\n}\n"
  },
  {
    "path": "projects/spdlog/fuzz/levels_fuzzer.options",
    "content": "[libfuzzer]\ndict = spdlog_fuzzer.dict"
  },
  {
    "path": "projects/spdlog/fuzz/log_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"spdlog/spdlog.h\"\n#include \"spdlog/sinks/basic_file_sink.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static std::shared_ptr<spdlog::logger> my_logger;\n  if (!my_logger.get()) {\n    my_logger = spdlog::basic_logger_mt(\"basic_logger\", \"/dev/null\");\n    spdlog::set_default_logger(my_logger);\n  }\n\n  if (size == 0) {\n    return 0;\n  }\n\n\n  FuzzedDataProvider stream(data, size);\n\n  const unsigned long size_arg = stream.ConsumeIntegral<unsigned long>();\n  const unsigned long int_arg = stream.ConsumeIntegral<unsigned long>();\n  const std::string string_arg = stream.ConsumeRandomLengthString(size);\n  const std::string format_string = stream.ConsumeRemainingBytesAsString();\n\n  spdlog::info(format_string.c_str(), size_arg, int_arg, string_arg);\n  spdlog::trace(format_string.c_str(), size_arg, int_arg, string_arg);\n  spdlog::debug(format_string.c_str(), size_arg, int_arg, string_arg);\n  spdlog::error(format_string.c_str(), size_arg, int_arg, string_arg);\n  spdlog::warn(format_string.c_str(), size_arg, int_arg, string_arg);\n  spdlog::critical(format_string.c_str(), size_arg, int_arg, string_arg);\n\n  SPDLOG_INFO(format_string.c_str(), size_arg, int_arg, string_arg);\n  SPDLOG_TRACE(format_string.c_str(), size_arg, int_arg, string_arg);\n  SPDLOG_DEBUG(format_string.c_str(), size_arg, int_arg, string_arg);\n  SPDLOG_ERROR(format_string.c_str(), size_arg, int_arg, string_arg);\n  SPDLOG_WARN(format_string.c_str(), size_arg, int_arg, string_arg);\n  SPDLOG_CRITICAL(format_string.c_str(), size_arg, int_arg, string_arg);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/spdlog/fuzz/log_fuzzer.options",
    "content": "[libfuzzer]\ndict = spdlog_fuzzer.dict"
  },
  {
    "path": "projects/spdlog/fuzz/pattern_fuzzer.cc",
    "content": "// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"spdlog/spdlog.h\"\n#include \"spdlog/sinks/basic_file_sink.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  static std::shared_ptr<spdlog::logger> my_logger;\n  if (!my_logger.get()) {\n    my_logger = spdlog::basic_logger_mt(\"basic_logger\", \"/dev/null\");\n    spdlog::set_default_logger(my_logger);\n  }\n\n  if (size == 0) {\n    return 0;\n  }\n\n  FuzzedDataProvider stream(data, size);\n  const std::string str = stream.ConsumeRemainingBytesAsString();\n  spdlog::set_pattern(str);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/spdlog/fuzz/pattern_fuzzer.options",
    "content": "[libfuzzer]\ndict = spdlog_fuzzer.dict"
  },
  {
    "path": "projects/spdlog/project.yaml",
    "content": "homepage: \"https://github.com/gabime/spdlog\"\nlanguage: c++\nprimary_contact: \"gmelman1@gmail.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\n  - undefined\nmain_repo: 'https://github.com/gabime/spdlog.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/spdlog/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest -j 4 --output-on-failure\n"
  },
  {
    "path": "projects/spdlog/spdlog_fuzzer.dict",
    "content": "\"{}\"\n\"{:08d}\"\n\"{0:d}\"\n\"{0:x}\"\n\"{0:o}\"\n\"{0:b}\"\n\"{:03.2f}\"\n\"{1}\"\n\"{0}\"\n\"{:<8}\"\n\"{:<999999999999999999999999}\"\n\"[%H:%M:%S %z]\"\n\"[%^%L%$]\"\n\"[thread %t]\"\n\"%v\"\n\"%+\"\n\"{:X}\"\n\"{:s}\"\n\"{:p}\"\n\"{:n}\""
  },
  {
    "path": "projects/spdm-rs/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth 1 --recursive https://github.com/ccc-spdm-tools/spdm-rs.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/spdm-rs\n"
  },
  {
    "path": "projects/spdm-rs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nset -eox pipefail\npushd $SRC/spdm-rs\n\nexport CARGO_TARGET_DIR=$SRC/spdm-rs/target\nFUZZ_TARGET_OUTPUT_DIR=${CARGO_TARGET_DIR}/x86_64-unknown-linux-gnu/release\n\nbash sh_script/pre-build.sh\n\npushd spdmlib\ncargo fuzz build --release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\npopd # spdmlib\n\npopd # $SRC/spdm-rs\n"
  },
  {
    "path": "projects/spdm-rs/project.yaml",
    "content": "homepage: \"https://github.com/ccc-spdm-tools/spdm-rs\"\nmain_repo: 'https://github.com/ccc-spdm-tools/spdm-rs.git'\nlanguage: rust\nprimary_contact: \"xiaoyu1.lu@intel.com\"\nauto_ccs:\n  - \"jiewen.yao@intel.com\"\n  - \"longlong.yang@intel.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer"
  },
  {
    "path": "projects/speex/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf libtool pkg-config wget\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/ogg.git\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/speex.git speex\nWORKDIR speex\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/speex/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd $SRC/ogg\n./autogen.sh\n./configure --prefix=\"$WORK\" --enable-static --disable-shared --disable-crc\nmake clean\nmake -j$(nproc)\nmake install\npopd\n\n./autogen.sh\nexport CFLAGS=\"$CFLAGS -DDISABLE_NOTIFICATIONS -DDISABLE_WARNINGS\"\n# Build fixed-point encoder fuzzer\nPKG_CONFIG_PATH=\"$WORK\"/lib/pkgconfig ./configure --prefix=\"$WORK\" --enable-static --disable-shared --enable-fixed-point\nmake -j$(nproc)\nmake install\n$CXX $CXXFLAGS contrib/oss-fuzz/speexenc_fuzzer.cc -o $OUT/speex_encode_fuzzer_fixed -L\"$WORK/lib\" -I\"$WORK/include\" $LIB_FUZZING_ENGINE -lspeex\n# Build floating-point encoder fuzzer\nPKG_CONFIG_PATH=\"$WORK\"/lib/pkgconfig ./configure --prefix=\"$WORK\" --enable-static --disable-shared\nmake -j$(nproc)\nmake install\n$CXX $CXXFLAGS contrib/oss-fuzz/speexenc_fuzzer.cc -o $OUT/speex_encode_fuzzer_float -L\"$WORK/lib\" -I\"$WORK/include\" $LIB_FUZZING_ENGINE -lspeex\n# Build fixed-point decoder fuzzer\nPKG_CONFIG_PATH=\"$WORK\"/lib/pkgconfig ./configure --prefix=\"$WORK\" --enable-static --disable-shared --enable-fixed-point\nmake -j$(nproc)\nmake install\n$CXX $CXXFLAGS contrib/oss-fuzz/speexdec_fuzzer.cc -o $OUT/speex_decode_fuzzer_fixed -L\"$WORK/lib\" -I\"$WORK/include\" $LIB_FUZZING_ENGINE -lspeex -logg\n# Build floating-point decoder fuzzer\nPKG_CONFIG_PATH=\"$WORK\"/lib/pkgconfig ./configure --prefix=\"$WORK\" --enable-static --disable-shared\nmake -j$(nproc)\nmake install\n$CXX $CXXFLAGS contrib/oss-fuzz/speexdec_fuzzer.cc -o $OUT/speex_decode_fuzzer_float -L\"$WORK/lib\" -I\"$WORK/include\" $LIB_FUZZING_ENGINE -lspeex -logg\n\n# build samples and prepare corpus\ncd src/\n./generate-samples.sh\nzip -j0r ${OUT}/speex_decode_fuzzer_fixed_seed_corpus.zip ./samples/\ncp ${OUT}/speex_decode_fuzzer_fixed_seed_corpus.zip ${OUT}/speex_decode_fuzzer_float_seed_corpus.zip\ncd ..\n"
  },
  {
    "path": "projects/speex/project.yaml",
    "content": "homepage: \"https://speex.org/\"\nlanguage: c++\nprimary_contact: \"tmatth@videolan.org\"\nauto_ccs:\n  - \"twsmith@mozilla.com\"\n  - \"le.businessman@gmail.com\"\n  - \"jmvalin@jmvalin.ca\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://gitlab.xiph.org/xiph/speex.git'\n"
  },
  {
    "path": "projects/spice-usbredir/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN \\\n  apt-get update && \\\n  apt-get install -y libtool libusb-1.0-0-dev pkg-config libglib2.0-dev && \\\n  apt-get clean\n\n# Ubuntu 16.04 ships Meson 0.29 which doesn't support the \"feature\" option type.\n#\n# https://mesonbuild.com/Build-options.html#features\nRUN python3 -m pip install --no-user --no-cache meson ninja\n\nRUN git clone --depth 1 https://gitlab.freedesktop.org/spice/usbredir.git $SRC/spice-usbredir\n\nWORKDIR $SRC/spice-usbredir\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/spice-usbredir/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexec ./build-aux/oss-fuzz.sh\n"
  },
  {
    "path": "projects/spice-usbredir/project.yaml",
    "content": "homepage: \"https://www.spice-space.org/usbredir.html\"\nlanguage: c++\nprimary_contact: \"freddy77@gmail.com\"\nauto_ccs:\n  - \"imsnah@gmail.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: \"https://gitlab.freedesktop.org/spice/usbredir.git\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/spicy/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nSHELL [\"/bin/bash\", \"-o\", \"pipefail\", \"-c\"]\nENV DEBIAN_FRONTEND=noninteractive\n\nRUN apt-get update \\\n && apt-get install -y --no-install-recommends \\\n    curl \\\n    ca-certificates \\\n    gnupg2 \\\n    less \\\n    sudo \\\n # Spicy build and test dependencies.\n && apt-get install -y --no-install-recommends \\\n    git \\\n    ninja-build \\\n    bison \\\n    flex \\\n    libfl-dev \\\n    zlib1g-dev \\\n    libssl-dev \\\n    locales-all \\\n # Spicy doc dependencies.\n && apt-get install -y --no-install-recommends \\\n    python3 \\\n    python3-pip \\\n    python3-sphinx \\\n    python3-sphinx-rtd-theme \\\n    python3-setuptools \\\n    python3-wheel doxygen \\\n && pip3 install --no-cache-dir \"btest>=0.66\" \\\n # Install a recent CMake.\n && mkdir -p /opt/cmake \\\n && curl -L https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-linux-x86_64.tar.gz | tar xzvf - -C /opt/cmake --strip-components 1 \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\nENV PATH=\"/opt/cmake/bin:${PATH}\"\n\nRUN git clone --depth 1 --recursive https://github.com/zeek/spicy spicy \\\n && git clone --depth 1 --recursive https://github.com/zeek/spicy-dhcp spicy/spicy-dhcp \\\n && git clone --depth 1 --recursive https://github.com/zeek/spicy-tftp spicy/spicy-tftp \\\n && git clone --depth 1 --recursive https://github.com/zeek/spicy-pe spicy/spicy-pe \\\n && git clone --depth 1 --recursive https://github.com/zeek/spicy-png spicy/spicy-png \\\n && git clone --depth 1 --recursive https://github.com/zeek/spicy-dns spicy/spicy-dns \\\n && git clone --depth 1 --recursive https://github.com/zeek/spicy-http spicy/spicy-http\n\nWORKDIR ${SRC}/spicy\n\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/spicy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho 'add_subdirectory(ci/fuzz)' >> CMakeLists.txt\n\nexport LIBFUZZER_LIB=$( echo /usr/local/lib/clang/*/lib/$ARCHITECTURE-unknown-linux-gnu/libclang_rt.fuzzer_no_main.a )\n\nCXXFLAGS=\"${CXXFLAGS} -DHILTI_HAVE_SANITIZER\" ./configure --generator=Ninja --build-type=Release || (cat build/config.log && exit)\nmapfile -t FUZZ_TARGETS < <(ninja -C build -t targets | grep fuzz- | cut -d: -f1)\nninja -j\"$(nproc)\" -C build \"${FUZZ_TARGETS[@]}\" tests\n\ncp build/bin/fuzz-* \"${OUT}\"\ncp -r build \"${OUT}\"\n\n## Replace soflinks in copied out build directory with actual contents.\nFROM=${SRC}/spicy\nTO=${OUT}/$(basename \"${SRC}\")/spicy\n\n# Replace softlinks to runtime headers with actual contents.\nmkdir -p \"${TO}/hilti/runtime/include/hilti/rt\"\nrm -rf \"${TO}/hilti/runtime/include/hilti/rt\"/*\ncp -rP \"${FROM}/hilti/runtime/include/\"* \"${TO}/hilti/runtime/include/hilti/rt\"\n\nmkdir -p \"${TO}/spicy/runtime/include/spicy/rt\"\nrm -rf \"${TO}/spicy/runtime/include/spicy/rt\"/*\ncp -rP \"${FROM}/spicy/runtime/include/\"* \"${TO}/spicy/runtime/include/spicy/rt\"\n\n# Replace softlinks to 3rdparty dependencies with actual contents.\nfor DEP in ArticleEnumClass-v2 SafeInt tinyformat nlohmann; do\n\tD=${TO}/hilti/runtime/include/hilti/rt/3rdparty\n\trm -r \"${D}/${DEP}\"\n\tmkdir -p \"${D}/${DEP}\"\n\tcp -rL \"${FROM}/hilti/runtime/include/hilti/rt/3rdparty/${DEP}\"/* \"${D}/${DEP}/\"\ndone\n"
  },
  {
    "path": "projects/spicy/project.yaml",
    "content": "homepage: \"https://docs.zeek.org/projects/spicy/en/latest/\"\nlanguage: c++\nprimary_contact: \"security@zeek.org\"\nauto_ccs:\n  - \"robin@corelight.com\"\n  - \"johanna@corelight.com\"\n  - \"tim@corelight.com\"\n  - \"seth@corelight.com\"\n  - \"justin@corelight.com\"\n  - \"vern@corelight.com\"\n  - \"benjamin.bannier@corelight.com\"\n  - \"christian@corelight.com\"\n  - \"evan.typanski@corelight.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/zeek/spicy'\n\ncoverage_extra_args: >\n  -ignore-filename-regex=src/spicy/3rdparty/.*\n  -ignore-filename-regex=src/spicy/build/3rdparty/.*\n  -ignore-filename-regex=src/spicy/hilti/runtime/include/hilti/rt/3rdparty/.*\n"
  },
  {
    "path": "projects/spicy/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run unit test\nninja test -C build -j$(nproc)\n"
  },
  {
    "path": "projects/spidermonkey/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get upgrade -y && apt-get install -y \\\n  autoconf2.13 \\\n  libc++1 \\\n  libc++abi1 \\\n  m4 \\\n  yasm \\\n  python \\\n  patchelf \\\n  libxml2 \\\n  llvm-dev curl\n# we need llvm-dev for llvm-objdump\n\n# This wrapper of cargo seems to interfere with our build system.\nRUN rm -f /usr/local/bin/cargo\n\nRUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $SRC/rustbuild.sh && \\\n    chmod +x $SRC/rustbuild.sh && \\\n    $SRC/rustbuild.sh -y\n\nRUN git clone --depth=1 https://github.com/mozilla/gecko-dev mozilla-central\nWORKDIR mozilla-central/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/spidermonkey/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ensure rust nightly is used\nsource $HOME/.cargo/env\nrustup default nightly\n\n# Write mozconfig file.\necho '\nac_add_options --enable-application=js\nmk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-shell\n\nac_add_options --enable-debug\nac_add_options --enable-optimize=\"-O2 -gline-tables-only\"\n\nac_add_options --disable-jemalloc\nac_add_options --disable-tests\nac_add_options --enable-address-sanitizer\n\nCFLAGS=\"-fsanitize=address\"\nCXXFLAGS=\"-fsanitize=address\"\nLDFLAGS=\"-fsanitize=address\"\n' > ./mozconfig\nexport MOZCONFIG=./mozconfig\n\n# Install dependencies.\n./mach --no-interactive bootstrap --application-choice js\n\n./mach build \"-j$(nproc)\"\n\ncp obj-shell/dist/bin/js $OUT\n\n# Copy libraries.\nmkdir -p $OUT/lib\ncp -L /usr/lib/x86_64-linux-gnu/libc++.so.1 $OUT/lib\ncp -L /usr/lib/x86_64-linux-gnu/libc++abi.so.1 $OUT/lib\n\n# Make sure libs are resolved properly\npatchelf --set-rpath '$ORIGIN/lib'  $OUT/js\n"
  },
  {
    "path": "projects/spidermonkey/project.yaml",
    "content": "homepage: \"https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey\"\nlanguage: c++\nmain_repo: https://hg.mozilla.org/mozilla-central/\nprimary_contact: \"choller@mozilla.com\"\nauto_ccs:\n  - jdemooij@mozilla.com\n  - sledru@mozilla.com\n  - twsmith@mozilla.com\nvendor_ccs:\n  - oss-fuzz@mozilla-fuzzing.iam.gserviceaccount.com\nfuzzing_engines:\n  - none\nsanitizers:\n  - address\nblackbox: true\n"
  },
  {
    "path": "projects/spidermonkey-ufi/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    autoconf2.13 \\\n    python \\\n    libc++1 \\\n    libc++abi1 \\\n    m4 llvm-dev curl\n\n# This wrapper of cargo seems to interfere with our build system.\nRUN rm -f /usr/local/bin/cargo\n\nRUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $SRC/rustbuild.sh && \\\n    chmod +x $SRC/rustbuild.sh && \\\n    $SRC/rustbuild.sh -y\n\nRUN git clone --depth=1 https://github.com/mozilla/gecko-dev mozilla-central\nWORKDIR mozilla-central/js/src/\nCOPY build.sh target.c $SRC/\n"
  },
  {
    "path": "projects/spidermonkey-ufi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Case-sensitive names of internal Firefox fuzzing targets. Edit to add more.\nFUZZ_TARGETS=(\n  StructuredCloneReader\n  Wasm\n)\n\n# Ensure rust nightly is used\nsource $HOME/.cargo/env\nrustup default nightly\n\n# Install dependencies.\nexport MOZBUILD_STATE_PATH=/root/.mozbuild\nexport SHELL=/bin/bash\ncd ../../\n./mach --no-interactive bootstrap --application-choice browser\ncd js/src/\n\nautoconf2.13\n\n# Skip patches for now\nrm ../../tools/fuzzing/libfuzzer/patches/*.patch\ntouch ../../tools/fuzzing/libfuzzer/patches/dummy.patch\n\n# Update internal libFuzzer.\n(cd ../../tools/fuzzing/libfuzzer && ./clone_libfuzzer.sh HEAD)\n\nmkdir -p build_OPT.OBJ\ncd build_OPT.OBJ\n\nif [ \"$SANITIZER\" = coverage ]; then\n  SAN_OPT=\"--enable-coverage\"\nelse\n  SAN_OPT=\"--enable-$SANITIZER-sanitizer\"\nfi\n\n../configure \\\n    --enable-debug \\\n    --enable-optimize=\"-O2 -gline-tables-only\" \\\n    --disable-jemalloc \\\n    --enable-tests \\\n    --enable-fuzzing \\\n    $SAN_OPT\n\nmake \"-j$(nproc)\"\n\ncp dist/bin/fuzz-tests $OUT\n\n# Build a wrapper binary for each target to set environment variables.\nfor FUZZ_TARGET in ${FUZZ_TARGETS[@]}\ndo\n  $CC $CFLAGS -O0 \\\n    -DFUZZ_TARGET=$FUZZ_TARGET \\\n    $SRC/target.c -o $OUT/$FUZZ_TARGET\ndone\n\n# Copy libraries.\nmkdir -p $OUT/lib\ncp -L /usr/lib/x86_64-linux-gnu/libc++.so.1 $OUT/lib\ncp -L /usr/lib/x86_64-linux-gnu/libc++abi.so.1 $OUT/lib\n"
  },
  {
    "path": "projects/spidermonkey-ufi/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: 'https://searchfox.org/mozilla-central/source/js/src/fuzz-tests/README'\nlanguage: c++\nmain_repo: https://hg.mozilla.org/mozilla-central/\nprimary_contact: 'choller@mozilla.com'\nvendor_ccs:\n  - oss-fuzz@mozilla-fuzzing.iam.gserviceaccount.com\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/spidermonkey-ufi/target.c",
    "content": "#include <limits.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n#define STRINGLIT(S) #S\n#define STRINGIFY(S) STRINGLIT(S)\n\n// Required for oss-fuzz to consider the binary a target.\nstatic const char* magic __attribute__((used)) = \"LLVMFuzzerTestOneInput\";\n\nint main(int argc, char* argv[]) {\n  char path[PATH_MAX] = {0};\n\n  // Handle (currently not used) relative binary path.\n  if (**argv != '/') {\n    if (!getcwd(path, PATH_MAX - 1)) {\n      perror(\"getcwd\");\n      exit(1);\n    }\n    strcat(path, \"/\");\n  }\n\n  if (strlen(path) + strlen(*argv) + 40 >= PATH_MAX) {\n    fprintf(stderr, \"Path length would exceed PATH_MAX\\n\");\n    exit(1);\n  }\n\n  strcat(path, *argv);\n  char* solidus = strrchr(path, '/');\n  *solidus = 0; // terminate path before last /\n\n  char ld_path[PATH_MAX] = {0};\n  strcpy(ld_path, path);\n  strcat(ld_path, \"/lib\");\n\n  // Expects LD_LIBRARY_PATH to also be set by oss-fuzz.\n  setenv(\"LD_LIBRARY_PATH\", ld_path, 0);\n  setenv(\"HOME\", \"/tmp\", 0);\n  setenv(\"FUZZER\", STRINGIFY(FUZZ_TARGET), 1);\n\n  char* options = getenv(\"ASAN_OPTIONS\");\n  if (options) {\n    char* ptr;\n    char* new_options = strdup(options);\n\n    // https://bugzilla.mozilla.org/1477846\n    ptr = strstr(new_options, \"detect_stack_use_after_return=1\");\n    if (ptr) ptr[30] = '0';\n\n    // https://bugzilla.mozilla.org/1477844\n    ptr = strstr(new_options, \"detect_leaks=1\");\n    if (ptr) ptr[13] = '0';\n\n    setenv(\"ASAN_OPTIONS\", new_options, 1);\n    free(new_options);\n  }\n\n\n  char js_path[PATH_MAX] = {0};\n  strcpy(js_path, path);\n  strcat(js_path, \"/fuzz-tests\");\n\n  int ret = execv(js_path, argv);\n  if (ret)\n    perror(\"execv\");\n  return ret;\n}\n\n"
  },
  {
    "path": "projects/spirv-cross/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update &&  \\\n  apt-get install -y build-essential autoconf automake libtool pkg-config make \\\n                     cmake\n\n\nRUN git clone https://github.com/KhronosGroup/SPIRV-Cross spirv-cross\nWORKDIR $SRC/spirv-cross\n\nCOPY *_fuzzer.cpp *.diff *.sh $SRC/\n\n"
  },
  {
    "path": "projects/spirv-cross/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Apply the following patch for tests to succeed.\ngit apply --ignore-space-change --ignore-whitespace  ../patch.diff\n\n# Update submodule\n./checkout_glslang_spirv_tools.sh\nNPROC=\"--parallel $(nproc)\" ./build_glslang_spirv_tools.sh\n\n# Build spirv-cross binaries with debug options\ncmake -S . -B build/ -D CMAKE_BUILD_TYPE=Debug \\\n    -D CMAKE_CXX_FLAGS=\"$CXXFLAGS -pthread -stdlib=libc++\"\ncmake --build build --config Debug --parallel $(nproc)\n\n# Copy built binaries of the spirv-cross project\nfor fuzzers in $(find $SRC -maxdepth 1 -name '*_fuzzer.cpp'); do\n    fuzz_basename=$(basename -s .cpp $fuzzers)\n    $CXX $CXXFLAGS -std=c++17 -I$SRC/spirv-cross \\\n        -I$SRC/spirv-cross/external/spirv-tools \\\n        -I$SRC/spirv-cross/external/spirv-tools/include \\\n        -c $fuzzers -o $fuzz_basename.o\n\n    $CXX $CXXFLAGS -std=c++17 $LIB_FUZZING_ENGINE \\\n        $fuzz_basename.o -o $OUT/$fuzz_basename \\\n        -Wl,--start-group \\\n        $SRC/spirv-cross/build/*.a \\\n        $SRC/spirv-cross/external/glslang-build/output/lib/*.a \\\n        -Wl,--end-group\ndone\n\ncd $SRC/\nmkdir -p spirv-corpus\nfind $SRC/spirv-cross -name \"*.spv\" -exec cp {} $SRC/spirv-corpus \\;\nzip -q -r -j $OUT/parser_fuzzer_seed_corpus.zip $SRC/spirv-corpus/*\n"
  },
  {
    "path": "projects/spirv-cross/parser_fuzzer.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"spirv_common.hpp\"\n#include \"spirv_parser.hpp\"\n#include <cstdint>\n#include <vector>\n\nusing namespace spirv_cross;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  // Skip this iteration if data is not enough\n  if (size < (sizeof(uint32_t) * 5) || (size % 4 != 0)) {\n    return 0;\n  }\n\n  // Initialise objects and random data\n  std::vector<uint32_t> spirv_data((uint32_t *)data, (uint32_t *)(data + size));\n\n  // Set magic number, since this is needed to get past initial checks.\n  spirv_data[0] = 0x07230203;\n  spirv_data[1] = 0x10600;\n\n  Parser parser(spirv_data);\n  ParsedIR &ir = parser.get_parsed_ir();\n  SPIRFunction *current_function = nullptr;\n  SPIRBlock *current_block = nullptr;\n\n  try {\n    parser.parse();\n  } catch (...) {\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/spirv-cross/patch.diff",
    "content": "diff --git a/Makefile b/Makefile\nindex b44eb5e8..def197c9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -30,7 +30,7 @@ all: $(TARGET)\n -include $(DEPS)\n \n $(TARGET): $(CLI_OBJECTS) $(STATIC_LIB)\n-\t$(CXX) -o $@ $(CLI_OBJECTS) $(STATIC_LIB) $(LDFLAGS)\n+\t$(CXX) ${CXXFLAGS} -o $@ $(CLI_OBJECTS) $(STATIC_LIB) $(LDFLAGS)\n \n $(STATIC_LIB): $(OBJECTS)\n \t$(AR) rcs $@ $(OBJECTS)\n"
  },
  {
    "path": "projects/spirv-cross/project.yaml",
    "content": "homepage: \"https://github.com/KhronosGroup/SPIRV-Cross\"\nmain_repo: \"https://github.com/KhronosGroup/SPIRV-Cross.git\"\nlanguage: c++\nsanitizers:\n- address\nvendor_ccs:\n- \"fuzzing@fuchsia.dev\"\n- \"david@adalogics.com\"\n- \"arthur.chan@adalogics.com\"\n"
  },
  {
    "path": "projects/spirv-cross/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\nexport CXXFLAGS=\"$CXXFLAGS -pthread -stdlib=libc++\"\n./test_shaders.sh --parallel\n"
  },
  {
    "path": "projects/spirv-tools/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool ninja-build\nRUN git clone --filter=tree:0 https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools\nWORKDIR spirv-tools\nCOPY run_tests.sh build.sh $SRC/\nCOPY generate_spirv_corpus.py $SRC/\n"
  },
  {
    "path": "projects/spirv-tools/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSCRIPT_DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\")\" >/dev/null 2>&1 && pwd )\"\n\n[ -d external/abseil_cpp ] || git clone https://github.com/abseil/abseil-cpp external/abseil_cpp --depth=1\n[ -d external/re2 ] || git clone https://github.com/google/re2 external/re2 --depth=1\n[ -d external/effcee ] || git clone https://github.com/google/effcee external/effcee --depth=1\n[ -d external/googletest ] || git clone https://github.com/google/googletest external/googletest --depth=1\n[ -d external/spirv-headers ] || git clone https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers --depth=1\n[ -d external/protobuf ] || git clone https://github.com/protocolbuffers/protobuf   external/protobuf      --branch v3.13.0.1\n\n[ -d build ] || mkdir build\npushd build\n\nCMAKE_ARGS=\"-DSPIRV_BUILD_LIBFUZZER_TARGETS=ON -DSPIRV_LIB_FUZZING_ENGINE_LINK_OPTIONS=$LIB_FUZZING_ENGINE\"\n\n# With ubsan, RTTI must be enabled due to certain checks (vptr) requiring it.\nif [ $SANITIZER == \"undefined\" ];\nthen\n  CMAKE_ARGS=\"${CMAKE_ARGS} -DENABLE_RTTI=ON\"\nfi\ncmake -G Ninja .. ${CMAKE_ARGS}\nninja\n\nSPIRV_BINARY_FUZZERS=\"spvtools_binary_parser_fuzzer\\\n spvtools_dis_fuzzer\\\n spvtools_opt_legalization_fuzzer\\\n spvtools_opt_performance_fuzzer\\\n spvtools_opt_size_fuzzer\\\n spvtools_val_fuzzer\"\n\nSPIRV_ASSEMBLY_FUZZERS=\"spvtools_as_fuzzer\"\n\nfor fuzzer in $SPIRV_BINARY_FUZZERS $SPIRV_ASSEMBLY_FUZZERS\ndo\n  cp test/fuzzers/$fuzzer $OUT\ndone\n\npopd\n\nif [ -f do-not-build-corpus ]; then\n  echo \"Stopping before building fuzzing corpus: File $(pwd)/do-not-build-corpus exists\"\n  exit 0\nfi\n\n# An un-instrumented build of spirv-as is used to generate a corpus of SPIR-V binaries.\n[ -d out/standard-build ] || mkdir -p out/standard-build\npushd out/standard-build\n\n# Back-up instrumentation options\nCFLAGS_SAVE=\"$CFLAGS\"\nCXXFLAGS_SAVE=\"$CXXFLAGS\"\nunset CFLAGS\nunset CXXFLAGS\nexport AFL_NOOPT=1\n\ncmake -G Ninja ../.. ${CMAKE_ARGS}\nninja spirv-as\n\n# Restore instrumentation options\nexport CFLAGS=\"${CFLAGS_SAVE}\"\nexport CXXFLAGS=\"${CXXFLAGS_SAVE}\"\nunset AFL_NOOPT\n\npopd\n\nfunction make_empty_dir() {\n  if [ -d \"$@\" ]; then\n    rm -rf \"$@\"/*\n    rm -rf \"$@\"/.*\n  else\n    mkdir -p \"$@\"\n  fi\n}\n\n# Generate a corpus of SPIR-V binaries from the SPIR-V assembly files in the\n# SPIRV-Tools and tint repositories.\nmake_empty_dir dawn\ngit clone https://dawn.googlesource.com/dawn --depth=1\n\nmake_empty_dir $WORK/tint-binary-corpus\npython3 $SCRIPT_DIR/generate_spirv_corpus.py dawn/test/tint $WORK/tint-binary-corpus out/standard-build/tools/spirv-as\nmake_empty_dir $WORK/spirv-binary-corpus-hashed-names\ntint_test_cases=`ls $WORK/tint-binary-corpus/*.spv`\nspirv_tools_test_cases=`find test/fuzzers/corpora -name \"*.spv\"`\nfor f in $tint_test_cases $spirv_tools_test_cases\ndo\n  hashed_name=$(sha1sum \"$f\" | awk '{print $1}')\n  cp $f $WORK/spirv-binary-corpus-hashed-names/$hashed_name\ndone\nzip -j \"$WORK/spirv_binary_seed_corpus.zip\" \"$WORK/spirv-binary-corpus-hashed-names\"/*\n\n# Supply each of the binary fuzzers with this seed corpus.\nfor fuzzer in $SPIRV_BINARY_FUZZERS\ndo\n  cp \"$WORK/spirv_binary_seed_corpus.zip\" \"$OUT/${fuzzer}_seed_corpus.zip\"\ndone\n\n# Generate a corpus of SPIR-V assembly files from the tint repository.\nmake_empty_dir $WORK/spirv-assembly-corpus-hashed-names\nfor f in `find dawn/test/tint -name \"*.spvasm\"`\ndo\n  hashed_name=$(sha1sum \"$f\" | awk '{print $1}')\n  cp $f $WORK/spirv-assembly-corpus-hashed-names/$hashed_name\ndone\n\nzip -j \"$WORK/spirv_assembly_seed_corpus.zip\" \"$WORK/spirv-assembly-corpus-hashed-names\"/*\n\n# Supply each of the assembly fuzzers with this seed corpus.\nfor fuzzer in $SPIRV_ASSEMBLY_FUZZERS\ndo\n  cp \"$WORK/spirv_assembly_seed_corpus.zip\" \"$OUT/${fuzzer}_seed_corpus.zip\"\ndone\n"
  },
  {
    "path": "projects/spirv-tools/generate_spirv_corpus.py",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Collect all .spvasm files under a given directory, assemble them using\n# spirv-as, and emit the assembled binaries to a given corpus directory,\n# flattening their file names by replacing path separators with underscores.\n# If the output directory already exists, it will be deleted and re-created.\n# Files ending with \".expected.spvasm\" are skipped.\n#\n# The intended use of this script is to generate a corpus of SPIR-V\n# binaries for fuzzing.\n#\n# Usage:\n#    generate_spirv_corpus.py <input_dir> <corpus_dir> <path to spirv-as>\n\nimport os\nimport pathlib\nimport shutil\nimport subprocess\nimport sys\n\n\ndef list_spvasm_files(root_search_dir):\n    for root, folders, files in os.walk(root_search_dir):\n        for filename in folders + files:\n            if pathlib.Path(filename).suffix == \".spvasm\":\n                yield os.path.join(root, filename)\n\n\ndef main():\n    if len(sys.argv) != 4:\n        print(\"Usage: \" + sys.argv[0] +\n              \" <input dir> <output dir> <spirv-as path>\")\n        return 1\n    input_dir: str = os.path.abspath(sys.argv[1].rstrip(os.sep))\n    corpus_dir: str = os.path.abspath(sys.argv[2])\n    spirv_as_path: str = os.path.abspath(sys.argv[3])\n    if os.path.exists(corpus_dir):\n        shutil.rmtree(corpus_dir)\n    os.makedirs(corpus_dir)\n\n    # It might be that some of the attempts to convert SPIR-V assembly shaders\n    # into SPIR-V binaries go wrong. It is sensible to tolerate a small number\n    # of such errors, to avoid fuzzer preparation failing due to bugs in\n    # spirv-as. But it is important to know when a large number of failures\n    # occur, in case something is more deeply wrong.\n    num_errors = 0\n    max_tolerated_errors = 10\n    logged_errors = \"\"\n\n    for in_file in list_spvasm_files(input_dir):\n        if \".expected.\" in in_file:\n            continue\n        out_file = os.path.splitext(\n            corpus_dir + os.sep +\n            in_file[len(input_dir) + 1:].replace(os.sep, '_'))[0] + \".spv\"\n        cmd = [\n            spirv_as_path, \"--target-env\", \"spv1.3\", in_file, \"-o\", out_file\n        ]\n        proc = subprocess.Popen(cmd,\n                                stdout=subprocess.PIPE,\n                                stderr=subprocess.PIPE)\n        stdout, stderr = proc.communicate()\n        if proc.returncode != 0:\n            num_errors += 1\n            logged_errors += \"Error running \" + \" \".join(\n                cmd) + \": \" + stdout.decode('utf-8') + stderr.decode('utf-8')\n\n    if num_errors > max_tolerated_errors:\n        print(\"Too many (\" + str(num_errors) +\n              \") errors occurred while generating the SPIR-V corpus.\")\n        print(logged_errors)\n        return 1\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n"
  },
  {
    "path": "projects/spirv-tools/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: https://github.com/KhronosGroup/SPIRV-Tools\nlanguage: c++\nprimary_contact: rharrison@google.com\nauto_ccs:\n  - \"dneto@google.com\"\n  - \"alanbaker@google.com\"\n  - \"stevenperron@google.com\"\n  - \"nathangauer@google.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/KhronosGroup/SPIRV-Tools.git'\narchitectures:\n  - x86_64\n  - i386\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/spirv-tools/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Skip copyrights check\n# Skip shared symbol check since the fuzzing build only build static tools\n# Run unit testing\nctest --test-dir build -j$(nproc) -E \"spirv-tools-copyrights|spirv-tools-symbol-exports-SPIRV-Tools-shared\"\n"
  },
  {
    "path": "projects/spotify-json/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y libboost-dev libboost-test-dev \\\n      libboost-system-dev libboost-chrono-dev\nRUN git clone https://github.com/spotify/spotify-json\n\nWORKDIR $SRC/spotify-json\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/spotify-json/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build spotify-json\nmkdir build\npushd build\ncmake -DSPOTIFY_JSON_BUILD_TESTS=OFF ../\nmake -j$(nproc) spotify-json\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ../fuzzers//fuzz_decode.cpp \\\n    -I../include -I../vendor/double-conversion \\\n    ./libspotify-json.a ./vendor/double-conversion/libdouble-conversion.a  -lpthread -o $OUT/fuzz_decode\npopd\n\n# Build unit testing and benchmark which is incompatible with major build with fuzzing sanitizer\nmkdir build-tests\npushd build-tests\nunset CXXFLAGS\ncmake -DSPOTIFY_JSON_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS='-stdlib=libstdc++' ../\nmake -j$(nproc) spotify_json_test json_benchmark\npopd\n"
  },
  {
    "path": "projects/spotify-json/project.yaml",
    "content": "homepage: \"https://github.com/spotify/spotify-json\"\nmain_repo: 'https://github.com/spotify/spotify-json'\nprimary_contact: \"johanl@spotify.com\"\nlanguage: c++\nauto_ccs:\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/spotify-json/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake test -C $SRC/spotify-json/build-tests -j$(nproc)\n"
  },
  {
    "path": "projects/spring-amqp/.gitignore",
    "content": "project-parent/spring-amqp\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/spring-amqp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/spring-amqp\nRUN apt update && apt install -y openjdk-17-jdk\nRUN git clone --depth 1 https://github.com/spring-projects/spring-amqp/ $SRC/project-parent/spring-amqp\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/spring-amqp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=spring-amqp\nPROJECT_GROUP_ID=org.springframework.amqp\nPROJECT_ARTIFACT_ID=spring-amqp\nMAIN_REPOSITORY=https://github.com/spring-projects/spring-amqp/\n\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  # mv $SRC/{*.zip,*.dict} $OUT\n\n  # set_project_version_in_fuzz_targets_dependency\n\n  export JAVA_HOME=\"$OUT/open-jdk-17\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  pushd $PROJECT\n    export SPRING_AMQP_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n  popd\n\n  #install\n  (cd $PROJECT && ./gradlew publishToMavenLocal -x javadoc -x asciidoctor -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/spring-amqp/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>17</java.version>\n        <maven.compiler.source>17</maven.compiler.source>\n        <maven.compiler.target>17</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.springframework.amqp</groupId>\n            <artifactId>spring-amqp</artifactId>\n            <version>${env.SPRING_AMQP_VERSION}</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/spring-amqp/project-parent/fuzz-targets/src/test/java/com/example/AllowedListDeserializingMessageConverterFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport org.springframework.amqp.core.Message;\nimport org.springframework.amqp.core.MessageProperties;\nimport org.springframework.amqp.core.MessageDeliveryMode;\nimport org.springframework.amqp.support.converter.*;\n\nimport java.util.*;\nimport java.io.Serializable;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\n\n\nclass AllowedListDeserializingMessageConverterFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        int cn = 29;\n        int dummyNum = data.consumeInt(0, 2^cn - 1);\n        DummyClass dummyClass = new DummyClass();\n\n        for (int bit = 0; bit < cn; ++bit) {\n            if (((dummyNum >> bit) & 1) == 1) {\n                switch (bit) {\n                    case 0:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._treeMap.put(data.consumeString(50), data.consumeInt());\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 1:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._arrayList.add(data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 2:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._hashSet.add(data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 3:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._hashMap.put(data.consumeString(50), data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 4:\n                        Integer[] integerArr = new Integer[data.consumeInt(0, 50)];\n                        for (int i = 0; i < integerArr.length; i++) {\n                            integerArr[i] = data.consumeInt();\n                        }\n                        dummyClass._asList = Arrays.asList(integerArr);\n                        break;\n                    case 5:\n                        dummyClass._intArray = data.consumeInts(50);\n                        break;\n                    case 6:\n                        dummyClass._longArray = data.consumeLongs(50);\n                        break;\n                    case 7:\n                        dummyClass._shortArray = data.consumeShorts(50);\n                        break;\n                    case 8:\n                        float[] floatArr = new float[data.consumeInt(0, 50)];\n                        for (int i = 0; i < floatArr.length; i++) {\n                            floatArr[i] = data.consumeFloat();\n                        }\n                        dummyClass._floatArray = floatArr;\n                        break;\n                    case 9:\n                        double[] doubleArr = new double[data.consumeInt(0, 50)];\n                        for (int i = 0; i < doubleArr.length; i++) {\n                            doubleArr[i] = data.consumeDouble();\n                        }\n                        dummyClass._doubleArray = doubleArr;\n                        break;\n                    case 10:\n                        dummyClass._byteArray = data.consumeBytes(50);\n                        break;\n                    case 11:\n                        char[] charArr = new char[data.consumeInt(0, 50)];\n                        for (int i = 0; i < charArr.length; i++) {\n                            charArr[i] = data.consumeChar();\n                        }\n                        dummyClass._charArray = charArr;\n                        break;\n                    case 12:\n                        dummyClass._boolArray = data.consumeBooleans(50);\n                        break;\n                    case 13:\n                        String[] strArr = new String[data.consumeInt(0, 50)];\n                        for (int i = 0; i < strArr.length; i++) {\n                            strArr[i] = data.consumeString(50);\n                        }\n                        dummyClass._stringArray = strArr;\n                        break;\n                    case 14:\n                        BitSet bitSet = BitSet.valueOf(data.consumeLongs(50));\n                        dummyClass._bitSet = bitSet;\n                        break;\n                    case 15:\n                        SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n                        try {\n                            dummyClass._date = dateFormat.parse(data.consumeString(50));\n                        } catch (ParseException e) {\n                        }\n                        break;\n                    case 16:\n                        TimeZone tz = TimeZone.getTimeZone(data.consumeString(50));\n                        dummyClass._timeZone = tz;\n                        break;\n                    case 17:\n                        Calendar calendar = new GregorianCalendar(data.consumeInt(),data.consumeInt(),data.consumeInt());\n                        dummyClass._calendar = calendar;\n                        break;\n                    case 18:\n                        Locale locale = new Locale(data.consumeString(50));\n                        dummyClass._locale = locale;\n                        break;\n                    case 19:\n                        Integer[] integerArr2 = new Integer[data.consumeInt(0, 50)];\n                        for (int i = 0; i < integerArr2.length; i++) {\n                            integerArr2[i] = data.consumeInt();\n                        }\n                        dummyClass._integerArray = integerArr2;\n                        break;\n                    case 20:\n                        dummyClass._boolean = data.consumeBoolean();\n                        break;\n                    case 21:\n                        dummyClass._char = data.consumeChar();\n                        break;\n                    case 22:\n                        dummyClass._byte = data.consumeByte();\n                        break;\n                    case 23:\n                        dummyClass._short = data.consumeShort();\n                        break;\n                    case 24:\n                        dummyClass._int = data.consumeInt();\n                        break;\n                    case 25:\n                        dummyClass._float = data.consumeFloat();\n                        break;\n                    case 26:\n                        dummyClass._long = data.consumeLong();\n                        break;\n                    case 27:\n                        dummyClass._double = data.consumeDouble();\n                        break;\n                    case 28:\n                        dummyClass._string = data.consumeString(50);\n                        break;\n                }\n            }\n        }\n\n        String str = data.consumeString(100);\n        String str1 = data.consumeString(100);\n        String str2 = data.consumeString(100);\n        String str3 = data.consumeString(100);\n        String str4 = data.consumeString(100);\n        String str5 = data.consumeString(100);\n        String str6 = data.consumeString(100);\n        String str7 = data.consumeString(100);\n        String str8 = data.consumeString(100);\n        String str9 = data.consumeString(100);\n        String str10 = data.consumeString(100);\n        String str11 = data.consumeString(100);\n        String str12 = data.consumeString(100);\n        String str13 = data.consumeString(100);\n        String str14 = data.consumeString(100);\n        String str15 = data.consumeString(100);\n        String str16 = data.consumeString(100);\n\n        SerializerMessageConverter converter = new SerializerMessageConverter();\n        converter.setAllowedListPatterns(Collections.singletonList(\"\"));\n\n        MessageProperties messageProperties = new MessageProperties();\n        messageProperties.setDeliveryMode(data.pickValue(MessageDeliveryMode.values()));\n        messageProperties.setHeader(str, str1);\n        messageProperties.setContentType(str2);\n        messageProperties.setAppId(str3);\n        messageProperties.setClusterId(str4);\n        messageProperties.setConsumerQueue(str5);\n        messageProperties.setContentEncoding(str6);\n        messageProperties.setConsumerTag(str7);\n        messageProperties.setCorrelationId(str8);\n        messageProperties.setExpiration(str9);\n        messageProperties.setMessageId(str10);\n        messageProperties.setReceivedExchange(str11);\n        messageProperties.setReceivedRoutingKey(str12);\n        messageProperties.setReceivedUserId(str13);\n        messageProperties.setReplyTo(str14);\n        messageProperties.setType(str15);\n        messageProperties.setUserId(str16);\n\n        Message message = converter.toMessage(dummyClass, messageProperties);\n\n        Object fromMessage = null;\n        try {\n            fromMessage = converter.fromMessage(message);\n\n        } catch (SecurityException e) {\n            return;\n        }\n\n        assert fromMessage.equals(dummyClass) : new FuzzerSecurityIssueLow(\"Deseralized object is not the same as the original object!\");\n        throw new FuzzerSecurityIssueLow(\"Bypass allowed list!\");\n    }\n\n    public static class DummyClass implements Serializable {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList;\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public boolean[] _boolArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n        public Long _long;\n        public Double _double;\n        public String _string;\n    }\n}"
  },
  {
    "path": "projects/spring-amqp/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n<!--    <module>spring-amqp</module>-->\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/spring-amqp/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/spring-projects/spring-amqp.git\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-amqp.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-boot/BasicJsonParserFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.boot.json.BasicJsonParser;\nimport org.springframework.boot.json.JsonParseException;\n\npublic class BasicJsonParserFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String content = data.consumeRemainingAsString();\n        BasicJsonParser parser = new BasicJsonParser();\n        try { \n            parser.parseList(content);\n            parser.parseMap(content);\n        } catch (JsonParseException e) { }\n    } \n}"
  },
  {
    "path": "projects/spring-boot/ConfigurationMetadataRepositoryJsonBuilderFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport org.springframework.boot.configurationmetadata.ConfigurationMetadataRepositoryJsonBuilder;\nimport java.io.ByteArrayInputStream;\n\npublic class ConfigurationMetadataRepositoryJsonBuilderFuzzer {\n    \n    public static void fuzzerTestOneInput(byte[] data) {\n        \n        try { \n            ConfigurationMetadataRepositoryJsonBuilder.create(new ByteArrayInputStream(data));\n        } catch (Exception e) { }\n    } \n}\n"
  },
  {
    "path": "projects/spring-boot/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/json.dict $SRC/BasicJsonParserFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/BasicJsonParserFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-boot\nRUN git clone --depth 1 https://github.com/spring-projects/spring-framework spring-boot/spring-framework\n\nCOPY . $SRC/\n\nRUN cd spring-boot && (for i in ${SRC}/add-shadow*.diff; do tr -d '\\015' < $i | git apply; done )\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-boot\n"
  },
  {
    "path": "projects/spring-boot/JsonMarshallerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata;\nimport org.springframework.boot.configurationprocessor.metadata.ItemHint;\nimport org.springframework.boot.configurationprocessor.metadata.ItemMetadata;\nimport org.springframework.boot.configurationprocessor.metadata.JsonMarshaller;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.util.Arrays;\nimport java.util.Collections;\n\npublic class JsonMarshallerFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tConfigurationMetadata metadata = new ConfigurationMetadata();\n\t\tfor (int i = 0; i < data.consumeInt(1, 50); i++) {\n\t\t\tswitch (data.consumeInt(0, 3)) {\n\t\t\t\tcase 0:\n\t\t\t\t\tmetadata.add(ItemMetadata.newProperty(\n\t\t\t\t\t\t\tdata.consumeString(50),\n\t\t\t\t\t\t\tdata.consumeString(50),\n\t\t\t\t\t\t\tdata.consumeString(50),\n\t\t\t\t\t\t\tdata.consumeString(10),\n\t\t\t\t\t\t\tdata.consumeString(10),\n\t\t\t\t\t\t\tdata.consumeString(10),\n\t\t\t\t\t\t\tnew String[] { data.consumeString(50), data.consumeString(50) },\n\t\t\t\t\t\t\tnull\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tmetadata.add(ItemMetadata.newGroup(\n\t\t\t\t\t\t\tdata.consumeString(50),\n\t\t\t\t\t\t\tdata.consumeString(50),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnull\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tmetadata.add(ItemHint.newHint(data.consumeString(50)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tmetadata.add(new ItemHint(\n\t\t\t\t\t\t\tdata.consumeString(50),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tArrays.asList(new ItemHint.ValueProvider(\n\t\t\t\t\t\t\t\t\tdata.consumeString(50),\n\t\t\t\t\t\t\t\t\tCollections.singletonMap(data.consumeString(50),\n\t\t\t\t\t\t\t\t\tdata.consumeString(50))\n\t\t\t\t\t\t\t), new ItemHint.ValueProvider(data.consumeString(50), null))\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\t\tJsonMarshaller marshaller = new JsonMarshaller();\n\t\ttry {\n\t\t\tmarshaller.write(metadata, outputStream);\n\t\t\toutputStream.toString();\n\t\t\tmarshaller.read(new ByteArrayInputStream(outputStream.toByteArray()));\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/spring-boot/TokenFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.boot.actuate.autoconfigure.cloudfoundry.*;\n\npublic class TokenFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String content = data.consumeRemainingAsString();\n        try {\n            Token t = new Token(content);\n        } catch (CloudFoundryAuthorizationException e) { }\n    }\n}\n"
  },
  {
    "path": "projects/spring-boot/add-shadow-spring-boot-configuration-metadata.diff",
    "content": "diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build.gradle\nindex 7b8fbb1..a3027b4 100644\n--- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build.gradle\n+++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build.gradle\n@@ -2,10 +2,13 @@ plugins {\n \tid \"java-library\"\n \tid \"org.springframework.boot.conventions\"\n \tid \"org.springframework.boot.deployed\"\n+\tid \"com.github.johnrengelman.shadow\" version \"7.1.2\"\n }\n \n description = \"Spring Boot Configuration Metadata\"\n \n+apply plugin: \"com.github.johnrengelman.shadow\"\n+\n dependencies {\n \timplementation(\"com.vaadin.external.google:android-json\")\n \n"
  },
  {
    "path": "projects/spring-boot/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nCURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n\n# build spring-boot\n./gradlew build -x test -x intTest -i -x asciidoctor -x javadoc -x asciidoctorPdf -x :spring-boot-project:spring-boot-docs:zip -x :spring-boot-project:spring-boot-docs:publishMavenPublicationToMavenLocal -x :checkstyleNohttp -x :spring-boot-project:spring-boot-docs:publishMavenPublicationToProjectRepository\n\n./gradlew shadowJar -p spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/\n\n# build actuator autoconfigure\n./gradlew clean build -x test -i -x asciidoctor -x javadoc -x asciidoctorPdf -x :spring-boot-project:spring-boot-docs:zip -x :spring-boot-project:spring-boot-docs:publishMavenPublicationToMavenLocal -x :checkstyleNohttp -x :spring-boot-project:spring-boot-docs:publishMavenPublicationToProjectRepository -p spring-boot-project/spring-boot-actuator-autoconfigure/\ncp \"spring-boot-project/spring-boot/build/libs/spring-boot-$CURRENT_VERSION.jar\" \"$OUT/spring-boot.jar\"\ncp \"spring-boot-project/spring-boot-tools/spring-boot-loader/build/libs/spring-boot-loader-$CURRENT_VERSION.jar\" \"$OUT/spring-boot-loader.jar\"\ncp \"spring-boot-project/spring-boot-starters/spring-boot-starter-web/build/libs/spring-boot-starter-web-$CURRENT_VERSION.jar\" \"$OUT/spring-boot-starter-web.jar\"\ncp \"spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build/libs/spring-boot-configuration-processor-$CURRENT_VERSION.jar\" \"$OUT/spring-boot-configure-processor.jar\"\nfind $SRC/spring-boot/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build/libs/ -name \"spring-boot-configuration-metadata*-all.jar\" -exec cp {} $OUT/spring-boot-configuration-metadata.jar \\;\ncp \"spring-boot-project/spring-boot-actuator-autoconfigure/build/libs/spring-boot-actuator-autoconfigure-$CURRENT_VERSION.jar\" \"$OUT/spring-boot-actuator-autoconfigure.jar\"\ncp \"spring-boot-project/spring-boot-autoconfigure/build/libs/spring-boot-autoconfigure-$CURRENT_VERSION.jar\" \"$OUT/spring-boot-autoconfigure.jar\"\n\n# Spring core\nCURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain --build-file=spring-framework/build.gradle | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n./gradlew build --build-file=spring-framework/spring-core/spring-core.gradle -x test -x javadoc -x :checkstyleNohttp\ncp \"spring-framework/spring-core/build/libs/spring-core-$CURRENT_VERSION.jar\" \"$OUT/spring-core.jar\"\n\n./gradlew build --build-file=spring-framework/spring-web/spring-web.gradle -x test -x javadoc\ncp \"spring-framework/spring-web/build/libs/spring-web-$CURRENT_VERSION.jar\" \"$OUT/spring-web.jar\"\n\nALL_JARS=\"spring-boot.jar spring-boot-loader.jar spring-core.jar spring-web.jar spring-boot-starter-web.jar spring-boot-configure-processor.jar spring-boot-configuration-metadata.jar spring-boot-autoconfigure.jar spring-boot-actuator-autoconfigure.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-boot/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-boot\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-boot.git\"\nprimary_contact: \"pwebb@vmware.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-cloud-commons/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/pem.dict $SRC/EncryptionIntegrationFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/spring-cloud/spring-cloud-commons\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-cloud-commons\n"
  },
  {
    "path": "projects/spring-cloud-commons/EncryptionIntegrationFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.cloud.context.encrypt.EncryptorFactory;\nimport org.springframework.security.crypto.encrypt.TextEncryptor;\nimport java.nio.charset.Charset;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport java.math.BigInteger;\nimport org.springframework.security.crypto.encrypt.Encryptors;\nimport org.springframework.cloud.context.encrypt.KeyFormatException;\n\npublic class EncryptionIntegrationFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String keyStr = data.consumeString(100);\n        String salt = data.consumeString(50);\n        if (keyStr.isEmpty() || salt.isEmpty()) {\n            return;\n        }\n\n        String content = data.consumeRemainingAsString();\n\n        TextEncryptor encryptor;\n\t\ttry {\n            encryptor = new EncryptorFactory(salt).create(keyStr);\n        } catch (KeyFormatException | IllegalArgumentException e) {\n            return;\n        }\n\n        String encrypted = encryptor.encrypt(content);\n        String decrypted = encryptor.decrypt(encrypted);\n\n\t\tif (!decrypted.equals(content)) {\n            throw new FuzzerSecurityIssueHigh(\"Different result when encrypting & decrypting: \" + decrypted + \" != \" + content);\n        }\n\t}\n}"
  },
  {
    "path": "projects/spring-cloud-commons/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/*.dict $OUT\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\ncat > patch.diff <<- EOM\ndiff --git a/pom.xml b/pom.xml\nindex 831f5a1..855a43e 100644\n--- a/pom.xml\n+++ b/pom.xml\n@@ -61,10 +74,6 @@\n \t\t\t\t<groupId>io.spring.javaformat</groupId>\n \t\t\t\t<artifactId>spring-javaformat-maven-plugin</artifactId>\n \t\t\t</plugin>\n-\t\t\t<plugin>\n-\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n-\t\t\t\t<artifactId>maven-checkstyle-plugin</artifactId>\n-\t\t\t</plugin>\n \t\t\t<plugin>\n \t\t\t\t<groupId>org.basepom.maven</groupId>\n \t\t\t\t<artifactId>duplicate-finder-maven-plugin</artifactId>\n@@ -74,10 +83,6 @@\n\n \t<reporting>\n \t\t<plugins>\n-\t\t\t<plugin>\n-\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n-\t\t\t\t<artifactId>maven-checkstyle-plugin</artifactId>\n-\t\t\t</plugin>\n \t\t</plugins>\n \t</reporting>\n\n\nEOM\n\ngit apply patch.diff -v\n\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests -Dcheckstyle.skip=true\"\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\n$MVN clean package $MAVEN_ARGS\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\ncp \"spring-cloud-commons/target/spring-cloud-commons-$CURRENT_VERSION.jar\" \"$OUT/spring-cloud-commons.jar\"\ncp \"spring-cloud-context/target/spring-cloud-context-$CURRENT_VERSION.jar\" \"$OUT/spring-cloud-context.jar\"\ncp \"spring-cloud-starter-bootstrap/target/spring-cloud-starter-bootstrap-$CURRENT_VERSION.jar\" \"$OUT/spring-cloud-starter-bootstrap.jar\"\n\nALL_JARS=\"spring-cloud-commons.jar spring-cloud-context.jar spring-cloud-starter-bootstrap.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_excludes=org.springframework.security.**:org.bouncycastle.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-cloud-commons/project.yaml",
    "content": "homepage: \"https://github.com/spring-cloud/spring-cloud-commons\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-cloud/spring-cloud-commons.git\"\nprimary_contact: \"pwebb@vmware.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-cloud-config/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven-3.6.3 && \\\nrm -rf maven.zip\n\nRUN curl -L https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.7%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.7_7.tar.gz -o jdk.tar.gz && \\\ntar xvf jdk.tar.gz && \\\nrm -rf jdk.tar.gz\n\nENV MVN $SRC/maven-3.6.3/apache-maven-3.6.3/bin/mvn\n\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/spring-cloud/spring-cloud-config.git\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/spring-cloud-config"
  },
  {
    "path": "projects/spring-cloud-config/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp -r $SRC/jdk-17.0.7+7 $OUT/jdk\nexport JAVA_HOME=\"$OUT/jdk\"\n\nMVN_FLAGS=\"-Dmaven.compiler.source=17 -Dmaven.compiler.target=17 -DskipTests\"\nALL_JARS=\"\"\nLIBRARY_NAME=\"spring-cloud-config\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \".\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-image/test_all.py. DO NOT REMOVE\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nJAVA_HOME=\\$this_dir/jdk \\\nLD_LIBRARY_PATH=\\\"\\$JAVA_HOME/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/spring-cloud-config/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>spring-cloud-config-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>17</maven.compiler.source>\n\t\t<maven.compiler.target>17</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>4.0.0-SNAPSHOT</fuzzedLibaryVersion>\n\t\t<exec.mainClass>EnvironmentFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t<repositories>\n\t\t<repository>\n\t\t\t<id>spring-snapshots</id>\n\t\t\t<name>Spring Snapshots</name>\n\t\t\t<url>https://repo.spring.io/libs-snapshot-local</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>true</enabled>\n\t\t\t</snapshots>\n\t\t\t<releases>\n\t\t\t\t<enabled>false</enabled>\n\t\t\t</releases>\n\t\t</repository>\n\t\t<repository>\n\t\t\t<id>spring-milestones</id>\n\t\t\t<name>Spring Milestones</name>\n\t\t\t<url>https://repo.spring.io/libs-milestone-local</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>false</enabled>\n\t\t\t</snapshots>\n\t\t</repository>\n\t\t<repository>\n\t\t\t<id>spring-releases</id>\n\t\t\t<name>Spring Releases</name>\n\t\t\t<url>https://repo.spring.io/release</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>false</enabled>\n\t\t\t</snapshots>\n\t\t</repository>\n\t</repositories>\n\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.springframework.cloud</groupId>\n\t\t\t<artifactId>spring-cloud-starter-config</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.springframework.cloud</groupId>\n\t\t\t<artifactId>spring-cloud-config-server</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/spring-cloud-config/project.yaml",
    "content": "homepage: \"https://docs.spring.io/spring-cloud-config/docs/current/reference/html/\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-cloud/spring-cloud-config.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-cloud-config/src/main/java/ossfuzz/ConfigServerPropertiesFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.cloud.config.server.config.ConfigServerProperties;\nimport java.util.HashMap;\n\npublic class ConfigServerPropertiesFuzzer {\n\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic ConfigServerPropertiesFuzzer(FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\n\t}\n\n\tvoid test() {\n\t\tConfigServerProperties config = new org.springframework.cloud.config.server.config.ConfigServerProperties();\n\n\t\tconfig.setPrefix(fuzzedDataProvider.consumeString(16));\n\t\tconfig.setDefaultLabel(fuzzedDataProvider.consumeString(16));\n\t\tconfig.setBootstrap(fuzzedDataProvider.consumeBoolean());\n\n\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\tint n = fuzzedDataProvider.consumeInt(0, 100);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tmap.put(fuzzedDataProvider.consumeString(16), fuzzedDataProvider.consumeString(16));\n\t\t}\n\n\t\tconfig.setOverrides(map);\n\t\tconfig.isBootstrap();\n\t\tconfig.getOverrides();\n\t\tconfig.getPrefix();\n\t\tconfig.getDefaultLabel();\n\t\tconfig.toString();\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tConfigServerPropertiesFuzzer loggingInterceptorFuzzer = new ConfigServerPropertiesFuzzer(fuzzedDataProvider);\n\t\tloggingInterceptorFuzzer.test();\n\t}\n}"
  },
  {
    "path": "projects/spring-cloud-config/src/main/java/ossfuzz/EnvironmentFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.cloud.config.environment.Environment;\nimport org.springframework.cloud.config.environment.PropertySource;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class EnvironmentFuzzer {\n\t\n\tprivate FuzzedDataProvider fuzzedDataProvider;\n\n\tpublic EnvironmentFuzzer( FuzzedDataProvider fuzzedDataProvider) {\n\t\tthis.fuzzedDataProvider = fuzzedDataProvider;\n\n\t}\n\t\n\tvoid test()\n\t{\n\t\tString[] fuzzedArray = {\n\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\tfuzzedDataProvider.consumeString(10)\n\t\t};\n\t\tEnvironment environment = new Environment(\n\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\tfuzzedArray,\n\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\tfuzzedDataProvider.consumeString(10),\n\t\t\tfuzzedDataProvider.consumeString(10)\n\t\t);\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tint n = fuzzedDataProvider.consumeInt(0, 10);\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tmap.put(fuzzedDataProvider.consumeInt(), fuzzedDataProvider.consumeInt());\n\t\t}\n\t\tPropertySource propertySource = new PropertySource(fuzzedDataProvider.consumeString(10), map);\n\t\tList<PropertySource> lPropertySources = new ArrayList<PropertySource>();\n\t\tlPropertySources.add(propertySource);\n\n\t\tenvironment.add(propertySource);\n\t\tenvironment.addFirst(propertySource);\n\t\tenvironment.addAll(lPropertySources);\n\n\t\tenvironment.getName();\n\t\tenvironment.getLabel();\n\t\tenvironment.getProfiles();\n\t\tenvironment.getPropertySources();\n\t\tenvironment.getState();\n\t\tenvironment.getVersion();\n\t\tenvironment.setLabel(fuzzedDataProvider.consumeString(10));\n\t\tenvironment.setName(fuzzedDataProvider.consumeString(10));\n\t\tenvironment.setState(fuzzedDataProvider.consumeString(10));\n\t\tenvironment.setVersion(fuzzedDataProvider.consumeString(10));\n\t\tenvironment.setProfiles(new String[]{fuzzedDataProvider.consumeString(10), fuzzedDataProvider.consumeString(10)});\n\t\tenvironment.toString();\n\t\t\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n\n\t\tEnvironmentFuzzer loggingInterceptorFuzzer = new EnvironmentFuzzer(fuzzedDataProvider);\n\t\tloggingInterceptorFuzzer.test();\n\t}\n}"
  },
  {
    "path": "projects/spring-cloud-netflix/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nRUN curl -L https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.7%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.7_7.tar.gz -o jdk.tar.gz && \\\ntar xvf jdk.tar.gz && \\\nrm -rf jdk.tar.gz\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone https://github.com/spring-cloud/spring-cloud-netflix.git\nRUN cd spring-cloud-netflix && git checkout 5ec430efb\n\nADD pom.xml build.sh ${SRC}/\nADD src/ ${SRC}/src/\nWORKDIR ${SRC}/spring-cloud-netflix"
  },
  {
    "path": "projects/spring-cloud-netflix/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncp -r $SRC/jdk-17.0.7+7 $OUT/jdk\nexport JAVA_HOME=\"$OUT/jdk\"\n\nMVN_FLAGS=\"-Dmaven.compiler.source=17 -Dmaven.compiler.target=17 -DskipTests\"\nALL_JARS=\"\"\nLIBRARY_NAME=\"spring-cloud-netflix\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.12.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \".\"\n\t${MVN} package ${MVN_FLAGS}\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n  -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-image/test_all.py. DO NOT REMOVE\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nJAVA_HOME=\\$this_dir/jdk \\\nLD_LIBRARY_PATH=\\\"\\$JAVA_HOME/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/spring-cloud-netflix/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>spring-cloud-netflix-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>17</maven.compiler.source>\n\t\t<maven.compiler.target>17</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>4.0.0-SNAPSHOT</fuzzedLibaryVersion>\n\t\t<exec.mainClass>org.springframework.cloud.netflix.eureka.config.HostnameBasedUrlRandomizerFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t<repositories>\n\t\t<repository>\n\t\t\t<id>spring-snapshots</id>\n\t\t\t<name>Spring Snapshots</name>\n\t\t\t<url>https://repo.spring.io/libs-snapshot-local</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>true</enabled>\n\t\t\t</snapshots>\n\t\t\t<releases>\n\t\t\t\t<enabled>false</enabled>\n\t\t\t</releases>\n\t\t</repository>\n\t\t<repository>\n\t\t\t<id>spring-milestones</id>\n\t\t\t<name>Spring Milestones</name>\n\t\t\t<url>https://repo.spring.io/libs-milestone-local</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>false</enabled>\n\t\t\t</snapshots>\n\t\t</repository>\n\t\t<repository>\n\t\t\t<id>spring-releases</id>\n\t\t\t<name>Spring Releases</name>\n\t\t\t<url>https://repo.spring.io/release</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>false</enabled>\n\t\t\t</snapshots>\n\t\t</repository>\n\t\t<!-- FIXME: 4.0 -->\n\t\t<repository>\n\t\t\t<id>netflix-snapshots</id>\n\t\t\t<name>Netflix Snapshots</name>\n\t\t\t<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-snapshots</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>true</enabled>\n\t\t\t</snapshots>\n\t\t</repository>\n\t\t<repository>\n\t\t\t<id>netflix-candidates</id>\n\t\t\t<name>Netflix Candidates</name>\n\t\t\t<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>\n\t\t\t<snapshots>\n\t\t\t\t<enabled>false</enabled>\n\t\t\t</snapshots>\n\t\t</repository>\n\t</repositories>\n\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.12.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.12.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.springframework.cloud</groupId>\n\t\t\t<artifactId>spring-cloud-netflix-eureka-client</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.springframework.cloud</groupId>\n\t\t\t<artifactId>spring-cloud-netflix-eureka-server</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.springframework.cloud</groupId>\n\t\t\t<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.springframework.cloud</groupId>\n\t\t\t<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\n\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/spring-cloud-netflix/project.yaml",
    "content": "homepage: \"https://cloud.spring.io/spring-cloud-netflix/reference/html/\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-cloud/spring-cloud-netflix.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-cloud-netflix/src/main/java/org/springframework/cloud/netflix/eureka/config/HostnameBasedUrlRandomizerFuzzer.java",
    "content": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n *\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.springframework.cloud.netflix.eureka.config;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.springframework.cloud.netflix.eureka.config.HostnameBasedUrlRandomizer;\npublic class HostnameBasedUrlRandomizerFuzzer {\n\n    FuzzedDataProvider dataProvider;\n\n    public HostnameBasedUrlRandomizerFuzzer(FuzzedDataProvider dataProvider) {\n        this.dataProvider = dataProvider;\n    }\n\n    public String getString() {\n        return dataProvider.consumeString(16);\n    }\n\n    public ArrayList<String> getStringArrayList() {\n        ArrayList<String> list = new ArrayList<String>();\n        int n = dataProvider.consumeInt(0, 10);\n        for (int i = 0; i < n; ++i) {\n            list.add(getString());\n        }\n        return list;\n    }\n\n    void test() {\n        HostnameBasedUrlRandomizer randomizer = new HostnameBasedUrlRandomizer(getString());\n        randomizer.randomize(getStringArrayList());\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider dataProvider) {\n        HostnameBasedUrlRandomizerFuzzer closure = new HostnameBasedUrlRandomizerFuzzer(dataProvider);\n        closure.test();\n    }\n}"
  },
  {
    "path": "projects/spring-cloud-sleuth-brave/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\n\nRUN git clone --depth 1 https://github.com/spring-cloud/spring-cloud-sleuth.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-cloud-sleuth"
  },
  {
    "path": "projects/spring-cloud-sleuth-brave/W3CPropagationFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\npackage org.springframework.cloud.sleuth.brave.bridge;\n\nimport java.lang.reflect.*;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic class W3CPropagationFuzzer {\n    static Method extractContextFromTraceParent_Method;\n\n    public static void fuzzerInitialize() {\n        // expose a private method \"extractContextFromTraceParent\" of the class W3CPropagation                                                                                                                                              \n        try {\n            extractContextFromTraceParent_Method = W3CPropagation.class.getDeclaredMethod(\"extractContextFromTraceParent\", String.class);\n            extractContextFromTraceParent_Method.setAccessible(true);\n        } catch (NoSuchMethodException e) {\n        } catch (ExceptionInInitializerError e) {}\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String content = data.consumeRemainingAsString();\n        try {\n            extractContextFromTraceParent_Method.invoke(W3CPropagation.class, content);\n        } catch (IllegalAccessException e) {\n        } catch (InvocationTargetException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/spring-cloud-sleuth-brave/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nMVNW=./mvnw\n\nsed -i \"s/<java.version>1.6<\\/java.version>/<java.version>1.7<\\/java.version>/g\" pom.xml\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nJVM_LD_LIBRARY_PATH=\"${JAVA_HOME}/lib/server\"\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Dmaven.repo.local=$WORK/m2\"\n\n# comment out logging from W3CPropagation.java\nsed -i \"s|logger\\.info|\\/\\/logger\\.info|g\" spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/bridge/W3CPropagation.java\n\n# Build the target jar.\n${MVNW} clean package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\n\n# Is this some old maven version that used to be more verbose? It prints too much, but we only need the last line of the output containing the version\nCURRENT_VERSION=$(${MVNW} -Dexec.executable=\"echo\" -Dexec.args='${project.version}' --non-recursive exec:exec  -q -DforceStdout | tail -1)\n\ncp \"spring-cloud-sleuth-brave/target/spring-cloud-sleuth-brave-$CURRENT_VERSION.jar\" $OUT/spring-sleuth-brave.jar\n\n# The jar files containing the project (separated by spaces).\nPROJECT_JARS=spring-sleuth-brave.jar\n\n# Get the fuzzer dependencies (gson).\n${MVNW} dependency:copy -Dartifact=com.google.code.gson:gson:2.8.6 -DoutputDirectory=$OUT/\n\n# The jar files containing further dependencies of the fuzz targets (separated\n# by spaces).\nFUZZER_JARS=gson-2.8.6.jar\nALL_JARS=\"$PROJECT_JARS $FUZZER_JARS\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\nmkdir -p $OUT/org/springframework/cloud/sleuth/brave/bridge\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH --release 15 $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/org/springframework/cloud/sleuth/brave/bridge/\n\n  # Create execution wrapper.\n  echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH  \\\n--target_class=org.springframework.cloud.sleuth.brave.bridge.$fuzzer_basename \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-cloud-sleuth-brave/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://spring.io/projects/spring-cloud-sleuth\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-cloud/spring-cloud-sleuth\"\nprimary_contact: \"\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-cloud-stream/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-cloud/spring-cloud-stream\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-cloud-stream"
  },
  {
    "path": "projects/spring-cloud-stream/RabbitExchangeQueueProvisionerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.rabbitmq.client.BlockedListener;\nimport com.rabbitmq.client.Channel;\nimport org.mockito.Mockito;\nimport org.springframework.amqp.AmqpException;\nimport org.springframework.amqp.rabbit.connection.Connection;\nimport org.springframework.amqp.rabbit.connection.ConnectionFactory;\nimport org.springframework.amqp.rabbit.connection.ConnectionListener;\nimport org.springframework.cloud.stream.binder.ExtendedProducerProperties;\nimport org.springframework.cloud.stream.binder.rabbit.properties.RabbitProducerProperties;\nimport org.springframework.cloud.stream.binder.rabbit.provisioning.RabbitExchangeQueueProvisioner;\n\npublic class RabbitExchangeQueueProvisionerFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tChannel channel = Mockito.mock(Channel.class);\n\t\tMockito.when(channel.getChannelNumber()).thenReturn(data.consumeInt());\n\n\t\tConnection connection = Mockito.mock(DummyConnection.class);\n\t\tMockito.when(connection.createChannel(Mockito.anyBoolean())).thenReturn(channel);\n\t\tMockito.when(connection.isOpen()).thenReturn(true);\n\n\t\tDummyConnectionFactory connectionFactory = Mockito.mock(DummyConnectionFactory.class);\n\t\tMockito.when(connectionFactory.getPort()).thenReturn(data.consumeInt());\n\t\tMockito.when(connectionFactory.getHost()).thenReturn(data.consumeString(50));\n\t\tMockito.when(connectionFactory.getVirtualHost()).thenReturn(data.consumeString(50));\n\t\tMockito.when(connectionFactory.getUsername()).thenReturn(data.consumeString(50));\n\t\tMockito.when(connectionFactory.getPort()).thenReturn(data.consumeInt());\n\t\tMockito.when(connectionFactory.createConnection()).thenReturn(connection);\n\n\t\tRabbitExchangeQueueProvisioner provisioner = new RabbitExchangeQueueProvisioner(connectionFactory);\n\t\tif (data.consumeBoolean()) {\n\t\t\tRabbitProducerProperties rabbitProducerProperties = new RabbitProducerProperties();\n\t\t\trabbitProducerProperties.setCompress(data.consumeBoolean());\n\t\t\trabbitProducerProperties.setHeaderPatterns(new String[]{data.consumeString(100)});\n\t\t\trabbitProducerProperties.setBatchingEnabled(data.consumeBoolean());\n\t\t\trabbitProducerProperties.setRoutingKey(data.consumeString(100));\n\t\t\trabbitProducerProperties.setConfirmAckChannel(data.consumeString(100));\n\t\t\trabbitProducerProperties.setUseConfirmHeader(data.consumeBoolean());\n\t\t\trabbitProducerProperties.setStreamMessageConverterBeanName(data.consumeString(100));\n\t\t\trabbitProducerProperties.setSuperStream(data.consumeBoolean());\n\t\t\trabbitProducerProperties.setBatchingStrategyBeanName(data.consumeString(100));\n\n\t\t\tExtendedProducerProperties<RabbitProducerProperties> properties = new ExtendedProducerProperties<RabbitProducerProperties>(rabbitProducerProperties);\n\t\t\tprovisioner.provisionProducerDestination(data.consumeString(500), properties);\n\t\t}\n\t}\n\n\tpublic class DummyConnection implements Connection {\n\n\t\t@Override\n\t\tpublic Channel createChannel(boolean b) throws AmqpException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void close() throws AmqpException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isOpen() {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic int getLocalPort() {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic void addBlockedListener(BlockedListener blockedListener) {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean removeBlockedListener(BlockedListener blockedListener) {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic com.rabbitmq.client.Connection getDelegate() {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class DummyConnectionFactory implements ConnectionFactory {\n\n\t\t@Override\n\t\tpublic Connection createConnection() throws AmqpException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic String getHost() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic int getPort() {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic String getVirtualHost() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic String getUsername() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void addConnectionListener(ConnectionListener connectionListener) {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean removeConnectionListener(ConnectionListener connectionListener) {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic void clearConnectionListeners() {\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/spring-cloud-stream/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\n# Remove all logging to console\ntouch empty-logback.xml\nfind . -name logback.xml -exec cp empty-logback.xml \"{}\" \\;\n\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests -Dcheckstyle.skip=true\"\nCURRENT_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout | tail -n1)\n\n./mvnw package $MAVEN_ARGS\n./mvnw package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS -f binders/rabbit-binder/spring-cloud-stream-binder-rabbit/pom.xml\ncp \"binders/rabbit-binder/spring-cloud-stream-binder-rabbit/target/spring-cloud-stream-binder-rabbit-$CURRENT_VERSION.jar\" \"$OUT/spring-cloud-stream-binder-rabbit.jar\"\ncp \"core/spring-cloud-stream/target/spring-cloud-stream-$CURRENT_VERSION.jar\" \"$OUT/spring-cloud-stream.jar\"\n\n# Mockito dependencies\nwget https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.12.17/byte-buddy-1.12.17.jar -O \"$OUT/byte-buddy.jar\"\nwget https://repo1.maven.org/maven2/org/objenesis/objenesis/3.3/objenesis-3.3.jar -O \"$OUT/objenesis.jar\"\nwget https://repo1.maven.org/maven2/org/mockito/mockito-core/4.7.0/mockito-core-4.7.0.jar -O \"$OUT/mockito.jar\"\nwget https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.12.17/byte-buddy-agent-1.12.17.jar -O \"$OUT/byte-buddy-agent.jar\"\n\nALL_JARS=\"spring-cloud-stream-binder-rabbit.jar spring-cloud-stream.jar mockito.jar byte-buddy.jar byte-buddy-agent.jar objenesis.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nJAVA_OPTS=\\\"-Dlogging.level.root=WARN -javaagent:\\$this_dir/byte-buddy-agent.jar\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_includes=org.springframework.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/spring-cloud-stream/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-data-mongodb\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-data-mongodb.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-data-jpa/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.0/bin/mvn\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-data-jpa.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-data-jpa\n"
  },
  {
    "path": "projects/spring-data-jpa/QueryUtilsFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.List;\nimport java.util.Vector;\nimport java.lang.IllegalArgumentException;\nimport org.springframework.data.domain.Sort;\nimport org.springframework.data.domain.Sort.Order;\nimport org.springframework.data.jpa.repository.query.QueryUtils;\n\n\npublic class QueryUtilsFuzzer {\n    public static Sort.Direction da [] = {Sort.Direction.ASC, Sort.Direction.DESC};\n    public static Sort.NullHandling na [] = {Sort.NullHandling.NATIVE, Sort.NullHandling.NULLS_FIRST, Sort.NullHandling.NULLS_LAST};\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int num = data.consumeInt(0, 200);\n        String str = null;\n        String str1 = null;\n        String str2 = null;\n\n        try {\n            List<Order> orders = new Vector<Order>();\n\n            for (int i = 0; i < num; ++i) {\n                str = data.consumeString(1000);\n                Order o = new Order(data.pickValue(da), str, data.pickValue(na));\n                orders.add(o);\n            }\n\n            Sort sort = Sort.by(orders);\n            str1 = data.consumeString(1000);\n            str2 = data.consumeRemainingAsString();\n            QueryUtils.applySorting(str1, sort, str2);\n        } catch (IllegalArgumentException | org.springframework.dao.InvalidDataAccessApiUsageException e) {\n        }\n\n    }\n\n}"
  },
  {
    "path": "projects/spring-data-jpa/build.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nexport MAVEN_OPTS=\"-Xmx1G\"\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=17 -Djavac.target.version=17\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.3.0:shade $MAVEN_ARGS\nSPRING_DATA_JPA_VERSION=$($MVN help:evaluate -Dexpression=project.version -q -DforceStdout)\ncp $SRC/spring-data-jpa/spring-data-jpa/target/spring-data-jpa-$SPRING_DATA_JPA_VERSION.jar $OUT/spring-data-jpa.jar\n\nALL_JARS=\"spring-data-jpa.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/[$fuzzer_basename]*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-data-jpa/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-data-jpa.git\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-data-jpa.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-data-keyvalue/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.1/bin/mvn\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-data-keyvalue.git spring-data-keyvalue\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/spring-data-keyvalue\n"
  },
  {
    "path": "projects/spring-data-keyvalue/KeyValueTemplateFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport lombok.Data;\nimport lombok.AllArgsConstructor;\nimport org.springframework.data.keyvalue.core.KeyValueTemplate;\nimport org.springframework.data.keyvalue.annotation.KeySpace;\nimport org.springframework.data.keyvalue.core.query.KeyValueQuery;\nimport org.springframework.data.map.MapKeyValueAdapter;\nimport org.springframework.data.annotation.Id;\nimport org.springframework.core.annotation.AliasFor;\nimport org.springframework.data.annotation.Persistent;\nimport java.io.Serializable;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\nimport java.util.List;\nimport org.springframework.dao.DuplicateKeyException;\n\nimport org.springframework.dao.DataRetrievalFailureException;\nimport org.springframework.expression.spel.SpelParseException;\nimport org.springframework.expression.spel.SpelEvaluationException;\nimport org.springframework.data.mapping.MappingException;\nimport org.springframework.data.keyvalue.core.UncategorizedKeyValueException;\n\n\npublic class KeyValueTemplateFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    String foo_id = data.consumeString(1000);\n    String bar_id = data.consumeString(1000);\n    String aliased_id = data.consumeString(1000);\n    String subclass_id = data.consumeString(1000);\n    String foo_input = data.consumeString(1000);    \n    Foo foo = new Foo(foo_input);\n    Bar bar = new Bar(data.consumeString(1000));\n    ClassWithTypeAlias aliased = new ClassWithTypeAlias(data.consumeString(1000));\n    SubclassOfAliasedType subclass_of_aliased = new SubclassOfAliasedType(data.consumeString(1000));\n\t  KeyValueQuery<String> STRING_QUERY = new KeyValueQuery<>(\"foo == '\" + foo_input + \"'\");\n\n    \n    KeyValueTemplate operations = new KeyValueTemplate(new MapKeyValueAdapter());   \n   \n     try{\n      operations.insert(foo_id, foo);\n      operations.insert(bar_id, bar);\n      operations.insert(aliased_id, aliased);\n      operations.insert(subclass_id, subclass_of_aliased);\n    }\n    catch (DuplicateKeyException e){}\n\n    operations.update(foo_id, bar);\n    \n    operations.findById(foo_id, Foo.class);\n    operations.findById(bar_id, Bar.class);\n    operations.findById(foo_id, Bar.class);\n    operations.findById(aliased_id, ClassWithTypeAlias.class);\n    try {\n      operations.find(new KeyValueQuery<>(data.consumeString(1000)), Foo.class);\n    }\n    //catching the Spel* exceptions because they are not the focus and essentially block the fuzzer\n    catch (DataRetrievalFailureException | SpelParseException | SpelEvaluationException | UncategorizedKeyValueException e){}\n\n\n    try {\n      operations.find(new KeyValueQuery<>(STRING_QUERY), Foo.class);\n      operations.find(new KeyValueQuery<>(STRING_QUERY), ClassWithTypeAlias.class);\n      operations.find(new KeyValueQuery<>(STRING_QUERY), SubclassOfAliasedType.class);\n    }\n    catch (DataRetrievalFailureException | UncategorizedKeyValueException e){}\n  \n    \n    operations.findAll(foo.getClass());\n    operations.findAll(aliased.getClass());\n    operations.findAll(subclass_of_aliased.getClass());\n    \n    operations.delete(data.consumeString(1000), Foo.class);\n    operations.delete(foo_id, Foo.class);\n\n  }\n  \n\n\t@Data\n\t@AllArgsConstructor\n\tstatic class Foo {\n\n\t\tString foo;\n\n\t}\n\n\t@Data\n\t@AllArgsConstructor\n\tstatic class Bar {\n\n\t\tString bar;\n\t}\n\n\t@Data\n\tstatic class ClassWithStringId implements Serializable {\n\n\t\tprivate static final long serialVersionUID = -7481030649267602830L;\n\t\t@Id String id;\n\t\tString value;\n\t}\n\n\t@ExplicitKeySpace(name = \"aliased\")\n\t@Data\n\tstatic class ClassWithTypeAlias implements Serializable {\n\n\t\tprivate static final long serialVersionUID = -5921943364908784571L;\n\t\t@Id String id;\n\t\tString name;\n\n\t\tClassWithTypeAlias(String name) {\n\t\t\tthis.name = name;\n\t\t}\n\t}\n\n\tstatic class SubclassOfAliasedType extends ClassWithTypeAlias {\n\n\t\tprivate static final long serialVersionUID = -468809596668871479L;\n\n\t\tSubclassOfAliasedType(String name) {\n\t\t\tsuper(name);\n\t\t}\n\n\t}\n\n\t@KeySpace\n\t@Persistent\n\t@Retention(RetentionPolicy.RUNTIME)\n\t@Target({ ElementType.TYPE })\n\t@interface ExplicitKeySpace {\n\n\t\t@AliasFor(annotation = KeySpace.class, value = \"value\")\n\t\tString name() default \"\";\n\n\t}\n}\n\n\n\n\n"
  },
  {
    "path": "projects/spring-data-keyvalue/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=17 -Djavac.target.version=17 -Dmaven.repo.local=$WORK/m2\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/spring-data-keyvalue-$CURRENT_VERSION.jar\" $OUT/spring-data-keyvalue.jar\n\n# remove signature files\nmkdir $OUT/tmp\nunzip $OUT/spring-data-keyvalue.jar -x \"META-INF/*.SF\" \"META-INF/*.RSA\" \"META-INF/*.DSA\" -d $OUT/tmp\ncd $OUT/tmp\njar -cvf $OUT/spring-data-keyvalue.jar *\ncd -\nrm -rf $OUT/tmp\n\n# need lombok for fuzz test\nfind $WORK -name \"spring-tx*.jar\" -exec cp {} $OUT/spring-tx.jar \\;\nwget -O \"$OUT/lombok.jar\" \"https://repo.maven.apache.org/maven2/org/projectlombok/lombok/1.18.28/lombok-1.18.28.jar\"\n\nALL_JARS=\"spring-data-keyvalue.jar lombok.jar spring-tx.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH:$OUT/\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir:$OUT/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-data-keyvalue/project.yaml",
    "content": "homepage: \"https://docs.spring.io/spring-data/keyvalue/docs/current/reference/html/\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-data-keyvalue.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-data-mongodb/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-data-mongodb\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-data-mongodb"
  },
  {
    "path": "projects/spring-data-mongodb/ParameterBindingJsonReaderFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.bson.json.JsonParseException;\nimport org.springframework.data.mongodb.util.json.ParameterBindingJsonReader;\nimport org.springframework.expression.spel.SpelEvaluationException;\nimport org.springframework.expression.spel.SpelParseException;\n\npublic class ParameterBindingJsonReaderFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try (ParameterBindingJsonReader reader = new ParameterBindingJsonReader(data.consumeRemainingAsString())) {\n            reader.doReadDecimal128();\n            reader.getMark();\n            reader.readBsonType();\n        } catch (SpelParseException | SpelEvaluationException | IllegalStateException | IllegalArgumentException |\n                 JsonParseException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/spring-data-mongodb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -Dmaven.test.skip=true -Dcheckstyle.skip=true\"\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\n$MVN clean package $MAVEN_ARGS\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\ncp \"spring-data-mongodb/target/spring-data-mongodb-$CURRENT_VERSION.jar\" \"$OUT/spring-data-mongodb.jar\"\n\nALL_JARS=\"spring-data-mongodb.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_includes=org.springframework.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-data-mongodb/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-data-mongodb\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-data-mongodb.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-data-redis/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n# Added a workaround to get Maven from a different source.\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nENV MVN $SRC/maven/apache-maven-3.9.1/bin/mvn\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-data-redis.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-data-redis"
  },
  {
    "path": "projects/spring-data-redis/GenericJackson2JsonRedisSerializerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;\nimport org.springframework.data.redis.serializer.SerializationException;\n\n\npublic class GenericJackson2JsonRedisSerializerFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        GenericJackson2JsonRedisSerializer serializer = new GenericJackson2JsonRedisSerializer();\n        byte[] input = data.consumeRemainingAsBytes();\n        try {\n            serializer.deserialize(input);\n        } catch (SerializationException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/spring-data-redis/RedisStringDeserializationFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.data.redis.serializer.StringRedisSerializer;\n\n\npublic class RedisStringDeserializationFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int value = data.consumeInt(0,2);\n        byte[] input = data.consumeRemainingAsBytes();\n        switch (value) {\n            case 0:\n                StringRedisSerializer.US_ASCII.deserialize(input);\n            case 1:\n                StringRedisSerializer.ISO_8859_1.deserialize(input);\n            case 2:\n                StringRedisSerializer.UTF_8.deserialize(input);\n        }\n    }\n}"
  },
  {
    "path": "projects/spring-data-redis/RedisStringSerializationFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.data.redis.serializer.StringRedisSerializer;\n\n\npublic class RedisStringSerializationFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int value = data.consumeInt(0,2);\n        String original_input = data.consumeRemainingAsString();\n        String deserialized_input = null;\n        byte[] serialized_input = null;\n        String format = null;\n        switch (value) {\n            case 0:\n                format = \"US_ASCII\";\n                serialized_input = StringRedisSerializer.US_ASCII.serialize(original_input);\n                deserialized_input = StringRedisSerializer.US_ASCII.deserialize(serialized_input);\n            case 1:\n                format = \"ISO_8859_1\";\n                serialized_input = StringRedisSerializer.ISO_8859_1.serialize(original_input);\n                deserialized_input = StringRedisSerializer.ISO_8859_1.deserialize(serialized_input);\n            case 2:\n                format = \"UTF_8\";\n                serialized_input = StringRedisSerializer.UTF_8.serialize(original_input);\n                deserialized_input = StringRedisSerializer.UTF_8.deserialize(serialized_input);\n        }\n        if (!deserialized_input.equals(original_input)) {\n            throw new IllegalStateException(\"Failed to recover\\n\" + original_input + \"\\ndeserialized with \" + format \n                    + \", got:\\n\" + deserialized_input + \"\\n\\n\");\n        }\n    }\n}"
  },
  {
    "path": "projects/spring-data-redis/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Djavac.src.version=17 -Djavac.target.version=17 -DskipTests -Dcheckstyle.skip=true\"\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\n$MVN clean package $MAVEN_ARGS\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\ncp \"target/spring-data-redis-$CURRENT_VERSION.jar\" \"$OUT/spring-data-redis.jar\"\n\n\nALL_JARS=\"spring-data-redis.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.ReflectiveCall\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-data-redis/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-boot\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-boot.git\"\nprimary_contact: \"pwebb@vmware.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-framework/.dockerignore",
    "content": "*\n!/spring-*\n!*.diff\n!*.sh"
  },
  {
    "path": "projects/spring-framework/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n# Spring Framework main branch requires Java 25\n# Download and install OpenJDK 25 GA\nRUN apt update && apt install -y wget && \\\n    wget -q https://download.java.net/java/GA/jdk25.0.1/2fbf10d8c78e40bd87641c434705079d/8/GPL/openjdk-25.0.1_linux-x64_bin.tar.gz -O /tmp/openjdk25.tar.gz && \\\n    mkdir -p /usr/lib/jvm && \\\n    tar -xzf /tmp/openjdk25.tar.gz -C /usr/lib/jvm && \\\n    mv /usr/lib/jvm/jdk-25.0.1 /usr/lib/jvm/java-25-openjdk-amd64 && \\\n    rm /tmp/openjdk25.tar.gz && \\\n    update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-25-openjdk-amd64/bin/java 1 && \\\n    update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-25-openjdk-amd64/bin/javac 1 && \\\n    update-alternatives --set java /usr/lib/jvm/java-25-openjdk-amd64/bin/java && \\\n    update-alternatives --set javac /usr/lib/jvm/java-25-openjdk-amd64/bin/javac\n\nENV JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-framework\n\nCOPY . $SRC/\n\nRUN  cd spring-framework && (for i in ${SRC}/add-shadow-*.diff; do tr -d '\\015' < $i | git apply -v; done )\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/spring-context/XmlApplicationContextFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/spring-context/XmlApplicationContextFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nWORKDIR $SRC/spring-framework"
  },
  {
    "path": "projects/spring-framework/add-shadow-context.diff",
    "content": "diff --git a/spring-context/spring-context.gradle b/spring-context/spring-context.gradle\nindex 5f5ac1001e..bff2f80935 100644\n--- a/spring-context/spring-context.gradle\n+++ b/spring-context/spring-context.gradle\n@@ -4,6 +4,7 @@ plugins {\n \n description = \"Spring Context\"\n \n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlin\"\n \n dependencies {\n"
  },
  {
    "path": "projects/spring-framework/add-shadow-core.diff",
    "content": "diff --git a/spring-core/spring-core.gradle b/spring-core/spring-core.gradle\nindex 25c6f7ce78..aba0c7f1cb 100644\n--- a/spring-core/spring-core.gradle\n+++ b/spring-core/spring-core.gradle\n@@ -3,6 +3,7 @@ import org.springframework.build.shadow.ShadowSource\n \n description = \"Spring Core\"\n \n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlin\"\n apply plugin: \"kotlinx-serialization\"\n \n"
  },
  {
    "path": "projects/spring-framework/add-shadow-jdbc.diff",
    "content": "diff --git a/spring-jdbc/spring-jdbc.gradle b/spring-jdbc/spring-jdbc.gradle\nindex 389462f3bb..98a4e93d92 100644\n--- a/spring-jdbc/spring-jdbc.gradle\n+++ b/spring-jdbc/spring-jdbc.gradle\n@@ -1,5 +1,6 @@\n description = \"Spring JDBC\"\n \n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlin\"\n \n dependencies {\n"
  },
  {
    "path": "projects/spring-framework/add-shadow-jms.diff",
    "content": "diff --git a/spring-jms/spring-jms.gradle b/spring-jms/spring-jms.gradle\n--- a/spring-jms/spring-jms.gradle\n+++ b/spring-jms/spring-jms.gradle\n@@ -1,5 +1,16 @@\n description = \"Spring JMS\"\n \n+apply plugin: \"com.gradleup.shadow\"\n+\n+configurations {\n+\tshadow\n+}\n+\n+shadowJar {\n+\tconfigurations = [project.configurations.shadow, project.configurations.runtimeClasspath]\n+\tmergeServiceFiles()\n+}\n+\n dependencies {\n \tapi(project(\":spring-beans\"))\n \tapi(project(\":spring-core\"))\n@@ -8,6 +19,7 @@ dependencies {\n \tapi(\"io.micrometer:micrometer-observation\")\n \tcompileOnly(\"jakarta.jms:jakarta.jms-api\")\n \toptional(project(\":spring-aop\"))\n+\tshadow(\"jakarta.jms:jakarta.jms-api:3.1.0\")\n \toptional(project(\":spring-context\"))\n \toptional(project(\":spring-oxm\"))\n \toptional(\"com.fasterxml.jackson.core:jackson-databind\")\n"
  },
  {
    "path": "projects/spring-framework/add-shadow-messaging.diff",
    "content": "diff --git a/spring-messaging/spring-messaging.gradle b/spring-messaging/spring-messaging.gradle\nindex cb54d42e59..e48a0d00a7 100644\n--- a/spring-messaging/spring-messaging.gradle\n+++ b/spring-messaging/spring-messaging.gradle\n@@ -1,5 +1,6 @@\n description = \"Spring Messaging\"\n \n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlin\"\n apply plugin: \"kotlinx-serialization\"\n \n"
  },
  {
    "path": "projects/spring-framework/add-shadow-orm.diff",
    "content": "diff --git a/spring-orm/spring-orm.gradle b/spring-orm/spring-orm.gradle\nindex c2c5a4afc9..5151f30de5 100644\n--- a/spring-orm/spring-orm.gradle\n+++ b/spring-orm/spring-orm.gradle\n@@ -1,5 +1,7 @@\n description = \"Spring Object/Relational Mapping\"\n \n+apply plugin: \"com.gradleup.shadow\"\n+\n dependencies {\n \tapi(project(\":spring-beans\"))\n \tapi(project(\":spring-core\"))\n"
  },
  {
    "path": "projects/spring-framework/add-shadow-oxm.diff",
    "content": "diff --git a/spring-oxm/spring-oxm.gradle b/spring-oxm/spring-oxm.gradle\n--- a/spring-oxm/spring-oxm.gradle\n+++ b/spring-oxm/spring-oxm.gradle\n@@ -1,6 +1,7 @@\n plugins {\n \tid \"com.github.bjornvester.xjc\"\n+\tid \"com.gradleup.shadow\"\n }\n \n description = \"Spring Object/XML Marshalling\"\n \n"
  },
  {
    "path": "projects/spring-framework/add-shadow-test.diff",
    "content": "--- a/spring-test/spring-test.gradle\n+++ b/spring-test/spring-test.gradle\n@@ -1,5 +1,6 @@\n description = \"Spring TestContext Framework\"\n \n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlin\"\n \n dependencies {\n"
  },
  {
    "path": "projects/spring-framework/add-shadow-tx.diff",
    "content": "diff --git a/spring-tx/spring-tx.gradle b/spring-tx/spring-tx.gradle\nindex 75d1b22a94..84a13262ab 100644\n--- a/spring-tx/spring-tx.gradle\n+++ b/spring-tx/spring-tx.gradle\n@@ -1,5 +1,6 @@\n description = \"Spring Transaction\"\n \n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlin\"\n \n dependencies {\n"
  },
  {
    "path": "projects/spring-framework/add-shadow-web.diff",
    "content": "--- a/spring-web/spring-web.gradle\n+++ b/spring-web/spring-web.gradle\n@@ -1,5 +1,6 @@\n description = \"Spring Web\"\n \n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlin\"\n apply plugin: \"kotlinx-serialization\"\n \n"
  },
  {
    "path": "projects/spring-framework/add-shadow-webmvc.diff",
    "content": "diff --git a/spring-webmvc/spring-webmvc.gradle b/spring-webmvc/spring-webmvc.gradle\n--- a/spring-webmvc/spring-webmvc.gradle\n+++ b/spring-webmvc/spring-webmvc.gradle\n@@ -1,6 +1,7 @@\n description = \"Spring Web MVC\"\n \n apply plugin: \"kotlin\"\n+apply plugin: \"com.gradleup.shadow\"\n apply plugin: \"kotlinx-serialization\"\n \n dependencies {\n"
  },
  {
    "path": "projects/spring-framework/add-shadow-websocket.diff",
    "content": "diff --git a/spring-websocket/spring-websocket.gradle b/spring-websocket/spring-websocket.gradle\nindex 3c9d011b4a..7eec687c0c 100644\n--- a/spring-websocket/spring-websocket.gradle\n+++ b/spring-websocket/spring-websocket.gradle\n@@ -1,6 +1,10 @@\n description = \"Spring WebSocket\"\n \n+apply plugin: \"com.gradleup.shadow\"\n+\n dependencies {\n+\timplementation 'org.mockito:mockito-core:4.7.0'\n+\timplementation 'org.objenesis:objenesis:3.3'\n \tapi(project(\":spring-context\"))\n \tapi(project(\":spring-core\"))\n \tapi(project(\":spring-web\"))\n"
  },
  {
    "path": "projects/spring-framework/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfind $SRC/spring* -name *.dict -o -name *zip -exec cp {} $OUT/ \\;\n\nexport JAVA_HOME=\"$OUT/open-jdk-25\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-25-openjdk-amd64/\" \"$JAVA_HOME\"\n\n# Disable build scan publishing for all gradle commands\nexport GRADLE_OPTS=\"-Dscan.disabled=true -Dorg.gradle.daemon=false\"\n\n# Try to get version from gradle.properties first, fallback to gradlew\nCURRENT_VERSION=$(grep -E \"^version\\s*=\" gradle.properties 2>/dev/null | sed 's/version\\s*=\\s*//')\nif [ -z \"$CURRENT_VERSION\" ]; then\n    CURRENT_VERSION=$(timeout 120 ./gradlew properties --console=plain --no-scan --no-daemon -q 2>/dev/null | sed -nr \"s/^version:\\ (.*)/\\1/p\")\nfi\nexport CURRENT_VERSION\n\nfunction install_shadowJar {\n    if grep -q shadow $1/$1.gradle; then\n\t    ./gradlew :$1:shadowJar -x javadoc -x test --no-scan --no-daemon\n    \tinstall -v \"$1/build/libs/$1-$CURRENT_VERSION-all.jar\" \"$OUT/$1.jar\";\n    else\n        ./gradlew :$1:build -x javadoc -x test --no-scan --no-daemon\n        install -v \"$1/build/libs/$1-$CURRENT_VERSION.jar\" \"$OUT/$1.jar\";\n    fi\n}\n\ninstall_shadowJar spring-context\ninstall_shadowJar spring-core\ninstall_shadowJar spring-jdbc\ninstall_shadowJar spring-orm\ninstall_shadowJar spring-web\ninstall_shadowJar spring-webmvc\ninstall_shadowJar spring-test\ninstall_shadowJar spring-tx\ninstall_shadowJar spring-messaging\ninstall_shadowJar spring-jms\ninstall_shadowJar spring-webflux\ninstall_shadowJar spring-websocket\ninstall_shadowJar spring-oxm\n\nALL_JARS=$(find $OUT -name \"spring*.jar\" -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nexport BUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH:$SRC\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nexport RUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfunction create_fuzz_targets() {\n    mkdir -p $SRC/$1\n    mkdir -p $OUT/$1\n    # Use -d $OUT to place class files (including packaged classes) in the output directory\n    javac -cp $BUILD_CLASSPATH -d $OUT --release 25 $(find $SRC/$1/ -name \"*.java\" -print)\n\n    # Save the original classpath\n    local ORIGINAL_CLASSPATH=$RUNTIME_CLASSPATH\n\n    # Overwrite class path for some projects\n    if [ $# -eq 2 ]; then\n        RUNTIME_CLASSPATH=$2\n    fi\n\n    for fuzzer in $SRC/$1/*Fuzzer.java; do\n        fuzzer_basename=$(basename -s .java $fuzzer)\n\n        # Add special flags for specific fuzzers\n        EXTRA_JAZZER_ARGS=\"\"\n        if [ \"$fuzzer_basename\" = \"XStreamMarshallerFuzzer\" ]; then\n            # Disable UnsafeSanitizer which conflicts with XStream's use of sun.misc.Unsafe\n            EXTRA_JAZZER_ARGS=\"--disabled_hooks=com.code_intelligence.jazzer.sanitizers.UnsafeSanitizer\"\n        elif [ \"$fuzzer_basename\" = \"JdbcCoreMapperFuzzer\" ]; then\n            # Disable SSRF sanitizer - XML schema validation requires network access to springframework.org\n            EXTRA_JAZZER_ARGS=\"--disabled_hooks=com.code_intelligence.jazzer.sanitizers.ServerSideRequestForgery\"\n        fi\n\n        # Create an execution wrapper that executes Jazzer with the correct arguments.\n        echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nexport JAVA_OPTS=\\\"-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog\\\"\nexport JAVA_HOME=\\\"\\$this_dir/open-jdk-25/\\\"\nexport LD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-25/lib/server\\\":\\$this_dir\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\nelse\n    mem_settings='-Xmx2048m:-Xss1024k'\nfi\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\\\n    --cp=$RUNTIME_CLASSPATH \\\\\n    --target_class=$fuzzer_basename \\\\\n    --instrumentation_includes=org.springframework.** \\\\\n    --jvm_args=\\\"\\$mem_settings:-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog\\\" \\\\\n    $EXTRA_JAZZER_ARGS \\\\\n    \\$@\" > $OUT/$fuzzer_basename\n        chmod u+x $OUT/$fuzzer_basename\n    done\n\n    # Restore the original classpath\n    RUNTIME_CLASSPATH=$ORIGINAL_CLASSPATH\n\n    # Note: Class files are already in $OUT from javac -d $OUT\n}\n\ncreate_fuzz_targets spring-aop\ncreate_fuzz_targets spring-beans\ncreate_fuzz_targets spring-context\ncreate_fuzz_targets spring-expression\ncreate_fuzz_targets spring-tx\ncreate_fuzz_targets spring-web\ncreate_fuzz_targets spring-jdbc \"\\$this_dir/spring-jdbc:$RUNTIME_CLASSPATH\"\ncreate_fuzz_targets spring-messaging\ncreate_fuzz_targets spring-jms\ncreate_fuzz_targets spring-webflux\ncreate_fuzz_targets spring-oxm\ncreate_fuzz_targets spring-websocket \"\\$this_dir/spring-websocket.jar:\\$this_dir\"; # Overwrite class path to avoid logging to stdout\n\ncp $SRC/spring-jdbc/*.xml $OUT/spring-jdbc/\n"
  },
  {
    "path": "projects/spring-framework/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-framework\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-framework.git\"\nprimary_contact: \"pwebb@vmware.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\nrun_tests: False"
  },
  {
    "path": "projects/spring-framework/spring-aop/AspectJExpressionPointcutFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.aop.aspectj.AspectJExpressionPointcut;\nimport java.lang.reflect.Method;\nimport java.util.*;\nimport java.lang.*;\n\npublic class AspectJExpressionPointcutFuzzer {\n\tpublic static Class<?>[] classes = { Integer.class, String.class, Byte.class, List.class, Map.class,\n\t\t\tTreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class };\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tClass<?> classMatch = data.pickValue(classes);\n\t\tString matchesTestBean = data.consumeRemainingAsString();\n\t\tAspectJExpressionPointcut testBeanPc = new AspectJExpressionPointcut();\n\t\ttestBeanPc.setExpression(matchesTestBean);\n\n\t\tMethod methodName;\n\t\ttry {\n\t\t\tmethodName = classMatch.getMethod(\"hashCode\");\n\t\t} catch (NoSuchMethodException ignored) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\ttestBeanPc.matches(methodName, classMatch);\n\t\t} catch (RuntimeException e) {\n            // Ignore most aspectj syntax errors\n\t\t\tif (!(e instanceof IllegalArgumentException) && !e.getMessage().contains(\"bad\")) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\n\t\ttestBeanPc.toString();\n\t\ttestBeanPc.hashCode();\n\t\ttestBeanPc.equals(new Object());\n\t}\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-beans/BeanWrapperFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.beans.BeanWrapper;\nimport org.springframework.beans.BeanWrapperImpl;\nimport org.springframework.beans.ConversionNotSupportedException;\nimport org.springframework.beans.InvalidPropertyException;\nimport java.util.List;\nimport java.util.Map;\n\npublic class BeanWrapperFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tString property = data.consumeString(100);\n\t\tBean bean = new Bean();\n\t\tBeanWrapper bw = new BeanWrapperImpl(bean);\n\t\ttry {\n\t\t\tbw.setPropertyValue(property, data.consumeRemainingAsString());\n\t\t\tbw.getPropertyType(property);\n\t\t} catch (ConversionNotSupportedException | InvalidPropertyException ignored) {}\n\t}\n\n\tpublic static class Bean {\n\n\t\tprivate String prop;\n\n\t\tprivate Bean nested;\n\n\t\tprivate Bean[] array;\n\n\t\tprivate Bean[][] multiArray;\n\n\t\tprivate Bean[][][] threeDimensionalArray;\n\n\t\tprivate List<Bean> list;\n\n\t\tprivate List<List<Bean>> multiList;\n\n\t\tprivate List listNotParameterized;\n\n\t\tprivate Map<String, Bean> map;\n\n\t\tpublic String getProp() {\n\t\t\treturn prop;\n\t\t}\n\n\t\tpublic void setProp(String prop) {\n\t\t\tthis.prop = prop;\n\t\t}\n\n\t\tpublic Bean getNested() {\n\t\t\treturn nested;\n\t\t}\n\n\t\tpublic void setNested(Bean nested) {\n\t\t\tthis.nested = nested;\n\t\t}\n\n\t\tpublic Bean[] getArray() {\n\t\t\treturn array;\n\t\t}\n\n\t\tpublic void setArray(Bean[] array) {\n\t\t\tthis.array = array;\n\t\t}\n\n\t\tpublic Bean[][] getMultiArray() {\n\t\t\treturn multiArray;\n\t\t}\n\n\t\tpublic void setMultiArray(Bean[][] multiArray) {\n\t\t\tthis.multiArray = multiArray;\n\t\t}\n\n\t\tpublic Bean[][][] getThreeDimensionalArray() {\n\t\t\treturn threeDimensionalArray;\n\t\t}\n\n\t\tpublic void setThreeDimensionalArray(Bean[][][] threeDimensionalArray) {\n\t\t\tthis.threeDimensionalArray = threeDimensionalArray;\n\t\t}\n\n\t\tpublic List<Bean> getList() {\n\t\t\treturn list;\n\t\t}\n\n\t\tpublic void setList(List<Bean> list) {\n\t\t\tthis.list = list;\n\t\t}\n\n\t\tpublic List<List<Bean>> getMultiList() {\n\t\t\treturn multiList;\n\t\t}\n\n\t\tpublic void setMultiList(List<List<Bean>> multiList) {\n\t\t\tthis.multiList = multiList;\n\t\t}\n\n\t\tpublic List getListNotParameterized() {\n\t\t\treturn listNotParameterized;\n\t\t}\n\n\t\tpublic void setListNotParameterized(List listNotParameterized) {\n\t\t\tthis.listNotParameterized = listNotParameterized;\n\t\t}\n\n\t\tpublic Map<String, Bean> getMap() {\n\t\t\treturn map;\n\t\t}\n\n\t\tpublic void setMap(Map<String, Bean> map) {\n\t\t\tthis.map = map;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-context/XmlApplicationContextFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.util.*;\nimport java.nio.file.Files;\nimport org.springframework.context.support.FileSystemXmlApplicationContext;\nimport org.springframework.context.ApplicationContext;\nimport java.nio.file.Path;\nimport java.io.IOException;\nimport org.springframework.beans.factory.BeanDefinitionStoreException;\n\npublic class XmlApplicationContextFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String path = data.consumeString(50);\n\n        try {\n            Path tempFile = Files.createTempFile(\"dummy\", \".xml\");\n            Files.writeString(tempFile, data.consumeRemainingAsString());\n\n            ApplicationContext ctx = new FileSystemXmlApplicationContext(\"file:\" + tempFile.toAbsolutePath().toString());\n\n            ctx.getApplicationName();\n            ctx.getDisplayName();\n            ctx.getParent();\n            ctx.getResource(path);\n            ctx.getClassLoader();\n\n            Files.delete(tempFile);\n        } catch (IOException|BeanDefinitionStoreException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-expression/SpelExpressionFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.expression.Expression;\nimport org.springframework.expression.ExpressionParser;\nimport org.springframework.expression.spel.SpelEvaluationException;\nimport org.springframework.expression.spel.SpelParseException;\nimport org.springframework.expression.spel.standard.SpelExpressionParser;\nimport org.springframework.expression.spel.support.StandardEvaluationContext;\n\nimport java.util.*;\n\npublic class SpelExpressionFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ExpressionParser parser = new SpelExpressionParser();\n\n        // Create and fill a dummy object with fuzzer data\n        String[] strArr = new String[data.consumeInt(0, 50)];\n        for (int i = 0; i < strArr.length; i++) {\n            strArr[i] = data.consumeString(100);\n        }\n\n        DummyClass dummyObject = new DummyClass();\n        dummyObject._char = data.consumeChar();\n        dummyObject._string = data.consumeString(100);\n        dummyObject._boolArray = data.consumeBooleans(50);\n        dummyObject._double = data.consumeDouble();\n        dummyObject._intArray = data.consumeInts(50);\n        dummyObject._long = data.consumeLong();\n        dummyObject._byteArray = data.consumeBytes(50);\n        dummyObject._boolean = data.consumeBoolean();\n        dummyObject._byte = data.consumeByte();\n        dummyObject._stringArray = strArr;\n        dummyObject._int = data.consumeInt();\n        dummyObject._short = data.consumeShort();\n        dummyObject._float = data.consumeFloat();\n        dummyObject._arrayList = Arrays.asList(strArr);\n\n        StandardEvaluationContext context = new StandardEvaluationContext();\n        context.setRootObject(dummyObject);\n\n        String expressionString = data.consumeRemainingAsString();\n        if (expressionString == null || expressionString.isBlank()) {\n            return;  // Early return for empty/blank input\n        }\n\n        try {\n            Expression expr = parser.parseExpression(expressionString);\n            expr.getValue();\n            expr.getValue(dummyObject);\n        } catch (SpelEvaluationException | SpelParseException | IllegalArgumentException ignored) {}\n    }\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public boolean[] _boolArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n        public Long _long;\n        public Double _double;\n        public String _string;\n    }\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/DataAccessObject.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage jdbc;\n\nimport java.util.List;\nimport javax.sql.DataSource;\n\npublic interface DataAccessObject {\n\tpublic void setDataSource(DataSource ds);\n\tpublic void create(PersistentClass persistentClass);\n\tpublic void remove(PersistentClass persistentClass);\n\tpublic void update(PersistentClass persistentClass);\n\tpublic List<PersistentClass> listPersistentClasses();\n}"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/JdbcCoreMapperFuzzer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.sql.SQLException;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.support.ClassPathXmlApplicationContext;\n\nimport jdbc.*;\n\npublic class JdbcCoreMapperFuzzer extends MapperFuzzerServer {\n    List<PersistentClass> m_persistentClasses = null;\n\n    JdbcCoreMapperFuzzer(FuzzedDataProvider data) {\n        super(false);\n\n        m_persistentClasses = new ArrayList<PersistentClass>();\n        int n = data.consumeInt(1,10);\n        for(int i = 0; i < n; ++i) {\n            m_persistentClasses.add(new PersistentClass(data.consumeInt(), data.consumeAsciiString(10)));\n        }\n    }\n\n    boolean containedIn(PersistentClass needle, List<PersistentClass> haystack) {\n        for (PersistentClass rval : haystack) {\n            /*\n             * id is allowed to mismatch.\n             */\n            if (!needle.getIntMember().equals(rval.getIntMember())) {\n                continue;\n            }\n            if (!needle.getStringMember().equals(rval.getStringMember())) {\n                continue;\n            }\n            return true;\n        }\n        return false;\n    }\n\n    void verifyPersistentClasses(List<PersistentClass> persistentClasses) {\n        \n        if (persistentClasses.size() != m_persistentClasses.size()) {\n            throw new FuzzerSecurityIssueLow(\"Data loss detected\");\n        }\n\n        for (PersistentClass expectedClass : m_persistentClasses) {\n            if (! containedIn(expectedClass, persistentClasses)) {\n                throw new FuzzerSecurityIssueLow(\"Data corruption detected\");\n            }\n        }\n    }\n\n    void persistData(Template template) {\n        for(PersistentClass persistentClass : m_persistentClasses) {\n            template.create(persistentClass);\n        }\n\n        List<PersistentClass> persistedClasses = template.listPersistentClasses();\n        verifyPersistentClasses(persistedClasses);\n\n        /*\n         * the list from the template contains IDs.\n         */\n        m_persistentClasses = persistedClasses;\n    }\n\n    void updateData(Template template, FuzzedDataProvider data) {\n        int k = data.consumeInt(0, m_persistentClasses.size()-1);\n        PersistentClass persistentClass = m_persistentClasses.get(k);\n        persistentClass.setIntMember(data.consumeInt());\n        persistentClass.setStringMember(data.consumeString(10));\n        m_persistentClasses.set(k, persistentClass);\n        template.update(persistentClass);\n\n        List<PersistentClass> persistedClasses = template.listPersistentClasses();\n        verifyPersistentClasses(persistedClasses);\n    }\n\n    void removeData(Template template, FuzzedDataProvider data) {\n        int k = data.consumeInt(0, m_persistentClasses.size()-1);\n        PersistentClass persistentClass = m_persistentClasses.remove(k);\n        template.remove(persistentClass);\n\n        List<PersistentClass> persistedClasses = template.listPersistentClasses();\n        verifyPersistentClasses(persistedClasses);\n    }\n\n    void runTests(FuzzedDataProvider data) {\n        try {\n            prepareTables();\n        } catch (SQLException ex) {\n            /* this should really not happen */\n            ex.printStackTrace(System.err);\n            System.exit(1);\n        }\n\n        ApplicationContext context = new ClassPathXmlApplicationContext(\"JdbcCoreMapperFuzzerBeans.xml\");\n        Template template = (Template)context.getBean(\"persistentClassJdbcTemplate\");\n\n        persistData(template);\n        updateData(template, data);\n        removeData(template, data);\n    }\n    \n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        JdbcCoreMapperFuzzer testClosure = new JdbcCoreMapperFuzzer(data);\n        testClosure.runTests(data);\n        testClosure.stop();\n    }\n}"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/JdbcCoreMapperFuzzerBeans.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\n   xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n   xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\">\n\n\t<bean id=\"dataSource\" class=\"org.springframework.jdbc.datasource.DriverManagerDataSource\">\n\t\t<property name=\"driverClassName\" value=\"org.hsqldb.jdbc.JDBCDriver\" />\n\t\t<property name=\"url\" value=\"jdbc:hsqldb:mem:CoreMapperFuzzer\" />\n\t\t<property name=\"username\" value=\"sa\" />\n\t\t<property name=\"password\" value=\"\" />\n\t</bean>\n\t\n\t<bean id=\"persistentClassJdbcTemplate\" class=\"jdbc.Template\">\n\t\t<property name=\"dataSource\" ref=\"dataSource\" />\n\t</bean>\n\n</beans>"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/Mapper.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage jdbc;\n\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport org.springframework.jdbc.core.RowMapper;\n\npublic class Mapper implements RowMapper<PersistentClass> {\n    public PersistentClass mapRow(ResultSet rs, int rowNum) throws SQLException {\n        return new PersistentClass(\n            rs.getInt(\"intMember\"),\n            rs.getString(\"stringMember\"),\n            rs.getInt(\"id\")\n        );\n    }\n}"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/MapperFuzzerServer.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage jdbc;\n\nimport java.sql.Connection;\nimport java.sql.SQLException;\nimport java.sql.Statement;\n\npublic class MapperFuzzerServer extends Server {\n\n\tpublic MapperFuzzerServer(boolean verbose) {\n\t\tsuper(verbose, \"CoreMapperFuzzer\");\n\t}\n\n\tpublic void prepareTables() throws SQLException {\n\t\t/*\n\t\t * HSQLDB in-memory-databases can survive the server instance being destroyed,\n\t\t * especially when another instance is created within the same address space.\n\t\t *\n\t\t * Drop any previous tables to prevent a fuzz iteratation \"preparing\" the table\n\t\t * for another one, which will fail to reproduce, as only the last fuzzers'\n\t\t * input would be recorded.\n\t\t */\n\t\ttry (Connection connection = getConnection()) {\n\t\t\tconnection.createStatement().execute(\"DROP TABLE PersistentClass IF EXISTS\");\n\t\t\tconnection.createStatement().execute(\"CREATE TABLE PersistentClass ( id INT IDENTITY, intMember INT NOT NULL, stringMember VARCHAR(255) NOT NULL )\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/PersistentClass.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage jdbc;\n\npublic class PersistentClass {\n    private Integer m_id;\n    private Integer m_int;\n    private String  m_string;\n    \n    public PersistentClass(Integer intMember, String stringMember, Integer id) {\n        m_id = id;\n        m_int = intMember;\n        m_string = stringMember;\n    }\n\n    public PersistentClass(Integer intMember, String stringMember) {\n        m_int = intMember;\n        m_string = stringMember;\n    }\n\n    public void setId(Integer id) {\n        m_id = id;\n    }\n    public Integer getId() {\n        return m_id;\n    }\n    public void setIntMember(Integer value) {\n        m_int = value;\n    }\n    public Integer getIntMember() {\n        return m_int;\n    }\n    public void setStringMember(String value) {\n        m_string = value;\n    }\n    public String getStringMember() {\n        return m_string;\n    }\n}"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/Server.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage jdbc;\n\nimport org.hsqldb.server.ServerConstants;\nimport java.io.PrintWriter;\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.sql.PreparedStatement;\n\npublic abstract class Server extends org.hsqldb.server.Server implements AutoCloseable {\n\n\tprivate PrintWriter m_stderr = null;\n\tprivate PrintWriter m_stdout = null;\n\n\tstatic {\n\t\ttry {\n\t\t\tClass.forName(\"org.hsqldb.jdbc.JDBCDriver\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"Failed to load HSQLDB driver\", e);\n\t\t}\n\t}\n\n\tpublic Server(boolean verbose, String databaseName) {\n\t\tsuper();\n\t\tsetVerbose(verbose);\n\n\t\tsetDatabaseName(0, databaseName);\n        setDatabasePath(0, \"mem:\" + databaseName);\n\n\t\tstart();\n\t}\n\n\tpublic abstract void prepareTables() throws SQLException;\n\n\tpublic void close() throws Exception {\n\t\tstop();\n\t}\n\n\tprotected void setVerbose(boolean verbose) {\n\t\tif (verbose) {\n\t\t\tm_stderr = new PrintWriter(System.err);\n\t\t\tm_stdout = new PrintWriter(System.out);\n\t\t} else {\n\t\t\tm_stderr = null;\n\t\t\tm_stdout = null;\n\t\t}\n\t\tthis.setErrWriter(m_stderr);\n\t\tthis.setLogWriter(m_stdout);\n\t}\n\n\tpublic int stop() {\n\t\tint retval = super.stop();\n\t\t/*\n\t\t * polling [...]\n\t\t */\n\t\twhile (getState() == ServerConstants.SERVER_STATE_CLOSING) {\n\t\t\tThread.yield();\n\t\t}\n\n\t\treturn retval;\n\t}\n\n\tConnection getConnection(String options) throws SQLException {\n\t\treturn DriverManager.getConnection(\"jdbc:hsqldb:mem:\" + getDatabaseName(0, false) + \";\" + options, \"sa\", \"\");\n\t}\n\n\tConnection getConnection() throws SQLException {\n\t\treturn getConnection(\"\");\n\t}\n}"
  },
  {
    "path": "projects/spring-framework/spring-jdbc/Template.java",
    "content": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage jdbc;\n\nimport java.util.List;\nimport javax.sql.DataSource;\nimport org.springframework.jdbc.core.JdbcTemplate;\n\npublic class Template implements DataAccessObject {\n    private DataSource m_dataSource;\n    private JdbcTemplate m_jdbcTemplate;\n    \n    public void setDataSource(DataSource dataSource) {\n        m_dataSource = dataSource;\n        m_jdbcTemplate = new JdbcTemplate(dataSource);\n    }\n    public void create(PersistentClass persistentClass) {\n        m_jdbcTemplate.update(\"INSERT INTO PersistentClass (stringMember, intMember) VALUES (?, ?)\", persistentClass.getStringMember(), persistentClass.getIntMember());\n    }\n    public void remove(PersistentClass persistentClass) {\n        m_jdbcTemplate.update(\"DELETE FROM PersistentClass WHERE id=?\", persistentClass.getId());\n    }\n    public void update(PersistentClass persistentClass) {\n        m_jdbcTemplate.update(\"UPDATE PersistentClass SET (stringMember, intMember)=(?, ?) WHERE id=?\", persistentClass.getStringMember(), persistentClass.getIntMember(), persistentClass.getId());\n    }\n    public List<PersistentClass> listPersistentClasses() {\n        return m_jdbcTemplate.query(\"SELECT * FROM PersistentClass\", new Mapper());\n    }\n}"
  },
  {
    "path": "projects/spring-framework/spring-jms/SimpleJmsHeaderMapperFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport jakarta.jms.Destination;\nimport jakarta.jms.JMSException;\nimport jakarta.jms.TextMessage;\nimport org.springframework.jms.support.SimpleJmsHeaderMapper;\nimport org.springframework.messaging.Message;\nimport org.springframework.messaging.support.MessageBuilder;\n\nimport java.util.Enumeration;\n\npublic class SimpleJmsHeaderMapperFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tSimpleJmsHeaderMapper mapper = new SimpleJmsHeaderMapper();\n\t\tif (data.consumeBoolean()) {\n\t\t\tmapper.setOutboundPrefix(data.consumeString(50));\n\t\t}\n\n\t\tif (data.consumeBoolean()) {\n\t\t\tmapper.setInboundPrefix(data.consumeString(100));\n\t\t}\n\n\t\tMessageBuilder<String> builder = MessageBuilder.withPayload(data.consumeString(100));\n\n\t\tfor (int i = 0; i < data.consumeInt(0, 30); i++) {\n\t\t\taddHeader(builder, data);\n\t\t}\n\n\t\tMessage<String> message = builder.build();\n\n\t\tjakarta.jms.Message jmsMessage = new DummyMessage();\n\t\tmapper.fromHeaders(message.getHeaders(), jmsMessage);\n\t}\n\n\tprivate static void addHeader(MessageBuilder<String> builder, FuzzedDataProvider data) {\n\t\ttry {\n\t\t\tswitch (data.consumeInt(0, 4)) {\n\t\t\t\tcase 0 -> builder.setHeader(data.consumeString(50), data.consumeString(100));\n\t\t\t\tcase 1 -> builder.setHeader(data.consumeString(50), data.consumeInt());\n\t\t\t\tcase 2 -> builder.setHeader(data.consumeString(50), data.consumeLong());\n\t\t\t\tcase 3 -> builder.setHeader(data.consumeString(50), data.consumeBoolean());\n\t\t\t\tcase 4 -> builder.setHeader(data.consumeString(50), data.consumeBytes(50));\n\t\t\t}\n\t\t} catch (java.lang.IllegalArgumentException e) {}\n\t}\n\n\tpublic static class DummyMessage implements TextMessage {\n\n\t\t@Override\n\t\tpublic void setText(String s) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic String getText() throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic String getJMSMessageID() throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSMessageID(String s) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic long getJMSTimestamp() throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSTimestamp(long l) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic byte[] getJMSCorrelationIDAsBytes() throws JMSException {\n\t\t\treturn new byte[0];\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSCorrelationID(String s) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic String getJMSCorrelationID() throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic Destination getJMSReplyTo() throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSReplyTo(Destination destination) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic Destination getJMSDestination() throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSDestination(Destination destination) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic int getJMSDeliveryMode() throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSDeliveryMode(int i) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean getJMSRedelivered() throws JMSException {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSRedelivered(boolean b) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic String getJMSType() throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSType(String s) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic long getJMSExpiration() throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSExpiration(long l) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic long getJMSDeliveryTime() throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSDeliveryTime(long l) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic int getJMSPriority() throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setJMSPriority(int i) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void clearProperties() throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean propertyExists(String s) throws JMSException {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean getBooleanProperty(String s) throws JMSException {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic byte getByteProperty(String s) throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic short getShortProperty(String s) throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic int getIntProperty(String s) throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic long getLongProperty(String s) throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic float getFloatProperty(String s) throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic double getDoubleProperty(String s) throws JMSException {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tpublic String getStringProperty(String s) throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic Object getObjectProperty(String s) throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic Enumeration getPropertyNames() throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void setBooleanProperty(String s, boolean b) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setByteProperty(String s, byte b) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setShortProperty(String s, short i) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setIntProperty(String s, int i) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setLongProperty(String s, long l) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setFloatProperty(String s, float v) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setDoubleProperty(String s, double v) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setStringProperty(String s, String s1) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void setObjectProperty(String s, Object o) throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void acknowledge() throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void clearBody() throws JMSException {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic <T> T getBody(Class<T> aClass) throws JMSException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isBodyAssignableTo(Class aClass) throws JMSException {\n\t\t\treturn false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "projects/spring-framework/spring-messaging/PayloadMethodArgumentResolverFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport org.springframework.core.annotation.SynthesizingMethodParameter;\nimport org.springframework.messaging.Message;\nimport org.springframework.messaging.MessageHeaders;\nimport org.springframework.messaging.converter.MarshallingMessageConverter;\nimport org.springframework.messaging.converter.StringMessageConverter;\nimport org.springframework.messaging.handler.annotation.support.MethodArgumentNotValidException;\nimport org.springframework.messaging.handler.annotation.support.PayloadMethodArgumentResolver;\nimport org.springframework.messaging.support.MessageBuilder;\nimport org.springframework.messaging.support.MessageHeaderAccessor;\nimport org.springframework.util.MimeType;\nimport org.springframework.validation.Errors;\nimport org.springframework.validation.Validator;\n\nimport java.lang.reflect.Method;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport java.util.*;\n\npublic class PayloadMethodArgumentResolverFuzzer {\n    public static Class<?>[] classes = { DummyClass.class, Integer.class, String.class, Byte.class, List.class, Map.class,\n            TreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String payload = data.consumeString(200);\n        String headerName = data.consumeString(50);\n        String headerValue = data.consumeString(50);\n\n        Validator validator = new Validator() {\n            @Override\n            public boolean supports(Class<?> clazz) {\n                return true;\n            }\n\n            @Override\n            public void validate(Object target, Errors errors) {}\n        };\n\n        PayloadMethodArgumentResolver resolver = new PayloadMethodArgumentResolver(new StringMessageConverter(), validator);\n\n        Method method;\n        SynthesizingMethodParameter parameter;\n        Message<String> message;\n        try {\n            method = (data.pickValue(classes)).getDeclaredMethod(\"foo\", data.consumeBoolean() ? data.pickValue(classes) : null);\n            parameter = new SynthesizingMethodParameter(method, data.consumeInt(0, 100));\n            message = MessageBuilder.withPayload(payload)\n                    .setHeader(headerName, headerValue)\n                    .build();\n            message.getHeaders().get(headerName, data.pickValue(classes));\n        } catch (NoSuchMethodException | IllegalArgumentException ignored) {\n            return;\n        }\n\n        try {\n            Object result = resolver.resolveArgument(parameter, message);\n            if (!Objects.equals(result, payload)) {\n                throw new FuzzerSecurityIssueLow(\"Payload is different\");\n            }\n        } catch (MethodArgumentNotValidException ignored) {\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    public static class DummyClass {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList = Arrays.asList(1, 2, 3);\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n\n        public void foo(String dummy) {}\n    }\n}"
  },
  {
    "path": "projects/spring-framework/spring-oxm/XStreamMarshallerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.thoughtworks.xstream.XStreamException;\nimport com.thoughtworks.xstream.io.StreamException;\nimport org.junit.platform.commons.logging.LoggerFactory;\nimport org.springframework.oxm.xstream.XStreamMarshaller;\n\nimport javax.xml.transform.stream.StreamResult;\nimport javax.xml.transform.stream.StreamSource;\nimport java.io.*;\nimport java.util.*;\n\npublic class XStreamMarshallerFuzzer {\n\tpublic static Class<?>[] classes = { DummyClass.class, Integer.class, String.class, Byte.class, List.class, Map.class,\n\t\t\tTreeMap.class, BitSet.class, TimeZone.class, Date.class, Calendar.class, Locale.class };\n\n\tprivate static final PrintStream noopStream = new PrintStream(new OutputStream() {\n\t\t@Override\n\t\tpublic void write(int b) {}\n\t});\n\n\tpublic static void fuzzerInitialize() {\n\t\tSystem.setErr(noopStream);\n\t\tSystem.setOut(noopStream);\n\t}\n\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tXStreamMarshaller marshaller = new XStreamMarshaller();\n\n\t\tHashMap<String, Object> aliases = new HashMap<>();\n\t\tfor (int i = 0; i < data.consumeInt(0, 100); i++) {\n\t\t\taliases.put(data.consumeString(100), data.pickValue(classes));\n\t\t}\n\n\t\tif (data.consumeBoolean()) {\n\t\t\tmarshaller.setAliases(aliases);\n\t\t}\n\n\t\tif (data.consumeBoolean()) {\n\t\t\tmarshaller.supports(data.pickValue(classes));\n\t\t}\n\n\t\tif (data.consumeBoolean()) {\n\t\t\tmarshaller.setEncoding(data.consumeString(100));\n\t\t}\n\n\t\tbyte[] buffer = data.consumeBytes(1000);\n\t\tWriter writer = new StringWriter();\n\t\tReader reader = new StringReader(writer.toString());\n\n\t\t// Marshal & unmarshal\n\t\ttry {\n\t\t\tmarshaller.marshal(buffer, new StreamResult(writer));\n\t\t\tmarshaller.unmarshal(new StreamSource(reader));\n\t\t} catch (IOException | StreamException e) {}\n\t}\n\n\tpublic static class DummyClass {\n\t\tpublic TreeMap<String, Integer> _treeMap;\n\t\tpublic List<String> _arrayList;\n\t\tpublic Set<String> _hashSet;\n\t\tpublic Map<String, Object> _hashMap;\n\t\tpublic List<Integer> _asList = Arrays.asList(1, 2, 3);\n\t\tpublic int[] _intArray;\n\t\tpublic long[] _longArray;\n\t\tpublic short[] _shortArray;\n\t\tpublic float[] _floatArray;\n\t\tpublic double[] _doubleArray;\n\t\tpublic byte[] _byteArray;\n\t\tpublic char[] _charArray;\n\t\tpublic String[] _stringArray;\n\t\tpublic BitSet _bitSet;\n\t\tpublic Date _date;\n\t\tpublic TimeZone _timeZone;\n\t\tpublic Calendar _calendar;\n\t\tpublic Locale _locale;\n\t\tpublic Integer[] _integerArray;\n\t\tpublic boolean _boolean;\n\t\tpublic char _char;\n\t\tpublic byte _byte;\n\t\tpublic short _short;\n\t\tpublic int _int;\n\t\tpublic float _float;\n\n\t\tpublic void foo(String dummy) {}\n\t}\n}"
  },
  {
    "path": "projects/spring-framework/spring-tx/TransactionAttributeSourceEditorFuzzer.dict",
    "content": "\"PROPAGATION_REQUIRED\"\n\"PROPAGATION_SUPPORTS\"\n\"PROPAGATION_MANDATORY\"\n\"PROPAGATION_REQUIRES_NEW\"\n\"PROPAGATION_NOT_SUPPORTED\"\n\"PROPAGATION_NEVER\"\n\"PROPAGATION_NESTED\"\n\"ISOLATION_DEFAULT\"\n\"ISOLATION_READ_UNCOMMITTED\"\n\"ISOLATION_READ_COMMITTED\"\n\"ISOLATION_REPEATABLE_READ\"\n\"ISOLATION_SERIALIZABLE\"\n\"TIMEOUT_DEFAULT\"\n\"hashCode\"\n\"java.lang.Object\"\n"
  },
  {
    "path": "projects/spring-framework/spring-tx/TransactionAttributeSourceEditorFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport org.springframework.transaction.interceptor.TransactionAttribute;\nimport org.springframework.transaction.interceptor.TransactionAttributeEditor;\nimport org.springframework.transaction.interceptor.TransactionAttributeSource;\nimport org.springframework.transaction.interceptor.TransactionAttributeSourceEditor;\n\npublic class TransactionAttributeSourceEditorFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tString source = data.consumeRemainingAsString();\n\n\t\tTransactionAttributeSourceEditor editor = new TransactionAttributeSourceEditor();\n\t\ttry {\n\t\t\teditor.setAsText(source);\n\t\t} catch (IllegalArgumentException e) {}\n\n\t\tTransactionAttributeSource tas = (TransactionAttributeSource) editor.getValue();\n\t\tif (tas == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tTransactionAttribute ta = null;\n\t\ttry {\n\t\t\tta = tas.getTransactionAttribute(Object.class.getMethod(\"dummyMethod\"), null);\n\t\t} catch (NoSuchMethodException e) {}\n\n\t\tif (ta == null) {\n\t\t\treturn;\n\t\t}\n\t\tta.getPropagationBehavior();\n\t\tta.rollbackOn(new RuntimeException());\n\t}\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-web/ContentDispositionFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.http.ContentDisposition;\nimport org.springframework.util.Assert;\n\npublic class ContentDispositionFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String value = data.consumeRemainingAsString();\n        try {\n            ContentDisposition content = ContentDisposition.parse(value);\n        } catch (IllegalArgumentException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-web/CookieLocaleResolverFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport jakarta.servlet.http.Cookie;\nimport org.springframework.mock.web.MockHttpServletRequest;\nimport org.springframework.mock.web.MockHttpServletResponse;\nimport org.springframework.web.servlet.i18n.CookieLocaleResolver;\n\nimport java.util.Locale;\n\nimport static org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE_REQUEST_ATTRIBUTE_NAME;\n\npublic class CookieLocaleResolverFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tCookieLocaleResolver resolver = new CookieLocaleResolver();\n\t\tString cookieName = data.consumeString(100);\n\t\tif (cookieName.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tMockHttpServletRequest request = new MockHttpServletRequest();\n\t\trequest.setScheme(\"http\");\n\t\trequest.setServerName(\"localhost\");\n\t\trequest.setServerPort(data.consumeInt());\n\t\trequest.setRequestURI(data.consumeString(100));\n\t\trequest.setQueryString(data.consumeString(100));\n\t\trequest.removeAttribute(LOCALE_REQUEST_ATTRIBUTE_NAME);\n\n\n\t\tMockHttpServletResponse response = new MockHttpServletResponse();\n\t\tif (data.consumeBoolean()) {\n\t\t\ttry {\n\t\t\t\tresponse.setHeader(data.consumeString(50), data.consumeString(100));\n\t\t\t} catch (IllegalArgumentException ignored) {}\n\t\t}\n\n\t\ttry {\n\t\t\tif (data.consumeBoolean()) {\n\t\t\t\tLocale locale = new Locale(data.consumeString(50));\n\t\t\t\tresolver.setLocale(request, response, locale);\n\t\t\t}\n\n\t\t\tCookie cookie = new Cookie(data.consumeString(100), data.consumeString(500));\n\t\t\trequest.setCookies(cookie);\n\t\t\tresolver.resolveLocaleContext(request);\n\n\t\t} catch (IllegalArgumentException | IllegalStateException ignored) {}\n\t}\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-webflux/BindStatusFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.MessageSource;\nimport org.springframework.context.MessageSourceResolvable;\nimport org.springframework.context.NoSuchMessageException;\nimport org.springframework.context.i18n.LocaleContext;\nimport org.springframework.context.i18n.SimpleLocaleContext;\nimport org.springframework.http.codec.multipart.Part;\nimport org.springframework.http.server.reactive.ServerHttpRequest;\nimport org.springframework.http.server.reactive.ServerHttpResponse;\nimport org.springframework.mock.web.MockHttpServletRequest;\nimport org.springframework.util.MultiValueMap;\nimport org.springframework.web.reactive.result.view.BindStatus;\nimport org.springframework.web.reactive.result.view.RequestContext;\nimport org.springframework.web.server.ServerWebExchange;\nimport org.springframework.web.server.WebSession;\nimport org.springframework.beans.NotReadablePropertyException;\nimport java.security.Principal;\nimport java.time.Instant;\nimport java.util.*;\nimport java.util.function.Function;\nimport reactor.core.publisher.Mono;\nimport org.springframework.beans.InvalidPropertyException;\n\npublic class BindStatusFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\t\tMockHttpServletRequest request = new MockHttpServletRequest(\"\", \"\");\n\t\tMap<String, Object> objectMap = new HashMap<String, Object>();\n\n\t\tfor (int i = 0; i < data.consumeInt(0, 200); i++) {\n\t\t\tString name = data.consumeString(50);\n\t\t\tswitch (data.consumeInt(0, 3)) {\n\t\t\t\tcase 0 -> objectMap.put(name, data.consumeString(50));\n\t\t\t\tcase 1 -> objectMap.put(name, data.consumeInt());\n\t\t\t\tcase 2 -> objectMap.put(name, data.consumeBytes(100));\n\t\t\t\tcase 3 -> objectMap.put(name, data.consumeBoolean());\n\t\t\t}\n\t\t}\n\n\t\tRequestContext context = new RequestContext(new DummyWebExchange(), objectMap, new DummyMessage());\n\t\ttry {\n\t\t\tBindStatus bindStatus = new BindStatus(context, data.consumeString(100), data.consumeBoolean());\n\t\t\tbindStatus.getActualValue();\n\t\t\tbindStatus.getEditor();\n\t\t\tbindStatus.getDisplayValue();\n\t\t\tbindStatus.getErrors();\n\t\t\tbindStatus.getErrorMessages();\n\t\t\tbindStatus.getPath();\n\t\t} catch (IllegalStateException | InvalidPropertyException e) {}\n\t}\n\n\t// Mocked classes\n\tpublic static class DummyMessage implements MessageSource {\n\n\t\t@Override\n\t\tpublic String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\n\tpublic static class DummyWebExchange implements ServerWebExchange {\n\n\t\t@Override\n\t\tpublic ServerHttpRequest getRequest() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic ServerHttpResponse getResponse() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic Map<String, Object> getAttributes() {\n\t\t\treturn new HashMap<String, Object>() {{\n\t\t\t\tput(\"foo\", \"bar\");\n\t\t\t}};\n\t\t}\n\n\t\t@Override\n\t\tpublic Mono<WebSession> getSession() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic <T extends Principal> Mono<T> getPrincipal() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic Mono<MultiValueMap<String, String>> getFormData() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic Mono<MultiValueMap<String, Part>> getMultipartData() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic LocaleContext getLocaleContext() {\n\t\t\treturn new SimpleLocaleContext(new Locale(\"EN_us\"));\n\t\t}\n\n\t\t@Override\n\t\tpublic ApplicationContext getApplicationContext() {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isNotModified() {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean checkNotModified(Instant lastModified) {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean checkNotModified(String etag) {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean checkNotModified(String etag, Instant lastModified) {\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic String transformUrl(String url) {\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void addUrlTransformer(Function<String, String> transformer) {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic String getLogPrefix() {\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/spring-framework/spring-websocket/StompSubProtocolHandlerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport jakarta.websocket.Session;\nimport org.mockito.Mockito;\nimport org.springframework.context.ApplicationEventPublisher;\nimport org.springframework.messaging.MessageChannel;\nimport org.springframework.messaging.simp.stomp.StompDecoder;\nimport org.springframework.messaging.simp.stomp.StompEncoder;\nimport org.springframework.web.socket.*;\nimport org.springframework.web.socket.adapter.standard.StandardWebSocketSession;\nimport org.springframework.web.socket.messaging.StompSubProtocolHandler;\n\npublic class StompSubProtocolHandlerFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        StompSubProtocolHandler handler = new StompSubProtocolHandler();\n\n        handler.setDecoder(new StompDecoder());\n        handler.setEncoder(new StompEncoder());\n\n        DummyEventPublisher publisher = new DummyEventPublisher();\n        handler.setApplicationEventPublisher(publisher);\n\n        Session nativeSession = Mockito.mock(Session.class);\n        Mockito.when(nativeSession.getNegotiatedSubprotocol()).thenReturn(data.consumeString(100));\n\n        StandardWebSocketSession session = Mockito.mock(StandardWebSocketSession.class);\n        Mockito.when(session.isOpen()).thenReturn(data.consumeBoolean());\n        Mockito.when(session.getId()).thenReturn(data.consumeString(500));\n        Mockito.when(session.getAcceptedProtocol()).thenReturn(data.consumeString(500));\n        Mockito.when(session.getBinaryMessageSizeLimit()).thenReturn(data.consumeInt());\n        Mockito.when(session.getTextMessageSizeLimit()).thenReturn(data.consumeInt());\n\n        session.initializeNativeSession(nativeSession);\n\n        MessageChannel channel = Mockito.mock(MessageChannel.class);\n        Mockito.when(channel.send(Mockito.any())).thenReturn(data.consumeBoolean());\n\n        handler.afterSessionStarted(session, channel);\n\n        WebSocketMessage<?> message;\n        if (data.consumeBoolean()) {\n            message = new TextMessage(data.consumeBytes(1000));\n        } else {\n            message = new BinaryMessage(data.consumeBytes(1000));\n        }\n\n        try {\n            handler.handleMessageFromClient(session, message, channel);\n        } catch (IllegalStateException | IllegalArgumentException ignored) {}\n    }\n\n    public static class DummyEventPublisher implements ApplicationEventPublisher {\n\n        @Override\n        public void publishEvent(Object event) {}\n    }\n}\n"
  },
  {
    "path": "projects/spring-integration/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-integration spring-integration     # or use other version control\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/json.dict $SRC/SimpleJsonSerializerFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/SimpleJsonSerializerFuzzer_seed_corpus.zip go-fuzz-corpus/json/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nCOPY *.patch $SRC/\nWORKDIR spring-integration"
  },
  {
    "path": "projects/spring-integration/SimpleJsonSerializerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\n\nimport org.springframework.integration.json.SimpleJsonSerializer;\n\npublic class SimpleJsonSerializerFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        String string = data.consumeString(250);\n        String info = data.consumeRemainingAsString();\n\n        String json = SimpleJsonSerializer.toJson(string, info);\n    }\n}"
  },
  {
    "path": "projects/spring-integration/add-shadow.patch",
    "content": "diff --git a/build.gradle b/build.gradle\nindex 516e780..15d678d 100644\n--- a/build.gradle\n+++ b/build.gradle\n@@ -22,6 +22,7 @@ plugins {\n     id 'org.asciidoctor.jvm.pdf' version '3.3.2'\n     id 'org.asciidoctor.jvm.gems' version '3.3.2'\n     id 'org.asciidoctor.jvm.convert' version '3.3.2'\n+    id 'com.github.johnrengelman.shadow' version '7.1.2'\n }\n \n if (isCI) {\n@@ -495,6 +496,7 @@ project('spring-integration-core') {\n     description = 'Spring Integration Core'\n \n     apply plugin: 'org.jetbrains.dokka'\n+    apply plugin: 'com.github.johnrengelman.shadow'\n \n     dependencies {\n         api 'org.springframework:spring-aop'\n"
  },
  {
    "path": "projects/spring-integration/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\nJVM_LD_LIBRARY_PATH=\"${JAVA_HOME}/lib/server\"\n\n# Replace git patch with sed commands (patch no longer applies to latest code)\n# Add shadow plugin to root plugins block\nsed -i '/^plugins {/a\\    id \"com.gradleup.shadow\" version \"8.3.0\"' build.gradle\n# Apply shadow plugin to spring-integration-core subproject\nsed -i \"/description = 'Spring Integration Core'/a\\\\    apply plugin: 'com.gradleup.shadow'\" build.gradle\n\n./gradlew shadowJar -p spring-integration-core/ -x test -x javadoc\n\nCURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\ncp ./spring-integration-core/build/libs/spring-integration-core-$CURRENT_VERSION-all.jar $OUT/spring-integration-core.jar\n\nALL_JARS=\"spring-integration-core.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-integration/project.yaml",
    "content": "homepage: \"https://spring.io/projects/spring-integration\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-integration.git\"\nprimary_contact: \"pwebb@vmware.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-ldap/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm:ubuntu-24-04\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-ldap.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/spring-ldap"
  },
  {
    "path": "projects/spring-ldap/LdapQueryBuilderFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.ldap.InvalidNameException;\n\nimport static org.springframework.ldap.query.LdapQueryBuilder.query;\nimport org.springframework.ldap.query.LdapQuery;\nimport org.springframework.ldap.query.SearchScope;\n\n\npublic class LdapQueryBuilderFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try {\n            LdapQuery query = query()\n\t\t\t\t.base(data.consumeString(100))\n\t\t\t\t.searchScope(SearchScope.ONELEVEL)\n\t\t\t\t.timeLimit(30)\n\t\t\t\t.countLimit(60)\n\t\t\t\t.where(data.consumeString(100))\n                .is(data.consumeString(100))\n                .and(data.consumeString(100))\n                .is(data.consumeRemainingAsString());\n        } catch (InvalidNameException e) {\n\n        }\n    }\n}"
  },
  {
    "path": "projects/spring-ldap/build.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\ncat > add-shadow.diff <<- EOM\ndiff --git a/core/build.gradle b/core/build.gradle\nindex d6119e9..1ffa9a1 100644\n--- a/core/build.gradle\n+++ b/core/build.gradle\n@@ -1,6 +1,7 @@\n plugins {\n     id 'io.spring.convention.spring-module'\n     id 'com.intershop.gradle.javacc'\n+    id 'com.github.johnrengelman.shadow' version '7.0.0'\n }\n\n javacc {\n@@ -54,4 +55,4 @@ compileTestJava {\n\n test {\n     jvmArgs '--add-exports', 'java.naming/com.sun.jndi.ldap=ALL-UNNAMED'\n-}\n\\ No newline at end of file\n+}\nEOM\n\ngit apply add-shadow.diff\n\n./gradlew shadowJar -p core -x test -x javadoc -x :checkstyleNohttp\nCURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\ncp \"core/build/libs/spring-ldap-core-$CURRENT_VERSION-all.jar\" \"$OUT/spring-ldap-core.jar\"\n\nALL_JARS=\"spring-ldap-core.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-ldap/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/spring-projects/spring-ldap.git\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-ldap.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-retry/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/google/fuzzing\n\nRUN git clone https://github.com/spring-projects/spring-retry.git && git -C ./spring-retry checkout v1.3.3\n\nCOPY build.sh $SRC/\nCOPY PatternMatcher_match_Fuzzer.java $SRC/\nWORKDIR $SRC/spring-retry"
  },
  {
    "path": "projects/spring-retry/PatternMatcher_match_Fuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\n\nimport org.springframework.classify.PatternMatcher;\n\nimport java.util.*;\nimport java.lang.*;\n\npublic class PatternMatcher_match_Fuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    if (data.remainingBytes() < 2)\n      return;\n\n    String pattern = data.consumeString(data.consumeInt(0, 1000));\n    String str     = data.consumeString(data.consumeInt(0, 1000));\n\n    // Fill the hash map with things\n    Map<String, Integer> map = new HashMap<String, Integer>();\n    while (data.remainingBytes() > 0) {\n        String key = data.consumeString(data.consumeInt(0, 1000));\n        Integer val = data.consumeInt(0, 255);\n        map.putIfAbsent(key, val);\n    }\n\n    PatternMatcher pm = new PatternMatcher(map);\n    pm.match(pattern, str);\n  }\n}\n"
  },
  {
    "path": "projects/spring-retry/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nMVNW=./mvnw\n\nsed -i \"s/<java.version>1.6<\\/java.version>/<java.version>1.7<\\/java.version>/g\" pom.xml\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nJVM_LD_LIBRARY_PATH=\"${JAVA_HOME}/lib/server\"\n\n# Build the target jar.\nCURRENT_VERSION=$(${MVNW} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n\t\t      -Dexpression=project.version -q -DforceStdout)\n${MVNW} package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade -Dmaven.test.skip=true\ncp \"target/spring-retry-$CURRENT_VERSION.jar\" $OUT/spring-retry.jar\n\n# The jar files containing the project (separated by spaces).\nPROJECT_JARS=spring-retry.jar\n\n# Get the fuzzer dependencies (gson).\n${MVNW} dependency:copy -Dartifact=com.google.code.gson:gson:2.8.6 -DoutputDirectory=$OUT/\n\n# The jar files containing further dependencies of the fuzz targets (separated\n# by spaces).\nFUZZER_JARS=gson-2.8.6.jar\n\n# Build fuzzers in $OUT.\nALL_JARS=\"$PROJECT_JARS $FUZZER_JARS\"\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All jars and class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):.:\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create execution wrapper.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/spring-retry/project.yaml",
    "content": "homepage: \"https://ci.spring.io/teams/spring-retry/pipelines/spring-retry-2.0.x\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-retry.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-security/BCryptPasswordEncoderFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.springframework.security.crypto.bcrypt.BCrypt;\nimport org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;\n\npublic class BCryptPasswordEncoderFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        BCryptPasswordEncoder.BCryptVersion bCryptVersion = data.pickValue(new BCryptPasswordEncoder.BCryptVersion[]\n                {BCryptPasswordEncoder.BCryptVersion.$2A, BCryptPasswordEncoder.BCryptVersion.$2B, BCryptPasswordEncoder.BCryptVersion.$2Y});\n\n        BCryptPasswordEncoder encoder;\n        try {\n            if (data.consumeBoolean()) {\n                encoder = new BCryptPasswordEncoder(bCryptVersion);\n            } else {\n                // using MAX_LOG_ROUNDS will slow down the fuzz test\n                encoder = new BCryptPasswordEncoder(bCryptVersion, data.consumeInt(-1, 10));\n            }\n        } catch (IllegalArgumentException ignored) {\n            return;\n        }\n\n        String password = data.consumeRemainingAsString();\n        if (password.isEmpty()) {\n            return;\n        }\n\n        String result = encoder.encode(password);\n        if (!encoder.matches(password, result)) {\n            throw new FuzzerSecurityIssueHigh(\"Password `\" + password + \"` does not match encoded one `\" + result + \"`\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/spring-security/BindAuthenticatorFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.springframework.security.ldap.DefaultSpringSecurityContextSource;\nimport org.springframework.security.ldap.SpringSecurityLdapTemplate;\nimport org.springframework.ldap.core.ContextSource;\nimport org.springframework.ldap.core.LdapTemplate;\nimport org.springframework.security.ldap.authentication.BindAuthenticator;\nimport org.springframework.security.authentication.UsernamePasswordAuthenticationToken;\nimport org.springframework.security.core.SpringSecurityMessageSource;\nimport org.springframework.ldap.core.AuthenticationSource;\nimport com.unboundid.ldap.listener.InMemoryDirectoryServer;\nimport com.unboundid.ldap.listener.InMemoryDirectoryServerConfig;\nimport com.unboundid.ldap.listener.InMemoryListenerConfig;\nimport com.unboundid.ldap.sdk.DN;\nimport com.unboundid.ldap.sdk.Entry;\nimport com.unboundid.ldap.sdk.LDAPException;\nimport com.unboundid.ldif.LDIFReader;\nimport org.springframework.security.ldap.server.UnboundIdContainer;\nimport org.springframework.ldap.core.DirContextOperations;\nimport org.springframework.security.authentication.BadCredentialsException;\n\npublic class BindAuthenticatorFuzzer {\n    private static InMemoryDirectoryServer directoryServer;\n\n    public static void fuzzerTearDown() {\n        if (directoryServer instanceof InMemoryDirectoryServer) {\n            directoryServer.shutDown(true);\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String username = data.consumeString(100);\n        String password = data.consumeRemainingAsString();\n\n        if (username.isEmpty() || password.isEmpty() || (username.equals(\"admin\") && password.equals(\"secret\"))) {\n            return;\n        }\n\n        if (directoryServer instanceof InMemoryDirectoryServer) {\n            directoryServer.shutDown(true);\n        }\n\n        createInMemoryLdapServer();\n\n        DefaultSpringSecurityContextSource context = new DefaultSpringSecurityContextSource(\"ldap://localhost:1234/dc=springframework,dc=org\");\n        context.setUserDn(\"uid=admin,ou=system\");\n        context.setPassword(\"secret\");\n        context.afterPropertiesSet();\n\n        BindAuthenticator authenticator = new BindAuthenticator(context);\n        authenticator.setUserDnPatterns(new String[] { \"uid={0},ou=people\" });\n        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);\n        DirContextOperations user = null;\n\n        try {\n            user = authenticator.authenticate(token);\n        } catch (BadCredentialsException e) {\n            // BadCredentialsException is expected here\n        } finally {\n            if (user != null) {\n                throw new FuzzerSecurityIssueHigh(\"Invalid user `\" + username + \"` could authenticate\");\n            }\n        }\n    }\n\n    private static void createInMemoryLdapServer() {\n        String defaultPartitionName = \"dc=springframework,dc=org\";\n        try {\n            InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(defaultPartitionName);\n            config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig(\"LDAP\", 1234));\n            config.setEnforceSingleStructuralObjectClass(false);\n            config.setEnforceAttributeSyntaxCompliance(true);\n            Entry dc = new Entry(new DN(\"dc=springframework,dc=org\"));\n            dc.addAttribute(\"objectClass\", \"top\", \"domain\", \"extensibleObject\");\n            dc.addAttribute(\"dc\", \"springframework\");\n            dc.addAttribute(\"ou\", \"people\");\n\n            Entry ou = new Entry(new DN(\"ou=people,dc=springframework,dc=org\"));\n            ou.addAttribute(\"objectClass\", \"organizationalUnit\");\n            ou.addAttribute(\"ou\", \"people\");\n\n            Entry cn = new Entry(new DN(\"uid=admin,ou=people,dc=springframework,dc=org\"));\n            cn.addAttribute(\"objectClass\", \"person\");\n            cn.addAttribute(\"objectClass\", \"inetOrgPerson\");\n            cn.addAttribute(\"cn\", \"Adm\");\n            cn.addAttribute(\"sn\", \"In\");\n            cn.addAttribute(\"uid\", \"admin\");\n            cn.addAttribute(\"userPassword\", \"secret\");\n            directoryServer = new InMemoryDirectoryServer(config);\n\n            directoryServer.add(dc);\n            directoryServer.add(ou);\n            directoryServer.add(cn);\n            directoryServer.startListening();\n        } catch (LDAPException e) {\n            e.printStackTrace();\n        }\n    }\n} "
  },
  {
    "path": "projects/spring-security/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-security\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nCOPY oauth2-core/*Fuzzer.java $SRC/\nCOPY oauth2-client/*Fuzzer.java $SRC/\nCOPY oauth2-jose/*Fuzzer.java $SRC/\nCOPY acl/*Fuzzer.java $SRC/\nCOPY *.patch $SRC/\nRUN  cd spring-security && (for i in ${SRC}/*.patch; do tr -d '\\015' < $i | git apply; done )\n\nWORKDIR $SRC/spring-security"
  },
  {
    "path": "projects/spring-security/EncodingUtilsConcatenateFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.security.crypto.util.EncodingUtils;\n\npublic class EncodingUtilsConcatenateFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        final byte[][] arrayOfByteArrays = getArrayOfByteArrays(data);\n\n        EncodingUtils.concatenate(arrayOfByteArrays);\n    }\n\n    // Constants to reduce cases of fuzzer running out of memory\n    private final static int MIN_OUTER_LENGTH = 500;\n    private final static int MAX_OUTER_LENGTH = 1000;\n    private final static int MIN_INNER_LENGTH = 320;\n    private final static int MAX_INNER_LENGTH = 700;\n\n    private static byte[][] getArrayOfByteArrays(FuzzedDataProvider data) {\n        final int numberOfArrays = data.consumeInt(MIN_OUTER_LENGTH, MAX_OUTER_LENGTH);\n        byte[][] arrayOfArrays = new byte[numberOfArrays][];\n\n        for (int i=0; i<numberOfArrays; i++) {\n            arrayOfArrays[i] = data.consumeBytes(data.consumeInt(MIN_INNER_LENGTH, MAX_INNER_LENGTH));\n        }\n\n        return arrayOfArrays;\n    }\n}\n"
  },
  {
    "path": "projects/spring-security/HexFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport java.lang.CharSequence;\n\nimport org.springframework.security.crypto.codec.Hex;\n\npublic class HexFuzzer {\n    public static void fuzzerTestOneInput(byte[] data) {\n        final byte[] initialByteArray = data;\n        final char[] encodedChars;\n\n        try {\n            encodedChars = Hex.encode(initialByteArray);\n\n            if (! initialByteArray.toString().equals(Hex.decode(encodedChars.toString()))) {\n                throw new FuzzerSecurityIssueLow(\"Hex value has changed during encoding and decoding\");\n            }\n        } catch (IllegalArgumentException err) {\n            // ignore expected exceptions\n        }\n    }\n}\n"
  },
  {
    "path": "projects/spring-security/InMemoryUserDetailsManagerChangePasswordFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\n\nimport java.util.List;\n\nimport org.springframework.security.access.AccessDeniedException;\nimport org.springframework.security.authentication.UsernamePasswordAuthenticationToken;\nimport org.springframework.security.core.GrantedAuthority;\nimport org.springframework.security.core.authority.AuthorityUtils;\nimport org.springframework.security.core.context.SecurityContextHolder;\nimport org.springframework.security.core.userdetails.User;\nimport org.springframework.security.core.userdetails.UsernameNotFoundException;\nimport org.springframework.security.provisioning.InMemoryUserDetailsManager;\n\npublic class InMemoryUserDetailsManagerChangePasswordFuzzer {\n    private final static String USERNAME = \"admin\";\n    private final static String PASSWORD = \"secret\";\n    private final static String USER_ROLE = \"ADMIN\";\n    private static final List<GrantedAuthority> AUTHORITIES = AuthorityUtils.createAuthorityList(USER_ROLE);\n\n    private final static int LENGTH_PASSWORD = 500;\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        // generating needed objects\n        final String generatedPassword01 = data.consumeString(LENGTH_PASSWORD);\n        final String generatedPassword02 = data.consumeRemainingAsString();\n\n        // check if the fuzzer generated useful data\n        if (generatedPassword01.equals(PASSWORD) || generatedPassword02.equals(PASSWORD)) {\n            return;\n        }\n\n        // create all the objects needed for fuzzing the InMemoryUserDetailsManager\n        final User user = new User(USERNAME, PASSWORD, AUTHORITIES);\n        final InMemoryUserDetailsManager userDetailsManager = new InMemoryUserDetailsManager(user);\n\n        // set the SecurityContext\n        // this makes it so that InMemoryUserDetailsManager.changePassword(old, new) never actually checks the old password\n        SecurityContextHolder.getContext().setAuthentication(\n            UsernamePasswordAuthenticationToken.authenticated(USERNAME, PASSWORD, AUTHORITIES));\n\n        try {\n            userDetailsManager.changePassword(generatedPassword01, generatedPassword02);\n\n            // check if the password was successfully changed\n            final String finalPassword = userDetailsManager.loadUserByUsername(USERNAME).getPassword();\n            if (PASSWORD.equals(finalPassword)) {\n                throw new FuzzerSecurityIssueHigh(\"Password was not changed to '\" + finalPassword + \"'\");\n            }\n        } catch (UsernameNotFoundException err) {\n            throw new FuzzerSecurityIssueLow(\"The user disappeared from the InMemoryUserDetailsManager\");\n        } catch (AccessDeniedException problem) {\n            // should not be thrown anymore\n            problem.printStackTrace();\n            throw problem;\n        }\n    }\n\n    public static void fuzzerTearDown() {\n        SecurityContextHolder.clearContext();\n    }\n}\n"
  },
  {
    "path": "projects/spring-security/StrictHttpFirewallFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.springframework.mock.web.MockHttpServletResponse;\nimport org.springframework.http.HttpMethod;\nimport org.springframework.mock.web.MockHttpServletRequest;\nimport org.springframework.security.web.firewall.StrictHttpFirewall;\nimport org.springframework.security.web.firewall.RequestRejectedException;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\nimport java.util.function.Predicate;\nimport java.util.Enumeration;\nimport java.util.regex.Pattern;\nimport java.util.regex.Matcher;\nimport java.util.ArrayList;\nimport java.util.List;\nimport jakarta.servlet.http.HttpServletRequest;\nimport java.math.BigInteger;\nimport java.nio.charset.StandardCharsets;\nimport java.lang.IllegalStateException;\n\npublic class StrictHttpFirewallFuzzer {\n    record Header(String n, String v) {};\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) throws Exception {\n        StrictHttpFirewall firewall = new StrictHttpFirewall();\n\t    MockHttpServletRequest request = new MockHttpServletRequest(\"GET\", \"\");\n\n        boolean invalidMethod = data.consumeBoolean();\n\n        if (invalidMethod) {\n            request.setMethod(data.consumeString(50));\n        }\n\n        List<Header> maliciousHeaders = new ArrayList<Header>();\n        List<String> maliciousParameterNames = new ArrayList<String>();\n        List<String> maliciousUrls = new ArrayList<String>();\n\n        // Feed fuzzer data into the request\n        for (int i = 0; i < data.consumeInt(1, 5); i++) {\n            String url = data.consumeString(400);\n            switch (data.consumeInt(0, 5)) {\n                case 0:\n                    request.setPathInfo(url);\n                    maliciousUrls.add(url);\n                    break;\n                case 1:\n                    request.setContextPath(url);\n                    maliciousUrls.add(url);\n                    break;\n                case 2:\n                    request.setRequestURI(url);\n                    maliciousUrls.add(url);\n                    break;\n                case 3:\n                    request.setServletPath(url);\n                    maliciousUrls.add(url);\n                    break;\n                case 4:\n                    String parameterName = data.consumeString(100);\n                    if (parameterName.isEmpty()) {\n                        break;\n                    }\n                    request.addParameter(parameterName, \"Dummy value\");\n                    maliciousParameterNames.add(parameterName);\n                    break;\n                case 5:\n                    Header header = new Header(data.consumeString(100), data.consumeString(100));\n                    if (header.v().isEmpty() || header.n().isEmpty()) {\n                        break;\n                    }\n                    request.addHeader(header.n(), header.v());\n                    maliciousHeaders.add(header);\n            }\n        }\n\n        HttpServletRequest servletRequest;\n        try {\n            servletRequest = firewall.getFirewalledRequest(request);\n\n            // getHeader() and getParameter() should throw a rejection exception if it contains invalid chars\n            for (Header header : maliciousHeaders) {\n                servletRequest.getHeader(header.n());\n            }\n\n            for (String parameterName : maliciousParameterNames) {\n                servletRequest.getParameter(parameterName);\n            }\n\n        } catch (RequestRejectedException | IllegalStateException e) {\n            return;\n        }\n\n        for (String forbiddenChar : firewall.getEncodedUrlBlocklist()) {\n            if (request.getPathInfo() != null && request.getPathInfo().contains(forbiddenChar)\n                || request.getRequestURI() != null && request.getRequestURI().contains(forbiddenChar)\n                || request.getContextPath() != null && request.getContextPath().contains(forbiddenChar)\n                || request.getServletPath() != null && request.getServletPath().contains(forbiddenChar)) {\n                throw new FuzzerSecurityIssueMedium(\"Malicious char not filtered: \" + forbiddenChar);\n            }\n        }\n\n        for (Header header : maliciousHeaders) {\n            validate(header.n());\n            String v = servletRequest.getHeader(header.n());\n            validate(v);\n        }\n\n        for (String name : maliciousParameterNames) {\n            validate(name);\n        }\n    }\n\n    // Check for invalid chars\n    // https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/web/firewall/StrictHttpFirewall.html#setAllowedHeaderNames(java.util.function.Predicate)\n    private static void validate(String value) {\n        for (char c : value.toCharArray()) {\n            if (Character.isISOControl(c) || !Character.isDefined(c)) {\n                throw new FuzzerSecurityIssueMedium(\"Malicious char not filtered: \\\\x\" + String.format(\"%04x\", (int) c) + \" in `\" + value + \"`\");\n            }\n        }\n    }\n} \n"
  },
  {
    "path": "projects/spring-security/Utf8Fuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport java.lang.CharSequence;\n\nimport org.springframework.security.crypto.codec.Utf8;\n\npublic class Utf8Fuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        final String initialString = data.consumeString(Integer.MAX_VALUE);\n        final byte[] encodedBytes;\n\n        try {\n            encodedBytes = Utf8.encode(initialString);\n\n            if (! initialString.equals(Utf8.decode(encodedBytes))) {\n                throw new FuzzerSecurityIssueLow(\"Utf8 value has changed during encoding and decoding\");\n            }\n        } catch (IllegalArgumentException err) {\n            // ignore expected exceptions\n        }\n    }\n}\n"
  },
  {
    "path": "projects/spring-security/acl/AclFormattingUtilsFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.security.acls.domain.AclFormattingUtils;\n\n\n\npublic class AclFormattingUtilsFuzzer {\n\n     public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        String origin;\n        String bits;\n        int mask;\n        char code;\n        char off;\n\n        mask = data.consumeInt();\n        code = data.consumeChar();\n        origin = data.consumeString(250);\n        bits = data.consumeRemainingAsString();\n\n        String printBinary1;\n        String printBinary2;\n        String mergePatterns;\n        String demergePatterns;\n        try {\n            printBinary1 = AclFormattingUtils.printBinary(mask);\n            printBinary2 = AclFormattingUtils.printBinary(mask, code);\n            mergePatterns = AclFormattingUtils.mergePatterns(origin, bits);\n            demergePatterns = AclFormattingUtils.demergePatterns(origin, bits);\n        }\n        catch(IllegalArgumentException iae) {\n\n        }\n    }\n\n}\n"
  },
  {
    "path": "projects/spring-security/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\nCURRENT_VERSION=$(sed -nr \"s/^version=(.*)/\\1/p\" gradle.properties)\n\nGRADLE_ARGS=\"-x test -x javadoc\"\n\n./gradlew shadowJar $GRADLE_ARGS -b ldap/spring-security-ldap.gradle\n./gradlew shadowJar $GRADLE_ARGS -b config/spring-security-config.gradle\n./gradlew shadowJar $GRADLE_ARGS -b core/spring-security-core.gradle\n./gradlew build -b dependencies/spring-security-dependencies.gradle\n./gradlew shadowJar $GRADLE_ARGS -b messaging/spring-security-messaging.gradle\n./gradlew shadowJar $GRADLE_ARGS -b web/spring-security-web.gradle\n./gradlew shadowJar $GRADLE_ARGS -b test/spring-security-test.gradle\n./gradlew shadowJar $GRADLE_ARGS -b oauth2/oauth2-core/spring-security-oauth2-core.gradle\n./gradlew shadowJar $GRADLE_ARGS -b acl/spring-security-acl.gradle\n./gradlew shadowJar $GRADLE_ARGS -b oauth2/oauth2-client/spring-security-oauth2-client.gradle\n./gradlew shadowJar $GRADLE_ARGS -b oauth2/oauth2-jose/spring-security-oauth2-jose.gradle\n\n# Copy all shadow jars to the $OUT folder\nfind . -name \"*-all.jar\" -print0 | while read -d $'\\0' file\ndo\n    file_name=`echo $file | sed \"s/-$CURRENT_VERSION-all//g\" | egrep \"[^\\/]*.jar\" -o`\n    cp $file $OUT/$file_name\ndone\n\nALL_JARS=`ls $OUT/*.jar -I jazzer_agent_deploy.jar -1 | tr \"\\n\" \" \" | egrep \"[^\\/]*.jar\" -o`\n\n# The class path at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/[$fuzzer_basename]*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--instrumentation_excludes=com.unboundid.ldap.**:org.springframework.ldap.** \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\ncp $SRC/StrictHttpFirewallFuzzer\\$Header.class $OUT/\n"
  },
  {
    "path": "projects/spring-security/diff.patch",
    "content": "diff --git a/acl/spring-security-acl.gradle b/acl/spring-security-acl.gradle\nindex 976d8d4..f01b423 100644\n--- a/acl/spring-security-acl.gradle\n+++ b/acl/spring-security-acl.gradle\n@@ -1,3 +1,4 @@\n+apply plugin: \"com.github.johnrengelman.shadow\"\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\ndiff --git a/build.gradle b/build.gradle\nindex 21893a7..faf7dff 100644\n--- a/build.gradle\n+++ b/build.gradle\n@@ -4,6 +4,7 @@ import trang.RncToXsd\n buildscript {\n \tdependencies {\n \t\tclasspath libs.io.spring.javaformat.spring.javaformat.gradle.plugin\n+\t\tclasspath \"gradle.plugin.com.github.johnrengelman:shadow:7.1.2\"\n \t\tclasspath libs.io.spring.nohttp.nohttp.gradle\n \t\tclasspath libs.io.freefair.gradle.aspectj.plugin\n \t\tclasspath libs.org.jetbrains.kotlin.kotlin.gradle.plugin\n@@ -18,6 +19,7 @@ plugins {\n \talias(libs.plugins.org.gradle.wrapper.upgrade)\n }\n \n+apply plugin: 'com.github.johnrengelman.shadow'\n apply plugin: 'io.spring.nohttp'\n apply plugin: 'locks'\n apply plugin: 'io.spring.convention.root'\ndiff --git a/config/spring-security-config.gradle b/config/spring-security-config.gradle\nindex 7818f34..4ef9150 100644\n--- a/config/spring-security-config.gradle\n+++ b/config/spring-security-config.gradle\n@@ -1,5 +1,6 @@\n import org.springframework.gradle.xsd.CreateVersionlessXsdTask\n import trang.RncToXsd\n \n+apply plugin: 'com.github.johnrengelman.shadow'\n apply plugin: 'io.spring.convention.spring-module'\n apply plugin: 'trang'\ndiff --git a/core/spring-security-core.gradle b/core/spring-security-core.gradle\nindex 2968d3d..9a1be67 100644\n--- a/core/spring-security-core.gradle\n+++ b/core/spring-security-core.gradle\n@@ -3,6 +3,7 @@ import java.util.concurrent.Callable\n plugins {\n \tid 'security-nullability'\n }\n+apply plugin: 'com.github.johnrengelman.shadow'\n \n apply plugin: 'io.spring.convention.spring-module'\n apply plugin: 'security-kotlin'\ndiff --git a/data/spring-security-data.gradle b/data/spring-security-data.gradle\nindex 3e915ef..1b4d55b 100644\n--- a/data/spring-security-data.gradle\n+++ b/data/spring-security-data.gradle\n@@ -2,6 +2,7 @@ plugins {\n \tid 'security-nullability'\n }\n \n+apply plugin: 'com.github.johnrengelman.shadow'\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\ndiff --git a/dependencies/spring-security-dependencies.gradle b/dependencies/spring-security-dependencies.gradle\nindex fb306f6..b27cd44 100644\n--- a/dependencies/spring-security-dependencies.gradle\n+++ b/dependencies/spring-security-dependencies.gradle\n@@ -4,6 +4,8 @@ plugins {\n javaPlatform {\n \tallowDependencies()\n }\n+\n+apply plugin: \"com.github.johnrengelman.shadow\"\n \n dependencies {\n \tif (project.hasProperty(\"isOverrideVersionCatalog\")) {\ndiff --git a/ldap/spring-security-ldap.gradle b/ldap/spring-security-ldap.gradle\nindex c4f6c08..39023ed 100644\n--- a/ldap/spring-security-ldap.gradle\n+++ b/ldap/spring-security-ldap.gradle\n@@ -1,3 +1,4 @@\n+apply plugin: 'com.github.johnrengelman.shadow'\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\n@@ -10,7 +11,7 @@ dependencies {\n \n \toptional 'com.fasterxml.jackson.core:jackson-databind'\n \toptional 'ldapsdk:ldapsdk'\n-\toptional \"com.unboundid:unboundid-ldapsdk\"\n+\tapi \"com.unboundid:unboundid-ldapsdk\"\n \toptional 'tools.jackson.core:jackson-databind'\n \tapi ('org.springframework.ldap:spring-ldap-core') {\n \t\texclude(group: 'commons-logging', module: 'commons-logging')\ndiff --git a/messaging/spring-security-messaging.gradle b/messaging/spring-security-messaging.gradle\nindex 64435e6..9f8526f 100644\n--- a/messaging/spring-security-messaging.gradle\n+++ b/messaging/spring-security-messaging.gradle\n@@ -2,6 +2,7 @@ plugins {\n \tid 'security-nullability'\n }\n \n+apply plugin: 'com.github.johnrengelman.shadow'\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\ndiff --git a/oauth2/oauth2-client/spring-security-oauth2-client.gradle b/oauth2/oauth2-client/spring-security-oauth2-client.gradle\nindex 0666a90..94c14cd 100644\n--- a/oauth2/oauth2-client/spring-security-oauth2-client.gradle\n+++ b/oauth2/oauth2-client/spring-security-oauth2-client.gradle\n@@ -1,3 +1,4 @@\n+apply plugin: \"com.github.johnrengelman.shadow\"\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\ndiff --git a/oauth2/oauth2-core/spring-security-oauth2-core.gradle b/oauth2/oauth2-core/spring-security-oauth2-core.gradle\nindex 9fb4449..101532c 100644\n--- a/oauth2/oauth2-core/spring-security-oauth2-core.gradle\n+++ b/oauth2/oauth2-core/spring-security-oauth2-core.gradle\n@@ -1,3 +1,4 @@\n+apply plugin: 'com.github.johnrengelman.shadow'\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\ndiff --git a/oauth2/oauth2-jose/spring-security-oauth2-jose.gradle b/oauth2/oauth2-jose/spring-security-oauth2-jose.gradle\nindex 8290b85..c177be4 100644\n--- a/oauth2/oauth2-jose/spring-security-oauth2-jose.gradle\n+++ b/oauth2/oauth2-jose/spring-security-oauth2-jose.gradle\n@@ -1,3 +1,4 @@\n+apply plugin: \"com.github.johnrengelman.shadow\"\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\ndiff --git a/test/spring-security-test.gradle b/test/spring-security-test.gradle\nindex 92b3868..b24d835 100644\n--- a/test/spring-security-test.gradle\n+++ b/test/spring-security-test.gradle\n@@ -2,6 +2,7 @@ plugins {\n \tid 'security-nullability'\n }\n \n+apply plugin: \"com.github.johnrengelman.shadow\"\n apply plugin: 'io.spring.convention.spring-module'\n \n dependencies {\ndiff --git a/web/spring-security-web.gradle b/web/spring-security-web.gradle\nindex ca63924..45aea6f 100644\n--- a/web/spring-security-web.gradle\n+++ b/web/spring-security-web.gradle\n@@ -2,6 +2,7 @@ plugins {\n \tid 'security-nullability'\n }\n \n+apply plugin: 'com.github.johnrengelman.shadow'\n apply plugin: 'io.spring.convention.spring-module'\n \n configurations {\n@@ -50,7 +51,7 @@ dependencies {\n \toptional 'tools.jackson.core:jackson-databind'\n \toptional libs.webauthn4j.core\n \n-\tprovided 'jakarta.servlet:jakarta.servlet-api'\n+\tapi 'jakarta.servlet:jakarta.servlet-api'\n \n \ttestImplementation project(path: ':spring-security-core', configuration: 'tests')\n \ttestImplementation 'io.projectreactor:reactor-test'\n"
  },
  {
    "path": "projects/spring-security/oauth2-client/ClientRegistrationFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.security.oauth2.client.registration.ClientRegistration;\nimport org.springframework.security.oauth2.client.registration.ClientRegistration.ProviderDetails;\nimport org.springframework.security.oauth2.core.ClientAuthenticationMethod;\nimport org.springframework.security.oauth2.core.AuthenticationMethod;\nimport org.springframework.security.oauth2.core.AuthorizationGrantType;\n\nimport java.util.Collections;\nimport java.util.LinkedHashMap;\nimport java.util.stream.Stream;\nimport java.util.Map;\nimport java.util.Set;\n\npublic class ClientRegistrationFuzzer {\n\n     public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        \n        String registration = \"registration-1\";\n        String scope = \"email\";\n        String clientName = \"Client 1\";\n        String clientId = \"client-1\";\n        String clientSecret = \"secret\";\n        String uri = \"https://example.com\";\n        String config = \"config-1\";\n        String value = \"value-1\";\n\n        int switchInput = data.consumeInt(0,7);\n        switch(switchInput) {\n            case 0 : \n                registration = data.consumeRemainingAsString();\n                break;\n            case 1 :\n                scope = data.consumeRemainingAsString();\n                break;\n            case 2 :\n                clientName = data.consumeRemainingAsString();\n                break;\n            case 3 :\n                clientId = data.consumeRemainingAsString();\n                break;\n            case 4 :\n                clientSecret = data.consumeRemainingAsString();\n                break;\n            case 5 :\n                uri = data.consumeRemainingAsString();\n                break;\n            case 6 :\n                config = data.consumeRemainingAsString();\n                break;\n            case 7 :\n                value = data.consumeRemainingAsString();\n                break;\n        }\n\n        Map<String, Object> configurationMetadata = new LinkedHashMap<>();\n            configurationMetadata.put(config, value);\n        Map<String, Object> PROVIDER_CONFIGURATION_METADATA = Collections\n            .unmodifiableMap(configurationMetadata);\n\n        ClientRegistration clientRegistration = null;\n        try {\n            clientRegistration = ClientRegistration.withRegistrationId(registration)\n                .clientId(clientId)\n                .clientSecret(clientSecret)\n                .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC)\n                .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)\n                .redirectUri(uri)\n                .scope(scope)\n                .authorizationUri(uri)\n                .tokenUri(uri)\n                .userInfoAuthenticationMethod(AuthenticationMethod.HEADER)\n                .issuerUri(uri)\n                .providerConfigurationMetadata(null)\n                .jwkSetUri(uri)\n                .clientName(clientName)\n                .build();\n\n            ProviderDetails pd = clientRegistration.getProviderDetails();\n        }\n        catch (IllegalArgumentException iae){}\n\n    }\n\n}\n"
  },
  {
    "path": "projects/spring-security/oauth2-core/OAuth2AccessTokenFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.security.oauth2.core.OAuth2AccessToken;\n\nimport java.time.Instant;\nimport java.util.Arrays;\nimport java.util.LinkedHashSet;\nimport java.util.Set;\n\npublic class OAuth2AccessTokenFuzzer {\n\n    private static final OAuth2AccessToken.TokenType TOKEN_TYPE = OAuth2AccessToken.TokenType.BEARER;\n    private static final Instant ISSUED_AT = Instant.now();\n    private static final Instant EXPIRES_AT = Instant.from(ISSUED_AT).plusSeconds(60);\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        Set<String> scope;\n        String tmpScope;\n        String value;\n        boolean proceed = true;\n        OAuth2AccessToken accessToken = null;\n\n        boolean isScope = data.consumeBoolean();\n        if (isScope) {\n\n            tmpScope = data.consumeString(250);\n            value = data.consumeString(250);\n\n            scope = new LinkedHashSet<>(Arrays.asList(tmpScope));\n            try {\n                accessToken = new OAuth2AccessToken(TOKEN_TYPE, value, ISSUED_AT, EXPIRES_AT, scope);\n            }\n            catch (IllegalArgumentException iae) {\n                proceed = false;\n             }\n        }\n        else {\n            value = data.consumeRemainingAsString();\n\n            try {\n                accessToken = new OAuth2AccessToken(TOKEN_TYPE, value, ISSUED_AT, EXPIRES_AT);\n            }\n            catch (IllegalArgumentException iae) {\n                proceed = false;\n             }\n        }\n\n        if (proceed) {\n            String tokenValue = accessToken.getTokenValue();\n            int hashCode = accessToken.hashCode();\n            OAuth2AccessToken compareToken = new OAuth2AccessToken(TOKEN_TYPE, value, ISSUED_AT, EXPIRES_AT);\n            boolean compareTokens = accessToken.equals(compareToken);\n        }\n    }\n\n}\n"
  },
  {
    "path": "projects/spring-security/oauth2-jose/NimbusJwtEncoderFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.springframework.security.oauth2.jwt.NimbusJwtEncoder;\nimport org.springframework.security.oauth2.jwt.JwsHeader;\nimport org.springframework.security.oauth2.jwt.JwtEncoderParameters;\nimport org.springframework.security.oauth2.jwt.Jwt;\nimport org.springframework.security.oauth2.jwt.JwtClaimsSet;\nimport org.springframework.security.oauth2.jose.jws.SignatureAlgorithm;\nimport org.springframework.security.oauth2.jwt.JwtEncodingException;\n\nimport com.nimbusds.jose.jwk.JWK;\nimport com.nimbusds.jose.jwk.KeyType;\nimport com.nimbusds.jose.jwk.KeyRevocation;\nimport com.nimbusds.jose.jwk.JWKSet;\nimport com.nimbusds.jose.proc.SecurityContext;\nimport com.nimbusds.jose.jwk.source.JWKSource;\nimport com.nimbusds.jose.util.Base64URL;\n\nimport java.time.temporal.ChronoUnit;\nimport java.time.Instant;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Collections;\nimport java.util.LinkedHashMap;\n\npublic class NimbusJwtEncoderFuzzer {\n\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        String keyId = data.consumeString(200);\n        String x5t256 = data.consumeString(300);\n\n        List<JWK> jwkList = new ArrayList<>();\n\n        //\n        MockJwk mockJwk = new NimbusJwtEncoderFuzzer.MockJwk(KeyType.RSA, keyId, x5t256);\n        jwkList.add(mockJwk);\n\n        JWKSource<SecurityContext> jwkSource = (jwkSelector, securityContext) -> jwkSelector.select(new JWKSet(jwkList));\n        NimbusJwtEncoder jwtEncoder = new NimbusJwtEncoder(jwkSource);\n\n        JwsHeader jwsHeader = JwsHeader\n            .with(SignatureAlgorithm.RS256)\n            .build();\n        JwtClaimsSet jwtClaimsSet = jwtClaimsSet().build();\n\n        try {\n                Jwt encodedJws = jwtEncoder.encode(JwtEncoderParameters.from(jwsHeader, jwtClaimsSet));\n        }\n        catch(JwtEncodingException jee) {\n\n        }\n    }\n\n    public static JwtClaimsSet.Builder jwtClaimsSet() {\n        String issuer = \"https://provider.com\";\n        Instant issuedAt = Instant.now();\n        Instant expiresAt = issuedAt.plus(1, ChronoUnit.HOURS);\n\n        // @formatter:off\n        return JwtClaimsSet.builder()\n            .issuer(issuer)\n            .subject(\"subject\")\n            .audience(Collections.singletonList(\"client-1\"))\n            .issuedAt(issuedAt)\n            .notBefore(issuedAt)\n            .expiresAt(expiresAt)\n            .id(\"jti\")\n            .claim(\"custom-claim-name\", \"custom-claim-value\");\n    }\n\n    private static final class MockJwk extends JWK{\n\n        protected MockJwk(KeyType kty, String kid, String x5t256) {\n            super(kty, null, null, null, kid, null, null, new Base64URL(x5t256), null, null);\n            //TODO Auto-generated constructor stub\n        }\n    \n        @Override\n        public LinkedHashMap<String, ?> getRequiredParams() {\n            // TODO Auto-generated method stub\n            return null;\n        }\n    \n        @Override\n        public boolean isPrivate() {\n            // TODO Auto-generated method stub\n            return false;\n        }\n    \n        @Override\n        public JWK toPublicJWK() {\n            // TODO Auto-generated method stub\n            return null;\n        }\n    \n        @Override\n        public int size() {\n            // TODO Auto-generated method stub\n            return 0;\n        }\n\n        @Override\n        public JWK toRevokedJWK(KeyRevocation keyRevocation) {\n            // TODO Auto-generated method stub\n            return null;\n        }\n    }\n    \n}"
  },
  {
    "path": "projects/spring-security/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-security\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-security.git\"\nprimary_contact: \"rwinch@vmware.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"pwebb@vmware.com\"\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-shell/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-shell.git spring-shell     # or use other version control\nCOPY add-shadow-*.patch $SRC/\nRUN  cd spring-shell && (for i in ${SRC}/add-shadow-*.patch; do tr -d '\\015' < $i | git apply; done )\n\nCOPY build.sh $SRC/\nCOPY core $SRC/core/\nCOPY standard $SRC/standard/\nCOPY table $SRC/table/\n\nWORKDIR spring-shell"
  },
  {
    "path": "projects/spring-shell/add-shadow-core.patch",
    "content": "diff --git a/spring-shell-core/spring-shell-core.gradle b/spring-shell-core/spring-shell-core.gradle\nindex bc3c8dc..16a4aaa 100644\n--- a/spring-shell-core/spring-shell-core.gradle\n+++ b/spring-shell-core/spring-shell-core.gradle\n@@ -1,5 +1,6 @@\n plugins {\n \tid 'org.springframework.shell.module'\n+        id 'com.github.johnrengelman.shadow' version '7.1.2'\n }\n \n description = 'Spring Shell Core'\n@@ -16,4 +17,5 @@ dependencies {\n \ttestImplementation 'org.springframework.boot:spring-boot-starter-test'\n \ttestImplementation 'org.awaitility:awaitility'\n \ttestImplementation 'com.google.jimfs:jimfs'\n+        apply plugin: 'com.github.johnrengelman.shadow'\n }\n"
  },
  {
    "path": "projects/spring-shell/add-shadow-standard.patch",
    "content": "diff --git a/spring-shell-standard/spring-shell-standard.gradle b/spring-shell-standard/spring-shell-standard.gradle\nindex c471dbd..d6c5e9d 100644\n--- a/spring-shell-standard/spring-shell-standard.gradle\n+++ b/spring-shell-standard/spring-shell-standard.gradle\n@@ -1,5 +1,6 @@\n plugins {\n \tid 'org.springframework.shell.module'\n+\tid 'com.github.johnrengelman.shadow' version '7.1.2'\n }\n \n description = 'Spring Shell Standard'\n@@ -9,4 +10,5 @@ dependencies {\n \timplementation project(':spring-shell-core')\n \tcompileOnly 'com.google.code.findbugs:jsr305'\n \ttestImplementation 'org.springframework.boot:spring-boot-starter-test'\n+\tapply plugin: 'com.github.johnrengelman.shadow'\n }\n"
  },
  {
    "path": "projects/spring-shell/add-shadow-table.patch",
    "content": "diff --git a/spring-shell-table/spring-shell-table.gradle b/spring-shell-table/spring-shell-table.gradle\nindex 1e17209..f554308 100644\n--- a/spring-shell-table/spring-shell-table.gradle\n+++ b/spring-shell-table/spring-shell-table.gradle\n@@ -1,5 +1,6 @@\n plugins {\n \tid 'org.springframework.shell.module'\n+        id 'com.github.johnrengelman.shadow' version '7.1.2'\n }\n \n description = 'Spring Shell Table'\n@@ -10,4 +11,5 @@ dependencies {\n \tapi('org.springframework:spring-context')\n \tcompileOnly 'com.google.code.findbugs:jsr305'\n \ttestImplementation 'org.springframework.boot:spring-boot-starter-test'\n+        apply plugin: 'com.github.johnrengelman.shadow'\n }\n"
  },
  {
    "path": "projects/spring-shell/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\nJVM_LD_LIBRARY_PATH=\"${JAVA_HOME}/lib/server\"\n\nCURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain | sed -nr \"s/^version:\\ (.*)/\\1/p\")\n\nALL_JARS=\"\"\n\nfunction install_shadowJar {\n  ./gradlew shadowJar --build-file spring-$1/spring-$1.gradle -x javadoc -x test\n  install -v \"spring-$1/build/libs/spring-$1-${CURRENT_VERSION}-all.jar\" \"$OUT/spring-$1.jar\";\n  ALL_JARS=\"${ALL_JARS} spring-$1.jar\";\n}\n\ninstall_shadowJar shell-core;\ninstall_shadowJar shell-standard;\ninstall_shadowJar shell-table;\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfunction create_fuzz_targets() {\n  mkdir -p $SRC/$1\n  mkdir -p $OUT/$1\n  javac -cp $BUILD_CLASSPATH $SRC/$1/*.java --release 17\n\n  for fuzzer in $SRC/$1/*Fuzzer.java; do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper that executes Jazzer with the correct arguments.\n    echo \"#!/bin/bash\n    # LLVMFuzzerTestOneInput for fuzzer detection.\n    this_dir=\\$(dirname \\\"\\$0\\\")\n    JAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\n    if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n      mem_settings='-Xmx1900m:-Xss900k'\n    else\n      mem_settings='-Xmx2048m:-Xss1024k'\n    fi\n    LD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n    \\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH \\\n    --target_class=$fuzzer_basename \\\n    --jvm_args=\\\"\\$mem_settings\\\" \\\n    \\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\n  cp $SRC/$1/*.class $OUT/\n}\n\ncreate_fuzz_targets core;\ncreate_fuzz_targets standard;\ncreate_fuzz_targets table;\n"
  },
  {
    "path": "projects/spring-shell/core/CommandParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\n\nimport org.springframework.core.convert.ConversionService;\nimport org.springframework.core.convert.support.DefaultConversionService;\nimport org.springframework.shell.command.CommandOption;\nimport org.springframework.shell.command.CommandParser;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport java.lang.Character;\npublic class CommandParserFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        String longName1 = data.consumeString(200);\n        String longName2 = data.consumeString(5);\n        String shortName1 = data.consumeString(100);\n        String argument = data.consumeString(100);\n        String description = data.consumeRemainingAsString();\n\n        char[] c = shortName1.toCharArray();\n        Character[] shortNameArray = new Character[c.length];\n        int i = 0;\n        for (char value : c) {\n            shortNameArray[i++] = Character.valueOf(value);\n        }\n\n        CommandParser parser;\n        ConversionService conversionService = new DefaultConversionService();\n        parser = CommandParser.of(conversionService);\n\n        CommandOption option1 = CommandOption.of(new String[]{longName1}, shortNameArray, description);\n        CommandOption option2 = CommandOption.of(new String[]{longName2}, new Character[0], description);\n        List<CommandOption> options = Arrays.asList(option1, option2);\n        String[] args = new String[]{\"--\"+longName1, argument};\n        CommandParser.CommandParserResults results = parser.parse(options, args);\n\n        if (results.errors().size() > 0){\n            throw new FuzzerSecurityIssueMedium(\"Something went wrong while parsing\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/spring-shell/project.yaml",
    "content": "homepage: \"http://projects.spring.io/spring-shell/\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-shell.git\"\nprimary_contact: \"pwebb@vmware.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/spring-shell/standard/BashCompletionsFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\n\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\nimport org.springframework.shell.command.CommandCatalog;\nimport org.springframework.shell.standard.completion.BashCompletions;\n\n\npublic class BashCompletionsFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        String command = data.consumeRemainingAsString();\n\n        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();\n\n        CommandCatalog commandCatalog = CommandCatalog.of();\n        BashCompletions completions = new BashCompletions(context, commandCatalog);\n        String bash = completions.generate(command);\n\n    }\n}\n"
  },
  {
    "path": "projects/spring-shell/table/TableFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;\n\nimport org.springframework.shell.table.Table;\nimport org.springframework.shell.table.TableModel;\nimport org.springframework.shell.table.TableBuilder;\nimport org.springframework.shell.table.ArrayTableModel;\nimport org.springframework.shell.table.BorderStyle;\n\npublic class TableFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        String header = data.consumeString(250);\n        String body = data.consumeString(250);\n\n        TableModel model = new ArrayTableModel(new String[][] {{header, body}, {\"\",\"\"}});\n        Table table = new TableBuilder(model).addHeaderAndVerticalsBorders(BorderStyle.fancy_light).build();\n\n        if (model.transpose().getColumnCount() != 2) {\n            throw new FuzzerSecurityIssueMedium(\"There must be two columns!\");\n        }\n        if (model.transpose().getRowCount() != 2 ) {\n            throw new FuzzerSecurityIssueMedium(\"There must be two rows!\");\n        }\n        if (!((String) model.transpose().getValue(0,0)).equals(header)) {\n            throw new FuzzerSecurityIssueMedium(\"Header is not the same!\");\n        }\n        if (!((String) model.transpose().getValue(1,0)).equals(body)) {\n            throw new FuzzerSecurityIssueMedium(\"Body is not the same!\");\n        }\n    }\n}\n"
  },
  {
    "path": "projects/spring-webflow/DefaultConversionServiceFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in co  mpliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n//////////////////////////////////////////////////////////////////////////////////\n\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport java.util.*;\nimport java.security.Principal;\n\nimport org.springframework.binding.convert.service.*;\nimport org.springframework.binding.convert.ConversionException;\nimport org.springframework.binding.convert.ConversionExecutionException;\nimport org.springframework.binding.convert.ConversionExecutor;\nimport org.springframework.binding.convert.ConversionExecutorNotFoundException;\nimport org.springframework.binding.convert.converters.Converter;\nimport org.springframework.binding.convert.converters.FormattedStringToNumber;\nimport org.springframework.binding.convert.converters.StringToBoolean;\nimport org.springframework.binding.convert.converters.StringToObject;\nimport org.springframework.binding.convert.converters.TwoWayConverter;\nimport org.springframework.binding.format.DefaultNumberFormatFactory;\n\npublic class DefaultConversionServiceFuzzer {\n    static Class[] classes = {String.class, String[].class, Boolean.class, int.class, int[].class, Integer.class, Integer[].class, Collection.class, Set.class,\n            LinkedList.class, List.class, HashMap.class, Principal.class, Principal[].class};\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        Class c1 = data.pickValue(classes);\n        Class c2 = data.pickValue(classes);\n\n        try {\n            DefaultConversionService service = new DefaultConversionService();\n            ConversionExecutor executor = service.getConversionExecutor(c1, c2);\n\n            if (c1 == String.class) {\n                executor.execute(data.consumeRemainingAsString());\n            } else if (c1 == String[].class) {\n                String[] stringArr = new String[data.consumeInt(0, 50)];\n                for (int i = 0; i < stringArr.length; i++) {\n                    stringArr[i] = data.consumeString(1000);\n                }\n                executor.execute(stringArr);\n            } else if (c1 == Boolean.class) {\n                executor.execute(data.consumeBoolean());\n            } else if (c1 == int.class) {\n                executor.execute(data.consumeInt());\n            } else if (c1 == int[].class) {\n                int[] intArr = new int[data.consumeInt(0, 50)];\n                for (int i = 0; i < intArr.length; i++) {\n                    intArr[i] = data.consumeInt();\n                }\n                executor.execute(intArr);\n            } else if (c1 == Integer.class) {\n                executor.execute(data.consumeInt());\n            } else if (c1 == Integer[].class) {\n                Integer[] integerArr = new Integer[data.consumeInt(0, 50)];\n                for (int i = 0; i < integerArr.length; i++) {\n                    integerArr[i] = data.consumeInt();\n                }\n                executor.execute(integerArr);\n            } else if (c1 == Collection.class) {\n                int sz = data.consumeInt(0, 50);\n                Collection<String> collection = new ArrayList<String>();\n                for (int i = 0; i < sz; i++) {\n                    collection.add(data.consumeString(1000));\n                }\n                executor.execute(collection);\n            } else if (c1 == Set.class) {\n                int sz = data.consumeInt(0, 50);\n                Set<String> set = new LinkedHashSet<>();\n                for (int i = 0; i < sz; ++i) {\n                    set.add(data.consumeString(1000));\n                }\n                executor.execute(set);\n            } else if (c1 == LinkedList.class) {\n                int sz = data.consumeInt(0, 50);\n                LinkedList<String> result = new LinkedList<String>();\n                for (int i = 0; i < sz; ++i) {\n                    result.add(data.consumeString(1000));\n                }\n                executor.execute(result);\n            } else if (c1 == List.class) {\n                int sz = data.consumeInt(0, 50);\n                List<String> list = new ArrayList<String>();\n                for (int i = 0; i < sz; ++i) {\n                    list.add(data.consumeString(1000));\n                }\n                executor.execute(list);\n            } else if (c1 == HashMap.class) {\n                int sz = data.consumeInt(0, 50);\n                HashMap<Integer, String> hash_map = new HashMap<Integer, String>();\n                for (int i = 0; i < sz; ++i) {\n                    hash_map.put(data.consumeInt(), data.consumeString(1000));\n                }\n                executor.execute(hash_map);\n            } else if (c1 == Principal.class) {\n                Principal principal = () -> data.consumeString(1000);\n                executor.execute(principal);\n            } else if (c1 == Principal[].class) {\n                Principal[] principalArr = new Principal[data.consumeInt(0, 50)];\n                for (int i = 0; i < principalArr.length; i++) {\n                    Principal principal = () -> data.consumeString(1000);\n                    principalArr[i] = principal;\n                }\n                executor.execute(principalArr);\n            } else {\n                return;\n            }\n        } catch (ConversionExecutionException | ConversionExecutorNotFoundException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/spring-webflow/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt update && apt install -y openjdk-17-jdk\n\nRUN git clone --depth 1 https://github.com/spring-projects/spring-webflow.git\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nCOPY build.patch $SRC/spring-webflow\nWORKDIR $SRC/spring-webflow"
  },
  {
    "path": "projects/spring-webflow/build.patch",
    "content": "diff --git a/build.gradle b/build.gradle\nindex 4d167835..e019f4fb 100644\n--- a/build.gradle\n+++ b/build.gradle\n@@ -11,6 +11,7 @@ plugins {\n \tid 'org.asciidoctor.jvm.gems' version '3.3.2'\n \tid 'org.asciidoctor.jvm.convert' version '3.3.2'\n \tid 'de.undercouch.download' version '4.1.2'\n+\tid 'com.gradleup.shadow' version '9.0.0'\n }\n \n ext {\n@@ -27,6 +28,7 @@ allprojects {\n \tapply plugin: \"java-library\"\n \tapply plugin: \"io.spring.dependency-management\"\n \tapply plugin: \"org.springframework.build.optional-dependencies\"\n+\tapply plugin: 'com.gradleup.shadow'\n \tapply from: \"${rootProject.projectDir}/ide.gradle\"\n \n \tdependencyManagement {\n"
  },
  {
    "path": "projects/spring-webflow/build.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\npatch build.gradle build.patch\n\n./gradlew shadowJar --no-daemon\n\n# Extract version from the built JAR filename instead of running gradlew properties (which can hang)\nSPRING_WEBFLOW_VERSION=$(ls $SRC/spring-webflow/spring-webflow/build/libs/spring-webflow-*-all.jar | sed -nr 's/.*spring-webflow-(.+)-all\\.jar/\\1/p')\n\ncp $SRC/spring-webflow/spring-webflow/build/libs/spring-webflow-$SPRING_WEBFLOW_VERSION-all.jar $OUT/spring-webflow.jar\ncp $SRC/spring-webflow/spring-binding/build/libs/spring-binding-$SPRING_WEBFLOW_VERSION-all.jar $OUT/spring-binding.jar\n\nALL_JARS=\"spring-webflow.jar spring-binding.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 17\n  cp $SRC/[$fuzzer_basename]*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n--instrumentation_includes=org.springframework.** \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone"
  },
  {
    "path": "projects/spring-webflow/project.yaml",
    "content": "homepage: \"https://github.com/spring-projects/spring-webflow.git\"\nlanguage: jvm\nmain_repo: \"https://github.com/spring-projects/spring-webflow.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"pwebb@vmware.com\"\nauto_ccs:\n  - \"wilkinsona@vmware.com\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n  - \"peter.samarin@code-intelligence.com\"\n"
  },
  {
    "path": "projects/sql-parser/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake bison flex\nRUN git clone https://github.com/hyrise/sql-parser\n\nWORKDIR $SRC/sql-parser\nCOPY build.sh run_tests.sh $SRC/\nCOPY fuzz_sql_parse.cpp $SRC/sql-parser/fuzz_sql_parse.cpp\n"
  },
  {
    "path": "projects/sql-parser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build fuzzers\nsed 's/static ?= no/LIB_CFLAGS += ${CXXFLAGS}\\nstatic ?= no/g' -i Makefile\nmake static=yes -j$(nproc)\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n    fuzz_sql_parse.cpp libsqlparser.a -I./src -o $OUT/fuzz_sql_parse\n\n# Build unit tests\nexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:.\nmake bin/tests static=yes TEST_CFLAGS=\"-std=c++1z -Wall -Werror -Isrc/ -Itest/ -L./ $CXXFLAGS\" -j$(nproc)\n"
  },
  {
    "path": "projects/sql-parser/fuzz_sql_parse.cpp",
    "content": "/* Copyright 2021 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <string>\n#include \"SQLParser.h\"\n\nusing namespace hsql;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    std::string input(reinterpret_cast<const char*>(data), size);\n    SQLParserResult res;\n    SQLParser::parse(input, &res);\n    return 0;\n}\n"
  },
  {
    "path": "projects/sql-parser/project.yaml",
    "content": "homepage: \"https://github.com/hyrise/sql-parser\"\nmain_repo: \"https://github.com/hyrise/sql-parser\"\nprimary_contact: \"marcel.weisgut@hpi.de\"\nlanguage: c++\nauto_ccs:\n  - \"klauck2@gmail.com\"\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/sql-parser/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbin/tests -f \"test/queries/queries-good.sql\" -f \"test/queries/queries-bad.sql\"\n"
  },
  {
    "path": "projects/sqlalchemy/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth 1 --branch rel_1_3 https://github.com/sqlalchemy/sqlalchemy\nWORKDIR $SRC/sqlalchemy\nCOPY build.sh sqlalchemy_fuzzer.py $SRC/\n"
  },
  {
    "path": "projects/sqlalchemy/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 setup.py install\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/sqlalchemy/project.yaml",
    "content": "homepage: \"https://www.sqlalchemy.org\"\nlanguage: python\nprimary_contact: \"mike_mp@zzzcomputing.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\nmain_repo: \"https://github.com/sqlalchemy/sqlalchemy\"\n"
  },
  {
    "path": "projects/sqlalchemy/sqlalchemy_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\n\nwith atheris.instrument_imports():\n  import sqlalchemy\n  from sqlalchemy import create_engine\n  from sqlalchemy import Table, Column, Integer, String, MetaData\n  from sqlalchemy.sql import text\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n    try:\n        sql_string = input_bytes.decode(\"utf-8\")\n        metadata = MetaData()\n        fuzz_table = Table('fuzz_table', metadata,\n          Column('id', Integer, primary_key=True),\n          Column('column1', String),\n          Column('column2', String),\n        )\n\n        engine = create_engine('sqlite:///fuzz.db')\n        metadata.create_all(engine)\n        statement = text(sql_string)\n        with engine.connect() as conn:            \n            conn.execute(statement)\n    except Exception as e:\n        pass\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sqlalchemy-utils/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN git clone https://github.com/kvesteri/sqlalchemy-utils\n\nWORKDIR $SRC/sqlalchemy-utils\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/sqlalchemy-utils/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npython3 -m pip install --upgrade pip\npython3 -m pip install sqlalchemy arrow colour babel\npython3 -m pip install .\n\nmkdir $SRC/tmp\ncd $SRC/tmp\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n   #compile_python_fuzzer $fuzzer --hidden-import=sqlalchemy_utils --hidden-import=sqlalchemy_utils.models\n   compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/sqlalchemy-utils/fuzz_db.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n   import sqlalchemy\n   from sqlalchemy import (\n      create_engine,\n      insert,\n      Table,\n      Column,\n      Integer,\n      String,\n      MetaData\n   )\n   import sqlalchemy_utils as utils\n   from sqlalchemy.sql import text\n   from sqlalchemy.exc import SQLAlchemyError\n\n@atheris.instrument_func\ndef TestInput(data):\n    if len(data) < 10:\n        pass\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    db_str = 'sqlite:///fuzz.db'\n\n    metadata = MetaData()\n    fuzz_table = Table('fuzz_table', metadata,\n        Column('id', Integer, primary_key=True),\n        Column('Col1', String))\n\n    engine = create_engine(db_str)\n    metadata.create_all(engine)\n\n    if not utils.database_exists(db_str):\n       utils.create_database(db_str)\n    assert utils.database_exists(db_str)\n\n    try:\n        with engine.connect() as conn:\n            conn.execute(text(fdp.ConsumeString(100))) \n    except (SQLAlchemyError, UnicodeEncodeError) as e:\n       pass\n    except ValueError as e:\n      if \"the query contains a null character\" not in str(e):\n         raise e\n\n    utils.drop_database(db_str)\n    assert not utils.database_exists(db_str)\ndef main():\n  atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sqlalchemy-utils/fuzz_orm.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n   import sqlalchemy\n   from sqlalchemy import Column, Integer, String, select, create_engine\n   from sqlalchemy.orm import declarative_base, Session\n   from sqlalchemy_utils import cast_if, escape_like\n   from sqlalchemy.exc import SQLAlchemyError\n\nBase = declarative_base()\n\nclass FuzzTable(Base):\n    __tablename__ = \"fuzz_table\"\n\n    id = Column(Integer, primary_key=True)\n    name = Column(String)\n\n@atheris.instrument_func\ndef TestInput(data):\n    if len(data) < 10:\n        pass\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    cast_if(FuzzTable.id, Integer)\n    cast_if(FuzzTable.name, Integer)\n    cast_if(FuzzTable.id, String)\n    cast_if(FuzzTable.name, String)\n\n    cast_if(fdp.ConsumeInt(10), Integer)\n    cast_if(fdp.ConsumeString(10), Integer)\n    cast_if(fdp.ConsumeInt(10), String)\n    cast_if(fdp.ConsumeString(10), String)\n\n    db_str = 'sqlite:///fuzz.db'\n\n    engine = create_engine(db_str)\n    Base.metadata.create_all(engine)\n\n    try:\n       with Session(engine) as session:\n           name_str = fdp.ConsumeString(20)\n           session.query(FuzzTable).filter(FuzzTable.name.ilike(escape_like(name_str))).all()\n    except SQLAlchemyError as e:\n       pass\n\ndef main():\n  atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sqlalchemy-utils/fuzz_type.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n   from arrow import utcnow\n   from colour import Color\n   from uuid import uuid4\n\n   import sqlalchemy\n   from sqlalchemy.sql import text, select\n   from sqlalchemy.exc import SQLAlchemyError\n   from sqlalchemy import (\n      create_engine, Integer, String, MetaData,\n      Table, Column, Sequence\n   )\n   from sqlalchemy_utils import (\n      ArrowType, ChoiceType, ColorType, CountryType,\n      Country, EmailType, JSONType, IPAddressType,\n      ScalarListType, URLType, UUIDType, WeekDays,\n      WeekDaysType\n   )\n\n   # The following imports are needed to make the pyinstaller\n   # executable work.\n   from babel import Locale\n   import babel.dates\n   import babel.numbers\n\n\n@atheris.instrument_func\ndef TestInput(data):\n    if len(data) < 10:\n        pass\n\n    fdp = atheris.FuzzedDataProvider(data)\n\n    metadata = MetaData()\n    fuzz_table = Table('fuzz_table', metadata,\n        Column('id', Integer, Sequence('id_seq'), primary_key=True),\n        Column('Col1', String),\n        Column('Col2', ArrowType),\n        Column('Col3', ChoiceType(\n            [(u'c1', u'Choice 1'),(u'c2', u'Choice 2')]\n        )),\n        Column('Col4', ColorType),\n        Column('Col5', CountryType),\n        Column('Col6', EmailType),\n        Column('Col7', JSONType),\n        Column('Col8', IPAddressType),\n        Column('Col9', ScalarListType(int)),\n        Column('Col10', URLType),\n        Column('Col11', UUIDType(binary=False)),\n        Column('Col12', WeekDaysType)\n    )\n\n    engine = create_engine('sqlite:///fuzz.db')\n    metadata.create_all(engine)\n    try:\n        with engine.connect() as conn:\n            conn.execute(text(fdp.ConsumeString(100))) \n            ins = fuzz_table.insert().values(\n                 Col1=fdp.ConsumeString(100),\n                 Col2=utcnow(),\n                 Col3=u'c1' if fdp.ConsumeBool() else u'c2',\n                 Col4=Color(\"#{:02x}{:02x}{:02x}\".format(\n                    fdp.ConsumeIntInRange(0,255),\n                    fdp.ConsumeIntInRange(0,255),\n                    fdp.ConsumeIntInRange(0,255)\n                 )),\n                 Col5=Country('US'),\n                 Col6=fdp.ConsumeString(20),\n                 Col7={\n                     fdp.ConsumeString(2):fdp.ConsumeString(10),\n                     fdp.ConsumeString(2):fdp.ConsumeString(10),\n                     fdp.ConsumeString(2):fdp.ConsumeString(10)\n                 },\n                 Col8=\"%d.%d.%d.%d\"%(\n                    fdp.ConsumeIntInRange(0,255),\n                    fdp.ConsumeIntInRange(0,255),\n                    fdp.ConsumeIntInRange(0,255),\n                    fdp.ConsumeIntInRange(0,255)\n                 ),\n                 Col9=[fdp.ConsumeInt(8),fdp.ConsumeInt(8),fdp.ConsumeInt(8)],\n                 Col10=fdp.ConsumeUnicode(20),\n                 Col11=uuid4(),\n                 Col12=WeekDays(\"{0:07b}\".format(fdp.ConsumeIntInRange(0,31)))\n            )\n            ins.compile()\n            conn.execute(ins) \n    except (SQLAlchemyError, UnicodeEncodeError) as e:\n       pass\n    except ValueError as e:\n      if \"the query contains a null character\" not in str(e):\n         raise e\n\ndef main():\n  atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sqlalchemy-utils/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/kvesteri/sqlalchemy-utils\nlanguage: python\nmain_repo: https://github.com/kvesteri/sqlalchemy-utils\nprimary_contact: david@adalogics.com\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/sqlalchemy_jsonfield/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/sqlalchemy/sqlalchemy\nRUN git clone https://github.com/penguinolog/sqlalchemy_jsonfield\n\nWORKDIR $SRC/sqlalchemy_jsonfield\nCOPY build.sh fuzz_*.py $SRC/\n"
  },
  {
    "path": "projects/sqlalchemy_jsonfield/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install --upgrade pip\n\ncd $SRC/sqlalchemy\npip3 install .\n\ncd $SRC/sqlalchemy_jsonfield\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n   compile_python_fuzzer $fuzzer \ndone\n"
  },
  {
    "path": "projects/sqlalchemy_jsonfield/fuzz_basic.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n   import sqlalchemy\n   from sqlalchemy import create_engine, Table, Column, Integer, MetaData\n   from sqlalchemy.sql import text\n   from sqlalchemy.exc import SQLAlchemyError\n   import sqlalchemy_jsonfield\n   from sqlalchemy_jsonfield import JSONField\n\n@atheris.instrument_func\ndef TestInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    metadata = MetaData()\n    fuzz_table = Table('fuzz_table', metadata,\n        Column('id', Integer, primary_key=True),\n        Column('Col1',\n           JSONField(enforce_string=fdp.ConsumeBool(),enforce_unicode=fdp.ConsumeBool())\n       )\n    )\n\n    engine = create_engine('sqlite:///fuzz.db')\n    metadata.create_all(engine)\n    try:\n        with engine.connect() as conn:\n            conn.execute(text(fdp.ConsumeString(100))) \n    except (SQLAlchemyError, UnicodeEncodeError) as e:\n       pass\n    except ValueError as e:\n      if \"the query contains a null character\" not in str(e):\n         raise e\n\ndef main():\n  atheris.Setup(sys.argv, TestInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sqlalchemy_jsonfield/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/penguinolog/sqlalchemy_jsonfield\nlanguage: python\nmain_repo: https://github.com/penguinolog/sqlalchemy_jsonfield\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/sqlite-jdbc/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/xerial/sqlite-jdbc sqlite-jdbc\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/sqlite-jdbc\n"
  },
  {
    "path": "projects/sqlite-jdbc/SqliteConnectionFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.sql.Connection;\nimport java.sql.SQLException;\nimport org.sqlite.SQLiteConfig;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [org.sqlite.SQLiteConfig] public java.sql.Connection createConnection(java.lang.String) throws java.sql.SQLException\npublic class SqliteConnectionFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      SQLiteConfig obj = new SQLiteConfig();\n      obj.createConnection(data.consumeRemainingAsString());\n    } catch (SQLException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/sqlite-jdbc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./target/sqlite-jdbc-$CURRENT_VERSION.jar\" $OUT/sqlite-jdbc.jar\n\nALL_JARS='sqlite-jdbc.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/sqlite-jdbc/project.yaml",
    "content": "homepage: https://github.com/xerial/sqlite-jdbc\nmain_repo: https://github.com/xerial/sqlite-jdbc\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/sqlite3/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl tcl zlib1g-dev tcl-dev\n\n# We won't be able to poll fossil for changes, so this will build\n# only once a day.\nRUN mkdir $SRC/sqlite3 && \\\n    cd $SRC/sqlite3 && \\\n    curl 'https://www.sqlite.org/src/tarball?uuid=trunk' -o sqlite3.tar.gz && \\\n    tar xzf sqlite3.tar.gz\n\nRUN find $SRC/sqlite3 -name \"*.test\" | xargs zip $SRC/ossfuzz_seed_corpus.zip\n\nWORKDIR sqlite3\nCOPY build.sh *.dict *.options run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/sqlite3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir bld\ncd bld\n\nexport ASAN_OPTIONS=detect_leaks=0\n\n# Limit max length of data blobs and sql queries to prevent irrelevant OOMs.\n# Also limit max memory page count to avoid creating large databases.\nexport CFLAGS=\"$CFLAGS -DSQLITE_MAX_LENGTH=128000000 \\\n               -DSQLITE_MAX_SQL_LENGTH=128000000 \\\n               -DSQLITE_MAX_MEMORY=25000000 \\\n               -DSQLITE_PRINTF_PRECISION_LIMIT=1048576 \\\n               -DSQLITE_DEBUG=1 \\\n               -DSQLITE_MAX_PAGE_COUNT=16384\"             \n               \n../configure --shared=0\nmake -j$(nproc)\nmake sqlite3.c\n\n$CC $CFLAGS -I. -c \\\n    $SRC/sqlite3/test/ossfuzz.c -o $SRC/sqlite3/test/ossfuzz.o\n\n$CXX $CXXFLAGS \\\n    $SRC/sqlite3/test/ossfuzz.o -o $OUT/ossfuzz \\\n    $LIB_FUZZING_ENGINE ./sqlite3.o\n\ncp $SRC/*.options $SRC/*.dict $SRC/*.zip $OUT/\n"
  },
  {
    "path": "projects/sqlite3/ossfuzz.options",
    "content": "[libfuzzer]\ndict = sql.dict\n"
  },
  {
    "path": "projects/sqlite3/project.yaml",
    "content": "homepage: \"https://sqlite.org/\"\nmain_repo: \"https://sqlite.org/src/dir\"\nlanguage: c++\nprimary_contact: \"drhsqlite@gmail.com\"\nauto_ccs:\n  - \"sboydps@gmail.com\"\n  - \"twsmith@mozilla.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/sqlite3/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\ncd $SRC/sqlite3/bld\n\n# The above fails in the container.\n# Ideally we should have \"make tests\". However, there are issues in this\n# that are unresolved. It needs a non-root user in the conatiner, which is\n# fine, but even after adjusting that the tests are not succeeding.\nmake test || true\n\n\n# Run the actual tests that work within the container.\n/usr/bin/tclsh8.6 /src/sqlite3/tool/srctree-check.tcl\n./fuzzcheck /src/sqlite3/test/fuzzdata1.db /src/sqlite3/test/fuzzdata2.db /src/sqlite3/test/fuzzdata3.db /src/sqlite3/test/fuzzdata4.db /src/sqlite3/test/fuzzdata5.db /src/sqlite3/test/fuzzdata6.db /src/sqlite3/test/fuzzdata7.db /src/sqlite3/test/fuzzdata8.db\n./sessionfuzz run /src/sqlite3/test/sessionfuzz-data1.db\n./srcck1 sqlite3.c \n"
  },
  {
    "path": "projects/sqlite3/sql.dict",
    "content": "#\n# AFL dictionary for SQL\n# ----------------------\n#\n# Modeled based on SQLite documentation, contains some number of SQLite\n# extensions. Other dialects of SQL may benefit from customized dictionaries.\n#\n# If you append @1 to the file name when loading this dictionary, afl-fuzz\n# will also additionally load a selection of pragma keywords that are very\n# specific to SQLite (and are probably less interesting from the security\n# standpoint, because they are usually not allowed in non-privileged\n# contexts).\n#\n# Created by Michal Zalewski <lcamtuf@google.com>\n#\n\nfunction_abs=\" abs(1)\"\nfunction_avg=\" avg(1)\"\nfunction_changes=\" changes()\"\nfunction_char=\" char(1)\"\nfunction_coalesce=\" coalesce(1,1)\"\nfunction_count=\" count(1)\"\nfunction_date=\" date(1,1,1)\"\nfunction_datetime=\" datetime(1,1,1)\"\nfunction_decimal=\" decimal(1,1)\"\nfunction_glob=\" glob(1,1)\"\nfunction_group_concat=\" group_concat(1,1)\"\nfunction_hex=\" hex(1)\"\nfunction_ifnull=\" ifnull(1,1)\"\nfunction_instr=\" instr(1,1)\"\nfunction_julianday=\" julianday(1,1,1)\"\nfunction_last_insert_rowid=\" last_insert_rowid()\"\nfunction_length=\" length(1)\"\nfunction_like=\" like(1,1)\"\nfunction_likelihood=\" likelihood(1,1)\"\nfunction_likely=\" likely(1)\"\nfunction_load_extension=\" load_extension(1,1)\"\nfunction_lower=\" lower(1)\"\nfunction_ltrim=\" ltrim(1,1)\"\nfunction_max=\" max(1,1)\"\nfunction_min=\" min(1,1)\"\nfunction_nullif=\" nullif(1,1)\"\nfunction_printf=\" printf(1,1)\"\nfunction_quote=\" quote(1)\"\nfunction_random=\" random()\"\nfunction_randomblob=\" randomblob(1)\"\nfunction_replace=\" replace(1,1,1)\"\nfunction_round=\" round(1,1)\"\nfunction_rtrim=\" rtrim(1,1)\"\nfunction_soundex=\" soundex(1)\"\nfunction_sqlite_compileoption_get=\" sqlite_compileoption_get(1)\"\nfunction_sqlite_compileoption_used=\" sqlite_compileoption_used(1)\"\nfunction_sqlite_source_id=\" sqlite_source_id()\"\nfunction_sqlite_version=\" sqlite_version()\"\nfunction_strftime=\" strftime(1,1,1,1)\"\nfunction_substr=\" substr(1,1,1)\"\nfunction_sum=\" sum(1)\"\nfunction_time=\" time(1,1,1)\"\nfunction_total=\" total(1)\"\nfunction_total_changes=\" total_changes()\"\nfunction_trim=\" trim(1,1)\"\nfunction_typeof=\" typeof(1)\"\nfunction_unicode=\" unicode(1)\"\nfunction_unlikely=\" unlikely(1)\"\nfunction_upper=\" upper(1)\"\nfunction_varchar=\" varchar(1)\"\nfunction_zeroblob=\" zeroblob(1)\"\n\nkeyword_ABORT=\"ABORT\"\nkeyword_ACTION=\"ACTION\"\nkeyword_ADD=\"ADD\"\nkeyword_AFTER=\"AFTER\"\nkeyword_ALL=\"ALL\"\nkeyword_ALTER=\"ALTER\"\nkeyword_ANALYZE=\"ANALYZE\"\nkeyword_AND=\"AND\"\nkeyword_AS=\"AS\"\nkeyword_ASC=\"ASC\"\nkeyword_ATTACH=\"ATTACH\"\nkeyword_AUTOINCREMENT=\"AUTOINCREMENT\"\nkeyword_BEFORE=\"BEFORE\"\nkeyword_BEGIN=\"BEGIN\"\nkeyword_BETWEEN=\"BETWEEN\"\nkeyword_BY=\"BY\"\nkeyword_CASCADE=\"CASCADE\"\nkeyword_CASE=\"CASE\"\nkeyword_CAST=\"CAST\"\nkeyword_CHECK=\"CHECK\"\nkeyword_COLLATE=\"COLLATE\"\nkeyword_COLUMN=\"COLUMN\"\nkeyword_COMMIT=\"COMMIT\"\nkeyword_CONFLICT=\"CONFLICT\"\nkeyword_CONSTRAINT=\"CONSTRAINT\"\nkeyword_CREATE=\"CREATE\"\nkeyword_CROSS=\"CROSS\"\nkeyword_CURRENT_DATE=\"CURRENT_DATE\"\nkeyword_CURRENT_TIME=\"CURRENT_TIME\"\nkeyword_CURRENT_TIMESTAMP=\"CURRENT_TIMESTAMP\"\nkeyword_DATABASE=\"DATABASE\"\nkeyword_DEFAULT=\"DEFAULT\"\nkeyword_DEFERRABLE=\"DEFERRABLE\"\nkeyword_DEFERRED=\"DEFERRED\"\nkeyword_DELETE=\"DELETE\"\nkeyword_DESC=\"DESC\"\nkeyword_DETACH=\"DETACH\"\nkeyword_DISTINCT=\"DISTINCT\"\nkeyword_DROP=\"DROP\"\nkeyword_EACH=\"EACH\"\nkeyword_ELSE=\"ELSE\"\nkeyword_END=\"END\"\nkeyword_ESCAPE=\"ESCAPE\"\nkeyword_EXCEPT=\"EXCEPT\"\nkeyword_EXCLUSIVE=\"EXCLUSIVE\"\nkeyword_EXISTS=\"EXISTS\"\nkeyword_EXPLAIN=\"EXPLAIN\"\nkeyword_FAIL=\"FAIL\"\nkeyword_FOR=\"FOR\"\nkeyword_FOREIGN=\"FOREIGN\"\nkeyword_FROM=\"FROM\"\nkeyword_FULL=\"FULL\"\nkeyword_GLOB=\"GLOB\"\nkeyword_GROUP=\"GROUP\"\nkeyword_HAVING=\"HAVING\"\nkeyword_IF=\"IF\"\nkeyword_IGNORE=\"IGNORE\"\nkeyword_IMMEDIATE=\"IMMEDIATE\"\nkeyword_IN=\"IN\"\nkeyword_INDEX=\"INDEX\"\nkeyword_INDEXED=\"INDEXED\"\nkeyword_INITIALLY=\"INITIALLY\"\nkeyword_INNER=\"INNER\"\nkeyword_INSERT=\"INSERT\"\nkeyword_INSTEAD=\"INSTEAD\"\nkeyword_INTERSECT=\"INTERSECT\"\nkeyword_INTO=\"INTO\"\nkeyword_IS=\"IS\"\nkeyword_ISNULL=\"ISNULL\"\nkeyword_JOIN=\"JOIN\"\nkeyword_KEY=\"KEY\"\nkeyword_LEFT=\"LEFT\"\nkeyword_LIKE=\"LIKE\"\nkeyword_LIMIT=\"LIMIT\"\nkeyword_MATCH=\"MATCH\"\nkeyword_NATURAL=\"NATURAL\"\nkeyword_NO=\"NO\"\nkeyword_NOT=\"NOT\"\nkeyword_NOTNULL=\"NOTNULL\"\nkeyword_NULL=\"NULL\"\nkeyword_OF=\"OF\"\nkeyword_OFFSET=\"OFFSET\"\nkeyword_ON=\"ON\"\nkeyword_OR=\"OR\"\nkeyword_ORDER=\"ORDER\"\nkeyword_OUTER=\"OUTER\"\nkeyword_PLAN=\"PLAN\"\nkeyword_PRAGMA=\"PRAGMA\"\nkeyword_PRIMARY=\"PRIMARY\"\nkeyword_QUERY=\"QUERY\"\nkeyword_RAISE=\"RAISE\"\nkeyword_RECURSIVE=\"RECURSIVE\"\nkeyword_REFERENCES=\"REFERENCES\"\n#keyword_REGEXP=\"REGEXP\"\nkeyword_REINDEX=\"REINDEX\"\nkeyword_RELEASE=\"RELEASE\"\nkeyword_RENAME=\"RENAME\"\nkeyword_REPLACE=\"REPLACE\"\nkeyword_RESTRICT=\"RESTRICT\"\nkeyword_RIGHT=\"RIGHT\"\nkeyword_ROLLBACK=\"ROLLBACK\"\nkeyword_ROW=\"ROW\"\nkeyword_SAVEPOINT=\"SAVEPOINT\"\nkeyword_SELECT=\"SELECT\"\nkeyword_SET=\"SET\"\nkeyword_TABLE=\"TABLE\"\nkeyword_TEMP=\"TEMP\"\nkeyword_TEMPORARY=\"TEMPORARY\"\nkeyword_THEN=\"THEN\"\nkeyword_TO=\"TO\"\nkeyword_TRANSACTION=\"TRANSACTION\"\nkeyword_TRIGGER=\"TRIGGER\"\nkeyword_UNION=\"UNION\"\nkeyword_UNIQUE=\"UNIQUE\"\nkeyword_UPDATE=\"UPDATE\"\nkeyword_USING=\"USING\"\nkeyword_VACUUM=\"VACUUM\"\nkeyword_VALUES=\"VALUES\"\nkeyword_VIEW=\"VIEW\"\nkeyword_VIRTUAL=\"VIRTUAL\"\nkeyword_WHEN=\"WHEN\"\nkeyword_WHERE=\"WHERE\"\nkeyword_WITH=\"WITH\"\nkeyword_WITHOUT=\"WITHOUT\"\n\noperator_concat=\" || \"\noperator_ebove_eq=\" >=\"\n\nsnippet_1eq1=\" 1=1\"\nsnippet_at=\" @1\"\nsnippet_backticks=\" `a`\"\nsnippet_blob=\" blob\"\nsnippet_brackets=\" [a]\"\nsnippet_colon=\" :1\"\nsnippet_comment=\" /* */\"\nsnippet_date=\"2001-01-01\"\nsnippet_dollar=\" $1\"\nsnippet_dotref=\" a.b\"\nsnippet_fmtY=\"%Y\"\nsnippet_int=\" int\"\nsnippet_neg1=\" -1\"\nsnippet_pair=\" a,b\"\nsnippet_parentheses=\" (1)\"\nsnippet_plus2days=\"+2 days\"\nsnippet_qmark=\" ?1\"\nsnippet_semicolon=\" ;\"\nsnippet_star=\" *\"\nsnippet_string_pair=\" \\\"a\\\",\\\"b\\\"\"\n\nstring_dbl_q=\" \\\"a\\\"\"\nstring_escaped_q=\" 'a''b'\"\nstring_single_q=\" 'a'\"\n\npragma_application_id@1=\" application_id\"\npragma_auto_vacuum@1=\" auto_vacuum\"\npragma_automatic_index@1=\" automatic_index\"\npragma_busy_timeout@1=\" busy_timeout\"\npragma_cache_size@1=\" cache_size\"\npragma_cache_spill@1=\" cache_spill\"\npragma_case_sensitive_like@1=\" case_sensitive_like\"\npragma_checkpoint_fullfsync@1=\" checkpoint_fullfsync\"\npragma_collation_list@1=\" collation_list\"\npragma_compile_options@1=\" compile_options\"\npragma_count_changes@1=\" count_changes\"\npragma_data_store_directory@1=\" data_store_directory\"\npragma_database_list@1=\" database_list\"\npragma_default_cache_size@1=\" default_cache_size\"\npragma_defer_foreign_keys@1=\" defer_foreign_keys\"\npragma_empty_result_callbacks@1=\" empty_result_callbacks\"\npragma_encoding@1=\" encoding\"\npragma_foreign_key_check@1=\" foreign_key_check\"\npragma_foreign_key_list@1=\" foreign_key_list\"\npragma_foreign_keys@1=\" foreign_keys\"\npragma_freelist_count@1=\" freelist_count\"\npragma_full_column_names@1=\" full_column_names\"\npragma_fullfsync@1=\" fullfsync\"\npragma_ignore_check_constraints@1=\" ignore_check_constraints\"\npragma_incremental_vacuum@1=\" incremental_vacuum\"\npragma_index_info@1=\" index_info\"\npragma_index_list@1=\" index_list\"\npragma_integrity_check@1=\" integrity_check\"\npragma_journal_mode@1=\" journal_mode\"\npragma_journal_size_limit@1=\" journal_size_limit\"\npragma_legacy_file_format@1=\" legacy_file_format\"\npragma_locking_mode@1=\" locking_mode\"\npragma_max_page_count@1=\" max_page_count\"\npragma_mmap_size@1=\" mmap_size\"\npragma_page_count@1=\" page_count\"\npragma_page_size@1=\" page_size\"\npragma_parser_trace@1=\" parser_trace\"\npragma_query_only@1=\" query_only\"\npragma_quick_check@1=\" quick_check\"\npragma_read_uncommitted@1=\" read_uncommitted\"\npragma_recursive_triggers@1=\" recursive_triggers\"\npragma_reverse_unordered_selects@1=\" reverse_unordered_selects\"\npragma_schema_version@1=\" schema_version\"\npragma_secure_delete@1=\" secure_delete\"\npragma_short_column_names@1=\" short_column_names\"\npragma_shrink_memory@1=\" shrink_memory\"\npragma_soft_heap_limit@1=\" soft_heap_limit\"\npragma_stats@1=\" stats\"\npragma_synchronous@1=\" synchronous\"\npragma_table_info@1=\" table_info\"\npragma_temp_store@1=\" temp_store\"\npragma_temp_store_directory@1=\" temp_store_directory\"\npragma_threads@1=\" threads\"\npragma_user_version@1=\" user_version\"\npragma_vdbe_addoptrace@1=\" vdbe_addoptrace\"\npragma_vdbe_debug@1=\" vdbe_debug\"\npragma_vdbe_listing@1=\" vdbe_listing\"\npragma_vdbe_trace@1=\" vdbe_trace\"\npragma_wal_autocheckpoint@1=\" wal_autocheckpoint\"\npragma_wal_checkpoint@1=\" wal_checkpoint\"\npragma_writable_schema@1=\" writable_schema\"\n"
  },
  {
    "path": "projects/sqlparse/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/andialbrecht/sqlparse sqlparse\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/sqlparse\n"
  },
  {
    "path": "projects/sqlparse/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/sqlparse/fuzz_format.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport sqlparse\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  sqlparse.format(\n    fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n    output_format='python'\n  )\n\n  sqlparse.lexer.tokenize(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sqlparse/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport sqlparse\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    sqlparse.parse(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except RecursionError:\n    # Not interesting\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/sqlparse/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/andialbrecht/sqlparse\nlanguage: python\nmain_repo: https://github.com/andialbrecht/sqlparse\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/stack_data/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/alexmojaki/stack_data stack_data\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/stack_data\n"
  },
  {
    "path": "projects/stack_data/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/stack_data/fuzz_source.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nfrom stack_data import Source\n\n\ndef TestOneInput(data):\n  fuzz_file = '/tmp/fuzz_data.py'\n  with open(fuzz_file, 'wb') as f:\n    f.write(data)\n  try:\n    src = Source.for_filename(fuzz_file)\n  except:\n    return\n\n  list(src.pieces)\n  try:\n    src.tokens_by_line\n  except AttributeError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/stack_data/project.yaml",
    "content": "homepage: https://github.com/alexmojaki/stack_data\nmain_repo: https://github.com/alexmojaki/stack_data\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/starlark-rust/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/facebookexperimental/starlark-rust.git starlark-rust\nRUN rustup update nightly\nWORKDIR starlark-rust\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/starlark-rust/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nfind . -name '*.star' -exec zip starlark_seed_corpus.zip {} \\;\n\ncd starlark\ncargo +nightly fuzz build -O\n\nFUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n\n"
  },
  {
    "path": "projects/starlark-rust/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/facebookexperimental/starlark-rust/\"\nlanguage: rust\n\nprimary_contact: \"ndmitchell@gmail.com\"\nmain_repo: \"https://github.com/facebookexperimental/starlark-rust.git\"\nfile_github_issue: false\nauto_ccs:\n  - \"nathaniel.brough@gmail.com\"\nvendor_ccs:\n  - \"oss-fuzz@fb.com\"\n\n# Rust only supports libfuzzer+address sanitizer\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  -  address"
  },
  {
    "path": "projects/starnix-netlink/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone https://fuchsia.googlesource.com/fuchsia\nWORKDIR $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink\n\nCOPY build.sh $SRC/\nCOPY fuzz $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink/fuzz\n\n# Copy Cargo.toml to different modules\nCOPY cargo.toml/parent $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink/Cargo.toml\nCOPY cargo.toml/core $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink/netlink_packet_core/Cargo.toml\nCOPY cargo.toml/generic $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink/netlink_packet_generic/Cargo.toml\nCOPY cargo.toml/route $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink/netlink_packet_route/Cargo.toml\nCOPY cargo.toml/sock_diag $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink/netlink_packet_sock_diag/Cargo.toml\nCOPY cargo.toml/utils $SRC/fuchsia/src/starnix/lib/third_party/rust_netlink/netlink_packet_utils/Cargo.toml\n"
  },
  {
    "path": "projects/starnix-netlink/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Update local crate.io vendors\ncargo vendor -- /src/fuchsia/third_party/rust_crates/vendor/\n\n# Build the fuzzers and project source code\ncargo fuzz build\n\n# Copy built fuzzer binaries to $OUT\ncp /src/fuchsia/out/cargo_target/x86_64-unknown-linux-gnu/release/core_fuzzer $OUT/\ncp /src/fuchsia/out/cargo_target/x86_64-unknown-linux-gnu/release/utils_fuzzer $OUT/\n"
  },
  {
    "path": "projects/starnix-netlink/cargo.toml/core",
    "content": "[package]\nname = \"netlink_packet_core\"\nversion = \"0.1.0\"\nedition = \"2018\"\n\n[dependencies]\nanyhow = { path = \"/src/fuchsia/third_party/rust_crates/vendor/anyhow-1.0.86\" }\nbyteorder = \"1.5\"\nnetlink_packet_utils = { path = \"../netlink_packet_utils\" }\n\n[lib]\nname = \"netlink_packet_core\"\npath = \"src/lib.rs\"\n"
  },
  {
    "path": "projects/starnix-netlink/cargo.toml/generic",
    "content": "[package]\nname = \"netlink_packet_generic\"\nversion = \"0.1.0\"\nedition = \"2018\"\n\n[dependencies]\nanyhow = { path = \"/src/fuchsia/third_party/rust_crates/vendor/anyhow-1.0.86\" }\nbyteorder = \"1.5\"\nnetlink_packet_core = { path = \"../netlink_packet_core\" }\nnetlink_packet_utils = { path = \"../netlink_packet_utils\" }\n\n[lib]\nname = \"netlink_packet_generic\"\npath = \"src/lib.rs\"\n"
  },
  {
    "path": "projects/starnix-netlink/cargo.toml/parent",
    "content": "[workspace]\nmembers = [\n    \"netlink_packet_core\",\n    \"netlink_packet_generic\",\n    \"netlink_packet_route\",\n    \"netlink_packet_sock_diag\",\n    \"netlink_packet_utils\",\n    \"fuzz\"\n]\n"
  },
  {
    "path": "projects/starnix-netlink/cargo.toml/route",
    "content": "[package]\nname = \"netlink_packet_route\"\nversion = \"0.1.0\"\nedition = \"2018\"\n\n[dependencies]\nanyhow = { path = \"/src/fuchsia/third_party/rust_crates/vendor/anyhow-1.0.86\" }\nbitflags = { path = \"/src/fuchsia/third_party/rust_crates/vendor/bitflags-2.4.1\" }\nbyteorder = \"1.5\"\nlibc = \"0.2.158\"\nlog = { path = \"/src/fuchsia/third_party/rust_crates/vendor/log-0.4.22\", features = [\"std\"] }\nthiserror = { path = \"/src/fuchsia/third_party/rust_crates/vendor/thiserror-1.0.57\" }\nnetlink_packet_core = { path = \"../netlink_packet_core\" }\nnetlink_packet_utils = { path = \"../netlink_packet_utils\" }\n\n[lib]\nname = \"netlink_packet_route\"\npath = \"src/lib.rs\"\n\n[features]\nrich_nlas = []\n"
  },
  {
    "path": "projects/starnix-netlink/cargo.toml/sock_diag",
    "content": "[package]\nname = \"netlink_packet_sock_diag\"\nversion = \"0.1.0\"\nedition = \"2018\"\n\n[dependencies]\nanyhow = { path = \"/src/fuchsia/third_party/rust_crates/vendor/anyhow-1.0.86\" }\nbitflags = { path = \"/src/fuchsia/third_party/rust_crates/vendor/bitflags-2.4.1\" }\nbyteorder = \"1.5\"\nlibc = \"0.2.158\"\nsmallvec = { path = \"/src/fuchsia/third_party/rust_crates/vendor/smallvec-1.13.1\" }\nnetlink_packet_core = { path = \"../netlink_packet_core\" }\nnetlink_packet_utils = { path = \"../netlink_packet_utils\" }\n\n[lib]\nname = \"netlink_packet_sock_diag\"\npath = \"src/lib.rs\"\n\n[features]\nrich_nlas = []\n"
  },
  {
    "path": "projects/starnix-netlink/cargo.toml/utils",
    "content": "[package]\nname = \"netlink_packet_utils\"\nversion = \"0.1.0\"\nedition = \"2018\"\n\n[dependencies]\nanyhow = { path = \"/src/fuchsia/third_party/rust_crates/vendor/anyhow-1.0.86\" }\nbitflags = { path = \"/src/fuchsia/third_party/rust_crates/vendor/bitflags-2.4.1\" }\nbyteorder = \"1.5\"\npaste = { path = \"/src/fuchsia/third_party/rust_crates/vendor/paste-1.0.9\" }\nthiserror = { path = \"/src/fuchsia/third_party/rust_crates/vendor/thiserror-1.0.57\" }\n\n[lib]\nname = \"netlink_packet_utils\"\npath = \"src/lib.rs\"\n"
  },
  {
    "path": "projects/starnix-netlink/fuzz/.gitignore",
    "content": "target\ncorpus\nartifacts\ncoverage\n"
  },
  {
    "path": "projects/starnix-netlink/fuzz/Cargo.toml",
    "content": "[package]\nname = \"netlink_fuzz\"\nversion = \"0.0.0\"\npublish = false\nedition = \"2018\"\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies]\nlibfuzzer-sys = \"0.4\"\narbitrary = \"1.3.2\"\nderive_arbitrary = \"1.3.2\"\nnetlink_packet_core = { path = \"../netlink_packet_core\" }\nnetlink_packet_generic = { path = \"../netlink_packet_generic\" }\nnetlink_packet_route = { path = \"../netlink_packet_route\" }\nnetlink_packet_sock_diag = { path = \"../netlink_packet_sock_diag\" }\nnetlink_packet_utils = { path = \"../netlink_packet_utils\" }\n\n[[bin]]\nname = \"core_fuzzer\"\npath = \"fuzz_targets/core_fuzzer.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"utils_fuzzer\"\npath = \"fuzz_targets/utils_fuzzer.rs\"\ntest = false\ndoc = false\nbench = false\n"
  },
  {
    "path": "projects/starnix-netlink/fuzz/fuzz_targets/core_fuzzer.rs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\nuse arbitrary::{Arbitrary, Unstructured};\nuse derive_arbitrary::Arbitrary;\nuse libfuzzer_sys::fuzz_target;\nuse netlink_packet_core::buffer::NetlinkBuffer;\nuse netlink_packet_core::constants::*;\nuse netlink_packet_core::done::DoneBuffer;\nuse netlink_packet_core::error::ErrorBuffer;\nuse netlink_packet_core::header::NetlinkHeader;\n\n// Derive random data from fuzz input\n#[derive(Arbitrary, Debug)]\nstruct FuzzInput {\n    message_type: u16,\n    sequence_number: u32,\n    port_number: u32,\n    buffer_data: Vec<u8>,\n    payload_data: Vec<u8>,\n}\n\nfuzz_target!(|data: &[u8]| {\n    // Initialize Unstructured for parsing the data\n    let mut unstructured = Unstructured::new(data);\n\n    // Attempt to parse the fuzz input structure\n    if let Ok(fuzz_input) = FuzzInput::arbitrary(&mut unstructured) {\n        // Fuzz NetlinkBuffer\n        if let Ok(netlink_buffer) = NetlinkBuffer::new_checked(&fuzz_input.buffer_data) {\n            let _ = netlink_buffer.payload_length();\n            let _ = netlink_buffer.payload();\n        }\n\n        // Fuzz DoneBuffer\n        if let Ok(done_buffer) = DoneBuffer::new_checked(&fuzz_input.buffer_data) {\n            let _ = done_buffer.code();\n            let _ = done_buffer.extended_ack();\n        }\n\n        // Fuzz ErrorBuffer\n        if let Ok(error_buffer) = ErrorBuffer::new_checked(&fuzz_input.buffer_data) {\n            let _code = error_buffer.code();\n            let _payload = error_buffer.payload();\n        }\n    }\n});\n"
  },
  {
    "path": "projects/starnix-netlink/fuzz/fuzz_targets/utils_fuzzer.rs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\n\nuse arbitrary::{Arbitrary, Unstructured};\nuse derive_arbitrary::Arbitrary;\nuse libfuzzer_sys::fuzz_target;\nuse netlink_packet_utils::nla::{DefaultNla, NlaBuffer};\nuse netlink_packet_utils::parsers::*;\nuse netlink_packet_utils::traits::{Emitable, Parseable};\n\n// Derive random data from fuzz input\n#[derive(Arbitrary, Debug)]\nstruct FuzzInput {\n    mac_data: [u8; 6],\n    ip_data: Vec<u8>,\n    utf8_data: Vec<u8>,\n    nla_kind: u16,\n    nla_value: Vec<u8>,\n}\n\nfuzz_target!(|data: &[u8]| {\n    // Attempt to create a FuzzInput struct from the fuzzed data\n    let mut unstructured = Unstructured::new(data);\n    let fuzz_input = match FuzzInput::arbitrary(&mut unstructured) {\n        Ok(input) => input,\n        Err(_) => return,\n    };\n\n    // Fuzz parse_mac\n    let _ = parse_mac(&fuzz_input.mac_data);\n\n    // Fuzz parse_ip\n    let _ = parse_ip(&fuzz_input.ip_data);\n\n    // Fuzz parse_string\n    let _ = parse_string(&fuzz_input.utf8_data);\n\n    // Fuzz NlaBuffer\n    if let Ok(nla_buf) = NlaBuffer::new_checked(&fuzz_input.nla_value) {\n        let _ = nla_buf.kind();\n        let _ = nla_buf.length();\n        let _ = nla_buf.value_length();\n    }\n\n    // Fuzz DefaultNla\n    let nla = DefaultNla::new(fuzz_input.nla_kind, fuzz_input.nla_value.clone());\n    let mut emit_buffer = vec![0; nla.buffer_len()];\n    nla.emit(&mut emit_buffer);\n\n    // Fuzz DefaultNla parsing\n    if let Ok(nla_buf) = NlaBuffer::new_checked(&fuzz_input.nla_value) {\n        let _ = DefaultNla::parse(&nla_buf);\n    }\n});\n"
  },
  {
    "path": "projects/starnix-netlink/project.yaml",
    "content": "homepage: \"https://cs.opensource.google/fuchsia/fuchsia/+/main:src/starnix/lib/third_party/rust_netlink\"\nmain_repo: \"https://fuchsia.googlesource.com/fuchsia\"\nprimary_contact: \"fuzzing@fuchsia.dev\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/stax/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get update && apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME stax\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://git.openjdk.org/jdk/ ${SRC}/jdk\n#\n# Install jdk dependencies. Current master needs JDK 19 or newer, which isn't available\n# in ubuntu's repositories yet\n#\nRUN apt-get update && apt-get install -y autoconf file libasound2-dev libcups2-dev libfontconfig1-dev \\\n\t\tlibx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev\nRUN curl -o ${SRC}/jdk-25_linux-x64_bin.deb https://download.oracle.com/java/25/latest/jdk-25_linux-x64_bin.deb && \\\n\tapt-get update && apt-get install -y ${SRC}/jdk-25_linux-x64_bin.deb && \\\n\tln -sf $(ls -d /usr/lib/jvm/jdk-25*) /usr/lib/jvm/jdk-25\nENV JAVA_HOME=/usr/lib/jvm/jdk-25/\nENV CC gcc\nENV CXX g++\n#\n# apply fixes\n#\n#ADD *.patch ${SRC}/\n#RUN cd ${SRC}/${LIBRARY_NAME} && (for i in ${SRC}/*.patch; do tr -d '\\015' < $i | git apply -v; done )\n\nADD build.sh build-jdk.sh enable-jdk.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}\n"
  },
  {
    "path": "projects/stax/build-jdk.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif ! test -e ${OUT}/jdk.tar.xz; then\n\tpushd ${SRC}/jdk\n\t\tbash configure --build x86_64-linux-gnu --disable-warnings-as-errors\n\t\tmake images\n\t\tpushd ${SRC}/jdk/build/linux-x86_64-server-release/images\n\t\t\ttar cf ${OUT}/jdk.tar.xz jdk\n\t\tpopd\n\tpopd\nfi\n"
  },
  {
    "path": "projects/stax/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_SUBDIR=\"\"\nMVN_FLAGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests -Dmaven.javadoc.skip=true\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.14.0\" \\\n\t\t-Dpackaging=jar\npopd\n\nCURRENT_VERSION=\"0.1\"\npushd \"${SRC}\"\n\t. ${SRC}/build-jdk.sh\n\t. ${SRC}/enable-jdk.sh\n\tinstall -v ${SRC}/enable-jdk.sh ${OUT}/enable-jdk.sh\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\n. \\${this_dir}/enable-jdk.sh\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n--instrumentation_includes=\\\"javax.xml.stream.**\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/stax/enable-jdk.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif ! test -d ${OUT}/jdk; then\n\tpushd ${OUT}\n\t\ttar xf ${OUT}/jdk.tar.xz\n\tpopd\nfi\nexport JAVA_HOME=${OUT}/jdk\nexport PATH=${JAVA_HOME}/bin:${PATH}\n"
  },
  {
    "path": "projects/stax/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/stax/project.yaml",
    "content": "homepage: \"https://docs.oracle.com/javase/8/docs/api/index.html?javax/xml/stream/package-summary.html\"\nlanguage: jvm\nmain_repo: \"https://github.com/openjdk/jdk/tree/master/src/java.xml/share/classes\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/stax/stax-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>stax-fuzzer</artifactId>\n\t<version>0.1</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.14.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.14.0</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/stax/stax-fuzzer/src/main/java/ossfuzz/XMLStreamReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage ossfuzz;\n\nimport java.io.ByteArrayInputStream;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport javax.xml.stream.XMLInputFactory;\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.XMLStreamReader;\n\n\npublic class XMLStreamReaderFuzzer {\n\n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public XMLStreamReaderFuzzer(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        this.fuzzedDataProvider = fuzzedDataProvider;\n    }\n\n    void test() {\n        try {\n            ByteArrayInputStream stream = new ByteArrayInputStream(fuzzedDataProvider.consumeRemainingAsBytes());\n            XMLInputFactory factory = XMLInputFactory.newInstance();\n            XMLStreamReader reader = factory.createXMLStreamReader(stream);\n            while(reader.hasNext()) {\n                reader.next();\n            }\n        } catch (XMLStreamException exception) {\n            /* ignore */\n        } catch (IllegalArgumentException exception) {\n            /* ignore */\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider)  throws Exception {\n\n        XMLStreamReaderFuzzer fixture = new XMLStreamReaderFuzzer(fuzzedDataProvider);\n        fixture.test();\n    }\n}"
  },
  {
    "path": "projects/stb/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y wget tar\n\n\nRUN git clone --depth 1 https://github.com/nothings/stb.git\n\nRUN mkdir $SRC/stbi # CIFuzz workaround\n\nRUN wget -O $SRC/stbi/gif.tar.gz https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/imagetestsuite/imagetestsuite-gif-1.00.tar.gz\nRUN wget -O $SRC/stbi/jpg.tar.gz https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/imagetestsuite/imagetestsuite-jpg-1.00.tar.gz\nRUN wget -O $SRC/stbi/bmp.zip http://entropymine.com/jason/bmpsuite/releases/bmpsuite-2.6.zip\nRUN wget -O $SRC/stbi/tga.zip https://github.com/richgel999/tga_test_files/archive/master.zip\n\nRUN wget -O $SRC/stbi/gif.dict https://raw.githubusercontent.com/mirrorer/afl/master/dictionaries/gif.dict\n\n# Maintain compatibility with master branch until a new release\nRUN cp $SRC/stbi/gif.tar.gz $SRC/stbi/jpg.tar.gz $SRC/stbi/bmp.zip $SRC/stbi/gif.dict $SRC/stb\n\nWORKDIR stb\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/stb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project\n$SRC/stb/tests/ossfuzz.sh\n"
  },
  {
    "path": "projects/stb/project.yaml",
    "content": "homepage: \"https://github.com/nothings/stb\"\nlanguage: c++\nprimary_contact: \"nothings.org@gmail.com\"\nauto_ccs:\n  - \"randy440088@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/nothings/stb.git'\n"
  },
  {
    "path": "projects/stringtemplate4/Dockerfile",
    "content": "\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/antlr/stringtemplate4.git stringtemplate4\n\nCOPY build.sh $SRC/\nCOPY StringFuzzer.java $SRC/\nWORKDIR $SRC/stringtemplate4\n"
  },
  {
    "path": "projects/stringtemplate4/StringFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.stringtemplate.v4.*;\n\npublic class StringFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n      ST stringtemplate = new ST(\"Hello <name>\");\n      stringtemplate.add(\"name\", data.consumeRemainingAsString());\n      stringtemplate.render();\n  }\n}\n"
  },
  {
    "path": "projects/stringtemplate4/build.sh",
    "content": "\n#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move dictionary.\n#mv $SRC/*.dict $OUT\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/ST4-$CURRENT_VERSION.jar\" $OUT/ST4.jar\n\nALL_JARS=\"ST4.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/stringtemplate4/project.yaml",
    "content": "homepage: \"https://github.com/antlr/stringtemplate4\"\nlanguage: jvm\nprimary_contact: \"parrt@antlr.org\"\nfuzzing_engines:\n  - \"libfuzzer\"\nsanitizers:\n  - \"address\"\nmain_repo: \"https://github.com/antlr/stringtemplate4.git\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/strongswan/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##############################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y automake autoconf libtool pkg-config gettext perl python flex bison gperf lcov libgmp3-dev\nRUN git clone --depth 1 --no-single-branch https://github.com/strongswan/strongswan.git strongswan\nRUN git clone --depth 1 https://github.com/strongswan/fuzzing-corpora.git strongswan/fuzzing-corpora\nWORKDIR strongswan\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/strongswan/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh\n\n./configure CFLAGS=\"$CFLAGS -DNO_CHECK_MEMWIPE -DDEBUG_LEVEL=-1\" \\\n\t--enable-imc-test \\\n\t--enable-tnccs-20 \\\n\t--enable-libipsec \\\n\t--enable-eap-radius \\\n\t--enable-fuzzing \\\n\t--with-libfuzzer=$LIB_FUZZING_ENGINE \\\n\t--enable-monolithic \\\n\t--disable-shared \\\n\t--enable-static\n\nmake -j$(nproc)\n\nfuzzers=$(find fuzz -maxdepth 1 -executable -type f -name 'fuzz_*')\nfor f in $fuzzers; do\n\tfuzzer=$(basename $f)\n\tcp $f $OUT/\n\tcorpus=${fuzzer#fuzz_}\n\tif [ -d \"fuzzing-corpora/${corpus}\" ]; then\n\t\tzip -rj $OUT/${fuzzer}_seed_corpus.zip fuzzing-corpora/${corpus}\n\tfi\ndone\n"
  },
  {
    "path": "projects/strongswan/project.yaml",
    "content": "homepage: \"https://www.strongswan.org\"\nlanguage: c++\nprimary_contact: \"security@strongswan.org\"\nauto_ccs:\n  - \"tobias@strongswan.org\"\n  - \"andreas.steffen@strongswan.org\"\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\nmain_repo: 'https://github.com/strongswan/strongswan.git'\n"
  },
  {
    "path": "projects/struts/.gitignore",
    "content": ".idea\n"
  },
  {
    "path": "projects/struts/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME struts2\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/apache/struts ${LIBRARY_NAME}\n\nRUN apt install -y openjdk-17-jdk-headless\nENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}\n"
  },
  {
    "path": "projects/struts/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_SUBDIR=\"\"\nMVN_FLAGS=\"-DskipTests\"\nALL_JARS=\"\"\nFUZZER_VERSION=1.1\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} --no-transfer-progress install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.23.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}/${SRC_SUBDIR}\"\n\t${MVN} --no-transfer-progress install ${MVN_FLAGS}\n\tSTRUTS_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n  FUZZER_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -DfuzzedLibraryVersion=\"${STRUTS_VERSION}\" -Dexpression=project.version -q -DforceStdout)\n\t${MVN} --no-transfer-progress package -DfuzzedLibraryVersion=\"${STRUTS_VERSION}\" ${MVN_FLAGS}\n\tinstall -v fuzzer/target/${LIBRARY_NAME}-fuzzer-${FUZZER_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${FUZZER_VERSION}.jar\n\tinstall -v webapp/target/struts2-webapp.war ${OUT}/struts2-webapp.war\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${FUZZER_VERSION}.jar\"\npopd\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\n\techo \"#!/bin/bash\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\n\npushd \\$this_dir\n\n\texport JAZZER_MAX_NUM_COUNTERS=\\\"16777216\\\"\n\texport LD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir\n\n\t\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n\t\t--cp=${RUNTIME_CLASSPATH} \\\n\t\t--target_class=${fuzzer_classname} \\\n\t\t--jvm_args=\\\"-Xmx2048m\\\" \\\n\t\t\\$@\n\npopd\n\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone\n"
  },
  {
    "path": "projects/struts/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/struts/project.yaml",
    "content": "homepage: \"https://github.com/apache/struts\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/struts.git\"\nprimary_contact: \"lukasz.lenart@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nauto_ccs:\n  - \"security@struts.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/.gitignore",
    "content": ".idea\ntarget\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <artifactId>struts2-fuzzer</artifactId>\n    <packaging>jar</packaging>\n\n    <parent>\n        <groupId>ossfuzz</groupId>\n        <artifactId>parent-project</artifactId>\n        <version>1.1</version>\n    </parent>\n\n    <properties>\n        <maven.compiler.source>17</maven.compiler.source>\n        <maven.compiler.target>17</maven.compiler.target>\n        <jetty.version>11.0.24</jetty.version>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <!-- This repositories list is copy pasted from the projects' main BOM -->\n\n    <dependencies>\n        <!--\n            On the CI, install the jazzer file with\n\n                mvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n                    -DgroupId=\"com.code-intelligence\" \\\n                    -DartifactId=\"jazzer-api\" \\\n                    -Dversion=\"0.23.0\" \\\n                    -Dpackaging=jar\n\n            in order to avoid mismatching driver/api versions.\n        -->\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-api</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>jakarta.servlet</groupId>\n            <artifactId>jakarta.servlet-api</artifactId>\n        </dependency>\n\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-server</artifactId>\n            <version>${jetty.version}</version>\n        </dependency>\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-servlet</artifactId>\n            <version>${jetty.version}</version>\n        </dependency>\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>jetty-webapp</artifactId>\n            <version>${jetty.version}</version>\n        </dependency>\n        <dependency>\n            <groupId>org.eclipse.jetty</groupId>\n            <artifactId>apache-jsp</artifactId>\n            <version>${jetty.version}</version>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-shade-plugin</artifactId>\n                <version>3.6.0</version>\n                <configuration>\n                    <filters>\n                        <filter>\n                            <artifact>*:*</artifact>\n                            <excludes>\n                                <exclude>META-INF/*.SF</exclude>\n                                <exclude>META-INF/*.DSA</exclude>\n                                <exclude>META-INF/*.RSA</exclude>\n                            </excludes>\n                        </filter>\n                    </filters>\n                </configuration>\n                <executions>\n                    <execution>\n                        <phase>package</phase>\n                        <goals>\n                            <goal>shade</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.eclipse.jetty</groupId>\n                <artifactId>jetty-maven-plugin</artifactId>\n                <version>11.0.18</version>\n                <configuration>\n                    <stopKey>CTRL+C</stopKey>\n                    <stopPort>8999</stopPort>\n                    <httpConnector>\n                        <port>8080</port>\n                    </httpConnector>\n                    <scan>10</scan>\n                    <webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>\n                    <webApp>\n                        <contextPath>/</contextPath>\n                        <descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>\n                    </webApp>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/fuzzer/src/main/java/org/apache/struts/test/StrutsSimpleRequestFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\npackage org.apache.struts.test;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.webapp.WebAppContext;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\n\npublic class StrutsSimpleRequestFuzzer {\n\n    private static String g_host = \"localhost\";\n    private static int g_port = 8080;\n\n    public static void main(String args[]) {\n        new StrutsSimpleRequestFuzzer().runTest(\"hello.action\");\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) {\n        new StrutsSimpleRequestFuzzer().runTest(fuzzedDataProvider.consumeRemainingAsString());\n    }\n\n    public void runTest(String fuzzyString) {\n        com.code_intelligence.jazzer.api.BugDetectors.allowNetworkConnections();\n\n        Server server = null;\n\n        try {\n            server = new Server(g_port);\n\n            // Configure the struts web application ...\n            WebAppContext strutsWebApp = new WebAppContext();\n\n            strutsWebApp.setDescriptor(\"/WEB-INF/web.xml\");\n\n            File warFile = new File(\"struts2-webapp.war\");\n            strutsWebApp.setWar(warFile.getAbsolutePath());\n\n            strutsWebApp.setContextPath(\"/struts-test\");\n            //strutsWebApp.setParentLoaderPriority(true);\n\n            // ... add it to the server configuration in order  to serve requests to /struts-test\n            server.setHandler(strutsWebApp);\n\n            // Start the server.\n            do {\n                try {\n                    server.start();\n                } catch (Exception ex) {\n                    /* port still locked? */\n                }\n            } while (!server.isStarted());\n\n            HttpURLConnection http = (HttpURLConnection) new URL(\"http://\" + g_host + \":\" + g_port + \"/struts-test/\" + fuzzyString).openConnection();\n            http.connect();\n\n            System.out.println(http.getResponseCode() + \" \" + http.getResponseMessage());\n        } catch (IOException | IllegalArgumentException ex) {\n            /* ignore */\n        } finally {\n            if (server != null) {\n                do {\n                    try {\n                        server.stop();\n                    } catch (Exception ex) {\n                        /* shouldn't happen */\n                    }\n                } while (!server.isStopped());\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>ossfuzz</groupId>\n    <artifactId>parent-project</artifactId>\n    <version>1.1</version>\n    <packaging>pom</packaging>\n\n    <properties>\n        <maven.compiler.source>17</maven.compiler.source>\n        <maven.compiler.target>17</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n        <struts.version>${fuzzedLibraryVersion}</struts.version>\n    </properties>\n\n    <modules>\n        <module>webapp</module>\n        <module>fuzzer</module>\n    </modules>\n\n    <dependencyManagement>\n        <dependencies>\n            <dependency>\n                <groupId>com.code-intelligence</groupId>\n                <artifactId>jazzer-api</artifactId>\n                <version>0.23.0</version>\n                <scope>provided</scope>\n            </dependency>\n            <dependency>\n                <groupId>jakarta.servlet</groupId>\n                <artifactId>jakarta.servlet-api</artifactId>\n                <version>6.0.0</version>\n                <scope>provided</scope>\n            </dependency>\n            <dependency>\n                <groupId>jakarta.servlet.jsp</groupId>\n                <artifactId>jakarta.servlet.jsp-api</artifactId>\n                <version>3.1.0</version>\n                <scope>provided</scope>\n            </dependency>\n        </dependencies>\n    </dependencyManagement>\n</project>\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/webapp/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <artifactId>struts2-webapp</artifactId>\n    <packaging>war</packaging>\n\n    <parent>\n        <groupId>ossfuzz</groupId>\n        <artifactId>parent-project</artifactId>\n        <version>1.1</version>\n    </parent>\n\n    <properties>\n        <maven.compiler.source>17</maven.compiler.source>\n        <maven.compiler.target>17</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <!-- This repositories list is copy pasted from the projects' main BOM -->\n\n    <dependencies>\n        <!--\n            On the CI, install the jazzer file with\n\n                mvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n                    -DgroupId=\"com.code-intelligence\" \\\n                    -DartifactId=\"jazzer-api\" \\\n                    -Dversion=\"0.15.0\" \\\n                    -Dpackaging=jar\n\n            in order to avoid mismatching driver/api versions.\n        -->\n        <dependency>\n            <groupId>org.apache.struts</groupId>\n            <artifactId>struts2-core</artifactId>\n            <version>${struts.version}</version>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.logging.log4j</groupId>\n            <artifactId>log4j-core</artifactId>\n            <version>2.24.2</version>\n        </dependency>\n        <dependency>\n            <groupId>jakarta.servlet</groupId>\n            <artifactId>jakarta.servlet-api</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>jakarta.servlet.jsp</groupId>\n            <artifactId>jakarta.servlet.jsp-api</artifactId>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <finalName>struts2-webapp</finalName>\n        <plugins>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-war-plugin</artifactId>\n                <version>3.4.0</version>\n                <configuration>\n                    <webXml>src\\main\\webapp\\WEB-INF\\web.xml</webXml>\n                </configuration>\n            </plugin>\n\n            <plugin>\n                <groupId>org.eclipse.jetty</groupId>\n                <artifactId>jetty-maven-plugin</artifactId>\n                <version>11.0.18</version>\n                <configuration>\n                    <webApp>\n                        <contextPath>/${project.build.finalName}</contextPath>\n                    </webApp>\n                    <stopKey>CTRL+C</stopKey>\n                    <stopPort>8999</stopPort>\n                    <scan>10</scan>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n</project>\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/webapp/src/main/java/org/apache/struts/test/TestAction.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage org.apache.struts.test;\n\nimport org.apache.struts2.ActionSupport;\n\npublic class TestAction extends ActionSupport {\n    private String subject = \"World (from Java)\";\n\n    public String execute() {\n        return ActionSupport.SUCCESS;\n    }\n\n    public String getSubject() {\n        return this.subject;\n    }\n\n    public void setSubject(String subject) {\n        if (subject != null) {\n            this.subject = subject;\n        }\n    }\n}"
  },
  {
    "path": "projects/struts/struts2-fuzzer/webapp/src/main/resources/struts.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE struts PUBLIC\n        \"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN\"\n        \"http://struts.apache.org/dtds/struts-2.5.dtd\">\n<struts>\n    <package name=\"basicstruts2\" extends=\"struts-default\">\n        <action name=\"index\">\n            <result>/index.jsp</result>\n        </action>\n\n        <action name=\"hello\" class=\"org.apache.struts.test.TestAction\" method=\"execute\">\n            <result name=\"success\">/HelloWorld.jsp</result>\n        </action>\n    </package>\n</struts>\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/webapp/src/main/webapp/HelloWorld.jsp",
    "content": "<!DOCTYPE html>\n<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\" pageEncoding=\"UTF-8\" %>\n<%@ taglib prefix=\"s\" uri=\"/struts-tags\" %>\n<html>\n  <head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n    <title>Hello World!</title>\n  </head>\n  <body>\n    Hello\n    <h2><s:property value=\"subject\" /></h2>\n  </body>\n</html>"
  },
  {
    "path": "projects/struts/struts2-fuzzer/webapp/src/main/webapp/WEB-INF/web.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<web-app xmlns=\"http://xmlns.jcp.org/xml/ns/javaee\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://xmlns.jcp.org/xml/ns/javaee\n         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd\"\n         version=\"3.1\">\n\n    <display-name>Basic Struts2</display-name>\n    <filter>\n        <filter-name>struts2</filter-name>\n        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>\n    </filter>\n\n    <filter-mapping>\n        <filter-name>struts2</filter-name>\n        <url-pattern>/*</url-pattern>\n    </filter-mapping>\n\n    <welcome-file-list>\n        <welcome-file>index</welcome-file>\n    </welcome-file-list>\n</web-app>\n"
  },
  {
    "path": "projects/struts/struts2-fuzzer/webapp/src/main/webapp/index.jsp",
    "content": "<!DOCTYPE html>\n<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\" pageEncoding=\"UTF-8\" %>\n<html>\n    <head>\n        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n        <title>Basic Struts 2 Application - Welcome</title>\n    </head>\n    <body>\n        <h1>Welcome To Struts 2!</h1>\n    </body>\n</html>"
  },
  {
    "path": "projects/sudoers/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone https://github.com/sudo-project/sudo\n\nWORKDIR $SRC/sudo\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/sudoers/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Debugging\nenv\n\n# Some of the sanitizer flags cause issues with configure tests.\n# Pull them out of CFLAGS and pass them to configure instead.\nif [ $SANITIZER == \"coverage\" -a -n \"$COVERAGE_FLAGS\" ]; then\n    CFLAGS=\"`echo \\\"$CFLAGS\\\" | sed \\\"s/ $COVERAGE_FLAGS//\\\"`\"\n    sanitizer_opts=\"$COVERAGE_FLAGS\"\nelif [ -n \"$SANITIZER_FLAGS\" ]; then\n    CFLAGS=\"`echo \\\"$CFLAGS\\\" | sed \\\"s/ $SANITIZER_FLAGS//\\\"`\"\n    sanitizer_opts=\"$SANITIZER_FLAGS\"\nelse\n    sanitizer_opts=no\nfi\n\n# This is already added by --enable-fuzzer\nCFLAGS=\"`echo \\\"$CFLAGS\\\" | sed 's/ -fsanitize=fuzzer-no-link//'`\"\n\n# Copy optimization flag to LDFLAGS for UBSan object-size check.\nOPTFLAG=\"`echo \\\"$CFLAGS\\\" | sed 's/^.*\\(-O[^ ]\\).*$/\\1/'`\"\nexport LDFLAGS=\"${LDFLAGS:-}${LDFLAGS:+ }$OPTFLAG\"\n\n# Build sudo with static libs and enable fuzzing targets.\n# All fuzz targets are integrated into the build process.\n./configure --disable-shared --disable-shared-libutil --enable-static-sudoers \\\n    --enable-sanitizer=\"$sanitizer_opts\" --enable-fuzzer \\\n    --enable-fuzzer-engine=\"$LIB_FUZZING_ENGINE\" --enable-fuzzer-linker=\"$CXX\" \\\n    --enable-warnings --enable-werror\nmake -j$(nproc) && make FUZZ_DESTDIR=$OUT install-fuzzer\n"
  },
  {
    "path": "projects/sudoers/project.yaml",
    "content": "homepage: \"https://github.com/sudo-project\"\nprimary_contact: \"sudo@sudo.ws\"\nlanguage: c\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nauto_ccs:\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/sudo-project/sudo'\n"
  },
  {
    "path": "projects/sudoers/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nmake check\n"
  },
  {
    "path": "projects/suricata/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y build-essential autoconf automake libtool make pkg-config  python flex bison zlib1g-dev libpcre3-dev cmake tshark\n\n# TODO libmagic, liblzma and other optional libraries\nADD https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.39/pcre2-10.39.tar.gz pcre2-10.39.tar.gz\nADD https://www.tcpdump.org/release/libpcap-1.9.1.tar.gz libpcap-1.9.1.tar.gz\nADD https://github.com/akheron/jansson/releases/download/v2.14/jansson-2.14.tar.gz jansson-2.14.tar.gz\nRUN git clone --depth=1 https://github.com/yaml/libyaml\nADD https://github.com/lz4/lz4/archive/v1.9.2.tar.gz lz4-1.9.2.tar.gz\nRUN git clone --depth 1 https://github.com/catenacyber/quadfuzz.git\nRUN git clone --depth 1 -b develop https://github.com/madler/zlib.git\nRUN git clone --depth=1 https://github.com/catenacyber/fuzzpcap\n\nADD https://rules.emergingthreats.net/open/suricata/emerging.rules.zip emerging.rules.zip\n\nRUN cargo install --force cbindgen\n\nRUN git clone --depth 1 https://github.com/OISF/suricata.git suricata\nRUN git clone --depth 1 --branch main-7.0.x https://github.com/OISF/suricata.git suricata7\nRUN git clone --depth 1 https://github.com/OISF/libhtp.git libhtp\nRUN git clone --depth 1 https://github.com/OISF/suricata-verify suricata-verify\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/suricata/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build dependencies statically\nif [ \"$SANITIZER\" = \"memory\" ]\nthen\n    (\n    cd zlib\n    ./configure --static\n    make -j$(nproc) clean\n    make -j$(nproc) all\n    make -j$(nproc) install\n    )\nfi\n\n(\ntar -xvzf pcre2-10.39.tar.gz\ncd pcre2-10.39\n./configure --disable-shared\nmake -j$(nproc) clean\nmake -j$(nproc) all\nmake -j$(nproc) install\n)\n\ntar -xvzf lz4-1.9.2.tar.gz\ncd lz4-1.9.2\nmake liblz4.a\ncp lib/liblz4.a /usr/local/lib/\ncp lib/lz4*.h /usr/local/include/\ncd ..\n\ntar -xvzf jansson-2.14.tar.gz\ncd jansson-2.14\n./configure --disable-shared\nmake -j$(nproc)\nmake install\ncd ..\n\ntar -xvzf libpcap-1.9.1.tar.gz\ncd libpcap-1.9.1\n./configure --disable-shared\nmake -j$(nproc)\nmake install\ncd ..\n\ncd fuzzpcap\nmkdir build\ncd build\ncmake ..\nmake install\ncd ../..\n\ncd libyaml\n./bootstrap\n./configure --disable-shared\nmake -j$(nproc)\nmake install\ncd ..\n\nexport CARGO_BUILD_TARGET=\"x86_64-unknown-linux-gnu\"\n# cf https://github.com/google/sanitizers/issues/1389\nexport MSAN_OPTIONS=strict_memcmp=false\n\n#run configure with right options\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n    export RUSTFLAGS=\"$RUSTFLAGS -Cpasses=sancov-module -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-trace-compares -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-pc-table -Clink-dead-code -Cllvm-args=-sanitizer-coverage-stack-depth -Ccodegen-units=1\"\n    export RUSTFLAGS=\"$RUSTFLAGS -Cdebug-assertions=yes\"\nfi\n\nfuzz_branches=(\"\")\nif [[ \"$SANITIZER\" != \"memory\" ]] && [[ ! -v CIFUZZ ]]\nthen\n    fuzz_branches+=(\"7\")\nfi\n\nif [[ `shuf -i 0-9 -n 1` -eq 0 ]]\nthen\n    # adds quadratic complexity custom mutator one random build out of 10\n    clang -fPIE -I. -c $SRC/quadfuzz/quadfuzz.c -o $SRC/quadfuzz/quadfuzz.o\n    export LIB_FUZZING_ENGINE=\"-fsanitize=fuzzer $SRC/quadfuzz/quadfuzz.o\"\n    echo \"Using quadfuzz\"\nfi\n\nfor branch in \"${fuzz_branches[@]}\"; do\n#we did not put libhtp there before so that cifuzz does not remove it\ncp -r libhtp suricata$branch/\n# build project\n(\ncd suricata$branch\nsh autogen.sh\n\n./src/tests/fuzz/oss-fuzz-configure.sh\nmake -j$(nproc)\n\n./src/suricata --list-app-layer-protos | tail -n +2 | while read i; do cp src/fuzz_applayerparserparse $OUT/fuzz_applayerparserparse\"$branch\"_$i; done\n\n(\ncd src\nls fuzz_* | while read i; do cp $i $OUT/$i$branch; done\n)\n# dictionaries\n./src/suricata --list-keywords | grep \"\\- \" | sed 's/- //' | awk '{print \"\\\"\"$0\"\\\"\"}' > $OUT/fuzz_siginit$branch.dict\n\necho \\\"SMB\\\" > $OUT/fuzz_applayerparserparse\"$branch\"_smb.dict\n\necho \"\\\"FPC0\\\"\" > $OUT/fuzz_sigpcap_aware$branch.dict\necho \"\\\"FPC0\\\"\" > $OUT/fuzz_predefpcap_aware$branch.dict\n\ngit grep tag rust | grep '\"' | cut -d '\"' -f2 | sort | uniq | awk 'length($0) > 2' | awk '{print \"\\\"\"$0\"\\\"\"}' | grep -v '\\\\' > generic.dict\ncat generic.dict >> $OUT/fuzz_siginit$branch.dict\ncat generic.dict >> $OUT/fuzz_applayerparserparse$branch.dict\ncat generic.dict >> $OUT/fuzz_sigpcap$branch.dict\ncat generic.dict >> $OUT/fuzz_sigpcap_aware$branch.dict\n\n# build corpuses\n# default configuration file\nzip -r $OUT/fuzz_confyamlloadstring\"$branch\"_seed_corpus.zip suricata.yaml\n# rebuilds rules corpus with only one rule by file\nunzip ../emerging.rules.zip\ncd rules\ncat *.rules > $OUT/fuzz.rules\ni=0\nmkdir corpus\n# quiet output for commands\nset +x\ncat *.rules | while read l; do echo $l > corpus/$i.rule; i=$((i+1)); done\nset -x\nzip -q -r $OUT/fuzz_siginit\"$branch\"_seed_corpus.zip corpus\ncd ../../suricata-verify\n\n# corpus with single files\nfind . -name \"*.pcap\" | xargs zip -r $OUT/fuzz_decodepcapfile\"$branch\"_seed_corpus.zip\nfind . -name \"*.yaml\" | xargs zip -r $OUT/fuzz_confyamlloadstring\"$branch\"_seed_corpus.zip\nfind . -name \"*.rules\" | xargs zip -r $OUT/fuzz_siginit\"$branch\"_seed_corpus.zip\n)\ndone\n\n# corpus using both rule and pcap as in suricata-verify\ncd $SRC/suricata-verify/tests\ni=0\nmkdir corpus\nset +x\nfind . -name \"*.pcap\" -exec dirname \"{}\" \\; | while read t; do\ncat $t/*.rules > corpus/$i || true; echo -ne '\\0' >> corpus/$i; cat $t/*.pcap >> corpus/$i || true; i=$((i+1));\ndone\nset -x\nzip -q -r $OUT/fuzz_sigpcap_seed_corpus.zip corpus\nrm -Rf corpus\nmkdir corpus\nset +x\nfind . -name \"*.pcap\" -exec dirname \"{}\" \\; | while read t; do\ngrep -v \"#\" $t/*.rules | head -1 | cut -d \"(\" -f2 | cut -d \")\" -f1 > corpus/$i || true; echo -ne '\\0' >> corpus/$i; fpc_bin $t/*.pcap >> corpus/$i || rm corpus/$i; i=$((i+1));\necho -ne '\\0' >> corpus/$i; python3 $SRC/fuzzpcap/tcptofpc.py $t/*.pcap >> corpus/$i || rm corpus/$i; i=$((i+1));\ndone\nset -x\nzip -q -r $OUT/fuzz_sigpcap_aware_seed_corpus.zip corpus\nrm -Rf corpus\nmkdir corpus\nset +x\nfind . -name \"*.pcap\" -exec dirname \"{}\" \\; | while read t; do\nfpc_bin $t/*.pcap >> corpus/$i || rm corpus/$i; i=$((i+1));\npython3 $SRC/fuzzpcap/tcptofpc.py $t/*.pcap >> corpus/$i || rm corpus/$i; i=$((i+1));\ndone\nset -x\nzip -q -r $OUT/fuzz_predefpcap_aware_seed_corpus.zip corpus\n"
  },
  {
    "path": "projects/suricata/project.yaml",
    "content": "homepage: \"https://suricata.io\"\nlanguage: rust\nprimary_contact: \"vjulien@openinfosecfoundation.org\"\nauto_ccs:\n- \"jish@openinfosecfoundation.org\"\n- \"p.antoine@catenacyber.fr\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\nmain_repo: 'https://github.com/OISF/suricata.git'\n"
  },
  {
    "path": "projects/surrealdb/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/surrealdb/surrealdb surrealdb\nRUN git clone --depth 1 https://github.com/surrealdb/docs.surrealdb.com.git surrealdb_website\nWORKDIR surrealdb\nRUN rustup toolchain install nightly-2025-12-01 && rustup default nightly-2025-12-01\nENV RUSTUP_TOOLCHAIN=nightly-2025-12-01\n# needed for MSAN and coverage build\nRUN rustup component add rust-src\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/surrealdb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Copy dictionaries, but don't fail if there aren't any.\ncp fuzz/fuzz_targets/*.dict $OUT/ || true\n\n# Add additional compiler flags required for a successful build.\nexport RUSTFLAGS=\"$RUSTFLAGS --cfg surrealdb_unstable\"\n\ncargo fuzz build -O --debug-assertions --fuzz-dir fuzz\n\nFUZZ_TARGET_OUTPUT_DIR=\"fuzz/target/x86_64-unknown-linux-gnu/release\"\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\n    # Create fuzz corpus, but don't fail if there aren't any.\n    zip $OUT/${FUZZ_TARGET_NAME}_seed_corpus.zip fuzz/fuzz_targets/${FUZZ_TARGET_NAME}_seed_corpus/* || true\ndone\n\nfind $SRC/surrealdb_website -name '*.surql' -exec zip -r $OUT/fuzz_executor_seed_corpus.zip {} \\;\n"
  },
  {
    "path": "projects/surrealdb/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://surrealdb.com/\"\nlanguage: rust\nprimary_contact: \"tobie@surrealdb.com\"\nmain_repo: \"https://github.com/surrealdb/surrealdb\"\nauto_ccs:\n  - security@surrealdb.com\n  - mees.delzenne@surrealdb.com\n  - emmanuel.keller@surrealdb.com\n  - micha.de.vries@surrealdb.com\n  - rushmore@surrealdb.com\n  - rowan.baker@surrealdb.com\n\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/rustc/.*\n"
  },
  {
    "path": "projects/swagger-core/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.2/bin/mvn\nRUN git clone --depth 1 https://github.com/swagger-api/swagger-core swagger-core\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/swagger-core\n"
  },
  {
    "path": "projects/swagger-core/YamlFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport io.swagger.v3.core.util.Yaml31;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [io.swagger.v3.core.util.Yaml31] public static java.util.Map jsonSchemaAsMap(java.lang.String)\npublic class YamlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    io.swagger.v3.core.util.Yaml31.jsonSchemaAsMap(data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/swagger-core/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean install -DskipTests=true -Dencoding=UTF-8 -Dmaven.antrun.skip=true \\\n    -Dcheckstyle.skip=true org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./modules/swagger-core/target/swagger-core-$CURRENT_VERSION.jar\" $OUT/swagger-core.jar\n\nALL_JARS='swagger-core.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/swagger-core/project.yaml",
    "content": "homepage: https://github.com/swagger-api/swagger-core\nmain_repo: https://github.com/swagger-api/swagger-core\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/swc/project.yaml",
    "content": "homepage: https://swc.rs\nlanguage: rust\nprimary_contact: \"kdy1997.dev@gmail.com\"\nauto_ccs:\n  - kdy1997.dev@gmail.com\nsanitizers:\n  - address\n  - undefined\nmain_repo: https://github.com/swc-project/swc\n"
  },
  {
    "path": "projects/swift-nio/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-swift\n\n# specific swift-nio\nRUN git clone --depth 1 https://github.com/google/fuzzing\nRUN git clone --depth 1 https://github.com/apple/swift-nio.git\nCOPY build.sh $SRC\nCOPY *.swift $SRC/\nWORKDIR $SRC/swift-nio\n"
  },
  {
    "path": "projects/swift-nio/Package.swift",
    "content": "// swift-tools-version:5.3\n// The swift-tools-version declares the minimum version of Swift required to build this package.\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"swift-nio-fuzz\",\n    dependencies: [\n        // Dependencies declare other packages that this package depends on.\n        .package(name: \"swift-nio\", path: \"..\"),\n    ],\n    targets: [\n        // Targets are the basic building blocks of a package. A target can define a module or a test suite.\n        // Targets can depend on other targets in this package, and on products in packages this package depends on.\n        .target(\n            name: \"swift-nio-http1-fuzz\",\n            dependencies: [.product(name: \"NIOHTTP1\", package: \"swift-nio\")]),\n    ]\n)\n"
  },
  {
    "path": "projects/swift-nio/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir swift-nio-fuzz\ncd swift-nio-fuzz\nswift package init --type=executable\nrm -Rf Sources/swift-nio-fuzz\nmkdir Sources/swift-nio-http1-fuzz\ncp $SRC/fuzz_http1.swift Sources/swift-nio-http1-fuzz/main.swift\ncp $SRC/Package.swift Package.swift\n\n. precompile_swift\nswift build -c debug $SWIFTFLAGS\n(\ncd .build/debug/\nfind . -maxdepth 1 -type f -name \"*fuzz\" -executable | while read i; do cp $i $OUT/\"$i\"-debug; done\n)\nswift build -c release $SWIFTFLAGS\n(\ncd .build/release/\nfind . -maxdepth 1 -type f -name \"*fuzz\" -executable | while read i; do cp $i $OUT/\"$i\"-release; done\n)\n\ncp $SRC/fuzzing/dictionaries/http.dict $OUT/swift-nio-http1-fuzz-debug.dict\ncp $SRC/fuzzing/dictionaries/http.dict $OUT/swift-nio-http1-fuzz-release.dict\n"
  },
  {
    "path": "projects/swift-nio/fuzz_http1.swift",
    "content": "import NIOHTTP1\nimport NIO\n\n@_cdecl(\"LLVMFuzzerTestOneInput\")\npublic func test(_ start: UnsafeRawPointer, _ count: Int) -> CInt {\n    let bytes = UnsafeRawBufferPointer(start: start, count: count)\n    let channel = EmbeddedChannel()\n    var buffer = channel.allocator.buffer(capacity: count)\n    buffer.writeBytes(bytes)\n    do {\n        try channel.pipeline.addHandler(ByteToMessageHandler(HTTPRequestDecoder())).wait()\n        try channel.writeInbound(buffer)\n        channel.embeddedEventLoop.run()\n    } catch {\n    }\n    do {\n        try channel.finish(acceptAlreadyClosed: true)\n    } catch {\n    }\n    return 0\n}\n"
  },
  {
    "path": "projects/swift-nio/project.yaml",
    "content": "homepage: \"https://github.com/apple/swift-nio\"\nlanguage: swift\nprimary_contact: \"lukasa@apple.com\"\nauto_ccs :\n- \"johannesweiss@apple.com\"\n- \"pp_adams@apple.com\"\n- \"p.antoine@catenacyber.fr\"\n\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- thread\nmain_repo: 'https://github.com/apple/swift-nio.git'\n"
  },
  {
    "path": "projects/swift-protobuf/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-swift\n\nRUN git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/apple/swift-protobuf.git\nCOPY build.sh $SRC\nWORKDIR $SRC/swift-protobuf\n"
  },
  {
    "path": "projects/swift-protobuf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n. precompile_swift\ncd FuzzTesting\n\n# debug build\nswift build -c debug $SWIFTFLAGS\n(\ncd .build/debug/\nfind . -maxdepth 1 -type f -name \"Fuzz*\" -executable | while read i; do cp $i $OUT/\"$i\"_debug; done\n)\n\n# release build\nswift build -c release $SWIFTFLAGS\n(\ncd .build/release/\nfind . -maxdepth 1 -type f -name \"Fuzz*\" -executable | while read i; do cp $i $OUT/\"$i\"_release; done\n)\n\n# Copy any dictionaries over.\nfor fuzz_dict in Fuzz*.dict ; do\n  fuzzer_name=$(basename $fuzz_dict .dict)\n  cp $fuzz_dict $OUT/${fuzzer_name}_debug.dict\n  cp $fuzz_dict $OUT/${fuzzer_name}_release.dict\ndone\n"
  },
  {
    "path": "projects/swift-protobuf/project.yaml",
    "content": "homepage: \"https://github.com/apple/swift-protobuf\"\nlanguage: swift\nprimary_contact: \"tkientzle@apple.com\"\nauto_ccs :\n- \"lukasa@apple.com\"\n- \"p.antoine@catenacyber.fr\"\n- \"thomasvl@google.com\"\n\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- thread\ncoverage_extra_args: >\n  -ignore-filename-regex=.*\\.pb\\.swift\n  -ignore-filename-regex=.*/\\.build/.*\nmain_repo: 'https://github.com/apple/swift-protobuf.git'\n"
  },
  {
    "path": "projects/symphonia/project.yaml",
    "content": "homepage: \"https://docs.rs/symphonia/\"\nmain_repo: \"https://github.com/pdeljanov/Symphonia.git\"\nlanguage: rust\nprimary_contact: \"jophba@chromium.org\"\nauto_ccs:\n  - philip.deljanov@gmail.com\n"
  },
  {
    "path": "projects/systemd/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/systemd/systemd systemd\nWORKDIR systemd\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/systemd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ntools/oss-fuzz.sh\n"
  },
  {
    "path": "projects/systemd/project.yaml",
    "content": "homepage: \"https://freedesktop.org/wiki/Software/systemd/\"\nbase_os_version: ubuntu-24-04\nlanguage: c++\nprimary_contact: \"lennart@poettering.net\"\nbuilds_per_day: 4\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - honggfuzz\n  - libfuzzer\nauto_ccs:\n  - jonathan@titanous.com\n  - zbyszek@in.waw.pl\n  - poettering@gmail.com\n  - watanabe.yu@gmail.com\n  - Tixxdz@gmail.com\n  - fsumsal@redhat.com\n  - johannbg@gmail.com\n  - ssahani@vmware.com\n  - chris@chrisdown.name\n  - the.anitazha@gmail.com\n  - daan.j.demeyer@gmail.com\n  - luca.boccassi@gmail.com\n  - rpigott314@gmail.com\nmain_repo: 'https://github.com/systemd/systemd'\narchitectures:\n  - x86_64\n  - i386\nfile_github_issue: True\n"
  },
  {
    "path": "projects/syzkaller/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth 1 https://github.com/google/syzkaller/\n\nWORKDIR $SRC/syzkaller\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/syzkaller/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n\nmake descriptions\n\ngo mod tidy && go mod vendor\n\ncompile_go_fuzzer github.com/google/syzkaller/pkg/compiler Fuzz compiler_fuzzer\ncompile_go_fuzzer github.com/google/syzkaller/prog/test FuzzDeserialize prog_deserialize_fuzzer\ncompile_go_fuzzer github.com/google/syzkaller/prog/test FuzzParseLog prog_parselog_fuzzer\ncompile_go_fuzzer github.com/google/syzkaller/pkg/report Fuzz report_fuzzer\n\n# This target is way too spammy and OOMs very quickly.\n# compile_go_fuzzer ./tools/syz-trace2syz/proggen Fuzz trace2syz_fuzzer\n"
  },
  {
    "path": "projects/syzkaller/project.yaml",
    "content": "homepage: \"https://github.com/google/syzkaller.git\"\nprimary_contact: \"nogikh@google.com\"\nauto_ccs:\n  - \"dvyukov@google.com\"\n  - \"tarasmadan@google.com\"\n  - \"syzkaller@googlegroups.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nview_restrictions: none\nmain_repo: 'https://github.com/google/syzkaller'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/tablesaw/.gitignore",
    "content": "project-parent/tablesaw\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/tablesaw/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/csv.dict $SRC/ReaderFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/ReaderFuzzer_seed_corpus.zip go-fuzz-corpus/csv/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/tablesaw\nRUN git clone --depth 1 https://github.com/jtablesaw/tablesaw/ $SRC/project-parent/tablesaw\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/tablesaw/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=tablesaw\nPROJECT_GROUP_ID=tech.tablesaw\nPROJECT_ARTIFACT_ID=tablesaw-core\nMAIN_REPOSITORY=https://github.com/jtablesaw/tablesaw/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/tablesaw/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>tech.tablesaw</groupId>\n            <artifactId>tablesaw-core</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n        <dependency>\n            <groupId>com.github.haifengl</groupId>\n            <artifactId>smile-data</artifactId>\n            <version>2.6.0</version>\n            <scope>test</scope>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/tablesaw/project-parent/fuzz-targets/src/test/java/com/example/ReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.*;\nimport java.util.Locale;\nimport tech.tablesaw.io.csv.*;\nimport tech.tablesaw.api.Table;\nimport tech.tablesaw.io.AddCellToColumnException;\nimport tech.tablesaw.io.fixed.FixedWidthReadOptions;\nimport tech.tablesaw.io.ColumnIndexOutOfBoundsException;\n\n\nclass ReaderFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        boolean b1 = data.consumeBoolean();\n        boolean b2 = data.consumeBoolean();\n        boolean b3 = data.consumeBoolean();\n        boolean b4 = data.consumeBoolean();\n        boolean b5 = data.consumeBoolean();\n        char c1 = data.consumeChar();\n        Locale locale = data.pickValue(Locale.getAvailableLocales());\n        Reader reader = new StringReader(data.consumeString(4096));\n\n        CsvReadOptions options =\n                CsvReadOptions.builder(reader)\n                        .allowDuplicateColumnNames(b1)\n                        .minimizeColumnSizes()\n                        .ignoreZeroDecimal(b2)\n                        .locale(locale)\n                        .separator(c1)\n                        .header(b3)\n                        .sample(b4)\n                        .build();\n\n        FixedWidthReadOptions options1 =\n                FixedWidthReadOptions.builder(reader)\n                        .skipTrailingCharsUntilNewline(b1)\n                        .minimizeColumnSizes()\n                        .ignoreZeroDecimal(b2)\n                        .systemLineEnding()\n                        .locale(locale)\n                        .padding(c1)\n                        .header(b3)\n                        .sample(b4)\n                        .build();\n\n        try {\n            Table table = Table.read().usingOptions(b5 ? options : options1);\n            table.smile().toDataFrame();\n            table.print();\n        } catch (NullPointerException | IllegalArgumentException | ArrayIndexOutOfBoundsException |\n            ColumnIndexOutOfBoundsException | AddCellToColumnException | IllegalStateException e) {\n            // Need to catch these exceptions to reach interesting findings.\n        }\n    }\n}\n"
  },
  {
    "path": "projects/tablesaw/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>tablesaw</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/tablesaw/project.yaml",
    "content": "homepage: \"https://jtablesaw.github.io/tablesaw/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/jtablesaw/tablesaw/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/tailscale/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y wget\nRUN git clone --depth 1 https://github.com/tailscale/tailscale\nRUN wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz \\\n    && mkdir temp-go \\\n    && rm -rf /root/.go/* \\\n    && tar -C temp-go/ -xzf go1.23.1.linux-amd64.tar.gz \\\n    && mv temp-go/go/* /root/.go/\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/tailscale\n"
  },
  {
    "path": "projects/tailscale/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer tailscale.com/net/stun FuzzStunParser stun_parser_fuzzer\n"
  },
  {
    "path": "projects/tailscale/project.yaml",
    "content": "homepage: \"https://tailscale.com/\"\nmain_repo: \"https://github.com/tailscale/tailscale\"\nprimary_contact: \"Adam@adalogics.com\"\nauto_ccs :\n  - \"josh@tailscale.com\"\n  - \"danderson@tailscale.com\"\n  - \"bradfitz@tailscale.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/tar-rs/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone https://github.com/alexcrichton/tar-rs\nWORKDIR $SRC/tar-rs\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tar-rs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the fuzzers and project source code\ncargo fuzz build\n\n# Copy built fuzzer binaries to $OUT\nfind $SRC/tar-rs/fuzz/target/x86_64-unknown-linux-gnu/release -maxdepth 1 \\\n    -type f -perm -u=x -exec cp {} $OUT \\;\n"
  },
  {
    "path": "projects/tar-rs/project.yaml",
    "content": "homepage: \"https://github.com/alexcrichton/tar-rs\"\nmain_repo: \"https://github.com/alexcrichton/tar-rs.git\"\nprimary_contact: \"cgwalters@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"fuzzing@fuchsia.dev\"\n"
  },
  {
    "path": "projects/tarantool/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y \\\n\tbuild-essential cmake make coreutils sed lld \\\n\tautoconf automake libtool zlib1g-dev \\\n\tlibreadline-dev libncurses5-dev libssl-dev \\\n\tlibunwind-dev luajit wget ninja-build \\\n\tlibzstd-dev libyaml-dev libcurl4-openssl-dev\n\nRUN git clone --jobs $(nproc) --recursive https://github.com/tarantool/tarantool\nWORKDIR $SRC/tarantool\n\n# Download a seed corpus.\nRUN rm -rf test/static\nRUN git clone https://github.com/ligurio/tarantool-corpus test/static\n\nCOPY build.sh $SRC/\nCOPY compile_lua_fuzzer $SRC/\n"
  },
  {
    "path": "projects/tarantool/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Clean up potentially persistent build directory.\n[[ -e $SRC/tarantool/build ]] && rm -rf $SRC/tarantool/build\n\n# For fuzz-introspector, exclude all functions in the tests directory,\n# libprotobuf-mutator and protobuf source code.\n# See https://github.com/ossf/fuzz-introspector/blob/main/doc/Config.md#code-exclusion-from-the-report\nexport FUZZ_INTROSPECTOR_CONFIG=$SRC/fuzz_introspector_exclusion.config\ncat > $FUZZ_INTROSPECTOR_CONFIG <<EOF\nFILES_TO_AVOID\ntarantool/build/test\ntarantool/build/icu-prefix\nEOF\n\ncd $SRC/tarantool\n\ncase $SANITIZER in\n  address) SANITIZERS_ARGS=\"-DENABLE_ASAN=ON\" ;;\n  undefined) SANITIZERS_ARGS=\"-DENABLE_UB_SANITIZER=ON\" ;;\n  *) SANITIZERS_ARGS=\"\" ;;\nesac\n\nexport LSAN_OPTIONS=\"verbosity=1:log_threads=1\"\n\n# Workaround for a LeakSanitizer crashes,\n# see https://github.com/google/oss-fuzz/issues/11798.\nif [ \"$ARCHITECTURE\" = \"aarch64\" ]; then\n    export ASAN_OPTIONS=detect_leaks=0\nfi\n\n: ${LD:=\"${CXX}\"}\n: ${LDFLAGS:=\"${CXXFLAGS}\"}  # to make sure we link with sanitizer runtime\n\nFUZZER_ARGS=\"\"\nif [[ \"$FUZZING_ENGINE\" == libfuzzer ]]; then\n  FUZZER_ARGS=\"-DENABLE_LIBFUZZER_STATIC_LINKAGE=ON\"\nfi\n\n# Apply potential fix for the problem described in\n# google/oss-fuzz#13226.\n# See https://github.com/ossf/fuzz-introspector/pull/2278\nif [[ \"$SANITIZER\" = \"introspector\" ]]; then\n  curl -O https://patch-diff.githubusercontent.com/raw/ossf/fuzz-introspector/pull/2278.patch\n  patch -p1 --directory=/fuzz-introspector/ < 2278.patch\n  export FUZZ_INTROSPECTOR_PARALLEL=false\nfi\n\ncmake_args=(\n    # Specific to Tarantool\n    # Tarantool executable binary is needed for running Lua tests,\n    # it should not have any dependencies.\n    -DBUILD_STATIC=ON\n    -DENABLE_BACKTRACE=ON\n    -DENABLE_FUZZER=ON\n    -DOSS_FUZZ=ON\n    -DLUA_USE_APICHECK=ON\n    -DLUA_USE_ASSERT=ON\n    -DLUAJIT_USE_SYSMALLOC=ON\n    -DLUAJIT_ENABLE_GC64=ON\n    $SANITIZERS_ARGS\n    $FUZZER_ARGS\n\n    -DCMAKE_BUILD_TYPE=Debug\n\n    # C compiler\n    -DCMAKE_C_COMPILER=\"${CC}\"\n    -DCMAKE_C_FLAGS=\"${CFLAGS} -Wno-error=unused-command-line-argument -fno-sanitize=unsigned-integer-overflow\"\n\n    # C++ compiler\n    -DCMAKE_CXX_COMPILER=\"${CXX}\"\n    -DCMAKE_CXX_FLAGS=\"${CXXFLAGS} -Wno-error=unused-command-line-argument -fno-sanitize=unsigned-integer-overflow\"\n\n    # Linker\n    -DCMAKE_LINKER=\"${LD}\"\n    -DCMAKE_EXE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_MODULE_LINKER_FLAGS=\"${LDFLAGS}\"\n    -DCMAKE_SHARED_LINKER_FLAGS=\"${LDFLAGS}\"\n\n    # Dependencies\n    -DENABLE_BUNDLED_ICU=ON\n    -DENABLE_BUNDLED_LIBUNWIND=ON\n    -DENABLE_BUNDLED_ZSTD=OFF\n)\n\n# To deal with a host filesystem from inside of container.\ngit config --global --add safe.directory '*'\n\n# Build the project and fuzzers.\n[[ -e build ]] && rm -rf build\ncmake \"${cmake_args[@]}\" -S . -B build\ncmake --build build --target fuzzers --parallel --verbose\n\n# Archive and copy to $OUT seed corpus if the build succeeded.\n# Postfix `_fuzzer` is used in Tarantool, postfix `_test` is\n# used in additional tests [1].\n#\n# 1. https://github.com/ligurio/lunapark\ncp test/static/*.dict test/static/*.options $OUT/\nfor f in $(find build/test/fuzz/ \\( -name '*_fuzzer' -o -name '*_test' \\) -type f);\ndo\n  name=$(basename $f);\n  module=$(echo $name | sed 's/_fuzzer//' | sed 's/_test//' )\n  corpus_dir=\"test/static/corpus/$module\"\n  echo \"Copying for $module\";\n  cp $f $OUT/\n  if [ -e \"$corpus_dir\" ]; then\n    zip --quiet -j $OUT/\"$name\"_seed_corpus.zip $corpus_dir/*\n  fi\ndone\n\n# Finish execution if libFuzzer is not used, because luzer\n# is libFuzzer-based.\n# Code coverage is not supported,\n# see https://github.com/google/oss-fuzz/issues/14859.\nif [[ \"$FUZZING_ENGINE\" != libfuzzer ]] ||\n   [[ \"$SANITIZER\" == \"coverage\" ]]; then\n  exit\nfi\n\n# Tarantool binary is required for running luzer-based tests.\n# Beware, tarantool binary is linked with libFuzzer statically\n# when CMake options ENABLE_LIBFUZZER_STATIC_LINKAGE and\n# ENABLE_FUZZER are passed, the linkage can fail\n# when other fuzzing engine is used due to symbols conflict,\n# see FUZZING_ENGINE environment variable.\ncmake --build build --target tarantool --parallel --verbose\n\nLUA_RUNTIME_NAME=tarantool\nTARANTOOL_PATH=build/src/$LUA_RUNTIME_NAME\nLUA_MODULES_DIR=lua_modules\n\napt install -y luarocks liblua5.1-0 liblua5.1-0-dev liblua5.1-0-dbg lua5.1\n\n# Required by luzer installed using luarocks.\nexport OSS_FUZZ=1\nluarocks install --lua-version 5.1 --server=https://luarocks.org/dev --tree=$LUA_MODULES_DIR luzer\nunset OSS_FUZZ\n\n# This Lua module exists only when target `lua-tests` is used,\n# see cmake/BuildLuaTests.cmake.\nlua_lib_path=\"build/test/fuzz/lua-tests/src/tests/lapi/lib.lua\"\nif [ -f $lua_lib_path ]; then\n    cp $lua_lib_path $OUT\nfi\nLUZER_TEST_DIR=\"build/luzer_tests\"\n# Copying luzer-based tests to a $LUZER_TEST_DIR.\ncmake --build build --parallel --verbose --target copy_tests\n# Generating test wrappers for luzer-based tests.\nfor test_path in $(find $LUZER_TEST_DIR -name \"*.lua\" -type f);\ndo\n  test_file=$(basename $test_path);\n  test_name_we=\"${test_file%.*}\";\n  module_name=$(echo $test_name_we | sed 's/_test//' )\n  \"$SRC/compile_lua_fuzzer\" \"$LUA_RUNTIME_NAME\" $test_file\n  cp \"$test_path\" \"$OUT/\"\n  corpus_dir=\"test/static/corpus/$module_name\"\n  if [ -e \"$corpus_dir\" ]; then\n    zip -j $OUT/\"$test_name_we\"_seed_corpus.zip $corpus_dir/*\n    echo \"Build corpus '$OUT/\"$test_name_we\"_seed_corpus.zip' for the test '$test_name_we'\"\n  fi\ndone\n\ncp $TARANTOOL_PATH \"$OUT/$LUA_RUNTIME_NAME\"\ncp -R $LUA_MODULES_DIR \"$OUT/\"\n"
  },
  {
    "path": "projects/tarantool/compile_lua_fuzzer",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# The Lua runtime name.\nlua_runtime=$1\n# Path to the fuzz target source file relative to the project's root.\nfuzz_target=$2\n\nfuzzer_basename=$(basename -s .lua \"$fuzz_target\")\n\n# Create an execution wrapper that executes luzer with the correct\n# arguments.\necho \"#!/bin/bash\n\nset -eu\n\n# LLVMFuzzerTestOneInput so that the wrapper script is recognized\n# as a fuzz target for 'check_build'.\nproject_dir=\\$(dirname \\$(realpath \\\"\\$0\\\"))\neval \\$(luarocks --lua-version 5.1 --tree \\$project_dir/lua_modules path)\nASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$project_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$project_dir/$lua_runtime \\$project_dir/$fuzz_target \\$@\" > \"$OUT/$fuzzer_basename\"\n\nchmod +x \"$OUT/$fuzzer_basename\"\n"
  },
  {
    "path": "projects/tarantool/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.tarantool.io/en/\"\nlanguage: c\nbuilds_per_day: 4\nprimary_contact: \"estetus@gmail.com\"\nauto_ccs:\n  - \"estetus@gmail.com\"\n  - \"totktonada.ru@gmail.com\"\n  - \"sergeykaplun1998@gmail.com\"\n  - \"imeevma@gmail.com\"\n  - \"boris.stepanenko@gmail.com\"\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - x86_64\nmain_repo: \"https://github.com/tarantool/tarantool\"\n"
  },
  {
    "path": "projects/tcmalloc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool python python3\nRUN git clone --depth 1 https://github.com/google/tcmalloc tcmalloc\nWORKDIR tcmalloc\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tcmalloc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# TODO(David) This should applied in the general script once confirmed it works\nsed -i 's/standalone/sandboxed/g' /usr/local/bin/bazel_build_fuzz_tests\n\nbazel_build_fuzz_tests\n"
  },
  {
    "path": "projects/tcmalloc/project.yaml",
    "content": "homepage: \"tcmalloc\"\nlanguage: c++\nprimary_contact: \"ckennelly@google.com\"\nmain_repo: \"https://github.com/google/tcmalloc\"\nauto_ccs:\n - \"david@adalogics.com\"\nsanitizers:\n - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n# - memory\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/td-shim/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n# Install packages we need to build dependencies\nRUN apt-get update && apt-get install -y nasm\nRUN git clone --depth 1 https://github.com/confidential-containers/td-shim.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/td-shim"
  },
  {
    "path": "projects/td-shim/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nset -eox pipefail\ncd $SRC/td-shim\n\nFUZZ_CRATE_DIRS=$(find . -type d -name fuzz -exec dirname $(readlink -f {}) \\;)\n\ngit submodule update --init --recursive\nbash sh_script/preparation.sh\n\nfor CRATE_DIR in ${FUZZ_CRATE_DIRS[@]};\ndo\n  echo \"Building crate: $CRATE_DIR\"\n  cd $CRATE_DIR\n  cargo fuzz build -O\n  FUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\n  fuzz_tcs=$(cargo fuzz list)\n  for tcs in ${fuzz_tcs[@]}; do\n    if [[ $tcs =~ \"afl\" ]]; then\n      continue\n    else\n      FUZZ_TARGET_NAME=$tcs\n      CRATE_NAME=$(basename $CRATE_DIR)\n      cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/$CRATE_NAME-$FUZZ_TARGET_NAME\n    fi\n  done\ndone"
  },
  {
    "path": "projects/td-shim/project.yaml",
    "content": "homepage: \"https://github.com/confidential-containers/td-shim\"\nlanguage: rust\nprimary_contact: \"wei3.liu@intel.com\"\nauto_ccs:\n  - \"jiewen.yao@intel.com\"\n  - \"jiaqi.gao@intel.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/confidential-containers/td-shim.git'"
  },
  {
    "path": "projects/tdengine/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y  libtool build-essential wget pkg-config zlib1g-dev liblzma-dev libjansson-dev\nRUN git clone --depth 1 https://github.com/taosdata/TDengine tdengine\nRUN cd /tmp \\\n  && wget https://golang.org/dl/go1.16.8.linux-amd64.tar.gz \\\n  && tar -xf go1.16.8.linux-amd64.tar.gz\nENV PATH ${PATH}:/tmp/go/bin\n\nWORKDIR tdengine\nCOPY build.sh $SRC/\nCOPY *.options $SRC/\n"
  },
  {
    "path": "projects/tdengine/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsed -i 's/git@/https:\\/\\//g' .gitmodules\nsed -i 's/:taos/\\/taos/g' .gitmodules\nsed -i 's/\\.git//g' .gitmodules\n\ngit submodule update --init --recursive\nsed -i 's/-Werror//g' ./cmake/define.inc\nmkdir debug && cd debug\nexport LDFLAGS=\"${CXXFLAGS}\"\n\nif [[ $SANITIZER = *coverage* ]]; then\n  ln -f -s /usr/bin/gold /usr/bin/ld\nfi\n\ncmake -DBUILD_HTTP=true ..\ncmake --build .\n\ncd build/bin\n\n# Now let's build the fuzzer.\n$CC $CFLAGS -DLINUX -DUSE_LIBICONV -D_LINUX -D_M_X64 \\\n     -D_TD_LINUX  -D_TD_LINUX_64 \\\n     -I/src/tdengine/src/inc -I/src/tdengine/src/os/inc \\\n     -I/src/tdengine/src/util/inc -I/src/tdengine/src/common/inc \\\n     -I/src/tdengine/src/tsdb/inc -I/src/tdengine/src/query/inc \\\n     -o sql-fuzzer.o -c $SRC/tdengine/tests/fuzz//sql-fuzzer.c\n\n$CC $CFLAGS $LIB_FUZZING_ENGINE sql-fuzzer.o -o $OUT/sql-fuzzer \\\n      ../../../debug/src/common/CMakeFiles/common.dir/src/tglobal.c.o  \\\n      -Wl,--start-group \\\n      ../lib/libtaos_static.a  ../lib/libtrpc.a ../lib/libtutil.a \\\n      ../lib/libquery.a  ../lib/libtsdb.a ../lib/libcommon.a \\\n       ../lib/libtfs.a ../lib/liblz4.a ../lib/libos.a \\\n       ../lib/liboslinux.a ../lib/libz.a ../lib/librmonotonic.a \\\n       ../lib/liblua.a ../lib/libtutil.a ../lib/libTSZ.a \\\n       -Wl,--end-group -lpthread -ldl\n\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/tdengine/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.taosdata.com/en/documentation/\"\nlanguage: c\nprimary_contact: \"sangshuduo@gmail.com\"\nmain_repo: \"https://github.com/taosdata/TDengine\"\nauto_ccs:\n - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/tdengine/sql-fuzzer.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/teleport/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/gravitational/teleport.git teleport\nWORKDIR teleport\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/teleport/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash -x ./fuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/teleport/project.yaml",
    "content": "homepage: \"https://github.com/gravitational/teleport\"\nlanguage: go\nprimary_contact: \"zac.bergquist@goteleport.com\"\nmain_repo: \"https://github.com/gravitational/teleport\"\nauto_ccs:\n  - \"oss-fuzz@goteleport.com\"\n  - \"jakub.nyckowski@goteleport.com\"\n  - \"ossfuzz1337@gmail.com\"\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/tendermint/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone https://github.com/cometbft/cometbft\n\nCOPY build.sh $SRC\nWORKDIR $SRC/cometbft\n"
  },
  {
    "path": "projects/tendermint/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nbash -x ./test/fuzz/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/tendermint/project.yaml",
    "content": "homepage: \"https://github.com/cometbft/cometbft\"\nprimary_contact: \"security@interchain.io\"\nauto_ccs:\n  - fuzzing@orijtech.com\n  - emmanuel@orijtech.com\n  - elias@orijtech.com\n  - thane@informal.systems\n  - sergio@informal.systems\n  - adi@informal.systems\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/cometbft/cometbft\"\n"
  },
  {
    "path": "projects/tensorflow/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! This project was pinned after a clang bump. Please remove the pin, Try to fix any build warnings and errors, as well as runtime errors\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n        curl \\\n        rsync \\\n        && \\\n    apt-get clean && \\\n    rm -rf /var/lib/apt/lists/*\nRUN python3 -m pip install numpy\n\n# Due to Bazel bug, need to symlink python3 to python\n# See https://github.com/bazelbuild/bazel/issues/8665\nRUN ln -s /usr/local/bin/python3 /usr/local/bin/python\n\n# Install Bazelisk to keep bazel in sync with the version required by TensorFlow\nRUN curl -Lo /usr/bin/bazel \\\n        https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64 \\\n        && \\\n    chmod +x /usr/bin/bazel\n\nENV JAVA_HOME /usr/lib/jvm/java-15-openjdk-amd64\n# it fails after installing java due to jazzer env variables missing\nRUN install_java.sh || true\n\nRUN git clone --depth 1 https://github.com/tensorflow/tensorflow tensorflow\nWORKDIR $SRC/tensorflow\nCOPY build.sh $SRC/\nCOPY *.patch $SRC/\n"
  },
  {
    "path": "projects/tensorflow/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit apply  --ignore-space-change --ignore-whitespace $SRC/fuzz_patch.patch\n\nif [ \"$SANITIZER\" = \"undefined\" ]; then\n  rm $SRC/tensorflow/tensorflow/security/fuzzing/cc/core/function/BUILD\nfi\n\n# Rename all fuzzer rules to oss-fuzz rules.\nfind $SRC/tensorflow/tensorflow/ -name \"BUILD\" -exec sed -i 's/tf_cc_fuzz_test/tf_oss_fuzz_fuzztest/g' {} \\;\n\n# Overwrite compiler flags that break the oss-fuzz build\nsed -i 's/build:linux --copt=\\\"-Wno-unknown-warning\\\"/# overwritten/g' ./.bazelrc\nsed -i 's/build:linux --copt=\\\"-Wno-array-parameter\\\"/# overwritten/g' ./.bazelrc\nsed -i 's/build:linux --copt=\\\"-Wno-stringop-overflow\\\"/# overwritten/g' ./.bazelrc\n\n# Force Python3, run configure.py to pick the right build config\nexport TF_PYTHON_VERSION=3.9\nPYTHON=python3\nyes \"\" | ${PYTHON} configure.py\n\nsynchronize_coverage_directories() {\n  # For coverage, we need to remap source files to correspond to the Bazel build\n  # paths. We also need to resolve all symlinks that Bazel creates.\n  if [ \"$SANITIZER\" = \"coverage\" ]\n  then\n    declare -r RSYNC_CMD=\"rsync -aLkR\"\n    declare -r REMAP_PATH=${OUT}/proc/self/cwd/\n    mkdir -p ${REMAP_PATH}\n\n    # Synchronize the folder bazel-BAZEL_OUT_PROJECT.\n    declare -r RSYNC_FILTER_ARGS=(\"--include\" \"*.h\" \"--include\" \"*.cc\" \"--include\" \\\n      \"*.hpp\" \"--include\" \"*.cpp\" \"--include\" \"*.c\" \"--include\" \"*/\" \"--include\" \"*.inc\" \\\n      \"--include\" \"*.def\" \"--exclude\" \"*\")\n\n    # Sync existing code.\n    ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" tensorflow/ ${REMAP_PATH}\n\n    # Sync generated proto files.\n    if [ -d \"./bazel-out/k8-opt/bin/tensorflow/\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-opt/bin/tensorflow/ ${REMAP_PATH}\n    fi\n    if [ -d \"./bazel-out/k8-opt/bin/external\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-opt/bin/external/ ${REMAP_PATH}\n    fi\n    if [ -d \"./bazel-out/k8-opt/bin/third_party\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-opt/bin/third_party/ ${REMAP_PATH}\n    fi\n\n    # Sync external dependencies. We don't need to include `bazel-tensorflow`.\n    # Also, remove `external/org_tensorflow` which is a copy of the entire source\n    # code that Bazel creates. Not removing this would cause `rsync` to expand a\n    # symlink that ends up pointing to itself!\n    pushd bazel-tensorflow\n    [[ -e external/org_tensorflow ]] && unlink external/org_tensorflow\n    ${RSYNC_CMD} external/ ${REMAP_PATH}\n    popd\n  fi\n}\n\n# Since Bazel passes flags to compilers via `--copt`, `--conlyopt` and\n# `--cxxopt`, we need to move all flags from `$CFLAGS` and `$CXXFLAGS` to these.\n# We don't use `--copt` as warnings issued by C compilers when encountering a\n# C++-only option results in errors during build.\n#\n# Note: Make sure that by this line `$CFLAGS` and `$CXXFLAGS` are properly set\n# up as further changes to them won't be visible to Bazel.\n#\n# Note: for builds using the undefined behavior sanitizer we need to link\n# `clang_rt` ubsan library. Since Bazel uses `clang` for linking instead of\n# `clang++`, we need to add the additional `--linkopt` flag.\n# See issue: https://github.com/bazelbuild/bazel/issues/8777\ndeclare -r EXTRA_FLAGS=\"\\\n$(\nfor f in ${CFLAGS}; do\n  echo \"--conlyopt=${f}\" \"--linkopt=${f}\"\ndone\nfor f in ${CXXFLAGS}; do\n    echo \"--cxxopt=${f}\" \"--linkopt=${f}\"\ndone\nif [ \"$SANITIZER\" = \"undefined\" ]\nthen\n  echo \"--linkopt=$(find $(llvm-config --libdir) -name libclang_rt.ubsan_standalone_cxx-x86_64.a | head -1)\"\n  sed -i -e 's/\"\\/\\/conditions:default\": \\[/\"\\/\\/conditions:default\": \\[\\n\"-fno-sanitize=undefined\",/' third_party/nasm/nasm.BUILD\n  sed -i -e 's/includes/linkopts = \\[\"-fno-sanitize=undefined\"\\],\\nincludes/' third_party/nasm/nasm.BUILD\nfi\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  echo \"--action_env=ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0\"\nfi\n)\"\n\n# Ugly hack to get LIB_FUZZING_ENGINE only for fuzz targets\n# and not for other binaries such as protoc\nsed -i -e 's/linkstatic/linkopts = \\[\"-fsanitize=fuzzer\"\\],\\nlinkstatic/' tensorflow/security/fuzzing/tf_fuzzing.bzl\n\n# Prepare flags for compiling fuzzers.\nexport FUZZTEST_EXTRA_ARGS=\"--spawn_strategy=sandboxed --action_env=ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0 --define force_libcpp=enabled --verbose_failures --copt=-UNDEBUG --config=monolithic\"\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n  export FUZZTEST_EXTRA_ARGS=\"${FUZZTEST_EXTRA_ARGS} --local_ram_resources=HOST_RAM*1.0 --local_cpu_resources=HOST_CPUS*.6 --strip=always\"\nelse\n  export FUZZTEST_EXTRA_ARGS=\"${FUZZTEST_EXTRA_ARGS} --local_ram_resources=HOST_RAM*1.0 --local_cpu_resources=HOST_CPUS*.15 --strip=never\"\nfi\n\n# Do not use compile_fuzztests.sh to synchronize coverage folders as we use\n# synchronize_coverage_directories from this script instead.\nexport FUZZTEST_DO_SYNC=\"no\"\n\n# Set fuzz targets\nexport FUZZTEST_TARGET_FOLDER=\"//tensorflow/security/fuzzing/...+//tensorflow/cc/saved_model/...+//tensorflow/cc/framework/fuzzing/...+//tensorflow/core/common_runtime/...+//tensorflow/core/framework/...\"\nexport FUZZTEST_EXTRA_TARGETS=\"//tensorflow/core/kernels/fuzzing:all\"\n\n# Overwrite fuzz targets in CI.\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n  echo \"In CI overwriting targets to only build a single target.\"\n  export FUZZTEST_TARGET_FOLDER=\"//tensorflow/security/fuzzing/cc:base64_fuzz\"\n  unset FUZZTEST_EXTRA_TARGETS\nfi\n\necho \"  write_to_bazelrc('import %workspace%/tools/bazel.rc')\" >> configure.py\nyes \"\" | ./configure\n\ndeclare FUZZERS=$(grep '^tf_ops_fuzz_target' tensorflow/core/kernels/fuzzing/BUILD | cut -d'\"' -f2 | grep -v decode_base64 | grep -v decode_compressed | grep -v one_hot | grep -v encode_base64 | grep -v scatter_nd | grep -v decode_csv | grep -v check_numerics)\n\ncat >> tensorflow/core/kernels/fuzzing/tf_ops_fuzz_target_lib.bzl << END\n\ndef cc_tf(name):\n    native.cc_test(\n        name = name + \"_fuzz\",\n        deps = [\n            \"//tensorflow/core/kernels/fuzzing:fuzz_session\",\n            \"//tensorflow/core/kernels/fuzzing:\" + name + \"_fuzz_lib\",\n            \"//tensorflow/cc:cc_ops\",\n            \"//tensorflow/cc:scope\",\n            \"//tensorflow/core:core_cpu\",\n        ],\n\n\tlinkopts = [\"-fsanitize=fuzzer\"]\n    )\nEND\n\ncat >> tensorflow/core/kernels/fuzzing/BUILD << END\n\nload(\"//tensorflow/core/kernels/fuzzing:tf_ops_fuzz_target_lib.bzl\", \"cc_tf\")\n\nEND\n\nfor fuzzer in ${FUZZERS}; do\n    echo cc_tf\\(\\\"${fuzzer}\\\"\\) >> tensorflow/core/kernels/fuzzing/BUILD\ndone\n\ndeclare FUZZERS=$(bazel query 'kind(cc_.*, tests(//tensorflow/core/kernels/fuzzing/...))' | grep -v decode_base64)\n\n# All preparations are done, proceed to build fuzzers.\ncompile_fuzztests.sh\n\nif [ -n \"${OSS_FUZZ_CI-}\" ]\nthen\n  # Exit for now in the CI.\n  exit 0\nfi\n\n# Copy out all non-fuzztest fuzzers.\n# The fuzzers built above are in the `bazel-bin/` symlink. But they need to be\n# in `$OUT`, so move them accordingly.\nfor bazel_target in ${FUZZERS}; do\n  colon_index=$(expr index \"${bazel_target}\" \":\")\n  fuzz_name=\"${bazel_target:$colon_index}\"\n  bazel_location=\"bazel-bin/${bazel_target/:/\\/}\"\n  cp ${bazel_location} ${OUT}/$fuzz_name\n  corpus_location=tensorflow/core/kernels/fuzzing/corpus/$(basename ${fuzz_name} _fuzz)\n  if [[ -d ${corpus_location} ]]\n  then\n    find ${corpus_location} -type f | xargs zip -j ${OUT}/${fuzz_name}_seed_corpus.zip\n  fi\n  dict_location=tensorflow/core/kernels/fuzzing/dictionaries/$(basename ${fuzz_name} _fuzz).dict\n  if [[ -f ${dict_location} ]]\n  then\n    cp ${dict_location} $OUT/${fuzz_name}.dict\n  fi\ndone\n\n# Synchronize coverage folders\nsynchronize_coverage_directories\n\n# Finally, make sure we don't accidentally run with stuff from the bazel cache.\nrm -f bazel-*\n"
  },
  {
    "path": "projects/tensorflow/fuzz_patch.patch",
    "content": "diff --git a/tensorflow/security/fuzzing/cc/BUILD b/tensorflow/security/fuzzing/cc/BUILD\nindex de0898ea..ec3e3c46 100644\n--- a/tensorflow/security/fuzzing/cc/BUILD\n+++ b/tensorflow/security/fuzzing/cc/BUILD\n@@ -55,23 +55,23 @@ tf_cc_fuzz_test(\n     ],\n )\n \n-tf_cc_fuzz_test(\n-    name = \"checkpoint_reader_fuzz\",\n-    srcs = [\"checkpoint_reader_fuzz.cc\"],\n-    data = glob([\"checkpoint_reader_testdata/*\"]),\n-    tags = [\"no_oss\"],\n-    deps = [\n-        \":checkpoint_reader_fuzz_input_proto_cc\",\n-        \"//tensorflow/c:checkpoint_reader\",\n-        \"//tensorflow/c:tf_status\",\n-        \"//tensorflow/c:tf_status_helper\",\n-        \"//tensorflow/core:framework\",\n-        \"//tensorflow/core:lib\",\n-        \"//tensorflow/core/framework:types_proto_cc\",\n-        \"//tensorflow/core/platform:resource_loader\",\n-        \"//tensorflow/core/platform:status\",\n-    ],\n-)\n+#tf_cc_fuzz_test(\n+#    name = \"checkpoint_reader_fuzz\",\n+#    srcs = [\"checkpoint_reader_fuzz.cc\"],\n+#    data = glob([\"checkpoint_reader_testdata/*\"]),\n+#    tags = [\"no_oss\"],\n+#    deps = [\n+#        \":checkpoint_reader_fuzz_input_proto_cc\",\n+#        \"//tensorflow/c:checkpoint_reader\",\n+#        \"//tensorflow/c:tf_status\",\n+#        \"//tensorflow/c:tf_status_helper\",\n+#        \"//tensorflow/core:framework\",\n+#        \"//tensorflow/core:lib\",\n+#        \"//tensorflow/core/framework:types_proto_cc\",\n+#        \"//tensorflow/core/platform:resource_loader\",\n+#        \"//tensorflow/core/platform:status\",\n+#    ],\n+#)\n \n tf_proto_library(\n     name = \"checkpoint_reader_fuzz_input_proto\",\ndiff --git a/tensorflow/security/fuzzing/tf_fuzzing.bzl b/tensorflow/security/fuzzing/tf_fuzzing.bzl\nindex 1f8527c4..558c3ede 100644\n--- a/tensorflow/security/fuzzing/tf_fuzzing.bzl\n+++ b/tensorflow/security/fuzzing/tf_fuzzing.bzl\n@@ -1,6 +1,26 @@\n \"\"\"Definitions for rules to fuzz TensorFlow.\"\"\"\n \n # TensorFlow fuzzing can be done in open source too, as it is in oss-fuzz.com\n+load(\n+    \"//tensorflow:tensorflow.bzl\",\n+    \"tf_cc_test\",\n+)\n+\n+def tf_oss_fuzz_fuzztest(\n+        name,\n+        fuzzing_dict = [],\n+        corpus = [],\n+        deps = [],\n+        tags = [],\n+        **kwargs):\n+    tf_cc_test(\n+        name = name,\n+        deps = deps + [\n+            \"@com_google_fuzztest//fuzztest\",\n+            \"@com_google_fuzztest//fuzztest:fuzztest_gtest_main\",\n+        ],\n+        **kwargs\n+    )\n \n # tf_cc_fuzz_test is a cc_test modified to include fuzzing support and dependencies for go/fuzztest.\n def tf_cc_fuzz_test(\n"
  },
  {
    "path": "projects/tensorflow/project.yaml",
    "content": "homepage: \"https://www.tensorflow.org\"\nlanguage: c++\nprimary_contact: \"lpak@google.com\"\nauto_ccs:\n - \"itaiz@google.com\"\n - \"mihaimaruseac@google.com\"\n - \"rostam@google.com\"\n - \"unda@google.com\"\n - \"david@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/tensorflow/tensorflow'\n"
  },
  {
    "path": "projects/tensorflow-addons/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n        curl \\\n        rsync\n\nRUN python3 -m pip install --upgrade pip chardet\n\n# Due to Bazel bug, need to symlink python3 to python\n# See https://github.com/bazelbuild/bazel/issues/8665\nRUN ln -s /usr/local/bin/python3 /usr/local/bin/python\n\n# Install Bazelisk to keep bazel in sync with the version required by TensorFlow\nRUN curl -Lo /usr/bin/bazel \\\n        https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64 \\\n        && \\\n    chmod +x /usr/bin/bazel\n\nRUN git clone https://github.com/tensorflow/addons.git\nWORKDIR $SRC/addons\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/tensorflow-addons/build.sh",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nexport TF_NEED_CUDA=\"0\"\n\npython3 -m pip install tensorflow\npython3 ./configure.py\n\nbazel build build_pip_pkg\nbazel-bin/build_pip_pkg artifacts\npython3 -m pip install artifacts/tensorflow_addons-*.whl\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data '/usr/local/lib/python3.8/site-packages/tensorflow_addons/custom_ops/text/:tensorflow_addons/custom_ops/text/'\ndone\n"
  },
  {
    "path": "projects/tensorflow-addons/fuzz_text_ops.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n\"\"\"Module for hitting the native text modules\"\"\"\nimport sys\nimport atheris\n\n\n# Instrument selected imports rather than atheris.instrument_all() since the\n# python package will have a huge amount of code and instrument_all() will\n# take many minutes to complete.\nwith atheris.instrument_imports():\n  import numpy as np\n  import tensorflow as tf\n  from tensorflow_addons import text\n\n\n@atheris.instrument_func\ndef fuzz_parse_time(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  formats = [\n      'SECOND', 'MILLISECOND', 'MICROSECOND', 'NANOSECOND',\n      fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 32))\n  ]\n  try:\n    text.parse_time(time_string=fdp.ConsumeUnicodeNoSurrogates(\n        fdp.ConsumeIntInRange(1, 1024)),\n                    time_format=fdp.ConsumeUnicodeNoSurrogates(\n                        fdp.ConsumeIntInRange(1, 1024)),\n                    output_unit=fdp.PickValueInList(formats))\n  except tf.errors.InvalidArgumentError:\n    pass\n\n\n@atheris.instrument_func\ndef fuzz_skip_gram(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  input_bytes = []\n  for idx in range(fdp.ConsumeIntInRange(1, 100)):\n    input_bytes.append(fdp.ConsumeBytes(fdp.ConsumeIntInRange(1, 64)))\n  input_tensor = tf.constant(input_bytes)\n\n  keys_inp = []\n  for idx in range(5):\n    keys_inp.append(fdp.ConsumeBytes(fdp.ConsumeIntInRange(1, 16)))\n  keys = tf.constant(keys_inp)\n  values = tf.constant([0, 1, 2, 3, 4], tf.dtypes.int64)\n\n  tf.lookup.StaticHashTable(tf.lookup.KeyValueTensorInitializer(keys, values),\n                            -1)\n  no_table_output = text.skip_gram_ops._filter_input(\n      input_tensor=input_tensor,\n      vocab_freq_table=None,\n      vocab_min_count=None,\n      vocab_subsampling=None,\n      corpus_size=None,\n      seed=None,\n  )\n\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  fuzz_parse_time(data)\n  try:\n    fuzz_skip_gram(data)\n  except (tf.errors.FailedPreconditionError, UnicodeDecodeError):\n    pass\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/tensorflow-addons/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/tensorflow/addons\"\nmain_repo: \"https://github.com/tensorflow/addons\"\nlanguage: python\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/tensorflow-py/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n        curl \\\n        rsync \\\n        vim \\\n        && \\\n    apt-get clean && \\\n    rm -rf /var/lib/apt/lists/*\n\nRUN python3 -m pip install --upgrade pip chardet\n\n# Due to Bazel bug, need to symlink python3 to python\n# See https://github.com/bazelbuild/bazel/issues/8665\nRUN ln -s /usr/local/bin/python3 /usr/local/bin/python\n\n# Install Bazelisk to keep bazel in sync with the version required by TensorFlow\nRUN curl -Lo /usr/bin/bazel \\\n        https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64 \\\n        && \\\n    chmod +x /usr/bin/bazel\n\nRUN git clone --depth 1 https://github.com/tensorflow/tensorflow tensorflow\nWORKDIR $SRC/tensorflow\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tensorflow-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nexport ORIG_CFLAGS=\"$CFLAGS\"\nexport ORIG_CXXFLAGS=\"$CXXFLAGS\"\nexport CFLAGS=\"\"\nexport CXXFLAGS=\"\"\npython3 -m pip install numpy\nexport CFLAGS=$ORIG_CFLAGS\nexport CXXFLAGS=$ORIG_CXXFLAGS\npython3 -m pip install tf-nightly-cpu\n\n# Rename to avoid the following: https://github.com/tensorflow/tensorflow/issues/40182\nmv $SRC/tensorflow/tensorflow $SRC/tensorflow/tensorflow_src\n\n# Build fuzzers into $OUT. These could be detected in other ways.\n\nfor fuzzer in $(find $SRC -name '*_fuzz.py'); do\n  fuzzer_basename=$(basename -s .py $fuzzer)\n  fuzzer_package=${fuzzer_basename}.pkg\n\n  pyinstaller --distpath $OUT --onefile --name $fuzzer_package $fuzzer --hidden-import=chardet\n\n  echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\n\nLD_PRELOAD=ASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$this_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$this_dir/$fuzzer_package \\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\n\nmv $SRC/tensorflow/tensorflow_src $SRC/tensorflow/tensorflow\n"
  },
  {
    "path": "projects/tensorflow-py/project.yaml",
    "content": "homepage: \"https://www.tensorflow.org\"\nlanguage: python\nprimary_contact: \"lpak@google.com\"\nauto_ccs:\n - \"itaiz@google.com\"\n - \"mihaimaruseac@google.com\"\n - \"rostam@google.com\"\n - \"unda@google.com\"\n - \"david@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/tensorflow/tensorflow'\n"
  },
  {
    "path": "projects/tensorflow-serving/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder@sha256:19782f7fe8092843368894dbc471ce9b30dd6a2813946071a36e8b05f5b1e27e\n# ! This project was pinned after a clang bump. Please remove the pin, Try to fix any build warnings and errors, as well as runtime errors\nRUN apt-get update && apt-get install -y make autoconf automake libtool default-jdk bison m4 \\\n    build-essential\\\n    curl \\\n    doxygen \\\n    flex \\\n    libffi-dev \\\n    libncurses5-dev \\\n    libtool \\\n    libsqlite3-dev \\\n    mcpp \\\n    sqlite \\\n    uuid-runtime \\\n    zlib1g-dev \nRUN python3 -m pip install numpy\nRUN wget https://github.com/bazelbuild/buildtools/releases/download/4.2.5/buildifier-linux-amd64 \\\n    -O /usr/local/bin/buildifier && chmod a+x /usr/local/bin/buildifier\n\nRUN git clone https://github.com/tensorflow/serving serving\n\nCOPY build.sh *.diff $SRC/\nWORKDIR $SRC/serving\n"
  },
  {
    "path": "projects/tensorflow-serving/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nsynchronize_coverage_directories() {\n  # For coverage, we need to remap source files to correspond to the Bazel build\n  # paths. We also need to resolve all symlinks that Bazel creates.\n  if [ \"$SANITIZER\" = \"coverage\" ]\n  then\n    declare -r RSYNC_CMD=\"rsync -aLkR\"\n    declare -r REMAP_PATH=${OUT}/proc/self/cwd/\n    mkdir -p ${REMAP_PATH}\n\n    # Synchronize the folder bazel-BAZEL_OUT_PROJECT.\n    declare -r RSYNC_FILTER_ARGS=(\"--include\" \"*.h\" \"--include\" \"*.cc\" \"--include\" \\\n      \"*.hpp\" \"--include\" \"*.cpp\" \"--include\" \"*.c\" \"--include\" \"*/\" \"--include\" \"*.inc\" \\\n      \"--exclude\" \"*\")\n\n    # Sync existing code.\n    ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" tensorflow_serving/ ${REMAP_PATH}\n\n    # Sync generated proto files.\n    if [ -d \"./bazel-out/k8-opt/bin/tensorflow/\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-opt/bin/tensorflow_serving/ ${REMAP_PATH}\n    fi\n    if [ -d \"./bazel-out/k8-opt/bin/external\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-opt/bin/external/ ${REMAP_PATH}\n    fi\n    if [ -d \"./bazel-out/k8-opt/bin/third_party\" ]\n    then\n      ${RSYNC_CMD} \"${RSYNC_FILTER_ARGS[@]}\" ./bazel-out/k8-opt/bin/third_party/ ${REMAP_PATH}\n    fi\n\n    # Sync external dependencies. We don't need to include `bazel-tensorflow`.\n    # Also, remove `external/org_tensorflow` which is a copy of the entire source\n    # code that Bazel creates. Not removing this would cause `rsync` to expand a\n    # symlink that ends up pointing to itself!\n    pushd bazel-serving\n    [[ -e external/org_tensorflow ]] && unlink external/org_tensorflow\n    ${RSYNC_CMD} external/ ${REMAP_PATH}\n    popd\n  fi\n}\n\ngit apply  --ignore-space-change --ignore-whitespace $SRC/tensorflow-serving.diff\n\nbazel run @com_google_fuzztest//bazel:setup_configs >> /etc/bazel.bazelrc\nbazel build --config=oss-fuzz --subcommands --spawn_strategy=sandboxed //tensorflow_serving/util:json_tensor_test_fuzz\n\ncp bazel-bin/tensorflow_serving/util/json_tensor_test_fuzz $OUT/json_tensor_test_fuzz\n\nTARGET_FUZZER=\"json_tensor_test_fuzz@JsonFuzzTest.TheF\"\necho \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nchmod +x \\$this_dir/json_tensor_test_fuzz\n\\$this_dir/json_tensor_test_fuzz --fuzz=JsonFuzzTest.TheF -- \\$@\" > $OUT/${TARGET_FUZZER}\nchmod +x $OUT/${TARGET_FUZZER}\n\n# Synchronize coverage folders\nsynchronize_coverage_directories\n"
  },
  {
    "path": "projects/tensorflow-serving/project.yaml",
    "content": "homepage: \"https://github.com/tensorflow/serving\"\nprimary_contact: \"david@adalogics.com\"\nmain_repo: \"https://github.com/tensorflow/serving\"\nlanguage: c++\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/tensorflow-serving/tensorflow-serving.diff",
    "content": "diff --git a/tensorflow_serving/util/BUILD b/tensorflow_serving/util/BUILD\nindex 4802a79f..f7d596dc 100644\n--- a/tensorflow_serving/util/BUILD\n+++ b/tensorflow_serving/util/BUILD\n@@ -345,6 +345,28 @@ cc_test(\n     ],\n )\n \n+cc_test(\n+    name = \"json_tensor_test_fuzz\",\n+    srcs = [\"json_tensor_test.cc\"],\n+    deps = [\n+        \":json_tensor\",\n+        \"//tensorflow_serving/apis:classification_cc_proto\",\n+        \"//tensorflow_serving/apis:model_cc_proto\",\n+        \"//tensorflow_serving/apis:predict_cc_proto\",\n+        \"//tensorflow_serving/apis:regression_cc_proto\",\n+        # \"//tensorflow_serving/core/test_util:test_main\",\n+\t\"@org_tensorflow//tensorflow/core:testlib\",\n+        \"//tensorflow_serving/test_util\",\n+\t\"@com_google_fuzztest//fuzztest\",\n+\t\"@com_google_fuzztest//fuzztest:fuzztest_gtest_main\",\n+        \"@com_google_protobuf//:protobuf\",\n+        \"@org_tensorflow//tensorflow/core:framework\",\n+        \"@org_tensorflow//tensorflow/core:lib\",\n+        \"@org_tensorflow//tensorflow/core:protos_all_cc\",\n+        \"@org_tensorflow//tensorflow/core:test\",\n+    ],\n+)\n+\n cc_library(\n     name = \"proto_util\",\n     srcs = [\"proto_util.h\"],\ndiff --git a/tensorflow_serving/util/json_tensor_test.cc b/tensorflow_serving/util/json_tensor_test.cc\nindex b8145986..2b6a464b 100644\n--- a/tensorflow_serving/util/json_tensor_test.cc\n+++ b/tensorflow_serving/util/json_tensor_test.cc\n@@ -23,6 +23,9 @@ limitations under the License.\n #include <gmock/gmock.h>\n #include <gtest/gtest.h>\n #include \"absl/strings/substitute.h\"\n+\n+#include \"fuzztest/fuzztest.h\"\n+\n #include \"tensorflow/core/lib/core/errors.h\"\n #include \"tensorflow/core/lib/core/status_test_util.h\"\n #include \"tensorflow/core/platform/protobuf.h\"\n@@ -184,6 +187,15 @@ TEST(JsontensorTest, FloatTensorWithPrecisionLoss) {\n               )\"));\n }\n \n+\n+void TheF(const std::string &s1) {\n+\tif (s1.size() > 120){\n+\t  TensorInfoMap infomap;\n+\t      TextFormat::ParseFromString(s1, &infomap[\"default\"]);\n+\t}\n+}\n+FUZZ_TEST(JsonFuzzTest, TheF);\n+\n TEST(JsontensorTest, FloatTensorThatExceedsMaxReturnsInf) {\n   TensorInfoMap infomap;\n   ASSERT_TRUE(\ndiff --git a/tensorflow_serving/workspace.bzl b/tensorflow_serving/workspace.bzl\nindex de1203a7..dd18da94 100644\n--- a/tensorflow_serving/workspace.bzl\n+++ b/tensorflow_serving/workspace.bzl\n@@ -104,6 +104,13 @@ def tf_serving_workspace():\n         ],\n     )\n \n+    http_archive(\n+        name = \"com_google_fuzztest\",\n+\tsha256 = \"c75f224b34c3c62ee901381fb743f6326f7b91caae0ceb8fe62f3fd36f187627\",\n+\tstrip_prefix = \"fuzztest-58b4e7065924f1a284952b84ea827ce35a87e4dc\",\n+\turls = [\"https://github.com/google/fuzztest/archive/58b4e7065924f1a284952b84ea827ce35a87e4dc.zip\"],\n+    )\n+\n     # ==== TensorFlow Decision Forests ===\n     http_archive(\n         name = \"org_tensorflow_decision_forests\",\n"
  },
  {
    "path": "projects/tesseract-ocr/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y automake libtool pkg-config libtiff-dev libwebp-dev libzstd-dev\n\nRUN git clone --depth 1 https://github.com/DanBloomberg/leptonica.git\nRUN git clone --depth 1 https://github.com/tesseract-ocr/tesseract.git\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tesseract-ocr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n$SRC/tesseract/unittest/fuzzers/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/tesseract-ocr/project.yaml",
    "content": "homepage: \"https://github.com/tesseract-ocr/tesseract\"\nlanguage: c++\nprimary_contact: \"stjoweil@googlemail.com\"\nmain_repo: 'https://github.com/tesseract-ocr/tesseract'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/textdistance/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone --depth 1 https://github.com/life4/textdistance.git textdistance \\\n        && cp textdistance/fuzzing/build.sh $SRC/\nWORKDIR $SRC/textdistance\n\n"
  },
  {
    "path": "projects/textdistance/project.yaml",
    "content": "homepage: \"https://github.com/life4/textdistance\"\nlanguage: python\nprimary_contact: \"gram@orsinium.dev\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/life4/textdistance.git\"\n"
  },
  {
    "path": "projects/textwrap/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/mgeisler/textwrap.git\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/textwrap/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\ncd $SRC/textwrap/fuzz\ncargo fuzz build\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/fill_fast_path $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/fill_first_fit $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/fill_optimal_fit $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/refill $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/unfill $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/wrap_fast_path $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/wrap_first_fit $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/wrap_optimal_fit $OUT/\ncp $SRC/textwrap/fuzz/target/x86_64-unknown-linux-gnu/release/wrap_optimal_fit_usize $OUT/\n"
  },
  {
    "path": "projects/textwrap/project.yaml",
    "content": "homepage: \"https://crates.io/crates/textwrap\"\nlanguage: rust\nprimary_contact: \"mrtn.gslr@gmail.com\"\nauto_ccs:\n  - \"github@ireas.org\"\n  - \"guillaume1.gomez@gmail.com\"\n  - \"venkatamaturi98@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/mgeisler/textwrap.git'\n"
  },
  {
    "path": "projects/threetenbp/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nRUN curl -L https://download.java.net/openjdk/jdk11.0.0.1/ri/openjdk-11.0.0.1_linux-x64_bin.tar.gz \\\n      -o jdk.tar.gz && \\\n      tar zxf jdk.tar.gz && \\\n      rm jdk.tar.gz\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nENV JAVA_HOME=\"$SRC/jdk-11.0.0.1\"\nENV PATH=\"$JAVA_HOME/bin:$PATH\"\nRUN git clone --depth 1 https://github.com/ThreeTen/threetenbp threetenbp\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/threetenbp\n"
  },
  {
    "path": "projects/threetenbp/ThreetenbpFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport java.util.EnumSet;\nimport java.util.Locale;\nimport org.threeten.bp.format.DateTimeFormatter;\nimport org.threeten.bp.format.DateTimeParseException;\nimport org.threeten.bp.format.FormatStyle;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [org.threeten.bp.format.DateTimeFormatter] public static\n// org.threeten.bp.format.DateTimeFormatter ofPattern(java.lang.String)\npublic class ThreetenbpFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      DateTimeFormatter formatter = null;\n      switch (data.consumeInt(1, 6)) {\n        case 1:\n          formatter = DateTimeFormatter.ofPattern(data.consumeString(data.remainingBytes() / 2));\n          break;\n        case 2:\n          formatter = DateTimeFormatter.ofPattern(\n              data.consumeString(data.remainingBytes() / 2), Locale.ROOT);\n          break;\n        case 3:\n          formatter =\n              DateTimeFormatter.ofLocalizedDate(data.pickValue(EnumSet.allOf(FormatStyle.class)));\n          break;\n        case 4:\n          formatter =\n              DateTimeFormatter.ofLocalizedTime(data.pickValue(EnumSet.allOf(FormatStyle.class)));\n          break;\n        case 5:\n          formatter = DateTimeFormatter.ofLocalizedDateTime(\n              data.pickValue(EnumSet.allOf(FormatStyle.class)));\n          break;\n        case 6:\n          formatter = DateTimeFormatter.ofLocalizedDateTime(\n              data.pickValue(EnumSet.allOf(FormatStyle.class)),\n              data.pickValue(EnumSet.allOf(FormatStyle.class)));\n          break;\n      }\n      if (formatter != null) {\n        formatter.parse(data.consumeRemainingAsString());\n      }\n    } catch (DateTimeParseException | IllegalArgumentException e) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/threetenbp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nfind ./ -name pom.xml -exec sed -i 's/compilerVersion>1.6</compilerVersion>1.8</g' {} \\;\nfind ./ -name pom.xml -exec sed -i 's/source>1.6</source>1.8</g' {} \\;\nfind ./ -name pom.xml -exec sed -i 's/target>1.6</target>1.8</g' {} \\;\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"target/threetenbp-$CURRENT_VERSION.jar\" $OUT/threetenbp.jar\n\nALL_JARS=\"threetenbp.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\ncp -r $JAVA_HOME $OUT/\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  $JAVA_HOME/bin/javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    JAVA_HOME=\\$this_dir/$(basename $JAVA_HOME)     \\\n    PATH=$JAVA_HOME/bin:$PATH\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/threetenbp/project.yaml",
    "content": "homepage: https://github.com/ThreeTen/threetenbp\nmain_repo: https://github.com/ThreeTen/threetenbp\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/thrift-c_glib/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y libssl-dev pkg-config autoconf automake libtool bison flex wget make zip cmake libglib2.0-dev patchelf\n\n#Install Boost from source\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \\\n    tar xzf boost_1_87_0.tar.gz && \\\n    cd boost_1_87_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_87_0\n\nCOPY build.sh default.options $SRC/\n\nRUN git clone --depth 1 https://github.com/apache/thrift.git\n\nWORKDIR $SRC/thrift "
  },
  {
    "path": "projects/thrift-c_glib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\n\n# Build and install the compiler (disable other languages to save time)\n./bootstrap.sh\n./configure --enable-static --disable-shared --with-cpp=no --with-c_glib=yes --with-python=no --with-py3=no --with-go=no --with-rs=no --with-java=no --with-nodejs=no --with-dotnet=no --with-kotlin=no\nmake -j$(nproc)\nmake install\n\n# Build c_glib library and fuzzers\npushd lib/c_glib/test/fuzz\nmake check\nfor i in $(find . -maxdepth 1 -type f -executable -printf \"%f\\n\"); do\n    cp $i $OUT/$i\n    cp $SRC/default.options $OUT/\"$i\".options; \n    # Set rpath so fuzzers can find libraries\n    patchelf --set-rpath '$ORIGIN/lib' $OUT/$i\ndone\npopd\n\n# Copy libraries over for the c_glib fuzzers\nmkdir -p $OUT/lib\ncp /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 $OUT/lib/ "
  },
  {
    "path": "projects/thrift-c_glib/default.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/thrift-c_glib/project.yaml",
    "content": "homepage: \"https://thrift.apache.org/\"\nlanguage: c\nprimary_contact: \"m.hasnain.lakhani@gmail.com\"\n\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - centipede\nsanitizers:\n  - address\n  - undefined\n\nmain_repo: 'https://github.com/apache/thrift' "
  },
  {
    "path": "projects/thrift-cpp/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y libssl-dev pkg-config autoconf automake libtool bison flex wget make zip cmake\n\n# Install Boost from source\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \\\n    tar xzf boost_1_87_0.tar.gz && \\\n    cd boost_1_87_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_87_0\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/apache/thrift.git\n\nWORKDIR $SRC/thrift "
  },
  {
    "path": "projects/thrift-cpp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\n\n# Build and install the compiler (disable other languages to save time)\n./bootstrap.sh\n./configure --enable-static --disable-shared --with-cpp=yes --with-c_glib=no --with-python=no --with-py3=no --with-go=no --with-rs=no --with-java=no --with-nodejs=no --with-dotnet=no --with-kotlin=no\nmake -j$(nproc)\nmake install\n\n# Build C++ library and fuzzers\npushd lib/cpp/test/fuzz\nmake check\nfor i in $(find . -maxdepth 1 -type f -executable -printf \"%f\\n\"); do\n    cp $i $OUT/$i\ndone\npopd\n"
  },
  {
    "path": "projects/thrift-cpp/project.yaml",
    "content": "homepage: \"https://thrift.apache.org/\"\nlanguage: c++\nprimary_contact: \"m.hasnain.lakhani@gmail.com\"\n\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - centipede\nsanitizers:\n  - address\n\nmain_repo: 'https://github.com/apache/thrift' "
  },
  {
    "path": "projects/thrift-go/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN apt-get update && apt-get install -y libssl-dev pkg-config autoconf automake libtool bison flex wget make\n\n# Install Boost from source\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \\\n    tar xzf boost_1_87_0.tar.gz && \\\n    cd boost_1_87_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_87_0\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/apache/thrift.git\n\nWORKDIR $SRC/thrift "
  },
  {
    "path": "projects/thrift-go/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\n\nif [[ ! -z \"${CXX:-}\" ]]; then\n  export CXX=\"${CXX//-lresolv/}\"\nfi\n\n# Build and install the compiler...\n# Disable other languages to save on compile time\n./bootstrap.sh\n# ... this forces go to be downloaded/installed, otherwise the configure script chokes when running go version\ngo version\n./configure --enable-static --disable-shared --with-cpp=no --with-c_glib=no --with-python=no --with-py3=no --with-go=yes --with-rs=no --with-java=no --with-nodejs=no --with-dotnet=no --with-kotlin=no\nmake -j$(nproc)\n\npushd lib/go/test/fuzz\n\nmake gopathfuzz\ncompile_go_fuzzer . FuzzTutorial fuzz_tutorial\ncompile_go_fuzzer . FuzzParseBinary fuzz_parse_binary\ncompile_go_fuzzer . FuzzParseCompact fuzz_parse_compact\ncompile_go_fuzzer . FuzzParseJson fuzz_parse_json\ncompile_go_fuzzer . FuzzRoundtripBinary fuzz_roundtrip_binary\ncompile_go_fuzzer . FuzzRoundtripCompact fuzz_roundtrip_compact\ncompile_go_fuzzer . FuzzRoundtripJson fuzz_roundtrip_json\n\npopd\n"
  },
  {
    "path": "projects/thrift-go/project.yaml",
    "content": "homepage: \"https://thrift.apache.org/\"\nlanguage: go\nprimary_contact: \"m.hasnain.lakhani@gmail.com\"\nauto_ccs:\n- \"p.antoine@catenacyber.fr\"\n\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\nmain_repo: 'https://github.com/apache/thrift' "
  },
  {
    "path": "projects/thrift-java/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y libssl-dev pkg-config autoconf automake libtool bison flex wget make ant zip curl\n\n# Install Boost from source\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \\\n    tar xzf boost_1_87_0.tar.gz && \\\n    cd boost_1_87_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_87_0\n\n# Download and install Gradle\nRUN cd /usr/local && \\\n    curl -L https://services.gradle.org/distributions/gradle-8.13-bin.zip -o gradle-8.13-bin.zip && \\\n    unzip gradle-8.13-bin.zip && \\\n    rm gradle-8.13-bin.zip\n\nENV GRADLE_HOME=/usr/local/gradle-8.13\nENV PATH=$PATH:$GRADLE_HOME/bin\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/apache/thrift.git\n\nWORKDIR $SRC/thrift "
  },
  {
    "path": "projects/thrift-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\n\n# Build and install the compiler (disable other languages to save time)\n./bootstrap.sh\n./configure --enable-static --disable-shared --with-cpp=no --with-c_glib=no --with-python=no --with-py3=no --with-go=no --with-rs=no --with-java=yes --with-nodejs=no --with-dotnet=no --with-kotlin=no\nmake -j$(nproc)\nmake install\n\n# Build Java library and fuzzers\npushd lib/java\nmake check\ncp build/libs/*.jar $OUT/\n\n# Dynamically find the built jar files to be version-agnostic\nMAIN_JAR=$(find build/libs -name \"libthrift-*.jar\" -not -name \"*-test.jar\" -not -name \"*-sources.jar\" -not -name \"*-javadoc.jar\" | head -n1 | xargs basename)\nTEST_JAR=$(find build/libs -name \"libthrift-*-test.jar\" | head -n1 | xargs basename)\n\n# Verify jars were found\nif [[ -z \"$MAIN_JAR\" || -z \"$TEST_JAR\" ]]; then\n  echo \"Error: Could not find required jar files\"\n  echo \"Main jar: $MAIN_JAR\"\n  echo \"Test jar: $TEST_JAR\"\n  echo \"Available jars:\"\n  find build/libs -name \"*.jar\"\n  exit 1\nfi\n\nPROJECT_JARS=\"$MAIN_JAR $TEST_JAR\"\necho \"Using jars: $PROJECT_JARS\"\n\n# Package each fuzzer\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  # Build classpath using $this_dir so it works in any location (not hardcoded /out/)\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"\\$this_dir\\\" \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=\\$this_dir/$MAIN_JAR:\\$this_dir/$TEST_JAR:/usr/local/lib/jazzer_api_deploy.jar \\\n--target_class=org.apache.thrift.test.fuzz.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:-Djava.awt.headless=true\\\" \\\n\\\"\\$@\\\"\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\npopd "
  },
  {
    "path": "projects/thrift-java/project.yaml",
    "content": "homepage: \"https://thrift.apache.org/\"\nlanguage: jvm\nprimary_contact: \"m.hasnain.lakhani@gmail.com\"\n\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\nmain_repo: 'https://github.com/apache/thrift' "
  },
  {
    "path": "projects/thrift-js/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nRUN apt-get update && apt-get install -y libssl-dev pkg-config autoconf automake libtool bison flex wget make\n\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \\\n    tar xzf boost_1_87_0.tar.gz && \\\n    cd boost_1_87_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_87_0\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/apache/thrift.git\n\nWORKDIR $SRC/thrift\n"
  },
  {
    "path": "projects/thrift-js/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\n\n# Build and install the compiler...\n# Disable other languages to save on compile time\n./bootstrap.sh\n./configure --enable-static --disable-shared --with-cpp=no --with-c_glib=no --with-python=no --with-py3=no --with-go=no --with-rs=no --with-java=no --with-nodejs=yes --with-dotnet=no --with-kotlin=no\nmake -j$(nproc)\n\n# We only fuzz the nodejs ones for now, will do the base JS ones later in a followup\n# TODO: Do this\npushd lib/nodejs\nmake stubs\nmake install\n\n# Install jazzer.js for fuzzing\nnpm install --save-dev @jazzer.js/core\n\n# Create the directory structure expected by the fuzzers\n# Fuzzers use require(\"../../lib/thrift\") so they need to be at lib/nodejs/test/fuzz/\n# and the thrift library at lib/nodejs/lib/thrift/\nmkdir -p $OUT/thrift/lib/nodejs/lib\nmkdir -p $OUT/thrift/lib/nodejs/test\n\n# Copy files to match the expected structure (we're in lib/nodejs/)\ncp -r lib/thrift $OUT/thrift/lib/nodejs/lib/\ncp -r test/fuzz $OUT/thrift/lib/nodejs/test/\n\n# node_modules may be in current dir or have been hoisted - find and copy it\nif [ -d \"node_modules\" ]; then\n    cp -r node_modules $OUT/thrift/\nelif [ -d \"../../node_modules\" ]; then\n    cp -r ../../node_modules $OUT/thrift/\nelse\n    echo \"ERROR: Could not find node_modules\"\n    find /src -name \"node_modules\" -type d 2>/dev/null | head -5\n    exit 1\nfi\n\npushd test/fuzz\n\ncompile_javascript_fuzzer() {\n    fuzz_target=$1\n    jazzerjs_args=${@:2}\n    fuzzer_basename=$(basename -s .js $fuzz_target)\n\n    # Use this_dir for portability (works in check_build which copies to /tmp)\n    echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput so that the wrapper script is recognized as a fuzz target for 'check_build'.\nthis_dir=\\$(dirname \\\"\\$0\\\")\n\\$this_dir/thrift/node_modules/@jazzer.js/core/dist/cli.js \\$this_dir/thrift/lib/nodejs/test/fuzz/$fuzz_target $jazzerjs_args \\$JAZZERJS_EXTRA_ARGS -- \\\"\\$@\\\"\" > $OUT/$fuzzer_basename\n\n    chmod +x $OUT/$fuzzer_basename\n}\n\ncompile_javascript_fuzzer fuzz_parse_TBinaryProtocol.js --sync\ncompile_javascript_fuzzer fuzz_parse_TCompactProtocol.js --sync\ncompile_javascript_fuzzer fuzz_parse_TJSONProtocol.js --sync\ncompile_javascript_fuzzer fuzz_roundtrip_TBinaryProtocol.js --sync\ncompile_javascript_fuzzer fuzz_roundtrip_TCompactProtocol.js --sync\ncompile_javascript_fuzzer fuzz_roundtrip_TJSONProtocol.js --sync\n\npopd\npopd\n"
  },
  {
    "path": "projects/thrift-js/project.yaml",
    "content": "homepage: \"https://thrift.apache.org/\"\nlanguage: javascript\nprimary_contact: \"m.hasnain.lakhani@gmail.com\"\n\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - none\n\nmain_repo: 'https://github.com/apache/thrift'\n"
  },
  {
    "path": "projects/thrift-py/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN apt-get update && apt-get install -y libssl-dev pkg-config autoconf automake libtool bison flex wget make\n\n# Install Boost from source\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \\\n    tar xzf boost_1_87_0.tar.gz && \\\n    cd boost_1_87_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_87_0\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/apache/thrift.git\n\nWORKDIR $SRC/thrift "
  },
  {
    "path": "projects/thrift-py/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\n\n\n# Build and install the compiler...\n# Disable other languages to save on compile time\n./bootstrap.sh\n./configure --enable-static --disable-shared --with-cpp=no --with-c_glib=no --with-python=yes --with-py3=yes --with-go=no --with-rs=no --with-java=no --with-nodejs=no --with-dotnet=no --with-kotlin=no\nmake -j$(nproc)\n\npushd lib/py\nmake check || true\nmake install\n\nfor fuzzer in $(find . -name 'fuzz_*.py'); do\n  # Skip fuzz_common.py\n  if [[ $fuzzer == *\"fuzz_common.py\"* ]]; then\n    continue\n  fi\n\n  fuzzer_basename=$(basename -s .py $fuzzer)\n  fuzzer_package=${fuzzer_basename}.pkg\n\n  # Thrift lib dir contains python version in the name, so to be portable...\n  lib_path=$(find ./build -maxdepth 1 -type d | grep lib)\n\n  # To avoid issues with Python version conflicts, or changes in environment\n  # over time on the OSS-Fuzz bots, we use pyinstaller to create a standalone\n  # package. Though not necessarily required for reproducing issues, this is\n  # required to keep fuzzers working properly in OSS-Fuzz.\n  pyinstaller --distpath $OUT \\\n          --paths \"$lib_path\" \\\n          --paths \"./gen-py\" \\\n          --add-data \"$lib_path:thrift_lib\" \\\n          --add-data \"./gen-py:gen-py\" \\\n          --onefile --name $fuzzer_package $fuzzer\n\n  # Create execution wrapper. Atheris requires that certain libraries are\n  # preloaded, so this is also done here to ensure compatibility and simplify\n  # test case reproduction. Since this helper script is what OSS-Fuzz will\n  # actually execute, it is also always required.\n  # NOTE: If you are fuzzing python-only code and do not have native C/C++\n  # extensions, then remove the LD_PRELOAD line below as preloading sanitizer\n  # library is not required and can lead to unexpected startup crashes.\n  echo \"#!/bin/sh\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_PRELOAD=\\$this_dir/sanitizer_with_fuzzer.so \\\nASAN_OPTIONS=\\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\\$this_dir/llvm-symbolizer:detect_leaks=0 \\\n\\$this_dir/$fuzzer_package \\$@\" > $OUT/$fuzzer_basename\n  chmod +x $OUT/$fuzzer_basename\ndone\npopd"
  },
  {
    "path": "projects/thrift-py/project.yaml",
    "content": "homepage: \"https://thrift.apache.org/\"\nlanguage: python\nprimary_contact: \"m.hasnain.lakhani@gmail.com\"\n\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\nmain_repo: 'https://github.com/apache/thrift' "
  },
  {
    "path": "projects/thrift-rust/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN apt-get update && apt-get install -y libssl-dev pkg-config autoconf automake libtool bison flex wget make\n\n# Install Boost from source\nRUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \\\n    tar xzf boost_1_87_0.tar.gz && \\\n    cd boost_1_87_0 && \\\n    ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 clean && \\\n    ./b2 toolset=clang -j$(nproc) install && \\\n    cd .. && \\\n    rm -rf boost_1_87_0\n\nRUN rustup component add rustfmt\nRUN rustup component add clippy\n\nCOPY build.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/apache/thrift.git\n\nWORKDIR $SRC/thrift"
  },
  {
    "path": "projects/thrift-rust/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport ASAN_OPTIONS=detect_leaks=0\n\n# Build and install the compiler...\n# Disable other languages to save on compile time\n./bootstrap.sh\n./configure --enable-static --disable-shared --with-cpp=no --with-c_glib=no --with-python=no --with-py3=no --with-go=no --with-rs=yes --with-java=no --with-nodejs=no --with-dotnet=no --with-kotlin=no\nmake -j$(nproc)\n\n# Build rust fuzzers\npushd lib/rs/test/fuzz\n# Don't do a make check so we don't fail clippy on formatting and stuff\nmake stubs\nrust_target_out_dir=target/x86_64-unknown-linux-gnu/release\ncargo fuzz build -O\ncargo fuzz list | while read i; do\n    cp $rust_target_out_dir/$i $OUT/fuzz_$i\ndone\npopd\n\n# Generate corpora\npushd lib/rs/test/fuzz\nmkdir -p corpus/{binary,compact}\n\n# Generate corpus files for each protocol type\necho \"Generating binary protocol corpus...\"\n$rust_target_out_dir/corpus_generator --protocol binary --output-dir corpus/binary --generate 1024\n\necho \"Generating compact protocol corpus...\"\n$rust_target_out_dir/corpus_generator --protocol compact --output-dir corpus/compact --generate 1024\n\n# Create seed corpus zip files once per protocol\nzip -q -j \"$OUT/binary_protocol_corpus.zip\" corpus/binary/*\nzip -q -j \"$OUT/compact_protocol_corpus.zip\" corpus/compact/*\n\n# Define fuzzer names for Rust-specific fuzzers\nBINARY_FUZZERS=\"fuzz_parse_binary fuzz_roundtrip_binary\"\nCOMPACT_FUZZERS=\"fuzz_parse_compact fuzz_roundtrip_compact\"\n\n# Copy the zip files for each fuzzer\nfor fuzzer in $BINARY_FUZZERS; do\n    cp \"$OUT/binary_protocol_corpus.zip\" \"$OUT/${fuzzer}_seed_corpus.zip\"\ndone\n\nfor fuzzer in $COMPACT_FUZZERS; do\n    cp \"$OUT/compact_protocol_corpus.zip\" \"$OUT/${fuzzer}_seed_corpus.zip\"\ndone\n\n# Clean up temporary protocol corpus files\nrm \"$OUT/binary_protocol_corpus.zip\" \"$OUT/compact_protocol_corpus.zip\"\n\npopd"
  },
  {
    "path": "projects/thrift-rust/project.yaml",
    "content": "homepage: \"https://thrift.apache.org/\"\nlanguage: rust\nprimary_contact: \"m.hasnain.lakhani@gmail.com\"\n\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n\nmain_repo: 'https://github.com/apache/thrift'"
  },
  {
    "path": "projects/tidb/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/pingcap/tidb\nCOPY build.sh \\\n     fuzzMarshalJSON.go \\\n     fuzzNewBitLiteral.go \\\n     fuzzNewHexLiteral.go \\\n     $SRC/\nWORKDIR $SRC/tidb\n"
  },
  {
    "path": "projects/tidb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/fuzzMarshalJSON.go $SRC/tidb/pkg/types/\nmv $SRC/fuzzNewBitLiteral.go $SRC/tidb/pkg/types/\nmv $SRC/fuzzNewHexLiteral.go $SRC/tidb/pkg/types/\n\ncompile_go_fuzzer github.com/pingcap/tidb/pkg/types FuzzUnmarshalJSON fuzzUnmarshalJSON\ncompile_go_fuzzer github.com/pingcap/tidb/pkg/types FuzzNewBitLiteral fuzzNewBitLiteral\ncompile_go_fuzzer github.com/pingcap/tidb/pkg/types FuzzNewHexLiteral fuzzNewHexLiteral\n"
  },
  {
    "path": "projects/tidb/fuzzMarshalJSON.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage types\n\n// FuzzMarshalJSON implements the fuzzer\nfunc FuzzUnmarshalJSON(data []byte) int {\n\tbj :=  new(BinaryJSON)\n\tbj.UnmarshalJSON(data)\n\treturn 1\n}\n"
  },
  {
    "path": "projects/tidb/fuzzNewBitLiteral.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage types\n\n// FuzzNewBitLiteral implements the fuzzer\nfunc FuzzNewBitLiteral(data []byte) int {\n\t_, err := NewBitLiteral(string(data))\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/tidb/fuzzNewHexLiteral.go",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\npackage types\n\n// FuzzNewHexLiteral implements the fuzzer\nfunc FuzzNewHexLiteral(data []byte) int {\n\t_, err := NewHexLiteral(string(data))\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/tidb/project.yaml",
    "content": "homepage: \"https://github.com/pingcap/tidb\"\nprimary_contact: \"zhouqiang@pingcap.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/pingcap/tidb'\n"
  },
  {
    "path": "projects/tidy-html5/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && \\\n    apt-get install -y --no-install-recommends \\\n        cmake ninja-build && \\\n    apt-get clean\n\nRUN git clone -b next --single-branch \\\n    https://github.com/htacg/tidy-html5.git tidy-html5\nWORKDIR tidy-html5\nCOPY *.sh *.c *.h *.options $SRC/\n"
  },
  {
    "path": "projects/tidy-html5/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir -p build/cmake\ncd build/cmake\n\ncmake -GNinja ${SRC}/tidy-html5/\nninja\n\nfor fuzzer in tidy_config_fuzzer tidy_fuzzer tidy_xml_fuzzer tidy_parse_string_fuzzer tidy_parse_file_fuzzer tidy_general_fuzzer; do\n    ${CC} ${CFLAGS} -c -I${SRC}/tidy-html5/include \\\n        $SRC/${fuzzer}.c -o ${fuzzer}.o\n    ${CXX} ${CXXFLAGS} -std=c++11 ${fuzzer}.o \\\n        -o $OUT/${fuzzer} \\\n        $LIB_FUZZING_ENGINE libtidy.a\n    cp $SRC/tidy_config_fuzzer.options $OUT/${fuzzer}.options\ndone\n\ncp ${SRC}/*.options ${OUT}/\n"
  },
  {
    "path": "projects/tidy-html5/fuzzer_temp_file.h",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that\n// require a file instead of an input buffer.\n\n#ifndef FUZZER_TEMP_FILE_H_\n#define FUZZER_TEMP_FILE_H_\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n// Pure-C interface for creating and cleaning up temporary files.\n\nstatic char* fuzzer_get_tmpfile(const uint8_t* data, size_t size) {\n  char* filename_buffer = strdup(\"/tmp/generate_temporary_file.XXXXXX\");\n  if (!filename_buffer) {\n    perror(\"Failed to allocate file name buffer.\");\n    abort();\n  }\n  const int file_descriptor = mkstemp(filename_buffer);\n  if (file_descriptor < 0) {\n    perror(\"Failed to make temporary file.\");\n    abort();\n  }\n  FILE* file = fdopen(file_descriptor, \"wb\");\n  if (!file) {\n    perror(\"Failed to open file descriptor.\");\n    close(file_descriptor);\n    abort();\n  }\n  const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);\n  if (bytes_written < size) {\n    close(file_descriptor);\n    fprintf(stderr, \"Failed to write all bytes to file (%zu out of %zu)\",\n            bytes_written, size);\n    abort();\n  }\n  fclose(file);\n  return filename_buffer;\n}\n\nstatic void fuzzer_release_tmpfile(char* filename) {\n  if (unlink(filename) != 0) {\n    perror(\"WARNING: Failed to delete temporary file.\");\n  }\n  free(filename);\n}\n\n// C++ RAII object for creating temporary files.\n\n#ifdef __cplusplus\nclass FuzzerTemporaryFile {\n public:\n  FuzzerTemporaryFile(const uint8_t* data, size_t size)\n      : filename_(fuzzer_get_tmpfile(data, size)) {}\n\n  ~FuzzerTemporaryFile() { fuzzer_release_tmpfile(filename_); }\n\n  const char* filename() const { return filename_; }\n\n private:\n  char* filename_;\n};\n#endif\n\n#endif  // FUZZER_TEMP_FILE_H_\n"
  },
  {
    "path": "projects/tidy-html5/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"http://www.html-tidy.org/\"\nlanguage: c++\nprimary_contact: \"balthisar@gmail.com\"\nauto_ccs:\n  - \"nmarrow@google.com\"\n  - \"pmokati@google.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\nlabels:\n  tidy_fuzzer:\n    - sundew\nmain_repo: 'https://github.com/htacg/tidy-html5.git'\n"
  },
  {
    "path": "projects/tidy-html5/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\ncd regression_testing\nASAN_OPTIONS=detect_leaks=0 ./test.rb test\n"
  },
  {
    "path": "projects/tidy-html5/tidy_config_fuzzer.c",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n\n#include \"fuzzer_temp_file.h\"\n#include \"tidy.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    TidyDoc tdoc = tidyCreate();\n\n    // At the time this fuzzer was written, the configuration parser could\n    // only be exercised via a file interface.\n    char* tmpfile = fuzzer_get_tmpfile(data, size);\n    tidyLoadConfig(tdoc, tmpfile);\n    fuzzer_release_tmpfile(tmpfile);\n    tidyRelease(tdoc);\n    return 0;\n}\n"
  },
  {
    "path": "projects/tidy-html5/tidy_config_fuzzer.options",
    "content": "[libfuzzer]\nclose_fd_mask = 3\ndetect_leaks = 0"
  },
  {
    "path": "projects/tidy-html5/tidy_fuzzer.c",
    "content": "// Copyright 2018 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"tidy.h\"\n#include \"tidybuffio.h\"\n\nvoid run_tidy_parser(TidyBuffer* data_buffer,\n                     TidyBuffer* output_buffer,\n                     TidyBuffer* error_buffer) {\n    TidyDoc tdoc = tidyCreate();\n    if (tidySetErrorBuffer(tdoc, error_buffer) < 0) {\n        abort();\n    }\n    tidyOptSetBool(tdoc, TidyXhtmlOut, yes);\n    tidyOptSetBool(tdoc, TidyForceOutput, yes);\n\n    if (tidyParseBuffer(tdoc, data_buffer) >= 0 &&\n            tidyCleanAndRepair(tdoc) >= 0 &&\n            tidyRunDiagnostics(tdoc) >= 0) {\n        tidySaveBuffer(tdoc, output_buffer);\n    }\n    tidyRelease(tdoc);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    TidyBuffer data_buffer;\n    TidyBuffer output_buffer;\n    TidyBuffer error_buffer;\n    tidyBufInit(&data_buffer);\n    tidyBufInit(&output_buffer);\n    tidyBufInit(&error_buffer);\n\n    tidyBufAttach(&data_buffer, (byte*)data, size);\n    run_tidy_parser(&data_buffer, &output_buffer, &error_buffer);\n\n    tidyBufFree(&error_buffer);\n    tidyBufFree(&output_buffer);\n    tidyBufDetach(&data_buffer);\n    return 0;\n}\n"
  },
  {
    "path": "projects/tidy-html5/tidy_general_fuzzer.c",
    "content": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#include <sys/types.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <unistd.h>\n#include \"tidybuffio.h\"\n#include \"tidy.h\"\n\n// All boolean options. These will be set randomly\n// based on the fuzzer data.\nTidyOptionId bool_options[] = {\n  TidyJoinClasses, \n  TidyJoinStyles, \n  TidyKeepFileTimes, \n  TidyKeepTabs, \n  TidyLiteralAttribs, \n  TidyLogicalEmphasis, \n  TidyLowerLiterals, \n  TidyMakeBare, \n  TidyFixUri, \n  TidyForceOutput, \n  TidyGDocClean, \n  TidyHideComments,\n  TidyMark, \n  TidyXmlTags, \n  TidyMakeClean,\n  TidyAnchorAsName, \n  TidyMergeEmphasis, \n  TidyMakeBare, \n  TidyMetaCharset, \n  TidyMuteShow, \n  TidyNCR, \n  TidyNumEntities, \n  TidyOmitOptionalTags, \n  TidyPunctWrap, \n  TidyQuiet,\n  TidyQuoteAmpersand,  \n  TidyQuoteMarks, \n  TidyQuoteNbsp, \n  TidyReplaceColor, \n  TidyShowFilename, \n  TidyShowInfo, \n  TidyShowMarkup, \n  TidyShowMetaChange, \n  TidyShowWarnings, \n  TidySkipNested, \n  TidyUpperCaseTags, \n  TidyWarnPropAttrs, \n  TidyWord2000, \n  TidyWrapAsp, \n  TidyWrapAttVals, \n  TidyWrapJste, \n  TidyWrapPhp, \n  TidyWrapScriptlets, \n  TidyWrapSection, \n  TidyWriteBack,\n};\n\nvoid set_option(const uint8_t** data, size_t *size, TidyDoc *tdoc, TidyOptionId tboolID) {\n  uint8_t decider;\n  decider = **data;\n  *data += 1; \n  *size -= 1;\n  if (decider % 2 == 0) tidyOptSetBool( *tdoc, tboolID, yes );\n  else { tidyOptSetBool( *tdoc, tboolID, no ); }\n}\n\nint TidyXhtml(const uint8_t* data, size_t size, TidyBuffer* output, TidyBuffer* errbuf) {\n  uint8_t decider;\n\n  // We need enough data for picking all of the options. One byte per option.\n  if (size < 5+(sizeof(bool_options)/sizeof(bool_options[0]))) {\n    return 0;\n  }\n\n  TidyDoc tdoc = tidyCreate();\n\n  // Decide output format\n  decider = *data;\n  data++; size--;\n  if (decider % 3 == 0) tidyOptSetBool( tdoc, TidyXhtmlOut, yes );\n  else { tidyOptSetBool( tdoc, TidyXhtmlOut, no ); }\n\n  if (decider % 3 == 1) tidyOptSetBool( tdoc, TidyHtmlOut, yes );\n  else { tidyOptSetBool( tdoc, TidyHtmlOut, no ); }\n\n  if (decider % 3 == 2) tidyOptSetBool( tdoc, TidyXmlOut, yes );\n  else { tidyOptSetBool( tdoc, TidyXmlOut, no ); }\n\n  // Set options \n  for (int i=0; i < sizeof(bool_options)/sizeof(TidyOptionId); i++) {\n    set_option(&data, &size, &tdoc, bool_options[i]);\n  }\n\n  // Set an error buffer.\n  tidySetErrorBuffer(tdoc, errbuf);\n\n  // Parse the data\n  decider = *data;\n  data++; size--;\n  switch (decider % 2) {\n    case 0: {\n      char filename[256];\n      sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n      FILE *fp = fopen(filename, \"wb\");\n      if (!fp) {\n          return 0;\n      }\n      fwrite(data, size, 1, fp);\n      fclose(fp);\n\n      tidyParseFile(tdoc, filename);\n      unlink(filename);\n    }\n    break;\n    case 1: {\n      char *inp = malloc(size+1);\n      inp[size] = '\\0';\n      memcpy(inp, data, size);\n      tidyParseString(tdoc, inp);\n      free(inp);\n    }\n  }\n\n  // Cleanup\n  tidyRelease( tdoc );\n\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  TidyBuffer fuzz_toutput;\n  TidyBuffer fuzz_terror;\n\n  tidyBufInit(&fuzz_toutput);\n  tidyBufInit(&fuzz_terror);\n\n  TidyXhtml(data, size, &fuzz_toutput, &fuzz_terror);\n\n  tidyBufFree(&fuzz_toutput);\n  tidyBufFree(&fuzz_terror);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/tidy-html5/tidy_parse_file_fuzzer.c",
    "content": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#include <sys/types.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <unistd.h>\n#include \"tidybuffio.h\"\n#include \"tidy.h\"\n\n\nint TidyXhtml(const uint8_t* data, size_t size, TidyBuffer* output, TidyBuffer* errbuf) {\n  Bool ok;\n\n  TidyDoc tdoc = tidyCreate();\n\n  ok = tidyOptSetBool( tdoc, TidyXhtmlOut, yes );\n  if (ok) tidySetErrorBuffer(tdoc, errbuf);\n \n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  tidyParseFile(tdoc, filename);\n\n  tidyRelease( tdoc );\n  unlink(filename);\n\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  TidyBuffer fuzz_toutput;\n  TidyBuffer fuzz_terror;\n\n  tidyBufInit(&fuzz_toutput);\n  tidyBufInit(&fuzz_terror);\n\n  TidyXhtml(data, size, &fuzz_toutput, &fuzz_terror);\n\n  tidyBufFree(&fuzz_toutput);\n  tidyBufFree(&fuzz_terror);\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/tidy-html5/tidy_parse_string_fuzzer.c",
    "content": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#include <sys/types.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include \"tidybuffio.h\"\n#include \"tidy.h\"\n\n\nint TidyXhtml(const char* input, TidyBuffer* output, TidyBuffer* errbuf) {\n  TidyDoc tdoc = tidyCreate();\n  tidyOptSetBool( tdoc, TidyXhtmlOut, yes );\n  tidySetErrorBuffer(tdoc, errbuf);\n\n  tidyParseString(tdoc, input);\n\n  tidyCleanAndRepair(tdoc);\n  tidyRunDiagnostics(tdoc);\n  tidyOptSetBool(tdoc, TidyForceOutput, yes);\n  tidySaveBuffer(tdoc, output);\n  tidyRelease( tdoc );\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  char *fuzz_inp = malloc(size+1);\n  memcpy(fuzz_inp, data, size);\n  fuzz_inp[size] = '\\0';\n\n  TidyBuffer fuzz_toutput;\n  TidyBuffer fuzz_terror;\n\n  tidyBufInit(&fuzz_toutput);\n  tidyBufInit(&fuzz_terror);\n\n  TidyXhtml(fuzz_inp, &fuzz_toutput, &fuzz_terror);\n\n  tidyBufFree(&fuzz_toutput);\n  tidyBufFree(&fuzz_terror);\n  free(fuzz_inp);\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/tidy-html5/tidy_xml_fuzzer.c",
    "content": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#include <sys/types.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include \"tidy.h\"\n#include \"tidybuffio.h\"\n#include \"tidyenum.h\"\n#include \"tidyplatform.h\"\n\nvoid TidyXml(char *fuzz_inp, TidyBuffer *toutput,\n             TidyBuffer *terror) {\n  TidyDoc tdoc = tidyCreate();\n  tidyBufClear(toutput);\n  tidyBufClear(terror);\n  if (tidyOptSetBool(tdoc, TidyXmlOut, yes)) {\n    tidySetCharEncoding(tdoc, \"utf8\");\n    tidySetErrorBuffer(tdoc, terror);\n    tidyOptSetInt(tdoc, TidyWrapLen, 0);\n    tidyOptSetBool(tdoc, TidyXmlTags, yes);\n    tidyOptSetBool(tdoc, TidyQuoteNbsp, no);\n    tidyOptSetBool(tdoc, TidyNumEntities, yes);\n    tidyOptSetBool(tdoc, TidyQuiet, yes);\n    tidyOptSetBool(tdoc, TidyMark, no);\n    tidyOptSetBool(tdoc, TidyShowWarnings, no);\n    tidyParseString(tdoc, fuzz_inp);\n    tidyCleanAndRepair(tdoc);\n    tidyRunDiagnostics(tdoc);\n    tidySaveBuffer(tdoc, toutput);\n  }\n\n  tidyRelease(tdoc);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char *fuzz_inp = malloc(size+1);\n  memcpy(fuzz_inp, data, size);\n  fuzz_inp[size] = '\\0';\n\n  TidyBuffer fuzz_toutput;\n  TidyBuffer fuzz_terror;\n\n  tidyBufInit(&fuzz_toutput);\n  tidyBufInit(&fuzz_terror);\n\n  TidyXml(fuzz_inp, &fuzz_toutput, &fuzz_terror);\n\n  free(fuzz_inp);\n  tidyBufFree(&fuzz_toutput);\n  tidyBufFree(&fuzz_terror);\n  return 0;\n}\n"
  },
  {
    "path": "projects/time/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/facebook/time.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/time\n"
  },
  {
    "path": "projects/time/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngo install golang.org/x/tools/cmd/goimports@latest\n\ngo get github.com/AdamKorcz/go-118-fuzz-build/testing\ngo get github.com/stretchr/testify/assert@v1.7.0\ngo get github.com/facebook/time/fbclock/daemon\n\n\n# FuzzCompute\nsed -i -e '/func TestHashShouldMatch(/,/^}/ s/^/\\/\\//' leaphash/leaphash_test.go\nsed -i -e '/\\\"github.com\\/stretchr\\/testify\\/require\\\"/ s/^/\\/\\//' leaphash/leaphash_test.go\n\n# FuzzBytesToPacket\nsed -i -e '/func Benchmark.*(/,/^}/ s/^/\\/\\//' ntp/protocol/ntp_test.go\ngoimports -w ntp/protocol/ntp_test.go\n\n# FuzzDecodePacket ptp\nsed -i -e '/func Benchmark.*(/,/^}/ s/^/\\/\\//' ptp/protocol/protocol_test.go\n\n\ncompile_native_go_fuzzer    github.com/facebook/time/fbclock/daemon          FuzzPrepareExpression       fuzz_prepare_expression\ncompile_native_go_fuzzer    github.com/facebook/time/leaphash                FuzzCompute                 fuzz_compute\ncompile_native_go_fuzzer    github.com/facebook/time/leapsectz               FuzzParse                   fuzz_parse\ncompile_native_go_fuzzer    github.com/facebook/time/ntp/chrony              FuzzDecodePacket            fuzz_decode_packet_ntp\ncompile_native_go_fuzzer    github.com/facebook/time/ntp/control             FuzzNormalizeData           fuzz_normalize_data\ncompile_native_go_fuzzer    github.com/facebook/time/ntp/protocol            FuzzBytesToPacket           fuzz_bytes_to_packet\ncompile_native_go_fuzzer    github.com/facebook/time/ptp/protocol            FuzzDecodePacket            fuzz_decode_packet_ptp\n"
  },
  {
    "path": "projects/time/project.yaml",
    "content": "homepage: \"https://opensource.fb.com\"\nlanguage: go\nprimary_contact: \"leoleovich@meta.com\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\n  - \"pcullen@meta.com\"\n  - \"vadfed@meta.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: \"https://github.com/facebook/time\"\nfile_github_issue: True\n"
  },
  {
    "path": "projects/timestamp-authority/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/sigstore/timestamp-authority\n# For json corpus\nRUN git clone --depth=1 https://github.com/dvyukov/go-fuzz-corpus\n# For json dictionary\nRUN git clone --depth=1 https://github.com/rc0r/afl-fuzz\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/timestamp-authority\n"
  },
  {
    "path": "projects/timestamp-authority/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./test/fuzz/oss_fuzz_build.sh\n\n"
  },
  {
    "path": "projects/timestamp-authority/project.yaml",
    "content": "homepage: \"https://sigstore.dev\"\nmain_repo: \"https://github.com/sigstore/timestamp-authority\"\nprimary_contact: \"hblauzvern@sigstore.dev\"\nauto_ccs:\n  - malancas@sigstore.dev\n  - bcallaway@sigstore.dev\n  - lhinds@sigstore.dev\n  - codysoyland@sigstore.dev\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/tink-cc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN apt-get update && apt-get install -y make pkg-config\nRUN git clone --depth 1 https://github.com/tink-crypto/tink-cc\n\nRUN mkdir $SRC/tink-cc/fuzzing\nCOPY fuzzing_CMake $SRC/tink-cc/fuzzing/CMakeLists.txt\nCOPY tink_encrypt_decrypt_fuzzer.cc $SRC/tink-cc/fuzzing/tink_encrypt_decrypt_fuzzer.cc\nCOPY build.sh $SRC/\n\nWORKDIR tink-cc\n"
  },
  {
    "path": "projects/tink-cc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/tink-cc/fuzzing && cmake .\nmake -j$(nproc)\nmv tink_encrypt_fuzzer $OUT/\n\n# Hack to get coverage to work. We need this due to /src/tink/cc/fuzzing/tink/__include_alias/tink\n# being an symbolic link. Instead, we exchange it with the actual contents.\nrm /src/tink-cc/fuzzing/tink-cc/__include_alias/tink\nmkdir /src/tinktmp\ncp -rf /src/tink-cc/ /src/tinktmp/tink\ncp -rf /src/tinktmp/tink/ /src/tink-cc/fuzzing/tink-cc/__include_alias/tink\n"
  },
  {
    "path": "projects/tink-cc/fuzzing_CMake",
    "content": "cmake_minimum_required(VERSION 3.5)\nproject(tink_fuzz CXX)\nset(CMAKE_CXX_STANDARD 17)\n\nadd_subdirectory(.. tink-cc)\n\nadd_executable(tink_encrypt_fuzzer tink_encrypt_decrypt_fuzzer.cc)\ntarget_link_libraries(tink_encrypt_fuzzer tink::static $ENV{LIB_FUZZING_ENGINE})\n"
  },
  {
    "path": "projects/tink-cc/project.yaml",
    "content": "homepage: \"https://developers.google.com/tink\"\nlanguage: c++\nprimary_contact: \"thaidn@google.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"sschmieg@google.com\"\n  - \"tholenst@google.com\"\nsanitizers:\n  - address\n  - memory\n#  - undefined # TODO: Needs investigation\nmain_repo: \"https://github.com/google/tink\"\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/tink-cc/tink_encrypt_decrypt_fuzzer.cc",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n#include <string>\n#include \"tink/subtle/aes_siv_boringssl.h\"\n\n\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n    crypto::tink::util::SecretData key = crypto::tink::util::SecretDataFromStringView(\"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\");\n    auto res = crypto::tink::subtle::AesSivBoringSsl::New(key);\n    auto cipher = std::move(res.value());\n    std::string aad = \"Additional data\";\n    std::string message(reinterpret_cast<const char*>(data), size);\n    auto ct = cipher->EncryptDeterministically(message, aad);\n    auto pt = cipher->DecryptDeterministically(ct.value(), aad);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/tinycss2/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/Kozea/tinycss2/ tinycss2\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/tinycss2\n"
  },
  {
    "path": "projects/tinycss2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/tinycss2/fuzz_components.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport tinycss2\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  skip_comments = fdp.ConsumeBool()\n  skip_whitespace = fdp.ConsumeBool()\n  source_to_parse = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n\n  tinycss2.parse_one_component_value(\n    source_to_parse,\n    skip_comments\n  )\n\n  tinycss2.parse_one_component_value(\n    source_to_parse,\n    skip_comments\n  )\n\n  tinycss2.parse_declaration_list(\n    source_to_parse,\n    skip_comments,\n    skip_whitespace\n  )\n\n  tinycss2.parse_one_rule(\n    source_to_parse,\n    skip_comments,\n  )\n\n  tinycss2.parse_rule_list(\n    source_to_parse,\n    skip_comments,\n    skip_whitespace\n  )\n\n  tinycss2.parse_stylesheet(\n    source_to_parse,\n    skip_comments,\n    skip_whitespace\n  )\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/tinycss2/fuzz_parse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport tinycss2\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  tinycss2.parse_component_value_list(\n    fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  )\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/tinycss2/project.yaml",
    "content": "homepage: https://github.com/Kozea/tinycss2/\nmain_repo: https://github.com/Kozea/tinycss2/\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/tinygltf/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN pip3 install meson ninja\nRUN git clone --depth 1 https://github.com/syoyo/tinygltf.git\nWORKDIR $SRC/tinygltf\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/tinygltf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\ncd tests/fuzzer/\nmeson build\ncd build\nninja -j$(nproc)\ncp fuzz_gltf $OUT/\n\n# Build unit test\ncd $SRC/tinygltf\ncmake .\nmake -C tests\n"
  },
  {
    "path": "projects/tinygltf/project.yaml",
    "content": "homepage: \"https://github.com/syoyo/tinygltf\"\nlanguage: c++\nprimary_contact: \"p.antoine@catenacyber.fr\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nmain_repo: 'https://github.com/syoyo/tinygltf.git'\n"
  },
  {
    "path": "projects/tinygltf/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Enter tests directory and run the two unit test cases\ncd tests && ./tester && ./tester_noexcept\n"
  },
  {
    "path": "projects/tinyobjloader/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://github.com/tinyobjloader/tinyobjloader\nCOPY build.sh run_tests.sh $SRC/\nWORKDIR $SRC/tinyobjloader\n"
  },
  {
    "path": "projects/tinyobjloader/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir build && cd build\ncmake .. -DBUILD_SHARED_LIBS=OFF\nmake -j $(nproc)\ncp fuzz* $OUT/\n"
  },
  {
    "path": "projects/tinyobjloader/project.yaml",
    "content": "homepage: \"https://github.com/tinyobjloader/tinyobjloader\"\nlanguage: c++\nprimary_contact: \"p.antoine@catenacyber.fr\"\nsanitizers:\n- address\n- undefined\nmain_repo: 'https://github.com/tinyobjloader/tinyobjloader'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/tinyobjloader/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/tinyobjloader/tests && make check\n"
  },
  {
    "path": "projects/tinysparql/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y python3-pip libdbus-1-dev libnghttp2-dev libpsl-dev asciidoc-base libunistring-dev libffi-dev libpcre2-dev\nRUN unset CFLAGS CXXFLAGS && pip3 install -U meson ninja packaging\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/tinysparql.git\nWORKDIR tinysparql\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tinysparql/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nBUILD=$WORK/meson\n\nrm -rf $BUILD\nmkdir $BUILD\n\nmeson setup $BUILD \\\n  -Doss_fuzz=enabled \\\n  -Db_lundef=false \\\n  -Ddefault_library=static \\\n  -Dunicode_support=unistring \\\n  -Dsystemd_user_services=false \\\n  -Dintrospection=disabled \\\n  -Dbuiltin_modules=true \\\n  -Dvapi=disabled \\\n  -Ddocs=false \\\n  -Dtests=false \\\n  -Dlibsoup3:tests=false \\\n  -Dlibsoup3:docs=disabled \\\n  -Dglib:tests=false \\\n  -Dglib:libmount=disabled \\\n  -Dglib:oss_fuzz=disabled\n\nninja -C $BUILD\n\nfind $BUILD/fuzzing -maxdepth 1 -executable -type f -exec cp \"{}\" $OUT \\;\n\nfind fuzzing -type f -name \"*.dict\" -exec cp \"{}\" $OUT \\;\n\nfor CORPUS in $(find fuzzing -type f -name \"*.corpus\"); do\n  BASENAME=${CORPUS##*/}\n  zip $OUT/${BASENAME%%.*}_seed_corpus.zip . -ws -r -i@$CORPUS\ndone\n"
  },
  {
    "path": "projects/tinysparql/project.yaml",
    "content": "homepage: \"http://tinysparql.org\"\nlanguage: c\nprimary_contact: \"mrgarnacho@gmail.com\"\nauto_ccs:\n- ssssam@gmail.com\nsanitizers:\n- address\n- undefined\nhelp_url: https://gitlab.gnome.org/GNOME/tinysparql/tree/main/fuzzing#how-to-reproduce-oss-fuzz-bugs-locally\nmain_repo: 'https://gitlab.gnome.org/GNOME/tinysparql'\n"
  },
  {
    "path": "projects/tinyusb/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool python3-click\n\nRUN git clone --depth 1 https://github.com/hathach/tinyusb.git tinyusb\nWORKDIR tinyusb\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tinyusb/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nset -euxo pipefail\n\nexport CXXFLAGS=\"$CXXFLAGS -Wno-error=missing-field-initializers\"\n\n# Patch target Makefiles to use absolute include paths for the per-target\n# src/ directory (contains tusb_config.h). The upstream Makefiles use a\n# relative \"src\" include which resolves differently per build directory,\n# causing the indexer to pick up conflicting compile commands.\nfor f in test/fuzz/device/*/Makefile; do\n  sed -i '/^[[:space:]]\\+src[[:space:]]/s|src|$(abspath src)|' \"$f\"\ndone\n\nfuzz_harness=$(ls -d test/fuzz/device/*/)\nfor h in $fuzz_harness\ndo\n  make -C $h get-deps\n  make -C $h all\n  cp $h/_build/$(basename $h) $OUT/\n  corpus=$h/$(basename $h)_seed_corpus.zip\n  if test -f $corpus; then\n    cp $corpus $OUT/\n  fi\ndone\n"
  },
  {
    "path": "projects/tinyusb/project.yaml",
    "content": "homepage: \"https://docs.tinyusb.org/en/latest/\"\nlanguage: c++\nprimary_contact: \"Ha Thach\"\nmain_repo: \"https://github.com/hathach/tinyusb.git\"\nprimary_contact: \"thach@tinyusb.org\"\nauto_ccs:\n  - \"tinyusb.org@gmail.com\"\n  - \"nathaniel.brough@gmail.com\"\n\nsanitizers:\n  - address\n  - undefined\n  - memory\n\narchitectures:\n- x86_64\n# aarch64 is not supported yet. Enabling it causes trouble for maintainers.\n#- aarch64\n"
  },
  {
    "path": "projects/tinyxml2/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config\n\nRUN git clone --depth 1 https://github.com/leethomason/tinyxml2\nWORKDIR tinyxml2\n\nCOPY run_tests.sh build.sh *.cpp *.dict *.options $SRC/\n"
  },
  {
    "path": "projects/tinyxml2/build.sh",
    "content": "#!/bin/bash\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Make sure OSS-Fuzz's CXXFLAGS are propagated into the build\nsed -i 's/CXXFLAGS =/#CXXFLAGS/g' Makefile\n\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\nfuzz_harness=$(ls -d \"$SRC\"/*.cpp)\nfor h in $fuzz_harness; do\n  $CXX $CXXFLAGS -std=c++11 -Iinclude/ \"$h\" \\\n    -o \"$OUT/$(basename \"$h\" .cpp)\" $LIB_FUZZING_ENGINE $SRC/tinyxml2/libtinyxml2.a\ndone\n\ncp $SRC/*.dict $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/tinyxml2/project.yaml",
    "content": "homepage: \"www.grinninglizard.com/tinyxml2\"\nlanguage: c++\nprimary_contact: \"leethomason@gmail.com\"\nauto_ccs:\n  - \"pranjal.jumde@gmail.com\"\n  - \"kiddo.pwn@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/leethomason/tinyxml2'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/tinyxml2/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/tinyxml2/xmltest\n"
  },
  {
    "path": "projects/tinyxml2/xml.dict",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n#\n# AFL dictionary for XML\n# ----------------------\n#\n# Several basic syntax elements and attributes, modeled on libxml2.\n#\n# Created by Michal Zalewski <lcamtuf@google.com>\n#\n\nattr_encoding=\" encoding=\\\"1\\\"\"\nattr_generic=\" a=\\\"1\\\"\"\nattr_href=\" href=\\\"1\\\"\"\nattr_standalone=\" standalone=\\\"no\\\"\"\nattr_version=\" version=\\\"1\\\"\"\nattr_xml_base=\" xml:base=\\\"1\\\"\"\nattr_xml_id=\" xml:id=\\\"1\\\"\"\nattr_xml_lang=\" xml:lang=\\\"1\\\"\"\nattr_xml_space=\" xml:space=\\\"1\\\"\"\nattr_xmlns=\" xmlns=\\\"1\\\"\"\n\nentity_builtin=\"&lt;\"\nentity_decimal=\"&#1;\"\nentity_external=\"&a;\"\nentity_hex=\"&#x1;\"\n\nstring_any=\"ANY\"\nstring_brackets=\"[]\"\nstring_cdata=\"CDATA\"\nstring_col_fallback=\":fallback\"\nstring_col_generic=\":a\"\nstring_col_include=\":include\"\nstring_dashes=\"--\"\nstring_empty=\"EMPTY\"\nstring_empty_dblquotes=\"\\\"\\\"\"\nstring_empty_quotes=\"''\"\nstring_entities=\"ENTITIES\"\nstring_entity=\"ENTITY\"\nstring_fixed=\"#FIXED\"\nstring_id=\"ID\"\nstring_idref=\"IDREF\"\nstring_idrefs=\"IDREFS\"\nstring_implied=\"#IMPLIED\"\nstring_nmtoken=\"NMTOKEN\"\nstring_nmtokens=\"NMTOKENS\"\nstring_notation=\"NOTATION\"\nstring_parentheses=\"()\"\nstring_pcdata=\"#PCDATA\"\nstring_percent=\"%a\"\nstring_public=\"PUBLIC\"\nstring_required=\"#REQUIRED\"\nstring_schema=\":schema\"\nstring_system=\"SYSTEM\"\nstring_ucs4=\"UCS-4\"\nstring_utf16=\"UTF-16\"\nstring_utf8=\"UTF-8\"\nstring_xmlns=\"xmlns:\"\n\ntag_attlist=\"<!ATTLIST\"\ntag_cdata=\"<![CDATA[\"\ntag_close=\"</a>\"\ntag_doctype=\"<!DOCTYPE\"\ntag_element=\"<!ELEMENT\"\ntag_entity=\"<!ENTITY\"\ntag_ignore=\"<![IGNORE[\"\ntag_include=\"<![INCLUDE[\"\ntag_notation=\"<!NOTATION\"\ntag_open=\"<a>\"\ntag_open_close=\"<a />\"\ntag_open_exclamation=\"<!\"\ntag_open_q=\"<?\"\ntag_sq2_close=\"]]>\"\ntag_xml_q=\"<?xml?>\"\n"
  },
  {
    "path": "projects/tinyxml2/xmltest.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"tinyxml2/tinyxml2.h\"\n\n#include <string>\n#include <cstdint>\n\nusing namespace tinyxml2;\nusing namespace std;\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tstd::string data_string(reinterpret_cast<const char*>(data), size);\n\tXMLDocument doc;\n\tdoc.Parse( data_string.c_str() );\n\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/tinyxml2/xmltest.options",
    "content": "[libfuzzer]\ndict = xml.dict\n"
  },
  {
    "path": "projects/tinyxml2/xmltest2.cpp",
    "content": "/* Copyright 2024 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"tinyxml2/tinyxml2.h\"\n\n#include <string>\n#include <cstdio>\n#include <cstdint>\n#include <cstdlib>\n\n#include <unistd.h>\n\nusing namespace tinyxml2;\nusing namespace std;\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\tchar pathname[256];\n\tsprintf(pathname, \"/tmp/libfuzzer.%d\", getpid());\n\tFILE *fp = fopen(pathname, \"wb\");\n\tfwrite(data, size, 1, fp);\n  \tfclose(fp);\n    \n\tXMLDocument doc;\n\tdoc.LoadFile(pathname);\n\n    unlink(pathname);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/tinyxml2/xmltest2.options",
    "content": "[libfuzzer]\ndict = xml.dict\n"
  },
  {
    "path": "projects/tmux/Dockerfile",
    "content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake bison pkg-config \\\n    ncurses-dev libtool\n\nRUN git clone https://github.com/libevent/libevent.git && \\\n    cd libevent && \\\n    mkdir build && \\\n    cd build && \\\n    cmake -DEVENT__DISABLE_MBEDTLS=ON -DEVENT__DISABLE_OPENSSL=ON -DEVENT__LIBRARY_TYPE=STATIC -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_SAMPLES=ON ../ && \\\n    make && make install\n\nRUN git clone --depth 1 https://github.com/tmux/tmux.git\nRUN git clone --depth 1 https://github.com/tmux/tmux-fuzzing-corpus.git\nWORKDIR tmux\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tmux/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Ensure libevent can be found\nexport PKG_CONFIG_PATH=\"/usr/local/lib/\"\n\n./autogen.sh\n./configure \\\n    --enable-fuzzing \\\n    FUZZING_LIBS=\"${LIB_FUZZING_ENGINE} -lc++\" \\\n    LIBEVENT_LIBS=\"-Wl,-Bstatic -levent -Wl,-Bdynamic\" \\\n    LIBTINFO_LIBS=\" -l:libtinfo.a \"\n\nmake -j\"$(nproc)\" check\nfind \"${SRC}/tmux/fuzz/\" -name '*-fuzzer' -exec cp -v '{}' \"${OUT}\"/ \\;\nfind \"${SRC}/tmux/fuzz/\" -name '*-fuzzer.options' -exec cp -v '{}' \"${OUT}\"/ \\;\nfind \"${SRC}/tmux/fuzz/\" -name '*-fuzzer.dict' -exec cp -v '{}' \"${OUT}\"/ \\;\n\nMAXLEN=$(grep -Po 'max_len\\s+=\\s+\\K\\d+' \"${OUT}/input-fuzzer.options\")\n\nif [ ! -d \"${WORK}/fuzzing_corpus\" ]; then\n    mkdir \"${WORK}/fuzzing_corpus\"\n    cd \"${WORK}/fuzzing_corpus\"\n    bash \"${SRC}/tmux/tools/24-bit-color.sh\" | \\\n        split -a4 -db$MAXLEN - 24-bit-color.out.\n    perl \"${SRC}/tmux/tools/256colors.pl\" | \\\n        split -a4 -db$MAXLEN - 256colors.out.\n    cat \"${SRC}/tmux/tools/UTF-8-demo.txt\" | \\\n        split -a4 -db$MAXLEN - UTF-8-demo.txt.\n    cat \"${SRC}/tmux-fuzzing-corpus/alacritty\"/* | \\\n        split -a4 -db$MAXLEN - alacritty.\n    cat \"${SRC}/tmux-fuzzing-corpus/esctest\"/* | \\\n        split -a4 -db$MAXLEN - esctest.\n    cat \"${SRC}/tmux-fuzzing-corpus/iterm2\"/* | \\\n        split -a5 -db$MAXLEN - iterm2.\n    zip -q -j -r \"${OUT}/input-fuzzer_seed_corpus.zip\" \\\n        \"${WORK}/fuzzing_corpus/\"\nfi\n"
  },
  {
    "path": "projects/tmux/project.yaml",
    "content": "homepage: \"https://tmux.github.io/\"\nlanguage: c\nprimary_contact: nicholas.marriott@gmail.com\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/tmux/tmux.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/tokio/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth 1 https://github.com/tokio-rs/tokio tokio     # or use other version control\nWORKDIR tokio\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tokio/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncd tokio\ncargo fuzz build -O --debug-assertions\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_linked_list $OUT/\n\ncd ..\n\ncd tokio-stream\ncargo fuzz build -O --debug-assertions\ncp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_stream_map $OUT/\n"
  },
  {
    "path": "projects/tokio/project.yaml",
    "content": "homepage: \"https://tokio.rs/\"\nlanguage: rust\nprimary_contact: aliceryhl@google.com\nmain_repo: \"https://github.com/tokio-rs/tokio\"\nauto_ccs:\n  - security@tokio.rs\n  - nathaniel.brough@gmail.com\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer"
  },
  {
    "path": "projects/tomcat/DecodeFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\n\nimport java.lang.StringBuilder;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.Charset;\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.io.UnsupportedEncodingException;\nimport org.apache.tomcat.util.buf.UEncoder;\nimport org.apache.tomcat.util.buf.UEncoder.SafeCharsSet;\nimport org.apache.tomcat.util.buf.UDecoder;\nimport org.apache.tomcat.util.buf.CharChunk;\nimport org.apache.catalina.util.URLEncoder;\nimport java.nio.charset.StandardCharsets;\n\npublic class DecodeFuzzer {\n    static String [] encodings = {\n        \"US-ASCII\",\n        \"ISO-8859-1\",\n        \"UTF-8\",\n        \"UTF-16BE\",\n        \"UTF-16LE\",\n        \"UTF-16\"\n    };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int num = data.consumeInt(0, encodings.length - 1);\n        String enc = encodings[num];\n        String str = data.consumeRemainingAsString();\n\n        try {\n            String decodedData = UDecoder.URLDecode(str, Charset.forName(enc));\n        } catch (IllegalArgumentException e) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/tomcat/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.15-bin.tar.gz -o ant.tar.gz && \\\n    mkdir -p $SRC/ant && \\\n    tar -zxvf ant.tar.gz -C $SRC/ant --strip-components=1 && \\\n    rm -rf ant.tar.gz\n\nRUN apt update && apt install -y openjdk-21-jdk\n\nENV ANT_HOME=$SRC/ant\nENV ANT $SRC/ant/bin/ant\nENV JAVA_HOME /usr/lib/jvm/java-21-openjdk-amd64\n\nRUN git clone --depth 1 https://github.com/apache/tomcat\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/tomcat"
  },
  {
    "path": "projects/tomcat/EnDecodeFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\n\nimport java.lang.StringBuilder;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.Charset;\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.io.UnsupportedEncodingException;\nimport org.apache.tomcat.util.buf.UEncoder;\nimport org.apache.tomcat.util.buf.UEncoder.SafeCharsSet;\nimport org.apache.tomcat.util.buf.UDecoder;\nimport org.apache.tomcat.util.buf.CharChunk;\nimport org.apache.catalina.util.URLEncoder;\nimport java.nio.charset.StandardCharsets;\nimport java.math.BigInteger;\n// import javax.xml.bind.DatatypeConverter;\n\npublic class EnDecodeFuzzer {\n    static String [] encodings = {\n        \"US-ASCII\",\n        \"ISO-8859-1\",\n        \"UTF-8\",\n        \"UTF-16BE\",\n        \"UTF-16LE\",\n        // \"UTF-16\"\n    };\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int num = data.consumeInt(0, encodings.length - 1);\n        String originalData = data.consumeRemainingAsAsciiString();\n        URLEncoder ue = new URLEncoder();\n        String enc = encodings[num];\n        String encodedData = ue.encode(originalData, Charset.forName(enc));\n        String decodedData = UDecoder.URLDecode(encodedData, Charset.forName(enc));\n\n        // try {\n        //     System.out.println(\"Encoding: \" + enc);\n        //     System.out.println(\"Original: \" + toHexadecimal(originalData, enc));\n        //     System.out.println(\"Decoded: \" + toHexadecimal(decodedData, enc));   \n        // } catch (Exception e) {\n        //     throw new FuzzerSecurityIssueHigh(\"print error\");\n        // }\n\n        assert decodedData.equals(originalData) : new FuzzerSecurityIssueHigh(\"Encoding decoding inconsistent\");\n    }\n\n    // public static String toHexadecimal(String text, String enc) throws UnsupportedEncodingException\n    // {\n    //     byte[] myBytes = text.getBytes(enc);\n    //     return DatatypeConverter.printHexBinary(myBytes);\n    // }\n}\n"
  },
  {
    "path": "projects/tomcat/FileHandlerFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.File;\nimport java.nio.file.Paths;\nimport java.nio.file.Files;\nimport java.util.logging.LogRecord;\nimport java.util.logging.Level;\n\nimport org.apache.juli.FileHandler;\nimport org.apache.juli.OneLineFormatter;\nimport org.apache.juli.VerbatimFormatter;\n\n\npublic class FileHandlerFuzzer {\n    static final String PREFIX = \"test\";\n    static final String SUFFIX = \".log\";\n    // Use /tmp to avoid creating directories in /out which breaks check_build\n    static final String logsBase = \"/tmp/juli_fuzz_tests\";\n    static File logsDir = null;\n    static FileHandler fh1 = null;\n    static OneLineFormatter olf = new OneLineFormatter();\n    static VerbatimFormatter vf = new VerbatimFormatter();\n    static Level[] la = {Level.SEVERE, Level.WARNING, Level.INFO, Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST, Level.ALL};\n    static boolean initialized = false;\n\n    public static void fuzzerTearDown() {\n        if (fh1 != null) {\n            try {\n                fh1.close();\n            } catch (Exception e) {\n                // Ignore cleanup errors\n            }\n            fh1 = null;\n        }\n        if (logsDir != null) {\n            deleteDirectory(logsDir);\n            logsDir = null;\n        }\n        initialized = false;\n    }\n\n    public static void fuzzerInitialize() {\n        try {\n            if (Files.exists(Paths.get(logsBase))) {\n                deleteDirectory(new File(logsBase));\n            }\n            new File(logsBase).mkdirs();\n            logsDir = new File(logsBase);\n            // Only use FileHandler (not AsyncFileHandler) to avoid threading issues\n            fh1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX, SUFFIX);\n            fh1.open();\n            initialized = true;\n        } catch (Exception e) {\n            // If initialization fails, mark as initialized to avoid retry loops\n            initialized = true;\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        if (!initialized) {\n            fuzzerInitialize();\n        }\n        \n        // Skip if handler failed to initialize\n        if (fh1 == null) {\n            return;\n        }\n\n        int fn = data.consumeInt(0, 2);\n        int ln = data.consumeInt(0, la.length - 1);\n        String str = data.consumeRemainingAsString();\n\n        switch (fn) {\n            case 1:\n                fh1.setFormatter(olf);\n                break;\n            case 2:\n                fh1.setFormatter(vf);\n                break;\n            default:\n                break;\n        }\n\n        fh1.setLevel(la[ln]);\n        \n        LogRecord lr = new LogRecord(la[ln], str);\n        \n        try {\n            fh1.publish(lr);\n            fh1.flush();\n        } catch (Exception e) {\n            // Ignore publish errors\n        }\n    }\n\n    static boolean deleteDirectory(File directoryToBeDeleted) {\n        if (directoryToBeDeleted == null || !directoryToBeDeleted.exists()) {\n            return true;\n        }\n        File[] allContents = directoryToBeDeleted.listFiles();\n        if (allContents != null) {\n            for (File file : allContents) {\n                deleteDirectory(file);\n            }\n        }\n        return directoryToBeDeleted.delete();\n    }\n}"
  },
  {
    "path": "projects/tomcat/HttpParserFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;\nimport org.apache.tomcat.util.http.parser.HttpParser;\n\npublic class HttpParserFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String input = data.consumeRemainingAsString();\n        HttpParser.unquote(input);\n    }\n}\n"
  },
  {
    "path": "projects/tomcat/WsPingPongFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.api.FuzzerSecurityIssueLow;\n\nimport org.apache.tomcat.websocket.*;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.StandardCharsets;\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.TimeUnit;\nimport java.util.Arrays;\n\nimport jakarta.websocket.ClientEndpointConfig;\nimport jakarta.websocket.ContainerProvider;\nimport jakarta.websocket.PongMessage;\nimport jakarta.websocket.Session;\nimport jakarta.websocket.WebSocketContainer;\nimport jakarta.websocket.DeploymentException;\n\nimport org.apache.catalina.Context;\nimport org.apache.catalina.servlets.DefaultServlet;\nimport org.apache.catalina.startup.Tomcat;\nimport org.apache.catalina.connector.Connector;\nimport org.apache.catalina.LifecycleException;\nimport org.apache.tomcat.websocket.TesterMessageCountClient.TesterEndpoint;\nimport org.apache.tomcat.websocket.TesterMessageCountClient.TesterProgrammaticEndpoint;\n\n\npublic class WsPingPongFuzzer {\n    static Tomcat tomcat = null;\n    static Connector connector1 = null;\n    static Context ctx = null;\n    static WebSocketContainer wsContainer = null;\n    static Session wsSession = null;\n\n    public static void fuzzerTearDown() {\n        try {\n            tomcat.stop();\n            tomcat.destroy();\n            tomcat = null;\n            System.gc();\n        } catch (LifecycleException e) {\n            throw new FuzzerSecurityIssueLow(\"Teardown Error!\");\n        }\n    }\n\n    public static void fuzzerInitialize() {\n        tomcat = new Tomcat();\n        tomcat.setBaseDir(\"temp\");\n        ctx = tomcat.addContext(\"\", null);\n        ctx.addApplicationListener(TesterEchoServer.Config.class.getName());\n        Tomcat.addServlet(ctx, \"default\", new DefaultServlet());\n        ctx.addServletMappingDecoded(\"/\", \"default\");\n\n        connector1 = tomcat.getConnector();\n        connector1.setPort(0);\n\n        try {\n            tomcat.start();\n        } catch (LifecycleException e) {\n            throw new FuzzerSecurityIssueLow(\"Tomcat Start error!\");\n        }\n\n        wsContainer = ContainerProvider.getWebSocketContainer();\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        byte [] ba = data.consumeBytes(125);\n\n        ByteBuffer applicationData = ByteBuffer.wrap(ba);\n\n        ClientEndpointConfig clientEndpointConfig = ClientEndpointConfig.Builder.create().build();\n\n        try {\n            wsSession = wsContainer.connectToServer(TesterProgrammaticEndpoint.class, clientEndpointConfig, \n                new URI(\"ws://localhost:\" + tomcat.getConnector().getLocalPort() + TesterEchoServer.Config.PATH_ASYNC));\n        } catch (URISyntaxException | DeploymentException | IOException e) {\n            return;\n        }\n        \n        CountDownLatch latch = new CountDownLatch(1);\n        TesterEndpoint tep = (TesterEndpoint) wsSession.getUserProperties().get(\"endpoint\");\n        tep.setLatch(latch);\n\n        PongMessageHandler handler = new PongMessageHandler(latch);\n        wsSession.addMessageHandler(handler);\n        try {\n            for (int i = 0; i < 20; ++i) {\n                wsSession.getBasicRemote().sendPing(applicationData);\n            }\n        } catch (IOException e) {\n        }\n\n        try {\n            boolean latchResult = handler.getLatch().await(10, TimeUnit.SECONDS);\n            assert latchResult == true : new FuzzerSecurityIssueLow(\"latchResult is not true!\");\n        } catch (InterruptedException e) {\n        }\n\n        assert Arrays.equals(applicationData.array(), (handler.getMessages().peek()).getApplicationData().array()) : new FuzzerSecurityIssueLow(\"Not equal!\");\n\n        try {\n            wsSession.close();\n        } catch (IOException e) {\n        }\n    }\n\n    public static class PongMessageHandler extends TesterMessageCountClient.BasicHandler<PongMessage> {\n        public PongMessageHandler(CountDownLatch latch) {\n            super(latch);\n        }\n\n        @Override\n        public void onMessage(PongMessage message) {\n            getMessages().add(message);\n            if (getLatch() != null) {\n                getLatch().countDown();\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "projects/tomcat/build.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-21\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-21-openjdk-amd64/\" \"$JAVA_HOME\"\n\n$ANT\n$ANT test-compile\n$ANT download-compile\n\ncd $SRC/tomcat/output/classes && jar cfv classes.jar . && mv ./classes.jar $OUT\ncd $SRC/tomcat/output/testclasses && jar cfv testclasses.jar . && mv ./testclasses.jar $OUT\ncd $OUT\nmkdir tmp\n(cd tmp; unzip -uo ../classes.jar)\n(cd tmp; unzip -uo ../testclasses.jar)\njar -cvf tomcat.jar -C tmp .\nrm -rf tmp\nrm classes.jar\nrm testclasses.jar\ncd $SRC/tomcat\n\ncp /root/tomcat-build-libs/unboundid*/unboundid*.jar $OUT/unboundid-ldapsdk.jar\n\nALL_JARS=\"tomcat.jar unboundid-ldapsdk.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer --release 21\n  cp $SRC/[$fuzzer_basename]*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-21/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-21/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n-rss_limit_mb=0 \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.ExpressionLanguageInjection\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/tomcat/project.yaml",
    "content": "homepage: \"https://github.com/apache/tomcat\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/tomcat\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nprimary_contact: \"fuzz-testing@tomcat.apache.org\"\nauto_ccs:\n  - \"security@tomcat.apache.org\"\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/toml/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python:ubuntu-24-04\nRUN pip3 install dictgen numpy\nRUN git clone --depth 1 https://github.com/uiri/toml toml\nCOPY build.sh fuzz_*.py $SRC/\nWORKDIR $SRC/toml\n"
  },
  {
    "path": "projects/toml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/toml/fuzz_dump.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nimport io\nimport sys\nimport atheris\n\n# Libraries used as part of the test\nimport dictgen\nfrom numpy import array, float64, int32\nimport pathlib\nfrom random import randint\n\nimport toml\nfrom toml import ordered as toml_ordered\n\ndef random_path(**kwargs):\n    return pathlib.Path(f\"/{dictgen.random_string()}\")\n\ndef random_inlinetabledict(**kwargs):\n    class TestDict(dict, toml.decoder.InlineTableDict):\n        pass\n    \n    val_generators = kwargs[\"val_generators\"]\n    key_generators = kwargs[\"key_generators\"]\n    nested_generators = kwargs[\"nested_generators\"]\n    max_height = kwargs[\"max_height\"]\n    max_depth = kwargs[\"max_depth\"]\n\n    all_generators = val_generators + nested_generators\n\n    target = TestDict()\n    for i in range(randint(0, max_height)):\n        # If we are at a top level depth don't allow any nested generators\n        if max_depth > 2:\n            target[key_generators[randint(0, len(key_generators) - 1)](**kwargs)] = all_generators[randint(0, len(all_generators) - 1)](**kwargs)\n        else:\n            target[key_generators[randint(0, len(key_generators) - 1)](**kwargs)] = val_generators[randint(0, len(val_generators) - 1)](**kwargs)\n    return target\n\ndef random_numpy(**kwargs):\n    df = {\n        dictgen.random_string() : array([1, .3], dtype=float64),\n        dictgen.random_string(): array([1, 3], dtype=int32)\n    }\n    return df\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    # Pick from a random set of encoders\n    ENCODERS = [\n        toml.TomlEncoder(preserve=fdp.ConsumeBool()),  # Optional formatting argument\n        toml.TomlPreserveInlineDictEncoder(),\n        toml.TomlArraySeparatorEncoder(),\n        toml.TomlPreserveCommentEncoder(),\n        toml.TomlPathlibEncoder(),\n        toml_ordered.TomlOrderedEncoder(),\n        toml.TomlNumpyEncoder(),\n        None,\n    ]\n\n    # Generate a random dictionary object\n    fuzz_dict = dictgen.generate(\n        key_generators=(\n            dictgen.random_string,\n        ),\n        val_generators=(\n            dictgen.random_int,\n            dictgen.random_float,\n            dictgen.random_string,\n            dictgen.random_datetime,\n            random_path,\n            random_numpy\n        ),\n        nested_generators=(\n            dictgen.random_dict,\n            dictgen.random_array,\n            random_inlinetabledict\n        ),\n        rand_seed=fdp.ConsumeInt(32)\n    )\n\n    try:\n        with io.StringIO(\"\") as outfile:\n            result = toml.encoder.dump(fuzz_dict, outfile, fdp.PickValueInList(ENCODERS))\n    except TypeError:\n        pass\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/toml/fuzz_load.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nimport sys\nimport atheris\nimport io\n\nimport toml\nfrom toml import ordered as toml_ordered\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    # Pick from a random set of decoders\n    DECODERS = [\n        None,\n        toml_ordered.TomlOrderedDecoder(),\n        toml.TomlPreserveCommentDecoder()\n    ]\n\n    try:\n        f = io.StringIO(fdp.ConsumeString(sys.maxsize))\n        result = toml.decoder.load(f, decoder=fdp.PickValueInList(DECODERS))\n    except (toml.TomlDecodeError, IndexError) as e:\n        if isinstance(e, IndexError):\n            if \"IndexError: list index out of range\" in str(e) or \"IndexError: string index out of range\" in str(e):\n                pass\n            else:\n                raise e\n        pass\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/toml/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/uiri/toml/\nlanguage: python\nmain_repo: https://github.com/uiri/toml/\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/toml_edit/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/ordian/toml_edit toml_edit\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/toml_edit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/toml_edit\ncargo fuzz build --fuzz-dir=./crates/toml_edit_fuzz -O\ncp target/x86_64-unknown-linux-gnu/release/parse_document $OUT/\n"
  },
  {
    "path": "projects/toml_edit/project.yaml",
    "content": "homepage: \"https://github.com/ordian/toml_edit\"\nlanguage: rust\nmain_repo: \"https://github.com/ordian/toml_edit\"\nprimary_contact: \"eopage@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/tomli/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# Held back because of github.com/google/oss-fuzz/pull/13407\n# Please fix the build failure + upgrade.\n\nFROM gcr.io/oss-fuzz-base/base-builder-python@sha256:d223a882810372830fd7968eb3e64533f3a2318c90be43ac753a46a15946faec\nRUN git clone --depth=1 https://github.com/hukkinj1/tomli tomli\nRUN git clone --depth=1 https://github.com/hukkin/tomli-w tomli-w\nCOPY *.sh $SRC/\nWORKDIR $SRC/tomli\n"
  },
  {
    "path": "projects/tomli/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\ncd $SRC/tomli-w\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/tomli/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/hukkinj1/tomli\nlanguage: python\nmain_repo: https://github.com/hukkinj1/tomli\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/tomlkit/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/sdispater/tomlkit tomlkit\nRUN pip3 install dictgen\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/tomlkit\n"
  },
  {
    "path": "projects/tomlkit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/tomlkit/fuzz_dumps.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport atheris\nimport sys\nimport tomlkit\nimport dictgen\n\n\ndef test_one_input(input_bytes: bytes) -> None:\n    fdp = atheris.FuzzedDataProvider(input_bytes)\n    test_data = dictgen.generate(\n        max_height=5,\n        max_depth=10,\n        key_generators=(\n            dictgen.random_string,\n        ),\n        val_generators=(\n            dictgen.random_string,\n            dictgen.random_bool,\n            dictgen.random_int,\n            dictgen.random_datetime,\n            dictgen.random_float\n        ),\n        rand_seed=fdp.ConsumeInt(32)\n    )\n    tomlkit.api.dumps(test_data, sort_keys=fdp.ConsumeBool())\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, test_one_input)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/tomlkit/fuzz_parser.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport tomlkit\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  parser = tomlkit.parser.Parser(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  try:\n    parser.parse()\n  except (\n    tomlkit.exceptions.TOMLKitError,\n    RecursionError\n  ):\n    # Recursion errors are not interesting\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/tomlkit/project.yaml",
    "content": "homepage: https://github.com/sdispater/tomlkit\nmain_repo: https://github.com/sdispater/tomlkit\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/tomlplusplus/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake make\n\nRUN git clone --depth 1 https://github.com/marzer/tomlplusplus.git tomlplusplus \\\n        && cp tomlplusplus/fuzzing/build.sh $SRC/\nWORKDIR tomlplusplus\n\n"
  },
  {
    "path": "projects/tomlplusplus/project.yaml",
    "content": "homepage: \"https://marzer.github.io/tomlplusplus/\"\nlanguage: c++\nprimary_contact: \"mark.gillard@outlook.com.au\"\nauto_ccs:\n  - \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/marzer/tomlplusplus.git\"\n\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/toolbelt/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip && pip3 install mock requests\nRUN git clone https://github.com/requests/toolbelt toolbelt\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/toolbelt\n"
  },
  {
    "path": "projects/toolbelt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/toolbelt/fuzz_multipart.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport io\nimport mock\nimport requests\nfrom requests_toolbelt.multipart import decoder\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  response = mock.NonCallableMagicMock(spec=requests.Response)\n  response.headers = {\n    'content-type': 'multipart/related; boundary=\"samp1\"'\n  }\n  response.content = io.BytesIO(data).getvalue()\n  try:\n    decoder.MultipartDecoder.from_response(response)\n  except decoder.ImproperBodyPartContentException:\n    pass\n  except decoder.NonMultipartContentTypeException:\n    pass\n  except UnicodeDecodeError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/toolbelt/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/requests/toolbelt\nlanguage: python\nmain_repo: https://github.com/requests/toolbelt\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/toolz/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/pytoolz/toolz toolz\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/toolz\n"
  },
  {
    "path": "projects/toolz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/toolz/fuzz_itertoolz.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport toolz\nfrom toolz import dicttoolz, functoolz, itertoolz\nfrom operator import add\n\n\ndef fuzz_curry(x, y):\n  return x + y\n\n\ndef ConsumeDictionary(fdp, dict_size):\n  dictionary = {}\n  for _ in range(dict_size):\n    dictionary[fdp.ConsumeUnicodeNoSurrogates(20)] = fdp.ConsumeIntInRange(1, 100)\n  return dictionary\n\n\ndef ConsumeDictionaryReversed(fdp, dict_size):\n  dictionary = {}\n  for _ in range(dict_size):\n    dictionary[fdp.ConsumeIntInRange(1, 100)] = fdp.ConsumeUnicodeNoSurrogates(20)\n  return dictionary\n\n\ndef ConsumeDictionaryWithList(fdp, dict_size):\n  dictionary = {}\n  for _ in range(dict_size):\n    dictionary[fdp.ConsumeUnicodeNoSurrogates(20)] = fdp.ConsumeIntListInRange(4, 1, 100)\n  return dictionary\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  val_1 = fdp.ConsumeUnicodeNoSurrogates(24)\n\n  fuzz_int_list_1 = fdp.ConsumeIntList(fdp.ConsumeIntInRange(1, 100), 4)\n  fuzz_int_list_2 = fdp.ConsumeIntList(fdp.ConsumeIntInRange(1, 100), 4)\n  fuzz_int_list_3 = fdp.ConsumeIntList(fdp.ConsumeIntInRange(1, 100), 4)\n\n  fuzz_int_list_4 = []\n  fuzz_int_list_5 = []\n  for i in range(fdp.ConsumeIntInRange(10, 50)):\n    fuzz_int_list_4.append((i, fdp.ConsumeUnicodeNoSurrogates(12)))\n    fuzz_int_list_5.append((i, fdp.ConsumeUnicodeNoSurrogates(12)))\n\n  str_list3 = []\n  str_list4 = []\n  for i in range(fdp.ConsumeIntInRange(10, 50)):\n    str_list3.append((fdp.ConsumeUnicodeNoSurrogates(12),\n                      fdp.ConsumeUnicodeNoSurrogates(12)))\n    str_list4.append((fdp.ConsumeUnicodeNoSurrogates(12),\n                      fdp.ConsumeUnicodeNoSurrogates(12)))\n\n  list(\n      toolz.merge_sorted(fuzz_int_list_1, fuzz_int_list_2,\n                         fuzz_int_list_3))\n  list(\n      toolz.merge_sorted(fuzz_int_list_1,\n                         fuzz_int_list_2,\n                         fuzz_int_list_3,\n                         key=lambda x: x + 2))\n  list(\n      toolz.join(toolz.first, fuzz_int_list_4,\n                 toolz.second, fuzz_int_list_5))\n\n  list(\n      toolz.join(toolz.second, str_list3,\n                 toolz.first, str_list4))\n  list(\n      toolz.join(toolz.second,\n                 str_list3,\n                 toolz.first,\n                 str_list4,\n                 left_default=None,\n                 right_default=None))\n  list(\n      toolz.join(lambda x: x,\n                 str_list3,\n                 lambda x: x,\n                 str_list4,\n                 left_default=None))\n  list(\n      toolz.join(lambda x: x,\n                 str_list3,\n                 lambda x: x,\n                 str_list4,\n                 right_default=None))\n  list(toolz.join(lambda x: x, str_list3, lambda x: x, str_list4))\n  list(toolz.diff(fuzz_int_list_2, fuzz_int_list_3))\n  list(toolz.partition_all(3, fuzz_int_list_3))\n\n  try:\n    toolz.get(fdp.ConsumeIntInRange(1, 1000000), fuzz_int_list_3)\n    toolz.get([1, 2], fuzz_int_list_3)\n  except (KeyError, IndexError, TypeError):\n    pass\n\n  toolz.isdistinct(fuzz_int_list_3)\n  toolz.isdistinct(fdp.ConsumeUnicodeNoSurrogates(256))\n  toolz.isiterable(fuzz_int_list_3)\n  toolz.peekn(fdp.ConsumeIntInRange(1, 10), fuzz_int_list_3)\n  toolz.peek(fuzz_int_list_3)\n  list(toolz.tail(fdp.ConsumeIntInRange(1, 1000), fuzz_int_list_2))\n  tuple(toolz.unique(fuzz_int_list_3))\n  tuple(toolz.unique(fuzz_int_list_3, key=lambda x: x + 3))\n  list(\n      toolz.interleave(\n          [fuzz_int_list_1, fuzz_int_list_2, fuzz_int_list_3]))\n  list(toolz.accumulate(add, fuzz_int_list_3))\n\n  toolz.reduceby(lambda x: x + 8 == 2, add, fuzz_int_list_2)\n\n  # fuzz functoolz\n  fuzz_curry_int = toolz.curry(fuzz_curry)\n  first_number = fuzz_curry_int(fdp.ConsumeIntInRange(0, 1000))\n  first_number(fdp.ConsumeIntInRange(0, 1000))\n\n  toolz.flip(fuzz_curry, fdp.ConsumeIntInRange(0, 1000),\n                      fdp.ConsumeIntInRange(0, 1000))\n\n  # functions to use\n  double = lambda i: 2 * i\n  inc = lambda i: i + 1\n\n  toolz.pipe(fdp.ConsumeIntInRange(1, 100), double, str)\n  toolz.compose(inc, double)(fdp.ConsumeIntInRange(1, 100))\n  toolz.compose_left(inc, double)(fdp.ConsumeIntInRange(1, 100))\n\n  # fuzz dicttoolz\n  toolz.dissoc(ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)),\n                                 fdp.ConsumeUnicodeNoSurrogates(\n                                 fdp.ConsumeIntInRange(0, 1000)))\n  toolz.assoc(ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)),\n                                fdp.ConsumeUnicodeNoSurrogates(\n                                fdp.ConsumeIntInRange(0, 1000)),\n                                fdp.ConsumeIntInRange(0, 1000))\n  toolz.merge(ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)),\n              ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)))\n  toolz.merge_with(sum, ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)),\n                        ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)))\n  toolz.valmap(sum,\n               ConsumeDictionaryWithList(fdp, fdp.ConsumeIntInRange(1, 100)))\n  toolz.keymap(str.lower,\n               ConsumeDictionaryWithList(fdp, fdp.ConsumeIntInRange(1, 100)))\n  toolz.itemmap(reversed,\n                ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)))\n  toolz.valfilter(lambda x: x + 8 == 2,\n                  ConsumeDictionary(fdp, fdp.ConsumeIntInRange(1, 100)))\n  toolz.keyfilter(lambda x: x + 8 == 2,\n                  ConsumeDictionaryReversed(fdp, fdp.ConsumeIntInRange(1, 100)))\n\n  # fuzz sandbox\n  toolz.sandbox.core.unzip(ConsumeDictionary(fdp,\n                                             fdp.ConsumeIntInRange(1, 100)))\n  toolz.sandbox.core.EqualityHashKey(fdp.ConsumeUnicodeNoSurrogates(\n                                     fdp.ConsumeIntInRange(0, 1000)),\n                                     fdp.ConsumeUnicodeNoSurrogates(\n                                     fdp.ConsumeIntInRange(0, 1000)))\n  fold_list = fdp.ConsumeIntList(fdp.ConsumeIntInRange(1, 100), 4)\n  toolz.sandbox.parallel.fold(add,\n                              fold_list,\n                              chunksize=fdp.ConsumeIntInRange(2, 100),\n                              map=map)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/toolz/project.yaml",
    "content": "homepage: https://github.com/pytoolz/toolz\nmain_repo: https://github.com/pytoolz/toolz\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/tor/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##############################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake make libtool pkg-config\nRUN git clone --depth 1 https://git.torproject.org/tor.git\nRUN git clone --depth 1 https://git.torproject.org/fuzzing-corpora.git tor-fuzz-corpora\nRUN git clone --depth 1 https://github.com/madler/zlib.git\nRUN git clone --depth 1 https://github.com/openssl/openssl.git\nRUN git clone --depth 1 https://github.com/libevent/libevent.git\nWORKDIR tor\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tor/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##############################################################################\n\n# Create a directory for instrumented dependencies.\nTOR_DEPS=${SRC}/deps\nmkdir -p $TOR_DEPS\n\n# Build libevent with proper instrumentation.\ncd ${SRC}/libevent\nmkdir build && cd build\ncmake -DEVENT__DISABLE_MBEDTLS=ON \\\n      -DEVENT__DISABLE_OPENSSL=ON \\\n      -DEVENT__LIBRARY_TYPE=STATIC \\\n      -DEVENT__DISABLE_TESTS=ON \\\n      -DEVENT__DISABLE_SAMPLES=ON \\\n      ../\nmake && make install\n\n# Build OpenSSL with proper instrumentation.\ncd ${SRC}/openssl\nOPENSSL_CONFIGURE_FLAGS=\"\"\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n  OPENSSL_CONFIGURE_FLAGS=\"no-asm\"\nfi\n\n./config no-shared --prefix=${TOR_DEPS} \\\n    enable-tls1_3 enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 \\\n    enable-weak-ssl-ciphers $CFLAGS \\\n    -fno-sanitize=alignment $OPENSSL_CONFIGURE_FLAGS\n\nmake -j$(nproc) LDCMD=\"$CXX $CXXFLAGS\"\nmake install\n\n# Build zlib with proper instrumentation,\ncd ${SRC}/zlib\n./configure --prefix=${TOR_DEPS}\nmake -j$(nproc) clean\nmake -j$(nproc) all\nmake install\n\n# Build tor and the fuzz targets.\ncd ${SRC}/tor\n\nsh autogen.sh\n\n# We need to run configure with leak-checking disabled, or many of the\n# test functions will fail.\nexport ASAN_OPTIONS=detect_leaks=0\n\n./configure --disable-asciidoc --enable-oss-fuzz --disable-memory-sentinels \\\n    --with-libevent-dir=${SRC}/deps \\\n    --with-openssl-dir=${SRC}/deps \\\n    --with-zlib-dir=${SRC}/deps \\\n    --disable-gcc-hardening \\\n    LDFLAGS=\"-L${TOR_DEPS}/lib64\"\n\nmake clean\nmake micro-revision.i  # Workaround from https://gitlab.torproject.org/tpo/core/tor/-/issues/29520#note_2749427\nmake -j$(nproc) oss-fuzz-fuzzers\n\nTORLIBS=\"`make show-testing-libs`\"\nTORLIBS=\"$TORLIBS -lm -Wl,-Bstatic -lssl -lcrypto -levent -lz -L${TOR_DEPS}/lib -L${TOR_DEPS}/lib64\"\nTORLIBS=\"$TORLIBS -Wl,-Bdynamic\"\n\nfor fuzzer in src/test/fuzz/*.a; do\n    output=\"${fuzzer%.a}\"\n    output=\"${output##*lib}\"\n    ${CXX} ${CXXFLAGS} -std=c++11 $LIB_FUZZING_ENGINE ${fuzzer} ${TORLIBS} -o ${OUT}/${output}\n\n    corpus_dir=\"${SRC}/tor-fuzz-corpora/${output#oss-fuzz-}\"\n    if [ -d \"${corpus_dir}\" ]; then\n      set +x\n      zip -q -j ${OUT}/${output}_seed_corpus.zip ${corpus_dir}/*\n      set -x\n    fi\ndone\n"
  },
  {
    "path": "projects/tor/project.yaml",
    "content": "homepage: \"https://www.torproject.org\"\nlanguage: c++\nprimary_contact: \"nima@torproject.org\"\nauto_ccs:\n  - \"nick.a.mathewson@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\nsanitizers:\n - address\n - memory\n - undefined\nmain_repo: 'https://git.torproject.org/tor.git'\n"
  },
  {
    "path": "projects/tpm2/Dockerfile",
    "content": "# Copyright 2017 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n#\n# Defines a docker image that can build fuzzers.\n#\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libssl-dev binutils libgcc-9-dev\nRUN git clone --depth 1 https://chromium.googlesource.com/chromiumos/third_party/tpm2\nWORKDIR tpm2\nRUN cp /src/tpm2/fuzz/build.sh /src/\n"
  },
  {
    "path": "projects/tpm2/project.yaml",
    "content": "homepage: \"https://chromium.googlesource.com/chromiumos/third_party/tpm2\"\nlanguage: c++\n# todo: delete Dockerfile from tpm2 repo.\n# Docker files change too much, it was moved to oss-fuzz repository.\n#\n#dockerfile:\n#  git: \"https://chromium.googlesource.com/chromiumos/third_party/tpm2/\"\n#  path: \"fuzz/Dockerfile\"\nprimary_contact: \"ngm@google.com\"\nauto_ccs:\n  - \"tpm-security-bugs@google.com\"\n  - \"dkrahn@google.com\"\n  - \"vbendeb@google.com\"\n  - \"apronin@google.com\"\n  - \"cfir@google.com\"\n  - \"mruthven@google.com\"\nmain_repo: 'https://chromium.googlesource.com/chromiumos/third_party/tpm2'\n"
  },
  {
    "path": "projects/tpm2-tss/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y \\\n    autoconf-archive \\\n    curl \\\n    libcmocka0 \\\n    libcmocka-dev \\\n    net-tools \\\n    build-essential \\\n    git \\\n    pkg-config \\\n    gcc \\\n    g++ \\\n    m4 \\\n    libtool \\\n    automake \\\n    libgcrypt20-dev \\\n    libssl-dev \\\n    autoconf \\\n    gnulib \\\n    wget \\\n    doxygen \\\n    libdbus-1-dev \\\n    libglib2.0-dev \\\n    clang-6.0 \\\n    clang-tools-6.0 \\\n    pandoc \\\n    lcov \\\n    libcurl4-openssl-dev \\\n    dbus-x11 \\\n    python-yaml \\\n    python3-yaml \\\n    vim-common \\\n    acl\n\nRUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100\nRUN update-alternatives --install /usr/bin/scan-build scan-build /usr/bin/scan-build-6.0 100\n\nARG autoconf_archive=autoconf-archive-2018.03.13\nWORKDIR /tmp \nRUN wget --quiet --show-progress --progress=dot:giga \"http://mirror.kumi.systems/gnu/autoconf-archive/$autoconf_archive.tar.xz\" \\\n\t\t&& tar -xf $autoconf_archive.tar.xz \\\n        && rm $autoconf_archive.tar.xz \\\n        && cd $autoconf_archive \\\n        && ./configure --prefix=/usr \\\n        && make -j $(nproc) && make install\nRUN rm -fr $autoconf_archive.tar.xz\n\nARG ibmtpm_name=ibmtpm1661\nWORKDIR /tmp\nRUN wget --quiet --show-progress --progress=dot:giga \"https://downloads.sourceforge.net/project/ibmswtpm2/$ibmtpm_name.tar.gz\" \\\n\t&& sha256sum $ibmtpm_name.tar.gz | grep ^55145928ad2b24f34be6a0eacf9fb492e10e0ea919b8428c721fa970e85d6147 \\\n\t&& mkdir -p $ibmtpm_name \\\n\t&& tar xvf $ibmtpm_name.tar.gz -C $ibmtpm_name \\\n\t&& rm $ibmtpm_name.tar.gz\nWORKDIR $ibmtpm_name/src\nRUN CFLAGS=\"-I/usr/local/openssl/include\" make -j$(nproc) \\\n&& cp tpm_server /usr/local/bin\nRUN rm -fr $ibmtpm_name/src $ibmtpm_name.tar.gz\n\nARG uthash=\"2.1.0\"\nWORKDIR /tmp\nRUN wget --quiet --show-progress --progress=dot:giga \"https://github.com/troydhanson/uthash/archive/v${uthash}.tar.gz\" \\\n\t&& tar -xf v${uthash}.tar.gz \\\n        && cp uthash-${uthash}/src/*.h /usr/include/\nRUN rm -rf uthash-${uthash}/ v${uthash}.tar.gz\n\nRUN git clone --depth 1 \\\n  https://github.com/tpm2-software/tpm2-tss $SRC/tpm2-tss/\nWORKDIR $SRC/tpm2-tss/\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/tpm2-tss/build.sh",
    "content": "#!/bin/sh\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/tpm2-tss/\n\nexport LD_LIBRARY_PATH=/usr/local/bin\n\nexport GEN_FUZZ=1\n\n./bootstrap\n./configure \\\n  CC=$CC \\\n  CXX=$CXX \\\n  --enable-debug \\\n  --with-fuzzing=ossfuzz \\\n  --enable-tcti-fuzzing \\\n  --disable-tcti-device \\\n  --disable-tcti-mssim \\\n  --disable-tcti-swtpm \\\n  --disable-tcti-spi-ftdi \\\n  --disable-tcti-spi-lt2go \\\n  --disable-doxygen-doc \\\n  --disable-shared \\\n  --disable-fapi \\\n  --disable-policy\n\nsed -i 's/@DX_RULES@/# @DX_RULES@/g' Makefile\nmake -j $(nproc) fuzz-targets\n\nfor filename in $(ls test/fuzz/*.fuzz); do\n  cp -v $filename $OUT/$(echo $(basename $filename .fuzz))\ndone\n"
  },
  {
    "path": "projects/tpm2-tss/project.yaml",
    "content": "homepage: \"https://github.com/tpm2-software/tpm2-tss\"\nlanguage: c++\nprimary_contact: \"william.c.roberts@intel.com\"\nauto_ccs:\n  - \"andreas.fuchs@sit.fraunhofer.de\"\n  - \"tstruk@gmail.com\"\nfuzzing_engines:\n  - \"afl\"\n  - \"honggfuzz\"\n  - \"libfuzzer\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: 'https://github.com/tstruk/tpm2-tss.git'\n"
  },
  {
    "path": "projects/tpm2-tss/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/tqdm/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/tqdm/tqdm tqdm\nWORKDIR tqdm\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/tqdm/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/tqdm/fuzz_tqdm.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Targets tqdm using fuzzer-derived options and data\"\"\"\nimport sys\nimport atheris\n\nfrom tqdm import tqdm\n\ndef gen_random_list(fdp):\n    elem_list = list()\n    elem_count = fdp.ConsumeIntInRange(1, 10000)\n    for i in range(elem_count):\n        op = fdp.ConsumeIntInRange(1,1)\n        if op == 1:\n            elem_list.append(fdp.ConsumeIntInRange(10, 1000))\n        if op == 2:\n            elem_list.append(fdp.ConsumeUnicode(10))\n        if op == 3:\n            elem_list.append(fdp.ConsumeUnicodeNoSurrogates(10))\n    return elem_list\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    fuzz_leave = fdp.ConsumeBool()\n    fuzz_mininterval = fdp.ConsumeIntInRange(0, 20)\n    fuzz_ncols = fdp.ConsumeIntInRange(0, 5)\n    fuzz_unit_scale = fdp.ConsumeBool()\n    fuzz_disable = fdp.ConsumeBool()\n\n    elem_list = gen_random_list(fdp)\n    dev_null = open(\"/dev/null\", \"w\")\n    for i in tqdm(elem_list,\n                  file=dev_null,\n                  leave=fuzz_leave,\n                  mininterval=fuzz_mininterval,\n                  ncols = fuzz_ncols,\n                  unit_scale = fuzz_unit_scale,\n                  disable = fuzz_disable\n    ):\n        pass\n    dev_null.close()\n    return \n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/tqdm/project.yaml",
    "content": "homepage: \"https://github.com/tqdm/tqdm\"\nlanguage: python\nmain_repo: \"https://github.com/tqdm/tqdm\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/trafficserver/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y libpcre3-dev zlib1g-dev cmake libssl-dev libpcre2-dev pkg-config libc-ares-dev\nRUN git clone --depth 1 https://github.com/apache/trafficserver.git\nRUN cp $SRC/trafficserver/tests/fuzzing/oss-fuzz.sh $SRC/build.sh\nWORKDIR $SRC/trafficserver/\n"
  },
  {
    "path": "projects/trafficserver/project.yaml",
    "content": "homepage: \"https://trafficserver.apache.org\"\nlanguage: c++\nprimary_contact: \"security@apache.org\"\nvendor_ccs:\n  - \"security@trafficserver.apache.org\"\nauto_ccs:\n  - \"ajsinghyadav00@gmail.com\"\n  - \"kichan@apache.org\"\n  - \"bcall@apache.org\"\n  - \"lhedstrom@gmail.com\"\n  - \"brian.neradt@gmail.com\"\n  - \"masaori@apache.org\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/apache/trafficserver'\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/tremor/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake ffmpeg libogg-dev libtool pkg-config wget\nRUN python3 -m pip install --upgrade pip && python3 -m pip install corpus-replicator\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/ogg.git\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/tremor.git\nRUN corpus-replicator -o decode_corpus audio_vorbis_ogg_libvorbis.yml audio\nWORKDIR tremor\nCOPY decode_fuzzer.cc $SRC/tremor/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tremor/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the ogg library\npushd $SRC/ogg\n./autogen.sh\n./configure --prefix=\"$WORK\" --enable-static --disable-shared --disable-crc\nmake clean\nmake -j$(nproc)\nmake install\npopd\n\n# Build the tremor library\npushd $SRC/tremor\n./autogen.sh --prefix=\"$WORK\" --enable-static --disable-shared\n./configure --prefix=\"$WORK\" --enable-static --disable-shared\nmake -j$(nproc)\nmake install\npopd\n\n# Build the fuzz target\n$CXX $CXXFLAGS -I\"$WORK/include\" -L\"$WORK/lib\" \\\n    /src/tremor/decode_fuzzer.cc -o $OUT/decode_fuzzer \\\n    $LIB_FUZZING_ENGINE -lvorbisidec -logg\n"
  },
  {
    "path": "projects/tremor/decode_fuzzer.cc",
    "content": "/* Copyright (C) 2019 Mozilla Foundation.\n   File: decode_fuzzer.cc\n \n   Redistribution and use in source and binary forms, with or without\n   modification, are permitted provided that the following conditions\n   are met:\n \n   - Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n \n   - Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n \n   - Neither the name of the Xiph.org Foundation nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n \n   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR\n   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/* This based on decode_fuzzer.cc used with Vorbis.\n   https://git.xiph.org/?p=vorbis.git;a=blob;f=contrib/oss-fuzz/decode_fuzzer.cc;hb=HEAD\n*/\n\n#include <stdio.h>\n#include <string.h>\n#include <cstdint>\n#include \"ivorbisfile.h\"\n\n#define INPUT_LIMIT 16384\n\nstruct vorbis_data {\n  const uint8_t *current;\n  const uint8_t *data;\n  size_t size;\n};\n\nsize_t read_func(void *ptr, size_t size1, size_t size2, void *datasource) {\n  vorbis_data* vd = (vorbis_data *)(datasource);\n  size_t len = size1 * size2;\n  if (vd->current + len > vd->data + vd->size) {\n      len = vd->data + vd->size - vd->current;\n  }\n  memcpy(ptr, vd->current, len);\n  vd->current += len;\n  return len;\n}\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n  ov_callbacks memory_callbacks = {0};\n  memory_callbacks.read_func = read_func;\n  vorbis_data data_st;\n  data_st.size = Size > INPUT_LIMIT ? INPUT_LIMIT : Size;\n  data_st.current = Data;\n  data_st.data = Data;\n  OggVorbis_File vf;\n  int result = ov_open_callbacks(&data_st, &vf, NULL, 0, memory_callbacks);\n  if (result < 0) {\n    return 0;\n  }\n  int current_section = 0;\n  char pcm[4096];\n  long read_result;\n  while (true) {\n    read_result = ov_read(&vf, pcm, sizeof(pcm), &current_section);\n    if (read_result <= 0 && read_result != OV_HOLE) {\n      break;\n    }\n  }\n  ov_clear(&vf);\n  return 0;\n}\n"
  },
  {
    "path": "projects/tremor/project.yaml",
    "content": "homepage: \"https://xiph.org/vorbis/\"\nlanguage: c++\nprimary_contact: \"daede003@umn.edu\"\nauto_ccs:\n  - \"le.businessman@gmail.com\"\n  - \"paul.l.kehrer@gmail.com\"\nvendor_ccs:\n  - \"twsmith@mozilla.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://gitlab.xiph.org/xiph/tremor.git'\n"
  },
  {
    "path": "projects/trust-dns/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/hickory-dns/hickory-dns hickory-dns\nWORKDIR hickory-dns\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/trust-dns/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/message $OUT/\n"
  },
  {
    "path": "projects/trust-dns/project.yaml",
    "content": "homepage: \"https://github.com/hickory-dns/hickory-dns\"\nlanguage: rust\nmain_repo: \"https://github.com/hickory-dns/hickory-dns\"\nprimary_contact: \"bluejekyll@gmail.com\"\nauto_ccs:\n  - djc.ochtman@gmail.com\n  - divergentdave@gmail.com\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n  - maxnair.dev@gmail.com\n"
  },
  {
    "path": "projects/tslib/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\n\nRUN  git clone --depth 1 https://github.com/microsoft/tslib\n\nCOPY build.sh $SRC/\nCOPY fuzz.js $SRC/tslib\n\nWORKDIR $SRC/tslib\n"
  },
  {
    "path": "projects/tslib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer tslib fuzz.js --sync\n"
  },
  {
    "path": "projects/tslib/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst tslib = require('./tslib.js');\n\nmodule.exports.fuzz = function(data) {\n  const provider = new FuzzedDataProvider(data);\n\n  try {\n    const functionList = [\n      '__assign',\n      '__rest',\n      '__spread',\n      '__decorate',\n      '__param',\n      '__awaiter',\n      '__generator',\n      '__exportStar',\n      '__values',\n      '__read',\n      '__spreadArrays',\n      '__spreadArray',\n      '__extends'\n    ];\n\n    const functionName = provider.pickValue(functionList);\n\n    let numProperties;\n    switch (functionName) {\n      case '__assign':\n\n        const target = {};\n        const numSources = provider.consumeIntegral(1, false);\n        const sources = [];\n        for (let i = 0; i < numSources; i++) {\n          const source = {};\n          numProperties = provider.consumeIntegral(1, false);\n          for (let j = 0; j < numProperties; j++) {\n            const key = provider.consumeString(10);\n            const value = provider.consumeBoolean() ? provider.consumeString(10) : provider.consumeNumber();\n            source[key] = value;\n          }\n          sources.push(source);\n        }\n\n\n        tslib.__assign(target, ...sources);\n        break;\n\n      case '__rest':\n\n        const obj = {};\n        numProperties = provider.consumeIntegral(1, false);\n        for (let i = 0; i < numProperties; i++) {\n          const key = provider.consumeString(10);\n          const value = provider.consumeBoolean() ? provider.consumeString(10) : provider.consumeNumber();\n          obj[key] = value;\n        }\n        const keys = Object.keys(obj);\n        const excludedKeys = keys.sort(() => Math.random() - 0.5).slice(0, provider.consumeIntegral(1, false));\n\n\n        tslib.__rest(obj, excludedKeys);\n        break;\n\n      case '__spread':\n\n        const arr = [];\n        const numArrays = provider.consumeIntegral(1, false);\n        for (let i = 0; i < numArrays; i++) {\n          const subArr = [];\n          const numElements = provider.consumeIntegral(1, false);\n          for (let j = 0; j < numElements; j++) {\n            const element = provider.consumeBoolean() ? provider.consumeString(10) : provider.consumeNumber();\n            subArr.push(element);\n          }\n          arr.push(subArr);\n        }\n\n\n        tslib.__spreadArray([], arr, true);\n        break;\n\n      case '__decorate':\n\n        const classConstructor = function() { };\n        const numDecorators = provider.consumeIntegral(1, false);\n        const decorators = [];\n        for (let i = 0; i < numDecorators; i++) {\n          const decorator = function() { };\n          decorators.push(decorator);\n        }\n\n\n        tslib.__decorate(decorators, classConstructor.prototype, 'methodName', Object.getOwnPropertyDescriptor(classConstructor.prototype, 'methodName'));\n        break;\n\n      case '__param':\n\n        const index = provider.consumeIntegral(1, false);\n        const decorator = function() { };\n\n\n        tslib.__param(index, decorator);\n        break;\n\n      case '__metadata':\n\n        const key = provider.consumeString(10);\n        const value = provider.consumeBoolean() ? provider.consumeString(10) : provider.consumeNumber();\n        const target1 = function() { };\n\n\n        tslib.__metadata(key, value)(target1, 'methodName', 0);\n        break;\n\n      case '__awaiter':\n\n        const thisArg = {};\n        const _arguments = [];\n        const resolve = function() { };\n        const reject = function() { };\n\n\n        tslib.__awaiter(thisArg, _arguments, resolve, reject);\n        break;\n\n      case '__generator':\n\n        const obj1 = {};\n        const body = function() { };\n        const methodName = provider.consumeString(10);\n\n\n        tslib.__generator(obj1, body, methodName);\n        break;\n\n      case '__exportStar':\n\n        const moduleObj = {};\n        const exportsObj = {};\n\n\n        tslib.__exportStar(moduleObj, exportsObj);\n        break;\n\n      case '__values':\n\n        const iterable = [];\n        const iteratorMethod = function() { };\n\n\n        tslib.__values(iterable, iteratorMethod);\n        break;\n\n      case '__read':\n\n        const iterator = {};\n        tslib.__read(iterator, true);\n\n        break;\n\n      case '__spreadArrays':\n\n        const arr1 = [];\n        const arr2 = [];\n        const arr3 = [];\n        const arr4 = [];\n        const arr5 = [];\n\n\n        tslib.__spreadArray([], arr1).concat(tslib.__spreadArray([], arr2), tslib.__spreadArray([], arr3), tslib.__spreadArray([], arr4), tslib.__spreadArray([], arr5));\n        break;\n\n      case '__spreadArray':\n\n        const to = [];\n        const from = [];\n        const condition = function() { };\n\n\n        tslib.__spreadArray(to, from, condition);\n        break;\n\n      case '__extends':\n\n        const derivedCtor = provider.consumeString(10);\n        const baseCtor = provider.consumeString(10);\n\n\n        const proto = {};\n        numProperties = provider.consumeIntegral(1, false);\n        for (let i = 0; i < numProperties; i++) {\n          const key = provider.consumeString(10);\n          const value = provider.consumeBoolean() ? provider.consumeString(10) : provider.consumeNumber();\n          proto[key] = value;\n        }\n\n\n        tslib.__extends(derivedCtor, baseCtor, proto);\n        break;\n\n      default:\n        break;\n    }\n\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [\n  \"Class extends value\"\n];\n"
  },
  {
    "path": "projects/tslib/project.yaml",
    "content": "homepage: https://github.com/microsoft/tslib\nlanguage: javascript\nmain_repo: https://github.com/microsoft/tslib\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/ttf-parser/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\n# Clone ttf-parser project\nRUN git clone https://github.com/RazrFalcon/ttf-parser ttf-parser\nWORKDIR $SRC/ttf-parser\n\nCOPY build.sh $SRC/\nCOPY fuzz $SRC/ttf-parser/fuzz\n"
  },
  {
    "path": "projects/ttf-parser/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build fuzzers\ncargo fuzz build -O\n\nfind $SRC/ttf-parser/fuzz/target/x86_64-unknown-linux-gnu/release -maxdepth 1 -name fuzz-* \\\n    -type f -perm -u=x -exec cp {} $OUT \\;\n\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/.gitignore",
    "content": "target\ncorpus\nartifacts\ncoverage\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/Cargo.toml",
    "content": "[package]\nname = \"ttf-parser-fuzz\"\nversion = \"0.0.0\"\npublish = false\nedition = \"2018\"\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies]\nlibfuzzer-sys = \"0.4\"\nserde = \"1.0\"\nserde_json = \"1.0\"\nttf-parser = { path = \"..\", features = [\"apple-layout\"] }\n\n[[bin]]\nname = \"fuzz-base\"\npath = \"fuzz_targets/fuzz-base.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"fuzz-aat\"\npath = \"fuzz_targets/fuzz-aat.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"fuzz-cpal\"\npath = \"fuzz_targets/fuzz-cpal.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"fuzz-table\"\npath = \"fuzz_targets/fuzz-table.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"fuzz-table-with-builder\"\npath = \"fuzz_targets/fuzz-table-with-builder.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"fuzz-glyph-index\"\npath = \"fuzz_targets/fuzz-glyph-index.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"fuzz-outline\"\npath = \"fuzz_targets/fuzz-outline.rs\"\ntest = false\ndoc = false\nbench = false\n\n[[bin]]\nname = \"fuzz-variable-outline\"\npath = \"fuzz_targets/fuzz-variable-outline.rs\"\ntest = false\ndoc = false\nbench = false\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-aat.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse std::num::NonZeroU16;\nuse ttf_parser::{GlyphId, apple_layout::Lookup};\n\nfn u16_to_u8_vec(data: &[u16]) -> Vec<u8> {\n    let mut u8_data = Vec::with_capacity(data.len() * 2);\n    for &value in data {\n        u8_data.push((value >> 8) as u8);\n        u8_data.push(value as u8);\n    }\n    u8_data\n}\n\nfuzz_target!(|data: &[u8]| {\n    // Skip this iteration if data not enough\n    if data.len() < 4 {\n        return;\n    }\n\n    let (format_data, rest) = data.split_at(2);\n    let format = u16::from_be_bytes([format_data[0], format_data[1]]);\n\n    let random_u16 = |data: &[u8], idx: usize| -> Option<u16> {\n        if data.len() > idx + 1 {\n            Some(u16::from_be_bytes([data[idx], data[idx + 1]]))\n        } else {\n            None\n        }\n    };\n\n    let lookup_len = NonZeroU16::new(1).unwrap();\n\n    // Use valid fromat 0 2 4 6 8 10 for fuzzing chioce\n    match format {\n        0 => {\n            if let Some(value) = random_u16(rest, 0) {\n                let lookup_data = u16_to_u8_vec(&[0, value]);\n                if let Some(table) = Lookup::parse(lookup_len, &lookup_data) {\n                    let _ = table.value(GlyphId(0));\n                    let _ = table.value(GlyphId(1));\n                }\n            }\n        }\n        2 => {\n            if let Some(segment_size) = random_u16(rest, 2) {\n                let lookup_data = u16_to_u8_vec(&[2, segment_size, 1]);\n                if let Some(table) = Lookup::parse(lookup_len, &lookup_data) {\n                    let _ = table.value(GlyphId(118));\n                    let _ = table.value(GlyphId(5));\n                }\n            }\n        }\n        4 => {\n            if let Some(segment_size) = random_u16(rest, 2) {\n                let lookup_data = u16_to_u8_vec(&[4, segment_size, 1]);\n                if let Some(table) = Lookup::parse(lookup_len, &lookup_data) {\n                    let _ = table.value(GlyphId(118));\n                    let _ = table.value(GlyphId(7));\n                }\n            }\n        }\n        6 => {\n            if let Some(segment_size) = random_u16(rest, 2) {\n                let lookup_data = u16_to_u8_vec(&[6, segment_size]);\n                if let Some(table) = Lookup::parse(lookup_len, &lookup_data) {\n                    let _ = table.value(GlyphId(0));\n                    let _ = table.value(GlyphId(10));\n                }\n            }\n        }\n        8 => {\n            if let Some(glyph_count) = random_u16(rest, 2) {\n                let lookup_data = u16_to_u8_vec(&[8, 0, glyph_count]);\n                if let Some(table) = Lookup::parse(lookup_len, &lookup_data) {\n                    let _ = table.value(GlyphId(0));\n                    let _ = table.value(GlyphId(5));\n                }\n            }\n        }\n        10 => {\n            if let Some(value_size) = random_u16(rest, 2) {\n                let lookup_data = u16_to_u8_vec(&[10, value_size, 0]);\n                if let Some(table) = Lookup::parse(lookup_len, &lookup_data) {\n                    let _ = table.value(GlyphId(0));\n                    let _ = table.value(GlyphId(1));\n                }\n            }\n        }\n        _ => {\n          // Ignore invliad format of 1 3 5 7 9        \n        }\n    }\n});\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-base.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse ttf_parser::{Face, GlyphId, name_id};\n\nfn get_fuzzed_char(data: &[u8]) -> char {\n    if data.len() >= 4 {\n        let code_point = u32::from_le_bytes([data[0], data[1], data[2], data[3]]);\n        std::char::from_u32(code_point).unwrap_or('A')\n    } else {\n        'A'\n    }\n}\n\nfuzz_target!(|data: &[u8]| {\n    // Skip this iteration if no data is provided\n    if data.is_empty() {\n        return;\n    }\n\n    let choice = data[0] % 15;\n    let fuzz_data = &data[1..];\n\n    let face_result = Face::parse(fuzz_data, 0);\n    let id = if !data.is_empty() { data[0] as u16 } else { 0 };\n    let glyph_id = GlyphId(id);\n    let random_char = get_fuzzed_char(fuzz_data);\n\n    // Randomly fuzz functions from base ttf-parser\n    match choice {\n        0 => {\n            if let Ok(face) = face_result {\n                let mut family_names = Vec::new();\n                for name in face.names() {\n                    if name.name_id == name_id::FULL_NAME && name.is_unicode() {\n                        if let Some(family_name) = name.to_string() {\n                            let language = name.language();\n                            family_names.push(format!(\n                                \"{} ({}, {})\",\n                                family_name,\n                                language.primary_language(),\n                                language.region()\n                            ));\n                        }\n                    }\n                }\n                let _ = family_names;\n            }\n        },\n        1 => {\n            if let Ok(face) = face_result {\n                let _ = face.units_per_em();\n                let _ = face.ascender();\n                let _ = face.descender();\n                let _ = face.line_gap();\n                let _ = face.global_bounding_box();\n            }\n        },\n        2 => {\n            if let Ok(face) = face_result {\n                let _ = face.is_regular();\n                let _ = face.is_bold();\n                let _ = face.is_italic();\n                let _ = face.is_oblique();\n                let _ = face.is_variable();\n            }\n        },\n        3 => {\n            if let Ok(face) = face_result {\n                let _ = face.number_of_glyphs();\n                let _ = face.glyph_bounding_box(glyph_id);\n                let _ = face.glyph_hor_advance(glyph_id);\n                let _ = face.glyph_index(random_char);\n            }\n        },\n        4 => {\n            if let Ok(face) = face_result {\n                let _ = face.underline_metrics();\n                let _ = face.strikeout_metrics();\n                let _ = face.subscript_metrics();\n                let _ = face.superscript_metrics();\n            }\n        },\n        5 => {\n            if let Ok(face) = face_result {\n                let post_script_name = face.names().into_iter()\n                    .find(|name| name.name_id == name_id::POST_SCRIPT_NAME && name.is_unicode())\n                    .and_then(|name| name.to_string());\n                let _ = post_script_name;\n            }\n        },\n        6 => { \n            if let Ok(face) = face_result {\n                let _ = face.glyph_raster_image(glyph_id, u16::MAX);\n            }\n        },\n        7 => {\n            if let Ok(face) = face_result {\n                if let Some(stat) = face.tables().stat {\n                    for axis in stat.axes {\n                        let _ = axis.tag;\n                    }\n                }\n            }\n        },\n        8 => {\n            if let Ok(face) = face_result {\n                if let Some(svg_table) = face.tables().svg {\n                    let _ = svg_table.documents.find(glyph_id);\n                }\n            }\n        },\n        9 => {\n            if let Ok(face) = face_result {\n                let _ = face.permissions();\n                let _ = face.is_variable();\n            }\n        },\n        10 => {\n            if let Ok(face) = face_result {\n                let _ = face.glyph_hor_side_bearing(glyph_id);\n                let _ = face.glyph_ver_advance(glyph_id);\n                let _ = face.glyph_ver_side_bearing(glyph_id);\n            }\n        },\n        11 => {\n            if let Ok(face) = face_result {\n                let _ = face.tables().os2;\n            }\n        },\n        12 => {\n            if let Ok(face) = face_result {\n                let _ = face.tables().head;\n            }\n        },\n        13 => {\n            if let Ok(face) = face_result {\n                let _ = face.tables().maxp;\n            }\n        },\n        14 => {\n            if let Ok(face) = face_result {\n                let _ = face.tables().hhea;\n            }\n        },\n        _ => return,\n    }\n});\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-cpal.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse ttf_parser::{colr, GlyphId, cpal, RgbaColor};\n\nfuzz_target!(|data: &[u8]| {\n    if data.len() < 10 {\n        return;\n    }\n\n    // Fuzz CPAL/COLR parse\n    if let Some(cpal_table) = cpal::Table::parse(data) {\n        if let Some(colr_table) = colr::Table::parse(cpal_table, data) {\n            let mut painter = VecPainter(vec![]);\n            let glyph_id = GlyphId(data[0] as u16);\n            let _ = colr_table.paint(glyph_id, 0, &mut painter, &[], RgbaColor::new(0, 0, 0, 255));\n        }\n    }\n});\n\n// Custom VecPainter\nstruct VecPainter(Vec<Command>);\n\nimpl<'a> colr::Painter<'a> for VecPainter {\n    fn outline_glyph(&mut self, glyph_id: GlyphId) {\n        self.0.push(Command::OutlineGlyph(glyph_id));\n    }\n\n    fn paint(&mut self, paint: colr::Paint<'a>) {\n        let custom_paint = match paint {\n            colr::Paint::Solid(color) => CustomPaint::Solid(color),\n            colr::Paint::LinearGradient(lg) => CustomPaint::LinearGradient(\n                lg.x0, lg.y0, lg.x1, lg.y1, lg.x2, lg.y2, lg.extend,\n                lg.stops(0, &[]).map(|stop| CustomStop(stop.stop_offset, stop.color)).collect(),\n            ),\n            colr::Paint::RadialGradient(rg) => CustomPaint::RadialGradient(\n                rg.x0, rg.y0, rg.r0, rg.r1, rg.x1, rg.y1, rg.extend,\n                rg.stops(0, &[]).map(|stop| CustomStop(stop.stop_offset, stop.color)).collect(),\n            ),\n            colr::Paint::SweepGradient(sg) => CustomPaint::SweepGradient(\n                sg.center_x, sg.center_y, sg.start_angle, sg.end_angle, sg.extend,\n                sg.stops(0, &[]).map(|stop| CustomStop(stop.stop_offset, stop.color)).collect(),\n            ),\n        };\n\n        self.0.push(Command::Paint(custom_paint));\n    }\n\n    fn push_layer(&mut self, mode: colr::CompositeMode) {\n        self.0.push(Command::PushLayer(mode));\n    }\n\n    fn pop_layer(&mut self) {\n        self.0.push(Command::PopLayer);\n    }\n\n    fn push_transform(&mut self, transform: ttf_parser::Transform) {\n        self.0.push(Command::Transform(transform));\n    }\n\n    fn pop_transform(&mut self) {\n        self.0.push(Command::PopTransform);\n    }\n\n    fn push_clip(&mut self) {\n        self.0.push(Command::PushClip);\n    }\n\n    fn push_clip_box(&mut self, clipbox: colr::ClipBox) {\n        self.0.push(Command::PushClipBox(clipbox));\n    }\n\n    fn pop_clip(&mut self) {\n        self.0.push(Command::PopClip);  \n    }\n}\n\n#[derive(Clone, Debug, PartialEq)]\nstruct CustomStop(f32, RgbaColor);\n\n#[derive(Clone, Debug, PartialEq)]\nenum CustomPaint {\n    Solid(RgbaColor),\n    LinearGradient(f32, f32, f32, f32, f32, f32, colr::GradientExtend, Vec<CustomStop>),\n    RadialGradient(f32, f32, f32, f32, f32, f32, colr::GradientExtend, Vec<CustomStop>),\n    SweepGradient(f32, f32, f32, f32, colr::GradientExtend, Vec<CustomStop>),\n}\n\n#[derive(Clone, Debug, PartialEq)]\nenum Command {\n    OutlineGlyph(GlyphId),\n    Paint(CustomPaint),\n    PushLayer(colr::CompositeMode),\n    PopLayer,\n    Transform(ttf_parser::Transform),\n    PopTransform,\n    PushClip,\n    PushClipBox(colr::ClipBox),\n    PopClip,\n}\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-glyph-index.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Transformed from ttf-parser/testing-tools/ttf-fuzz/src/fuzz-glyph-index.rs\n// for LibFuzzer and Cargo-Fuzz compatibility\n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse ttf_parser::Face;\n\nconst CHARS: &[char] = &[\n    '\\u{0}',\n    'A',\n    'Ф',\n    '0',\n    '\\u{D7FF}',\n    '\\u{10FFFF}',\n];\n\nfuzz_target!(|data: &[u8]| {\n    if let Ok(face) = Face::parse(data, 0) {\n        for c in CHARS {\n            let _ = face.glyph_index(*c);\n        }\n    }\n});\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-outline.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Transformed from ttf-parser/testing-tools/ttf-fuzz/src/fuzz-outline.rs\n// for LibFuzzer and Cargo-Fuzz compatibility \n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse ttf_parser::{Face, GlyphId, OutlineBuilder};\n\nstruct Builder(usize);\n\nimpl OutlineBuilder for Builder {\n    #[inline]\n    fn move_to(&mut self, _: f32, _: f32) {\n        self.0 += 1;\n    }\n\n    #[inline]\n    fn line_to(&mut self, _: f32, _: f32) {\n        self.0 += 1;\n    }\n\n    #[inline]\n    fn quad_to(&mut self, _: f32, _: f32, _: f32, _: f32) {\n        self.0 += 2;\n    }\n\n    #[inline]\n    fn curve_to(&mut self, _: f32, _: f32, _: f32, _: f32, _: f32, _: f32) {\n        self.0 += 3;\n    }\n\n    #[inline]\n    fn close(&mut self) {\n        self.0 += 1;\n    }\n}\n\nfuzz_target!(|data: &[u8]| {\n    if let Ok(face) = Face::parse(data, 0) {\n        for id in 0..face.number_of_glyphs() {\n            let _ = face.outline_glyph(GlyphId(id), &mut Builder(0));\n        }\n    }\n});\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-table-with-builder.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\n\nuse ttf_parser::{GlyphId, Face, cff};\nuse std::fmt::Write;\n\nfuzz_target!(|fuzz_data: &[u8]| {\n    // Skip this iteration if data is not enough\n    if fuzz_data.is_empty() {\n        return;\n    }\n\n    let choice = fuzz_data[0] % 2;\n    let data = &fuzz_data[1..];\n\n    // Randomly choose a module to fuzz\n    if (choice) == 0 {\n        // Fuzzing CFF1 module\n        if let Some(table) = cff::Table::parse(data) {\n            let mut builder = Builder(String::new());\n            let _ = table.outline(GlyphId(0), &mut builder);\n        }\n    } else {\n        // Fuzzing glyf module\n        if let Ok(face) = Face::parse(data, 0) {\n            let mut builder = Builder(String::new());\n            let _ = face.outline_glyph(GlyphId(0), &mut builder);\n        }\n    }\n});\n\n// Custom Builder implementation\nstruct Builder(String);\n\nimpl ttf_parser::OutlineBuilder for Builder {\n    fn move_to(&mut self, x: f32, y: f32) {\n        let _ = write!(&mut self.0, \"M {} {} \", x, y);\n    }\n\n    fn line_to(&mut self, x: f32, y: f32) {\n        let _ = write!(&mut self.0, \"L {} {} \", x, y);\n    }\n\n    fn quad_to(&mut self, x1: f32, y1: f32, x: f32, y: f32) {\n        let _ = write!(&mut self.0, \"Q {} {} {} {} \", x1, y1, x, y);\n    }\n\n    fn curve_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32) {\n        let _ = write!(&mut self.0, \"C {} {} {} {} {} {} \", x1, y1, x2, y2, x, y);\n    }\n\n    fn close(&mut self) {\n        let _ = write!(&mut self.0, \"Z \");\n    }\n}\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-table.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse std::num::NonZeroU16;\nuse ttf_parser::{GlyphId};\nuse ttf_parser::{ankr, avar, cmap, feat, fvar, gdef, gvar, hmtx, hvar, kern, kerx};\nuse ttf_parser::{loca, math, maxp, morx, mvar, name, sbix, stat, svg, trak, vhea, vorg, vvar};\n\nfuzz_target!(|fuzz_data: &[u8]| {\n    // Skip this iteration if data is empty\n    if fuzz_data.is_empty() {\n        return;\n    }\n\n    // Randomly choose a fuzzing target function\n    let choice = fuzz_data[0] % 26;\n    let data = &fuzz_data[1..];\n    match choice {\n        0 => {\n            // Fuzz cmap module\n            if let Some(subtable0) = cmap::Subtable0::parse(data) {\n                subtable0.glyph_index(0x41);\n                subtable0.glyph_index(0x42);\n                let mut codepoints = vec![];\n                subtable0.codepoints(|c| codepoints.push(c));\n            }\n            if let Some(subtable4) = cmap::Subtable4::parse(data) {\n                subtable4.glyph_index(0x41);\n                subtable4.glyph_index(0x42);\n                let mut codepoints = vec![];\n                subtable4.codepoints(|c| codepoints.push(c));\n            }\n        }\n        1 => {\n            // Fuzz ankr module\n            if let Some(table) = ankr::Table::parse(NonZeroU16::new(1).unwrap(), data) {\n                if let Some(points) = table.points(GlyphId(0)) {\n                    for point in points {\n                        let _ = point.x;\n                        let _ = point.y;\n                    }\n                }\n            }\n        }\n        2 => {\n            // Fuzz feat module\n            if let Some(feat_table) = feat::Table::parse(data) {\n                for feature in feat_table.names {\n                    let _ = feature.exclusive;\n                    let _ = feature.default_setting_index;\n                }\n            }\n        }\n        3 => {\n            // Fuzz hmtx module\n            if let Some(hmtx_table) = hmtx::Table::parse(1, NonZeroU16::new(1).unwrap(), data) {\n                let _ = hmtx_table.number_of_metrics;\n            }\n        }\n        4 => {\n            // Fuzz maxp module\n            if let Some(maxp_table) = maxp::Table::parse(data) {\n                let _ = maxp_table.number_of_glyphs;\n            }\n        }\n        5 => {\n            // Fuzz sbix module\n            if let Some(table) = sbix::Table::parse(NonZeroU16::new(1).unwrap(), data) {\n                for strike in table.strikes {\n                    for i in 0..strike.len() {\n                        if let Some(glyph_data) = strike.get(GlyphId(i as u16)) {\n                            let _ = glyph_data.x;\n                            let _ = glyph_data.y;\n                            let _ = glyph_data.width;\n                            let _ = glyph_data.height;\n                            let _ = glyph_data.pixels_per_em;\n                            let _ = glyph_data.format;\n                        }\n                    }\n                }\n            }\n        }\n        6 => {\n            // Fuzz trak module\n            if let Some(trak_table) = trak::Table::parse(data) {\n                for track in trak_table.horizontal.tracks {\n                    let _ = track.value;\n                    for value in track.values {\n                        let _ = value;\n                    }\n                }\n            }\n        }\n        7 => {\n            // Fuzz kern module\n            if let Some(kern_table) = kern::Table::parse(data) {\n                for subtable in kern_table.subtables.into_iter() {\n                    if let Some(kern_val) = subtable.glyphs_kerning(GlyphId(1), GlyphId(2)) {\n                        let _ = kern_val;\n                    }\n                }\n            }\n        }\n        8 => {\n            // Fuzz kerx module\n            if let Some(kerx_table) = kerx::Table::parse(NonZeroU16::new(1).unwrap(), data) {\n                for subtable in kerx_table.subtables.into_iter() {\n                    if let Some(kerx_val) = subtable.glyphs_kerning(GlyphId(1), GlyphId(2)) {\n                        let _ = kerx_val;\n                    }\n                }\n            }\n        }\n        9 => {\n            // Fuzz loca module\n            if let Some(loca_table) = loca::Table::parse(NonZeroU16::new(1).unwrap(), ttf_parser::head::IndexToLocationFormat::Short, data) {\n                if let Some(range) = loca_table.glyph_range(GlyphId(1)) {\n                    let _ = range.start;\n                    let _ = range.end;\n                }\n            }\n        }\n        10 => {\n            // Fuzz math constants module\n            if let Some(math_table) = math::Table::parse(data) {\n                if let Some(constants) = math_table.constants {\n                    let _ = constants.axis_height();\n                    let _ = constants.script_percent_scale_down();\n                }\n            }\n        }\n        11 => {\n            // Fuzz math kern info module\n            if let Some(math_table) = math::Table::parse(data) {\n                if let Some(glyph_info) = math_table.glyph_info {\n                    if let Some(kern_infos) = glyph_info.kern_infos {\n                        if let Some(kern_info) = kern_infos.get(GlyphId(1)) {\n                            let _ = kern_info.top_right;\n                            let _ = kern_info.bottom_left;\n                        }\n                    }\n                }\n            }\n        }\n        12 => {\n            // Fuzz gvar module\n            let _ = gvar::Table::parse(data);\n        }\n        13 => {\n            // Fuzz hvar module\n            let _ = hvar::Table::parse(data);\n        }\n        14 => {\n            // Fuzz avar module\n            let _ = avar::Table::parse(data);\n        }\n        15 => {\n            // Fuzz fvar module\n            if let Some(fvar_table) = fvar::Table::parse(data) {\n                for axis in fvar_table.axes {\n                    let _ = axis.tag;\n                }\n            }\n        }\n        16 => {\n            // Fuzz gdef module\n            if let Some(gdef_table) = gdef::Table::parse(data) {\n                let _ = gdef_table.glyph_class(GlyphId(1));\n            }\n        }\n        17 => {\n            // Fuzz morx module\n            if let Some(morx_table) = morx::Table::parse(NonZeroU16::new(1).unwrap(), data) {\n                for chain in morx_table.chains {\n                    let _ = chain.default_flags;\n                    for feature in chain.features {\n                        let _ = feature.kind;\n                    }\n                }\n            }\n        }\n        18 => {\n            // Fuzz mvar module\n            if let Some(mvar_table) = mvar::Table::parse(data) {\n                let _ = mvar_table.metric_offset(ttf_parser::Tag::from_bytes(b\"wdth\"), &[]);\n            }\n        }\n        19 => {\n            // Fuzz name module\n            if let Some(name_table) = name::Table::parse(data) {\n                for index in 0..name_table.names.len() {\n                    if let Some(name) = name_table.names.get(index) {\n                        let _ = name.to_string();\n                    }\n                }\n            }\n        }\n        20 => {\n            // Fuzz stat module\n            if let Some(stat_table) = stat::Table::parse(data) {\n                for subtable in stat_table.subtables() {\n                    let _ = subtable.name_id();\n                }\n            }\n        }\n        21 => {\n            // Fuzz svg module\n            if let Some(svg_table) = svg::Table::parse(data) {\n                for index in 0..svg_table.documents.len() {\n                    if let Some(svg_doc) = svg_table.documents.get(index) {\n                        let _ = svg_doc.glyphs_range();\n                    }\n                }\n            }\n        }\n        22 => {\n            // Fuzz trak module\n            if let Some(trak_table) = trak::Table::parse(data) {\n                for track in trak_table.horizontal.tracks {\n                    let _ = track.value;\n                    for value in track.values {\n                        let _ = value;\n                    }\n                }\n            }\n        }\n        23 => {\n            // Fuzz vhea module\n            if let Some(vhea_table) = vhea::Table::parse(data) {\n                let _ = vhea_table.ascender;\n                let _ = vhea_table.descender;\n                let _ = vhea_table.line_gap;\n                let _ = vhea_table.number_of_metrics;\n            }\n        }\n        24 => {\n            // Fuzz vorg module\n            if let Some(vorg_table) = vorg::Table::parse(data) {\n                let _ = vorg_table.default_y;\n                for metrics in vorg_table.metrics {\n                    let _ = metrics.glyph_id;\n                    let _ = metrics.y;\n                }\n            }\n        }\n        25 => {\n            // Fuzz vvar module\n            if let Some(vvar_table) = vvar::Table::parse(data) {\n                let _ = vvar_table.advance_offset(GlyphId(1), &[]);\n                let _ = vvar_table.top_side_bearing_offset(GlyphId(1), &[]);\n                let _ = vvar_table.bottom_side_bearing_offset(GlyphId(1), &[]);\n                let _ = vvar_table.vertical_origin_offset(GlyphId(1), &[]);\n            }\n        }\n        _ => {}\n    }\n});\n"
  },
  {
    "path": "projects/ttf-parser/fuzz/fuzz_targets/fuzz-variable-outline.rs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Transformed from ttf-parser/testing-tools/ttf-fuzz/src/fuzz-variable-outline.rs\n// for LibFuzzer and Cargo-Fuzz compatibility \n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse ttf_parser::{Face, GlyphId, OutlineBuilder, Tag};\n\nstruct Builder(usize);\n\nimpl OutlineBuilder for Builder {\n    #[inline]\n    fn move_to(&mut self, _: f32, _: f32) {\n        self.0 += 1;\n    }\n\n    #[inline]\n    fn line_to(&mut self, _: f32, _: f32) {\n        self.0 += 1;\n    }\n\n    #[inline]\n    fn quad_to(&mut self, _: f32, _: f32, _: f32, _: f32) {\n        self.0 += 2;\n    }\n\n    #[inline]\n    fn curve_to(&mut self, _: f32, _: f32, _: f32, _: f32, _: f32, _: f32) {\n        self.0 += 3;\n    }\n\n    #[inline]\n    fn close(&mut self) {\n        self.0 += 1;\n    }\n}\n\nfuzz_target!(|data: &[u8]| {\n    if let Ok(mut face) = Face::parse(data, 0) {\n        if face.set_variation(Tag::from_bytes(b\"wght\"), 500.0).is_some() {\n            for id in 0..face.number_of_glyphs() {\n                let _ = face.outline_glyph(GlyphId(id), &mut Builder(0));\n            }\n        }\n    }\n});\n"
  },
  {
    "path": "projects/ttf-parser/project.yaml",
    "content": "homepage: \"https://github.com/RazrFalcon/ttf-parser\"\nmain_repo: \"https://github.com/RazrFalcon/ttf-parser.git\"\nlanguage: rust\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n- \"david@adalogics.com\"\n- \"arthur.chan@adalogics.com\"\n- \"fuzzing@fuchsia.dev\"\n"
  },
  {
    "path": "projects/tungstenite-rs/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/snapview/tungstenite-rs.git\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/tungstenite-rs/build.sh",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/tungstenite-rs/fuzz\ncargo fuzz build -O\ncp $SRC/tungstenite-rs/fuzz/target/x86_64-unknown-linux-gnu/release/parse_frame_header $OUT/\ncp $SRC/tungstenite-rs/fuzz/target/x86_64-unknown-linux-gnu/release/read_message_client $OUT/\ncp $SRC/tungstenite-rs/fuzz/target/x86_64-unknown-linux-gnu/release/read_message_server $OUT/"
  },
  {
    "path": "projects/tungstenite-rs/project.yaml",
    "content": "homepage: \"https://crates.io/crates/tungstenite\"\nlanguage: rust\nprimary_contact: \"venkatamaturi98@gmail.com\"\nauto_ccs:\n  - \"dnaka91@gmail.com\"\n  - \"slomo@coaxion.net\"\n  - \"ran@unusedvar.com\"\n  - \"leckey.ryan@gmail.com\"\n  - \"redrield@gmail.com\"\n  - \"dushistov@mail.ru\"\n\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/snapview/tungstenite-rs'"
  },
  {
    "path": "projects/turf/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\n# FIXME: Building locally from source is currently abyssmally complicated/broken\n# Ref: https://github.com/Turfjs/turf/issues/2229\n# RUN git clone --depth 1 https://github.com/Turfjs/turf.git\nRUN mkdir -p \"$SRC/turf\"\n\nCOPY package.json $SRC/turf\nCOPY fuzz.js $SRC/turf\n\nWORKDIR $SRC/turf\n"
  },
  {
    "path": "projects/turf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\ncompile_javascript_fuzzer turf fuzz.js -i turf --sync\n"
  },
  {
    "path": "projects/turf/fuzz.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require(\"@jazzer.js/core\");\nconst turf = require(\"@turf/turf\");\n\nmodule.exports.fuzz = function(data) {\n  const provider = new FuzzedDataProvider(data);\n  const randomSwitch = provider.consumeIntegralInRange(0, 4);\n  try {\n    switch (randomSwitch) {\n      case 0:\n        const point = turf.point([\n          provider.consumeNumberInRange(-180, 180),\n          provider.consumeNumberInRange(-90, 90),\n        ]);\n        const radius = provider.consumeNumber();\n        const options = {\n          steps: provider.consumeIntegralInRange(1, 1000),\n          units: provider.consumeString(10),\n        };\n\n        turf.buffer(point, radius, options);\n        break;\n      case 1:\n        const line1 = turf.lineString([\n          [\n            provider.consumeNumberInRange(-180, 180),\n            provider.consumeNumberInRange(-90, 90),\n          ],\n          [\n            provider.consumeNumberInRange(-180, 180),\n            provider.consumeNumberInRange(-90, 90),\n          ],\n        ]);\n        const line2 = turf.lineString([\n          [\n            provider.consumeNumberInRange(-180, 180),\n            provider.consumeNumberInRange(-90, 90),\n          ],\n          [\n            provider.consumeNumberInRange(-180, 180),\n            provider.consumeNumberInRange(-90, 90),\n          ],\n        ]);\n\n        turf.lineIntersect(line1, line2);\n        break;\n      case 2:\n        const origin = turf.point([\n          provider.consumeNumberInRange(-180, 180),\n          provider.consumeNumberInRange(-90, 90),\n        ]);\n        const distance = provider.consumeNumberInRange(0, 100);\n        const bearing = provider.consumeNumberInRange(0, 360);\n\n        turf.destination(origin, distance, bearing);\n        break;\n      case 3:\n        const polygon1 = turf.polygon([\n          [\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n          ],\n        ]);\n        const polygon2 = turf.polygon([\n          [\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n            [\n              provider.consumeNumberInRange(-180, 180),\n              provider.consumeNumberInRange(-90, 90),\n            ],\n          ],\n        ]);\n\n        turf.booleanContains(polygon1, polygon2);\n        break;\n      case 4:\n        const point1 = turf.point([\n          provider.consumeNumberInRange(-180, 180),\n          provider.consumeNumberInRange(-90, 90),\n        ]);\n        const point2 = turf.point([\n          provider.consumeNumberInRange(-180, 180),\n          provider.consumeNumberInRange(-90, 90),\n        ]);\n        const point3 = turf.point([\n          provider.consumeNumberInRange(-180, 180),\n          provider.consumeNumberInRange(-90, 90),\n        ]);\n        const point4 = turf.point([\n          provider.consumeNumberInRange(-180, 180),\n          provider.consumeNumberInRange(-90, 90),\n        ]);\n\n        turf.bbox(turf.featureCollection([point1, point2, point3, point4]));\n        break;\n    }\n  } catch (error) {\n    // Ignore errors\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.indexOf(message) !== -1);\n}\n\nconst ignored = [\"units is invalid\", \"First and last\"];\n"
  },
  {
    "path": "projects/turf/package.json",
    "content": "{\n  \"name\": \"turf-fuzz\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Fuzzing the geojson library turf.js\",\n  \"main\": \"fuzz.js\",\n  \"author\": \"Christopher Krah <christopher.krah@code-intelligence.com>\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"@turf/turf\": \"*\"\n  }\n}\n\n"
  },
  {
    "path": "projects/turf/project.yaml",
    "content": "homepage: https://turfjs.org/\nlanguage: javascript\nmain_repo: https://github.com/Turfjs/turf\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/twelve-monkeys/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/haraldk/TwelveMonkeys TwelveMonkeys\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/TwelveMonkeys\n"
  },
  {
    "path": "projects/twelve-monkeys/WildcardStringParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.twelvemonkeys.util.regex.WildcardStringParser;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-11\n// Heuristic name: jvm-autofuzz-heuristics-11\n// Target method: [com.twelvemonkeys.util.regex.WildcardStringParser] public  <init>(java.lang.String)\npublic class WildcardStringParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    new WildcardStringParser(data.consumeRemainingAsString());\n  }\n}\n"
  },
  {
    "path": "projects/twelve-monkeys/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./common/common-io/target/twelvemonkeys-common-io-$CURRENT_VERSION.jar\" $OUT/common-io.jar\ncp \"./common/common-lang/target/twelvemonkeys-common-lang-$CURRENT_VERSION.jar\" $OUT/common-lang.jar\ncp \"./common/common-image/target/twelvemonkeys-common-image-$CURRENT_VERSION.jar\" $OUT/common-image.jar\ncp \"./contrib/target/twelvemonkeys-contrib-$CURRENT_VERSION.jar\" $OUT/contrib.jar\n\nALL_JARS='common-io.jar common-lang.jar common-image.jar contrib.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/twelve-monkeys/project.yaml",
    "content": "homepage: https://github.com/haraldk/TwelveMonkeys\nmain_repo: https://github.com/haraldk/TwelveMonkeys\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/twitter4j/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN git clone --depth 1 https://github.com/Twitter4J/Twitter4J/ Twitter4J\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/Twitter4J\n"
  },
  {
    "path": "projects/twitter4j/TwitterObjectFactoryFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport twitter4j.TwitterException;\nimport twitter4j.TwitterObjectFactory;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-1\n// Heuristic name: jvm-autofuzz-heuristics-1\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.User createUser(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.UserList createUserList(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.Place createPlace(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.DirectMessage createDirectMessage(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.SavedSearch createSavedSearch(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static java.lang.Object createObject(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.AccountTotals createAccountTotals(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.Location createLocation(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.IDs createIDs(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.Relationship createRelationship(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.Trend createTrend(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.Trends createTrends(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static java.util.Map createRateLimitStatus(java.lang.String) throws twitter4j.TwitterException\n// Target method: [twitter4j.TwitterObjectFactory] public static twitter4j.v1.OEmbed createOEmbed(java.lang.String) throws twitter4j.TwitterException\npublic class TwitterObjectFactoryFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      switch (data.consumeInt(1, 14)) {\n        case 1:\n          TwitterObjectFactory.createUser(data.consumeRemainingAsString());\n          break;\n        case 2:\n          TwitterObjectFactory.createUserList(data.consumeRemainingAsString());\n          break;\n        case 3:\n          TwitterObjectFactory.createPlace(data.consumeRemainingAsString());\n          break;\n        case 4:\n          TwitterObjectFactory.createDirectMessage(data.consumeRemainingAsString());\n          break;\n        case 5:\n          TwitterObjectFactory.createSavedSearch(data.consumeRemainingAsString());\n          break;\n        case 6:\n          TwitterObjectFactory.createObject(data.consumeRemainingAsString());\n          break;\n        case 7:\n          TwitterObjectFactory.createAccountTotals(data.consumeRemainingAsString());\n          break;\n        case 8:\n          TwitterObjectFactory.createLocation(data.consumeRemainingAsString());\n          break;\n        case 9:\n          TwitterObjectFactory.createIDs(data.consumeRemainingAsString());\n          break;\n        case 10:\n          TwitterObjectFactory.createRelationship(data.consumeRemainingAsString());\n          break;\n        case 11:\n          TwitterObjectFactory.createTrend(data.consumeRemainingAsString());\n          break;\n        case 12:\n          TwitterObjectFactory.createTrends(data.consumeRemainingAsString());\n          break;\n        case 13:\n          TwitterObjectFactory.createRateLimitStatus(data.consumeRemainingAsString());\n          break;\n        case 14:\n          TwitterObjectFactory.createOEmbed(data.consumeRemainingAsString());\n          break;\n      }\n    } catch (TwitterException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/twitter4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n./gradlew clean build -x test -x javadoc -x sources\n\nCURRENT_VERSION=$(./gradlew properties | grep ^version: | cut -d\" \" -f2)\n\ncp \"./build/libs/twitter4j-$CURRENT_VERSION.jar\" $OUT/twitter4j.jar\ncp \"./twitter4j-core/build/libs/twitter4j-core-$CURRENT_VERSION.jar\" $OUT/twitter4j-core.jar\n\nALL_JARS=\"twitter4j.jar twitter4j-core.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n    chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/twitter4j/project.yaml",
    "content": "homepage: https://github.com/Twitter4J/Twitter4J/\nmain_repo: https://github.com/Twitter4J/Twitter4J/\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/typescript/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nRUN  git clone --depth 1 https://github.com/microsoft/TypeScript.git\n\nCOPY build.sh $SRC/\nCOPY fuzz_util.js $SRC/TypeScript\nCOPY fuzz_ast.js $SRC/TypeScript\nCOPY fuzz_compiler.js $SRC/TypeScript\nCOPY fuzz_scanner.js $SRC/TypeScript\nCOPY fuzz_json_parser.js $SRC/TypeScript\nCOPY fuzz_transpile_module.js $SRC/TypeScript\n\n\nWORKDIR $SRC/TypeScript\n"
  },
  {
    "path": "projects/typescript/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\n# Fuzzing TS is a resource hog so we have to adjust the rss limit a bit\ncompile_javascript_fuzzer TypeScript fuzz_ast -i typescript -- -rss_limit_mb=4096\ncompile_javascript_fuzzer TypeScript fuzz_compiler -i typescript --sync -- -rss_limit_mb=4096\ncompile_javascript_fuzzer TypeScript fuzz_scanner -i typescript --sync -- -rss_limit_mb=4096\ncompile_javascript_fuzzer TypeScript fuzz_json_parser -i typescript --sync -- -rss_limit_mb=4096\ncompile_javascript_fuzzer TypeScript fuzz_transpile_module -i typescript --sync -- -rss_limit_mb=4096\n"
  },
  {
    "path": "projects/typescript/fuzz_ast.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require(\"@jazzer.js/core\");\nconst { getCompilerOptions } = require(\"./fuzz_util\");\nconst ts = require(\"typescript\");\n\nmodule.exports.fuzz = async function(data) {\n  const provider = new FuzzedDataProvider(data);\n\n  try {\n    const fileName = provider.consumeString(10) + \".ts\";\n    const fileContents = provider.consumeString(1000);\n\n    const sourceFile = ts.createSourceFile(\n      fileName,\n      fileContents,\n      ts.ScriptTarget.Latest,\n      /*setParentNodes */ true\n    );\n\n    ts.getPreEmitDiagnostics(sourceFile);\n    ts.getTypeChecker(sourceFile);\n\n    const shouldRemoveNode = provider.consumeBoolean();\n    if (shouldRemoveNode) {\n      const nodes = [];\n      ts.forEachChild(sourceFile, node => nodes.push(node));\n      if (nodes.length > 0) {\n        const indexToRemove = provider.consumeIntegralInRange(0, nodes.length - 1);\n        const nodeToRemove = nodes[indexToRemove];\n        ts.removeNode(nodeToRemove);\n      }\n    }\n\n    const shouldAddNode = provider.consumeBoolean();\n    if (shouldAddNode) {\n      const newNode = ts.createEmptyStatement();\n      const nodes = [];\n      ts.forEachChild(sourceFile, node => nodes.push(node));\n      if (nodes.length > 0) {\n        const indexToAddAt = provider.consumeIntegralInRange(0, nodes.length - 1);\n        const nodeToAddAt = nodes[indexToAddAt];\n        ts.insertNodeAtPosition(sourceFile, newNode, nodeToAddAt.pos);\n      } else {\n        ts.addSyntheticLeadingComment(sourceFile, ts.SyntaxKind.SingleLineCommentTrivia, 'Empty file', true);\n        ts.addSyntheticTrailingComment(sourceFile, ts.SyntaxKind.SingleLineCommentTrivia, 'End of file', true);\n      }\n    }\n\n    const numNodes = provider.consumeIntegral(1, true);\n    for (let i = 0; i < numNodes; i++) {\n      const nodes = [];\n      ts.forEachChild(sourceFile, node => nodes.push(node));\n      if (nodes.length > 0) {\n        const indexToReplace = provider.consumeIntegralInRange(0, nodes.length - 1);\n        const nodeToReplace = nodes[indexToReplace];\n        const newNode = ts.createEmptyStatement();\n        ts.replaceNode(nodeToReplace, newNode);\n      }\n    }\n\n    const transformed = ts.transform(sourceFile, [/* transformation functions */]);\n    transformed.transformed[0];\n\n    const shouldFuzzLanguageFeature = provider.consumeBoolean();\n    if (shouldFuzzLanguageFeature) {\n      const classDeclaration = ts.createClassDeclaration(\n        /* decorators */[],\n        /* modifiers */[],\n        provider.consumeString(10),\n        /* typeParameters */[],\n        /* heritageClauses */[],\n        /* members */[]\n      );\n      ts.addDeclaration(sourceFile, classDeclaration);\n\n      const interfaceDeclaration = ts.createInterfaceDeclaration(\n        /* decorators */[],\n        /* modifiers */[],\n        provider.consumeString(10),\n        /* typeParameters */[],\n        /* heritageClauses */[],\n        /* members */[]\n      );\n      ts.addDeclaration(sourceFile, interfaceDeclaration);\n\n      const moduleDeclaration = ts.createModuleDeclaration(\n        /* decorators */[],\n        /* modifiers */[],\n        ts.createIdentifier(provider.consumeString(10)),\n        ts.createModuleBlock([]),\n        ts.NodeFlags.Namespace\n      );\n      ts.addDeclaration(sourceFile, moduleDeclaration);\n\n      const genericFunctionDeclaration = ts.createFunctionDeclaration(\n        /* decorators */[],\n        /* modifiers */[],\n        /* asteriskToken */ undefined,\n        provider.consumeString(10),\n        /* typeParameters */[\n          ts.createTypeParameterDeclaration(\n            ts.createIdentifier(provider.consumeString(10)),\n            /* constraint */ undefined,\n            /* defaultType */ undefined\n          )\n        ],\n        /* parameters */[],\n        /* type */ undefined,\n        /* body */ undefined\n      );\n      ts.addDeclaration(sourceFile, genericFunctionDeclaration);\n\n      const decorator = ts.createDecorator(\n        ts.createCall(\n          ts.createIdentifier(provider.consumeString(10)),\n          /* typeArguments */[],\n          /* argumentsArray */[]\n        )\n      );\n      ts.addDeclaration(sourceFile, decorator);\n\n      const asyncFunctionDeclaration = ts.createFunctionDeclaration(\n        /* decorators */[],\n        /* modifiers */[],\n        /* asteriskToken */ undefined,\n        provider.consumeString(10),\n        /* typeParameters */[],\n        /* parameters */[],\n        /* type */ undefined,\n        ts.createBlock([\n          ts.createAwaitExpression(\n            ts.createCall(\n              ts.createIdentifier(provider.consumeString(10)),\n              /* typeArguments */[],\n              /* argumentsArray */[]\n            )\n          )\n        ])\n      );\n      ts.addDeclaration(sourceFile, asyncFunctionDeclaration);\n    }\n\n    const compilerOptions = getCompilerOptions(provider);\n    const program = ts.createProgram([fileName], compilerOptions);\n    program.emit();\n\n    const shouldFuzzApiFunction = provider.consumeBoolean();\n    if (shouldFuzzApiFunction) {\n      const typeChecker = program.getTypeChecker();\n      const randomSymbol = typeChecker.getSymbolAtLocation(sourceFile);\n      typeChecker.getTypeOfSymbolAtLocation(randomSymbol, sourceFile);\n    }\n\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find(message => error.message.toLowerCase().indexOf(message) !== -1);\n}\n\nconst ignored = [\n  // TypeScript not interested: https://github.com/microsoft/TypeScript/issues/55480\n  \"maximum call stack size exceeded\",\n];\n"
  },
  {
    "path": "projects/typescript/fuzz_compiler.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require(\"@jazzer.js/core\");\nconst { getCompilerOptions } = require(\"./fuzz_util\");\nconst ts = require(\"typescript\");\n\nmodule.exports.fuzz = function(data) {\n  const provider = new FuzzedDataProvider(data);\n\n  try {\n    const fileName = provider.consumeString(10) + \".ts\";\n    const fileContent = provider.consumeString(provider.consumeIntegralInRange(1, 10000));\n\n    const sourceFile = ts.createSourceFile(fileName, fileContent, ts.ScriptTarget.Latest);\n    const compilerOptions = getCompilerOptions(provider);\n\n    const program = ts.createProgram([fileName], compilerOptions);\n    const printer = ts.createPrinter();\n\n    ts.createSourceMapSource(sourceFile.fileName, fileContent, provider.consumeBoolean());\n    printer.printFile(sourceFile);\n    const watchOptions = getWatchOptions(provider);\n\n    ts.createWatchCompilerHost([fileName] /* rootFiles */, compilerOptions /* compilerOptions */,\n      ts.sys /* System */, ts.createSemanticDiagnosticsBuilderProgram /* createProgram */,\n      undefined /* DiagnosticReporter */, undefined, undefined, watchOptions /* watchOptions */);\n\n    program.getTypeChecker();\n    program.emit();\n    ts.getParsedCommandLineOfConfigFile(fileName, {}, ts.sys).errors;\n    program.getDeclarationDiagnostics();\n  }\n  catch (error) {\n    if (!ignoredError(error)) {\n      throw error;\n    }\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.toLowerCase().indexOf(message) !== -1);\n}\n\nconst ignored = [\n  // TypeScript not interested: https://github.com/microsoft/TypeScript/issues/55480\n  \"maximum call stack size exceeded\",\n  \"host.onunrecoverableconfigfilediagnostic is not a function\", // weird bug\n];\n\nfunction getWatchOptions(provider) {\n  return {\n    watchFile: getWatchFileKind(provider),\n    watchDirectory: getWatchDirectoryKind(provider),\n    fallbackPolling: getFallbackPollingKind(provider),\n    synchronousWatchDirectory: provider.consumeBoolean(),\n    excludeDirectories: [],\n    excludeFiles: [],\n  }\n}\n\nfunction getWatchFileKind(provider) {\n  switch (provider.consumeIntegralInRange(0, 6)) {\n    case 0: return ts.WatchFileKind.FixedPollingInterval;\n    case 1: return ts.WatchFileKind.PriorityPollingInterval;\n    case 2: return ts.WatchFileKind.DynamicPriorityPolling;\n    case 3: return ts.WatchFileKind.UseFsEvents;\n    case 4: return ts.WatchFileKind.UseFsEventsOnParentDirectory;\n    case 5: return ts.WatchFileKind.FixedChunkSizePolling;\n    case 6: return provider.consumeString(provider.consumeIntegralInRange(0, 100));\n  }\n}\n\nfunction getWatchDirectoryKind(provider) {\n  switch (provider.consumeIntegralInRange(0, 4)) {\n    case 0: return ts.WatchDirectoryKind.UseFsEvents;\n    case 1: return ts.WatchDirectoryKind.FixedChunkSizePolling;\n    case 2: return ts.WatchDirectoryKind.DynamicPriorityPolling;\n    case 3: return ts.WatchDirectoryKind.FixedPollingInterval;\n    case 4: return provider.consumeString(provider.consumeIntegralInRange(0, 100));\n  }\n}\n\nfunction getFallbackPollingKind(provider) {\n  switch (provider.consumeIntegralInRange(0, 4)) {\n    case 0: return ts.PollingWatchKind.FixedInterval;\n    case 1: return ts.PollingWatchKind.PriorityInterval;\n    case 2: return ts.PollingWatchKind.DynamicPriority;\n    case 3: return ts.PollingWatchKind.FixedChunkSize;\n    case 4: return provider.consumeString(provider.consumeIntegralInRange(0, 100));\n  }\n}\n\n"
  },
  {
    "path": "projects/typescript/fuzz_json_parser.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst ts = require('typescript');\n\nmodule.exports.fuzz = function(data) {\n  const provider = new FuzzedDataProvider(data);\n\n  const fileContent = provider.consumeString(provider.consumeIntegralInRange(1, 10000));\n  const host = createHost(provider);\n  const basePath = provider.consumeString(provider.consumeIntegralInRange(1, 100));\n  const existingOptions = createExistingOptions(provider);\n  const configFileName = provider.consumeString(provider.consumeIntegralInRange(1, 100));\n  let json;\n  try {\n    json = JSON.parse(fileContent);\n  } catch (error) {\n    return;\n  }\n\n  try {\n    ts.parseJsonConfigFileContent(\n      json,\n      host,\n      basePath,\n      existingOptions,\n      configFileName\n    );\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.toLowerCase().indexOf(message) !== -1);\n}\n\nfunction createHost(provider) {\n  return {\n    fileExists: (fileName) => provider.consumeBoolean(),\n    readFile: (fileName) => null,\n    readDirectory: (path, extensions, exclude, include, depth) => [],\n    getCurrentDirectory: () => process.cwd(),\n    getDirectories: (path) => [],\n    useCaseSensitiveFileNames: () => provider.consumeBoolean(),\n    getCanonicalFileName: (fileName) => fileName,\n    getNewLine: () => ts.sys.newLine,\n    getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options),\n    writeFile: (fileName, data) => { },\n    resolveModuleNames: (moduleNames, containingFile, reusedNames, redirectedReference) => [],\n    createHash: (data) => ts.createHash(data),\n  };\n}\n\nfunction createExistingOptions(provider) {\n  return {\n    target: provider.consumeIntegralInRange(ts.ScriptTarget.ES3, ts.ScriptTarget.Latest),\n    module: provider.consumeIntegralInRange(ts.ModuleKind.None, ts.ModuleKind.NodeNext),\n    strict: provider.consumeBoolean(),\n  };\n}\n\nconst ignored = [\n  // TypeScript not interested: https://github.com/microsoft/TypeScript/issues/55480\n  \"maximum call stack size exceeded\",\n  \"cannot read\",\n  \"cannot create\",\n  \"expected\",\n  \"unexpected\",\n  \"invalid\",\n  \"unterminated\",\n  \"must be\",\n  \"incorrect\",\n  \"stream error\",\n  \"duplicate\",\n  \"the value\"\n];\n"
  },
  {
    "path": "projects/typescript/fuzz_scanner.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst ts = require('typescript');\n\nmodule.exports.fuzz = function(data) {\n  try {\n    const provider = new FuzzedDataProvider(data);\n\n    const languageVersion = provider.consumeIntegralInRange(0, 3);\n    const skipTrivia = provider.consumeBoolean();\n    const languageVariant = provider.consumeIntegralInRange(0, 2);\n    const text = provider.consumeString(provider.consumeIntegralInRange(0, 10000));\n    const onError = (_message) => { };\n    const start = provider.consumeIntegralInRange(0, text.length);\n    const length = provider.consumeIntegralInRange(0, text.length - start);\n\n    const scanner = ts.createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length);\n\n    while (scanner.scan() !== ts.SyntaxKind.EndOfFileToken) {\n      scanner.getToken();\n      scanner.getTokenText();\n      scanner.getTokenValue();\n      scanner.getTokenStart();\n      scanner.getTokenEnd();\n\n      if (provider.remainingBytes > 0 && provider.consumeProbabilityFloat() < 0.1) {\n        scanner.resetTokenState(provider.consumeIntegralInRange(0, text.length));\n      }\n\n    }\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.toLowerCase().indexOf(message) !== -1);\n}\n\nconst ignored = [\n  // TypeScript not interested: https://github.com/microsoft/TypeScript/issues/55480\n  \"maximum call stack size exceeded\",\n  \"expected\",\n  \"unexpected\",\n  \"invalid\",\n  \"unterminated\",\n  \"must be\",\n  \"incorrect\",\n  \"stream error\",\n  \"duplicate\",\n  \"the value\"\n];\n"
  },
  {
    "path": "projects/typescript/fuzz_transpile_module.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst { FuzzedDataProvider } = require('@jazzer.js/core');\nconst { getCompilerOptions } = require(\"./fuzz_util\");\nconst ts = require('typescript');\n\nmodule.exports.fuzz = function(data) {\n  const provider = new FuzzedDataProvider(data);\n  const input = provider.consumeRemainingAsString();\n  const transpileOptions = {\n    getCompilerOptions: () => getCompilerOptions(provider),\n  };\n\n  try {\n    ts.transpileModule(input, transpileOptions);\n  } catch (error) {\n    if (!ignoredError(error)) throw error;\n  }\n};\n\nfunction ignoredError(error) {\n  return !!ignored.find((message) => error.message.toLowerCase().indexOf(message) !== -1);\n}\n\nconst ignored = [\n  // TypeScript not interested: https://github.com/microsoft/TypeScript/issues/55480\n  \"maximum call stack size exceeded\",\n  \"expected\",\n  \"unexpected\",\n  \"invalid\",\n  \"cannot\",\n  \"unterminated\",\n  \"must be\",\n  \"incorrect\",\n  \"stream error\",\n  \"duplicate\",\n  \"the value\"\n];\n"
  },
  {
    "path": "projects/typescript/fuzz_util.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst ts = require(\"typescript\");\n\nmodule.exports = { getCompilerOptions };\nfunction getCompilerOptions(provider) {\n  return {\n    allowJs: provider.consumeBoolean(),\n    allowSyntheticDefaultImports: provider.consumeBoolean(),\n    allowUnreachableCode: provider.consumeBoolean(),\n    allowUnusedLabels: provider.consumeBoolean(),\n    alwaysStrict: provider.consumeBoolean(),\n    baseUrl: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    charset: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    checkJs: provider.consumeBoolean(),\n    declaration: provider.consumeBoolean(),\n    declarationDir: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    disableSizeLimit: provider.consumeBoolean(),\n    downlevelIteration: provider.consumeBoolean(),\n    emitBOM: provider.consumeBoolean(),\n    emitDecoratorMetadata: provider.consumeBoolean(),\n    experimentalDecorators: provider.consumeBoolean(),\n    forceConsistentCasingInFileNames: provider.consumeBoolean(),\n    importHelpers: provider.consumeBoolean(),\n    inlineSourceMap: provider.consumeBoolean(),\n    inlineSources: provider.consumeBoolean(),\n    isolatedModules: provider.consumeBoolean(),\n    jsx: getJsx(provider),\n    lib: [],\n    locale: provider.consumeString(provider.consumeIntegralInRange(0, 8)),\n    mapRoot: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    maxNodeModuleJsDepth: provider.consumeIntegralInRange(0, 100),\n    module: getModuleKind(provider),\n    moduleResolution: getModuleResolutionKind(provider),\n    newLine: provider.consumeBoolean() ? ts.NewLineKind.LineFeed : ts.NewLineKind.CarriageReturnLineFeed,\n    noEmit: provider.consumeBoolean(),\n    noEmitHelpers: provider.consumeBoolean(),\n    noEmitOnError: provider.consumeBoolean(),\n    noErrorTruncation: provider.consumeBoolean(),\n    noFallthroughCasesInSwitch: provider.consumeBoolean(),\n    noImplicitAny: provider.consumeBoolean(),\n    noImplicitReturns: provider.consumeBoolean(),\n    noImplicitThis: provider.consumeBoolean(),\n    noUnusedLocals: provider.consumeBoolean(),\n    noUnusedParameters: provider.consumeBoolean(),\n    noImplicitUseStrict: provider.consumeBoolean(),\n    noLib: provider.consumeBoolean(),\n    noResolve: provider.consumeBoolean(),\n    out: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    outDir: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    outFile: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    paths: {},\n    plugins: [],\n    preserveConstEnums: provider.consumeBoolean(),\n    preserveSymlinks: provider.consumeBoolean(),\n    project: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    reactNamespace: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    removeComments: provider.consumeBoolean(),\n    references: [],\n    rootDir: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    rootDirs: [],\n    skipLibCheck: provider.consumeBoolean(),\n    skipDefaultLibCheck: provider.consumeBoolean(),\n    sourceMap: provider.consumeBoolean(),\n    sourceRoot: provider.consumeString(provider.consumeIntegralInRange(0, 100)),\n    strict: provider.consumeBoolean(),\n    strictNullChecks: provider.consumeBoolean(),\n    suppressExcessPropertyErrors: provider.consumeBoolean(),\n    suppressImplicitAnyIndexErrors: provider.consumeBoolean(),\n    useDefineForClassFields: provider.consumeBoolean(),\n    target: getScriptTarget(provider),\n    traceResolution: provider.consumeBoolean(),\n    resolveJsonModule: provider.consumeBoolean(),\n    types: [],\n    typeRoots: []\n  }\n}\n\nfunction getJsx(provider) {\n  switch (provider.consumeIntegralInRange(0, 4)) {\n    case 0: return ts.JsxEmit.None;\n    case 1: return ts.JsxEmit.Preserve;\n    case 2: return ts.JsxEmit.ReactNative;\n    case 3: return ts.JsxEmit.React;\n    case 4: return provider.consumeString(provider.consumeIntegralInRange(0, 100));\n  }\n}\n\nfunction getModuleKind(provider) {\n  switch (provider.consumeIntegralInRange(0, 11)) {\n    case 0: return ts.ModuleKind.None;\n    case 1: return ts.ModuleKind.CommonJS;\n    case 2: return ts.ModuleKind.AMD;\n    case 3: return ts.ModuleKind.UMD;\n    case 4: return ts.ModuleKind.System;\n    case 5: return ts.ModuleKind.ES2015;\n    case 6: return ts.ModuleKind.ES2020;\n    case 7: return ts.ModuleKind.ES2022;\n    case 8: return ts.ModuleKind.ESNext;\n    case 9: return ts.ModuleKind.Node16;\n    case 10: return ts.ModuleKind.NodeNext;\n    case 11: return provider.consumeString(provider.consumeIntegralInRange(0, 100));\n  }\n}\n\nfunction getModuleResolutionKind(provider) {\n  switch (provider.consumeIntegralInRange(0, 5)) {\n    case 0: return ts.ModuleResolutionKind.Classic;\n    case 1: return ts.ModuleResolutionKind.NodeNext;\n    case 2: return ts.ModuleResolutionKind.Node16\n    case 3: return ts.ModuleResolutionKind.Node10;\n    case 4: return ts.ModuleResolutionKind.Bundler;\n    case 5: return provider.consumeString(provider.consumeIntegralInRange(0, 100));\n  }\n}\n\nfunction getScriptTarget(provider) {\n  switch (provider.consumeIntegralInRange(0, 10)) {\n    case 0: return ts.ScriptTarget.ESNext;\n    case 1: return ts.ScriptTarget.ES2022;\n    case 2: return ts.ScriptTarget.Latest;\n    case 3: return ts.ScriptTarget.ES3;\n    case 4: return ts.ScriptTarget.ES5;\n    case 5: return ts.ScriptTarget.ESNext;\n    case 6: return ts.ScriptTarget.JSON;\n    case 7: return ts.ScriptTarget.ES2015;\n    case 8: return ts.ScriptTarget.ES2016;\n    case 9: return ts.ScriptTarget.ES2017;\n    case 10: return provider.consumeString(provider.consumeIntegralInRange(0, 100));\n  }\n}\n\n"
  },
  {
    "path": "projects/typescript/project.yaml",
    "content": "homepage: https://www.typescriptlang.org/\nlanguage: javascript\nmain_repo: https://github.com/microsoft/typescript\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/typescript-example/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\n# For real projects, you would clone your repo in the next step.\nRUN mkdir -p $SRC/example\n\n# Ideally, you have already configured fuzz tests in your repo so that they\n# run (in Jazzer.js regression mode) as part of unit testing. Keeping the fuzz\n# tests in sync with the source code ensures that they are adjusted continue\n# to work after code changes. Here, we copy them into the example project directory.\nCOPY fuzz_explore_me.ts target.ts package.json tsconfig.json $SRC/example/\n\nWORKDIR $SRC/example\n"
  },
  {
    "path": "projects/typescript-example/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\n\n# Install Jazzer.js before building the code since use the fuzzed data provider\n# in the fuzz test\nnpm install --save-dev @jazzer.js/core\n\n# Compile TypeScript code.\nnpm run build\n\n# Build Fuzzers.\ncompile_javascript_fuzzer example dist/fuzz_explore_me.js --sync\n"
  },
  {
    "path": "projects/typescript-example/fuzz_explore_me.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////////\n\nimport { FuzzedDataProvider } from \"@jazzer.js/core\"\nimport { exploreMe } from \"./target\";\n\nexport function fuzz(data: Buffer) {\n\tconst fdp = new FuzzedDataProvider(data)\n\texploreMe(\n\t\tfdp.consumeIntegral(4),\n\t\tfdp.consumeIntegral(4),\n\t\tfdp.consumeRemainingAsString()\n\t)\n}\n"
  },
  {
    "path": "projects/typescript-example/package.json",
    "content": "{\n\t\"name\": \"jazzerjs-typescript-example\",\n\t\"version\": \"1.0.0\",\n\t\"description\": \"An example how to fuzz TypeScript projects with Jazzer.js\",\n\t\"scripts\": {\n\t\t\"build\": \"tsc\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@types/node\": \"^18.11.18\",\n\t\t\"typescript\": \"^4.7.4\"\n\t}\n}\n"
  },
  {
    "path": "projects/typescript-example/project.yaml",
    "content": "homepage: https://github.com/CodeIntelligenceTesting/jazzer.js\nlanguage: javascript\nmain_repo: https://github.com/CodeIntelligenceTesting/jazzer.js\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- none\nvendor_ccs:\n- yakdan@code-intelligence.com\n- norbert.schneider@code-intelligence.com\n- peter.samarin@code-intelligence.com\n"
  },
  {
    "path": "projects/typescript-example/target.ts",
    "content": "export function exploreMe(a: number, b: number, c: string ) {\n    if (a > 2000 &&\n        b > 20000 &&\n        b - a < 10000\n        && c === \"Hello World!\") {\n        throw Error(\"Crash!\")\n    }\n}"
  },
  {
    "path": "projects/typescript-example/tsconfig.json",
    "content": "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"ES2022\",\n\t\t\"module\": \"commonjs\",\n\t\t\"moduleResolution\": \"node\",\n\t\t\"allowJs\": true,\n\t\t\"checkJs\": true,\n\t\t\"rootDir\": \".\",\n\t\t\"outDir\": \"./dist\",\n\t\t\"esModuleInterop\": true,\n\t\t\"forceConsistentCasingInFileNames\": true,\n\t\t\"strict\": true,\n\t\t\"skipLibCheck\": true,\n\t\t\"declaration\": true,\n\t\t\"composite\": true,\n\t\t\"sourceMap\": true\n\t}\n}\n"
  },
  {
    "path": "projects/typing_extensions/Dockerfile",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/python/typing_extensions typing_extensions\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/typing_extensions\n"
  },
  {
    "path": "projects/typing_extensions/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/typing_extensions/fuzz_typing_extensions.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport json\nimport atheris\n\nfrom typing_extensions import (TypeVarTuple, Unpack, dataclass_transform,\n                               TypedDict)\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  s1 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024))\n  s2 = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024))\n  Tvt = TypeVarTuple(s1)\n  Tvt2 = TypeVarTuple(s2)\n  hash(Tvt)\n  list(Tvt)\n  repr(Tvt)\n\n  if s1 != s2:\n    try:\n      assert Unpack[Tvt] != Unpack[Tvt2]\n    except (SyntaxError, ValueError):\n      pass\n    try:\n      assert Unpack[s1] != Unpack[s2]\n    except (SyntaxError, ValueError):\n      pass\n\n  try:\n    d1 = json.loads(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 256)))\n    d2 = json.loads(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 256)))\n  except:\n    d1 = None\n    d2 = None\n  if isinstance(d1, dict) and isinstance(d2, dict):\n    if d1 != d2:\n      assert TypedDict('D1', d1) != TypedDict('D2', d2)\n    else:\n      assert TypedDict('D1', d1) == TypedDict('D2', d2)\n\n  dataclass_transform(eq_default=fdp.ConsumeBool(),\n                      order_default=fdp.ConsumeBool(),\n                      kw_only_default=fdp.ConsumeBool(),\n                      frozen_default=fdp.ConsumeBool(),\n                      kwargs={})\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/typing_extensions/project.yaml",
    "content": "homepage: https://github.com/python/typing_extensions\nlanguage: python\nmain_repo: https://github.com/python/typing_extensions\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/typst/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN rustup toolchain install nightly\nRUN git clone --depth 1 https://github.com/typst/typst.git typst\nWORKDIR typst\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/typst/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd tests/fuzz\n# Use the most recent nightly version available.\ncargo +nightly fuzz build -O --debug-assertions\n\nFUZZ_TARGET_OUTPUT_DIR=$SRC/typst/target/x86_64-unknown-linux-gnu/release \nfor f in src/bin/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/typst/project.yaml",
    "content": "homepage: \"https://typst.app/\"\nlanguage: rust\nprimary_contact: \"laurmaedje@googlemail.com\"\nmain_repo: \"https://github.com/typst/typst.git\"\nauto_ccs:\n  - nathaniel.brough@gmail.com\n  - tobiasschmitz2001@gmail.com\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/tyrus/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/eclipse-ee4j/tyrus tyrus\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/tyrus\n"
  },
  {
    "path": "projects/tyrus/UriTemplateParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.glassfish.tyrus.core.uri.internal.UriTemplateParser;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-11\n// Heuristic name: jvm-autofuzz-heuristics-11\n// Target method: [org.glassfish.tyrus.core.uri.internal.UriTemplateParser] public  <init>(java.lang.String) throws java.lang.IllegalArgumentException\npublic class UriTemplateParserFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      new UriTemplateParser(data.consumeRemainingAsString());\n    } catch (IllegalArgumentException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/tyrus/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nexclude=\"!docs,!samples,!samples/auction,!samples/cdi,!samples/chat,!samples/draw,\"\nexclude=$exclude\"!samples/echo-basic-auth,!samples/echo-https,!samples/echo,\"\nexclude=$exclude\"!samples/programmatic-echo,!samples/shared-collection,\"\nexclude=$exclude\"!samples/simplelife\"\n\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade \\\n    -pl \"$exclude\"\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./spi/target/tyrus-spi-$CURRENT_VERSION.jar\" $OUT/tyrus-spi.jar\ncp \"./client/target/tyrus-client-$CURRENT_VERSION.jar\" $OUT/tyrus-client.jar\ncp \"./core/target/tyrus-core-$CURRENT_VERSION.jar\" $OUT/tyrus.jar\n\nALL_JARS='tyrus-spi.jar tyrus-client.jar tyrus.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/tyrus/project.yaml",
    "content": "homepage: https://github.com/eclipse-ee4j/tyrus\nmain_repo: https://github.com/eclipse-ee4j/tyrus\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/u-boot/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n    device-tree-compiler \\\n    python3-pyelftools \\\n    flex \\\n    bison \\\n    bc \\\n    libssl-dev \\\n    libgnutls28-dev \\\n    swig\nRUN pip3 install jsonschema jinja2\nRUN git clone --depth 1 https://github.com/u-boot/u-boot.git $SRC/u-boot\nWORKDIR $SRC/u-boot\nCOPY efi_load_image.c $SRC/u-boot/test/fuzz/\nCOPY fit_image_load.c image_decomp.c $SRC/u-boot/test/fuzz/\nCOPY btrfs.c $SRC/u-boot/test/fuzz/\nCOPY oss-fuzz.patch $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/u-boot/btrfs.c",
    "content": "/* Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Fuzz test for BTRFS filesystem parser.\n */\n\n#include <command.h>\n#include <os.h>\n#include <test/fuzz.h>\n\n#define FUZZ_DISK_PATH \"/tmp/fuzz_btrfs.img\"\n\nstatic int fuzz_btrfs(const uint8_t *data, size_t size)\n{\n\tint fd;\n\n\tif (size < 512)\n\t\treturn 0;\n\n\tfd = os_open(FUZZ_DISK_PATH, OS_O_WRONLY | OS_O_CREAT | OS_O_TRUNC);\n\tif (fd < 0)\n\t\treturn 0;\n\tos_write(fd, data, size);\n\tos_close(fd);\n\n\trun_command(\"host bind 0 \" FUZZ_DISK_PATH, 0);\n\trun_command(\"ls host 0:0 /\", 0);\n\trun_command(\"host unbind 0\", 0);\n\n\treturn 0;\n}\nFUZZ_TEST(fuzz_btrfs, 0);\n"
  },
  {
    "path": "projects/u-boot/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/u-boot\n\n# 0. Patch u-boot source\ngit apply $SRC/oss-fuzz.patch\n\n# 1. Configure: sandbox + fuzz + all fuzzer target dependencies\nmake sandbox_defconfig CC=\"$CC\" HOSTCC=\"$CC\"\n./scripts/config --enable CONFIG_FUZZ\n./scripts/config --enable CONFIG_DM_FUZZING_ENGINE\n./scripts/config --enable CONFIG_FUZZING_ENGINE_SANDBOX\n./scripts/config --disable CONFIG_EFI_CAPSULE_AUTHENTICATE\n./scripts/config --disable CONFIG_LTO\n./scripts/config --disable CONFIG_OF_SEPARATE\n./scripts/config --enable CONFIG_OF_EMBED\n./scripts/config --set-str CONFIG_DEFAULT_DEVICE_TREE \"test\"\n# Decompressors\n./scripts/config --enable CONFIG_GZIP\n./scripts/config --enable CONFIG_BZIP2\n./scripts/config --enable CONFIG_LZMA\n./scripts/config --enable CONFIG_LZO\n./scripts/config --enable CONFIG_LZ4\n./scripts/config --enable CONFIG_ZSTD\n# Filesystems\n./scripts/config --enable CONFIG_FS_BTRFS\n./scripts/config --enable CONFIG_CMD_BTRFS\nmake olddefconfig CC=\"$CC\" HOSTCC=\"$CC\"\n\n# 2. Build u-boot sandbox\n#    NO_PYTHON=1 skips pylibfdt (_libfdt.so) meaning no shared libraries.\n#    CONFIG_BINMAN= prevents binman (needs pylibfdt) from running.\n#    -fintegrated-as avoids clang/gas assembler incompatibility.\n#    KCFLAGS passes $CFLAGS (which the OSS-Fuzz compile script populates\n#    with sanitizer and coverage flags) through to both compilation and\n#    the link command (the patch adds $(KCFLAGS) to cmd_u-boot__).\nmake -j$(nproc) CROSS_COMPILE=\"\" CC=\"$CC\" HOSTCC=\"$CC\" NO_PYTHON=1 \\\n    CONFIG_BINMAN= KCFLAGS=\"$CFLAGS -fintegrated-as\"\n\n# 3. Install all fuzzers (same binary, different names)\nFUZZERS=\"\n    fuzz_efi_load_image\n    fuzz_fit_image_load\n    fuzz_image_decomp\n    fuzz_btrfs\n\"\n\nfor fuzzer in $FUZZERS; do\n    cp u-boot $OUT/$fuzzer\n\n    cat > $OUT/$fuzzer.options <<EOF\n[libfuzzer]\ndetect_leaks=0\n[asan]\ndetect_leaks=0\nEOF\ndone\n\n"
  },
  {
    "path": "projects/u-boot/efi_load_image.c",
    "content": "/* Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Fuzz test for efi_load_image() - feeds random data as a PE image buffer\n * into the EFI image loader.\n */\n\n#include <efi_loader.h>\n#include <test/fuzz.h>\n\nstatic int fuzz_efi_load_image(const uint8_t *data, size_t size)\n{\n\tefi_handle_t image_handle = NULL;\n\n\tif (size == 0)\n\t\treturn 0;\n\n\t/* Initialize EFI subsystem on first call */\n\tif (efi_obj_list_initialized != EFI_SUCCESS)\n\t\tefi_init_obj_list();\n\n\t/* Call efi_load_image with fuzz data as a PE image buffer */\n\tEFI_CALL(efi_load_image(false, efi_root, NULL,\n\t\t\t\t(void *)data, size, &image_handle));\n\n\t/* Clean up loaded image to prevent memory accumulation */\n\tif (image_handle)\n\t\tEFI_CALL(efi_unload_image(image_handle));\n\n\treturn 0;\n}\nFUZZ_TEST(fuzz_efi_load_image, 0);\n"
  },
  {
    "path": "projects/u-boot/fit_image_load.c",
    "content": "/* Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Fuzz test for fit_image_load() - FIT image loader.\n */\n\n#include <image.h>\n#include <mapmem.h>\n#include <linux/libfdt.h>\n#include <test/fuzz.h>\n\nstatic int fuzz_fit_image_load(const uint8_t *data, size_t size)\n{\n\tstruct bootm_headers images = {};\n\tconst char *fit_uname = NULL;\n\tconst char *fit_uname_config = NULL;\n\tulong data_ptr, len;\n\tulong addr;\n\n\tif (size < sizeof(struct fdt_header))\n\t\treturn 0;\n\n\t/* Quick check: is it a valid FDT? FIT images are FDT blobs. */\n\tif (fdt_check_header(data) != 0)\n\t\treturn 0;\n\n\t/* Map fuzz data into u-boot's address space */\n\taddr = map_to_sysmem((void *)data);\n\n\tfit_image_load(&images, addr, &fit_uname, &fit_uname_config,\n\t\t       IH_ARCH_DEFAULT, IH_TYPE_KERNEL, 0,\n\t\t       FIT_LOAD_IGNORED, &data_ptr, &len);\n\n\treturn 0;\n}\nFUZZ_TEST(fuzz_fit_image_load, 0);\n"
  },
  {
    "path": "projects/u-boot/image_decomp.c",
    "content": "/* Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Fuzz test for image_decomp() - multi-format decompressor.\n */\n\n#include <image.h>\n#include <malloc.h>\n#include <test/fuzz.h>\n\n#define DECOMP_BUF_SIZE (1 * 1024 * 1024)  /* 1 MB output limit */\n\nstatic void *decomp_buf;\n\nstatic int fuzz_image_decomp(const uint8_t *data, size_t size)\n{\n\tulong load_end;\n\tint comp;\n\n\tif (size < 2)\n\t\treturn 0;\n\n\t/* First byte selects compression type */\n\tcomp = (data[0] % (IH_COMP_COUNT - 1)) + 1;\n\tdata++;\n\tsize--;\n\n\tif (!decomp_buf) {\n\t\tdecomp_buf = malloc(DECOMP_BUF_SIZE);\n\t\tif (!decomp_buf)\n\t\t\treturn 0;\n\t}\n\n\timage_decomp(comp, 0, 0, IH_TYPE_KERNEL,\n\t\t     decomp_buf, (void *)data, size,\n\t\t     DECOMP_BUF_SIZE, &load_end);\n\n\treturn 0;\n}\nFUZZ_TEST(fuzz_image_decomp, 0);\n"
  },
  {
    "path": "projects/u-boot/oss-fuzz.patch",
    "content": "diff --git a/Kconfig b/Kconfig\nindex ce25ea24..05614884 100644\n--- a/Kconfig\n+++ b/Kconfig\n@@ -190,7 +190,6 @@ config FUZZ\n \tbool \"Enable fuzzing\"\n \tdepends on CC_IS_CLANG\n \tdepends on DM_FUZZING_ENGINE\n-\tselect ASAN\n \thelp\n \t  Enables the fuzzing infrastructure to generate fuzzing data and run\n           fuzz tests.\ndiff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk\nindex 275661a1..2f7c54b7 100644\n--- a/arch/sandbox/config.mk\n+++ b/arch/sandbox/config.mk\n@@ -27,12 +27,14 @@ cmd_u-boot__ = \\\n \t$(CC) -o $@ -Wl,-T u-boot.lds $(u-boot-init) \\\n \t$(KBUILD_LDFLAGS:%=-Wl,%) \\\n \t$(SANITIZERS) \\\n+\t$(KCFLAGS) \\\n \t$(LTO_FINAL_LDFLAGS) \\\n \t-Wl,--whole-archive \\\n \t\t$(u-boot-main) \\\n \t\t$(u-boot-keep-syms-lto) \\\n \t-Wl,--no-whole-archive \\\n-\t$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -Wl,--gc-sections\n+\t$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -Wl,--gc-sections \\\n+\t-Wl,--allow-multiple-definition\n \n cmd_u-boot-spl = (cd $(obj) && \\\n \ttouch $(patsubst $(obj)/%,%,$(u-boot-spl-main)) && \\\ndiff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c\nindex e48eb23c..00258af7 100644\n--- a/arch/sandbox/cpu/os.c\n+++ b/arch/sandbox/cpu/os.c\n@@ -1129,17 +1129,26 @@ void os_relaunch(char *argv[])\n static void *fuzzer_thread(void * ptr)\n {\n \tchar cmd[64];\n-\tchar *argv[5] = {\"./u-boot\", \"-T\", \"-c\", cmd, NULL};\n+\tchar *argv[6] = {\"u-boot\", \"-L\", \"0\", \"-c\", cmd, NULL};\n \tconst char *fuzz_test;\n \n \t/* Find which test to run from an environment variable. */\n \tfuzz_test = getenv(\"UBOOT_SB_FUZZ_TEST\");\n+\tif (!fuzz_test)\n+\t\tfuzz_test = program_invocation_short_name;\n \tif (!fuzz_test)\n \t\tos_abort();\n \n \tsnprintf(cmd, sizeof(cmd), \"fuzz %s\", fuzz_test);\n \n-\tsandbox_main(4, argv);\n+\t/* Suppress u-boot's stdout to keep libFuzzer's stderr output readable. */\n+\tint devnull = open(\"/dev/null\", O_WRONLY);\n+\tif (devnull >= 0) {\n+\t\tdup2(devnull, STDOUT_FILENO);\n+\t\tclose(devnull);\n+\t}\n+\n+\tsandbox_main(5, argv);\n \tos_abort();\n \treturn NULL;\n }\ndiff --git a/test/fuzz/Makefile b/test/fuzz/Makefile\nindex 0a8f3d12..52792c05 100644\n--- a/test/fuzz/Makefile\n+++ b/test/fuzz/Makefile\n@@ -6,3 +6,7 @@\n \n obj-$(CONFIG_$(PHASE_)CMDLINE) += cmd_fuzz.o\n obj-$(CONFIG_VIRTIO_SANDBOX) += virtio.o\n+obj-$(CONFIG_EFI_LOADER) += efi_load_image.o\n+obj-$(CONFIG_FIT) += fit_image_load.o\n+obj-y += image_decomp.o\n+obj-$(CONFIG_FS_BTRFS) += btrfs.o\n"
  },
  {
    "path": "projects/u-boot/project.yaml",
    "content": "homepage: \"https://u-boot.readthedocs.io/\"\nlanguage: c\nprimary_contact: \"trini@konsulko.com\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nmain_repo: \"https://github.com/u-boot/u-boot\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/u-root/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1  https://github.com/u-root/u-root\nWORKDIR u-root\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/u-root/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# cpio pkg  \ncd $SRC/u-root/pkg/cpio\n#go mod init cpio\nprintf \"package cpio\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\ngo mod tidy\ngo mod vendor\n\ncp $SRC/u-root/pkg/cpio/testdata/fuzz/*.dict $SRC/u-root/pkg/cpio/testdata/fuzz/*.options $OUT\n\n## FuzzReadWriteNewc\nzip -j $OUT/fuzz_read_write_newc_seed_corpus.zip $SRC/u-root/pkg/cpio/testdata/fuzz/corpora/*\ncompile_native_go_fuzzer $SRC/u-root/pkg/cpio FuzzReadWriteNewc fuzz_read_write_newc\n\n## FuzzWriteReadInMemArchive\ncompile_native_go_fuzzer $SRC/u-root/pkg/cpio FuzzWriteReadInMemArchive fuzz_write_read_in_mem_archive\n\n# grub pkg  \ncd $SRC/u-root/pkg/boot/grub\n#go mod init grub\nprintf \"package grub\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\ngo mod tidy\n\ncp $SRC/u-root/pkg/boot/grub/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/grub/testdata/fuzz/*.options $OUT\n\n## FuzzParseEnvFile\ncompile_native_go_fuzzer $SRC/u-root/pkg/boot/grub FuzzParseEnvFile fuzz_parse_env_file\n\n## FuzzParseGrubConfig\nfind $SRC/u-root/pkg/boot/grub/testdata_new -name \"grub.cfg\" -exec zip $OUT/fuzz_parse_grub_config_seed_corpus.zip {} +\ncompile_native_go_fuzzer $SRC/u-root/pkg/boot/grub FuzzParseGrubConfig fuzz_parse_grub_config\n\n# localboot pkg\n# cd $SRC/u-root/cmds/boot/localboot\n#go mod init localboot\n# printf \"package main\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\n# go mod tidy\n\n# cp $SRC/u-root/pkg/boot/grub/testdata/fuzz/*.dict $SRC/u-root/cmds/boot/localboot/testdata/fuzz/*.options $OUT\n\n# ## FuzzParseGrubCfg\n# find $SRC/u-root/pkg/boot/grub/testdata_new -name \"grub.cfg\" -exec zip $OUT/fuzz_parse_grub_cfg_seed_corpus.zip {} +\n# compile_native_go_fuzzer $SRC/u-root/cmds/boot/localboot FuzzParseGrubCfg fuzz_parse_grub_cmd_cfg\n\n# syslinux pkg\ncd $SRC/u-root/pkg/boot/syslinux\n#go mod init syslinux\nprintf \"package syslinux\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\ngo mod tidy\n\ncp $SRC/u-root/pkg/boot/syslinux/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/syslinux/testdata/fuzz/*.options $OUT\n\n## FuzzParseSyslinuxConfig\nfind $SRC/u-root/pkg/boot/syslinux/testdata -name \"isolinux.cfg\" -exec zip $OUT/fuzz_parse_syslinux_config_seed_corpus.zip {} +\ncompile_native_go_fuzzer $SRC/u-root/pkg/boot/syslinux FuzzParseSyslinuxConfig fuzz_parse_syslinux_config\n\n# gosh cmd\n# cd $SRC/u-root/cmds/core/gosh\n# #go mod init gosh\n# go get github.com/u-root/prompt@v0.0.0-20221110083427-a2ad3c8339a8\n# printf \"package main\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\n# go mod tidy\n\n# cp $SRC/u-root/cmds/core/gosh/testdata/fuzz/*.dict $SRC/u-root/cmds/core/gosh/testdata/fuzz/*.options $OUT\n\n# ## FuzzRun\n# find $SRC/u-root/cmds/core/gosh/testdata/fuzz/corpora -name \"*.seed\" -exec zip $OUT/fuzz_gosh_run_seed_corpus.zip {} +\n# compile_native_go_fuzzer $SRC/u-root/cmds/core/gosh FuzzRun fuzz_gosh_run\n\n# esxi pkg\ncd $SRC/u-root/pkg/boot/esxi\n#go mod init esxi\nprintf \"package esxi\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\ngo mod tidy\ncp $SRC/u-root/pkg/boot/esxi/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/esxi/testdata/fuzz/*.options $OUT\n\n## FuzzParse\nfind $SRC/u-root/pkg/boot/esxi/testdata -name \"*.cfg\" -exec zip $OUT/fuzz_esxi_parse_seed_corpus.zip {} +\ncompile_native_go_fuzzer $SRC/u-root/pkg/boot/esxi FuzzParse fuzz_esxi_parse\n\n# ipxe pkg\ncd $SRC/u-root/pkg/boot/netboot/ipxe\n#go mod init ipxe\nprintf \"package ipxe\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\n\nsed 's/log\\: ulogtest\\.Logger/\\/\\/log\\: ulogtest\\.Logger/g' -i $SRC/u-root/pkg/boot/netboot/ipxe/fuzz_test.go\nsed 's/c\\.log\\.Printf/\\/\\/c\\.log\\.Printf/g' -i $SRC/u-root/pkg/boot/netboot/ipxe/ipxe.go\nsed 's/\"github\\.com\\/u-root\\/u-root\\/pkg\\/ulog\\/ulogtest/\\/\\/\"github.com\\/u-root\\/u-root\\/pkg\\/ulog\\/ulogtest/g' -i $SRC/u-root/pkg/boot/netboot/ipxe/fuzz_test.go\n\ngo mod tidy\n\ncp $SRC/u-root/pkg/boot/netboot/ipxe/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/netboot/ipxe/testdata/fuzz/*.options $OUT\n\n## FuzzParseIpxeConfig\nfind $SRC/u-root/pkg/boot/netboot/ipxe/testdata/fuzz/corpora -name \"*.seed\" -exec zip $OUT/fuzz_ipxe_parse_config_seed_corpus.zip {} +\ncompile_native_go_fuzzer $SRC/u-root/pkg/boot/netboot/ipxe FuzzParseIpxeConfig fuzz_ipxe_parse_config\n\n# smbios pkg\n# cd $SRC/u-root/pkg/smbios\n# go mod init smbios\n# printf \"package smbios\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\n# go mod tidy\n# cp $SRC/u-root/pkg/smbios/testdata/fuzz/*.dict $SRC/u-root/pkg/smbios/testdata/fuzz/*.options $OUT\n\n# ## FuzzParseInfo\n# find $SRC/u-root/pkg/smbios/testdata -name \"*.bin\" -exec zip $OUT/fuzz_smbios_parse_info_seed_corpus.zip {} +\n# compile_native_go_fuzzer $SRC/u-root/pkg/smbios FuzzParseInfo fuzz_smbios_parse_info\n\n# ip cmd\n# cd $SRC/u-root/cmds/core/ip\n# go mod init ip\n# printf \"package main\\nimport _ \\\"github.com/AdamKorcz/go-118-fuzz-build/testing\\\"\\n\" > registerfuzzdep.go\n# go mod tidy\n# cp $SRC/u-root/cmds/core/ip/testdata/fuzz/*.dict $SRC/u-root/cmds/core/ip/testdata/fuzz/*.options $OUT\n\n# ## FuzzIPCmd\n# find $SRC/u-root/cmds/core/ip/testdata/fuzz/corpora -name \"*.seed\" -exec zip $OUT/fuzz_ip_cmd_seed_corpus.zip {} +\n# compile_native_go_fuzzer $SRC/u-root/cmds/core/ip FuzzIPCmd fuzz_ip_cmd\n"
  },
  {
    "path": "projects/u-root/project.yaml",
    "content": "homepage: \"https://u-root.org/\"\nmain_repo: \"https://github.com/u-root/u-root.git\"\nprimary_contact: \"rminnich@gmail.com\"\nauto_ccs:\n  - \"fabian.wienand@9elements.com\"\nlanguage: go\narchitectures:\n  - x86_64\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/ua-parser-js/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\n\nCOPY build.sh $SRC/\n\n# For real projects, you would clone your repo in the next step.\n#RUN mkdir -p $SRC/example\nRUN git clone https://github.com/faisalman/ua-parser-js\n\n# Ideally, you have already configured fuzz tests in your repo so that they\n# run (in Jazzer.js regression mode) as part of unit testing. Keeping the fuzz\n# tests in sync with the source code ensures that they are adjusted continue\n# to work after code changes. Here, we copy them into the example project directory.\n#COPY fuzz_string_compare.js fuzz_promise.js fuzz_value_profiling.js package.json $SRC/example/\n\n#WORKDIR $SRC/example\nWORKDIR $SRC/ua-parser-js"
  },
  {
    "path": "projects/ua-parser-js/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Install dependencies.\nnpm install\n\n# Install Jazzer.js\nnpm install --save-dev @jazzer.js/core\n\n# Build Fuzzers.\n#compile_javascript_fuzzer example fuzz_promise.js\n#compile_javascript_fuzzer example fuzz_string_compare.js --sync\n#compile_javascript_fuzzer example fuzz_value_profiling.js --sync\ncompile_javascript_fuzzer ua-parser-js test/jazzer-fuzz-test.js --sync"
  },
  {
    "path": "projects/ua-parser-js/project.yaml",
    "content": "homepage: https://github.com/faisalman/ua-parser-js\nlanguage: javascript\nmain_repo: https://github.com/faisalman/ua-parser-js.git\nprimary_contact: fyzlman@gmail.com\nfuzzing_engines:\n- libfuzzer\nsanitizers: \n- none\n"
  },
  {
    "path": "projects/uint256/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\n\nRUN git clone --depth 1 https://github.com/holiman/uint256.git uint256\nRUN cp uint256/oss-fuzz.sh $SRC/build.sh\n\nWORKDIR $SRC/uint256\n"
  },
  {
    "path": "projects/uint256/project.yaml",
    "content": "homepage: \"https://github.com/holiman/uint256\"\nlanguage: go\nprimary_contact: \"martin.swende@ethereum.org\"\nauto_ccs:\n  - \"pawel@ethereum.org\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/holiman/uint256.git'\n"
  },
  {
    "path": "projects/ujson/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN pip3 install hypothesis\n\nRUN git clone \\\n\t--depth 1 \\\n\t--branch main \\\n\thttps://github.com/ultrajson/ultrajson.git\n\nWORKDIR ultrajson\n\nCOPY build.sh json_differential_fuzzer.py ujson_fuzzer.py hypothesis_structured_fuzzer.py $SRC/\n"
  },
  {
    "path": "projects/ujson/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/ujson/hypothesis_structured_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2021 Zac Hatfield-Dodds\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"This fuzzer is an example harness using Hypothesis for structured inputs.\n\nIt would be possible, though more difficult, to write this test in terms\nof Atheris' `FuzzedDataProvider` instead of Hypothesis strategies.\n\nAs well as defining structured inputs however, the call to\n`test_ujson_roundtrip()` will replay, deduplicate, and minimize any known\nfailing examples from previous runs - which is great when debugging.\nHypothesis uses a separate cache to Atheris/LibFuzzer seeds, so this is\nstrictly complementary to your traditional fuzzing workflow.\n\nFor more details on Hypothesis, see:\nhttps://hypothesis.readthedocs.io/en/latest/data.html\nhttps://hypothesis.readthedocs.io/en/latest/details.html#use-with-external-fuzzers\n\"\"\"\n\nimport sys\nimport atheris\nimport ujson\nfrom hypothesis import given, strategies as st\n\n# We could define all these inline within the call to @given(),\n# but it's a bit easier to read if we name them here instead.\nJSON_ATOMS = st.one_of(\n    st.none(),\n    st.booleans(),\n    st.integers(min_value=-(2 ** 63), max_value=2 ** 63 - 1),\n    st.floats(allow_nan=False, allow_infinity=False),\n    st.text(),\n)\nJSON_OBJECTS = st.recursive(\n    base=JSON_ATOMS,\n    extend=lambda inner: st.lists(inner) | st.dictionaries(st.text(), inner),\n)\nUJSON_ENCODE_KWARGS = {\n    \"ensure_ascii\": st.booleans(),\n    \"encode_html_chars\": st.booleans(),\n    \"escape_forward_slashes\": st.booleans(),\n    \"sort_keys\": st.booleans(),\n    \"indent\": st.integers(0, 20),\n}\n\n\n@given(obj=JSON_OBJECTS, kwargs=st.fixed_dictionaries(UJSON_ENCODE_KWARGS))\n@atheris.instrument_func\ndef test_ujson_roundtrip(obj, kwargs):\n    \"\"\"Check that all JSON objects round-trip regardless of other options.\"\"\"\n    assert obj == ujson.decode(ujson.encode(obj, **kwargs))\n\n\nif __name__ == \"__main__\":\n    # Running `pytest hypothesis_structured_fuzzer.py` will replay, deduplicate,\n    # and minimize any failures discovered by earlier runs or by OSS-Fuzz, or\n    # briefly search for new failures if none are known.\n    # Or, when running via OSS-Fuzz, we'll execute it via the fuzzing hook:\n    atheris.Setup(sys.argv, atheris.instrument_func(test_ujson_roundtrip.hypothesis.fuzz_one_input))\n    atheris.Fuzz()\n"
  },
  {
    "path": "projects/ujson/json_differential_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\" An example native JSON vs uJSON differential fuzzer.\n\nThis fuzzer looks for differences between the built-in json library and the\nnative ujson library. The ujson library should be built for coverage (see\nbuild_install_ujson.sh), and the Python fuzzer should be executed under ASAN.\nAs an example:\n    LD_PRELOAD=\"/usr/lib/llvm-9/lib/clang/9.0.1/lib/linux/libclang_rt.asan-x86_64.so\n    $(python3 -c \"import atheris; print(atheris.path())\")\" python3\n    ./json_differential_fuzzer.py -detect_leaks=0\n\nThis fuzzer has found a bug with inconsistent handling of integers with\ntoo-high magnitude. uJSON sometimes refuses to process numbers that are too far\nfrom 0 with \"Value is too big!\" or the equivalent for values that are too\nnegative. However, other times it happily processes them with two's compliment\nmod. As an example, it refuses to parse \"-9223372036854775809\" (the first\ninteger not representable in a 64-bit signed number) with \"Value is too small\";\nbut it will happily parse \"-80888888888888888888\", a significantly more negative\nnumber. However, it parses it as -9223372036854775808. The JSON spec\n(https://tools.ietf.org/html/rfc7159#section-6) \"allows implementations to set\nlimits on the range and precision of numbers accepted\", so failing to parse\nvalues that are too big or too small is techincally fine; however,\nmisinterpreting them is not.\n\"\"\"\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  import json\n  import ujson\n\n\n@atheris.instrument_func\ndef ClearAllIntegers(data):\n  \"\"\"Used to prevent known bug; sets all integers in data recursively to 0.\"\"\"\n  if type(data) == int:\n    return 0\n  if type(data) == list:\n    for i in range(0, len(data)):\n      data[i] = ClearAllIntegers(data[i])\n  if type(data) == dict:\n    for k, v in data:\n      data[k] = ClearAllIntegers(v)\n  return data\n\n\n@atheris.instrument_func\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  original = fdp.ConsumeUnicode(sys.maxsize)\n\n  try:\n    ujson_data = ujson.loads(original)\n    json_data = json.loads(original)\n  except Exception as e:\n    # It would be interesting to enforce that if one of the libraries throws an\n    # exception, the other does too. However, uJSON accepts many invalid inputs\n    # that are uninteresting, such as \"00\". So, that is not done.\n    return\n\n  # Uncomment these lines to ignore the errors described in the docstring of\n  # this file.\n  # json_data = ClearAllIntegers(json_data)\n  # ujson_data = ClearAllIntegers(ujson_data)\n\n  json_dumped = json.dumps(json_data)\n  ujson_dumped = json.dumps(ujson_data)\n\n  if json_dumped != ujson_dumped:\n    raise RuntimeError(\n        \"Decoding/encoding disagreement!\\nInput: %s\\nJSON data: %s\\nuJSON data: %s\\nJSON-dumped: %s\\nuJSON-dumped: %s\\n\"\n        % (original, json_data, ujson_data, json_dumped, ujson_dumped))\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/ujson/project.yaml",
    "content": "homepage: \"https://github.com/ultrajson/ultrajson\"\nmain_repo: \"https://github.com/ultrajson/ultrajson\"\nlanguage: python\n# TODO(mbarbella): Reach out to project maintainers for a better primary contact.\nprimary_contact: \"mbarbella@google.com\"\nauto_ccs:\n  - \"ipudney@google.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n  - undefined\n"
  },
  {
    "path": "projects/ujson/ujson_fuzzer.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"This fuzzer is an example of native extension fuzzing with coverage.\n\nThis requires that the fuzzer be built with coverage:\nsee build_install_ujson.sh.\nThe fuzzer should then be executed under ASAN.\n\nAs an example, this is the run command under the author's machine:\n    LD_PRELOAD=\"/usr/lib/llvm-9/lib/clang/9.0.1/lib/linux/libclang_rt.asan-x86_64.so\n    $(python3 -c \"import atheris; print(atheris.path())\")\" python3\n    ./ujson_fuzzer.py -detect_leaks=0\n\nThis fuzzer is provided mainly as an example for how to deal with native\ncoverage.\n\"\"\"\n\nimport sys\nimport atheris\nimport ujson\n\n\ndef TestOneInput(input_bytes):\n  fdp = atheris.FuzzedDataProvider(input_bytes)\n  original = fdp.ConsumeUnicode(sys.maxsize)\n\n  try:\n    ujson_data = ujson.loads(original)\n  except ValueError:\n    return\n\n  # We make sure there's no error in encoding, but we don't actually compare\n  # (encoded == original) because it's not entirely preserving. For example,\n  # it does not preserve whitespace.\n  encoded = ujson.dumps(ujson_data)\n  del encoded\n\n\ndef main():\n  # Since everything interesting in this fuzzer is in native code, we can\n  # disable Python coverage to improve performance and reduce coverage noise.\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=False)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/unblob/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone https://github.com/onekey-sec/unblob\n\nRUN apt-get update && apt-get install build-essential libssl-dev libffi-dev pkg-config python3-dev cargo -y\nRUN python3 -m pip install --upgrade pip\nRUN curl https://sh.rustup.rs -sSf | sh -s -- -y\n\nENV PATH=\"/root/.cargo/bin:${PATH}\"\nRUN rustup install nightly\nRUN rustup default nightly\n\nRUN unblob/install-deps.sh\nRUN python3 -m pip install ./unblob\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/unblob\n"
  },
  {
    "path": "projects/unblob/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip cache purge\n\nunset RUSTFLAGS\nunset CXXFLAGS\nunset CFLAGS\npython3 -m pip install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  fuzz_target=$(basename $fuzzer .py)\n  find ${SRC}/unblob/tests/integration -path '*/__input__/*' -type f -print | zip $OUT/${fuzz_target}_seed_corpus.zip -@\n  compile_python_fuzzer $fuzzer --hidden-import=_cffi_backend\ndone\n"
  },
  {
    "path": "projects/unblob/project.yaml",
    "content": "homepage: https://unblob.org\nmain_repo: https://github.com/onekey-sec/unblob\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nprimary_contact: kaiserquentin@gmail.com\nvendor_ccs:\n- research@onekey.com\n"
  },
  {
    "path": "projects/unbound/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make libtool libssl-dev libexpat-dev wget flex bison\nRUN git clone --depth=1 https://github.com/NLnetLabs/unbound unbound\nWORKDIR unbound\nCOPY parse_packet_fuzzer.c .\nCOPY fuzz_1.c .\nCOPY fuzz_2.c .\nCOPY fuzz_3.c .\nCOPY fuzz_4.c .\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/unbound/build.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# util/storage/lookup3.c has some code that triggers the address sanitizer, but\n# according to a comment is OK. -DVALGRIND turns on an alternate version of that\n# code.\nCFLAGS=\"${CFLAGS} -DVALGRIND=1\"\n./configure\nmake -j6 all unittest\n\n$CC $CFLAGS -I. -DSRCDIR=. -c -o parse_packet_fuzzer.o parse_packet_fuzzer.c\n$CC $CFLAGS -I. -DSRCDIR=. -c -o fuzz_1.o fuzz_1.c\n$CC $CFLAGS -I. -DSRCDIR=. -c -o fuzz_2.o fuzz_2.c\n$CC $CFLAGS -I. -DSRCDIR=. -c -o fuzz_3.o fuzz_3.c\n$CC $CFLAGS -I. -DSRCDIR=. -c -o fuzz_4.o fuzz_4.c\n\n# get the LIBOBJS with the replaced functions needed for linking.\nLIBOBJS=`make --eval 'echolibobjs: ; @echo \"$(LIBOBJS)\"' echolibobjs`\n\nOBJECTS_TO_LINK=\"dns.o infra.o rrset.o dname.o \\\n  msgencode.o as112.o msgparse.o msgreply.o packed_rrset.o iterator.o \\\n  iter_delegpt.o iter_donotq.o iter_fwd.o iter_hints.o iter_priv.o \\\n  iter_resptype.o iter_scrub.o iter_utils.o localzone.o mesh.o modstack.o view.o \\\n  outbound_list.o alloc.o config_file.o configlexer.o configparser.o \\\n  fptr_wlist.o edns.o locks.o log.o mini_event.o module.o net_help.o random.o \\\n  rbtree.o regional.o rtt.o dnstree.o lookup3.o lruhash.o slabhash.o \\\n  tcp_conn_limit.o timehist.o tube.o winsock_event.o autotrust.o val_anchor.o \\\n  validator.o val_kcache.o val_kentry.o val_neg.o val_nsec3.o val_nsec.o \\\n  val_secalgo.o val_sigcrypt.o val_utils.o dns64.o authzone.o \\\n  respip.o netevent.o listen_dnsport.o outside_network.o ub_event.o keyraw.o \\\n  sbuffer.o wire2str.o parse.o parseutil.o rrdef.o str2wire.o libunbound.o \\\n  libworker.o context.o rpz.o proxy_protocol.o timeval_func.o rfc_1982.o \\\n  siphash.o\"\n\n$CXX $CXXFLAGS -std=c++11 \\\n  $LIB_FUZZING_ENGINE \\\n  -lssl -lcrypto -pthread \\\n  -o $OUT/parse_packet_fuzzer \\\n  parse_packet_fuzzer.o \\\n  $OBJECTS_TO_LINK \\\n  $LIBOBJS\n\n$CXX $CXXFLAGS -std=c++11 \\\n  $LIB_FUZZING_ENGINE \\\n  -lssl -lcrypto -pthread \\\n  -o $OUT/fuzz_1_fuzzer \\\n  fuzz_1.o \\\n  $OBJECTS_TO_LINK \\\n  $LIBOBJS\n\n$CXX $CXXFLAGS -std=c++11 \\\n  $LIB_FUZZING_ENGINE \\\n  -lssl -lcrypto -pthread \\\n  -o $OUT/fuzz_2_fuzzer \\\n  fuzz_2.o \\\n  $OBJECTS_TO_LINK \\\n  $LIBOBJS\n\n$CXX $CXXFLAGS -std=c++11 \\\n  $LIB_FUZZING_ENGINE \\\n  -lssl -lcrypto -pthread \\\n  -o $OUT/fuzz_3_fuzzer \\\n  fuzz_3.o \\\n  $OBJECTS_TO_LINK \\\n  $LIBOBJS\n\n$CXX $CXXFLAGS -std=c++11 \\\n  $LIB_FUZZING_ENGINE \\\n  -lssl -lcrypto -pthread \\\n  -o $OUT/fuzz_4_fuzzer \\\n  fuzz_4.o \\\n  $OBJECTS_TO_LINK \\\n  $LIBOBJS\n\nwget --directory-prefix $OUT https://github.com/jsha/unbound/raw/fuzzing-corpora/testdata/parse_packet_fuzzer_seed_corpus.zip\n"
  },
  {
    "path": "projects/unbound/fuzz_1.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * unbound-fuzzme.c - parse a packet provided on stdin (for fuzzing).\n *\n */\n#include \"config.h\"\n#include \"util/regional.h\"\n#include \"util/module.h\"\n#include \"util/config_file.h\"\n#include \"iterator/iterator.h\"\n#include \"iterator/iter_priv.h\"\n#include \"iterator/iter_scrub.h\"\n#include \"util/log.h\"\n#include \"sldns/sbuffer.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {\n  log_init(\"/tmp/foo\", 0, NULL);\n  char *bin = buf;\n  struct regional* reg;\n\n  struct sldns_buffer *pkt = sldns_buffer_new(1);\n  sldns_buffer_new_frm_data(pkt, bin, len);\n\n  reg = regional_create();\n\n  struct msg_parse msg;\n  struct edns_data edns;\n  memset(&msg, 0, sizeof(struct msg_parse));\n  memset(&edns, 0, sizeof(edns));\n  if (parse_packet(pkt, &msg, reg) != LDNS_RCODE_NOERROR) {    \n    goto out;\n  }\n  if (parse_extract_edns_from_response_msg(&msg, &edns, reg) != LDNS_RCODE_NOERROR) {\n    goto out;\n  }\n\n\n  struct query_info qinfo_out;\n  memset(&qinfo_out, 0, sizeof(struct query_info));\n  qinfo_out.qname = (unsigned char *) \"\\03nic\\02de\";\n  uint8_t *peter = (unsigned char *) \"\\02de\";   // zonename  \n  struct module_env env;\n  memset(&env, 0, sizeof(struct module_env));\n  struct config_file cfg;\n  memset(&cfg, 0, sizeof(struct config_file));\n  cfg.harden_glue = 1;    // crashes now, want to remove that later\n  env.cfg = &cfg;\n\n  struct iter_env ie;\n  memset(&ie, 0, sizeof(struct iter_env));\n\n  struct iter_priv priv;\n  memset(&priv, 0, sizeof(struct iter_priv));\n  ie.priv = &priv;\n\n  struct module_qstate qstate;\n  memset(&qstate, 0, sizeof(struct module_qstate));\n  qstate.env = &env;\n  qstate.region = reg;\n\n  scrub_message(pkt, &msg, &qinfo_out, peter, reg, &env, &qstate, &ie);\nout:\n  regional_destroy(reg);\n  sldns_buffer_free(pkt);\n  return 0;\n}\n"
  },
  {
    "path": "projects/unbound/fuzz_2.c",
    "content": "#include \"config.h\"\n#include \"sldns/sbuffer.h\"\n#include \"sldns/wire2str.h\"\n#include \"util/data/dname.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *bin, size_t nr) {\n  char *bout;\n  uint8_t *a;\n  char *b;\n  size_t bl;\n  size_t al;\n  size_t len;\n\n  if (nr > 2) {\n    len = bin[0] & 0xff;  // want random sized output buf\n    bout = malloc(len);\n    nr--;\n    bin++;\n    b = bout; bl = len; sldns_wire2str_edns_subnet_print(&b, &bl, bin, nr);\n    b = bout; bl = len; sldns_wire2str_edns_n3u_print(&b, &bl, bin, nr);\n    b = bout; bl = len; sldns_wire2str_edns_dhu_print(&b, &bl, bin, nr);\n    b = bout; bl = len; sldns_wire2str_edns_dau_print(&b, &bl, bin, nr);\n    b = bout; bl = len; sldns_wire2str_edns_nsid_print(&b, &bl, bin, nr);\n    b = bout; bl = len; sldns_wire2str_edns_ul_print(&b, &bl, bin, nr);\n    b = bout; bl = len; sldns_wire2str_edns_llq_print(&b, &bl, bin, nr); \n  \n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_tsigerror_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_long_str_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_tag_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_eui64_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_int16_data_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_hip_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_wks_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_loc_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_cert_alg_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_nsec3_salt_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_nsec_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_b32_ext_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_apl_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_str_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_rdata_unknown_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_header_scan(&a, &al, &b, &bl);\n    a = bin; al = nr; b = bout; bl = len; sldns_wire2str_pkt_scan(&a, &al, &b, &bl);\n\n    bin--;\n    free(bout);\n  }\n\nout:\n  return 0;\n}\n"
  },
  {
    "path": "projects/unbound/fuzz_3.c",
    "content": "#include \"config.h\"\n#include \"sldns/sbuffer.h\"\n#include \"sldns/wire2str.h\"\n#include \"sldns/str2wire.h\"\n#include \"util/data/dname.h\"\n\n#define SZ 1000\n#define SZ2 100\n\n\nint LLVMFuzzerTestOneInput(const uint8_t *buf, size_t nr) {\n  char *bin = malloc(nr);\n  uint8_t *bout;\n  size_t len, len2;\n\n  memset(bin, 0, nr);\n  memcpy(bin, buf, nr);\n\n  if (nr > 2) {\n    bin[nr-1] = 0x00;  // null terminate\n    len = bin[0] & 0xff;  // want random sized output buf\n    bout = malloc(len);\n    nr--;\n    bin++;\n  \n    // call the targets  \n    len2 = len; sldns_str2wire_dname_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_int8_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_int16_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_int32_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_a_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_aaaa_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_str_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_apl_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_b64_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_b32_ext_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_hex_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_nsec_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_type_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_class_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_cert_alg_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_alg_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_tsigerror_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_time_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_tsigtime_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_period_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_loc_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_wks_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_nsap_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_atma_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_ipseckey_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_nsec3_salt_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_ilnp64_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_eui48_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_eui64_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_tag_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_long_str_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_hip_buf(bin, bout, &len2);\n    len2 = len; sldns_str2wire_int16_data_buf(bin, bout, &len2);\n\n    bin--;\n    free(bout);\n  }\n\nout:\n  free(bin);\n}\n"
  },
  {
    "path": "projects/unbound/fuzz_4.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * unbound-fuzzme.c - parse a packet provided on stdin (for fuzzing).\n *\n */\n#include \"config.h\"\n#include \"util/regional.h\"\n#include \"util/module.h\"\n#include \"util/config_file.h\"\n#include \"iterator/iterator.h\"\n#include \"iterator/iter_priv.h\"\n#include \"iterator/iter_scrub.h\"\n#include \"util/log.h\"\n#include \"util/netevent.h\"\n#include \"util/alloc.h\"\n#include \"sldns/sbuffer.h\"\n#include \"services/cache/rrset.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *buf, size_t nr) {\n  log_init(\"/tmp/foo\", 0, NULL);\n  struct regional* reg;\n\n  struct sldns_buffer *pkt = sldns_buffer_new(1);\n  sldns_buffer_new_frm_data(pkt, buf, nr);\n\n  reg = regional_create();\n\n  struct msg_parse msg;\n  struct edns_data edns;\n  memset(&msg, 0, sizeof(struct msg_parse));\n  memset(&edns, 0, sizeof(edns));\n\n  struct query_info qinfo_out;\n  memset(&qinfo_out, 0, sizeof(struct query_info));\n  qinfo_out.qname = (unsigned char *) \"\\03nic\\02de\";\n  uint8_t *peter = (unsigned char *) \"\\02de\";   // zonename  \n  struct module_env env;\n  memset(&env, 0, sizeof(struct module_env));\n  struct config_file cfg;\n  memset(&cfg, 0, sizeof(struct config_file));\n\n  cfg.harden_glue = 0;    // crashes now, want to remove that later\n  env.cfg = &cfg;\n  cfg.rrset_cache_slabs = HASH_DEFAULT_SLABS;\n  cfg.rrset_cache_size = HASH_DEFAULT_MAXMEM;\n\n  struct comm_base* base = comm_base_create(0);\n  comm_base_timept(base, &env.now, &env.now_tv);\n\n  env.alloc = malloc(sizeof(struct alloc_cache));\n  alloc_init(env.alloc, NULL, 0);\n\n  env.rrset_cache = rrset_cache_create(env.cfg, env.alloc);\n  \n\n  struct iter_env ie;\n  memset(&ie, 0, sizeof(struct iter_env));\n\n  struct iter_priv priv;\n  memset(&priv, 0, sizeof(struct iter_priv));\n  ie.priv = &priv;\n\n  struct module_qstate qstate;\n  memset(&qstate, 0, sizeof(struct module_qstate));\n  qstate.env = &env;\n  qstate.region = reg;\n\n  if (parse_packet(pkt, &msg, reg) != LDNS_RCODE_NOERROR) {    \n    goto out;\n  }\n  if (parse_extract_edns_from_response_msg(&msg, &edns, reg) != LDNS_RCODE_NOERROR) {\n    goto out;\n  }\n\n\n  scrub_message(pkt, &msg, &qinfo_out, peter, reg, &env, &qstate, &ie);\n\nout:\n  rrset_cache_delete(env.rrset_cache);\n  alloc_clear(env.alloc);\n  free(env.alloc);\n  comm_base_delete(base);\n  regional_destroy(reg);\n  sldns_buffer_free(pkt);\n  return 0;\n}\n"
  },
  {
    "path": "projects/unbound/parse_packet_fuzzer.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include \"config.h\"\n#include \"util/regional.h\"\n#include \"util/fptr_wlist.h\"\n#include \"sldns/sbuffer.h\"\n\nstruct regional * region = NULL;\n\nint LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)\n{\n\tif (!region) {\n\t\tregion = regional_create();\n\t\tif (!region) {\n\t\t\tabort();\n\t\t}\n\t}\n\tsldns_buffer pktbuf;\n\tsldns_buffer_init_frm_data(&pktbuf, (void*)buf, len);\n\n\tstruct msg_parse prs;\n\tmemset(&prs, 0, sizeof(prs));\n\tparse_packet(&pktbuf, &prs, region);\n\tregional_free_all(region);\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/unbound/project.yaml",
    "content": "homepage: \"https://nlnetlabs.nl/projects/unbound/about/\"\nlanguage: c\nprimary_contact: \"wouter@nlnetlabs.nl\"\nauto_ccs:\n  - \"yorgos@nlnetlabs.nl\"\n  - \"philip@nlnetlabs.nl\"\nmain_repo: 'https://github.com/NLnetLabs/unbound'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/unbound/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run unit test\n$SRC/unbound/unittest\n"
  },
  {
    "path": "projects/underscore/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN pip3 install --upgrade pip && pip3 install wheel\nRUN git clone --depth 1 https://github.com/doboy/Underscore underscore\nWORKDIR underscore\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/underscore/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/fuzz_*.py .\nfor fuzzer in $(find . -name 'fuzz_*.py'); do\n   compile_python_fuzzer $fuzzer --paths=$PWD/underscore\ndone\n"
  },
  {
    "path": "projects/underscore/fuzz_compile.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nfrom underscore import _\n\n\ndef TestOneInput(data):\n    with open(\"tmp.f\", \"wb\") as f:\n        f.write(data)\n\n    # Only continue if the file exists.\n    if os.path.isfile(\"tmp.f\"):\n        try:\n            # Call underscore\n            _(\"tmp.f\", \"dst.f\")\n        except (SyntaxError, UnicodeDecodeError) as e:\n            pass\n        except ValueError as e2:\n            if \"cannot contain null\" in str(e2):\n                pass\n            else:\n                raise e2\n        except KeyError:\n            # This is added because the fuzzer quickly runs into it, and I think\n            # the reason is that not all python AST types have been added AFAIK.\n            # As such, it's an issue by design.\n            pass\n        os.remove(\"tmp.f\")\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/underscore/project.yaml",
    "content": "homepage: \"https://github.com/doboy/Underscore\"\nlanguage: python\nprimary_contact: \"doboy0+_ossfuzz@gmail.com\"\nmain_repo: \"https://github.com/doboy/Underscore\"\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/undertow/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.9/bin/mvn\nRUN git clone --depth 1 https://github.com/undertow-io/undertow undertow\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/undertow\n"
  },
  {
    "path": "projects/undertow/RedirectHandlerFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport io.undertow.server.handlers.RedirectHandler;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-11\n// Heuristic name: jvm-autofuzz-heuristics-11\n// Target method: [io.undertow.server.handlers.RedirectHandler] public  <init>(java.lang.String)\npublic class RedirectHandlerFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      new RedirectHandler(data.consumeRemainingAsString());\n    } catch (RuntimeException e) {\n      if (!e.getMessage().startsWith(\"UT\")) {\n        throw e;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "projects/undertow/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -DperformRelease=True org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"./servlet/target/undertow-servlet-$CURRENT_VERSION.jar\" $OUT/servlet.jar\ncp \"./core/target/undertow-core-$CURRENT_VERSION.jar\" $OUT/undertow.jar\ncp \"./parser-generator/target/undertow-parser-generator-$CURRENT_VERSION.jar\" $OUT/parser.jar\ncp \"./websockets-jsr/target/undertow-websockets-jsr-$CURRENT_VERSION.jar\" $OUT/websockets.jar\n\nALL_JARS='servlet.jar undertow.jar parser.jar websockets.jar'\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/undertow/project.yaml",
    "content": "homepage: https://github.com/undertow-io/undertow\nmain_repo: https://github.com/undertow-io/undertow\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/unicode-rs/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --depth 1 https://github.com/unicode-rs/unicode-normalization\nRUN git clone --depth 1 https://github.com/unicode-rs/unicode-segmentation\n\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/unicode-rs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/unicode-normalization\ncargo fuzz build -O\ncp fuzz/target/x86_64-unknown-linux-gnu/release/unicode-normalization $OUT/unicode-normalization-normalization\ncp fuzz/target/x86_64-unknown-linux-gnu/release/streaming $OUT/unicode-normalization-streaming\ncp fuzz/target/x86_64-unknown-linux-gnu/release/process $OUT/process\n\ncd $SRC/unicode-segmentation/\ncargo fuzz build -O\ncp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_1 $OUT/unicode-segmentation-fuzzer\n\n"
  },
  {
    "path": "projects/unicode-rs/project.yaml",
    "content": "homepage: \"http://unicode-rs.github.io/\"\nmain_repo: \"https://github.com/unicode-rs\"\nprimary_contact: \"manishsmail@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/unicorn/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y cmake pkg-config make python3\nRUN git clone -b dev --depth 1 https://github.com/unicorn-engine/unicorn.git\nWORKDIR $SRC\nCOPY run_tests.sh build.sh $SRC/\n"
  },
  {
    "path": "projects/unicorn/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd unicorn\nmkdir build\ncd build\n\n# CC CXX should be auto retrieved by cmake.\ncmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=off -DUNICORN_FUZZ=1\nmake -j4\n\nlibs=\"libunicorn.a \\\nlibx86_64-softmmu.a \\\nlibaarch64-softmmu.a \\\nlibarm-softmmu.a \\\nlibm68k-softmmu.a \\\nlibmips64el-softmmu.a \\\nlibmips64-softmmu.a \\\nlibmipsel-softmmu.a \\\nlibmips-softmmu.a \\\nlibppc64-softmmu.a \\\nlibppc-softmmu.a \\\nlibriscv32-softmmu.a \\\nlibriscv64-softmmu.a \\\nlibsparc64-softmmu.a \\\nlibsparc-softmmu.a \\\nlibs390x-softmmu.a \\\nlibunicorn-common.a\"\n\n\nls ../tests/fuzz/fuzz_*.c | cut -d_ -f2-4 | cut -d. -f1 | while read target\ndo\n    FUZZO=CMakeFiles/fuzz_$target.dir/tests/fuzz/fuzz_$target.c.o \n    $CXX $CXXFLAGS $FUZZO $libs -lpthread -lrt -lm -o $OUT/fuzz_$target $LIB_FUZZING_ENGINE\n    cp ../tests/fuzz/fuzz_emu.options $OUT/fuzz_$target.options\ndone\n"
  },
  {
    "path": "projects/unicorn/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.unicorn-engine.org\"\nlanguage: c++\nprimary_contact: \"unicorn.emu@gmail.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\n  - \"ch980501427@gmail.com\"\n  - \"stalkr@stalkr.net\"\n  - \"mio@lazym.io\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/unicorn-engine/unicorn.git'\n"
  },
  {
    "path": "projects/unicorn/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer and run unit testing\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nctest --test-dir $SRC/unicorn/build\n"
  },
  {
    "path": "projects/unirest-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip \\\n      -o maven.zip && \\\n      unzip maven.zip -d $SRC/maven && \\\n      rm maven.zip\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 https://github.com/Mashape/unirest-java unirest-java\nCOPY *.sh *.java $SRC/\nWORKDIR $SRC/unirest-java\n"
  },
  {
    "path": "projects/unirest-java/JacksonEngineFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport kong.unirest.core.json.JsonEngine;\nimport kong.unirest.core.json.JSONException;\nimport kong.unirest.modules.jackson.JacksonEngine;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [kong.unirest.jackson.JacksonEngine] public kong.unirest.core.json.JsonEngine$Object newEngineObject(java.lang.String) throws kong.unirest.core.json.JSONExce>\npublic class JacksonEngineFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      JacksonEngine obj = new JacksonEngine();\n      obj.newEngineObject(data.consumeRemainingAsString());\n    } catch (JSONException e1) {\n      // Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/unirest-java/JsonArrayFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport kong.unirest.core.json.JSONArray;\nimport kong.unirest.core.json.JSONException;\nimport kong.unirest.core.json.JSONObject;\n\n// Generated with https://github.com/ossf/fuzz-introspector/tree/main/tools/auto-fuzz\n// Minor modifications to beautify code and ensure exception is caught.\n// jvm-autofuzz-heuristics-2\n// Heuristic name: jvm-autofuzz-heuristics-2\n// Target method: [kong.unirest.core.json.JSONArray] public kong.unirest.core.json.JSONObject toJSONObject(kong.unirest.core.json.JSONArray) throws kong.unirest.core.json.JSON>\npublic class JsonArrayFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n      JSONArray obj = new JSONArray(data.consumeRemainingAsString());\n      obj.toJSONObject(new JSONArray());\n    } catch (JSONException e1) {\n      //Known exception\n    }\n  }\n}\n"
  },
  {
    "path": "projects/unirest-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\n$MVN clean package -Dmaven.javadoc.skip=true -DskipTests=true -Dpmd.skip=true \\\n    -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n    -Denforcer.fail=false org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\n\ncp \"unirest-modules-jackson/target/unirest-modules-jackson-$CURRENT_VERSION.jar\" $OUT/jackson.jar\ncp \"unirest-modules-gson/target/unirest-modules-gson-$CURRENT_VERSION.jar\" $OUT/gson.jar\ncp \"unirest/target/unirest-java-core-$CURRENT_VERSION.jar\" $OUT/unirest.jar\n\nALL_JARS=\"jackson.jar gson.jar unirest.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')\ndo\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n\n  # LLVMFuzzerTestOneInput for fuzzer detection.\n  this_dir=\\$(dirname \"\\$0\")\n  if [[ \"\\$@\" =~ (^| )-runs=[0-9]+($| ) ]]\n  then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n\n  LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\\$this_dir \\\n    \\$this_dir/jazzer_driver                        \\\n    --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n    --cp=$RUNTIME_CLASSPATH                         \\\n    --target_class=$fuzzer_basename                 \\\n    --jvm_args=\"\\$mem_settings\"                     \\\n    \\$@\" > $OUT/$fuzzer_basename\n\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/unirest-java/project.yaml",
    "content": "homepage: https://github.com/Mashape/unirest-java\nmain_repo: https://github.com/Mashape/unirest-java\nlanguage: jvm\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/unit/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://github.com/nginx/unit.git\nRUN cp $SRC/unit/fuzzing/oss-fuzz.sh $SRC/build.sh\nWORKDIR $SRC/unit/\nCOPY run_tests.sh $SRC/\n\n# Necessary as upstream repository has been archived\nRUN sed -i 's/--no-regex/--no-regex --tests/g' $SRC/build.sh\nRUN sed -i 's/make fuzz/make fuzz tests/g' $SRC/build.sh\n"
  },
  {
    "path": "projects/unit/project.yaml",
    "content": "homepage: \"https://unit.nginx.org\"\nlanguage: c\nprimary_contact: \"xim.andrew@gmail.com\"\nauto_ccs:\n  - \"devrep@nginx.com\"\n  - \"andrew@digital-domain.net\"\n  - \"pkillarjun@protonmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/nginx/unit'\n"
  },
  {
    "path": "projects/unit/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer and run unit test\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n./build/tests\n"
  },
  {
    "path": "projects/univocity-parsers/.gitignore",
    "content": "project-parent/univocity-parsers\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/univocity-parsers/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/csv.dict $SRC/CsvParserFuzzer.dict && \\\n    cp fuzzing/dictionaries/csv.dict $SRC/TsvParserFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/CsvParserFuzzer_seed_corpus.zip go-fuzz-corpus/csv/corpus/* && \\\n    zip -j $SRC/TsvParserFuzzer_seed_corpus.zip go-fuzz-corpus/csv/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/univocity-parsers\nRUN apt update && apt install -y openjdk-11-jdk\nRUN git clone --depth 1 https://github.com/univocity/univocity-parsers/ $SRC/project-parent/univocity-parsers\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/univocity-parsers/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=univocity-parsers\nPROJECT_GROUP_ID=com.univocity\nPROJECT_ARTIFACT_ID=univocity-parsers\nMAIN_REPOSITORY=https://github.com/univocity/univocity-parsers/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-11\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/univocity-parsers/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.univocity</groupId>\n            <artifactId>univocity-parsers</artifactId>\n            <version>Fuzzing-SNAPSOHT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/univocity-parsers/project-parent/fuzz-targets/src/test/java/com/example/CsvParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.univocity.parsers.common.processor.*;\nimport com.univocity.parsers.common.TextParsingException;\nimport com.univocity.parsers.csv.CsvParser;\nimport com.univocity.parsers.csv.CsvParserSettings;\n\nimport java.io.Reader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.ByteArrayInputStream;\n\n\nclass CsvParserFuzzer {\n    static RowProcessor [] rowProcessors = {new RowListProcessor(), new ObjectRowListProcessor(), new CompositeRowProcessor(), new ColumnProcessor(), new ObjectColumnProcessor()};\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        CsvParserSettings settings = new CsvParserSettings();\n\n        settings.setRowProcessor(data.pickValue(rowProcessors));\n        settings.setDelimiterDetectionEnabled(data.consumeBoolean());\n        settings.setEscapeUnquotedValues(data.consumeBoolean());\n        settings.setIgnoreLeadingWhitespaces(data.consumeBoolean());\n        settings.setIgnoreTrailingWhitespaces(data.consumeBoolean());\n        settings.setKeepEscapeSequences(data.consumeBoolean());\n        settings.setKeepQuotes(data.consumeBoolean());\n        settings.setNormalizeLineEndingsWithinQuotes(data.consumeBoolean());\n        settings.setQuoteDetectionEnabled(data.consumeBoolean());\n        settings.setCommentCollectionEnabled(data.consumeBoolean());\n        settings.setHeaderExtractionEnabled(data.consumeBoolean());\n        settings.setAutoClosingEnabled(data.consumeBoolean());\n        settings.setAutoConfigurationEnabled(data.consumeBoolean());\n        settings.setColumnReorderingEnabled(data.consumeBoolean());\n        settings.setLineSeparatorDetectionEnabled(data.consumeBoolean());\n        if (data.consumeBoolean()) {\n            settings.detectFormatAutomatically();\n        }\n\n        try (Reader inputReader = new InputStreamReader(new ByteArrayInputStream(data.consumeRemainingAsBytes()))) {\n            CsvParser parser = new CsvParser(settings);\n            parser.parseAll(inputReader);\n            parser.parseAllRecords(inputReader);\n            parser.parse(inputReader);\n            parser.getDetectedFormat();\n            parser.getContext();\n            parser.getRecordMetadata();\n            parser.getClass();\n        } catch (IOException | TextParsingException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/univocity-parsers/project-parent/fuzz-targets/src/test/java/com/example/TsvParserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.univocity.parsers.common.processor.*;\nimport com.univocity.parsers.common.TextParsingException;\nimport com.univocity.parsers.tsv.TsvParser;\nimport com.univocity.parsers.tsv.TsvParserSettings;\n\nimport java.io.Reader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.ByteArrayInputStream;\n\n\nclass TsvParserFuzzer {\n    static RowProcessor [] rowProcessors = {new RowListProcessor(), new ObjectRowListProcessor(), new CompositeRowProcessor(), new ColumnProcessor(), new ObjectColumnProcessor()};\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        TsvParserSettings settings = new TsvParserSettings();\n\n        settings.setRowProcessor(data.pickValue(rowProcessors));\n        settings.setIgnoreLeadingWhitespaces(data.consumeBoolean());\n        settings.setIgnoreTrailingWhitespaces(data.consumeBoolean());\n        settings.setCommentCollectionEnabled(data.consumeBoolean());\n        settings.setHeaderExtractionEnabled(data.consumeBoolean());\n        settings.setAutoClosingEnabled(data.consumeBoolean());\n        settings.setAutoConfigurationEnabled(data.consumeBoolean());\n        settings.setColumnReorderingEnabled(data.consumeBoolean());\n        settings.setLineJoiningEnabled(data.consumeBoolean());\n        settings.setLineSeparatorDetectionEnabled(data.consumeBoolean());\n\n        try (Reader inputReader = new InputStreamReader(new ByteArrayInputStream(data.consumeRemainingAsBytes()))) {\n            TsvParser parser = new TsvParser(settings);\n            parser.parseAll(inputReader);\n            parser.parseAllRecords(inputReader);\n            parser.parse(inputReader);\n            parser.getContext();\n            parser.getRecordMetadata();\n            parser.getClass();\n        } catch (IOException | TextParsingException e) {\n        }\n    }\n}"
  },
  {
    "path": "projects/univocity-parsers/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>univocity-parsers</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/univocity-parsers/project.yaml",
    "content": "homepage: \"https://github.com/univocity/univocity-parsers/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/univocity/univocity-parsers/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/unsafe-libyaml/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl cmake python llvm-dev libclang-dev clang\n\nRUN git clone https://github.com/dtolnay/unsafe-libyaml\nWORKDIR $SRC/unsafe-libyaml\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/unsafe-libyaml/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncargo fuzz build -O\n\ncp fuzz/target/x86_64-unknown-linux-gnu/release/load $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/parse $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/scan $OUT/\n\n"
  },
  {
    "path": "projects/unsafe-libyaml/project.yaml",
    "content": "homepage: \"https://github.com/dtolnay/unsafe-libyaml\"\nmain_repo: \"https://github.com/dtolnay/unsafe-libyaml.git\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nvendor_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"fuzzing@fuchsia.dev\"\n"
  },
  {
    "path": "projects/upx/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool cmake\nRUN git clone https://github.com/upx/upx-testsuite.git testsuite\nRUN git clone https://github.com/upx/upx-testsuite-v2.git testsuite2\nRUN git clone https://github.com/MykolaMykhno/upx-testsuite-v3.git testsuite3\nRUN git clone --depth 1 https://github.com/upx/upx.git upx\n\nWORKDIR /src/upx\nRUN git submodule update --init\n\nCOPY build.sh $SRC/\nCOPY fuzzers/ $SRC/upx/fuzzers/\n"
  },
  {
    "path": "projects/upx/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Temporary fix for clang bug of upx\nsed -i 's/ \\&\\& __clang_major__ < 15//m' /src/upx/src/util/util.cpp\ngit apply   --ignore-space-change --ignore-whitespace  $SRC/upx/fuzzers/build.patch\n\n# build project\n# e.g.\nmkdir -p build/debug\ncd build/debug\n# Disable UBSan for the compiler sanity check that intentionally tests overflow\ncmake ../.. -DCMAKE_CXX_FLAGS=\"${CXXFLAGS} -fno-sanitize=signed-integer-overflow\" -DCMAKE_C_FLAGS=\"${CFLAGS} -fno-sanitize=signed-integer-overflow\"\n\nfor fuzzer in $(find $SRC -name '*_fuzzer.cpp'); do\n    fuzz_basename=$(basename -s .cpp $fuzzer)\n    cmake --build . --target $fuzz_basename -v\ndone\n\ncp ./*_fuzzer $OUT/\n\nmkdir -p $SRC/corpus/\n\ncp $SRC/testsuite3/files/corpus/* $SRC/corpus/\n\nfor architecture in $(ls $SRC/testsuite/files/packed/); do\n    for file in $(ls $SRC/testsuite/files/packed/$architecture); do\n        cp $SRC/testsuite/files/packed/$architecture/$file $SRC/corpus/$architecture-$file\n    done\ndone\n\nfor architecture in $(ls $SRC/testsuite2/files/all/); do\n    for file in $(ls $SRC/testsuite2/files/all/$architecture); do\n        cp $SRC/testsuite2/files/all/$architecture/$file $SRC/corpus/$architecture-$file\n    done\ndone\n\n# build corpora\n# e.g.\nfor fuzzer in $(find $SRC -name '*_fuzzer.cpp'); do\n    fuzz_basename=$(basename -s .cpp $fuzzer)\n    zip -q $OUT/${fuzz_basename}_seed_corpus.zip $SRC/corpus/*\ndone\n"
  },
  {
    "path": "projects/upx/fuzzers/build.patch",
    "content": "diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex ac15329b..dba7e5f5 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -336,10 +336,87 @@ if(Threads_FOUND)\n     target_link_libraries(upx Threads::Threads)\n endif()\n \n+set(fuzzers \"\")\n+\n+file(GLOB fuzzers_files \"fuzzers/*_fuzzer.cpp\")\n+\n+foreach(file ${fuzzers_files})\n+    get_filename_component(fuzzer_name \"${file}\" NAME_WLE)\n+    list(APPEND fuzzers ${fuzzer_name})\n+\n+    add_executable(${fuzzer_name} ${file} ${upx_SOURCES})\n+\n+    target_compile_definitions(${fuzzer_name} PUBLIC FUZZING_TESTS=1)\n+\n+    target_link_options(${fuzzer_name} PUBLIC -v)\n+\n+    # if(NOT \"$ENV{SANITIZER}\" STREQUAL \"introspector\")\n+    message(ENV_SANITIZER=$ENV{SANITIZER})\n+    target_link_options(${fuzzer_name} PUBLIC $ENV{LIB_FUZZING_ENGINE})\n+    # endif()\n+\n+    if(NOT UPX_CONFIG_DISABLE_CXX_STANDARD)\n+        set_property(TARGET ${fuzzer_name} PROPERTY CXX_STANDARD 17)\n+    endif()\n+    target_link_libraries(${fuzzer_name} upx_vendor_ucl upx_vendor_zlib)\n+    if(NOT UPX_CONFIG_DISABLE_BZIP2)\n+        target_link_libraries(${fuzzer_name} upx_vendor_bzip2)\n+    endif()\n+    if(NOT UPX_CONFIG_DISABLE_ZSTD)\n+        target_link_libraries(${fuzzer_name} upx_vendor_zstd)\n+    endif()\n+    if(Threads_FOUND)\n+        target_link_libraries(${fuzzer_name} Threads::Threads)\n+    endif()\n+endforeach()\n+\n #***********************************************************************\n # target compilation flags\n #***********************************************************************\n \n+foreach(fuzzer ${fuzzers})\n+    set(t ${fuzzer})\n+    target_include_directories(${t} PRIVATE vendor)\n+    target_compile_definitions(${t} PRIVATE $<$<CONFIG:Debug>:DEBUG=1>)\n+    if(GITREV_SHORT)\n+        target_compile_definitions(${t} PRIVATE UPX_VERSION_GITREV=\"${GITREV_SHORT}${GITREV_PLUS}\")\n+        if(GIT_DESCRIBE)\n+            target_compile_definitions(${t} PRIVATE UPX_VERSION_GIT_DESCRIBE=\"${GIT_DESCRIBE}\")\n+        endif()\n+    endif()\n+    if(Threads_FOUND)\n+        target_compile_definitions(${t} PRIVATE WITH_THREADS=1)\n+    endif()\n+    if(NOT UPX_CONFIG_DISABLE_WSTRICT)\n+        target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WSTRICT=0)\n+    endif()\n+    if(NOT UPX_CONFIG_DISABLE_WERROR)\n+        target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WERROR=0)\n+    endif()\n+    if(NOT UPX_CONFIG_DISABLE_BZIP2)\n+        target_compile_definitions(${t} PRIVATE WITH_BZIP2=0) # FIXME TODO\n+    endif()\n+    if(NOT UPX_CONFIG_DISABLE_ZSTD)\n+        target_compile_definitions(${t} PRIVATE WITH_ZSTD=1)\n+    endif()\n+    if(HAVE_UTIMENSAT)\n+        target_compile_definitions(${t} PRIVATE USE_UTIMENSAT=1)\n+        if(HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)\n+            target_compile_definitions(${t} PRIVATE HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC=1)\n+        endif()\n+    endif()\n+    # improve speed of the Debug versions\n+    upx_compile_source_debug_with_O2(src/compress/compress_lzma.cpp)\n+    upx_compile_source_debug_with_O2(src/filter/filter_impl.cpp)\n+    #upx_compile_target_debug_with_O2(${t})\n+    upx_sanitize_target(${t})\n+    if(MSVC_FRONTEND)\n+        target_compile_options(${t} PRIVATE -EHsc ${warn_WN} ${warn_WX})\n+    else()\n+        target_compile_options(${t} PRIVATE ${warn_Wall} ${warn_Werror})\n+    endif()\n+endforeach()\n+\n upx_cmake_include_hook(5_target_compilation_flags)\n \n if(NOT UPX_CONFIG_DISABLE_BZIP2)\ndiff --git a/src/main.cpp b/src/main.cpp\nindex 2d181687..ccb14660 100644\n--- a/src/main.cpp\n+++ b/src/main.cpp\n@@ -1341,6 +1341,7 @@ int upx_main(int argc, char *argv[]) may_throw {\n // real entry point\n **************************************************************************/\n \n+#if !(FUZZING_TESTS)\n #if !(WITH_GUI)\n \n #if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)\n@@ -1394,5 +1395,6 @@ int __acc_cdecl_main main(int argc, char *argv[]) /*noexcept*/ {\n }\n \n #endif /* !(WITH_GUI) */\n+#endif /* !(FUZZING_TESTS) */\n \n /* vim:set ts=4 sw=4 et: */\n"
  },
  {
    "path": "projects/upx/fuzzers/decompress_packed_file_fuzzer.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"../src/conf.h\"\n#include \"../src/file.h\"\n#include \"../src/packmast.h\"\n\nenum OpenMode { RO_MUST_EXIST, WO_MUST_EXIST_TRUNCATE, WO_MUST_CREATE, WO_CREATE_OR_TRUNCATE };\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  char infilename[256];\n  char outfilename[256];\n  snprintf(infilename, 256, \"/tmp/libfuzzer.%d\", getpid());\n  snprintf(outfilename, 256, \"/tmp/libfuzzer.%d.decompressed\", getpid());\n  \n  FILE *fp = fopen(infilename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  char argv_progname[4] = \"upx\";\n  char argv_decompression[3] = \"-d\";\n  char argv_output[3] = \"-o\";\n\n  char* argv_data[] = {argv_progname, argv_decompression, infilename, argv_output, outfilename};\n\n  try {\n    upx_main(5, argv_data);\n  } catch(...) {\n  }\n  \n  unlink(infilename);\n  unlink(outfilename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/upx/fuzzers/list_packed_file_fuzzer.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"../src/conf.h\"\n#include \"../src/file.h\"\n#include \"../src/packmast.h\"\n\nenum OpenMode { RO_MUST_EXIST, WO_MUST_EXIST_TRUNCATE, WO_MUST_CREATE, WO_CREATE_OR_TRUNCATE };\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  char infilename[256];\n  char outfilename[256];\n  snprintf(infilename, 256, \"/tmp/libfuzzer.%d\", getpid());\n  snprintf(outfilename, 256, \"/tmp/libfuzzer.%d.decompressed\", getpid());\n  \n  FILE *fp = fopen(infilename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  char argv_progname[4] = \"upx\";\n  char argv_list_packed_files[3] = \"-l\";\n\n  char* argv_data[] = {argv_progname, argv_list_packed_files, infilename};\n\n  try {\n    upx_main(3, argv_data);\n  } catch(...) {\n  }\n  \n  unlink(infilename);\n  unlink(outfilename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/upx/fuzzers/test_packed_file_fuzzer.cpp",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"../src/conf.h\"\n#include \"../src/file.h\"\n#include \"../src/packmast.h\"\n\nenum OpenMode { RO_MUST_EXIST, WO_MUST_EXIST_TRUNCATE, WO_MUST_CREATE, WO_CREATE_OR_TRUNCATE };\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  char infilename[256];\n  char outfilename[256];\n  snprintf(infilename, 256, \"/tmp/libfuzzer.%d\", getpid());\n  snprintf(outfilename, 256, \"/tmp/libfuzzer.%d.decompressed\", getpid());\n  \n  FILE *fp = fopen(infilename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  char argv_progname[4] = \"upx\";\n  char argv_test_file[3] = \"-t\";\n\n  char* argv_data[] = {argv_progname, argv_test_file, infilename};\n\n  try {\n    upx_main(3, argv_data);\n  } catch(...) {\n  }\n  \n  unlink(infilename);\n  unlink(outfilename);\n  return 0;\n}\n"
  },
  {
    "path": "projects/upx/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://upx.github.io/\"\nlanguage: c++\nprimary_contact: \"reiser.john@gmail.com\"\nmain_repo: \"https://github.com/upx/upx.git\"\ncoverage_extra_args: -ignore-filename-regex=.*vendor/.*\n"
  },
  {
    "path": "projects/uriparser/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake wget sudo libtool cmake\nRUN git clone --depth 1 https://github.com/uriparser/uriparser uriparser\nWORKDIR uriparser\nCOPY build.sh \"$SRC/\"\n"
  },
  {
    "path": "projects/uriparser/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir -p build\ncd build\ncmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n      -DURIPARSER_OSSFUZZ_BUILD=ON \\\n      -DURIPARSER_BUILD_FUZZERS=ON \\\n      -DURIPARSER_BUILD_DOCS=OFF \\\n      -DURIPARSER_BUILD_TESTS=OFF \\\n      -DURIPARSER_BUILD_TOOLS=OFF \\\n      -DURIPARSER_ENABLE_INSTALL=OFF \\\n      ..\nmake\ncp fuzz/*_fuzzer \"$OUT/\"\n"
  },
  {
    "path": "projects/uriparser/project.yaml",
    "content": "homepage: \"https://github.com/uriparser/uriparser\"\nlanguage: c++\nprimary_contact: \"webmaster@hartwork.org\"\nsanitizers:\n - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/uriparser/uriparser'\n"
  },
  {
    "path": "projects/uritemplate/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/python-hyper/uritemplate uritemplate\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/uritemplate\n"
  },
  {
    "path": "projects/uritemplate/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/uritemplate/fuzz_expand.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport sys\nimport atheris\nfrom uritemplate import URITemplate\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  url = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)\n  t = URITemplate(url)\n  t.expand(fuzzVar='1234')\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/uritemplate/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/python-hyper/uritemplate\nlanguage: python\nmain_repo: https://github.com/python-hyper/uritemplate\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/urlextract/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/lipoja/URLExtract URLExtract\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/URLExtract\n"
  },
  {
    "path": "projects/urlextract/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer --add-data urlextract/data/:urlextract/data/\ndone\n"
  },
  {
    "path": "projects/urlextract/fuzz_find_urls.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-4.1\n# Imports by the generated code\nimport urlextract\n\n# Stpre the extractor as a global variable to speed up exec/sec. The startup\n# time is heavy for URLExtract.\nurlextractor = urlextract.urlextract_core.URLExtract()\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  text = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n  # Class target.\n  try:\n    urlextractor.find_urls(text)\n  except (\n      urlextract.urlextract_core.URLExtractError,\n      urlextract.cachefile.CacheFileError,\n  ):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/urlextract/project.yaml",
    "content": "homepage: https://github.com/lipoja/URLExtract\nmain_repo: https://github.com/lipoja/URLExtract\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/urllib3/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone --depth 1 https://github.com/urllib3/urllib3\n\nCOPY build.sh $SRC/\nCOPY fuzz_* $SRC/\n\nWORKDIR $SRC/urllib3\n"
  },
  {
    "path": "projects/urllib3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\n\nexport PYFUZZPACKAGE=$SRC/urllib3/src/urllib3\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/urllib3/fuzz_requests.py",
    "content": "#!/usr/bin/python3\n\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport socket\nimport sys\nimport threading\nimport time\n\nimport urllib3\n\n# Setup http mocking\nGLOBAL_RESPONSE_BODY = b\"\"\nGLOBAL_RESPONSE_CODE = 0\nGLOBAL_CONTENT_TYPE = b\"\"\n\n\nclass ServerThread(threading.Thread):\n    def __init__(self) -> None:\n        self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n        self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n        self.s.bind((\"127.0.0.1\", 8001))\n        self.s.listen(1)\n        super().__init__()\n\n    def run(self) -> None:\n        global GLOBAL_RESPONSE_CODE, GLOBAL_CONTENT_TYPE, GLOBAL_RESPONSE_BODY\n        conn, addr = self.s.accept()\n        conn.recv(1024)\n        conn.send(\n            b\"HTTP/1.1 %d FOO\\r\\nContent-Type: %b\\r\\n\\r\\n%b\"\n            % (GLOBAL_RESPONSE_CODE, GLOBAL_CONTENT_TYPE, GLOBAL_RESPONSE_BODY)\n        )\n        time.sleep(0.005)\n        conn.close()\n        self.s.shutdown(1)\n        self.s.close()\n        time.sleep(0.01)\n\n\nREQUEST_METHODS = [\"POST\", \"GET\", \"HEAD\", \"PUT\"]\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n\n    global GLOBAL_RESPONSE_BODY, GLOBAL_RESPONSE_CODE, GLOBAL_CONTENT_TYPE\n    GLOBAL_RESPONSE_BODY = fdp.ConsumeBytes(sys.maxsize)\n    GLOBAL_RESPONSE_CODE = fdp.ConsumeIntInRange(200, 599)\n    GLOBAL_CONTENT_TYPE = fdp.ConsumeBytes(sys.maxsize)\n\n    requestType = fdp.PickValueInList(REQUEST_METHODS)\n\n    # Optionally provide request headers\n    requestHeaders = urllib3._collections.HTTPHeaderDict({})\n    for i in range(0, fdp.ConsumeIntInRange(0, 10)):\n        requestHeaders.add(\n            fdp.ConsumeString(sys.maxsize), fdp.ConsumeString(sys.maxsize)\n        )\n    requestHeaders = None if fdp.ConsumeBool() else requestHeaders\n\n    # Optionally generate form data\n    formData = {}\n    for i in range(0, fdp.ConsumeIntInRange(0, 100)):\n        formData[fdp.ConsumeString(sys.maxsize)] = fdp.ConsumeString(sys.maxsize)\n    formData = None if fdp.ConsumeBool() else formData\n\n    timeout = urllib3.util.Timeout(connect=0.1, read=0.1)\n    urllib_pool = urllib3.poolmanager.PoolManager(timeout=timeout)\n\n    t1 = ServerThread()\n    t1.start()\n\n    response = urllib_pool.request(\n        requestType,\n        \"http://localhost:8001/\", \n        headers=requestHeaders,\n        fields=formData\n    )\n    \n    response.status\n    response.data\n    response.headers\n\n    t1.join()\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/urllib3/fuzz_urlparse.py",
    "content": "#!/usr/bin/python3\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\nimport urllib3\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    original = fdp.ConsumeUnicode(sys.maxsize)\n\n    try:\n        # We have to call this via .url because of limitations\n        # in PyCG analysis\n        response = urllib3.util.url.parse_url(original)\n        response.hostname\n        response.request_uri\n        response.authority\n        response.netloc\n        response.url\n    except urllib3.exceptions.LocationParseError:\n        None\n    return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    atheris.instrument_all()\n    main()\n\n"
  },
  {
    "path": "projects/urllib3/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/urllib3/urllib3\nlanguage: python\nmain_repo: https://github.com/urllib3/urllib3\nsanitizers:\n- address\n- undefined\nprimary_contact: \"illia.volochii@gmail.com\"\nvendor_ccs:\n- david@adalogics.com\n- sean@compactcloud.co.uk\n"
  },
  {
    "path": "projects/usbguard/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y \\\n  make \\\n  autoconf \\\n  automake \\\n  libtool \\\n  pkg-config \\\n  libxml2-utils \\\n  libxml2-dev \\\n  xsltproc \\\n  libprotobuf-dev \\\n  protobuf-compiler \\\n  libdbus-1-dev \\\n  libdbus-glib-1-dev \\\n  libgio2.0-cil-dev \\\n  libgcrypt20-dev \\\n  libpolkit-gobject-1-dev \\\n  libseccomp-dev \\\n  libcap-ng-dev\n\nRUN git clone https://github.com/ClusterLabs/libqb && cd libqb && \\\n    ./autogen.sh && ./configure && make && make install\n\nRUN git clone --recurse-submodules --depth 1 \\\n  https://github.com/USBGuard/usbguard usbguard\nWORKDIR usbguard\nCOPY build.sh $SRC\n"
  },
  {
    "path": "projects/usbguard/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Ensure libqb can be found by pkgconfig\nexport PKG_CONFIG_PATH=/usr/lib64/pkgconfig/\n\nautoreconf -fi\n\nlibqb=`find /usr/lib64/ -name libqb.a -print -quit`\nprotobuf=`find /usr/lib/ -name libprotobuf.a -print -quit`\n\nqb_LIBS=\"${libqb}\" \\\n  protobuf_LIBS=\"-pthread ${protobuf} -pthread -lpthread\" \\\n  ./configure --with-bundled-catch --with-bundled-pegtl \\\n  --with-crypto-library=gcrypt --disable-shared\n\nfuzzers=\"$( cd src/Tests/Fuzzers && find -name 'fuzzer-*.cpp' |\n           sed 's/^\\.\\/\\(fuzzer-.*\\)\\.cpp$/\\1/g' )\"\n\nmake -j`nproc` src/build-config.h libusbguard.la\nmake -j`nproc` -C src/Tests/Fuzzers ${fuzzers}\n\ncd src/Tests/Fuzzers\nmv ${fuzzers} \"$OUT\"\n\n################################################################################\n# Create seed corpora.\n################################################################################\n\n# General case:\ncd \"$SRC/usbguard/src/Tests/Fuzzers\"\n# fuzzer-usb-descriptor seed corpus.\nfor fuzzer_name in ${fuzzers}; do\n  corpus_dir=\"${fuzzer_name}_corpus\"\n  if [[ ! -d \"$corpus_dir\" ]] ; then\n    continue\n  fi\n  zip_name=\"$OUT/${fuzzer_name}_seed_corpus.zip\"\n  rm -f \"${zip_name}\"\n  zip -r \"${zip_name}\" \"${corpus_dir}\"\ndone\n\n# Specific cases:\ncd \"$WORK\"\n# fuzzer-rules seed corpus.\nfuzzer_name=fuzzer-rules\ncorpus_dir=\"${fuzzer_name}_corpus\"\nzip_name=\"$OUT/${fuzzer_name}_seed_corpus.zip\"\nif [[ ! -d \"$SRC/usbguard/src/Tests/Fuzzers/$corpus_dir\" ]] ; then\n  rm -f \"${zip_name}\"\n  rm -rf \"${corpus_dir}\"\n  mkdir -p \"${corpus_dir}\"\n  pushd \"${corpus_dir}\"\n  i=1000000\n  while read -r line; do\n    echo \"${line}\" > \"$((i++))\"\n  done < <( cat $SRC/usbguard/src/Tests/Rules/test-rules.good \\\n            $SRC/usbguard/src/Tests/Rules/test-rules.bad )\n  popd\n  zip -r \"${zip_name}\" \"${corpus_dir}\"\nfi\n\n# fuzzer-usb-descriptor seed corpus.\nfuzzer_name=fuzzer-usb-descriptor\ncorpus_dir=\"${fuzzer_name}_corpus\"\nzip_name=\"$OUT/${fuzzer_name}_seed_corpus.zip\"\nif [[ ! -d \"$SRC/usbguard/src/Tests/Fuzzers/$corpus_dir\" ]] ; then\n  rm -rf \"${corpus_dir}\"\n  rm -f \"${zip_name}\"\n  cp -R \"$SRC/usbguard/src/Tests/USB/data\" \"${corpus_dir}\"\n  zip -r \"${zip_name}\" \"${corpus_dir}\"\nfi\n"
  },
  {
    "path": "projects/usbguard/project.yaml",
    "content": "homepage: \"https://usbguard.github.io/\"\nlanguage: c++\nprimary_contact: \"rsroka@redhat.com\"\nsanitizers:\n - address\n - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nauto_ccs:\n - \"alakatos@redhat.com\"\n - \"allenwebb@google.com\"\n - \"zfridric@redhat.com\"\nmain_repo: \"https://github.com/USBGuard/usbguard\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/userver/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.12...3.31)\nproject(fuzzservice CXX)\n\n# Static linking configuration - only when not fuzzing\nif(NOT DEFINED ENV{LIB_FUZZING_ENGINE})\n  set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} -static\")\n  set(CMAKE_FIND_LIBRARY_SUFFIXES \".a\")\n  set(BUILD_SHARED_LIBS OFF)\nendif()\n\nlist(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/cmake\")\ninclude(DownloadUserver)\n\nfind_package(userver COMPONENTS\n    core\n    QUIET\n)\nif(NOT userver_FOUND)\n  # Tries TRY_DIR first, falls back to downloading userver from GitHub using CPM.\n  download_userver(TRY_DIR third_party/userver)\nendif()\n\nuserver_setup_environment()\n\n\n# Common sources\ninclude_directories(src)\n\nadd_library(${PROJECT_NAME}_objs OBJECT\n    src/greeting.cpp\n    src/hello.cpp\n)\ntarget_link_libraries(${PROJECT_NAME}_objs PUBLIC\n  userver::core\n)\n\n# The Service\nadd_executable(${PROJECT_NAME} src/main.cpp)\nuserver_embed_file(${PROJECT_NAME}_config NAME static_config_yaml FILEPATH static_config.yaml)\n\nif(DEFINED ENV{LIB_FUZZING_ENGINE})\n  message(\"LIB_FUZZING_ENGINE set - $ENV{LIB_FUZZING_ENGINE}\")\n  target_link_libraries(${PROJECT_NAME} PRIVATE \n    ${PROJECT_NAME}_objs \n    $ENV{LIB_FUZZING_ENGINE}\n    ${PROJECT_NAME}_config)\n  set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} $ENV{LIB_FUZZING_ENGINE} $ENV{LIB_HFND}\")\n  add_definitions(-DLIB_FUZZING_ENGINE)\n  if(DEFINED ENV{FUZZING_ENGINE})\n    string(TOUPPER \"$ENV{FUZZING_ENGINE}\" UPCASE_FUZZING_ENGINE)\n    add_definitions(-DFUZZING_ENGINE_${UPCASE_FUZZING_ENGINE})\n  endif()\n  set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS}\")\nelse()\n  target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_objs ${PROJECT_NAME}_config)\nendif()\n"
  },
  {
    "path": "projects/userver/CMakePresets.json",
    "content": "{\n  \"version\": 2,\n  \"cmakeMinimumRequired\": {\n    \"major\": 3,\n    \"minor\": 20,\n    \"patch\": 0\n  },\n  \"configurePresets\": [\n    {\n      \"name\": \"debug\",\n      \"displayName\": \"Debug\",\n      \"description\": \"Fully featured Debug build\",\n      \"inherits\": [\n        \"common-flags\"\n      ],\n      \"binaryDir\": \"${sourceDir}/build-debug\",\n      \"cacheVariables\": {\n        \"CMAKE_BUILD_TYPE\": \"Debug\",\n        \"CMAKE_CXX_FLAGS\": \"\",\n        \"CMAKE_EXE_LINKER_FLAGS\": \"-pthread -ldl -lrt -rpath '$ORIGIN/lib'\",\n        \"USERVER_SANITIZE_old\": \"addr;ub\",\n        \"USERVER_SANITIZE\": \"addr\"\n      }\n    },\n    {\n      \"name\": \"release\",\n      \"displayName\": \"Release\",\n      \"description\": \"Fully featured Release build\",\n      \"inherits\": [\n        \"common-flags\"\n      ],\n      \"binaryDir\": \"${sourceDir}/build-release\",\n      \"cacheVariables\": {\n        \"CMAKE_BUILD_TYPE\": \"Release\"\n      }\n    },\n    {\n      \"name\": \"common-flags\",\n      \"hidden\": true,\n      \"generator\": \"Ninja\",\n      \"cacheVariables\": {\n        \"CMAKE_EXPORT_COMPILE_COMMANDS\": \"ON\"\n      }\n    }\n  ]\n}"
  },
  {
    "path": "projects/userver/Dockerfile",
    "content": "# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool ninja-build libyaml-cpp-dev libzstd-dev libre2-dev libicu-dev zlib1g-dev libnghttp2-dev libev-dev clang-format\nRUN apt-get update && apt-get install -y ccache cmake git libbenchmark-dev libbson-dev libcctz-dev libcurl4-openssl-dev libev-dev libgmock-dev libc-ares-dev libfmt-dev libgrpc-dev libgrpc++-dev libgrpc++1 libgtest-dev libhiredis-dev libjemalloc-dev libkrb5-dev libldap2-dev libmongoc-dev libnghttp2-dev libpq-dev libprotoc-dev libssl-dev libyaml-cpp-dev ninja-build pkg-config protobuf-compiler-grpc python3-dev python3-jinja2 python3-pip python3-protobuf python3-venv python3-voluptuous zlib1g-dev chrpath libstdc++-10-dev\n\n#Ubuntu 20.04 contains only boost 1.74.0\nRUN wget https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.gz && \\\n    tar xzf boost_1_81_0.tar.gz && \\\n    cd boost_1_81_0 && \\\n    CXXFLAGS=\"\" LDFLAGS=\"\" ./bootstrap.sh --with-toolset=clang && \\\n    ./b2 -j$(nproc) link=static install\nRUN git clone --depth 1 https://github.com/userver-framework/userver userver\n\nRUN python3 userver/scripts/userver-create-service.py fuzzservice\n\nRUN apt remove -y clang-format\nRUN apt-get update && apt install -y clang-format-18\nRUN ln -s /usr/bin/clang-format-18 /usr/bin/clang-format\n\nCOPY build.sh $SRC/\nCOPY main.cpp $SRC/\nCOPY CMakeLists.txt $SRC/\nCOPY CMakePresets.json $SRC/fuzzservice/\nCOPY static_config.yaml $SRC/fuzzservice/\n"
  },
  {
    "path": "projects/userver/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncp fuzzservice/CMakePresets.json fuzzservice/CMakePresets_user.json\njq '.configurePresets[0].cacheVariables += {\"USERVER_FEATURE_STACKTRACE\":\"OFF\", \"USERVER_FEATURE_STACK_USAGE_MONITOR\":\"OFF\"}' fuzzservice/CMakePresets_user.json > fuzzservice/CMakePresets.json\n\n# unset CXXFLAGS\n# unset LDFLAGS\n\nprintenv\n\ncp $SRC/main.cpp $SRC/fuzzservice/src/main.cpp\n\ncp $SRC/CMakeLists.txt $SRC/fuzzservice/CMakeLists.txt\n\ncd fuzzservice\nmake build-debug\n\ncp build-debug/fuzzservice $OUT/\n\nmkdir -p $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libcctz.so.2 $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libicudata.so.66 $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libicui18n.so.66 $OUT/lib/\ncp /usr/lib/x86_64-linux-gnu/libicuuc.so.66 $OUT/lib/\n\nchrpath -r '$ORIGIN/lib' $OUT/fuzzservice\n"
  },
  {
    "path": "projects/userver/main.cpp",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <userver/components/component.hpp>\n#include <userver/components/component_list.hpp>\n#include <userver/components/minimal_server_component_list.hpp>\n#include <userver/server/handlers/ping.hpp>\n#include <userver/utils/daemon_run.hpp>\n\n#include <hello.hpp>\n#include <generated/static_config.yaml.hpp>\n\n// Suppress LSAN for rapidjson\nextern \"C\" const char* __lsan_default_suppressions() {\n    return \"leak:userver::v2_*::components::DynamicConfig::Impl::ReadFallback\\n\";\n}\n\nnamespace {\n\nint StartService(int argc, char* argv[]) {\n    auto component_list = userver::components::MinimalServerComponentList()\n                              .Append<userver::server::handlers::Ping>()\n                              .Append<fuzzservice::Hello>();\n    auto config = userver::components::InMemoryConfig{userver::utils::FindResource(\"static_config_yaml\")};\n\n    return userver::utils::DaemonMain(config, component_list);\n}\n\n}  // namespace\n\n#if defined(FUZZING_ENGINE_HONGGFUZZ)\n\n#define HFND_FUZZING_ENTRY_FUNCTION_CXX(x, y)                                \\\n    extern const char* LIBHFNETDRIVER_module_netdriver;                      \\\n    const char** LIBHFNETDRIVER_tmp1 = &LIBHFNETDRIVER_module_netdriver;     \\\n    extern \"C\" int HonggfuzzNetDriver_main(x, y);                            \\\n    int HonggfuzzNetDriver_main(x, y)\n\nHFND_FUZZING_ENTRY_FUNCTION_CXX(int argc, char* argv[]) {\n    return StartService(argc, argv);\n}\n\n#elif defined(LIB_FUZZING_ENGINE)\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {\n    // TODO: Implement fuzzing logic later for libfuzzer now working on honggfuzz.\n    return 0;\n}\n\n#else\n\nint main(int argc, char* argv[]) {\n    return StartService(argc, argv);\n}\n\n#endif\n"
  },
  {
    "path": "projects/userver/project.yaml",
    "content": "homepage: \"https://userver.tech/\"\nlanguage: c++\nprimary_contact: \"antoshkka@gmail.com\"\nmain_repo: \"https://github.com/userver-framework/userver.git\"\nfile_github_issue: true\nauto_ccs:\n    - \"kirikpavlov@gmail.com\"\nfuzzing_engines:\n    - honggfuzz\n"
  },
  {
    "path": "projects/userver/static_config.yaml",
    "content": "components_manager:\n    task_processors:                  # Task processor is an executor for coroutine tasks\n\n        main-task-processor:          # Make a task processor for CPU-bound coroutine tasks.\n            worker_threads: 1         # Process tasks in 4 threads.\n\n        fs-task-processor:            # Make a separate task processor for filesystem bound tasks.\n            worker_threads: 1\n\n    default_task_processor: main-task-processor\n\n    components:                       # Configuring components that were registered via component_list\n        server:\n            listener:                 # configuring the main listening socket...\n                port: 8080            # ...to listen on this port and...\n                task_processor: main-task-processor    # ...process incoming requests on this task processor.\n\n        logging:\n            fs-task-processor: fs-task-processor\n            loggers:\n                default:\n                    file_path: '@stderr'\n                    level: info\n                    overflow_behavior: discard  # Drop logs if the system is too busy to write them down.\n\n        # Dynamic config options. Cache is disabled, updates are disabled.\n        dynamic-config:\n            # defaults-path: dynamic_config.yaml\n            # For most of userver dynamic configs, defaults are used, some are overridden here.\n            # See userver \"dynamic config\" docs for what configs exist.\n            defaults:\n                HTTP_CLIENT_CONNECTION_POOL_SIZE: 1000\n\n        handler-ping:\n            path: /ping\n            method: GET\n            task_processor: main-task-processor\n            throttling_enabled: false\n            url_trailing_slash: strict-match\n\n        handler-hello:                    # Finally! Our handler.\n            path: /hello                  # Registering handler by URL '/hello'.\n            method: GET,POST              # It will only reply to GET (HEAD) and POST requests.\n            task_processor: main-task-processor  # Run it on CPU bound task processor\n"
  },
  {
    "path": "projects/usrsctp/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make cmake\nRUN git clone --depth 1 https://github.com/sctplab/usrsctp usrsctp\nWORKDIR usrsctp\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/usrsctp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncmake -Dsctp_build_programs=0 -Dsctp_debug=0 -Dsctp_invariants=1 -Dsctp_build_fuzzer=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo .\nmake -j$(nproc)\ncd fuzzer\n\nTARGETS=\"fuzzer_connect fuzzer_listen fuzzer_fragment\"\n\nCORPUS=\"CORPUS_CONNECT CORPUS_LISTEN CORPUS_FRAGMENT\"\n\nwhile [ -n \"$TARGETS\" ]\ndo\n        target=`echo \"$TARGETS\" | cut -d ' ' -f 1`\n        TARGETS=`echo \"$TARGETS\" | sed 's/[^ ]* *\\(.*\\)$/\\1/'`\n        corpus=`echo \"$CORPUS\" | cut -d ' ' -f 1`\n        CORPUS=`echo \"$CORPUS\" | sed 's/[^ ]* *\\(.*\\)$/\\1/'`\n\n        $CC $CFLAGS -DFUZZING_STAGE=0 -I . -I ../usrsctplib/ -c ${target}.c -o $OUT/${target}.o\n        $CXX $CXXFLAGS -o $OUT/${target} $OUT/${target}.o $LIB_FUZZING_ENGINE ../usrsctplib/libusrsctp.a\n        rm -f $OUT/${target}.o\n\n        zip -jr ${target}_seed_corpus.zip ${corpus}/\n        cp ${target}_seed_corpus.zip $OUT/\ndone\n"
  },
  {
    "path": "projects/usrsctp/project.yaml",
    "content": "homepage: \"https://github.com/sctplab/usrsctp\"\nlanguage: c++\nprimary_contact: \"weinrank@fh-muenster.de\"\nauto_ccs:\n  - \"t00fcxen@googlemail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/sctplab/usrsctp'\n"
  },
  {
    "path": "projects/utf8parse/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone https://github.com/alacritty/vte vte\nWORKDIR $SRC/vte/utf8parse\n\nCOPY build.sh $SRC/\nCOPY fuzz $SRC/vte/utf8parse/fuzz\n"
  },
  {
    "path": "projects/utf8parse/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Change to version 0.1.1\ngit checkout tags/v0.1.1\n\n# Build fuzzers and project binaries\ncargo fuzz build -O\n\n# Copy fuzzer binaries to $OUT\ncp $SRC/vte/utf8parse/fuzz/target/x86_64-unknown-linux-gnu/release/parse $OUT/\n"
  },
  {
    "path": "projects/utf8parse/fuzz/.gitignore",
    "content": "target\ncorpus\nartifacts\ncoverage\n"
  },
  {
    "path": "projects/utf8parse/fuzz/Cargo.toml",
    "content": "[package]\nname = \"utf8parse-fuzz\"\nversion = \"0.0.0\"\npublish = false\nedition = \"2018\"\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies]\nlibfuzzer-sys = \"0.4\"\n\n[dependencies.utf8parse]\npath = \"..\"\n\n[[bin]]\nname = \"parse\"\npath = \"fuzz_targets/parse.rs\"\ntest = false\ndoc = false\nbench = false\n"
  },
  {
    "path": "projects/utf8parse/fuzz/fuzz_targets/parse.rs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse utf8parse::{Parser, Receiver};\n\n// Create dummy receiver for fuzzing\nstruct FuzzReceiver;\nimpl Receiver for FuzzReceiver {\n    fn codepoint(&mut self, _c: char) {\n        // Do nothing\n    }\n\n    fn invalid_sequence(&mut self) {\n        // Do nothing\n    }\n}\n\nfuzz_target!(|data: &[u8]| {\n    if data.is_empty() {\n        // Skip this iteration if there is no data\n        return;\n    }\n\n    let mut parser = Parser::new();\n    let mut receiver = FuzzReceiver;\n\n    // Process parsing\n    fn process_byte_sequence(parser: &mut Parser, receiver: &mut FuzzReceiver, bytes: &[u8]) {\n        for &byte in bytes {\n            parser.advance(receiver, byte);\n        }\n    }\n\n    let mut remaining_data = data;\n\n    // Randomly create fuzz data with different constraint for fuzzing\n    match remaining_data.get(0) {\n        Some(&choice) => match choice % 3 {\n            0 => {\n                // Half and half\n                let half = remaining_data.len() / 2;\n                let (first_half, second_half) = remaining_data.split_at(half);\n                process_byte_sequence(&mut parser, &mut receiver, first_half);\n                process_byte_sequence(&mut parser, &mut receiver, second_half);\n            }\n            1 => {\n                // Split data into uneven portion\n                let chunk_size = (remaining_data[0] % 8) as usize + 1;\n                let (chunk, rest) = remaining_data.split_at(remaining_data.len().min(chunk_size));\n                process_byte_sequence(&mut parser, &mut receiver, chunk);\n                remaining_data = rest;\n\n                while !remaining_data.is_empty() {\n                    let chunk_size = (remaining_data[0] % 6) as usize + 1;\n                    let (chunk, rest) = remaining_data.split_at(remaining_data.len().min(chunk_size));\n                    process_byte_sequence(&mut parser, &mut receiver, chunk);\n                    remaining_data = rest;\n                }\n            }\n            2 => {\n                // Malformed input\n                let incomplete_seq = vec![0xF0];\n                process_byte_sequence(&mut parser, &mut receiver, &incomplete_seq);\n\n                let chunk_size = (remaining_data[0] % 5) as usize + 1;\n                let (chunk, _) = remaining_data.split_at(remaining_data.len().min(chunk_size));\n                process_byte_sequence(&mut parser, &mut receiver, chunk);\n            }\n            _ => {\n                // Should not reach here, fail safe\n            }\n        },\n        None => return,\n    }\n});\n"
  },
  {
    "path": "projects/utf8parse/project.yaml",
    "content": "homepage: \"https://docs.rs/vte/\"\nmain_repo: \"https://github.com/alacritty/vte.git\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/utf8proc/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y wget tar\n\nRUN git clone --depth 1 https://github.com/JuliaStrings/utf8proc.git\n\nRUN wget -O $SRC/utf8proc/test/NormalizationTest.txt https://www.unicode.org/Public/13.0.0/ucd/NormalizationTest.txt\nRUN wget -O $SRC/utf8proc/test/GraphemeBreakTest.txt https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest.txt\n\nWORKDIR $SRC/utf8proc/\nCOPY *.sh $SRC/\n"
  },
  {
    "path": "projects/utf8proc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n# Run the OSS-Fuzz script in the project\n$SRC/utf8proc/test/ossfuzz.sh\n"
  },
  {
    "path": "projects/utf8proc/project.yaml",
    "content": "homepage: \"http://juliastrings.github.io/utf8proc/\"\nlanguage: c\nprimary_contact: \"stevenj@alum.mit.edu\"\nauto_ccs:\n  - \"randy440088@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/JuliaStrings/utf8proc'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/utf8proc/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd build\nmake test\n"
  },
  {
    "path": "projects/util-linux/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y autoconf automake autopoint bison flex libtool pkg-config\nRUN git clone --depth 1 https://github.com/util-linux/util-linux\nWORKDIR util-linux\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/util-linux/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./tools/oss-fuzz.sh\n"
  },
  {
    "path": "projects/util-linux/project.yaml",
    "content": "homepage: \"https://github.com/util-linux/util-linux\"\nprimary_contact: \"ruediger.meier@ga-group.nl\"\nlanguage: c\nbuilds_per_day: 4\nauto_ccs:\n  - \"kzak@redhat.com\"\n  - \"evverx@gmail.com\"\n  - \"kerolasa@gmail.com\"\n  - \"gmazyland@gmail.com\"\n  - \"thomas@t-8ch.de\"\narchitectures:\n  - x86_64\n  - i386\nsanitizers:\n  - address\n  - undefined\n  - memory\nmain_repo: 'https://github.com/util-linux/util-linux'\nfile_github_issue: True\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n  - centipede\n"
  },
  {
    "path": "projects/uwebsockets/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --recursive https://github.com/uNetworking/uWebSockets.git uWebSockets\nWORKDIR uWebSockets\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/uwebsockets/build.sh",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd fuzzing\nmake oss-fuzz\n"
  },
  {
    "path": "projects/uwebsockets/project.yaml",
    "content": "homepage: \"https://github.com/uNetworking/uWebSockets\"\nlanguage: c++\nprimary_contact: \"alexhultman@gmail.com\"\nbuilds_per_day: 4\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: 'https://github.com/uNetworking/uWebSockets.git'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/v8/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y \\\n        lsb-release sudo pkg-config file libc++-18-dev libc++abi-18-dev\nRUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git\nENV PATH=/src/depot_tools:$PATH\nRUN fetch v8 && cd v8 && git checkout HEAD && gclient sync -D\nWORKDIR v8\n\nRUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections\nRUN ./build/install-build-deps.sh --no-prompt\nCOPY build.sh run_tests.sh $SRC/\n\nENV CLANG_TOOLCHAIN $SRC/v8/third_party/llvm-build/Release+Asserts\n"
  },
  {
    "path": "projects/v8/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Configure arguments for gn build\nARGS='is_asan = true\n is_component_build = false\n use_clang_modules = false\n symbol_level = 2\n forbid_non_component_debug_builds = false\n use_debug_fission = false\n use_dwarf5 = true\n target_cpu = \"x64\"\n target_os = \"linux\"\n use_reclient = false\n use_remoteexec = false\n use_siso = false\n treat_warnings_as_errors = false\n libcxx_is_shared = false\n v8_enable_backtrace = true\n v8_enable_slow_dchecks = true\n v8_enable_test_features = true\n v8_enable_fast_mksnapshot = true'\n\nif [[ -n \"${INDEXER_BUILD:-}\" ]]; then\n  ARGS=\"$ARGS is_debug=true v8_optimized_debug=false v8_enable_slow_dchecks=true clang_base_path=\\\"/opt/toolchain\\\"\"\nelse\n  ARGS=\"$ARGS is_debug=false v8_enable_slow_dchecks=false\"\nfi\n\n# Generate ninja file for build\ngn gen out/fuzz --args=\"$ARGS\"\necho $SANITIZER\n\n# Force re-linking.\nrm -f out/fuzz/d8\n\n# Build binary\nninja -C out/fuzz d8 -j$(nproc)\n\n# Copy binaries to $OUT\ncp ./out/fuzz/{d8,snapshot_blob.bin,*.so} $OUT\n"
  },
  {
    "path": "projects/v8/project.yaml",
    "content": "homepage: \"https://chromium.googlesource.com/v8/v8\"\nlanguage: c++\nmain_repo: \"https://chromium.googlesource.com/v8/v8\"\nfuzzing_engines:\n  - none\nsanitizers:\n  - address\n\nindexer:\n  targets:\n    - d8\n"
  },
  {
    "path": "projects/v8/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./tools/dev/gm.py quiet x64.release.check --progress=dots --exit-after-n-failures=5\n#./tools/dev/gm.py x64.release test262\n#./tools/dev/gm.py x64.release mozilla\n#./tools/dev/gm.py x64.release webkit\n"
  },
  {
    "path": "projects/validators/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/python-validators/validators validators\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/validators\n"
  },
  {
    "path": "projects/validators/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npython3 -m pip install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/validators/fuzz_validators.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport validators\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  targets = [\n      validators.uuid,\n      validators.url,\n      validators.slug,\n      validators.mac_address,\n      validators.ipv4,\n      validators.ipv6,\n      validators.iban,\n      validators.md5,\n      validators.sha1,\n      validators.sha224,\n      validators.sha256,\n      validators.sha512,\n      validators.iban,\n      validators.email,\n      validators.domain,\n      validators.card_number,\n      validators.visa,\n      validators.mastercard,\n      validators.amex,\n      validators.unionpay,\n      validators.diners,\n      validators.jcb,\n      validators.discover,\n      validators.btc_address,\n      validators.fi_business_id,\n  ]\n\n  try:\n    target = fdp.PickValueInList(targets)\n    target(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)))\n  except validators.ValidationFailure:\n    pass\n\n  try:\n    validators.length(fdp.ConsumeUnicodeNoSurrogates(\n        fdp.ConsumeIntInRange(0, 1024)),\n                      min_val=fdp.ConsumeIntInRange(1, 100),\n                      max_val=fdp.ConsumeIntInRange(1, 100))\n  except (validators.ValidationFailure, TypeError, AssertionError):\n    # Thrown by the functions.\n    pass\n\n  try:\n    validators.fi_ssn(\n        fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 1024)),\n        fdp.ConsumeBool())\n  except validators.ValidationFailure:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/validators/project.yaml",
    "content": "homepage: https://github.com/python-validators/validators\nmain_repo: https://github.com/python-validators/validators\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/valijson/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config cmake libcurlpp-dev libcurl4-openssl-dev\nRUN git clone --depth 1 https://github.com/tristanpenman/valijson\nCOPY run_tests.sh $SRC/\nWORKDIR valijson\nRUN cp $SRC/valijson/tests/fuzzing/oss-fuzz-build.sh $SRC/build.sh\n"
  },
  {
    "path": "projects/valijson/project.yaml",
    "content": "homepage: \"https://github.com/tristanpenman/valijson\"\nmain_repo: \"https://github.com/tristanpenman/valijson\"\nlanguage: c++\nprimary_contact: \"tristan@tristanpenman.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/valijson/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncd $SRC/valijson/build\n./test_suite\n"
  },
  {
    "path": "projects/varnish/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt install -y automake autoconf libtool pkg-config python3-docutils python3-sphinx libedit-dev libpcre2-dev libncurses-dev\nRUN git clone --recursive https://code.vinyl-cache.org/vinyl-cache/vinyl-cache\nCOPY run_tests.sh build.sh $SRC/\nWORKDIR $SRC/vinyl-cache\n"
  },
  {
    "path": "projects/varnish/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\n# build project\n./autogen.sh\n./configure --enable-oss-fuzz PCRE2_LIBS=-l:libpcre2-8.a\nmake -j2 -C include/\nmake -j2 -C lib/libvarnish/\nmake -j2 -C lib/libvgz/\nmake -j2 -C lib/libvsc/\nmake -j2 -C bin/varnishd/ esi_parse_fuzzer\ncp bin/varnishd/*_fuzzer $OUT/\n"
  },
  {
    "path": "projects/varnish/project.yaml",
    "content": "homepage: \"https://varnish-cache.org/\"\nlanguage: c\nprimary_contact: \"phk@varnish.org\"\nauto_ccs:\n  - \"bsdphk@gmail.com\"\n  - \"nils.goroll@uplex.de\"\n  - \"martin@varnish-software.com\"\nmain_repo: 'https://github.com/varnishcache/varnish-cache'\nfuzzing_engines:\n  - \"afl\"\n  - \"honggfuzz\"\n  - \"libfuzzer\"\n"
  },
  {
    "path": "projects/varnish/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer\nexport ASAN_OPTIONS=\"detect_leaks=0\"\n\n# Skip failing tests that failed in Docker container by temporarily moving them\nmkdir -p /tmp/skipped_tests\nmv bin/varnishtest/tests/c00057.vtc /tmp/skipped_tests/\nmv bin/varnishtest/tests/c00080.vtc /tmp/skipped_tests/\n\n# Run unit test\nmake check -j$(nproc)\n\n# Restore the skipped tests for integrity check\ncp /tmp/skipped_tests/* bin/varnishtest/tests/\nrm -rf /tmp/skipped_tests\n"
  },
  {
    "path": "projects/vitess/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go:ubuntu-24-04\nRUN git clone --depth 1 https://github.com/vitessio/vitess\nRUN git clone --depth 1 https://github.com/cncf/cncf-fuzzing\nCOPY build.sh $SRC/\nWORKDIR $SRC/vitess\n"
  },
  {
    "path": "projects/vitess/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncp $SRC/cncf-fuzzing/projects/vitess/vt_schema_fuzzer.go $SRC/vitess/go/test/fuzzing/\n$SRC/cncf-fuzzing/projects/vitess/build.sh\n"
  },
  {
    "path": "projects/vitess/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/vitessio/vitess\" \nprimary_contact: \"andres@planetscale.com\"\nauto_ccs :\n  - \"adam@adalogics.com\"\n  - \"team-ps-vitess@planetscale.com\"\n  - \"manan@planetscale.com\"\n  - \"harshit@planetscale.com\"\n  - \"florent@planetscale.com\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/vitessio/vitess'\n"
  },
  {
    "path": "projects/vlc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n  pkg-config cmake flex bison gettext libglu1-mesa-dev ninja-build \\\n  python3-pip nasm yasm\nRUN pip3 install meson\nRUN git clone --depth 1 https://code.videolan.org/videolan/vlc.git vlc\nRUN git clone --depth 1 https://code.videolan.org/VideoLAN.org/vlc-fuzz-corpus.git vlc/fuzz-corpus\nWORKDIR vlc\nCOPY build.sh fuzzing-modules.patch $SRC/\n"
  },
  {
    "path": "projects/vlc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build dependencies without instrumentation\nCFLAGS_SAVE=\"$CFLAGS\"\nCXXFLAGS_SAVE=\"$CXXFLAGS\"\nunset CFLAGS\nunset CXXFLAGS\nexport AFL_NOOPT=1\n\n# But we need libc++\nexport CXXFLAGS=\"-stdlib=libc++\"\n\nmkdir contrib/contrib-build\ncd contrib/contrib-build\n../bootstrap\n\n# Disable X11/xlib in FFmpeg to avoid runtime dependency on libX11\nsed -i '/--target-os=linux --enable-pic/a FFMPEGCONF += --disable-xlib --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-libxcb-shape' ../src/ffmpeg/rules.mak\n\nmake V=1 -j$(nproc) \\\n    .matroska \\\n    .ogg \\\n    .libxml2 \\\n    .flac \\\n    .opus \\\n    .vorbis \\\n    .speex \\\n    .speexdsp \\\n    .theora \\\n    .dav1d \\\n    .vpx \\\n    .mpg123 \\\n    .dvbpsi \\\n    .mpcdec \\\n    .ffmpeg\n\ncd ../../\n\n# Resume instrumentation\nexport CFLAGS=\"${CFLAGS_SAVE}\"\nexport CXXFLAGS=\"${CXXFLAGS_SAVE}\"\nunset AFL_NOOPT\n\n# Use OSS-Fuzz environment rather than hardcoded setup.\nsed -i 's/-fsanitize-coverage=trace-pc-guard//g' ./configure.ac\nsed -i 's/-fsanitize-coverage=trace-cmp//g' ./configure.ac\nsed -i 's/-fsanitize-coverage=trace-pc//g' ./configure.ac\nsed -i 's/-lFuzzer//g'  ./configure.ac\n\n# Use default -lc++\nsed -i 's/-lstdc++ //g' ./configure.ac\nsed -i 's/-lstdc++/$(NULL)/g' ./test/Makefile.am\n\nsed -i 's/..\\/..\\/lib\\/libvlc_internal.h/lib\\/libvlc_internal.h/g' ./test/src/input/decoder.c\n\n# Add extra codec, packetizer, and demux modules for broader fuzzing coverage.\n# See fuzzing-modules.patch for the actual changes.\npatch -p1 < $SRC/fuzzing-modules.patch\n\n# Register the MPC demux module in the static module list (the module is linked\n# via fuzzing-modules.patch but also needs to be in the PLUGINS macro).\nsed -i 's/f(demux_ogg)/f(demux_mpc) \\\\\\n    f(demux_ogg)/' ./test/src/input/demux-run.c\n\n# clang is used to link the binary since there are no cpp sources (but we have\n# cpp modules), force clang++ usage\ntouch ./test/dummy.cpp\n\n# Rework implicit RULEs so that the final sed add dummy.cpp\nRULE=vlc_demux_libfuzzer\nRULE_SOURCES=\"${RULE}_SOURCES = vlc-demux-libfuzzer.c\"\nsed -i \"s/${RULE}_LDADD/${RULE_SOURCES}\\n${RULE}_LDADD/g\" ./test/Makefile.am\nRULE=vlc_demux_run\nRULE_SOURCES=\"${RULE}_SOURCES = vlc-demux-run.c\"\nsed -i \"s/${RULE}_LDADD/${RULE_SOURCES}\\n${RULE}_LDADD/g\" ./test/Makefile.am\n\n# Add dummy.cpp to all rules\nsed -i 's/_SOURCES = /_SOURCES = dummy.cpp /g' ./test/Makefile.am\n\n# Ensure that we compile with the correct link flags.\nRULE=\"vlc_demux_libfuzzer_LDADD\"\nFUZZ_LDFLAGS=\"vlc_demux_libfuzzer_LDFLAGS=\\${LIB_FUZZING_ENGINE}\"\nsed -i \"s/${RULE}/${FUZZ_LDFLAGS}\\n${RULE}/g\" ./test/Makefile.am\n\nRULE=\"vlc_demux_dec_libfuzzer_LDADD\"\nFUZZ_LDFLAGS=\"vlc_demux_dec_libfuzzer_LDFLAGS=\\${LIB_FUZZING_ENGINE}\"\nsed -i \"s/${RULE}/${FUZZ_LDFLAGS}\\n${RULE}/g\" ./test/Makefile.am\n\n./bootstrap\n\n./configure --disable-lua \\\n            --disable-nls \\\n            --disable-shared \\\n            --enable-static \\\n            --enable-vlc=no \\\n            --disable-xcb \\\n            --disable-alsa \\\n            --disable-libva \\\n            --with-libfuzzer\nmake V=1 -j$(nproc)\n\ncp ./test/vlc-demux-dec-libfuzzer $OUT/\n\n# Prepare for removing sdp.dict without breaking the build\nrm fuzz-corpus/dictionaries/sdp.dict || true\nfind fuzz-corpus/dictionaries -name \"*dict\" -exec cat {} \\; -exec echo \"\" \\; >> $OUT/vlc-demux-dec-libfuzzer.dict\n\nfor i in fuzz-corpus/seeds/* fuzz-corpus/dictionaries/*.dict\ndo\n    target=`basename \"$i\" .dict`\n    outfile=\"$OUT/vlc-demux-dec-libfuzzer\"\n    # the target will be selected from the command name\n    outfile_target=\"$outfile-$target\"\n\n    # Copy dict or seeds\n    if [ -f \"$i\" ]; then\n        cp \"$i\" \"${outfile_target}.dict\"\n    else\n        zip -jr \"${outfile_target}_seed_corpus.zip\" \"$i\"/*\n    fi\n\n    # Create one binary per target\n    cp \"$outfile\" \"$outfile_target\"\ndone\n"
  },
  {
    "path": "projects/vlc/fuzzing-modules.patch",
    "content": "diff --git a/test/Makefile.am b/test/Makefile.am\nindex 7eb4ab5..cdbd28a 100644\n--- a/test/Makefile.am\n+++ b/test/Makefile.am\n@@ -480,8 +480,17 @@ libvlc_demux_run_la_LIBADD += \\\n \t../modules/libpacketizer_mpegaudio_plugin.la \\\n \t../modules/libpacketizer_mpegvideo_plugin.la \\\n \t../modules/libpacketizer_vc1_plugin.la \\\n+\t../modules/libpacketizer_av1_plugin.la \\\n+\t../modules/libpacketizer_mjpeg_plugin.la \\\n \t../modules/librawaud_plugin.la \\\n \t../modules/librawvid_plugin.la \\\n+\t../modules/librawdv_plugin.la \\\n+\t../modules/libvobsub_plugin.la \\\n+\t../modules/libimage_plugin.la \\\n+\t../modules/libvc1_plugin.la \\\n+\t../modules/libmpgv_plugin.la \\\n+\t../modules/libdemux_stl_plugin.la \\\n+\t../modules/libmpc_plugin.la \\\n \t../modules/libfilesystem_plugin.la \\\n \t../modules/libxml_plugin.la \\\n \t../modules/libogg_plugin.la \\\n@@ -522,13 +530,28 @@ libvlc_demux_dec_run_la_LIBADD += \\\n \t../modules/libsubsusf_plugin.la \\\n \t../modules/libsvcdsub_plugin.la \\\n \t../modules/libtextst_plugin.la \\\n-\t../modules/libsubstx3g_plugin.la\n+\t../modules/libsubstx3g_plugin.la \\\n+\t../modules/libcdg_plugin.la \\\n+\t../modules/libspdif_plugin.la \\\n+\t../modules/libflac_plugin.la \\\n+\t../modules/libopus_plugin.la \\\n+\t../modules/libvorbis_plugin.la \\\n+\t../modules/libspeex_plugin.la \\\n+\t../modules/libtheora_plugin.la \\\n+\t../modules/libdav1d_plugin.la \\\n+\t../modules/libvpx_plugin.la \\\n+\t../modules/libmpg123_plugin.la \\\n+\t../modules/liboggspots_plugin.la\n if HAVE_ZVBI\n libvlc_demux_dec_run_la_LIBADD += ../modules/libzvbi_plugin.la\n endif\n if HAVE_TELX\n libvlc_demux_dec_run_la_LIBADD += ../modules/libtelx_plugin.la\n endif\n+if HAVE_AVCODEC\n+libvlc_demux_dec_run_la_CPPFLAGS += -DHAVE_AVCODEC\n+libvlc_demux_dec_run_la_LIBADD += ../modules/libavcodec_plugin.la ../modules/libavcodec_common.la\n+endif\n endif\n EXTRA_LTLIBRARIES += libvlc_demux_dec_run.la\n \ndiff --git a/test/src/input/demux-run.c b/test/src/input/demux-run.c\nindex c71afa2..c4c2ebd 100644\n--- a/test/src/input/demux-run.c\n+++ b/test/src/input/demux-run.c\n@@ -417,7 +417,18 @@ int vlc_demux_process_memory(const struct vlc_run_args *args,\n     f(codec_subsusf) \\\n     f(codec_svcdsub) \\\n     f(codec_textst) \\\n-    f(codec_substx3g)\n+    f(codec_substx3g) \\\n+    f(codec_cdg) \\\n+    f(codec_spdif) \\\n+    f(codec_flac) \\\n+    f(codec_opus) \\\n+    f(codec_vorbis) \\\n+    f(codec_speex) \\\n+    f(codec_theora) \\\n+    f(codec_dav1d) \\\n+    f(codec_vpx) \\\n+    f(codec_mpg123) \\\n+    f(codec_oggspots)\n #else\n #define DECODER_PLUGINS(f)\n #endif\n@@ -464,11 +475,27 @@ int vlc_demux_process_memory(const struct vlc_run_args *args,\n     f(packetizer_mpegaudio) \\\n     f(packetizer_mpegvideo) \\\n     f(packetizer_vc1) \\\n+    f(packetizer_av1) \\\n+    f(packetizer_mjpeg) \\\n     f(demux_rawvid) \\\n     f(demux_rawaud) \\\n+    f(demux_rawdv) \\\n+    f(demux_vobsub) \\\n+    f(demux_image) \\\n+    f(demux_nuv) \\\n+    f(demux_vc1) \\\n+    f(demux_mpeg_mpgv) \\\n+    f(demux_demux_stl) \\\n     f(demux_ogg) \\\n+    PLUGIN_AVCODEC(f) \\\n     DECODER_PLUGINS(f)\n \n+#ifdef HAVE_AVCODEC\n+# define PLUGIN_AVCODEC(f) f(codec_avcodec_avcodec)\n+#else\n+# define PLUGIN_AVCODEC(f)\n+#endif\n+\n #ifdef HAVE_DVBPSI\n # define PLUGIN_TS(f) f(demux_mpeg_ts)\n #else\n"
  },
  {
    "path": "projects/vlc/project.yaml",
    "content": "homepage: \"https://github.com/videolan/vlc\"\nlanguage: c\nprimary_contact: \"security@videolan.org\"\nauto_ccs:\n  - \"le.businessman@gmail.com\"\n  - \"thomas.guillem@gmail.com\"\n  - \"alexandre.janniaux@gmail.com\"\n  - \"kempfjb@gmail.com\"\n  - \"courmisch@gmail.com\"\n  - \"robux4@gmail.com\"\n  - \"epirat07@gmail.com\"\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n  - \"adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/videolan/vlc'\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n"
  },
  {
    "path": "projects/volcano/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/volcano-sh/volcano\nWORKDIR volcano\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/volcano/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./hack/oss-fuzz-build.sh\n"
  },
  {
    "path": "projects/volcano/project.yaml",
    "content": "homepage: \"https://volcano.sh/\"\nlanguage: go\nprimary_contact: \"cxz2536818783@gmail.com\"\nmain_repo: \"https://github.com/volcano-sh/volcano\"\nauto_ccs:\n  - \"adam@adalogics.com\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/vorbis/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake ffmpeg libtool pkg-config python3 wget\nRUN python3 -m pip install --upgrade pip && python3 -m pip install corpus-replicator\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/ogg.git\nRUN git clone --depth 1 https://gitlab.xiph.org/xiph/vorbis.git\nRUN corpus-replicator -o decode_corpus audio_vorbis_ogg_libvorbis.yml audio\n# TODO: remove `people.xiph.org` lines once upstream build script is updated\nRUN mkdir people.xiph.org/\nRUN touch people.xiph.org/dummy.ogg\nWORKDIR vorbis\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/vorbis/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n. contrib/oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/vorbis/project.yaml",
    "content": "homepage: \"https://xiph.org/vorbis/\"\nlanguage: c++\nprimary_contact: \"daede003@umn.edu\"\nauto_ccs:\n  - paul.l.kehrer@gmail.com\n  - alex.gaynor@gmail.com\n  - le.businessman@gmail.com\nvendor_ccs:\n  - media-alerts@mozilla.com\n  - twsmith@mozilla.com\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\nmain_repo: 'https://gitlab.xiph.org/xiph/vorbis.git'\n"
  },
  {
    "path": "projects/vtpm-td/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n# Install packages we need to build dependencies\nRUN apt-get update && apt-get install -y nasm\nRUN git clone --depth 1 https://github.com/intel/vtpm-td.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/vtpm-td"
  },
  {
    "path": "projects/vtpm-td/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nset -eox pipefail\ncd $SRC/vtpm-td\n\nFUZZ_CRATE_DIRS=$(find . -type d -name fuzz -exec dirname $(readlink -f {}) \\;)\n\ngit submodule update --init --recursive\nbash sh_script/pre-build.sh\n\nfor CRATE_DIR in ${FUZZ_CRATE_DIRS[@]};\ndo\n  if [[ $CRATE_DIR =~ \"deps\" ]]; then\n    continue\n  else    \n    echo \"Building crate: $CRATE_DIR\"\n    cd $CRATE_DIR\n    cargo fuzz build -O\n    FUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release\n    fuzz_tcs=$(cargo fuzz list)\n    for tcs in ${fuzz_tcs[@]}; do\n      if [[ $tcs =~ \"afl\" ]]; then\n        continue\n      else\n        FUZZ_TARGET_NAME=$tcs\n        CRATE_NAME=$(basename $CRATE_DIR)\n       cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/$CRATE_NAME-$FUZZ_TARGET_NAME\n      fi\n    done\n  fi\ndone"
  },
  {
    "path": "projects/vtpm-td/project.yaml",
    "content": "homepage: \"https://github.com/intel/vtpm-td\"\nlanguage: rust\nprimary_contact: \"wei3.liu@intel.com\"\nauto_ccs:\n  - \"jiewen.yao@intel.com\"\n  - \"min.m.xu@intel.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nmain_repo: 'https://github.com/intel/vtpm-td.git'"
  },
  {
    "path": "projects/vulkan-loader/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && \\\n    apt-get install -y \\\n    build-essential \\\n    autoconf \\\n    automake \\\n    libtool \\\n    pkg-config \\\n    libx11-xcb-dev \\\n    libxkbcommon-dev \\\n    libxrandr-dev\n\n# Vulkan-Loader depends on the header file in Vulkan-Headers\nRUN git clone https://github.com/khronosgroup/Vulkan-Headers vulkan-headers\nRUN git clone https://github.com/khronosgroup/Vulkan-Loader vulkan-loader\nCOPY fuzzers/*.h fuzzers/*_fuzzer.c *.sh vulkan-keywords.dict *.diff $SRC/\nWORKDIR $SRC/vulkan-loader\n"
  },
  {
    "path": "projects/vulkan-loader/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit apply --ignore-space-change --ignore-whitespace $SRC/fuzz-patch.diff\n\nmkdir -p build\ncd build\n\nsed -i 's/fput/\\/\\/fput/g' $SRC/vulkan-loader/loader/log.c\n\ncmake -DUPDATE_DEPS=ON -DCMAKE_BUILD_TYPE=Release ..\nmake -j$(nproc)\n\nar rcs $OUT/libvulkan.a $SRC/vulkan-loader/build/loader/CMakeFiles/vulkan.dir/*.o\n\n$CC $CFLAGS -I$SRC/vulkan-loader/loader \\\n    -I$SRC/vulkan-loader/loader/generated \\\n    -I$SRC/vulkan-headers/include \\\n    -I$SRC/ \\\n    -DENABLE_FILE_CALLBACK \\\n    -c $SRC/instance_create_advanced_fuzzer.c -o instance_create_advanced_fuzzer.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE instance_create_advanced_fuzzer.o \\\n    -o $OUT/instance_create_advanced_fuzzer -lpthread $OUT/libvulkan.a\nzip -q $OUT/instance_create_advanced_fuzzer_seed_corpus.zip $SRC/vulkan-loader/tests/corpus/*\ncp $SRC/vulkan-keywords.dict $OUT/instance_create_advanced_fuzzer.dict\n\n$CC $CXXFLAGS -I$SRC/vulkan-loader/loader \\\n    -I$SRC/vulkan-loader/loader/generated \\\n    -I$SRC/vulkan-headers/include \\\n    -DSPLIT_INPUT \\\n    -c $SRC/instance_enumerate_fuzzer.c -o instance_enumerate_fuzzer_split_input.o\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE instance_enumerate_fuzzer_split_input.o \\\n    -o $OUT/instance_enumerate_fuzzer_split_input -lpthread $OUT/libvulkan.a\ncp $SRC/vulkan-keywords.dict $OUT/instance_enumerate_fuzzer_split_input.dict\n\nfor fuzzer in instance_create_fuzzer json_load_fuzzer settings_fuzzer instance_enumerate_fuzzer; do\n    #fuzz_basename=$(basename -s .c $fuzzers)\n    $CC $CXXFLAGS -I$SRC/vulkan-loader/loader \\\n        -I$SRC/vulkan-loader/loader/generated \\\n        -I$SRC/vulkan-headers/include \\\n        -c $SRC/$fuzzer.c -o $fuzzer.o\n\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.o \\\n        -o $OUT/$fuzzer -lpthread $OUT/libvulkan.a\n\n    zip -q $OUT/${fuzzer}_seed_corpus.zip $SRC/vulkan-loader/tests/corpus/*\n    cp $SRC/vulkan-keywords.dict $OUT/$fuzzer.dict\ndone\n"
  },
  {
    "path": "projects/vulkan-loader/fuzz-patch.diff",
    "content": "diff --git a/loader/loader_json.c b/loader/loader_json.c\nindex 805d278c0..cdebd2a69 100644\n--- a/loader/loader_json.c\n+++ b/loader/loader_json.c\n@@ -38,6 +38,8 @@\n #include \"loader.h\"\n #include \"log.h\"\n \n+extern void create_callback_file(const char *filename);\n+\n #if COMMON_UNIX_PLATFORMS\n #include <fcntl.h>\n #include <sys/stat.h>\n@@ -98,7 +100,14 @@ static VkResult loader_read_entire_file(const struct loader_instance *inst, cons\n     struct stat stats = {0};\n     VkResult res = VK_SUCCESS;\n \n+    // fprintf(stderr, \"loader_get_json: Reading JSON file %s\\n\", filename);\n     file = fopen(filename, \"rb\");\n+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n+    if (file == NULL) {\n+        create_callback_file(filename);\n+        file = fopen(filename, \"rb\");\n+    }\n+#endif\n     if (NULL == file) {\n         loader_log(inst, VULKAN_LOADER_ERROR_BIT, 0, \"loader_get_json: Failed to open JSON file %s\", filename);\n         res = VK_ERROR_INITIALIZATION_FAILED;\n"
  },
  {
    "path": "projects/vulkan-loader/fuzzers/fuzz_header.h",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nuint8_t *global_fuzz_data;\nsize_t global_size;\n\nchar *callback1 = NULL;\nchar *callback2 = NULL;\nchar *callback3 = NULL;\nchar *callback4 = NULL;\n\nvoid fuzz_init(const uint8_t *data, size_t size) {\n    global_fuzz_data = (uint8_t *)data;\n    global_size = size;\n    \n    callback1 = NULL;\n    callback2 = NULL;\n    callback3 = NULL;\n    callback4 = NULL;\n}\n\n#ifdef ENABLE_FILE_CALLBACK\nvoid create_callback_file(const char *filename) {\n  fprintf(stderr, \"create_callback_file: Creating file %s\\n\", filename);\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return;\n  }\n  fwrite(global_fuzz_data, global_size, 1, fp);\n  fclose(fp);\n\n  if (callback1 == NULL) {\n    callback1 = strdup(filename);\n  } else if (callback2 == NULL) {\n    callback2 = strdup(filename);\n  } else if (callback3 == NULL) {\n    callback3 = strdup(filename);\n  } else if (callback4 == NULL) {\n    callback4 = strdup(filename);\n  } else {\n    fprintf(stderr, \"create_callback_file: Too many callbacks created, ignoring %s\\n\", filename);\n  }\n}\n\n#else\nvoid create_callback_file(const char *filename) {}\n#endif\n\nvoid fuzz_cleanup() {\n  if (callback1) {\n unlink(callback1);    \n    free(callback1);\n   \n    callback1 = NULL;\n  }\n  if (callback2) {\n unlink(callback2);    \n    free(callback2);\n    callback2 = NULL;\n  }\n  if (callback3) {\n unlink(callback3);      \n    free(callback3);\n    callback3 = NULL;\n  }\n  if (callback4) {\n     unlink(callback4);\n    free(callback4);\n    callback4 = NULL;\n  }\n}"
  },
  {
    "path": "projects/vulkan-loader/fuzzers/instance_create_advanced_fuzzer.c",
    "content": "/* Copyright 2025 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"cJSON.h\"\n#include \"loader.h\"\n\n#include \"fuzz_header.h\"\n\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n  setenv(\"HOME\", \"/tmp\", 1);\n  system(\"mkdir -p $HOME/.local/share/vulkan/implicit_layer.d\");\n  system(\"mkdir -p $HOME/.local/share/vulkan/loader_settings.d\");\n  system(\"mkdir -p $HOME/.local/share/vulkan/icd.d\");\n  return 0;\n}\n\n/*\n * Create config files for given path and data.\n */\nint create_config_file(const char* config_path, const char* config_filename, const uint8_t* data, size_t size) {\n  char filename[512];\n  char path[256];\n  // char command[256];\n\n  sprintf(path, \"%s/%s\", getenv(\"HOME\"), config_path);\n  //sprintf(command, \"mkdir -p %s\", path);\n\n  //system(command);\n\n  sprintf(filename, \"%s/%s\", path, config_filename);\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 1;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  return 0;\n}\n\n/*\n * Remove config file\n */\nvoid remove_config_file(const char* config_path, const char* config_filename) {\n  char filename[512];\n  sprintf(filename, \"%s/%s/%s\", getenv(\"HOME\"), config_path, config_filename);\n  unlink(filename);\n}\n\n/*\n * Targets the instance creation.\n */\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  if (size < 3*sizeof(size_t)) {\n    return 0;\n  }\n\n  // Split the loaders into two different parts so the files\n  // are independently seeded with fuzz data.\n  size_t first_size = (*(size_t*)data) % 40000;\n  size_t second_size = (*(size_t*)(data + sizeof(size_t))) % 40000;\n  size_t third_size = (*(size_t*)(data + 2*sizeof(size_t))) % 40000;\n\n  data += 3*sizeof(size_t); // Move past the first two integers\n  size -= 3*sizeof(size_t); // Adjust size to account for the first two integers\n  size_t total_size_needed = first_size + second_size + third_size;\n  if (size <= total_size_needed) {\n    return 0;\n  }\n  int result = create_config_file(\".local/share/vulkan/implicit_layer.d\", \"complex_layer.json\", data, first_size);\n  if (result) {\n    return 0;\n  }\n\n  data += first_size;\n  size -= first_size;\n  result = create_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\", data, second_size);\n  if (result) {\n    return 0;\n  }\n\n  data += second_size;\n  size -= second_size;\n  result = create_config_file(\".local/share/vulkan/loader_settings.d\", \"icd_test.json\", data, third_size);\n  if (result) {\n    return 0;\n  }\n  data += third_size;\n  size -= third_size;\n\n  fuzz_init(data, size);\n\n  setenv(\"VK_LOADER_LAYERS_ENABLE\", \"all\", 1);\n\n\n  VkInstance inst = {0};\n  char *instance_layers[] = {\n    \"VK_LAYER_KHRONOS_validation\",\n    \"VK_LAYER_test_layer_1\",\n    \"VK_LAYER_test_layer_2\"\n  };\n  const VkApplicationInfo app = {\n      .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,\n      .pNext = NULL,\n      .pApplicationName = \"TEST_APP\",\n      .applicationVersion = 0,\n      .pEngineName = \"TEST_ENGINE\",\n      .engineVersion = 0,\n      .apiVersion = VK_API_VERSION_1_0,\n  };\n  VkInstanceCreateInfo inst_info = {\n      .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,\n      .pNext = NULL,\n      .pApplicationInfo = &app,\n      .enabledLayerCount = 1,\n      .ppEnabledLayerNames = (const char *const *)instance_layers,\n      .enabledExtensionCount = 0,\n      .ppEnabledExtensionNames = NULL,\n  };\n  VkResult err = vkCreateInstance(&inst_info, NULL, &inst);\n  if (err != VK_SUCCESS) {\n    goto out;\n  }\n  else {\n\n  }\n\n  vkDestroyInstance(inst, NULL);\n\nout:\n  // Clean up config files\n  remove_config_file(\".local/share/vulkan/implicit_layer.d\", \"complex_layer.json\");\n  remove_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\");\n  remove_config_file(\".local/share/vulkan/icd.d\", \"icd_test.json\");\n\n\n  fuzz_cleanup();\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/vulkan-loader/fuzzers/instance_create_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"cJSON.h\"\n#include \"loader.h\"\n#include \"fuzz_header.h\"\n\n/*\n * Create config files for given path and data.\n */\nint create_config_file(const char* config_path, const char* config_filename, const uint8_t* data, size_t size) {\n  char filename[512];\n  char path[256];\n  char command[256];\n\n  sprintf(path, \"%s/%s\", getenv(\"HOME\"), config_path);\n  sprintf(command, \"mkdir -p %s\", path);\n\n  system(command);\n\n  sprintf(filename, \"%s/%s\", path, config_filename);\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 1;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  return 0;\n}\n\n/*\n * Remove config file\n */\nvoid remove_config_file(const char* config_path, const char* config_filename) {\n  char filename[512];\n  sprintf(filename, \"%s/%s/%s\", getenv(\"HOME\"), config_path, config_filename);\n  unlink(filename);\n}\n\n/*\n * Targets the instance creation.\n */\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  setenv(\"HOME\", \"/tmp\", 1);\n\n  // Create implicit layer configuration file\n  int result = create_config_file(\".local/share/vulkan/implicit_layer.d\", \"complex_layer.json\", data, size);\n  if (result) {\n    return 0;\n  }\n  \n  // Create loader configuration file\n  result = create_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\", data, size);\n  if (result) {\n    return 0;\n  }\n\n  // Create icd configuration file\n  result = create_config_file(\".local/share/vulkan/icd.d\", \"icd_test.json\", data, size);\n  if (result) {\n    return 0;\n  }\n\n  setenv(\"VK_LOADER_LAYERS_ENABLE\", \"all\", 1);\n\n\n  VkInstance inst = {0};\n  char *instance_layers[] = {\n    \"VK_LAYER_KHRONOS_validation\",\n    \"VK_LAYER_test_layer_1\",\n    \"VK_LAYER_test_layer_2\"\n  };\n  const VkApplicationInfo app = {\n      .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,\n      .pNext = NULL,\n      .pApplicationName = \"TEST_APP\",\n      .applicationVersion = 0,\n      .pEngineName = \"TEST_ENGINE\",\n      .engineVersion = 0,\n      .apiVersion = VK_API_VERSION_1_0,\n  };\n  VkInstanceCreateInfo inst_info = {\n      .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,\n      .pNext = NULL,\n      .pApplicationInfo = &app,\n      .enabledLayerCount = 1,\n      .ppEnabledLayerNames = (const char *const *)instance_layers,\n      .enabledExtensionCount = 0,\n      .ppEnabledExtensionNames = NULL,\n  };\n  VkResult err = vkCreateInstance(&inst_info, NULL, &inst);\n  if (err != VK_SUCCESS) {\n    goto out;\n  }\n\n  vkDestroyInstance(inst, NULL);\n\nout:\n  // Clean up config files\n  remove_config_file(\".local/share/vulkan/implicit_layer.d\", \"complex_layer.json\");\n  remove_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\");\n  remove_config_file(\".local/share/vulkan/icd.d\", \"icd_test.json\");\n\n  return 0;\n}"
  },
  {
    "path": "projects/vulkan-loader/fuzzers/instance_enumerate_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"cJSON.h\"\n#include \"loader.h\"\n#include \"fuzz_header.h\"\n\n#define MAX_SIZE = 64000\nint LLVMFuzzerInitialize(int *argc, char ***argv) {\n  setenv(\"HOME\", \"/tmp\", 1);\n  system(\"mkdir -p $HOME/.local/share/vulkan/implicit_layer.d\");\n  system(\"mkdir -p $HOME/.local/share/vulkan/loader_settings.d\");\n  return 0;\n}\n\n/*\n * Create config files for given path and data.\n */\nint create_config_file(const char* config_path, const char* config_filename, const uint8_t* data, size_t size) {\n  char filename[512];\n  char path[256];\n\n\n  sprintf(path, \"%s/%s\", getenv(\"HOME\"), config_path);\n  sprintf(filename, \"%s/%s\", path, config_filename);\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 1;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  return 0;\n}\n\n/*\n * Remove config file\n */\nvoid remove_config_file(const char* config_path, const char* config_filename) {\n  char filename[512];\n  sprintf(filename, \"%s/%s/%s\", getenv(\"HOME\"), config_path, config_filename);\n  unlink(filename);\n}\n\n/*\n * Targets the instance extension enumeration.\n */\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n\n# ifdef SPLIT_INPUT\n  if (size < 2*sizeof(size_t)) {\n    return 0;\n  }\n\n  // Split the loaders into two different parts so the files\n  // are independently seeded with fuzz data.\n  size_t first_size = (*(size_t*)data) % 64000;\n  size_t second_size = (*(size_t*)(data + sizeof(size_t))) % 64000;\n\n  data += 2*sizeof(size_t); // Move past the first two integers\n  size -= 2*sizeof(size_t); // Adjust size to account for the first two integers\n  size_t total_size_needed = first_size + second_size;\n  if (size <= total_size_needed) {\n    return 0;\n  }\n  int result = create_config_file(\".local/share/vulkan/implicit_layer.d\", \"complex_layer.json\", data, first_size);\n  if (result) {\n    return 0;\n  }\n\n  data += first_size;\n\n  result = create_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\", data, second_size);\n  if (result) {\n    return 0;\n  }\n#else\n  int result = create_config_file(\".local/share/vulkan/implicit_layer.d\", \"complex_layer.json\", data, size);\n  if (result) {\n    return 0;\n  }\n\n  result = create_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\", data, size);\n  if (result) {\n    return 0;\n  }\n#endif\n\n\n  //printf(\"Status: %d\\n\", (int)ms);\n  setenv(\"VK_LOADER_LAYERS_ENABLE\", \"all\", 1);\n\n  uint32_t pPropertyCount = 0;\n  VkResult vk_result = vkEnumerateInstanceExtensionProperties(\"test_auto\", &pPropertyCount, NULL);\n  \n  if (vk_result == VK_SUCCESS) {\n  \n    VkExtensionProperties* pProperties = (VkExtensionProperties*)malloc(sizeof(VkExtensionProperties) * pPropertyCount); \n  \n    vkEnumerateInstanceExtensionProperties(\"test_auto\", &pPropertyCount, pProperties);\n    \n    free(pProperties);\n  }\n  // Clean up config files\n  remove_config_file(\".local/share/vulkan/implicit_layer.d\", \"complex_layer.json\");\n  remove_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\");\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/vulkan-loader/fuzzers/json_load_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"cJSON.h\"\n#include \"loader.h\"\n#include \"fuzz_header.h\"\n\n/*\n * Targets the custom version of cJson.\n */\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  char filename[256];\n  sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 0;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  cJSON *json = NULL;\n  loader_get_json(NULL, filename, &json);\n\n  if (json == NULL) {\n    goto out;\n  }\n  bool out_of_mem = false;\n  char *json_data = loader_cJSON_Print(json, &out_of_mem);\n\n  if (json_data != NULL) {\n    free(json_data);\n  }\n\n  if (json != NULL) {\n    loader_cJSON_Delete(json);\n  }\n\nout:\n  unlink(filename);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/vulkan-loader/fuzzers/settings_fuzzer.c",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"cJSON.h\"\n#include \"loader.h\"\n#include \"fuzz_header.h\"\n\n/*\n * Create config files for given path and data.\n */\nint create_config_file(const char* config_path, const char* config_filename, const uint8_t* data, size_t size) {\n  char filename[512];\n  char path[256];\n  char command[256];\n\n  sprintf(path, \"%s/%s\", getenv(\"HOME\"), config_path);\n  sprintf(command, \"mkdir -p %s\", path);\n\n  system(command);\n\n  sprintf(filename, \"%s/%s\", path, config_filename);\n\n  FILE *fp = fopen(filename, \"wb\");\n  if (!fp) {\n    return 1;\n  }\n  fwrite(data, size, 1, fp);\n  fclose(fp);\n\n  return 0;\n}\n\n/*\n * Remove config file\n */\nvoid remove_config_file(const char* config_path, const char* config_filename) {\n  char filename[512];\n  sprintf(filename, \"%s/%s/%s\", getenv(\"HOME\"), config_path, config_filename);\n  unlink(filename);\n}\n\n/*\n * Targets the settings parser.\n */\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  setenv(\"HOME\", \"/tmp\", 1);\n\n  // Create loader configuration file\n  int result = create_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\", data, size);\n  if (result) {\n    return 0;\n  }\n\n  update_global_loader_settings();\n  update_global_loader_settings();\n  get_current_settings_and_lock(NULL);\n  release_current_settings_lock(NULL);\n  struct loader_layer_list settings_layers = {0};\n\n  bool should_search_for_other_layers = true;\n  get_settings_layers(NULL, &settings_layers, &should_search_for_other_layers);\n  // Free allocated memory\n  loader_delete_layer_list_and_properties(NULL, &settings_layers);\n  should_skip_logging_global_messages(0);\n  update_global_loader_settings();\n  teardown_global_loader_settings();\n\n  // Clean up config file\n  remove_config_file(\".local/share/vulkan/loader_settings.d\", \"vk_loader_settings.json\");\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/vulkan-loader/project.yaml",
    "content": "homepage: \"https://github.com/khronosgroup/Vulkan-Loader\"\nmain_repo: \"https://github.com/khronosgroup/Vulkan-Loader.git\"\nprimary_contact: \"charles@lunarg.com\"\nlanguage: c\nvendor_ccs:\n- \"david@adalogics.com\"\n- \"arthur.chan@adalogics.com\"\n- \"fuzzing@fuchsia.dev\"\n"
  },
  {
    "path": "projects/vulkan-loader/vulkan-keywords.dict",
    "content": "\"\\\"name\\\":\"\n\"\\\"device_extensions\\\":\"\n\"\\\"api_version\\\":\"\n\"\\\"default\\\":\"\n\"\\\"dependence\\\":\"\n\"\\\"spec_version\\\":\"\n\"\\\"view\\\":\"\n\"\\\"min\\\":\"\n\"\\\"unit\\\":\"\n\"\\\"presets\\\":\"\n\"\\\"status\\\":\"\n\"\\\"flags\\\":\"\n\"\\\"layer\\\":\"\n\"\\\"instance_extensions\\\":\"\n\"\\\"test_code_description\\\":\"\n\"\\\"library_path\\\":\"\n\"\\\"value\\\":\"\n\"\\\"platforms\\\":\"\n\"\\\"editor_state\\\":\"\n\"\\\"introduction\\\":\"\n\"\\\"mode\\\":\"\n\"\\\"env\\\":\"\n\"\\\"description\\\":\"\n\"\\\"key\\\":\"\n\"\\\"implementation_version\\\":\"\n\"\\\"range\\\":\"\n\"\\\"max\\\":\"\n\"\\\"label\\\":\"\n\"\\\"url\\\":\"\n\"\\\"features\\\":\"\n\"\\\"type\\\":\"\n\"\\\"file_format_version\\\":\"\n\"\\\"entrypoints\\\":\"\n\"\\\"settings\\\":\"\n\"False\"\n\"True\"\n\"Query\"\n\"VK_LAYER_MESSAGE_ID_FILTER\"\n\"1024\"\n\"1048576\"\n\"10\"\n\"vkCreateValidationCacheEXT\"\n\"VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM\"\n\"Report errors in API usage.\"\n\"enables\"\n\"FLAGS\"\n\"VK_EXT_tooling_info\"\n\"Printf verbose\"\n\"printf_to_stdout\"\n\"${LUNARG_SDK}/debug_printf.html\"\n\"perf\"\n\"VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT\"\n\"VK_DBG_LAYER_ACTION_LOG_MSG\"\n\"INT\"\n\"Shader Validation\"\n\"Fine Grained Locking\"\n\"VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE\"\n\"1.2.0\"\n\"WINDOWS\"\n\"report_flags\"\n\"Khronos Validation Layer\"\n\"ANY\"\n\"ANDROID\"\n\"STABLE\"\n\"fine_grained_locking\"\n\"VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT\"\n\"debug\"\n\"gpuav_buffer_oob\"\n\"MACOS\"\n\"LINUX\"\n\"2\"\n\"128\"\n\"9\"\n\"ALL\"\n\"VALIDATION_CHECK_DISABLE_OBJECT_IN_USE\"\n\"1\"\n\"Standard\"\n\"VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION\"\n\"VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_AMD\"\n\"VK_LAYER_ENABLES\"\n\"Object Lifetime\"\n\"vkCmdDebugMarkerEndEXT\"\n\"VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT\"\n\"VALIDATION_CHECK_DISABLE_QUERY_VALIDATION\"\n\"VK_LAYER_DUPLICATE_MESSAGE_LIMIT\"\n\"Disables\"\n\"QueueSubmit Synchronization Validation\"\n\"AMD-specific best practices\"\n\"vkDebugMarkerSetObjectNameEXT\"\n\"bytes\"\n\"Debug Action\"\n\"Max Duplicated Messages\"\n\"message_id_filter\"\n\"Thread Safety\"\n\"VK_EXT_debug_report\"\n\"vma_linear_output\"\n\"Log Filename\"\n\"SAVE_FILE\"\n\"Break\"\n\"VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT\"\n\"VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT\"\n\"VK_DBG_LAYER_ACTION_DEBUG_OUTPUT\"\n\"VALIDATION_CHECK_ENABLE_SYNCHRONIZATION_VALIDATION_QUEUE_SUBMIT\"\n\"Performance\"\n\"Set the verbosity of debug printf messages\"\n\"VK_EXT_validation_features\"\n\"debug_action\"\n\"vkCmdDebugMarkerInsertEXT\"\n\"VK_LAYER_KHRONOS_validation\"\n\"Info\"\n\"Error\"\n\"VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_NVIDIA\"\n\"ALPHA\"\n\"enable_message_limit\"\n\"vkGetValidationCacheDataEXT\"\n\"Core\"\n\"Log Message\"\n\"error\"\n\"VK_DBG_LAYER_ACTION_CALLBACK\"\n\"VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT\"\n\"vkCmdDebugMarkerBeginEXT\"\n\"GLOBAL\"\n\"vkMergeValidationCachesEXT\"\n\"Enable limiting of duplicate messages.\"\n\"VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT\"\n\"vkDebugMarkerSetObjectTagEXT\"\n\"Warning\"\n\"Debug Output\"\n\"NVIDIA-specific best practices\"\n\"Shader Validation Caching\"\n\"vkGetPhysicalDeviceToolPropertiesEXT\"\n\"BOOL\"\n\"gpuav_descriptor_indexing\"\n\"VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT\"\n\"log_filename\"\n\"ADVANCED\"\n\"VK_LAYER_FINE_GRAINED_LOCKING\"\n\"VK_LAYER_DISABLES\"\n\"Specify areas of validation to be disabled\"\n\"validate_dispatch_indirect\"\n\"${LUNARG_SDK}/synchronization_usage.html\"\n\"info\"\n\"${LUNARG_SDK}/best_practices.html\"\n\"Checks for commands that use VkQueryPool objects.\"\n\"Callback\"\n\"VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT\"\n\"stdout\"\n\"VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT\"\n\"LIST\"\n\"Synchronization\"\n\"Message Severity\"\n\"VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT\"\n\"vkDestroyValidationCacheEXT\"\n\"Reduced-Overhead\"\n\"Image Layout\"\n\"HIDDEN\"\n\"libVkLayer_khronos_validation.so\"\n\"VK_EXT_validation_cache\"\n\"VK_DBG_LAYER_ACTION_BREAK\"\n\"${LUNARG_SDK}/gpu_validation.html\"\n\"VK_EXT_debug_utils\"\n\"1.3.231\"\n\"VK_EXT_debug_marker\"\n\"Mute Message VUIDs\"\n\"VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT\"\n"
  },
  {
    "path": "projects/vulnerable-project/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nCOPY solution.seed vulnerable.cc build.sh $SRC/\n"
  },
  {
    "path": "projects/vulnerable-project/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$CXX $CXXFLAGS $SRC/vulnerable.cc -o $OUT/vulnerable $LIB_FUZZING_ENGINE\nzip -o $OUT/vulnerable_seed_corpus.zip $SRC/solution.seed\n"
  },
  {
    "path": "projects/vulnerable-project/project.yaml",
    "content": "homepage: \"https://github.com/google/oss-fuzz\"\nlanguage: c++\nprimary_contact: \"fake@example.com\"\nmain_repo: \"https://github.com/google/oss-fuzz\"\nfile_github_issue: false\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/vulnerable-project/solution.seed",
    "content": "Hello, Wor"
  },
  {
    "path": "projects/vulnerable-project/vulnerable.cc",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <stddef.h>\nextern \"C\" int LLVMFuzzerTestOneInput(uint8_t* data, size_t size) {\n  if (size < 4) {\n    return 0;\n  }\n\n  int index = 0;\n  if (data[index++] != 'H')\n    return 0;\n\n  if (data[index++] != 'e')\n    return 0;\n\n  if (data[index++] != 'l')\n    return 0;\n\n  if (size < 13) {\n    return 0;\n  }\n  if (data[index++] != 'l')\n    return 0;\n  if (data[index++] != 'o')\n    return 0;\n  if (data[index++] != ',')\n    return 0;\n  if (data[index++] != ' ')\n    return 0;\n  if (data[index++] != 'W')\n    return 0;\n  if (data[index++] != 'o')\n    return 0;\n  if (data[index++] != 'r')\n    return 0;\n  if (data[index++] != 'l')\n    return 0;\n  if (data[index++] != 'd')\n    return 0;\n  if (data[index] != '!')\n    return 0;\n\n  uint8_t* x = (uint8_t *) malloc(10);\n  free(x);\n\n  return x[8];\n}\n"
  },
  {
    "path": "projects/w3lib/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone https://github.com/scrapy/w3lib w3lib\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/w3lib\n"
  },
  {
    "path": "projects/w3lib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/w3lib/fuzz_parse_data_uri.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-2\n# Imports by the generated code\nfrom w3lib.url import parse_data_uri\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  uri = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 4096))\n\n  try:\n    parse_data_uri(uri)\n  except (ValueError,):\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/w3lib/fuzz_safe_download_url.py",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-2\n# Imports by the generated code\nfrom w3lib.url import safe_download_url\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  url = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  safe_download_url(url)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/w3lib/fuzz_url_safe.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n##########################################################################\nimport sys\nimport atheris\n# Auto-fuzz heuristics used: py-autofuzz-heuristics-2\n# Imports by the generated code\nfrom w3lib.url import safe_url_string\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  url = fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(0, 4096))\n  safe_url_string(url)\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/w3lib/project.yaml",
    "content": "homepage: https://github.com/scrapy/w3lib\nmain_repo: https://github.com/scrapy/w3lib\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/w3m/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y libgc-dev\nRUN git clone https://github.com/tats/w3m\n\nWORKDIR $SRC\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/w3m/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n#export CFLAGS=\"${CFLAGS} -\"\n#export CXXFLAGS=\"${CXXFLAGS} -ltinfo\"\n\ncd w3m\n./configure\n\nmake myctype.o\nmake Str.o\nmake libwc\n\ncd libwc\n$CC $CFLAGS -c ../fuzz/fuzz-conv.c -o fuzz_conv.o -I../ -I./\nstatic_libgc=($(find /usr/lib -name \"libgc.a\"))\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_conv.o -o $OUT/fuzz_conv \\\n    -I./libwc  -DUSE_UNICODE -I. -I./.. -DHAVE_CONFIG_H ../Str.o ../myctype.o libwc.a ${static_libgc}\n"
  },
  {
    "path": "projects/w3m/project.yaml",
    "content": "homepage: \"https://tracker.debian.org/pkg/w3m\"\nprimary_contact: \"tats@debian.org\"\nlanguage: c\nauto_ccs :\n  - \"david@adalogics.com\"\nmain_repo: 'https://github.com/tats/w3m'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/wabt/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake libtool make python\nRUN git clone --recursive https://github.com/WebAssembly/wabt\nWORKDIR wabt\nRUN git submodule init\nRUN git submodule update\nCOPY run_tests.sh build.sh *_fuzzer.cc $SRC/\n"
  },
  {
    "path": "projects/wabt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmkdir build\ncd build\ncmake ..\ncmake --build . --parallel\ncd ..\n\nfor fuzzers in $(find $SRC -name '*_fuzzer.cc' | grep -v wasm_objdump_fuzzer); do\n  fuzz_basename=$(basename -s .cc $fuzzers)\n  $CXX $CXXFLAGS -std=c++17 -I. -Ibuild -Iinclude -Ibuild/include \\\n  $fuzzers $LIB_FUZZING_ENGINE ./build/libwabt.a \\\n  -o $OUT/$fuzz_basename\ndone\n\n# wasm_objdump_fuzzer needs to be linked together with binary-reader-objdump.cc\n$CXX $CXXFLAGS -std=c++17 -I. -Ibuild -Ibuild/include -Iinclude /src/wasm_objdump_fuzzer.cc \\\n        ./src/binary-reader-objdump.cc $LIB_FUZZING_ENGINE ./build/libwabt.a \\\n        -o $OUT/wasm_objdump_fuzzer\n\n\n"
  },
  {
    "path": "projects/wabt/project.yaml",
    "content": "homepage: \"https://github.com/WebAssembly/wabt\"\nlanguage: c++\nprimary_contact: \"sbc@chromium.org\"\nauto_ccs:\n  - \"binji@chromium.org\"\n  - \"winstein@gmail.com\"\n  - \"shravanrn@gmail.com\"\n  - \"endermoneymod@gmail.com\"\nsanitizers:\n - address\n - memory\n - undefined\narchitectures:\n - x86_64\n - i386\nmain_repo: 'https://github.com/WebAssembly/wabt'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/wabt/read_binary_interp_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"wabt/binary-reader.h\"\n#include \"wabt/interp/binary-reader-interp.h\"\n#include \"wabt/interp/interp.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  wabt::Errors errors;\n  wabt::Features features;\n  wabt::interp::ModuleDesc module;\n  FuzzedDataProvider data_provider(data, size);\n\n#define WABT_FEATURE(variable, flag, default_, help) \\\n  if (data_provider.ConsumeBool()) { features.enable_##variable(); }\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n  // Add only feature related options, but no logging, stop_on_first_error, etc.\n  wabt::ReadBinaryOptions options(features, nullptr, false, false, false);\n  std::vector<uint8_t> text = data_provider.ConsumeRemainingBytes<uint8_t>();\n  ReadBinaryInterp(\"<fuzzer>\", text.data(), text.size(), options, &errors,\n                   &module);\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/wabt/read_binary_ir_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  wabt::Errors errors;\n  wabt::Module module;\n  wabt::Features features;\n  FuzzedDataProvider data_provider(data, size);\n#define WABT_FEATURE(variable, flag, default_, help) \\\n  if (data_provider.ConsumeBool()) { features.enable_##variable(); }\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n  // Add only feature related options, but no logging, stop_on_first_error, etc.\n  wabt::ReadBinaryOptions options(features, nullptr, false, false, false);\n  std::vector<uint8_t> text = data_provider.ConsumeRemainingBytes<uint8_t>();\n  ReadBinaryIr(\"\", text.data(), text.size(), options, &errors, &module);\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/wabt/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/wabt/build/wabt-unittests\n"
  },
  {
    "path": "projects/wabt/wasm2wat_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  wabt::ReadBinaryOptions options;\n  wabt::Errors errors;\n  wabt::Module module;\n  wabt::ReadBinaryIr(\"dummy filename\", data, size, options, &errors, &module);\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/wabt/wasm_objdump_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"wabt/binary-reader-objdump.h\"\n#include \"wabt/binary-reader.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  wabt::ObjdumpOptions objdump_options{};\n  wabt::ObjdumpState state;\n\n  objdump_options.debug = false;\n  objdump_options.filename = \"dummy\";\n  objdump_options.log_stream = nullptr;\n\n  objdump_options.mode = wabt::ObjdumpMode::Prepass;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::Headers;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::Details;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::Disassemble;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::RawData;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  return 0;\n}\n\n"
  },
  {
    "path": "projects/wabt/wat2wasm_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"wabt/ir.h\"\n#include \"wabt/wast-lexer.h\"\n#include \"wabt/wast-parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  wabt::Errors Lexerrors;\n  std::unique_ptr<wabt::WastLexer> lexer =\n      wabt::WastLexer::CreateBufferLexer(\"fake_file\", data, size, &Lexerrors);\n\n  if (!lexer) {\n    return 0;\n  }\n\n  std::unique_ptr<wabt::Module> module;\n  wabt::Errors errors;\n  wabt::Features features;\n  wabt::WastParseOptions parse_wast_options(features);\n  ParseWatModule(lexer.get(), &module, &errors, &parse_wast_options);\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/wamr/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt upgrade -y \\\n  && apt install -y build-essential clang ninja-build zlib1g-dev libncurses5-dev\n\n# install llvm\nARG LLVM_VER=18.1.8\nRUN cd /opt \\\n  && wget --progress=dot:giga https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VER}/clang+llvm-${LLVM_VER}-x86_64-linux-gnu-ubuntu-18.04.tar.xz\nRUN cd /opt \\\n  && tar -xvf clang+llvm-${LLVM_VER}-x86_64-linux-gnu-ubuntu-18.04.tar.xz \\\n  && mv clang+llvm-${LLVM_VER}-x86_64-linux-gnu-ubuntu-18.04 llvm-${LLVM_VER} \\\n  && rm clang+llvm-${LLVM_VER}-x86_64-linux-gnu-ubuntu-18.04.tar.xz\n\n# install wasm-tools\nARG WASM_TOOLS_VER=1.243.0\nRUN cd /opt \\\n  && wget --progress=dot:giga https://github.com/bytecodealliance/wasm-tools/releases/download/v${WASM_TOOLS_VER}/wasm-tools-${WASM_TOOLS_VER}-x86_64-linux.tar.gz\nRUN cd /opt \\\n  && tar -xvf wasm-tools-${WASM_TOOLS_VER}-x86_64-linux.tar.gz \\\n  && mv wasm-tools-${WASM_TOOLS_VER}-x86_64-linux wasm-tools \\\n  && rm wasm-tools-${WASM_TOOLS_VER}-x86_64-linux.tar.gz \\\n  && ln -s /opt/wasm-tools/wasm-tools /usr/local/bin/wasm-tools\n\nRUN git clone --depth 1 https://github.com/bytecodealliance/wasm-micro-runtime wamr\nWORKDIR wamr\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wamr/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\necho \"<| ------ \" $(pwd) \" ------ |>\"\nls .\nls -l /usr/lib/libFuzzing*\necho \"<| ------  --------  ------ |>\"\n\n# avoid `-stdlib=libc++` by not using ${CXX} and ${CXXFLAGS}\n# to make sure we link with sanitizer runtime\n: ${LD:=\"${CC}\"}\n: ${LDFLAGS:=\"${CFLAGS}\"}\n\ncmake_args=(\n  # C compiler\n  -DCMAKE_C_COMPILER=\"${CC}\"\n  -DCMAKE_C_FLAGS=\"${CFLAGS}\"\n\n  # C++ compiler\n  # avoid `-stdlib=libc++` by not using ${CXX} and ${CXXFLAGS}\n  -DCMAKE_CXX_COMPILER=\"${CC}\"\n  -DCMAKE_CXX_FLAGS=\"${CFLAGS}\"\n\n  # Linker\n  -DCMAKE_LINKER=\"${LD}\"\n  -DCMAKE_EXE_LINKER_FLAGS=\"${LDFLAGS}\"\n  -DCMAKE_MODULE_LINKER_FLAGS=\"${LDFLAGS}\"\n  -DCMAKE_SHARED_LINKER_FLAGS=\"${LDFLAGS}\"\n\n  # ZLIB Configuration\n  -DZLIB_INCLUDE_DIR=/usr/include\n  -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.so\n\n  # Terminfo Configuration\n  -DTerminfo_LIBRARIES=/usr/lib/x86_64-linux-gnu/libncurses.so\n  -DTerminfo_INCLUDE_DIRS=/usr/include\n)\n\n# CORPUS\n(\n  echo \"Building seed corpus...\\n\"\n  cd tests/fuzz/wasm-mutator-fuzz/\n  ./smith_wasm.sh 10\n\n  zip -j ./build/seed_corpus.zip ./build/CORPUS_DIR/test_*.wasm\n)\n\n# fuzzing target\n\n# classic-interp\n(\n  echo \"Building classic interp...\\n\"\n  cd tests/fuzz/wasm-mutator-fuzz/\n\n  cmake -S . -B build-classic-interp \\\n      -DCMAKE_TOOLCHAIN_FILE=./clang_toolchain.cmake \\\n      -DLLVM_DIR=/opt/llvm-18.1.8/lib/cmake/llvm \\\n      -G Ninja \\\n      -DWAMR_BUILD_FAST_INTERP=0 \\\n      -DWAMR_BUILD_SIMD=0 \\\n      \"${cmake_args[@]}\" \\\n    && cmake --build build-classic-interp\n\n  cp ./build-classic-interp/wasm-mutator/wasm_mutator_fuzz $OUT/wamr_fuzz_classic_interp\n  cp ./build/seed_corpus.zip $OUT/wamr_fuzz_classic_interp_seed_corpus.zip\n)\n\n## fast-interp (by default)\n(\n  echo \"Building fast interp...\\n\"\n  cd tests/fuzz/wasm-mutator-fuzz/\n\n  cmake -S . -B build-fast-interp \\\n      -DCMAKE_TOOLCHAIN_FILE=./clang_toolchain.cmake \\\n      -DLLVM_DIR=/opt/llvm-18.1.8/lib/cmake/llvm \\\n      -G Ninja \\\n      \"${cmake_args[@]}\" \\\n    && cmake --build build-fast-interp\n\n  cp ./build-fast-interp/wasm-mutator/wasm_mutator_fuzz $OUT/wamr_fuzz_fast_interp\n  cp ./build/seed_corpus.zip $OUT/wamr_fuzz_fast_interp_seed_corpus.zip\n)\n\n## llvm-jit\n(\n  echo \"Building llvm jit...\\n\"\n  cd tests/fuzz/wasm-mutator-fuzz/\n\n  cmake -S . -B build-llvm-jit \\\n      -DCMAKE_TOOLCHAIN_FILE=./clang_toolchain.cmake \\\n      -DLLVM_DIR=/opt/llvm-18.1.8/lib/cmake/llvm \\\n      -G Ninja \\\n      -DWAMR_BUILD_FAST_INTERP=0 \\\n      -DWAMR_BUILD_JIT=1 \\\n      \"${cmake_args[@]}\" \\\n    && cmake --build build-llvm-jit --target wasm_mutator_fuzz\n\n  cp ./build-llvm-jit/wasm-mutator/wasm_mutator_fuzz $OUT/wamr_fuzz_llvm_jit\n  cp ./build/seed_corpus.zip $OUT/wamr_fuzz_llvm_jit_seed_corpus.zip\n)\n\n# aot-compiler\n(\n  echo \"Building aot compiler...\\n\"\n  cd tests/fuzz/wasm-mutator-fuzz/\n\n  cmake -S . -B build-aot-compiler \\\n      -DCMAKE_TOOLCHAIN_FILE=./clang_toolchain.cmake \\\n      -DLLVM_DIR=/opt/llvm-18.1.8/lib/cmake/llvm \\\n      -G Ninja \\\n      \"${cmake_args[@]}\" \\\n    && cmake --build build-aot-compiler --target aot_compiler_fuzz\n\n  cp ./build-aot-compiler/aot-compiler/aot_compiler_fuzz $OUT/wamr_fuzz_aot_compiler\n  cp ./build/seed_corpus.zip $OUT/wamr_fuzz_aot_compiler_seed_corpus.zip\n)\n"
  },
  {
    "path": "projects/wamr/project.yaml",
    "content": "homepage: \"https://github.com/bytecodealliance/wasm-micro-runtime\"\nlanguage: c\nprimary_contact: \"liang.he@intel.com\"\nauto_ccs:\n  - \"jia3.liu@intel.com\"\n  - \"tianlong.liang@intel.com\"\n  - \"tianyou.li@intel.com\"\n  - \"zhenwei.jin@intel.com\"\nmain_repo: \"https://github.com/bytecodealliance/wasm-micro-runtime.git\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\nfile_github_issue: false\n"
  },
  {
    "path": "projects/wasm3/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/wasm3/wasm3\nWORKDIR wasm3\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wasm3/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nmkdir build && cd build\ncmake -DBUILD_WASI=none ..\nmake -j$(nproc)\n$CC $CFLAGS -c $SRC/wasm3/platforms/app_fuzz/fuzzer.c -o fuzzer.o -I/src/wasm3/source\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -o $OUT/fuzzer fuzzer.o /src/wasm3/build/source/libm3.a\n"
  },
  {
    "path": "projects/wasm3/project.yaml",
    "content": "homepage: \"https://github.com/wasm3/wasm3\"\nmain_repo: \"https://github.com/wasm3/wasm3\"\nlanguage: c\nprimary_contact: \"vshymanskyi@gmail.com\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\nsanitizers:\n  - address\n  - undefined\n  - memory\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\n"
  },
  {
    "path": "projects/wasmedge/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y \\\n    software-properties-common \\\n    dpkg-dev \\\n    ninja-build \\\n    llvm-12-dev \\\n    liblld-12-dev\n\nADD \"https://api.github.com/repos/WasmEdge/WasmEdge/commits?per_page=1\" latest_commit\nRUN rm latest_commit\nRUN git clone  https://github.com/WasmEdge/WasmEdge.git\n\nADD \"https://api.github.com/repos/second-state/WasmEdge-unittest/commits?per_page=1&sha=wasm-dev-0.11.0\" latest_commit\nRUN rm latest_commit\nRUN git clone --branch wasm-dev-0.13.0 https://github.com/second-state/WasmEdge-unittest.git\n\nCOPY build.sh $SRC/\nWORKDIR $SRC\n"
  },
  {
    "path": "projects/wasmedge/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"${CXXFLAGS} -Wno-error=invalid-specialization\"\n\ncd \"$SRC/WasmEdge\"\nsed -ie 's@core lto native@core native@' cmake/Helper.cmake\ncmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n  -DWASMEDGE_FORCE_DISABLE_LTO=ON \\\n  -DWASMEDGE_BUILD_FUZZING=ON \\\n  -DWASMEDGE_BUILD_TOOLS=OFF \\\n  -DWASMEDGE_BUILD_TESTS=OFF \\\n  -DLIB_FUZZING_ENGINE=\"$LIB_FUZZING_ENGINE\" \\\n  -DCMAKE_C_COMPILER_AR=\"$(command -v llvm-ar)\" \\\n  -DCMAKE_C_COMPILER_RANLIB=\"$(command -v llvm-ranlib)\" \\\n  -DCMAKE_CXX_COMPILER_AR=\"$(command -v llvm-ar)\" \\\n  -DCMAKE_CXX_COMPILER_RANLIB=\"$(command -v llvm-ranlib)\" \\\n  -DLLVM_DIR=\"/usr/lib/llvm-12/lib/cmake/llvm\" \\\n  -DLLD_DIR=\"/usr/lib/llvm-12/lib/cmake/lld\" \\\n  .\nninja -C build\ncp -a build/lib/api/libwasmedge*.so* build/tools/fuzz/wasmedge-fuzz* \"$OUT\"/\npatchelf --set-rpath \\$ORIGIN \"$OUT\"/libwasmedge*.so*\ncd utils/corpus/po\nzip -9 \"$OUT/wasmedge-fuzzpo_seed_corpus.zip\" -R '*.txt'\ncd -\n\ncd \"$SRC/WasmEdge-unittest\"\nzip -9 \"$OUT/wasmedge-fuzztool_seed_corpus.zip\" -R '*.wasm'\ncd -\n\nfor i in build/tools/fuzz/wasmedge-fuzz*; do\n  j=\"$(basename \"$i\")\"\n  patchelf --set-rpath \\$ORIGIN \"$OUT/${j}\"\ndone\n\nfor i in libLLVM-12.so.1 libedit.so.2 libbsd.so.0; do\n  cp \"/usr/lib/x86_64-linux-gnu/${i}\" \"$OUT/\"\n  patchelf --set-rpath \\$ORIGIN \"$OUT/${i}\"\ndone\n"
  },
  {
    "path": "projects/wasmedge/project.yaml",
    "content": "homepage: \"https://github.com/WasmEdge/WasmEdge\"\nlanguage: c++\nprimary_contact: \"beststeve@secondstate.io\"\nauto_ccs:\n  - \"hydai@secondstate.io\"\n  - \"yiying@secondstate.io\"\nsanitizers:\n  - address\n  - memory:\n     experimental: True\nmain_repo: 'https://github.com/WasmEdge/WasmEdge.git'\n"
  },
  {
    "path": "projects/wasmer/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool \\\n\tzlib1g-dev libffi-dev build-essential libxml2-dev libzstd-dev\n\nRUN git clone --depth 1 https://github.com/wasmerio/wasmer wasmer\n\nRUN mkdir -p $SRC/.llvm && curl --proto '=https' --tlsv1.2 -sSf \\\n    https://github.com/wasmerio/llvm-custom-builds/releases/download/21.x/llvm-linux-amd64.tar.xz -L -o -| \\\n    tar xJv -C $SRC/.llvm\n\nWORKDIR wasmer\n\nENV RUSTUP_TOOLCHAIN nightly\n\nCOPY build.sh default.options $SRC/\n"
  },
  {
    "path": "projects/wasmer/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap plicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport LLVM_SYS_211_PREFIX=$($SRC/.llvm/bin/llvm-config --prefix)\n\n# Needed for coverage to work.\nnightly=\"+$RUSTUP_TOOLCHAIN\"\n\ncargo $nightly fuzz build universal_cranelift --features=universal,cranelift -O\ncargo $nightly fuzz build universal_llvm --features=universal,llvm -O\ncargo $nightly fuzz build universal_singlepass --features=universal,singlepass -O\ncargo $nightly fuzz build metering --features=universal,cranelift -O\ncargo $nightly fuzz build deterministic --features=universal,cranelift,llvm,singlepass -O\n\nfuzz_targets=\"universal_cranelift \\\n  universal_llvm \\\n  universal_singlepass \\\n  metering \\\n  deterministic\"\nfuzz_target_output_dir=target/x86_64-unknown-linux-gnu/release\n\nfor target in $fuzz_targets; do\n\tcp $fuzz_target_output_dir/$target $OUT/\n\tcp $SRC/default.options $OUT/$target.options\ndone\n"
  },
  {
    "path": "projects/wasmer/default.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/wasmer/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://github.com/wasmerio/wasmer\"\nlanguage: rust\nmain_repo: \"https://github.com/wasmerio/wasmer\"\nprimary_contact: \"martin@wasmer.io\"\nauto_ccs:\n  - syrus@wasmer.io\n  - christoph@wasmer.io\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nvendor_ccs:\n  - maxnair.dev@gmail.com\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/rustc/.*\n"
  },
  {
    "path": "projects/wasmi/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN git clone --depth=1 https://github.com/wasmi-labs/wasmi wasmi\nWORKDIR wasmi\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wasmi/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap plicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Needed for coverage to work.\nnightly=\"+$RUSTUP_TOOLCHAIN\"\n\ncargo $nightly fuzz build translate -O\ncargo $nightly fuzz build execute -O\ncargo $nightly fuzz build differential --all-features -O\n\nFUZZ_TARGET_OUTPUT_DIR=target/x86_64-unknown-linux-gnu/release\nfor f in fuzz/fuzz_targets/*.rs\ndo\n    FUZZ_TARGET_NAME=$(basename ${f%.*})\n    cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/\ndone\n"
  },
  {
    "path": "projects/wasmi/project.yaml",
    "content": "homepage: \"https://wasmi-labs.github.io/blog/\"\nmain_repo: \"https://github.com/wasmi-labs/wasmi\"\nprimary_contact: \"robin.freyler@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\n# Ignore dependencies on crates.io, and the Rust standard library itself.\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/registry/src/.*crates.io.*/.*\n  -ignore-filename-regex=.*/rustc/.*\n"
  },
  {
    "path": "projects/wasmtime/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nRUN apt-get update && apt-get install -y make autoconf automake libtool curl \\\n  cmake python llvm-dev libclang-dev clang \\\n  libgmp-dev pkg-config\n\n# Install a newer version of OCaml than provided by Ubuntu 16.04 (base version for this image)\nRUN curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh -o install.sh && \\\n  echo | sh install.sh && \\\n  opam init --disable-sandboxing --yes --compiler=4.11.2 && \\\n  opam install ocamlbuild ocamlfind --yes && \\\n  CFLAGS= opam install zarith --yes\n\nRUN git clone --depth 1 https://github.com/bytecodealliance/wasm-tools wasm-tools\n\nRUN git clone --depth 1 https://github.com/bytecodealliance/regalloc2 regalloc2\n\nRUN git clone --depth 1 https://github.com/bytecodealliance/wasmtime wasmtime\nWORKDIR wasmtime\n#RUN git submodule update --init --recursive\n\n#RUN git clone --depth 1 https://github.com/bytecodealliance/wasmtime-libfuzzer-corpus wasmtime-libfuzzer-corpus\n\n# The default toolchain used by OSS-Fuzz is too old to build Wasmtime at this\n# time.\nENV RUSTUP_TOOLCHAIN nightly-2026-01-28\n\nCOPY build.sh *.options $SRC/\n"
  },
  {
    "path": "projects/wasmtime/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Commands migrated from Dockerfile to make CIFuzz work\n# REF: https://github.com/google/oss-fuzz/issues/6755\ngit submodule update --init --recursive\n\n# Note: This project creates Rust fuzz targets exclusively\n\nbuild() {\n  project=$1\n  shift\n  fuzzer_prefix=$1\n  shift\n  fuzz_targets=$1\n  shift\n  fuzz_target_path=$1\n  shift\n  PROJECT_DIR=$SRC/$project\n\n  # ensure we get absolute paths for the coverage report\n  cd $PROJECT_DIR\n  crate_src_abspath=`cargo metadata --no-deps --format-version 1 | jq -r '.workspace_root'`\n  while read i; do\n    export RUSTFLAGS=\"$RUSTFLAGS --remap-path-prefix $i=$crate_src_abspath/$i\"\n  done <<< \"$(find . -name \"*.rs\" | cut -d/ -f2 | uniq)\"\n\n  cd $PROJECT_DIR/fuzz && cargo fuzz build --sanitizer none --strip-dead-code -O --debug-assertions \"$@\"\n\n  FUZZ_TARGET_OUTPUT_DIR=$PROJECT_DIR/$fuzz_target_path/x86_64-unknown-linux-gnu/release\n\n  if [ \"x$fuzz_targets\" = \"x\" ]; then\n      fuzz_targets=$PROJECT_DIR/fuzz/fuzz_targets/*.rs\n  fi\n\n  for f in $fuzz_targets; do\n      src_name=$(basename ${f%.*})\n      dst_name=$fuzzer_prefix$src_name\n      cp $FUZZ_TARGET_OUTPUT_DIR/$src_name $OUT/$dst_name\n\n      if [[ -f $SRC/$dst_name.options ]]; then\n        cp $SRC/$dst_name.options $OUT/$dst_name.options\n      else\n        cp $SRC/default.options $OUT/$dst_name.options\n      fi\n  done\n}\n\n# Ensure OCaml environment is set up prior to Wasmtime build.\neval $(opam env)\n\n# Needed for Wasmtime's adapter/test builds\nrustup target add wasm32-unknown-unknown wasm32-wasip1 wasm32-wasip2\n\n# Shrink builds to take up less disk space\nexport CARGO_INCREMENTAL=0\nexport CARGO_PROFILE_DEV_DEBUG=0\nexport CARGO_PROFILE_DEV_STRIP=debuginfo\nexport CARGO_PROFILE_RELEASE_DEBUG=0\n\nbuild wasmtime \"\" \"\" target\nbuild wasm-tools wasm-tools- \"\" target --features wasmtime\nbuild regalloc2 regalloc2- ion fuzz/target\n\n# In coverage builds copy the opam header files into the output so coverage can\n# find the source files.\nif [ \"$SANITIZER\" = \"coverage\" ]; then\n  cp --recursive --dereference --no-preserve mode,ownership --parents \\\n    $HOME/.opam/4.11.2/lib/ocaml $OUT\nfi\n"
  },
  {
    "path": "projects/wasmtime/default.options",
    "content": "[asan]\nallow_user_segv_handler=1\nhandle_sigill=0\nhandle_segv=1\nhandle_sigfpe=1\n"
  },
  {
    "path": "projects/wasmtime/project.yaml",
    "content": "homepage: \"https://wasmtime.dev/\"\nprimary_contact: \"tsc@bytecodealliance.org\"\nauto_ccs:\n  - \"fitzgen@gmail.com\"\n  - \"alex@alexcrichton.com\"\n  - \"till@tillschneidereit.net\"\n  - \"cfallin@gmail.com\"\n  - \"andrew.s.brown2@gmail.com\"\n  - \"saule.cabrera@gmail.com\"\n  - \"jeff.charles@shopify.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nmain_repo: 'https://github.com/bytecodealliance/wasmtime'\n\n# Ignore some ocaml files that show up, dependencies on crates.io, and the\n# standard library itself.\ncoverage_extra_args: >\n  -ignore-filename-regex=.*/root/.opam/.*\n  -ignore-filename-regex=.*/registry/src/.*crates.io.*/.*\n  -ignore-filename-regex=.*/rustc/.*\n"
  },
  {
    "path": "projects/wavpack/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool gettext\nRUN git clone --depth 1 https://github.com/dbry/WavPack.git wavpack\nRUN cp wavpack/fuzzing/build.sh $SRC\nCOPY run_tests.sh $SRC/\nWORKDIR wavpack\n"
  },
  {
    "path": "projects/wavpack/project.yaml",
    "content": "homepage: \"http://www.wavpack.com\" \nlanguage: c++\nprimary_contact: \"david@wavpack.com\" \nauto_ccs:\n- dvbryant@gmail.com\n- thuanpv.nus@gmail.com\nsanitizers: \n- address \n- memory\n- undefined\nmain_repo: 'https://github.com/dbry/WavPack.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/wavpack/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check\n"
  },
  {
    "path": "projects/wazuh/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y libpcre2-dev libssl-dev libsystemd-dev autoconf libtool\nRUN git clone https://github.com/wazuh/wazuh\n\nWORKDIR $SRC/wazuh\nCOPY build.sh $SRC/\nCOPY fuzz_xml.c $SRC/fuzz_xml.c\n"
  },
  {
    "path": "projects/wazuh/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd src\nexport LDFLAGS=\"$CFLAGS\"\nsed -i 's/CC=gcc/CC=clang/g' Makefile\n\nmake deps\nmkdir -p build && cd build\ncmake .. -DTARGET=agent\nmake wazuh -j$(nproc)\ncd ..\n\n$CC $CFLAGS $LIB_FUZZING_ENGINE $SRC/fuzz_xml.c -o $OUT/fuzz_xml \\\n    -I./ -I./shared -I./shared/include \\\n    ./build/lib/libwazuh.a \\\n    ./external/sqlite/libsqlite3.a ./external/cJSON/libcjson.a \\\n    ./external/zlib/libz.a ./external/bzip2/libbz2.a \\\n    -lpthread -ldl -lrt -lm\n"
  },
  {
    "path": "projects/wazuh/fuzz_xml.c",
    "content": "/* Copyright 2021 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdint.h>\n\n#include \"./os_xml/os_xml.h\"\n#include \"./os_xml/os_xml_internal.h\"\n\nint\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    char filename[256];\n    sprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n    FILE *fp = fopen(filename, \"wb\");\n    if (!fp)\n        return 0;\n    fwrite(data, size, 1, fp);\n    fclose(fp);\n\n    OS_XML xml;\n    if (OS_ReadXML(filename, &xml) < 0) {\n        OS_ClearXML(&xml);\n        unlink(filename);\n        return 0;\n    }\n    XML_NODE node = NULL;\n    node = OS_GetElementsbyNode(&xml, NULL);\n    if (node == NULL) {\n        OS_ClearXML(&xml);\n        return 0;\n    }\n\n    int i = 0;\n    while (node[i]) {\n        int j = 0;\n        XML_NODE cnode;\n        cnode = OS_GetElementsbyNode(&xml, node[i]);\n        if (cnode == NULL) {\n            i++;\n            continue;\n        }\n\n        while (cnode[j]) {\n            if (cnode[j]->attributes && cnode[j]->values) {\n                int k = 0;\n                while (cnode[j]->attributes[k]) {\n                    k++;\n                }\n            }\n            j++;\n        }\n\n        OS_ClearNode(cnode);\n        i++;\n    }\n\n    OS_ClearNode(node);\n    OS_ClearXML(&xml);\n    unlink(filename);\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/wazuh/fuzz_xml.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/wazuh/project.yaml",
    "content": "homepage: \"https://wazuh.com/\"\nmain_repo: 'https://github.com/wazuh/wazuh'\nprimary_contact: \"devel@wazuh.com\"\nlanguage: c\nauto_ccs:\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/websocket-client/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/websocket-client/websocket-client websocket-client\nWORKDIR websocket-client\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/websocket-client/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/websocket-client/fuzz_http.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom websocket._exceptions import WebSocketException\nfrom websocket._http import read_headers, _tunnel\n\n\nclass FuzzMock:\n    \"\"\"FuzzMock class inspired by SockMock\"\"\"\n    def __init__(self, packet):\n        self.data = [packet]\n        self.sent = []\n\n    def gettimeout(self):\n        return None\n\n    def recv(self, bufsize):\n        if self.data:\n            e = self.data.pop(0)\n            if isinstance(e, Exception):\n                raise e\n            if len(e) > bufsize:\n                self.data.insert(0, e[bufsize:])\n            return e[:bufsize]\n\n    def send(self, data):\n        self.sent.append(data)\n        return len(data)\n\n\ndef TestOneInput(data):\n    try:\n        fdp = atheris.FuzzedDataProvider(data)\n        # Create mock socket with fuzzer-derived data.\n        mock_sock = FuzzMock(fdp.ConsumeBytes(512))\n        _tunnel(\n            mock_sock,\n            fdp.ConsumeUnicodeNoSurrogates(200),\n            fdp.ConsumeIntInRange(1, 1000),\n            (\n                fdp.ConsumeUnicodeNoSurrogates(100),\n                fdp.ConsumeUnicodeNoSurrogates(100)\n            )\n        )\n    except WebSocketException:\n        pass\n    except UnicodeDecodeError:\n        pass\n        \n    \ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/websocket-client/fuzz_url.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nfrom websocket._url import parse_url\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        parse_url(fdp.ConsumeUnicodeNoSurrogates(20))\n    except ValueError as e:\n        # Catch all ValueError exceptions. This is also\n        # because urllib will throw a set of them which\n        # is not visible from the websocket-client code.\n        return\n    \ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/websocket-client/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/websocket-client/websocket-client\nlanguage: python\nmain_repo: https://github.com/websocket-client/websocket-client\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/websockets/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone --depth 1 https://github.com/aaugustin/websockets\nWORKDIR websockets\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/websockets/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build and install project (using current CFLAGS, CXXFLAGS).\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/websockets/project.yaml",
    "content": "homepage: https://websockets.readthedocs.io/\nlanguage: python\nprimary_contact: aymeric.augustin@fractalideas.com\nmain_repo: https://github.com/aaugustin/websockets\nfile_github_issue: true\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/weechat/project.yaml",
    "content": "homepage: \"https://github.com/weechat/weechat\"\nmain_repo: \"https://github.com/weechat/weechat\"\nprimary_contact: \"flashcode@flashtux.org\"\nauto_ccs:\n  - \"security@weechat.org\"\n"
  },
  {
    "path": "projects/wget/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y \\\n make \\\n pkg-config \\\n gettext \\\n autogen \\\n autopoint \\\n autoconf-archive \\\n automake \\\n libtool \\\n texinfo \\\n flex \\\n bison \\\n gettext \\\n gengetopt \\\n curl \\\n gperf \\\n wget \\\n rsync \\\n gtk-doc-tools \\\n libtasn1-bin \\\n libz-dev\n\nRUN cd /usr/src && \\\n        curl -oautoconf-2.71.tar.gz https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz && \\\n\ttar xf autoconf-2.71.tar.gz && \\\n\tcd autoconf-2.71 && \\\n\t./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && \\\n\tmake install\n\nENV GNULIB_TOOL $SRC/gnulib/gnulib-tool\nENV GNULIB_SRCDIR $SRC/gnulib\nRUN git clone https://git.savannah.gnu.org/git/gnulib.git gnulib\nRUN wget -qO- https://ftp.gnu.org/gnu/libunistring/libunistring-latest.tar.gz | tar xz && mv libunistring-* libunistring\nRUN wget -qO- https://ftp.gnu.org/gnu/libidn/libidn2-latest.tar.gz | tar xz && mv libidn2-* libidn2\nRUN wget -qO- https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.gz | tar xz && mv gmp-* gmp\nRUN git clone --depth=1 --recursive https://github.com/rockdaboot/libpsl.git\nRUN git clone --depth=1 https://git.lysator.liu.se/nettle/nettle.git --branch=nettle_3.10_release_20240616\nRUN git clone --depth=1 https://gitlab.com/gnutls/gnutls.git\n\nRUN git clone https://git.savannah.gnu.org/git/wget.git\n\nWORKDIR wget\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wget/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport WGET_DEPS_PATH=$SRC/wget_deps\nexport PKG_CONFIG_PATH=$WGET_DEPS_PATH/lib64/pkgconfig:$WGET_DEPS_PATH/lib/pkgconfig\nexport CPPFLAGS=\"-I$WGET_DEPS_PATH/include\"\nexport CFLAGS=\"$CFLAGS -I$WGET_DEPS_PATH/include -L$WGET_DEPS_PATH/lib\"\nexport LDFLAGS=\"-L$WGET_DEPS_PATH/lib\"\nexport GNULIB_SRCDIR=$SRC/gnulib\nexport LLVM_PROFILE_FILE=/tmp/prof.test\n\ncd $SRC/libunistring\n./configure --enable-static --disable-shared --prefix=$WGET_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/libidn2\n./configure --enable-static --disable-shared --disable-doc --disable-gcc-warnings --prefix=$WGET_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/libpsl\n./autogen.sh\n./configure --enable-static --disable-shared --disable-gtk-doc --enable-runtime=libidn2 --enable-builtin=libidn2 --prefix=$WGET_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/gmp\n./configure --enable-static --disable-shared --prefix=$WGET_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/nettle\nbash .bootstrap\n./configure --enable-static --disable-shared --disable-documentation --disable-openssl --disable-assembler --disable-fat --prefix=$WGET_DEPS_PATH\n( make -j$(nproc) || make -j$(nproc) ) && make install\nif test $? != 0;then\n        echo \"Failed to compile nettle\"\n        exit 1\nfi\n\ncd $SRC/gnutls\ntouch .submodule.stamp\n./bootstrap\nGNUTLS_CFLAGS=`echo $CFLAGS|sed s/-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION//`\nLIBS=\"-lunistring\" \\\nCFLAGS=\"$GNUTLS_CFLAGS\" \\\n./configure --enable-gcc-warnings --enable-static --disable-shared --with-included-libtasn1 \\\n    --with-included-unistring --without-p11-kit --disable-doc --disable-tests --disable-tools --disable-cxx \\\n    --disable-maintainer-mode --disable-libdane --disable-gcc-warnings --disable-full-test-suite --disable-guile \\\n    --prefix=$WGET_DEPS_PATH\nmake -j$(nproc)\nmake install\n\n\n# avoid iconv() memleak on Ubuntu 16.04 image (breaks test suite)\nexport ASAN_OPTIONS=detect_leaks=0\n\n# Ensure our libraries can be found\nln -sf $WGET_DEPS_PATH/lib64/libhogweed.a $WGET_DEPS_PATH/lib/libhogweed.a\nln -sf $WGET_DEPS_PATH/lib64/libnettle.a  $WGET_DEPS_PATH/lib/libnettle.a\n\ncd $SRC/wget\nsed -i '/GETTEXT_REQUIRE_VERSION/d' configure.ac\n./bootstrap --skip-po\n\n# build and run non-networking tests\nLIBS=\"-lgnutls -lhogweed -lnettle -lgmp -lidn2 -lunistring -lpsl -lz\" \\\n./configure -C\nmake clean\nmake -j$(nproc) -C lib\nmake -j$(nproc) -C src\nmake -j$(nproc) -C fuzz check\n\n# build for fuzzing\nLIBS=\"-lgnutls -lhogweed -lnettle -lgmp -lidn2 -lunistring -lpsl -lz\" \\\n./configure --enable-fuzzing -C\nmake clean\nmake -j$(nproc) -C lib\nmake -j$(nproc) -C src\n\n# build fuzzers\ncd fuzz\nmake -j$(nproc) ../src/libunittest.a\nmake oss-fuzz\n\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'\n\nfor dir in *_fuzzer.in; do\n  fuzzer=$(basename $dir .in)\n  zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n"
  },
  {
    "path": "projects/wget/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.gnu.org/software/wget/\"\nlanguage: c++\nprimary_contact: \"rockdaboot@gmail.com\"\nauto_ccs:\n  - \"tim.ruehsen@gmx.de\"\n  - \"darnir@gmail.com\"\n  - \"gscrivan@redhat.com\"\nfuzzing_engines:\n  - \"afl\"\n  - \"honggfuzz\"\n  - \"libfuzzer\"\nmain_repo: 'https://git.savannah.gnu.org/git/wget.git'\n"
  },
  {
    "path": "projects/wget2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y \\\n make \\\n pkg-config \\\n autogen \\\n autopoint \\\n automake \\\n libtool \\\n texinfo \\\n flex \\\n bison \\\n gettext \\\n gengetopt \\\n curl \\\n gperf \\\n wget \\\n python \\\n lzip \\\n rsync \\\n libmicrohttpd-dev \\\n gtk-doc-tools \\\n libtasn1-bin \\\n libz-dev\n\n\nRUN cd /usr/src && \\\n        curl -oautoconf-2.71.tar.gz https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz && \\\n    tar xf autoconf-2.71.tar.gz && \\\n    cd autoconf-2.71 && \\\n    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && \\\n    make install\n\nRUN cd /usr/src && \\\n    curl -ogettext-0.22.5.tar.gz https://ftp.gnu.org/gnu/gettext/gettext-0.22.5.tar.gz && \\\n    tar xf gettext-0.22.5.tar.gz && \\\n    cd gettext-0.22.5 && \\\n    ./configure --prefix=/usr && \\\n    make -j$(nproc) install\n\nENV GNULIB_TOOL $SRC/gnulib/gnulib-tool\nENV GNULIB_SRCDIR $SRC/gnulib\nRUN git clone https://git.savannah.gnu.org/git/gnulib.git gnulib\nRUN wget -qO- https://ftp.gnu.org/gnu/libunistring/libunistring-latest.tar.gz | tar xz && mv libunistring-* libunistring\nRUN wget -qO- https://ftp.gnu.org/gnu/libidn/libidn2-latest.tar.gz | tar xz && mv libidn2-* libidn2\nRUN wget -qO- https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.gz | tar xz && mv gmp-* gmp\nRUN git clone --depth=1 --recursive https://github.com/rockdaboot/libpsl.git\nRUN wget -qO- https://ftp.gnu.org/gnu/nettle/nettle-3.10.tar.gz | tar xz && mv nettle-3.10 nettle\nRUN git clone --depth=1 https://gitlab.com/gnutls/gnutls.git\nRUN wget -O- https://ftp.gnu.org/pub/gnu/libmicrohttpd/libmicrohttpd-latest.tar.gz | tar xz\n\nRUN git clone --recursive https://gitlab.com/gnuwget/wget2.git\nWORKDIR wget2\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/wget2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport WGET2_DEPS_PATH=$SRC/wget2_deps\nexport PKG_CONFIG_PATH=$WGET2_DEPS_PATH/lib64/pkgconfig:$WGET2_DEPS_PATH/lib/pkgconfig\nexport CPPFLAGS=\"-I$WGET2_DEPS_PATH/include\"\nexport LDFLAGS=\"-L$WGET2_DEPS_PATH/lib\"\nexport GNULIB_SRCDIR=$SRC/gnulib\nexport LLVM_PROFILE_FILE=/tmp/prof.test\n\ncd $SRC/libunistring\n./configure --enable-static --disable-shared --prefix=$WGET2_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/libidn2\n./configure --enable-static --disable-shared --disable-doc --disable-gcc-warnings --prefix=$WGET2_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/libpsl\n./autogen.sh\n./configure --enable-static --disable-shared --disable-gtk-doc --enable-runtime=libidn2 --enable-builtin=libidn2 --prefix=$WGET2_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/gmp\n./configure --enable-static --disable-shared --prefix=$WGET2_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/nettle\n./configure --enable-static --disable-shared --disable-documentation --disable-openssl --disable-assembler --disable-fat --prefix=$WGET2_DEPS_PATH\n( make -j$(nproc) || make -j$(nproc) ) && make install\nif test $? != 0;then\n        echo \"Failed to compile nettle\"\n        exit 1\nfi\n\ncd $SRC/gnutls\ntouch .submodule.stamp\n./bootstrap\nGNUTLS_CFLAGS=`echo $CFLAGS|sed s/-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION//`\nLIBS=\"-lunistring\" \\\nCFLAGS=\"$GNUTLS_CFLAGS\" \\\n./configure --enable-gcc-warnings --enable-static --disable-shared --with-included-libtasn1 \\\n    --with-included-unistring --without-p11-kit --disable-doc --disable-tests --disable-tools --disable-cxx \\\n    --disable-maintainer-mode --disable-libdane --disable-gcc-warnings --disable-full-test-suite --disable-guile \\\n    --prefix=$WGET2_DEPS_PATH\nmake -j$(nproc)\nmake install\n\ncd $SRC/libmicrohttpd-*\n./configure --enable-static --disable-shared --disable-doc --disable-examples --disable-tools --prefix=$WGET2_DEPS_PATH\nmake -j$(nproc)\nmake install\n\n# avoid iconv() memleak on Ubuntu 16.04 image (breaks test suite)\nexport ASAN_OPTIONS=detect_leaks=0\n\ncd $SRC/wget2\n./bootstrap\n\nLIBS=\"-lgnutls -lhogweed -lnettle -lgmp -lidn2 -lunistring -lpsl -lz\" \\\n  ./configure -C --enable-static --disable-shared --disable-doc --without-plugin-support --with-libdane=no \\\n  --disable-examples\nmake clean\nmake -j$(nproc)\nmake -j$(nproc) -C unit-tests check\nmake -j$(nproc) -C fuzz check\n\nLIBS=\"-lgnutls -lhogweed -lnettle -lgmp -lidn2 -lunistring -lpsl -lz\" \\\n  ./configure -C --enable-fuzzing --enable-static --disable-shared --disable-doc --without-plugin-support --with-libdane=no \\\n  --disable-examples\nmake clean\nmake -j$(nproc) -C lib\nmake -j$(nproc) -C include\nmake -j$(nproc) -C libwget\nmake -j$(nproc) -C src\n\n# Ensure our libraries can be found\nln -sf $WGET2_DEPS_PATH/lib64/libhogweed.a $WGET2_DEPS_PATH/lib/libhogweed.a\nln -sf $WGET2_DEPS_PATH/lib64/libnettle.a  $WGET2_DEPS_PATH/lib/libnettle.a\n\n# build fuzzers\ncd fuzz\n\nCXXFLAGS=\"$CXXFLAGS -L$WGET2_DEPS_PATH/lib/\" make oss-fuzz\n\nfind . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'\nfind . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'\n\nfor dir in *_fuzzer.in; do\n  fuzzer=$(basename $dir .in)\n  zip -rj \"$OUT/${fuzzer}_seed_corpus.zip\" \"${dir}/\"\ndone\n"
  },
  {
    "path": "projects/wget2/project.yaml",
    "content": "homepage: \"https://gitlab.com/gnuwget/wget2\"\nlanguage: c++\nprimary_contact: \"rockdaboot@gmail.com\"\nauto_ccs:\n  - \"tim.ruehsen@gmx.de\"\n  - \"darnir@gmail.com\"\n  - \"gscrivan@redhat.com\"\n  - \"ajuaristi@gmx.es\"\n  - \"rootkea@gmail.com\"\nmain_repo: 'https://gitlab.com/gnuwget/wget2.git'\n"
  },
  {
    "path": "projects/wget2/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/wget2\n\n# The following runs all of wget2's tests except for:\n# 1: test-redirection\n# 2: test-ocsp-server\n# 3: test-ocsp-stap\n# 4: test-cookies\n#\n# At the time of making this script, these 4 tests\n# failed at the latest master and the last few releases.\nmake check -C tests TESTS=\"test-wget-1 test-c-r test-restrict-ascii test-i-http test-i-https test-np test-spider-r test-meta-robots test-idn-robots test-idn-meta test-idn-cmd test-iri test-iri-percent test-iri-list test-iri-forced-remote test-auth-basic test-parse-rss test-page-requisites test-p-nc test-accept test-k test-follow-tags test-directory-clash test-base test-metalink test-robots test-robots-off test-parse-css test-bad-chunk test-iri-subdir test-chunked test-cut-dirs test-cut-get-vars test-parse-html-css test-auth-digest test-stats-dns test-stats-tls test-stats-site test-stats-ocsp test-plugin-interception test-plugin-nonexistance test-plugin-failure test-filter-mime-type test-https-enforce-hard1 test-https-enforce-hard2 test-https-enforce-hard3 test-https-enforce-soft1 test-https-enforce-soft2 test-https-enforce-soft3 test-gzip test-compression test-include-and-exclude-directories test-save-content-on test-limit-rate test-interrupt-response test-post-handshake-auth test-unlink test-limit-rate-http2 test-timestamping test-E-k test-ignore-length test-convert-file-only test-download-attr test-directory-prefix test-level\"\n"
  },
  {
    "path": "projects/wheel/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/pypa/wheel wheel\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/wheel\n"
  },
  {
    "path": "projects/wheel/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/wheel/fuzz_wheel.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport zipfile\nfrom wheel.cli import unpack, WheelError\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  wheel_path = \"/tmp/fuzzwheelfile-1.0-py27-none-any.whl\"\n  with open(wheel_path, \"wb\") as fuzz_file:\n    fuzz_file.write(data)\n\n  try:\n    zipfile.ZipFile(wheel_path, \"r\", zipfile.ZIP_DEFLATED, allowZip64=True)\n  except:\n    # To focus on the wheel logic we only want to use zipfiles that\n    # does not cause zipfile to break. This is because wheel does not\n    # protect against this: e.g. https://github.com/pypa/wheel/blob/8dfef1355a8f19e773a08630613bd2da6c636c37/src/wheel/wheelfile.py#L47\n    return\n\n  try:\n    unpack.unpack(wheel_path)\n  except WheelError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/wheel/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/pypa/wheel\nlanguage: python\nmain_repo: https://github.com/pypa/wheel\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/wireshark/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\n\nRUN apt-get update && apt-get install -y ninja-build cmake \\\n                       flex libc-ares-dev \\\n                       libglib2.0-dev libgcrypt20-dev wget\n\nRUN wget https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.10.tar.xz\nRUN git clone --depth=1 https://gitlab.com/wireshark/wireshark.git\nRUN git clone --depth=1 https://bitbucket.org/jwzawadzki/wireshark-fuzzdb.git\n\nWORKDIR wireshark\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wireshark/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC\ntar -xJf $SRC/libxml2-2.12.10.tar.xz\ncd libxml2-2.12.10\n./configure --disable-shared --enable-static --disable-ipv6 --without-python --without-zlib --without-lzma\nmake -j$(nproc)\nmake install\nexport LIBXML_CFLAGS=\"-I$(pwd)/include\"\nexport LIBXML_LIBS=\"-L$(pwd) -lxml2\"\nexport XML_CFLAGS=\"$LIBXML_CFLAGS\"\nexport XML_LIBS=\"$LIBXML_LIBS\"\ncd $SRC/wireshark\n\nWIRESHARK_BUILD_PATH=\"$WORK/build\"\nmkdir -p \"$WIRESHARK_BUILD_PATH\"\n\n# Prepare Samples directory\nexport SAMPLES_DIR=\"$WORK/samples\"\nmkdir -p \"$SAMPLES_DIR\"\ncp -a $SRC/wireshark-fuzzdb/samples/* \"$SAMPLES_DIR\"\n\n# Make sure we build fuzzshark.\nCMAKE_DEFINES=\"-DBUILD_fuzzshark=ON\"\n\n# compile static version of libs\n# XXX, with static wireshark linking each fuzzer binary is ~346 MB (just libwireshark.a is 761 MB).\n# XXX, wireshark is not ready for including static plugins into binaries.\nCMAKE_DEFINES=\"$CMAKE_DEFINES -DBUILD_SHARED_LIBS=OFF -DENABLE_PLUGINS=OFF\"\n\n# disable optional dependencies\nCMAKE_DEFINES=\"$CMAKE_DEFINES -DENABLE_PCAP=OFF -DENABLE_GNUTLS=OFF\"\n\n# There is no need to manually disable programs via BUILD_xxx=OFF since the\n# all-fuzzers targets builds the minimum required binaries. However we do have\n# to disable the Qt GUI and sharkd or else the cmake step will fail.\nCMAKE_DEFINES=\"$CMAKE_DEFINES -DBUILD_wireshark=OFF -DBUILD_stratoshark=OFF -DBUILD_sharkd=OFF\"\n\ncd \"$WIRESHARK_BUILD_PATH\"\n\ncmake -GNinja \\\n      -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \\\n      -DCMAKE_C_FLAGS=\"-Wno-error=fortify-source -Wno-error=missing-field-initializers $CFLAGS\" -DCMAKE_CXX_FLAGS=\"-Wno-error=fortify-source -Wno-error=missing-field-initializers $CXXFLAGS\" \\\n      -DCMAKE_JOB_POOL_LINK=limited_link_pool \\\n      -DCMAKE_JOBS_POOLS:STRING=limited_link_pool=2 \\\n      -DENABLE_WERROR=OFF -DOSS_FUZZ=ON $CMAKE_DEFINES \\\n      -DUSE_STATIC=ON $SRC/wireshark\n\nninja all-fuzzers -j$(expr $(nproc) / 4)\n\n$SRC/wireshark/tools/oss-fuzzshark/build.sh all\n"
  },
  {
    "path": "projects/wireshark/project.yaml",
    "content": "homepage: \"https://www.wireshark.org\"\nlanguage: c++\nprimary_contact: \"gerald@wireshark.org\"\nauto_ccs:\n - \"security@wireshark.org\"\n - \"peter@lekensteyn.nl\"\n - \"me@moshekaplan.com\"\n - \"david@davidmanouchehri.com\"\n - \"lomato@gmail.com\"\n - \"rknall@gmail.com\"\n - \"jbwzawadzki@gmail.com\"\n - \"gerald.combs@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\nmain_repo: 'https://gitlab.com/wireshark/wireshark'\nbase_os_version: ubuntu-24-04\n"
  },
  {
    "path": "projects/woff2/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\nRUN git clone --depth 1 --recursive https://github.com/google/woff2\nWORKDIR woff2\nCOPY build.sh *.options $SRC/\nCOPY corpus $SRC/corpus\n"
  },
  {
    "path": "projects/woff2/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n  cd $SRC/\n  python3 -m pip install Brotli\n  cd $SRC/woff2\nfi\n\n# Build the library. Actually there is no 'library' target, so we use .o files.\n# '-no-canonical-prefixes' flag makes clang crazy. Need to avoid it.\ncat brotli/shared.mk | sed -e \"s/-no-canonical-prefixes//\" \\\n> brotli/shared.mk.temp\nmv brotli/shared.mk.temp brotli/shared.mk\n\nif [ \"$SANITIZER\" == \"introspector\" ]; then\n  # Modify AR flags as \"f\" is not a valid option to llvm-ar.\n  sed -i 's/crf/cr/g' Makefile\nfi\n\n# woff2 uses LFLAGS instead of LDFLAGS.\nmake clean\nmake CC=\"$CC $CFLAGS\" CXX=\"$CXX $CXXFLAGS\" CANONICAL_PREFIXES= all \\\n  NOISY_LOGGING=\n\n# Build fuzzers\nfor fuzzer_archive in src/*fuzzer*.a; do\n  fuzzer_name=$(basename ${fuzzer_archive%.a})\n  $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer_archive \\\n      -o $OUT/$fuzzer_name\n  zip -q $OUT/${fuzzer_name}_seed_corpus.zip $SRC/corpus/*\ndone\n\ncp $SRC/*.options $OUT/\n"
  },
  {
    "path": "projects/woff2/convert_woff2ttf_fuzzer.options",
    "content": "[libfuzzer]\nmax_len = 1000000\n"
  },
  {
    "path": "projects/woff2/convert_woff2ttf_fuzzer_new_entry.options",
    "content": "[libfuzzer]\nmax_len = 1000000\n"
  },
  {
    "path": "projects/woff2/project.yaml",
    "content": "homepage: \"https://github.com/google/woff2\"\nlanguage: c++\nprimary_contact: \"rsheeter@google.com\"\nauto_ccs:\n  - \"grieger@google.com\"\n  - \"nyshadhr@google.com\"\n  - \"ewa@google.com\"\n  - \"williamsnathan@google.com\"\nvendor_ccs:\n  - \"jkew@mozilla.com\"\n  - \"jmuizelaar@mozilla.com\"\n  - \"lsalzman@mozilla.com\"\n  - \"twsmith@mozilla.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - centipede\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/google/woff2'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/wolfmqtt/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool bsdmainutils pkg-config libwebsockets-dev\nRUN git clone --depth 1 https://github.com/wolfSSL/wolfssl.git\nRUN git clone --depth 1 https://github.com/wolfSSL/wolfMQTT.git wolfmqtt\nRUN git clone --depth 1 https://github.com/guidovranken/wolfmqtt-fuzzers.git\nRUN git clone --depth 1 https://github.com/guidovranken/fuzzing-headers.git\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wolfmqtt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build wolfSSL (dependency of wolfMQTT)\ncd $SRC/wolfssl/\nautoreconf -ivf\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    ./configure --enable-static --disable-crypttests --disable-examples --disable-asm\nelif [[ $CFLAGS = *-m32* ]]\nthen\n    ./configure --enable-static --disable-crypttests --disable-examples --disable-fastmath\nelse\n    ./configure --enable-static --disable-crypttests --disable-examples\nfi\nmake -j$(nproc)\nexport CFLAGS=\"$CFLAGS -I $(realpath .)\"\nexport LDFLAGS=\"-L$(realpath src/.libs/)\"\n\n# Build wolfMQTT\ncd $SRC/wolfmqtt/\n./autogen.sh\n./configure --enable-static --disable-examples --enable-mqtt5\nmake -j$(nproc)\n\n$CXX $CXXFLAGS \\\n    -std=c++17 \\\n    -I $SRC/fuzzing-headers/include/ \\\n    -I $SRC/wolfssl/ \\\n    -I $SRC/wolfmqtt/ \\\n    $SRC/wolfmqtt-fuzzers/fuzzer.cpp \\\n    $SRC/wolfmqtt/src/.libs/libwolfmqtt.a \\\n    $SRC/wolfssl/src/.libs/libwolfssl.a \\\n    $LIB_FUZZING_ENGINE \\\n    -o $OUT/wolfmqtt-fuzzer\n"
  },
  {
    "path": "projects/wolfmqtt/project.yaml",
    "content": "homepage: \"https://www.wolfssl.com/products/wolfmqtt/\"\nlanguage: c\nprimary_contact: \"guidovranken@gmail.com\"\nmain_repo: \"https://github.com/wolfSSL/wolfMQTT\"\nauto_ccs:\n    - \"eric@wolfssl.com\"\n    - \"embhorn@gmail.com\"\n    - \"david@wolfssl.com\"\n    - \"dgarske80@gmail.com\"\n    - \"kaleb@wolfssl.com\"\n    - \"kaleb.himes@gmail.com\"\nsanitizers:\n - address\n - undefined\n - memory\narchitectures:\n  - x86_64\n  - i386\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/wolfssl/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool zip wget python bsdmainutils libcrypt-dev:i386\nRUN git clone --depth 1 https://github.com/wolfssl/wolfssl $SRC/wolfssl\nRUN git clone --depth 1 https://github.com/wolfSSL/wolfsm\nRUN git clone --depth 1 https://github.com/wolfSSL/wolfssh.git\nRUN git clone --depth 1 https://github.com/JacobBarthelmeh/fuzzing-headers.git\nRUN git clone --depth 1 https://github.com/JacobBarthelmeh/wolf-ssl-ssh-fuzzers\nRUN git clone --depth 1 https://github.com/MozillaSecurity/cryptofuzz\nRUN git clone --depth 1 https://github.com/google/wycheproof.git\nRUN wget https://archives.boost.io/release/1.82.0/source/boost_1_82_0.tar.bz2\nRUN git clone https://github.com/wolfssl/oss-fuzz-targets --depth 1 $SRC/fuzz-targets\n\n# Retrieve corpora from other projects\nRUN wget https://storage.googleapis.com/pub/gsutil.tar.gz -O $SRC/gsutil.tar.gz\nRUN tar zxf $SRC/gsutil.tar.gz\nENV PATH=\"${PATH}:$SRC/gsutil\"\nRUN gsutil cp gs://bearssl-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/bearssl_cryptofuzz-bearssl/public.zip $SRC/corpus_bearssl.zip\nRUN gsutil cp gs://nettle-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/nettle_cryptofuzz-nettle-with-mini-gmp/public.zip $SRC/corpus_nettle.zip\nRUN gsutil cp gs://libecc-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/libecc_cryptofuzz-libecc/public.zip $SRC/corpus_libecc.zip\nRUN gsutil cp gs://relic-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/relic_cryptofuzz-relic/public.zip $SRC/corpus_relic.zip\nRUN gsutil cp gs://cryptofuzz-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/cryptofuzz_cryptofuzz-openssl/public.zip $SRC/corpus_cryptofuzz-openssl.zip\nRUN gsutil cp gs://cryptofuzz-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/cryptofuzz_cryptofuzz-boringssl/public.zip $SRC/corpus_cryptofuzz-boringssl.zip\nRUN gsutil cp gs://cryptofuzz-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/cryptofuzz_cryptofuzz-nss/public.zip $SRC/corpus_cryptofuzz-nss.zip\n\n# OpenSSL/LibreSSL corpora, which require a special import procedure\nRUN gsutil cp gs://openssl-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/openssl_bignum/public.zip $SRC/corpus_openssl_expmod.zip\nRUN gsutil cp gs://libressl-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/libressl_bignum/public.zip $SRC/corpus_libressl_expmod.zip\n\nWORKDIR wolfssl\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wolfssl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif true\nthen\n    cd $SRC/wolfsm/\n    ./install.sh\n\n    cd $SRC/wolfssl/\n    WOLFCRYPT_CONFIGURE_PARAMS=\"--enable-static --enable-md2 --enable-md4 --enable-ripemd --enable-blake2 --enable-blake2s --enable-pwdbased --enable-scrypt --enable-hkdf --enable-cmac --enable-arc4 --enable-camellia --enable-aesccm --enable-aesctr --enable-xts --enable-des3 --enable-x963kdf --enable-harden --enable-aescfb --enable-aesofb --enable-aeskeywrap --enable-aessiv --enable-keygen --enable-curve25519 --enable-curve448 --enable-shake256 --disable-crypttests --disable-examples --enable-compkey --enable-ed448 --enable-ed25519 --enable-ecccustcurves --enable-xchacha --enable-cryptocb --enable-eccencrypt --enable-aesgcm-stream --enable-smallstack --enable-ed25519-stream --enable-ed448-stream --enable-aesgcm-stream --enable-shake128 --enable-siphash --enable-eccsi --with-eccminsz=0 --enable-sm2 --enable-sm3 --enable-sm4-cbc --enable-sm4-ccm --enable-sm4-ctr --enable-sm4-ecb --enable-sm4-gcm\"\n    if [[ $CFLAGS = *sanitize=memory* ]]\n    then\n        WOLFCRYPT_CONFIGURE_PARAMS=\"$WOLFCRYPT_CONFIGURE_PARAMS --disable-asm\"\n    fi\n\n    # Install Boost headers\n    cd $SRC/\n    tar jxf boost_1_82_0.tar.bz2\n    cd boost_1_82_0/\n    CFLAGS=\"\" CXXFLAGS=\"\" ./bootstrap.sh\n    CFLAGS=\"\" CXXFLAGS=\"\" ./b2 headers\n    cp -R boost/ /usr/include/\n\n    OLD_CFLAGS=\"$CFLAGS\"\n    OLD_CXXFLAGS=\"$CXXFLAGS\"\n\n    # Configure Cryptofuzz\n    cd $SRC/cryptofuzz\n    sed -i 's/kNegativeIntegers = false/kNegativeIntegers = true/g' config.h\n    cp -R $SRC/cryptofuzz/ $SRC/cryptofuzz-openssl-api/\n    cd $SRC/cryptofuzz-openssl-api/\n    python gen_repository.py\n    rm extra_options.h\n    echo -n '\"' >>extra_options.h\n    echo -n '--force-module=wolfCrypt-OpenSSL ' >>extra_options.h\n    echo -n '\"' >>extra_options.h\n\n    # Build OpenSSL API fuzzer\n    cp -R $SRC/wolfssl/ $SRC/wolfssl-openssl-api/\n    cd $SRC/wolfssl-openssl-api/\n    autoreconf -ivf\n    CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP\"\n    if [[ $CFLAGS = *-m32* ]]\n    then\n        ./configure $WOLFCRYPT_CONFIGURE_PARAMS --enable-opensslall --enable-opensslextra --disable-fastmath\n    else\n        ./configure $WOLFCRYPT_CONFIGURE_PARAMS --enable-opensslall --enable-opensslextra\n    fi\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_WOLFCRYPT_OPENSSL -Wno-deprecated-literal-operator\"\n    export WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl-openssl-api/src/.libs/libwolfssl.a\"\n    export WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl-openssl-api/\"\n    cd $SRC/cryptofuzz-openssl-api/modules/wolfcrypt-openssl\n    make -j$(nproc)\n    cd $SRC/cryptofuzz-openssl-api/\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc)\n    cp cryptofuzz $OUT/cryptofuzz-openssl-api\n    CFLAGS=\"$OLD_CFLAGS\"\n    CXXFLAGS=\"$OLD_CXXFLAGS\"\n    unset WOLFCRYPT_LIBWOLFSSL_A_PATH\n    unset WOLFCRYPT_INCLUDE_PATH\n\n    # Configure Cryptofuzz\n    cd $SRC/cryptofuzz/\n    python gen_repository.py\n\n    rm extra_options.h\n    echo -n '\"' >>extra_options.h\n    echo -n '--force-module=wolfCrypt ' >>extra_options.h\n    echo -n '--digests=NULL ' >>extra_options.h\n    echo -n '--operations=' >>extra_options.h\n    echo -n 'BignumCalc,' >>extra_options.h\n    echo -n 'DH_GenerateKeyPair,' >>extra_options.h\n    echo -n 'DH_Derive,' >>extra_options.h\n    echo -n 'ECC_GenerateKeyPair,' >>extra_options.h\n    echo -n 'ECC_PrivateToPublic,' >>extra_options.h\n    echo -n 'ECC_ValidatePubkey,' >>extra_options.h\n    echo -n 'ECDSA_Verify,' >>extra_options.h\n    echo -n 'ECDSA_Sign,' >>extra_options.h\n    echo -n 'ECIES_Encrypt,' >>extra_options.h\n    echo -n 'ECIES_Decrypt,' >>extra_options.h\n    echo -n 'ECC_Point_Add,' >>extra_options.h\n    echo -n 'ECC_Point_Mul,' >>extra_options.h\n    echo -n 'ECC_Point_Dbl,' >>extra_options.h\n    echo -n 'ECDH_Derive,' >>extra_options.h\n    echo -n 'ECCSI_Sign,' >>extra_options.h\n    echo -n 'ECCSI_Verify ' >>extra_options.h\n    echo -n '\"' >>extra_options.h\n\n    # Build normal math fuzzer\n    cp -R $SRC/cryptofuzz/ $SRC/cryptofuzz-normal-math/\n    cp -R $SRC/wolfssl/ $SRC/wolfssl-normal-math/\n    cd $SRC/wolfssl-normal-math/\n    autoreconf -ivf\n    CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP\"\n    if [[ $CFLAGS != *-m32* ]]\n    then\n        ./configure $WOLFCRYPT_CONFIGURE_PARAMS\n    else\n        # Compiling instrumented 32 bit normal math with asm is currently\n        # not possible because it results in Clang error messages such as:\n        #\n        # wolfcrypt/src/tfm.c:3154:11: error: inline assembly requires more registers than available\n        ./configure $WOLFCRYPT_CONFIGURE_PARAMS --disable-asm\n    fi\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_WOLFCRYPT -Wno-deprecated-literal-operator\"\n    export WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl-normal-math/src/.libs/libwolfssl.a\"\n    export WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl-normal-math/\"\n    cd $SRC/cryptofuzz-normal-math/modules/wolfcrypt\n    make -j$(nproc)\n    cd $SRC/cryptofuzz-normal-math/\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc)\n    cp cryptofuzz $OUT/cryptofuzz-normal-math\n    CFLAGS=\"$OLD_CFLAGS\"\n    CXXFLAGS=\"$OLD_CXXFLAGS\"\n    unset WOLFCRYPT_LIBWOLFSSL_A_PATH\n    unset WOLFCRYPT_INCLUDE_PATH\n\n    # Build sp-math-all fuzzer\n    cp -R $SRC/cryptofuzz/ $SRC/cryptofuzz-sp-math-all/\n    cp -R $SRC/wolfssl/ $SRC/wolfssl-sp-math-all/\n    cd $SRC/wolfssl-sp-math-all/\n    autoreconf -ivf\n    CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP -DWOLFSSL_SP_INT_NEGATIVE\"\n    ./configure $WOLFCRYPT_CONFIGURE_PARAMS --enable-sp-math-all\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_WOLFCRYPT -Wno-deprecated-literal-operator\"\n    export WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl-sp-math-all/src/.libs/libwolfssl.a\"\n    export WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl-sp-math-all/\"\n    cd $SRC/cryptofuzz-sp-math-all/modules/wolfcrypt\n    make -j$(nproc)\n    cd $SRC/cryptofuzz-sp-math-all/\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc)\n    cp cryptofuzz $OUT/cryptofuzz-sp-math-all\n    CFLAGS=\"$OLD_CFLAGS\"\n    CXXFLAGS=\"$OLD_CXXFLAGS\"\n    unset WOLFCRYPT_LIBWOLFSSL_A_PATH\n    unset WOLFCRYPT_INCLUDE_PATH\n\n    # Build sp-math-all 8bit fuzzer\n    cp -R $SRC/cryptofuzz/ $SRC/cryptofuzz-sp-math-all-8bit/\n    cp -R $SRC/wolfssl/ $SRC/wolfssl-sp-math-all-8bit/\n    cd $SRC/wolfssl-sp-math-all-8bit/\n    autoreconf -ivf\n    CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP -DSP_WORD_SIZE=8 -DWOLFSSL_SP_INT_NEGATIVE\"\n    ./configure $WOLFCRYPT_CONFIGURE_PARAMS --enable-sp-math-all\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_WOLFCRYPT -Wno-deprecated-literal-operator\"\n    export WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl-sp-math-all-8bit/src/.libs/libwolfssl.a\"\n    export WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl-sp-math-all-8bit/\"\n    cd $SRC/cryptofuzz-sp-math-all-8bit/modules/wolfcrypt\n    make -j$(nproc)\n    cd $SRC/cryptofuzz-sp-math-all-8bit/\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc)\n    cp cryptofuzz $OUT/cryptofuzz-sp-math-all-8bit\n    CFLAGS=\"$OLD_CFLAGS\"\n    CXXFLAGS=\"$OLD_CXXFLAGS\"\n    unset WOLFCRYPT_LIBWOLFSSL_A_PATH\n    unset WOLFCRYPT_INCLUDE_PATH\n\n    # Build sp-math fuzzer\n    cp -R $SRC/cryptofuzz/ $SRC/cryptofuzz-sp-math/\n    cp -R $SRC/wolfssl/ $SRC/wolfssl-sp-math/\n    cd $SRC/wolfssl-sp-math/\n    autoreconf -ivf\n    # -DHAVE_ECC_BRAINPOOL and -DHAVE_ECC_KOBLITZ are lacking from the CFLAGS; these are not supported by SP math\n    CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP -DWOLFSSL_PUBLIC_ECC_ADD_DBL\"\n    # SP math does not support custom curves, so remove that flag\n    export WOLFCRYPT_CONFIGURE_PARAMS_SP_MATH=${WOLFCRYPT_CONFIGURE_PARAMS//\"--enable-ecccustcurves\"/}\n    if [[ $CFLAGS = *-m32* ]]\n    then\n        setarch i386 ./configure $WOLFCRYPT_CONFIGURE_PARAMS_SP_MATH --enable-sp --enable-sp-math\n    elif [[ $CFLAGS = *sanitize=memory* ]]\n    then\n        ./configure $WOLFCRYPT_CONFIGURE_PARAMS_SP_MATH --enable-sp --enable-sp-math --disable-sp-asm\n    else\n        ./configure $WOLFCRYPT_CONFIGURE_PARAMS_SP_MATH --enable-sp --enable-sp-math\n    fi\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_WOLFCRYPT -Wno-deprecated-literal-operator\"\n    export WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl-sp-math/src/.libs/libwolfssl.a\"\n    export WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl-sp-math/\"\n    cd $SRC/cryptofuzz-sp-math/modules/wolfcrypt\n    make -j$(nproc)\n    cd $SRC/cryptofuzz-sp-math/\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc)\n    cp cryptofuzz $OUT/cryptofuzz-sp-math\n    CFLAGS=\"$OLD_CFLAGS\"\n    CXXFLAGS=\"$OLD_CXXFLAGS\"\n    unset WOLFCRYPT_LIBWOLFSSL_A_PATH\n    unset WOLFCRYPT_INCLUDE_PATH\n\n    # Build fastmath fuzzer\n    cp -R $SRC/cryptofuzz/ $SRC/cryptofuzz-fastmath/\n    cp -R $SRC/wolfssl/ $SRC/wolfssl-fastmath/\n    cd $SRC/wolfssl-fastmath/\n    autoreconf -ivf\n    CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP\"\n    ./configure $WOLFCRYPT_CONFIGURE_PARAMS --enable-fastmath\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_WOLFCRYPT -Wno-deprecated-literal-operator\"\n    export WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl-fastmath/src/.libs/libwolfssl.a\"\n    export WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl-fastmath/\"\n    cd $SRC/cryptofuzz-fastmath/modules/wolfcrypt\n    make -j$(nproc)\n    cd $SRC/cryptofuzz-fastmath/\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc)\n    cp cryptofuzz $OUT/cryptofuzz-fastmath\n    CFLAGS=\"$OLD_CFLAGS\"\n    CXXFLAGS=\"$OLD_CXXFLAGS\"\n    unset WOLFCRYPT_LIBWOLFSSL_A_PATH\n    unset WOLFCRYPT_INCLUDE_PATH\n\n    # Build heapmath fuzzer\n    cp -R $SRC/cryptofuzz/ $SRC/cryptofuzz-heapmath/\n    cp -R $SRC/wolfssl/ $SRC/wolfssl-heapmath/\n    cd $SRC/wolfssl-heapmath/\n    autoreconf -ivf\n    CFLAGS=\"$CFLAGS -DHAVE_AES_ECB -DWOLFSSL_DES_ECB -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ -DWOLFSSL_ECDSA_SET_K -DWOLFSSL_ECDSA_SET_K_ONE_LOOP\"\n    ./configure $WOLFCRYPT_CONFIGURE_PARAMS --enable-heapmath\n    make -j$(nproc)\n    export CXXFLAGS=\"$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL -DCRYPTOFUZZ_WOLFCRYPT -Wno-deprecated-literal-operator\"\n    export WOLFCRYPT_LIBWOLFSSL_A_PATH=\"$SRC/wolfssl-heapmath/src/.libs/libwolfssl.a\"\n    export WOLFCRYPT_INCLUDE_PATH=\"$SRC/wolfssl-heapmath/\"\n    cd $SRC/cryptofuzz-heapmath/modules/wolfcrypt\n    make -j$(nproc)\n    cd $SRC/cryptofuzz-heapmath/\n    LIBFUZZER_LINK=\"$LIB_FUZZING_ENGINE\" make -B -j$(nproc)\n    cp cryptofuzz $OUT/cryptofuzz-heapmath\n    CFLAGS=\"$OLD_CFLAGS\"\n    CXXFLAGS=\"$OLD_CXXFLAGS\"\n    unset WOLFCRYPT_LIBWOLFSSL_A_PATH\n    unset WOLFCRYPT_INCLUDE_PATH\n\n    mkdir $SRC/cryptofuzz-seed-corpus/\n\n    # Convert Wycheproof test vectors to Cryptofuzz corpus format\n    find $SRC/wycheproof/testvectors_v1/ -type f -name 'ecdsa_*' -exec $SRC/cryptofuzz-fastmath/cryptofuzz --from-wycheproof={},$SRC/cryptofuzz-seed-corpus/ \\;\n    find $SRC/wycheproof/testvectors_v1/ -type f -name 'ecdh_*' -exec $SRC/cryptofuzz-fastmath/cryptofuzz --from-wycheproof={},$SRC/cryptofuzz-seed-corpus/ \\;\n\n    # Unpack corpora from other projects\n    unzip -n $SRC/corpus_bearssl.zip -d $SRC/cryptofuzz_seed_corpus/ >/dev/null\n    unzip -n $SRC/corpus_nettle.zip -d $SRC/cryptofuzz_seed_corpus/ >/dev/null\n    unzip -n $SRC/corpus_libecc.zip -d $SRC/cryptofuzz_seed_corpus/ >/dev/null\n    unzip -n $SRC/corpus_relic.zip -d $SRC/cryptofuzz_seed_corpus/ >/dev/null\n    unzip -n $SRC/corpus_cryptofuzz-openssl.zip -d $SRC/cryptofuzz_seed_corpus/ >/dev/null\n    unzip -n $SRC/corpus_cryptofuzz-boringssl.zip -d $SRC/cryptofuzz_seed_corpus/ >/dev/null\n    unzip -n $SRC/corpus_cryptofuzz-nss.zip -d $SRC/cryptofuzz_seed_corpus/ >/dev/null\n\n    # Import OpenSSL/LibreSSL corpora\n    mkdir $SRC/openssl-expmod-corpus/\n    unzip $SRC/corpus_openssl_expmod.zip -d $SRC/openssl-expmod-corpus/ >/dev/null\n    find $SRC/openssl-expmod-corpus/ -type f -exec $SRC/cryptofuzz-fastmath/cryptofuzz --from-openssl-expmod={},$SRC/cryptofuzz-seed-corpus/ \\;\n\n    mkdir $SRC/libressl-expmod-corpus/\n    unzip $SRC/corpus_libressl_expmod.zip -d $SRC/libressl-expmod-corpus/ >/dev/null\n    find $SRC/libressl-expmod-corpus/ -type f -exec $SRC/cryptofuzz-fastmath/cryptofuzz --from-openssl-expmod={},$SRC/cryptofuzz-seed-corpus/ \\;\n\n    # Write Cryptofuzz built-in tests\n    $SRC/cryptofuzz-fastmath/cryptofuzz --from-builtin-tests=$SRC/cryptofuzz-seed-corpus/\n\n    # Pack it\n    cd $SRC/cryptofuzz_seed_corpus\n    zip -r $SRC/cryptofuzz_seed_corpus.zip . >/dev/null\n\n    # Use it as the seed corpus for each Cryptofuzz-based fuzzer\n    cp $SRC/cryptofuzz_seed_corpus.zip $OUT/cryptofuzz-normal-math_seed_corpus.zip\n    cp $SRC/cryptofuzz_seed_corpus.zip $OUT/cryptofuzz-sp-math-all_seed_corpus.zip\n    cp $SRC/cryptofuzz_seed_corpus.zip $OUT/cryptofuzz-sp-math-all-8bit_seed_corpus.zip\n    cp $SRC/cryptofuzz_seed_corpus.zip $OUT/cryptofuzz-sp-math_seed_corpus.zip\n    cp $SRC/cryptofuzz_seed_corpus.zip $OUT/cryptofuzz-fastmath_seed_corpus.zip\n    cp $SRC/cryptofuzz_seed_corpus.zip $OUT/cryptofuzz-heapmath_seed_corpus.zip\n\n    # Remove files that are no longer needed to prevent running out of disk space\n    rm -rf $SRC/openssl-expmod-corpus/\n    rm -rf $SRC/libressl-expmod-corpus/\n    rm -rf $SRC/cryptofuzz_seed_corpus/\n    rm -rf $SRC/cryptofuzz_seed_corpus.zip\n\n    # Build SSL/SSH fuzzers\n    NEW_SRC=$SRC/wolf-ssl-ssh-fuzzers/oss-fuzz/projects/wolf-ssl-ssh/\n    cp -R $SRC/wolfssl/ $NEW_SRC\n    cp -R $SRC/wolfssh/ $NEW_SRC\n    cp -R $SRC/fuzzing-headers/ $NEW_SRC\n    OSS_FUZZ_BUILD=1 SRC=\"$NEW_SRC\" $NEW_SRC/build.sh\n\n    # Copy corpora for SSL/SSH fuzzers\n    cp $SRC/wolf-ssl-ssh-fuzzers/corpora/fuzzer-wolfssl-client-randomize_seed_corpus.zip $OUT/\nfi\n\nif [[ $CFLAGS != *-m32* ]]\nthen\n    cd $SRC/wolfssl\n\n    # target_dir determined by Dockerfile\n    target_dir=\"$SRC/fuzz-targets\"\n\n    # build wolfssl\n    ./autogen.sh\n    ./configure --enable-static --disable-shared --prefix=/usr CC=\"clang\"\n    make -j \"$(nproc)\" all\n    make install\n\n    # put linker arguments into the environment, appending to any existing ones\n    export LDFLAGS=\"${LDFLAGS-\"\"}\"\n    export LDLIBS=\"${LDLIBS-\"\"} -lwolfssl $LIB_FUZZING_ENGINE\"\n\n    # make and export targets to $OUT; environment overridding internal variables\n    cd \"${target_dir}\"\n    make -e all\n    make -e export prefix=\"$OUT\"\nfi\n"
  },
  {
    "path": "projects/wolfssl/project.yaml",
    "content": "homepage: \"https://www.wolfssl.com/\"\nlanguage: c++\nprimary_contact: \"jacob@wolfssl.com\"\nauto_ccs:\n  - \"david@wolfssl.com\"\n  - \"john@wolfssl.com\"\n  - \"kaleb@wolfssl.com\"\n  - \"kaleb.himes@gmail.com\"\n  - \"testing@wolfssl.com\"\n  - \"dgarske80@gmail.com\"\n  - \"douzzer@mega.nu\"\n  - \"jordan@wolfssl.com\"\n  - \"jordanjphillips1@gmail.com\"\n  - \"anthony@wolfssl.com\"\n  - \"anthony.hu.76@gmail.com\"\n  - \"kareem@wolfssl.com\"\n  - \"sean@wolfssl.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/wolfssl/wolfssl'\n"
  },
  {
    "path": "projects/woodstox/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/XmlFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XmlFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/FasterXML/woodstox\n\nCOPY build.sh $SRC/\nCOPY XmlFuzzer.java $SRC/\nWORKDIR $SRC/woodstox\n"
  },
  {
    "path": "projects/woodstox/XmlFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.ByteArrayInputStream;\nimport javax.xml.stream.*;\nimport com.ctc.wstx.stax.WstxInputFactory;\nimport com.ctc.wstx.exc.WstxLazyException;\n\npublic class XmlFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        WstxInputFactory STAX_F = new WstxInputFactory();\n        try {\n            XMLStreamReader sr = STAX_F.createXMLStreamReader(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n            streamThrough(sr);\n            sr.close();\n        } catch (XMLStreamException | WstxLazyException e) {\n        }\n    }\n\n    public static int streamThrough(XMLStreamReader sr) throws XMLStreamException {\n        int result = 0;\n\n        while (sr.hasNext()) {\n            int type = sr.next();\n            result += type;\n            if (sr.hasText()) {\n                result += getText(sr).hashCode();\n            }\n            if (sr.hasName()) {\n                result += sr.getName().hashCode();\n            }\n        }\n\n        return result;\n    }\n\n    public static String getText(XMLStreamReader sr) {\n        int type = sr.getEventType();\n        int expLen = sr.getTextLength();\n        String text = sr.getText();\n        char[] textChars = sr.getTextCharacters();\n        int start = sr.getTextStart();\n\n        return text;\n    }\n}"
  },
  {
    "path": "projects/woodstox/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Move seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/woodstox-core-$CURRENT_VERSION.jar\" $OUT/woodstox.jar\n\nALL_JARS=\"woodstox.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n\n"
  },
  {
    "path": "projects/woodstox/project.yaml",
    "content": "homepage: \"https://github.com/FasterXML/woodstox\"\nlanguage: jvm\nprimary_contact: \"tatu@fasterxml.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/FasterXML/woodstox\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n"
  },
  {
    "path": "projects/wpantund/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get -y update \\\n\t&& DEBIAN_FRONTEND=noninteractive \\\n\t\t\tapt-get install -y -q --no-install-recommends \\\n\t\t\t\tgdb \\\n\t\t\t\tlibdbus-1-dev \\\n\t\t\t\tlibboost-dev \\\n\t\t\t\tpkg-config \\\n\t\t\t\tlibtool \\\n\t\t\t\tautoconf \\\n\t\t\t\tautoconf-archive \\\n\t\t\t\tautomake\n\nCOPY build.sh *.options run_tests.sh $SRC/\n\nRUN git clone --depth 1 https://github.com/openthread/wpantund\n\nWORKDIR wpantund\n"
  },
  {
    "path": "projects/wpantund/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Wpantund's configure script is fuzzer-aware, so we\n# move those flags into their own environment variables.\nFUZZ_CFLAGS=\"${CFLAGS}\"\nFUZZ_CXXFLAGS=\"${CXXFLAGS}\"\nunset CFLAGS\nunset CXXFLAGS\n\n./bootstrap.sh\n\n./configure                               \\\n        --enable-fuzz-targets             \\\n        --disable-shared                  \\\n        --enable-static                   \\\n\t\tCC=\"${CC}\"                        \\\n\t\tCXX=\"${CXX}\"                      \\\n\t\tFUZZ_LIBS=\"${LIB_FUZZING_ENGINE}\" \\\n\t\tFUZZ_CFLAGS=\"${FUZZ_CFLAGS}\"      \\\n\t\tFUZZ_CXXFLAGS=\"${FUZZ_CXXFLAGS}\"  \\\n\t\tLDFLAGS=\"-lpthread\"               \\\n\t\tCXXFLAGS=\"-stdlib=libc++\"\n\n# Build everything.\nmake -j$(nproc)\n\n# Copy all fuzzers and related options/dictionaries.\nfind . -name '*[-_]fuzz' -type f -exec cp -v '{}' $OUT ';'\nfind . -name '*[-_]fuzz.dict' -type f -exec cp -v '{}' $OUT ';'\nfind . -name '*[-_]fuzz.options' -type f -exec cp -v '{}' $OUT ';'\n\n# Copy all of the fuzzers' related corpi.\nfor f in etc/fuzz-corpus/*[-_]fuzz\ndo\n    fuzzer=$(basename $f)\n    if test -d \"${f}\"\n\tthen zip -j $OUT/${fuzzer}_seed_corpus.zip ${f}/*\n    fi\ndone\n\n# Dump out all of the files in the output.\nfind $OUT -type f > /dev/stderr\n"
  },
  {
    "path": "projects/wpantund/project.yaml",
    "content": "homepage: \"https://github.com/openthread/wpantund\"\nlanguage: c++\nprimary_contact: \"rquattle@google.com\"\nauto_ccs:\n - \"abtink@google.com\"\n - \"wpantund-fuzz@google.com\"\nmain_repo: 'https://github.com/openthread/wpantund'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/wpantund/run_tests.sh",
    "content": "#!/bin/bash -eux\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###############################################################################\n\nmake check\n"
  },
  {
    "path": "projects/wt/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y libboost-all-dev cmake\nRUN git clone https://github.com/emweb/wt.git\nCOPY build.sh $SRC/\nWORKDIR $SRC/wt/\n"
  },
  {
    "path": "projects/wt/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport CXXFLAGS=\"$CFLAGS\"\n\nmkdir -p mybuild\n\npushd mybuild/\ncmake -DSHARED_LIBS=OFF -DBUILD_FUZZ=ON -DBoost_USE_STATIC_LIBS=ON ../.\nmake -j$(nproc) --ignore-errors\ncp fuzz/fuzz-* $OUT/\npopd\n\ncp fuzz/*zip $OUT/\n"
  },
  {
    "path": "projects/wt/project.yaml",
    "content": "homepage: \"https://www.webtoolkit.eu/wt\"\nlanguage: c++\nprimary_contact: \"wt-security@emweb.be\"\nauto_ccs:\n  - \"matthias@emweb.be\"\n  - \"wim@emweb.be\"\n  - \"ajsinghyadav00@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\nmain_repo: 'https://github.com/emweb/wt'\n"
  },
  {
    "path": "projects/wtforms/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip email-validator\nRUN git clone https://github.com/wtforms/wtforms wtforms\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/wtforms\n"
  },
  {
    "path": "projects/wtforms/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\npip3 install .\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/wtforms/fuzz_validators.py",
    "content": "#!/usr/bin/python3\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\n\nimport wtforms\n\n\nclass FuzzField:\n  def __init__(self, text):\n    self.text = text\n    self.data = text\n\n  def gettext(self, string):\n    return self.text\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n\n  try:\n    c1 = wtforms.validators.HostnameValidation()\n    c1(fdp.ConsumeUnicodeNoSurrogates(1024))\n  except (wtforms.validators.StopValidation,\n          wtforms.validators.ValidationError):\n    pass\n\n  try:\n    validator = wtforms.validators.URL()\n    validator(fdp.ConsumeUnicodeNoSurrogates(1024),\n              FuzzField(fdp.ConsumeUnicodeNoSurrogates(1024)))\n  except wtforms.validators.ValidationError:\n    pass\n\n  try:\n    validator = wtforms.validators.email()\n    validator(fdp.ConsumeUnicodeNoSurrogates(1024),\n              FuzzField(fdp.ConsumeUnicodeNoSurrogates(1024)))\n  except wtforms.validators.ValidationError:\n    pass\n\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/wtforms/project.yaml",
    "content": "homepage: https://github.com/wtforms/wtforms\nmain_repo: https://github.com/wtforms/wtforms\nlanguage: python\nfuzzing_engines:\n- libfuzzer\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/wuffs/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y wget\n\n# Get Wuffs' first-party code.\n\nRUN git clone --depth 1 https://github.com/google/wuffs.git\n\n# Get third-party test corpora.\n\nRUN git clone --depth 1 https://github.com/nst/JSONTestSuite.git\nRUN rm -rf JSONTestSuite/.git\n\nRUN wget -O bmpsuite.zip https://entropymine.com/jason/bmpsuite/releases/bmpsuite-2.6.zip\nRUN mkdir bmpsuite_corpus\nRUN unzip -j bmpsuite.zip -d bmpsuite_corpus\nRUN rm bmpsuite.zip\n\nRUN mkdir libjpeg_turbo_corpus && \\\n    git clone --depth=1 https://github.com/libjpeg-turbo/seed-corpora && \\\n    mv ./seed-corpora/afl-testcases/jpeg_turbo/full/images/*.jpg ./libjpeg_turbo_corpus && \\\n    rm -rf seed-corpora\n\nRUN mkdir pngsuite_corpus && \\\n    git clone --depth=1 https://github.com/nigeltao/mozsec-fuzzdata && \\\n    mv ./mozsec-fuzzdata/samples/png/common/*.png ./pngsuite_corpus && \\\n    rm -rf mozsec-fuzzdata\n\nRUN git clone --depth 1 https://github.com/minio/simdjson-fuzz\nRUN mv simdjson-fuzz/corpus/corpus simdjson_corpus\nRUN rm -rf simdjson-fuzz\n\nRUN git clone --depth 1 https://github.com/webmproject/libwebp-test-data.git webp_corpus\nRUN rm -rf webp_corpus/.git\n\nRUN git clone --depth 1 https://github.com/nigeltao/xz-tests-files\nRUN rm -rf xz-tests-files/.git\nRUN mv xz-tests-files xz_corpus\n\n# Finish.\n\nWORKDIR wuffs\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wuffs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# \"Build the project\" is a no-op. There is no \"./configure.sh && make\" dance.\n# Wuffs' generated C files are \"drop-in libraries\" a la\n# http://gpfault.net/posts/drop-in-libraries.txt.html\n\nfor f in fuzz/c/std/*_fuzzer.c*; do\n  # Extract the format name (such as \"gzip\", from the C or C++ file name,\n  # \"fuzz/c/std/gzip_fuzzer.c\") and make the \"gzip_fuzzer\" binary. First\n  # compile the (C or C++) Wuffs code...\n  extension=\"${f##*.}\"\n  if [   \"$extension\" = \"c\" ]; then\n    echo \"Building (C)   $f\"\n    b=$(basename $f _fuzzer.c)\n    $CC  $CFLAGS   -c $f -o $WORK/${b}_fuzzer.o\n  elif [ \"$extension\" = \"cc\" ]; then\n    if [[ $LIB_FUZZING_ENGINE == *\"DataFlow\"* ]]; then\n      # Linking (below) with \"--engine dataflow\" works with the C fuzzers but\n      # not the C++ ones. With C++, we get errors like `undefined reference to\n      # `dfs$_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'`\n      #\n      # This is possibly \"DFsan instrumented dependencies\"\n      # https://github.com/google/oss-fuzz/issues/3388\n      echo \"Skipping (C++) $f\"\n      continue\n    fi\n    echo \"Building (C++) $f\"\n    b=$(basename $f _fuzzer.cc)\n    $CXX $CXXFLAGS -c $f -o $WORK/${b}_fuzzer.o\n  else\n    continue\n  fi\n\n  # ...then link the (C++) fuzzing library.\n  $CXX $CXXFLAGS $WORK/${b}_fuzzer.o -o $OUT/${b}_fuzzer $LIB_FUZZING_ENGINE\n\n  # Make the optional \"gzip_fuzzer_seed_corpus.zip\" archive. This means\n  # extracting the \"foo/bar/*.gz\" out of the matching \"gzip: foo/bar/*.gz\"\n  # lines in fuzz/c/std/seed_corpora.txt.\n  #\n  # The seed_corpora.txt lines can contain multiple entries, combining\n  # independent corpora. A naive \"zip --junk-paths\" of all those files can fail\n  # if there are duplicate file names, which can easily happen if the file name\n  # is a hash of its contents and the contents are a (trivial) minimal\n  # reproducer. We use a de-duplication step of copying all of those files into\n  # a single directory. Doing that in a single \"cp\" or \"mv\" call can fail with\n  # \"will not overwrite just-created 'foo/etc' with 'bar/etc'\", so we make\n  # multiple calls, each copying one file at a time. Later duplicates overwrite\n  # earlier duplicates. It's OK if the contents aren't identical. The result is\n  # still a valid uber-corpus of seed files.\n  seeds=$(sed -n -e \"/^$b:/s/^$b: *//p\" fuzz/c/std/seed_corpora.txt)\n  if [ -n \"$seeds\" ]; then\n    mkdir ${b}_fuzzer_seed_corpus\n    for s in $seeds; do\n      cp $s ${b}_fuzzer_seed_corpus\n    done\n    zip --junk-paths --recurse-paths $OUT/${b}_fuzzer_seed_corpus.zip ${b}_fuzzer_seed_corpus\n    rm -rf ${b}_fuzzer_seed_corpus\n  fi\ndone\n"
  },
  {
    "path": "projects/wuffs/project.yaml",
    "content": "homepage: \"https://github.com/google/wuffs\"\nlanguage: c++\nprimary_contact: \"nigeltao@golang.org\"\nauto_ccs:\n  - \"raph.levien@gmail.com\"\nsanitizers:\n  - address\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/google/wuffs.git'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/wxwidgets/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\nRUN git clone --recurse-submodules --depth 1 https://github.com/wxWidgets/wxWidgets.git wxwidgets\nWORKDIR wxwidgets\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/wxwidgets/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npushd $SRC/wxwidgets\n./tests/fuzz/ossfuzz.sh\npopd\n"
  },
  {
    "path": "projects/wxwidgets/project.yaml",
    "content": "homepage: \"https://www.wxwidgets.org/\"\nlanguage: c++\nprimary_contact: \"vzeitlin@gmail.com\"\nmain_repo: 'https://github.com/wxWidgets/wxWidgets.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/xbps/project.yaml",
    "content": "homepage: \"https://github.com/void-linux/xbps\"\nprimary_contact: \"miwaxe@gmail.com\"\nauto_ccs:\n  - \"gottox@voidlinux.eu\"\n  - \"xtraeme@voidlinux.eu\"\nmain_repo: \"https://github.com/void-linux/xbps\"\nlanguage: c\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/xen/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get -y install iasl uuid-dev \\\n    libncurses-dev pkg-config libglib2.0-dev libpixman-1-dev \\\n    libyajl-dev\nRUN git clone --depth=1 https://xenbits.xen.org/git-http/xen.git\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/xen/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nchmod +x xen/tools/fuzz/oss-fuzz/build.sh\nxen/tools/fuzz/oss-fuzz/build.sh\n"
  },
  {
    "path": "projects/xen/project.yaml",
    "content": "homepage: https://xenproject.org\nlanguage: c\nmain_repo: https://xenbits.xen.org/git-http/xen.git\nauto_ccs:\n  - \"tamas.k.lengyel@gmail.com\"\n  - \"jbeulich@suse.com\"\n  - \"andrew.cooper@cloud.com\"\n  - \"roger.pau@cloud.com\"\n  - \"sstabellini@kernel.org\"\nsanitizers:\n  - address\n  - undefined\nfuzzing_engines:\n  - libfuzzer\n"
  },
  {
    "path": "projects/xerces/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool openjdk-8-jdk\n#RUN git clone --depth 1 https://github.com/apache/xerces2-j.git xerces     # or use other version control\nRUN svn co http://svn.apache.org/repos/asf/xerces/java/trunk xerces\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/xml.dict $SRC/parserFuzzing.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/parserFuzzing_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n\nWORKDIR xerces"
  },
  {
    "path": "projects/xerces/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-8\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-8-openjdk-amd64/\" \"$JAVA_HOME\"\n\nLIBDIR=$SRC/xerces/tools\nANT_HOME=\"$LIBDIR\"\nLOCALCLASSPATH=\"$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/classes.zip\"\nLOCALCLASSPATH=\"$LOCALCLASSPATH:$LIBDIR/ant.jar\"\nLOCALCLASSPATH=\"$LOCALCLASSPATH:$LIBDIR/ant-nodeps.jar\"\nLOCALCLASSPATH=\"$LOCALCLASSPATH:$LIBDIR/ant-launcher.jar\"\nLOCALCLASSPATH=\"$LOCALCLASSPATH:$LIBDIR/ant-junit.jar\"\nLOCALCLASSPATH=\"$LOCALCLASSPATH:$LIBDIR/xml-apis.jar\"\nLOCALCLASSPATH=\"$LOCALCLASSPATH:$LIBDIR/xercesImpl.jar\"\nLOCALCLASSPATH=\"$LOCALCLASSPATH:$LIBDIR/bin/xjavac.jar\"\njava -Dant.home=\"$ANT_HOME\" -classpath \"$LOCALCLASSPATH\" org.apache.tools.ant.Main jars\n\ncp ./build/xercesImpl.jar $OUT/xercesImpl.jar\n\nALL_JARS=\"xercesImpl.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.c\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/xerces/parserFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.xerces.parsers.DOMParser;\nimport org.w3c.dom.Document;\n\npublic class parserFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        String feature = data.consumeString(100);\n        boolean state = data.consumeBoolean();\n        String property = data.consumeString(100);\n        String value = data.consumeString(100);\n\n        if (feature.isEmpty() | property.isEmpty()) {\n            return;\n        }\n\n        String content = data.consumeRemainingAsString();\n\n        try {\n            DOMParser parser = new DOMParser();\n\n            parser.setFeature(feature, state);\n            parser.getFeature(feature);\n\n            parser.setProperty(property, value);\n            String getValue = (String) parser.getProperty(property);\n\n            parser.parse(content);\n\n            Document document = parser.getDocument();\n        }\n        catch(Exception e){}\n    }\n}"
  },
  {
    "path": "projects/xerces/project.yaml",
    "content": "homepage: \"https://xerces.apache.org/index.html\"\nlanguage: jvm\nmain_repo: \"http://svn.apache.org/repos/asf/xerces/java/trunk\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\n"
  },
  {
    "path": "projects/xerces-c/Dockerfile",
    "content": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update -y && \\\n    apt-get install -y make autoconf automake libtool wget zlib1g-dev \\\n    binutils cmake subversion ninja-build liblzma-dev libz-dev pkg-config\nRUN svn co https://svn.apache.org/repos/asf/xerces/c/trunk $SRC/xerces-c\nRUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git\nRUN (mkdir LPM && cd LPM && cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release && ninja)\nCOPY *.c *.options run_tests.sh build.sh *.h *.cc *.cpp *.proto $SRC/\n"
  },
  {
    "path": "projects/xerces-c/build.sh",
    "content": "#!/bin/bash\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n#https://github.com/linux-on-ibm-z/docs/wiki/Building-Xerces\nset -e\ncd $SRC/xerces-c\n./reconf\n./configure --disable-shared\nmake -j\n\ncd $SRC\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -std=c++11 \\\n        -I. -Ixerces-c/src \\\n        xerces_fuzz_common.cpp parse_target.cpp -o $OUT/parse_target \\\n        xerces-c/src/.libs/libxerces-c.a\n\nif [[ $CFLAGS != *sanitize=memory* ]]; then\n\trm -rf genfiles && mkdir genfiles && LPM/external.protobuf/bin/protoc xml.proto --cpp_out=genfiles\n\n\t$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -DNDEBUG -std=c++14 \\\n\t        -I. -I xerces-c/src -Ixerces-c/build/src genfiles/xml.pb.cc xmlProtoConverter.cpp xerces_fuzz_common.cpp parse_target_proto.cpp \\\n\t        -I libprotobuf-mutator/ \\\n\t        -I genfiles \\\n\t        -I LPM/external.protobuf/include \\\n\t        -o $OUT/parse_target_proto xerces-c/src/.libs/libxerces-c.a \\\n\t        LPM/src/libfuzzer/libprotobuf-mutator-libfuzzer.a \\\n\t        LPM/src/libprotobuf-mutator.a \\\n\t        -Wl,--start-group LPM/external.protobuf/lib/lib*.a -Wl,--end-group\nfi\n"
  },
  {
    "path": "projects/xerces-c/parse_target.cpp",
    "content": "/*\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#include \"xerces_fuzz_common.h\"\n\n#include \"xercesc/framework/MemBufInputSource.hpp\"\n#include \"xercesc/parsers/SAXParser.hpp\"\n#include \"xercesc/util/OutOfMemoryException.hpp\"\n\nusing namespace xercesc_3_2;\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {\n    parseInMemory(Data, Size);\n    return 0;\n}\n"
  },
  {
    "path": "projects/xerces-c/parse_target_proto.cpp",
    "content": "/*\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#include \"xerces_fuzz_common.h\"\n#include \"xmlProtoConverter.h\"\n\n#include \"xercesc/framework/MemBufInputSource.hpp\"\n#include \"xercesc/parsers/SAXParser.hpp\"\n#include \"xercesc/util/OutOfMemoryException.hpp\"\n\n#include \"genfiles/xml.pb.h\"\n\n#include \"src/libfuzzer/libfuzzer_macro.h\"\n\n#include <iostream>\n\nnamespace {\n    void ignore(void* ctx, const char* msg, ...) {}\n\n    template <class T, class D>\n    std::unique_ptr<T, D> MakeUnique(T* obj, D del) {\n    return {obj, del};\n    }\n}\n\nusing namespace xercesc_3_2;\n\nDEFINE_PROTO_FUZZER(const xmlProtoFuzzer::XmlDocument& xmlDocument) {\n    std::string xmlData = xmlProtoFuzzer::ProtoConverter().protoToString(xmlDocument);\n    parseInMemory((const uint8_t *)xmlData.c_str(), xmlData.size());\n}\n"
  },
  {
    "path": "projects/xerces-c/project.yaml",
    "content": "homepage: \"https://xerces.apache.org/\"\nmain_repo: 'https://svn.apache.org/repos/asf/xerces/c/trunk'\nlanguage: c++\nprimary_contact: \"vincent.ulitzsch@live.de\"\nauto_ccs:\n  - \"vincent.ulitzsch@live.de\"\n  - \"bshas3@gmail.com\"\ncoverage_extra_args: -ignore-filename-regex=.*/LPM/.*\nsanitizers:\n - address\n - memory\n - undefined\n"
  },
  {
    "path": "projects/xerces-c/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizer and run unit test\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nmake check -C xerces-c\n"
  },
  {
    "path": "projects/xerces-c/xerces_fuzz_common.cpp",
    "content": "/*\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#include \"xerces_fuzz_common.h\"\n\nusing namespace xercesc_3_2;\nstatic bool initialized = false;\n\nvoid parseInMemory(const uint8_t *Data, size_t Size)\n{\n    if (!initialized)\n    {\n        XMLPlatformUtils::Initialize();\n        initialized = true;\n    }\n    SAXParser::ValSchemes valScheme = SAXParser::Val_Auto;\n    bool doNamespaces = false;\n    bool doSchema = false;\n    bool schemaFullChecking = false;\n    SAXParser *parser = new SAXParser;\n    parser->setValidationScheme(valScheme);\n    parser->setDoNamespaces(doNamespaces);\n    parser->setDoSchema(doSchema);\n    parser->setHandleMultipleImports(true);\n    parser->setValidationSchemaFullChecking(schemaFullChecking);\n    static const char *gMemBufId = \"prodInfo\";\n\n    MemBufInputSource *memBufIS = new MemBufInputSource(\n        (const XMLByte *)Data, Size, gMemBufId, false);\n    parser->parse(*memBufIS);\n    delete parser;\n    delete memBufIS;\n    //XMLPlatformUtils::Terminate();\n}\n"
  },
  {
    "path": "projects/xerces-c/xerces_fuzz_common.h",
    "content": "/*\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n#pragma once\n\n#include \"xercesc/parsers/SAXParser.hpp\"\n#include \"xercesc/framework/MemBufInputSource.hpp\"\n#include \"xercesc/util/OutOfMemoryException.hpp\"\n\nvoid parseInMemory(const uint8_t *Data, size_t Size);"
  },
  {
    "path": "projects/xerces-c/xml.proto",
    "content": "/*\n * Copyright (C) 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nsyntax = \"proto3\";\n\nmessage Misc {\n    oneof misc_oneof {\n        string comment = 1;\n        ProcessingInstruction inst = 2;\n    }\n}\n\nmessage PEReference {\n    string name = 1;\n}\n\nmessage ElementDecl {\n    enum ContentSpec {\n        EMPTY = 0;\n        ANY = 1;\n        FUZZ = 2;\n        MIXED = 3;\n        CHILDREN = 4;\n    }\n    string name = 1;\n    ContentSpec spec = 2;\n    repeated string cdata = 3;\n}\n\nmessage AttrType {\n    enum Type {\n        CDATA = 0;\n        ID = 1;\n        IDREF = 2;\n        IDREFS = 3;\n        ENTITY = 4;\n        ENTITIES = 5;\n        NMTOKEN = 6;\n        NMTOKENS = 7;\n    }\n    Type ty = 1;\n}\n\nmessage EnumeratedType {\n    repeated string names = 1;\n}\n\nmessage AttrListDecl {\n    string name = 1;\n    AttrType atype = 2;\n    EnumeratedType etype = 3;\n    DefaultDecl def = 4;\n}\n\nmessage ExternalId {\n    enum Type {\n        SYSTEM = 0;\n        PUBLIC = 1;\n        FUZZ = 2;\n    }\n    Type type = 1;\n    string system = 2;\n    string pub = 3;\n}\n\nmessage AttValue {\n    enum Type {\n        ENTITY = 0;\n        CHAR = 1;\n        FUZZ = 2;\n    }\n    Type type = 1;\n    repeated string value = 2;\n}\n\nmessage DefaultDecl {\n    enum Type {\n        REQUIRED = 0;\n        IMPLIED = 1;\n        FIXED = 2;\n        FUZZ = 3;\n    }\n    Type type = 1;\n    AttValue att = 2;\n}\n\nmessage AttDef {\n    // TODO: Add enumerated type\n    enum Type {\n        CDATA = 0;\n        ID = 1;\n        IDREF = 2;\n        IDREFS = 3;\n        ENTITY = 4;\n        ENTITIES = 5;\n        NMTOKEN = 6;\n        NMTOKENS = 7;\n        FUZZ = 8;\n    }\n    string name = 1;\n    Type type = 2;\n    DefaultDecl def = 3;\n}\n\nmessage AttListDecl {\n    string name = 1;\n    repeated AttDef attdefs = 2;\n}\n\nmessage NotationDecl {\n    string name = 1;\n    oneof notation_oneof {\n        ExternalId ext = 2;\n        string pub = 3;\n        string fuzz = 4;\n    }\n}\n\nmessage EntityValue {\n    enum Type {\n        ENTITY = 0;\n        CHAR = 1;\n        PEREF = 2;\n        FUZZ = 3;\n    }\n    Type type = 1;\n    repeated string name = 2;\n}\n\nmessage NDataDecl {\n    string name = 1;\n}\n\nmessage EntityDef {\n    oneof entity_oneof {\n        ExternalId ext = 1;\n        EntityValue val = 2;\n    }\n    NDataDecl ndata = 3;\n}\n\nmessage PEDef {\n    oneof pedef_oneof {\n        EntityValue val = 1;\n        ExternalId id = 2;\n    }\n}\n\nmessage EntityDecl {\n    enum Type {\n        GEDECL = 0;\n        PEDECL = 1;\n    }\n    Type type = 1;\n    string name = 2;\n    EntityDef ent = 3;\n    PEDef pedef = 4;\n}\n\nmessage ConditionalSect {\n    enum Type {\n        INCLUDE = 0;\n        IGNORE = 1;\n        FUZZ = 2;\n    }\n    Type type = 1;\n    ExtSubsetDecl ext = 2;\n    // TODO: Make this recursive\n    // See https://www.w3.org/TR/xml/#NT-conditionalSect\n    repeated string ignores = 3;\n}\n\nmessage OneExtSubsetDecl {\n    oneof extsubset_oneof {\n        MarkupDecl m = 1;\n        ConditionalSect c = 2;\n    }\n}\n\nmessage ExtSubsetDecl {\n    repeated OneExtSubsetDecl decls = 1;\n}\n\nmessage MarkupDecl {\n    oneof markup_oneof {\n        ElementDecl e = 1;\n        AttListDecl a = 2;\n        NotationDecl n = 3;\n        Misc m = 4;\n        EntityDecl entity = 5;\n        ExtSubsetDecl ext = 6;\n    }\n}\n\nmessage DocTypeDecl {\n    string name = 1;\n    ExternalId ext = 2;\n    repeated MarkupDecl mdecl = 3;\n}\n\nmessage Prolog {\n    XmlDeclaration decl = 1;\n    DocTypeDecl doctype = 2;\n    repeated Misc misc = 3;\n}\n\nmessage KeyValue {\n    enum XmlNamespace {\n        ATTRIBUTES = 0;\n        BASE = 1;\n        CATALOG = 2;\n        ID = 3;\n        LANG = 4;\n        LINK = 5;\n        SPACE = 6;\n        SPECIAL = 7;\n        TEST = 8;\n        FUZZ = 9;\n    }\n    XmlNamespace type = 1;\n    string key = 2;\n    string value = 3;\n}\n\nmessage ProcessingInstruction {\n    string name = 1;\n    repeated KeyValue kv = 2;\n}\n\nmessage CData {\n    string data = 1;\n}\n\nmessage Content {\n    // TODO: Add other content types\n    oneof content_oneof {\n        string str = 1;\n        Element e = 2;\n        CData c = 3;\n    }\n}\n\nmessage Element {\n    enum Type {\n        PREDEFINED = 0;\n        FUZZ = 1;\n    }\n    enum Id {\n        XIINCLUDE = 0;\n        XIFALLBACK = 1;\n        // Attributes of xinclude\n        XIHREF = 2;\n        XIPARSE = 3;\n        XIXPOINTER = 4;\n        XIENCODING = 5;\n        XIACCEPT = 6;\n        XIACCEPTLANG = 7;\n    }\n    Type type = 1;\n    Id id = 2;\n    string name = 3;\n    repeated KeyValue kv = 4;\n    Content content = 5;\n    string childprop = 6;\n}\n\nmessage VersionNum {\n    enum Type {\n        STANDARD = 0;\n        FUZZ = 1;\n    }\n    Type type = 1;\n    uint64 major = 2;\n    uint64 minor = 3;\n}\n\nmessage Encodings {\n    enum Enc {\n        BIG5 = 0;\n        EUCJP = 1;\n        EUCKR = 2;\n        GB18030 = 3;\n        ISO2022JP = 4;\n        ISO2022KR = 5;\n        ISO88591 = 6;\n        ISO88592 = 7;\n        ISO88593 = 8;\n        ISO88594 = 9;\n        ISO88595 = 10;\n        ISO88596 = 11;\n        ISO88597 = 12;\n        ISO88598 = 13;\n        ISO88599 = 14;\n        SHIFTJIS = 15;\n        TIS620 = 16;\n        USASCII = 17;\n        UTF8 = 18;\n        UTF16 = 19;\n        UTF16BE = 20;\n        UTF16LE = 21;\n        WINDOWS31J = 22;\n        WINDOWS1255 = 23;\n        WINDOWS1256 = 24;\n        FUZZ = 25;\n    }\n    Enc name = 1;\n    string fuzz = 2;\n}\n\nmessage XmlDeclaration {\n    VersionNum ver = 1;\n    Encodings enc = 2;\n    enum Standalone {\n        YES = 0;\n        NO = 1;\n    }\n    Standalone standalone = 3;\n    string fuzz = 4;\n}\n\nmessage XmlDocument {\n    Prolog p = 1;\n    repeated Element e = 2;\n}\n\npackage xmlProtoFuzzer;"
  },
  {
    "path": "projects/xerces-c/xmlProtoConverter.cpp",
    "content": "/*\n * Copyright (C) 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"xmlProtoConverter.h\"\n\n#include <algorithm>\n\nusing namespace std;\nusing namespace xmlProtoFuzzer;\n\nstring ProtoConverter::removeNonAscii(string const& _utf8)\n{\n\tstring asciiStr{_utf8};\n\tasciiStr.erase(remove_if(asciiStr.begin(), asciiStr.end(), [=](char c) -> bool {\n                        return !(std::isalpha(c) || std::isdigit(c));\n                }), asciiStr.end());\n\treturn asciiStr.empty() ? \"fuzz\" : asciiStr;\n}\n\n\nvoid ProtoConverter::visit(Misc const& _x)\n{\n\tswitch (_x.misc_oneof_case())\n\t{\n\tcase Misc::kComment:\n\t\tm_output << \"<!--\" << _x.comment() << \"-->\\n\";\n\t\tbreak;\n\tcase Misc::kInst:\n\t\tvisit(_x.inst());\n\t\tbreak;\n\tcase Misc::MISC_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(Prolog const& _x)\n{\n\tvisit(_x.decl());\n\tvisit(_x.doctype());\n\tfor (auto const& misc: _x.misc())\n\t\tvisit(misc);\n}\n\nvoid ProtoConverter::visit(KeyValue const& _x)\n{\n\tif (!KeyValue::XmlNamespace_IsValid(_x.type()))\n\t\treturn;\n\n\tswitch (_x.type())\n\t{\n\tcase KeyValue::ATTRIBUTES:\n\t\tm_output << \"xml:attributes=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::BASE:\n\t\tm_output << \"xml:base=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::CATALOG:\n\t\tm_output << \"xml:catalog=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::ID:\n\t\tm_output << \"xml:id=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::LANG:\n\t\tm_output << \"xml:lang=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::LINK:\n\t\tm_output << \"xml:link=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::SPACE:\n\t\tm_output << \"xml:space=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::SPECIAL:\n\t\tm_output << \"xml:special=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::TEST:\n\t\tm_output << \"xml:test=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue::FUZZ:\n\t\tif (_x.ByteSizeLong() % 2)\n\t\t\tm_output << \"xmlns:\" << removeNonAscii(_x.key()) << \"=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\telse\n\t\t\tm_output << removeNonAscii(_x.key()) << \"=\\\"\" << removeNonAscii(_x.value()) << \"\\\" \";\n\t\tbreak;\n\tcase KeyValue_XmlNamespace_KeyValue_XmlNamespace_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase KeyValue_XmlNamespace_KeyValue_XmlNamespace_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(ProcessingInstruction const& _x)\n{\n\tm_output << \"<?\" << removeNonAscii(_x.name()) << \" \";\n\tfor (auto const& prop: _x.kv())\n\t\tvisit(prop);\n\tm_output << \"?>\\n\";\n}\n\nvoid ProtoConverter::visit(Content const& _x)\n{\n\tswitch (_x.content_oneof_case())\n\t{\n\tcase Content::kStr:\n\t\tm_output << _x.str() << \"\\n\";\n\t\tbreak;\n\tcase Content::kE:\n\t\tvisit(_x.e());\n\t\tm_output << \"\\n\";\n\t\tbreak;\n\tcase Content::kC:\n\t\tvisit(_x.c());\n\t\tm_output << \"\\n\";\n\t\tbreak;\n\tcase Content::CONTENT_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(ElementDecl const& _x)\n{\n\tif (!ElementDecl::ContentSpec_IsValid(_x.spec()))\n\t\treturn;\n\n\tm_output << \"<!ELEMENT \" << _x.name() << \" \";\n\tswitch (_x.spec())\n\t{\n\tcase ElementDecl::EMPTY:\n\t\tm_output << \"EMPTY>\";\n\t\tbreak;\n\tcase ElementDecl::ANY:\n\t\tm_output << \"ANY>\";\n\t\tbreak;\n\tcase ElementDecl::FUZZ:\n\t\tm_output << \"FUZZ>\";\n\t\tbreak;\n\tcase ElementDecl::MIXED:\n\t\tm_output << \"(#PCDATA\";\n\t\tfor (auto const& pcdata: _x.cdata())\n\t\t\tm_output << \"|\" << pcdata;\n\t\tm_output << \")\";\n\t\tif (_x.cdata_size() > 0)\n\t\t\tm_output << \"*\";\n\t\tm_output << \">\";\n\t\tbreak;\n\tcase ElementDecl::CHILDREN:\n\t{\n\t\tm_output << \"(\";\n\t\tstring delim = \"\";\n\t\tfor (auto const& str: _x.cdata()) {\n\t\t\tm_output << delim << removeNonAscii(str);\n\t\t\tdelim = \", \";\n\t\t}\n\t\tm_output << \")>\";\n\t\tbreak;\n\t}\n\tcase ElementDecl_ContentSpec_ElementDecl_ContentSpec_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase ElementDecl_ContentSpec_ElementDecl_ContentSpec_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(AttValue const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tm_output << \"\\\"\";\n\tstring prefix;\n\tswitch (_x.type())\n\t{\n\tcase AttValue::ENTITY:\n\t\tprefix = \"&\";\n\t\tbreak;\n\tcase AttValue::CHAR:\n\t\tif (_x.ByteSizeLong() % 2)\n\t\t\tprefix = \"&#\";\n\t\telse\n\t\t\t// TODO: Value that follows this must be a\n\t\t\t// sequence of hex digits.\n\t\t\tprefix = \"&#x\";\n\t\tbreak;\n\tcase AttValue::FUZZ:\n\t\tprefix = \"fuzz\";\n\t\tbreak;\n\tcase AttValue_Type_AttValue_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase AttValue_Type_AttValue_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n\tfor (auto const& name: _x.value())\n\t\tm_output << prefix << removeNonAscii(name) << \";\";\n\tm_output << \"\\\"\";\n}\n\nvoid ProtoConverter::visit(DefaultDecl const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tswitch (_x.type())\n\t{\n\tcase DefaultDecl::REQUIRED:\n\t\tm_output << \"#REQUIRED\";\n\t\tbreak;\n\tcase DefaultDecl::IMPLIED:\n\t\tm_output << \"#IMPLIED\";\n\t\tbreak;\n\tcase DefaultDecl::FIXED:\n\t\tm_output << \"#FIXED \";\n\t\tvisit(_x.att());\n\t\tbreak;\n\tcase DefaultDecl::FUZZ:\n\t\tm_output << \"#FUZZ\";\n\t\tbreak;\n\tcase DefaultDecl_Type_DefaultDecl_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase DefaultDecl_Type_DefaultDecl_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(AttDef const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tm_output << \" \" << removeNonAscii(_x.name()) << \" \";\n\tswitch (_x.type())\n\t{\n\tcase AttDef::CDATA:\n\t\tm_output << \"CDATA \";\n\t\tbreak;\n\tcase AttDef::ID:\n\t\tm_output << \"ID \";\n\t\tbreak;\n\tcase AttDef::IDREF:\n\t\tm_output << \"IDREF \";\n\t\tbreak;\n\tcase AttDef::IDREFS:\n\t\tm_output << \"IDREFS \";\n\t\tbreak;\n\tcase AttDef::ENTITY:\n\t\tm_output << \"ENTITY \";\n\t\tbreak;\n\tcase AttDef::ENTITIES:\n\t\tm_output << \"ENTITIES \";\n\t\tbreak;\n\tcase AttDef::NMTOKEN:\n\t\tm_output << \"NMTOKEN \";\n\t\tbreak;\n\tcase AttDef::NMTOKENS:\n\t\tm_output << \"NMTOKENS \";\n\t\tbreak;\n\tcase AttDef::FUZZ:\n\t\tm_output << \"FUZZ \";\n\t\tbreak;\n\tcase AttDef_Type_AttDef_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase AttDef_Type_AttDef_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n\tvisit(_x.def());\n}\n\nvoid ProtoConverter::visit(AttListDecl const& _x)\n{\n\tm_output << \"<!ATTLIST \" << removeNonAscii(_x.name());\n\tfor (auto const& att: _x.attdefs())\n\t\tvisit(att);\n\tm_output << \">\";\n}\n\nvoid ProtoConverter::visit(NotationDecl const& _x)\n{\n\tm_output << \"<!NOTATION \" << removeNonAscii(_x.name()) << \" \";\n\tswitch (_x.notation_oneof_case())\n\t{\n\tcase NotationDecl::kExt:\n\t\tvisit(_x.ext());\n\t\tbreak;\n\tcase NotationDecl::kPub:\n\t\tm_output << \"PUBLIC \" << _x.pub();\n\t\tbreak;\n\tcase NotationDecl::kFuzz:\n\t\tm_output << \"FUZZ \" << _x.fuzz();\n\t\tbreak;\n\tcase NotationDecl::NOTATION_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n\tm_output << \">\";\n}\n\nvoid ProtoConverter::visit(NDataDecl const& _x)\n{\n\tm_output << \" NDATA \" << _x.name();\n}\n\nvoid ProtoConverter::visit(EntityDef const& _x)\n{\n\tswitch (_x.entity_oneof_case())\n\t{\n\tcase EntityDef::kExt:\n\t\tvisit(_x.ext());\n\t\tif (_x.ByteSizeLong() % 2)\n\t\t\tvisit(_x.ndata());\n\t\tbreak;\n\tcase EntityDef::kVal:\n\t\tvisit(_x.val());\n\t\tbreak;\n\tcase EntityDef::ENTITY_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(PEDef const& _x)\n{\n\tswitch (_x.pedef_oneof_case())\n\t{\n\tcase PEDef::kVal:\n\t\tvisit(_x.val());\n\t\tbreak;\n\tcase PEDef::kId:\n\t\tvisit(_x.id());\n\t\tbreak;\n\tcase PEDef::PEDEF_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(EntityValue const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tm_output << \"\\\"\";\n\tstring prefix;\n\tswitch (_x.type())\n\t{\n\tcase EntityValue::ENTITY:\n\t\tprefix = \"&\";\n\t\tbreak;\n\tcase EntityValue::CHAR:\n\t\tif (_x.ByteSizeLong() % 2)\n\t\t\tprefix = \"&#\";\n\t\telse\n\t\t\tprefix = \"&#x\";\n\t\tbreak;\n\tcase EntityValue::PEREF:\n\t\tprefix = \"%\";\n\t\tbreak;\n\tcase EntityValue::FUZZ:\n\t\tprefix = \"fuzz\";\n\t\tbreak;\n\tcase EntityValue_Type_EntityValue_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase EntityValue_Type_EntityValue_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n\tfor (auto const& ref: _x.name())\n\t\tm_output << prefix << ref << \";\";\n\tm_output << \"\\\"\";\n}\n\nvoid ProtoConverter::visit(EntityDecl const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tm_output << \"<!ENTITY \";\n\tswitch (_x.type())\n\t{\n\tcase EntityDecl::GEDECL:\n\t\tm_output << _x.name() << \" \";\n\t\tvisit(_x.ent());\n\t\tbreak;\n\tcase EntityDecl::PEDECL:\n\t\tm_output << \"% \" << _x.name() << \" \";\n\t\tvisit(_x.pedef());\n\t\tbreak;\n\tcase EntityDecl_Type_EntityDecl_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase EntityDecl_Type_EntityDecl_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n\tm_output << \">\";\n}\n\nvoid ProtoConverter::visit(ConditionalSect const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tswitch (_x.type())\n\t{\n\tcase ConditionalSect::INCLUDE:\n\t\tm_output << \"<![ INCLUDE [\";\n\t\tvisit(_x.ext());\n\t\tm_output << \"]]>\";\n\t\tbreak;\n\tcase ConditionalSect::IGNORE:\n\t\tm_output << \"<![ IGNORE [\";\n\t\tfor (auto const& str: _x.ignores())\n\t\t\tm_output << \"<![\" << removeNonAscii(str) << \"]]>\";\n\t\tm_output << \"]]>\";\n\t\tbreak;\n\tcase ConditionalSect::FUZZ:\n\t\tm_output << \"<![ FUZZ [\";\n\t\tvisit(_x.ext());\n\t\tm_output << \"]]>\";\n\t\tbreak;\n\tcase ConditionalSect_Type_ConditionalSect_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase ConditionalSect_Type_ConditionalSect_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n}\n\n\nvoid ProtoConverter::visit(OneExtSubsetDecl const& _x)\n{\n\tswitch (_x.extsubset_oneof_case())\n\t{\n\tcase OneExtSubsetDecl::kM:\n\t\tvisit(_x.m());\n\t\tbreak;\n\tcase OneExtSubsetDecl::kC:\n\t\tvisit(_x.c());\n\t\tbreak;\n\tcase OneExtSubsetDecl::EXTSUBSET_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n}\n\n\nvoid ProtoConverter::visit(ExtSubsetDecl const& _x)\n{\n\tfor (auto const& decl: _x.decls())\n\t\tvisit(decl);\n}\n\nvoid ProtoConverter::visit(CData const& _x)\n{\n\tm_output << \"<![CDATA[\" << removeNonAscii(_x.data()) << \"]]>\";\n}\n\nvoid ProtoConverter::visit(MarkupDecl const& _x)\n{\n\tswitch (_x.markup_oneof_case())\n\t{\n\tcase MarkupDecl::kE:\n\t\tvisit(_x.e());\n\t\tbreak;\n\tcase MarkupDecl::kA:\n\t\tvisit(_x.a());\n\t\tbreak;\n\tcase MarkupDecl::kN:\n\t\tvisit(_x.n());\n\t\tbreak;\n\tcase MarkupDecl::kM:\n\t\tvisit(_x.m());\n\t\tbreak;\n\tcase MarkupDecl::kEntity:\n\t\tvisit(_x.entity());\n\t\tbreak;\n\tcase MarkupDecl::kExt:\n\t\tvisit(_x.ext());\n\t\tbreak;\n\tcase MarkupDecl::MARKUP_ONEOF_NOT_SET:\n\t\tbreak;\n\t}\n}\n\n/// Returns predefined element from an Element_Id enum\n/// @param _x is an enum that holds the desired type of predefined value\n/// @param _prop is a string that holds the value of the desired type\n/// @return string holding the predefined value of the form\n/// name attribute=\\\"value\\\"\nstring ProtoConverter::getPredefined(Element_Id _x, string const& _prop)\n{\n\tstring output{};\n\tswitch (_x)\n\t{\n\tcase Element::XIINCLUDE:\n\tcase Element::XIFALLBACK:\n\tcase Element::XIHREF:\n\t\toutput = \"xi:include href=\\\"fuzz.xml\\\"\";\n\tcase Element::XIPARSE:\n\t\toutput = \"xi:include parse=\\\"xml\\\"\";\n\tcase Element::XIXPOINTER:\n\t\toutput = \"xi:include xpointer=\\\"\" + removeNonAscii(_prop) + \"\\\"\";\n\tcase Element::XIENCODING:\n\t\toutput = \"xi:include encoding=\\\"\" + removeNonAscii(_prop) + \"\\\"\";\n\tcase Element::XIACCEPT:\n\t\toutput = \"xi:include accept=\\\"\" + removeNonAscii(_prop) + \"\\\"\";\n\tcase Element::XIACCEPTLANG:\n\t\toutput = \"xi:include accept-language=\\\"\" + removeNonAscii(_prop) + \"\\\"\";\n\tcase Element_Id_Element_Id_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase Element_Id_Element_Id_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\toutput = \"xi:fuzz xifuzz=\\\"fuzz\\\"\";\n\t}\n\treturn output;\n}\n\n/// Returns uri string for a given Element_Id type\nstring ProtoConverter::getUri(Element_Id _x)\n{\n\tif (!Element::Id_IsValid(_x))\n\t\treturn s_XInclude;\n\n\tswitch (_x)\n\t{\n\tcase Element::XIINCLUDE:\n\tcase Element::XIFALLBACK:\n\tcase Element::XIHREF:\n\tcase Element::XIPARSE:\n\tcase Element::XIXPOINTER:\n\tcase Element::XIENCODING:\n\tcase Element::XIACCEPT:\n\tcase Element::XIACCEPTLANG:\n\tcase Element_Id_Element_Id_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase Element_Id_Element_Id_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\treturn s_XInclude;\n\t}\n}\n\nvoid ProtoConverter::visit(Element const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\t// Predefined child node\n\tstring child = {};\n\t// Predefined uri for child node\n\tstring pUri = {};\n\t// Element name\n\tstring name = removeNonAscii(_x.name());\n\n\tswitch (_x.type())\n\t{\n\tcase Element::PREDEFINED:\n\t\tchild = getPredefined(_x.id(), _x.childprop());\n\t\tpUri = getUri(_x.id());\n\t\tbreak;\n\tcase Element::FUZZ:\n\tcase Element_Type_Element_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase Element_Type_Element_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n\n\t// <name k1=v1 k2=v2 k3=v3>\n\t// <content>\n\t// </name>\n\n\t// Start name tag: Must be Ascii?\n\tm_output << \"<\" << name << \" \";\n\n\t// Add uri to name tag\n\tif (!pUri.empty())\n\t\tm_output << pUri << \" \";\n\tfor (auto const& prop: _x.kv())\n\t\tvisit(prop);\n\tm_output << \">\\n\";\n\n\t// Add attribute\n\tif (!child.empty())\n\t\tm_output << \"<\" << child << \"/>\\n\";\n\n\t// Add content\n\tvisit(_x.content());\n\n\t// Close name tag\n\tm_output << \"</\" << name << \">\\n\";\n}\n\nvoid ProtoConverter::visit(ExternalId const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tswitch (_x.type())\n\t{\n\tcase ExternalId::SYSTEM:\n\t\tm_output << \"SYSTEM \" << \"\\\"\" << removeNonAscii(_x.system()) << \"\\\"\";\n\t\tbreak;\n\tcase ExternalId::PUBLIC:\n\t\tm_output << \"PUBLIC \" << \"\\\"\" << removeNonAscii(_x.pub()) << \"\\\"\"\n\t\t\t<< \" \" << \"\\\"\" << removeNonAscii(_x.system()) << \"\\\"\";\n\t\tbreak;\n\tcase ExternalId::FUZZ:\n\t\tm_output << \"FUZZ \" << \"\\\"\" << removeNonAscii(_x.pub()) << \"\\\"\";\n\t\tbreak;\n\tcase ExternalId_Type_ExternalId_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase ExternalId_Type_ExternalId_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(DocTypeDecl const& _x)\n{\n\tm_output << \"<!DOCTYPE \" << removeNonAscii(_x.name()) << \" \";\n\tvisit(_x.ext());\n\tm_output << \"[\";\n\tfor (auto const& m: _x.mdecl())\n\t\tvisit(m);\n\tm_output << \"]\";\n\tm_output << \">\\n\";\n}\n\nvoid ProtoConverter::visit(VersionNum const& _x)\n{\n\tif (!isValid(_x))\n\t\treturn;\n\n\tswitch (_x.type())\n\t{\n\tcase VersionNum::STANDARD:\n\t\tm_output << \"\\\"1.0\\\"\";\n\t\tbreak;\n\tcase VersionNum::FUZZ:\n\tcase VersionNum_Type_VersionNum_Type_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase VersionNum_Type_VersionNum_Type_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tm_output << \"\\\"\" << _x.major() << \".\" << _x.minor() << \"\\\"\";\n\t\tbreak;\n\t}\n}\n\nvoid ProtoConverter::visit(Encodings const& _x)\n{\n\tif (!Encodings::Enc_IsValid(_x.name()))\n\t\treturn;\n\n\tm_output << \" encoding=\\\"\";\n\tswitch (_x.name())\n\t{\n\tcase Encodings::BIG5:\n\t\tm_output << \"BIG5\";\n\t\tbreak;\n\tcase Encodings::EUCJP:\n\t\tm_output << \"EUC-JP\";\n\t\tbreak;\n\tcase Encodings::EUCKR:\n\t\tm_output << \"EUC-KR\";\n\t\tbreak;\n\tcase Encodings::GB18030:\n\t\tm_output << \"GB18030\";\n\t\tbreak;\n\tcase Encodings::ISO2022JP:\n\t\tm_output << \"ISO-2022-JP\";\n\t\tbreak;\n\tcase Encodings::ISO2022KR:\n\t\tm_output << \"ISO-2022-KR\";\n\t\tbreak;\n\tcase Encodings::ISO88591:\n\t\tm_output << \"ISO-8859-1\";\n\t\tbreak;\n\tcase Encodings::ISO88592:\n\t\tm_output << \"ISO-8859-2\";\n\t\tbreak;\n\tcase Encodings::ISO88593:\n\t\tm_output << \"ISO-8859-3\";\n\t\tbreak;\n\tcase Encodings::ISO88594:\n\t\tm_output << \"ISO-8859-4\";\n\t\tbreak;\n\tcase Encodings::ISO88595:\n\t\tm_output << \"ISO-8859-5\";\n\t\tbreak;\n\tcase Encodings::ISO88596:\n\t\tm_output << \"ISO-8859-6\";\n\t\tbreak;\n\tcase Encodings::ISO88597:\n\t\tm_output << \"ISO-8859-7\";\n\t\tbreak;\n\tcase Encodings::ISO88598:\n\t\tm_output << \"ISO-8859-8\";\n\t\tbreak;\n\tcase Encodings::ISO88599:\n\t\tm_output << \"ISO-8859-9\";\n\t\tbreak;\n\tcase Encodings::SHIFTJIS:\n\t\tm_output << \"SHIFT_JIS\";\n\t\tbreak;\n\tcase Encodings::TIS620:\n\t\tm_output << \"TIS-620\";\n\t\tbreak;\n\tcase Encodings::USASCII:\n\t\tm_output << \"US-ASCII\";\n\t\tbreak;\n\tcase Encodings::UTF8:\n\t\tm_output << \"UTF-8\";\n\t\tbreak;\n\tcase Encodings::UTF16:\n\t\tm_output << \"UTF-16\";\n\t\tbreak;\n\tcase Encodings::UTF16BE:\n\t\tm_output << \"UTF-16BE\";\n\t\tbreak;\n\tcase Encodings::UTF16LE:\n\t\tm_output << \"UTF-16LE\";\n\t\tbreak;\n\tcase Encodings::WINDOWS31J:\n\t\tm_output << \"WINDOWS-31J\";\n\t\tbreak;\n\tcase Encodings::WINDOWS1255:\n\t\tm_output << \"WINDOWS-1255\";\n\t\tbreak;\n\tcase Encodings::WINDOWS1256:\n\t\tm_output << \"WINDOWS-1256\";\n\t\tbreak;\n\tcase Encodings::FUZZ:\n\t\tm_output << removeNonAscii(_x.fuzz());\n\t\tbreak;\n\tcase Encodings_Enc_Encodings_Enc_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase Encodings_Enc_Encodings_Enc_INT_MAX_SENTINEL_DO_NOT_USE_:\n\t\tbreak;\n\t}\n\tm_output << \"\\\"\";\n}\n\nvoid ProtoConverter::visit(XmlDeclaration const& _x)\n{\n\tm_output << R\"(<?xml version=)\";\n\tvisit(_x.ver());\n\tvisit(_x.enc());\n\tswitch (_x.standalone())\n\t{\n\tcase XmlDeclaration::YES:\n\t\tm_output << \" standalone=\\'yes\\'\";\n\t\tbreak;\n\tcase XmlDeclaration::NO:\n\t\tm_output << \" standalone=\\'no\\'\";\n\t\tbreak;\n\tcase XmlDeclaration_Standalone_XmlDeclaration_Standalone_INT_MIN_SENTINEL_DO_NOT_USE_:\n\tcase XmlDeclaration_Standalone_XmlDeclaration_Standalone_INT_MAX_SENTINEL_DO_NOT_USE_:\n\tdefault:\n\t\tbreak;\n\t}\n\tm_output << \"?>\\n\";\n}\n\nvoid ProtoConverter::visit(XmlDocument const& _x)\n{\n\tvisit(_x.p());\n\tfor (auto const& element: _x.e())\n\t\tvisit(element);\n}\n\nstring ProtoConverter::protoToString(XmlDocument const& _x)\n{\n\tvisit(_x);\n\treturn m_output.str();\n}\n"
  },
  {
    "path": "projects/xerces-c/xmlProtoConverter.h",
    "content": "/*\n * Copyright (C) 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <sstream>\n\n#include \"xml.pb.h\"\n\nnamespace xmlProtoFuzzer {\nclass ProtoConverter\n{\npublic:\n\tProtoConverter() = default;\n\n\tProtoConverter(ProtoConverter const&) = delete;\n\n\tProtoConverter(ProtoConverter&&) = delete;\n\n\tstd::string protoToString(XmlDocument const&);\n\nprivate:\n\tvoid visit(Prolog const&);\n\n\tvoid visit(ProcessingInstruction const&);\n\n\tvoid visit(ExternalId const&);\n\n\tvoid visit(DocTypeDecl const&);\n\n\tvoid visit(VersionNum const&);\n\n\tvoid visit(Encodings const&);\n\n\tvoid visit(Misc const&);\n\n\tvoid visit(KeyValue const&);\n\n\tvoid visit(Element const&);\n\n\tvoid visit(ElementDecl const&);\n\n\tvoid visit(AttValue const&);\n\n\tvoid visit(DefaultDecl const&);\n\n\tvoid visit(AttDef const&);\n\n\tvoid visit(AttListDecl const&);\n\n\tvoid visit(NotationDecl const&);\n\n\tvoid visit(EntityDecl const&);\n\n\tvoid visit(EntityValue const&);\n\n\tvoid visit(EntityDef const&);\n\n\tvoid visit(PEDef const&);\n\n\tvoid visit(NDataDecl const&);\n\n\tvoid visit(ConditionalSect const&);\n\n\tvoid visit(OneExtSubsetDecl const&);\n\n\tvoid visit(ExtSubsetDecl const&);\n\n\tvoid visit(MarkupDecl const&);\n\n\tvoid visit(CData const&);\n\n\tvoid visit(Content const&);\n\n\tvoid visit(XmlDeclaration const&);\n\n\tvoid visit(XmlDocument const&);\n\n\ttemplate <typename T>\n\tbool isValid(T const& messageType) {\n\t\treturn T::Type_IsValid(messageType.type());\n\t}\n\n\tstd::string removeNonAscii(std::string const&);\n\tstd::string getUri(Element_Id _x);\n\tstd::string getPredefined(Element_Id _x, std::string const&);\n\n\tstd::ostringstream m_output;\n\n\tstatic constexpr auto s_XInclude = \"xmlns:xi=\\\"http://www.w3.org/2001/XInclude\\\"\";\n};\n}\n\n"
  },
  {
    "path": "projects/xlrd/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/python-excel/xlrd\nCOPY build.sh *.py $SRC/\nWORKDIR xlrd\n"
  },
  {
    "path": "projects/xlrd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/xlrd/fuzz_open_workbook.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport atheris\nimport sys\n\nwith atheris.instrument_imports():\n  import xlrd\n  import zipfile\n\n\ndef TestOneInput(data):\n  temp_file = \"myfile.xls\"\n  with open(temp_file, \"wb\") as fd:\n    fd.write(data)\n\n  try:\n    xlrd.open_workbook(\"myfile.xls\")\n  except (\n    xlrd.XLRDError,\n    xlrd.compdoc.CompDocError,\n    zipfile.BadZipFile,\n    OSError\n  ) as e:\n    pass\n\n\ndef main():\n  atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/xlrd/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/python-excel/xlrd\nlanguage: python\nmain_repo: https://github.com/python-excel/xlrd\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n- arthur.chan@adalogics.com\n"
  },
  {
    "path": "projects/xlsxwriter/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN pip3 install --upgrade pip\nRUN git clone --depth 1 https://github.com/jmcnamara/XlsxWriter.git XlsxWriter \\\n        && cp XlsxWriter/dev/fuzzing/build.sh $SRC/\nRUN cp -r XlsxWriter/dev/fuzzing/corpus $SRC/corpus\nWORKDIR $SRC/XlsxWriter\n\n"
  },
  {
    "path": "projects/xlsxwriter/project.yaml",
    "content": "homepage: \"https://xlsxwriter.readthedocs.io/\"\nlanguage: python\nprimary_contact: \"jmcnamara@cpan.org\"\nauto_ccs: \n  - \"ennamarie19@gmail.com\"\nfuzzing_engines: \n  - libfuzzer\nsanitizers: \n  - address\n  - undefined\nmain_repo: \"https://github.com/jmcnamara/XlsxWriter.git\"\n"
  },
  {
    "path": "projects/xmlbeans/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/apache/xmlbeans xmlbeans     # or use other version control\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n\nWORKDIR xmlbeans"
  },
  {
    "path": "projects/xmlbeans/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n\nCURRENT_VERSION=$(sed -nr \"s/^XMLBeansVersion=(.*)/\\1/p\" gradle.properties)\nLOG4J_VERSION=$(sed -nr \"s/^    log4jVersion = '(.*)'/\\1/p\" build.gradle)\n\nGRADLE_ARGS=\"-x test -x javadoc\"\n./gradlew buildDependents -x test -x javadoc\ncp ./build/libs/xmlbeans-$CURRENT_VERSION.jar $OUT/xmlbeans.jar\ncp ./build/libs/log4j-api-$LOG4J_VERSION.jar $OUT/log4j.jar\n\nALL_JARS=\"xmlbeans.jar log4j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.c\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--disabled_hooks=\\\"com.code_intelligence.jazzer.sanitizers.RegexInjection\\\"\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/xmlbeans/project.yaml",
    "content": "homepage: \"https://xmlbeans.apache.org/\"\nlanguage: jvm\nmain_repo: \"https://github.com/apache/xmlbeans\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n  - \"jacek.trossen@code-intelligence.com\"\nrun_tests: False"
  },
  {
    "path": "projects/xmlbeans/regExFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.apache.xmlbeans.impl.regex.RegularExpression;\n\npublic class regExFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n        String regExStr = data.consumeString(100);\n        String parse = data.consumeRemainingAsString();\n\n        try {\n            RegularExpression regex = new RegularExpression(regExStr);\n            regex.matches(parse);\n        }\n        catch(Exception e){}\n    }\n}"
  },
  {
    "path": "projects/xmldom/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-javascript\nRUN git clone --depth 1 --no-tags https://github.com/xmldom/xmldom.git xmldom     # or use other version control\nWORKDIR xmldom\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/xmldom/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# install dependencies\nnpm ci\n# no longer part of xmldom devDependencies since it can no longer be installed reliably\nnpm i -D @jazzer.js/core\n\n# prepare corpus\nXMLTEST_CORPUS=$OUT/xmldom/xmltest\nmkdir -p $XMLTEST_CORPUS\n# extract all *.xml files without a folder structure,\n# renaming duplicate filenames with ~, ~1, ~2, ...\n# into the target directory\nunzip -Bj node_modules/xmltest/xmltest.zip '*.xml' -d $XMLTEST_CORPUS\n\n# build fuzzers\ncompile_javascript_fuzzer xmldom fuzz/dom-parser.xml.target.js --sync --timeout=10 $XMLTEST_CORPUS\ncompile_javascript_fuzzer xmldom fuzz/dom-parser.html.target.js --sync --timeout=10 $XMLTEST_CORPUS\n"
  },
  {
    "path": "projects/xmldom/project.yaml",
    "content": "homepage: \"https://github.com/xmldom/xmldom\"\nlanguage: javascript\nprimary_contact: \"coder@karfau.de\"\nmain_repo: 'https://github.com/xmldom/xmldom.git'\nfile_github_issue: true\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - none\n"
  },
  {
    "path": "projects/xmlpull/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\nunzip maven.zip -d $SRC/maven && \\\nrm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/xmlpull-org/xmlpull-api-v1 xmlpull\n\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/xmlpull"
  },
  {
    "path": "projects/xmlpull/PullParserFactoryFuzzer.java",
    "content": "import com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport org.xmlpull.v1.XmlPullParserFactory;\nimport org.xmlpull.v1.XmlPullParser;\nimport org.xmlpull.v1.XmlPullParserException;\nimport org.xmlpull.v1.XmlSerializer;\n\nimport java.io.IOException;\nimport java.io.StringReader;\n\npublic class PullParserFactoryFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        try {\n            XmlPullParserFactory factory = XmlPullParserFactory.newInstance(\n                data.consumeString(100),\n                null\n            );\n            factory.setFeature(data.consumeString(30), data.consumeBoolean());\n            factory.getFeature(data.consumeString(30));\n            factory.setNamespaceAware(data.consumeBoolean());\n            XmlPullParser xpp = factory.newPullParser();\n        } catch (XmlPullParserException e) { }\n\t}\n}\n"
  },
  {
    "path": "projects/xmlpull/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncat > patch.diff <<- EOM\n--- pom2.xml\t2022-04-26 14:46:24.060195186 +0200\n+++ pom.xml\t2022-04-26 14:47:28.479389378 +0200\n@@ -30,6 +30,8 @@\n\n  <properties>\n   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n+  <maven.compiler.source>1.8</maven.compiler.source>\n+  <maven.compiler.target>1.8</maven.compiler.target>\n  </properties>\n\n  <dependencies>\n@@ -61,6 +63,9 @@\n     <groupId>org.apache.maven.plugins</groupId>\n     <artifactId>maven-javadoc-plugin</artifactId>\n     <version>2.9.1</version>\n+    <configuration>\n+     <sourcepath>src/main/java/api/org/xmlpull/v1/*</sourcepath>\n+    </configuration>\n     <executions>\n      <execution>\n       <id>attach-javadocs</id>\n\nEOM\ngit apply patch.diff\n\n\n# Use standard apache structure\nmkdir src/main\nmv src/java src/main/\nrm -r src/main/java/tests\n\nMAVEN_ARGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\n$MVN package $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/xmlpull-$CURRENT_VERSION.jar\" \"$OUT/xmlpull.jar\"\n\nALL_JARS=\"xmlpull.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/xmlpull/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/xmlpull-org/xmlpull-api-v1\nlanguage: jvm\nmain_repo: https://github.com/xmlpull-org/xmlpull-api-v1.git\nsanitizers:\n- address\nvendor_ccs:\n- patrice.salathe@code-intelligence.com\n- yakdan@code-intelligence.com\n- patrice.salathe@code-intelligence.com\n"
  },
  {
    "path": "projects/xmlsec/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config \\\n    libssl-dev wget liblzma-dev python3-dev\n# Build requires automake 1.16.3\nRUN curl -LO http://mirrors.kernel.org/ubuntu/pool/main/a/automake-1.16/automake_1.16.5-1.3_all.deb && \\\n    apt install ./automake_1.16.5-1.3_all.deb    \nRUN git clone --depth 1 https://github.com/lsh123/xmlsec\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git\nRUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxslt.git\nCOPY run_tests.sh build.sh *.diff $SRC/\n"
  },
  {
    "path": "projects/xmlsec/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build dependencies.\nexport XMLSEC_DEPS_PATH=$SRC/xmlsec_deps\nmkdir -p $XMLSEC_DEPS_PATH\n\ncd $SRC/libxml2\n./autogen.sh \\\n    --without-legacy \\\n    --without-python \\\n    --without-zlib \\\n    --without-lzma \\\n    --enable-static \\\n    --prefix=\"$XMLSEC_DEPS_PATH\"\nmake -j$(nproc) all\nmake install\n\ncd $SRC/libxslt\ncd ../libxslt\n./autogen.sh \\\n    --with-libxml-src=../libxml2 \\\n    --without-python \\\n    --without-debug \\\n    --without-debugger \\\n    --without-profiler \\\n    --enable-static \\\n    --prefix=\"$XMLSEC_DEPS_PATH\"\n\nmake -j$(nproc)\nmake install\n\ncd $SRC/xmlsec\nsed -i 's/-pedantic-errors//g' configure.ac\nsed -i 's/-pedantic//g' configure.ac\nautoreconf -vfi\n./configure \\\n  --enable-static-linking \\\n  --enable-development \\\n  --with-libxml=\"$XMLSEC_DEPS_PATH\" \\\n  --with-libxslt=\"$XMLSEC_DEPS_PATH\"\nmake -j$(nproc) clean\nmake -j$(nproc) all V=1\n\nfor file in $SRC/xmlsec/tests/oss-fuzz/*_target.c; do\n    b=$(basename $file _target.c)\n    echo -e \"#include <stdint.h>\\n$(cat $file)\" > $file\n    $CC $CFLAGS -c $file -I${XMLSEC_DEPS_PATH=}/include/libxml2 -I${XMLSEC_DEPS_PATH=}/include/ -I ./include/ \\\n    -o $OUT/${b}_target.o\n    $CXX $CXXFLAGS $OUT/${b}_target.o ./src/.libs/libxmlsec1.a \\\n    ./src/openssl/.libs/libxmlsec1-openssl.a $LIB_FUZZING_ENGINE \\\n    \"$XMLSEC_DEPS_PATH\"/lib/libxslt.a \"$XMLSEC_DEPS_PATH\"/lib/libxml2.a \\\n    -lz -llzma -o $OUT/${b}_fuzzer\ndone\ncp $SRC/xmlsec/tests/oss-fuzz/config/*.options $OUT/\nwget -O $OUT/xml.dict https://raw.githubusercontent.com/mirrorer/afl/master/dictionaries/xml.dict\n"
  },
  {
    "path": "projects/xmlsec/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.aleksey.com/xmlsec/\"\nlanguage: c++\nprimary_contact: \"aleksey@aleksey.com\"\nauto_ccs:\n  - \"alekseysanin@gmail.com\"\nsanitizers:\n  - address\n  - undefined\nmain_repo: 'https://github.com/lsh123/xmlsec'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/xmlsec/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Disable leak sanitizers and run unit test\nexport ASAN_OPTIONS=\"detect_leaks=0\"\nmake check -C xmlsec\n"
  },
  {
    "path": "projects/xmltodict/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\n\nRUN git clone --depth 1 --branch master \\\n        https://github.com/martinblech/xmltodict.git\n\nWORKDIR xmltodict\nCOPY build.sh unparse_parse_fuzzer.py $SRC/\n"
  },
  {
    "path": "projects/xmltodict/build.sh",
    "content": "#!/bin/bash\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\npip3 install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers into $OUT. These could be detected in other ways.\nfor fuzzer in $(find $SRC -name '*_fuzzer.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/xmltodict/project.yaml",
    "content": "auto_ccs:\n- david@adalogics.com\nfuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/martinblech/xmltodict\nlanguage: python\nmain_repo: https://github.com/martinblech/xmltodict.git\nprimary_contact: cneo@google.com\nsanitizers:\n- address\n- undefined\n"
  },
  {
    "path": "projects/xmltodict/unparse_parse_fuzzer.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Test dict to xml and back with fuzzing..\"\"\"\nfrom typing import Dict, Any, Text, List, Callable\n\nimport atheris\nimport logging\nimport sys\n\nfrom collections import OrderedDict\nfrom xmltodict import parse, unparse\nfrom xml.parsers.expat import ExpatError\n\n_MAX_LENGTH = 1000\n_MAX_DEPTH = 500\n\n\ndef _gen_dict(fdp: atheris.FuzzedDataProvider, depth: int):\n    \"\"\"Returns a random dict for fuzzing.\"\"\"\n    length = fdp.ConsumeIntInRange(0, _MAX_LENGTH)\n    d = OrderedDict()\n    for _ in range(length):\n        key_length = fdp.ConsumeIntInRange(0, _MAX_LENGTH)\n        key = fdp.ConsumeString(key_length)\n        d[key] = _gen_value(fdp, depth + 1)\n    return d\n\n\ndef _gen_string(fdp: atheris.FuzzedDataProvider):\n    \"\"\"Returns a random string for fuzzing.\"\"\"\n    length = fdp.ConsumeIntInRange(0, _MAX_LENGTH)\n    return fdp.ConsumeString(length)\n\n\ndef _gen_list(fdp: atheris.FuzzedDataProvider, depth: int):\n    \"\"\"Returns a random list for fuzzing.\"\"\"\n    length = fdp.ConsumeIntInRange(0, _MAX_LENGTH)\n    return [_gen_value(fdp, depth + 1) for _ in range(length)]\n\n\ndef _gen_value(fdp: atheris.FuzzedDataProvider, depth: int) -> Any:\n    \"\"\"Returns a random value for fuzzing.\"\"\"\n    consume_next = [\n        fdp.ConsumeBool,\n        fdp.ConsumeFloat,\n        lambda: fdp.ConsumeInt(4),\n        lambda: _gen_string(fdp),\n        lambda: None,\n    ]\n    # XML documents can have exactly 1 root so don't add lists when\n    # depth is exactly 0.\n    if 0 < depth < _MAX_DEPTH:\n        consume_next.append(lambda: _gen_list(fdp, depth))\n\n    if depth < _MAX_DEPTH:\n        consume_next.append(lambda: _gen_dict(fdp, depth))\n    return fdp.PickValueInList(consume_next)()\n\n\n@atheris.instrument_func\ndef test_one_input(data: bytes):\n    fdp = atheris.FuzzedDataProvider(data)\n    original = OrderedDict()\n    try:\n        original[_gen_string(fdp)] = _gen_value(fdp, depth=0)\n    except RecursionError:\n        # Not interesting\n        return\n\n    try:\n        # Not all fuzz-generated data is valid XML.\n        xml = unparse(original)\n    except (ExpatError, UnicodeEncodeError):\n        return\n\n    try:\n        # FIXME: Not all unparsed XML is parsable.\n        # FIXME: Why is there an _encode_ error in parse?\n        final = parse(xml)  # type: OrderedDict[Text, Any]\n    except (ExpatError, UnicodeEncodeError):\n      return\n\n    assert len(original) == len(final)\n    for (k1,v1), (k2, v2) in zip(original.items(), final.items()):\n        assert k1.strip() == k2, (k1, k2)\n\n        if isinstance(v1, str):\n            # Strings are stripped and '' becomes None.\n            v1 = v1.strip() or None\n        if any(isinstance(v1, t) for t in (bool, int, float)):\n            # Bools and Numbers become strings.\n            v1 = str(v1)\n            # Capitalization of booleans is inconsistent.\n            assert v1.lower() == v2.lower(), (v1, v2)\n            return\n        if v1 == OrderedDict():\n            # Empty dict => None\n            assert v2 == None\n            return\n\n        assert v1 == v2, (v1, v2)\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, test_one_input)\n    atheris.Fuzz()\n    return 0\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n"
  },
  {
    "path": "projects/xmlunit/DOMDifferenceEngineCompareFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.xmlunit.diff.*;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport org.w3c.dom.Document;\nimport javax.xml.transform.dom.DOMSource;\n\nclass DiffExpecter implements ComparisonListener {\n         int invoked = 0;\n         final int expectedInvocations;\n         final ComparisonType type;\n         final boolean withXPath;\n         final String controlXPath;\n         final String testXPath;\n         boolean withParentXPath;\n         String controlParentXPath;\n         String testParentXPath;\n         DiffExpecter(ComparisonType type) {\n            this(type, 1);\n        }\n         DiffExpecter(ComparisonType type, int expected) {\n            this(type, expected, false, null, null);\n        }\n         DiffExpecter(ComparisonType type, String controlXPath,\n                             String testXPath) {\n            this(type, 1, true, controlXPath, testXPath);\n        }\n         DiffExpecter(ComparisonType type, int expected,\n                             boolean withXPath, String controlXPath,\n                             String testXPath) {\n            this.type = type;\n            this.expectedInvocations = expected;\n            this.withXPath = withXPath;\n            this.controlXPath = controlXPath;\n            this.testXPath = testXPath;\n            withParentXPath = withXPath;\n            controlParentXPath = getParentXPath(controlXPath);\n            testParentXPath = getParentXPath(testXPath);\n        }\n\n        public DiffExpecter withParentXPath(String controlParentXPath, String testParentXPath) {\n            withParentXPath = true;\n            this.controlParentXPath = controlParentXPath;\n            this.testParentXPath = testParentXPath;\n            return this;\n        }\n\n        @Override\n        public void comparisonPerformed(Comparison comparison,\n                                        ComparisonResult outcome) {\n            invoked++;\n        }\n\n         String getParentXPath(String xPath) {\n            if (xPath == null) {\n                return null;\n            }\n            if (xPath.equals(\"/\") || xPath.equals(\"\")) {\n                return \"\";\n            }\n            int i = xPath.lastIndexOf('/');\n            if (i == xPath.indexOf('/')) {\n                return \"/\";\n            }\n            return i >= 0 ? xPath.substring(0, i) : xPath;\n        }\n    }\n\npublic class DOMDifferenceEngineCompareFuzzer {\n\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();\n        DOMDifferenceEngine d = new DOMDifferenceEngine();\n        DiffExpecter ex = new DiffExpecter(ComparisonType.NODE_TYPE, 0);\n        d.addDifferenceListener(ex);\n        d.setComparisonController(ComparisonControllers.StopWhenDifferent);\n        d.compare(new DOMSource(doc.createElement(data.consumeString(100))),\n                    new DOMSource(doc.createElement(data.consumeString(100))));\n    }\n    catch (org.w3c.dom.DOMException e) {}\n    catch (javax.xml.parsers.ParserConfigurationException e) {}\n  }\n}"
  },
  {
    "path": "projects/xmlunit/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-8-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\nENV MVN $SRC/maven/apache-maven-3.9.5/bin/mvn\n\nRUN git clone --depth 1 https://github.com/xmlunit/xmlunit.git xmlunit\nWORKDIR xmlunit\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\n"
  },
  {
    "path": "projects/xmlunit/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-8\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-8-openjdk-amd64/\" \"$JAVA_HOME\"\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN clean package ${MAVEN_ARGS} org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\n\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./xmlunit-core -name \"xmlunit-core-$CURRENT_VERSION.jar\" -exec mv {} $OUT/xmlunit-core.jar \\;\n\nALL_JARS=\"xmlunit-core.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-8/\\\" \\\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/xmlunit/project.yaml",
    "content": "homepage: \"https://github.com/xmlunit/xmlunit\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/xmlunit/xmlunit.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/xnio-api/0001-avoid-ConcurrentModificationException.patch",
    "content": "diff --git a/api/pom.xml b/api/pom.xml\nindex 5d29ee4d..b72b3395 100644\n--- a/api/pom.xml\n+++ b/api/pom.xml\n@@ -194,6 +194,7 @@\n             <plugin>\n                 <groupId>org.apache.felix</groupId>\n                 <artifactId>maven-bundle-plugin</artifactId>\n+\t\t<version>5.1.8</version>\n                 <configuration>\n                     <instructions>\n                         <Main-Class>org.xnio.Version</Main-Class>\ndiff --git a/nio-impl/pom.xml b/nio-impl/pom.xml\nindex 2f229929..f3e6c388 100644\n--- a/nio-impl/pom.xml\n+++ b/nio-impl/pom.xml\n@@ -176,6 +176,7 @@\n             <plugin>\n                 <groupId>org.apache.felix</groupId>\n                 <artifactId>maven-bundle-plugin</artifactId>\n+\t\t<version>5.1.8</version>\n                 <configuration>\n                     <instructions>\n                         <Main-Class>org.xnio.Version</Main-Class>\n"
  },
  {
    "path": "projects/xnio-api/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\n#\n# install maven configuration, which is also used by gradles's publishToMavenLocal\n#\nADD maven-settings.xml ${SRC}/\nRUN apt-get install -y xmlstarlet\nRUN mkdir -p ~/.m2 && \\\n\txmlstarlet ed \\\n\t\t-u \"settings/localRepository\" -v \"${OUT}/m2/repository\" \\\n\t< ${SRC}/maven-settings.xml > ~/.m2/settings.xml\n\n#\n# install maven and gradle\n#\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n\tunzip maven.zip -d $SRC/maven-3.8.7 && \\\n\trm -rf maven.zip\n\nENV MVN $SRC/maven-3.8.7/apache-maven-3.8.7/bin/mvn\n\nRUN curl -L https://services.gradle.org/distributions/gradle-7.6-bin.zip -o gradle.zip && \\\n    unzip gradle.zip -d $SRC/gradle && \\\n    rm -rf gradle.zip\n\nENV GRADLE $SRC/gradle/gradle-7.6/bin/gradle\n\nENV LIBRARY_NAME xnio\nWORKDIR ${SRC}\n#\n# clone repository\n#\nRUN git clone https://github.com/xnio/xnio ${LIBRARY_NAME}\n\n#\n# apply fixes\n#\nADD *.patch ${SRC}/\nRUN cd ${SRC}/${LIBRARY_NAME} && (for i in ${SRC}/*.patch; do tr -d '\\015' < $i | git apply -v; done )\n\nADD build.sh ${SRC}/\nADD ${LIBRARY_NAME}-fuzzer ${SRC}/${LIBRARY_NAME}-fuzzer/\nWORKDIR ${SRC}/${LIBRARY_NAME}\n"
  },
  {
    "path": "projects/xnio-api/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nSRC_SUBDIR=\"\"\nMVN_FLAGS=\"-Djavac.src.version=15 -Djavac.target.version=15 -DskipTests\"\nALL_JARS=\"\"\n\n# Install the build servers' jazzer-api into the maven repository.\npushd \"/tmp\"\n\t${MVN} install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t-DartifactId=\"jazzer-api\" \\\n\t\t-Dversion=\"0.14.0\" \\\n\t\t-Dpackaging=jar\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}/${SRC_SUBDIR}\"\n\t${MVN} install ${MVN_FLAGS}\n\tCURRENT_VERSION=$(${MVN} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\npopd\n\npushd \"${SRC}/${LIBRARY_NAME}-fuzzer\"\n\t${MVN} package -DfuzzedLibaryVersion=\"${CURRENT_VERSION}\" ${MVN_FLAGS}\n\tinstall -v target/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar ${OUT}/${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\n\tALL_JARS=\"${ALL_JARS} ${LIBRARY_NAME}-fuzzer-${CURRENT_VERSION}.jar\"\npopd\n\n\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nMVN_FUZZERS_PREFIX=\"src/main/java\"\n\nfor fuzzer in $(find ${SRC} -name '*Fuzzer.java'); do\n\t# Find our fuzzer inside the maven structure\n\tstripped_path=$(echo ${fuzzer} | sed \\\n\t\t-e 's|^.*src/main/java/\\(.*\\).java$|\\1|' \\\n\t\t-e 's|^.*src/test/java/\\(.*\\).java$|\\1|' \\\n\t);\n\t# The .java suffix was stripped by sed.\n\tif (echo ${stripped_path} | grep \".java$\"); then\n\t\tcontinue;\n\tfi\n\t\n\tfuzzer_basename=$(basename -s .java $fuzzer)\n\tfuzzer_classname=$(echo ${stripped_path} | sed 's|/|.|g');\n\t\n\t# Create an execution wrapper that executes Jazzer with the correct arguments.\n\t\n\techo \"#!/bin/sh\n# LLVMFuzzerTestOneInput Magic String required for infra/base-images/base-runner/test_all.py. DO NOT REMOVE\n\n\nthis_dir=\\$(dirname \\\"\\$0\\\")\nLD_LIBRARY_PATH=\\\"\\$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=${RUNTIME_CLASSPATH} \\\n--target_class=${fuzzer_classname} \\\n--jvm_args=\\\"-Xmx2048m\\\" \\\n\\$@\" > $OUT/${fuzzer_basename}\n\tchmod u+x $OUT/${fuzzer_basename}\ndone"
  },
  {
    "path": "projects/xnio-api/maven-settings.xml",
    "content": "<settings>\n\t<localRepository>${user.home}/.m2/repository</localRepository>\n</settings>"
  },
  {
    "path": "projects/xnio-api/project.yaml",
    "content": "homepage: \"https://github.com/eclipse-ee4j/jax-rpc-ri\"\nlanguage: jvm\nmain_repo: \"https://github.com/eclipse-ee4j/jax-rpc-ri.git\"\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/xnio-api/xnio-fuzzer/pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\n\t<groupId>ossfuzz</groupId>\n\t<artifactId>xnio-fuzzer</artifactId>\n\t<version>${fuzzedLibaryVersion}</version>\n\t<packaging>jar</packaging>\n\t\n\t<properties>\n\t\t<maven.compiler.source>15</maven.compiler.source>\n\t\t<maven.compiler.target>15</maven.compiler.target>\n\t\t<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n\t\t<fuzzedLibaryVersion>3.8.8.Final</fuzzedLibaryVersion>\n\t\t<exec.mainClass>com.sun.xml.rpc.processor.modeler.rmi.SOAPSimpleTypeCreatorFuzzer</exec.mainClass>\n\t</properties>\n\n\t<!-- This repositories list is copy pasted from the projects' main BOM -->\n\t\n\t<dependencies>\n\t\t<!--\n\t\t\tOn the CI, install the jazzer file with\n\t\t\n\t\t\t\tmvn install:install-file -Dfile=${JAZZER_API_PATH} \\\n\t\t\t\t\t-DgroupId=\"com.code-intelligence\" \\\n\t\t\t\t\t-DartifactId=\"jazzer-api\" \\\n\t\t\t\t\t-Dversion=\"0.14.0\" \\\n\t\t\t\t\t-Dpackaging=jar\n\t\t\n\t\t\tin order to avoid mismatching driver/api versions.\n\t\t-->\n\t\t<dependency>\n\t\t\t<groupId>com.code-intelligence</groupId>\n\t\t\t<artifactId>jazzer-api</artifactId>\n\t\t\t<version>0.14.0</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.jboss.xnio</groupId>\n\t\t\t<artifactId>xnio-api</artifactId>\n\t\t\t<version>${fuzzedLibaryVersion}</version>\n\t\t</dependency>\n\t</dependencies>\n\n\t<build>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<groupId>org.apache.maven.plugins</groupId>\n\t\t\t\t<artifactId>maven-shade-plugin</artifactId>\n\t\t\t\t<version>3.3.0</version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<filters>\n\t\t\t\t\t\t<filter>\n\t\t\t\t\t\t\t<artifact>*:*</artifact>\n\t\t\t\t\t\t\t<excludes>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.SF</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.DSA</exclude>\n\t\t\t\t\t\t\t\t<exclude>META-INF/*.RSA</exclude>\n\t\t\t\t\t\t\t</excludes>\n\t\t\t\t\t\t</filter>\n\t\t\t\t\t</filters>\n\t\t\t\t</configuration>\n\t\t\t\t<executions>\n\t\t\t\t\t<execution>\n\t\t\t\t\t\t<phase>package</phase>\n\t\t\t\t\t\t<goals>\n\t\t\t\t\t\t\t<goal>shade</goal>\n\t\t\t\t\t\t</goals>\n\t\t\t\t\t</execution>\n\t\t\t\t</executions>\n\t\t\t</plugin>\n\t\t</plugins>\n\t</build>\n</project>"
  },
  {
    "path": "projects/xnio-api/xnio-fuzzer/src/main/java/org/xnio/http/HttpParserFuzzer.java",
    "content": "package org.xnio.http;\n\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\n\npublic class HttpParserFuzzer {\n\n    private FuzzedDataProvider fuzzedDataProvider;\n\n    public HttpParserFuzzer(FuzzedDataProvider fuzzedDataProvider) throws Exception {\n        this.fuzzedDataProvider = fuzzedDataProvider;\n    }\n\n    void test() {\n        byte b[] = new byte[]{ 1 };\n        int n = fuzzedDataProvider.remainingBytes();\n        if(n != 0) {\n            b = fuzzedDataProvider.consumeBytes(n);\n        }\n        HttpUpgradeParser parser = new HttpUpgradeParser();\n        ByteBuffer buffer = ByteBuffer.wrap(b);\n        \n        try {\n            /*\n             * read everything, like HttpParserTestCase.testOneCharacterAtATime does,\n             * but read junk after that, too\n             */\n            for(int i=0; i!=n; ++i) {\n                buffer.limit(i);\n                parser.parse(buffer);\n            }\n        } catch (IOException exception) {\n            /* ignore */\n        } catch (IllegalArgumentException excepion) {\n            /* ignore */\n        }\n    }\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider)  throws Exception {\n\n        HttpParserFuzzer fixture = new HttpParserFuzzer(fuzzedDataProvider);\n        fixture.test();\n    }\n}"
  },
  {
    "path": "projects/xnnpack/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool libomp-dev libgomp1\nRUN git clone --depth 1 https://github.com/google/XNNPACK xnnpack\nWORKDIR xnnpack\nCOPY run_tests.sh build.sh *.cc $SRC/\n"
  },
  {
    "path": "projects/xnnpack/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\ncmake -DXNNPACK_BUILD_BENCHMARKS=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DXNNPACK_BUILD_TESTS=ON ../\nmake V=1 -j8\ncd ../\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ../fuzz_model.cc \\\n    -DFXDIV_USE_INLINE_ASSEMBLY=0 -DPTHREADPOOL_NO_DEPRECATED_API=1 \\\n    -DXNN_ENABLE_ARM_BF16=1 -DXNN_ENABLE_ARM_DOTPROD=1 \\\n    -DXNN_ENABLE_ARM_FP16_SCALAR=1 -DXNN_ENABLE_ARM_FP16_VECTOR=1 \\\n    -DXNN_ENABLE_ASSEMBLY=1 -DXNN_ENABLE_DWCONV_MULTIPASS=0 \\\n    -DXNN_ENABLE_GEMM_M_SPECIALIZATION=1 -DXNN_ENABLE_JIT=0 \\\n    -DXNN_ENABLE_MEMOPT=1 -DXNN_ENABLE_RISCV_VECTOR=1 -DXNN_ENABLE_SPARSE=1 \\\n    -I/src/xnnpack/src -I/src/xnnpack/build/pthreadpool-source/include \\\n    -I/src/xnnpack/build/FXdiv-source/include -I/src/xnnpack/include/ \\\n    -I/src/xnnpack/build/FP16-source/include ./build/libXNNPACK.a \\\n    ./build/pthreadpool/libpthreadpool.a ./build/cpuinfo/libcpuinfo.a \\\n    ./build/libxnnpack-microkernels-all.a ./build/libxnnpack-microkernels-prod.a \\\n    -o $OUT/fuzz_model\n"
  },
  {
    "path": "projects/xnnpack/fuzz_model.cc",
    "content": "/* Copyright 2023 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <xnnpack.h>\n\n#include <algorithm>\n#include <array>\n#include <functional>\n#include <iostream>\n#include <limits>\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  FuzzedDataProvider provider(data, size);\n  xnn_status status = xnn_initialize(nullptr);\n  if (status != xnn_status_success) {\n    return 0;\n  }\n\n  /* Prepare a set of input arrays with fuzzer-generated data */\n  alignas(16) static std::array<int8_t, 864 + XNN_EXTRA_BYTES / sizeof(int8_t)>\n      w1;\n  alignas(16) static std::array<int32_t, 32 + XNN_EXTRA_BYTES / sizeof(int8_t)>\n      w2;\n  std::generate(w1.begin(), w1.end(),\n                [&]() mutable { return provider.ConsumeIntegral<uint8_t>(); });\n  std::generate(w2.begin(), w2.end(),\n                [&]() mutable { return provider.ConsumeIntegral<uint32_t>(); });\n\n  xnn_operator_t op0 = nullptr;\n  status = xnn_create_convolution2d_nhwc_qs8(\n      0 /* top padding */, 1 /* right padding */, 1 /* bottom padding */,\n      0 /* left padding */, 3 /* kernel height */, 3 /* kernel width */,\n      2 /* subsampling height */, 2 /* subsampling width */,\n      1 /* dilation_height */, 1 /* dilation_width */, 1 /* groups */,\n      3 /* input channels per group */, 32 /* output_channels_per_group */,\n      3 /* input pixel stride */, 32 /* output pixel stride */,\n      -1 /* input zero point */,\n      provider.ConsumeFloatingPoint<float>() /* input scale */,\n      provider.ConsumeFloatingPoint<float>() /* kernel scale */, w1.data(),\n      w2.data(), -1 /* output zero point */,\n      provider.ConsumeFloatingPoint<float>() /* output scale */,\n      -126 /* output min */, 126 /* output max */, 0 /* flags */, nullptr,\n      &op0);\n\n  xnn_deinitialize();\n  return 0;\n}\n"
  },
  {
    "path": "projects/xnnpack/project.yaml",
    "content": "homepage: \"https://github.com/google/XNNPACK\"\nmain_repo: \"https://github.com/google/XNNPACK\"\nlanguage: c++\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/xnnpack/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build\n"
  },
  {
    "path": "projects/xnu/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y \\\n  autoconf \\\n  automake \\\n  libtool \\\n  ninja-build\n\n# Install Protobuf for C++ as the version in the base-builder repos may\n# be outdated.\nRUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.18.1/protobuf-cpp-3.18.1.tar.gz\nRUN tar xf protobuf-cpp-3.18.1.tar.gz\nWORKDIR $SRC/protobuf-3.18.1\n# Build statically\nRUN ./configure --disable-shared\nRUN make -j $(nproc)\nRUN make install\n\nWORKDIR $SRC\nRUN git clone https://github.com/googleprojectzero/SockFuzzer.git && \\\n    cd SockFuzzer && \\\n    git checkout 801269cfa703a82fbd788ff93afaac16d114e673\nCOPY build.sh $SRC\n"
  },
  {
    "path": "projects/xnu/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir $SRC/build\ncd $SRC/build\n\n# Fix stub functions that use old-style empty parameter lists () which\n# conflict with header declarations in newer clang versions.\ncd $SRC/SockFuzzer\nsed -i 's/^void zone_view_startup_init() {}/void zone_view_startup_init(struct zone_view_startup_spec *spec) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_grp_startup_init() {}/void lck_grp_startup_init(struct lck_grp_startup_spec *spec) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_mtx_assert() {}/void lck_mtx_assert(lck_mtx_t *lck, unsigned int type) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_mtx_init() {}/void lck_mtx_init(lck_mtx_t *lck, lck_grp_t *grp, lck_attr_t *attr) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_mtx_lock() {}/void lck_mtx_lock(lck_mtx_t *lck) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_spin_init() {}/void lck_spin_init(lck_spin_t *lck, lck_grp_t *grp, lck_attr_t *attr) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_mtx_lock_spin() {}/void lck_mtx_lock_spin(lck_mtx_t *lck) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_mtx_convert_spin() {}/void lck_mtx_convert_spin(lck_mtx_t *lck) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_mtx_free() {}/void lck_mtx_free(lck_mtx_t *lck, lck_grp_t *grp) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_rw_init() {}/void lck_rw_init(lck_rw_t *lck, lck_grp_t *grp, lck_attr_t *attr) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_mtx_unlock() {}/void lck_mtx_unlock(lck_mtx_t *lck) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_attr_free() {}/void lck_attr_free(lck_attr_t *attr) {}/' fuzz/fakes/osfmk_stubs.c\nsed -i 's/^void lck_attr_setdebug() {}/void lck_attr_setdebug(lck_attr_t *attr) {}/' fuzz/fakes/osfmk_stubs.c\n\n# Fix kernel_debug stub in fake_impls.c\nsed -i 's/^void kernel_debug() {}/void kernel_debug(uint32_t debugid, uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5) {}/' fuzz/fakes/fake_impls.c\n\n# Remove -Werror from XNU build flags since the old code triggers many new\n# warnings with the current clang version (e.g. single-bit-bitfield-constant-conversion).\nsed -i 's/-Werror//' CMakeLists.txt\n\n# Upgrade C++ standard from C++11 to C++17 since the clang FuzzedDataProvider.h\n# header requires C++17 features (std::is_integral_v, std::conditional_t, etc.).\nsed -i 's/-std=c++11/-std=c++17/g' CMakeLists.txt\n\ncd $SRC/build\ncmake -GNinja $SRC/SockFuzzer\nninja\n\ncp $SRC/build/net_fuzzer $OUT\n"
  },
  {
    "path": "projects/xnu/project.yaml",
    "content": "homepage: \"https://opensource.apple.com/\"\nlanguage: \"c\"\nprimary_contact: \"nedwill@google.com\"\nmain_repo: \"https://github.com/googleprojectzero/SockFuzzer\"\nauto_ccs:\n  - \"ddkilzer@apple.com\"\n  - \"dkishore@apple.com\"\n  - \"phan@apple.com\"\n  - \"Product-Security@apple.com\"\n  - \"vlubet@apple.com\"\n  - \"ebanniettis@apple.com\"\n  - \"jm.park@apple.com\"\n  - \"james_e_kim@apple.com\"\n  - \"rding23@apple.com\"\n  - \"albassam@apple.com\"\n  - \"zakr@apple.com\"\n  - \"roberto_rodriguez2@apple.com\"\n  - \"k_monsen@apple.com\"\n  - \"nnothstine@apple.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\nfile_github_issue: True\n"
  },
  {
    "path": "projects/xpdf/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://gitlab.freedesktop.org/freetype/freetype\nRUN apt-get update\nRUN apt-get install --no-install-recommends -y make wget cmake qtbase5-dev libcups2-dev autoconf automake autotools-dev libtool\nRUN wget https://dl.xpdfreader.com/xpdf-latest.tar.gz\n\nWORKDIR $SRC\nCOPY fuzz_*.cc $SRC/\nCOPY build.sh $SRC/\nCOPY fuzz_*.options $SRC/\n"
  },
  {
    "path": "projects/xpdf/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Unpack the file and cd into it\ntar -zxf xpdf-latest.tar.gz\ndir_name=`tar -tzf xpdf-latest.tar.gz | head -1 | cut -f1 -d\"/\"`\ncd $dir_name\n\nPREFIX=$WORK/prefix\nmkdir -p $PREFIX\n\nexport PKG_CONFIG=\"`which pkg-config` --static\"\nexport PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\nexport PATH=$PREFIX/bin:$PATH\npushd $SRC/freetype\n# Temporarily Add -D_GNU_SOURCE to CFLAGS to fix freetype's dependence on GNU\n# extensions for dlsym to dynamically load harfbuzz. This feature\n# should potentially be disabled instead of fixing the compilation.\n# See https://github.com/google/oss-fuzz/pull/13325 for more details.\nCFLAGS=\"$CFLAGS -D_GNU_SOURCE\" ./autogen.sh\nCFLAGS=\"$CFLAGS -D_GNU_SOURCE\" ./configure --prefix=\"$PREFIX\" --disable-shared PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\" --with-png=no --with-zlib=no\nCFLAGS=\"$CFLAGS -D_GNU_SOURCE\" make -j$(nproc)\nCFLAGS=\"$CFLAGS -D_GNU_SOURCE\" make install\npopd\n\n# Make minor change in the CMakeFiles file.\nsed -i 's/#--- object files needed by XpdfWidget/add_library(testXpdfStatic STATIC $<TARGET_OBJECTS:xpdf_objs>)\\n#--- object files needed by XpdfWidget/' ./xpdf/CMakeLists.txt\nsed -i 's/#--- pdftops/add_library(testXpdfWidgetStatic STATIC $<TARGET_OBJECTS:xpdf_widget_objs>\\n $<TARGET_OBJECTS:splash_objs>\\n $<TARGET_OBJECTS:xpdf_objs>\\n ${FREETYPE_LIBRARY}\\n ${FREETYPE_OTHER_LIBS})\\n#--- pdftops/' ./xpdf/CMakeLists.txt\n\n# Build the project\nmkdir build && cd build\nexport LD=$CXX\ncmake ../ -DCMAKE_C_FLAGS=\"$CFLAGS\" -DCMAKE_CXX_FLAGS=\"$CXXFLAGS\" \\\n  -DOPI_SUPPORT=ON -DSPLASH_CMYK=ON -DMULTITHREADED=ON \\\n  -DUSE_EXCEPTIONS=ON -DXPDFWIDGET_PRINTING=ON -DFREETYPE_DIR=\"$PREFIX\"\nmake\n\n# Build fuzzers\nfor fuzzer in zxdoc pdfload JBIG2; do\n    cp ../../fuzz_$fuzzer.cc .\n    $CXX fuzz_$fuzzer.cc -o $OUT/fuzz_$fuzzer $CXXFLAGS $LIB_FUZZING_ENGINE \\\n      ./xpdf/libtestXpdfStatic.a ./fofi/libfofi.a ./goo/libgoo.a ./splash/libsplash.a ./xpdf/libtestXpdfWidgetStatic.a /work/prefix/lib/libfreetype.a \\\n      -I../ -I../goo -I../fofi -I. -I../xpdf -I../splash\ndone\n\n# Copy over options files\ncp $SRC/fuzz_*.options $OUT/\n"
  },
  {
    "path": "projects/xpdf/fuzz_JBIG2.cc",
    "content": "/*  Copyright 2022 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <vector>\n#include <aconf.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <stddef.h>\n#include <string.h>\n#include <png.h>\n\n#include \"gmem.h\"\n#include \"gmempp.h\"\n#include \"parseargs.h\"\n#include \"GString.h\"\n#include \"gfile.h\"\n#include \"GlobalParams.h\"\n#include \"Object.h\"\n#include \"PDFDoc.h\"\n#include \"SplashBitmap.h\"\n#include \"Splash.h\"\n#include \"SplashOutputDev.h\"\n#include \"Stream.h\"\n#include \"config.h\"\n\n#include \"JBIG2Stream.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  FuzzedDataProvider fdp(data, size);\n  double hdpi = fdp.ConsumeFloatingPoint<double>();\n  double vdpi = fdp.ConsumeFloatingPoint<double>();\n  int rotate = fdp.ConsumeIntegral<int>();\n  bool useMediaBox = fdp.ConsumeBool();\n  bool crop = fdp.ConsumeBool();\n  bool printing = fdp.ConsumeBool();\n  std::vector<char> payload = fdp.ConsumeRemainingBytes<char>();\n\n  Object xpdf_obj;\n  xpdf_obj.initNull();\n  BaseStream *stream = new MemStream(payload.data(), 0, payload.size(), &xpdf_obj);\n\n  Object info, xfa;\n  Object *acroForm;\n  globalParams = new GlobalParams(NULL);\n  globalParams->setErrQuiet(1);\n  globalParams->setupBaseFonts(NULL);\n  char yes[] = \"yes\";\n  globalParams->setEnableFreeType(yes); // Yes, it's a string and not a bool.\n  globalParams->setErrQuiet(1);\n\n  PDFDoc *doc = NULL;\n  try\n  {\n    PDFDoc doc(stream);\n    if (doc.isOk() == gTrue)\n    {\n      XRef *xref = doc.getXRef();\n      int objNums = xref->getNumObjects();\n      Object currentObj;\n      for (int i = 0; i < objNums; ++i)\n      {\n        if (xref->fetch(i, 0, &currentObj)->isStream())\n        {\n          currentObj.getStream()->reset();\n        }\n      }\n      currentObj.free();\n    }\n  }\n  catch (...)\n  {\n  }\n\n  delete globalParams;\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/xpdf/fuzz_JBIG2.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/xpdf/fuzz_pdfload.cc",
    "content": "/*  Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <vector>\n#include <aconf.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <stddef.h>\n#include <string.h>\n#include <png.h>\n\n#include \"gmem.h\"\n#include \"gmempp.h\"\n#include \"parseargs.h\"\n#include \"GString.h\"\n#include \"gfile.h\"\n#include \"GlobalParams.h\"\n#include \"Object.h\"\n#include \"PDFDoc.h\"\n#include \"SplashBitmap.h\"\n#include \"Splash.h\"\n#include \"SplashOutputDev.h\"\n#include \"Stream.h\"\n#include \"config.h\"\n#include \"JBIG2Stream.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    FuzzedDataProvider fdp (data, size);\n    double hdpi = fdp.ConsumeFloatingPoint<double>();\n    double vdpi = fdp.ConsumeFloatingPoint<double>();\n    int rotate = fdp.ConsumeIntegral<int>();\n    bool useMediaBox = fdp.ConsumeBool();\n    bool crop = fdp.ConsumeBool();\n    bool printing = fdp.ConsumeBool();\n    std::vector<char> payload = fdp.ConsumeRemainingBytes<char>();\n\n    Object xpdf_obj;\n    xpdf_obj.initNull();\n    BaseStream *stream = new MemStream(payload.data(), 0, payload.size(), &xpdf_obj);\n\n    Object info, xfa;\n    Object *acroForm;\n    globalParams = new GlobalParams(NULL);\n    globalParams->setErrQuiet(1);\n    globalParams->setupBaseFonts(NULL);\n    char yes[] = \"yes\";\n    globalParams->setEnableFreeType(yes);  // Yes, it's a string and not a bool.\n    globalParams->setErrQuiet(1);\n\n    PDFDoc *doc = NULL;\n    try {\n      PDFDoc doc(stream);\n        if (doc.isOk() == gTrue)\n        {\n            doc.getNumPages();\n            doc.getOutline();\n            doc.getStructTreeRoot();\n            doc.getXRef();\n            doc.okToPrint(gTrue);\n            doc.okToCopy(gTrue);\n            doc.okToChange(gTrue);\n            doc.okToAddNotes(gTrue);\n            doc.isLinearized();\n            doc.getPDFVersion();\n\n            GString *metadata;\n            if ((metadata = doc.readMetadata())) {\n              (void)metadata->getCString();\n            }\n            delete metadata;\n\n            Object info;\n            doc.getDocInfo(&info);\n            if (info.isDict()) {\n              info.getDict();\n            }\n            info.free();\n\n            if ((acroForm = doc.getCatalog()->getAcroForm())->isDict()) {\n                acroForm->dictLookup(\"XFA\", &xfa);\n                xfa.free();\n            }\n\n            for (size_t i = 1; i <= doc.getNumPages(); i++) {\n              doc.getLinks(i);\n              auto page = doc.getCatalog()->getPage(i);\n              if (!page->isOk()) {\n                continue;\n              }\n              page->getResourceDict();\n              page->getMetadata();\n              page->getResourceDict();\n            }\n\n            SplashColor paperColor = {0xff, 0xff, 0xff};\n            SplashOutputDev *splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor);\n            splashOut->setNoComposite(gTrue);\n            splashOut->startDoc(doc.getXRef());\n            for (size_t i = 1; i <= doc.getNumPages(); ++i) {\n              doc.displayPage(splashOut, NULL, i, hdpi, vdpi, rotate, useMediaBox, crop, printing);\n            }\n            (void)splashOut->getBitmap();\n\n            delete splashOut;\n        }\n    } catch (...) {\n\n    }\n\n    delete globalParams;\n\n    return 0;\n}\n\n"
  },
  {
    "path": "projects/xpdf/fuzz_pdfload.options",
    "content": "[libfuzzer]\ndetect_leaks=0\n"
  },
  {
    "path": "projects/xpdf/fuzz_zxdoc.cc",
    "content": "/*  Copyright 2020 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdlib.h>\n#include <string.h>\n#include <stdint.h>\n#include \"Zoox.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    char *ss = (char*)malloc(size+1);\n    memcpy(ss, data, size);\n    ss[size] = '\\0';\n\n    ZxDoc Z1;\n    ZxDoc *new_doc = Z1.loadMem(ss, size);\n    if (new_doc != NULL)\n        delete new_doc;\n\n    free(ss);\n\n    return 0;  \n}\n"
  },
  {
    "path": "projects/xpdf/project.yaml",
    "content": "homepage: \"https://www.xpdfreader.com/\"\nprimary_contact: \"xpdf@xpdfreader.com\"\nlanguage: c++\nsanitizers:\n  - address\nauto_ccs :\n  - \"david@adalogics.com\"\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/xs/Dockerfile",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\n#Apache-2.0 license\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -q $SRC/xst_jsonparse_seed_corpus.zip go-fuzz-corpus/json/corpus/*\n\n#Apache-2.0 license\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cat fuzzing/dictionaries/json.dict > $SRC/xst_jsonparse.dict && \\\n    cat fuzzing/dictionaries/js.dict > $SRC/xst.dict\n\n# install npm tool to strip comments\nENV DEBIAN_FRONTEND=noninteractive\n# Fuzz Introspector used by OSS-Fuzz depends on installing libjpeg-dev zlib1g-dev\n# later in the build process, and because we remoy /var/lib/apt/lists/* below we\n# need to install them here.\nRUN apt update && apt install -yqq npm libjpeg-dev zlib1g-dev libyaml-dev\n# && rm -rf /var/lib/apt/lists/*\nRUN npm i -g @prasadrajandran/strip-comments-cli\n\n#test262 built-ins\n#BSD license\nRUN git clone --depth 1 https://github.com/tc39/test262 && \\\n    # strip comments\n    find test262/test/built-ins -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+ && \\\n    # strip empty lines\n    find test262/test/built-ins -iname '*.js' -exec sed -i '/^[[:space:]]*$/d' '{}' \\+ && \\\n    # strip functions that sleep\n    find test262/test/built-ins -iname '*.js' -exec grep -l 'Atomics\\.wait' {} \\; -exec rm -f {} \\; && \\\n    find test262/test/built-ins -iname '*.js' | zip -@ -q $SRC/xst_seed_corpus.zip\n\nRUN git clone --depth=1 https://github.com/Moddable-OpenSource/moddable moddable && \\\n    # strip comments\n    find moddable/tests/xs -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \\+ && \\\n    # strip empty lines\n    find moddable/tests/xs -iname '*.js' -exec sed -i '/^[[:space:]]*$/d' '{}' \\+ && \\\n    find moddable/tests/xs -iname '*.js' | zip -@ -q $SRC/xst_seed_corpus.zip\nWORKDIR $SRC/moddable\n\nCOPY build.sh xst.options $SRC/\n\n# clean up\nRUN npm rm @prasadrajandran/strip-comments-cli && apt purge -yqq npm && apt autoremove -yqq && rm -rf /var/lib/apt/lists/*\n"
  },
  {
    "path": "projects/xs/build.sh",
    "content": "#!/bin/bash -eu\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Copy seed corpus and dictionary.\nmv $SRC/{*.zip,*.dict} $OUT\n\n\nexport MODDABLE=$PWD\n\nFUZZ_TARGETS=(\n  xst\n  xst_jsonparse\n)\n\nREALBIN_PATH=$OUT\n\n# build main target\ncd \"$MODDABLE/xs/makefiles/lin\"\nFUZZING=1 OSSFUZZ=1 FUZZ_METER=2560000 make debug\n\ncd \"$MODDABLE\"\ncp ./build/bin/lin/debug/xst $REALBIN_PATH/xst\ncp $SRC/xst.options $OUT/\n\n# build jsonparse target\ncd \"$MODDABLE/xs/makefiles/lin\"\nmake -f xst.mk clean\nFUZZING=1 OSSFUZZ=1 OSSFUZZ_JSONPARSE=1 FUZZ_METER=2560000 make debug\n\ncd \"$MODDABLE\"\ncp ./build/bin/lin/debug/xst $REALBIN_PATH/xst_jsonparse\n\ncp $SRC/xst.options $OUT/xst_jsonparse.options\n"
  },
  {
    "path": "projects/xs/project.yaml",
    "content": "homepage: \"https://github.com/Moddable-OpenSource/moddable\"\nlanguage: c\nprimary_contact: \"peter.hoddie@gmail.com\"\nauto_ccs:\n  - peter@moddable.com\n  - ps@moddable.com\n  - raphael@agoric.com\n  - kris@agoric.com\n  - gibson@agoric.com\nsanitizers:\n  - address\n  - memory\n  - undefined:\n      experimental: True \nmain_repo: 'https://github.com/Moddable-OpenSource/moddable.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/xs/xst.options",
    "content": "[asan]\ndetect_stack_use_after_return=0\n"
  },
  {
    "path": "projects/xstream/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nENV JAVA_HOME $JAVA_15_HOME\nENV JVM_LD_LIBRARY_PATH $JAVA_HOME/lib/server\nENV PATH $JAVA_HOME/bin:$PATH\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/xml.dict $SRC/XmlFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/XmlFuzzer_seed_corpus.zip go-fuzz-corpus/xml/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/x-stream/xstream.git xstream\n\nCOPY build.sh $SRC/\nCOPY XmlFuzzer.java $SRC/\nWORKDIR $SRC/xstream\n"
  },
  {
    "path": "projects/xstream/XmlFuzzer.java",
    "content": "\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.BugDetectors;\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport com.thoughtworks.xstream.XStream;\nimport com.thoughtworks.xstream.io.xml.DomDriver;\nimport com.thoughtworks.xstream.io.xml.StaxDriver;\n\nimport com.thoughtworks.xstream.io.StreamException;\nimport com.thoughtworks.xstream.mapper.CannotResolveClassException;\nimport com.thoughtworks.xstream.converters.ConversionException;\n\nclass FuzzObj {\n  private String string1;\n  \n  public FuzzObj(String s1){\n    this.string1 = s1;  \n  }\n}\n\npublic class XmlFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try (AutoCloseable ignored = BugDetectors.allowNetworkConnections()) {\n      XStream xstream;\n      switch(data.consumeInt(1,3)){\n          case 1: xstream = new XStream(new DomDriver());\n              break;\n          case 2: xstream = new XStream(new StaxDriver());\n              break;\n          case 3: xstream = new XStream();\n              break;\n          default: return;\n      }\n      try{\n          FuzzObj fo = (FuzzObj) xstream.fromXML(data.consumeRemainingAsString());\n      }\n      catch (StreamException | CannotResolveClassException | ConversionException e){\n          return;\n      }\n    } catch (Exception e) {\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "projects/xstream/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN -pl xstream package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"xstream/target/xstream-$CURRENT_VERSION.jar\" $OUT/xstream.jar\n\nALL_JARS=\"xstream.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/xstream/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: http://x-stream.github.io/\nlanguage: jvm\nmain_repo: https://github.com/x-stream/xstream.git\nsanitizers:\n- address\nvendor_ccs:\n- patrice.salathe@code-intelligence.com\n- yakdan@code-intelligence.com\n"
  },
  {
    "path": "projects/xvid/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool subversion\nRUN svn checkout http://svn.xvid.org/trunk --username anonymous --password \"\" --non-interactive --no-auth-cache\nRUN git clone --depth 1 https://github.com/guidovranken/fuzzing-headers.git\nRUN git clone --depth 1 https://github.com/guidovranken/oss-fuzz-fuzzers.git\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/xvid/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/trunk/xvidcore/build/generic/\n./bootstrap.sh\nmkdir $SRC/xvidcore-install/\nif [[ $CFLAGS = *sanitize=memory* ]]\nthen\n    ./configure --prefix=$SRC/xvidcore-install/ --disable-assembly\nelse\n    if [[ $CFLAGS = *-m32* ]]\n    then\n        LDFLAGS=\"-m32\" ./configure --prefix=$SRC/xvidcore-install/ --disable-assembly\n    else\n        ./configure --prefix=$SRC/xvidcore-install/\n    fi\nfi\nmake -j $(nproc) libxvidcore.a\n\nfind . -name \"libxvidcore.a\"  -exec cp {} . \\;\n\n$CXX $CXXFLAGS -I $SRC/trunk/xvidcore/src/ \\\n    $SRC/oss-fuzz-fuzzers/xvid/fuzzer.cpp ./libxvidcore.a \\\n    $LIB_FUZZING_ENGINE -o $OUT/fuzzer-decoder\n"
  },
  {
    "path": "projects/xvid/project.yaml",
    "content": "homepage: \"https://www.xvid.com/\"\nmain_repo: \"http://svn.xvid.org/trunk\"\nlanguage: c++\nprimary_contact: \"guidovranken@gmail.com\"\nauto_ccs:\n - \"mm@xvid.org\"\n - \"xvidsolutions@gmail.com\"\nsanitizers:\n - address\n - memory\narchitectures:\n - x86_64\n - i386\n"
  },
  {
    "path": "projects/xz/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf autopoint libtool zip\nRUN git clone https://github.com/tukaani-project/xz.git\nCOPY build.sh $SRC/\nWORKDIR xz\n"
  },
  {
    "path": "projects/xz/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./autogen.sh --no-po4a --no-doxygen\n./configure \\\n  --enable-static \\\n  --enable-debug \\\n  --disable-shared \\\n  --disable-xz \\\n  --disable-xzdec \\\n  --disable-lzmadec \\\n  --disable-lzmainfo\n\nmake clean\nmake -j$(nproc)\nmake -C tests/ossfuzz\n\ncp $SRC/xz/tests/ossfuzz/config/*.options $OUT/\ncp $SRC/xz/tests/ossfuzz/config/*.dict $OUT/\n\nfind $SRC/xz/tests/files -name \"*.lzma\" \\\n-exec zip -ujq $OUT/fuzz_decode_alone_seed_corpus.zip \"{}\" \\;\nfind $SRC/xz/tests/files -name \"*.xz\" \\\n-exec zip -ujq $OUT/fuzz_decode_stream_seed_corpus.zip \"{}\" \\;\n"
  },
  {
    "path": "projects/xz/project.yaml",
    "content": "homepage: \"https://tukaani.org/xz/\"\nlanguage: c++\nprimary_contact: \"lasse.collin@tukaani.org\"\nauto_ccs:\n  - \"bshas3@gmail.com\"\n  - \"samjd1024@gmail.com\"\narchitectures:\n  - x86_64\n  - i386\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/tukaani-project/xz.git'\n"
  },
  {
    "path": "projects/xz-java/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install ant -y\nRUN git clone --depth 1 https://github.com/tukaani-project/xz-java $SRC/xz-java\n\nCOPY build.sh $SRC/\nCOPY *Fuzzer.java $SRC/\nWORKDIR $SRC/xz-java\n"
  },
  {
    "path": "projects/xz-java/XZEncoderFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.tukaani.xz.LZMA2Options;\nimport org.tukaani.xz.UnsupportedOptionsException;\nimport org.tukaani.xz.XZOutputStream;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\n\npublic class XZEncoderFuzzer {\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        ByteArrayInputStream in = new ByteArrayInputStream(data.consumeBytes(300));\n        ByteArrayOutputStream out = new ByteArrayOutputStream();\n        LZMA2Options options = new LZMA2Options();\n        try {\n            options.setPreset(data.consumeInt(LZMA2Options.PRESET_MIN, LZMA2Options.PRESET_MAX));\n        } catch (UnsupportedOptionsException e) {\n            throw new RuntimeException(e);\n        }\n\n        byte[] buf = data.consumeBytes(300);\n        try {\n            XZOutputStream xzOut = new XZOutputStream(out, options);\n            xzOut.write(buf, 0, buf.length);\n            xzOut.finish();\n        } catch (IOException e) {}\n    }\n}\n"
  },
  {
    "path": "projects/xz-java/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\nant\n\ncp \"$SRC/xz-java/build/jar/xz.jar\" $OUT/\n\nALL_JARS=$(find $OUT/ -name *.jar ! -name jazzer*.jar -printf \"%f \")\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/xz-java/project.yaml",
    "content": "homepage: \"https://tukaani.org/xz/java.html\"\nlanguage: jvm\nprimary_contact: \"lasse.collin@tukaani.org\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/tukaani-project/xz-java\"\nsanitizers:\n  - address\nvendor_ccs:\n"
  },
  {
    "path": "projects/yajl-ruby/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN git clone --depth 1 https://github.com/brianmario/yajl-ruby\nWORKDIR yajl-ruby\nCOPY json_fuzzer.c $SRC/yajl-ruby/fuzz/\nCOPY json_fuzzer.dict $SRC/\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/yajl-ruby/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd ext/yajl\n\necho '{\"a\":\"\\u00f8C\",\"b\":1.2,\"c\":{\"d\":[\"foo\",{\"bar\":\"baz\"}]},\"e\":null,\"f\":true,\"t\":false}' > $WORK/seed.json\nzip -q $OUT/json_fuzzer_seed_corpus.zip $WORK/seed.json\n\nmv $SRC/*.dict $OUT/\n\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -I. \\\n    -x c yajl.c yajl_alloc.c yajl_buf.c yajl_lex.c yajl_parser.c yajl_encode.c \\\n    ../../fuzz/json_fuzzer.c -o $OUT/json_fuzzer\n"
  },
  {
    "path": "projects/yajl-ruby/json_fuzzer.c",
    "content": "/*\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <assert.h>\n#include <stdbool.h>\n#include <stddef.h>\n#include <stdint.h>\n\n#include \"api/yajl_parse.h\"\n\ntypedef struct {\n    int arrayLevel;\n    int objectLevel;\n} context;\n\nstatic int yajl_found_null(void* ctx) { \n    return 1;\n}\n\nstatic int yajl_found_boolean(void* ctx, int boolean) {\n    return 1;\n};\n\nstatic int yajl_found_number(void* ctx, const char* v, unsigned int l) {\n    assert(l > 0);\n    return 1;\n}\n\nstatic int yajl_found_string(void* ctx, const unsigned char* s, unsigned int l) {\n    return 1;\n}\n\nstatic int yajl_found_object_key(void* ctx, const unsigned char* v, unsigned int l) {\n    assert(((context*)ctx)->objectLevel > 0);\n    return 1;\n}\n\nstatic int yajl_found_start_object(void* ctx) {\n    ((context*)ctx)->objectLevel++;\n    return 1;\n}\n\nstatic int yajl_found_end_object(void* ctx) {\n    assert(((context*)ctx)->objectLevel > 0);\n    ((context*)ctx)->objectLevel--;\n    return 1;\n}\n\nstatic int yajl_found_start_array(void* ctx) {\n    ((context*)ctx)->arrayLevel++;\n    return 1;\n}\n\nstatic int yajl_found_end_array(void* ctx) {\n    assert(((context*)ctx)->arrayLevel > 0);\n    ((context*)ctx)->arrayLevel--;\n    return 1;\n}\n\nstatic yajl_callbacks callbacks = {\n    yajl_found_null,\n    yajl_found_boolean,\n    NULL,\n    NULL,\n    yajl_found_number,\n    yajl_found_string,\n    yajl_found_start_object,\n    yajl_found_object_key,\n    yajl_found_end_object,\n    yajl_found_start_array,\n    yajl_found_end_array\n};\n\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n    context ctx = {\n        .arrayLevel = 0,\n        .objectLevel = 0,\n    };\n    yajl_parser_config cfg = {\n        .allowComments = 1,\n        .checkUTF8 = 1,\n    };\n    yajl_handle parser = yajl_alloc(&callbacks, &cfg, NULL, (void*)&ctx);\n\n    (void)yajl_parse(parser, data, size);\n    yajl_free(parser);\n\n    return 0;\n}\n"
  },
  {
    "path": "projects/yajl-ruby/json_fuzzer.dict",
    "content": "\"{\"\n\"}\"\n\",\"\n\"[\"\n\"]\"\n\",\"\n\":\"\n\"e\"\n\"e+\"\n\"e-\"\n\"E\"\n\"E+\"\n\"E-\"\n\"\\\"\"\n\"\\\\\"\n\" \"\n\"null\"\n\"1\"\n\"1.234\"\n\"3e4\"\n"
  },
  {
    "path": "projects/yajl-ruby/project.yaml",
    "content": "homepage: https://github.com/brianmario/yajl-ruby\nlanguage: c++\nprimary_contact: seniorlopez@gmail.com\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - undefined\n  - memory\nauto_ccs:\n  - aaron.patterson@gmail.com\n  - jonathan@titanous.com\nmain_repo: 'https://github.com/brianmario/yajl-ruby'\n"
  },
  {
    "path": "projects/yaml-cpp/Dockerfile",
    "content": "# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && \\\n    apt-get install -y \\\n    make \\\n    cmake\n\nRUN git clone --depth 1 https://github.com/jbeder/yaml-cpp.git $SRC/yaml-cpp/\nRUN git clone --depth 1 https://github.com/initializedd/yaml-cpp-fuzzer.git $SRC/yaml-cpp-fuzzer/\n\nCOPY build.sh run_tests.sh $SRC/\nWORKDIR $SRC/yaml-cpp/\n\n"
  },
  {
    "path": "projects/yaml-cpp/build.sh",
    "content": "#!/bin/bash -eu\n\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmkdir build\ncd build\n\ncmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=ON ..\nmake -j4\n\ncp $SRC/yaml-cpp-fuzzer/*.dict $OUT/\ncp $SRC/yaml-cpp-fuzzer/*.options $OUT/\n\nfor fuzzer in $(find $SRC/yaml-cpp-fuzzer/ -name \"*_fuzzer.cpp\"); do\n    fuzzer_basename=$(basename -s .cpp $fuzzer)\n    $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n        -I$SRC/yaml-cpp/include \\\n        $fuzzer \\\n        -o $OUT/$fuzzer_basename \\\n        libyaml-cpp.a\n\n    zip -q $OUT/${fuzzer_basename}_seed_corpus.zip $SRC/yaml-cpp-fuzzer/${fuzzer_basename}_seed_corpus/*\ndone\n\n"
  },
  {
    "path": "projects/yaml-cpp/project.yaml",
    "content": "homepage: \"https://codedocs.xyz/jbeder/yaml-cpp/index.html\"\nmain_repo: \"https://github.com/jbeder/yaml-cpp\"\nlanguage: c++\nprimary_contact: \"jbeder+github@gmail.com\"\nauto_ccs:\n  - \"initializedd123@protonmail.com\"\n\n"
  },
  {
    "path": "projects/yaml-cpp/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n################################################################################\n\ncd build\nmake test\n"
  },
  {
    "path": "projects/yamlbeans/.gitignore",
    "content": "project-parent/yamlbeans\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/yamlbeans/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/yaml.dict $SRC/YamlReaderFuzzer.dict && \\\n    cp fuzzing/dictionaries/yaml.dict $SRC/YamlWriterFuzzer.dict && \\\n    rm -rf fuzzing\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/yamlbeans\nRUN apt update && apt install -y openjdk-8-jdk\nRUN git clone --depth 1 https://github.com/EsotericSoftware/yamlbeans/ $SRC/project-parent/yamlbeans\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/yamlbeans/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=yamlbeans\nPROJECT_GROUP_ID=com.esotericsoftware.yamlbeans\nPROJECT_ARTIFACT_ID=yamlbeans\nMAIN_REPOSITORY=https://github.com/EsotericSoftware/yamlbeans/\n\nMAVEN_ARGS=\"-Djavac.src.version=1.8 -Djavac.target.version=1.8 -Denforcer.skip=true -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/*.dict $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-8\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip \"/usr/lib/jvm/java-8-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-8/\\\" \\\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/yamlbeans/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>1.8</java.version>\n        <maven.compiler.source>1.8</maven.compiler.source>\n        <maven.compiler.target>1.8</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>com.esotericsoftware.yamlbeans</groupId>\n            <artifactId>yamlbeans</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/yamlbeans/project-parent/fuzz-targets/src/test/java/com/example/YamlReaderFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.esotericsoftware.yamlbeans.YamlConfig;\nimport com.esotericsoftware.yamlbeans.YamlException;\nimport com.esotericsoftware.yamlbeans.YamlReader;\n\nimport java.util.NoSuchElementException;\n\n\nclass YamlReaderFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        YamlConfig yamlConfig = new YamlConfig();\n        yamlConfig.setAllowDuplicates(data.consumeBoolean());\n        yamlConfig.setBeanProperties(data.consumeBoolean());\n        yamlConfig.setPrivateConstructors(data.consumeBoolean());\n        yamlConfig.setPrivateFields(data.consumeBoolean());\n\n        YamlReader reader = new YamlReader(data.consumeRemainingAsString(), yamlConfig);\n\n        while (true) {\n            Object object = null;\n            try {\n                object = reader.read();\n            } catch (YamlException e) {\n            } catch (NoSuchElementException | NullPointerException | IndexOutOfBoundsException e) {\n                // Need to catch to let fuzzer continue.\n            }\n            if (object == null) break;\n        }\n    }\n}"
  },
  {
    "path": "projects/yamlbeans/project-parent/fuzz-targets/src/test/java/com/example/YamlWriterFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport com.esotericsoftware.yamlbeans.YamlException;\nimport com.esotericsoftware.yamlbeans.YamlReader;\nimport com.esotericsoftware.yamlbeans.YamlWriter;\n\nimport java.io.*;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.*;\n\n\nclass YamlWriterFuzzer {\n    static int cn = 29;\n\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        int dummyNum = data.consumeInt(0, 2^cn - 1);\n        DummyClass dummyClass = getDummyClass(data, dummyNum);\n\n        YamlWriter writer = null;\n        try {\n            writer = new YamlWriter(new FileWriter(\"output.yaml\"));\n        } catch (IOException e) {\n            return;\n        }\n\n        try {\n            writer.write(dummyClass);\n            writer.close();\n        } catch (YamlException e) {\n        }\n\n        YamlReader reader = null;\n        try {\n            reader = new YamlReader(new FileReader(\"output.yaml\"));\n\n            while (true) {\n                Object object = null;\n                object = reader.read(DummyClass.class);\n\n                if (object == null) break;\n            }\n        } catch (FileNotFoundException | YamlException e) {\n        } catch (NoSuchElementException | NullPointerException | IndexOutOfBoundsException e) {\n            // Need to catch to let fuzzer continue.\n        }\n    }\n\n    public static DummyClass getDummyClass (FuzzedDataProvider data, int dummyNum) {\n        DummyClass dummyClass = new DummyClass();\n\n        for (int bit = 0; bit < cn; ++bit) {\n            if (((dummyNum >> bit) & 1) == 1) {\n                switch (bit) {\n                    case 0:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._treeMap.put(data.consumeString(50), data.consumeInt());\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 1:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._arrayList.add(data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 2:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._hashSet.add(data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 3:\n                        for (int i = 0; i < data.consumeInt(0, 50); i++) {\n                            try {\n                                dummyClass._hashMap.put(data.consumeString(50), data.consumeString(50));\n                            } catch (NullPointerException e) {\n                            }\n                        }\n                        break;\n                    case 4:\n                        Integer[] integerArr = new Integer[data.consumeInt(0, 50)];\n                        for (int i = 0; i < integerArr.length; i++) {\n                            integerArr[i] = data.consumeInt();\n                        }\n                        dummyClass._asList = Arrays.asList(integerArr);\n                        break;\n                    case 5:\n                        dummyClass._intArray = data.consumeInts(50);\n                        break;\n                    case 6:\n                        dummyClass._longArray = data.consumeLongs(50);\n                        break;\n                    case 7:\n                        dummyClass._shortArray = data.consumeShorts(50);\n                        break;\n                    case 8:\n                        float[] floatArr = new float[data.consumeInt(0, 50)];\n                        for (int i = 0; i < floatArr.length; i++) {\n                            floatArr[i] = data.consumeFloat();\n                        }\n                        dummyClass._floatArray = floatArr;\n                        break;\n                    case 9:\n                        double[] doubleArr = new double[data.consumeInt(0, 50)];\n                        for (int i = 0; i < doubleArr.length; i++) {\n                            doubleArr[i] = data.consumeDouble();\n                        }\n                        dummyClass._doubleArray = doubleArr;\n                        break;\n                    case 10:\n                        dummyClass._byteArray = data.consumeBytes(50);\n                        break;\n                    case 11:\n                        char[] charArr = new char[data.consumeInt(0, 50)];\n                        for (int i = 0; i < charArr.length; i++) {\n                            charArr[i] = data.consumeChar();\n                        }\n                        dummyClass._charArray = charArr;\n                        break;\n                    case 12:\n                        dummyClass._boolArray = data.consumeBooleans(50);\n                        break;\n                    case 13:\n                        String[] strArr = new String[data.consumeInt(0, 50)];\n                        for (int i = 0; i < strArr.length; i++) {\n                            strArr[i] = data.consumeString(50);\n                        }\n                        dummyClass._stringArray = strArr;\n                        break;\n                    case 14:\n                        BitSet bitSet = BitSet.valueOf(data.consumeLongs(50));\n                        dummyClass._bitSet = bitSet;\n                        break;\n                    case 15:\n                        SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n                        try {\n                            dummyClass._date = dateFormat.parse(data.consumeString(50));\n                        } catch (ParseException e) {\n                        }\n                        break;\n                    case 16:\n                        TimeZone tz = TimeZone.getTimeZone(data.consumeString(50));\n                        dummyClass._timeZone = tz;\n                        break;\n                    case 17:\n                        Calendar calendar = new GregorianCalendar(data.consumeInt(),data.consumeInt(),data.consumeInt());\n                        dummyClass._calendar = calendar;\n                        break;\n                    case 18:\n                        Locale locale = new Locale(data.consumeString(50));\n                        dummyClass._locale = locale;\n                        break;\n                    case 19:\n                        Integer[] integerArr2 = new Integer[data.consumeInt(0, 50)];\n                        for (int i = 0; i < integerArr2.length; i++) {\n                            integerArr2[i] = data.consumeInt();\n                        }\n                        dummyClass._integerArray = integerArr2;\n                        break;\n                    case 20:\n                        dummyClass._boolean = data.consumeBoolean();\n                        break;\n                    case 21:\n                        dummyClass._char = data.consumeChar();\n                        break;\n                    case 22:\n                        dummyClass._byte = data.consumeByte();\n                        break;\n                    case 23:\n                        dummyClass._short = data.consumeShort();\n                        break;\n                    case 24:\n                        dummyClass._int = data.consumeInt();\n                        break;\n                    case 25:\n                        dummyClass._float = data.consumeFloat();\n                        break;\n                    case 26:\n                        dummyClass._long = data.consumeLong();\n                        break;\n                    case 27:\n                        dummyClass._double = data.consumeDouble();\n                        break;\n                    case 28:\n                        dummyClass._string = data.consumeString(50);\n                        break;\n                }\n            }\n        }\n        return dummyClass;\n    }\n\n    public static class DummyClass implements Serializable {\n        public TreeMap<String, Integer> _treeMap;\n        public List<String> _arrayList;\n        public Set<String> _hashSet;\n        public Map<String, Object> _hashMap;\n        public List<Integer> _asList;\n        public int[] _intArray;\n        public long[] _longArray;\n        public short[] _shortArray;\n        public float[] _floatArray;\n        public double[] _doubleArray;\n        public byte[] _byteArray;\n        public char[] _charArray;\n        public boolean[] _boolArray;\n        public String[] _stringArray;\n        public BitSet _bitSet;\n        public Date _date;\n        public TimeZone _timeZone;\n        public Calendar _calendar;\n        public Locale _locale;\n        public Integer[] _integerArray;\n        public boolean _boolean;\n        public char _char;\n        public byte _byte;\n        public short _short;\n        public int _int;\n        public float _float;\n        public Long _long;\n        public Double _double;\n        public String _string;\n    }\n}"
  },
  {
    "path": "projects/yamlbeans/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>yamlbeans</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/yamlbeans/project.yaml",
    "content": "homepage: \"https://github.com/EsotericSoftware/yamlbeans/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/EsotericSoftware/yamlbeans/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/yara/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN \\\n  apt-get update && apt-get install -y \\\n  automake \\\n  autoconf \\\n  make \\\n  libtool \\\n  pkg-config \\\n  bison \\\n  flex\n\nRUN git clone --depth 1 https://github.com/VirusTotal/yara.git\nCOPY run_tests.sh build.sh $SRC/\nWORKDIR yara\n"
  },
  {
    "path": "projects/yara/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n./bootstrap.sh\n./configure --enable-macho --enable-debug --enable-dex --enable-dotnet --without-crypto\n\nmake clean\nmake -j$(nproc) all\nmake install\n\nfuzzers=$(find $SRC/yara/tests/oss-fuzz/ -name \"*.cc\")\nfor f in $fuzzers; do\n  fuzzer_name=$(basename -s \".cc\" $f)\n  echo \"Building $fuzzer_name\"\n  $CXX $CXXFLAGS -std=c++11 -I. $f -o $OUT/$fuzzer_name \\\n    ./.libs/libyara.a \\\n    $LIB_FUZZING_ENGINE\n  if [ -d \"$SRC/yara/tests/oss-fuzz/${fuzzer_name}_corpus\" ]; then\n    zip -j $OUT/${fuzzer_name}_seed_corpus.zip $SRC/yara/tests/oss-fuzz/${fuzzer_name}_corpus/*\n  fi\ndone\n\nfind $SRC/yara/tests/oss-fuzz -name \\*.dict -exec cp {} $OUT \\;\nfind $SRC/yara/tests/oss-fuzz -name \\*.options -exec cp {} $OUT \\;\n\n# Build unit test\nmake -j$(nproc) test-alignment test-api test-arena test-async test-atoms test-bitmask test-dex test-dotnet test-elf test-macho test-math test-pe test-re-split test-stack test-string test-version\n"
  },
  {
    "path": "projects/yara/project.yaml",
    "content": "homepage: \"http://virustotal.github.io/yara/\"\nlanguage: c++\nprimary_contact: \"vmalvarez@google.com\"\nauto_ccs:\n  - \"vmalvarez@virustotal.com\"\n  - \"plusvic@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\nmain_repo: 'https://github.com/VirusTotal/yara.git'\n\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/yara/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run unit tests\n./test-alignment && ./test-api && ./test-arena && ./test-async && ./test-atoms && ./test-bitmask && ./test-dex && ./test-dotnet && ./test-elf && ./test-macho && ./test-math && ./test-pe && ./test-re-split && ./test-stack && ./test-string && ./test-version\n"
  },
  {
    "path": "projects/yarl/Dockerfile",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN git clone https://github.com/aio-libs/yarl yarl\nRUN pip3 install --upgrade pip && pip3 install cython\nCOPY *.sh *py $SRC/\nWORKDIR $SRC/yarl\n"
  },
  {
    "path": "projects/yarl/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Use the OSS-Fuzz python\nsed -i 's/python/python3/g' Makefile\n\n# Compile native code with sanitizer flags\nmake cythonize\n\n# Install yarl\npython3 -m pip install .\n\nif [ \"$SANITIZER\" = \"address\" ]\nthen\n  # Enable pysecsan\n  export ENABLE_PYSECSAN=\"1\"\nfi\n\n# Build fuzzers in $OUT.\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/yarl/fuzz_url.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport atheris\nimport yarl\n\n\ndef TestOneInput(data):\n  fdp = atheris.FuzzedDataProvider(data)\n  try:\n    u = yarl.URL(fdp.ConsumeUnicodeNoSurrogates(sys.maxsize))\n  except ValueError:\n    pass\n\ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()\n"
  },
  {
    "path": "projects/yarl/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/aio-libs/yarl\nlanguage: python\nmain_repo: https://github.com/aio-libs/yarl\nsanitizers:\n- address\nvendor_ccs:\n- david@adalogics.com\n"
  },
  {
    "path": "projects/ygot/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-go\nRUN git clone --depth 1 https://github.com/openconfig/ygot\n\nCOPY build.sh $SRC/\nCOPY fuzz.go $SRC/ygot/exampleoc/\nWORKDIR $SRC/ygot\n"
  },
  {
    "path": "projects/ygot/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncompile_go_fuzzer github.com/openconfig/ygot/exampleoc Fuzz fuzz_oc_unmarshall gofuzz\n"
  },
  {
    "path": "projects/ygot/fuzz.go",
    "content": "// +build gofuzz\n\npackage exampleoc\n\nfunc Fuzz(data []byte) int {\n\tnd := &Device{}\n\terr := Unmarshal([]byte(data), nd)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn 1\n}\n"
  },
  {
    "path": "projects/ygot/project.yaml",
    "content": "homepage: \"https://github.com/openconfig/ygot\"\nprimary_contact: \"ygot-maintainers@google.com\"\nauto_ccs:\n  - \"p.antoine@catenacyber.fr\"\nlanguage: go\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\nmain_repo: 'https://github.com/openconfig/ygot'\n"
  },
  {
    "path": "projects/yoga/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake ninja-build\nRUN git clone --depth 1 https://github.com/facebook/yoga.git yoga\nWORKDIR yoga\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/yoga/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\ncmake -B build -S . -D BUILD_FUZZ_TESTS=ON -Dcxx_no_rtti=OFF -D CMAKE_BUILD_TYPE=\"Release\" -G Ninja\ncmake --build build --target fuzz_layout\n\ncp ./build/fuzz/fuzz_layout $OUT/\n"
  },
  {
    "path": "projects/yoga/project.yaml",
    "content": "homepage: \"https://yogalayout.dev/\"\nlanguage: c++\nprimary_contact: \"ngerlem@meta.com\"\n\nauto_ccs:\n  - \"nathaniel.brough@gmail.com\"\n  - \"oss-fuzz@meta.com\"\n  \nmain_repo: \"https://github.com/facebook/yoga\"\n\nsanitizers:\n  - address\n  - memory\n"
  },
  {
    "path": "projects/yoga/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nASAN_OPTIONS=\"detect_leaks=0\" ./unit_tests\n"
  },
  {
    "path": "projects/zeek/Dockerfile",
    "content": "# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n        patchelf \\\n        cmake \\\n        ninja-build \\\n        flex \\\n        bison \\\n        libfl-dev \\\n        libpcap-dev \\\n        libssl-dev \\\n        libmaxminddb-dev \\\n        libkrb5-dev \\\n        zlib1g-dev \\\n  && rm -rf /var/lib/apt/lists/*\n\nRUN git clone --depth 1 --recursive https://github.com/zeek/zeek zeek\nWORKDIR zeek\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/zeek/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2020 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nCFLAGS=\"${CFLAGS} -pthread\" CXXFLAGS=\"${CXXFLAGS} -pthread\" \\\n    ./configure --prefix=$(pwd)/build/install-root \\\n                --build-type=debug \\\n                --generator=Ninja \\\n                --enable-fuzzers \\\n                --disable-python \\\n                --disable-zeekctl \\\n                --disable-auxtools \\\n                --disable-broker-tests\n\ncd build\nninja install\n\ncp -R ./install-root/share/zeek ${OUT}/oss-fuzz-zeek-scripts\n\nfuzzers=$(find . -name 'zeek-*-fuzzer')\nfuzzer_count=1\n\nfunction copy_lib\n    {\n    local fuzzer_path=$1\n    local lib=$2\n    cp $(ldd ${fuzzer_path} | grep \"${lib}\" | awk '{ print $3 }') ${OUT}/lib\n    }\n\nfor f in ${fuzzers}; do\n    fuzzer_exe=$(basename ${f})\n    fuzzer_name=$(echo ${fuzzer_exe} | sed 's/zeek-\\(.*\\)-fuzzer/\\1/g')\n\n    cp ${f} ${OUT}/\n\n    # Set up run-time dependency libraries\n    if [[ \"${fuzzer_count}\" -eq \"1\" ]]; then\n        mkdir -p ${OUT}/lib\n        zeek_libs=$(ldd ${f} | grep 'zeek/build' | awk '{ print $1 }' )\n\n        for lib in ${zeek_libs}; do\n            copy_lib ${f} ${lib}\n        done\n\n        copy_lib ${f} libpcap\n        copy_lib ${f} libssl\n        copy_lib ${f} libcrypto\n        copy_lib ${f} libz\n        copy_lib ${f} libmaxminddb\n    fi\n\n    patchelf --set-rpath '$ORIGIN/lib' ${OUT}/${fuzzer_exe}\n\n    if [[ -e ../src/fuzzers/${fuzzer_name}.dict ]]; then\n        cp ../src/fuzzers/${fuzzer_name}.dict ${OUT}/${fuzzer_exe}.dict\n    fi\n\n    if [[ -e ../src/fuzzers/corpora/${fuzzer_name}-corpus.zip ]]; then\n        cp ../src/fuzzers/corpora/${fuzzer_name}-corpus.zip ${OUT}/${fuzzer_exe}_seed_corpus.zip\n    fi\n\n    fuzzer_count=$((fuzzer_count + 1))\ndone\n\nif [ \"${SANITIZER}\" = \"coverage\" ]; then\n  # Normally, base-builder/compile copies sources for use in coverage reports,\n  # but its use of `cp -rL` omits the \"zeek -> .\" symlink used by #includes,\n  # causing the coverage build to fail.\n  mkdir -p $OUT/$(basename $SRC)\n  cp -r $SRC/zeek $OUT/$(basename $SRC)/zeek\n\n  # Replace the 3rdpary/ghc symlink in the ./build directory with the\n  # actual contents. The symlink otherwise points into the /src directory.\n  if [ -L ${OUT}/$(basename $SRC)/zeek/build/zeek/3rdparty/ghc ]; then\n    rm ${OUT}/$(basename $SRC)/zeek/build/zeek/3rdparty/ghc\n    cp -r $SRC/zeek/auxil/filesystem/include/ghc ${OUT}/$(basename $SRC)/zeek/build/zeek/3rdparty/\n  fi\nfi\n"
  },
  {
    "path": "projects/zeek/project.yaml",
    "content": "homepage: \"https://www.zeek.org\"\nlanguage: c++\nprimary_contact: \"security@zeek.org\"\nauto_ccs:\n  - \"robin@corelight.com\"\n  - \"johanna@corelight.com\"\n  - \"tim@corelight.com\"\n  - \"seth@corelight.com\"\n  - \"justin@corelight.com\"\n  - \"vern@corelight.com\"\n  - \"dominik.charousset@corelight.com\"\n  - \"christian@corelight.com\"\n  - \"arne.welzel@corelight.com\"\n  - \"benjamin.bannier@corelight.com\"\n  - \"evan.typanski@corelight.com\"\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\nsanitizers:\n  - address\nmain_repo: 'https://github.com/zeek/zeek'\ncoverage_extra_args: >\n  -ignore-filename-regex=src/3rdparty/.*\n  -ignore-filename-regex=build/zeek/3rdparty/.*\n  -ignore-filename-regex=auxil/.*\n"
  },
  {
    "path": "projects/zip/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y cmake make\n\nRUN git clone --depth 1 https://github.com/kuba--/zip.git zip \\\n        && cp zip/fuzz/build.sh $SRC/\nWORKDIR zip\nCOPY run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/zip/project.yaml",
    "content": "homepage: \"https://github.com/kuba--/zip\"\nlanguage: c\nprimary_contact: \"capuanobailey@gmail.com\"\nmain_repo: \"https://github.com/kuba--/zip.git\"\nfuzzing_engines:\n    - libfuzzer\n    - afl\n    - honggfuzz\n"
  },
  {
    "path": "projects/zip/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build\n"
  },
  {
    "path": "projects/zip-rs/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\nENV RUSTUP_TOOLCHAIN nightly-2025-07-16\nRUN git clone --depth 1 https://github.com/zip-rs/zip\nCOPY fuzz $SRC/zip/fuzz\nWORKDIR $SRC\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/zip-rs/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ncd $SRC/zip\ncargo fuzz build -O --debug-assertions\n\nfor file in tests/data/*.zip\ndo\n  mv \"$file\" \"${file%.zip}_zip\"\ndone\n\nzip from_zip_seed_corpus.zip tests/data/*_zip\ncp from_zip_seed_corpus.zip structured_fuzz_reader_seed_corpus.zip\n\ncp fuzz/target/x86_64-unknown-linux-gnu/release/from_zip $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/structured_fuzz_reader $OUT/\ncp fuzz/target/x86_64-unknown-linux-gnu/release/roundtrip $OUT/\n"
  },
  {
    "path": "projects/zip-rs/fuzz/Cargo.toml",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n####################\n\n[package]\nname = \"zip-fuzz\"\nversion = \"0.0.0\"\nauthors = [\"David Korczynski <david@adalogics.com>\"]\npublish = false\nedition = \"2018\"\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies]\nlibfuzzer-sys = \"0.4.6\"\nzip = { path = \"..\" }\narbitrary = { version = \"1\", features = [\"derive\"] }\n\n# Prevent this from interfering with workspaces\n[workspace]\n\n[[bin]]\nname = \"from_zip\"\npath = \"fuzz_targets/fuzz_zip.rs\"\n\n[[bin]]\nname = \"roundtrip\"\npath = \"fuzz_targets/roundtrip.rs\"\ntest = false\ndoc = false\n\n[[bin]]\nname = \"structured_fuzz_reader\"\npath = \"fuzz_targets/structured_fuzz_reader.rs\"\ntest = false\ndoc = false\n"
  },
  {
    "path": "projects/zip-rs/fuzz/fuzz_targets/fuzz_zip.rs",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n//limitations under the License.\n//\n//###################\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\nuse std::io::Cursor;\nuse zip;\n\nfuzz_target!(|data: &[u8]| {\n    match zip::ZipArchive::new(Cursor::new(data)) {\n        Ok(archive) => {\n            for _ in 0..archive.len() {\n                let comment = archive.comment();\n                if !comment.is_empty() {}\n            }\n        }\n        Err(_) => return,\n    }\n});\n"
  },
  {
    "path": "projects/zip-rs/fuzz/fuzz_targets/roundtrip.rs",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n//limitations under the License.\n//\n//###################\n#![no_main]\n\nuse arbitrary::{self, Arbitrary, Unstructured};\nuse libfuzzer_sys::fuzz_target;\nuse std::hint::black_box;\nuse zip::{self, result::ZipError};\n\nfn arbitrary_unix_permissions(u: &mut Unstructured) -> arbitrary::Result<u32> {\n    return Ok(u.int_in_range(0o1..=0o777)?);\n}\n\n// Generate a valid arbitrary path.\nfn arbitrary_path(u: &mut Unstructured) -> arbitrary::Result<String> {\n    let path_len: usize = u.int_in_range(1..=512).unwrap_or(1);\n    Ok((0..=path_len)\n        .map(|_| {\n            let valid_chars: Vec<char> = ('a'..='z')\n                .chain('A'..='Z')\n                .chain(\"/-_.@\".chars())\n                .collect();\n            return valid_chars[u.choose_index(valid_chars.len()).unwrap_or(0)];\n        })\n        .collect())\n}\n\n#[derive(Debug, Clone, PartialEq)]\nstruct Compression {\n    method: zip::CompressionMethod,\n    level: Option<i32>,\n}\n\nimpl<'a> Arbitrary<'a> for Compression {\n    fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {\n        use zip::CompressionMethod::*;\n        Ok(match u8::arbitrary(u) {\n            Ok(1) => Compression {\n                method: Stored,\n                level: u.int_in_range(0..=9).ok(),\n            },\n            Ok(2) => Compression {\n                method: Deflated,\n                level: u.int_in_range(0..=9).ok(),\n            },\n            Ok(3) => Compression {\n                method: Bzip2,\n                level: u.int_in_range(1..=9).ok(),\n            },\n            _ => Compression {\n                method: Zstd,\n                level: u.int_in_range(-7..=22).ok(),\n            },\n        })\n    }\n}\n\nfn arbitrary_file(u: &mut Unstructured) -> arbitrary::Result<Vec<u8>> {\n    let file = Vec::<u8>::arbitrary(u)?;\n    if file.len() == 0 {\n        return Err(arbitrary::Error::IncorrectFormat);\n    }\n    return Ok(file);\n}\n\n#[derive(Arbitrary, Clone, Debug, PartialEq)]\nstruct File {\n    #[arbitrary(with = arbitrary_path)]\n    zip_path: String,\n    #[arbitrary(with = arbitrary_file)]\n    contents: Vec<u8>,\n    compression: Compression,\n    alignment: Option<u16>,\n    large_file: bool,\n    #[arbitrary(with = arbitrary_unix_permissions)]\n    unix_permissions: u32,\n}\n\n#[derive(Arbitrary, Clone, Debug, PartialEq)]\nenum ZipEntry<'a> {\n    File(File),\n    RawComment(&'a [u8]),\n    Comment(String),\n    Symlink {\n        #[arbitrary(with = arbitrary_path)]\n        src: String,\n        #[arbitrary(with = arbitrary_path)]\n        dst: String,\n    },\n    Directory {\n        #[arbitrary(with = arbitrary_path)]\n        path: String,\n    },\n}\n\nimpl<'a> ZipEntry<'a> {\n    fn path(&self) -> Option<String> {\n        match self {\n            ZipEntry::File(file) => Some(file.zip_path.clone()),\n            ZipEntry::Symlink { dst, .. } => Some(dst.clone()),\n            ZipEntry::Directory { path } => Some(path.clone()),\n            _ => None,\n        }\n    }\n}\n\n#[derive(Debug, PartialEq)]\nstruct Operations<'a> {\n    zip_entries: Vec<ZipEntry<'a>>,\n}\n\nimpl<'a> Arbitrary<'a> for Operations<'a> {\n    fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {\n        let zip_entries = Vec::<ZipEntry>::arbitrary(u)?;\n        let mut paths = std::collections::HashSet::new();\n        let mut result = Vec::new();\n        for zip_entry in zip_entries.iter() {\n            if let Some(path) = zip_entry.path() {\n                if paths.contains(&path) {\n                    continue;\n                } else {\n                    result.push(zip_entry.clone());\n                    paths.insert(path.clone());\n                }\n            } else {\n                result.push(zip_entry.clone());\n            }\n        }\n        return Ok(Operations {\n            zip_entries: result,\n        });\n    }\n}\n\nfn build_zip(zip_entries: &Vec<ZipEntry>) -> Result<Vec<u8>, ZipError> {\n    use std::io::Write;\n    use zip::write::FileOptions;\n\n    // 1mB\n    let max_zip_size = 1024 * 1024 * 1;\n    let mut buf = vec![0; max_zip_size];\n    let mut zip = zip::ZipWriter::new(std::io::Cursor::new(&mut buf[..]));\n\n    let mut created_paths = std::collections::HashSet::new();\n    for entry in zip_entries.iter() {\n        use ZipEntry::*;\n        match entry {\n            File(file) => {\n                if created_paths.contains(&file.zip_path) {\n                    continue;\n                } else {\n                    created_paths.insert(file.zip_path.clone());\n                }\n                let options = FileOptions::default()\n                    .compression_method(file.compression.method)\n                    .compression_level(file.compression.level)\n                    .large_file(file.large_file)\n                    .unix_permissions(file.unix_permissions);\n                if let Some(alignment) = file.alignment {\n                    zip.start_file_aligned(file.zip_path.clone(), options, alignment)?;\n                } else {\n                    zip.start_file(file.zip_path.clone(), options)?;\n                }\n\n                zip.write(&file.contents)?;\n            }\n            RawComment(comment) => zip.set_raw_comment(comment.to_vec()),\n            Comment(comment) => zip.set_comment(comment),\n            Symlink { src, dst } => {\n                if created_paths.contains(dst) {\n                    continue;\n                } else {\n                    created_paths.insert(dst.clone());\n                }\n                let options = FileOptions::default();\n                zip.add_symlink(dst, src, options)?;\n            }\n            Directory { path } => {\n                if created_paths.contains(path) {\n                    continue;\n                } else {\n                    created_paths.insert(path.clone());\n                }\n                let options = FileOptions::default();\n                zip.add_directory(path, options)?;\n            }\n        }\n    }\n\n    return Ok(zip.finish()?.get_ref().to_vec());\n}\n\nfuzz_target!(|operations: Operations| {\n    match build_zip(&operations.zip_entries) {\n        Ok(compressed) => match zip::ZipArchive::new(std::io::Cursor::new(compressed)) {\n            Ok(mut archive) => {\n                for i in 0..archive.len() {\n                    let mut file = archive\n                        .by_index(i)\n                        .expect(\"This was a generated zip it should be valid.\");\n                    let _ = std::io::copy(&mut file, &mut std::io::sink());\n                }\n            }\n            Err(e) => {\n                let _unused = black_box(format!(\"{e:?}\"));\n                let _unused = black_box(format!(\"{e:#?}\"));\n            }\n        },\n        Err(e) => {\n            let _unused = black_box(format!(\"{e:?}\"));\n            let _unused = black_box(format!(\"{e:#?}\"));\n        }\n    }\n});\n"
  },
  {
    "path": "projects/zip-rs/fuzz/fuzz_targets/structured_fuzz_reader.rs",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n//limitations under the License.\n//\n//###################\n\n#![no_main]\n\nuse arbitrary::Arbitrary;\nuse libfuzzer_sys::fuzz_target;\nuse std::hint::black_box;\nuse std::io::Cursor;\n\n#[derive(Arbitrary, Debug)]\nenum ReadOperations<'a> {\n    ReadByName(String),\n    ReadByNameDecrypt { name: String, password: &'a [u8] },\n    ReadByIterableNames,\n    ReadByIndex(usize),\n    ReadByIndexDecrypt { index: usize, password: &'a [u8] },\n    ReadByIterableIndicies,\n    ReadComment,\n}\n\n#[derive(Arbitrary, Debug)]\n#[repr(C)]\nstruct Driver<'a> {\n    // NOTE: we are defining repr(C) so that the struct field ordering is consistent.\n    // This consistent ordering means that we still generate a set of zip files\n    // for the fuzz corpus, which will become the .zip_file, and any leftover data\n    // will be used for structured fuzzing.\n    zip_file: &'a [u8],\n    read_operations: Vec<ReadOperations<'a>>,\n}\n\nfn read_file_attributes(file: &mut zip::read::ZipFile) -> Result<(), zip::result::ZipError> {\n    use std::io::Read;\n    let _unused = black_box(file.name());\n    let _unused = black_box(file.mangled_name());\n    let _unused = black_box(file.enclosed_name());\n    let _unused = black_box(file.compression());\n    let _unused = black_box(file.compressed_size());\n    let _unused = black_box(file.size());\n    let _unused = black_box(file.last_modified());\n    let _unused = black_box(file.is_dir());\n    let _unused = black_box(file.is_file());\n    let _unused = black_box(file.unix_mode());\n    let _unused = black_box(file.crc32());\n    let _unused = black_box(file.data_start());\n    let _unused = black_box(file.header_start());\n    let _unused = black_box(file.central_header_start());\n    let mut s: String = String::new();\n    let _unused = black_box(file.read_to_string(&mut s));\n    return Ok(());\n}\n\nfn fuzzed_extract(driver: Driver) -> Result<(), zip::result::ZipError> {\n    match zip::ZipArchive::new(Cursor::new(driver.zip_file)) {\n        Ok(mut archive) => {\n            for operation in driver.read_operations.iter() {\n                match operation {\n                    ReadOperations::ReadByName(name) => {\n                        let mut file = archive.by_name(name)?;\n                        let _unused = black_box(read_file_attributes(&mut file));\n                    }\n                    // TODO: This could probably use a custom mutator, or a specialised seed corpus.\n                    // The probability that the fuzzer guesses the correct password is exceedingly low.\n                    ReadOperations::ReadByNameDecrypt { name, password } => {\n                        match archive.by_name_decrypt(name, password)? {\n                            Ok(mut file) => {\n                                let _unused = black_box(&read_file_attributes(&mut file));\n                            }\n                            Err(e) => {\n                                let _unused = black_box(format!(\"{e:?}\"));\n                                let _unused = black_box(format!(\"{e:#?}\"));\n                            }\n                        }\n                    }\n                    ReadOperations::ReadByIterableNames => {\n                        let names: Vec<String> =\n                            archive.file_names().map(|x| x.to_string()).collect();\n                        for name in names.iter() {\n                            let mut file = archive.by_name(&name)?;\n                            let _unused = black_box(read_file_attributes(&mut file));\n                        }\n                    }\n                    ReadOperations::ReadByIndex(index) => {\n                        let mut file = archive.by_index(*index)?;\n                        let _unused = black_box(read_file_attributes(&mut file));\n                    }\n                    ReadOperations::ReadByIndexDecrypt { index, password } => {\n                        match archive.by_index_decrypt(*index, password)? {\n                            Ok(mut file) => {\n                                let _unused = black_box(read_file_attributes(&mut file));\n                            }\n                            Err(e) => {\n                                let _unused = black_box(format!(\"{e:?}\"));\n                                let _unused = black_box(format!(\"{e:#?}\"));\n                            }\n                        }\n                    }\n                    ReadOperations::ReadByIterableIndicies => {\n                        for i in 0..archive.len() {\n                            let mut file = archive.by_index(i)?;\n                            let _unused = black_box(read_file_attributes(&mut file));\n                        }\n                    }\n                    ReadOperations::ReadComment => {\n                        let _unused = black_box(archive.comment());\n                    }\n                }\n            }\n        }\n        Err(e) => return Err(e),\n    }\n    return Ok(());\n}\n\nfuzz_target!(|driver: Driver| {\n    if let Err(e) = fuzzed_extract(driver) {\n        let _unused = black_box(format!(\"{e:?}\"));\n        let _unused = black_box(format!(\"{e:#?}\"));\n    }\n});\n"
  },
  {
    "path": "projects/zip-rs/project.yaml",
    "content": "homepage: \"https://github.com/zip-rs/zip\"\nmain_repo: \"https://github.com/zip-rs/zip\"\nprimary_contact: \"marli@frost.red\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/zip4j/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.8.7/bin/mvn\n\n# Dict\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    mv fuzzing/dictionaries/zip.dict $SRC/Zip4jFuzzer.dict && \\\n    rm -rf fuzzing\n\n# Seeds\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/Zip4jFuzzer_seed_corpus.zip go-fuzz-corpus/zip/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\nRUN git clone --depth 1 https://github.com/srikanth-lingala/zip4j.git zip4j\n\nCOPY build.sh $SRC/\nCOPY Zip4jFuzzer.java $SRC/\nWORKDIR $SRC/zip4j\n"
  },
  {
    "path": "projects/zip4j/Zip4jFuzzer.java",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\n\nimport java.util.List;\n\nimport net.lingala.zip4j.io.inputstream.ZipInputStream;\nimport net.lingala.zip4j.model.LocalFileHeader;\nimport net.lingala.zip4j.model.ExtraDataRecord;\nimport net.lingala.zip4j.model.AESExtraDataRecord;\nimport net.lingala.zip4j.model.enums.CompressionMethod;\nimport net.lingala.zip4j.model.enums.EncryptionMethod;\nimport net.lingala.zip4j.model.Zip64ExtendedInfo;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic class Zip4jFuzzer {\n\tpublic static void fuzzerTestOneInput(FuzzedDataProvider data) {\n\n\t\tZipInputStream v0 = null;\n\t\tLocalFileHeader v1 = null;\n\t\tAESExtraDataRecord v2 = null;\n\t\tCompressionMethod v3 = null;\n\t\tEncryptionMethod v4 = null;\n\t\tList<ExtraDataRecord> v5 = null;\n\t\tZip64ExtendedInfo v6 = null;\n\n\t\ttry {\n\t\t\tv0 = new ZipInputStream(new ByteArrayInputStream(data.consumeRemainingAsBytes()));\n\n\t\t\tif (v0 != null) {\n\n\t\t\t\twhile (true) {\n\n\t\t\t\t\tv1 = v0.getNextEntry();\n\t\t\t\t\tif (v1 ==  null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tv1.isDirectory();\n\t\t\t\t\t\tv1.isEncrypted();\n\n\t\t\t\t\t\tv2 = v1.getAesExtraDataRecord();\n\t\t\t\t\t\tif (v2 != null) {\n\t\t\t\t\t\t\tv2.getCompressionMethod();\n\t\t\t\t\t\t\tv2.getDataSize();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tv3 = v1.getCompressionMethod();\n\t\t\t\t\t\tif (v3 != null) {\n\t\t\t\t\t\t\tv3.getCode();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tv4 = v1.getEncryptionMethod();\n\t\t\t\t\t\tv5 = v1.getExtraDataRecords();\n\t\t\t\t\t\tif (v5 != null) {\n\t\t\t\t\t\t\tfor (ExtraDataRecord v7 : v5) {\n\t\t\t\t\t\t\t\tv7.getData();\n\t\t\t\t\t\t\t\tv7.getHeader();\n\t\t\t\t\t\t\t\tv7.getSizeOfData();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tv6 = v1.getZip64ExtendedInfo();\n\t\t\t\t\t\tif (v6 != null) {\n\t\t\t\t\t\t\tv6.getCompressedSize();\n\t\t\t\t\t\t\tv6.getUncompressedSize();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "projects/zip4j/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmv $SRC/{*.zip,*.dict} $OUT\n\nMAVEN_ARGS=\"-Dmaven.test.skip=true -Djavac.src.version=15 -Djavac.target.version=15\"\nMAVEN_ARGS=$MAVEN_ARGS\" -Dmaven.wagon.httpconnectionManager.ttlSeconds=120\"\nMAVEN_ARGS=$MAVEN_ARGS\" -Dmaven.wagon.http.retryHandler.requestSentEnabled=true\"\nMAVEN_ARGS=$MAVEN_ARGS\" -Dmaven.wagon.http.retryHandler.count=5\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"target/zip4j-$CURRENT_VERSION.jar\" $OUT/zip4j.jar\n\nALL_JARS=\"zip4j.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/zip4j/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: http://www.lingala.net/zip4j.html\nlanguage: jvm\nmain_repo: https://github.com/srikanth-lingala/zip4j.git\nsanitizers:\n- address\nvendor_ccs:\n- srikanth.mailbox@gmail.com\n- all.u.ever.know@gmail.com\n"
  },
  {
    "path": "projects/zipp/Dockerfile",
    "content": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-python\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/jaraco/zipp zipp\nWORKDIR zipp\nCOPY build.sh *.py $SRC/\n"
  },
  {
    "path": "projects/zipp/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\npip3 install .\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone\n"
  },
  {
    "path": "projects/zipp/fuzz_zipp.py",
    "content": "#!/usr/bin/python3\n# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport atheris\n\nimport zipp\nimport zipfile\nimport io\n\n\ndef gen_path(fdp):\n    \"\"\"Generate a string with maximum 4 instances of /\"\"\"\n    s1 = fdp.ConsumeUnicodeNoSurrogates(15)\n    while s1.count(\"/\") > 4:\n        # Replace the first occurrence of /\n        s1 = s1.replace(\"/\", \"a\", 1)\n    return s1\n\n\ndef build_fixture(fdp):\n    \"\"\"Generate a random zip structure\"\"\"\n    data = io.BytesIO()\n    zf = zipfile.ZipFile(data, \"w\")\n    number_of_entries = fdp.ConsumeIntInRange(2, 10)\n    for i in range(number_of_entries):\n        zf.writestr(gen_path(fdp), fdp.ConsumeBytes(20))\n    zf.filename = \"fuzzGen.zip\"\n    return zf\n\n\ndef TestOneInput(data):\n    fdp = atheris.FuzzedDataProvider(data)\n    try:\n        zf = build_fixture(fdp)\n    except:\n        # On any issue we return\n        return\n\n    root = zipp.Path(zf)\n    for elem in root.iterdir():\n        # perform simple operations on the elem\n        elem.is_dir()\n        elem.is_file()\n\n\ndef main():\n    atheris.instrument_all()\n    atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "projects/zipp/project.yaml",
    "content": "fuzzing_engines:\n- libfuzzer\nhomepage: https://github.com/jaraco/zipp\nlanguage: python\nmain_repo: https://github.com/jaraco/zipp\nsanitizers:\n- address\n- undefined\nvendor_ccs:\n- david@adalogics.com\n- adam@adalogics.com\n"
  },
  {
    "path": "projects/zlib/Dockerfile",
    "content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 -b develop https://github.com/madler/zlib.git\nWORKDIR zlib\nCOPY run_tests.sh build.sh *_fuzzer.c* $SRC/\n"
  },
  {
    "path": "projects/zlib/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nif ! ./configure; then\n    cat configure.log\n    exit 1\nfi\n\nmake -j$(nproc) clean\nmake -j$(nproc) all\n\n# Skip make check for memory sanitizer - zlib's tests have uninitialized memory issues\nif [ \"$SANITIZER\" != \"memory\" ]; then\n    make -j$(nproc) check\nfi\n\nfor f in $(find $SRC -name '*_fuzzer.cc'); do\n    b=$(basename -s .cc $f)\n    $CXX $CXXFLAGS -std=c++11 -I. $f -o $OUT/$b $LIB_FUZZING_ENGINE ./libz.a\ndone\n\nzip $OUT/seed_corpus.zip *.*\n\nfor f in $(find $SRC -name '*_fuzzer.c'); do\n    b=$(basename -s .c $f)\n    $CC $CFLAGS -I. $f -c -o /tmp/$b.o\n    $CXX $CXXFLAGS -o $OUT/$b /tmp/$b.o -stdlib=libc++ $LIB_FUZZING_ENGINE ./libz.a\n    rm -f /tmp/$b.o\n    ln -sf $OUT/seed_corpus.zip $OUT/${b}_seed_corpus.zip\ndone\n"
  },
  {
    "path": "projects/zlib/checksum_fuzzer.c",
    "content": "#include <stdio.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <inttypes.h>\n#include \"zlib.h\"\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen) {\n  uint32_t crc0 = crc32(0L, NULL, 0);\n  uint32_t crc1 = crc0;\n  uint32_t crc2 = crc0;\n  uint32_t adler0 = adler32(0L, NULL, 0);\n  uint32_t adler1 = adler0;\n  uint32_t adler2 = adler0;\n  /* Checksum with a buffer of size equal to the first byte in the input. */\n  uint32_t buffSize = data[0];\n  uint32_t offset = 0;\n  uint32_t op;\n\n  /* Discard inputs larger than 1Mb. */\n  static size_t kMaxSize = 1024 * 1024;\n  if (dataLen < 1 || dataLen > kMaxSize)\n    return 0;\n\n  /* Make sure the buffer has at least a byte. */\n  if (buffSize == 0)\n    ++buffSize;\n\n  /* CRC32 */\n  op = crc32_combine_gen(buffSize);\n  for (offset = 0; offset + buffSize <= dataLen; offset += buffSize) {\n    uint32_t crc3 = crc32_z(crc0, data + offset, buffSize);\n    uint32_t crc4 = crc32_combine_op(crc1, crc3, op);\n    crc1 = crc32_z(crc1, data + offset, buffSize);\n    assert(crc1 == crc4);\n  }\n  crc1 = crc32_z(crc1, data + offset, dataLen % buffSize);\n\n  crc2 = crc32(crc2, data, (uint32_t) dataLen);\n\n  assert(crc1 == crc2);\n  assert(crc32_combine(crc1, crc2, dataLen) ==\n         crc32_combine(crc1, crc1, dataLen));\n\n  /* Fast CRC32 combine. */\n  op = crc32_combine_gen(dataLen);\n  assert(crc32_combine_op(crc1, crc2, op) ==\n         crc32_combine_op(crc2, crc1, op));\n  assert(crc32_combine(crc1, crc2, dataLen) ==\n         crc32_combine_op(crc2, crc1, op));\n\n  /* Adler32 */\n  for (offset = 0; offset + buffSize <= dataLen; offset += buffSize)\n    adler1 = adler32_z(adler1, data + offset, buffSize);\n  adler1 = adler32_z(adler1, data + offset, dataLen % buffSize);\n\n  adler2 = adler32(adler2, data, (uint32_t) dataLen);\n\n  assert(adler1 == adler2);\n  assert(adler32_combine(adler1, adler2, dataLen) ==\n         adler32_combine(adler1, adler1, dataLen));\n\n  /* This function must return 0. */\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/compress_fuzzer.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <inttypes.h>\n#include \"zlib.h\"\n\nstatic const uint8_t *data;\nstatic size_t dataLen;\n\nstatic void check_compress_level(uint8_t *compr, size_t comprLen,\n                                 uint8_t *uncompr, size_t uncomprLen,\n                                 int level) {\n  compress2(compr, &comprLen, data, dataLen, level);\n  uncompress(uncompr, &uncomprLen, compr, comprLen);\n\n  /* Make sure compress + uncompress gives back the input data. */\n  assert(dataLen == uncomprLen);\n  assert(0 == memcmp(data, uncompr, dataLen));\n}\n\n#define put_byte(s, i, c) {s[i] = (unsigned char)(c);}\n\nstatic void write_zlib_header(uint8_t *s, unsigned compression_method, unsigned flags) {\n  unsigned int header = (Z_DEFLATED + ((flags)<<4)) << 8;\n  header |= (compression_method << 6);\n\n  header += 31 - (header % 31);\n\n  /* s is guaranteed to be longer than 2 bytes. */\n  put_byte(s, 0, (unsigned char)(header >> 8));\n  put_byte(s, 1, (unsigned char)(header & 0xff));\n}\n\nstatic void check_decompress(uint8_t *compr, size_t comprLen, unsigned compression_method, unsigned flags) {\n  /* We need to write a valid zlib header of size two bytes. Copy the input data\n     in a larger buffer. Do not modify the input data to avoid libFuzzer error:\n     fuzz target overwrites its const input. */\n  size_t copyLen = dataLen + 2;\n  uint8_t *copy = (uint8_t *)malloc(copyLen);\n  memcpy(copy + 2, data, dataLen);\n  write_zlib_header(copy, compression_method, flags);\n\n  uncompress(compr, &comprLen, copy, copyLen);\n  free(copy);\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {\n  if (size < 10 || size > 1024 * 1024)\n    return 0;\n\n  const int level = d[0] % 10;\n  d++,size--;\n\n  //https://web.archive.org/web/20200220015003/http://www.onicos.com/staff/iz/formats/gzip.html\n  unsigned compression_method = d[0] % 5;\n  if (compression_method == 4)  //[4...7] are reserved\n    compression_method = 8;\n  d++,size--;\n  unsigned flags = d[0] & (2 << 4);\n  d++,size--;\n\n  size_t comprLen = compressBound(size);\n  size_t uncomprLen = size;\n  uint8_t *compr = NULL, *uncompr = NULL;\n\n  data = d;\n  dataLen = size;\n  compr = (uint8_t *)calloc(1, comprLen);\n  if (!compr)\n    goto err;\n  uncompr = (uint8_t *)calloc(1, uncomprLen);\n  if (!uncompr)\n    goto err;\n\n  check_compress_level(compr, comprLen, uncompr, uncomprLen, level);\n  check_decompress(compr, comprLen, compression_method, flags);\n\nerr:\n  free(compr);\n  free(uncompr);\n\n  /* This function must return 0. */\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/example_dict_fuzzer.c",
    "content": "#include <stdio.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <inttypes.h>\n#include \"zlib.h\"\n\n#define CHECK_ERR(err, msg) { \\\n    if (err != Z_OK) { \\\n        fprintf(stderr, \"%s error: %d\\n\", msg, err); \\\n        return 0; \\\n    } \\\n}\n\nstatic const uint8_t *data;\nstatic size_t dataLen;\nstatic alloc_func zalloc = NULL;\nstatic free_func zfree = NULL;\nstatic size_t dictionaryLen = 0;\nstatic unsigned long dictId; /* Adler32 value of the dictionary */\n\n/* ===========================================================================\n * Test deflate() with preset dictionary\n */\nint test_dict_deflate(unsigned char **compr, size_t *comprLen)\n{\n    z_stream c_stream; /* compression stream */\n    int err;\n    int level = data[0] % 11 - 1; /* [-1..9]\n      compression levels\n      #define Z_NO_COMPRESSION         0\n      #define Z_BEST_SPEED             1\n      #define Z_BEST_COMPRESSION       9\n      #define Z_DEFAULT_COMPRESSION  (-1) */\n\n    int method = Z_DEFLATED; /* The deflate compression method (the only one\n                                supported in this version) */\n    int windowBits = 8 + data[0] % 8; /* The windowBits parameter is the base\n      two logarithm of the window size (the size of the history buffer).  It\n      should be in the range 8..15 for this version of the library. */\n    int memLevel = 1 + data[0] % 9;   /* memLevel=1 uses minimum memory but is\n      slow and reduces compression ratio; memLevel=9 uses maximum memory for\n      optimal speed. */\n    int strategy = data[0] % 5;       /* [0..4]\n      #define Z_FILTERED            1\n      #define Z_HUFFMAN_ONLY        2\n      #define Z_RLE                 3\n      #define Z_FIXED               4\n      #define Z_DEFAULT_STRATEGY    0 */\n\n    /* deflate would fail for no-compression or for speed levels. */\n    if (level == 0 || level == 1)\n      level = -1;\n\n    c_stream.zalloc = zalloc;\n    c_stream.zfree = zfree;\n    c_stream.opaque = (void *)0;\n\n    err = deflateInit2(&c_stream, level, method, windowBits, memLevel, strategy);\n    CHECK_ERR(err, \"deflateInit\");\n\n    err = deflateSetDictionary(\n        &c_stream, (const unsigned char *)data, dictionaryLen);\n    CHECK_ERR(err, \"deflateSetDictionary\");\n\n    /* deflateBound does not provide enough space for low compression levels. */\n    *comprLen = 100 + 2 * deflateBound(&c_stream, dataLen);\n    *compr = (uint8_t *)calloc(1, *comprLen);\n\n    dictId = c_stream.adler;\n    c_stream.next_out = *compr;\n    c_stream.avail_out = (unsigned int)(*comprLen);\n\n    c_stream.next_in = (Bytef *)data;\n    c_stream.avail_in = dataLen;\n\n    err = deflate(&c_stream, Z_FINISH);\n    if (err != Z_STREAM_END) {\n        fprintf(stderr, \"deflate dict should report Z_STREAM_END\\n\");\n        return 0;\n    }\n    err = deflateEnd(&c_stream);\n    CHECK_ERR(err, \"deflateEnd\");\n    return 0;\n}\n\n/* ===========================================================================\n * Test inflate() with a preset dictionary\n */\nint test_dict_inflate(unsigned char *compr, size_t comprLen) {\n  int err;\n  z_stream d_stream; /* decompression stream */\n  unsigned char *uncompr;\n\n  d_stream.zalloc = zalloc;\n  d_stream.zfree = zfree;\n  d_stream.opaque = (void *)0;\n\n  d_stream.next_in = compr;\n  d_stream.avail_in = (unsigned int)comprLen;\n\n  err = inflateInit(&d_stream);\n  CHECK_ERR(err, \"inflateInit\");\n\n  uncompr = (uint8_t *)calloc(1, dataLen);\n  d_stream.next_out = uncompr;\n  d_stream.avail_out = (unsigned int)dataLen;\n\n  for (;;) {\n    err = inflate(&d_stream, Z_NO_FLUSH);\n    if (err == Z_STREAM_END)\n      break;\n    if (err == Z_NEED_DICT) {\n      if (d_stream.adler != dictId) {\n        fprintf(stderr, \"unexpected dictionary\");\n        return 0;\n      }\n      err = inflateSetDictionary(\n          &d_stream, (const unsigned char *)data, dictionaryLen);\n    }\n    CHECK_ERR(err, \"inflate with dict\");\n  }\n\n  err = inflateEnd(&d_stream);\n  CHECK_ERR(err, \"inflateEnd\");\n\n  if (memcmp(uncompr, data, dataLen)) {\n    fprintf(stderr, \"bad inflate with dict\\n\");\n    return 0;\n  }\n\n  free(uncompr);\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {\n  size_t comprLen = 0;\n  uint8_t *compr;\n\n  /* Discard inputs larger than 100Kb. */\n  static size_t kMaxSize = 100 * 1024;\n\n  if (size < 1 || size > kMaxSize)\n    return 0;\n\n  data = d;\n  dataLen = size;\n\n  /* Set up the contents of the dictionary.  The size of the dictionary is\n     intentionally selected to be of unusual size.  To help cover more corner\n     cases, the size of the dictionary is read from the input data.  */\n  dictionaryLen = data[0];\n  if (dictionaryLen > dataLen)\n    dictionaryLen = dataLen;\n\n  test_dict_deflate(&compr, &comprLen);\n  test_dict_inflate(compr, comprLen);\n\n  free(compr);\n\n  /* This function must return 0. */\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/example_flush_fuzzer.c",
    "content": "/* Copyright 2022 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n      http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n#include <stdio.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <inttypes.h>\n#include \"zlib.h\"\n\n#define CHECK_ERR(err, msg) { \\\n    if (err != Z_OK) { \\\n        fprintf(stderr, \"%s error: %d\\n\", msg, err); \\\n        return 0; \\\n    } \\\n}\n\nstatic const uint8_t *data;\nstatic size_t dataLen;\nstatic alloc_func zalloc = NULL;\nstatic free_func zfree = NULL;\n\n/* ===========================================================================\n * Test deflate() with full flush\n */\nint test_flush(unsigned char *compr, z_size_t *comprLen) {\n  z_stream c_stream; /* compression stream */\n  int err;\n  unsigned int len = dataLen;\n\n  c_stream.zalloc = zalloc;\n  c_stream.zfree = zfree;\n  c_stream.opaque = (void *)0;\n\n  err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);\n  CHECK_ERR(err, \"deflateInit\");\n\n  c_stream.next_in = (Bytef *)data;\n  c_stream.next_out = compr;\n  c_stream.avail_in = 3;\n  c_stream.avail_out = (unsigned int)*comprLen;\n  err = deflate(&c_stream, Z_FULL_FLUSH);\n  CHECK_ERR(err, \"deflate flush 1\");\n\n  compr[3]++; /* force an error in first compressed block */\n  c_stream.avail_in = len - 3;\n\n  err = deflate(&c_stream, Z_FINISH);\n  if (err != Z_STREAM_END) {\n    CHECK_ERR(err, \"deflate flush 2\");\n  }\n  err = deflateEnd(&c_stream);\n  CHECK_ERR(err, \"deflateEnd\");\n\n  *comprLen = (z_size_t)c_stream.total_out;\n\n  return 0;\n}\n\n/* ===========================================================================\n * Test inflateSync()\n */\nint test_sync(unsigned char *compr, size_t comprLen, unsigned char *uncompr,\n               size_t uncomprLen) {\n  int err;\n  z_stream d_stream; /* decompression stream */\n\n  d_stream.zalloc = zalloc;\n  d_stream.zfree = zfree;\n  d_stream.opaque = (void *)0;\n\n  d_stream.next_in = compr;\n  d_stream.avail_in = 2; /* just read the zlib header */\n\n  err = inflateInit(&d_stream);\n  CHECK_ERR(err, \"inflateInit\");\n\n  d_stream.next_out = uncompr;\n  d_stream.avail_out = (unsigned int)uncomprLen;\n\n  err = inflate(&d_stream, Z_NO_FLUSH);\n  CHECK_ERR(err, \"inflate\");\n\n  d_stream.avail_in = (unsigned int)comprLen - 2; /* read all compressed data */\n  err = inflateSync(&d_stream); /* but skip the damaged part */\n  CHECK_ERR(err, \"inflateSync\");\n\n  err = inflate(&d_stream, Z_FINISH);\n  if (err != Z_DATA_ERROR && err != Z_STREAM_END) {\n    fprintf(stderr, \"inflate should report DATA_ERROR or Z_STREAM_END\\n\");\n    /* v1.1.11= reports DATA_ERROR because of incorrect adler32. v1.1.12+ reports Z_STREAM END because it skips the adler32 check. */\n    return 0;\n  }\n  err = inflateEnd(&d_stream);\n  CHECK_ERR(err, \"inflateEnd\");\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {\n  size_t comprLen = 100 + 2 * compressBound(size);\n  size_t uncomprLen = size;\n  uint8_t *compr, *uncompr;\n\n  /* Discard inputs larger than 1Mb. */\n  static size_t kMaxSize = 1024 * 1024;\n\n  // This test requires at least 3 bytes of input data.\n  if (size <= 3 || size > kMaxSize)\n    return 0;\n\n  data = d;\n  dataLen = size;\n  compr = (uint8_t *)calloc(1, comprLen);\n  uncompr = (uint8_t *)calloc(1, uncomprLen);\n\n  test_flush(compr, &comprLen);\n  test_sync(compr, comprLen, uncompr, uncomprLen);\n\n  free(compr);\n  free(uncompr);\n\n  /* This function must return 0. */\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/example_large_fuzzer.c",
    "content": "#include <stdio.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <inttypes.h>\n#include \"zlib.h\"\n\n#define CHECK_ERR(err, msg) { \\\n    if (err != Z_OK) { \\\n        fprintf(stderr, \"%s error: %d\\n\", msg, err); \\\n        return 0; \\\n    } \\\n}\n\nstatic const uint8_t *data;\nstatic size_t dataLen;\nstatic alloc_func zalloc = NULL;\nstatic free_func zfree = NULL;\nstatic unsigned int diff;\n\n/* ===========================================================================\n * Test deflate() with large buffers and dynamic change of compression level\n */\nint test_large_deflate(unsigned char *compr, size_t comprLen,\n                        unsigned char *uncompr, size_t uncomprLen) {\n  z_stream c_stream; /* compression stream */\n  int err;\n\n  c_stream.zalloc = zalloc;\n  c_stream.zfree = zfree;\n  c_stream.opaque = (void *)0;\n\n  err = deflateInit(&c_stream, Z_BEST_COMPRESSION);\n  CHECK_ERR(err, \"deflateInit\");\n\n  c_stream.next_out = compr;\n  c_stream.avail_out = (unsigned int)comprLen;\n\n  /* At this point, uncompr is still mostly zeroes, so it should compress\n   * very well:\n   */\n  c_stream.next_in = uncompr;\n  c_stream.avail_in = (unsigned int)uncomprLen;\n  err = deflate(&c_stream, Z_NO_FLUSH);\n  CHECK_ERR(err, \"deflate large 1\");\n  if (c_stream.avail_in != 0) {\n    fprintf(stderr, \"deflate not greedy\\n\");\n    return 0;\n  }\n\n  /* Feed in already compressed data and switch to no compression: */\n  deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY);\n  c_stream.next_in = compr;\n  diff = (unsigned int)(c_stream.next_out - compr);\n  c_stream.avail_in = diff;\n  err = deflate(&c_stream, Z_NO_FLUSH);\n  CHECK_ERR(err, \"deflate large 2\");\n\n  /* Switch back to compressing mode: */\n  deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED);\n  c_stream.next_in = uncompr;\n  c_stream.avail_in = (unsigned int)uncomprLen;\n  err = deflate(&c_stream, Z_NO_FLUSH);\n  CHECK_ERR(err, \"deflate large 3\");\n\n  err = deflate(&c_stream, Z_FINISH);\n  if (err != Z_STREAM_END) {\n    fprintf(stderr, \"deflate large should report Z_STREAM_END\\n\");\n    return 0;\n  }\n  err = deflateEnd(&c_stream);\n  CHECK_ERR(err, \"deflateEnd\");\n  return 0;\n}\n\n/* ===========================================================================\n * Test inflate() with large buffers\n */\nint test_large_inflate(unsigned char *compr, size_t comprLen,\n                        unsigned char *uncompr, size_t uncomprLen) {\n  int err;\n  z_stream d_stream; /* decompression stream */\n\n  d_stream.zalloc = zalloc;\n  d_stream.zfree = zfree;\n  d_stream.opaque = (void *)0;\n\n  d_stream.next_in = compr;\n  d_stream.avail_in = (unsigned int)comprLen;\n\n  err = inflateInit(&d_stream);\n  CHECK_ERR(err, \"inflateInit\");\n\n  for (;;) {\n    d_stream.next_out = uncompr; /* discard the output */\n    d_stream.avail_out = (unsigned int)uncomprLen;\n    err = inflate(&d_stream, Z_NO_FLUSH);\n    if (err == Z_STREAM_END)\n      break;\n    CHECK_ERR(err, \"large inflate\");\n  }\n\n  err = inflateEnd(&d_stream);\n  CHECK_ERR(err, \"inflateEnd\");\n\n  if (d_stream.total_out != 2 * uncomprLen + diff) {\n    fprintf(stderr, \"bad large inflate: %zu\\n\", d_stream.total_out);\n    return 0;\n  }\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {\n  size_t comprLen = 100 + 3 * size;\n  size_t uncomprLen = comprLen;\n  uint8_t *compr, *uncompr;\n\n  /* Discard inputs larger than 512Kb. */\n  static size_t kMaxSize = 512 * 1024;\n\n  if (size < 1 || size > kMaxSize)\n    return 0;\n\n  data = d;\n  dataLen = size;\n  compr = (uint8_t *)calloc(1, comprLen);\n  uncompr = (uint8_t *)calloc(1, uncomprLen);\n\n  test_large_deflate(compr, comprLen, uncompr, uncomprLen);\n  test_large_inflate(compr, comprLen, uncompr, uncomprLen);\n\n  free(compr);\n  free(uncompr);\n\n  /* This function must return 0. */\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/example_small_fuzzer.c",
    "content": "#include <stdio.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <inttypes.h>\n#include \"zlib.h\"\n\n#define CHECK_ERR(err, msg) { \\\n    if (err != Z_OK) { \\\n        fprintf(stderr, \"%s error: %d\\n\", msg, err); \\\n        return 0; \\\n    } \\\n}\n\nstatic const uint8_t *data;\nstatic size_t dataLen;\nstatic alloc_func zalloc = NULL;\nstatic free_func zfree = NULL;\n\n/* ===========================================================================\n * Test deflate() with small buffers\n */\nint test_deflate(unsigned char *compr, size_t comprLen) {\n  z_stream c_stream; /* compression stream */\n  int err;\n  unsigned long len = dataLen;\n\n  c_stream.zalloc = zalloc;\n  c_stream.zfree = zfree;\n  c_stream.opaque = (void *)0;\n\n  err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);\n  CHECK_ERR(err, \"deflateInit\");\n\n  c_stream.next_in = (Bytef *)data;\n  c_stream.next_out = compr;\n\n  while (c_stream.total_in != len && c_stream.total_out < comprLen) {\n    c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */\n    err = deflate(&c_stream, Z_NO_FLUSH);\n    CHECK_ERR(err, \"deflate small 1\");\n  }\n  /* Finish the stream, still forcing small buffers: */\n  for (;;) {\n    c_stream.avail_out = 1;\n    err = deflate(&c_stream, Z_FINISH);\n    if (err == Z_STREAM_END)\n      break;\n    CHECK_ERR(err, \"deflate small 2\");\n  }\n\n  err = deflateEnd(&c_stream);\n  CHECK_ERR(err, \"deflateEnd\");\n  return 0;\n}\n\n/* ===========================================================================\n * Test inflate() with small buffers\n */\nint test_inflate(unsigned char *compr, size_t comprLen, unsigned char *uncompr,\n                  size_t uncomprLen) {\n  int err;\n  z_stream d_stream; /* decompression stream */\n\n  d_stream.zalloc = zalloc;\n  d_stream.zfree = zfree;\n  d_stream.opaque = (void *)0;\n\n  d_stream.next_in = compr;\n  d_stream.avail_in = 0;\n  d_stream.next_out = uncompr;\n\n  err = inflateInit(&d_stream);\n  CHECK_ERR(err, \"inflateInit\");\n\n  while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) {\n    d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */\n    err = inflate(&d_stream, Z_NO_FLUSH);\n    if (err == Z_STREAM_END)\n      break;\n    CHECK_ERR(err, \"inflate\");\n  }\n\n  err = inflateEnd(&d_stream);\n  CHECK_ERR(err, \"inflateEnd\");\n\n  if (memcmp(uncompr, data, dataLen)) {\n    fprintf(stderr, \"bad inflate\\n\");\n    return 0;\n  }\n  return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {\n  size_t comprLen = compressBound(size);\n  size_t uncomprLen = size;\n  uint8_t *compr, *uncompr;\n\n  /* Discard inputs larger than 1Mb. */\n  static size_t kMaxSize = 1024 * 1024;\n\n  if (size < 1 || size > kMaxSize)\n    return 0;\n\n  data = d;\n  dataLen = size;\n  compr = (uint8_t *)calloc(1, comprLen);\n  uncompr = (uint8_t *)calloc(1, uncomprLen);\n\n  test_deflate(compr, comprLen);\n  test_inflate(compr, comprLen, uncompr, uncomprLen);\n\n  free(compr);\n  free(uncompr);\n\n  /* This function must return 0. */\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/gzio_fuzzer.c",
    "content": "/********************************************************************************\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *******************************************************************************/\n#include <stdio.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <inttypes.h>\n#include \"zlib.h\"\n\n#undef gzgetc\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen) {\n\n    gzFile file;\n    char fname[] = \"gzio.XXXXXX\";\n    close(mkstemp(fname));\n    unsigned mode_sz = (dataLen ? (--dataLen, *data++) | 2 : 8) & 0xF;\n    char mode[mode_sz];\n    memcpy(mode, data, dataLen >= mode_sz ? mode_sz - 1: dataLen);\n    mode[mode_sz - 1] = 0;\n    file = gzopen(fname, mode);\n\n    /* Chain I/O operations on a file opened with random mode the nature of the\n     * operation and their operand are controlled by the fuzzer\n     */\n    int op_count = 2; //< Number of operations chained.\n    while(op_count-- && dataLen > 0) {\n      switch((--dataLen, (*data++)%26)) {\n        case 0: {\n          char c = dataLen ? (--dataLen, (char)*data++) : 'c';\n          if(gzputc(file, c) < 0) {\n            goto exit;\n          }\n          break;\n        }\n        case 1: {\n          unsigned sz = dataLen ? ((--dataLen, *data++)&0xF) + 1 : 8;\n          char input[sz];\n          memcpy(input, data, dataLen >= sz ? sz - 1: dataLen);\n          input[sz - 1] = 0;\n          if(gzputs(file, input) < 0)\n            goto exit;\n          break;\n        }\n        case 2: {\n          unsigned sz = dataLen ? ((--dataLen, *data++)&0xF) + 1 : 8;\n          unsigned nitems = dataLen ? ((--dataLen, *data++)&0xF) + 1 : 8;\n          unsigned count = sz * nitems;\n          char input[count];\n          memcpy(input, data, dataLen >= count ? count - 1: dataLen);\n          input[count - 1] = 0;\n          if(gzfwrite(input, sz, nitems, file) <= 0)\n            goto exit;\n          break;\n        }\n        case 3: {\n          unsigned sz = dataLen ? (--dataLen, *data++) : 8;\n          char uncompr[sz];\n          if(gzread(file, uncompr, sz) < 0)\n            goto exit;\n          break;\n        }\n        case 4: {\n          int whences[5] = {SEEK_CUR, SEEK_SET, SEEK_END, 18};\n          int whence = dataLen ? (--dataLen, whences[(*data++)%6]) : SEEK_CUR;\n          long offset = dataLen >= sizeof(long) ? (*(long*)data &0xFF) + 1: 1L;\n          if(gzseek(file, offset, whence) < 0)\n            goto exit;\n          break;\n        }\n        case 5:\n          gztell(file);\n          break;\n        case 6:\n          gzgetc(file);\n          break;\n        case 7: {\n          char c = dataLen ? (--dataLen, (char)*data++) : 'c';\n          if(gzungetc(c, file) < 0)\n            goto exit;\n          break;\n        }\n        case 8: {\n          unsigned sz = dataLen ? (--dataLen, *data++) : 8;\n          char uncompr[sz];\n          if(gzgets(file, uncompr, sz) < 0)\n            goto exit;\n          break;\n        }\n        case 9: {\n          int level = dataLen ? (--dataLen, *data++) : 1;\n          int strat = dataLen ? (--dataLen, *data++) : 2;\n          if(gzsetparams(file, level, strat) < 0)\n            goto exit;\n          break;\n        }\n        case 10: {\n          int flush = dataLen ? (--dataLen, *data++) : 0;\n          gzflush(file, flush); break;\n        }\n        case 11: {\n          static const char formats [][4] = { \"%d\", \"%f\", \"%c\", \"%s\" };\n          int nformat = dataLen ? (--dataLen, *data++)%5 : 1;\n          switch(nformat) {\n            case 0: {\n              int value = dataLen >= sizeof(int) ? *(int*)data : 1;\n              gzprintf(file, formats[nformat], value);\n              break;\n            }\n            case 1: {\n              float value = dataLen >= sizeof(float) ? *(float*)data : 1;\n              gzprintf(file, formats[nformat], value);\n              break;\n            }\n            case 2: {\n              char value = dataLen >= sizeof(char) ? *(char*)data : 1;\n              gzprintf(file, formats[nformat], value);\n              break;\n            }\n            case 3: {\n             unsigned sz = dataLen ? ((--dataLen, *data++)&0xF)+1 : 8;\n             char input[sz];\n             memcpy(input, data, dataLen >= sz ? sz - 1: dataLen);\n             input[sz - 1] = 0;\n             gzprintf(file, formats[nformat], input);\n             break;\n            }\n            default: {\n             unsigned sz = dataLen ? ((--dataLen, *data++)&0xF)+1 : 8;\n             char input[sz] = {};\n             memcpy(input, data, dataLen >= sz ? sz - 1: dataLen);\n             for(int i = 0; i < sz - 1; ++i)\n               if(input[i] == '%') input[i] = '!';\n             gzprintf(file, input);\n             break;\n            }\n          };\n          break;\n        }\n        case 12: {\n          gzoffset(file);\n          break;\n        }\n        case 13: {\n          gzrewind(file);\n          break;\n        }\n        case 14: {\n          gzeof(file);\n          break;\n        }\n        case 15: {\n          gzdirect(file);\n          break;\n        }\n        case 16: {\n          unsigned sz = dataLen ? ((--dataLen, *data++))|1 : 128;\n          if(gzbuffer(file, sz) <0)\n            goto exit;\n          break;\n        }\n        case 17: {\n          int errnum;\n          gzerror(file, &errnum);\n          break;\n        }\n        case 18: {\n          gzclearerr(file);\n          break;\n        }\n        case 19: {\n          unsigned sz = dataLen ? (--dataLen, *data++) : 8;\n          unsigned nitems = dataLen ? (--dataLen, *data++) : 8;\n          char buffer[sz * nitems];\n          if(gzfread(buffer, sz, nitems, file) < 0)\n            goto exit;\n          break;\n        }\n        case 20: {\n          gzgetc_(file);\n          break;\n        }\n        case 21: {\n          gzclose_r(file);\n          file = NULL;\n          break;\n        }\n        case 22: {\n          zlibVersion();\n          break;\n        }\n        case 23: {\n          zlibCompileFlags();\n          break;\n        }\n        case 24: {\n          get_crc_table();\n          break;\n        }\n        case 25: {\n          unsigned err = dataLen ? (--dataLen, *data++) : 0;\n          zError(err);\n          break;\n        }\n      }\n    }\n    gzclose(file);\n    remove(fname);\n  return 0;\nexit:\n    gzclose(file);\n    remove(fname);\n  return -1;\n}\n"
  },
  {
    "path": "projects/zlib/minigzip_fuzzer.c",
    "content": "/* minigzip.c -- simulate gzip using the zlib compression library\n * Copyright (C) 1995-2006, 2010, 2011, 2016 Jean-loup Gailly\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/*\n * minigzip is a minimal implementation of the gzip utility. This is\n * only an example of using zlib and isn't meant to replace the\n * full-featured gzip. No attempt is made to deal with file systems\n * limiting names to 14 or 8+3 characters, etc... Error checking is\n * very limited. So use minigzip only for testing; use gzip for the\n * real thing.\n */\n\n/* @(#) $Id$ */\n\n#include \"zlib.h\"\n#include <stdio.h>\n#include <assert.h>\n#include <string.h>\n#include <stdlib.h>\n#include <inttypes.h>\n\n#ifdef USE_MMAP\n#  include <sys/types.h>\n#  include <sys/mman.h>\n#  include <sys/stat.h>\n#endif\n\n#ifndef UNALIGNED_OK\n#  include <malloc.h>\n#endif\n\n#if defined(WIN32) || defined(__CYGWIN__)\n#  include <fcntl.h>\n#  include <io.h>\n#  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)\n#else\n#  define SET_BINARY_MODE(file)\n#endif\n\n#if defined(_MSC_VER) && _MSC_VER < 1900\n#  define snprintf _snprintf\n#endif\n\n#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)\n#ifndef WIN32 /* unlink already in stdio.h for WIN32 */\n  extern int unlink (const char *);\n#endif\n#endif\n\n#ifndef GZ_SUFFIX\n#  define GZ_SUFFIX \".gz\"\n#endif\n#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)\n\n#define BUFLEN      16384        /* read buffer size */\n#define BUFLENW     (BUFLEN * 3) /* write buffer size */\n#define MAX_NAME_LEN 1024\n\n#ifdef Z_SOLO\n/* for Z_SOLO, create simplified gz* functions using deflate and inflate */\n\n#if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)\n#  include <unistd.h>       /* for unlink() */\n#endif\n\nvoid *myalloc (void *, unsigned, unsigned);\nvoid myfree (void *, void *);\n\nvoid *myalloc(void *q, unsigned n, unsigned m)\n{\n    (void)q;\n#ifndef UNALIGNED_OK\n    return memalign(16, n * m);\n#else\n    return calloc(n, m);\n#endif\n}\n\nvoid myfree(void *q, void *p)\n{\n    (void)q;\n    free(p);\n}\n\ntypedef struct gzFile_s {\n    FILE *file;\n    int write;\n    int err;\n    const char *msg;\n    z_stream strm;\n    unsigned char *buf;\n} *gzFile;\n\ngzFile gzopen(const char *, const char *);\ngzFile gzdopen(int, const char *);\ngzFile gz_open (const char *, int, const char *);\n\ngzFile gzopen(const char *path, const char *mode)\n{\n    return gz_open(path, -1, mode);\n}\n\ngzFile gzdopen(int fd, const char *mode)\n{\n    return gz_open(NULL, fd, mode);\n}\n\ngzFile gz_open(const char *path, int fd, const char *mode)\n{\n    gzFile gz;\n    int ret;\n    int level = Z_DEFAULT_COMPRESSION;\n    const char *plevel = mode;\n\n    gz = malloc(sizeof(struct gzFile_s));\n    if (gz == NULL)\n        return NULL;\n    gz->write = strchr(mode, 'w') != NULL;\n    gz->strm.zalloc = myalloc;\n    gz->strm.zfree = myfree;\n    gz->strm.opaque = NULL;\n    gz->buf = malloc(gz->write ? BUFLENW : BUFLEN);\n\n    if (gz->buf == NULL) {\n        free(gz);\n        return NULL;\n    }\n\n    while (*plevel) {\n        if (*plevel >= '0' && *plevel <= '9') {\n           level = *plevel - '0';\n           break;\n        }\n        plevel++;\n    }\n    if (gz->write)\n        ret = deflateInit2(&(gz->strm), level, 8, 15 + 16, 8, 0);\n    else {\n        gz->strm.next_in = NULL;\n        gz->strm.avail_in = 0;\n        ret = inflateInit2(&(gz->strm), 15 + 16);\n    }\n    if (ret != Z_OK) {\n        free(gz);\n        return NULL;\n    }\n    gz->file = path == NULL ? fdopen(fd, gz->write ? \"wb\" : \"rb\") :\n                              fopen(path, gz->write ? \"wb\" : \"rb\");\n    if (gz->file == NULL) {\n        gz->write ? deflateEnd(&(gz->strm)) : inflateEnd(&(gz->strm));\n        free(gz);\n        return NULL;\n    }\n    gz->err = 0;\n    gz->msg = \"\";\n    return gz;\n}\n\nint gzwrite(gzFile, const void *, unsigned);\n\nint gzwrite(gzFile gz, const void *buf, unsigned len)\n{\n    z_stream *strm;\n\n    if (gz == NULL || !gz->write)\n        return 0;\n    strm = &(gz->strm);\n    strm->next_in = (void *)buf;\n    strm->avail_in = len;\n    do {\n        strm->next_out = gz->buf;\n        strm->avail_out = BUFLENW;\n        (void)deflate(strm, Z_NO_FLUSH);\n        fwrite(gz->buf, 1, BUFLENW - strm->avail_out, gz->file);\n    } while (strm->avail_out == 0);\n    return len;\n}\n\nint gzread(gzFile, void *, unsigned);\n\nint gzread(gzFile gz, void *buf, unsigned len)\n{\n    z_stream *strm;\n\n    if (gz == NULL || gz->write || gz->err)\n        return 0;\n    strm = &(gz->strm);\n    strm->next_out = buf;\n    strm->avail_out = len;\n    do {\n        if (strm->avail_in == 0)\n        {\n            strm->next_in = gz->buf;\n            strm->avail_in = (uint32_t)fread(gz->buf, 1, BUFLEN, gz->file);\n        }\n        if (strm->avail_in > 0)\n        {\n            int ret = inflate(strm, Z_NO_FLUSH);\n            if (ret == Z_DATA_ERROR) {\n                gz->err = ret;\n                gz->msg = strm->msg;\n                return 0;\n            }\n            else if (ret == Z_STREAM_END)\n                inflateReset(strm);\n        }\n        else\n            break;\n    } while (strm->avail_out);\n    return len - strm->avail_out;\n}\n\nint gzclose(gzFile);\n\nint gzclose(gzFile gz)\n{\n    z_stream *strm;\n\n    if (gz == NULL)\n        return Z_STREAM_ERROR;\n    strm = &(gz->strm);\n    if (gz->write) {\n        strm->next_in = NULL;\n        strm->avail_in = 0;\n        do {\n            strm->next_out = gz->buf;\n            strm->avail_out = BUFLENW;\n            (void)deflate(strm, Z_FINISH);\n            fwrite(gz->buf, 1, BUFLENW - strm->avail_out, gz->file);\n        } while (strm->avail_out == 0);\n        deflateEnd(strm);\n    }\n    else\n        inflateEnd(strm);\n    free(gz->buf);\n    fclose(gz->file);\n    free(gz);\n    return Z_OK;\n}\n\nconst char *gzerror(gzFile, int *);\n\nconst char *gzerror(gzFile gz, int *err)\n{\n    *err = gz->err;\n    return gz->msg;\n}\n\n#endif\n\nstatic char *prog;\n\nint error            (const char *msg);\nint gz_compress      (FILE   *in, gzFile out);\n#ifdef USE_MMAP\nint  gz_compress_mmap (FILE   *in, gzFile out);\n#endif\nvoid gz_uncompress    (gzFile in, FILE   *out);\nint file_compress    (char  *file, char *mode);\nint file_uncompress  (char  *file);\nint  main             (int argc, char *argv[]);\n\n/* ===========================================================================\n * Display error message and return\n */\nint error(const char *msg)\n{\n    fprintf(stderr, \"%s: %s\\n\", prog, msg);\n    return 0;\n}\n\n/* ===========================================================================\n * Compress input to output then close both files.\n */\n\nint gz_compress(FILE   *in, gzFile out)\n{\n    char buf[BUFLEN];\n    int len;\n    int err;\n\n#ifdef USE_MMAP\n    /* Try first compressing with mmap. If mmap fails (minigzip used in a\n     * pipe), use the normal fread loop.\n     */\n    if (gz_compress_mmap(in, out) == Z_OK) return;\n#endif\n    /* Clear out the contents of buf before reading from the file to avoid\n       MemorySanitizer: use-of-uninitialized-value warnings. */\n    memset(buf, 0, sizeof(buf));\n    for (;;) {\n        len = (int)fread(buf, 1, sizeof(buf), in);\n        if (ferror(in)) {\n            perror(\"fread\");\n            return 0;\n        }\n        if (len == 0) break;\n\n        if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));\n    }\n    fclose(in);\n    if (gzclose(out) != Z_OK) error(\"failed gzclose\");\n    return 0;\n}\n\n#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */\n\n/* Try compressing the input file at once using mmap. Return Z_OK if\n * if success, Z_ERRNO otherwise.\n */\nint gz_compress_mmap(FILE   *in, gzFile out)\n{\n    int len;\n    int err;\n    int ifd = fileno(in);\n    caddr_t buf;    /* mmap'ed buffer for the entire input file */\n    off_t buf_len;  /* length of the input file */\n    struct stat sb;\n\n    /* Determine the size of the file, needed for mmap: */\n    if (fstat(ifd, &sb) < 0) return Z_ERRNO;\n    buf_len = sb.st_size;\n    if (buf_len <= 0) return Z_ERRNO;\n\n    /* Now do the actual mmap: */\n    buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);\n    if (buf == (caddr_t)(-1)) return Z_ERRNO;\n\n    /* Compress the whole file at once: */\n    len = gzwrite(out, (char *)buf, (unsigned)buf_len);\n\n    if (len != (int)buf_len) error(gzerror(out, &err));\n\n    munmap(buf, buf_len);\n    fclose(in);\n    if (gzclose(out) != Z_OK) error(\"failed gzclose\");\n    return Z_OK;\n}\n#endif /* USE_MMAP */\n\n/* ===========================================================================\n * Uncompress input to output then close both files.\n */\nvoid gz_uncompress(gzFile in, FILE   *out)\n{\n    char buf[BUFLENW];\n    int len;\n    int err;\n\n    for (;;) {\n        len = gzread(in, buf, sizeof(buf));\n        if (len < 0) error (gzerror(in, &err));\n        if (len == 0) break;\n\n        if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {\n            error(\"failed fwrite\");\n        }\n    }\n    if (fclose(out)) error(\"failed fclose\");\n\n    if (gzclose(in) != Z_OK) error(\"failed gzclose\");\n}\n\n\n/* ===========================================================================\n * Compress the given file: create a corresponding .gz file and remove the\n * original.\n */\nint file_compress(char  *file, char  *mode)\n{\n    char outfile[MAX_NAME_LEN];\n    FILE  *in;\n    gzFile out;\n\n    if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {\n        fprintf(stderr, \"%s: filename too long\\n\", prog);\n        return 0;\n    }\n\n    snprintf(outfile, sizeof(outfile), \"%s%s\", file, GZ_SUFFIX);\n\n    in = fopen(file, \"rb\");\n    if (in == NULL) {\n        perror(file);\n        return 0;\n    }\n    out = gzopen(outfile, mode);\n    if (out == NULL) {\n        fprintf(stderr, \"%s: can't gzopen %s\\n\", prog, outfile);\n        return 0;\n    }\n    gz_compress(in, out);\n\n    unlink(file);\n    return 0;\n}\n\n\n/* ===========================================================================\n * Uncompress the given file and remove the original.\n */\nint file_uncompress(char  *file)\n{\n    char buf[MAX_NAME_LEN];\n    char *infile, *outfile;\n    FILE  *out;\n    gzFile in;\n    size_t len = strlen(file);\n\n    if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {\n        fprintf(stderr, \"%s: filename too long\\n\", prog);\n        return 0;\n    }\n\n    snprintf(buf, sizeof(buf), \"%s\", file);\n\n    if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {\n        infile = file;\n        outfile = buf;\n        outfile[len-3] = '\\0';\n    } else {\n        outfile = file;\n        infile = buf;\n        snprintf(buf + len, sizeof(buf) - len, \"%s\", GZ_SUFFIX);\n    }\n    in = gzopen(infile, \"rb\");\n    if (in == NULL) {\n        fprintf(stderr, \"%s: can't gzopen %s\\n\", prog, infile);\n        return 0;\n    }\n    out = fopen(outfile, \"wb\");\n    if (out == NULL) {\n        perror(file);\n        return 0;\n    }\n\n    gz_uncompress(in, out);\n\n    unlink(infile);\n    return 0;\n}\n\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen) {\n  char *inFileName = \"/tmp/minigzip_fuzzer.out\";\n  char *outFileName = \"/tmp/minigzip_fuzzer.out.gz\";\n  char outmode[20];\n  FILE *in;\n  char buf[BUFLEN];\n  uint32_t offset = 0;\n\n  /* Discard inputs larger than 1Mb. */\n  static size_t kMaxSize = 1024 * 1024;\n  if (dataLen < 1 || dataLen > kMaxSize)\n    return 0;\n\n  in = fopen(inFileName, \"w\");\n  if (fwrite(data, 1, (unsigned)dataLen, in) != dataLen)\n    error(\"failed fwrite\");\n  if (fclose(in))\n    error(\"failed fclose\");\n\n  memset(outmode, 0, sizeof(outmode));\n  snprintf(outmode, sizeof(outmode), \"%s\", \"wb\");\n\n  /* Compression level: [0..9]. */\n  outmode[2] = data[0] % 10;\n\n  switch (data[0] % 4) {\n  default:\n  case 0:\n    outmode[3] = 0;\n    break;\n  case 1:\n    /* compress with Z_FILTERED */\n    outmode[3] = 'f';\n    break;\n  case 2:\n    /* compress with Z_HUFFMAN_ONLY */\n    outmode[3] = 'h';\n    break;\n  case 3:\n    /* compress with Z_RLE */\n    outmode[3] = 'R';\n    break;\n  }\n\n  file_compress(inFileName, outmode);\n  file_uncompress(outFileName);\n\n  /* Check that the uncompressed file matches the input data. */\n  in = fopen(inFileName, \"rb\");\n  if (in == NULL) {\n    perror(inFileName);\n    return 0;\n  }\n\n  memset(buf, 0, sizeof(buf));\n  for (;;) {\n    int len = (int)fread(buf, 1, sizeof(buf), in);\n    if (ferror(in)) {\n      perror(\"fread\");\n      return 0;\n    }\n    if (len == 0)\n      break;\n    assert(0 == memcmp(data + offset, buf, len));\n    offset += len;\n  }\n\n  if (fclose(in))\n    error(\"failed fclose\");\n\n  /* This function must return 0. */\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/project.yaml",
    "content": "base_os_version: ubuntu-24-04\nhomepage: \"https://www.zlib.net/\"\nlanguage: c++\nprimary_contact: \"glennrp@gmail.com\"\nauto_ccs:\n  - \"sebpop@gmail.com\"\n  - \"cblume@google.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nmain_repo: 'https://github.com/madler/zlib.git'\n"
  },
  {
    "path": "projects/zlib/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nmake check\n"
  },
  {
    "path": "projects/zlib/zlib_uncompress2_fuzzer.cc",
    "content": "#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\n#include \"zlib.h\"\n\nstatic Bytef buffer[256 * 1024] = { 0 };\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  uLongf buffer_length = static_cast<uLongf>(sizeof(buffer));\n  uLong buf_size = static_cast<uLong>(size);\n  // Ignore return code.\n  uncompress2(buffer, &buffer_length, data, &buf_size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/zlib_uncompress3_fuzzer.cc",
    "content": "/********************************************************************************\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *******************************************************************************/\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\n#include \"zlib.h\"\n\nstatic Bytef buffer[256 * 1024] = { 0 };\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n\n  uLong basesz = size ? (--size, *data++) : 8;\n  uLong multiplier0 = size ? (--size, *data++) : 1;\n  uLong multiplier1 = size ? (--size, *data++) : 1;\n\n  uLongf buffer_length = static_cast<uLongf>(basesz * multiplier0 * multiplier1);\n  uLong buf_size = static_cast<uLong>(size);\n  // Ignore return code.\n  uncompress2(buffer, &buffer_length, data, &buf_size);\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib/zlib_uncompress_fuzzer.cc",
    "content": "// Copyright 2015 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\n#include \"zlib.h\"\n\nstatic Bytef buffer[256 * 1024] = { 0 };\n\n// Entry point for LibFuzzer.\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  uLongf buffer_length = static_cast<uLongf>(sizeof(buffer));\n  if (Z_OK != uncompress(buffer, &buffer_length, data,\n                         static_cast<uLong>(size))) {\n    return 0;\n  }\n  return 0;\n}\n"
  },
  {
    "path": "projects/zlib-ng/Dockerfile",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\n\nRUN git clone --depth 1 -b develop https://github.com/zlib-ng/zlib-ng.git\nWORKDIR zlib-ng\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/zlib-ng/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n: ${LD:=\"${CXX}\"}\n: ${LDFLAGS:=\"${CXXFLAGS}\"}  # to make sure we link against 32-bit libraries\n\n# Package seed corpus\nzip $OUT/seed_corpus.zip *.*\n\n# Build project\nmkdir build && cd build\ncmake .. -DCMAKE_C_FLAGS=\"${CFLAGS}\" \\\n         -DCMAKE_CXX_FLAGS=\"${CXXFLAGS}\" \\\n         -DCMAKE_LINKER=\"${LD}\" \\\n         -DCMAKE_SHARED_LINKER_FLAGS=\"${LDFLAGS}\" \\\n         -DCMAKE_EXE_LINKER_FLAGS=\"${LDFLAGS}\" \\\n         -DBUILD_SHARED_LIBS=OFF \\\n         -DWITH_FUZZERS=ON\nmake clean\nmake -j $(nproc)\n\n# Copy seed corpus for each fuzzer target\nfor f in $(find . -type f -name 'fuzzer_*'); do\n    cp -v $f $OUT\n    (cd $OUT; ln -s seed_corpus.zip $(basename $f)_seed_corpus.zip)\ndone\n"
  },
  {
    "path": "projects/zlib-ng/project.yaml",
    "content": "homepage: \"https://github.com/zlib-ng/zlib-ng\"\nlanguage: c++\nprimary_contact: \"zlib-ng@circlestorm.org\"\nauto_ccs:\n  - \"sebpop@gmail.com\"\n  - \"nathan.moinvaziri@gmail.com\"\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n  - x86_64\n  - i386\nfuzzing_engines:\n  - libfuzzer\n  - honggfuzz\n  - afl\n  # - centipede disabled due to https://github.com/google/oss-fuzz/pull/10248#issuecomment-1579657163\nmain_repo: 'https://github.com/zlib-ng/zlib-ng.git'\n"
  },
  {
    "path": "projects/znc/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make\nRUN git clone --depth 1 https://github.com/znc/znc\nWORKDIR $SRC/znc\nCOPY run_tests.sh build.sh msg_parse_fuzzer.cpp $SRC/\n"
  },
  {
    "path": "projects/znc/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\ngit submodule update --init --recursive\nmkdir build && cd build\ncmake -DBUILD_SHARED_LIBS=OFF \\\n\t  -DWANT_ICU=OFF \\\n\t  -DWANT_OPENSSL=OFF \\\n\t  -DWANT_ZLIB=OFF \\\n\t  -DWANT_IPV6=OFF ..\nmake -j$(nproc)\n\n$CXX $CXXFLAGS -DGTEST_HAS_POSIX_RE=0 \\\n\t-I/src/znc/include -I/src/znc/build/include \\\n\t-fPIE -include znc/zncconfig.h -std=c++11 \\\n\t-c $SRC/msg_parse_fuzzer.cpp -o msg_parse_fuzzer.o\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\n\tmsg_parse_fuzzer.o -o $OUT/msg_parse_fuzzer \\\n\t/src/znc/build/src/libznc.a \n\n# Build unit test\nmake unittest_bin -j$(nproc)\n"
  },
  {
    "path": "projects/znc/msg_parse_fuzzer.cpp",
    "content": "/*\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n*/\n\n#include <stdint.h>\n#include <znc/Message.h>\n\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){\n\tstd::string input(reinterpret_cast<const char*>(data), size);\n\tCMessage msg;\n\tmsg.Parse(input);\n\tmsg.SetParam(1, input);\n\tmsg.GetParams();\n\treturn 0;\n}\n"
  },
  {
    "path": "projects/znc/project.yaml",
    "content": "homepage: \"https://znc.in\"\nlanguage: c++\nprimary_contact: \"alexey+znc@asokolov.org\"\nauto_ccs:\n  - \"Adam@adalogics.com\"\n  - \"ktonibud@gmail.com\"\nsanitizers:\n  - address\n  - undefined\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\nmain_repo: \"https://github.com/znc/znc\"\nfuzzing_engines:\n  - afl\n  - honggfuzz\n  - libfuzzer\n\n"
  },
  {
    "path": "projects/znc/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n$SRC/znc/build/test/unittest_bin\n"
  },
  {
    "path": "projects/zookeeper/DataTreeFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.zookeeper.server.DataTree;\nimport org.apache.zookeeper.ZooDefs;\nimport org.apache.zookeeper.txn.TxnHeader;\nimport org.apache.zookeeper.txn.CreateTxn;\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class DataTreeFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        DataTree dt = new DataTree();\n        String path = data.consumeString(20);\n        dt.createNode(path, data.consumeBytes(1000), null, data.consumeLong(), data.consumeInt(), data.consumeLong(), data.consumeLong());\n        dt.deleteNode(path, data.consumeLong());\n        dt.processTxn(\n            new TxnHeader(data.consumeInt(), data.consumeInt(), data.consumeInt(), data.consumeInt(), ZooDefs.OpCode.create), \n            new CreateTxn(data.consumeString(15), data.consumeBytes(1000), ZooDefs.Ids.OPEN_ACL_UNSAFE, data.consumeBoolean(), data.consumeInt())\n        );\n    \n    }\n    catch (org.apache.zookeeper.KeeperException.NoNodeException e) {}\n    catch (org.apache.zookeeper.KeeperException.NodeExistsException e) {}\n    catch (java.lang.StringIndexOutOfBoundsException e) {}\n    catch (java.lang.NoClassDefFoundError e) {}\n  }\n}"
  },
  {
    "path": "projects/zookeeper/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN apt-get update && apt-get install -y make autoconf automake libtool wget openjdk-17-jdk\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.9.5/bin/mvn\n\nRUN git clone --depth 1 https://github.com/apache/zookeeper.git zookeeper\nCOPY build.sh $SRC/\nCOPY *.java $SRC/\nWORKDIR $SRC/zookeeper"
  },
  {
    "path": "projects/zookeeper/MessageTrackerPeekReceivedFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport org.apache.zookeeper.server.util.*;\nimport java.io.*;\nimport java.util.*;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\npublic class MessageTrackerPeekReceivedFuzzer {\n    private static final Logger LOG = LoggerFactory.getLogger(MessageTrackerPeekReceivedFuzzer.class);\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        System.setProperty(MessageTracker.MESSAGE_TRACKER_ENABLED, \"true\");\n        long timestamp1 = data.consumeLong();\n        MessageTracker messageTracker = new MessageTracker(data.consumeInt(1, 100));\n        String sid = data.consumeRemainingAsString();\n        messageTracker.dumpToLog(sid);\n        messageTracker.peekSent();\n        messageTracker.peekReceived();\n        messageTracker.trackSent(timestamp1);\n        messageTracker.peekSentTimestamp();\n        messageTracker.peekReceived();\n        messageTracker.dumpToLog(sid);\n        messageTracker.peekSent();\n        messageTracker.peekReceived();\n        messageTracker.trackSent(timestamp1);\n        messageTracker.trackReceived(timestamp1);\n        messageTracker.peekSentTimestamp();\n        messageTracker.peekReceivedTimestamp();\n        messageTracker.dumpToLog(sid);\n        messageTracker.peekSent();\n        messageTracker.peekReceived();\n        System.clearProperty(MessageTracker.MESSAGE_TRACKER_ENABLED);\n    }\n}"
  },
  {
    "path": "projects/zookeeper/ProcessTxnFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.zookeeper.server.DataTree;\nimport org.apache.zookeeper.ZooDefs;\nimport org.apache.zookeeper.txn.TxnHeader;\nimport org.apache.zookeeper.txn.CreateTxn;\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class ProcessTxnFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try{\n        DataTree dt = new DataTree();\n        dt.processTxn(\n            new TxnHeader(data.consumeInt(), data.consumeInt(), data.consumeInt(), data.consumeInt(), ZooDefs.OpCode.create), \n            new CreateTxn(data.consumeString(15), data.consumeBytes(1000), ZooDefs.Ids.OPEN_ACL_UNSAFE, data.consumeBoolean(), data.consumeInt())\n        );\n    \n    }\n    catch (java.lang.StringIndexOutOfBoundsException e) {}\n    catch (java.lang.NoClassDefFoundError e) {}\n  }\n}"
  },
  {
    "path": "projects/zookeeper/SerializeFuzzer.java",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport org.apache.zookeeper.server.DataTree;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport org.apache.jute.BinaryInputArchive;\nimport org.apache.jute.BinaryOutputArchive;\nimport java.io.IOException;\n\npublic class SerializeFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n    try {\n        DataTree tree = new DataTree();\n        ByteArrayOutputStream baos = new ByteArrayOutputStream();\n        BinaryOutputArchive oa = BinaryOutputArchive.getArchive(baos);\n        tree.serialize(oa, data.consumeString(100));\n        baos.flush();\n        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());\n        BinaryInputArchive ia = BinaryInputArchive.getArchive(bais);\n        tree.deserialize(ia, data.consumeString(100));\n    } catch (IOException e) {\n    }\n    \n  }\n}"
  },
  {
    "path": "projects/zookeeper/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nexport JAVA_HOME=\"$OUT/open-jdk-17\"\nmkdir -p $JAVA_HOME\nrsync -aL --exclude=*.zip \"/usr/lib/jvm/java-17-openjdk-amd64/\" \"$JAVA_HOME\"\n\n\nMAVEN_ARGS=\"-Dpropguard.skip -DskipTests -Dmaven.javadoc.skip=true -Dpmd.skip=true \\\n  -Dencoding=UTF-8 -Dmaven.antrun.skip=true -Dcheckstyle.skip=true \\\n  -DperformRelease=True\"\n$MVN clean package $MAVEN_ARGS org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\nfind ./zookeeper-server -name \"zookeeper-$CURRENT_VERSION.jar\" -exec mv {} $OUT/zookeeper.jar \\;\n\nALL_JARS=\"zookeeper.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\njavac -cp $BUILD_CLASSPATH ${SRC}/*.java\ninstall ${SRC}/*.class ${OUT}/\n\nfor fuzzer in $(find $SRC -name '*Fuzzer.java' -maxdepth 1); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n\n# Create an execution wrapper that executes Jazzer with the correct arguments.\necho \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nJAVA_HOME=\\\"\\$this_dir/open-jdk-17/\\\" \\\nLD_LIBRARY_PATH=\\\"\\$this_dir/open-jdk-17/lib/server\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/zookeeper/project.yaml",
    "content": "homepage: \"https://github.com/apache/zookeeper\"\nlanguage: jvm\nprimary_contact: \"irali@google.com\"\nmain_repo: \"https://github.com/apache/zookeeper.git\"\nfile_github_issue: false\nfuzzing_engines:\n  - libfuzzer\nsanitizers:\n  - address\n"
  },
  {
    "path": "projects/zopfli/Dockerfile",
    "content": "# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 https://github.com/google/zopfli\nWORKDIR zopfli\nCOPY build.sh *.cc $SRC/\n"
  },
  {
    "path": "projects/zopfli/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2019 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# build project\nmake -j$(nproc) clean\nmake -j$(nproc) libzopfli.a\n\n# build fuzzers\nfor fuzzers in $(find $SRC -name '*_fuzzer.cc'); do\n  base=$(basename -s .cc $fuzzers)\n  $CXX $CXXFLAGS -std=c++17 -I. -Isrc/zopfli \\\n  $fuzzers ./libzopfli.a -o $OUT/$base $LIB_FUZZING_ENGINE\ndone\n"
  },
  {
    "path": "projects/zopfli/project.yaml",
    "content": "homepage: \"https://github.com/google/zopfli\"\nlanguage: c++\nprimary_contact: \"lode@google.com\"\nsanitizers:\n  - address\n# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294\n#  - memory\n  - undefined\nmain_repo: 'https://github.com/google/zopfli'\nfile_github_issue: True\n"
  },
  {
    "path": "projects/zopfli/zopfli_compress_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n#include <cstdlib>\n#include <string>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"zopfli.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  if (size > 8192)\n    return 0;\n\n  FuzzedDataProvider stream(data, size);\n\n  ZopfliOptions options;\n  ZopfliInitOptions(&options);\n\n  const ZopfliFormat format = stream.PickValueInArray(\n      {ZOPFLI_FORMAT_GZIP, ZOPFLI_FORMAT_ZLIB, ZOPFLI_FORMAT_DEFLATE});\n\n  unsigned char* outbuf = nullptr;\n  size_t outsize = 0;\n  std::vector<unsigned char> input =\n      stream.ConsumeRemainingBytes<unsigned char>();\n\n  ZopfliCompress(&options, format, input.data(), input.size(), &outbuf,\n                 &outsize);\n\n  if (outbuf != nullptr) {\n    free(outbuf);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/zopfli/zopfli_deflate_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include <string>\n\n#include \"deflate.h\"\n#include \"zopfli.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  ZopfliOptions options;\n  ZopfliInitOptions(&options);\n\n  FuzzedDataProvider stream(data, size);\n\n  // From documentation: valid values for btype are 0, 1, or 2.\n  const int btype = stream.PickValueInArray({0, 1, 2});\n  // The final parameter is an int but it is used as a bool.\n  const int is_final = stream.ConsumeIntegralInRange(0, 1);\n  const std::string input = stream.ConsumeRemainingBytesAsString();\n\n  unsigned char* out = nullptr;\n  size_t outsize = 0;\n  unsigned char bp = 0;  // Apparently must be zero.\n  ZopfliDeflate(&options, btype, is_final,\n                reinterpret_cast<const unsigned char*>(input.data()),\n                input.size(), &bp, &out, &outsize);\n\n  if (out != nullptr) {\n    free(out);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/zstd/Dockerfile",
    "content": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make python wget\n# Clone source\nRUN git clone --depth 1 https://github.com/facebook/zstd\nWORKDIR zstd\nCOPY build.sh run_tests.sh $SRC/\n"
  },
  {
    "path": "projects/zstd/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncd tests/fuzz\n\n# Download the seed corpora\nmake -j seedcorpora\n# Build all of the fuzzers\n./fuzz.py build all\n\nfor target in $(./fuzz.py list); do\n    cp \"$target\" \"$OUT\"\n\n    if [ -f \"$target.dict\" ]; then\n        cp \"$target.dict\" \"$OUT\"\n    fi\n\n    cp \"corpora/${target}_seed_corpus.zip\" \"$OUT\"\ndone\n"
  },
  {
    "path": "projects/zstd/project.yaml",
    "content": "homepage: \"http://facebook.github.io/zstd/\"\nlanguage: c++\nprimary_contact: \"terrelln@fb.com\"\nauto_ccs:\n  - \"NickRTerrell@gmail.com\"\n  - \"Yann.collet.73@gmail.com\"\n  - \"cyan@fb.com\"\n  - \"felixh@fb.com\"\n  - \"dpc@fb.com\"\n  - \"hmf@fb.com\"\n  - \"yaohway@fb.com\"\n  - \"axxu@fb.com\"\n  - \"embg@fb.com\"\n  - \"yoniko@fb.com\"\n  - \"sangelov@fb.com\"\n  - \"drozenblit@fb.com\"\n  - \"cyan@meta.com\"\n  - \"terrelln@meta.com\"\n  - \"felixh@meta.com\"\n  - \"embg@meta.com\"\n  - \"yoniko@meta.com\"\n  - \"drozenblit@meta.com\"\nvendor_ccs:\n  - \"oss-fuzz@fb.com\"\n  - \"danilak@google.com\"\nfuzzing_engines:\n  - libfuzzer\n  - afl\n  - honggfuzz\nsanitizers:\n  - address\n  - memory\n  - undefined\narchitectures:\n - x86_64\n - i386\nmain_repo: 'https://github.com/facebook/zstd'\n"
  },
  {
    "path": "projects/zstd/run_tests.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n\ncd tests\n\n# `make test` is a wrapper for the following tests.\n# At the time of writing, `test-cli-tests fails at\n# the latest master but not at the latest release,\n# so it is likely that zstd will fix this. For now,\n# that test is commented out. A TODO for the future\n# is to call `make test` instead of each test suite\n# individually.\nmake test-zstd\n#make test-cli-tests\nmake test-fullbench\nmake test-fuzzer\nmake test-fullbench\nmake test-invalidDictionaries\nmake test-legacy test-decodecorpus\n"
  },
  {
    "path": "projects/zstd-safe/Dockerfile",
    "content": "# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\nFROM gcr.io/oss-fuzz-base/base-builder-rust\n\nRUN git clone --recursive https://github.com/gyscos/zstd-rs\nWORKDIR $SRC/zstd-rs/zstd-safe\n\nCOPY build.sh $SRC/\n"
  },
  {
    "path": "projects/zstd-safe/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2024 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Build the fuzzers and project source code\ncargo fuzz build\n\n# Copy built fuzzer binaries to $OUT\ncp $SRC/zstd-rs/zstd-safe/fuzz/target/x86_64-unknown-linux-gnu/release/zstd_fuzzer $OUT\n"
  },
  {
    "path": "projects/zstd-safe/project.yaml",
    "content": "homepage: \"https://github.com/gyscos/zstd-rs\"\nmain_repo: \"https://github.com/gyscos/zstd-rs.git\"\nprimary_contact: \"alexandre.bury@gmail.com\"\nsanitizers:\n  - address\nfuzzing_engines:\n  - libfuzzer\nlanguage: rust\nauto_ccs:\n  - \"arthur.chan@adalogics.com\"\n  - \"david@adalogics.com\"\n"
  },
  {
    "path": "projects/zt-zip/.gitignore",
    "content": "project-parent/zt-zip\nproject-parent/fuzz-targets/target\nproject-parent/fuzz-targets/src/test/resources\nproject-parent/fuzz-targets/pom.xml.versionsBackup"
  },
  {
    "path": "projects/zt-zip/Dockerfile",
    "content": "# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/google/fuzzing && \\\n    cp fuzzing/dictionaries/zip.dict $SRC/UnpackFuzzer.dict && \\\n    rm -rf fuzzing\n\nRUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus && \\\n    zip -j $SRC/UnpackFuzzer_seed_corpus.zip go-fuzz-corpus/zip/corpus/* && \\\n    rm -rf go-fuzz-corpus\n\n# if not set python infra helper cannot be used for local testing\n\nCOPY project-parent $SRC/project-parent/\n\nRUN rm -rf $SRC/project-parent/zt-zip\nRUN apt update && apt install -y openjdk-11-jdk\nRUN git clone --depth 1 https://github.com/zeroturnaround/zt-zip/ $SRC/project-parent/zt-zip\n\nCOPY build.sh $SRC/\nWORKDIR $SRC/"
  },
  {
    "path": "projects/zt-zip/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2023 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nPROJECT=zt-zip\nPROJECT_GROUP_ID=org.zeroturnaround\nPROJECT_ARTIFACT_ID=zt-zip\nMAIN_REPOSITORY=https://github.com/zeroturnaround/zt-zip/\n\nMAVEN_ARGS=\"-Djavac.src.version=11 -Djavac.target.version=11 -DskipTests\"\n\nfunction set_project_version_in_fuzz_targets_dependency {\n  PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)\n  # set dependency project version in fuzz-targets\n  (cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)\n}\n\ncd project-parent\n\n# LOCAL_DEV env variable need to be set in local development env\nif [[ -v LOCAL_DEV ]]; then\n  MVN=mvn\n\n  # checkout latest project version\n  git -C $PROJECT pull || git clone $MAIN_REPOSITORY $PROJECT\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS)\n  mvn -pl fuzz-targets install\n\nelse\n  # Move seed corpus and dictionary.\n  mv $SRC/{*.zip,*.dict} $OUT\n\n  export JAVA_HOME=\"$OUT/open-jdk-11\"\n  mkdir -p $JAVA_HOME\n  rsync -aL --exclude=*.zip --exclude 'lib/security/blacklisted.certs' \"/usr/lib/jvm/java-11-openjdk-amd64/\" \"$JAVA_HOME\"\n\n  set_project_version_in_fuzz_targets_dependency\n\n  #install\n  (cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2)\n  $MVN -pl fuzz-targets install -Dmaven.repo.local=$OUT/m2\n\n  # build classpath\n  $MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2\n  cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes\n  RUNTIME_CLASSPATH_ABSOLUTE=\"$(cat fuzz-targets/cp.txt):$OUT/test-classes\"\n  # replace $OUT with placeholder $this_dir that will be dissolved at runtime\n  RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed \"s|$OUT|\\$this_dir|g\")\n\n  for fuzzer in $(find $SRC/project-parent -name '*Fuzzer.java'); do\n    fuzzer_basename=$(basename -s .java $fuzzer)\n\n    # Create an execution wrapper for every fuzztarget\n    echo \"#!/bin/bash\n  # LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.\n  this_dir=\\$(dirname \\\"\\$0\\\")\n  if [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n    mem_settings='-Xmx1900m:-Xss900k'\n  else\n    mem_settings='-Xmx2048m:-Xss1024k'\n  fi\n  JAVA_HOME=\\\"\\$this_dir/open-jdk-11/\\\" \\\n  LD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=com.example.$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings\\\" \\\n--instrumentation_includes=\\\"com.**:org.**\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n    chmod u+x $OUT/$fuzzer_basename\n  done\n\nfi"
  },
  {
    "path": "projects/zt-zip/project-parent/fuzz-targets/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n    <modelVersion>4.0.0</modelVersion>\n    <groupId>com.fuzzer</groupId>\n    <artifactId>fuzz-targets</artifactId>\n    <version>0.0.1-SNAPSHOT</version>\n    <name>fuzz</name>\n    <description>fuzz</description>\n\n    <properties>\n        <java.version>11</java.version>\n        <maven.compiler.source>11</maven.compiler.source>\n        <maven.compiler.target>11</maven.compiler.target>\n    </properties>\n\n    <dependencies>\n\n        <dependency>\n            <groupId>com.code-intelligence</groupId>\n            <artifactId>jazzer-junit</artifactId>\n            <version>0.19.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.9.2</version>\n            <scope>test</scope>\n        </dependency>\n\n        <dependency>\n            <groupId>org.junit.platform</groupId>\n            <artifactId>junit-platform-launcher</artifactId>\n            <version>1.9.2</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.zeroturnaround</groupId>\n            <artifactId>zt-zip</artifactId>\n            <version>Fuzzing-SNAPSHOT</version>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-surefire-plugin</artifactId>\n                <version>3.1.2</version>\n            </plugin>\n        </plugins>\n        <testResources>\n            <testResource>\n                <directory>${project.basedir}/src/test/resources</directory>\n            </testResource>\n        </testResources>\n    </build>\n\n</project>"
  },
  {
    "path": "projects/zt-zip/project-parent/fuzz-targets/src/test/java/com/example/UnpackFuzzer.java",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\npackage com.example;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\nimport com.code_intelligence.jazzer.junit.FuzzTest;\n\nimport java.io.*;\nimport java.util.Enumeration;\nimport java.util.zip.ZipEntry;\nimport java.util.zip.ZipFile;\nimport java.lang.IllegalArgumentException;\nimport java.lang.StringIndexOutOfBoundsException;\n\nimport org.zeroturnaround.zip.ZipUtil;\nimport org.zeroturnaround.zip.ZipException;\nimport org.zeroturnaround.zip.commons.IOUtils;\n\n\nclass UnpackFuzzer {\n    @FuzzTest\n    void myFuzzTest(FuzzedDataProvider data) {\n        String str = data.consumeString(100);\n        String dir = \"/tmp\";\n        int level = data.consumeInt();\n        InputStream is = new ByteArrayInputStream(data.consumeRemainingAsBytes());\n\n        try {\n            ZipUtil.unpackEntry(is, str);\n            ZipUtil.unpack(is, new File(dir));\n            ZipUtil.unwrap(is, new File(dir));\n            ZipUtil.repack(is, new File(dir), level);\n            IOUtils.closeQuietly(is);\n        } catch (ZipException | IllegalArgumentException | StringIndexOutOfBoundsException e) {\n        } \n    }\n}"
  },
  {
    "path": "projects/zt-zip/project-parent/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>com.fuzzer</groupId>\n  <artifactId>project-parent</artifactId>\n  <version>0.1.0</version>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>zt-zip</module>\n    <module>fuzz-targets</module>\n  </modules>\n\n</project>"
  },
  {
    "path": "projects/zt-zip/project.yaml",
    "content": "homepage: \"https://github.com/zeroturnaround/zt-zip/\"\nlanguage: jvm\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/zeroturnaround/zt-zip/\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"yakdan@code-intelligence.com\"\n  - \"patrice.salathe@code-intelligence.com\"\n"
  },
  {
    "path": "projects/zxing/Dockerfile",
    "content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder-jvm\n\nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\n    unzip maven.zip -d $SRC/maven && \\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\n\nRUN git clone --depth 1 https://github.com/zxing/zxing\n\nCOPY build.sh $SRC/\nCOPY MultiFormatDecodeFuzzer.java MultiFormatEncodeFuzzer.java $SRC/\nWORKDIR $SRC/zxing\n"
  },
  {
    "path": "projects/zxing/MultiFormatDecodeFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.google.zxing.BinaryBitmap;\nimport com.google.zxing.BufferedImageLuminanceSource;\nimport com.google.zxing.MultiFormatReader;\nimport com.google.zxing.ReaderException;\nimport com.google.zxing.Result;\nimport com.google.zxing.common.HybridBinarizer;\n\nimport javax.imageio.ImageIO;\nimport java.io.IOException;\nimport java.awt.image.BufferedImage;\nimport java.io.ByteArrayInputStream;\n\npublic final class MultiFormatDecodeFuzzer {\n    private static MultiFormatReader barcodeReader = new MultiFormatReader();\n\n    public static void fuzzerInitialize() {\n    }\n\n    public static void fuzzerTestOneInput(byte[] input) {\n        BufferedImage image;\n        try {\n            image = ImageIO.read(new ByteArrayInputStream(input));\n        } catch (IOException e) {\n            return;\n        }\n        if (image == null)\n            return;\n        if ((long) image.getHeight() * (long) image.getWidth() > 10000000)\n            return;\n\n        BufferedImageLuminanceSource source = new BufferedImageLuminanceSource(image);\n        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));\n        try {\n            Result result = barcodeReader.decode(bitmap);\n            result.getText();\n            result.getResultMetadata();\n        } catch (ReaderException ignored) {\n        }\n    }\n}\n"
  },
  {
    "path": "projects/zxing/MultiFormatEncodeFuzzer.java",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport com.google.zxing.BarcodeFormat;\nimport com.google.zxing.MultiFormatWriter;\nimport com.google.zxing.MultiFormatReader;\nimport com.google.zxing.aztec.encoder.AztecCode;\nimport com.google.zxing.aztec.AztecReader;\nimport com.google.zxing.datamatrix.DataMatrixReader;\nimport com.google.zxing.maxicode.MaxiCodeReader;\nimport com.google.zxing.oned.MultiFormatOneDReader;\nimport com.google.zxing.pdf417.PDF417Reader;\nimport com.google.zxing.qrcode.QRCodeReader;\nimport com.google.zxing.oned.CodaBarReader;\nimport com.google.zxing.oned.Code128Reader;\nimport com.google.zxing.oned.Code39Reader;\nimport com.google.zxing.oned.Code93Reader;\nimport com.google.zxing.oned.EAN13Reader;\nimport com.google.zxing.oned.EAN8Reader;\nimport com.google.zxing.oned.ITFReader;\nimport com.google.zxing.oned.UPCAReader;\nimport com.google.zxing.oned.UPCEReader;\nimport com.google.zxing.pdf417.PDF417Reader;\nimport com.google.zxing.qrcode.QRCodeReader;\n\nimport java.util.EnumMap;\nimport java.util.Map;\n\nimport javax.naming.NameNotFoundException;\n\nimport com.google.zxing.Reader;\nimport com.google.zxing.Binarizer;\nimport com.google.zxing.BinaryBitmap;\nimport com.google.zxing.WriterException;\nimport com.google.zxing.BarcodeFormat;\nimport com.google.zxing.EncodeHintType;\nimport com.google.zxing.common.BitMatrix;\nimport com.google.zxing.common.BitArray;\nimport com.google.zxing.NotFoundException;\nimport com.google.zxing.FormatException;\nimport com.google.zxing.ChecksumException;\nimport com.google.zxing.LuminanceSource;\nimport com.google.zxing.Result;\nimport com.google.zxing.pdf417.PDF417Writer;\n\nimport com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;\nimport com.google.zxing.qrcode.decoder.Mode;\nimport com.google.zxing.qrcode.encoder.QRCode;\n\nimport com.google.zxing.datamatrix.encoder.HighLevelEncoder;\n\nimport com.code_intelligence.jazzer.api.FuzzedDataProvider;\n\npublic final class MultiFormatEncodeFuzzer {\n\n    public static void fuzzerTestOneInput(FuzzedDataProvider data) {\n        int width = data.consumeInt(100, 200);\n        int height = data.consumeInt(100, 200);\n        BarcodeFormat format = data.pickValue(BarcodeFormat.values());\n        String originalData = data.consumeRemainingAsAsciiString();\n\n        BitMatrix matrix;\n        try {\n            matrix = new MultiFormatWriter().encode(originalData, format, width, height);\n        } catch (WriterException | IllegalArgumentException e) {\n            return;\n        }\n\n        BinaryBitmap bitmap = null;\n        Result result;\n        try {\n            bitmap = new BinaryBitmap(new TrivialBinarizer(matrix));\n            result = getReader(format).decode(bitmap);\n        } catch (NotFoundException | ChecksumException | FormatException e) {\n            throw new IllegalStateException(\"Failed to recover\\n\" + originalData + \"\\nencoded with \" + format + \" in \"\n                    + width + \"x\" + height + \"\\n\\n\" + matrix.toString() + \"\\n\\n\" + bitmap.toString(), e);\n        }\n        String decodedData = result.getText();\n        if (!decodedData.equals(originalData)) {\n            throw new IllegalStateException(\n                    \"Failed to recover\\n\" + originalData + \"\\nencoded with \" + format + \" in \" + width + \"x\" + height\n                            + \", got:\\n\" + decodedData + \"\\n\\n\" + matrix.toString() + \"\\n\\n\" + bitmap.toString());\n        }\n    }\n\n    private static Reader getReader(BarcodeFormat format) {\n        switch (format) {\n            case EAN_8:\n                return new EAN8Reader();\n            case UPC_E:\n                return new UPCEReader();\n            case EAN_13:\n                return new EAN13Reader();\n            case UPC_A:\n                return new UPCAReader();\n            case QR_CODE:\n                return new QRCodeReader();\n            case CODE_39:\n                return new Code39Reader();\n            case CODE_93:\n                return new Code93Reader();\n            case CODE_128:\n                return new Code128Reader();\n            case ITF:\n                return new ITFReader();\n            case PDF_417:\n                return new PDF417Reader();\n            case CODABAR:\n                return new CodaBarReader();\n            case DATA_MATRIX:\n                return new DataMatrixReader();\n            case AZTEC:\n                return new AztecReader();\n            default:\n                throw new IllegalArgumentException(\"No encoder available for format \" + format);\n        }\n    }\n\n    private static final class TrivialBinarizer extends Binarizer {\n        private final BitMatrix matrix;\n\n        public TrivialBinarizer(BitMatrix matrix) {\n            super(new TrivialLuminanceSource(matrix));\n            this.matrix = matrix;\n        }\n\n        public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {\n            return matrix.getRow(y, row);\n        }\n\n        public BitMatrix getBlackMatrix() throws NotFoundException {\n            return matrix;\n        }\n\n        public Binarizer createBinarizer(LuminanceSource source) {\n            return new TrivialBinarizer(matrix);\n        }\n    }\n\n    private static final class TrivialLuminanceSource extends LuminanceSource {\n        private final BitMatrix matrix;\n\n        public TrivialLuminanceSource(BitMatrix matrix) {\n            super(matrix.getWidth(), matrix.getHeight());\n            this.matrix = matrix;\n        }\n\n        public byte[] getRow(int y, byte[] row) {\n            if (row.length != matrix.getWidth()) {\n                row = new byte[matrix.getWidth()];\n            }\n            BitArray bitRow = matrix.getRow(y, null);\n            for (int i = 0; i < matrix.getWidth(); i++) {\n                if (bitRow.get(i)) {\n                    row[i] = 0;\n                } else {\n                    row[i] = (byte) 255;\n                }\n            }\n            return row;\n        }\n\n        public byte[] getMatrix() {\n            byte[] bytes = new byte[matrix.getWidth() * matrix.getHeight()];\n            for (int x = 0; x < matrix.getWidth(); x++) {\n                for (int y = 0; y < matrix.getHeight(); y++) {\n                    if (!matrix.get(x, y))\n                        bytes[x + y * matrix.getWidth()] = (byte) 255;\n                }\n            }\n            return bytes;\n        }\n    }\n}\n"
  },
  {
    "path": "projects/zxing/build.sh",
    "content": "#!/bin/bash -eu\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nMAVEN_ARGS=\"-DskipTests -Djavac.src.version=15 -Djavac.target.version=15\"\n$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS\nCURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \\\n -Dexpression=project.version -q -DforceStdout)\ncp \"core/target/core-$CURRENT_VERSION.jar\" $OUT/zxing.jar\n\nmkdir -p $OUT/com/google/zxing\ncp core/target/test-classes/com/google/zxing/BufferedImageLuminanceSource.class $OUT/com/google/zxing\n\nALL_JARS=\"zxing.jar\"\n\n# The classpath at build-time includes the project jars in $OUT as well as the\n# Jazzer API. Additionally, include $OUT itself to pick up\n# BufferedImageLuminanceSource.\nBUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"$OUT/%s:\"):$JAZZER_API_PATH:$OUT\n\n# All .jar and .class files lie in the same directory as the fuzzer at runtime.\nRUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- \"\\$this_dir/%s:\"):\\$this_dir\n\nfor fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java'); do\n  fuzzer_basename=$(basename -s .java $fuzzer)\n  javac -cp $BUILD_CLASSPATH $fuzzer\n  cp $SRC/$fuzzer_basename*.class $OUT/\n\n  # Create an execution wrapper that executes Jazzer with the correct arguments.\n  echo \"#!/bin/bash\n# LLVMFuzzerTestOneInput for fuzzer detection.\nthis_dir=\\$(dirname \\\"\\$0\\\")\nif [[ \\\"\\$@\\\" =~ (^| )-runs=[0-9]+($| ) ]]; then\n  mem_settings='-Xmx1900m:-Xss900k'\nelse\n  mem_settings='-Xmx2048m:-Xss1024k'\nfi\nLD_LIBRARY_PATH=\\\"$JVM_LD_LIBRARY_PATH\\\":\\$this_dir \\\n\\$this_dir/jazzer_driver --agent_path=\\$this_dir/jazzer_agent_deploy.jar \\\n--cp=$RUNTIME_CLASSPATH \\\n--target_class=$fuzzer_basename \\\n--jvm_args=\\\"\\$mem_settings:-Djava.awt.headless=true\\\" \\\n\\$@\" > $OUT/$fuzzer_basename\n  chmod u+x $OUT/$fuzzer_basename\ndone\n"
  },
  {
    "path": "projects/zxing/project.yaml",
    "content": "homepage: \"https://github.com/zxing/zxing\"\nlanguage: jvm\nprimary_contact: \"srowen@gmail.com\"\nfuzzing_engines:\n  - libfuzzer\nmain_repo: \"https://github.com/zxing/zxing.git\"\nsanitizers:\n  - address\nvendor_ccs:\n  - \"norbert.schneider@code-intelligence.com\"\n"
  },
  {
    "path": "projects/zydis/Dockerfile",
    "content": "# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nFROM gcr.io/oss-fuzz-base/base-builder\n\nADD https://zydis.re/fuzzing-corpora/ZydisFuzzDecoder_seed_corpus.zip \\\n    $SRC/ZydisFuzzDecoder_seed_corpus.zip\nADD https://zydis.re/fuzzing-corpora/ZydisFuzzEncoder_seed_corpus.zip \\\n    $SRC/ZydisFuzzEncoder_seed_corpus.zip\nADD https://zydis.re/fuzzing-corpora/ZydisFuzzReEncoding_seed_corpus.zip \\\n    $SRC/ZydisFuzzReEncoding_seed_corpus.zip\n\nCOPY run_tests.sh build.sh $SRC/\n\nRUN git clone --recursive https://github.com/zyantific/zydis.git\nWORKDIR zydis\n"
  },
  {
    "path": "projects/zydis/build.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nset -eu\n\n#\n# Build Zydis library.\n#\n\nmkdir build && cd build\n\ncmake                                       \\\n    -DZYAN_FORCE_ASSERTS=ON                 \\\n    -DZYDIS_BUILD_EXAMPLES=OFF              \\\n    -DZYDIS_BUILD_TOOLS=ON                  \\\n    -DZYDIS_BUILD_TESTS=ON                  \\\n    -DCMAKE_BUILD_TYPE=RelWithDebInfo       \\\n    \"-DCMAKE_C_COMPILER=${CC}\"              \\\n    \"-DCMAKE_CXX_COMPILER=${CXX}\"           \\\n    \"-DCMAKE_C_FLAGS=${CFLAGS}\"             \\\n    \"-DCMAKE_CXX_FLAGS=${CXXFLAGS}\"         \\\n    ..\n\nmake -j$(nproc) VERBOSE=1\n\n#\n# Build fuzzing tools.\n#\n\nfunction build_fuzzer() {\n    source_file=\"${1}\"\n    max_len=\"${2}\"\n    executable=\"${source_file%.c}\"\n\n    $CC                                     \\\n        $CFLAGS                             \\\n        -c                                  \\\n        \"../tools/${source_file}\"           \\\n        ../tools/ZydisFuzzShared.c          \\\n        -DZYDIS_LIBFUZZER                   \\\n        -I .                                \\\n        -I ./zycore                         \\\n        -I ../include                       \\\n        -I ../dependencies/zycore/include\n\n     $CXX                                   \\\n        $CXXFLAGS                           \\\n        \"${LIB_FUZZING_ENGINE}\"             \\\n        \"$executable.o\"                      \\\n        ZydisFuzzShared.o                   \\\n        -DZYDIS_LIBFUZZER                   \\\n        -o \"${OUT}/${executable}\"           \\\n        ./libZydis.a\n\n    echo -e \"[libfuzzer]\\nmax_len = ${max_len}\" > \"${OUT}/${executable}.options\"\n}\n\nbuild_fuzzer \"ZydisFuzzDecoder.c\"    350\nbuild_fuzzer \"ZydisFuzzEncoder.c\"    450\nbuild_fuzzer \"ZydisFuzzReEncoding.c\" 100\n\n#\n# Place fuzzing corpora where they belong.\n#\n\ncp ${SRC}/Zydis*_seed_corpus.zip ${OUT}\n"
  },
  {
    "path": "projects/zydis/project.yaml",
    "content": "homepage: \"https://github.com/zyantific/zydis\"\nlanguage: c\nprimary_contact: \"joel.hoener@gmail.com\"\nauto_ccs:\n - \"flobernd90@gmail.com\"\nsanitizers:\n - address\n - memory\n - undefined\nmain_repo: 'https://github.com/zyantific/zydis.git'\n"
  },
  {
    "path": "projects/zydis/run_tests.sh",
    "content": "#!/bin/bash -eu\n#\n# Copyright 2026 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\nctest --test-dir build\n"
  },
  {
    "path": "tools/vscode-extension/.editorconfig",
    "content": "root = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ninsert_final_newline = true\n"
  },
  {
    "path": "tools/vscode-extension/.eslintignore",
    "content": "build/\n"
  },
  {
    "path": "tools/vscode-extension/.eslintrc.json",
    "content": "{\n  \"extends\": \"./node_modules/gts/\"\n}\n"
  },
  {
    "path": "tools/vscode-extension/.gitignore",
    "content": "out\nbuild\ndist\nnode_modules\n.vscode-test/\n*.vsix\n"
  },
  {
    "path": "tools/vscode-extension/.prettierrc.js",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\nmodule.exports = {\n  ...require('gts/.prettierrc.json')\n}\n"
  },
  {
    "path": "tools/vscode-extension/.vscode/extensions.json",
    "content": "{\n\t// See http://go.microsoft.com/fwlink/?LinkId=827846\n\t// for the documentation about the extensions.json format\n\t\"recommendations\": [\n\t\t\"dbaeumer.vscode-eslint\"\n\t]\n}\n"
  },
  {
    "path": "tools/vscode-extension/.vscode/launch.json",
    "content": "// A launch configuration that compiles the extension and then opens it inside a new window\n// Use IntelliSense to learn about possible attributes.\n// Hover to view descriptions of existing attributes.\n// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t{\n\t\t\t\"name\": \"Run Extension\",\n\t\t\t\"type\": \"extensionHost\",\n\t\t\t\"request\": \"launch\",\n\t\t\t\"args\": [\n\t\t\t\t\"--extensionDevelopmentPath=${workspaceFolder}\"\n\t\t\t],\n\t\t\t\"outFiles\": [\n\t\t\t\t\"${workspaceFolder}/out/**/*.js\"\n\t\t\t],\n\t\t\t\"preLaunchTask\": \"${defaultBuildTask}\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Extension Tests\",\n\t\t\t\"type\": \"extensionHost\",\n\t\t\t\"request\": \"launch\",\n\t\t\t\"args\": [\n\t\t\t\t\"--extensionDevelopmentPath=${workspaceFolder}\",\n\t\t\t\t\"--extensionTestsPath=${workspaceFolder}/out/test/suite/index\"\n\t\t\t],\n\t\t\t\"outFiles\": [\n\t\t\t\t\"${workspaceFolder}/out/test/**/*.js\"\n\t\t\t],\n\t\t\t\"preLaunchTask\": \"${defaultBuildTask}\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "tools/vscode-extension/.vscode/settings.json",
    "content": "// Place your settings in this file to overwrite default and user settings.\n{\n    \"files.exclude\": {\n        \"out\": false // set this to true to hide the \"out\" folder with the compiled JS files\n    },\n    \"search.exclude\": {\n        \"out\": true // set this to false to include \"out\" folder in search results\n    },\n    // Turn off tsc task auto detection since we have the necessary tasks as npm scripts\n    \"typescript.tsc.autoDetect\": \"off\"\n}"
  },
  {
    "path": "tools/vscode-extension/.vscode/tasks.json",
    "content": "// See https://go.microsoft.com/fwlink/?LinkId=733558\n// for the documentation about the tasks.json format\n{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t{\n\t\t\t\"type\": \"npm\",\n\t\t\t\"script\": \"watch\",\n\t\t\t\"problemMatcher\": \"$tsc-watch\",\n\t\t\t\"isBackground\": true,\n\t\t\t\"presentation\": {\n\t\t\t\t\"reveal\": \"never\"\n\t\t\t},\n\t\t\t\"group\": {\n\t\t\t\t\"kind\": \"build\",\n\t\t\t\t\"isDefault\": true\n\t\t\t}\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "tools/vscode-extension/.vscodeignore",
    "content": ".vscode/**\n.vscode-test/**\nsrc/**\n.gitignore\n.yarnrc\nvsc-extension-quickstart.md\n**/tsconfig.json\n**/.eslintrc.json\n**/*.map\n**/*.ts\n"
  },
  {
    "path": "tools/vscode-extension/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "tools/vscode-extension/README.md",
    "content": "# OSS-Fuzz VSCode extension\n\n[OSS-Fuzz](https://github.com/google/oss-fuzz) is a fuzzing toolkit and service for fuzzing open source projects. This VSCode extension provides features and capabilities for interacting with the OSS-Fuzz toolkit and also to compare local changes to the OSS-Fuzz cloud database by way of [Open source fuzz introspection](https://introspector.oss-fuzz.com).\n\n## Features\n\nThe VSCode extension is largely driven by commands at this point. The featues of these commands includes:\n\n- Easily setting up OSS-Fuzz\n- Templates for easily setting up a new OSS-Fuzz project\n- Building arbitrary projects from OSS-Fuzz\n- Modify a project from VSCode and test changes in OSS-Fuzz\n- Easily extract code coverage of fuzzers, including local-only fuzzers\n- Compare local code coverage to what is currently achieved by OSS-Fuzz\n- Auto-generation of fuzzer templates\n\nFor a full list of commands and their features, please check the commands page."
  },
  {
    "path": "tools/vscode-extension/package.json",
    "content": "{\n  \"name\": \"OSS-Fuzz\",\n  \"displayName\": \"OSS-Fuzz\",\n  \"description\": \"\",\n  \"version\": \"0.0.5\",\n  \"publisher\": \"OSS-FuzzMaintainers\",\n  \"icon\": \"images/thumbnail.png\",\n  \"engines\": {\n    \"vscode\": \"^1.76.0\"\n  },\n  \"repository\": \"https://github.com/google/oss-fuzz\",\n  \"categories\": [\n    \"Other\"\n  ],\n  \"extensionDependencies\": [\n    \"mindaro-dev.file-downloader\"\n  ],\n  \"activationEvents\": [],\n  \"main\": \"./build/src/extension.js\",\n  \"contributes\": {\n    \"configurations\": [\n      {\n        \"id\": \"OSS-Fuzz-Base\",\n        \"title\": \"Base path to OSS-Fuzz\",\n        \"properties\": {\n          \"oss-fuzz.OSS.Path\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    ],\n    \"viewsWelcome\": [\n      {\n        \"view\": \"workbench.explorer.emptyView\",\n        \"contents\": \"You can have paragraphs of text here. You can have [links](https://code.visualstudio.com) to external sources or [internal commands](command:welcome-view-content-sample.hello).\\nUse new lines to have new paragraphs.\\nPlace a link alone in a paragraph to make it a button\\n[Hello](command:welcome-view-content-sample.hello)\"\n      }\n    ],\n    \"commands\": [\n      {\n        \"command\": \"oss-fuzz.SetUp\",\n        \"title\": \"OSS-Fuzz: Set Up OSS-Fuzz\",\n        \"description\": \"Downloads the OSS-Fuzz repository and places it under /tmp/oss-fuzz. This will then be the OSS-Fuzz repository used by vscode.\"\n      },\n      {\n        \"command\": \"oss-fuzz.RunFuzzer\",\n        \"title\": \"OSS-Fuzz: Run Fuzzer\",\n        \"description\": \"Runs a single fuzzer from a given project. The fuzzer must already be build, meaning the project should be build first.\"\n      },\n      {\n        \"command\": \"oss-fuzz.ListFuzzers\",\n        \"title\": \"OSS-Fuzz: List Fuzzers\",\n        \"description\": \"Lists the fuzzers built for a given project. The project must be build first.\"\n      },\n      {\n        \"command\": \"oss-fuzz.GetCodeCoverage\",\n        \"title\": \"OSS-Fuzz: Display Code Coverage (Python only)\",\n        \"description\": \"Downloads the latest code coverage from OSS-Fuzz's cloud data (can find at https://introspector.oss-fuzz.com).\"\n      },\n      {\n        \"command\": \"oss-fuzz.ClearCodeCoverage\",\n        \"title\": \"OSS-Fuzz: Clear Code Coverage\",\n        \"description\": \"Clears code coverage visualization in the editor.\"\n      },\n      {\n        \"command\": \"oss-fuzz.CreateOSSFuzzSetup\",\n        \"title\": \"OSS-Fuzz: Initialize OSS-Fuzz Set Up\",\n        \"description\": \"Creates the relevant files using templates to set up an OSS-Fuzz project. Uses minor heuristics e.g. detection of language.\"\n      },\n      {\n        \"command\": \"oss-fuzz.WSBuildFuzzers\",\n        \"title\": \"OSS-Fuzz: Build Fuzzers In Workspace\",\n        \"description\": \"Builds the fuzzers from the project in the current VSCode workspace.\"\n      },\n      {\n        \"command\": \"oss-fuzz.SetupCIFuzz\",\n        \"title\": \"OSS-Fuzz: Set up CIFuzz\",\n        \"description\": \"Creates the files necessary for a CIFuzz set up.\"\n      },\n      {\n        \"command\": \"oss-fuzz.testFuzzer\",\n        \"title\": \"OSS-Fuzz: Test Specific Fuzzer\",\n        \"description\": \"Tests if a given fuzzer works by running it for 10 seconds.\"\n      },\n      {\n        \"command\": \"oss-fuzz.testCodeCoverage\",\n        \"title\": \"OSS-Fuzz: End-To-End Code Coverage Generation\",\n        \"description\": \"Builds the fuzzers in a ASAN mode for a project, collects corpus using the ASAN fuzzers and then generates an HTLM code coverage report using the generated corpus.\"\n      },\n      {\n        \"command\": \"oss-fuzz.Redo\",\n        \"title\": \"OSS-Fuzz: Redo Previous Command\",\n        \"description\": \"Performs the exact same command as the most recent one. Will provide the same input to the command as the previous one. This is efficient when e.g. continuously generating code coverage reports while working on improving a fuzzing set up.\"\n      },\n      {\n        \"command\": \"oss-fuzz.Template\",\n        \"title\": \"OSS-Fuzz: Fuzzer Creation Using Templates\",\n        \"description\": \"Creates a template fuzzer file using a catalogue of templates available.\"\n      },\n      {\n        \"command\": \"oss-fuzz.GenerateClusterfuzzLite\",\n        \"title\": \"OSS-Fuzz: [CFLite] Generate ClusterfuzzLite setup\",\n        \"description\": \"Creates the files needed for ClusterfuzzLite integration.\"\n      },\n      {\n        \"command\": \"oss-fuzz.WSBuildFuzzersCFLite\",\n        \"title\": \"OSS-Fuzz: [CFLite] Build Fuzzers In Workspace\",\n        \"description\": \"Builds the ClusterfuzzLite fuzzers from the project in the current VSCode workspace.\"\n      },\n      {\n        \"command\": \"oss-fuzz.testFuzzerCFLite\",\n        \"title\": \"OSS-Fuzz: [CFLite] Test running a specific fuzzer.\",\n        \"description\": \"Builds the CFLite setup and runs a fuzzer for a short period of time.\"\n      },\n      {\n        \"command\": \"oss-fuzz.setupFuzzIntrospector\",\n        \"title\": \"OSS-Fuzz: Set up Fuzz Introspector\",\n        \"description\": \"Install fuzz introspector on the system\"\n      },\n      {\n        \"command\": \"oss-fuzz.runFuzzIntrospector\",\n        \"title\": \"OSS-Fuzz: Run Full Fuzz Introspector\",\n        \"description\": \"Runs a full Fuzz Introspector\"\n      },\n      {\n        \"command\": \"oss-fuzz.GetOptimalTargets\",\n        \"title\": \"OSS-Fuzz: Get optimal targets\",\n        \"description\": \"Gets the optimal targets of this project\"\n      }\n    ],\n    \"walkthroughs\":[\n      {\n        \"id\": \"BuildAndRunExisting Project\",\n        \"title\": \"Set up OSS-Fuzz\",\n        \"description\": \"This walkthrough takes you through how to set up OSS-Fuzz in the VSCode extension and proceeding to build the fuzzers of an existing project as well as running a fuzzer from the project.\",\n        \"steps\": [\n          {\n            \"id\": \"s1\",\n            \"title\": \"Set up OSS-Fuzz\",\n            \"description\": \"This step sets up OSS-Fuzz in the folder /tmp/oss-fuzz\",\n            \"completionEvents\": [\"onCommand:oss-fuzz.SetUp\"],\n            \"media\": {\"altText\": \".\", \"image\": \"images/workflow-1-s-1\"}\n          }\n        ]\n      }\n    ]\n  },\n  \"scripts\": {\n    \"vscode:prepublish\": \"npm run compile\",\n    \"compile\": \"tsc\",\n    \"watch\": \"tsc -watch -p ./\",\n    \"pretest\": \"npm run compile\",\n    \"lint\": \"gts lint\",\n    \"clean\": \"gts clean\",\n    \"fix\": \"gts fix\",\n    \"prepare\": \"npm run compile\",\n    \"posttest\": \"npm run lint\"\n  },\n  \"devDependencies\": {\n    \"@types/glob\": \"^8.1.0\",\n    \"@types/mocha\": \"^10.0.1\",\n    \"@types/node\": \"^14.11.2\",\n    \"@types/vscode\": \"^1.76.0\",\n    \"@typescript-eslint/eslint-plugin\": \"^5.53.0\",\n    \"@typescript-eslint/parser\": \"^5.53.0\",\n    \"@vscode/test-electron\": \"^2.2.3\",\n    \"eslint\": \"^8.34.0\",\n    \"glob\": \"^8.1.0\",\n    \"mocha\": \"^10.8.2\",\n    \"typescript\": \"~4.7.0\",\n    \"gts\": \"^3.1.1\"\n  },\n  \"dependencies\": {\n    \"@microsoft/vscode-file-downloader-api\": \"^1.0.1\"\n  }\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/cifuzz.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {println} from './logger';\n\n/**\n * Creates a CIFuzz template\n * @param language\n * @param projectName\n * @param secondToRun\n * @returns\n */\nexport function cifuzzGenerator(\n  language: string,\n  projectName: string,\n  secondToRun: Number\n) {\n  println('Exporting cifuzz logic ' + language);\n\n  const cifuzzTemplate = `name: CIFuzz\non: [pull_request]\npermissions: {}\njobs:\n    Fuzzing:\n    runs-on: ubuntu-latest\n    permissions:\n        security-events: write\n    steps:\n    - name: Build Fuzzers\n        id: build\n        uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master\n        with:\n        oss-fuzz-project-name: '${projectName}'\n        language: ${language}\n    - name: Run Fuzzers\n        uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master\n        with:\n        oss-fuzz-project-name: '${projectName}'\n        language: ${language}\n        fuzz-seconds: ${secondToRun}\n        output-sarif: true\n    - name: Upload Crash\n        uses: actions/upload-artifact@v4\n        if: failure() && steps.build.outcome == 'success'\n        with:\n        name: artifacts\n        path: ./out/artifacts\n    - name: Upload Sarif\n        if: always() && steps.build.outcome == 'success'\n        uses: github/codeql-action/upload-sarif@v2\n        with:\n        # Path to SARIF file relative to the root of the repository\n        sarif_file: cifuzz-sarif/results.sarif\n        checkout_path: cifuzz-sarif`;\n\n  return cifuzzTemplate;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commandUtils.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nexport const commandHistory: any[] = [];\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdBuildFuzzerFromWorkspace.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nimport {println} from '../logger';\nimport {commandHistory} from '../commandUtils';\nimport {\n  hasOssFuzzInWorkspace,\n  getOssFuzzWorkspaceProjectName,\n  setStatusText,\n} from '../utils';\nimport {buildFuzzersFromWorkspace} from '../ossfuzzWrappers';\n\nexport async function cmdInputCollectorBuildFuzzersFromWorkspace() {\n  let ossFuzzProjectName = '';\n  // First determine if we have a name in the workspace\n  if (await hasOssFuzzInWorkspace()) {\n    /**\n     * The fuzzers are in the workspace, as opposed to e.g. the oss-fuzz dirctory.\n     */\n    ossFuzzProjectName = await getOssFuzzWorkspaceProjectName();\n  } else {\n    // If we did not have that, ask the user.\n\n    const ossFuzzProjectNameInput = await vscode.window.showInputBox({\n      value: '',\n      placeHolder: 'The OSS-Fuzz project name',\n    });\n    if (!ossFuzzProjectNameInput) {\n      println('Did not get a ossFuzzTargetProject');\n      return false;\n    }\n    ossFuzzProjectName = ossFuzzProjectNameInput.toString();\n  }\n\n  // Create an history object\n  const args = new Object({\n    projectName: ossFuzzProjectName,\n    sanitizer: '',\n    toClean: false,\n  });\n\n  const commandObject = new Object({\n    commandType: 'oss-fuzz.WSBuildFuzzers',\n    Arguments: args,\n    dispatcherFunc: cmdDispatchBuildFuzzersFromWorkspace,\n  });\n  console.log('L1: ' + commandHistory.length);\n  commandHistory.push(commandObject);\n\n  await cmdDispatchBuildFuzzersFromWorkspace(args);\n  return true;\n}\n\nasync function cmdDispatchBuildFuzzersFromWorkspace(args: any) {\n  await setStatusText('Building fuzzers: starting');\n  const res = await buildFuzzersFromWorkspace(\n    args.projectName,\n    args.sanitizer,\n    args.toClean\n  );\n  if (res) {\n    await setStatusText('Building fuzzers: finished');\n  } else {\n    await setStatusText('Building fuzzers: failed');\n  }\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdBuildFuzzerFromWorkspaceCFLite.ts",
    "content": "/* eslint-disable @typescript-eslint/no-explicit-any */\n// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {commandHistory} from '../commandUtils';\nimport {setStatusText} from '../utils';\nimport {buildFuzzersFromWorkspaceClusterfuzzLite} from '../ossfuzzWrappers';\n\nexport async function cmdInputCollectorBuildFuzzersFromWorkspaceCFLite() {\n  // Create an history object\n  const args = new Object({\n    toClean: false,\n  });\n\n  const commandObject = new Object({\n    commandType: 'oss-fuzz.WSBuildFuzzers',\n    Arguments: args,\n    dispatcherFunc: cmdDispatchbuildFuzzersFromWorkspaceClusterfuzzLite,\n  });\n  console.log('L1: ' + commandHistory.length);\n  commandHistory.push(commandObject);\n\n  await cmdDispatchbuildFuzzersFromWorkspaceClusterfuzzLite(args);\n  return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nasync function cmdDispatchbuildFuzzersFromWorkspaceClusterfuzzLite(_args: any) {\n  await setStatusText('[CFLite] Building fuzzers: starting');\n  const res = await buildFuzzersFromWorkspaceClusterfuzzLite();\n  if (res) {\n    await setStatusText('[CFLite] Building fuzzers: finished');\n  } else {\n    await setStatusText('[CFLite] Building fuzzers: failed');\n  }\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdCreateOSSFuzzSetup.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {setupProjectInitialFiles} from '../projectIntegrationHelper';\nimport {setStatusText} from '../utils';\n\nexport async function createOssFuzzSetup() {\n  await setStatusText('Creating OSS-Fuzz setup: starting');\n  const res = await setupProjectInitialFiles(false);\n  if (res) {\n    await setStatusText('Creating OSS-Fuzz setup: finished');\n  } else {\n    await setStatusText('Creating OSS-Fuzz setup: failed');\n  }\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdDispatcherGenerateClusterfuzzLite.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Command for generating template fuzzers. This is a short-cut for rapid\n * prototyping as well as an archive for inspiration.\n */\nimport * as vscode from 'vscode';\nimport {setStatusText} from '../utils';\n\nimport {setupProjectInitialFiles} from '../projectIntegrationHelper';\n\nexport async function cmdDispatcherGenerateClusterfuzzLite(\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  _context: vscode.ExtensionContext\n) {\n  await setStatusText('Creating OSS-Fuzz setup: starting');\n  const res = await setupProjectInitialFiles(true);\n  if (res) {\n    await setStatusText('Creating OSS-Fuzz setup: finished');\n  } else {\n    await setStatusText('Creating OSS-Fuzz setup: failed');\n  }\n  return;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdDisplayCoverage.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nimport {loadCoverageIntoWorkspace} from '../coverageHelper';\nimport {println} from '../logger';\nimport {getApi, FileDownloader} from '@microsoft/vscode-file-downloader-api';\n\n/*\n * Displays code coverage from OSS-Fuzz.\n *\n * Downloads a code coverage report from the OSS-Fuzz online storage, and then overlays\n * the relevant source files with the coverage information.\n */\nexport async function displayCodeCoverageFromOssFuzz(\n  context: vscode.ExtensionContext\n) {\n  const projectName = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: \"The project you'd like to get code coverage for.\",\n  });\n  if (!projectName) {\n    return;\n  }\n  println('Getting code coverage for ' + projectName);\n\n  const fileDownloader: FileDownloader = await getApi();\n\n  const currentDate = new Date();\n  const yesterday = new Date(currentDate);\n  yesterday.setDate(yesterday.getDate() - 1);\n\n  const day = yesterday.getDate();\n  const month = yesterday.getMonth();\n  const year = yesterday.getFullYear();\n\n  try {\n    const codeCoverageFile: vscode.Uri = await fileDownloader.downloadFile(\n      vscode.Uri.parse(\n        'https://storage.googleapis.com/oss-fuzz-coverage/' +\n          projectName +\n          '/textcov_reports/' +\n          year.toString() +\n          month.toString() +\n          day.toString() +\n          '/all_cov.json'\n      ),\n      'all_cov.json',\n      context\n    );\n    await loadCoverageIntoWorkspace(context, codeCoverageFile);\n  } catch (err) {\n    println(\n      'Could not get the URL. Currently, this feature is only supported for Python projects'\n    );\n    return;\n  }\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdEndToEndCoverage.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nconst fs = require('fs');\nimport {println} from '../logger';\nimport {commandHistory} from '../commandUtils';\nimport {buildFuzzersFromWorkspace, runFuzzerHandler} from '../ossfuzzWrappers';\nimport {listFuzzersForProject, systemSync, setStatusText} from '../utils';\nimport {\n  compareLocalToRemoteCoverage,\n  loadCoverageIntoWorkspace,\n} from '../coverageHelper';\nimport {extensionConfig} from '../config';\n\n/**\n * Performs the activities:\n * 1) Build a project using address sanitizer\n * 2) Run each fuzzer of the project, saving corpus\n * 3) Build project using coverage sanitizer\n * 4) Collect coverage\n * @param context\n * @returns\n */\nexport async function runEndToEndAndGetCoverage(\n  context: vscode.ExtensionContext\n) {\n  println('Getting code coverage');\n  await setStatusText('end-to-end coverage: getting input');\n  const ossFuzzProjectNameInput = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'The OSS-Fuzz project name',\n  });\n  if (!ossFuzzProjectNameInput) {\n    println('Did not get a ossFuzzTargetProject');\n    return;\n  }\n  const secondsToRunEachFuzzer = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Seconds to run each fuzzer',\n  });\n  if (!secondsToRunEachFuzzer) {\n    println('Did not get number of seconds to run each fuzzer');\n    return;\n  }\n\n  // Create an history object\n  const args = new Object({\n    projectName: ossFuzzProjectNameInput.toString(),\n    secondsToRun: secondsToRunEachFuzzer.toString(),\n    vsContext: context,\n  });\n\n  const commandObject = new Object({\n    commandType: 'oss-fuzz.cmdDispatchEndToEndRun',\n    Arguments: args,\n    dispatcherFunc: cmdDispatchEndToEndRun,\n  });\n  console.log('L1: ' + commandHistory.length);\n  commandHistory.push(commandObject);\n\n  await cmdDispatchEndToEndRun(args);\n  return;\n}\n\nasync function cmdDispatchEndToEndRun(args: any) {\n  await setStatusText('end-to-end coverage: starting');\n  const res = await endToEndRun(\n    args.projectName,\n    args.secondsToRun,\n    args.vsContext\n  );\n  if (res) {\n    await setStatusText('end-to-end coverage: finished succesfully');\n  } else {\n    await setStatusText('end-to-end coverage: failed');\n  }\n  return;\n}\n\nasync function endToEndRun(\n  ossFuzzProjectNameInput: string,\n  secondsToRunEachFuzzer: string,\n  context: vscode.ExtensionContext\n) {\n  await setStatusText('end-to-end coverage: build with ASAN');\n  vscode.window.showInformationMessage(\n    'Building project: ' + ossFuzzProjectNameInput.toString()\n  );\n  if (\n    (await buildFuzzersFromWorkspace(\n      ossFuzzProjectNameInput.toString(),\n      '',\n      true\n    )) === false\n  ) {\n    println('Failed to build project');\n    return false;\n  }\n  println('Build projects');\n\n  // List all of the fuzzers in the project\n  const fuzzersInProject = await listFuzzersForProject(\n    ossFuzzProjectNameInput,\n    extensionConfig.ossFuzzPepositoryWorkPath\n  );\n\n  // Run all of the fuzzers in the project\n  await setStatusText('end-to-end coverage: collecting corpus');\n  println('Fuzzers found in project: ' + fuzzersInProject.toString());\n  println('Running each of the fuzzers to collect a corpus');\n  for (const fuzzName of fuzzersInProject) {\n    println('Running fuzzer: ' + fuzzName);\n    await setStatusText('end-to-end coverage: collecting corpus: ' + fuzzName);\n    // Corpus directory\n    const fuzzerCorpusPath =\n      extensionConfig.ossFuzzPepositoryWorkPath +\n      '/build/corpus/' +\n      ossFuzzProjectNameInput +\n      '/' +\n      fuzzName;\n\n    await systemSync('mkdir', ['-p', fuzzerCorpusPath]);\n\n    await runFuzzerHandler(\n      ossFuzzProjectNameInput,\n      fuzzName,\n      secondsToRunEachFuzzer.toString(),\n      fuzzerCorpusPath\n    );\n  }\n\n  // Build with code coverage\n  println('Building project with coverage sanitizer');\n  await setStatusText('end-to-end coverage: building with coverage');\n  await buildFuzzersFromWorkspace(\n    ossFuzzProjectNameInput.toString(),\n    'coverage',\n    true\n  );\n\n  // Run coverage command\n  println('Collecting code coverage');\n  await setStatusText('end-to-end coverage: collecting coverage');\n  const args: Array<string> = [\n    extensionConfig.ossFuzzPepositoryWorkPath + '/infra/helper.py',\n    'coverage',\n    '--port',\n    '',\n    '--no-corpus-download',\n    ossFuzzProjectNameInput.toString(),\n  ];\n  await systemSync('python3', args);\n  await setStatusText('end-to-end coverage: finished collecting coverage');\n  println('Load coverage report with the command:');\n  println(\n    'python3 -m http.server 8008 --directory /tmp/oss-fuzz/build/out/' +\n      ossFuzzProjectNameInput.toString() +\n      '/report/'\n  );\n\n  println('Trying to load code coverage in IDE');\n  const allCovPath =\n    extensionConfig.ossFuzzPepositoryWorkPath +\n    '/build/out/' +\n    ossFuzzProjectNameInput.toString() +\n    '/textcov_reports/all_cov.json';\n  if (fs.existsSync(allCovPath)) {\n    const generatedCodeCoverageFile = vscode.Uri.file(allCovPath);\n    await loadCoverageIntoWorkspace(context, generatedCodeCoverageFile);\n  }\n\n  await compareLocalToRemoteCoverage(\n    context,\n    ossFuzzProjectNameInput.toString()\n  );\n\n  return true;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdFIGetOptimalTargets.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {getOptimalTargetsFromIntrospector} from '../fuzzIntrospectorHelper';\n\nexport async function runGetOptimalTargetsHandler() {\n  getOptimalTargetsFromIntrospector();\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdListFuzzers.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\n\nimport {listFuzzersForProject} from '../utils';\nimport {println} from '../logger';\nimport {extensionConfig} from '../config';\n\n/**\n * Lists all the fuzzers for a project.\n */\nexport async function listFuzzersHandler() {\n  // Lists all of the fuzzers from a project.\n  const projectName = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Type a project name',\n  });\n  if (!projectName) {\n    console.log('Failed to get project name');\n    return;\n  }\n  println('Listing fuzzers for project ' + projectName);\n\n  await listFuzzersForProject(\n    projectName?.toString(),\n    extensionConfig.ossFuzzPepositoryWorkPath\n  );\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdRedo.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {commandHistory} from '../commandUtils';\n\n/**\n * Rerun the latest command\n */\nexport async function cmdDispatcherRe() {\n  if (commandHistory.length === 0) {\n    console.log('command history is empty');\n    return false;\n  }\n\n  const commandObj: any = commandHistory[commandHistory.length - 1];\n\n  console.log('Redoing');\n  console.log(commandObj.commandType);\n  await commandObj.dispatcherFunc(commandObj.Arguments);\n  //await commandObj.dispatcherFunc(commandObj.args);\n  return true;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdReproduceTestcase.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nconst fs = require('fs');\nimport {println} from '../logger';\nimport {commandHistory} from '../commandUtils';\nimport {systemSyncLogIfFailure} from '../utils';\nimport {buildFuzzersFromWorkspace} from '../ossfuzzWrappers';\nimport {extensionConfig} from '../config';\nconst readline = require('readline');\n\nexport async function cmdInputCollectorReproduceTestcase() {\n  // Runs a fuzzer from a given project.\n  const crashFileInput = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'The ID of the testcase.',\n  });\n  if (!crashFileInput) {\n    return;\n  }\n  // Create an history object and append it to the command history.\n  const args = new Object({\n    crashFile: crashFileInput.toString(),\n  });\n\n  const commandObject = new Object({\n    commandType: 'oss-fuzz.ReproduceFuzzer',\n    Arguments: args,\n    dispatcherFunc: cmdDispatchReproduceTestcase,\n  });\n  commandHistory.push(commandObject);\n\n  await cmdDispatchReproduceTestcase(args);\n  return true;\n}\n\nasync function cmdDispatchReproduceTestcase(args: any) {\n  await reproduceTestcase(args.crashFile);\n}\n\nexport async function reproduceTestcase(crashInfoFileInput: string) {\n  println('Reproducing testcase for ' + crashInfoFileInput);\n  println('Checking directory: ' + extensionConfig.crashesDirectory);\n\n  const crashInfoFile =\n    extensionConfig.crashesDirectory + '/' + crashInfoFileInput + '.info';\n  println(crashInfoFile);\n  try {\n    if (fs.existsSync(crashInfoFile)) {\n      println('File exists');\n    } else {\n      println('Crash file does not exist');\n      return;\n    }\n  } catch (err) {\n    console.error(err);\n    return;\n  }\n\n  // At this point the file exists\n  const r = readline.createInterface({\n    input: fs.createReadStream(crashInfoFile),\n  });\n\n  let targetProject = 'N/A';\n  let targetFuzzer = 'N/A';\n  // Logic for passing the file. This is based off of clusterfuzz monorail reports,\n  // and the intention is the file needs to be a copy of:\n  //\n  // Project: project-name\n  // Fuzzing Engine: libFuzzer\n  // Fuzz Target: fuzzer-name\n  //\n  // Example:\n  // The following URL: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59747\n  // has the bug information:\n  // \"\"\"\n  // Project: my-fuzzing-project\n  // Fuzzing Engine: libFuzzer\n  // Fuzz Target: the-fuzzer-name-fuzz-parseXX\n  // Job Type: libfuzzer_asan_my-fuzzing-project\n  // Platform Id: linux\n  // \"\"\"\n  // and a link to a reproducer test case:\n  // https://oss-fuzz.com/download?testcase_id=5009071179431936\n  // which, when accessed will download the file\n  // clusterfuzz-testcase-minimized-flb-it-fuzz-config_map_fuzzer_OSSFUZZ-5009071179431936\n  //\n  // To enable reproducing of this issue we need to:\n  // - 1) Download the crash file and place it in the directory given in config.ts\n  //      and \"crashesDirectory\" variable.\n  // - 2) create a file \"5009071179431936.info\" and paste the information above\n  //      (Project:... Fuzz Target: ...) into the file. This information is\n  //      needed because we need to know project name and fuzzer name in order\n  //      to reproduce the crash.\n  // - 3) the reproducer can now be reproduced using the reproduce command\n  //      with argument \"5009071179431936\" as argument.\n  r.on('line', (text: string) => {\n    println(text);\n    if (text.startsWith('Project: ')) {\n      println('Starts with project');\n      println(text.split('Project: ').toString());\n      targetProject = text.split('Project: ')[1];\n    } else if (text.startsWith('Fuzzing Engine: ')) {\n      println('Starts with fuzzing engine');\n    } else if (text.startsWith('Fuzz Target:')) {\n      println('Starts with Fuzz Target');\n      targetFuzzer = text.split('Fuzz Target: ')[1];\n    } else if (text.startsWith('Job Type:')) {\n      println('Starts with Job Type');\n    }\n  });\n\n  r.on('close', async () => {\n    println('Target project: ' + targetProject);\n    println('Target fuzzer: ' + targetFuzzer);\n\n    // Build a fresh version of the project.\n    const buildResult: boolean = await buildFuzzersFromWorkspace(\n      targetProject,\n      '',\n      true\n    );\n    if (!buildResult) {\n      println('Failed to build fuzzers');\n      return false;\n    }\n\n    // We have a fresh build of the project, proceed to reproduce the testcase.\n    const crashInputTestCase =\n      extensionConfig.crashesDirectory +\n      '/' +\n      'clusterfuzz-testcase-minimized-' +\n      targetFuzzer +\n      '-' +\n      crashInfoFileInput;\n    // Run reproduce command against the target file\n    // Build the fuzzers using OSS-Fuzz infrastructure.\n    const cmdToExec = 'python3';\n    const args = [\n      extensionConfig.ossFuzzPepositoryWorkPath + '/infra/helper.py',\n      'reproduce',\n      targetProject,\n      targetFuzzer,\n      crashInputTestCase,\n    ];\n    if (!(await systemSyncLogIfFailure(cmdToExec, args))) {\n      println('Failed to reproduce testcase');\n    }\n\n    return true;\n  });\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdRunFI.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {runFuzzIntrospector} from '../fuzzIntrospectorHelper';\n\n/**\n * Function for setting up Fuzz Introspector by way of a Python virtual env.\n */\nexport async function runFuzzIntrospectorHandler() {\n  runFuzzIntrospector();\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdRunFuzzer.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nimport {println} from '../logger';\nimport {commandHistory} from '../commandUtils';\nimport {runFuzzerHandler} from '../ossfuzzWrappers';\n\nexport async function cmdInputCollectorRunSpecificFuzzer() {\n  let projectNameArg = '';\n  let fuzzerName = '';\n  let secondsToRun = '';\n\n  // Runs a fuzzer from a given project.\n  const projectNameFromPrompt = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Type a project name',\n  });\n  if (!projectNameFromPrompt) {\n    println('Failed to get project name');\n    return;\n  }\n  projectNameArg = projectNameFromPrompt.toString();\n  const fuzzerNameFromPrompt = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Type a fuzzer name',\n  });\n  if (!fuzzerNameFromPrompt) {\n    println('Failed to get fuzzer name');\n    return;\n  }\n  fuzzerName = fuzzerNameFromPrompt.toString();\n  const secondsToRunInp = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Type the number of seconds to run the fuzzer',\n  });\n  if (!secondsToRunInp) {\n    return;\n  }\n  secondsToRun = secondsToRunInp.toString();\n\n  // Create an history object\n  const args = new Object({\n    projectName: projectNameArg,\n    fuzzerName: fuzzerName,\n    secondsToRun: secondsToRun,\n    fuzzerCorpusPath: '',\n  });\n\n  const commandObject = new Object({\n    commandType: 'oss-fuzz.RunFuzzer',\n    Arguments: args,\n    dispatcherFunc: cmdDispatchRunFuzzerHandler,\n  });\n  console.log('L1: ' + commandHistory.length);\n  commandHistory.push(commandObject);\n\n  await cmdDispatchRunFuzzerHandler(args);\n  return true;\n}\n\nasync function cmdDispatchRunFuzzerHandler(args: any) {\n  await runFuzzerHandler(\n    args.projectName,\n    args.fuzzerName,\n    args.secondsToRun,\n    args.fuzzerCorpusPath\n  );\n  return;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdSetOSSFuzzPath.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\n\nimport {println} from '../logger';\nimport {extensionConfig} from '../config';\n\n// Set the oss-fuzz path.\nexport async function setOssFuzzPath() {\n  println('Setting path');\n  const newOssFuzzPath = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Type path',\n  });\n  if (!newOssFuzzPath) {\n    println('Failed getting path');\n    return;\n  }\n\n  const fpathh = vscode.Uri.file(newOssFuzzPath);\n  let isValid = false;\n  try {\n    if (await vscode.workspace.fs.readDirectory(fpathh)) {\n      println('Is a directory');\n      const helperPathURI = vscode.Uri.file(\n        newOssFuzzPath + '/infra/helper.py'\n      );\n      if (await vscode.workspace.fs.readFile(helperPathURI)) {\n        println('Found helper file');\n        isValid = true;\n      }\n      isValid = true;\n    } else {\n      isValid = false;\n    }\n  } catch {\n    isValid = false;\n  }\n\n  if (isValid) {\n    extensionConfig.ossFuzzPepositoryWorkPath = newOssFuzzPath;\n  } else {\n    println('Not setting OSS-Fuzz path');\n  }\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdSetupCIFuzz.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nimport {println} from '../logger';\nimport {determineWorkspaceLanguage} from '../utils';\nimport {cifuzzGenerator} from '../cifuzz';\n\nexport async function setupCIFuzzHandler() {\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return false;\n  }\n\n  const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n\n  /**\n   * Go through GitHub workflows to find potential traces of CIFuzz\n   */\n  const githubWorkflowsPath = vscode.Uri.file(wsPath + '/.github/workflows');\n  try {\n    await vscode.workspace.fs.readDirectory(githubWorkflowsPath);\n  } catch {\n    println('Did not find a workflows path.');\n    return false;\n  }\n\n  for (const [name, type] of await vscode.workspace.fs.readDirectory(\n    githubWorkflowsPath\n  )) {\n    // Skip directories.\n    if (type === 2) {\n      continue;\n    }\n\n    // Read the files.\n    println('Is a file');\n    const workflowFile = vscode.Uri.file(wsPath + '/.github/workflows/' + name);\n    const doc = await vscode.workspace.openTextDocument(workflowFile);\n    if (doc.getText().includes('cifuzz')) {\n      println('Found existing CIFuzz, will not continue.');\n      return false;\n    }\n  }\n\n  println('Did not find CIFuzz, creating one.');\n  const projectName = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'OSS-Fuzz project name',\n  });\n  if (!projectName) {\n    println('Failed to get project name');\n    return false;\n  }\n\n  /*\n   * There is no CIFuzz found, so we create one.\n   */\n  // Determine the language of the workspace.\n  const targetLanguage = await determineWorkspaceLanguage();\n  println('Target language: ' + targetLanguage);\n\n  // Generate a CIFuzz workflow text.\n  const cifuzzWorkflowText = cifuzzGenerator(targetLanguage, projectName, 30);\n\n  // Create the CIFuzz .yml file and write the contents to it to path\n  // .github/workflows/cifuzz.yml\n  const cifuzzYml = vscode.Uri.file(wsPath + '/.github/workflows/cifuzz.yml');\n  const wsedit = new vscode.WorkspaceEdit();\n  wsedit.createFile(cifuzzYml, {ignoreIfExists: true});\n  wsedit.insert(cifuzzYml, new vscode.Position(0, 0), cifuzzWorkflowText);\n  vscode.workspace.applyEdit(wsedit);\n  return true;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdSetupFI.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {setUpFuzzIntrospector} from '../fuzzIntrospectorHelper';\n\n/**\n * Function for setting up Fuzz Introspector by way of a Python virtual env.\n */\nexport async function setUpFuzzIntrospectorHandler() {\n  setUpFuzzIntrospector();\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdSetupOSSFuzz.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {println} from '../logger';\nimport {extensionConfig} from '../config';\nimport {isPathValidOssFuzzPath} from '../ossfuzzWrappers';\nimport {systemSync} from '../utils';\n\n/**\n * Function for setting up oss-fuzz. This clones the relevant directory\n * and sets the oss-fuzz variable accordingly.\n */\nexport async function setUpOssFuzzHandler() {\n  println('Setting up oss-fuzz in /tmp/');\n\n  // First check if we already have an OSS-Fuzz path\n  const tmpOssFuzzRepositoryPath = '/tmp/oss-fuzz';\n\n  if ((await isPathValidOssFuzzPath(tmpOssFuzzRepositoryPath)) === true) {\n    println('OSS-Fuzz already exists in /tmp/oss-fuzz');\n    extensionConfig.ossFuzzPepositoryWorkPath = tmpOssFuzzRepositoryPath;\n    return;\n  }\n\n  const cmdToExec = 'git';\n  const args: Array<string> = [\n    'clone',\n    'https://github.com/google/oss-fuzz',\n    tmpOssFuzzRepositoryPath,\n  ];\n  const [res, output] = await systemSync(cmdToExec, args);\n  if (res === false) {\n    println('Failed to clone oss-fuzz');\n    println(output);\n    return;\n  }\n  println('Finished cloning oss-fuzz');\n\n  extensionConfig.ossFuzzPepositoryWorkPath = tmpOssFuzzRepositoryPath;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdTemplate.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Command for generating template fuzzers. This is a short-cut for rapid\n * prototyping as well as an archive for inspiration.\n */\nimport * as vscode from 'vscode';\nimport {println} from '../logger';\n\nexport const cLangSimpleStringFuzzer = `#include <stdint.h>\n#include <string.h>\n#include <stdlib.h>\n\nint \nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n    char *new_str = (char *)malloc(size+1);\n    if (new_str == NULL){\n        return 0;\n    }\n    memcpy(new_str, data, size);\n    new_str[size] = '\\\\0';\n\n    // Insert fuzzer contents here \n    // fuzz data in new_str\n\n    // end of fuzzer contents\n\n    free(new_str);\n    return 0;\n}`;\n\nconst cLangFileInputFuzzer = `int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n\tchar filename[256];\n\tsprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n  // Create a file on the filesystem with fuzzer data in it\n\tFILE *fp = fopen(filename, \"wb\");\n\tif (!fp) {\n\t\treturn 0;\n  }\n\tfwrite(data, size, 1, fp);\n\tfclose(fp);\n\n\t// Fuzzer logic here. Use the file as a source of data.\n\n\t// Fuzzer logic end\n\n  // Clean up the file.\n\tunlink(filename);\n\n\treturn 0;\n}`;\n\nconst cLangBareTemplateFuzzer = `int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n\treturn 0;\n}`;\n\nconst cppLangBareTemplateFuzzer = `extern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n\treturn 0;\n}`;\n\nconst cppLangStdStringTemplateFuzzer = `extern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  std::string input(reinterpret_cast<const char*>(data), size);\n\n  return 0;\n}`;\n\nexport const cppLangFDPTemplateFuzzer = `#include <fuzzer/FuzzedDataProvider.h>\n\n#include <string>\n\nextern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n  FuzzedDataProvider fdp(data, size);\n\n  // Extract higher level data types used for fuzzing, e.g.\n  // int ran_int = fdp.ConsumeIntegralInRange<int>(1, 1024);\n  // std::string s = fdp.ConsumeRandomLengthString();\n\n  return 0;\n}`;\n\nconst cppLangFileInputFuzzer = `extern \"C\" int\nLLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n{\n\tchar filename[256];\n\tsprintf(filename, \"/tmp/libfuzzer.%d\", getpid());\n\n\tFILE *fp = fopen(filename, \"wb\");\n\tif (!fp) {\n\t\treturn 0;\n  }\n\tfwrite(data, size, 1, fp);\n\tfclose(fp);\n\n\t// Fuzzer logic here\n\n\t// Fuzzer logic end\n\n\tunlink(filename);\n}`;\n\nconst pythonLangBareTemplate = `import sys\nimport atheris\n\n\ndef TestOneInput(fuzz_bytes):\n    return\n\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n    main()`;\n\nexport const pythonLangFileInputFuzzer = `import sys\nimport atheris\n\n@atheris.instrument_func\ndef TestOneInput(data):\n  # Write fuzz data to a file\n  with open('/tmp/fuzz_input.b') as f:\n    f.write(data)\n  \n  # Use '/tmp/fuzz_input.b' as input to file handling logic.\n\n  \ndef main():\n  atheris.instrument_all()\n  atheris.Setup(sys.argv, TestOneInput)\n  atheris.Fuzz()\n\n\nif __name__ == \"__main__\":\n  main()`;\n\nconst pythonLongFdpTemplate = `import sys\nimport atheris\n\ndef TestOneInput(fuzz_bytes):\n    fdp = atheris.FuzzedDataProvider(fuzz_bytes)\n    return\n\ndef main():\n    atheris.Setup(sys.argv, TestOneInput)\n    atheris.Fuzz()\n\nif __name__ == \"__main__\":\n    main()`;\n\nexport const javaLangBareTemplate = `import com.code_intelligence.jazzer.api.FuzzedDataProvider;\npublic class SampleFuzzer {\n  public static void fuzzerTestOneInput(FuzzedDataProvider fdp) {\n    // Use fdp to create arbitrary types seeded with fuzz data\n  }\n}\n`;\n\n/**\n * C templates\n */\nasync function cTemplates() {\n  let template = '';\n  const result = await vscode.window.showQuickPick(\n    ['Bare template', 'Null-terminated string input', 'File input'],\n    {\n      placeHolder: 'Pick which template',\n    }\n  );\n  vscode.window.showInformationMessage(`Got: ${result}`);\n\n  if (result === 'Null-terminated string input') {\n    template = cLangSimpleStringFuzzer;\n  } else if (result === 'File input') {\n    template = cLangFileInputFuzzer;\n  } else if (result === 'Bare template') {\n    template = cLangBareTemplateFuzzer;\n  } else {\n    template = 'empty';\n  }\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return;\n  }\n\n  const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n\n  const cifuzzYml = vscode.Uri.file(wsPath + '/oss-fuzz-template.c');\n  const wsedit = new vscode.WorkspaceEdit();\n  wsedit.createFile(cifuzzYml, {ignoreIfExists: true});\n  wsedit.insert(cifuzzYml, new vscode.Position(0, 0), template);\n  vscode.workspace.applyEdit(wsedit);\n  return;\n}\n\n/**\n * CPP templates\n */\nasync function cppTemplates() {\n  let template = '';\n  const result = await vscode.window.showQuickPick(\n    [\n      'Bare template',\n      'Simple CPP string',\n      'File input fuzzer',\n      'Fuzzed data provider',\n    ],\n    {\n      placeHolder: 'Pick which template',\n    }\n  );\n  vscode.window.showInformationMessage(`Got: ${result}`);\n\n  if (result === 'Bare template') {\n    template = cppLangBareTemplateFuzzer;\n  } else if (result === 'Simple CPP string') {\n    template = cppLangStdStringTemplateFuzzer;\n  } else if (result === 'File input fuzzer') {\n    template = cppLangFileInputFuzzer;\n  } else if (result === 'Fuzzed data provider') {\n    template = cppLangFDPTemplateFuzzer;\n  } else {\n    template = 'empty';\n  }\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return;\n  }\n\n  const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n\n  const cifuzzYml = vscode.Uri.file(wsPath + '/oss-fuzz-template.cpp');\n  const wsedit = new vscode.WorkspaceEdit();\n  wsedit.createFile(cifuzzYml, {ignoreIfExists: true});\n  wsedit.insert(cifuzzYml, new vscode.Position(0, 0), template);\n  vscode.workspace.applyEdit(wsedit);\n  return;\n}\n\n/**\n * Python templates\n */\nasync function pythonTepmlates() {\n  let template = '';\n  const result = await vscode.window.showQuickPick(\n    ['Bare template', 'Fuzzed Data Provider', 'File input fuzzer'],\n    {\n      placeHolder: 'Pick which template',\n    }\n  );\n  vscode.window.showInformationMessage(`Got: ${result}`);\n\n  if (result === 'Fuzzed Data Provider') {\n    template = pythonLongFdpTemplate;\n  } else if (result === 'Bare template') {\n    template = pythonLangBareTemplate;\n  } else if (result === 'File input fuzzer') {\n    template = pythonLangFileInputFuzzer;\n  } else {\n    template = 'empty';\n  }\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return;\n  }\n\n  const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n\n  const cifuzzYml = vscode.Uri.file(wsPath + '/oss-fuzz-template.py');\n  const wsedit = new vscode.WorkspaceEdit();\n  wsedit.createFile(cifuzzYml, {ignoreIfExists: true});\n  wsedit.insert(cifuzzYml, new vscode.Position(0, 0), template);\n  vscode.workspace.applyEdit(wsedit);\n  return;\n}\n\n/**\n * Java templates\n */\nasync function javaTemplates() {\n  let template = '';\n  const result = await vscode.window.showQuickPick(['Bare template'], {\n    placeHolder: 'Pick which template',\n  });\n  vscode.window.showInformationMessage(`Got: ${result}`);\n\n  if (result === 'Bare template') {\n    template = javaLangBareTemplate;\n  } else {\n    template = 'empty';\n  }\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return;\n  }\n\n  const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n\n  const cifuzzYml = vscode.Uri.file(wsPath + '/oss-fuzz-template.java');\n  const wsedit = new vscode.WorkspaceEdit();\n  wsedit.createFile(cifuzzYml, {ignoreIfExists: true});\n  wsedit.insert(cifuzzYml, new vscode.Position(0, 0), template);\n  vscode.workspace.applyEdit(wsedit);\n  return;\n}\n\nexport async function cmdDispatcherTemplate(context: vscode.ExtensionContext) {\n  println('Creating template');\n  const options: {\n    [key: string]: (context: vscode.ExtensionContext) => Promise<void>;\n  } = {\n    C: cTemplates,\n    CPP: cppTemplates,\n    Python: pythonTepmlates,\n    Java: javaTemplates,\n  };\n\n  const quickPick = vscode.window.createQuickPick();\n  quickPick.items = Object.keys(options).map(label => ({label}));\n  quickPick.onDidChangeSelection(selection => {\n    if (selection[0]) {\n      options[selection[0].label](context).catch(console.error);\n    }\n  });\n  quickPick.onDidHide(() => quickPick.dispose());\n  quickPick.placeholder = 'Pick language';\n  quickPick.show();\n\n  return;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdTestFuzzer.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nimport {println} from '../logger';\nimport {runFuzzerHandler, buildFuzzersFromWorkspace} from '../ossfuzzWrappers';\nimport {setStatusText} from '../utils';\nimport {commandHistory} from '../commandUtils';\nimport {extensionConfig} from '../config';\n\n/**\n * Does an end-to-end test of a project/fuzzer. This is done by\n * first building the project and then running the fuzzer.\n * @param context\n * @returns\n */\n\nexport async function cmdInputCollectorTestFuzzer() {\n  setStatusText('Testing specific fuzzer: getting input');\n  // Get the project name and fuzzer name to test.\n  const ossFuzzProjectNameInput = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'The OSS-Fuzz project name',\n  });\n  if (!ossFuzzProjectNameInput) {\n    println('Did not get a ossFuzzTargetProject');\n    return;\n  }\n  println('Project name: ' + ossFuzzProjectNameInput);\n\n  // Get the fuzzer to run\n  const fuzzerNameInput = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Type a fuzzer name',\n  });\n  if (!fuzzerNameInput) {\n    println('Failed to get fuzzer name');\n    return;\n  }\n\n  // Create the args object for the dispatcher\n  const args = new Object({\n    projectName: ossFuzzProjectNameInput.toString(),\n    fuzzerName: fuzzerNameInput.toString(),\n  });\n\n  // Create a dispatcher object.\n  const commandObject = new Object({\n    commandType: 'oss-fuzz.TestFuzzer',\n    Arguments: args,\n    dispatcherFunc: cmdDispatchTestFuzzerHandler,\n  });\n  commandHistory.push(commandObject);\n\n  await cmdDispatchTestFuzzerHandler(args);\n}\n\nasync function cmdDispatchTestFuzzerHandler(args: any) {\n  // Build the project\n  setStatusText('Test specific fuzzer: building fuzzers in workspace');\n  if (!(await buildFuzzersFromWorkspace(args.projectName, '', false))) {\n    println('Build projects');\n    return;\n  }\n\n  // Run the fuzzer for 10 seconds\n  println('Running fuzzer');\n  setStatusText('Test specific fuzzer: running fuzzer ' + args.fuzzerName);\n  await runFuzzerHandler(\n    args.projectName,\n    args.fuzzerName,\n    extensionConfig.numberOfSecondsForTestRuns.toString(),\n    ''\n  );\n  setStatusText('Test specific fuzzer: test completed of ' + args.fuzzerName);\n  return;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/commands/cmdTestFuzzerCFLite.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport path = require('path');\nimport * as vscode from 'vscode';\nimport {println} from '../logger';\nimport {\n  runFuzzerHandlerCFLite,\n  buildFuzzersFromWorkspaceClusterfuzzLite,\n} from '../ossfuzzWrappers';\nimport {setStatusText} from '../utils';\nimport {commandHistory} from '../commandUtils';\nimport {extensionConfig} from '../config';\n\n/**\n * Does an end-to-end test of a project/fuzzer. This is done by\n * first building the project and then running the fuzzer.\n * @param context\n * @returns\n */\n\nexport async function cmdInputCollectorTestFuzzerCFLite() {\n  setStatusText('Testing specific fuzzer: getting input');\n  // Get the fuzzer to run\n  const fuzzerNameInput = await vscode.window.showInputBox({\n    value: '',\n    placeHolder: 'Type a fuzzer name',\n  });\n  if (!fuzzerNameInput) {\n    println('Failed to get fuzzer name');\n    return;\n  }\n\n  // Create the args object for the dispatcher\n  const args = new Object({\n    fuzzerName: fuzzerNameInput.toString(),\n  });\n\n  // Create a dispatcher object.\n  const commandObject = new Object({\n    commandType: 'oss-fuzz.TestFuzzerCFLite',\n    Arguments: args,\n    dispatcherFunc: cmdDispatchTestFuzzerHandlerCFLite,\n  });\n  commandHistory.push(commandObject);\n\n  await cmdDispatchTestFuzzerHandlerCFLite(args);\n}\n\nasync function cmdDispatchTestFuzzerHandlerCFLite(args: any) {\n  // Build the project\n  setStatusText('Test specific fuzzer: building fuzzers in workspace');\n  if (!(await buildFuzzersFromWorkspaceClusterfuzzLite())) {\n    println('Build projects');\n    return;\n  }\n\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return;\n  }\n\n  const pathOfLocal = workspaceFolder[0].uri.path;\n  println('path of local: ' + pathOfLocal);\n\n  // Run the fuzzer for 10 seconds\n  println('Running fuzzer');\n  setStatusText('Test specific fuzzer: running fuzzer ' + args.fuzzerName);\n  await runFuzzerHandlerCFLite(\n    pathOfLocal,\n    args.fuzzerName,\n    extensionConfig.numberOfSecondsForTestRuns.toString()\n  );\n  setStatusText('Test specific fuzzer: test completed of ' + args.fuzzerName);\n  return;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/config.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport {println} from './logger';\n\nexport class ExtensionConfig {\n  /** Path to the repository that will be used. */\n  ossFuzzPepositoryWorkPath: string = '/tmp/oss-fuzz';\n\n  /** The directory where crash info is stored. */\n  crashesDirectory = process.env.HOME + '/oss-fuzz-crashes';\n\n  /** Number of seconds used for running quick test fuzzers */\n  numberOfSecondsForTestRuns = 20;\n\n  async printConfig() {\n    println('Config:');\n    println('- OSS-Fuzz repository path: ' + this.ossFuzzPepositoryWorkPath);\n    println('- Crashes directory: ' + this.crashesDirectory);\n    println('- numberOfSecondsForTestRuns: ' + this.numberOfSecondsForTestRuns);\n  }\n}\n\nexport const extensionConfig = new ExtensionConfig();\n"
  },
  {
    "path": "tools/vscode-extension/src/coverageHelper.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nimport {Uri} from 'vscode';\nimport {println} from './logger';\nimport {\n  getOSSFuzzCloudURL,\n  getLocalOutBuildDir,\n  downloadRemoteURL,\n} from './utils';\n\nconst path = require('path');\nlet isCodeCoverageEnabled = false;\n\n// create a decorator type that we use to decorate small numbers\nconst codeCoveredLineDecorationType =\n  vscode.window.createTextEditorDecorationType({\n    backgroundColor: '#184916',\n    overviewRulerColor: 'blue',\n    overviewRulerLane: vscode.OverviewRulerLane.Right,\n    light: {\n      // this color will be used in light color themes\n      borderColor: 'darkblue',\n    },\n    dark: {\n      // this color will be used in dark color themes\n      borderColor: 'lightblue',\n    },\n  });\n\nconst missingLineDecorationType = vscode.window.createTextEditorDecorationType({\n  backgroundColor: '#6C2B34',\n  overviewRulerColor: 'blue',\n  overviewRulerLane: vscode.OverviewRulerLane.Right,\n  light: {\n    // this color will be used in light color themes\n    borderColor: 'darkblue',\n  },\n  dark: {\n    // this color will be used in dark color themes\n    borderColor: 'lightblue',\n  },\n});\n\nexport async function loadSummaryJsonCoverage(\n  context: vscode.ExtensionContext,\n  codeCoverageFile: Uri\n) {\n  const coverageSummaryRawJson = await vscode.workspace.openTextDocument(\n    codeCoverageFile\n  );\n  const jsonCodeCoverage = JSON.parse(coverageSummaryRawJson.getText());\n  return jsonCodeCoverage;\n}\n\nexport async function compareLocalToRemoteCoverage(\n  context: vscode.ExtensionContext,\n  projectName: string\n) {\n  println('Checking the file matching');\n  /* Get the coverage from the remote server */\n  const urlString =\n    (await getOSSFuzzCloudURL(projectName)) + '/linux/summary.json';\n\n  println('URL: ' + urlString);\n  const codeCoverageFile: false | vscode.Uri = await downloadRemoteURL(\n    urlString,\n    'summary.json',\n    context\n  );\n  if (!codeCoverageFile) {\n    println('Could not get the coverage summary file');\n    return;\n  }\n  const remoteCoverage = await loadSummaryJsonCoverage(\n    context,\n    codeCoverageFile\n  );\n\n  /* Get the local coverage report */\n  // Compare the local coverage to the upstream coverage\n  const localSummaryCovPath =\n    (await getLocalOutBuildDir(projectName)) + '/report/linux/summary.json';\n  const localCodeCoverage = await loadSummaryJsonCoverage(\n    context,\n    vscode.Uri.file(localSummaryCovPath)\n  );\n\n  for (let i = 0; i < localCodeCoverage.data[0].files.length; i++) {\n    for (let j = 0; j < remoteCoverage.data[0].files.length; j++) {\n      // Get the file dictionary\n      const localFileData = localCodeCoverage.data[0].files[i];\n      const remoteFileData = remoteCoverage.data[0].files[j];\n\n      // If the filepaths are the same, then we match coverage data\n      if (localFileData.filename === remoteFileData.filename) {\n        const remoteFuncCount = remoteFileData.summary.functions.count;\n        const localFuncCount = localFileData.summary.functions.count;\n\n        if (localFuncCount > remoteFuncCount) {\n          println(\n            'Coverage improved in :' +\n              localFileData.filename +\n              ' [' +\n              localFuncCount +\n              ' : ' +\n              remoteFuncCount +\n              ']'\n          );\n        }\n      }\n    }\n  }\n}\n\n/**\n *\n * @param context Adds visualisation to the editor based on reading a code coverage file.\n * @param codeCoverageFile\n */\nexport async function loadCoverageIntoWorkspace(\n  context: vscode.ExtensionContext,\n  codeCoverageFile: Uri\n) {\n  isCodeCoverageEnabled = true;\n\n  const doc3 = await vscode.workspace.openTextDocument(codeCoverageFile);\n  const jsonCodeCoverageObj3 = JSON.parse(doc3.getText());\n\n  const codeCoverageMappingWithCoverage = new Map();\n  const codeCoverageMapMissingCoverage = new Map();\n\n  Object.entries(jsonCodeCoverageObj3['files']).forEach(entry => {\n    const [key, value] = entry;\n    println(key);\n    const filename = path.parse(key).base;\n    println('Filename base: ' + filename);\n    const objectDictionary: any = value as any;\n    const linesWithCodeCoverage: unknown[] = [];\n    println(objectDictionary['executed_lines']);\n    Object.entries(objectDictionary['executed_lines']).forEach(entryInner => {\n      const lineNumber = entryInner[1];\n      //println(\"executed line: \" + lineNumber);\n      linesWithCodeCoverage.push(lineNumber);\n    });\n    codeCoverageMappingWithCoverage.set(filename, linesWithCodeCoverage);\n\n    const linesMissingCodeCoverage: unknown[] = [];\n    Object.entries(objectDictionary['missing_lines']).forEach(entryInner => {\n      const lineNumber = entryInner[1];\n      //println(\"executed line: \" + line_numb);\n      linesMissingCodeCoverage.push(lineNumber);\n    });\n    codeCoverageMapMissingCoverage.set(filename, linesMissingCodeCoverage);\n  });\n  println('=========>');\n\n  println('Enabling code coverage decorator');\n  println('decorator sample is activated');\n\n  let timeout: NodeJS.Timer | undefined = undefined;\n\n  // create a decorator type that we use to decorate large numbers\n\n  let activeEditor = vscode.window.activeTextEditor;\n\n  function updateDecorations(\n    linesWithCodeCoverage: any,\n    linesWithoNoCodeCoverage: any\n  ) {\n    if (!isCodeCoverageEnabled) {\n      return;\n    }\n    if (!activeEditor) {\n      return;\n    }\n    println('Filename');\n    println(activeEditor.document.fileName);\n\n    // Current file opened in the editor.\n    const nameOfCurrentFile = path.parse(activeEditor.document.fileName).base;\n\n    println('Base filename: ' + nameOfCurrentFile);\n    println('Done filename');\n    const lineNumbersWithCoverage: vscode.DecorationOptions[] = [];\n    const missingLineNumbers: vscode.DecorationOptions[] = [];\n\n    if (linesWithCodeCoverage.has(nameOfCurrentFile)) {\n      println('Has this file');\n      const elemWithCov = linesWithCodeCoverage.get(nameOfCurrentFile);\n      for (let idx = 0; idx < elemWithCov.length; idx++) {\n        const lineNo = elemWithCov[idx];\n        println('Setting up: ' + lineNo);\n        lineNumbersWithCoverage.push({\n          range: new vscode.Range(lineNo - 1, 0, lineNo, 0),\n        });\n      }\n\n      const elemNoCov = linesWithoNoCodeCoverage.get(nameOfCurrentFile);\n      for (let idx = 0; idx < elemNoCov.length; idx++) {\n        const lineNo = elemNoCov[idx];\n        println('Setting up: ' + lineNo);\n        missingLineNumbers.push({\n          range: new vscode.Range(lineNo - 1, 0, lineNo, 0),\n        });\n      }\n    } else {\n      println('Does not have this file');\n    }\n\n    activeEditor.setDecorations(\n      codeCoveredLineDecorationType,\n      lineNumbersWithCoverage\n    );\n    activeEditor.setDecorations(missingLineDecorationType, missingLineNumbers);\n    //activeEditor.setDecorations(largeNumberDecorationType, largeNumbers);\n  }\n\n  function triggerUpdateDecorations(\n    throttle = false,\n    covMap: any,\n    covMisMap: any\n  ) {\n    if (timeout) {\n      clearTimeout(timeout);\n      timeout = undefined;\n    }\n    if (throttle) {\n      //timeout = setTimeout(updateDecorations, 500);\n      updateDecorations(covMap, covMisMap);\n    } else {\n      updateDecorations(covMap, covMisMap);\n    }\n  }\n\n  if (activeEditor) {\n    triggerUpdateDecorations(\n      false,\n      codeCoverageMappingWithCoverage,\n      codeCoverageMapMissingCoverage\n    );\n  }\n\n  vscode.window.onDidChangeActiveTextEditor(\n    editor => {\n      activeEditor = editor;\n      if (editor) {\n        triggerUpdateDecorations(\n          false,\n          codeCoverageMappingWithCoverage,\n          codeCoverageMapMissingCoverage\n        );\n      }\n    },\n    null,\n    context.subscriptions\n  );\n\n  vscode.workspace.onDidChangeTextDocument(\n    event => {\n      if (activeEditor && event.document === activeEditor.document) {\n        triggerUpdateDecorations(\n          true,\n          codeCoverageMappingWithCoverage,\n          codeCoverageMapMissingCoverage\n        );\n      }\n    },\n    null,\n    context.subscriptions\n  );\n}\n\n/**\n * Removes the values from the mappings used to track code coverage. As a\n * result, the visualisation disappears.\n */\nexport async function clearCoverage() {\n  // Set global indicator.\n  const activeEditor = vscode.window.activeTextEditor;\n  isCodeCoverageEnabled = false;\n  if (activeEditor) {\n    activeEditor.setDecorations(codeCoveredLineDecorationType, []);\n    activeEditor.setDecorations(missingLineDecorationType, []);\n  }\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/extension.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\n\nimport {clearCoverage} from './coverageHelper';\nimport {println} from './logger';\n\n// Import the command dispatcher functions\nimport {cmdInputCollectorRunSpecificFuzzer} from './commands/cmdRunFuzzer';\nimport {cmdInputCollectorBuildFuzzersFromWorkspace} from './commands/cmdBuildFuzzerFromWorkspace';\nimport {cmdInputCollectorBuildFuzzersFromWorkspaceCFLite} from './commands/cmdBuildFuzzerFromWorkspaceCFLite';\nimport {cmdInputCollectorTestFuzzerCFLite} from './commands/cmdTestFuzzerCFLite';\nimport {cmdDispatcherRe} from './commands/cmdRedo';\nimport {setupCIFuzzHandler} from './commands/cmdSetupCIFuzz';\nimport {cmdInputCollectorTestFuzzer} from './commands/cmdTestFuzzer';\nimport {displayCodeCoverageFromOssFuzz} from './commands/cmdDisplayCoverage';\nimport {createOssFuzzSetup} from './commands/cmdCreateOSSFuzzSetup';\nimport {runEndToEndAndGetCoverage} from './commands/cmdEndToEndCoverage';\nimport {listFuzzersHandler} from './commands/cmdListFuzzers';\nimport {cmdInputCollectorReproduceTestcase} from './commands/cmdReproduceTestcase';\nimport {cmdDispatcherTemplate} from './commands/cmdTemplate';\nimport {runGetOptimalTargetsHandler} from './commands/cmdFIGetOptimalTargets';\nimport {setUpFuzzIntrospectorHandler} from './commands/cmdSetupFI';\nimport {runFuzzIntrospectorHandler} from './commands/cmdRunFI';\nimport {cmdDispatcherGenerateClusterfuzzLite} from './commands/cmdDispatcherGenerateClusterfuzzLite';\nimport {setUpOssFuzzHandler} from './commands/cmdSetupOSSFuzz';\nimport {setOssFuzzPath} from './commands/cmdSetOSSFuzzPath';\nimport {extensionConfig} from './config';\n\n/**\n * Extension entrypoint. Activate the extension and register the commands.\n */\nexport function activate(context: vscode.ExtensionContext) {\n  console.log('Activating extension)');\n  extensionConfig.printConfig();\n  println('OSS-Fuzz extension is now active!');\n\n  // Command registration\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.SetUp', async () => {\n      println('CMD start: SetUp');\n      await setUpOssFuzzHandler();\n      println('CMD end: SetUp');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.RunFuzzer', async () => {\n      println('CMD start: Run Fuzzer');\n      //await runFuzzerHandler('', '', '', '');\n      cmdInputCollectorRunSpecificFuzzer();\n      println('CMD end: Run Fuzzer');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.ListFuzzers', async () => {\n      println('CMD start: ListFuzzers');\n      await listFuzzersHandler();\n      println('CMD end: ListFuzzers');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.SetOSSFuzzPath', async () => {\n      println('CMD start: SetOSSFuzzPath');\n      await setOssFuzzPath();\n      println('CMD end: SetOSSFuzzPath');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.GetCodeCoverage', async () => {\n      println('CMD start: GetCodeCoverage');\n      await displayCodeCoverageFromOssFuzz(context);\n      println('CMD end: GetCodeCoverage');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.ClearCodeCoverage', async () => {\n      println('CMD start: ClearCodeCoverage');\n      await clearCoverage();\n      println('CMD end: ClearCodeCoverage');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.CreateOSSFuzzSetup', async () => {\n      println('CMD start: CreateOSSFuzzSetup');\n      await createOssFuzzSetup();\n      println('CMD end: CreateOSSFuzzSetup');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.WSBuildFuzzers', async () => {\n      println('CMD start: WSBuildFuzzers3');\n      await cmdInputCollectorBuildFuzzersFromWorkspace();\n      println('CMD end: WSBuildFuzzers4');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.SetupCIFuzz', async () => {\n      println('CMD start: SetupCIFuzz');\n      await setupCIFuzzHandler();\n      println('CMD end: SetupCIFuzz');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.testFuzzer', async () => {\n      println('CMD start: testFuzzer');\n      await cmdInputCollectorTestFuzzer();\n      println('CMD end: testFuzzer');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.testCodeCoverage', async () => {\n      println('CMD start: testCodeCoverage');\n      await runEndToEndAndGetCoverage(context);\n      println('CMD end: testCodeCoverage');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.Reproduce', async () => {\n      println('CMD start: Reproduce');\n      await cmdInputCollectorReproduceTestcase();\n      println('CMD end: Reproduce');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.Redo', async () => {\n      println('CMD start: Re');\n      await cmdDispatcherRe();\n      println('CMD end: Re');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.Template', async () => {\n      println('CMD start: remplate');\n      await cmdDispatcherTemplate(context);\n      println('CMD end: template');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand(\n      'oss-fuzz.GenerateClusterfuzzLite',\n      async () => {\n        println('CMD start: GenerateClusterfuzzLite');\n        await cmdDispatcherGenerateClusterfuzzLite(context);\n        println('CMD end: GenerateClusterfuzzLite');\n      }\n    )\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand(\n      'oss-fuzz.WSBuildFuzzersCFLite',\n      async () => {\n        println('CMD start: WSBuildFuzzersCFLite');\n        await cmdInputCollectorBuildFuzzersFromWorkspaceCFLite();\n        println('CMD end: WSBuildFuzzersCFLite');\n      }\n    )\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.testFuzzerCFLite', async () => {\n      println('CMD start: testFuzzerCFLite');\n      await cmdInputCollectorTestFuzzerCFLite();\n      println('CMD end: testFuzzerCFLite');\n    })\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand(\n      'oss-fuzz.setupFuzzIntrospector',\n      async () => {\n        println('CMD start: setup FI');\n        await setUpFuzzIntrospectorHandler();\n      }\n    )\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand(\n      'oss-fuzz.runFuzzIntrospector',\n      async () => {\n        println('CMD start: run Fuzz Introspector');\n        await runFuzzIntrospectorHandler();\n      }\n    )\n  );\n\n  context.subscriptions.push(\n    vscode.commands.registerCommand('oss-fuzz.GetOptimalTargets', async () => {\n      println('CMD start: run GetOptimalTargets');\n      await runGetOptimalTargetsHandler();\n    })\n  );\n}\n\n// This method is called when your extension is deactivated\nexport function deactivate() {\n  println('Deactivating the extension');\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/fuzzIntrospectorHelper.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\n\nimport {println} from './logger';\nimport {extensionConfig} from './config';\nimport {isPathValidOssFuzzPath} from './ossfuzzWrappers';\nimport {systemSync} from './utils';\n\nconst fs = require('fs');\n\nexport async function setUpFuzzIntrospector() {\n  println('Setting up oss-fuzz in /tmp/');\n\n  // First check if we already have Fuzz Introspector installed.\n  const tmpOssFuzzRepositoryPath = '/tmp/fi-tmp-env';\n\n  if ((await isPathValidOssFuzzPath(tmpOssFuzzRepositoryPath)) === true) {\n    println('Fuzz Introspector virtual env already exists in /tmp/fi-tmp-env');\n    extensionConfig.ossFuzzPepositoryWorkPath = tmpOssFuzzRepositoryPath;\n    return;\n  }\n\n  const cmdToExec = 'python3.11';\n  const args: Array<string> = ['-m', 'virtualenv', tmpOssFuzzRepositoryPath];\n  const [res, output] = await systemSync(cmdToExec, args);\n  if (res === false) {\n    println('Failed to create virtual environment');\n    println(output);\n    return;\n  }\n\n  const cmdToExec2 = '/tmp/fi-tmp-env/bin/python3.11';\n  const args2: Array<string> = [\n    '-m',\n    'pip',\n    'install',\n    'fuzz-introspector==0.1.6',\n  ];\n  const [res2, output2] = await systemSync(cmdToExec2, args2);\n  if (res2 === false) {\n    println('Failed to create virtual environment');\n    println(output2);\n    return;\n  }\n}\n\nexport async function runFuzzIntrospector() {\n  println('Setting up oss-fuzz in /tmp/');\n\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return;\n  }\n  const pathOfLocal = workspaceFolder[0].uri.fsPath;\n  println('path of local: ' + pathOfLocal);\n\n  // First check if we already have Fuzz Introspector installed.\n  const tmpOssFuzzRepositoryPath = '/tmp/fi-tmp-env';\n\n  if ((await isPathValidOssFuzzPath(tmpOssFuzzRepositoryPath)) === true) {\n    println('Fuzz Introspector virtual env already exists in /tmp/fi-tmp-env');\n    extensionConfig.ossFuzzPepositoryWorkPath = tmpOssFuzzRepositoryPath;\n    return;\n  }\n\n  await systemSync('mkdir', ['-p', '/tmp/out-fi/']);\n\n  const cmdToExec = '/tmp/fi-tmp-env/bin/fuzz-introspector';\n  const args: Array<string> = [\n    'full',\n    '--target_dir=' + pathOfLocal,\n    '--out-dir=/tmp/out-fi',\n  ];\n  const [res, output] = await systemSync(cmdToExec, args);\n  if (res === false) {\n    println('Failed run FI');\n    println(output);\n    return;\n  }\n}\n\nexport async function getOptimalTargetsFromIntrospector() {\n  if (!fs.existsSync('/tmp/out-fi/summary.json')) {\n    println('There are no introspector reports. Please run introspector first');\n  }\n  const json_data = fs.readFileSync('/tmp/out-fi/summary.json');\n  // println(json_data);\n\n  const jsonCodeCoverage = JSON.parse(json_data);\n\n  println('Optimal targets');\n  Object.entries(jsonCodeCoverage['analyses']['OptimalTargets']).forEach(\n    entry => {\n      const [key, value] = entry;\n      const objectDictionary: any = value as any;\n      println(JSON.stringify(objectDictionary, null, 2));\n    }\n  );\n  println('--------------------------');\n\n  return;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/logger.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nexport const vscodeOutputChannel =\n  vscode.window.createOutputChannel('oss-fuzz');\n\nexport function println(line: string) {\n  vscodeOutputChannel.appendLine(line);\n}\n\nexport function printRaw(line: string) {\n  vscodeOutputChannel.append(line);\n}\n\nexport function debugPrintln(line: string) {\n  console.log(line);\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/ossfuzzWrappers.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst fs = require('fs');\nimport * as vscode from 'vscode';\nimport {\n  hasOssFuzzInWorkspace,\n  getOssFuzzWorkspaceProjectName,\n  listFuzzersForProject,\n  systemSyncLogIfFailure,\n} from './utils';\nimport {println} from './logger';\nimport {extensionConfig} from './config';\n\nexport async function buildFuzzersFromWorkspaceClusterfuzzLite() {\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    println('No workspace folder, exiting');\n    return false;\n  }\n\n  // Build the fuzzers using OSS-Fuzz infrastructure.\n  const cmdToExec = 'python3';\n  const args = [\n    extensionConfig.ossFuzzPepositoryWorkPath + '/infra/helper.py',\n    'build_fuzzers',\n  ];\n\n  args.push('--external');\n  args.push(workspaceFolder[0].uri.path);\n  println('Building fuzzers');\n  if (!(await systemSyncLogIfFailure(cmdToExec, args))) {\n    println('Failed to build fuzzers');\n    return false;\n  }\n  return true;\n}\n\n/**\n * Builds the fuzzers for a given workspace.\n *\n * There are two options:\n *  1) The fuzzers are build using the OSS-Fuzz set up in the folder\n *  2) The fuzzers are build using the workspace and then copies that over.\n */\nexport async function buildFuzzersFromWorkspace(\n  projectNameArg: string,\n  sanitizer: string,\n  toClean: boolean\n) {\n  // println('Building fuzzers locally');\n\n  // Check if there is an OSS-Fuzz set up, and exit if not.\n  if (\n    (await isPathValidOssFuzzPath(\n      extensionConfig.ossFuzzPepositoryWorkPath\n    )) === false\n  ) {\n    println('No valid oss-fuzz path');\n    return false;\n  }\n\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    println('No workspace folder, exiting');\n    return false;\n  }\n\n  let ossFuzzProjectName = '';\n  if (await hasOssFuzzInWorkspace()) {\n    /**\n     * The fuzzers are in the workspace, as opposed to e.g. the oss-fuzz dirctory.\n     */\n    ossFuzzProjectName = await getOssFuzzWorkspaceProjectName();\n\n    /**\n     * The workspace has an OSS-Fuzz directory. We use this for the build.\n     * This is done by copying over the relevant files to the oss-fuzz repository\n     * folder. Notice that we will do a forceful copy overwriting the existing\n     * project foler if it exists.\n     */\n    println('Found project folder: ' + ossFuzzProjectName);\n\n    // Copy over the workspace oss-fuzz set up to the oss-fuzz folder.\n    let cmdToExec = 'cp';\n    let args: Array<string> = [\n      '-rfT',\n      workspaceFolder[0].uri.path + '/OSS-Fuzz/' + ossFuzzProjectName,\n      extensionConfig.ossFuzzPepositoryWorkPath +\n        '/projects/' +\n        ossFuzzProjectName +\n        '/',\n    ];\n\n    if (!(await systemSyncLogIfFailure(cmdToExec, args))) {\n      println('Failed to copy project');\n      return false;\n    }\n\n    // Build the fuzzers using OSS-Fuzz infrastructure.\n    cmdToExec = 'python3';\n    args = [\n      extensionConfig.ossFuzzPepositoryWorkPath + '/infra/helper.py',\n      'build_fuzzers',\n    ];\n    println('DECIDING ABOUT SANITIZER');\n    if (sanitizer !== '') {\n      println('ADDING CODE COVERAGE SANITIZER');\n      args.push('--sanitizer=' + sanitizer);\n    }\n\n    if (toClean) {\n      args.push('--clean');\n    }\n\n    args.push(ossFuzzProjectName);\n    println('Building fuzzers');\n    if (!(await systemSyncLogIfFailure(cmdToExec, args))) {\n      println('Failed to build fuzzers');\n      return false;\n    }\n  } else {\n    ossFuzzProjectName = projectNameArg;\n\n    const targetOssFuzzProject = vscode.Uri.file(\n      extensionConfig.ossFuzzPepositoryWorkPath +\n        '/projects/' +\n        ossFuzzProjectName\n    );\n    // Check if the folder exists.\n    let projectHasOssFuzzFolder = false;\n    try {\n      await vscode.workspace.fs.readDirectory(targetOssFuzzProject);\n      projectHasOssFuzzFolder = true;\n    } catch {\n      projectHasOssFuzzFolder = false;\n    }\n\n    /**\n     * The workspace does not have a OSS-Fuzz specific folder but has\n     * a folder in the OSS-Fuzz/projects/* directory. As such, we build\n     * the project using that build.sh set up, but, instead of cloning\n     * the repository we mount the workspace root onto what would normally\n     * be cloned.\n     */\n    if (projectHasOssFuzzFolder) {\n      // println('Found a target directory');\n\n      // Build the fuzzers using OSS-Fuzz infrastructure.\n      // First, Set up a temporary workpath that will be cleanup after\n      const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n      const cmdToExec2 = 'cp';\n      const temporaryProjectPath =\n        extensionConfig.ossFuzzPepositoryWorkPath +\n        '/projects/' +\n        ossFuzzProjectName +\n        '/temporary-project';\n\n      const args2: Array<string> = [\n        '-rfT',\n        wsPath.toString(),\n        temporaryProjectPath,\n      ];\n\n      if (!(await systemSyncLogIfFailure(cmdToExec2, args2))) {\n        println('Failed to build fuzzers');\n        return false;\n      }\n\n      //const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n      const temporaryDockerPath =\n        extensionConfig.ossFuzzPepositoryWorkPath +\n        '/projects/' +\n        ossFuzzProjectName +\n        '/Dockerfile';\n      const temporaryDockerPath2 =\n        extensionConfig.ossFuzzPepositoryWorkPath +\n        '/projects/' +\n        ossFuzzProjectName +\n        '/Dockerfile2';\n\n      const args3: Array<string> = [temporaryDockerPath, temporaryDockerPath2];\n      if (!(await systemSyncLogIfFailure('cp', args3))) {\n        println('Failed to copy Dockerfile');\n        return false;\n      }\n\n      // Append COPY command to Dockerfile\n      fs.appendFileSync(\n        temporaryDockerPath,\n        'COPY temporary-project /src/' + ossFuzzProjectName\n      );\n\n      // Second, build the actual fuzzers using the temporarily created project path for mount.\n      const cmdToExec = 'python3';\n      const args = [\n        extensionConfig.ossFuzzPepositoryWorkPath + '/infra/helper.py',\n        'build_fuzzers', // command\n      ];\n\n      // Add sanitizer if needed.\n      if (sanitizer !== '') {\n        args.push('--sanitizer=' + sanitizer);\n      }\n\n      // Add clean flag if needed.\n      if (toClean) {\n        args.push('--clean');\n      }\n\n      args.push(ossFuzzProjectName);\n      /*\n      Previously we used OSS-Fuzz logic that supports mounting paths for getting\n      the workspace into the Dockerfile.\n      This approach, however, has limitations in that most builds will modify\n      the contents of the folder they're working in. This can cause issues and also\n      make it not possible to build several versions of the project with changing\n      sanitizers in a sequence. As such, we disbanded.\n      */\n      println('Building fuzzers');\n      if (!(await systemSyncLogIfFailure(cmdToExec, args))) {\n        println('Failed to copy Dockerfile');\n        // Move back the modified Dockerfile\n        const args5: Array<string> = [\n          temporaryDockerPath2,\n          temporaryDockerPath,\n        ];\n        if (!(await systemSyncLogIfFailure('mv', args5))) {\n          println('Failed to copy back Dockerfile');\n          return false;\n        }\n        return false;\n      }\n\n      // Move back the modified Dockerfile\n      const args5: Array<string> = [temporaryDockerPath2, temporaryDockerPath];\n      if (!(await systemSyncLogIfFailure('mv', args5))) {\n        println('Failed to copy back Dockerfile');\n        return false;\n      }\n    } else {\n      println('OSS-Fuzz does not have the relevant project folder');\n      return false;\n    }\n  }\n\n  // If we go to here we successfully build the project. Give information.\n  vscode.window.showInformationMessage('Successfully build project');\n\n  // List the fuzzers build\n  await listFuzzersForProject(\n    ossFuzzProjectName,\n    extensionConfig.ossFuzzPepositoryWorkPath\n  );\n  return true;\n}\n\n/**\n * Runs the fuzzer for a given CFLite project\n */\nexport async function runFuzzerHandlerCFLite(\n  projectNameArg: string,\n  fuzzerNameArg: string,\n  secondsToRunArg: string\n) {\n  // The fuzzer is run by way of OSS-Fuzz's helper.py so we use python3 to launch\n  // this script.\n  const cmdToExec = 'python3';\n\n  // Set the arguments correctly. The ordering here is important for compatibility\n  // with the underlying argparse used by OSS-Fuzz helper.py.\n  const args: Array<string> = [\n    extensionConfig.ossFuzzPepositoryWorkPath + '/infra/helper.py',\n    'run_fuzzer',\n  ];\n\n  args.push('--external');\n  args.push(projectNameArg);\n  args.push(fuzzerNameArg);\n  args.push('--');\n  args.push('-max_total_time=' + secondsToRunArg);\n\n  println(\n    'Running fuzzer' +\n      fuzzerNameArg +\n      ' from project ' +\n      projectNameArg +\n      ' for ' +\n      secondsToRunArg +\n      ' seconds.'\n  );\n\n  // Run the actual command\n  if (!(await systemSyncLogIfFailure(cmdToExec, args))) {\n    println('Failed to run fuzzer');\n    return false;\n  }\n  return true;\n}\n\n/**\n * Runs the fuzzer for a given project.\n */\nexport async function runFuzzerHandler(\n  projectNameArg: string,\n  fuzzerNameArg: string,\n  secondsToRunArg: string,\n  fuzzerCorpusPath: string\n) {\n  // Check there is a valid OSS-Fuzz path. If not, bail out.\n  if (\n    (await isPathValidOssFuzzPath(\n      extensionConfig.ossFuzzPepositoryWorkPath\n    )) === false\n  ) {\n    println('Missing valid OSS-Fuzz path.');\n    return;\n  }\n  // The fuzzer is run by way of OSS-Fuzz's helper.py so we use python3 to launch\n  // this script.\n  const cmdToExec = 'python3';\n\n  // Set the arguments correctly. The ordering here is important for compatibility\n  // with the underlying argparse used by OSS-Fuzz helper.py.\n  const args: Array<string> = [\n    extensionConfig.ossFuzzPepositoryWorkPath + '/infra/helper.py',\n    'run_fuzzer',\n  ];\n  if (fuzzerCorpusPath !== '') {\n    args.push('--corpus-dir');\n    args.push(fuzzerCorpusPath);\n  }\n  args.push(projectNameArg);\n  args.push(fuzzerNameArg);\n  args.push('--');\n  args.push('-max_total_time=' + secondsToRunArg);\n\n  println(\n    'Running fuzzer' +\n      fuzzerNameArg +\n      ' from project ' +\n      projectNameArg +\n      ' for ' +\n      secondsToRunArg +\n      ' seconds.'\n  );\n\n  // Run the actual command\n  if (!(await systemSyncLogIfFailure(cmdToExec, args))) {\n    println('Failed to run fuzzer');\n    return false;\n  }\n  return true;\n}\n\n// Validates if a directory is a valid oss-fuzz path.\nexport async function isPathValidOssFuzzPath(path: string) {\n  try {\n    if (await vscode.workspace.fs.readDirectory(vscode.Uri.file(path))) {\n      // println('Is a directory');\n      // const helperPath = vscode.Uri.file(path + '/infra/helper.py');\n      const helperPath = path + '/infra/helper.py';\n      //console.log('Checking ' + helperPath.toString());\n      if (fs.existsSync(helperPath.toString())) {\n        return true;\n      }\n    }\n  } catch {\n    /* empty */\n  }\n  return false;\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/projectIntegrationHelper.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nconst fs = require('fs');\nimport path = require('path');\nimport {println} from './logger';\nimport * as fuzzTemplate from './commands/cmdTemplate';\n\nexport async function setupProjectInitialFiles(isClusterfuzzLite: boolean) {\n  const wsedit = new vscode.WorkspaceEdit();\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  let projectGithubRepository = '';\n\n  const isOssFuzz = isClusterfuzzLite === false;\n\n  // Get the repository if this is not ClusterfuzzLite\n  if (isOssFuzz) {\n    const tmpProjectGithubRepository = await vscode.window.showInputBox({\n      value: '',\n      placeHolder: 'Github repository for the project.',\n    });\n    if (!tmpProjectGithubRepository) {\n      return false;\n    }\n    projectGithubRepository = tmpProjectGithubRepository;\n  }\n\n  const projectNameFromRepo = path\n    .parse(projectGithubRepository)\n    .base.toLocaleLowerCase();\n\n  let pathOfLocal = '';\n  if (workspaceFolder) {\n    pathOfLocal = path\n      .parse(workspaceFolder[0].uri.fsPath)\n      .base.toLocaleLowerCase();\n    println('path of local: ' + pathOfLocal);\n  }\n  if (isOssFuzz) {\n    println('Derived project name: ' + projectNameFromRepo);\n  }\n\n  const pythonFiles = await vscode.workspace.findFiles('**/*.py');\n  const cppFiles = await vscode.workspace.findFiles('**/*.c++');\n  const cppFiles2 = await vscode.workspace.findFiles('**/*.cpp');\n  const cppFiles3 = await vscode.workspace.findFiles('**/*.cc');\n  const cfiles = await vscode.workspace.findFiles('**/*.c');\n  const hfiles = await vscode.workspace.findFiles('**/*.h');\n  const rustFiles = await vscode.workspace.findFiles('**/*.rust');\n  const golangFiles = await vscode.workspace.findFiles('**/*.go');\n  const javaFiles = await vscode.workspace.findFiles('**/*.java');\n\n  println('Number of python files: ' + pythonFiles.length);\n  println('Number of C++ files: ' + cppFiles.length + cppFiles2.length);\n  println('Number of C files: ' + cfiles.length);\n  println('Number of rustFiles files: ' + rustFiles.length);\n  println('Number of golangFiles files: ' + golangFiles.length);\n  println('Number of H files: ' + hfiles.length);\n\n  const cppFilesCount = cppFiles.length + cppFiles2.length + cppFiles3.length;\n\n  const maxCount = Math.max(\n    pythonFiles.length,\n    cppFilesCount,\n    cfiles.length,\n    rustFiles.length,\n    golangFiles.length,\n    javaFiles.length\n  );\n  let target = '';\n  if (maxCount > 0) {\n    if (maxCount === pythonFiles.length) {\n      target = 'python';\n    } else if (maxCount === cppFilesCount) {\n      target = 'cpp';\n    } else if (maxCount === cfiles.length) {\n      target = 'c';\n    } else if (maxCount === javaFiles.length) {\n      target = 'java';\n    } else {\n      println('Target is not implemented');\n      return true;\n    }\n  } else {\n    if (hfiles.length > 0) {\n      target = 'cpp';\n    } else {\n      return true;\n    }\n  }\n\n  println('Target language: ' + target);\n\n  let baseFolder = '.clusterfuzzlite';\n  if (isOssFuzz) {\n    baseFolder = 'OSS-Fuzz';\n  }\n\n  if (workspaceFolder) {\n    const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n\n    // Create workflow file for ClusterFuzzLite\n    if (isOssFuzz === false) {\n      println('Creating the workflow file');\n      const clusterfuzzWorkflowFile = vscode.Uri.file(\n        wsPath + '/' + '.github' + '/' + 'workflows/cflite_pr.yml'\n      );\n\n      let tmp_target = target;\n      if (tmp_target === 'cpp') {\n        tmp_target = 'c++';\n      }\n\n      //println('Workflow pth: ' + clusterfuzzWorkflowFile);\n\n      const cflite_workflow_yaml = `name: ClusterFuzzLite PR fuzzing\non:\n  workflow_dispatch:\n  pull_request:\n    branches: [ main ]\npermissions: read-all\njobs:\n  PR:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        sanitizer: [address]\n    steps:\n    - name: Build Fuzzers (\\${{ matrix.sanitizer }})\n      id: build\n      uses: google/clusterfuzzlite/actions/build_fuzzers@v1\n      with:\n        sanitizer: \\${{ matrix.sanitizer }}\n        language: ${tmp_target}\n        bad-build-check: false\n    - name: Run Fuzzers (\\${{ matrix.sanitizer }})\n      id: run\n      uses: google/clusterfuzzlite/actions/run_fuzzers@v1\n      with:\n        github-token: \\${{ secrets.GITHUB_TOKEN }}\n        fuzz-seconds: 100\n        mode: 'code-change'\n        report-unreproducible-crashes: false\n        sanitizer: \\${{ matrix.sanitizer }}\n`;\n\n      // Create the file and add the contents\n      if (fs.existsSync(clusterfuzzWorkflowFile.path) === false) {\n        wsedit.createFile(clusterfuzzWorkflowFile, {ignoreIfExists: true});\n        wsedit.insert(\n          clusterfuzzWorkflowFile,\n          new vscode.Position(0, 0),\n          cflite_workflow_yaml\n        );\n      }\n    }\n\n    const ossfuzzDockerFilepath = vscode.Uri.file(\n      wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/Dockerfile'\n    );\n\n    vscode.window.showInformationMessage(ossfuzzDockerFilepath.toString());\n    //wsedit.createFile(ossfuzzDockerFilepath, {ignoreIfExists: true});\n\n    if (target === 'python') {\n      await setupPythonProjectInitialFiles(\n        projectGithubRepository,\n        projectNameFromRepo,\n        ossfuzzDockerFilepath,\n        wsedit,\n        wsPath,\n        baseFolder,\n        pathOfLocal,\n        isOssFuzz\n      );\n    }\n    if (target === 'cpp') {\n      await setupCPPProjectInitialFiles(\n        projectGithubRepository,\n        projectNameFromRepo,\n        ossfuzzDockerFilepath,\n        wsedit,\n        wsPath,\n        baseFolder,\n        pathOfLocal,\n        isOssFuzz\n      );\n    }\n    if (target === 'c') {\n      await setupCProjectInitialFiles(\n        projectGithubRepository,\n        projectNameFromRepo,\n        ossfuzzDockerFilepath,\n        wsedit,\n        wsPath,\n        baseFolder,\n        pathOfLocal,\n        isOssFuzz\n      );\n    }\n    if (target === 'java') {\n      await setupJavaProjectInitialFiles(\n        projectGithubRepository,\n        projectNameFromRepo,\n        ossfuzzDockerFilepath,\n        wsedit,\n        wsPath,\n        baseFolder,\n        isOssFuzz\n      );\n    }\n    vscode.workspace.applyEdit(wsedit);\n    vscode.window.showInformationMessage('Created a new file: hello/world.md');\n  }\n  return true;\n}\n\nfunction createProjectYamlContent(\n  wsedit: vscode.WorkspaceEdit,\n  wsPath: string,\n  baseFolder: string,\n  isOssFuzz: boolean,\n  projectGithubRepository: string,\n  projectNameFromRepo: string,\n  language: string\n) {\n  const projectYamlFilepath = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/project.yaml'\n  );\n  if (fs.existsSync(projectYamlFilepath.path) === false) {\n    vscode.window.showInformationMessage(projectYamlFilepath.toString());\n    wsedit.createFile(projectYamlFilepath, {ignoreIfExists: true});\n    const projectYamlTemplate = `homepage: \"${projectGithubRepository}\"\nlanguage: ${language}\nprimary_contact: \"<primary_contact_email>\"\nmain_repo: \"${projectGithubRepository}\"\nfile_github_issue: true\n    `;\n\n    const projectYamlTemplateCFLite = `language: ${language}`;\n\n    const yamlContentToWrite = isOssFuzz\n      ? projectYamlTemplate\n      : projectYamlTemplateCFLite;\n\n    wsedit.insert(\n      projectYamlFilepath,\n      new vscode.Position(0, 0),\n      yamlContentToWrite\n    );\n  }\n}\n\nfunction getLicenseHeader() {\n  const todaysDate = new Date();\n  const currentYear = todaysDate.getFullYear();\n\n  const licenseHeader = `# Copyright ${currentYear} Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n`;\n\n  return licenseHeader;\n}\n\nfunction getBaseDockerFile(language: string) {\n  const languageToBasebuilder: {[id: string]: string} = {\n    java: 'gcr.io/oss-fuzz-base/base-builder-jvm',\n    cpp: 'gcr.io/oss-fuzz-base/base-builder',\n    c: 'gcr.io/oss-fuzz-base/base-builder',\n    python: 'gcr.io/oss-fuzz-base/base-builder-python',\n  };\n  let dockerFileContent = getLicenseHeader();\n  dockerFileContent += '\\n' + 'FROM ' + languageToBasebuilder[language] + '\\n';\n\n  return dockerFileContent;\n}\n\nfunction createReadmeFile(\n  wsedit: vscode.WorkspaceEdit,\n  wsPath: string,\n  baseFolder: string,\n  isOssFuzz: boolean\n) {\n  const readmeFile = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + '/README.md'\n  );\n  //vscode.window.showInformationMessage(readmeFile.toString());\n  if (fs.existsSync(readmeFile.path) === false) {\n    const readmeContents = `# OSS-Fuzz set up\nThis folder is the OSS-Fuzz set up.\n    `;\n\n    const readmeContentsCFLite = `# ClusterFuzzLite set up\nThis folder contains a fuzzing set for [ClusterFuzzLite](https://google.github.io/clusterfuzzlite).\n        `;\n\n    const readmeContentsToWrite = isOssFuzz\n      ? readmeContents\n      : readmeContentsCFLite;\n\n    wsedit.createFile(readmeFile, {ignoreIfExists: true});\n\n    wsedit.insert(readmeFile, new vscode.Position(0, 0), readmeContentsToWrite);\n  }\n}\n\nasync function setupJavaProjectInitialFiles(\n  projectGithubRepository: string,\n  projectNameFromRepo: string,\n  ossfuzzDockerFilepath: vscode.Uri,\n  wsedit: vscode.WorkspaceEdit,\n  wsPath: string,\n  baseFolder: string,\n  isOssFuzz: boolean\n) {\n  // Dockerfile\n  const dockerfileTemplate =\n    getBaseDockerFile('java') +\n    ` \nRUN curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip && \\\\\n    unzip maven.zip -d $SRC/maven && \\\\\n    rm -rf maven.zip\n\nENV MVN $SRC/maven/apache-maven-3.6.3/bin/mvn\nRUN git clone --depth 1 ${projectGithubRepository} ${projectNameFromRepo}\nWORKDIR ${projectNameFromRepo}\nCOPY build.sh *.java $SRC/`;\n  wsedit.insert(\n    ossfuzzDockerFilepath,\n    new vscode.Position(0, 0),\n    dockerfileTemplate\n  );\n\n  // build.sh\n  const ossfuzzBuildFilepath = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/build.sh'\n  );\n  vscode.window.showInformationMessage(ossfuzzBuildFilepath.toString());\n  wsedit.createFile(ossfuzzBuildFilepath, {ignoreIfExists: true});\n  const buildTemplate =\n    `#!/bin/bash -eu\n  ` +\n    getLicenseHeader() +\n    `\n# Supply build instructions\n# Copy all fuzzer executables to $OUT/\n`;\n  wsedit.insert(ossfuzzBuildFilepath, new vscode.Position(0, 0), buildTemplate);\n\n  // project.yaml\n  createProjectYamlContent(\n    wsedit,\n    wsPath,\n    baseFolder,\n    isOssFuzz,\n    projectGithubRepository,\n    projectNameFromRepo,\n    'jvm'\n  );\n\n  /* Sample template fuzzer */\n  const sampleFuzzFile = vscode.Uri.file(\n    wsPath +\n      '/' +\n      baseFolder +\n      '/' +\n      projectNameFromRepo +\n      '/fuzzer_example.java'\n  );\n\n  wsedit.createFile(sampleFuzzFile, {ignoreIfExists: true});\n  const sampleFuzzFileContents = fuzzTemplate.javaLangBareTemplate;\n\n  wsedit.insert(\n    sampleFuzzFile,\n    new vscode.Position(0, 0),\n    sampleFuzzFileContents\n  );\n\n  createReadmeFile(wsedit, wsPath, baseFolder, isOssFuzz);\n}\n\nasync function setupCProjectInitialFiles(\n  projectGithubRepository: string,\n  projectNameFromRepo: string,\n  ossfuzzDockerFilepath: vscode.Uri,\n  wsedit: vscode.WorkspaceEdit,\n  wsPath: string,\n  baseFolder: string,\n  baseName: string,\n  isOssFuzz: boolean\n) {\n  // Dockerfile\n  if (fs.existsSync(ossfuzzDockerFilepath.path) === false) {\n    const dockerfileTemplate =\n      getBaseDockerFile('cpp') +\n      `\nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 ${projectGithubRepository} ${projectNameFromRepo}\nWORKDIR ${projectNameFromRepo}\nCOPY build.sh *.cpp $SRC/`;\n\n    const dockerfileTemplateClusterfuzzLite = `FROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\nCOPY . $SRC/${baseName}\nCOPY .clusterfuzzlite/build.sh $SRC/build.sh\nWORKDIR $SRC/${baseName}`;\n\n    const contentToWrite = isOssFuzz\n      ? dockerfileTemplate\n      : dockerfileTemplateClusterfuzzLite;\n\n    // Create the file and add the contents\n    wsedit.createFile(ossfuzzDockerFilepath, {ignoreIfExists: true});\n    wsedit.insert(\n      ossfuzzDockerFilepath,\n      new vscode.Position(0, 0),\n      contentToWrite\n    );\n  }\n\n  // build.sh\n  const ossfuzzBuildFilepath = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/build.sh'\n  );\n  // Only create the build file if it doesn't exist\n  if (fs.existsSync(ossfuzzBuildFilepath.path) === false) {\n    vscode.window.showInformationMessage(ossfuzzBuildFilepath.toString());\n    wsedit.createFile(ossfuzzBuildFilepath, {ignoreIfExists: true});\n    const buildTemplate =\n      `#!/bin/bash -eu\n  ` +\n      getLicenseHeader() +\n      `\n# Supply build instructions\n# Use the following environment variables to build the code\n# $CXX:               c++ compiler\n# $CC:                c compiler\n# CFLAGS:             compiler flags for C files\n# CXXFLAGS:           compiler flags for CPP files\n# LIB_FUZZING_ENGINE: linker flag for fuzzing harnesses\n\n# Copy all fuzzer executables to $OUT/\n$CXX $CFLAGS $LIB_FUZZING_ENGINE $SRC/fuzzer_example.c -o $OUT/fuzzer_example\n`;\n\n    const buildTemplateClusterfuzzLite = `#!/bin/bash -eu\n# Supply build instructions\n# Use the following environment variables to build the code\n# $CXX:               c++ compiler\n# $CC:                c compiler\n# CFLAGS:             compiler flags for C files\n# CXXFLAGS:           compiler flags for CPP files\n# LIB_FUZZING_ENGINE: linker flag for fuzzing harnesses\n\n# Copy all fuzzer executables to $OUT/\n$CC $CFLAGS $LIB_FUZZING_ENGINE \\\\\n  $SRC/${baseName}/.clusterfuzzlite/fuzzer_example.c \\\\\n  -o $OUT/fuzzer_example\n`;\n\n    const buildContent = isOssFuzz\n      ? buildTemplate\n      : buildTemplateClusterfuzzLite;\n    wsedit.insert(\n      ossfuzzBuildFilepath,\n      new vscode.Position(0, 0),\n      buildContent\n    );\n  }\n\n  // project.yaml\n  createProjectYamlContent(\n    wsedit,\n    wsPath,\n    baseFolder,\n    isOssFuzz,\n    projectGithubRepository,\n    projectNameFromRepo,\n    'c'\n  );\n\n  /* Sample template fuzzer */\n  const sampleFuzzFile = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/fuzzer_example.c'\n  );\n  if (fs.existsSync(sampleFuzzFile.path) === false) {\n    wsedit.createFile(sampleFuzzFile, {ignoreIfExists: true});\n    const sampleFuzzFileContents = fuzzTemplate.cLangSimpleStringFuzzer;\n\n    wsedit.insert(\n      sampleFuzzFile,\n      new vscode.Position(0, 0),\n      sampleFuzzFileContents\n    );\n  }\n\n  createReadmeFile(wsedit, wsPath, baseFolder, isOssFuzz);\n}\n\nasync function setupCPPProjectInitialFiles(\n  projectGithubRepository: string,\n  projectNameFromRepo: string,\n  ossfuzzDockerFilepath: vscode.Uri,\n  wsedit: vscode.WorkspaceEdit,\n  wsPath: string,\n  baseFolder: string,\n  baseName: string,\n  isOssFuzz: boolean\n) {\n  // Dockerfile\n  // Only create a new Dockerfile if it doesn't already exist\n  if (fs.existsSync(ossfuzzDockerFilepath.path) === false) {\n    const dockerfileTemplate =\n      getBaseDockerFile('cpp') +\n      ` \nRUN apt-get update && apt-get install -y make autoconf automake libtool\nRUN git clone --depth 1 ${projectGithubRepository} ${projectNameFromRepo}\nWORKDIR ${projectNameFromRepo}\nCOPY build.sh *.cpp $SRC/`;\n\n    const dockerfileTemplateClusterfuzzLite = `FROM gcr.io/oss-fuzz-base/base-builder\nRUN apt-get update && apt-get install -y make autoconf automake libtool\n\nCOPY . $SRC/${baseName}\nCOPY .clusterfuzzlite/build.sh $SRC/build.sh\nWORKDIR $SRC/${baseName}`;\n\n    const contentToWrite = isOssFuzz\n      ? dockerfileTemplate\n      : dockerfileTemplateClusterfuzzLite;\n\n    // Create the file and add the contents\n    wsedit.createFile(ossfuzzDockerFilepath, {ignoreIfExists: true});\n    wsedit.insert(\n      ossfuzzDockerFilepath,\n      new vscode.Position(0, 0),\n      contentToWrite\n    );\n  }\n\n  // build.sh\n  const ossfuzzBuildFilepath = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/build.sh'\n  );\n  // Only create the build file if it doesn't exist\n  if (fs.existsSync(ossfuzzBuildFilepath.path) === false) {\n    vscode.window.showInformationMessage(ossfuzzBuildFilepath.toString());\n    wsedit.createFile(ossfuzzBuildFilepath, {ignoreIfExists: true});\n    const buildTemplate =\n      `#!/bin/bash -eu\n  ` +\n      getLicenseHeader() +\n      `\n# Supply build instructions\n# Use the following environment variables to build the code\n# $CXX:               c++ compiler\n# $CC:                c compiler\n# CFLAGS:             compiler flags for C files\n# CXXFLAGS:           compiler flags for CPP files\n# LIB_FUZZING_ENGINE: linker flag for fuzzing harnesses\n\n# Copy all fuzzer executables to $OUT/\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/fuzzer_example.cpp -o $OUT/fuzzer_example\n`;\n    const buildTemplateClusterfuzzLite = `#!/bin/bash -eu\n# Supply build instructions\n# Use the following environment variables to build the code\n# $CXX:               c++ compiler\n# $CC:                c compiler\n# CFLAGS:             compiler flags for C files\n# CXXFLAGS:           compiler flags for CPP files\n# LIB_FUZZING_ENGINE: linker flag for fuzzing harnesses\n\n# Copy all fuzzer executables to $OUT/\n$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \\\\\n  $SRC/${baseName}/.clusterfuzzlite/fuzzer_example.cpp \\\\\n  -o $OUT/fuzzer_example\n`;\n\n    const buildContent = isOssFuzz\n      ? buildTemplate\n      : buildTemplateClusterfuzzLite;\n    wsedit.insert(\n      ossfuzzBuildFilepath,\n      new vscode.Position(0, 0),\n      buildContent\n    );\n  }\n\n  // project.yaml\n  createProjectYamlContent(\n    wsedit,\n    wsPath,\n    baseFolder,\n    isOssFuzz,\n    projectGithubRepository,\n    projectNameFromRepo,\n    'c++'\n  );\n\n  /* Sample template fuzzer */\n  const sampleFuzzFile = vscode.Uri.file(\n    wsPath +\n      '/' +\n      baseFolder +\n      '/' +\n      projectNameFromRepo +\n      '/fuzzer_example.cpp'\n  );\n  if (fs.existsSync(sampleFuzzFile.path) === false) {\n    wsedit.createFile(sampleFuzzFile, {ignoreIfExists: true});\n    const sampleFuzzFileContents = fuzzTemplate.cppLangFDPTemplateFuzzer;\n\n    wsedit.insert(\n      sampleFuzzFile,\n      new vscode.Position(0, 0),\n      sampleFuzzFileContents\n    );\n  }\n\n  createReadmeFile(wsedit, wsPath, baseFolder, isOssFuzz);\n}\n\nasync function setupPythonProjectInitialFiles(\n  projectGithubRepository: string,\n  projectNameFromRepo: string,\n  ossfuzzDockerFilepath: vscode.Uri,\n  wsedit: vscode.WorkspaceEdit,\n  wsPath: string,\n  baseFolder: string,\n  baseName: string,\n  isOssFuzz: boolean\n) {\n  // Only write to Dockerfile if it doesn't already exist\n  // Dockerfile\n  if (fs.existsSync(ossfuzzDockerFilepath.path) === false) {\n    const dockerfileTemplate =\n      getBaseDockerFile('python') +\n      ` \n  RUN python3 -m pip install --upgrade pip\n  RUN git clone --depth 1 ${projectGithubRepository} ${projectNameFromRepo}\n  WORKDIR ${projectNameFromRepo}\n  COPY build.sh *.py $SRC/`;\n\n    const dockerfileTemplateClusterfuzzLite =\n      getBaseDockerFile('python') +\n      ` \n  RUN apt-get update && apt-get install -y make autoconf automake libtool\n\n  COPY . $SRC/${baseName}\n  COPY .clusterfuzzlite/build.sh $SRC/build.sh\n  WORKDIR $SRC/${baseName}`;\n\n    const contentToWrite = isOssFuzz\n      ? dockerfileTemplate\n      : dockerfileTemplateClusterfuzzLite;\n\n    wsedit.insert(\n      ossfuzzDockerFilepath,\n      new vscode.Position(0, 0),\n      contentToWrite\n    );\n  }\n\n  // build.sh\n  const ossfuzzBuildFilepath = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/build.sh'\n  );\n  // Only create the build file if it doesn't exist\n  if (fs.existsSync(ossfuzzBuildFilepath.path) === false) {\n    vscode.window.showInformationMessage(ossfuzzBuildFilepath.toString());\n    wsedit.createFile(ossfuzzBuildFilepath, {ignoreIfExists: true});\n    const buildTemplate =\n      `#!/bin/bash -eu\n  ` +\n      getLicenseHeader() +\n      `\npython3 -m pip install .\n\n# Build fuzzers (files prefixed with fuzz_) to $OUT\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone`;\n\n    const buildTemplateClusterfuzzLite = `#!/bin/bash -eu\npython3 -m pip install .\n\n# Build fuzzers (files prefixed with fuzz_) to $OUT\nfor fuzzer in $(find $SRC -name 'fuzz_*.py'); do\n  compile_python_fuzzer $fuzzer\ndone`;\n\n    const buildContent = isOssFuzz\n      ? buildTemplate\n      : buildTemplateClusterfuzzLite;\n    wsedit.insert(\n      ossfuzzBuildFilepath,\n      new vscode.Position(0, 0),\n      buildContent\n    );\n  }\n\n  // project.yaml\n  createProjectYamlContent(\n    wsedit,\n    wsPath,\n    baseFolder,\n    isOssFuzz,\n    projectGithubRepository,\n    projectNameFromRepo,\n    'python'\n  );\n\n  // Sample template fuzzer\n  const sampleFuzzFile = vscode.Uri.file(\n    wsPath + '/' + baseFolder + '/' + projectNameFromRepo + '/fuzz_ex1.py'\n  );\n  if (fs.existsSync(sampleFuzzFile.path) === false) {\n    wsedit.createFile(sampleFuzzFile, {ignoreIfExists: true});\n    const sampleFuzzFileContents = fuzzTemplate.pythonLangFileInputFuzzer;\n\n    wsedit.insert(\n      sampleFuzzFile,\n      new vscode.Position(0, 0),\n      sampleFuzzFileContents\n    );\n  }\n\n  // README.md\n  createReadmeFile(wsedit, wsPath, baseFolder, isOssFuzz);\n}\n"
  },
  {
    "path": "tools/vscode-extension/src/utils.ts",
    "content": "// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nimport * as vscode from 'vscode';\nimport {extensionConfig} from './config';\nimport {getApi, FileDownloader} from '@microsoft/vscode-file-downloader-api';\n\nconst fs = require('fs');\nconst {spawn} = require('node:child_process');\nconst statusBarComp = vscode.window.createStatusBarItem(\n  vscode.StatusBarAlignment.Right,\n  100\n);\n\nimport {println, printRaw, debugPrintln} from './logger';\n\nexport async function setStatusText(statusText: string) {\n  //let myStatusBarItem: vscode.StatusBarItem;\n  statusBarComp.text = '$(megaphone) OSS-Fuzz: ' + statusText;\n  statusBarComp.show();\n}\n\nexport async function downloadRemoteURL(\n  urlString: string,\n  targetFile: string,\n  context: vscode.ExtensionContext\n) {\n  const fileDownloader: FileDownloader = await getApi();\n  println('URL: ' + urlString);\n  let codeCoverageFile: vscode.Uri;\n  try {\n    codeCoverageFile = await fileDownloader.downloadFile(\n      vscode.Uri.parse(urlString),\n      targetFile,\n      context\n    );\n  } catch (err) {\n    println('Could not get the coverage summary file');\n    return false;\n  }\n  return codeCoverageFile;\n}\n\nexport async function getLocalOutBuildDir(projectName: string) {\n  const summaryCovPath =\n    extensionConfig.ossFuzzPepositoryWorkPath + '/build/out/' + projectName;\n  return summaryCovPath;\n}\n\nexport async function getOSSFuzzCloudURL(projectName: string) {\n  const currentDate = new Date();\n  const yesterday = new Date(currentDate);\n  yesterday.setDate(yesterday.getDate() - 1);\n\n  const day = yesterday.getDate();\n  const month = yesterday.getMonth();\n  const year = yesterday.getFullYear();\n\n  let urlString =\n    'https://storage.googleapis.com/oss-fuzz-coverage/' +\n    projectName +\n    '/reports/' +\n    year.toString();\n\n  if (month < 10) {\n    urlString += '0';\n  }\n  urlString += month.toString();\n  if (day < 10) {\n    urlString += '0';\n  }\n  urlString += day.toString();\n\n  return urlString;\n}\n\n/**\n * Checks if the current workspace has a generated OSS-Fuzz folder. This is the\n * generated folder from our auto-generation capabilities.\n *\n * @returns boolean\n */\nexport async function hasOssFuzzInWorkspace() {\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n\n  if (!workspaceFolder) {\n    return false;\n  }\n\n  // Identify if the workspace folder has a OSS-Fuzz set up.\n  const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n  const ossfuzzDockerFilepath = vscode.Uri.file(wsPath + '/OSS-Fuzz/');\n  try {\n    if (await vscode.workspace.fs.readDirectory(ossfuzzDockerFilepath)) {\n      for (const [name, type] of await vscode.workspace.fs.readDirectory(\n        ossfuzzDockerFilepath\n      )) {\n        // If it's a directory then we know we have the project set up in there.\n        if (type === 2) {\n          // We assume this is the project folder for now.\n          println('Found the relevant directory: ' + name);\n          return true;\n        }\n      }\n    }\n  } catch {\n    /* empty */\n  }\n  return false;\n}\n\n/**\n * Gets the project name of the integrated OSS-Fuzz project.\n * @returns string\n */\nexport async function getOssFuzzWorkspaceProjectName() {\n  const workspaceFolder = vscode.workspace.workspaceFolders;\n  if (!workspaceFolder) {\n    return 'N/A';\n  }\n\n  // Identify if the workspace folder has a OSS-Fuzz set up.\n  const wsPath = workspaceFolder[0].uri.fsPath; // gets the path of the first workspace folder\n  const ossfuzzDockerFilepath = vscode.Uri.file(wsPath + '/OSS-Fuzz/');\n  try {\n    if (await vscode.workspace.fs.readDirectory(ossfuzzDockerFilepath)) {\n      for (const [name, type] of await vscode.workspace.fs.readDirectory(\n        ossfuzzDockerFilepath\n      )) {\n        if (type === 2) {\n          // println('Is a directory');\n          // We assume this is the project folder for now.\n          return name;\n        }\n      }\n    }\n  } catch {\n    /* empty */\n  }\n\n  return 'N/A';\n}\n\n/**\n * Lists the fuzzers available in the OSS-Fuzz build project.\n *\n * @param projectName\n * @param ossFuzzRepositoryPath\n * @returns\n */\nexport async function listFuzzersForProject(\n  projectName: string,\n  ossFuzzRepositoryPath: string\n) {\n  const projectOssFuzzBuildPath = vscode.Uri.file(\n    ossFuzzRepositoryPath + '/build/out/' + projectName\n  );\n  const fuzzersInProject: Array<string> = [];\n  for (const [name, type] of await vscode.workspace.fs.readDirectory(\n    projectOssFuzzBuildPath\n  )) {\n    // Is it a file?\n    if (type === 1) {\n      const filepath =\n        ossFuzzRepositoryPath + '/build/out/' + projectName + '/' + name;\n      const binary = fs.readFileSync(filepath);\n\n      // Check if fuzzer entrypoint exists in file. This is similar to how OSS-Fuzz\n      // checks whether a file is fuzzer or not.\n      if (binary.lastIndexOf('LLVMFuzzerTestOneInput') !== -1) {\n        fuzzersInProject.push(name);\n      }\n    }\n  }\n  println('Successfully build the project.');\n  println('The fuzzers in project');\n  for (const fuzzName of fuzzersInProject) {\n    println(fuzzName);\n  }\n  return fuzzersInProject;\n}\n\n/**\n * Helper functions for identifying the primary programming language of the workspace.\n *\n * This is achieved by identifying the suffix of files and then sorting\n * based on those with most of a given language supported by OSS-Fuzz.\n *\n * @returns\n */\nexport async function determineWorkspaceLanguage() {\n  const pythonFiles = await vscode.workspace.findFiles('**/*.py');\n  const cppFiles = await vscode.workspace.findFiles('**/*.c++');\n  const cfiles = await vscode.workspace.findFiles('**/*.c');\n  const rustFiles = await vscode.workspace.findFiles('**/*.rust');\n  const golangFiles = await vscode.workspace.findFiles('**/*.go');\n\n  println('Number of python files: ' + pythonFiles.length);\n  println('Number of C++ files: ' + cppFiles.length);\n  println('Number of C files: ' + cfiles.length);\n  println('Number of rustFiles files: ' + rustFiles.length);\n  println('Number of golangFiles files: ' + golangFiles.length);\n\n  const maxCount = Math.max(\n    pythonFiles.length,\n    cppFiles.length,\n    cfiles.length,\n    rustFiles.length,\n    golangFiles.length\n  );\n  let target = '';\n  if (maxCount === pythonFiles.length) {\n    target = 'python';\n  } else if (maxCount === cppFiles.length) {\n    target = 'c++';\n  } else if (maxCount === cfiles.length) {\n    target = 'c';\n  } else if (maxCount === rustFiles.length) {\n    target = 'rust';\n  } else if (maxCount === golangFiles.length) {\n    target = 'golang';\n  } else {\n    target = 'not implemented';\n  }\n\n  println('Target language: ' + target);\n  return target;\n}\n\n/**\n * Helper method to execute commands on the system.\n */\nexport async function systemSync(cmd: string, args: Array<string | undefined>) {\n  debugPrintln('Running command');\n  debugPrintln(cmd);\n  debugPrintln(args.toString());\n  debugPrintln('<<<<<<<<<<<<');\n\n  // Launch the command\n  const command = spawn(cmd, args);\n\n  // Callbacks for output events, to capture stdout and stderr live.\n  command.stdout.on('data', (x: {toString: () => string}) => {\n    printRaw(x.toString());\n  });\n  command.stderr.on('data', (x: {toString: () => string}) => {\n    printRaw(x.toString());\n  });\n\n  // Monitor for child exit.\n  let hasChildExited = 0;\n  let childExitCode = 0;\n  command.on('exit', (code: any, signal: any) => {\n    // println('child process exited with ' + `code ${code} and signal ${signal}`);\n    childExitCode = code;\n    hasChildExited = 1;\n  });\n\n  // Block until the child process has exited.\n  const snooze = (ms: number) =>\n    new Promise(resolve => setTimeout(resolve, ms));\n\n  let idx = 0;\n  const maxSeconds = 1800;\n  debugPrintln('Child exited: ' + hasChildExited);\n\n  // I think we can convert the following loop to a Promise wrapping the command\n  // exeuction. TODO(David).\n  while (hasChildExited === 0 && idx < maxSeconds) {\n    idx += 1;\n    await snooze(1000);\n  }\n\n  // Command execution is done, return appropriately if success/error.\n  if (childExitCode !== 0) {\n    println('Command execution errored');\n    return [false, command.toString()];\n  }\n  // println('Succes');\n  return [true, command.toString()];\n}\n\nexport async function systemSyncLogIfFailure(\n  cmd: string,\n  args: Array<string | undefined>\n): Promise<boolean> {\n  const [res, cmdMsg] = await systemSync(cmd, args);\n  if (res === false) {\n    println(cmdMsg);\n    return false;\n  }\n  return true;\n}\n"
  },
  {
    "path": "tools/vscode-extension/tsconfig.json",
    "content": "{\n  \"extends\": \"./node_modules/gts/tsconfig-google.json\",\n  \"compilerOptions\": {\n    \"rootDir\": \".\",\n    \"outDir\": \"build\"\n  },\n  \"include\": [\n    \"src/**/*.ts\",\n    \"test/**/*.ts\"\n  ]\n}\n"
  }
]